diff -Nru sdcc-3.1.0+dfsg/.version sdcc-3.2.0+dfsg/.version --- sdcc-3.1.0+dfsg/.version 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/.version 2012-06-16 21:42:29.000000000 +0000 @@ -1 +1 @@ -3.1.0 +3.2.0 diff -Nru sdcc-3.1.0+dfsg/ChangeLog sdcc-3.2.0+dfsg/ChangeLog --- sdcc-3.1.0+dfsg/ChangeLog 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/ChangeLog 2012-07-06 08:41:29.000000000 +0000 @@ -1,8 +1,3416 @@ +2012-07-06 Borut Razem + + * src/pic16/main.c: bug patched with sdcc-3.2.0-config_fix.diff + #3539804 - #pragma config and certain string constants, + thanks to Herbert Potzl + +2012-06-30 Borut Razem + + * support/scripts/sdcc.nsi: + fixed 'Installer suggest "C:\Program Files\SDCC" instead of + "C:\Program Files (x86)\SDCC"' problem + +2012-06-28 Philipp Klaus Krause + + * src/z80/peep.c: + Fix out-of-array read. + +2012-06-28 Maarten Brock + + * sdcc.sln, + * sdas/asrab/asrab.vcxproj: renamed output to sdasrab + * all.vcxproj: added sdasrab.exe and sdldrab.exe + * src/sdcc.vcxproj: removed parsing SDCC.y + * src/yacc.vcxproj: cosmetics + * sdas/as6808/m6808.h, + * sdas/as8051/i8051.h, + * sdas/asgb/gb.h, + * sdas/asrab/rabbit.h, + * sdas/asz80/z80.h: removed (conflicting) prototypes for machine and minit + * src/hc08/ralloc.c (packRegisters): fixed bug indicated by a warning + * src/pic14/gen.c (genDataPointerGet, genConstPointerGet), + * src/pic14/genarith.c (genAddLit), + * src/pic14/glue.c (pic14_constructAbsMap, emitInitVal) + * src/pic16/device.h (PIC16_device), + * src/pic16/gen.c (pic16_storeForReturn, genAnd, genXor, genAssign), + * src/pic16/glue.c (pic16_printIvalType, pic16_printIvalChar, + pic16_printIvalBitFields, pic16_printIvalUnion), + * src/z80/ralloc2.cc (iy_reserved, Ainst_ok, omit_frame_ptr): fixed warnings + +2012-06-27 Borut Razem + + * src/SDCC.lex: + unescape file names from preprocessor, 2nd and 3rd try + * device/non-free/lib/pic16/libdev/Makefile.am, + device/non-free/lib/pic16/libdev/Makefile.in, + device/non-free/lib/pic14/libdev/Makefile.in: + gputils supports all devices supported by SDCC + +2012-06-26 Borut Razem + + * src/SDCC.lex, src/SDCCerr.c, src/SDCCerr.h: + unescape file names from preprocessor + +2012-06-25 Borut Razem + + * src/regression/Makefile: + applied patch #3537593 - pic16 regression patch, + thanks to Don Wooton + +2012-06-24 Borut Razem + + * support/scripts/repack_release.sh: updated + +2012-06-24 Maarten Brock + + * src/mcs51/gen.c (genLeftShiftLiteral): commented out wassert to work + around bug 3537338 + + +2012-06-21 Borut Razem + + * device/non-free/lib/pic14/libdev/devices.txt, + device/non-free/lib/pic14/libdev/Makefile.in, + device/non-free/lib/pic14/libdev/pic16c782.c, + device/non-free/lib/pic14/libdev/pic16f676.c, + device/non-free/lib/pic14/libdev/pic16f1782.c, + device/non-free/lib/pic14/libdev/pic16c770.c, + device/non-free/lib/pic14/libdev/pic16f716.c, + device/non-free/lib/pic14/libdev/pic16f1503.c, + device/non-free/lib/pic14/libdev/pic16f1507.c, + device/non-free/lib/pic14/libdev/pic16f1783.c, + device/non-free/lib/pic14/libdev/pic16c771.c, + device/non-free/lib/pic14/libdev/pic16c925.c, + device/non-free/lib/pic14/libdev/pic16f1508.c, + device/non-free/lib/pic14/libdev/pic16f1823.c, + device/non-free/lib/pic14/libdev/pic16c432.c, + device/non-free/lib/pic14/libdev/pic16c717.c, + device/non-free/lib/pic14/libdev/pic16c781.c, + device/non-free/lib/pic14/libdev/pic12f675.c, + device/non-free/lib/pic14/libdev/pic16c926.c, + device/non-free/lib/pic14/libdev/pic16f1509.c, + device/non-free/lib/pic14/libdev/pic12f629.c, + device/non-free/lib/pic14/libdev/pic16f684.c, + device/non-free/lib/pic14/libdev/pic16f688.c, + device/non-free/lib/pic14/libdev/pic16f630.c, + device/non-free/lib/pic14/libdev/pic16f747.c, + device/non-free/lib/pic14/libdev/pic16c946.c, + device/non-free/include/pic14/pic16c782.h, + device/non-free/include/pic14/pic16f676.h, + device/non-free/include/pic14/pic16f1509.h, + device/non-free/include/pic14/pic16c770.h, + device/non-free/include/pic14/pic16f716.h, + device/non-free/include/pic14/pic16f1782.h, + device/non-free/include/pic14/pic16c771.h, + device/non-free/include/pic14/pic16c925.h, + device/non-free/include/pic14/pic16f1503.h, + device/non-free/include/pic14/pic16f1507.h, + device/non-free/include/pic14/pic16f1783.h, + device/non-free/include/pic14/pic16c432.h, + device/non-free/include/pic14/pic16c717.h, + device/non-free/include/pic14/pic16c781.h, + device/non-free/include/pic14/pic12f675.h, + device/non-free/include/pic14/pic16c926.h, + device/non-free/include/pic14/pic16f1508.h, + device/non-free/include/pic14/pic16f1823.h, + device/non-free/include/pic14/pic12f629.h, + device/non-free/include/pic14/pic16f684.h, + device/non-free/include/pic14/pic16f688.h, + device/non-free/include/pic14/pic16f630.h: + device/non-free/include/pic14/pic16f747.h: + device/non-free/include/pic14/pic16c946.h: + applied modified patch + #3536909 - "Pic14 device and header upgrade.", + thanks to Molnar Karoly + * support/scripts/inc2h.pl: applied modified patch + #3536022 - "Error in the inc2h.pl program.", + thanks to Molnar Karoly + * device/non-free/include/pic14/recreate.sh: + generate NO_LEGACY_NAMES block if exists in the old version + * src/pic14/genarith.c: applied patch + #3521376 - "pic14 incorrect asm op code", + thanks to Raphael Neider + +2012-06-21 Philipp Klaus Krause + + * src/SDCCralloc.hpp, + src/z80/ralloc2.c, + src/z80/ralloc.h: + Ugly hack to fix bug #3536902. + +2012-06-21 Leland Morrison + + * sim/ucsim/z80.src/inst_r2k.cc: + Fix flags for rl de, rr d, rr hl (merged by Philipp Klaus Krause from smallopts branch). + +2012-06-21 Philipp Klaus Krause + + * src/z80/gen.c: + Fix spilling of comitted pair after ex (sp), dd. + +2012-06-21 Maarten Brock + + * device/include/mcs51/cc2530.h: renamed TR0 to TESTREG0 + +2012-06-19 Philipp Klaus Krause + + * src/z80/peeph-z80.def, + src/z80/peeph-r2k.def: + Minor peephole fix. + +2012-06-18 Philipp Klaus Krause + + * src/SDCCopt.c, + src/hc08/ralloc.c: + Document relation between offsetFold() and packPointerOp(). + +2012-06-18 Borut Razem + + * doc/sdccman.lyx, device/include/pic14/pic14devices.txt, + device/non-free/lib/pic14/libdev/devices.txt, + device/non-free/lib/pic14/libdev/Makefile.in, + device/non-free/include/pic14/pic16f883.h, + device/non-free/include/pic14/pic16f884.h, + device/non-free/include/pic14/pic16f882.h, + device/non-free/lib/pic14/libdev/pic16f884.c, + device/non-free/lib/pic14/libdev/pic16f882.c, + device/non-free/lib/pic14/libdev/pic16f883.c: + applied patch #3531530 - new CPU support (pic16f882, 883, 884), + thanks to Molnar Karoly + +2012-06-17 Borut Razem + + * support/scripts/sdcc.nsi: + added removal of include\asm\r3ka\*.h + * device/non-free/include/pic14/pic16fam.h, + support/scripts/pic16fam-h-gen.pl: + applied patch #3531531 - The pic16fam-h-gen correction, + thanks to Molnar Karoly + * support/scripts/repack_release.sh: + remove unneeded directories produced by sdbinutils + +2012-06-17 Philipp Klaus Krause + + * src/SDCCerr.h, + src/SDCCerr.c, + src/SDCCval.c: + Warn when encountering long long literals. + +2012-06-16 Leland Morrison + + * sdas/asz80/z80mch.c: Change to report error for invalid operands + to z180 tst instruction. + +2012-06-09 Borut Razem + + * .version, sdcc.spec, doc/sdccman.lyx: + changed sdcc version to 3.2.0 + +2012-06-16 Philipp Klaus Krause + + * src/z80/gen.c: + Implement #3512989. + +2012-06-15 Philipp Klaus Krause + + * support/regression/ports/pic14/support.c: + Fix for renamed __asm. + * support/regression/tests/gcc-torture-execute-pr31169.c, + support/regression/tests/bitfields.c, + support/regression/tests/gcc-torture-execute-20100316-1.c, + support/regression/tests/gcc-torture-execute-pr38422.c, + support/regression/tests/gcc-torture-execute-921016-1.c: + Disable tests that use bitfields of size greater than 8 bits, which is not yet supproted by the pic16 port. + +2012-06-15 Philipp Klaus Krause + + * support/regression/tests/and_survive.c: + Test non-destructive and, regression test for #3534833. + * support/regression/tests/gcc-torture-execute-980707-1.c: + Adapted and enabled test for mcs51. + +2012-06-14 Philipp Klaus Krause + + * src/hc08/gen.c: + Fix cost calculation for branches. + +2012-06-13 Leland Morrison + + * sdas/asz80/z80mch.c: Allow the tst instruction for z180/.hd64 to + use the two operand form (tst a,X) (fixes bug #3534833) + +2012-06-12 Philipp Klaus Krause + + * src/SDCCicode.c: + Fix debug output for GET_VALUE_AT_ADDRESS right operand. + +2012-06-10 Maarten Brock + + * src/SDCCast.c (decorateType, &/|/^): optimize bool with literal, + (optimizeGetAbit): prevent memory leak + * src/SDCCcse.c (algebraicOpts): optimize bool XOR literal + * src/SDCCsymt.c (computeType): also remove const from result, + fixed bug 3531687 by removing wrong CHAR = ? 1 : 0 optimization to BOOL + * src/SDCCval.h, + * src/SDCCval.c (constBoolVal): new function + (cheapestVal): added BOOL for 0 or 1, + * support/regression/tests/bug3531687.c: enabled test, removed unrelated + and already covered test + * support/regression/tests/getbyte.c: new, added + +2012-06-09 Borut Razem + + * support/regression/ports/pic14/spec.mk, + support/regression/ports/pic16/spec.mk: + fixed pic -> pic14, --non-free -> --use-non-free + +2012-06-09 Philipp Klaus Krause + + * src/z80/ralloc2.cc: + Disallow source operand in h or l for >= 16-bit addition that also has a + source operand on extended stack. Final part of fix for bug #3531660. + * support/regression/tests/bug3531687.c: + Regression test for bug #3531687. + +2012-06-09 Erik Petrich + + * src/SDCCopt.c: fixed several missing def/use problems including + bug #3511517 + * src/SDCCBBlock.c (addiCodeToeBBlock): fixed bug #3511516 + * src/hc08/ralloc.c (packRegisters): fixed bug #3531045 + * support/regression/tests/gcc-torture-execute-980604-1.c: reenabled + * support/regression/tests/gcc-torture-execute-980205.c: reenabled + +2012-06-07 Philipp Klaus Krause + + * src/z80/main.c: + Fix handling of --fomit-frame-pointer for z180, r2k and r3ka port. + +2012-06-07 Maarten Brock + + * src/ds390/gen.c (genAssign): no assignment for ruonly to ruonly + * src/SDCC.y, + * src/SDCCerr.c: W_COMP_RANGE, W_EMPTY_SOURCE_FILE & W_CONTROL_FLOW are pedantic + * src/SDCCast.c (processParms): no cast for signedness only, + (resultTypePropagate): propagate for GETHBIT, GETABIT, GETBYTE & GETWORD, + (decorateType: BITWISEAND): rearrange first, + (decorateType: RETURN): no cast for signedness only, + (optimizeGetHbit, optimizeGetAbit): use bitsForType instead of getSize and + propagate resultType, + (optimizeGetByte, optimizeGetWord): handle offset 0 + * src/SDCClabel.c (deleteIfx), + * src/SDCCcse.c (ifxOptimize): W_CONTROL_FLOW is pedantic, + (algebraicOpts: BITWISEAND, OR): use bitsForType instead of getSize + * src/SDCCicode.c (geniCodeLogic): W_COMP_RANGE is pedantic, + (geniCodeUnary, geniCodeBinary): added param resType, + (checkTypes): no cast for signedness only, + (ast2iCode): propagate tree->ftype + * src/SDCCopt.c (optimizeCastCast): use bitsForType instead of getSize + * src/SDCCsymt.c (comparePtrType): only cast signedness if necessary + * src/SDCCsymt.h, + * src/SDCCicode.h: cosmetics + +2012-06-06 Erik Petrich + + * src/hc08/gen.c: fixed bugs #3531546 and #3531545 + +2012-06-06 Philipp Klaus Krause + + * src/z80/gen.c: + Fix 16-Bit addition for interleaved pairs. Partial fix for bug #3531660. + +2012-06-06 Philipp Klaus Krause + + * src/z80/gen.c: + Fix POINTER_SET with surviving result partially in hl. Partial fix for bug #3531660. + +2012-06-06 Maarten Brock + + * device/lib/_autobaud.c: cosmetics + * device/lib/printfl.c: fixed bug 3513300 + +2012-06-06 Erik Petrich + + * src/hc08/gen.c: Fixed bug #3531544. Fixed cast from h to hx. + +2012-06-05 Borut Razem + + * support/sdbinutils/libiberty/makefile.in: + excluded pex*.c files from build since pex-unix.c doesn't + compile on cygwim mingw and they are not needed by sdbinutils + * doc/sdccman.lyx: compiler macro definitions not starting with + double underscore characters are deprecated if --std-cXX + command line option is defined; + new compiler macros for processor definition were introduced + for pic14 and pic16 targets + +2012-06-05 Philipp Klaus Krause + + * src/z80/ralloc2.cc: + Disallow surviving hl in addition with extended stack operands. Partial fix for bug #3531660. + +2012-06-05 Erik Petrich + + * src/mcs51/ralloc.c (packForPush), + * src/ds390/ralloc.c (packForPush), + * src/hc08/ralloc.c (packForPush), + * src/pic14/ralloc.c (packForPush), + * src/pic16/ralloc.c (packForPush): fixed bug #3527285 + +2012-06-04 Philipp Klaus Krause + + * src/z80/gen.c: + Fix corner case in addition with extended stack right operand and low result byte in hl. Partial fix for bug #3531660. + +2012-06-04 Philipp Klaus Krause + + * src/z80/ralloc2.cc: + Disallow use of hl over comparison when there is an extended stack operand. Partial fix for bug #3531660. + * src/z80/gen.c: + Save a during GET_VALUE_AT_ADDRESS when storing to extended stack operand. Partial fix for bug #3531660. + +2012-06-04 Erik Petrich + + * src/hc08/gen.c (loadRegIndex, storeRegIndexed): added missing + rematOfs + +2012-06-03 Borut Razem + + * src/pic14/main.c, src/pic16/main.c: re-enabled deprecated + macros not starting with double underscore characters in + combination with --std-cXX + * device/include/pic16/pic18fregs.h: modified for __SDCC_PICXXX + +2012-06-03 Philipp Klaus Krause + + * src/z80/gen.c: + Fix handling of extended stack operands in 16-bit unary minus and signed comparison. Partial fix for bug #3531660. + +2012-06-03 Erik Petrich + + * src/SDCCopt.c, + * src/hc08/ralloc.c: RFE 3526269 and 3526268 + +2012-06-02 Philipp Klaus Krause + + * src/port.h: + Fixed bug #3531540. + +2012-06-02 Philipp Klaus Krause + + * src/SDCCerr.c, src/SDCCerr.h: added W_STRING_CANNOT_BE_TERMINATED + src/SDCCast.c (createIvalCharPtr): fixed #3007799: generate different warning + for initializer strings that fit in buffer without terminating '\0'. According + C99 $6.7.8:14 this is allowed. With --less-pedantic no warning is generated. + Modified version of patch by Jan Waclawek. + +2012-06-02 Borut Razem + + * src/SDCCmain.c, src/pic14/main.c, src/pic16/main.c, + support/scripts/pic14fam-h-gen.pl, + applied modified patch + #3531337 - The pic14 port, automatically creates the -DpicXXX, + thanks to Molnar Karoly + * support/scripts/pic16fam-h-gen.pl: modified for __SDCC_PICXXX + * device/non-free/include/pic14/pic14fam.h, + device/non-free/include/pic16/pic16fam.h: (re)generated + +2012-06-01 Borut Razem + + * doc/README.txt, doc/INSTALL.txt: updated for SDCC 3.2.0 release + +2012-06-01 Philipp Klaus Krause + + * src/z80/peeph-z80.def, + src/z80/peeph-r2k.def: + Shift optimization. + +2012-06-01 Philipp Klaus Krause + + * src/z80/gen.c: + Always use 16-bit addition when an operand and the result are in hl. + +2012-06-01 Erik Petrich + + * src/hc08/gen.c: Preparations for further pointer offset + optimizations. Bug fixes for certain register assignment cases + in complement, unary minus, bitwise operators, and bitfield + unpacking. + +2012-05-31 Philipp Klaus Krause + + * src/z80/gen.c: + Fix handling of a in casts, bug #3531118. + +2012-05-31 Philipp Klaus Krause + + * doc/sdccman.lyx: + Updated manual (mostly r3ka and s08 port). + +2012-05-31 Borut Razem + + * debugger/mcs51/cmd.c: fixed bug #3530998 - source code bug.. + +2012-05-31 Erik Petrich + + * src/SDCCsymt.h: handle up to 8 registers per symbol for long long + support + +2012-05-30 Philipp Klaus Krause + + * src/z80/ralloc.h, + src/z80/gen.c, + src/z80/ralloc2.cc: + More flexible handling of a during pointer access in z80-related ports. + +2012-05-30 Philipp Klaus Krause + + * src/z80/peeph-r2k.def: + Fix invalid stack-relative increment. + * src/z80/gen.c: + More efficient handling of 16-bit stores to stack. + +2012-05-30 Philipp Klaus Krause + + * sim/ucsim/z80.src/inst_r2k.cc: + Fix handling of carry in 16-bit shift rotate instructions. + * src/z80/gen.c: + Better 16 bit signed comparison for z80 related (except gbz80). + +2012-05-30 Philipp Klaus Krause + + * src/z80/gen.c: + Allow result of GET_VALUE_AT_ADDRESS in A for z80-related ports. + +2012-05-30 Philipp Klaus Krause + + * src/z80/gen.c: + Improve storing of literals to stack for Rabbits. + +2012-05-30 Philipp Klaus Krause + + * src/z80/gen.c: + Fix multibyte global to global assignment on gbz80 with de alive. + +2012-05-30 Erik Petrich + + * src/hc08/ralloc2.cc (operand_sane): fixed erroneous rejection of + single byte operand register assignment due to out of bounds + dereference + +2012-05-29 Philipp Klaus Krause + + * src/z80/gen.c: + Fix for surviving pair in bitfield write. + +2012-05-29 Philipp Klaus Krause + + * src/z80/gen.c, + src/hc08/gen.c: + Added assertions to debug rematerialization issues. + +2012-05-29 Erik Petrich + + * src/hc08/ralloc.c (moveSendToCall, packRegisters): move SEND iCodes + to immediately precede their CALL/PCALL for better live range info. + * src/hc08/gen.c (genSend): fixed bug swapping SEND iCode order. + +2012-05-29 Philipp Klaus Krause + + * src/z80/gen.c: + Fixed bug #3530276. + +2012-05-29 Erik Petrich + + * src/SDCCbitv.c (bitVectSetBit, bitVectUnSetBit), + * src/hc08/ralloc2.cc (set_surviving_regs), + * src/z80/ralloc2.cc (set_surviving_regs): Prohibit negative bit + position in bit vectors to avoid memory corruption + * device/lib/clean.mk: add s08 and r3ka ports to cleaning + +2012-05-28 Philipp Klaus Krause + + * src/z80/gen.c: + Use Rabbit's cast to bool instruction for zeroing h, + more efficient loading of pairs in shifts. + * src/z80/peep.c: + Handle bool in instruction size calculations. + +2012-05-28 Borut Razem + + * src/pic16/main.c: allow underscore characters in #pragma config + +2012-05-26 Borut Razem + + * src/pic16/main.c: allow space characters in #pragma config + +2012-05-25 Borut Razem + + * doc/sdccman.lyx: corrected #pragma configure to #pragma config + +2012-05-25 Maarten Brock + + * src/hc08/gen.c (genPointerSet): fixed warning + +2012-05-25 Erik Petrich + + * support/scripts/sdcc.nsi: fix my typo in r3ka path + +2012-05-24 Philipp Klaus Krause + + * src/z80/peeph-r2k.def, + src/z80/peeph-z80.def, + src/z80/peeph-gbz80.def: + Jump optimization. + +2012-05-24 Philipp Klaus Krause + + * src/z80/ralloc2.cc, + src/z80/gen.c: + Non-destructive & with bit literal. + +2012-05-24 Philipp Klaus Krause + + * src/hc08/peeph.def: + Improve elimination of branches. + +2012-05-24 Erik Petrich + + * support/scripts/sdcc.nsi: added r3ka and s08 to installer + * support/sdbinutils/binutils/configure.in, + * support/sdbinutils/binutils/configure: fix bug #3527589 + * src/SDCCcse.c (newCseDef): fix bug #3528899 + +2012-05-23 Erik Petrich + + * src/hc08/gen.c: Preparations for further pointer offset + optimizations + +2012-05-22 Philipp Klaus Krause + + * src/hc08/peeph.def: + Allow disabling of tail-call and jump to return optimization. + +2012-05-22 Erik Petrich + + * src/hc08/gen.c: Fixed inconsistent offsets for 16-bit register + accesses. Removed broken and unused AOP_STR type. Prohibit loading + h via hx from volatile operands. + +2012-05-21 Philipp Klaus Krause + + * support/regression/tests/memory.c, + src/z80/gen.c, + src/port.h, + src/SDCCglue.c, + src/z80/main.c, + src/z80/peep.c: + Use lsidr for built-in memset() for r3ka. + * src/hc08/gen.c: + Use ldhx, sthx for memory-to-memory assignment and cast. + * src/hc08/peeph.def: + Basic tail call optimization. + +2012-05-21 Philipp Klaus Krause + + * src/hc08/gen.c: + More efficient loading of H and HX for hc08 and s08. + +2012-05-21 Philipp Klaus Krause + + * support/regression/tests/setjmp.c: + Enable test for r3ka. + * support/regression/tests/gcc-torture-execute-pr28982a.c, + support/regression/tests/gcc-torture-execute-20010224-1.c, + support/regression/tests/gcc-torture-execute-20030408-1.c: + Disable tests for r3ka. + * support/regression/Makefile.in: + Add ucr3ka target to z80 target. + +2012-05-21 Leland Morrison + + * SDCCpeeph.c, peep.c: Fixed so that R2K instructions are + recognized for -mr3ka target by the peephole optimizer. + +2012-05-20 Leland Morrison + + * support/regression/Makefile.in, support/regression/ports/ucr3ka/*, + support/regression/fwk/include/testfwk.h: added test-ucr3ka to + run regression tests on the rabbit 3000A port + +2012-05-20 Leland Morrison + + * device/include/sdcc-lib.h, device/include/math.h: Added conditional + for rabbit 3000 + * devince/include/asm/r3ka/features.h: Added to allow customizations + for -mr3ka + +2012-05-20 Leland Morrison + + * src/sdas/asrab/rabbitpst.c: Added mnemonics for rabbit 3000A + * src/sdas/asrab/rabbitmch.c: Added .r3k flag and rabbit 3000A + instructions, changed much of the indentation to make gnu style, + and update two functions declarations from K&R style + * src/sdas/asrab/rabbit.h: Added constants for rabbit 3000 support + +2012-05-20 Philipp Klaus Krause + + * src/hc08/gen.c: + Emit cost information only when --fverbose-asm is used. + +2012-05-20 Erik Petrich + + * src/hc08/gen.c: Fixed yet more problems with registers possibly + clobbered in division/modulus. Optimized GET_VALUE_AT_ADDRESS + including handling non-zero right operand. + * src/hc08/ralloc.c: Allow packRegsForSupport() to optimize + conditions computed for IFX. Handle non-zero right operand + for GET_VALUE_AT_ADDRESS when generating pseudo symbol. + * src/SDCCopt.c: Let GET_VALUE_AT_ADDRESS have non-zero right + operand for HC08-like ports. Fix def/use info on operands + converted to integer support function calls. + +2012-05-20 Philipp Klaus Krause + + * sdccconf_in.h: + Regenerated, so building with r3ka port disabled works now. + +2012-05-20 Philipp Klaus Krause + + * src/hc08/gen.c: + Improved code for PCALL. + +2012-05-20 Philipp Klaus Krause + + * src/hc08/gen.c, + src/hc08/ralloc2.cc: + Improved code for GET_VALUE_AT_ADDRESS. + +2012-05-19 Philipp Klaus Krause + + * src/hc08/gen.c: + Improve addition for hc08 and s08. + * src/z80/main.c: + Fix name of r3ka library. + * src/hc08/main.c: + Fix name of s08 library. + +2012-05-19 Philipp Klaus Krause + + * sim/ucsim/hc08.src/hc08.cc: + Fix sthx with ext operand on s08. + * src/hc08/gen.c: + Use ldhx, cphx and sthx with ext operands for s08 in places where we use them for hc08 with imm operands. + +2012-05-19 Philipp Klaus Krause + + * sdas/as6808/m08mch.c, + sdas/as6808/m6808.h, + sdas/as6808/m08pst.c, + src/SDCCralloc.hpp, + src/SDCCglue.c, + src/hc08/main.c, + src/hc08/ralloc2.cc: + Asm for s08. + +2012-05-19 Philipp Klaus Krause + + * support/regression/tests/bug3223041.c: + Do not handle hc08 as special case. + +2012-05-18 Philipp Klaus Krause + + * device/lib/r3ka/Makefile.in: + Fix building of r3ka lib. + * device/lib/s08/Makefile.in: + Fix building of s08 lib. + * support/regression/Makefile.in, + support/regression/ports/s08, + support/regression/fwk/include/testfwk.h, + support/regression/tests/gcc-torture-execute-func-ptr-1.c, + support/regression/tests/gcc-torture-execute-991112-1.c, + support/regression/tests/gcc-torture-execute-921208-1.c, + support/regression/tests/bug3379723.c, + support/regression/tests/gcc-torture-execute-930702-1.c, + support/regression/tests/float_single.c, + support/regression/tests/gcc-torture-execute-20000412-2.c, + support/regression/tests/gcc-torture-execute-20080529-1.c, + support/regression/tests/gcc-torture-execute-20030209-1.c, + support/regression/tests/gcc-torture-execute-950915-1.c, + support/regression/tests/bug1723128.c, + support/regression/tests/gcc-torture-execute-20001221-1.c, + support/regression/tests/gcc-torture-execute-20030307-1.c, + support/regression/tests/gcc-torture-execute-950612-1.c, + support/regression/tests/gcc-torture-execute-20001108-1.c, + support/regression/tests/cse.c: + Regression testing for s08 port. + * device/include/stdarg.h: + Fix variable arguments for s08. + * device/lib/_mullong.c: + Fix long multiplication for s08. + +2012-05-18 Philipp Klaus Krause + + * configure.in, + src/SDCCicode.c, + src/SDCCsymt.c, + src/SDCCmain.c, + src/port.h, + src/SDCCglue.c, + src/hc08/main.c, + src/SDCCpeeph.c, + src/hc08/hc08.h, + device/lib/Makefile.in, + device/lib/s08: + Dummy (behaves as HC08) S08 port. + +2012-05-18 Philipp Klaus Krause + + * device/include/stdarg.h, + device/include/string.h, + device/include/setjmp.h, + device/lib/Makefile.in, + configure.in, + src/SDCCopt.c, + src/z80/gen.c, + src/z80/main.c, + src/z80/z80.h, + src/SDCCmain.c, + src/port.h, + sim/ucsim/aclocal.m4, + sim/ucsim/configure, + device/lib/r3ka: + Dummy (behaves as Rabbit 2000/3000) Rabbit 3000A port. + +2012-05-17 Leland Morrison + + * sim/ucsim/hc08/hc08.cc: Fix for opcodes 0xAE, 0xBE, and 0xCE op-decode + +2012-05-17 Philipp Klaus Krause + + * support/regression/tests/bug3521024.c: + Regression test for bug #3521024. + +2012-05-17 Erik Petrich + + * src/hc08/gen.c: Use non-destructive bit tests when possible + (rfe #3526285). Fixed loss of association between generated + assembly and iCodes. + * src/hc08/peeph.def: Additional rules for conditional branches and + to remove unused labels. + +2012-05-16 Maarten Brock + + * support/regression/Makefile.in: renamed test-z80 and test-gbz80 to test-rr... + * support/regression/ports/gbz80, + * support/regression/ports/rrgbz80: renamed to rrgbz80 + * support/regression/ports/z80, + * support/regression/ports/rrz80: renamed to rrz80 + * support/regression/tests/gcc-torture-execute-921013-1.c: disabled for xstack + +2012-05-15 Erik Petrich + + * src/hc08/gen.c (genAnd): added forgotten ifx->generated = TRUE + +2012-05-15 Maarten Brock + + * support/regression/tests/gcc-torture-execute-961017-2.c: use less loops to + reduce test time + +2012-05-15 Erik Petrich + + * sim/ucsim/hc08.src/hc08.cc, + * sim/ucsim/hc08.src/inst.cc: Fixed simulation of brset/brclr. Keep + track of instruction cycle times. + * src/hc08/gen.c (genAnd): Use brset/brclr where possible + +2012-05-14 Leland Morrison + + * sim/ucsim/stypes.h, + * sim/ucsim/globals.cc: add R3KA (rabbit 3000A) processor type + * sim/ucsim/z80.src/r2k.cc, + * sim/ucsim/z80.src/simz80.cc: added initialization code for R3KA support + * sim/ucsim/z80.src/r2kcl.h, + * sim/ucsim/z80.src/inst_ed_r2k.cc: support for r3ka instructions + * sim/ucsim/z80.src/inst_ed.cc: change to allow overloading of inst_ed_ + +2012-05-14 Erik Petrich + + * src/hc08/gen.c: correct some dry run costs, update genDivOneByte() + and genModOneByte() to handle all register operand posibilities + +2012-05-13 Maarten Brock + + * sim/ucsim/pobj.cc, + * sim/ucsim/pobjcl.h: made cl_list::at inline + * sim/ucsim/s51.src/regs51.h: added AP + * sim/ucsim/s51.src/uc390.cc (inst_inc_dptr): fixed sel bug, + (disass): show inc/dec dptr, + (print_regs): show DPTR0, DPTR1 and AP + * src/ds390/gen.c (genGenPointerGet, genGenPointerSet): fixed bug 3509705 + * support/regression/compact-results.py: align results + * support/regression/tests/gcc-torture-execute-921013-1.c: enabled tests + +2012-05-11 Philipp Klaus Krause + + * src/z80/ralloc2.cc, + src/hc08/ralloc2.c: + Bypass dry run for generated ic. + +2012-05-10 Maarten Brock + + * src/hc08/gen.h, + * src/hc08/gen.c (aopName): compile conditionally, + (assignResultValue): MSVC has no true/false, + (hasInchc08): fixed warning, + (genReceive): declarations first + * src/hc08/ralloc.c: include dbuf_string.h, + (createStackSpil): removed unused slocBuffer + * src/hc08/hc08.vcxproj.filters, + * src/hc08/hc08.vcxproj: added ralloc2.cc and boost include dir + * src/z80/gen.c (genCmp): fixed uninitialised warning + * src/SDCCicode.h: cosmetics + +2012-05-09 Philipp Klaus Krause + + * src/SDCCralloc.hpp, + src/hc08/ralloc2.cc: + Added some debug info code. + +2012-05-09 Philipp Klaus Krause + + * src/hc08/gen.c, + src/hc08/ralloc.c: + Remove some unused variables. + +2012-05-09 Erik Petrich + + * src/hc08/gen.c (aopOp): Handle spill location correctly even + though it is not actually allocated during dry run + +2012-05-07 Philipp Klaus Krause + + * support/regression/ports/ds390/spec.mk: + Increase timeout from 40 to 60, since ds390 simulation on NetBSD is slow. + +2012-05-06 Erik Petrich + + * src/hc08/gen.c (aopAdrStr): handle incompletely initialized + spill location symbols during dry run + +2012-05-06 Borut Razem + + * .version, doc/sdccman.lyx: bumped version to 3.1.5 + * ChangeLog: removed unicode BOM + * support/sdbinutils/binutils/Makefile.am, + support/sdbinutils/binutils/Makefile.in: + fixed the first part of bug #3518739 - Build weird behaviour... + +2012-05-05 Maarten Brock + + * support/regression/tests/gcc-torture-execute-pr44555.c: test was not + disabled for gcc 4.4.3, now it is for all 4.x.x < 4.6.0 + +2012-05-05 Philipp Klaus Krause + + * src/SDCCicode.c, + * src/SDCCicode.h, + * src/SDCCralloc.hpp, + * src/SDCCset.c, + * src/SDCCsymt.c, + * src/hc08/gen.c, + * src/hc08/gen.h, + * src/hc08/main.c, + * src/hc08/ralloc.c, + * src/hc08/ralloc.h, + * src/hc08/ralloc2.cc, + * src/yacc.vcxproj, + * src/z80/gen.c, + * src/z80/ralloc.c, + * src/z80/ralloc2.cc: Merged optralloc-hc08 branch + +2012-05-05 Maarten Brock + + * config.vcxproj, + * configure_vc.awk, + * doc/sdccman.lyx, + * sdcc_vc.h.in, sdcc_vc_in.h: renamed sdcc_vc_in.h to sdcc_vc.h.in + * src/SDCCval.c (byteOfVal), + * src/z80/gen.c (genLeftShiftLiteral, genPointerGet), + * src/mcs51/gen.c (genLeftShiftLiteral): fixed warnings + * src/SDCCnaddr.hpp: renamed cfg_node to cfg_naddr_node + * src/SDCCralloc.hpp: default_constructor_of_cfg_node_called and + cfg_node constructor disabled to fix bug 3521407 + * src/SDCCtree_dec.hpp: set svn properties + * support/regression/ports/mcs51-common/spec.mk: fixed SIM_TIMEOUT bug + * support/regression/tests/bug-3495411.c: enabled for mcs51 + * support/regression/tests/gcc-torture-execute-20000622-1.c, + * support/regression/tests/gcc-torture-execute-20010924-1.c, + * support/regression/tests/gcc-torture-execute-961004-1.c, + * support/regression/tests/gcc-torture-execute-961125-1.c, + * support/regression/tests/gcc-torture-execute-990404-1.c: suppressed warnings + +2012-05-05 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-20080529-1.c: + Disable test for gcc older than 5.0. + +2012-05-05 Borut Razem + + * support/regression/ports/ds390/spec.mk, + support/regression/ports/hc08/spec.mk, + support/regression/ports/mcs51-common/spec.mk, + support/regression/ports/pic14/spec.mk, + support/regression/ports/pic16/spec.mk, + support/regression/ports/ucgbz80/spec.mk, + support/regression/ports/ucr2k/spec.mk, + support/regression/ports/ucz180/spec.mk, + support/regression/ports/ucz80/spec.mk: use SIM_TIMEOUT + +2012-05-04 Philipp Klaus Krause + + * support/regression/ports/ucgbz80/spec.mk: + Increase timeout from 20s to the 30s other ports use to get rid of NetBSD/sparc64 regression failure. + +2012-05-03 Philipp Klaus Krause + + * src/hc08/main.c, + src/hc08/ralloc.c: + Revive old register allocator for --oldralloc. + +2012-05-03 Philipp Klaus Krause + + * src/SDCCmain.c, + src/z80/gen.c, + src/z80/ralloc.c, + src/z80/main.c, + src/z80/z80.h, + src/SDCCglobl.h: + Made --oldralloc less port-specific. + +2012-05-03 Erik Petrich + + * src/z80/gen.c (aopPut3): added missing declarations + +2012-05-02 Philipp Klaus Krause + + * src/hc08/gen.c: + Remove obsolete genPointerGetSetOfs(). + +2012-05-02 Erik Petrich + + * configure: regenerated from new configure.in + +2012-05-02 Philipp Klaus Krause + + * src/z80/gen.c: + More efficent storing of registers pairs to top of stack. + +2012-05-02 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-20101013-1.c: + Disable test until nonzero integer constants work. + +2012-05-02 Erik Petrich + + * src/SDCCval.h, + * src/SDCCval.c (byteOfVal): new function + * src/z80/gen.c (aopGet, gencjneshort), + * src/SCCglue.c (aopLiteralLong): use byteOfVal() to access value + * configure.in, + * sdcc_vc_in.h, + * sdccconf_in.h: find/define appropriate 64-bit integer + * src/SDCCsymt.h: start of support for 64-bit literal + +2012-04-30 Leland Morrison + + * sim/ucsim/app.cc: reduced the frequency of checks for user input + +2012-04-26 Philipp Klaus Krause + + * src/z80/gen.c: + Improve code generation for comparison to zero. + +2012-04-26 Philipp Klaus Krause + + * support/librarian/sdcclib.c: + Do not depend on PATH_MAX, fix #3521650. + * sdas/asxxsrc/asxxxx.h: + Use FILENAME_MAX if PATH_MAX is not defined. + +2012-04-28 Erik Petrich + + * src/hc08/gen.c: Optimize access to h/hx on top of stack. Compute + cost of SEND. + * src/hc08/ralloc2.cc: Compute cost of SEND. Support xa and ax + with GETBYTE and GETWORD. + +2012-04-26 Erik Petrich + + * src/hc08/gen.c: Rewrite genSend to fix problem with register + clobbering. Allow use of tsx with function return values. + * src/hc08/ralloc.c: Removed unneed constraint on stack operands + +2012-04-25 Borut Razem + + * src/common.h, src/ds390/main.c: include SDCCsystem.h in common.h + * src/SDCCmain.c: added newline at end of file + * src/SDCCicode.c: use TRUE instead of undefined true + * src/SDCCicode.h: fixed declaration of isOperandLiteral() + +2012-04-25 Philipp Klaus Krause + + * src/z80/peeph-gbz80.def: + Removed peephole that resulted in invalid or operand on gbz80. + +2012-04-24 Philipp Klaus Krause + + * src/z80/gen.c: + Fix #3521024. + +2012-04-25 Erik Petrich + + * src/hc08/gen.c: Fixed bug with cpx use. Optimize stack adjustments + of +/-1. Use mov #0 instead of clr with volatile operands to avoid + read side effect. Avoid using x as stack frame base unless it saves + clock cycles. + +2012-04-24 Philipp Klaus Krause + + * src/SDCCicode.c, + src/SDCCopt.c, + src/z80/gen.c: + GET_VALUE_AT_ADDRESS with offset for z80, z180 and r2k. + +2012-04-24 Erik Petrich + + * src/hc08/gen.c: Index stack frame via x instead of sp when convenient + +2012-04-22 Erik Petrich + + * src/hc08/gen.c: Use msb to lsb order in assignment for compatibility + with hardware hardware registers. Expanded use of cpx and ldhx + instructions. Removed some old unused code. Fixed a stack bug in + genPlusIncr. + +2012-04-23 Philipp Klaus Krause + + * src/SDCCicode.c: + Enable replacing division by power of two by conditional addition and shift (for hc08, z80, z180, gbz80 and r2k). + * src/z80/gen.c, + src/mcs51/gen.c: + Fortify a "/* I assume that [...]" comment by an assertion that would have saved me some time. + +2012-04-20 Philipp Klaus Krause + + * src/hc08/main.c: + Enable CSE for an approx. 0.1-0.2% code size reduction. + +2012-04-22 Raphael Neider + + * device/lib/pic16/libsdcc/gptr/eeprom{8,16}_gptrput[1234].c: + fix accessing EECON1.WREN + +2012-04-22 Raphael Neider + + * device/non-free/lib/pic14/libdev/Makefile.in: + build 16f72[01] only if --enable-new-pics is given, as the + devices are not supported in the current gputils release 0.14.1 + +2012-04-21 Maarten Brock + + * src/ds390/main.c: undo removed include to fix implicit declaration + +2012-04-21 Philipp Klaus Krause + + * src/SDCCicode.c: + Preparations for replacing division by power of two by conditional addition and shift. + * support/regression/tests/longlong.c, + support/regression/tests/gcc-torture-execute-pr42269-2.c, + support/regression/tests/gcc-torture-execute-20080529-1.c, + support/regression/tests/gcc-torture-execute-950503-1.c, + support/regression/tests/float_single.c: + Enable more tests for hc08. + +2012-04-22 Erik Petrich + + * src/hc08/gen.c: fix bugs in genRLC, genRRC, and genJumpTab; support large stack + offsets in rmwWithAop; optimized asmopToBool + * src/hc08/ralloc.c: fix bug in findAssignToSym + +2012-04-20 Philipp Klaus Krause + + * src/hc08/ralloc2.cc, + src/hc08/gen.c: + Allow some use of ax. + +2012-04-20 Philipp Klaus Krause + + * src/hc08/ralloc2.cc, + src/hc08/gen.c: + Remove accuse. + +2012-04-19 Raphael Neider + + * device/lib/pic16/libc/stdio/strmmssp.c: + fixed use of access bank vs. BSR + + * device/lib/pic16/libsdcc/gptr/eeprom{8,16}_gptr{get,put}[1234].c, + device/lib/pic16/libsdcc/gptr/eeprom{8,16}_write.c: + implement EEPROM read/write access + + * device/lib/pic16/libsdcc/gptr/gptr{get,put}[1234].c: + call EEPROM dispatchers on EEPROM accesses + + * device/lib/pic16/libsdcc/Makefile.am: + add gptr EEPROM accessors + + * device/non-free/lib/pic16/libdev/gptr/*: + dispatch EEPROM accesses to the appropriate implementations + based on device capabilities (no eeprom, 8 or 16 bit EEPROM + address space) + + * device/non-free/lib/pic16/libdev/mkmk.sh, + device/non-free/lib/pic16/libdev/newdevices.txt: + improved to automatically add SSPBUF workaround + plus EEPROM dispatchers as required by the devices + + * device/non-free/lib/pic16/libdev/pic18f1330.c, + device/non-free/lib/pic16/libdev/pic18f1220.c, + device/non-free/lib/pic16/libdev/pic18f4450.c: + removed manual SSPBUF workaround + + * device/non-free/lib/pic16/libdev/fake_sspbuf.c: + provide automatic SSPBUF workaround + + * device/lib/pic16/libsdcc/Makefile.in, + device/non-free/lib/pic16/libdev/Makefile.am, + device/non-free/lib/pic16/libdev/Makefile.in: + regenerated + +2012-04-20 Philipp Klaus Krause + + * src/hc08/ralloc2.cc, + src/hc08/gen.c: + Made hc08 code generation more robust wrt. surviving registers and register operands. + +2012-04-19 Erik Petrich + + * src/hc08/gen.c: rewrite genCast for register source/results + +2012-04-19 Philipp Klaus Krause + + * src/hc08/ralloc2.cc, + src/hc08/gen.c: + Fixes for the cost function (reducing code size and exposing code generation issues). + +2012-04-19 Philipp Klaus Krause + + * src/hc08/ralloc2.cc, + src/hc08/gen.c: + Made hc08 code generation more robust wrt. surviving registers and register operands. + +2012-04-19 Philipp Klaus Krause + + * src/hc08/gen.c: + Preparations for removing accuse. + +2012-04-19 Philipp Klaus Krause + + * src/hc08/ralloc2.cc, + src/hc08/gen.c: + Fix xa to hx assignment. + +2012-04-19 Philipp Klaus Krause + + * src/hc08/ralloc2.cc: + Fix assignment of nRegs and regs for accuse symbols. + +2012-04-19 Erik Petrich + + * src/hc08/gen.c: fixed div/mod sign ext. to work with register result + +2012-04-18 Philipp Klaus Krause + + * src/hc08/ralloc2.cc, + src/hc08/gen.c: + Made hc08 code generation more robust wrt. surviving registers and register operands. + +2012-04-17 Philipp Klaus Krause + + * src/hc08/ralloc2.cc, + src/hc08/gen.c: + Made hc08 code generation more robust wrt. surviving registers and register operands. + +2012-04-16 Philipp Klaus Krause + + * src/hc08/ralloc2.cc, + src/hc08/gen.c: + Handling of pointer access in new allocator. + +2012-04-16 Philipp Klaus Krause + + * src/SDCCralloc.hpp, + src/SDCCicode.c, + src/SDCCicode.h, + src/z80/ralloc2.cc, + src/hc08/gen.h, + src/hc08/ralloc2.cc, + src/hc08/gen.c: + Improve hc08 cost function. + +2012-04-16 Philipp Klaus Krause + + * src/hc08/ralloc2.cc, + src/hc08/gen.c: + Made hc08 code generation more robust wrt. surviving registers and register operands. + +2012-04-14 Raphael Neider + + * src/pic16/genarith.c (pic16_genMult8XLit_n,pic16_genMult8X8_n): + work around early clobbering of input operands, fixes #3515677; + clean up, eliminate dead code + +2012-04-14 Erik Petrich + + * src/hc08/gen.c: fix isDead status for register H + +2012-04-13 Philipp Klaus Krause + + * src/SDCCralloc.hpp, + src/hc08/ralloc2.cc, + src/hc08/gen.c: + Made hc08 code generation more robust wrt. surviving registers and register operands. + +2012-04-13 Philipp Klaus Krause + + * src/hc08/ralloc.h, + src/hc08/ralloc2.cc, + src/hc08/gen.c, + src/z80/ralloc2.cc: + Introduce isDead for hc08 registers. + +2012-04-13 Erik Petrich + + * src/hc08/gen.c (asmOp): always keep pointer to operand in asmop + * src/hc08/ralloc2.cc (instruction_cost): reenable !, IFX, and CAST + +2012-04-13 Erik Petrich + + * src/SDCCsymt.c (newBoolLink): return bool instead of bit if no + bit memory. + * src/hc08/gen.c: Fixed no register assigned to iTemp for IFX. + Guarded more instances of emitLabel for dry run + +2012-04-12 Philipp Klaus Krause + + * src/hc08/gen.c: + Fix genPointerGet with postincrement and result in h. + +2012-04-12 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-920428-1.c: + Reformatted test. + +2012-04-12 Philipp Klaus Krause + + * src/hc08/gen.c: + Fix handling of isFree for register operands. + +2012-04-12 Philipp Klaus Krause + + * src/hc08/gen.c: + More flexible use of A in cast. + +2012-04-12 Philipp Klaus Krause + + * src/hc08/ralloc2.cc: + Fix checking of XA and reenable use of assignment. + * src/hc08/gen.c: + Additional debugging output. + +2012-04-12 Philipp Klaus Krause + + * src/SDCCset.c: + Additional assertion. + * src/hc08/ralloc.c: + Avoid buffer overflow. + * src/hc08/ralloc2.cc: + Do not use assignment for now. + +2012-04-12 Philipp Klaus Krause + + * src/SDCCicode.h, + src/SDCCicode.c: + Made isOperandLiteral() work on const operand *. + +2012-04-12 Philipp Klaus Krause + + * src/hc08/ralloc.c: + Cleanup. + * src/hc08/gen.c: + Made genDjnz() more flexible. + * src/hc08/ralloc2.cc: + Disallow X, A for now. + +2012-04-12 Philipp Klaus Krause + + * src/SDCCralloc.hpp, + src/z80/ralloc2.cc, + src/hc08/ralloc2.cc: + Make optimal register allocator less port-specific. + +2012-04-11 Philipp Klaus Krause + + * src/SDCCralloc.hpp, + src/z80/gen.c, + src/hc08/ralloc2.cc, + src/hc08/gen.c, + src/hc08/ralloc.c, + src/SDCCicode.c: + Optimal register allocator for hc08 working partially. + +2012-04-11 Erik Petrich + + * src/SDCCcse.c (ifOperandsHave): fixed bug #3516746 + +2012-04-11 Philipp Klaus Krause + + * support/regression/tests/string.c: + Added test for strrchr(). + * src/z80/gen.c, + src/SDCCpeeph.c: + Fixed memory leaks. + +2012-04-10 Philipp Klaus Krause + + * src/SDCCralloc.hpp, + src/z80/ralloc.c, + src/hc08/ralloc.c, + src/hc08/gen.c: + Enable new allocator as dummy, spilling everything. + +2012-04-10 Philipp Klaus Krause + + * src/z80/ralloc.c, + src/hc08/ralloc2.cc, + src/hc08/ralloc.c: + Preparations for optimal register allocation for hc08. + +2012-04-09 Erik Petrich + + * support/regression/Makefile.in, + support/regression/collate-results.py : another fix for bug #3477347 + * support/regression/ports/hc08/spec.mk: increase timeout to 30 seconds + +2012-04-08 Borut Razem + + * src/SDCCgen.c: + don't emit leading whitespaces in inline asm, 2nd try + fixed bug #3515390 - asm with leading whitespace passed to backends + * src/z80/peep.c: made z80instructionSize() function more + ropbust: accept arbitrary number of arbitrary space characters + between mnemonic and the first operand + +2012-04-07 Philipp Klaus Krause + + * src/z80/ralloc2.cc: + Fix invalid reads. + * src/z80/gen.c: + Fix a memory leak. + +2012-04-07 Borut Razem + + * src/common.h, SDCCglobal.h: fixed mingw32 build on derna: + macros min and max should not be defined when compiled with C++ + * src/pic16/device.c, src/pic16/genarith.c, src/pic16/gen.c, + src/pic16/pcode.c, src/pic16/glue.c: + applied patch #3515647 - Correction patch on the PIC16's branch, + thanks to Molnar Karoly + +2012-04-07 Philipp Klaus Krause + + * src/SDCCralloc.hpp: + Additional assertion to track down #3475617 and #3506333. + +2012-04-06 Borut Razem + + * src/SDCCgen.c, src/SDCCgen.h, src/SDCCralloc.hpp, src/common.h, + src/mcs51/gen.c, src/pic14/gen.c, src/z80/gen.c, + src/pic16/gen.c, src/ds390/gen.c, src/hc08/gen.c: + fixed NetBSD sparc64 build, code beautification, + additional unification of target code generation + * support/cpp/configure.in, support/cpp/configure, + support/cpp/system.h: fixed sdcc configure include paths + * src/SDCCgen.c: don't emit leading whitespaces in inline asm; + fixed bug #3515390 - asm with leading whitespace passed to backends + +2012-04-05 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-20080529-1.c: + Disable test for gcc older than 5.0. + * src/z80/ralloc2.cc, + src/SDCCralloc.hpp, + src/z80/gen.h, + src/z80/gen.c: + Made optimal allocator less z80-specific. + +2012-04-04 Borut Razem + + * support/cpp/system.h, support/cpp/libiberty/filenames.h, + support/cpp/libiberty/md5.c, support/cpp/libiberty/obstack.h: + sdcpp partially synchronized with GCC CPP release version 4.7.0 + * support/cpp/sdcpp.vcxproj: enhancements, added custom build messages + +2012-04-03 Philipp Klaus Krause + + * src/SDCCralloc.hpp: + Additional assertions to track down #3475617 and #3506333. + +2012-04-02 Philipp Klaus Krause + + * src/SDCCsymt.c + src/z80/main.c + src/hc08/main.c + src/hc08/gen.c + src/hc08/ralloc.c + device/include/stdint.h + device/lib/_rlslonglong.c + device/lib/_divslonglong.c + device/lib/z180/Makefile.in + device/lib/z180/stubs.s + device/lib/_mullonglong.c + device/lib/_rrslonglong.c + device/lib/z80/Makefile.in + device/lib/z80/stubs.s + device/lib/gbz80/stubs.s + device/lib/gbz80/Makefile.in + device/lib/_rlulonglong.c + device/lib/Makefile.in + device/lib/_divulonglong.c + device/lib/_divslonglong_rrx_s.c + device/lib/_rrslonglong_rrx_s.c + device/lib/_divulonglong_rrx_s.c + device/lib/_rrulonglong_rrx_s.c + device/lib/_rrulonglong.c + device/lib/_rlslonglong_rrx_s.c + device/lib/r2k/Makefile.in + device/lib/r2k/stubs.s + device/lib/_rlulonglong_rrx_s.c + device/lib/hc08/Makefile.in + device/lib/hc08/_ret.c + support/regression/tests/gcc-torture-execute-991216-1.c + support/regression/tests/gcc-torture-execute-pr47337.c + support/regression/tests/gcc-torture-execute-991216-2.c + support/regression/tests/gcc-torture-execute-pr20187-1.c + support/regression/tests/gcc-torture-execute-20000121-1.c + support/regression/tests/gcc-torture-execute-960801-1.c + support/regression/tests/gcc-torture-execute-930111-1.c + support/regression/tests/gcc-torture-execute-20001112-1.c + support/regression/tests/gcc-torture-execute-20101013-1.c: + long long for hc08. + * src/z80/gen.c, + support/regression/tests/gcc-torture-execute-pr47337.c, + support/regression/tests/gcc-torture-execute-961213-1.c: + Fixed bug #3513892. + * src/SDCCralloc.hpp: + Additional assertions to track down #3475617. + * src/z80/ralloc.c: + Assertion for local variables outside of functions. + +2012-04-01 Philipp Klaus Krause + + * device/lib/Makefile.in, + device/lib/*/Makefile.in, + device/lib/*/stubs.s, + device/lib/_divslonglong_rrx_s.c, + device/lib/_rrslonglong_rrx_s.c, + support/regression/tests/gcc-torture-execute-20101013-1.c, + support/regression/tests/gcc-torture-execute-950512-1.c: + long long division. + * support/regression/tests/gcc-torture-execute-920612-1.c, + support/regression/tests/gcc-torture-execute-920711-1.c: + Disable tests for gcc older than 5.0. + * support/regression/tests/longlong.c, + support/regression/tests/gcc-torture-execute-960801-1.c, + support/regression/tests/longlong.c: + Disable long long tests since they fail on 32-bit systems. + +2012-03-31 Borut Razem + + * src/SDCCgen.c, src/SDCCgen.h, src/ds390/gen.c, + src/ds390/main.c, src/hc08/gen.c, src/hc08/main.c, + src/mcs51/gen.c, src/pic14/gen.c, src/pic16/gen.c, + src/z80/gen.c, src/z80/gen.h: + introduced labelKey2num label handling macro + +2012-03-30 Borut Razem + + * src/common.h, src/Makefile.in, src/SDCCgen.c, src/SDCCgen.h, + src/SDCCasm.c, src/SDCCasm.h, src/SDCCdebug.c, + src/SDCCdebug.h, src/SDCCpeeph.c, src/SDCCpeeph.h, + src/avr/gen.c, src/ds390/gen.c, src/ds390/gen.h, + src/ds390/main.c, src/ds390/main.h, src/hc08/gen.c, + src/mcs51/gen.c, src/mcs51/main.c, src/mcs51/main.h, + src/pic14/gen.c, src/pic16/gen.c, src/z80/gen.c, + sdcc_vc_in.h, src/sdcc.vcxproj, src/sdcc.vcxproj.filters: + unification of target code generation + +2012-03-30 Philipp Klaus Krause + + * device/lib/z180/stubs.s, + device/lib/z80/stubs.s, + device/lib/gbz80/stubs.s, + support/regression/tests/longlong.c, + support/regression/tests/gcc-torture-execute-*.c: + Made TODO comments more specific wrt. to what sdcc functionality is required for enabling the test, enabled more long long tests. + +2012-03-30 Borut Razem + + * configure.in, configure, sdccconf_in.h: + added check if c supports tags in unnamed struct, + fixed IS_VALID_OPTION + * sim/ucsim/configure.in, sim/ucsim/configure: + fixed IS_VALID_OPTION + * sim/ucsim/aclocal.m4: regenerated + * src/pic14/Makefile.in: removed unneeded PORT + +2012-03-30 Philipp Klaus Krause + + * src/z80/gen.c: + Fix for returning long long, fixes #3512403. + * device/lib/z180/stubs.s, + device/lib/z80/stubs.s, + device/lib/gbz80/stubs.s, + support/regression/tests/longlong.c: + More tests for long long. + * support/regression/tests/gcc-torture-execute-*.c: + Made TODO comments more specific wrt. to what sdcc functionality is required for enabling the test. + * device/lib/_rrslonglong_rrx_s.c, + device/lib/_rrulonglong_rrx_s.c, + device/lib/_rlulonglong_rrx_s.c: + Fixes for long long shift. + +2012-03-29 Philipp Klaus Krause + + * src/SDCCsymt.c (initCSupport), + device/lib/_rrslonglong_rrx_s.c, + device/lib/_rrulonglong_rrx_s.c: + Fixed declarations for shift support functions. + * device/lib/*z*/Makefile.in, + device/lib/Makefile.in, + device/lib/_r??longlong_rrx_s.c, + device/lib/_mullonglong.c: + Shift and multiplication support for long long. + +2012-03-29 Philipp Klaus Krause + + * src/z80/gen.c, + src/z80/ralloc2.cc: + More flexible use of de for gbz80. + +2012-03-29 Erik Petrich + + * src/SDCCsymt.c (initCSupport): fixed declarations for shift support functions + * src/SDCCsymt.c (initBuiltIns), + src/SDCCast.c (funcOfTypeVarg), + src/SDCCast.h: added some const qualifiers + +2012-03-29 Philipp Klaus Krause + + * src/z80/gen.c, + src/z80/ralloc2.cc: + More flexible use of de for gbz80. + +2012-03-28 Philipp Klaus Krause + + * src/z80/ralloc2.cc: + Allow some use of de on gbz80. + * src/z80/gen.c: + gbz80 >> fix. + * device/lib/_rrslonglong_rrx_s.c, + device/lib/_rrulonglong_rrx_s.c: + Support functions for shifting long long. + +2012-03-28 Philipp Klaus Krause + + * src/z80/ralloc2.cc, + src/z80/ralloc.c, + src/z80/z80.h: + Remove support for using the old allocator for A, while using the new allocator for other registers. + +2012-03-28 Philipp Klaus Krause + + * src/z80/z80.h: + Enabled exact cost function for gbz80. + * src/z80/gen.c: + Fixed a gbz80 comparison bug. + +2012-03-28 Borut Razem + + * src/SDCCval.c, src/SDCCval.h, src/SDCCicode.c: + double2ul converted from macro to a function + +2012-03-28 Philipp Klaus Krause + + * src/z80/gen.c: + Better support for returning long long, now works for gbz80, too. + +2012-03-28 Philipp Klaus Krause + + * src/z80/gen.c: + Better assignment for large variables. + * src/z80/peep.c: + Fix code size calculation bug. + +2012-03-28 Borut Razem + + * configure.in, configure, sdccconf_in.h, + sim/ucsim/configure.in, sim/ucsim/configure, + sim/ucsim/ddconfig_in.h: + use AC_C_BIGENDIAN instead of SDCC_BUILD_BIGENDIAN + * support/cpp/config.in: regenerated + * custom_in.h, sim/ucsim/custom_in.h: removed + +2012-03-28 Philipp Klaus Krause + + * device/include/stdint.h: + Use long long for intmax_t where available. + +2012-03-28 Erik Petrich + + * support/regression/tests/gcc-torture-execute-981001-1.c: Revert my + previous edit since it was not needed + +2012-03-28 Philipp Klaus Krause + + * src/z80/gen.c, + support/regression/tests/longlong.c: + Fixed returning long long, and reenabled test. + +2012-03-28 Erik Petrich + + * support/regression/tests/gcc-torture-execute-981001-1.c: Only use + __reentrant for SDCC and not for test-host + * support/regression/tests/gcc-torture-execute-930106-1.c: Reenabled + +2012-03-28 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-981001-1.c: + Fixed #3511512 / #3511513. + +2012-03-27 Philipp Klaus Krause + + * src/SDCCsymt.c, + src/z80/gen.c, + support/regression/tests/gcc-torture-execute-960801-1.c, + support/regression/tests/longlong.c: + Support for returning long long and unsigned long long in z80, z180 and r2k port. + +2012-03-26 Philipp Klaus Krause + + * src/z80/gen.c: + Fixed stack unbalance bug. + +2012-03-26 Erik Petrich + + * src/SDCCasm.c (FileBaseName): fixed bug 3511092 + +2012-03-26 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-9*.c: + Added some more tests from the execute part of the gcc torture regression test suite. + +2012-03-26 Erik Petrich + + * src/mcs51/ralloc.c (packForPush), + src/ds390/ralloc.c (packForPush), + src/hc08/ralloc.c (packForPush): fixed bug #3502628 + * support/regression/tests/gcc-torture-execute-20010403-1.c: reenabled + * src/hc08/ralloc.c (packRegisters, packForPush): use packForPush + for SEND iCodes too. + +2012-03-25 Maarten Brock + + * src/mcs51/ralloc.c (packForPush): fixed bug 3502621 + * support/regression/tests/gcc-torture-execute-20030117-1.c: enabled test + +2012-03-25 Erik Petrich + + * src/SDCCast.c (isConformingBody): fixed bug #3509715 + * support/regression/tests/gcc-torture-execute-930513-2.c: reenabled + * src/SDCCast.c (decorateType): fixed bug #3509713 + * support/regression/tests/gcc-torture-execute-930429-1.c: reenabled + * src/SDCCicode.c (geniCodeAssign): fixed bug #3509712 + * support/regression/tests/gcc-torture-execute-921016-1.c: reenabled + * src/SDCCopt.c (optimizeCastCast): fixed bug #3509711 + * support/regression/tests/gcc-torture-execute-921218-1.c: reenabled + +2012-03-24 Borut Razem + + * support/makebin/makebin.c: applied modified patch + #3510671 - [makebin / gbz80] add nintendo logo info in ROM header, + thanks to Noel Lemouel + +2012-03-24 Erik Petrich + + * support/regression/Makefile.in, + support/regression/ports/ds390/spec.mk, + support/regression/ports/hc08/spec.mk, + support/regression/ports/mcs51-common/spec.mk, + support/regression/ports/pic14/spec.mk, + support/regression/ports/pic16/spec.mk, + support/regression/ports/ucgbz80/spec.mk, + support/regression/ports/ucr2k/spec.mk, + support/regression/ports/ucz180/spec.mk, + support/regression/ports/ucz80/spec.mk, + support/regression/ports/xa51/spec.mk: attempt to fix bug #3477347 + +2012-03-24 Erik Petrich + + * src/SDCCcse.h, + src/SDCCcse.c: handle possible pointer aliasing more conservatively + * src/z80/gen.c (genFunction): reset stack.pushed at function start too + +2012-03-22 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-941021-1.c: + Disable test for gcc older than 5.0. + +2012-03-22 Borut Razem + + * doc/sdccman.lyx: double underlined keywords, + fixed bug #3510011 - Wrong keyword + * src/sdcc.vcxproj, src/sdcc.vcxproj.filters: + added some missing header files + +2012-03-22 Erik Petrich + + * src/SDCCsymt.h, + src/SDCCsymt.c (initCSupport, typeFromStr, printTypeChainRaw), + src/SDCCopt.c (cnvToFloatCast, cnvToFixed16x16Cast, cnvFromFloatCast, + cnvFromFixed16x16Cast, convilong): ongoing upgrades for long long type + +2012-03-22 Erik Petrich + + * src/hc08/gen.c (transferAopAop): fixed bug 3509707 + * support/regression/tests/gcc-torture-execute-930603-1.c: reenabled + +2012-03-21 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-92*, + support/regression/tests/gcc-torture-execute-93*, + support/regression/tests/gcc-torture-execute-94*: + Added some more tests from the execute part of the gcc torture regression test suite. + +2012-03-20 Borut Razem + + * src/mcs51/gen.c, src/SDCCasm.c, src/SDCCasm.h, src/z80/gen.c, + src/SDCCutil.c, src/ds390/gen.c, src/hc08/gen.c: + code cleaning, optimization, ... + +2012-03-20 Philipp Klaus Krause + + * device/include/stdint.h, + device/include/string.h, + device/include/stddef.h, + device/include/stdlib.h, + device/include/stdio.h, + device/include/time.h, + device/include/errno.h: + rsize_t, errno_t, constraint_handler_t, RSIZE_MAX from annex K (bounds-checking) of the C11 standard. + +2012-03-19 Borut Razem + + * src/SDCC.lex, doc/sdccman.lyx: removed asm() pseudo function + since it is not standard-compliant + +2012-03-19 Philipp Klaus Krause + + * src/SDCCpeeph.c: + Handle gbz80 (hl+) and (hl-). + +2012-03-19 Erik Petrich + + * support/regression/Makefile.in, + support/regression/collate-results.py: Summarize any failures in a + nicer format instead of all run together on one line + * src/ds390/gen.c (genPlusIncr): fix problem with dereferencing a + generic pointer via a struct losing pointer type byte + +2012-03-18 Borut Razem + + * doc/sdccman.lyx,src/avr/gen.c, src/ds390/gen.c, + src/hc08/gen.c, src/mcs51/gen.c, src/pic14/gen.c, + src/pic16/device.c, src/pic16/gen.c, src/pic16/glue.c, + src/pic16/pcode.c, src/SDCC.lex, src/SDCC.y, src/SDCCast.c, + src/SDCCglue.c, src/SDCCsymt.h, src/SDCCutil.c, + src/SDCCutil.h, src/SDCCval.c: + implemented feature request #2815320 - please add asm() + pseudo function as alternate + * sdcc.sln, src/sdcc.vcxproj, src/sdcc.vcxproj.filters, + src/yacc.vcxproj: + re-itroduced yacc project + * .version, doc/sdccman.lyx: bumped version to 3.1.4 + * config.vcxproj, src/ds390/ds390.vcxproj, + src/hc08/hc08.vcxproj, src/mcs51/mcs51.vcxproj, + src/pic14/pic14.vcxproj, src/pic16/pic16.vcxproj, + src/sdcc.vcxproj, src/yacc.vcxproj, src/z80/z80.vcxproj, + all.vcxproj, all.vcxproj.filters: + VS project enhancements + * src/SDCC.y, src/SDCCsymt.h, src/SDCCutil.c, src/SDCCutil.h, + src/SDCCval.c: fixed flaws in previous commit + * src/SDCCsymt.c, src/pic14/glue.c, src/cdbFile.c: + fixed printing size_t type numbers + +2012-03-18 Maarten Brock + + * src/ds390/gen.c (aopGet, aopPut), + * src/mcs51/gen.c (aopGet, aopPut): fixed bug 3496842 + * support/regression/tests/sfr16.c: enabled test and fixed for ds390 + +2012-03-17 Borut Razem + + * support/regression/tests/strstr.c, + support/regression/tests/strcpy.c, + support/regression/tests/strcmp.c, + support/regression/tests/strtok.c, + support/regression/tests/strncmp.c, + support/regression/tests/strspn.c, + support/regression/tests/strpbrk.c, + support/regression/tests/string.c: + merged strstr.c, strcpy.c, strcmp.c, strtok.c, strncmp.c, + strspn.c, and strpbrk.c to string.c, added test for + bug #3506236 + +2012-03-16 Erik Petrich + + * sdas/linksrc/lkarea.c (lnksect2): applied fix from Tim Schuerewegen + (bug 3495316) + +2012-03-16 Borut Razem + + * sdcc.sln, src/sdcc.vcxproj, src/sdcc.vcxproj.filters, + src/yacc.vcxproj: + project src renamed to sdcc, removed project yacc + * doc/sdccman.lyx, src/SDCCasm.c, src/SDCCicode.h, + src/SDCCast.c, src/SDCCast.h, src/pic16/main.c: + implemeted pragma config for pic16 target, solution + of bug #3486890 - pic16 port config directive warning + * src/Makefile.in, src/sdcc.vcxproj: + fixed bug #3506236: sdcc.exe unicode problem? by generating + 8-bit scanner + +2012-03-16 Erik Petrich + + * sdas/linksrc/lkarea.c (allocate_space,find_empty_space): fixed bound + checking errors on allocation bitmap (possbile fix for bug #3502626) + +2012-03-16 Raphael Neider + + * device/non-free/lib/pic16/libdev/pic18f1330.c: + add dummy SSPBUF symbol as required by __stream_putchar/printf + * device/non-free/lib/pic16/libdev/testall.sh: + test using printf_tiny() for greater confidence + +2012-03-14 Borut Razem + + * debugger/mcs51/sdcdb.c, src/mcs51/gen.c, src/SDCCopt.c, + src/hc08/gen.c, src/hc08/ralloc.c, src/ds390/gen.c, + src/ds390/ralloc.c, sim/ucsim/cmd.src/cmdset.cc, + sim/ucsim/cmd.src/cmdstat.cc, sim/ucsim/cmd.src/cmdgui.cc, + sim/ucsim/z80.src/inst.cci, sdas/asxxsrc/asout.c: + fixed gcc 4.6.1 warnimgs, mainly warning: 'xxx' may be used + uninitialized in this function [-Wuninitialized] + +2012-03-14 Philipp Klaus Krause + + * src/z80/ralloc.c, + support/regression/tests/bug3502965.c: + Fixed bug #3502965. + * support/regression/tests/gcc-torture-execute-20030209-1.c, + support/regression/tests/gcc-torture-execute-20031012-1.c: + Added explanation for why tests don't work on gbz80. + * src/SDCCmain.c: + Reenable non-compliant SDCC macros (but not for --std-c89, --std-c99, --std-c11). + * src/z80/ralloc2.cc: + More flexible handling of accumulator in multiplication and return. + +2012-03-14 Borut Razem + + * device/non-free/include/*, device/non-free/lib/*: + added info about "The header files should state that they are + only to be used with authentic Microchip devices" Microchip + requirement and GPL incompatibility + +2012-03-13 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-20010224-1.c, + support/regression/tests/gcc-torture-execute-20030714-1.c: + Disable tests for gcc older than 5.0. + +2012-03-13 Borut Razem + + * device/include/*, device/lib/*: corrected GPL license version + from 2.1 to 2: GPLv2.1 does not exist + +2012-03-12 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-2001*.c, + support/regression/tests/gcc-torture-execute-2003*.c: + Added some more tests from the execute part of the gcc torture regression test suite. + +2012-03-12 Borut Razem + + * doc/TININative.txt: removed, available at + http://sourceforge.net/apps/trac/sdcc/wiki/Using%20SDCC%20to%20develop%20Native%20Java%20functions + * doc/Makefile.in: + don't generate unusable html and txt versions of sdccman + +2012-03-11 Philipp Klaus Krause + + * src/SDCCpeeph.c, + src/z80/peeph-r2k.def, + src/z80/peeph-z80.def, + support/regression/tests/bug3501942.c: + Fixed bug #3501942. + +2012-03-11 Philipp Klaus Krause + + * src/z80/gen.c: + Fixed bug that made copying from hl to iy ineffcient on r2k, + fix another check in commitPair(), improved stack adjustment + after function call. + +2012-03-11 Raphael Neider + + * device/lib/pic16/libio/usart/uopen.c: + properly setup BAUDCONbits.BRG16, closes #3495815 + + * device/non-free/include/pic16/pic18f1220.h: + added BAUDCON alias and structure definition for BAUDCTL + +2012-03-10 Borut Razem + + * doc/sdccman.lyx: + documented support for 18f1230/18f1330 device family + +2012-03-10 Raphael Neider + + * Makefile.in: + device/lib build depends on sdcc-sdbinutils + + * device/include/pic16/adc.h, + device/include/pic16/pic16devices.txt, + device/include/pic16/pic18fregs.h, + device/lib/pic16/libio/Makefile.am, + device/lib/pic16/libio/adc/adcbusy.c, + device/lib/pic16/libio/adc/adcopen.c, + device/lib/pic16/libio/adc/adcsetch.c, + device/lib/pic16/libio/i2c.ignore, + device/lib/pic16/libio/usart/uopen.c, + device/non-free/include/pic16/pic18f1230.h, + device/non-free/include/pic16/pic18f1330.h, + device/non-free/lib/pic16/libdev/Makefile.am, + device/non-free/lib/pic16/libdev/pic18f1230.c, + device/non-free/lib/pic16/libdev/pic18f1330.c, + device/non-free/lib/pic16/pics.all, + support/scripts/pic18fam-h-gen.pl: + add support for 18f1230 and 18f1330 devices + + * device/lib/pic16/libio/mkmk.sh: + adjust path to pics.all + + * device/lib/pic16/libdev: + removed obsolete, empty directory + + * device/lib/pic16/libio/Makefile.in, + device/non-free/include/pic16/pic18fam.h, + device/non-free/lib/pic16/libdev/Makefile.in: + regenerated + +2012-03-10 Borut Razem + + * doc/README.txt, doc/sdccman.lyx: + backslashes replaced with slashes in non-free paths; + obsoleted special sdcc keywords which are not preceded + by a double underscore + * support/scripts/inc2h-pic16.pl, support/scripts/inc2h.pl: + added comment about Microchip "The header files should state + that they are only to be used with authentic Microchip + devices" requirement. + +2012-03-10 Philipp Klaus Krause + + * src/z80/gen.c: + Fixed bug #3501019. + +2012-03-09 Erik Petrich + + * src/mcs51/gen.c (genCast): fixed bug #3486542 + * support/regression/tests/gcc-torture-execute-pr15296.c: re-enabled + +2012-03-09 Borut Razem + + * doc/README.txt: + added info about included code from gcc test suite + * Makefile.in: + replaced test -e with -f, since -e is not available in sh + on Solaris + +2012-03-08 Philipp Klaus Krause + + * src/z80/gen.c: + Use 16-bit addition instructions for 8-bit additions when cheaper and possible. + +2012-03-07 Borut Razem + + * Makefile.in: copy correct sdbinutils executables to bin + +2012-03-07 Erik Petrich + + * src/SDCCopt.c (getAddrspaceiCode), + src/SDCCralloc.hpp (create_cfg): properly handle IFX and + JUMPTABLE operands + +2012-03-06 Borut Razem + + * Makefile.in, support/sdbinutils/binutils/Makefile.am, + support/sdbinutils/binutils/Makefile.in, + support/scripts/sdcc.nsi, + support/sdbinutils/bfd/asxxxx.c, + support/sdbinutils/binutils/nm.c: + added sdnm sdbinutils utility + +2012-03-06 Philipp Klaus Krause + + * src/z80/gen.c: + Fixed bug #3496508. + +2012-03-05 Borut Razem + + * src/SDCCicode.c: + disable -O2 optimization for gcc 4.6.3, see bug #3285611 + * support/scripts/sdcc_mingw32: minor cosmetical fix + * configure.in, configure, config.guess, config.sub: + added host and build type detection + * device/lib/pic14/Makefile.in, + device/lib/pic14/libm/Makefile.in: regenerated + +2012-03-05 Erik Petrich + + * src/SDCCopt.c (separateAddressSpaces): fixed bug #3476041 + +2012-03-04 Borut Razem + + * doc/README.txt, doc/sdccman.lyx: small corrections + * src/SDCC.lex: removed forward declaration of non existing + function deprecated_keyword(), removed macro TKEYWORDSDCC + * support/cpp/opts.c, support/cpp/sdcpp.c, + support/cpp/version.c, support/cpp/version.h: + updated version to 4.6.3 + +2012-03-04 Erik Petrich + + * src/SDCCsymt.h, + * src/SDCCerr.c, + * src/SDCCerr.h, + * src/SDCC.y: fix struct/union tag scope problems + (including bug #3487670) + * support/regression/tests/structscope.c: new tests + +2012-03-03 Borut Razem + + * support/regression/ports/ucz80/spec.mk, + support/regression/ports/ucz180/spec.mk: + simulation timeout doubled due to several tests + failures on sparc64-unknown-netbsd platform + +2012-03-02 Philipp Klaus Krause + + * src/z80/gen.c, + src/z80/ralloc.c, + support/regression/tests/bug-3495411.c, + Fixed #3495411 and another --oldralloc bug. + +2012-03-02 Borut Razem + + * doc/sdccman.lyx: fixed pdf generation; + added chapter 1.2 SDCC Suite Licenses; + libraries license should be at least as liberal as the GPLv2+LE; + note about GPL incompatible pic device libraries; + added link to "List of the SDCC library" wiki page; + added link to "SDCC - Small Device C Compiler Wiki" wiki page; + use term "SDCC suite"; + formatting cleaning + * doc/README.txt: changed chapters Licenses and Authors and interested persons + +2012-03-01 Borut Razem + + * support/regression/ports/ucz80/spec.mk: + simulation timeout increased to 20s due to several tests + failures on sparc64-unknown-netbsd platform + * configure.in, configure: report CPPFLAGS and LDFLAGS settings + * support/sdbinutils/bfd/configure.in, + support/sdbinutils/bfd/configure, + PKGVERSION set to (sdbinutils derived from GNU Binutils), + BUGURL set to http://sourceforge.net/tracker/?group_id=599&atid=100599 + * support/sdbinutils/binutils/version.c: + --vesion shows sd* names instead GNU * + +2012-03-01 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-20080506-1.c, + support/regression/tests/gcc-torture-execute-20080506-2.c: + Disable tests for gcc versions earlier than 5.0. + +2012-03-01 Erik Petrich + + * support/regression/tests/cse.c: new tests checking for CSE problems + +2012-02-28 Philipp Klaus Krause + + * support/regression/tests/2000*.c: + More tests from gcc. + +2012-02-28 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-20000402-1.c: + Disable test since unsigned long long is not yet fully supported. + * support/regression/tests/gcc-torture-execute-20000314-1.c: + Silence warning. + +2012-02-27 Philipp Klaus Krause + + * support/regression/tests/2000*.c: + More tests from gcc. + +2012-02-26 Borut Razem + + * support/regression/ports/ds390/spec.mk: + simulation timeout icreased to 40s due to + gcc-torture-execute-20090113-1 test failure on + x86_64-w64-mingw32 and sparc64-unknown-netbsd platforms + * doc/README.txt: added gbz80 to supported targets, + explanation of sdcc run time libraries licensing + +2012-02-26 Philipp Klaus Krause + + * device/include/mcs51/compiler.h: + Update for SDCC -> __SDCC rename. + * support/regression/tests/gcc-torture-execute-pr49161.c, + support/regression/tests/gcc-torture-execute-pr49039.c, + support/regression/tests/gcc-torture-execute-pr48809.c, + support/regression/tests/gcc-torture-execute-pr48973-1.c, + support/regression/tests/gcc-torture-execute-pr48973-2.c: + Disable tests for all gcc older than 5.0. + * doc/sdccman.lyx: + Document feature macro rename. + +2012-02-26 Erik Petrich + + * src/ds390/gen.c (genAssign): fixed bug #3463343 + * support/regression/tests/gcc-torture-execute-string-opt-5.c: + reenabled for ds390 + * src/ds390/gen.c (genPlus, genMinus): fix bug #3486541 + * support/regression/tests/gcc-torture-execute-pr20527-1.c: + reenabled for ds390 + +2012-02-26 Borut Razem + + * doc/sdccman.lyx: documented support for 16f720/16f721 + +2012-02-26 Erik Petrich + + * support/regression/tests/gcc-torture-execute-stdarg-4.c: + reenabled for ds390 + +2012-02-25 Borut Razem + + * configure.in, configure, Makefile.in, sdcc.sln, + doc/sdccman.lyx, support/sdranlib/*: support/sdranlib removed + * .version, doc/sdccman.lyx: bumped version to 3.1.3 + +2012-02-25 Raphael Neider + + * device/include/pic14/pic14devices.txt, + device/non-free/include/pic14/pic16f720.h, + device/non-free/include/pic14/pic16f721.h, + device/non-free/lib/pic14/libdev/Makefile.in, + device/non-free/lib/pic14/libdev/devices.txt, + device/non-free/lib/pic14/libdev/pic16f720.c, + device/non-free/lib/pic14/libdev/pic16f721.c: + added support for 16f720/16f721 + + * device/non-free/include/pic14/pic14regs.h: + fixed to use __SDCC_PROCESSOR instead of SDCC_PROCESSOR + + * device/non-free/lib/pic16/libdev/testall.sh: + test support for all devices by compiling a source file + +2012-02-25 Erik Petrich + + * src/SDCCcse.c: fixed bug #3473062 + * src/z80/gen.c (genCmpGt, genCmpLt), + src/hc08/gen.c (genCmp, genCmpEQorNE), + src/pic16/gen.c (genCmpGt, genCmpLt), + src/pic14/gen.c (genCmpGt, genCmpLt): fixed bug #3487025 + +2012-02-24 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-pr42833.c: + Disable test for all gcc versions earlier than 5.0. + +2012-02-24 Erik Petrich + + * src/SDCCast.c (createDo): fixed bug #3489326 + +2012-02-23 Philipp Klaus Krause + + * src/z80/gen.c: + More efficient access to two-byte variables near the stack pointer for r2k, fix a bug when fetching 1-byte variables. + +2012-02-23 Philipp Klaus Krause + + * src/z80/gen.c, + src/z80/peeph-z80.def: + More efficient access to two-byte variables near the stack pointer. + * support/regression/tests/gcc-torture-execute-pr42833.c: + Disable test for even more gcc versions. + +2012-02-22 Philipp Klaus Krause + + * src/SDCCmain.c, + device/*, + support/regression/*: + sdcc macro mess cleanup, fix #3490776. + +2012-02-22 Erik Petrich + + * support/regression/tests/bug2935162.c, + * device/include/limits.h: changed constants to be compatible with + both C89 and C99 integer constant type rules + * src/SDCCval.c (constVal): fixed bug #3489899 + * src/mcs51/peeph.def: don't tail call optimize longjmp() + * src/SDCCsymt.c (addSymChain): fixed bug #3489870 + +2012-02-21 Philipp Klaus Krause + + * device/include/setjmp.h, + support/regression/tests/setjmp.c, + device/lib/_setjmp.c: + Rename HIDE_LONGJMP to __SDCC_HIDE_LONGJMP for standard compliance, enable setjmp/longjmp for z180 and r2k. + +2012-02-21 Erik Petrich + + * src/SDCCcse.c (cseBBlock): fixed bug #3482753 + * support/regression/tests/bug3482753.c: new + +2012-02-20 Erik Petrich + + * src/SDCCsymt.h, + src/SDCCast.h, + src/SDCCast.c (decorateType, processParms, checkPtrCast, copyAstValues): + fixed bug #3438706 + +2012-02-19 Philipp Klaus Krause + + * src/z80/gen.c, + support/regression/tests/gcc-torture-execute-pr39339.c: + Fixed bug #3486544. + +2012-02-19 Philipp Klaus Krause + + * src/z80/gen.c, + support/regression/tests/gcc-torture-execute-pr43236.c, + support/regression/tests/gcc-torture-execute-20090113-1.c: + Fixed bugs #3486543 and #3487324. + +2012-02-19 Erik Petrich + + * src/SDCCsymt.h, + src/SDCCsymt.c (findSymWithLevel), + src/SDCCast.c (resolveSymbols, processBlockVars): fixed bugs 3403429, + 3153215, 3107914 + * support/regression/tests/bug3403429.c: enabled test + +2012-02-18 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-pr44468.c, + support/regression/tests/gcc-torture-execute-pr43438.c, + support/regression/tests/gcc-torture-execute-pr45034.c: + Disable tests for older gcc. + +2012-02-17 Philipp Klaus Krause + + * device/lib/z80/divunsigned.s, + device/lib/z180/divunsigned.s, + device/lib/r2k/divunsigned.s: + Remove some leftover code for handling division by zero (patch by parerga, #3488149). + +2012-02-17 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-pr37924.c: + Fix gcc compilation failure. + +2012-02-16 Philipp Klaus Krause + + * src/z80/peeph-r2k.def: + Use some peepholes useful when omitting the frame pointer from z80 for r2k. + * src/z80/gen.c: + Improve code generation for r2k when omitting frame pointer, enable use of ld iy, hl on r2k. + +2012-02-16 Borut Razem + + * support/sdbinutils/include/opcode/sparc.h, + support/sdbinutils/include/aout/sun4.h: + added for NetBSD/sparc64 bfd build + +2012-02-15 Erik Petrich + + * src/hc08/main.c (hasExtBitOp), + src/hc08/gen.c (genGetAbit, genGetByte, genGetWord, genhc08Code): + implemented the GETABIT, GETBYTE, and GETWORD iCodes for HC08 + +2012-02-15 Philipp Klaus Krause + + * src/z80/gen.c: + Cheaper signed comparison when right operand is a literal. + * support/regression/tests/gcc-torture-execute-pr37924.c: + Disable even more of a test for older gcc. + +2012-02-15 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-pr37924.c, + support/regression/tests/gcc-torture-execute-pr33779-2.c: + Disable tests for older gcc. + * src/SDCCast.c + Fix setting of CurrFunc for non-functions. + * src/z80/main.c, + src/z80/gen.h, + src/z80/gen.c, + src/z80/ralloc2.cc: + Fixes for --fomit-frame-pointer, omit frame pointer by default for functions with low register pressure and few stack accesses. + +2012-02-15 Erik Petrich + + * src/SDCCast.c (createWhile, createDo, backPatchLabels): put label + nodes above IFX nodes rather than between IFX and condition + * src/SDCCicode.c (geniCodeIfx, ast2iCode): fixed bug #3429793 + +2012-02-14 Philipp Klaus Krause + + * src/z80/ralloc2.cc, + src/z80/gen.h, + src/z80/gen.c: + Omit frame pointer for functions with low register pressure and few parameter accesses. + +2012-02-14 Philipp Klaus Krause + + * src/z80/gen.c: + Fix addition when multiple operands are on the stack and --fomit-frame-pointer is used. + +2012-02-14 Philipp Klaus Krause + + * src/z80/peeph-z80.def, + src/z80/gen.c, + src/z80/ralloc2.cc: + Generate better code when using --fomit-frame-ppinter. + +2012-02-14 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-pr28651.c: + Disable test for older gcc. + +2012-02-13 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-pr49073.c, + support/regression/tests/gcc-torture-execute-pr36691.c: + Disabled some tests for older gcc. + * support/regression/tests/gcc-torture-execute-*.c: + Added some more tests from the execute part of the gcc torture regression test suite. + * src/z80/gen.c: + Improve handling of bc, de in addition. + * src/SDCC.lex: + Remove leftover legacy keyword function. + +2012-02-13 Philipp Klaus Krause + + * src/z80/ralloc2.cc, + src/z80/gen.c: + Improve handling of hl in address calculations, minor decrement improvement. + +2012-02-13 Erik Petrich + + * support/regression/tests/gcc-torture-execute-pr34070-1.c, + support/regression/tests/gcc-torture-execute-pr34070-2.c: + Disable more tests for older gcc + * support/regression/tests/gcc-torture-execute-pr15296.c, + support/regression/tests/bug1115321.c: Fix test to be compatible + with hosts in which int and pointers differ in size. + +2012-02-12 Erik Petrich + + * support/regression/tests/gcc-torture-execute-pr42833.c: + don't redefine ssize_t if host already defines + +2012-02-12 Raphael Neider + + * src/pic14/pcode.c (newpCodeOpBit): + prevent SIGSEGV on copying temporary registers + + * src/pic14/gen.c (gen{,End}Function, gen{,End}Critical, genpic14Code), + src/pic16/gen.c (gen{,End}Function, gen{,End}Critical, genpic16Code): + implement __critical (block and function attribute, PIC14 limited to + no-arg functions: arg0 in W would be corrupted) + +2012-02-12 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-pr42833.c, + support/regression/tests/gcc-torture-execute-pr44555.c, + support/regression/tests/gcc-torture-execute-pr48809.c, + support/regression/tests/gcc-torture-execute-pr48973-1.c, + support/regression/tests/gcc-torture-execute-pr48973-2.c, + support/regression/tests/gcc-torture-execute-pr49039.c, + support/regression/tests/gcc-torture-execute-pr49123.c, + support/regression/tests/gcc-torture-execute-pr49161.c, + support/regression/tests/gcc-torture-execute-pr49768.c: + Disable some tests for older gcc. + +2012-02-12 Erik Petrich + + * support/sdbinutils/include/mach-o/*: added missing files for Mac OS + +2012-02-12 Raphael Neider + + * src/pic14/gen.c (genGetABit, genpic14Code), + src/pic14/main.c (hasExtBitOp), + src/pic16/gen.c (genGetABit, genpic16Code), + src/pic16/main.c (hasExtBitOp): + implement GETABIT iCode, fixes #2986039 + +2012-02-11 Raphael Neider + + * device/include/pic16/signal.h: + explicitly access SFRs via access bank, closes #3482876 + +2012-02-11 Raphael Neider + + * device/include/pic14/pic14devices.txt, + device/non-free/include/pic14/pic16f1946.h, + device/non-free/include/pic14/pic16f1947.h, + device/non-free/lib/pic14/libdev/Makefile.in, + device/non-free/lib/pic14/libdev/devices.txt, + device/non-free/lib/pic14/libdev/pic16f1946.c, + device/non-free/lib/pic14/libdev/pic16f1947.c, + doc/sdccman.lyx: + enabled/added devices + + * device/non-free/lib/pic14/libdev/testall.sh: + test support for all devices by compiling a source file + + * device/non-free/lib/pic14/libdev/mkall.sh, + support/scripts/inc2h.pl: + improved regenerating device support files + +2012-02-11 Borut Razem + + * device/include/pic14/pic14devices.txt, + device/non-free/include/pic14/pic16f1503.h, + device/non-free/include/pic14/pic16f1507.h, + device/non-free/include/pic14/pic16f1508.h, + device/non-free/include/pic14/pic16f1509.h, + device/non-free/include/pic14/pic16f1516.h, + device/non-free/include/pic14/pic16f1517.h, + device/non-free/include/pic14/pic16f1518.h, + device/non-free/include/pic14/pic16f1519.h, + device/non-free/include/pic14/pic16f1526.h, + device/non-free/include/pic14/pic16f1527.h, + device/non-free/lib/pic14/libdev/Makefile.in, + device/non-free/lib/pic14/libdev/devices.txt, + device/non-free/lib/pic14/libdev/pic16f1503.c, + device/non-free/lib/pic14/libdev/pic16f1507.c, + device/non-free/lib/pic14/libdev/pic16f1508.c, + device/non-free/lib/pic14/libdev/pic16f1509.c, + device/non-free/lib/pic14/libdev/pic16f1516.c, + device/non-free/lib/pic14/libdev/pic16f1517.c, + device/non-free/lib/pic14/libdev/pic16f1518.c, + device/non-free/lib/pic14/libdev/pic16f1519.c, + device/non-free/lib/pic14/libdev/pic16f1526.c, + device/non-free/lib/pic14/libdev/pic16f1527.c: + applied patch #3471142: [PIC14] more enchanced core devices, + thanks to Gal Zsolt + * doc/sdccman.lyx: added new 16f15xx devices to the list + * support/sdbinutils/include/fopen-bin.h: + added, required by mingw build + * Makefile.in: added EXEEXT required by mingw build + * support/scripts/sdcc_mingw32: added TARGETAR + +2012-02-11 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-pr20601-1.c: + Disabled test for host, since _Noreturn support is required. + * support/regression/tests/gcc-torture-execute-pr23047.c: + Removed test, since it seems to test for implementation-defined behaviour. + * support/regression/tests/gcc-torture-execute-pr33779-1.c: + Use exact-width integer types from stdint.h instead, no longer require long to be 32 bits. + +2012-02-10 Philipp Klaus Krause + + * src/z80/ralloc2.cc, + src/z80/gen.c: + Increase flexibility of handling of register pair hl over function calls. + +2012-02-10 Philipp Klaus Krause + + * support/regression/tests/* + Added some more tests from the execute part of the gcc torture regression test suite. + +2012-02-10 Borut Razem + + * configure, Makefile.in, configure.in, sdccconf_in.h, + device/lib/z180/Makefile.in, device/lib/small/Makefile.in, + device/lib/z80/Makefile.in, device/lib/gbz80/Makefile.in, + device/lib/ds390/Makefile.in, device/lib/medium/Makefile.in, + device/lib/Makefile.in, device/lib/ds400/Makefile.in, + device/lib/mcs51/Makefile.in, device/lib/huge/Makefile.in, + device/lib/large/Makefile.in, device/lib/r2k/Makefile.in, + device/lib/hc08/Makefile.in, Makefile.common.in, + support/scripts/sdcc.nsi, support/sdbinutils/*: + device/lib/z180/Makefileadded sdbinutils: sdar and sdranlib + * device/lib/z180/Makefile: + deleted, generated from device/lib/z180/Makefile.in + +2012-02-09 Philipp Klaus Krause + + * src/z80/gen.c: + Fix for yesterdays addition improvement, decide in which pair + to increment in code generator instead of peephole optimizer. + +2012-02-08 Philipp Klaus Krause + + * src/z80/gen.c, + src/z80/peeph-z80.def: + Minor addition improvement. + +2012-02-08 Philipp Klaus Krause + + * src/z80/gen.c: + Use bit instruction for & in jump condition. + * src/z80/peep.c, + src/z80/peeph-z80.def: + Minor peephole improvements. + +2012-02-07 Philipp Klaus Krause + + * src/z80/ralloc2.cc, + src/z80/gen.c: + Improve handling of register pairs, in particular hl. + +2012-02-06 Philipp Klaus Krause + + * src/SDCCast.c: + Fixed bug #3073647. + * src/SDCCsymt.c: + Fixed #3034739. + +2012-02-06 Erik Petrich + + * support/regression/tests/bug2935162.c: don't assume 32-bit long host + +2012-02-06 Philipp Klaus Krause + + * src/z80/gen.c: + Fixed bug #3482732. + * src/SDCClrange.h, + src/SDCClrange.c, + src/SDCCopt.c, + support/Regression/bug3482217.c: + Fixed bug #3482217. + +2012-02-04 Maarten Brock + + * src/SDCCval.c (constVal): fixed bug 2935162 + * support/regression/tests/bug2935162.c: new, added + +2012-02-03 Philipp Klaus Krause + + * src/z80/gen.c, + src/z80/z80.h, + src/z80/ralloc2.cc: + Fixes for #3482732, preparations for exact cost function in gbz80 port. + +2012-02-03 Philipp Klaus Krause + + * src/z80/gen.c: + Fix generation of invalid instructions when --reserve-regs-iy is used. + +2012-01-31 Borut Razem + + * support/regression/ports/ucgbz80/spec.mk: + simulation timeout increased to 20s due to timeout failure on + gcc-torture-execute-divcmp-3 regressin test on + mypants.neurotica.com NetBSD/Sparc64 build machine + +2012-01-31 Philipp Klaus Krause + + * src/z80/ralloc2.cc, + support/regression/tests/bug3482146.c: + Fixed bug #3482146. + +2012-01-31 Philipp Klaus Krause + + * support/regression/tests/bug3482146.c: + Regression test for bug #3482146. + +2012-01-30 Philipp Klaus Krause + + * src/z80/gen.c: + Fixed bug #3480597. + +2012-01-29 Borut Razem + + * support/regression/tests/key.c: fixed for Mac OS X + +2012-01-28 Maarten Brock + + * src/mcs51/gen.c (genJumpTab): fixed bug 3480545 + * support/regression/tests/bug3480545.c: new, added + +2012-01-27 Philipp Klaus Krause + + * src/z80/gen.c, + support/regression/tests/gcc-torture-execute-stdarg-4.c: + Fix bug #3463344. + +2012-01-27 Philipp Klaus Krause + + * src/z80/peeph-gbz80.def: + Fix remaining gbz80 regression failures when using --max-allocs-per-node 5. + * src/z80/gen.c: + Fix right shift for gbz80 using --max-allocs-per-node 1. + +2012-01-26 Philipp Klaus Krause + + * src/z80/gen.c: + Fix comparison and unary minus for gbz80 when many operands are on the stack. + +2012-01-26 Raphael Neider + + * src/pic14/pcodepeep.c, + src/pic14/gen.c, + src/pic14/glue.c, + src/pic16/device.c, + src/pic16/pcodepeep.c, + src/pic16/gen.c, + src/pic16/pcoderegs.c, + src/pic16/ralloc.c, + src/pic16/pcode.c, + src/pic16/genutils.c: avoid compiler warnings + +2012-01-26 Philipp Klaus Krause + + * support/cpp/libcpp/internal.h, + support/cpp/sdcpp.c, + support/cpp/libcpp/lex.c: + Remove support for _asm and _endasm, rename macros that had names reserved for the implementation. + * support/regression/tests/key.c: + Regression test for obsolete keywords. + +2012-01-26 Philipp Klaus Krause + + * src/z80/gen.c: + Correctly handle some forgotten corner cases in the fix for #3427564. + +2012-01-25 Philipp Klaus Krause + + * doc/sdccman.lyx: + Mention -mz180, -mr2k, named address spaces and use non-deprectaed form of sdcc-specific keywords. + * src/SDCC.lex: + Remove support for deprecated keywords. + * src/z80/gen.c: + Fixed bug #3427564. + +2012-01-25 Borut Razem + + * device/lib/make51lib.bat: rewritten for ar / sdranlib + +2012-01-23 Borut Razem + + * doc/sdccman.lyx: pic14 enhanced cores enabled by default + +2012-01-22 Borut Razem + + * configure.in, configure: corrected test if ar accepts -S option + +2012-01-22 Maarten Brock + + * support/regression/tests/bug3475630.c, + * support/regression/tests/bug3475656.c: fixed for mcs51, native eol + * device/include/mcs51/stc12.h: new, added, thanks intron + +2012-01-21 Philipp Klaus Krause + + * src/z80/ralloc2.cc, + support/regression/tests/bug3475630.c: + Fixed bug #3475630. + * support/regression/tests/bug3475656.c: + Regression test for bug #3475656. + +2012-01-21 Philipp Klaus Krause + + * src/z80/peeph-gbz80.def: + Enable some more peephole rules for the gbz80. + +2012-01-21 Borut Razem + + * support/regression/tests/bug2942343.c: corrected test if SDCC + +2012-01-20 Borut Razem + + * device/lib/pic14/Makefile.am, device/lib/pic14/Makefile.in, + device/lib/pic14/libm/Makefile.am, + device/lib/pic14/libm/Makefile.in: + added template for NEW_PICS + * device/non-free/lib/pic14/libdev/Makefile.in: + pic14 enhanced cores enabled by default + +2012-01-20 Erik Petrich + + * support/regression/tests/bug2942343.c: disable for test-host + * support/regression/tests/bug3475990.c: skip named address space + declaration for test-host + +2012-01-19 Philipp Klaus Krause + + * src/SDCCnaddr.hpp: + Fix preprocessing step for named address spaces. + +2012-01-19 Philipp Klaus Krause + + * src/SDCCnaddr.cc, + src/SDCCnaddr.hpp, + src/SDCCopt.c, + src/SDCCopt.h, + support/regression/tests/bug3475990.c: + Fixed bug #3475990. + +2012-01-19 Borut Razem + + * device/lib/pic14/configure.in, device/lib/pic14/configure, + device/lib/pic14/Makefile.am, device/lib/pic14/Makefile.in, + device/lib/pic14/libm/Makefile.am, + device/lib/pic14/libm/Makefile.in: + pic14 enhanced cores enabled by default; gputils 0.14.1 or + newer required + +2012-01-18 Maarten Brock + + * device/lib/_fsget1arg.c, + * device/lib/_fsget2args.c: cosmetics + * device/lib/_fsnormalize.c: fixed bug 3474855 + * support/regression/tests/bug3474855.c: new, added + +2012-01-16 Philipp Klaus Krause + + * src/z80/gen.c: + Fix signed comparison on gbz80. + * device/lib/_memmove.c: + Fix comparison in pointer location for memmove(). + * src/z80/peeph-gbz80.def: + Enable some jump peepholes for gbz80. + +2012-01-15 Philipp Klaus Krause + + * src/z80/gen.c: + Fix #3473876. + * Changelog: + Pretend to live in the year 2012 to not cause suspicion. + * device/lib/_memmove.c: + Simplified test deciding copy direction for memmove(). + * src/z80/peeph-gbz80.def: + Use gbz80-specific load-and-increment/decrement instructions. + * src/z80/mappings.i: + Use more intuitive add sp, d syntax instead of lda sp, d(sp). + +2012-01-15 Borut Razem + + * sdas/asrab/Makefile.in: fixed linking with -lm math library + * src/SDCCnaddr.cc: removed unicode BOM + * device/lib/pic14/configure.in, device/lib/pic14/configure, + device/lib/pic14/aclocal.m4: fixed transfer of gcc CFLAGS to + sdcc while generating dependencies + +2012-01-14 Philipp Klaus Krause + + * src/z80/gen.c: + Fixed bug #3473863 in increment of pointers, fixed similar bug in equality comparison. + * support/regression/tests/memory.c: + Enable a memchr() test. + * support/regression/tests/bug2729218.c: + Move struct out of ROM for gbz80. + +2012-01-14 Philipp Klaus Krause + + * src/z80/main.c: + Remove unnecessary value calculation in _hasNativeMulFor(). + +2012-01-14 Maarten Brock + + * .version, + * doc/sdccman.lyx: bumped version to 3.1.2 + * src/SDCCicode.c (checkTypes): fixed bug 2942343 + * src/SDCCnaddr.cc: svn properties + * src/SDCCnaddr.hpp: removed some typename keywords for MSVC, + fixed warning + * src/src.vcxproj: added SDCCnaddr.*, added boost include path + * src/z80/z80.vcxproj: upgraded boost include path + * support/regression/tests/bug2942343.c: new, added + +2012-01-11 Borut Razem + + * src/SDCC.lex: removed #line rule handled by preprocessor + +2012-01-11 Philipp Klaus Krause + + * src/SDCCglobl.h, + src/z80/z80.h, + src/z80/main.c, + src/z80/ralloc2.cc, + src/SDCCnaddr.hpp, + src/SDCCmain.c, + src/SDCCnaddr.cc: + Make optimal placement of bank-selection instructions configurable using --max-allocs-per-node and --dump-graphs options. + +2012-01-10 Philipp Klaus Krause + + * src/SDCCnaddr.hpp, + src/SDCCopt.c, + src/SDCCopt.h: + Optimal placement of bank-switching calls. + +2012-01-10 Philipp Klaus Krause + + * src/SDCCicode.h, + src/SDCCnaddr.cc, + src/SDCCnaddr.hpp, + src/SDCCopt.c, + src/z80/ralloc2.cc, + src/SDCCopt.h, + src/Makefile.in: + Preparations for optimal placement of bank-switching calls. + +2012-01-10 Erik Petrich + + * src/SDCCicode.c: fixed bug 3466784 + +2012-01-09 Leland Morrison + + * sim/ucsim/z80.src/glob_lr35902.cc: disassemble for gb processor + * sim/ucsim/z80.src/inst_lr35902.cc: instruction simulation for gb + * sim/ucsim/z80.src/lr35902.cc, + * sim/ucsim/z80.src/lr35902cl.h: definition of gb processor + * sim/ucsim/z80.src/z80cl.h, + * sim/ucsim/z80.src/z80.cc: added peek1 function to look at next opcode + * sim/ucsim/z80.src/glob.cc: fixes to disassembly for "ld e,", + "inc (hl)", and "dec (hl)" for z80 processor + * sim/ucsim/z80.src/glob.h: added declaration for gb disassembly table + * sim/ucsim/z80.src/inst_r2k.h: fix to sign extension for add sp,d + * sim/ucsim/z80.src/simz80.cc: added -tlr35902 option for gameboy + * support/regression/Makefile.in, + * support/regression/ports/ucgbz80/*: added option to run regression + tests for the gb processor using ucsim + +2012-01-08 Maarten Brock + + * src/SDCC.lex: included io.h for read() declaration with MSVC, + fixed linenr bug + * src/SDCCerr.c: made W_LIT_OVERFLOW pedantic + * src/SDCCglue.c (printIvalType, printIvalBitFields), + * src/SDCCicode.c checkTypes): removed lessPedantic check + * src/SDCCicode.c (geniCodeCast): fixed bug 3470368 + +2012-01-06 Philipp Klaus Krause + + * src/z80/gen.c: + Fixed width of lower part of large literals. + +2012-01-06 Borut Razem + + * sdas/linksrc/Makefile.in: removed LKLIB + * device/non-free/lib/Makefile.in: removed SOURCES + +2012-01-04 Philipp Klaus Krause + + * src/hc08/gen.c: + More explicit stack size reporting for hc08. + +2012-01-04 Maarten Brock + + * src/SDCCopt.c (killDeadCode): fixed bug 2862308 + * support/regression/tests/bug2862308.c: new, added + +2012-01-03 Philipp Klaus Krause + + * src/z80/gen.c, + support/regression/tests/gcc-torture-execute-string-opt-5.c: + Fixed bug #3463342. + +2012-01-03 Maarten Brock + + * sdas/as6808/m08ext.c, + * sdas/as6808/as_hc08.vcxproj, + * sdas/as6808/as_hc08.vcxproj.filters, + * sdas/as6808/Makefile.in: removed m08ext.c + * sdas/as6808/m08adr.c, + * sdas/as6808/m08mch.c, + * sdas/as6808/m08pst.c, + * sdas/as6808/m6808.h, + * sdas/asxxsrc/asout.c: synced with ASxxxx v5 to fix bug 2894291 + +2012-01-02 Borut Razem + + * sdcc/SDCC.lex: included unistd.h, needed by flex 2.5.4 on + NetBSD 5.0.1 sparc64 for read() declaration + * sdas/linksrc/lkar.h: '\n' replaced by '\012' + +2012-01-02 Maarten Brock + + * src/src.vcxproj: increased stack size 32M/64M so it never overflows + * src/Makefile.in: added flex fast flag -f + * src/SDCC.lex: removed preprocessor warning and error rules, + removed EOL after #... rules + +2011-12-29 Maarten Brock + + * device/lib/clean.mk: added z180 and r2k + * sim/ucsim/cmd.src/cmdlex.l: fixed unused yyunput warning + * src/hc08/main.c: removed unused BSEG + * src/SDCCglue.c (glue): suppress unused segments + * src/SDCCmem.c (allocMap, initMem): skip when name==NULL, + (allocGlobal): use x_abs for __at on z80, fixed bug 2040874 + * src/z80/main.c: removed ISEG, XSEG, BSEG, OVERLAY, added DABS (x_abs) + * support/regression/fwk/include/testfwk.h, + * support/regression/tests/absolute.c: z80 supports __at + +2011-12-29 Borut Razem + + * support/cpp/libcpp/lex.c: + partialy synchronized with sdcpp 4.6.[12]: no mmx, sse, altivec + * support/cpp/version.c: updated version to 4.6.2 + * support/cpp/configure.in, support/cpp/configure, + support/cpp/config.in: WORDS endianness detection + +2011-12-27 Maarten Brock + + * src/SDCC.lex, + * src/SDCC.y: fixed bugs 1810965 and 2698805 + * src/SDCCsymt.c (checkSClass): removed old hack-o-matic + * support/regression/tests/bug1810965.c: new, added + +2011-12-26 Philipp Klaus Krause + + * src/SDCCralloc.hpp: + Reduce stack space usage in recursion. + +2011-12-25 Maarten Brock + + * device/lib/r2k/setjmp.s, + * device/lib/z180/setjmp.s, + * device/lib/z80/setjmp.s: optimized + * device/lib/r2k/*, + * device/lib/z180/*, + * device/lib/z80/*: use native eol + +2011-12-24 Maarten Brock + + * device/include/setjmp.h: changed longjmp return type to void + * device/lib/_setjmp.c: but use int for the implementation + +2011-12-24 Erik Petrich + + * src/SDCCopt.c (replaceRegEqv): fixed bug 2938101 + +2011-12-23 Philipp Klaus Krause + + * src/SDCCerr.h, + src/SDCCerr.c, + src/SDCCicode.c: + Warn about return statements in _Noreturn functions. + * device/include/setjmp.h, + device/lib/_setjmp.c: + Make longjmp() a _Noreturn function, as required by the C11 standard. + * src/SDCClabel.c, + src/z80/gen.c: + Do some basic optimizations for _Noreturn functions. + +2011-12-23 Erik Petrich + + * src/SDCClabel.c (labelIfx): fixed bug 3463455 + * support/regression/tests/gcc-torture-execute-loop-12.c: + reenable tests for hc08 and ds390 + * support/regression/compact-results.py: wider test name field + +2011-12-22 Maarten Brock + + * src/SDCCerr.c: changed E_NONRENT_ARGS description + +2011-12-22 Philipp Klaus Krause + + * src/SDCCmain.c, + src/SDCCglobl.h, + src/SDCC.lex: + Add option and pragma for ISO C11. + * support/regression/tests/gcc-torture-execute-anon-1.c: + Disable for compilers other than sdcc and use sdcc in C11 mode. + * src/SDCCsymt.c, + src/SDCCsymt.h, + src/SDCC.y, + src/SDCC.lex, + device/include/stdnoreturn.h: + Accept C11 keyword _Noreturn. + * device/include/stdio.h: + Do not declare gets() in C11 mode. + +2011-12-21 Maarten Brock + + * sdas/as6808/Makefile.in, + * sdas/as8051/Makefile.in, + * sdas/asgb/Makefile.in, + * sdas/asrab/Makefile.in, + * sdas/asz80/Makefile.in: reverted as it fails to build without error + +2011-12-21 Philipp Klaus Krause + + * support/regression/tests/gcc-torture-execute-pure-1.c, + support/regression/tests/gcc-torture-execute-string-opt-17.c, + support/regression/tests/gcc-torture-execute-pta-field-1.c, + support/regression/tests/gcc-torture-execute-string-opt-18.c, + support/regression/tests/gcc-torture-execute-struct-ini-1.c, + support/regression/tests/gcc-torture-execute-pta-field-2.c, + support/regression/tests/gcc-torture-execute-ptr-arith-1.c, + support/regression/tests/gcc-torture-execute-unroll-1.c, + support/regression/tests/gcc-torture-execute-struct-ini-2.c, + support/regression/tests/gcc-torture-execute-struct-ini-3.c, + support/regression/tests/gcc-torture-execute-string-opt-5.c, + support/regression/tests/gcc-torture-execute-stdarg-3.c, + support/regression/tests/gcc-torture-execute-shiftopt-1.c, + support/regression/tests/gcc-torture-execute-struct-ini-4.c, + support/regression/tests/gcc-torture-execute-stdarg-4.c, + support/regression/tests/gcc-torture-execute-switch-1.c, + support/regression/tests/gcc-torture-execute-scope-1.c, + support/regression/tests/gcc-torture-execute-loop-10.c, + support/regression/tests/gcc-torture-execute-loop-11.c, + support/regression/tests/gcc-torture-execute-loop-12.c, + support/regression/tests/gcc-torture-execute-loop-13.c, + support/regression/tests/gcc-torture-execute-loop-14.c, + support/regression/tests/gcc-torture-execute-loop-15.c, + support/regression/tests/gcc-torture-execute-loop-1.c, + support/regression/tests/gcc-torture-execute-loop-2.c, + support/regression/tests/gcc-torture-execute-loop-2c.c, + support/regression/tests/gcc-torture-execute-loop-2d.c, + support/regression/tests/gcc-torture-execute-loop-3b.c, + support/regression/tests/gcc-torture-execute-loop-3.c, + support/regression/tests/gcc-torture-execute-loop-3c.c, + support/regression/tests/gcc-torture-execute-loop-5.c, + support/regression/tests/gcc-torture-execute-loop-6.c, + support/regression/tests/gcc-torture-execute-loop-7.c, + support/regression/tests/gcc-torture-execute-loop-8.c, + support/regression/tests/gcc-torture-execute-loop-9.c, + support/regression/tests/gcc-torture-execute-func-ptr-1.c, + support/regression/tests/gcc-torture-execute-const-addr-expr-1.c, + support/regression/tests/gcc-torture-execute-divmod-1.c, + support/regression/tests/gcc-torture-execute-divcmp-4.c, + support/regression/tests/gcc-torture-execute-divconst-1.c, + support/regression/tests/gcc-torture-execute-compare-1.c, + support/regression/tests/gcc-torture-execute-divconst-2.c, + support/regression/tests/gcc-torture-execute-compare-2.c, + support/regression/tests/gcc-torture-execute-compare-3.c, + support/regression/tests/gcc-torture-execute-loop-12.c, + support/regression/tests/gcc-torture-execute-doloop-1.c, + support/regression/tests/gcc-torture-execute-doloop-2.c, + support/regression/tests/gcc-torture-execute-enum-2.c, + support/regression/tests/gcc-torture-execute-ifcvt-onecmpl-abs-1.c, + support/regression/tests/gcc-torture-execute-divcmp-1.c, + support/regression/tests/gcc-torture-execute-enum-3.c, + support/regression/tests/gcc-torture-execute-cmpsf-1.c, + support/regression/tests/gcc-torture-execute-mod-1.c, + support/regression/tests/gcc-torture-execute-divcmp-2.c, + support/regression/tests/gcc-torture-execute-int-compare.c, + support/regression/tests/gcc-torture-execute-divcmp-3.c, + support/regression/tests/gcc-torture-execute-anon-1.c, + support/regression/tests/gcc-torture-execute-arith-1.c, + support/regression/tests/gcc-torture-execute-postmod-1.c, + support/regression/tests/gcc-torture-execute-bitfld-1.c, + support/regression/tests/gcc-torture-execute-pending-4.c: + Added some tests from the execute part of the gcc torture regression test suite. + +2011-12-20 Maarten Brock + + * sdas/as6808/Makefile.in, + * sdas/as8051/Makefile.in, + * sdas/asgb/Makefile.in, + * sdas/asrab/Makefile.in, + * sdas/asz80/Makefile.in: added dependencies + +2011-12-19 Maarten Brock + + * sdas/asz80/z80pst.c: forgot this one, probably sdas dependencies are + insufficient too + +2011-12-18 Maarten Brock + + * debugger/mcs51/sdcdb.c (escapeQuotes): fixed warning + * sdas/asrab/rabbitmch.c: fixed bug 3461821 by calling outrb with 0 + * sdas/as6808/m08pst.c, + * sdas/as8051/i51adr.c, + * sdas/as8051/i51mch.c, + * sdas/as8051/i51pst.c, + * sdas/as8051/i8051.h, + * sdas/asgb/gbpst.c, + * sdas/asxxsrc/asdata.c, + * sdas/asxxsrc/asexpr.c, + * sdas/asxxsrc/aslex.c, + * sdas/asxxsrc/aslist.c, + * sdas/asxxsrc/asmain.c, + * sdas/asxxsrc/asout.c, + * sdas/asxxsrc/assym.c, + * sdas/asxxsrc/asxxxx.h, + * sdas/asz80/z80mch.c, + * sdas/linksrc/aslink.h, + * sdas/linksrc/lkarea.c, + * sdas/linksrc/lkhead.c, + * sdas/linksrc/lklex.c, + * sdas/linksrc/lklist.c, + * sdas/linksrc/sdld.c, + * sdas/linksrc/sdld.h: another step towards ASxxxx v5 + * sdas/asrab/rabbit.h, + * sdas/asrab/rabbitadr.c, + * sdas/asrab/rabbitext.c, + * sdas/asrab/rabbitpst.c: native line endings, no TABs + * src/ds390/main.c, + * src/mcs51/main.c, + * src/z80/main.c: asxxx -z flag is now case INsensitive + * src/hc08/main.c: fixed bug 1666106 by adding (PAG) to DSEG and OSEG + * src/SDCCglobl.h: fixed -E comment + * src/SDCCicode.c (geniCodeAdd), + * src/SDCCsymt.c (compStructSize): added error for unknown struct size + * src/SDCClabel.c: no TABs + +2011-12-17 Maarten Brock + + * device/include/mcs51/cc2530.h: new, added, thanks Zafi Ramarosandratana + +2011-12-08 Maarten Brock + + * device/lib/_atof.c, + * device/lib/_divuint.c, + * device/lib/_divulong.c, + * device/lib/_fsadd.c, + * device/lib/acosf.c, + * device/lib/asincosf.c, + * device/lib/asinf.c, + * device/lib/cosf.c, + * device/lib/cotf.c, + * device/lib/expf.c, + * device/lib/printf_large.c, + * device/lib/sincosf.c, + * device/lib/sincoshf.c, + * device/lib/sinf.c, + * device/lib/tancotf.c, + * device/lib/tanf.c, + * support/regression/tests/bug1337835.c, + * support/regression/tests/bug2719592.c, + * support/regression/tests/bug2805333.c, + * support/regression/tests/bug3223041.c, + * support/regression/tests/bug3290691.c, + * support/regression/tests/funptrs.c: changed BOOL to bool + +2011-12-07 Maarten Brock + + * device/include/stdbool.h: removed BOOL + * src/SDCCast.c (decorateType, addess of), + * src/SDCCsymt.c (checkSClass): fixed bug 2934292 + * support/regression/tests/bool.c: enabled function pointer tests + +2011-12-07 Maarten Brock + + * sdas/linksrc/aslink.h, + * sdas/linksrc/lkarea.c, + * sdas/linksrc/lkbank.c, + * sdas/linksrc/lkdata.c, + * sdas/linksrc/lklex.c, + * sdas/linksrc/lklist.c, + * sdas/linksrc/lkmain.c, + * sdas/linksrc/lknoice.c, + * sdas/linksrc/lkout.c, + * sdas/linksrc/lkrloc.c, + * sdas/linksrc/lkrloc3.c, + * sdas/linksrc/lks19.c, + * sdas/linksrc/lksym.c, + * sdas/linksrc/Makefile.in: and another step towards ASxxxx v5 + +2011-12-05 Philipp Klaus Krause + + * src/z80/ralloc.c: + Fixed bug #3441816. + +2011-12-04 Maarten Brock + + * sdas/linksrc/aslink.h, + * sdas/linksrc/aslink.vcxproj, + * sdas/linksrc/aslink.vcxproj.filters, + * sdas/linksrc/lkar.c, + * sdas/linksrc/lkarea.c, + * sdas/linksrc/lkbank.c, + * sdas/linksrc/lkdata.c, + * sdas/linksrc/lkhead.c, + * sdas/linksrc/lklex.c, + * sdas/linksrc/lklibr.c, + * sdas/linksrc/lklist.c, + * sdas/linksrc/lkmain.c, + * sdas/linksrc/lkmem.c, + * sdas/linksrc/lknoice.c, + * sdas/linksrc/lkout.c, + * sdas/linksrc/lkrloc.c, + * sdas/linksrc/lkrloc3.c, + * sdas/linksrc/lks19.c, + * sdas/linksrc/lksdcclib.c, + * sdas/linksrc/lksdcdb.c, + * sdas/linksrc/lksym.c, + * sdas/linksrc/Makefile.in: next step towards ASxxxx v5 + * src/SDCCmem.c (allocIntoSeg): MSVC 2010 still needs all declarations at + the start of a block in C mode + * src/z80/gen.c (genPointerSet): fixed warning + * src/SDCCast.c (processParms): removed incorrect function pointer check + * support/regression/tests/bug3440327.c: reenabled test for mcs51 + +2011-12-03 Philipp Klaus Krause + + * support/regression/tests/bug3444293.c + Fix warning in regression test. + +2011-12-02 Philipp Klaus Krause + + * src/SDCCcse.c, + src/SDCCicode.h: + Rename IS_ASSOCIATIVE to IS_COMMUTATIVE. + +2011-12-01 Philipp Klaus Krause + + * src/z80/ralloc2.cc, + src/z80/gen.c, + src/z80/peeph-z80.def: + Minor improvements in pointer handling for the z80 backends. + +2011-12-01 Philipp Klaus Krause + + * src/SDCClabel.c: + Disable hidden jump-to-jump optimization for mcs51, since it breaks large and huge. + +2011-11-30 Philipp Klaus Krause + + * support/regression/tests/bug3440327.c: + Disable bug 3440327 test on mcs51. + +2011-11-30 Philipp Klaus Krause + + * src/SDCCsymt.c: + Cleanup leftover warning. + +2011-11-29 Philipp Klaus Krause + + * src/z80/ralloc2.cc, + src/z80/gen.c, + src/z80/peeph-z80.def: + Some small improvements to the generated code. + +2011-11-29 Philipp Klaus Krause + + * src/z80/ralloc2.cc, + support/regression/tests/bug3444293.c: + Fixed bug #3444293. + +2011-11-28 Philipp Klaus Krause + + * support/regression/tests/bug3440327.c: + Regression test for bug #3440327. + +2011-11-28 Philipp Klaus Krause + + * src/SDCClabel.c: + Optimize hidden jump-to-jump. + +2011-11-28 Philipp Klaus Krause + + * src/z80/gen.c: + Replaced some uses of isLastUse() by the safer isPairDead(). + +2011-11-28 Philipp Klaus Krause + + * Merged the addrspacequal branch (named address spaces). + +2011-11-28 Borut Razem + + * sim/ucsim/libltdl: direcrory removed since it is not used + * support/scripts/gen_known_bugs.pl: warious fixes + * src/pic16/ralloc.c, sim/ucsim/pobj.cc, sim/ucsim/utils.cc, + sdas/linksrc/lkmain.c: + fixed bug #3444387: Minor spelling fix in binary files; + thanks to Gudjon I. Gudjonsson for the patch + +2011-11-27 Borut Razem + + * Small Device C Compiler 3.1.0 released + * .version, doc/sdccman.lyx: changed sdcc version to 3.1.1 + * support/scripts/gen_known_bugs.pl: adopted to the new SF bug tracker + 2011-11-21 Philipp Klaus Krause * src/z80/gen.c: Fixed bug #3440327. +2011-11-17 Philipp Klaus Krause + + * src/SDCCsymt.h, + src/SDCCsymt.c, + src/SDCCast.c, + src/SDCCopt.c: + Error message for implicit casts between named address spaces, fix live-range analysis (regression tests passing now). + +2011-11-15 Philipp Klaus Krause + + * src/SDCCsymt.c, + src/SDCCerr.h, + src/SDCCerr.c: + Error message for attemting to use named address spacces for auto variables. + +2011-11-15 Philipp Klaus Krause + + * src/SDCCopt.c: + Fix broken control and data flow handling (regression tests passing now, exept for bug-895992.c). + +2011-11-14 Philipp Klaus Krause + + * src/SDCCopt.c: + Improve handling of variables in named address space passed as parameters. + +2011-11-14 Philipp Klaus Krause + + * src/SDCCopt.c: + Avoid emitting some unecessary bank switching calls. + +2011-11-14 Philipp Klaus Krause + + * src/SDCCast.c: + Keep global named address spaces alive over functions. + +2011-11-14 Philipp Klaus Krause + + * src/SDCCicode.c, + src/SDCCopt.c: + Debug message cleanup, reenable address space splitting. + 2011-11-14 Raphael Neider * device/include/pic14/pic14devices.txt, @@ -29,6 +3437,23 @@ single mnemonic per assembly line, available peephole functions +2011-11-14 Philipp Klaus Krause + + * src/SDCCcse.c, + src/SDCCicode.c, + src/SDCCopt.c: + Basic support for pointers into named address spaces. + +2011-11-14 Philipp Klaus Krause + + * src/SDCCicode.c, + src/SDCCsymt.c, + src/SDCCsymt.h, + src/SDCC.y, + src/SDCCopt.c, + src/SDCCast.c: + Debug messages related to pointers to named address spaces. + 2011-11-12 Borut Razem * added XXX_bits deprecation note in chapter @@ -78,7 +3503,40 @@ 2011-11-11 Borut Razem * src/SDCCsystem.c: removed wine bug workaround: - wine bug #25062 was fixed in wine 1.3.8 + wine bug #25062 was fixed in wine 1.3. + +2011-11-10 Philipp Klaus Krause + + * src/SDCCmem.h, + src/SDCCmem.c, + src/SDCCglue.c: + Use named address space as segment name for the linker. + +2011-11-10 Philipp Klaus Krause + + * src/SDCCsymt.h, + src/SDCCsymt.c, + src/SDCC.y, + src/SDCCopt.c: + Basic compiler-side named address space support. + +2011-11-09 Philipp Klaus Krause + + * src/SDCCsymt.h, + src/SDCC.y, + src/SDCCopt.c, + src/SDCCicode.c + src/z80/ralloc.c: + Preparations for named address space support. + +2011-11-08 Philipp Klaus Krause + + * src/SDCCsymt.c, + src/SDCCsymt.h, + src/SDCC.y, + src/SDCC.lex, + src/SDCCast.c: + Preparations for named address space support. 2011-11-05 Borut Razem @@ -3900,7 +7358,7 @@ 2010-09-18 Borut Razem * debugger/mcs51/cmd.c: - fixed warning: suggest explicit braces to avoid ambiguous ‘else’ + fixed warning: suggest explicit braces to avoid ambiguous 'else' 2010-09-18 Philipp Klaus Krause @@ -4084,7 +7542,8 @@ * support/regression/tests/bug3037889.c: testBug3037889() renamed to Bug3037889() so that the function is compiled but not executed - * src/pic/ralloc.c: fixed gcc warnings: statement with no effect + * src/pic/ralloc.c: + fixed bug #3038483: running make of revision 5905 produces warnings 2010-08-13 Borut Razem @@ -20309,7 +23768,7 @@ wherever there is enough space for it, and IDATA can be anywhere in internal RAM. For now compile using -Wl-Y[stack_size]. The mem file is different for this option as well, since it - makes no sense of talking about DSEG lenght. + makes no sense of talking about DSEG length. 2004-01-02 Vangelis Rokas @@ -23817,6 +27276,7 @@ 2001-11-07 Michael Hope * support/regression/tests/float.c (testFloatAdd): Fixed up warning. + 2001-11-18 Bernhard Held * sdcc/support/regression/tests/bug-460010.c: fix seg violation on host @@ -24380,4 +27840,4 @@ * as/mcs51/lklex.c: accept everything as symbol name in rel-files, bug fix ID 452601 * as/mcs51/lksym.c: accept everything as symbol name in rel-files, bug fix ID 452601 -$Revision: 7066 $ +$Revision: 8008 $ diff -Nru sdcc-3.1.0+dfsg/Makefile.common.in sdcc-3.2.0+dfsg/Makefile.common.in --- sdcc-3.1.0+dfsg/Makefile.common.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/Makefile.common.in 2012-02-10 10:16:50.000000000 +0000 @@ -39,26 +39,28 @@ lib_dir_suffix = @lib_dir_suffix@ # Modules to enable/disable -OPT_DISABLE_AVR = @OPT_DISABLE_AVR@ -OPT_DISABLE_DS390 = @OPT_DISABLE_DS390@ -OPT_DISABLE_DS400 = @OPT_DISABLE_DS400@ -OPT_DISABLE_HC08 = @OPT_DISABLE_HC08@ -OPT_DISABLE_MCS51 = @OPT_DISABLE_MCS51@ -OPT_DISABLE_PIC14 = @OPT_DISABLE_PIC14@ -OPT_DISABLE_PIC16 = @OPT_DISABLE_PIC16@ -OPT_DISABLE_XA51 = @OPT_DISABLE_XA51@ -OPT_DISABLE_Z80 = @OPT_DISABLE_Z80@ -OPT_DISABLE_Z180 = @OPT_DISABLE_Z180@ -OPT_DISABLE_R2K = @OPT_DISABLE_R2K@ -OPT_DISABLE_GBZ80 = @OPT_DISABLE_GBZ80@ - -OPT_DISABLE_UCSIM = @OPT_DISABLE_UCSIM@ -OPT_DISABLE_DEVICE_LIB= @OPT_DISABLE_DEVICE_LIB@ -OPT_DISABLE_PACKIHX = @OPT_DISABLE_PACKIHX@ -OPT_ENABLE_DOC = @OPT_ENABLE_DOC@ -OPT_DISABLE_SDCPP = @OPT_DISABLE_SDCPP@ +OPT_DISABLE_AVR = @OPT_DISABLE_AVR@ +OOPT_DISABLE_DS390 = @OPT_DISABLE_DS390@ +OPT_DISABLE_DS400 = @OPT_DISABLE_DS400@ +OPT_DISABLE_GBZ80 = @OPT_DISABLE_GBZ80@ +OPT_DISABLE_HC08 = @OPT_DISABLE_HC08@ +OPT_DISABLE_MCS51 = @OPT_DISABLE_MCS51@ +OPT_DISABLE_PIC14 = @OPT_DISABLE_PIC14@ +OPT_DISABLE_PIC16 = @OPT_DISABLE_PIC16@ +OPT_DISABLE_R2K = @OPT_DISABLE_R2K@ +OPT_DISABLE_XA51 = @OPT_DISABLE_XA51@ +OPT_DISABLE_Z180 = @OPT_DISABLE_Z180@ +OPT_DISABLE_Z80 = @OPT_DISABLE_Z80@ + +OPT_ENABLE_DOC = @OPT_ENABLE_DOC@ + +OPT_DISABLE_DEVICE_LIB = @OPT_DISABLE_DEVICE_LIB@ +OPT_DISABLE_PACKIHX = @OPT_DISABLE_PACKIHX@ +OPT_DISABLE_SDBINUTILS = @OPT_DISABLE_SDBINUTILS@ +OPT_DISABLE_SDCPP = @OPT_DISABLE_SDCPP@ +OPT_DISABLE_UCSIM = @OPT_DISABLE_UCSIM@ -SLIB = $(top_builddir)/support/util +SLIB = $(top_builddir)/support/util EXEEXT = @EXEEXT@ transform = @program_transform_name@ diff -Nru sdcc-3.1.0+dfsg/Makefile.in sdcc-3.2.0+dfsg/Makefile.in --- sdcc-3.1.0+dfsg/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/Makefile.in 2012-03-10 17:53:10.000000000 +0000 @@ -1,5 +1,5 @@ # -# +# sdcc project main Makefile # SHELL = /bin/sh @@ -9,6 +9,8 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +EXEEXT = @EXEEXT@ + include Makefile.common SDCC_LIBS = support/makebin @@ -20,68 +22,76 @@ SDCC_PACKIHX = support/packihx SDCC_LIBRARIAN = support/librarian -SDCC_SDRANLIB = support/sdranlib +SDCC_SDBINUTILS = support/sdbinutils -TARGETS = sdcc-librarian sdcc-sdranlib +TARGETS = sdcc-librarian ifeq ($(OPT_DISABLE_HC08), 0) -SDCC_AS += sdas/as6808 -SDCC_LD += sdcc-ld6808 +SDCC_AS += sdas/as6808 +SDCC_LD += sdcc-ld6808 endif ifeq ($(OPT_DISABLE_MCS51), 0) -SDCC_AS += sdas/as8051 -SDCC_LD += sdcc-ld8051 -SDCC_MISC += debugger/mcs51 +SDCC_AS += sdas/as8051 +SDCC_LD += sdcc-ld8051 +SDCC_MISC += debugger/mcs51 endif ifeq ($(OPT_DISABLE_Z80), 0) -SDCC_AS += sdas/asz80 -SDCC_LD += sdcc-ldz80 +SDCC_AS += sdas/asz80 +SDCC_LD += sdcc-ldz80 endif ifeq ($(OPT_DISABLE_R2K), 0) -SDCC_AS += sdas/asrab -SDCC_LD += sdcc-ldz80 +SDCC_AS += sdas/asrab +SDCC_LD += sdcc-ldz80 endif ifeq ($(OPT_DISABLE_GBZ80), 0) -SDCC_AS += sdas/asgb -SDCC_LD += sdcc-ldgb +SDCC_AS += sdas/asgb +SDCC_LD += sdcc-ldgb endif ifeq ($(OPT_DISABLE_UCSIM), 0) -TARGETS += sdcc-misc -SDCC_MISC += sim/ucsim -PKGS += $(SDCC_MISC) +TARGETS += sdcc-misc +SDCC_MISC += sim/ucsim +PKGS += $(SDCC_MISC) +endif + +SDCC_BINUTILS = +ifeq ($(OPT_DISABLE_SDBINUTILS), 0) +TARGETS += sdcc-sdbinutils +PKGS += $(SDCC_SDBINUTILS) +SDBINUTILS_BINS = sdar$(EXEEXT) sdranlib$(EXEEXT) sdnm$(EXEEXT) +SDCC_BINUTILS = sdcc-sdbinutils endif ifeq ($(OPT_DISABLE_DEVICE_LIB), 0) -TARGETS += sdcc-device-lib -PKGS += device/lib device/non-free/lib +TARGETS += sdcc-device-lib +PKGS += device/lib device/non-free/lib endif ifeq ($(OPT_DISABLE_PACKIHX), 0) -TARGETS += sdcc-packihx -PKGS += $(SDCC_PACKIHX) +TARGETS += sdcc-packihx +PKGS += $(SDCC_PACKIHX) endif ifeq ($(OPT_ENABLE_DOC), 1) -TARGETS += sdcc-doc +TARGETS += sdcc-doc endif # always install docs, which don't need to be built PKGS += $(SDCC_DOC) ifeq ($(OPT_DISABLE_SDCPP), 0) -SDCC_LIBS += support/cpp +SDCC_LIBS += support/cpp endif -TARGETS += sdcc-libs sdcc-cc sdcc-device-inc sdcc-as sdcc-ld sdcc-scripts +TARGETS += sdcc-libs sdcc-cc sdcc-device-inc sdcc-as sdcc-ld sdcc-scripts -PKGS += $(SDCC_LIBS) src device/include device/non-free/include $(SDCC_AS) sdas/linksrc $(SDCC_LIBRARIAN) $(SDCC_SDRANLIB) $(SDCC_SCRIPTS) +PKGS += $(SDCC_LIBS) src device/include device/non-free/include \ + $(SDCC_AS) sdas/linksrc $(SDCC_LIBRARIAN) \ + $(SDCC_SDBINUTILS) $(SDCC_SCRIPTS) -PKGS_TINI = $(SDCC_LIBS) $(SDCC_AS) sdas/linksrc \ - src device/include device/non-free/include $(SDCC_PACKIHX) $(SDCC_LIBRARIAN) PORTS = $(shell cat ports.build) ALLPORTS = $(shell cat ports.all) @@ -115,14 +125,22 @@ sdcc-librarian: $(MAKE) -C $(SDCC_LIBRARIAN) -sdcc-sdranlib: - $(MAKE) -C $(SDCC_SDRANLIB) +sdcc-sdbinutils: + $(MAKE) -C $(SDCC_SDBINUTILS) + # in some cases (cygwin) the real binaries are in .libs + for bin in $(SDBINUTILS_BINS); do \ + if [ -f $(SDCC_SDBINUTILS)/binutils/.libs/$$bin ]; then \ + cp $(SDCC_SDBINUTILS)/binutils/.libs/$$bin bin; \ + else \ + cp $(SDCC_SDBINUTILS)/binutils/$$bin bin; \ + fi \ + done sdcc-device-inc: $(MAKE) -C device/include $(MAKE) -C device/non-free/include -sdcc-device-lib: sdcc-cc sdcc-as sdcc-ld +sdcc-device-lib: sdcc-cc sdcc-as sdcc-ld $(SDCC_BINUTILS) $(MAKE) -C device/lib $(MAKE) -C device/non-free/lib @@ -137,7 +155,7 @@ sdcc: $(TARGETS) -sdcc-tini: sdcc-librarian sdcc-sdranlib sdcc-cc sdcc-as sdcc-ld sdcc-device-tini sdcc-packihx +sdcc-tini: sdcc-librarian sdcc-cc sdcc-as sdcc-ld sdcc-device-tini sdcc-packihx $(MAKE) -f main.mk all # Some interesting sub rules @@ -153,15 +171,6 @@ $(MAKE) -C $$pkg install ;\ done -install-tini: checkconf sdcc - $(MAKE) -f main.mk install - @for pkg in $(PKGS_TINI); do\ - $(MAKE) -C $$pkg install ;\ - done - $(MAKE) -C device/lib install - - - # Deleting all the installed files # -------------------------------- uninstall: @@ -170,7 +179,6 @@ $(MAKE) -C $$pkg uninstall ;\ done - # Deleting all files created by building the program # -------------------------------------------------- clean: @@ -202,7 +210,6 @@ $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) mostlyclean ;\ done - # Deleting everything that can reconstructed by this Makefile. It deletes # everything deleted by distclean plus files created by bison, stc. # ----------------------------------------------------------------------- @@ -212,7 +219,6 @@ $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) realclean ;\ done - # Creating distribution # --------------------- dist: distclean @@ -222,17 +228,14 @@ mkdist sdcc;\ fi - # Performing self-test # -------------------- check: - # Performing installation test # ---------------------------- installcheck: - # Creating dependencies # --------------------- dep: $(SDCC_LIBS) @@ -241,7 +244,6 @@ $(MAKE) -C $$pkg dep ;\ done - # My rules # -------- newer: distclean @@ -257,7 +259,6 @@ putcopyright: 'put(c)' -s $(STARTYEAR) *.cc *.h *.y *.l - # Remaking configuration # ---------------------- configure: configure.in diff -Nru sdcc-3.1.0+dfsg/all.vcxproj sdcc-3.2.0+dfsg/all.vcxproj --- sdcc-3.1.0+dfsg/all.vcxproj 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/all.vcxproj 2012-06-28 14:09:28.000000000 +0000 @@ -59,94 +59,129 @@ Document - copy bin_vc\sdranlib.exe bin /y > nul + copy %(Identity) bin /y > nul bin\sdranlib.exe;%(Outputs) - copy bin_vc\sdranlib.exe bin /y > nul + Generating: %(Outputs) + copy %(Identity) bin /y > nul bin\sdranlib.exe;%(Outputs) + Generating: %(Outputs) Document - copy bin_vc\sdcdb.exe bin /y > nul + copy %(Identity) bin /y > nul bin\sdcdb.exe;%(Outputs) - copy bin_vc\sdcdb.exe bin /y > nul + Generating: %(Outputs) + copy %(Identity) bin /y > nul bin\sdcdb.exe;%(Outputs) + Generating: %(Outputs) Document - copy bin_vc\makebin.exe bin /y > nul + copy %(Identity) bin /y > nul bin\makebin.exe;%(Outputs) - copy bin_vc\makebin.exe bin /y > nul + Generating: %(Outputs) + copy %(Identity) bin /y > nul bin\makebin.exe;%(Outputs) + Generating: %(Outputs) Document - copy bin_vc\packihx.exe bin /y > nul + copy %(Identity) bin /y > nul bin\packihx.exe;%(Outputs) - copy bin_vc\packihx.exe bin /y > nul + Generating: %(Outputs) + copy %(Identity) bin /y > nul bin\packihx.exe;%(Outputs) + Generating: %(Outputs) Document - copy bin_vc\sdas6808.exe bin /y > nul + copy %(Identity) bin /y > nul bin\sdas6808.exe;%(Outputs) - copy bin_vc\sdas6808.exe bin /y > nul + Generating: %(Outputs) + copy %(Identity) bin /y > nul bin\sdas6808.exe;%(Outputs) + Generating: %(Outputs) Document - copy bin_vc\sdas8051.exe bin /y > nul + copy %(Identity) bin /y > nul bin\sdas8051.exe;%(Outputs) - copy bin_vc\sdas8051.exe bin /y > nul + Generating: %(Outputs) + copy %(Identity) bin /y > nul bin\sdas8051.exe;%(Outputs) + Generating: %(Outputs) Document - copy bin_vc\sdasgb.exe bin /y > nul + copy %(Identity) bin /y > nul bin\sdasgb.exe;%(Outputs) - copy bin_vc\sdasgb.exe bin /y > nul + Generating: %(Outputs) + copy %(Identity) bin /y > nul bin\sdasgb.exe;%(Outputs) + Generating: %(Outputs) + + + Document + copy %(Identity) bin /y > nul + bin\sdasrab.exe;%(Outputs) + Generating: %(Outputs) + copy %(Identity) bin /y > nul + bin\sdasrab.exe;%(Outputs) + Generating: %(Outputs) Document - copy bin_vc\sdasz80.exe bin /y > nul + copy %(Identity) bin /y > nul bin\sdasz80.exe;%(Outputs) - copy bin_vc\sdasz80.exe bin /y > nul + Generating: %(Outputs) + copy %(Identity) bin /y > nul bin\sdasz80.exe;%(Outputs) + Generating: %(Outputs) Document - copy bin_vc\sdcc.exe bin /y > nul + copy %(Identity) bin /y > nul bin\sdcc.exe;%(Outputs) - copy bin_vc\sdcc.exe bin /y > nul + Generating: %(Outputs) + copy %(Identity) bin /y > nul bin\sdcc.exe;%(Outputs) + Generating: %(Outputs) Document - copy bin_vc\sdcclib.exe bin /y > nul + copy %(Identity) bin /y > nul bin\sdcclib.exe;%(Outputs) - copy bin_vc\sdcclib.exe bin /y > nul + Generating: %(Outputs) + copy %(Identity) bin /y > nul bin\sdcclib.exe;%(Outputs) + Generating: %(Outputs) Document - copy bin_vc\sdcpp.exe bin /y > nul + copy %(Identity) bin /y > nul bin\sdcpp.exe;%(Outputs) - copy bin_vc\sdcpp.exe bin /y > nul + Generating: %(Outputs) + copy %(Identity) bin /y > nul bin\sdcpp.exe;%(Outputs) + Generating: %(Outputs) Document - copy bin_vc\sdld.exe bin\sdld.exe /y > nul -copy bin_vc\sdld.exe bin\sdldz80.exe /y > nul -copy bin_vc\sdld.exe bin\sdldgb.exe /y > nul -copy bin_vc\sdld.exe bin\sdld6808.exe /y > nul - bin\sdld.exe;bin\sdldz80.exe;bin\sdldgb.exe;bin\sdld6808.exe;%(Outputs) - copy bin_vc\sdld.exe bin\sdld.exe /y > nul -copy bin_vc\sdld.exe bin\sdldz80.exe /y > nul -copy bin_vc\sdld.exe bin\sdldgb.exe /y > nul -copy bin_vc\sdld.exe bin\sdld6808.exe /y > nul - bin\sdld.exe;bin\sdldz80.exe;bin\sdldgb.exe;bin\sdld6808.exe;%(Outputs) + copy %(Identity) bin\sdld.exe /y > nul +copy %(Identity) bin\sdldz80.exe /y > nul +copy %(Identity) bin\sdldrab.exe /y > nul +copy %(Identity) bin\sdldgb.exe /y > nul +copy %(Identity) bin\sdld6808.exe /y > nul + bin\sdld.exe;bin\sdldz80.exe;bin\sdldrab.exe;bin\sdldgb.exe;bin\sdld6808.exe;%(Outputs) + Generating: %(Outputs) + copy %(Identity) bin\sdld.exe /y > nul +copy %(Identity) bin\sdldz80.exe /y > nul +copy %(Identity) bin\sdldrab.exe /y > nul +copy %(Identity) bin\sdldgb.exe /y > nul +copy %(Identity) bin\sdld6808.exe /y > nul + bin\sdld.exe;bin\sdldz80.exe;bin\sdldrab.exe;bin\sdldgb.exe;bin\sdld6808.exe;%(Outputs) + Generating: %(Outputs) @@ -174,7 +209,7 @@ {6e94db45-345e-4697-98da-6c72237d6eca} false - + {f9485499-151b-4886-935c-7d687c4a0549} false @@ -194,4 +229,4 @@ - + \ No newline at end of file diff -Nru sdcc-3.1.0+dfsg/all.vcxproj.filters sdcc-3.2.0+dfsg/all.vcxproj.filters --- sdcc-3.1.0+dfsg/all.vcxproj.filters 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/all.vcxproj.filters 2012-03-18 18:25:04.000000000 +0000 @@ -22,10 +22,7 @@ - - - - + \ No newline at end of file diff -Nru sdcc-3.1.0+dfsg/cleanup-script.sh sdcc-3.2.0+dfsg/cleanup-script.sh --- sdcc-3.1.0+dfsg/cleanup-script.sh 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/cleanup-script.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -#!/bin/sh -# -# clean upstream source to achieve DFSG compliance -# Copyright 2008 by Bdale Garbee. GPL v2 or any later version. -# -rm -rf device/non-free -rm -rf sim/ucsim/libltdl - - diff -Nru sdcc-3.1.0+dfsg/config.guess sdcc-3.2.0+dfsg/config.guess --- sdcc-3.1.0+dfsg/config.guess 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/config.guess 2012-03-05 20:14:11.000000000 +0000 @@ -0,0 +1,1530 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-02-10' + +# This file 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, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +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` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -Nru sdcc-3.1.0+dfsg/config.sub sdcc-3.2.0+dfsg/config.sub --- sdcc-3.1.0+dfsg/config.sub 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/config.sub 2012-03-05 20:14:11.000000000 +0000 @@ -0,0 +1,1773 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-02-10' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file 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, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 \ + | ns16k | ns32k \ + | open8 \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i386-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -Nru sdcc-3.1.0+dfsg/config.vcxproj sdcc-3.2.0+dfsg/config.vcxproj --- sdcc-3.1.0+dfsg/config.vcxproj 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/config.vcxproj 2012-05-05 14:39:36.000000000 +0000 @@ -60,29 +60,34 @@ Document gawk -f configure_vc.awk sdas/linksrc/asxxxx_config.h.in > sdas/linksrc/asxxxx_config.h - sdas/linksrc/asxxxx_config.h;%(Outputs) gawk -f configure_vc.awk sdas/linksrc/asxxxx_config.h.in > sdas/linksrc/asxxxx_config.h + sdas/linksrc/asxxxx_config.h;%(Outputs) sdas/linksrc/asxxxx_config.h;%(Outputs) + Generating: asxxxx_config.h + Generating: asxxxx_config.h - - + Document - gawk -f %(FullPath) ChangeLog > .\src\version.h + gawk -f src/version.awk ChangeLog > ./src/version.h + gawk -f src/version.awk ChangeLog > ./src/version.h ChangeLog;%(AdditionalInputs) - .\src\version.h;%(Outputs) - gawk -f %(FullPath) ChangeLog > .\src\version.h ChangeLog;%(AdditionalInputs) - .\src\version.h;%(Outputs) + ./src/version.h;%(Outputs) + ./src/version.h;%(Outputs) + Generating: version.h + Generating: version.h - - gawk -f configure_vc.awk sdcc_vc_in.h > sdcc_vc.h + + gawk -f configure_vc.awk sdcc_vc.h.in > sdcc_vc.h + gawk -f configure_vc.awk sdcc_vc.h.in > sdcc_vc.h .version;configure_vc.awk;%(AdditionalInputs) - sdcc_vc.h;%(Outputs) - gawk -f configure_vc.awk sdcc_vc_in.h > sdcc_vc.h .version;configure_vc.awk;%(AdditionalInputs) + sdcc_vc.h;%(Outputs) sdcc_vc.h;%(Outputs) + Generating: sdcc_vc.h + Generating: sdcc_vc.h diff -Nru sdcc-3.1.0+dfsg/configure sdcc-3.2.0+dfsg/configure --- sdcc-3.1.0+dfsg/configure 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/configure 2012-05-18 16:09:24.000000000 +0000 @@ -1,11 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67. +# Generated by GNU Autoconf 2.69. # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -89,6 +87,7 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -133,6 +132,31 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -166,7 +190,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -211,14 +236,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -320,6 +356,14 @@ } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -441,6 +485,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # 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). @@ -475,16 +523,16 @@ # ... 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'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -496,28 +544,8 @@ 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 +as_test_x='test -x' +as_executable_p=as_fn_executable_p # 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'" @@ -603,6 +631,7 @@ LATEX2HTML LYX OPT_ENABLE_DOC +OPT_DISABLE_SDBINUTILS OPT_DISABLE_SDCDB OPT_DISABLE_SDCPP OPT_DISABLE_PACKIHX @@ -610,12 +639,14 @@ OPT_DISABLE_UCSIM OPT_DISABLE_XA51 OPT_DISABLE_AVR +OPT_DISABLE_S08 OPT_DISABLE_HC08 OPT_DISABLE_PIC16 OPT_DISABLE_PIC14 OPT_DISABLE_DS400 OPT_DISABLE_DS390 OPT_DISABLE_GBZ80 +OPT_DISABLE_R3KA OPT_DISABLE_R2K OPT_DISABLE_Z180 OPT_DISABLE_Z80 @@ -626,7 +657,6 @@ include_dir_suffix LIB_TYPE sdccconf_h_dir_separator -AR_S_FLAG C99_FLAG WALL_FLAG MAKEDEP @@ -662,6 +692,14 @@ VERSION PACKAGE AWK +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build target_alias host_alias build_alias @@ -708,12 +746,14 @@ enable_z80_port enable_z180_port enable_r2k_port +enable_r3ka_port enable_gbz80_port enable_ds390_port enable_ds400_port enable_pic14_port enable_pic16_port enable_hc08_port +enable_s08_port enable_avr_port enable_xa51_port enable_ucsim @@ -721,6 +761,7 @@ enable_packihx enable_sdcpp enable_sdcdb +enable_sdbinutils enable_doc enable_libgc ' @@ -748,6 +789,7 @@ support/packihx sim/ucsim debugger/mcs51 +support/sdbinutils device/lib/pic14 device/non-free/lib/pic14 device/lib/pic16 device/non-free/lib/pic16' @@ -1153,7 +1195,7 @@ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1204,8 +1246,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_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 @@ -1352,6 +1392,10 @@ --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 @@ -1367,12 +1411,14 @@ --disable-z80-port Excludes the z80 port --disable-z180-port Excludes the z180 port --disable-r2k-port Excludes the r2k port + --disable-r3ka-port Excludes the r3ka port --disable-gbz80-port Excludes the Gameboy gbz80 port --disable-ds390-port Excludes the DS390 port --disable-ds400-port Excludes the DS400 port --disable-pic14-port Excludes the PIC14 port --disable-pic16-port Excludes the PIC16 port --disable-hc08-port Excludes the HC08 port + --disable-s08-port Excludes the S08 port --enable-avr-port Includes the AVR port (disabled by default) --enable-xa51-port Includes the XA51 port (disabled by default) --disable-ucsim Disables configuring and building of ucsim @@ -1380,6 +1426,7 @@ --disable-packihx Disables building packihx --disable-sdcpp Disables building sdcpp --disable-sdcdb Disables building sdcdb + --disable-sdbinutils Disables configuring and building of sdbinutils --enable-doc Enables building the documentation --enable-libgc Use the Bohem memory allocator. Lower runtime footprint. @@ -1482,9 +1529,9 @@ if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.67 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1528,7 +1575,7 @@ ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1565,7 +1612,7 @@ ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1603,7 +1650,7 @@ ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile @@ -1616,10 +1663,10 @@ ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval "test \"\${$3+set}\"" = set; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1682,7 +1729,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1691,7 +1738,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel @@ -1732,7 +1779,7 @@ ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1746,7 +1793,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1764,7 +1811,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -1800,7 +1847,7 @@ ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp @@ -1813,10 +1860,10 @@ ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval "test \"\${$3+set}\"" = set; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1879,7 +1926,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1888,7 +1935,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel @@ -1919,7 +1966,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -1933,7 +1980,7 @@ # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -1946,7 +1993,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2001,7 +2048,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func @@ -2022,7 +2069,8 @@ main () { static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2038,7 +2086,8 @@ main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2064,7 +2113,8 @@ main () { static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2080,7 +2130,8 @@ main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2114,7 +2165,8 @@ main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2178,7 +2230,7 @@ rm -f conftest.val fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_compute_int @@ -2187,7 +2239,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.67. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2445,7 +2497,7 @@ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi done @@ -2535,7 +2587,111 @@ -ac_config_headers="$ac_config_headers sdccconf.h:sdccconf_in.h custom.h:custom_in.h sdas/linksrc/asxxxx_config.h" + +# Determine the host and build type. +# =========================================================================== +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 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +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. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + +ac_config_headers="$ac_config_headers sdccconf.h:sdccconf_in.h sdas/linksrc/asxxxx_config.h" for ac_prog in gawk mawk nawk awk @@ -2544,7 +2700,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then : +if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -2556,7 +2712,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2654,7 +2810,7 @@ set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2666,7 +2822,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2694,7 +2850,7 @@ set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2706,7 +2862,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2747,7 +2903,7 @@ set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2759,7 +2915,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2787,7 +2943,7 @@ set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2800,7 +2956,7 @@ 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 as_fn_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 @@ -2846,7 +3002,7 @@ set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2858,7 +3014,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2890,7 +3046,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2902,7 +3058,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2945,7 +3101,7 @@ test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3060,7 +3216,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3103,7 +3259,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3162,7 +3318,7 @@ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi fi fi @@ -3173,7 +3329,7 @@ ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3214,7 +3370,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -3224,7 +3380,7 @@ ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3261,7 +3417,7 @@ ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -3339,7 +3495,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -3348,8 +3504,7 @@ /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* 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); @@ -3446,7 +3601,7 @@ CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -3562,7 +3717,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -3587,7 +3742,7 @@ set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then : +if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then @@ -3599,7 +3754,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3631,7 +3786,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : +if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then @@ -3643,7 +3798,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3709,7 +3864,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : +if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3746,7 +3901,7 @@ ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then : +if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag @@ -3828,35 +3983,6 @@ 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" "$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 - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -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. - - # 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: @@ -3874,7 +4000,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3894,7 +4020,7 @@ # 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 as_fn_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. @@ -3955,7 +4081,7 @@ set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then : +if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -3967,7 +4093,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3995,7 +4121,7 @@ set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -4007,7 +4133,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4046,7 +4172,7 @@ set dummy autoconf; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AUTOCONF+set}" = set; then : +if ${ac_cv_prog_AUTOCONF+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AUTOCONF"; then @@ -4058,7 +4184,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AUTOCONF="autoconf" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4084,7 +4210,7 @@ set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -4096,7 +4222,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4122,7 +4248,7 @@ set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AS+set}" = set; then : +if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then @@ -4134,7 +4260,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4160,7 +4286,7 @@ set dummy cp; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CP+set}" = set; then : +if ${ac_cv_prog_CP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CP"; then @@ -4172,7 +4298,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CP="cp" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4198,7 +4324,7 @@ set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then : +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then @@ -4210,7 +4336,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4239,7 +4365,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LEX+set}" = set; then : +if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then @@ -4251,7 +4377,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4283,7 +4409,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_YACC+set}" = set; then : +if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then @@ -4295,7 +4421,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4343,7 +4469,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -4357,7 +4483,7 @@ 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 + as_fn_executable_p "$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 @@ -4406,7 +4532,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -4423,7 +4549,7 @@ 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 + as_fn_executable_p "$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 @@ -4473,7 +4599,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4628,7 +4754,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then : + if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded @@ -4744,7 +4870,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp @@ -4773,7 +4899,7 @@ for ac_header in boost/graph/adjacency_list.hpp do : ac_fn_cxx_check_header_mongrel "$LINENO" "boost/graph/adjacency_list.hpp" "ac_cv_header_boost_graph_adjacency_list_hpp" "$ac_includes_default" -if test "x$ac_cv_header_boost_graph_adjacency_list_hpp" = x""yes; then : +if test "x$ac_cv_header_boost_graph_adjacency_list_hpp" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BOOST_GRAPH_ADJACENCY_LIST_HPP 1 _ACEOF @@ -4802,7 +4928,7 @@ set dummy ccache; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CCACHE+set}" = set; then : +if ${ac_cv_prog_CCACHE+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CCACHE"; then @@ -4814,7 +4940,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CCACHE="ccache" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4846,7 +4972,7 @@ for ac_func in strerror do : ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" -if test "x$ac_cv_func_strerror" = x""yes; then : +if test "x$ac_cv_func_strerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRERROR 1 _ACEOF @@ -4871,24 +4997,24 @@ # Macro definitions # =========================================================================== -# _bor_EXECUTE_IFELSE_BODY(COMMAND) +# _sdcc_EXECUTE_IFELSE_BODY(COMMAND) # ----------------------- # Shell function body for _AC_EXECUTE_IFELSE. -# _bor_EXECUTE_IFELSE_BODY +# _sdcc_EXECUTE_IFELSE_BODY -# bor_EXECUTE_IFELSE(COMMAND[ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# sdcc_EXECUTE_IFELSE(COMMAND[ACTION-IF-TRUE], [ACTION-IF-FALSE]) # ---------------------------------------------------------------- # Try to execute COMMAND. -# bor_EXECUTE_IFELSE +# sdcc_EXECUTE_IFELSE # Check whether the compiler for the current language is SunPRO. -# bor_IS_VALID_OPTION macro checks if the current compiler, selected by +# sdcc_IS_VALID_OPTION macro checks if the current compiler, selected by # AC_LANG, supports option specified as the 1st parameter. The test fails if # the compiler returns an error or in case something is writeen to stderr. -# For example: bor_VALID_OPT(fPIC) +# For example: sdcc_VALID_OPT(-fPIC) @@ -4959,7 +5085,7 @@ if test "$ac_cv_c_compiler_gnu" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether preprocessor accepts -MM or -M" >&5 $as_echo_n "checking whether preprocessor accepts -MM or -M... " >&6; } -if test "${sdcc_cv_MM+set}" = set; then : +if ${sdcc_cv_MM+:} false; then : $as_echo_n "(cached) " >&6 else echo "#include " >_test_.c @@ -4976,14 +5102,15 @@ $as_echo "$sdcc_cv_MM" >&6; } # This is the first time when CFLAGS are set/modified!! - ac_test_CFLAGS=${CFLAGS+set} -bor_save_CFLAGS=$CFLAGS + arg1=`echo -ggdb | sed -e"s/^-*//" -e"s/-/_/"` +ac_test_CFLAGS=${CFLAGS+set} +sdcc_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C accepts -ggdb" >&5 $as_echo_n "checking whether C accepts -ggdb... " >&6; } -if test "${bor_cv_c_ggdb+set}" = set; then : +if eval \${sdcc_cv_c_$arg1+:} false; then : $as_echo_n "(cached) " >&6 else - bor_save_c_werror_flag=$ac_c_werror_flag + sdcc_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes CFLAGS="-ggdb" @@ -4999,30 +5126,32 @@ } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - bor_cv_c_ggdb=yes + eval sdcc_cv_c_$arg1=yes else - bor_cv_c_ggdb=no + eval sdcc_cv_c_$arg1=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$bor_save_c_werror_flag + ac_c_werror_flag=$sdcc_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bor_cv_c_ggdb" >&5 -$as_echo "$bor_cv_c_ggdb" >&6; } - CFLAGS=$bor_save_CFLAGS +eval ac_res=\$sdcc_cv_c_$arg1 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + CFLAGS=$sdcc_save_CFLAGS - if test "$bor_cv_c_ggdb" = "yes"; then + if test "$sdcc_cv_c_ggdb" = "yes"; then CFLAGS="-ggdb ${CFLAGS}" CXXFLAGS="-ggdb ${CXXFLAGS}" fi - ac_test_CFLAGS=${CFLAGS+set} -bor_save_CFLAGS=$CFLAGS + arg1=`echo -pipe | sed -e"s/^-*//" -e"s/-/_/"` +ac_test_CFLAGS=${CFLAGS+set} +sdcc_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C accepts -pipe" >&5 $as_echo_n "checking whether C accepts -pipe... " >&6; } -if test "${bor_cv_c_pipe+set}" = set; then : +if eval \${sdcc_cv_c_$arg1+:} false; then : $as_echo_n "(cached) " >&6 else - bor_save_c_werror_flag=$ac_c_werror_flag + sdcc_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes CFLAGS="-pipe" @@ -5038,18 +5167,19 @@ } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - bor_cv_c_pipe=yes + eval sdcc_cv_c_$arg1=yes else - bor_cv_c_pipe=no + eval sdcc_cv_c_$arg1=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$bor_save_c_werror_flag + ac_c_werror_flag=$sdcc_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bor_cv_c_pipe" >&5 -$as_echo "$bor_cv_c_pipe" >&6; } - CFLAGS=$bor_save_CFLAGS +eval ac_res=\$sdcc_cv_c_$arg1 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + CFLAGS=$sdcc_save_CFLAGS - if test "$bor_cv_c_pipe" = "yes"; then + if test "$sdcc_cv_c_pipe" = "yes"; then CFLAGS="-pipe ${CFLAGS}" # Don't use "-pipe" on x86 Solaris g++, since src/z80/ralloc2.cc dies with: # Assembler: ralloc2.cc @@ -5065,7 +5195,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the SunPRO C compiler" >&5 $as_echo_n "checking whether we are using the SunPRO C compiler... " >&6; } -if test "${bor_cv_c_compiler_sunpro+set}" = set; then : +if ${sdcc_cv_c_compiler_sunpro+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5083,17 +5213,16 @@ } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - bor_compiler_sunpro=yes + sdcc_cv_c_compiler_sunpro=yes else - bor_compiler_sunpro=no + sdcc_cv_c_compiler_sunpro=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -bor_cv_c_compiler_sunpro=$bor_compiler_sunpro fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bor_cv_c_compiler_sunpro" >&5 -$as_echo "$bor_cv_c_compiler_sunpro" >&6; } - if test "$bor_cv_c_compiler_sunpro" = "yes"; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sdcc_cv_c_compiler_sunpro" >&5 +$as_echo "$sdcc_cv_c_compiler_sunpro" >&6; } + if test "$sdcc_cv_c_compiler_sunpro" = "yes"; then C99_FLAG="-xc99" CFLAGS="-xO2 ${C99_FLAG} ${CFLAGS}" CXXFLAGS="-xO2 ${CXXFLAGS}" @@ -5106,55 +5235,112 @@ -# does AR accept the -S flag -echo '!' > conftest.ar -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $AR accepts -S" >&5 -$as_echo_n "checking whether $AR accepts -S... " >&6; } - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$AR -S -t conftest.ar " -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$AR -S -t conftest.ar ") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.out && { - test ! -s conftest.err - }; then : - ac_retval=0 +# SDCC_C_UNNAMED_STRUCT_TAG () +# chech whether C compiler supports tag in unnamed struct +# ------------------------------------------------------------------------- + + + + if test "$ac_cv_c_compiler_gnu" = "yes"; then + arg1=`echo -fms-extensions | sed -e"s/^-*//" -e"s/-/_/"` +ac_test_CFLAGS=${CFLAGS+set} +sdcc_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C accepts -fms-extensions" >&5 +$as_echo_n "checking whether C accepts -fms-extensions... " >&6; } +if eval \${sdcc_cv_c_$arg1+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + sdcc_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes - if test "$ac_retval" = 0; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - AR_S_FLAG="-S" + CFLAGS="-fms-extensions" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval sdcc_cv_c_$arg1=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - AR_S_FLAG="" + eval sdcc_cv_c_$arg1=no fi -rm conftest.err conftest.out +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$sdcc_save_c_werror_flag +fi +eval ac_res=\$sdcc_cv_c_$arg1 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + CFLAGS=$sdcc_save_CFLAGS + + else + sdcc_cv_c_fms_extensions=no + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C supports tag in unnamed struct" >&5 +$as_echo_n "checking whether C supports tag in unnamed struct... " >&6; } +if ${sdcc_cv_c_unnamed_struct_tag+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$sdcc_cv_c_fms_extensions" = "yes"; then + CFLAGS="-fms-extensions ${CFLAGS}" + fi + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +struct s1 { + int a; +}; + +struct s2 { + struct s1; + int b; +}; + +int +main () +{ + + struct s2 s; + + s.a = 1; + s.b = 2; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + sdcc_cv_c_unnamed_struct_tag=yes + +cat >>confdefs.h <<_ACEOF +#define UNNAMED_STRUCT_TAG 1 +_ACEOF + + +else -rm conftest.ar + sdcc_cv_c_unnamed_struct_tag=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sdcc_cv_c_unnamed_struct_tag" >&5 +$as_echo "$sdcc_cv_c_unnamed_struct_tag" >&6; } # Checks for typedefs, structures, and compiler characteristics. # =========================================================================== { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } -if test "${ac_cv_type_signal+set}" = set; then : +if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5192,7 +5378,7 @@ # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5 $as_echo_n "checking size of char... " >&6; } -if test "${ac_cv_sizeof_char+set}" = set; then : +if ${ac_cv_sizeof_char+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default"; then : @@ -5202,7 +5388,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (char) -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_char=0 fi @@ -5225,7 +5411,7 @@ # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 $as_echo_n "checking size of short... " >&6; } -if test "${ac_cv_sizeof_short+set}" = set; then : +if ${ac_cv_sizeof_short+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : @@ -5235,7 +5421,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (short) -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_short=0 fi @@ -5258,7 +5444,7 @@ # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } -if test "${ac_cv_sizeof_int+set}" = set; then : +if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : @@ -5268,7 +5454,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi @@ -5291,7 +5477,7 @@ # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } -if test "${ac_cv_sizeof_long+set}" = set; then : +if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : @@ -5301,7 +5487,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi @@ -5318,9 +5504,42 @@ _ACEOF +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if ${ac_cv_sizeof_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 $as_echo_n "checking whether char is unsigned... " >&6; } -if test "${ac_cv_c_char_unsigned+set}" = set; then : +if ${ac_cv_c_char_unsigned+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5330,7 +5549,8 @@ main () { static int test_array [1 - 2 * !(((char) -1) < 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -5369,6 +5589,10 @@ echo "long" exit fi + if expr "$ac_cv_sizeof_long_long" '>=' "$1" >/dev/null; then + echo "long long" + exit + fi echo "long" } @@ -5392,6 +5616,11 @@ TYPE_DWORD=`type_name 4` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TYPE_DWORD" >&5 $as_echo "$TYPE_DWORD" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking type name for qword" >&5 +$as_echo_n "checking type name for qword... " >&6; } +TYPE_QWORD=`type_name 8` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $TYPE_QWORD" >&5 +$as_echo "$TYPE_QWORD" >&6; } cat >>confdefs.h <<_ACEOF @@ -5409,6 +5638,11 @@ _ACEOF +cat >>confdefs.h <<_ACEOF +#define TYPE_QWORD $TYPE_QWORD +_ACEOF + + cat >>confdefs.h <<_ACEOF #define TYPE_UBYTE unsigned $TYPE_CHAR @@ -5425,29 +5659,68 @@ _ACEOF +cat >>confdefs.h <<_ACEOF +#define TYPE_UQWORD unsigned $TYPE_QWORD +_ACEOF -# SDCC_BUILD_BIGENDIAN ([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN]) -# ------------------------------------------------------------------------- -# SDCC_BUILD_BIGENDIAN -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether host machine byte ordering is bigendian" >&5 -$as_echo_n "checking whether host machine byte ordering is bigendian... " >&6; } -if test "${sdcc_cv_build_bigendian+set}" = set; then : +# Checking whether byte ordering is bigendian +# =========================================================================== + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else - # See if sys/param.h defines the BYTE_ORDER macro. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include -#include + #include int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif ; return 0; @@ -5455,61 +5728,116 @@ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include -#include + #include int main () { #if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif + not big endian + #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - sdcc_cv_build_bigendian=yes + ac_cv_c_bigendian=yes else - sdcc_cv_build_bigendian=no + ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - # 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 - sdcc_cv_build_bigendian=unknown - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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; } +#include + int main () { - _ascii (); _ebcdic (); +#ifndef _BIG_ENDIAN + not big endian + #endif + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - sdcc_cv_build_bigendian=yes + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$sdcc_cv_build_bigendian" = unknown; then - sdcc_cv_build_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - sdcc_cv_build_bigendian=unknown - 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 $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; 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 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else @@ -5520,44 +5848,47 @@ 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; + /* 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 if ac_fn_c_try_run "$LINENO"; then : - sdcc_cv_build_bigendian=no + ac_cv_c_bigendian=no else - sdcc_cv_build_bigendian=yes + ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sdcc_cv_build_bigendian" >&5 -$as_echo "$sdcc_cv_build_bigendian" >&6; } -case $sdcc_cv_build_bigendian in - yes) +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) -$as_echo "#define BUILD_WORDS_BIGENDIAN 1" >>confdefs.h - ;; - no) - ;; - *) - as_fn_error $? "unknown endianness -presetting sdcc_cv_build_bigendian=no (or yes) will help" "$LINENO" 5 ;; -esac +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac # Set standard installation paths @@ -6364,6 +6695,32 @@ fi + # Check whether --enable-r3ka-port was given. +if test "${enable_r3ka_port+set}" = set; then : + enableval=$enable_r3ka_port; +fi + + + if test "$enable_r3ka_port" = "no"; then + OPT_DISABLE_R3KA=1 + else + enable_r3ka_port="yes" + OPT_DISABLE_R3KA=0 + fi + + +cat >>confdefs.h <<_ACEOF +#define OPT_DISABLE_R3KA $OPT_DISABLE_R3KA +_ACEOF + + + + echo z80 >>ports.all + if test $OPT_DISABLE_R3KA = 0; then + echo z80 >>ports.build + fi + + # Check whether --enable-gbz80-port was given. if test "${enable_gbz80_port+set}" = set; then : enableval=$enable_gbz80_port; @@ -6525,6 +6882,32 @@ fi + # Check whether --enable-s08-port was given. +if test "${enable_s08_port+set}" = set; then : + enableval=$enable_s08_port; +fi + + + if test "$enable_s08_port" = "no"; then + OPT_DISABLE_S08=1 + else + enable_s08_port="yes" + OPT_DISABLE_S08=0 + fi + + +cat >>confdefs.h <<_ACEOF +#define OPT_DISABLE_S08 $OPT_DISABLE_S08 +_ACEOF + + + + echo hc08 >>ports.all + if test $OPT_DISABLE_S08 = 0; then + echo hc08 >>ports.build + fi + + # Unsupported targets # Check whether --enable-avr-port was given. @@ -6690,6 +7073,28 @@ + # Check whether --enable-sdbinutils was given. +if test "${enable_sdbinutils+set}" = set; then : + enableval=$enable_sdbinutils; +fi + + + arg1=`echo sdbinutils | sed s/-/_/` + + if test "`eval echo \\$enable_$arg1`" = "no"; then + OPT_DISABLE_SDBINUTILS=1 + else + OPT_DISABLE_SDBINUTILS=0 + fi + + +cat >>confdefs.h <<_ACEOF +#define OPT_DISABLE_SDBINUTILS $OPT_DISABLE_SDBINUTILS +_ACEOF + + + + # Check whether --enable-doc was given. if test "${enable_doc+set}" = set; then : @@ -6714,7 +7119,7 @@ set dummy lyx; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LYX+set}" = set; then : +if ${ac_cv_prog_LYX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LYX"; then @@ -6726,7 +7131,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LYX="lyx" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6752,7 +7157,7 @@ set dummy latex2html; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LATEX2HTML+set}" = set; then : +if ${ac_cv_prog_LATEX2HTML+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LATEX2HTML"; then @@ -6764,7 +7169,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LATEX2HTML="latex2html" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6790,7 +7195,7 @@ set dummy pdflatex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_PDFLATEX+set}" = set; then : +if ${ac_cv_prog_PDFLATEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PDFLATEX"; then @@ -6802,7 +7207,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PDFLATEX="pdflatex" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6828,7 +7233,7 @@ set dummy pdfopt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_PDFOPT+set}" = set; then : +if ${ac_cv_prog_PDFOPT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PDFOPT"; then @@ -6840,7 +7245,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PDFOPT="pdfopt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6866,7 +7271,7 @@ set dummy makeindex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_MAKEINDEX+set}" = set; then : +if ${ac_cv_prog_MAKEINDEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MAKEINDEX"; then @@ -6878,7 +7283,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MAKEINDEX="makeindex" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6947,7 +7352,7 @@ if test $OPT_ENABLE_LIBGC = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GC_malloc in -lgc" >&5 $as_echo_n "checking for GC_malloc in -lgc... " >&6; } -if test "${ac_cv_lib_gc_GC_malloc+set}" = set; then : +if ${ac_cv_lib_gc_GC_malloc+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6981,7 +7386,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gc_GC_malloc" >&5 $as_echo "$ac_cv_lib_gc_GC_malloc" >&6; } -if test "x$ac_cv_lib_gc_GC_malloc" = x""yes; then : +if test "x$ac_cv_lib_gc_GC_malloc" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGC 1 _ACEOF @@ -7013,6 +7418,8 @@ test $OPT_DISABLE_SDCDB = 0 && subdirs="$subdirs debugger/mcs51" +test $OPT_DISABLE_SDBINUTILS = 0 && subdirs="$subdirs support/sdbinutils" + ac_config_files="$ac_config_files doc/Makefile" @@ -7033,10 +7440,10 @@ fi -if test $OPT_DISABLE_HC08 = 0; then +if test $OPT_DISABLE_HC08 = 0 || test $OPT_DISABLE_S08 = 0; then ac_config_files="$ac_config_files src/hc08/Makefile sdas/as6808/Makefile" - test $OPT_DISABLE_DEVICE_LIB = 0 && ac_config_files="$ac_config_files device/lib/hc08/Makefile" + test $OPT_DISABLE_DEVICE_LIB = 0 && ac_config_files="$ac_config_files device/lib/hc08/Makefile device/lib/s08/Makefile" fi @@ -7063,7 +7470,7 @@ test $OPT_DISABLE_XA51 = 0 && ac_config_files="$ac_config_files src/xa51/Makefile" -if test $OPT_DISABLE_Z80 = 0 || test $OPT_DISABLE_Z180 = 0 || test $OPT_DISABLE_R2K = 0 || test $OPT_DISABLE_GBZ80 = 0; then +if test $OPT_DISABLE_Z80 = 0 || test $OPT_DISABLE_Z180 = 0 || test $OPT_DISABLE_R2K = 0 || test $OPT_DISABLE_R3KA = 0 || test $OPT_DISABLE_GBZ80 = 0; then ac_config_files="$ac_config_files src/z80/Makefile" fi @@ -7082,17 +7489,17 @@ fi -if test $OPT_DISABLE_R2K = 0; then +if test $OPT_DISABLE_R2K = 0 || test $OPT_DISABLE_R3KA = 0; then ac_config_files="$ac_config_files sdas/asrab/Makefile" - test $OPT_DISABLE_DEVICE_LIB = 0 && ac_config_files="$ac_config_files device/lib/r2k/Makefile" + test $OPT_DISABLE_DEVICE_LIB = 0 && ac_config_files="$ac_config_files device/lib/r2k/Makefile device/lib/r3ka/Makefile" fi test $OPT_DISABLE_DEVICE_LIB = 0 && ac_config_files="$ac_config_files device/lib/Makefile device/non-free/lib/Makefile" -ac_config_files="$ac_config_files main.mk:main_in.mk src/Makefile device/include/Makefile device/non-free/include/Makefile sdas/linksrc/Makefile support/sdranlib/Makefile support/librarian/Makefile support/makebin/Makefile support/regression/Makefile support/valdiag/Makefile support/scripts/Makefile support/regression/ports/host/spec.mk:support/regression/ports/host/spec.mk.in Makefile Makefile.common:Makefile.common.in" +ac_config_files="$ac_config_files main.mk:main_in.mk src/Makefile device/include/Makefile device/non-free/include/Makefile sdas/linksrc/Makefile support/librarian/Makefile support/makebin/Makefile support/regression/Makefile support/valdiag/Makefile support/scripts/Makefile support/regression/ports/host/spec.mk:support/regression/ports/host/spec.mk.in Makefile Makefile.common:Makefile.common.in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -7158,10 +7565,21 @@ :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" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -7193,7 +7611,8 @@ -: ${CONFIG_STATUS=./config.status} + +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -7294,6 +7713,7 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7489,16 +7909,16 @@ # ... 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'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -7558,28 +7978,16 @@ 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 + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # 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'" @@ -7601,7 +8009,7 @@ # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.67. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7663,10 +8071,10 @@ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.67, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -7756,7 +8164,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -7786,7 +8194,6 @@ do case $ac_config_target in "sdccconf.h") CONFIG_HEADERS="$CONFIG_HEADERS sdccconf.h:sdccconf_in.h" ;; - "custom.h") CONFIG_HEADERS="$CONFIG_HEADERS custom.h:custom_in.h" ;; "sdas/linksrc/asxxxx_config.h") CONFIG_HEADERS="$CONFIG_HEADERS sdas/linksrc/asxxxx_config.h" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "src/avr/Makefile") CONFIG_FILES="$CONFIG_FILES src/avr/Makefile" ;; @@ -7797,6 +8204,7 @@ "src/hc08/Makefile") CONFIG_FILES="$CONFIG_FILES src/hc08/Makefile" ;; "sdas/as6808/Makefile") CONFIG_FILES="$CONFIG_FILES sdas/as6808/Makefile" ;; "device/lib/hc08/Makefile") CONFIG_FILES="$CONFIG_FILES device/lib/hc08/Makefile" ;; + "device/lib/s08/Makefile") CONFIG_FILES="$CONFIG_FILES device/lib/s08/Makefile" ;; "src/mcs51/Makefile") CONFIG_FILES="$CONFIG_FILES src/mcs51/Makefile" ;; "sdas/as8051/Makefile") CONFIG_FILES="$CONFIG_FILES sdas/as8051/Makefile" ;; "device/lib/mcs51/Makefile") CONFIG_FILES="$CONFIG_FILES device/lib/mcs51/Makefile" ;; @@ -7815,6 +8223,7 @@ "device/lib/gbz80/Makefile") CONFIG_FILES="$CONFIG_FILES device/lib/gbz80/Makefile" ;; "sdas/asrab/Makefile") CONFIG_FILES="$CONFIG_FILES sdas/asrab/Makefile" ;; "device/lib/r2k/Makefile") CONFIG_FILES="$CONFIG_FILES device/lib/r2k/Makefile" ;; + "device/lib/r3ka/Makefile") CONFIG_FILES="$CONFIG_FILES device/lib/r3ka/Makefile" ;; "device/lib/Makefile") CONFIG_FILES="$CONFIG_FILES device/lib/Makefile" ;; "device/non-free/lib/Makefile") CONFIG_FILES="$CONFIG_FILES device/non-free/lib/Makefile" ;; "main.mk") CONFIG_FILES="$CONFIG_FILES main.mk:main_in.mk" ;; @@ -7822,7 +8231,6 @@ "device/include/Makefile") CONFIG_FILES="$CONFIG_FILES device/include/Makefile" ;; "device/non-free/include/Makefile") CONFIG_FILES="$CONFIG_FILES device/non-free/include/Makefile" ;; "sdas/linksrc/Makefile") CONFIG_FILES="$CONFIG_FILES sdas/linksrc/Makefile" ;; - "support/sdranlib/Makefile") CONFIG_FILES="$CONFIG_FILES support/sdranlib/Makefile" ;; "support/librarian/Makefile") CONFIG_FILES="$CONFIG_FILES support/librarian/Makefile" ;; "support/makebin/Makefile") CONFIG_FILES="$CONFIG_FILES support/makebin/Makefile" ;; "support/regression/Makefile") CONFIG_FILES="$CONFIG_FILES support/regression/Makefile" ;; @@ -7832,7 +8240,7 @@ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "Makefile.common") CONFIG_FILES="$CONFIG_FILES Makefile.common:Makefile.common.in" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -7854,9 +8262,10 @@ # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -7864,12 +8273,13 @@ { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -7891,7 +8301,7 @@ ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -7919,7 +8329,7 @@ rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -7967,7 +8377,7 @@ rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -7999,7 +8409,7 @@ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF @@ -8033,7 +8443,7 @@ # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || +cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -8045,8 +8455,8 @@ # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 @@ -8147,7 +8557,7 @@ esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -8166,7 +8576,7 @@ for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_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 `:'. @@ -8175,7 +8585,7 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -8201,8 +8611,8 @@ esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -8332,21 +8742,22 @@ s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 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"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_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" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; @@ -8357,20 +8768,20 @@ if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ + mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; @@ -8784,20 +9195,22 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: sdcc ${VERSION} is now configured for - Build: ${build_alias} - Host: ${host_alias} + Build: ${build} + Host: ${host} Source directory: ${srcdir} C compiler: ${CC} CFLAGS: ${CFLAGS} C++ compiler: ${CXX} CXXFLAGS: ${CXXFLAGS} + CPPFLAGS: ${CPPFLAGS} + LDFLAGS: ${LDFLAGS} ENABLED Ports: avr ${enable_avr_port} ds390 ${enable_ds390_port} ds400 ${enable_ds400_port} - gbz80 ${enable_gbz80_port} hc08 ${enable_hc08_port} + s08 ${enable_s08_port} mcs51 ${enable_mcs51_port} pic14 ${enable_pic14_port} pic16 ${enable_pic16_port} @@ -8805,12 +9218,15 @@ z80 ${enable_z80_port} z180 ${enable_z180_port} r2k ${enable_r2k_port} + r3ka ${enable_r3ka_port} + gbz80 ${enable_gbz80_port} Disable packihx: ${OPT_DISABLE_PACKIHX} Disable ucsim: ${OPT_DISABLE_UCSIM} Disable device lib: ${OPT_DISABLE_DEVICE_LIB} Disable sdcpp: ${OPT_DISABLE_SDCPP} Disable sdcdb: ${OPT_DISABLE_SDCDB} + Disable sdbinutil: ${OPT_DISABLE_SDBINUTILS} Enable documentation: ${OPT_ENABLE_DOC} Enable libgc: ${OPT_ENABLE_LIBGC} @@ -8844,20 +9260,22 @@ $as_echo " sdcc ${VERSION} is now configured for - Build: ${build_alias} - Host: ${host_alias} + Build: ${build} + Host: ${host} Source directory: ${srcdir} C compiler: ${CC} CFLAGS: ${CFLAGS} C++ compiler: ${CXX} CXXFLAGS: ${CXXFLAGS} + CPPFLAGS: ${CPPFLAGS} + LDFLAGS: ${LDFLAGS} ENABLED Ports: avr ${enable_avr_port} ds390 ${enable_ds390_port} ds400 ${enable_ds400_port} - gbz80 ${enable_gbz80_port} hc08 ${enable_hc08_port} + s08 ${enable_s08_port} mcs51 ${enable_mcs51_port} pic14 ${enable_pic14_port} pic16 ${enable_pic16_port} @@ -8865,12 +9283,15 @@ z80 ${enable_z80_port} z180 ${enable_z180_port} r2k ${enable_r2k_port} + r3ka ${enable_r3ka_port} + gbz80 ${enable_gbz80_port} Disable packihx: ${OPT_DISABLE_PACKIHX} Disable ucsim: ${OPT_DISABLE_UCSIM} Disable device lib: ${OPT_DISABLE_DEVICE_LIB} Disable sdcpp: ${OPT_DISABLE_SDCPP} Disable sdcdb: ${OPT_DISABLE_SDCDB} + Disable sdbinutil: ${OPT_DISABLE_SDBINUTILS} Enable documentation: ${OPT_ENABLE_DOC} Enable libgc: ${OPT_ENABLE_LIBGC} diff -Nru sdcc-3.1.0+dfsg/configure.in sdcc-3.2.0+dfsg/configure.in --- sdcc-3.1.0+dfsg/configure.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/configure.in 2012-05-18 16:09:24.000000000 +0000 @@ -3,7 +3,12 @@ AC_PREREQ(2.60) AC_INIT(.version) AC_CONFIG_SRCDIR([Makefile.in]) -AC_CONFIG_HEADER([sdccconf.h:sdccconf_in.h custom.h:custom_in.h sdas/linksrc/asxxxx_config.h]) + +# Determine the host and build type. +# =========================================================================== +AC_CANONICAL_HOST + +AC_CONFIG_HEADER([sdccconf.h:sdccconf_in.h sdas/linksrc/asxxxx_config.h]) AC_PROG_AWK @@ -94,62 +99,62 @@ # Macro definitions # =========================================================================== -# _bor_EXECUTE_IFELSE_BODY(COMMAND) +# _sdcc_EXECUTE_IFELSE_BODY(COMMAND) # ----------------------- # Shell function body for _AC_EXECUTE_IFELSE. -m4_define([_bor_EXECUTE_IFELSE_BODY], +m4_define([_sdcc_EXECUTE_IFELSE_BODY], [ AS_LINENO_PUSH([$[]1]) AS_IF([_AC_DO_STDERR([$1 $2]) > conftest.out && { - test ! -s conftest.err + test ! -s conftest.err }], [ac_retval=0], [ac_retval=1]) AS_LINENO_POP -])# _bor_EXECUTE_IFELSE_BODY +])# _sdcc_EXECUTE_IFELSE_BODY -# bor_EXECUTE_IFELSE(COMMAND[ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# sdcc_EXECUTE_IFELSE(COMMAND[ACTION-IF-TRUE], [ACTION-IF-FALSE]) # ---------------------------------------------------------------- # Try to execute COMMAND. -AC_DEFUN([bor_EXECUTE_IFELSE], +AC_DEFUN([sdcc_EXECUTE_IFELSE], [_$0_BODY($1) AS_IF([test "$ac_retval" = 0], [$2], [$3]) rm conftest.err conftest.out -])# bor_EXECUTE_IFELSE +])# sdcc_EXECUTE_IFELSE # Check whether the compiler for the current language is SunPRO. -AC_DEFUN([bor_IS_SUNPRO], +AC_DEFUN([sdcc_IS_SUNPRO], [AC_CACHE_CHECK([whether we are using the SunPRO _AC_LANG compiler], - [bor_cv_[]_AC_LANG_ABBREV[]_compiler_sunpro], + [sdcc_cv_[]_AC_LANG_ABBREV[]_compiler_sunpro], [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#if !defined __SUNPRO_C && !defined __SUNPRO_CC choke me #endif ]])], - [bor_compiler_sunpro=yes], - [bor_compiler_sunpro=no]) -bor_cv_[]_AC_LANG_ABBREV[]_compiler_sunpro=$bor_compiler_sunpro + [sdcc_cv_[]_AC_LANG_ABBREV[]_compiler_sunpro=yes], + [sdcc_cv_[]_AC_LANG_ABBREV[]_compiler_sunpro=no]) ])]) -# bor_IS_VALID_OPTION macro checks if the current compiler, selected by +# sdcc_IS_VALID_OPTION macro checks if the current compiler, selected by # AC_LANG, supports option specified as the 1st parameter. The test fails if # the compiler returns an error or in case something is writeen to stderr. -# For example: bor_VALID_OPT(fPIC) +# For example: sdcc_VALID_OPT(-fPIC) -AC_DEFUN([bor_IS_VALID_OPTION], -[ac_test_[]_AC_LANG_PREFIX[]FLAGS=${[]_AC_LANG_PREFIX[]FLAGS+set} -bor_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS -AC_CACHE_CHECK(whether _AC_LANG accepts -$1, bor_cv_[]_AC_LANG_ABBREV[]_$1, - [bor_save_[]_AC_LANG_ABBREV[]_werror_flag=$ac_[]_AC_LANG_ABBREV[]_werror_flag +AC_DEFUN([sdcc_IS_VALID_OPTION], +[arg1=`echo $1 | sed -e"s/^-*//" -e"s/-/_/"` +ac_test_[]_AC_LANG_PREFIX[]FLAGS=${[]_AC_LANG_PREFIX[]FLAGS+set} +sdcc_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS +AC_CACHE_CHECK(whether _AC_LANG accepts $1, sdcc_cv_[]_AC_LANG_ABBREV[]_$arg1, + [sdcc_save_[]_AC_LANG_ABBREV[]_werror_flag=$ac_[]_AC_LANG_ABBREV[]_werror_flag ac_[]_AC_LANG_ABBREV[]_werror_flag=yes - []_AC_LANG_PREFIX[]FLAGS="-$1" + []_AC_LANG_PREFIX[]FLAGS="$1" AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], - [bor_cv_[]_AC_LANG_ABBREV[]_$1=yes], - [bor_cv_[]_AC_LANG_ABBREV[]_$1=no]) - ac_[]_AC_LANG_ABBREV[]_werror_flag=$bor_save_[]_AC_LANG_ABBREV[]_werror_flag]) - []_AC_LANG_PREFIX[]FLAGS=$bor_save_[]_AC_LANG_PREFIX[]FLAGS + [eval sdcc_cv_[]_AC_LANG_ABBREV[]_$arg1=yes], + [eval sdcc_cv_[]_AC_LANG_ABBREV[]_$arg1=no]) + ac_[]_AC_LANG_ABBREV[]_werror_flag=$sdcc_save_[]_AC_LANG_ABBREV[]_werror_flag]) + []_AC_LANG_PREFIX[]FLAGS=$sdcc_save_[]_AC_LANG_PREFIX[]FLAGS ]) # This macro expands DIR and assigns it to RET. @@ -376,14 +381,14 @@ rm -f _test_.*) # This is the first time when CFLAGS are set/modified!! - bor_IS_VALID_OPTION(ggdb) - if test "$bor_cv_c_ggdb" = "yes"; then + sdcc_IS_VALID_OPTION(-ggdb) + if test "$sdcc_cv_c_ggdb" = "yes"; then CFLAGS="-ggdb ${CFLAGS}" CXXFLAGS="-ggdb ${CXXFLAGS}" fi - bor_IS_VALID_OPTION(pipe) - if test "$bor_cv_c_pipe" = "yes"; then + sdcc_IS_VALID_OPTION(-pipe) + if test "$sdcc_cv_c_pipe" = "yes"; then CFLAGS="-pipe ${CFLAGS}" # Don't use "-pipe" on x86 Solaris g++, since src/z80/ralloc2.cc dies with: # Assembler: ralloc2.cc @@ -397,8 +402,8 @@ C99_FLAG="--std=c99" MAKEDEP="$CC $sdcc_cv_MM" else - bor_IS_SUNPRO - if test "$bor_cv_c_compiler_sunpro" = "yes"; then + sdcc_IS_SUNPRO + if test "$sdcc_cv_c_compiler_sunpro" = "yes"; then C99_FLAG="-xc99" CFLAGS="-xO2 ${C99_FLAG} ${CFLAGS}" CXXFLAGS="-xO2 ${CXXFLAGS}" @@ -411,17 +416,49 @@ AC_SUBST(WALL_FLAG) AC_SUBST(C99_FLAG) -# does AR accept the -S flag -echo '!' > conftest.ar -AC_MSG_CHECKING([whether $AR accepts -S]) -bor_EXECUTE_IFELSE([$AR -S -t conftest.ar], - [AC_MSG_RESULT([yes]) - AR_S_FLAG="-S"], - [AC_MSG_RESULT([no]) - AR_S_FLAG=""]) -rm conftest.ar -AC_SUBST(AR_S_FLAG) +# SDCC_C_UNNAMED_STRUCT_TAG () +# chech whether C compiler supports tag in unnamed struct +# ------------------------------------------------------------------------- +AC_DEFUN([SDCC_C_UNNAMED_STRUCT_TAG], +[ + if test "$ac_cv_c_compiler_gnu" = "yes"; then + sdcc_IS_VALID_OPTION(-fms-extensions) + else + sdcc_cv_c_fms_extensions=no + fi + AC_CACHE_CHECK(whether C supports tag in unnamed struct, sdcc_cv_c_unnamed_struct_tag, + if test "$sdcc_cv_c_fms_extensions" = "yes"; then + CFLAGS="-fms-extensions ${CFLAGS}" + fi + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [ +struct s1 { + int a; +}; + +struct s2 { + struct s1; + int b; +}; + ], + [ + struct s2 s; + + s.a = 1; + s.b = 2; + ])], + [ + sdcc_cv_[]_AC_LANG_ABBREV[]_unnamed_struct_tag=yes + AC_DEFINE_UNQUOTED(UNNAMED_STRUCT_TAG, 1, [Define to 1 if c supports tags in unnamed struct.]) + ], + [ + sdcc_cv_[]_AC_LANG_ABBREV[]_unnamed_struct_tag=no + ]) + ) +]) +SDCC_C_UNNAMED_STRUCT_TAG # Checks for typedefs, structures, and compiler characteristics. # =========================================================================== @@ -431,6 +468,7 @@ AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) +AC_CHECK_SIZEOF(long long) AC_C_CHAR_UNSIGNED type_name() @@ -451,6 +489,10 @@ echo "long" exit fi + if expr "$ac_cv_sizeof_long_long" '>=' "$1" >/dev/null; then + echo "long long" + exit + fi echo "long" } @@ -468,87 +510,23 @@ AC_MSG_CHECKING(type name for dword) TYPE_DWORD=`type_name 4` AC_MSG_RESULT($TYPE_DWORD) +AC_MSG_CHECKING(type name for qword) +TYPE_QWORD=`type_name 8` +AC_MSG_RESULT($TYPE_QWORD) AC_DEFINE_UNQUOTED(TYPE_BYTE, $TYPE_BYTE, [XXX]) AC_DEFINE_UNQUOTED(TYPE_WORD, $TYPE_WORD, [XXX]) AC_DEFINE_UNQUOTED(TYPE_DWORD, $TYPE_DWORD, [XXX]) +AC_DEFINE_UNQUOTED(TYPE_QWORD, $TYPE_QWORD, [XXX]) AC_DEFINE_UNQUOTED(TYPE_UBYTE, unsigned $TYPE_CHAR, [XXX]) AC_DEFINE_UNQUOTED(TYPE_UWORD, unsigned $TYPE_WORD, [XXX]) AC_DEFINE_UNQUOTED(TYPE_UDWORD, unsigned $TYPE_DWORD, [XXX]) +AC_DEFINE_UNQUOTED(TYPE_UQWORD, unsigned $TYPE_QWORD, [XXX]) - -# SDCC_BUILD_BIGENDIAN ([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN]) -# ------------------------------------------------------------------------- -AC_DEFUN([SDCC_BUILD_BIGENDIAN], -[AC_CACHE_CHECK(whether host machine byte ordering is bigendian, sdcc_cv_build_bigendian, -[# See if sys/param.h defines the BYTE_ORDER macro. -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include -#include -], -[#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif -])], -[# It does; now see whether it defined to BIG_ENDIAN or not. -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include -#include -], [#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif -])], [sdcc_cv_build_bigendian=yes], [sdcc_cv_build_bigendian=no])], -[# It does not; compile a test program. -AC_RUN_IFELSE( -[AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [[ - /* 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; -]])], - [sdcc_cv_build_bigendian=no], - [sdcc_cv_build_bigendian=yes], -[# try to guess the endianness by grepping values into an object file - sdcc_cv_build_bigendian=unknown - AC_COMPILE_IFELSE([AC_LANG_PROGRAM( -[[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; }]], -[[ _ascii (); _ebcdic (); ]])], -[if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - sdcc_cv_build_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$sdcc_cv_build_bigendian" = unknown; then - sdcc_cv_build_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - sdcc_cv_build_bigendian=unknown - fi -fi])])])]) -case $sdcc_cv_build_bigendian in - yes) - m4_default([$1], - [AC_DEFINE([BUILD_WORDS_BIGENDIAN], 1, - [Define to 1 if your processor stores words with the most significant - byte first (like Motorola and SPARC, unlike Intel and VAX).])]) ;; - no) - $2 ;; - *) - m4_default([$3], - [AC_MSG_ERROR([unknown endianness -presetting sdcc_cv_build_bigendian=no (or yes) will help])]) ;; -esac -])# SDCC_BUILD_BIGENDIAN - -SDCC_BUILD_BIGENDIAN +# Checking whether byte ordering is bigendian +# =========================================================================== +AC_C_BIGENDIAN # Set standard installation paths # =========================================================================== @@ -706,8 +684,7 @@ # add include guard and custom stuff to sdccconf.h AH_TOP([#ifndef SDCCCONF_HEADER #define SDCCCONF_HEADER]) -AH_BOTTOM([#include "custom.h" -#endif /* SDCCCONF_HEADER */]) +AH_BOTTOM([#endif /* SDCCCONF_HEADER */]) # Port selection helper # =========================================================================== @@ -807,7 +784,8 @@ AC_DO_PORT(mcs51, mcs51, MCS51, [Excludes the Intel mcs51 port]) AC_DO_PORT(z80, z80, Z80, [Excludes the z80 port]) AC_DO_PORT(z180, z80, Z180, [Excludes the z180 port]) -AC_DO_PORT(r2k, z80, R2K, [Excludes the r2k port]) +AC_DO_PORT(r2k, z80, R2K, [Excludes the r2k port]) +AC_DO_PORT(r3ka, z80, R3KA, [Excludes the r3ka port]) AC_DO_PORT(gbz80, z80, GBZ80, [Excludes the Gameboy gbz80 port]) AC_DO_PORT(ds390, ds390, DS390, [Excludes the DS390 port]) AC_DEFINE_UNQUOTED(OPT_DISABLE_TININative, $OPT_DISABLE_DS390, [XXX]) @@ -815,6 +793,7 @@ AC_DO_PORT(pic14, pic14, PIC14, [Excludes the PIC14 port]) AC_DO_PORT(pic16, pic16, PIC16, [Excludes the PIC16 port]) AC_DO_PORT(hc08, hc08, HC08, [Excludes the HC08 port]) +AC_DO_PORT(s08, hc08, S08, [Excludes the S08 port]) # Unsupported targets AC_DO_PORT_ENABLER(avr, avr, AVR, [Includes the AVR port (disabled by default)]) @@ -825,6 +804,7 @@ AC_DO_DISABLER(packihx, PACKIHX, [Disables building packihx]) AC_DO_DISABLER(sdcpp, SDCPP, [Disables building sdcpp]) AC_DO_DISABLER(sdcdb, SDCDB, [Disables building sdcdb]) +AC_DO_DISABLER(sdbinutils, SDBINUTILS, [Disables configuring and building of sdbinutils]) AC_DO_ENABLER(doc, DOC, [Enables building the documentation]) AC_CHECK_PROG([LYX], [lyx], [lyx], [:]) @@ -861,6 +841,7 @@ test $OPT_DISABLE_PACKIHX = 0 && AC_CONFIG_SUBDIRS(support/packihx) test $OPT_DISABLE_UCSIM = 0 && AC_CONFIG_SUBDIRS(sim/ucsim) test $OPT_DISABLE_SDCDB = 0 && AC_CONFIG_SUBDIRS(debugger/mcs51) +test $OPT_DISABLE_SDBINUTILS = 0 && AC_CONFIG_SUBDIRS(support/sdbinutils) AC_CONFIG_FILES([doc/Makefile]) test $OPT_DISABLE_AVR = 0 && AC_CONFIG_FILES([src/avr/Makefile]) @@ -875,10 +856,11 @@ test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/ds400/Makefile]) fi -if test $OPT_DISABLE_HC08 = 0; then +if test $OPT_DISABLE_HC08 = 0 || test $OPT_DISABLE_S08 = 0; then AC_CONFIG_FILES([src/hc08/Makefile sdas/as6808/Makefile]) - test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/hc08/Makefile]) + test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/hc08/Makefile + device/lib/s08/Makefile]) fi if test $OPT_DISABLE_MCS51 = 0; then @@ -902,7 +884,7 @@ test $OPT_DISABLE_XA51 = 0 && AC_CONFIG_FILES([src/xa51/Makefile]) -if test $OPT_DISABLE_Z80 = 0 || test $OPT_DISABLE_Z180 = 0 || test $OPT_DISABLE_R2K = 0 || test $OPT_DISABLE_GBZ80 = 0; then +if test $OPT_DISABLE_Z80 = 0 || test $OPT_DISABLE_Z180 = 0 || test $OPT_DISABLE_R2K = 0 || test $OPT_DISABLE_R3KA = 0 || test $OPT_DISABLE_GBZ80 = 0; then AC_CONFIG_FILES([src/z80/Makefile]) fi @@ -917,9 +899,10 @@ test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/gbz80/Makefile]) fi -if test $OPT_DISABLE_R2K = 0; then +if test $OPT_DISABLE_R2K = 0 || test $OPT_DISABLE_R3KA = 0; then AC_CONFIG_FILES([sdas/asrab/Makefile]) - test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/r2k/Makefile]) + test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/r2k/Makefile + device/lib/r3ka/Makefile]) fi test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/Makefile device/non-free/lib/Makefile]) @@ -929,7 +912,6 @@ device/include/Makefile device/non-free/include/Makefile sdas/linksrc/Makefile -support/sdranlib/Makefile support/librarian/Makefile support/makebin/Makefile support/regression/Makefile @@ -970,20 +952,22 @@ AC_MSG_RESULT([ sdcc ${VERSION} is now configured for - Build: ${build_alias} - Host: ${host_alias} + Build: ${build} + Host: ${host} Source directory: ${srcdir} C compiler: ${CC} CFLAGS: ${CFLAGS} C++ compiler: ${CXX} CXXFLAGS: ${CXXFLAGS} + CPPFLAGS: ${CPPFLAGS} + LDFLAGS: ${LDFLAGS} ENABLED Ports: avr ${enable_avr_port} ds390 ${enable_ds390_port} ds400 ${enable_ds400_port} - gbz80 ${enable_gbz80_port} hc08 ${enable_hc08_port} + s08 ${enable_s08_port} mcs51 ${enable_mcs51_port} pic14 ${enable_pic14_port} pic16 ${enable_pic16_port} @@ -991,12 +975,15 @@ z80 ${enable_z80_port} z180 ${enable_z180_port} r2k ${enable_r2k_port} + r3ka ${enable_r3ka_port} + gbz80 ${enable_gbz80_port} Disable packihx: ${OPT_DISABLE_PACKIHX} Disable ucsim: ${OPT_DISABLE_UCSIM} Disable device lib: ${OPT_DISABLE_DEVICE_LIB} Disable sdcpp: ${OPT_DISABLE_SDCPP} Disable sdcdb: ${OPT_DISABLE_SDCDB} + Disable sdbinutil: ${OPT_DISABLE_SDBINUTILS} Enable documentation: ${OPT_ENABLE_DOC} Enable libgc: ${OPT_ENABLE_LIBGC} diff -Nru sdcc-3.1.0+dfsg/configure_vc.awk sdcc-3.2.0+dfsg/configure_vc.awk --- sdcc-3.1.0+dfsg/configure_vc.awk 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/configure_vc.awk 2012-05-05 14:39:36.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/awk -# configure_vc.awk - Genarate sdcc_vc.h using sdcc_vc_in.h as template +# configure_vc.awk - Genarate sdcc_vc.h using sdcc_vc.h.in as template # and insert the version number definitions from .version # # Written By - Borut Razem borut.razem@siol.net diff -Nru sdcc-3.1.0+dfsg/custom_in.h sdcc-3.2.0+dfsg/custom_in.h --- sdcc-3.1.0+dfsg/custom_in.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/custom_in.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* custom.h -- manual additions to #include into sdccconf.h */ - -/* - * find out the endianess of host machine - */ -#if defined __APPLE__ && (defined __BIG_ENDIAN__ || defined _BIG_ENDIAN) -/* 1) trust the compiler - * in order to be able to make Mac OS X unified binaries */ -# define WORDS_BIGENDIAN 1 -#elif defined __APPLE__ && (defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN) -/* do nothing */ -#elif defined __sun && defined HAVE_SYS_ISA_DEFS_H -/* Solaris defines endianness in */ -# include -# ifdef _BIG_ENDIAN -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifdef HAVE_ENDIAN_H -# include -# elif defined HAVE_SYS_ENDIAN_H -# include -# elif defined HAVE_MACHINE_ENDIAN_H -# include -# endif -# if (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) -/* 2) trust the header files */ -# if BYTE_ORDER == BIG_ENDIAN -# define WORDS_BIGENDIAN 1 -# endif -# else -/* 3) trust the configure; this actually doesn't work for unified Mac OS X binaries :-( */ -# if (defined BUILD_WORDS_BIGENDIAN && BUILD_WORDS_BIGENDIAN) -# define WORDS_BIGENDIAN 1 -# endif -/* 4) assume that host is a little endian machine */ -# endif -#endif diff -Nru sdcc-3.1.0+dfsg/debian/changelog sdcc-3.2.0+dfsg/debian/changelog --- sdcc-3.1.0+dfsg/debian/changelog 2012-06-14 03:29:32.000000000 +0000 +++ sdcc-3.2.0+dfsg/debian/changelog 2013-03-23 06:32:54.000000000 +0000 @@ -1,12 +1,18 @@ -sdcc (3.1.0+dfsg-1ubuntu1) quantal; urgency=low +sdcc (3.2.0+dfsg-1~precise2~ppa2) unstable; urgency=low - * Remove build-indep from build target. Add it as a requisite of the - install-indep target. This will keep it from being built on binary-arch - builds, but still work on full builds. Not ideal, but it will suffice - so that slow buildd's wont have to install all of lyx and tex just to - churn out a small binary. + * added documentation related tools to build dependencies to avoid issues + on Ubuntu Precise (dpkg-buildpackage calling build instead of build-arch + and build-indep), this is probably not a proper fix, but it should work - -- Ben Collins Wed, 13 Jun 2012 23:27:54 -0400 + -- Iztok Jeras Sat, 23 Mar 2013 07:22:50 +0100 + +sdcc (3.2.0+dfsg-1) UNRELEASED; urgency=low + + * New upstream release (Closes: #422599, #671631) + * Remove patch 02_fix_spelling. Fixed in upstream. + * Update patch 01_disable_non-free + + -- Gudjon I. Gudjonsson Fri, 13 Jul 2012 17:52:52 +0200 sdcc (3.1.0+dfsg-1) unstable; urgency=low diff -Nru sdcc-3.1.0+dfsg/debian/control sdcc-3.2.0+dfsg/debian/control --- sdcc-3.1.0+dfsg/debian/control 2012-06-14 03:29:55.000000000 +0000 +++ sdcc-3.2.0+dfsg/debian/control 2013-03-23 06:20:20.000000000 +0000 @@ -1,12 +1,10 @@ Source: sdcc Section: electronics Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Gudjon I. Gudjonsson +Maintainer: Gudjon I. Gudjonsson Uploaders: Bdale Garbee Build-Depends: debhelper (>=8), autoconf, autotools-dev, libtool, flex, bison, - libncurses5-dev, gputils, libboost-dev -Build-Depends-Indep: lyx, texlive-full, ghostscript, + libncurses5-dev, gputils, libboost-dev, lyx, texlive-full, ghostscript, Standards-Version: 3.9.3 Homepage: http://sdcc.sourceforge.net Vcs-Git: git://anonscm.debian.org/collab-maint/sdcc.git diff -Nru sdcc-3.1.0+dfsg/debian/patches/01_disable_non-free sdcc-3.2.0+dfsg/debian/patches/01_disable_non-free --- sdcc-3.1.0+dfsg/debian/patches/01_disable_non-free 2012-06-04 18:21:53.000000000 +0000 +++ sdcc-3.2.0+dfsg/debian/patches/01_disable_non-free 2012-07-13 16:02:03.000000000 +0000 @@ -2,35 +2,31 @@ compile the source files stripped of non-free files. --- a/Makefile.in +++ b/Makefile.in -@@ -58,7 +58,7 @@ +@@ -68,7 +68,7 @@ ifeq ($(OPT_DISABLE_DEVICE_LIB), 0) - TARGETS += sdcc-device-lib --PKGS += device/lib device/non-free/lib -+PKGS += device/lib + TARGETS += sdcc-device-lib +-PKGS += device/lib device/non-free/lib ++PKGS += device/lib endif ifeq ($(OPT_DISABLE_PACKIHX), 0) -@@ -78,10 +78,10 @@ +@@ -88,7 +88,7 @@ - TARGETS += sdcc-libs sdcc-cc sdcc-device-inc sdcc-as sdcc-ld sdcc-scripts + TARGETS += sdcc-libs sdcc-cc sdcc-device-inc sdcc-as sdcc-ld sdcc-scripts --PKGS += $(SDCC_LIBS) src device/include device/non-free/include $(SDCC_AS) sdas/linksrc $(SDCC_LIBRARIAN) $(SDCC_SDRANLIB) $(SDCC_SCRIPTS) -+PKGS += $(SDCC_LIBS) src device/include $(SDCC_AS) sdas/linksrc $(SDCC_LIBRARIAN) $(SDCC_SDRANLIB) $(SDCC_SCRIPTS) +-PKGS += $(SDCC_LIBS) src device/include device/non-free/include \ ++PKGS += $(SDCC_LIBS) src device/include \ + $(SDCC_AS) sdas/linksrc $(SDCC_LIBRARIAN) \ + $(SDCC_SDBINUTILS) $(SDCC_SCRIPTS) - PKGS_TINI = $(SDCC_LIBS) $(SDCC_AS) sdas/linksrc \ -- src device/include device/non-free/include $(SDCC_PACKIHX) $(SDCC_LIBRARIAN) -+ src device/include $(SDCC_PACKIHX) $(SDCC_LIBRARIAN) - PORTS = $(shell cat ports.build) - ALLPORTS = $(shell cat ports.all) - -@@ -120,15 +120,12 @@ +@@ -138,15 +138,12 @@ sdcc-device-inc: $(MAKE) -C device/include - $(MAKE) -C device/non-free/include - sdcc-device-lib: sdcc-cc sdcc-as sdcc-ld + sdcc-device-lib: sdcc-cc sdcc-as sdcc-ld $(SDCC_BINUTILS) $(MAKE) -C device/lib - $(MAKE) -C device/non-free/lib @@ -42,18 +38,18 @@ # doc depends on latex and latex2html --- a/configure +++ b/configure -@@ -747,9 +747,7 @@ - ac_subdirs_all='support/cpp +@@ -789,9 +789,7 @@ support/packihx sim/ucsim --debugger/mcs51 + debugger/mcs51 +-support/sdbinutils -device/lib/pic14 device/non-free/lib/pic14 -device/lib/pic16 device/non-free/lib/pic16' -+debugger/mcs51' ++support/sdbinutils' # Initialize some variables set by options. ac_init_help= -@@ -5601,9 +5599,6 @@ +@@ -5932,9 +5930,6 @@ # *nix default: "sdcc/non-free/include" @@ -63,7 +59,7 @@ # lib_dir_suffix: # *nix default: "sdcc/lib" -@@ -7089,10 +7084,10 @@ +@@ -7496,10 +7491,10 @@ fi @@ -71,14 +67,14 @@ +test $OPT_DISABLE_DEVICE_LIB = 0 && ac_config_files="$ac_config_files device/lib/Makefile" --ac_config_files="$ac_config_files main.mk:main_in.mk src/Makefile device/include/Makefile device/non-free/include/Makefile sdas/linksrc/Makefile support/sdranlib/Makefile support/librarian/Makefile support/makebin/Makefile support/regression/Makefile support/valdiag/Makefile support/scripts/Makefile support/regression/ports/host/spec.mk:support/regression/ports/host/spec.mk.in Makefile Makefile.common:Makefile.common.in" -+ac_config_files="$ac_config_files main.mk:main_in.mk src/Makefile device/include/Makefile sdas/linksrc/Makefile support/sdranlib/Makefile support/librarian/Makefile support/makebin/Makefile support/regression/Makefile support/valdiag/Makefile support/scripts/Makefile support/regression/ports/host/spec.mk:support/regression/ports/host/spec.mk.in Makefile Makefile.common:Makefile.common.in" +-ac_config_files="$ac_config_files main.mk:main_in.mk src/Makefile device/include/Makefile device/non-free/include/Makefile sdas/linksrc/Makefile support/librarian/Makefile support/makebin/Makefile support/regression/Makefile support/valdiag/Makefile support/scripts/Makefile support/regression/ports/host/spec.mk:support/regression/ports/host/spec.mk.in Makefile Makefile.common:Makefile.common.in" ++ac_config_files="$ac_config_files main.mk:main_in.mk src/Makefile device/include/Makefile sdas/linksrc/Makefile support/librarian/Makefile support/makebin/Makefile support/regression/Makefile support/valdiag/Makefile support/scripts/Makefile support/regression/ports/host/spec.mk:support/regression/ports/host/spec.mk.in Makefile Makefile.common:Makefile.common.in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure -@@ -7816,11 +7811,9 @@ - "sdas/asrab/Makefile") CONFIG_FILES="$CONFIG_FILES sdas/asrab/Makefile" ;; +@@ -8225,11 +8220,9 @@ "device/lib/r2k/Makefile") CONFIG_FILES="$CONFIG_FILES device/lib/r2k/Makefile" ;; + "device/lib/r3ka/Makefile") CONFIG_FILES="$CONFIG_FILES device/lib/r3ka/Makefile" ;; "device/lib/Makefile") CONFIG_FILES="$CONFIG_FILES device/lib/Makefile" ;; - "device/non-free/lib/Makefile") CONFIG_FILES="$CONFIG_FILES device/non-free/lib/Makefile" ;; "main.mk") CONFIG_FILES="$CONFIG_FILES main.mk:main_in.mk" ;; @@ -86,5 +82,5 @@ "device/include/Makefile") CONFIG_FILES="$CONFIG_FILES device/include/Makefile" ;; - "device/non-free/include/Makefile") CONFIG_FILES="$CONFIG_FILES device/non-free/include/Makefile" ;; "sdas/linksrc/Makefile") CONFIG_FILES="$CONFIG_FILES sdas/linksrc/Makefile" ;; - "support/sdranlib/Makefile") CONFIG_FILES="$CONFIG_FILES support/sdranlib/Makefile" ;; "support/librarian/Makefile") CONFIG_FILES="$CONFIG_FILES support/librarian/Makefile" ;; + "support/makebin/Makefile") CONFIG_FILES="$CONFIG_FILES support/makebin/Makefile" ;; diff -Nru sdcc-3.1.0+dfsg/debian/patches/02_fix_spelling sdcc-3.2.0+dfsg/debian/patches/02_fix_spelling --- sdcc-3.1.0+dfsg/debian/patches/02_fix_spelling 2012-06-04 18:21:53.000000000 +0000 +++ sdcc-3.2.0+dfsg/debian/patches/02_fix_spelling 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -Fixes spelling errors in programs, minor lintian warnings ---- a/sim/ucsim/pobj.cc -+++ b/sim/ucsim/pobj.cc -@@ -157,7 +157,7 @@ - { - char *s; - s= (char*)malloc(strlen(get_name("?"))+100); -- sprintf(s, "childs of %s", get_name("?")); -+ sprintf(s, "children of %s", get_name("?")); - children= new cl_list(1, 1, s); - free(s); - } ---- a/src/pic16/ralloc.c -+++ b/src/pic16/ralloc.c -@@ -311,7 +311,7 @@ - case SEND: return "SEND"; - case DUMMY_READ_VOLATILE: return "DUMMY_READ_VOLATILE"; - } -- sprintf (buffer, "unkown op %d %c", op, op & 0xff); -+ sprintf (buffer, "unknown op %d %c", op, op & 0xff); - - return buffer; - } ---- a/sim/ucsim/utils.cc -+++ b/sim/ucsim/utils.cc -@@ -142,7 +142,7 @@ - name= o->get_name(); - if (name && *name) - return(name); -- return("(unkown)"); -+ return("(unknown)"); - } - - ---- a/sdas/linksrc/lkmain.c -+++ b/sdas/linksrc/lkmain.c -@@ -1100,7 +1100,7 @@ - default: - err: - fprintf(stderr, -- "Unkown option -%c ignored\n", c); -+ "Unknown option -%c ignored\n", c); - break; - } - } diff -Nru sdcc-3.1.0+dfsg/debian/patches/series sdcc-3.2.0+dfsg/debian/patches/series --- sdcc-3.1.0+dfsg/debian/patches/series 2012-06-04 18:21:53.000000000 +0000 +++ sdcc-3.2.0+dfsg/debian/patches/series 2012-07-13 16:03:57.000000000 +0000 @@ -1,2 +1 @@ 01_disable_non-free -02_fix_spelling diff -Nru sdcc-3.1.0+dfsg/debian/rules sdcc-3.2.0+dfsg/debian/rules --- sdcc-3.1.0+dfsg/debian/rules 2012-06-14 03:27:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/debian/rules 2012-06-04 18:21:53.000000000 +0000 @@ -74,7 +74,7 @@ --prefix=/usr touch $@ -build: build-arch +build: build-arch build-indep build-arch: build-arch-stamp build-arch-stamp: configure-stamp dh_testdir @@ -88,7 +88,7 @@ touch $@ install: install-arch install-indep -install-indep: build-indep +install-indep: build dh_testdir dh_testroot dh_installdirs diff -Nru sdcc-3.1.0+dfsg/debugger/mcs51/aclocal.m4 sdcc-3.2.0+dfsg/debugger/mcs51/aclocal.m4 --- sdcc-3.1.0+dfsg/debugger/mcs51/aclocal.m4 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/debugger/mcs51/aclocal.m4 2012-05-18 10:47:44.000000000 +0000 @@ -1,7 +1,8 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.5 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. diff -Nru sdcc-3.1.0+dfsg/debugger/mcs51/cmd.c sdcc-3.2.0+dfsg/debugger/mcs51/cmd.c --- sdcc-3.1.0+dfsg/debugger/mcs51/cmd.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/debugger/mcs51/cmd.c 2012-05-31 08:33:34.000000000 +0000 @@ -1078,7 +1078,7 @@ { if (!cctxt->func->mod) { - if (!applyToSet (functions, funcWithName, "main")) + if (!applyToSet (functions, funcWithName, "main", &func)) { fprintf (stderr, "Function \"main\" not defined.\n"); } @@ -3336,7 +3336,7 @@ { if (!cctxt->func->mod) { - if (!applyToSet(functions,funcWithName,"main")) + if (!applyToSet (functions, funcWithName, "main", &func)) fprintf(stderr,"Function \"main\" not defined.\n"); else clearBPatModLine(func->mod,line); diff -Nru sdcc-3.1.0+dfsg/debugger/mcs51/configure sdcc-3.2.0+dfsg/debugger/mcs51/configure --- sdcc-3.1.0+dfsg/debugger/mcs51/configure 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/debugger/mcs51/configure 2012-05-18 10:47:44.000000000 +0000 @@ -1,11 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68. +# Generated by GNU Autoconf 2.69. # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -134,6 +132,31 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -167,7 +190,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -212,21 +236,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -328,6 +356,14 @@ } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -449,6 +485,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # 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). @@ -483,16 +523,16 @@ # ... 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'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -504,28 +544,8 @@ 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 +as_test_x='test -x' +as_executable_p=as_fn_executable_p # 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'" @@ -1133,8 +1153,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_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 @@ -1364,9 +1382,9 @@ if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.68 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1639,7 +1657,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -1662,7 +1680,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2036,7 +2054,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2076,7 +2094,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2129,7 +2147,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2170,7 +2188,7 @@ 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 as_fn_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 @@ -2228,7 +2246,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2272,7 +2290,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2718,8 +2736,7 @@ /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* 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); @@ -2959,7 +2976,7 @@ 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 + as_fn_executable_p "$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 @@ -3025,7 +3042,7 @@ 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 + as_fn_executable_p "$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 @@ -3322,7 +3339,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3362,7 +3379,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3415,7 +3432,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3456,7 +3473,7 @@ 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 as_fn_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 @@ -3514,7 +3531,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3558,7 +3575,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3754,8 +3771,7 @@ /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* 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); @@ -4043,7 +4059,7 @@ # 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 as_fn_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. @@ -4116,7 +4132,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4156,7 +4172,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4207,7 +4223,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AUTOCONF="autoconf" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4245,7 +4261,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4283,7 +4299,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4321,7 +4337,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CP="cp" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5187,16 +5203,16 @@ # ... 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'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -5256,28 +5272,16 @@ 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 + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # 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'" @@ -5299,7 +5303,7 @@ # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -5361,10 +5365,10 @@ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.68, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -5453,7 +5457,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' diff -Nru sdcc-3.1.0+dfsg/debugger/mcs51/sdcdb.c sdcc-3.2.0+dfsg/debugger/mcs51/sdcdb.c --- sdcc-3.1.0+dfsg/debugger/mcs51/sdcdb.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/debugger/mcs51/sdcdb.c 2012-03-14 20:37:02.000000000 +0000 @@ -1708,11 +1708,11 @@ /*-----------------------------------------------------------------*/ /* escapeQuotes - escape double quotes */ /*-----------------------------------------------------------------*/ -#define CHUNCK 256 +#define CHUNK 256 static const char *escapeQuotes(const char *arg) { -#define extend(n) do { if (ps - str + (n) > strLen) str = Safe_realloc (str, strLen += CHUNCK); } while (0) +#define extend(n) do { if ((size_t)(ps - str + (n)) > strLen) str = Safe_realloc (str, strLen += CHUNK); } while (0) static char *str = NULL; static size_t strLen = 0; @@ -1721,7 +1721,7 @@ if (NULL == str) { - strLen = CHUNCK; + strLen = CHUNK; str = Safe_malloc (strLen); } @@ -1757,8 +1757,8 @@ if (NULL == cmd) { - cmd = Safe_malloc(CHUNCK); - cmdLen = CHUNCK; + cmd = Safe_malloc(CHUNK); + cmdLen = CHUNK; } for (i = 0; i < nargs; ++i) @@ -2071,9 +2071,8 @@ static void sigchld(int sig) { /* the only child can be the simulator */ - int status, retpid; - retpid = wait ( &status ); - /* if ( retpid == simPid ) */ + int status; + wait ( &status ); simactive = 0; } #endif diff -Nru sdcc-3.1.0+dfsg/device/include/asm/default/features.h sdcc-3.2.0+dfsg/device/include/asm/default/features.h --- sdcc-3.1.0+dfsg/device/include/asm/default/features.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/asm/default/features.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/asm/ds390/features.h sdcc-3.2.0+dfsg/device/include/asm/ds390/features.h --- sdcc-3.1.0+dfsg/device/include/asm/ds390/features.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/asm/ds390/features.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -42,15 +42,15 @@ char _AUTOMEM * pAr = Ar; } */ -#if defined(SDCC_STACK_AUTO) - #if defined(SDCC_USE_XSTACK) +#if defined(__SDCC_STACK_AUTO) + #if defined(__SDCC_USE_XSTACK) #define _AUTOMEM __pdata - #elif defined(SDCC_STACK_TENBIT) + #elif defined(__SDCC_STACK_TENBIT) #define _AUTOMEM __xdata #else #define _AUTOMEM __idata #endif -#elif defined(SDCC_MODEL_SMALL) +#elif defined(__SDCC_MODEL_SMALL) #define _AUTOMEM __data #else #define _AUTOMEM __xdata @@ -65,7 +65,7 @@ char _STATMEM * pAr = Ar; } */ -#if defined(SDCC_MODEL_SMALL) +#if defined(__SDCC_MODEL_SMALL) #define _STATMEM __data #else #define _STATMEM __xdata diff -Nru sdcc-3.1.0+dfsg/device/include/asm/gbz80/features.h sdcc-3.2.0+dfsg/device/include/asm/gbz80/features.h --- sdcc-3.1.0+dfsg/device/include/asm/gbz80/features.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/asm/gbz80/features.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/asm/mcs51/features.h sdcc-3.2.0+dfsg/device/include/asm/mcs51/features.h --- sdcc-3.1.0+dfsg/device/include/asm/mcs51/features.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/asm/mcs51/features.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -42,15 +42,15 @@ char _AUTOMEM * pAr = Ar; } */ -#if defined(SDCC_STACK_AUTO) - #if defined(SDCC_USE_XSTACK) +#if defined(__SDCC_STACK_AUTO) + #if defined(__SDCC_USE_XSTACK) #define _AUTOMEM __pdata #else #define _AUTOMEM __idata #endif -#elif defined(SDCC_MODEL_SMALL) +#elif defined(__SDCC_MODEL_SMALL) #define _AUTOMEM __data -#elif defined(SDCC_MODEL_MEDIUM) +#elif defined(__SDCC_MODEL_MEDIUM) #define _AUTOMEM __pdata #else #define _AUTOMEM __xdata @@ -65,9 +65,9 @@ char _STATMEM * pAr = Ar; } */ -#if defined(SDCC_MODEL_SMALL) +#if defined(__SDCC_MODEL_SMALL) #define _STATMEM __data -#elif defined(SDCC_MODEL_MEDIUM) +#elif defined(__SDCC_MODEL_MEDIUM) #define _STATMEM __pdata #else #define _STATMEM __xdata @@ -76,7 +76,7 @@ /* define _RETURN for correct returning from inline asm functions */ -#if defined(SDCC_MODEL_HUGE) +#if defined(__SDCC_MODEL_HUGE) #define _RETURN ljmp __sdcc_banked_ret #else #define _RETURN ret diff -Nru sdcc-3.1.0+dfsg/device/include/asm/pic14/features.h sdcc-3.2.0+dfsg/device/include/asm/pic14/features.h --- sdcc-3.1.0+dfsg/device/include/asm/pic14/features.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/asm/pic14/features.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/asm/pic16/features.h sdcc-3.2.0+dfsg/device/include/asm/pic16/features.h --- sdcc-3.1.0+dfsg/device/include/asm/pic16/features.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/asm/pic16/features.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/asm/r2k/features.h sdcc-3.2.0+dfsg/device/include/asm/r2k/features.h --- sdcc-3.1.0+dfsg/device/include/asm/r2k/features.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/asm/r2k/features.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/asm/r3ka/features.h sdcc-3.2.0+dfsg/device/include/asm/r3ka/features.h --- sdcc-3.1.0+dfsg/device/include/asm/r3ka/features.h 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/asm/r3ka/features.h 2012-05-21 00:13:27.000000000 +0000 @@ -0,0 +1,50 @@ +/*------------------------------------------------------------------------- + features.h - Rabbit 3000A specific features. + + Copyright (C) 2001, Michael Hope + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +#ifndef __SDCC_ASM_R3KA_FEATURES_H +#define __SDCC_ASM_R3KA_FEATURES_H 1 + +#define _REENTRANT +#define _CODE +#define _AUTOMEM +#define _STATMEM + +#define _SDCC_MANGLES_SUPPORT_FUNS 1 +#define _SDCC_Z80_STYLE_LIB_OPT 1 + +/* The following are disabled to make the dhrystone test more authentic. + */ +#define _SDCC_PORT_PROVIDES_MEMCPY 0 +#define _SDCC_PORT_PROVIDES_STRCMP 0 +/* Register allocator is as good as hand coded asm. Cool. */ +#define _SDCC_PORT_PROVIDES_STRCPY 0 + +#define _SDCC_MALLOC_TYPE_MLH 1 + +#endif + diff -Nru sdcc-3.1.0+dfsg/device/include/asm/z180/features.h sdcc-3.2.0+dfsg/device/include/asm/z180/features.h --- sdcc-3.1.0+dfsg/device/include/asm/z180/features.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/asm/z180/features.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/asm/z80/features.h sdcc-3.2.0+dfsg/device/include/asm/z80/features.h --- sdcc-3.1.0+dfsg/device/include/asm/z80/features.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/asm/z80/features.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/assert.h sdcc-3.2.0+dfsg/device/include/assert.h --- sdcc-3.1.0+dfsg/device/include/assert.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/assert.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/ctype.h sdcc-3.2.0+dfsg/device/include/ctype.h --- sdcc-3.1.0+dfsg/device/include/ctype.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/ctype.h 2012-03-13 10:17:10.000000000 +0000 @@ -11,7 +11,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/ds390/serial390.h sdcc-3.2.0+dfsg/device/include/ds390/serial390.h --- sdcc-3.1.0+dfsg/device/include/ds390/serial390.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/ds390/serial390.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/ds400/ds400rom.h sdcc-3.2.0+dfsg/device/include/ds400/ds400rom.h --- sdcc-3.1.0+dfsg/device/include/ds400/ds400rom.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/ds400/ds400rom.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/ds80c390.h sdcc-3.2.0+dfsg/device/include/ds80c390.h --- sdcc-3.1.0+dfsg/device/include/ds80c390.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/ds80c390.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/errno.h sdcc-3.2.0+dfsg/device/include/errno.h --- sdcc-3.1.0+dfsg/device/include/errno.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/errno.h 2012-03-20 09:56:26.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -38,4 +38,15 @@ #define EDOM 33 /* Math argument out of domain of functions */ #define ERANGE 34 /* Math result not representable */ +/* Bounds-checking interfaces from annex K of the C11 standard. */ +#if defined (__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ + +#ifndef __ERRNO_T_DEFINED +#define __ERRNO_T_DEFINED +typedef int errno_t; +#endif + +#endif + #endif /* _INC_ERRNO */ + diff -Nru sdcc-3.1.0+dfsg/device/include/float.h sdcc-3.2.0+dfsg/device/include/float.h --- sdcc-3.1.0+dfsg/device/include/float.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/float.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -76,7 +76,7 @@ char __fsgt (float, float); -#if defined(SDCC_FLOAT_LIB) && defined(SDCC_mcs51) && !defined(SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) +#if defined(__SDCC_FLOAT_LIB) && defined(__SDCC_mcs51) && !defined(__SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) #define FLOAT_ASM_MCS51 diff -Nru sdcc-3.1.0+dfsg/device/include/hc08/mc68hc908apxx.h sdcc-3.2.0+dfsg/device/include/hc08/mc68hc908apxx.h --- sdcc-3.1.0+dfsg/device/include/hc08/mc68hc908apxx.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/hc08/mc68hc908apxx.h 2012-03-13 10:17:10.000000000 +0000 @@ -8,7 +8,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/hc08/mc68hc908gp32.h sdcc-3.2.0+dfsg/device/include/hc08/mc68hc908gp32.h --- sdcc-3.1.0+dfsg/device/include/hc08/mc68hc908gp32.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/hc08/mc68hc908gp32.h 2012-03-13 10:17:10.000000000 +0000 @@ -8,7 +8,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/hc08/mc68hc908jb8.h sdcc-3.2.0+dfsg/device/include/hc08/mc68hc908jb8.h --- sdcc-3.1.0+dfsg/device/include/hc08/mc68hc908jb8.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/hc08/mc68hc908jb8.h 2012-03-13 10:17:10.000000000 +0000 @@ -7,7 +7,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/hc08/mc68hc908jkjl.h sdcc-3.2.0+dfsg/device/include/hc08/mc68hc908jkjl.h --- sdcc-3.1.0+dfsg/device/include/hc08/mc68hc908jkjl.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/hc08/mc68hc908jkjl.h 2012-03-13 10:17:10.000000000 +0000 @@ -8,7 +8,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/hc08/mc68hc908qy.h sdcc-3.2.0+dfsg/device/include/hc08/mc68hc908qy.h --- sdcc-3.1.0+dfsg/device/include/hc08/mc68hc908qy.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/hc08/mc68hc908qy.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/iso646.h sdcc-3.2.0+dfsg/device/include/iso646.h --- sdcc-3.1.0+dfsg/device/include/iso646.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/iso646.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/limits.h sdcc-3.2.0+dfsg/device/include/limits.h --- sdcc-3.1.0+dfsg/device/include/limits.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/limits.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -33,7 +33,7 @@ #define SCHAR_MAX 127 #define SCHAR_MIN -128 #define UCHAR_MAX 0xff -#ifdef SDCC_CHAR_UNSIGNED +#ifdef __SDCC_CHAR_UNSIGNED #define CHAR_MAX UCHAR_MAX #define CHAR_MIN 0 #else @@ -49,13 +49,13 @@ #define UINT_MIN 0 #define USHRT_MAX UINT_MAX #define USHRT_MIN UINT_MIN -#define LONG_MIN -2147483648 -#define LONG_MAX 2147483647 +#define LONG_MIN (-2147483647L-1) +#define LONG_MAX 2147483647L #define ULONG_MAX 0xffffffff #define ULONG_MIN 0 -#define LLONG_MIN -9223372036854775808 -#define LLONG_MAX 9223372036854775807 -#define ULLONG_MAX 18446744073709551615 +#define LLONG_MIN (-9223372036854775807LL-1) +#define LLONG_MAX 9223372036854775807LL +#define ULLONG_MAX 18446744073709551615ULL #endif diff -Nru sdcc-3.1.0+dfsg/device/include/malloc.h sdcc-3.2.0+dfsg/device/include/malloc.h --- sdcc-3.1.0+dfsg/device/include/malloc.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/malloc.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/math.h sdcc-3.2.0+dfsg/device/include/math.h --- sdcc-3.1.0+dfsg/device/include/math.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/math.h 2012-05-21 00:13:27.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -53,7 +53,7 @@ long l; }; -#if defined(SDCC_MATH_LIB) && defined(SDCC_mcs51) && !defined(SDCC_USE_XSTACK) && !defined(SDCC_STACK_AUTO) && !defined(_SDCC_NO_ASM_LIB_FUNCS) +#if defined(__SDCC_MATH_LIB) && defined(__SDCC_mcs51) && !defined(__SDCC_USE_XSTACK) && !defined(__SDCC_STACK_AUTO) && !defined(_SDCC_NO_ASM_LIB_FUNCS) /* Compile the mcs51 assembly version only when all these conditions are met. Since not all the functions are reentrant, do not compile with --stack-auto is used. */ @@ -63,7 +63,7 @@ /* Functions on the z80 & gbz80 are always reentrant and so the "reentrant" */ /* keyword is not defined. */ -#if defined(SDCC_z80) || defined(SDCC_z180) || defined(SDCC_r2k) || defined(SDCC_gbz80) +#if defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_r2k) || defined(__SDCC_r3ka) || defined(__SDCC_r4k) || defined(__SDCC_gbz80) #define _FLOAT_FUNC_REENTRANT #else #define _FLOAT_FUNC_REENTRANT __reentrant diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/8051.h sdcc-3.2.0+dfsg/device/include/mcs51/8051.h --- sdcc-3.1.0+dfsg/device/include/mcs51/8051.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/8051.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/8052.h sdcc-3.2.0+dfsg/device/include/mcs51/8052.h --- sdcc-3.1.0+dfsg/device/include/mcs51/8052.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/8052.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/ADuC84x.h sdcc-3.2.0+dfsg/device/include/mcs51/ADuC84x.h --- sdcc-3.1.0+dfsg/device/include/mcs51/ADuC84x.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/ADuC84x.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/AT89C513xA.h sdcc-3.2.0+dfsg/device/include/mcs51/AT89C513xA.h --- sdcc-3.1.0+dfsg/device/include/mcs51/AT89C513xA.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/AT89C513xA.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F000.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F000.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F000.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F000.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F018.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F018.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F018.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F018.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F020.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F020.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F020.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F020.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F040.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F040.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F040.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F040.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F060.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F060.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F060.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F060.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F120.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F120.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F120.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F120.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F200.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F200.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F200.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F200.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F300.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F300.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F300.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F300.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F310.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F310.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F310.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F310.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F320.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F320.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F320.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F320.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F326.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F326.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F326.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F326.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F330.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F330.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F330.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F330.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F336.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F336.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F336.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F336.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F340.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F340.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F340.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F340.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F350.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F350.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F350.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F350.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F360.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F360.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F360.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F360.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F410.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F410.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F410.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F410.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F520.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F520.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F520.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F520.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051F920.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051F920.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051F920.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051F920.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051T600.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051T600.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051T600.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051T600.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051T610.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051T610.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051T610.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051T610.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/C8051T630.h sdcc-3.2.0+dfsg/device/include/mcs51/C8051T630.h --- sdcc-3.1.0+dfsg/device/include/mcs51/C8051T630.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/C8051T630.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/P89LPC925.h sdcc-3.2.0+dfsg/device/include/mcs51/P89LPC925.h --- sdcc-3.1.0+dfsg/device/include/mcs51/P89LPC925.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/P89LPC925.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/SST89x5xRDx.h sdcc-3.2.0+dfsg/device/include/mcs51/SST89x5xRDx.h --- sdcc-3.1.0+dfsg/device/include/mcs51/SST89x5xRDx.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/SST89x5xRDx.h 2012-03-13 10:17:10.000000000 +0000 @@ -7,7 +7,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/XC866.h sdcc-3.2.0+dfsg/device/include/mcs51/XC866.h --- sdcc-3.1.0+dfsg/device/include/mcs51/XC866.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/XC866.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/at89S8252.h sdcc-3.2.0+dfsg/device/include/mcs51/at89S8252.h --- sdcc-3.1.0+dfsg/device/include/mcs51/at89S8252.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/at89S8252.h 2012-03-13 10:17:10.000000000 +0000 @@ -16,7 +16,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/at89Sx051.h sdcc-3.2.0+dfsg/device/include/mcs51/at89Sx051.h --- sdcc-3.1.0+dfsg/device/include/mcs51/at89Sx051.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/at89Sx051.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/at89c51ed2.h sdcc-3.2.0+dfsg/device/include/mcs51/at89c51ed2.h --- sdcc-3.1.0+dfsg/device/include/mcs51/at89c51ed2.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/at89c51ed2.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/at89c51snd1c.h sdcc-3.2.0+dfsg/device/include/mcs51/at89c51snd1c.h --- sdcc-3.1.0+dfsg/device/include/mcs51/at89c51snd1c.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/at89c51snd1c.h 2012-03-13 10:17:10.000000000 +0000 @@ -8,7 +8,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/at89c55.h sdcc-3.2.0+dfsg/device/include/mcs51/at89c55.h --- sdcc-3.1.0+dfsg/device/include/mcs51/at89c55.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/at89c55.h 2012-03-13 10:17:10.000000000 +0000 @@ -8,7 +8,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/at89s53.h sdcc-3.2.0+dfsg/device/include/mcs51/at89s53.h --- sdcc-3.1.0+dfsg/device/include/mcs51/at89s53.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/at89s53.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/at89s8253.h sdcc-3.2.0+dfsg/device/include/mcs51/at89s8253.h --- sdcc-3.1.0+dfsg/device/include/mcs51/at89s8253.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/at89s8253.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/at89x051.h sdcc-3.2.0+dfsg/device/include/mcs51/at89x051.h --- sdcc-3.1.0+dfsg/device/include/mcs51/at89x051.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/at89x051.h 2012-03-13 10:17:10.000000000 +0000 @@ -7,7 +7,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/at89x51.h sdcc-3.2.0+dfsg/device/include/mcs51/at89x51.h --- sdcc-3.1.0+dfsg/device/include/mcs51/at89x51.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/at89x51.h 2012-03-13 10:17:10.000000000 +0000 @@ -8,7 +8,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/at89x52.h sdcc-3.2.0+dfsg/device/include/mcs51/at89x52.h --- sdcc-3.1.0+dfsg/device/include/mcs51/at89x52.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/at89x52.h 2012-03-13 10:17:10.000000000 +0000 @@ -8,7 +8,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/cc2430.h sdcc-3.2.0+dfsg/device/include/mcs51/cc2430.h --- sdcc-3.1.0+dfsg/device/include/mcs51/cc2430.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/cc2430.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/cc2510fx.h sdcc-3.2.0+dfsg/device/include/mcs51/cc2510fx.h --- sdcc-3.1.0+dfsg/device/include/mcs51/cc2510fx.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/cc2510fx.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/cc2530.h sdcc-3.2.0+dfsg/device/include/mcs51/cc2530.h --- sdcc-3.1.0+dfsg/device/include/mcs51/cc2530.h 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/cc2530.h 2012-06-21 09:00:27.000000000 +0000 @@ -0,0 +1,471 @@ +/*------------------------------------------------------------------------- + cc2530.h - Register Declarations for Chipcon/Texas Intruments CC2530 + (Based on CC253x User's Guide (rev. B) SWRU191B) + + Copyright (C) 2011, Zafi Ramarosandratana / zramaro at gmail.com + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +#ifndef REG_CC2530_H +#define REG_CC2530_H + +#include + +// Interrupt Vectors + +#define RFERR_VECTOR 0 // RF TX FIFO underflow and RX FIFO overflow. +#define ADC_VECTOR 1 // ADC end of conversion +#define URX0_VECTOR 2 // USART0 RX complete +#define URX1_VECTOR 3 // USART1 RX complete +#define ENC_VECTOR 4 // AES encryption/decryption complete +#define ST_VECTOR 5 // Sleep Timer compare +#define P2INT_VECTOR 6 // Port 2 inputs +#define UTX0_VECTOR 7 // USART0 TX complete +#define DMA_VECTOR 8 // DMA transfer complete +#define T1_VECTOR 9 // Timer 1 (16-bit) capture/compare/overflow +#define T2_VECTOR 10 // Timer 2 (MAC Timer) +#define T3_VECTOR 11 // Timer 3 (8-bit) capture/compare/overflow +#define T4_VECTOR 12 // Timer 4 (8-bit) capture/compare/overflow +#define P0INT_VECTOR 13 // Port 0 inputs +#define UTX1_VECTOR 14 // USART1 TX complete +#define P1INT_VECTOR 15 // Port 1 inputs +#define RF_VECTOR 16 // RF general interrupts +#define WDT_VECTOR 17 // Watchdog overflow in timer mode + +// SFR Registers and BITs + +SFR(P0, 0x80); // Port 0 + SBIT(P0_0, 0x80, 0); // Port 0 bit 0 + SBIT(P0_1, 0x80, 1); // Port 0 bit 1 + SBIT(P0_2, 0x80, 2); // Port 0 bit 2 + SBIT(P0_3, 0x80, 3); // Port 0 bit 3 + SBIT(P0_4, 0x80, 4); // Port 0 bit 4 + SBIT(P0_5, 0x80, 5); // Port 0 bit 5 + SBIT(P0_6, 0x80, 6); // Port 0 bit 6 + SBIT(P0_7, 0x80, 7); // Port 0 bit 7 +SFR(SP, 0x81); // Stack Pointer +SFR(DPL0, 0x82); // Data Pointer 0 Low Byte +SFR(DPH0, 0x83); // Data Pointer 0 High Byte +SFR(DPL1, 0x84); // Data Pointer 1 Low Byte +SFR(DPH1, 0x85); // Data Pointer 1 High Byte +SFR(U0CSR, 0x86); // USART 0 Control and Status +SFR(PCON, 0x87); // Power Mode Control +SFR(TCON, 0x88); // Interrupt Flags + SBIT(IT0, 0x88, 0); // reserved (must always be set to 1) + SBIT(RFERRIF, 0x88, 1); // RF TX/RX FIFO interrupt flag + SBIT(IT1, 0x88, 2); // reserved (must always be set to 1) + SBIT(URX0IF, 0x88, 3); // USART0 RX Interrupt Flag + SBIT(ADCIF, 0x88, 5); // ADC Interrupt Flag + SBIT(URX1IF, 0x88, 7); // USART1 RX Interrupt Flag +SFR(P0IFG, 0x89); // Port 0 Interrupt Status Flag +SFR(P1IFG, 0x8A); // Port 1 Interrupt Status Flag +SFR(P2IFG, 0x8B); // Port 2 Interrupt Status Flag +SFR(PICTL, 0x8C); // Port Interrupt Control +SFR(P1IEN, 0x8D); // Port 1 Interrupt Mask +SFR(P0INP, 0x8F); // Port 0 Input Mode +SFR(P1, 0x90); // Port 1 + SBIT(P1_0, 0x90, 0); // Port 1 bit 0 + SBIT(P1_1, 0x90, 1); // Port 1 bit 1 + SBIT(P1_2, 0x90, 2); // Port 1 bit 2 + SBIT(P1_3, 0x90, 3); // Port 1 bit 3 + SBIT(P1_4, 0x90, 4); // Port 1 bit 4 + SBIT(P1_5, 0x90, 5); // Port 1 bit 5 + SBIT(P1_6, 0x90, 6); // Port 1 bit 6 + SBIT(P1_7, 0x90, 7); // Port 1 bit 7 +SFR(RFIRQF1, 0x91); // RF Interrupt Flags MSB +SFR(DPS, 0x92); // Data Pointer Select +SFR(MPAGE, 0x93); // Memory Page Select +SFR(_XPAGE, 0x93); // XDATA/PDATA page alias for SDCC +SFR(T2CTRL, 0x94); // Timer 2 Control +SFR(ST0, 0x95); // Sleep Timer 0 +SFR(ST1, 0x96); // Sleep Timer 1 +SFR(ST2, 0x97); // Sleep Timer 2 +SFR(S0CON, 0x98); // Interrupt Flags 2 + SBIT(ENCIF_0, 0x98, 0); // AES Interrupt Flag 0 + SBIT(ENCIF_1, 0x98, 1); // AES Interrupt Flag 1 +SFR(IEN2, 0x9A); // Interrupt Enable 2 +SFR(S1CON, 0x9B); // Interrupt Flags 3 +SFR(T2EVTCFG, 0x9C); // Timer 2 Event Configuration +SFR(SLEEPSTA, 0x9D); // Sleep Mode Control Status +SFR(CLKCONSTA,0x9E); // Clock Control Status +SFR(PSBANK, 0x9F); // Identifier Name used by the trampoline __sdcc_banked_call +SFR(FMAP, 0x9F); // Flash Memory Bank Mapping +SFR(P2, 0xA0); // Port 2 + SBIT(P2_0, 0xA0, 0); // Port 2 bit 0 + SBIT(P2_1, 0xA0, 1); // Port 2 bit 1 + SBIT(P2_2, 0xA0, 2); // Port 2 bit 2 + SBIT(P2_3, 0xA0, 3); // Port 2 bit 3 + SBIT(P2_4, 0xA0, 4); // Port 2 bit 4 + SBIT(P2_5, 0xA0, 5); // Port 2 bit 5 + SBIT(P2_6, 0xA0, 6); // Port 2 bit 6 + SBIT(P2_7, 0xA0, 7); // Port 2 bit 7 +SFR(T2IRQF, 0xA1); // Timer 2 Interrupt Flags +SFR(T2M0, 0xA2); // Timer 2 Multiplexed Register 0 +SFR(T2M1, 0xA3); // Timer 2 Multiplexed Rgeister 1 +SFR(T2MOVF0, 0xA4); // Timer 2 Multiplexed Overflow Register 0 +SFR(T2MOVF1, 0xA5); // Timer 2 Multiplexed Overflow Register 1 +SFR(T2MOVF2, 0xA6); // Timer 2 Multiplexed Overflow Register 2 +SFR(T2IRQM, 0xA7); // Timer 2 Interrupt Mask +SFR(IEN0, 0xA8); // Interrupt Enable 0 + SBIT(RFERRIE, 0xA8, 0); // RF TX/RX FIFO interrupt Enable + SBIT(ADCIE, 0xA8, 1); // ADC Interrupt Enable + SBIT(URX0IE, 0xA8, 2); // USART0 RX Interrupt Enable + SBIT(URX1IE, 0xA8, 3); // USART1 RX Interrupt Enable + SBIT(ENCIE, 0xA8, 4); // AES Encryption/Decryption Interrupt Enable + SBIT(STIE, 0xA8, 5); // Sleep Timer Interrupt Enable + SBIT(EA, 0xA8, 7); // Global Interrupt Enable +SFR(IP0, 0xA9); // Interrupt Priority 0 +SFR(P0IEN, 0xAB); // Port 0 Interrupt Mask +SFR(P2IEN, 0xAC); // Port 2 Interrupt Mask +SFR(STLOAD, 0xAD); // Sleep Timer Load Status +SFR(PMUX, 0xAE); // Power Down Signal Mux +SFR(T1STAT, 0xAF); // Timer 1 Status +SFR(ENCDI, 0xB1); // Encryption Input Data +SFR(ENCDO, 0xB2); // Encryption Output Data +SFR(ENCCS, 0xB3); // Encryption Control and Status +SFR(ADCCON1, 0xB4); // ADC Control 1 +SFR(ADCCON2, 0xB5); // ADC Control 2 +SFR(ADCCON3, 0xB6); // ADC Control 3 +SFR(IEN1, 0xB8); // Interrupt Enable 1 + SBIT(DMAIE, 0xB8, 0); // DMA Transfer Interrupt Enable + SBIT(T1IE, 0xB8, 1); // Timer 1 Interrupt Enable + SBIT(T2IE, 0xB8, 2); // Timer 2 Interrupt Enable + SBIT(T3IE, 0xB8, 3); // Timer 3 Interrupt Enable + SBIT(T4IE, 0xB8, 4); // Timer 4 Interrupt Enable + SBIT(P0IE, 0xB8, 5); // Port 0 Interrupt Enable +SFR(IP1, 0xB9); // Interrupt Priority 1 +SFR(ADCL, 0xBA); // ADC Data Low +SFR(ADCH, 0xBB); // ADC Data High +SFR(RNDL, 0xBC); // Random Number Generator Data Low Byte +SFR(RNDH, 0xBD); // Random Number Generator Data High Byte +SFR(SLEEPCMD, 0xBE); // Sleep Mode Control Command +SFR(RFERRF, 0xBF); // RF Error Interrupt Flags +SFR(IRCON, 0xC0); // Interrupt Flags 4 + SBIT(DMAIF, 0xC0, 0); // DMA Complete Interrupt Flag + SBIT(T1IF, 0xC0, 1); // Timer 1 Interrupt Flag + SBIT(T2IF, 0xC0, 2); // Timer 2 Interrupt Flag + SBIT(T3IF, 0xC0, 3); // Timer 3 Interrupt Flag + SBIT(T4IF, 0xC0, 4); // Timer 4 Interrupt Flag + SBIT(P0IF, 0xC0, 5); // Port 0 Interrupt Flag + SBIT(STIF, 0xC0, 7); // Sleep Timer Interrupt Flag +SFR(U0DBUF, 0xC1); // USART 0 Receive/Transmit Data Buffer +SFR(U0BAUD, 0xC2); // USART 0 Baud Rate Control +SFR(T2MSEL, 0xC3); // Timer 2 Multiplex Select +SFR(U0UCR, 0xC4); // USART 0 UART Control +SFR(U0GCR, 0xC5); // USART 0 Generic Control +SFR(CLKCONCMD,0xC6); // Clock Control Command +SFR(MEMCTR, 0xC7); // Memory Arbitrer Control +SFR(WDCTL, 0xC9); // Watchdog Timer Control +SFR(T3CNT, 0xCA); // Timer 3 Counter +SFR(T3CTL, 0xCB); // Timer 3 Control +SFR(T3CCTL0, 0xCC); // Timer 3 Channel 0 Capture/Compare Control +SFR(T3CC0, 0xCD); // Timer 3 Channel 0 Capture/Compare Value +SFR(T3CCTL1, 0xCE); // Timer 3 Channel 1 Capture/Compare Control +SFR(T3CC1, 0xCF); // Timer 3 Channel 1 Capture/Compare Value +SFR(PSW, 0xD0); // Program Status Word + SBIT(P, 0xD0, 0); // Parity Flag + SBIT(F1, 0xD0, 1); // User-Defined Flag + SBIT(OV, 0xD0, 2); // Overflow Flag + SBIT(RS0, 0xD0, 3); // Register Bank Select 0 + SBIT(RS1, 0xD0, 4); // Register Bank Select 1 + SBIT(F0, 0xD0, 5); // User-Defined Flag + SBIT(AC, 0xD0, 6); // Auxiliary Carry Flag + SBIT(CY, 0xD0, 7); // Carry Flag +SFR(DMAIRQ, 0xD1); // DMA Interrupt Flag +SFR(DMA1CFGL, 0xD2); // DMA Channel 1-4 Configuration Address Low Byte +SFR(DMA1CFGH, 0xD3); // DMA Channel 1-4 Configuration Address High Byte +SFR(DMA0CFGL, 0xD4); // DMA Channel 0 Configuration Address Low Byte +SFR(DMA0CFGH, 0xD5); // DMA Channel 0 Configuration Address High Byte +SFR(DMAARM, 0xD6); // DMA Channel Arm +SFR(DMAREQ, 0xD7); // DMA Channel Start Request and Status +SFR(TIMIF, 0xD8); // Timers 1/3/4 Interrupt Mask/Flag + SBIT(T3OVFIF, 0xD8, 0); // Timer 3 overflow interrupt flag 0:no pending 1:pending + SBIT(T3CH0IF, 0xD8, 1); // Timer 3 channel 0 interrupt flag 0:no pending 1:pending + SBIT(T3CH1IF, 0xD8, 2); // Timer 3 channel 1 interrupt flag 0:no pending 1:pending + SBIT(T4OVFIF, 0xD8, 3); // Timer 4 overflow interrupt flag 0:no pending 1:pending + SBIT(T4CH0IF, 0xD8, 4); // Timer 4 channel 0 interrupt flag 0:no pending 1:pending + SBIT(T4CH1IF, 0xD8, 5); // Timer 4 channel 1 interrupt flag 0:no pending 1:pending + SBIT(OVFIM, 0xD8, 6); // Timer 1 overflow interrupt mask +SFR(RFD, 0xD9); // RF Data +SFR(T1CC0L, 0xDA); // Timer 1 Channel 0 Capture/Compare Value Low +SFR(T1CC0H, 0xDB); // Timer 1 Channel 0 Capture/Compare Value High +SFR(T1CC1L, 0xDC); // Timer 1 Channel 1 Capture/Compare Value Low +SFR(T1CC1H, 0xDD); // Timer 1 Channel 1 Capture/Compare Value High +SFR(T1CC2L, 0xDE); // Timer 1 Channel 2 Capture/Compare Value Low +SFR(T1CC2H, 0xDF); // Timer 1 Channel 2 Capture/Compare Value High +SFR(ACC, 0xE0); // Accumulator + SBIT(ACC_0, 0xE0, 0); // Accumulator bit 0 + SBIT(ACC_1, 0xE0, 1); // Accumulator bit 1 + SBIT(ACC_2, 0xE0, 2); // Accumulator bit 2 + SBIT(ACC_3, 0xE0, 3); // Accumulator bit 3 + SBIT(ACC_4, 0xE0, 4); // Accumulator bit 4 + SBIT(ACC_5, 0xE0, 5); // Accumulator bit 5 + SBIT(ACC_6, 0xE0, 6); // Accumulator bit 6 + SBIT(ACC_7, 0xE0, 7); // Accumulator bit 7 +SFR(RFST, 0xE1); // RF CSMA-CA / Strobe Processor +SFR(T1CNTL, 0xE2); // Timer 1 Counter Low +SFR(T1CNTH, 0xE3); // Timer 1 Counter High +SFR(T1CTL, 0xE4); // Timer 1 Control and Status +SFR(T1CCTL0, 0xE5); // Timer 1 Channel 0 Capture/Compare Control +SFR(T1CCTL1, 0xE6); // Timer 1 Channel 1 Capture/Compare Control +SFR(T1CCTL2, 0xE7); // Timer 1 Channel 2 Capture/Compare Control +SFR(IRCON2, 0xE8); // Interrupt Flags 5 + SBIT(P2IF, 0xE8, 0); // Port 2 Interrupt Flag + SBIT(UTX0IF, 0xE8, 1); // USART0 TX Interrupt Flag + SBIT(UTX1IF, 0xE8, 2); // USART1 TX Interrupt Flag + SBIT(P1IF, 0xE8, 3); // Port 1 Interrupt Flag + SBIT(WDTIF, 0xE8, 4); // Watchdog Timer Interrupt Flag +SFR(RFIRQF0, 0xE9); // RF Interrupt Flags LSB +SFR(T4CNT, 0xEA); // Timer 4 Counter +SFR(T4CTL, 0xEB); // Timer 4 Control +SFR(T4CCTL0, 0xEC); // Timer 4 Channel 0 Capture/Compare Control +SFR(T4CC0, 0xED); // Timer 4 Channel 0 Capture/Compare Value +SFR(T4CCTL1, 0xEE); // Timer 4 Channel 1 Capture/Compare Control +SFR(T4CC1, 0xEF); // Timer 4 Channel 1 Capture/Compare Value +SFR(B, 0xF0); // B Register + SBIT(B_0, 0xF0, 0); // Register B bit 0 + SBIT(B_1, 0xF0, 1); // Register B bit 1 + SBIT(B_2, 0xF0, 2); // Register B bit 2 + SBIT(B_3, 0xF0, 3); // Register B bit 3 + SBIT(B_4, 0xF0, 4); // Register B bit 4 + SBIT(B_5, 0xF0, 5); // Register B bit 5 + SBIT(B_6, 0xF0, 6); // Register B bit 6 + SBIT(B_7, 0xF0, 7); // Register B bit 7 +SFR(PERCFG, 0xF1); // Peripheral I/O Control +SFR(APCFG, 0xF2); // Analog Peripheral I/O Configuration +SFR(P0SEL, 0xF3); // Port 0 Function Select +SFR(P1SEL, 0xF4); // Port 1 Function Select +SFR(P2SEL, 0xF5); // Port 2 Function Select +SFR(P1INP, 0xF6); // Port 1 Input Mode +SFR(P2INP, 0xF7); // Port 2 Input Mode +SFR(U1CSR, 0xF8); // USART 1 Control and Status + SBIT(ACTIVE, 0xF8, 0); // USART transmit/receive active status 0:idle 1:busy + SBIT(TX_BYTE, 0xF8, 1); // Transmit byte status 0:Byte not transmitted 1:Last byte transmitted + SBIT(RX_BYTE, 0xF8, 2); // Receive byte status 0:No byte received 1:Received byte ready + SBIT(ERR, 0xF8, 3); // UART parity error status 0:No error 1:parity error + SBIT(FE, 0xF8, 4); // UART framing error status 0:No error 1:incorrect stop bit level + SBIT(SLAVE, 0xF8, 5); // SPI master or slave mode select 0:master 1:slave + SBIT(RE, 0xF8, 6); // UART receiver enable 0:disabled 1:enabled + SBIT(MODE, 0xF8, 7); // USART mode select 0:SPI 1:UART +SFR(U1DBUF, 0xF9); // USART 1 Receive/Transmit Data Buffer +SFR(U1BAUD, 0xFA); // USART 1 Baud Rate Control +SFR(U1UCR, 0xFB); // USART 1 UART Control +SFR(U1GCR, 0xFC); // USART 1 Generic Control +SFR(P0DIR, 0xFD); // Port 0 Direction +SFR(P1DIR, 0xFE); // Port 1 Direction +SFR(P2DIR, 0xFF); // Port 2 Direction +// +//// From Table 2-2 : Overview of XREG Registers +// +SFRX(I2CCFG, 0x6230); // I2C control +SFRX(I2CSTAT, 0x6231); // I2C status +SFRX(I2CDATA, 0x6232); // I2C data +SFRX(I2CADDR, 0x6233); // I2C own slave address +SFRX(I2CWC, 0x6234); // Wrapper control +SFRX(I2CIO, 0x6235); // GPIO +SFRX(OBSSEL0, 0x6243); // Observation output control register 0 +SFRX(OBSSEL1, 0x6244); // Observation output control register 1 +SFRX(OBSSEL2, 0x6245); // Observation output control register 2 +SFRX(OBSSEL3, 0x6246); // Observation output control register 3 +SFRX(OBSSEL4, 0x6247); // Observation output control register 4 +SFRX(OBSSEL5, 0x6248); // Observation output control register 5 +SFRX(CHVER, 0x6249); // Chip version +SFRX(CHIPID, 0x624A); // Chip identification +SFRX(TESTREG0, 0x624B); // Test register 0, cannot use TR0 name from the datasheet due to TR0 (TCON.4) redefinition +SFRX(DBGDATA, 0x6260); // Debug interface write data +SFRX(SRCRC, 0x6262); // Sleep reset CRC +SFRX(BATTMON, 0x6264); // Battery monitor +SFRX(IVCTRL, 0x6265); // Analog control register +SFRX(FCTL, 0x6270); // Flash control +SFRX(FADDRL, 0x6271); // Flash address low +SFRX(FADDRH, 0x6272); // Flash address high +SFRX(FWDATA, 0x6273); // Flash write data +SFRX(CHIPINFO0, 0x6276); // Chip information byte 0 +SFRX(CHIPINFO1, 0x6277); // Chip information byte 1 +SFRX(IRCTL, 0x6281); // Timer 1 IR generation control +SFRX(CLD, 0x6290); // Clock-loss detection +SFRX(X_T1CCTL0, 0x62A0); // Timer 1 channel 0 capture/compare control (additional XREG mapping of SFR register) +SFRX(X_T1CCTL1, 0x62A1); // Timer 1 channel 1 capture/compare control (additional XREG mapping of SFR register) +SFRX(X_T1CCTL2, 0x62A2); // Timer 1 channel 2 capture/compare control (additional XREG mapping of SFR register) +SFRX(T1CCTL3, 0x62A3); // Timer 1 channel 3 capture/compare control +SFRX(T1CCTL4, 0x62A4); // Timer 1 channel 4 capture/compare control +SFRX(X_T1CC0L, 0x62A6); // Timer 1 channel 0 capture/compare value low (additional XREG mapping of SFR register) +SFRX(X_T1CC0H, 0x62A7); // Timer 1 channel 0 capture/compare value high (additional XREG mapping of SFR register) +SFRX(X_T1CC1L, 0x62A8); // Timer 1 channel 1 capture/compare value low (additional XREG mapping of SFR register) +SFRX(X_T1CC1H, 0x62A9); // Timer 1 channel 1 capture/compare value high (additional XREG mapping of SFR register) +SFRX(X_T1CC2L, 0x62AA); // Timer 1 channel 2 capture/compare value low (additional XREG mapping of SFR register) +SFRX(X_T1CC2H, 0x62AB); // Timer 1 channel 2 capture/compare value high (additional XREG mapping of SFR register) +SFRX(T1CC3L, 0x62AC); // Timer 1 channel 3 capture/compare value low +SFRX(T1CC3H, 0x62AD); // Timer 1 channel 3 capture/compare value high +SFRX(T1CC4L, 0x62AE); // Timer 1 channel 4 capture/compare value low +SFRX(T1CC4H, 0x62AF); // Timer 1 channel 4 capture/compare value high +SFRX(STCC, 0x62B0); // Sleep Timer capture control +SFRX(STCS, 0x62B1); // Sleep Timer capture status +SFRX(STCV0, 0x62B2); // Sleep Timer capture value byte 0 +SFRX(STCV1, 0x62B3); // Sleep Timer capture value byte 1 +SFRX(STCV2, 0x62B4); // Sleep Timer capture value byte 2 +SFRX(OPAMPC, 0x62C0); // Operational amplifier control +SFRX(OPAMPS, 0x62C1); // Operational amplifier status +SFRX(CMPCTL, 0x62D0); // Analog comparator control and status +// +//// From Section 21.12 : USB Registers +// +SFRX(USBADDR, 0x6200); // Function Address +SFRX(USBPOW, 0x6201); // Power/Control Register +SFRX(USBIIF, 0x6202); // IN Endpoints and EP0 Interrupt Flags +SFRX(USBOIF, 0x6204); // OUT-Endpoint Interrupt Flags +SFRX(USBCIF, 0x6206); // Common USB Interrupt Flags +SFRX(USBIIE, 0x6207); // IN Endpoints and EP0 Interrupt-Enable Mask +SFRX(USBOIE, 0x6209); // Out Endpoints Interrupt Enable Mask +SFRX(USBCIE, 0x620B); // Common USB Interrupt-Enable Mask +SFRX(USBFRML, 0x620C); // Current Frame Number (Low Byte) +SFRX(USBFRMH, 0x620D); // Current Frame Number (High Byte) +SFRX(USBINDEX, 0x620E); // Current-Endpoint Index Register +SFRX(USBCTRL, 0x620F); // USB Control Register +SFRX(USBMAXI, 0x6210); // Max. Packet Size for IN Endpoint{15} +SFRX(USBCS0, 0x6211); // EP0 Control and Status (USBINDEX = 0) +SFRX(USBCSIL, 0x6211); // IN EP{15} Control and Status, Low +SFRX(USBCSIH, 0x6212); // IN EP{15} Control and Status, High +SFRX(USBMAXO, 0x6213); // Max. Packet Size for OUT EP{15} +SFRX(USBCSOL, 0x6214); // OUT EP{15} Control and Status, Low +SFRX(USBCSOH, 0x6215); // OUT EP{15} Control and Status, High +SFRX(USBCNT0, 0x6216); // Number of Received Bytes in EP0 FIFO (USBINDEX = 0) +SFRX(USBCNTL, 0x6216); // Number of Bytes in EP{15} OUT FIFO, Low +SFRX(USBCNTH, 0x6217); // Number of Bytes in EP{15} OUT FIFO, High +SFRX(USBF0, 0x6220); // Endpoint-0 FIFO +SFRX(USBF1, 0x6222); // Endpoint-1 FIFO +SFRX(USBF2, 0x6224); // Endpoint-2 FIFO +SFRX(USBF3, 0x6226); // Endpoint-3 FIFO +SFRX(USBF4, 0x6228); // Endpoint-4 FIFO +SFRX(USBF5, 0x622A); // Endpoint-5 FIFO +// +//// From Table 23.1 : Frame Filtering +// +SFRX(SHORTADDRH, 0x6174); // Short Address High Byte +SFRX(SHORTADDRL, 0x6175); // Short Address Low Byte +SFRX(PANIDH, 0x6172); // PAN ID High Byte +SFRX(PANIDL, 0x6173); // PAN ID Low Byte +SFRX(IEEE_ADDR, 0x616A); // Extended Address MSB + +// +//// From Table 23-5 : CC253x Radio Register Overview +// +SFRX(FRMFILT0, 0x6180); // Frame Filtering +SFRX(FRMFILT1, 0x6181); // Frame Filtering +SFRX(SRCMATCH, 0x6182); // Source Address Matching and Pending Bits +SFRX(SRCSHORTEN0,0x6183); // Short Address Matching +SFRX(SRCSHORTEN1,0x6184); // Short Address Matching +SFRX(SRCSHORTEN2,0x6185); // Short Address Matching +SFRX(SRCEXTEN0, 0x6186); // Extended Address Matching +SFRX(SRCEXTEN1, 0x6187); // Extended Address Matching +SFRX(SRCEXTEN2, 0x6188); // Extended Address Matching +SFRX(FRMCTRL0, 0x6189); // Frame Handling +SFRX(FRMCTRL1, 0x618A); // Frame Handling +SFRX(RXENABLE, 0x618B); // RX Enabling +SFRX(RXMASKSET, 0x618C); // RX Enabling +SFRX(RXMASKCLR, 0x618D); // RX Disabling +SFRX(FREQTUNE, 0x618E); // Crystal Oscillator Frequency Tuning +SFRX(FREQCTRL, 0x618F); // Controls the RF Frequency +SFRX(TXPOWER, 0x6190); // Controls the Output Power +SFRX(TXCTRL, 0x6191); // Controls the TX Settings +SFRX(FSMSTAT0, 0x6192); // Radio Status Register +SFRX(FSMSTAT1, 0x6193); // Radio Status Register +SFRX(FIFOPCTRL, 0x6194); // FIFOP Threshold +SFRX(FSMCTRL, 0x6195); // FSM Options +SFRX(CCACTRL0, 0x6196); // CCA Threshold +SFRX(CCACTRL1, 0x6197); // Other CCA Options +SFRX(RSSI, 0x6198); // RSSI Status Register +SFRX(RSSISTAT, 0x6199); // RSSI Valid Status Register +SFRX(RXFIRST, 0x619A); // First Byte in RXFIFO +SFRX(RXFIFOCNT, 0x619B); // Number of Bytes in RXFIFO +SFRX(TXFIFOCNT, 0x619C); // Number of Bytes in TXFIFO +SFRX(RXFIRST_PTR,0x619D); // RXFIFO Pointer +SFRX(RXLAST_PTR, 0x619E); // RXFIFO Pointer +SFRX(RXP1_PTR, 0x619F); // RXFIFO Pointer +SFRX(TXFIRST_PTR,0x61A1); // TXFIFO Pointer +SFRX(TXLAST_PTR, 0x61A2); // TXFIFO Pointer +SFRX(RFIRQM0, 0x61A3); // RF Interrupt Masks +SFRX(RFIRQM1, 0x61A4); // RF Interrupt Masks +SFRX(RFERRM, 0x61A5); // RF Error Interrupt Mask +SFRX(OPAMPMC, 0x61A6); // Operational amplifier mode control +SFRX(RFRND, 0x61A7); // Random Data +SFRX(MDMCTRL0, 0x61A8); // Controls Modem +SFRX(MDMCTRL1, 0x61A9); // Controls Modem +SFRX(FREQEST, 0x61AA); // Estimated RF Frequency Offset +SFRX(RXCTRL, 0x61AB); // Tune Receive Section +SFRX(FSCTRL, 0x61AC); // Tune Frequency Synthesizer +SFRX(FSCAL1, 0x61AE); // Tune Frequency Calibration +SFRX(FSCAL2, 0x61AF); // Tune Frequency Calibration +SFRX(FSCAL3, 0x61B0); // Tune Frequency Calibration +SFRX(AGCCTRL0, 0x61B1); // AGC Dynamic Range Control +SFRX(AGCCTRL1, 0x61B2); // AGC Reference Level +SFRX(AGCCTRL2, 0x61B3); // AGC Gain Override +SFRX(AGCCTRL3, 0x61B4); // AGC Control +SFRX(ADCTEST0, 0x61B5); // ADC Tuning +SFRX(ADCTEST1, 0x61B6); // ADC Tuning +SFRX(ADCTEST2, 0x61B7); // ADC Tuning +SFRX(MDMTEST0, 0x61B8); // Test Register for Modem +SFRX(MDMTEST1, 0x61B9); // Test Register for Modem +SFRX(DACTEST0, 0x61BA); // DAC Override Value +SFRX(DACTEST1, 0x61BB); // DAC Override Value +SFRX(DACTEST2, 0x61BC); // DAC Test Setting +SFRX(ATEST, 0x61BD); // Analog Test Control +SFRX(PTEST0, 0x61BE); // Override Power-Down Register +SFRX(PTEST1, 0x61BF); // Override Power-Down Register +SFRX(CSPPROG0, 0x61C0); // CSP Program 0 +SFRX(CSPPROG1, 0x61C1); // CSP Program 1 +SFRX(CSPPROG2, 0x61C2); // CSP Program 2 +SFRX(CSPPROG3, 0x61C3); // CSP Program 3 +SFRX(CSPPROG4, 0x61C4); // CSP Program 4 +SFRX(CSPPROG5, 0x61C5); // CSP Program 5 +SFRX(CSPPROG6, 0x61C6); // CSP Program 6 +SFRX(CSPPROG7, 0x61C7); // CSP Program 7 +SFRX(CSPPROG8, 0x61C8); // CSP Program 8 +SFRX(CSPPROG9, 0x61C9); // CSP Program 9 +SFRX(CSPPROG10, 0x61CA); // CSP Program 10 +SFRX(CSPPROG11, 0x61CB); // CSP Program 11 +SFRX(CSPPROG12, 0x61CC); // CSP Program 12 +SFRX(CSPPROG13, 0x61CD); // CSP Program 13 +SFRX(CSPPROG14, 0x61CE); // CSP Program 14 +SFRX(CSPPROG15, 0x61CF); // CSP Program 15 +SFRX(CSPPROG16, 0x61D0); // CSP Program 16 +SFRX(CSPPROG17, 0x61D1); // CSP Program 17 +SFRX(CSPPROG18, 0x61D2); // CSP Program 18 +SFRX(CSPPROG19, 0x61D3); // CSP Program 19 +SFRX(CSPPROG20, 0x61D4); // CSP Program 20 +SFRX(CSPPROG21, 0x61D5); // CSP Program 21 +SFRX(CSPPROG22, 0x61D6); // CSP Program 22 +SFRX(CSPPROG23, 0x61D7); // CSP Program 23 +SFRX(CSPCTRL, 0x61E0); // CSP Control Bit +SFRX(CSPSTAT, 0x61E1); // CSP Status Register +SFRX(CSPX, 0x61E2); // CSP X Register +SFRX(CSPY, 0x61E3); // CSP Y Register +SFRX(CSPZ, 0x61E4); // CSP Z Register +SFRX(CSPT, 0x61E5); // CSP T Register +SFRX(RFC_OBS_CTRL0, 0x61EB); // RF Observation Mux Control +SFRX(RFC_OBS_CTRL1, 0x61EC); // RF Observation Mux Control +SFRX(RFC_OBS_CTRL2, 0x61ED); // RF Observation Mux Control +SFRX(TXFILTCFG, 0x61FA); // TX Filter Configuration + +#endif //REG_CC2530_H diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/compiler.h sdcc-3.2.0+dfsg/device/include/mcs51/compiler.h --- sdcc-3.1.0+dfsg/device/include/mcs51/compiler.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/compiler.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -70,7 +70,7 @@ /** SDCC - Small Device C Compiler * http://sdcc.sf.net */ -#if defined SDCC +#if defined (SDCC) || defined (__SDCC) # define SBIT(name, addr, bit) __sbit __at(addr+bit) name # define SFR(name, addr) __sfr __at(addr) name # define SFRX(name, addr) __xdata volatile unsigned char __at(addr) name @@ -183,3 +183,4 @@ #endif #endif //COMPILER_H + diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/lint.h sdcc-3.2.0+dfsg/device/include/mcs51/lint.h --- sdcc-3.1.0+dfsg/device/include/mcs51/lint.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/lint.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/mcs51reg.h sdcc-3.2.0+dfsg/device/include/mcs51/mcs51reg.h --- sdcc-3.1.0+dfsg/device/include/mcs51/mcs51reg.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/mcs51reg.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/msc1210.h sdcc-3.2.0+dfsg/device/include/mcs51/msc1210.h --- sdcc-3.1.0+dfsg/device/include/mcs51/msc1210.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/msc1210.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/msm8xc154s.h sdcc-3.2.0+dfsg/device/include/mcs51/msm8xc154s.h --- sdcc-3.1.0+dfsg/device/include/mcs51/msm8xc154s.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/msm8xc154s.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/p89c66x.h sdcc-3.2.0+dfsg/device/include/mcs51/p89c66x.h --- sdcc-3.1.0+dfsg/device/include/mcs51/p89c66x.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/p89c66x.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/p89lpc9321.h sdcc-3.2.0+dfsg/device/include/mcs51/p89lpc9321.h --- sdcc-3.1.0+dfsg/device/include/mcs51/p89lpc9321.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/p89lpc9321.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/p89lpc9331.h sdcc-3.2.0+dfsg/device/include/mcs51/p89lpc9331.h --- sdcc-3.1.0+dfsg/device/include/mcs51/p89lpc9331.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/p89lpc9331.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/p89lpc933_4.h sdcc-3.2.0+dfsg/device/include/mcs51/p89lpc933_4.h --- sdcc-3.1.0+dfsg/device/include/mcs51/p89lpc933_4.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/p89lpc933_4.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/p89lpc9351.h sdcc-3.2.0+dfsg/device/include/mcs51/p89lpc9351.h --- sdcc-3.1.0+dfsg/device/include/mcs51/p89lpc9351.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/p89lpc9351.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/p89lpc935_6.h sdcc-3.2.0+dfsg/device/include/mcs51/p89lpc935_6.h --- sdcc-3.1.0+dfsg/device/include/mcs51/p89lpc935_6.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/p89lpc935_6.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/p89lpc938.h sdcc-3.2.0+dfsg/device/include/mcs51/p89lpc938.h --- sdcc-3.1.0+dfsg/device/include/mcs51/p89lpc938.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/p89lpc938.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/p89v51rd2.h sdcc-3.2.0+dfsg/device/include/mcs51/p89v51rd2.h --- sdcc-3.1.0+dfsg/device/include/mcs51/p89v51rd2.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/p89v51rd2.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/p89v66x.h sdcc-3.2.0+dfsg/device/include/mcs51/p89v66x.h --- sdcc-3.1.0+dfsg/device/include/mcs51/p89v66x.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/p89v66x.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/reg51.h sdcc-3.2.0+dfsg/device/include/mcs51/reg51.h --- sdcc-3.1.0+dfsg/device/include/mcs51/reg51.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/reg51.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/reg764.h sdcc-3.2.0+dfsg/device/include/mcs51/reg764.h --- sdcc-3.1.0+dfsg/device/include/mcs51/reg764.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/reg764.h 2012-03-13 10:17:10.000000000 +0000 @@ -7,7 +7,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/regc515c.h sdcc-3.2.0+dfsg/device/include/mcs51/regc515c.h --- sdcc-3.1.0+dfsg/device/include/mcs51/regc515c.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/regc515c.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/sab80515.h sdcc-3.2.0+dfsg/device/include/mcs51/sab80515.h --- sdcc-3.1.0+dfsg/device/include/mcs51/sab80515.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/sab80515.h 2012-03-13 10:17:10.000000000 +0000 @@ -7,7 +7,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/ser.h sdcc-3.2.0+dfsg/device/include/mcs51/ser.h --- sdcc-3.1.0+dfsg/device/include/mcs51/ser.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/ser.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/ser_ir.h sdcc-3.2.0+dfsg/device/include/mcs51/ser_ir.h --- sdcc-3.1.0+dfsg/device/include/mcs51/ser_ir.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/ser_ir.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/serial.h sdcc-3.2.0+dfsg/device/include/mcs51/serial.h --- sdcc-3.1.0+dfsg/device/include/mcs51/serial.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/serial.h 2012-03-13 10:17:10.000000000 +0000 @@ -7,7 +7,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/serial_IO.h sdcc-3.2.0+dfsg/device/include/mcs51/serial_IO.h --- sdcc-3.1.0+dfsg/device/include/mcs51/serial_IO.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/serial_IO.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/stc12.h sdcc-3.2.0+dfsg/device/include/mcs51/stc12.h --- sdcc-3.1.0+dfsg/device/include/mcs51/stc12.h 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/stc12.h 2012-03-13 10:17:10.000000000 +0000 @@ -0,0 +1,320 @@ +/*------------------------------------------------------------------------- + stc12.h - Register Declarations for STC10/11/12 Series + Based on 8051.h and compiler.h + + Copyright (c) 2012, intron@intron.ac + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* + Brief: + + STC10/11/12 series are 8051-compatible MCU's. The "official" website + is http://www.stcmcu.com/ (In Chinese Han only), and datasheets in Chinese + Han and English can be downloaded there. + + Reference: + + 1. The "official" C header file (written for another C51 compiler): + http://www.stcmcu.com/datasheet/stc/STC-AD-PDF/STC_NEW_8051.H + 2. Datasheets for STC12(C/LE)5Axx(S2/AD) series: + Chinese Han: + http://www.stcmcu.com/datasheet/stc/STC-AD-PDF/STC12C5A60S2.pdf + English: + http://www.stcmcu.com/datasheet/stc/STC-AD-PDF/STC12C5A60S2-english.pdf + 3. Datasheets for STC12(C/LE)52xxAD series: + Chinese Han: + http://www.stcmcu.com/datasheet/stc/STC-AD-PDF/STC12C5201AD.pdf + English: + http://www.stcmcu.com/datasheet/stc/STC-AD-PDF/STC12C5201AD-english.pdf + 4. Datasheets for STC11/10 series: + Chinese Han: + http://www.stcmcu.com/datasheet/stc/STC-AD-PDF/STC11F-10Fxx.pdf + English: + http://www.stcmcu.com/datasheet/stc/STC-AD-PDF/STC11F-10Fxx-english.pdf + */ + +#ifndef _STC12_H_ +#define _STC12_H_ + +#include <8051.h> +#include + +#ifdef REG8051_H +#undef REG8051_H +#endif + +/* + * Auxiliary Register + * Bit Mapping: T0x12 T1x12 UART_M0x6 BRTR S2SMOD BRTx12 EXTRAM S1BRS + * Reset Value: 0000,0000 + */ +SFR(AUXR, 0x8E); + +/* + * Auxiliary Register 1 + * Bit Mapping: - PCA_P4 SPI_P4 S2_P4 GF2 ADRJ - DPS + * Reset Value: x000,00x0 + */ +SFR(AUXR1, 0xA2); + +/* + * Control Register for Clock Output and Power Down Wake-up + * Bit Mapping: PCAWAKEUP RXD_PIN_IE T1_PIN_IE T0_PIN_IE + * LVD_WAKE BRTCLKO T1CLKO T0CLKO + * (Here "O" is the letter meaning "output", not the digit.) + * Reset Value: 0000,0000 + */ +SFR(WAKE_CLKO, 0x8F); + +/* + * Clock Devider Register + * Bit Mapping: - - - - - CLKS2 CLKS1 CLKS0 + * Reset Value: xxxx,x000 + */ +SFR(CLK_DIV, 0x97); + +/* + * Stretch register + * Bit Mapping: - - ALES1 ALES0 - RWS2 RWS1 RWS0 + * Reset Value: xx10,x011 + */ +SFR(BUS_SPEED, 0xA1); + +/* Two extended bits in IE */ +SBIT(ELVD, 0xA8, 6); /* Enable Low Voltage Detection Interrupt */ +SBIT(EADC, 0xA8, 5); /* Enable ADC Interrupt */ + +/* + * Auxiliary Interrupt Register + * Bit Mapping: - - - - - - ESPI ES2 + * Reset Value: xxxx,xx00 + */ +SFR(IE2, 0xAF); + +/* Three extended bits in IP */ +SBIT(PPCA, 0xB8, 7); /* Interrupt Priority for PCA */ +SBIT(PLVD, 0xB8, 6); /* Interrupt Priority for Low Voltage Detection */ +SBIT(PADC, 0xB8, 5); /* Interrupt Priority for ADC */ + +/* + * Higher bits for Interrupt Priority + * Bit Mapping: PPCAH PLVDH PADCH PSH PT1H PX1H PT0H PX0H + * Reset Value: 0000,0000 + */ +SFR(IPH, 0xB7); + +/* + * The 2nd Interrupt Priority Register, Lower bits + * Bit Mapping: - - - - - - PSPI PS2 + * Reset Value: xxxx,xx00 + */ +SFR(IP2, 0xB5); + +/* + * The 2nd Interrupt Priority Register, Higher bits + * Bit Mapping: - - - - - - PSPIH PS2H + * Reset Value: xxxx,xx00 + */ +SFR(IP2H, 0xB6); + +/* + * Two Extended GPIO Ports: P4 and P5 + * - For DIP-40 and QFN-40 packages, only higher 4 bits of P4 are available. + * - For PLCC-44 and LQFP-44 packages, only all 8 bits of P4 are available. + * - For LQFP-48 package, all 8 bits of P4 and lower 4 bits of P5 are + * available. + */ +SFR(P4, 0xC0); + SBIT(P4_0, 0xC0, 0); + SBIT(P4_1, 0xC0, 1); + SBIT(P4_2, 0xC0, 2); + SBIT(P4_3, 0xC0, 3); + SBIT(P4_4, 0xC0, 4); + SBIT(P4_5, 0xC0, 5); + SBIT(P4_6, 0xC0, 6); + SBIT(P4_7, 0xC0, 7); +SFR(P5, 0xC8); /* Only lower 4 bits */ + SBIT(P5_0, 0xC8, 0); + SBIT(P5_1, 0xC8, 1); + SBIT(P5_2, 0xC8, 2); + SBIT(P5_3, 0xC8, 3); + +/* Working Mode Registers for P0, P1, P2, P3, P4 and P5 */ +SFR(P0M0, 0x94); +SFR(P0M1, 0x93); +SFR(P1M0, 0x92); +SFR(P1M1, 0x91); +SFR(P2M0, 0x96); +SFR(P2M1, 0x95); +SFR(P3M0, 0xB2); +SFR(P3M1, 0xB1); +SFR(P4M0, 0xB4); +SFR(P4M1, 0xB3); +SFR(P4SW, 0xBB); /* - LVD_P4.6 ALE_P4.5 NA_P4.4 - - - - Reset: x000,xxxx */ +SFR(P5M0, 0xCA); +SFR(P5M1, 0xC9); + +/* Slave Address Mask for Serial Communication */ +SFR(SADEN, 0xB9); + +/* Slave Address for Serial Communication */ +SFR(SADDR, 0xA9); + +/* + * The Control Register for the 2nd Serial Communication Port + * Bit Mapping: S2SM0 S2SM1 S2SM2 S2REN S2TB8 S2RB8 S2TI S2RI + * Reset Value: 0000,0000 + */ +SFR(S2CON, 0x9A); + +/* Data Buffer Register for the 2nd Serial Communication Port */ +SFR(S2BUF, 0x9B); + +/* + * Reload Value Register for the Specific Baud Rate Generator + * (Independent from the 8051 Timer) + */ +SFR(BRT, 0x9C); + +/* + * Watchdog Timer Control Register + * Bit Mapping: WDT_FLAG - EN_WDT CLR_WDT IDLE_WDT PS2 PS1 PS0 + * Reset Value: 0x00,0000 + */ +SFR(WDT_CONTR, 0xC1); + +/* + * PCA Control Register + * Bit Mapping: CF CR - - - - CCF1 CCF0 + * Reset Value: 00xx,xx00 + */ +SFR(CCON, 0xD8); + SBIT(CF, 0xD8, 7); + SBIT(CR, 0xD8, 6); + SBIT(CCF1, 0xD8, 1); + SBIT(CCF0, 0xD8, 0); + +/* + * PCA Mode Register + * Bit Mapping: CIDL - - - CPS2 CPS1 CPS0 ECF + * Reset Value: 0xxx,x000 + */ +SFR(CMOD, 0xD9); + +/* PCA Counter Registers */ +SFR(CL, 0xE9); /* Lower 8 bits */ +SFR(CH, 0xF9); /* Higher 8 bits */ + +/* + * PCA Module 0 PWM Register + * Bit Mapping: - ECOM0 CAPP0 CAPN0 MAT0 TOG0 PWM0 ECCF0 + * Reset Value: x000,0000 + */ +SFR(CCAPM0, 0xDA); + +/* + * PCA Module 1 PWM Register + * Bit Mapping: - ECOM1 CAPP1 CAPN1 MAT1 TOG1 PWM1 ECCF1 + * Reset Value: x000,0000 + */ +SFR(CCAPM1, 0xDB); + +/* PCA Module 0/1 Capture/Comparison Registers */ +SFR(CCAP0L, 0xEA); +SFR(CCAP0H, 0xFA); +SFR(CCAP1L, 0xEB); +SFR(CCAP1H, 0xFB); + +/* + * PCA Module 0 PWM Auxiliary Register + * Bit Mapping: - - - - - - EPC0H EPC0L + * Reset Value: xxxx,xx00 + */ +SFR(PCA_PWM0, 0xF2); + +/* + * PCA Module 1 PWM Auxiliary Register + * Bit Mapping: - - - - - - EPC1H EPC1L + * Reset Value: xxxx,xx00 + */ +SFR(PCA_PWM1, 0xF3); + +/* Switch P1 pins between ADC inputs and GPIO Port pins */ +SFR(P1ASF, 0x9D); + +/* + * ADC Control Register + * Bit Mapping: ADC_POWER SPEED1 SPEED0 ADC_FLAG ADC_START CHS2 CHS1 CHS0 + * Reset Value: 0000,0000 + */ +SFR(ADC_CONTR, 0xBC); + +/* ADC Converting Result Registers */ +SFR(ADC_RES, 0xBD); /* Higher Bits */ +SFR(ADC_RESL, 0xBE); /* Lower Bits */ + +/* + * SPI Control Register + * Bit Mapping: SSIG SPEN DORD MSTR CPOL CPHA SPR1 SPR0 + * Reset Value: 0000,0100 + */ +SFR(SPCTL, 0xCE); + +/* + * SPI Status Register + * Bit Mapping: SPIF WCOL - - - - - - + * Reset Value: 00xx,xxxx + */ +SFR(SPSTAT, 0xCD); + +/* SPI Data Register */ +SFR(SPDAT, 0xCF); + +/* In-Application-Programming Data Register */ +SFR(IAP_DATA, 0xC2); + +/* In-Application-Programming Address Registers */ +SFR(IAP_ADDRH, 0xC3); /* Higher 8 bits */ +SFR(IAP_ADDRL, 0xC4); /* Lower 8 bits */ + +/* + * In-Application-Programming Address Registers + * Bit Mapping: - - - - - - MS1 MS0 + * Reset Value: xxxx,xx00 + */ +SFR(IAP_CMD, 0xC5); + +/* In-Application-Programming Trigger Registers */ +SFR(IAP_TRIG, 0xC6); + +/* + * In-Application-Programming Control Register + * Bit Mapping: IAPEN SWBS SWRST CFAIL - WT2 WT1 WT0 + * Reset Value: 0000,x000 + */ +SFR(IAP_CONTR, 0xC7); + +#endif /* _STC12_H_ */ + diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/uPSD32xx.h sdcc-3.2.0+dfsg/device/include/mcs51/uPSD32xx.h --- sdcc-3.1.0+dfsg/device/include/mcs51/uPSD32xx.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/uPSD32xx.h 2012-03-13 10:17:10.000000000 +0000 @@ -9,7 +9,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/uPSD33xx.h sdcc-3.2.0+dfsg/device/include/mcs51/uPSD33xx.h --- sdcc-3.1.0+dfsg/device/include/mcs51/uPSD33xx.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/uPSD33xx.h 2012-03-13 10:17:10.000000000 +0000 @@ -7,7 +7,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/mcs51/w7100.h sdcc-3.2.0+dfsg/device/include/mcs51/w7100.h --- sdcc-3.1.0+dfsg/device/include/mcs51/w7100.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/mcs51/w7100.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic14/errno.h sdcc-3.2.0+dfsg/device/include/pic14/errno.h --- sdcc-3.1.0+dfsg/device/include/pic14/errno.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic14/errno.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic14/float.h sdcc-3.2.0+dfsg/device/include/pic14/float.h --- sdcc-3.1.0+dfsg/device/include/pic14/float.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic14/float.h 2012-03-13 10:17:10.000000000 +0000 @@ -7,7 +7,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic14/limits.h sdcc-3.2.0+dfsg/device/include/pic14/limits.h --- sdcc-3.1.0+dfsg/device/include/pic14/limits.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic14/limits.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -35,7 +35,7 @@ #define SCHAR_MIN -128 #define UCHAR_MAX 0xff #define UCHAR_MIN 0 -#ifdef SDCC_CHAR_UNSIGNED +#ifdef __SDCC_CHAR_UNSIGNED #define CHAR_MAX UCHAR_MAX #define CHAR_MIN UCHAR_MIN #else diff -Nru sdcc-3.1.0+dfsg/device/include/pic14/math.h sdcc-3.2.0+dfsg/device/include/pic14/math.h --- sdcc-3.1.0+dfsg/device/include/pic14/math.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic14/math.h 2012-03-13 10:17:10.000000000 +0000 @@ -7,7 +7,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic14/p16f_common.inc sdcc-3.2.0+dfsg/device/include/pic14/p16f_common.inc --- sdcc-3.1.0+dfsg/device/include/pic14/p16f_common.inc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic14/p16f_common.inc 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic14/pic14devices.txt sdcc-3.2.0+dfsg/device/include/pic14/pic14devices.txt --- sdcc-3.1.0+dfsg/device/include/pic14/pic14devices.txt 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic14/pic14devices.txt 2012-06-18 07:51:00.000000000 +0000 @@ -6,7 +6,7 @@ # # This library 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.1, or (at your option) any +# Free Software Foundation; either version 2, or (at your option) any # later version. # # This library is distributed in the hope that it will be useful, @@ -298,6 +298,32 @@ memmap 0x0070 0x007f 0x080 memmap 0x00a0 0x00bf 0x000 +processor 16f720,16lf720 + program 2K + data 128 + eeprom 0 + io 18 + maxram 0x0ff + bankmsk 0x180 + config 0x2007 0x2008 + regmap 0x180 0x00 0x02 0x03 0x04 0x0a 0x0b + regmap 0x100 0x01 0x81 + memmap 0x0020 0x006f 0x000 + memmap 0x0070 0x007f 0x180 + +processor 16f721,16lf721 + program 4K + data 256 + eeprom 0 + io 18 + maxram 0x17f + bankmsk 0x180 + config 0x2007 0x2008 + regmap 0x180 0x00 0x02 0x03 0x04 0x0a 0x0b + regmap 0x100 0x01 0x81 + memmap 0x0020 0x006f 0x000 + memmap 0x0070 0x007f 0x180 + processor 16f737 program 4K data 368 @@ -462,6 +488,50 @@ memmap 0x0110 0x016f 0x000 memmap 0x0190 0x01ef 0x000 +processor 16f882 + program 2K + data 128 + eeprom 128 + io 24 + maxram 0x1ff + bankmsk 0x180 + config 0x2007 0x2008 + regmap 0x180 0x00 0x02 0x03 0x04 0x0a 0x0b + regmap 0x100 0x01 0x81 0x06 0x86 + memmap 0x0020 0x006f 0x000 + memmap 0x0070 0x007f 0x180 + memmap 0x00a0 0x00bf 0x000 + +processor 16f883 + program 4K + data 256 + eeprom 256 + io 24 + maxram 0x1ff + bankmsk 0x180 + config 0x2007 0x2008 + regmap 0x180 0x00 0x02 0x03 0x04 0x0a 0x0b + regmap 0x100 0x01 0x81 0x06 0x86 + memmap 0x0020 0x006f 0x000 + memmap 0x0070 0x007f 0x180 + memmap 0x00a0 0x00ef 0x000 + memmap 0x0120 0x016f 0x000 + +processor 16f884 + program 4K + data 256 + eeprom 256 + io 35 + maxram 0x1ff + bankmsk 0x180 + config 0x2007 0x2008 + regmap 0x180 0x00 0x02 0x03 0x04 0x0a 0x0b + regmap 0x100 0x01 0x81 0x06 0x86 + memmap 0x0020 0x006f 0x000 + memmap 0x0070 0x007f 0x180 + memmap 0x00a0 0x00ef 0x000 + memmap 0x0120 0x016f 0x000 + processor 16f886 program 8K data 368 @@ -1060,10 +1130,10 @@ # processor 16f1455, 16lf1455 - program 0 - data 0 + program 8K + data 512 eeprom 0 - io 0 + io 12 enhanced 1 maxram 0x07f bankmsk 0xf80 @@ -1073,10 +1143,10 @@ memmap 0x70 0x7f 0xf80 processor 16f1458, 16lf1458 - program 0 - data 0 + program 4K + data 512 eeprom 0 - io 0 + io 18 enhanced 1 maxram 0x07f bankmsk 0xf80 @@ -1086,10 +1156,10 @@ memmap 0x70 0x7f 0xf80 processor 16f1459, 16lf1459 - program 0 - data 0 + program 8K + data 1024 eeprom 0 - io 0 + io 18 enhanced 1 maxram 0x07f bankmsk 0xf80 @@ -1098,11 +1168,50 @@ memmap 0x20 0x6f 0x000 memmap 0x70 0x7f 0xf80 -processor 16f1507 +processor 16f1503, 16lf1503 program 2K data 128 eeprom 0 enhanced 1 + io 12 + maxram 0x07f + bankmsk 0xf80 + config 0x8007 0x8008 + regmap 0xf80 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b + memmap 0x20 0x6f 0x000 + memmap 0x70 0x7f 0xf80 + +processor 16f1507, 16lf1507 + program 2K + data 128 + eeprom 0 + enhanced 1 + io 18 + maxram 0x07f + bankmsk 0xf80 + config 0x8007 0x8008 + regmap 0xf80 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b + memmap 0x20 0x6f 0x000 + memmap 0x70 0x7f 0xf80 + +processor 16f1508, 16lf1508 + program 4K + data 256 + eeprom 0 + enhanced 1 + io 18 + maxram 0x07f + bankmsk 0xf80 + config 0x8007 0x8008 + regmap 0xf80 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b + memmap 0x20 0x6f 0x000 + memmap 0x70 0x7f 0xf80 + +processor 16f1509, 16lf1509 + program 8K + data 512 + eeprom 0 + enhanced 1 io 18 maxram 0x07f bankmsk 0xf80 @@ -1111,6 +1220,84 @@ memmap 0x20 0x6f 0x000 memmap 0x70 0x7f 0xf80 +processor 16f1516, 16lf1516 + program 8K + data 512 + eeprom 0 + enhanced 1 + io 25 + maxram 0x07f + bankmsk 0xf80 + config 0x8007 0x8008 + regmap 0xf80 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b + memmap 0x20 0x6f 0x000 + memmap 0x70 0x7f 0xf80 + +processor 16f1517, 16lf1517 + program 8K + data 512 + eeprom 0 + enhanced 1 + io 36 + maxram 0x07f + bankmsk 0xf80 + config 0x8007 0x8008 + regmap 0xf80 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b + memmap 0x20 0x6f 0x000 + memmap 0x70 0x7f 0xf80 + +processor 16f1518, 16lf1518 + program 16K + data 1024 + eeprom 0 + enhanced 1 + io 25 + maxram 0x07f + bankmsk 0xf80 + config 0x8007 0x8008 + regmap 0xf80 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b + memmap 0x20 0x6f 0x000 + memmap 0x70 0x7f 0xf80 + +processor 16f1519, 16lf1519 + program 16K + data 1024 + eeprom 0 + enhanced 1 + io 36 + maxram 0x07f + bankmsk 0xf80 + config 0x8007 0x8008 + regmap 0xf80 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b + memmap 0x20 0x6f 0x000 + memmap 0x70 0x7f 0xf80 + +processor 16f1526, 16lf1526 + program 8K + data 768 + eeprom 0 + enhanced 1 + io 55 + maxram 0x07f + bankmsk 0xf80 + config 0x8007 0x8008 + regmap 0xf80 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b + memmap 0x20 0x6f 0x000 + memmap 0x70 0x7f 0xf80 + +processor 16f1527, 16lf1527 + program 16K + data 1536 + eeprom 0 + enhanced 1 + io 55 + maxram 0x07f + bankmsk 0xf80 + config 0x8007 0x8008 + regmap 0xf80 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b + memmap 0x20 0x6f 0x000 + memmap 0x70 0x7f 0xf80 + processor 16f1782, 16lf1782 program 2K data 256 @@ -1138,7 +1325,7 @@ memmap 0x70 0x7f 0xf80 # PICxxF182x family -processor 12f1822 +processor 12f1822, 12lf1822 program 2K data 128 eeprom 256 @@ -1151,7 +1338,7 @@ memmap 0x20 0x6f 0x000 memmap 0x70 0x7f 0xf80 -processor 16f1823 +processor 16f1823, 16lf1823 program 2K data 128 eeprom 256 @@ -1164,7 +1351,7 @@ memmap 0x20 0x6f 0x000 memmap 0x70 0x7f 0xf80 -processor 16f1824 +processor 16f1824, 16lf1824 program 4K data 256 eeprom 256 @@ -1177,7 +1364,7 @@ memmap 0x20 0x6f 0x000 memmap 0x70 0x7f 0xf80 -processor 16f1825 +processor 16f1825, 16lf1825 program 8K data 1024 eeprom 256 @@ -1190,7 +1377,7 @@ memmap 0x20 0x6f 0x000 memmap 0x70 0x7f 0xf80 -processor 16f1826 +processor 16f1826, 16lf1826 program 2K data 256 eeprom 256 @@ -1203,7 +1390,7 @@ memmap 0x20 0x6f 0x000 memmap 0x70 0x7f 0xf80 -processor 16f1827 +processor 16f1827, 16lf1827 program 4K data 384 eeprom 256 @@ -1216,7 +1403,7 @@ memmap 0x20 0x6f 0x000 memmap 0x70 0x7f 0xf80 -processor 16f1828 +processor 16f1828, 16lf1828 program 4K data 256 eeprom 256 @@ -1229,7 +1416,7 @@ memmap 0x20 0x6f 0x000 memmap 0x70 0x7f 0xf80 -processor 16f1829 +processor 16f1829, 16lf1829 program 8K data 1024 eeprom 256 @@ -1243,7 +1430,7 @@ memmap 0x70 0x7f 0xf80 # PICxxF184x family -processor 12f1840 +processor 12f1840, 12lf1840 program 4K data 256 eeprom 256 @@ -1256,7 +1443,7 @@ memmap 0x20 0x6f 0x000 memmap 0x70 0x7f 0xf80 -processor 16f1847 +processor 16f1847, 16lf1847 program 8K data 1024 eeprom 256 @@ -1336,7 +1523,7 @@ memmap 0x70 0x7f 0xf80 # PIC16F193x family -processor 16f1933 +processor 16f1933, 16lf1933 program 4K data 256 eeprom 256 @@ -1349,7 +1536,7 @@ memmap 0x20 0x6f 0x000 memmap 0x70 0x7f 0xf80 -processor 16f1934 +processor 16f1934, 16lf1934 program 4K data 256 eeprom 256 @@ -1362,7 +1549,7 @@ memmap 0x20 0x6f 0x000 memmap 0x70 0x7f 0xf80 -processor 16f1936 +processor 16f1936, 16lf1936 program 8K data 512 eeprom 256 @@ -1375,7 +1562,7 @@ memmap 0x20 0x6f 0x000 memmap 0x70 0x7f 0xf80 -processor 16f1937 +processor 16f1937, 16lf1937 program 8K data 512 eeprom 256 @@ -1388,7 +1575,7 @@ memmap 0x20 0x6f 0x000 memmap 0x70 0x7f 0xf80 -processor 16f1938 +processor 16f1938, 16lf1938 program 16K data 1024 eeprom 256 @@ -1401,7 +1588,7 @@ memmap 0x20 0x6f 0x000 memmap 0x70 0x7f 0xf80 -processor 16f1939 +processor 16f1939, 16lf1939 program 16K data 1024 eeprom 256 @@ -1413,3 +1600,29 @@ regmap 0xf80 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b memmap 0x20 0x6f 0x000 memmap 0x70 0x7f 0xf80 + +processor 16f1946, 16lf1946 + program 8K + data 512 + eeprom 256 + enhanced 1 + io 53 + maxram 0x07f + bankmsk 0xf80 + config 0x8007 0x8008 + regmap 0xf80 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b + memmap 0x20 0x6f 0x000 + memmap 0x70 0x7f 0xf80 + +processor 16f1947, 16lf1947 + program 16K + data 1024 + eeprom 256 + enhanced 1 + io 53 + maxram 0x07f + bankmsk 0xf80 + config 0x8007 0x8008 + regmap 0xf80 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b + memmap 0x20 0x6f 0x000 + memmap 0x70 0x7f 0xf80 diff -Nru sdcc-3.1.0+dfsg/device/include/pic14/sdcc-lib.h sdcc-3.2.0+dfsg/device/include/pic14/sdcc-lib.h --- sdcc-3.1.0+dfsg/device/include/pic14/sdcc-lib.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic14/sdcc-lib.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/adc.h sdcc-3.2.0+dfsg/device/include/pic16/adc.h --- sdcc-3.1.0+dfsg/device/include/pic16/adc.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/adc.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -171,37 +171,37 @@ * 18f65j50-style devices multiplex ANCONx and ADCONx * * ADCON0: - * bit 18f242 18f1220 18f13k50 18f2220 18f24j50 18f65j50 18f23k22 - * 0 ADON ADON ADON ADON ADON ADON ADON - * 1 - GO GO GO GO GO GO - * 2 GO CHS0 CHS0 CHS0 CHS0 CHS0 CHS0 - * 3 CHS0 CHS1 CHS1 CHS1 CHS1 CHS1 CHS1 - * 4 CHS1 CHS2 CHS2 CHS2 CHS2 CHS2 CHS2 - * 5 CHS2 - CHS3 CHS3 CHS3 CHS3 CHS3 - * 6 ADCS0 VCFG0 - - VCFG0 VCFG0 CHS4 - * 7 ADCS1 VCFG1 - (ADCAL) VCFG1 VCFG1 - + * bit 18f242 18f1220 18f1230 18f13k50 18f2220 18f24j50 18f65j50 18f23k22 + * 0 ADON ADON ADON ADON ADON ADON ADON ADON + * 1 - GO GO GO GO GO GO GO + * 2 GO CHS0 CHS0 CHS0 CHS0 CHS0 CHS0 CHS0 + * 3 CHS0 CHS1 CHS1 CHS1 CHS1 CHS1 CHS1 CHS1 + * 4 CHS1 CHS2 - CHS2 CHS2 CHS2 CHS2 CHS2 + * 5 CHS2 - - CHS3 CHS3 CHS3 CHS3 CHS3 + * 6 ADCS0 VCFG0 - - - VCFG0 VCFG0 CHS4 + * 7 ADCS1 VCFG1 SEVTEN - (ADCAL) VCFG1 VCFG1 - * * ADCON1: - * bit 18f242 18f1220 18f13k50 18f2220 18f24j50 18f65j50 18f23k22 - * 0 PCFG0 PCFG0 NVCFG0 PCFG0 ADCS0 ADCS0 NVCFG0 - * 1 PCFG1 PCFG1 NVCFG1 PCFG1 ADCS1 ADCS1 NVCFG1 - * 2 PCFG2 PCFG2 PVCFG0 PCFG2 ADCS2 ADCS2 PVCFG0 - * 3 PCFG3 PCFG3 PVCFG1 PCFG3 ACQT0 ACQT0 PVCFG1 - * 4 - PCFG4 - VCFG0 ACQT1 ACQT1 - - * 5 - PCFG5 - VCFG1 ACQT2 ACQT2 - - * 6 ADCS2 PCFG6 - - ADCAL ADCAL - - * 7 ADFM - - - ADFM ADFM TRIGSEL + * bit 18f242 18f1220 18f1230 18f13k50 18f2220 18f24j50 18f65j50 18f23k22 + * 0 PCFG0 PCFG0 PCFG0 NVCFG0 PCFG0 ADCS0 ADCS0 NVCFG0 + * 1 PCFG1 PCFG1 PCFG1 NVCFG1 PCFG1 ADCS1 ADCS1 NVCFG1 + * 2 PCFG2 PCFG2 PCFG2 PVCFG0 PCFG2 ADCS2 ADCS2 PVCFG0 + * 3 PCFG3 PCFG3 PCFG3 PVCFG1 PCFG3 ACQT0 ACQT0 PVCFG1 + * 4 - PCFG4 VCFG0 - VCFG0 ACQT1 ACQT1 - + * 5 - PCFG5 - VCFG1 ACQT2 ACQT2 - + * 6 ADCS2 PCFG6 - - ADCAL ADCAL - + * 7 ADFM - - - ADFM ADFM TRIGSEL * * ADCON2: - * bit 18f242 18f1220 18f13k50 18f2220 18f24j50 18f65j50 18f23k22 - * 0 ADCS0 ADCS0 ADCS0 - * 1 ADCS1 ADCS1 ADCS1 - * 2 ADCS2 ADCS2 ADCS2 - * 3 ACQT0 ADQT0 ACQT0 - * 4 ACQT1 ADQT1 ACQT1 - * 5 ACQT2 ADQT2 ACQT2 - * 6 - - - - * 7 ADFM ADFM ADFM + * bit 18f242 18f1220 18f1230 18f13k50 18f2220 18f24j50 18f65j50 18f23k22 + * 0 ADCS0 ADCS0 ADCS0 ADCS0 + * 1 ADCS1 ADCS1 ADCS1 ADCS1 + * 2 ADCS2 ADCS2 ADCS2 ADCS2 + * 3 ACQT0 ACQT0 ADQT0 ACQT0 + * 4 ACQT1 ACQT1 ADQT1 ACQT1 + * 5 ACQT2 ACQT2 ADQT2 ACQT2 + * 6 - - - - + * 7 ADFM ADFM ADFM ADFM */ #include "pic18fam.h" @@ -251,6 +251,28 @@ #define ADC_CFG_1A 0x3e #define ADC_CFG_0A 0x3f +#elif (__SDCC_ADC_STYLE == 1812300) + +/* + * These devices use a bitmask in ADCON1 to configure AN0..AN3 + * as digital ports (bit set) or analog input (bit clear). + * + * These settings are selected based on their similarity with + * the 2220-style settings; 1230-style is more flexible, though. + * + * Reference voltages are configured via adc_open's config parameter + * using ADC_VCFG_*. + */ + +#define ADC_CFG_4A 0x00 +#define ADC_CFG_3A 0x08 +#define ADC_CFG_2A 0x0c +#define ADC_CFG_1A 0x0e +#define ADC_CFG_0A 0x0f + +#define ADC_VCFG_AVDD 0x00 /* AVdd */ +#define ADC_VCFG_VREF 0x10 /* Vref+ */ + #elif (__SDCC_ADC_STYLE == 1813502) /* diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/ctype.h sdcc-3.2.0+dfsg/device/include/pic16/ctype.h --- sdcc-3.1.0+dfsg/device/include/pic16/ctype.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/ctype.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/delay.h sdcc-3.2.0+dfsg/device/include/pic16/delay.h --- sdcc-3.1.0+dfsg/device/include/pic16/delay.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/delay.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/errno.h sdcc-3.2.0+dfsg/device/include/pic16/errno.h --- sdcc-3.1.0+dfsg/device/include/pic16/errno.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/errno.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/float.h sdcc-3.2.0+dfsg/device/include/pic16/float.h --- sdcc-3.1.0+dfsg/device/include/pic16/float.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/float.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/gstack.h sdcc-3.2.0+dfsg/device/include/pic16/gstack.h --- sdcc-3.1.0+dfsg/device/include/pic16/gstack.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/gstack.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/i2c.h sdcc-3.2.0+dfsg/device/include/pic16/i2c.h --- sdcc-3.1.0+dfsg/device/include/pic16/i2c.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/i2c.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/limits.h sdcc-3.2.0+dfsg/device/include/pic16/limits.h --- sdcc-3.1.0+dfsg/device/include/pic16/limits.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/limits.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/malloc.h sdcc-3.2.0+dfsg/device/include/pic16/malloc.h --- sdcc-3.1.0+dfsg/device/include/pic16/malloc.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/malloc.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/math.h sdcc-3.2.0+dfsg/device/include/pic16/math.h --- sdcc-3.1.0+dfsg/device/include/pic16/math.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/math.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/p18fxxx.inc sdcc-3.2.0+dfsg/device/include/pic16/p18fxxx.inc --- sdcc-3.1.0+dfsg/device/include/pic16/p18fxxx.inc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/p18fxxx.inc 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/pic16devices.txt sdcc-3.2.0+dfsg/device/include/pic16/pic16devices.txt --- sdcc-3.1.0+dfsg/device/include/pic16/pic16devices.txt 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/pic16devices.txt 2012-03-13 16:39:53.000000000 +0000 @@ -6,7 +6,7 @@ # # This library 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.1, or (at your option) any +# Free Software Foundation; either version 2, or (at your option) any # later version. # # This library is distributed in the hope that it will be useful, @@ -74,10 +74,33 @@ idlocrange 0x200000 0x200007 +name 18f1230 +ramsize 256 +split 0x80 +configrange 0x300001 0x30000d +configword 0x300001 0xcf 0x73 +configword 0x300002 0x1f 0xff +configword 0x300003 0x1f 0xff +configword 0x300004 0x0e 0xff +configword 0x300005 0x89 0xf7 +configword 0x300006 0xf1 0x8f +configword 0x300008 0x03 0xff +configword 0x300009 0xc0 0xff +configword 0x30000a 0x03 0xff +configword 0x30000b 0xe0 0xff +configword 0x30000c 0x03 0xff +configword 0x30000d 0x40 0xff +idlocrange 0x200000 0x200007 + + name 18f1320 using 18f1220 +name 18f1330 +using 18f1230 + + name 18f13k50 ramsize 512 split 0x60 diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/pic18fregs.h sdcc-3.2.0+dfsg/device/include/pic16/pic18fregs.h --- sdcc-3.1.0+dfsg/device/include/pic16/pic18fregs.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/pic18fregs.h 2012-06-03 17:48:05.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -29,373 +29,379 @@ #ifndef __PIC18FREGS_H__ #define __PIC18FREGS_H__ -#if defined(pic18f242) +#if defined(__SDCC_PIC18F242) # include -#elif defined(pic18f248) +#elif defined(__SDCC_PIC18F248) # include -#elif defined(pic18f252) +#elif defined(__SDCC_PIC18F252) # include -#elif defined(pic18f258) +#elif defined(__SDCC_PIC18F258) # include -#elif defined(pic18f442) +#elif defined(__SDCC_PIC18F442) # include -#elif defined(pic18f448) +#elif defined(__SDCC_PIC18F448) # include -#elif defined(pic18f452) +#elif defined(__SDCC_PIC18F452) # include -#elif defined(pic18f458) +#elif defined(__SDCC_PIC18F458) # include -#elif defined(pic18f1220) +#elif defined(__SDCC_PIC18F1220) # include -#elif defined(pic18f1320) +#elif defined(__SDCC_PIC18F1230) +# include + +#elif defined(__SDCC_PIC18F1320) # include -#elif defined(pic18f13k50) +#elif defined(__SDCC_PIC18F1330) +# include + +#elif defined(__SDCC_PIC18F13K50) # include -#elif defined(pic18f14k50) +#elif defined(__SDCC_PIC18F14K50) # include -#elif defined(pic18f2220) +#elif defined(__SDCC_PIC18F2220) # include -#elif defined(pic18f2221) +#elif defined(__SDCC_PIC18F2221) # include -#elif defined(pic18f2320) +#elif defined(__SDCC_PIC18F2320) # include -#elif defined(pic18f2321) +#elif defined(__SDCC_PIC18F2321) # include -#elif defined(pic18f2331) +#elif defined(__SDCC_PIC18F2331) # include -#elif defined(pic18f23k20) +#elif defined(__SDCC_PIC18F23K20) # include -#elif defined(pic18f23k22) +#elif defined(__SDCC_PIC18F23K22) # include -#elif defined(pic18f2410) +#elif defined(__SDCC_PIC18F2410) # include -#elif defined(pic18f2420) +#elif defined(__SDCC_PIC18F2420) # include -#elif defined(pic18f2423) +#elif defined(__SDCC_PIC18F2423) # include -#elif defined(pic18f2431) +#elif defined(__SDCC_PIC18F2431) # include -#elif defined(pic18f2450) +#elif defined(__SDCC_PIC18F2450) # include -#elif defined(pic18f2455) +#elif defined(__SDCC_PIC18F2455) # include -#elif defined(pic18f2480) +#elif defined(__SDCC_PIC18F2480) # include -#elif defined(pic18f24j10) +#elif defined(__SDCC_PIC18F24J10) # include -#elif defined(pic18f24j50) +#elif defined(__SDCC_PIC18F24J50) # include -#elif defined(pic18f24k20) +#elif defined(__SDCC_PIC18F24K20) # include -#elif defined(pic18f24k22) +#elif defined(__SDCC_PIC18F24K22) # include -#elif defined(pic18f2510) +#elif defined(__SDCC_PIC18F2510) # include -#elif defined(pic18f2515) +#elif defined(__SDCC_PIC18F2515) # include -#elif defined(pic18f2520) +#elif defined(__SDCC_PIC18F2520) # include -#elif defined(pic18f2523) +#elif defined(__SDCC_PIC18F2523) # include -#elif defined(pic18f2525) +#elif defined(__SDCC_PIC18F2525) # include -#elif defined(pic18f2550) +#elif defined(__SDCC_PIC18F2550) # include -#elif defined(pic18f2580) +#elif defined(__SDCC_PIC18F2580) # include -#elif defined(pic18f2585) +#elif defined(__SDCC_PIC18F2585) # include -#elif defined(pic18f25j10) +#elif defined(__SDCC_PIC18F25J10) # include -#elif defined(pic18f25j50) +#elif defined(__SDCC_PIC18F25J50) # include -#elif defined(pic18f25k20) +#elif defined(__SDCC_PIC18F25K20) # include -#elif defined(pic18f25k22) +#elif defined(__SDCC_PIC18F25K22) # include -#elif defined(pic18f2610) +#elif defined(__SDCC_PIC18F2610) # include -#elif defined(pic18f2620) +#elif defined(__SDCC_PIC18F2620) # include -#elif defined(pic18f2680) +#elif defined(__SDCC_PIC18F2680) # include -#elif defined(pic18f2682) +#elif defined(__SDCC_PIC18F2682) # include -#elif defined(pic18f2685) +#elif defined(__SDCC_PIC18F2685) # include -#elif defined(pic18f26j50) +#elif defined(__SDCC_PIC18F26J50) # include -#elif defined(pic18f26k20) +#elif defined(__SDCC_PIC18F26K20) # include -#elif defined(pic18f26k22) +#elif defined(__SDCC_PIC18F26K22) # include -#elif defined(pic18f4220) +#elif defined(__SDCC_PIC18F4220) # include -#elif defined(pic18f4221) +#elif defined(__SDCC_PIC18F4221) # include -#elif defined(pic18f4320) +#elif defined(__SDCC_PIC18F4320) # include -#elif defined(pic18f4321) +#elif defined(__SDCC_PIC18F4321) # include -#elif defined(pic18f4331) +#elif defined(__SDCC_PIC18F4331) # include -#elif defined(pic18f43k20) +#elif defined(__SDCC_PIC18F43K20) # include -#elif defined(pic18f43k22) +#elif defined(__SDCC_PIC18F43K22) # include -#elif defined(pic18f4410) +#elif defined(__SDCC_PIC18F4410) # include -#elif defined(pic18f4420) +#elif defined(__SDCC_PIC18F4420) # include -#elif defined(pic18f4423) +#elif defined(__SDCC_PIC18F4423) # include -#elif defined(pic18f4431) +#elif defined(__SDCC_PIC18F4431) # include -#elif defined(pic18f4450) +#elif defined(__SDCC_PIC18F4450) # include -#elif defined(pic18f4455) +#elif defined(__SDCC_PIC18F4455) # include -#elif defined(pic18f4480) +#elif defined(__SDCC_PIC18F4480) # include -#elif defined(pic18f44j10) +#elif defined(__SDCC_PIC18F44J10) # include -#elif defined(pic18f44j50) +#elif defined(__SDCC_PIC18F44J50) # include -#elif defined(pic18f44k20) +#elif defined(__SDCC_PIC18F44K20) # include -#elif defined(pic18f44k22) +#elif defined(__SDCC_PIC18F44K22) # include -#elif defined(pic18f4510) +#elif defined(__SDCC_PIC18F4510) # include -#elif defined(pic18f4515) +#elif defined(__SDCC_PIC18F4515) # include -#elif defined(pic18f4520) +#elif defined(__SDCC_PIC18F4520) # include -#elif defined(pic18f4523) +#elif defined(__SDCC_PIC18F4523) # include -#elif defined(pic18f4525) +#elif defined(__SDCC_PIC18F4525) # include -#elif defined(pic18f4550) +#elif defined(__SDCC_PIC18F4550) # include -#elif defined(pic18f4580) +#elif defined(__SDCC_PIC18F4580) # include -#elif defined(pic18f4585) +#elif defined(__SDCC_PIC18F4585) # include -#elif defined(pic18f45j10) +#elif defined(__SDCC_PIC18F45J10) # include -#elif defined(pic18f45j50) +#elif defined(__SDCC_PIC18F45J50) # include -#elif defined(pic18f45k20) +#elif defined(__SDCC_PIC18F45K20) # include -#elif defined(pic18f45k22) +#elif defined(__SDCC_PIC18F45K22) # include -#elif defined(pic18f4610) +#elif defined(__SDCC_PIC18F4610) # include -#elif defined(pic18f4620) +#elif defined(__SDCC_PIC18F4620) # include -#elif defined(pic18f4680) +#elif defined(__SDCC_PIC18F4680) # include -#elif defined(pic18f4682) +#elif defined(__SDCC_PIC18F4682) # include -#elif defined(pic18f4685) +#elif defined(__SDCC_PIC18F4685) # include -#elif defined(pic18f46j50) +#elif defined(__SDCC_PIC18F46J50) # include -#elif defined(pic18f46k20) +#elif defined(__SDCC_PIC18F46K20) # include -#elif defined(pic18f46k22) +#elif defined(__SDCC_PIC18F46K22) # include -#elif defined(pic18f6520) +#elif defined(__SDCC_PIC18F6520) # include -#elif defined(pic18f6527) +#elif defined(__SDCC_PIC18F6527) # include -#elif defined(pic18f6585) +#elif defined(__SDCC_PIC18F6585) # include -#elif defined(pic18f65j50) +#elif defined(__SDCC_PIC18F65J50) # include -#elif defined(pic18f6620) +#elif defined(__SDCC_PIC18F6620) # include -#elif defined(pic18f6622) +#elif defined(__SDCC_PIC18F6622) # include -#elif defined(pic18f6627) +#elif defined(__SDCC_PIC18F6627) # include -#elif defined(pic18f6680) +#elif defined(__SDCC_PIC18F6680) # include -#elif defined(pic18f66j50) +#elif defined(__SDCC_PIC18F66J50) # include -#elif defined(pic18f66j55) +#elif defined(__SDCC_PIC18F66J55) # include -#elif defined(pic18f66j60) +#elif defined(__SDCC_PIC18F66J60) # include -#elif defined(pic18f66j65) +#elif defined(__SDCC_PIC18F66J65) # include -#elif defined(pic18f6720) +#elif defined(__SDCC_PIC18F6720) # include -#elif defined(pic18f6722) +#elif defined(__SDCC_PIC18F6722) # include -#elif defined(pic18f67j50) +#elif defined(__SDCC_PIC18F67J50) # include -#elif defined(pic18f67j60) +#elif defined(__SDCC_PIC18F67J60) # include -#elif defined(pic18f8520) +#elif defined(__SDCC_PIC18F8520) # include -#elif defined(pic18f8527) +#elif defined(__SDCC_PIC18F8527) # include -#elif defined(pic18f8585) +#elif defined(__SDCC_PIC18F8585) # include -#elif defined(pic18f85j50) +#elif defined(__SDCC_PIC18F85J50) # include -#elif defined(pic18f8620) +#elif defined(__SDCC_PIC18F8620) # include -#elif defined(pic18f8622) +#elif defined(__SDCC_PIC18F8622) # include -#elif defined(pic18f8627) +#elif defined(__SDCC_PIC18F8627) # include -#elif defined(pic18f8680) +#elif defined(__SDCC_PIC18F8680) # include -#elif defined(pic18f86j50) +#elif defined(__SDCC_PIC18F86J50) # include -#elif defined(pic18f86j55) +#elif defined(__SDCC_PIC18F86J55) # include -#elif defined(pic18f86j60) +#elif defined(__SDCC_PIC18F86J60) # include -#elif defined(pic18f86j65) +#elif defined(__SDCC_PIC18F86J65) # include -#elif defined(pic18f8720) +#elif defined(__SDCC_PIC18F8720) # include -#elif defined(pic18f8722) +#elif defined(__SDCC_PIC18F8722) # include -#elif defined(pic18f87j50) +#elif defined(__SDCC_PIC18F87J50) # include -#elif defined(pic18f87j60) +#elif defined(__SDCC_PIC18F87J60) # include -#elif defined(pic18f96j60) +#elif defined(__SDCC_PIC18F96J60) # include -#elif defined(pic18f96j65) +#elif defined(__SDCC_PIC18F96J65) # include -#elif defined(pic18f97j60) +#elif defined(__SDCC_PIC18F97J60) # include diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/sdcc-lib.h sdcc-3.2.0+dfsg/device/include/pic16/sdcc-lib.h --- sdcc-3.1.0+dfsg/device/include/pic16/sdcc-lib.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/sdcc-lib.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/signal.h sdcc-3.2.0+dfsg/device/include/pic16/signal.h --- sdcc-3.1.0+dfsg/device/include/pic16/signal.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/signal.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -116,7 +116,7 @@ * To be used together with DEF_INTHIGH and DEF_INTLOW. */ #define DEF_HANDLER(sig, handler) \ - __asm btfsc sig __endasm; \ + __asm btfsc sig, 0 __endasm; \ __asm goto _ ## handler __endasm; /* Declare handler to be the handler function for the given signal. @@ -127,9 +127,9 @@ * To be used together with DEF_INTHIGH and DEF_INTLOW. */ #define DEF_HANDLER2(sig1,sig2,handler) \ - __asm btfss sig1 __endasm; \ + __asm btfss sig1, 0 __endasm; \ __asm bra $+8 __endasm; \ - __asm btfsc sig2 __endasm; \ + __asm btfsc sig2, 0 __endasm; \ __asm goto _ ## handler __endasm; /* Declare or define an interrupt handler function. */ diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/stdarg.h sdcc-3.2.0+dfsg/device/include/pic16/stdarg.h --- sdcc-3.1.0+dfsg/device/include/pic16/stdarg.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/stdarg.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/stddef.h sdcc-3.2.0+dfsg/device/include/pic16/stddef.h --- sdcc-3.1.0+dfsg/device/include/pic16/stddef.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/stddef.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/stdint.h sdcc-3.2.0+dfsg/device/include/pic16/stdint.h --- sdcc-3.1.0+dfsg/device/include/pic16/stdint.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/stdint.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/stdio.h sdcc-3.2.0+dfsg/device/include/pic16/stdio.h --- sdcc-3.1.0+dfsg/device/include/pic16/stdio.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/stdio.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/stdlib.h sdcc-3.2.0+dfsg/device/include/pic16/stdlib.h --- sdcc-3.1.0+dfsg/device/include/pic16/stdlib.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/stdlib.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/string.h sdcc-3.2.0+dfsg/device/include/pic16/string.h --- sdcc-3.1.0+dfsg/device/include/pic16/string.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/string.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/pic16/usart.h sdcc-3.2.0+dfsg/device/include/pic16/usart.h --- sdcc-3.1.0+dfsg/device/include/pic16/usart.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/pic16/usart.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/sdcc-lib.h sdcc-3.2.0+dfsg/device/include/sdcc-lib.h --- sdcc-3.1.0+dfsg/device/include/sdcc-lib.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/sdcc-lib.h 2012-05-21 00:13:27.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -30,22 +30,25 @@ #ifndef __SDC51_SDCC_LIB_H #define __SDC51_SDCC_LIB_H 1 -#if defined(__z80) +#if defined(__SDCC_z80) #include -#elif defined(__z180) +#elif defined(__SDCC_z180) #include -#elif defined(__r2k) +#elif defined(__SDCC_r2k) #include -#elif defined(__gbz80) +#elif defined(__SDCC_r3ka) +#include + +#elif defined(__SDCC_gbz80) #include -#elif defined(__mcs51) +#elif defined(__SDCC_mcs51) #include -#elif defined(__ds390) +#elif defined(__SDCC_ds390) #include #else @@ -55,3 +58,4 @@ #endif #endif + diff -Nru sdcc-3.1.0+dfsg/device/include/setjmp.h sdcc-3.2.0+dfsg/device/include/setjmp.h --- sdcc-3.1.0+dfsg/device/include/setjmp.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/setjmp.h 2012-05-18 10:47:44.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -26,18 +26,18 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ -#ifndef SDCC_SETJMP_H -#define SDCC_SETJMP_H +#ifndef __SDCC_SETJMP_H +#define __SDCC_SETJMP_H #define SP_SIZE 1 -#ifdef SDCC_STACK_AUTO +#ifdef __SDCC_STACK_AUTO #define BP_SIZE SP_SIZE #else #define BP_SIZE 0 #endif -#ifdef SDCC_USE_XSTACK +#ifdef __SDCC_USE_XSTACK #define SPX_SIZE 1 #else #define SPX_SIZE 0 @@ -45,13 +45,13 @@ #define BPX_SIZE SPX_SIZE -#ifdef SDCC_MODEL_HUGE +#ifdef __SDCC_MODEL_HUGE #define RET_SIZE 3 #else #define RET_SIZE 2 #endif -#ifdef SDCC_z80 +#if defined (__SDCC_z80) || defined (__SDCC_z180) || defined (__SDCC_r2k) || defined (__SDCC_r3ka) typedef unsigned char jmp_buf[6]; // 2 for the stack pointer, 2 for the return address, 2 for the frame pointer. #else typedef unsigned char jmp_buf[RET_SIZE + SP_SIZE + BP_SIZE + SPX_SIZE + BPX_SIZE]; @@ -62,7 +62,9 @@ // C99 might require setjmp to be a macro. The standard seems self-contradicting on this issue. #define setjmp(jump_buf) __setjmp(jump_buf) -int longjmp(jmp_buf, int); +#ifndef __SDCC_HIDE_LONGJMP +_Noreturn void longjmp(jmp_buf, int); +#endif #undef RET_SIZE #undef SP_SIZE diff -Nru sdcc-3.1.0+dfsg/device/include/stdarg.h sdcc-3.2.0+dfsg/device/include/stdarg.h --- sdcc-3.1.0+dfsg/device/include/stdarg.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/stdarg.h 2012-05-18 16:31:18.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -30,19 +30,19 @@ #ifndef __SDC51_STDARG_H #define __SDC51_STDARG_H 1 -#if defined(__z80) || defined(__z180) || defined(__r2k) || defined(__gbz80) || defined(__hc08) +#if defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_r2k) || defined(__SDCC_r3ka) || defined(__SDCC_gbz80) || defined(__SDCC_hc08) || defined(__SDCC_s08) typedef unsigned char * va_list; #define va_start(marker, last) { marker = (va_list)&last + sizeof(last); } #define va_arg(marker, type) *((type *)((marker += sizeof(type)) - sizeof(type))) -#elif defined(__ds390) || defined(__ds400) +#elif defined(__SDCC_ds390) || defined(__SDCC_ds400) typedef unsigned char * va_list; #define va_start(marker, first) { marker = (va_list)&first; } #define va_arg(marker, type) *((type *)(marker -= sizeof(type))) -#elif defined(SDCC_USE_XSTACK) +#elif defined(__SDCC_USE_XSTACK) typedef unsigned char __pdata * va_list; #define va_start(marker, first) { marker = (va_list)&first; } @@ -60,3 +60,4 @@ #define va_end(marker) { marker = (va_list) 0; }; #endif + diff -Nru sdcc-3.1.0+dfsg/device/include/stdbool.h sdcc-3.2.0+dfsg/device/include/stdbool.h --- sdcc-3.1.0+dfsg/device/include/stdbool.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/stdbool.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -32,10 +32,9 @@ #define true 1 #define false 0 -#if defined (SDCC_ds390) || defined (SDCC_mcs51) || defined (SDCC_xa51) +#if defined (__SDCC_ds390) || defined (__SDCC_mcs51) || defined (__SDCC_xa51) /* The ports that have __bit and use it as an imperfect substitute for bool */ #define _Bool __bit - #define BOOL __bit #define bool _Bool #define __bool_true_false_are_defined 1 #define __SDCC_WEIRD_BOOL 1 diff -Nru sdcc-3.1.0+dfsg/device/include/stddef.h sdcc-3.2.0+dfsg/device/include/stddef.h --- sdcc-3.1.0+dfsg/device/include/stddef.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/stddef.h 2012-03-20 09:56:26.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -36,7 +36,7 @@ #ifndef __PTRDIFF_T_DEFINED #define __PTRDIFF_T_DEFINED -#if defined (SDCC_mcs51) || defined (SDCC_ds390) +#if defined (__SDCC_mcs51) || defined (__SDCC_ds390) typedef long int ptrdiff_t; #else typedef int ptrdiff_t; @@ -53,6 +53,22 @@ typedef char wchar_t; #endif +/* Bounds-checking interfaces from annex K of the C11 standard. */ +#if defined (__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ + +#ifndef __RSIZE_T_DEFINED +#define __RSIZE_T_DEFINED +typedef size_t rsize_t; +#endif + +#ifndef __ERRNO_T_DEFINED +#define __ERRNO_T_DEFINED +typedef int errno_t; +#endif + +#endif + #define offsetof(s, m) __builtin_offsetof (s, m) #endif + diff -Nru sdcc-3.1.0+dfsg/device/include/stdint.h sdcc-3.2.0+dfsg/device/include/stdint.h --- sdcc-3.1.0+dfsg/device/include/stdint.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/stdint.h 2012-04-02 12:21:45.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -32,7 +32,7 @@ /* Exact integral types. */ -#if defined (SDCC_z80) || defined (SDCC_z180) || defined (SDCC_r2k) || defined (SDCC_gbz80) +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_ds400) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) #if __STDC_VERSION__ >= 199901L #define __SDCC_LONGLONG #endif @@ -92,7 +92,7 @@ #endif /* Types for `void *' pointers. */ -#if defined (SDCC_mcs51) || defined (SDCC_ds390) +#if defined (__SDCC_mcs51) || defined (__SDCC_ds390) typedef long int intptr_t; typedef unsigned long int uintptr_t; #else @@ -102,9 +102,13 @@ /* Largest integral types. */ +#ifndef __SDCC_LONGLONG typedef long int intmax_t; typedef unsigned long int uintmax_t; - +#else +typedef long long int intmax_t; +typedef unsigned long long int uintmax_t; +#endif /* Limits of integral types. */ @@ -181,7 +185,7 @@ #endif /* Values to test for integral types holding `void *' pointer. */ -#if defined (SDCC_mcs51) || defined (SDCC_ds390) +#if defined (__SDCC_mcs51) || defined (__SDCC_ds390) #define INTPTR_MIN (-2147483647L-1) #define INTPTR_MAX (2147483647L) #define UINTPTR_MAX (4294967295UL) @@ -203,7 +207,7 @@ /* Limits of other integer types. */ /* Limits of `ptrdiff_t' type. */ -#if defined (SDCC_mcs51) || defined (SDCC_ds390) +#if defined (__SDCC_mcs51) || defined (__SDCC_ds390) #define PTRDIFF_MIN (-2147483647L-1) #define PTRDIFF_MAX (2147483647L) #else @@ -212,7 +216,7 @@ #endif /* Limit of `size_t' type. */ -#define SIZE_MAX (65535) +#define SIZE_MAX (65535u) /* Signed. */ #define INT8_C(c) c @@ -245,4 +249,10 @@ #define UINTMAX_C(c) c ## UL #endif +/* Bounds-checking interfaces from annex K of the C11 standard. */ +#if defined (__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ +#define RSIZE_MAX SIZE_MAX +#endif + #endif /* stdint.h */ + diff -Nru sdcc-3.1.0+dfsg/device/include/stdio.h sdcc-3.2.0+dfsg/device/include/stdio.h --- sdcc-3.1.0+dfsg/device/include/stdio.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/stdio.h 2012-03-20 09:56:26.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -46,6 +46,21 @@ typedef unsigned int size_t; #endif +/* Bounds-checking interfaces from annex K of the C11 standard. */ +#if defined (__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ + +#ifndef __RSIZE_T_DEFINED +#define __RSIZE_T_DEFINED +typedef size_t rsize_t; +#endif + +#ifndef __ERRNO_T_DEFINED +#define __ERRNO_T_DEFINED +typedef int errno_t; +#endif + +#endif + typedef void (*pfn_outputchar)(char c, void* p) _REENTRANT; extern int _print_format (pfn_outputchar pfn, void* pvoid, const char *format, va_list ap); @@ -58,7 +73,11 @@ extern int sprintf (char *, const char *, ...); extern int vsprintf (char *, const char *, va_list); extern int puts(const char *); + +#if __STDC_VERSION__ < 201112L extern char *gets(char *); +#endif + extern char getchar(void); extern void putchar(char); diff -Nru sdcc-3.1.0+dfsg/device/include/stdlib.h sdcc-3.2.0+dfsg/device/include/stdlib.h --- sdcc-3.1.0+dfsg/device/include/stdlib.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/stdlib.h 2012-03-20 09:56:26.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -52,4 +52,22 @@ int rand(void); void srand(unsigned int seed); + +/* Bounds-checking interfaces from annex K of the C11 standard. */ +#if defined (__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ + +#ifndef __RSIZE_T_DEFINED +#define __RSIZE_T_DEFINED +typedef size_t rsize_t; +#endif + +#ifndef __ERRNO_T_DEFINED +#define __ERRNO_T_DEFINED +typedef int errno_t; +#endif + +typedef void (*constraint_handler_t)(const char *restrict msg, void *restrict ptr, errno_t error); + +#endif + #endif diff -Nru sdcc-3.1.0+dfsg/device/include/stdnoreturn.h sdcc-3.2.0+dfsg/device/include/stdnoreturn.h --- sdcc-3.1.0+dfsg/device/include/stdnoreturn.h 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/stdnoreturn.h 2011-12-22 16:08:37.000000000 +0000 @@ -0,0 +1,7 @@ +#ifndef __SDC51_STDNORETURN_H +#define __SDC51_STDNORETURN_H 1 + +#define noreturn _Noreturn + +#endif + diff -Nru sdcc-3.1.0+dfsg/device/include/string.h sdcc-3.2.0+dfsg/device/include/string.h --- sdcc-3.1.0+dfsg/device/include/string.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/string.h 2012-05-18 10:47:44.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -39,7 +39,22 @@ typedef unsigned int size_t; #endif -#if !defined(SDCC_z80) && !defined(SDCC_z180) && !defined(SDCC_gbz80) +/* Bounds-checking interfaces from annex K of the C11 standard. */ +#if defined (__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ + +#ifndef __RSIZE_T_DEFINED +#define __RSIZE_T_DEFINED +typedef size_t rsize_t; +#endif + +#ifndef __ERRNO_T_DEFINED +#define __ERRNO_T_DEFINED +typedef int errno_t; +#endif + +#endif + +#if defined(__SDCC_mcs51) || defined(__SDCC_hc08) || defined(__SDCC_ds390) || defined(__SDCC_pic14) || defined(__SDCC_pic16) #define __SDCC_BROKEN_STRING_FUNCTIONS #endif @@ -50,7 +65,7 @@ /* Copying functions: */ extern void *memcpy (void * /*restrict */ dest, const void * /*restrict*/ src, size_t n); extern void *memmove (void *dest, const void *src, size_t n); -extern char *strcpy (char * /*restrit*/ dest, const char * /*restrict*/ src); +extern char *strcpy (char * /*restrict*/ dest, const char * /*restrict*/ src); extern char *strncpy(char * /*restrict*/ dest, const char * /*restrict*/ src, size_t n); /* Concatenation functions: */ @@ -93,11 +108,11 @@ /* extern char *strerror(int errnum); */ extern size_t strlen (const char *s); -#ifdef SDCC_ds390 +#ifdef __SDCC_ds390 extern void __xdata * memcpyx(void __xdata *, void __xdata *, int) __naked; #endif -#if defined(SDCC_z80) || defined(SDCC_z180) || defined(SDCC_r2k) +#if defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_r2k) || defined(__SDCC_r3ka) #define memcpy(dst, src, n) __builtin_memcpy(dst, src, n) #define memset(dst, c, n) __builtin_memset(dst, c, n) #endif diff -Nru sdcc-3.1.0+dfsg/device/include/time.h sdcc-3.2.0+dfsg/device/include/time.h --- sdcc-3.1.0+dfsg/device/include/time.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/time.h 2012-03-20 09:56:26.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -33,6 +33,21 @@ #define __TIME_UNSIGNED 1 #endif +/* Bounds-checking interfaces from annex K of the C11 standard. */ +#if defined (__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ + +#ifndef __RSIZE_T_DEFINED +#define __RSIZE_T_DEFINED +typedef size_t rsize_t; +#endif + +#ifndef __ERRNO_T_DEFINED +#define __ERRNO_T_DEFINED +typedef int errno_t; +#endif + +#endif + #if __TIME_UNSIGNED struct tm { diff -Nru sdcc-3.1.0+dfsg/device/include/tinibios.h sdcc-3.2.0+dfsg/device/include/tinibios.h --- sdcc-3.1.0+dfsg/device/include/tinibios.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/tinibios.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -63,7 +63,7 @@ #define SERIAL_1_RECEIVE_BUFFER_SIZE 64 /* I know someone is fooling with the crystals */ -#if defined(SDCC_ds400) +#if defined(__SDCC_ds400) # define OSCILLATOR 14745600L #else # define OSCILLATOR 18432000L @@ -125,12 +125,12 @@ void Serial0IrqHandler (void) __interrupt 4; void Serial1IrqHandler (void) __interrupt 7; -#if !defined(SDCC_ds400) +#if !defined(__SDCC_ds400) void ClockInit(); void ClockIrqHandler (void) __interrupt 1 __naked; #endif -#if defined(SDCC_ds400) +#if defined(__SDCC_ds400) /* functions for dealing with the ds400 ROM firmware. */ /* A wrapper which calls rom_init allocating all available RAM in CE0 diff -Nru sdcc-3.1.0+dfsg/device/include/typeof.h sdcc-3.2.0+dfsg/device/include/typeof.h --- sdcc-3.1.0+dfsg/device/include/typeof.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/typeof.h 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/include/z180/z180.h sdcc-3.2.0+dfsg/device/include/z180/z180.h --- sdcc-3.1.0+dfsg/device/include/z180/z180.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/include/z180/z180.h 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/Makefile.in sdcc-3.2.0+dfsg/device/lib/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/Makefile.in 2012-05-18 16:09:24.000000000 +0000 @@ -10,7 +10,6 @@ SHELL = /bin/sh INSTALL = @INSTALL@ CP = @CP@ -AR_S = @AR@ @AR_S_FLAG@ LIB_TYPE = @LIB_TYPE@ @@ -61,8 +60,8 @@ OPT_DISABLE_AVR = @OPT_DISABLE_AVR@ OPT_DISABLE_DS390 = @OPT_DISABLE_DS390@ OPT_DISABLE_DS400 = @OPT_DISABLE_DS400@ -OPT_DISABLE_GBZ80 = @OPT_DISABLE_GBZ80@ OPT_DISABLE_HC08 = @OPT_DISABLE_HC08@ +OPT_DISABLE_S08 = @OPT_DISABLE_S08@ OPT_DISABLE_MCS51 = @OPT_DISABLE_MCS51@ OPT_DISABLE_PIC14 = @OPT_DISABLE_PIC14@ OPT_DISABLE_PIC16 = @OPT_DISABLE_PIC16@ @@ -70,6 +69,8 @@ OPT_DISABLE_Z80 = @OPT_DISABLE_Z80@ OPT_DISABLE_Z180 = @OPT_DISABLE_Z180@ OPT_DISABLE_R2K = @OPT_DISABLE_R2K@ +OPT_DISABLE_R3KA = @OPT_DISABLE_R3KA@ +OPT_DISABLE_GBZ80 = @OPT_DISABLE_GBZ80@ SOURCES_FLOAT = $(COMMON_FLOAT) \ _fscmp.c \ @@ -92,6 +93,15 @@ _divulong.c \ _mullong.c +SOURCES_LONGLONG = $(COMMON_LONGLONG) \ + _rrulonglong.c \ + _rrslonglong.c \ + _rlulonglong.c \ + _rlslonglong.c \ + _mullonglong.c \ + _divslonglong.c \ + _divulonglong.c + SOURCES_SDCC = $(COMMON_SDCC) \ _autobaud.c \ _bp.c \ @@ -117,14 +127,15 @@ printfl.c \ bpx.c -SOURCES = $(SOURCES_FLOAT) $(SOURCES_INT) $(SOURCES_LONG) $(SOURCES_SDCC) +SOURCES = $(SOURCES_FLOAT) $(SOURCES_INT) $(SOURCES_LONG) $(SOURCES_LONGLONG) $(SOURCES_SDCC) OBJECTS_FLOAT = $(SOURCES_FLOAT:%.c=$(PORT)/%.rel) OBJECTS_INT = $(SOURCES_INT:%.c=$(PORT)/%.rel) OBJECTS_LONG = $(SOURCES_LONG:%.c=$(PORT)/%.rel) +OBJECTS_LONGLONG = $(SOURCES_LONGLONG:%.c=$(PORT)/%.rel) OBJECTS_SDCC = $(SOURCES_SDCC:%.c=$(PORT)/%.rel) -OBJECTS = $(OBJECTS_FLOAT) $(OBJECTS_INT) $(OBJECTS_LONG) $(OBJECTS_SDCC) +OBJECTS = $(OBJECTS_FLOAT) $(OBJECTS_INT) $(OBJECTS_LONG) $(OBJECTS_LONGLONG) $(OBJECTS_SDCC) XA51_FLOAT = $(COMMON_FLOAT) @@ -147,7 +158,7 @@ XA51SOURCES = $(XA51_FLOAT) $(XA51_INT) $(XA51_LONG) $(XA51_SDCC) XA51OBJECTS = $(XA51SOURCES:%.c=$(PORT)/%.rel) -LIB_FILES = $(PORTDIR)/libfloat.lib $(PORTDIR)/libint.lib $(PORTDIR)/liblong.lib $(PORTDIR)/libsdcc.lib +LIB_FILES = $(PORTDIR)/libfloat.lib $(PORTDIR)/libint.lib $(PORTDIR)/liblong.lib $(PORTDIR)/liblonglong.lib $(PORTDIR)/libsdcc.lib OEXT = .rel @@ -165,6 +176,10 @@ TARGETS += model-hc08 endif +ifeq ($(OPT_DISABLE_S08), 0) +TARGETS += model-s08 +endif + ifeq ($(OPT_DISABLE_MCS51), 0) TARGETS += models small-mcs51-stack-auto endif @@ -189,6 +204,10 @@ TARGETS += model-r2k endif +ifeq ($(OPT_DISABLE_R3KA), 0) +TARGETS += model-r3ka +endif + ifeq ($(OPT_DISABLE_GBZ80), 0) TARGETS += model-gbz80 endif @@ -259,14 +278,13 @@ $(PORTDIR)/lib$(PORT).lib: $(XA51OBJECTS) ifeq ($(LIB_TYPE), SDCCLIB) - ../../bin/sdcclib -a $(PORTDIR)/lib$(PORT).lib $(XA51OBJECTS) + $(top_builddir)/bin/sdcclib -a $(PORTDIR)/lib$(PORT).lib $(XA51OBJECTS) else ifeq ($(LIB_TYPE), AR) - $(AR_S) -q $(PORTDIR)/lib$(PORT).lib $(XA51OBJECTS) + $(top_builddir)/bin/sdar -rcS $(PORTDIR)/lib$(PORT).lib $(XA51OBJECTS) else ifeq ($(LIB_TYPE), RANLIB) - $(AR_S) -q $(PORTDIR)/lib$(PORT).lib $(XA51OBJECTS) - $(top_builddir)/bin/sdranlib $(PORTDIR)/lib$(PORT).lib + $(top_builddir)/bin/sdar -rc $(PORTDIR)/lib$(PORT).lib $(XA51OBJECTS) else rm -f $(PORTDIR)/lib$(PORT).lib for i in $(notdir $(basename $(XA51OBJECTS))); do echo $$i >> $(PORTDIR)/lib$(PORT).lib; done @@ -290,6 +308,11 @@ $(MAKE) MODELFLAGS="-mr2k" PORT=r2k objects-z80 OEXT=.o; \ fi +model-r3ka: + if grep '^z80\>' $(top_builddir)/ports.build > /dev/null; then \ + $(MAKE) MODELFLAGS="-mr3ka" PORT=r3ka objects-z80 OEXT=.o; \ + fi + model-gbz80: if grep '^z80\>' $(top_builddir)/ports.build > /dev/null; then \ $(MAKE) MODELFLAGS="-mgbz80" PORT=gbz80 objects-z80 OEXT=.o; \ @@ -305,6 +328,11 @@ $(MAKE) MODELFLAGS="-mhc08" PORT=hc08 objects-hc08; \ fi +model-s08: + if grep '^hc08\>' $(top_builddir)/ports.build > /dev/null; then \ + $(MAKE) MODELFLAGS="-ms08" PORT=s08 objects-hc08; \ + fi + objects-hc08: $(MAKE) build-dir $(MAKE) port-specific-objects @@ -363,46 +391,55 @@ ifeq ($(LIB_TYPE), SDCCLIB) $(PORTDIR)/libfloat.lib: $(OBJECTS_FLOAT) - ../../bin/sdcclib -a $(PORTDIR)/libfloat.lib $(OBJECTS_FLOAT) + $(top_builddir)/bin/sdcclib -a $(PORTDIR)/libfloat.lib $(OBJECTS_FLOAT) $(PORTDIR)/libint.lib: $(OBJECTS_INT) - ../../bin/sdcclib -a $(PORTDIR)/libint.lib $(OBJECTS_INT) + $(top_builddir)/bin/sdcclib -a $(PORTDIR)/libint.lib $(OBJECTS_INT) $(PORTDIR)/liblong.lib: $(OBJECTS_LONG) - ../../bin/sdcclib -a $(PORTDIR)/liblong.lib $(OBJECTS_LONG) + $(top_builddir)/bin/sdcclib -a $(PORTDIR)/liblong.lib $(OBJECTS_LONG) + +$(PORTDIR)/liblonglong.lib: $(OBJECTS_LONGLONG) + $(top_builddir)/bin/sdcclib -a $(PORTDIR)/liblonglong.lib $(OBJECTS_LONGLONG) $(PORTDIR)/libsdcc.lib: $(OBJECTS_SDCC) - ../../bin/sdcclib -a $(PORTDIR)/libsdcc.lib $(OBJECTS_SDCC) + $(top_builddir)/bin/sdcclib -a $(PORTDIR)/libsdcc.lib $(OBJECTS_SDCC) else ifeq ($(LIB_TYPE), AR) $(PORTDIR)/libfloat.lib: $(OBJECTS_FLOAT) - $(AR_S) -cq $(PORTDIR)/libfloat.lib $(OBJECTS_FLOAT) + $(top_builddir)/bin/sdar -rcS $(PORTDIR)/libfloat.lib $(OBJECTS_FLOAT) $(PORTDIR)/libint.lib: $(OBJECTS_INT) - $(AR_S) -cq $(PORTDIR)/libint.lib $(OBJECTS_INT) + $(top_builddir)/bin/sdar -rcS $(PORTDIR)/libint.lib $(OBJECTS_INT) $(PORTDIR)/liblong.lib: $(OBJECTS_LONG) - $(AR_S) -cq $(PORTDIR)/liblong.lib $(OBJECTS_LONG) + $(top_builddir)/bin/sdar -rcS $(PORTDIR)/liblong.lib $(OBJECTS_LONG) + +$(PORTDIR)/liblonglong.lib: $(OBJECTS_LONGLONG) + $(top_builddir)/bin/sdar -rcS $(PORTDIR)/liblonglong.lib $(OBJECTS_LONGLONG) $(PORTDIR)/libsdcc.lib: $(OBJECTS_SDCC) - $(AR_S) -cq $(PORTDIR)/libsdcc.lib $(OBJECTS_SDCC) + $(top_builddir)/bin/sdar -rcS $(PORTDIR)/libsdcc.lib $(OBJECTS_SDCC) else ifeq ($(LIB_TYPE), RANLIB) $(PORTDIR)/libfloat.lib: $(OBJECTS_FLOAT) - $(AR_S) -cq $(PORTDIR)/libfloat.lib $(OBJECTS_FLOAT); $(top_builddir)/bin/sdranlib $(PORTDIR)/libfloat.lib + $(top_builddir)/bin/sdar -rc $(PORTDIR)/libfloat.lib $(OBJECTS_FLOAT) $(PORTDIR)/libint.lib: $(OBJECTS_INT) - $(AR_S) -cq $(PORTDIR)/libint.lib $(OBJECTS_INT); $(top_builddir)/bin/sdranlib $(PORTDIR)/libint.lib + $(top_builddir)/bin/sdar -rc $(PORTDIR)/libint.lib $(OBJECTS_INT) $(PORTDIR)/liblong.lib: $(OBJECTS_LONG) - $(AR_S) -cq $(PORTDIR)/liblong.lib $(OBJECTS_LONG); $(top_builddir)/bin/sdranlib $(PORTDIR)/liblong.lib + $(top_builddir)/bin/sdar -rc $(PORTDIR)/liblong.lib $(OBJECTS_LONG) + +$(PORTDIR)/liblonglong.lib: $(OBJECTS_LONGLONG) + $(top_builddir)/bin/sdar -rc $(PORTDIR)/liblonglong.lib $(OBJECTS_LONGLONG) $(PORTDIR)/libsdcc.lib: $(OBJECTS_SDCC) - $(AR_S) -cq $(PORTDIR)/libsdcc.lib $(OBJECTS_SDCC); $(top_builddir)/bin/sdranlib $(PORTDIR)/libsdcc.lib + $(top_builddir)/bin/sdar -rc $(PORTDIR)/libsdcc.lib $(OBJECTS_SDCC) else @@ -421,6 +458,11 @@ for i in $(notdir $(basename $(OBJECTS_LONG))); do echo $$i >> $(PORTDIR)/liblong.lib; done cp $(OBJECTS_LONG) $(PORTDIR) +$(PORTDIR)/liblonglong.lib: $(OBJECTS_LONGLONG) + rm -f $(PORTDIR)/liblonglong.lib + for i in $(notdir $(basename $(OBJECTS_LONGLONG))); do echo $$i >> $(PORTDIR)/liblonglong.lib; done + cp $(OBJECTS_LONGLONG) $(PORTDIR) + $(PORTDIR)/libsdcc.lib: $(OBJECTS_SDCC) rm -f $(PORTDIR)/libsdcc.lib for i in $(notdir $(basename $(OBJECTS_SDCC))); do echo $$i >> $(PORTDIR)/libsdcc.lib; done @@ -444,11 +486,12 @@ install: all installdirs [ ! -d "$(BUILDDIR)" ] || $(CP_U) -r $(BUILDDIR)/* $(sdcc_libdir) $(CP_U) -r $(MODELS) $(srcdir)/mcs51 $(srcdir)/ds390 $(srcdir)/ds400 \ - $(srcdir)/z80 $(srcdir)/z180 $(srcdir)/r2k $(srcdir)/gbz80 $(srcdir)/hc08 \ + $(srcdir)/z80 $(srcdir)/z180 $(srcdir)/r2k $(srcdir)/r3ka $(srcdir)/gbz80 \ + $(srcdir)/hc08 $(srcdir)/s08 \ $(srcdir)/pic14 $(srcdir)/pic16 $(srcdir)/*.c $(sdcc_libdir)/src - $(CP_U) -r $(MODELS) mcs51 ds390 ds400 z80 z180 r2k gbz80 hc08 $(sdcc_libdir)/src + $(CP_U) -r $(MODELS) mcs51 ds390 ds400 z80 z180 r2k r3ka gbz80 hc08 s08 $(sdcc_libdir)/src - for src in $(MODELS) ds390 ds400 z80 z180 r2k gbz80 hc08 pic14 pic16; do \ + for src in $(MODELS) ds390 ds400 z80 z180 r2k r3ka gbz80 hc08 s08 pic14 pic16; do \ find $(sdcc_libdir)/src/$$src -depth \ \( -name '*.rel' -o -name '*.dump*' -o -name '*.sym' -o -name '*.o' -o -name '*.lib' -o \ -name '*.lst' -o -name '*.asm' -o -name '.svn' -o -name 'autom4te.cache' -o \ @@ -484,7 +527,7 @@ for model in $(MODELS); do \ mkdir -p $(sdcc_libdir)/$$model; \ done - for libdir in small-stack-auto ds390 ds400 hc08 pic16 pic14; do \ + for libdir in small-stack-auto ds390 ds400 hc08 s08 pic16 pic14; do \ mkdir -p $(sdcc_libdir)/$$libdir; \ done mkdir -p $(sdcc_libdir)/src diff -Nru sdcc-3.1.0+dfsg/device/lib/_atof.c sdcc-3.2.0+dfsg/device/lib/_atof.c --- sdcc-3.1.0+dfsg/device/lib/_atof.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_atof.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -13,7 +13,7 @@ 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 + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -30,15 +30,11 @@ #include #include -#ifndef BOOL -#define BOOL _Bool -#endif - float atof(const char * s) { float value, fraction; signed char iexp; - BOOL sign; + bool sign; //Skip leading blanks while (isspace(*s)) s++; diff -Nru sdcc-3.1.0+dfsg/device/lib/_atoi.c sdcc-3.2.0+dfsg/device/lib/_atoi.c --- sdcc-3.1.0+dfsg/device/lib/_atoi.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_atoi.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_atol.c sdcc-3.2.0+dfsg/device/lib/_atol.c --- sdcc-3.1.0+dfsg/device/lib/_atol.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_atol.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_autobaud.c sdcc-3.2.0+dfsg/device/lib/_autobaud.c --- sdcc-3.1.0+dfsg/device/lib/_autobaud.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_autobaud.c 2012-06-06 11:34:31.000000000 +0000 @@ -9,7 +9,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -58,45 +58,44 @@ { /* get timer #1 ready for action (16 bit mode) */ - TMOD=0x11; - TCON = 0; - TH1 = TL1 = 0; - - /* wait for start bit */ + TMOD=0x11; + TCON = 0; + TH1 = TL1 = 0; + + /* wait for start bit */ autobaud2: while(RXD) ; - /* check it a few more times to make + /* check it a few more times to make sure we don't trigger on some noise*/ - if (RXD) goto autobaud2; - if (RXD) goto autobaud2; - if (RXD) goto autobaud2; - if (RXD) goto autobaud2; + if (RXD) goto autobaud2; + if (RXD) goto autobaud2; + if (RXD) goto autobaud2; + if (RXD) goto autobaud2; - /* wait for bit #0 to begin */ - while (!RXD); + /* wait for bit #0 to begin */ + while (!RXD); TR1 = 1; /* start the timer */ - while (RXD); // wait for bit #1 to begin + while (RXD); // wait for bit #1 to begin while(!RXD); // wait for bit #2 to begin while(RXD); // wait for bit #4 to begin while (!RXD); // wait for stop bit to begin TR1 = 0; // stop timing - /* ;grab bit 7... it's the lsb we want */ - TH1 = (TH1 << 1) | (TL1 >> 7); + /* ;grab bit 7... it's the lsb we want */ + TH1 = (TH1 << 1) | (TL1 >> 7); - /* round off if necessary */ + /* round off if necessary */ TH1 = (TH1 << 1) | ((TL1 >> 6) & 0x01); - /* invert since timer #1 will count up */ + /* invert since timer #1 will count up */ TH1 = ~TH1; - /* now TH1 has the correct reload value (I hope) */ - TH1++ ; + /* now TH1 has the correct reload value (I hope) */ + TH1++ ; - TL1 = TH1; - TMOD = 0x21 ; // set timer #1 for 8 bit auto-reload + TL1 = TH1; + TMOD = 0x21 ; // set timer #1 for 8 bit auto-reload PCON = 0x80 ; // configure built-in uart SCON = 0x52 ; } - diff -Nru sdcc-3.1.0+dfsg/device/lib/_bp.c sdcc-3.2.0+dfsg/device/lib/_bp.c --- sdcc-3.1.0+dfsg/device/lib/_bp.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_bp.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_calloc.c sdcc-3.2.0+dfsg/device/lib/_calloc.c --- sdcc-3.1.0+dfsg/device/lib/_calloc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_calloc.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_decdptr.c sdcc-3.2.0+dfsg/device/lib/_decdptr.c --- sdcc-3.1.0+dfsg/device/lib/_decdptr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_decdptr.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -35,7 +35,7 @@ .globl __decdptr __decdptr: -#ifdef SDCC_ds390 +#ifdef __SDCC_ds390 orl dps, #0xc0 inc dptr anl dps, #0x3f diff -Nru sdcc-3.1.0+dfsg/device/lib/_divsint.c sdcc-3.2.0+dfsg/device/lib/_divsint.c --- sdcc-3.1.0+dfsg/device/lib/_divsint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_divsint.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -39,10 +39,10 @@ mcs51 small stack-auto */ -#if !defined(SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) -# if defined(SDCC_mcs51) -# if defined(SDCC_MODEL_SMALL) -# if defined(SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) +#if !defined(__SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) +# if defined(__SDCC_mcs51) +# if defined(__SDCC_MODEL_SMALL) +# if defined(__SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) # define _DIVSINT_ASM_SMALL_AUTO # else # define _DIVSINT_ASM_SMALL diff -Nru sdcc-3.1.0+dfsg/device/lib/_divslong.c sdcc-3.2.0+dfsg/device/lib/_divslong.c --- sdcc-3.1.0+dfsg/device/lib/_divslong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_divslong.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -38,10 +38,10 @@ mcs51 small stack-auto */ -#if !defined(SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) -# if defined(SDCC_mcs51) -# if defined(SDCC_MODEL_SMALL) -# if defined(SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) +#if !defined(__SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) +# if defined(__SDCC_mcs51) +# if defined(__SDCC_MODEL_SMALL) +# if defined(__SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) # define _DIVSLONG_ASM_SMALL_AUTO # else # define _DIVSLONG_ASM_SMALL diff -Nru sdcc-3.1.0+dfsg/device/lib/_divslonglong.c sdcc-3.2.0+dfsg/device/lib/_divslonglong.c --- sdcc-3.1.0+dfsg/device/lib/_divslonglong.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_divslonglong.c 2012-04-02 09:59:13.000000000 +0000 @@ -0,0 +1,52 @@ +/*------------------------------------------------------------------------- + _divslonglong.c - routine for divsion of 64 bit unsigned long long + + Copyright (C) 2012, Philipp Klaus Krause . pkk@spth.de + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +#pragma std_c99 + +#include +#include + +#ifdef __SDCC_LONGLONG +long long +_divslonglong (long long numerator, long long denominator) +{ + bool numeratorneg = (numerator < 0); + bool denominatorneg = (denominator < 0); + long long d; + + if (numeratorneg) + numerator = -numerator; + if (denominatorneg) + denominator = -denominator; + + d = (unsigned long long)numerator / (unsigned long long)denominator; + + return ((numeratorneg ^ denominatorneg) ? -d : d); +} +#endif + diff -Nru sdcc-3.1.0+dfsg/device/lib/_divuint.c sdcc-3.2.0+dfsg/device/lib/_divuint.c --- sdcc-3.1.0+dfsg/device/lib/_divuint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_divuint.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -13,7 +13,7 @@ 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 + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -33,10 +33,10 @@ #include -#if !defined(SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) -# if defined(SDCC_mcs51) -# if defined(SDCC_MODEL_SMALL) -# if defined(SDCC_STACK_AUTO) +#if !defined(__SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) +# if defined(__SDCC_mcs51) +# if defined(__SDCC_MODEL_SMALL) +# if defined(__SDCC_STACK_AUTO) # define _DIVUINT_ASM_SMALL_AUTO # else # define _DIVUINT_ASM_SMALL @@ -66,7 +66,7 @@ #define yl (b1_0) #define yh (b1_1) #else // SDCC_PARMS_IN_BANK1 - #if defined(SDCC_STACK_AUTO) + #if defined(__SDCC_STACK_AUTO) .globl __divint @@ -87,7 +87,7 @@ #else // SDCC_STACK_AUTO - #if defined(SDCC_NOOVERLAY) + #if defined(__SDCC_NOOVERLAY) .area DSEG (DATA) #else .area OSEG (OVR,DATA) @@ -156,7 +156,7 @@ { unsigned int reste = 0; unsigned char count = 16; - BOOL c; + bool c; do { diff -Nru sdcc-3.1.0+dfsg/device/lib/_divulong.c sdcc-3.2.0+dfsg/device/lib/_divulong.c --- sdcc-3.1.0+dfsg/device/lib/_divulong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_divulong.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -13,7 +13,7 @@ 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 + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -33,14 +33,10 @@ #include -#ifndef BOOL -#define BOOL _Bool -#endif - -#if !defined(SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) -# if defined(SDCC_mcs51) -# if defined(SDCC_MODEL_SMALL) -# if defined(SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) +#if !defined(__SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) +# if defined(__SDCC_mcs51) +# if defined(__SDCC_MODEL_SMALL) +# if defined(__SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) # define _DIVULONG_ASM_SMALL_AUTO # else # define _DIVULONG_ASM_SMALL @@ -73,7 +69,7 @@ #define reste3 r7 #if !defined(SDCC_PARMS_IN_BANK1) -#if defined(SDCC_NOOVERLAY) +#if defined(__SDCC_NOOVERLAY) .area DSEG (DATA) #else .area OSEG (OVR,DATA) @@ -336,7 +332,7 @@ { unsigned long reste = 0L; unsigned char count = 32; - BOOL c; + bool c; do { diff -Nru sdcc-3.1.0+dfsg/device/lib/_divulonglong.c sdcc-3.2.0+dfsg/device/lib/_divulonglong.c --- sdcc-3.1.0+dfsg/device/lib/_divulonglong.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_divulonglong.c 2012-04-02 09:59:13.000000000 +0000 @@ -0,0 +1,65 @@ +/*------------------------------------------------------------------------- + _divslonglong.c - routine for divsion of 64 bit unsigned long long + + Copyright (C) 1999, Jean-Louis Vern + Copyright (C) 2012, Philipp Klaus Krause . pkk@spth.de + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +#pragma std_c99 + +#include +#include + +#ifdef __SDCC_LONGLONG +#define MSB_SET(x) ((x >> (8*sizeof(x)-1)) & 1) + +unsigned long long +_divulonglong (unsigned long long x, unsigned long long y) +{ + unsigned long long reste = 0L; + unsigned char count = 64; + bool c; + + do + { + // reste: x <- 0; + c = MSB_SET(x); + x <<= 1; + reste <<= 1; + if (c) + reste |= 1L; + + if (reste >= y) + { + reste -= y; + // x <- (result = 1) + x |= 1L; + } + } + while (--count); + return x; +} +#endif + diff -Nru sdcc-3.1.0+dfsg/device/lib/_free.c sdcc-3.2.0+dfsg/device/lib/_free.c --- sdcc-3.1.0+dfsg/device/lib/_free.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_free.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -29,7 +29,7 @@ #include #include -#if defined(SDCC_STACK_AUTO) || defined(SDCC_z80) || defined(SDCC_z180) || defined(SDCC_gbz80) +#if defined(__SDCC_STACK_AUTO) || defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_gbz80) #define CRITICAL __critical #else #define CRITICAL diff -Nru sdcc-3.1.0+dfsg/device/lib/_fs2schar.c sdcc-3.2.0+dfsg/device/lib/_fs2schar.c --- sdcc-3.1.0+dfsg/device/lib/_fs2schar.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fs2schar.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_fs2sint.c sdcc-3.2.0+dfsg/device/lib/_fs2sint.c --- sdcc-3.1.0+dfsg/device/lib/_fs2sint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fs2sint.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_fs2slong.c sdcc-3.2.0+dfsg/device/lib/_fs2slong.c --- sdcc-3.1.0+dfsg/device/lib/_fs2slong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fs2slong.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_fs2uchar.c sdcc-3.2.0+dfsg/device/lib/_fs2uchar.c --- sdcc-3.1.0+dfsg/device/lib/_fs2uchar.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fs2uchar.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -26,7 +26,7 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_fs2uint.c sdcc-3.2.0+dfsg/device/lib/_fs2uint.c --- sdcc-3.1.0+dfsg/device/lib/_fs2uint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fs2uint.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -26,7 +26,7 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_fs2ulong.c sdcc-3.2.0+dfsg/device/lib/_fs2ulong.c --- sdcc-3.1.0+dfsg/device/lib/_fs2ulong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fs2ulong.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_fsadd.c sdcc-3.2.0+dfsg/device/lib/_fsadd.c --- sdcc-3.1.0+dfsg/device/lib/_fsadd.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fsadd.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -13,7 +13,7 @@ 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 + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -27,15 +27,11 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include #include #include -#ifndef BOOL -#define BOOL _Bool -#endif - #ifdef FLOAT_ASM_MCS51 // float __fsadd (float a, float b) __reentrant @@ -177,7 +173,7 @@ long _AUTOMEM *pfl1; long _AUTOMEM *pfl2; int exp1, exp2, expd; - BOOL sign = false; + bool sign = false; pfl2 = (long _AUTOMEM *)&a2; exp2 = EXP (*pfl2); diff -Nru sdcc-3.1.0+dfsg/device/lib/_fscmp.c sdcc-3.2.0+dfsg/device/lib/_fscmp.c --- sdcc-3.1.0+dfsg/device/lib/_fscmp.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fscmp.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_fsdiv.c sdcc-3.2.0+dfsg/device/lib/_fsdiv.c --- sdcc-3.1.0+dfsg/device/lib/_fsdiv.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fsdiv.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_fseq.c sdcc-3.2.0+dfsg/device/lib/_fseq.c --- sdcc-3.1.0+dfsg/device/lib/_fseq.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fseq.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_fsget1arg.c sdcc-3.2.0+dfsg/device/lib/_fsget1arg.c --- sdcc-3.1.0+dfsg/device/lib/_fsget1arg.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fsget1arg.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include @@ -40,19 +40,19 @@ .globl fsgetarg fsgetarg: // extract the input, placing it into: - // sign exponent mantiassa - // ---- -------- --------- - // a: sign_a exp_a r4/r3/r2 + // sign exponent mantissa + // ---- -------- -------- + // a: sign_a exp_a r4/r3/r2 // mov r2, dpl mov r3, dph mov c, b.7 rlc a mov sign_a, c + mov exp_a, a jz 00001$ setb b.7 00001$: - mov exp_a, a mov r4, b ret __endasm; diff -Nru sdcc-3.1.0+dfsg/device/lib/_fsget2args.c sdcc-3.2.0+dfsg/device/lib/_fsget2args.c --- sdcc-3.1.0+dfsg/device/lib/_fsget2args.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fsget2args.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -28,7 +28,7 @@ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include @@ -42,20 +42,20 @@ .globl fsgetargs fsgetargs: // extract the two inputs, placing them into: - // sign exponent mantiassa - // ---- -------- --------- - // a: sign_a exp_a r4/r3/r2 - // b: sign_b exp_b r7/r6/r5 + // sign exponent mantissa + // ---- -------- -------- + // a: sign_a exp_a r4/r3/r2 + // b: sign_b exp_b r7/r6/r5 // mov r2, dpl mov r3, dph mov c, b.7 rlc a mov sign_a, c + mov exp_a, a jz 00001$ setb b.7 00001$: - mov exp_a, a mov r4, b // now extract the 2nd parameter from the stack mov a, sp @@ -73,10 +73,10 @@ mov c, b.7 rlc a mov sign_b, c + mov exp_b, a jz 00002$ setb b.7 00002$: - mov exp_b, a mov r7, b ret __endasm; diff -Nru sdcc-3.1.0+dfsg/device/lib/_fsgt.c sdcc-3.2.0+dfsg/device/lib/_fsgt.c --- sdcc-3.1.0+dfsg/device/lib/_fsgt.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fsgt.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_fslt.c sdcc-3.2.0+dfsg/device/lib/_fslt.c --- sdcc-3.1.0+dfsg/device/lib/_fslt.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fslt.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_fsmul.c sdcc-3.2.0+dfsg/device/lib/_fsmul.c --- sdcc-3.1.0+dfsg/device/lib/_fsmul.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fsmul.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_fsneq.c sdcc-3.2.0+dfsg/device/lib/_fsneq.c --- sdcc-3.1.0+dfsg/device/lib/_fsneq.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fsneq.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_fsnormalize.c sdcc-3.2.0+dfsg/device/lib/_fsnormalize.c --- sdcc-3.1.0+dfsg/device/lib/_fsnormalize.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fsnormalize.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -28,7 +28,7 @@ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include @@ -41,9 +41,14 @@ fs_normalize_a: #ifdef FLOAT_SHIFT_SPEEDUP mov r0, #4 -00001$: mov a, r4 +00001$: jnz 00003$ + mov a, exp_a + add a, #248 + jnc 00002$ ;denormalized + mov exp_a, a + clr a xch a, r1 xch a, r2 xch a, r3 @@ -52,19 +57,19 @@ //mov r3, ar2 //mov r2, ar1 //mov r1, #0 - mov a, exp_a - add a, #248 - mov exp_a, a djnz r0, 00001$ ret -#else - mov a, r4 #endif +00002$: + mov a, r4 00003$: mov r0, #32 -00005$: + inc exp_a +00004$: jb acc.7, 00006$ - dec exp_a + djnz exp_a, 00005$ + ret ;denormalized +00005$: clr c mov a, r1 rlc a @@ -78,8 +83,9 @@ mov a, r4 rlc a mov r4, a - djnz r0, 00005$ + djnz r0, 00004$ 00006$: + dec exp_a ret __endasm; } diff -Nru sdcc-3.1.0+dfsg/device/lib/_fsreturnval.c sdcc-3.2.0+dfsg/device/lib/_fsreturnval.c --- sdcc-3.1.0+dfsg/device/lib/_fsreturnval.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fsreturnval.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -28,7 +28,7 @@ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_fsrshift.c sdcc-3.2.0+dfsg/device/lib/_fsrshift.c --- sdcc-3.1.0+dfsg/device/lib/_fsrshift.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fsrshift.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -28,7 +28,7 @@ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_fssub.c sdcc-3.2.0+dfsg/device/lib/_fssub.c --- sdcc-3.1.0+dfsg/device/lib/_fssub.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fssub.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_fsswapargs.c sdcc-3.2.0+dfsg/device/lib/_fsswapargs.c --- sdcc-3.1.0+dfsg/device/lib/_fsswapargs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_fsswapargs.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -28,7 +28,7 @@ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_gptrget.c sdcc-3.2.0+dfsg/device/lib/_gptrget.c --- sdcc-3.1.0+dfsg/device/lib/_gptrget.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_gptrget.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -216,7 +216,7 @@ #endif -#ifdef SDCC_ds390 +#ifdef __SDCC_ds390 /* the return value is expected to be in acc/_ap, and not in the standard * location dpl/dph. Therefore we choose return type void here: */ diff -Nru sdcc-3.1.0+dfsg/device/lib/_gptrgetc.c sdcc-3.2.0+dfsg/device/lib/_gptrgetc.c --- sdcc-3.1.0+dfsg/device/lib/_gptrgetc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_gptrgetc.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_gptrput.c sdcc-3.2.0+dfsg/device/lib/_gptrput.c --- sdcc-3.1.0+dfsg/device/lib/_gptrput.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_gptrput.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -187,7 +187,7 @@ #endif -#ifdef SDCC_ds390 +#ifdef __SDCC_ds390 void _gptrputWord () diff -Nru sdcc-3.1.0+dfsg/device/lib/_heap.c sdcc-3.2.0+dfsg/device/lib/_heap.c --- sdcc-3.1.0+dfsg/device/lib/_heap.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_heap.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_iscntrl.c sdcc-3.2.0+dfsg/device/lib/_iscntrl.c --- sdcc-3.1.0+dfsg/device/lib/_iscntrl.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_iscntrl.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_isdigit.c sdcc-3.2.0+dfsg/device/lib/_isdigit.c --- sdcc-3.1.0+dfsg/device/lib/_isdigit.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_isdigit.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_isgraph.c sdcc-3.2.0+dfsg/device/lib/_isgraph.c --- sdcc-3.1.0+dfsg/device/lib/_isgraph.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_isgraph.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_islower.c sdcc-3.2.0+dfsg/device/lib/_islower.c --- sdcc-3.1.0+dfsg/device/lib/_islower.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_islower.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_isprint.c sdcc-3.2.0+dfsg/device/lib/_isprint.c --- sdcc-3.1.0+dfsg/device/lib/_isprint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_isprint.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_ispunct.c sdcc-3.2.0+dfsg/device/lib/_ispunct.c --- sdcc-3.1.0+dfsg/device/lib/_ispunct.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_ispunct.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_isspace.c sdcc-3.2.0+dfsg/device/lib/_isspace.c --- sdcc-3.1.0+dfsg/device/lib/_isspace.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_isspace.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_isupper.c sdcc-3.2.0+dfsg/device/lib/_isupper.c --- sdcc-3.1.0+dfsg/device/lib/_isupper.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_isupper.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_isxdigit.c sdcc-3.2.0+dfsg/device/lib/_isxdigit.c --- sdcc-3.1.0+dfsg/device/lib/_isxdigit.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_isxdigit.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_itoa.c sdcc-3.2.0+dfsg/device/lib/_itoa.c --- sdcc-3.1.0+dfsg/device/lib/_itoa.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_itoa.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_logexpf.c sdcc-3.2.0+dfsg/device/lib/_logexpf.c --- sdcc-3.1.0+dfsg/device/lib/_logexpf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_logexpf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -26,7 +26,7 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ -#define SDCC_MATH_LIB +#define __SDCC_MATH_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_ltoa.c sdcc-3.2.0+dfsg/device/lib/_ltoa.c --- sdcc-3.1.0+dfsg/device/lib/_ltoa.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_ltoa.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -46,7 +46,7 @@ # warning _ltoa() and _ultoa() are not save for radix 2 #endif -#if defined (SDCC_mcs51) && defined (SDCC_MODEL_SMALL) && !defined (SDCC_STACK_AUTO) +#if defined (__SDCC_mcs51) && defined (__SDCC_MODEL_SMALL) && !defined (__SDCC_STACK_AUTO) # define MEMSPACE_BUFFER __idata /* eventually __pdata or __xdata */ # pragma nogcse #else @@ -81,3 +81,4 @@ } _ultoa(value, string, radix); } + diff -Nru sdcc-3.1.0+dfsg/device/lib/_malloc.c sdcc-3.2.0+dfsg/device/lib/_malloc.c --- sdcc-3.1.0+dfsg/device/lib/_malloc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_malloc.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -29,7 +29,7 @@ #include #include -#if defined(SDCC_STACK_AUTO) || defined(SDCC_z80) || defined(SDCC_z180) || defined(SDCC_gbz80) +#if defined(__SDCC_STACK_AUTO) || defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_gbz80) #define CRITICAL __critical #else #define CRITICAL @@ -241,3 +241,4 @@ //END OF MODULE #endif + diff -Nru sdcc-3.1.0+dfsg/device/lib/_memchr.c sdcc-3.2.0+dfsg/device/lib/_memchr.c --- sdcc-3.1.0+dfsg/device/lib/_memchr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_memchr.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_memcmp.c sdcc-3.2.0+dfsg/device/lib/_memcmp.c --- sdcc-3.1.0+dfsg/device/lib/_memcmp.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_memcmp.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_memcpy.c sdcc-3.2.0+dfsg/device/lib/_memcpy.c --- sdcc-3.1.0+dfsg/device/lib/_memcpy.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_memcpy.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_memmove.c sdcc-3.2.0+dfsg/device/lib/_memmove.c --- sdcc-3.1.0+dfsg/device/lib/_memmove.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_memmove.c 2012-03-13 10:17:10.000000000 +0000 @@ -7,7 +7,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -28,6 +28,7 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ #include "string.h" +#include #include #ifndef _SDCC_PORT_PROVIDES_MEMMOVE @@ -46,7 +47,7 @@ char * d; char * s; - if (((int)src < (int)dst) && ((((int)src)+acount) > (int)dst)) { + if ((uintptr_t)src < (uintptr_t)dst) { /* * copy from higher addresses to lower addresses */ diff -Nru sdcc-3.1.0+dfsg/device/lib/_memset.c sdcc-3.2.0+dfsg/device/lib/_memset.c --- sdcc-3.1.0+dfsg/device/lib/_memset.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_memset.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -31,9 +31,9 @@ #undef memset /* Avoid conflict with builtin memset() in Z80 and some related ports */ -#if defined (_SDCC_NO_ASM_LIB_FUNCS) || !defined (SDCC_mcs51) || \ - (!defined (SDCC_MODEL_SMALL) && !defined (SDCC_MODEL_LARGE)) || \ - (defined (SDCC_STACK_AUTO) || defined (SDCC_PARMS_IN_BANK1) ) +#if defined (_SDCC_NO_ASM_LIB_FUNCS) || !defined (__SDCC_mcs51) || \ + (!defined (__SDCC_MODEL_SMALL) && !defined (__SDCC_MODEL_LARGE)) || \ + (defined (__SDCC_STACK_AUTO) || defined (__SDCC_PARMS_IN_BANK1) ) #ifdef __SDCC_BROKEN_STRING_FUNCTIONS void *memset (void *s, unsigned char c, size_t n) @@ -61,9 +61,9 @@ /* assigning function parameters to registers. SDCC_PARMS_IN_BANK1 or SDCC_STACK_AUTO not yet implemented. */ - #if defined (SDCC_MODEL_SMALL) + #if defined (__SDCC_MODEL_SMALL) - #if defined(SDCC_NOOVERLAY) + #if defined(__SDCC_NOOVERLAY) .area DSEG (DATA) #else .area OSEG (OVR,DATA) diff -Nru sdcc-3.1.0+dfsg/device/lib/_modsint.c sdcc-3.2.0+dfsg/device/lib/_modsint.c --- sdcc-3.1.0+dfsg/device/lib/_modsint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_modsint.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -38,10 +38,10 @@ mcs51 small stack-auto */ -#if !defined(SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) -# if defined(SDCC_mcs51) -# if defined(SDCC_MODEL_SMALL) -# if defined(SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) +#if !defined(__SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) +# if defined(__SDCC_mcs51) +# if defined(__SDCC_MODEL_SMALL) +# if defined(__SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) # define _MODSINT_ASM_SMALL_AUTO # else # define _MODSINT_ASM_SMALL diff -Nru sdcc-3.1.0+dfsg/device/lib/_modslong.c sdcc-3.2.0+dfsg/device/lib/_modslong.c --- sdcc-3.1.0+dfsg/device/lib/_modslong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_modslong.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -37,10 +37,10 @@ mcs51 small stack-auto */ -#if !defined(SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) -# if defined(SDCC_mcs51) -# if defined(SDCC_MODEL_SMALL) -# if defined(SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) +#if !defined(__SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) +# if defined(__SDCC_mcs51) +# if defined(__SDCC_MODEL_SMALL) +# if defined(__SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) # define _MODSLONG_ASM_SMALL_AUTO # else # define _MODSLONG_ASM_SMALL diff -Nru sdcc-3.1.0+dfsg/device/lib/_moduint.c sdcc-3.2.0+dfsg/device/lib/_moduint.c --- sdcc-3.1.0+dfsg/device/lib/_moduint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_moduint.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -32,10 +32,10 @@ mcs51 small stack-auto */ -#if !defined(SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) -# if defined(SDCC_mcs51) -# if defined(SDCC_MODEL_SMALL) -# if defined(SDCC_STACK_AUTO) +#if !defined(__SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) +# if defined(__SDCC_mcs51) +# if defined(__SDCC_MODEL_SMALL) +# if defined(__SDCC_STACK_AUTO) # define _MODUINT_ASM_SMALL_AUTO # else # define _MODUINT_ASM_SMALL @@ -59,7 +59,7 @@ #define al dpl #define ah dph -#if defined(SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) +#if defined(__SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) ar0 = 0 ; BUG register set is not considered ar1 = 1 @@ -82,7 +82,7 @@ #else // SDCC_STACK_AUTO #if !defined(SDCC_PARMS_IN_BANK1) -#if defined(SDCC_NOOVERLAY) +#if defined(__SDCC_NOOVERLAY) .area DSEG (DATA) #else .area OSEG (OVR,DATA) diff -Nru sdcc-3.1.0+dfsg/device/lib/_modulong.c sdcc-3.2.0+dfsg/device/lib/_modulong.c --- sdcc-3.1.0+dfsg/device/lib/_modulong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_modulong.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -32,10 +32,10 @@ mcs51 small stack-auto */ -#if !defined(SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) -# if defined(SDCC_mcs51) -# if defined(SDCC_MODEL_SMALL) -# if defined(SDCC_STACK_AUTO) && !defined (SDCC_PARMS_IN_BANK1) +#if !defined(__SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) +# if defined(__SDCC_mcs51) +# if defined(__SDCC_MODEL_SMALL) +# if defined(__SDCC_STACK_AUTO) && !defined (SDCC_PARMS_IN_BANK1) # define _MODULONG_ASM_SMALL_AUTO # else # define _MODULONG_ASM_SMALL @@ -66,7 +66,7 @@ #define b2 (b1_2) #define b3 (b1_3) #else -#if defined(SDCC_NOOVERLAY) +#if defined(__SDCC_NOOVERLAY) .area DSEG (DATA) #else .area OSEG (OVR,DATA) @@ -363,3 +363,4 @@ } #endif // _MODULONG_ASM + diff -Nru sdcc-3.1.0+dfsg/device/lib/_mulint.c sdcc-3.2.0+dfsg/device/lib/_mulint.c --- sdcc-3.1.0+dfsg/device/lib/_mulint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_mulint.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -36,20 +36,20 @@ mcs51 large */ -#if !defined(SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) -# if defined(SDCC_ds390) -# if !defined(SDCC_STACK_AUTO) +#if !defined(__SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) +# if defined(__SDCC_ds390) +# if !defined(__SDCC_STACK_AUTO) # define _MULINT_ASM_LARGE # endif -# elif defined(SDCC_mcs51) -# if defined(SDCC_MODEL_SMALL) -# if defined(SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) +# elif defined(__SDCC_mcs51) +# if defined(__SDCC_MODEL_SMALL) +# if defined(__SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) # define _MULINT_ASM_SMALL_AUTO # else # define _MULINT_ASM_SMALL # endif # else // must be SDCC_MODEL_LARGE -# if !defined(SDCC_STACK_AUTO) +# if !defined(__SDCC_STACK_AUTO) # define _MULINT_ASM_LARGE # endif # endif @@ -126,9 +126,9 @@ .globl __mulint -#if !defined(SDCC_STACK_AUTO) || defined(SDCC_PARMS_IN_BANK1) +#if !defined(__SDCC_STACK_AUTO) || defined(SDCC_PARMS_IN_BANK1) -#if defined(SDCC_NOOVERLAY) +#if defined(__SDCC_NOOVERLAY) .area DSEG (DATA) #else .area OSEG (OVR,DATA) @@ -216,7 +216,7 @@ int _mulint (int a, int b) { -#if !defined(SDCC_STACK_AUTO) && (defined(SDCC_MODEL_LARGE) || defined(SDCC_ds390)) // still needed for large +#if !defined(__SDCC_STACK_AUTO) && (defined(__SDCC_MODEL_LARGE) || defined(__SDCC_ds390)) // still needed for large union uu __xdata *x; union uu __xdata *y; union uu t; @@ -239,3 +239,4 @@ #endif #undef _MULINT_ASM + diff -Nru sdcc-3.1.0+dfsg/device/lib/_mullong.c sdcc-3.2.0+dfsg/device/lib/_mullong.c --- sdcc-3.1.0+dfsg/device/lib/_mullong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_mullong.c 2012-05-18 16:46:53.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -35,16 +35,16 @@ mcs51 small stack-auto */ -#if !defined(SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) -# if defined(SDCC_mcs51) -# if defined(SDCC_MODEL_SMALL) -# if defined(SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) +#if !defined(__SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) +# if defined(__SDCC_mcs51) +# if defined(__SDCC_MODEL_SMALL) +# if defined(__SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) # define _MULLONG_ASM_SMALL_AUTO # else # define _MULLONG_ASM_SMALL # endif -# elif defined(SDCC_MODEL_LARGE) -# if !defined(SDCC_STACK_AUTO) +# elif defined(__SDCC_MODEL_LARGE) +# if !defined(__SDCC_STACK_AUTO) # define _MULLONG_ASM_LARGE # endif # endif @@ -78,14 +78,14 @@ ; c2 a2 * b0 + a1 * b1 + a0 * b2 ; c3 a3 * b0 + a2 * b1 + a1 * b2 + a0 * b3 -#if !defined(SDCC_STACK_AUTO) || defined(SDCC_PARMS_IN_BANK1) +#if !defined(__SDCC_STACK_AUTO) || defined(SDCC_PARMS_IN_BANK1) #if defined(SDCC_PARMS_IN_BANK1) #define b0 (b1_0) #define b1 (b1_1) #define b2 (b1_2) #define b3 (b1_3) #else -#if defined(SDCC_NOOVERLAY) +#if defined(__SDCC_NOOVERLAY) .area DSEG (DATA) #else .area OSEG (OVR,DATA) @@ -490,7 +490,7 @@ __endasm; } -#elif defined(SDCC_USE_XSTACK) && defined(SDCC_STACK_AUTO) +#elif defined(__SDCC_USE_XSTACK) && defined(__SDCC_STACK_AUTO) void _mullong_dummy (void) __naked @@ -629,7 +629,7 @@ short a ; char b; long c ;}; -#if defined(SDCC_hc08) +#if defined(__SDCC_hc08) || defined(__SDCC_s08) /* big endian order */ union bil { struct {unsigned char b3,b2,b1,b0 ;} b; @@ -647,7 +647,7 @@ } ; #endif -#if defined(SDCC) +#if defined(__SDCC) #include #endif @@ -671,7 +671,7 @@ |3.0| G |-------> only this side 32 x 32 -> 32 */ -#if defined(SDCC_USE_XSTACK) +#if defined(__SDCC_USE_XSTACK) // currently the original code without u fails with --xstack // it runs out of pointer registers long diff -Nru sdcc-3.1.0+dfsg/device/lib/_mullonglong.c sdcc-3.2.0+dfsg/device/lib/_mullonglong.c --- sdcc-3.1.0+dfsg/device/lib/_mullonglong.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_mullonglong.c 2012-04-02 09:59:13.000000000 +0000 @@ -0,0 +1,52 @@ +/*------------------------------------------------------------------------- + _mullonglong.c - routine for multiplication of 64 bit long long + + Copyright (C) 2012, Philipp Klaus Krause . philipp@informatik.uni-frankfurt.de + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +#pragma std_c99 + +#include + +#ifdef __SDCC_LONGLONG + +long long _mullonglong(long long ll, long long lr) +{ + unsigned long long ret = 0ull; + unsigned char *l = (unsigned char *)(&ll); + unsigned char *r = (unsigned char *)(&lr); + unsigned char i, j; + + for (i = 0; i < sizeof (long long); i++) + { + for(j = 0; (i + j) < sizeof (long long); j++) + ret += ((unsigned short)(l[i] * r [j])) << ((i + j) * 8); + } + + return(ret); +} + +#endif + diff -Nru sdcc-3.1.0+dfsg/device/lib/_realloc.c sdcc-3.2.0+dfsg/device/lib/_realloc.c --- sdcc-3.1.0+dfsg/device/lib/_realloc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_realloc.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -30,7 +30,7 @@ #include #include -#if defined(SDCC_STACK_AUTO) || defined(SDCC_z80) || defined(SDCC_z180) || defined(SDCC_gbz80) +#if defined(__SDCC_STACK_AUTO) || defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_gbz80) #define CRITICAL __critical #else #define CRITICAL diff -Nru sdcc-3.1.0+dfsg/device/lib/_rlslonglong.c sdcc-3.2.0+dfsg/device/lib/_rlslonglong.c --- sdcc-3.1.0+dfsg/device/lib/_rlslonglong.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_rlslonglong.c 2012-04-02 09:59:13.000000000 +0000 @@ -0,0 +1,41 @@ +/*------------------------------------------------------------------------- + _rlslonglong.c - routine for left shift of 64 bit long long + + Copyright (C) 2012, Philipp Klaus Krause . philipp@informatik.uni-frankfurt.de + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +#pragma std_c99 + +#include + +#ifdef __SDCC_LONGLONG + +long long _rlslonglong(long long l, signed char s) +{ + return((unsigned long long)(l) << s); +} + +#endif + diff -Nru sdcc-3.1.0+dfsg/device/lib/_rlulonglong.c sdcc-3.2.0+dfsg/device/lib/_rlulonglong.c --- sdcc-3.1.0+dfsg/device/lib/_rlulonglong.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_rlulonglong.c 2012-04-02 09:59:13.000000000 +0000 @@ -0,0 +1,58 @@ +/*------------------------------------------------------------------------- + _rlulonglong.c - routine for left shift of 64 bit unsigned long long + + Copyright (C) 2012, Philipp Klaus Krause . philipp@informatik.uni-frankfurt.de + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +#pragma std_c99 + +#include + +#ifdef __SDCC_LONGLONG + +unsigned long long _rlulonglong(unsigned long long l, signed char s) +{ + uint32_t *const top = (uint32_t *)((char *)(&l) + 4); + uint16_t *const middle = (uint16_t *)((char *)(&l) + 2); + uint32_t *const bottom = (uint32_t *)(&l); + uint16_t *const b = (uint16_t *)(&l); + + for(;s >= 16; s-= 16) + { + b[3] = b[2]; + b[2] = b[1]; + b[1] = b[0]; + b[0] = 0; + } + + (*top) <<= s; + (*top) |= (((uint32_t)((*middle) & 0xffffu) << s) >> 16); + (*bottom) <<= s; + + return(l); +} + +#endif + diff -Nru sdcc-3.1.0+dfsg/device/lib/_rrslonglong.c sdcc-3.2.0+dfsg/device/lib/_rrslonglong.c --- sdcc-3.1.0+dfsg/device/lib/_rrslonglong.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_rrslonglong.c 2012-04-02 09:59:13.000000000 +0000 @@ -0,0 +1,57 @@ +/*------------------------------------------------------------------------- + _rrulonglong.c - routine for right shift of 64 bit unsigned long long + + Copyright (C) 2012, Philipp Klaus Krause . philipp@informatik.uni-frankfurt.de + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +#pragma std_c99 + +#include + +#ifdef __SDCC_LONGLONG +// This function is the same as the one from rrulonglong_rrx_s.c, except for the type of top. +long long _rrslonglong(long long l, signed char s) +{ + int32_t *top = (uint32_t *)((char *)(&l) + 4); + uint16_t *middle = (uint16_t *)((char *)(&l) + 3); + uint32_t *bottom = (uint32_t *)(&l); + uint16_t *b = (uint16_t *)(&l); + + for(;s >= 16; s-= 16) + { + b[0] = b[1]; + b[1] = b[2]; + b[2] = b[3]; + b[3] = (b[3] & 0x8000) ? 0xffff : 0x000000; + } + + (*bottom) >>= s; + (*bottom) |= ((uint32_t)((*middle) >> s) << 16); + (*top) |= (((*middle) & 0xffff0000) >> s); + + return(l); +} +#endif + diff -Nru sdcc-3.1.0+dfsg/device/lib/_rrulonglong.c sdcc-3.2.0+dfsg/device/lib/_rrulonglong.c --- sdcc-3.1.0+dfsg/device/lib/_rrulonglong.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_rrulonglong.c 2012-04-02 09:59:13.000000000 +0000 @@ -0,0 +1,57 @@ +/*------------------------------------------------------------------------- + _rrulonglong.c - routine for right shift of 64 bit unsigned long long + + Copyright (C) 2012, Philipp Klaus Krause . philipp@informatik.uni-frankfurt.de + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +#pragma std_c99 + +#include + +#ifdef __SDCC_LONGLONG +// This function is the same as the one from rrslonglong_rrx_s.c, except for the type of top, and b[3]. +unsigned long long _rrulonglong(unsigned long long l, signed char s) +{ + uint32_t *const top = (uint32_t *)((char *)(&l) + 4); + uint16_t *const middle = (uint16_t *)((char *)(&l) + 3); + uint32_t *const bottom = (uint32_t *)(&l); + uint16_t *const b = (uint16_t *)(&l); + + for(;s >= 16; s -= 16) + { + b[0] = b[1]; + b[1] = b[2]; + b[2] = b[3]; + b[3] = 0x000000; + } + + (*bottom) >>= s; + (*middle) |= (((*middle) & 0xffff0000ul) >> s); + (*top) |= (((*middle) & 0xffff0000ul) >> s); + + return(l); +} +#endif + diff -Nru sdcc-3.1.0+dfsg/device/lib/_schar2fs.c sdcc-3.2.0+dfsg/device/lib/_schar2fs.c --- sdcc-3.1.0+dfsg/device/lib/_schar2fs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_schar2fs.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_ser.c sdcc-3.2.0+dfsg/device/lib/_ser.c --- sdcc-3.1.0+dfsg/device/lib/_ser.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_ser.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_setjmp.c sdcc-3.2.0+dfsg/device/lib/_setjmp.c --- sdcc-3.1.0+dfsg/device/lib/_setjmp.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_setjmp.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -28,9 +28,10 @@ #include <8051.h> #include +#define __SDCC_HIDE_LONGJMP #include -#if defined(SDCC_STACK_AUTO) && defined(SDCC_USE_XSTACK) +#if defined(__SDCC_STACK_AUTO) && defined(__SDCC_USE_XSTACK) static void dummy (void) __naked { @@ -101,7 +102,7 @@ ; genPointerSet ; genGenPointerSet lcall __gptrput -#ifdef SDCC_MODEL_HUGE +#ifdef __SDCC_MODEL_HUGE inc dptr ;../../device/lib/_setjmp.c:189:*buf = *((unsigned char __data *)SP - 2); ; genCast @@ -187,9 +188,9 @@ ; genPointerSet ; genNearPointerSet mov @r0,a -#ifdef SDCC_MODEL_HUGE +#ifdef __SDCC_MODEL_HUGE inc dptr -;../../device/lib/_setjmp.c:199:*((unsigned char __data *) lsp - 1) = *buf; +;../../device/lib/_setjmp.c:199:*((unsigned char __data *) lsp - 2) = *buf; ; genMinus ; genMinusDec dec r0 @@ -218,7 +219,7 @@ __endasm; } -#elif defined(SDCC_STACK_AUTO) +#elif defined(__SDCC_STACK_AUTO) static void dummy (void) __naked { @@ -277,7 +278,7 @@ ; genPointerSet ; genGenPointerSet lcall __gptrput -#ifdef SDCC_MODEL_HUGE +#ifdef __SDCC_MODEL_HUGE inc dptr ;../../device/lib/_setjmp.c:129:*buf++ = *((unsigned char __data *)SP - 2); ; genCast @@ -321,7 +322,7 @@ mov r0,sp dec r0 dec r0 -#ifdef SDCC_MODEL_HUGE +#ifdef __SDCC_MODEL_HUGE dec r0 #endif mov ar2,@r0 @@ -362,7 +363,7 @@ ; genPointerSet ; genNearPointerSet mov @r0,a -#ifdef SDCC_MODEL_HUGE +#ifdef __SDCC_MODEL_HUGE inc dptr ;../../device/lib/_setjmp.c:34:*((unsigned char __data *) lsp - 2) = *buf; ; genCast @@ -405,7 +406,7 @@ /* registers would have been saved on the stack anyway so we need to save SP and the return address */ -#ifdef SDCC_USE_XSTACK +#ifdef __SDCC_USE_XSTACK *buf++ = spx; *buf++ = bpx; #endif @@ -413,7 +414,7 @@ // *buf++ = bp; *buf++ = *((unsigned char __data *) SP - 0); *buf++ = *((unsigned char __data *) SP - 1); -#ifdef SDCC_MODEL_HUGE +#ifdef __SDCC_MODEL_HUGE *buf++ = *((unsigned char __data *) SP - 2); #endif return 0; @@ -423,7 +424,7 @@ { unsigned char lsp; -#ifdef SDCC_USE_XSTACK +#ifdef __SDCC_USE_XSTACK spx = *buf++; bpx = *buf++; #endif @@ -431,7 +432,7 @@ // bp = *buf++; *((unsigned char __data *) lsp - 0) = *buf++; *((unsigned char __data *) lsp - 1) = *buf++; -#ifdef SDCC_MODEL_HUGE +#ifdef __SDCC_MODEL_HUGE *((unsigned char __data *) lsp - 2) = *buf++; #endif SP = lsp; @@ -439,3 +440,4 @@ } #endif + diff -Nru sdcc-3.1.0+dfsg/device/lib/_sint2fs.c sdcc-3.2.0+dfsg/device/lib/_sint2fs.c --- sdcc-3.1.0+dfsg/device/lib/_sint2fs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_sint2fs.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_slong2fs.c sdcc-3.2.0+dfsg/device/lib/_slong2fs.c --- sdcc-3.1.0+dfsg/device/lib/_slong2fs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_slong2fs.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_spx.c sdcc-3.2.0+dfsg/device/lib/_spx.c --- sdcc-3.1.0+dfsg/device/lib/_spx.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_spx.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_startup.c sdcc-3.2.0+dfsg/device/lib/_startup.c --- sdcc-3.1.0+dfsg/device/lib/_startup.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_startup.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -35,12 +35,12 @@ variables if external data memory needs to be enabled first. */ -#if defined(SDCC_ds390) || defined(SDCC_ds400) +#if defined(__SDCC_ds390) || defined(__SDCC_ds400) /* Disable "ISO C forbids an empty source file" warning message */ #pragma disable_warning 190 -#elif defined(SDCC_mcs51) || defined(SDCC_z80) +#elif defined(__SDCC_mcs51) || defined(__SDCC_z80) unsigned char _sdcc_external_startup (void) __nonbanked { diff -Nru sdcc-3.1.0+dfsg/device/lib/_strcat.c sdcc-3.2.0+dfsg/device/lib/_strcat.c --- sdcc-3.1.0+dfsg/device/lib/_strcat.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_strcat.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_strchr.c sdcc-3.2.0+dfsg/device/lib/_strchr.c --- sdcc-3.1.0+dfsg/device/lib/_strchr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_strchr.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -13,7 +13,7 @@ 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 + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff -Nru sdcc-3.1.0+dfsg/device/lib/_strcmp.c sdcc-3.2.0+dfsg/device/lib/_strcmp.c --- sdcc-3.1.0+dfsg/device/lib/_strcmp.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_strcmp.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_strcpy.c sdcc-3.2.0+dfsg/device/lib/_strcpy.c --- sdcc-3.1.0+dfsg/device/lib/_strcpy.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_strcpy.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_strcspn.c sdcc-3.2.0+dfsg/device/lib/_strcspn.c --- sdcc-3.1.0+dfsg/device/lib/_strcspn.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_strcspn.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_strlen.c sdcc-3.2.0+dfsg/device/lib/_strlen.c --- sdcc-3.1.0+dfsg/device/lib/_strlen.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_strlen.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -29,7 +29,7 @@ #include -#if (!defined (SDCC_mcs51)) +#if (!defined (__SDCC_mcs51)) /* Generic routine first */ size_t strlen ( const char * str ) @@ -44,7 +44,7 @@ #else -#if defined(SDCC) +#if defined(__SDCC) #include #endif diff -Nru sdcc-3.1.0+dfsg/device/lib/_strncat.c sdcc-3.2.0+dfsg/device/lib/_strncat.c --- sdcc-3.1.0+dfsg/device/lib/_strncat.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_strncat.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_strncmp.c sdcc-3.2.0+dfsg/device/lib/_strncmp.c --- sdcc-3.1.0+dfsg/device/lib/_strncmp.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_strncmp.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_strncpy.c sdcc-3.2.0+dfsg/device/lib/_strncpy.c --- sdcc-3.1.0+dfsg/device/lib/_strncpy.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_strncpy.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_strpbrk.c sdcc-3.2.0+dfsg/device/lib/_strpbrk.c --- sdcc-3.1.0+dfsg/device/lib/_strpbrk.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_strpbrk.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_strrchr.c sdcc-3.2.0+dfsg/device/lib/_strrchr.c --- sdcc-3.1.0+dfsg/device/lib/_strrchr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_strrchr.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_strspn.c sdcc-3.2.0+dfsg/device/lib/_strspn.c --- sdcc-3.1.0+dfsg/device/lib/_strspn.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_strspn.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_strstr.c sdcc-3.2.0+dfsg/device/lib/_strstr.c --- sdcc-3.1.0+dfsg/device/lib/_strstr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_strstr.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/_strtok.c sdcc-3.2.0+dfsg/device/lib/_strtok.c --- sdcc-3.1.0+dfsg/device/lib/_strtok.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_strtok.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -28,7 +28,7 @@ #include "string.h" -#if defined(SDCC_MODEL_LARGE) || defined (SDCC_MODEL_FLAT24) +#if defined(__SDCC_MODEL_LARGE) || defined (__SDCC_MODEL_FLAT24) #pragma noinduction #pragma noinvariant #endif @@ -69,3 +69,4 @@ else return NULL; } + diff -Nru sdcc-3.1.0+dfsg/device/lib/_uchar2fs.c sdcc-3.2.0+dfsg/device/lib/_uchar2fs.c --- sdcc-3.1.0+dfsg/device/lib/_uchar2fs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_uchar2fs.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_uint2fs.c sdcc-3.2.0+dfsg/device/lib/_uint2fs.c --- sdcc-3.1.0+dfsg/device/lib/_uint2fs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_uint2fs.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -26,7 +26,7 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/_ulong2fs.c sdcc-3.2.0+dfsg/device/lib/_ulong2fs.c --- sdcc-3.1.0+dfsg/device/lib/_ulong2fs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/_ulong2fs.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include diff -Nru sdcc-3.1.0+dfsg/device/lib/abs.c sdcc-3.2.0+dfsg/device/lib/abs.c --- sdcc-3.1.0+dfsg/device/lib/abs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/abs.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -28,9 +28,9 @@ #include -#if defined (SDCC_mcs51) +#if defined (__SDCC_mcs51) -#if defined(SDCC) +#if defined(__SDCC) #include #endif diff -Nru sdcc-3.1.0+dfsg/device/lib/acosf.c sdcc-3.2.0+dfsg/device/lib/acosf.c --- sdcc-3.1.0+dfsg/device/lib/acosf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/acosf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -13,7 +13,7 @@ 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 + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -31,11 +31,7 @@ #include #include -#ifndef BOOL -#define BOOL _Bool -#endif - -float asincosf(const float x, const BOOL isacos); +float asincosf(const float x, const bool isacos); float acosf(const float x) _FLOAT_FUNC_REENTRANT { diff -Nru sdcc-3.1.0+dfsg/device/lib/asincosf.c sdcc-3.2.0+dfsg/device/lib/asincosf.c --- sdcc-3.1.0+dfsg/device/lib/asincosf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/asincosf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -13,7 +13,7 @@ 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 + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -35,10 +35,6 @@ #include #include -#ifndef BOOL -#define BOOL _Bool -#endif - #define P1 0.933935835E+0 #define P2 -0.504400557E+0 #define Q0 0.560363004E+1 @@ -48,11 +44,11 @@ #define P(g) (P2 * g + P1) #define Q(g) ((Q2 * g + Q1) * g + Q0) -float asincosf(const float x, const BOOL isacos) +float asincosf(const float x, const bool isacos) { float y, g, r; unsigned char i; - BOOL quartPI = isacos; + bool quartPI = isacos; static const float a[2] = { 0.0, QUART_PI }; static const float b[2] = { HALF_PI, QUART_PI }; diff -Nru sdcc-3.1.0+dfsg/device/lib/asinf.c sdcc-3.2.0+dfsg/device/lib/asinf.c --- sdcc-3.1.0+dfsg/device/lib/asinf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/asinf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -13,7 +13,7 @@ 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 + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -31,11 +31,7 @@ #include #include -#ifndef BOOL -#define BOOL _Bool -#endif - -float asincosf(const float x, const BOOL isacos); +float asincosf(const float x, const bool isacos); float asinf(const float x) _FLOAT_FUNC_REENTRANT { diff -Nru sdcc-3.1.0+dfsg/device/lib/assert.c sdcc-3.2.0+dfsg/device/lib/assert.c --- sdcc-3.1.0+dfsg/device/lib/assert.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/assert.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/atan2f.c sdcc-3.2.0+dfsg/device/lib/atan2f.c --- sdcc-3.1.0+dfsg/device/lib/atan2f.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/atan2f.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/atanf.c sdcc-3.2.0+dfsg/device/lib/atanf.c --- sdcc-3.1.0+dfsg/device/lib/atanf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/atanf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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,1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -46,7 +46,7 @@ #define K2 0.7320508076 /* sqrt(3)-1 */ #define K3 1.7320508076 /* sqrt(3) */ -#ifdef SDCC_mcs51 +#ifdef __SDCC_mcs51 #define myconst __code #else #define myconst const diff -Nru sdcc-3.1.0+dfsg/device/lib/bpx.c sdcc-3.2.0+dfsg/device/lib/bpx.c --- sdcc-3.1.0+dfsg/device/lib/bpx.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/bpx.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -26,7 +26,7 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) __data unsigned char bpx ; #else __data unsigned int bpx ; diff -Nru sdcc-3.1.0+dfsg/device/lib/ceilf.c sdcc-3.2.0+dfsg/device/lib/ceilf.c --- sdcc-3.1.0+dfsg/device/lib/ceilf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/ceilf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/clean.mk sdcc-3.2.0+dfsg/device/lib/clean.mk --- sdcc-3.1.0+dfsg/device/lib/clean.mk 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/clean.mk 2012-05-29 07:51:36.000000000 +0000 @@ -1,4 +1,4 @@ -CLEANALLPORTS = ds390 ds400 gbz80 hc08 huge large mcs51 medium pic pic16 small z80 +CLEANALLPORTS = ds390 ds400 gbz80 hc08 s08 huge large mcs51 medium pic pic16 small z80 z180 r2k r3ka include $(srcdir)/incl.mk # Deleting all files created by building the program diff -Nru sdcc-3.1.0+dfsg/device/lib/cosf.c sdcc-3.2.0+dfsg/device/lib/cosf.c --- sdcc-3.1.0+dfsg/device/lib/cosf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/cosf.c 2012-03-13 10:17:10.000000000 +0000 @@ -1,11 +1,11 @@ /*------------------------------------------------------------------------- cosf.c - Computes cos(x) where x is a 32-bit float. - Copyright (C) 2001, 2002, Jesus Calvino-Fraga, jesusc@ieee.org + Copyright (C) 2001, 2002, Jesus Calvino-Fraga, jesusc@ieee.org This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -13,7 +13,7 @@ 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 + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -31,11 +31,7 @@ #include #include -#ifndef BOOL -#define BOOL _Bool -#endif - -float sincosf(const float x, const BOOL iscos); +float sincosf(const float x, const bool iscos); float cosf(const float x) _FLOAT_FUNC_REENTRANT { diff -Nru sdcc-3.1.0+dfsg/device/lib/coshf.c sdcc-3.2.0+dfsg/device/lib/coshf.c --- sdcc-3.1.0+dfsg/device/lib/coshf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/coshf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/cotf.c sdcc-3.2.0+dfsg/device/lib/cotf.c --- sdcc-3.1.0+dfsg/device/lib/cotf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/cotf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -13,7 +13,7 @@ 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 + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -32,11 +32,7 @@ #include #include -#ifndef BOOL -#define BOOL _Bool -#endif - -float tancotf(const float x, const BOOL iscotan); +float tancotf(const float x, const bool iscotan); float cotf(const float x) _FLOAT_FUNC_REENTRANT { diff -Nru sdcc-3.1.0+dfsg/device/lib/ds390/Makefile.in sdcc-3.2.0+dfsg/device/lib/ds390/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/ds390/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/ds390/Makefile.in 2012-02-10 10:16:50.000000000 +0000 @@ -1,19 +1,19 @@ +# libc/ds390 Makefile + VPATH = @srcdir@ srcdir = @srcdir@ top_builddir = @top_builddir@ -AR_S = @AR@ @AR_S_FLAG@ - -LIB_TYPE = @LIB_TYPE@ +LIB_TYPE = @LIB_TYPE@ -CC = ../../../bin/sdcc +CC = $(top_builddir)/bin/sdcc # override PORTDIR defined by super (parent) makefile override PORTDIR = ../build/ds390 #VERBOSE = --verbose -OBJECTS = tinibios.rel memcpyx.rel lcd390.rel i2c390.rel rtc390.rel putchar.rel gptr_cmp.rel +OBJECTS = tinibios.rel memcpyx.rel lcd390.rel i2c390.rel rtc390.rel putchar.rel gptr_cmp.rel SOURCES = $(patsubst %.rel,%.c,$(OBJECTS)) @@ -32,14 +32,13 @@ $(PORTDIR)/libds390.lib: $(OBJECTS) ifeq ($(LIB_TYPE), SDCCLIB) rm -f $@; \ - ../../../bin/sdcclib -a $@ $(OBJECTS) + $(top_builddir)/bin/sdcclib -a $@ $(OBJECTS) else ifeq ($(LIB_TYPE), AR) - $(AR_S) -cq $@ $(OBJECTS) + $(top_builddir)/bin/sdar -rcS $@ $(OBJECTS) else ifeq ($(LIB_TYPE), RANLIB) - $(AR_S) -cq $@ $(OBJECTS) - $(top_builddir)/bin/sdranlib $@ + $(top_builddir)/bin/sdar -rc $@ $(OBJECTS) else rm -f $@; for libfile in $(basename $(OBJECTS)); do echo $$libfile >>$@; done diff -Nru sdcc-3.1.0+dfsg/device/lib/ds390/gptr_cmp.c sdcc-3.2.0+dfsg/device/lib/ds390/gptr_cmp.c --- sdcc-3.1.0+dfsg/device/lib/ds390/gptr_cmp.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/ds390/gptr_cmp.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, @@ -26,7 +26,7 @@ ; might be covered by the GNU General Public License. ;------------------------------------------------------------------------*/ -#ifdef SDCC_MODEL_FLAT24 +#ifdef __SDCC_MODEL_FLAT24 static void dummy(void) __naked { @@ -95,3 +95,4 @@ } #endif + diff -Nru sdcc-3.1.0+dfsg/device/lib/ds390/i2c390.c sdcc-3.2.0+dfsg/device/lib/ds390/i2c390.c --- sdcc-3.1.0+dfsg/device/lib/ds390/i2c390.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/ds390/i2c390.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/ds390/lcd390.c sdcc-3.2.0+dfsg/device/lib/ds390/lcd390.c --- sdcc-3.1.0+dfsg/device/lib/ds390/lcd390.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/ds390/lcd390.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/ds390/memcpyx.c sdcc-3.2.0+dfsg/device/lib/ds390/memcpyx.c --- sdcc-3.1.0+dfsg/device/lib/ds390/memcpyx.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/ds390/memcpyx.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/ds390/putchar.c sdcc-3.2.0+dfsg/device/lib/ds390/putchar.c --- sdcc-3.1.0+dfsg/device/lib/ds390/putchar.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/ds390/putchar.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/ds390/rtc390.c sdcc-3.2.0+dfsg/device/lib/ds390/rtc390.c --- sdcc-3.1.0+dfsg/device/lib/ds390/rtc390.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/ds390/rtc390.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/ds390/tinibios.c sdcc-3.2.0+dfsg/device/lib/ds390/tinibios.c --- sdcc-3.1.0+dfsg/device/lib/ds390/tinibios.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/ds390/tinibios.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/ds400/Makefile.in sdcc-3.2.0+dfsg/device/lib/ds400/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/ds400/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/ds400/Makefile.in 2012-02-10 10:16:50.000000000 +0000 @@ -1,12 +1,12 @@ +# libc/ds400 Makefile + VPATH = @srcdir@ srcdir = @srcdir@ top_builddir = @top_builddir@ -AR_S = @AR@ @AR_S_FLAG@ - LIB_TYPE = @LIB_TYPE@ -CC = ../../../bin/sdcc +CC = $(top_builddir)/bin/sdcc # override PORTDIR defined by super (parent) makefile override PORTDIR = ../build/ds400 @@ -32,14 +32,13 @@ $(PORTDIR)/libds400.lib: $(OBJECTS) ifeq ($(LIB_TYPE), SDCCLIB) rm -f $@; \ - ../../../bin/sdcclib -a $@ $(OBJECTS) + $(top_builddir)/bin/sdcclib -a $@ $(OBJECTS) else ifeq ($(LIB_TYPE), AR) - $(AR_S) -cq $@ $(OBJECTS) + $(top_builddir)/bin/sdar -rcS $@ $(OBJECTS) else ifeq ($(LIB_TYPE), RANLIB) - $(AR_S) -cq $@ $(OBJECTS) - $(top_builddir)/bin/sdranlib $@ + $(top_builddir)/bin/sdar -rc $@ $(OBJECTS) else rm -f $@; for libfile in $(basename $(OBJECTS)); do echo $$libfile >>$@; done diff -Nru sdcc-3.1.0+dfsg/device/lib/ds400/ds400rom.c sdcc-3.2.0+dfsg/device/lib/ds400/ds400rom.c --- sdcc-3.1.0+dfsg/device/lib/ds400/ds400rom.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/ds400/ds400rom.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/ds400/memcpyx.c sdcc-3.2.0+dfsg/device/lib/ds400/memcpyx.c --- sdcc-3.1.0+dfsg/device/lib/ds400/memcpyx.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/ds400/memcpyx.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/ds400/tinibios.c sdcc-3.2.0+dfsg/device/lib/ds400/tinibios.c --- sdcc-3.1.0+dfsg/device/lib/ds400/tinibios.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/ds400/tinibios.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/errno.c sdcc-3.2.0+dfsg/device/lib/errno.c --- sdcc-3.1.0+dfsg/device/lib/errno.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/errno.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/expf.c sdcc-3.2.0+dfsg/device/lib/expf.c --- sdcc-3.1.0+dfsg/device/lib/expf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/expf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -13,7 +13,7 @@ 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 + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -31,18 +31,14 @@ /* Version 1.0 - Initial release */ -#define SDCC_MATH_LIB +#define __SDCC_MATH_LIB #include #include #include -#ifndef BOOL -#define BOOL _Bool -#endif - #ifdef MATH_ASM_MCS51 -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include // TODO: share with other temps @@ -336,7 +332,7 @@ { int n; float xn, g, r, z, y; - BOOL sign; + bool sign; if(x>=0.0) { y=x; sign=0; } diff -Nru sdcc-3.1.0+dfsg/device/lib/fabsf.c sdcc-3.2.0+dfsg/device/lib/fabsf.c --- sdcc-3.1.0+dfsg/device/lib/fabsf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/fabsf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/floorf.c sdcc-3.2.0+dfsg/device/lib/floorf.c --- sdcc-3.1.0+dfsg/device/lib/floorf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/floorf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/frexpf.c sdcc-3.2.0+dfsg/device/lib/frexpf.c --- sdcc-3.1.0+dfsg/device/lib/frexpf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/frexpf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/gbz80/Makefile.in sdcc-3.2.0+dfsg/device/lib/gbz80/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/gbz80/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/gbz80/Makefile.in 2012-04-02 09:59:13.000000000 +0000 @@ -4,14 +4,10 @@ srcdir = @srcdir@ top_builddir = @top_builddir@ -AR_S = @AR@ @AR_S_FLAG@ +LIB_TYPE = @LIB_TYPE@ -LIB_TYPE = @LIB_TYPE@ - -TOPDIR = ../../.. - -SCC = $(TOPDIR)/bin/sdcc -mgbz80 -SAS = $(TOPDIR)/bin/sdasgb +SCC = $(top_builddir)/bin/sdcc -mgbz80 +SAS = $(top_builddir)/bin/sdasgb # override PORTDIR defined by super (parent) makefile override PORTDIR = ../build/gbz80 @@ -26,6 +22,15 @@ _divulong.c \ _mullong.c +Z80_LONGLONG = $(COMMON_LONGLONG) \ + _rrulonglong.c \ + _rrslonglong.c \ + _rlulonglong.c \ + _rlslonglong.c \ + _mullonglong.c \ + _divslonglong.c \ + _divulonglong.c + Z80_SDCC = $(COMMON_SDCC) \ _itoa.c \ _ltoa.c \ @@ -35,8 +40,8 @@ _strlen.c \ _memmove.c -Z80SOURCES = $(addprefix ../,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_SDCC)) -Z8OBJECTS = $(patsubst %.c,%.rel,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_SDCC)) +Z80SOURCES = $(addprefix ../,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_LONGLONG) $(Z80_SDCC)) +Z8OBJECTS = $(patsubst %.c,%.rel,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_LONGLONG) $(Z80_SDCC)) OBJ = div.rel mul.rel \ putchar.rel shift.rel stubs.rel crt0_rle.rel heap.rel fstubs.rel crtcall.rel @@ -56,14 +61,13 @@ $(PORTDIR)/$(LIB): $(OBJ) $(Z8OBJECTS) Makefile ifeq ($(LIB_TYPE), SDCCLIB) rm -f $@; \ - ../../../bin/sdcclib -a $@ $(OBJ) $(Z8OBJECTS) + $(top_builddir)/bin/sdcclib -a $@ $(OBJ) $(Z8OBJECTS) else ifeq ($(LIB_TYPE), AR) - $(AR_S) -cq $@ $(OBJ) $(Z8OBJECTS) + $(top_builddir)/bin/sdar -rcS $@ $(OBJ) $(Z8OBJECTS) else ifeq ($(LIB_TYPE), RANLIB) - $(AR_S) -cq $@ $(OBJ) $(Z8OBJECTS) - $(top_builddir)/bin/sdranlib $@ + $(top_builddir)/bin/sdar -rc $@ $(OBJ) $(Z8OBJECTS) else rm -f $@; \ for i in $(basename $(OBJ) $(Z8OBJECTS)); do echo $$i >>$@; done diff -Nru sdcc-3.1.0+dfsg/device/lib/gbz80/crt0.s sdcc-3.2.0+dfsg/device/lib/gbz80/crt0.s --- sdcc-3.1.0+dfsg/device/lib/gbz80/crt0.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/gbz80/crt0.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/gbz80/crt0_rle.s sdcc-3.2.0+dfsg/device/lib/gbz80/crt0_rle.s --- sdcc-3.1.0+dfsg/device/lib/gbz80/crt0_rle.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/gbz80/crt0_rle.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/gbz80/crtcall.s sdcc-3.2.0+dfsg/device/lib/gbz80/crtcall.s --- sdcc-3.1.0+dfsg/device/lib/gbz80/crtcall.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/gbz80/crtcall.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/gbz80/div.s sdcc-3.2.0+dfsg/device/lib/gbz80/div.s --- sdcc-3.1.0+dfsg/device/lib/gbz80/div.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/gbz80/div.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/gbz80/fstubs.s sdcc-3.2.0+dfsg/device/lib/gbz80/fstubs.s --- sdcc-3.1.0+dfsg/device/lib/gbz80/fstubs.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/gbz80/fstubs.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/gbz80/heap.s sdcc-3.2.0+dfsg/device/lib/gbz80/heap.s --- sdcc-3.1.0+dfsg/device/lib/gbz80/heap.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/gbz80/heap.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/gbz80/mul.s sdcc-3.2.0+dfsg/device/lib/gbz80/mul.s --- sdcc-3.1.0+dfsg/device/lib/gbz80/mul.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/gbz80/mul.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/gbz80/putchar.s sdcc-3.2.0+dfsg/device/lib/gbz80/putchar.s --- sdcc-3.1.0+dfsg/device/lib/gbz80/putchar.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/gbz80/putchar.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/gbz80/shift.s sdcc-3.2.0+dfsg/device/lib/gbz80/shift.s --- sdcc-3.1.0+dfsg/device/lib/gbz80/shift.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/gbz80/shift.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/gbz80/stubs.s sdcc-3.2.0+dfsg/device/lib/gbz80/stubs.s --- sdcc-3.1.0+dfsg/device/lib/gbz80/stubs.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/gbz80/stubs.s 2012-04-02 09:59:13.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, @@ -29,28 +29,34 @@ ; Just stubs - not copyrightable ;; Stubs to match between function names - .area _CODE + .area _CODE .globl __mullong .globl __modslong .globl __modulong .globl __divslong .globl __divulong - .globl __divschar_rrx_s - .globl __divsint_rrx_s - .globl __divuchar_rrx_s - .globl __divuint_rrx_s - .globl __mulschar_rrx_s - .globl __muluchar_rrx_s - .globl __mulint_rrx_s - .globl __moduchar_rrx_s + .globl __divschar_rrx_s + .globl __divuchar_rrx_s + .globl __divsuchar_rrx_s + .globl __divuschar_rrx_s + .globl __divsint_rrx_s + .globl __divuint_rrx_s + .globl __mulschar_rrx_s + .globl __muluchar_rrx_s + .globl __mulsuchar_rrx_s + .globl __muluschar_rrx_s + .globl __mulint_rrx_s .globl __modschar_rrx_s + .globl __moduchar_rrx_s + .globl __modsuchar_rrx_s + .globl __moduschar_rrx_s .globl __moduint_rrx_s .globl __modsint_rrx_s - .globl __rrulong_rrx_s - .globl __rrslong_rrx_s - .globl __rlulong_rrx_s - .globl __rlslong_rrx_s + .globl __rrulong_rrx_s + .globl __rrslong_rrx_s + .globl __rlulong_rrx_s + .globl __rlslong_rrx_s __mullong_rrx_s:: __mullong_rrf_s:: @@ -75,74 +81,106 @@ __mulint_rrf_s:: ld a,#5 rst 0x08 - jp __mulint_rrx_s + jp __mulint_rrx_s __divsint_rrf_s:: ld a,#5 rst 0x08 - jp __divsint_rrx_s + jp __divsint_rrx_s __divuint_rrf_s:: ld a,#5 rst 0x08 - jp __divuint_rrx_s + jp __divuint_rrx_s __mulschar_rrf_s:: ld a,#5 rst 0x08 - jp __mulschar_rrx_s + jp __mulschar_rrx_s __divschar_rrf_s:: ld a,#5 rst 0x08 - jp __divschar_rrx_s + jp __divschar_rrx_s + +__modschar_rrf_s:: + ld a,#5 + rst 0x08 + jp __modschar_rrx_s __muluchar_rrf_s:: ld a,#5 rst 0x08 - jp __muluchar_rrx_s + jp __muluchar_rrx_s __divuchar_rrf_s:: ld a,#5 rst 0x08 - jp __divuchar_rrx_s + jp __divuchar_rrx_s -__modschar_rrf_s:: +__moduchar_rrf_s:: ld a,#5 rst 0x08 - jp __modschar_rrx_s + jp __moduchar_rrx_s -__moduchar_rrf_s:: +__mulsuchar_rrf_s:: + ld a,#5 + rst 0x08 + jp __mulsuchar_rrx_s + +__divsuchar_rrf_s:: + ld a,#5 + rst 0x08 + jp __divsuchar_rrx_s + +__modsuchar_rrf_s:: ld a,#5 rst 0x08 - jp __moduchar_rrx_s + jp __modsuchar_rrx_s + +__muluschar_rrf_s:: + ld a,#5 + rst 0x08 + jp __muluschar_rrx_s + +__divuschar_rrf_s:: + ld a,#5 + rst 0x08 + jp __divuschar_rrx_s + +__moduschar_rrf_s:: + ld a,#5 + rst 0x08 + jp __moduschar_rrx_s __modsint_rrf_s:: ld a,#5 rst 0x08 - jp __modsint_rrx_s + jp __modsint_rrx_s __moduint_rrf_s:: ld a,#5 rst 0x08 - jp __moduint_rrx_s + jp __moduint_rrx_s __rrulong_rrf_s:: ld a,#5 rst 0x08 - jp __rrulong_rrx_s + jp __rrulong_rrx_s __rrslong_rrf_s:: ld a,#5 rst 0x08 - jp __rrslong_rrx_s + jp __rrslong_rrx_s __rlulong_rrf_s:: ld a,#5 rst 0x08 - jp __rlulong_rrx_s + jp __rlulong_rrx_s __rlslong_rrf_s:: ld a,#5 rst 0x08 - jp __rlslong_rrx_s + jp __rlslong_rrx_s + + diff -Nru sdcc-3.1.0+dfsg/device/lib/gets.c sdcc-3.2.0+dfsg/device/lib/gets.c --- sdcc-3.1.0+dfsg/device/lib/gets.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/gets.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/hc08/Makefile.in sdcc-3.2.0+dfsg/device/lib/hc08/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/hc08/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/hc08/Makefile.in 2012-04-02 09:59:13.000000000 +0000 @@ -4,14 +4,10 @@ srcdir = @srcdir@ top_builddir = @top_builddir@ -AR_S = @AR@ @AR_S_FLAG@ +LIB_TYPE = @LIB_TYPE@ -LIB_TYPE = @LIB_TYPE@ - -TOPDIR = ../../.. - -SCC = $(TOPDIR)/bin/sdcc -mhc08 -SAS = $(TOPDIR)/bin/sdas6808 +SCC = $(top_builddir)/bin/sdcc -mhc08 +SAS = $(top_builddir)/bin/sdas6808 # override PORTDIR defined by super (parent) makefile override PORTDIR = ../build/hc08 @@ -27,6 +23,15 @@ HC08_LONG = $(COMMON_LONG) +HC08_LONGLONG = $(COMMON_LONGLONG) \ + _rrulonglong.c \ + _rrslonglong.c \ + _rlulonglong.c \ + _rlslonglong.c \ + _mullonglong.c \ + _divslonglong.c \ + _divulonglong.c + HC08_SDCC = $(COMMON_SDCC) \ _itoa.c \ _ltoa.c \ @@ -38,8 +43,8 @@ sprintf.c \ vprintf.c -HC08SOURCES = $(addprefix ../,$(HC08_FLOAT) $(HC08_INT) $(HC08_LONG) $(HC08_SDCC)) -HC08OBJECTS = $(patsubst %.c,%.rel,$(HC08_FLOAT) $(HC08_INT) $(HC08_LONG) $(HC08_SDCC)) +HC08SOURCES = $(addprefix ../,$(HC08_FLOAT) $(HC08_INT) $(HC08_LONG) $(HC08_LONGLONG) $(HC08_SDCC)) +HC08OBJECTS = $(patsubst %.c,%.rel,$(HC08_FLOAT) $(HC08_INT) $(HC08_LONG) $(HC08_LONGLONG) $(HC08_SDCC)) OBJ = _ret.rel _divuint.rel _divulong.rel _mulint.rel _mullong.rel @@ -55,14 +60,13 @@ $(PORTDIR)/$(LIB): $(OBJ) $(HC08OBJECTS) Makefile ifeq ($(LIB_TYPE), SDCCLIB) rm -f $@; \ - ../../../bin/sdcclib -a $@ $(OBJ) $(HC08OBJECTS) + $(top_builddir)/bin/sdcclib -a $@ $(OBJ) $(HC08OBJECTS) else ifeq ($(LIB_TYPE), AR) - $(AR_S) -cq $@ $(OBJ) $(HC08OBJECTS) + $(top_builddir)/bin/sdar -rcS $@ $(OBJ) $(HC08OBJECTS) else ifeq ($(LIB_TYPE), RANLIB) - $(AR_S) -cq $@ $(OBJ) $(HC08OBJECTS) - $(top_builddir)/bin/sdranlib $@ + $(top_builddir)/bin/sdar -rc $@ $(OBJ) $(HC08OBJECTS) else rm -f $@ for i in $(basename $(OBJ) $(HC08OBJECTS)); do echo $$i >>$@; done diff -Nru sdcc-3.1.0+dfsg/device/lib/hc08/_divuint.c sdcc-3.2.0+dfsg/device/lib/hc08/_divuint.c --- sdcc-3.1.0+dfsg/device/lib/hc08/_divuint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/hc08/_divuint.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/hc08/_divulong.c sdcc-3.2.0+dfsg/device/lib/hc08/_divulong.c --- sdcc-3.1.0+dfsg/device/lib/hc08/_divulong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/hc08/_divulong.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/hc08/_mulint.c sdcc-3.2.0+dfsg/device/lib/hc08/_mulint.c --- sdcc-3.1.0+dfsg/device/lib/hc08/_mulint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/hc08/_mulint.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -44,7 +44,7 @@ { a,b; /* reference to make compiler happy */ -#if !defined(SDCC_STACK_AUTO) +#if !defined(__SDCC_STACK_AUTO) __asm ais #-2 psha @@ -112,7 +112,7 @@ int _mulint (int a, int b) { -#if !defined(SDCC_STACK_AUTO) && (defined(SDCC_MODEL_LARGE) || defined(SDCC_ds390)) // still needed for large +#if !defined(__SDCC_STACK_AUTO) && (defined(__SDCC_MODEL_LARGE) || defined(__SDCC_ds390)) // still needed for large union uu __xdata *x; union uu __xdata *y; union uu t; @@ -135,3 +135,4 @@ #undef _MULINT_ASM + diff -Nru sdcc-3.1.0+dfsg/device/lib/hc08/_mullong.c sdcc-3.2.0+dfsg/device/lib/hc08/_mullong.c --- sdcc-3.1.0+dfsg/device/lib/hc08/_mullong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/hc08/_mullong.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/hc08/_ret.c sdcc-3.2.0+dfsg/device/lib/hc08/_ret.c --- sdcc-3.1.0+dfsg/device/lib/hc08/_ret.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/hc08/_ret.c 2012-04-02 09:59:13.000000000 +0000 @@ -2,10 +2,12 @@ _ret.c Copyright (C) 2003, Erik Petrich + Copyright (C) 2012, Philipp Klaus Krause + Considering how short this file is, it is probably not copyrightable, though. This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -26,5 +28,10 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ -__data unsigned char _ret2; -__data unsigned char _ret3; +__data unsigned char __SDCC_hc08_ret2; +__data unsigned char __SDCC_hc08_ret3; +__data unsigned char __SDCC_hc08_ret4; +__data unsigned char __SDCC_hc08_ret5; +__data unsigned char __SDCC_hc08_ret6; +__data unsigned char __SDCC_hc08_ret7; + diff -Nru sdcc-3.1.0+dfsg/device/lib/huge/Makefile.in sdcc-3.2.0+dfsg/device/lib/huge/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/huge/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/huge/Makefile.in 2012-02-10 10:16:50.000000000 +0000 @@ -1,3 +1,5 @@ +# libc/huge Makefile + all: $(MAKE) -C ../mcs51 all cp ../mcs51/*.rel . @@ -7,4 +9,4 @@ rm -f *.rel *.sym *.lst *.asm *~ *.lib distclean: clean - rm -f Makefile \ No newline at end of file + rm -f Makefile diff -Nru sdcc-3.1.0+dfsg/device/lib/labs.c sdcc-3.2.0+dfsg/device/lib/labs.c --- sdcc-3.1.0+dfsg/device/lib/labs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/labs.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -28,9 +28,9 @@ #include -#if defined (SDCC_mcs51) +#if defined (__SDCC_mcs51) -#if defined(SDCC) +#if defined(__SDCC) #include #endif diff -Nru sdcc-3.1.0+dfsg/device/lib/large/Makefile.in sdcc-3.2.0+dfsg/device/lib/large/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/large/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/large/Makefile.in 2012-02-10 10:16:50.000000000 +0000 @@ -1,3 +1,5 @@ +# libc/large Makefile + all: $(MAKE) -C ../mcs51 all cp ../mcs51/*.rel . @@ -7,4 +9,4 @@ rm -f *.rel *.sym *.lst *.asm *~ *.lib distclean: clean - rm -f Makefile \ No newline at end of file + rm -f Makefile diff -Nru sdcc-3.1.0+dfsg/device/lib/ldexpf.c sdcc-3.2.0+dfsg/device/lib/ldexpf.c --- sdcc-3.1.0+dfsg/device/lib/ldexpf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/ldexpf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/log10f.c sdcc-3.2.0+dfsg/device/lib/log10f.c --- sdcc-3.1.0+dfsg/device/lib/log10f.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/log10f.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/logf.c sdcc-3.2.0+dfsg/device/lib/logf.c --- sdcc-3.1.0+dfsg/device/lib/logf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/logf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -31,14 +31,14 @@ /* Version 1.0 - Initial release */ -#define SDCC_MATH_LIB +#define __SDCC_MATH_LIB #include #include #ifdef MATH_ASM_MCS51 -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include // TODO: share with other temps @@ -215,8 +215,8 @@ float logf(const float x) _FLOAT_FUNC_REENTRANT { -#if defined(SDCC_mcs51) && defined(SDCC_MODEL_SMALL) \ - && !defined(SDCC_NOOVERLAY) +#if defined(__SDCC_mcs51) && defined(__SDCC_MODEL_SMALL) \ + && !defined(__SDCC_NOOVERLAY) volatile #endif float Rz; diff -Nru sdcc-3.1.0+dfsg/device/lib/make51lib.bat sdcc-3.2.0+dfsg/device/lib/make51lib.bat --- sdcc-3.1.0+dfsg/device/lib/make51lib.bat 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/make51lib.bat 2012-01-24 23:50:33.000000000 +0000 @@ -1,37 +1,34 @@ -del small\*.lib -set SDCCLIB_CC=sdcc --use-stdout --model-small -c -sdcclib -l small\libfloat.lib libfloat.lib -sdcclib -l small\libint.lib libint.lib -sdcclib -l small\liblong.lib liblong.lib -sdcclib -l small\libsdcc.lib libsdcc.lib -cd mcs51 -@for %%I in (*.asm) do sdas8051 -plosgff %%I -@for %%I in (*.rel) do sdcclib ..\small\mcs51.lib %%I -cd.. -del *.rel *.sym *.asm *.lst *.adb +setlocal +set AR=ar +set RANLIB=sdranlib -del medium\*.lib -set SDCCLIB_CC=sdcc --use-stdout --model-medium -c -sdcclib -l medium\libfloat.lib libfloat.lib -sdcclib -l medium\libint.lib libint.lib -sdcclib -l medium\liblong.lib liblong.lib -sdcclib -l medium\libsdcc.lib libsdcc.lib -cd mcs51 -@for %%I in (*.asm) do sdas8051 -plosgff %%I -@for %%I in (*.rel) do sdcclib ..\medium\mcs51.lib %%I -cd.. -del *.rel *.sym *.asm *.lst *.adb +set REL_FLOAT=_atof.rel _schar2fs.rel _sint2fs.rel _slong2fs.rel _uchar2fs.rel _uint2fs.rel _ulong2fs.rel _fs2schar.rel _fs2sint.rel _fs2slong.rel _fs2uchar.rel _fs2uint.rel _fs2ulong.rel _fsadd.rel _fsdiv.rel _fsmul.rel _fssub.rel _fseq.rel _fsgt.rel _fslt.rel _fsneq.rel fabsf.rel frexpf.rel ldexpf.rel expf.rel powf.rel sincosf.rel sinf.rel cosf.rel logf.rel log10f.rel sqrtf.rel tancotf.rel tanf.rel cotf.rel asincosf.rel asinf.rel acosf.rel atanf.rel atan2f.rel sincoshf.rel sinhf.rel coshf.rel tanhf.rel floorf.rel ceilf.rel modff.rel errno.rel +set REL_LONG=_divslong.rel _modslong.rel _modulong.rel +set REL_SDCC=_atoi.rel _atol.rel abs.rel labs.rel rand.rel _iscntrl.rel _isdigit.rel _isgraph.rel _isprint.rel _ispunct.rel _isspace.rel _islower.rel _isupper.rel _isxdigit.rel _strcat.rel _strchr.rel _strcmp.rel _strcpy.rel _strcspn.rel _strncat.rel _strncmp.rel _strncpy.rel _strpbrk.rel _strrchr.rel _strspn.rel _strstr.rel _strtok.rel _memchr.rel _memcmp.rel _memcpy.rel _memset.rel _calloc.rel _malloc.rel _realloc.rel _free.rel printf_large.rel puts.rel gets.rel assert.rel time.rel -del large\*.lib -set SDCCLIB_CC=sdcc --use-stdout --model-large -DUSE_FLOATS -c -sdcclib -l large\libfloat.lib libfloat.lib -sdcclib -l large\libint.lib libint.lib -sdcclib -l large\liblong.lib liblong.lib -sdcclib -l large\libsdcc.lib libsdcc.lib -cd mcs51 -@for %%I in (*.asm) do sdas8051 -plosgff %%I -@for %%I in (*.rel) do sdcclib ..\large\mcs51.lib %%I -cd.. -del *.rel *.sym *.asm *.lst *.adb +set REL_FLOAT=%REL_FLOAT% _fscmp.rel _fsget1arg.rel _fsget2args.rel _fsnormalize.rel _fsreturnval.rel _fsrshift.rel _fsswapargs.rel _logexpf.rel +set REL_INT=%REL_INT% _divsint.rel _divuint.rel _modsint.rel _moduint.rel _mulint.rel +set REL_LONG=%REL_LONG% _divulong.rel _mullong.rel +set REL_SDCC=%REL_SDCC% _autobaud.rel _bp.rel _decdptr.rel _gptrget.rel _gptrgetc.rel _gptrput.rel _ser.rel _setjmp.rel serial.rel _itoa.rel _ltoa.rel _spx.rel _startup.rel _strlen.rel _memmove.rel _heap.rel sprintf.rel vprintf.rel printf_fast.rel printf_fast_f.rel printf_tiny.rel printfl.rel bpx.rel -set SDCCLIB_CC= \ No newline at end of file +set MODELS=small medium large + +for %%M in (%MODELS%) do ( + pushd %%M + del *.lib + set SDCCLIB_CC=sdcc --use-stdout --model-%%M -c + %AR% -S -cq libfloat.lib %REL_FLOAT% + %RANLIB% libfloat.lib + %AR% -S -cq libint.lib %REL_INT% + %RANLIB% libint.lib + %AR% -S -cq liblong.lib %REL_LONG% + %RANLIB% liblong.lib + %AR% -S -cq libsdcc.lib %REL_SDCC% + %RANLIB% libsdcc.lib + cd ..\mcs51 + for %%I in (*.asm) do sdas8051 -plosgff %%I + for %%I in (*.rel) do %AR% -S -cq ..\%%M\mcs51.lib %%I + %RANLIB% ..\%%M\mcs51.lib + popd +) +endlocal diff -Nru sdcc-3.1.0+dfsg/device/lib/mcs51/Makefile.in sdcc-3.2.0+dfsg/device/lib/mcs51/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/mcs51/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/mcs51/Makefile.in 2012-02-10 10:16:50.000000000 +0000 @@ -1,12 +1,12 @@ +# libc/mcs51 Makefile + VPATH = @srcdir@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -AR_S = @AR@ @AR_S_FLAG@ - -LIB_TYPE = @LIB_TYPE@ +LIB_TYPE = @LIB_TYPE@ SAS = $(top_builddir)/bin/sdas8051 SCC = $(top_builddir)/bin/sdcc @@ -31,14 +31,13 @@ $(PORTDIR)/$(LIB): $(OBJ) Makefile ifeq ($(LIB_TYPE), SDCCLIB) rm -f $@; \ - ../../../bin/sdcclib -a $@ $(OBJ) + $(top_builddir)/bin/sdcclib -a $@ $(OBJ) else ifeq ($(LIB_TYPE), AR) - $(AR_S) -cq $@ $(OBJ) + $(top_builddir)/bin/sdar -rcS $@ $(OBJ) else ifeq ($(LIB_TYPE), RANLIB) - $(AR_S) -cq $@ $(OBJ) - $(top_builddir)/bin/sdranlib $@ + $(top_builddir)/bin/sdar -rc $@ $(OBJ) else rm -f $@ for i in $(basename $(OBJ)); do echo $$i >>$@; done diff -Nru sdcc-3.1.0+dfsg/device/lib/mcs51/crtbank.asm sdcc-3.2.0+dfsg/device/lib/mcs51/crtbank.asm --- sdcc-3.1.0+dfsg/device/lib/mcs51/crtbank.asm 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/mcs51/crtbank.asm 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/mcs51/crtcall.asm sdcc-3.2.0+dfsg/device/lib/mcs51/crtcall.asm --- sdcc-3.1.0+dfsg/device/lib/mcs51/crtcall.asm 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/mcs51/crtcall.asm 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/mcs51/crtclear.asm sdcc-3.2.0+dfsg/device/lib/mcs51/crtclear.asm --- sdcc-3.1.0+dfsg/device/lib/mcs51/crtclear.asm 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/mcs51/crtclear.asm 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/mcs51/crtpagesfr.asm sdcc-3.2.0+dfsg/device/lib/mcs51/crtpagesfr.asm --- sdcc-3.1.0+dfsg/device/lib/mcs51/crtpagesfr.asm 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/mcs51/crtpagesfr.asm 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/mcs51/crtstart.asm sdcc-3.2.0+dfsg/device/lib/mcs51/crtstart.asm --- sdcc-3.1.0+dfsg/device/lib/mcs51/crtstart.asm 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/mcs51/crtstart.asm 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/mcs51/crtxclear.asm sdcc-3.2.0+dfsg/device/lib/mcs51/crtxclear.asm --- sdcc-3.1.0+dfsg/device/lib/mcs51/crtxclear.asm 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/mcs51/crtxclear.asm 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/mcs51/crtxinit.asm sdcc-3.2.0+dfsg/device/lib/mcs51/crtxinit.asm --- sdcc-3.1.0+dfsg/device/lib/mcs51/crtxinit.asm 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/mcs51/crtxinit.asm 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/mcs51/crtxpop.asm sdcc-3.2.0+dfsg/device/lib/mcs51/crtxpop.asm --- sdcc-3.1.0+dfsg/device/lib/mcs51/crtxpop.asm 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/mcs51/crtxpop.asm 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/mcs51/crtxpopr0.asm sdcc-3.2.0+dfsg/device/lib/mcs51/crtxpopr0.asm --- sdcc-3.1.0+dfsg/device/lib/mcs51/crtxpopr0.asm 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/mcs51/crtxpopr0.asm 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/mcs51/crtxpush.asm sdcc-3.2.0+dfsg/device/lib/mcs51/crtxpush.asm --- sdcc-3.1.0+dfsg/device/lib/mcs51/crtxpush.asm 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/mcs51/crtxpush.asm 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/mcs51/crtxpushr0.asm sdcc-3.2.0+dfsg/device/lib/mcs51/crtxpushr0.asm --- sdcc-3.1.0+dfsg/device/lib/mcs51/crtxpushr0.asm 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/mcs51/crtxpushr0.asm 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/mcs51/crtxstack.asm sdcc-3.2.0+dfsg/device/lib/mcs51/crtxstack.asm --- sdcc-3.1.0+dfsg/device/lib/mcs51/crtxstack.asm 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/mcs51/crtxstack.asm 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/mcs51/gptr_cmp.asm sdcc-3.2.0+dfsg/device/lib/mcs51/gptr_cmp.asm --- sdcc-3.1.0+dfsg/device/lib/mcs51/gptr_cmp.asm 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/mcs51/gptr_cmp.asm 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/medium/Makefile.in sdcc-3.2.0+dfsg/device/lib/medium/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/medium/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/medium/Makefile.in 2012-02-10 10:16:50.000000000 +0000 @@ -1,3 +1,5 @@ +# libc/medium Makefile + all: $(MAKE) -C ../mcs51 all cp ../mcs51/*.rel . @@ -7,4 +9,4 @@ rm -f *.rel *.sym *.lst *.asm *~ *.lib distclean: clean - rm -f Makefile \ No newline at end of file + rm -f Makefile diff -Nru sdcc-3.1.0+dfsg/device/lib/modff.c sdcc-3.2.0+dfsg/device/lib/modff.c --- sdcc-3.1.0+dfsg/device/lib/modff.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/modff.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/Makefile.am sdcc-3.2.0+dfsg/device/lib/pic14/Makefile.am --- sdcc-3.1.0+dfsg/device/lib/pic14/Makefile.am 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/Makefile.am 2012-01-20 17:19:33.000000000 +0000 @@ -1,10 +1,10 @@ ## Process this file with Automake to create Makefile.in -SUBDIRS = libm libsdcc/regular +SUBDIRS = libm libsdcc/regular libsdcc/enhanced if HAVE_NEW_PICS -SUBDIRS += libsdcc/enhanced +# add new pics subdirs here +SUBDIRS += endif include $(top_srcdir)/Makefile.common - diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/Makefile.in sdcc-3.2.0+dfsg/device/lib/pic14/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/pic14/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/Makefile.in 2012-07-06 09:07:10.000000000 +0000 @@ -31,7 +31,9 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -@HAVE_NEW_PICS_TRUE@am__append_1 = libsdcc/enhanced + +# add new pics subdirs here +@HAVE_NEW_PICS_TRUE@am__append_1 = DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/Makefile.common $(top_srcdir)/configure NEWS \ @@ -63,7 +65,7 @@ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = libm libsdcc/regular libsdcc/enhanced +DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -188,7 +190,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = libm libsdcc/regular $(am__append_1) +SUBDIRS = libm libsdcc/regular libsdcc/enhanced $(am__append_1) AM_CPPFLAGS = -I. -I$(top_srcdir)/../../include/pic14 \ -I$(top_srcdir)/../../non-free/include/pic14 #AM_CFLAGS += --asm="$(CCAS)" diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/TEMPLATE.S sdcc-3.2.0+dfsg/device/lib/pic14/TEMPLATE.S --- sdcc-3.1.0+dfsg/device/lib/pic14/TEMPLATE.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/TEMPLATE.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/TEMPLATE.c sdcc-3.2.0+dfsg/device/lib/pic14/TEMPLATE.c --- sdcc-3.1.0+dfsg/device/lib/pic14/TEMPLATE.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/TEMPLATE.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/aclocal.m4 sdcc-3.2.0+dfsg/device/lib/pic14/aclocal.m4 --- sdcc-3.1.0+dfsg/device/lib/pic14/aclocal.m4 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/aclocal.m4 2012-07-06 09:07:05.000000000 +0000 @@ -13,8 +13,8 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],, -[m4_warning([this file was generated for autoconf 2.67. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],, +[m4_warning([this file was generated for autoconf 2.63. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/autom4te.cache/output.0 sdcc-3.2.0+dfsg/device/lib/pic14/autom4te.cache/output.0 --- sdcc-3.1.0+dfsg/device/lib/pic14/autom4te.cache/output.0 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/autom4te.cache/output.0 2012-07-06 09:07:04.000000000 +0000 @@ -1325,7 +1325,7 @@ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-new-pics Enable use of PIC devices added to gputils after the - 0.13.7 release. Requires custom-built gputils + 0.14.1 release. Requires custom-built gputils obtained from their SVN repository! --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors @@ -2491,7 +2491,9 @@ ;; esac; +CFLAGS="" +CCASFLAGS="" LDFLAGS="-m -l -w" diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/autom4te.cache/output.1 sdcc-3.2.0+dfsg/device/lib/pic14/autom4te.cache/output.1 --- sdcc-3.1.0+dfsg/device/lib/pic14/autom4te.cache/output.1 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/autom4te.cache/output.1 2012-07-06 09:07:07.000000000 +0000 @@ -0,0 +1,4311 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.63 for pic14lib 0.1. +@%:@ +@%:@ Report bugs to . +@%:@ +@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +@%:@ 2002, 2003, 2004, 2005, 2006, 2007, 2008 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=: + # Pre-4.2 versions of Zsh do 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 + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +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.) +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 + $as_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. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# 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 || +$as_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=: + # Pre-4.2 versions of Zsh do 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=: + # Pre-4.2 versions of Zsh do 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 bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. +} + + + + 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" || + { $as_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 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + 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 +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 &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=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME='pic14lib' +PACKAGE_TARNAME='pic14lib' +PACKAGE_VERSION='0.1' +PACKAGE_STRING='pic14lib 0.1' +PACKAGE_BUGREPORT='tecodev AT users sourceforge net' + +ac_unique_file="libsdcc/idata.c" +ac_subst_vars='LTLIBOBJS +LIB@&t@OBJS +am__fastdepCCAS_FALSE +am__fastdepCCAS_TRUE +CCASDEPMODE +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +RANLIB +ARFLAGS +LDFLAGS +CCASFLAGS +CFLAGS +AR +LD +CCAS +CC +EARCH +ARCH +HAVE_NEW_PICS_FALSE +HAVE_NEW_PICS_TRUE +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_new_pics +enable_dependency_tracking +' + ac_precious_vars='build_alias +host_alias +target_alias' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# 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_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=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_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=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 ;; + + -*) { $as_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 && + { $as_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. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_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'` + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +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 + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { $as_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 + $as_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 .` || + { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { $as_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 -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + 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 .." + { $as_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" || { $as_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 pic14lib 0.1 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/pic14lib@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_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 +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of pic14lib 0.1:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-new-pics Enable use of PIC devices added to gputils after the + 0.14.1 release. Requires custom-built gputils + obtained from their SVN repository! + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Report bugs to . +_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" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && 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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_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 + $as_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 +pic14lib configure 0.1 +generated by GNU Autoconf 2.63 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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 pic14lib $as_me 0.1, which was +generated by GNU Autoconf 2.63. 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=. + $as_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=`$as_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_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $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=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_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=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_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 && + $as_echo "$as_me: caught signal $ac_signal" + $as_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 an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test -r "$ac_site_file"; then + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_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 + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_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,) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_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 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_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 + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_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.11' + +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 + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&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. + + +# 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. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + $as_echo_n "(cached) " >&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 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + +done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +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 +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$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' + +{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5 +$as_echo "$as_me: error: unsafe absolute working directory name" >&2;} + { (exit 1); exit 1; }; };; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5 +$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;} + { (exit 1); exit 1; }; };; +esac + +# 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". + { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +$as_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 + { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +$as_echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "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 $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# 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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + $as_echo_n "(cached) " >&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 { 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_STRIP="strip" + $as_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_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P 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. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +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 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:$LINENO: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_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 + $as_echo_n "(cached) " >&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 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "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 + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + fi +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='pic14lib' + VERSION='0.1' + + +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"} + +# 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" + + + +NEWPICS=no; +@%:@ Check whether --enable-new-pics was given. +if test "${enable_new_pics+set}" = set; then + enableval=$enable_new_pics; case "x$enableval" in + xyes) NEWPICS=yes; + { $as_echo "$as_me:$LINENO: Enabling support for PICs from unreleased gputils -- make sure you have up-to-date gputils from SVN." >&5 +$as_echo "$as_me: Enabling support for PICs from unreleased gputils -- make sure you have up-to-date gputils from SVN." >&6;};; + xno) NEWPICS=no;; + *) { { $as_echo "$as_me:$LINENO: error: bad value \"${enableval}\" for --enable-new-pics" >&5 +$as_echo "$as_me: error: bad value \"${enableval}\" for --enable-new-pics" >&2;} + { (exit 1); exit 1; }; };; + esac +else + NEWPICS=no + +fi + + + if test x$NEWPICS = xyes ; then + HAVE_NEW_PICS_TRUE= + HAVE_NEW_PICS_FALSE='#' +else + HAVE_NEW_PICS_TRUE='#' + HAVE_NEW_PICS_FALSE= +fi + + +# SDCC setup +case $srcdir in + \\/*|?:\\/*) abs_srcdir="$srcdir"; + ;; + *) abs_srcdir="$ac_pwd/$srcdir"; + ;; +esac +case $ac_top_build_prefix in + \\/*|?:\\/*) + abs_top_builddir="$ac_top_build_prefix"; + ;; + *) abs_top_builddir="$ac_pwd/$ac_top_build_prefix"; + ;; +esac + +libdir=$libdir/pic14 + +# Checks for programs. +# The default architectures (regular and enhanced cores) can be selected at +# configure time by setting the environment variables ARCH and/or EARCH to +# the desired device (16fxxx). +ARCH=${ARCH:-16f877} + +EARCH=${EARCH:-16f1934} + + +# We cannot use AC_PROG_CC(sdcc) as sdcc might not be built at configure-time... +CC=\'$abs_top_builddir/../../../bin/sdcc\' + +# Extract the first word of "gpasm", so it can be a program name with args. +set dummy gpasm; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_CCAS+set}" = set; then + $as_echo_n "(cached) " >&6 +else + case $CCAS in + [\\/]* | ?:[\\/]*) + ac_cv_path_CCAS="$CCAS" # Let the user override the test with a path. + ;; + *) + 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_path_CCAS="$as_dir/$ac_word$ac_exec_ext" + $as_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_path_CCAS" && ac_cv_path_CCAS=":" + ;; +esac +fi +CCAS=$ac_cv_path_CCAS +if test -n "$CCAS"; then + { $as_echo "$as_me:$LINENO: result: $CCAS" >&5 +$as_echo "$CCAS" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "gplink", so it can be a program name with args. +set dummy gplink; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_LD+set}" = set; then + $as_echo_n "(cached) " >&6 +else + case $LD in + [\\/]* | ?:[\\/]*) + ac_cv_path_LD="$LD" # Let the user override the test with a path. + ;; + *) + 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_path_LD="$as_dir/$ac_word$ac_exec_ext" + $as_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_path_LD" && ac_cv_path_LD=":" + ;; +esac +fi +LD=$ac_cv_path_LD +if test -n "$LD"; then + { $as_echo "$as_me:$LINENO: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "gplib", so it can be a program name with args. +set dummy gplib; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_AR+set}" = set; then + $as_echo_n "(cached) " >&6 +else + case $AR in + [\\/]* | ?:[\\/]*) + ac_cv_path_AR="$AR" # Let the user override the test with a path. + ;; + *) + 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_path_AR="$as_dir/$ac_word$ac_exec_ext" + $as_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_path_AR" && ac_cv_path_AR=":" + ;; +esac +fi +AR=$ac_cv_path_AR +if test -n "$AR"; then + { $as_echo "$as_me:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +case ":$CCAS:$LD:$AR:" in + *:::*) + { { $as_echo "$as_me:$LINENO: error: gputils (gpasm, gplink, and gplib) are required but not found. +Either install gputils or reconfigure with --disable-pic14-port and --disable-pic16-port." >&5 +$as_echo "$as_me: error: gputils (gpasm, gplink, and gplib) are required but not found. +Either install gputils or reconfigure with --disable-pic14-port and --disable-pic16-port." >&2;} + { (exit 1); exit 1; }; } + ;; +esac; + +CFLAGS="" + +CCASFLAGS="" + +LDFLAGS="-m -l -w" + +ARFLAGS="-c" + +CCAS=\'$CCAS\' + +LD=\'$LD\' + +AR=\'$AR\' + + +# $RANLIB is called by the autotools but not provided nor required +RANLIB=: + +OBJEXT=o + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +@%:@ Check whether --enable-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= + +{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + $as_echo_n "(cached) " >&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 + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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 +{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$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 + + + +depcc="$CCAS" am_compiler_list= + +{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CCAS_dependencies_compiler_type+set}" = set; then + $as_echo_n "(cached) " >&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_CCAS_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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_CCAS_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CCAS_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $am_cv_CCAS_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; } +CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then + am__fastdepCCAS_TRUE= + am__fastdepCCAS_FALSE='#' +else + am__fastdepCCAS_TRUE='#' + am__fastdepCCAS_FALSE= +fi + + + +# Checks for libraries. + +# Checks for header files. + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. + +ac_config_files="$ac_config_files Makefile libsdcc/enhanced/Makefile libsdcc/regular/Makefile libm/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, 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_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $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" && + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_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}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIB@&t@OBJS; 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=`$as_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 +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +if test -z "${HAVE_NEW_PICS_TRUE}" && test -z "${HAVE_NEW_PICS_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_NEW_PICS\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"HAVE_NEW_PICS\" 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 + { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_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 + { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_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 "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCCAS\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"am__fastdepCCAS\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +#! $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 || ac_write_fail=1 +## --------------------- ## +## 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=: + # Pre-4.2 versions of Zsh do 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 + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +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.) +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 + $as_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. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# 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 || +$as_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" || + { $as_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 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + 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 +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 pic14lib $as_me 0.1, which was +generated by GNU Autoconf 2.63. 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 + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTION]... [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet, --silent + 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 ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_version="\\ +pic14lib config.status 0.1 +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2008 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' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +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 ) + $as_echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { $as_echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + $as_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. + -*) { $as_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 || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "libsdcc/enhanced/Makefile") CONFIG_FILES="$CONFIG_FILES libsdcc/enhanced/Makefile" ;; + "libsdcc/regular/Makefile") CONFIG_FILES="$CONFIG_FILES libsdcc/regular/Makefile" ;; + "libm/Makefile") CONFIG_FILES="$CONFIG_FILES libm/Makefile" ;; + + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_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 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") +} || +{ + $as_echo "$as_me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=' ' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_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 +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } +_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 || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #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. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 +$as_echo "$as_me: error: could not setup config headers machinery" >&2;} + { (exit 1); exit 1; }; } +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_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 || + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; 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 '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; + 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 || +$as_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=`$as_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 || +$as_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" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_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 + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# 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= + +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + 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 || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;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 +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + +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"; } && + { $as_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 +$as_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 \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 +$as_echo "$as_me: error: could not create -" >&2;} + { (exit 1); exit 1; }; } + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_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=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + 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=`$as_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 || +$as_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" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + + esac +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + +# 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 +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/autom4te.cache/requests sdcc-3.2.0+dfsg/device/lib/pic14/autom4te.cache/requests --- sdcc-3.1.0+dfsg/device/lib/pic14/autom4te.cache/requests 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/autom4te.cache/requests 2012-07-06 09:07:18.000000000 +0000 @@ -11,29 +11,97 @@ ], [ '/home/sdcc-builder/local-cf-x86/share/autoconf/autoconf/autoconf.m4f', + '/usr/share/aclocal-1.11/amversion.m4', + '/usr/share/aclocal-1.11/auxdir.m4', + '/usr/share/aclocal-1.11/cond.m4', + '/usr/share/aclocal-1.11/depend.m4', + '/usr/share/aclocal-1.11/depout.m4', + '/usr/share/aclocal-1.11/init.m4', + '/usr/share/aclocal-1.11/install-sh.m4', + '/usr/share/aclocal-1.11/lead-dot.m4', + '/usr/share/aclocal-1.11/make.m4', + '/usr/share/aclocal-1.11/missing.m4', + '/usr/share/aclocal-1.11/mkdirp.m4', + '/usr/share/aclocal-1.11/options.m4', + '/usr/share/aclocal-1.11/runlog.m4', + '/usr/share/aclocal-1.11/sanity.m4', + '/usr/share/aclocal-1.11/silent.m4', + '/usr/share/aclocal-1.11/strip.m4', + '/usr/share/aclocal-1.11/substnot.m4', + '/usr/share/aclocal-1.11/tar.m4', + 'configure.in' + ], + { + 'm4_pattern_forbid' => 1, + 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + '_AM_SET_OPTION' => 1, + 'AC_DEFUN' => 1, + 'AM_PROG_MKDIR_P' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AM_MISSING_HAS_RUN' => 1, + 'AM_SUBST_NOTMAKE' => 1, + 'AM_MISSING_PROG' => 1, + 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AC_DEFUN_ONCE' => 1, + 'AM_PROG_INSTALL_STRIP' => 1, + '_m4_warn' => 1, + 'AM_SANITY_CHECK' => 1, + 'AM_SILENT_RULES' => 1, + 'include' => 1, + '_AM_PROG_TAR' => 1, + 'AM_AUX_DIR_EXPAND' => 1, + 'AM_DEP_TRACK' => 1, + '_AM_SET_OPTIONS' => 1, + '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AM_RUN_LOG' => 1, + '_AM_IF_OPTION' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'm4_pattern_allow' => 1, + '_AM_AUTOCONF_VERSION' => 1, + '_AM_MANGLE_OPTION' => 1, + 'AM_CONDITIONAL' => 1, + 'AM_SET_LEADING_DOT' => 1, + 'AM_SET_DEPDIR' => 1, + '_AM_DEPENDENCIES' => 1, + 'AM_PROG_INSTALL_SH' => 1, + 'm4_include' => 1, + '_AC_AM_CONFIG_HEADER_HOOK' => 1, + 'AU_DEFUN' => 1, + 'AM_MAKE_INCLUDE' => 1 + } + ], 'Autom4te::Request' ), + bless( [ + '1', + 1, + [ + '/home/sdcc-builder/local-cf-x86/share/autoconf' + ], + [ + '/home/sdcc-builder/local-cf-x86/share/autoconf/autoconf/autoconf.m4f', 'aclocal.m4', 'configure.in' ], { - '_LT_AC_TAGCONFIG' => 1, 'AM_PROG_F77_C_O' => 1, - 'AC_INIT' => 1, + '_LT_AC_TAGCONFIG' => 1, 'm4_pattern_forbid' => 1, - 'AC_CANONICAL_TARGET' => 1, + 'AC_INIT' => 1, '_AM_COND_IF' => 1, - 'AC_CONFIG_LIBOBJ_DIR' => 1, + 'AC_CANONICAL_TARGET' => 1, 'AC_SUBST' => 1, - 'AC_CANONICAL_HOST' => 1, + 'AC_CONFIG_LIBOBJ_DIR' => 1, 'AC_FC_SRCEXT' => 1, + 'AC_CANONICAL_HOST' => 1, 'AC_PROG_LIBTOOL' => 1, 'AM_INIT_AUTOMAKE' => 1, 'AC_CONFIG_SUBDIRS' => 1, 'AM_AUTOMAKE_VERSION' => 1, 'LT_CONFIG_LTDL_DIR' => 1, - 'AC_CONFIG_LINKS' => 1, 'AC_REQUIRE_AUX_FILE' => 1, - 'm4_sinclude' => 1, + 'AC_CONFIG_LINKS' => 1, 'LT_SUPPORTED_TAG' => 1, + 'm4_sinclude' => 1, 'AM_MAINTAINER_MODE' => 1, 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, '_m4_warn' => 1, @@ -46,17 +114,17 @@ 'include' => 1, 'AM_GNU_GETTEXT' => 1, 'AC_LIBSOURCE' => 1, - 'AC_CANONICAL_BUILD' => 1, 'AM_PROG_FC_C_O' => 1, + 'AC_CANONICAL_BUILD' => 1, 'AC_FC_FREEFORM' => 1, 'AH_OUTPUT' => 1, - 'AC_CONFIG_AUX_DIR' => 1, '_AM_SUBST_NOTMAKE' => 1, - 'AM_PROG_CC_C_O' => 1, - 'sinclude' => 1, + 'AC_CONFIG_AUX_DIR' => 1, 'm4_pattern_allow' => 1, - 'AM_CONDITIONAL' => 1, + 'sinclude' => 1, + 'AM_PROG_CC_C_O' => 1, 'AC_CANONICAL_SYSTEM' => 1, + 'AM_CONDITIONAL' => 1, 'AC_CONFIG_HEADERS' => 1, 'AC_DEFINE_TRACE_LITERAL' => 1, 'm4_include' => 1, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/autom4te.cache/traces.0 sdcc-3.2.0+dfsg/device/lib/pic14/autom4te.cache/traces.0 --- sdcc-3.1.0+dfsg/device/lib/pic14/autom4te.cache/traces.0 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/autom4te.cache/traces.0 2012-07-06 09:07:04.000000000 +0000 @@ -1,4 +1,579 @@ -m4trace:configure.in:18: -1- AC_INIT([pic14lib], [0.1], [tecodev AT users sourceforge net]) +m4trace:/usr/share/aclocal-1.11/amversion.m4:14: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) +m4trace:/usr/share/aclocal-1.11/amversion.m4:33: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) +m4trace:/usr/share/aclocal-1.11/auxdir.m4:47: -1- 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` +]) +m4trace:/usr/share/aclocal-1.11/cond.m4:15: -1- 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])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +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])]) +m4trace:/usr/share/aclocal-1.11/depend.m4:28: -1- 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], UPC, [depcc="$UPC" am_compiler_list=], + [$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 + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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]) +]) +m4trace:/usr/share/aclocal-1.11/depend.m4:163: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) +m4trace:/usr/share/aclocal-1.11/depend.m4:171: -1- 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])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) +m4trace:/usr/share/aclocal-1.11/depout.m4:14: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/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 +} +]) +m4trace:/usr/share/aclocal-1.11/depout.m4:75: -1- 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"]) +]) +m4trace:/usr/share/aclocal-1.11/init.m4:26: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])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 +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +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 +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])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) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +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 +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) +m4trace:/usr/share/aclocal-1.11/init.m4:126: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) +m4trace:/usr/share/aclocal-1.11/install-sh.m4:11: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) +m4trace:/usr/share/aclocal-1.11/lead-dot.m4:12: -1- 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])]) +m4trace:/usr/share/aclocal-1.11/make.m4:14: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.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 +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) +m4trace:/usr/share/aclocal-1.11/missing.m4:14: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) +m4trace:/usr/share/aclocal-1.11/missing.m4:24: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# 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 +]) +m4trace:/usr/share/aclocal-1.11/mkdirp.m4:11: -1- AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) +m4trace:/usr/share/aclocal-1.11/options.m4:13: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) +m4trace:/usr/share/aclocal-1.11/options.m4:19: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +m4trace:/usr/share/aclocal-1.11/options.m4:25: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +m4trace:/usr/share/aclocal-1.11/options.m4:31: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +m4trace:/usr/share/aclocal-1.11/runlog.m4:12: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) +m4trace:/usr/share/aclocal-1.11/sanity.m4:14: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# 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)]) +m4trace:/usr/share/aclocal-1.11/silent.m4:14: -1- AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], +[ --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0')]) +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) +m4trace:/usr/share/aclocal-1.11/strip.m4:17: -1- 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="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) +m4trace:/usr/share/aclocal-1.11/substnot.m4:14: -1- AC_DEFUN([_AM_SUBST_NOTMAKE]) +m4trace:/usr/share/aclocal-1.11/substnot.m4:19: -1- AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) +m4trace:/usr/share/aclocal-1.11/tar.m4:24: -1- 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 /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]) +]) m4trace:configure.in:18: -1- m4_pattern_forbid([^_?A[CHUM]_]) m4trace:configure.in:18: -1- m4_pattern_forbid([_AC_]) m4trace:configure.in:18: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) @@ -6,346 +581,173 @@ m4trace:configure.in:18: -1- m4_pattern_forbid([^_?m4_]) m4trace:configure.in:18: -1- m4_pattern_forbid([^dnl$]) m4trace:configure.in:18: -1- m4_pattern_forbid([^_?AS_]) -m4trace:configure.in:18: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([SHELL]) m4trace:configure.in:18: -1- m4_pattern_allow([^SHELL$]) -m4trace:configure.in:18: -1- AC_SUBST([PATH_SEPARATOR]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) m4trace:configure.in:18: -1- m4_pattern_allow([^PATH_SEPARATOR$]) -m4trace:configure.in:18: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([PACKAGE_NAME]) m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_NAME$]) -m4trace:configure.in:18: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) -m4trace:configure.in:18: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_VERSION$]) -m4trace:configure.in:18: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([PACKAGE_STRING]) m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_STRING$]) -m4trace:configure.in:18: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) -m4trace:configure.in:18: -1- AC_SUBST([exec_prefix], [NONE]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([exec_prefix]) m4trace:configure.in:18: -1- m4_pattern_allow([^exec_prefix$]) -m4trace:configure.in:18: -1- AC_SUBST([prefix], [NONE]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([prefix]) m4trace:configure.in:18: -1- m4_pattern_allow([^prefix$]) -m4trace:configure.in:18: -1- AC_SUBST([program_transform_name], [s,x,x,]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([program_transform_name]) m4trace:configure.in:18: -1- m4_pattern_allow([^program_transform_name$]) -m4trace:configure.in:18: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([bindir]) m4trace:configure.in:18: -1- m4_pattern_allow([^bindir$]) -m4trace:configure.in:18: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([sbindir]) m4trace:configure.in:18: -1- m4_pattern_allow([^sbindir$]) -m4trace:configure.in:18: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([libexecdir]) m4trace:configure.in:18: -1- m4_pattern_allow([^libexecdir$]) -m4trace:configure.in:18: -1- AC_SUBST([datarootdir], ['${prefix}/share']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([datarootdir]) m4trace:configure.in:18: -1- m4_pattern_allow([^datarootdir$]) -m4trace:configure.in:18: -1- AC_SUBST([datadir], ['${datarootdir}']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([datadir]) m4trace:configure.in:18: -1- m4_pattern_allow([^datadir$]) -m4trace:configure.in:18: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([sysconfdir]) m4trace:configure.in:18: -1- m4_pattern_allow([^sysconfdir$]) -m4trace:configure.in:18: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([sharedstatedir]) m4trace:configure.in:18: -1- m4_pattern_allow([^sharedstatedir$]) -m4trace:configure.in:18: -1- AC_SUBST([localstatedir], ['${prefix}/var']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([localstatedir]) m4trace:configure.in:18: -1- m4_pattern_allow([^localstatedir$]) -m4trace:configure.in:18: -1- AC_SUBST([includedir], ['${prefix}/include']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([includedir]) m4trace:configure.in:18: -1- m4_pattern_allow([^includedir$]) -m4trace:configure.in:18: -1- AC_SUBST([oldincludedir], ['/usr/include']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([oldincludedir]) m4trace:configure.in:18: -1- m4_pattern_allow([^oldincludedir$]) -m4trace:configure.in:18: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], - ['${datarootdir}/doc/${PACKAGE_TARNAME}'], - ['${datarootdir}/doc/${PACKAGE}'])]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([docdir]) m4trace:configure.in:18: -1- m4_pattern_allow([^docdir$]) -m4trace:configure.in:18: -1- AC_SUBST([infodir], ['${datarootdir}/info']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([infodir]) m4trace:configure.in:18: -1- m4_pattern_allow([^infodir$]) -m4trace:configure.in:18: -1- AC_SUBST([htmldir], ['${docdir}']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([htmldir]) m4trace:configure.in:18: -1- m4_pattern_allow([^htmldir$]) -m4trace:configure.in:18: -1- AC_SUBST([dvidir], ['${docdir}']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([dvidir]) m4trace:configure.in:18: -1- m4_pattern_allow([^dvidir$]) -m4trace:configure.in:18: -1- AC_SUBST([pdfdir], ['${docdir}']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([pdfdir]) m4trace:configure.in:18: -1- m4_pattern_allow([^pdfdir$]) -m4trace:configure.in:18: -1- AC_SUBST([psdir], ['${docdir}']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([psdir]) m4trace:configure.in:18: -1- m4_pattern_allow([^psdir$]) -m4trace:configure.in:18: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([libdir]) m4trace:configure.in:18: -1- m4_pattern_allow([^libdir$]) -m4trace:configure.in:18: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([localedir]) m4trace:configure.in:18: -1- m4_pattern_allow([^localedir$]) -m4trace:configure.in:18: -1- AC_SUBST([mandir], ['${datarootdir}/man']) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([mandir]) m4trace:configure.in:18: -1- m4_pattern_allow([^mandir$]) -m4trace:configure.in:18: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_NAME$]) -m4trace:configure.in:18: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ -#undef PACKAGE_NAME]) -m4trace:configure.in:18: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) -m4trace:configure.in:18: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME]) -m4trace:configure.in:18: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_VERSION$]) -m4trace:configure.in:18: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ -#undef PACKAGE_VERSION]) -m4trace:configure.in:18: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_STRING$]) -m4trace:configure.in:18: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING]) -m4trace:configure.in:18: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) -m4trace:configure.in:18: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT]) -m4trace:configure.in:18: -1- AC_SUBST([DEFS]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([DEFS]) m4trace:configure.in:18: -1- m4_pattern_allow([^DEFS$]) -m4trace:configure.in:18: -1- AC_SUBST([ECHO_C]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([ECHO_C]) m4trace:configure.in:18: -1- m4_pattern_allow([^ECHO_C$]) -m4trace:configure.in:18: -1- AC_SUBST([ECHO_N]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([ECHO_N]) m4trace:configure.in:18: -1- m4_pattern_allow([^ECHO_N$]) -m4trace:configure.in:18: -1- AC_SUBST([ECHO_T]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([ECHO_T]) m4trace:configure.in:18: -1- m4_pattern_allow([^ECHO_T$]) -m4trace:configure.in:18: -1- AC_SUBST([LIBS]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([LIBS]) m4trace:configure.in:18: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.in:18: -1- AC_SUBST([build_alias]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([build_alias]) m4trace:configure.in:18: -1- m4_pattern_allow([^build_alias$]) -m4trace:configure.in:18: -1- AC_SUBST([host_alias]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([host_alias]) m4trace:configure.in:18: -1- m4_pattern_allow([^host_alias$]) -m4trace:configure.in:18: -1- AC_SUBST([target_alias]) -m4trace:configure.in:18: -1- AC_SUBST_TRACE([target_alias]) m4trace:configure.in:18: -1- m4_pattern_allow([^target_alias$]) m4trace:configure.in:19: -1- AM_INIT_AUTOMAKE([foreign]) m4trace:configure.in:19: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.in:19: -1- AM_SET_CURRENT_AUTOMAKE_VERSION m4trace:configure.in:19: -1- AM_AUTOMAKE_VERSION([1.11.1]) -m4trace:configure.in:19: -1- AC_REQUIRE_AUX_FILE([install-sh]) -m4trace:configure.in:19: -1- AC_SUBST([INSTALL_PROGRAM]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) +m4trace:configure.in:19: -1- _AM_AUTOCONF_VERSION([2.63]) m4trace:configure.in:19: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) -m4trace:configure.in:19: -1- AC_SUBST([INSTALL_SCRIPT]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) m4trace:configure.in:19: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) -m4trace:configure.in:19: -1- AC_SUBST([INSTALL_DATA]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([INSTALL_DATA]) m4trace:configure.in:19: -1- m4_pattern_allow([^INSTALL_DATA$]) -m4trace:configure.in:19: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([am__isrc]) m4trace:configure.in:19: -1- m4_pattern_allow([^am__isrc$]) m4trace:configure.in:19: -1- _AM_SUBST_NOTMAKE([am__isrc]) -m4trace:configure.in:19: -1- AC_SUBST([CYGPATH_W]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([CYGPATH_W]) m4trace:configure.in:19: -1- m4_pattern_allow([^CYGPATH_W$]) -m4trace:configure.in:19: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME']) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([PACKAGE]) +m4trace:configure.in:19: -1- _AM_SET_OPTIONS([foreign]) +m4trace:configure.in:19: -1- _AM_SET_OPTION([foreign]) +m4trace:configure.in:19: -2- _AM_MANGLE_OPTION([foreign]) m4trace:configure.in:19: -1- m4_pattern_allow([^PACKAGE$]) -m4trace:configure.in:19: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION']) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([VERSION]) m4trace:configure.in:19: -1- m4_pattern_allow([^VERSION$]) -m4trace:configure.in:19: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) +m4trace:configure.in:19: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])]) +m4trace:configure.in:19: -2- _AM_MANGLE_OPTION([no-define]) m4trace:configure.in:19: -1- m4_pattern_allow([^PACKAGE$]) -m4trace:configure.in:19: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ -#undef PACKAGE]) -m4trace:configure.in:19: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) m4trace:configure.in:19: -1- m4_pattern_allow([^VERSION$]) -m4trace:configure.in:19: -1- AH_OUTPUT([VERSION], [/* Version number of package */ -#undef VERSION]) -m4trace:configure.in:19: -1- AC_REQUIRE_AUX_FILE([missing]) -m4trace:configure.in:19: -1- AC_SUBST([ACLOCAL]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([ACLOCAL]) +m4trace:configure.in:19: -1- AM_SANITY_CHECK +m4trace:configure.in:19: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +m4trace:configure.in:19: -1- AM_MISSING_HAS_RUN +m4trace:configure.in:19: -1- AM_AUX_DIR_EXPAND m4trace:configure.in:19: -1- m4_pattern_allow([^ACLOCAL$]) -m4trace:configure.in:19: -1- AC_SUBST([AUTOCONF]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([AUTOCONF]) +m4trace:configure.in:19: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) m4trace:configure.in:19: -1- m4_pattern_allow([^AUTOCONF$]) -m4trace:configure.in:19: -1- AC_SUBST([AUTOMAKE]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([AUTOMAKE]) +m4trace:configure.in:19: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) m4trace:configure.in:19: -1- m4_pattern_allow([^AUTOMAKE$]) -m4trace:configure.in:19: -1- AC_SUBST([AUTOHEADER]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([AUTOHEADER]) +m4trace:configure.in:19: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) m4trace:configure.in:19: -1- m4_pattern_allow([^AUTOHEADER$]) -m4trace:configure.in:19: -1- AC_SUBST([MAKEINFO]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([MAKEINFO]) +m4trace:configure.in:19: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) m4trace:configure.in:19: -1- m4_pattern_allow([^MAKEINFO$]) -m4trace:configure.in:19: -1- AC_SUBST([install_sh]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([install_sh]) +m4trace:configure.in:19: -1- AM_PROG_INSTALL_SH m4trace:configure.in:19: -1- m4_pattern_allow([^install_sh$]) -m4trace:configure.in:19: -1- AC_SUBST([STRIP]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.in:19: -1- AM_PROG_INSTALL_STRIP m4trace:configure.in:19: -1- m4_pattern_allow([^STRIP$]) -m4trace:configure.in:19: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) m4trace:configure.in:19: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) -m4trace:configure.in:19: -1- AC_REQUIRE_AUX_FILE([install-sh]) -m4trace:configure.in:19: -1- AC_SUBST([MKDIR_P]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.in:19: -1- AM_PROG_MKDIR_P m4trace:configure.in:19: -1- m4_pattern_allow([^MKDIR_P$]) -m4trace:configure.in:19: -1- AC_SUBST([mkdir_p], ["$MKDIR_P"]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([mkdir_p]) m4trace:configure.in:19: -1- m4_pattern_allow([^mkdir_p$]) -m4trace:configure.in:19: -1- AC_SUBST([AWK]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([AWK]) m4trace:configure.in:19: -1- m4_pattern_allow([^AWK$]) -m4trace:configure.in:19: -1- AC_SUBST([SET_MAKE]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([SET_MAKE]) m4trace:configure.in:19: -1- m4_pattern_allow([^SET_MAKE$]) -m4trace:configure.in:19: -1- AC_SUBST([am__leading_dot]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([am__leading_dot]) +m4trace:configure.in:19: -1- AM_SET_LEADING_DOT m4trace:configure.in:19: -1- m4_pattern_allow([^am__leading_dot$]) -m4trace:configure.in:19: -1- AC_SUBST([AMTAR]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([AMTAR]) +m4trace:configure.in:19: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +m4trace:configure.in:19: -2- _AM_MANGLE_OPTION([tar-ustar]) +m4trace:configure.in:19: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) +m4trace:configure.in:19: -2- _AM_MANGLE_OPTION([tar-pax]) +m4trace:configure.in:19: -1- _AM_PROG_TAR([v7]) +m4trace:configure.in:19: -1- AM_MISSING_PROG([AMTAR], [tar]) m4trace:configure.in:19: -1- m4_pattern_allow([^AMTAR$]) -m4trace:configure.in:19: -1- AC_SUBST([am__tar]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([am__tar]) m4trace:configure.in:19: -1- m4_pattern_allow([^am__tar$]) -m4trace:configure.in:19: -1- AC_SUBST([am__untar]) -m4trace:configure.in:19: -1- AC_SUBST_TRACE([am__untar]) m4trace:configure.in:19: -1- m4_pattern_allow([^am__untar$]) -m4trace:configure.in:21: -1- AC_CONFIG_HEADERS([config.h]) +m4trace:configure.in:19: -1- _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 +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +m4trace:configure.in:19: -2- _AM_MANGLE_OPTION([no-dependencies]) +m4trace:configure.in:19: -1- _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])]) +m4trace:configure.in:19: -2- _AM_MANGLE_OPTION([silent-rules]) m4trace:configure.in:37: -1- AM_CONDITIONAL([HAVE_NEW_PICS], [ test x$NEWPICS = xyes ]) -m4trace:configure.in:37: -1- AC_SUBST([HAVE_NEW_PICS_TRUE]) -m4trace:configure.in:37: -1- AC_SUBST_TRACE([HAVE_NEW_PICS_TRUE]) m4trace:configure.in:37: -1- m4_pattern_allow([^HAVE_NEW_PICS_TRUE$]) -m4trace:configure.in:37: -1- AC_SUBST([HAVE_NEW_PICS_FALSE]) -m4trace:configure.in:37: -1- AC_SUBST_TRACE([HAVE_NEW_PICS_FALSE]) m4trace:configure.in:37: -1- m4_pattern_allow([^HAVE_NEW_PICS_FALSE$]) m4trace:configure.in:37: -1- _AM_SUBST_NOTMAKE([HAVE_NEW_PICS_TRUE]) m4trace:configure.in:37: -1- _AM_SUBST_NOTMAKE([HAVE_NEW_PICS_FALSE]) -m4trace:configure.in:60: -1- AC_SUBST([ARCH], [${ARCH:-16f877}]) -m4trace:configure.in:60: -1- AC_SUBST_TRACE([ARCH]) m4trace:configure.in:60: -1- m4_pattern_allow([^ARCH$]) -m4trace:configure.in:61: -1- AC_SUBST([EARCH], [${EARCH:-16f1934}]) -m4trace:configure.in:61: -1- AC_SUBST_TRACE([EARCH]) m4trace:configure.in:61: -1- m4_pattern_allow([^EARCH$]) -m4trace:configure.in:64: -1- AC_SUBST([CC], [\'$abs_top_builddir/../../../bin/sdcc\']) -m4trace:configure.in:64: -1- AC_SUBST_TRACE([CC]) m4trace:configure.in:64: -1- m4_pattern_allow([^CC$]) -m4trace:configure.in:65: -1- AC_SUBST([CCAS]) -m4trace:configure.in:65: -1- AC_SUBST_TRACE([CCAS]) m4trace:configure.in:65: -1- m4_pattern_allow([^CCAS$]) -m4trace:configure.in:66: -1- AC_SUBST([LD]) -m4trace:configure.in:66: -1- AC_SUBST_TRACE([LD]) m4trace:configure.in:66: -1- m4_pattern_allow([^LD$]) -m4trace:configure.in:67: -1- AC_SUBST([AR]) -m4trace:configure.in:67: -1- AC_SUBST_TRACE([AR]) m4trace:configure.in:67: -1- m4_pattern_allow([^AR$]) -m4trace:configure.in:76: -1- AC_SUBST([CFLAGS], []) -m4trace:configure.in:76: -1- AC_SUBST_TRACE([CFLAGS]) m4trace:configure.in:76: -1- m4_pattern_allow([^CFLAGS$]) -m4trace:configure.in:77: -1- AC_SUBST([CCASFLAGS], []) -m4trace:configure.in:77: -1- AC_SUBST_TRACE([CCASFLAGS]) m4trace:configure.in:77: -1- m4_pattern_allow([^CCASFLAGS$]) -m4trace:configure.in:78: -1- AC_SUBST([LDFLAGS], ["-m -l -w"]) -m4trace:configure.in:78: -1- AC_SUBST_TRACE([LDFLAGS]) m4trace:configure.in:78: -1- m4_pattern_allow([^LDFLAGS$]) -m4trace:configure.in:79: -1- AC_SUBST([ARFLAGS], ["-c"]) -m4trace:configure.in:79: -1- AC_SUBST_TRACE([ARFLAGS]) m4trace:configure.in:79: -1- m4_pattern_allow([^ARFLAGS$]) -m4trace:configure.in:80: -1- AC_SUBST([CCAS], [\'$CCAS\']) -m4trace:configure.in:80: -1- AC_SUBST_TRACE([CCAS]) m4trace:configure.in:80: -1- m4_pattern_allow([^CCAS$]) -m4trace:configure.in:81: -1- AC_SUBST([LD], [\'$LD\']) -m4trace:configure.in:81: -1- AC_SUBST_TRACE([LD]) m4trace:configure.in:81: -1- m4_pattern_allow([^LD$]) -m4trace:configure.in:82: -1- AC_SUBST([AR], [\'$AR\']) -m4trace:configure.in:82: -1- AC_SUBST_TRACE([AR]) m4trace:configure.in:82: -1- m4_pattern_allow([^AR$]) -m4trace:configure.in:85: -1- AC_SUBST([RANLIB], [:]) -m4trace:configure.in:85: -1- AC_SUBST_TRACE([RANLIB]) m4trace:configure.in:85: -1- m4_pattern_allow([^RANLIB$]) -m4trace:configure.in:86: -1- AC_SUBST([OBJEXT], [o]) -m4trace:configure.in:86: -1- AC_SUBST_TRACE([OBJEXT]) m4trace:configure.in:86: -1- m4_pattern_allow([^OBJEXT$]) -m4trace:configure.in:88: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) -m4trace:configure.in:88: -1- AC_SUBST_TRACE([DEPDIR]) +m4trace:configure.in:88: -1- _AM_DEPENDENCIES([CC]) +m4trace:configure.in:88: -1- AM_SET_DEPDIR m4trace:configure.in:88: -1- m4_pattern_allow([^DEPDIR$]) -m4trace:configure.in:88: -1- AC_SUBST([am__include]) -m4trace:configure.in:88: -1- AC_SUBST_TRACE([am__include]) +m4trace:configure.in:88: -1- AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.in:88: -1- AM_MAKE_INCLUDE m4trace:configure.in:88: -1- m4_pattern_allow([^am__include$]) -m4trace:configure.in:88: -1- AC_SUBST([am__quote]) -m4trace:configure.in:88: -1- AC_SUBST_TRACE([am__quote]) m4trace:configure.in:88: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.in:88: -1- AM_DEP_TRACK m4trace:configure.in:88: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -m4trace:configure.in:88: -1- AC_SUBST([AMDEP_TRUE]) -m4trace:configure.in:88: -1- AC_SUBST_TRACE([AMDEP_TRUE]) m4trace:configure.in:88: -1- m4_pattern_allow([^AMDEP_TRUE$]) -m4trace:configure.in:88: -1- AC_SUBST([AMDEP_FALSE]) -m4trace:configure.in:88: -1- AC_SUBST_TRACE([AMDEP_FALSE]) m4trace:configure.in:88: -1- m4_pattern_allow([^AMDEP_FALSE$]) m4trace:configure.in:88: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) m4trace:configure.in:88: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) -m4trace:configure.in:88: -1- AC_SUBST([AMDEPBACKSLASH]) -m4trace:configure.in:88: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) m4trace:configure.in:88: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) m4trace:configure.in:88: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) -m4trace:configure.in:88: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) -m4trace:configure.in:88: -1- AC_SUBST_TRACE([CCDEPMODE]) m4trace:configure.in:88: -1- m4_pattern_allow([^CCDEPMODE$]) m4trace:configure.in:88: -1- AM_CONDITIONAL([am__fastdepCC], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) -m4trace:configure.in:88: -1- AC_SUBST([am__fastdepCC_TRUE]) -m4trace:configure.in:88: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) m4trace:configure.in:88: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) -m4trace:configure.in:88: -1- AC_SUBST([am__fastdepCC_FALSE]) -m4trace:configure.in:88: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) m4trace:configure.in:88: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) m4trace:configure.in:88: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) m4trace:configure.in:88: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) -m4trace:configure.in:89: -1- AC_SUBST([CCASDEPMODE], [depmode=$am_cv_CCAS_dependencies_compiler_type]) -m4trace:configure.in:89: -1- AC_SUBST_TRACE([CCASDEPMODE]) +m4trace:configure.in:89: -1- _AM_DEPENDENCIES([CCAS]) m4trace:configure.in:89: -1- m4_pattern_allow([^CCASDEPMODE$]) m4trace:configure.in:89: -1- AM_CONDITIONAL([am__fastdepCCAS], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3]) -m4trace:configure.in:89: -1- AC_SUBST([am__fastdepCCAS_TRUE]) -m4trace:configure.in:89: -1- AC_SUBST_TRACE([am__fastdepCCAS_TRUE]) m4trace:configure.in:89: -1- m4_pattern_allow([^am__fastdepCCAS_TRUE$]) -m4trace:configure.in:89: -1- AC_SUBST([am__fastdepCCAS_FALSE]) -m4trace:configure.in:89: -1- AC_SUBST_TRACE([am__fastdepCCAS_FALSE]) m4trace:configure.in:89: -1- m4_pattern_allow([^am__fastdepCCAS_FALSE$]) m4trace:configure.in:89: -1- _AM_SUBST_NOTMAKE([am__fastdepCCAS_TRUE]) m4trace:configure.in:89: -1- _AM_SUBST_NOTMAKE([am__fastdepCCAS_FALSE]) -m4trace:configure.in:99: -1- AC_CONFIG_FILES([Makefile - libsdcc/enhanced/Makefile - libsdcc/regular/Makefile - libm/Makefile]) -m4trace:configure.in:103: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) -m4trace:configure.in:103: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) m4trace:configure.in:103: -1- m4_pattern_allow([^LIB@&t@OBJS$]) -m4trace:configure.in:103: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) -m4trace:configure.in:103: -1- AC_SUBST_TRACE([LTLIBOBJS]) m4trace:configure.in:103: -1- m4_pattern_allow([^LTLIBOBJS$]) -m4trace:configure.in:103: -1- AC_SUBST_TRACE([top_builddir]) -m4trace:configure.in:103: -1- AC_SUBST_TRACE([top_build_prefix]) -m4trace:configure.in:103: -1- AC_SUBST_TRACE([srcdir]) -m4trace:configure.in:103: -1- AC_SUBST_TRACE([abs_srcdir]) -m4trace:configure.in:103: -1- AC_SUBST_TRACE([top_srcdir]) -m4trace:configure.in:103: -1- AC_SUBST_TRACE([abs_top_srcdir]) -m4trace:configure.in:103: -1- AC_SUBST_TRACE([builddir]) -m4trace:configure.in:103: -1- AC_SUBST_TRACE([abs_builddir]) -m4trace:configure.in:103: -1- AC_SUBST_TRACE([abs_top_builddir]) -m4trace:configure.in:103: -1- AC_SUBST_TRACE([INSTALL]) -m4trace:configure.in:103: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.in:103: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"]) +m4trace:configure.in:103: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/autom4te.cache/traces.1 sdcc-3.2.0+dfsg/device/lib/pic14/autom4te.cache/traces.1 --- sdcc-3.1.0+dfsg/device/lib/pic14/autom4te.cache/traces.1 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/autom4te.cache/traces.1 2012-07-06 09:07:07.000000000 +0000 @@ -0,0 +1,351 @@ +m4trace:configure.in:18: -1- AC_INIT([pic14lib], [0.1], [tecodev AT users sourceforge net]) +m4trace:configure.in:18: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.in:18: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.in:18: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.in:18: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.in:18: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.in:18: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.in:18: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.in:18: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([SHELL]) +m4trace:configure.in:18: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.in:18: -1- AC_SUBST([PATH_SEPARATOR]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) +m4trace:configure.in:18: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.in:18: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([PACKAGE_NAME]) +m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.in:18: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) +m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.in:18: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) +m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.in:18: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([PACKAGE_STRING]) +m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.in:18: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) +m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.in:18: -1- AC_SUBST([exec_prefix], [NONE]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([exec_prefix]) +m4trace:configure.in:18: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.in:18: -1- AC_SUBST([prefix], [NONE]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([prefix]) +m4trace:configure.in:18: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.in:18: -1- AC_SUBST([program_transform_name], [s,x,x,]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([program_transform_name]) +m4trace:configure.in:18: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.in:18: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([bindir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.in:18: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([sbindir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.in:18: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([libexecdir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.in:18: -1- AC_SUBST([datarootdir], ['${prefix}/share']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([datarootdir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.in:18: -1- AC_SUBST([datadir], ['${datarootdir}']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([datadir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.in:18: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([sysconfdir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.in:18: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([sharedstatedir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.in:18: -1- AC_SUBST([localstatedir], ['${prefix}/var']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([localstatedir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.in:18: -1- AC_SUBST([includedir], ['${prefix}/include']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([includedir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.in:18: -1- AC_SUBST([oldincludedir], ['/usr/include']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([oldincludedir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.in:18: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([docdir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.in:18: -1- AC_SUBST([infodir], ['${datarootdir}/info']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([infodir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.in:18: -1- AC_SUBST([htmldir], ['${docdir}']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([htmldir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.in:18: -1- AC_SUBST([dvidir], ['${docdir}']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([dvidir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.in:18: -1- AC_SUBST([pdfdir], ['${docdir}']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([pdfdir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.in:18: -1- AC_SUBST([psdir], ['${docdir}']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([psdir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.in:18: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([libdir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.in:18: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.in:18: -1- AC_SUBST([mandir], ['${datarootdir}/man']) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([mandir]) +m4trace:configure.in:18: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.in:18: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) +m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.in:18: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ +#undef PACKAGE_NAME]) +m4trace:configure.in:18: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) +m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.in:18: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME]) +m4trace:configure.in:18: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) +m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.in:18: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ +#undef PACKAGE_VERSION]) +m4trace:configure.in:18: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) +m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.in:18: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING]) +m4trace:configure.in:18: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) +m4trace:configure.in:18: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.in:18: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT]) +m4trace:configure.in:18: -1- AC_SUBST([DEFS]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([DEFS]) +m4trace:configure.in:18: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.in:18: -1- AC_SUBST([ECHO_C]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([ECHO_C]) +m4trace:configure.in:18: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.in:18: -1- AC_SUBST([ECHO_N]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([ECHO_N]) +m4trace:configure.in:18: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.in:18: -1- AC_SUBST([ECHO_T]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([ECHO_T]) +m4trace:configure.in:18: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.in:18: -1- AC_SUBST([LIBS]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.in:18: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.in:18: -1- AC_SUBST([build_alias]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([build_alias]) +m4trace:configure.in:18: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.in:18: -1- AC_SUBST([host_alias]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([host_alias]) +m4trace:configure.in:18: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.in:18: -1- AC_SUBST([target_alias]) +m4trace:configure.in:18: -1- AC_SUBST_TRACE([target_alias]) +m4trace:configure.in:18: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.in:19: -1- AM_INIT_AUTOMAKE([foreign]) +m4trace:configure.in:19: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.in:19: -1- AM_AUTOMAKE_VERSION([1.11.1]) +m4trace:configure.in:19: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.in:19: -1- AC_SUBST([INSTALL_PROGRAM]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) +m4trace:configure.in:19: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.in:19: -1- AC_SUBST([INSTALL_SCRIPT]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) +m4trace:configure.in:19: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.in:19: -1- AC_SUBST([INSTALL_DATA]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([INSTALL_DATA]) +m4trace:configure.in:19: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.in:19: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([am__isrc]) +m4trace:configure.in:19: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.in:19: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.in:19: -1- AC_SUBST([CYGPATH_W]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([CYGPATH_W]) +m4trace:configure.in:19: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.in:19: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME']) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([PACKAGE]) +m4trace:configure.in:19: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.in:19: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION']) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([VERSION]) +m4trace:configure.in:19: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.in:19: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) +m4trace:configure.in:19: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.in:19: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ +#undef PACKAGE]) +m4trace:configure.in:19: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) +m4trace:configure.in:19: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.in:19: -1- AH_OUTPUT([VERSION], [/* Version number of package */ +#undef VERSION]) +m4trace:configure.in:19: -1- AC_REQUIRE_AUX_FILE([missing]) +m4trace:configure.in:19: -1- AC_SUBST([ACLOCAL]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([ACLOCAL]) +m4trace:configure.in:19: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.in:19: -1- AC_SUBST([AUTOCONF]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([AUTOCONF]) +m4trace:configure.in:19: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.in:19: -1- AC_SUBST([AUTOMAKE]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([AUTOMAKE]) +m4trace:configure.in:19: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.in:19: -1- AC_SUBST([AUTOHEADER]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([AUTOHEADER]) +m4trace:configure.in:19: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.in:19: -1- AC_SUBST([MAKEINFO]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([MAKEINFO]) +m4trace:configure.in:19: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.in:19: -1- AC_SUBST([install_sh]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([install_sh]) +m4trace:configure.in:19: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.in:19: -1- AC_SUBST([STRIP]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.in:19: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.in:19: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) +m4trace:configure.in:19: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.in:19: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.in:19: -1- AC_SUBST([MKDIR_P]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.in:19: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.in:19: -1- AC_SUBST([mkdir_p], ["$MKDIR_P"]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([mkdir_p]) +m4trace:configure.in:19: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.in:19: -1- AC_SUBST([AWK]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([AWK]) +m4trace:configure.in:19: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.in:19: -1- AC_SUBST([SET_MAKE]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([SET_MAKE]) +m4trace:configure.in:19: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.in:19: -1- AC_SUBST([am__leading_dot]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([am__leading_dot]) +m4trace:configure.in:19: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.in:19: -1- AC_SUBST([AMTAR]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([AMTAR]) +m4trace:configure.in:19: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.in:19: -1- AC_SUBST([am__tar]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([am__tar]) +m4trace:configure.in:19: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.in:19: -1- AC_SUBST([am__untar]) +m4trace:configure.in:19: -1- AC_SUBST_TRACE([am__untar]) +m4trace:configure.in:19: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.in:21: -1- AC_CONFIG_HEADERS([config.h]) +m4trace:configure.in:37: -1- AM_CONDITIONAL([HAVE_NEW_PICS], [ test x$NEWPICS = xyes ]) +m4trace:configure.in:37: -1- AC_SUBST([HAVE_NEW_PICS_TRUE]) +m4trace:configure.in:37: -1- AC_SUBST_TRACE([HAVE_NEW_PICS_TRUE]) +m4trace:configure.in:37: -1- m4_pattern_allow([^HAVE_NEW_PICS_TRUE$]) +m4trace:configure.in:37: -1- AC_SUBST([HAVE_NEW_PICS_FALSE]) +m4trace:configure.in:37: -1- AC_SUBST_TRACE([HAVE_NEW_PICS_FALSE]) +m4trace:configure.in:37: -1- m4_pattern_allow([^HAVE_NEW_PICS_FALSE$]) +m4trace:configure.in:37: -1- _AM_SUBST_NOTMAKE([HAVE_NEW_PICS_TRUE]) +m4trace:configure.in:37: -1- _AM_SUBST_NOTMAKE([HAVE_NEW_PICS_FALSE]) +m4trace:configure.in:60: -1- AC_SUBST([ARCH], [${ARCH:-16f877}]) +m4trace:configure.in:60: -1- AC_SUBST_TRACE([ARCH]) +m4trace:configure.in:60: -1- m4_pattern_allow([^ARCH$]) +m4trace:configure.in:61: -1- AC_SUBST([EARCH], [${EARCH:-16f1934}]) +m4trace:configure.in:61: -1- AC_SUBST_TRACE([EARCH]) +m4trace:configure.in:61: -1- m4_pattern_allow([^EARCH$]) +m4trace:configure.in:64: -1- AC_SUBST([CC], [\'$abs_top_builddir/../../../bin/sdcc\']) +m4trace:configure.in:64: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.in:64: -1- m4_pattern_allow([^CC$]) +m4trace:configure.in:65: -1- AC_SUBST([CCAS]) +m4trace:configure.in:65: -1- AC_SUBST_TRACE([CCAS]) +m4trace:configure.in:65: -1- m4_pattern_allow([^CCAS$]) +m4trace:configure.in:66: -1- AC_SUBST([LD]) +m4trace:configure.in:66: -1- AC_SUBST_TRACE([LD]) +m4trace:configure.in:66: -1- m4_pattern_allow([^LD$]) +m4trace:configure.in:67: -1- AC_SUBST([AR]) +m4trace:configure.in:67: -1- AC_SUBST_TRACE([AR]) +m4trace:configure.in:67: -1- m4_pattern_allow([^AR$]) +m4trace:configure.in:76: -1- AC_SUBST([CFLAGS], [""]) +m4trace:configure.in:76: -1- AC_SUBST_TRACE([CFLAGS]) +m4trace:configure.in:76: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.in:77: -1- AC_SUBST([CCASFLAGS], [""]) +m4trace:configure.in:77: -1- AC_SUBST_TRACE([CCASFLAGS]) +m4trace:configure.in:77: -1- m4_pattern_allow([^CCASFLAGS$]) +m4trace:configure.in:78: -1- AC_SUBST([LDFLAGS], ["-m -l -w"]) +m4trace:configure.in:78: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.in:78: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.in:79: -1- AC_SUBST([ARFLAGS], ["-c"]) +m4trace:configure.in:79: -1- AC_SUBST_TRACE([ARFLAGS]) +m4trace:configure.in:79: -1- m4_pattern_allow([^ARFLAGS$]) +m4trace:configure.in:80: -1- AC_SUBST([CCAS], [\'$CCAS\']) +m4trace:configure.in:80: -1- AC_SUBST_TRACE([CCAS]) +m4trace:configure.in:80: -1- m4_pattern_allow([^CCAS$]) +m4trace:configure.in:81: -1- AC_SUBST([LD], [\'$LD\']) +m4trace:configure.in:81: -1- AC_SUBST_TRACE([LD]) +m4trace:configure.in:81: -1- m4_pattern_allow([^LD$]) +m4trace:configure.in:82: -1- AC_SUBST([AR], [\'$AR\']) +m4trace:configure.in:82: -1- AC_SUBST_TRACE([AR]) +m4trace:configure.in:82: -1- m4_pattern_allow([^AR$]) +m4trace:configure.in:85: -1- AC_SUBST([RANLIB], [:]) +m4trace:configure.in:85: -1- AC_SUBST_TRACE([RANLIB]) +m4trace:configure.in:85: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.in:86: -1- AC_SUBST([OBJEXT], [o]) +m4trace:configure.in:86: -1- AC_SUBST_TRACE([OBJEXT]) +m4trace:configure.in:86: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.in:88: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) +m4trace:configure.in:88: -1- AC_SUBST_TRACE([DEPDIR]) +m4trace:configure.in:88: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.in:88: -1- AC_SUBST([am__include]) +m4trace:configure.in:88: -1- AC_SUBST_TRACE([am__include]) +m4trace:configure.in:88: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.in:88: -1- AC_SUBST([am__quote]) +m4trace:configure.in:88: -1- AC_SUBST_TRACE([am__quote]) +m4trace:configure.in:88: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.in:88: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.in:88: -1- AC_SUBST([AMDEP_TRUE]) +m4trace:configure.in:88: -1- AC_SUBST_TRACE([AMDEP_TRUE]) +m4trace:configure.in:88: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.in:88: -1- AC_SUBST([AMDEP_FALSE]) +m4trace:configure.in:88: -1- AC_SUBST_TRACE([AMDEP_FALSE]) +m4trace:configure.in:88: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.in:88: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.in:88: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.in:88: -1- AC_SUBST([AMDEPBACKSLASH]) +m4trace:configure.in:88: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) +m4trace:configure.in:88: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.in:88: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.in:88: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) +m4trace:configure.in:88: -1- AC_SUBST_TRACE([CCDEPMODE]) +m4trace:configure.in:88: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.in:88: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.in:88: -1- AC_SUBST([am__fastdepCC_TRUE]) +m4trace:configure.in:88: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) +m4trace:configure.in:88: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.in:88: -1- AC_SUBST([am__fastdepCC_FALSE]) +m4trace:configure.in:88: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) +m4trace:configure.in:88: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.in:88: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.in:88: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.in:89: -1- AC_SUBST([CCASDEPMODE], [depmode=$am_cv_CCAS_dependencies_compiler_type]) +m4trace:configure.in:89: -1- AC_SUBST_TRACE([CCASDEPMODE]) +m4trace:configure.in:89: -1- m4_pattern_allow([^CCASDEPMODE$]) +m4trace:configure.in:89: -1- AM_CONDITIONAL([am__fastdepCCAS], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3]) +m4trace:configure.in:89: -1- AC_SUBST([am__fastdepCCAS_TRUE]) +m4trace:configure.in:89: -1- AC_SUBST_TRACE([am__fastdepCCAS_TRUE]) +m4trace:configure.in:89: -1- m4_pattern_allow([^am__fastdepCCAS_TRUE$]) +m4trace:configure.in:89: -1- AC_SUBST([am__fastdepCCAS_FALSE]) +m4trace:configure.in:89: -1- AC_SUBST_TRACE([am__fastdepCCAS_FALSE]) +m4trace:configure.in:89: -1- m4_pattern_allow([^am__fastdepCCAS_FALSE$]) +m4trace:configure.in:89: -1- _AM_SUBST_NOTMAKE([am__fastdepCCAS_TRUE]) +m4trace:configure.in:89: -1- _AM_SUBST_NOTMAKE([am__fastdepCCAS_FALSE]) +m4trace:configure.in:99: -1- AC_CONFIG_FILES([Makefile + libsdcc/enhanced/Makefile + libsdcc/regular/Makefile + libm/Makefile]) +m4trace:configure.in:103: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) +m4trace:configure.in:103: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.in:103: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.in:103: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) +m4trace:configure.in:103: -1- AC_SUBST_TRACE([LTLIBOBJS]) +m4trace:configure.in:103: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.in:103: -1- AC_SUBST_TRACE([top_builddir]) +m4trace:configure.in:103: -1- AC_SUBST_TRACE([top_build_prefix]) +m4trace:configure.in:103: -1- AC_SUBST_TRACE([srcdir]) +m4trace:configure.in:103: -1- AC_SUBST_TRACE([abs_srcdir]) +m4trace:configure.in:103: -1- AC_SUBST_TRACE([top_srcdir]) +m4trace:configure.in:103: -1- AC_SUBST_TRACE([abs_top_srcdir]) +m4trace:configure.in:103: -1- AC_SUBST_TRACE([builddir]) +m4trace:configure.in:103: -1- AC_SUBST_TRACE([abs_builddir]) +m4trace:configure.in:103: -1- AC_SUBST_TRACE([abs_top_builddir]) +m4trace:configure.in:103: -1- AC_SUBST_TRACE([INSTALL]) +m4trace:configure.in:103: -1- AC_SUBST_TRACE([MKDIR_P]) diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/configure sdcc-3.2.0+dfsg/device/lib/pic14/configure --- sdcc-3.1.0+dfsg/device/lib/pic14/configure 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/configure 2012-07-06 09:07:11.000000000 +0000 @@ -1,24 +1,20 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for pic14lib 0.1. +# Generated by GNU Autoconf 2.63 for pic14lib 0.1. # # Report bugs to . # -# # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. -# -# +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 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. ## -## -------------------- ## +## --------------------- ## +## 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 : +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -26,15 +22,23 @@ alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; + 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 + as_nl=' ' export as_nl @@ -42,13 +46,7 @@ as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -59,7 +57,7 @@ as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in #( + case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -82,6 +80,13 @@ } 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 @@ -91,15 +96,15 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in #(( +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 + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done IFS=$as_save_IFS ;; @@ -111,16 +116,12 @@ fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 + { (exit 1); exit 1; } fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +# 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='> ' @@ -132,299 +133,330 @@ LANGUAGE=C export LANGUAGE +# 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 || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + # CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +$as_unset CDPATH + if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST + if (eval ":") 2>/dev/null; then + as_have_required=yes else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac + as_have_required=no fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } + + 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 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +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 positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes + 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 - as_have_required=no + exitcode=1 + echo positional parameters were not saved. fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : +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_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false + 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=. - as_found=: - case $as_dir in #( + case $as_dir in /*) for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac - as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS - if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi + 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=: + # Pre-4.2 versions of Zsh do 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 - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org and tecodev AT users -$0: sourceforge net about your system, including any error -$0: possibly output before this message. Then install a -$0: modern shell, or manually run the script under such a -$0: shell if you do have one." - fi - exit 1 -fi 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=: + # Pre-4.2 versions of Zsh do 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 -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} + +: +(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 } -as_unset=as_fn_unset -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_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 || -$as_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" || as_fn_error $? "cannot create directory $as_dir" +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 -} # as_fn_mkdir_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' +if ( set x; as_func_ret_success y && test x = "$1" ); then + : else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append + exitcode=1 + echo positional parameters were not saved. +fi -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith +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; } -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error +_ASEOF +}; then + break +fi -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr +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 - as_expr=false + exitcode=1 + echo as_func_success failed. fi -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : else - as_basename=false + exitcode=1 + echo as_func_ret_success failed. fi -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname +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 - as_dirname=false + exitcode=1 + echo positional parameters were not saved. fi -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. +} -# 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 - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + 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/= @@ -441,7 +473,8 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { $as_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 @@ -451,18 +484,29 @@ 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 #((((( +case `echo -n x` in -n*) - case `echo 'xy\c'` in + case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; + *) 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 @@ -492,7 +536,7 @@ rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' + as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false @@ -511,10 +555,10 @@ if test -d "$1"; then test -d "$1/."; else - case $1 in #( + case $1 in -*)set "./$1";; esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' @@ -528,11 +572,11 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -test -n "$DJDIR" || exec 7<&0 &1 + +exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# 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` @@ -547,6 +591,7 @@ subdirs= MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='pic14lib' @@ -554,7 +599,6 @@ PACKAGE_VERSION='0.1' PACKAGE_STRING='pic14lib 0.1' PACKAGE_BUGREPORT='tecodev AT users sourceforge net' -PACKAGE_URL='' ac_unique_file="libsdcc/idata.c" ac_subst_vars='LTLIBOBJS @@ -638,7 +682,6 @@ program_transform_name prefix exec_prefix -PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION @@ -717,9 +760,8 @@ fi case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -764,7 +806,8 @@ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -790,7 +833,8 @@ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -994,7 +1038,8 @@ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1010,7 +1055,8 @@ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1040,17 +1086,17 @@ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) { $as_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. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1067,13 +1113,15 @@ if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1096,7 +1144,8 @@ [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" + { $as_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' @@ -1110,8 +1159,8 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_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 + $as_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 @@ -1126,9 +1175,11 @@ ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" + { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" + { $as_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. @@ -1167,11 +1218,13 @@ fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" + { $as_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" || as_fn_error $? "$ac_msg" + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_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 @@ -1211,7 +1264,7 @@ --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 + -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 @@ -1272,7 +1325,7 @@ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-new-pics Enable use of PIC devices added to gputils after the - 0.13.7 release. Requires custom-built gputils + 0.14.1 release. Requires custom-built gputils obtained from their SVN repository! --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors @@ -1341,24 +1394,21 @@ if $ac_init_version; then cat <<\_ACEOF pic14lib configure 0.1 -generated by GNU Autoconf 2.67 +generated by GNU Autoconf 2.63 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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 - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## 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 pic14lib $as_me 0.1, which was -generated by GNU Autoconf 2.67. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -1394,8 +1444,8 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done + $as_echo "PATH: $as_dir" +done IFS=$as_save_IFS } >&5 @@ -1432,9 +1482,9 @@ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) - as_fn_append ac_configure_args1 " '$ac_arg'" + 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 @@ -1450,13 +1500,13 @@ -* ) ac_must_keep_next=true ;; esac fi - as_fn_append ac_configure_args " '$ac_arg'" + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} +$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 @@ -1468,9 +1518,11 @@ { echo - $as_echo "## ---------------- ## + cat <<\_ASBOX +## ---------------- ## ## Cache variables. ## -## ---------------- ##" +## ---------------- ## +_ASBOX echo # The following way of writing the cache mishandles newlines in values, ( @@ -1479,13 +1531,13 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; + *) $as_unset $ac_var ;; esac ;; esac done @@ -1504,9 +1556,11 @@ ) echo - $as_echo "## ----------------- ## + cat <<\_ASBOX +## ----------------- ## ## Output variables. ## -## ----------------- ##" +## ----------------- ## +_ASBOX echo for ac_var in $ac_subst_vars do @@ -1519,9 +1573,11 @@ echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + cat <<\_ASBOX +## ------------------- ## ## File substitutions. ## -## ------------------- ##" +## ------------------- ## +_ASBOX echo for ac_var in $ac_subst_files do @@ -1535,9 +1591,11 @@ fi if test -s confdefs.h; then - $as_echo "## ----------- ## + cat <<\_ASBOX +## ----------- ## ## confdefs.h. ## -## ----------- ##" +## ----------- ## +_ASBOX echo cat confdefs.h echo @@ -1551,39 +1609,37 @@ exit $exit_status ' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal + 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 -$as_echo "/* confdefs.h */" > 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 cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF @@ -1592,12 +1648,7 @@ ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -1608,23 +1659,19 @@ for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 + if test -r "$ac_site_file"; then + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 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. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; @@ -1632,7 +1679,7 @@ esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1647,11 +1694,11 @@ eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; @@ -1661,17 +1708,17 @@ ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac @@ -1683,20 +1730,43 @@ esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## + + + + + + + + + + + + + + + + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -1724,7 +1794,9 @@ fi done if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, @@ -1750,10 +1822,10 @@ # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -1761,11 +1833,11 @@ 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]/* | \ + # 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[\\/]* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -1802,7 +1874,7 @@ ;; esac - done +done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir @@ -1818,7 +1890,7 @@ INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. @@ -1829,7 +1901,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 @@ -1840,11 +1912,15 @@ ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; + { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5 +$as_echo "$as_me: error: unsafe absolute working directory name" >&2;} + { (exit 1); exit 1; }; };; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; + { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5 +$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;} + { (exit 1); exit 1; }; };; esac # Do `set' in a subshell so we don't clobber the current shell's @@ -1866,8 +1942,11 @@ # 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". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +$as_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 @@ -1876,10 +1955,13 @@ # Ok. : else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +$as_echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +{ $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" @@ -1907,7 +1989,7 @@ am_missing_run="$MISSING --run " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 + { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi @@ -1928,9 +2010,9 @@ 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : +if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -1941,24 +2023,24 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + 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_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -1968,9 +2050,9 @@ 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -1981,24 +2063,24 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + 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_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -2007,7 +2089,7 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -2020,10 +2102,10 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then : + if test "${ac_cv_path_mkdir+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2031,7 +2113,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do + for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( @@ -2043,12 +2125,11 @@ esac done done - done +done IFS=$as_save_IFS fi - test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else @@ -2056,10 +2137,11 @@ # value for MKDIR_P 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. + test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" @@ -2072,9 +2154,9 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then : +if test "${ac_cv_prog_AWK+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -2085,24 +2167,24 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + 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_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 + { $as_echo "$as_me:$LINENO: result: $AWK" >&5 $as_echo "$AWK" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -2110,11 +2192,11 @@ test -n "$AWK" && break done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -2122,7 +2204,7 @@ all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +# 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;; @@ -2132,11 +2214,11 @@ rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -2156,7 +2238,9 @@ am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } fi fi @@ -2219,13 +2303,15 @@ NEWPICS=no; # Check whether --enable-new-pics was given. -if test "${enable_new_pics+set}" = set; then : +if test "${enable_new_pics+set}" = set; then enableval=$enable_new_pics; case "x$enableval" in xyes) NEWPICS=yes; - { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling support for PICs from unreleased gputils -- make sure you have up-to-date gputils from SVN." >&5 + { $as_echo "$as_me:$LINENO: Enabling support for PICs from unreleased gputils -- make sure you have up-to-date gputils from SVN." >&5 $as_echo "$as_me: Enabling support for PICs from unreleased gputils -- make sure you have up-to-date gputils from SVN." >&6;};; xno) NEWPICS=no;; - *) as_fn_error $? "bad value \"${enableval}\" for --enable-new-pics" "$LINENO" 5 ;; + *) { { $as_echo "$as_me:$LINENO: error: bad value \"${enableval}\" for --enable-new-pics" >&5 +$as_echo "$as_me: error: bad value \"${enableval}\" for --enable-new-pics" >&2;} + { (exit 1); exit 1; }; };; esac else NEWPICS=no @@ -2273,9 +2359,9 @@ # Extract the first word of "gpasm", so it can be a program name with args. set dummy gpasm; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CCAS+set}" = set; then : +if test "${ac_cv_path_CCAS+set}" = set; then $as_echo_n "(cached) " >&6 else case $CCAS in @@ -2288,14 +2374,14 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + 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_path_CCAS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS test -z "$ac_cv_path_CCAS" && ac_cv_path_CCAS=":" @@ -2304,19 +2390,19 @@ fi CCAS=$ac_cv_path_CCAS if test -n "$CCAS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CCAS" >&5 + { $as_echo "$as_me:$LINENO: result: $CCAS" >&5 $as_echo "$CCAS" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gplink", so it can be a program name with args. set dummy gplink; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_LD+set}" = set; then : +if test "${ac_cv_path_LD+set}" = set; then $as_echo_n "(cached) " >&6 else case $LD in @@ -2329,14 +2415,14 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + 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_path_LD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS test -z "$ac_cv_path_LD" && ac_cv_path_LD=":" @@ -2345,19 +2431,19 @@ fi LD=$ac_cv_path_LD if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 + { $as_echo "$as_me:$LINENO: result: $LD" >&5 $as_echo "$LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gplib", so it can be a program name with args. set dummy gplib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_AR+set}" = set; then : +if test "${ac_cv_path_AR+set}" = set; then $as_echo_n "(cached) " >&6 else case $AR in @@ -2370,14 +2456,14 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + 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_path_AR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS test -z "$ac_cv_path_AR" && ac_cv_path_AR=":" @@ -2386,10 +2472,10 @@ fi AR=$ac_cv_path_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 + { $as_echo "$as_me:$LINENO: result: $AR" >&5 $as_echo "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -2397,12 +2483,17 @@ case ":$CCAS:$LD:$AR:" in *:::*) - as_fn_error $? "gputils (gpasm, gplink, and gplib) are required but not found. -Either install gputils or reconfigure with --disable-pic14-port and --disable-pic16-port." "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: gputils (gpasm, gplink, and gplib) are required but not found. +Either install gputils or reconfigure with --disable-pic14-port and --disable-pic16-port." >&5 +$as_echo "$as_me: error: gputils (gpasm, gplink, and gplib) are required but not found. +Either install gputils or reconfigure with --disable-pic14-port and --disable-pic16-port." >&2;} + { (exit 1); exit 1; }; } ;; esac; +CFLAGS="" +CCASFLAGS="" LDFLAGS="-m -l -w" @@ -2433,7 +2524,7 @@ .PHONY: am__doit END # If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= @@ -2461,12 +2552,12 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : +if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi @@ -2486,9 +2577,9 @@ depcc="$CC" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -2596,7 +2687,7 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type @@ -2614,9 +2705,9 @@ depcc="$CCAS" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CCAS_dependencies_compiler_type+set}" = set; then : +if test "${am_cv_CCAS_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -2722,7 +2813,7 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 +{ $as_echo "$as_me:$LINENO: result: $am_cv_CCAS_dependencies_compiler_type" >&5 $as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; } CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type @@ -2775,13 +2866,13 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; + *) $as_unset $ac_var ;; esac ;; esac done @@ -2789,8 +2880,8 @@ (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 \. + # `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" @@ -2813,11 +2904,11 @@ if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi @@ -2831,15 +2922,14 @@ ac_libobjs= ac_ltlibobjs= -U= 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=`$as_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. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -2848,30 +2938,41 @@ if test -z "${HAVE_NEW_PICS_TRUE}" && test -z "${HAVE_NEW_PICS_FALSE}"; then - as_fn_error $? "conditional \"HAVE_NEW_PICS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_NEW_PICS\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"HAVE_NEW_PICS\" 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 - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_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 - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_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 "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCCAS\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"am__fastdepCCAS\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -2881,18 +2982,17 @@ debug=false ac_cs_recheck=false ac_cs_silent=false - SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +## --------------------- ## +## 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 : +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -2900,15 +3000,23 @@ alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; + 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 + as_nl=' ' export as_nl @@ -2916,13 +3024,7 @@ as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -2933,7 +3035,7 @@ as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in #( + case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -2956,6 +3058,13 @@ } 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 @@ -2965,15 +3074,15 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in #(( +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 + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done IFS=$as_save_IFS ;; @@ -2985,16 +3094,12 @@ fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 + { (exit 1); exit 1; } fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +# 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='> ' @@ -3006,89 +3111,7 @@ LANGUAGE=C export LANGUAGE -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - +# Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -3102,12 +3125,8 @@ as_basename=false fi -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -3127,25 +3146,76 @@ } s/.*/./; q'` -# 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 +# 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" || + { $as_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 #((((( +case `echo -n x` in -n*) - case `echo 'xy\c'` in + case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; + *) 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 @@ -3174,56 +3244,8 @@ rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_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 || -$as_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" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' + as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false @@ -3242,10 +3264,10 @@ if test -d "$1"; then test -d "$1/."; else - case $1 in #( + case $1 in -*)set "./$1";; esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' @@ -3260,19 +3282,13 @@ exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to +# 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 pic14lib $as_me 0.1, which was -generated by GNU Autoconf 2.67. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -3304,15 +3320,13 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. +\`$as_me' instantiates files from templates according to the +current configuration. -Usage: $0 [OPTION]... [TAG]... +Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files @@ -3331,17 +3345,16 @@ Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ pic14lib config.status 0.1 -configured by $0, generated by GNU Autoconf 2.67, - with options \\"\$ac_cs_config\\" +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -3359,16 +3372,11 @@ while test $# != 0 do case $1 in - --*=?*) + --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; *) ac_option=$1 ac_optarg=$2 @@ -3382,29 +3390,27 @@ ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; esac - as_fn_append CONFIG_FILES " '$ac_optarg'" + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" + CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + { $as_echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -3412,10 +3418,11 @@ ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) { $as_echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; - *) as_fn_append ac_config_targets " $1" + *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac @@ -3473,7 +3480,9 @@ "libsdcc/regular/Makefile") CONFIG_FILES="$CONFIG_FILES libsdcc/regular/Makefile" ;; "libm/Makefile") CONFIG_FILES="$CONFIG_FILES libm/Makefile" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; esac done @@ -3500,7 +3509,7 @@ trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 - trap 'as_fn_exit 1' 1 2 13 15 + trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. @@ -3511,7 +3520,11 @@ { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +} || +{ + $as_echo "$as_me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -3519,13 +3532,7 @@ if test -n "$CONFIG_FILES"; then -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi +ac_cr=' ' ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' @@ -3542,18 +3549,24 @@ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -3575,7 +3588,7 @@ t delim :nl h -s/\(.\{148\}\)..*/\1/ +s/\(.\{148\}\).*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p @@ -3589,7 +3602,7 @@ t nl :delim h -s/\(.\{148\}\)..*/\1/ +s/\(.\{148\}\).*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p @@ -3642,28 +3655,22 @@ else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } _ACEOF -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# 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[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// s/^[^=]*=[ ]*$// }' fi @@ -3691,7 +3698,9 @@ if test -z "$ac_t"; then break elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} + { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -3776,7 +3785,9 @@ _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 +$as_echo "$as_me: error: could not setup config headers machinery" >&2;} + { (exit 1); exit 1; }; } fi # test -n "$CONFIG_HEADERS" @@ -3789,7 +3800,9 @@ esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_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 @@ -3817,10 +3830,12 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" + ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't @@ -3831,7 +3846,7 @@ `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. @@ -3844,7 +3859,9 @@ case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; esac ;; esac @@ -3872,7 +3889,47 @@ q } s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p + { 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=`$as_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 || +$as_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" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in @@ -3929,6 +3986,7 @@ # 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= + ac_sed_dataroot=' /datarootdir/ { p @@ -3938,11 +3996,12 @@ /@docdir@/p /@infodir@/p /@localedir@/p -/@mandir@/p' +/@mandir@/p +' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -3952,7 +4011,7 @@ s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; + s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF @@ -3981,22 +4040,26 @@ $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } 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"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 + { $as_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 $as_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;} +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 \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; :H) # @@ -4007,19 +4070,25 @@ $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 + { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 + || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 +$as_echo "$as_me: error: could not create -" >&2;} + { (exit 1); exit 1; }; } fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" @@ -4057,7 +4126,7 @@ s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 + :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -4152,7 +4221,47 @@ q } s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p + { as_dir=$dirpart/$fdir + 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=`$as_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 || +$as_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" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done @@ -4164,12 +4273,15 @@ done # for ac_tag -as_fn_exit 0 +{ (exit 0); exit 0; } _ACEOF +chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } # configure is writing to config.log, and then calls config.status. @@ -4190,10 +4302,10 @@ 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 || as_fn_exit 1 + $ac_cs_success || { (exit 1); exit 1; } fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/configure.in sdcc-3.2.0+dfsg/device/lib/pic14/configure.in --- sdcc-3.1.0+dfsg/device/lib/pic14/configure.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/configure.in 2012-01-18 23:52:23.000000000 +0000 @@ -10,7 +10,7 @@ # Adopted for the SDCC/pic14 library by # Raphael Neider # -# $Id: configure.in 7001 2011-11-01 16:35:46Z tecodev $ +# $Id: configure.in 7239 2012-01-18 23:52:23Z borutr $ # # Process this file with autoconf to produce a configure script. @@ -24,7 +24,7 @@ NEWPICS=no; AC_ARG_ENABLE( [new-pics], - AS_HELP_STRING([--enable-new-pics], [Enable use of PIC devices added to gputils after the 0.13.7 release. Requires custom-built gputils obtained from their SVN repository!]), + AS_HELP_STRING([--enable-new-pics], [Enable use of PIC devices added to gputils after the 0.14.1 release. Requires custom-built gputils obtained from their SVN repository!]), [ case "x$enableval" in xyes) NEWPICS=yes; AC_MSG_NOTICE([Enabling support for PICs from unreleased gputils -- make sure you have up-to-date gputils from SVN.]);; @@ -73,8 +73,8 @@ ;; esac; -AC_SUBST(CFLAGS, []) -AC_SUBST(CCASFLAGS, []) +AC_SUBST(CFLAGS, [""]) +AC_SUBST(CCASFLAGS, [""]) AC_SUBST(LDFLAGS, ["-m -l -w"]) AC_SUBST(ARFLAGS, ["-c"]) AC_SUBST(CCAS, [\'$CCAS\']) diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/Makefile.am sdcc-3.2.0+dfsg/device/lib/pic14/libm/Makefile.am --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/Makefile.am 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/Makefile.am 2012-01-20 17:19:33.000000000 +0000 @@ -1,6 +1,6 @@ ## Process this file with Automake to create Makefile.in -noinst_LIBRARIES = libm.a +noinst_LIBRARIES = libm.a libme.a libm_a_SOURCES = libm_a_SOURCES += acosf.c @@ -33,13 +33,23 @@ libm_a_CFLAGS = -p$(ARCH) $(AM_CFLAGS) -if HAVE_NEW_PICS -noinst_LIBRARIES += libme.a - libme_a_SOURCES = $(libm_a_SOURCES) limbe_a_CFLAGS = -p$(EARCH) $(AM_CFLAGS) + +if HAVE_NEW_PICS +# add new pics libraries to be built here +noinst_LIBRARIES += + +## replace with the new library name, +## add sources for new libraries and +## uncomment the following line +#_a_SOURCES = $(libm_a_SOURCES) + +## replace with the new library name, +## add CFLAGS for compiling new libraries and +## uncomment the following line +#_a_CFLAGS = -p$(EARCH) $(AM_CFLAGS) endif include $(top_srcdir)/Makefile.common - diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/Makefile.in sdcc-3.2.0+dfsg/device/lib/pic14/libm/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/Makefile.in 2012-07-06 09:07:08.000000000 +0000 @@ -32,7 +32,9 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -@HAVE_NEW_PICS_TRUE@am__append_1 = libme.a + +# add new pics libraries to be built here +@HAVE_NEW_PICS_TRUE@am__append_1 = DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.common subdir = libm @@ -64,10 +66,6 @@ libm_a_OBJECTS = $(am_libm_a_OBJECTS) libme_a_AR = $(AR) $(ARFLAGS) libme_a_LIBADD = -am__libme_a_SOURCES_DIST = acosf.c asincosf.c asinf.c atan2f.c atanf.c \ - ceilf.c cosf.c coshf.c cotf.c errno.c expf.c fabsf.c floorf.c \ - frexpf.c ldexpf.c log10f.c logf.c modff.c powf.c sincosf.c \ - sincoshf.c sinf.c sinhf.c sqrtf.c tancotf.c tanf.c tanhf.c am__objects_1 = acosf.$(OBJEXT) asincosf.$(OBJEXT) asinf.$(OBJEXT) \ atan2f.$(OBJEXT) atanf.$(OBJEXT) ceilf.$(OBJEXT) \ cosf.$(OBJEXT) coshf.$(OBJEXT) cotf.$(OBJEXT) errno.$(OBJEXT) \ @@ -77,7 +75,7 @@ sincosf.$(OBJEXT) sincoshf.$(OBJEXT) sinf.$(OBJEXT) \ sinhf.$(OBJEXT) sqrtf.$(OBJEXT) tancotf.$(OBJEXT) \ tanf.$(OBJEXT) tanhf.$(OBJEXT) -@HAVE_NEW_PICS_TRUE@am_libme_a_OBJECTS = $(am__objects_1) +am_libme_a_OBJECTS = $(am__objects_1) libme_a_OBJECTS = $(am_libme_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -88,7 +86,7 @@ CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libm_a_SOURCES) $(libme_a_SOURCES) -DIST_SOURCES = $(libm_a_SOURCES) $(am__libme_a_SOURCES_DIST) +DIST_SOURCES = $(libm_a_SOURCES) $(libme_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -180,14 +178,14 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -noinst_LIBRARIES = libm.a $(am__append_1) +noinst_LIBRARIES = libm.a libme.a $(am__append_1) libm_a_SOURCES = acosf.c asincosf.c asinf.c atan2f.c atanf.c ceilf.c \ cosf.c coshf.c cotf.c errno.c expf.c fabsf.c floorf.c frexpf.c \ ldexpf.c log10f.c logf.c modff.c powf.c sincosf.c sincoshf.c \ sinf.c sinhf.c sqrtf.c tancotf.c tanf.c tanhf.c libm_a_CFLAGS = -p$(ARCH) $(AM_CFLAGS) -@HAVE_NEW_PICS_TRUE@libme_a_SOURCES = $(libm_a_SOURCES) -@HAVE_NEW_PICS_TRUE@limbe_a_CFLAGS = -p$(EARCH) $(AM_CFLAGS) +libme_a_SOURCES = $(libm_a_SOURCES) +limbe_a_CFLAGS = -p$(EARCH) $(AM_CFLAGS) AM_CPPFLAGS = -I. -I$(top_srcdir)/../../include/pic14 \ -I$(top_srcdir)/../../non-free/include/pic14 #AM_CFLAGS += --asm="$(CCAS)" @@ -916,6 +914,10 @@ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@); \ done +#_a_SOURCES = $(libm_a_SOURCES) + +#_a_CFLAGS = -p$(EARCH) $(AM_CFLAGS) + # 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 -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/acosf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/acosf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/acosf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/acosf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/asincosf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/asincosf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/asincosf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/asincosf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/asinf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/asinf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/asinf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/asinf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/atan2f.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/atan2f.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/atan2f.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/atan2f.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/atanf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/atanf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/atanf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/atanf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/ceilf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/ceilf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/ceilf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/ceilf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/cosf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/cosf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/cosf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/cosf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/coshf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/coshf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/coshf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/coshf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/cotf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/cotf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/cotf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/cotf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/errno.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/errno.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/errno.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/errno.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/expf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/expf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/expf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/expf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/fabsf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/fabsf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/fabsf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/fabsf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/floorf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/floorf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/floorf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/floorf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/frexpf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/frexpf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/frexpf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/frexpf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/ldexpf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/ldexpf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/ldexpf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/ldexpf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/log10f.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/log10f.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/log10f.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/log10f.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/logf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/logf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/logf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/logf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/modff.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/modff.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/modff.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/modff.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/powf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/powf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/powf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/powf.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/sincosf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/sincosf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/sincosf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/sincosf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/sincoshf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/sincoshf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/sincoshf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/sincoshf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/sinf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/sinf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/sinf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/sinf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/sinhf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/sinhf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/sinhf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/sinhf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/sqrtf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/sqrtf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/sqrtf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/sqrtf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/tancotf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/tancotf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/tancotf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/tancotf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/tanf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/tanf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/tanf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/tanf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libm/tanhf.c sdcc-3.2.0+dfsg/device/lib/pic14/libm/tanhf.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libm/tanhf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libm/tanhf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_divschar.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_divschar.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_divschar.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_divschar.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_divsint.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_divsint.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_divsint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_divsint.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_divslong.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_divslong.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_divslong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_divslong.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_divuchar.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_divuchar.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_divuchar.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_divuchar.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_divuint.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_divuint.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_divuint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_divuint.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_divulong.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_divulong.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_divulong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_divulong.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_modschar.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_modschar.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_modschar.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_modschar.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_modsint.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_modsint.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_modsint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_modsint.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_modslong.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_modslong.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_modslong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_modslong.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_moduchar.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_moduchar.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_moduchar.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_moduchar.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_moduint.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_moduint.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_moduint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_moduint.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_modulong.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_modulong.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_modulong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_modulong.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_mulchar.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_mulchar.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_mulchar.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_mulchar.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_mulint.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_mulint.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_mulint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_mulint.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_mullong.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_mullong.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/_mullong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/_mullong.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrget1.S sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrget1.S --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrget1.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrget1.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrget2.S sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrget2.S --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrget2.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrget2.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrget3.S sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrget3.S --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrget3.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrget3.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrget4.S sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrget4.S --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrget4.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrget4.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrput1.S sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrput1.S --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrput1.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrput1.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrput2.S sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrput2.S --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrput2.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrput2.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrput3.S sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrput3.S --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrput3.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrput3.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrput4.S sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrput4.S --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrput4.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/enhanced/_gptrput4.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fs2schar.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fs2schar.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fs2schar.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fs2schar.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fs2sint.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fs2sint.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fs2sint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fs2sint.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fs2slong.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fs2slong.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fs2slong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fs2slong.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fs2uchar.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fs2uchar.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fs2uchar.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fs2uchar.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fs2uint.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fs2uint.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fs2uint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fs2uint.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fs2ulong.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fs2ulong.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fs2ulong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fs2ulong.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fsadd.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fsadd.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fsadd.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fsadd.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fsdiv.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fsdiv.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fsdiv.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fsdiv.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fseq.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fseq.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fseq.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fseq.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fsgt.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fsgt.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fsgt.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fsgt.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fslt.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fslt.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fslt.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fslt.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fsmul.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fsmul.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fsmul.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fsmul.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fsneq.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fsneq.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fsneq.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fsneq.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fssub.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fssub.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/fssub.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/fssub.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/idata.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/idata.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/idata.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/idata.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrget1.S sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrget1.S --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrget1.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrget1.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrget2.S sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrget2.S --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrget2.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrget2.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrget3.S sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrget3.S --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrget3.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrget3.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrget4.S sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrget4.S --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrget4.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrget4.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrput1.S sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrput1.S --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrput1.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrput1.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrput2.S sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrput2.S --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrput2.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrput2.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrput3.S sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrput3.S --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrput3.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrput3.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrput4.S sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrput4.S --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrput4.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/_gptrput4.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/shadowregs.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/shadowregs.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/regular/shadowregs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/regular/shadowregs.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/schar2fs.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/schar2fs.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/schar2fs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/schar2fs.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/sint2fs.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/sint2fs.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/sint2fs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/sint2fs.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/slong2fs.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/slong2fs.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/slong2fs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/slong2fs.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/uchar2fs.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/uchar2fs.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/uchar2fs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/uchar2fs.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/uint2fs.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/uint2fs.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/uint2fs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/uint2fs.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/ulong2fs.c sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/ulong2fs.c --- sdcc-3.1.0+dfsg/device/lib/pic14/libsdcc/ulong2fs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic14/libsdcc/ulong2fs.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/configure sdcc-3.2.0+dfsg/device/lib/pic16/configure --- sdcc-3.1.0+dfsg/device/lib/pic16/configure 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/configure 2012-05-05 12:10:45.000000000 +0000 @@ -1,13 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for pic16lib 0.3. +# Generated by GNU Autoconf 2.69 for pic16lib 0.3. # # Report bugs to . # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -91,6 +89,7 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -135,6 +134,31 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -168,7 +192,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -212,14 +237,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -318,10 +354,18 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -358,19 +402,19 @@ fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -443,6 +487,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # 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). @@ -477,16 +525,16 @@ # ... 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'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -498,28 +546,8 @@ 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 +as_test_x='test -x' +as_executable_p=as_fn_executable_p # 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'" @@ -532,7 +560,7 @@ exec 6>&1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -717,8 +745,9 @@ fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -763,7 +792,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -789,7 +818,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -993,7 +1022,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1009,7 +1038,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1039,8 +1068,8 @@ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information." + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) @@ -1048,7 +1077,7 @@ # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1058,7 +1087,7 @@ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1066,13 +1095,13 @@ if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" + as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1095,7 +1124,7 @@ [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1109,8 +1138,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_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 @@ -1125,9 +1152,9 @@ ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error "working directory cannot be determined" + as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error "pwd does not report name of working directory" + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1166,11 +1193,11 @@ fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1210,7 +1237,7 @@ --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 + -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 @@ -1341,9 +1368,9 @@ if $ac_init_version; then cat <<\_ACEOF pic16lib configure 0.3 -generated by GNU Autoconf 2.65 +generated by GNU Autoconf 2.69 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1358,7 +1385,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by pic16lib $as_me 0.3, which was -generated by GNU Autoconf 2.65. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -1468,11 +1495,9 @@ { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -1506,11 +1531,9 @@ ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -1523,11 +1546,9 @@ echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -1541,11 +1562,9 @@ fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -1600,7 +1619,12 @@ ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -1615,7 +1639,11 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } fi done @@ -1691,7 +1719,7 @@ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -1708,16 +1736,22 @@ ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done + 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 - as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -1746,7 +1780,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -1766,7 +1800,7 @@ # 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 as_fn_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. @@ -1833,11 +1867,11 @@ ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's @@ -1859,7 +1893,7 @@ # 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". - as_fn_error "ls -t appears to fail. Make sure there is not a broken + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi @@ -1869,7 +1903,7 @@ # Ok. : else - as_fn_error "newly created file is older than distributed files! + as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -1923,7 +1957,7 @@ set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -1935,7 +1969,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -1963,7 +1997,7 @@ set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -1975,7 +2009,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2016,7 +2050,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then : + if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2026,7 +2060,7 @@ test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ @@ -2067,7 +2101,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then : +if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -2079,7 +2113,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2107,7 +2141,7 @@ $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_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 : +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -2115,7 +2149,7 @@ all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +# 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;; @@ -2149,7 +2183,7 @@ am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then - as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi @@ -2244,7 +2278,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling support for PICs from unreleased gputils -- make sure you have up-to-date gputils from SVN." >&5 $as_echo "$as_me: Enabling support for PICs from unreleased gputils -- make sure you have up-to-date gputils from SVN." >&6;};; xno) NEWPICS=no;; - *) as_fn_error "bad value \"${enableval}\" for --enable-new-pics" "$LINENO" 5;; + *) as_fn_error $? "bad value \"${enableval}\" for --enable-new-pics" "$LINENO" 5;; esac else NEWPICS=no @@ -2275,7 +2309,7 @@ set dummy gpasm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CCAS+set}" = set; then : +if ${ac_cv_path_CCAS+:} false; then : $as_echo_n "(cached) " >&6 else case $CCAS in @@ -2289,7 +2323,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CCAS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2316,7 +2350,7 @@ set dummy gplink; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_LD+set}" = set; then : +if ${ac_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else case $LD in @@ -2330,7 +2364,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LD="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2357,7 +2391,7 @@ set dummy gplib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_AR+set}" = set; then : +if ${ac_cv_path_AR+:} false; then : $as_echo_n "(cached) " >&6 else case $AR in @@ -2371,7 +2405,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2397,7 +2431,7 @@ case ":$CCAS:$LD:$AR:" in *:::*) - as_fn_error "gputils (gpasm, gplink, and gplib) are required but not found. + as_fn_error $? "gputils (gpasm, gplink, and gplib) are required but not found. Either install gputils or reconfigure with --disable-pic14-port and --disable-pic16-port." "$LINENO" 5 ;; esac; @@ -2488,7 +2522,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : +if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -2616,7 +2650,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CCAS_dependencies_compiler_type+set}" = set; then : +if ${am_cv_CCAS_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -2812,10 +2846,21 @@ :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" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -2831,6 +2876,7 @@ ac_libobjs= ac_ltlibobjs= +U= 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$//' @@ -2847,23 +2893,23 @@ if test -z "${HAVE_NEW_PICS_TRUE}" && test -z "${HAVE_NEW_PICS_FALSE}"; then - as_fn_error "conditional \"HAVE_NEW_PICS\" was never defined. + as_fn_error $? "conditional \"HAVE_NEW_PICS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error "conditional \"AMDEP\" was never defined. + as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error "conditional \"am__fastdepCC\" was never defined. + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then - as_fn_error "conditional \"am__fastdepCCAS\" was never defined. + as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -2964,6 +3010,7 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3009,19 +3056,19 @@ (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -3159,16 +3206,16 @@ # ... 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'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -3217,7 +3264,7 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -3228,28 +3275,16 @@ 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 + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # 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'" @@ -3271,7 +3306,7 @@ # values after options handling. ac_log=" This file was extended by pic16lib $as_me 0.3, which was -generated by GNU Autoconf 2.65. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -3337,10 +3372,10 @@ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ pic16lib config.status 0.3 -configured by $0, generated by GNU Autoconf 2.65, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -3358,11 +3393,16 @@ while test $# != 0 do case $1 in - --*=*) + --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; *) ac_option=$1 ac_optarg=$2 @@ -3384,6 +3424,7 @@ $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; @@ -3396,7 +3437,7 @@ ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error "ambiguous option: \`$1' + as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; @@ -3405,7 +3446,7 @@ ac_cs_silent=: ;; # This is an error. - -*) as_fn_error "unrecognized option: \`$1' + -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" @@ -3425,7 +3466,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -3469,7 +3510,7 @@ "libsdcc/Makefile") CONFIG_FILES="$CONFIG_FILES libsdcc/Makefile" ;; "startup/Makefile") CONFIG_FILES="$CONFIG_FILES startup/Makefile" ;; - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -3492,9 +3533,10 @@ # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -3502,12 +3544,13 @@ { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -3524,12 +3567,12 @@ fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\r' + ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -3538,18 +3581,18 @@ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -3557,7 +3600,7 @@ rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -3605,7 +3648,7 @@ rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -3637,21 +3680,29 @@ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries 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/ + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// s/^[^=]*=[ ]*$// }' fi @@ -3663,7 +3714,7 @@ # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || +cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -3675,11 +3726,11 @@ # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -3764,7 +3815,7 @@ _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error "could not setup config headers machinery" "$LINENO" 5 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -3777,7 +3828,7 @@ esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -3796,7 +3847,7 @@ for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_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 `:'. @@ -3805,7 +3856,7 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -3831,8 +3882,8 @@ esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -3968,23 +4019,24 @@ s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 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"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 +which seems to be undefined. Please make sure it is defined" >&5 $as_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;} +which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -3993,21 +4045,21 @@ if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error "could not create -" "$LINENO" 5 + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" @@ -4157,7 +4209,7 @@ ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -4178,7 +4230,7 @@ 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 || as_fn_exit $? + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/debug/gstack/gstack.c sdcc-3.2.0+dfsg/device/lib/pic16/debug/gstack/gstack.c --- sdcc-3.1.0+dfsg/device/lib/pic16/debug/gstack/gstack.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/debug/gstack/gstack.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/iscntrl.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/iscntrl.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/iscntrl.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/iscntrl.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/isdigit.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/isdigit.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/isdigit.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/isdigit.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/isgraph.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/isgraph.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/isgraph.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/isgraph.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/islower.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/islower.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/islower.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/islower.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/isprint.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/isprint.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/isprint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/isprint.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/ispunct.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/ispunct.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/ispunct.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/ispunct.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/isspace.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/isspace.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/isspace.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/isspace.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/isupper.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/isupper.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/isupper.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/isupper.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/isxdigit.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/isxdigit.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/ctype/isxdigit.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/ctype/isxdigit.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/delay/delay100ktcy.S sdcc-3.2.0+dfsg/device/lib/pic16/libc/delay/delay100ktcy.S --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/delay/delay100ktcy.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/delay/delay100ktcy.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/delay/delay100tcy.S sdcc-3.2.0+dfsg/device/lib/pic16/libc/delay/delay100tcy.S --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/delay/delay100tcy.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/delay/delay100tcy.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/delay/delay10ktcy.S sdcc-3.2.0+dfsg/device/lib/pic16/libc/delay/delay10ktcy.S --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/delay/delay10ktcy.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/delay/delay10ktcy.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/delay/delay10tcy.S sdcc-3.2.0+dfsg/device/lib/pic16/libc/delay/delay10tcy.S --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/delay/delay10tcy.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/delay/delay10tcy.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/delay/delay1ktcy.S sdcc-3.2.0+dfsg/device/lib/pic16/libc/delay/delay1ktcy.S --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/delay/delay1ktcy.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/delay/delay1ktcy.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/delay/delay1mtcy.S sdcc-3.2.0+dfsg/device/lib/pic16/libc/delay/delay1mtcy.S --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/delay/delay1mtcy.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/delay/delay1mtcy.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/fprintf.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/fprintf.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/fprintf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/fprintf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/printf.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/printf.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/printf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/printf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/printf_small.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/printf_small.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/printf_small.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/printf_small.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/printf_tiny.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/printf_tiny.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/printf_tiny.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/printf_tiny.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/putchar.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/putchar.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/putchar.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/putchar.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/sprintf.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/sprintf.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/sprintf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/sprintf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/streams.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/streams.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/streams.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/streams.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/strmgpsim.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/strmgpsim.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/strmgpsim.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/strmgpsim.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/strmmssp.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/strmmssp.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/strmmssp.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/strmmssp.c 2012-04-19 22:14:15.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -26,7 +26,6 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ -extern WREG; extern SSPBUF; /* note that USART should already been initialized */ @@ -35,7 +34,7 @@ { (void)c; __asm - MOVWF _SSPBUF + MOVWF _SSPBUF, 0 RETURN __endasm; } diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/strmputchar.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/strmputchar.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/strmputchar.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/strmputchar.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/strmusart.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/strmusart.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/strmusart.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/strmusart.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/vfprintf.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/vfprintf.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/vfprintf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/vfprintf.c 2012-03-13 10:17:10.000000000 +0000 @@ -7,7 +7,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/vprintf.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/vprintf.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/vprintf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/vprintf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/vsprintf.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/vsprintf.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdio/vsprintf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdio/vsprintf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/atof.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/atof.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/atof.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/atof.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/atoi.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/atoi.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/atoi.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/atoi.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/atol.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/atol.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/atol.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/atol.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/calloc.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/calloc.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/calloc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/calloc.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/crc16.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/crc16.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/crc16.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/crc16.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/free.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/free.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/free.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/free.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/g_ftoa.S sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/g_ftoa.S --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/g_ftoa.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/g_ftoa.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/itoa.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/itoa.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/itoa.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/itoa.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/ltoa.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/ltoa.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/ltoa.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/ltoa.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/malloc.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/malloc.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/malloc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/malloc.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/memfree.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/memfree.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/memfree.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/memfree.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/memfreemax.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/memfreemax.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/memfreemax.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/memfreemax.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/memmisc.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/memmisc.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/memmisc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/memmisc.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/rand.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/rand.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/rand.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/rand.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/realloc.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/realloc.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/realloc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/realloc.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/x_ftoa.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/x_ftoa.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/stdlib/x_ftoa.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/stdlib/x_ftoa.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memccpy.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memccpy.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memccpy.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memccpy.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memchr.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memchr.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memchr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memchr.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memchrpgm.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memchrpgm.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memchrpgm.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memchrpgm.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memchrram.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memchrram.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memchrram.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memchrram.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memcmp.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memcmp.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memcmp.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memcmp.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memcpy.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memcpy.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memcpy.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memcpy.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memcpypgm2ram.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memcpypgm2ram.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memcpypgm2ram.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memcpypgm2ram.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memcpyram2ram.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memcpyram2ram.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memcpyram2ram.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memcpyram2ram.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memmove.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memmove.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memmove.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memmove.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memrchr.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memrchr.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memrchr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memrchr.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memset.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memset.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/memset.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/memset.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strcat.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strcat.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strcat.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strcat.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strchr.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strchr.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strchr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strchr.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strcmp.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strcmp.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strcmp.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strcmp.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strcpy.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strcpy.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strcpy.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strcpy.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strcspn.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strcspn.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strcspn.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strcspn.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strlen.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strlen.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strlen.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strlen.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strlwr.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strlwr.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strlwr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strlwr.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strncat.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strncat.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strncat.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strncat.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strncmp.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strncmp.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strncmp.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strncmp.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strncpy.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strncpy.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strncpy.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strncpy.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strpbrk.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strpbrk.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strpbrk.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strpbrk.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strrchr.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strrchr.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strrchr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strrchr.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strspn.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strspn.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strspn.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strspn.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strstr.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strstr.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strstr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strstr.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strtok.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strtok.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strtok.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strtok.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strupr.c sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strupr.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/string/strupr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/string/strupr.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/utils/cnvfrac.S sdcc-3.2.0+dfsg/device/lib/pic16/libc/utils/cnvfrac.S --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/utils/cnvfrac.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/utils/cnvfrac.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/utils/cnvint.S sdcc-3.2.0+dfsg/device/lib/pic16/libc/utils/cnvint.S --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/utils/cnvint.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/utils/cnvint.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libc/utils/cvtdec.S sdcc-3.2.0+dfsg/device/lib/pic16/libc/utils/cvtdec.S --- sdcc-3.1.0+dfsg/device/lib/pic16/libc/utils/cvtdec.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libc/utils/cvtdec.S 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/Makefile.am sdcc-3.2.0+dfsg/device/lib/pic16/libio/Makefile.am --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/Makefile.am 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/Makefile.am 2012-03-10 17:53:10.000000000 +0000 @@ -13,6 +13,16 @@ libio18f1220_a_SOURCES += usart/usartd.c libio18f1220_a_CFLAGS = -p18f1220 $(AM_CFLAGS) +lib_LIBRARIES += libio18f1230.a +libio18f1230_a_SOURCES = dummy.c +libio18f1230_a_SOURCES += adc/adcbusy.c adc/adcclose.c adc/adcconv.c +libio18f1230_a_SOURCES += adc/adcopen.c adc/adcread.c adc/adcsetch.c +libio18f1230_a_SOURCES += usart/ubaud.c usart/ubusy.c usart/uclose.c +libio18f1230_a_SOURCES += usart/udrdy.c usart/ugetc.c usart/ugets.c +libio18f1230_a_SOURCES += usart/uopen.c usart/uputc.c usart/uputs.c +libio18f1230_a_SOURCES += usart/usartd.c +libio18f1230_a_CFLAGS = -p18f1230 $(AM_CFLAGS) + lib_LIBRARIES += libio18f1320.a libio18f1320_a_SOURCES = dummy.c libio18f1320_a_SOURCES += adc/adcbusy.c adc/adcclose.c adc/adcconv.c @@ -23,6 +33,16 @@ libio18f1320_a_SOURCES += usart/usartd.c libio18f1320_a_CFLAGS = -p18f1320 $(AM_CFLAGS) +lib_LIBRARIES += libio18f1330.a +libio18f1330_a_SOURCES = dummy.c +libio18f1330_a_SOURCES += adc/adcbusy.c adc/adcclose.c adc/adcconv.c +libio18f1330_a_SOURCES += adc/adcopen.c adc/adcread.c adc/adcsetch.c +libio18f1330_a_SOURCES += usart/ubaud.c usart/ubusy.c usart/uclose.c +libio18f1330_a_SOURCES += usart/udrdy.c usart/ugetc.c usart/ugets.c +libio18f1330_a_SOURCES += usart/uopen.c usart/uputc.c usart/uputs.c +libio18f1330_a_SOURCES += usart/usartd.c +libio18f1330_a_CFLAGS = -p18f1330 $(AM_CFLAGS) + lib_LIBRARIES += libio18f13k50.a libio18f13k50_a_SOURCES = dummy.c libio18f13k50_a_SOURCES += adc/adcbusy.c adc/adcclose.c adc/adcconv.c @@ -136,9 +156,7 @@ libio18f23k20_a_SOURCES += usart/usartd.c libio18f23k20_a_CFLAGS = -p18f23k20 $(AM_CFLAGS) -if HAVE_NEW_PICS lib_LIBRARIES += libio18f23k22.a -endif HAVE_NEW_PICS libio18f23k22_a_SOURCES = dummy.c libio18f23k22_a_SOURCES += adc/adcbusy.c adc/adcclose.c adc/adcconv.c libio18f23k22_a_SOURCES += adc/adcopen.c adc/adcread.c adc/adcsetch.c @@ -321,9 +339,7 @@ libio18f24k20_a_SOURCES += usart/usartd.c libio18f24k20_a_CFLAGS = -p18f24k20 $(AM_CFLAGS) -if HAVE_NEW_PICS lib_LIBRARIES += libio18f24k22.a -endif HAVE_NEW_PICS libio18f24k22_a_SOURCES = dummy.c libio18f24k22_a_SOURCES += adc/adcbusy.c adc/adcclose.c adc/adcconv.c libio18f24k22_a_SOURCES += adc/adcopen.c adc/adcread.c adc/adcsetch.c @@ -533,9 +549,7 @@ libio18f25k20_a_SOURCES += usart/usartd.c libio18f25k20_a_CFLAGS = -p18f25k20 $(AM_CFLAGS) -if HAVE_NEW_PICS lib_LIBRARIES += libio18f25k22.a -endif HAVE_NEW_PICS libio18f25k22_a_SOURCES = dummy.c libio18f25k22_a_SOURCES += adc/adcbusy.c adc/adcclose.c adc/adcconv.c libio18f25k22_a_SOURCES += adc/adcopen.c adc/adcread.c adc/adcsetch.c @@ -655,9 +669,7 @@ libio18f26k20_a_SOURCES += usart/usartd.c libio18f26k20_a_CFLAGS = -p18f26k20 $(AM_CFLAGS) -if HAVE_NEW_PICS lib_LIBRARIES += libio18f26k22.a -endif HAVE_NEW_PICS libio18f26k22_a_SOURCES = dummy.c libio18f26k22_a_SOURCES += adc/adcbusy.c adc/adcclose.c adc/adcconv.c libio18f26k22_a_SOURCES += adc/adcopen.c adc/adcread.c adc/adcsetch.c @@ -755,9 +767,7 @@ libio18f43k20_a_SOURCES += usart/usartd.c libio18f43k20_a_CFLAGS = -p18f43k20 $(AM_CFLAGS) -if HAVE_NEW_PICS lib_LIBRARIES += libio18f43k22.a -endif HAVE_NEW_PICS libio18f43k22_a_SOURCES = dummy.c libio18f43k22_a_SOURCES += adc/adcbusy.c adc/adcclose.c adc/adcconv.c libio18f43k22_a_SOURCES += adc/adcopen.c adc/adcread.c adc/adcsetch.c @@ -940,9 +950,7 @@ libio18f44k20_a_SOURCES += usart/usartd.c libio18f44k20_a_CFLAGS = -p18f44k20 $(AM_CFLAGS) -if HAVE_NEW_PICS lib_LIBRARIES += libio18f44k22.a -endif HAVE_NEW_PICS libio18f44k22_a_SOURCES = dummy.c libio18f44k22_a_SOURCES += adc/adcbusy.c adc/adcclose.c adc/adcconv.c libio18f44k22_a_SOURCES += adc/adcopen.c adc/adcread.c adc/adcsetch.c @@ -1152,9 +1160,7 @@ libio18f45k20_a_SOURCES += usart/usartd.c libio18f45k20_a_CFLAGS = -p18f45k20 $(AM_CFLAGS) -if HAVE_NEW_PICS lib_LIBRARIES += libio18f45k22.a -endif HAVE_NEW_PICS libio18f45k22_a_SOURCES = dummy.c libio18f45k22_a_SOURCES += adc/adcbusy.c adc/adcclose.c adc/adcconv.c libio18f45k22_a_SOURCES += adc/adcopen.c adc/adcread.c adc/adcsetch.c @@ -1274,9 +1280,7 @@ libio18f46k20_a_SOURCES += usart/usartd.c libio18f46k20_a_CFLAGS = -p18f46k20 $(AM_CFLAGS) -if HAVE_NEW_PICS lib_LIBRARIES += libio18f46k22.a -endif HAVE_NEW_PICS libio18f46k22_a_SOURCES = dummy.c libio18f46k22_a_SOURCES += adc/adcbusy.c adc/adcclose.c adc/adcconv.c libio18f46k22_a_SOURCES += adc/adcopen.c adc/adcread.c adc/adcsetch.c diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/Makefile.in sdcc-3.2.0+dfsg/device/lib/pic16/libio/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/Makefile.in 2012-07-06 09:08:36.000000000 +0000 @@ -32,14 +32,6 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -@HAVE_NEW_PICS_TRUE@am__append_1 = libio18f23k22.a -@HAVE_NEW_PICS_TRUE@am__append_2 = libio18f24k22.a -@HAVE_NEW_PICS_TRUE@am__append_3 = libio18f25k22.a -@HAVE_NEW_PICS_TRUE@am__append_4 = libio18f26k22.a -@HAVE_NEW_PICS_TRUE@am__append_5 = libio18f43k22.a -@HAVE_NEW_PICS_TRUE@am__append_6 = libio18f44k22.a -@HAVE_NEW_PICS_TRUE@am__append_7 = libio18f45k22.a -@HAVE_NEW_PICS_TRUE@am__append_8 = libio18f46k22.a DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.common subdir = libio @@ -89,6 +81,21 @@ libio18f1220_a-uopen.$(OBJEXT) libio18f1220_a-uputc.$(OBJEXT) \ libio18f1220_a-uputs.$(OBJEXT) libio18f1220_a-usartd.$(OBJEXT) libio18f1220_a_OBJECTS = $(am_libio18f1220_a_OBJECTS) +libio18f1230_a_AR = $(AR) $(ARFLAGS) +libio18f1230_a_LIBADD = +am_libio18f1230_a_OBJECTS = libio18f1230_a-dummy.$(OBJEXT) \ + libio18f1230_a-adcbusy.$(OBJEXT) \ + libio18f1230_a-adcclose.$(OBJEXT) \ + libio18f1230_a-adcconv.$(OBJEXT) \ + libio18f1230_a-adcopen.$(OBJEXT) \ + libio18f1230_a-adcread.$(OBJEXT) \ + libio18f1230_a-adcsetch.$(OBJEXT) \ + libio18f1230_a-ubaud.$(OBJEXT) libio18f1230_a-ubusy.$(OBJEXT) \ + libio18f1230_a-uclose.$(OBJEXT) libio18f1230_a-udrdy.$(OBJEXT) \ + libio18f1230_a-ugetc.$(OBJEXT) libio18f1230_a-ugets.$(OBJEXT) \ + libio18f1230_a-uopen.$(OBJEXT) libio18f1230_a-uputc.$(OBJEXT) \ + libio18f1230_a-uputs.$(OBJEXT) libio18f1230_a-usartd.$(OBJEXT) +libio18f1230_a_OBJECTS = $(am_libio18f1230_a_OBJECTS) libio18f1320_a_AR = $(AR) $(ARFLAGS) libio18f1320_a_LIBADD = am_libio18f1320_a_OBJECTS = libio18f1320_a-dummy.$(OBJEXT) \ @@ -104,6 +111,21 @@ libio18f1320_a-uopen.$(OBJEXT) libio18f1320_a-uputc.$(OBJEXT) \ libio18f1320_a-uputs.$(OBJEXT) libio18f1320_a-usartd.$(OBJEXT) libio18f1320_a_OBJECTS = $(am_libio18f1320_a_OBJECTS) +libio18f1330_a_AR = $(AR) $(ARFLAGS) +libio18f1330_a_LIBADD = +am_libio18f1330_a_OBJECTS = libio18f1330_a-dummy.$(OBJEXT) \ + libio18f1330_a-adcbusy.$(OBJEXT) \ + libio18f1330_a-adcclose.$(OBJEXT) \ + libio18f1330_a-adcconv.$(OBJEXT) \ + libio18f1330_a-adcopen.$(OBJEXT) \ + libio18f1330_a-adcread.$(OBJEXT) \ + libio18f1330_a-adcsetch.$(OBJEXT) \ + libio18f1330_a-ubaud.$(OBJEXT) libio18f1330_a-ubusy.$(OBJEXT) \ + libio18f1330_a-uclose.$(OBJEXT) libio18f1330_a-udrdy.$(OBJEXT) \ + libio18f1330_a-ugetc.$(OBJEXT) libio18f1330_a-ugets.$(OBJEXT) \ + libio18f1330_a-uopen.$(OBJEXT) libio18f1330_a-uputc.$(OBJEXT) \ + libio18f1330_a-uputs.$(OBJEXT) libio18f1330_a-usartd.$(OBJEXT) +libio18f1330_a_OBJECTS = $(am_libio18f1330_a_OBJECTS) libio18f13k50_a_AR = $(AR) $(ARFLAGS) libio18f13k50_a_LIBADD = am_libio18f13k50_a_OBJECTS = libio18f13k50_a-dummy.$(OBJEXT) \ @@ -3623,7 +3645,8 @@ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libio18f1220_a_SOURCES) $(libio18f1320_a_SOURCES) \ +SOURCES = $(libio18f1220_a_SOURCES) $(libio18f1230_a_SOURCES) \ + $(libio18f1320_a_SOURCES) $(libio18f1330_a_SOURCES) \ $(libio18f13k50_a_SOURCES) $(libio18f14k50_a_SOURCES) \ $(libio18f2220_a_SOURCES) $(libio18f2221_a_SOURCES) \ $(libio18f2320_a_SOURCES) $(libio18f2321_a_SOURCES) \ @@ -3685,7 +3708,8 @@ $(libio18f87j50_a_SOURCES) $(libio18f87j60_a_SOURCES) \ $(libio18f96j60_a_SOURCES) $(libio18f96j65_a_SOURCES) \ $(libio18f97j60_a_SOURCES) -DIST_SOURCES = $(libio18f1220_a_SOURCES) $(libio18f1320_a_SOURCES) \ +DIST_SOURCES = $(libio18f1220_a_SOURCES) $(libio18f1230_a_SOURCES) \ + $(libio18f1320_a_SOURCES) $(libio18f1330_a_SOURCES) \ $(libio18f13k50_a_SOURCES) $(libio18f14k50_a_SOURCES) \ $(libio18f2220_a_SOURCES) $(libio18f2221_a_SOURCES) \ $(libio18f2320_a_SOURCES) $(libio18f2321_a_SOURCES) \ @@ -3837,50 +3861,62 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -lib_LIBRARIES = libio18f1220.a libio18f1320.a libio18f13k50.a \ - libio18f14k50.a libio18f2220.a libio18f2221.a libio18f2320.a \ - libio18f2321.a libio18f2331.a libio18f23k20.a $(am__append_1) \ - libio18f2410.a libio18f242.a libio18f2420.a libio18f2423.a \ - libio18f2431.a libio18f2450.a libio18f2455.a libio18f248.a \ - libio18f2480.a libio18f24j10.a libio18f24j50.a libio18f24k20.a \ - $(am__append_2) libio18f2510.a libio18f2515.a libio18f252.a \ - libio18f2520.a libio18f2523.a libio18f2525.a libio18f2550.a \ - libio18f258.a libio18f2580.a libio18f2585.a libio18f25j10.a \ - libio18f25j50.a libio18f25k20.a $(am__append_3) libio18f2610.a \ - libio18f2620.a libio18f2680.a libio18f2682.a libio18f2685.a \ - libio18f26j50.a libio18f26k20.a $(am__append_4) libio18f4220.a \ - libio18f4221.a libio18f4320.a libio18f4321.a libio18f4331.a \ - libio18f43k20.a $(am__append_5) libio18f4410.a libio18f442.a \ - libio18f4420.a libio18f4423.a libio18f4431.a libio18f4450.a \ - libio18f4455.a libio18f448.a libio18f4480.a libio18f44j10.a \ - libio18f44j50.a libio18f44k20.a $(am__append_6) libio18f4510.a \ - libio18f4515.a libio18f452.a libio18f4520.a libio18f4523.a \ - libio18f4525.a libio18f4550.a libio18f458.a libio18f4580.a \ - libio18f4585.a libio18f45j10.a libio18f45j50.a libio18f45k20.a \ - $(am__append_7) libio18f4610.a libio18f4620.a libio18f4680.a \ - libio18f4682.a libio18f4685.a libio18f46j50.a libio18f46k20.a \ - $(am__append_8) libio18f6520.a libio18f6527.a libio18f6585.a \ - libio18f65j50.a libio18f6620.a libio18f6622.a libio18f6627.a \ - libio18f6680.a libio18f66j50.a libio18f66j55.a libio18f66j60.a \ - libio18f66j65.a libio18f6720.a libio18f6722.a libio18f67j50.a \ - libio18f67j60.a libio18f8520.a libio18f8527.a libio18f8585.a \ - libio18f85j50.a libio18f8620.a libio18f8622.a libio18f8627.a \ - libio18f8680.a libio18f86j50.a libio18f86j55.a libio18f86j60.a \ - libio18f86j65.a libio18f8720.a libio18f8722.a libio18f87j50.a \ - libio18f87j60.a libio18f96j60.a libio18f96j65.a \ - libio18f97j60.a +lib_LIBRARIES = libio18f1220.a libio18f1230.a libio18f1320.a \ + libio18f1330.a libio18f13k50.a libio18f14k50.a libio18f2220.a \ + libio18f2221.a libio18f2320.a libio18f2321.a libio18f2331.a \ + libio18f23k20.a libio18f23k22.a libio18f2410.a libio18f242.a \ + libio18f2420.a libio18f2423.a libio18f2431.a libio18f2450.a \ + libio18f2455.a libio18f248.a libio18f2480.a libio18f24j10.a \ + libio18f24j50.a libio18f24k20.a libio18f24k22.a libio18f2510.a \ + libio18f2515.a libio18f252.a libio18f2520.a libio18f2523.a \ + libio18f2525.a libio18f2550.a libio18f258.a libio18f2580.a \ + libio18f2585.a libio18f25j10.a libio18f25j50.a libio18f25k20.a \ + libio18f25k22.a libio18f2610.a libio18f2620.a libio18f2680.a \ + libio18f2682.a libio18f2685.a libio18f26j50.a libio18f26k20.a \ + libio18f26k22.a libio18f4220.a libio18f4221.a libio18f4320.a \ + libio18f4321.a libio18f4331.a libio18f43k20.a libio18f43k22.a \ + libio18f4410.a libio18f442.a libio18f4420.a libio18f4423.a \ + libio18f4431.a libio18f4450.a libio18f4455.a libio18f448.a \ + libio18f4480.a libio18f44j10.a libio18f44j50.a libio18f44k20.a \ + libio18f44k22.a libio18f4510.a libio18f4515.a libio18f452.a \ + libio18f4520.a libio18f4523.a libio18f4525.a libio18f4550.a \ + libio18f458.a libio18f4580.a libio18f4585.a libio18f45j10.a \ + libio18f45j50.a libio18f45k20.a libio18f45k22.a libio18f4610.a \ + libio18f4620.a libio18f4680.a libio18f4682.a libio18f4685.a \ + libio18f46j50.a libio18f46k20.a libio18f46k22.a libio18f6520.a \ + libio18f6527.a libio18f6585.a libio18f65j50.a libio18f6620.a \ + libio18f6622.a libio18f6627.a libio18f6680.a libio18f66j50.a \ + libio18f66j55.a libio18f66j60.a libio18f66j65.a libio18f6720.a \ + libio18f6722.a libio18f67j50.a libio18f67j60.a libio18f8520.a \ + libio18f8527.a libio18f8585.a libio18f85j50.a libio18f8620.a \ + libio18f8622.a libio18f8627.a libio18f8680.a libio18f86j50.a \ + libio18f86j55.a libio18f86j60.a libio18f86j65.a libio18f8720.a \ + libio18f8722.a libio18f87j50.a libio18f87j60.a libio18f96j60.a \ + libio18f96j65.a libio18f97j60.a libio18f1220_a_SOURCES = dummy.c adc/adcbusy.c adc/adcclose.c \ adc/adcconv.c adc/adcopen.c adc/adcread.c adc/adcsetch.c \ usart/ubaud.c usart/ubusy.c usart/uclose.c usart/udrdy.c \ usart/ugetc.c usart/ugets.c usart/uopen.c usart/uputc.c \ usart/uputs.c usart/usartd.c libio18f1220_a_CFLAGS = -p18f1220 $(AM_CFLAGS) +libio18f1230_a_SOURCES = dummy.c adc/adcbusy.c adc/adcclose.c \ + adc/adcconv.c adc/adcopen.c adc/adcread.c adc/adcsetch.c \ + usart/ubaud.c usart/ubusy.c usart/uclose.c usart/udrdy.c \ + usart/ugetc.c usart/ugets.c usart/uopen.c usart/uputc.c \ + usart/uputs.c usart/usartd.c +libio18f1230_a_CFLAGS = -p18f1230 $(AM_CFLAGS) libio18f1320_a_SOURCES = dummy.c adc/adcbusy.c adc/adcclose.c \ adc/adcconv.c adc/adcopen.c adc/adcread.c adc/adcsetch.c \ usart/ubaud.c usart/ubusy.c usart/uclose.c usart/udrdy.c \ usart/ugetc.c usart/ugets.c usart/uopen.c usart/uputc.c \ usart/uputs.c usart/usartd.c libio18f1320_a_CFLAGS = -p18f1320 $(AM_CFLAGS) +libio18f1330_a_SOURCES = dummy.c adc/adcbusy.c adc/adcclose.c \ + adc/adcconv.c adc/adcopen.c adc/adcread.c adc/adcsetch.c \ + usart/ubaud.c usart/ubusy.c usart/uclose.c usart/udrdy.c \ + usart/ugetc.c usart/ugets.c usart/uopen.c usart/uputc.c \ + usart/uputs.c usart/usartd.c +libio18f1330_a_CFLAGS = -p18f1330 $(AM_CFLAGS) libio18f13k50_a_SOURCES = dummy.c adc/adcbusy.c adc/adcclose.c \ adc/adcconv.c adc/adcopen.c adc/adcread.c adc/adcsetch.c \ i2c/i2cack.c i2c/i2cclose.c i2c/i2cdrdy.c i2c/i2cidle.c \ @@ -5034,10 +5070,18 @@ -rm -f libio18f1220.a $(libio18f1220_a_AR) libio18f1220.a $(libio18f1220_a_OBJECTS) $(libio18f1220_a_LIBADD) $(RANLIB) libio18f1220.a +libio18f1230.a: $(libio18f1230_a_OBJECTS) $(libio18f1230_a_DEPENDENCIES) + -rm -f libio18f1230.a + $(libio18f1230_a_AR) libio18f1230.a $(libio18f1230_a_OBJECTS) $(libio18f1230_a_LIBADD) + $(RANLIB) libio18f1230.a libio18f1320.a: $(libio18f1320_a_OBJECTS) $(libio18f1320_a_DEPENDENCIES) -rm -f libio18f1320.a $(libio18f1320_a_AR) libio18f1320.a $(libio18f1320_a_OBJECTS) $(libio18f1320_a_LIBADD) $(RANLIB) libio18f1320.a +libio18f1330.a: $(libio18f1330_a_OBJECTS) $(libio18f1330_a_DEPENDENCIES) + -rm -f libio18f1330.a + $(libio18f1330_a_AR) libio18f1330.a $(libio18f1330_a_OBJECTS) $(libio18f1330_a_LIBADD) + $(RANLIB) libio18f1330.a libio18f13k50.a: $(libio18f13k50_a_OBJECTS) $(libio18f13k50_a_DEPENDENCIES) -rm -f libio18f13k50.a $(libio18f13k50_a_AR) libio18f13k50.a $(libio18f13k50_a_OBJECTS) $(libio18f13k50_a_LIBADD) @@ -5546,6 +5590,23 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1220_a-uputc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1220_a-uputs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1220_a-usartd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-adcbusy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-adcclose.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-adcconv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-adcopen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-adcread.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-adcsetch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-dummy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-ubaud.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-ubusy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-uclose.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-udrdy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-ugetc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-ugets.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-uopen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-uputc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-uputs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1230_a-usartd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1320_a-adcbusy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1320_a-adcclose.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1320_a-adcconv.Po@am__quote@ @@ -5563,6 +5624,23 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1320_a-uputc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1320_a-uputs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1320_a-usartd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-adcbusy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-adcclose.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-adcconv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-adcopen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-adcread.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-adcsetch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-dummy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-ubaud.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-ubusy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-uclose.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-udrdy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-ugetc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-ugets.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-uopen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-uputc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-uputs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f1330_a-usartd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f13k50_a-adcbusy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f13k50_a-adcclose.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libio18f13k50_a-adcconv.Po@am__quote@ @@ -9344,6 +9422,244 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1220_a_CFLAGS) $(CFLAGS) -c -o libio18f1220_a-usartd.obj `if test -f 'usart/usartd.c'; then $(CYGPATH_W) 'usart/usartd.c'; else $(CYGPATH_W) '$(srcdir)/usart/usartd.c'; fi` +libio18f1230_a-dummy.o: dummy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-dummy.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-dummy.Tpo -c -o libio18f1230_a-dummy.o `test -f 'dummy.c' || echo '$(srcdir)/'`dummy.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-dummy.Tpo $(DEPDIR)/libio18f1230_a-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dummy.c' object='libio18f1230_a-dummy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-dummy.o `test -f 'dummy.c' || echo '$(srcdir)/'`dummy.c + +libio18f1230_a-dummy.obj: dummy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-dummy.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-dummy.Tpo -c -o libio18f1230_a-dummy.obj `if test -f 'dummy.c'; then $(CYGPATH_W) 'dummy.c'; else $(CYGPATH_W) '$(srcdir)/dummy.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-dummy.Tpo $(DEPDIR)/libio18f1230_a-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dummy.c' object='libio18f1230_a-dummy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-dummy.obj `if test -f 'dummy.c'; then $(CYGPATH_W) 'dummy.c'; else $(CYGPATH_W) '$(srcdir)/dummy.c'; fi` + +libio18f1230_a-adcbusy.o: adc/adcbusy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-adcbusy.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-adcbusy.Tpo -c -o libio18f1230_a-adcbusy.o `test -f 'adc/adcbusy.c' || echo '$(srcdir)/'`adc/adcbusy.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-adcbusy.Tpo $(DEPDIR)/libio18f1230_a-adcbusy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcbusy.c' object='libio18f1230_a-adcbusy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-adcbusy.o `test -f 'adc/adcbusy.c' || echo '$(srcdir)/'`adc/adcbusy.c + +libio18f1230_a-adcbusy.obj: adc/adcbusy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-adcbusy.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-adcbusy.Tpo -c -o libio18f1230_a-adcbusy.obj `if test -f 'adc/adcbusy.c'; then $(CYGPATH_W) 'adc/adcbusy.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcbusy.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-adcbusy.Tpo $(DEPDIR)/libio18f1230_a-adcbusy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcbusy.c' object='libio18f1230_a-adcbusy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-adcbusy.obj `if test -f 'adc/adcbusy.c'; then $(CYGPATH_W) 'adc/adcbusy.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcbusy.c'; fi` + +libio18f1230_a-adcclose.o: adc/adcclose.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-adcclose.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-adcclose.Tpo -c -o libio18f1230_a-adcclose.o `test -f 'adc/adcclose.c' || echo '$(srcdir)/'`adc/adcclose.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-adcclose.Tpo $(DEPDIR)/libio18f1230_a-adcclose.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcclose.c' object='libio18f1230_a-adcclose.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-adcclose.o `test -f 'adc/adcclose.c' || echo '$(srcdir)/'`adc/adcclose.c + +libio18f1230_a-adcclose.obj: adc/adcclose.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-adcclose.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-adcclose.Tpo -c -o libio18f1230_a-adcclose.obj `if test -f 'adc/adcclose.c'; then $(CYGPATH_W) 'adc/adcclose.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcclose.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-adcclose.Tpo $(DEPDIR)/libio18f1230_a-adcclose.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcclose.c' object='libio18f1230_a-adcclose.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-adcclose.obj `if test -f 'adc/adcclose.c'; then $(CYGPATH_W) 'adc/adcclose.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcclose.c'; fi` + +libio18f1230_a-adcconv.o: adc/adcconv.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-adcconv.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-adcconv.Tpo -c -o libio18f1230_a-adcconv.o `test -f 'adc/adcconv.c' || echo '$(srcdir)/'`adc/adcconv.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-adcconv.Tpo $(DEPDIR)/libio18f1230_a-adcconv.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcconv.c' object='libio18f1230_a-adcconv.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-adcconv.o `test -f 'adc/adcconv.c' || echo '$(srcdir)/'`adc/adcconv.c + +libio18f1230_a-adcconv.obj: adc/adcconv.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-adcconv.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-adcconv.Tpo -c -o libio18f1230_a-adcconv.obj `if test -f 'adc/adcconv.c'; then $(CYGPATH_W) 'adc/adcconv.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcconv.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-adcconv.Tpo $(DEPDIR)/libio18f1230_a-adcconv.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcconv.c' object='libio18f1230_a-adcconv.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-adcconv.obj `if test -f 'adc/adcconv.c'; then $(CYGPATH_W) 'adc/adcconv.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcconv.c'; fi` + +libio18f1230_a-adcopen.o: adc/adcopen.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-adcopen.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-adcopen.Tpo -c -o libio18f1230_a-adcopen.o `test -f 'adc/adcopen.c' || echo '$(srcdir)/'`adc/adcopen.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-adcopen.Tpo $(DEPDIR)/libio18f1230_a-adcopen.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcopen.c' object='libio18f1230_a-adcopen.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-adcopen.o `test -f 'adc/adcopen.c' || echo '$(srcdir)/'`adc/adcopen.c + +libio18f1230_a-adcopen.obj: adc/adcopen.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-adcopen.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-adcopen.Tpo -c -o libio18f1230_a-adcopen.obj `if test -f 'adc/adcopen.c'; then $(CYGPATH_W) 'adc/adcopen.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcopen.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-adcopen.Tpo $(DEPDIR)/libio18f1230_a-adcopen.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcopen.c' object='libio18f1230_a-adcopen.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-adcopen.obj `if test -f 'adc/adcopen.c'; then $(CYGPATH_W) 'adc/adcopen.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcopen.c'; fi` + +libio18f1230_a-adcread.o: adc/adcread.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-adcread.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-adcread.Tpo -c -o libio18f1230_a-adcread.o `test -f 'adc/adcread.c' || echo '$(srcdir)/'`adc/adcread.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-adcread.Tpo $(DEPDIR)/libio18f1230_a-adcread.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcread.c' object='libio18f1230_a-adcread.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-adcread.o `test -f 'adc/adcread.c' || echo '$(srcdir)/'`adc/adcread.c + +libio18f1230_a-adcread.obj: adc/adcread.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-adcread.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-adcread.Tpo -c -o libio18f1230_a-adcread.obj `if test -f 'adc/adcread.c'; then $(CYGPATH_W) 'adc/adcread.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcread.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-adcread.Tpo $(DEPDIR)/libio18f1230_a-adcread.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcread.c' object='libio18f1230_a-adcread.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-adcread.obj `if test -f 'adc/adcread.c'; then $(CYGPATH_W) 'adc/adcread.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcread.c'; fi` + +libio18f1230_a-adcsetch.o: adc/adcsetch.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-adcsetch.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-adcsetch.Tpo -c -o libio18f1230_a-adcsetch.o `test -f 'adc/adcsetch.c' || echo '$(srcdir)/'`adc/adcsetch.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-adcsetch.Tpo $(DEPDIR)/libio18f1230_a-adcsetch.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcsetch.c' object='libio18f1230_a-adcsetch.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-adcsetch.o `test -f 'adc/adcsetch.c' || echo '$(srcdir)/'`adc/adcsetch.c + +libio18f1230_a-adcsetch.obj: adc/adcsetch.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-adcsetch.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-adcsetch.Tpo -c -o libio18f1230_a-adcsetch.obj `if test -f 'adc/adcsetch.c'; then $(CYGPATH_W) 'adc/adcsetch.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcsetch.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-adcsetch.Tpo $(DEPDIR)/libio18f1230_a-adcsetch.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcsetch.c' object='libio18f1230_a-adcsetch.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-adcsetch.obj `if test -f 'adc/adcsetch.c'; then $(CYGPATH_W) 'adc/adcsetch.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcsetch.c'; fi` + +libio18f1230_a-ubaud.o: usart/ubaud.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-ubaud.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-ubaud.Tpo -c -o libio18f1230_a-ubaud.o `test -f 'usart/ubaud.c' || echo '$(srcdir)/'`usart/ubaud.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-ubaud.Tpo $(DEPDIR)/libio18f1230_a-ubaud.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/ubaud.c' object='libio18f1230_a-ubaud.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-ubaud.o `test -f 'usart/ubaud.c' || echo '$(srcdir)/'`usart/ubaud.c + +libio18f1230_a-ubaud.obj: usart/ubaud.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-ubaud.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-ubaud.Tpo -c -o libio18f1230_a-ubaud.obj `if test -f 'usart/ubaud.c'; then $(CYGPATH_W) 'usart/ubaud.c'; else $(CYGPATH_W) '$(srcdir)/usart/ubaud.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-ubaud.Tpo $(DEPDIR)/libio18f1230_a-ubaud.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/ubaud.c' object='libio18f1230_a-ubaud.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-ubaud.obj `if test -f 'usart/ubaud.c'; then $(CYGPATH_W) 'usart/ubaud.c'; else $(CYGPATH_W) '$(srcdir)/usart/ubaud.c'; fi` + +libio18f1230_a-ubusy.o: usart/ubusy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-ubusy.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-ubusy.Tpo -c -o libio18f1230_a-ubusy.o `test -f 'usart/ubusy.c' || echo '$(srcdir)/'`usart/ubusy.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-ubusy.Tpo $(DEPDIR)/libio18f1230_a-ubusy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/ubusy.c' object='libio18f1230_a-ubusy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-ubusy.o `test -f 'usart/ubusy.c' || echo '$(srcdir)/'`usart/ubusy.c + +libio18f1230_a-ubusy.obj: usart/ubusy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-ubusy.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-ubusy.Tpo -c -o libio18f1230_a-ubusy.obj `if test -f 'usart/ubusy.c'; then $(CYGPATH_W) 'usart/ubusy.c'; else $(CYGPATH_W) '$(srcdir)/usart/ubusy.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-ubusy.Tpo $(DEPDIR)/libio18f1230_a-ubusy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/ubusy.c' object='libio18f1230_a-ubusy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-ubusy.obj `if test -f 'usart/ubusy.c'; then $(CYGPATH_W) 'usart/ubusy.c'; else $(CYGPATH_W) '$(srcdir)/usart/ubusy.c'; fi` + +libio18f1230_a-uclose.o: usart/uclose.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-uclose.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-uclose.Tpo -c -o libio18f1230_a-uclose.o `test -f 'usart/uclose.c' || echo '$(srcdir)/'`usart/uclose.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-uclose.Tpo $(DEPDIR)/libio18f1230_a-uclose.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/uclose.c' object='libio18f1230_a-uclose.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-uclose.o `test -f 'usart/uclose.c' || echo '$(srcdir)/'`usart/uclose.c + +libio18f1230_a-uclose.obj: usart/uclose.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-uclose.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-uclose.Tpo -c -o libio18f1230_a-uclose.obj `if test -f 'usart/uclose.c'; then $(CYGPATH_W) 'usart/uclose.c'; else $(CYGPATH_W) '$(srcdir)/usart/uclose.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-uclose.Tpo $(DEPDIR)/libio18f1230_a-uclose.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/uclose.c' object='libio18f1230_a-uclose.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-uclose.obj `if test -f 'usart/uclose.c'; then $(CYGPATH_W) 'usart/uclose.c'; else $(CYGPATH_W) '$(srcdir)/usart/uclose.c'; fi` + +libio18f1230_a-udrdy.o: usart/udrdy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-udrdy.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-udrdy.Tpo -c -o libio18f1230_a-udrdy.o `test -f 'usart/udrdy.c' || echo '$(srcdir)/'`usart/udrdy.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-udrdy.Tpo $(DEPDIR)/libio18f1230_a-udrdy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/udrdy.c' object='libio18f1230_a-udrdy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-udrdy.o `test -f 'usart/udrdy.c' || echo '$(srcdir)/'`usart/udrdy.c + +libio18f1230_a-udrdy.obj: usart/udrdy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-udrdy.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-udrdy.Tpo -c -o libio18f1230_a-udrdy.obj `if test -f 'usart/udrdy.c'; then $(CYGPATH_W) 'usart/udrdy.c'; else $(CYGPATH_W) '$(srcdir)/usart/udrdy.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-udrdy.Tpo $(DEPDIR)/libio18f1230_a-udrdy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/udrdy.c' object='libio18f1230_a-udrdy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-udrdy.obj `if test -f 'usart/udrdy.c'; then $(CYGPATH_W) 'usart/udrdy.c'; else $(CYGPATH_W) '$(srcdir)/usart/udrdy.c'; fi` + +libio18f1230_a-ugetc.o: usart/ugetc.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-ugetc.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-ugetc.Tpo -c -o libio18f1230_a-ugetc.o `test -f 'usart/ugetc.c' || echo '$(srcdir)/'`usart/ugetc.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-ugetc.Tpo $(DEPDIR)/libio18f1230_a-ugetc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/ugetc.c' object='libio18f1230_a-ugetc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-ugetc.o `test -f 'usart/ugetc.c' || echo '$(srcdir)/'`usart/ugetc.c + +libio18f1230_a-ugetc.obj: usart/ugetc.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-ugetc.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-ugetc.Tpo -c -o libio18f1230_a-ugetc.obj `if test -f 'usart/ugetc.c'; then $(CYGPATH_W) 'usart/ugetc.c'; else $(CYGPATH_W) '$(srcdir)/usart/ugetc.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-ugetc.Tpo $(DEPDIR)/libio18f1230_a-ugetc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/ugetc.c' object='libio18f1230_a-ugetc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-ugetc.obj `if test -f 'usart/ugetc.c'; then $(CYGPATH_W) 'usart/ugetc.c'; else $(CYGPATH_W) '$(srcdir)/usart/ugetc.c'; fi` + +libio18f1230_a-ugets.o: usart/ugets.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-ugets.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-ugets.Tpo -c -o libio18f1230_a-ugets.o `test -f 'usart/ugets.c' || echo '$(srcdir)/'`usart/ugets.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-ugets.Tpo $(DEPDIR)/libio18f1230_a-ugets.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/ugets.c' object='libio18f1230_a-ugets.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-ugets.o `test -f 'usart/ugets.c' || echo '$(srcdir)/'`usart/ugets.c + +libio18f1230_a-ugets.obj: usart/ugets.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-ugets.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-ugets.Tpo -c -o libio18f1230_a-ugets.obj `if test -f 'usart/ugets.c'; then $(CYGPATH_W) 'usart/ugets.c'; else $(CYGPATH_W) '$(srcdir)/usart/ugets.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-ugets.Tpo $(DEPDIR)/libio18f1230_a-ugets.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/ugets.c' object='libio18f1230_a-ugets.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-ugets.obj `if test -f 'usart/ugets.c'; then $(CYGPATH_W) 'usart/ugets.c'; else $(CYGPATH_W) '$(srcdir)/usart/ugets.c'; fi` + +libio18f1230_a-uopen.o: usart/uopen.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-uopen.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-uopen.Tpo -c -o libio18f1230_a-uopen.o `test -f 'usart/uopen.c' || echo '$(srcdir)/'`usart/uopen.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-uopen.Tpo $(DEPDIR)/libio18f1230_a-uopen.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/uopen.c' object='libio18f1230_a-uopen.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-uopen.o `test -f 'usart/uopen.c' || echo '$(srcdir)/'`usart/uopen.c + +libio18f1230_a-uopen.obj: usart/uopen.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-uopen.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-uopen.Tpo -c -o libio18f1230_a-uopen.obj `if test -f 'usart/uopen.c'; then $(CYGPATH_W) 'usart/uopen.c'; else $(CYGPATH_W) '$(srcdir)/usart/uopen.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-uopen.Tpo $(DEPDIR)/libio18f1230_a-uopen.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/uopen.c' object='libio18f1230_a-uopen.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-uopen.obj `if test -f 'usart/uopen.c'; then $(CYGPATH_W) 'usart/uopen.c'; else $(CYGPATH_W) '$(srcdir)/usart/uopen.c'; fi` + +libio18f1230_a-uputc.o: usart/uputc.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-uputc.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-uputc.Tpo -c -o libio18f1230_a-uputc.o `test -f 'usart/uputc.c' || echo '$(srcdir)/'`usart/uputc.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-uputc.Tpo $(DEPDIR)/libio18f1230_a-uputc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/uputc.c' object='libio18f1230_a-uputc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-uputc.o `test -f 'usart/uputc.c' || echo '$(srcdir)/'`usart/uputc.c + +libio18f1230_a-uputc.obj: usart/uputc.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-uputc.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-uputc.Tpo -c -o libio18f1230_a-uputc.obj `if test -f 'usart/uputc.c'; then $(CYGPATH_W) 'usart/uputc.c'; else $(CYGPATH_W) '$(srcdir)/usart/uputc.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-uputc.Tpo $(DEPDIR)/libio18f1230_a-uputc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/uputc.c' object='libio18f1230_a-uputc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-uputc.obj `if test -f 'usart/uputc.c'; then $(CYGPATH_W) 'usart/uputc.c'; else $(CYGPATH_W) '$(srcdir)/usart/uputc.c'; fi` + +libio18f1230_a-uputs.o: usart/uputs.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-uputs.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-uputs.Tpo -c -o libio18f1230_a-uputs.o `test -f 'usart/uputs.c' || echo '$(srcdir)/'`usart/uputs.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-uputs.Tpo $(DEPDIR)/libio18f1230_a-uputs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/uputs.c' object='libio18f1230_a-uputs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-uputs.o `test -f 'usart/uputs.c' || echo '$(srcdir)/'`usart/uputs.c + +libio18f1230_a-uputs.obj: usart/uputs.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-uputs.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-uputs.Tpo -c -o libio18f1230_a-uputs.obj `if test -f 'usart/uputs.c'; then $(CYGPATH_W) 'usart/uputs.c'; else $(CYGPATH_W) '$(srcdir)/usart/uputs.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-uputs.Tpo $(DEPDIR)/libio18f1230_a-uputs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/uputs.c' object='libio18f1230_a-uputs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-uputs.obj `if test -f 'usart/uputs.c'; then $(CYGPATH_W) 'usart/uputs.c'; else $(CYGPATH_W) '$(srcdir)/usart/uputs.c'; fi` + +libio18f1230_a-usartd.o: usart/usartd.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-usartd.o -MD -MP -MF $(DEPDIR)/libio18f1230_a-usartd.Tpo -c -o libio18f1230_a-usartd.o `test -f 'usart/usartd.c' || echo '$(srcdir)/'`usart/usartd.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-usartd.Tpo $(DEPDIR)/libio18f1230_a-usartd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/usartd.c' object='libio18f1230_a-usartd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-usartd.o `test -f 'usart/usartd.c' || echo '$(srcdir)/'`usart/usartd.c + +libio18f1230_a-usartd.obj: usart/usartd.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -MT libio18f1230_a-usartd.obj -MD -MP -MF $(DEPDIR)/libio18f1230_a-usartd.Tpo -c -o libio18f1230_a-usartd.obj `if test -f 'usart/usartd.c'; then $(CYGPATH_W) 'usart/usartd.c'; else $(CYGPATH_W) '$(srcdir)/usart/usartd.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1230_a-usartd.Tpo $(DEPDIR)/libio18f1230_a-usartd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/usartd.c' object='libio18f1230_a-usartd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1230_a_CFLAGS) $(CFLAGS) -c -o libio18f1230_a-usartd.obj `if test -f 'usart/usartd.c'; then $(CYGPATH_W) 'usart/usartd.c'; else $(CYGPATH_W) '$(srcdir)/usart/usartd.c'; fi` + libio18f1320_a-dummy.o: dummy.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1320_a_CFLAGS) $(CFLAGS) -MT libio18f1320_a-dummy.o -MD -MP -MF $(DEPDIR)/libio18f1320_a-dummy.Tpo -c -o libio18f1320_a-dummy.o `test -f 'dummy.c' || echo '$(srcdir)/'`dummy.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1320_a-dummy.Tpo $(DEPDIR)/libio18f1320_a-dummy.Po @@ -9582,6 +9898,244 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1320_a_CFLAGS) $(CFLAGS) -c -o libio18f1320_a-usartd.obj `if test -f 'usart/usartd.c'; then $(CYGPATH_W) 'usart/usartd.c'; else $(CYGPATH_W) '$(srcdir)/usart/usartd.c'; fi` +libio18f1330_a-dummy.o: dummy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-dummy.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-dummy.Tpo -c -o libio18f1330_a-dummy.o `test -f 'dummy.c' || echo '$(srcdir)/'`dummy.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-dummy.Tpo $(DEPDIR)/libio18f1330_a-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dummy.c' object='libio18f1330_a-dummy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-dummy.o `test -f 'dummy.c' || echo '$(srcdir)/'`dummy.c + +libio18f1330_a-dummy.obj: dummy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-dummy.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-dummy.Tpo -c -o libio18f1330_a-dummy.obj `if test -f 'dummy.c'; then $(CYGPATH_W) 'dummy.c'; else $(CYGPATH_W) '$(srcdir)/dummy.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-dummy.Tpo $(DEPDIR)/libio18f1330_a-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dummy.c' object='libio18f1330_a-dummy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-dummy.obj `if test -f 'dummy.c'; then $(CYGPATH_W) 'dummy.c'; else $(CYGPATH_W) '$(srcdir)/dummy.c'; fi` + +libio18f1330_a-adcbusy.o: adc/adcbusy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-adcbusy.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-adcbusy.Tpo -c -o libio18f1330_a-adcbusy.o `test -f 'adc/adcbusy.c' || echo '$(srcdir)/'`adc/adcbusy.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-adcbusy.Tpo $(DEPDIR)/libio18f1330_a-adcbusy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcbusy.c' object='libio18f1330_a-adcbusy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-adcbusy.o `test -f 'adc/adcbusy.c' || echo '$(srcdir)/'`adc/adcbusy.c + +libio18f1330_a-adcbusy.obj: adc/adcbusy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-adcbusy.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-adcbusy.Tpo -c -o libio18f1330_a-adcbusy.obj `if test -f 'adc/adcbusy.c'; then $(CYGPATH_W) 'adc/adcbusy.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcbusy.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-adcbusy.Tpo $(DEPDIR)/libio18f1330_a-adcbusy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcbusy.c' object='libio18f1330_a-adcbusy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-adcbusy.obj `if test -f 'adc/adcbusy.c'; then $(CYGPATH_W) 'adc/adcbusy.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcbusy.c'; fi` + +libio18f1330_a-adcclose.o: adc/adcclose.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-adcclose.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-adcclose.Tpo -c -o libio18f1330_a-adcclose.o `test -f 'adc/adcclose.c' || echo '$(srcdir)/'`adc/adcclose.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-adcclose.Tpo $(DEPDIR)/libio18f1330_a-adcclose.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcclose.c' object='libio18f1330_a-adcclose.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-adcclose.o `test -f 'adc/adcclose.c' || echo '$(srcdir)/'`adc/adcclose.c + +libio18f1330_a-adcclose.obj: adc/adcclose.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-adcclose.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-adcclose.Tpo -c -o libio18f1330_a-adcclose.obj `if test -f 'adc/adcclose.c'; then $(CYGPATH_W) 'adc/adcclose.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcclose.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-adcclose.Tpo $(DEPDIR)/libio18f1330_a-adcclose.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcclose.c' object='libio18f1330_a-adcclose.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-adcclose.obj `if test -f 'adc/adcclose.c'; then $(CYGPATH_W) 'adc/adcclose.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcclose.c'; fi` + +libio18f1330_a-adcconv.o: adc/adcconv.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-adcconv.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-adcconv.Tpo -c -o libio18f1330_a-adcconv.o `test -f 'adc/adcconv.c' || echo '$(srcdir)/'`adc/adcconv.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-adcconv.Tpo $(DEPDIR)/libio18f1330_a-adcconv.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcconv.c' object='libio18f1330_a-adcconv.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-adcconv.o `test -f 'adc/adcconv.c' || echo '$(srcdir)/'`adc/adcconv.c + +libio18f1330_a-adcconv.obj: adc/adcconv.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-adcconv.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-adcconv.Tpo -c -o libio18f1330_a-adcconv.obj `if test -f 'adc/adcconv.c'; then $(CYGPATH_W) 'adc/adcconv.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcconv.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-adcconv.Tpo $(DEPDIR)/libio18f1330_a-adcconv.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcconv.c' object='libio18f1330_a-adcconv.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-adcconv.obj `if test -f 'adc/adcconv.c'; then $(CYGPATH_W) 'adc/adcconv.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcconv.c'; fi` + +libio18f1330_a-adcopen.o: adc/adcopen.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-adcopen.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-adcopen.Tpo -c -o libio18f1330_a-adcopen.o `test -f 'adc/adcopen.c' || echo '$(srcdir)/'`adc/adcopen.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-adcopen.Tpo $(DEPDIR)/libio18f1330_a-adcopen.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcopen.c' object='libio18f1330_a-adcopen.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-adcopen.o `test -f 'adc/adcopen.c' || echo '$(srcdir)/'`adc/adcopen.c + +libio18f1330_a-adcopen.obj: adc/adcopen.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-adcopen.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-adcopen.Tpo -c -o libio18f1330_a-adcopen.obj `if test -f 'adc/adcopen.c'; then $(CYGPATH_W) 'adc/adcopen.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcopen.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-adcopen.Tpo $(DEPDIR)/libio18f1330_a-adcopen.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcopen.c' object='libio18f1330_a-adcopen.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-adcopen.obj `if test -f 'adc/adcopen.c'; then $(CYGPATH_W) 'adc/adcopen.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcopen.c'; fi` + +libio18f1330_a-adcread.o: adc/adcread.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-adcread.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-adcread.Tpo -c -o libio18f1330_a-adcread.o `test -f 'adc/adcread.c' || echo '$(srcdir)/'`adc/adcread.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-adcread.Tpo $(DEPDIR)/libio18f1330_a-adcread.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcread.c' object='libio18f1330_a-adcread.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-adcread.o `test -f 'adc/adcread.c' || echo '$(srcdir)/'`adc/adcread.c + +libio18f1330_a-adcread.obj: adc/adcread.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-adcread.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-adcread.Tpo -c -o libio18f1330_a-adcread.obj `if test -f 'adc/adcread.c'; then $(CYGPATH_W) 'adc/adcread.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcread.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-adcread.Tpo $(DEPDIR)/libio18f1330_a-adcread.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcread.c' object='libio18f1330_a-adcread.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-adcread.obj `if test -f 'adc/adcread.c'; then $(CYGPATH_W) 'adc/adcread.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcread.c'; fi` + +libio18f1330_a-adcsetch.o: adc/adcsetch.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-adcsetch.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-adcsetch.Tpo -c -o libio18f1330_a-adcsetch.o `test -f 'adc/adcsetch.c' || echo '$(srcdir)/'`adc/adcsetch.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-adcsetch.Tpo $(DEPDIR)/libio18f1330_a-adcsetch.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcsetch.c' object='libio18f1330_a-adcsetch.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-adcsetch.o `test -f 'adc/adcsetch.c' || echo '$(srcdir)/'`adc/adcsetch.c + +libio18f1330_a-adcsetch.obj: adc/adcsetch.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-adcsetch.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-adcsetch.Tpo -c -o libio18f1330_a-adcsetch.obj `if test -f 'adc/adcsetch.c'; then $(CYGPATH_W) 'adc/adcsetch.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcsetch.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-adcsetch.Tpo $(DEPDIR)/libio18f1330_a-adcsetch.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc/adcsetch.c' object='libio18f1330_a-adcsetch.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-adcsetch.obj `if test -f 'adc/adcsetch.c'; then $(CYGPATH_W) 'adc/adcsetch.c'; else $(CYGPATH_W) '$(srcdir)/adc/adcsetch.c'; fi` + +libio18f1330_a-ubaud.o: usart/ubaud.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-ubaud.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-ubaud.Tpo -c -o libio18f1330_a-ubaud.o `test -f 'usart/ubaud.c' || echo '$(srcdir)/'`usart/ubaud.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-ubaud.Tpo $(DEPDIR)/libio18f1330_a-ubaud.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/ubaud.c' object='libio18f1330_a-ubaud.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-ubaud.o `test -f 'usart/ubaud.c' || echo '$(srcdir)/'`usart/ubaud.c + +libio18f1330_a-ubaud.obj: usart/ubaud.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-ubaud.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-ubaud.Tpo -c -o libio18f1330_a-ubaud.obj `if test -f 'usart/ubaud.c'; then $(CYGPATH_W) 'usart/ubaud.c'; else $(CYGPATH_W) '$(srcdir)/usart/ubaud.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-ubaud.Tpo $(DEPDIR)/libio18f1330_a-ubaud.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/ubaud.c' object='libio18f1330_a-ubaud.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-ubaud.obj `if test -f 'usart/ubaud.c'; then $(CYGPATH_W) 'usart/ubaud.c'; else $(CYGPATH_W) '$(srcdir)/usart/ubaud.c'; fi` + +libio18f1330_a-ubusy.o: usart/ubusy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-ubusy.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-ubusy.Tpo -c -o libio18f1330_a-ubusy.o `test -f 'usart/ubusy.c' || echo '$(srcdir)/'`usart/ubusy.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-ubusy.Tpo $(DEPDIR)/libio18f1330_a-ubusy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/ubusy.c' object='libio18f1330_a-ubusy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-ubusy.o `test -f 'usart/ubusy.c' || echo '$(srcdir)/'`usart/ubusy.c + +libio18f1330_a-ubusy.obj: usart/ubusy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-ubusy.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-ubusy.Tpo -c -o libio18f1330_a-ubusy.obj `if test -f 'usart/ubusy.c'; then $(CYGPATH_W) 'usart/ubusy.c'; else $(CYGPATH_W) '$(srcdir)/usart/ubusy.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-ubusy.Tpo $(DEPDIR)/libio18f1330_a-ubusy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/ubusy.c' object='libio18f1330_a-ubusy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-ubusy.obj `if test -f 'usart/ubusy.c'; then $(CYGPATH_W) 'usart/ubusy.c'; else $(CYGPATH_W) '$(srcdir)/usart/ubusy.c'; fi` + +libio18f1330_a-uclose.o: usart/uclose.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-uclose.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-uclose.Tpo -c -o libio18f1330_a-uclose.o `test -f 'usart/uclose.c' || echo '$(srcdir)/'`usart/uclose.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-uclose.Tpo $(DEPDIR)/libio18f1330_a-uclose.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/uclose.c' object='libio18f1330_a-uclose.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-uclose.o `test -f 'usart/uclose.c' || echo '$(srcdir)/'`usart/uclose.c + +libio18f1330_a-uclose.obj: usart/uclose.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-uclose.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-uclose.Tpo -c -o libio18f1330_a-uclose.obj `if test -f 'usart/uclose.c'; then $(CYGPATH_W) 'usart/uclose.c'; else $(CYGPATH_W) '$(srcdir)/usart/uclose.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-uclose.Tpo $(DEPDIR)/libio18f1330_a-uclose.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/uclose.c' object='libio18f1330_a-uclose.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-uclose.obj `if test -f 'usart/uclose.c'; then $(CYGPATH_W) 'usart/uclose.c'; else $(CYGPATH_W) '$(srcdir)/usart/uclose.c'; fi` + +libio18f1330_a-udrdy.o: usart/udrdy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-udrdy.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-udrdy.Tpo -c -o libio18f1330_a-udrdy.o `test -f 'usart/udrdy.c' || echo '$(srcdir)/'`usart/udrdy.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-udrdy.Tpo $(DEPDIR)/libio18f1330_a-udrdy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/udrdy.c' object='libio18f1330_a-udrdy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-udrdy.o `test -f 'usart/udrdy.c' || echo '$(srcdir)/'`usart/udrdy.c + +libio18f1330_a-udrdy.obj: usart/udrdy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-udrdy.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-udrdy.Tpo -c -o libio18f1330_a-udrdy.obj `if test -f 'usart/udrdy.c'; then $(CYGPATH_W) 'usart/udrdy.c'; else $(CYGPATH_W) '$(srcdir)/usart/udrdy.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-udrdy.Tpo $(DEPDIR)/libio18f1330_a-udrdy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/udrdy.c' object='libio18f1330_a-udrdy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-udrdy.obj `if test -f 'usart/udrdy.c'; then $(CYGPATH_W) 'usart/udrdy.c'; else $(CYGPATH_W) '$(srcdir)/usart/udrdy.c'; fi` + +libio18f1330_a-ugetc.o: usart/ugetc.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-ugetc.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-ugetc.Tpo -c -o libio18f1330_a-ugetc.o `test -f 'usart/ugetc.c' || echo '$(srcdir)/'`usart/ugetc.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-ugetc.Tpo $(DEPDIR)/libio18f1330_a-ugetc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/ugetc.c' object='libio18f1330_a-ugetc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-ugetc.o `test -f 'usart/ugetc.c' || echo '$(srcdir)/'`usart/ugetc.c + +libio18f1330_a-ugetc.obj: usart/ugetc.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-ugetc.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-ugetc.Tpo -c -o libio18f1330_a-ugetc.obj `if test -f 'usart/ugetc.c'; then $(CYGPATH_W) 'usart/ugetc.c'; else $(CYGPATH_W) '$(srcdir)/usart/ugetc.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-ugetc.Tpo $(DEPDIR)/libio18f1330_a-ugetc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/ugetc.c' object='libio18f1330_a-ugetc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-ugetc.obj `if test -f 'usart/ugetc.c'; then $(CYGPATH_W) 'usart/ugetc.c'; else $(CYGPATH_W) '$(srcdir)/usart/ugetc.c'; fi` + +libio18f1330_a-ugets.o: usart/ugets.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-ugets.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-ugets.Tpo -c -o libio18f1330_a-ugets.o `test -f 'usart/ugets.c' || echo '$(srcdir)/'`usart/ugets.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-ugets.Tpo $(DEPDIR)/libio18f1330_a-ugets.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/ugets.c' object='libio18f1330_a-ugets.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-ugets.o `test -f 'usart/ugets.c' || echo '$(srcdir)/'`usart/ugets.c + +libio18f1330_a-ugets.obj: usart/ugets.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-ugets.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-ugets.Tpo -c -o libio18f1330_a-ugets.obj `if test -f 'usart/ugets.c'; then $(CYGPATH_W) 'usart/ugets.c'; else $(CYGPATH_W) '$(srcdir)/usart/ugets.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-ugets.Tpo $(DEPDIR)/libio18f1330_a-ugets.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/ugets.c' object='libio18f1330_a-ugets.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-ugets.obj `if test -f 'usart/ugets.c'; then $(CYGPATH_W) 'usart/ugets.c'; else $(CYGPATH_W) '$(srcdir)/usart/ugets.c'; fi` + +libio18f1330_a-uopen.o: usart/uopen.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-uopen.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-uopen.Tpo -c -o libio18f1330_a-uopen.o `test -f 'usart/uopen.c' || echo '$(srcdir)/'`usart/uopen.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-uopen.Tpo $(DEPDIR)/libio18f1330_a-uopen.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/uopen.c' object='libio18f1330_a-uopen.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-uopen.o `test -f 'usart/uopen.c' || echo '$(srcdir)/'`usart/uopen.c + +libio18f1330_a-uopen.obj: usart/uopen.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-uopen.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-uopen.Tpo -c -o libio18f1330_a-uopen.obj `if test -f 'usart/uopen.c'; then $(CYGPATH_W) 'usart/uopen.c'; else $(CYGPATH_W) '$(srcdir)/usart/uopen.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-uopen.Tpo $(DEPDIR)/libio18f1330_a-uopen.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/uopen.c' object='libio18f1330_a-uopen.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-uopen.obj `if test -f 'usart/uopen.c'; then $(CYGPATH_W) 'usart/uopen.c'; else $(CYGPATH_W) '$(srcdir)/usart/uopen.c'; fi` + +libio18f1330_a-uputc.o: usart/uputc.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-uputc.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-uputc.Tpo -c -o libio18f1330_a-uputc.o `test -f 'usart/uputc.c' || echo '$(srcdir)/'`usart/uputc.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-uputc.Tpo $(DEPDIR)/libio18f1330_a-uputc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/uputc.c' object='libio18f1330_a-uputc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-uputc.o `test -f 'usart/uputc.c' || echo '$(srcdir)/'`usart/uputc.c + +libio18f1330_a-uputc.obj: usart/uputc.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-uputc.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-uputc.Tpo -c -o libio18f1330_a-uputc.obj `if test -f 'usart/uputc.c'; then $(CYGPATH_W) 'usart/uputc.c'; else $(CYGPATH_W) '$(srcdir)/usart/uputc.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-uputc.Tpo $(DEPDIR)/libio18f1330_a-uputc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/uputc.c' object='libio18f1330_a-uputc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-uputc.obj `if test -f 'usart/uputc.c'; then $(CYGPATH_W) 'usart/uputc.c'; else $(CYGPATH_W) '$(srcdir)/usart/uputc.c'; fi` + +libio18f1330_a-uputs.o: usart/uputs.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-uputs.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-uputs.Tpo -c -o libio18f1330_a-uputs.o `test -f 'usart/uputs.c' || echo '$(srcdir)/'`usart/uputs.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-uputs.Tpo $(DEPDIR)/libio18f1330_a-uputs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/uputs.c' object='libio18f1330_a-uputs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-uputs.o `test -f 'usart/uputs.c' || echo '$(srcdir)/'`usart/uputs.c + +libio18f1330_a-uputs.obj: usart/uputs.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-uputs.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-uputs.Tpo -c -o libio18f1330_a-uputs.obj `if test -f 'usart/uputs.c'; then $(CYGPATH_W) 'usart/uputs.c'; else $(CYGPATH_W) '$(srcdir)/usart/uputs.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-uputs.Tpo $(DEPDIR)/libio18f1330_a-uputs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/uputs.c' object='libio18f1330_a-uputs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-uputs.obj `if test -f 'usart/uputs.c'; then $(CYGPATH_W) 'usart/uputs.c'; else $(CYGPATH_W) '$(srcdir)/usart/uputs.c'; fi` + +libio18f1330_a-usartd.o: usart/usartd.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-usartd.o -MD -MP -MF $(DEPDIR)/libio18f1330_a-usartd.Tpo -c -o libio18f1330_a-usartd.o `test -f 'usart/usartd.c' || echo '$(srcdir)/'`usart/usartd.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-usartd.Tpo $(DEPDIR)/libio18f1330_a-usartd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/usartd.c' object='libio18f1330_a-usartd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-usartd.o `test -f 'usart/usartd.c' || echo '$(srcdir)/'`usart/usartd.c + +libio18f1330_a-usartd.obj: usart/usartd.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -MT libio18f1330_a-usartd.obj -MD -MP -MF $(DEPDIR)/libio18f1330_a-usartd.Tpo -c -o libio18f1330_a-usartd.obj `if test -f 'usart/usartd.c'; then $(CYGPATH_W) 'usart/usartd.c'; else $(CYGPATH_W) '$(srcdir)/usart/usartd.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f1330_a-usartd.Tpo $(DEPDIR)/libio18f1330_a-usartd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usart/usartd.c' object='libio18f1330_a-usartd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f1330_a_CFLAGS) $(CFLAGS) -c -o libio18f1330_a-usartd.obj `if test -f 'usart/usartd.c'; then $(CYGPATH_W) 'usart/usartd.c'; else $(CYGPATH_W) '$(srcdir)/usart/usartd.c'; fi` + libio18f13k50_a-dummy.o: dummy.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libio18f13k50_a_CFLAGS) $(CFLAGS) -MT libio18f13k50_a-dummy.o -MD -MP -MF $(DEPDIR)/libio18f13k50_a-dummy.Tpo -c -o libio18f13k50_a-dummy.o `test -f 'dummy.c' || echo '$(srcdir)/'`dummy.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libio18f13k50_a-dummy.Tpo $(DEPDIR)/libio18f13k50_a-dummy.Po diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/adc/adcbusy.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/adc/adcbusy.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/adc/adcbusy.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/adc/adcbusy.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -46,6 +46,7 @@ return __endasm; #elif (__SDCC_ADC_STYLE == 1812200) \ + || (__SDCC_ADC_STYLE == 1812300) \ || (__SDCC_ADC_STYLE == 1813502) \ || (__SDCC_ADC_STYLE == 1822200) \ || (__SDCC_ADC_STYLE == 1823222) \ diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/adc/adcclose.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/adc/adcclose.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/adc/adcclose.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/adc/adcclose.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/adc/adcconv.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/adc/adcconv.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/adc/adcconv.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/adc/adcconv.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/adc/adcopen.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/adc/adcopen.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/adc/adcopen.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/adc/adcopen.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -34,7 +34,7 @@ * parameters are: * channel: one of ADC_CHN_* * fosc: one of ADC_FOSC_* | ADC_ACQT_* | ADC_CAL - * pcfg: one of ADC_CFG_* (a bitmask with set bits denoting digital ports for 1220/65j50-style) + * pcfg: one of ADC_CFG_* (a bitmask with set bits denoting digital ports for many styles) * config: ADC_FRM_* | ADC_INT_* | ADC_VCFG_* | ADC_NVCFG_* | ADC_PVCFG_* */ @@ -57,6 +57,10 @@ ADCON0 = ((channel & 0x07) | (config & ADC_VCFG_AN3_AN2)) << 2; ADCON1 = (pcfg & 0x7f); ADCON2 = (ADCON2 & 0x38) | (fosc & 0x07) | (config & ADC_FRM_RJUST); +#elif (__SDCC_ADC_STYLE == 1812300) + ADCON0 = ((channel & 0x03) << 2); + ADCON1 = (pcfg & 0x0f) | (config & ADC_VCFG_VREF); + ADCON2 = (fosc & 0x7f) | (config & ADC_FRM_RJUST); #elif (__SDCC_ADC_STYLE == 1813502) ANSEL = pcfg; ANSELH = (pcfg >> 8); diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/adc/adcread.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/adc/adcread.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/adc/adcread.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/adc/adcread.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/adc/adcsetch.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/adc/adcsetch.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/adc/adcsetch.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/adc/adcsetch.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -36,6 +36,8 @@ ADCON0 = (ADCON0 & ~(0x07 << 3)) | ((channel & 0x07) << 3); #elif (__SDCC_ADC_STYLE == 1812200) ADCON0 = (ADCON0 & ~(0x07 << 2)) | ((channel & 0x07) << 2); +#elif (__SDCC_ADC_STYLE == 1812300) + ADCON0 = (ADCON0 & ~(0x03 << 2)) | ((channel & 0x03) << 2); #elif (__SDCC_ADC_STYLE == 1813502) ADCON0 = (ADCON0 & ~(0x0f << 2)) | ((channel & 0x0f) << 2); #elif (__SDCC_ADC_STYLE == 1822200) diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cack.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cack.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cack.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cack.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cclose.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cclose.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cclose.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cclose.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cdrdy.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cdrdy.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cdrdy.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cdrdy.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cidle.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cidle.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cidle.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cidle.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cnack.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cnack.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cnack.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cnack.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2copen.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2copen.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2copen.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2copen.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2creadc.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2creadc.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2creadc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2creadc.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2creads.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2creads.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2creads.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2creads.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2crestart.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2crestart.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2crestart.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2crestart.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cstart.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cstart.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cstart.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cstart.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cstop.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cstop.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cstop.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cstop.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cwritec.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cwritec.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cwritec.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cwritec.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cwrites.c sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cwrites.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c/i2cwrites.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c/i2cwrites.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c.ignore sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c.ignore --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/i2c.ignore 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/i2c.ignore 2012-03-10 17:53:10.000000000 +0000 @@ -1,5 +1,7 @@ 1220 +1230 1320 +1330 2331 2431 diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libio/mkmk.sh sdcc-3.2.0+dfsg/device/lib/pic16/libio/mkmk.sh --- sdcc-3.1.0+dfsg/device/lib/pic16/libio/mkmk.sh 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libio/mkmk.sh 2012-03-10 17:53:10.000000000 +0000 @@ -17,7 +17,7 @@ HEREDOC -sed -e 's/\s*#.*$//' ../pics.all | grep -v "^\s*$" | sort | while read arch; do +sed -e 's/\s*#.*$//' ../../../non-free/lib/pic16/pics.all | grep -v "^\s*$" | sort | while read arch; do echo "Generating for device >>${arch}<<" >&2; cat < + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* the return value is expected to be in (FSR0H, PRODH, PRODL, WREG), + * therefore we choose return type void here. Generic pointer is expected + * to be in (WREG, PRODL, FSR0L), so function arguments are void, too */ + +extern EEADR; +extern EEADRH; +extern EECON1; +extern EEDATA; +extern FSR0L; +extern INTCON; +extern PRODL; +extern TBLPTRL; + +void +__eeprom16_gptrget1(void) __naked +{ + __asm + MOVFF _INTCON, _TBLPTRL ; save previous interupt state + BCF _INTCON, 7, 0 ; GIE = 0: disable interrupts + + BCF _EECON1, 7, 0 ; EEPGD = 0: access EEPROM, not program memory + BCF _EECON1, 6, 0 ; CFGS = 0: access EEPROM, not config words + + MOVFF _FSR0L, _EEADR ; address first byte + MOVFF _PRODL, _EEADRH ; high address bits + BSF _EECON1, 0, 0 ; RD = 1: read EEPROM + MOVF _EEDATA, 0, 0 ; W = EEPROM[adr] + + BTFSC _TBLPTRL, 7, 0 ; check previous interrupt state + BSF _INTCON, 7, 0 ; conditionally re-enable interrupts + + RETURN + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrget2.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrget2.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrget2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrget2.c 2012-04-19 22:14:15.000000000 +0000 @@ -0,0 +1,67 @@ +/*------------------------------------------------------------------------- + eeprom16_gptrget2.c - get 2 byte value from EEPROM via a generic pointer + + Copyright (C) 2012 Raphael Neider + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* the return value is expected to be in (FSR0H, PRODH, PRODL, WREG), + * therefore we choose return type void here. Generic pointer is expected + * to be in (WREG, PRODL, FSR0L), so function arguments are void, too */ + +extern EEADR; +extern EEADRH; +extern EECON1; +extern EEDATA; +extern FSR0L; +extern INTCON; +extern PRODL; +extern TBLPTRL; + +void +__eeprom16_gptrget2(void) __naked +{ + __asm + MOVFF _INTCON, _TBLPTRL ; save previous interupt state + BCF _INTCON, 7, 0 ; GIE = 0: disable interrupts + + BCF _EECON1, 7, 0 ; EEPGD = 0: access EEPROM, not program memory + BCF _EECON1, 6, 0 ; CFGS = 0: access EEPROM, not config words + + MOVFF _FSR0L, _EEADR ; address first byte + MOVFF _PRODL, _EEADRH ; address first byte, high address bits + BSF _EECON1, 0, 0 ; RD = 1: read EEPROM + MOVF _EEDATA, 0, 0 ; W = EEPROM[adr] + + INFSNZ _EEADR, 1, 0 ; address second byte + INCF _EEADRH, 1, 0 ; high address bits + BSF _EECON1, 0, 0 ; RD = 1: read EEPROM + MOVFF _EEDATA, _PRODL ; PRODL = EEPROM[adr+1] + + BTFSC _TBLPTRL, 7, 0 ; check previous interrupt state + BSF _INTCON, 7, 0 ; conditionally re-enable interrupts + + RETURN + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrget3.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrget3.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrget3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrget3.c 2012-04-19 22:14:15.000000000 +0000 @@ -0,0 +1,73 @@ +/*------------------------------------------------------------------------- + eeprom16_gptrget3.c - get 3 byte value from EEPROM via a generic pointer + + Copyright (C) 2012 Raphael Neider + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* the return value is expected to be in (FSR0H, PRODH, PRODL, WREG), + * therefore we choose return type void here. Generic pointer is expected + * to be in (WREG, PRODL, FSR0L), so function arguments are void, too */ + +extern EEADR; +extern EEADRH; +extern EECON1; +extern EEDATA; +extern FSR0L; +extern INTCON; +extern PRODH; +extern PRODL; +extern TBLPTRL; + +void +__eeprom16_gptrget3(void) __naked +{ + __asm + MOVFF _INTCON, _TBLPTRL ; save previous interupt state + BCF _INTCON, 7, 0 ; GIE = 0: disable interrupts + + BCF _EECON1, 7, 0 ; EEPGD = 0: access EEPROM, not program memory + BCF _EECON1, 6, 0 ; CFGS = 0: access EEPROM, not config words + + MOVFF _FSR0L, _EEADR ; address first byte + MOVFF _PRODL, _EEADRH ; high address bits + BSF _EECON1, 0, 0 ; RD = 1: read EEPROM + MOVF _EEDATA, 0, 0 ; W = EEPROM[adr] + + INFSNZ _EEADR, 1, 0 ; address second byte + INCF _EEADRH, 1, 0 ; high address bits + BSF _EECON1, 0, 0 ; RD = 1: read EEPROM + MOVFF _EEDATA, _PRODL ; PRODL = EEPROM[adr+1] + + INFSNZ _EEADR, 1, 0 ; address third byte + INCF _EEADRH, 1, 0 ; high address bits + BSF _EECON1, 0, 0 ; RD = 1: read EEPROM + MOVFF _EEDATA, _PRODH ; PRODH = EEPROM[adr+2] + + BTFSC _TBLPTRL, 7, 0 ; check previous interrupt state + BSF _INTCON, 7, 0 ; conditionally re-enable interrupts + + RETURN + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrget4.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrget4.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrget4.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrget4.c 2012-04-19 22:14:15.000000000 +0000 @@ -0,0 +1,79 @@ +/*------------------------------------------------------------------------- + eeprom16_gptrget4.c - get 4 byte value from EEPROM via a generic pointer + + Copyright (C) 2012 Raphael Neider + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* the return value is expected to be in (FSR0H, PRODH, PRODL, WREG), + * therefore we choose return type void here. Generic pointer is expected + * to be in (WREG, PRODL, FSR0L), so function arguments are void, too */ + +extern EEADR; +extern EEADRH; +extern EECON1; +extern EEDATA; +extern FSR0H; +extern FSR0L; +extern INTCON; +extern PRODH; +extern PRODL; +extern TBLPTRL; + +void +__eeprom16_gptrget4(void) __naked +{ + __asm + MOVFF _INTCON, _TBLPTRL ; save previous interupt state + BCF _INTCON, 7, 0 ; GIE = 0: disable interrupts + + BCF _EECON1, 7, 0 ; EEPGD = 0: access EEPROM, not program memory + BCF _EECON1, 6, 0 ; CFGS = 0: access EEPROM, not config words + + MOVFF _FSR0L, _EEADR ; address first byte + MOVFF _PRODL, _EEADRH ; high address bits + BSF _EECON1, 0, 0 ; RD = 1: read EEPROM + MOVF _EEDATA, 0, 0 ; W = EEPROM[adr] + + INFSNZ _EEADR, 1, 0 ; address second byte + INCF _EEADRH, 1, 0 ; high address bits + BSF _EECON1, 0, 0 ; RD = 1: read EEPROM + MOVFF _EEDATA, _PRODL ; PRODL = EEPROM[adr+1] + + INFSNZ _EEADR, 1, 0 ; address third byte + INCF _EEADRH, 1, 0 ; high address bits + BSF _EECON1, 0, 0 ; RD = 1: read EEPROM + MOVFF _EEDATA, _PRODH ; PRODH = EEPROM[adr+2] + + INFSNZ _EEADR, 1, 0 ; address fourth byte + INCF _EEADRH, 1, 0 ; high address bits + BSF _EECON1, 0, 0 ; RD = 1: read EEPROM + MOVFF _EEDATA, _FSR0H ; FSR0H = EEPROM[adr+3] + + BTFSC _TBLPTRL, 7, 0 ; check previous interrupt state + BSF _INTCON, 7, 0 ; conditionally re-enable interrupts + + RETURN + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrput1.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrput1.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrput1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrput1.c 2012-04-22 12:54:57.000000000 +0000 @@ -0,0 +1,67 @@ +/*------------------------------------------------------------------------- + eeprom16_gptrput1.c - write 1 byte value to EEPROM via a generic pointer + + Copyright (C) 2012 Raphael Neider + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* write address is expected to be in WREG:PRODL:FSR0L while + * write value is in TBLPTRH:TBLPTRL:PRODH:[stack] */ + +extern EEADR; +extern EEADRH; +extern EECON1; +extern EEDATA; +extern FSR0H; +extern FSR0L; +extern INTCON; +extern PREINC1; +extern PRODL; +extern __eeprom16_write; + +void +__eeprom16_gptrput1(void) __naked +{ + __asm + MOVFF _INTCON, _FSR0H ; save previous interupt state + BCF _INTCON, 7, 0 ; GIE = 0: disable interrupts + + BCF _EECON1, 7, 0 ; EEPGD = 0: access EEPROM, not program memory + BCF _EECON1, 6, 0 ; CFGS = 0: access EEPROM, not config words + BSF _EECON1, 2, 0 ; WREN = 1: enable write access + + MOVFF _FSR0L, _EEADR ; address first byte + MOVFF _PRODL, _EEADRH ; high address bits + + MOVFF _PREINC1, _EEDATA ; load first byte + CALL ___eeprom16_write ; write and address next byte + + BCF _EECON1, 2, 0 ; WREN = 0: disable write access + + BTFSC _FSR0H, 7, 0 ; check previous interrupt state + BSF _INTCON, 7, 0 ; conditionally re-enable interrupts + + RETURN + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrput2.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrput2.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrput2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrput2.c 2012-04-22 12:54:57.000000000 +0000 @@ -0,0 +1,71 @@ +/*------------------------------------------------------------------------- + eeprom16_gptrput2.c - write 2 byte value to EEPROM via a generic pointer + + Copyright (C) 2012 Raphael Neider + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* write address is expected to be in WREG:PRODL:FSR0L while + * write value is in TBLPTRH:TBLPTRL:PRODH:[stack] */ + +extern EEADR; +extern EEADRH; +extern EECON1; +extern EEDATA; +extern FSR0H; +extern FSR0L; +extern INTCON; +extern PREINC1; +extern PRODH; +extern PRODL; +extern __eeprom16_write; + +void +__eeprom16_gptrput2(void) __naked +{ + __asm + MOVFF _INTCON, _FSR0H ; save previous interupt state + BCF _INTCON, 7, 0 ; GIE = 0: disable interrupts + + BCF _EECON1, 7, 0 ; EEPGD = 0: access EEPROM, not program memory + BCF _EECON1, 6, 0 ; CFGS = 0: access EEPROM, not config words + BSF _EECON1, 2, 0 ; WREN = 1: enable write access + + MOVFF _FSR0L, _EEADR ; address first byte + MOVFF _PRODL, _EEADRH ; high address bits + + MOVFF _PREINC1, _EEDATA ; load first byte + CALL ___eeprom16_write ; write and address next byte + + MOVFF _PRODH, _EEDATA ; load second byte + CALL ___eeprom16_write ; write and address next byte + + BCF _EECON1, 2, 0 ; WREN = 0: disable write access + + BTFSC _FSR0H, 7, 0 ; check previous interrupt state + BSF _INTCON, 7, 0 ; conditionally re-enable interrupts + + RETURN + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrput3.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrput3.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrput3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrput3.c 2012-04-22 12:54:57.000000000 +0000 @@ -0,0 +1,75 @@ +/*------------------------------------------------------------------------- + eeprom16_gptrput3.c - write 3 byte value to EEPROM via a generic pointer + + Copyright (C) 2012 Raphael Neider + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* write address is expected to be in WREG:PRODL:FSR0L while + * write value is in TBLPTRH:TBLPTRL:PRODH:[stack] */ + +extern EEADR; +extern EEADRH; +extern EECON1; +extern EEDATA; +extern FSR0H; +extern FSR0L; +extern INTCON; +extern PREINC1; +extern PRODH; +extern PRODL; +extern TBLPTRL; +extern __eeprom16_write; + +void +__eeprom16_gptrput3(void) __naked +{ + __asm + MOVFF _INTCON, _FSR0H ; save previous interupt state + BCF _INTCON, 7, 0 ; GIE = 0: disable interrupts + + BCF _EECON1, 7, 0 ; EEPGD = 0: access EEPROM, not program memory + BCF _EECON1, 6, 0 ; CFGS = 0: access EEPROM, not config words + BSF _EECON1, 2, 0 ; WREN = 1: enable write access + + MOVFF _FSR0L, _EEADR ; address first byte + MOVFF _PRODL, _EEADRH ; high address bits + + MOVFF _PREINC1, _EEDATA ; load first byte + CALL ___eeprom16_write ; write and address next byte + + MOVFF _PRODH, _EEDATA ; load second byte + CALL ___eeprom16_write ; write and address next byte + + MOVFF _TBLPTRL, _EEDATA ; load third byte + CALL ___eeprom16_write ; write and address next byte + + BCF _EECON1, 2, 0 ; WREN = 0: disable write access + + BTFSC _FSR0H, 7, 0 ; check previous interrupt state + BSF _INTCON, 7, 0 ; conditionally re-enable interrupts + + RETURN + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrput4.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrput4.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrput4.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_gptrput4.c 2012-04-22 12:54:57.000000000 +0000 @@ -0,0 +1,79 @@ +/*------------------------------------------------------------------------- + eeprom16_gptrput4.c - write 4 byte value to EEPROM via a generic pointer + + Copyright (C) 2012 Raphael Neider + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* write address is expected to be in WREG:PRODL:FSR0L while + * write value is in TBLPTRH:TBLPTRL:PRODH:[stack] */ + +extern EEADR; +extern EEADRH; +extern EECON1; +extern EEDATA; +extern FSR0H; +extern FSR0L; +extern INTCON; +extern PREINC1; +extern PRODH; +extern PRODL; +extern TBLPTRL; +extern TBLPTRH; +extern __eeprom16_write; + +void +__eeprom16_gptrput4(void) __naked +{ + __asm + MOVFF _INTCON, _FSR0H ; save previous interupt state + BCF _INTCON, 7, 0 ; GIE = 0: disable interrupts + + BCF _EECON1, 7, 0 ; EEPGD = 0: access EEPROM, not program memory + BCF _EECON1, 6, 0 ; CFGS = 0: access EEPROM, not config words + BSF _EECON1, 2, 0 ; WREN = 1: enable write access + + MOVFF _FSR0L, _EEADR ; address first byte + MOVFF _PRODL, _EEADRH ; high address bits + + MOVFF _PREINC1, _EEDATA ; load first byte + CALL ___eeprom16_write ; write and address next byte + + MOVFF _PRODH, _EEDATA ; load second byte + CALL ___eeprom16_write ; write and address next byte + + MOVFF _TBLPTRL, _EEDATA ; load third byte + CALL ___eeprom16_write ; write and address next byte + + MOVFF _TBLPTRH, _EEDATA ; load fourth byte + CALL ___eeprom16_write ; write and address next byte + + BCF _EECON1, 2, 0 ; WREN = 0: disable write access + + BTFSC _FSR0H, 7, 0 ; check previous interrupt state + BSF _INTCON, 7, 0 ; conditionally re-enable interrupts + + RETURN + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_write.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_write.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_write.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom16_write.c 2012-04-19 22:14:15.000000000 +0000 @@ -0,0 +1,51 @@ +/*------------------------------------------------------------------------- + eeprom_write16.c - write one byte to EEPROM and wait for completion + + Copyright (C) 1999, Sandeep Dutta . sandeep.dutta@usa.net + Adopted for pic16 port by Vangelis Rokas, 2004 + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +extern char EEADR; +extern char EEADRH; +extern char EECON1; +extern char EECON2; + +void __eeprom16_write(void) __naked +{ + __asm + movlw 0x55 + movwf _EECON2, 0 + movlw 0xAA + movwf _EECON2, 0 + bsf _EECON1, 1, 0 ; WR + + wait_till_done: + btfsc _EECON1, 1, 0 ; WR still set? + bra wait_till_done + + infsnz _EEADR, 1, 0 ; address next byte + incf _EEADRH, 1, 0 ; address next byte + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrget1.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrget1.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrget1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrget1.c 2012-04-19 22:14:15.000000000 +0000 @@ -0,0 +1,59 @@ +/*------------------------------------------------------------------------- + eeprom8_gptrget1.c - get 1 byte value from EEPROM via a generic pointer + + Copyright (C) 2012 Raphael Neider + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* the return value is expected to be in (FSR0H, PRODH, PRODL, WREG), + * therefore we choose return type void here. Generic pointer is expected + * to be in (WREG, PRODL, FSR0L), so function arguments are void, too */ + +extern EEADR; +extern EECON1; +extern EEDATA; +extern FSR0L; +extern INTCON; +extern TBLPTRL; + +void +__eeprom8_gptrget1(void) __naked +{ + __asm + MOVFF _INTCON, _TBLPTRL ; save previous interupt state + BCF _INTCON, 7, 0 ; GIE = 0: disable interrupts + + BCF _EECON1, 7, 0 ; EEPGD = 0: access EEPROM, not program memory + BCF _EECON1, 6, 0 ; CFGS = 0: access EEPROM, not config words + + MOVFF _FSR0L, _EEADR ; address first byte + BSF _EECON1, 0, 0 ; RD = 1 + MOVF _EEDATA, 0, 0 ; W = EEPROM[adr] + + BTFSC _TBLPTRL, 7, 0 ; check previous interrupt state + BSF _INTCON, 7, 0 ; conditionally re-enable interrupts + + RETURN + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrget2.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrget2.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrget2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrget2.c 2012-04-19 22:14:15.000000000 +0000 @@ -0,0 +1,64 @@ +/*------------------------------------------------------------------------- + eeprom8_gptrget2.c - get 2 byte value from EEPROM via a generic pointer + + Copyright (C) 2012 Raphael Neider + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* the return value is expected to be in (FSR0H, PRODH, PRODL, WREG), + * therefore we choose return type void here. Generic pointer is expected + * to be in (WREG, PRODL, FSR0L), so function arguments are void, too */ + +extern EEADR; +extern EECON1; +extern EEDATA; +extern FSR0L; +extern INTCON; +extern PRODL; +extern TBLPTRL; + +void +__eeprom8_gptrget2(void) __naked +{ + __asm + MOVFF _INTCON, _TBLPTRL ; save previous interupt state + BCF _INTCON, 7, 0 ; GIE = 0: disable interrupts + + BCF _EECON1, 7, 0 ; EEPGD = 0: access EEPROM, not program memory + BCF _EECON1, 6, 0 ; CFGS = 0: access EEPROM, not config words + + MOVFF _FSR0L, _EEADR ; address first byte + BSF _EECON1, 0, 0 ; RD = 1 + MOVF _EEDATA, 0, 0 ; W = EEPROM[adr] + + INCF _EEADR, 1, 0 ; address second byte + BSF _EECON1, 0, 0 ; RD = 1 + MOVFF _EEDATA, _PRODL ; PRODL = EEPROM[adr+1] + + BTFSC _TBLPTRL, 7, 0 ; check previous interrupt state + BSF _INTCON, 7, 0 ; conditionally re-enable interrupts + + RETURN + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrget3.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrget3.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrget3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrget3.c 2012-04-19 22:14:15.000000000 +0000 @@ -0,0 +1,69 @@ +/*------------------------------------------------------------------------- + eeprom8_gptrget3.c - get 3 byte value from EEPROM via a generic pointer + + Copyright (C) 2012 Raphael Neider + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* the return value is expected to be in (FSR0H, PRODH, PRODL, WREG), + * therefore we choose return type void here. Generic pointer is expected + * to be in (WREG, PRODL, FSR0L), so function arguments are void, too */ + +extern EEADR; +extern EECON1; +extern EEDATA; +extern FSR0L; +extern INTCON; +extern PRODH; +extern PRODL; +extern TBLPTRL; + +void +__eeprom8_gptrget3(void) __naked +{ + __asm + MOVFF _INTCON, _TBLPTRL ; save previous interupt state + BCF _INTCON, 7, 0 ; GIE = 0: disable interrupts + + BCF _EECON1, 7, 0 ; EEPGD = 0: access EEPROM, not program memory + BCF _EECON1, 6, 0 ; CFGS = 0: access EEPROM, not config words + + MOVFF _FSR0L, _EEADR ; address first byte + BSF _EECON1, 0, 0 ; RD = 1 + MOVF _EEDATA, 0, 0 ; W = EEPROM[adr] + + INCF _EEADR, 1, 0 ; address second byte + BSF _EECON1, 0, 0 ; RD = 1 + MOVFF _EEDATA, _PRODL ; PRODL = EEPROM[adr+1] + + INCF _EEADR, 1, 0 ; address third byte + BSF _EECON1, 0, 0 ; RD = 1 + MOVFF _EEDATA, _PRODH ; PRODH = EEPROM[adr+2] + + BTFSC _TBLPTRL, 7, 0 ; check previous interrupt state + BSF _INTCON, 7, 0 ; conditionally re-enable interrupts + + RETURN + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrget4.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrget4.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrget4.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrget4.c 2012-04-19 22:14:15.000000000 +0000 @@ -0,0 +1,74 @@ +/*------------------------------------------------------------------------- + eeprom8_gptrget4.c - get 4 byte value from EEPROM via a generic pointer + + Copyright (C) 2012 Raphael Neider + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* the return value is expected to be in (FSR0H, PRODH, PRODL, WREG), + * therefore we choose return type void here. Generic pointer is expected + * to be in (WREG, PRODL, FSR0L), so function arguments are void, too */ + +extern EEADR; +extern EECON1; +extern EEDATA; +extern FSR0H; +extern FSR0L; +extern INTCON; +extern PRODH; +extern PRODL; +extern TBLPTRL; + +void +__eeprom8_gptrget4(void) __naked +{ + __asm + MOVFF _INTCON, _TBLPTRL ; save previous interupt state + BCF _INTCON, 7, 0 ; GIE = 0: disable interrupts + + BCF _EECON1, 7, 0 ; EEPGD = 0: access EEPROM, not program memory + BCF _EECON1, 6, 0 ; CFGS = 0: access EEPROM, not config words + + MOVFF _FSR0L, _EEADR ; address first byte + BSF _EECON1, 0, 0 ; RD = 1 + MOVF _EEDATA, 0, 0 ; W = EEPROM[adr] + + INCF _EEADR, 1, 0 ; address second byte + BSF _EECON1, 0, 0 ; RD = 1 + MOVFF _EEDATA, _PRODL ; PRODL = EEPROM[adr+1] + + INCF _EEADR, 1, 0 ; address third byte + BSF _EECON1, 0, 0 ; RD = 1 + MOVFF _EEDATA, _PRODH ; PRODH = EEPROM[adr+2] + + INCF _EEADR, 1, 0 ; address fourth byte + BSF _EECON1, 0, 0 ; RD = 1 + MOVFF _EEDATA, _FSR0H ; PRODL = EEPROM[adr+3] + + BTFSC _TBLPTRL, 7, 0 ; check previous interrupt state + BSF _INTCON, 7, 0 ; conditionally re-enable interrupts + + RETURN + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrput1.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrput1.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrput1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrput1.c 2012-04-22 12:54:57.000000000 +0000 @@ -0,0 +1,64 @@ +/*------------------------------------------------------------------------- + eeprom8_gptrput1.c - write 1 byte value to EEPROM via a generic pointer + + Copyright (C) 2012 Raphael Neider + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* write address is expected to be in WREG:PRODL:FSR0L while + * write value is in TBLPTRH:TBLPTRL:PRODH:[stack] */ + +extern EEADR; +extern EECON1; +extern EEDATA; +extern FSR0H; +extern FSR0L; +extern INTCON; +extern PREINC1; +extern __eeprom8_write; + +void +__eeprom8_gptrput1(void) __naked +{ + __asm + MOVFF _INTCON, _FSR0H ; save previous interupt state + BCF _INTCON, 7, 0 ; GIE = 0: disable interrupts + + BCF _EECON1, 7, 0 ; EEPGD = 0: access EEPROM, not program memory + BCF _EECON1, 6, 0 ; CFGS = 0: access EEPROM, not config words + BSF _EECON1, 2, 0 ; WREN = 1: enable write access + + MOVFF _FSR0L, _EEADR ; address first byte + + MOVFF _PREINC1, _EEDATA ; load first byte + CALL ___eeprom8_write ; write and address next byte + + BCF _EECON1, 2, 0 ; WREN = 0: disable write access + + BTFSC _FSR0H, 7, 0 ; check previous interrupt state + BSF _INTCON, 7, 0 ; conditionally re-enable interrupts + + RETURN + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrput2.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrput2.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrput2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrput2.c 2012-04-22 12:54:57.000000000 +0000 @@ -0,0 +1,68 @@ +/*------------------------------------------------------------------------- + eeprom8_gptrput2.c - write 2 byte value to EEPROM via a generic pointer + + Copyright (C) 2012 Raphael Neider + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* write address is expected to be in WREG:PRODL:FSR0L while + * write value is in TBLPTRH:TBLPTRL:PRODH:[stack] */ + +extern EEADR; +extern EECON1; +extern EEDATA; +extern FSR0H; +extern FSR0L; +extern INTCON; +extern PREINC1; +extern PRODH; +extern __eeprom8_write; + +void +__eeprom8_gptrput2(void) __naked +{ + __asm + MOVFF _INTCON, _FSR0H ; save previous interupt state + BCF _INTCON, 7, 0 ; GIE = 0: disable interrupts + + BCF _EECON1, 7, 0 ; EEPGD = 0: access EEPROM, not program memory + BCF _EECON1, 6, 0 ; CFGS = 0: access EEPROM, not config words + BSF _EECON1, 2, 0 ; WREN = 1: enable write access + + MOVFF _FSR0L, _EEADR ; address first byte + + MOVFF _PREINC1, _EEDATA ; load first byte + CALL ___eeprom8_write ; write and address next byte + + MOVFF _PRODH, _EEDATA ; load second byte + CALL ___eeprom8_write ; write and address next byte + + BCF _EECON1, 2, 0 ; WREN = 0: disable write access + + BTFSC _FSR0H, 7, 0 ; check previous interrupt state + BSF _INTCON, 7, 0 ; conditionally re-enable interrupts + + RETURN + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrput3.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrput3.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrput3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrput3.c 2012-04-22 12:54:57.000000000 +0000 @@ -0,0 +1,72 @@ +/*------------------------------------------------------------------------- + eeprom8_gptrput3.c - write 3 byte value to EEPROM via a generic pointer + + Copyright (C) 2012 Raphael Neider + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* write address is expected to be in WREG:PRODL:FSR0L while + * write value is in TBLPTRH:TBLPTRL:PRODH:[stack] */ + +extern EEADR; +extern EECON1; +extern EEDATA; +extern FSR0H; +extern FSR0L; +extern INTCON; +extern PREINC1; +extern PRODH; +extern TBLPTRL; +extern __eeprom8_write; + +void +__eeprom8_gptrput3(void) __naked +{ + __asm + MOVFF _INTCON, _FSR0H ; save previous interupt state + BCF _INTCON, 7, 0 ; GIE = 0: disable interrupts + + BCF _EECON1, 7, 0 ; EEPGD = 0: access EEPROM, not program memory + BCF _EECON1, 6, 0 ; CFGS = 0: access EEPROM, not config words + BSF _EECON1, 2, 0 ; WREN = 1: enable write access + + MOVFF _FSR0L, _EEADR ; address first byte + + MOVFF _PREINC1, _EEDATA ; load first byte + CALL ___eeprom8_write ; write and address next byte + + MOVFF _PRODH, _EEDATA ; load second byte + CALL ___eeprom8_write ; write and address next byte + + MOVFF _TBLPTRL, _EEDATA ; load third byte + CALL ___eeprom8_write ; write and address next byte + + BCF _EECON1, 2, 0 ; WREN = 0: disable write access + + BTFSC _FSR0H, 7, 0 ; check previous interrupt state + BSF _INTCON, 7, 0 ; conditionally re-enable interrupts + + RETURN + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrput4.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrput4.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrput4.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_gptrput4.c 2012-04-22 12:54:57.000000000 +0000 @@ -0,0 +1,75 @@ +/*------------------------------------------------------------------------- + eeprom8_gptrput4.c - write 4 byte value to EEPROM via a generic pointer + + Copyright (C) 2012 Raphael Neider + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* write address is expected to be in WREG:PRODL:FSR0L while + * write value is in TBLPTRH:TBLPTRL:PRODH:[stack] */ + +extern EEADR; +extern EECON1; +extern EEDATA; +extern FSR0H; +extern FSR0L; +extern INTCON; +extern PREINC1; +extern PRODH; +extern TBLPTRL; +extern TBLPTRH; +extern __eeprom8_write; + +void +__eeprom8_gptrput4(void) __naked +{ + __asm + MOVFF _INTCON, _FSR0H ; save previous interupt state + BCF _INTCON, 7, 0 ; GIE = 0: disable interrupts + + BCF _EECON1, 7, 0 ; EEPGD = 0: access EEPROM, not program memory + BCF _EECON1, 6, 0 ; CFGS = 0: access EEPROM, not config words + BSF _EECON1, 2, 0 ; WREN = 1: enable write access + + MOVFF _FSR0L, _EEADR ; address first byte + MOVFF _PREINC1, _EEDATA ; load first byte + CALL ___eeprom8_write ; write and address next byte + + MOVFF _PRODH, _EEDATA ; load second byte + CALL ___eeprom8_write ; write and address next byte + + MOVFF _TBLPTRL, _EEDATA ; load third byte + CALL ___eeprom8_write ; write and address next byte + + MOVFF _TBLPTRH, _EEDATA ; load fourth byte + CALL ___eeprom8_write ; write and address next byte + + BCF _EECON1, 2, 0 ; WREN = 0: disable write access + + BTFSC _FSR0H, 7, 0 ; check previous interrupt state + BSF _INTCON, 7, 0 ; conditionally re-enable interrupts + + RETURN + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_write.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_write.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_write.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/eeprom8_write.c 2012-04-19 22:14:15.000000000 +0000 @@ -0,0 +1,49 @@ +/*------------------------------------------------------------------------- + eeprom_write8.c - write one byte to EEPROM and wait for completion + + Copyright (C) 1999, Sandeep Dutta . sandeep.dutta@usa.net + Adopted for pic16 port by Vangelis Rokas, 2004 + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +extern char EEADR; +extern char EECON1; +extern char EECON2; + +void __eeprom8_write(void) __naked +{ + __asm + movlw 0x55 + movwf _EECON2, 0 + movlw 0xAA + movwf _EECON2, 0 + bsf _EECON1, 1, 0 ; WR + + wait_till_done: + btfsc _EECON1, 1, 0 ; WR still set? + bra wait_till_done + + infsnz _EEADR, 1, 0 ; address next byte + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrget1.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrget1.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrget1.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrget1.c 2012-04-19 22:14:15.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,13 +27,11 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ -/* the return value is expected to be in WREG, therefore we choose return - * type void here. Generic pointer is expected to be in WREG:PRODL:FSR0L, - * so function arguments are void, too */ +/* the return value is expected to be in (FSR0H, PRODH, PRODL, WREG), + * therefore we choose return type void here. Generic pointer is expected + * to be in (WREG, PRODL, FSR0L), so function arguments are void, too */ extern POSTINC0; -extern POSTINC1; -extern PREINC1; extern INDF0; extern FSR0L; extern FSR0H; @@ -43,7 +41,7 @@ extern TBLPTRU; extern TABLAT; extern PRODL; - +extern __eeprom_gptrget1; void _gptrget1(void) __naked { @@ -52,44 +50,38 @@ * 00 -> code * 01 -> EEPROM * 10 -> data - * 11 -> unimplemented + * 11 -> data + * + * address in (WREG, PRODL, FSR0L) + * result in (FSR0L, PRODH, PRODL, WREG) */ - btfss _WREG, 7 + btfss _WREG, 7, 0 bra _lab_01_ - ; data pointer - ; data are already in FSR0 - movff _PRODL, _FSR0H - - movf _POSTINC0, w - + /* data pointer */ + /* FSR0L is already set up */ + movff _PRODL, _FSR0H + + movf _POSTINC0, 0, 0 + return _lab_01_: - ; code or eeprom - btfsc _WREG, 6 - bra _lab_02_ + /* code or eeprom */ + btfsc _WREG, 6, 0 + goto ___eeprom_gptrget1 ; code pointer - movff _FSR0L, _TBLPTRL + movff _FSR0L, _TBLPTRL movff _PRODL, _TBLPTRH - movwf _TBLPTRU - - tblrd*+ - - ; result in WREG - movf _TABLAT, w + movwf _TBLPTRU, 0 + /* fetch first byte */ + TBLRD*+ + movf _TABLAT, 0, 0 + return -_lab_02_: - ; EEPROM pointer - - ; unimplemented yet - -_end_: - - return __endasm; } diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrget2.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrget2.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrget2.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrget2.c 2012-04-19 22:14:15.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,9 +27,9 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ -/* the return value is expected to be in WREG:PRODL, therefore we choose return - * type void here. Generic pointer is expected to be in WREG:PRODL:FSR0L, - * so function arguments are void, too */ +/* the return value is expected to be in (FSR0H, PRODH, PRODL, WREG), + * therefore we choose return type void here. Generic pointer is expected + * to be in (WREG, PRODL, FSR0L), so function arguments are void, too */ extern POSTINC0; extern INDF0; @@ -41,6 +41,7 @@ extern TBLPTRU; extern TABLAT; extern PRODL; +extern __eeprom_gptrget2; void _gptrget2(void) __naked { @@ -49,16 +50,19 @@ * 00 -> code * 01 -> EEPROM * 10 -> data - * 11 -> unimplemented + * 11 -> data + * + * address in (WREG, PRODL, FSR0L) + * result in (FSR0L, PRODH, PRODL, WREG) */ - btfss _WREG, 7 + btfss _WREG, 7, 0 bra _lab_01_ /* data pointer */ - /* data are already in FSR0 */ + /* FSR0L is already set up */ movff _PRODL, _FSR0H - movf _POSTINC0, w + movf _POSTINC0, 0, 0 movff _POSTINC0, _PRODL return @@ -66,32 +70,23 @@ _lab_01_: /* code or eeprom */ - btfsc _WREG, 6 - bra _lab_02_ + btfsc _WREG, 6, 0 + goto ___eeprom_gptrget2 ; code pointer movff _FSR0L, _TBLPTRL movff _PRODL, _TBLPTRH - movwf _TBLPTRU + movwf _TBLPTRU, 0 /* fetch first byte */ TBLRD*+ - movf _TABLAT, w + movf _TABLAT, 0, 0 /* fetch second byte */ TBLRD*+ movff _TABLAT, _PRODL - return - - -_lab_02_: - /* EEPROM pointer */ - - /* unimplemented yet */ - -_end_: + return - return __endasm; } diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrget3.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrget3.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrget3.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrget3.c 2012-04-19 22:14:15.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,9 +27,9 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ -/* the return value is expected to be in WREG:PRODL:PRODH, therefore we choose return - * type void here. Generic pointer is expected to be in WREG:PRODL:FSR0L, - * so function arguments are void, too */ +/* the return value is expected to be in (FSR0H, PRODH, PRODL, WREG), + * therefore we choose return type void here. Generic pointer is expected + * to be in (WREG, PRODL, FSR0L), so function arguments are void, too */ extern POSTINC0; extern INDF0; @@ -42,6 +42,7 @@ extern TABLAT; extern PRODL; extern PRODH; +extern __eeprom_gptrget3; void _gptrget3(void) __naked { @@ -50,16 +51,19 @@ * 00 -> code * 01 -> EEPROM * 10 -> data - * 11 -> unimplemented + * 11 -> data + * + * address in (WREG, PRODL, FSR0L) + * result in (FSR0L, PRODH, PRODL, WREG) */ - btfss _WREG, 7 + btfss _WREG, 7, 0 bra _lab_01_ /* data pointer */ - /* data are already in FSR0 */ + /* FSR0L is already set up */ movff _PRODL, _FSR0H - movf _POSTINC0, w + movf _POSTINC0, 0, 0 movff _POSTINC0, _PRODL movff _POSTINC0, _PRODH @@ -68,17 +72,17 @@ _lab_01_: /* code or eeprom */ - btfsc _WREG, 6 - bra _lab_02_ + btfsc _WREG, 6, 0 + goto ___eeprom_gptrget3 ; code pointer movff _FSR0L, _TBLPTRL movff _PRODL, _TBLPTRH - movwf _TBLPTRU + movwf _TBLPTRU, 0 /* fetch first byte */ TBLRD*+ - movf _TABLAT, w + movf _TABLAT, 0, 0 /* fetch second byte */ TBLRD*+ @@ -88,14 +92,7 @@ TBLRD*+ movff _TABLAT, _PRODH - return - + return -_lab_02_: - /* EEPROM pointer */ - - /* unimplemented yet */ - - return __endasm; } diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrget4.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrget4.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrget4.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrget4.c 2012-04-19 22:14:15.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,9 +27,9 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ -/* the return value is expected to be in WREG:PRODL, therefore we choose return - * type void here. Generic pointer is expected to be in WREG:PRODL:FSR0L, - * so function arguments are void, too */ +/* the return value is expected to be in (FSR0H, PRODH, PRODL, WREG), + * therefore we choose return type void here. Generic pointer is expected + * to be in (WREG, PRODL, FSR0L), so function arguments are void, too */ extern POSTINC0; extern INDF0; @@ -42,6 +42,7 @@ extern TABLAT; extern PRODL; extern PRODH; +extern __eeprom_gptrget4; void _gptrget4(void) __naked { @@ -50,16 +51,19 @@ * 00 -> code * 01 -> EEPROM * 10 -> data - * 11 -> unimplemented + * 11 -> data + * + * address in (WREG, PRODL, FSR0L) + * result in (FSR0L, PRODH, PRODL, WREG) */ - btfss _WREG, 7 + btfss _WREG, 7, 0 bra _lab_01_ /* data pointer */ - /* data are already in FSR0 */ + /* FSR0L is already set up */ movff _PRODL, _FSR0H - movf _POSTINC0, w + movf _POSTINC0, 0, 0 movff _POSTINC0, _PRODL movff _POSTINC0, _PRODH movff _POSTINC0, _FSR0L @@ -69,17 +73,17 @@ _lab_01_: /* code or eeprom */ - btfsc _WREG, 6 - bra _lab_02_ + btfsc _WREG, 6, 0 + goto ___eeprom_gptrget4 ; code pointer movff _FSR0L, _TBLPTRL movff _PRODL, _TBLPTRH - movwf _TBLPTRU + movwf _TBLPTRU, 0 /* fetch first byte */ TBLRD*+ - movf _TABLAT, w + movf _TABLAT, 0, 0 /* fetch second byte */ TBLRD*+ @@ -95,12 +99,5 @@ return -_lab_02_: - /* EEPROM pointer */ - - /* unimplemented yet */ - - return - __endasm; } diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrput1.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrput1.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrput1.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrput1.c 2012-04-19 22:14:15.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -28,35 +28,32 @@ -------------------------------------------------------------------------*/ /* write address is expected to be in WREG:PRODL:FSR0L while - * write value is in TBLPTRL:TBLPTRH:PRODH:[stack] */ + * write value is in TBLPTRH:TBLPTRL:PRODH:[stack] */ +extern FSR0H; extern POSTINC0; extern PREINC1; -extern INDF0; -extern FSR0L; -extern FSR0H; -extern WREG; -extern TBLPTRL; -extern TBLPTRH; -extern TBLPTRU; -extern TABLAT; extern PRODL; -extern PRODH; +extern WREG; +extern __eeprom_gptrput1; void _gptrput1(void) __naked { __asm /* decode generic pointer MSB (in WREG) bits 6 and 7: * 00 -> code (unimplemented) - * 01 -> EEPROM (unimplemented) + * 01 -> EEPROM * 10 -> data - * 11 -> unimplemented + * 11 -> data + * + * address: (WREG, PRODL, FSR0L) + * value: (TBLPTRH, TBLPTRL, PRODH, STACK1[+1]) */ btfss _WREG, 7 bra _lab_01_ /* data pointer */ - /* data are already in FSR0 */ + /* FSR0L is already set up */ movff _PRODL, _FSR0H movff _PREINC1, _POSTINC0 @@ -66,17 +63,11 @@ _lab_01_: /* code or eeprom */ - btfss _WREG, 6 - return - - /* code pointer, cannot write code pointers */ - -_lab_02_: - /* EEPROM pointer */ - - /* unimplemented yet */ + btfsc _WREG, 6 + goto ___eeprom_gptrput1 + /* code pointer, cannot write code pointers */ + return - return __endasm; } diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrput2.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrput2.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrput2.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrput2.c 2012-04-19 22:14:15.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -28,35 +28,33 @@ -------------------------------------------------------------------------*/ /* write address is expected to be in WREG:PRODL:FSR0L while - * write value is in TBLPTRL:TBLPTRH:PRODH:[stack] */ + * write value is in TBLPTRH:TBLPTRL:PRODH:[stack] */ +extern FSR0H; extern POSTINC0; extern PREINC1; -extern INDF0; -extern FSR0L; -extern FSR0H; -extern WREG; -extern TBLPTRL; -extern TBLPTRH; -extern TBLPTRU; -extern TABLAT; -extern PRODL; extern PRODH; +extern PRODL; +extern WREG; +extern __eeprom_gptrput2; void _gptrput2(void) __naked { __asm /* decode generic pointer MSB (in WREG) bits 6 and 7: * 00 -> code (unimplemented) - * 01 -> EEPROM (unimplemented) + * 01 -> EEPROM * 10 -> data - * 11 -> unimplemented + * 11 -> data + * + * address: (WREG, PRODL, FSR0L) + * value: (TBLPTRH, TBLPTRL, PRODH, STACK1[+1]) */ btfss _WREG, 7 bra _lab_01_ /* data pointer */ - /* data are already in FSR0 */ + /* FSR0L is already set up */ movff _PRODL, _FSR0H movff _PREINC1, _POSTINC0 @@ -67,18 +65,11 @@ _lab_01_: /* code or eeprom */ - btfss _WREG, 6 - return - - /* code pointer, cannot write code pointers */ - - -_lab_02_: - /* EEPROM pointer */ - - /* unimplemented yet */ + btfsc _WREG, 6 + goto ___eeprom_gptrput2 + /* code pointer, cannot write code pointers */ + return - return __endasm; } diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrput3.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrput3.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrput3.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrput3.c 2012-04-19 22:14:15.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,36 +27,35 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ -/* write address is expected to be in WREG:FSR0H:FSR0L while +/* write address is expected to be in WREG:PRODL:FSR0L while * write value is in TBLPTRH:TBLPTRL:PRODH:[stack] */ +extern FSR0H; extern POSTINC0; extern PREINC1; -extern INDF0; -extern FSR0L; -extern FSR0H; -extern WREG; -extern TBLPTRL; -extern TBLPTRH; -extern TBLPTRU; -extern TABLAT; -extern PRODL; extern PRODH; +extern PRODL; +extern TBLPTRL; +extern WREG; +extern __eeprom_gptrput3; void _gptrput3(void) __naked { __asm /* decode generic pointer MSB (in WREG) bits 6 and 7: * 00 -> code (unimplemented) - * 01 -> EEPROM (unimplemented) + * 01 -> EEPROM * 10 -> data - * 11 -> unimplemented + * 11 -> data + * + * address: (WREG, PRODL, FSR0L) + * value: (TBLPTRH, TBLPTRL, PRODH, STACK1[+1]) */ btfss _WREG, 7 bra _lab_01_ /* data pointer */ - /* data are already in FSR0 */ + /* FSR0L is already set up */ movff _PRODL, _FSR0H movff _PREINC1, _POSTINC0 @@ -68,18 +67,11 @@ _lab_01_: /* code or eeprom */ - btfss _WREG, 6 - return - - /* code pointer, cannot write code pointers */ - - -_lab_02_: - /* EEPROM pointer */ - - /* unimplemented yet */ + btfsc _WREG, 6 + goto ___eeprom_gptrput3 + /* code pointer, cannot write code pointers */ + return - return __endasm; } diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrput4.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrput4.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrput4.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/gptr/gptrput4.c 2012-04-19 22:14:15.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -27,36 +27,36 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ -/* write address is expected to be in WREG:FSR0H:FSR0L while +/* write address is expected to be in WREG:PRODL:FSR0L while * write value is in TBLPTRH:TBLPTRL:PRODH:[stack] */ +extern FSR0H; extern POSTINC0; extern PREINC1; -extern INDF0; -extern FSR0L; -extern FSR0H; -extern WREG; -extern TBLPTRL; -extern TBLPTRH; -extern TBLPTRU; -extern TABLAT; -extern PRODL; extern PRODH; +extern PRODL; +extern TBLPTRH; +extern TBLPTRL; +extern WREG; +extern __eeprom_gptrput4; void _gptrput4(void) __naked { __asm /* decode generic pointer MSB (in WREG) bits 6 and 7: * 00 -> code (unimplemented) - * 01 -> EEPROM (unimplemented) + * 01 -> EEPROM * 10 -> data - * 11 -> unimplemented + * 11 -> data + * + * address: (WREG, PRODL, FSR0L) + * value: (TBLPTRH, TBLPTRL, PRODH, STACK1[+1]) */ btfss _WREG, 7 bra _lab_01_ /* data pointer */ - /* data are already in FSR0 */ + /* FSR0L is already set up */ movff _PRODL, _FSR0H movff _PREINC1, _POSTINC0 @@ -69,18 +69,11 @@ _lab_01_: /* code or eeprom */ - btfss _WREG, 6 - return - + btfsc _WREG, 6 + goto ___eeprom_gptrput4 + /* code pointer, cannot write code pointers */ + return - -_lab_02_: - /* EEPROM pointer */ - - /* unimplemented yet */ - - - return __endasm; } diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/int/divsint.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/int/divsint.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/int/divsint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/int/divsint.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/int/divuint.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/int/divuint.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/int/divuint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/int/divuint.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/int/modsint.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/int/modsint.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/int/modsint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/int/modsint.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/int/moduint.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/int/moduint.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/int/moduint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/int/moduint.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/int/mulint.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/int/mulint.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/int/mulint.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/int/mulint.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/long/divslong.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/long/divslong.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/long/divslong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/long/divslong.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/long/divulong.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/long/divulong.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/long/divulong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/long/divulong.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/long/modslong.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/long/modslong.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/long/modslong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/long/modslong.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/long/modulong.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/long/modulong.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/long/modulong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/long/modulong.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/long/mullong.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/long/mullong.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/long/mullong.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/long/mullong.c 2012-03-13 10:17:10.000000000 +0000 @@ -7,7 +7,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/lregs/lrrest.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/lregs/lrrest.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/lregs/lrrest.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/lregs/lrrest.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/lregs/lrst.c sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/lregs/lrst.c --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/lregs/lrst.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/lregs/lrst.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/stack/stack.S sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/stack/stack.S --- sdcc-3.1.0+dfsg/device/lib/pic16/libsdcc/stack/stack.S 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/libsdcc/stack/stack.S 2012-03-13 10:17:10.000000000 +0000 @@ -7,7 +7,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/startup/crt0.c sdcc-3.2.0+dfsg/device/lib/pic16/startup/crt0.c --- sdcc-3.1.0+dfsg/device/lib/pic16/startup/crt0.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/startup/crt0.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/startup/crt0i.c sdcc-3.2.0+dfsg/device/lib/pic16/startup/crt0i.c --- sdcc-3.1.0+dfsg/device/lib/pic16/startup/crt0i.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/startup/crt0i.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/pic16/startup/crt0iz.c sdcc-3.2.0+dfsg/device/lib/pic16/startup/crt0iz.c --- sdcc-3.1.0+dfsg/device/lib/pic16/startup/crt0iz.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/pic16/startup/crt0iz.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/powf.c sdcc-3.2.0+dfsg/device/lib/powf.c --- sdcc-3.1.0+dfsg/device/lib/powf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/powf.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/printf_fast.c sdcc-3.2.0+dfsg/device/lib/printf_fast.c --- sdcc-3.1.0+dfsg/device/lib/printf_fast.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/printf_fast.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -110,7 +110,7 @@ #endif #ifdef FLOAT -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include static __bit continue_float; #ifndef FLOAT_FIXED4 @@ -132,10 +132,10 @@ #endif -#if !defined(SDCC_mcs51) || defined(SDCC_USE_XSTACK) || defined(_SDCC_NO_ASM_LIB_FUNCS) +#if !defined(__SDCC_mcs51) || defined(__SDCC_USE_XSTACK) || defined(_SDCC_NO_ASM_LIB_FUNCS) // Does printf_fast really work on ds390 and ds400? // If it does, enable them in the line above -#if defined(SDCC_USE_XSTACK) +#if defined(__SDCC_USE_XSTACK) #warning "printf_fast not built, does not support --xstack" #elif defined(_SDCC_NO_ASM_LIB_FUNCS) #warning "printf_fast not built, _SDCC_NO_ASM_LIB_FUNCS defined" diff -Nru sdcc-3.1.0+dfsg/device/lib/printf_fast_f.c sdcc-3.2.0+dfsg/device/lib/printf_fast_f.c --- sdcc-3.1.0+dfsg/device/lib/printf_fast_f.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/printf_fast_f.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -26,7 +26,7 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ -#define SDCC_FLOAT_LIB +#define __SDCC_FLOAT_LIB #include #ifdef FLOAT_ASM_MCS51 diff -Nru sdcc-3.1.0+dfsg/device/lib/printf_large.c sdcc-3.2.0+dfsg/device/lib/printf_large.c --- sdcc-3.1.0+dfsg/device/lib/printf_large.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/printf_large.c 2012-03-13 10:17:10.000000000 +0000 @@ -7,7 +7,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -28,7 +28,7 @@ might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ -#if defined (SDCC_ds390) || defined (SDCC_USE_XSTACK) || defined (SDCC_MODEL_HUGE) +#if defined (__SDCC_ds390) || defined (__SDCC_USE_XSTACK) || defined (__SDCC_MODEL_HUGE) #define USE_FLOATS 1 #endif @@ -39,18 +39,14 @@ #include #include -#ifndef BOOL -#define BOOL _Bool -#endif - #define PTR value.ptr -#ifdef SDCC_ds390 +#ifdef __SDCC_ds390 #define NULL_STRING "" #define NULL_STRING_LENGTH 6 #endif -#if defined (SDCC_mcs51) && defined (SDCC_MODEL_SMALL) && !defined (SDCC_STACK_AUTO) +#if defined (__SDCC_mcs51) && defined (__SDCC_MODEL_SMALL) && !defined (__SDCC_STACK_AUTO) # define MEM_SPACE_BUF __idata # define MEM_SPACE_BUF_PP __idata #else @@ -91,8 +87,8 @@ const char *ptr; } value_t; -#ifndef SDCC_STACK_AUTO - static BOOL lower_case; +#ifndef __SDCC_STACK_AUTO + static bool lower_case; static pfn_outputchar output_char; static void* p; static value_t value; @@ -101,7 +97,7 @@ /****************************************************************************/ -#ifdef SDCC_STACK_AUTO +#ifdef __SDCC_STACK_AUTO #define OUTPUT_CHAR(c, p) { output_char (c, p); charsOutputted++; } #else #define OUTPUT_CHAR(c, p) _output_char (c) @@ -115,9 +111,9 @@ /*--------------------------------------------------------------------------*/ -#ifdef SDCC_STACK_AUTO +#ifdef __SDCC_STACK_AUTO static void - output_digit (unsigned char n, BOOL lower_case, pfn_outputchar output_char, void* p) + output_digit (unsigned char n, bool lower_case, pfn_outputchar output_char, void* p) { register unsigned char c = n + (unsigned char)'0'; @@ -147,10 +143,10 @@ /*--------------------------------------------------------------------------*/ -#ifdef SDCC_STACK_AUTO +#ifdef __SDCC_STACK_AUTO #define OUTPUT_2DIGITS( B ) { output_2digits( B, lower_case, output_char, p ); charsOutputted += 2; } static void - output_2digits (unsigned char b, BOOL lower_case, pfn_outputchar output_char, void* p) + output_2digits (unsigned char b, bool lower_case, pfn_outputchar output_char, void* p) { output_digit( b>>4, lower_case, output_char, p ); output_digit( b&0x0F, lower_case, output_char, p ); @@ -167,7 +163,7 @@ /*--------------------------------------------------------------------------*/ -#if defined SDCC_STACK_AUTO +#if defined __SDCC_STACK_AUTO static void calculate_digit (value_t _AUTOMEM * value, unsigned char radix) { @@ -225,16 +221,16 @@ #define DEFAULT_FLOAT_PRECISION 6 -#ifdef SDCC_STACK_AUTO +#ifdef __SDCC_STACK_AUTO #define OUTPUT_FLOAT(F, W, D, L, Z, S, P) output_float(F, W, D, L, Z, S, P, output_char, p) static unsigned char output_float (float f, unsigned char reqWidth, signed char reqDecimals, - BOOL left, BOOL zero, BOOL sign, BOOL space, + bool left, bool zero, bool sign, bool space, pfn_outputchar output_char, void* p) { unsigned char charsOutputted = 0; - #if defined (SDCC_mcs51) + #if defined (__SDCC_mcs51) char fpBuffer[16]; //mcs51 has only a small stack #else char fpBuffer[128]; @@ -244,11 +240,11 @@ static void output_float (float f, unsigned char reqWidth, signed char reqDecimals, - BOOL left, BOOL zero, BOOL sign, BOOL space) + bool left, bool zero, bool sign, bool space) { __xdata char fpBuffer[128]; -#endif //SDCC_STACK_AUTO - BOOL negative = 0; +#endif //__SDCC_STACK_AUTO + bool negative = 0; unsigned long integerPart; float rounding; float decimalPart; @@ -426,31 +422,31 @@ OUTPUT_CHAR ('0'+exp/10, p); OUTPUT_CHAR ('0'+exp%10, p); } -#ifdef SDCC_STACK_AUTO +#ifdef __SDCC_STACK_AUTO return charsOutputted; #else return; -#endif //SDCC_STACK_AUTO +#endif //__SDCC_STACK_AUTO } #endif //USE_FLOATS int _print_format (pfn_outputchar pfn, void* pvoid, const char *format, va_list ap) { - BOOL left_justify; - BOOL zero_padding; - BOOL prefix_sign; - BOOL prefix_space; - BOOL signed_argument; - BOOL char_argument; - BOOL long_argument; - BOOL float_argument; -#ifdef SDCC_STACK_AUTO - BOOL lower_case; + bool left_justify; + bool zero_padding; + bool prefix_sign; + bool prefix_space; + bool signed_argument; + bool char_argument; + bool long_argument; + bool float_argument; +#ifdef __SDCC_STACK_AUTO + bool lower_case; value_t value; int charsOutputted; #endif - BOOL lsd; + bool lsd; unsigned char radix; unsigned char width; @@ -458,7 +454,7 @@ unsigned char length; char c; -#ifdef SDCC_STACK_AUTO +#ifdef __SDCC_STACK_AUTO #define output_char pfn #define p pvoid #else @@ -469,7 +465,7 @@ // reset output chars charsOutputted = 0; -#ifdef SDCC_ds390 +#ifdef __SDCC_ds390 if (format==0) { format=NULL_STRING; @@ -572,7 +568,7 @@ case 'S': PTR = va_arg(ap,ptr_t); -#ifdef SDCC_ds390 +#ifdef __SDCC_ds390 if (PTR==0) { PTR=NULL_STRING; @@ -617,7 +613,7 @@ case 'P': PTR = va_arg(ap,ptr_t); -#if defined (SDCC_ds390) +#if defined (__SDCC_ds390) { unsigned char memtype = value.byte[3]; if (memtype >= 0x80) @@ -636,7 +632,7 @@ OUTPUT_2DIGITS( value.byte[2] ); OUTPUT_2DIGITS( value.byte[1] ); OUTPUT_2DIGITS( value.byte[0] ); -#elif defined (SDCC_mcs51) +#elif defined (__SDCC_mcs51) { unsigned char memtype = value.byte[2]; if (memtype >= 0x80) @@ -710,13 +706,13 @@ //width=8; #else // ignore b and l conversion spec for now -#ifdef SDCC_STACK_AUTO +#ifdef __SDCC_STACK_AUTO charsOutputted += OUTPUT_FLOAT(value.f, width, decimals, left_justify, zero_padding, prefix_sign, prefix_space); #else OUTPUT_FLOAT(value.f, width, decimals, left_justify, zero_padding, prefix_sign, prefix_space); -#endif //SDCC_STACK_AUTO +#endif //__SDCC_STACK_AUTO #endif //USE_FLOATS } else if (radix != 0) @@ -761,7 +757,7 @@ do { value.byte[4] = 0; -#if defined SDCC_STACK_AUTO +#if defined __SDCC_STACK_AUTO calculate_digit(&value, radix); #else calculate_digit(radix); @@ -850,7 +846,7 @@ { value.byte[4] = *pstore & 0x0F; } -#ifdef SDCC_STACK_AUTO +#ifdef __SDCC_STACK_AUTO output_digit( value.byte[4], lower_case, output_char, p ); charsOutputted++; #else diff -Nru sdcc-3.1.0+dfsg/device/lib/printf_tiny.c sdcc-3.2.0+dfsg/device/lib/printf_tiny.c --- sdcc-3.1.0+dfsg/device/lib/printf_tiny.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/printf_tiny.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -64,13 +64,13 @@ #define print_zero_flag PSW.5 -#if !defined(SDCC_mcs51) || defined(SDCC_USE_XSTACK) || defined(_SDCC_NO_ASM_LIB_FUNCS) +#if !defined(__SDCC_mcs51) || defined(__SDCC_USE_XSTACK) || defined(_SDCC_NO_ASM_LIB_FUNCS) /* Does printf_tiny really work on ds390 and ds400? If it does, enable them in the line above */ #if defined(_SDCC_BUILD_LIB) /* Disable all warnings if building a library */ #pragma disable_warning 190 -#elif defined(SDCC_USE_XSTACK) +#elif defined(__SDCC_USE_XSTACK) #warning "printf_tiny not built, does not support --xstack" #elif defined(_SDCC_NO_ASM_LIB_FUNCS) #warning "printf_tiny not built, _SDCC_NO_ASM_LIB_FUNCS defined" diff -Nru sdcc-3.1.0+dfsg/device/lib/printfl.c sdcc-3.2.0+dfsg/device/lib/printfl.c --- sdcc-3.1.0+dfsg/device/lib/printfl.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/printfl.c 2012-06-06 11:34:31.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -45,10 +45,6 @@ #include #include #include -#ifndef __ds390 -/* just for the SP */ -#include <8051.h> -#endif static __data char radix ; static __bit long_flag = 0; @@ -60,7 +56,7 @@ /* This great loop fails with the ds390 port (2003-01-13). At the beginning resp. end of the loop the compiler inserts a "push ar2" - resp. "pop ar2", which badly interfers with the push/pop in the source. + resp. "pop ar2", which badly interferes with the push/pop in the source. Library functions should be rock solid and portable. There's an _ltoa in the library, so let's use it and don't reinvent the wheel. @@ -69,6 +65,9 @@ */ #if NICE_LIFO_IMPLEMENTATION_BUT_NOT_PORTABLE +/* just for the SP */ +#include <8051.h> + static __data volatile char ch; static __bit sign; @@ -85,12 +84,12 @@ } else { sign = 0; lval = val;} - if (!long_flag) { - lval &= 0x0000ffff; - } + if (!long_flag) { + lval &= 0x0000ffff; + } if (char_flag) { - lval &= 0x000000ff; - } + lval &= 0x000000ff; + } do { @@ -101,7 +100,7 @@ __asm push _ch __endasm; lval /= radix; # else - // This only looks more efficient, but isn't. see the .map + // This only looks more efficient, but isn't. see the .map ch = (lval % radix) + '0'; if (ch>'9') ch+=7; __asm push _ch __endasm; diff -Nru sdcc-3.1.0+dfsg/device/lib/puts.c sdcc-3.2.0+dfsg/device/lib/puts.c --- sdcc-3.1.0+dfsg/device/lib/puts.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/puts.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/Makefile.in sdcc-3.2.0+dfsg/device/lib/r2k/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/r2k/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/Makefile.in 2012-04-02 09:59:13.000000000 +0000 @@ -1,17 +1,13 @@ -# libc/z80 Makefile +# libc/r2k Makefile VPATH = @srcdir@ srcdir = @srcdir@ top_builddir = @top_builddir@ -AR_S = @AR@ @AR_S_FLAG@ +LIB_TYPE = @LIB_TYPE@ -LIB_TYPE = @LIB_TYPE@ - -TOPDIR = ../../.. - -SCC = $(TOPDIR)/bin/sdcc -mr2k -SAS = $(TOPDIR)/bin/sdasrab +SCC = $(top_builddir)/bin/sdcc -mr2k +SAS = $(top_builddir)/bin/sdasrab # override PORTDIR defined by super (parent) makefile override PORTDIR = ../build/r2k @@ -26,6 +22,15 @@ _divulong.c \ _mullong.c +Z80_LONGLONG = $(COMMON_LONGLONG) \ + _rrulonglong.c \ + _rrslonglong.c \ + _rlulonglong.c \ + _rlslonglong.c \ + _mullonglong.c \ + _divslonglong.c \ + _divulonglong.c + Z80_SDCC = $(COMMON_SDCC) \ _itoa.c \ _ltoa.c \ @@ -34,8 +39,8 @@ vprintf.c \ _strlen.c -Z80SOURCES = $(addprefix ../,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_SDCC)) -Z8OBJECTS = $(patsubst %.c,%.rel,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_SDCC)) +Z80SOURCES = $(addprefix ../,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_LONGLONG) $(Z80_SDCC)) +Z8OBJECTS = $(patsubst %.c,%.rel,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_LONGLONG) $(Z80_SDCC)) OBJ = divunsigned.rel divsigned.rel divmixed.rel modunsigned.rel modsigned.rel modmixed.rel mul.rel mulchar.rel \ putchar.rel shift.rel stubs.rel crt0_rle.rel heap.rel fstubs.rel memmove.rel abs.rel crtcall.rel \ @@ -56,14 +61,13 @@ $(PORTDIR)/$(LIB): $(OBJ) $(Z8OBJECTS) Makefile ifeq ($(LIB_TYPE), SDCCLIB) rm -f $@; \ - ../../../bin/sdcclib -a $@ $(OBJ) $(Z8OBJECTS) + $(top_builddir)/bin/sdcclib -a $@ $(OBJ) $(Z8OBJECTS) else ifeq ($(LIB_TYPE), AR) - $(AR_S) -cq $@ $(OBJ) $(Z8OBJECTS) + $(top_builddir)/bin/sdar -rcS $@ $(OBJ) $(Z8OBJECTS) else ifeq ($(LIB_TYPE), RANLIB) - $(AR_S) -cq $@ $(OBJ) $(Z8OBJECTS) - $(top_builddir)/bin/sdranlib $@ + $(top_builddir)/bin/sdar -rc $@ $(OBJ) $(Z8OBJECTS) else rm -f $@; \ for i in $(basename $(OBJ) $(Z8OBJECTS)); do echo $$i >>$@; done diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/abs.s sdcc-3.2.0+dfsg/device/lib/r2k/abs.s --- sdcc-3.1.0+dfsg/device/lib/r2k/abs.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/abs.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/crt0.s sdcc-3.2.0+dfsg/device/lib/r2k/crt0.s --- sdcc-3.1.0+dfsg/device/lib/r2k/crt0.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/crt0.s 2012-03-13 10:17:10.000000000 +0000 @@ -7,7 +7,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/crt0_rle.s sdcc-3.2.0+dfsg/device/lib/r2k/crt0_rle.s --- sdcc-3.1.0+dfsg/device/lib/r2k/crt0_rle.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/crt0_rle.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/crtcall.s sdcc-3.2.0+dfsg/device/lib/r2k/crtcall.s --- sdcc-3.1.0+dfsg/device/lib/r2k/crtcall.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/crtcall.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/divmixed.s sdcc-3.2.0+dfsg/device/lib/r2k/divmixed.s --- sdcc-3.1.0+dfsg/device/lib/r2k/divmixed.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/divmixed.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/divsigned.s sdcc-3.2.0+dfsg/device/lib/r2k/divsigned.s --- sdcc-3.1.0+dfsg/device/lib/r2k/divsigned.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/divsigned.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/divunsigned.s sdcc-3.2.0+dfsg/device/lib/r2k/divunsigned.s --- sdcc-3.1.0+dfsg/device/lib/r2k/divunsigned.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/divunsigned.s 2012-03-13 10:17:10.000000000 +0000 @@ -1,11 +1,11 @@ ;-------------------------------------------------------------------------- ; divunsigned.s ; -; Copyright (C) 2000-2010, Michael Hope, Philipp Klaus Krause, Marco Bodrato +; Copyright (C) 2000-2012, Michael Hope, Philipp Klaus Krause, Marco Bodrato ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, @@ -64,19 +64,16 @@ ;; Exit conditions ;; HL = quotient ;; DE = remainder - ;; If divisor is non-zero, carry=0 - ;; If divisor is 0, carry=1 and both quotient and remainder are 0 + ;; carry = 0 + ;; If divisor is 0, quotient is set to "infinity", i.e HL = 0xFFFF. ;; ;; Register used: AF,B,DE,HL __divuint_rrx_hds:: __divu16:: - ;; Check for division by zero - ld a,e - or a,d ;; Two algorithms: one assumes divisor <2^7, the second ;; assumes divisor >=2^7; choose the applicable one. + ld a,e and a,#0x80 - jr NZ,.morethan7bits or a,d jr NZ,.morethan7bits ;; Both algorithms "rotate" 24 bits (H,L,A) but roles change. diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/fstubs.s sdcc-3.2.0+dfsg/device/lib/r2k/fstubs.s --- sdcc-3.1.0+dfsg/device/lib/r2k/fstubs.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/fstubs.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/heap.s sdcc-3.2.0+dfsg/device/lib/r2k/heap.s --- sdcc-3.1.0+dfsg/device/lib/r2k/heap.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/heap.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/memmove.s sdcc-3.2.0+dfsg/device/lib/r2k/memmove.s --- sdcc-3.1.0+dfsg/device/lib/r2k/memmove.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/memmove.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/modmixed.s sdcc-3.2.0+dfsg/device/lib/r2k/modmixed.s --- sdcc-3.1.0+dfsg/device/lib/r2k/modmixed.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/modmixed.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/modsigned.s sdcc-3.2.0+dfsg/device/lib/r2k/modsigned.s --- sdcc-3.1.0+dfsg/device/lib/r2k/modsigned.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/modsigned.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/modunsigned.s sdcc-3.2.0+dfsg/device/lib/r2k/modunsigned.s --- sdcc-3.1.0+dfsg/device/lib/r2k/modunsigned.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/modunsigned.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/mul.s sdcc-3.2.0+dfsg/device/lib/r2k/mul.s --- sdcc-3.1.0+dfsg/device/lib/r2k/mul.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/mul.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/mulchar.s sdcc-3.2.0+dfsg/device/lib/r2k/mulchar.s --- sdcc-3.1.0+dfsg/device/lib/r2k/mulchar.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/mulchar.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/putchar.s sdcc-3.2.0+dfsg/device/lib/r2k/putchar.s --- sdcc-3.1.0+dfsg/device/lib/r2k/putchar.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/putchar.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/setjmp.s sdcc-3.2.0+dfsg/device/lib/r2k/setjmp.s --- sdcc-3.1.0+dfsg/device/lib/r2k/setjmp.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/setjmp.s 2012-03-13 10:17:10.000000000 +0000 @@ -1,11 +1,11 @@ ;-------------------------------------------------------------------------- -; abs.s +; setjmp.s ; ; Copyright (C) 2011, Philipp Klaus Krause ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, @@ -44,7 +44,6 @@ xor a, a ld l, a ld h, a - ld hl, #0 add hl, sp ld 2(iy), l ld 3(iy), h @@ -84,8 +83,7 @@ ld l, 2(iy) ld h, 3(iy) ld sp, hl - inc sp - inc sp + pop hl ; Move return value into hl. ex de, hl @@ -95,4 +93,3 @@ ld b, 1(iy) push bc ret - diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/shift.s sdcc-3.2.0+dfsg/device/lib/r2k/shift.s --- sdcc-3.1.0+dfsg/device/lib/r2k/shift.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/shift.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/r2k/stubs.s sdcc-3.2.0+dfsg/device/lib/r2k/stubs.s --- sdcc-3.1.0+dfsg/device/lib/r2k/stubs.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r2k/stubs.s 2012-04-02 09:59:13.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, @@ -182,3 +182,4 @@ ld a,#5 rst #0x28 jp __rlslong_rrx_s + diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/Makefile.in sdcc-3.2.0+dfsg/device/lib/r3ka/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/r3ka/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/Makefile.in 2012-05-18 16:23:38.000000000 +0000 @@ -0,0 +1,95 @@ +# libc/r3ka Makefile + +VPATH = @srcdir@ +srcdir = @srcdir@ +top_builddir = @top_builddir@ + +LIB_TYPE = @LIB_TYPE@ + +SCC = $(top_builddir)/bin/sdcc -mr3ka +SAS = $(top_builddir)/bin/sdasrab + +# override PORTDIR defined by super (parent) makefile +override PORTDIR = ../build/r3ka + +include $(srcdir)/../incl.mk + +Z80_FLOAT = $(COMMON_FLOAT) + +Z80_INT = $(COMMON_INT) + +Z80_LONG = $(COMMON_LONG) \ + _divulong.c \ + _mullong.c + +Z80_LONGLONG = $(COMMON_LONGLONG) \ + _rrulonglong.c \ + _rrslonglong.c \ + _rlulonglong.c \ + _rlslonglong.c \ + _mullonglong.c \ + _divslonglong.c \ + _divulonglong.c + +Z80_SDCC = $(COMMON_SDCC) \ + _itoa.c \ + _ltoa.c \ + _startup.c \ + sprintf.c \ + vprintf.c \ + _strlen.c + +Z80SOURCES = $(addprefix ../,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_LONGLONG) $(Z80_SDCC)) +Z8OBJECTS = $(patsubst %.c,%.rel,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_LONGLONG) $(Z80_SDCC)) + +OBJ = divunsigned.rel divsigned.rel divmixed.rel modunsigned.rel modsigned.rel modmixed.rel mul.rel mulchar.rel \ + putchar.rel shift.rel stubs.rel crt0_rle.rel heap.rel fstubs.rel memmove.rel abs.rel crtcall.rel \ + setjmp.rel + +LIB = r3ka.lib +CC = $(SCC) +AS = $(SAS) +ASFLAGS = -plosgff + +CFLAGS = -I$(srcdir)/../../include -I. --std-c99 + +all: $(PORTDIR)/$(LIB) $(PORTDIR)/crt0.rel + +$(PORTDIR)/crt0.rel: crt0.rel + cp crt0.rel $(PORTDIR)/crt0.rel + +$(PORTDIR)/$(LIB): $(OBJ) $(Z8OBJECTS) Makefile +ifeq ($(LIB_TYPE), SDCCLIB) + rm -f $@; \ + $(top_builddir)/bin/sdcclib -a $@ $(OBJ) $(Z8OBJECTS) +else + ifeq ($(LIB_TYPE), AR) + $(top_builddir)/bin/sdar -rcS $@ $(OBJ) $(Z8OBJECTS) + else + ifeq ($(LIB_TYPE), RANLIB) + $(top_builddir)/bin/sdar -rc $@ $(OBJ) $(Z8OBJECTS) + else + rm -f $@; \ + for i in $(basename $(OBJ) $(Z8OBJECTS)); do echo $$i >>$@; done + cp $(OBJ) $(Z8OBJECTS) $(PORTDIR) + endif + endif +endif + +%.rel: %.c + $(CC) $(CFLAGS) -c $< + +%.rel: %.s + @# TODO: sdas should place it\'s output in the current dir + test $(srcdir) = . || cp $< . + -$(AS) $(ASFLAGS) $(notdir $<) + test $(srcdir) = . || rm $(notdir $<) + +%.rel: ../%.c + $(CC) $(CFLAGS) -c $< + +clean: + rm -f *.rel *.sym *.lst *~ $(CLEANSPEC) *.dump* *.asm *.lib + +distclean: clean + rm -f Makefile diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/abs.s sdcc-3.2.0+dfsg/device/lib/r3ka/abs.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/abs.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/abs.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,61 @@ +;-------------------------------------------------------------------------- +; abs.s +; +; Copyright (C) 2010, Philipp Klaus Krause +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + + .area _CODE + + .globl _abs + +; 12B; 86T for nonnegative arguments, 78T for negative. +_abs: + pop hl + pop de + push de + push hl + xor a, a + ld l, a + ld h, a + sbc hl, de + ret P + ex de, hl + ret + +; 14B; 59T for nonegative arguments, 94T for negative: +;_abs: +; pop de +; pop hl +; push hl +; push de +; bit 7, h +; ret Z +; xor a, a +; ld e, a +; ld d, a +; ex de, hl +; sbc hl, de +; ret + diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/crt0.s sdcc-3.2.0+dfsg/device/lib/r3ka/crt0.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/crt0.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/crt0.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,93 @@ +;-------------------------------------------------------------------------- +; crt0.s - Generic crt0.s for a rabbit 2000 +; derived from "Generic crt0.s for a Z80" +; +; Copyright (C) 2000, Michael Hope +; Modified for rabbit by Leland Morrison 2011 +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + + .module crt0 + .globl _main + + .area _HEADER (ABS) + ;; Reset vector + .org 0 + jp init + + .org 0x08 + reti + .org 0x10 + reti + .org 0x18 + reti + .org 0x20 + reti + .org 0x28 + reti + .org 0x30 + reti + .org 0x38 + reti + + .org 0x100 +init: + ;; Stack at the top of memory. + ld sp,#0xffff + + ;; Initialise global variables + call gsinit + call _main + jp _exit + + ;; Ordering of segments for the linker. + .area _HOME + .area _CODE + .area _GSINIT + .area _GSFINAL + + .area _DATA + .area _BSEG + .area _BSS + .area _HEAP + + .area _CODE +__clock:: + ld a,#2 + rst #0x28 + ret + +_exit:: + ;; Exit - special code to the emulator + ld a,#0 + rst #0x28 +1$: + ;halt ; opcode for halt used for 'altd' on rabbit processors + jr 1$ + + .area _GSINIT +gsinit:: + + .area _GSFINAL + ret diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/crt0_rle.s sdcc-3.2.0+dfsg/device/lib/r3ka/crt0_rle.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/crt0_rle.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/crt0_rle.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,73 @@ +;-------------------------------------------------------------------------- +; crt0_rle.s +; +; Copyright (C) 2001, Michael Hope +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + + .area _CODE + + ;; Special RLE decoder used for initing global data +__initrleblock:: + ;; Pull the destination address out + ld c,l + ld b,h + + ;; Pop the return address + pop hl +1$: + ;; Fetch the run + ld e,(hl) + inc hl + ;; Negative means a run + bit 7,e + jp Z,2$ + ;; Code for expanding a run + ld a,(hl) + inc hl +3$: + ld (bc),a + inc bc + inc e + jp NZ,3$ + jp 1$ +2$: + ;; Zero means end of a block + xor a,a + or a,e + jp Z,4$ + ;; Code for expanding a block +5$: + ld a,(hl) + inc hl + ld (bc),a + inc bc + dec e + jp NZ,5$ + jp 1$ +4$: + ;; Push the return address back onto the stack + push hl + ret + diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/crtcall.s sdcc-3.2.0+dfsg/device/lib/r3ka/crtcall.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/crtcall.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/crtcall.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,36 @@ +;-------------------------------------------------------------------------- +; crtcall.s +; +; Copyright (C) 2011, Maarten Brock +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + + .area _CODE + + .globl __sdcc_call_hl + +; The Z80 has the jp (hl) instruction, which is perfect for implementing function pointers. + +__sdcc_call_hl: + jp (hl) diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/divmixed.s sdcc-3.2.0+dfsg/device/lib/r3ka/divmixed.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/divmixed.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/divmixed.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,55 @@ +;-------------------------------------------------------------------------- +; divmixed.s +; +; Copyright (C) 2010, Philipp Klaus Krause +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + +__divsuchar_rrx_s:: + ld hl,#2+1 + add hl,sp + + ld e,(hl) + dec hl + ld l,(hl) + ld h,#0 + + jp __div_signexte + +__divuschar_rrx_s:: + ld hl,#2+1 + ld d, h + add hl,sp + + ld e,(hl) + dec hl + ld l,(hl) + + ld a,l ; Sign extend + rlca + sbc a,a + ld h,a + + jp __div16 + diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/divsigned.s sdcc-3.2.0+dfsg/device/lib/r3ka/divsigned.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/divsigned.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/divsigned.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,137 @@ +;-------------------------------------------------------------------------- +; divsigned.s +; +; Copyright (C) 2000-2010, Michael Hope, Philipp Klaus Krause +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + + .area _CODE + +__divsint_rrx_s:: + pop af + pop hl + pop de + push de + push hl + push af + + jp __div16 + +__divschar_rrx_s:: + ld hl, #2+1 + add hl, sp + + ld e, (hl) + dec hl + ld l, (hl) + + ;; Fall through +__divschar_rrx_hds:: +__div8:: + ld a, l ; Sign extend + rlca + sbc a,a + ld h, a +__div_signexte:: + ld a, e ; Sign extend + rlca + sbc a,a + ld d, a + ; Fall through to __div16 + + ;; signed 16-bit division + ;; + ;; Entry conditions + ;; HL = dividend + ;; DE = divisor + ;; + ;; Exit conditions + ;; HL = quotient + ;; DE = remainder + ;; + ;; Register used: AF,B,DE,HL +__divsint_rrx_hds:: +__div16:: + ;; Determine sign of quotient by xor-ing high bytes of dividend + ;; and divisor. Quotient is positive if signs are the same, negative + ;; if signs are different + ;; Remainder has same sign as dividend + ld a, h ; Get high byte of dividend + xor a, d ; Xor with high byte of divisor + rla ; Sign of quotient goes into the carry + ld a, h ; Get high byte of dividend + push af ; Save sign of both quotient and reminder + + ; Take absolute value of dividend + rla + jr NC, .chkde ; Jump if dividend is positive + sub a, a ; Substract dividend from 0 + sub a, l + ld l, a + sbc a, a ; Propagate borrow (A=0xFF if borrow) + sub a, h + ld h, a + + ; Take absolute value of divisor +.chkde: + bit 7, d + jr Z, .dodiv ; Jump if divisor is positive + sub a, a ; Subtract divisor from 0 + sub a, e + ld e, a + sbc a, a ; Propagate borrow (A=0xFF if borrow) + sub a, d + ld d, a + + ; Divide absolute values +.dodiv: + call __divu16 + +.fix_quotient: + ; Negate quotient if it is negative + pop af ; recover sign of quotient + ret NC ; Jump if quotient is positive + ld b, a + sub a, a ; Subtract quotient from 0 + sub a, l + ld l, a + sbc a, a ; Propagate borrow (A=0xFF if borrow) + sub a, h + ld h, a + ld a, b + ret + +__get_remainder:: + ; Negate remainder if it is negative and move it into hl + rla + ex de, hl + ret NC ; Return if remainder is positive + sub a, a ; Subtract remainder from 0 + sub a, l + ld l, a + sbc a, a ; Propagate remainder (A=0xFF if borrow) + sub a, h + ld h, a + ret + diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/divunsigned.s sdcc-3.2.0+dfsg/device/lib/r3ka/divunsigned.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/divunsigned.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/divunsigned.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,142 @@ +;-------------------------------------------------------------------------- +; divunsigned.s +; +; Copyright (C) 2000-2012, Michael Hope, Philipp Klaus Krause, Marco Bodrato +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + + ;; Originally from GBDK by Pascal Felber. + + .area _CODE + +__divuint_rrx_s:: + pop af + pop hl + pop de + push de + push hl + push af + + jr __divu16 + +__divuchar_rrx_s:: + ld hl,#2+1 + add hl,sp + + ld e,(hl) + dec hl + ld l,(hl) + + ;; Fall through +__divuchar_rrx_hds:: +__divu8:: + ld h,#0x00 + ld d,h + ; Fall through to __divu16 + + ;; unsigned 16-bit division + ;; + ;; Entry conditions + ;; HL = dividend + ;; DE = divisor + ;; + ;; Exit conditions + ;; HL = quotient + ;; DE = remainder + ;; carry = 0 + ;; If divisor is 0, quotient is set to "infinity", i.e HL = 0xFFFF. + ;; + ;; Register used: AF,B,DE,HL +__divuint_rrx_hds:: +__divu16:: + ;; Two algorithms: one assumes divisor <2^7, the second + ;; assumes divisor >=2^7; choose the applicable one. + ld a,e + and a,#0x80 + or a,d + jr NZ,.morethan7bits + ;; Both algorithms "rotate" 24 bits (H,L,A) but roles change. + + ;; unsigned 16/7-bit division +.atmost7bits: + ld b,#16 ; bits in dividend and possible quotient + ;; Carry cleared by AND/OR, this "0" bit will pass trough HL.[*] + adc hl,hl +.dvloop7: + ;; HL holds both dividend and quotient. While we shift a bit from + ;; MSB of dividend, we shift next bit of quotient in from carry. + ;; A holds remainder. + rla + + ;; If remainder is >= divisor, next bit of quotient is 1. We try + ;; to compute the difference. + sub a,e + jr NC,.nodrop7 ; Jump if remainder is >= dividend + add a,e ; Otherwise, restore remainder + ;; The add above sets the carry, because sbc a,e did set it. +.nodrop7: + ccf ; Complement borrow so 1 indicates a + ; successful substraction (this is the + ; next bit of quotient) + adc hl,hl + djnz .dvloop7 + ;; Carry now contains the same value it contained before + ;; entering .dvloop7[*]: "0" = valid result. + ld e,a ; DE = remainder, HL = quotient + ret + +.morethan7bits: + ld b,#9 ; at most 9 bits in quotient. + ld a,l ; precompute the first 7 shifts, by + ld l,h ; doing 8 + ld h,#0 + rr l ; undoing 1 +.dvloop: + ;; Shift next bit of quotient into bit 0 of dividend + ;; Shift next MSB of dividend into LSB of remainder + ;; A holds both dividend and quotient. While we shift a bit from + ;; MSB of dividend, we shift next bit of quotient in from carry + ;; HL holds remainder + adc hl,hl ; HL < 2^(7+9), no carry, ever. + + ;; If remainder is >= divisor, next bit of quotient is 1. We try + ;; to compute the difference. + sbc hl,de + jr NC,.nodrop ; Jump if remainder is >= dividend + add hl,de ; Otherwise, restore remainder + ;; The add above sets the carry, because sbc hl,de did set it. +.nodrop: + ccf ; Complement borrow so 1 indicates a + ; successful substraction (this is the + ; next bit of quotient) + rla + djnz .dvloop + ;; Take care of the ninth quotient bit! after the loop B=0. + rl b ; BA = quotient + ;; Carry now contains "0" = valid result. + ld d,b + ld e,a ; DE = quotient, HL = remainder + ex de,hl ; HL = quotient, DE = remainder + ret + diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/fstubs.s sdcc-3.2.0+dfsg/device/lib/r3ka/fstubs.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/fstubs.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/fstubs.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,35 @@ +;-------------------------------------------------------------------------- +; fstubs.s +; +; Copyright (C) 2001, Michael Hope +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + +; Just stubs - not copyrightable + + ;; Stubs to match between function names + .area _CODE + +___slong2fs_rrx_s:: + jp ___slong2fs diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/heap.s sdcc-3.2.0+dfsg/device/lib/r3ka/heap.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/heap.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/heap.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,44 @@ +;-------------------------------------------------------------------------- +; heap.s +; +; Copyright (C) 2001, Michael Hope +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + +; Just stubs - not copyrightable + + ;; Stubs that hook the heap in + .globl __sdcc_heap_init + + .area _GSINIT + call __sdcc_heap_init + + .area _HEAP +__sdcc_heap_start:: + ;; For now just allocate 1k of heap. + .ds 1023 + + .area _HEAP_END +__sdcc_heap_end:: + .ds 1 diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/memmove.s sdcc-3.2.0+dfsg/device/lib/r3ka/memmove.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/memmove.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/memmove.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,65 @@ +;-------------------------------------------------------------------------- +; memmove.s +; +; Copyright (C) 2008-2009, Philipp Klaus Krause, Marco Bodrato +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + + .area _CODE + + .globl _memmove + +; The Z80 has the ldir and lddr instructions, which are perfect for implementing memmove(). + +_memmove: + pop af + pop hl + pop de + pop bc + push bc + push de + push hl + push af + ld a, c + or a, b + ret Z + push hl + sbc hl, de ; or above cleared carry. + add hl, de ; same carry as the line before + jr C, memmove_up +memmove_down: + dec bc + add hl, bc + ex de, hl + add hl, bc + inc bc + lddr + pop hl + ret +memmove_up: + ex de, hl + ldir + pop hl + ret + diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/modmixed.s sdcc-3.2.0+dfsg/device/lib/r3ka/modmixed.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/modmixed.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/modmixed.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,59 @@ +;-------------------------------------------------------------------------- +; modmixed.s +; +; Copyright (C) 2010, Philipp Klaus Krause +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + +__modsuchar_rrx_s:: + ld hl,#2+1 + add hl,sp + + ld e,(hl) + dec hl + ld l,(hl) + ld h,#0 + + call __div_signexte + + jp __get_remainder + +__moduschar_rrx_s:: + ld hl,#2+1 + ld d, h + add hl,sp + + ld e,(hl) + dec hl + ld l,(hl) + + ld a,l ; Sign extend + rlca + sbc a,a + ld h,a + + call __div16 + + jp __get_remainder + diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/modsigned.s sdcc-3.2.0+dfsg/device/lib/r3ka/modsigned.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/modsigned.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/modsigned.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,58 @@ +;-------------------------------------------------------------------------- +; modsigned.s +; +; Copyright (C) 2009, Philipp Klaus Krause +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + + .area _CODE + +__modschar_rrx_s:: + ld hl,#2+1 + add hl,sp + + ld e,(hl) + dec hl + ld l,(hl) + + ;; Fall through +__modschar_rrx_hds:: + call __div8 + + jp __get_remainder + +__modsint_rrx_s:: + pop af + pop hl + pop de + push de + push hl + push af + + ;; Fall through +__modsint_rrx_hds:: + call __div16 + + jp __get_remainder + diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/modunsigned.s sdcc-3.2.0+dfsg/device/lib/r3ka/modunsigned.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/modunsigned.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/modunsigned.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,62 @@ +;-------------------------------------------------------------------------- +; modunsigned.s +; +; Copyright (C) 2009-2010, Philipp Klaus Krause +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + + .area _CODE + +__moduchar_rrx_s:: + ld hl,#2+1 + add hl,sp + + ld e,(hl) + dec hl + ld l,(hl) + + ;; Fall through +__moduchar_rrx_hds:: + call __divu8 + + ex de,hl + + ret + +__moduint_rrx_s:: + pop af + pop hl + pop de + push de + push hl + push af + + ;; Fall through +__moduint_rrx_hds:: + call __divu16 + + ex de,hl + + ret + diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/mul.s sdcc-3.2.0+dfsg/device/lib/r3ka/mul.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/mul.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/mul.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,81 @@ +;-------------------------------------------------------------------------- +; mulchar.s +; +; Copyright (C) 2000, Michael Hope +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + + .area _CODE + +__mulint_rrx_s:: + pop af + pop hl + pop de + push de + push hl + push af + + ;; Fall through + +__muluchar_rrx_hds:: +__mulint_rrx_hds:: + ;; Parameters: + ;; hl, de (left, right irrelevant) + ld b,h + ld c,l + + ;; 16-bit multiplication + ;; + ;; Entry conditions + ;; bc = multiplicand + ;; de = multiplier + ;; + ;; Exit conditions + ;; hl = less significant word of product + ;; + ;; Register used: AF,BC,DE,HL +__mul16:: + xor a,a + ld l,a + or a,b + ld b,#16 + + ;; Optimise for the case when this side has 8 bits of data or + ;; less. This is often the case with support address calls. + jr NZ,2$ + ld b,#8 + ld a,c +1$: + ;; Taken from z88dk, which originally borrowed from the + ;; Spectrum rom. + add hl,hl +2$: + rl c + rla ;DLE 27/11/98 + jr NC,3$ + add hl,de +3$: + djnz 1$ + ret + diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/mulchar.s sdcc-3.2.0+dfsg/device/lib/r3ka/mulchar.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/mulchar.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/mulchar.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,101 @@ +;-------------------------------------------------------------------------- +; mulchar.s +; +; Copyright (C) 2009, Philipp Klaus Krause +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + + .area _CODE + +; This multiplication routine is similar to the one +; from Rodnay Zaks, "Programming the Z80". + +; Now replaced by a builtin for code generation, but +; still called from some asm files in this directory. +__muluchar_rrx_s:: + ld hl, #2+1 + ld d, h + add hl, sp + ld e, (hl) + dec hl + ld h, (hl) + ld l, d + ld b, #8 +muluchar_rrx_s_loop: + add hl, hl + jr nc, muluchar_rrx_s_noadd + add hl, de +muluchar_rrx_s_noadd: + djnz muluchar_rrx_s_loop + ret + +; operands have different sign + +__mulsuchar_rrx_s:: + ld hl,#2+1 + ld b, h + add hl,sp + + ld e,(hl) + dec hl + ld c,(hl) + jr signexte + +__muluschar_rrx_s:: + ld hl,#2 + ld b, h + add hl,sp + + ld e,(hl) + inc hl + ld c,(hl) + jr signexte + +;; Originally from GBDK by Pascal Felber. + +__mulschar_rrx_s:: + ld hl,#2+1 + add hl,sp + + ld e,(hl) + dec hl + ld l,(hl) + + ;; Fall through +__mulschar_rrx_hds:: + ;; Need to sign extend before going in. + ld c,l + + ld a,l + rla + sbc a,a + ld b,a +signexte: + ld a,e + rla + sbc a,a + ld d,a + + jp __mul16 + diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/putchar.s sdcc-3.2.0+dfsg/device/lib/r3ka/putchar.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/putchar.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/putchar.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,47 @@ +;-------------------------------------------------------------------------- +; putchar.s +; +; Copyright (C) 2000, Michael Hope +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + + .area _CODE +_putchar:: +_putchar_rr_s:: + ld hl,#2 + add hl,sp + + ld l,(hl) + ld a,#1 + rst #0x28 + + ret + +_putchar_rr_dbs:: + ld l,e + ld a,#1 + rst #0x28 + + ret + diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/setjmp.s sdcc-3.2.0+dfsg/device/lib/r3ka/setjmp.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/setjmp.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/setjmp.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,95 @@ +;-------------------------------------------------------------------------- +; setjmp.s +; +; Copyright (C) 2011, Philipp Klaus Krause +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + + .area _CODE + + .globl ___setjmp + +___setjmp: + pop hl + pop iy + push af + push hl + + ; Store return address. + ld 0(iy), l + ld 1(iy), h + + ; Store stack pointer. + xor a, a + ld l, a + ld h, a + add hl, sp + ld 2(iy), l + ld 3(iy), h + + ; Store frame pointer. + push ix + pop hl + ld 4(iy), l + ld 5(iy), h + + ; Return 0. + ld l, a + ld h, a + ret + +.globl _longjmp + +_longjmp: + pop af + pop iy + pop de + + ; Ensure that return value is non-zero. + ld a, e + or a, d + jr NZ, jump + ld de, #1 +jump: + + ; Restore frame pointer. + ld l, 4(iy) + ld h, 5(iy) + push hl + pop ix + + ; Adjust stack pointer. + ld l, 2(iy) + ld h, 3(iy) + ld sp, hl + pop hl + + ; Move return value into hl. + ex de, hl + + ; Jump. + ld c, 0(iy) + ld b, 1(iy) + push bc + ret diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/shift.s sdcc-3.2.0+dfsg/device/lib/r3ka/shift.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/shift.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/shift.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,103 @@ +;-------------------------------------------------------------------------- +; putchar.s +; +; Copyright (C) 2001, Michael Hope +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + + ;; +__rrulong_rrx_s:: + ld hl,#2+4 + add hl,sp + + ld a,(hl) + or a,a + pop bc + pop hl + pop de + push de + push hl + push bc + ret Z + ld b,a + ld a,e +1$: + srl d + rra + rr h + rr l + + djnz 1$ + ld e,a + ret + +__rrslong_rrx_s:: + ld hl,#2+4 + add hl,sp + + ld a,(hl) + or a,a + pop bc + pop hl + pop de + push de + push hl + push bc + ret Z + ld b,a + ld a,e +2$: + sra d + rra + rr h + rr l + + djnz 2$ + ld e,a + ret + +__rlslong_rrx_s:: +__rlulong_rrx_s:: + ld hl,#2+4 + add hl,sp + + ld a,(hl) + or a,a + pop bc + pop hl + pop de + push de + push hl + push bc + ret Z + ld b,a + ld a,e +3$: + add hl,hl + rla + rl d + + djnz 3$ + ld e,a + ret diff -Nru sdcc-3.1.0+dfsg/device/lib/r3ka/stubs.s sdcc-3.2.0+dfsg/device/lib/r3ka/stubs.s --- sdcc-3.1.0+dfsg/device/lib/r3ka/stubs.s 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/r3ka/stubs.s 2012-05-18 10:47:44.000000000 +0000 @@ -0,0 +1,185 @@ +;-------------------------------------------------------------------------- +; stubs.s +; +; Copyright (C) 2001, Michael Hope +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library 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 library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + +; Just stubs - not copyrightable + + ;; Stubs to match between function names + .area _CODE + + .globl __mullong + .globl __modslong + .globl __modulong + .globl __divslong + .globl __divulong + .globl __divschar_rrx_s + .globl __divuchar_rrx_s + .globl __divsuchar_rrx_s + .globl __divuschar_rrx_s + .globl __divsint_rrx_s + .globl __divuint_rrx_s + .globl __mulschar_rrx_s + .globl __muluchar_rrx_s + .globl __mulsuchar_rrx_s + .globl __muluschar_rrx_s + .globl __mulint_rrx_s + .globl __modschar_rrx_s + .globl __moduchar_rrx_s + .globl __modsuchar_rrx_s + .globl __moduschar_rrx_s + .globl __moduint_rrx_s + .globl __modsint_rrx_s + .globl __rrulong_rrx_s + .globl __rrslong_rrx_s + .globl __rlulong_rrx_s + .globl __rlslong_rrx_s + +__mullong_rrx_s:: +__mullong_rrf_s:: + jp __mullong + +__modslong_rrx_s:: +__modslong_rrf_s:: + jp __modslong + +__modulong_rrx_s:: +__modulong_rrf_s:: + jp __modulong + +__divslong_rrx_s:: +__divslong_rrf_s:: + jp __divslong + +__divulong_rrx_s:: +__divulong_rrf_s:: + jp __divulong + +__mulint_rrf_s:: + ld a,#5 + rst #0x28 + jp __mulint_rrx_s + +__divsint_rrf_s:: + ld a,#5 + rst #0x28 + jp __divsint_rrx_s + +__divuint_rrf_s:: + ld a,#5 + rst #0x28 + jp __divuint_rrx_s + +__mulschar_rrf_s:: + ld a,#5 + rst #0x28 + jp __mulschar_rrx_s + +__divschar_rrf_s:: + ld a,#5 + rst #0x28 + jp __divschar_rrx_s + +__modschar_rrf_s:: + ld a,#5 + rst #0x28 + jp __modschar_rrx_s + +__muluchar_rrf_s:: + ld a,#5 + rst #0x28 + jp __muluchar_rrx_s + +__divuchar_rrf_s:: + ld a,#5 + rst #0x28 + jp __divuchar_rrx_s + +__moduchar_rrf_s:: + ld a,#5 + rst #0x28 + jp __moduchar_rrx_s + +__mulsuchar_rrf_s:: + ld a,#5 + rst #0x28 + jp __mulsuchar_rrx_s + +__divsuchar_rrf_s:: + ld a,#5 + rst #0x28 + jp __divsuchar_rrx_s + +__modsuchar_rrf_s:: + ld a,#5 + rst #0x28 + jp __modsuchar_rrx_s + +__muluschar_rrf_s:: + ld a,#5 + rst #0x28 + jp __muluschar_rrx_s + +__divuschar_rrf_s:: + ld a,#5 + rst #0x28 + jp __divuschar_rrx_s + +__moduschar_rrf_s:: + ld a,#5 + rst #0x28 + jp __moduschar_rrx_s + +__modsint_rrf_s:: + ld a,#5 + rst #0x28 + jp __modsint_rrx_s + +__moduint_rrf_s:: + ld a,#5 + rst #0x28 + jp __moduint_rrx_s + +__rrulong_rrf_s:: + ld a,#5 + rst #0x28 + jp __rrulong_rrx_s + +__rrslong_rrf_s:: + ld a,#5 + rst #0x28 + jp __rrslong_rrx_s + +__rlulong_rrf_s:: + ld a,#5 + rst #0x28 + jp __rlulong_rrx_s + +__rlslong_rrf_s:: + ld a,#5 + rst #0x28 + jp __rlslong_rrx_s + diff -Nru sdcc-3.1.0+dfsg/device/lib/rand.c sdcc-3.2.0+dfsg/device/lib/rand.c --- sdcc-3.1.0+dfsg/device/lib/rand.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/rand.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/s08/Makefile.in sdcc-3.2.0+dfsg/device/lib/s08/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/s08/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/s08/Makefile.in 2012-05-18 16:23:38.000000000 +0000 @@ -0,0 +1,88 @@ +# libc/s08 Makefile + +VPATH = @srcdir@ +srcdir = @srcdir@ +top_builddir = @top_builddir@ + +LIB_TYPE = @LIB_TYPE@ + +SCC = $(top_builddir)/bin/sdcc -ms08 +SAS = $(top_builddir)/bin/sdas6808 + +# override PORTDIR defined by super (parent) makefile +override PORTDIR = ../build/s08 + +include $(srcdir)/../incl.mk + +HC08_FLOAT = $(COMMON_FLOAT) + +HC08_INT = $(COMMON_INT) \ + _divsint.c \ + _modsint.c \ + _moduint.c + +HC08_LONG = $(COMMON_LONG) + +HC08_LONGLONG = $(COMMON_LONGLONG) \ + _rrulonglong.c \ + _rrslonglong.c \ + _rlulonglong.c \ + _rlslonglong.c \ + _mullonglong.c \ + _divslonglong.c \ + _divulonglong.c + +HC08_SDCC = $(COMMON_SDCC) \ + _itoa.c \ + _ltoa.c \ + _spx.c \ + _startup.c \ + _strlen.c \ + _memmove.c \ + _heap.c \ + sprintf.c \ + vprintf.c + +HC08SOURCES = $(addprefix ../,$(HC08_FLOAT) $(HC08_INT) $(HC08_LONG) $(HC08_LONGLONG) $(HC08_SDCC)) +HC08OBJECTS = $(patsubst %.c,%.rel,$(HC08_FLOAT) $(HC08_INT) $(HC08_LONG) $(HC08_LONGLONG) $(HC08_SDCC)) + +OBJ = _ret.rel _divuint.rel _divulong.rel _mulint.rel _mullong.rel + +LIB = s08.lib +CC = $(SCC) +AS = $(SAS) +ASFLAGS = -plosgff + +CFLAGS = -I$(srcdir)/../../include -I. --std-c99 + +all: $(PORTDIR)/$(LIB) + +$(PORTDIR)/$(LIB): $(OBJ) $(HC08OBJECTS) Makefile +ifeq ($(LIB_TYPE), SDCCLIB) + rm -f $@; \ + $(top_builddir)/bin/sdcclib -a $@ $(OBJ) $(HC08OBJECTS) +else + ifeq ($(LIB_TYPE), AR) + $(top_builddir)/bin/sdar -rcS $@ $(OBJ) $(HC08OBJECTS) + else + ifeq ($(LIB_TYPE), RANLIB) + $(top_builddir)/bin/sdar -rc $@ $(OBJ) $(HC08OBJECTS) + else + rm -f $@ + for i in $(basename $(OBJ) $(HC08OBJECTS)); do echo $$i >>$@; done + cp $(OBJ) $(HC08OBJECTS) $(PORTDIR) + endif + endif +endif + +%.rel: %.c + $(CC) $(CFLAGS) -c $< + +%.rel: ../%.c + $(CC) $(CFLAGS) -c $< + +clean: + rm -f *.rel *.sym *.lst *~ $(CLEANSPEC) *.dump* *.asm *.lib + +distclean: clean + rm -f Makefile diff -Nru sdcc-3.1.0+dfsg/device/lib/s08/_divuint.c sdcc-3.2.0+dfsg/device/lib/s08/_divuint.c --- sdcc-3.1.0+dfsg/device/lib/s08/_divuint.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/s08/_divuint.c 2012-05-18 16:09:24.000000000 +0000 @@ -0,0 +1,179 @@ +/*------------------------------------------------------------------------- + _divuint.c - routine for unsigned int (16 bit) division + + Copyright (C) 1999, Jean-Louis Vern + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* Assembler-functions are provided for: + mcs51 small + mcs51 small stack-auto +*/ + +#if !defined(SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) +# if defined(SDCC_mcs51) +# if defined(SDCC_MODEL_SMALL) +# if defined(SDCC_STACK_AUTO) +# define _DIVUINT_ASM_SMALL_AUTO +# else +# define _DIVUINT_ASM_SMALL +# endif +# endif +# endif +#endif + +#if defined _DIVUINT_ASM_SMALL || defined _DIVUINT_ASM_SMALL_AUTO + +static void +_divuint_dummy (void) _naked +{ + __asm + + .globl __divuint + + __divuint: + + #define count r2 + #define reste_l r3 + #define reste_h r4 + #define al dpl + #define ah dph + +#if defined(SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) + + ar0 = 0 ; BUG register set is not considered + ar1 = 1 + + .globl __divint + + mov a,sp + add a,#-2 ; 2 bytes return address + mov r0,a ; r0 points to bh + mov ar1,@r0 ; load bh + dec r0 + mov ar0,@r0 ; load bl + + #define bl r0 + #define bh r1 + + __divint: ; entry point for __divsint + + +#else // SDCC_STACK_AUTO + +#if !defined(SDCC_PARMS_IN_BANK1) +#if defined(SDCC_NOOVERLAY) + .area DSEG (DATA) +#else + .area OSEG (OVR,DATA) +#endif + + .globl __divuint_PARM_2 + .globl __divsint_PARM_2 + + __divuint_PARM_2: + __divsint_PARM_2: + .ds 2 + + .area CSEG (CODE) +#endif // !SDCC_PARMS_IN_BANK1 +#if defined(SDCC_PARMS_IN_BANK1) + #define bl (b1_0) + #define bh (b1_1) +#else + #define bl (__divuint_PARM_2) + #define bh (__divuint_PARM_2 + 1) +#endif // SDCC_PARMS_IN_BANK1 +#endif // SDCC_STACK_AUTO + + mov count,#16 + clr a + mov reste_l,a + mov reste_h,a + + loop: mov a,al ; a <<= 1 + add a,acc + mov al,a + mov a,ah + rlc a + mov ah,a + + mov a,reste_l ; reste <<= 1 + rlc a ; feed in carry + mov reste_l,a + mov a,reste_h + rlc a + mov reste_h,a + + mov a,reste_l ; reste - b + subb a,bl ; here carry is always clear, because + ; reste <<= 1 never overflows + mov b,a + mov a,reste_h + subb a,bh + + jc smaller ; reste >= b? + + mov reste_h,a ; -> yes; reste = reste - b; + mov reste_l,b + orl al,#1 + smaller: ; -> no + djnz count,loop + ret + + __endasm ; +} + +#else // defined _DIVUINT_ASM_SMALL || defined _DIVUINT_ASM_SMALL_AUTO + +#define MSB_SET(x) ((x >> (8*sizeof(x)-1)) & 1) + +unsigned int +_divuint (unsigned int a, unsigned int b) +{ + unsigned int reste = 0; + unsigned char count = 16; + char c; + + do + { + // reste: a <- 0; + c = MSB_SET(a); + a <<= 1; + reste <<= 1; + if (c) + reste |= 1; + + if (reste >= b) + { + reste -= b; + // a <- (result = 1) + a |= 1; + } + } + while (--count); + return a; +} + +#endif // defined _DIVUINT_ASM_SMALL || defined _DIVUINT_ASM_SMALL_AUTO diff -Nru sdcc-3.1.0+dfsg/device/lib/s08/_divulong.c sdcc-3.2.0+dfsg/device/lib/s08/_divulong.c --- sdcc-3.1.0+dfsg/device/lib/s08/_divulong.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/s08/_divulong.c 2012-05-18 16:09:24.000000000 +0000 @@ -0,0 +1,357 @@ +/*------------------------------------------------------------------------- + _divulong.c - routine for division of 32 bit unsigned long + + Copyright (C) 1999, Jean-Louis Vern + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* Assembler-functions are provided for: + mcs51 small + mcs51 small stack-auto +*/ + +#if !defined(SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS) +# if defined(SDCC_mcs51) +# if defined(SDCC_MODEL_SMALL) +# if defined(SDCC_STACK_AUTO) && !defined(SDCC_PARMS_IN_BANK1) +# define _DIVULONG_ASM_SMALL_AUTO +# else +# define _DIVULONG_ASM_SMALL +# endif +# endif +# endif +#endif + +#if defined _DIVULONG_ASM_SMALL + +static void +_divlong_dummy (void) _naked +{ + __asm + + .globl __divulong + + __divulong: + + #define count r2 + + #define a0 dpl + #define a1 dph + #define a2 b + #define a3 r3 + + #define reste0 r4 + #define reste1 r5 + #define reste2 r6 + #define reste3 r7 +#if !defined(SDCC_PARMS_IN_BANK1) + +#if defined(SDCC_NOOVERLAY) + .area DSEG (DATA) +#else + .area OSEG (OVR,DATA) +#endif + + .globl __divulong_PARM_2 + .globl __divslong_PARM_2 + + __divulong_PARM_2: + __divslong_PARM_2: + .ds 4 + + .area CSEG (CODE) + + #define b0 (__divulong_PARM_2) + #define b1 (__divulong_PARM_2 + 1) + #define b2 (__divulong_PARM_2 + 2) + #define b3 (__divulong_PARM_2 + 3) +#else + #define b0 (b1_0) + #define b1 (b1_1) + #define b2 (b1_2) + #define b3 (b1_3) +#endif // !SDCC_PARMS_IN_BANK1 + ; parameter a comes in a, b, dph, dpl + mov a3,a ; save parameter a3 + + mov count,#32 + clr a + mov reste0,a + mov reste1,a + mov reste2,a + mov reste3,a + + ; optimization loop in lp0 until the first bit is shifted into rest + + lp0: mov a,a0 ; a <<= 1 + add a,a0 + mov a0,a + mov a,a1 + rlc a + mov a1,a + mov a,a2 + rlc a + mov a2,a + mov a,a3 + rlc a + mov a3,a + + jc in_lp + djnz count,lp0 + + sjmp exit + + loop: mov a,a0 ; a <<= 1 + add a,a0 + mov a0,a + mov a,a1 + rlc a + mov a1,a + mov a,a2 + rlc a + mov a2,a + mov a,a3 + rlc a + mov a3,a + + in_lp: mov a,reste0 ; reste <<= 1 + rlc a ; feed in carry + mov reste0,a + mov a,reste1 + rlc a + mov reste1,a + mov a,reste2 + rlc a + mov reste2,a + mov a,reste3 + rlc a + mov reste3,a + + mov a,reste0 ; reste - b + subb a,b0 ; carry is always clear here, because + ; reste <<= 1 never overflows + mov a,reste1 + subb a,b1 + mov a,reste2 + subb a,b2 + mov a,reste3 + subb a,b3 + + jc minus ; reste >= b? + + ; -> yes; reste -= b; + mov a,reste0 + subb a,b0 ; carry is always clear here (jc) + mov reste0,a + mov a,reste1 + subb a,b1 + mov reste1,a + mov a,reste2 + subb a,b2 + mov reste2,a + mov a,reste3 + subb a,b3 + mov reste3,a + + orl a0,#1 + + minus: djnz count,loop ; -> no + + exit: mov a,a3 ; prepare the return value + ret + + __endasm ; +} + +#elif defined _DIVULONG_ASM_SMALL_AUTO + +static void +_divlong_dummy (void) _naked +{ + __asm + + .globl __divulong + + __divulong: + + #define count r2 + + #define a0 dpl + #define a1 dph + #define a2 b + #define a3 r3 + + #define reste0 r4 + #define reste1 r5 + #define reste2 r6 + #define reste3 r7 + + .globl __divlong ; entry point for __divslong + + #define b0 r1 + + ar0 = 0 ; BUG register set is not considered + ar1 = 1 + + ; parameter a comes in a, b, dph, dpl + mov a3,a ; save parameter a3 + + mov a,sp + add a,#-2-3 ; 2 bytes return address, 3 bytes param b + mov r0,a ; r0 points to b0 + + __divlong: ; entry point for __divslong + + mov ar1,@r0 ; load b0 + inc r0 ; r0 points to b1 + + mov count,#32 + clr a + mov reste0,a + mov reste1,a + mov reste2,a + mov reste3,a + + ; optimization loop in lp0 until the first bit is shifted into rest + + lp0: mov a,a0 ; a <<= 1 + add a,a0 + mov a0,a + mov a,a1 + rlc a + mov a1,a + mov a,a2 + rlc a + mov a2,a + mov a,a3 + rlc a + mov a3,a + + jc in_lp + djnz count,lp0 + + sjmp exit + + loop: mov a,a0 ; a <<= 1 + add a,a0 + mov a0,a + mov a,a1 + rlc a + mov a1,a + mov a,a2 + rlc a + mov a2,a + mov a,a3 + rlc a + mov a3,a + + in_lp: mov a,reste0 ; reste <<= 1 + rlc a ; feed in carry + mov reste0,a + mov a,reste1 + rlc a + mov reste1,a + mov a,reste2 + rlc a + mov reste2,a + mov a,reste3 + rlc a + mov reste3,a + + mov a,reste0 ; reste - b + subb a,b0 ; carry is always clear here, because + ; reste <<= 1 never overflows + mov a,reste1 + subb a,@r0 ; b1 + mov a,reste2 + inc r0 + subb a,@r0 ; b2 + mov a,reste3 + inc r0 + subb a,@r0 ; b3 + dec r0 + dec r0 + + jc minus ; reste >= b? + + ; -> yes; reste -= b; + mov a,reste0 + subb a,b0 ; carry is always clear here (jc) + mov reste0,a + mov a,reste1 + subb a,@r0 ; b1 + mov reste1,a + mov a,reste2 + inc r0 + subb a,@r0 ; b2 + mov reste2,a + mov a,reste3 + inc r0 + subb a,@r0 ; b3 + mov reste3,a + dec r0 + dec r0 + + orl a0,#1 + + minus: djnz count,loop ; -> no + + exit: mov a,a3 ; prepare the return value + ret + + __endasm ; +} + +#else // _DIVULONG_ASM + +#define MSB_SET(x) ((x >> (8*sizeof(x)-1)) & 1) + +unsigned long +_divulong (unsigned long a, unsigned long b) +{ + unsigned long reste = 0L; + unsigned char count = 32; + char c; + + do + { + // reste: a <- 0; + c = MSB_SET(a); + a <<= 1; + reste <<= 1; + if (c) + reste |= 1L; + + if (reste >= b) + { + reste -= b; + // a <- (result = 1) + a |= 1L; + } + } + while (--count); + return a; +} + +#endif // _DIVULONG_ASM diff -Nru sdcc-3.1.0+dfsg/device/lib/s08/_mulint.c sdcc-3.2.0+dfsg/device/lib/s08/_mulint.c --- sdcc-3.1.0+dfsg/device/lib/s08/_mulint.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/s08/_mulint.c 2012-05-18 16:09:24.000000000 +0000 @@ -0,0 +1,138 @@ +/*------------------------------------------------------------------------- + _mulint.c - routine for (unsigned) int (16 bit) multiplication + + Copyright (C) 1999, Sandeep Dutta . sandeep.dutta@usa.net + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* Signed and unsigned multiplication are the same - as long as the output + has the same precision as the input. + + Assembler-functions are provided for: + hc08 + hc08 stack-auto +*/ + + +#if !defined(_SDCC_NO_ASM_LIB_FUNCS) + +#pragma save +#pragma less_pedantic +int +_mulint (int a, int b) +{ + a,b; /* reference to make compiler happy */ + +#if !defined(__SDCC_STACK_AUTO) + __asm + ais #-2 + psha + pshx + + ldx __mulint_PARM_2+1 + mul + sta 4,s + stx 3,s + + lda 1,s + ldx __mulint_PARM_2+1 + mul + add 3,s + sta 3,s + + lda 2,s + ldx __mulint_PARM_2 + mul + add 3,s + sta 3,s + + ais #2 + pulx + pula + __endasm; +#else + __asm + ais #-2 + psha + pshx + + ldx 8,s + mul + sta 4,s + stx 3,s + + lda 1,s + ldx 8,s + mul + add 3,s + sta 3,s + + lda 2,s + ldx 7,s + mul + add 3,s + sta 3,s + + ais #2 + pulx + pula + __endasm; +#endif +} +#pragma restore + +#else + +union uu { + struct { unsigned char hi,lo ;} s; + unsigned int t; +} ; + +int +_mulint (int a, int b) +{ +#if !defined(__SDCC_STACK_AUTO) && (defined(__SDCC_MODEL_LARGE) || defined(__SDCC_ds390)) // still needed for large + union uu __xdata *x; + union uu __xdata *y; + union uu t; + x = (union uu __xdata *)&a; + y = (union uu __xdata *)&b; +#else + register union uu *x; + register union uu *y; + union uu t; + x = (union uu *)&a; + y = (union uu *)&b; +#endif + + t.t = x->s.lo * y->s.lo; + t.s.hi += (x->s.lo * y->s.hi) + (x->s.hi * y->s.lo); + + return t.t; +} +#endif + + +#undef _MULINT_ASM + diff -Nru sdcc-3.1.0+dfsg/device/lib/s08/_mullong.c sdcc-3.2.0+dfsg/device/lib/s08/_mullong.c --- sdcc-3.1.0+dfsg/device/lib/s08/_mullong.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/s08/_mullong.c 2012-05-18 16:09:24.000000000 +0000 @@ -0,0 +1,99 @@ +/*------------------------------------------------------------------------- + _mullong.c - routine for multiplication of 32 bit (unsigned) long + + Copyright (C) 1999, Jean-Louis Vern + Copyright (C) 1999, Sandeep Dutta + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +/* Signed and unsigned multiplication are the same - as long as the output + has the same precision as the input. + + Assembler-functions are provided for: + mcs51 small + mcs51 small stack-auto +*/ + + +struct some_struct { + short a ; + char b; + long c ;}; +union bil { + struct {unsigned char b3,b2,b1,b0 ;} b; + struct {unsigned short hi,lo ;} i; + unsigned long l; + struct { unsigned char b3; unsigned short i12; unsigned char b0;} bi; +} ; + +# define bcast(x) ((union bil *)&(x)) + +/* + 3 2 1 0 + X 3 2 1 0 + ---------------------------- + 0.3 0.2 0.1 0.0 + 1.3 1.2 1.1 1.0 + 2.3 2.2 2.1 2.0 + 3.3 3.2 3.1 3.0 + ---------------------------- + |3.3|1.3|0.2|0.0| A + |2.3|0.3|0.1| B + |3.2|1.2|1.0| C + |2.2|1.1| D + |3.1|2.0| E + |2.1| F + |3.0| G + |-------> only this side 32 x 32 -> 32 +*/ +long +_mullong (long a, long b) +{ + union bil t; + + t.i.hi = bcast(a)->b.b0 * bcast(b)->b.b2; // A + t.i.lo = bcast(a)->b.b0 * bcast(b)->b.b0; // A + t.b.b3 += bcast(a)->b.b3 * + bcast(b)->b.b0; // G + t.b.b3 += bcast(a)->b.b2 * + bcast(b)->b.b1; // F + t.i.hi += bcast(a)->b.b2 * bcast(b)->b.b0; // E <- b lost in .lst + // bcast(a)->i.hi is free ! + t.i.hi += bcast(a)->b.b1 * bcast(b)->b.b1; // D <- b lost in .lst + + bcast(a)->bi.b3 = bcast(a)->b.b1 * + bcast(b)->b.b2; + bcast(a)->bi.i12 = bcast(a)->b.b1 * + bcast(b)->b.b0; // C + + bcast(b)->bi.b3 = bcast(a)->b.b0 * + bcast(b)->b.b3; + bcast(b)->bi.i12 = bcast(a)->b.b0 * + bcast(b)->b.b1; // B + bcast(b)->bi.b0 = 0; // B + bcast(a)->bi.b0 = 0; // C + t.l += a; + + return t.l + b; +} diff -Nru sdcc-3.1.0+dfsg/device/lib/s08/_ret.c sdcc-3.2.0+dfsg/device/lib/s08/_ret.c --- sdcc-3.1.0+dfsg/device/lib/s08/_ret.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/s08/_ret.c 2012-05-18 16:09:24.000000000 +0000 @@ -0,0 +1,37 @@ +/*------------------------------------------------------------------------- + _ret.c + + Copyright (C) 2003, Erik Petrich + Copyright (C) 2012, Philipp Klaus Krause + Considering how short this file is, it is probably not copyrightable, though. + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This library 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 library; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + + As a special exception, if you link this library with other files, + some of which are compiled with SDCC, to produce an executable, + this library does not by itself cause the resulting executable to + be covered by the GNU General Public License. This exception does + not however invalidate any other reasons why the executable file + might be covered by the GNU General Public License. +-------------------------------------------------------------------------*/ + +__data unsigned char __SDCC_hc08_ret2; +__data unsigned char __SDCC_hc08_ret3; +__data unsigned char __SDCC_hc08_ret4; +__data unsigned char __SDCC_hc08_ret5; +__data unsigned char __SDCC_hc08_ret6; +__data unsigned char __SDCC_hc08_ret7; + diff -Nru sdcc-3.1.0+dfsg/device/lib/ser_ir.c sdcc-3.2.0+dfsg/device/lib/ser_ir.c --- sdcc-3.1.0+dfsg/device/lib/ser_ir.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/ser_ir.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/ser_ir_cts_rts.c sdcc-3.2.0+dfsg/device/lib/ser_ir_cts_rts.c --- sdcc-3.1.0+dfsg/device/lib/ser_ir_cts_rts.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/ser_ir_cts_rts.c 2012-03-13 10:17:10.000000000 +0000 @@ -9,7 +9,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/serial.c sdcc-3.2.0+dfsg/device/lib/serial.c --- sdcc-3.1.0+dfsg/device/lib/serial.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/serial.c 2012-03-13 10:17:10.000000000 +0000 @@ -7,7 +7,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/sincosf.c sdcc-3.2.0+dfsg/device/lib/sincosf.c --- sdcc-3.1.0+dfsg/device/lib/sincosf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/sincosf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -13,7 +13,7 @@ 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 + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -35,10 +35,6 @@ #include #include -#ifndef BOOL -#define BOOL _Bool -#endif - #define r1 -0.1666665668E+0 #define r2 0.8333025139E-2 #define r3 -0.1980741872E-3 @@ -51,11 +47,11 @@ /*A reasonable value for YMAX is the int part of PI*B**(t/2)=3.1416*2**(12)*/ #define YMAX 12867.0 -float sincosf(const float x, const BOOL iscos) +float sincosf(const float x, const bool iscos) { float y, f, r, g, XN; int N; - BOOL sign; + bool sign; if(iscos) { diff -Nru sdcc-3.1.0+dfsg/device/lib/sincoshf.c sdcc-3.2.0+dfsg/device/lib/sincoshf.c --- sdcc-3.1.0+dfsg/device/lib/sincoshf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/sincoshf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -13,7 +13,7 @@ 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 + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -35,10 +35,6 @@ #include #include -#ifndef BOOL -#define BOOL _Bool -#endif - #define P0 -0.713793159E+1 #define P1 -0.190333999E+0 #define Q0 -0.428277109E+2 @@ -60,7 +56,7 @@ float sincoshf(const float x, const int iscosh) { float y, w, z; - BOOL sign; + bool sign; if (x<0.0) { y=-x; sign=1; } else { y=x; sign=0; } diff -Nru sdcc-3.1.0+dfsg/device/lib/sinf.c sdcc-3.2.0+dfsg/device/lib/sinf.c --- sdcc-3.1.0+dfsg/device/lib/sinf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/sinf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -13,7 +13,7 @@ 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 + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -31,11 +31,7 @@ #include #include -#ifndef BOOL -#define BOOL _Bool -#endif - -float sincosf(const float x, const BOOL iscos); +float sincosf(const float x, const bool iscos); float sinf(const float x) _FLOAT_FUNC_REENTRANT { diff -Nru sdcc-3.1.0+dfsg/device/lib/sinhf.c sdcc-3.2.0+dfsg/device/lib/sinhf.c --- sdcc-3.1.0+dfsg/device/lib/sinhf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/sinhf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/small/Makefile.in sdcc-3.2.0+dfsg/device/lib/small/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/small/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/small/Makefile.in 2012-02-10 10:16:50.000000000 +0000 @@ -1,3 +1,5 @@ +# libc/small Makefile + all: $(MAKE) -C ../mcs51 all cp ../mcs51/*.rel . @@ -7,4 +9,4 @@ rm -f *.rel *.sym *.lst *.asm *~ *.lib distclean: clean - rm -f Makefile \ No newline at end of file + rm -f Makefile diff -Nru sdcc-3.1.0+dfsg/device/lib/sprintf.c sdcc-3.2.0+dfsg/device/lib/sprintf.c --- sdcc-3.1.0+dfsg/device/lib/sprintf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/sprintf.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/sqrtf.c sdcc-3.2.0+dfsg/device/lib/sqrtf.c --- sdcc-3.1.0+dfsg/device/lib/sqrtf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/sqrtf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/strxfrm.c sdcc-3.2.0+dfsg/device/lib/strxfrm.c --- sdcc-3.1.0+dfsg/device/lib/strxfrm.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/strxfrm.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/tancotf.c sdcc-3.2.0+dfsg/device/lib/tancotf.c --- sdcc-3.1.0+dfsg/device/lib/tancotf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/tancotf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -13,7 +13,7 @@ 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 + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -35,10 +35,6 @@ #include #include -#ifndef BOOL -#define BOOL _Bool -#endif - #define P0 0.100000000E+1 #define P1 -0.958017723E-1 #define Q0 0.100000000E+1 @@ -54,7 +50,7 @@ //A reasonable choice for YMAX is the integer part of B**(t/2)*PI/2: #define YMAX 6433.0 -float tancotf(const float x, const BOOL iscotan) +float tancotf(const float x, const bool iscotan) { float f, g, xn, xnum, xden; int n; diff -Nru sdcc-3.1.0+dfsg/device/lib/tanf.c sdcc-3.2.0+dfsg/device/lib/tanf.c --- sdcc-3.1.0+dfsg/device/lib/tanf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/tanf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, @@ -13,7 +13,7 @@ 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 + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -31,11 +31,7 @@ #include #include -#ifndef BOOL -#define BOOL _Bool -#endif - -float tancotf(const float x, const BOOL iscotan); +float tancotf(const float x, const bool iscotan); float tanf(const float x) _FLOAT_FUNC_REENTRANT { diff -Nru sdcc-3.1.0+dfsg/device/lib/tanhf.c sdcc-3.2.0+dfsg/device/lib/tanhf.c --- sdcc-3.1.0+dfsg/device/lib/tanhf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/tanhf.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/time.c sdcc-3.2.0+dfsg/device/lib/time.c --- sdcc-3.1.0+dfsg/device/lib/time.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/time.c 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/vprintf.c sdcc-3.2.0+dfsg/device/lib/vprintf.c --- sdcc-3.1.0+dfsg/device/lib/vprintf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/vprintf.c 2012-03-13 10:17:10.000000000 +0000 @@ -6,7 +6,7 @@ This library 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.1, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/Makefile sdcc-3.2.0+dfsg/device/lib/z180/Makefile --- sdcc-3.1.0+dfsg/device/lib/z180/Makefile 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -# libc/z80 Makefile - - -srcdir = . -top_builddir = ../../.. - -AR_S = ar -S - -LIB_TYPE = RANLIB - -TOPDIR = ../../.. - -SCC = $(TOPDIR)/bin/sdcc -mz180 -SAS = $(TOPDIR)/bin/sdasz80 - -# override PORTDIR defined by super (parent) makefile -override PORTDIR = ../build/z180 - -include $(srcdir)/../incl.mk - -Z80_FLOAT = $(COMMON_FLOAT) - -Z80_INT = $(COMMON_INT) - -Z80_LONG = $(COMMON_LONG) \ - _divulong.c \ - _mullong.c - -Z80_SDCC = $(COMMON_SDCC) \ - _itoa.c \ - _ltoa.c \ - _startup.c \ - sprintf.c \ - vprintf.c - -Z80SOURCES = $(addprefix ../,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_SDCC)) -Z8OBJECTS = $(patsubst %.c,%.rel,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_SDCC)) - -OBJ = divunsigned.rel divsigned.rel divmixed.rel modunsigned.rel modsigned.rel modmixed.rel mul.rel mulchar.rel \ - putchar.rel shift.rel stubs.rel crt0_rle.rel heap.rel fstubs.rel memmove.rel strlen.rel abs.rel crtcall.rel \ - setjmp.rel - -LIB = z180.lib -CC = $(SCC) -AS = $(SAS) -ASFLAGS = -plosgff - -CFLAGS = -I$(srcdir)/../../include -I. --std-c99 - -all: $(PORTDIR)/$(LIB) $(PORTDIR)/crt0.rel - -$(PORTDIR)/crt0.rel: crt0.rel - cp crt0.rel $(PORTDIR)/crt0.rel - -$(PORTDIR)/$(LIB): $(OBJ) $(Z8OBJECTS) Makefile -ifeq ($(LIB_TYPE), SDCCLIB) - rm -f $@; \ - ../../../bin/sdcclib -a $@ $(OBJ) $(Z8OBJECTS) -else - ifeq ($(LIB_TYPE), AR) - $(AR_S) -cq $@ $(OBJ) $(Z8OBJECTS) - else - ifeq ($(LIB_TYPE), RANLIB) - $(AR_S) -cq $@ $(OBJ) $(Z8OBJECTS) - $(top_builddir)/bin/sdranlib $@ - else - rm -f $@; \ - for i in $(basename $(OBJ) $(Z8OBJECTS)); do echo $$i >>$@; done - cp $(OBJ) $(Z8OBJECTS) $(PORTDIR) - endif - endif -endif - -%.rel: %.c - $(CC) $(CFLAGS) -c $< - -%.rel: %.s - @# TODO: sdas should place it\'s output in the current dir - test $(srcdir) = . || cp $< . - -$(AS) $(ASFLAGS) $(notdir $<) - test $(srcdir) = . || rm $(notdir $<) - -%.rel: ../%.c - $(CC) $(CFLAGS) -c $< - -clean: - rm -f *.rel *.sym *.lst *~ $(CLEANSPEC) *.dump* *.asm *.lib - -distclean: clean - rm -f Makefile diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/Makefile.in sdcc-3.2.0+dfsg/device/lib/z180/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/z180/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/Makefile.in 2012-04-02 09:59:13.000000000 +0000 @@ -1,17 +1,13 @@ -# libc/z80 Makefile +# libc/z180 Makefile VPATH = @srcdir@ srcdir = @srcdir@ top_builddir = @top_builddir@ -AR_S = @AR@ @AR_S_FLAG@ +LIB_TYPE = @LIB_TYPE@ -LIB_TYPE = @LIB_TYPE@ - -TOPDIR = ../../.. - -SCC = $(TOPDIR)/bin/sdcc -mz180 -SAS = $(TOPDIR)/bin/sdasz80 +SCC = $(top_builddir)/bin/sdcc -mz180 +SAS = $(top_builddir)/bin/sdasz80 # override PORTDIR defined by super (parent) makefile override PORTDIR = ../build/z180 @@ -26,6 +22,15 @@ _divulong.c \ _mullong.c +Z80_LONGLONG = $(COMMON_LONGLONG) \ + _rrulonglong.c \ + _rrslonglong.c \ + _rlulonglong.c \ + _rlslonglong.c \ + _mullonglong.c \ + _divslonglong.c \ + _divulonglong.c + Z80_SDCC = $(COMMON_SDCC) \ _itoa.c \ _ltoa.c \ @@ -33,8 +38,8 @@ sprintf.c \ vprintf.c -Z80SOURCES = $(addprefix ../,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_SDCC)) -Z8OBJECTS = $(patsubst %.c,%.rel,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_SDCC)) +Z80SOURCES = $(addprefix ../,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_LONGLONG) $(Z80_SDCC)) +Z8OBJECTS = $(patsubst %.c,%.rel,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_LONGLONG) $(Z80_SDCC)) OBJ = divunsigned.rel divsigned.rel divmixed.rel modunsigned.rel modsigned.rel modmixed.rel mul.rel mulchar.rel \ putchar.rel shift.rel stubs.rel crt0_rle.rel heap.rel fstubs.rel memmove.rel strlen.rel abs.rel crtcall.rel \ @@ -55,14 +60,13 @@ $(PORTDIR)/$(LIB): $(OBJ) $(Z8OBJECTS) Makefile ifeq ($(LIB_TYPE), SDCCLIB) rm -f $@; \ - ../../../bin/sdcclib -a $@ $(OBJ) $(Z8OBJECTS) + $(top_builddir)/bin/sdcclib -a $@ $(OBJ) $(Z8OBJECTS) else ifeq ($(LIB_TYPE), AR) - $(AR_S) -cq $@ $(OBJ) $(Z8OBJECTS) + $(top_builddir)/bin/sdar -rcS $@ $(OBJ) $(Z8OBJECTS) else ifeq ($(LIB_TYPE), RANLIB) - $(AR_S) -cq $@ $(OBJ) $(Z8OBJECTS) - $(top_builddir)/bin/sdranlib $@ + $(top_builddir)/bin/sdar -rc $@ $(OBJ) $(Z8OBJECTS) else rm -f $@; \ for i in $(basename $(OBJ) $(Z8OBJECTS)); do echo $$i >>$@; done diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/abs.s sdcc-3.2.0+dfsg/device/lib/z180/abs.s --- sdcc-3.1.0+dfsg/device/lib/z180/abs.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/abs.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/crt0.s sdcc-3.2.0+dfsg/device/lib/z180/crt0.s --- sdcc-3.1.0+dfsg/device/lib/z180/crt0.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/crt0.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/crt0_rle.s sdcc-3.2.0+dfsg/device/lib/z180/crt0_rle.s --- sdcc-3.1.0+dfsg/device/lib/z180/crt0_rle.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/crt0_rle.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/crtcall.s sdcc-3.2.0+dfsg/device/lib/z180/crtcall.s --- sdcc-3.1.0+dfsg/device/lib/z180/crtcall.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/crtcall.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/divmixed.s sdcc-3.2.0+dfsg/device/lib/z180/divmixed.s --- sdcc-3.1.0+dfsg/device/lib/z180/divmixed.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/divmixed.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/divsigned.s sdcc-3.2.0+dfsg/device/lib/z180/divsigned.s --- sdcc-3.1.0+dfsg/device/lib/z180/divsigned.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/divsigned.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/divunsigned.s sdcc-3.2.0+dfsg/device/lib/z180/divunsigned.s --- sdcc-3.1.0+dfsg/device/lib/z180/divunsigned.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/divunsigned.s 2012-03-13 10:17:10.000000000 +0000 @@ -1,11 +1,11 @@ ;-------------------------------------------------------------------------- ; divunsigned.s ; -; Copyright (C) 2000-2010, Michael Hope, Philipp Klaus Krause, Marco Bodrato +; Copyright (C) 2000-2012, Michael Hope, Philipp Klaus Krause, Marco Bodrato ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, @@ -64,19 +64,16 @@ ;; Exit conditions ;; HL = quotient ;; DE = remainder - ;; If divisor is non-zero, carry=0 - ;; If divisor is 0, carry=1 and both quotient and remainder are 0 + ;; carry = 0 + ;; If divisor is 0, quotient is set to "infinity", i.e HL = 0xFFFF. ;; ;; Register used: AF,B,DE,HL __divuint_rrx_hds:: __divu16:: - ;; Check for division by zero - ld a,e - or d ;; Two algorithms: one assumes divisor <2^7, the second ;; assumes divisor >=2^7; choose the applicable one. - and #0x80 - jr NZ,.morethan7bits + ld a,e + and a,#0x80 or d jr NZ,.morethan7bits ;; Both algorithms "rotate" 24 bits (H,L,A) but roles change. diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/fstubs.s sdcc-3.2.0+dfsg/device/lib/z180/fstubs.s --- sdcc-3.1.0+dfsg/device/lib/z180/fstubs.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/fstubs.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/heap.s sdcc-3.2.0+dfsg/device/lib/z180/heap.s --- sdcc-3.1.0+dfsg/device/lib/z180/heap.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/heap.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/memmove.s sdcc-3.2.0+dfsg/device/lib/z180/memmove.s --- sdcc-3.1.0+dfsg/device/lib/z180/memmove.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/memmove.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/modmixed.s sdcc-3.2.0+dfsg/device/lib/z180/modmixed.s --- sdcc-3.1.0+dfsg/device/lib/z180/modmixed.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/modmixed.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/modsigned.s sdcc-3.2.0+dfsg/device/lib/z180/modsigned.s --- sdcc-3.1.0+dfsg/device/lib/z180/modsigned.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/modsigned.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/modunsigned.s sdcc-3.2.0+dfsg/device/lib/z180/modunsigned.s --- sdcc-3.1.0+dfsg/device/lib/z180/modunsigned.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/modunsigned.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/mul.s sdcc-3.2.0+dfsg/device/lib/z180/mul.s --- sdcc-3.1.0+dfsg/device/lib/z180/mul.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/mul.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/mulchar.s sdcc-3.2.0+dfsg/device/lib/z180/mulchar.s --- sdcc-3.1.0+dfsg/device/lib/z180/mulchar.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/mulchar.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/putchar.s sdcc-3.2.0+dfsg/device/lib/z180/putchar.s --- sdcc-3.1.0+dfsg/device/lib/z180/putchar.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/putchar.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/setjmp.s sdcc-3.2.0+dfsg/device/lib/z180/setjmp.s --- sdcc-3.1.0+dfsg/device/lib/z180/setjmp.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/setjmp.s 2012-03-13 10:17:10.000000000 +0000 @@ -1,11 +1,11 @@ ;-------------------------------------------------------------------------- -; abs.s +; setjmp.s ; ; Copyright (C) 2011, Philipp Klaus Krause ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, @@ -44,7 +44,6 @@ xor a, a ld l, a ld h, a - ld hl, #0 add hl, sp ld 2(iy), l ld 3(iy), h @@ -84,8 +83,7 @@ ld l, 2(iy) ld h, 3(iy) ld sp, hl - inc sp - inc sp + pop hl ; Move return value into hl. ex de, hl @@ -95,4 +93,3 @@ ld b, 1(iy) push bc ret - diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/shift.s sdcc-3.2.0+dfsg/device/lib/z180/shift.s --- sdcc-3.1.0+dfsg/device/lib/z180/shift.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/shift.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/strlen.s sdcc-3.2.0+dfsg/device/lib/z180/strlen.s --- sdcc-3.1.0+dfsg/device/lib/z180/strlen.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/strlen.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z180/stubs.s sdcc-3.2.0+dfsg/device/lib/z180/stubs.s --- sdcc-3.1.0+dfsg/device/lib/z180/stubs.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z180/stubs.s 2012-04-02 09:59:13.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, @@ -182,3 +182,5 @@ ld a,#5 rst 0x08 jp __rlslong_rrx_s + + diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/Makefile.in sdcc-3.2.0+dfsg/device/lib/z80/Makefile.in --- sdcc-3.1.0+dfsg/device/lib/z80/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/Makefile.in 2012-04-02 09:59:13.000000000 +0000 @@ -4,14 +4,10 @@ srcdir = @srcdir@ top_builddir = @top_builddir@ -AR_S = @AR@ @AR_S_FLAG@ +LIB_TYPE = @LIB_TYPE@ -LIB_TYPE = @LIB_TYPE@ - -TOPDIR = ../../.. - -SCC = $(TOPDIR)/bin/sdcc -mz80 -SAS = $(TOPDIR)/bin/sdasz80 +SCC = $(top_builddir)/bin/sdcc -mz80 +SAS = $(top_builddir)/bin/sdasz80 # override PORTDIR defined by super (parent) makefile override PORTDIR = ../build/z80 @@ -26,6 +22,15 @@ _divulong.c \ _mullong.c +Z80_LONGLONG = $(COMMON_LONGLONG) \ + _rrulonglong.c \ + _rrslonglong.c \ + _rlulonglong.c \ + _rlslonglong.c \ + _mullonglong.c \ + _divslonglong.c \ + _divulonglong.c + Z80_SDCC = $(COMMON_SDCC) \ _itoa.c \ _ltoa.c \ @@ -33,8 +38,8 @@ sprintf.c \ vprintf.c -Z80SOURCES = $(addprefix ../,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_SDCC)) -Z8OBJECTS = $(patsubst %.c,%.rel,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_SDCC)) +Z80SOURCES = $(addprefix ../,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_LONGLONG) $(Z80_SDCC)) +Z8OBJECTS = $(patsubst %.c,%.rel,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_LONGLONG) $(Z80_SDCC)) OBJ = divunsigned.rel divsigned.rel divmixed.rel modunsigned.rel modsigned.rel modmixed.rel mul.rel mulchar.rel \ putchar.rel shift.rel stubs.rel crt0_rle.rel heap.rel fstubs.rel memmove.rel strlen.rel abs.rel crtcall.rel \ @@ -55,14 +60,13 @@ $(PORTDIR)/$(LIB): $(OBJ) $(Z8OBJECTS) Makefile ifeq ($(LIB_TYPE), SDCCLIB) rm -f $@; \ - ../../../bin/sdcclib -a $@ $(OBJ) $(Z8OBJECTS) + $(top_builddir)/bin/sdcclib -a $@ $(OBJ) $(Z8OBJECTS) else ifeq ($(LIB_TYPE), AR) - $(AR_S) -cq $@ $(OBJ) $(Z8OBJECTS) + $(top_builddir)/bin/sdar -rcS $@ $(OBJ) $(Z8OBJECTS) else ifeq ($(LIB_TYPE), RANLIB) - $(AR_S) -cq $@ $(OBJ) $(Z8OBJECTS) - $(top_builddir)/bin/sdranlib $@ + $(top_builddir)/bin/sdar -rc $@ $(OBJ) $(Z8OBJECTS) else rm -f $@; \ for i in $(basename $(OBJ) $(Z8OBJECTS)); do echo $$i >>$@; done @@ -88,3 +92,4 @@ distclean: clean rm -f Makefile + diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/abs.s sdcc-3.2.0+dfsg/device/lib/z80/abs.s --- sdcc-3.1.0+dfsg/device/lib/z80/abs.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/abs.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/crt0.s sdcc-3.2.0+dfsg/device/lib/z80/crt0.s --- sdcc-3.1.0+dfsg/device/lib/z80/crt0.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/crt0.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/crt0_rle.s sdcc-3.2.0+dfsg/device/lib/z80/crt0_rle.s --- sdcc-3.1.0+dfsg/device/lib/z80/crt0_rle.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/crt0_rle.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/crtcall.s sdcc-3.2.0+dfsg/device/lib/z80/crtcall.s --- sdcc-3.1.0+dfsg/device/lib/z80/crtcall.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/crtcall.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/divmixed.s sdcc-3.2.0+dfsg/device/lib/z80/divmixed.s --- sdcc-3.1.0+dfsg/device/lib/z80/divmixed.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/divmixed.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/divsigned.s sdcc-3.2.0+dfsg/device/lib/z80/divsigned.s --- sdcc-3.1.0+dfsg/device/lib/z80/divsigned.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/divsigned.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/divunsigned.s sdcc-3.2.0+dfsg/device/lib/z80/divunsigned.s --- sdcc-3.1.0+dfsg/device/lib/z80/divunsigned.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/divunsigned.s 2012-03-13 10:17:10.000000000 +0000 @@ -1,11 +1,11 @@ ;-------------------------------------------------------------------------- ; divunsigned.s ; -; Copyright (C) 2000-2010, Michael Hope, Philipp Klaus Krause, Marco Bodrato +; Copyright (C) 2000-2012, Michael Hope, Philipp Klaus Krause, Marco Bodrato ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, @@ -64,20 +64,17 @@ ;; Exit conditions ;; HL = quotient ;; DE = remainder - ;; If divisor is non-zero, carry=0 - ;; If divisor is 0, carry=1 and both quotient and remainder are 0 + ;; carry = 0 + ;; If divisor is 0, quotient is set to "infinity", i.e HL = 0xFFFF. ;; ;; Register used: AF,B,DE,HL __divuint_rrx_hds:: __divu16:: - ;; Check for division by zero - ld a,e - or d ;; Two algorithms: one assumes divisor <2^7, the second ;; assumes divisor >=2^7; choose the applicable one. - and #0x80 - jr NZ,.morethan7bits - or d + ld a,e + and a,#0x80 + or a,d jr NZ,.morethan7bits ;; Both algorithms "rotate" 24 bits (H,L,A) but roles change. diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/fstubs.s sdcc-3.2.0+dfsg/device/lib/z80/fstubs.s --- sdcc-3.1.0+dfsg/device/lib/z80/fstubs.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/fstubs.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/heap.s sdcc-3.2.0+dfsg/device/lib/z80/heap.s --- sdcc-3.1.0+dfsg/device/lib/z80/heap.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/heap.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/memmove.s sdcc-3.2.0+dfsg/device/lib/z80/memmove.s --- sdcc-3.1.0+dfsg/device/lib/z80/memmove.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/memmove.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/modmixed.s sdcc-3.2.0+dfsg/device/lib/z80/modmixed.s --- sdcc-3.1.0+dfsg/device/lib/z80/modmixed.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/modmixed.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/modsigned.s sdcc-3.2.0+dfsg/device/lib/z80/modsigned.s --- sdcc-3.1.0+dfsg/device/lib/z80/modsigned.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/modsigned.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/modunsigned.s sdcc-3.2.0+dfsg/device/lib/z80/modunsigned.s --- sdcc-3.1.0+dfsg/device/lib/z80/modunsigned.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/modunsigned.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/mul.s sdcc-3.2.0+dfsg/device/lib/z80/mul.s --- sdcc-3.1.0+dfsg/device/lib/z80/mul.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/mul.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/mulchar.s sdcc-3.2.0+dfsg/device/lib/z80/mulchar.s --- sdcc-3.1.0+dfsg/device/lib/z80/mulchar.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/mulchar.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/putchar.s sdcc-3.2.0+dfsg/device/lib/z80/putchar.s --- sdcc-3.1.0+dfsg/device/lib/z80/putchar.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/putchar.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/setjmp.s sdcc-3.2.0+dfsg/device/lib/z80/setjmp.s --- sdcc-3.1.0+dfsg/device/lib/z80/setjmp.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/setjmp.s 2012-03-13 10:17:10.000000000 +0000 @@ -1,11 +1,11 @@ ;-------------------------------------------------------------------------- -; abs.s +; setjmp.s ; ; Copyright (C) 2011, Philipp Klaus Krause ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, @@ -44,7 +44,6 @@ xor a, a ld l, a ld h, a - ld hl, #0 add hl, sp ld 2(iy), l ld 3(iy), h @@ -84,8 +83,7 @@ ld l, 2(iy) ld h, 3(iy) ld sp, hl - inc sp - inc sp + pop hl ; Move return value into hl. ex de, hl @@ -95,4 +93,3 @@ ld b, 1(iy) push bc ret - diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/shift.s sdcc-3.2.0+dfsg/device/lib/z80/shift.s --- sdcc-3.1.0+dfsg/device/lib/z80/shift.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/shift.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/strlen.s sdcc-3.2.0+dfsg/device/lib/z80/strlen.s --- sdcc-3.1.0+dfsg/device/lib/z80/strlen.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/strlen.s 2012-03-13 10:17:10.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, diff -Nru sdcc-3.1.0+dfsg/device/lib/z80/stubs.s sdcc-3.2.0+dfsg/device/lib/z80/stubs.s --- sdcc-3.1.0+dfsg/device/lib/z80/stubs.s 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/device/lib/z80/stubs.s 2012-04-02 09:59:13.000000000 +0000 @@ -5,7 +5,7 @@ ; ; This library 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.1, or (at your option) any +; Free Software Foundation; either version 2, or (at your option) any ; later version. ; ; This library is distributed in the hope that it will be useful, @@ -182,3 +182,5 @@ ld a,#5 rst 0x08 jp __rlslong_rrx_s + + diff -Nru sdcc-3.1.0+dfsg/doc/INSTALL.txt sdcc-3.2.0+dfsg/doc/INSTALL.txt --- sdcc-3.1.0+dfsg/doc/INSTALL.txt 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/doc/INSTALL.txt 2012-06-01 17:44:12.000000000 +0000 @@ -10,7 +10,7 @@ cd ~ mkdir tmp cd tmp - tar xjf path/to/binary/kit/sdcc-3.1.0-i386-unknown-linux2.5.tar.bz2 + tar xjf path/to/binary/kit/sdcc-3.2.0-i386-unknown-linux2.5.tar.bz2 * Change to the sdcc directory and copy all files to /usr/local cd sdcc @@ -30,7 +30,7 @@ Even if the default search paths look into /usr/local, sdcc is fully relocatable. Try `sdcc --print-search-dirs` if you have problems with header -or library files. See sdccman.[txt|pdf|html] for more detailed information. +or library files. See sdccman.pdf for more detailed information. For Windows 9X/NT/2000/XP users: @@ -39,7 +39,7 @@ * If you would like to keep a copy of your previous version, rename the directory where it's installed first -* Run sdcc-3.1.0-setup.exe +* Run sdcc-3.2.0-setup.exe By default this will install sdcc binaries into: C:\Program Files\SDCC\bin\ header files into: C:\Program Files\SDCC\include\ @@ -54,8 +54,8 @@ This should return sdcc's version number. sdcc for win32 is fully relocatable. Try `sdcc --print-search-dirs` if you -have problems with header or library files. See sdccman.[txt|pdf|html] for -more detailed information. +have problems with header or library files. See sdccman.pdf for more +detailed information. For Mac OS X users: @@ -67,7 +67,7 @@ cd ~ mkdir tmp cd tmp - tar xjf path/to/binary/kit/sdcc-3.1.0-universal-apple-macosx.tar.bz2 + tar xjf path/to/binary/kit/sdcc-3.2.0-universal-apple-macosx.tar.bz2 * Change to the sdcc directory and copy all files to /Developer/sdcc cp -r sdcc /Developer/sdcc @@ -86,4 +86,4 @@ Even if the default search paths look into /usr/local, sdcc is fully relocatable. Try `sdcc --print-search-dirs` if you have problems with header -or library files. See sdccman.[txt|pdf|html] for more detailed information. +or library files. See sdccman.pdf for more detailed information. diff -Nru sdcc-3.1.0+dfsg/doc/Makefile.in sdcc-3.2.0+dfsg/doc/Makefile.in --- sdcc-3.1.0+dfsg/doc/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/doc/Makefile.in 2012-03-12 13:19:06.000000000 +0000 @@ -7,13 +7,14 @@ MAKEINDEX = @MAKEINDEX@ PDFOPT = @PDFOPT@ -QUIET = >/dev/null 2>/dev/null +QUIET = >/dev/null 2>/dev/null include ../Makefile.common MANUAL = sdccman -all: $(MANUAL).pdf $(MANUAL).html/index.html $(MANUAL).txt +#all: $(MANUAL).pdf $(MANUAL).html/index.html $(MANUAL).txt +all: $(MANUAL).pdf install: $(INSTALL) -d $(DESTDIR)$(docdir) diff -Nru sdcc-3.1.0+dfsg/doc/README.txt sdcc-3.2.0+dfsg/doc/README.txt --- sdcc-3.1.0+dfsg/doc/README.txt 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/doc/README.txt 2012-06-01 17:44:12.000000000 +0000 @@ -1,13 +1,14 @@ SDCC - free open source, retargettable, optimizing ANSI-C compiler ------------------------------------------------------------------ -SDCC 3.1.0 release is dedicated to the memory of Dennis M. Ritchie, -father of the C programming language. - -Welcome to SDCC, free open source, retargettable, optimizing ANSI C compiler -that supports a growing list of processors including the Intel 8051, -Maxim 80DS390, Zilog Z80, Z180, Rabbit 2000, Motorola 68HC08 and the -PIC16 and PIC18 familiy. +Welcome to SDCC, free open source, retargettable, optimizing ANSI C +compiler suite that targets a growing list of processors including the +Intel MCS51 based microprocessors (8031, 8032, 8051, 8052, etc.), Maxim +(formerly Dallas) DS80C390 variants, Freescale (formerly Motorola) HC08 +based (hc08, s08) and Zilog Z80 based MCUs (z80, z180, gbz80, Rabbit +2000/3000, Rabbit 3000A). Work is in progress on supporting the +Microchip PIC16 and PIC18 targets. It can be retargeted for other +microprocessors. See share/sdcc/doc/INSTALL.txt for the installation instructions for the binary kits. @@ -17,44 +18,65 @@ See http://sdcc.sourceforge.net/ for the latest information on sdcc. -License: -SDCC is licensed under the GNU Public license (GPL) v2. Note that -this license covers the code to the compiler and other executables, -but explicitly does not cover any code or objects generated by sdcc. -We have not yet decided on a license for the run time libraries, but -it will not put any requirements on code linked against it. See: +Licenses: +~~~~~~~~~ +SDCC compiler suite is a collection of several components derived from +different sources with different FOSS licenses. See the sdccman.pdf +document, chapter "SDCC Suite Licenses" for details. + +The code or object files generated by SDCC suite are not licensed, so +they can be used in FLOSS or proprietary (closed source) applications. + +The great majority of sdcc run-time libraries are licensed under the +GPLv2+LE which allows linking of sdcc run time libraries with +proprietary (closed source) applications. + +Exception are pic device libraries and header files which are derived +from Microchip header (.inc) and linker script (.lkr) files. Microchip +requires that "The header files should state that they are only to be +used with authentic Microchip devices" which makes them incompatible +with the GPL. Pic device libraries and header files are located at +non-free/lib and non-free/include directories respectively. Sdcc should +be run with the --use-non-free command line option in order to include +non-free header files and libraries. + +See: http://www.gnu.org/copyleft/gpl.html + http://sourceforge.net/apps/trac/sdcc/wiki/SDCC%20Library%20Licenses + Support: -SDCC is a collaborative effort between a group of volunteers. Please -feel free to report bugs via the Sourceforge bug tracker, or to ask -questions on the user mailing list. See: +~~~~~~~~ +SDCC compiler suite is a collaborative effort between a group of +volunteers. Please feel free to report bugs via the Sourceforge bug +tracker, or to ask questions on the user mailing list. See: http://sourceforge.net/tracker/?atid=100599&group_id=599&func=browse http://sourceforge.net/mail/?group_id=599 - Notes: * The ds400, pic14 and pic16 are currently experimental, but work is in progress. Please check http://sdcc.sourceforge.net/snap.php for snapshots. -* The TININative, gbz80, avr and xa51 targets are no longer maintained. +* The TININative, avr and xa51 targets are no longer maintained. + Roadmap: -COPYING - GPL v2 -as/ - Assembler, derived from asxxxx -debugger/ -device/ - Device libraries and examples -doc/ - sdcc and target specific documentation -link/ - Linker, also derived from asxxxx -sim/ - Simulator (mcs51 only) -src/ - Source to the C compiler and targets -support/ - Libraries and apps that may not be provided by your system. +~~~~~~~~ +COPYING - GPL v2 +debugger/ - sdcdb debugger +device/ - Device libraries and examples +doc/ - sdcc and target specific documentation +sdas/ - Assemblers and linkers, derived from asxxxx +sim/ - ucsim simulator +src/ - Source to the C compiler and targets +support/ - Libraries and apps that may not be provided by your system. Authors and interested persons: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Sandeep Dutta (sandeep AT users.sourceforge.net) * Jean Loius-VERN @@ -79,9 +101,9 @@ * Leland Morrison SDCC includes code from: -* Alan Baldwin +* Alan Baldwin Initial version of ASXXXX and ASLINK. -* John Hartman +* John Hartman Porting ASXXXX and ASLINK for 8051. * Dmitry S. Obukhov malloc and serial I/O routines. @@ -89,4 +111,13 @@ Some of the Z80 related files are borrowed from the Gameboy Development Kit (GBDK). * The GCC development team http://gcc.gnu.org/ - The basis of sdcpp preprocessor + for GNU C preprocessor, the basis of sdcpp preprocessor and + gcc test suite, partially included into the SDCC regression test suite +* The GNU Binutils development team http://www.gnu.org/software/binutils/ + for GNU Binutils, the basis of sdbinutils +* Boost Community http://www.boost.org/ + for Boost C++ libraries used in sdcc compiler +* Timo Bingmann http://idlebox.net/2007/stx-btree/ + for TX B+ Tree C++ Template Classes used in sdcc compiler +* Malini Dutta + Sandeep's wife, for her patience and support. diff -Nru sdcc-3.1.0+dfsg/doc/TININative.txt sdcc-3.2.0+dfsg/doc/TININative.txt --- sdcc-3.1.0+dfsg/doc/TININative.txt 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/doc/TININative.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,171 +0,0 @@ -Using SDCC to develop Native Java functions -------------------------------------------- - -Prerequisites --------------- - -1) Download the latest compiler sources from http://sdcc.sourceforge.net (Subversion download), build & - install the compiler. -2) Download & install tini development kit. SDCC uses 'a390' assembler to generate Native libraries, - it is NOT distributed with the compiler. Tested with Version 1.02d. - - -Small Example -------------- - -Hello.java :- - -import com.dalsemi.comm.*; -import com.dalsemi.system.*; - -public class Hello -{ - public static native int method1(int i,int j); - static void main(String args[]) - { - System.out.println("Hello Started"); - try { - System.loadLibrary("myn.tlib"); - System.out.println("Load Success"); - System.out.println("Native method1 returned " + method1(200,100)); - } - catch (Throwable t) { - System.out.println(t); - } - } -} - -myn.c :- - -long Native_method1() _JavaNative -{ - long l = NatLib_LoadInt(0); - long k = NatLib_LoadInt(1); - return l-k; -} - -Before you start compiling make sure -a) 'macro' & 'a390' are in the PATH -b) The files tini.inc, ds80c390.inc, tinimacro.inc & apiequ.inc are in the SAME directory as - the C file. - -> javac -bootclasspath /tiniclasses.jar Hello.java -> java -cp /tini.jar TINIConvertor -f Hello.class -o Hello.tini -d /tini.db -> sdcc -mTININative myn.c - -Load Hello.tini & myn.tlib into the TINI board then - -TINI /> java Hello.tini -Hello Started -Load Success -Native method1 returned 100 - -TINI /> - -Details you MUST know ---------------------- -SDCC has a completely different and incompatible parameter passing and register usage -than the TINI java environment. The Native API has been implemented using the __builtin, -or intrinsic function support in SDCC . Each of the Native API functions are mapped to an -SDCC intrinsic function, the code generator for the intrinsic function takes care of mapping -the registers and parameters to the TINI Java environment's expectations . - -The _JavaNative keyword is used to map the return value from a Native function to R4:R0, by -default SDCC uses DPTR:b:a to return a value. - - Type Mapping - ------------ - - SDCC can support types that are upto 4 bytes (32 bits). - - Java SDCC - ---- ---- - char char - short short/int - int long - long NOT SUPPORTED - double NOT SUPPORTED - - _bpx & _ap - --------- - SDCC requires a 16 bit frame pointer to access local variables (on the stack), and - function parameters . In the TININative environment _bpx is mapped to R7_B3:R6_B3 - (register R7:R6 in bank3). The compiler also uses AP as a temp register, for the - TINI environment this is mapped to R5_B3. - -Limitations ------------ - -The TININative environment does not have a linker. Multiplication & Division of 16 & 32 bit -numbers are implemented in SDCC as library functions this implies that , division & multiplication -of these numbers are not supported in the TININative environment. The compiler transforms div/mul by -power of 2 to shifts . For other mul/divs there are two ways around . - -a) Copy the library function from the library to your code . The sources can be found in - sdcc/device/lib. -b) Use the --use-accelerator option, with this option the compiler will generate code to use - the on-chip arithmetic accelerator for 16 bit multiplication & division & modulus. - NOTE The compiler will disable interrupts during this operation to prevent corruption of - MA & MB registers. MUL/DIV/MOD of unsigned quantities are more efficient than signed - quantities. - -API Mappings ------------- -As mentioned earlier the Native APIs are implemented using compiler intrinsic functions, at this -time only the following functions have been mapped (more will be mapped in the future). Some -Native API calls return multiple values, I haven't found a good way to handle this yet, in most -cases these return a HANDLE and a pointer to ABSOLUTE memory in DPTR, in such cases SDCC will -return ONLY the HANDLE and ignore the POINTER value. The HANDLE can then be used with MM_Deref to -obtain the POINTER value again (I hope my assumption is correct here). - -SDCC Prototype Native API --------------- ---------- -char NatLib_LoadByte (char parmnum); NatLib_LoadPrimitive -int NatLib_LoadShort(char parmnum); NatLib_LoadPrimitive -long NatLib_LoadInt (char parmnum); NatLib_LoadPrimitive -char *NatLib_LoadPointer (char parmnum); NatLib_LoadPointer - -/* in the following cases the compiler will fill in the pointer to LibraryID when required*/ -/* NatLib_Get* return mutiple values return value is HANDLE , pointer is ignored */ - -char NatLib_InstallImmutableStateBlock(void *state_block,int handle); - NatLib_InstallImmutableStateBlock -char NatLib_InstallEphemeralStateBlock(void *state_block,int handle); - NatLib_InstallEphemeralStateBlock -void NatLib_RemoveImmutableStateBlock (); NatLib_RemoveImmutableStateBlock -void NatLib_RemoveEphemeralStateBlock (); NatLib_RemoveEphemeralStateBlock -int NatLib_GetImmutableStateBlock(); NatLib_GetImmutableStateBlock -int NatLib_GetEphemeralStateBlock(); NatLib_GetEphemeralStateBlock - -int MM_XMalloc (long size); MM_XMalloc /* returns HANDLE */ -int MM_Malloc (int size); MM_Malloc /* return HANDLE */ -int MM_ApplicationMalloc ( int size ); MM_ApplicationMalloc /* returns HANDLE */ -int MM_Free (int handle); MM_Free -char *MM_Deref (int handle); MM_Deref -char MM_UnrestrictedPersist(int handle); MM_UnrestrictedPersist - -char System_ExecJavaProcess(char *image,int handle-to-processname) - System_ExecJavaProcess -void System_GetRTCRegisters(char *regsavearea) System_GetRTCRegisters -void System_SetRTCRegisters(char *regsavearea) System_SetRTCRegisters -void System_ThreadSleep(long timeout) System_ThreadSleep -void System_ThreadSleep_ExitCriticalSection(long timeout) System_ThreadSleep_ExitCriticalSection -void System_ThreadResume(char threadid,char processid) System_ThreadResume -void System_SaveJavaThreadState() System_SaveJavaThreadState -void System_RestoreJavaThreadState() System_RestoreJavaThreadState -void System_ProcessSleep(long timeout) System_ProcessSleep -void System_ProcessSleep_ExitCriticalSection(long timeout) System_ProcessSleep_ExitCriticalSection -void System_ProcessYield() System_ProcessYield -void System_ProcessSuspend() System_ProcessSuspend -void System_ProcessResume(char processid) System_ProcessResume -char System_RegisterPoll((void *)(funcpointer)()) System_RegisterPoll -char System_RemovePoll((void *)(funcpointer)()) System_RemovePoll -char System_GetCurrentThreadId() System_GetCurrentThreadId -char System_GetCurrentProcessId() System_GetCurrentProcessId - - -Some Notes ----------- - -The register convention mapping causes a lot of push & pops to be generated. -The source for the built in functions can be found in file src/ds390/gen.c. \ No newline at end of file diff -Nru sdcc-3.1.0+dfsg/doc/sdccman.lyx sdcc-3.2.0+dfsg/doc/sdccman.lyx --- sdcc-3.1.0+dfsg/doc/sdccman.lyx 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/doc/sdccman.lyx 2012-06-18 07:51:00.000000000 +0000 @@ -1,9 +1,17 @@ -#LyX 1.6.5 created this file. For more info see http://www.lyx.org/ +#LyX 1.6.10 created this file. For more info see http://www.lyx.org/ \lyxformat 345 \begin_document \begin_header \textclass book \begin_preamble +% Added by lyx2lyx +% for proper underlining +\PassOptionsToPackage{normalem}{ulem} +\usepackage{ulem} +\let\cite@rig\cite +\newcommand{\b@xcite}[2][\%]{\def\def@pt{\%}\def\pas@pt{#1} + \mbox{\ifx\def@pt\pas@pt\cite@rig{#2}\else\cite@rig[#1]{#2}\fi}} +\renewcommand{\underbar}[1]{{\let\cite\b@xcite\uline{#1}}} \pdfoptionpdfminorversion=3 \usepackage[ pdftitle={SDCC Compiler User Guide}, @@ -117,17 +125,17 @@ \begin_layout Date \size normal -SDCC 3.1.0 +SDCC 3.2.0 \size footnotesize \begin_inset Newline newline \end_inset -$Date:: 2011-11-13 #$ +$Date:: 2012-06-18 #$ \begin_inset Newline newline \end_inset -$Revision: 7037 $ +$Revision: 7931 $ \end_layout \begin_layout Standard @@ -182,7 +190,7 @@ C \emph default ompiler) is free open source, retargettable, optimizing ANSI-C compiler - by + suite by \series bold Sandeep Dutta \series default @@ -198,13 +206,14 @@ \end_inset -, etc.), Dallas DS80C390 variants, Freescale (formerly Motorola) HC08 and - Zilog Z80 based MCUs (z80, z180, gbz80, Rabbit 2000/3000 +, etc.), Dallas DS80C390 variants, Freescale (formerly Motorola) HC08 based + (hc08, s08) and Zilog Z80 based MCUs (z80, z180, gbz80, Rabbit 2000/3000, + Rabbit 3000A \begin_inset Index -status open +status collapsed \begin_layout Plain Layout -Z80, Z180, GBZ80, Rabbit 2000/3000 CPU +Z80, Z180, GBZ80, Rabbit 2000/3000, Rabbit 3000A CPU \end_layout \end_inset @@ -245,8 +254,19 @@ Warning: Large parts of this manual apply to the mc51 port only \emph default . - Further information on the z80, z180, r2k and gbz80 ports and standard - compliance can be found in the sdcc wiki. + Further information on the z80, z180, r2k, r3ka and gbz80 ports and standard + compliance can be found in the sdcc wiki +\begin_inset Flex URL +status collapsed + +\begin_layout Plain Layout + +http://sourceforge.net/apps/trac/sdcc/ +\end_layout + +\end_inset + +. \begin_inset Newline newline \end_inset @@ -290,7 +310,6 @@ \begin_layout Standard For the back-end SDCC uses a global register allocation scheme which should be well suited for other 8 bit MCUs. - \begin_inset Newline newline \end_inset @@ -300,7 +319,6 @@ The peep hole optimizer uses a rule based substitution mechanism which is MCU independent. - \begin_inset Newline newline \end_inset @@ -309,6 +327,10 @@ \end_inset Supported data-types are: +\begin_inset Newline newline +\end_inset + + \end_layout \begin_layout Standard @@ -609,10 +631,11 @@ \begin_layout Plain Layout long long \begin_inset Foot -status open +status collapsed \begin_layout Plain Layout -only supported in the z80, z180, r2k and gbz80 ports as of sdcc 3.1.0 +only supported in the hc08, s08, z80, z180, r2k, r3ka and gbz80 ports as + of sdcc 3.2.0 \end_layout \end_inset @@ -799,7 +822,6 @@ -cyclomatic) to report the relative complexity of a function. These functions can then be further optimized, or hand coded in assembly if needed. - \begin_inset Newline newline \end_inset @@ -859,54 +881,413 @@ \end_layout \begin_layout Section -Open Source +SDCC Suite Licenses \end_layout \begin_layout Standard -All packages used in this compiler system are -\emph on -free open source -\emph default -; source code for all the sub-packages (pre-processor, assemblers, linkers - etc.) is distributed with the package. - This documentation is maintained using a free open source word processor - (LyX). +SDCC suite is a collection of several components derived from different + sources with different licenses: +\end_layout + +\begin_layout Itemize +executables: +\end_layout + +\begin_deeper +\begin_layout Itemize +sdcc compiler: \begin_inset Newline newline \end_inset -This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License +sdcc compiler is licensed under the GPLv2. +\begin_inset Newline newline +\end_inset + +The code or object files generated by SDCC suite are not licensed, so they + can be used in FLOSS or proprietary (closed source) applications. +\end_layout + +\begin_layout Itemize +sdcpp preprocessor: +\begin_inset Newline newline +\end_inset + +derived from GCC cpp preprocessor +\begin_inset Flex URL +status collapsed + +\begin_layout Plain Layout + +http://gcc.gnu.org/ +\end_layout + +\end_inset + +; GPLv3 license +\end_layout + +\begin_layout Itemize +sdas assemblers and sdld linker: +\begin_inset Newline newline +\end_inset + +derived from ASXXXX +\begin_inset Flex URL +status collapsed + +\begin_layout Plain Layout + +http://shop-pdp.kent.edu/ashtml/asxxxx.htm +\end_layout + +\end_inset + +; GPLv3 license +\end_layout + +\begin_layout Itemize +SDCC run-time libraries: +\begin_inset Newline newline +\end_inset + +The great majority of SDCC run-time libraries are licensed under the GPLv2+LE \begin_inset Index status collapsed \begin_layout Plain Layout -GNU General Public License, GPL +GPLv2+LE \end_layout \end_inset - as published by the Free Software Foundation; either version 2, or (at - your option) any later version. - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty + which allows linking of SDCC run-time libraries with proprietary (closed + source) applications. +\begin_inset Newline newline +\end_inset + +Exception are pic device libraries and header files which are derived from + Microchip header (.inc) and linker script (.lkr) files. + Microchip requires that "The header files should state that they are only + to be used with authentic Microchip devices" which makes them incompatible + with the GPL. + Pic device libraries and header files are located at non-free/lib and non-free/ +include directories respectively. + Sdcc should be run with the +\series bold +- +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +/ +\end_layout + +\end_inset + +- +\series default +use-non-free +\series bold + \begin_inset Index status collapsed \begin_layout Plain Layout -warranty +- +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +/ +\end_layout + +\end_inset + +-use-non-free +\end_layout + +\end_inset + + +\series default + command line option in order to include non-free header files and libraries. + +\end_layout + +\begin_layout Itemize +sdbinutils utilities (sdar, sdranlib, sdnm): +\begin_inset Newline newline +\end_inset + +derived from GNU Binutils +\begin_inset Flex URL +status collapsed + +\begin_layout Plain Layout + +http://www.gnu.org/software/binutils/ +\end_layout + +\end_inset + +; GPLv3 license +\end_layout + +\begin_layout Itemize +sdcclib librarian: +\begin_inset Newline newline +\end_inset + +GPLv2 license +\end_layout + +\begin_layout Itemize +ucsim simulators: +\begin_inset Newline newline +\end_inset + +GPLv2 license +\end_layout + +\begin_layout Itemize +sdcdb debugger: +\begin_inset Newline newline +\end_inset + +GPLv2 license +\end_layout + +\begin_layout Itemize +gcc-test regression tests: +\begin_inset Newline newline +\end_inset + +derived from gcc-testsuite; no license explicitely specified, but since + it is a part of GCC is probably GPLv3 licensed \end_layout +\begin_layout Itemize +packihx: +\begin_inset Newline newline \end_inset - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA. - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve what - you give them. - Help stamp out software-hoarding! +public domain +\end_layout + +\begin_layout Itemize +makebin: +\begin_inset Newline newline +\end_inset + +zlib/libpng License +\end_layout + +\end_deeper +\begin_layout Itemize +libraries: +\end_layout + +\begin_deeper +\begin_layout Itemize +dbuf library: +\begin_inset Newline newline +\end_inset + +zlib/libpng License +\end_layout + +\begin_layout Itemize +Boost C++ libraries: +\begin_inset Newline newline +\end_inset + + +\begin_inset Flex URL +status collapsed + +\begin_layout Plain Layout + +http://www.boost.org/ +\end_layout + +\end_inset + +; Boost Software License 1.0 (BSL-1.0) +\end_layout + +\begin_layout Itemize +STX B+ Tree C++ Template Classes: +\begin_inset Newline newline +\end_inset + + +\begin_inset Flex URL +status collapsed + +\begin_layout Plain Layout + +http://idlebox.net/2007/stx-btree/ +\end_layout + +\end_inset + +; LGPLv2.1 +\end_layout + +\end_deeper +\begin_layout Standard +Links to licenses: +\end_layout + +\begin_layout Itemize +GPLv2 license +\begin_inset Index +status collapsed + +\begin_layout Plain Layout +GPLv2 license +\end_layout + +\end_inset + +: +\begin_inset Flex URL +status collapsed + +\begin_layout Plain Layout + +http://www.gnu.org/licenses/old-licenses/gpl-2.0.html +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Itemize +LGPLv2.1 license +\begin_inset Index +status collapsed + +\begin_layout Plain Layout +LGPLv2.1 license +\end_layout + +\end_inset + +: +\begin_inset Flex URL +status collapsed + +\begin_layout Plain Layout + +http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Itemize +GPLv3 license +\begin_inset Index +status collapsed + +\begin_layout Plain Layout +GPLv3 license +\end_layout + +\end_inset + +: +\begin_inset Flex URL +status collapsed + +\begin_layout Plain Layout + +http://www.gnu.org/licenses/gpl.html +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Itemize +zlib/libpng License +\begin_inset Index +status collapsed + +\begin_layout Plain Layout +zlib/libpng License +\end_layout + +\end_inset + +: +\begin_inset Flex URL +status collapsed + +\begin_layout Plain Layout + +http://www.opensource.org/licenses/Zlib +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Itemize +Boost Software License 1.0 (BSL-1.0) +\begin_inset Index +status collapsed + +\begin_layout Plain Layout +Boost Software License 1.0 (BSL-1.0) +\end_layout + +\end_inset + +: +\begin_inset Flex URL +status collapsed + +\begin_layout Plain Layout + +http://www.opensource.org/licenses/BSL-1.0 +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Section +Documentation +\end_layout + +\begin_layout Standard +This documentation is maintained using a free open source word processor + (LyX) +\begin_inset Flex URL +status collapsed + +\begin_layout Plain Layout + +http://www.lyx.org/ +\end_layout + +\end_inset + +. \end_layout \begin_layout Section @@ -998,10 +1379,6 @@ \end_inset -\begin_inset Newline newline -\end_inset - - \end_layout \begin_layout Itemize @@ -1619,20 +1996,7 @@ status collapsed \begin_layout Plain Layout -̃ -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -/ -\end_layout - -\end_inset - - Operator +~ Operator \end_layout \end_inset @@ -1997,7 +2361,7 @@ See section \begin_inset CommandInset ref LatexCommand ref -reference "sub:Using-ar-to" +reference "sub:Using-sdar-to" \end_inset @@ -2005,19 +2369,6 @@ \end_layout \begin_layout Itemize -special sdcc keywords which are not preceded by a double underscore are - deprecated in version 3.0.0 and higher. - See section -\begin_inset CommandInset ref -LatexCommand ref -reference "sub:ANSI-Compliance" - -\end_inset - - ANSI-Compliance. -\end_layout - -\begin_layout Itemize targets for xa51 and avr are disabled by default in version 3.0.0 and higher. \end_layout @@ -2060,6 +2411,84 @@ . \end_layout +\begin_layout Itemize +sdar archive managing utility and sdnm utilityes were introduced in version + 3.2.0. + sdar, sdranlib and sdnm are derived from GNU Binutils package. +\end_layout + +\begin_layout Itemize +with sdcc version 3.2.0 the sdcclib utility is deprecated. + Sdar utility should be used to create sdcc object file archives. + Sdcclib utility will become obsolete in one of next sdcc releases and will + be removed from sdcc packages. +\end_layout + +\begin_layout Itemize +special sdcc keywords which are not preceded by a double underscore are + obsoleted (removed) in version 3.2.0 and higher. + See section +\begin_inset CommandInset ref +LatexCommand ref +reference "sub:ANSI-Compliance" + +\end_inset + + ANSI-Compliance. +\end_layout + +\begin_layout Itemize +in sdcc version 3.2.0 compiler macro definitions not starting with double + underscore characters are deprecated if --std-cXX command line option is + defined. + They will be oboleted (removed) in one of next sdcc releases. +\end_layout + +\begin_layout Itemize +in sdcc version 3.2.0 new compiler macros for processor definition were introduced + for pic14 and pic16 targets: -D__SDCC_PIC16XXXX and -D__SDCC_PIC18FXXX + respectively. + The pic16 macro definition -D__18fXXX is deprecated. + It will be obsoleted (removed) in one of next sdcc releases. +\end_layout + +\begin_layout Itemize +pragma config for pic16 target was introduced in version 3.2.0. + See section +\begin_inset CommandInset ref +LatexCommand ref +reference "sub:PIC16_Pragmas" + +\end_inset + + +\end_layout + +\begin_layout Itemize +new inline assembler format +\family typewriter +__asm__ (inline_assembler_code +\begin_inset Quotes srd +\end_inset + +); +\family default + as an addition to +\family typewriter +__asm ... + __endasem; +\family default + format introduced in version 3.2.0. + See section +\begin_inset CommandInset ref +LatexCommand ref +reference "sec:Inline-Assembler-Code" + +\end_inset + + +\end_layout + \begin_layout Section System Requirements \end_layout @@ -2189,10 +2618,6 @@ \end_inset . -\begin_inset Newline newline -\end_inset - - \end_layout \begin_layout Chapter @@ -2461,7 +2886,7 @@ \end_inset --disable-gbz80-port Excludes the GameBoy gbz80 port +-disable-z80-port Excludes the z80 port \end_layout \begin_layout List @@ -2479,7 +2904,61 @@ \end_inset --disable-z80-port Excludes the z80 port +-disable-z180-port Excludes the z180 port +\end_layout + +\begin_layout List +\labelwidthstring 00.00.0000 +- +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +/ +\end_layout + +\end_inset + +-disable-r2k-port Excludes the r2k port +\end_layout + +\begin_layout List +\labelwidthstring 00.00.0000 +- +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +/ +\end_layout + +\end_inset + +-disable-r3ka-port Excludes the r3ka port +\end_layout + +\begin_layout List +\labelwidthstring 00.00.0000 +- +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +/ +\end_layout + +\end_inset + +-disable-gbz80-port Excludes the GameBoy gbz80 port \end_layout \begin_layout List @@ -2551,6 +3030,24 @@ \end_inset +-disable-s08-port Excludes the S08 port +\end_layout + +\begin_layout List +\labelwidthstring 00.00.0000 +- +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +/ +\end_layout + +\end_inset + -disable-pic-port Excludes the PIC14 port \end_layout @@ -2660,17 +3157,7 @@ \end_inset -enable-new-pics Enables support for PIC devices that are not supported - by the current 0.13.7 release of gputils, namely 12f1822, 16f1933, 16f1934, - 16f1936, and 16f1937 for the PIC14 target and 18f[24][3456]k22 for PIC16. - Enabling this probably requires gputils -\begin_inset Formula $\geq$ -\end_inset - -0.14.0 or a recent SVN revision! -\begin_inset Newline newline -\end_inset - - + by the current 0.14.2 release of gputils \end_layout \begin_layout List @@ -2808,7 +3295,7 @@ \begin_layout Standard See the examples, how to pass the Win32 settings to 'configure'. The other Win32 builds using VC or whatever don't use 'configure', but - a header file sdcc_vc_in.h is the same as sdccconf.h built by 'configure' + a header file sdcc_vc.h.in is the same as sdccconf.h built by 'configure' for Win32. \begin_inset Newline newline \end_inset @@ -3485,7 +3972,7 @@ \backslash - + \begin_inset Newline newline \end_inset @@ -3954,13 +4441,6 @@ \end_layout \begin_layout Standard -\begin_inset VSpace medskip -\end_inset - - -\end_layout - -\begin_layout Standard \align center \begin_inset Tabular @@ -5160,7 +5640,7 @@ \end_inset 3. - Library files + Library files \begin_inset Newline newline \end_inset @@ -5195,7 +5675,6 @@ \shape default is auto-appended by the compiler (e.g. small, large, z80, ds390 etc.). - \begin_inset Newline newline \end_inset @@ -6563,7 +7042,7 @@ \backslash util \backslash -' and add these lines: +' and add these lines: \begin_inset Newline newline \end_inset @@ -6710,7 +7189,7 @@ \emph on sdcc-x.y.z-setup.exe \emph default - for an official release from + for an official release from \begin_inset Newline newline \end_inset @@ -7262,7 +7741,6 @@ \end_inset . - \begin_inset Newline newline \end_inset @@ -7288,7 +7766,6 @@ \end_inset . - \begin_inset Newline newline \end_inset @@ -8064,11 +8541,11 @@ \end_layout \begin_layout Itemize -sdcclib - A tool for creating sdcc libraries +sdcclib - A tool for creating sdcc libraries (deprecated) \end_layout \begin_layout Itemize -sdranlib - A tool for indexing sdcc ar libraries +sdar, sdranlib, sdnm - The sdcc archive managing and indexing utilites. \end_layout \begin_layout Itemize @@ -8242,7 +8719,7 @@ \begin_layout Standard s51 \begin_inset Index -status open +status collapsed \begin_layout Plain Layout s51 (simulator) @@ -8252,7 +8729,7 @@ , sz80 \begin_inset Index -status open +status collapsed \begin_layout Plain Layout sz80 (simulator) @@ -8262,7 +8739,7 @@ and shc08 \begin_inset Index -status open +status collapsed \begin_layout Plain Layout shc08 (simulator) @@ -8989,7 +9466,7 @@ \series default An example for a more complex command line \begin_inset Foot -status open +status collapsed \begin_layout Plain Layout the command backfills @@ -9117,10 +9594,6 @@ \size default The first two files will need to be compiled separately with the commands: -\size footnotesize - -\size default - \begin_inset Newline newline \end_inset @@ -9184,7 +9657,7 @@ \end_inset - the files together with the following command: + the files together with the following command: \begin_inset Newline newline \end_inset @@ -9232,7 +9705,7 @@ \emph on foomain.c \emph default - can be separately compiled as well: + can be separately compiled as well: \family sans \series bold @@ -9397,7 +9870,70 @@ \end_layout \begin_layout Subsection -Using sdcclib to Create and Manage Libraries +Using sdar to Create and Manage Libraries +\begin_inset Index +status collapsed + +\begin_layout Plain Layout +sdar +\end_layout + +\end_inset + + +\begin_inset CommandInset label +LatexCommand label +name "sub:Using-sdar-to" + +\end_inset + + +\end_layout + +\begin_layout Standard +Support for sdar format libraries was introduced in sdcc 2.9.0. +\series bold + +\begin_inset Newline newline +\end_inset + + +\begin_inset Newline newline +\end_inset + + +\series default +Both the GNU and BSD ar format variants are supported by sdld linkers. +\series bold + +\begin_inset Newline newline +\end_inset + + +\begin_inset Newline newline +\end_inset + + +\series default +To create a library containing sdas object files, you should use the following + sequence: +\series bold + +\begin_inset Newline newline +\end_inset + + +\end_layout + +\begin_layout Standard + +\family sans +\series bold +sdar -rc .lib +\end_layout + +\begin_layout Subsection +Using sdcclib to Create and Manage Libraries (deprecated) \begin_inset Index status collapsed @@ -9408,6 +9944,19 @@ \end_inset +\begin_inset Foot +status collapsed + +\begin_layout Plain Layout +With sdcc version 3.2.0 the sdcclib utility is deprecated. + Sdar utility should be used to create sdcc object file archives. + Sdcclib utility will become obsolete in one of next sdcc releases and will + be removed from sdcc packages. +\end_layout + +\end_inset + + \end_layout \begin_layout Standard @@ -9431,7 +9980,7 @@ \series bold sdcclib -? \begin_inset Index -status open +status collapsed \begin_layout Plain Layout sdcclib @@ -9515,7 +10064,7 @@ \family default \begin_inset Index -status open +status collapsed \begin_layout Plain Layout sdcclib @@ -9914,13 +10463,13 @@ sections. \end_layout -\begin_layout Subsection -Using ar to Create and Manage Libraries +\begin_layout Section +Command Line Options \begin_inset Index status collapsed \begin_layout Plain Layout -ar +Command Line Options \end_layout \end_inset @@ -9928,264 +10477,235 @@ \begin_inset CommandInset label LatexCommand label -name "sub:Using-ar-to" +name "sec:Command-Line-Options" \end_inset \end_layout -\begin_layout Standard -Support for ar format libraries was introduced in sdcc 2.9.0. - Ar is a standard archive managing utility on unices (Linux, Mac OS X, several - unix flavors) so it is not included in the sdcc package. -\series bold - -\begin_inset Newline newline -\end_inset - - -\begin_inset Newline newline -\end_inset - - -\series default -For Windows platform you can find ar utility in GNU binutils package included - in several projects: Cygwin at -\begin_inset Flex URL +\begin_layout Subsection +Processor Selection Options +\begin_inset Index status collapsed \begin_layout Plain Layout - -http://www.cygwin.com/ +Options processor selection \end_layout \end_inset -, MinGW at -\begin_inset Flex URL + +\begin_inset Index status collapsed \begin_layout Plain Layout - -http://www.mingw.org/ +Processor selection options \end_layout \end_inset -. -\series bold - -\begin_inset Newline newline -\end_inset - -\begin_inset Newline newline -\end_inset +\end_layout +\begin_layout List +\labelwidthstring 00.00.0000 -\series default -Both the GNU and BSD ar format variants are supported by sdld linkers. - Ar doesn't natively understand the sdas object file format, so there is - a special version of ranlib distributed with sdcc, called sdranlib, which - produces the ar symbol lookup table. \series bold +-mmcs51 +\begin_inset Index +status collapsed -\begin_inset Newline newline -\end_inset - +\begin_layout Plain Layout +-mmcs51 +\end_layout -\begin_inset Newline newline \end_inset \series default -To create a library containing sdas object files, you should use the following - sequence: -\series bold - -\begin_inset Newline newline -\end_inset - - -\end_layout - -\begin_layout Standard - -\family sans -\series bold -ar -Sq .lib -\end_layout - -\begin_layout Standard + Generate code for the Intel MCS51 +\begin_inset Index +status collapsed -\family sans -\series bold -sdranlib .lib +\begin_layout Plain Layout +MCS51 \end_layout -\begin_layout Standard -\begin_inset VSpace bigskip \end_inset - + family of processors. + This is the default processor target. \end_layout -\begin_layout Section -Command Line Options +\begin_layout List +\labelwidthstring 00.00.0000 + +\series bold +-mds390 \begin_inset Index status collapsed \begin_layout Plain Layout -Command Line Options +-mds390 \end_layout \end_inset -\begin_inset CommandInset label -LatexCommand label -name "sec:Command-Line-Options" +\series default + Generate code for the Dallas DS80C390 +\begin_inset Index +status collapsed -\end_inset +\begin_layout Plain Layout +DS80C390 +\end_layout +\end_inset + processor. \end_layout -\begin_layout Subsection -Processor Selection Options +\begin_layout List +\labelwidthstring 00.00.0000 + +\series bold +-mds400 \begin_inset Index status collapsed \begin_layout Plain Layout -Options processor selection +-mds400 \end_layout \end_inset +\series default + Generate code for the Dallas DS80C400 \begin_inset Index status collapsed \begin_layout Plain Layout -Processor selection options +DS80C400 \end_layout \end_inset - + processor. \end_layout \begin_layout List \labelwidthstring 00.00.0000 \series bold --mmcs51 +-mhc08 \begin_inset Index status collapsed \begin_layout Plain Layout --mmcs51 +-mhc08 \end_layout \end_inset \series default - Generate code for the Intel MCS51 + Generate code for the Freescale/Motorola HC08 (aks 68HC08) \begin_inset Index status collapsed \begin_layout Plain Layout -MCS51 +HC08 \end_layout \end_inset family of processors. - This is the default processor target. \end_layout \begin_layout List \labelwidthstring 00.00.0000 \series bold --mds390 +-ms08 \begin_inset Index status collapsed \begin_layout Plain Layout --mds390 +-ms08 \end_layout \end_inset \series default - Generate code for the Dallas DS80C390 + Generate code for the Freescale/Motorola S08 (aks 68HCS08, HCS08, CS08) + \begin_inset Index status collapsed \begin_layout Plain Layout -DS80C390 +S08 \end_layout \end_inset - processor. + family of processors. \end_layout \begin_layout List \labelwidthstring 00.00.0000 \series bold --mds400 +-mz80 \begin_inset Index status collapsed \begin_layout Plain Layout --mds400 +-mz80 \end_layout \end_inset \series default - Generate code for the Dallas DS80C400 + Generate code for the Zilog Z80 \begin_inset Index status collapsed \begin_layout Plain Layout -DS80C400 +Z80 \end_layout \end_inset - processor. + family of processors. \end_layout \begin_layout List \labelwidthstring 00.00.0000 \series bold --mhc08 +-mz180 \begin_inset Index status collapsed \begin_layout Plain Layout --mhc08 +-mz180 \end_layout \end_inset \series default - Generate code for the Freescale/Motorola HC08 + Generate code for the Zilog Z180 \begin_inset Index status collapsed \begin_layout Plain Layout -HC08 +Z180 \end_layout \end_inset @@ -10197,29 +10717,38 @@ \labelwidthstring 00.00.0000 \series bold --mz80 +-mr2k \begin_inset Index status collapsed \begin_layout Plain Layout --mz80 +-mr2k \end_layout \end_inset \series default - Generate code for the Zilog Z80 + Generate code for the Rabbit 2000 / Rabbit 3000 family of processors. +\end_layout + +\begin_layout List +\labelwidthstring 00.00.0000 + +\series bold +-mr3ka \begin_inset Index status collapsed \begin_layout Plain Layout -Z80 +-mr3ka \end_layout \end_inset - family of processors. + +\series default + Generate code for the Rabbit 3000A family of processors. \end_layout \begin_layout List @@ -10379,13 +10908,6 @@ Option -m has higher priority than setting from program name. \end_layout -\begin_layout Standard -\begin_inset VSpace bigskip -\end_inset - - -\end_layout - \begin_layout Subsection Preprocessor Options \begin_inset Index @@ -10846,13 +11368,6 @@ \end_layout -\begin_layout Standard -\begin_inset VSpace bigskip -\end_inset - - -\end_layout - \begin_layout Subsection Linker Options \begin_inset Index @@ -11873,7 +12388,7 @@ \end_inset - processors) + and S08 processors) \end_layout \begin_layout List @@ -11931,13 +12446,6 @@ File sdcc/sdas/doc/asxhtm.html has more on linker options. \end_layout -\begin_layout Standard -\begin_inset VSpace bigskip -\end_inset - - -\end_layout - \begin_layout Subsection MCS51 Options \begin_inset Index @@ -12594,13 +13102,6 @@ lcall/ljmp instructions.. \end_layout -\begin_layout Standard -\begin_inset VSpace bigskip -\end_inset - - -\end_layout - \begin_layout Subsection DS390 / DS400 Options \begin_inset Index @@ -12899,7 +13400,7 @@ \series bold - \begin_inset ERT -status open +status collapsed \begin_layout Plain Layout @@ -13055,13 +13556,6 @@ \end_layout -\begin_layout Standard -\begin_inset VSpace bigskip -\end_inset - - -\end_layout - \begin_layout Subsection Z80 Options \begin_inset Index @@ -13421,14 +13915,6 @@ \end_layout -\begin_layout List -\labelwidthstring 00.00.0000 -\begin_inset VSpace bigskip -\end_inset - - -\end_layout - \begin_layout Subsection GBZ80 Options \begin_inset Index @@ -13692,13 +14178,6 @@ Use for the const segment name. \end_layout -\begin_layout Standard -\begin_inset VSpace bigskip -\end_inset - - -\end_layout - \begin_layout Subsection Optimization Options \begin_inset Index @@ -14767,11 +15246,55 @@ Frame pointer will be omitted when the function uses no local variables. \end_layout -\begin_layout Standard -\begin_inset VSpace bigskip +\begin_layout List +\labelwidthstring 00.00.0000 +- +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +/ +\end_layout + +\end_inset + +- +\series bold +max-allocs-per-node +\series default + +\begin_inset Index +status open + +\begin_layout Plain Layout +- +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +/ +\end_layout + \end_inset +-max-allocs-per-node +\end_layout + +\end_inset + Setting this to a high value will result in increased compilation time + and more optimized code being generated. + Setting it to lower valeus speed up compilation, but does not optimize + as much. + The default value is 3000. + This option currently only affects the hc08, s08, z80, z180, r2k, r3ka + and gbz80 ports. \end_layout \begin_layout Subsection @@ -15719,7 +16242,7 @@ \series bold \begin_inset ERT -status open +status collapsed \begin_layout Plain Layout @@ -16105,7 +16628,7 @@ \series bold \begin_inset ERT -status open +status collapsed \begin_layout Plain Layout @@ -17218,13 +17741,6 @@ \end_layout -\begin_layout Standard -\begin_inset VSpace bigskip -\end_inset - - -\end_layout - \begin_layout Subsection Intermediate Dump Options \begin_inset CommandInset label @@ -17791,13 +18307,6 @@ Will cause all the above mentioned dumps to be created. \end_layout -\begin_layout Standard -\begin_inset VSpace bigskip -\end_inset - - -\end_layout - \begin_layout Subsection Redirecting output on Windows Shells \end_layout @@ -17965,12 +18474,6 @@ \series bold \emph default -model-large -c $(InputPath) -\series default - -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Section @@ -18237,7 +18740,7 @@ are mainly used for debugging purposes. They can change or disappear very quickly, and will never be documented \begin_inset Foot -status open +status collapsed \begin_layout Plain Layout if you are curious search in SDCC's sources for @@ -18266,11 +18769,6 @@ \end_inset . - -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Section @@ -18297,17 +18795,7 @@ \end_layout \begin_layout Subsubsection -data -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -data (mcs51, ds390 storage class) -\end_layout - -\end_inset - - +__data \begin_inset Index status collapsed @@ -18342,17 +18830,7 @@ \end_inset - / near -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -near (storage class) -\end_layout - -\end_inset - - + / __near \begin_inset Index status collapsed @@ -18395,23 +18873,7 @@ \series bold default \series default - storage class for the Small Memory model ( -\emph on -data -\emph default - and -\emph on -near -\emph default - or the more ANSI-C compliant forms -\emph on -__data -\emph default - and -\emph on -__near -\emph default - can be used synonymously). + storage class for the Small Memory model. Variables declared with this storage class will be allocated in the directly addressable portion of the internal RAM of a 8051, e.g.: \end_layout @@ -18453,17 +18915,7 @@ \end_layout \begin_layout Subsubsection -xdata -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -xdata (mcs51, ds390 storage class) -\end_layout - -\end_inset - - +__xdata \begin_inset Index status collapsed @@ -18498,17 +18950,7 @@ \end_inset - / far -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -far (storage class) -\end_layout - -\end_inset - - + / __far \begin_inset Index status collapsed @@ -18589,7 +19031,7 @@ \begin_inset space ~ \end_inset -dptr,#_test_xdata +dptr,#_test_xdata \begin_inset Newline newline \end_inset @@ -18629,7 +19071,7 @@ \begin_inset space ~ \end_inset -a,#0x01 +a,#0x01 \begin_inset Newline newline \end_inset @@ -18677,17 +19119,7 @@ \end_layout \begin_layout Subsubsection -idata -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -idata (mcs51, ds390 storage class) -\end_layout - -\end_inset - - +__idata \begin_inset Index status collapsed @@ -18845,17 +19277,7 @@ \end_layout \begin_layout Subsubsection -pdata -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -pdata (mcs51, ds390 storage class) -\end_layout - -\end_inset - - +__pdata \begin_inset Index status collapsed @@ -18991,7 +19413,7 @@ \begin_inset space ~ \end_inset -mov a,#0x01 +mov a,#0x01 \begin_inset Newline newline \end_inset @@ -19076,17 +19498,7 @@ \end_layout \begin_layout Subsubsection -code -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -code -\end_layout - -\end_inset - - +__code \begin_inset Index status collapsed @@ -19347,17 +19759,7 @@ \end_layout \begin_layout Subsubsection -bit -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -bit -\end_layout - -\end_inset - - +__bit \begin_inset Index status collapsed @@ -19452,7 +19854,6 @@ \begin_layout Standard The bit addressable memory consists of 128 bits which are located from 0x20 to 0x2f in data memory. - \begin_inset Newline newline \end_inset @@ -19484,17 +19885,7 @@ \end_layout \begin_layout Subsubsection -sfr -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -sfr -\end_layout - -\end_inset - - +__sfr \begin_inset Index status collapsed @@ -19529,17 +19920,7 @@ \end_inset - / sfr16 -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -sfr16 -\end_layout - -\end_inset - - + / __sfr16 \begin_inset Index status collapsed @@ -19574,17 +19955,7 @@ \end_inset - / sfr32 -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -sfr32 -\end_layout - -\end_inset - - + / __sfr32 \begin_inset Index status collapsed @@ -19619,42 +19990,7 @@ \end_inset - / sbit -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -_ -\end_layout - -\end_inset - - -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -_ -\end_layout - -\end_inset - -sbit -\end_layout - -\end_inset - - + / __sbit \begin_inset Index status collapsed @@ -19670,7 +20006,7 @@ \begin_layout Standard Like the bit keyword, \emph on -sfr / sfr16 / sfr32 / sbit +__sfr / __sfr16 / __sfr32 / __sbit \emph default signify both a data-type and storage class, they are used to describe the @@ -19685,13 +20021,9 @@ \emph on r \emph default -egisters and -\emph on -s -\emph default -pecial +egisters and special \emph on -bit +__bit \emph default variables of a 8051, eg: \end_layout @@ -19704,16 +20036,6 @@ status collapsed \begin_layout Plain Layout -at -\end_layout - -\end_inset - - -\begin_inset Index -status collapsed - -\begin_layout Plain Layout \begin_inset ERT status collapsed @@ -19785,16 +20107,6 @@ status collapsed \begin_layout Plain Layout -at -\end_layout - -\end_inset - - -\begin_inset Index -status collapsed - -\begin_layout Plain Layout \begin_inset ERT status collapsed @@ -19856,7 +20168,7 @@ Special function registers which are located on an address dividable by 8 are bit-addressable, an \emph on -sbit +__sbit \emph default addresses a specific bit within these sfr. \begin_inset Newline newline @@ -19865,11 +20177,11 @@ 16 Bit and 32 bit special function register combinations which require a certain access order are better not declared using \emph on -sfr16 +__sfr16 \emph default or \emph on -sfr32. +__sfr32. \emph default Allthough SDCC usually accesses them Least Significant Byte (LSB) first, @@ -19908,7 +20220,7 @@ \family typewriter \begin_inset Marginal -status open +status collapsed \begin_layout Plain Layout @@ -20014,7 +20326,7 @@ \family typewriter /* pointer physically in internal ram pointing to object in external ram - */ + */ \begin_inset Newline newline \end_inset @@ -20027,7 +20339,7 @@ \end_inset /* pointer physically in external ram pointing to object in internal ram - */ + */ \begin_inset Newline newline \end_inset @@ -20039,7 +20351,7 @@ \begin_inset Newline newline \end_inset -/* pointer physically in code rom pointing to data in xdata space */ +/* pointer physically in code rom pointing to data in xdata space */ \begin_inset Newline newline \end_inset @@ -20051,7 +20363,7 @@ \begin_inset Newline newline \end_inset -/* pointer physically in code space pointing to data in code space */ +/* pointer physically in code space pointing to data in code space */ \begin_inset Newline newline \end_inset @@ -20106,7 +20418,6 @@ \begin_layout Standard Well you get the idea. - \begin_inset Newline newline \end_inset @@ -20119,7 +20430,6 @@ generic \emph default pointers. - \size small \begin_inset Newline newline @@ -20191,7 +20501,6 @@ \end_inset - Bytes 00-1F - 32 bytes to hold up to 4 banks of the registers R0 to R7, - \begin_inset Newline newline \end_inset @@ -20205,7 +20514,7 @@ \end_inset - variables and, + variables and, \begin_inset Newline newline \end_inset @@ -20402,7 +20711,7 @@ of registers (register bank 0), but it is possible to specify that other banks of registers (keyword \emph on -using +__using \emph default \emph on @@ -20852,10 +21161,6 @@ allocation, take a look at either the .map or .mem files to find out what the problem is. The .mem file may even suggest a solution to the problem. -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Subsection @@ -20873,17 +21178,7 @@ \end_layout \begin_layout Subsubsection -sfr -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -sfr -\end_layout - -\end_inset - - +__sfr \begin_inset Index status collapsed @@ -21056,16 +21351,6 @@ status collapsed \begin_layout Plain Layout -sfr -\end_layout - -\end_inset - - -\begin_inset Index -status collapsed - -\begin_layout Plain Layout \begin_inset ERT status collapsed @@ -21102,7 +21387,7 @@ \begin_layout Standard The keyword \emph on -banked +__banked \emph default is used to support 16 bit addresses in I/O memory e.g.: \end_layout @@ -21115,16 +21400,6 @@ status collapsed \begin_layout Plain Layout -at -\end_layout - -\end_inset - - -\begin_inset Index -status collapsed - -\begin_layout Plain Layout \begin_inset ERT status collapsed @@ -21205,7 +21480,7 @@ \begin_inset space ~ \end_inset -ld a,#0x01 +ld a,#0x01 \begin_inset Newline newline \end_inset @@ -21237,17 +21512,7 @@ \end_layout \begin_layout Subsubsection -sfr -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -sfr -\end_layout - -\end_inset - - +__sfr \begin_inset Index status collapsed @@ -21380,14 +21645,10 @@ \family default . If you include the file z180.h this will be set automatically. -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Subsection -HC08 Storage Class +HC08/S08 Storage Class \begin_inset Index status collapsed @@ -21401,17 +21662,7 @@ \end_layout \begin_layout Subsubsection -data -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -data (hc08 storage class) -\end_layout - -\end_inset - - +__data \begin_inset Index status collapsed @@ -21450,7 +21701,7 @@ \end_layout \begin_layout Standard -The data storage class declares a variable that resides in the first 256 +The __data storage class declares a variable that resides in the first 256 bytes of memory (the direct page). The HC08 \begin_inset Index @@ -21466,17 +21717,7 @@ \end_layout \begin_layout Subsubsection -xdata -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -xdata (hc08 storage class) -\end_layout - -\end_inset - - +__xdata \begin_inset Index status collapsed @@ -21515,14 +21756,10 @@ \end_layout \begin_layout Standard -The xdata storage class declares a variable that can reside anywhere in +The __xdata storage class declares a variable that can reside anywhere in memory. This is the default if no storage class is specified. -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Section @@ -21548,13 +21785,80 @@ This feature is only enabled when the compiler is invoked using --std-sdccxx. \end_layout -\begin_layout Standard -\begin_inset VSpace bigskip +\begin_layout Subsection +Named address spaces +\end_layout + +\begin_layout Standard +SDCC supports named address spaces. + See the Embedded C standard for more information on them. + So far SDCC only supports them for bank-switching. + You need to have a function that switches to the desired memory bank and + declare a corresponding named address space: +\end_layout + +\begin_layout Standard + +\family typewriter +\begin_inset listings +inline false +status collapsed + +\begin_layout Plain Layout + +void setb0(void); // The function that sets the currently active memory + bank to b0 +\end_layout + +\begin_layout Plain Layout + +void setb1(void); // The function that sets the currently active memory + bank to b1 +\end_layout + +\begin_layout Plain Layout + +__addressmod setb0 spaceb0; // Declare a named address space called spaceb0 + that uses setb0() +\end_layout + +\begin_layout Plain Layout + +__addressmod setb1 spaceb1; // Declare a named address space called spaceb1 + that uses setb1() +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout + +spaceb0 int x; // An int in address space spaceb0 +\end_layout + +\begin_layout Plain Layout + +spaceb1 int *y; // A pointer to an int in address space spaceb1 +\end_layout + +\begin_layout Plain Layout + +spaceb0 int *spaceb1 z; //A pointer in address space sapceb1 that points + to an int in address space spaceb0 +\end_layout + \end_inset \end_layout +\begin_layout Standard +SDCC will automatically insert calls to the correspionding function before + accessing the variable. + SDCC inserts the minimum possible number calls to the bank selection functions. +\end_layout + \begin_layout Section Absolute Addressing \begin_inset Index @@ -21572,7 +21876,7 @@ \begin_layout Standard Data items can be assigned an absolute address with the \emph on -at +__at \begin_inset Index status collapsed @@ -21950,7 +22254,7 @@ \begin_inset Newline newline \end_inset -unsigned char spi_io(unsigned char out_byte) +unsigned char spi_io(unsigned char out_byte) \begin_inset Newline newline \end_inset @@ -22030,7 +22334,7 @@ \begin_inset space ~ \end_inset -MOSI = out_byte & 0x80; +MOSI = out_byte & 0x80; \begin_inset Newline newline \end_inset @@ -22102,7 +22406,7 @@ \begin_inset space ~ \end_inset -MCLK = 1; +MCLK = 1; \begin_inset Newline newline \end_inset @@ -22206,7 +22510,7 @@ \begin_inset space ~ \end_inset -if(MISO) +if(MISO) \begin_inset Newline newline \end_inset @@ -22258,7 +22562,7 @@ \begin_inset space ~ \end_inset -out_byte += 1; +out_byte += 1; \begin_inset Newline newline \end_inset @@ -22294,7 +22598,7 @@ \begin_inset space ~ \end_inset -MCLK = 0; +MCLK = 0; \begin_inset Newline newline \end_inset @@ -22334,7 +22638,7 @@ \begin_inset space ~ \end_inset -return out_byte; +return out_byte; \begin_inset Newline newline \end_inset @@ -22533,10 +22837,6 @@ for example in a library. This is somehow similar to sbit, but only one absolute address has to be specified in the whole project. -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Section @@ -22700,7 +23000,7 @@ or by using the \emph on -reentrant +__reentrant \begin_inset Index status collapsed @@ -22718,7 +23018,7 @@ \begin_layout Verse \family typewriter -unsigned char foo(char i) __reentrant +unsigned char foo(char i) __reentrant \begin_inset Newline newline \end_inset @@ -22753,7 +23053,7 @@ \begin_layout Standard Since stack space on 8051 is limited, the \emph on -reentrant +__reentrant \emph default keyword or the \emph on @@ -22822,7 +23122,7 @@ \begin_layout Verse \family typewriter -unsigned char foo(__xdata int parm) +unsigned char foo(__xdata int parm) \begin_inset Newline newline \end_inset @@ -23152,7 +23452,7 @@ \begin_layout Verse \family typewriter -#pragma save +#pragma save \begin_inset Newline newline \end_inset @@ -23178,11 +23478,11 @@ \end_inset - + \begin_inset Newline newline \end_inset -void set_error(unsigned char errcd) +void set_error(unsigned char errcd) \begin_inset Newline newline \end_inset @@ -23214,7 +23514,7 @@ \begin_inset Newline newline \end_inset -#pragma restore +#pragma restore \begin_inset Newline newline \end_inset @@ -23297,7 +23597,6 @@ \end_inset ... - \begin_inset Newline newline \end_inset @@ -23325,10 +23624,6 @@ nooverlay ensures that the parameters and local variables for the function are NOT overlaid. -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Section @@ -23365,11 +23660,11 @@ \begin_layout Verse \family typewriter -void timer_isr (void) __interrupt (1) __using (1) +void timer_isr (void) __interrupt (1) __using (1) \begin_inset Newline newline \end_inset -{ +{ \begin_inset Newline newline \end_inset @@ -23390,7 +23685,6 @@ \end_inset ... - \begin_inset Newline newline \end_inset @@ -23400,7 +23694,7 @@ \begin_layout Standard The optional number following the \emph on -interrupt +__interrupt \begin_inset Index status collapsed @@ -23469,7 +23763,7 @@ . The optional (8051 specific) keyword \emph on -using +__using \begin_inset Index status collapsed @@ -23518,7 +23812,6 @@ \emph default can be used to tell the compiler to use the specified register bank when generating code for this function. - \begin_inset Newline newline \end_inset @@ -23991,10 +24284,6 @@ \end_inset about Functions using private register banks. -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Subsection @@ -24314,7 +24603,7 @@ \begin_layout Standard If the interrupt service routine is defined without \emph on -using +__using \begin_inset Index status collapsed @@ -24363,7 +24652,7 @@ \emph default a register bank or with register bank 0 ( \emph on -using +__using \emph default 0), the compiler will save the registers used by itself on the stack upon entry and restore them at exit, however if such an interrupt service routine @@ -24393,10 +24682,6 @@ . This scheme is recommended for larger interrupt service routines. -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Subsection @@ -24438,10 +24723,6 @@ \end_inset for details on customizing startup. -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Subsection @@ -24480,7 +24761,7 @@ To write an interrupt handler for the non-maskable interrupt, which needs a RETN instruction instead, add the \emph on -critical +__critical \emph default keyword: \end_layout @@ -24488,11 +24769,11 @@ \begin_layout Verse \family typewriter -void nmi_isr (void) critical interrupt +void nmi_isr (void) __critical __interrupt \begin_inset Newline newline \end_inset -{ +{ \begin_inset Newline newline \end_inset @@ -24513,7 +24794,6 @@ \end_inset ... - \begin_inset Newline newline \end_inset @@ -24524,15 +24804,11 @@ However if you need to create a non-interruptable interrupt service routine you would also require the \emph on -critical +__critical \emph default keyword. To distinguish between this and an nmi_isr you must provide an interrupt number. -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Section @@ -24547,7 +24823,7 @@ A special keyword may be associated with a block or a function declaring it as \emph on -critical +__critical \emph default . SDCC will generate code to disable all interrupts @@ -24623,11 +24899,11 @@ \end_inset - + \begin_inset Newline newline \end_inset -{ +{ \begin_inset Newline newline \end_inset @@ -24648,7 +24924,6 @@ \end_inset ... - \begin_inset Newline newline \end_inset @@ -24669,7 +24944,6 @@ \end_inset ... - \begin_inset Newline newline \end_inset @@ -24687,7 +24961,7 @@ The keyword \emph on -critical +__critical \emph default may also be used to disable interrupts more locally: \end_layout @@ -25305,9 +25579,35 @@ \end_layout \begin_layout Verse +or gor SDCC version 3.2.0 or newer: +\end_layout + +\begin_layout Verse \family typewriter -... +#define CLI asm ( +\begin_inset Quotes sld +\end_inset + +cli +\begin_inset Quotes srd +\end_inset + +); +\end_layout + +\begin_layout Verse + +\family typewriter +#define SEI asm ( +\begin_inset Quotes sld +\end_inset + +sei +\begin_inset Quotes srd +\end_inset + +); \end_layout \begin_layout Standard @@ -25479,7 +25779,7 @@ \end_inset - bit resource_is_free; + bit resource_is_free; \begin_inset Newline newline \end_inset @@ -25487,7 +25787,7 @@ \begin_inset Newline newline \end_inset -if (resource_is_free) +if (resource_is_free) \begin_inset Newline newline \end_inset @@ -25499,7 +25799,7 @@ \begin_inset space ~ \end_inset -{ +{ \begin_inset Newline newline \end_inset @@ -25519,7 +25819,7 @@ \begin_inset space ~ \end_inset -resource_is_free=0; +resource_is_free=0; \begin_inset Newline newline \end_inset @@ -25540,7 +25840,6 @@ \end_inset ... - \begin_inset Newline newline \end_inset @@ -25610,7 +25909,7 @@ Some architectures have support for quickly changing register sets. SDCC supports this feature with the \emph on -using +__using \begin_inset Index status collapsed @@ -25690,7 +25989,7 @@ \begin_layout Standard The \emph on -using +__using \emph default attribute will have no effect on the generated code for a \emph on @@ -25720,7 +26019,7 @@ \emph on (pending: Note, nowadays the \emph default - using + __using \emph on attribute has an effect on \emph default @@ -25794,10 +26093,6 @@ It is very inefficient to call a function using a different, non-zero bank from an ISR. -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Section @@ -28676,13 +28971,6 @@ is generated. \end_layout -\begin_layout Standard -\begin_inset VSpace bigskip -\end_inset - - -\end_layout - \begin_layout Subsection HC08 Startup Code \end_layout @@ -28699,10 +28987,6 @@ \end_inset startup code follows the same scheme as the MCS51 startup code. -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Subsection @@ -28770,14 +29054,17 @@ and provide your own crt0.rel. -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Section Inline Assembler Code +\begin_inset CommandInset label +LatexCommand label +name "sec:Inline-Assembler-Code" + +\end_inset + + \begin_inset Index status collapsed @@ -28791,6 +29078,159 @@ \end_layout \begin_layout Subsection +Inline Assemblere Code Formats +\end_layout + +\begin_layout Standard +SDCC supports two formats for inline assembler code definition: +\end_layout + +\begin_layout Subsubsection +Old __asm ... + __endasm; Format +\end_layout + +\begin_layout Standard +Most of inline assembler code examples in this manual use the old inline + assembler code format, but the new format could be used equivalently. +\end_layout + +\begin_layout Standard +Example: +\end_layout + +\begin_layout Verse + +\family typewriter +__asm +\family default + +\begin_inset Newline newline +\end_inset + + +\family typewriter + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + +; This is a comment +\begin_inset Newline newline +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + +label: +\begin_inset Newline newline +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + +nop +\begin_inset Newline newline +\end_inset + +__endasm; +\end_layout + +\begin_layout Subsubsection +New __asm__ ( +\begin_inset Quotes sld +\end_inset + +inline_assembler_code +\begin_inset Quotes srd +\end_inset + +) Format +\end_layout + +\begin_layout Standard +The __asm__ inline assembler code format was introduced in SDCC version + 3.2.0. +\end_layout + +\begin_layout Standard +Example: +\end_layout + +\begin_layout Verse + +\family typewriter +__asm__ ( +\begin_inset Quotes sld +\end_inset + +; This is a comment +\backslash +nlabel: +\backslash +n +\backslash +tnop +\begin_inset Quotes srd +\end_inset + +); +\end_layout + +\begin_layout Subsection A Step by Step Introduction \begin_inset CommandInset label LatexCommand label @@ -29566,7 +30006,7 @@ \begin_inset space ~ \end_inset -r2,dpl +r2,dpl \begin_inset Newline newline \end_inset @@ -29632,7 +30072,7 @@ \begin_inset space ~ \end_inset -a,_tail +a,_tail \begin_inset Newline newline \end_inset @@ -29660,7 +30100,7 @@ \begin_inset space ~ \end_inset -a +a \begin_inset Newline newline \end_inset @@ -29688,7 +30128,7 @@ \begin_inset space ~ \end_inset -r3,a +r3,a \begin_inset Newline newline \end_inset @@ -29716,7 +30156,7 @@ \begin_inset space ~ \end_inset -a,_head +a,_head \begin_inset Newline newline \end_inset @@ -29736,7 +30176,7 @@ \begin_inset space ~ \end_inset -cjne a,ar3,00106$ +cjne a,ar3,00106$ \begin_inset Newline newline \end_inset @@ -29760,7 +30200,7 @@ \begin_inset Newline newline \end_inset -00106$: +00106$: \begin_inset Newline newline \end_inset @@ -29802,7 +30242,7 @@ \begin_inset space ~ \end_inset -r3,_head +r3,_head \begin_inset Newline newline \end_inset @@ -29830,7 +30270,7 @@ \begin_inset space ~ \end_inset -_head +_head \begin_inset Newline newline \end_inset @@ -29858,7 +30298,7 @@ \begin_inset space ~ \end_inset -dpl,r3 +dpl,r3 \begin_inset Newline newline \end_inset @@ -29886,7 +30326,7 @@ \begin_inset space ~ \end_inset -dph,#(_buf >> 8) +dph,#(_buf >> 8) \begin_inset Newline newline \end_inset @@ -29914,7 +30354,7 @@ \begin_inset space ~ \end_inset -a,r2 +a,r2 \begin_inset Newline newline \end_inset @@ -29934,11 +30374,11 @@ \begin_inset space ~ \end_inset -movx @dptr,a +movx @dptr,a \begin_inset Newline newline \end_inset -00103$: +00103$: \begin_inset Newline newline \end_inset @@ -30295,7 +30735,6 @@ \end_inset ; save used registers here. - \begin_inset Newline newline \end_inset @@ -30332,7 +30771,6 @@ \end_inset ; If we were still using r2,r3 we would have to push them here. - \begin_inset Newline newline \end_inset @@ -30888,7 +31326,7 @@ \begin_inset space ~ \end_inset -; restore used registers here +; restore used registers here \begin_inset Newline newline \end_inset @@ -31463,7 +31901,7 @@ \begin_layout Standard A special keyword may be associated with a function declaring it as \emph on -_naked +__naked \begin_inset Index status collapsed @@ -32713,7 +33151,7 @@ \end_inset - + \begin_inset Newline newline \end_inset @@ -32753,11 +33191,11 @@ \begin_inset space ~ \end_inset -b,#10 +b,#10 \begin_inset Newline newline \end_inset -00001$: +00001$: \begin_inset Newline newline \end_inset @@ -32793,7 +33231,7 @@ \begin_inset space ~ \end_inset -b,00001$ +b,00001$ \begin_inset Newline newline \end_inset @@ -32875,7 +33313,7 @@ \begin_layout Verse \family typewriter -foo() { +foo() { \begin_inset Newline newline \end_inset @@ -32895,7 +33333,7 @@ \begin_inset space ~ \end_inset -/* some c code */ +/* some c code */ \begin_inset Newline newline \end_inset @@ -32915,7 +33353,7 @@ \begin_inset space ~ \end_inset -__asm +__asm \begin_inset Newline newline \end_inset @@ -32943,7 +33381,7 @@ \begin_inset space ~ \end_inset -; some assembler code +; some assembler code \begin_inset Newline newline \end_inset @@ -32971,7 +33409,7 @@ \begin_inset space ~ \end_inset -ljmp 0003$ +ljmp 0003$ \begin_inset Newline newline \end_inset @@ -32991,7 +33429,7 @@ \begin_inset space ~ \end_inset -__endasm; +__endasm; \begin_inset Newline newline \end_inset @@ -33011,7 +33449,7 @@ \begin_inset space ~ \end_inset -/* some more c code */ +/* some more c code */ \begin_inset Newline newline \end_inset @@ -33078,7 +33516,7 @@ \begin_inset space ~ \end_inset -0003$: ;label (can be referenced by inline assembler only) +0003$: ;label (can be referenced by inline assembler only) \begin_inset Newline newline \end_inset @@ -33155,7 +33593,7 @@ \end_inset - ; + ; \begin_inset Newline newline \end_inset @@ -33485,7 +33923,7 @@ , the caller will swap register banks around the call, if caller and callee use different register banks (having them defined by the \family typewriter -_using +__using \family default modifier). @@ -33635,7 +34073,38 @@ \begin_layout Verse \family typewriter -.globl _asm_func_PARM_2 +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + +.globl _asm_func_PARM_2 \begin_inset Newline newline \end_inset @@ -33671,7 +34140,7 @@ \begin_inset space ~ \end_inset -.globl _asm_func +.globl _asm_func \begin_inset Newline newline \end_inset @@ -33707,7 +34176,7 @@ \begin_inset space ~ \end_inset -.area OSEG +.area OSEG \begin_inset Newline newline \end_inset @@ -33747,7 +34216,7 @@ \begin_inset space ~ \end_inset -.ds 1 +.ds 1 \begin_inset Newline newline \end_inset @@ -33783,11 +34252,11 @@ \begin_inset space ~ \end_inset -.area CSEG +.area CSEG \begin_inset Newline newline \end_inset -_asm_func: +_asm_func: \begin_inset Newline newline \end_inset @@ -33839,7 +34308,7 @@ \begin_inset space ~ \end_inset -a,dpl +a,dpl \begin_inset Newline newline \end_inset @@ -33891,7 +34360,7 @@ \begin_inset space ~ \end_inset -a,_asm_func_PARM_2 +a,_asm_func_PARM_2 \begin_inset Newline newline \end_inset @@ -33943,7 +34412,7 @@ \begin_inset space ~ \end_inset -dpl,a +dpl,a \begin_inset Newline newline \end_inset @@ -34005,7 +34474,7 @@ \end_inset -,#0x00 +,#0x00 \begin_inset Newline newline \end_inset @@ -34167,7 +34636,7 @@ \begin_inset Newline newline \end_inset -{ +{ \begin_inset Newline newline \end_inset @@ -34187,11 +34656,11 @@ \begin_inset space ~ \end_inset -return asm_func(i,j,k); +return asm_func(i,j,k); \begin_inset Newline newline \end_inset -} +} \begin_inset Newline newline \end_inset @@ -34199,11 +34668,11 @@ \begin_inset Newline newline \end_inset -int main() +int main() \begin_inset Newline newline \end_inset -{ +{ \begin_inset Newline newline \end_inset @@ -34223,7 +34692,7 @@ \begin_inset space ~ \end_inset -return c_func(10,9,8); +return c_func(10,9,8); \begin_inset Newline newline \end_inset @@ -34237,11 +34706,11 @@ \begin_layout Verse \family typewriter -.globl _asm_func +.globl _asm_func \begin_inset Newline newline \end_inset -_asm_func: +_asm_func: \begin_inset Newline newline \end_inset @@ -34265,7 +34734,7 @@ \begin_inset space ~ \end_inset -_bp +_bp \begin_inset Newline newline \end_inset @@ -34449,7 +34918,7 @@ \begin_inset space ~ \end_inset -r0,a +r0,a \begin_inset Newline newline \end_inset @@ -34477,7 +34946,7 @@ \begin_inset space ~ \end_inset -a,_bp +a,_bp \begin_inset Newline newline \end_inset @@ -34553,7 +35022,7 @@ \begin_inset space ~ \end_inset -r1,a +r1,a \begin_inset Newline newline \end_inset @@ -34753,7 +35222,7 @@ \begin_inset space ~ \end_inset -dph,#0x00 +dph,#0x00 \begin_inset Newline newline \end_inset @@ -34781,7 +35250,7 @@ \begin_inset space ~ \end_inset -sp,_bp +sp,_bp \begin_inset Newline newline \end_inset @@ -34809,7 +35278,7 @@ \begin_inset space ~ \end_inset -_bp +_bp \begin_inset Newline newline \end_inset @@ -34852,13 +35321,6 @@ functions from Small-C. \end_layout -\begin_layout Standard -\begin_inset VSpace bigskip -\end_inset - - -\end_layout - \begin_layout Section int (16 bit) \begin_inset Index @@ -35965,10 +36427,6 @@ Also notice that you don't have to call this routines directly. The compiler will use them automatically every time a floating point operation is required. -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Section @@ -35988,10 +36446,21 @@ \begin_layout Standard \emph on - + +\begin_inset Flex URL +status collapsed + +\begin_layout Plain Layout + +http://sourceforge.net/apps/trac/sdcc/wiki/List%20of%20the%20SDCC%20library +\end_layout + +\end_inset + +> \end_layout \begin_layout Subsection @@ -36086,7 +36555,7 @@ \begin_layout Verse \family typewriter -void putchar (char c) { +void putchar (char c) { \begin_inset Newline newline \end_inset @@ -36300,7 +36769,7 @@ \emph on - \begin_inset ERT -status open +status collapsed \begin_layout Plain Layout @@ -37736,42 +38205,22 @@ \end_inset - included in SDCC should have a license at least as liberal as the GNU Lesser - General Public License + included in SDCC should have a license at least as liberal as the GPLv2+LE \begin_inset Index status collapsed \begin_layout Plain Layout -GNU Lesser General Public License, LGPL +GNUv2+LE \end_layout \end_inset - -\emph on -LGPL -\emph default . -\end_layout - -\begin_layout Standard -\begin_inset Note Note -status collapsed - -\begin_layout Plain Layout -license statements for the libraries are missing. - sdcc/device/lib/ser_ir.c -\end_layout - -\begin_layout Plain Layout -or _decdptr f.e. - come with a GPL (as opposed to LGPL) License - this will not be liberal - enough for many embedded programmers. -\end_layout - -\end_inset - - + Exception are pic device libraries and header files which are derived from + Microchip header (.inc) and linker script (.lkr) files. + Microchip requires that "The header files should state that they are only + to be used with authentic Microchip devices" which makes them incompatible + with GPL. \end_layout \begin_layout Standard @@ -37802,10 +38251,6 @@ enthusiastic, so don't expect a big hurray but as the mailing list is searchabl e these references are very valuable. Let's help to create a climate where information is shared. -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Section @@ -38184,7 +38629,6 @@ -model-large \emph default option, variables will by default be placed into the XDATA segment. - \begin_inset Newline newline \end_inset @@ -38576,7 +39020,11 @@ \end_inset . - See also the related keyword _naked + See also the related keyword +\emph on +__naked +\emph default + \begin_inset Index status collapsed @@ -39004,7 +39452,11 @@ table (e.g. for the autovector feature of the Cypress EZ-USB FX2). More elegantly this can be achieved by omitting the optional interrupt - number after the interrupt keyword, see section + number after the +\emph on +__interrupt +\emph default + keyword, see section \begin_inset CommandInset ref LatexCommand ref reference "sub:Interrupt-Service-Routines" @@ -40222,7 +40674,7 @@ \begin_inset Newline newline \end_inset -{ +{ \begin_inset Newline newline \end_inset @@ -40239,7 +40691,6 @@ \end_inset ... - \begin_inset Newline newline \end_inset @@ -40272,11 +40723,10 @@ \end_inset ... - \begin_inset Newline newline \end_inset -} +} \begin_inset Newline newline \end_inset @@ -40537,7 +40987,7 @@ \begin_inset space ~ \end_inset -/* save the current settings */ +/* save the current settings */ \begin_inset Newline newline \end_inset @@ -40583,7 +41033,7 @@ \begin_inset space ~ \end_inset -/* turnoff global subexpression elimination */ +/* turnoff global subexpression elimination */ \begin_inset Newline newline \end_inset @@ -40609,15 +41059,15 @@ \end_inset - /* turn off induction optimizations */ + /* turn off induction optimizations */ \begin_inset Newline newline \end_inset -int foo () +int foo () \begin_inset Newline newline \end_inset -{ +{ \begin_inset Newline newline \end_inset @@ -40630,7 +41080,6 @@ \end_inset ... - \begin_inset Newline newline \end_inset @@ -40642,7 +41091,7 @@ \begin_inset space ~ \end_inset - /* large code */ + /* large code */ \begin_inset Newline newline \end_inset @@ -40655,11 +41104,10 @@ \end_inset ... - \begin_inset Newline newline \end_inset -} +} \begin_inset Newline newline \end_inset @@ -40686,176 +41134,24 @@ \end_inset /* turn the optimizations back on */ -\end_layout - -\begin_layout Standard -The compiler will generate a warning message when extra space is allocated. - It is strongly recommended that the save and restore pragmas be used when - changing options for a function. -\begin_inset Newline newline -\end_inset - - -\begin_inset Newline newline -\end_inset - - -\begin_inset Newline newline -\end_inset - - -\end_layout - -\begin_layout Section -Defines Created by the Compiler -\end_layout - -\begin_layout Standard -The compiler creates the following #defines -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -# -\end_layout - -\end_inset - -defines -\end_layout - -\end_inset - - -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -Defines created by the compiler -\end_layout - -\end_inset - -: -\begin_inset Newline newline -\end_inset - - -\end_layout - -\begin_layout Standard -\begin_inset Tabular - - - - - - -\begin_inset Text - -\begin_layout Plain Layout - -\series bold -#define -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout - -\series bold -Description -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -SDCC -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -SDCC!Defines!SDCC (version macro) -\end_layout - -\end_inset - - -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -version macro -\end_layout - -\end_inset - - -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Always defined. - Since version 2.5.6 the version number as an int (ex. - 256) -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -SDCC_mcs51 -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -SDCC!Defines!SDCC -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -_ -\end_layout - -\end_inset +\end_layout -mcs51 +\begin_layout Standard +The compiler will generate a warning message when extra space is allocated. + It is strongly recommended that the save and restore pragmas be used when + changing options for a function. \end_layout -\end_inset +\begin_layout Section +Defines Created by the Compiler +\end_layout - or SDCC_ds390 +\begin_layout Standard +The compiler creates the following #defines \begin_inset Index status collapsed \begin_layout Plain Layout -SDCC!Defines!SDCC \begin_inset ERT status collapsed @@ -40863,49 +41159,58 @@ \backslash -_ +# \end_layout \end_inset -ds390 +defines \end_layout \end_inset - or SDCC_z80 -\begin_inset Index -status collapsed -\begin_layout Plain Layout -SDCC!Defines!SDCC -\begin_inset ERT +\begin_inset Index status collapsed \begin_layout Plain Layout - - -\backslash -_ +Defines created by the compiler \end_layout \end_inset -z80 +: +\begin_inset Newline newline +\end_inset + + \end_layout -\end_inset +\begin_layout Standard +\begin_inset Tabular + + + + + + +\begin_inset Text -, etc. +\begin_layout Plain Layout + +\series bold +#define \end_layout \end_inset - + \begin_inset Text \begin_layout Plain Layout -depending on the model used (e.g.: -mds390) + +\series bold +Description \end_layout \end_inset @@ -40916,59 +41221,57 @@ \begin_inset Text \begin_layout Plain Layout -__mcs51 +__SDCC \begin_inset Index status collapsed \begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -_ +SDCC!Defines!__SDCC (version macro) \end_layout \end_inset -\begin_inset ERT +\begin_inset Index status collapsed \begin_layout Plain Layout - - -\backslash -_ +version macro \end_layout \end_inset -mcs51 + \end_layout \end_inset - -, __ds390 -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -\begin_inset ERT -status collapsed + + +\begin_inset Text \begin_layout Plain Layout - - -\backslash -_ +Always defined. + Version number string (e.g. + SDCC_3_2_0 for sdcc 3.2.0). + In older versions SDCC was always defined instead. + From version 2.5.6 SDCC was the version number as an int (ex. + 256). \end_layout \end_inset + + + + +\begin_inset Text +\begin_layout Plain Layout +__SDCC_mcs51 +\begin_inset Index +status collapsed +\begin_layout Plain Layout +SDCC!Defines!__SDCC \begin_inset ERT status collapsed @@ -40981,16 +41284,17 @@ \end_inset -ds390 +mcs51 \end_layout \end_inset -, __hc08 + or __SDCC_ds390 \begin_inset Index status collapsed \begin_layout Plain Layout +SDCC!Defines!__SDCC \begin_inset ERT status collapsed @@ -41003,42 +41307,17 @@ \end_inset - -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -_ -\end_layout - -\end_inset - -hc08 +ds390 \end_layout \end_inset -, __z80 + or __SDCC_z80 \begin_inset Index status collapsed \begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -_ -\end_layout - -\end_inset - - +SDCC!Defines!__SDCC \begin_inset ERT status collapsed @@ -41056,7 +41335,7 @@ \end_inset -, etc +, etc. \end_layout \end_inset @@ -41065,8 +41344,9 @@ \begin_inset Text \begin_layout Plain Layout -depending on the model used (e.g. - -mz80) +depending on the model used (e.g.: -mds390). + Older versions used SDCC_mcs51, etc instead. + \end_layout \end_inset @@ -41077,7 +41357,7 @@ \begin_inset Text \begin_layout Plain Layout -SDCC_STACK_AUTO +__SDCC_STACK_AUTO \begin_inset Index status collapsed @@ -41150,7 +41430,7 @@ \begin_inset Text \begin_layout Plain Layout -SDCC_MODEL_SMALL +__SDCC_MODEL_SMALL \begin_inset Index status collapsed @@ -41223,7 +41503,7 @@ \begin_inset Text \begin_layout Plain Layout -SDCC_MODEL_MEDIUM +__SDCC_MODEL_MEDIUM \begin_inset Index status collapsed @@ -41296,7 +41576,7 @@ \begin_inset Text \begin_layout Plain Layout -SDCC_MODEL_LARGE +__SDCC_MODEL_LARGE \begin_inset Index status collapsed @@ -41369,7 +41649,7 @@ \begin_inset Text \begin_layout Plain Layout -SDCC_MODEL_HUGE +__SDCC_MODEL_HUGE \begin_inset Index status collapsed @@ -41442,7 +41722,7 @@ \begin_inset Text \begin_layout Plain Layout -SDCC_USE_XSTACK +__SDCC_USE_XSTACK \begin_inset Index status collapsed @@ -41515,7 +41795,7 @@ \begin_inset Text \begin_layout Plain Layout -SDCC_CHAR_UNSIGNED +__SDCC_CHAR_UNSIGNED \begin_inset Index status collapsed @@ -41588,7 +41868,7 @@ \begin_inset Text \begin_layout Plain Layout -SDCC_STACK_TENBIT +__SDCC_STACK_TENBIT \begin_inset Index status collapsed @@ -41648,7 +41928,7 @@ \begin_inset Text \begin_layout Plain Layout -SDCC_MODEL_FLAT24 +__SDCC_MODEL_FLAT24 \begin_inset Index status collapsed @@ -41708,7 +41988,7 @@ \begin_inset Text \begin_layout Plain Layout -SDCC_REVISION +__SDCC_REVISION \begin_inset Index status collapsed @@ -41741,7 +42021,8 @@ \begin_layout Plain Layout Always defined. - SDCC svn revision number + SDCC svn revision number. + Older versions of sdcc used SDCC_REVISION instead. \end_layout \end_inset @@ -41838,7 +42119,7 @@ \begin_inset Text \begin_layout Plain Layout -SDCC_FLOAT_REENT +__SDCC_FLOAT_REENT \begin_inset Index status collapsed @@ -41911,7 +42192,7 @@ \begin_inset Text \begin_layout Plain Layout -SDCC_INT_LONG_REENT +__SDCC_INT_LONG_REENT \begin_inset Index status collapsed @@ -42411,7 +42692,7 @@ To create a function that can be called from another bank it requires the keyword \emph on -banked +__banked \emph default \begin_inset Index @@ -42428,7 +42709,7 @@ needs it for a proper return. Called functions within the same bank as the caller do not need the \emph on -banked +__banked \emph default keyword nor do functions in the common area. Beware: SDCC does not know or check if functions are in the same bank. @@ -42505,13 +42786,6 @@ The linker will not check for overflows, again this is your responsibility. \end_layout -\begin_layout Standard -\begin_inset VSpace bigskip -\end_inset - - -\end_layout - \begin_layout Section DS400 port \end_layout @@ -42556,14 +42830,10 @@ . -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Section -The Z80, Z180, Rabbit 2000/3000 and GBZ80 ports +The Z80, Z180, Rabbit 2000/3000, Rabbit 3000A and GBZ80 ports \end_layout \begin_layout Standard @@ -42577,7 +42847,8 @@ \end_inset -, Z180, Rabbit 2000/3000 and the Nintendo GameBoy's Z80-like gbz80 +, Z180, Rabbit 2000/3000, Rabbit 3000A and LR35902, the Nintendo GameBoy's + Z80-like gbz80 \begin_inset Index status collapsed @@ -42588,7 +42859,7 @@ \end_inset . - The Z80 port is passed through the same + These ports passed through the same \emph on regressions tests \begin_inset Index @@ -42645,14 +42916,28 @@ The gbz80 port use the same set of registers for the return values, but in a different order of significance: E (one byte), DE (two bytes), or HLDE (four bytes). -\begin_inset VSpace bigskip -\end_inset +\end_layout + +\begin_layout Standard +When enabling optimizations using --opt-code size and a sufficiently high + value for --max-allocs-per-node sdcc typically generates much better code + for these architectures than any other compiler. + A comparison of compilers for these architecture can be found at +\begin_inset Flex URL +status collapsed + +\begin_layout Plain Layout +https://sourceforge.net/apps/trac/sdcc/wiki/z80%20code%20size +\end_layout + +\end_inset +. \end_layout \begin_layout Section -The HC08 port +The HC08 and S08 ports \end_layout \begin_layout Standard @@ -42666,16 +42951,24 @@ \end_inset - family has been added in October 2003, and is still undergoing some basic - development. - The code generator is complete, but the register allocation is still quite - unoptimized. - Some of the SDCC's standard C library functions have embedded non-HC08 - inline assembly and so are not yet usable. + and S08 does not yet generated code as compact as that generated by some + non-free compilers. + A comparison of compilers for these architecture can be found at +\begin_inset Flex URL +status collapsed + +\begin_layout Plain Layout + +https://sourceforge.net/apps/trac/sdcc/wiki/hc08%20code%20size +\end_layout + +\end_inset + +. \end_layout \begin_layout Standard -The HC08 port passes the regression test suite (see section +The HC08 and S08 ports pass the regression test suite (see section \begin_inset CommandInset ref LatexCommand ref reference "sec:Quality-control" @@ -42683,10 +42976,6 @@ \end_inset ). -\begin_inset VSpace bigskip -\end_inset - - \end_layout \begin_layout Section @@ -42777,12 +43066,12 @@ \end_layout \begin_layout Standard -16F: 716, 72, 73, 737, 74, 747, 76, 767, 77, 777, 785 +16F: 716, 72, 720, 721, 73, 737, 74, 747, 76, 767, 77, 777, 785 \end_layout \begin_layout Standard 16F: 818, 819, 84, 84a, 87, 870, 871, 872, 873, 873a, 874, 874a, 876, 876a, - 877, 877a, 88, 886, 887 + 877, 877a, 88, 882, 883, 884, 886, 887 \end_layout \begin_layout Standard @@ -42804,7 +43093,8 @@ \end_layout \begin_layout Standard -16F: 1455, 1458, 1459, 1507, 1782, 1783 +16F: 1455, 1458, 1459, 1503, 1507, 1508, 1509, 1516, 1517, 1518, 1519, 1526, + 1527, 1782, 1783 \end_layout \begin_layout Standard @@ -42812,7 +43102,7 @@ \end_layout \begin_layout Standard -16F: 1933, 1934, 1936, 1937, 1938, 1939 +16F: 1933, 1934, 1936, 1937, 1938, 1939, 1946, 1947 \end_layout \begin_layout Standard @@ -42906,7 +43196,7 @@ \begin_layout Standard Adding support for a new 14 \begin_inset ERT -status open +status collapsed \begin_layout Plain Layout @@ -42971,9 +43261,13 @@ \end_layout \begin_layout Standard -For the interrupt function, use the keyword `__interrupt' +For the interrupt function, use the keyword +\emph on +__interrupt +\emph default + \begin_inset Index -status collapsed +status open \begin_layout Plain Layout PIC14!interrupt @@ -43158,7 +43452,7 @@ -use-non-free \begin_inset Index -status open +status collapsed \begin_layout Plain Layout - @@ -43244,7 +43538,7 @@ \begin_inset space ~ \end_inset -sdcc -V --use-non-free -mpic14 -p16f877 -c $< +sdcc -V --use-non-free -mpic14 -p16f877 -c $< \begin_inset Newline newline \end_inset @@ -43252,7 +43546,7 @@ \begin_inset Newline newline \end_inset -$(PRJ).hex: $(OBJS) +$(PRJ).hex: $(OBJS) \begin_inset Newline newline \end_inset @@ -43338,7 +43632,7 @@ \begin_inset space ~ \end_inset -sdcc -S -V --use-non-free -mpic14 -p16f877 $< +sdcc -S -V --use-non-free -mpic14 -p16f877 $< \begin_inset Newline newline \end_inset @@ -43382,7 +43676,7 @@ \begin_inset Newline newline \end_inset -$(PRJ).hex: $(OBJS) +$(PRJ).hex: $(OBJS) \begin_inset Newline newline \end_inset @@ -43958,7 +44252,7 @@ This warning can usually be ignored due to the very good compatibility amongst 14 \begin_inset ERT -status open +status collapsed \begin_layout Plain Layout @@ -44022,15 +44316,6 @@ However, many smaller projects have successfully used SDCC in the past... \end_layout -\begin_layout Standard - -\size footnotesize -\begin_inset Newpage newpage -\end_inset - - -\end_layout - \begin_layout Section The PIC16 \begin_inset Index @@ -44084,7 +44369,7 @@ \end_layout \begin_layout Standard -18F: 1220, 1320, 13k50, 14k50 +18F: 1220, 1230, 1320, 1330, 13k50, 14k50 \end_layout \begin_layout Standard @@ -45027,7 +45312,7 @@ \begin_layout Standard \align center \begin_inset Tabular - + @@ -45056,12 +45341,12 @@ \begin_inset Text \begin_layout Plain Layout -SDCC_pic16 +__SDCC_pic16 \begin_inset Index status collapsed \begin_layout Plain Layout -SDCC!Defines!SDCC +SDCC!Defines!__SDCC \begin_inset ERT status collapsed @@ -45099,75 +45384,6 @@ \begin_inset Text \begin_layout Plain Layout -_ -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -/ -\end_layout - -\end_inset - -_pic16 -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -PIC16!Defines! -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -_ -\end_layout - -\end_inset - - -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -_ -\end_layout - -\end_inset - -pic16 -\end_layout - -\end_inset - - -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Port identification (same as above) -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout pic18fxxxx \begin_inset Index status collapsed @@ -45394,7 +45610,7 @@ \begin_inset Text \begin_layout Plain Layout -SDCC_MODEL_nnn +__SDCC_MODEL_nnn \end_layout \end_inset @@ -45453,6 +45669,10 @@ \end_inset port uses the following directories for searching header files and libraries. +\begin_inset Newline newline +\end_inset + + \end_layout \begin_layout Standard @@ -45840,10 +46060,6 @@ \end_inset The format is as follows: -\begin_inset Newline newline -\end_inset - - \end_layout \begin_layout LyX-Code @@ -45934,7 +46150,30 @@ \end_layout \begin_layout Description -library instructs the linker to use a library module. +library +\begin_inset Index +status collapsed + +\begin_layout Plain Layout +PIC16!Pragmas! +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +# +\end_layout + +\end_inset + +pragma library +\end_layout + +\end_inset + + instructs the linker to use a library module. \begin_inset Newline newline \end_inset @@ -46189,8 +46428,31 @@ \end_layout \begin_layout Description -udata The pragma udata instructs the compiler to emit code so that linker - will place a variable at a specific memory bank. +udata +\begin_inset Index +status collapsed + +\begin_layout Plain Layout +PIC16!Pragmas! +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +# +\end_layout + +\end_inset + +pragma udata +\end_layout + +\end_inset + + The pragma udata instructs the compiler to emit code so that linker will + place a variable at a specific memory bank. \end_layout \begin_layout LyX-Code @@ -46333,6 +46595,68 @@ the SECTION line in the linker script file. \end_layout +\begin_layout Description +config +\begin_inset Index +status collapsed + +\begin_layout Plain Layout +PIC16!Pragmas! +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +# +\end_layout + +\end_inset + +pragma config +\end_layout + +\end_inset + + The pragma config instructs the compiler to emit config directive. +\begin_inset Newline newline +\end_inset + +The format is as follows: +\end_layout + +\begin_layout LyX-Code +#pragma config setting=value [, setting=value] +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout Standard +Multiple settings may be defined on a single line, separated by commas. + Settings for a single configuration byte may also be defined on separate + lines. + +\end_layout + +\begin_layout LyX-Code +Example: +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +#pragma config CP0=OFF,OSCS=ON,OSC=LP,BOR=ON,BORV=25,WDT=ON,WDTPS=128,CCP2MUX=ON +\end_layout + +\begin_layout LyX-Code +#pragma config STVR=ON +\end_layout + \begin_layout Subsection Header Files and Libraries \begin_inset CommandInset label @@ -47328,7 +47652,7 @@ \end_layout \begin_layout Description -wparam +__wparam \begin_inset Index status collapsed @@ -47346,7 +47670,7 @@ \end_layout \begin_layout LyX-Code -void func_wparam(int a) wparam +void func_wparam(int a) __wparam \end_layout \begin_layout LyX-Code @@ -47371,7 +47695,7 @@ \end_layout \begin_layout Description -shadowregs +__shadowregs \begin_inset Index status collapsed @@ -47386,17 +47710,17 @@ registers. This can be done by adding the keyword \emph on -shadowregs +__shadowregs \emph default before the \emph on -interrupt +__interrupt \emph default keyword in the function's header. \end_layout \begin_layout LyX-Code -void isr_shadow(void) shadowregs interrupt 1 +void isr_shadow(void) __shadowregs __interrupt 1 \end_layout \begin_layout LyX-Code @@ -47414,7 +47738,7 @@ \begin_layout Standard \emph on -shadowregs +__shadowregs \emph default instructs the code generator not to store/restore WREG, STATUS, BSR when entering/exiting the ISR. @@ -47581,13 +47905,13 @@ service routine (ISR) is declared using the \emph on -interrupt +__interrupt \emph default keyword. \end_layout \begin_layout LyX-Code -void isr(void) interrupt +void isr(void) __interrupt \emph on n \end_layout @@ -48191,7 +48515,7 @@ \begin_inset Newline newline \end_inset -static __code char __at(__CONFIG1L) configword1l = +static __code char __at(__CONFIG1L) configword1l = \begin_inset Newline newline \end_inset @@ -48649,7 +48973,10 @@ \emph on putchar \emph default - is declared in stdio.h as having its parameter in WREG (it has the wparam + is declared in stdio.h as having its parameter in WREG (it has the +\emph on +__wparam +\emph default keyword). In stdio.h exists the macro PUTCHAR(arg) that defines the putchar function in a user-friendly way. @@ -48686,7 +49013,7 @@ \end_layout \begin_layout LyX-Code -} +} \begin_inset Newline newline \end_inset @@ -50516,7 +50843,7 @@ \begin_layout Standard \begin_inset Note Note -status open +status collapsed \begin_layout Plain Layout Check that the double quotes or an apostrophe within the command line survive @@ -50573,7 +50900,7 @@ \family typewriter (load-file sdcdbsrc.el) \family default - + \begin_inset Newline newline \end_inset @@ -50585,7 +50912,7 @@ The files can also be loaded dynamically while XEmacs is running, set the environment variable 'EMACSLOADPATH' to the installation bin directory (/bin), then enter the following command ESC-x load-file sdcdbsrc. - To start the interface enter the following command: + To start the interface enter the following command: \begin_inset Newline newline \end_inset @@ -50608,7 +50935,6 @@ \end_inset You will prompted to enter the file name to be debugged. - \begin_inset Newline newline \end_inset @@ -50651,7 +50977,7 @@ \begin_inset space ~ \end_inset -Current Listing :: +Current Listing :: \begin_inset Newline newline \end_inset @@ -50799,7 +51125,7 @@ \begin_inset space ~ \end_inset -Comment +Comment \begin_inset Newline newline \end_inset @@ -51059,7 +51385,7 @@ \begin_inset space ~ \end_inset -SDCDB next command +SDCDB next command \begin_inset Newline newline \end_inset @@ -51167,7 +51493,7 @@ \begin_inset space ~ \end_inset -SDCDB back command +SDCDB back command \begin_inset Newline newline \end_inset @@ -51383,7 +51709,7 @@ \begin_inset space ~ \end_inset -SDCDB step command +SDCDB step command \begin_inset Newline newline \end_inset @@ -51491,7 +51817,7 @@ \begin_inset space ~ \end_inset -SDCDB ptypecommand for data at +SDCDB ptypecommand for data at \begin_inset Newline newline \end_inset @@ -51683,7 +52009,7 @@ \begin_inset space ~ \end_inset -buffer point +buffer point \begin_inset Newline newline \end_inset @@ -51807,7 +52133,7 @@ \begin_inset space ~ \end_inset -SDCDB Delete all breakpoints if no arg +SDCDB Delete all breakpoints if no arg \begin_inset Newline newline \end_inset @@ -51999,7 +52325,7 @@ \begin_inset space ~ \end_inset -given or delete arg (C-u arg x) +given or delete arg (C-u arg x) \begin_inset Newline newline \end_inset @@ -52127,7 +52453,7 @@ \begin_inset space ~ \end_inset -SDCDB Display current frame if no arg, +SDCDB Display current frame if no arg, \begin_inset Newline newline \end_inset @@ -52319,7 +52645,7 @@ \begin_inset space ~ \end_inset -given or display frame arg +given or display frame arg \begin_inset Newline newline \end_inset @@ -52511,7 +52837,7 @@ \begin_inset space ~ \end_inset -buffer point +buffer point \begin_inset Newline newline \end_inset @@ -52619,7 +52945,7 @@ \begin_inset space ~ \end_inset -Goto the SDCDB output buffer +Goto the SDCDB output buffer \begin_inset Newline newline \end_inset @@ -52731,7 +53057,7 @@ \begin_inset space ~ \end_inset -SDCDB print command for data at +SDCDB print command for data at \begin_inset Newline newline \end_inset @@ -52923,7 +53249,7 @@ \begin_inset space ~ \end_inset -buffer point +buffer point \begin_inset Newline newline \end_inset @@ -53031,7 +53357,7 @@ \begin_inset space ~ \end_inset -Goto the SDCDB output buffer +Goto the SDCDB output buffer \begin_inset Newline newline \end_inset @@ -53163,11 +53489,11 @@ \begin_inset space ~ \end_inset -Toggles Sdcdbsrc mode (turns it off) +Toggles Sdcdbsrc mode (turns it off) \begin_inset Newline newline \end_inset -;; +;; \begin_inset Newline newline \end_inset @@ -53247,11 +53573,11 @@ \begin_inset space ~ \end_inset -SDCDB finish command +SDCDB finish command \begin_inset Newline newline \end_inset -;; +;; \begin_inset Newline newline \end_inset @@ -53371,7 +53697,7 @@ \begin_inset space ~ \end_inset -Set break for line with point +Set break for line with point \begin_inset Newline newline \end_inset @@ -53491,7 +53817,7 @@ \begin_inset space ~ \end_inset -Toggle Sdcdbsrc mode +Toggle Sdcdbsrc mode \begin_inset Newline newline \end_inset @@ -53599,21 +53925,11 @@ \begin_inset space ~ \end_inset -Toggle list mode -\begin_inset Newline newline -\end_inset - -;; +Toggle list mode \begin_inset Newline newline \end_inset - -\family default - -\begin_inset Newpage newpage -\end_inset - - +;; \end_layout \begin_layout Chapter @@ -53728,7 +54044,6 @@ (int) uc * (int) uc = (int) 0xfe * (int) 0xfe = (int) 0xfc04 = -1024 \family default . - \begin_inset Newline newline \end_inset @@ -54037,20 +54352,7 @@ status collapsed \begin_layout Plain Layout -̃ -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -/ -\end_layout - -\end_inset - - Operator +~ Operator \end_layout \end_inset @@ -55059,7 +55361,7 @@ \begin_inset Flex URL -status open +status collapsed \begin_layout Plain Layout @@ -57060,10 +57362,6 @@ \end_inset -\begin_inset Newline newline -\end_inset - - \end_layout \begin_layout Section @@ -58607,10 +58905,6 @@ \begin_layout Standard then SDCC is probably among the first choices. Well, probably SDCC might be the only choice. -\begin_inset Newpage newpage -\end_inset - - \end_layout \begin_layout Chapter @@ -58674,7 +58968,7 @@ \begin_layout Verse \family typewriter -i = x + y + 1; +i = x + y + 1; \begin_inset Newline newline \end_inset @@ -58688,11 +58982,11 @@ \begin_layout Verse \family typewriter -iTemp = x + y; +iTemp = x + y; \begin_inset Newline newline \end_inset -i = iTemp + 1; +i = iTemp + 1; \begin_inset Newline newline \end_inset @@ -58706,7 +59000,7 @@ \begin_layout Verse \family typewriter -a->b[i].c = 10; +a->b[i].c = 10; \begin_inset Newline newline \end_inset @@ -58721,11 +59015,11 @@ \begin_layout Verse \family typewriter -iTemp = a->b[i]; +iTemp = a->b[i]; \begin_inset Newline newline \end_inset -iTemp.c = 10; +iTemp.c = 10; \begin_inset Newline newline \end_inset @@ -58761,7 +59055,7 @@ \begin_inset Newline newline \end_inset -void f () { +void f () { \begin_inset Newline newline \end_inset @@ -58773,7 +59067,7 @@ \begin_inset space ~ \end_inset -int i; +int i; \begin_inset Newline newline \end_inset @@ -58805,7 +59099,7 @@ \begin_inset space ~ \end_inset -/* dead store */ +/* dead store */ \begin_inset Newline newline \end_inset @@ -58821,7 +59115,7 @@ \begin_inset space ~ \end_inset -/* dead store */ +/* dead store */ \begin_inset Newline newline \end_inset @@ -58833,7 +59127,7 @@ \begin_inset space ~ \end_inset -global = 2; +global = 2; \begin_inset Newline newline \end_inset @@ -58845,7 +59139,7 @@ \begin_inset space ~ \end_inset -return; +return; \begin_inset Newline newline \end_inset @@ -58861,7 +59155,7 @@ \begin_inset space ~ \end_inset -/* unreachable */ +/* unreachable */ \begin_inset Newline newline \end_inset @@ -58919,7 +59213,7 @@ \begin_layout Verse \family typewriter -int f() { +int f() { \begin_inset Newline newline \end_inset @@ -58931,7 +59225,7 @@ \begin_inset space ~ \end_inset -int i, j; +int i, j; \begin_inset Newline newline \end_inset @@ -58943,7 +59237,7 @@ \begin_inset space ~ \end_inset -i = 10; +i = 10; \begin_inset Newline newline \end_inset @@ -58955,7 +59249,7 @@ \begin_inset space ~ \end_inset -j = i; +j = i; \begin_inset Newline newline \end_inset @@ -58967,7 +59261,7 @@ \begin_inset space ~ \end_inset -return j; +return j; \begin_inset Newline newline \end_inset @@ -58981,7 +59275,7 @@ \begin_layout Verse \family typewriter -int f() { +int f() { \begin_inset Newline newline \end_inset @@ -58993,7 +59287,7 @@ \begin_inset space ~ \end_inset -int i, j; +int i, j; \begin_inset Newline newline \end_inset @@ -59005,7 +59299,7 @@ \begin_inset space ~ \end_inset -i = 10; +i = 10; \begin_inset Newline newline \end_inset @@ -59017,7 +59311,7 @@ \begin_inset space ~ \end_inset -j = 10; +j = 10; \begin_inset Newline newline \end_inset @@ -59029,7 +59323,7 @@ \begin_inset space ~ \end_inset -return 10; +return 10; \begin_inset Newline newline \end_inset @@ -59153,7 +59447,7 @@ \begin_layout Verse \family typewriter -for (i = 0 ; i < 100 ; i ++) +for (i = 0 ; i < 100 ; i ++) \begin_inset Newline newline \end_inset @@ -59183,11 +59477,11 @@ \begin_layout Verse \family typewriter -itemp = k + l; +itemp = k + l; \begin_inset Newline newline \end_inset -for (i = 0; i < 100; i++) +for (i = 0; i < 100; i++) \begin_inset Newline newline \end_inset @@ -59266,15 +59560,15 @@ \begin_layout Verse \family typewriter -itemp1 = 0; +itemp1 = 0; \begin_inset Newline newline \end_inset -itemp2 = 0; +itemp2 = 0; \begin_inset Newline newline \end_inset -for (i=0;i< 100;i++) { +for (i=0;i< 100;i++) { \begin_inset Newline newline \end_inset @@ -59294,7 +59588,7 @@ \begin_inset space ~ \end_inset -ar[itemp1] = itemp2; +ar[itemp1] = itemp2; \begin_inset Newline newline \end_inset @@ -59314,7 +59608,7 @@ \begin_inset space ~ \end_inset -itemp1 += 5; +itemp1 += 5; \begin_inset Newline newline \end_inset @@ -59334,7 +59628,7 @@ \begin_inset space ~ \end_inset -itemp2 += 3; +itemp2 += 3; \begin_inset Newline newline \end_inset @@ -59502,7 +59796,7 @@ \begin_inset space ~ \end_inset - i = j; + i = j; \begin_inset Newline newline \end_inset @@ -59550,7 +59844,7 @@ \begin_inset space ~ \end_inset - i >>= 1; + i >>= 1; \begin_inset Newline newline \end_inset @@ -59586,7 +59880,7 @@ \begin_inset space ~ \end_inset - i = 0; + i = 0; \begin_inset Newline newline \end_inset @@ -59791,7 +60085,7 @@ \begin_inset space ~ \end_inset -switch (i) { +switch (i) { \begin_inset Newline newline \end_inset @@ -59912,7 +60206,6 @@ \end_inset case 0: ... - \begin_inset Newline newline \end_inset @@ -60033,7 +60326,6 @@ \end_inset case 1: ... - \begin_inset Newline newline \end_inset @@ -60274,7 +60566,6 @@ \end_inset case 3: ... - \begin_inset Newline newline \end_inset @@ -60395,7 +60686,6 @@ \end_inset case 4: ... - \begin_inset Newline newline \end_inset @@ -60516,7 +60806,6 @@ \end_inset case 5: ... - \begin_inset Newline newline \end_inset @@ -60637,7 +60926,6 @@ \end_inset case 6: ... - \begin_inset Newline newline \end_inset @@ -60754,7 +61042,6 @@ \end_inset case 7: ... - \begin_inset Newline newline \end_inset @@ -60871,7 +61158,6 @@ \end_inset case 8: ... - \begin_inset Newline newline \end_inset @@ -61057,7 +61343,7 @@ \begin_layout Verse \family typewriter -switch (i) { +switch (i) { \begin_inset Newline newline \end_inset @@ -61070,7 +61356,6 @@ \end_inset case 1: ... - \begin_inset Newline newline \end_inset @@ -61083,7 +61368,6 @@ \end_inset case 2: ... - \begin_inset Newline newline \end_inset @@ -61096,7 +61380,6 @@ \end_inset case 3: ... - \begin_inset Newline newline \end_inset @@ -61109,7 +61392,6 @@ \end_inset case 4: ... - \begin_inset Newline newline \end_inset @@ -61122,7 +61404,6 @@ \end_inset case 5: ... - \begin_inset Newline newline \end_inset @@ -61135,7 +61416,6 @@ \end_inset case 6: ... - \begin_inset Newline newline \end_inset @@ -61148,7 +61428,6 @@ \end_inset case 7: ... - \begin_inset Newline newline \end_inset @@ -61161,7 +61440,6 @@ \end_inset case 101: ... - \begin_inset Newline newline \end_inset @@ -61174,7 +61452,6 @@ \end_inset case 102: ... - \begin_inset Newline newline \end_inset @@ -61187,7 +61464,6 @@ \end_inset case 103: ... - \begin_inset Newline newline \end_inset @@ -61200,7 +61476,6 @@ \end_inset case 104: ... - \begin_inset Newline newline \end_inset @@ -61213,7 +61488,6 @@ \end_inset case 105: ... - \begin_inset Newline newline \end_inset @@ -61226,7 +61500,6 @@ \end_inset case 106: ... - \begin_inset Newline newline \end_inset @@ -61239,7 +61512,6 @@ \end_inset case 107: ... - \begin_inset Newline newline \end_inset @@ -61253,7 +61525,7 @@ \begin_layout Verse \family typewriter -switch (i) { +switch (i) { \begin_inset Newline newline \end_inset @@ -61266,7 +61538,6 @@ \end_inset case 1: ... - \begin_inset Newline newline \end_inset @@ -61279,7 +61550,6 @@ \end_inset case 2: ... - \begin_inset Newline newline \end_inset @@ -61292,7 +61562,6 @@ \end_inset case 3: ... - \begin_inset Newline newline \end_inset @@ -61305,7 +61574,6 @@ \end_inset case 4: ... - \begin_inset Newline newline \end_inset @@ -61318,7 +61586,6 @@ \end_inset case 5: ... - \begin_inset Newline newline \end_inset @@ -61331,7 +61598,6 @@ \end_inset case 6: ... - \begin_inset Newline newline \end_inset @@ -61344,7 +61610,6 @@ \end_inset case 7: ... - \begin_inset Newline newline \end_inset @@ -61358,7 +61623,7 @@ \begin_layout Verse \family typewriter -switch (i) { +switch (i) { \begin_inset Newline newline \end_inset @@ -61371,7 +61636,6 @@ \end_inset case 101: ... - \begin_inset Newline newline \end_inset @@ -61384,7 +61648,6 @@ \end_inset case 102: ... - \begin_inset Newline newline \end_inset @@ -61397,7 +61660,6 @@ \end_inset case 103: ... - \begin_inset Newline newline \end_inset @@ -61410,7 +61672,6 @@ \end_inset case 104: ... - \begin_inset Newline newline \end_inset @@ -61423,7 +61684,6 @@ \end_inset case 105: ... - \begin_inset Newline newline \end_inset @@ -61436,7 +61696,6 @@ \end_inset case 106: ... - \begin_inset Newline newline \end_inset @@ -61449,7 +61708,6 @@ \end_inset case 107: ... - \begin_inset Newline newline \end_inset @@ -61558,11 +61816,10 @@ \end_inset ... - \begin_inset Newline newline \end_inset -i >>= 4; +i >>= 4; \begin_inset Newline newline \end_inset @@ -61580,11 +61837,11 @@ \begin_inset space ~ \end_inset - a,_i + a,_i \begin_inset Newline newline \end_inset -swap a +swap a \begin_inset Newline newline \end_inset @@ -61592,7 +61849,7 @@ \begin_inset space ~ \end_inset - a,#0x0f + a,#0x0f \begin_inset Newline newline \end_inset @@ -61611,16 +61868,15 @@ \begin_layout Verse \family typewriter -unsigned int i; +unsigned int i; \begin_inset Newline newline \end_inset ... - \begin_inset Newline newline \end_inset -i >>= 9; +i >>= 9; \begin_inset Newline newline \end_inset @@ -61642,7 +61898,7 @@ \begin_inset space ~ \end_inset -a,(_i + 1) +a,(_i + 1) \begin_inset Newline newline \end_inset @@ -61654,7 +61910,7 @@ \begin_inset space ~ \end_inset -(_i + 1),#0x00 +(_i + 1),#0x00 \begin_inset Newline newline \end_inset @@ -61666,7 +61922,7 @@ \begin_inset space ~ \end_inset -c +c \begin_inset Newline newline \end_inset @@ -61678,7 +61934,7 @@ \begin_inset space ~ \end_inset -a +a \begin_inset Newline newline \end_inset @@ -61779,18 +62035,17 @@ \begin_inset space ~ \end_inset -/* unsigned is needed for rotation */ +/* unsigned is needed for rotation */ \begin_inset Newline newline \end_inset ... - \begin_inset Newline newline \end_inset i = ((i << 1) | (i >> 7)); \family default - + \begin_inset Newline newline \end_inset @@ -61814,7 +62069,7 @@ \begin_inset space ~ \end_inset -a,_i +a,_i \begin_inset Newline newline \end_inset @@ -61830,7 +62085,7 @@ \begin_inset space ~ \end_inset -a +a \begin_inset Newline newline \end_inset @@ -61888,7 +62143,7 @@ \begin_inset space ~ \end_inset -char i; +char i; \begin_inset Newline newline \end_inset @@ -61904,12 +62159,11 @@ \begin_inset space ~ \end_inset -int j; +int j; \begin_inset Newline newline \end_inset ... - \begin_inset Newline newline \end_inset @@ -62052,7 +62306,7 @@ \begin_layout Verse \family typewriter -unsigned int gint; +unsigned int gint; \begin_inset Newline newline \end_inset @@ -62060,7 +62314,7 @@ \begin_inset Newline newline \end_inset -foo () { +foo () { \begin_inset Newline newline \end_inset @@ -62072,7 +62326,7 @@ \begin_inset space ~ \end_inset -unsigned char hob1, aob1; +unsigned char hob1, aob1; \begin_inset Newline newline \end_inset @@ -62084,7 +62338,7 @@ \begin_inset space ~ \end_inset -bit hob2, hob3, aob2, aob3; +bit hob2, hob3, aob2, aob3; \begin_inset Newline newline \end_inset @@ -62097,7 +62351,6 @@ \end_inset ... - \begin_inset Newline newline \end_inset @@ -62109,7 +62362,7 @@ \begin_inset space ~ \end_inset -hob1 = (gint >> 15) & 1; +hob1 = (gint >> 15) & 1; \begin_inset Newline newline \end_inset @@ -62121,7 +62374,7 @@ \begin_inset space ~ \end_inset -hob2 = (gint >> 15) & 1; +hob2 = (gint >> 15) & 1; \begin_inset Newline newline \end_inset @@ -62133,7 +62386,7 @@ \begin_inset space ~ \end_inset -hob3 = gint & 0x8000; +hob3 = gint & 0x8000; \begin_inset Newline newline \end_inset @@ -62145,7 +62398,7 @@ \begin_inset space ~ \end_inset -aob1 = (gint >> 9) & 1; +aob1 = (gint >> 9) & 1; \begin_inset Newline newline \end_inset @@ -62157,7 +62410,7 @@ \begin_inset space ~ \end_inset -aob2 = (gint >> 8) & 1; +aob2 = (gint >> 8) & 1; \begin_inset Newline newline \end_inset @@ -62169,7 +62422,7 @@ \begin_inset space ~ \end_inset -aob3 = gint & 0x0800; +aob3 = gint & 0x0800; \begin_inset Newline newline \end_inset @@ -62181,8 +62434,7 @@ \begin_inset space ~ \end_inset -.. - +... \begin_inset Newline newline \end_inset @@ -62299,7 +62551,7 @@ \begin_inset space ~ \end_inset - hob.c 7 + hob.c 7 \begin_inset Newline newline \end_inset @@ -62403,7 +62655,7 @@ \begin_inset space ~ \end_inset - a,(_gint + 1) + a,(_gint + 1) \begin_inset Newline newline \end_inset @@ -62523,7 +62775,7 @@ \begin_inset space ~ \end_inset - a + a \begin_inset Newline newline \end_inset @@ -62627,7 +62879,7 @@ \begin_inset space ~ \end_inset - a,#0x01 + a,#0x01 \begin_inset Newline newline \end_inset @@ -62731,7 +62983,7 @@ \begin_inset space ~ \end_inset - _foo_hob1_1_1,a + _foo_hob1_1_1,a \begin_inset Newline newline \end_inset @@ -62839,7 +63091,7 @@ \begin_inset space ~ \end_inset - hob.c 8 + hob.c 8 \begin_inset Newline newline \end_inset @@ -62943,7 +63195,7 @@ \begin_inset space ~ \end_inset - a,(_gint + 1) + a,(_gint + 1) \begin_inset Newline newline \end_inset @@ -63059,7 +63311,7 @@ \begin_inset space ~ \end_inset - a + a \begin_inset Newline newline \end_inset @@ -63163,7 +63415,7 @@ \begin_inset space ~ \end_inset - _foo_hob2_1_1,c + _foo_hob2_1_1,c \begin_inset Newline newline \end_inset @@ -63271,7 +63523,7 @@ \begin_inset space ~ \end_inset - hob.c 9 + hob.c 9 \begin_inset Newline newline \end_inset @@ -63375,7 +63627,7 @@ \begin_inset space ~ \end_inset - a,(_gint + 1) + a,(_gint + 1) \begin_inset Newline newline \end_inset @@ -63491,7 +63743,7 @@ \begin_inset space ~ \end_inset - a + a \begin_inset Newline newline \end_inset @@ -63595,7 +63847,7 @@ \begin_inset space ~ \end_inset - _foo_hob3_1_1,c + _foo_hob3_1_1,c \begin_inset Newline newline \end_inset @@ -63703,7 +63955,7 @@ \begin_inset space ~ \end_inset - hob.c 10 + hob.c 10 \begin_inset Newline newline \end_inset @@ -63807,7 +64059,7 @@ \begin_inset space ~ \end_inset - a,(_gint + 1) + a,(_gint + 1) \begin_inset Newline newline \end_inset @@ -63927,7 +64179,7 @@ \begin_inset space ~ \end_inset - a + a \begin_inset Newline newline \end_inset @@ -64031,7 +64283,7 @@ \begin_inset space ~ \end_inset - a,#0x01 + a,#0x01 \begin_inset Newline newline \end_inset @@ -64135,7 +64387,7 @@ \begin_inset space ~ \end_inset - _foo_aob1_1_1,a + _foo_aob1_1_1,a \begin_inset Newline newline \end_inset @@ -64243,7 +64495,7 @@ \begin_inset space ~ \end_inset - hob.c 11 + hob.c 11 \begin_inset Newline newline \end_inset @@ -64347,7 +64599,7 @@ \begin_inset space ~ \end_inset - a,(_gint + 1) + a,(_gint + 1) \begin_inset Newline newline \end_inset @@ -64463,7 +64715,7 @@ \begin_inset space ~ \end_inset - a + a \begin_inset Newline newline \end_inset @@ -64567,7 +64819,7 @@ \begin_inset space ~ \end_inset - _foo_aob2_1_1,c + _foo_aob2_1_1,c \begin_inset Newline newline \end_inset @@ -64675,7 +64927,7 @@ \begin_inset space ~ \end_inset - hob.c 12 + hob.c 12 \begin_inset Newline newline \end_inset @@ -64779,7 +65031,7 @@ \begin_inset space ~ \end_inset - a,(_gint + 1) + a,(_gint + 1) \begin_inset Newline newline \end_inset @@ -64883,7 +65135,7 @@ \begin_inset space ~ \end_inset - c,acc[3] + c,acc[3] \begin_inset Newline newline \end_inset @@ -64987,7 +65239,7 @@ \begin_inset space ~ \end_inset - _foo_aob3_1_1,c + _foo_aob3_1_1,c \end_layout \begin_layout Standard @@ -65046,11 +65298,11 @@ \begin_layout Verse \family typewriter -unsigned int gint; +unsigned int gint; \begin_inset Newline newline \end_inset -unsigned long int glong; +unsigned long int glong; \begin_inset Newline newline \end_inset @@ -65058,7 +65310,7 @@ \begin_inset Newline newline \end_inset -foo () { +foo () { \begin_inset Newline newline \end_inset @@ -65070,7 +65322,7 @@ \begin_inset space ~ \end_inset -unsigned char hob1, hob2; +unsigned char hob1, hob2; \begin_inset Newline newline \end_inset @@ -65082,7 +65334,7 @@ \begin_inset space ~ \end_inset -unsigned int how1, how2; +unsigned int how1, how2; \begin_inset Newline newline \end_inset @@ -65095,7 +65347,6 @@ \end_inset ... - \begin_inset Newline newline \end_inset @@ -65107,7 +65358,7 @@ \begin_inset space ~ \end_inset -hob1 = (gint >> 8) & 0xFF; +hob1 = (gint >> 8) & 0xFF; \begin_inset Newline newline \end_inset @@ -65119,7 +65370,7 @@ \begin_inset space ~ \end_inset -hob2 = glong >> 24; +hob2 = glong >> 24; \begin_inset Newline newline \end_inset @@ -65131,7 +65382,7 @@ \begin_inset space ~ \end_inset -how1 = (glong >> 16) & 0xFFFF; +how1 = (glong >> 16) & 0xFFFF; \begin_inset Newline newline \end_inset @@ -65143,7 +65394,7 @@ \begin_inset space ~ \end_inset -how2 = glong >> 8; +how2 = glong >> 8; \begin_inset Newline newline \end_inset @@ -65155,8 +65406,7 @@ \begin_inset space ~ \end_inset -.. - +... \begin_inset Newline newline \end_inset @@ -65273,7 +65523,7 @@ \begin_inset space ~ \end_inset - hob.c 15 + hob.c 15 \begin_inset Newline newline \end_inset @@ -65365,7 +65615,7 @@ \begin_inset space ~ \end_inset - _foo_hob1_1_1,(_gint + 1) + _foo_hob1_1_1,(_gint + 1) \begin_inset Newline newline \end_inset @@ -65473,7 +65723,7 @@ \begin_inset space ~ \end_inset - hob.c 16 + hob.c 16 \begin_inset Newline newline \end_inset @@ -65565,7 +65815,7 @@ \begin_inset space ~ \end_inset - _foo_hob2_1_1,(_glong + 3) + _foo_hob2_1_1,(_glong + 3) \begin_inset Newline newline \end_inset @@ -65673,7 +65923,7 @@ \begin_inset space ~ \end_inset - hob.c 17 + hob.c 17 \begin_inset Newline newline \end_inset @@ -65765,7 +66015,7 @@ \begin_inset space ~ \end_inset - _foo_how1_1_1,(_glong + 2) + _foo_how1_1_1,(_glong + 2) \begin_inset Newline newline \end_inset @@ -65857,7 +66107,7 @@ \begin_inset space ~ \end_inset - (_foo_how1_1_1 + 1),(_glong + 3) + (_foo_how1_1_1 + 1),(_glong + 3) \begin_inset Newline newline \end_inset @@ -65949,7 +66199,7 @@ \begin_inset space ~ \end_inset - _foo_how2_1_1,(_glong + 1) + _foo_how2_1_1,(_glong + 1) \begin_inset Newline newline \end_inset @@ -66041,7 +66291,7 @@ \begin_inset space ~ \end_inset - (_foo_how2_1_1 + 1),(_glong + 2) + (_foo_how2_1_1 + 1),(_glong + 2) \end_layout \begin_layout Standard @@ -66152,7 +66402,7 @@ \begin_layout Verse \family typewriter -replace { +replace { \begin_inset Newline newline \end_inset @@ -66164,7 +66414,7 @@ \begin_inset space ~ \end_inset -mov %1,a +mov %1,a \begin_inset Newline newline \end_inset @@ -66216,7 +66466,7 @@ \begin_layout Verse \family typewriter -mov r1,a +mov r1,a \begin_inset Newline newline \end_inset @@ -66245,7 +66495,7 @@ \begin_layout Verse \family typewriter -mov r1,a +mov r1,a \begin_inset Newline newline \end_inset @@ -66319,7 +66569,7 @@ \begin_layout Verse \family typewriter -replace { lcall %1 } by { acall %1 } +replace { lcall %1 } by { acall %1 } \begin_inset Newline newline \end_inset @@ -66400,7 +66650,7 @@ \family typewriter rule := replace [ restart ] '{' ' \backslash -n' +n' \begin_inset Newline newline \end_inset @@ -66462,7 +66712,7 @@ '}' by '{' ' \backslash -n' +n' \begin_inset Newline newline \end_inset @@ -66532,7 +66782,7 @@ ' \backslash -n' +n' \begin_inset Newline newline \end_inset @@ -66594,7 +66844,7 @@ '}' [if ] ' \backslash -n' +n' \end_layout \begin_layout Standard @@ -66620,7 +66870,7 @@ \begin_layout Verse \family typewriter -replace restart { +replace restart { \begin_inset Newline newline \end_inset @@ -66632,7 +66882,7 @@ \begin_inset space ~ \end_inset -pop %1 +pop %1 \begin_inset Newline newline \end_inset @@ -66644,7 +66894,7 @@ \begin_inset space ~ \end_inset -push %1 } by { +push %1 } by { \begin_inset Newline newline \end_inset @@ -66656,7 +66906,7 @@ \begin_inset space ~ \end_inset -; nop +; nop \begin_inset Newline newline \end_inset @@ -66672,15 +66922,15 @@ \begin_layout Verse \family typewriter -pop ar1 +pop ar1 \begin_inset Newline newline \end_inset -pop ar2 +pop ar2 \begin_inset Newline newline \end_inset -push ar2 +push ar2 \begin_inset Newline newline \end_inset @@ -66694,11 +66944,11 @@ \begin_layout Verse \family typewriter -pop ar1 +pop ar1 \begin_inset Newline newline \end_inset -; nop +; nop \begin_inset Newline newline \end_inset @@ -66717,7 +66967,7 @@ \begin_layout Verse \family typewriter -; nop +; nop \begin_inset Newline newline \end_inset @@ -66733,7 +66983,7 @@ \begin_layout Verse \family typewriter -replace { +replace { \begin_inset Newline newline \end_inset @@ -66749,7 +66999,7 @@ \begin_inset space ~ \end_inset -ljmp %5 +ljmp %5 \begin_inset Newline newline \end_inset @@ -66757,7 +67007,7 @@ \begin_inset Newline newline \end_inset -} by { +} by { \begin_inset Newline newline \end_inset @@ -66773,7 +67023,7 @@ \begin_inset space ~ \end_inset -sjmp %5 +sjmp %5 \begin_inset Newline newline \end_inset @@ -66995,19 +67245,19 @@ \family typewriter struct s { ... - }; + }; \begin_inset Newline newline \end_inset -struct s s1, s2; +struct s s1, s2; \begin_inset Newline newline \end_inset -foo() +foo() \begin_inset Newline newline \end_inset -{ +{ \begin_inset Newline newline \end_inset @@ -67028,7 +67278,6 @@ \end_inset ... - \begin_inset Newline newline \end_inset @@ -67048,7 +67297,7 @@ \begin_inset space ~ \end_inset -s1 = s2 ; /* is invalid in SDCC although allowed in ANSI */ +s1 = s2 ; /* is invalid in SDCC although allowed in ANSI */ \begin_inset Newline newline \end_inset @@ -67069,7 +67318,6 @@ \end_inset ... - \begin_inset Newline newline \end_inset @@ -67095,7 +67343,7 @@ \begin_inset Newline newline \end_inset -{ +{ \begin_inset Newline newline \end_inset @@ -67115,7 +67363,7 @@ \begin_inset space ~ \end_inset -struct s rets; +struct s rets; \begin_inset Newline newline \end_inset @@ -67136,7 +67384,6 @@ \end_inset ... - \begin_inset Newline newline \end_inset @@ -67156,7 +67403,7 @@ \begin_inset space ~ \end_inset -return rets; /* is invalid in SDCC although allowed in ANSI */ +return rets; /* is invalid in SDCC although allowed in ANSI */ \begin_inset Newline newline \end_inset @@ -67279,11 +67526,11 @@ \begin_layout Verse \family typewriter -foo(i,j) /* this old style of function declarations */ +foo(i,j) /* this old style of function declarations */ \begin_inset Newline newline \end_inset -int i,j; /* is valid in ANSI but not valid in SDCC */ +int i,j; /* is valid in ANSI but not valid in SDCC */ \begin_inset Newline newline \end_inset @@ -67418,53 +67665,11 @@ \series default command line options are used. - These may include (depending on the selected processor): 'at', 'banked', - 'bit', 'code', 'critical', 'data', 'eeprom', 'far', 'flash', 'idata', 'interrup -t', 'near', 'nonbanked', 'pdata', 'reentrant', 'sbit', 'sfr', 'shadowregs', - 'sram', 'using', 'wparam', 'xdata', '_overlay', '_asm', '_endasm', and - '_naked'. - The compiler displays a warning "keyword is deprecated, use '__' instead" in such cases. - The warning can be disabled by using "#pragma disable_warning 197" in the - source file or "--disable-warning 197" command line option. - Compliant equivalents of these keywords are always available in a form - that begin with two underscores -\begin_inset Index -status collapsed - -\begin_layout Plain Layout -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -_ -\end_layout - -\end_inset - - -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - - -\backslash -_ -\end_layout - -\end_inset - - (prefix for extended keywords) -\end_layout - -\end_inset - -, f.e. - '__data' instead of 'data' and '__asm' instead of '_asm'. + These may include (depending on the selected processor): '__at', '__banked', + '__bit', '__code', '__critical', '__data', '__eeprom', '__far', '__flash', + '__idata', '__interrupt', '__near', '__nonbanked', '__pdata', '__reentrant', + '__sbit', '__sfr', '__shadowregs', '__sram', '__using', '__wparam', '__xdata', + '__overlay', '__asm', '__endasm', and '__naked'. \end_layout \begin_layout Itemize @@ -67991,8 +68196,8 @@ August 2000 \series default . - It's a little outdated (the compiler is much more efficient now and user/develo -per friendly), but pretty well exposes the guts of it all. + It's outdated (the compiler is much more efficient now and user/developer + friendly), but pretty well exposes the guts of it all. \shape default \begin_inset Newline newline @@ -70235,7 +70440,7 @@ \begin_inset space ~ \end_inset -while (*x) *x++ = *p++; +while (*x) *x++ = *p++; \begin_inset Newline newline \end_inset @@ -70255,7 +70460,7 @@ \begin_inset space ~ \end_inset -sum = 0 ; +sum = 0 ; \begin_inset Newline newline \end_inset @@ -72222,7 +72427,8 @@ \end_layout \begin_layout Standard -This document was initially written by Sandeep Dutta +This document was initially written by Sandeep Dutta and updated bu SDCC + developers. \end_layout \begin_layout Standard diff -Nru sdcc-3.1.0+dfsg/sdas/as6808/Makefile.in sdcc-3.2.0+dfsg/sdas/as6808/Makefile.in --- sdcc-3.1.0+dfsg/sdas/as6808/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/as6808/Makefile.in 2012-01-03 09:28:29.000000000 +0000 @@ -49,7 +49,7 @@ ASXXLIBSRC = asdbg.c asdata.c asexpr.c aslex.c aslist.c asmain.c asout.c assubr.c assym.c sdas.c strcmpi.c ASXXLIBOBJS = $(ASXXLIBSRC:%.c=$(OBJDIR)/%.o) -SRC = m08ext.c m08pst.c m08mch.c m08adr.c +SRC = m08pst.c m08mch.c m08adr.c OBJS = $(SRC:%.c=$(OBJDIR)/%.o) ASSOURCES = $(SRC) $(ASXXLIBSRC:%.c=$(ASXXLIB)/%.c) $(UTILSRC:%.c=$(UTILLIB)/%.c) diff -Nru sdcc-3.1.0+dfsg/sdas/as6808/as_hc08.vcxproj sdcc-3.2.0+dfsg/sdas/as6808/as_hc08.vcxproj --- sdcc-3.1.0+dfsg/sdas/as6808/as_hc08.vcxproj 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/as6808/as_hc08.vcxproj 2012-01-03 09:28:29.000000000 +0000 @@ -197,12 +197,6 @@ %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) diff -Nru sdcc-3.1.0+dfsg/sdas/as6808/as_hc08.vcxproj.filters sdcc-3.2.0+dfsg/sdas/as6808/as_hc08.vcxproj.filters --- sdcc-3.1.0+dfsg/sdas/as6808/as_hc08.vcxproj.filters 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/as6808/as_hc08.vcxproj.filters 2012-01-03 09:28:29.000000000 +0000 @@ -47,9 +47,6 @@ Source Files - - Source Files - Source Files diff -Nru sdcc-3.1.0+dfsg/sdas/as6808/m08adr.c sdcc-3.2.0+dfsg/sdas/as6808/m08adr.c --- sdcc-3.1.0+dfsg/sdas/as6808/m08adr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/as6808/m08adr.c 2012-01-03 09:28:29.000000000 +0000 @@ -1,23 +1,27 @@ -/* m08adr.c +/* m08adr.c */ - Copyright (C) 1989-1995 Alan R. Baldwin - 721 Berkeley St., Kent, Ohio 44240 - -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, see . */ +/* + * Copyright (C) 1989-2009 Alan R. Baldwin + * + * 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, see . + * + * + * Alan R. Baldwin + * 721 Berkeley St. + * Kent, Ohio 44240 + */ -#include -#include #include "asxxxx.h" #include "m6808.h" @@ -54,8 +58,6 @@ } else if (c == '*') { expr(esp, 0); esp->e_mode = S_DIR; - if (esp->e_addr & ~0xFF) - err('d'); if (more()) { comma(1); tcp = ip; diff -Nru sdcc-3.1.0+dfsg/sdas/as6808/m08ext.c sdcc-3.2.0+dfsg/sdas/as6808/m08ext.c --- sdcc-3.1.0+dfsg/sdas/as6808/m08ext.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/as6808/m08ext.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -/* m08ext.c - - Copyright (C) 1989-1995 Alan R. Baldwin - 721 Berkeley St., Kent, Ohio 44240 - -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, see . */ - -#include -#include -#include "asxxxx.h" -#include "m6808.h" - -char *cpu = "Motorola 68HC08"; -int hilo = 1; -char *dsft = "asm"; diff -Nru sdcc-3.1.0+dfsg/sdas/as6808/m08mch.c sdcc-3.2.0+dfsg/sdas/as6808/m08mch.c --- sdcc-3.1.0+dfsg/sdas/as6808/m08mch.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/as6808/m08mch.c 2012-05-19 08:49:12.000000000 +0000 @@ -1,26 +1,36 @@ -/* m08mch.c +/* m08mch.c */ - Copyright (C) 1989-1995 Alan R. Baldwin - 721 Berkeley St., Kent, Ohio 44240 - -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, see . */ +/* + * Copyright (C) 1993-2009 Alan R. Baldwin + * + * 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, see . + * + * + * Alan R. Baldwin + * 721 Berkeley St. + * Kent, Ohio 44240 + */ -#include -#include #include "asxxxx.h" #include "m6808.h" +int allow_cs08_code; + +char *cpu = "Motorola 68HC(S)08"; +int hilo = 1; +char *dsft = "asm"; + /* * Process a machine op. */ @@ -38,7 +48,7 @@ clrexpr(&e1); clrexpr(&e2); clrexpr(&e3); - op = mp->m_valu; + op = (int) mp->m_valu; type = mp->m_type; switch (type) { @@ -77,7 +87,7 @@ expr(&e1, 0); outab(op); if (mchpcr(&e1)) { - v1 = e1.e_addr - dot.s_addr - 1; + v1 = (int) (e1.e_addr - dot.s_addr - 1); if ((v1 < -128) || (v1 > 127)) aerr(); outab(v1); @@ -205,7 +215,7 @@ outab(op + 2*(espv&0x07)); outrb(&e2, R3_PAG0); if (mchpcr(&e3)) { - v1 = e3.e_addr - dot.s_addr - 1; + v1 = (int) (e3.e_addr - dot.s_addr - 1); if ((v1 < -128) || (v1 > 127)) aerr(); outab(v1); @@ -221,7 +231,7 @@ if (t1 == S_IMMED) { outab(op); if (e1.e_flag == 0 && e1.e_base.e_ap == NULL) { - v1 = e1.e_addr; + v1 = (int) e1.e_addr; if ((v1 < -128) || (v1 > 127)) aerr(); outab(v1); @@ -234,15 +244,83 @@ break; case S_TYPHX: +// Code below from Gary Osborne (gary@s-4.com) +// G.O. +// This block of code was copied from a later version of the asxxxx assembler +// distribution. The later version supports the cs08. The SDCC version of +// the assembler did not. The cs08 ldhx, sthx, and cphx instructions allow +// more addressing modes than the hc08. That is the only difference in the +// instruction sets. + +// The new asxxxx assemblers have other nice features that could be retrofitted +// one day, but we can limp along without them for a few years yet. They +// are less important when the primary user writes in C. It would probably +// be easier to customize the new asxxxx files rather than try to upgrade +// the SDCC version. + t1 = addr(&e1); if (t1 == S_IMMED) { if (op == 0x25) - aerr(); + aerr(); outab(op); outrw(&e1, 0); break; } - if (t1 == S_DIR || t1 == S_EXT) { + if (allow_cs08_code) { + if (t1 == S_EXT) { + switch (op) { + default: + case 0x25: outab(0x96); break; + case 0x45: outab(0x32); break; + case 0x65: outab(0x3E); break; + } + outrw(&e1, 0); + break; + } + if ((t1 == S_SP1) || (t1 == S_SP2)) { + outab(0x9E); + switch (op) { + default: + case 0x25: outab(0xFF); break; + case 0x45: outab(0xFE); break; + case 0x65: outab(0xF3); break; + } + outrb(&e1, R3_USGN); + // The SDCC version of outrb() is not fully compatible. Work around it. + // Not an asxxxx error. + if (t1==S_SP2) { // ldhx 0x100,s etc should show error tag + aerr(); + } + break; + } + if ((t1 == S_IX) && (op == 0x45)) { + outab(0x9E); + outab(0xAE); + break; + } + if ((t1 == S_IX1) && (op == 0x45)) { + outab(0x9E); + outab(0xCE); + outrb(&e1, R3_USGN); + break; + } + if ((t1 == S_IX2) && (op == 0x45)) { + outab(0x9E); + outab(0xBE); + outrw(&e1, 0); + break; + } + } else { + if (t1 == S_EXT) { + t1 = S_DIR; + // The SDCC version of outrb() is not fully compatible. Work around it. + // Not an asxxxx error, at least not in the newer versions. + if (e1.e_addr > 0xFF) { + err('d'); + } + } + } + if (t1 == S_DIR) { outab(op | 0x10); outrb(&e1, R3_PAG0); break; @@ -250,6 +328,8 @@ aerr(); break; +// end G.O. + case S_CBEQ: t1 = addr(&e1); comma(1); @@ -282,7 +362,7 @@ break; } if (mchpcr(&e2)) { - v1 = e2.e_addr - dot.s_addr - 1; + v1 = (int) (e2.e_addr - dot.s_addr - 1); if ((v1 < -128) || (v1 > 127)) aerr(); outab(v1); @@ -302,7 +382,7 @@ outab(op); outrb(&e1, 0); if (mchpcr(&e2)) { - v1 = e2.e_addr - dot.s_addr - 1; + v1 = (int) (e2.e_addr - dot.s_addr - 1); if ((v1 < -128) || (v1 > 127)) aerr(); outab(v1); @@ -341,7 +421,7 @@ break; } if (mchpcr(&e2)) { - v1 = e2.e_addr - dot.s_addr - 1; + v1 = (int) (e2.e_addr - dot.s_addr - 1); if ((v1 < -128) || (v1 > 127)) aerr(); outab(v1); @@ -356,7 +436,7 @@ expr(&e1, 0); outab(op); if (mchpcr(&e1)) { - v1 = e1.e_addr - dot.s_addr - 1; + v1 = (int) (e1.e_addr - dot.s_addr - 1); if ((v1 < -128) || (v1 > 127)) aerr(); outab(v1); @@ -404,8 +484,13 @@ aerr(); break; + case X_CS08: + ++allow_cs08_code; + break; + default: err('o'); + break; } } @@ -455,4 +540,9 @@ VOID minit() { + /* + * Byte Order + */ + hilo = 1; + } diff -Nru sdcc-3.1.0+dfsg/sdas/as6808/m08pst.c sdcc-3.2.0+dfsg/sdas/as6808/m08pst.c --- sdcc-3.1.0+dfsg/sdas/as6808/m08pst.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/as6808/m08pst.c 2012-05-19 08:49:12.000000000 +0000 @@ -1,23 +1,27 @@ -/* m08pst.c +/* m08pst.c */ - Copyright (C) 1989-1995 Alan R. Baldwin - 721 Berkeley St., Kent, Ohio 44240 +/* + * Copyright (C) 1993-2009 Alan R. Baldwin + * + * 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, see . + * + * + * Alan R. Baldwin + * 721 Berkeley St. + * Kent, Ohio 44240 + */ -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, see . */ - -#include -#include #include "asxxxx.h" #include "m6808.h" @@ -40,35 +44,35 @@ { NULL, "LOAD", S_ATYP, 0, A_LOAD }, { NULL, "NOLOAD", S_ATYP, 0, A_NOLOAD }, + { NULL, ".page", S_PAGE, 0, 0 }, + { NULL, ".title", S_TITLE, 0, 0 }, + { NULL, ".sbttl", S_SBTL, 0, 0 }, + { NULL, ".module", S_MODUL, 0, 0 }, + { NULL, ".include", S_INCL, 0, 0 }, + { NULL, ".area", S_DAREA, 0, 0 }, + { NULL, ".org", S_ORG, 0, 0 }, + { NULL, ".radix", S_RADIX, 0, 0 }, + { NULL, ".globl", S_GLOBL, 0, 0 }, + { NULL, ".if", S_IF, 0, 0 }, + { NULL, ".else", S_ELSE, 0, 0 }, + { NULL, ".endif", S_ENDIF, 0, 0 }, { NULL, ".uleb128", S_ULEB128, 0, 0 }, { NULL, ".sleb128", S_SLEB128, 0, 0 }, { NULL, ".byte", S_BYTE, 0, 1 }, { NULL, ".db", S_BYTE, 0, 1 }, { NULL, ".word", S_WORD, 0, 2 }, { NULL, ".dw", S_WORD, 0, 2 }, - { NULL, ".ascii", S_ASCII, 0, 0 }, - { NULL, ".asciz", S_ASCIZ, 0, 0 }, { NULL, ".blkb", S_BLK, 0, 1 }, { NULL, ".ds", S_BLK, 0, 1 }, { NULL, ".blkw", S_BLK, 0, 2 }, - { NULL, ".page", S_PAGE, 0, 0 }, - { NULL, ".title", S_TITLE, 0, 0 }, - { NULL, ".sbttl", S_SBTL, 0, 0 }, - { NULL, ".globl", S_GLOBL, 0, 0 }, - { NULL, ".area", S_DAREA, 0, 0 }, - { NULL, ".even", S_EVEN, 0, 0 }, - { NULL, ".odd", S_ODD, 0, 0 }, - { NULL, ".if", S_IF, 0, 0 }, - { NULL, ".else", S_ELSE, 0, 0 }, - { NULL, ".endif", S_ENDIF, 0, 0 }, - { NULL, ".include", S_INCL, 0, 0 }, - { NULL, ".radix", S_RADIX, 0, 0 }, - { NULL, ".org", S_ORG, 0, 0 }, - { NULL, ".module", S_MODUL, 0, 0 }, + { NULL, ".ascii", S_ASCII, 0, 0 }, { NULL, ".ascis", S_ASCIS, 0, 0 }, + { NULL, ".asciz", S_ASCIZ, 0, 0 }, /* sdas specific */ { NULL, ".optsdcc", S_OPTSDCC, 0, 0 }, /* end sdas specific */ + { NULL, ".even", S_EVEN, 0, 0 }, + { NULL, ".odd", S_ODD, 0, 0 }, // { NULL, ".assume", S_ERROR, 0, 0 }, // { NULL, ".error", S_ERROR, 0, 1 }, @@ -207,5 +211,10 @@ { NULL, "sei", S_INH, 0, 0x9B }, { NULL, "rsp", S_INH, 0, 0x9C }, { NULL, "nop", S_INH, 0, 0x9D }, - { NULL, "txa", S_INH, S_END, 0x9F } + { NULL, "txa", S_INH, 0, 0x9F}, + + /* S08/CS08/HCS08/68HCS08 */ + + { NULL, ".cs08", X_CS08, S_EOL, 0 } }; + diff -Nru sdcc-3.1.0+dfsg/sdas/as6808/m6808.h sdcc-3.2.0+dfsg/sdas/as6808/m6808.h --- sdcc-3.1.0+dfsg/sdas/as6808/m6808.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/as6808/m6808.h 2012-06-28 14:09:28.000000000 +0000 @@ -1,20 +1,26 @@ -/* m6808.h +/* m6808.h */ - Copyright (C) 1989-1995 Alan R. Baldwin - 721 Berkeley St., Kent, Ohio 44240 - -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, see . */ +/* + * Copyright (C) 1993-2009 Alan R. Baldwin + * + * 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, see . + * + * + * Alan R. Baldwin + * 721 Berkeley St. + * Kent, Ohio 44240 + */ /*)BUILD $(PROGRAM) = AS6808 @@ -23,11 +29,11 @@ M6808.H } $(FILES) = { - M08EXT.C M08MCH.C M08ADR.C M08PST.C ASMAIN.C + ASDBG.C ASLEX.C ASSYM.C ASSUBR.C @@ -82,10 +88,30 @@ #define S_DZAX 71 #define S_MOV 72 +#define S_INH8 73 +#define S_INH8S 74 +#define S_BRA8 75 + /* - * Set Direct Pointer + * Special Types */ #define S_SDP 80 +#define S_CPU 81 + +/* + * CS08 Instructions + */ +#define X_CS08 90 + +/* + * Processor Types (S_CPU) + */ +#define X_HC08 0 +#define X_HCS08 1 +#define X_6805 2 +#define X_HC05 3 + + /* machine dependent functions */ @@ -100,10 +126,8 @@ extern int srch(char *str); /* m08mch.c */ -extern VOID machine(struct mne *mp); extern int chkindx(struct expr *exp); extern int mchpcr(struct expr *esp); -extern VOID minit(void); #else @@ -115,10 +139,8 @@ extern int srch(); /* m08mch.c */ -extern VOID machine(); extern int chkindx(); extern int mchpcr(); -extern VOID minit(); #endif diff -Nru sdcc-3.1.0+dfsg/sdas/as8051/i51adr.c sdcc-3.2.0+dfsg/sdas/as8051/i51adr.c --- sdcc-3.1.0+dfsg/sdas/as8051/i51adr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/as8051/i51adr.c 2011-12-18 17:44:59.000000000 +0000 @@ -1,28 +1,33 @@ -/* i51adr.c - - Copyright (C) 1989-1995 Alan R. Baldwin - 721 Berkeley St., Kent, Ohio 44240 - -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, see . */ +/* i51adr.c */ /* - * Ported from 8085 to 8051 by John Hartman 30-Apr-1995 - * Continued, 29-May-95 + * Copyright (C) 1998-2009 Alan R. Baldwin + * + * 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, see . + * + * + * Alan R. Baldwin + * 721 Berkeley St. + * Kent, Ohio 44240 + * + * This Assember Ported by + * John L. Hartman (JLH) + * jhartman at compuserve dot com + * noice at noicedebugger dot com + * */ -#include -#include #include "asxxxx.h" #include "i8051.h" @@ -46,8 +51,7 @@ /* Classify argument as to address mode */ int -addr(esp) -struct expr *esp; +addr(struct expr *esp) { int c; unsigned rd; @@ -138,6 +142,7 @@ } } else { /* Must be an expression */ + esp->e_addr = 0; expr(esp, 0); if ((!esp->e_flag) && (esp->e_base.e_ap==NULL) @@ -157,11 +162,10 @@ * -1 for no match. */ int -admode(sp) -register struct adsym *sp; +admode(struct adsym *sp) { - register char *ptr; - register int i; + char *ptr; + int i; unget(getnb()); i = 0; while ( *(ptr = &sp[i].a_str[0]) ) { @@ -177,8 +181,7 @@ * srch --- does string match ? */ int -srch(str) -char *str; +srch(char *str) { char *ptr; ptr = ip; @@ -206,9 +209,7 @@ * any --- does str contain c? */ int -any(c,str) -int c; -char *str; +any(int c, char *str) { while (*str) if(*str++ == c) @@ -220,7 +221,7 @@ * Read a register name. Return register value, -1 if no register found */ int -reg() +reg(void) { struct mne *mp; char id[NCPS]; diff -Nru sdcc-3.1.0+dfsg/sdas/as8051/i51mch.c sdcc-3.2.0+dfsg/sdas/as8051/i51mch.c --- sdcc-3.1.0+dfsg/sdas/as8051/i51mch.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/as8051/i51mch.c 2011-12-18 17:44:59.000000000 +0000 @@ -1,28 +1,33 @@ -/* i85mch.c - - Copyright (C) 1989-1995 Alan R. Baldwin - 721 Berkeley St., Kent, Ohio 44240 - -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, see . */ +/* i51mch.c */ /* - * 28-Oct-97 Ported from 8085 to 8051 by John Hartman + * Copyright (C) 1998-2009 Alan R. Baldwin + * + * 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, see . + * + * + * Alan R. Baldwin + * 721 Berkeley St. + * Kent, Ohio 44240 + * + * This Assember Ported by + * John L. Hartman (JLH) + * jhartman at compuserve dot com + * noice at noicedebugger dot com + * */ -#include -#include -#include #include "asxxxx.h" #include "i8051.h" @@ -30,11 +35,10 @@ * Process machine ops. */ VOID -machine(mp) -struct mne *mp; +machine(struct mne *mp) { - register unsigned op; - register int t, t1, v1; + unsigned op; + int t, t1, v1; struct expr e, e1; clrexpr(&e); @@ -489,6 +493,7 @@ default: aerr(); + break; } /* branch destination */ @@ -684,6 +689,7 @@ case S_AT_R: outab(op + e1.e_addr); break; + default: aerr(); } @@ -698,8 +704,7 @@ * Branch/Jump PCR Mode Check */ int -mchpcr(esp) -struct expr *esp; +mchpcr(struct expr *esp) { if (esp->e_base.e_ap == dot.s_area) { return(1); @@ -719,14 +724,14 @@ return(0); } - /* - * Machine specific initialization - */ +/* + * Machine specific initialization + */ -static int beenHere=0; /* set non-zero if we have done that... */ +static int beenHere = 0; /* set non-zero if we have done that... */ VOID -minit() +minit(void) { struct sym *sp; struct PreDef *pd; diff -Nru sdcc-3.1.0+dfsg/sdas/as8051/i51pst.c sdcc-3.2.0+dfsg/sdas/as8051/i51pst.c --- sdcc-3.1.0+dfsg/sdas/as8051/i51pst.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/as8051/i51pst.c 2011-12-18 17:44:59.000000000 +0000 @@ -1,147 +1,157 @@ -/* i85pst.c - - Copyright (C) 1989-1995 Alan R. Baldwin - 721 Berkeley St., Kent, Ohio 44240 - -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, see . */ +/* i51pst.c */ /* - * 28-Oct-97 Ported from 8085 to 8051 by John Hartman - * 30-Jan-98 JLH: add memory-space flags for .AREA + * Copyright (C) 1998-2009 Alan R. Baldwin + * + * 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, see . + * + * + * Alan R. Baldwin + * 721 Berkeley St. + * Kent, Ohio 44240 + * + * This Assember Ported by + * John L. Hartman (JLH) + * jhartman at compuserve dot com + * noice at noicedebugger dot com + * */ -#include -#include #include "asxxxx.h" #include "i8051.h" +/* + * Mnemonic Structure + */ struct mne mne[] = { /* machine */ /* system */ - { NULL, "CON", S_ATYP, 0, A3_CON}, - { NULL, "OVR", S_ATYP, 0, A3_OVR}, - { NULL, "REL", S_ATYP, 0, A3_REL}, - { NULL, "ABS", S_ATYP, 0, A3_ABS}, - { NULL, "NOPAG", S_ATYP, 0, A3_NOPAG}, - { NULL, "PAG", S_ATYP, 0, A3_PAG}, - - { NULL, "CODE", S_ATYP, 0, A_CODE}, - { NULL, "DATA", S_ATYP, 0, A_DATA}, - { NULL, "XDATA", S_ATYP, 0, A_XDATA}, - { NULL, "BIT", S_ATYP, 0, A_BIT}, - - { NULL, ".byte", S_BYTE, 0, 0}, - { NULL, ".db", S_BYTE, 0, 0}, - { NULL, ".word", S_WORD, 0, 0}, - { NULL, ".dw", S_WORD, 0, 0}, - { NULL, ".ascii", S_ASCII, 0, 0}, - { NULL, ".asciz", S_ASCIZ, 0, 0}, - { NULL, ".blkb", S_BLK, 0, 1}, - { NULL, ".ds", S_BLK, 0, 1}, - { NULL, ".blkw", S_BLK, 0, 2}, - { NULL, ".page", S_PAGE, 0, 0}, - { NULL, ".title", S_TITLE, 0, 0}, - { NULL, ".sbttl", S_SBTL, 0, 0}, - { NULL, ".globl", S_GLOBL, 0, 0}, - { NULL, ".area", S_DAREA, 0, 0}, - { NULL, ".even", S_EVEN, 0, 0}, - { NULL, ".odd", S_ODD, 0, 0}, - { NULL, ".if", S_IF, 0, 0}, - { NULL, ".else", S_ELSE, 0, 0}, - { NULL, ".endif", S_ENDIF, 0, 0}, - { NULL, ".include", S_INCL, 0, 0}, - { NULL, ".radix", S_RADIX, 0, 0}, - { NULL, ".org", S_ORG, 0, 0}, - { NULL, ".module", S_MODUL, 0, 0}, - { NULL, ".ascis", S_ASCIS, 0, 0}, - { NULL, ".flat24", S_FLAT24, 0, 0}, + { NULL, "CON", S_ATYP, 0, A3_CON }, + { NULL, "OVR", S_ATYP, 0, A3_OVR }, + { NULL, "REL", S_ATYP, 0, A3_REL }, + { NULL, "ABS", S_ATYP, 0, A3_ABS }, + { NULL, "NOPAG", S_ATYP, 0, A3_NOPAG }, + { NULL, "PAG", S_ATYP, 0, A3_PAG }, + + { NULL, "CODE", S_ATYP, 0, A_CODE }, + { NULL, "DATA", S_ATYP, 0, A_DATA }, + { NULL, "XDATA", S_ATYP, 0, A_XDATA }, + { NULL, "BIT", S_ATYP, 0, A_BIT }, + + { NULL, ".page", S_PAGE, 0, 0 }, + { NULL, ".title", S_TITLE, 0, 0 }, + { NULL, ".sbttl", S_SBTL, 0, 0 }, + { NULL, ".module", S_MODUL, 0, 0 }, + { NULL, ".include", S_INCL, 0, 0 }, + { NULL, ".area", S_DAREA, 0, 0 }, + { NULL, ".org", S_ORG, 0, 0 }, + { NULL, ".radix", S_RADIX, 0, 0 }, + { NULL, ".globl", S_GLOBL, 0, 0 }, + { NULL, ".if", S_IF, 0, 0 }, + { NULL, ".else", S_ELSE, 0, 0 }, + { NULL, ".endif", S_ENDIF, 0, 0 }, + + { NULL, ".flat24", S_FLAT24, 0, 0 }, /* sdas specific */ - { NULL, ".optsdcc", S_OPTSDCC, 0, 0}, + { NULL, ".optsdcc", S_OPTSDCC, 0, 0 }, /* end sdas specific */ + { NULL, ".byte", S_BYTE, 0, 0 }, + { NULL, ".db", S_BYTE, 0, 0 }, + { NULL, ".word", S_WORD, 0, 0 }, + { NULL, ".dw", S_WORD, 0, 0 }, + { NULL, ".ascii", S_ASCII, 0, 0 }, + { NULL, ".ascis", S_ASCIS, 0, 0 }, + { NULL, ".asciz", S_ASCIZ, 0, 0 }, + { NULL, ".blkb", S_BLK, 0, 1 }, + { NULL, ".ds", S_BLK, 0, 1 }, + { NULL, ".blkw", S_BLK, 0, 2 }, + { NULL, ".even", S_EVEN, 0, 0 }, + { NULL, ".odd", S_ODD, 0, 0 }, /* 8051 */ + /* machine */ - { NULL, "a", S_A, 0, A}, - { NULL, "ab", S_AB, 0, 0}, - { NULL, "dptr", S_DPTR, 0, DPTR}, - { NULL, "pc", S_PC, 0, PC}, - { NULL, "r0", S_REG, 0, R0}, - { NULL, "r1", S_REG, 0, R1}, - { NULL, "r2", S_REG, 0, R2}, - { NULL, "r3", S_REG, 0, R3}, - { NULL, "r4", S_REG, 0, R4}, - { NULL, "r5", S_REG, 0, R5}, - { NULL, "r6", S_REG, 0, R6}, - { NULL, "r7", S_REG, 0, R7}, - - { NULL, "nop", S_INH, 0, 0x00}, - { NULL, "ret", S_INH, 0, 0x22}, - { NULL, "reti", S_INH, 0, 0x32}, - - { NULL, "ajmp", S_JMP11, 0, 0x01}, - { NULL, "acall", S_JMP11, 0, 0x11}, - { NULL, "ljmp", S_JMP16, 0, 0x02}, - { NULL, "lcall", S_JMP16, 0, 0x12}, - - { NULL, "rr", S_ACC, 0, 0x03}, - { NULL, "rrc", S_ACC, 0, 0x13}, - { NULL, "rl", S_ACC, 0, 0x23}, - { NULL, "rlc", S_ACC, 0, 0x33}, - { NULL, "swap", S_ACC, 0, 0xC4}, - { NULL, "da", S_ACC, 0, 0xD4}, - - { NULL, "inc", S_TYP1, 0, 0x00}, - { NULL, "dec", S_TYP1, 0, 0x10}, - - { NULL, "add", S_TYP2, 0, 0x20}, - { NULL, "addc", S_TYP2, 0, 0x30}, - { NULL, "subb", S_TYP2, 0, 0x90}, - - { NULL, "orl", S_TYP3, 0, 0x40}, - { NULL, "anl", S_TYP3, 0, 0x50}, - { NULL, "xrl", S_TYP3, 0, 0x60}, - - { NULL, "xch", S_TYP4, 0, 0xC0}, - - { NULL, "mov", S_MOV, 0, 0x00}, - - { NULL, "jbc", S_BITBR, 0, 0x10}, - { NULL, "jb", S_BITBR, 0, 0x20}, - { NULL, "jnb", S_BITBR, 0, 0x30}, - - { NULL, "jc", S_BR, 0, 0x40}, - { NULL, "jnc", S_BR, 0, 0x50}, - { NULL, "jz", S_BR, 0, 0x60}, - { NULL, "jnz", S_BR, 0, 0x70}, - { NULL, "sjmp", S_BR, 0, 0x80}, - - { NULL, "cjne", S_CJNE, 0, 0xB0}, - { NULL, "djnz", S_DJNZ, 0, 0xD0}, - { NULL, "jmp", S_JMP, 0, 0x73}, - { NULL, "movc", S_MOVC, 0, 0x83}, - { NULL, "movx", S_MOVX, 0, 0x00}, - { NULL, "div", S_AB, 0, 0x84}, - { NULL, "mul", S_AB, 0, 0xA4}, - { NULL, "clr", S_ACBIT, 0, 0xC2}, - { NULL, "cpl", S_ACBIT, 0, 0xB2}, - { NULL, "setb", S_SETB, 0, 0xD2}, - { NULL, "push", S_DIRECT, 0, 0xC0}, - { NULL, "pop", S_DIRECT, 0, 0xD0}, - { NULL, "xchd", S_XCHD, S_END, 0xD6} + { NULL, "a", S_A, 0, A }, + { NULL, "ab", S_AB, 0, 0 }, + { NULL, "dptr", S_DPTR, 0, DPTR }, + { NULL, "pc", S_PC, 0, PC }, + { NULL, "r0", S_REG, 0, R0 }, + { NULL, "r1", S_REG, 0, R1 }, + { NULL, "r2", S_REG, 0, R2 }, + { NULL, "r3", S_REG, 0, R3 }, + { NULL, "r4", S_REG, 0, R4 }, + { NULL, "r5", S_REG, 0, R5 }, + { NULL, "r6", S_REG, 0, R6 }, + { NULL, "r7", S_REG, 0, R7 }, + + { NULL, "nop", S_INH, 0, 0x00 }, + { NULL, "ret", S_INH, 0, 0x22 }, + { NULL, "reti", S_INH, 0, 0x32 }, + + { NULL, "ajmp", S_JMP11, 0, 0x01 }, + { NULL, "acall", S_JMP11, 0, 0x11 }, + { NULL, "ljmp", S_JMP16, 0, 0x02 }, + { NULL, "lcall", S_JMP16, 0, 0x12 }, + + { NULL, "rr", S_ACC, 0, 0x03 }, + { NULL, "rrc", S_ACC, 0, 0x13 }, + { NULL, "rl", S_ACC, 0, 0x23 }, + { NULL, "rlc", S_ACC, 0, 0x33 }, + { NULL, "swap", S_ACC, 0, 0xC4 }, + { NULL, "da", S_ACC, 0, 0xD4 }, + + { NULL, "inc", S_TYP1, 0, 0x00 }, + { NULL, "dec", S_TYP1, 0, 0x10 }, + + { NULL, "add", S_TYP2, 0, 0x20 }, + { NULL, "addc", S_TYP2, 0, 0x30 }, + { NULL, "subb", S_TYP2, 0, 0x90 }, + + { NULL, "orl", S_TYP3, 0, 0x40 }, + { NULL, "anl", S_TYP3, 0, 0x50 }, + { NULL, "xrl", S_TYP3, 0, 0x60 }, + + { NULL, "xch", S_TYP4, 0, 0xC0 }, + + { NULL, "mov", S_MOV, 0, 0x00 }, + + { NULL, "jbc", S_BITBR, 0, 0x10 }, + { NULL, "jb", S_BITBR, 0, 0x20 }, + { NULL, "jnb", S_BITBR, 0, 0x30 }, + + { NULL, "jc", S_BR, 0, 0x40 }, + { NULL, "jnc", S_BR, 0, 0x50 }, + { NULL, "jz", S_BR, 0, 0x60 }, + { NULL, "jnz", S_BR, 0, 0x70 }, + { NULL, "sjmp", S_BR, 0, 0x80 }, + + { NULL, "cjne", S_CJNE, 0, 0xB0 }, + { NULL, "djnz", S_DJNZ, 0, 0xD0 }, + { NULL, "jmp", S_JMP, 0, 0x73 }, + { NULL, "movc", S_MOVC, 0, 0x83 }, + { NULL, "movx", S_MOVX, 0, 0x00 }, + { NULL, "div", S_AB, 0, 0x84 }, + { NULL, "mul", S_AB, 0, 0xA4 }, + { NULL, "clr", S_ACBIT, 0, 0xC2 }, + { NULL, "cpl", S_ACBIT, 0, 0xB2 }, + { NULL, "setb", S_SETB, 0, 0xD2 }, + { NULL, "push", S_DIRECT, 0, 0xC0 }, + { NULL, "pop", S_DIRECT, 0, 0xD0 }, + { NULL, "xchd", S_XCHD, S_EOL, 0xD6 } }; struct PreDef preDef[] = { diff -Nru sdcc-3.1.0+dfsg/sdas/as8051/i8051.h sdcc-3.2.0+dfsg/sdas/as8051/i8051.h --- sdcc-3.1.0+dfsg/sdas/as8051/i8051.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/as8051/i8051.h 2012-06-28 14:09:28.000000000 +0000 @@ -1,24 +1,31 @@ -/* i8051.h - - Copyright (C) 1989-1995 Alan R. Baldwin - 721 Berkeley St., Kent, Ohio 44240 - -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, see . */ +/* i8051.h */ /* - * Ported from 8085 to 8051 by John Hartman 30-Apr-1995 - * Continued, 2-Jun-95 + * Copyright (C) 1998-2009 Alan R. Baldwin + * + * 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, see . + * + * + * Alan R. Baldwin + * 721 Berkeley St. + * Kent, Ohio 44240 + * + * This Assember Ported by + * John L. Hartman (JLH) + * jhartman at compuserve dot com + * noice at noicedebugger dot com + * */ /*)BUILD @@ -132,11 +139,10 @@ extern int reg(void); /* i51mch.c */ -extern VOID machine(struct mne *mp); extern int mchpcr(struct expr *esp); -extern VOID minit(void); #else + /* i51adr.c */ extern struct adsym reg51[]; extern int addr(); @@ -146,7 +152,6 @@ extern int reg(); /* i51mch.c */ -extern VOID machine(); extern int mchpcr(); -extern VOID minit(); + #endif diff -Nru sdcc-3.1.0+dfsg/sdas/asgb/gb.h sdcc-3.2.0+dfsg/sdas/asgb/gb.h --- sdcc-3.1.0+dfsg/sdas/asgb/gb.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asgb/gb.h 2012-06-28 14:09:28.000000000 +0000 @@ -154,9 +154,7 @@ /* gbmch.c */ extern int genop(int pop, int op, struct expr *esp, int f); -extern VOID machine(struct mne *mp); extern int mchpcr(struct expr *esp); -extern VOID minit(void); #else /* gbadr.c */ @@ -167,7 +165,5 @@ /* gbmch.c */ extern int genop(); -extern VOID machine() ; extern int mchpcr(); -extern VOID minit(); #endif diff -Nru sdcc-3.1.0+dfsg/sdas/asgb/gbpst.c sdcc-3.2.0+dfsg/sdas/asgb/gbpst.c --- sdcc-3.1.0+dfsg/sdas/asgb/gbpst.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asgb/gbpst.c 2011-12-18 17:44:59.000000000 +0000 @@ -124,5 +124,5 @@ { NULL, "reti", S_INH1, 0, 0xD9 }, { NULL, "ldh", S_LDH, 0, 0xE0 }, { NULL, "lda", S_LDA, 0, 0xE8 }, - { NULL, "ldhl", S_LDHL, S_END, 0xF } + { NULL, "ldhl", S_LDHL, S_EOL, 0xF } }; diff -Nru sdcc-3.1.0+dfsg/sdas/asrab/Makefile.in sdcc-3.2.0+dfsg/sdas/asrab/Makefile.in --- sdcc-3.1.0+dfsg/sdas/asrab/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asrab/Makefile.in 2012-01-15 08:31:23.000000000 +0000 @@ -36,7 +36,8 @@ CPPFLAGS = @CPPFLAGS@ -DSDCDB -DNOICE -DINDEXLIB -I. -I$(srcdir) -I$(srcdir)/../asxxsrc -I$(srcdir)/../../support/util CFLAGS = @CFLAGS@ @WALL_FLAG@ $(CPPFLAGS) -LDFLAGS = @LDFLAGS@ -lm +LDFLAGS = @LDFLAGS@ +LIBS = -lm OBJDIR = obj @@ -65,7 +66,7 @@ all: checkconf $(ASX) $(ASX): $(ASOBJECTS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ASOBJECTS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ASOBJECTS) $(LIBS) # Compiling and installing everything and running test # ---------------------------------------------------- diff -Nru sdcc-3.1.0+dfsg/sdas/asrab/asrab.vcxproj sdcc-3.2.0+dfsg/sdas/asrab/asrab.vcxproj --- sdcc-3.1.0+dfsg/sdas/asrab/asrab.vcxproj 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asrab/asrab.vcxproj 2012-06-28 14:09:28.000000000 +0000 @@ -37,6 +37,7 @@ {F47A26F0-2D57-4A1F-86CF-6E3F82D3E877} Win32Proj asrab + sdasrab diff -Nru sdcc-3.1.0+dfsg/sdas/asrab/rabbit.h sdcc-3.2.0+dfsg/sdas/asrab/rabbit.h --- sdcc-3.1.0+dfsg/sdas/asrab/rabbit.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asrab/rabbit.h 2012-06-28 14:09:28.000000000 +0000 @@ -24,71 +24,71 @@ */ /*)BUILD - $(PROGRAM) = asrab - $(INCLUDE) = { - ASXXXX.H - rabbit.H - } - $(FILES) = { - rabbitext.c - rabbitmch.c - rabbitadr.c - rabbitpst.c - ASMAIN.C - ASLEX.C - ASSYM.C - ASSUBR.C - ASEXPR.C - ASDATA.C - ASLIST.C - ASOUT.C - } - $(STACK) = 3000 + $(PROGRAM) = asrab + $(INCLUDE) = { + ASXXXX.H + rabbit.H + } + $(FILES) = { + rabbitext.c + rabbitmch.c + rabbitadr.c + rabbitpst.c + ASMAIN.C + ASLEX.C + ASSYM.C + ASSUBR.C + ASEXPR.C + ASDATA.C + ASLIST.C + ASOUT.C + } + $(STACK) = 3000 */ /* * Indirect Addressing delimeters */ -#define LFIND '(' -#define RTIND ')' +#define LFIND '(' +#define RTIND ')' /* * Registers */ -#define B 0 -#define C 1 -#define D 2 -#define E 3 -#define H 4 -#define L 5 -#define A 7 +#define B 0 +#define C 1 +#define D 2 +#define E 3 +#define H 4 +#define L 5 +#define A 7 -#define IIR 0x47 -#define EIR 0x4F +#define IIR 0x47 +#define EIR 0x4F #define IP 0x76 -#define BC 0 -#define DE 1 -#define HL 2 -#define SP 3 -#define AF 4 -#define IX 5 -#define IY 6 +#define BC 0 +#define DE 1 +#define HL 2 +#define SP 3 +#define AF 4 +#define IX 5 +#define IY 6 -#define BCDE 1 +#define BCDE 1 #define JKHL 1 /* * Conditional definitions */ -#define NZ 0 -#define Z 1 -#define NC 2 -#define CS 3 -#define PO 4 -#define PE 5 -#define P 6 -#define M 7 +#define NZ 0 +#define Z 1 +#define NC 2 +#define CS 3 +#define PO 4 +#define PE 5 +#define P 6 +#define M 7 /* * Alternate set of conditional definitions for some rabbit 4000 instructions @@ -105,13 +105,13 @@ /* * Symbol types */ -#define S_IMMED 30 -#define S_R8 31 -#define S_R8X 32 -#define S_R16 33 -#define S_R16X 34 -#define S_CND 35 -#define S_FLAG 36 +#define S_IMMED 30 +#define S_R8 31 +#define S_R8X 32 +#define S_R16 33 +#define S_R16X 34 +#define S_CND 35 +#define S_FLAG 36 #define S_R32_BCDE 37 #define S_R32_JKHL 38 @@ -120,56 +120,56 @@ /* * Indexing modes */ -#define S_INDB 40 -#define S_IDC 41 -#define S_INDR 50 -#define S_IDBC 50 -#define S_IDDE 51 -#define S_IDHL 52 -#define S_IDSP 53 -#define S_IDIX 55 -#define S_IDIY 56 -#define S_INDM 57 +#define S_INDB 40 +#define S_IDC 41 +#define S_INDR 50 +#define S_IDBC 50 +#define S_IDDE 51 +#define S_IDHL 52 +#define S_IDSP 53 +#define S_IDIX 55 +#define S_IDIY 56 +#define S_INDM 57 #define S_IDHL_OFFSET 58 /* * Instruction types */ -#define S_LD 60 -#define S_CALL 61 -#define S_JP 62 -#define S_JR 63 -#define S_RET 64 -#define S_BIT 65 -#define S_INC 66 -#define S_DEC 67 -#define S_ADD 68 -#define S_ADC 69 -#define S_AND 70 -#define S_EX 71 -#define S_PUSH 72 -#define S_IN 73 -#define S_OUT 74 -#define S_RL 75 -#define S_RST 76 -#define S_IM 77 -#define S_INH1 78 -#define S_INH2 79 -#define S_DJNZ 80 -#define S_SUB 81 -#define S_SBC 82 +#define S_LD 60 +#define S_CALL 61 +#define S_JP 62 +#define S_JR 63 +#define S_RET 64 +#define S_BIT 65 +#define S_INC 66 +#define S_DEC 67 +#define S_ADD 68 +#define S_ADC 69 +#define S_AND 70 +#define S_EX 71 +#define S_PUSH 72 +#define S_IN 73 +#define S_OUT 74 +#define S_RL 75 +#define S_RST 76 +#define S_IM 77 +#define S_INH1 78 +#define S_INH2 79 +#define S_DJNZ 80 +#define S_SUB 81 +#define S_SBC 82 #define S_NEG 83 /* * HD64180 Instructions */ -#define X_HD64 90 -#define X_INH2 91 -#define X_IN 92 -#define X_OUT 93 -#define X_MLT 94 -#define X_TST 95 -#define X_TSTIO 96 +#define X_HD64 90 +#define X_INH2 91 +#define X_IN 92 +#define X_OUT 93 +#define X_MLT 94 +#define X_TST 95 +#define X_TSTIO 96 /* * Rabbit 2000 / Rabbit 4000 specific Instructions @@ -178,67 +178,68 @@ #define X_LCALL 98 #define X_BOOL 99 -#define X_R4K_MODE 101 +#define X_R3K_MODE 101 +#define R3K_INH1 102 +#define R3K_INH2 103 + +#define X_R4K_MODE 105 /* the remaining instructions are only on Rabbit 4000: */ -#define X_R4K_MULU 102 -#define X_JRE 103 -#define X_CLR 104 +#define X_R4K_MULU 106 +#define X_JRE 107 +#define X_CLR 108 +#define R4K_INH2 109 #define BCDE_PG 0xDD #define JKHL_PG 0xFD struct adsym { - char a_str[8]; /* addressing string */ - int a_val; /* addressing mode value */ + char a_str[8]; /* addressing string */ + int a_val; /* addressing mode value */ }; - /* register names are in rabbitadr.c: */ -extern struct adsym R8[]; -extern struct adsym R8X[]; -extern struct adsym R8IP[]; -extern struct adsym R16[]; -extern struct adsym R16X[]; + /* register names are in rabbitadr.c: */ +extern struct adsym R8[]; +extern struct adsym R8X[]; +extern struct adsym R8IP[]; +extern struct adsym R16[]; +extern struct adsym R16X[]; extern struct adsym R32_JKHL[]; extern struct adsym R32_BCDE[]; extern struct adsym RXPC[]; -extern struct adsym CND[]; +extern struct adsym CND[]; extern struct adsym ALT_CND[]; - /* machine dependent functions */ + /* machine dependent functions */ + +#ifdef OTHERSYSTEM + + /* rabbitadr.c */ +extern int addr(struct expr *esp); +extern int admode(struct adsym *sp); +extern int any(char c, char *str); +extern int srch(char *str); + -#ifdef OTHERSYSTEM - - /* rabbitadr.c */ -extern int addr(struct expr *esp); -extern int admode(struct adsym *sp); -extern int any(char c, char *str); -extern int srch(char *str); - - - /* rabbitmch.c */ -extern int genop(int pop, int op, struct expr *esp, int f); -extern int gixiy(int v); -extern VOID machine(struct mne *mp); -extern int mchpcr(struct expr *esp); -extern VOID minit(void); + /* rabbitmch.c */ +extern int genop(int pop, int op, struct expr *esp, int f); +extern int gixiy(int v); +extern int mchpcr(struct expr *esp); #else - /* rabbitadr.c */ -extern int addr(); -extern int admode(); -extern int any(); -extern int srch(); - - /* rabbitmch.c */ -extern int genop(); -extern int gixiy(); -extern VOID machine(); -extern int mchpcr(); -extern VOID minit(); + /* rabbitadr.c */ +extern int addr(); +extern int admode(); +extern int any(); +extern int srch(); + + /* rabbitmch.c */ +extern int genop(); +extern int gixiy(); +extern int mchpcr(); #endif diff -Nru sdcc-3.1.0+dfsg/sdas/asrab/rabbitadr.c sdcc-3.2.0+dfsg/sdas/asrab/rabbitadr.c --- sdcc-3.1.0+dfsg/sdas/asrab/rabbitadr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asrab/rabbitadr.c 2011-12-18 17:44:59.000000000 +0000 @@ -53,20 +53,20 @@ expr(esp, 0); esp->e_mode = S_IMMED; #if 0 - /* ljm - leading digit is used for offset for dd(ix|iy|sp) */ + /* ljm - leading digit is used for offset for dd(ix|iy|sp) */ } else if ((c == '-') || ((c >= '0') && (c <= '9'))) { unget(c); - expr(esp, 0); - esp->e_mode = S_IMMED; + expr(esp, 0); + esp->e_mode = S_IMMED; #endif - } else + } else if (c == LFIND) { - /* ljm comment - - * '(' number ')' - * or '(' register=[hl,ix,iy,sp,bc,de] ')' - * ref to memory, scan the next 'symbol' to see if - * it is a register or an absolute address - */ + /* ljm comment - + * '(' number ')' + * or '(' register=[hl,ix,iy,sp,bc,de] ')' + * ref to memory, scan the next 'symbol' to see if + * it is a register or an absolute address + */ if ((indx = admode(R8)) != 0) { mode = S_INDB; } else @@ -81,7 +81,7 @@ mode = S_R16X; aerr(); } else { - mode = S_INDM; + mode = S_INDM; expr(esp, 0); esp->e_mode = mode; } @@ -89,25 +89,25 @@ esp->e_mode = (mode + indx)&0xFF; esp->e_base.e_ap = NULL; } - /* ljm comment - - * flag an error if the closing paren is absent - */ + /* ljm comment - + * flag an error if the closing paren is absent + */ if ((c = getnb()) != RTIND) qerr(); } else { unget(c); - /* ljm - - * cases: - * register - * symbol - * symbol(register) - * number - * number(register) - * - * scan the list(s) of registers to see if the - * name matches the name of one of the processor - * registers - */ + /* ljm - + * cases: + * register + * symbol + * symbol(register) + * number + * number(register) + * + * scan the list(s) of registers to see if the + * name matches the name of one of the processor + * registers + */ if ((indx = admode(R8)) != 0) { mode = S_R8; } else @@ -119,17 +119,17 @@ } else if ((indx = admode(R16X)) != 0) { mode = S_R16X; - } else - if ((indx = admode(R32_JKHL)) != 0) { - mode = S_R32_JKHL; - } else - if ((indx = admode(R32_BCDE)) != 0) { - mode = S_R32_BCDE; - } else - if ((indx = admode(RXPC)) != 0) { - mode = S_RXPC; + } else + if ((indx = admode(R32_JKHL)) != 0) { + mode = S_R32_JKHL; + } else + if ((indx = admode(R32_BCDE)) != 0) { + mode = S_R32_BCDE; + } else + if ((indx = admode(RXPC)) != 0) { + mode = S_RXPC; } else { - mode = S_USER; + mode = S_USER; expr(esp, 0); esp->e_mode = mode; } @@ -139,14 +139,14 @@ esp->e_base.e_ap = NULL; } if ((c = getnb()) == LFIND) { - indx=admode(R16); - if ((indx&0xFF)==IX || (indx&0xFF)==IY || - (indx&0xFF)==SP) - { - esp->e_mode = S_INDR + (indx&0xFF); - } else if ( (indx&0xFF)==HL ) { - esp->e_mode = S_IDHL_OFFSET; - } else { + indx=admode(R16); + if ((indx&0xFF)==IX || (indx&0xFF)==IY || + (indx&0xFF)==SP) + { + esp->e_mode = S_INDR + (indx&0xFF); + } else if ( (indx&0xFF)==HL ) { + esp->e_mode = S_IDHL_OFFSET; + } else { aerr(); } if ((c = getnb()) != RTIND) @@ -175,7 +175,7 @@ unget(getnb()); i = 0; - while ( *(ptr = &sp[i].a_str[0]) ) { + while ( *(ptr = &sp[i].a_str[0]) ) { if (srch(ptr)) { return(sp[i].a_val); } @@ -264,7 +264,7 @@ }; struct adsym R16X[] = { - { "af'", AF|0400 }, /* af' must be first !!! */ + { "af'", AF|0400 }, /* af' must be first !!! */ { "af", AF|0400 }, { "", 0000 } }; diff -Nru sdcc-3.1.0+dfsg/sdas/asrab/rabbitext.c sdcc-3.2.0+dfsg/sdas/asrab/rabbitext.c --- sdcc-3.1.0+dfsg/sdas/asrab/rabbitext.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asrab/rabbitext.c 2011-12-18 17:44:59.000000000 +0000 @@ -28,6 +28,6 @@ #include "asxxxx.h" #include "rabbit.h" -char *cpu = "Rabbit 2000/4000"; -int hilo = 0; -char *dsft = "asm"; +char *cpu = "Rabbit 2000/4000"; +int hilo = 0; +char *dsft = "asm"; diff -Nru sdcc-3.1.0+dfsg/sdas/asrab/rabbitmch.c sdcc-3.2.0+dfsg/sdas/asrab/rabbitmch.c --- sdcc-3.1.0+dfsg/sdas/asrab/rabbitmch.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asrab/rabbitmch.c 2012-05-20 23:43:48.000000000 +0000 @@ -23,1036 +23,1059 @@ * and rabbit 4000 instruction sets (2011) */ -#include -#include #include "asxxxx.h" #include "rabbit.h" -char imtab[3] = { 0x46, 0x56, 0x5E }; -int hd64; +char imtab[3] = { 0x46, 0x56, 0x5E }; +int hd64; +int r3k_mode; int r4k_mode; /* when set, generate op-code for Rabbit-4000 instead of Rabbit 2000/3000 */ /* * Process a machine op. */ -VOID -machine(mp) -struct mne *mp; +VOID machine(struct mne * const mp) { - int op, t1, t2; - struct expr e1, e2; - int rf, v1, v2; - - clrexpr(&e1); - clrexpr(&e2); - op = (int) mp->m_valu; - rf = mp->m_type; + int op, t1, t2; + struct expr e1, e2; + int rf, v1, v2; + + clrexpr(&e1); + clrexpr(&e2); + op = (int) mp->m_valu; + rf = mp->m_type; #if 0 - if (!hd64 && rf>X_HD64) - rf = 0; -#else - if (!r4k_mode && rf > X_R4K_MODE) - rf = 0; + if (!hd64 && rf>X_HD64) + rf = 0; #endif - switch (rf) { - - case S_INH1: - outab(op); - break; - - case S_INH2: - outab(0xED); - outab(op); - break; - - case S_RET: - if (more()) { - if ((v1 = admode(CND)) != 0) { - outab(op | (v1<<3)); - } else { - qerr(); - } - } else { - outab(0xC9); - } - break; - - case S_PUSH: - if (admode(R16X)) { - outab(op+0x30); - break; - } else if ((v1 = admode(R8IP)) != 0) { - outab(0xED); - if (op == 0xC5) - outab(0x76); /* push */ - else - outab(0x7E); /* pop */ - break; - } else - if ((v1 = admode(R16)) != 0 && (v1 &= 0xFF) != SP) { - if (v1 != gixiy(v1)) { - outab(op+0x20); - break; - } - outab(op | (v1<<4)); - break; - } else if (r4k_mode) { - if ( (v1 = admode(R32_JKHL)) != 0 ) { - outab(JKHL_PG); - outab(op+0x30); - break; - } else if ( (v1 = admode(R32_BCDE)) != 0 ) { - outab(BCDE_PG); - outab(op+0x30); - break; - } - } - aerr(); - break; - - case S_RST: - v1 = (int) absexpr(); - /* ljm comment - - * block RST 00, 08, and 30 b/c those opcodes - * are assigned to different instructions in the - * rabbit processor - */ - if ((v1 == 0x00) || (v1 == 0x08) || (v1 == 0x30)) { - aerr( ); - v1 = 0; - } - if (v1 & ~0x38) { - aerr(); - v1 = 0; - } - outab(op|v1); - break; - + + if (!r4k_mode && rf > X_R4K_MODE) + rf = 0; + + switch (rf) + { + case S_INH1: + outab(op); + break; + + case S_INH2: + outab(0xED); + outab(op); + break; + + case S_RET: + if (more()) { + if ((v1 = admode(CND)) != 0) { + outab(op | (v1<<3)); + } else { + qerr(); + } + } else { + outab(0xC9); + } + break; + + case S_PUSH: + if (admode(R16X)) { + outab(op+0x30); + break; + } else if ((v1 = admode(R8IP)) != 0) { + outab(0xED); + if (op == 0xC5) + outab(0x76); /* push */ + else + outab(0x7E); /* pop */ + break; + } else + if ((v1 = admode(R16)) != 0 && (v1 &= 0xFF) != SP) { + if (v1 != gixiy(v1)) { + outab(op+0x20); + break; + } + outab(op | (v1<<4)); + break; + } else if (r4k_mode) { + if ( (v1 = admode(R32_JKHL)) != 0 ) { + outab(JKHL_PG); + outab(op+0x30); + break; + } else if ( (v1 = admode(R32_BCDE)) != 0 ) { + outab(BCDE_PG); + outab(op+0x30); + break; + } + } + aerr(); + break; + + case S_RST: + v1 = (int) absexpr(); + /* ljm comment - + * block RST 00, 08, and 30 b/c those opcodes + * are assigned to different instructions in the + * rabbit processor + */ + if ((v1 == 0x00) || (v1 == 0x08) || (v1 == 0x30)) { + aerr( ); + v1 = 0; + } + if (v1 & ~0x38) { + aerr(); + v1 = 0; + } + outab(op|v1); + break; + #if 0 - /* IM x set interrupt mode on Z-80 */ - /* Rabbit processor use the opcode to set interrupt level */ - case S_IM: - expr(&e1, 0); - abscheck(&e1); - if (e1.e_addr > 2) { - aerr(); - e1.e_addr = 0; - } - outab(op); - outab(imtab[(int) e1.e_addr]); - break; + /* IM x set interrupt mode on Z-80 */ + /* Rabbit processor use the opcode to set interrupt level */ + case S_IM: + expr(&e1, 0); + abscheck(&e1); + if (e1.e_addr > 2) { + aerr(); + e1.e_addr = 0; + } + outab(op); + outab(imtab[(int) e1.e_addr]); + break; #endif - - case S_BIT: - expr(&e1, 0); - t1 = 0; - v1 = (int) e1.e_addr; - if (v1 > 7) { - ++t1; - v1 &= 0x07; - } - op |= (v1<<3); - comma(1); - addr(&e2); - abscheck(&e1); - if (genop(0xCB, op, &e2, 0) || t1) - aerr(); - break; - - case S_RL: - t1 = 0; - t2 = addr(&e2); - if ((t2 == S_IMMED) && r4k_mode) - { - v1 = (int) e2.e_addr; - /* v1 should be shift count of 1,2,4, or 8 */ - comma(1); - clrexpr(&e2); - t2 = addr(&e2); - - if ((t2 != S_R32_BCDE) && (t2 != S_R32_JKHL)) - aerr( ); - - if (v1 == 1) - v1 = 0x48; - else if (v1 == 2) - v1 = 0x49; - else if (v1 == 4) - v1 = 0x4B; - else if ((v1 == 8) && (op < 0x20 /* op is rlc|rrc|rl|rr */)) - v1 = 0x4F; - else { - err('o'); - break; - } - - /* 00 rlc, 08 rrc, 10 rl , 18 rr * - * 20 sla, 28 sra, 38 srl, [30 sll == sla] */ - outab( ((t2 == S_R32_JKHL)?JKHL_PG:BCDE_PG) ); - outab(v1 + (op << 1)); - break; - } - else if (more()) { - if ((t2 != S_R8) || (e2.e_addr != A)) - ++t1; - comma(1); - clrexpr(&e2); - t2 = addr(&e2); - } else if (t2 == S_R16) { - v2 = (int) e2.e_addr; - if ((v2 == DE) && - ((op == 0x10 /* rl */) || (op == 0x18 /* rr */))) { - outab( 0xF3 - 0x10 + op ); - break; - } - - if ((v2 == HL) && (op == 0x18 /* rr */)) { - outab( 0xFC ); - break; - } - - if (r4k_mode) { - if ((v2 == HL) && (op == 0x10 /* rl */)) { - outab( 0x42 ); - break; - } - if (((v2 == BC)||(v2 == DE)) && - (op < 0x20 /* 00 rlc, 08 rrc, 10 rl, 18 rr */)) { - outab( 0x50 + (op >> 3) + ((v2==BC)?0x10:0x00) ); - break; - } - } - - aerr( ); - } - if (genop(0xCB, op, &e2, 0) || t1) - aerr(); - break; - - case S_AND: /* and, xor, or, cp */ - case S_SUB: /* sub */ - case S_SBC: /* sbc */ - t1 = addr(&e1); + + case S_BIT: + expr(&e1, 0); + t1 = 0; + v1 = (int) e1.e_addr; + if (v1 > 7) { + ++t1; + v1 &= 0x07; + } + op |= (v1<<3); + comma(1); + addr(&e2); + abscheck(&e1); + if (genop(0xCB, op, &e2, 0) || t1) + aerr(); + break; + + case S_RL: + t1 = 0; + t2 = addr(&e2); + if ((t2 == S_IMMED) && r4k_mode) + { + v1 = (int) e2.e_addr; + /* v1 should be shift count of 1,2,4, or 8 */ + comma(1); + clrexpr(&e2); + t2 = addr(&e2); + + if ((t2 != S_R32_BCDE) && (t2 != S_R32_JKHL)) + aerr( ); + + if (v1 == 1) + v1 = 0x48; + else if (v1 == 2) + v1 = 0x49; + else if (v1 == 4) + v1 = 0x4B; + else if ((v1 == 8) && (op < 0x20 /* op is rlc|rrc|rl|rr */)) + v1 = 0x4F; + else { + err('o'); + break; + } + + /* 00 rlc, 08 rrc, 10 rl , 18 rr * + * 20 sla, 28 sra, 38 srl, [30 sll == sla] */ + outab( ((t2 == S_R32_JKHL)?JKHL_PG:BCDE_PG) ); + outab(v1 + (op << 1)); + break; + } + else if (more()) { + if ((t2 != S_R8) || (e2.e_addr != A)) + ++t1; + comma(1); + clrexpr(&e2); + t2 = addr(&e2); + } else if (t2 == S_R16) { + v2 = (int) e2.e_addr; + if ((v2 == DE) && + ((op == 0x10 /* rl */) || (op == 0x18 /* rr */))) { + outab( 0xF3 - 0x10 + op ); + break; + } + + if ((v2 == HL) && (op == 0x18 /* rr */)) { + outab( 0xFC ); + break; + } + + if (r4k_mode) { + if ((v2 == HL) && (op == 0x10 /* rl */)) { + outab( 0x42 ); + break; + } + if (((v2 == BC)||(v2 == DE)) && + (op < 0x20 /* 00 rlc, 08 rrc, 10 rl, 18 rr */)) { + outab( 0x50 + (op >> 3) + ((v2==BC)?0x10:0x00) ); + break; + } + } + + aerr( ); + } + if (genop(0xCB, op, &e2, 0) || t1) + aerr(); + break; + + case S_AND: /* and, xor, or, cp */ + case S_SUB: /* sub */ + case S_SBC: /* sbc */ + t1 = addr(&e1); #if 0 - if (!(more())) { - /* handle case for implicit target of 'A' register */ - /* TODO */ - aerr( ); - } + if (!(more())) { + /* handle case for implicit target of 'A' register */ + /* TODO */ + aerr( ); + } #endif - comma(1); - t2 = addr(&e2); - - v1 = (int) e1.e_addr; - v2 = (int) e2.e_addr; - - if ((t1 == S_R8) && (v1 == A)) { - if ( ((t2 == S_R8) && (v2 == A)) && - ((op == 0xA8) || (op == 0xB0)) ) { - /* AF: "xor a,a" || B7: "or a,a" */ - outab( op | 0x07 ); - break; - } - - if ((t2 == S_R8) || (t2 == S_IDHL)) { - /* ljm - rabbit 4000 support - * (sub,sbc,and,xor,or,cp) A,R or A,(HL) - * needs a 0x7F prefix byte when - * operating in rabbit 4000 mode - */ - if (r4k_mode) - outab(0x7F); - } - + comma(1); + t2 = addr(&e2); + + v1 = (int) e1.e_addr; + v2 = (int) e2.e_addr; + + if ((t1 == S_R8) && (v1 == A)) { + if ( ((t2 == S_R8) && (v2 == A)) && + ((op == 0xA8) || (op == 0xB0)) ) { + /* AF: "xor a,a" || B7: "or a,a" */ + outab( op | 0x07 ); + break; + } + + if ((t2 == S_R8) || (t2 == S_IDHL)) { + /* ljm - rabbit 4000 support + * (sub,sbc,and,xor,or,cp) A,R or A,(HL) + * needs a 0x7F prefix byte when + * operating in rabbit 4000 mode + */ + if (r4k_mode) + outab(0x7F); + } + #if 0 - if (t2 == S_IMMED) { /* AND,XOR,OR,CP,SUB A, #n */ - /* opcode for (sub,sbc,and,xor,or,cp) A,#immediate - * do not need 0x7F prefix byte - */ - outab(op|0x46); /* 0xA0 | 0x46 => 0xE6, etc */ - outrb(&e2,0); - } else + if (t2 == S_IMMED) { /* AND,XOR,OR,CP,SUB A, #n */ + /* opcode for (sub,sbc,and,xor,or,cp) A,#immediate + * do not need 0x7F prefix byte + */ + outab(op|0x46); /* 0xA0 | 0x46 => 0xE6, etc */ + outrb(&e2, 0); + } else #endif - - if (genop(0, op, &e2, 1)) - aerr(); - - break; - } - if ((t1 == S_R16) && (v1 == HL) && - (t2 == S_R16) && (rf == S_SBC)) { - /* sbc hl, [bc|de|hl|sp] */ - if ( v2 != gixiy(v2) ) - /* sorry, sbc hl, [ix|iy] do not exist */ - aerr( ); - - outab(0xED); - outab(0x42 | v2 << 4); - break; - } - if ((t1 == S_R16) && (v1 == HL) && - (t2 == S_R16) && (v2 == DE)) { - /* 55 sub hl, de */ - /* sbc hl, de does not exist */ - /* DC and hl, de */ - /* 54 xor hl, de */ - /* EC or hl, de */ - /* ED 48 cp hl, de */ - if (rf == S_SBC) /* op == 0x98 */ - aerr( ); - - switch( op ) { - case 0x90: /* sub */ outab(0x55); break; - case 0xA0: /* and */ outab(0xDC); break; - case 0xA8: /* xor */ outab(0x54); break; - case 0xB0: /* or */ outab(0xEC); break; - case 0xB8: /* cp */ - outab( 0xED ); - outab( 0x48 ); - break; - } - break; - } - - if ((t1 == S_R16) && ((v1 == IX) || (v1 == IY)) && - (t2 == S_R16) && (v2 == DE) && - ((op == 0xA0 /* and */) || (op == 0xB0 /* or */))) { - v1 = gixiy(v1); - outab(op + 0x3C); - break; - } - - if ((t1 == S_R32_JKHL) && (t2 == S_R32_BCDE)) { - /* ED D6 sub jkhl, bcde */ - /* sbc jkhl, bcde does not exist */ - /* ED E6 and jkhl, bcde */ - /* ED EE xor jkhl, bcde */ - /* ED F6 or jkhl, bcde */ - /* ED 58 cp jkhl, bcde */ - if (rf == S_SBC) /* op == 0x98 */ - aerr( ); - - outab(0xED); - switch( op ) { - case 0x90: /* sub */ outab(0xD6); break; - case 0xA0: /* and */ outab(0xE6); break; - case 0xA8: /* xor */ outab(0xEE); break; - case 0xB0: /* or */ outab(0xF6); break; - case 0xB8: /* cp */ outab(0x58); break; - } - break; - } - - if ((t1 == S_R16) && (v1 == HL) && (t2 == S_IMMED)) { - /* cp hl, #signed displacement */ - outab(0x48); - outrb(&e2); - break; - } - - aerr( ); - break; - - case S_ADD: - case S_ADC: - t1 = addr(&e1); - t2 = 0; - if (more()) { - comma(1); - t2 = addr(&e2); - } - if (t2 == 0) { - /* implied destination of the 8-bit 'a' register */ - if ((t1 == S_R8) || (t1 == S_IDHL)) { - /* ljm - rabbit 4000 support - * (add,adc,sub,sbc,and,xor,or,cp) A,R or A,(HL) - * needs a 0x7F prefix byte when - * operating in rabbit 4000 mode - */ - if (r4k_mode) - outab(0x7F); - } - - if (genop(0, op, &e1, 1)) - aerr(); - break; - } - if ((t1 == S_R8) && (e1.e_addr == A)) { - if ( ((t2 == S_R8) || (t2 == S_IDHL)) && r4k_mode ) - /* ljm - rabbit 4000 support, see note in t2==0 */ - outab(0x7F); - - if (genop(0, op, &e2, 1)) - aerr(); - break; - } - - if ((t1 == S_R32_JKHL) && (t2 == S_R32_BCDE) && - (rf == S_ADD)) { - /* rabbit 4000 - ED C6 "add jkhl, bcde" */ - outab(0xED); - outab(0xC6); - break; - } - - v1 = (int) e1.e_addr; - v2 = (int) e2.e_addr; - - if ((t1 == S_R16) && (v1 == SP) && (t2 == S_IMMED)) { - /* rabbit 4000 - add sp,#n n=signed displacement */ - outab(0x27); - outrb(&e2); - break; - } - - if ((t1 == S_R16) && (v1 == HL) && (t2 == S_R16)) { - if (v2 > SP) - aerr( ); - - if (rf == S_ADC) - outab(0xED); - - op = (rf == S_ADD) ? 0x09 : 0x4A; - outab(op | (v2 << 4) ); - break; - } - - if ((t1 == S_R16) && ((v1 == IX) || (v1 == IY)) && - (t2 == S_R16)) - { - if ((v2 == HL) || - (((v2 == IX) || (v2 == IY)) && (v2 != v1))) - aerr( ); - - if ((v2 == IX) || (v2 == IY)) - v2 = HL; - - gixiy(v1); - outab(0x09 | (v2 << 4)); - break; - } - aerr(); - break; - - case S_LD: - t1 = addr(&e1); - comma(1); - t2 = addr(&e2); - - v1 = (int) e1.e_addr; - v2 = (int) e2.e_addr; - if (t1 == S_R8) - { - if (t2 == S_IMMED) { - outab((e1.e_addr<<3) | 0x06); - outrb(&e2,0); - break; - } - - if (r4k_mode && (v1 == A) && (t2 == S_R8) && (v2 == A)) { - /* exception for "ld a,a" - * on rabbit 4000 0x7F is a prefix instead of "ld a,a" - */ - aerr( ); - } - - if ((v1 == A) && (t2 == S_R8)) { - /* "ld a,r", (except "ld a,a") */ - v1 = op | e1.e_addr<<3; - if (genop(0, v1, &e2, 0)) - aerr( ); - break; - } - - /* ld [b,c,d,e,h,l,a], _ */ - if ((t2 == S_R8) && (v2 != A)) { - /* 8-bit register to 8-bit register */ - /* use 0x7F prefix when in rabbit 4000 mode */ - v1 = op | e1.e_addr<<3; - if (r4k_mode) - outab(0x7F); - if (genop(0, v1, &e2, 0) == 0) - break; - - aerr( ); - } - - if ((t2 == S_R8) && (v2 == A) && - ((v1 != A) || (!r4k_mode))) { - /* "ld r,a", but except "ld a,a" - * on rabbit 4000 0x7F is a prefix instead of "ld a,a" */ - v1 = op | e1.e_addr<<3; - if (genop(0, v1, &e2, 0)) - aerr( ); - break; - } - - if ((t2 == S_IDHL) || (t2 == S_IDIX) || (t2 == S_IDIY)) { - /* "ld r,(hl)" or "ld r,disp (ix|iy)" */ - v1 = op | e1.e_addr<<3; - if (genop(0, v1, &e2, 0)) - aerr( ); - break; - } - } - - if ((t1 == S_R16) && (t2 == S_IMMED)) { - v1 = gixiy(v1); /* generayes prefix when ix or iy */ - outab(0x01|(v1<<4)); - outrw(&e2, 0); - break; - } - if ((t1 == S_R16) && (t2 == S_INDM)) { - if (gixiy(v1) == HL) { - outab(0x2A); - } else { - outab(0xED); - outab(0x4B | (v1<<4)); - } - outrw(&e2, 0); - break; - } - if ((t1 == S_R16) && (v1 == HL)) - { - if ((t2 == S_IDIX) || (t2 == S_IDIY) || - (t2 == S_IDHL) || (t2 == S_IDHL_OFFSET)) - { - /* ljm - added rabbit instruction LD HL,n(IX|HL|IY) */ - if (t2 == S_IDIY) - outab( 0xFD ); - else if ((t2 == S_IDHL) || (t2 == S_IDHL_OFFSET)) - /* ljm - added rabbit instruction LD HL,n(IY) - * normally 0xFD generated by "gixiy(v1)", but - * 0xDD results in n(HL) instead of n(IX) - */ - outab( 0xDD ); - - outab( 0xE4 ); - outrb( &e2 ); - break; - } - if ((t2 == S_R16) && ((v2 == IX) || (v2 == IY))) { - outab( ((v2==IX)?0xDD:0xFD) ); - outab(0x7C); - break; - } - if (r4k_mode) { - if ((t2 == S_R16) && ((v2 == BC) || (v2 == DE))) { - outab( 0x81 + ((v2 == DE) ? 0x20 : 0) ); - break; - } - } - } - if ((t2 == S_R16) && (v2 == HL)) /* ld n(IX|IY|HL), HL */ - { - if ((t1 == S_IDIY) || (t1 == S_IDHL) || - (t1 == S_IDHL_OFFSET)) - outab( ((t1==S_IDIY) ? 0xFD : 0xDD) ); - - if ((t1 == S_IDIY) || (t1 == S_IDIX) || - (t1 == S_IDHL) || (t1 == S_IDHL_OFFSET)) { - outab( 0xF4 ); - outrb( &e2 ); - break; - } - - if ((t1 == S_R16) && ((v1 == IX) || (v1 == IY))) { - outab( ((v1==IX)?0xDD:0xFD) ); - outab(0x7D); - break; - } - } - if ((t1 == S_INDM) && (t2 == S_R16)) { - if (gixiy(v2) == HL) { - outab(0x22); - } else { - outab(0xED); - outab(0x43 | (v2<<4)); - } - outrw(&e1, 0); - break; - } - if ((t1 == S_R8) && (v1 == A) && (t2 == S_INDM)) { - outab(0x3A); - outrw(&e2, 0); - break; - } - if ((t1 == S_INDM) && (t2 == S_R8) && (v2 == A)) { - outab(0x32); - outrw(&e1, 0); - break; - } - if ((t2 == S_R8) && (gixiy(t1) == S_IDHL)) { - outab(0x70|v2); - if (t1 != S_IDHL) - outrb(&e1, 0); - break; - } - if ((t2 == S_IMMED) && (gixiy(t1) == S_IDHL)) { - outab(0x36); - if (t1 != S_IDHL) - outrb(&e1, 0); - outrb(&e2, 0); - break; - } - if ((t1 == S_R8X) && (t2 == S_R8) && (v2 == A)) { - outab(0xED); - outab(v1); - break; - } - if ((t1 == S_R8) && (v1 == A) && (t2 == S_R8X)) { - outab(0xED); - outab(v2|0x10); - break; - } - if ((t1 == S_R16) && (v1 == SP)) { - if ((t2 == S_R16) && (gixiy(v2) == HL)) { - outab(0xF9); - break; - } - } - if ((t1 == S_R16) && (t2 == S_IDSP)) - { - if ( (v1=gixiy(v1)) == HL ) { - /* ljm - added rabbit instruction: - * LD HL|IX|IY, n(SP) - */ - outab(0xC4); - outrb(&e2); - break; - } - } - - if ((t1 == S_IDSP) && (t2 == S_R16)) - { - //printf( "at %s: %d, t1=%d, v1=%d, t2=%d, v2=%d\n", - // __FILE__, __LINE__, t1, v1, t2, v2 ); - if ( (v2=gixiy(v2)) == HL ) { - /* ljm - added rabbit instruction: - * LD HL|IX|IY, n(SP) - */ - outab(0xD4); - outrb(&e1); - break; - } - } - if ((t1 == S_R8) && (v1 == A)) { - if ((t2 == S_IDBC) || (t2 == S_IDDE)) { - outab(0x0A | ((t2-S_INDR)<<4)); - break; - } - } - if ((t2 == S_R8) && (v2 == A)) { - if ((t1 == S_IDBC) || (t1 == S_IDDE)) { - outab(0x02 | ((t1-S_INDR)<<4)); - break; - } - } - - /* load/save code bank register "xpc" */ - if ((t1 == S_RXPC) && (t2 == S_R8) && (v2 == A)) { - outab(0xED); - outab(0x67); - break; - } - - if ((t1 == S_RXPC) && r4k_mode && - (t2 == S_R16) && (v2 == HL)) { - outab(0x97); - break; - } - - if ((t2 == S_RXPC) && (t1 == S_R8) && (v1 == A)) { - outab(0xED); - outab(0x77); - break; - } - - if ((t2 == S_RXPC) && r4k_mode && - (t1 == S_R16) && (v1 == HL)) { - outab(0x9F); - break; - } - - /* 16-bit operations valid only in rabbit 4000 mode */ - if (r4k_mode && (t1 == S_R16) && (t2 == S_R16)) { - if ((v1 == HL) && ((v2 == BC) || (v2 == DE))) { - outab( 0x81 + ((v2==DE)?0x20:0x00) ); - break; - } - if ((v2 == HL) && ((v1 == BC) || (v1 == DE))) { - outab( 0x91 + ((v1==DE)?0x20:0x00) ); - break; - } - } - - /* 32-bit operations valid in rabbit 4000 mode */ - if (r4k_mode && ((t1 == S_R32_JKHL) || (t1 == S_R32_BCDE))) { - if (t2 == S_IDHL) { - outab( ((t1 == S_R32_JKHL)?JKHL_PG:BCDE_PG) ); - outab( 0x1A ); - break; - } - if ((t2 == S_IDIX) || (t2 == S_IDIY) || (t2 == S_IDSP)) { - outab( ((t1 == S_R32_JKHL)?JKHL_PG:BCDE_PG) ); - if (t2 == S_IDSP) - v2 = 0x20; - else - v2 = ((t2 == S_IDIY) ? 0x10 : 0x00); - - outab( 0xCE + v2 ); - outrb(&e2); - break; - } - if (t2 == S_INDM) { - outab( 0x93 + ((t1 == S_R32_JKHL) ? 1 : 0) ); - outrw(&e2, 0); - break; - } - if (t2 == S_IMMED) { - outab( 0xA3 + ((t1 == S_R32_JKHL) ? 1 : 0) ); - outrb(&e2); - break; - } - } - - if (r4k_mode && ((t2 == S_R32_JKHL) || (t2 == S_R32_BCDE))) { - if (t1 == S_IDHL) { - outab( ((t2 == S_R32_JKHL)?JKHL_PG:BCDE_PG) ); - outab( 0x1B ); - break; - } - if ((t1 == S_IDIX) || (t1 == S_IDIY) || (t1 == S_IDSP)) { - outab( ((t2 == S_R32_JKHL)?JKHL_PG:BCDE_PG) ); - if (t1 == S_IDSP) - v1 = 0x20; - else - v1 = ((t1 == S_IDIY) ? 0x10 : 0x00); - - outab( 0xCF + v1 ); - outrb(&e1); - break; - } - if (t1 == S_INDM) { - outab( 0x83 + ((t2 == S_R32_JKHL) ? 1 : 0) ); - outrw(&e1, 0); - break; - } - } - aerr(); - break; - - - - - case S_EX: - t1 = addr(&e1); - comma(1); - t2 = addr(&e2); - if (t2 == S_R16) { - v1 = (int) e1.e_addr; - v2 = (int) e2.e_addr; - if (t1 == S_R16) { - if ((v1 == DE) && (v2 == HL)) { - outab(0xEB); - break; - } - if (r4k_mode && (v1==BC) && (v2==HL)) { - outab(0xB3); - break; - } - } - - if ((t1 == S_IDSP) && (v1 == 0) && (v2!=HL)) { - /* 0xE3 is EX DE',HL on rabbit 2000 - * but DD/FD E3 "ex (sp),ix|iy" is valid - */ - if (gixiy(v2) == HL) { - outab(op); - break; - } - } - - } - if ((t1 == S_R16X) && (t2 == S_R16X)) { - outab(0x08); - break; - } - if ((t1==S_R32_JKHL) && (t2==S_R32_BCDE)) { - outab(0xB4); - break; - } - aerr(); - break; - - case S_IN: - case S_OUT: - outab(op); - break; - - case S_DEC: - case S_INC: - t1 = addr(&e1); - v1 = (int) e1.e_addr; - if (t1 == S_R8) { - outab(op|(v1<<3)); - break; - } - if (t1 == S_IDHL) { - outab(op|0x30); - break; - } - if (t1 != gixiy(t1)) { - outab(op|0x30); - outrb(&e1,0); - break; - } - if (t1 == S_R16) { - v1 = gixiy(v1); - if (rf == S_INC) { - outab(0x03|(v1<<4)); - break; - } - if (rf == S_DEC) { - outab(0x0B|(v1<<4)); - break; - } - } - aerr(); - break; - - case S_NEG: - if (!more()) { - /* "neg" implies "neg a" */ - outab(0xED); - outab(op); - break; - } - t1 = addr(&e1); - v1 = (int) e1.e_addr; - if ((t1 == S_R8) && (v1 == A)) { /* "neg a" */ - outab(0xED); - outab(op); - break; - } - - if ((t1 == S_R16) && (v1 == HL) && r4k_mode) { /* "neg hl" */ - outab(0x4D); - break; - } - - if (r4k_mode && - ((t1 == S_R32_JKHL) || (t1 == S_R32_BCDE))) { - /* neg jkhl|bcde */ - outab( ( (t1 == S_R32_BCDE) ? 0xDD : 0xFD ) ); - outab(0x4D); - break; - } - break; - - case S_DJNZ: - case S_JR: - if ((v1 = admode(CND)) != 0 && rf != S_DJNZ) { - if ((v1 &= 0xFF) <= 0x03) { - op += (v1+1)<<3; - } else { - aerr(); - } - comma(1); - } - expr(&e2, 0); - outab(op); - if (mchpcr(&e2)) { - v2 = (int) (e2.e_addr - dot.s_addr - 1); - if (pass == 2 && ((v2 < -128) || (v2 > 127))) - aerr(); - outab(v2); - } else { - outrb(&e2, R3_PCR); - } - if (e2.e_mode != S_USER) - rerr(); - break; - - case S_CALL: - op = 0xCD; - expr(&e1, 0); - outab(op); - outrw(&e1, 0); - break; - - case S_JP: - if ((v1 = admode(CND)) != 0) { - op |= (v1&0xFF)<<3; - comma(1); - expr(&e1, 0); - outab(op); - outrw(&e1, 0); - break; - } - t1 = addr(&e1); - if (t1 == S_USER) { - outab(0xC3); - outrw(&e1, 0); - break; - } - if ((e1.e_addr == 0) && (gixiy(t1) == S_IDHL)) { - outab(0xE9); - break; - } - aerr(); - break; - - case X_HD64: - ++hd64; - break; - - case X_INH2: - outab(0xED); - outab(op); - break; - - case X_IN: - case X_OUT: - if (rf == X_IN) { - t1 = addr(&e1); - comma(1); - t2 = addr(&e2); - } else { - t2 = addr(&e2); - comma(1); - t1 = addr(&e1); - } - if ((t1 == S_R8) && (t2 == S_INDM)) { - outab(0xED); - outab(op | (e1.e_addr<<3)); - outrb(&e2, 0); - break; - } - aerr(); - break; - - case X_MLT: - t1 = addr(&e1); - if ((t1 == S_R16) && ((v1 = (int) e1.e_addr) <= SP)) { - outab(0xED); - outab(op | (v1<<4)); - break; - } - aerr(); - break; - - case X_TST: - t1 = addr(&e1); - if (t1 == S_R8) { - outab(0xED); - outab(op | (e1.e_addr<<3)); - break; - } - if (t1 == S_IDHL) { - outab(0xED); - outab(0x34); - break; - } - if (t1 == S_IMMED) { - outab(0xED); - outab(0x64); - outrb(&e1, 0); - break; - } - aerr(); - break; - - case X_TSTIO: - t1 = addr(&e1); - if (t1 == S_IMMED) { - outab(0xED); - outab(op); - outrb(&e1, 0); - break; - } - aerr(); - break; - - case X_LJP: - case X_LCALL: - /* bank jump or call for rabbit processor */ - t1 = addr(&e1); - comma(1); - t2 = addr(&e2); - v1 = (int) e1.e_addr; - if ((t1 == S_USER) && (t2 == S_IMMED)) { - outab(op); - outrw(&e1, 0); - outrb(&e2, 0); - break; - } - break; - - case X_BOOL: - t1 = addr(&e1); - v1 = (int) e1.e_addr; - if ((t1 == S_R16) && ((v1 == HL) || (v1 == IX) || (v1 == IY))) { - v1 = gixiy(v1); - outab(op); - break; - } - aerr( ); - break; - - case X_R4K_MODE: - r4k_mode=1; - break; - - case X_R4K_MULU: - if (!r4k_mode) - err('o'); - - outab(op); - break; - - case X_JRE: - if (!r4k_mode) - err('o'); - - if ((v1 = admode(ALT_CND)) != 0) { - op += v1<<3; - comma(1); - } else { - op = 0x98; - } - expr(&e2, 0); - outab(op); - if (mchpcr(&e2)) { - v2 = (int) (e2.e_addr - dot.s_addr - 1); - if (pass == 2 && ((v2 < -32768) || (v2 > 32767))) - aerr(); - outab( (v2 & 0xFF) ); - outab( (v2 >> 8) ); - } else { - outrb(&e2, R3_PCR); - } - if (e2.e_mode != S_USER) - rerr(); - break; - - case X_CLR: - if (!r4k_mode) - err('o'); - t1 = addr(&e1); - v1 = (int) e1.e_addr; - if ((t1 == S_R16) && (v1 == HL)) { - outab(op); - break; - } - aerr( ); - break; - - default: - err('o'); - } + + if (genop(0, op, &e2, 1)) + aerr(); + + break; + } + + if ((t1 == S_R16) && (v1 == HL) && + (t2 == S_R16) && (rf == S_SBC)) { + /* sbc hl, [bc|de|hl|sp] */ + if ( v2 != gixiy(v2) ) + /* sorry, sbc hl, [ix|iy] do not exist */ + aerr( ); + + outab(0xED); + outab(0x42 | v2 << 4); + break; + } + if ((t1 == S_R16) && (v1 == HL) && + (t2 == S_R16) && (v2 == DE)) { + /* 55 sub hl, de */ + /* sbc hl, de does not exist */ + /* DC and hl, de */ + /* 54 xor hl, de */ + /* EC or hl, de */ + /* ED 48 cp hl, de */ + if (rf == S_SBC) /* op == 0x98 */ + aerr( ); + + switch( op ) { + case 0x90: /* sub */ outab(0x55); break; + case 0xA0: /* and */ outab(0xDC); break; + case 0xA8: /* xor */ outab(0x54); break; + case 0xB0: /* or */ outab(0xEC); break; + case 0xB8: /* cp */ + outab( 0xED ); + outab( 0x48 ); + break; + } + break; + } + + if ((t1 == S_R16) && ((v1 == IX) || (v1 == IY)) && + (t2 == S_R16) && (v2 == DE) && + ((op == 0xA0 /* and */) || (op == 0xB0 /* or */))) { + v1 = gixiy(v1); + outab(op + 0x3C); + break; + } + + if ((t1 == S_R32_JKHL) && (t2 == S_R32_BCDE)) { + /* ED D6 sub jkhl, bcde */ + /* sbc jkhl, bcde does not exist */ + /* ED E6 and jkhl, bcde */ + /* ED EE xor jkhl, bcde */ + /* ED F6 or jkhl, bcde */ + /* ED 58 cp jkhl, bcde */ + if (rf == S_SBC) /* op == 0x98 */ + aerr( ); + + outab(0xED); + switch( op ) { + case 0x90: /* sub */ outab(0xD6); break; + case 0xA0: /* and */ outab(0xE6); break; + case 0xA8: /* xor */ outab(0xEE); break; + case 0xB0: /* or */ outab(0xF6); break; + case 0xB8: /* cp */ outab(0x58); break; + } + break; + } + + if ((t1 == S_R16) && (v1 == HL) && (t2 == S_IMMED)) { + /* cp hl, #signed displacement */ + outab(0x48); + outrb(&e2, 0); + break; + } + + aerr( ); + break; + + case S_ADD: + case S_ADC: + t1 = addr(&e1); + t2 = 0; + if (more()) { + comma(1); + t2 = addr(&e2); + } + if (t2 == 0) { + /* implied destination of the 8-bit 'a' register */ + if ((t1 == S_R8) || (t1 == S_IDHL)) { + /* ljm - rabbit 4000 support + * (add,adc,sub,sbc,and,xor,or,cp) A,R or A,(HL) + * needs a 0x7F prefix byte when + * operating in rabbit 4000 mode + */ + if (r4k_mode) + outab(0x7F); + } + + if (genop(0, op, &e1, 1)) + aerr(); + break; + } + if ((t1 == S_R8) && (e1.e_addr == A)) { + if ( ((t2 == S_R8) || (t2 == S_IDHL)) && r4k_mode ) + /* ljm - rabbit 4000 support, see note in t2==0 */ + outab(0x7F); + + if (genop(0, op, &e2, 1)) + aerr(); + break; + } + + if ((t1 == S_R32_JKHL) && (t2 == S_R32_BCDE) && + (rf == S_ADD)) { + /* rabbit 4000 - ED C6 "add jkhl, bcde" */ + outab(0xED); + outab(0xC6); + break; + } + + v1 = (int) e1.e_addr; + v2 = (int) e2.e_addr; + + if ((t1 == S_R16) && (v1 == SP) && (t2 == S_IMMED)) { + /* rabbit 4000 - add sp,#n n=signed displacement */ + outab(0x27); + outrb(&e2, 0); + break; + } + + if ((t1 == S_R16) && (v1 == HL) && (t2 == S_R16)) { + if (v2 > SP) + aerr( ); + + if (rf == S_ADC) + outab(0xED); + + op = (rf == S_ADD) ? 0x09 : 0x4A; + outab(op | (v2 << 4) ); + break; + } + + if ((t1 == S_R16) && ((v1 == IX) || (v1 == IY)) && + (t2 == S_R16)) + { + if ((v2 == HL) || + (((v2 == IX) || (v2 == IY)) && (v2 != v1))) + aerr( ); + + if ((v2 == IX) || (v2 == IY)) + v2 = HL; + + gixiy(v1); + outab(0x09 | (v2 << 4)); + break; + } + aerr(); + break; + + case S_LD: + t1 = addr(&e1); + comma(1); + t2 = addr(&e2); + + v1 = (int) e1.e_addr; + v2 = (int) e2.e_addr; + if (t1 == S_R8) + { + if (t2 == S_IMMED) { + outab((e1.e_addr<<3) | 0x06); + outrb(&e2, 0); + break; + } + + if (r4k_mode && (v1 == A) && (t2 == S_R8) && (v2 == A)) { + /* exception for "ld a,a" + * on rabbit 4000 0x7F is a prefix instead of "ld a,a" + */ + aerr( ); + } + + if ((v1 == A) && (t2 == S_R8)) { + /* "ld a,r", (except "ld a,a") */ + v1 = op | e1.e_addr<<3; + if (genop(0, v1, &e2, 0)) + aerr( ); + break; + } + + /* ld [b,c,d,e,h,l,a], _ */ + if ((t2 == S_R8) && (v2 != A)) { + /* 8-bit register to 8-bit register */ + /* use 0x7F prefix when in rabbit 4000 mode */ + v1 = op | e1.e_addr<<3; + if (r4k_mode) + outab(0x7F); + if (genop(0, v1, &e2, 0) == 0) + break; + + aerr( ); + } + + if ((t2 == S_R8) && (v2 == A) && + ((v1 != A) || (!r4k_mode))) { + /* "ld r,a", but except "ld a,a" + * on rabbit 4000 0x7F is a prefix instead of "ld a,a" */ + v1 = op | e1.e_addr<<3; + if (genop(0, v1, &e2, 0)) + aerr( ); + break; + } + + if ((t2 == S_IDHL) || (t2 == S_IDIX) || (t2 == S_IDIY)) { + /* "ld r,(hl)" or "ld r,disp (ix|iy)" */ + v1 = op | e1.e_addr<<3; + if (genop(0, v1, &e2, 0)) + aerr( ); + break; + } + } + + if ((t1 == S_R16) && (t2 == S_IMMED)) { + v1 = gixiy(v1); /* generayes prefix when ix or iy */ + outab(0x01|(v1<<4)); + outrw(&e2, 0); + break; + } + if ((t1 == S_R16) && (t2 == S_INDM)) { + if (gixiy(v1) == HL) { + outab(0x2A); + } else { + outab(0xED); + outab(0x4B | (v1<<4)); + } + outrw(&e2, 0); + break; + } + if ((t1 == S_R16) && (v1 == HL)) + { + if ((t2 == S_IDIX) || (t2 == S_IDIY) || + (t2 == S_IDHL) || (t2 == S_IDHL_OFFSET)) + { + /* ljm - added rabbit instruction LD HL,n(IX|HL|IY) */ + if (t2 == S_IDIY) + outab(0xFD); + else if ((t2 == S_IDHL) || (t2 == S_IDHL_OFFSET)) + /* ljm - added rabbit instruction LD HL,n(IY) + * normally 0xFD generated by "gixiy(v1)", but + * 0xDD results in n(HL) instead of n(IX) + */ + outab(0xDD); + + outab(0xE4); + outrb(&e2, 0); + break; + } + if ((t2 == S_R16) && ((v2 == IX) || (v2 == IY))) { + outab( ((v2==IX)?0xDD:0xFD) ); + outab(0x7C); + break; + } + if (r4k_mode) { + if ((t2 == S_R16) && ((v2 == BC) || (v2 == DE))) { + outab( 0x81 + ((v2 == DE) ? 0x20 : 0) ); + break; + } + } + } + if ((t2 == S_R16) && (v2 == HL)) /* ld n(IX|IY|HL), HL */ + { + if ((t1 == S_IDIY) || (t1 == S_IDHL) || + (t1 == S_IDHL_OFFSET)) + outab( ((t1==S_IDIY) ? 0xFD : 0xDD) ); + + if ((t1 == S_IDIY) || (t1 == S_IDIX) || + (t1 == S_IDHL) || (t1 == S_IDHL_OFFSET)) { + outab(0xF4); + outrb(&e2, 0); + break; + } + + if ((t1 == S_R16) && ((v1 == IX) || (v1 == IY))) { + outab( ((v1==IX)?0xDD:0xFD) ); + outab(0x7D); + break; + } + } + if ((t1 == S_INDM) && (t2 == S_R16)) { + if (gixiy(v2) == HL) { + outab(0x22); + } else { + outab(0xED); + outab(0x43 | (v2<<4)); + } + outrw(&e1, 0); + break; + } + if ((t1 == S_R8) && (v1 == A) && (t2 == S_INDM)) { + outab(0x3A); + outrw(&e2, 0); + break; + } + if ((t1 == S_INDM) && (t2 == S_R8) && (v2 == A)) { + outab(0x32); + outrw(&e1, 0); + break; + } + if ((t2 == S_R8) && (gixiy(t1) == S_IDHL)) { + outab(0x70|v2); + if (t1 != S_IDHL) + outrb(&e1, 0); + break; + } + if ((t2 == S_IMMED) && (gixiy(t1) == S_IDHL)) { + outab(0x36); + if (t1 != S_IDHL) + outrb(&e1, 0); + outrb(&e2, 0); + break; + } + if ((t1 == S_R8X) && (t2 == S_R8) && (v2 == A)) { + outab(0xED); + outab(v1); + break; + } + if ((t1 == S_R8) && (v1 == A) && (t2 == S_R8X)) { + outab(0xED); + outab(v2|0x10); + break; + } + if ((t1 == S_R16) && (v1 == SP)) { + if ((t2 == S_R16) && (gixiy(v2) == HL)) { + outab(0xF9); + break; + } + } + if ((t1 == S_R16) && (t2 == S_IDSP)) + { + if ( (v1=gixiy(v1)) == HL ) { + /* ljm - added rabbit instruction: + * LD HL|IX|IY, n(SP) + */ + outab(0xC4); + outrb(&e2, 0); + break; + } + } + + if ((t1 == S_IDSP) && (t2 == S_R16)) + { + //printf( "at %s: %d, t1=%d, v1=%d, t2=%d, v2=%d\n", + // __FILE__, __LINE__, t1, v1, t2, v2 ); + if ( (v2=gixiy(v2)) == HL ) { + /* ljm - added rabbit instruction: + * LD HL|IX|IY, n(SP) + */ + outab(0xD4); + outrb(&e1, 0); + break; + } + } + if ((t1 == S_R8) && (v1 == A)) { + if ((t2 == S_IDBC) || (t2 == S_IDDE)) { + outab(0x0A | ((t2-S_INDR)<<4)); + break; + } + } + if ((t2 == S_R8) && (v2 == A)) { + if ((t1 == S_IDBC) || (t1 == S_IDDE)) { + outab(0x02 | ((t1-S_INDR)<<4)); + break; + } + } + + /* load/save code bank register "xpc" */ + if ((t1 == S_RXPC) && (t2 == S_R8) && (v2 == A)) { + outab(0xED); + outab(0x67); + break; + } + + if ((t1 == S_RXPC) && r4k_mode && + (t2 == S_R16) && (v2 == HL)) { + outab(0x97); + break; + } + + if ((t2 == S_RXPC) && (t1 == S_R8) && (v1 == A)) { + outab(0xED); + outab(0x77); + break; + } + + if ((t2 == S_RXPC) && r4k_mode && + (t1 == S_R16) && (v1 == HL)) { + outab(0x9F); + break; + } + + /* 16-bit operations valid only in rabbit 4000 mode */ + if (r4k_mode && (t1 == S_R16) && (t2 == S_R16)) { + if ((v1 == HL) && ((v2 == BC) || (v2 == DE))) { + outab( 0x81 + ((v2==DE)?0x20:0x00) ); + break; + } + if ((v2 == HL) && ((v1 == BC) || (v1 == DE))) { + outab( 0x91 + ((v1==DE)?0x20:0x00) ); + break; + } + } + + /* 32-bit operations valid in rabbit 4000 mode */ + if (r4k_mode && ((t1 == S_R32_JKHL) || (t1 == S_R32_BCDE))) { + if (t2 == S_IDHL) { + outab( ((t1 == S_R32_JKHL)?JKHL_PG:BCDE_PG) ); + outab( 0x1A ); + break; + } + if ((t2 == S_IDIX) || (t2 == S_IDIY) || (t2 == S_IDSP)) { + outab( ((t1 == S_R32_JKHL)?JKHL_PG:BCDE_PG) ); + if (t2 == S_IDSP) + v2 = 0x20; + else + v2 = ((t2 == S_IDIY) ? 0x10 : 0x00); + + outab( 0xCE + v2 ); + outrb(&e2, 0); + break; + } + if (t2 == S_INDM) { + outab( 0x93 + ((t1 == S_R32_JKHL) ? 1 : 0) ); + outrw(&e2, 0); + break; + } + if (t2 == S_IMMED) { + outab( 0xA3 + ((t1 == S_R32_JKHL) ? 1 : 0) ); + outrb(&e2, 0); + break; + } + } + + if (r4k_mode && ((t2 == S_R32_JKHL) || (t2 == S_R32_BCDE))) { + if (t1 == S_IDHL) { + outab( ((t2 == S_R32_JKHL)?JKHL_PG:BCDE_PG) ); + outab( 0x1B ); + break; + } + if ((t1 == S_IDIX) || (t1 == S_IDIY) || (t1 == S_IDSP)) { + outab( ((t2 == S_R32_JKHL)?JKHL_PG:BCDE_PG) ); + if (t1 == S_IDSP) + v1 = 0x20; + else + v1 = ((t1 == S_IDIY) ? 0x10 : 0x00); + + outab( 0xCF + v1 ); + outrb(&e1, 0); + break; + } + if (t1 == S_INDM) { + outab( 0x83 + ((t2 == S_R32_JKHL) ? 1 : 0) ); + outrw(&e1, 0); + break; + } + } + aerr(); + break; + + case S_EX: + t1 = addr(&e1); + comma(1); + t2 = addr(&e2); + if (t2 == S_R16) { + v1 = (int) e1.e_addr; + v2 = (int) e2.e_addr; + if (t1 == S_R16) { + if ((v1 == DE) && (v2 == HL)) { + outab(0xEB); + break; + } + if (r4k_mode && (v1==BC) && (v2==HL)) { + outab(0xB3); + break; + } + } + + if ((t1 == S_IDSP) && (v1 == 0) && (v2!=HL)) { + /* 0xE3 is EX DE',HL on rabbit 2000 + * but DD/FD E3 "ex (sp),ix|iy" is valid + */ + if (gixiy(v2) == HL) { + outab(op); + break; + } + } + + } + if ((t1 == S_R16X) && (t2 == S_R16X)) { + outab(0x08); + break; + } + if ((t1==S_R32_JKHL) && (t2==S_R32_BCDE)) { + outab(0xB4); + break; + } + aerr(); + break; + + case S_IN: + case S_OUT: + outab(op); + break; + + case S_DEC: + case S_INC: + t1 = addr(&e1); + v1 = (int) e1.e_addr; + if (t1 == S_R8) { + outab(op|(v1<<3)); + break; + } + if (t1 == S_IDHL) { + outab(op|0x30); + break; + } + if (t1 != gixiy(t1)) { + outab(op|0x30); + outrb(&e1, 0); + break; + } + if (t1 == S_R16) { + v1 = gixiy(v1); + if (rf == S_INC) { + outab(0x03|(v1<<4)); + break; + } + if (rf == S_DEC) { + outab(0x0B|(v1<<4)); + break; + } + } + aerr(); + break; + + case S_NEG: + if (!more()) { + /* "neg" implies "neg a" */ + outab(0xED); + outab(op); + break; + } + t1 = addr(&e1); + v1 = (int) e1.e_addr; + if ((t1 == S_R8) && (v1 == A)) { /* "neg a" */ + outab(0xED); + outab(op); + break; + } + + if ((t1 == S_R16) && (v1 == HL) && r4k_mode) { /* "neg hl" */ + outab(0x4D); + break; + } + + if (r4k_mode && + ((t1 == S_R32_JKHL) || (t1 == S_R32_BCDE))) { + /* neg jkhl|bcde */ + outab( ( (t1 == S_R32_BCDE) ? 0xDD : 0xFD ) ); + outab(0x4D); + break; + } + break; + + case S_DJNZ: + case S_JR: + if ((v1 = admode(CND)) != 0 && rf != S_DJNZ) { + if ((v1 &= 0xFF) <= 0x03) { + op += (v1+1)<<3; + } else { + aerr(); + } + comma(1); + } + expr(&e2, 0); + outab(op); + if (mchpcr(&e2)) { + v2 = (int) (e2.e_addr - dot.s_addr - 1); + if (pass == 2 && ((v2 < -128) || (v2 > 127))) + aerr(); + outab(v2); + } else { + outrb(&e2, R3_PCR); + } + if (e2.e_mode != S_USER) + rerr(); + break; + + case S_CALL: + op = 0xCD; + expr(&e1, 0); + outab(op); + outrw(&e1, 0); + break; + + case S_JP: + if ((v1 = admode(CND)) != 0) { + op |= (v1&0xFF)<<3; + comma(1); + expr(&e1, 0); + outab(op); + outrw(&e1, 0); + break; + } + t1 = addr(&e1); + if (t1 == S_USER) { + outab(0xC3); + outrw(&e1, 0); + break; + } + if ((e1.e_addr == 0) && (gixiy(t1) == S_IDHL)) { + outab(0xE9); + break; + } + aerr(); + break; + + case X_HD64: + ++hd64; + break; + + case X_INH2: + outab(0xED); + outab(op); + break; + + case X_IN: + case X_OUT: + if (rf == X_IN) { + t1 = addr(&e1); + comma(1); + t2 = addr(&e2); + } else { + t2 = addr(&e2); + comma(1); + t1 = addr(&e1); + } + if ((t1 == S_R8) && (t2 == S_INDM)) { + outab(0xED); + outab(op | (e1.e_addr<<3)); + outrb(&e2, 0); + break; + } + aerr(); + break; + + case X_MLT: + t1 = addr(&e1); + if ((t1 == S_R16) && ((v1 = (int) e1.e_addr) <= SP)) { + outab(0xED); + outab(op | (v1<<4)); + break; + } + aerr(); + break; + + case X_TST: + t1 = addr(&e1); + if (t1 == S_R8) { + outab(0xED); + outab(op | (e1.e_addr<<3)); + break; + } + if (t1 == S_IDHL) { + outab(0xED); + outab(0x34); + break; + } + if (t1 == S_IMMED) { + outab(0xED); + outab(0x64); + outrb(&e1, 0); + break; + } + aerr(); + break; + + case X_TSTIO: + t1 = addr(&e1); + if (t1 == S_IMMED) { + outab(0xED); + outab(op); + outrb(&e1, 0); + break; + } + aerr(); + break; + + case X_LJP: + case X_LCALL: + /* bank jump or call for rabbit processor */ + t1 = addr(&e1); + comma(1); + t2 = addr(&e2); + v1 = (int) e1.e_addr; + if ((t1 == S_USER) && (t2 == S_IMMED)) { + outab(op); + outrw(&e1, 0); + outrb(&e2, 0); + break; + } + break; + + case X_BOOL: + t1 = addr(&e1); + v1 = (int) e1.e_addr; + if ((t1 == S_R16) && ((v1 == HL) || (v1 == IX) || (v1 == IY))) { + v1 = gixiy(v1); + outab(op); + break; + } + aerr( ); + break; + + case X_R3K_MODE: + r3k_mode=1; + break; + + case R3K_INH1: + if (!(r3k_mode || r4k_mode)) + err('o'); + + outab(op); + break; + + case R3K_INH2: + if (!(r3k_mode || r4k_mode)) + err('o'); + + outab(0xED); + outab(op); + break; + + case X_R4K_MODE: + r4k_mode=1; + break; + + case R4K_INH2: + if (!r4k_mode) + err('o'); + + outab(0xED); + outab(op); + break; + + case X_R4K_MULU: + if (!r4k_mode) + err('o'); + + outab(op); + break; + + case X_JRE: + if (!r4k_mode) + err('o'); + + if ((v1 = admode(ALT_CND)) != 0) { + op += v1<<3; + comma(1); + } else { + op = 0x98; + } + expr(&e2, 0); + outab(op); + if (mchpcr(&e2)) { + v2 = (int) (e2.e_addr - dot.s_addr - 1); + if (pass == 2 && ((v2 < -32768) || (v2 > 32767))) + aerr(); + outab( (v2 & 0xFF) ); + outab( (v2 >> 8) ); + } else { + outrb(&e2, R3_PCR); + } + if (e2.e_mode != S_USER) + rerr(); + break; + + case X_CLR: + if (!r4k_mode) + err('o'); + t1 = addr(&e1); + v1 = (int) e1.e_addr; + if ((t1 == S_R16) && (v1 == HL)) { + outab(op); + break; + } + aerr( ); + break; + + default: + err('o'); + } } /* @@ -1060,67 +1083,73 @@ * return(0) if general addressing mode output, else * return(esp->e_mode) */ -int -genop(pop, op, esp, f) -int pop, op; -struct expr *esp; -int f; +int genop(int pop, int op, struct expr *esp, int f) { - int t1; - if ((t1 = esp->e_mode) == S_R8) { - if (pop) - outab(pop); - outab(op|esp->e_addr); - return(0); - } - if (t1 == S_IDHL) { - if (pop) - outab(pop); - outab(op|0x06); - return(0); - } - if (gixiy(t1) == S_IDHL) { - if (pop) { - outab(pop); - outrb(esp,0); - outab(op|0x06); - } else { - outab(op|0x06); - outrb(esp,0); - } - return(0); - } - if ((t1 == S_IMMED) && (f)) { - if (pop) - outab(pop); - outab(op|0x46); - outrb(esp,0); - return(0); - } - return(t1); + int t1; + + if ((t1 = esp->e_mode) == S_R8) + { + if (pop) + outab(pop); + + outab(op|esp->e_addr); + return(0); + } + + if (t1 == S_IDHL) + { + if (pop) + outab(pop); + + outab(op|0x06); + return(0); + } + + if (gixiy(t1) == S_IDHL) + { + if (pop) { + outab(pop); + outrb(esp, 0); + outab(op|0x06); + } else { + outab(op|0x06); + outrb(esp, 0); + } + return(0); + } + + if ((t1 == S_IMMED) && (f)) + { + if (pop) + outab(pop); + + outab(op|0x46); + outrb(esp, 0); + return(0); + } + + return(t1); } /* * IX and IY prebyte check */ -int -gixiy(v) -int v; +int gixiy(int v) { - if (v == IX) { - v = HL; - outab(0xDD); - } else if (v == IY) { - v = HL; - outab(0xFD); - } else if (v == S_IDIX) { - v = S_IDHL; - outab(0xDD); - } else if (v == S_IDIY) { - v = S_IDHL; - outab(0xFD); - } - return(v); + if (v == IX) { + v = HL; + outab(0xDD); + } else if (v == IY) { + v = HL; + outab(0xFD); + } else if (v == S_IDIX) { + v = S_IDHL; + outab(0xDD); + } else if (v == S_IDIY) { + v = S_IDHL; + outab(0xFD); + } + return(v); } /* @@ -1130,30 +1159,30 @@ mchpcr(esp) struct expr *esp; { - if (esp->e_base.e_ap == dot.s_area) { - return(1); - } - if (esp->e_flag==0 && esp->e_base.e_ap==NULL) { - /* - * Absolute Destination - * - * Use the global symbol '.__.ABS.' - * of value zero and force the assembler - * to use this absolute constant as the - * base value for the relocation. - */ - esp->e_flag = 1; - esp->e_base.e_sp = &sym[1]; - } - return(0); + if (esp->e_base.e_ap == dot.s_area) { + return(1); + } + if (esp->e_flag==0 && esp->e_base.e_ap==NULL) { + /* + * Absolute Destination + * + * Use the global symbol '.__.ABS.' + * of value zero and force the assembler + * to use this absolute constant as the + * base value for the relocation. + */ + esp->e_flag = 1; + esp->e_base.e_sp = &sym[1]; + } + return(0); } /* * Machine dependent initialization */ -VOID -minit() +VOID minit() { - hd64 = 0; - r4k_mode = 0; + hd64 = 0; + r3k_mode = 0; + r4k_mode = 0; } diff -Nru sdcc-3.1.0+dfsg/sdas/asrab/rabbitpst.c sdcc-3.2.0+dfsg/sdas/asrab/rabbitpst.c --- sdcc-3.1.0+dfsg/sdas/asrab/rabbitpst.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asrab/rabbitpst.c 2012-05-20 23:43:48.000000000 +0000 @@ -23,154 +23,169 @@ * and rabbit 4000 instruction sets (2011) */ -#include -#include #include "asxxxx.h" #include "rabbit.h" -struct mne mne[] = { +struct mne mne[] = { - /* machine */ + /* machine */ - /* system */ + /* system */ - { NULL, "CON", S_ATYP, 0, A3_CON }, - { NULL, "OVR", S_ATYP, 0, A3_OVR }, - { NULL, "REL", S_ATYP, 0, A3_REL }, - { NULL, "ABS", S_ATYP, 0, A3_ABS }, - { NULL, "NOPAG", S_ATYP, 0, A3_NOPAG }, - { NULL, "PAG", S_ATYP, 0, A3_PAG }, - - { NULL, ".byte", S_BYTE, 0, 0 }, - { NULL, ".db", S_BYTE, 0, 0 }, - { NULL, ".word", S_WORD, 0, 0 }, - { NULL, ".dw", S_WORD, 0, 0 }, - { NULL, ".df", S_FLOAT, 0, 0 }, - { NULL, ".ascii", S_ASCII, 0, 0 }, - { NULL, ".asciz", S_ASCIZ, 0, 0 }, - { NULL, ".blkb", S_BLK, 0, 1 }, - { NULL, ".ds", S_BLK, 0, 1 }, - { NULL, ".blkw", S_BLK, 0, 2 }, - { NULL, ".page", S_PAGE, 0, 0 }, - { NULL, ".title", S_TITLE, 0, 0 }, - { NULL, ".sbttl", S_SBTL, 0, 0 }, - { NULL, ".globl", S_GLOBL, 0, 0 }, - { NULL, ".area", S_DAREA, 0, 0 }, - { NULL, ".even", S_EVEN, 0, 0 }, - { NULL, ".odd", S_ODD, 0, 0 }, - { NULL, ".if", S_IF, 0, 0 }, - { NULL, ".else", S_ELSE, 0, 0 }, - { NULL, ".endif", S_ENDIF, 0, 0 }, - { NULL, ".include", S_INCL, 0, 0 }, - { NULL, ".radix", S_RADIX, 0, 0 }, - { NULL, ".org", S_ORG, 0, 0 }, - { NULL, ".module", S_MODUL, 0, 0 }, - { NULL, ".ascis", S_ASCIS, 0, 0 }, + { NULL, "CON", S_ATYP, 0, A3_CON }, + { NULL, "OVR", S_ATYP, 0, A3_OVR }, + { NULL, "REL", S_ATYP, 0, A3_REL }, + { NULL, "ABS", S_ATYP, 0, A3_ABS }, + { NULL, "NOPAG", S_ATYP, 0, A3_NOPAG }, + { NULL, "PAG", S_ATYP, 0, A3_PAG }, + + { NULL, ".byte", S_BYTE, 0, 0 }, + { NULL, ".db", S_BYTE, 0, 0 }, + { NULL, ".word", S_WORD, 0, 0 }, + { NULL, ".dw", S_WORD, 0, 0 }, + { NULL, ".df", S_FLOAT, 0, 0 }, + { NULL, ".ascii", S_ASCII, 0, 0 }, + { NULL, ".asciz", S_ASCIZ, 0, 0 }, + { NULL, ".blkb", S_BLK, 0, 1 }, + { NULL, ".ds", S_BLK, 0, 1 }, + { NULL, ".blkw", S_BLK, 0, 2 }, + { NULL, ".page", S_PAGE, 0, 0 }, + { NULL, ".title", S_TITLE, 0, 0 }, + { NULL, ".sbttl", S_SBTL, 0, 0 }, + { NULL, ".globl", S_GLOBL, 0, 0 }, + { NULL, ".area", S_DAREA, 0, 0 }, + { NULL, ".even", S_EVEN, 0, 0 }, + { NULL, ".odd", S_ODD, 0, 0 }, + { NULL, ".if", S_IF, 0, 0 }, + { NULL, ".else", S_ELSE, 0, 0 }, + { NULL, ".endif", S_ENDIF, 0, 0 }, + { NULL, ".include", S_INCL, 0, 0 }, + { NULL, ".radix", S_RADIX, 0, 0 }, + { NULL, ".org", S_ORG, 0, 0 }, + { NULL, ".module", S_MODUL, 0, 0 }, + { NULL, ".ascis", S_ASCIS, 0, 0 }, /* sdas specific */ - { NULL, ".optsdcc", S_OPTSDCC, 0, 0 }, + { NULL, ".optsdcc", S_OPTSDCC, 0, 0 }, /* end sdas specific */ - /* rabbit (warning: derived from "z80 / hd64180") */ + /* rabbit (warning: derived from "z80 / hd64180") */ - { NULL, "ld", S_LD, 0, 0x40 }, + { NULL, "ld", S_LD, 0, 0x40 }, - { NULL, "call", S_CALL, 0, 0xC4 }, - { NULL, "jp", S_JP, 0, 0xC2 }, - { NULL, "jr", S_JR, 0, 0x18 }, - { NULL, "djnz", S_DJNZ, 0, 0x10 }, - { NULL, "ret", S_RET, 0, 0xC0 }, - - { NULL, "bit", S_BIT, 0, 0x40 }, - { NULL, "res", S_BIT, 0, 0x80 }, - { NULL, "set", S_BIT, 0, 0xC0 }, - - { NULL, "inc", S_INC, 0, 0x04 }, - { NULL, "dec", S_DEC, 0, 0x05 }, - - { NULL, "add", S_ADD, 0, 0x80 }, - { NULL, "adc", S_ADC, 0, 0x88 }, - { NULL, "sub", S_SUB, 0, 0x90 }, - { NULL, "sbc", S_SBC, 0, 0x98 }, - - { NULL, "and", S_AND, 0, 0xA0 }, - { NULL, "cp", S_AND, 0, 0xB8 }, - { NULL, "or", S_AND, 0, 0xB0 }, - { NULL, "xor", S_AND, 0, 0xA8 }, - - { NULL, "ex", S_EX, 0, 0xE3 }, - - { NULL, "push", S_PUSH, 0, 0xC5 }, - { NULL, "pop", S_PUSH, 0, 0xC1 }, - - /* { NULL, "in", S_IN, 0, 0xDB }, */ - /* { NULL, "out", S_OUT, 0, 0xD3 }, */ - { NULL, "ioi", S_IN, 0, 0xD3 }, - { NULL, "ioe", S_OUT, 0, 0xDB }, - - { NULL, "rl", S_RL, 0, 0x10 }, - { NULL, "rlc", S_RL, 0, 0x00 }, - { NULL, "rr", S_RL, 0, 0x18 }, - { NULL, "rrc", S_RL, 0, 0x08 }, - { NULL, "sla", S_RL, 0, 0x20 }, - { NULL, "sra", S_RL, 0, 0x28 }, - { NULL, "srl", S_RL, 0, 0x38 }, - - { NULL, "rst", S_RST, 0, 0xC7 }, - - /* { NULL, "im", S_IM, 0, 0xED }, */ - - { NULL, "ccf", S_INH1, 0, 0x3F }, - { NULL, "cpl", S_INH1, 0, 0x2F }, - /* { NULL, "daa", S_INH1, 0, 0x27 }, */ - /* { NULL, "di", S_INH1, 0, 0xF3 }, */ - /* { NULL, "ei", S_INH1, 0, 0xFB }, */ + { NULL, "call", S_CALL, 0, 0xC4 }, + { NULL, "jp", S_JP, 0, 0xC2 }, + { NULL, "jr", S_JR, 0, 0x18 }, + { NULL, "djnz", S_DJNZ, 0, 0x10 }, + { NULL, "ret", S_RET, 0, 0xC0 }, + + { NULL, "bit", S_BIT, 0, 0x40 }, + { NULL, "res", S_BIT, 0, 0x80 }, + { NULL, "set", S_BIT, 0, 0xC0 }, + + { NULL, "inc", S_INC, 0, 0x04 }, + { NULL, "dec", S_DEC, 0, 0x05 }, + + { NULL, "add", S_ADD, 0, 0x80 }, + { NULL, "adc", S_ADC, 0, 0x88 }, + { NULL, "sub", S_SUB, 0, 0x90 }, + { NULL, "sbc", S_SBC, 0, 0x98 }, + + { NULL, "and", S_AND, 0, 0xA0 }, + { NULL, "cp", S_AND, 0, 0xB8 }, + { NULL, "or", S_AND, 0, 0xB0 }, + { NULL, "xor", S_AND, 0, 0xA8 }, + + { NULL, "ex", S_EX, 0, 0xE3 }, + + { NULL, "push", S_PUSH, 0, 0xC5 }, + { NULL, "pop", S_PUSH, 0, 0xC1 }, + + /* { NULL, "in", S_IN, 0, 0xDB }, */ + /* { NULL, "out", S_OUT, 0, 0xD3 }, */ + { NULL, "ioi", S_IN, 0, 0xD3 }, + { NULL, "ioe", S_OUT, 0, 0xDB }, + + { NULL, "rl", S_RL, 0, 0x10 }, + { NULL, "rlc", S_RL, 0, 0x00 }, + { NULL, "rr", S_RL, 0, 0x18 }, + { NULL, "rrc", S_RL, 0, 0x08 }, + { NULL, "sla", S_RL, 0, 0x20 }, + { NULL, "sra", S_RL, 0, 0x28 }, + { NULL, "srl", S_RL, 0, 0x38 }, + + { NULL, "rst", S_RST, 0, 0xC7 }, + + /* { NULL, "im", S_IM, 0, 0xED }, */ + + { NULL, "ccf", S_INH1, 0, 0x3F }, + { NULL, "cpl", S_INH1, 0, 0x2F }, + /* { NULL, "daa", S_INH1, 0, 0x27 }, */ + /* { NULL, "di", S_INH1, 0, 0xF3 }, */ + /* { NULL, "ei", S_INH1, 0, 0xFB }, */ { NULL, "ipset0", S_INH2, 0, 0x46 }, { NULL, "ipset1", S_INH2, 0, 0x56 }, { NULL, "ipset2", S_INH2, 0, 0x4E }, { NULL, "ipset3", S_INH2, 0, 0x5E }, { NULL, "ipres", S_INH2, 0, 0x5D }, - { NULL, "exx", S_INH1, 0, 0xD9 }, - { NULL, "nop", S_INH1, 0, 0x00 }, + { NULL, "exx", S_INH1, 0, 0xD9 }, + { NULL, "nop", S_INH1, 0, 0x00 }, - /* { NULL, "halt", S_INH1, 0, 0x76 }, */ - { NULL, "altd", S_INH1, 0, 0x76 }, + /* { NULL, "halt", S_INH1, 0, 0x76 }, */ + { NULL, "altd", S_INH1, 0, 0x76 }, - { NULL, "rla", S_INH1, 0, 0x17 }, - { NULL, "rlca", S_INH1, 0, 0x07 }, - { NULL, "rra", S_INH1, 0, 0x1F }, - { NULL, "rrca", S_INH1, 0, 0x0F }, - { NULL, "scf", S_INH1, 0, 0x37 }, - - /* { NULL, "cpd", S_INH2, 0, 0xA9 }, */ - /* { NULL, "cpdr", S_INH2, 0, 0xB9 }, */ - /* { NULL, "cpi", S_INH2, 0, 0xA1 }, */ - /* { NULL, "cpir", S_INH2, 0, 0xB1 }, */ - /* { NULL, "ind", S_INH2, 0, 0xAA }, */ - /* { NULL, "indr", S_INH2, 0, 0xBA }, */ - /* { NULL, "ini", S_INH2, 0, 0xA2 }, */ - /* { NULL, "inir", S_INH2, 0, 0xB2 }, */ - { NULL, "ldd", S_INH2, 0, 0xA8 }, - { NULL, "lddr", S_INH2, 0, 0xB8 }, - { NULL, "ldi", S_INH2, 0, 0xA0 }, - { NULL, "ldir", S_INH2, 0, 0xB0 }, - { NULL, "neg", S_NEG, 0, 0x44 }, - /* { NULL, "outd", S_INH2, 0, 0xAB }, */ - /* { NULL, "otdr", S_INH2, 0, 0xBB }, */ - /* { NULL, "outi", S_INH2, 0, 0xA3 }, */ - /* { NULL, "otir", S_INH2, 0, 0xB3 }, */ - { NULL, "reti", S_INH2, 0, 0x4D }, - /* { NULL, "retn", S_INH2, 0, 0x45 },*/ - { NULL, "lret", S_INH2, 0, 0x45 }, - /* { NULL, "rld", S_INH2, 0, 0x6F }, */ - /* { NULL, "rrd", S_INH2, S_END, 0x67 } */ - - { NULL, ".r4k", X_R4K_MODE, 0, 0 }, + { NULL, "rla", S_INH1, 0, 0x17 }, + { NULL, "rlca", S_INH1, 0, 0x07 }, + { NULL, "rra", S_INH1, 0, 0x1F }, + { NULL, "rrca", S_INH1, 0, 0x0F }, + { NULL, "scf", S_INH1, 0, 0x37 }, + + /* { NULL, "cpd", S_INH2, 0, 0xA9 }, */ + /* { NULL, "cpdr", S_INH2, 0, 0xB9 }, */ + /* { NULL, "cpi", S_INH2, 0, 0xA1 }, */ + /* { NULL, "cpir", S_INH2, 0, 0xB1 }, */ + /* { NULL, "ind", S_INH2, 0, 0xAA }, */ + /* { NULL, "indr", S_INH2, 0, 0xBA }, */ + /* { NULL, "ini", S_INH2, 0, 0xA2 }, */ + /* { NULL, "inir", S_INH2, 0, 0xB2 }, */ + { NULL, "ldd", S_INH2, 0, 0xA8 }, + { NULL, "lddr", S_INH2, 0, 0xB8 }, + { NULL, "ldi", S_INH2, 0, 0xA0 }, + { NULL, "ldir", S_INH2, 0, 0xB0 }, + { NULL, "neg", S_NEG, 0, 0x44 }, + /* { NULL, "outd", S_INH2, 0, 0xAB }, */ + /* { NULL, "otdr", S_INH2, 0, 0xBB }, */ + /* { NULL, "outi", S_INH2, 0, 0xA3 }, */ + /* { NULL, "otir", S_INH2, 0, 0xB3 }, */ + { NULL, "reti", S_INH2, 0, 0x4D }, + /* { NULL, "retn", S_INH2, 0, 0x45 },*/ + { NULL, "lret", S_INH2, 0, 0x45 }, + /* { NULL, "rld", S_INH2, 0, 0x6F }, */ + /* { NULL, "rrd", S_INH2, S_EOL, 0x67 } */ + { NULL, "mul", S_INH1, 0, 0xF7 }, + + { NULL, ".r3k", X_R3K_MODE, 0, 0 }, + { NULL, "idet", R3K_INH1, 0, 0x5B }, + { NULL, "lddsr", R3K_INH2, 0, 0x98 }, + { NULL, "ldisr", R3K_INH2, 0, 0x90 }, + { NULL, "lsddr", R3K_INH2, 0, 0xD8 }, + { NULL, "lsdr", R3K_INH2, 0, 0xF8 }, + { NULL, "lsidr", R3K_INH2, 0, 0xD0 }, + { NULL, "lsir", R3K_INH2, 0, 0xF0 }, + { NULL, "rdmode", R3K_INH2, 0, 0x7F }, + { NULL, "setusr", R3K_INH2, 0, 0x6F }, + { NULL, "sures", R3K_INH2, 0, 0x7D }, + { NULL, "uma", R3K_INH2, 0, 0xC0 }, + { NULL, "ums", R3K_INH2, 0, 0xC8 }, + + { NULL, ".r4k", X_R4K_MODE, 0, 0 }, { NULL, "jre", X_JRE, 0, 0xA3 }, { NULL, "clr", X_CLR, 0, 0xBF }, { NULL, "ljp", X_LJP, 0, 0xC7 }, { NULL, "lcall", X_LCALL, 0, 0xCF }, { NULL, "lret", S_INH2, 0, 0x45 }, { NULL, "bool", X_BOOL, 0, 0xCC }, - { NULL, "mulu", X_R4K_MULU, S_END, 0xA7 } + { NULL, "syscall", R4K_INH2, 0, 0x75 }, + { NULL, "sysret", R4K_INH2, 0, 0x83 }, + { NULL, "mulu", X_R4K_MULU, S_EOL, 0xA7 } }; diff -Nru sdcc-3.1.0+dfsg/sdas/asxxsrc/asdata.c sdcc-3.2.0+dfsg/sdas/asxxsrc/asdata.c --- sdcc-3.1.0+dfsg/sdas/asxxsrc/asdata.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asxxsrc/asdata.c 2011-12-18 17:44:59.000000000 +0000 @@ -98,7 +98,7 @@ */ int wflag; /* -w, enable wide listing format */ -int zflag; /* -z, enable symbol case sensitivity +int zflag; /* -z, disable symbol case sensitivity */ int xflag; /* -x, listing radix flag */ @@ -212,7 +212,7 @@ */ struct sym sym[] = { {NULL, NULL, ".", S_USER, 0, NULL, 0, 0, 0}, - {NULL, NULL, ".__.ABS.", S_USER, S_ASG|S_GBL|S_END, NULL, 0, 0, 0} + {NULL, NULL, ".__.ABS.", S_USER, S_ASG|S_GBL|S_EOL, NULL, 0, 0, 0} }; struct sym *symp; /* pointer to a symbol structure diff -Nru sdcc-3.1.0+dfsg/sdas/asxxsrc/asexpr.c sdcc-3.2.0+dfsg/sdas/asxxsrc/asexpr.c --- sdcc-3.1.0+dfsg/sdas/asxxsrc/asexpr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asxxsrc/asexpr.c 2011-12-18 17:44:59.000000000 +0000 @@ -374,6 +374,8 @@ if (c == '\'') { esp->e_mode = S_USER; esp->e_addr = getmap(-1)&0377; + c = get(); + if (c != '\'') { unget(c); } return; } if (c == '\"') { @@ -385,6 +387,8 @@ esp->e_addr = (getmap(-1)&0377); esp->e_addr |= (getmap(-1)&0377)<<8; } + c = get(); + if (c != '\"') { unget(c); } return; } if (c == '>' || c == '<') { diff -Nru sdcc-3.1.0+dfsg/sdas/asxxsrc/aslex.c sdcc-3.2.0+dfsg/sdas/asxxsrc/aslex.c --- sdcc-3.1.0+dfsg/sdas/asxxsrc/aslex.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asxxsrc/aslex.c 2011-12-18 17:44:59.000000000 +0000 @@ -39,8 +39,8 @@ * aslex.c contains the following functions: * char endline() * char get() - * VOID getid(id,c) - * int as_getline() + * VOID getid() + * int nxtline() * int getmap() * char getnb() * VOID getst() @@ -62,7 +62,7 @@ * * The function getid() scans the current assembler-source text line * from the current position copying the next LETTER | DIGIT string - * into the external string buffer (id). The string ends when a non + * into the external string buffer id[]. The string ends when a non * LETTER or DIGIT character is found. The maximum number of characters * copied is NCPS-1. If the input string is larger than NCPS-1 * characters then the string is truncated. The string is always @@ -83,22 +83,21 @@ * being processed. * * called functions: - * char get() aslex.c - * char getnb() aslex.c + * int get() aslex.c + * int getnb() aslex.c * VOID unget() aslex.c + * VOID qerr() assubr.c * * side effects: - * use of getnb(), get(), and unget() updates the + * Use of getnb(), get(), and unget() updates the * global pointer ip, the position in the current * assembler-source text line. */ VOID -getid(id, c) -register int c; -char *id; +getid(char *id, int c) { - register char *p; + char *p; if (c < 0) { c = getnb(); @@ -158,9 +157,7 @@ */ VOID -getst(id, c) -register int c; -char *id; +getst(char *id, int c) { register char *p; @@ -198,10 +195,10 @@ * in the current assembler-source text line */ -char -getnb() +int +getnb(void) { - register int c; + int c; while ((c=get()) == ' ' || c == '\t') ; @@ -231,10 +228,10 @@ * line, ip is not updated. */ -char -get() +int +get(void) { - register int c; + int c; if ((c = *ip) != 0) ++ip; @@ -270,8 +267,7 @@ */ VOID -unget(c) -int c; +unget(int c) { if (c) if (ip != ib) @@ -309,8 +305,7 @@ */ int -getmap(d) -int d; +getmap(int d) { register int c, n, v; @@ -391,8 +386,7 @@ */ int -comma(flag) -int flag; +comma(int flag) { int c; @@ -407,18 +401,18 @@ return(1); } -/*)Function int as_getline() +/*)Function int nxtline() * - * The function as_getline() reads a line of assembler-source text + * The function nxtline() reads a line of assembler-source text * from an assembly source text file or an include file. * Lines of text are processed from assembler-source files until * all files have been read. If an include file is opened then * lines of text are read from the include file (or nested * include file) until the end of the include file is found. - * The input text line is copied into the global string ib[] - * and converted to a NULL terminated string. The function - * as_getline() returns a (1) after succesfully reading a line - * or a (0) if all files have been read. + * The input text line is transferred into the global string + * ib[] and converted to a NULL terminated string. The function + * nxtline() returns a (1) after succesfully reading + * a line, or a (0) if all files have been read. * * local variables: * int i string length @@ -458,7 +452,7 @@ */ int -as_getline(void) +nxtline(void) { static struct dbuf_s dbuf; static char dbufInitialized = 0; @@ -542,7 +536,7 @@ */ int -more() +more(void) { register int c; @@ -574,7 +568,7 @@ */ char -endline() +endline(void) { register int c; diff -Nru sdcc-3.1.0+dfsg/sdas/asxxsrc/aslist.c sdcc-3.2.0+dfsg/sdas/asxxsrc/aslist.c --- sdcc-3.1.0+dfsg/sdas/asxxsrc/aslist.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asxxsrc/aslist.c 2011-12-18 17:44:59.000000000 +0000 @@ -87,7 +87,7 @@ */ VOID -list() +list(void) { char *wp; int *wpt; @@ -291,9 +291,7 @@ */ VOID -list1(wp, wpt, nb, f) -char *wp; -int *wpt, nb, f; +list1(char *wp, int *wpt, int nb, int f) { int i; @@ -405,8 +403,7 @@ */ VOID -list2(t) -int t; +list2(int t) { int c; @@ -479,9 +476,7 @@ */ VOID -slew(fp,flag) -FILE *fp; -int flag; +slew(FILE *fp, int flag) { if ((lop++ >= NLPP) && flag) { fprintf(fp, "\fASxxxx Assembler %s (%s), page %u.\n", @@ -546,8 +541,7 @@ */ VOID -lstsym(fp) -FILE *fp; +lstsym(FILE *fp) { int i, j, k; char *ptr; diff -Nru sdcc-3.1.0+dfsg/sdas/asxxsrc/asmain.c sdcc-3.2.0+dfsg/sdas/asxxsrc/asmain.c --- sdcc-3.1.0+dfsg/sdas/asxxsrc/asmain.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asxxsrc/asmain.c 2011-12-18 17:44:59.000000000 +0000 @@ -193,7 +193,7 @@ * int tlevel current conditional level * int wflag -w, enable wide listing format * int xflag -x, listing radix flag - * int zflag -z, enable symbol case sensitivity + * int zflag -z, disable symbol case sensitivity * FILE * lfp list output file handle * FILE * ofp relocation output file handle * FILE * tfp symbol table output file handle @@ -206,7 +206,7 @@ * VOID diag() assubr.c * VOID err() assubr.c * int fprintf() c-library - * int as_getline() aslex.c + * int nxtline() aslex.c * VOID list() aslist.c * VOID lstsym() aslist.c * VOID minit() ___mch.c @@ -230,9 +230,7 @@ /* end sdas specific */ int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { char *p = NULL; char *q = NULL; @@ -406,7 +404,7 @@ outchk(0,0); symp = ˙ minit(); - while (as_getline()) { + while (nxtline()) { cp = cb; cpt = cbt; ep = eb; @@ -472,8 +470,7 @@ */ VOID -asexit(i) -int i; +asexit(int i) { int j; @@ -589,7 +586,7 @@ */ VOID -asmbl() +asmbl(void) { struct mne *mp; struct sym *sp; @@ -874,7 +871,7 @@ do { double f1, f2; unsigned int mantissa, exponent; - const char readbuffer[80]; + char readbuffer[80]; getid(readbuffer, ' '); /* Hack :) */ if ((c = getnb()) == '.') { @@ -1263,10 +1260,7 @@ */ FILE * -afile(fn, ft, wf) -char *fn; -char *ft; -int wf; +afile(char *fn, char *ft, int wf) { char *p2, *p3; int c; @@ -1334,8 +1328,7 @@ */ VOID -newdot(nap) -struct area *nap; +newdot(struct area *nap) { struct area *oap; @@ -1401,9 +1394,7 @@ */ VOID -phase(ap, a) -struct area *ap; -a_uint a; +phase(struct area *ap, a_uint a) { if (ap != dot.s_area || a != dot.s_addr) err('p'); @@ -1456,7 +1447,7 @@ */ VOID -usage(n) +usage(int n) { char **dp; diff -Nru sdcc-3.1.0+dfsg/sdas/asxxsrc/asout.c sdcc-3.2.0+dfsg/sdas/asxxsrc/asout.c --- sdcc-3.1.0+dfsg/sdas/asxxsrc/asout.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asxxsrc/asout.c 2012-03-14 20:37:02.000000000 +0000 @@ -1,20 +1,27 @@ -/* asout.c +/* asout.c */ - Copyright (C) 1989-1995 Alan R. Baldwin - 721 Berkeley St., Kent, Ohio 44240 - -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, see . */ +/* + * Copyright (C) 1989-2009 Alan R. Baldwin + * + * 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, see . + * + * + * Alan R. Baldwin + * 721 Berkeley St. + * Kent, Ohio 44240 + * + */ /* * 28-Oct-97 JLH: @@ -22,9 +29,6 @@ * - Added outr11 to support 8051's 11 bit destination address */ -#include -#include -#include #include "sdas.h" #include "asxxxx.h" @@ -62,7 +66,8 @@ * * The first line of an object module contains the [XDQ][HL] * format specifier (i.e. XH indicates a hexadecimal file with - * most significant byte first) for the following designators. + * most significant byte first) for the + * following designators. * * * (2) Header Line @@ -348,7 +353,9 @@ * is loaded into the txt and rel buffers. * * local variables: - * int n symbol/area reference number + * int m signed value mask + * int n unsigned value mask + * symbol/area reference number * int * relp pointer to rel array * int * txtp pointer to txt array * @@ -370,7 +377,7 @@ VOID outrb(struct expr *esp, int r) { - register int n; + a_uint n; if (pass == 2) { if (esp->e_flag==0 && esp->e_base.e_ap==NULL) { @@ -378,6 +385,14 @@ * const byte to the T line and don't * generate any relocation info. */ + n = (a_uint) ~0x000000FF; /* 1 byte */ + /* + * Page0 Range Check + */ + if (((r & (R3_SGND | R3_USGN | R3_PAG0 | R3_PAG | R3_PCR)) == R3_PAG0) && + ((n & esp->e_addr) != 0)) + err('d'); + out_lb(lobyte(esp->e_addr),0); if (oflag) { outchk(1, 0); @@ -1140,10 +1155,10 @@ */ VOID -out_lb(register int b, register int t) +out_lb(a_uint v, int t) { if (cp < &cb[NCODE]) { - *cp++ = b; + *cp++ = v; *cpt++ = t; } } @@ -1172,14 +1187,14 @@ */ VOID -out_lw(register int n, register int t) +out_lw(a_uint v, int t) { if (hilo) { - out_lb(hibyte(n),t ? t|R_HIGH : 0); - out_lb(lobyte(n),t); + out_lb(hibyte(v),t ? t|R_HIGH : 0); + out_lb(lobyte(v),t); } else { - out_lb(lobyte(n),t); - out_lb(hibyte(n),t ? t|R_HIGH : 0); + out_lb(lobyte(v),t); + out_lb(hibyte(v),t ? t|R_HIGH : 0); } } @@ -1244,20 +1259,20 @@ */ VOID -out_rw(register int n) +out_rw(a_uint v) { if (hilo) { - *relp++ = hibyte(n); - *relp++ = lobyte(n); + *relp++ = hibyte(v); + *relp++ = lobyte(v); } else { - *relp++ = lobyte(n); - *relp++ = hibyte(n); + *relp++ = lobyte(v); + *relp++ = hibyte(v); } } /*)Function VOID out_tw(n) * - * int n data word + * a_uint n data word * * The function out_tw() outputs the text (T) * data word as two bytes ordered according to hilo. @@ -1277,7 +1292,7 @@ */ VOID -out_tw(register int n) +out_tw(a_uint n) { if (hilo) { *txtp++ = hibyte(n); @@ -1346,9 +1361,9 @@ */ int -lobyte(int n) +lobyte(a_uint v) { - return (n&0377); + return (v&0377); } /*)Function int hibyte(n) @@ -1372,9 +1387,9 @@ */ int -hibyte(int n) +hibyte(a_uint v) { - return ((n>>8)&0377); + return ((v>>8)&0377); } /* diff -Nru sdcc-3.1.0+dfsg/sdas/asxxsrc/assym.c sdcc-3.2.0+dfsg/sdas/asxxsrc/assym.c --- sdcc-3.1.0+dfsg/sdas/asxxsrc/assym.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asxxsrc/assym.c 2011-12-18 17:44:59.000000000 +0000 @@ -101,21 +101,21 @@ VOID syminit(void) { - register struct mne *mp; + struct mne *mp; struct mne **mpp; - register struct sym *sp; + struct sym *sp; struct sym **spp; - register int h; + int h; mpp = &mnehash[0]; while (mpp < &mnehash[NHASH]) *mpp++ = NULL; mp = &mne[0]; for (;;) { - h = hash(mp->m_id); + h = hash(mp->m_id, 1); mp->m_mp = mnehash[h]; mnehash[h] = mp; - if (mp->m_flag&S_END) + if (mp->m_flag&S_EOL) break; ++mp; } @@ -125,10 +125,10 @@ *spp++ = NULL; sp = &sym[0]; for (;;) { - h = hash(sp->s_id); + h = hash(sp->s_id, zflag); sp->s_sp = symhash[h]; symhash[h] = sp; - if (sp->s_flag&S_END) + if (sp->s_flag&S_EOL) break; ++sp; } @@ -200,16 +200,16 @@ struct mne * mlookup(char *id) { - register struct mne *mp; - register int h; + struct mne *mp; + int h; - h = hash(id); + /* + * JLH: case insensitive lookup always + */ + h = hash(id, 1); mp = mnehash[h]; while (mp) { - /* - * JLH: case insensitive lookup always - */ - if(symeq(id, mp->m_id, 0)) + if(symeq(id, mp->m_id, 1)) return (mp); mp = mp->m_mp; } @@ -231,10 +231,10 @@ * sym * sp pointer to a sym structure * * global varaibles: - * sym * symhash[] array of pointers to NHASH + * sym * symhash[] array of pointers to NHASH * linked symbol lists - * int zflag enable symbol case sensitivity -* + * int zflag disable symbol case sensitivity + * * functions called: * int hash() assym.c * VOID * new() assym.c @@ -247,12 +247,12 @@ */ struct sym * -lookup(char *id) +lookup(const char *id) { - register struct sym *sp; - register int h; + struct sym *sp; + int h; - h = hash(id); + h = hash(id, zflag); sp = symhash[h]; while (sp) { if(symeq(id, sp->s_id, zflag)) @@ -296,8 +296,8 @@ VOID symglob(void) { - register struct sym *sp; - register int i; + struct sym *sp; + int i; for (i=0; i bytes) { + if (len > bytes) { /* * No space. Allocate a new hunk. * We lose the pointer to any old hunk. @@ -503,10 +511,10 @@ * Copy the name and terminating null. */ p = pnext; - strncpy(p, str, l); + strncpy(p, str, len); - pnext += l; - bytes -= l; + pnext += len; + bytes -= len; return(p); } @@ -538,11 +546,11 @@ VOID * new(unsigned int n) { - register VOID *p; + VOID *p; if ((p = (VOID *) malloc(n)) == NULL) { fprintf(stderr, "Out of space!\n"); - asexit(1); + asexit(ER_FATAL); } return (p); } diff -Nru sdcc-3.1.0+dfsg/sdas/asxxsrc/asxxxx.h sdcc-3.2.0+dfsg/sdas/asxxsrc/asxxxx.h --- sdcc-3.1.0+dfsg/sdas/asxxsrc/asxxxx.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asxxsrc/asxxxx.h 2012-04-26 14:48:07.000000000 +0000 @@ -1,24 +1,42 @@ -/* asxxxx.h +/* asxxxx.h */ - Copyright (C) 1989-1995 Alan R. Baldwin - 721 Berkeley St., Kent, Ohio 44240 - -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, see . */ +/* + * Copyright (C) 1989-2010 Alan R. Baldwin + * + * 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, see . + * + * + * Alan R. Baldwin + * 721 Berkeley St. + * Kent, Ohio 44240 + * + * With enhancements from + * + * John L. Hartman (JLH) + * jhartman at compuserve dot com + * + * Bill McKinnon (BM) + * w_mckinnon at conknet dot com + * + * Boisy G. Petri (BGP) + * boisy at boisypitre dot com + * + * Mike McCarty + * mike dot mccarty at sbcglobal dot net + */ /* - * 10-Nov-07 borutr: - * - change a_id from [NCPS] to pointer * 28-Oct-97 JLH: * - add proto for strsto * - change s_id from [NCPS] to pointer @@ -36,6 +54,8 @@ * * 3-Feb-00 KV: * - add DS80C390 flat mode support. + * 10-Nov-07 borutr: + * - change a_id from [NCPS] to pointer */ /* @@ -57,9 +77,9 @@ * * The module asxxxx.h contains the definitions for constants, * structures, global variables, and ASxxxx functions - * contained in the ASxxxx.c files. The two functions - * and three global variables from the machine dependent - * files are also defined. + * contained in the ASxxxx.c files. The functions and + * global variables from the machine dependent files are + * also defined. */ /* @@ -69,7 +89,7 @@ /* DECUS C void definition */ /* File/extension seperator */ -#ifdef decus +#ifdef DECUS #define VOID char #define FSEPX '.' #endif @@ -100,7 +120,7 @@ #include #define PATH_MAX _MAX_PATH #else -#define PATH_MAX /* define a reasonable value */ +#define PATH_MAX FILENAME_MAX /* define a reasonable value */ #endif #endif @@ -121,39 +141,42 @@ /* * Error definitions */ -#define ER_NONE 0 /* No error */ -#define ER_WARNING 1 /* Warning */ -#define ER_ERROR 2 /* Assembly error */ -#define ER_FATAL 3 /* Fatal error */ +#define ER_NONE 0 /* No error */ +#define ER_WARNING 1 /* Warning */ +#define ER_ERROR 2 /* Assembly error */ +#define ER_FATAL 3 /* Fatal error */ /* * Assembler definitions. */ -#define LFTERM '(' /* Left expression delimeter */ -#define RTTERM ')' /* Right expression delimeter */ +#define LFTERM '(' /* Left expression delimeter */ +#define RTTERM ')' /* Right expression delimeter */ -#define NCPS 80 /* Characters per symbol */ +#define NCPS 80 /* Characters per symbol */ #define ASXXXX_HUGE 1000 /* A huge number */ -#define NERR 3 /* Errors per line */ -#define NINPUT 1024 /* Input buffer size */ -#define NCODE 128 /* Listing code buffer size */ -#define NTITL 80 /* Title buffer size */ -#define NSBTL 80 /* SubTitle buffer size */ -#define NHASH 64 /* Buckets in hash table */ -#define HMASK 077 /* Hash mask */ -#define NLPP 60 /* Lines per page */ -#define MAXFIL 6 /* Maximum command line input files */ -#define MAXINC 6 /* Maximum nesting of include files */ -#define MAXIF 10 /* Maximum nesting of if/else/endif */ -#define FILSPC 256 /* Chars. in filespec */ - -#define NLIST 0 /* No listing */ -#define SLIST 1 /* Source only */ -#define ALIST 2 /* Address only */ -#define BLIST 3 /* Address only with allocation */ -#define CLIST 4 /* Code */ -#define ELIST 5 /* Equate only */ +#define NERR 3 /* Errors per line */ +#define NINPUT 1024 /* Input buffer size */ +#define NCODE 128 /* Listing code buffer size */ +#define NTITL 80 /* Title buffer size */ +#define NSBTL 80 /* SubTitle buffer size */ +#define NHASH (1 << 6) /* Buckets in hash table */ +#define HMASK (NHASH - 1) /* Hash mask */ +#define NLPP 60 /* Lines per page */ +#define MAXFIL 6 /* Maximum command line input files */ +#define MAXINC 6 /* Maximum nesting of include files */ +#define MAXIF 10 /* Maximum nesting of if/else/endif */ +#define FILSPC 256 /* Chars. in filespec */ + +#define NLIST 0 /* No listing */ +#define SLIST 1 /* Source only */ +#define ALIST 2 /* Address only */ +#define BLIST 3 /* Address only with allocation */ +#define CLIST 4 /* Code */ +#define ELIST 5 /* Equate only */ +/* + * Internal Definitions + */ #define dot sym[0] /* Dot, current loc */ #define dca area[0] /* Dca, default code area */ @@ -257,17 +280,17 @@ #define R3_MSB 0x80 /* high byte */ #define R_BYT3 0x100 /* if R3_BYTE is set, this is a - * 3 byte address, of which - * the linker must select one byte. - */ -#define R_HIB 0x200 /* If R3_BYTE & R_BYT3 are set, linker - * will select byte 3 of the relocated - * 24 bit address. - */ + * 3 byte address, of which + * the linker must select one byte. + */ +#define R_HIB 0x200 /* If R3_BYTE & R_BYT3 are set, linker + * will select byte 3 of the relocated + * 24 bit address. + */ #define R_BIT 0x400 /* Linker will convert from byte-addressable - * space to bit-addressable space. - */ + * space to bit-addressable space. + */ #define R_J11 (R3_WORD|R3_BYTX) /* JLH: 11 bit JMP and CALL (8051) */ #define R_J19 (R3_WORD|R3_BYTX|R3_MSB) /* 19 bit JMP/CALL (DS80C390) */ @@ -325,8 +348,8 @@ * defined in asdata.c. The entry 'struct tsym *s_tsym' * links any temporary symbols following this symbol and * preceeding the next normal symbol. The structure also - * contains the symbol's name, type (USER or NEW), flag - * (global, assigned, and multiply defined), a pointer + * contains the symbol's name, type (NEW or USER), + * flag (global, assigned, and multiply defined), a pointer * to the area structure defining where the symbol is * located, a reference number assigned by outgsd() in * asout.c, and the symbols address relative to the base @@ -347,13 +370,15 @@ /* end sdas specific */ }; +#define S_EOL 010 /* End mark for ___pst files */ + #define S_GBL 01 /* Global */ #define S_ASG 02 /* Assigned */ #define S_MDF 04 /* Mult. def */ -#define S_END 010 /* End mark for ___pst files */ -#define S_NEW 0 /* New name */ -#define S_USER 1 /* User name */ + +#define S_NEW 0 /* New Name (External) */ +#define S_USER 1 /* User Name (Assigned) */ /* unused slot */ /* unused slot */ /* unused slot */ @@ -401,12 +426,9 @@ struct tsym { struct tsym *t_lnk; /* Link to next */ -/* sandeep changed to 'int' from 'char' */ -/* this will increase the number temp symbols - that can be defined from 255 to INT_MAX */ - int t_num; /* 0-INT_MAX$ */ + a_uint t_num; /* 0-65535$ for a 16-bit int */ + /* 0-4294967295$ for a 32-bit int */ int t_flg; /* flags */ - struct area *t_area; /* Area */ a_uint t_addr; /* Address */ }; @@ -440,14 +462,12 @@ extern int iflvl[MAXIF+1]; /* array of IF-ELSE-ENDIF flevel * values indexed by tlevel */ -extern char - afn[FILSPC]; /* afile() temporary filespec +extern char afn[FILSPC]; /* afile() temporary filespec */ extern char srcfn[MAXFIL][FILSPC]; /* array of source file names */ -extern int - srcline[MAXFIL]; /* current source file line +extern int srcline[MAXFIL]; /* current source file line */ extern char incfn[MAXINC][FILSPC]; /* array of include file names @@ -459,8 +479,7 @@ * 2 (binary), 8 (octal), 10 (decimal), * 16 (hexadecimal) */ -extern int line; /* current assembler source - * line number +extern int line; /* current assembler source line number */ extern int page; /* current page number */ @@ -468,28 +487,31 @@ */ extern int pass; /* assembler pass number */ -extern int lflag; /* -l, generate listing flag +extern int aflag; /* -a, make all symbols global flag + */ +extern int fflag; /* -f(f), relocations flagged flag */ extern int gflag; /* -g, make undefined symbols global flag */ -extern int aflag; /* -a, make all symbols global flag +extern int jflag; /* -j, generate debug information flag */ -extern int oflag; /* -o, generate relocatable output flag + +extern int lflag; /* -l, generate listing flag */ -extern int sflag; /* -s, generate symbol table flag +extern int oflag; /* -o, generate relocatable output flag */ extern int pflag; /* -p, enable listing pagination */ -extern int wflag; /* -w, enable wide format listing +extern int sflag; /* -s, generate symbol table flag */ -extern int zflag; /* -z, enable symbol case sensitivity +extern int wflag; /* -w, enable wide listing format */ extern int xflag; /* -x, listing radix flag */ -extern int fflag; /* -f(f), relocations flagged flag +extern int zflag; /* -z, disable symbol case sensitivity */ -extern a_uint laddr; /* address of current assembler line - * or value of .if argument +extern a_uint laddr; /* address of current assembler line, + * equate, or value of .if argument */ extern a_uint fuzz; /* tracks pass to pass changes in the * address of symbols caused by @@ -552,10 +574,10 @@ */ extern FILE *ifp[MAXINC]; /* array of include-file file handles */ -extern unsigned char ctype[128]; /* array of character types, one per +extern unsigned char ctype[128]; /* array of character types, one per * ASCII character */ -extern char ccase[128]; /* an array of characters which +extern char ccase[128]; /* an array of characters which * perform the case translation function */ /*sdas specific */ @@ -565,8 +587,6 @@ */ extern int cflag; /* -c, generate sdcdb debug information */ -extern int jflag; /* -j, generate debug information flag - */ extern char *optsdcc; /* sdcc compile options */ extern int flat24Mode; /* non-zero if we are using DS390 24 bit @@ -643,80 +663,119 @@ /* Machine independent functions */ #ifdef OTHERSYSTEM + +/* asmain.c */ +extern FILE * afile(char *fn, char *ft, int wf); +extern VOID asexit(int i); +extern VOID asmbl(void); +extern VOID newdot(struct area *nap); +extern VOID phase(struct area *ap, a_uint a); +extern VOID usage(int n); + /* aslex.c */ extern int comma(int flag); +extern char endline(void); +extern int get(void); +extern VOID getid(char *id, int c); +extern int getmap(int d); +extern int getnb(void); +extern VOID getst(char *id, int c); +extern int more(void); +extern int nxtline(void); +extern VOID unget(int c); /* assym.c */ -extern char * strsto(char *str); +extern VOID allglob(void); +extern struct area * alookup(char *id); +extern int hash(const char *p, int flag); +extern struct sym * lookup(const char *id); +extern struct mne * mlookup(char *id); +extern VOID * new(unsigned int n); +extern char * strsto(const char *str); +extern int symeq(const char *p1, const char *p2, int flag); +extern VOID syminit(void); +extern VOID symglob(void); /* assubr.c */ +extern VOID aerr(void); +extern VOID diag(void); +extern VOID err(int c); +extern char * geterr(int c); +extern VOID qerr(void); +extern VOID rerr(void); /* sdas specific */ extern VOID warnBanner(void); /* end sdas specific */ +/* asexpr.c */ +extern VOID abscheck(struct expr *esp); +extern a_uint absexpr(void); +extern VOID clrexpr(struct expr *esp); +extern int digit(int c, int r); +extern VOID expr(struct expr *esp, int n); +extern int is_abs(struct expr *esp); +extern int oprio(int c); +extern VOID term(struct expr *esp); + +/* asdbg */ +extern VOID DefineNoICE_Line(void); +extern VOID DefineSDCC_Line(void); + +/* aslist.c */ +extern VOID list(void); +extern VOID list1(char *wp, int *wpt, int nb, int f); +extern VOID list2(int t); +extern VOID lstsym(FILE *fp); +extern VOID slew(FILE *fp, int flag); + /* asout.c */ -extern VOID outrw(struct expr *, int); +extern int lobyte(a_uint v); +extern int hibyte(a_uint v); +extern VOID outab(int v); +extern VOID out(char *p, int n); +extern VOID outarea(struct area *ap); +extern VOID outall(void); +extern VOID outdot(void); +extern VOID outbuf(char *s); +extern VOID outchk(int nt, int nr); +extern VOID outgsd(void); +extern VOID outsym(struct sym *sp); +extern VOID outrb(struct expr *esp, int r); +extern VOID outrw(struct expr *esp, int r); +extern VOID out_lb(a_uint v, int t); +extern VOID out_lw(a_uint v, int t); +extern VOID out_rw(a_uint v); +extern VOID out_tw(a_uint n); /* sdas specific */ extern int byte3(int); +extern VOID outr11(); /* JLH */ extern VOID outr24(struct expr *, int); extern VOID out_l24(int, int); extern VOID out_t24(int); extern VOID outr19(struct expr *, int, int); extern VOID outdp(struct area *, struct expr *); - -/* asdbg */ -extern VOID DefineNoICE_Line(void); -extern VOID DefineSDCC_Line(void); /* end sdas specific */ +/* Machine dependent variables */ + +extern int hilo; +extern char * cpu; +extern char * dsft; +extern struct mne mne[]; + /* Machine dependent functions */ +extern VOID machine(struct mne *mp); extern VOID minit(void); -extern VOID machine(struct mne *); + /* sdas specific */ /* strcmpi.c */ extern int as_strcmpi(const char *s1, const char *s2); extern int as_strncmpi(const char *s1, const char *s2, size_t n); /* end sdas specific */ -#else -/* aslex.c */ -extern int comma(); - -/* assym.c */ -extern char * strsto(); -/* assubr.c */ -/* sdas specific */ -extern VOID warnBanner(); -/* end sdas specific */ - -/* asout.c */ -extern VOID outrw(); -/* sdas specific */ -extern int byte3(); -extern VOID outr24(); -extern VOID out_l24(); -extern VOID out_t24(); -extern VOID outr19(t); -extern VOID outdp(); - -/* asdbg */ -extern VOID DefineNoICE_Line(); -extern VOID DefineSDCC_Line(); -/* end sdas specific */ - -/* Machine dependent functions */ - -extern VOID minit(); -extern VOID machine(); - -/* sdas specific */ -/* strcmpi.c */ -extern int as_strcmpi(); -extern int as_strncmpi(); -/* end sdas specific */ -#endif +#else /* asmain.c */ extern FILE * afile(); @@ -728,45 +787,55 @@ extern VOID usage(); /* aslex.c */ +extern int comma(); extern char endline(); extern char get(); extern VOID getid(); -extern int as_getline(); extern int getmap(); extern char getnb(); extern VOID getst(); extern int more(); +extern int nxtline(); extern VOID unget(); /* assym.c */ +extern VOID allglob(); extern struct area * alookup(); -extern struct mne * mlookup(); + extern int hash(); extern struct sym * lookup(); +extern struct mne * mlookup(); extern VOID * new(); +extern char * strsto(); extern int symeq(); extern VOID syminit(); extern VOID symglob(); -extern VOID allglob(); /* assubr.c */ extern VOID aerr(); extern VOID diag(); -extern VOID err(register int c); +extern VOID err(); extern char * geterr(); extern VOID qerr(); extern VOID rerr(); +/* sdas specific */ +extern VOID warnBanner(); +/* end sdas specific */ /* asexpr.c */ extern VOID abscheck(); extern a_uint absexpr(); extern VOID clrexpr(); extern int digit(); -extern int is_abs(); extern VOID expr(); +extern int is_abs(); extern int oprio(); extern VOID term(); +/* asdbg */ +extern VOID DefineNoICE_Line(); +extern VOID DefineSDCC_Line(); + /* aslist.c */ extern VOID list(); extern VOID list1(); @@ -775,20 +844,29 @@ extern VOID slew(); /* asout.c */ -extern int hibyte(); extern int lobyte(); +extern int hibyte(); extern VOID out(); -extern VOID outab(); extern VOID outarea(); -extern VOID outaw(); +extern VOID outdp(); extern VOID outall(); extern VOID outdot(); extern VOID outbuf(); extern VOID outchk(); extern VOID outgsd(); +extern VOID outsym(); +extern VOID outab(); +extern VOID outaw(); extern VOID outrb(); +extern VOID outrw(); +/* sdas specific */ +extern int byte3(); extern VOID outr11(); /* JLH */ -extern VOID outsym(); +extern VOID outr24(); +extern VOID out_l24(); +extern VOID out_t24(); +extern VOID outr19(t); +/* end sdas specific */ extern VOID out_lb(); extern VOID out_lw(); extern VOID out_rw(); @@ -800,3 +878,15 @@ extern char * dsft; extern int hilo; extern struct mne mne[]; +/* Machine dependent functions */ + +extern VOID machine(); +extern VOID minit(); + +/* sdas specific */ +/* strcmpi.c */ +extern int as_strcmpi(); +extern int as_strncmpi(); +/* end sdas specific */ +#endif + diff -Nru sdcc-3.1.0+dfsg/sdas/asz80/z80.h sdcc-3.2.0+dfsg/sdas/asz80/z80.h --- sdcc-3.1.0+dfsg/sdas/asz80/z80.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asz80/z80.h 2012-06-28 14:09:28.000000000 +0000 @@ -172,9 +172,7 @@ /* z80mch.c */ extern int genop(int pop, int op, struct expr *esp, int f); extern int gixiy(int v); -extern VOID machine(struct mne *mp); extern int mchpcr(struct expr *esp); -extern VOID minit(void); #else @@ -187,9 +185,7 @@ /* z80mch.c */ extern int genop(); extern int gixiy(); -extern VOID machine(); extern int mchpcr(); -extern VOID minit(); #endif diff -Nru sdcc-3.1.0+dfsg/sdas/asz80/z80mch.c sdcc-3.2.0+dfsg/sdas/asz80/z80mch.c --- sdcc-3.1.0+dfsg/sdas/asz80/z80mch.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asz80/z80mch.c 2012-06-16 22:04:35.000000000 +0000 @@ -20,8 +20,6 @@ * Extensions: P. Felber */ -#include -#include #include "asxxxx.h" #include "z80.h" @@ -488,21 +486,29 @@ break; case X_TST: - t1 = addr(&e1); - if (t1 == S_R8) { + t2 = addr(&e2); + if (more()) + { + if ((t2 != S_R8) || (e2.e_addr != A)) + aerr(); + comma(1); + clrexpr(&e2); + t2 = addr(&e2); + } + if (t2 == S_R8) { outab(0xED); - outab(op | (e1.e_addr<<3)); + outab(op | (e2.e_addr<<3)); break; } - if (t1 == S_IDHL) { + if (t2 == S_IDHL) { outab(0xED); outab(0x34); break; } - if (t1 == S_IMMED) { + if (t2 == S_IMMED) { outab(0xED); outab(0x64); - outrb(&e1, 0); + outrb(&e2, 0); break; } aerr(); diff -Nru sdcc-3.1.0+dfsg/sdas/asz80/z80pst.c sdcc-3.2.0+dfsg/sdas/asz80/z80pst.c --- sdcc-3.1.0+dfsg/sdas/asz80/z80pst.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/asz80/z80pst.c 2011-12-19 19:23:24.000000000 +0000 @@ -166,5 +166,5 @@ { NULL, "mlt", X_MLT, 0, 0x4C }, { NULL, "tst", X_TST, 0, 0x04 }, - { NULL, "tstio", X_TSTIO, S_END, 0x74 } + { NULL, "tstio", X_TSTIO, S_EOL, 0x74 } }; diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/Makefile.in sdcc-3.2.0+dfsg/sdas/linksrc/Makefile.in --- sdcc-3.1.0+dfsg/sdas/linksrc/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/Makefile.in 2012-01-06 08:30:10.000000000 +0000 @@ -42,13 +42,11 @@ ASXXLIB = $(srcdir)/../asxxsrc -LKLIB = $(srcdir)/.. - ASXXLIBSRC = strcmpi.c SRC = lk_readnl.c lkaomf51.c lkar.c lkarea.c lkdata.c lkelf.c lkeval.c \ - lkhead.c lkihx.c lklex.c lklib.c lklibr.c lklist.c lkmain.c \ - lkmem.c lknoice.c lkrel.c lkrloc.c lks19.c lksdcclib.c \ + lkhead.c lklex.c lklib.c lklibr.c lklist.c lkmain.c lkmem.c \ + lknoice.c lkout.c lkrel.c lkrloc.c lkrloc3.c lks19.c lksdcclib.c \ lksym.c sdld.c lksdcdb.c lkbank.c LKSOURCES = $(SRC) $(ASXXLIBSRC:%.c=$(ASXXLIB)/%.c) @@ -57,6 +55,8 @@ ASXXLIBOBJS = $(ASXXLIBSRC:%.c=$(OBJDIR)/%.o) LKOBJECTS = $(OBJS) $(LKOBJS) $(ASXXLIBOBJS) +$(LKOBJECTS) : aslink.h + ASLINK = $(top_builddir)/bin/sdld$(EXEEXT) transform = @program_transform_name@ @@ -117,7 +117,7 @@ # --------------------- dep: Makefile.dep -Makefile.dep: $(LKSOURCES) $(LKLIB)/*.h $(top_builddir)/*.h +Makefile.dep: $(LKSOURCES) $(top_builddir)/*.h $(MAKEDEP) $(CPPFLAGS) $(filter %.c,$^) >Makefile.dep ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs \ diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/aslink.h sdcc-3.2.0+dfsg/sdas/linksrc/aslink.h --- sdcc-3.1.0+dfsg/sdas/linksrc/aslink.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/aslink.h 2011-12-18 17:44:59.000000000 +0000 @@ -22,8 +22,8 @@ * Kent, Ohio 44240 * * With enhancements from - * John L. Hartman (JLH) - * jhartman@compuserve.com + * John L. Hartman (JLH) + * jhartman@compuserve.com */ /* @@ -39,7 +39,7 @@ * Local Definitions */ -#define VERSION "V02.00 + NoICE + sdld" +#define VERSION "V03.00 + NoICE + sdld" /* * To include NoICE Debugging set non-zero @@ -65,75 +65,76 @@ /* Turbo C++ 3.0 for DOS */ /* 'int' is 16-bits, 'long' is 32-bits */ -#ifdef __TURBOC__ -#define INT32 long -#define LONGINT +#ifdef __TURBOC__ +#define INT32 long +#define LONGINT #endif /* Symantec C++ V6.x/V7.x for DOS (not DOSX) */ /* 'int' is 16-bits, 'long' is 32-bits */ -#ifdef __SC__ -#define INT32 long -#define LONGINT +#ifdef __SC__ +#define INT32 long +#define LONGINT #endif /* The DEFAULT is 'int' is 32 bits */ -#ifndef INT32 -#define INT32 int +#ifndef INT32 +#define INT32 int #endif -/*)Module aslink.h +/*)Module aslink.h * - * The module aslink.h contains the definitions for constants, - * structures, global variables, and LKxxxx functions - * contained in the LKxxxx.c files. + * The module aslink.h contains the definitions for constants, + * structures, global variables, and LKxxxx functions + * contained in the LKxxxx.c files. */ /*)BUILD - $(PROGRAM) = ASLINK - $(INCLUDE) = ASLINK.H - $(FILES) = { - LKMAIN.C - LKLEX.C - LKAREA.C - LKBANK.C - LKHEAD.C - LKSYM.C - LKEVAL.C - LKDATA.C - LKLIST.C - LKNOICE.C - LKSDCDB.C - LKRLOC.C - LKLIBR.C - LKS19.C - LKIHX.C - } - $(STACK) = 2000 + $(PROGRAM) = ASLINK + $(INCLUDE) = ASLINK.H + $(FILES) = { + LKMAIN.C + LKLEX.C + LKAREA.C + LKBANK.C + LKHEAD.C + LKSYM.C + LKEVAL.C + LKDATA.C + LKLIST.C + LKNOICE.C + LKSDCDB.C + LKRLOC.C + LKRLOC3.C + LKLIBR.C + LKOUT.C + LKS19.C + } + $(STACK) = 2000 */ #if defined DECUS /* DECUS C void definition */ /* File/extension seperator */ -#define VOID char -#define FSEPX '.' +#define VOID char +#define FSEPX '.' #elif defined PDOS /* PDOS C void definition */ /* File/extension seperator */ -#define VOID char -#define FSEPX ':' +#define VOID char +#define FSEPX ':' #elif defined UNIX /* UNIX void definition */ /* File/extension seperator */ -#define VOID void -#define FSEPX '.' +#define VOID void +#define FSEPX '.' #define LKDIRSEP '/' #define LKDIRSEPSTR "/" #define OTHERSYSTEM @@ -142,8 +143,8 @@ /* DOS/WINDOWS void definition */ /* File/extension seperator */ -#define VOID void -#define FSEPX '.' +#define VOID void +#define FSEPX '.' #define LKDIRSEP '\\' #define LKDIRSEPSTR "\\" #define OTHERSYSTEM @@ -154,53 +155,56 @@ * PATH_MAX */ #include -#ifndef PATH_MAX /* POSIX, but not required */ +#ifndef PATH_MAX /* POSIX, but not required */ #if defined(__BORLANDC__) || defined(_MSC_VER) #include - #define PATH_MAX _MAX_PATH + #define PATH_MAX _MAX_PATH #else - #define PATH_MAX 255 /* define a reasonable value */ + #define PATH_MAX 255 /* define a reasonable value */ #endif #endif -#define LKOBJEXT "rel" +#define LKOBJEXT "rel" /* * Global symbol types. */ -#define S_REF 1 /* referenced */ -#define S_DEF 2 /* defined */ +#define S_REF 1 /* referenced */ +#define S_DEF 2 /* defined */ /* * File types */ -#define F_OUT 0 /* File.ixx / File.sxx */ -#define F_STD 1 /* stdin */ -#define F_LNK 2 /* File.lnk */ -#define F_REL 3 /* File.rel */ +#define F_OUT 0 /* File.ixx / File.sxx */ +#define F_STD 1 /* stdin */ +#define F_LNK 2 /* File.lnk */ +#define F_REL 3 /* File.rel */ /* * Error definitions */ -#define ER_NONE 0 /* No error */ -#define ER_WARNING 1 /* Warning */ -#define ER_ERROR 2 /* Assembly error */ -#define ER_FATAL 3 /* Fatal error */ +#define ER_NONE 0 /* No error */ +#define ER_WARNING 1 /* Warning */ +#define ER_ERROR 2 /* Assembly error */ +#define ER_FATAL 3 /* Fatal error */ /* * This file defines the format of the * relocatable binary file. */ -#define NCPS PATH_MAX /* characters per symbol */ -#define NINPUT PATH_MAX /* Input buffer size */ -#define NHASH (1 << 6) /* Buckets in hash table */ -#define HMASK (NHASH - 1) /* Hash mask */ -#define NLPP 60 /* Lines per page */ -#define NMAX 78 /* Maximum S19/IHX line length */ -#define FILSPC PATH_MAX /* File spec length */ +#define NCPS PATH_MAX /* characters per symbol */ +#define NINPUT PATH_MAX /* Input buffer size */ +#define NHASH (1 << 6) /* Buckets in hash table */ +#define HMASK (NHASH - 1) /* Hash mask */ +#define NLPP 60 /* Lines per page */ +#define NMAX 78 /* IXX/SXX/DBX Buffer Length */ +#define IXXMAXBYTES 32 /* NMAX > (2 * IXXMAXBYTES) */ +#define SXXMAXBYTES 32 /* NMAX > (2 * SXXMAXBYTES) */ +#define DBXMAXBYTES 64 /* NMAX > ( DBXMAXBYTES ) */ +#define FILSPC PATH_MAX /* File spec length */ -#define NDATA 16 /* actual data */ +#define NDATA 16 /* actual data */ /* * NTXT must be defined to have the same value in * the ASxxxx assemblers and ASLink. @@ -209,656 +213,900 @@ * the T Line index. The MAXIMUM value for NTXT * is 16. It should not be changed. */ -#define NTXT 16 /* T values */ +#define NTXT 16 /* T values */ /* * Internal ASxxxx Version Variable */ -extern int ASxxxx_VERSION; +extern int ASxxxx_VERSION; /* - * ASLINK - Version 3 Definitions + * ASLINK - Version 3 Definitions */ /* - * The "A3_" area constants define values used in - * generating the assembler area output data. + * The "A3_" area constants define values used in + * generating the assembler area output data. * * Area flags * - * 7 6 5 4 3 2 1 0 - * +-----+-----+-----+-----+-----+-----+-----+-----+ - * | | | | PAG | ABS | OVR | | | - * +-----+-----+-----+-----+-----+-----+-----+-----+ + * 7 6 5 4 3 2 1 0 + * +-----+-----+-----+-----+-----+-----+-----+-----+ + * | | | | PAG | ABS | OVR | | | + * +-----+-----+-----+-----+-----+-----+-----+-----+ */ -#define A3_CON 000 /* concatenate */ -#define A3_OVR 004 /* overlay */ -#define A3_REL 000 /* relocatable */ -#define A3_ABS 010 /* absolute */ -#define A3_NOPAG 000 /* non-paged */ -#define A3_PAG 020 /* paged */ +#define A3_CON 000 /* concatenate */ +#define A3_OVR 004 /* overlay */ +#define A3_REL 000 /* relocatable */ +#define A3_ABS 010 /* absolute */ +#define A3_NOPAG 000 /* non-paged */ +#define A3_PAG 020 /* paged */ /* sdld specific */ /* Additional flags for 8051 address spaces */ -#define A_DATA 0000 /* data space (default)*/ -#define A_CODE 0040 /* code space */ -#define A_XDATA 0100 /* external data space */ -#define A_BIT 0200 /* bit addressable space */ +#define A_DATA 0000 /* data space (default)*/ +#define A_CODE 0040 /* code space */ +#define A_XDATA 0100 /* external data space */ +#define A_BIT 0200 /* bit addressable space */ /* Additional flags for hc08 */ -#define A_NOLOAD 0400 /* nonloadable */ -#define A_LOAD 0000 /* loadable (default) */ +#define A_NOLOAD 0400 /* nonloadable */ +#define A_LOAD 0000 /* loadable (default) */ /* end sdld specific */ /* - * The "R3_" relocation constants define values used in - * generating the assembler relocation output data for - * areas, symbols, and code. + * The "R3_" relocation constants define values used in + * generating the assembler relocation output data for + * areas, symbols, and code. * * - * Relocation types. + * Relocation types. * - * 7 6 5 4 3 2 1 0 - * +-----+-----+-----+-----+-----+-----+-----+-----+ - * | MSB | PAGn| PAG0| USGN| BYT2| PCR | SYM | BYT | - * +-----+-----+-----+-----+-----+-----+-----+-----+ + * 7 6 5 4 3 2 1 0 + * +-----+-----+-----+-----+-----+-----+-----+-----+ + * | MSB | PAGn| PAG0| USGN| BYT2| PCR | SYM | BYT | + * +-----+-----+-----+-----+-----+-----+-----+-----+ */ -#define R3_WORD 0x00 /* 16 bit */ -#define R3_BYTE 0x01 /* 8 bit */ +#define R3_WORD 0x00 /* 16 bit */ +#define R3_BYTE 0x01 /* 8 bit */ -#define R3_AREA 0x00 /* Base type */ -#define R3_SYM 0x02 +#define R3_AREA 0x00 /* Base type */ +#define R3_SYM 0x02 -#define R3_NORM 0x00 /* PC adjust */ -#define R3_PCR 0x04 +#define R3_NORM 0x00 /* PC adjust */ +#define R3_PCR 0x04 -#define R3_BYT1 0x00 /* Byte count for R_BYTE = 1 */ -#define R3_BYTX 0x08 /* Byte count for R_BYTE = X */ +#define R3_BYT1 0x00 /* Byte count for R_BYTE = 1 */ +#define R3_BYTX 0x08 /* Byte count for R_BYTE = X */ -#define R3_SGND 0x00 /* Signed value */ -#define R3_USGN 0x10 /* Unsigned value */ +#define R3_SGND 0x00 /* Signed value */ +#define R3_USGN 0x10 /* Unsigned value */ -#define R3_NOPAG 0x00 /* Page Mode */ -#define R3_PAG0 0x20 /* Page '0' */ -#define R3_PAG 0x40 /* Page 'nnn' */ +#define R3_NOPAG 0x00 /* Page Mode */ +#define R3_PAG0 0x20 /* Page '0' */ +#define R3_PAG 0x40 /* Page 'nnn' */ -#define R3_LSB 0x00 /* output low byte */ -#define R3_MSB 0x80 /* output high byte */ +#define R3_LSB 0x00 /* output low byte */ +#define R3_MSB 0x80 /* output high byte */ /* - * Additional "R3_" functionality is required to support - * some microprocesssor architectures. The 'illegal' - * "R3_" mode of R3_WORD | R3_BYTX is used as a designator - * of the extended R3_ modes. The extended modes replace - * the PAGING modes and are being added in an adhoc manner - * as follows: + * Additional "R3_" functionality is required to support + * some microprocesssor architectures. The 'illegal' + * "R3_" mode of R3_WORD | R3_BYTX is used as a designator + * of the extended R3_ modes. The extended modes replace + * the PAGING modes and are being added in an adhoc manner + * as follows: * * Extended Mode relocation flags * - * 7 6 5 4 3 2 1 0 - * +-----+-----+-----+-----+-----+-----+-----+-----+ - * | MSB | x | x | USGN| 1 | PCR | SYM | 0 | - * +-----+-----+-----+-----+-----+-----+-----+-----+ + * 7 6 5 4 3 2 1 0 + * +-----+-----+-----+-----+-----+-----+-----+-----+ + * | MSB | x | x | USGN| 1 | PCR | SYM | 0 | + * +-----+-----+-----+-----+-----+-----+-----+-----+ */ -#define R3_ECHEK 0011 /* Extended Mode Check Bits */ -#define R3_EXTND 0010 /* Extended Mode Code */ -#define R3_EMASK 0151 /* Extended Mode Mask */ +#define R3_ECHEK 0011 /* Extended Mode Check Bits */ +#define R3_EXTND 0010 /* Extended Mode Code */ +#define R3_EMASK 0151 /* Extended Mode Mask */ -/* #define R3_AREA 0000 */ /* Base type */ +/* #define R3_AREA 0000 */ /* Base type */ /* #define R3_SYM 0002 */ -/* #define R3_NORM 0000 */ /* PC adjust */ +/* #define R3_NORM 0000 */ /* PC adjust */ /* #define R3_PCR 0004 */ -/* #define R3_SGND 0000 */ /* Signed value */ -/* #define R3_USGN 0020 */ /* Unsigned value */ +/* #define R3_SGND 0000 */ /* Signed value */ +/* #define R3_USGN 0020 */ /* Unsigned value */ -/* #define R3_LSB 0000 */ /* output low byte */ -/* #define R3_MSB 0200 */ /* output high byte */ +/* #define R3_LSB 0000 */ /* output low byte */ +/* #define R3_MSB 0200 */ /* output high byte */ -#define R_J11 (R3_WORD|R3_BYTX) /* JLH: 11 bit JMP and CALL (8051) */ -#define R_J19 (R3_WORD|R3_BYTX|R3_MSB) /* 19 bit JMP and CALL (DS80C390) */ -#define R_C24 (R3_WORD|R3_BYT1|R3_MSB) /* 24 bit address (DS80C390) */ +#define R3_J11 (R3_WORD|R3_BYTX) /* JLH: 11 bit JMP and CALL (8051) */ +#define R3_J19 (R3_WORD|R3_BYTX|R3_MSB) /* BM: 19 bit JMP and CALL (DS80C390) */ +#define R_C24 (R3_WORD|R3_BYT1|R3_MSB) /* 24 bit address (DS80C390) */ #define R_J19_MASK (R3_BYTE|R3_BYTX|R3_MSB) -#define IS_R_J19(x) (((x) & R_J19_MASK) == R_J19) -#define IS_R_J11(x) (((x) & R_J19_MASK) == R_J11) +#define IS_R_J19(x) (((x) & R_J19_MASK) == R3_J19) +#define IS_R_J11(x) (((x) & R_J19_MASK) == R3_J11) #define IS_C24(x) (((x) & R_J19_MASK) == R_C24) /* sdld specific */ -#define R_BYT3 0x100 /* if R3_BYTE is set, this is a - * 3 byte address, of which - * the linker must select one byte. - */ -#define R_HIB 0x200 /* If R3_BYTE & R_BYT3 are set, linker - * will select byte 3 of the relocated - * 24 bit address. - */ - -#define R_BIT 0x400 /* Linker will convert from byte-addressable - * space to bit-addressable space. - */ - -#define R_ESCAPE_MASK 0xf0 /* Used to escape relocation modes - * greater than 0xff in the .rel - * file. - */ +#define R_BYT3 0x100 /* if R3_BYTE is set, this is a + * 3 byte address, of which + * the linker must select one byte. + */ +#define R_HIB 0x200 /* If R3_BYTE & R_BYT3 are set, linker + * will select byte 3 of the relocated + * 24 bit address. + */ + +#define R_BIT 0x400 /* Linker will convert from byte-addressable + * space to bit-addressable space. + */ + +#define R_ESCAPE_MASK 0xf0 /* Used to escape relocation modes + * greater than 0xff in the .rel + * file. + */ /* end sdld specific */ + +/* + * ASLINK - Version 4 Definitions + */ + +/* + * The "A4_" area constants define values used in + * generating the assembler area output data. + * + * Area flags + * + * 7 6 5 4 3 2 1 0 + * +-----+-----+-----+-----+-----+-----+-----+-----+ + * | BNK | SEG | | PAG | ABS | OVR | WL1 | WL0 | + * +-----+-----+-----+-----+-----+-----+-----+-----+ + */ + +#define A4_BYTE 0x0000 /* 8 bit */ +#define A4_WORD 0x0001 /* 16 bit */ + +#define A4_1BYTE 0x0000 /* 1 Byte Word Length */ +#define A4_2BYTE 0x0001 /* 2 Byte Word Length */ +#define A4_3BYTE 0x0002 /* 3 Byte Word Length */ +#define A4_4BYTE 0x0003 /* 4 Byte Word Length */ +#define A4_WLMSK 0x0003 /* Word Length Mask */ + +#define A4_CON 0x0400 /* Concatenating */ +#define A4_OVR 0x0404 /* Overlaying */ +#define A4_REL 0x0800 /* Relocatable */ +#define A4_ABS 0x0808 /* absolute */ +#define A4_NOPAG 0x1000 /* Non-Paged */ +#define A4_PAG 0x1010 /* Paged */ + +#define A4_CSEG 0x4000 /* CSEG */ +#define A4_DSEG 0x4040 /* DSEG */ +#define A4_NOBNK 0x8000 /* Non-Banked */ +#define A4_BNK 0x8080 /* Banked */ + +#define A4_OUT 0x0100 /* Output Code Flag */ + +/* + * The "R4_" relocation constants define values used in + * generating the assembler relocation output data for + * areas, symbols, and code. + * + * Note: The PAGE modes, PCR modes, Signed, Unsigned, + * and MSB codes are mutually exclusive !!! + * + * + * Relocation flags + * + * 7 6 5 4 3 2 1 0 + * +-----+-----+-----+-----+-----+-----+-----+-----+ + * | SYM | PCR | PAGn| PAG0| USGN| SGND| BYT1| BYT0| + * +-----+-----+-----+-----+-----+-----+-----+-----+ + */ + +#define R4_BYTE 0x0000 /* 8 bit */ +#define R4_WORD 0x0001 /* 16 bit */ + +#define R4_1BYTE 0x0000 /* 1 Byte */ +#define R4_2BYTE 0x0001 /* 2 Byte */ +#define R4_3BYTE 0x0002 /* 3 Byte */ +#define R4_4BYTE 0x0003 /* 4 Byte */ +#define R4_BYTES 0x0003 /* Data Size */ + +#define R4_SGND 0x0004 /* Signed */ +#define R4_USGN 0x0008 /* Unsigned */ +#define R4_OVRF 0x0008 /* Overflow */ + +#define R4_MBRS 0x0004 /* Merge Bit Range Signed */ + /* An alias for Signed */ +#define R4_MBRU 0x0008 /* Merge Bit Range Unsigned */ + /* An alias for Unsigned */ +#define R4_MBRO 0x0008 /* Merge Bit Range Overflow */ + /* An alias for Unsigned */ + +#define R4_MSB 0x000C /* MSB */ + /* Mutually exclusive with Signed / Unsigned */ + +#define R4_AREA 0x0000 /* Base type */ +#define R4_SYM 0x0080 + +/* + * Paging Modes: + */ + +#define R4_NOPAG 0x0000 /* Page Mode */ +#define R4_PBITS 0x003C /* Paging Bits */ +#define R4_PAGE 0x0030 /* Paged Addressing */ +#define R4_PAG0 0x0010 /* Page '0' .setdp */ +#define R4_PAGN 0x0020 /* Page 'nnn' .setdp */ +#define R4_PAGX 0x0030 /* Page 'x', Extended Relocation Mode */ +#define R4_PAGX0 0x0030 /* Page 'x', pc + 0 */ +#define R4_PAGX1 0x0034 /* Page 'x', pc + 1 */ +#define R4_PAGX2 0x0038 /* Page 'x', pc + 2 */ +#define R4_PAGX3 0x003C /* Page 'x', pc + 3 */ + +/* + * PCR Modes: + */ + +#define R4_PCR 0x0040 /* PC adjust (default) */ +#define R4_PCRN 0x0050 /* PC adjust (default) no range check */ + +#define R4_PCR0 0x0054 /* PC adjust (offset = 0) */ +#define R4_PCR1 0x0060 /* PC adjust (offset = 1) */ +#define R4_PCR2 0x0064 /* PC adjust (offset = 2) */ +#define R4_PCR3 0x0068 /* PC adjust (offset = 3) */ +#define R4_PCR4 0x006C /* PC adjust (offset = 4) */ + +#define R4_PCR0N 0x0058 /* PC adjust (offset = 0) no range check */ +#define R4_PCR1N 0x0070 /* PC adjust (offset = 1) no range check */ +#define R4_PCR2N 0x0074 /* PC adjust (offset = 2) no range check */ +#define R4_PCR3N 0x0078 /* PC adjust (offset = 3) no range check */ +#define R4_PCR4N 0x007C /* PC adjust (offset = 4) no range check */ + +/* + * Basic Relocation Modes + */ + +#define R4_NORM 0x0000 /* No Bit Positioning */ + + /* - * The defined type 'a_uint' is used for all address and - * unsigned variable value calculations. Its size is - * required to be at least 32-bits to allow upto - * 32-bit addressing or 32-bit value manipulation. - */ -typedef unsigned INT32 a_uint; - -/* - * The defined type 'v_sint' is used for address and - * variable value calculations requiring a sign. - * Its size is required to be at least 32-bits to allow - * upto 32-bit addressing or 32-bit value manipulation. - */ -typedef signed INT32 v_sint; - -/* - * The structures of head, area, areax, and sym - * are created as the REL files are read during the first - * pass of the linker. The struct head is created upon - * encountering a H directive in the REL file. The - * structure contains a link to a link file structure - * (struct lfile) which describes the file containing the H - * directive, the number of data/code areas - * contained in this header segment, the number of - * symbols referenced/defined in this header segment, a pointer - * to an array of pointers to areax structures (struct areax) - * created as each A directive is read, and a pointer to an - * array of pointers to symbol structures (struct sym) for - * all referenced/defined symbols. As H directives are read - * from the REL files a linked list of head structures is - * created by placing a link to the new head structure - * in the previous head structure. + * The defined type 'a_uint' is used for all address and + * unsigned variable value calculations. Its size is + * required to be at least 32-bits to allow upto + * 32-bit addressing or 32-bit value manipulation. */ -struct head +typedef unsigned INT32 a_uint; + +/* + * The defined type 'v_sint' is used for address and + * variable value calculations requiring a sign. + * Its size is required to be at least 32-bits to allow + * upto 32-bit addressing or 32-bit value manipulation. + */ +typedef signed INT32 v_sint; + +/* + * The structures of head, mode, bank, area, areax, and sym + * are created as the REL files are read during the first + * pass of the linker. The struct head is created upon + * encountering a H directive in the REL file. The + * structure contains a link to a link file structure + * (struct lfile) which describes the file containing the H + * directive, a pointer to an array of merge mode + * definition pointers, the number of data/code areas + * contained in this header segment, the number of + * symbols referenced/defined in this header segment, a pointer + * to an array of pointers to areax structures (struct areax) + * created as each A directive is read, a pointer to an + * array of pointers to symbol structures (struct sym) for + * all referenced/defined symbols and a pointer to an array + * of pointers to bank structures (struct bank) referenced + * by this module. As H directives are read + * from the REL files a linked list of head structures is + * created by placing a link to the new head structure + * in the previous head structure. + */ +struct head +{ + struct head *h_hp; /* Header link */ + struct lfile *h_lfile; /* Associated file */ + int h_narea; /* # of areas */ + struct areax **a_list; /* Area list */ + int h_nsym; /* # of symbols */ + struct sym **s_list; /* Symbol list */ + int h_nbank; /* # of banks */ + struct bank **b_list; /* Bank list */ + int h_nmode; /* # of modes */ + struct mode **m_list; /* Mode list */ + char * m_id; /* Module name */ +}; + +/* + * The MODE structure contains the specification of one of the + * assemblers' relocation modes. Each assembler must specify + * at least one relocation mode. The relocation specification + * allows arbitrarily defined active bits and bit positions. + * The 32 element arrays are indexed from 0 to 31. + * Index 0 corresponds to bit 0, ..., and 31 corresponds to bit 31 + * of a normal integer value. + * + * The value an array element defines if the normal integer bit is + * active (bit <7> is set, 0x80) and what destination bit + * (bits <4:0>, 0 - 31) should be loaded with this normal + * integer bit. + * + * The specification for a 32-bit integer: + * + * char mode_[32] = { + * 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + * 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, + * 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + * 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F + * }; + * + * + * The specification for the 11-bit 8051 addressing mode: + * + * char mode_[32] = { + * 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + * 0x8D, 0x8E, 0x8F, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + * 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + * 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F + * }; + * + * + * m_def is the bit relocation definition array. + * m_flag indicates that bit position swapping is required. + * m_dbits contains the active bit positions for the output. + * m_sbits contains the active bit positions for the input. + */ +struct mode { - struct head *h_hp; /* Header link */ - struct lfile *h_lfile; /* Associated file */ - int h_narea; /* # of areas */ - struct areax **a_list; /* Area list */ - int h_nsym; /* # of symbols */ - struct sym **s_list; /* Symbol list */ - char * m_id; /* Module name */ + char m_def[32]; /* Bit Relocation Definition */ + int m_flag; /* Bit Swapping Flag */ + a_uint m_dbits; /* Destination Bit Mask */ + a_uint m_sbits; /* Source Bit Mask */ }; /* - * A structure area is created for each 'unique' data/code - * area definition found as the REL files are read. The - * struct area contains the name of the area, a flag byte - * which contains the area attributes (REL/CON/OVR/ABS), - * the area subtype (not used in this assembler), and the - * area base address and total size which will be filled - * in at the end of the first pass through the REL files. - * As A directives are read from the REL files a linked - * list of unique area structures is created by placing a - * link to the new area structure in the previous area structure. + * The bank structure contains the parameter values for a + * specific program or data bank. The bank structure + * is a linked list of banks. The initial default bank + * is unnamed and is defined in lkdata.c, the next bank structure + * will be linked to this structure through the structure + * element 'struct bank *b_bp'. The structure contains the + * bank name, the bank base address (default = 0), the bank size + * (default = 0, whole addressing space), the bank mapping, + * and the file name suffix. (default is none) These optional + * parameters are from the .bank assembler directive. + * The bank structure also contains the bank data output + * file specification, file handle pointer and the + * bank first output flag. */ -struct area +struct bank { - struct area *a_ap; /* Area link */ - struct areax *a_axp; /* Area extension link */ - a_uint a_addr; /* Beginning address of area */ - a_uint a_size; /* Total size of the area */ + struct bank *b_bp; /* Bank link */ + char * b_id; /* Bank Name */ + char * b_fsfx; /* Bank File Suffix / File Specification */ + a_uint b_base; /* Bank base address */ + a_uint b_size; /* Bank size */ + a_uint b_map; /* Bank mapping */ + int b_flag; /* Bank flags */ + char * b_fspec; /* Bank File Specification */ + FILE * b_ofp; /* Bank File Handle */ + char * b_ofspec; /* Bank Output File Specification */ + int b_oflag; /* Bank has output flag */ + int b_rtaflg; /* Bank First Output flag */ +}; + +#define B_BASE 0001 /* 'base' address specified */ +#define B_SIZE 0002 /* 'size' of bank specified */ +#define B_FSFX 0004 /* File suffix specified */ +#define B_MAP 0010 /* Mapped Bank Flag */ + +/* + * A structure area is created for each 'unique' data/code + * area definition found as the REL files are read. The + * struct area contains the name of the area, a flag byte + * which contains the area attributes (REL/CON/OVR/ABS), + * the area base address set flag byte (-b option), and the + * area base address and total size which will be filled + * in at the end of the first pass through the REL files. + * The area structure also contains a link to the bank + * this area is a part of and a data output file handle + * pointer which is loaded from from the bank structure. + * As A directives are read from the REL files a linked + * list of unique area structures is created by placing a + * link to the new area structure in the previous area structure. + */ +struct area +{ + struct area *a_ap; /* Area link */ + struct areax *a_axp; /* Area extension link */ + struct bank *a_bp; /* Bank link */ + FILE * a_ofp; /* Area File Handle */ + a_uint a_addr; /* Beginning address of area */ + a_uint a_size; /* Total size of the area */ + int a_bset; /* Area base address set */ /* sdld specific */ - a_uint a_unaloc; /* Total number of unallocated bytes, for error reporting */ + a_uint a_unaloc; /* Total number of unallocated bytes, for error reporting */ /* end sdld specific */ - char a_type; /* Area subtype */ - int a_flag; /* Flags */ - char * a_id; /* Name */ + int a_flag; /* Flags */ + char * a_id; /* Name */ /* sdld specific */ - char *a_image; /* Something for hc08/lkelf */ - char *a_used; /* Something for hc08/lkelf */ + char *a_image; /* Something for hc08/lkelf */ + char *a_used; /* Something for hc08/lkelf */ /* end sdld specific */ }; /* - * An areax structure is created for every A directive found - * while reading the REL files. The struct areax contains a - * link to the 'unique' area structure referenced by the A - * directive and to the head structure this area segment is - * a part of. The size of this area segment as read from the - * A directive is placed in the areax structure. The beginning - * address of this segment will be filled in at the end of the - * first pass through the REL files. As A directives are read - * from the REL files a linked list of areax structures is - * created for each unique area. The final areax linked - * list has at its head the 'unique' area structure linked - * to the linked areax structures (one areax structure for - * each A directive for this area). + * An areax structure is created for every A directive found + * while reading the REL files. The struct areax contains a + * link to the 'unique' area structure referenced by the A + * directive and to the head structure this area segment is + * a part of. The size of this area segment as read from the + * A directive is placed in the areax structure. The beginning + * address of this segment will be filled in at the end of the + * first pass through the REL files. As A directives are read + * from the REL files a linked list of areax structures is + * created for each unique area. The final areax linked + * list has at its head the 'unique' area structure linked + * to the linked areax structures (one areax structure for + * each A directive for this area). */ -struct areax +struct areax { - struct areax *a_axp; /* Area extension link */ - struct area *a_bap; /* Base area link */ - struct head *a_bhp; /* Base header link */ - a_uint a_addr; /* Beginning address of section */ - a_uint a_size; /* Size of the area in section */ + struct areax *a_axp; /* Area extension link */ + struct area *a_bap; /* Base area link */ + struct head *a_bhp; /* Base header link */ + a_uint a_addr; /* Beginning address of section */ + a_uint a_size; /* Size of the area in section */ }; /* - * A sym structure is created for every unique symbol - * referenced/defined while reading the REL files. The - * struct sym contains the symbol's name, a flag value - * (not used in this linker), a symbol type denoting - * referenced/defined, and an address which is loaded - * with the relative address within the area in which - * the symbol was defined. The sym structure also - * contains a link to the area where the symbol was defined. - * The sym structures are linked into linked lists using - * the symbol link element. + * A sym structure is created for every unique symbol + * referenced/defined while reading the REL files. The + * struct sym contains the symbol's name, a flag value + * (not used in this linker), a symbol type denoting + * referenced/defined, and an address which is loaded + * with the relative address within the area in which + * the symbol was defined. The sym structure also + * contains a link to the area where the symbol was defined. + * The sym structures are linked into linked lists using + * the symbol link element. */ -struct sym +struct sym { - struct sym *s_sp; /* Symbol link */ - struct areax *s_axp; /* Symbol area link */ - char s_type; /* Symbol subtype */ - char s_flag; /* Flag byte */ - a_uint s_addr; /* Address */ - char *s_id; /* Name (JLH) */ - char *m_id; /* Module symbol define in */ + struct sym *s_sp; /* Symbol link */ + struct areax *s_axp; /* Symbol area link */ + char s_type; /* Symbol subtype */ + char s_flag; /* Flag byte */ + a_uint s_addr; /* Address */ + char *s_id; /* Name (JLH) */ + char *m_id; /* Module symbol define in */ }; /* - * The structure lfile contains a pointer to a - * file specification string, the file type, and - * a link to the next lfile structure. + * The structure lfile contains a pointer to a + * file specification string, an index which points + * to the file name (past the 'path'), the file type, + * an object output flag, and a link to the next + * lfile structure. */ -struct lfile +struct lfile { - struct lfile *f_flp; /* lfile link */ - int f_type; /* File type */ - char *f_idp; /* Pointer to file spec */ - int f_idx; /* Index to file name */ + struct lfile *f_flp; /* lfile link */ + int f_type; /* File type */ + char *f_idp; /* Pointer to file spec */ + int f_idx; /* Index to file name */ + int f_obj; /* Object output flag */ }; /* - * The struct base contains a pointer to a - * base definition string and a link to the next - * base structure. + * The struct base contains a pointer to a + * base definition string and a link to the next + * base structure. */ -struct base +struct base { - struct base *b_base; /* Base link */ - char *b_strp; /* String pointer */ + struct base *b_base; /* Base link */ + char *b_strp; /* String pointer */ }; /* - * The struct globl contains a pointer to a - * global definition string and a link to the next - * global structure. + * The struct globl contains a pointer to a + * global definition string and a link to the next + * global structure. */ -struct globl +struct globl { - struct globl *g_globl; /* Global link */ - char *g_strp; /* String pointer */ + struct globl *g_globl; /* Global link */ + char *g_strp; /* String pointer */ }; /* - * A structure sdp is created for each 'unique' paged - * area definition found as the REL files are read. - * As P directives are read from the REL files a linked - * list of unique sdp structures is created by placing a - * link to the new sdp structure in the previous area structure. + * A structure sdp is created for each 'unique' paged + * area definition found as the REL files are read. + * As P directives are read from the REL files a linked + * list of unique sdp structures is created by placing a + * link to the new sdp structure in the previous area structure. */ -struct sdp +struct sdp { - struct area *s_area; /* Paged Area link */ - struct areax *s_areax; /* Paged Area Extension Link */ - a_uint s_addr; /* Page address offset */ + struct area *s_area; /* Paged Area link */ + struct areax *s_areax; /* Paged Area Extension Link */ + a_uint s_addr; /* Page address offset */ }; /* - * The structure rerr is loaded with the information - * required to report an error during the linking - * process. The structure contains an index value - * which selects the areax structure from the header - * areax structure list, a mode value which selects - * symbol or area relocation, the base address in the - * area section, an area/symbol list index value, and - * an area/symbol offset value. + * The structure rerr is loaded with the information + * required to report an error during the linking + * process. The structure contains an index value + * which selects the areax structure from the header + * areax structure list, a mode value which selects + * symbol or area relocation, the base address in the + * area section, an area/symbol list index value, and + * an area/symbol offset value. */ -struct rerr +struct rerr { - int aindex; /* Linking area */ - int mode; /* Relocation mode */ - a_uint rtbase; /* Base address in section */ - int rindex; /* Area/Symbol reloaction index */ - a_uint rval; /* Area/Symbol offset value */ + int aindex; /* Linking area */ + int mode; /* Relocation mode */ + a_uint rtbase; /* Base address in section */ + int rindex; /* Area/Symbol reloaction index */ + a_uint rval; /* Area/Symbol offset value */ }; /* - * The structure lbpath is created for each library - * path specification input by the -k option. The - * lbpath structures are linked into a list using - * the next link element. + * The structure lbpath is created for each library + * path specification input by the -k option. The + * lbpath structures are linked into a list using + * the next link element. */ struct lbpath { - struct lbpath *next; - char *path; + struct lbpath *next; + char *path; }; /* - * The structure lbname is created for all combinations of the - * library path specifications (input by the -k option) and the - * library file specifications (input by the -l option) that - * lead to an existing file. The element path points to - * the path string, element libfil points to the library - * file string, and the element libspc is the concatenation - * of the valid path and libfil strings. - * - * The lbpath structures are linked into a list - * using the next link element. + * The structure lbname is created for all combinations of the + * library path specifications (input by the -k option) and the + * library file specifications (input by the -l option) that + * lead to an existing file. The element path points to + * the path string, element libfil points to the library + * file string, and the element libspc is the concatenation + * of the valid path and libfil strings. + * + * The lbpath structures are linked into a list + * using the next link element. * - * Each library file contains a list of object files - * that are contained in the particular library. e.g.: + * Each library file contains a list of object files + * that are contained in the particular library. e.g.: * - * \iolib\termio - * \inilib\termio + * \iolib\termio + * \inilib\termio * - * Only one specification per line is allowed. + * Only one specification per line is allowed. */ struct lbname { - struct lbname *next; - char *path; - char *libfil; - char *libspc; + struct lbname *next; + char *path; + char *libfil; + char *libspc; + int f_obj; }; /* - * The function fndsym() searches through all combinations of the - * library path specifications (input by the -k option) and the - * library file specifications (input by the -l option) that - * lead to an existing file for a symbol definition. - * - * The structure lbfile is created for the first library - * object file which contains the definition for the - * specified undefined symbol. - * - * The element libspc points to the library file path specification - * and element relfil points to the object file specification string. - * The element filspc is the complete path/file specification for - * the library file to be imported into the linker. The - * file specicifation may be formed in one of two ways: - * - * (1) If the library file contained an absolute - * path/file specification then this becomes filspc. - * (i.e. C:\...) - * - * (2) If the library file contains a relative path/file - * specification then the concatenation of the path - * and this file specification becomes filspc. - * (i.e. \...) + * The function fndsym() searches through all combinations of the + * library path specifications (input by the -k option) and the + * library file specifications (input by the -l option) that + * lead to an existing file for a symbol definition. + * + * The structure lbfile is created for the first library + * object file which contains the definition for the + * specified undefined symbol. + * + * The element libspc points to the library file path specification + * and element relfil points to the object file specification string. + * The element filspc is the complete path/file specification for + * the library file to be imported into the linker. The f_obj + * flag specifies if the object code from this file is + * to be output by the linker. The file specification + * may be formed in one of two ways: + * + * (1) If the library file contained an absolute + * path/file specification then this becomes filspc. + * (i.e. C:\...) + * + * (2) If the library file contains a relative path/file + * specification then the concatenation of the path + * and this file specification becomes filspc. + * (i.e. \...) * - * The lbpath structures are linked into a list - * using the next link element. + * The lbpath structures are linked into a list + * using the next link element. */ struct lbfile { - struct lbfile *next; - char *libspc; - char *relfil; - char *filspc; + struct lbfile *next; + char *libspc; + char *relfil; + char *filspc; + int f_obj; /* sdld specific */ - long offset; - unsigned int type; + long offset; + unsigned int type; /* end sdld specific */ }; /* - * External Definitions for all Global Variables + * External Definitions for all Global Variables */ -extern char *_abs_; /* = { ". .ABS." }; - */ -extern int lkerr; /* ASLink error flag - */ -extern char *ip; /* pointer into the REL file - * text line in ib[] - */ -extern char ib[NINPUT]; /* REL file text line - */ -extern char *rp; /* pointer into the LST file - * text line in rb[] - */ -extern char rb[NINPUT]; /* LST file text line being - * address relocated - */ -extern char ctype[]; /* array of character types, one per - * ASCII character - */ - -/* - * Character Type Definitions - */ -#define SPACE '\000' -#define ETC '\000' -#define LETTER '\001' -#define DIGIT '\002' -#define BINOP '\004' -#define RAD2 '\010' -#define RAD8 '\020' -#define RAD10 '\040' -#define RAD16 '\100' -#define ILL '\200' - -#define DGT2 DIGIT|RAD16|RAD10|RAD8|RAD2 -#define DGT8 DIGIT|RAD16|RAD10|RAD8 -#define DGT10 DIGIT|RAD16|RAD10 -#define LTR16 LETTER|RAD16 - -extern char afspec[]; /* The filespec created by afile() - */ -extern char ccase[]; /* an array of characters which - * perform the case translation function - */ - -extern struct lfile *filep; /* The pointers (lfile *) filep, - * (lfile *) cfp, and (FILE *) sfp - * are used in conjunction with - * the routine nxtline() to read - * aslink commands from - * (1) the standard input or - * (2) or a command file - * and to read the REL files - * sequentially as defined by the - * aslink input commands. - * - * The pointer *filep points to the - * beginning of a linked list of - * lfile structures. - */ -extern struct lfile *cfp; /* The pointer *cfp points to the - * current lfile structure - */ -extern struct lfile *startp;/* aslink startup file structure - */ -extern struct lfile *linkp; /* pointer to first lfile structure - * containing an input REL file - * specification - */ -extern struct lfile *lfp; /* pointer to current lfile structure - * being processed by parse() - */ -extern struct head *headp; /* The pointer to the first - * head structure of a linked list - */ -extern struct head *hp; /* Pointer to the current - * head structure - */ -extern struct area *areap; /* The pointer to the first - * area structure of a linked list - */ -extern struct area *ap; /* Pointer to the current - * area structure - */ -extern struct areax *axp; /* Pointer to the current - * areax structure - */ -extern struct sym *symhash[NHASH]; /* array of pointers to NHASH - * linked symbol lists - */ -extern struct base *basep; /* The pointer to the first - * base structure - */ -extern struct base *bsp; /* Pointer to the current - * base structure - */ -extern struct globl *globlp;/* The pointer to the first - * globl structure - */ -extern struct globl *gsp; /* Pointer to the current - * globl structure - */ -extern struct sdp sdp; /* Base Paged structure - */ -extern struct rerr rerr; /* Structure containing the - * linker error information - */ -extern FILE *ofp; /* Linker Output file handle - */ +extern char *_abs_; /* = { ". .ABS." }; + */ +extern int lkerr; /* ASLink error flag + */ +extern char *ip; /* pointer into the REL file + * text line in ib[] + */ +extern char ib[NINPUT]; /* REL file text line + */ +extern char *rp; /* pointer into the LST file + * text line in rb[] + */ +extern char rb[NINPUT]; /* LST file text line being + * address relocated + */ +extern char ctype[]; /* array of character types, one per + * ASCII character + */ + +/* + * Character Type Definitions + */ +#define SPACE '\000' +#define ETC '\000' +#define LETTER '\001' +#define DIGIT '\002' +#define BINOP '\004' +#define RAD2 '\010' +#define RAD8 '\020' +#define RAD10 '\040' +#define RAD16 '\100' +#define ILL '\200' + +#define DGT2 DIGIT|RAD16|RAD10|RAD8|RAD2 +#define DGT8 DIGIT|RAD16|RAD10|RAD8 +#define DGT10 DIGIT|RAD16|RAD10 +#define LTR16 LETTER|RAD16 + +extern char afspec[]; /* The filespec created by afile() + */ +extern char ccase[]; /* an array of characters which + * perform the case translation function + */ + +extern struct lfile *filep; /* The pointers (lfile *) filep, + * (lfile *) cfp, and (FILE *) sfp + * are used in conjunction with + * the routine nxtline() to read + * aslink commands from + * (1) the standard input or + * (2) or a command file + * and to read the REL files + * sequentially as defined by the + * aslink input commands. + * + * The pointer *filep points to the + * beginning of a linked list of + * lfile structures. + */ +extern struct lfile *cfp; /* The pointer *cfp points to the + * current lfile structure + */ +extern struct lfile *startp;/* aslink startup file structure + */ +extern struct lfile *linkp; /* pointer to first lfile structure + * containing an input REL file + * specification + */ +extern struct lfile *lfp; /* pointer to current lfile structure + * being processed by parse() + */ +extern struct head *headp; /* The pointer to the first + * head structure of a linked list + */ +extern struct head *hp; /* Pointer to the current + * head structure + */ +extern struct bank *bankp; /* The pointer to the first + * bank structure of a linked list + */ +extern struct bank *bp; /* Pointer to the current + * bank structure + */ +extern struct area *areap; /* The pointer to the first + * area structure of a linked list + */ +extern struct area *ap; /* Pointer to the current + * area structure + */ +extern struct areax *axp; /* Pointer to the current + * areax structure + */ +extern struct sym *symhash[NHASH]; /* array of pointers to NHASH + * linked symbol lists + */ +extern struct base *basep; /* The pointer to the first + * base structure + */ +extern struct base *bsp; /* Pointer to the current + * base structure + */ +extern struct globl *globlp;/* The pointer to the first + * globl structure + */ +extern struct globl *gsp; /* Pointer to the current + * globl structure + */ +extern struct sdp sdp; /* Base Paged structure + */ +extern struct rerr rerr; /* Structure containing the + * linker error information + */ +extern FILE *nbofp; /* Non Banked Linker Output + * File Handle + */ +extern FILE *ofp; /* Linker Output file handle + */ #if NOICE -extern FILE *jfp; /* NoICE output file handle - */ +extern FILE *jfp; /* NoICE output file handle + */ #endif -extern FILE *mfp; /* Map output file handle - */ -extern FILE *rfp; /* File handle for output - * address relocated ASxxxx - * listing file - */ -extern FILE *sfp; /* The file handle sfp points to the - * currently open file - */ -extern FILE *tfp; /* File handle for input - * ASxxxx listing file - */ +extern FILE *mfp; /* Map output file handle + */ +extern FILE *rfp; /* File handle for output + * address relocated ASxxxx + * listing file + */ +extern FILE *sfp; /* The file handle sfp points to the + * currently open file + */ +extern FILE *tfp; /* File handle for input + * ASxxxx listing file + */ #if SDCDB -extern FILE *yfp; /* SDCDB output file handle - */ +extern FILE *yfp; /* SDCDB output file handle + */ #endif -extern int oflag; /* Output file type flag - */ +extern int oflag; /* Output file type flag + */ +extern int objflg; /* Linked file/library object output flag + */ + #if NOICE -extern int jflag; /* -j, enable NoICE Debug output - */ +extern int jflag; /* -j, enable NoICE Debug output + */ #endif -extern int mflag; /* Map output flag - */ -extern int xflag; /* Map file radix type flag - */ +extern int mflag; /* Map output flag + */ +extern int xflag; /* Map file radix type flag + */ #if SDCDB -extern int yflag; /* -y, enable SDCC Debug output - */ +extern int yflag; /* -y, enable SDCC Debug output + */ #endif -extern int pflag; /* print linker command file flag - */ -extern int uflag; /* Listing relocation flag - */ -extern int wflag; /* Enable wide format listing - */ -extern int zflag; /* Disable symbol case sensitivity - */ -extern int radix; /* current number conversion radix: - * 2 (binary), 8 (octal), 10 (decimal), - * 16 (hexadecimal) - */ -extern int line; /* current line number - */ -extern int page; /* current page number - */ -extern int lop; /* current line number on page - */ -extern int pass; /* linker pass number - */ -extern int pcb; /* current bytes per pc word - */ -extern int rtcnt; /* count of elements in the - * rtval[] and rtflg[] arrays - */ -extern a_uint rtval[]; /* data associated with relocation - */ -extern int rtflg[]; /* indicates if rtval[] value is - * to be sent to the output file. - */ -extern int rterr[]; /* indicates if rtval[] value should - * be flagged as a relocation error. - */ -extern char rtbuf[]; /* S19/IHX output buffer - */ - /* rtbuf[] processing - */ -extern a_uint rtadr0; /* - */ -extern a_uint rtadr1; /* - */ -extern a_uint rtadr2; /* - */ -extern int a_bytes; /* REL file T Line address length - */ -extern int hilo; /* REL file byte ordering - */ -extern a_uint a_mask; /* Address Mask - */ -extern a_uint s_mask; /* Sign Mask - */ -extern a_uint v_mask; /* Value Mask - */ -extern int gline; /* LST file relocation active - * for current line - */ -extern int gcntr; /* LST file relocation active - * counter - */ -extern struct lbpath *lbphead; /* pointer to the first - * library path structure - */ -extern struct lbname *lbnhead; /* pointer to the first - * library name structure - */ -extern struct lbfile *lbfhead; /* pointer to the first - * library file structure - */ +extern int pflag; /* print linker command file flag + */ +extern int uflag; /* Listing relocation flag + */ +extern int wflag; /* Enable wide format listing + */ +extern int zflag; /* Disable symbol case sensitivity + */ +extern int radix; /* current number conversion radix: + * 2 (binary), 8 (octal), 10 (decimal), + * 16 (hexadecimal) + */ +extern int line; /* current line number + */ +extern int page; /* current page number + */ +extern int lop; /* current line number on page + */ +extern int pass; /* linker pass number + */ +extern a_uint pc; /* current relocation address + */ +extern int pcb; /* current bytes per pc word + */ +extern int rtcnt; /* count of elements in the + * rtval[] and rtflg[] arrays + */ +extern a_uint rtval[]; /* data associated with relocation + */ +extern int rtflg[]; /* indicates if rtval[] value is + * to be sent to the output file. + */ +extern int rterr[]; /* indicates if rtval[] value should + * be flagged as a relocation error. + */ +extern char rtbuf[]; /* S19/IHX output buffer + */ +extern struct bank *rtabnk; /* rtbuf[] processing + */ +extern int rtaflg; /* rtbuf[] processing + */ +extern a_uint rtadr0; /* + */ +extern a_uint rtadr1; /* + */ +extern a_uint rtadr2; /* + */ +extern int obj_flag; /* Linked file/library object output flag + */ +extern int a_bytes; /* REL file T Line address length + */ +extern int hilo; /* REL file byte ordering + */ +extern a_uint a_mask; /* Address Mask + */ +extern a_uint s_mask; /* Sign Mask + */ +extern a_uint v_mask; /* Value Mask + */ +extern int gline; /* LST file relocation active + * for current line + */ +extern int gcntr; /* LST file relocation active + * counter + */ +extern struct lbpath *lbphead; /* pointer to the first + * library path structure + */ +extern struct lbname *lbnhead; /* pointer to the first + * library name structure + */ +extern struct lbfile *lbfhead; /* pointer to the first + * library file structure + */ /* sdld specific */ -extern int sflag; /* JCF: Memory usage output flag - */ -extern int packflag; /* Pack data memory flag - */ -extern int stacksize; /* Pack data memory flag - */ -extern int rflag; /* Extended linear address record flag. - */ -extern a_uint iram_size; /* internal ram size - */ -extern long xram_size; /* external ram size - */ -extern long code_size; /* code size - */ -extern char *sdld_output; /* output file name, --output argument - */ +extern int sflag; /* JCF: Memory usage output flag + */ +extern int packflag; /* Pack data memory flag + */ +extern int stacksize; /* Pack data memory flag + */ +extern int rflag; /* Extended linear address record flag. + */ +extern a_uint iram_size; /* internal ram size + */ +extern long xram_size; /* external ram size + */ +extern long code_size; /* code size + */ +extern char *sdld_output; /* output file name, --output argument + */ extern char *optsdcc; extern char *optsdcc_module; /* sdld 8015 specific */ -extern char idatamap[]; /* 0:not used, 1:used - */ +extern char idatamap[]; /* 0:not used, 1:used + */ /* end sdld 8051 specific */ /* end sdld specific */ @@ -866,164 +1114,179 @@ /* C Library function definitions */ /* for reference only -extern VOID exit(); -extern int fclose(); -extern char * fgets(); -extern FILE * fopen(); -extern int fprintf(); -extern VOID free(); -extern VOID * malloc(); -extern char putc(); -extern char * sprintf(); -extern char * strcpy(); -extern int strlen(); -extern char * strncpy(); -extern char * strrchr(); +extern VOID exit(); +extern int fclose(); +extern char * fgets(); +extern FILE * fopen(); +extern int fprintf(); +extern VOID free(); +extern VOID * malloc(); +extern char putc(); +extern char * sprintf(); +extern char * strcpy(); +extern int strlen(); +extern char * strncpy(); +extern char * strrchr(); */ /* Program function definitions */ -#ifdef OTHERSYSTEM +#ifdef OTHERSYSTEM /* lkmain.c */ -extern FILE * afile(char *fn, char *ft, int wf); -extern VOID bassav(void); -extern int fndidx(char *str); -extern int fndext(char *str); -extern VOID gblsav(void); -extern int intsiz(void); -extern VOID iramsav(void); -extern VOID xramsav(void); -extern VOID codesav(void); -extern VOID iramcheck(void); -extern VOID link_main(void); -extern VOID lkexit(int i); -extern int main(int argc, char *argv[]); -extern VOID map(void); -extern VOID sym(void); -extern int parse(void); -extern VOID doparse(void); -extern VOID setbas(void); -extern VOID setgbl(void); -extern VOID usage(int n); -extern VOID copyfile (FILE *dest, FILE *src); +extern FILE * afile(char *fn, char *ft, int wf); +extern VOID bassav(void); +extern int fndidx(char *str); +extern int fndext(char *str); +extern VOID gblsav(void); +extern int intsiz(void); +extern VOID iramsav(void); +extern VOID xramsav(void); +extern VOID codesav(void); +extern VOID iramcheck(void); +extern VOID link_main(void); +extern VOID lkexit(int i); +extern int main(int argc, char *argv[]); +extern VOID map(void); +extern VOID sym(void); +extern int parse(void); +extern VOID doparse(void); +extern VOID setarea(void); +extern VOID setgbl(void); +extern VOID usage(int n); +extern VOID copyfile (FILE *dest, FILE *src); /* lklex.c */ -extern VOID chopcrlf(char *str); -extern char endline(void); -extern int get(void); -extern VOID getfid(char *str, int c); -extern VOID getid(char *id, int c); -extern VOID getSid(char *id); -extern int getmap(int d); -extern int getnb(void); -extern int more(void); -extern int nxtline(void); -extern VOID skip(int c); -extern VOID unget(int c); +extern VOID chopcrlf(char *str); +extern char endline(void); +extern int get(void); +extern VOID getfid(char *str, int c); +extern VOID getid(char *id, int c); +extern VOID getSid(char *id); +extern int getmap(int d); +extern int getnb(void); +extern int more(void); +extern int nxtline(void); +extern VOID skip(int c); +extern VOID unget(int c); /* lkarea.c */ -extern VOID lkparea(char *id); -extern VOID lnkarea(void); -extern VOID lnkarea2(void); -extern VOID newarea(void); +extern VOID lkparea(char *id); +extern VOID lnkarea(void); +extern VOID lnkarea2(void); +extern VOID newarea(void); /* lkbank.c */ -extern VOID lkfclose(void); -extern VOID lkfopen(void); +extern VOID chkbank(FILE *fp); +extern VOID lkfclose(void); +extern VOID lkfopen(void); +extern VOID lkpbank(char * id); +extern VOID newbank(void); +extern VOID setbank(void); /* lkhead.c */ -extern VOID module(void); -extern VOID newhead(void); +extern VOID module(void); +extern VOID newhead(void); +extern VOID newmode(void); /* lksym.c */ -extern int hash(char *p, int cflag); -extern struct sym * lkpsym(char *id, int f); -extern char * new(unsigned int n); -extern struct sym * newsym(void); -extern char * strsto(char *str); -extern VOID symdef(FILE *fp); -extern int symeq(char *p1, char *p2, int cflag); -extern VOID syminit(void); -extern VOID symmod(FILE *fp, struct sym *tsp); -extern a_uint symval(struct sym *tsp); +extern int hash(char *p, int cflag); +extern struct sym * lkpsym(char *id, int f); +extern char * new(unsigned int n); +extern struct sym * newsym(void); +extern char * strsto(char *str); +extern VOID symdef(FILE *fp); +extern int symeq(char *p1, char *p2, int cflag); +extern VOID syminit(void); +extern VOID symmod(FILE *fp, struct sym *tsp); +extern a_uint symval(struct sym *tsp); /* lkeval.c */ -extern int digit(int c, int r); -extern a_uint eval(void); -extern a_uint expr(int n); -extern int oprio(int c); -extern a_uint term(void); +extern int digit(int c, int r); +extern a_uint eval(void); +extern a_uint expr(int n); +extern int oprio(int c); +extern a_uint term(void); /* lklist.c */ -extern int dgt(int rdx, char *str, int n); -extern VOID newpag(FILE *fp); -extern VOID slew(struct area *xp); -extern VOID lstarea(struct area *xp); -extern VOID lkulist(int i); -extern VOID lkalist(a_uint cpc); -extern VOID lkglist(a_uint cpc, int v, int err); +extern int dgt(int rdx, char *str, int n); +extern VOID newpag(FILE *fp); +extern VOID slew(struct area *xp, struct bank *yp); +extern VOID lstarea(struct area *xp, struct bank *yp); +extern VOID lkulist(int i); +extern VOID lkalist(a_uint cpc); +extern VOID lkglist(a_uint cpc, int v, int err); /* lknoice.c */ -extern VOID NoICEfopen(void); -extern VOID DefineNoICE( char *name, a_uint value, int page ); - +extern VOID NoICEfopen(void); +extern VOID NoICEmagic(void); +extern VOID DefineNoICE(char *name, a_uint value, struct bank *yp); +extern VOID DefineGlobal(char *name, a_uint value, struct bank *yp); +extern VOID DefineScoped(char *name, a_uint value, struct bank *yp); +extern VOID DefineFile(char *name, a_uint value, struct bank *yp); +extern VOID DefineFunction(char *name, a_uint value, struct bank *yp); +extern VOID DefineStaticFunction(char *name, a_uint value, struct bank *yp); +extern VOID DefineEndFunction(a_uint value, struct bank *yp); +extern VOID DefineLine(char *lineString, a_uint value, struct bank *yp); +extern VOID PagedAddress(a_uint value, struct bank *yp); /* lksdcdb.c */ -extern VOID SDCDBfopen(void); -extern VOID SDCDBcopy(char * str); -extern VOID DefineSDCDB(char *name, a_uint value); +extern VOID SDCDBfopen(void); +extern VOID SDCDBcopy(char * str); +extern VOID DefineSDCDB(char *name, a_uint value); /* lkrloc.c */ -extern a_uint adb_b(a_uint v, int i); -extern a_uint adb_bit(a_uint v, int i); -extern a_uint adb_24_bit(a_uint v, int i); -extern a_uint adb_24_hi(a_uint v, int i); -extern a_uint adb_24_mid(a_uint v, int i); -extern a_uint adb_24_lo(a_uint v, int i); -extern a_uint adw_w(a_uint v, int i); -extern a_uint adw_24(a_uint v, int i); -extern a_uint adw_hi(a_uint v, int i); -extern a_uint adw_lo(a_uint v, int i); -extern a_uint evword(void); -extern VOID prntval(FILE *fptr, a_uint v); -extern a_uint adb_hi(a_uint v, int i); -extern a_uint adb_lo(a_uint v, int i); -extern char * errmsg[]; -extern VOID errdmp(FILE *fptr, char *str); -extern VOID erpdmp(FILE *fptr, char *str); -extern VOID rele(VOID); -extern VOID reloc(char c); -extern VOID relt(VOID); -extern VOID relr(VOID); -extern VOID relp(VOID); -extern VOID relerr(char *str); -extern VOID relerp(char *str); -extern int lastExtendedAddress; +extern a_uint adb_1b(a_uint v, int i); +extern a_uint adb_2b(a_uint v, int i); +extern a_uint adb_3b(a_uint v, int i); +extern a_uint adb_4b(a_uint v, int i); +extern a_uint adb_xb(a_uint v, int i); +extern a_uint evword(void); +extern VOID prntval(FILE *fptr, a_uint v); +extern VOID reloc(int c); + +/* lkrloc3.c */ +extern a_uint adb_bit(a_uint v, int i); +extern a_uint adb_24_bit(a_uint v, int i); +extern a_uint adb_24_hi(a_uint v, int i); +extern a_uint adb_24_mid(a_uint v, int i); +extern a_uint adb_24_lo(a_uint v, int i); +extern a_uint adb_hi(a_uint v, int i); +extern a_uint adb_lo(a_uint v, int i); +extern char * errmsg3[]; +extern VOID errdmp3(FILE *fptr, char *str); +extern VOID erpdmp3(FILE *fptr, char *str); +extern VOID rele3(void); +extern VOID reloc3(int c); +extern VOID relt3(void); +extern VOID relr3(void); +extern VOID relp3(void); +extern VOID relerr3(char *str); +extern VOID relerp3(char *str); /* lklibr.c */ -extern int addfile(char *path, char *libfil); -extern VOID addlib(void); -extern VOID addpath(void); -extern int fndsym(char *name); -extern VOID library(void); -extern VOID loadfile(char *filspc); -extern VOID search(void); - -/* lkihx.c */ -extern VOID ihx(int i); -extern VOID iflush(void); -/* sdld specific */ -extern VOID ihxExtendedLinearAddress(a_uint); -extern VOID ihxNewArea(); -/* end sdld specific */ +extern int addfile(char *path, char *libfil); +extern VOID addlib(void); +extern VOID addpath(void); +extern int fndsym(char *name); +extern VOID library(void); +extern VOID loadfile(char *filspc); +extern VOID search(void); + +/* lkout.c */ +extern VOID lkout(int i); +extern VOID lkflush(void); +extern VOID ixx(int i); +extern VOID iflush(void); +extern VOID dbx(int i); +extern VOID dflush(void); /* lks19.c */ -extern VOID s19(int i); -extern VOID sflush(void); +extern VOID s19(int i); +extern VOID sflush(void); /* EEP: lkelf.c */ -extern VOID elf(); +extern VOID elf(); /* JCF: lkmem.c */ extern int summary(struct area * xp); diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/aslink.vcxproj sdcc-3.2.0+dfsg/sdas/linksrc/aslink.vcxproj --- sdcc-3.1.0+dfsg/sdas/linksrc/aslink.vcxproj 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/aslink.vcxproj 2011-12-03 23:42:25.000000000 +0000 @@ -134,6 +134,8 @@ + + %(AdditionalIncludeDirectories) @@ -183,12 +185,6 @@ %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) @@ -277,7 +273,6 @@ - diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/aslink.vcxproj.filters sdcc-3.2.0+dfsg/sdas/linksrc/aslink.vcxproj.filters --- sdcc-3.1.0+dfsg/sdas/linksrc/aslink.vcxproj.filters 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/aslink.vcxproj.filters 2011-12-03 23:42:25.000000000 +0000 @@ -35,9 +35,6 @@ Source Files - - Source Files - Source Files @@ -86,6 +83,12 @@ Source Files + + Source Files + + + Source Files + @@ -94,9 +97,6 @@ Header Files - - Header Files - Header Files diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lkar.c sdcc-3.2.0+dfsg/sdas/linksrc/lkar.c --- sdcc-3.1.0+dfsg/sdas/linksrc/lkar.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lkar.c 2011-12-03 23:42:25.000000000 +0000 @@ -678,12 +678,10 @@ if (lbnh->path != NULL) { strcpy (filspc, lbnh->path); -#ifdef OTHERSYSTEM if (*filspc != '\0' && (filspc[strlen (filspc) - 1] != '/') && (filspc[strlen (filspc) - 1] != LKDIRSEP)) { strcat (filspc, LKDIRSEPSTR); } -#endif } if (AR_IS_SYMBOL_TABLE (obj_name)) diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lkar.h sdcc-3.2.0+dfsg/sdas/linksrc/lkar.h --- sdcc-3.1.0+dfsg/sdas/linksrc/lkar.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lkar.h 2012-01-02 20:18:12.000000000 +0000 @@ -1,6 +1,6 @@ /* lkar.h - ar library format handling - Copyright (C) 2008-2009 Borut Razem, borut dot razem at siol dot net + Copyright (C) 2008-2012 Borut Razem, borut dot razem at siol dot net 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 @@ -32,10 +32,14 @@ #define sgetl(buf) (((((((unsigned char)(buf)[0] << 8) + (unsigned char)(buf)[1]) << 8) + (unsigned char)(buf)[2]) << 8) + (unsigned char)(buf)[3]) #define sputl(value, buf) ((buf)[0] = (value) >> 24, (buf)[1] = (value) >> 16, (buf)[2] = (value) >> 8, (buf)[3] = (value)) -#define ARMAG "!\n" /* magic string */ +/* Note that the usual '\n' in magic strings may translate to different + characters, as allowed by ANSI. '\012' has a fixed value, and remains + compatible with existing BSDish archives. */ + +#define ARMAG "!\012" /* magic string */ #define SARMAG (sizeof (ARMAG) - 1) /* length of magic string */ -#define ARFMAG "`\n" /* header trailer string */ +#define ARFMAG "`\012" /* header trailer string */ #define AR_NAME_OFFSET 0 #define AR_NAME_LEN 16 diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lkarea.c sdcc-3.2.0+dfsg/sdas/linksrc/lkarea.c --- sdcc-3.1.0+dfsg/sdas/linksrc/lkarea.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lkarea.c 2012-03-17 06:13:59.000000000 +0000 @@ -1,330 +1,338 @@ -/* lkarea.c +/* lkarea.c */ - Copyright (C) 1989-1998 Alan R. Baldwin - 721 Berkeley St., Kent, Ohio 44240 - -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, see . */ +/* + * Copyright (C) 1989-2009 Alan R. Baldwin + * + * 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, see . + * + * + * Alan R. Baldwin + * 721 Berkeley St. + * Kent, Ohio 44240 + */ /* - * 3-Nov-97 JLH: - * - change lkparea to use a_type == 0 as "virgin area" flag * 02-Apr-98 JLH: add code to link 8051 data spaces */ #include "aslink.h" -/*)Module lkarea.c +/*)Module lkarea.c * - * The module lkarea.c contains the functions which - * create and link together all area definitions read - * from the .rel file(s). - * - * lkarea.c contains the following functions: - * VOID lnkarea() - * VOID lnksect() - * VOID lkparea() - * VOID newarea() + * The module lkarea.c contains the functions which + * create and link together all area definitions read + * from the .rel file(s). + * + * lkarea.c contains the following functions: + * VOID lnkarea() + * VOID lnksect() + * VOID lkparea() + * VOID newarea() + * VOID setarea() * - * lkarea.c contains no global variables. + * lkarea.c contains no global variables. */ -/*)Function VOID newarea() +/*)Function VOID newarea() * - * The function newarea() creates and/or modifies area - * and areax structures for each A directive read from - * the .rel file(s). The function lkparea() is called - * to find the area structure associated with this name. - * If the area does not yet exist then a new area - * structure is created and linked to any existing - * linked area structures. The area flags are copied - * into the area flag variable. For each occurence of - * an A directive an areax structure is created and - * linked to the areax structures associated with this - * area. The size of this area section is placed into - * the areax structure. The flag value for all subsequent - * area definitions for the same area are compared and - * flagged as an error if they are not identical. - * The areax structure created for every occurence of - * an A directive is loaded with a pointer to the base - * area structure and a pointer to the associated - * head structure. And finally, a pointer to this - * areax structure is loaded into the list of areax - * structures in the head structure. Refer to lkdata.c - * for details of the structures and their linkage. - * - * local variables: - * areax **halp pointer to an array of pointers - * int i counter, loop variable, value - * char id[] id string - * int narea number of areas in this head structure - * areax * taxp pointer to an areax structure - * to areax structures - * - * global variables: - * area *ap Pointer to the current - * area structure - * areax *axp Pointer to the current - * areax structure - * head *hp Pointer to the current - * head structure - * int lkerr error flag - * - * functions called: - * addr_t eval() lkeval.c - * VOID exit() c_library - * int fprintf() c_library - * VOID getid() lklex.c - * VOID lkparea() lkarea.c - * VOID skip() lklex.c - * - * side effects: - * The area and areax structures are created and - * linked with the appropriate head structures. - * Failure to allocate area or areax structure - * space will terminate the linker. Other internal - * errors most likely caused by corrupted .rel - * files will also terminate the linker. + * The function newarea() creates and/or modifies area + * and areax structures for each A directive read from + * the .rel file(s). The function lkparea() is called + * to find the area structure associated with this name. + * If the area does not yet exist then a new area + * structure is created and linked to any existing + * linked area structures. The area flags are copied + * into the area flag variable. For each occurence of + * an A directive an areax structure is created and + * linked to the areax structures associated with this + * area. The size of this area section is placed into + * the areax structure. The flag value for all subsequent + * area definitions for the same area are compared and + * flagged as an error if they are not identical. + * The areax structure created for every occurence of + * an A directive is loaded with a pointer to the base + * area structure and a pointer to the associated + * head structure. And finally, a pointer to this + * areax structure is loaded into the list of areax + * structures in the head structure. Refer to lkdata.c + * for details of the structures and their linkage. + * + * local variables: + * areax **halp pointer to an array of pointers + * a_uint i value + * char id[] id string + * int k counter, loop variable + * int narea number of areas in this head structure + * areax * taxp pointer to an areax structure + * to areax structures + * + * global variables: + * area *ap Pointer to the current + * area structure + * areax *axp Pointer to the current + * areax structure + * head *hp Pointer to the current + * head structure + * int lkerr error flag + * + * functions called: + * a_uint eval() lkeval.c + * VOID exit() c_library + * int fprintf() c_library + * VOID getid() lklex.c + * VOID lkparea() lkarea.c + * VOID skip() lklex.c + * + * side effects: + * The area and areax structures are created and + * linked with the appropriate head structures. + * Failure to allocate area or areax structure + * space will terminate the linker. Other internal + * errors most likely caused by corrupted .rel + * files will also terminate the linker. */ /* * Create an area entry. * - * A xxxxxx size nnnn flags mm - * | | | - * | | `-- ap->a_flag - * | `------------- axp->a_size - * `------------------------- ap->a_id + * A xxxxxx size nnnn flags mm bank n + * | | | | + * | | | `-- ap->a_bank + * | | `---------- ap->a_flag + * | `--------------------- axp->a_size + * `--------------------------------- ap->a_id * */ VOID -newarea() +newarea(void) { - int i, narea; - struct areax *taxp; - struct areax **halp; - char id[NCPS]; - - /* - * Create Area entry - */ - getid(id, -1); - lkparea(id); - /* - * Evaluate area size - */ - skip(-1); - axp->a_size = eval(); - /* - * Evaluate flags - */ - skip(-1); - i = 0; - taxp = ap->a_axp; - while (taxp->a_axp) { - ++i; - taxp = taxp->a_axp; - } - if (i == 0) { - ap->a_flag = eval(); - } else { - i = eval(); - if ((!is_sdld() || TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GB) && - i && (ap->a_flag != i)) { - fprintf(stderr, "Conflicting flags in area %8s\n", id); - lkerr++; - } - } - if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GB)) { - /* - * Evaluate area address - */ - skip(-1); - axp->a_addr = eval(); - } - /* - * Place pointer in header area list - */ - if (headp == NULL) { - fprintf(stderr, "No header defined\n"); - lkexit(1); - } - narea = hp->h_narea; - halp = hp->a_list; - for (i=0; i < narea ;++i) { - if (halp[i] == NULL) { - halp[i] = taxp; - return; - } - } - fprintf(stderr, "Header area list overflow\n"); - lkexit(1); + a_uint i; + int k, narea; + struct areax *taxp; + struct areax **halp; + char id[NCPS]; + + if (headp == NULL) { + fprintf(stderr, "No header defined\n"); + lkexit(ER_FATAL); + } + /* + * Create Area entry + */ + getid(id, -1); + lkparea(id); + /* + * Evaluate area size + */ + skip(-1); + axp->a_size = eval(); + /* + * Evaluate flags + */ + skip(-1); + i = 0; + taxp = ap->a_axp; + while (taxp->a_axp) { + ++i; + taxp = taxp->a_axp; + } + if (i == 0) { + ap->a_flag = eval(); + } else { + i = eval(); + if ((!is_sdld() || TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GB) && + i && (ap->a_flag != i)) { + fprintf(stderr, "Conflicting flags in area %8s\n", id); + lkerr++; + } + } + if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GB)) { + /* + * Evaluate area address + */ + skip(-1); + axp->a_addr = eval(); + } + /* + * Place pointer in header area list + */ + narea = hp->h_narea; + halp = hp->a_list; + for (k=0; k < narea ;++k) { + if (halp[k] == NULL) { + halp[k] = taxp; + return; + } + } + fprintf(stderr, "Header area list overflow\n"); + lkexit(ER_FATAL); } -/*)Function VOID lkparea(id) +/*)Function VOID lkparea(id) * - * char * id pointer to the area name string + * char * id pointer to the area name string * - * The function lkparea() searches the linked area structures - * for a name match. If the name is not found then an area - * structure is created. An areax structure is created and - * appended to the areax structures linked to the area structure. - * The associated base area and head structure pointers are - * loaded into the areax structure. - * - * local variables: - * area * tap pointer to an area structure - * areax * taxp pointer to an areax structure - * - * global variables: - * area *ap Pointer to the current - * area structure - * area *areap The pointer to the first - * area structure of a linked list - * areax *axp Pointer to the current - * areax structure - * - * functions called: - * VOID * new() lksym() - * char * strsto() lksym.c - * int symeq() lksym.c - * - * side effects: - * Area and/or areax structures are created. - * Failure to allocate space for created structures - * will terminate the linker. + * The function lkparea() searches the linked area structures + * for a name match. If the name is not found then an area + * structure is created. An areax structure is created and + * appended to the areax structures linked to the area structure. + * The associated base area and head structure pointers are + * loaded into the areax structure. + * + * local variables: + * area * tap pointer to an area structure + * areax * taxp pointer to an areax structure + * + * global variables: + * area *ap Pointer to the current + * area structure + * area *areap The pointer to the first + * area structure of a linked list + * areax *axp Pointer to the current + * areax structure + * + * functions called: + * VOID * new() lksym() + * char * strsto() lksym.c + * int symeq() lksym.c + * + * side effects: + * Area and/or areax structures are created. + * Failure to allocate space for created structures + * will terminate the linker. */ VOID lkparea(char *id) { - struct area *tap; - struct areax *taxp; + struct area *tap; + struct areax *taxp; - ap = areap; - axp = (struct areax *) new (sizeof(struct areax)); - if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GB)) - axp->a_addr = -1; /* default: no address yet */ - while (ap) { - if (symeq(id, ap->a_id, 1)) { - taxp = ap->a_axp; - while (taxp->a_axp) - taxp = taxp->a_axp; - taxp->a_axp = axp; - axp->a_bap = ap; - axp->a_bhp = hp; - return; - } - ap = ap->a_ap; - } - ap = (struct area *) new (sizeof(struct area)); - if (areap == NULL) { - areap = ap; - } else { - tap = areap; - while (tap->a_ap) - tap = tap->a_ap; - tap->a_ap = ap; - } - ap->a_axp = axp; - axp->a_bap = ap; - axp->a_bhp = hp; - ap->a_id = strsto(id); - if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GB)) - ap->a_addr = 0; + ap = areap; + axp = (struct areax *) new (sizeof(struct areax)); + if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GB)) + axp->a_addr = -1; /* default: no address yet */ + while (ap) { + if (symeq(id, ap->a_id, 1)) { + taxp = ap->a_axp; + while (taxp->a_axp) + taxp = taxp->a_axp; + taxp->a_axp = axp; + axp->a_bap = ap; + axp->a_bhp = hp; + return; + } + ap = ap->a_ap; + } + ap = (struct area *) new (sizeof(struct area)); + if (areap == NULL) { + areap = ap; + } else { + tap = areap; + while (tap->a_ap) + tap = tap->a_ap; + tap->a_ap = ap; + } + ap->a_axp = axp; + axp->a_bap = ap; + axp->a_bhp = hp; + ap->a_id = strsto(id); + if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GB)) + ap->a_addr = 0; } -/*)Function VOID lnkarea() +/*)Function VOID lnkarea() * - * The function lnkarea() resolves all area addresses. - * The function evaluates each area structure (and all - * the associated areax structures) in sequence. The - * linking process supports four (4) possible area types: - * - * ABS/OVR - All sections (each individual areax - * section) starts at the identical base - * area address overlaying all other - * areax sections for this area. The - * size of the area is largest of the area - * sections. - * - * ABS/CON - All sections (each individual areax - * section) are concatenated with the - * first section starting at the base - * area address. The size of the area - * is the sum of the section sizes. - * - * NOTE: Multiple absolute (ABS) areas are - * never concatenated with each other, - * thus absolute area A and absolute area - * B will overlay each other if they begin - * at the same location (the default is - * always address 0 for absolute areas). - * - * REL/OVR - All sections (each individual areax - * section) starts at the identical base - * area address overlaying all other - * areax sections for this area. The - * size of the area is largest of the area - * sections. - * - * REL/CON - All sections (each individual areax - * section) are concatenated with the - * first section starting at the base - * area address. The size of the area - * is the sum of the section sizes. - * - * NOTE: Relocatable (REL) areas are always concatenated - * with each other, thus relocatable area B - * (defined after area A) will follow - * relocatable area A independent of the - * starting address of area A. Within a - * specific area each areax section may be - * overlayed or concatenated with other - * areax sections. - * - * - * If a base address for an area is specified then the - * area will start at that address. Any relocatable - * areas defined subsequently will be concatenated to the - * previous relocatable area if it does not have a base - * address specified. - * - * The names s_ and l_ are created to - * define the starting address and length of each area. - * - * local variables: - * a_uint rloc ;current relocation address - * char temp[] ;temporary string - * struct symbol *sp ;symbol structure - * - * global variables: - * area *ap Pointer to the current - * area structure - * area *areap The pointer to the first - * area structure of a linked list - * - * functions called: - * int fprintf() c_library - * VOID lnksect() lkarea.c - * symbol *lkpsym() lksysm.c - * char * strncpy() c_library - * int symeq() lksysm.c - * - * side effects: - * All area and areax addresses and sizes are - * determined and saved in their respective - * structures. + * The function lnkarea() resolves all area addresses. + * The function evaluates each area structure (and all + * the associated areax structures) in sequence. The + * linking process supports four (4) possible area types: + * + * ABS/OVR - All sections (each individual areax + * section) starts at the identical base + * area address overlaying all other + * areax sections for this area. The + * size of the area is largest of the area + * sections. + * + * ABS/CON - All sections (each individual areax + * section) are concatenated with the + * first section starting at the base + * area address. The size of the area + * is the sum of the section sizes. + * + * NOTE: Multiple absolute (ABS) areas are + * never concatenated with each other, + * thus absolute area A and absolute area + * B will overlay each other if they begin + * at the same location (the default is + * always address 0 for absolute areas). + * + * REL/OVR - All sections (each individual areax + * section) starts at the identical base + * area address overlaying all other + * areax sections for this area. The + * size of the area is largest of the area + * sections. + * + * REL/CON - All sections (each individual areax + * section) are concatenated with the + * first section starting at the base + * area address. The size of the area + * is the sum of the section sizes. + * + * NOTE: Relocatable (REL) areas are always concatenated + * with each other, thus relocatable area B + * (defined after area A) will follow + * relocatable area A independent of the + * starting address of area A. Within a + * specific area each areax section may be + * overlayed or concatenated with other + * areax sections. + * + * + * If a base address for an area is specified then the + * area will start at that address. Any relocatable + * areas defined subsequently will be concatenated to the + * previous relocatable area if it does not have a base + * address specified. + * + * The names s_ and l_ are created to + * define the starting address and length of each area. + * + * local variables: + * a_uint rloc ;current relocation address + * char temp[] ;temporary string + * struct symbol *sp ;symbol structure + * + * global variables: + * area *ap Pointer to the current + * area structure + * area *areap The pointer to the first + * area structure of a linked list + * + * functions called: + * int fprintf() c_library + * VOID lnksect() lkarea.c + * symbol *lkpsym() lksysm.c + * char * strncpy() c_library + * int symeq() lksysm.c + * + * side effects: + * All area and areax addresses and sizes are + * determined and saved in their respective + * structures. */ /* sdld6808 specific */ @@ -334,355 +342,420 @@ VOID lnksect(struct area *tap); /* end sdld specific */ /* - * Resolve all area addresses. + * Resolve all bank/area addresses. */ VOID -lnkarea() +lnkarea(void) { - /* sdld specific */ - a_uint rloc[4] = { 0, 0, 0, 0 }; - int locIndex; - /* end sdld specific */ - /* sdld8051 & sdld6808 specific */ - /*JCF: used to save the REG_BANK_[0-3] and SBIT_BYTES area pointers*/ - struct area *ta[5]; - int j; - /* end sdld8051 & sdld6808 specific */ - /* sdld6800 specific */ - a_uint gs_size = 0; - struct area *abs_ap = NULL; - struct area *gs0_ap = NULL; - /* end sdld6800 specific */ - char temp[NCPS+2]; - struct sym *sp; - - if (TARGET_IS_6808) { - memset(codemap6808, 0, sizeof(codemap6808)); - - /* first sort all absolute areas to the front */ - ap = areap; - /* no need to check first area, it's in front anyway */ - while (ap && ap->a_ap) { - if (ap->a_ap->a_flag & A3_ABS) - {/* next area is absolute, move it to front, - reversed sequence is no problem for absolutes */ - abs_ap = ap->a_ap; - ap->a_ap = abs_ap->a_ap; - abs_ap->a_ap = areap; - areap = abs_ap; - } - else { - ap = ap->a_ap; - } - } - - /* next accumulate all GSINITx/GSFINAL area sizes - into GSINIT so they stay together */ - ap = areap; - while (ap) { - if (!strncmp(ap->a_id, "GS", 2)) - {/* GSxxxxx area */ - if (ap->a_size == 0) - { - axp = ap->a_axp; - while (axp) - { - ap->a_size += axp->a_size; - axp = axp->a_axp; - } - } - gs_size += ap->a_size; - if (!strcmp(ap->a_id, "GSINIT0")) - {/* GSINIT0 area */ - gs0_ap = ap; - } - } - ap = ap->a_ap; - } - if (gs0_ap) - gs0_ap->a_size = gs_size; - } - - ap = areap; - while (ap) { - if (ap->a_flag&A3_ABS) { - /* - * Absolute sections - */ - lnksect(ap); - } else { - /* sdld specific */ - /* Determine memory space */ - locIndex = 0; - if ((TARGET_IS_8051)) { - if (ap->a_flag & A_CODE) { - locIndex = 1; - } - if (ap->a_flag & A_XDATA) { - locIndex = 2; - } - if (ap->a_flag & A_BIT) { - locIndex = 3; - } - } - /* - * Relocatable sections - */ - if (!is_sdld() || TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GB) { - if (ap->a_addr == 0) - ap->a_addr = rloc[locIndex]; - } - else if (ap->a_type == 0) { /* JLH */ - if (TARGET_IS_6808 && ap->a_flag & A_NOLOAD) { - locIndex = 2; - ap->a_addr = 0; - } - else { - ap->a_addr = rloc[locIndex]; - } - ap->a_type = 1; - } - lnksect(ap); - rloc[ locIndex ] = ap->a_addr + ap->a_size; - /* end sdld specific */ - } - - /* - * Create symbols called: - * s_ the start address of the area - * l_ the length of the area - */ - - if (! symeq(ap->a_id, _abs_, 1)) { - strcpy(temp+2, ap->a_id); - *(temp+1) = '_'; - - *temp = 's'; - sp = lkpsym(temp, 1); - sp->s_addr = ap->a_addr ; - if (!is_sdld() || TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GB) - sp->s_axp = NULL; - sp->s_type |= S_DEF; - - *temp = 'l'; - sp = lkpsym(temp, 1); - sp->s_addr = ap->a_size; - sp->s_axp = NULL; - sp->s_type |= S_DEF; - } - - if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GB)) { - /*JCF: Since area BSEG is defined just before BSEG_BYTES, use the bit size of BSEG - to compute the byte size of BSEG_BYTES: */ - if (!strcmp(ap->a_id, "BSEG")) { - if (TARGET_IS_8051) - ap->a_ap->a_axp->a_size += ((ap->a_addr + ap->a_size + 7)/8); /*Bits to bytes*/ - else - ap->a_ap->a_axp->a_size=(ap->a_addr/8)+((ap->a_size+7)/8); /*Bits to bytes*/ - } - else if (!strcmp(ap->a_id, "REG_BANK_0")) ta[0]=ap; - else if (!strcmp(ap->a_id, "REG_BANK_1")) ta[1]=ap; - else if (!strcmp(ap->a_id, "REG_BANK_2")) ta[2]=ap; - else if (!strcmp(ap->a_id, "REG_BANK_3")) ta[3]=ap; - else if (!strcmp(ap->a_id, "BSEG_BYTES")) - { - ta[4]=ap; - for(j=4; j>1; j--) - { - /*If upper register banks are not used roll back the relocation counter*/ - if ( (ta[j]->a_size==0) && (ta[j-1]->a_size==0) ) - { - rloc[0]-=8; - } - else break; - } - } - } - ap = ap->a_ap; - } + /* sdld specific */ + a_uint rloc[4] = { 0, 0, 0, 0 }; + int locIndex; + /* end sdld specific */ + /* sdld8051 & sdld6808 specific */ + /*JCF: used to save the REG_BANK_[0-3] and SBIT_BYTES area pointers*/ + struct area *ta[5]; + int j; + /* end sdld8051 & sdld6808 specific */ + /* sdld6800 specific */ + a_uint gs_size = 0; + struct area *abs_ap = NULL; + struct area *gs0_ap = NULL; + /* end sdld6800 specific */ + char temp[NCPS+2]; + struct sym *sp; + + if (TARGET_IS_6808) { + memset(codemap6808, 0, sizeof(codemap6808)); + + /* first sort all absolute areas to the front */ + ap = areap; + /* no need to check first area, it's in front anyway */ + while (ap && ap->a_ap) { + if (ap->a_ap->a_flag & A3_ABS) + {/* next area is absolute, move it to front, + reversed sequence is no problem for absolutes */ + abs_ap = ap->a_ap; + ap->a_ap = abs_ap->a_ap; + abs_ap->a_ap = areap; + areap = abs_ap; + } + else { + ap = ap->a_ap; + } + } + + /* next accumulate all GSINITx/GSFINAL area sizes + into GSINIT so they stay together */ + ap = areap; + while (ap) { + if (!strncmp(ap->a_id, "GS", 2)) + {/* GSxxxxx area */ + if (ap->a_size == 0) + { + axp = ap->a_axp; + while (axp) + { + ap->a_size += axp->a_size; + axp = axp->a_axp; + } + } + gs_size += ap->a_size; + if (!strcmp(ap->a_id, "GSINIT0")) + {/* GSINIT0 area */ + gs0_ap = ap; + } + } + ap = ap->a_ap; + } + if (gs0_ap) + gs0_ap->a_size = gs_size; + } + + ap = areap; + while (ap) { + if (ap->a_flag & A3_ABS) { + /* + * Absolute sections + */ + lnksect(ap); + } else { + /* sdld specific */ + /* Determine memory space */ + locIndex = 0; + if ((TARGET_IS_8051)) { + if (ap->a_flag & A_CODE) { + locIndex = 1; + } + if (ap->a_flag & A_XDATA) { + locIndex = 2; + } + if (ap->a_flag & A_BIT) { + locIndex = 3; + } + } + /* + * Relocatable sections + */ + if (!is_sdld() || TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GB) { + if (ap->a_addr == 0) + ap->a_addr = rloc[locIndex]; + } + else if (ap->a_bset == 0) { + if (TARGET_IS_6808 && ap->a_flag & A_NOLOAD) { + locIndex = 2; + ap->a_addr = 0; + } + else { + ap->a_addr = rloc[locIndex]; + } + ap->a_bset = 1; + } + lnksect(ap); + rloc[ locIndex ] = ap->a_addr + ap->a_size; + /* end sdld specific */ + } + + /* + * Create symbols called: + * s_ the start address of the area + * l_ the length of the area + */ + + if (! symeq(ap->a_id, _abs_, 1)) { + strcpy(temp+2, ap->a_id); + *(temp+1) = '_'; + + *temp = 's'; + sp = lkpsym(temp, 1); + sp->s_addr = ap->a_addr; + if (!is_sdld() || TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GB) + sp->s_axp = NULL; + sp->s_type |= S_DEF; + + *temp = 'l'; + sp = lkpsym(temp, 1); + sp->s_addr = ap->a_size; + sp->s_axp = NULL; + sp->s_type |= S_DEF; + } + + if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GB)) { + /*JCF: Since area BSEG is defined just before BSEG_BYTES, use the bit size of BSEG + to compute the byte size of BSEG_BYTES: */ + if (!strcmp(ap->a_id, "BSEG")) { + if (TARGET_IS_8051) + ap->a_ap->a_axp->a_size += ((ap->a_addr + ap->a_size + 7)/8); /*Bits to bytes*/ + else + ap->a_ap->a_axp->a_size=(ap->a_addr/8)+((ap->a_size+7)/8); /*Bits to bytes*/ + } + else if (!strcmp(ap->a_id, "REG_BANK_0")) ta[0]=ap; + else if (!strcmp(ap->a_id, "REG_BANK_1")) ta[1]=ap; + else if (!strcmp(ap->a_id, "REG_BANK_2")) ta[2]=ap; + else if (!strcmp(ap->a_id, "REG_BANK_3")) ta[3]=ap; + else if (!strcmp(ap->a_id, "BSEG_BYTES")) + { + ta[4]=ap; + for(j=4; j>1; j--) + { + /*If upper register banks are not used roll back the relocation counter*/ + if ( (ta[j]->a_size==0) && (ta[j-1]->a_size==0) ) + { + rloc[0]-=8; + } + else break; + } + } + } + ap = ap->a_ap; + } } /* sdld specific */ static a_uint find_empty_space(a_uint start, a_uint size, char *id, unsigned long *map, unsigned int map_size) { - int i, j, k; - unsigned long mask, b; - - while (1) { - a_uint a = start; - i = start >> 5; - j = (start + size) >> 5; - mask = -(1 << (start & 0x1F)); - - if (j >= map_size) { - fprintf(stderr, "internal memory limit is exceeded for %s; memory size = 0x%06X, address = 0x%06X\n", id, map_size << 5, start + size - 1); - } - else { - while (i < j) { - if (map[i] & mask) { - k = 32; - for (b=0x80000000; b!=0; b>>=1, k--) { - if (map[i] & b) - break; - } - start = a + k; - break; - } - i++; - mask = 0xFFFFFFFF; - a += 32; - } - if (start > a) - continue; - - mask &= (1 << ((start + size) & 0x1F)) - 1; - if (map[i] & mask) { - k = 32; - for (b=0x80000000; b!=0; b>>=1, k--) { - if (map[i] & b) - break; - } - start = (a & ~0x1F) + k; - } - if (start <= a) - break; - } - } - return start; + a_uint i, j, k; + unsigned long mask, b; + map_size /= sizeof(*map); /* Convert from bytes to number of elements */ + + while (1) { + a_uint a = start; + i = start >> 5; + j = (start + size) >> 5; + mask = -(1 << (start & 0x1F)); + + if (j > map_size) { + fprintf(stderr, "internal memory limit is exceeded for %s; memory size = 0x%06X, address = 0x%06X\n", id, map_size << 5, start + size - 1); + break; + } + else { + while (i < j) { + if (map[i] & mask) { + k = 32; + for (b=0x80000000; b!=0; b>>=1, k--) { + if (map[i] & b) + break; + } + start = a + k; + break; + } + i++; + mask = 0xFFFFFFFF; + a += 32; + } + if (start > a) + continue; + + mask &= (1 << ((start + size) & 0x1F)) - 1; + if (i < map_size && map[i] & mask) { + k = 32; + for (b=0x80000000; b!=0; b>>=1, k--) { + if (map[i] & b) + break; + } + start = (a & ~0x1F) + k; + } + if (start <= a) + break; + } + } + return start; } static a_uint allocate_space(a_uint start, a_uint size, char *id, unsigned long *map, unsigned int map_size) { - int i, j; - unsigned long mask; - a_uint a = start; - i = start >> 5; - j = (start + size) >> 5; - mask = -(1 << (start & 0x1F)); - - if (j >= map_size) { - fprintf(stderr, "internal memory limit is exceeded for %s; memory size = 0x%06X, address = 0x%06X\n", id, map_size << 5, start + size - 1); - } - else { - while (i < j) { - if (map[i] & mask) { - fprintf(stderr, "memory overlap near 0x%X for %s\n", a, id); - } - map[i++] |= mask; - mask = 0xFFFFFFFF; - a += 32; - } - mask &= (1 << ((start + size) & 0x1F)) - 1; - if (map[i] & mask) { - fprintf(stderr, "memory overlap near 0x%X for %s\n", a, id); - } - map[i] |= mask; - } - return start; + a_uint i, j; + unsigned long mask; + a_uint a = start; + i = start >> 5; + j = (start + size) >> 5; + mask = -(1 << (start & 0x1F)); + map_size /= sizeof(*map); /* Convert from bytes to number of elements */ + + if (j > map_size) { + fprintf(stderr, "internal memory limit is exceeded for %s; memory size = 0x%06X, address = 0x%06X\n", id, map_size << 5, start + size - 1); + } + else { + while (i < j) { + if (map[i] & mask) { + fprintf(stderr, "memory overlap near 0x%X for %s\n", a, id); + } + map[i++] |= mask; + mask = 0xFFFFFFFF; + a += 32; + } + mask &= (1 << ((start + size) & 0x1F)) - 1; + if (i < map_size && map[i] & mask) { + fprintf(stderr, "memory overlap near 0x%X for %s\n", a, id); + } + map[i] |= mask; + } + return start; } /* end sdld specific */ -/*)Function VOID lnksect() +/*)Function VOID lnksect(tap) * - * area * tap pointer to an area structure + * area * tap pointer to an area structure * - * The function lnksect() is the function called by - * lnkarea() to resolve the areax addresses. Refer - * to the function lnkarea() for more detail. Pageing - * boundary and length errors will be reported by this - * function. - * - * local variables: - * a_uint size size of area - * a_uint addr address of area - * areax * taxp pointer to an areax structure - * - * global variables: - * int lkerr error flag - * - * functions called: - * none - * - * side effects: - * All area and areax addresses and sizes area determined - * and linked into the structures. + * The function lnksect() is the function called by + * lnkarea() to resolve the areax addresses. Refer + * to the function lnkarea() for more detail. Pageing + * boundary and length errors will be reported by this + * function. + * + * local variables: + * a_uint size size of area + * a_uint addr address of area + * areax * taxp pointer to an areax structure + * + * global variables: + * int lkerr error flag + * + * functions called: + * none + * + * side effects: + * All area and areax addresses and sizes are determined + * and linked into the structures. */ VOID lnksect(struct area *tap) { - a_uint size, addr; - struct areax *taxp; + a_uint size, addr; + struct areax *taxp; + + size = 0; + addr = tap->a_addr; + taxp = tap->a_axp; + if (tap->a_flag & A3_OVR) { + /* + * Overlayed sections + */ + while (taxp) { + taxp->a_addr = addr; + if (taxp->a_size > size) + size = taxp->a_size; + taxp = taxp->a_axp; + } + } else if (TARGET_IS_6808 && tap->a_flag & A3_ABS) { + /* + * Absolute sections + */ + while (taxp) { + allocate_space(taxp->a_addr, taxp->a_size, tap->a_id, codemap6808, sizeof (codemap6808)); + taxp->a_addr = 0; /* reset to zero so relative addresses become absolute */ + size += taxp->a_size; + taxp = taxp->a_axp; + } + } else { + /* + * Concatenated sections + */ + if (TARGET_IS_6808 && tap->a_size) { + addr = find_empty_space(addr, tap->a_size, tap->a_id, codemap6808, sizeof (codemap6808)); + } + while (taxp) { + /* find next unused address now */ + if (TARGET_IS_6808 && taxp->a_size) { + addr = find_empty_space(addr, taxp->a_size, tap->a_id, codemap6808, sizeof (codemap6808)); + allocate_space(addr, taxp->a_size, tap->a_id, codemap6808, sizeof (codemap6808)); + } + taxp->a_addr = addr; + addr += taxp->a_size; + size += taxp->a_size; + taxp = taxp->a_axp; + } + } + tap->a_size = size; + if ((tap->a_flag & A3_PAG) && (size > 256)) { + fprintf(stderr, + "\n?ASlink-Warning-Paged Area %s Length Error\n", + tap->a_id); + lkerr++; + } + if (TARGET_IS_8051 && + (tap->a_flag & A3_PAG) && (tap->a_size) && + ((tap->a_addr & 0xFFFFFF00) != ((addr-1) & 0xFFFFFF00))) + { + fprintf(stderr, + "\n?ASlink-Warning-Paged Area %s Boundary Error\n", + tap->a_id); + lkerr++; + } +} + + +/*)Function VOID setarea() + * + * The function setarea() scans the base address lines in the + * basep structure, evaluates the arguments, and sets the beginning + * address of the specified areas. + * + * local variables: + * a_uint v expression value + * char id[] base id string + * + * global variables: + * area *ap Pointer to the current + * area structure + * area *areap The pointer to the first + * area structure of a linked list + * base *basep The pointer to the first + * base structure + * base *bsp Pointer to the current + * base structure + * char *ip pointer into the REL file + * text line in ib[] + * int lkerr error flag + * + * functions called: + * a_uint expr() lkeval.c + * int fprintf() c_library + * VOID getid() lklex.c + * int getnb() lklex.c + * int symeq() lksym.c + * + * side effects: + * The base address of an area is set. + */ + +VOID +setarea(void) +{ + a_uint v; + char id[NCPS]; - size = 0; - addr = tap->a_addr; - if (!TARGET_IS_8051 && - (tap->a_flag&A3_PAG) && (addr & 0xFF)) { - fprintf(stderr, - "\n?ASlink-Warning-Paged Area %s Boundary Error\n", - tap->a_id); - lkerr++; - } - taxp = tap->a_axp; - if (tap->a_flag&A3_OVR) { - /* - * Overlayed sections - */ - while (taxp) { - taxp->a_addr = addr; - if (taxp->a_size > size) - size = taxp->a_size; - taxp = taxp->a_axp; - } - } else if (TARGET_IS_6808 && tap->a_flag & A3_ABS) { - /* - * Absolute sections - */ - while (taxp) { - allocate_space(taxp->a_addr, taxp->a_size, tap->a_id, codemap6808, sizeof (codemap6808)); - taxp->a_addr = 0; /* reset to zero so relative addresses become absolute */ - size += taxp->a_size; - taxp = taxp->a_axp; - } - } else { - /* - * Concatenated sections - */ - if (TARGET_IS_6808 && tap->a_size) { - addr = find_empty_space(addr, tap->a_size, tap->a_id, codemap6808, sizeof (codemap6808)); - } - while (taxp) { - /* find next unused address now */ - if (TARGET_IS_6808 && taxp->a_size) { - addr = find_empty_space(addr, taxp->a_size, tap->a_id, codemap6808, sizeof (codemap6808)); - allocate_space(addr, taxp->a_size, tap->a_id, codemap6808, sizeof (codemap6808)); - } - taxp->a_addr = addr; - addr += taxp->a_size; - size += taxp->a_size; - taxp = taxp->a_axp; - } - } - tap->a_size = size; - if ((tap->a_flag&A3_PAG) && (size > 256)) { - fprintf(stderr, - "\n?ASlink-Warning-Paged Area %s Length Error\n", - tap->a_id); - lkerr++; - } - if (TARGET_IS_8051 && - (tap->a_flag&A3_PAG) && (tap->a_size) && - ((tap->a_addr & 0xFFFFFF00) != ((addr-1) & 0xFFFFFF00))) - { - fprintf(stderr, - "\n?ASlink-Warning-Paged Area %s Boundary Error\n", - tap->a_id); - lkerr++; - } + bsp = basep; + while (bsp) { + ip = bsp->b_strp; + getid(id, -1); + if (getnb() == '=') { + v = expr(0); + for (ap = areap; ap != NULL; ap = ap->a_ap) { + if (symeq(id, ap->a_id, 1)) + break; + } + if (ap == NULL) { + fprintf(stderr, + "ASlink-Warning-No definition of area %s\n", id); + lkerr++; + } else { + ap->a_addr = v; + ap->a_bset = 1; + } + } else { + fprintf(stderr, "ASlink-Warning-No '=' in base expression"); + lkerr++; + } + bsp = bsp->b_base; + } } + + /* sdld specific */ a_uint lnksect2 (struct area *tap, int locIndex); unsigned long codemap8051[524288]; @@ -694,526 +767,518 @@ /*Modified version of the functions for packing variables in internal data memory*/ VOID lnkarea2 (void) { - a_uint rloc[4]={0, 0, 0, 0}; - a_uint gs_size = 0; - int locIndex; - char temp[NCPS+2]; - struct sym *sp; - int j; - struct area *bseg_ap = NULL; - struct area *abs_ap = NULL; - struct area *gs0_ap = NULL; - struct sym *sp_dseg_s=NULL, *sp_dseg_l=NULL; - - for(j=0; j<256; j++) idatamap[j]=' '; - memset(codemap8051, 0, sizeof(codemap8051)); - memset(xdatamap, 0, sizeof(xdatamap)); - - /* first sort all absolute areas to the front */ - ap = areap; - /* no need to check first area, it's in front anyway */ - while (ap && ap->a_ap) - { - if (ap->a_ap->a_flag & A3_ABS) - {/* next area is absolute, move it to front, - reversed sequence is no problem for absolutes */ - abs_ap = ap->a_ap; - ap->a_ap = abs_ap->a_ap; - abs_ap->a_ap = areap; - areap = abs_ap; - } - else - { - ap = ap->a_ap; - } - } - - /* next accumulate all GSINITx/GSFINAL area sizes - into GSINIT so they stay together */ - ap = areap; - abs_ap = areap; - while (ap) - { - if (ap->a_flag & A3_ABS) - { - abs_ap = ap; /* Remember the last abs area */ - } - if (!strncmp(ap->a_id, "GS", 2)) - {/* GSxxxxx area */ - if (ap->a_size == 0) - { - axp = ap->a_axp; - while (axp) - { - ap->a_size += axp->a_size; - axp = axp->a_axp; - } - } - gs_size += ap->a_size; - if (!strcmp(ap->a_id, "GSINIT0")) - {/* GSINIT0 area */ - gs0_ap = ap; - } - } - /*Since area BSEG is defined just before BSEG_BYTES, use the bit size of BSEG - to compute the byte size of BSEG_BYTES: */ - else if (!strcmp(ap->a_id, "BSEG")) - { - bseg_ap = ap->a_ap; //BSEG_BYTES - for (axp=ap->a_axp; axp; axp=axp->a_axp) - ap->a_size += axp->a_size; - bseg_ap->a_axp->a_size = ((ap->a_addr + ap->a_size + 7)/8); /*Bits to bytes*/ - ap->a_ap = bseg_ap->a_ap; //removed BSEG_BYTES from list - bseg_ap->a_ap = abs_ap->a_ap; - abs_ap->a_ap = bseg_ap; //inserted BSEG_BYTES after abs - bseg_ap = ap; //BSEG - } - else if (!strcmp(ap->a_id, "DSEG")) - { - dseg_ap = ap; /*Need it later*/ - dram_start = ap->a_addr; - } - else if (!strcmp(ap->a_id, "ISEG")) - { - iram_start = ap->a_addr; - } - ap = ap->a_ap; - } - if (gs0_ap) - gs0_ap->a_size = gs_size; - - ap = areap; - while (ap) - { - /* Determine memory space */ - if (ap->a_flag & A_CODE) locIndex = 1; - else if (ap->a_flag & A_XDATA) locIndex = 2; - else if (ap->a_flag & A_BIT) locIndex = 3; - else locIndex = 0; - - if (ap->a_flag & A3_ABS) /* Absolute sections */ - { - lnksect2(ap, locIndex); - } - else /* Relocatable sections */ - { - if (ap->a_type == 0) - { - ap->a_addr = rloc[locIndex]; - ap->a_type = 1; - } - - rloc[locIndex] = lnksect2(ap, locIndex); - } - - if (!strcmp(ap->a_id, "BSEG_BYTES")) - { - bseg_ap->a_addr += (ap->a_axp->a_addr - 0x20) * 8; /*Bytes to bits*/ - } - /* - * Create symbols called: - * s_ the start address of the area - * l_ the length of the area - */ - - if (! symeq(ap->a_id, _abs_, 1)) - { - strcpy(temp+2,ap->a_id); - *(temp+1) = '_'; - - *temp = 's'; - sp = lkpsym(temp, 1); - sp->s_addr = ap->a_addr; - sp->s_type |= S_DEF; - if (!strcmp(ap->a_id, "DSEG")) sp_dseg_s=sp; - - *temp = 'l'; - sp = lkpsym(temp, 1); - sp->s_addr = ap->a_size; - sp->s_axp = NULL; - sp->s_type |= S_DEF; - if (!strcmp(ap->a_id, "DSEG")) sp_dseg_l=sp; - } - - ap = ap->a_ap; - } - - /*Compute the size of DSEG*/ - if(dseg_ap!=NULL) - { - dseg_ap->a_addr=0; - dseg_ap->a_size=0; - for(j=0; j<0x80; j++) if(idatamap[j]!=' ') dseg_ap->a_size++; - } - if(sp_dseg_s!=NULL) sp_dseg_s->s_addr=0; - if(sp_dseg_l!=NULL) sp_dseg_l->s_addr=dseg_ap->a_size; + a_uint rloc[4]={0, 0, 0, 0}; + a_uint gs_size = 0; + int locIndex; + char temp[NCPS+2]; + struct sym *sp; + int j; + struct area *bseg_ap = NULL; + struct area *abs_ap = NULL; + struct area *gs0_ap = NULL; + struct sym *sp_dseg_s=NULL, *sp_dseg_l=NULL; + + for(j=0; j<256; j++) idatamap[j]=' '; + memset(codemap8051, 0, sizeof(codemap8051)); + memset(xdatamap, 0, sizeof(xdatamap)); + + /* first sort all absolute areas to the front */ + ap = areap; + /* no need to check first area, it's in front anyway */ + while (ap && ap->a_ap) + { + if (ap->a_ap->a_flag & A3_ABS) + {/* next area is absolute, move it to front, + reversed sequence is no problem for absolutes */ + abs_ap = ap->a_ap; + ap->a_ap = abs_ap->a_ap; + abs_ap->a_ap = areap; + areap = abs_ap; + } + else + { + ap = ap->a_ap; + } + } + + /* next accumulate all GSINITx/GSFINAL area sizes + into GSINIT so they stay together */ + ap = areap; + abs_ap = areap; + while (ap) + { + if (ap->a_flag & A3_ABS) + { + abs_ap = ap; /* Remember the last abs area */ + } + if (!strncmp(ap->a_id, "GS", 2)) + {/* GSxxxxx area */ + if (ap->a_size == 0) + { + axp = ap->a_axp; + while (axp) + { + ap->a_size += axp->a_size; + axp = axp->a_axp; + } + } + gs_size += ap->a_size; + if (!strcmp(ap->a_id, "GSINIT0")) + {/* GSINIT0 area */ + gs0_ap = ap; + } + } + /*Since area BSEG is defined just before BSEG_BYTES, use the bit size of BSEG + to compute the byte size of BSEG_BYTES: */ + else if (!strcmp(ap->a_id, "BSEG")) + { + bseg_ap = ap->a_ap; //BSEG_BYTES + for (axp=ap->a_axp; axp; axp=axp->a_axp) + ap->a_size += axp->a_size; + bseg_ap->a_axp->a_size = ((ap->a_addr + ap->a_size + 7)/8); /*Bits to bytes*/ + ap->a_ap = bseg_ap->a_ap; //removed BSEG_BYTES from list + bseg_ap->a_ap = abs_ap->a_ap; + abs_ap->a_ap = bseg_ap; //inserted BSEG_BYTES after abs + bseg_ap = ap; //BSEG + } + else if (!strcmp(ap->a_id, "DSEG")) + { + dseg_ap = ap; /*Need it later*/ + dram_start = ap->a_addr; + } + else if (!strcmp(ap->a_id, "ISEG")) + { + iram_start = ap->a_addr; + } + ap = ap->a_ap; + } + if (gs0_ap) + gs0_ap->a_size = gs_size; + + ap = areap; + while (ap) + { + /* Determine memory space */ + if (ap->a_flag & A_CODE) locIndex = 1; + else if (ap->a_flag & A_XDATA) locIndex = 2; + else if (ap->a_flag & A_BIT) locIndex = 3; + else locIndex = 0; + + if (ap->a_flag & A3_ABS) /* Absolute sections */ + { + lnksect2(ap, locIndex); + } + else /* Relocatable sections */ + { + if (ap->a_bset == 0) + { + ap->a_addr = rloc[locIndex]; + ap->a_bset = 1; + } + + rloc[locIndex] = lnksect2(ap, locIndex); + } + + if (!strcmp(ap->a_id, "BSEG_BYTES")) + { + bseg_ap->a_addr += (ap->a_axp->a_addr - 0x20) * 8; /*Bytes to bits*/ + } + /* + * Create symbols called: + * s_ the start address of the area + * l_ the length of the area + */ + + if (! symeq(ap->a_id, _abs_, 1)) + { + strcpy(temp+2,ap->a_id); + *(temp+1) = '_'; + + *temp = 's'; + sp = lkpsym(temp, 1); + sp->s_addr = ap->a_addr; + sp->s_type |= S_DEF; + if (!strcmp(ap->a_id, "DSEG")) sp_dseg_s=sp; + + *temp = 'l'; + sp = lkpsym(temp, 1); + sp->s_addr = ap->a_size; + sp->s_axp = NULL; + sp->s_type |= S_DEF; + if (!strcmp(ap->a_id, "DSEG")) sp_dseg_l=sp; + } + + ap = ap->a_ap; + } + + /*Compute the size of DSEG*/ + if(dseg_ap!=NULL) + { + dseg_ap->a_addr=0; + dseg_ap->a_size=0; + for(j=0; j<0x80; j++) if(idatamap[j]!=' ') dseg_ap->a_size++; + } + if(sp_dseg_s!=NULL) sp_dseg_s->s_addr=0; + if(sp_dseg_l!=NULL) sp_dseg_l->s_addr=dseg_ap->a_size; } a_uint lnksect2 (struct area *tap, int locIndex) { - a_uint size, addr; - struct areax *taxp; - int j, k, ramlimit, ramstart; - char fchar=' ', dchar='a'; - char ErrMsg[]="?ASlink-Error-Could not get %d consecutive byte%s" - " in internal RAM for area %s.\n"; - - tap->a_unaloc=0; - - /*Notice that only ISEG and SSEG can be in the indirectly addressable internal RAM*/ - if( (!strcmp(tap->a_id, "ISEG")) || (!strcmp(tap->a_id, "SSEG")) ) - { - ramstart = iram_start; - - if ((iram_size <= 0) || (ramstart + iram_size > 0x100)) - ramlimit = 0x100; - else - ramlimit = ramstart + iram_size; - } - else - { - ramstart = dram_start; - - if ((iram_size <= 0) || (ramstart + iram_size > 0x80)) - ramlimit = 0x80; - else - ramlimit = ramstart + iram_size; - } - - size = 0; - addr = tap->a_addr; -#if 0 - if ((tap->a_flag&A3_PAG) && (addr & 0xFF)) - { - fprintf(stderr, - "\n?ASlink-Warning-Paged Area %s Boundary Error\n", - tap->a_id); - lkerr++; - } -#endif - taxp = tap->a_axp; - - /*Use a letter to identify each area in the internal RAM layout map*/ - if (locIndex==0) - { - /**/ if(!strcmp(tap->a_id, "DSEG")) - fchar='D'; /*It will be converted to letters 'a' to 'z' later for each areax*/ - else if(!strcmp(tap->a_id, "ISEG")) - fchar='I'; - else if(!strcmp(tap->a_id, "SSEG")) - fchar='S'; - else if(!strcmp(tap->a_id, "OSEG")) - fchar='Q'; - else if(!strcmp(tap->a_id, "REG_BANK_0")) - fchar='0'; - else if(!strcmp(tap->a_id, "REG_BANK_1")) - fchar='1'; - else if(!strcmp(tap->a_id, "REG_BANK_2")) - fchar='2'; - else if(!strcmp(tap->a_id, "REG_BANK_3")) - fchar='3'; - else if(!strcmp(tap->a_id, "BSEG_BYTES")) - fchar='B'; - else if(!strcmp(tap->a_id, "BIT_BANK")) - fchar='T'; - else - fchar=' ';/*???*/ - } - else if (locIndex == 1) - { - /**/ if(!strcmp(tap->a_id, "GSINIT")) - fchar='G'; - } - else if (locIndex == 2) - { - /**/ if(!strcmp(tap->a_id, "XSTK")) - fchar='K'; - } - - if (tap->a_flag&A3_OVR) /* Overlayed sections */ - { - while (taxp) - { - if(taxp->a_size == 0) - { - taxp = taxp->a_axp; - continue; - } - - if ( (fchar=='0')||(fchar=='1')||(fchar=='2')||(fchar=='3') ) /*Reg banks*/ - { - addr=(fchar-'0')*8; - taxp->a_addr=addr; - size=taxp->a_size; - for(j=addr; (j<(int)(addr+size)) && (ja_size=0; j(int)taxp->a_size) - taxp->a_size=k; - } - else - { - k=0; - } - } - stacksize=taxp->a_size; - } - - /*If more space required, release the previously allocated areax in - internal RAM and search for a bigger one*/ - if((int)taxp->a_size>size) - { - size=(int)taxp->a_size; - - for(j=ramstart; ja_size) - break; - } - - /*Mark the memory used for overlay*/ - if(k==(int)taxp->a_size) - { - addr = j-k+1; - for(j=addr; (j<(int)(addr+size)); j++) - idatamap[j]=fchar; - } - else /*Couldn't find a chunk big enough: report the problem.*/ - { - tap->a_unaloc=taxp->a_size; - fprintf(stderr, ErrMsg, taxp->a_size, taxp->a_size>1?"s":"", tap->a_id); - lkerr++; - } - } - } - else if (fchar=='T') /*Bit addressable bytes in internal RAM*/ - { - /*Find the size of the space currently used for this areax overlay*/ -// for(j=0x20, size=0; j<0x30; j++) -// if(idatamap[j]==fchar) size++; - - /*If more space required, release the previously allocated areax in - internal RAM and search for a bigger one*/ - if((int)taxp->a_size>size) - { - size=(int)taxp->a_size; - - for(j=0x20; j<0x30; j++) - if(idatamap[j]==fchar) idatamap[j]=' '; - - /*Search for a space large enough in data memory for this overlay areax*/ - for(j=0x20, k=0; j<0x30; j++) - { - if(idatamap[j]==' ') - k++; - else - k=0; - if(k==(int)taxp->a_size) - break; - } - - /*Mark the memory used for overlay*/ - if(k==(int)size) - { - addr = j-k+1; - for(j=addr; (j<(int)(addr+size)); j++) - idatamap[j]=fchar; - } - else /*Couldn't find a chunk big enough: report the problem.*/ - { - tap->a_unaloc=taxp->a_size; - fprintf(stderr, ErrMsg, taxp->a_size, taxp->a_size>1?"s":"", tap->a_id); - lkerr++; - } - } - } - else /*Overlay areas not in internal ram*/ - { - taxp->a_addr = addr; - if (taxp->a_size > size) size = taxp->a_size; - } - taxp = taxp->a_axp; - } - /*Now set all overlayed areax to the same start address*/ - taxp = tap->a_axp; - while (taxp) - { - taxp->a_addr = addr; - taxp = taxp->a_axp; - } - } - else if (tap->a_flag & A3_ABS) /* Absolute sections */ - { - while (taxp) - { - if (locIndex == 0) - { - for (j=taxp->a_addr; (j<(int)(taxp->a_addr+taxp->a_size)) && (j<256); j++) - { - if (idatamap[j] == ' ') - idatamap[j] = 'A'; - else - fprintf(stderr, "memory overlap at 0x%X for %s\n", j, tap->a_id); - } - } - else if (locIndex == 1) - { - allocate_space(taxp->a_addr, taxp->a_size, tap->a_id, codemap8051, sizeof (codemap8051)); - } - else if (locIndex == 2) - { - allocate_space(taxp->a_addr, taxp->a_size, tap->a_id, xdatamap, sizeof (xdatamap)); - } - taxp->a_addr = 0; /* reset to zero so relative addresses become absolute */ - size += taxp->a_size; - taxp = taxp->a_axp; - } - } - else /* Concatenated sections */ - { - if ((locIndex == 1) && tap->a_size) - { - addr = find_empty_space(addr, tap->a_size, tap->a_id, codemap8051, sizeof (codemap6808)); - } - if ((locIndex == 2) && tap->a_size) - { - addr = find_empty_space(addr, tap->a_size, tap->a_id, xdatamap, sizeof (xdatamap)); - } - while (taxp) - { - if( (fchar=='D') || (fchar=='I') ) - { - if(taxp->a_size) - { - /*Search for a space large enough in internal RAM for this areax*/ - for(j=ramstart, k=0; ja_size) - break; - } - - if(k==(int)taxp->a_size) - { - taxp->a_addr = j-k+1; - - size += taxp->a_size; - - for(j=taxp->a_addr; (j<(int)(taxp->a_addr+taxp->a_size)) && (ja_size>0)&&(fchar=='D'))dchar++; - if((dchar<'a')||(dchar>'z')) dchar='D'; /*Ran out of letters?*/ - } - else /*We are in trouble, there is not enough memory for an areax chunk*/ - { - taxp->a_addr = addr; - addr += taxp->a_size; - size += taxp->a_size; - tap->a_unaloc+=taxp->a_size; - fprintf(stderr, ErrMsg, taxp->a_size, taxp->a_size>1?"s":"", tap->a_id); - lkerr++; - } - } - taxp = taxp->a_axp; - } - else if(fchar=='B') - { - if(taxp->a_size!=0) - { - /*Search for a space large enough in data memory for this areax*/ - for(j=0x20, k=0; j<0x30; j++) - { - if(idatamap[j]==' ') - k++; - else - k=0; - if(k==(int)taxp->a_size) break; - } - - /*Mark the memory used*/ - if(k==(int)taxp->a_size) - { - taxp->a_addr = j-k+1; - for(j=taxp->a_addr; (j<(int)(taxp->a_addr+taxp->a_size)) && (j<0x30); j++) - idatamap[j]=fchar; - } - else /*Couldn't find a chunk big enough: report the problem.*/ - { - tap->a_unaloc=taxp->a_size; - fprintf(stderr, ErrMsg, taxp->a_size, taxp->a_size>1?"s":"", tap->a_id); - lkerr++; - } - } - size += taxp->a_size; - taxp = taxp->a_axp; - } - else /*For concatenated BIT, CODE, and XRAM areax's*/ - { - if((fchar=='K') && (taxp->a_size == 1)) - { - taxp->a_size = 256-(addr & 0xFF); - } - //find next unused address now - if ((locIndex == 1) && taxp->a_size) - { - addr = find_empty_space(addr, taxp->a_size, tap->a_id, codemap8051, sizeof (codemap8051)); - allocate_space(addr, taxp->a_size, tap->a_id, codemap8051, sizeof (codemap8051)); - } - if ((locIndex == 2) && taxp->a_size) - { - addr = find_empty_space(addr, taxp->a_size, tap->a_id, xdatamap, sizeof (xdatamap)); - allocate_space(addr, taxp->a_size, tap->a_id, xdatamap, sizeof (xdatamap)); - } - taxp->a_addr = addr; - addr += taxp->a_size; - size += taxp->a_size; - taxp = taxp->a_axp; - } - } - } - tap->a_size = size; - tap->a_addr = tap->a_axp->a_addr; - - if ((tap->a_flag&A3_PAG) && (size > 256)) - { - fprintf(stderr, - "\n?ASlink-Warning-Paged Area %s Length Error\n", - tap->a_id); - lkerr++; - } - if ((tap->a_flag&A3_PAG) && (tap->a_size) && - ((tap->a_addr & 0xFFFFFF00) != ((addr-1) & 0xFFFFFF00))) - { - fprintf(stderr, - "\n?ASlink-Warning-Paged Area %s Boundary Error\n", - tap->a_id); - lkerr++; - } - return addr; + a_uint size, addr; + struct areax *taxp; + int j, k, ramlimit, ramstart; + char fchar=' ', dchar='a'; + char ErrMsg[]="?ASlink-Error-Could not get %d consecutive byte%s" + " in internal RAM for area %s.\n"; + + tap->a_unaloc=0; + + /*Notice that only ISEG and SSEG can be in the indirectly addressable internal RAM*/ + if( (!strcmp(tap->a_id, "ISEG")) || (!strcmp(tap->a_id, "SSEG")) ) + { + ramstart = iram_start; + + if ((iram_size <= 0) || (ramstart + iram_size > 0x100)) + ramlimit = 0x100; + else + ramlimit = ramstart + iram_size; + } + else + { + ramstart = dram_start; + + if ((iram_size <= 0) || (ramstart + iram_size > 0x80)) + ramlimit = 0x80; + else + ramlimit = ramstart + iram_size; + } + + size = 0; + addr = tap->a_addr; + taxp = tap->a_axp; + + /*Use a letter to identify each area in the internal RAM layout map*/ + if (locIndex==0) + { + /**/ if(!strcmp(tap->a_id, "DSEG")) + fchar='D'; /*It will be converted to letters 'a' to 'z' later for each areax*/ + else if(!strcmp(tap->a_id, "ISEG")) + fchar='I'; + else if(!strcmp(tap->a_id, "SSEG")) + fchar='S'; + else if(!strcmp(tap->a_id, "OSEG")) + fchar='Q'; + else if(!strcmp(tap->a_id, "REG_BANK_0")) + fchar='0'; + else if(!strcmp(tap->a_id, "REG_BANK_1")) + fchar='1'; + else if(!strcmp(tap->a_id, "REG_BANK_2")) + fchar='2'; + else if(!strcmp(tap->a_id, "REG_BANK_3")) + fchar='3'; + else if(!strcmp(tap->a_id, "BSEG_BYTES")) + fchar='B'; + else if(!strcmp(tap->a_id, "BIT_BANK")) + fchar='T'; + else + fchar=' ';/*???*/ + } + else if (locIndex == 1) + { + /**/ if(!strcmp(tap->a_id, "GSINIT")) + fchar='G'; + } + else if (locIndex == 2) + { + /**/ if(!strcmp(tap->a_id, "XSTK")) + fchar='K'; + } + + if (tap->a_flag & A3_OVR) /* Overlayed sections */ + { + while (taxp) + { + if(taxp->a_size == 0) + { + taxp = taxp->a_axp; + continue; + } + + if ( (fchar=='0')||(fchar=='1')||(fchar=='2')||(fchar=='3') ) /*Reg banks*/ + { + addr=(fchar-'0')*8; + taxp->a_addr=addr; + size=taxp->a_size; + for(j=addr; (j<(int)(addr+size)) && (ja_size=0; j(int)taxp->a_size) + taxp->a_size=k; + } + else + { + k=0; + } + } + stacksize=taxp->a_size; + } + + /*If more space required, release the previously allocated areax in + internal RAM and search for a bigger one*/ + if((int)taxp->a_size>size) + { + size=(int)taxp->a_size; + + for(j=ramstart; ja_size) + break; + } + + /*Mark the memory used for overlay*/ + if(k==(int)taxp->a_size) + { + addr = j-k+1; + for(j=addr; (j<(int)(addr+size)); j++) + idatamap[j]=fchar; + } + else /*Couldn't find a chunk big enough: report the problem.*/ + { + tap->a_unaloc=taxp->a_size; + fprintf(stderr, ErrMsg, taxp->a_size, taxp->a_size>1?"s":"", tap->a_id); + lkerr++; + } + } + } + else if (fchar=='T') /*Bit addressable bytes in internal RAM*/ + { + /*Find the size of the space currently used for this areax overlay*/ +// for(j=0x20, size=0; j<0x30; j++) +// if(idatamap[j]==fchar) size++; + + /*If more space required, release the previously allocated areax in + internal RAM and search for a bigger one*/ + if((int)taxp->a_size>size) + { + size=(int)taxp->a_size; + + for(j=0x20; j<0x30; j++) + if(idatamap[j]==fchar) idatamap[j]=' '; + + /*Search for a space large enough in data memory for this overlay areax*/ + for(j=0x20, k=0; j<0x30; j++) + { + if(idatamap[j]==' ') + k++; + else + k=0; + if(k==(int)taxp->a_size) + break; + } + + /*Mark the memory used for overlay*/ + if(k==(int)size) + { + addr = j-k+1; + for(j=addr; (j<(int)(addr+size)); j++) + idatamap[j]=fchar; + } + else /*Couldn't find a chunk big enough: report the problem.*/ + { + tap->a_unaloc=taxp->a_size; + fprintf(stderr, ErrMsg, taxp->a_size, taxp->a_size>1?"s":"", tap->a_id); + lkerr++; + } + } + } + else /*Overlay areas not in internal ram*/ + { + taxp->a_addr = addr; + if (taxp->a_size > size) size = taxp->a_size; + } + taxp = taxp->a_axp; + } + /*Now set all overlayed areax to the same start address*/ + taxp = tap->a_axp; + while (taxp) + { + taxp->a_addr = addr; + taxp = taxp->a_axp; + } + } + else if (tap->a_flag & A3_ABS) /* Absolute sections */ + { + while (taxp) + { + if (locIndex == 0) + { + for (j=taxp->a_addr; (j<(int)(taxp->a_addr+taxp->a_size)) && (j<256); j++) + { + if (idatamap[j] == ' ') + idatamap[j] = 'A'; + else + fprintf(stderr, "memory overlap at 0x%X for %s\n", j, tap->a_id); + } + } + else if (locIndex == 1) + { + allocate_space(taxp->a_addr, taxp->a_size, tap->a_id, codemap8051, sizeof (codemap8051)); + } + else if (locIndex == 2) + { + allocate_space(taxp->a_addr, taxp->a_size, tap->a_id, xdatamap, sizeof (xdatamap)); + } + taxp->a_addr = 0; /* reset to zero so relative addresses become absolute */ + size += taxp->a_size; + taxp = taxp->a_axp; + } + } + else /* Concatenated sections */ + { + if ((locIndex == 1) && tap->a_size) + { + addr = find_empty_space(addr, tap->a_size, tap->a_id, codemap8051, sizeof (codemap8051)); + } + if ((locIndex == 2) && tap->a_size) + { + addr = find_empty_space(addr, tap->a_size, tap->a_id, xdatamap, sizeof (xdatamap)); + } + while (taxp) + { + if( (fchar=='D') || (fchar=='I') ) + { + if(taxp->a_size) + { + /*Search for a space large enough in internal RAM for this areax*/ + for(j=ramstart, k=0; ja_size) + break; + } + + if(k==(int)taxp->a_size) + { + taxp->a_addr = j-k+1; + + size += taxp->a_size; + + for(j=taxp->a_addr; (j<(int)(taxp->a_addr+taxp->a_size)) && (ja_size>0)&&(fchar=='D'))dchar++; + if((dchar<'a')||(dchar>'z')) dchar='D'; /*Ran out of letters?*/ + } + else /*We are in trouble, there is not enough memory for an areax chunk*/ + { + taxp->a_addr = addr; + addr += taxp->a_size; + size += taxp->a_size; + tap->a_unaloc+=taxp->a_size; + fprintf(stderr, ErrMsg, taxp->a_size, taxp->a_size>1?"s":"", tap->a_id); + lkerr++; + } + } + taxp = taxp->a_axp; + } + else if(fchar=='B') + { + if(taxp->a_size!=0) + { + /*Search for a space large enough in data memory for this areax*/ + for(j=0x20, k=0; j<0x30; j++) + { + if(idatamap[j]==' ') + k++; + else + k=0; + if(k==(int)taxp->a_size) break; + } + + /*Mark the memory used*/ + if(k==(int)taxp->a_size) + { + taxp->a_addr = j-k+1; + for(j=taxp->a_addr; (j<(int)(taxp->a_addr+taxp->a_size)) && (j<0x30); j++) + idatamap[j]=fchar; + } + else /*Couldn't find a chunk big enough: report the problem.*/ + { + tap->a_unaloc=taxp->a_size; + fprintf(stderr, ErrMsg, taxp->a_size, taxp->a_size>1?"s":"", tap->a_id); + lkerr++; + } + } + size += taxp->a_size; + taxp = taxp->a_axp; + } + else /*For concatenated BIT, CODE, and XRAM areax's*/ + { + //expand external stack + if((fchar=='K') && (taxp->a_size == 1)) + { + taxp->a_size = 256-(addr & 0xFF); + } + //find next unused address now + if ((locIndex == 1) && taxp->a_size) + { + addr = find_empty_space(addr, taxp->a_size, tap->a_id, codemap8051, sizeof (codemap8051)); + allocate_space(addr, taxp->a_size, tap->a_id, codemap8051, sizeof (codemap8051)); + } + if ((locIndex == 2) && taxp->a_size) + { + addr = find_empty_space(addr, taxp->a_size, tap->a_id, xdatamap, sizeof (xdatamap)); + allocate_space(addr, taxp->a_size, tap->a_id, xdatamap, sizeof (xdatamap)); + } + taxp->a_addr = addr; + addr += taxp->a_size; + size += taxp->a_size; + taxp = taxp->a_axp; + } + } + } + tap->a_size = size; + tap->a_addr = tap->a_axp->a_addr; + + if ((tap->a_flag & A3_PAG) && (size > 256)) + { + fprintf(stderr, + "\n?ASlink-Warning-Paged Area %s Length Error\n", + tap->a_id); + lkerr++; + } + if ((tap->a_flag & A3_PAG) && (tap->a_size) && + ((tap->a_addr & 0xFFFFFF00) != ((addr-1) & 0xFFFFFF00))) + { + fprintf(stderr, + "\n?ASlink-Warning-Paged Area %s Boundary Error\n", + tap->a_id); + lkerr++; + } + return addr; } /* end sdld specific */ diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lkbank.c sdcc-3.2.0+dfsg/sdas/linksrc/lkbank.c --- sdcc-3.1.0+dfsg/sdas/linksrc/lkbank.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lkbank.c 2011-12-06 23:01:37.000000000 +0000 @@ -24,128 +24,621 @@ #include "aslink.h" -/*Module lkbank.c +/*Module lkbank.c * - * The module lkbank.c contains the function newbank() which - * creates a bank structure and the function module() which - * loads the module name into the current head structure. - * - * lkbank.c contains the following functions: - * VOID lkfopen() - * VOID lkfclose() - * - * lkbank.c contains no local variables. - */ - -/*)Function VOID lkfopen() - * - * The function lkfopen() will - * open output data files. - * - * local variables: - * File * fp temporary file handle - * char * frmt temporary file type string - * - * - * global variables: - * int a_bytes T line address bytes - * char afspec[] Filespec from afile() - * FILE * jfp NoICE output file handle - * int oflag data output type flag - * FILE * ofp Output file handle - * FILE * stderr Standard Error Output handle - * - * functions called: - * FILE * afile() lkmain.c - * int fprintf() c_library - * VOID lkexit() lkmain.c - * - * side effects: - * All data output files are opened. - */ - -VOID -lkfopen() -{ - char * frmt; - FILE * fp; - - if (oflag == 0) return; - - fp = stderr; - /* - * Open output file - */ - if (oflag == 1) { - switch(a_bytes) { - default: - case 2: frmt = "ihx"; break; - } - fp = afile(linkp->f_idp, frmt, 1); - } else - if (oflag == 2) { - switch(a_bytes) { - default: - case 2: frmt = "s19"; break; - } - fp = afile(linkp->f_idp, frmt, 1); - } else - if (oflag == 3) { - switch(a_bytes) { - default: - case 2: frmt = "bin"; break; - case 3: frmt = "bi3"; break; - case 4: frmt = "bi4"; break; - } - fp = afile(linkp->f_idp, frmt, 2); - } - /* sdld specific */ - if (oflag == 4) { - fp = afile(linkp->f_idp, "elf", 2); - } - /* end sdld specific */ - if (fp != stderr) { - if (fp == NULL) { - lkexit(ER_FATAL); - } + * The module lkbank.c contains the function newbank() which + * creates a bank structure and the function module() which + * loads the module name into the current head structure. + * + * lkbank.c contains the following functions: + * VOID newbank() + * VOID lkpbank() + * VOID setbank() + * VOID chkbank() + * VOID lkfopen() + * VOID lkfclose() + * + * lkbank.c contains no local variables. + */ + +/*)Function VOID newbank() + * + * The function newbank() creates and/or modifies bank + * structures for each B directive read from + * the .rel file(s). The function lkpbank() is called + * to find the bank structure associated with this name. + * If the bank does not yet exist then a new bank + * structure is created and linked to any existing + * linked bank structures. The bank flags are copied + * into the bank flag variable. Refer to lkdata.c for + * details of the structures and their linkage. + * + * local variables: + * bank **hblp pointer to an array of pointers + * int i counter, loop variable, value + * char id[] id string + * int nbank number of banks in this head structure + * a_uint v temporary value + * + * global variables: + * bank *bp Pointer to the current + * bank structure + * head *hp Pointer to the current + * head structure + * int lkerr error flag + * + * functions called: + * a_uint eval() lkeval.c + * VOID exit() c_library + * int fprintf() c_library + * VOID getid() lklex.c + * VOID lkpbank() lkbank.c + * VOID skip() lklex.c + * + * side effects: + * The bank structure is created and + * linked with the appropriate head structures. + * Failure to allocate bank structure + * space will terminate the linker. Other internal + * errors most likely caused by corrupted .rel + * files will also terminate the linker. + */ + +/* + * Create a bank entry. + * + * B xxxxxx base nnnn size nnnn map nnn flags n fsfx xxxxxx + * | | | | | | + * | | | | | `-- bp->b_fsfx + * | | | | `--------- bp->b_flag + * | | | `--------------------bp->b_map + * | | `---------------------------- bp->b_size + * | `-------------------------------------- bp->b_base + * `-------------------------------------------------- bp->b_id + * + */ +VOID +newbank(void) +{ + int i; + a_uint v; + char id[NCPS]; + int nbank; + struct bank **hblp; + + if (headp == NULL) { + fprintf(stderr, "No header defined\n"); + lkexit(ER_FATAL); + } + /* + * Create bank entry + */ + getid(id, -1); + lkpbank(id); + /* + * Evaluate Parameters + */ + while (more()) { + getid(id, -1); + /* + * Evaluate base address + */ + if (symeq("base", id, 1)) { + v = eval(); + if (bp->b_base == 0) { + bp->b_base = v; + } else { + if (v && (bp->b_base != v)) { + fprintf(stderr, "Conflicting address in bank %s\n", id); + lkerr++; + } + } + } else + /* + * Evaluate bank size + */ + if (symeq("size", id, 1)) { + v = eval(); + if (bp->b_size == 0) { + bp->b_size = v; + } else { + if (v && (bp->b_size != v)) { + fprintf(stderr, "Conflicting size in bank %s\n", id); + lkerr++; + } + } + } else + /* + * Evaluate bank mapping + */ + if (symeq("map", id, 1)) { + v = eval(); + if (bp->b_map == 0) { + bp->b_map = v; + } else { + if (v && (bp->b_map != v)) { + fprintf(stderr, "Conflicting mapping in bank %s\n", id); + lkerr++; + } + } + } else + /* + * Evaluate flags + */ + if (symeq("flags", id, 1)) { + i = (int) eval(); + if (bp->b_flag == 0) { + bp->b_flag = i; + } else { + if (i && (bp->b_flag != i)) { + fprintf(stderr, "Conflicting flags in bank %s\n", id); + lkerr++; + } + } + } else + /* + * File Suffix + */ + if (symeq("fsfx", id, 1)) { + if (more()) { + getid(id, -1); + if (bp->b_fsfx == NULL) { + bp->b_fsfx = strsto(id); + } else { + if (!symeq(bp->b_fsfx, id, 1)) { + fprintf(stderr, "Conflicting fsfx in bank %s\n", id); + lkerr++; + } + } + } + } + } + /* + * Place pointer in header bank list + */ + nbank = hp->h_nbank; + hblp = hp->b_list; + for (i=0; i < nbank; i++) { + if (hblp[i] == NULL) { + hblp[i] = bp; + return; + } + } + fprintf(stderr, "Header bank list overflow\n"); + lkexit(ER_FATAL); +} + +/*)Function VOID lkpbank(id) + * + * char * id pointer to the bank name string + * + * The function lkpbank() searches the linked bank structures + * for a name match. If the name is not found then a bank + * structure is created. The linker flag, rtaflg, for initializing + * i86 format output is set. + * + * local variables: + * area * tbp pointer to a bank structure + * + * global variables: + * bank *bp Pointer to the current + * bank structure + * bank *bankp The pointer to the first + * bank structure of a linked list + * + * functions called: + * VOID * new() lksym() + * char * strsto() lksym.c + * int symeq() lksym.c + * + * side effects: + * Bank structure may be created. + * Failure to allocate space for a structure + * will terminate the linker. + */ + +VOID +lkpbank(char *id) +{ + struct bank *tbp; + + bp = bankp; + while (bp) { + if (symeq(id, bp->b_id, 1)) { + return; + } + bp = bp->b_bp; + } + bp = (struct bank *) new (sizeof(struct bank)); + tbp = bankp; + while (tbp->b_bp) + tbp = tbp->b_bp; + tbp->b_bp = bp; + bp->b_id = strsto(id); + bp->b_rtaflg = 1; +} + + +/*)Function VOID setbank() + * + * The function setbank() sets the base address of the bank by + * finding the first area in the bank and initializing the + * value to the bank base address. The bank base address is always + * specified in 'byte' addressing. A first area which is not 'byte' + * addressed (e.g. a processor addressed by a 'word' of 2 or more bytes) + * has the base address scaled to begin at the 'byte' address. + * + * If the area base address has been set using the -b linker + * option then the bank base address is NOT set. + * + * The function setbank() also scans all the areas searching + * for non-banked entries. All non-banked areas are linked + * to bank[0] which does not have a bank file suffix. + * + * local variables: + * a_uint base base address in 'bytes' + * int bytes size of PC increment in bytes + * + * global variables: + * area *ap Pointer to the current + * area structure + * area *areap The pointer to the first + * area structure of a linked list + * bank *bp Pointer to the current + * bank structure + * bank *bankp The pointer to the first + * bank structure of a linked list + * + * functions called: + * none + * + * side effects: + * Base starting address may be set and non-banked + * areas linked to bank[0]. + */ + +VOID +setbank(void) +{ + a_uint base; + int bytes; + + /* + * For each bank structure with a defined base address value + * scan the area structures for the first relocatable area + * in the bank and all absolute areas in the bank. + * Load the base address value into the area address if the + * bank base address has not been overridden by a -b option. + * The bank base address is always expressed in 'bytes'. + */ + for (bp = bankp; bp != NULL; bp = bp->b_bp) { + if ((bp->b_flag & B_BASE) == 0) + continue; + for (ap = areap; ap != NULL; ap = ap->a_ap) { + if (ap->a_bp != bp) + continue; + if ((ap->a_flag & A4_BNK) != A4_BNK) + continue; + if (ap->a_bset) + continue; + bytes = 1 + (ap->a_flag & A4_WLMSK); + base = bp->b_base; + ap->a_addr = (base/bytes) + ((base % bytes) ? 1 : 0); + ap->a_bset = 1; + if ((ap->a_flag & A4_ABS) == A4_ABS) { + continue; + } else { + break; + } + } + } + + /* + * Scan all the area structures for non-banked + * areas. Set the area bank pointer to reference + * bank[0] which has no file suffix. + */ + for (ap = areap; ap != NULL; ap = ap->a_ap) { + if ((ap->a_flag & A4_BNK) == 0) { + ap->a_bp = bankp; + } + } +} + + +/*)Function VOID chkbank(fp) + * + * FILE *fp file handle + * + * The function chkbank() scans the bank/area structures to + * determine the length of a bank. Banks exceeding the size + * specified from a bank size option are flagged. The bank + * size is always in 'byte' units. + * + * local variables: + * a_uint alow lowest address in a bank + * a_uint ahigh highest address in a bank + * a_uint blimit bank size limit + * + * global variables: + * area *ap Pointer to the current + * area structure + * area *areap The pointer to the first + * area structure of a linked list + * bank *bp Pointer to the current + * bank structure + * bank *bankp The pointer to the first + * bank structure of a linked list + * + * functions called: + * none + * + * side effects: + * Bank size may be flagged. + */ + +VOID +chkbank(FILE *fp) +{ + a_uint alow, ahigh, blimit, bytes; + + for (bp = bankp; bp != NULL; bp = bp->b_bp) { + if ((bp->b_flag & B_SIZE) == 0) { + continue; + } + blimit = bp->b_size; + if (blimit == 0) { + continue; + } + alow = ~0; + ahigh = 0; + for (ap = areap; ap != NULL; ap = ap->a_ap) { + if (ap->a_bp != bp) { + continue; + } + if ((ap->a_flag & A4_BNK) != A4_BNK) { + continue; + } + bytes = ap->a_addr * (1 + (ap->a_flag & A4_WLMSK)); + if (bytes < alow) { + alow = bytes; + } + bytes = (ap->a_addr + ap->a_size) * (1 + (ap->a_flag & A4_WLMSK)); + if (bytes > ahigh) { + ahigh = bytes; + } + } + if ((ahigh - alow) > blimit) { + fprintf(fp, + "\n?ASlink-Warning-Size limit exceeded in bank %s\n", bp->b_id); + lkerr++; + } + } +} + + +/*)Function VOID lkfopen() + * + * The function lkfopen() scans the bank/area structures to + * open output data files for banks with any data. Files + * are not opened for banks/areas with no output data. + * + * The bank structures are first scanned to create the + * file specification from the output file name combined + * with any given file suffixs. + * + * local variables: + * int idx position of FSEPX in file specification + * File * fp temporary file handle + * char * frmt temporary file type string + * char str[] File Specification String + * struct bank *tbp temporary bank pointer + * + * + * global variables: + * int a_bytes T line address bytes + * area *ap Pointer to the current + * area structure + * area *areap The pointer to the first + * area structure of a linked list + * char afspec[] Filespec from afile() + * bank *bp Pointer to the current + * bank structure + * bank *bankp The pointer to the first + * bank structure of a linked list + * FILE * jfp NoICE output file handle + * int oflag data output type flag + * FILE * stderr Standard Error Output handle + * + * functions called: + * FILE * afile() lkmain.c + * int fclose() c_library + * int fprintf() c_library + * VOID lkexit() lkmain.c + * char * strcpy() c_library + * char * strsto() lksym.c + * char * symeq() lksym.c + * + * side effects: + * All data output files are opened. + */ + +VOID +lkfopen(void) +{ + int idx; + char * frmt; + char str[NCPS+NCPS]; + struct bank *tbp; + struct sym *sp; + FILE * fp; + + if (oflag == 0) return; + + /* + * Scan bank structures preparing + * the output file specifications. + */ + idx = linkp->f_idx + fndext(linkp->f_idp + linkp->f_idx); + strncpy(str, linkp->f_idp, idx); + str[idx] = 0; + + for (bp = bankp; bp != NULL; bp = bp->b_bp) { + if (bp->b_flag & B_FSFX) { + strcpy(str + idx, bp->b_fsfx); + } + bp->b_fspec = strsto(str); + str[idx] = 0; + } + + /* + * If .__.END. is defined force + * an output file to be opened. + */ + sp = lkpsym(".__.END.", 0); + if (sp) { + sp->s_axp->a_bap->a_flag |= A4_OUT; + } + + /* + * Scan the area list opening the appropriate + * output file if there is data in the area. + */ + ap = areap; + while (ap) { + if ((ap->a_flag & A4_BNK) != A4_BNK) { + ap->a_bp = bankp; + } + if ((ap->a_flag & A4_OUT) || (ap->a_size != 0)) { + bp = ap->a_bp; + if (bp->b_ofp == NULL) { + /* + * Scan file specifications for + * identical file already opened. + */ + for (tbp = bankp; tbp != NULL; tbp = tbp->b_bp) { + if (symeq(tbp->b_fspec, bp->b_fspec, 1)) { + if (tbp->b_ofp != NULL) { + bp->b_ofp = tbp->b_ofp; + bp->b_ofspec = tbp->b_ofspec; + } + } + } + } + if (bp->b_ofp == NULL) { + fp = stderr; + /* + * Open output file + */ + if (oflag == 1) { + switch(a_bytes) { + default: + case 2: frmt = "ihx"; break; + } + fp = afile(bp->b_fspec, frmt, 1); + } else + if (oflag == 2) { + switch(a_bytes) { + default: + case 2: frmt = "s19"; break; + case 3: frmt = "s28"; break; + case 4: frmt = "s37"; break; + } + fp = afile(bp->b_fspec, frmt, 1); + } else + if (oflag == 3) { + switch(a_bytes) { + default: + case 2: frmt = "bin"; break; + case 3: frmt = "bi3"; break; + case 4: frmt = "bi4"; break; + } + fp = afile(bp->b_fspec, frmt, 2); + } else + /* sdld specific */ + if (oflag == 4) { + fp = afile(bp->b_fspec, "elf", 2); + } + /* end sdld specific */ + if (fp != stderr) { + if (fp == NULL) { + lkexit(ER_FATAL); + } + bp->b_ofspec = strsto(afspec); #if NOICE - /* - * Include NoICE command to load file - */ - if (jfp) { - fprintf(jfp, "LOAD %s\n", afspec); - } + /* + * Include NoICE command to load file + */ + if (jfp) { + fprintf(jfp, "LOAD %s\n", bp->b_ofspec); + } #endif - ofp = fp; - } + } + bp->b_ofp = fp; + } + ap->a_ofp = bp->b_ofp; + } else { + ap->a_ofp = NULL; + } + ap = ap->a_ap; + } } -/*)Function VOID lkfclose() - * - * The function lkfclose() will - * close all open data output files. +/*)Function VOID lkfclose() * - * local variables: + * The function lkfclose() scans the bank structures to + * close all open data output files. * - * global variables: - * FILE * ofp Output file handle - * FILE * stderr Standard Error Output handle + * local variables: + * struct bank *tbp temporary bank pointer * - * functions called: - * int fclose() c_library + * global variables: + * bank *bp Pointer to the current + * bank structure + * bank *bankp The pointer to the first + * bank structure of a linked list + * FILE * ofp Output file handle + * FILE * stderr Standard Error Output handle + * + * functions called: + * VOID lkout() lkout.c + * int fclose() c_library * - * side effects: - * All open data output files are closed. + * side effects: + * All open data output files are closed. */ VOID -lkfclose() +lkfclose(void) { - if (ofp != NULL) { - if (ofp != stderr) { - fclose(ofp); - } - ofp = NULL; - } + struct bank *tbp; + + /* + * Scan Bank Structure + * Output data terminations + * and close open files + */ + bp = bankp; + while (bp != NULL) { + ofp = bp->b_ofp; + if (ofp != NULL) { + lkout(0); + if (ofp != stderr) { + fclose(ofp); + } + /* + * Scan bank structure for + * identical file handles. + */ + for (tbp = bp->b_bp; tbp != NULL; tbp = tbp->b_bp) { + if (tbp->b_ofp == ofp) { + tbp->b_ofp = NULL; + } + } + ofp = NULL; + bp->b_ofp = NULL; + } + bp = bp->b_bp; + } } diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lkdata.c sdcc-3.2.0+dfsg/sdas/linksrc/lkdata.c --- sdcc-3.1.0+dfsg/sdas/linksrc/lkdata.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lkdata.c 2011-12-06 23:01:37.000000000 +0000 @@ -22,534 +22,602 @@ * Kent, Ohio 44240 * * With enhancements from - * John L. Hartman (JLH) - * jhartman@compuserve.com + * John L. Hartman (JLH) + * jhartman@compuserve.com * */ #include "aslink.h" -/*)Module lkdata.c +/*)Module lkdata.c * - * The module lkdata contains the global variables - * and structures used in the linker aslink. + * The module lkdata contains the global variables + * and structures used in the linker aslink. */ /* * Internal ASxxxx Version Variable */ -int ASxxxx_VERSION; +int ASxxxx_VERSION; /* - * Definitions for all Global Variables + * Definitions for all Global Variables */ -char *_abs_ = { ". .ABS." }; +char *_abs_ = { ". .ABS." }; + +char afspec[FILSPC]; /* The filespec created by afile() + */ +int lkerr; /* Linker error flag + */ +char *ip; /* Pointer into the REL file text line in ib[] + */ +char ib[NINPUT]; /* REL file text line + */ +char *rp; /* pointer into the LST file + * text line in rb[] + */ +char rb[NINPUT]; /* LST file text line being + * address relocated + */ +int oflag; /* Output file type flag + */ +int objflg; /* Linked file/library object output flag + */ -char afspec[FILSPC]; /* The filespec created by afile() - */ -int lkerr; /* Linker error flag - */ -char *ip; /* Pointer into the REL file text line in ib[] - */ -char ib[NINPUT]; /* REL file text line - */ -char *rp; /* pointer into the LST file - * text line in rb[] - */ -char rb[NINPUT]; /* LST file text line being - * address relocated - */ -int oflag; /* Output file type flag - */ #if NOICE -int jflag; /* NoICE output flag - */ +int jflag; /* NoICE output flag + */ #endif #if SDCDB -int yflag; /* SDCDB output flag - */ +int yflag; /* SDCDB output flag + */ #endif -int mflag; /* Map output flag - */ -int xflag; /* Map file radix type flag - */ -int pflag; /* print linker command file flag - */ -int uflag; /* Listing relocation flag - */ -int wflag; /* Enable wide format listing - */ -int zflag; /* Disable symbol case sensitivity - */ -int radix; /* current number conversion radix: - * 2 (binary), 8 (octal), 10 (decimal), - * 16 (hexadecimal) - */ -int line; /* current line number - */ -int page; /* current page number - */ -int lop; /* current line number on page - */ -int pass; /* linker pass number - */ -int pcb; /* current bytes per pc word - */ -int rtcnt; /* count of elements in the - * rtval[] and rtflg[] arrays - */ -a_uint rtval[NTXT]; /* data associated with relocation - */ -int rtflg[NTXT]; /* indicates if rtval[] value is - * to be sent to the output file. - */ -int rterr[NTXT]; /* indicates if rtval[] value should - * be flagged as a relocation error. - */ -char rtbuf[NMAX]; /* S19/IHX output buffer - */ - /* rtbuf[] processing - */ -a_uint rtadr0 = 0; /* - */ -a_uint rtadr1 = 0; /* - */ -a_uint rtadr2 = 0; /* - */ -int a_bytes; /* REL file T Line address length - */ -int hilo; /* REL file byte ordering - */ -a_uint a_mask; /* Address Mask - */ -a_uint s_mask; /* Sign Mask - */ -a_uint v_mask; /* Value Mask - */ -int gline; /* LST file relocation active - * for current line - */ -int gcntr; /* LST file relocation active - * counter - */ +int mflag; /* Map output flag + */ +int xflag; /* Map file radix type flag + */ +int pflag; /* print linker command file flag + */ +int uflag; /* Listing relocation flag + */ +int wflag; /* Enable wide format listing + */ +int zflag; /* Disable symbol case sensitivity + */ +int radix; /* current number conversion radix: + * 2 (binary), 8 (octal), 10 (decimal), + * 16 (hexadecimal) + */ +int line; /* current line number + */ +int page; /* current page number + */ +int lop; /* current line number on page + */ +int pass; /* linker pass number + */ +a_uint pc; /* current relocation address + */ +int pcb; /* current bytes per pc word + */ +int rtcnt; /* count of elements in the + * rtval[] and rtflg[] arrays + */ +a_uint rtval[NTXT]; /* data associated with relocation + */ +int rtflg[NTXT]; /* indicates if rtval[] value is + * to be sent to the output file. + */ +int rterr[NTXT]; /* indicates if rtval[] value should + * be flagged as a relocation error. + */ +char rtbuf[NMAX]; /* S19/IHX output buffer + */ +struct bank * rtabnk; /* rtbuf[] processing + */ +int rtaflg; /* rtbuf[] processing + */ +a_uint rtadr0 = 0; /* + */ +a_uint rtadr1 = 0; /* + */ +a_uint rtadr2 = 0; /* + */ +int obj_flag = 0; /* Linked file/library object output flag + */ +int a_bytes; /* REL file T Line address length + */ +int hilo; /* REL file byte ordering + */ +a_uint a_mask; /* Address Mask + */ +a_uint s_mask; /* Sign Mask + */ +a_uint v_mask; /* Value Mask + */ +int gline; /* LST file relocation active + * for current line + */ +int gcntr; /* LST file relocation active + * counter + */ /* sdld specific */ -char *optsdcc; -char *optsdcc_module; -int sflag; /* JCF: Memory usage output flag - */ -int packflag=0; /* JCF: Pack internal memory flag - */ -int stacksize=0; /* JCF: Stack size - */ -int aflag; /* Overlapping area warning flag - */ -int rflag; /* Extended linear address record flag. - */ -a_uint iram_size; /* internal ram size - */ -long xram_size = -1; /* external ram size - */ -long code_size = -1; /* code size - */ +char *optsdcc; +char *optsdcc_module; +int sflag; /* JCF: Memory usage output flag + */ +int packflag=0; /* JCF: Pack internal memory flag + */ +int stacksize=0; /* JCF: Stack size + */ +int aflag; /* Overlapping area warning flag + */ +int rflag; /* Extended linear address record flag. + */ +a_uint iram_size; /* internal ram size + */ +long xram_size = -1; /* external ram size + */ +long code_size = -1; /* code size + */ /* end sdld specific */ /* - * The structure lfile contains a pointer to a - * file specification string, the file type, - * and a link to the next - * lfile structure. - * - * struct lfile - * { - * struct lfile *f_flp; lfile link - * int f_type; File type - * char *f_idp; Pointer to file spec - * }; - */ -struct lfile *filep; /* The pointers (lfile *) filep, - * (lfile *) cfp, and (FILE *) sfp - * are used in conjunction with - * the routine nxtline() to read - * asmlnk commands from - * (1) the standard input or - * (2) or a command file - * and to read the REL files - * sequentially as defined by the - * asmlnk input commands. - * - * The pointer *filep points to the - * beginning of a linked list of - * lfile structures. - */ -struct lfile *cfp; /* The pointer *cfp points to the - * current lfile structure - */ -struct lfile *startp;/* aslink startup file structure - */ -struct lfile *linkp; /* pointer to first lfile structure - * containing an input REL file - * specification - */ -struct lfile *lfp; /* pointer to current lfile structure - * being processed by parse() - */ -FILE *ofp = NULL; /* Output file handle - * for word formats - */ + * The structure lfile contains a pointer to a + * file specification string, an index which points + * to the file name (past the 'path'), the file type, + * an object output flag, and a link to the next + * lfile structure. + * + * struct lfile + * { + * struct lfile *f_flp; lfile link + * int f_type; File type + * char *f_idp; Pointer to file spec + * int f_obj; Object output flag + * }; + */ +struct lfile *filep; /* The pointers (lfile *) filep, + * (lfile *) cfp, and (FILE *) sfp + * are used in conjunction with + * the routine nxtline() to read + * asmlnk commands from + * (1) the standard input or + * (2) or a command file + * and to read the REL files + * sequentially as defined by the + * asmlnk input commands. + * + * The pointer *filep points to the + * beginning of a linked list of + * lfile structures. + */ +struct lfile *cfp; /* The pointer *cfp points to the + * current lfile structure + */ +struct lfile *startp;/* aslink startup file structure + */ +struct lfile *linkp; /* pointer to first lfile structure + * containing an input REL file + * specification + */ +struct lfile *lfp; /* pointer to current lfile structure + * being processed by parse() + */ +FILE *ofp = NULL; /* Output file handle + * for word formats + */ #if NOICE -FILE *jfp = NULL; /* NoICE output file handle - */ +FILE *jfp = NULL; /* NoICE output file handle + */ #endif #if SDCDB -FILE *yfp = NULL; /* SDCDB output file handle - */ +FILE *yfp = NULL; /* SDCDB output file handle + */ #endif -FILE *mfp = NULL; /* Map output file handle - */ -FILE *rfp = NULL; /* File handle for output - * address relocated ASxxxx - * listing file - */ -FILE *sfp = NULL; /* The file handle sfp points to the - * currently open file - */ -FILE *tfp = NULL; /* File handle for input - * ASxxxx listing file - */ - -/* - * The structures of head, area, areax, and sym - * are created as the REL files are read during the first - * pass of the linker. The struct head is created upon - * encountering a H directive in the REL file. The - * structure contains a link to a link file structure - * (struct lfile) which describes the file containing the H - * directive, the number of data/code areas - * contained in this header segment, the number of - * symbols referenced/defined in this header segment, a pointer - * to an array of pointers to areax structures (struct areax) - * created as each A directive is read, and a pointer to an - * array of pointers to symbol structures (struct sym) for - * all referenced/defined symbols. As H directives are read - * from the REL files a linked list of head structures is - * created by placing a link to the new head structure - * in the previous head structure. - * - * struct head - * { - * struct head *h_hp; Header link - * struct lfile *h_lfile; Associated file - * int h_narea; # of areas - * struct areax **a_list; Area list - * int h_nsym; # of symbols - * struct sym **s_list; Symbol list - * char * m_id; Module name - * }; - */ -struct head *headp; /* The pointer to the first - * head structure of a linked list - */ -struct head *hp; /* Pointer to the current - * head structure - */ - -/* - * A structure area is created for each 'unique' data/code - * area definition found as the REL files are read. The - * struct area contains the name of the area, a flag byte - * which contains the area attributes (REL/CON/OVR/ABS), - * the area subtype (not used in this assembler), and the - * area base address and total size which will be filled - * in at the end of the first pass through the REL files. - * As A directives are read from the REL files a linked - * list of unique area structures is created by placing a - * link to the new area structure in the previous area structure. - * - * struct area - * { - * struct area *a_ap; Area link - * struct areax *a_axp; Area extension link - * a_uint a_addr; Beginning address of area - * a_uint a_size; Total size of the area - * char a_type; Area subtype - * int a_flag; Flags - * char * a_id; Name - * }; - */ -struct area *areap; /* The pointer to the first - * area structure of a linked list - */ -struct area *ap; /* Pointer to the current - * area structure - */ - -/* - * An areax structure is created for every A directive found - * while reading the REL files. The struct areax contains a - * link to the 'unique' area structure referenced by the A - * directive and to the head structure this area segment is - * a part of. The size of this area segment as read from the - * A directive is placed in the areax structure. The beginning - * address of this segment will be filled in at the end of the - * first pass through the REL files. As A directives are read - * from the REL files a linked list of areax structures is - * created for each unique area. The final areax linked - * list has at its head the 'unique' area structure linked - * to the linked areax structures (one areax structure for - * each A directive for this area). - * - * struct areax - * { - * struct areax *a_axp; Area extension link - * struct area *a_bap; Base area link - * struct head *a_bhp; Base header link - * a_uint a_addr; Beginning address of section - * a_uint a_size; Size of the area in section - * }; - */ -struct areax *axp; /* Pointer to the current - * areax structure - */ - -/* - * A sym structure is created for every unique symbol - * referenced/defined while reading the REL files. The - * struct sym contains the symbol's name, a flag value - * (not used in this linker), a symbol type denoting - * referenced/defined, and an address which is loaded - * with the relative address within the area in which - * the symbol was defined. The sym structure also - * contains a link to the area where the symbol was defined. - * The sym structures are linked into linked lists using - * the symbol link element. - * - * struct sym - * { - * struct sym *s_sp; Symbol link - * struct areax *s_axp; Symbol area link - * char s_type; Symbol subtype - * char s_flag; Flag byte - * a_uint s_addr; Address - * char *s_id; Name (JLH) - * char *m_id; Module - * }; - */ -struct sym *symhash[NHASH]; /* array of pointers to NHASH - * linked symbol lists - */ -/* - * The struct base contains a pointer to a - * base definition string and a link to the next - * base structure. - * - * struct base - * { - * struct base *b_base; Base link - * char *b_strp; String pointer - * }; - */ -struct base *basep; /* The pointer to the first - * base structure - */ -struct base *bsp; /* Pointer to the current - * base structure - */ - -/* - * The struct globl contains a pointer to a - * global definition string and a link to the next - * global structure. - * - * struct globl - * { - * struct globl *g_globl; Global link - * char *g_strp; String pointer - * }; - */ -struct globl *globlp;/* The pointer to the first - * globl structure - */ -struct globl *gsp; /* Pointer to the current - * globl structure - */ - -/* - * A structure sdp is created for each 'unique' paged - * area definition found as the REL files are read. - * As P directives are read from the REL files a linked - * list of unique sdp structures is created by placing a - * link to the new sdp structure in the previous area structure. - * - * struct sdp - * { - * struct area *s_area; Paged Area link - * struct areax *s_areax; Paged Area Extension Link - * a_uint s_addr; Page address offset - * }; - */ -struct sdp sdp; /* Base Page Structure */ - -/* - * The structure rerr is loaded with the information - * required to report an error during the linking - * process. The structure contains an index value - * which selects the areax structure from the header - * areax structure list, a mode value which selects - * symbol or area relocation, the base address in the - * area section, an area/symbol list index value, and - * an area/symbol offset value. - * - * struct rerr - * { - * int aindex; Linking area - * int mode; Relocation mode - * a_uint rtbase; Base address in section - * int rindex; Area/Symbol relocation index - * a_uint rval; Area/Symbol offset value - * }; - */ -struct rerr rerr; /* Structure containing the - * linker error information - */ - -/* - * The structure lbpath is created for each library - * path specification input by the -k option. The - * lbpath structures are linked into a list using - * the next link element. - * - * struct lbpath { - * struct lbpath *next; - * char *path; - * }; - */ -struct lbpath *lbphead; /* pointer to the first - * library path structure - */ - -/* - * The structure lbname is created for all combinations of the - * library path specifications (input by the -k option) and the - * library file specifications (input by the -l option) that - * lead to an existing file. The element path points to - * the path string, element libfil points to the library - * file string, and the element libspc is the concatenation - * of the valid path and libfil strings. - * - * The lbpath structures are linked into a list - * using the next link element. - * - * Each library file contains a list of object files - * that are contained in the particular library. e.g.: - * - * \iolib\termio - * \inilib\termio - * - * Only one specification per line is allowed. - * - * struct lbname { - * struct lbname *next; - * char *path; - * char *libfil; - * char *libspc; - * }; - */ -struct lbname *lbnhead; /* pointer to the first - * library name structure - */ - -/* - * The function fndsym() searches through all combinations of the - * library path specifications (input by the -k option) and the - * library file specifications (input by the -l option) that - * lead to an existing file for a symbol definition. - * - * The structure lbfile is created for the first library - * object file which contains the definition for the - * specified undefined symbol. - * - * The element libspc points to the library file path specification - * and element relfil points to the object file specification string. - * The element filspc is the complete path/file specification for - * the library file to be imported into the linker. - * The file specification - * may be formed in one of two ways: - * - * (1) If the library file contained an absolute - * path/file specification then this becomes filspc. - * (i.e. C:\...) - * - * (2) If the library file contains a relative path/file - * specification then the concatenation of the path - * and this file specification becomes filspc. - * (i.e. \...) - * - * The lbpath structures are linked into a list - * using the next link element. - * - * struct lbfile { - * struct lbfile *next; - * char *libspc; - * char *relfil; - * char *filspc; - * }; - */ -struct lbfile *lbfhead; /* pointer to the first - * library file structure - */ -/* sdld 8015 specific */ +FILE *mfp = NULL; /* Map output file handle + */ +FILE *rfp = NULL; /* File handle for output + * address relocated ASxxxx + * listing file + */ +FILE *sfp = NULL; /* The file handle sfp points to the + * currently open file + */ +FILE *tfp = NULL; /* File handle for input + * ASxxxx listing file + */ + +/* + * The structures of head, bank, area, areax, and sym + * are created as the REL files are read during the first + * pass of the linker. The struct head is created upon + * encountering a H directive in the REL file. The + * structure contains a link to a link file structure + * (struct lfile) which describes the file containing the H + * directive, a pointer to an array of merge mode + * definition pointers, the number of data/code areas + * contained in this header segment, the number of + * symbols referenced/defined in this header segment, a pointer + * to an array of pointers to areax structures (struct areax) + * created as each A directive is read, a pointer to an + * array of pointers to symbol structures (struct sym) for + * all referenced/defined symbols and a pointer to an array + * of pointers to bank structures (struct bank) referenced + * by this module. As H directives are read + * from the REL files a linked list of head structures is + * created by placing a link to the new head structure + * in the previous head structure. + * + * struct head + * { + * struct head *h_hp; Header link + * struct lfile *h_lfile; Associated file + * int h_narea; # of areas + * struct areax **a_list; Area list + * int h_nsym; # of symbols + * struct sym **s_list; Symbol list + * int h_nbank; # of banks + * struct bank **b_list; Bank list + * int h_nmode; # of modes + * struct mode **m_list; Mode list + * char * m_id; Module name + * }; + */ +struct head *headp; /* The pointer to the first + * head structure of a linked list + */ +struct head *hp; /* Pointer to the current + * head structure + */ + +/* + * The bank structure contains the parameter values for a + * specific program or data bank. The bank structure + * is a linked list of banks. The initial default bank + * is unnamed and is defined in lkdata.c, the next bank structure + * will be linked to this structure through the structure + * element 'struct bank *b_bp'. The structure contains the + * bank name, the bank base address (default = 0) + * the bank size, (default = 0, whole addressing space) + * and the file name suffix. (default is none) These optional + * parameters are from the .bank assembler directive. + * The bank structure also contains the bank data output + * file specificatiion, file handle pointer and the + * bank first output flag. + * + * struct bank + * { + * struct bank *b_bp; Bank link + * char * b_id; Bank Name + * char * b_fsfx; Bank File Suffix + * a_uint b_base; Bank base address + * a_uint b_size; Bank size + * a_uint b_map Bank mapping + * int b_flag; Bank flags + * char * b_fspec; Bank File Specification + * FILE * b_ofp; Bank File Handle + * int b_oflag; Bank has output flag + * int b_rtaflg Bank First Output flag + * }; + */ +struct bank bank[1] = { + { NULL, "", "", 0, 0, 0, 0, "", NULL, 0, 1 } +}; + +struct bank *bankp = &bank[0]; + /* The pointer to the first + * bank structure + */ +struct bank *bp; /* Pointer to the current + * bank structure + */ + +/* + * A structure area is created for each 'unique' data/code + * area definition found as the REL files are read. The + * struct area contains the name of the area, a flag byte + * which contains the area attributes (REL/CON/OVR/ABS), + * the area base address set flag byte (-b option), and the + * area base address and total size which will be filled + * in at the end of the first pass through the REL files. + * The area structure also contains a link to the bank + * this area is a part of and a data output file handle + * pointer which is loaded from from the bank structure. + * As A directives are read from the REL files a linked + * list of unique area structures is created by placing a + * link to the new area structure in the previous area structure. + * + * struct area + * { + * struct area *a_ap; Area link + * struct areax *a_axp; Area extension link + * struct bank *a_bp; Bank link + * FILE * a_ofp; Area File Handle + * a_uint a_addr; Beginning address of area + * a_uint a_size; Total size of the area + * int a_bset; Area base address set + * int a_flag; Flags + * char * a_id; Name + * }; + */ +struct area *areap; /* The pointer to the first + * area structure of a linked list + */ +struct area *ap; /* Pointer to the current + * area structure + */ + +/* + * An areax structure is created for every A directive found + * while reading the REL files. The struct areax contains a + * link to the 'unique' area structure referenced by the A + * directive and to the head structure this area segment is + * a part of. The size of this area segment as read from the + * A directive is placed in the areax structure. The beginning + * address of this segment will be filled in at the end of the + * first pass through the REL files. As A directives are read + * from the REL files a linked list of areax structures is + * created for each unique area. The final areax linked + * list has at its head the 'unique' area structure linked + * to the linked areax structures (one areax structure for + * each A directive for this area). + * + * struct areax + * { + * struct areax *a_axp; Area extension link + * struct area *a_bap; Base area link + * struct head *a_bhp; Base header link + * a_uint a_addr; Beginning address of section + * a_uint a_size; Size of the area in section + * }; + */ +struct areax *axp; /* Pointer to the current + * areax structure + */ + +/* + * A sym structure is created for every unique symbol + * referenced/defined while reading the REL files. The + * struct sym contains the symbol's name, a flag value + * (not used in this linker), a symbol type denoting + * referenced/defined, and an address which is loaded + * with the relative address within the area in which + * the symbol was defined. The sym structure also + * contains a link to the area where the symbol was defined. + * The sym structures are linked into linked lists using + * the symbol link element. + * + * struct sym + * { + * struct sym *s_sp; Symbol link + * struct areax *s_axp; Symbol area link + * char s_type; Symbol subtype + * char s_flag; Flag byte + * a_uint s_addr; Address + * char *s_id; Name (JLH) + * char *m_id; Module + * }; + */ +struct sym *symhash[NHASH]; /* array of pointers to NHASH + * linked symbol lists + */ +/* + * The struct base contains a pointer to a + * base definition string and a link to the next + * base structure. + * + * struct base + * { + * struct base *b_base; Base link + * char *b_strp; String pointer + * }; + */ +struct base *basep; /* The pointer to the first + * base structure + */ +struct base *bsp; /* Pointer to the current + * base structure + */ + +/* + * The struct globl contains a pointer to a + * global definition string and a link to the next + * global structure. + * + * struct globl + * { + * struct globl *g_globl; Global link + * char *g_strp; String pointer + * }; + */ +struct globl *globlp;/* The pointer to the first + * globl structure + */ +struct globl *gsp; /* Pointer to the current + * globl structure + */ + +/* + * A structure sdp is created for each 'unique' paged + * area definition found as the REL files are read. + * As P directives are read from the REL files a linked + * list of unique sdp structures is created by placing a + * link to the new sdp structure in the previous area structure. + * + * struct sdp + * { + * struct area *s_area; Paged Area link + * struct areax *s_areax; Paged Area Extension Link + * a_uint s_addr; Page address offset + * }; + */ +struct sdp sdp; /* Base Page Structure */ + +/* + * The structure rerr is loaded with the information + * required to report an error during the linking + * process. The structure contains an index value + * which selects the areax structure from the header + * areax structure list, a mode value which selects + * symbol or area relocation, the base address in the + * area section, an area/symbol list index value, and + * an area/symbol offset value. + * + * struct rerr + * { + * int aindex; Linking area + * int mode; Relocation mode + * a_uint rtbase; Base address in section + * int rindex; Area/Symbol relocation index + * a_uint rval; Area/Symbol offset value + * }; + */ +struct rerr rerr; /* Structure containing the + * linker error information + */ + +/* + * The structure lbpath is created for each library + * path specification input by the -k option. The + * lbpath structures are linked into a list using + * the next link element. + * + * struct lbpath { + * struct lbpath *next; + * char *path; + * }; + */ +struct lbpath *lbphead; /* pointer to the first + * library path structure + */ + +/* + * The structure lbname is created for all combinations of the + * library path specifications (input by the -k option) and the + * library file specifications (input by the -l option) that + * lead to an existing file. The element path points to + * the path string, element libfil points to the library + * file string, and the element libspc is the concatenation + * of the valid path and libfil strings. + * + * The lbpath structures are linked into a list + * using the next link element. + * + * Each library file contains a list of object files + * that are contained in the particular library. e.g.: + * + * \iolib\termio + * \inilib\termio + * + * Only one specification per line is allowed. + * + * struct lbname { + * struct lbname *next; + * char *path; + * char *libfil; + * char *libspc; + * char f_obj; + * }; + */ +struct lbname *lbnhead; /* pointer to the first + * library name structure + */ + +/* + * The function fndsym() searches through all combinations of the + * library path specifications (input by the -k option) and the + * library file specifications (input by the -l option) that + * lead to an existing file for a symbol definition. + * + * The structure lbfile is created for the first library + * object file which contains the definition for the + * specified undefined symbol. + * + * The element libspc points to the library file path specification + * and element relfil points to the object file specification string. + * The element filspc is the complete path/file specification for + * the library file to be imported into the linker. The f_obj + * flag specifies if the object code from this file is + * to be output by the linker. The file specification + * may be formed in one of two ways: + * + * (1) If the library file contained an absolute + * path/file specification then this becomes filspc. + * (i.e. C:\...) + * + * (2) If the library file contains a relative path/file + * specification then the concatenation of the path + * and this file specification becomes filspc. + * (i.e. \...) + * + * The lbpath structures are linked into a list + * using the next link element. + * + * struct lbfile { + * struct lbfile *next; + * char *libspc; + * char *relfil; + * char *filspc; + * int f_obj; + * }; + */ +struct lbfile *lbfhead; /* pointer to the first + * library file structure + */ +/* sdld 8051 specific */ char idatamap[256]; -/* end sdld 8015 specific */ +/* end sdld 8051 specific */ /* - * array of character types, one per - * ASCII character + * array of character types, one per + * ASCII character */ char ctype[128] = { -/*NUL*/ ILL, ILL, ILL, ILL, ILL, ILL, ILL, ILL, -/*BS*/ ILL, SPACE, ILL, ILL, SPACE, ILL, ILL, ILL, -/*DLE*/ ILL, ILL, ILL, ILL, ILL, ILL, ILL, ILL, -/*CAN*/ ILL, ILL, ILL, ILL, ILL, ILL, ILL, ILL, -/*SPC*/ SPACE, ETC, ETC, ETC, LETTER, BINOP, BINOP, ETC, -/*(*/ ETC, ETC, BINOP, BINOP, ETC, BINOP, LETTER, BINOP, -/*0*/ DGT2, DGT2, DGT8, DGT8, DGT8, DGT8, DGT8, DGT8, -/*8*/ DGT10, DGT10, ETC, ETC, BINOP, ETC, BINOP, ETC, -/*@*/ ETC, LTR16, LTR16, LTR16, LTR16, LTR16, LTR16, LETTER, -/*H*/ LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, -/*P*/ LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, -/*X*/ LETTER, LETTER, LETTER, BINOP, ETC, ETC, BINOP, LETTER, -/*`*/ ETC, LTR16, LTR16, LTR16, LTR16, LTR16, LTR16, LETTER, -/*h*/ LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, -/*p*/ LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, -/*x*/ LETTER, LETTER, LETTER, ETC, BINOP, ETC, ETC, ETC +/*NUL*/ ILL, ILL, ILL, ILL, ILL, ILL, ILL, ILL, +/*BS*/ ILL, SPACE, ILL, ILL, SPACE, ILL, ILL, ILL, +/*DLE*/ ILL, ILL, ILL, ILL, ILL, ILL, ILL, ILL, +/*CAN*/ ILL, ILL, ILL, ILL, ILL, ILL, ILL, ILL, +/*SPC*/ SPACE, ETC, ETC, ETC, LETTER, BINOP, BINOP, ETC, +/*(*/ ETC, ETC, BINOP, BINOP, ETC, BINOP, LETTER, BINOP, +/*0*/ DGT2, DGT2, DGT8, DGT8, DGT8, DGT8, DGT8, DGT8, +/*8*/ DGT10, DGT10, ETC, ETC, BINOP, ETC, BINOP, ETC, +/*@*/ ETC, LTR16, LTR16, LTR16, LTR16, LTR16, LTR16, LETTER, +/*H*/ LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, +/*P*/ LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, +/*X*/ LETTER, LETTER, LETTER, BINOP, ETC, ETC, BINOP, LETTER, +/*`*/ ETC, LTR16, LTR16, LTR16, LTR16, LTR16, LTR16, LETTER, +/*h*/ LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, +/*p*/ LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, +/*x*/ LETTER, LETTER, LETTER, ETC, BINOP, ETC, ETC, ETC }; /* - * an array of characters which - * perform the case translation function + * an array of characters which + * perform the case translation function */ -char ccase[128] = { +char ccase[128] = { /*NUL*/ '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', -/*BS*/ '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', +/*BS*/ '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', /*DLE*/ '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', /*CAN*/ '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', /*SPC*/ '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', -/*(*/ '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', -/*0*/ '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', -/*8*/ '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', -/*@*/ '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', -/*H*/ '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', -/*P*/ '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', -/*X*/ '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', -/*`*/ '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', -/*h*/ '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', -/*p*/ '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', -/*x*/ '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177' +/*(*/ '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', +/*0*/ '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', +/*8*/ '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', +/*@*/ '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', +/*H*/ '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', +/*P*/ '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', +/*X*/ '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', +/*`*/ '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', +/*h*/ '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', +/*p*/ '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', +/*x*/ '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177' }; diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lkhead.c sdcc-3.2.0+dfsg/sdas/linksrc/lkhead.c --- sdcc-3.1.0+dfsg/sdas/linksrc/lkhead.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lkhead.c 2011-12-18 17:44:59.000000000 +0000 @@ -27,11 +27,13 @@ /*Module lkhead.c * * The module lkhead.c contains the function newhead() which - * creates a head structure and the function module() which - * loads the module name into the current head structure. + * creates a head structure, the function module() which + * loads the module name into the current head structure, + * and newmode() which loads the linker merge modes. * * lkhead.c contains the following functions: * VOID newhead() + * VOID newmode() * VOID module() * * lkhead.c contains no local variables. @@ -45,6 +47,7 @@ * * local variables: * int i evaluation value + * char id[] temporary string * head * thp temporary pointer * to a header structure * @@ -60,14 +63,20 @@ * * functions called: * a_uint expr() lkeval.c + * a_uint eval() lkeval.c + * VOID getid() lklex.c * VOID * new() lksym.c * VOID lkparea() lkarea.c + * int more() lklex.c + * int symeq() lksym.c * * side effects: * A new head structure is created and linked to any * existing linked head structure. The head structure - * parameters of file handle, number of areas, and number - * of global symbols are loaded into the structure. + * parameters of file handle, number of areas, number + * of global symbols, number of banks and number of + * merge modes are loaded into the structure. The + * area, bank, symbol, and mode structure lists are created. * The default area "_abs_" is created when the first * head structure is created and an areax structure is * created for every head structure called. @@ -76,16 +85,19 @@ /* * Create a new header entry. * - * H n areas n global symbols - * | | - * | `---- hp->h_nsym - * `------------ hp->h_narea + * H n areas n global symbols n banks n modes + * | | | | + * | | | `----- G Lines + * | | `------------- B Lines + * | `------------------------------ hp->h_nsym + * `-------------------------------------- hp->h_narea * */ VOID newhead() { int i; + char id[NCPS]; struct head *thp; hp = (struct head *) new (sizeof(struct head)); @@ -103,18 +115,45 @@ hp->h_lfile = cfp; /* Set file pointer */ hp->m_id = ""; /* No Module */ /* - * Evaluate and build Area pointer list + * Scan for Parameters */ - i = hp->h_narea = eval(); - if (i) - hp->a_list = (struct areax **) new (i*sizeof(struct areax *)); - /* - * Evaluate and build Global symbol pointer list - */ - skip(-1); - i = hp->h_nsym = eval(); - if (i) - hp->s_list = (struct sym **) new (i*sizeof(struct sym *)); + while (more()) { + i = (int) eval(); + getid(id, -1); + /* + * Area pointer list + */ + if (symeq("areas", id, 1)) { + hp->h_narea = i; + if (i) + hp->a_list = (struct areax **) new (i*sizeof(struct areax *)); + } else + /* + * Symbol pointer list + */ + if (symeq("global", id, 1)) { + hp->h_nsym = i; + if (i) + hp->s_list = (struct sym **) new (i*sizeof(struct sym *)); + skip(-1); + } else + /* + * Bank pointer list + */ + if (symeq("banks", id, 1)) { + hp->h_nbank = i; + if (i) + hp->b_list = (struct bank **) new (i*sizeof(struct bank *)); + } else + /* + * Mode pointer list + */ + if (symeq("modes", id, 1)) { + hp->h_nmode = i; + if (i) + hp->m_list = (struct mode **) new (i*sizeof(struct mode *)); + } + } /* * Setup Absolute DEF linkage. */ @@ -124,6 +163,116 @@ } +/*)Function VOID newmode() + * + * The function newmode() creates / fills in a merge mode + * definition for this module. + * + * The MODE structure contains the specification of one of the + * assemblers' relocation modes. Each assembler must specify + * at least one relocation mode. The relocation specification + * allows arbitrarily defined active bits and bit positions. + * The 32 element arrays are indexed from 0 to 31. + * Index 0 corresponds to bit 0, ..., and 31 corresponds to bit 31 + * of a normal integer value. + * + * The value an array element defines if the normal integer bit is + * active (bit <7> is set, 0x80) and what destination bit + * (bits <4:0>, 0 - 31) should be loaded with this normal + * integer bit. + * + * The mode structure also contains a flag indicating if bit + * positioning is required, a mask word containing the active + * bits for merging, and an address paging mask. + * + * local variables: + * int index bit index of mode definition + * int n counter + * struct mode *mp pointer to a mode structure + * + * global variables: + * head *headp The pointer to the first + * head structure of a linked list + * head *hp Pointer to the current + * head structure + * FILE * stderr standard library error handle + * + * functions called: + * a_uint eval() lkexpr.c + * int fprintf() c_library + * VOID lkexit() lkmain.c + * int more() lklex.c + * char * new() lksym.c + * + * side effects: + * The merge mode structure is created / updated with + * the definition values. + */ + +VOID +newmode() +{ + int index, n; + a_uint v; + struct mode *mp; + + if (headp == NULL) { + fprintf(stderr, "No header defined\n"); + lkexit(ER_FATAL); + } + /* + * Mode number + */ + n = (int) eval(); + if (n >= hp->h_nmode) { + fprintf(stderr, "Header mode list overflow\n"); + lkexit(ER_FATAL); + } + /* + * Bit index + */ + index = (int) eval(); + if (index == 0) { + mp = (struct mode *) new (sizeof(struct mode)); + hp->m_list[n] = mp; + /* + * Initialize Mode + */ + for (n=0; n<32; n++) { + mp->m_def[n] = n; + } + } else { + mp = hp->m_list[n]; + } + /* + * Load Bits + */ + while (more() && (index < 32)) { + n = (int) eval(); + if (mp->m_def[index] != (n & 0x1F)) { + mp->m_flag |= 1; + } + mp->m_def[index] = n; + if (n & 0x80) { + mp->m_dbits |= (((a_uint) 1) << (n & 0x1F)); + mp->m_sbits |= (((a_uint) 1) << index); + } + index += 1; + } + /* + * Set Missing Low Order Bits + */ + for (n=0; n<32; n++) { + v = 1 << n; + if (mp->m_sbits & v) { + break; + } else { + mp->m_sbits |= v; + } + } +} + + /*)Function VOID module() * * The function module() copies the module name into diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lklex.c sdcc-3.2.0+dfsg/sdas/linksrc/lklex.c --- sdcc-3.1.0+dfsg/sdas/linksrc/lklex.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lklex.c 2011-12-18 17:44:59.000000000 +0000 @@ -24,650 +24,646 @@ #include "aslink.h" -/*)Module lklex.c +/*)Module lklex.c * - * The module lklex.c contains the general lexical analysis - * functions used to scan the text lines from the .rel files. + * The module lklex.c contains the general lexical analysis + * functions used to scan the text lines from the .rel files. * - * lklex.c contains the following functions: - * VOID chopcrlf() - * char endline() - * int get() - * VOID getfid() - * VOID getid() - * VOID getSid() - * int getmap() - * int getnb() - * int more() - * int nxtline() - * VOID skip() - * VOID unget() - * - * lklex.c contains no local variables. - */ - -/*)Function VOID getid(id,c) - * - * char * id a pointer to a string of - * maximum length NCPS-1 - * int c mode flag - * >=0 this is first character to - * copy to the string buffer - * <0 skip white space - * - * The function getid() scans the current input text line - * from the current position copying the next LETTER | DIGIT string - * into the external string buffer (id). The string ends when a non - * LETTER or DIGIT character is found. The maximum number of characters - * copied is NCPS-1. If the input string is larger than NCPS-1 - * characters then the string is truncated. The string is always - * NULL terminated. If the mode argument (c) is >=0 then (c) is - * the first character copied to the string buffer, if (c) is <0 - * then intervening white space (SPACES and TABS) are skipped. - * - * local variables: - * char * p pointer to external string buffer - * int c current character value - * - * global variables: - * char ctype[] a character array which defines the - * type of character being processed. - * This index is the character - * being processed. - * - * called functions: - * int get() lklex.c - * int getnb() lklex.c - * VOID unget() lklex.c - * - * side effects: - * use of getnb(), get(), and unget() updates the - * global pointer ip the position in the current - * input text line. + * lklex.c contains the following functions: + * VOID chopcrlf() + * char endline() + * int get() + * VOID getfid() + * VOID getid() + * VOID getSid() + * int getmap() + * int getnb() + * int more() + * int nxtline() + * VOID skip() + * VOID unget() + * + * lklex.c contains no local variables. + */ + +/*)Function VOID getid(id,c) + * + * char * id a pointer to a string of + * maximum length NCPS-1 + * int c mode flag + * >=0 this is first character to + * copy to the string buffer + * <0 skip white space + * + * The function getid() scans the current input text line + * from the current position copying the next LETTER | DIGIT string + * into the external string buffer (id). The string ends when a non + * LETTER or DIGIT character is found. The maximum number of characters + * copied is NCPS-1. If the input string is larger than NCPS-1 + * characters then the string is truncated. The string is always + * NULL terminated. If the mode argument (c) is >=0 then (c) is + * the first character copied to the string buffer, if (c) is <0 + * then intervening white space (SPACES and TABS) are skipped. + * + * local variables: + * char * p pointer to external string buffer + * int c current character value + * + * global variables: + * char ctype[] a character array which defines the + * type of character being processed. + * This index is the character + * being processed. + * + * called functions: + * int get() lklex.c + * int getnb() lklex.c + * VOID unget() lklex.c + * + * side effects: + * use of getnb(), get(), and unget() updates the + * global pointer ip the position in the current + * input text line. */ VOID -getid(id, c) -int c; -char *id; +getid(char *id, int c) { - char *p; + char *p; - if (c < 0) { - c = getnb(); - } - p = id; - do { - if (p < &id[NCPS-1]) - *p++ = c; - } while (ctype[c=get()] & (LETTER|DIGIT)); - unget(c); - *p++ = 0; + if (c < 0) { + c = getnb(); + } + p = id; + do { + if (p < &id[NCPS-1]) + *p++ = c; + } while (ctype[c=get()] & (LETTER|DIGIT)); + unget(c); + *p++ = 0; } -/*)Function VOID getSid (char *id) +/*)Function VOID getSid (char *id) * - * char * id a pointer to a string of - * maximum length NCPS-1 + * char * id a pointer to a string of + * maximum length NCPS-1 * * getSid is derived from getid. It is called from newsym() * in lksym.c, when an S-record has to be scanned. getSid accepts * much more characters than getid, which is necessary for SDCC. * - * The function getSid() scans the current input text line - * from the current position copying the next string - * into the external string buffer (id). The string ends when a space - * character (space, tab, \0) is found. The maximum number of - * characters copied is NCPS. If the input string is larger than - * NCPS characters then the string is truncated, if the input string - * is shorter than NCPS characters then the string is NULL filled. - * Intervening white space (SPACES and TABS) are skipped. - * - * local variables: - * char * p pointer to external string buffer - * int c current character value - * - * global variables: - * char ctype[] a character array which defines the - * type of character being processed. - * This index is the character - * being processed. - * - * called functions: - * int get() lklex.c - * int getnb() lklex.c - * VOID unget() lklex.c - * - * side effects: - * use of getnb(), get(), and unget() updates the - * global pointer ip the position in the current - * input text line. + * The function getSid() scans the current input text line + * from the current position copying the next string + * into the external string buffer (id). The string ends when a space + * character (space, tab, \0) is found. The maximum number of + * characters copied is NCPS. If the input string is larger than + * NCPS characters then the string is truncated, if the input string + * is shorter than NCPS characters then the string is NULL filled. + * Intervening white space (SPACES and TABS) are skipped. + * + * local variables: + * char * p pointer to external string buffer + * int c current character value + * + * global variables: + * none + * + * called functions: + * int get() lklex.c + * int getnb() lklex.c + * VOID unget() lklex.c + * + * side effects: + * use of getnb(), get(), and unget() updates the + * global pointer ip the position in the current + * input text line. */ VOID getSid (char *id) { - int c; - char *p; + int c; + char *p; - c = getnb(); - p = id; - do { - if (p < &id[NCPS-1]) - *p++ = c; - c = get(); - } while (c != '\0' && c != ' ' && c != '\t'); - unget(c); - *p++ = 0; -} - -/*)Function VOID getfid(str,c) - * - * char * str a pointer to a string of - * maximum length FILSPC-1 - * int c this is first character to - * copy to the string buffer - * - * asxxxx version: - * - * The function getfid() copies a string of characters from - * the current text line into the external string buffer (str). - * The maximum number of characters copied is FILSPC-1. The - * string is terminated by a 'space', 'tab' or end of string. - * - * sdld version: - * - * The function getfid() scans the current input text line from - * the current position copying the next string into the external - * string buffer (str). The string ends when end of line is found. - * Trailing spaces are removed. The maximum number of characters - * copied is FILSPC-1. If the input string is larger than FILSPC-1 - * characters then the string is truncated. The string is NULL - * terminated. - * - * local variables: - * char * p pointer to external string buffer - * int c current character value - * - * global variables: - * char ctype[] a character array which defines the - * type of character being processed. - * This index is the character - * being processed. - * - * called functions: - * int get() lklex.c - * - * side effects: - * use of get() updates the global pointer ip - * the position in the current input text line. + c = getnb(); + p = id; + do { + if (p < &id[NCPS-1]) + *p++ = c; + c = get(); + } while (c != '\0' && c != ' ' && c != '\t'); + unget(c); + *p++ = 0; +} + +/*)Function VOID getfid(str,c) + * + * char * str a pointer to a string of + * maximum length FILSPC-1 + * int c this is first character to + * copy to the string buffer + * + * asxxxx version: + * + * The function getfid() copies a string of characters from + * the current text line into the external string buffer (str). + * The maximum number of characters copied is FILSPC-1. The + * string is terminated by a 'space', 'tab' or end of string. + * + * sdld version: + * + * The function getfid() scans the current input text line from + * the current position copying the next string into the external + * string buffer (str). The string ends when end of line is found. + * Trailing spaces are removed. The maximum number of characters + * copied is FILSPC-1. If the input string is larger than FILSPC-1 + * characters then the string is truncated. The string is NULL + * terminated. + * + * local variables: + * char * p pointer to external string buffer + * int c current character value + * + * global variables: + * char ctype[] a character array which defines the + * type of character being processed. + * This index is the character + * being processed. + * + * called functions: + * int get() lklex.c + * + * side effects: + * use of get() updates the global pointer ip + * the position in the current input text line. */ VOID -getfid(str, c) -int c; -char *str; +getfid(char *str, int c) { - char *p; + char *p; - p = str; - if (!is_sdld()) { - do { - if (p < &str[FILSPC-1]) - *p++ = c; - c = get(); - } while ((c != 0) && (c != ' ') && (c != '\t')); - *p++ = 0; - } - else { - do { - if (p < &str[FILSPC-1]) - *p++ = c; - c = get(); - /* skip comment */ - if (c == ';') - while (c) - c = get(); - } while (c); - /* trim trailing spaces */ - --p; - while (p >= str && ctype[(int)*p] == SPACE) - --p; - /* terminate the string */ - *(++p) = '\0'; - } -} - -/*)Function int getnb() - * - * The function getnb() scans the current input text - * line returning the first character not a SPACE or TAB. - * - * local variables: - * int c current character from input - * - * global variables: - * none - * - * called functions: - * int get() lklex.c - * - * side effects: - * use of get() updates the global pointer ip, the position - * in the current input text line + p = str; + if (!is_sdld()) { + do { + if (p < &str[FILSPC-1]) + *p++ = c; + c = get(); + } while ((c != 0) && (c != ' ') && (c != '\t')); + *p++ = 0; + } + else { + do { + if (p < &str[FILSPC-1]) + *p++ = c; + c = get(); + /* skip comment */ + if (c == ';') + while (c) + c = get(); + } while (c); + /* trim trailing spaces */ + --p; + while (p >= str && ctype[*p & 0x007F] == SPACE) + --p; + /* terminate the string */ + *(++p) = '\0'; + } +} + +/*)Function int getnb() + * + * The function getnb() scans the current input text + * line returning the first character not a SPACE or TAB. + * + * local variables: + * int c current character from input + * + * global variables: + * none + * + * called functions: + * int get() lklex.c + * + * side effects: + * use of get() updates the global pointer ip, the position + * in the current input text line */ int getnb() { - int c; + int c; - while ((c=get())==' ' || c=='\t') - ; - return (c); + while ((c=get())==' ' || c=='\t') + ; + return (c); } -/*)Function VOID skip(c) +/*)Function VOID skip(c) * - * The function skip() scans the input text skipping all - * letters and digits. + * The function skip() scans the input text skipping all + * letters and digits. * - * local variables: - * int c last character read - * none + * local variables: + * int c last character read + * none * - * global variables: - * char ctype[] array of character types, one per - * ASCII character + * global variables: + * char ctype[] array of character types, one per + * ASCII character * - * functions called: - * int get() lklex.c - * int getnb() lklex.c - * VOID unget() lklex.c + * functions called: + * int get() lklex.c + * int getnb() lklex.c + * VOID unget() lklex.c * - * side effects: - * Input letters and digits are skipped. + * side effects: + * Input letters and digits are skipped. */ VOID skip(c) int c; { - if (c < 0) - c = getnb(); - while (ctype[c=get()] & (LETTER|DIGIT)) { ; } - unget(c); + if (c < 0) + c = getnb(); + while (ctype[c=get()] & (LETTER|DIGIT)) { ; } + unget(c); } -/*)Function int get() +/*)Function int get() * - * The function get() returns the next character in the - * input text line, at the end of the line a - * NULL character is returned. + * The function get() returns the next character in the + * input text line, at the end of the line a + * NULL character is returned. * - * local variables: - * int c current character from - * input text line + * local variables: + * int c current character from + * input text line * - * global variables: - * char * ip pointer into the current - * input text line + * global variables: + * char * ip pointer into the current + * input text line * - * called functions: - * none + * called functions: + * none * - * side effects: - * updates ip to the next character position in the - * input text line. If ip is at the end of the - * line, ip is not updated. + * side effects: + * updates ip to the next character position in the + * input text line. If ip is at the end of the + * line, ip is not updated. */ int get() { - int c; + int c; - if ((c = *ip) != 0) - ++ip; - return (c); + if ((c = *ip) != 0) + ++ip; + return (c & 0x007F); } -/*)Function VOID unget(c) +/*)Function VOID unget(c) * - * int c value of last character - * read from input text line + * int c value of last character + * read from input text line * - * If (c) is not a NULL character then the global pointer ip - * is updated to point to the preceeding character in the - * input text line. + * If (c) is not a NULL character then the global pointer ip + * is updated to point to the preceeding character in the + * input text line. * - * NOTE: This function does not push the character (c) - * back into the input text line, only - * the pointer ip is changed. + * NOTE: This function does not push the character (c) + * back into the input text line, only + * the pointer ip is changed. * - * local variables: - * int c last character read - * from input text line + * local variables: + * int c last character read + * from input text line * - * global variables: - * char * ip position into the current - * input text line + * global variables: + * char * ip position into the current + * input text line * - * called functions: - * none + * called functions: + * none * - * side effects: - * ip decremented by 1 character position + * side effects: + * ip decremented by 1 character position */ VOID unget(c) int c; { - if (c != 0) - --ip; + if (c != 0) + --ip; } -/*)Function int getmap(d) +/*)Function int getmap(d) * - * int d value to compare with the - * input text line character + * int d value to compare with the + * input text line character * - * The function getmap() converts the 'C' style characters \b, \f, - * \n, \r, and \t to their equivalent ascii values and also - * converts 'C' style octal constants '\123' to their equivalent - * numeric values. If the first character is equivalent to (d) then - * a (-1) is returned, if the end of the line is detected then - * a 'q' error terminates the parse for this line, or if the first - * character is not a \ then the character value is returned. - * - * local variables: - * int c value of character - * from input text line - * int n looping counter - * int v current value of numeric conversion - * - * global variables: - * none - * - * called functions: - * int get() lklex.c - * VOID unget() lklex.c - * - * side effects: - * use of get() updates the global pointer ip the position - * in the current input text line + * The function getmap() converts the 'C' style characters \b, \f, + * \n, \r, and \t to their equivalent ascii values and also + * converts 'C' style octal constants '\123' to their equivalent + * numeric values. If the first character is equivalent to (d) then + * a (-1) is returned, if the end of the line is detected then + * a 'q' error terminates the parse for this line, or if the first + * character is not a \ then the character value is returned. + * + * local variables: + * int c value of character + * from input text line + * int n looping counter + * int v current value of numeric conversion + * + * global variables: + * none + * + * called functions: + * int get() lklex.c + * VOID unget() lklex.c + * + * side effects: + * use of get() updates the global pointer ip the position + * in the current input text line */ int getmap(d) int d; { - int c, n, v; + int c, n, v; - if ((c = get()) == '\0') - return (-1); - if (c == d) - return (-1); - if (c == '\\') { - c = get(); - switch (c) { - - case 'b': - c = '\b'; - break; - - case 'f': - c = '\f'; - break; - - case 'n': - c = '\n'; - break; - - case 'r': - c = '\r'; - break; - - case 't': - c = '\t'; - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - n = 0; - v = 0; - while (++n<=3 && c>='0' && c<='7') { - v = (v<<3) + c - '0'; - c = get(); - } - unget(c); - c = v; - break; - } - } - return (c); -} - -/*)Function int nxtline() - * - * The function nxtline() reads a line of input text from a - * .rel source text file, a .lnk command file or from stdin. - * Lines of text are processed from a single .lnk file or - * multiple .rel files until all files have been read. - * The input text line is copied into the global string ib[] - * and converted to a NULL terminated string. The function - * nxtline() returns a (1) after succesfully reading a line - * or a (0) if all files have been read. - * This function also opens each input .lst file and output - * .rst file as each .rel file is processed. - * - * local variables: - * int ftype file type - * char * fid file name - * - * global variables: - * lfile *cfp The pointer *cfp points to the - * current lfile structure - * lfile *filep The pointer *filep points to the - * beginning of a linked list of - * lfile structures. - * int gline get a line from the LST file - * to translate for the RST file - * char ib[NINPUT] REL file text line - * int pass linker pass number - * int pflag print linker command file flag - * FILE *rfp The file handle to the current - * output RST file - * FILE *sfp The file handle sfp points to the - * currently open file - * FILE * stdin c_library - * FILE * stdout c_library - * FILE *tfp The file handle to the current - * LST file being scanned - * int uflag update listing flag - * - * called functions: - * VOID chopcrlf() lklex.c - * FILE * afile() lkmain.c - * int fclose() c_library - * char * fgets() c_library - * int fprintf() c_library - * VOID lkulist() lklist.c - * VOID lkexit() lkmain.c - * - * side effects: - * The input stream is scanned. The .rel files will be - * opened and closed sequentially scanning each in turn. + if ((c = get()) == '\0') + return (-1); + if (c == d) + return (-1); + if (c == '\\') { + c = get(); + switch (c) { + + case 'b': + c = '\b'; + break; + + case 'f': + c = '\f'; + break; + + case 'n': + c = '\n'; + break; + + case 'r': + c = '\r'; + break; + + case 't': + c = '\t'; + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + n = 0; + v = 0; + while (++n<=3 && c>='0' && c<='7') { + v = (v<<3) + c - '0'; + c = get(); + } + unget(c); + c = v; + break; + } + } + return (c); +} + +/*)Function int nxtline() + * + * The function nxtline() reads a line of input text from a + * .rel source text file, a .lnk command file or from stdin. + * Lines of text are processed from a single .lnk file or + * multiple .rel files until all files have been read. + * The input text line is copied into the global string ib[] + * and converted to a NULL terminated string. The function + * nxtline() returns a (1) after succesfully reading a line + * or a (0) if all files have been read. + * This function also opens each input .lst file and output + * .rst file as each .rel file is processed. + * + * local variables: + * int ftype file type + * char * fid file name + * + * global variables: + * lfile *cfp The pointer *cfp points to the + * current lfile structure + * lfile *filep The pointer *filep points to the + * beginning of a linked list of + * lfile structures. + * int gline get a line from the LST file + * to translate for the RST file + * char ib[NINPUT] REL file text line + * int pass linker pass number + * int pflag print linker command file flag + * FILE *rfp The file handle to the current + * output RST file + * FILE *sfp The file handle sfp points to the + * currently open file + * FILE * stdin c_library + * FILE * stdout c_library + * FILE *tfp The file handle to the current + * LST file being scanned + * int uflag update listing flag + * int obj_flag linked file/library object output flag + * + * called functions: + * VOID chopcrlf() lklex.c + * FILE * afile() lkmain.c + * int fclose() c_library + * char * fgets() c_library + * int fprintf() c_library + * VOID lkulist() lklist.c + * VOID lkexit() lkmain.c + * + * side effects: + * The input stream is scanned. The .rel files will be + * opened and closed sequentially scanning each in turn. */ int nxtline() { - int ftype; - char *fid; + int ftype; + char *fid; -loop: if (pflag && cfp && cfp->f_type == F_STD) - fprintf(stdout, "ASlink >> "); +loop: if (pflag && cfp && cfp->f_type == F_STD) + fprintf(stdout, "ASlink >> "); - if (sfp == NULL || fgets(ib, sizeof(ib), sfp) == NULL) { - if (sfp) { - if(sfp != stdin) { - fclose(sfp); - } - sfp = NULL; - lkulist(0); - } - if (cfp == NULL) { - cfp = filep; - } else { - cfp = cfp->f_flp; - } - if (cfp) { - ftype = cfp->f_type; - fid = cfp->f_idp; - if (ftype == F_STD) { - sfp = stdin; - } else - if (ftype == F_LNK) { - sfp = afile(fid, strrchr(fid, FSEPX) ? "" : "lk", 0); - } else - if (ftype == F_REL) { - sfp = afile(fid, "", 0); - if (sfp) { - if (uflag && (pass != 0)) { - if (is_sdld()) - SaveLinkedFilePath(fid); //Save the linked path for aomf51 - if ((tfp = afile(fid, "lst", 0)) != NULL) { - if ((rfp = afile(fid, "rst", 1)) == NULL) { - fclose(tfp); - tfp = NULL; - } - } - } - } + if (sfp == NULL || fgets(ib, sizeof(ib), sfp) == NULL) { + obj_flag = 0; + if (sfp) { + if(sfp != stdin) { + fclose(sfp); + } + sfp = NULL; + lkulist(0); + } + if (cfp == NULL) { + cfp = filep; + } else { + cfp = cfp->f_flp; + } + if (cfp) { + ftype = cfp->f_type; + fid = cfp->f_idp; + if (ftype == F_STD) { + sfp = stdin; + } else + if (ftype == F_LNK) { + sfp = afile(fid, strrchr(fid, FSEPX) ? "" : "lnk", 0); + } else + if (ftype == F_REL) { + obj_flag = cfp->f_obj; + sfp = afile(fid, "", 0); + if (sfp && (obj_flag == 0)) { + if (uflag && (pass != 0)) { + if (is_sdld()) + SaveLinkedFilePath(fid); //Save the linked path for aomf51 + if ((tfp = afile(fid, "lst", 0)) != NULL) { + if ((rfp = afile(fid, "rst", 1)) == NULL) { + fclose(tfp); + tfp = NULL; + } + } + } + } #if SDCDB - if (sfp && (pass == 0)) { - SDCDBcopy(fid); - } + if (sfp && (pass == 0)) { + SDCDBcopy(fid); + } #endif - gline = 1; - } else { - fprintf(stderr, "Invalid file type\n"); - lkexit(ER_FATAL); - } - if (sfp == NULL) { - lkexit(ER_FATAL); - } - goto loop; - } else { - filep = NULL; - return(0); - } - } - chopcrlf(ib); - return (1); -} - -/*)Function int more() - * - * The function more() scans the input text line - * skipping white space (SPACES and TABS) and returns a (0) - * if the end of the line or a comment delimeter (;) is found, - * or a (1) if their are additional characters in the line. - * - * local variables: - * int c next character from - * the input text line - * - * global variables: - * none - * - * called functions: - * int getnb() lklex.c - * VOID unget() lklex.c - * - * side effects: - * use of getnb() and unget() updates the global pointer ip - * the position in the current input text line + gline = 1; + } else { + fprintf(stderr, "Invalid file type\n"); + lkexit(ER_FATAL); + } + if (sfp == NULL) { + lkexit(ER_FATAL); + } + goto loop; + } else { + filep = NULL; + return(0); + } + } + chopcrlf(ib); + return (1); +} + +/*)Function int more() + * + * The function more() scans the input text line + * skipping white space (SPACES and TABS) and returns a (0) + * if the end of the line or a comment delimeter (;) is found, + * or a (1) if their are additional characters in the line. + * + * local variables: + * int c next character from + * the input text line + * + * global variables: + * none + * + * called functions: + * int getnb() lklex.c + * VOID unget() lklex.c + * + * side effects: + * use of getnb() and unget() updates the global pointer ip + * the position in the current input text line */ int more() { - int c; + int c; - c = getnb(); - unget(c); - return( (c == '\0' || c == ';') ? 0 : 1 ); + c = getnb(); + unget(c); + return( (c == '\0' || c == ';') ? 0 : 1 ); } -/*)Function char endline() +/*)Function char endline() * - * The function endline() scans the input text line - * skipping white space (SPACES and TABS) and returns the next - * character or a (0) if the end of the line is found or a - * comment delimiter (;) is found. + * The function endline() scans the input text line + * skipping white space (SPACES and TABS) and returns the next + * character or a (0) if the end of the line is found or a + * comment delimiter (;) is found. * - * local variables: - * int c next character from - * the input text line + * local variables: + * int c next character from + * the input text line * - * global variables: - * none + * global variables: + * none * - * called functions: - * int getnb() lklex.c + * called functions: + * int getnb() lklex.c * - * side effects: - * Use of getnb() updates the global pointer ip the - * position in the current input text line. + * side effects: + * Use of getnb() updates the global pointer ip the + * position in the current input text line. */ char endline() { - int c; + int c; - c = getnb(); - return( (c == '\0' || c == ';') ? 0 : c ); + c = getnb(); + return( (c == '\0' || c == ';') ? 0 : c ); } -/*)Function VOID chopcrlf(str) +/*)Function VOID chopcrlf(str) * - * char *str string to chop + * char *str string to chop * - * The function chop_crlf() removes trailing LF or CR/LF from - * str, if present. + * The function chop_crlf() removes trailing LF or CR/LF from + * str, if present. * - * local variables: - * int i string length + * local variables: + * int i string length * - * global variables: - * none + * global variables: + * none * - * functions called: - * none + * functions called: + * none * - * side effects: - * none + * side effects: + * none */ VOID chopcrlf(str) char *str; { - int i; + int i; - i = strlen(str); - if (i >= 1 && str[i-1] == '\n') str[i-1] = 0; - if (i >= 2 && str[i-2] == '\r') str[i-2] = 0; + i = strlen(str); + if (i >= 1 && str[i-1] == '\n') str[i-1] = 0; + if (i >= 2 && str[i-2] == '\r') str[i-2] = 0; } diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lklibr.c sdcc-3.2.0+dfsg/sdas/linksrc/lklibr.c --- sdcc-3.1.0+dfsg/sdas/linksrc/lklibr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lklibr.c 2011-12-03 23:42:25.000000000 +0000 @@ -198,8 +198,9 @@ * char * strend end of path pointer * * global variables: - * lbname *lbnhead The pointer to the first - * path structure + * lbname *lbnhead The pointer to the first + * path structure + * int objflg linked file/library object output flag * * functions called: * int getnb() lklex.c @@ -316,6 +317,7 @@ lbnh->path = path; lbnh->libfil = strdup (libfil); lbnh->libspc = str; + lbnh->f_obj = objflg; return 1; } else @@ -444,6 +446,7 @@ * name structure * lbfile *lbfhead The pointer to the first * file structure + * int obj_flag linked file/library object output flag * * functions called: * int fclose() c_library @@ -828,6 +831,7 @@ * * global variables: * lbfile *lbfhead pointer to first lbfile structure + * int obj_flag linked file/library object output flag * * functions called: * VOID loadfile lklibr.c @@ -841,8 +845,10 @@ { struct lbfile *lbfh; - for (lbfh = lbfhead; lbfh; lbfh = lbfh->next) + for (lbfh = lbfhead; lbfh; lbfh = lbfh->next) { + obj_flag = lbfh->f_obj; (*aslib_targets[lbfh->type]->loadfile) (lbfh); + } #ifdef INDEXLIB freelibraryindex (); diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lklist.c sdcc-3.2.0+dfsg/sdas/linksrc/lklist.c --- sdcc-3.1.0+dfsg/sdas/linksrc/lklist.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lklist.c 2011-12-18 17:44:59.000000000 +0000 @@ -25,306 +25,301 @@ /* * 28-Oct-97 JLH: - * - lstarea: show s_id as string rather than array [NCPS] - * - lstarea: show a_id as string rather than array [NCPS] + * - lstarea: show s_id as string rather than array [NCPS] + * - lstarea: show a_id as string rather than array [NCPS] * 31-Oct-97 JLH: add NoICE output file genration in lstarea * 02-Apr-98 JLH: add XDATA, DATA, BIT flags to area output */ #include "aslink.h" -/*)Module lklist.c +/*)Module lklist.c * - * The module lklist.c contains the functions which - * output the linker .map file and produce a relocated - * listing .rst file. - * - * lklist.c contains the following functions: - * int dgt() - * VOID newpag() - * VOID slew() - * VOID lstarea() - * VOID lkulist() - * VOID lkalist() - * VOID lkglist() + * The module lklist.c contains the functions which + * output the linker .map file and produce a relocated + * listing .rst file. + * + * lklist.c contains the following functions: + * int dgt() + * VOID newpag() + * VOID slew() + * VOID lstarea() + * VOID lkulist() + * VOID lkalist() + * VOID lkglist() * - * lklist.c contains no local variables. + * lklist.c contains no local variables. */ -/*)Function VOID newpag() +/*)Function VOID newpag() * - * The function newpag() outputs a page skip, writes the - * first page header line, sets the line count to 1, and - * increments the page counter. + * The function newpag() outputs a page skip, writes the + * first page header line, sets the line count to 1, and + * increments the page counter. * - * local variables: - * none + * local variables: + * none * - * global variables: - * int lop current line number on page - * int page current page number + * global variables: + * int lop current line number on page + * int page current page number * - * functions called: - * int fprintf() c_library + * functions called: + * int fprintf() c_library * - * side effects: - * The page and line counters are updated. + * side effects: + * The page and line counters are updated. */ VOID newpag(FILE *fp) { - fprintf(fp, "\fASxxxx Linker %s, page %u.\n", VERSION, ++page); - lop = 1; + fprintf(fp, "\fASxxxx Linker %s, page %u.\n", VERSION, ++page); + lop = 1; } -/*)Function int dgt(rdx,str,n) +/*)Function int dgt(rdx,str,n) * - * int rdx radix bit code - * char *str pointer to the test string - * int n number of characters to check + * int rdx radix bit code + * char *str pointer to the test string + * int n number of characters to check * - * The function dgt() verifies that the string under test - * is of the specified radix. + * The function dgt() verifies that the string under test + * is of the specified radix. * - * local variables: - * int i loop counter + * local variables: + * int i loop counter * - * global variables: - * ctype[] array of character types + * global variables: + * ctype[] array of character types * - * functions called: - * none + * functions called: + * none * - * side effects: - * none + * side effects: + * none */ int dgt(int rdx, char *str, int n) { - int i; + int i; - for (i=0; i= NLPP) { - newpag(mfp); - switch(xflag) { - default: - case 0: frmta = "Hexadecimal"; break; - case 1: frmta = "Octal"; break; - case 2: frmta = "Decimal"; break; - } - fprintf(mfp, "%s [%d-Bits]\n", frmta, a_bytes*8); - fprintf(mfp, "\n"); - if (wflag) { - fprintf(mfp, - "Area Addr"); - fprintf(mfp, - " Size Decimal Bytes (Attributes)\n"); - fprintf(mfp, - "-------------------------------- ----"); - fprintf(mfp, - " ---- ------- ----- ------------\n"); - } else { - fprintf(mfp, - "Area Addr "); - fprintf(mfp, - " Size Decimal Bytes (Attributes)\n"); - fprintf(mfp, - "-------------------- ---- "); - fprintf(mfp, - " ---- ------- ----- ------------\n"); - } - - ai = xp->a_addr; - aj = xp->a_size; - - /* - * Output Area Header - */ - ptr = &xp->a_id[0]; - if (wflag) { - fprintf(mfp, "%-32.32s", ptr); - } else { - fprintf(mfp, "%-19.19s", ptr); - } -#ifdef LONGINT - switch(a_bytes) { - default: - case 2: - switch(xflag) { - default: - case 0: frmta = " %04lX %04lX"; break; - case 1: frmta = " %06lo %06lo"; break; - case 2: frmta = " %05lu %05lu"; break; - } - frmtb = " = %6lu. bytes "; break; - case 3: - switch(xflag) { - default: - case 0: frmta = " %06lX %06lX"; break; - case 1: frmta = " %08lo %08lo"; break; - case 2: frmta = " %08lu %08lu"; break; - } - frmtb = " = %8lu. bytes "; break; - case 4: - switch(xflag) { - default: - case 0: frmta = " %08lX %08lX"; break; - case 1: frmta = " %011lo %011lo"; break; - case 2: frmta = " %010lu %010lu"; break; - } - frmtb = " = %10lu. bytes "; break; - } + int i, n; + char *frmta, *frmtb, *ptr; + a_uint ai, aj; + + if (lop++ >= NLPP) { + newpag(mfp); + switch(xflag) { + default: + case 0: frmta = "Hexadecimal"; break; + case 1: frmta = "Octal"; break; + case 2: frmta = "Decimal"; break; + } + fprintf(mfp, "%s [%d-Bits]\n", frmta, a_bytes*8); + if (*yp->b_id) { + fprintf(mfp, "[ Bank == %s ]\n", yp->b_id); + lop += 1; + } + fprintf(mfp, "\n"); + if (wflag) { + fprintf(mfp, + "Area Addr"); + fprintf(mfp, + " Size Decimal Bytes (Attributes)\n"); + fprintf(mfp, + "-------------------------------- ----"); + fprintf(mfp, + " ---- ------- ----- ------------\n"); + } else { + fprintf(mfp, + "Area Addr "); + fprintf(mfp, + " Size Decimal Bytes (Attributes)\n"); + fprintf(mfp, + "-------------------- ---- "); + fprintf(mfp, + " ---- ------- ----- ------------\n"); + } + + ai = xp->a_addr & a_mask; + aj = xp->a_size & a_mask; + + /* + * Output Area Header + */ + ptr = &xp->a_id[0]; + if (wflag) { + fprintf(mfp, "%-32.32s", ptr); + } else { + fprintf(mfp, "%-19.19s", ptr); + } +#ifdef LONGINT + switch(a_bytes) { + default: + case 2: + switch(xflag) { + default: + case 0: frmta = " %04lX %04lX"; break; + case 1: frmta = " %06lo %06lo"; break; + case 2: frmta = " %05lu %05lu"; break; + } + frmtb = " = %6lu. bytes "; break; + case 3: + switch(xflag) { + default: + case 0: frmta = " %06lX %06lX"; break; + case 1: frmta = " %08lo %08lo"; break; + case 2: frmta = " %08lu %08lu"; break; + } + frmtb = " = %8lu. bytes "; break; + case 4: + switch(xflag) { + default: + case 0: frmta = " %08lX %08lX"; break; + case 1: frmta = " %011lo %011lo"; break; + case 2: frmta = " %010lu %010lu"; break; + } + frmtb = " = %10lu. bytes "; break; + } #else - switch(a_bytes) { - default: - case 2: - switch(xflag) { - default: - case 0: frmta = " %04X %04X"; break; - case 1: frmta = " %06o %06o"; break; - case 2: frmta = " %05u %05u"; break; - } - frmtb = " = %6u. bytes "; break; - case 3: - switch(xflag) { - default: - case 0: frmta = " %06X %06X"; break; - case 1: frmta = " %08o %08o"; break; - case 2: frmta = " %08u %08u"; break; - } - frmtb = " = %8u. bytes "; break; - case 4: - switch(xflag) { - default: - case 0: frmta = " %08X %08X"; break; - case 1: frmta = " %011o %011o"; break; - case 2: frmta = " %010u %010u"; break; - } - frmtb = " = %10u. bytes "; break; - } + switch(a_bytes) { + default: + case 2: + switch(xflag) { + default: + case 0: frmta = " %04X %04X"; break; + case 1: frmta = " %06o %06o"; break; + case 2: frmta = " %05u %05u"; break; + } + frmtb = " = %6u. bytes "; break; + case 3: + switch(xflag) { + default: + case 0: frmta = " %06X %06X"; break; + case 1: frmta = " %08o %08o"; break; + case 2: frmta = " %08u %08u"; break; + } + frmtb = " = %8u. bytes "; break; + case 4: + switch(xflag) { + default: + case 0: frmta = " %08X %08X"; break; + case 1: frmta = " %011o %011o"; break; + case 2: frmta = " %010u %010u"; break; + } + frmtb = " = %10u. bytes "; break; + } #endif - fprintf(mfp, frmta, ai, aj); - fprintf(mfp, frmtb, aj); + fprintf(mfp, frmta, ai, aj); + fprintf(mfp, frmtb, aj); - if (xp->a_flag & A3_ABS) { - fprintf(mfp, "(ABS"); - } else { - fprintf(mfp, "(REL"); - } - if (xp->a_flag & A3_OVR) { - fprintf(mfp, ",OVR"); - } else { - fprintf(mfp, ",CON"); - } - if (xp->a_flag & A3_PAG) { - fprintf(mfp, ",PAG"); - } - - /* sdld specific */ - if (xp->a_flag & A_CODE) { - fprintf(mfp, ",CODE"); - } - if (xp->a_flag & A_XDATA) { - fprintf(mfp, ",XDATA"); - } - if (xp->a_flag & A_BIT) { - fprintf(mfp, ",BIT"); - } - /* end sdld specific */ - - fprintf(mfp, ")\n"); - - if (xp->a_flag & A3_PAG) { - ai = (ai & 0xFF); - aj = (aj > 256); - if (ai || aj) { fprintf(mfp, " "); lop += 1; } - if (ai) { fprintf(mfp, " Boundary"); } - if (ai & aj) { fprintf(mfp, " /"); } - if (aj) { fprintf(mfp, " Length"); } - if (ai || aj) { fprintf(mfp, " Error\n"); } - } - - if (wflag) { - putc('\n', mfp); - fprintf(mfp, - " Value Global "); - fprintf(mfp, - " Global Defined In Module\n"); - fprintf(mfp, - " ----- --------------------------------"); - fprintf(mfp, - " ------------------------\n"); - } else { - switch(a_bytes) { - default: - case 2: frmta = " Value Global "; - frmtb = " ----- ------ "; - n = 4; break; - case 3: - case 4: frmta = " Value Global "; - frmtb = " ----- ------ "; - n = 3; break; - } - putc('\n', mfp); - for(i=0;ia_flag & A3_ABS) { + fprintf(mfp, "(ABS"); + } else { + fprintf(mfp, "(REL"); + } + if (xp->a_flag & A3_OVR) { + fprintf(mfp, ",OVR"); + } else { + fprintf(mfp, ",CON"); + } + if (xp->a_flag & A3_PAG) { + fprintf(mfp, ",PAG"); + } + + /* sdld specific */ + if (xp->a_flag & A_CODE) { + fprintf(mfp, ",CODE"); + } + if (xp->a_flag & A_XDATA) { + fprintf(mfp, ",XDATA"); + } + if (xp->a_flag & A_BIT) { + fprintf(mfp, ",BIT"); + } + /* end sdld specific */ + + fprintf(mfp, ")\n"); + if (wflag) { + putc('\n', mfp); + fprintf(mfp, + " Value Global "); + fprintf(mfp, + " Global Defined In Module\n"); + fprintf(mfp, + " ----- --------------------------------"); + fprintf(mfp, + " ------------------------\n"); + } else { + switch(a_bytes) { + default: + case 2: frmta = " Value Global "; + frmtb = " ----- ------ "; + n = 4; break; + case 3: + case 4: frmta = " Value Global "; + frmtb = " ----- ------ "; + n = 3; break; + } + putc('\n', mfp); + for(i=0;is_addr + (*s1)->s_axp->a_addr) - - ((*s2)->s_addr + (*s2)->s_axp->a_addr); + ((*s2)->s_addr + (*s2)->s_axp->a_addr); /* Sort first by address, then by name. */ if (delta) { - return delta; + return delta; } return strcmp((*s1)->s_id,(*s2)->s_id); } /* end sdld specific */ -/*)Function VOID lstarea(xp) +/*)Function VOID lstarea(xp, yp) * - * area * xp pointer to an area structure + * area * xp pointer to an area structure + * bank * yp pointer to a bank structure * - * The function lstarea() creates the linker map output for - * the area specified by pointer xp. The generated output - * area header includes the area name, starting address, - * size of area, number of words (in decimal), and the - * area attributes. The symbols defined in this area are - * sorted by ascending address and output four per line - * in the selected radix (one per line in wide format). - * - * local variables: - * areax * oxp pointer to an area extension structure - * int c character value - * int i loop counter - * int n repeat counter - * char * frmt temporary format specifier - * char * ptr pointer to an id string - * int nmsym number of symbols in area - * a_uint ai temporary - * a_uint aj temporary - * sym * sp pointer to a symbol structure - * sym ** p pointer to an array of - * pointers to symbol structures - * - * global variables: - * int a_bytes T line address bytes - * FILE *mfp Map output file handle - * sym *symhash[NHASH] array of pointers to NHASH - * linked symbol lists - * int wflag Wide format listing - * int xflag Map file radix type flag - * - * functions called: - * int fprintf() c_library - * VOID free() c_library - * char * malloc() c_library - * char putc() c_library - * VOID slew() lklist.c + * The function lstarea() creates the linker map output for + * the area specified by pointer xp. The generated output + * area header includes the area name, starting address, + * size of area, number of words (in decimal), and the + * area attributes. The symbols defined in this area are + * sorted by ascending address and output four per line + * in the selected radix (one per line in wide format). + * + * local variables: + * areax * oxp pointer to an area extension structure + * int i loop counter + * int j bubble sort update status + * int n repeat counter + * char * frmt temporary format specifier + * char * ptr pointer to an id string + * int nmsym number of symbols in area + * a_uint a0 temporary + * a_uint ai temporary + * a_uint aj temporary + * sym * sp pointer to a symbol structure + * sym ** p pointer to an array of + * pointers to symbol structures + * + * global variables: + * int a_bytes T line address bytes + * FILE *mfp Map output file handle + * sym *symhash[NHASH] array of pointers to NHASH + * linked symbol lists + * int wflag Wide format listing + * int xflag Map file radix type flag + * + * functions called: + * int fprintf() c_library + * VOID free() c_library + * char * malloc() c_library + * char putc() c_library + * VOID slew() lklist.c * - * side effects: - * Map output generated. + * side effects: + * Map output generated. */ VOID -lstarea(struct area *xp) +lstarea(struct area *xp, struct bank *yp) { - struct areax *oxp; - int i, n; - char *frmt, *ptr; - int nmsym; - a_uint aj; - struct sym *sp; - struct sym **p; - /* sdld spcific */ - int memPage; - /* end sdld spcific */ - - /* - * Find number of symbols in area - */ - nmsym = 0; - oxp = xp->a_axp; - while (oxp) { - for (i=0; is_axp) - ++nmsym; - sp = sp->s_sp; - } - } - oxp = oxp->a_axp; - } - - if ((nmsym == 0) && (xp->a_size == 0)) { - return; - } - - lop = NLPP; - slew(xp); - - if (nmsym == 0) { - return; - } - - /* - * Allocate space for an array of pointers to symbols - * and load array. - */ - if ( (p = (struct sym **) malloc (nmsym*sizeof(struct sym *))) == NULL) { - fprintf(mfp, "Insufficient space to build Map Segment.\n"); - return; - } - nmsym = 0; - oxp = xp->a_axp; - while (oxp) { - for (i=0; is_axp) { - p[nmsym++] = sp; - } - sp = sp->s_sp; - } - } - oxp = oxp->a_axp; - } - - /* sdld specific */ - /* asxxxx use bubble sort */ - qsort(p, nmsym, sizeof(struct sym *), _cmpSymByAddr); - /* end sdld specific */ - - /* - * Repeat Counter - */ - switch(a_bytes) { - default: - case 2: n = 4; break; - case 3: - case 4: n = 3; break; - } - - /* - * Symbol Table Output - */ - /* sdld spcific */ - memPage = (xp->a_flag & A_CODE) ? 0x0C : ((xp->a_flag & A_XDATA) ? 0x0D : ((xp->a_flag & A_BIT) ? 0x0B : 0x00)); - /* end sdld spcific */ - i = 0; - while (i < nmsym) { - if (wflag) { - slew(xp); - switch(a_bytes) { - default: - case 2: frmt = " "; break; - case 3: - case 4: frmt = " "; break; - } - fprintf(mfp, "%s", frmt); - } else - if ((i % n) == 0) { - slew(xp); - switch(a_bytes) { - default: - case 2: frmt = " "; break; - case 3: - case 4: frmt = " "; break; - } - fprintf(mfp, "%s", frmt); - } - - if (is_sdld()) { - int memPage = (xp->a_flag & A_CODE) ? 0x0C : ((xp->a_flag & A_XDATA) ? 0x0D : ((xp->a_flag & A_BIT) ? 0x0B : 0x00)); - if (memPage != 0) - fprintf(mfp, " %02X:", memPage); - else - fprintf(mfp, " "); - } - - sp = p[i]; - aj = (sp->s_addr + sp->s_axp->a_addr) & a_mask; -#ifdef LONGINT - switch(a_bytes) { - default: - case 2: - switch(xflag) { - default: - case 0: frmt = " %04lX "; break; - case 1: frmt = "%06lo "; break; - case 2: frmt = " %05lu "; break; - } - break; - case 3: - switch(xflag) { - default: - case 0: frmt = " %06lX "; break; - case 1: frmt = " %08lo "; break; - case 2: frmt = " %08lu "; break; - } - break; - case 4: - switch(xflag) { - default: - case 0: frmt = " %08lX "; break; - case 1: frmt = "%011lo "; break; - case 2: frmt = " %010lu "; break; - } - break; - } + struct areax *oxp; + int i, j, n; + char *frmt, *ptr; + int nmsym; + a_uint a0, ai, aj; + struct sym *sp; + struct sym **p; + /* sdld specific */ + int memPage; + /* end sdld specific */ + + /* + * Find number of symbols in area + */ + nmsym = 0; + oxp = xp->a_axp; + while (oxp) { + for (i=0; is_axp) + ++nmsym; + sp = sp->s_sp; + } + } + oxp = oxp->a_axp; + } + + if ((nmsym == 0) && (xp->a_size == 0)) { + return; + } + + lop = NLPP; + slew(xp, yp); + + if (nmsym == 0) { + return; + } + + /* + * Allocate space for an array of pointers to symbols + * and load array. + */ + if ( (p = (struct sym **) malloc (nmsym*sizeof(struct sym *))) == NULL) { + fprintf(mfp, "Insufficient space to build Map Segment.\n"); + return; + } + nmsym = 0; + oxp = xp->a_axp; + while (oxp) { + for (i=0; is_axp) { + p[nmsym++] = sp; + } + sp = sp->s_sp; + } + } + oxp = oxp->a_axp; + } + + if (is_sdld()) { + /* + * Quick Sort of Addresses in Symbol Table Array + */ + qsort(p, nmsym, sizeof(struct sym *), _cmpSymByAddr); + } else { + /* + * Bubble Sort of Addresses in Symbol Table Array + */ + j = 1; + while (j) { + j = 0; + sp = p[0]; + a0 = sp->s_addr + sp->s_axp->a_addr; + for (i=1; is_addr + sp->s_axp->a_addr; + if (a0 > ai) { + j = 1; + p[i] = p[i-1]; + p[i-1] = sp; + } + a0 = ai; + } + } + } + + /* + * Repeat Counter + */ + switch(a_bytes) { + default: + case 2: n = 4; break; + case 3: + case 4: n = 3; break; + } + + /* + * Symbol Table Output + */ + /* sdld specific */ + memPage = (xp->a_flag & A_CODE) ? 0x0C : ((xp->a_flag & A_XDATA) ? 0x0D : ((xp->a_flag & A_BIT) ? 0x0B : 0x00)); + /* end sdld specific */ + i = 0; + while (i < nmsym) { + if (wflag) { + slew(xp, yp); + if (is_sdld()) { + switch(a_bytes) { + default: + case 2: frmt = " "; break; + case 3: + case 4: frmt = ""; break; + } + if (memPage != 0) + fprintf(mfp, "%s%X:", frmt, memPage); + else + fprintf(mfp, "%s ", frmt); + } else { + switch(a_bytes) { + default: + case 2: frmt = " "; break; + case 3: + case 4: frmt = " "; break; + } + fprintf(mfp, "%s", frmt); + } + } else + if ((i % n) == 0) { + slew(xp, yp); + switch(a_bytes) { + default: + case 2: frmt = " "; break; + case 3: + case 4: frmt = " "; break; + } + fprintf(mfp, "%s", frmt); + } + + sp = p[i]; + aj = (sp->s_addr + sp->s_axp->a_addr) & a_mask; +#ifdef LONGINT + switch(a_bytes) { + default: + case 2: + switch(xflag) { + default: + case 0: frmt = " %04lX "; break; + case 1: frmt = "%06lo "; break; + case 2: frmt = " %05lu "; break; + } + break; + case 3: + switch(xflag) { + default: + case 0: frmt = " %06lX "; break; + case 1: frmt = " %08lo "; break; + case 2: frmt = " %08lu "; break; + } + break; + case 4: + switch(xflag) { + default: + case 0: frmt = " %08lX "; break; + case 1: frmt = "%011lo "; break; + case 2: frmt = " %010lu "; break; + } + break; + } #else - switch(a_bytes) { - default: - case 2: - switch(xflag) { - default: - case 0: frmt = " %04X "; break; - case 1: frmt = "%06o "; break; - case 2: frmt = " %05u "; break; - } - break; - case 3: - switch(xflag) { - default: - case 0: frmt = " %06X "; break; - case 1: frmt = " %08o "; break; - case 2: frmt = " %08u "; break; - } - break; - case 4: - switch(xflag) { - default: - case 0: frmt = " %08X "; break; - case 1: frmt = "%011o "; break; - case 2: frmt = " %010u "; break; - } - break; - } + switch(a_bytes) { + default: + case 2: + switch(xflag) { + default: + case 0: frmt = " %04X "; break; + case 1: frmt = "%06o "; break; + case 2: frmt = " %05u "; break; + } + break; + case 3: + switch(xflag) { + default: + case 0: frmt = " %06X "; break; + case 1: frmt = " %08o "; break; + case 2: frmt = " %08u "; break; + } + break; + case 4: + switch(xflag) { + default: + case 0: frmt = " %08X "; break; + case 1: frmt = "%011o "; break; + case 2: frmt = " %010u "; break; + } + break; + } #endif - fprintf(mfp, frmt, aj); + fprintf(mfp, frmt, aj); - ptr = &sp->s_id[0]; + ptr = &sp->s_id[0]; #if NOICE - /* - * NoICE output of symbol - */ - if (jflag) DefineNoICE( ptr, aj, memPage ); + /* + * NoICE output of symbol + */ + if (jflag) DefineNoICE(ptr, aj, yp); #endif #if SDCDB - /* - * SDCDB output of symbol - */ - if (yflag) DefineSDCDB(ptr, aj); + /* + * SDCDB output of symbol + */ + if (yflag) DefineSDCDB(ptr, aj); #endif - if (wflag) { - fprintf(mfp, "%-32.32s", ptr); - i++; - ptr = &sp->m_id[0]; - if(ptr) { - fprintf(mfp, " %-.28s", ptr); - } - } else { - switch(a_bytes) { - default: - case 2: frmt = "%-8.8s"; break; - case 3: - case 4: frmt = "%-9.9s"; break; - } - fprintf(mfp, frmt, ptr); - if (++i < nmsym) - if (i % n != 0) - fprintf(mfp, " | "); - } - if (wflag || (i % n == 0)) { - putc('\n', mfp); - } - } - if (i % n != 0) { - putc('\n', mfp); - } - free(p); + if (wflag) { + fprintf(mfp, "%-32.32s", ptr); + i++; + ptr = &sp->m_id[0]; + if(ptr) { + fprintf(mfp, " %-.28s", ptr); + } + } else { + switch(a_bytes) { + default: + case 2: frmt = "%-8.8s"; break; + case 3: + case 4: frmt = "%-9.9s"; break; + } + fprintf(mfp, frmt, ptr); + if (++i < nmsym) + if (i % n != 0) + fprintf(mfp, " | "); + } + if (wflag || (i % n == 0)) { + putc('\n', mfp); + } + } + if (i % n != 0) { + putc('\n', mfp); + } + free(p); } -/*)Function VOID lkulist(i) +/*)Function VOID lkulist(i) * - * int i i # 0 process LST to RST file - * i = 0 copy remainder of LST file - * to RST file and close files - * - * The function lkulist() creates a relocated listing (.rst) - * output file from the ASxxxx assembler listing (.lst) - * files. The .lst file's program address and code bytes - * are changed to reflect the changes made by ASlink as - * the .rel files are combined into a single relocated - * output file. - * - * local variables: - * a_uint cpc current program counter address in PC increments - * int cbytes bytes so far in T line - * - * global variables: - * int a_bytes T Line Address Bytes - * int hilo byte order - * int gline get a line from the LST file - * to translate for the RST file - * int pcb bytes per instruction word - * char rb[] read listing file text line - * FILE *rfp The file handle to the current - * output RST file - * int rtcnt count of data words - * int rtflg[] output the data flag - * a_uint rtval[] relocated data - * int rterr[] error flag ??? - * FILE *tfp The file handle to the current - * LST file being scanned - * - * functions called: - * int fclose() c_library - * int fgets() c_library - * int fprintf() c_library - * VOID lkalist() lklist.c - * VOID lkglist() lklist.c - * - * side effects: - * A .rst file is created for each available .lst - * file associated with a .rel file. + * int i i # 0 process LST to RST file + * i = 0 copy remainder of LST file + * to RST file and close files + * + * The function lkulist() creates a relocated listing (.rst) + * output file from the ASxxxx assembler listing (.lst) + * files. The .lst file's program address and code bytes + * are changed to reflect the changes made by ASlink as + * the .rel files are combined into a single relocated + * output file. + * + * local variables: + * a_uint cpc current program counter address in PC increments + * int cbytes bytes so far in T line + * + * global variables: + * int a_bytes T Line Address Bytes + * int hilo byte order + * int gline get a line from the LST file + * to translate for the RST file + * a_uint pc current program counter address in bytes + * int pcb bytes per instruction word + * char rb[] read listing file text line + * FILE *rfp The file handle to the current + * output RST file + * int rtcnt count of data words + * int rtflg[] output the data flag + * a_uint rtval[] relocated data + * int rterr[] error flag ??? + * FILE *tfp The file handle to the current + * LST file being scanned + * + * functions called: + * int fclose() c_library + * int fgets() c_library + * int fprintf() c_library + * VOID lkalist() lklist.c + * VOID lkglist() lklist.c + * + * side effects: + * A .rst file is created for each available .lst + * file associated with a .rel file. */ VOID lkulist(int i) { - a_uint cpc; - int cbytes; + a_uint cpc; + int cbytes; - /* - * Exit if listing file is not open - */ - if (tfp == NULL) - return; - - /* - * Normal processing of LST to RST - */ - if (i) { - /* - * Evaluate current code address - */ - if (hilo == 0) { - cpc = ((rtval[1] & 0xFF) << 8) + (rtval[0] & 0xFF); - } else { - cpc = ((rtval[0] & 0xFF) << 8) + (rtval[1] & 0xFF); - } - - /* - * Line with only address - */ - if (rtcnt == a_bytes) { - lkalist(cpc); - - /* - * Line with address and code - */ - } else { - cbytes = 0; - for (i=a_bytes; i < rtcnt; i++) { - if (rtflg[i]) { - lkglist(cpc, (int) (rtval[i] & 0xFF), rterr[i]); - cbytes += 1; - cpc += (cbytes % pcb) ? 0 : 1; - } - } - } - /* - * Copy remainder of LST to RST - */ - } else { - if (gline == 0) - fprintf(rfp, "%s", rb); - - while (fgets(rb, sizeof(rb)-2, tfp) != 0) { - fprintf(rfp, "%s", rb); - } - fclose(tfp); - tfp = NULL; - fclose(rfp); - rfp = NULL; - } + /* + * Exit if listing file is not open + */ + if (tfp == NULL) + return; + + /* + * Normal processing of LST to RST + */ + if (i) { + /* + * Line with only address + */ + if (rtcnt == a_bytes) { + lkalist(pc); + + /* + * Line with address and code + */ + } else { + cpc = pc; + cbytes = 0; + for (i=a_bytes; i < rtcnt; i++) { + if (rtflg[i]) { + lkglist(cpc, (int) (rtval[i] & 0xFF), rterr[i]); + cbytes += 1; + cpc += (cbytes % pcb) ? 0 : 1; + } + } + } + /* + * Copy remainder of LST to RST + */ + } else { + if (gline == 0) + fprintf(rfp, "%s", rb); + + while (fgets(rb, sizeof(rb)-2, tfp) != 0) { + fprintf(rfp, "%s", rb); + } + fclose(tfp); + tfp = NULL; + fclose(rfp); + rfp = NULL; + } } -/*)Function VOID lkalist(cpc) +/*)Function VOID lkalist(cpc) * - * int cpc current program counter value + * int cpc current program counter value * - * The function lkalist() performs the following functions: + * The function lkalist() performs the following functions: * - * (1) if the value of gline = 0 then the current listing - * file line is copied to the relocated listing file output. + * (1) if the value of gline = 0 then the current listing + * file line is copied to the relocated listing file output. * - * (2) the listing file is read line by line and copied to - * the relocated listing file until a valid source - * line number and a program counter value of the correct - * radix is found. The new relocated pc value is substituted - * and the line is written to the RST file. - * - * local variables: - * int i loop counter - * int m character count - * int n character index - * int r character radix - * char * frmt temporary format specifier - * char str[] temporary string - * - * global variables: - * int a_bytes T Line Address Bytes - * a_uint a_mask address masking parameter - * int gcntr data byte counter - * int gline get a line from the LST file - * to translate for the RST file - * char rb[] read listing file text line - * char *rp pointer to listing file text line - * FILE *rfp The file handle to the current - * output RST file - * FILE *tfp The file handle to the current - * LST file being scanned - * - * functions called: - * int dgt() lklist.c - * int fclose() c_library - * int fgets() c_library - * int fprintf() c_library - * int sprintf() c_library - * char * strncpy() c_library - * - * side effects: - * Lines of the LST file are copied to the RST file, - * the last line copied has the code address - * updated to reflect the program relocation. + * (2) the listing file is read line by line and copied to + * the relocated listing file until a valid source + * line number and a program counter value of the correct + * radix is found. The new relocated pc value is substituted + * and the line is written to the RST file. + * + * local variables: + * int i loop counter + * int m character count + * int n character index + * int r character radix + * char * frmt temporary format specifier + * char str[] temporary string + * + * global variables: + * int a_bytes T Line Address Bytes + * a_uint a_mask address masking parameter + * int gcntr data byte counter + * int gline get a line from the LST file + * to translate for the RST file + * char rb[] read listing file text line + * char *rp pointer to listing file text line + * FILE *rfp The file handle to the current + * output RST file + * FILE *tfp The file handle to the current + * LST file being scanned + * + * functions called: + * int dgt() lklist.c + * int fclose() c_library + * int fgets() c_library + * int fprintf() c_library + * int sprintf() c_library + * char * strncpy() c_library + * + * side effects: + * Lines of the LST file are copied to the RST file, + * the last line copied has the code address + * updated to reflect the program relocation. */ /* The Output Formats, No Cycle Count @@ -774,34 +791,34 @@ 11111111112222222222333333333344444----- 012345678901234567890123456789012345678901234----- | | | | | -ee XXXX xx xx xx xx xx xx LLLLL ************* HEX(16) -ee 000000 ooo ooo ooo ooo LLLLL ************* OCTAL(16) -ee DDDDD ddd ddd ddd ddd LLLLL ************* DECIMAL(16) +ee XXXX xx xx xx xx xx xx LLLLL ************* HEX(16) +ee 000000 ooo ooo ooo ooo LLLLL ************* OCTAL(16) +ee DDDDD ddd ddd ddd ddd LLLLL ************* DECIMAL(16) XXXX - OOOOOO - DDDDD + OOOOOO + DDDDD | Tabs- | | | | | | 11111111112222222222333333333344444----- 012345678901234567890123456789012345678901234----- | | | | | -ee XXXXXX xx xx xx xx xx xx xx LLLLL ********* HEX(24) -ee OO000000 ooo ooo ooo ooo ooo LLLLL ********* OCTAL(24) -ee DDDDDDDD ddd ddd ddd ddd ddd LLLLL ********* DECIMAL(24) +ee XXXXXX xx xx xx xx xx xx xx LLLLL ********* HEX(24) +ee OO000000 ooo ooo ooo ooo ooo LLLLL ********* OCTAL(24) +ee DDDDDDDD ddd ddd ddd ddd ddd LLLLL ********* DECIMAL(24) XXXXXX - OOOOOOOO - DDDDDDDD + OOOOOOOO + DDDDDDDD | Tabs- | | | | | | 11111111112222222222333333333344444----- 012345678901234567890123456789012345678901234----- | | | | | -ee XXXXXXXX xx xx xx xx xx xx xx LLLLL ********* HEX(32) -eeOOOOO000000 ooo ooo ooo ooo ooo LLLLL ********* OCTAL(32) -ee DDDDDDDDDD ddd ddd ddd ddd ddd LLLLL ********* DECIMAL(32) +ee XXXXXXXX xx xx xx xx xx xx xx LLLLL ********* HEX(32) +eeOOOOO000000 ooo ooo ooo ooo ooo LLLLL ********* OCTAL(32) +ee DDDDDDDDDD ddd ddd ddd ddd ddd LLLLL ********* DECIMAL(32) XXXXXXXX - OOOOOOOOOOO - DDDDDDDDDD + OOOOOOOOOOO + DDDDDDDDDD */ /* The Output Formats, With Cycle Count [nn] @@ -809,229 +826,229 @@ 11111111112222222222333333333344444----- 012345678901234567890123456789012345678901234----- | | | | | -ee XXXX xx xx xx xx xx[nn]LLLLL ************* HEX(16) -ee 000000 ooo ooo ooo [nn]LLLLL ************* OCTAL(16) -ee DDDDD ddd ddd ddd [nn]LLLLL ************* DECIMAL(16) +ee XXXX xx xx xx xx xx[nn]LLLLL ************* HEX(16) +ee 000000 ooo ooo ooo [nn]LLLLL ************* OCTAL(16) +ee DDDDD ddd ddd ddd [nn]LLLLL ************* DECIMAL(16) XXXX - OOOOOO - DDDDD + OOOOOO + DDDDD | Tabs- | | | | | | 11111111112222222222333333333344444----- 012345678901234567890123456789012345678901234----- | | | | | -ee XXXXXX xx xx xx xx xx xx[nn]LLLLL ********* HEX(24) -ee OO000000 ooo ooo ooo ooo [nn]LLLLL ********* OCTAL(24) -ee DDDDDDDD ddd ddd ddd ddd [nn]LLLLL ********* DECIMAL(24) +ee XXXXXX xx xx xx xx xx xx[nn]LLLLL ********* HEX(24) +ee OO000000 ooo ooo ooo ooo [nn]LLLLL ********* OCTAL(24) +ee DDDDDDDD ddd ddd ddd ddd [nn]LLLLL ********* DECIMAL(24) XXXXXX - OOOOOOOO - DDDDDDDD + OOOOOOOO + DDDDDDDD | Tabs- | | | | | | 11111111112222222222333333333344444----- 012345678901234567890123456789012345678901234----- | | | | | -ee XXXXXXXX xx xx xx xx xx xx[nn]LLLLL ********* HEX(32) -eeOOOOO000000 ooo ooo ooo ooo [nn]LLLLL ********* OCTAL(32) -ee DDDDDDDDDD ddd ddd ddd ddd [nn]LLLLL ********* DECIMAL(32) +ee XXXXXXXX xx xx xx xx xx xx[nn]LLLLL ********* HEX(32) +eeOOOOO000000 ooo ooo ooo ooo [nn]LLLLL ********* OCTAL(32) +ee DDDDDDDDDD ddd ddd ddd ddd [nn]LLLLL ********* DECIMAL(32) XXXXXXXX - OOOOOOOOOOO - DDDDDDDDDD + OOOOOOOOOOO + DDDDDDDDDD */ VOID lkalist(a_uint cpc) { - char str[16]; - char *frmt; - int i, m, n, r; - - /* - * Truncate (int) to N-Bytes - */ - cpc &= a_mask; - - /* - * Exit if listing file is not open - */ -loop: if (tfp == NULL) - return; - - /* - * Copy current LST to RST - */ - if (gline == 0) { - fprintf(rfp, "%s", rb); - gline = 1; - } - - /* - * Clear text line buffer - */ - for (i=0,rp=rb; ia_ap) { - /**/ if (!strcmp(ap->a_id, "REG_BANK_0")) { ap->a_addr = 0x00; ap->a_type = 1; } - else if (!strcmp(ap->a_id, "REG_BANK_1")) { ap->a_addr = 0x08; ap->a_type = 1; } - else if (!strcmp(ap->a_id, "REG_BANK_2")) { ap->a_addr = 0x10; ap->a_type = 1; } - else if (!strcmp(ap->a_id, "REG_BANK_3")) { ap->a_addr = 0x18; ap->a_type = 1; } - else if (!strcmp(ap->a_id, "BSEG_BYTES")) { ap->a_addr = 0x20; ap->a_type = 1; } - else if (TARGET_IS_8051 && !strcmp(ap->a_id, "SSEG")) { - if (stacksize) ap->a_axp->a_size = stacksize; - } - } - - if (TARGET_IS_8051) { - sp = lkpsym("l_IRAM", 1); - sp->s_addr = ((iram_size>0) && (iram_size<=0x100)) ? iram_size : 0x0100; - sp->s_axp = NULL; - sp->s_type |= S_DEF; - } + char * rel[] = { + "XH", + "H 7 areas 0 global symbols", + "A _CODE size 0 flags 0", /*Each .rel has one, so...*/ + "A REG_BANK_0 size 0 flags 4", /*Register banks are overlayable*/ + "A REG_BANK_1 size 0 flags 4", + "A REG_BANK_2 size 0 flags 4", + "A REG_BANK_3 size 0 flags 4", + "A BSEG size 0 flags 80", /*BSEG must be just before BITS*/ + "A BSEG_BYTES size 0 flags 0", /*Size will be obtained from BSEG in lnkarea()*/ + "" + }; + + char * rel2[] = { + "XH", + "H C areas 0 global symbols", + "A _CODE size 0 flags 0", /*Each .rel has one, so...*/ + "A REG_BANK_0 size 0 flags 4", /*Register banks are overlayable*/ + "A REG_BANK_1 size 0 flags 4", + "A REG_BANK_2 size 0 flags 4", + "A REG_BANK_3 size 0 flags 4", + "A BSEG size 0 flags 80", /*BSEG must be just before BITS*/ + "A BSEG_BYTES size 0 flags 0", /*Size will be obtained from BSEG in lnkarea()*/ + "A BIT_BANK size 0 flags 4", /*Bit register bank is overlayable*/ + "A DSEG size 0 flags 0", + "A OSEG size 0 flags 4", + "A ISEG size 0 flags 0", + "A SSEG size 0 flags 4", + "" + }; + int j; + struct sym * sp; + + if (packflag) { + for (j = 0; rel2[j][0] != 0; j++) { + ip = rel2[j]; + link_main(); + } + } + else { + for (j = 0; rel[j][0] != 0; j++) { + ip = rel[j]; + link_main(); + } + } + + /*Set the start address of the default areas:*/ + for (ap = areap; ap; ap = ap->a_ap) { + /**/ if (!strcmp(ap->a_id, "REG_BANK_0")) { ap->a_addr = 0x00; ap->a_bset = 1; } + else if (!strcmp(ap->a_id, "REG_BANK_1")) { ap->a_addr = 0x08; ap->a_bset = 1; } + else if (!strcmp(ap->a_id, "REG_BANK_2")) { ap->a_addr = 0x10; ap->a_bset = 1; } + else if (!strcmp(ap->a_id, "REG_BANK_3")) { ap->a_addr = 0x18; ap->a_bset = 1; } + else if (!strcmp(ap->a_id, "BSEG_BYTES")) { ap->a_addr = 0x20; ap->a_bset = 1; } + else if (TARGET_IS_8051 && !strcmp(ap->a_id, "SSEG")) { + if (stacksize) ap->a_axp->a_size = stacksize; + } + } + + if (TARGET_IS_8051) { + sp = lkpsym("l_IRAM", 1); + sp->s_addr = ((iram_size>0) && (iram_size<=0x100)) ? iram_size : 0x0100; + sp->s_axp = NULL; + sp->s_type |= S_DEF; + } } /* end sdld 8051 & 6808 specific */ -/*)Function int main(argc,argv) +/*)Function int main(argc,argv) * - * int argc number of command line arguments + 1 - * char * argv[] array of pointers to the command line - * arguments - * - * The function main() evaluates the command line arguments to - * determine if the linker parameters are to input through 'stdin' - * or read from a command file. The functions nxtline() and parse() - * are to input and evaluate the linker parameters. The linking process - * proceeds by making the first pass through each .rel file in the order - * presented to the linker. At the end of the first pass the setbase(), - * lnkarea(), setgbl(), and symdef() functions are called to evaluate - * the base address terms, link all areas, define global variables, - * and look for undefined symbols. Following these routines a linker - * map file may be produced and the linker output files may be opened. - * The second pass through the .rel files will output the linked data - * in one of the supported formats. - * - * local variables: - * int c character from argument string - * int i loop counter - * int j loop counter - * int k loop counter - * - * global variables: - * text line in ib[] - * lfile *cfp The pointer *cfp points to the - * current lfile structure - * char ctype[] array of character types, one per - * ASCII character - * lfile *filep The pointer *filep points to the - * beginning of a linked list of - * lfile structures. - * head *hp Pointer to the current - * head structure - * char ib[NINPUT] .rel file text line - * char *ip pointer into the .rel file - * lfile *linkp pointer to first lfile structure - * containing an input .rel file - * specification - * int lkerr error flag - * int mflag Map output flag - * int oflag Output file type flag - * FILE *ofp Output file handle - * for word formats - * FILE *ofph Output file handle - * for high byte format - * FILE *ofpl Output file handle - * for low byte format - * int pass linker pass number - * int pflag print linker command file flag - * int radix current number conversion radix - * FILE *sfp The file handle sfp points to the - * currently open file - * lfile *startp aslink startup file structure - * FILE * stdout c_library - * - * functions called: - * int fclose() c_library - * int fprintf() c_library - * VOID library() lklibr.c - * VOID link_main() lkmain.c - * VOID lkexit() lkmain.c - * VOID lkfopen() lkbank.c - * VOID lnkarea() lkarea.c - * VOID map() lkmain.c - * VOID new() lksym.c - * int nxtline() lklex.c - * int parse() lkmain.c - * VOID reloc() lkreloc.c - * VOID search() lklibr.c - * VOID setbas() lkmain.c - * VOID setgbl() lkmain.c - * char * sprintf() c_library - * VOID symdef() lksym.c - * VOID usage() lkmain.c - * int fndidx() lkmain.c - * - * side effects: - * Completion of main() completes the linking process - * and may produce a map file (.map) and/or a linked - * data files (.ihx or .s19) and/or one or more - * relocated listing files (.rst). + * int argc number of command line arguments + 1 + * char * argv[] array of pointers to the command line + * arguments + * + * The function main() evaluates the command line arguments to + * determine if the linker parameters are to input through 'stdin' + * or read from a command file. The functions nxtline() and parse() + * are to input and evaluate the linker parameters. The linking process + * proceeds by making the first pass through each .rel file in the order + * presented to the linker. At the end of the first pass the setarea(), + * lnkarea(), setgbl(), and symdef() functions are called to evaluate + * the base address terms, link all areas, define global variables, + * and look for undefined symbols. Following these routines a linker + * map file may be produced and the linker output files may be opened. + * The second pass through the .rel files will output the linked data + * in one of the supported formats. + * + * local variables: + * int c character from argument string + * int i loop counter + * int j loop counter + * int k loop counter + * + * global variables: + * text line in ib[] + * lfile *cfp The pointer *cfp points to the + * current lfile structure + * char ctype[] array of character types, one per + * ASCII character + * lfile *filep The pointer *filep points to the + * beginning of a linked list of + * lfile structures. + * head *hp Pointer to the current + * head structure + * char ib[NINPUT] .rel file text line + * char *ip pointer into the .rel file + * lfile *linkp pointer to first lfile structure + * containing an input .rel file + * specification + * int lkerr error flag + * int oflag Output file type flag + * int objflg Linked file/library output object flag + * int pass linker pass number + * int pflag print linker command file flag + * int radix current number conversion radix + * FILE *sfp The file handle sfp points to the + * currently open file + * lfile *startp aslink startup file structure + * FILE * stdout c_library + * + * functions called: + * VOID chkbank() lkbank.c + * int fclose() c_library + * int fprintf() c_library + * VOID library() lklibr.c + * VOID link_main() lkmain.c + * VOID lkexit() lkmain.c + * VOID lkfopen() lkbank.c + * VOID lnkarea() lkarea.c + * VOID map() lkmain.c + * VOID new() lksym.c + * int nxtline() lklex.c + * int parse() lkmain.c + * VOID reloc() lkreloc.c + * VOID search() lklibr.c + * VOID setarea() lkarea.c + * VOID setbank() lkbank.c + * VOID setgbl() lkmain.c + * char * sprintf() c_library + * VOID symdef() lksym.c + * VOID usage() lkmain.c + * int fndidx() lkmain.c + * + * side effects: + * Completion of main() completes the linking process + * and may produce a map file (.map) and/or a linked + * data files (.ihx or .s19) and/or one or more + * relocated listing files (.rst). */ int main(int argc, char *argv[]) { - int c, i, j, k; + int c, i, j, k; - if (intsiz() < 4) { - fprintf(stderr, "?ASlink-Error-Size of INT32 is not 32 bits or larger.\n\n"); - exit(ER_FATAL); - } - - /* sdas specific */ - /* sdas initialization */ - sdld_init(argv[0]); - - /* use these defaults for parsing the .lk script */ - a_bytes = 4; - a_mask = 0xFFFFFFFF; - s_mask = 0x80000000; - v_mask = 0x7FFFFFFF; - /* end sdas specific */ - - if (!is_sdld()) - fprintf(stdout, "\n"); - - startp = (struct lfile *) new (sizeof (struct lfile)); - startp->f_idp = ""; - - pflag = 1; - - for(i=1; i> %s\n", ip); - parse(); - k++; - } - } else { - strcpy(ip, argv[i]); - if(pflag) - fprintf(stdout, "ASlink >> %s\n", ip); - parse(); - } - } - - if (linkp == NULL) - usage(ER_FATAL); - - /* - * If no input file is specified - * then assume a single file with - * the same name as the output file. - */ - if (lfp == linkp) { - lfp->f_flp = (struct lfile *) new (sizeof (struct lfile)); - lfp = lfp->f_flp; - lfp->f_idp = strsto(linkp->f_idp); - lfp->f_type = F_REL; - } + if (intsiz() < 4) { + fprintf(stderr, "?ASlink-Error-Size of INT32 is not 32 bits or larger.\n\n"); + exit(ER_FATAL); + } + + /* sdas specific */ + /* sdas initialization */ + sdld_init(argv[0]); + + /* use these defaults for parsing the .lk script */ + a_bytes = 4; + a_mask = 0xFFFFFFFF; + s_mask = 0x80000000; + v_mask = 0x7FFFFFFF; + /* end sdas specific */ + + if (!is_sdld()) + fprintf(stdout, "\n"); + + startp = (struct lfile *) new (sizeof (struct lfile)); + startp->f_idp = ""; + + pflag = 1; + + for(i=1; i> %s\n", ip); + parse(); + k++; + } + } else { + strcpy(ip, argv[i]); + if(pflag) + fprintf(stdout, "ASlink >> %s\n", ip); + parse(); + } + } + + if (linkp == NULL) + usage(ER_FATAL); + + /* + * If no input file is specified + * then assume a single file with + * the same name as the output file. + */ + if (lfp == linkp) { + lfp->f_flp = (struct lfile *) new (sizeof (struct lfile)); + lfp = lfp->f_flp; + lfp->f_idp = strsto(linkp->f_idp); + lfp->f_idx = fndidx(linkp->f_idp); + lfp->f_obj = objflg; + lfp->f_type = F_REL; + } - syminit(); + syminit(); #if SDCDB - /* - * Open SDCC Debug output file - */ - SDCDBfopen(); + /* + * Open SDCC Debug output file + */ + SDCDBfopen(); #endif - for (pass=0; pass<2; ++pass) { - cfp = NULL; - sfp = NULL; - filep = linkp->f_flp; - hp = NULL; - radix = 10; - - /* sdld specific */ - if (TARGET_IS_8051 || TARGET_IS_6808) - Areas51(); /*JCF: Create the default 8051 areas in the right order*/ - /* end sdld specific */ - - while (nxtline()) { - ip = ib; - - /* sdld specific */ - /* pass any "magic comments" to NoICE output */ - if ((ip[0] == ';') && (ip[1] == '!') && jfp) { - fprintf( jfp, "%s\n", &ip[2] ); - } - /* end sdld specific */ - - link_main(); - } - if (pass == 0) { - /* - * Search libraries for global symbols - */ - search(); - - /* sdas specific */ - /* use these defaults for parsing the .lk script */ - a_bytes = 4; - a_mask = 0xFFFFFFFF; - s_mask = 0x80000000; - v_mask = 0x7FFFFFFF; - /* end sdas specific */ - - /* - * Set area base addresses. - */ - setbas(); - - /* - * Link all area addresses. - */ - if (!packflag) - lnkarea(); - else { - /* sdld 8051 specific */ - lnkarea2(); - /* end sdld 8051 specific */ - } - /* - * Process global definitions. - */ - setgbl(); - /* - * Check for undefined globals. - */ - symdef(stderr); + for (pass=0; pass<2; ++pass) { + cfp = NULL; + sfp = NULL; + filep = linkp->f_flp; + hp = NULL; + radix = 10; + + /* sdld specific */ + if (TARGET_IS_8051 || TARGET_IS_6808) + Areas51(); /*JCF: Create the default 8051 areas in the right order*/ + /* end sdld specific */ + + while (nxtline()) { + ip = ib; + link_main(); + } + if (pass == 0) { + /* + * Search libraries for global symbols + */ + search(); + + /* sdas specific */ + /* use these defaults for parsing the .lk script */ + a_bytes = 4; + a_mask = 0xFFFFFFFF; + s_mask = 0x80000000; + v_mask = 0x7FFFFFFF; + /* end sdas specific */ + + /* + * Set area base addresses. + */ + setarea(); + /* + * Set bank base addresses. + */ + setbank(); + /* + * Link all area addresses. + */ + if (!packflag) + lnkarea(); + else { + /* sdld 8051 specific */ + lnkarea2(); + /* end sdld 8051 specific */ + } + /* + * Check bank size limits. + */ + chkbank(stderr); + /* + * Process global definitions. + */ + setgbl(); + /* + * Check for undefined globals. + */ + symdef(stderr); #if NOICE - /* - * Open NoICE output file - */ - NoICEfopen(); + /* + * Open NoICE output file + */ + NoICEfopen(); #endif - /* - * Output Link Map. - */ - map(); - - /* sdld specific */ - if (sflag) { /*JCF: memory usage summary output*/ - if (!packflag) { - if (summary(areap)) lkexit(1); - } - else { - /* sdld 8051 specific */ - if (summary2(areap)) lkexit(1); - /* end sdld 8051 specific */ - } - } - - if ((iram_size) && (!packflag)) - iramcheck(); - /* end sdld specific */ - - /* - * Open output file(s) - */ - lkfopen(); - } else { - /* - * Link in library files - */ - library(); - /* - * Complete Processing - */ - reloc('E'); - } - } - if (TARGET_IS_8051) { - //JCF: - CreateAOMF51(); - } - - lkexit(lkerr ? ER_ERROR : ER_NONE); - return(0); -} - -/*)Function int intsiz() - * - * The function intsiz() returns the size of INT32 + /* + * Output Link Map. + */ + map(); + + /* sdld specific */ + if (sflag) { /*JCF: memory usage summary output*/ + if (!packflag) { + if (summary(areap)) lkexit(1); + } + else { + /* sdld 8051 specific */ + if (summary2(areap)) lkexit(1); + /* end sdld 8051 specific */ + } + } + + if ((iram_size) && (!packflag)) + iramcheck(); + /* end sdld specific */ + + /* + * Open output file(s) + */ + lkfopen(); + } else { + /* + * Link in library files + */ + library(); + /* + * Complete Processing + */ + reloc('E'); + } + } + if (TARGET_IS_8051) { + //JCF: + CreateAOMF51(); + } + + lkexit(lkerr ? ER_ERROR : ER_NONE); + return(0); +} + +/*)Function int intsiz() + * + * The function intsiz() returns the size of INT32 + * + * local variables: + * none * - * local variables: - * none + * global variables: + * none * - * global variables: - * none + * functions called: + * none * - * functions called: - * none - * - * side effects: - * none + * side effects: + * none */ int intsiz() { - return(sizeof(a_uint)); + return(sizeof(a_uint)); } -/*)Function VOID lkexit(i) +/*)Function VOID lkexit(i) + * + * int i exit code + * + * The function lkexit() explicitly closes all open + * files and then terminates the program. * - * int i exit code + * local variables: + * none * - * The function lkexit() explicitly closes all open - * files and then terminates the program. + * global variables: + * FILE * jfp file handle for .noi + * FILE * mfp file handle for .map + * FILE * rfp file hanlde for .rst + * FILE * sfp file handle for .rel + * FILE * tfp file handle for .lst * - * local variables: - * none - * - * global variables: - * FILE * jfp file handle for .noi - * FILE * mfp file handle for .map - * FILE * rfp file hanlde for .rst - * FILE * sfp file handle for .rel - * FILE * tfp file handle for .lst - * - * functions called: - * int fclose() c_library - * VOID exit() c_library - * VOID lkfclose() lkbank.c + * functions called: + * int fclose() c_library + * VOID exit() c_library + * VOID lkfclose() lkbank.c * - * side effects: - * All files closed. Program terminates. + * side effects: + * All files closed. Program terminates. */ VOID lkexit(i) int i; { - lkfclose(); + lkfclose(); #if NOICE - if (jfp != NULL) fclose(jfp); + if (jfp != NULL) fclose(jfp); #endif - if (mfp != NULL) fclose(mfp); - if (rfp != NULL) fclose(rfp); - if (sfp != NULL) { if (sfp != stdin) fclose(sfp); } - if (tfp != NULL) fclose(tfp); + if (mfp != NULL) fclose(mfp); + if (rfp != NULL) fclose(rfp); + if (sfp != NULL) { if (sfp != stdin) fclose(sfp); } + if (tfp != NULL) fclose(tfp); #if SDCDB - if (yfp != NULL) fclose(yfp); + if (yfp != NULL) fclose(yfp); #endif - exit(i); + exit(i); } -/*)Function link_main() +/*)Function link_main() * - * The function link_main() evaluates the directives for each line of - * text read from the .rel file(s). The valid directives processed - * are: - * X, D, Q, H, M, A, S, T, R, and P. - * - * local variables: - * int c first non blank character of a line - * - * global variables: - * head *headp The pointer to the first - * head structure of a linked list - * head *hp Pointer to the current - * head structure - * int a_bytes T Line address bytes - * int hilo Byte ordering - * int pass linker pass number - * int radix current number conversion radix - * - * functions called: - * char endline() lklex.c - * VOID module() lkhead.c - * VOID newarea() lkarea.c - * VOID newhead() lkhead.c - * sym * newsym() lksym.c - * VOID reloc() lkreloc.c - * - * side effects: - * Head, area, and symbol structures are created and - * the radix is set as the .rel file(s) are read. + * The function link_main() evaluates the directives for each line of + * text read from the .rel file(s). The valid directives processed + * are: + * X, D, Q, H, M, A, S, T, R, and P. + * + * local variables: + * int c first non blank character of a line + * + * global variables: + * head *headp The pointer to the first + * head structure of a linked list + * head *hp Pointer to the current + * head structure + * int a_bytes T Line address bytes + * int hilo Byte ordering + * int pass linker pass number + * int radix current number conversion radix + * + * functions called: + * char endline() lklex.c + * VOID module() lkhead.c + * VOID newarea() lkarea.c + * VOID newhead() lkhead.c + * sym * newsym() lksym.c + * VOID NoICEmagic() lknoice.c + * VOID reloc() lkreloc.c + * + * side effects: + * Head, area, and symbol structures are created and + * the radix is set as the .rel file(s) are read. */ VOID link_main() { - char c; + char c; - if ((c=endline()) == 0) { return; } - switch (c) { + if ((c=endline()) == 0) { return; } + switch (c) { - /* sdld specific */ - case 'O': /* For some important sdcc options */ - if (is_sdld() && pass == 0) { - if (NULL == optsdcc) { - optsdcc = strsto(&ip[1]); - optsdcc_module = hp->m_id; - } - else { - if (strcmp(optsdcc, &ip[1]) != 0) { - fprintf(stderr, - "?ASlink-Warning-Conflicting sdcc options:\n" - " \"%s\" in module \"%s\" and\n" - " \"%s\" in module \"%s\".\n", - optsdcc, optsdcc_module, &ip[1], hp->m_id); - lkerr++; - } - } - } - break; - /* end sdld specific */ - - case 'X': - case 'D': - case 'Q': - ASxxxx_VERSION = 3; - a_bytes = 2; /* use default if unspecified */ - hilo = 0; /* use default if unspecified */ - if (c == 'X') { radix = 16; } else - if (c == 'D') { radix = 10; } else - if (c == 'Q') { radix = 8; } - - while ((c = get()) != 0) { - switch(c) { - case 'H': - hilo = 1; - break; - - case 'L': - hilo = 0; - break; - - case '2': - a_bytes = 2; - break; - - case '3': - a_bytes = 3; - break; - - case '4': - a_bytes = 4; - break; - - default: - break; - } - } -#ifdef LONGINT - switch(a_bytes) { - default: - a_bytes = 2; - case 2: - a_mask = 0x0000FFFFl; - s_mask = 0x00008000l; - v_mask = 0x00007FFFl; - break; - - case 3: - a_mask = 0x00FFFFFFl; - s_mask = 0x00800000l; - v_mask = 0x007FFFFFl; - break; - - case 4: - a_mask = 0xFFFFFFFFl; - s_mask = 0x80000000l; - v_mask = 0x7FFFFFFFl; - break; - } + /* sdld specific */ + case 'O': /* For some important sdcc options */ + if (is_sdld() && pass == 0) { + if (NULL == optsdcc) { + optsdcc = strsto(&ip[1]); + optsdcc_module = hp->m_id; + } + else { + if (strcmp(optsdcc, &ip[1]) != 0) { + fprintf(stderr, + "?ASlink-Warning-Conflicting sdcc options:\n" + " \"%s\" in module \"%s\" and\n" + " \"%s\" in module \"%s\".\n", + optsdcc, optsdcc_module, &ip[1], hp->m_id); + lkerr++; + } + } + } + break; + /* end sdld specific */ + + case 'X': + case 'D': + case 'Q': + ASxxxx_VERSION = 3; + a_bytes = 2; /* use default if unspecified */ + hilo = 0; /* use default if unspecified */ + if (c == 'X') { radix = 16; } else + if (c == 'D') { radix = 10; } else + if (c == 'Q') { radix = 8; } + + while ((c = get()) != 0) { + switch(c) { + case 'H': + hilo = 1; + break; + + case 'L': + hilo = 0; + break; + + case '2': + a_bytes = 2; + break; + + case '3': + a_bytes = 3; + break; + + case '4': + a_bytes = 4; + break; + + default: + break; + } + } +#ifdef LONGINT + switch(a_bytes) { + default: + a_bytes = 2; + case 2: + a_mask = 0x0000FFFFl; + s_mask = 0x00008000l; + v_mask = 0x00007FFFl; + break; + + case 3: + a_mask = 0x00FFFFFFl; + s_mask = 0x00800000l; + v_mask = 0x007FFFFFl; + break; + + case 4: + a_mask = 0xFFFFFFFFl; + s_mask = 0x80000000l; + v_mask = 0x7FFFFFFFl; + break; + } #else - switch(a_bytes) { - default: - a_bytes = 2; - case 2: - a_mask = 0x0000FFFF; - s_mask = 0x00008000; - v_mask = 0x00007FFF; - break; - - case 3: - a_mask = 0x00FFFFFF; - s_mask = 0x00800000; - v_mask = 0x007FFFFF; - break; - - case 4: - a_mask = 0xFFFFFFFF; - s_mask = 0x80000000; - v_mask = 0x7FFFFFFF; - break; - } + switch(a_bytes) { + default: + a_bytes = 2; + case 2: + a_mask = 0x0000FFFF; + s_mask = 0x00008000; + v_mask = 0x00007FFF; + break; + + case 3: + a_mask = 0x00FFFFFF; + s_mask = 0x00800000; + v_mask = 0x007FFFFF; + break; + + case 4: + a_mask = 0xFFFFFFFF; + s_mask = 0x80000000; + v_mask = 0x7FFFFFFF; + break; + } #endif - break; + break; - case 'H': - if (pass == 0) { - newhead(); - } else { - if (hp == 0) { - hp = headp; - } else { - hp = hp->h_hp; - } - } - sdp.s_area = NULL; - sdp.s_areax = NULL; - sdp.s_addr = 0; - break; - - case 'M': - if (pass == 0) - module(); - break; - - case 'A': - if (pass == 0) - newarea(); - if (sdp.s_area == NULL) { - sdp.s_area = areap; - sdp.s_areax = areap->a_axp; - sdp.s_addr = 0; - } - break; - - case 'S': - if (pass == 0) - newsym(); - break; - - case 'T': - case 'R': - case 'P': - if (pass == 0) - break; - reloc(c); - break; - - default: - break; - } -} + case 'H': + if (pass == 0) { + newhead(); + } else { + if (hp == 0) { + hp = headp; + } else { + hp = hp->h_hp; + } + } + sdp.s_area = NULL; + sdp.s_areax = NULL; + sdp.s_addr = 0; + break; + + case 'M': + if (pass == 0) + module(); + break; + + case 'A': + if (pass == 0) + newarea(); + if (sdp.s_area == NULL) { + sdp.s_area = areap; + sdp.s_areax = areap->a_axp; + sdp.s_addr = 0; + } + break; + + case 'S': + if (pass == 0) + newsym(); + break; + + case 'T': + case 'R': + case 'P': + if (pass == 0) + break; + reloc(c); + break; -/*)Function VOID map() - * - * The function map() opens the output map file and calls the various - * routines to - * (1) output the variables in each area, - * (2) list the files processed with module names, - * (3) list the libraries file processed, - * (4) list base address definitions, - * (5) list global variable definitions, and - * (6) list any undefined variables. - * - * local variables: - * int i counter - * head * hdp pointer to head structure - * lbfile *lbfh pointer to library file structure - * - * global variables: - * area *ap Pointer to the current - * area structure - * area *areap The pointer to the first - * area structure of a linked list - * base *basep The pointer to the first - * base structure - * base *bsp Pointer to the current - * base structure - * lfile *filep The pointer *filep points to the - * beginning of a linked list of - * lfile structures. - * globl *globlp The pointer to the first - * globl structure - * globl *gsp Pointer to the current - * globl structure - * head *headp The pointer to the first - * head structure of a linked list - * lbfile *lbfhead The pointer to the first - * lbfile structure of a linked list - * lfile *linkp pointer to first lfile structure - * containing an input REL file - * specification - * int lop current line number on page - * int mflag Map output flag - * FILE *mfp Map output file handle - * int page current page number - * - * functions called: - * FILE * afile() lkmain.c - * int fprintf() c_library - * VOID lkexit() lkmain.c - * VOID lstarea() lklist.c - * VOID newpag() lklist.c - * VOID symdef() lksym.c +#if NOICE + case ';': + unget(c); + NoICEmagic(); + break; +#endif + + default: + break; + } +} + +/*)Function VOID map() + * + * The function map() opens the output map file and calls the various + * routines to + * (1) output the variables in each area, + * (2) list the files processed with module names, + * (3) list the libraries file processed, + * (4) list base address definitions, + * (5) list global variable definitions, and + * (6) list any undefined variables. + * + * local variables: + * int i counter + * head * hdp pointer to head structure + * lbfile *lbfh pointer to library file structure + * + * global variables: + * area *ap Pointer to the current + * area structure + * area *areap The pointer to the first + * area structure of a linked list + * base *basep The pointer to the first + * base structure + * base *bsp Pointer to the current + * base structure + * lfile *filep The pointer *filep points to the + * beginning of a linked list of + * lfile structures. + * globl *globlp The pointer to the first + * globl structure + * globl *gsp Pointer to the current + * globl structure + * head *headp The pointer to the first + * head structure of a linked list + * lbfile *lbfhead The pointer to the first + * lbfile structure of a linked list + * lfile *linkp pointer to first lfile structure + * containing an input REL file + * specification + * int lop current line number on page + * int mflag Map output flag + * FILE *mfp Map output file handle + * int page current page number + * + * functions called: + * FILE * afile() lkmain.c + * int fprintf() c_library + * VOID lkexit() lkmain.c + * VOID lstarea() lklist.c + * VOID newpag() lklist.c + * VOID chkbank() lkbank.c + * VOID symdef() lksym.c * - * side effects: - * The map file is created. + * side effects: + * The map file is created. */ VOID map(void) { - int i; - struct head *hdp; - struct lbfile *lbfh; - - if (mflag == 0) return; - - /* - * Open Map File - */ - mfp = afile(linkp->f_idp, "map", 1); - if (mfp == NULL) { - lkexit(ER_FATAL); - } - - /* - * Output Map Area Lists - */ - page = 0; - lop = NLPP; - for (ap = areap; ap != NULL; ap = ap->a_ap) { - lstarea(ap); - } - - /* - * List Linked Files - */ - newpag(mfp); - fprintf(mfp, "\nFiles Linked [ module(s) ]\n\n"); - hdp = headp; - filep = linkp->f_flp; - while (filep) { - if (strlen (filep->f_idp) > 40) - fprintf(mfp, "%s\n%40s [ ", filep->f_idp, ""); - else - fprintf(mfp, "%-40.40s [ ", filep->f_idp); - i = 0; - while ((hdp != NULL) && (hdp->h_lfile == filep)) { - if (i) - fprintf(mfp, ",\n%44s", ""); - fprintf(mfp, "%-.32s", hdp->m_id); - hdp = hdp->h_hp; - i++; - } - fprintf(mfp, " ]\n"); - filep = filep->f_flp; - } - fprintf(mfp, "\n"); - /* - * List Linked Libraries - */ - if (lbfhead != NULL) { - fprintf(mfp, "\nLibraries Linked [ object file ]\n\n"); - for (lbfh=lbfhead; lbfh; lbfh=lbfh->next) { - if (strlen (lbfh->libspc) > 40) - fprintf(mfp, "%s\n%40s [ %-.32s ]\n", - lbfh->libspc, "", lbfh->relfil); - else - fprintf(mfp, "%-40.40s [ %-.32s ]\n", - lbfh->libspc, lbfh->relfil); - } - fprintf(mfp, "\n"); - } - /* - * List Base Address Definitions - */ - if (basep) { - newpag(mfp); - fprintf(mfp, "\nUser Base Address Definitions\n\n"); - bsp = basep; - while (bsp) { - fprintf(mfp, "%s\n", bsp->b_strp); - bsp = bsp->b_base; - } - } - /* - * List Global Definitions - */ - if (globlp) { - newpag(mfp); - fprintf(mfp, "\nUser Global Definitions\n\n"); - gsp = globlp; - while (gsp) { - fprintf(mfp, "%s\n", gsp->g_strp); - gsp = gsp->g_globl; - } - } - fprintf(mfp, "\n\f"); - symdef(mfp); -} - -/*)Function int parse() - * - * The function parse() evaluates all command line or file input - * linker directives and updates the appropriate variables. - * - * local variables: - * int c character value - * int sv_type save type of processing - * char fid[] file id string - * - * global variables: - * char ctype[] array of character types, one per - * ASCII character - * lfile *lfp pointer to current lfile structure - * being processed by parse() - * lfile *linkp pointer to first lfile structure - * containing an input REL file - * specification - * int mflag Map output flag - * int oflag Output file type flag - * int pflag print linker command file flag - * FILE * stderr c_library - * int uflag Relocated listing flag - * int xflag Map file radix type flag - * int wflag Wide listing format - * int zflag Disable symbol case sensitivity - * - * Functions called: - * VOID addlib() lklibr.c - * VOID addpath() lklibr.c - * VOID bassav() lkmain.c - * VOID doparse() lkmain.c - * int fprintf() c_library - * VOID gblsav() lkmain.c - * VOID getfid() lklex.c - * int getnb() lklex.c - * VOID lkexit() lkmain.c - * char * strsto() lksym.c - * int strlen() c_library - * int fndidx() lkmain.c - * - * side effects: - * Various linker flags are updated and the linked - * structure lfile is created. + int i; + struct head *hdp; + struct lbfile *lbfh; + + if (mflag == 0) return; + + /* + * Open Map File + */ + mfp = afile(linkp->f_idp, "map", 1); + if (mfp == NULL) { + lkexit(ER_FATAL); + } + + /* + * Output Map Bank/Area Lists + */ + page = 0; + lop = NLPP; + for (bp = bankp; bp != NULL; bp = bp->b_bp) { + for (ap = areap; ap != NULL; ap = ap->a_ap) { + if (ap->a_bp == bp) + lstarea(ap, bp); + } + } + + /* + * List Linked Files + */ + newpag(mfp); + fprintf(mfp, "\nFiles Linked [ module(s) ]\n\n"); + hdp = headp; + filep = linkp->f_flp; + while (filep) { + if (strlen (filep->f_idp) > 40) + fprintf(mfp, "%s\n%40s [ ", filep->f_idp, ""); + else + fprintf(mfp, "%-40.40s [ ", filep->f_idp); + i = 0; + while ((hdp != NULL) && (hdp->h_lfile == filep)) { + if (i) + fprintf(mfp, ",\n%44s", ""); + fprintf(mfp, "%-.32s", hdp->m_id); + hdp = hdp->h_hp; + i++; + } + fprintf(mfp, " ]\n"); + filep = filep->f_flp; + } + fprintf(mfp, "\n"); + /* + * List Linked Libraries + */ + if (lbfhead != NULL) { + fprintf(mfp, "\nLibraries Linked [ object file ]\n\n"); + for (lbfh=lbfhead; lbfh; lbfh=lbfh->next) { + if (strlen (lbfh->libspc) > 40) + fprintf(mfp, "%s\n%40s [ %-.32s ]\n", + lbfh->libspc, "", lbfh->relfil); + else + fprintf(mfp, "%-40.40s [ %-.32s ]\n", + lbfh->libspc, lbfh->relfil); + } + fprintf(mfp, "\n"); + } + /* + * List Base Address Definitions + */ + if (basep) { + newpag(mfp); + fprintf(mfp, "\nUser Base Address Definitions\n\n"); + bsp = basep; + while (bsp) { + fprintf(mfp, "%s\n", bsp->b_strp); + bsp = bsp->b_base; + } + } + /* + * List Global Definitions + */ + if (globlp) { + newpag(mfp); + fprintf(mfp, "\nUser Global Definitions\n\n"); + gsp = globlp; + while (gsp) { + fprintf(mfp, "%s\n", gsp->g_strp); + gsp = gsp->g_globl; + } + } + fprintf(mfp, "\n\f"); + chkbank(mfp); + symdef(mfp); +} + +/*)Function int parse() + * + * The function parse() evaluates all command line or file input + * linker directives and updates the appropriate variables. + * + * local variables: + * int c character value + * int sv_type save type of processing + * char fid[] file id string + * + * global variables: + * char ctype[] array of character types, one per + * ASCII character + * lfile *lfp pointer to current lfile structure + * being processed by parse() + * lfile *linkp pointer to first lfile structure + * containing an input REL file + * specification + * int mflag Map output flag + * int oflag Output file type flag + * int objflg Linked file/library output object flag + * int pflag print linker command file flag + * FILE * stderr c_library + * int uflag Relocated listing flag + * int xflag Map file radix type flag + * int wflag Wide listing format + * int zflag Disable symbol case sensitivity + * + * Functions called: + * VOID addlib() lklibr.c + * VOID addpath() lklibr.c + * VOID bassav() lkmain.c + * VOID doparse() lkmain.c + * int fprintf() c_library + * VOID gblsav() lkmain.c + * VOID getfid() lklex.c + * int get() lklex.c + * int getnb() lklex.c + * VOID lkexit() lkmain.c + * char * strsto() lksym.c + * int strlen() c_library + * int fndidx() lkmain.c + * + * side effects: + * Various linker flags are updated and the linked + * structure lfile is created. */ int parse() { - int c; - char fid[NINPUT]; - - int sv_type; - - while ((c = getnb()) != 0) { - /* sdld specific */ - if ( c == ';') - return(0); - /* end sdld specific */ - if ( c == '-') { - while (ctype[c=get()] & LETTER) { - switch(c) { - - case 'C': - if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_GB)) { - codesav(); - return(0); - } - // else fall through - case 'c': - if (startp->f_type != 0) - break; - startp->f_type = F_STD; - doparse(); - return(0); - - case 'f': - case 'F': - if (startp->f_type == F_LNK) - return(0); - unget(getnb()); - if (*ip == 0) - usage(ER_FATAL); - sv_type = startp->f_type; - startp->f_idp = strsto(ip); - startp->f_idx = fndidx(ip); - startp->f_type = F_LNK; - doparse(); - if (sv_type == F_STD) { - cfp = NULL; - sfp = NULL; - startp->f_type = F_STD; - filep = startp; - } - return(0); - - case 'I': - if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_GB)) { - iramsav(); - return(0); - } - // else fall through - case 'i': - oflag = 1; - break; - - case 'S': - if (TARGET_IS_8051) { - unget(getnb()); - if (ip && *ip) - { - stacksize = expr(0); - if (stacksize > 256) stacksize = 256; - else if (stacksize < 0) stacksize = 0; - } - return(0); - } - // else fall through - case 's': - oflag = 2; - break; - - case 't': - case 'T': - oflag = 3; - break; - - case 'M': - /*JCF: memory usage summary output*/ - if (is_sdld()) { - sflag = 1; - } - // else fall through - case 'm': - mflag = 1; - break; + int c; + int sv_type; + char fid[NINPUT]; + + while ((c = getnb()) != 0) { + /* sdld specific */ + if ( c == ';') + return(0); + /* end sdld specific */ + if ( c == '-') { + while (ctype[c=get()] & LETTER) { + switch(c) { + + case 'C': + if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_GB)) { + codesav(); + return(0); + } + // else fall through + case 'c': + if (startp->f_type != 0) + break; + startp->f_type = F_STD; + doparse(); + return(0); + + case 'f': + case 'F': + if (startp->f_type == F_LNK) + return(0); + unget(getnb()); + if (*ip == 0) + usage(ER_FATAL); + sv_type = startp->f_type; + startp->f_idp = strsto(ip); + startp->f_idx = fndidx(ip); + startp->f_type = F_LNK; + doparse(); + if (sv_type == F_STD) { + cfp = NULL; + sfp = NULL; + startp->f_type = F_STD; + filep = startp; + } + return(0); + + case 'I': + if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_GB)) { + iramsav(); + return(0); + } + // else fall through + case 'i': + oflag = 1; + break; + + case 'S': + if (TARGET_IS_8051) { + unget(getnb()); + if (ip && *ip) + { + stacksize = expr(0); + if (stacksize > 256) stacksize = 256; + else if (stacksize < 0) stacksize = 0; + } + return(0); + } + // else fall through + case 's': + oflag = 2; + break; + + case 't': + case 'T': + oflag = 3; + break; + + case 'o': + case 'O': + objflg = 0; + break; + + case 'v': + case 'V': + objflg = 1; + break; + + case 'M': + /*JCF: memory usage summary output*/ + if (is_sdld()) { + sflag = 1; + break; + } + // else fall through + case 'm': + mflag = 1; + break; #if NOICE - case 'j': - case 'J': - jflag = 1; - break; + case 'j': + case 'J': + jflag = 1; + break; #endif - case 'r': - case 'R': - if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_GB)) - rflag = 1; - else - goto err; - break; - - case 'u': - case 'U': - uflag = 1; - break; - - case 'X': - if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_GB)) { - xramsav(); - return(0); - } - // else fall through - case 'x': - xflag = 0; - break; - - case 'q': - case 'Q': - xflag = 1; - break; - - case 'd': - case 'D': - xflag = 2; - break; - - case 'E': - if (TARGET_IS_6808) { - oflag = 4; - break; - } - // else fall through - case 'e': - return(1); - - case 'n': - case 'N': - pflag = 0; - break; - - case 'p': - case 'P': - pflag = 1; - break; - - case 'b': - case 'B': - bassav(); - return(0); - - case 'g': - case 'G': - gblsav(); - return(0); - - case 'k': - case 'K': - addpath(); - return(0); - - case 'l': - case 'L': - addlib(); - return(0); - - case 'w': - case 'W': - wflag = 1; - break; + case 'r': + case 'R': + if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_GB)) + rflag = 1; + else + goto err; + break; + + case 'u': + case 'U': + uflag = 1; + break; + + case 'X': + if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_GB)) { + xramsav(); + return(0); + } + // else fall through + case 'x': + xflag = 0; + break; + + case 'q': + case 'Q': + xflag = 1; + break; + + case 'd': + case 'D': + xflag = 2; + break; + + case 'E': + if (TARGET_IS_6808) { + oflag = 4; + break; + } + // else fall through + case 'e': + return(1); + + case 'n': + case 'N': + pflag = 0; + break; + + case 'p': + case 'P': + pflag = 1; + break; + + case 'b': + case 'B': + bassav(); + return(0); + + case 'g': + case 'G': + gblsav(); + return(0); + + case 'k': + case 'K': + addpath(); + return(0); + + case 'l': + case 'L': + addlib(); + return(0); + + case 'w': + case 'W': + wflag = 1; + break; #if SDCDB - case 'Y': - if (TARGET_IS_8051) { - unget(getnb()); - packflag=1; - } - // else fall through - case 'y': - yflag = 1; - break; + case 'Y': + if (TARGET_IS_8051) { + unget(getnb()); + packflag=1; + break; + } + // else fall through + case 'y': + yflag = 1; + break; #endif - case 'z': - case 'Z': - zflag = 1; - break; - - default: - err: - fprintf(stderr, - "Unkown option -%c ignored\n", c); - break; - } - } - /* sdld specific */ - if ( c == ';') - return(0); - /* end sdld specific */ - } else - if (!(ctype[c] & ILL)) { - if (linkp == NULL) { - linkp = (struct lfile *) - new (sizeof (struct lfile)); - lfp = linkp; - lfp->f_type = F_OUT; - } else { - lfp->f_flp = (struct lfile *) - new (sizeof (struct lfile)); - lfp = lfp->f_flp; - lfp->f_type = F_REL; - } - getfid(fid, c); - lfp->f_idp = strsto(fid); - } else { - fprintf(stderr, "Invalid input\n"); - lkexit(ER_FATAL); - } - } - return(0); -} - -/*)Function VOID doparse() - * - * The function doparse() evaluates all interactive - * command line or file input linker directives and - * updates the appropriate variables. - * - * local variables: - * none - * - * global variables: - * FILE * stdin standard input - * FILE * stdout standard output - * lfile *cfp The pointer *cfp points to the - * current lfile structure - * FILE *sfp The file handle sfp points to the - * currently open file - * char ib[NINPUT] .rel file text line - * char *ip pointer into the .rel file - * lfile *filep The pointer *filep points to the - * beginning of a linked list of - * lfile structures. - * lfile *startp asmlnk startup file structure - * int pflag print linker command file flag - * - * Functions called: - * int fclose() c_library - * int fprintf() c_library - * VOID getfid() lklex.c - * int nxtline() lklex.c - * int parse() lkmain.c - * - * side effects: - * Various linker flags are updated and the linked - * structure lfile may be updated. + case 'z': + case 'Z': + zflag = 1; + break; + + default: + err: + fprintf(stderr, + "Unknown option -%c ignored\n", c); + break; + } + } + /* sdld specific */ + if ( c == ';') + return(0); + /* end sdld specific */ + } else + if (!(ctype[c] & ILL)) { + if (linkp == NULL) { + linkp = (struct lfile *) + new (sizeof (struct lfile)); + lfp = linkp; + lfp->f_type = F_OUT; + } else { + lfp->f_flp = (struct lfile *) + new (sizeof (struct lfile)); + lfp = lfp->f_flp; + lfp->f_type = F_REL; + } + getfid(fid, c); + lfp->f_idp = strsto(fid); + lfp->f_obj = objflg; + } else { + fprintf(stderr, "Invalid input\n"); + lkexit(ER_FATAL); + } + } + return(0); +} + +/*)Function VOID doparse() + * + * The function doparse() evaluates all interactive + * command line or file input linker directives and + * updates the appropriate variables. + * + * local variables: + * none + * + * global variables: + * FILE * stdin standard input + * FILE * stdout standard output + * lfile *cfp The pointer *cfp points to the + * current lfile structure + * FILE *sfp The file handle sfp points to the + * currently open file + * char ib[NINPUT] .rel file text line + * char *ip pointer into the .rel file + * lfile *filep The pointer *filep points to the + * beginning of a linked list of + * lfile structures. + * lfile *startp asmlnk startup file structure + * int pflag print linker command file flag + * + * Functions called: + * int fclose() c_library + * int fprintf() c_library + * VOID getfid() lklex.c + * int nxtline() lklex.c + * int parse() lkmain.c + * + * side effects: + * Various linker flags are updated and the linked + * structure lfile may be updated. */ VOID doparse() { - cfp = NULL; - sfp = NULL; - filep = startp; - while (1) { - ip = ib; - if (nxtline() == 0) - break; - if (pflag && cfp->f_type != F_STD) - fprintf(stdout, "ASlink >> %s\n", ip); - if (*ip == 0 || parse()) - break; - } - if((sfp != NULL) && (sfp != stdin)) { - fclose(sfp); - } - sfp = NULL; - startp->f_idp = ""; - startp->f_idx = 0; - startp->f_type = 0; -} - -/*)Function VOID bassav() - * - * The function bassav() creates a linked structure containing - * the base address strings input to the linker. - * - * local variables: - * none - * - * global variables: - * base *basep The pointer to the first - * base structure - * base *bsp Pointer to the current - * base structure - * char *ip pointer into the REL file - * text line in ib[] - * - * functions called: - * int getnb() lklex.c - * VOID * new() lksym.c - * int strlen() c_library - * char * strcpy() c_library - * VOID unget() lklex.c + cfp = NULL; + sfp = NULL; + filep = startp; + while (1) { + ip = ib; + if (nxtline() == 0) + break; + if (pflag && cfp->f_type != F_STD) + fprintf(stdout, "ASlink >> %s\n", ip); + if (*ip == 0 || parse()) + break; + } + if((sfp != NULL) && (sfp != stdin)) { + fclose(sfp); + } + sfp = NULL; + startp->f_idp = ""; + startp->f_idx = 0; + startp->f_type = 0; +} + +/*)Function VOID bassav() + * + * The function bassav() creates a linked structure containing + * the base address strings input to the linker. + * + * local variables: + * none + * + * global variables: + * base *basep The pointer to the first + * base structure + * base *bsp Pointer to the current + * base structure + * char *ip pointer into the REL file + * text line in ib[] + * + * functions called: + * int getnb() lklex.c + * VOID * new() lksym.c + * int strlen() c_library + * char * strcpy() c_library + * VOID unget() lklex.c * - * side effects: - * The basep structure is created. + * side effects: + * The basep structure is created. */ VOID bassav() { - if (basep == NULL) { - basep = (struct base *) - new (sizeof (struct base)); - bsp = basep; - } else { - bsp->b_base = (struct base *) - new (sizeof (struct base)); - bsp = bsp->b_base; - } - unget(getnb()); - bsp->b_strp = (char *) new (strlen(ip)+1); - strcpy(bsp->b_strp, ip); + if (basep == NULL) { + basep = (struct base *) + new (sizeof (struct base)); + bsp = basep; + } else { + bsp->b_base = (struct base *) + new (sizeof (struct base)); + bsp = bsp->b_base; + } + unget(getnb()); + bsp->b_strp = (char *) new (strlen(ip)+1); + strcpy(bsp->b_strp, ip); } -/*)Function VOID setbas() - * - * The function setbas() scans the base address lines in the - * basep structure, evaluates the arguments, and sets beginning - * address of the specified areas. - * - * local variables: - * int v expression value - * char id[] base id string - * - * global variables: - * area *ap Pointer to the current - * area structure - * area *areap The pointer to the first - * area structure of a linked list - * base *basep The pointer to the first - * base structure - * base *bsp Pointer to the current - * base structure - * char *ip pointer into the REL file - * text line in ib[] - * int lkerr error flag - * - * functions called: - * a_uint expr() lkeval.c - * int fprintf() c_library - * VOID getid() lklex.c - * int getnb() lklex.c - * int symeq() lksym.c - * - * side effects: - * The base address of an area is set. - */ -VOID -setbas() -{ - int v; - char id[NCPS]; - - bsp = basep; - while (bsp) { - ip = bsp->b_strp; - getid(id, -1); - if (getnb() == '=') { - v = expr(0); - for (ap = areap; ap != NULL; ap = ap->a_ap) { - if (symeq(id, ap->a_id, 1)) - break; - } - if (ap == NULL) { - fprintf(stderr, - "ASlink-Warning-No definition of area %s\n", id); - lkerr++; - } else { - ap->a_addr = v; - /* sdld specific */ - ap->a_type = 1; /* JLH: value set */ - /* end sdld specific */ - } - } else { - fprintf(stderr, "ASlink-Warning-No '=' in base expression"); - lkerr++; - } - bsp = bsp->b_base; - } -} - -/*)Function VOID gblsav() - * - * The function gblsav() creates a linked structure containing - * the global variable strings input to the linker. - * - * local variable: - * none +/*)Function VOID gblsav() + * + * The function gblsav() creates a linked structure containing + * the global variable strings input to the linker. + * + * local variable: + * none + * + * global variables: + * globl *globlp The pointer to the first + * globl structure + * globl *gsp Pointer to the current + * globl structure + * char *ip pointer into the REL file + * text line in ib[] + * int lkerr error flag + * + * functions called: + * int getnb() lklex.c + * VOID * new() lksym.c + * int strlen() c_library + * char * strcpy() c_library + * VOID unget() lklex.c * - * global variables: - * globl *globlp The pointer to the first - * globl structure - * globl *gsp Pointer to the current - * globl structure - * char *ip pointer into the REL file - * text line in ib[] - * int lkerr error flag - * - * functions called: - * int getnb() lklex.c - * VOID * new() lksym.c - * int strlen() c_library - * char * strcpy() c_library - * VOID unget() lklex.c - * - * side effects: - * The globlp structure is created. + * side effects: + * The globlp structure is created. */ VOID gblsav() { - if (globlp == NULL) { - globlp = (struct globl *) - new (sizeof (struct globl)); - gsp = globlp; - } else { - gsp->g_globl = (struct globl *) - new (sizeof (struct globl)); - gsp = gsp->g_globl; - } - unget(getnb()); - gsp->g_strp = (char *) new (strlen(ip)+1); - strcpy(gsp->g_strp, ip); + if (globlp == NULL) { + globlp = (struct globl *) + new (sizeof (struct globl)); + gsp = globlp; + } else { + gsp->g_globl = (struct globl *) + new (sizeof (struct globl)); + gsp = gsp->g_globl; + } + unget(getnb()); + gsp->g_strp = (char *) new (strlen(ip)+1); + strcpy(gsp->g_strp, ip); } -/*)Function VOID setgbl() - * - * The function setgbl() scans the global variable lines in the - * globlp structure, evaluates the arguments, and sets a variable - * to this value. - * - * local variables: - * int v expression value - * char id[] base id string - * sym * sp pointer to a symbol structure - * - * global variables: - * char *ip pointer into the REL file - * text line in ib[] - * globl *globlp The pointer to the first - * globl structure - * globl *gsp Pointer to the current - * globl structure - * FILE * stderr c_library - * int lkerr error flag - * - * functions called: - * a_uint expr() lkeval.c - * int fprintf() c_library - * VOID getid() lklex.c - * int getnb() lklex.c - * sym * lkpsym() lksym.c +/*)Function VOID setgbl() + * + * The function setgbl() scans the global variable lines in the + * globlp structure, evaluates the arguments, and sets a variable + * to this value. + * + * local variables: + * int v expression value + * char id[] base id string + * sym * sp pointer to a symbol structure + * + * global variables: + * char *ip pointer into the REL file + * text line in ib[] + * globl *globlp The pointer to the first + * globl structure + * globl *gsp Pointer to the current + * globl structure + * FILE * stderr c_library + * int lkerr error flag + * + * functions called: + * a_uint expr() lkeval.c + * int fprintf() c_library + * VOID getid() lklex.c + * int getnb() lklex.c + * sym * lkpsym() lksym.c * - * side effects: - * The value of a variable is set. + * side effects: + * The value of a variable is set. */ VOID setgbl() { - int v; - struct sym *sp; - char id[NCPS]; - - gsp = globlp; - while (gsp) { - ip = gsp->g_strp; - getid(id, -1); - if (getnb() == '=') { - v = (int) expr(0); - sp = lkpsym(id, 0); - if (sp == NULL) { - fprintf(stderr, - "No definition of symbol %s\n", id); - lkerr++; - } else { - if (sp->s_type & S_DEF) { - fprintf(stderr, - "Redefinition of symbol %s\n", id); - lkerr++; - sp->s_axp = NULL; - } - sp->s_addr = v; - sp->s_type |= S_DEF; - } - } else { - fprintf(stderr, "No '=' in global expression"); - lkerr++; - } - gsp = gsp->g_globl; - } -} - -/*)Function FILE * afile(fn, ft, wf) - * - * char * fn file specification string - * char * ft file type string - * int wf 0 ==>> read - * 1 ==>> write - * 2 ==>> binary write - * - * The function afile() opens a file for reading or writing. - * (1) If the file type specification string ft - * is not NULL then a file specification is - * constructed with the file path\name in fn - * and the extension in ft. - * (2) If the file type specification string ft - * is NULL then the file specification is - * constructed from fn. If fn does not have - * a file type then the default .rel file - * type is appended to the file specification. - * - * afile() returns a file handle for the opened file or aborts - * the assembler on an open error. - * - * local variables: - * int c character value - * FILE * fp filehandle for opened file - * char * p1 pointer to filespec string fn - * char * p2 pointer to filespec string fb - * char * p3 pointer to filetype string ft - * - * global variables: - * char afspec[] constructed file specification string - * int lkerr error flag - * - * functions called: - * int fndidx() lkmain.c - * FILE * fopen() c_library - * int fprintf() c_library + int v; + struct sym *sp; + char id[NCPS]; + + gsp = globlp; + while (gsp) { + ip = gsp->g_strp; + getid(id, -1); + if (getnb() == '=') { + v = (int) expr(0); + sp = lkpsym(id, 0); + if (sp == NULL) { + fprintf(stderr, + "No definition of symbol %s\n", id); + lkerr++; + } else { + if (sp->s_type & S_DEF) { + fprintf(stderr, + "Redefinition of symbol %s\n", id); + lkerr++; + sp->s_axp = NULL; + } + sp->s_addr = v; + sp->s_type |= S_DEF; + } + } else { + fprintf(stderr, "No '=' in global expression"); + lkerr++; + } + gsp = gsp->g_globl; + } +} + +/*)Function FILE * afile(fn, ft, wf) + * + * char * fn file specification string + * char * ft file type string + * int wf 0 ==>> read + * 1 ==>> write + * 2 ==>> binary write + * + * The function afile() opens a file for reading or writing. + * (1) If the file type specification string ft + * is not NULL then a file specification is + * constructed with the file path\name in fn + * and the extension in ft. + * (2) If the file type specification string ft + * is NULL then the file specification is + * constructed from fn. If fn does not have + * a file type then the default .rel file + * type is appended to the file specification. + * + * afile() returns a file handle for the opened file or aborts + * the assembler on an open error. + * + * local variables: + * int c character value + * FILE * fp filehandle for opened file + * char * p1 pointer to filespec string fn + * char * p2 pointer to filespec string fb + * char * p3 pointer to filetype string ft + * + * global variables: + * char afspec[] constructed file specification string + * int lkerr error flag + * + * functions called: + * int fndidx() lkmain.c + * FILE * fopen() c_library + * int fprintf() c_library * - * side effects: - * File is opened for read or write. + * side effects: + * File is opened for read or write. */ FILE * afile(char *fn, char *ft, int wf) { - char *p1, *p2; - int c; - char * frmt; - FILE *fp; - - if (strlen(fn) > (FILSPC-7)) { - fprintf(stderr, "?ASlink-Error- : \"%s\"\n", fn); - lkerr++; - return(NULL); - } - - /* - * Skip The Path - */ - strcpy(afspec, fn); - c = fndidx(afspec); - - /* - * Skip to File Extension separator - */ - p1 = strrchr(&afspec[c], FSEPX); - - /* - * Copy File Extension - */ - p2 = ft ? ft : ""; - if (*p2 == 0) { - if (p1 == NULL) { - p2 = LKOBJEXT; - } else { - p2 = strrchr(&fn[c], FSEPX) + 1; - } - } - if (p1 == NULL) { - p1 = &afspec[strlen(afspec)]; - } - *p1++ = FSEPX; - while ((c = *p2++) != 0) { - if (p1 < &afspec[FILSPC-1]) - *p1++ = c; - } - *p1++ = 0; - - /* - * Select Read/Write/Binary Write - */ - switch(wf) { - default: - case 0: frmt = "r"; break; - case 1: frmt = "w"; break; -#ifdef DECUS - case 2: frmt = "wn"; break; + char *p1, *p2; + int c; + char * frmt; + FILE *fp; + + if (strlen(fn) > (FILSPC-7)) { + fprintf(stderr, "?ASlink-Error- : \"%s\"\n", fn); + lkerr++; + return(NULL); + } + + /* + * Skip The Path + */ + strcpy(afspec, fn); + c = fndidx(afspec); + + /* + * Skip to File Extension separator + */ + p1 = strrchr(&afspec[c], FSEPX); + + /* + * Copy File Extension + */ + p2 = ft ? ft : ""; + if (*p2 == 0) { + if (p1 == NULL) { + p2 = LKOBJEXT; + } else { + p2 = strrchr(&fn[c], FSEPX) + 1; + } + } + if (p1 == NULL) { + p1 = &afspec[strlen(afspec)]; + } + *p1++ = FSEPX; + while ((c = *p2++) != 0) { + if (p1 < &afspec[FILSPC-1]) + *p1++ = c; + } + *p1++ = 0; + + /* + * Select Read/Write/Binary Write + */ + switch(wf) { + default: + case 0: frmt = "r"; break; + case 1: frmt = "w"; break; +#ifdef DECUS + case 2: frmt = "wn"; break; #else - case 2: frmt = "wb"; break; + case 2: frmt = "wb"; break; #endif - } - if ((fp = fopen(afspec, frmt)) == NULL && strcmp(ft,"adb") != 0) { /* Do not complain for optional adb files */ - fprintf(stderr, "?ASlink-Error- : \"%s\"\n", wf?"create":"open", afspec); - lkerr++; - } - return (fp); + } + if ((fp = fopen(afspec, frmt)) == NULL && strcmp(ft,"adb") != 0) { /* Do not complain for optional adb files */ + fprintf(stderr, "?ASlink-Error- : \"%s\"\n", wf?"create":"open", afspec); + lkerr++; + } + return (fp); } -/*)Function int fndidx(str) +/*)Function int fndidx(str) * - * char * str file specification string + * char * str file specification string * - * The function fndidx() scans the file specification string - * to find the index to the file name. If the file - * specification contains a 'path' then the index will - * be non zero. + * The function fndidx() scans the file specification string + * to find the index to the file name. If the file + * specification contains a 'path' then the index will + * be non zero. * - * fndidx() returns the index value. + * fndidx() returns the index value. * - * local variables: - * char * p1 temporary pointer - * char * p2 temporary pointer + * local variables: + * char * p1 temporary pointer + * char * p2 temporary pointer * - * global variables: - * none + * global variables: + * none * - * functions called: - * char * strrchr() c_library + * functions called: + * char * strrchr() c_library * - * side effects: - * none + * side effects: + * none */ int fndidx(str) char *str; { - char *p1, *p2; + char *p1, *p2; - /* - * Skip Path Delimiters - */ - p1 = str; - if ((p2 = strrchr(p1, ':')) != NULL) { p1 = p2 + 1; } - if ((p2 = strrchr(p1, '/')) != NULL) { p1 = p2 + 1; } - if ((p2 = strrchr(p1, '\\')) != NULL) { p1 = p2 + 1; } + /* + * Skip Path Delimiters + */ + p1 = str; + if ((p2 = strrchr(p1, ':')) != NULL) { p1 = p2 + 1; } + if ((p2 = strrchr(p1, '/')) != NULL) { p1 = p2 + 1; } + if ((p2 = strrchr(p1, '\\')) != NULL) { p1 = p2 + 1; } - return((int) (p1 - str)); + return((int) (p1 - str)); } -/*)Function int fndext(str) +/*)Function int fndext(str) * - * char * str file specification string + * char * str file specification string * - * The function fndext() scans the file specification string - * to find the file.ext separater. + * The function fndext() scans the file specification string + * to find the file.ext separater. * - * fndext() returns the index to FSEPX or the end of the string. + * fndext() returns the index to FSEPX or the end of the string. * - * local variables: - * char * p1 temporary pointer - * char * p2 temporary pointer + * local variables: + * char * p1 temporary pointer + * char * p2 temporary pointer * - * global variables: - * none + * global variables: + * none * - * functions called: - * char * strrchr() c_library + * functions called: + * char * strrchr() c_library * - * side effects: - * none + * side effects: + * none */ int fndext(str) char * str; { - char *p1, *p2; + char *p1, *p2; - /* - * Find the file separator - */ - p1 = str + strlen(str); - if ((p2 = strrchr(str, FSEPX)) != NULL) { p1 = p2; } + /* + * Find the file separator + */ + p1 = str + strlen(str); + if ((p2 = strrchr(str, FSEPX)) != NULL) { p1 = p2; } - return((int) (p1 - str)); + return((int) (p1 - str)); } /* sdld specific */ -/*)Function VOID iramsav() +/*)Function VOID iramsav() * - * The function iramsav() stores the size of the chip's internal RAM. - * This is used after linking to check that variable assignment to this - * dataspace didn't overflow into adjoining segments. Variables in the - * DSEG, OSEG, and ISEG are assigned to this dataspace. - * - * local variables: - * none - * - * global variables: - * char *ip pointer into the REL file - * text line in ib[] - * unsigned int size of chip's internal - * iram_size RAM segment - * - * functions called: - * int getnb() lklex.c - * VOID unget() lklex.c - * a_uint expr() lkeval.c + * The function iramsav() stores the size of the chip's internal RAM. + * This is used after linking to check that variable assignment to this + * dataspace didn't overflow into adjoining segments. Variables in the + * DSEG, OSEG, and ISEG are assigned to this dataspace. + * + * local variables: + * none + * + * global variables: + * char *ip pointer into the REL file + * text line in ib[] + * unsigned int size of chip's internal + * iram_size RAM segment + * + * functions called: + * int getnb() lklex.c + * VOID unget() lklex.c + * a_uint expr() lkeval.c * - * side effects: - * The iram_size may be modified. + * side effects: + * The iram_size may be modified. */ VOID @@ -1636,11 +1587,11 @@ { unget(getnb()); if (ip && *ip) - iram_size = expr(0); /* evaluate size expression */ + iram_size = expr(0); /* evaluate size expression */ else - iram_size = 128; /* Default is 128 (0x80) bytes */ + iram_size = 128; /* Default is 128 (0x80) bytes */ if ((iram_size<=0) || (iram_size>256)) - iram_size = 128; /* Default is 128 (0x80) bytes */ + iram_size = 128; /* Default is 128 (0x80) bytes */ } /*Similar to iramsav but for xram memory*/ @@ -1649,9 +1600,9 @@ { unget(getnb()); if (ip && *ip) - xram_size = expr(0); /* evaluate size expression */ + xram_size = expr(0); /* evaluate size expression */ else - xram_size = rflag?0x1000000:0x10000; + xram_size = rflag?0x1000000:0x10000; } /*Similar to iramsav but for code memory*/ @@ -1660,31 +1611,31 @@ { unget(getnb()); if (ip && *ip) - code_size = expr(0); /* evaluate size expression */ + code_size = expr(0); /* evaluate size expression */ else - code_size = rflag?0x1000000:0x10000; + code_size = rflag?0x1000000:0x10000; } -/*)Function VOID iramcheck() +/*)Function VOID iramcheck() * - * The function iramcheck() is used at the end of linking to check that - * the internal RAM area wasn't overflowed by too many variable - * assignments. Variables in the DSEG, ISEG, and OSEG are assigned to - * the chip's internal RAM. + * The function iramcheck() is used at the end of linking to check that + * the internal RAM area wasn't overflowed by too many variable + * assignments. Variables in the DSEG, ISEG, and OSEG are assigned to + * the chip's internal RAM. * - * local variables: - * none + * local variables: + * none * - * global variables: - * unsigned int size of chip's internal - * iram_size RAM segment - * struct area linked list of memory - * *areap areas + * global variables: + * unsigned int size of chip's internal + * iram_size RAM segment + * struct area linked list of memory + * *areap areas * - * functions called: + * functions called: * - * side effects: + * side effects: */ VOID @@ -1694,252 +1645,252 @@ register struct area *ap; for (ap = areap; ap; ap=ap->a_ap) { - if ((ap->a_size != 0) && - (!strcmp(ap->a_id, "DSEG") || - !strcmp(ap->a_id, "OSEG") || - !strcmp(ap->a_id, "ISEG") - ) - ) - { - last_addr = ap->a_addr + ap->a_size - 1; - if (last_addr >= iram_size) - fprintf(stderr, - "\nWARNING! Segment %s extends past the end\n" - " of internal RAM. Check map file.\n", - ap->a_id); - } + if ((ap->a_size != 0) && + (!strcmp(ap->a_id, "DSEG") || + !strcmp(ap->a_id, "OSEG") || + !strcmp(ap->a_id, "ISEG") + ) + ) + { + last_addr = ap->a_addr + ap->a_size - 1; + if (last_addr >= iram_size) + fprintf(stderr, + "\nWARNING! Segment %s extends past the end\n" + " of internal RAM. Check map file.\n", + ap->a_id); + } } } /* end sdld specific */ char *usetxt[] = { - "Usage: [-Options] [-Option with arg] file", - "Usage: [-Options] [-Option with arg] outfile file1 [file2 ...]", - "Startup:", - " -p Echo commands to stdout (default)", - " -n No echo of commands to stdout", - "Alternates to Command Line Input:", - " -c ASlink >> prompt input", - " -f file[.lk] Command File input", - "Libraries:", - " -k Library path specification, one per -k", - " -l Library file specification, one per -l", - "Relocation:", - " -b area base address = expression", - " -g global symbol = expression", - "Map format:", - " -m Map output generated as (out)file[.map]", - " -w Wide listing format for map file", - " -x Hexadecimal (default)", - " -d Decimal", - " -q Octal", - "Output:", - " -i Intel Hex as (out)file[.ihx]", - " -s Motorola S Record as (out)file[.s19]", -// " -t Tandy CoCo Disk BASIC binary as (out)file[.bi-]", + "Usage: [-Options] [-Option with arg] file", + "Usage: [-Options] [-Option with arg] outfile file1 [file2 ...]", + "Startup:", + " -p Echo commands to stdout (default)", + " -n No echo of commands to stdout", + "Alternates to Command Line Input:", + " -c ASlink >> prompt input", + " -f file[.lk] Command File input", + "Libraries:", + " -k Library path specification, one per -k", + " -l Library file specification, one per -l", + "Relocation:", + " -b area base address = expression", + " -g global symbol = expression", + "Map format:", + " -m Map output generated as (out)file[.map]", + " -w Wide listing format for map file", + " -x Hexadecimal (default)", + " -d Decimal", + " -q Octal", + "Output:", + " -i Intel Hex as (out)file[.ihx]", + " -s Motorola S Record as (out)file[.s19]", +// " -t Tandy CoCo Disk BASIC binary as (out)file[.bi-]", #if NOICE - " -j NoICE Debug output as (out)file[.noi]", + " -j NoICE Debug output as (out)file[.noi]", #endif #if SDCDB - " -y SDCDB Debug output as (out)file[.cdb]", + " -y SDCDB Debug output as (out)file[.cdb]", #endif -// " -o Linked file/library object output enable (default)", -// " -v Linked file/library object output disable", - "List:", - " -u Update listing file(s) with link data as file(s)[.rst]", - "Case Sensitivity:", - " -z Disable Case Sensitivity for Symbols", - "End:", - " -e or null line terminates input", - "", - 0 +// " -o Linked file/library object output enable (default)", +// " -v Linked file/library object output disable", + "List:", + " -u Update listing file(s) with link data as file(s)[.rst]", + "Case Sensitivity:", + " -z Disable Case Sensitivity for Symbols", + "End:", + " -e or null line terminates input", + "", + 0 }; char *usetxt_8051[] = { - "Usage: [-Options] [-Option with arg] file", - "Usage: [-Options] [-Option with arg] outfile file1 [file2 ...]", - "Startup:", - " -p Echo commands to stdout (default)", - " -n No echo of commands to stdout", - "Alternates to Command Line Input:", - " -c ASlink >> prompt input", - " -f file[.lk] Command File input", - "Libraries:", - " -k Library path specification, one per -k", - " -l Library file specification, one per -l", - "Relocation:", - " -b area base address = expression", - " -g global symbol = expression", - "Map format:", - " -m Map output generated as (out)file[.map]", - " -w Wide listing format for map file", - " -x Hexadecimal (default)", - " -d Decimal", - " -q Octal", - "Output:", - " -i Intel Hex as (out)file[.ihx]", - " -s Motorola S Record as (out)file[.s19]", + "Usage: [-Options] [-Option with arg] file", + "Usage: [-Options] [-Option with arg] outfile file1 [file2 ...]", + "Startup:", + " -p Echo commands to stdout (default)", + " -n No echo of commands to stdout", + "Alternates to Command Line Input:", + " -c ASlink >> prompt input", + " -f file[.lk] Command File input", + "Libraries:", + " -k Library path specification, one per -k", + " -l Library file specification, one per -l", + "Relocation:", + " -b area base address = expression", + " -g global symbol = expression", + "Map format:", + " -m Map output generated as (out)file[.map]", + " -w Wide listing format for map file", + " -x Hexadecimal (default)", + " -d Decimal", + " -q Octal", + "Output:", + " -i Intel Hex as (out)file[.ihx]", + " -s Motorola S Record as (out)file[.s19]", #if NOICE - " -j NoICE Debug output as (out)file[.noi]", + " -j NoICE Debug output as (out)file[.noi]", #endif #if SDCDB - " -y SDCDB Debug output as (out)file[.cdb]", + " -y SDCDB Debug output as (out)file[.cdb]", #endif - "List:", - " -u Update listing file(s) with link data as file(s)[.rst]", - "Case Sensitivity:", - " -z Disable Case Sensitivity for Symbols", - "Miscellaneous:\n" - " -I [iram-size] Check for internal RAM overflow", - " -X [xram-size] Check for external RAM overflow", - " -C [code-size] Check for code overflow", - " -M Generate memory usage summary file[.mem]", - " -Y Pack internal ram", - " -S [stack-size] Allocate space for stack", - "End:", - " -e or null line terminates input", - "", - 0 + "List:", + " -u Update listing file(s) with link data as file(s)[.rst]", + "Case Sensitivity:", + " -z Disable Case Sensitivity for Symbols", + "Miscellaneous:\n" + " -I [iram-size] Check for internal RAM overflow", + " -X [xram-size] Check for external RAM overflow", + " -C [code-size] Check for code overflow", + " -M Generate memory usage summary file[.mem]", + " -Y Pack internal ram", + " -S [stack-size] Allocate space for stack", + "End:", + " -e or null line terminates input", + "", + 0 }; char *usetxt_6808[] = { - "Usage: [-Options] [-Option with arg] file", - "Usage: [-Options] [-Option with arg] outfile file1 [file2 ...]", - "Startup:", - " -p Echo commands to stdout (default)", - " -n No echo of commands to stdout", - "Alternates to Command Line Input:", - " -c ASlink >> prompt input", - " -f file[.lk] Command File input", - "Libraries:", - " -k Library path specification, one per -k", - " -l Library file specification, one per -l", - "Relocation:", - " -b area base address = expression", - " -g global symbol = expression", - "Map format:", - " -m Map output generated as (out)file[.map]", - " -w Wide listing format for map file", - " -x Hexadecimal (default)", - " -d Decimal", - " -q Octal", - "Output:", - " -i Intel Hex as (out)file[.ihx]", - " -s Motorola S Record as (out)file[.s19]", - " -E ELF executable as file[.elf]", + "Usage: [-Options] [-Option with arg] file", + "Usage: [-Options] [-Option with arg] outfile file1 [file2 ...]", + "Startup:", + " -p Echo commands to stdout (default)", + " -n No echo of commands to stdout", + "Alternates to Command Line Input:", + " -c ASlink >> prompt input", + " -f file[.lk] Command File input", + "Libraries:", + " -k Library path specification, one per -k", + " -l Library file specification, one per -l", + "Relocation:", + " -b area base address = expression", + " -g global symbol = expression", + "Map format:", + " -m Map output generated as (out)file[.map]", + " -w Wide listing format for map file", + " -x Hexadecimal (default)", + " -d Decimal", + " -q Octal", + "Output:", + " -i Intel Hex as (out)file[.ihx]", + " -s Motorola S Record as (out)file[.s19]", + " -E ELF executable as file[.elf]", #if NOICE - " -j NoICE Debug output as (out)file[.noi]", + " -j NoICE Debug output as (out)file[.noi]", #endif #if SDCDB - " -y SDCDB Debug output as (out)file[.cdb]", + " -y SDCDB Debug output as (out)file[.cdb]", #endif - "List:", - " -u Update listing file(s) with link data as file(s)[.rst]", - "Case Sensitivity:", - " -z Disable Case Sensitivity for Symbols", - "Miscellaneous:\n" - " -I [iram-size] Check for internal RAM overflow", - " -X [xram-size] Check for external RAM overflow", - " -C [code-size] Check for code overflow", - " -M Generate memory usage summary file[.mem]", - "End:", - " -e or null line terminates input", - "", - 0 + "List:", + " -u Update listing file(s) with link data as file(s)[.rst]", + "Case Sensitivity:", + " -z Disable Case Sensitivity for Symbols", + "Miscellaneous:\n" + " -I [iram-size] Check for internal RAM overflow", + " -X [xram-size] Check for external RAM overflow", + " -C [code-size] Check for code overflow", + " -M Generate memory usage summary file[.mem]", + "End:", + " -e or null line terminates input", + "", + 0 }; char *usetxt_z80_gb[] = { - "Usage: [-Options] [-Option with arg] file", - "Usage: [-Options] [-Option with arg] outfile file1 [file2 ...]", - "Startup:", - " -p Echo commands to stdout (default)", - " -n No echo of commands to stdout", - "Alternates to Command Line Input:", - " -c ASlink >> prompt input", - " -f file[.lk] Command File input", - "Libraries:", - " -k Library path specification, one per -k", - " -l Library file specification, one per -l", - "Relocation:", - " -b area base address = expression", - " -g global symbol = expression", - "Map format:", - " -m Map output generated as (out)file[.map]", - " -w Wide listing format for map file", - " -x Hexadecimal (default)", - " -d Decimal", - " -q Octal", - "Output:", - " -i Intel Hex as (out)file[.ihx]", - " -s Motorola S Record as (out)file[.s19]", + "Usage: [-Options] [-Option with arg] file", + "Usage: [-Options] [-Option with arg] outfile file1 [file2 ...]", + "Startup:", + " -p Echo commands to stdout (default)", + " -n No echo of commands to stdout", + "Alternates to Command Line Input:", + " -c ASlink >> prompt input", + " -f file[.lk] Command File input", + "Libraries:", + " -k Library path specification, one per -k", + " -l Library file specification, one per -l", + "Relocation:", + " -b area base address = expression", + " -g global symbol = expression", + "Map format:", + " -m Map output generated as (out)file[.map]", + " -w Wide listing format for map file", + " -x Hexadecimal (default)", + " -d Decimal", + " -q Octal", + "Output:", + " -i Intel Hex as (out)file[.ihx]", + " -s Motorola S Record as (out)file[.s19]", #if SDCDB - " -y SDCDB Debug output as (out)file[.cdb]", + " -y SDCDB Debug output as (out)file[.cdb]", #endif - "List:", - " -u Update listing file(s) with link data as file(s)[.rst]", - "Case Sensitivity:", - " -z Disable Case Sensitivity for Symbols", - "End:", - " -e or null line terminates input", - "", - 0 + "List:", + " -u Update listing file(s) with link data as file(s)[.rst]", + "Case Sensitivity:", + " -z Disable Case Sensitivity for Symbols", + "End:", + " -e or null line terminates input", + "", + 0 }; -/*)Function VOID usage(n) +/*)Function VOID usage(n) * - * int n exit code + * int n exit code * - * The function usage() outputs to the stderr device the - * linker name and version and a list of valid linker options. + * The function usage() outputs to the stderr device the + * linker name and version and a list of valid linker options. * - * local variables: - * char ** dp pointer to an array of - * text string pointers. + * local variables: + * char ** dp pointer to an array of + * text string pointers. * - * global variables: - * FILE * stderr c_library + * global variables: + * FILE * stderr c_library * - * functions called: - * int fprintf() c_library + * functions called: + * int fprintf() c_library * - * side effects: - * none + * side effects: + * none */ VOID usage(int n) { - char **dp; + char **dp; - /* sdld specific */ - fprintf(stderr, "\n%s Linker %s\n\n", is_sdld() ? "sdld" : "ASxxxx", VERSION); - for (dp = TARGET_IS_8051 ? usetxt_8051 : (TARGET_IS_6808 ? usetxt_6808 : ((TARGET_IS_Z80 || TARGET_IS_GB) ? usetxt_z80_gb : usetxt)); *dp; dp++) - fprintf(stderr, "%s\n", *dp); - /* end sdld specific */ - lkexit(n); + /* sdld specific */ + fprintf(stderr, "\n%s Linker %s\n\n", is_sdld() ? "sdld" : "ASxxxx", VERSION); + for (dp = TARGET_IS_8051 ? usetxt_8051 : (TARGET_IS_6808 ? usetxt_6808 : ((TARGET_IS_Z80 || TARGET_IS_GB) ? usetxt_z80_gb : usetxt)); *dp; dp++) + fprintf(stderr, "%s\n", *dp); + /* end sdld specific */ + lkexit(n); } -/*)Function VOID copyfile() +/*)Function VOID copyfile() * - * FILE *dest destination file - * FILE *src source file + * FILE *dest destination file + * FILE *src source file * - * function will copy source file to destination file + * function will copy source file to destination file * * - * functions called: - * int fgetc() c_library - * int fputc() c_library + * functions called: + * int fgetc() c_library + * int fputc() c_library * - * side effects: - * none + * side effects: + * none */ VOID copyfile (FILE *dest, FILE *src) { - int ch; + int ch; - while ((ch = fgetc(src)) != EOF) { - fputc(ch,dest); - } + while ((ch = fgetc(src)) != EOF) { + fputc(ch,dest); + } } diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lkmem.c sdcc-3.2.0+dfsg/sdas/linksrc/lkmem.c --- sdcc-3.1.0+dfsg/sdas/linksrc/lkmem.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lkmem.c 2011-12-03 23:42:25.000000000 +0000 @@ -614,8 +614,8 @@ /*Report the position of the begining of the stack*/ if(Stack_Start!=256) - fprintf(of, "\n%stack starts at: 0x%02lx (sp set to 0x%02lx) with %ld bytes available.", - rflag ? "16 bit mode initial s" : "S", Stack_Start, Stack_Start-1, Stack_Size); + fprintf(of, "\n%s starts at: 0x%02lx (sp set to 0x%02lx) with %ld bytes available.", + rflag ? "16 bit mode initial stack" : "Stack", Stack_Start, Stack_Start-1, Stack_Size); else fprintf(of, "\nI don't have a clue where the stack ended up! Sorry..."); diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lknoice.c sdcc-3.2.0+dfsg/sdas/linksrc/lknoice.c --- sdcc-3.1.0+dfsg/sdas/linksrc/lknoice.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lknoice.c 2011-12-06 23:01:37.000000000 +0000 @@ -27,101 +27,267 @@ * 31-Oct-1997 by John Hartman * 30-Jan-98 JLH add page to DefineNoICE for 8051 * 2-Feb-98 JLH Allow optional .nest on local vars - C scoping rules... + * 27-May-01 ARB Updated for ASxxxx V4 */ #include "aslink.h" -static void DefineGlobal( char *name, a_uint value, int page ); -static void DefineScoped( char *name, a_uint value, int page ); -static void DefineFile( char *name, a_uint value, int page ); -static void DefineFunction( char *name, a_uint value, int page ); -static void DefineStaticFunction( char *name, a_uint value, int page ); -static void DefineEndFunction( a_uint value, int page ); -static void DefineLine( char *lineString, a_uint value, int page ); -static void PagedAddress( a_uint value, int page ); - -/*)Function VOID NoICEfopen() - * - * The function NoICEfile() opens the NoICE output file - * and sets the map flag, mflag, to create a map file. - * NoICE processing is performed during map generation. - * - * local variables: - * none - * - * global variables: - * int jflag NoICE Debug flag - * FILE * jfp NoICE Debug File handle - * struct lfile *linkp Pointer to the Linker output file name - * int mflag Map output flag - * - * functions called: - * FILE * afile() lkmain.c - * VOID lkexit() lkmain.c - * - * side effects: - * The NoICE output file is opened. - * Failure to open the file will - * terminate the linker. + +#if NOICE + +/*Module lknoice.c + * + * The module lknoice.c contains the functions + * required to create a NoICE debug file. + * + * lknoice.c contains the following functions: + * VOID NoICEfopen() + * VOID NoICEmagic() + * VOID DefineNoICE() + * VOID DefineGlobal() + * VOID DefineScoped() + * VOID DefineFile() + * VOID DefineFunction() + * VOID DefineStaticFunction() + * VOID DefineEndFunction() + * VOID DefineLine() + * VOID PagedAddress() + * + * lknoice.c contains these local variables: + * struct noicebn *noicebnp pointer to linked structure of + * ';!FILE' specifications + * char currentFile[] file being processed + * char currentFunction[] function being processed + */ + +struct noicefn { + struct noicefn *n_np; /* noicefn link */ + char * n_id; /* file name */ +}; + +static struct noicefn *noicefnp = NULL; + +static char currentFile[NCPS]; +static char currentFunction[NCPS]; + + +/*)Function VOID NoICEfopen() + * + * The function NoICEfopen() opens the NoICE output file + * and sets the map flag, mflag, to create a map file. + * NoICE processing is performed during map generation. + * + * local variables: + * none + * + * global variables: + * int jflag NoICE Debug flag + * FILE * jfp NoICE Debug File handle + * struct lfile *linkp Pointer to the Linker output file name + * int mflag Map output flag + * + * functions called: + * FILE * afile() lkmain.c + * VOID lkexit() lkmain.c + * + * side effects: + * The NoICE output file is opened. + * Failure to open the file will + * terminate the linker. */ VOID NoICEfopen(void) { - if (jflag) { - jfp = afile(linkp->f_idp, "noi", 1); - if (jfp == NULL) { - lkexit(1); - } - mflag = 1; - } + if (jflag) { + jfp = afile(linkp->f_idp, "noi", 1); + if (jfp == NULL) { + lkexit(1); + } + mflag = 1; + } +} + + +/*)Function VOID NoICEmagic() + * + * The function NoICEmagic() passes any "magic Comments" + * to the NoICE output file. Magic comments are those + * beginning with ";!". Also a linked list of file names + * specified in ";!FILE" magic comments is created. These + * file names are used to verify that symbols in the + * ASxxxx .rel files of the form str1.str2 are NoICE symbols. + * + * local variables: + * char id[] id string + * struct noicefn * np pointer to new structure + * char * p1 temporary string pointer + * char * p2 temporary string pointer + * struct noicefn * tnp temporary pointer to noicefn structure + * + * global variables: + * char * ip position into the current + * input text line + * FILE * jfp NoICE Debug File handle + * + * functions called: + * VOID getid() lklex.c + * VOID * new() lksym.c + * int fprintf() c_library + * char * strrchr() c_library + * char * strsto() lksym.c + * int symeq() lksym.c + * + * side effects: + * The NoICE "magic comments" are passed + * to the output file. A list of assembler + * file names is created. + */ + +VOID NoICEmagic(void) +{ + char id[NCPS]; + char *p1, *p2; + struct noicefn *np, *tnp; + + /* + * Pass any "magic comments" to NoICE output + */ + if ((ip[0] == ';') && (ip[1] == '!')) { + if (jfp) { + fprintf(jfp, "%s\n", &ip[2]); + } + if (pass == 0) { + getid(id, -1); + if (symeq(id, ";!FILE", 1)) { + getid(id, -1); + /* + * The name starts after the last + * '/' (Unices) or + * ':' or '\' (DOS) + * + * and ends at the last + * separator 'FSEPX' + */ + p1 = id; + if ((p2 = strrchr(p1, '\\')) != NULL) p1 = ++p2; + if ((p2 = strrchr(p1, '/')) != NULL) p1 = ++p2; + if ((p2 = strrchr(p1, ':')) != NULL) p1 = ++p2; + if ((p2 = strrchr(p1, FSEPX)) != NULL) *p2 = 0; + + np = (struct noicefn *) new (sizeof(struct noicefn)); + if (noicefnp == NULL) { + noicefnp = np; + } else { + tnp = noicefnp; + while (tnp->n_np) + tnp = tnp->n_np; + tnp->n_np = np; + } + np->n_id = strsto(p1); + } + } + } } -/* - * Called from lstarea in lklist.c for each symbol. + +/*)Function VOID DefineNoICE() + * + * char * name pointer to the symbol string + * a_uint value value of symbol + * struct bank * yp pointer to associated bank + * + * The function DefineNoICE() processes the symbols into + * NoICE commands for inclusion in the NoICE output file. + * + * The function is called from lstarea in lklist.c + * for each symbol. + * + * local variables: + * int j parsed argument count + * int k parsed argument count + * int level function level + * char token1[] parsed string + * char token2[] parsed string + * char token2[] parsed string + * char sep1 parsed character + * char sep2 parsed character + * struct noicefn * tnp temporary pointer to noicefn structure * - * Generates appropriate NoICE commands into output file, if any is open + * global variables: + * FILE * jfp NoICE Debug File handle * + * functions called: + * VOID DefineFile() lknoice.c + * VOID DefineFunction() lknoice.c + * VOID DefineStaticFunction() lknoice.c + * VOID DefineEndFunction() lknoice.c + * VOID DefineScoped() lknoice.c + * VOID DefineLine() lknoice.c + * VOID DefineGlobal() lknoice.c + * VOID PagedAddress() lknoice.c + * int sprintf() c_library + * int sscanf() c_library + * int symeq() lksym.c + * + * side effects: + * NoICE debug commands are placed + * into the output file. */ -void DefineNoICE( char *name, a_uint value, int page ) +void DefineNoICE( char *name, a_uint value, struct bank *yp ) { char token1[NCPS]; /* parse for file.function.symbol */ char token2[NCPS]; char token3[NCPS]; char sep1, sep2; - int j, level; + int j, k, level; + struct noicefn *np; /* no output if file is not open */ if (jfp == NULL) return; j = sscanf( name, "%[^.]%c%[^.]%c%s", token1, &sep1, token2, &sep2, token3 ); + if (j > 1) { + /* verify that first token is a file name */ + k = 1; + np = noicefnp; + while (np != NULL) { + if (symeq(token1, np->n_id, 1)) { + k = j; + break; + } + np = np->n_np; + } + j = k; + } + switch (j) { /* file.function.symbol, or file.function..SPECIAL */ case 5: - DefineFile( token1, 0, 0 ); + DefineFile( token1, 0, NULL ); if (token3[0] == '.') { if (symeq( token3, ".FN", 1 ) != 0) { /* Global function */ - DefineFunction( token2, value, page ); + DefineFunction( token2, value, yp ); } else if (symeq( token3, ".SFN", 1 ) != 0) { /* Static (file-scope) function */ - DefineStaticFunction( token2, value, page ); + DefineStaticFunction( token2, value, yp ); } else if (symeq( token3, ".EFN", 1 ) != 0) { /* End of function */ - DefineEndFunction( value, page ); + DefineEndFunction( value, yp ); } } else { /* Function-scope var. */ - DefineFunction( token2, 0, 0 ); + DefineFunction( token2, 0, NULL ); /* Look for optional level integer */ j = sscanf( token3, "%[^.]%c%u", token1, &sep1, &level ); @@ -129,72 +295,133 @@ { sprintf( &token1[ strlen(token1) ], "_%u", level ); } - DefineScoped( token1, value, page ); + DefineScoped( token1, value, yp ); } break; /* either file.symbol or file.line# */ case 3: - DefineFile( token1, 0, 0 ); + DefineFile( token1, 0, NULL ); if ((token2[0] >= '0') && (token2[0] <= '9')) { /* Line number */ - DefineLine( token2, value, page ); + DefineLine( token2, value, yp ); } else { /* File-scope symbol. (Kill any function) */ - DefineEndFunction( 0, 0 ); - DefineScoped( token2, value, page ); + DefineEndFunction( 0, NULL ); + DefineScoped( token2, value, yp ); } break; /* NoICE file.func. is illegal */ case 4: - break; /* NoICE symbol. is illegal */ case 2: - break; /* just a symbol */ case 1: - DefineGlobal( token1, value, page ); + + /* NoICE .symbol is illegal */ + case 0: + default: + DefineGlobal( name, value, yp ); break; } } -static char currentFile[NCPS]; -static char currentFunction[NCPS]; -/* - * static function: - * Define "name" as a global symbol +/*)Function VOID DefineGlobal() + * + * char * name pointer to the symbol string + * a_uint value value of symbol + * struct bank * yp pointer to associated bank + * + * The function DefineGlobal() places a DEF statement + * in the .noi debug file for the global symbol. + * + * local variables: + * none + * + * global variables: + * FILE * jfp NoICE Debug File handle + * + * functions called: + * int fprintf() c_library + * VOID PagedAddress() lknoice.c + * + * side effects: + * A global symbol definition is + * placed in the .noi debug file. */ -void DefineGlobal( char *name, a_uint value, int page ) +void DefineGlobal( char *name, a_uint value, struct bank *yp ) { fprintf( jfp, "DEF %s ", name ); - PagedAddress( value, page ); + PagedAddress( value, yp ); } -/* - * static function: - * Define "name" as a static (scoped) symbol + +/*)Function VOID DefineScoped() + * + * char * name pointer to the symbol string + * a_uint value value of symbol + * struct bank * yp pointer to associated bank + * + * The function DefineScoped() places a DEFS statement + * in the .noi debug file for the scoped symbol. + * + * local variables: + * none + * + * global variables: + * FILE * jfp NoICE Debug File handle + * + * functions called: + * int fprintf() c_library + * VOID PagedAddress() lknoice.c + * + * side effects: + * A scoped symbol definition is + * placed in the .noi debug file. */ -void DefineScoped( char *name, a_uint value, int page ) +void DefineScoped( char *name, a_uint value, struct bank *yp ) { fprintf( jfp, "DEFS %s ", name ); - PagedAddress( value, page ); + PagedAddress( value, yp ); } -/* - * static function: - * Define "name" as the current file + +/*)Function VOID DefineFile() + * + * char * name pointer to the symbol string + * a_uint value value of symbol + * struct bank * yp pointer to associated bank + * + * The function DefineFile() places a FILE statement + * in the .noi debug file for the processed file. + * + * local variables: + * none + * + * global variables: + * FILE * jfp NoICE Debug File handle + * + * functions called: + * int fprintf() c_library + * VOID PagedAddress() lknoice.c + * char * strcpy() c_library + * int symeq() lksym.c + * + * side effects: + * A file name definition is + * placed in the .noi debug file. */ -void DefineFile( char *name, a_uint value, int page ) +void DefineFile( char *name, a_uint value, struct bank *yp ) { if (symeq( name, currentFile, 1 ) == 0) { @@ -202,7 +429,7 @@ if (value != 0) { fprintf( jfp, "FILE %s ", name ); - PagedAddress( value, page ); + PagedAddress( value, yp ); } else { @@ -211,12 +438,36 @@ } } -/* - * static function: - * Define "name" as the current function + +/*)Function VOID DefineFunction() + * + * char * name pointer to the symbol string + * a_uint value value of symbol + * struct bank * yp pointer to associated bank + * + * The function DefineFunction() places a FUNC statement + * in the .noi debug file for the processed symbol. If + * a vaulue is present then a preceeding DEF statement is + * also placed in the .noi debug file. + * + * local variables: + * none + * + * global variables: + * FILE * jfp NoICE Debug File handle + * + * functions called: + * int fprintf() c_library + * VOID PagedAddress() lknoice.c + * char * strcpy() c_library + * int symeq() lksym.c + * + * side effects: + * A function definition is + * placed in the .noi debug file. */ -void DefineFunction( char *name, a_uint value, int page ) +void DefineFunction( char *name, a_uint value, struct bank *yp ) { if (symeq( name, currentFunction, 1 ) == 0) { @@ -224,9 +475,9 @@ if (value != 0) { fprintf( jfp, "DEF %s ", name ); - PagedAddress( value, page ); + PagedAddress( value, yp ); fprintf( jfp, "FUNC %s ", name ); - PagedAddress( value, page ); + PagedAddress( value, yp ); } else { @@ -235,12 +486,36 @@ } } -/* - * static function: - * Define "name" as the current static (scoped) function + +/*)Function VOID DefineStaticFunction() + * + * char * name pointer to the symbol string + * a_uint value value of symbol + * struct bank * yp pointer to associated bank + * + * The function DefineStaticFunction() places a SFUNC statement + * in the .noi debug file for the processed file. If + * a value is present then a preceeding DEFS statement is + * also placed in the .noi debug file. + * + * local variables: + * none + * + * global variables: + * FILE * jfp NoICE Debug File handle + * + * functions called: + * int fprintf() c_library + * VOID PagedAddress() lknoice.c + * char * strcpy() c_library + * int symeq() lksym.c + * + * side effects: + * A static function definition is + * placed in the .noi debug file. */ -void DefineStaticFunction( char *name, a_uint value, int page ) +void DefineStaticFunction( char *name, a_uint value, struct bank *yp ) { if (symeq( name, currentFunction, 1 ) == 0) { @@ -248,9 +523,9 @@ if (value != 0) { fprintf( jfp, "DEFS %s ", name ); - PagedAddress( value, page ); + PagedAddress( value, yp ); fprintf( jfp, "SFUNC %s ", name ); - PagedAddress( value, page ); + PagedAddress( value, yp ); } else { @@ -259,19 +534,41 @@ } } -/* - * static function: - * Define the end of the current function + +/*)Function VOID DefineEndFunction() + * + * char * name pointer to the symbol string + * a_uint value value of symbol + * struct bank * yp pointer to associated bank + * + * The function DefineEndFunction() places an ENDF statement + * in the .noi debug file for the processed file. + * + * local variables: + * none + * + * global variables: + * FILE * jfp NoICE Debug File handle + * + * functions called: + * int fprintf() c_library + * VOID PagedAddress() lknoice.c + * char * strcpy() c_library + * int symeq() lksym.c + * + * side effects: + * An end function definition is + * placed in the .noi debug file. */ -void DefineEndFunction( a_uint value, int page ) +void DefineEndFunction( a_uint value, struct bank *yp ) { if (currentFunction[0] != 0) { if (value != 0) { fprintf( jfp, "ENDF " ); - PagedAddress( value, page ); + PagedAddress( value, yp ); } else { @@ -282,12 +579,34 @@ } } -/* - * static function: - * Define "lineNumber" as a line in the current file + +/*)Function VOID DefineLine() + * + * char * name pointer to the symbol string + * a_uint value value of symbol + * struct bank * yp pointer to associated bank + * + * The function DefineLine() places a LINE statement + * in the .noi debug file for the processed file. + * + * local variables: + * int indigit converted digit + * int lineNumber converted line number + * + * global variables: + * FILE * jfp NoICE Debug File handle + * + * functions called: + * int fprintf() c_library + * VOID PagedAddress() lknoice.c + * int digit() lkeval.c + * + * side effects: + * A Line definition is + * placed in the .noi debug file. */ -void DefineLine( char *lineString, a_uint value, int page ) +void DefineLine( char *lineString, a_uint value, struct bank *yp ) { int indigit, lineNumber; @@ -297,13 +616,41 @@ lineNumber = 10*lineNumber + indigit; } fprintf( jfp, "LINE %u ", lineNumber ); - PagedAddress( value, page ); + PagedAddress( value, yp ); } -/* + +/*)Function VOID PagedAddress() + * + * a_uint value value of symbol + * struct bank * yp pointer to associated bank + * + * The function PagedAddress() places the value + * in the .noi debug file for the processed value. + * If the current bank is "mapped" then the page + * number preceeds the value as xx:. + * + * local variables: + * none + * + * global variables: + * FILE * jfp NoICE Debug File handle + * + * functions called: + * int fprintf() c_library + * + * side effects: + * A value is appended to the current + * line placed in the .noi debug file. */ -void PagedAddress( a_uint value, int page ) +void PagedAddress( a_uint value, struct bank *yp ) { - fprintf( jfp, "%X:0x%X\n", page, value ); + if (yp->b_flag & B_MAP) { + fprintf( jfp, "%X:0x%X\n", yp->b_map, value ); + } else { + fprintf( jfp, "0x%X\n", value ); + } } + +#endif diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lkout.c sdcc-3.2.0+dfsg/sdas/linksrc/lkout.c --- sdcc-3.1.0+dfsg/sdas/linksrc/lkout.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lkout.c 2011-12-06 23:01:37.000000000 +0000 @@ -0,0 +1,965 @@ +/* lkout.c */ + +/* + * Copyright (C) 1989-2009 Alan R. Baldwin + * + * 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, see . + * + * + * Alan R. Baldwin + * 721 Berkeley St. + * Kent, Ohio 44240 + * + * With enhancements by + * + * G. Osborn + * gary@s-4.com. + */ + +#include "aslink.h" + +/*)Module lkout.c + * + * The module lkout.c contains the dispatch + * function to create the relocated object + * code output in the required format. + * + * lkout.c contains the following functions: + * VOID lkout() + * VOID lkflush() + * VOID ixx() + * VOID iflush() + * VOID dbx() + * VOID dflush() + * + * lkout.c contains no local variables. + */ + +/*)Function lkout(i) + * + * int i 1 - process data + * 0 - end of data + * + * The function lkout() dispatches to the + * required output format routine. + * + * local variables: + * none + * + * global variables: + * int oflag output type flag + * int obj_flag Output enabled flag + * FILE * ofp output file handle + * a_uint pc Current relocation address + * int pcb Current pc bytes per address + * + * functions called: + * VOID ixx() lkout.c + * VOID s19() lks19.c + * VOID dbx() lkout.c + * VOID elf() lkelf.c + * + * side effects: + * The REL data is output in the required format. + */ + +VOID +lkout(int i) +{ + int j; + + if (i && obj_flag) { return; } + if (ofp == NULL) { return; } + + /* + * Create the Byte Output Address + */ + for (j=1; ja_flag & A_NOLOAD) + return; + + if (hilo == 0) { + switch(a_bytes){ + default: + case 2: + j = rtval[0]; + rtval[0] = rtval[1]; + rtval[1] = j; + break; + case 3: + j = rtval[0]; + rtval[0] = rtval[2]; + rtval[2] = j; + break; + case 4: + j = rtval[0]; + rtval[0] = rtval[3]; + rtval[3] = j; + j = rtval[2]; + rtval[2] = rtval[1]; + rtval[1] = j; + break; + } + } + for (i=0,rtadr2=0; is_axp->a_bap->a_ofp == ofp)) { + symadr = symval(sp); + lo_addr = symadr & 0xffff; + if (a_bytes > 2) { + hi_addr = (symadr >> 16) & 0xffff; + chksum = 0x00; + chksum += hi_addr; + chksum += hi_addr >> 8; + chksum += 0x04; +#ifdef LONGINT + fprintf(ofp, ":00%04lX04%02lX\n", hi_addr, (~chksum + 1) & 0x00ff); +#else + fprintf(ofp, ":00%04X04%02X\n", hi_addr, (~chksum + 1) & 0x00ff); +#endif + } + chksum = 0x00; + chksum += lo_addr; + chksum += lo_addr >> 8; + chksum += 0x03; +#ifdef LONGINT + fprintf(ofp, ":00%04lX03%02lX\n", lo_addr, (~chksum + 1) & 0x00ff); +#else + fprintf(ofp, ":00%04X03%02X\n", lo_addr, (~chksum + 1) & 0x00ff); +#endif + } + + fprintf(ofp, ":00000001FF\n"); + } +} + + +/*)Function iflush() + * + * The function iflush() outputs the relocated data + * in the standard Intel format. + * + * local variables: + * a_uint chksum byte checksum + * a_uint lo_addr address within segment + * a_uint hi_addr segment number + * int i loop counter + * int max number of data bytes + * int reclen record length + * + * global variables: + * int a_bytes T Line Address Bytes + * FILE * ofp output file handle + * int rtaflg first output flag + * char rtbuf[] output buffer + * a_uint rtadr0 address temporary + * a_uint rtadr1 address temporary + * + * functions called: + * int fprintf() c_library + * + * side effects: + * The data is output to the file defined by ofp. + */ + +/* + * This function derived from the work + * of G. Osborn, gary@s-4.com. + * The new version concatenates the assembler + * output records when they represent contiguous + * memory segments to produce IXXMAXBYTES data byte + * Intel Hex output lines whenever possible, resulting + * in a substantial reduction in file size. + * More importantly, the download time + * to the target system is much improved. + */ + +VOID +iflush() +{ + int i, max, reclen; + a_uint chksum, lo_addr, hi_addr; + + max = (int) (rtadr1 - rtadr0); + if (max) { + if (a_bytes > 2) { + static a_uint prev_hi_addr = 0; + + hi_addr = (rtadr0 >> 16) & 0xffff; + if ((hi_addr != prev_hi_addr) || rtaflg) { + chksum = 0x00; + chksum += hi_addr; + chksum += hi_addr >> 8; + chksum += 0x04; +#ifdef LONGINT + fprintf(ofp, ":00%04lX04%02lX\n", hi_addr, (~chksum + 1) & 0x00ff); +#else + fprintf(ofp, ":00%04X04%02X\n", hi_addr, (~chksum + 1) & 0x00ff); +#endif + prev_hi_addr = hi_addr; + } + } + + /* + * Only the ":" and the checksum itself are excluded + * from the checksum. The record length includes + * only the data bytes. + */ + lo_addr = rtadr0 & 0xffff; + reclen = max; + chksum = reclen; + chksum += lo_addr; + chksum += lo_addr >> 8; +#ifdef LONGINT + fprintf(ofp, ":%02X%04lX00", reclen, lo_addr); +#else + fprintf(ofp, ":%02X%04X00", reclen, lo_addr); +#endif + for (i=0; is_axp->a_bap->a_ofp == ofp)) { + symadr = symval(sp); + for (i=0,addr=symadr; i>=8) { + chksum += addr; + } + } else { + symadr = 0; + } +#ifdef LONGINT + switch(a_bytes) { + default: + case 2: frmt = "S9%02X%04lX"; addr = symadr & 0x0000ffffl; break; + case 3: frmt = "S8%02X%06lX"; addr = symadr & 0x00ffffffl; break; + case 4: frmt = "S7%02X%08lX"; addr = symadr & 0xffffffffl; break; + } +#else + switch(a_bytes) { + default: + case 2: frmt = "S9%02X%04X"; addr = symadr & 0x0000ffff; break; + case 3: frmt = "S8%02X%06X"; addr = symadr & 0x00ffffff; break; + case 4: frmt = "S7%02X%08X"; addr = symadr & 0xffffffff; break; + } +#endif + fprintf(ofp, frmt, reclen, addr); + /* + * 1's complement + */ +#ifdef LONGINT + fprintf(ofp, "%02lX\n", (~chksum) & 0x00ff); +#else + fprintf(ofp, "%02X\n", (~chksum) & 0x00ff); +#endif + } +} + + +/*)Function sflush() + * + * The function sflush() outputs the relocated data + * in the standard Motorola format. + * + * local variables: + * a_uint addr address temporary + * a_uint chksum byte checksum + * char * frmt format string pointer + * int i loop counter + * int max number of data bytes + * int reclen record length + * + * global variables: + * int a_bytes T Line Address Bytes + * FILE * ofp output file handle + * char rtbuf[] output buffer + * a_uint rtadr0 address temporary + * a_uint rtadr1 address temporary + * + * functions called: + * int fprintf() c_library + * + * side effects: + * The data is output to the file defined by ofp. + */ + +/* + * Written by G. Osborn, gary@s-4.com, 6-17-98. + * The new version concatenates the assembler + * output records when they represent contiguous + * memory segments to produce SXXMAXBYTES data byte + * S_ output lines whenever possible, resulting + * in a substantial reduction in file size. + * More importantly, the download time + * to the target system is much improved. + */ + +VOID +sflush() +{ + char *frmt; + int i, max, reclen; + a_uint addr, chksum; + + max = (int) (rtadr1 - rtadr0); + if (max == 0) { + return; + } + + /* + * Only the "S_" and the checksum itself are excluded + * from the checksum. The record length does not + * include "S_" and the pair count. It does + * include the address bytes, the data bytes, + * and the checksum. + */ + reclen = max + 1 + a_bytes; + chksum = reclen; + for (i=0,addr=rtadr0; i>=8) { + chksum += addr; + } +#ifdef LONGINT + switch(a_bytes) { + default: + case 2: frmt = "S1%02X%04lX"; addr = rtadr0 & 0x0000ffffl; break; + case 3: frmt = "S2%02X%06lX"; addr = rtadr0 & 0x00ffffffl; break; + case 4: frmt = "S3%02X%08lX"; addr = rtadr0 & 0xffffffffl; break; + } +#else + switch(a_bytes) { + default: + case 2: frmt = "S1%02X%04X"; addr = rtadr0 & 0x0000ffff; break; + case 3: frmt = "S2%02X%06X"; addr = rtadr0 & 0x00ffffff; break; + case 4: frmt = "S3%02X%08X"; addr = rtadr0 & 0xffffffff; break; + } +#endif + fprintf(ofp, frmt, reclen, addr); + for (i=0; is_axp->a_bap->a_ofp == ofp)) { + symadr = symval(sp); + } else { + symadr = 0; + } + /* Terminator */ + putc(0xFF, ofp); + + /* Size (0) */ + switch(a_bytes) { + case 4: putc((int) (0 >> 24) & 0xFF, ofp); + case 3: putc((int) (0 >> 16) & 0xFF, ofp); + default: + case 2: putc((int) (0 >> 8) & 0xFF, ofp); + putc((int) (0 >> 0) & 0xFF, ofp); + break; + } + + /* Starting Address */ + switch(a_bytes) { + case 4: putc((int) (symadr >> 24) & 0xFF, ofp); + case 3: putc((int) (symadr >> 16) & 0xFF, ofp); + default: + case 2: putc((int) (symadr >> 8) & 0xFF, ofp); + putc((int) (symadr >> 0) & 0xFF, ofp); + break; + } + } +} + + +/*)Function dflush() + * + * The function dflush() outputs the relocated data + * in the Disk BASIC loadable format + * + * local variables: + * int i loop counter + * int max number of data bytes + * + * global variables: + * FILE * ofp output file handle + * char rtbuf[] output buffer + * a_uint rtadr0 address temporary + * a_uint rtadr1 address temporary + * + * functions called: + * int putc() c_library + * + * side effects: + * The data is output to the file defined by ofp. + */ + +/* + * Written by Boisy G. Pitre, boisy@boisypitre.com, 6-7-04 + */ + +VOID +dflush() +{ + int i, max; + + max = (int) (rtadr1 - rtadr0); + if (max == 0) { + return; + } + + /* Preamble Byte */ + putc(0, ofp); + + /* Record Size */ + switch(a_bytes){ + case 4: putc((int) (max >> 24) & 0xFF, ofp); + case 3: putc((int) (max >> 16) & 0xFF, ofp); + default: + case 2: putc((int) (max >> 8) & 0xFF, ofp); + putc((int) (max >> 0) & 0xFF, ofp); + break; + } + + /* Load Address */ + switch(a_bytes){ + case 4: putc((int) (rtadr0 >> 24) & 0xFF, ofp); + case 3: putc((int) (rtadr0 >> 16) & 0xFF, ofp); + default: + case 2: putc((int) (rtadr0 >> 8) & 0xFF, ofp); + putc((int) (rtadr0 >> 0) & 0xFF, ofp); + break; + } + + for (i = 0; i < max; i++) { + putc(rtbuf[i], ofp); + } + + rtadr0 = rtadr1; +} diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lkrloc.c sdcc-3.2.0+dfsg/sdas/linksrc/lkrloc.c --- sdcc-3.1.0+dfsg/sdas/linksrc/lkrloc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lkrloc.c 2011-12-06 23:01:37.000000000 +0000 @@ -23,1531 +23,358 @@ * * With enhancements from: * - * John L. Hartman (JLH) - * jhartman@compuserve.com + * John L. Hartman (JLH) + * jhartman@compuserve.com * - * Bill McKinnon (BM) - * w_mckinnon@conknet.com + * Bill McKinnon (BM) + * w_mckinnon@conknet.com */ #include #include "aslink.h" -/*)Module lkrloc.c +/*)Module lkrloc.c * - * The module lkrloc.c contains the functions which - * perform the relocation calculations. + * The module lkrloc.c contains the functions which + * perform the relocation calculations. * - * lkrloc.c contains the following functions: - * a_uint adb_b() - * a_uint adb_lo() - * a_uint adb_hi() - * a_uint adw_w() - * a_uint adw_lo() - * a_uint adw_hi() - * VOID erpdmp() - * VOID errdmp() - * a_uint evword() - * VOID prntval() - * VOID rele() - * VOID relerr() - * VOID relerp() - * VOID reloc() - * VOID relp() - * VOID relr() - * VOID relt() + * lkrloc.c contains the following functions: + * a_uint adb_1b() + * a_uint adb_2b() + * a_uint adb_3b() + * a_uint adb_4b() + * a_uint adb_xb() + * a_uint evword() + * VOID prntval() + * VOID reloc() * - * lkrloc.c the local variable errmsg[]. * */ -/* sdld specific */ -/* Global which holds the upper 16 bits of the last 32 bit area adress - * output. Useful only for iHex mode. - */ -int lastExtendedAddress=-1; - -/* Static variable which holds the index of last processed area. - * Useful only for iHex mode. - */ -static int lastAreaIndex = -1; -/* end sdld specific */ - -/*)Function VOID reloc(c) - * - * char c process code - * - * The function reloc() calls a particular relocation - * function determined by the process code. - * - * local variable: - * none - * - * global variables: - * int lkerr error flag - * - * called functions: - * int fprintf() c_library - * VOID rele() lkrloc.c - * VOID relp() lkrloc.c - * VOID relr() lkrloc.c - * VOId relt() lkrloc.c - * - * side effects: - * Refer to the called relocation functions. - * - */ - -VOID -reloc(c) -char c; -{ - switch(c) { - - case 'T': - relt(); - break; - - case 'R': - relr(); - break; - - case 'P': - relp(); - break; - - case 'E': - rele(); - break; - - default: - fprintf(stderr, "Undefined Relocation Operation\n"); - lkerr++; - break; - - } -} - - -/*)Function VOID relt() - * - * The function relt() evaluates a T line read by - * the linker. Each byte value read is saved in the - * rtval[] array, rtflg[] is set, and the number of - * evaluations is maintained in rtcnt. - * - * T Line - * - * T xx xx nn nn nn nn nn ... - * +/*)Function VOID reloc(c) * - * In: "T n0 n1 n2 n3 ... nn" + * int c process code * - * Out: 0 1 2 .. rtcnt - * +----+----+----+----+----+ - * rtval | n0 | n1 | n2 | .. | nn | - * +----+----+----+----+----+ - * rtflag| 1 | 1 | 1 | 1 | 1 | - * +----+----+----+----+----+ - * - * The T line contains the assembled code output by the assem- - * bler with xx xx being the offset address from the current area - * base address and nn being the assembled instructions and data in - * byte format. - * - * local variable: - * none - * - * global variables: - * int rtcnt number of values evaluated - * int rtflg[] array of evaluation flags - * int rtval[] array of evaluation values - * - * called functions: - * int eval() lkeval.c - * int more() lklex.c - * - * side effects: - * Linker input T line evaluated. - * - */ - -VOID -relt() -{ - rtcnt = 0; - while (more()) { - if (rtcnt < NTXT) { - rtval[rtcnt] = eval(); - rtflg[rtcnt] = 1; - rtcnt++; - } - } -} - -/*)Function VOID relr() - * - * The function relr() evaluates a R line read by - * the linker. The R line data is combined with the - * previous T line data to perform the relocation of - * code and data bytes. The S19 / IHX output and - * translation of the LST files to RST files may be - * performed. - * - * R Line - * - * R 0 0 nn nn n1 n2 xx xx ... - * - * The R line provides the relocation information to the linker. - * The nn nn value is the current area index, i.e. which area the - * current values were assembled. Relocation information is en- - * coded in groups of 4 bytes: - * - * 1. n1 is the relocation mode and object format - * 1. bit 0 word(0x00)/byte(0x01) - * 2. bit 1 relocatable area(0x00)/symbol(0x02) - * 3. bit 2 normal(0x00)/PC relative(0x04) relocation - * 4. bit 3 1-byte(0x00)/2-byte(0x08) object format for - * byte data - * 5. bit 4 signed(0x00)/unsigned(0x10) byte data - * 6. bit 5 normal(0x00)/page '0'(0x20) reference - * 7. bit 6 normal(0x00)/page 'nnn'(0x40) reference - * - * 2. n2 is a byte index into the corresponding (i.e. pre- - * ceeding) T line data (i.e. a pointer to the data to be - * updated by the relocation). The T line data may be - * 1-byte or 2-byte byte data format or 2-byte word - * format. - * - * 3. xx xx is the area/symbol index for the area/symbol be- - * ing referenced. the corresponding area/symbol is found - * in the header area/symbol lists. - * - * The groups of 4 bytes are repeated for each item requiring relo- - * cation in the preceeding T line. - * - * local variable: - * areax **a pointer to array of area pointers - * int aindex area index - * char *errmsg[] array of pointers to error strings - * int error error code - * int lkerr error flag - * int mode relocation mode - * adrr_t paga paging base area address - * a_uint pags paging symbol address - * a_uint pc relocated base address - * a_uint r PCR relocation value - * a_uint reli relocation initial value - * a_uint relv relocation final value - * int rindex symbol / area index - * a_uint rtbase base code address - * a_uint rtofst rtval[] index offset - * int rtp index into T data - * sym **s pointer to array of symbol pointers - * - * global variables: - * head *hp pointer to the head structure - * rerr rerr linker error structure - * FILE *stderr standard error device - * - * called functions: - * a_uint adb_b() lkrloc.c - * a_uint adb_lo() lkrloc.c - * a_uint adb_hi() lkrloc.c - * a_uint adw_w() lkrloc.c - * sdld specific - * VOID elf() lkelf.c - * VOID gb() lkgb.c - * end sdld specific - * a_uint evword() lkrloc.c - * int eval() lkeval.c - * int fprintf() c_library - * VOID ihx() lkihx.c - * int lkulist lklist.c - * int more() lklex.c - * VOID relerr() lkrloc.c - * VOID s19() lks19.c - * int symval() lksym.c - * - * side effects: - * The R and T lines are combined to produce - * relocated code and data. Output S19 / IHX - * and relocated listing files may be produced. - * - */ - -VOID -relr() -{ - register int mode; - register a_uint reli, relv; - int aindex, rindex, rtp, error; - a_uint r, rtbase, rtofst, paga = 0, pags = 0, pc; - struct areax **a; - struct sym **s; - - /* - * Get area and symbol lists - */ - a = hp->a_list; - s = hp->s_list; - - /* - * Verify Area Mode - */ - if (eval() != (R3_WORD | R3_AREA) || eval()) { - fprintf(stderr, "R input error\n"); - lkerr++; - } - - /* - * Get area pointer - */ - aindex = evword(); - if (aindex >= hp->h_narea) { - fprintf(stderr, "R area error\n"); - lkerr++; - return; - } - if (TARGET_IS_6808) - ap = a[aindex]->a_bap; - - /* - * Base values - */ - rtbase = adw_w(0, 0); - rtofst = 2; - - /* - * Relocate address - */ - pc = adw_w(a[aindex]->a_addr, 0); - - /* - * Number of 'bytes' per PC address - */ - pcb = 1; - - #if 0 - printf("area %d base address: 0x%x size: 0x%x rtbase: 0x%x\n", aindex, - a[aindex]->a_addr, a[aindex]->a_size, rtbase); - #endif - /* - * Do remaining relocations - */ - while (more()) { - error = 0; - mode = eval(); - - if ((mode & R_ESCAPE_MASK) == R_ESCAPE_MASK) - { - mode = ((mode & ~R_ESCAPE_MASK) << 8) | eval(); - /* printf("unescaping rmode\n"); */ - } - - rtp = eval(); - rindex = evword(); - - /* - * R3_SYM or R3_AREA references - */ - if (mode & R3_SYM) { - if (rindex >= hp->h_nsym) { - fprintf(stderr, "R symbol error\n"); - lkerr++; - return; - } - reli = symval(s[rindex]); - } -/* sdld specific */ - else if ((IS_R_J11(mode) || IS_R_J19(mode)) && (rindex == 0xFFFF)) { - /* absolute acall/ajmp address */ - reli = 0; - } -/* end sdld specific */ - else { - if (rindex >= hp->h_narea) { - fprintf(stderr, "R area error\n"); - lkerr++; - return; - } - reli = a[rindex]->a_addr; - } - - /* - * R3_PCR addressing - */ - if (mode & R3_PCR) { - if (mode & R3_BYTE) { - reli -= (pc + (rtp-rtofst) + 1); - } else { - reli -= (pc + (rtp-rtofst) + 2); - } - } - - /* - * R3_PAG0 or R3_PAG addressing - */ - if (mode & (R3_PAG0 | R3_PAG)) { - paga = sdp.s_area->a_addr; - pags = sdp.s_addr; - reli -= paga + pags; - } - - /* - * R3_BYTE or R3_WORD operation - */ - if (mode & R3_BYTE) { - if (mode & R_BYT3) - { - /* This is a three byte address, of which - * we will select one byte. - */ -/* sdld specific */ - if (mode & R_BIT) - { - relv = adb_24_bit(reli, rtp); - } -/* sdld specific */ - else if (mode & R_HIB) - { - /* printf("24 bit address selecting hi byte.\n"); */ - relv = adb_24_hi(reli, rtp); - } - else if (mode & R3_MSB) - { - /* Note that in 24 bit mode, R3_MSB - * is really the middle byte, not - * the most significant byte. - * - * This is ugly and I can only apologize - * for any confusion. - */ - /* printf("24 bit address selecting middle byte.\n"); */ - relv = adb_24_mid(reli, rtp); - } - else - { - /* printf("24 bit address selecting lo byte.\n"); */ - relv = adb_24_lo(reli, rtp); - } - } - else if (mode & R3_BYTX) { - /* This is a two byte address, of - * which we will select one byte. - */ - if (mode & R_BIT) { - relv = adb_bit(reli, rtp); - } else if (mode & R3_MSB) { - relv = adb_hi(reli, rtp); - } else { - relv = adb_lo(reli, rtp); - } - } else { - relv = adb_b(reli, rtp); - } - } else if (IS_R_J11(mode)) { - /* JLH: 11 bit jump destination for 8051. Forms - / two byte instruction with op-code bits - / in the MIDDLE! - / rtp points at 3 byte locus: first two - / will get the instructiion. third one - / has raw op-code. - */ - - /* Calculate absolute destination - / relv must be on same 2K page as pc - */ - relv = adw_w(reli, rtp); - - if ((relv & ~0x7ff) != ((pc + rtp - rtofst) & ~0x7ff)) { - error = 2; - } - - /* Merge MSB (byte 0) with op-code, ignoring - / top 5 bits of address. Then hide the op-code - */ - rtval[rtp] = ((rtval[rtp] & 0x07)<<5) | rtval[rtp+2]; - rtflg[rtp+2] = 0; - rtofst += 1; - } - else if (IS_R_J19(mode)) { - /* 19 bit jump destination for DS80C390. Forms - / three byte instruction with op-code bits - / in the MIDDLE! - / rtp points at 4 byte locus: first three - / will get the instructiion. fourth one - / has raw op-code. - */ - - /* Calculate absolute destination - / relv must be on same 512K page as pc - */ - relv = adw_24(reli, rtp); - - if ((relv & ~0x7ffff) != ((pc + rtp - rtofst) & ~0x7ffff)) { - error = 2; - } - - /* Merge MSB (byte 0) with op-code, ignoring - / top 5 bits of address. Then hide the op-code - */ - rtval[rtp] = ((rtval[rtp] & 0x07)<<5) | rtval[rtp+3]; - rtflg[rtp+3] = 0; - rtofst += 1; - } - else if (IS_C24(mode)) - { - /* 24 bit address */ - relv = adw_24(reli, rtp); - } - else - { - /* 16 bit address. */ - relv = adw_w(reli, rtp); - } - - /* - * R3_BYTE with R3_BYTX offset adjust - */ - if (mode & R3_BYTE) { - if (mode & R3_BYTX) { - rtofst += 1; - } - } - - /* - * Unsigned Byte Checking - */ - if (mode & R3_USGN && mode & R3_BYTE && relv & ~0xFF) - error = 1; - - /* - * PCR Relocation Error Checking - */ - if (mode & R3_PCR && mode & R3_BYTE) { - r = relv & ~0x7F; - if (r != (a_uint) ~0x7F && r != 0) - error = 2; - } - - /* - * Page Relocation Error Checking - */ - if ((TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GB) && - mode & R3_PAG0 && (relv & ~0xFF || paga || pags)) - error = 3; - if (mode & R3_PAG && (relv & ~0xFF)) - error = 4; -/* sdld specific */ - if ((mode & R_BIT) && (relv & ~0x87FF)) - error = 5; -/* end sdld specific */ - - /* - * Error Processing - */ - if (error) { - rerr.aindex = aindex; - rerr.mode = mode; - rerr.rtbase = rtbase + rtp - rtofst - 1; - rerr.rindex = rindex; - rerr.rval = relv - reli; - relerr(errmsg[error-1]); - } - } - if (uflag != 0) { - lkulist(1); - } - - /* JLH: output only if data (beyond two byte address) */ - if ((TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GB) && oflag == 1) { - ihx(1); - } - else if ((oflag == 1) && (rtcnt > 2)) { - int extendedAddress = (a[aindex]->a_addr >> 16) & 0xffff; - - /* Boy, is this a hack: for ABS sections, the - * base address is stored as zero, and the T records - * indicate the offset from zero. - * - * Since T records can only indicate a 16 bit offset, this - * obviously creates a problem for ABS segments located - * above 64K (this is only meaningful in flat24 mode). - * - * However, the size of an ABS area is stored as - * base address + section size (I suspect this is a bug, - * but it's a handy one right now). So the upper 8 bits of - * the 24 bit address are stored in the size record. - * Thus we add it in. - * - * This is another reason why we can't have areas greater - * than 64K yet, even in flat24 mode. - */ - // extendedAddress += ((a[aindex]->a_size) >> 16 & 0xffff); - // commented out by jr - - if (lastAreaIndex != aindex) { - lastAreaIndex = aindex; - ihxNewArea(); - } - - if (TARGET_IS_8051 && extendedAddress != lastExtendedAddress) - { - - if (lastExtendedAddress!=-1) { - printf("output extended linear address record 0x%x 0x%x\n", - extendedAddress, lastExtendedAddress); - } - - if (rflag) - { - ihxExtendedLinearAddress(extendedAddress); - } - else if (extendedAddress) - { - /* Not allowed to generate extended address records, - * but one is called for here... - */ - fprintf(stderr, - "warning: extended linear address encountered; " - "you probably want the -r flag.\n"); - } - lastExtendedAddress = extendedAddress; - } - ihx(1); - } else - if ((oflag == 2) && (rtcnt > 2)) { - s19(1); - } -/* sdld specific */ - else - if ((oflag == 4) && (rtcnt > 2)) { - elf(1); - } -/* end sdld specific */ -} - -char *errmsg[] = { - "Unsigned Byte error", - "Byte PCR relocation error", - "Page0 relocation error", - "Page Mode relocation error", -/* sdld specific */ - "Bit-addressable relocation error" -/* end sdld specific */ -}; - - -/*)Function VOID relp() - * - * The function relp() evaluates a P line read by - * the linker. The P line data is combined with the - * previous T line data to set the base page address - * and test the paging boundary and length. - * - * P Line - * - * P 0 0 nn nn n1 n2 xx xx - * - * The P line provides the paging information to the linker as - * specified by a .setdp directive. The format of the relocation - * information is identical to that of the R line. The correspond- - * ing T line has the following information: - * T xx xx aa aa bb bb - * - * Where aa aa is the area reference number which specifies the - * selected page area and bb bb is the base address of the page. - * bb bb will require relocation processing if the 'n1 n2 xx xx' is - * specified in the P line. The linker will verify that the base - * address is on a 256 byte boundary and that the page length of an - * area defined with the PAG type is not larger than 256 bytes. - * - * local variable: - * areax **a pointer to array of area pointers - * int aindex area index - * int mode relocation mode - * a_uint relv relocation value - * int rindex symbol / area index - * int rtp index into T data - * sym **s pointer to array of symbol pointers - * - * global variables: - * head *hp pointer to the head structure - * int lkerr error flag - * sdp sdp base page structure - * FILE *stderr standard error device - * - * called functions: - * a_uint adw_w() lkrloc.c - * a_uint evword() lkrloc.c - * int eval() lkeval.c - * int fprintf() c_library - * int more() lklex.c - * int symval() lksym.c - * - * side effects: - * The P and T lines are combined to set - * the base page address and report any - * paging errors. - * - */ - -VOID -relp() -{ - register int aindex, rindex; - int mode, rtp; - a_uint relv; - struct areax **a; - struct sym **s; - - /* - * Get area and symbol lists - */ - a = hp->a_list; - s = hp->s_list; - - /* - * Verify Area Mode - */ - if (eval() != (R3_WORD | R3_AREA) || eval()) { - fprintf(stderr, "P input error\n"); - lkerr++; - } - - /* - * Get area pointer - */ - aindex = evword(); - if (aindex >= hp->h_narea) { - fprintf(stderr, "P area error\n"); - lkerr++; - return; - } - - /* - * Do remaining relocations - */ - while (more()) { - mode = eval(); - rtp = eval(); - rindex = evword(); - - /* - * R3_SYM or R3_AREA references - */ - if (mode & R3_SYM) { - if (rindex >= hp->h_nsym) { - fprintf(stderr, "P symbol error\n"); - lkerr++; - return; - } - relv = symval(s[rindex]); - } else { - if (rindex >= hp->h_narea) { - fprintf(stderr, "P area error\n"); - lkerr++; - return; - } - relv = a[rindex]->a_addr; - } - adw_w(relv, rtp); - } - - /* - * Paged values - */ - aindex = adw_w(0,2); - if (aindex >= hp->h_narea) { - fprintf(stderr, "P area error\n"); - lkerr++; - return; - } - sdp.s_areax = a[aindex]; - sdp.s_area = sdp.s_areax->a_bap; - sdp.s_addr = adw_w(0,4); - if (sdp.s_area->a_addr & 0xFF || sdp.s_addr & 0xFF) - relerp("Page Definition Boundary Error"); -} - -/*)Function VOID rele() + * The function reloc() calls the proper version + * of the linker code. * - * The function rele() closes all open output files - * at the end of the linking process. + * local variable: + * none * - * local variable: - * none + * global variables: + * ASxxxx_VERSION ASxxxx REL file version * - * global variables: - * int oflag output type flag - * int uflag relocation listing flag - * - * called functions: - * sdld specific - * VOID elf() lkelf.c - * VOID gb() lkgb.c - * end sdld specific - * VOID ihx() lkihx.c - * VOID lkulist() lklist.c - * VOID s19() lks19.c + * called functions: + * VOID reloc3() lkrloc3.c + * VOID reloc4() lkrloc4.c * - * side effects: - * All open output files are closed. + * side effects: + * Refer to the called relocation functions. * */ VOID -rele() +reloc(int c) { - if (uflag != 0) { - lkulist(0); - } - if (oflag == 1) { - ihx(0); - } else - if (oflag == 2) { - s19(0); - } -/* sdld specific */ - else - if (oflag == 4) { - elf(0); - } -/* end sdld specific */ -} - -/*)Function a_uint evword() - * - * The function evword() combines two byte values - * into a single word value. - * - * local variable: - * a_uint v temporary evaluation variable - * - * global variables: - * hilo byte ordering parameter - * - * called functions: - * int eval() lkeval.c - * - * side effects: - * Relocation text line is scanned to combine - * two byte values into a single word value. - * - */ + switch(ASxxxx_VERSION) { + case 3: + reloc3(c); + break; -a_uint -evword() -{ - register a_uint v; +// case 4: +// reloc4(c); +// break; - if (hilo) { - v = (eval() << 8); - v += eval(); - } else { - v = eval(); - v += (eval() << 8); - } - return(v); + default: + fprintf(stderr, "Internal Version Error"); + lkexit(ER_FATAL); + break; + } } -/*)Function a_uint adb_b(v, i) - * - * int v value to add to byte - * int i rtval[] index - * - * The function adb_b() adds the value of v to - * the single byte value contained in rtval[i]. - * The new value of rtval[i] is returned. - * - * local variable: - * none - * - * global variables: - * none - * - * called functions: - * none - * - * side effects: - * The value of rtval[] is changed. - * - */ - -a_uint -adb_b(v, i) -register a_uint v; -register int i; -{ - return(rtval[i] += v); -} -/* sdld specific */ -/*)Function a_uint adb_bit(v, i) - * - * int v value to add to byte - * int i rtval[] index +/*)Function a_uint evword() * - * The function adb_bit() converts the single - * byte address value contained in rtval[i] to bit- - * addressable space and adds the value of v to it. - * The new value of rtval[i] is returned. + * The function evword() combines two byte values + * into a single word value. * - * local variable: - * a_uint j temporary evaluation variable + * local variable: + * a_uint v temporary evaluation variable * - * global variables: - * none + * global variables: + * hilo byte ordering parameter * - * called functions: - * none + * called functions: + * int eval() lkeval.c * - * side effects: - * The value of rtval[] is changed. + * side effects: + * Relocation text line is scanned to combine + * two byte values into a single word value. * */ a_uint -adb_bit(v, i) -register a_uint v; -register int i; +evword(void) { - register a_uint j; + a_uint v; - j = adb_lo(v, i) & 0xFF; - if ((j >= 0x20) && (j <= 0x2F)) { - j = (j - 0x20) * 8; - } else if ((j < 0x80) || ((j & 0x07) != 0)) { - return(0x100);//error - } - - if (hilo) { - j = rtval[i+1] = j + (rtval[i] & 0x07); - } else { - j = rtval[i] = j + (rtval[i+1] & 0x07); - } - return(j); + if (hilo) { + v = (eval() << 8); + v += eval(); + } else { + v = eval(); + v += (eval() << 8); + } + return(v); } -/* end sdld specific */ -/*)Function a_uint adb_lo(v, i) +/*)Function a_uint adb_1b(v, i) * - * int v value to add to byte - * int i rtval[] index + * a_uint v value to add to byte + * int i rtval[] index * - * The function adb_lo() adds the value of v to the - * double byte value contained in rtval[i] and rtval[i+1]. - * The new value of rtval[i] / rtval[i+1] is returned. - * The MSB rtflg[] is cleared. + * The function adb_1b() adds the value of v to + * the single byte value contained in rtval[i]. + * The new value of rtval[i] is returned. * - * local variable: - * a_uint j temporary evaluation variable + * local variable: + * a_uint j temporary evaluation variable * - * global variables: - * hilo byte ordering parameter + * global variables: + * none * - * called functions: - * none + * called functions: + * none * - * side effects: - * The value of rtval[] is changed. - * The rtflg[] value corresponding to the - * MSB of the word value is cleared to reflect - * the fact that the LSB is the selected byte. + * side effects: + * The byte value of rtval[] is changed. * */ a_uint -adb_lo(v, i) -a_uint v; -int i; +adb_1b(a_uint v, int i) { - register a_uint j; - - j = adw_w(v, i); - /* - * Remove Hi byte - */ - if (hilo) { - rtflg[i] = 0; - } else { - rtflg[i+1] = 0; - } - return (j); -} + a_uint j; -/*)Function a_uint adb_hi(v, i) - * - * int v value to add to byte - * int i rtval[] index - * - * The function adb_hi() adds the value of v to the - * double byte value contained in rtval[i] and rtval[i+1]. - * The new value of rtval[i] / rtval[i+1] is returned. - * The LSB rtflg[] is cleared. - * - * local variable: - * a_uint j temporary evaluation variable - * - * global variables: - * hilo byte ordering parameter - * - * called functions: - * none - * - * side effects: - * The value of rtval[] is changed. - * The rtflg[] value corresponding to the - * LSB of the word value is cleared to reflect - * the fact that the MSB is the selected byte. - * - */ - -a_uint -adb_hi(v, i) -a_uint v; -int i; -{ - register a_uint j; + j = v + rtval[i]; + rtval[i] = j & ((a_uint) 0x000000FF); - j = adw_w(v, i); - /* - * Remove Lo byte - */ - if (hilo) { - rtflg[i+1] = 0; - } else { - rtflg[i] = 0; - } - return (j); + return(j); } -/* sdld specific */ -/*)Function a_uint adb_24_bit(v, i) +/*)Function a_uint adb_2b(v, i) * - * int v value to add to byte - * int i rtval[] index + * a_uint v value to add to word + * int i rtval[] index * - * The function adb_24_bit() converts the single - * byte address value contained in rtval[i] to bit- - * addressable space and adds the value of v to it. - * The new value of rtval[i] is returned. + * The function adb_2b() adds the value of v to the + * 2 byte value contained in rtval[i] and rtval[i+1]. + * The new value of rtval[i] / rtval[i+1] is returned. * - * local variable: - * a_uint j temporary evaluation variable + * local variable: + * a_uint j temporary evaluation variable * - * global variables: - * none + * global variables: + * hilo byte ordering parameter * - * called functions: - * none + * called functions: + * none * - * side effects: - * The value of rtval[] is changed. + * side effects: + * The 2 byte value of rtval[] is changed. * */ a_uint -adb_24_bit(v, i) -a_uint v; -int i; +adb_2b(a_uint v, int i) { - register a_uint j; + a_uint j; - j = adb_24_lo(v, i) & 0xFF; - if ((j >= 0x20) && (j <= 0x2F)) { - j = (j - 0x20) * 8; - } else if ((j < 0x80) || ((j & 0x07) != 0)) { - return(0x100);//error - } - - if (hilo) { - j = rtval[i+2] = j + (rtval[i+1] & 0x07); - } else { - j = rtval[i] = j + (rtval[i+1] & 0x07); - } - return(j); + if (hilo) { + j = v + (rtval[i+0] << 8) + + (rtval[i+1] << 0); + rtval[i+0] = (j >> 8) & ((a_uint) 0x000000FF); + rtval[i+1] = (j >> 0) & ((a_uint) 0x000000FF); + } else { + j = v + (rtval[i+0] << 0) + + (rtval[i+1] << 8); + rtval[i+0] = (j >> 0) & ((a_uint) 0x000000FF); + rtval[i+1] = (j >> 8) & ((a_uint) 0x000000FF); + } + return(j); } -/*)Function a_uint adb_24_hi(v, i) +/*)Function a_uint adb_3b(v, i) * - * int v value to add to byte - * int i rtval[] index - * - * The function adb_24_hi() adds the value of v to the - * 24 bit value contained in rtval[i] - rtval[i+2]. - * The new value of rtval[i] / rtval[i+1] is returned. - * The LSB & middle byte rtflg[] is cleared. - * - * local variable: - * a_uint j temporary evaluation variable - * - * global variables: - * hilo byte ordering parameter - * - * called functions: - * none - * - * side effects: - * The value of rtval[] is changed. - * The rtflg[] value corresponding to the - * LSB & middle byte of the word value is cleared to - * reflect the fact that the MSB is the selected byte. - * - */ - -a_uint -adb_24_hi(v, i) -a_uint v; -int i; -{ - register a_uint j; - - j = adw_24(v, i); - - /* Remove the lower two bytes. */ - if (hilo) - { - rtflg[i+2] = 0; - } - else - { - rtflg[i] = 0; - } - rtflg[i+1] = 0; - - return (j); -} - -/*)Function a_uint adb_24_mid(v, i) + * a_uint v value to add to word + * int i rtval[] index * - * int v value to add to byte - * int i rtval[] index + * The function adb_3b() adds the value of v to the + * three byte value contained in rtval[i], rtval[i+1], and rtval[i+2]. + * The new value of rtval[i] / rtval[i+1] / rtval[i+2] is returned. * - * The function adb_24_mid() adds the value of v to the - * 24 bit value contained in rtval[i] - rtval[i+2]. - * The new value of rtval[i] / rtval[i+1] is returned. - * The LSB & MSB byte rtflg[] is cleared. - * - * local variable: - * a_uint j temporary evaluation variable - * - * global variables: - * hilo byte ordering parameter - * - * called functions: - * none - * - * side effects: - * The value of rtval[] is changed. - * The rtflg[] value corresponding to the - * LSB & MSB of the 24 bit value is cleared to reflect - * the fact that the middle byte is the selected byte. + * local variable: + * a_uint j temporary evaluation variable * - */ - -a_uint -adb_24_mid(v, i) -a_uint v; -int i; -{ - register a_uint j; - - j = adw_24(v, i); - - /* remove the MSB & LSB. */ - rtflg[i+2] = 0; - rtflg[i] = 0; - - return (j); -} - -/*)Function a_uint adb_24_lo(v, i) + * global variables: + * hilo byte ordering parameter * - * int v value to add to byte - * int i rtval[] index + * called functions: + * none * - * The function adb_24_lo() adds the value of v to the - * 24 bit value contained in rtval[i] - rtval[i+2]. - * The new value of rtval[i] / rtval[i+1] is returned. - * The MSB & middle byte rtflg[] is cleared. - * - * local variable: - * a_uint j temporary evaluation variable - * - * global variables: - * hilo byte ordering parameter - * - * called functions: - * none - * - * side effects: - * The value of rtval[] is changed. - * The rtflg[] value corresponding to the - * MSB & middle byte of the word value is cleared to - * reflect the fact that the LSB is the selected byte. + * side effects: + * The 3 byte value of rtval[] is changed. * */ a_uint -adb_24_lo(v, i) -a_uint v; -int i; +adb_3b(a_uint v, int i) { - register a_uint j; - - j = adw_24(v, i); + a_uint j; - /* Remove the upper two bytes. */ - if (hilo) - { - rtflg[i] = 0; - } - else - { - rtflg[i+2] = 0; - } - rtflg[i+1] = 0; - - return (j); + if (hilo) { + j = v + (rtval[i+0] << 16) + + (rtval[i+1] << 8) + + (rtval[i+2] << 0); + rtval[i+0] = (j >> 16) & ((a_uint) 0x000000FF); + rtval[i+1] = (j >> 8) & ((a_uint) 0x000000FF); + rtval[i+2] = (j >> 0) & ((a_uint) 0x000000FF); + } else { + j = v + (rtval[i+0] << 0) + + (rtval[i+1] << 8) + + (rtval[i+2] << 16); + rtval[i+0] = (j >> 0) & ((a_uint) 0x000000FF); + rtval[i+1] = (j >> 8) & ((a_uint) 0x000000FF); + rtval[i+2] = (j >> 16) & ((a_uint) 0x000000FF); + } + return(j); } -/* end sdld specific */ -/*)Function a_uint adw_w(v, i) +/*)Function a_uint adb_4b(v, i) * - * int v value to add to word - * int i rtval[] index + * a_uint v value to add to word + * int i rtval[] index * - * The function adw_w() adds the value of v to the - * word value contained in rtval[i] and rtval[i+1]. - * The new value of rtval[i] / rtval[i+1] is returned. + * The function adb_4b() adds the value of v to the + * four byte value contained in rtval[i], ..., rtval[i+3]. + * The new value of rtval[i], ..., rtval[i+3] is returned. * - * local variable: - * a_uint j temporary evaluation variable + * local variable: + * a_uint j temporary evaluation variable * - * global variables: - * hilo byte ordering parameter + * global variables: + * hilo byte ordering parameter * - * called functions: - * none + * called functions: + * none * - * side effects: - * The word value of rtval[] is changed. + * side effects: + * The 4 byte value of rtval[] is changed. * */ a_uint -adw_w(v, i) -a_uint v; -int i; -{ - register a_uint j; - - if (hilo) { - j = v + (rtval[i] << 8) + (rtval[i+1] & 0xff); - rtval[i] = (j >> 8) & 0xff; - rtval[i+1] = j & 0xff; - } else { - j = v + (rtval[i] & 0xff) + (rtval[i+1] << 8); - rtval[i] = j & 0xff; - rtval[i+1] = (j >> 8) & 0xff; - } - return(j); -} - -/* sdld specific */ -/*)Function a_uint adw_24(v, i) - * - * int v value to add to word - * int i rtval[] index - * - * The function adw_w() adds the value of v to the - * 24 bit value contained in rtval[i] - rtval[i+2]. - * The new value of rtval[i] - rtval[i+2] is returned. - * - * local variable: - * a_uint j temporary evaluation variable - * - * global variables: - * hilo byte ordering parameter - * - * called functions: - * none - * - * side effects: - * The word value of rtval[] is changed. - * - */ -a_uint -adw_24(v, i) -a_uint v; -int i; +adb_4b(a_uint v, int i) { - register a_uint j; + a_uint j; - if (hilo) { - j = v + ((rtval[i] & 0xff) << 16) - + ((rtval[i+1] & 0xff) << 8) - + (rtval[i+2] & 0xff); - rtval[i] = (j >> 16) & 0xff; - rtval[i+1] = (j >> 8) & 0xff; - rtval[i+2] = j & 0xff; - } else { - j = v + (rtval[i] & 0xff) - + ((rtval[i+1] & 0xff) << 8) - + ((rtval[i+2] & 0xff) << 16); - rtval[i] = j & 0xff; - rtval[i+1] = (j >> 8) & 0xff; - rtval[i+2] = (j >> 16) & 0xff; - } - return(j); + if (hilo) { + j = v + (rtval[i+0] << 24) + + (rtval[i+1] << 16) + + (rtval[i+2] << 8) + + (rtval[i+3] << 0); + rtval[i+0] = (j >> 24) & ((a_uint) 0x000000FF); + rtval[i+1] = (j >> 16) & ((a_uint) 0x000000FF); + rtval[i+2] = (j >> 8) & ((a_uint) 0x000000FF); + rtval[i+3] = (j >> 0) & ((a_uint) 0x000000FF); + } else { + j = v + (rtval[i+0] << 0) + + (rtval[i+1] << 8) + + (rtval[i+2] << 16) + + (rtval[i+3] << 24); + rtval[i+0] = (j >> 0) & ((a_uint) 0x000000FF); + rtval[i+1] = (j >> 8) & ((a_uint) 0x000000FF); + rtval[i+2] = (j >> 16) & ((a_uint) 0x000000FF); + rtval[i+3] = (j >> 24) & ((a_uint) 0x000000FF); + } + return(j); } -/* end sdld specific */ -/*)Function a_uint adw_lo(v, i) - * - * int v value to add to byte - * int i rtval[] index - * - * The function adw_lo() adds the value of v to the - * double byte value contained in rtval[i] and rtval[i+1]. - * The new value of rtval[i] / rtval[i+1] is returned. - * The MSB rtval[] is zeroed. +/*)Function a_uint adb_xb(v, i) * - * local variable: - * a_uint j temporary evaluation variable + * a_uint v value to add to x-bytes + * int i rtval[] index * - * global variables: - * hilo byte ordering parameter + * The function adb_xb() adds the value of v to + * the value contained in rtval[i] for x-bytes. + * The new value of rtval[i] for x-bytes is returned. * - * called functions: - * none + * local variable: + * none * - * side effects: - * The value of rtval[] is changed. - * The MSB of the word value is cleared to reflect - * the fact that the LSB is the selected byte. - * - */ - -a_uint -adw_lo(v, i) -a_uint v; -int i; -{ - register a_uint j; - - j = adw_w(v, i); - /* - * Clear Hi byte - */ - if (hilo) { - rtval[i] = 0; - } else { - rtval[i+1] = 0; - } - return (j); -} - -/*)Function a_uint adw_hi(v, i) + * global variables: + * int a_bytes T Line Address Bytes * - * int v value to add to byte - * int i rtval[] index + * called functions: + * a_uint adb_1b() lkrloc.c + * a_uint adb_2b() lkrloc.c + * a_uint adb_3b() lkrloc.c + * a_uint adb_4b() lkrloc.c * - * The function adw_hi() adds the value of v to the - * double byte value contained in rtval[i] and rtval[i+1]. - * The new value of rtval[i] / rtval[i+1] is returned. - * The MSB and LSB values are interchanged. - * The MSB rtval[] is zeroed. - * - * local variable: - * a_uint j temporary evaluation variable - * - * global variables: - * hilo byte ordering parameter - * - * called functions: - * none - * - * side effects: - * The value of rtval[] is changed. - * The MSB and LSB values are interchanged and - * then the MSB cleared. + * side effects: + * The x-byte value of rtval[] is changed. * */ a_uint -adw_hi(v, i) -a_uint v; -int i; -{ - register a_uint j; - - j = adw_w(v, i); - /* - * LSB = MSB, Clear MSB - */ - if (hilo) { - rtval[i+1] = rtval[i]; - rtval[i] = 0; - } else { - rtval[i] = rtval[i+1]; - rtval[i+1] = 0; - } - return (j); -} - -/*)Function VOID relerr(str) - * - * char *str error string - * - * The function relerr() outputs the error string to - * stderr and to the map file (if it is open). - * - * local variable: - * none - * - * global variables: - * FILE *mfp handle for the map file - * - * called functions: - * VOID errdmp() lkrloc.c - * - * side effects: - * Error message inserted into map file. - * - */ - -VOID -relerr(str) -char *str; +adb_xb(a_uint v, int i) { - errdmp(stderr, str); - if (mfp) - errdmp(mfp, str); -} - -/*)Function VOID errdmp(fptr, str) - * - * FILE *fptr output file handle - * char *str error string - * - * The function errdmp() outputs the error string str - * to the device specified by fptr. Additional information - * is output about the definition and referencing of - * the symbol / area error. - * - * local variable: - * int mode error mode - * int aindex area index - * int lkerr error flag - * int rindex error index - * sym **s pointer to array of symbol pointers - * areax **a pointer to array of area pointers - * areax *raxp error area extension pointer - * - * global variables: - * sdp sdp base page structure - * - * called functions: - * int fprintf() c_library - * VOID prntval() lkrloc.c - * - * side effects: - * Error reported. - * - */ + a_uint j; -VOID -errdmp(fptr, str) -FILE *fptr; -char *str; -{ - int mode, aindex, rindex; - struct sym **s; - struct areax **a; - struct areax *raxp; - - a = hp->a_list; - s = hp->s_list; - - mode = rerr.mode; - aindex = rerr.aindex; - rindex = rerr.rindex; - - /* - * Print Error - */ - fprintf(fptr, "\n?ASlink-Warning-%s", str); - lkerr++; - - /* - * Print symbol if symbol based - */ - if (mode & R3_SYM) { - fprintf(fptr, " for symbol %s\n", - &s[rindex]->s_id[0]); - } else { - fprintf(fptr, "\n"); - } - - /* - * Print Ref Info - */ -/* 111111111122222222223333333333444444444455555555556666666666777*/ -/*123456789012345678901234567890123456789012345678901234567890123456789012*/ - fprintf(fptr, -" file module area offset\n"); - fprintf(fptr, -" Refby %-14.14s %-14.14s %-14.14s ", - hp->h_lfile->f_idp, - &hp->m_id[0], - &a[aindex]->a_bap->a_id[0]); - prntval(fptr, rerr.rtbase); - - /* - * Print Def Info - */ - if (mode & R3_SYM) { - raxp = s[rindex]->s_axp; - } else { - raxp = a[rindex]; - } -/* 111111111122222222223333333333444444444455555555556666666666777*/ -/*123456789012345678901234567890123456789012345678901234567890123456789012*/ - fprintf(fptr, -" Defin %-14.14s %-14.14s %-14.14s ", - raxp->a_bhp->h_lfile->f_idp, - &raxp->a_bhp->m_id[0], - &raxp->a_bap->a_id[0]); - if (mode & R3_SYM) { - prntval(fptr, s[rindex]->s_addr); - } else { - prntval(fptr, rerr.rval); - } + switch(a_bytes){ + case 1: + j = adb_1b(v, i); + j = (j & ((a_uint) 0x00000080) ? j | ~((a_uint) 0x0000007F) : j & ((a_uint) 0x0000007F)); + break; + case 2: + j = adb_2b(v, i); + j = (j & ((a_uint) 0x00008000) ? j | ~((a_uint) 0x00007FFF) : j & ((a_uint) 0x00007FFF)); + break; + case 3: + j = adb_3b(v, i); + j = (j & ((a_uint) 0x00800000) ? j | ~((a_uint) 0x007FFFFF) : j & ((a_uint) 0x007FFFFF)); + break; + case 4: + j = adb_4b(v, i); + j = (j & ((a_uint) 0x80000000) ? j | ~((a_uint) 0x7FFFFFFF) : j & ((a_uint) 0x7FFFFFFF)); + break; + default: + j = 0; + break; + } + return(j); } /*)Function VOID prntval(fptr, v) * - * FILE *fptr output file handle - * a_uint v value to output + * FILE *fptr output file handle + * a_uint v value to output * - * The function prntval() outputs the value v, in the - * currently selected radix, to the device specified - * by fptr. + * The function prntval() outputs the value v, in the + * currently selected radix, to the device specified + * by fptr. * - * local variable: - * none + * local variable: + * none * - * global variables: - * int xflag current radix + * global variables: + * int xflag current radix * - * called functions: - * int fprintf() c_library + * called functions: + * int fprintf() c_library * - * side effects: - * none + * side effects: + * none * */ @@ -1556,98 +383,34 @@ FILE *fptr; a_uint v; { - if (xflag == 0) { - fprintf(fptr, "%04X\n", v); - } else - if (xflag == 1) { - fprintf(fptr, "%06o\n", v); - } else - if (xflag == 2) { - fprintf(fptr, "%05u\n", v); - } -} - -/*)Function VOID relerp(str) - * - * char *str error string - * - * The function relerp() outputs the paging error string to - * stderr and to the map file (if it is open). - * - * local variable: - * none - * - * global variables: - * FILE *mfp handle for the map file - * - * called functions: - * VOID erpdmp() lkrloc.c - * - * side effects: - * Error message inserted into map file. - * - */ - -VOID -relerp(str) -char *str; -{ - erpdmp(stderr, str); - if (mfp) - erpdmp(mfp, str); -} - -/*)Function VOID erpdmp(fptr, str) - * - * FILE *fptr output file handle - * char *str error string - * - * The function erpdmp() outputs the error string str - * to the device specified by fptr. - * - * local variable: - * head *thp pointer to head structure - * - * global variables: - * int lkerr error flag - * sdp sdp base page structure - * - * called functions: - * int fprintf() c_library - * VOID prntval() lkrloc.c - * - * side effects: - * Error reported. - * - */ - -VOID -erpdmp(fptr, str) -FILE *fptr; -char *str; -{ - register struct head *thp; - - thp = sdp.s_areax->a_bhp; + char *frmt; - /* - * Print Error - */ - fprintf(fptr, "\n?ASlink-Warning-%s\n", str); - lkerr++; - - /* - * Print PgDef Info - */ -/* 111111111122222222223333333333444444444455555555556666666666777*/ -/*123456789012345678901234567890123456789012345678901234567890123456789012*/ - fprintf(fptr, -" file module pgarea pgoffset\n"); - fprintf(fptr, -" PgDef %-14.14s %-14.14s %-14.14s ", - thp->h_lfile->f_idp, - &thp->m_id[0], - &sdp.s_area->a_id[0]); - prntval(fptr, sdp.s_area->a_addr + sdp.s_addr); + switch(xflag) { + default: + case 0: + switch(a_bytes) { + default: + case 2: frmt = " %04X\n"; break; + case 3: frmt = " %06X\n"; break; + case 4: frmt = " %08X\n"; break; + } + break; + case 1: + switch(a_bytes) { + default: + case 2: frmt = " %06o\n"; break; + case 3: frmt = " %08o\n"; break; + case 4: frmt = "%011o\n"; break; + } + break; + case 2: + switch(a_bytes) { + default: + case 2: frmt = " %05u\n"; break; + case 3: frmt = " %08u\n"; break; + case 4: frmt = " %010u\n"; break; + } + break; + } + fprintf(fptr, frmt, v & a_mask); } - diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lkrloc3.c sdcc-3.2.0+dfsg/sdas/linksrc/lkrloc3.c --- sdcc-3.1.0+dfsg/sdas/linksrc/lkrloc3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lkrloc3.c 2011-12-06 23:01:37.000000000 +0000 @@ -0,0 +1,1302 @@ +/* lkrloc3.c */ + +/* + * Copyright (C) 1989-2010 Alan R. Baldwin + * + * 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, see . + * + * + * Alan R. Baldwin + * 721 Berkeley St. + * Kent, Ohio 44240 + * + * With enhancements from: + * + * John L. Hartman (JLH) + * jhartman@compuserve.com + * + * Bill McKinnon (BM) + * w_mckinnon@conknet.com + */ + +#include "aslink.h" + +/*)Module lkrloc3.c + * + * The module lkrloc3.c contains the functions which + * perform the version 3 relocation calculations. + * + * lkrloc3.c contains the following functions: + * a_uint adb_lo() + * a_uint adb_hi() + * VOID erpdmp3() + * VOID errdmp3() + * VOID rele3() + * VOID relerr3() + * VOID relerp3() + * VOID reloc3() + * VOID relp3() + * VOID relr3() + * VOID relt3() + * + * lkrloc3.c the local variable errmsg3[]. + * + */ + +/*)Function VOID reloc3(c) + * + * int c process code + * + * The function reloc3() calls a particular relocation + * function determined by the process code. + * + * local variable: + * none + * + * global variables: + * int lkerr error flag + * + * called functions: + * int fprintf() c_library + * VOID rele3() lkrloc3.c + * VOID relp3() lkrloc3.c + * VOID relr3() lkrloc3.c + * VOId relt3() lkrloc3.c + * + * side effects: + * Refer to the called relocation functions. + * + */ + +VOID +reloc3(int c) +{ + switch(c) { + + case 'T': + relt3(); + break; + + case 'R': + relr3(); + break; + + case 'P': + relp3(); + break; + + case 'E': + rele3(); + break; + + default: + fprintf(stderr, "Undefined Relocation Operation\n"); + lkerr++; + break; + + } +} + + +/*)Function VOID relt3() + * + * The function relt3() evaluates a T line read by + * the linker. Each byte value read is saved in the + * rtval[] array, rtflg[] is set, and the number of + * evaluations is maintained in rtcnt. + * + * T Line + * + * T xx xx nn nn nn nn nn ... + * + * + * In: "T n0 n1 n2 n3 ... nn" + * + * Out: 0 1 2 .. rtcnt + * +----+----+----+----+----+ + * rtval | n0 | n1 | n2 | .. | nn | + * +----+----+----+----+----+ + * rtflag| 1 | 1 | 1 | 1 | 1 | + * +----+----+----+----+----+ + * + * The T line contains the assembled code output by the assem- + * bler with xx xx being the offset address from the current area + * base address and nn being the assembled instructions and data in + * byte format. + * + * local variable: + * none + * + * global variables: + * int rtcnt number of values evaluated + * int rtflg[] array of evaluation flags + * int rtval[] array of evaluation values + * + * called functions: + * int eval() lkeval.c + * int more() lklex.c + * + * side effects: + * Linker input T line evaluated. + * + */ + +VOID +relt3(void) +{ + rtcnt = 0; + while (more()) { + if (rtcnt < NTXT) { + rtval[rtcnt] = eval(); + rtflg[rtcnt] = 1; + rterr[rtcnt] = 0; + rtcnt++; + } + } +} + +/*)Function VOID relr3() + * + * The function relr3() evaluates a R line read by + * the linker. The R line data is combined with the + * previous T line data to perform the relocation of + * code and data bytes. The S19 / IHX output and + * translation of the LST files to RST files may be + * performed. + * + * R Line + * + * R 0 0 nn nn n1 n2 xx xx ... + * + * The R line provides the relocation information to the linker. + * The nn nn value is the current area index, i.e. which area the + * current values were assembled. Relocation information is en- + * coded in groups of 4 bytes: + * + * 1. n1 is the relocation mode and object format + * 1. bit 0 word(0x00)/byte(0x01) + * 2. bit 1 relocatable area(0x00)/symbol(0x02) + * 3. bit 2 normal(0x00)/PC relative(0x04) relocation + * 4. bit 3 1-byte(0x00)/2-byte(0x08) byte data + * 5. bit 4 signed(0x00)/unsigned(0x10) byte data + * 6. bit 5 normal(0x00)/page '0'(0x20) reference + * 7. bit 6 normal(0x00)/page 'nnn'(0x40) reference + * + * 2. n2 is a byte index into the corresponding (i.e. pre- + * ceeding) T line data (i.e. a pointer to the data to be + * updated by the relocation). The T line data may be + * 1-byte or 2-byte byte data format or 2-byte word + * format. + * + * 3. xx xx is the area/symbol index for the area/symbol be- + * ing referenced. the corresponding area/symbol is found + * in the header area/symbol lists. + * + * The groups of 4 bytes are repeated for each item requiring relo- + * cation in the preceeding T line. + * + * local variable: + * areax **a pointer to array of area pointers + * int aindex area index + * char *errmsg3[] array of pointers to error strings + * int error error code + * int mode relocation mode + * adrr_t paga paging base area address + * a_uint pags paging symbol address + * a_uint r PCR relocation value + * a_uint reli relocation initial value + * a_uint relv relocation final value + * int rindex symbol / area index + * a_uint rtbase base code address + * a_uint rtofst rtval[] index offset + * int rtp index into T data + * sym **s pointer to array of symbol pointers + * + * global variables: + * head *hp pointer to the head structure + * int lkerr error flag + * a_uint pc relocated base address + * int pcb bytes per instruction word + * rerr rerr linker error structure + * FILE *stderr standard error device + * + * called functions: + * a_uint adb_1b() lkrloc.c + * a_uint adb_2b() lkrloc.c + * a_uint adb_lo() lkrloc3.c + * a_uint adb_hi() lkrloc3.c + * sdld specific + * VOID elf() lkelf.c + * VOID gb() lkgb.c + * end sdld specific + * a_uint evword() lkrloc.c + * int eval() lkeval.c + * int fprintf() c_library + * VOID ihx() lkihx.c + * VOID s19() lks19.c + * VOID lkulist lklist.c + * int more() lklex.c + * VOID relerr3() lkrloc3.c + * int symval() lksym.c + * + * side effects: + * The R and T lines are combined to produce + * relocated code and data. Output Sxx / Ixx + * and relocated listing files may be produced. + * + */ + +VOID +relr3(void) +{ + int mode; + a_uint reli, relv; + int aindex, rindex, rtp, error, i; + a_uint r, rtbase, rtofst, paga = 0, pags = 0; + struct areax **a; + struct sym **s; + + /* + * Get area and symbol lists + */ + a = hp->a_list; + s = hp->s_list; + + /* + * Verify Area Mode + */ + if (eval() != (R3_WORD | R3_AREA) || eval()) { + fprintf(stderr, "R input error\n"); + lkerr++; + return; + } + + /* + * Get area pointer + */ + aindex = (int) evword(); + if (aindex >= hp->h_narea) { + fprintf(stderr, "R area error\n"); + lkerr++; + return; + } + + /* + * Select Output File + */ + if (oflag != 0) { + ap = a[aindex]->a_bap; + if (ofp != NULL) { + rtabnk->b_rtaflg = rtaflg; + if (ofp != ap->a_ofp) { + lkflush(); + } + } + ofp = ap->a_ofp; + rtabnk = ap->a_bp; + rtaflg = rtabnk->b_rtaflg; + } + + /* + * Base values + */ + rtbase = adb_2b(0, 0); + rtofst = 2; + + /* + * Relocate address + */ + pc = adb_2b(a[aindex]->a_addr, 0); + + /* + * Number of 'bytes' per PC address + */ + pcb = 1; + + #if 0 + printf("area %d base address: 0x%x size: 0x%x rtbase: 0x%x\n", aindex, + a[aindex]->a_addr, a[aindex]->a_size, rtbase); + #endif + /* + * Do remaining relocations + */ + while (more()) { + error = 0; + mode = (int) eval(); + + if ((mode & R_ESCAPE_MASK) == R_ESCAPE_MASK) + { + mode = ((mode & ~R_ESCAPE_MASK) << 8) | eval(); + /* printf("unescaping rmode\n"); */ + } + + rtp = (int) eval(); + rindex = (int) evword(); + + /* + * R3_SYM or R3_AREA references + */ + if (mode & R3_SYM) { + if (rindex >= hp->h_nsym) { + fprintf(stderr, "R symbol error\n"); + lkerr++; + return; + } + reli = symval(s[rindex]); + } +/* sdld specific */ + else if ((IS_R_J11(mode) || IS_R_J19(mode)) && (rindex == 0xFFFF)) { + /* absolute acall/ajmp address */ + reli = 0; + } +/* end sdld specific */ + else { + if (rindex >= hp->h_narea) { + fprintf(stderr, "R area error\n"); + lkerr++; + return; + } + reli = a[rindex]->a_addr; + } + + /* + * R3_PCR addressing + */ + if (mode & R3_PCR) { + if (mode & R3_BYTE) { + reli -= (pc + (rtp-rtofst) + 1); + } else { + reli -= (pc + (rtp-rtofst) + 2); + } + } + + /* + * R3_PAG0 or R3_PAG addressing + */ + if (mode & (R3_PAG0 | R3_PAG)) { + paga = sdp.s_area->a_addr; + pags = sdp.s_addr; + reli -= paga + pags; + } + + /* + * R3_BYTE or R3_WORD operation + */ + if (mode & R3_BYTE) { + if (mode & R_BYT3) + { + /* This is a three byte address, of which + * we will select one byte. + */ +/* sdld specific */ + if (mode & R_BIT) + { + relv = adb_24_bit(reli, rtp); + } +/* sdld specific */ + else if (mode & R_HIB) + { + /* printf("24 bit address selecting hi byte.\n"); */ + relv = adb_24_hi(reli, rtp); + } + else if (mode & R3_MSB) + { + /* Note that in 24 bit mode, R3_MSB + * is really the middle byte, not + * the most significant byte. + * + * This is ugly and I can only apologize + * for any confusion. + */ + /* printf("24 bit address selecting middle byte.\n"); */ + relv = adb_24_mid(reli, rtp); + } + else + { + /* printf("24 bit address selecting lo byte.\n"); */ + relv = adb_24_lo(reli, rtp); + } + } + else if (mode & R3_BYTX) { + /* This is a two byte address, of + * which we will select one byte. + */ + if (mode & R_BIT) { + relv = adb_bit(reli, rtp); + } else if (mode & R3_MSB) { + relv = adb_hi(reli, rtp); + } else { + relv = adb_lo(reli, rtp); + } + } else { + relv = adb_1b(reli, rtp); + } + } else if (IS_R_J11(mode)) { + /* + * JLH: 11 bit jump destination for 8051. + * Forms two byte instruction with + * op-code bits in the MIDDLE! + * rtp points at 3 byte locus: + * first two will get the address, + * third one has raw op-code + */ + + /* + * Calculate absolute destination + * relv must be on same 2K page as pc + */ + relv = adb_2b(reli, rtp); + + if ((relv & ~((a_uint) 0x000007FF)) != + ((pc + rtp - rtofst) & ~((a_uint) 0x000007FF))) { + error = 6; + } + + /* + * Merge MSB with op-code, + * ignoring top 5 bits of address. + * Then hide the op-code. + */ + rtval[rtp] = ((rtval[rtp] & 0x07)<<5) | rtval[rtp+2]; + rtflg[rtp + 2] = 0; + rtofst += 1; + } + else if (IS_R_J19(mode)) { + /* + * BK: 19 bit jump destination for DS80C390. + * Forms four byte instruction with + * op-code bits in the MIDDLE! + * rtp points at 4 byte locus: + * first three will get the address, + * fourth one has raw op-code + */ + relv = adb_3b(reli, rtp); + + /* + * Calculate absolute destination + * relv must be on same 512K page as pc + */ + if ((relv & ~((a_uint) 0x0007FFFF)) != + ((pc + rtp - rtofst) & ~((a_uint) 0x0007FFFF))) { + error = 7; + } + + /* + * Merge MSB with op-code, + * ignoring top 5 bits of address. + * Then hide the op-code. + */ + rtval[rtp] = ((rtval[rtp] & 0x07)<<5) | rtval[rtp+3]; + rtflg[rtp + 3] = 0; + rtofst += 1; + } + else if (IS_C24(mode)) + { + /* + * 24 bit destination + */ + relv = adb_3b(reli, rtp); + } + else + { + /* 16 bit address. */ + relv = adb_2b(reli, rtp); + } + + /* + * R3_BYTE with R3_BYTX offset adjust + */ + if (mode & R3_BYTE) { + if (mode & R3_BYTX) { + rtofst += 1; + } + } + + /* + * Unsigned Byte Checking + */ + if (mode & R3_USGN && mode & R3_BYTE && relv & ~((a_uint) 0x000000FF)) + error = 1; + + /* + * PCR Relocation Error Checking + */ + if (mode & R3_PCR && mode & R3_BYTE) { + r = relv & ~0x7F; + if (r != (a_uint) ~0x7F && r != 0) + error = 2; + } + + /* + * Page Relocation Error Checking + */ + if ((TARGET_IS_GB || TARGET_IS_Z80) && + mode & R3_PAG0 && (relv & ~0xFF || paga || pags)) + error = 4; + if (mode & R3_PAG && (relv & ~0xFF)) + error = 5; +/* sdld specific */ + if ((mode & R_BIT) && (relv & ~0x87FF)) + error = 10; +/* end sdld specific */ + + /* + * Error Processing + */ + if (error) { + rerr.aindex = aindex; + rerr.mode = mode; + rerr.rtbase = rtbase + rtp - rtofst - 1; + rerr.rindex = rindex; + rerr.rval = relv - reli; + relerr3(errmsg3[error]); + + for (i=rtp; ia_list; + s = hp->s_list; + + /* + * Verify Area Mode + */ + if (eval() != (R3_WORD | R3_AREA) || eval()) { + fprintf(stderr, "P input error\n"); + lkerr++; + } + + /* + * Get area pointer + */ + aindex = (int) evword(); + if (aindex >= hp->h_narea) { + fprintf(stderr, "P area error\n"); + lkerr++; + return; + } + + /* + * Do remaining relocations + */ + while (more()) { + mode = (int) eval(); + rtp = (int) eval(); + rindex = (int) evword(); + + /* + * R3_SYM or R3_AREA references + */ + if (mode & R3_SYM) { + if (rindex >= hp->h_nsym) { + fprintf(stderr, "P symbol error\n"); + lkerr++; + return; + } + relv = symval(s[rindex]); + } else { + if (rindex >= hp->h_narea) { + fprintf(stderr, "P area error\n"); + lkerr++; + return; + } + relv = a[rindex]->a_addr; + } + adb_2b(relv, rtp); + } + + /* + * Paged values + */ + aindex = (int) adb_2b(0, 2); + if (aindex >= hp->h_narea) { + fprintf(stderr, "P area error\n"); + lkerr++; + return; + } + sdp.s_areax = a[aindex]; + sdp.s_area = sdp.s_areax->a_bap; + sdp.s_addr = adb_2b(0, 4); + if (sdp.s_area->a_addr & 0xFF || sdp.s_addr & 0xFF) + relerp3("Page Definition Boundary Error"); +} + +/*)Function VOID rele3() + * + * The function rele3() closes all open output files + * at the end of the linking process. + * + * local variable: + * none + * + * global variables: + * int oflag output type flag + * int uflag relocation listing flag + * + * called functions: + * VOID lkfclose() lkbank.c + * VOID lkflush() lkout.c + * VOID lkulist() lklist.c + * + * side effects: + * All open output files are closed. + * + */ + +VOID +rele3() +{ + if (uflag != 0) { + lkulist(0); + } + if (oflag != 0) { + lkflush(); + lkfclose(); + } +} + +/*)Function VOID relerr3(str) + * + * char *str error string + * + * The function relerr3() outputs the error string to + * stderr and to the map file (if it is open). + * + * local variable: + * none + * + * global variables: + * FILE *mfp handle for the map file + * + * called functions: + * VOID errdmp3() lkrloc3.c + * + * side effects: + * Error message inserted into map file. + * + */ + +VOID +relerr3(char *str) +{ + errdmp3(stderr, str); + if (mfp) + errdmp3(mfp, str); +} + +/*)Function VOID errdmp3(fptr, str) + * + * FILE *fptr output file handle + * char *str error string + * + * The function errdmp3() outputs the error string str + * to the device specified by fptr. Additional information + * is output about the definition and referencing of + * the symbol / area error. + * + * local variable: + * int mode error mode + * int aindex area index + * int lkerr error flag + * int rindex error index + * sym **s pointer to array of symbol pointers + * areax **a pointer to array of area pointers + * areax *raxp error area extension pointer + * + * global variables: + * sdp sdp base page structure + * + * called functions: + * int fprintf() c_library + * VOID prntval() lkrloc.c + * + * side effects: + * Error reported. + * + */ + +VOID +errdmp3(FILE *fptr, char *str) +{ + int mode, aindex, rindex; + struct sym **s; + struct areax **a; + struct areax *raxp; + + a = hp->a_list; + s = hp->s_list; + + mode = rerr.mode; + aindex = rerr.aindex; + rindex = rerr.rindex; + + /* + * Print Error + */ + fprintf(fptr, "\n?ASlink-Warning-%s", str); + lkerr++; + + /* + * Print symbol if symbol based + */ + if (mode & R3_SYM) { + fprintf(fptr, " for symbol %s\n", + &s[rindex]->s_id[0]); + } else { + fprintf(fptr, "\n"); + } + + /* + * Print Ref Info + */ +/* 11111111112222222222333333333344444444445555555555666666666677777*/ +/*12345678901234567890123456789012345678901234567890123456789012345678901234*/ +/* | | | | */ + fprintf(fptr, +" file module area offset\n"); + fprintf(fptr, +" Refby %-14.14s %-14.14s %-14.14s ", + hp->h_lfile->f_idp, + &hp->m_id[0], + &a[aindex]->a_bap->a_id[0]); + prntval(fptr, rerr.rtbase); + + /* + * Print Def Info + */ + if (mode & R3_SYM) { + raxp = s[rindex]->s_axp; + } else { + raxp = a[rindex]; + } +/* 11111111112222222222333333333344444444445555555555666666666677777*/ +/*12345678901234567890123456789012345678901234567890123456789012345678901234*/ +/* | | | | */ + fprintf(fptr, +" Defin %-14.14s %-14.14s %-14.14s ", + raxp->a_bhp->h_lfile->f_idp, + &raxp->a_bhp->m_id[0], + &raxp->a_bap->a_id[0]); + if (mode & R3_SYM) { + prntval(fptr, s[rindex]->s_addr); + } else { + prntval(fptr, rerr.rval); + } +} + +/*)Function VOID relerp3(str) + * + * char *str error string + * + * The function relerp3() outputs the paging error string to + * stderr and to the map file (if it is open). + * + * local variable: + * none + * + * global variables: + * FILE *mfp handle for the map file + * + * called functions: + * VOID erpdmp3() lkrloc3.c + * + * side effects: + * Error message inserted into map file. + * + */ + +VOID +relerp3(char *str) +{ + erpdmp3(stderr, str); + if (mfp) + erpdmp3(mfp, str); +} + +/*)Function VOID erpdmp3(fptr, str) + * + * FILE *fptr output file handle + * char *str error string + * + * The function erpdmp3() outputs the error string str + * to the device specified by fptr. + * + * local variable: + * head *thp pointer to head structure + * + * global variables: + * int lkerr error flag + * sdp sdp base page structure + * + * called functions: + * int fprintf() c_library + * VOID prntval() lkrloc.c + * + * side effects: + * Error reported. + * + */ + +VOID +erpdmp3(FILE *fptr, char *str) +{ + struct head *thp; + + thp = sdp.s_areax->a_bhp; + + /* + * Print Error + */ + fprintf(fptr, "\n?ASlink-Warning-%s\n", str); + lkerr++; + + /* + * Print PgDef Info + */ +/* 111111111122222222223333333333444444444455555555556666666666777*/ +/*123456789012345678901234567890123456789012345678901234567890123456789012*/ + fprintf(fptr, +" file module pgarea pgoffset\n"); + fprintf(fptr, +" PgDef %-14.14s %-14.14s %-14.14s ", + thp->h_lfile->f_idp, + &thp->m_id[0], + &sdp.s_area->a_id[0]); + prntval(fptr, sdp.s_area->a_addr + sdp.s_addr); +} + +/* sdld specific */ +/*)Function a_uint adb_bit(v, i) + * + * a_uint v value to add to byte + * int i rtval[] index + * + * The function adb_bit() converts the single + * byte address value contained in rtval[i] to bit- + * addressable space and adds the value of v to it. + * The new value of rtval[i] is returned. + * + * local variable: + * a_uint j temporary evaluation variable + * + * global variables: + * none + * + * called functions: + * none + * + * side effects: + * The value of rtval[] is changed. + * + */ + +a_uint +adb_bit(a_uint v, int i) +{ + a_uint j; + + j = adb_lo(v, i) & 0xFF; + if ((j >= 0x20) && (j <= 0x2F)) { + j = (j - 0x20) * 8; + } else if ((j < 0x80) || ((j & 0x07) != 0)) { + return(0x100);//error + } + + if (hilo) { + j = rtval[i+1] = j + (rtval[i] & 0x07); + } else { + j = rtval[i] = j + (rtval[i+1] & 0x07); + } + return(j); +} +/* end sdld specific */ + +/*)Function a_uint adb_lo(v, i) + * + * int v value to add to byte + * int i rtval[] index + * + * The function adb_lo() adds the value of v to the + * double byte value contained in rtval[i] and rtval[i+1]. + * The new value of rtval[i] / rtval[i+1] is returned. + * The MSB rtflg[] is cleared. + * + * local variable: + * a_uint j temporary evaluation variable + * + * global variables: + * hilo byte ordering parameter + * + * called functions: + * none + * + * side effects: + * The value of rtval[] is changed. + * The rtflg[] value corresponding to the + * MSB of the word value is cleared to reflect + * the fact that the LSB is the selected byte. + * + */ + +a_uint +adb_lo(v, i) +a_uint v; +int i; +{ + a_uint j; + + j = adb_2b(v, i); + /* + * Remove Hi byte + */ + if (hilo) { + rtflg[i] = 0; + } else { + rtflg[i+1] = 0; + } + return (j); +} + +/*)Function a_uint adb_hi(v, i) + * + * int v value to add to byte + * int i rtval[] index + * + * The function adb_hi() adds the value of v to the + * double byte value contained in rtval[i] and rtval[i+1]. + * The new value of rtval[i] / rtval[i+1] is returned. + * The LSB rtflg[] is cleared. + * + * local variable: + * a_uint j temporary evaluation variable + * + * global variables: + * hilo byte ordering parameter + * + * called functions: + * none + * + * side effects: + * The value of rtval[] is changed. + * The rtflg[] value corresponding to the + * LSB of the word value is cleared to reflect + * the fact that the MSB is the selected byte. + * + */ + +a_uint +adb_hi(v, i) +a_uint v; +int i; +{ + a_uint j; + + j = adb_2b(v, i); + /* + * Remove Lo byte + */ + if (hilo) { + rtflg[i+1] = 0; + } else { + rtflg[i] = 0; + } + return (j); +} + +/* sdld specific */ +/*)Function a_uint adb_24_bit(v, i) + * + * a_uint v value to add to byte + * int i rtval[] index + * + * The function adb_24_bit() converts the single + * byte address value contained in rtval[i] to bit- + * addressable space and adds the value of v to it. + * The new value of rtval[i] is returned. + * + * local variable: + * a_uint j temporary evaluation variable + * + * global variables: + * none + * + * called functions: + * none + * + * side effects: + * The value of rtval[] is changed. + * + */ + +a_uint +adb_24_bit(v, i) +a_uint v; +int i; +{ + a_uint j; + + j = adb_24_lo(v, i) & 0xFF; + if ((j >= 0x20) && (j <= 0x2F)) { + j = (j - 0x20) * 8; + } else if ((j < 0x80) || ((j & 0x07) != 0)) { + return(0x100);//error + } + + if (hilo) { + j = rtval[i+2] = j + (rtval[i+1] & 0x07); + } else { + j = rtval[i] = j + (rtval[i+1] & 0x07); + } + return(j); +} + +/*)Function a_uint adb_24_hi(v, i) + * + * a_uint v value to add to byte + * int i rtval[] index + * + * The function adb_24_hi() adds the value of v to the + * 24 bit value contained in rtval[i] - rtval[i+2]. + * The new value of rtval[i] / rtval[i+1] is returned. + * The LSB & middle byte rtflg[] is cleared. + * + * local variable: + * a_uint j temporary evaluation variable + * + * global variables: + * hilo byte ordering parameter + * + * called functions: + * none + * + * side effects: + * The value of rtval[] is changed. + * The rtflg[] value corresponding to the + * LSB & middle byte of the word value is cleared to + * reflect the fact that the MSB is the selected byte. + * + */ + +a_uint +adb_24_hi(v, i) +a_uint v; +int i; +{ + a_uint j; + + j = adb_3b(v, i); + + /* Remove the lower two bytes. */ + if (hilo) + { + rtflg[i+2] = 0; + } + else + { + rtflg[i] = 0; + } + rtflg[i+1] = 0; + + return (j); +} + +/*)Function a_uint adb_24_mid(v, i) + * + * a_uint v value to add to byte + * int i rtval[] index + * + * The function adb_24_mid() adds the value of v to the + * 24 bit value contained in rtval[i] - rtval[i+2]. + * The new value of rtval[i] / rtval[i+1] is returned. + * The LSB & MSB byte rtflg[] is cleared. + * + * local variable: + * a_uint j temporary evaluation variable + * + * global variables: + * hilo byte ordering parameter + * + * called functions: + * none + * + * side effects: + * The value of rtval[] is changed. + * The rtflg[] value corresponding to the + * LSB & MSB of the 24 bit value is cleared to reflect + * the fact that the middle byte is the selected byte. + * + */ + +a_uint +adb_24_mid(v, i) +a_uint v; +int i; +{ + a_uint j; + + j = adb_3b(v, i); + + /* remove the MSB & LSB. */ + rtflg[i+2] = 0; + rtflg[i] = 0; + + return (j); +} + +/*)Function a_uint adb_24_lo(v, i) + * + * a_uint v value to add to byte + * int i rtval[] index + * + * The function adb_24_lo() adds the value of v to the + * 24 bit value contained in rtval[i] - rtval[i+2]. + * The new value of rtval[i] / rtval[i+1] is returned. + * The MSB & middle byte rtflg[] is cleared. + * + * local variable: + * a_uint j temporary evaluation variable + * + * global variables: + * hilo byte ordering parameter + * + * called functions: + * none + * + * side effects: + * The value of rtval[] is changed. + * The rtflg[] value corresponding to the + * MSB & middle byte of the word value is cleared to + * reflect the fact that the LSB is the selected byte. + * + */ + +a_uint +adb_24_lo(v, i) +a_uint v; +int i; +{ + a_uint j; + + j = adb_3b(v, i); + + /* Remove the upper two bytes. */ + if (hilo) + { + rtflg[i] = 0; + } + else + { + rtflg[i+2] = 0; + } + rtflg[i+1] = 0; + + return (j); +} + +/* end sdld specific */ diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lks19.c sdcc-3.2.0+dfsg/sdas/linksrc/lks19.c --- sdcc-3.1.0+dfsg/sdas/linksrc/lks19.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lks19.c 2011-12-06 23:01:37.000000000 +0000 @@ -21,162 +21,163 @@ #include "sdld.h" #include "aslink.h" -/*)Module lks19.c +/*)Module lks19.c * - * The module lks19.c contains the functions to - * output the relocated object code in the - * Motorola S19 format. + * The module lks19.c contains the functions to + * output the relocated object code in the + * Motorola S19 format. * - * lks19.c contains the following functions: - * VOID s19() - * VOID sflush() + * lks19.c contains the following functions: + * VOID s19() + * VOID sflush() * - * lks19.c contains no local variables. + * lks19.c contains no local variables. */ /*)S19 Format * Record Type Field - This field signifies the start of a * record and identifies the the record - * type as follows: + * type as follows: * - * Ascii S1 - Data Record - * Ascii S9 - End of File Record + * Ascii S1 - Data Record + * Ascii S9 - End of File Record * * Record Length Field - This field specifies the record length * which includes the address, data, and * checksum fields. The 8 bit record * length value is converted to two ascii - * characters, high digit first. + * characters, high digit first. * * Load Address Field - This field consists of the four ascii * characters which result from converting * the the binary value of the address in * which to begin loading this record. The - * order is as follows: + * order is as follows: * - * High digit of high byte of address. - * Low digit of high byte of address. - * High digit of low byte of address. - * Low digit of low byte of address. + * High digit of high byte of address. + * Low digit of high byte of address. + * High digit of low byte of address. + * Low digit of low byte of address. * * In an End of File record this field con- * sists of either four ascii zeros or the * program entry address. Currently the - * entry address option is not supported. + * entry address option is not supported. * * Data Field - This field consists of the actual data, * converted to two ascii characters, high * digit first. There are no data bytes in - * the End of File record. + * the End of File record. * * Checksum Field - The checksum field is the 8 bit binary * sum of the record length field, the load * address field, and the data field. This * sum is then complemented (1's comple- * ment) and converted to two ascii - * characters, high digit first. + * characters, high digit first. */ -/*)Function s19(i) +/*)Function s19(i) * - * int i 0 - process data - * 1 - end of data + * int i 0 - process data + * 1 - end of data * - * The function s19() loads the output buffer with - * the relocated data. + * The function s19() loads the output buffer with + * the relocated data. * - * local variables: - * a_uint j temporary + * local variables: + * a_uint j temporary * - * global variables: - * int hilo byte order - * FILE * ofp output file handle - * int rtcnt count of data words - * int rtflg[] output the data flag - * a_uint rtval[] relocated data - * char rtbuf[] output buffer - * a_uint rtadr0 address temporary - * a_uint rtadr1 address temporary - * a_uint rtadr2 address temporary + * global variables: + * int hilo byte order + * FILE * ofp output file handle + * int rtcnt count of data words + * int rtflg[] output the data flag + * a_uint rtval[] relocated data + * char rtbuf[] output buffer + * a_uint rtadr0 address temporary + * a_uint rtadr1 address temporary + * a_uint rtadr2 address temporary * - * functions called: - * int fprintf() c_library - * VOID sflush() lks19.c + * functions called: + * int fprintf() c_library + * VOID sflush() lks19.c * - * side effects: - * The data is placed into the output buffer. + * side effects: + * The data is placed into the output buffer. */ /* * The maximum number of Data Field bytes is NMAX less: - * 2 Record Type Field - * 2 Record Length Field - * 4 Load Address Field - * 2 Checksum Field + * 2 Record Type Field + * 2 Record Length Field + * 4 Load Address Field + * 2 Checksum Field * - * Divided by 2 (2 characters per byte) + * Divided by 2 (2 characters per byte) */ -#define MAXBYTES ((NMAX - 10)/2) +#define MAXBYTES ((NMAX - 10)/2) VOID s19(int i) { - register a_uint j; + a_uint j; + int k; - if (i) { - if (TARGET_IS_6808 && ap->a_flag & A_NOLOAD) - return; - - if (hilo == 0) { - j = rtval[0]; - rtval[0] = rtval[1]; - rtval[1] = j; - } - rtadr2 = rtval[0] << 8 | rtval[1]; - if (rtadr2 != rtadr1) { - /* - * data bytes not contiguous between records - */ - sflush(); - rtadr0 = rtadr1 = rtadr2; - } - for (j=2; ja_flag & A_NOLOAD) + return; + + if (hilo == 0) { + j = rtval[0]; + rtval[0] = rtval[1]; + rtval[1] = j; + } + rtadr2 = rtval[0] << 8 | rtval[1]; + if (rtadr2 != rtadr1) { + /* + * data bytes not contiguous between records + */ + sflush(); + rtadr0 = rtadr1 = rtadr2; + } + for (k=2; k> 8; - fprintf(ofp, "S1%02X%04X", reclen, rtadr0); - for (i=0; i> 8; + fprintf(ofp, "S1%02X%04X", reclen, rtadr0); + for (i=0; ilibspc = lbnh->libspc; lbfh->filspc = strdup (filspc); lbfh->relfil = strdup (ModName); + lbfh->f_obj = lbnh->f_obj; /* Library embedded file, so lbfh->offset must be >=0 */ lbfh->offset = IndexOffset + FileOffset; + obj_flag = lbfh->f_obj; /* Jump to where the .rel begins and load it. */ fseek (libfp, lbfh->offset, SEEK_SET); diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lksdcdb.c sdcc-3.2.0+dfsg/sdas/linksrc/lksdcdb.c --- sdcc-3.1.0+dfsg/sdas/linksrc/lksdcdb.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lksdcdb.c 2011-12-03 23:42:25.000000000 +0000 @@ -70,6 +70,7 @@ if (yfp == NULL) { lkexit(1); } + mflag = 1; } } @@ -78,7 +79,7 @@ * * char * str pointer to the file spec * - * The function SDCDBcopy() copies an existing cdb file + * The function SDCDBcopy() copies an existing adb file * into the linker cdb file. * * The function is called from lklex.c and lklibr.c diff -Nru sdcc-3.1.0+dfsg/sdas/linksrc/lksym.c sdcc-3.2.0+dfsg/sdas/linksrc/lksym.c --- sdcc-3.1.0+dfsg/sdas/linksrc/lksym.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sdas/linksrc/lksym.c 2011-12-06 23:01:37.000000000 +0000 @@ -22,8 +22,8 @@ * Kent, Ohio 44240 * * With enhancements from - * John L. Hartman (JLH) - * jhartman@compuserve.com + * John L. Hartman (JLH) + * jhartman@compuserve.com * */ @@ -39,17 +39,17 @@ * sym * lkpsym() * char * new() * sym * newsym() - * char * strsto() + * char * strsto() * VOID symdef() * int symeq() * VOID syminit() * VOID symmod() * a_uint symval() * - * lksym.c contains the static variables: - * char * pnext - * int bytes - * used by the string store function. + * lksym.c contains the static variables: + * char * pnext + * int bytes + * used by the string store function. */ /*)Function VOID syminit() @@ -142,7 +142,7 @@ struct sym * newsym(void) { - a_uint ev; + a_uint ev; int c, i, nsym; struct sym *tsp; struct sym **s; @@ -152,10 +152,10 @@ fprintf(stderr, "No header defined\n"); lkexit(ER_FATAL); } - /* - * Create symbol entry - */ - getSid(id); // old: getid(id, -1); + /* + * Create symbol entry + */ + getSid(id); tsp = lkpsym(id, 1); c = getnb();get();get(); if (c == 'R') { @@ -168,7 +168,7 @@ if (c == 'D') { ev = eval(); if (tsp->s_type & S_DEF && - !(tsp->s_addr == ev && ((tsp->s_axp->a_bap->a_flag & A3_ABS) == A3_ABS))) { + !(tsp->s_addr == ev && tsp->s_axp && tsp->s_axp->a_bap && ((tsp->s_axp->a_bap->a_flag & A3_ABS) == A3_ABS))) { fprintf(stderr, "Multiple definition of %s\n", id); lkerr++; @@ -395,8 +395,8 @@ * The function symeq() compares the two name strings for a match. * The return value is 1 for a match and 0 for no match. * - * cflag == 0 case sensitive compare - * cflag != 0 case insensitive compare + * cflag == 0 case sensitive compare + * cflag != 0 case insensitive compare * * local variables: * int n loop counter @@ -416,122 +416,122 @@ int symeq(char *p1, char *p2, int cflag) { - int n; + int n; + + n = strlen(p1) + 1; + if(cflag) { + /* + * Case Insensitive Compare + */ + do { + if (ccase[*p1++ & 0x007F] != ccase[*p2++ & 0x007F]) + return (0); + } while (--n); + } else { + /* + * Case Sensitive Compare + */ + do { + if (*p1++ != *p2++) + return (0); + } while (--n); + } + return (1); +} - n = strlen(p1) + 1; - if(cflag) { - /* - * Case Insensitive Compare - */ - do { - if (ccase[*p1++ & 0x007F] != ccase[*p2++ & 0x007F]) - return (0); - } while (--n); - } else { - /* - * Case Sensitive Compare - */ - do { - if (*p1++ != *p2++) - return (0); - } while (--n); - } - return (1); -} - -/*)Function int hash(p, cflag) - * - * char * p pointer to string to hash - * int cflag case sensitive flag - * - * The function hash() computes a hash code using the sum - * of all characters mod table size algorithm. - * - * cflag == 0 case sensitive hash - * cflag != 0 case insensitive hash - * - * local variables: - * int h accumulated character sum - * - * global variables: - * char ccase[] an array of characters which - * perform the case translation function +/*)Function int hash(p, cflag) * - * functions called: - * none + * char * p pointer to string to hash + * int cflag case sensitive flag * - * side effects: - * none + * The function hash() computes a hash code using the sum + * of all characters mod table size algorithm. + * + * cflag == 0 case sensitive hash + * cflag != 0 case insensitive hash + * + * local variables: + * int h accumulated character sum + * + * global variables: + * char ccase[] an array of characters which + * perform the case translation function + * + * functions called: + * none + * + * side effects: + * none */ int hash(char *p, int cflag) { - int h; + int h; - h = 0; - while (*p) { - if(cflag) { - /* - * Case Insensitive Hash - */ - h += ccase[*p++ & 0x007F]; - } else { - /* - * Case Sensitive Hash - */ - h += *p++; - } - } - return (h&HMASK); -} - -#if decus - -/*)Function char * strsto(str) - * - * char * str pointer to string to save - * - * Allocate space for "str", copy str into new space. - * Return a pointer to the allocated string. - * - * This function based on code by - * John L. Hartman - * jhartman@compuserve.com - * - * local variables: - * int l string length + 1 - * char * p string location - * - * global variables: - * none - * - * functions called: - * char * new() assym.c - * char * strncpy() c_library - * - * side effects: - * Space allocated for string, string copied - * to space. Out of Space terminates linker. + h = 0; + while (*p) { + if(cflag) { + /* + * Case Insensitive Hash + */ + h += ccase[*p++ & 0x007F]; + } else { + /* + * Case Sensitive Hash + */ + h += *p++; + } + } + return (h&HMASK); +} + +#if decus + +/*)Function char * strsto(str) + * + * char * str pointer to string to save + * + * Allocate space for "str", copy str into new space. + * Return a pointer to the allocated string. + * + * This function based on code by + * John L. Hartman + * jhartman@compuserve.com + * + * local variables: + * int l string length + 1 + * char * p string location + * + * global variables: + * none + * + * functions called: + * char * new() assym.c + * char * strncpy() c_library + * + * side effects: + * Space allocated for string, string copied + * to space. Out of Space terminates linker. */ char * strsto(char *str) { - int l; - char *p; + int l; + char *p; - /* - * What we need, including a null. - */ - l = strlen(str) + 1; - p = (char *) new (l); - - /* - * Copy the name and terminating null. - */ - strncpy(p, str, l); - return(p); + /* + * What we need, including a null. + */ + l = strlen(str) + 1; + p = (char *) new (l); + + /* + * Copy the name and terminating null. + */ + strncpy(p, str, l); + return(p); } /* @@ -548,38 +548,38 @@ * requirement. */ -/*)Function char * new(n) +/*)Function char * new(n) * - * unsigned int n allocation size in bytes + * unsigned int n allocation size in bytes + * + * The function new() allocates n bytes of space and returns + * a pointer to this memory. If no space is available the + * linker is terminated. + * + * Allocate space for "str", copy str into new space. + * Return a pointer to the allocated string. + * + * This function based on code by + * John L. Hartman + * jhartman@compuserve.com + * + * local variables: + * int bytes bytes remaining in buffer area + * int i loop counter + * char * p pointer to head of copied string + * char * pnext next location in buffer area + * char * q a general pointer * - * The function new() allocates n bytes of space and returns - * a pointer to this memory. If no space is available the - * linker is terminated. - * - * Allocate space for "str", copy str into new space. - * Return a pointer to the allocated string. - * - * This function based on code by - * John L. Hartman - * jhartman@compuserve.com - * - * local variables: - * int bytes bytes remaining in buffer area - * int i loop counter - * char * p pointer to head of copied string - * char * pnext next location in buffer area - * char * q a general pointer - * - * global variables: - * none - * - * functions called: - * int fprintf() c_library - * VOID * malloc() c_library - * - * side effects: - * Memory is allocated, if allocation fails - * the linker is terminated. + * global variables: + * none + * + * functions called: + * int fprintf() c_library + * VOID * malloc() c_library + * + * side effects: + * Memory is allocated, if allocation fails + * the linker is terminated. */ /* @@ -588,86 +588,86 @@ * These static variables remember our hunk. */ -#define STR_SPC 1024 -#define STR_MIN 16 -static char * pnext = NULL; -static int bytes = 0; +#define STR_SPC 1024 +#define STR_MIN 16 +static char * pnext = NULL; +static int bytes = 0; char * new(unsigned int n) { - char *p,*q; - unsigned int i; + char *p,*q; + unsigned int i; - /* - * Always an even byte count - */ - n = (n+1) & 0xFFFE; - - if (n > STR_MIN) { - /* - * For allocations larger than - * most structures and short strings - * allocate the space directly. - */ - p = (char *) malloc(n); - } else { - /* - * For smaller structures and - * strings allocate from the hunk. - */ - if (n > bytes) { - /* - * No space. Allocate a new hunk. - * We lose the pointer to any old hunk. - * We don't care, as the pieces are never deleted. - */ - pnext = (char *) malloc (STR_SPC); - bytes = STR_SPC; - } - p = pnext; - pnext += n; - bytes -= n; - } - if (p == NULL) { - fprintf(stderr, "Out of space!\n"); - lkexit(ER_FATAL); - } - for (i=0,q=p; i STR_MIN) { + /* + * For allocations larger than + * most structures and short strings + * allocate the space directly. + */ + p = (char *) malloc(n); + } else { + /* + * For smaller structures and + * strings allocate from the hunk. + */ + if (n > bytes) { + /* + * No space. Allocate a new hunk. + * We lose the pointer to any old hunk. + * We don't care, as the pieces are never deleted. + */ + pnext = (char *) malloc (STR_SPC); + bytes = STR_SPC; + } + p = pnext; + pnext += n; + bytes -= n; + } + if (p == NULL) { + fprintf(stderr, "Out of space!\n"); + lkexit(ER_FATAL); + } + for (i=0,q=p; i bytes) { - /* - * No space. Allocate a new hunk. - * We lose the pointer to any old hunk. - * We don't care, as the strings are never deleted. - */ - pnext = (char *) new (STR_SPC); - bytes = STR_SPC; - } - - /* - * Copy the name and terminating null. - */ - p = pnext; - strncpy(p, str, l); - - pnext += l; - bytes -= l; - - return(p); -} - -/*)Function char * new(n) - * - * unsigned int n allocation size in bytes - * - * The function new() allocates n bytes of space and returns - * a pointer to this memory. If no space is available the - * linker is terminated. - * - * local variables: - * char * p a general pointer - * char * q a general pointer - * - * global variables: - * none - * - * functions called: - * int fprintf() c_library - * VOID * malloc() c_library - * - * side effects: - * Memory is allocated, if allocation fails - * the linker is terminated. + if (l > bytes) { + /* + * No space. Allocate a new hunk. + * We lose the pointer to any old hunk. + * We don't care, as the strings are never deleted. + */ + pnext = (char *) new (STR_SPC); + bytes = STR_SPC; + } + + /* + * Copy the name and terminating null. + */ + p = pnext; + strncpy(p, str, l); + + pnext += l; + bytes -= l; + + return(p); +} + +/*)Function char * new(n) + * + * unsigned int n allocation size in bytes + * + * The function new() allocates n bytes of space and returns + * a pointer to this memory. If no space is available the + * linker is terminated. + * + * local variables: + * char * p a general pointer + * char * q a general pointer + * + * global variables: + * none + * + * functions called: + * int fprintf() c_library + * VOID * malloc() c_library + * + * side effects: + * Memory is allocated, if allocation fails + * the linker is terminated. */ char * new(unsigned int n) { - char *p,*q; - unsigned int i; + char *p,*q; + unsigned int i; - if ((p = (char *) malloc(n)) == NULL) { - fprintf(stderr, "Out of space!\n"); - lkexit(ER_FATAL); - } - for (i=0,q=p; i='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) @@ -517,12 +542,20 @@ LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -533,9 +566,9 @@ # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -543,16 +576,38 @@ esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\[$]0 --fallback-echo"')dnl " - lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` - ;; -esac - _LT_OUTPUT_LIBTOOL_INIT ]) +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- @@ -562,20 +617,11 @@ AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) -cat >"$CONFIG_LT" <<_LTEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate a libtool stub with the current configuration. - -lt_cl_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_LTEOF +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF -AS_SHELL_SANITIZE -_AS_PREPARE - -exec AS_MESSAGE_FD>&1 +lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo @@ -601,7 +647,7 @@ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -646,15 +692,13 @@ # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. -if test "$no_create" != yes; then - lt_cl_success=: - test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" - exec AS_MESSAGE_LOG_FD>/dev/null - $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false - exec AS_MESSAGE_LOG_FD>>config.log - $lt_cl_success || AS_EXIT(1) -fi +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT @@ -717,15 +761,12 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - _LT_PROG_XSI_SHELLFNS + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) + _LT_PROG_REPLACE_SHELLFNS - mv -f "$cfgfile" "$ofile" || + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], @@ -770,6 +811,7 @@ m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], @@ -791,6 +833,29 @@ ])# _LT_LANG +m4_ifndef([AC_PROG_GO], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], @@ -821,6 +886,10 @@ m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) @@ -831,11 +900,13 @@ AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER @@ -921,7 +992,13 @@ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -929,6 +1006,7 @@ rm -rf libconftest.dylib* rm -f conftest.* fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no @@ -940,6 +1018,34 @@ [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -967,7 +1073,7 @@ else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -977,8 +1083,8 @@ ]) -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ @@ -987,7 +1093,13 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(whole_archive_flag_spec, $1)='' + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in @@ -995,7 +1107,7 @@ *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -1011,203 +1123,142 @@ fi ]) -# _LT_SYS_MODULE_PATH_AIX -# ----------------------- +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl -AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_SHELL_INIT +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + # _LT_PROG_ECHO_BACKSLASH # ----------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], -[_LT_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -[$]* -_LT_EOF - exit 0 + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' fi -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) -AC_SUBST(lt_ECHO) -]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], - [An echo program that does not interpret backslashes]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], @@ -1236,7 +1287,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in @@ -1329,14 +1380,27 @@ CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -1354,14 +1418,47 @@ ])# _LT_ENABLE_LOCK +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], -[AC_CHECK_TOOL(AR, ar, false) -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1]) +[_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: @@ -1380,18 +1477,27 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE @@ -1416,15 +1522,15 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1464,7 +1570,7 @@ if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1527,6 +1633,11 @@ lt_cv_sys_max_cmd_len=8192; ;; + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -1552,6 +1663,11 @@ lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -1591,8 +1707,8 @@ # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -1643,7 +1759,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -[#line __oline__ "configure" +[#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -1684,7 +1800,13 @@ # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -1693,7 +1815,11 @@ if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -1869,16 +1995,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes @@ -2037,6 +2163,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ @@ -2045,16 +2172,23 @@ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -2067,7 +2201,7 @@ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -2087,7 +2221,13 @@ if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) @@ -2113,7 +2253,7 @@ case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -2122,7 +2262,7 @@ ;; aix[[4-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -2175,7 +2315,7 @@ m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -2187,7 +2327,7 @@ ;; bsdi[[45]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -2206,8 +2346,9 @@ need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -2228,36 +2369,83 @@ cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -2278,7 +2466,7 @@ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -2286,10 +2474,6 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -2297,7 +2481,7 @@ objformat=`/usr/bin/objformat` else case $host_os in - freebsd[[123]]*) objformat=aout ;; + freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -2315,7 +2499,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) @@ -2335,12 +2519,26 @@ ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -2386,12 +2584,14 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[[3-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -2407,7 +2607,7 @@ nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -2444,9 +2644,9 @@ dynamic_linker=no ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) - version_type=linux +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2454,16 +2654,21 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -2472,7 +2677,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -2516,7 +2721,7 @@ ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -2585,7 +2790,7 @@ ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2610,7 +2815,7 @@ ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -2634,7 +2839,7 @@ sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -2665,7 +2870,7 @@ tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2675,7 +2880,7 @@ ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -2717,6 +2922,8 @@ The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], @@ -2829,6 +3036,7 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], @@ -2950,6 +3158,11 @@ esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -2958,8 +3171,8 @@ fi ;; esac -_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl -_LT_DECL([], [reload_cmds], [2])dnl +_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl +_LT_TAGDECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD @@ -3011,16 +3224,18 @@ # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc) +cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -3050,6 +3265,10 @@ lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -3058,11 +3277,11 @@ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -3083,8 +3302,8 @@ lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -3162,14 +3381,33 @@ ;; esac ]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown -_LT_DECL([], [deplibs_check_method], [1], - [Method to check whether dependent libraries are shared objects]) -_LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method == "file_magic"]) +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD @@ -3226,7 +3464,19 @@ NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -3239,13 +3489,13 @@ AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -3260,6 +3510,67 @@ dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + # LT_LIB_M # -------- @@ -3268,7 +3579,7 @@ [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) @@ -3296,7 +3607,12 @@ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, @@ -3313,6 +3629,7 @@ m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl @@ -3380,8 +3697,8 @@ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3405,6 +3722,7 @@ # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -3417,6 +3735,7 @@ else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -3438,7 +3757,7 @@ if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -3450,6 +3769,18 @@ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + #ifdef __cplusplus extern "C" { #endif @@ -3461,7 +3792,7 @@ cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -const struct { +LT@&t@_DLSYM_CONST struct { const char *name; void *address; } @@ -3487,15 +3818,15 @@ _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi @@ -3528,6 +3859,13 @@ AC_MSG_RESULT(ok) fi +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], @@ -3538,6 +3876,8 @@ _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3549,7 +3889,6 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= -AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -3600,6 +3939,11 @@ # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -3649,6 +3993,12 @@ ;; esac ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; dgux*) case $cc_basename in ec++*) @@ -3705,7 +4055,7 @@ ;; esac ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler @@ -3738,8 +4088,8 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xlc* | xlC*) - # IBM XL 8.0 on PPC + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' @@ -3801,7 +4151,7 @@ ;; solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' @@ -3905,6 +4255,12 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -3947,6 +4303,15 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -3989,7 +4354,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -4010,7 +4375,13 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; - pgcc* | pgf77* | pgf90* | pgf95*) + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' @@ -4022,25 +4393,40 @@ # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; @@ -4072,7 +4458,7 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in - f77* | f90* | f95*) + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; @@ -4129,9 +4515,11 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac -AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. @@ -4150,6 +4538,8 @@ _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # @@ -4170,6 +4560,7 @@ m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl @@ -4178,30 +4569,40 @@ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - ;; - linux* | k*bsd*-gnu) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no - ;; + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= @@ -4216,7 +4617,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -4261,13 +4661,39 @@ openbsd*) with_gnu_ld=no ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -4285,6 +4711,7 @@ fi supports_anon_versioning=no case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... @@ -4300,11 +4727,12 @@ _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. _LT_EOF fi @@ -4340,10 +4768,12 @@ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -4361,6 +4791,11 @@ fi ;; + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4376,7 +4811,7 @@ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -4386,15 +4821,16 @@ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag= + tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4405,13 +4841,17 @@ lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; - xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -4427,17 +4867,16 @@ fi case $cc_basename in - xlf*) + xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4451,8 +4890,8 @@ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -4470,8 +4909,8 @@ _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4517,8 +4956,8 @@ *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4558,8 +4997,10 @@ else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -4647,9 +5088,9 @@ _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -4658,14 +5099,19 @@ else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -4697,20 +5143,64 @@ # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac ;; darwin* | rhapsody*) @@ -4723,10 +5213,6 @@ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; - freebsd1*) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -4739,7 +5225,7 @@ ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -4748,7 +5234,7 @@ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4756,7 +5242,7 @@ hpux9*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -4771,14 +5257,13 @@ ;; hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes @@ -4790,16 +5275,16 @@ ;; hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -4811,7 +5296,14 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi @@ -4839,19 +5331,34 @@ irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - AC_LINK_IFELSE(int foo(void) {}, - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - ) - LDFLAGS="$save_LDFLAGS" + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -4913,17 +5420,17 @@ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -4933,13 +5440,13 @@ osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -4952,9 +5459,9 @@ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -5130,36 +5637,38 @@ # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi @@ -5196,9 +5705,6 @@ _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [[If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], @@ -5224,8 +5730,6 @@ to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [fix_srcfile_path], [1], - [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], @@ -5236,6 +5740,8 @@ [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented @@ -5276,10 +5782,6 @@ _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) @@ -5329,37 +5831,22 @@ ])# _LT_LANG_C_CONFIG -# _LT_PROG_CXX -# ------------ -# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ -# compiler, we have our own version here. -m4_defun([_LT_PROG_CXX], -[ -pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) -AC_PROG_CXX -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_CXX - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_CXX], []) - - # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], -[AC_REQUIRE([_LT_PROG_CXX])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no @@ -5371,7 +5858,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -5381,6 +5867,8 @@ _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -5412,6 +5900,7 @@ # Allow CC to be a program name with arguments. lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -5429,6 +5918,7 @@ fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -5450,8 +5940,8 @@ # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5483,7 +5973,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no @@ -5592,10 +6082,10 @@ _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -5604,14 +6094,19 @@ else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -5641,28 +6136,75 @@ ;; cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; @@ -5685,7 +6227,7 @@ esac ;; - freebsd[[12]]*) + freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no @@ -5704,6 +6246,11 @@ gnu*) ;; + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: @@ -5728,11 +6275,11 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -5793,7 +6340,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then @@ -5803,10 +6350,10 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -5836,7 +6383,7 @@ case $cc_basename in CC*) # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -5847,9 +6394,9 @@ *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -5860,7 +6407,7 @@ _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -5878,7 +6425,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5915,26 +6462,26 @@ pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 will use weak symbols + *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -5942,7 +6489,7 @@ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -5961,9 +6508,9 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; - xl*) + xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5983,13 +6530,13 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6058,7 +6605,7 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6093,15 +6640,15 @@ case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; @@ -6117,17 +6664,17 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -6137,7 +6684,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -6173,7 +6720,7 @@ solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -6194,7 +6741,7 @@ esac _LT_TAGVAR(link_all_deplibs, $1)=yes - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6214,14 +6761,14 @@ if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -6232,7 +6779,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' @@ -6286,6 +6833,10 @@ CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -6341,6 +6892,7 @@ fi # test -n "$compiler" CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -6355,6 +6907,29 @@ ])# _LT_LANG_CXX_CONFIG +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -6363,6 +6938,7 @@ # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= @@ -6412,7 +6988,20 @@ } }; _LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF ]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then @@ -6424,7 +7013,7 @@ pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case $p in + case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -6433,13 +7022,22 @@ test $p = "-R"; then prev=$p continue - else - prev= fi + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) + case ${prev} in + -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -6459,8 +7057,10 @@ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi + prev= ;; + *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -6496,6 +7096,7 @@ fi $RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], @@ -6532,7 +7133,7 @@ solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -6576,32 +7177,16 @@ ])# _LT_SYS_HIDDEN_LIBDEPS -# _LT_PROG_F77 -# ------------ -# Since AC_PROG_F77 is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_F77], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) -AC_PROG_F77 -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_F77 - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_F77], []) - - # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], -[AC_REQUIRE([_LT_PROG_F77])dnl -AC_LANG_PUSH(Fortran 77) +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -6611,7 +7196,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -6620,6 +7204,8 @@ _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -6659,7 +7245,9 @@ # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} + CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -6713,38 +7301,24 @@ GCC=$lt_save_GCC CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG -# _LT_PROG_FC -# ----------- -# Since AC_PROG_FC is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_FC], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) -AC_PROG_FC -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_FC - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_FC], []) - - # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], -[AC_REQUIRE([_LT_PROG_FC])dnl -AC_LANG_PUSH(Fortran) +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -6754,7 +7328,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -6763,6 +7336,8 @@ _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -6802,7 +7377,9 @@ # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} + CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu @@ -6858,7 +7435,8 @@ fi # test -n "$compiler" GCC=$lt_save_GCC - CC="$lt_save_CC" + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP @@ -6895,10 +7473,12 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC="$CC" +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" @@ -6908,11 +7488,9 @@ _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) @@ -6927,10 +7505,78 @@ AC_LANG_RESTORE GCC=$lt_save_GCC -CC="$lt_save_CC" +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler @@ -6962,9 +7608,11 @@ # Allow CC to be a program name with arguments. lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} +CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -6977,7 +7625,8 @@ GCC=$lt_save_GCC AC_LANG_RESTORE -CC="$lt_save_CC" +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG @@ -6997,6 +7646,13 @@ dnl AC_DEFUN([LT_AC_PROG_GCJ], []) +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], @@ -7036,6 +7692,15 @@ AC_SUBST([OBJDUMP]) ]) +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) # _LT_DECL_SED # ------------ @@ -7051,12 +7716,10 @@ ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ -############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # -############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) @@ -7129,8 +7792,8 @@ # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -7169,223 +7832,177 @@ ])# _LT_CHECK_SHELL_FEATURES -# _LT_PROG_XSI_SHELLFNS -# --------------------- -# Bourne and XSI compatible variants of some useful shell functions. -m4_defun([_LT_PROG_XSI_SHELLFNS], -[case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $[*] )) -} +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) -dnl func_dirname_and_basename -dnl A portable version of this function is already defined in general.m4sh -dnl so there is no need for it here. + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) -# sed scripts: -my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[[^=]]*=//' + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` -} +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$[@]"` -} + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` -} + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi -_LT_EOF -esac +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]+=\$[2]" -} -_LT_EOF +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]=\$$[1]\$[2]" -} - -_LT_EOF + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac ;; - esac + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac ]) - +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. # Written by Gary V. Vaughan, 2004 # # 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 6 ltoptions.m4 +# serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -7463,9 +8080,6 @@ ])# _LT_SET_OPTIONS -## --------------------------------- ## -## Macros to handle LT_INIT options. ## -## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- @@ -7503,7 +8117,7 @@ [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) @@ -7511,13 +8125,13 @@ esac test -z "$AS" && AS=as -_LT_DECL([], [AS], [0], [Assembler program])dnl +_LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], @@ -7703,9 +8317,24 @@ # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) @@ -7727,9 +8356,6 @@ dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) -## ----------------- ## -## LTDL_INIT Options ## -## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], @@ -7745,32 +8371,6 @@ LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) - -# ltversion.m4 -- version numbers -*- Autoconf -*- -# -# Copyright (C) 2004 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004 -# -# 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. - -# Generated from ltversion.in. - -# serial 3012 ltversion.m4 -# This file is part of GNU Libtool - -m4_define([LT_PACKAGE_VERSION], [2.2.6]) -m4_define([LT_PACKAGE_REVISION], [1.3012]) - -AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.6' -macro_revision='1.3012' -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) -_LT_DECL(, macro_revision, 0) -]) - - # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. @@ -7895,17 +8495,40 @@ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# 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. + +# @configure_input@ + +# serial 3337 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.2' +macro_revision='1.3337' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # 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 lt~obsolete.m4 +# serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # @@ -7975,7 +8598,6 @@ m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) @@ -7988,3 +8610,11 @@ m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) + diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/app.cc sdcc-3.2.0+dfsg/sim/ucsim/app.cc --- sdcc-3.1.0+dfsg/sim/ucsim/app.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/app.cc 2012-05-02 15:49:38.000000000 +0000 @@ -153,7 +153,8 @@ cl_app::run(void) { int done= 0; - + unsigned input_check_skip = 0; + while (!done && going) { @@ -161,10 +162,19 @@ { if (sim->state & SIM_GO) { - if (commander->input_avail()) - done= commander->proc_input(); + if ((!input_check_skip) && (commander->input_avail())) + { + done= commander->proc_input(); + + // run a few steps before checking for more input + ++input_check_skip; + } else - sim->step(); + { + sim->step(); + + input_check_skip = (input_check_skip + 1) % 50; + } } else { diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/cmd.src/cmdgui.cc sdcc-3.2.0+dfsg/sim/ucsim/cmd.src/cmdgui.cc --- sdcc-3.1.0+dfsg/sim/ucsim/cmd.src/cmdgui.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/cmd.src/cmdgui.cc 2012-03-14 20:37:02.000000000 +0000 @@ -47,23 +47,7 @@ // class cl_cmdline *cmdline, class cl_console_base *con) COMMAND_DO_WORK_UC(cl_gui_start_cmd) { - class cl_hw *hw; - class cl_memory *mem; - t_addr start, end; - class cl_cmd_arg *params[4]= { cmdline->param(0), - cmdline->param(1), - cmdline->param(2), - cmdline->param(3) }; - - if (cmdline->syntax_match(uc, HW)) { - hw= params[0]->value.hw; - } - else if (cmdline->syntax_match(uc, MEMORY ADDRESS ADDRESS)) { - mem= params[0]->value.memory.memory; - start= params[1]->value.address; - end= params[2]->value.address; - } - else + if (!cmdline->syntax_match(uc, HW) && !cmdline->syntax_match(uc, MEMORY ADDRESS ADDRESS)) { con->dd_printf("Error: wrong syntax\n" "%s\n", short_help?short_help:"no help"); diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/cmd.src/cmdlex.l sdcc-3.2.0+dfsg/sim/ucsim/cmd.src/cmdlex.l --- sdcc-3.1.0+dfsg/sim/ucsim/cmd.src/cmdlex.l 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/cmd.src/cmdlex.l 2011-12-29 13:55:21.000000000 +0000 @@ -8,6 +8,8 @@ #define YY_INPUT(buf,result,max_size) result = uc_yy_input(buf, max_size) %} +%option nounput + %% [ \t]* ; diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/cmd.src/cmdset.cc sdcc-3.2.0+dfsg/sim/ucsim/cmd.src/cmdset.cc --- sdcc-3.1.0+dfsg/sim/ucsim/cmd.src/cmdset.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/cmd.src/cmdset.cc 2012-03-14 20:37:02.000000000 +0000 @@ -207,13 +207,11 @@ // class cl_cmdline *cmdline, class cl_console_base *con) COMMAND_DO_WORK_APP(cl_help_cmd) { - class cl_sim *sim; class cl_commander_base *commander; class cl_cmdset *cmdset= 0; int i; class cl_cmd_arg *parm= cmdline->param(0); - sim= app->get_sim(); if ((commander= app->get_commander()) != 0) cmdset= commander->cmdset; if (!cmdset) diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/cmd.src/cmdstat.cc sdcc-3.2.0+dfsg/sim/ucsim/cmd.src/cmdstat.cc --- sdcc-3.1.0+dfsg/sim/ucsim/cmd.src/cmdstat.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/cmd.src/cmdstat.cc 2012-03-14 20:37:02.000000000 +0000 @@ -48,7 +48,6 @@ // class cl_cmdline *cmdline, class cl_console_base *con) COMMAND_DO_WORK_UC(cl_statistic_cmd) { - class cl_hw *hw; class cl_address_space *mem; t_addr start= 0, end= 0; bool addresses= DD_FALSE; @@ -57,10 +56,7 @@ cmdline->param(2), cmdline->param(3) }; - if (cmdline->syntax_match(uc, HW)) { - hw= params[0]->value.hw; - } - else { + if (!cmdline->syntax_match(uc, HW)) { mem= 0; if (cmdline->syntax_match(uc, MEMORY ADDRESS ADDRESS)) { mem= params[0]->value.memory.address_space; diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/configure sdcc-3.2.0+dfsg/sim/ucsim/configure --- sdcc-3.1.0+dfsg/sim/ucsim/configure 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/configure 2012-05-18 10:47:44.000000000 +0000 @@ -1,11 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68. +# Generated by GNU Autoconf 2.69. # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -134,6 +132,31 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -167,11 +190,20 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes @@ -212,21 +244,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -328,6 +364,14 @@ } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -449,6 +493,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # 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). @@ -483,16 +531,16 @@ # ... 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'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -504,28 +552,8 @@ 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 +as_test_x='test -x' +as_executable_p=as_fn_executable_p # 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'" @@ -533,155 +561,8 @@ # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -$* -_LT_EOF - exit 0 -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -fi - - - test -n "$DJDIR" || exec 7<&0 &1 @@ -773,8 +654,10 @@ LIPO NMEDIT DSYMUTIL -lt_ECHO +MANIFEST_TOOL +ac_ct_AR AR +DLLTOOL OBJDUMP LN_S NM @@ -878,6 +761,7 @@ with_pic enable_fast_install with_gnu_ld +with_sysroot enable_libtool_lock ' ac_precious_vars='build_alias @@ -1351,8 +1235,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_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 @@ -1527,9 +1409,11 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic try to use only PIC/non-PIC objects [default=use + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). Some influential environment variables: docdir documentation installation directory @@ -1618,9 +1502,9 @@ if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.68 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1771,7 +1655,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -1994,7 +1878,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -2226,7 +2110,8 @@ main () { static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2242,7 +2127,8 @@ main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2268,7 +2154,8 @@ main () { static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2284,7 +2171,8 @@ main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2318,7 +2206,8 @@ main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2391,7 +2280,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2739,7 +2628,7 @@ -ac_config_headers="$ac_config_headers ddconfig.h:ddconfig_in.h custom.h:custom_in.h" +ac_config_headers="$ac_config_headers ddconfig.h:ddconfig_in.h" for ac_prog in gawk mawk nawk awk @@ -2760,7 +2649,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2961,7 +2850,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3005,7 +2894,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3639,7 +3528,7 @@ # 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 as_fn_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. @@ -3712,7 +3601,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3752,7 +3641,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3804,7 +3693,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3839,8 +3728,8 @@ -macro_version='2.2.6' -macro_revision='1.3012' +macro_version='2.4.2' +macro_revision='1.3337' @@ -3927,6 +3816,75 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3949,7 +3907,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3989,7 +3947,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4042,7 +4000,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4083,7 +4041,7 @@ 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 as_fn_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 @@ -4141,7 +4099,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4185,7 +4143,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4381,8 +4339,7 @@ /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* 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); @@ -4489,7 +4446,7 @@ for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue + as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in @@ -4565,7 +4522,7 @@ 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 + as_fn_executable_p "$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 @@ -4631,7 +4588,7 @@ 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 + as_fn_executable_p "$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 @@ -4698,7 +4655,7 @@ for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue + as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in @@ -4932,8 +4889,11 @@ NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$ac_tool_prefix"; then - for ac_prog in "dumpbin -symbols" "link -dump -symbols" + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" 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 @@ -4951,7 +4911,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4977,7 +4937,7 @@ fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in "dumpbin -symbols" "link -dump -symbols" + for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4995,7 +4955,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5032,6 +4992,15 @@ fi fi + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -5051,13 +5020,13 @@ else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:5054: $ac_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:5057: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:5060: output\"" >&5) + (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5114,6 +5083,11 @@ lt_cv_sys_max_cmd_len=8192; ;; + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -5139,6 +5113,11 @@ lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -5178,8 +5157,8 @@ # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -5221,8 +5200,8 @@ # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -5271,6 +5250,80 @@ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : @@ -5287,6 +5340,11 @@ esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -5321,7 +5379,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5361,7 +5419,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5450,16 +5508,18 @@ # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc) +cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -5489,6 +5549,10 @@ lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -5497,11 +5561,11 @@ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -5522,8 +5586,8 @@ lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -5604,6 +5668,21 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -5619,16 +5698,26 @@ + + + + + + + + + + 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 + # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : +if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. + 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 @@ -5636,8 +5725,8 @@ 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="${ac_tool_prefix}ar" + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5647,10 +5736,10 @@ fi fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -5658,17 +5747,17 @@ 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 +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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. + 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 @@ -5676,8 +5765,8 @@ 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_AR="ar" + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5687,17 +5776,17 @@ fi fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_AR" = x; then - AR="false" + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) @@ -5705,17 +5794,54 @@ $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - AR=$ac_ct_AR + DLLTOOL=$ac_ct_DLLTOOL fi else - AR="$ac_cv_prog_AR" + DLLTOOL="$ac_cv_prog_DLLTOOL" fi -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -5725,15 +5851,17 @@ 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 + for ac_prog in ar + 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. + 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 @@ -5741,8 +5869,8 @@ 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_STRIP="${ac_tool_prefix}strip" + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5752,28 +5880,32 @@ fi fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + test -n "$AR" && break + done 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 +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : +if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. + 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 @@ -5781,7 +5913,172 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5840,7 +6137,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5880,7 +6177,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5930,15 +6227,27 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + @@ -6046,8 +6355,8 @@ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -6071,6 +6380,7 @@ # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -6083,6 +6393,7 @@ else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -6108,8 +6419,8 @@ test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then @@ -6124,6 +6435,18 @@ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + #ifdef __cplusplus extern "C" { #endif @@ -6135,7 +6458,7 @@ cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -const struct { +LT_DLSYM_CONST struct { const char *name; void *address; } @@ -6161,8 +6484,8 @@ _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 @@ -6172,8 +6495,8 @@ test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi @@ -6210,6 +6533,20 @@ $as_echo "ok" >&6; } fi +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + @@ -6229,6 +6566,40 @@ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + @@ -6263,7 +6634,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 6266 "configure"' > conftest.$ac_ext + echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -6398,7 +6769,7 @@ CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -6409,7 +6780,20 @@ case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -6425,6 +6809,123 @@ need_locks="$enable_libtool_lock" +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + case $host_os in rhapsody* | darwin*) @@ -6445,7 +6946,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6485,7 +6986,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6537,7 +7038,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6577,7 +7078,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6629,7 +7130,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6669,7 +7170,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6721,7 +7222,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6761,7 +7262,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6813,7 +7314,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6853,7 +7354,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6932,7 +7433,13 @@ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 @@ -6943,6 +7450,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : @@ -6975,11 +7483,46 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment @@ -7002,7 +7545,7 @@ else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -7192,502 +7735,115 @@ fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#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 -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF - -fi - -done - - - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC - 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # 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_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -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_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -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 "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include + _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + else - # Passes both tests. -ac_preproc_ok=: -break + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest* -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break fi - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP +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 - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else -# include +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif - Syntax error + +#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 -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_c_try_run "$LINENO"; then : else - # Broken: fails on valid input. -continue + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break + fi -rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -_lt_caught_CXX_error=yes; } -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 +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF -else - _lt_caught_CXX_error=yes fi +done + + + + +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf + @@ -7765,7 +7921,22 @@ # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : - withval=$with_pic; pic_mode="$withval" + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else pic_mode=default fi @@ -7842,6 +8013,11 @@ + + + + + test -z "$LN_S" && LN_S="ln -s" @@ -7891,19 +8067,6 @@ - - - - - - - - - - - - - case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some @@ -7916,23 +8079,6 @@ ;; esac -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - # Global variables: ofile=libtool can_build_shared=yes @@ -7961,7 +8107,7 @@ *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it @@ -8161,16 +8307,17 @@ $RM -r conftest* -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } @@ -8190,15 +8337,15 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8193: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8197: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes @@ -8227,8 +8374,6 @@ lt_prog_compiler_pic= lt_prog_compiler_static= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -8276,6 +8421,12 @@ lt_prog_compiler_pic='-fno-common' ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -8318,6 +8469,15 @@ lt_prog_compiler_pic='-fPIC' ;; esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -8359,7 +8519,7 @@ lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -8380,7 +8540,13 @@ lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; - pgcc* | pgf77* | pgf90* | pgf95*) + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' @@ -8392,25 +8558,40 @@ # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' ;; esac ;; @@ -8442,7 +8623,7 @@ lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in - f77* | f90* | f95*) + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; @@ -8499,13 +8680,17 @@ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 -$as_echo "$lt_prog_compiler_pic" >&6; } - - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. @@ -8529,15 +8714,15 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8532: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8536: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes @@ -8566,6 +8751,11 @@ + + + + + # # Check to make sure the static flag actually works. # @@ -8585,7 +8775,7 @@ if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes @@ -8634,16 +8824,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8637: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8641: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -8689,16 +8879,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8692: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8696: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -8764,7 +8954,6 @@ hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported @@ -8808,13 +8997,39 @@ openbsd*) with_gnu_ld=no ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -8832,6 +9047,7 @@ fi supports_anon_versioning=no case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... @@ -8847,11 +9063,12 @@ ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. _LT_EOF fi @@ -8887,10 +9104,12 @@ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -8908,6 +9127,11 @@ fi ;; + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no @@ -8923,7 +9147,7 @@ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -8933,15 +9157,16 @@ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag= + tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -8952,13 +9177,17 @@ lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; - xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -8974,17 +9203,16 @@ fi case $cc_basename in - xlf*) + xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld='-rpath $libdir' - archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -8998,8 +9226,8 @@ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -9017,8 +9245,8 @@ _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9064,8 +9292,8 @@ *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9105,8 +9333,10 @@ else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -9194,7 +9424,13 @@ allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -9207,25 +9443,32 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' @@ -9234,7 +9477,13 @@ else # Determine the default libpath from the value encoded in an # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -9247,30 +9496,42 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -9302,20 +9563,64 @@ # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac ;; darwin* | rhapsody*) @@ -9325,7 +9630,12 @@ hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in @@ -9333,7 +9643,7 @@ *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -9351,10 +9661,6 @@ hardcode_shlibpath_var=no ;; - freebsd1*) - ld_shlibs=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -9367,7 +9673,7 @@ ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes @@ -9376,7 +9682,7 @@ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no @@ -9384,7 +9690,7 @@ hpux9*) if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -9399,14 +9705,13 @@ ;; hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes @@ -9418,16 +9723,16 @@ ;; hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -9439,7 +9744,46 @@ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + ;; esac fi @@ -9467,26 +9811,39 @@ irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int foo(void) {} +int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -9548,17 +9905,17 @@ hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -9568,13 +9925,13 @@ osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -9587,9 +9944,9 @@ no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -9777,44 +10134,50 @@ # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 -$as_echo "$archive_cmds_need_lc" >&6; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi @@ -9972,11 +10335,6 @@ - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } @@ -9985,16 +10343,23 @@ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -10007,7 +10372,7 @@ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -10027,7 +10392,13 @@ if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi @@ -10053,7 +10424,7 @@ case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -10062,7 +10433,7 @@ ;; aix[4-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -10115,7 +10486,7 @@ m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -10127,7 +10498,7 @@ ;; bsdi[45]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -10146,8 +10517,9 @@ need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -10168,36 +10540,83 @@ cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -10218,7 +10637,7 @@ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -10226,10 +10645,6 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -10237,7 +10652,7 @@ objformat=`/usr/bin/objformat` else case $host_os in - freebsd[123]*) objformat=aout ;; + freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -10255,7 +10670,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) @@ -10275,12 +10690,26 @@ ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -10326,12 +10755,14 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[3-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -10347,7 +10778,7 @@ nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -10384,9 +10815,9 @@ dynamic_linker=no ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) - version_type=linux +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -10394,12 +10825,17 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10412,13 +10848,17 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - shlibpath_overrides_runpath=yes + lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -10427,7 +10867,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -10471,7 +10911,7 @@ ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -10540,7 +10980,7 @@ ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -10565,7 +11005,7 @@ ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -10589,7 +11029,7 @@ sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -10620,7 +11060,7 @@ tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -10630,7 +11070,7 @@ ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -10742,6 +11182,11 @@ + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= @@ -11072,7 +11517,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11075 "configure" +#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11113,7 +11558,13 @@ # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -11122,7 +11573,11 @@ if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -11168,7 +11623,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11171 "configure" +#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11209,7 +11664,13 @@ # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -11218,7 +11679,11 @@ if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -11336,45 +11801,184 @@ $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +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 + +CC="$lt_save_CC" + + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } + done + ac_cv_prog_CXXCPP=$CXXCPP - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } 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 -CC="$lt_save_CC" - +else + _lt_caught_CXX_error=yes +fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -11391,7 +11995,6 @@ hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= -hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported @@ -11401,6 +12004,8 @@ module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no @@ -11456,6 +12061,7 @@ # Allow CC to be a program name with arguments. lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -11473,6 +12079,7 @@ fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do @@ -11483,7 +12090,7 @@ *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then @@ -11612,8 +12219,8 @@ # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -11645,7 +12252,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no @@ -11755,7 +12362,13 @@ allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -11768,26 +12381,33 @@ _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' @@ -11796,7 +12416,13 @@ else # Determine the default libpath from the value encoded in an # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -11809,30 +12435,42 @@ _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -11862,28 +12500,75 @@ ;; cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; darwin* | rhapsody*) @@ -11891,7 +12576,12 @@ hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported - whole_archive_flag_spec_CXX='' + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec_CXX='' + fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in @@ -11899,7 +12589,7 @@ *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -11933,7 +12623,7 @@ esac ;; - freebsd[12]*) + freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no @@ -11952,6 +12642,11 @@ gnu*) ;; + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: @@ -11976,11 +12671,11 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no @@ -12041,7 +12736,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then @@ -12051,10 +12746,10 @@ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -12084,7 +12779,7 @@ case $cc_basename in CC*) # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -12095,9 +12790,9 @@ *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes @@ -12108,7 +12803,7 @@ inherit_rpath_CXX=yes ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -12126,7 +12821,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -12163,26 +12858,26 @@ pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [1-5]* | *pgcpp\ [1-5]*) + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 will use weak symbols + *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -12190,7 +12885,7 @@ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -12209,9 +12904,9 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; - xl*) + xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -12231,13 +12926,13 @@ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -12306,7 +13001,7 @@ export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi @@ -12341,15 +13036,15 @@ case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; @@ -12365,17 +13060,17 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -12385,7 +13080,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -12421,7 +13116,7 @@ solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' @@ -12442,7 +13137,7 @@ esac link_all_deplibs_CXX=yes - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -12462,14 +13157,14 @@ if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -12480,7 +13175,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' @@ -12534,6 +13229,10 @@ CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -12595,6 +13294,14 @@ }; _LT_EOF + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -12608,7 +13315,7 @@ pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case $p in + case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -12617,13 +13324,22 @@ test $p = "-R"; then prev=$p continue - else - prev= fi + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) + case ${prev} in + -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -12643,8 +13359,10 @@ postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi + prev= ;; + *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -12680,6 +13398,7 @@ fi $RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in @@ -12715,7 +13434,7 @@ solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -12780,8 +13499,6 @@ lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -12831,6 +13548,11 @@ # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -12880,6 +13602,11 @@ ;; esac ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; dgux*) case $cc_basename in ec++*) @@ -12936,7 +13663,7 @@ ;; esac ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler @@ -12969,8 +13696,8 @@ lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; - xlc* | xlC*) - # IBM XL 8.0 on PPC + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' @@ -13032,7 +13759,7 @@ ;; solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' @@ -13097,10 +13824,17 @@ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5 -$as_echo "$lt_prog_compiler_pic_CXX" >&6; } - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. @@ -13124,15 +13858,15 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13127: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13131: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes @@ -13158,6 +13892,8 @@ + + # # Check to make sure the static flag actually works. # @@ -13177,7 +13913,7 @@ if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes @@ -13223,16 +13959,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13226: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13230: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes @@ -13275,16 +14011,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13278: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13282: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes @@ -13335,30 +14071,40 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - ;; - linux* | k*bsd*-gnu) + case $cc_basename in + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + linux* | k*bsd*-gnu | gnu*) link_all_deplibs_CXX=no - ;; + ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac - exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } @@ -13390,44 +14136,50 @@ # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - then - archive_cmds_need_lc_CXX=no - else - archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_CXX" >&5 -$as_echo "$archive_cmds_need_lc_CXX" >&6; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi @@ -13495,8 +14247,6 @@ - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } @@ -13522,7 +14272,7 @@ case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -13531,7 +14281,7 @@ ;; aix[4-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -13584,7 +14334,7 @@ m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -13596,7 +14346,7 @@ ;; bsdi[45]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -13615,8 +14365,9 @@ need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -13637,36 +14388,82 @@ cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -13686,7 +14483,7 @@ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -13694,10 +14491,6 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -13705,7 +14498,7 @@ objformat=`/usr/bin/objformat` else case $host_os in - freebsd[123]*) objformat=aout ;; + freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -13723,7 +14516,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) @@ -13742,13 +14535,27 @@ esac ;; -gnu*) - version_type=linux +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no + dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -13794,12 +14601,14 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[3-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -13815,7 +14624,7 @@ nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -13852,9 +14661,9 @@ dynamic_linker=no ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) - version_type=linux +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -13862,12 +14671,17 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -13880,13 +14694,17 @@ _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - shlibpath_overrides_runpath=yes + lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -13895,7 +14713,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -13939,7 +14757,7 @@ ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -14008,7 +14826,7 @@ ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -14033,7 +14851,7 @@ ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -14057,7 +14875,7 @@ sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -14088,7 +14906,7 @@ tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -14098,7 +14916,7 @@ ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -14159,6 +14977,8 @@ + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= @@ -14206,6 +15026,7 @@ fi # test -n "$compiler" CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -14234,6 +15055,8 @@ + + ac_config_commands="$ac_config_commands libtool" @@ -14262,7 +15085,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -14294,7 +15117,8 @@ b { REJECT; } c { yymore (); } d { yyless (1); } -e { yyless (input () != 0); } +e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ + yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% @@ -14425,7 +15249,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -15520,10 +16344,10 @@ -# bor_IS_VALID_OPTION macro checks if the current compiler, selected by +# sdcc_IS_VALID_OPTION macro checks if the current compiler, selected by # AC_LANG, supports option specified as the 1st parameter. The test fails if # the compiler returns an error or in case something is writeen to stderr. -# For example: bor_VALID_OPT(fPIC) +# For example: sdcc_VALID_OPT(-fPIC) @@ -15541,28 +16365,63 @@ ac_cv_sizeof_long_long=4 fi -# SDCC_BUILD_BIGENDIAN ([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN]) -# ------------------------------------------------------------------------- -# SDCC_BUILD_BIGENDIAN - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether host machine byte ordering is bigendian" >&5 -$as_echo_n "checking whether host machine byte ordering is bigendian... " >&6; } -if ${sdcc_cv_build_bigendian+:} false; then : +# Checking whether byte ordering is bigendian +# -------------------------------------------------------- + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else - # See if sys/param.h defines the BYTE_ORDER macro. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include -#include + #include int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif ; return 0; @@ -15570,61 +16429,116 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include -#include + #include int main () { #if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif + not big endian + #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : - sdcc_cv_build_bigendian=yes + ac_cv_c_bigendian=yes else - sdcc_cv_build_bigendian=no + ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - # 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 - sdcc_cv_build_bigendian=unknown - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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; } +#include + int main () { - _ascii (); _ebcdic (); +#ifndef _BIG_ENDIAN + not big endian + #endif + ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - sdcc_cv_build_bigendian=yes + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$sdcc_cv_build_bigendian" = unknown; then - sdcc_cv_build_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - sdcc_cv_build_bigendian=unknown - 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 $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; 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 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else @@ -15635,44 +16549,47 @@ 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; + /* 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 if ac_fn_cxx_try_run "$LINENO"; then : - sdcc_cv_build_bigendian=no + ac_cv_c_bigendian=no else - sdcc_cv_build_bigendian=yes + ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sdcc_cv_build_bigendian" >&5 -$as_echo "$sdcc_cv_build_bigendian" >&6; } -case $sdcc_cv_build_bigendian in - yes) +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) -$as_echo "#define BUILD_WORDS_BIGENDIAN 1" >>confdefs.h - ;; - no) - ;; - *) - as_fn_error $? "unknown endianness -presetting sdcc_cv_build_bigendian=no (or yes) will help" "$LINENO" 5 ;; -esac +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac PICOPT="" @@ -15699,14 +16616,15 @@ # This is the first time when CFLAGS are set/modified!! - ac_test_CXXFLAGS=${CXXFLAGS+set} -bor_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -ggdb" >&5 -$as_echo_n "checking whether $CXX accepts -ggdb... " >&6; } -if ${bor_cv_cxx_ggdb+:} false; then : + arg1=`echo -ggdb | sed -e"s/^-*//" -e"s/-/_/"` +ac_test_CXXFLAGS=${CXXFLAGS+set} +sdcc_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ accepts -ggdb" >&5 +$as_echo_n "checking whether C++ accepts -ggdb... " >&6; } +if eval \${sdcc_cv_cxx_$arg1+:} false; then : $as_echo_n "(cached) " >&6 else - bor_save_cxx_werror_flag=$ac_cxx_werror_flag + sdcc_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes CXXFLAGS="-ggdb" @@ -15722,25 +16640,27 @@ } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : - bor_cv_cxx_ggdb=yes + eval sdcc_cv_cxx_$arg1=yes else - bor_cv_cxx_ggdb=no + eval sdcc_cv_cxx_$arg1=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$bor_save_cxx_werror_flag + ac_cxx_werror_flag=$sdcc_save_cxx_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bor_cv_cxx_ggdb" >&5 -$as_echo "$bor_cv_cxx_ggdb" >&6; } - CXXFLAGS=$bor_save_CXXFLAGS +eval ac_res=\$sdcc_cv_cxx_$arg1 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + CXXFLAGS=$sdcc_save_CXXFLAGS - ac_test_CXXFLAGS=${CXXFLAGS+set} -bor_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -gstabs" >&5 -$as_echo_n "checking whether $CXX accepts -gstabs... " >&6; } -if ${bor_cv_cxx_gstabs+:} false; then : + arg1=`echo -gstabs | sed -e"s/^-*//" -e"s/-/_/"` +ac_test_CXXFLAGS=${CXXFLAGS+set} +sdcc_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ accepts -gstabs" >&5 +$as_echo_n "checking whether C++ accepts -gstabs... " >&6; } +if eval \${sdcc_cv_cxx_$arg1+:} false; then : $as_echo_n "(cached) " >&6 else - bor_save_cxx_werror_flag=$ac_cxx_werror_flag + sdcc_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes CXXFLAGS="-gstabs" @@ -15756,16 +16676,17 @@ } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : - bor_cv_cxx_gstabs=yes + eval sdcc_cv_cxx_$arg1=yes else - bor_cv_cxx_gstabs=no + eval sdcc_cv_cxx_$arg1=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$bor_save_cxx_werror_flag + ac_cxx_werror_flag=$sdcc_save_cxx_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bor_cv_cxx_gstabs" >&5 -$as_echo "$bor_cv_cxx_gstabs" >&6; } - CXXFLAGS=$bor_save_CXXFLAGS +eval ac_res=\$sdcc_cv_cxx_$arg1 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + CXXFLAGS=$sdcc_save_CXXFLAGS if test "$ucsim_cv_cxx_gstabs" = "yes"; then gopt="-gstabs+ -g3" @@ -15780,14 +16701,15 @@ CXXFLAGS="$CXXFLAGS $gopt" fi - ac_test_CXXFLAGS=${CXXFLAGS+set} -bor_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -pipe" >&5 -$as_echo_n "checking whether $CXX accepts -pipe... " >&6; } -if ${bor_cv_cxx_pipe+:} false; then : + arg1=`echo -pipe | sed -e"s/^-*//" -e"s/-/_/"` +ac_test_CXXFLAGS=${CXXFLAGS+set} +sdcc_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ accepts -pipe" >&5 +$as_echo_n "checking whether C++ accepts -pipe... " >&6; } +if eval \${sdcc_cv_cxx_$arg1+:} false; then : $as_echo_n "(cached) " >&6 else - bor_save_cxx_werror_flag=$ac_cxx_werror_flag + sdcc_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes CXXFLAGS="-pipe" @@ -15803,16 +16725,17 @@ } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : - bor_cv_cxx_pipe=yes + eval sdcc_cv_cxx_$arg1=yes else - bor_cv_cxx_pipe=no + eval sdcc_cv_cxx_$arg1=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$bor_save_cxx_werror_flag + ac_cxx_werror_flag=$sdcc_save_cxx_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bor_cv_cxx_pipe" >&5 -$as_echo "$bor_cv_cxx_pipe" >&6; } - CXXFLAGS=$bor_save_CXXFLAGS +eval ac_res=\$sdcc_cv_cxx_$arg1 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + CXXFLAGS=$sdcc_save_CXXFLAGS if test "$ucsim_cv_cxx_pipe" = "yes"; then CXXFLAGS="$CXXFLAGS -pipe" @@ -15823,7 +16746,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the SunPRO C++ compiler" >&5 $as_echo_n "checking whether we are using the SunPRO C++ compiler... " >&6; } -if ${bor_cv_cxx_compiler_sunpro+:} false; then : +if ${sdcc_cv_cxx_compiler_sunpro+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15841,17 +16764,16 @@ } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : - bor_compiler_sunpro=yes + sdcc_cv_cxx_compiler_sunpro=yes else - bor_compiler_sunpro=no + sdcc_cv_cxx_compiler_sunpro=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -bor_cv_cxx_compiler_sunpro=$bor_compiler_sunpro fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bor_cv_cxx_compiler_sunpro" >&5 -$as_echo "$bor_cv_cxx_compiler_sunpro" >&6; } - if test "$bor_cv_cxx_compiler_sunpro" = "yes"; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sdcc_cv_cxx_compiler_sunpro" >&5 +$as_echo "$sdcc_cv_cxx_compiler_sunpro" >&6; } + if test "$sdcc_cv_cxx_compiler_sunpro" = "yes"; then CXXFLAGS="-xO2 $CXXFLAGS" MAKEDEP="$CXX -xM1" WALL_FLAG= @@ -16303,6 +17225,7 @@ + : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files @@ -16600,16 +17523,16 @@ # ... 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'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -16669,28 +17592,16 @@ 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 + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # 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'" @@ -16712,7 +17623,7 @@ # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -16778,10 +17689,10 @@ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.68, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -16871,7 +17782,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -16904,184 +17815,208 @@ sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' -macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' -enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' -pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' -host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' -host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' -host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' -build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' -build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' -build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' -SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' -Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' -GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' -EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' -FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' -LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' -NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' -LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' -ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' -exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' -lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' -reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' -AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' -STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' -RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' -compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' -GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' -SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' -ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' -need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' -LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' -libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' -fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' -version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' -runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' -libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' -soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' -old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' -striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`' -predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`' -postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`' -predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`' -postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`' -LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`' -GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`' -export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' -allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' -no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`' -inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`' -link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`' -fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' -always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`' -export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' -include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' -prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`' -predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' -postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' -predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' -postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + # Quote evaled strings. -for var in SED \ +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ GREP \ EGREP \ FGREP \ @@ -17094,8 +18029,13 @@ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ +archiver_list_spec \ STRIP \ RANLIB \ CC \ @@ -17105,14 +18045,14 @@ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -SHELL \ -ECHO \ +nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_wl \ lt_prog_compiler_pic \ +lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ +MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ @@ -17126,9 +18066,7 @@ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ -hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ -fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ @@ -17136,6 +18074,7 @@ libname_spec \ library_names_spec \ soname_spec \ +install_override_mode \ finish_eval \ old_striplib \ striplib \ @@ -17146,10 +18085,11 @@ postdeps \ compiler_lib_search_path \ LD_CXX \ +reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ -lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ @@ -17159,9 +18099,7 @@ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ -hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ -fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ @@ -17171,9 +18109,9 @@ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -17195,11 +18133,13 @@ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ +postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ +reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ @@ -17208,10 +18148,11 @@ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ -prelink_cmds_CXX; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -17219,12 +18160,6 @@ esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` - ;; -esac - ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' @@ -17256,7 +18191,6 @@ do case $ac_config_target in "ddconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS ddconfig.h:ddconfig_in.h" ;; - "custom.h") CONFIG_HEADERS="$CONFIG_HEADERS custom.h:custom_in.h" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "main.mk") CONFIG_FILES="$CONFIG_FILES main.mk:main_in.mk" ;; @@ -17847,7 +18781,8 @@ # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -17895,6 +18830,15 @@ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + # The host system. host_alias=$host_alias host=$host @@ -17944,9 +18888,11 @@ # turn newlines into spaces. NL2SP=$lt_lt_NL2SP -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP @@ -17954,13 +18900,30 @@ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method -# Command to use when deplibs_check_method == "file_magic". +# Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + # The archiver. AR=$lt_AR + +# Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + # A symbol stripping program. STRIP=$lt_STRIP @@ -17969,6 +18932,9 @@ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + # A C compiler. LTCC=$lt_CC @@ -17987,14 +18953,14 @@ # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix -# The name of the directory that contains temporary libtool files. -objdir=$objdir +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot -# An echo program that does not interpret backslashes. -ECHO=$lt_ECHO +# The name of the directory that contains temporary libtool files. +objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD @@ -18002,6 +18968,9 @@ # Must we lock files when doing compilation? need_locks=$lt_need_locks +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL @@ -18058,6 +19027,9 @@ # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds @@ -18097,6 +19069,10 @@ # The linker used to build libraries. LD=$lt_LD +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds @@ -18109,12 +19085,12 @@ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static @@ -18164,10 +19140,6 @@ # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator @@ -18201,9 +19173,6 @@ # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path - # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols @@ -18219,6 +19188,9 @@ # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + # Specify filename containing input files. file_list_spec=$lt_file_list_spec @@ -18265,212 +19237,169 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $* )) -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} - -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} - - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} - -# sed scripts: -my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[^=]*=//' - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$@"` -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` -} - -_LT_EOF -esac - -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1+=\$2" -} -_LT_EOF - ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1=\$$1\$2" -} - -_LT_EOF - ;; - esac + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - mv -f "$cfgfile" "$ofile" || + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -18482,6 +19411,10 @@ # The linker used to build libraries. LD=$lt_LD_CXX +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX @@ -18494,12 +19427,12 @@ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX @@ -18549,10 +19482,6 @@ # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX - # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX @@ -18586,9 +19515,6 @@ # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path_CXX - # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX @@ -18604,6 +19530,9 @@ # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/configure.in sdcc-3.2.0+dfsg/sim/ucsim/configure.in --- sdcc-3.1.0+dfsg/sim/ucsim/configure.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/configure.in 2012-03-30 10:48:18.000000000 +0000 @@ -3,7 +3,7 @@ AC_PREREQ(2.60) AC_INIT AC_CONFIG_SRCDIR(.version) -AC_CONFIG_HEADER(ddconfig.h:ddconfig_in.h custom.h:custom_in.h) +AC_CONFIG_HEADER(ddconfig.h:ddconfig_in.h) AC_PROG_AWK @@ -375,36 +375,36 @@ # Check whether the compiler for the current language is SunPRO. -AC_DEFUN([bor_IS_SUNPRO], +AC_DEFUN([sdcc_IS_SUNPRO], [AC_CACHE_CHECK([whether we are using the SunPRO _AC_LANG compiler], - [bor_cv_[]_AC_LANG_ABBREV[]_compiler_sunpro], + [sdcc_cv_[]_AC_LANG_ABBREV[]_compiler_sunpro], [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#if !defined __SUNPRO_C && !defined __SUNPRO_CC choke me #endif ]])], - [bor_compiler_sunpro=yes], - [bor_compiler_sunpro=no]) -bor_cv_[]_AC_LANG_ABBREV[]_compiler_sunpro=$bor_compiler_sunpro + [sdcc_cv_[]_AC_LANG_ABBREV[]_compiler_sunpro=yes], + [sdcc_cv_[]_AC_LANG_ABBREV[]_compiler_sunpro=no]) ])]) -# bor_IS_VALID_OPTION macro checks if the current compiler, selected by +# sdcc_IS_VALID_OPTION macro checks if the current compiler, selected by # AC_LANG, supports option specified as the 1st parameter. The test fails if # the compiler returns an error or in case something is writeen to stderr. -# For example: bor_VALID_OPT(fPIC) +# For example: sdcc_VALID_OPT(-fPIC) -AC_DEFUN([bor_IS_VALID_OPTION], -[ac_test_[]_AC_LANG_PREFIX[]FLAGS=${[]_AC_LANG_PREFIX[]FLAGS+set} -bor_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS -AC_CACHE_CHECK(whether $_AC_LANG_PREFIX accepts -$1, bor_cv_[]_AC_LANG_ABBREV[]_$1, - [bor_save_[]_AC_LANG_ABBREV[]_werror_flag=$ac_[]_AC_LANG_ABBREV[]_werror_flag +AC_DEFUN([sdcc_IS_VALID_OPTION], +[arg1=`echo $1 | sed -e"s/^-*//" -e"s/-/_/"` +ac_test_[]_AC_LANG_PREFIX[]FLAGS=${[]_AC_LANG_PREFIX[]FLAGS+set} +sdcc_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS +AC_CACHE_CHECK(whether _AC_LANG accepts $1, sdcc_cv_[]_AC_LANG_ABBREV[]_$arg1, + [sdcc_save_[]_AC_LANG_ABBREV[]_werror_flag=$ac_[]_AC_LANG_ABBREV[]_werror_flag ac_[]_AC_LANG_ABBREV[]_werror_flag=yes - []_AC_LANG_PREFIX[]FLAGS="-$1" + []_AC_LANG_PREFIX[]FLAGS="$1" AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], - [bor_cv_[]_AC_LANG_ABBREV[]_$1=yes], - [bor_cv_[]_AC_LANG_ABBREV[]_$1=no]) - ac_[]_AC_LANG_ABBREV[]_werror_flag=$bor_save_[]_AC_LANG_ABBREV[]_werror_flag]) - []_AC_LANG_PREFIX[]FLAGS=$bor_save_[]_AC_LANG_PREFIX[]FLAGS + [eval sdcc_cv_[]_AC_LANG_ABBREV[]_$arg1=yes], + [eval sdcc_cv_[]_AC_LANG_ABBREV[]_$arg1=no]) + ac_[]_AC_LANG_ABBREV[]_werror_flag=$sdcc_save_[]_AC_LANG_ABBREV[]_werror_flag]) + []_AC_LANG_PREFIX[]FLAGS=$sdcc_save_[]_AC_LANG_PREFIX[]FLAGS ]) # Checking characteristics of compilers and other programs @@ -421,77 +421,9 @@ ac_cv_sizeof_long_long=4 fi -# SDCC_BUILD_BIGENDIAN ([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN]) -# ------------------------------------------------------------------------- -AC_DEFUN([SDCC_BUILD_BIGENDIAN], -[AC_CACHE_CHECK(whether host machine byte ordering is bigendian, sdcc_cv_build_bigendian, -[# See if sys/param.h defines the BYTE_ORDER macro. -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include -#include -], -[#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif -])], -[# It does; now see whether it defined to BIG_ENDIAN or not. -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include -#include -], [#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif -])], [sdcc_cv_build_bigendian=yes], [sdcc_cv_build_bigendian=no])], -[# It does not; compile a test program. -AC_RUN_IFELSE( -[AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [[ - /* 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; -]])], - [sdcc_cv_build_bigendian=no], - [sdcc_cv_build_bigendian=yes], -[# try to guess the endianness by grepping values into an object file - sdcc_cv_build_bigendian=unknown - AC_COMPILE_IFELSE([AC_LANG_PROGRAM( -[[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; }]], -[[ _ascii (); _ebcdic (); ]])], -[if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - sdcc_cv_build_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$sdcc_cv_build_bigendian" = unknown; then - sdcc_cv_build_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - sdcc_cv_build_bigendian=unknown - fi -fi])])])]) -case $sdcc_cv_build_bigendian in - yes) - m4_default([$1], - [AC_DEFINE([BUILD_WORDS_BIGENDIAN], 1, - [Define to 1 if your processor stores words with the most significant - byte first (like Motorola and SPARC, unlike Intel and VAX).])]) ;; - no) - $2 ;; - *) - m4_default([$3], - [AC_MSG_ERROR([unknown endianness -presetting sdcc_cv_build_bigendian=no (or yes) will help])]) ;; -esac -])# SDCC_BUILD_BIGENDIAN - -SDCC_BUILD_BIGENDIAN +# Checking whether byte ordering is bigendian +# -------------------------------------------------------- +AC_C_BIGENDIAN PICOPT="" SHAREDLIB="no" @@ -510,8 +442,8 @@ # This is the first time when CFLAGS are set/modified!! - bor_IS_VALID_OPTION(ggdb) - bor_IS_VALID_OPTION(gstabs) + sdcc_IS_VALID_OPTION(-ggdb) + sdcc_IS_VALID_OPTION(-gstabs) if test "$ucsim_cv_cxx_gstabs" = "yes"; then gopt="-gstabs+ -g3" elif test "$ucsim_cv_cxx_ggdb" = "yes"; then @@ -525,7 +457,7 @@ CXXFLAGS="$CXXFLAGS $gopt" fi - bor_IS_VALID_OPTION(pipe) + sdcc_IS_VALID_OPTION(-pipe) if test "$ucsim_cv_cxx_pipe" = "yes"; then CXXFLAGS="$CXXFLAGS -pipe" fi @@ -533,8 +465,8 @@ MAKEDEP="$CXX $ucsim_cv_MM" WALL_FLAG="-Wall" else - bor_IS_SUNPRO - if test "$bor_cv_cxx_compiler_sunpro" = "yes"; then + sdcc_IS_SUNPRO + if test "$sdcc_cv_cxx_compiler_sunpro" = "yes"; then CXXFLAGS="-xO2 $CXXFLAGS" MAKEDEP="$CXX -xM1" WALL_FLAG= @@ -624,7 +556,10 @@ AH_TOP([#ifndef DDCONFIG_HEADER #define DDCONFIG_HEADER]) -AH_BOTTOM([#include "custom.h" +AH_BOTTOM([/* ucsim custom defines */ +#define DD_TRUE 1 +#define DD_FALSE 0 +#define NIL 0 #endif /* DDCONFIG_HEADER */]) if echo $TYPE_DWORD|grep short >/dev/null; then diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/custom_in.h sdcc-3.2.0+dfsg/sim/ucsim/custom_in.h --- sdcc-3.1.0+dfsg/sim/ucsim/custom_in.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/custom_in.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -/* - * Simulator of microcontrollers (custom.h) - * - * This file contains manual additions to #include into ddconfig.h - * - * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. - * - * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu - * - */ - -/* This file is part of microcontroller simulator: ucsim. - -UCSIM 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. - -UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ -/*@1@*/ - -#define DD_TRUE 1 -#define DD_FALSE 0 -#define NIL 0 - -/* - * find out the endianess of host machine - */ -#if defined __APPLE__ && (defined __BIG_ENDIAN__ || defined _BIG_ENDIAN) -/* 1) trust the compiler - * in order to be able to make Mac OS X unified binaries */ -# define WORDS_BIGENDIAN 1 -#elif defined __APPLE__ && (defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN) -/* do nothing */ -#elif defined __sun && defined HAVE_SYS_ISA_DEFS_H -/* Solaris defines endianness in */ -# include -# ifdef _BIG_ENDIAN -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifdef HAVE_ENDIAN_H -# include -# elif defined HAVE_SYS_ENDIAN_H -# include -# elif defined HAVE_MACHINE_ENDIAN_H -# include -# endif -# if (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) -/* 2) trust the header files */ -# if BYTE_ORDER == BIG_ENDIAN -# define WORDS_BIGENDIAN 1 -# endif -# else -/* 3) trust the configure; this actually doesn't work for unified Mac OS X binaries :-( */ -# if (defined BUILD_WORDS_BIGENDIAN && BUILD_WORDS_BIGENDIAN) -# define WORDS_BIGENDIAN 1 -# endif -/* 4) assume that host is a little endian machine */ -# endif -#endif - -/* End of custom.h */ diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/ddconfig_in.h sdcc-3.2.0+dfsg/sim/ucsim/ddconfig_in.h --- sdcc-3.1.0+dfsg/sim/ucsim/ddconfig_in.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/ddconfig_in.h 2012-03-28 12:38:08.000000000 +0000 @@ -6,9 +6,8 @@ /* Define to be the type of length parameter of accept (without the \*'). */ #undef ACCEPT_SOCKLEN_T -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef BUILD_WORDS_BIGENDIAN +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD /* XXX */ #undef FD_HEADER_OK @@ -254,6 +253,18 @@ /* XXX */ #undef VERSIONSTR +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER @@ -264,5 +275,8 @@ /* XXX */ #undef _M_ -#include "custom.h" +/* ucsim custom defines */ +#define DD_TRUE 1 +#define DD_FALSE 0 +#define NIL 0 #endif /* DDCONFIG_HEADER */ diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/globals.cc sdcc-3.2.0+dfsg/sim/ucsim/globals.cc --- sdcc-3.1.0+dfsg/sim/ucsim/globals.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/globals.cc 2012-05-15 03:59:44.000000000 +0000 @@ -409,9 +409,11 @@ struct cpu_entry cpus_z80[]= { - {"Z80" , CPU_Z80, 0}, - {"Z180" , CPU_Z180,0}, - {"R2K" , CPU_R2K, 0}, + {"Z80" , CPU_Z80, 0}, + {"Z180" , CPU_Z180, 0}, + {"R2K" , CPU_R2K, 0}, + {"R3KA" , CPU_R3KA, 0}, + {"LR35902", CPU_LR35902, 0}, {NULL, 0, 0} }; diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/hc08.src/hc08.cc sdcc-3.2.0+dfsg/sim/ucsim/hc08.src/hc08.cc --- sdcc-3.1.0+dfsg/sim/ucsim/hc08.src/hc08.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/hc08.src/hc08.cc 2012-05-19 12:33:25.000000000 +0000 @@ -489,7 +489,8 @@ case 0x2: case 0x3: return(inst_condbranch(code, false)); case 0x4: - case 0x5: + case 0x5: return(inst_transfer(code, false)); + case 0x6: return(inst_sthx(code, false)); case 0x7: case 0xf: return(inst_transfer(code, false)); case 0x8: @@ -500,6 +501,7 @@ case 0xd: return(inst_nop(code, false)); case 0xe: code = fetch(); + tick(1); switch ((code >> 4) & 0xf) { case 0x6: switch (code & 0xf) { @@ -519,18 +521,18 @@ default: return(resHALT); } case 0xa: - switch (code & 0x5) { - case 0xe: return(inst_ldhx(code,true)); + switch (code) { + case 0xae: return(inst_ldhx(code,true)); default: return(resHALT); } case 0xb: - switch (code & 0x5) { - case 0xe: return(inst_ldhx(code,true)); + switch (code) { + case 0xbe: return(inst_ldhx(code,true)); default: return(resHALT); } case 0xc: - switch (code & 0x5) { - case 0xe: return(inst_ldhx(code,true)); + switch (code) { + case 0xce: return(inst_ldhx(code,true)); default: return(resHALT); } case 0xd: diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/hc08.src/inst.cc sdcc-3.2.0+dfsg/sim/ucsim/hc08.src/inst.cc --- sdcc-3.1.0+dfsg/sim/ucsim/hc08.src/inst.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/hc08.src/inst.cc 2012-05-15 09:51:32.000000000 +0000 @@ -52,6 +52,7 @@ int result; result = fetch() << 8; result |= fetch(); + tick(2); return result; } @@ -63,12 +64,15 @@ case 0x1: case 0x3: case 0xb: + tick(1); return fetch(); // Direct case 0x7: case 0xf: + tick(1); // extra cycle needed, even without fetch return (regs.H << 8) | regs.X; // IX case 0x6: case 0xe: + tick(1); if (!prefix) return ((unsigned char)fetch())+((regs.H << 8) | regs.X); // IX1 else @@ -171,6 +175,7 @@ cl_hc08::inst_lda(t_mem code, bool prefix) { regs.A = OPERAND(code, prefix); + tick(1); FLAG_CLEAR(BIT_V); FLAG_NZ(regs.A); return(resGO); @@ -180,6 +185,7 @@ cl_hc08::inst_ldx(t_mem code, bool prefix) { regs.X = OPERAND(code, prefix); + tick(1); FLAG_CLEAR(BIT_V); FLAG_NZ(regs.X); return(resGO); @@ -190,11 +196,10 @@ { int ea = fetchea(code, prefix); - //fprintf (stdout, "ea = 0x%04x\n", ea); - FLAG_CLEAR(BIT_V); FLAG_NZ(regs.A); store1(ea, regs.A); + tick(1); return(resGO); } @@ -206,6 +211,7 @@ FLAG_CLEAR(BIT_V); FLAG_NZ(regs.X); store1(ea, regs.X); + tick(1); return(resGO); } @@ -216,12 +222,13 @@ operand1 = regs.A; operand2 = OPERAND(code, prefix); + tick(1); result = operand1 + operand2; FLAG_NZ (result); FLAG_ASSIGN (BIT_V, 0x80 & (operand1 ^ operand2 ^ result ^ (result >>1))); FLAG_ASSIGN (BIT_C, 0x100 & result); FLAG_ASSIGN (BIT_H, 0x10 & (operand1 ^ operand2 ^ result)); - + regs.A = result & 0xff; return(resGO); } @@ -234,6 +241,7 @@ operand1 = regs.A; operand2 = OPERAND(code, prefix); + tick(1); result = operand1 + operand2 + carryin; FLAG_NZ (result); FLAG_ASSIGN (BIT_V, 0x80 & (operand1 ^ operand2 ^ result ^ (result >>1))); @@ -251,6 +259,7 @@ operand1 = regs.A; operand2 = OPERAND(code, prefix); + tick(1); result = operand1 - operand2; FLAG_NZ (result); FLAG_ASSIGN (BIT_V, 0x80 & (operand1 ^ operand2 ^ result ^ (result >>1))); @@ -268,6 +277,7 @@ operand1 = regs.A; operand2 = OPERAND(code, prefix); + tick(1); result = operand1 - operand2 - carryin; FLAG_NZ (result); FLAG_ASSIGN (BIT_V, 0x80 & (operand1 ^ operand2 ^ result ^ (result >>1))); @@ -284,6 +294,7 @@ operand1 = regs.A; operand2 = OPERAND(code, prefix); + tick(1); result = operand1 - operand2; FLAG_NZ (result); FLAG_ASSIGN (BIT_V, 0x80 & (operand1 ^ operand2 ^ result ^ (result >>1))); @@ -299,6 +310,7 @@ operand1 = regs.X; operand2 = OPERAND(code, prefix); + tick(1); result = operand1 - operand2; FLAG_NZ (result); FLAG_ASSIGN (BIT_V, 0x80 & (operand1 ^ operand2 ^ result ^ (result >>1))); @@ -311,7 +323,7 @@ cl_hc08::inst_jmp(t_mem code, bool prefix) { PC = fetchea(code, prefix); - + tick(1); // extra cycle to reload pipeline return(resGO); } @@ -319,9 +331,11 @@ cl_hc08::inst_jsr(t_mem code, bool prefix) { int newPC = fetchea(code, prefix); - + push2(PC); + tick(2); PC = newPC; + tick(1); // extra cycle to reload pipeline return(resGO); } @@ -330,9 +344,11 @@ cl_hc08::inst_bsr(t_mem code, bool prefix) { signed char ofs = fetch(); - + push2(PC); + tick(2); PC += ofs; + tick(1); // extra cycle to reload pipeline return(resGO); } @@ -349,6 +365,7 @@ { int hx = (regs.H << 8) | (regs.X); hx += (signed char)fetch(); + tick(1); regs.H = (hx >> 8) & 0xff; regs.X = hx & 0xff; return(resGO); @@ -358,6 +375,7 @@ cl_hc08::inst_and(t_mem code, bool prefix) { regs.A = regs.A & OPERAND(code, prefix); + tick(1); FLAG_CLEAR(BIT_V); FLAG_NZ(regs.A); return(resGO); @@ -367,6 +385,7 @@ cl_hc08::inst_bit(t_mem code, bool prefix) { uchar operand = regs.A & OPERAND(code, prefix); + tick(1); FLAG_CLEAR(BIT_V); FLAG_NZ(operand); return(resGO); @@ -376,6 +395,7 @@ cl_hc08::inst_ora(t_mem code, bool prefix) { regs.A = regs.A | OPERAND(code, prefix); + tick(1); FLAG_CLEAR(BIT_V); FLAG_NZ(regs.A); return(resGO); @@ -385,6 +405,7 @@ cl_hc08::inst_eor(t_mem code, bool prefix) { regs.A = regs.A ^ OPERAND(code, prefix); + tick(1); FLAG_CLEAR(BIT_V); FLAG_NZ(regs.A); return(resGO); @@ -403,6 +424,7 @@ else { ea = fetchea(code,prefix); operand = get1(ea); + tick(1); } FLAG_ASSIGN (BIT_C, operand & 1); @@ -416,6 +438,9 @@ regs.X = operand; else { store1(ea, operand); + tick(1); + if ((code & 0x70) != 0x70) + tick(1); } return(resGO); @@ -435,6 +460,7 @@ else { ea = fetchea(code,prefix); operand = get1(ea); + tick(1); } FLAG_ASSIGN (BIT_C, operand & 1); @@ -448,6 +474,9 @@ regs.X = operand; else { store1(ea, operand); + tick(1); + if ((code & 0x70) != 0x70) + tick(1); } return(resGO); } @@ -466,6 +495,7 @@ else { ea = fetchea(code,prefix); operand = get1(ea); + tick(1); } FLAG_ASSIGN (BIT_C, operand & 0x80); @@ -479,6 +509,9 @@ regs.X = operand; else { store1(ea, operand); + tick(1); + if ((code & 0x70) != 0x70) + tick(1); } return(resGO); } @@ -498,6 +531,7 @@ else { ea = fetchea(code,prefix); operand = get1(ea); + tick(1); } FLAG_ASSIGN (BIT_C, operand & 0x80); @@ -511,6 +545,9 @@ regs.X = operand; else { store1(ea, operand); + tick(1); + if ((code & 0x70) != 0x70) + tick(1); } return(resGO); } @@ -530,6 +567,7 @@ else { ea = fetchea(code,prefix); operand = get1(ea); + tick(1); } FLAG_ASSIGN (BIT_C, operand & 1); @@ -543,6 +581,9 @@ regs.X = operand; else { store1(ea, operand); + tick(1); + if ((code & 0x70) != 0x70) + tick(1); } return(resGO); } @@ -561,6 +602,7 @@ else { ea = fetchea(code,prefix); operand = get1(ea); + tick(1); } operand++; @@ -573,6 +615,9 @@ regs.X = operand; else { store1(ea, operand); + tick(1); + if ((code & 0x70) != 0x70) + tick(1); } return(resGO); } @@ -591,6 +636,7 @@ else { ea = fetchea(code,prefix); operand = get1(ea); + tick(1); } operand--; @@ -603,6 +649,9 @@ regs.X = operand; else { store1(ea, operand); + tick(1); + if ((code & 0x70) != 0x70) + tick(1); } return(resGO); } @@ -621,6 +670,7 @@ else { ea = fetchea(code,prefix); operand = get1(ea); + tick(1); } operand--; @@ -633,11 +683,16 @@ regs.X = operand; else { store1(ea, operand); + tick(1); + if ((code & 0x70) != 0x70) + tick(1); } ofs = fetch(); + tick(1); if (operand) PC += ofs; + tick(1); // extra cycle to reload pipeline return(resGO); } @@ -648,7 +703,7 @@ { int ea = 0xffff; uchar operand; - + if ((code & 0xf0) == 0x40) operand = regs.A; else if ((code & 0xf0) == 0x50) @@ -656,10 +711,13 @@ else { ea = fetchea(code,prefix); operand = get1(ea); + tick(1); } FLAG_NZ (operand); FLAG_CLEAR (BIT_V); + if ((code & 0xf0) == 0x30 || (code & 0xf0) == 0x60) + tick(1); return(resGO); } @@ -670,7 +728,18 @@ { int ea = 0xffff; uchar operand; - + + // clr uses read-modify-write cycles, so simulate the read even if the data isn't used + if ((code & 0xf0) == 0x40) + operand = regs.A; + else if ((code & 0xf0) == 0x50) + operand = regs.X; + else { + ea = fetchea(code,prefix); + operand = get1(ea); + tick(1); + } + operand = 0; FLAG_CLEAR (BIT_V); FLAG_CLEAR (BIT_N); @@ -681,8 +750,9 @@ else if ((code & 0xf0) == 0x50) regs.X = operand; else { - ea = fetchea(code,prefix); store1(ea, operand); + if ((code & 0x70) != 0x70) + tick(1); } return(resGO); } @@ -712,6 +782,7 @@ else { ea = fetchea(code,prefix); operand = get1(ea); + tick(1); } operand = ~operand; @@ -725,6 +796,8 @@ regs.X = operand; else { store1(ea, operand); + if ((code & 0x70) != 0x70) + tick(1); } return(resGO); } @@ -743,6 +816,7 @@ else { ea = fetchea(code,prefix); operand = get1(ea); + tick(1); } FLAG_ASSIGN (BIT_V, operand==0x80); @@ -756,6 +830,8 @@ regs.X = operand; else { store1(ea, operand); + if ((code & 0x70) != 0x70) + tick(1); } return(resGO); } @@ -768,21 +844,27 @@ switch (code) { case 0x86: pop1(regs.A); + tick(2); break; case 0x87: push1(regs.A); + tick(1); break; case 0x88: pop1(regs.X); + tick(2); break; case 0x89: push1(regs.X); + tick(1); break; case 0x8a: pop1(regs.H); + tick(2); break; case 0x8b: push1(regs.H); + tick(1); break; default: return(resHALT); @@ -844,6 +926,7 @@ regs.X = (result >> 8) & 0xff; FLAG_CLEAR (BIT_C); FLAG_CLEAR (BIT_H); + tick(4); return(resGO); } @@ -865,6 +948,7 @@ FLAG_SET (BIT_C); // overflow } else FLAG_SET (BIT_C); // division by zero + tick(5); return(resGO); } @@ -927,8 +1011,10 @@ taken = ! taken; ofs = fetch(); + tick(1); if (taken) PC += ofs; + tick(1); // extra cycle to reload pipeline return(resGO); } @@ -939,12 +1025,15 @@ uchar bit = (code >> 1) & 7; int ea = fetchea(code, prefix); uchar operand = get1(ea); + tick(1); if (code & 1) operand &= ~(1 << bit); else operand |= (1 << bit); + tick(1); store1(ea, operand); + tick(1); return(resGO); } @@ -956,15 +1045,18 @@ uchar operand = get1(ea); signed char ofs; bool taken; - + + tick(1); if (code & 1) - taken = operand & (1 << bit); + taken = !(operand & (1 << bit)); // brclr else - taken = !(operand & (1 << bit)); + taken = (operand & (1 << bit)); // brset ofs = fetch(); + tick(1); if (taken) PC += ofs; + tick(1); // extra cycle to reload pipeline FLAG_ASSIGN (BIT_C, operand & (1 << bit)); return(resGO); @@ -980,24 +1072,29 @@ if ((code & 0xf0) == 0x40) { operand1 = regs.A; operand2 = fetch(); + tick(1); } else if ((code & 0xf0) == 0x50) { operand1 = regs.X; operand2 = fetch(); + tick(1); } else { ea = fetchea(code,prefix); operand1 = get1(ea); + tick(1); operand2 = regs.A; } ofs = fetch(); + tick(1); if (operand1==operand2) PC += ofs; - if (code==0x71) + if (code == 0x71 || code == 0x61) incx(); - + tick(1); // extra cycle to reload pipeline + return(resGO); } @@ -1005,11 +1102,16 @@ cl_hc08::inst_rti(t_mem code, bool prefix) { pop1(regs.P); + tick(1); regs.P |= 0x60; pop1(regs.A); + tick(1); pop1(regs.X); + tick(1); pop2(PC); - + tick(2); + tick(3); // pipeline reload and some extra overhead? + return(resGO); } @@ -1017,7 +1119,9 @@ cl_hc08::inst_rts(t_mem code, bool prefix) { pop2(PC); - + tick(2); + tick(3); // pipeline reload and some extra overhead? + return(resGO); } @@ -1033,35 +1137,45 @@ switch (code) { case 0x4e: //mov opr8a,opr8a operand = get1(fetch()); + tick(2); ea = fetch(); + tick(1); aix = 0; break; case 0x5e: //mov opr8a,x+ operand = get1(fetch()); + tick(2); + tick(1); ea = hx; aix = 1; break; case 0x6e: //mov #opr8i,opr8a operand = fetch(); + tick(1); ea = fetch(); + tick(1); aix = 0; break; case 0x7e: //mov x+,opr8a operand = get1(hx); + tick(1); ea = fetch(); + tick(1); + tick(1); aix = 1; break; default: return(resHALT); } - + store1(ea, operand); + tick(1); if (aix) incx(); FLAG_NZ(operand); FLAG_CLEAR(BIT_V); - + return(resGO); } @@ -1073,20 +1187,25 @@ if (code == 0x35) { ea = fetch(); + tick(1); } else if ((code == 0x96) && (type == CPU_HCS08)) { ea = fetch2(); + tick(2); } else if (prefix && (code == 0xff) && (type == CPU_HCS08)) { ea = regs.SP + fetch(); + tick(1); } else return(resHALT); store1(ea, regs.H); + tick(1); store1((ea+1) & 0xffff, regs.X); + tick(1); FLAG_CLEAR(BIT_V); FLAG_ASSIGN(BIT_N, regs.H & 0x80); @@ -1101,37 +1220,57 @@ if (code == 0x45) { regs.H = fetch(); + tick(1); regs.X = fetch(); + tick(1); } else if (code == 0x55) { ea = fetch(); + tick(1); regs.H = get1(ea); + tick(1); regs.X = get1(ea+1); + tick(1); } else if ((code == 0x32) && (type == CPU_HCS08)) { ea = fetch2(); + tick(2); regs.H = get1(ea); + tick(1); regs.X = get1(ea+1); + tick(1); } else if (prefix && (code == 0xae) && (type == CPU_HCS08)) { ea = (regs.H << 8) | regs.X; + tick(1); regs.H = get1(ea); + tick(1); regs.X = get1(ea+1); + tick(1); } else if (prefix && (code == 0xbe) && (type == CPU_HCS08)) { ea = ((regs.H << 8) | regs.X) + fetch2(); + tick(2); regs.H = get1(ea); + tick(1); regs.X = get1(ea+1); + tick(1); } else if (prefix && (code == 0xce) && (type == CPU_HCS08)) { ea = ((regs.H << 8) | regs.X) + fetch(); + tick(1); regs.H = get1(ea); + tick(1); regs.X = get1(ea+1); + tick(1); } else if (prefix && (code == 0xfe) && (type == CPU_HCS08)) { ea = regs.SP + fetch(); + tick(1); regs.H = get1(ea); + tick(1); regs.X = get1(ea+1); + tick(1); } else return(resHALT); @@ -1153,18 +1292,28 @@ if (code == 0x65) { operand = fetch2(); + tick(2); } else if (code == 0x75) { ea = fetch(); + tick(1); operand = (get1(ea) << 8) | get1(ea+1); + tick(2); + tick(1); } else if ((code == 0x3e) && (type == CPU_HCS08)) { ea = fetch2(); + tick(2); operand = (get1(ea) << 8) | get1(ea+1); + tick(2); + tick(1); } else if (prefix && (code == 0xf3) && (type == CPU_HCS08)) { ea = ((unsigned char)fetch())+regs.SP; + tick(1); operand = (get1(ea) << 8) | get1(ea+1); + tick(2); + tick(1); } else return(resHALT); @@ -1176,7 +1325,7 @@ FLAG_ASSIGN (BIT_C, 0x10000 & result); FLAG_ASSIGN(BIT_N, result & 0x8000); FLAG_ASSIGN(BIT_Z, !(result & 0xffff)); - + return(resGO); } @@ -1184,12 +1333,18 @@ cl_hc08::inst_swi(t_mem code, bool prefix) { push2(PC); + tick(2); push1(regs.X); + tick(1); push1(regs.A); + tick(1); push1(regs.P); + tick(1); FLAG_CLEAR(BIT_I); - + PC = get2(0xfffc); + tick(2); + tick(3); return(resGO); } diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/pobj.cc sdcc-3.2.0+dfsg/sim/ucsim/pobj.cc --- sdcc-3.1.0+dfsg/sim/ucsim/pobj.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/pobj.cc 2012-05-13 10:47:19.000000000 +0000 @@ -2,7 +2,7 @@ * Simulator of microcontrollers (pobj.cc) * * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. - * + * * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu * */ @@ -42,7 +42,7 @@ * */ -/* +/* * Initializing the object */ @@ -54,7 +54,7 @@ } -/* +/* * Destructing the object: calling hte virtual Done method */ @@ -157,7 +157,7 @@ { char *s; s= (char*)malloc(strlen(get_name("?"))+100); - sprintf(s, "childs of %s", get_name("?")); + sprintf(s, "children of %s", get_name("?")); children= new cl_list(1, 1, s); free(s); } @@ -261,7 +261,7 @@ * */ -/* +/* * Initializing a collection */ @@ -277,7 +277,7 @@ } -/* +/* * Disposing object's variables */ @@ -292,14 +292,14 @@ * Get indexed item from the collection */ -void * +/*void * cl_list::at(t_index index) { if (index < 0 || index >= count) error(1, index); return(Items[index]); -} +}*/ class cl_base * cl_list::object_at(t_index index) @@ -316,7 +316,7 @@ if (index < 0 || index >= count) error(1, 0); - return(Items[index]); + return(Items[index]); }*/ @@ -359,7 +359,7 @@ } -/* +/* * Deleting all the items from the collection but not disposing them */ @@ -426,7 +426,7 @@ } -/* +/* * Put a new item to the collection. This function replaces an existing * item with a new one but it does not delete or dispose the old item! */ @@ -440,21 +440,21 @@ } -/* +/* * Action taken when an error occure */ void cl_list::error(t_index code, t_index info) { - fprintf(stderr, + fprintf(stderr, "Collection index error. Code= %d, Info= %d.\n", code, info); exit(code); } -/* +/* * Iterator method. This function calls 'Test' using every items as Test's * argument until Test returns TRUE. */ @@ -470,7 +470,7 @@ } -/* +/* * Iterator method. This function calls 'Action' using every items as * Action's argument. */ @@ -483,7 +483,7 @@ } -/* +/* * Disposing an item. */ @@ -494,7 +494,7 @@ } -/* +/* * Get the number of collected items. */ @@ -525,7 +525,7 @@ } -/* +/* * Returning the index of an item. */ @@ -566,7 +566,7 @@ } -/* +/* * Inserting a new item to the collection. */ @@ -597,7 +597,7 @@ } -/* +/* * Iterator method. This function calls 'Test' using every items * (in reversed order) as Test's argument until Test returns TRUE. */ @@ -673,7 +673,7 @@ * */ -/* +/* * Initilizing the sorted collection */ @@ -687,7 +687,7 @@ cl_sorted_list::~cl_sorted_list(void) {} -/* +/* * Get the address of the key field in an item. */ @@ -698,7 +698,7 @@ } -/* +/* * Get index of an item. */ @@ -751,7 +751,7 @@ t_index l = 0; t_index h = count - 1; bool res= DD_FALSE; - + while (l <= h) { t_index i= (l + h) >> 1; @@ -780,7 +780,7 @@ * */ -/* +/* * Initilizing the string collection */ @@ -794,7 +794,7 @@ cl_strings::~cl_strings(void) {} -/* +/* * Comapare two string from the collection */ @@ -805,7 +805,7 @@ } -/* +/* * Deallocate string item of the collection */ @@ -846,7 +846,7 @@ } -/* +/* * Searching an item using linear search. */ diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/pobjcl.h sdcc-3.2.0+dfsg/sim/ucsim/pobjcl.h --- sdcc-3.1.0+dfsg/sim/ucsim/pobjcl.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/pobjcl.h 2012-05-13 10:47:19.000000000 +0000 @@ -2,7 +2,7 @@ * Simulator of microcontrollers (pobjcl.h) * * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. - * + * * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu * */ @@ -14,12 +14,12 @@ 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. - + UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA @@ -95,7 +95,7 @@ public: cl_event(enum event what_event); virtual ~cl_event(void); - + bool is_handled(void) { return(handled); } virtual void handle(void) { handled= DD_TRUE; } }; @@ -121,7 +121,12 @@ cl_list(t_index alimit, t_index adelta, const char *aname); virtual ~cl_list(void); - void *at(t_index index); + inline void *at(t_index index) + { + if (index < 0 || index >= count) + error(1, index); + return (Items[index]); + } class cl_base *object_at(t_index index); virtual t_index index_of(void *item); virtual bool index_of(void *item, t_index *idx); @@ -169,7 +174,7 @@ public: cl_sorted_list(t_index alimit, t_index adelta, const char *aname); virtual ~cl_sorted_list(void); - + virtual bool search(const void *key, t_index& index); virtual t_index index_of(void *item); virtual t_index add(void *item); @@ -191,7 +196,7 @@ public: cl_strings(t_index alimit, t_index adelta, const char *aname); virtual ~cl_strings(void); - + private: virtual int compare(const void *key1, const void *key2); virtual void free_item(void *item); @@ -210,7 +215,7 @@ public: cl_ustrings(t_index alimit, t_index adelta, const char *aname); virtual ~cl_ustrings(void); - + private: virtual int compare(const void *key1, const void *key2); virtual bool search(const void *key, t_index &index); diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/s51.src/regs51.h sdcc-3.2.0+dfsg/sim/ucsim/s51.src/regs51.h --- sdcc-3.1.0+dfsg/sim/ucsim/s51.src/regs51.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/s51.src/regs51.h 2012-05-13 10:47:19.000000000 +0000 @@ -74,6 +74,7 @@ #define DPX 0x93 /* Data Pointer HHigh byte */ #define DPX1 0x95 /* Data Pointer HHigh byte */ #define ESP 0x9b /* Extended Stack Pointer */ +#define AP 0x9c /* Address Page */ #define ACON 0x9d /* */ #define P5 0xa1 #define P5CNT 0xa2 /* */ diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/s51.src/uc390.cc sdcc-3.2.0+dfsg/sim/ucsim/s51.src/uc390.cc --- sdcc-3.1.0+dfsg/sim/ucsim/s51.src/uc390.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/s51.src/uc390.cc 2012-05-13 10:47:19.000000000 +0000 @@ -220,7 +220,7 @@ { 0xa0, 0xff, ' ', 2, "ORL C,/%b"}, { 0xa1, 0xff, 'A', 3, "AJMP %A"}, { 0xa2, 0xff, ' ', 2, "MOV C,%b"}, - { 0xa3, 0xff, ' ', 1, "INC DPTR"}, + { 0xa3, 0xff, ' ', 1, "%i DPTR"}, { 0xa4, 0xff, ' ', 1, "MUL AB"}, { 0xa5, 0xff, '_', 1, "-"}, { 0xa6, 0xff, ' ', 2, "MOV @R0,%a"}, @@ -561,7 +561,7 @@ { ulong dptr; - uchar pl, ph, px, dps; + uchar pl, ph, px, dps, dec; dps = sfr->get (DPS); if (dps & 0x01) @@ -569,18 +569,20 @@ pl = DPL1; ph = DPH1; px = DPX1; + dec = 0x80; } else { pl = DPL; ph = DPH; px = DPX; + dec = 0x040; } dptr = sfr->read (ph) * 256 + sfr->read (pl); if (sfr->get (ACON) & 0x02) /* AM1 set: 24-bit flat? */ dptr += sfr->read (px) *256*256; - if (dps & 0x80) /* decr set */ + if (dps & dec) /* decr set */ dptr--; else dptr++; @@ -1087,6 +1089,7 @@ const char *b; char *buf, *p, *t; t_mem code; + uchar dps; if (! (sfr->get (ACON) & 0x02)) /* AM1 set: 24-bit flat? */ return cl_51core::disass (addr, sep); @@ -1101,18 +1104,18 @@ b++; switch (*(b++)) { - case 'A': // absolute address - // stock: - // sprintf (temp, "%04lx", - // (addr & 0xf800)| - // (((code >> 5) & 0x07) * 256 + - // rom->get (addr + 1))); - - sprintf (temp, "%06lx", - (addr & 0xf80000L) | - (((code >> 5) & 0x07) * (256 * 256) + - (rom->get (addr + 1) * 256) + - rom->get (addr + 2))); + case 'A': // absolute address + // stock: + // sprintf (temp, "%04lx", + // (addr & 0xf800)| + // (((code >> 5) & 0x07) * 256 + + // rom->get (addr + 1))); + + sprintf (temp, "%06lx", + (addr & 0xf80000L) | + (((code >> 5) & 0x07) * (256 * 256) + + (rom->get (addr + 1) * 256) + + rom->get (addr + 2))); break; case 'l': // long address sprintf (temp, "%06lx", @@ -1122,8 +1125,8 @@ // rom->get (addr + 1) * 256 + rom->get (addr + 2)); break; case 'a': // addr8 (direct address) at 2nd byte - if (!get_name (rom->get (addr + 1), sfr_tbl (), temp)) - sprintf (temp, "%02"_M_"x", rom->get (addr + 1)); + if (!get_name (rom->get (addr + 1), sfr_tbl (), temp)) + sprintf (temp, "%02"_M_"x", rom->get (addr + 1)); break; case '8': // addr8 (direct address) at 3rd byte if (!get_name (rom->get (addr + 2), sfr_tbl (), temp)) @@ -1159,6 +1162,10 @@ case 'D': // data8 at 3rd byte sprintf (temp, "%02"_M_"x", rom->get (addr + 2)); break; + case 'i': // inc/dec dptr + dps = sfr->get(DPS); + sprintf (temp, ((dps & 0x01) ? (dps & 0x80) : (dps & 0x40)) ? "DEC" : "INC"); + break; default: strcpy (temp, "?"); break; @@ -1200,6 +1207,7 @@ { t_addr start; t_mem data; + uchar dps; if (! (sfr->get (ACON) & 0x02)) /* AM1 set: 24-bit flat? */ { @@ -1211,21 +1219,30 @@ iram->dump (start, start + 7, 8, con); start = sfr->get (PSW) & 0x18; data = iram->get (iram->get (start)); - con->dd_printf("%06x %02x %c", + con->dd_printf ("%06x %02x %c", iram->get (start), data, isprint (data) ? data : '.'); - con->dd_printf(" ACC= 0x%02x %3d %c B= 0x%02x", - sfr->get (ACC), sfr->get (ACC), - isprint (sfr->get (ACC)) ? - (sfr->get (ACC)) : '.', sfr->get (B)); + con->dd_printf (" ACC= 0x%02x %3d %c B= 0x%02x", + sfr->get (ACC), sfr->get (ACC), + isprint (sfr->get (ACC)) ? + (sfr->get (ACC)) : '.', sfr->get (B)); eram2xram (); + dps = sfr->get(DPS); data = get_mem (MEM_XRAM_ID, sfr->get (DPX) * 256*256 + sfr->get (DPH) * 256 + sfr->get (DPL)); - con->dd_printf (" DPTR= 0x%02x%02x%02x @DPTR= 0x%02x %3d %c\n", + con->dd_printf (" %cDPTR0= 0x%02x%02x%02x @DPTR0= 0x%02x %3d %c", + dps & 0x01 ? ' ' : dps & 0x20 ? 't' : '*', sfr->get (DPX), sfr->get (DPH), sfr->get (DPL), data, data, isprint (data) ? data : '.'); + data = get_mem (MEM_XRAM_ID, + sfr->get (DPX1) * 256*256 + sfr->get (DPH1) * 256 + sfr->get (DPL1)); + con->dd_printf (" %cDPTR1= 0x%02x%02x%02x @DPTR1= 0x%02x %3d %c\n", + dps & 0x01 ? dps & 0x20 ? 't' : '*' : ' ', + sfr->get (DPX1), sfr->get (DPH1), sfr->get (DPL1), + data, data, isprint (data) ? data : '.'); data = iram->get (iram->get (start + 1)); con->dd_printf ("%06x %02x %c", iram->get (start + 1), data, isprint (data) ? data : '.'); + con->dd_printf (" AP= 0x%02x", sfr->get (AP)); data= sfr->get (PSW); con->dd_printf (" PSW= 0x%02x CY=%c AC=%c OV=%c P=%c ", data, diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/stypes.h sdcc-3.2.0+dfsg/sim/ucsim/stypes.h --- sdcc-3.1.0+dfsg/sim/ucsim/stypes.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/stypes.h 2012-05-15 03:59:44.000000000 +0000 @@ -92,8 +92,10 @@ #define CPU_Z80 0x0001 #define CPU_Z180 0x0002 -#define CPU_R2K 0x0004 -#define CPU_ALL_Z80 (CPU_Z80|CPU_Z180|CPU_R2K) +#define CPU_LR35902 0x0004 +#define CPU_R2K 0x0008 +#define CPU_R3KA 0x0010 +#define CPU_ALL_Z80 (CPU_Z80|CPU_Z180|CPU_R2K|CPU_LR35902|CPU_R3KA) #define CPU_XA 0x0001 #define CPU_ALL_XA (CPU_XA) diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/utils.cc sdcc-3.2.0+dfsg/sim/ucsim/utils.cc --- sdcc-3.1.0+dfsg/sim/ucsim/utils.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/utils.cc 2011-11-28 19:54:35.000000000 +0000 @@ -142,7 +142,7 @@ name= o->get_name(); if (name && *name) return(name); - return("(unkown)"); + return("(unknown)"); } diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/z80.src/Makefile.in sdcc-3.2.0+dfsg/sim/ucsim/z80.src/Makefile.in --- sdcc-3.1.0+dfsg/sim/ucsim/z80.src/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/z80.src/Makefile.in 2012-01-10 04:32:27.000000000 +0000 @@ -56,6 +56,7 @@ inst_ddcb.o \ inst_fdcb.o \ glob_r2k.o inst_r2k.o inst_ed_r2k.o r2k.o \ + glob_lr35902.o inst_lr35902.o lr35902.o \ simz80.o z80.o OBJECTS_EXE = sz80.o OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE) diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/z80.src/glob.cc sdcc-3.2.0+dfsg/sim/ucsim/z80.src/glob.cc --- sdcc-3.1.0+dfsg/sim/ucsim/z80.src/glob.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/z80.src/glob.cc 2012-01-10 04:32:27.000000000 +0000 @@ -77,7 +77,7 @@ { 0x001b, 0x00ff, ' ', 1, "DEC DE" }, { 0x001c, 0x00ff, ' ', 1, "INC E" }, { 0x001d, 0x00ff, ' ', 1, "DEC E" }, - { 0x001e, 0x00ff, ' ', 2, "LD E" }, + { 0x001e, 0x00ff, ' ', 2, "LD E,%b" }, { 0x001f, 0x00ff, ' ', 1, "RRA" }, { 0x0020, 0x00ff, 'R', 2, "JR NZ,%d" }, @@ -106,8 +106,8 @@ { 0x0031, 0x00ff, ' ', 3, "LD SP,%w" }, { 0x0032, 0x00ff, ' ', 3, "LD (%w),A" }, { 0x0033, 0x00ff, ' ', 1, "INC SP" }, - { 0x0034, 0x00ff, ' ', 1, "INC HL" }, - { 0x0035, 0x00ff, ' ', 1, "DEC HL" }, + { 0x0034, 0x00ff, ' ', 1, "INC (HL)" }, + { 0x0035, 0x00ff, ' ', 1, "DEC (HL)" }, { 0x0036, 0x00ff, ' ', 2, "LD (HL),%b" }, { 0x0037, 0x00ff, ' ', 1, "SCF" }, diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/z80.src/glob.h sdcc-3.2.0+dfsg/sim/ucsim/z80.src/glob.h --- sdcc-3.1.0+dfsg/sim/ucsim/z80.src/glob.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/z80.src/glob.h 2012-01-10 04:32:27.000000000 +0000 @@ -49,6 +49,9 @@ extern struct dis_entry disass_r2k_ddcb[]; extern struct dis_entry disass_r2k_fdcb[]; +extern struct dis_entry disass_lr35902[]; +extern struct dis_entry disass_lr35902_cb[]; + #endif /* End of z80.src/glob.h */ diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/z80.src/glob_lr35902.cc sdcc-3.2.0+dfsg/sim/ucsim/z80.src/glob_lr35902.cc --- sdcc-3.1.0+dfsg/sim/ucsim/z80.src/glob_lr35902.cc 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/z80.src/glob_lr35902.cc 2012-01-10 04:32:27.000000000 +0000 @@ -0,0 +1,596 @@ +/* + * Disassembly table for LR35902, a Z-80 derivative used + * by the Gameboy (glob_lr35902.cc) + * + */ +/* Derived from z80 glob.cc by Leland Morrison 2011 */ + +/* This file is part of microcontroller simulator: ucsim. + + UCSIM 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. + + UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ +/*@1@*/ +#include + +#include "stypes.h" + +#define DISASS_NAME(X) disass_lr35902##X + + +/* +%d - signed compl.,byte jump +%w - 2-byte jump or imm. value +%b - byte imm. value + */ +/* uint code, mask; char branch; uchar length; char *mnemonic; */ + +struct dis_entry DISASS_NAME() []= { + { 0x0000, 0x00ff, ' ', 1, "NOP" }, + { 0x0001, 0x00ff, ' ', 3, "LD BC,%w" }, + { 0x0002, 0x00ff, ' ', 1, "LD (BC),A" }, + { 0x0003, 0x00ff, ' ', 1, "INC BC" }, + { 0x0004, 0x00ff, ' ', 1, "INC B" }, + { 0x0005, 0x00ff, ' ', 1, "DEC B" }, + { 0x0006, 0x00ff, ' ', 2, "LD b,%b" }, + { 0x0007, 0x00ff, ' ', 1, "RLCA" }, + + { 0x0008, 0x00ff, ' ', 3, "LD (%w),SP" }, // unique to LR35902 + { 0x0009, 0x00ff, ' ', 1, "ADD HL,BC" }, + { 0x000a, 0x00ff, ' ', 1, "LD A,(BC)" }, + { 0x000b, 0x00ff, ' ', 1, "DEC BC" }, + { 0x000c, 0x00ff, ' ', 1, "INC C" }, + { 0x000d, 0x00ff, ' ', 1, "DEC C" }, + { 0x000e, 0x00ff, ' ', 2, "LD C,%b" }, + { 0x000f, 0x00ff, ' ', 1, "RRCA" }, + +#if 1 + { 0x0010, 0x00ff, ' ', 2, "STOP 0" }, // unique to LR35902 +#else + { 0x0010, 0x00ff, 'R', 2, "DJNZ %d" }, +#endif + { 0x0011, 0x00ff, ' ', 3, "LD DE,%w" }, + { 0x0012, 0x00ff, ' ', 1, "LD (DE),A" }, + { 0x0013, 0x00ff, ' ', 1, "INC DE" }, + { 0x0014, 0x00ff, ' ', 1, "INC D" }, + { 0x0015, 0x00ff, ' ', 1, "DEC D" }, + { 0x0016, 0x00ff, ' ', 2, "LD D,%b" }, + { 0x0017, 0x00ff, ' ', 1, "RLA" }, + + { 0x0018, 0x00ff, 'R', 2, "JR %d" }, + { 0x0019, 0x00ff, ' ', 3, "ADD HL,DE" }, + { 0x001a, 0x00ff, ' ', 1, "LD A,(DE)" }, + { 0x001b, 0x00ff, ' ', 1, "DEC DE" }, + { 0x001c, 0x00ff, ' ', 1, "INC E" }, + { 0x001d, 0x00ff, ' ', 1, "DEC E" }, + { 0x001e, 0x00ff, ' ', 2, "LD E,%b" }, + { 0x001f, 0x00ff, ' ', 1, "RRA" }, + + { 0x0020, 0x00ff, 'R', 2, "JR NZ,%d" }, + { 0x0021, 0x00ff, ' ', 3, "LD HL,%w" }, + { 0x0022, 0x00ff, ' ', 1, "LDI (HL),A" },// unique to LR35902 + { 0x0023, 0x00ff, ' ', 1, "INC HL" }, + { 0x0024, 0x00ff, ' ', 1, "INC H" }, + { 0x0025, 0x00ff, ' ', 1, "DEC H" }, + { 0x0026, 0x00ff, ' ', 2, "LD H,%b" }, + { 0x0027, 0x00ff, ' ', 1, "DAA" }, + + { 0x0028, 0x00ff, 'R', 2, "JR Z,%d" }, + { 0x0029, 0x00ff, ' ', 1, "ADD HL,HL" }, + { 0x002a, 0x00ff, ' ', 1, "LDI A,(HL)" },// unique to LR35902 + { 0x002b, 0x00ff, ' ', 1, "DEC HL" }, + { 0x002c, 0x00ff, ' ', 1, "INC L" }, + { 0x002d, 0x00ff, ' ', 1, "DEC L" }, + { 0x002e, 0x00ff, ' ', 2, "LD L, %b" }, + { 0x002f, 0x00ff, ' ', 1, "CPL" }, + + { 0x0030, 0x00ff, 'R', 2, "JR NC,%d" }, + { 0x0031, 0x00ff, ' ', 3, "LD SP,%w" }, + { 0x0032, 0x00ff, ' ', 1, "LDD (HL),A" }, // unique to LR35902 + { 0x0033, 0x00ff, ' ', 1, "INC SP" }, + { 0x0034, 0x00ff, ' ', 1, "INC (HL)" }, + { 0x0035, 0x00ff, ' ', 1, "DEC (HL)" }, + { 0x0036, 0x00ff, ' ', 2, "LD (HL),%b" }, + { 0x0037, 0x00ff, ' ', 1, "SCF" }, + + { 0x0038, 0x00ff, 'R', 2, "JR C,%d" }, + { 0x0039, 0x00ff, ' ', 1, "ADD HL,SP" }, + { 0x003a, 0x00ff, ' ', 1, "LDD A,(HL)" }, // unique to LR35902 + { 0x003b, 0x00ff, ' ', 1, "DEC SP" }, + { 0x003c, 0x00ff, ' ', 1, "INC A" }, + { 0x003d, 0x00ff, ' ', 1, "DEC A" }, + { 0x003e, 0x00ff, ' ', 2, "LD A,%b" }, + { 0x003f, 0x00ff, ' ', 1, "CCF" }, + + { 0x0040, 0x00ff, ' ', 1, "LD B,B" }, + { 0x0041, 0x00ff, ' ', 1, "LD B,C" }, + { 0x0042, 0x00ff, ' ', 1, "LD B,D" }, + { 0x0043, 0x00ff, ' ', 1, "LD B,E" }, + { 0x0044, 0x00ff, ' ', 1, "LD B,H" }, + { 0x0045, 0x00ff, ' ', 1, "LD B,L" }, + { 0x0046, 0x00ff, ' ', 1, "LD B,(HL)" }, + { 0x0047, 0x00ff, ' ', 1, "LD B,a" }, + + { 0x0048, 0x00ff, ' ', 1, "LD C,B" }, + { 0x0049, 0x00ff, ' ', 1, "LD C,C" }, + { 0x004a, 0x00ff, ' ', 1, "LD C,D" }, + { 0x004b, 0x00ff, ' ', 1, "LD C,E" }, + { 0x004c, 0x00ff, ' ', 1, "LD C,H" }, + { 0x004d, 0x00ff, ' ', 1, "LD C,L" }, + { 0x004e, 0x00ff, ' ', 1, "LD C,(HL)" }, + { 0x004f, 0x00ff, ' ', 1, "LD C,A" }, + + { 0x0050, 0x00ff, ' ', 1, "LD D,B" }, + { 0x0051, 0x00ff, ' ', 1, "LD D,C" }, + { 0x0052, 0x00ff, ' ', 1, "LD D,D" }, + { 0x0053, 0x00ff, ' ', 1, "LD D,E" }, + { 0x0054, 0x00ff, ' ', 1, "LD D,H" }, + { 0x0055, 0x00ff, ' ', 1, "LD D,L" }, + { 0x0056, 0x00ff, ' ', 1, "LD D,(HL)" }, + { 0x0057, 0x00ff, ' ', 1, "LD D,A" }, + + { 0x0058, 0x00ff, ' ', 1, "LD E,B" }, + { 0x0059, 0x00ff, ' ', 1, "LD E,C" }, + { 0x005a, 0x00ff, ' ', 1, "LD E,D" }, + { 0x005b, 0x00ff, ' ', 1, "LD E,E" }, + { 0x005c, 0x00ff, ' ', 1, "LD E,H" }, + { 0x005d, 0x00ff, ' ', 1, "LD E,L" }, + { 0x005e, 0x00ff, ' ', 1, "LD E,(HL)" }, + { 0x005f, 0x00ff, ' ', 1, "LD E,A" }, + + { 0x0060, 0x00ff, ' ', 1, "LD H,B" }, + { 0x0061, 0x00ff, ' ', 1, "LD H,C" }, + { 0x0062, 0x00ff, ' ', 1, "LD H,D" }, + { 0x0063, 0x00ff, ' ', 1, "LD H,E" }, + { 0x0064, 0x00ff, ' ', 1, "LD H,H" }, + { 0x0065, 0x00ff, ' ', 1, "LD H,L" }, + { 0x0066, 0x00ff, ' ', 1, "LD H,(HL)" }, + { 0x0067, 0x00ff, ' ', 1, "LD H,A" }, + + { 0x0068, 0x00ff, ' ', 1, "LD L,B" }, + { 0x0069, 0x00ff, ' ', 1, "LD L,C" }, + { 0x006a, 0x00ff, ' ', 1, "LD L,D" }, + { 0x006b, 0x00ff, ' ', 1, "LD L,E" }, + { 0x006c, 0x00ff, ' ', 1, "LD L,H" }, + { 0x006d, 0x00ff, ' ', 1, "LD L,L" }, + { 0x006e, 0x00ff, ' ', 1, "LD L,(HL)" }, + { 0x006f, 0x00ff, ' ', 1, "LD L,A" }, + + { 0x0070, 0x00ff, ' ', 1, "LD (HL),B" }, + { 0x0071, 0x00ff, ' ', 1, "LD (HL),C" }, + { 0x0072, 0x00ff, ' ', 1, "LD (HL),D" }, + { 0x0073, 0x00ff, ' ', 1, "LD (HL),E" }, + { 0x0074, 0x00ff, ' ', 1, "LD (HL),H" }, + { 0x0075, 0x00ff, ' ', 1, "LD (HL),L" }, + { 0x0076, 0x00ff, ' ', 1, "HALT" }, + { 0x0077, 0x00ff, ' ', 1, "LD (HL),A" }, + + { 0x0078, 0x00ff, ' ', 1, "LD A,B" }, + { 0x0079, 0x00ff, ' ', 1, "LD A,C" }, + { 0x007a, 0x00ff, ' ', 1, "LD A,D" }, + { 0x007b, 0x00ff, ' ', 1, "LD A,E" }, + { 0x007c, 0x00ff, ' ', 1, "LD A,H" }, + { 0x007d, 0x00ff, ' ', 1, "LD A,L" }, + { 0x007e, 0x00ff, ' ', 1, "LD A,(HL)" }, + { 0x007f, 0x00ff, ' ', 1, "LD A,A" }, + + { 0x0080, 0x00ff, ' ', 1, "ADD A,B" }, + { 0x0081, 0x00ff, ' ', 1, "ADD A,C" }, + { 0x0082, 0x00ff, ' ', 1, "ADD A,D" }, + { 0x0083, 0x00ff, ' ', 1, "ADD A,E" }, + { 0x0084, 0x00ff, ' ', 1, "ADD A,H" }, + { 0x0085, 0x00ff, ' ', 1, "ADD A,L" }, + { 0x0086, 0x00ff, ' ', 1, "ADD A,(HL)" }, + { 0x0087, 0x00ff, ' ', 1, "ADD A,A" }, + + { 0x0088, 0x00ff, ' ', 1, "ADC A,B" }, + { 0x0089, 0x00ff, ' ', 1, "ADC A,C" }, + { 0x008a, 0x00ff, ' ', 1, "ADC A,D" }, + { 0x008b, 0x00ff, ' ', 1, "ADC A,E" }, + { 0x008c, 0x00ff, ' ', 1, "ADC A,H" }, + { 0x008d, 0x00ff, ' ', 1, "ADC A,L" }, + { 0x008e, 0x00ff, ' ', 1, "ADC A,(HL)" }, + { 0x008f, 0x00ff, ' ', 1, "ADC A,A" }, + + { 0x0090, 0x00ff, ' ', 1, "SUB A,B"}, + { 0x0091, 0x00ff, ' ', 1, "SUB A,C"}, + { 0x0092, 0x00ff, ' ', 1, "SUB A,D"}, + { 0x0093, 0x00ff, ' ', 1, "SUB A,E"}, + { 0x0094, 0x00ff, ' ', 1, "SUB A,H"}, + { 0x0095, 0x00ff, ' ', 1, "SUB A,L"}, + { 0x0096, 0x00ff, ' ', 1, "SUB A,(HL)"}, + { 0x0097, 0x00ff, ' ', 1, "SUB A,A"}, + + { 0x0098, 0x00ff, ' ', 1, "SBC A,B" }, + { 0x0099, 0x00ff, ' ', 1, "SBC A,C" }, + { 0x009a, 0x00ff, ' ', 1, "SBC A,D" }, + { 0x009b, 0x00ff, ' ', 1, "SBC A,E" }, + { 0x009c, 0x00ff, ' ', 1, "SBC A,H" }, + { 0x009d, 0x00ff, ' ', 1, "SBC A,L" }, + { 0x009e, 0x00ff, ' ', 1, "SBC A,(HL)" }, + { 0x009f, 0x00ff, ' ', 1, "SBC A,A" }, + + { 0x00a0, 0x00ff, ' ', 1, "AND B" }, + { 0x00a1, 0x00ff, ' ', 1, "AND C" }, + { 0x00a2, 0x00ff, ' ', 1, "AND D" }, + { 0x00a3, 0x00ff, ' ', 1, "AND E" }, + { 0x00a4, 0x00ff, ' ', 1, "AND H" }, + { 0x00a5, 0x00ff, ' ', 1, "AND L" }, + { 0x00a6, 0x00ff, ' ', 1, "AND (HL)" }, + { 0x00a7, 0x00ff, ' ', 1, "AND A" }, + + { 0x00a8, 0x00ff, ' ', 1, "XOR B" }, + { 0x00a9, 0x00ff, ' ', 1, "XOR C" }, + { 0x00aa, 0x00ff, ' ', 1, "XOR D" }, + { 0x00ab, 0x00ff, ' ', 1, "XOR E" }, + { 0x00ac, 0x00ff, ' ', 1, "XOR H" }, + { 0x00ad, 0x00ff, ' ', 1, "XOR L" }, + { 0x00ae, 0x00ff, ' ', 1, "XOR (HL)" }, + { 0x00af, 0x00ff, ' ', 1, "XOR A" }, + + { 0x00b0, 0x00ff, ' ', 1, "OR B" }, + { 0x00b1, 0x00ff, ' ', 1, "OR C" }, + { 0x00b2, 0x00ff, ' ', 1, "OR D" }, + { 0x00b3, 0x00ff, ' ', 1, "OR E" }, + { 0x00b4, 0x00ff, ' ', 1, "OR H" }, + { 0x00b5, 0x00ff, ' ', 1, "OR L" }, + { 0x00b6, 0x00ff, ' ', 1, "OR (HL)" }, + { 0x00b7, 0x00ff, ' ', 1, "OR A" }, + + { 0x00b8, 0x00ff, ' ', 1, "CP B" }, + { 0x00b9, 0x00ff, ' ', 1, "CP C" }, + { 0x00ba, 0x00ff, ' ', 1, "CP D" }, + { 0x00bb, 0x00ff, ' ', 1, "CP E" }, + { 0x00bc, 0x00ff, ' ', 1, "CP H" }, + { 0x00bd, 0x00ff, ' ', 1, "CP L" }, + { 0x00be, 0x00ff, ' ', 1, "CP (HL)" }, + { 0x00bf, 0x00ff, ' ', 1, "CP A" }, + + { 0x00c0, 0x00ff, ' ', 1, "RET NZ" }, + { 0x00c1, 0x00ff, ' ', 1, "POP BC" }, + { 0x00c2, 0x00ff, 'A', 3, "JP NZ, %w" }, + { 0x00c3, 0x00ff, 'A', 3, "JP %w" }, + { 0x00c4, 0x00ff, 'l', 3, "CALL NZ,%w" }, + { 0x00c5, 0x00ff, ' ', 1, "PUSH BC" }, + { 0x00c6, 0x00ff, ' ', 2, "ADD A,%b" }, + { 0x00c7, 0x00ff, ' ', 1, "RST 0" }, + + { 0x00c8, 0x00ff, ' ', 1, "RET Z" }, + { 0x00c9, 0x00ff, ' ', 1, "RET" }, + { 0x00ca, 0x00ff, 'A', 3, "JP Z,%w" }, + { 0x00cb, 0x00ff, ' ', 2, "?cb?" }, /* ESC code to lots of op-codes, all 2-byte */ + + { 0x00cc, 0x00ff, 'l', 3, "CALL Z,%w" }, + { 0x00cd, 0x00ff, 'l', 3, "CALL %w" }, + { 0x00ce, 0x00ff, ' ', 2, "ADC A,%b" }, + { 0x00cf, 0x00ff, ' ', 1, "RST 8" }, + + { 0x00d0, 0x00ff, ' ', 1, "RET NC" }, + { 0x00d1, 0x00ff, ' ', 1, "POP DE" }, + { 0x00d2, 0x00ff, 'A', 3, "JP NC,%w" }, + { 0x00d3, 0x00ff, ' ', 2, "Illegal Op" }, // in/out do not exist on LR35902 + { 0x00d4, 0x00ff, 'l', 3, "CALL NC,%w" }, + { 0x00d5, 0x00ff, ' ', 1, "PUSH DE" }, + { 0x00d6, 0x00ff, ' ', 2, "sub %b" }, + { 0x00d7, 0x00ff, ' ', 1, "RST 10H" }, + + { 0x00d8, 0x00ff, ' ', 1, "RET C" }, + { 0x00d9, 0x00ff, ' ', 1, "RETI" }, // unique to LR35902 + { 0x00da, 0x00ff, 'A', 3, "JP C,%w" }, + { 0x00db, 0x00ff, ' ', 2, "Illegal Op" }, // in/out do not exist on LR35902 + { 0x00dc, 0x00ff, 'l', 3, "CALL C,%w" }, + { 0x00dd, 0x00ff, ' ', 2, "Illegal Op" }, /* 0xdd - ESC codes,about 284, vary lengths, IX centric */ + { 0x00de, 0x00ff, ' ', 2, "SBC A,%b" }, + { 0x00df, 0x00ff, ' ', 1, "RST 18H" }, + + { 0x00e0, 0x00ff, ' ', 2, "LDH (0xFF00+%b),A" }, // unique to LR35902 + { 0x00e1, 0x00ff, ' ', 1, "POP HL" }, + { 0x00e2, 0x00ff, 'A', 2, "LD (0xFF00+C),A" }, // unique to LR35902 + { 0x00e3, 0x00ff, ' ', 1, "Illegal Op" }, + { 0x00e4, 0x00ff, 'l', 1, "Illegal Op" }, + { 0x00e5, 0x00ff, ' ', 1, "PUSH HL" }, + { 0x00e6, 0x00ff, ' ', 2, "AND %b" }, + { 0x00e7, 0x00ff, ' ', 1, "RST 20H" }, + + { 0x00e8, 0x00ff, ' ', 2, "ADD SP,%d" }, // unique to LR35902 + { 0x00e9, 0x00ff, 'A', 1, "JP (HL)" }, + { 0x00ea, 0x00ff, ' ', 3, "LD (%w),A" }, // unique to LR35902 + { 0x00eb, 0x00ff, ' ', 1, "Illegal Op" }, + { 0x00ec, 0x00ff, 'l', 1, "Illegal Op" }, + { 0x00ed, 0x00ff, ' ', 1, "Illegal Op" }, + { 0x00ee, 0x00ff, ' ', 2, "XOR %b" }, + { 0x00ef, 0x00ff, ' ', 1, "RST 28H" }, + + { 0x00f0, 0x00ff, ' ', 2, "LDH A,(0xFF00+%b)" }, // unique to LR35902 + { 0x00f1, 0x00ff, ' ', 1, "POP AF" }, + { 0x00f2, 0x00ff, ' ', 2, "LD A,(0xFF00+C)" }, // unique to LR35902 + { 0x00f3, 0x00ff, ' ', 1, "DI" }, + { 0x00f4, 0x00ff, 'l', 3, "Illegal Op" }, + { 0x00f5, 0x00ff, ' ', 1, "PUSH AF" }, + { 0x00f6, 0x00ff, ' ', 2, "OR %b" }, + { 0x00f7, 0x00ff, ' ', 1, "RST 30H" }, + + { 0x00f8, 0x00ff, ' ', 2, "LD HL,SP+%d" }, // unique to LR35902 + { 0x00f9, 0x00ff, ' ', 1, "LD SP,HL" }, + { 0x00fa, 0x00ff, ' ', 3, "LD A,(%w)" }, // unique to LR35902 + { 0x00fb, 0x00ff, ' ', 1, "EI" }, + { 0x00fc, 0x00ff, 'l', 1, "Illegal Op" }, + { 0x00fd, 0x00ff, ' ', 1, "Illegal Op" }, + { 0x00fe, 0x00ff, ' ', 2, "CP %b" }, + { 0x00ff, 0x00ff, ' ', 1, "RST 38H" }, + + { 0, 0, 0, 0, NULL } +}; + + +struct dis_entry DISASS_NAME(_cb)[]= { + { 0x0000, 0x00ff, ' ', 1, "RLC B" }, + { 0x0001, 0x00ff, ' ', 1, "RLC C" }, + { 0x0002, 0x00ff, ' ', 1, "RLC D" }, + { 0x0003, 0x00ff, ' ', 1, "RLC E" }, + { 0x0004, 0x00ff, ' ', 1, "RLC H" }, + { 0x0005, 0x00ff, ' ', 1, "RLC L" }, + { 0x0006, 0x00ff, ' ', 1, "RLC (HL)" }, + { 0x0007, 0x00ff, ' ', 1, "RLC A" }, + { 0x0008, 0x00ff, ' ', 1, "RRC B" }, + { 0x0009, 0x00ff, ' ', 1, "RRC C" }, + { 0x000A, 0x00ff, ' ', 1, "RRC D" }, + { 0x000B, 0x00ff, ' ', 1, "RRC E" }, + { 0x000C, 0x00ff, ' ', 1, "RRC H" }, + { 0x000D, 0x00ff, ' ', 1, "RRC L" }, + { 0x000E, 0x00ff, ' ', 1, "RRC (HL)" }, + { 0x000F, 0x00ff, ' ', 1, "RRC A" }, + { 0x0010, 0x00ff, ' ', 1, "RL B" }, + { 0x0011, 0x00ff, ' ', 1, "RL C" }, + { 0x0012, 0x00ff, ' ', 1, "RL D" }, + { 0x0013, 0x00ff, ' ', 1, "RL E" }, + { 0x0014, 0x00ff, ' ', 1, "RL H" }, + { 0x0015, 0x00ff, ' ', 1, "RL L" }, + { 0x0016, 0x00ff, ' ', 1, "RL (HL)" }, + { 0x0017, 0x00ff, ' ', 1, "RL A" }, + { 0x0018, 0x00ff, ' ', 1, "RR B" }, + { 0x0019, 0x00ff, ' ', 1, "RR C" }, + { 0x001A, 0x00ff, ' ', 1, "RR D" }, + { 0x001B, 0x00ff, ' ', 1, "RR E" }, + { 0x001C, 0x00ff, ' ', 1, "RR H" }, + { 0x001D, 0x00ff, ' ', 1, "RR L" }, + { 0x001E, 0x00ff, ' ', 1, "RR (HL)" }, + { 0x001F, 0x00ff, ' ', 1, "RR A" }, + { 0x0020, 0x00ff, ' ', 1, "SLA B" }, + { 0x0021, 0x00ff, ' ', 1, "SLA C" }, + { 0x0022, 0x00ff, ' ', 1, "SLA D" }, + { 0x0023, 0x00ff, ' ', 1, "SLA E" }, + { 0x0024, 0x00ff, ' ', 1, "SLA H" }, + { 0x0025, 0x00ff, ' ', 1, "SLA L" }, + { 0x0026, 0x00ff, ' ', 1, "SLA (HL)" }, + { 0x0027, 0x00ff, ' ', 1, "SLA A" }, + { 0x0028, 0x00ff, ' ', 1, "SRA B" }, + { 0x0029, 0x00ff, ' ', 1, "SRA C" }, + { 0x002A, 0x00ff, ' ', 1, "SRA D" }, + { 0x002B, 0x00ff, ' ', 1, "SRA E" }, + { 0x002C, 0x00ff, ' ', 1, "SRA H" }, + { 0x002D, 0x00ff, ' ', 1, "SRA L" }, + { 0x002E, 0x00ff, ' ', 1, "SRA (HL)" }, + { 0x002F, 0x00ff, ' ', 1, "SRA A" }, + { 0x0030, 0x00ff, ' ', 1, "SWAP B" }, + { 0x0031, 0x00ff, ' ', 1, "SWAP C" }, + { 0x0032, 0x00ff, ' ', 1, "SWAP D" }, + { 0x0033, 0x00ff, ' ', 1, "SWAP E" }, + { 0x0034, 0x00ff, ' ', 1, "SWAP H" }, + { 0x0035, 0x00ff, ' ', 1, "SWAP L" }, + { 0x0036, 0x00ff, ' ', 1, "SWAP (HL)" }, + { 0x0037, 0x00ff, ' ', 1, "SWAP A" }, + { 0x0038, 0x00ff, ' ', 1, "SRL B" }, + { 0x0039, 0x00ff, ' ', 1, "SRL C" }, + { 0x003A, 0x00ff, ' ', 1, "SRL D" }, + { 0x003B, 0x00ff, ' ', 1, "SRL E" }, + { 0x003C, 0x00ff, ' ', 1, "SRL H" }, + { 0x003D, 0x00ff, ' ', 1, "SRL L" }, + { 0x003E, 0x00ff, ' ', 1, "SRL (HL)" }, + { 0x003F, 0x00ff, ' ', 1, "SRL A" }, + { 0x0040, 0x00ff, ' ', 1, "BIT 0,B" }, + { 0x0041, 0x00ff, ' ', 1, "BIT 0,C" }, + { 0x0042, 0x00ff, ' ', 1, "BIT 0,D" }, + { 0x0043, 0x00ff, ' ', 1, "BIT 0,E" }, + { 0x0044, 0x00ff, ' ', 1, "BIT 0,H" }, + { 0x0045, 0x00ff, ' ', 1, "BIT 0,L" }, + { 0x0046, 0x00ff, ' ', 1, "BIT 0,(HL)" }, + { 0x0047, 0x00ff, ' ', 1, "BIT 0,A" }, + { 0x0048, 0x00ff, ' ', 1, "BIT 1,B" }, + { 0x0049, 0x00ff, ' ', 1, "BIT 1,C" }, + { 0x004A, 0x00ff, ' ', 1, "BIT 1,D" }, + { 0x004B, 0x00ff, ' ', 1, "BIT 1,E" }, + { 0x004C, 0x00ff, ' ', 1, "BIT 1,H" }, + { 0x004D, 0x00ff, ' ', 1, "BIT 1,L" }, + { 0x004E, 0x00ff, ' ', 1, "BIT 1,(HL)" }, + { 0x004F, 0x00ff, ' ', 1, "BIT 1,A" }, + { 0x0050, 0x00ff, ' ', 1, "BIT 2,B" }, + { 0x0051, 0x00ff, ' ', 1, "BIT 2,C" }, + { 0x0052, 0x00ff, ' ', 1, "BIT 2,D" }, + { 0x0053, 0x00ff, ' ', 1, "BIT 2,E" }, + { 0x0054, 0x00ff, ' ', 1, "BIT 2,H" }, + { 0x0055, 0x00ff, ' ', 1, "BIT 2,L" }, + { 0x0056, 0x00ff, ' ', 1, "BIT 2,(HL)" }, + { 0x0057, 0x00ff, ' ', 1, "BIT 2,A" }, + { 0x0058, 0x00ff, ' ', 1, "BIT 3,B" }, + { 0x0059, 0x00ff, ' ', 1, "BIT 3,C" }, + { 0x005A, 0x00ff, ' ', 1, "BIT 3,D" }, + { 0x005B, 0x00ff, ' ', 1, "BIT 3,E" }, + { 0x005C, 0x00ff, ' ', 1, "BIT 3,H" }, + { 0x005D, 0x00ff, ' ', 1, "BIT 3,L" }, + { 0x005E, 0x00ff, ' ', 1, "BIT 3,(HL)" }, + { 0x005F, 0x00ff, ' ', 1, "BIT 3,A" }, + { 0x0060, 0x00ff, ' ', 1, "BIT 4,B" }, + { 0x0061, 0x00ff, ' ', 1, "BIT 4,C" }, + { 0x0062, 0x00ff, ' ', 1, "BIT 4,D" }, + { 0x0063, 0x00ff, ' ', 1, "BIT 4,E" }, + { 0x0064, 0x00ff, ' ', 1, "BIT 4,H" }, + { 0x0065, 0x00ff, ' ', 1, "BIT 4,L" }, + { 0x0066, 0x00ff, ' ', 1, "BIT 4,(HL)" }, + { 0x0067, 0x00ff, ' ', 1, "BIT 4,A" }, + { 0x0068, 0x00ff, ' ', 1, "BIT 5,B" }, + { 0x0069, 0x00ff, ' ', 1, "BIT 5,C" }, + { 0x006A, 0x00ff, ' ', 1, "BIT 5,D" }, + { 0x006B, 0x00ff, ' ', 1, "BIT 5,E" }, + { 0x006C, 0x00ff, ' ', 1, "BIT 5,H" }, + { 0x006D, 0x00ff, ' ', 1, "BIT 5,L" }, + { 0x006E, 0x00ff, ' ', 1, "BIT 5,(HL)" }, + { 0x006F, 0x00ff, ' ', 1, "BIT 5,A" }, + { 0x0070, 0x00ff, ' ', 1, "BIT 6,B" }, + { 0x0071, 0x00ff, ' ', 1, "BIT 6,C" }, + { 0x0072, 0x00ff, ' ', 1, "BIT 6,D" }, + { 0x0073, 0x00ff, ' ', 1, "BIT 6,E" }, + { 0x0074, 0x00ff, ' ', 1, "BIT 6,H" }, + { 0x0075, 0x00ff, ' ', 1, "BIT 6,L" }, + { 0x0076, 0x00ff, ' ', 1, "BIT 6,(HL)" }, + { 0x0077, 0x00ff, ' ', 1, "BIT 6,A" }, + { 0x0078, 0x00ff, ' ', 1, "BIT 7,B" }, + { 0x0079, 0x00ff, ' ', 1, "BIT 7,C" }, + { 0x007A, 0x00ff, ' ', 1, "BIT 7,D" }, + { 0x007B, 0x00ff, ' ', 1, "BIT 7,E" }, + { 0x007C, 0x00ff, ' ', 1, "BIT 7,H" }, + { 0x007D, 0x00ff, ' ', 1, "BIT 7,L" }, + { 0x007E, 0x00ff, ' ', 1, "BIT 7,(HL)" }, + { 0x007F, 0x00ff, ' ', 1, "BIT 7,A" }, + { 0x0080, 0x00ff, ' ', 1, "RES 0,B" }, + { 0x0081, 0x00ff, ' ', 1, "RES 0,C" }, + { 0x0082, 0x00ff, ' ', 1, "RES 0,D" }, + { 0x0083, 0x00ff, ' ', 1, "RES 0,E" }, + { 0x0084, 0x00ff, ' ', 1, "RES 0,H" }, + { 0x0085, 0x00ff, ' ', 1, "RES 0,L" }, + { 0x0086, 0x00ff, ' ', 1, "RES 0,(HL)" }, + { 0x0087, 0x00ff, ' ', 1, "RES 0,A" }, + { 0x0088, 0x00ff, ' ', 1, "RES 1,B" }, + { 0x0089, 0x00ff, ' ', 1, "RES 1,C" }, + { 0x008A, 0x00ff, ' ', 1, "RES 1,D" }, + { 0x008B, 0x00ff, ' ', 1, "RES 1,E" }, + { 0x008C, 0x00ff, ' ', 1, "RES 1,H" }, + { 0x008D, 0x00ff, ' ', 1, "RES 1,L" }, + { 0x008E, 0x00ff, ' ', 1, "RES 1,(HL)" }, + { 0x008F, 0x00ff, ' ', 1, "RES 1,A" }, + { 0x0090, 0x00ff, ' ', 1, "RES 2,B" }, + { 0x0091, 0x00ff, ' ', 1, "RES 2,C" }, + { 0x0092, 0x00ff, ' ', 1, "RES 2,D" }, + { 0x0093, 0x00ff, ' ', 1, "RES 2,E" }, + { 0x0094, 0x00ff, ' ', 1, "RES 2,H" }, + { 0x0095, 0x00ff, ' ', 1, "RES 2,L" }, + { 0x0096, 0x00ff, ' ', 1, "RES 2,(HL)" }, + { 0x0097, 0x00ff, ' ', 1, "RES 2,A" }, + { 0x0098, 0x00ff, ' ', 1, "RES 3,B" }, + { 0x0099, 0x00ff, ' ', 1, "RES 3,C" }, + { 0x009A, 0x00ff, ' ', 1, "RES 3,D" }, + { 0x009B, 0x00ff, ' ', 1, "RES 3,E" }, + { 0x009C, 0x00ff, ' ', 1, "RES 3,H" }, + { 0x009D, 0x00ff, ' ', 1, "RES 3,L" }, + { 0x009E, 0x00ff, ' ', 1, "RES 3,(HL)" }, + { 0x009F, 0x00ff, ' ', 1, "RES 3,A" }, + { 0x00A0, 0x00ff, ' ', 1, "RES 4,B" }, + { 0x00A1, 0x00ff, ' ', 1, "RES 4,C" }, + { 0x00A2, 0x00ff, ' ', 1, "RES 4,D" }, + { 0x00A3, 0x00ff, ' ', 1, "RES 4,E" }, + { 0x00A4, 0x00ff, ' ', 1, "RES 4,H" }, + { 0x00A5, 0x00ff, ' ', 1, "RES 4,L" }, + { 0x00A6, 0x00ff, ' ', 1, "RES 4,(HL)" }, + { 0x00A7, 0x00ff, ' ', 1, "RES 4,A" }, + { 0x00A8, 0x00ff, ' ', 1, "RES 5,B" }, + { 0x00A9, 0x00ff, ' ', 1, "RES 5,C" }, + { 0x00AA, 0x00ff, ' ', 1, "RES 5,D" }, + { 0x00AB, 0x00ff, ' ', 1, "RES 5,E" }, + { 0x00AC, 0x00ff, ' ', 1, "RES 5,H" }, + { 0x00AD, 0x00ff, ' ', 1, "RES 5,L" }, + { 0x00AE, 0x00ff, ' ', 1, "RES 5,(HL)" }, + { 0x00AF, 0x00ff, ' ', 1, "RES 5,A" }, + { 0x00B0, 0x00ff, ' ', 1, "RES 6,B" }, + { 0x00B1, 0x00ff, ' ', 1, "RES 6,C" }, + { 0x00B2, 0x00ff, ' ', 1, "RES 6,D" }, + { 0x00B3, 0x00ff, ' ', 1, "RES 6,E" }, + { 0x00B4, 0x00ff, ' ', 1, "RES 6,H" }, + { 0x00B5, 0x00ff, ' ', 1, "RES 6,L" }, + { 0x00B6, 0x00ff, ' ', 1, "RES 6,(HL)" }, + { 0x00B7, 0x00ff, ' ', 1, "RES 6,A" }, + { 0x00B8, 0x00ff, ' ', 1, "RES 7,B" }, + { 0x00B9, 0x00ff, ' ', 1, "RES 7,C" }, + { 0x00BA, 0x00ff, ' ', 1, "RES 7,D" }, + { 0x00BB, 0x00ff, ' ', 1, "RES 7,E" }, + { 0x00BC, 0x00ff, ' ', 1, "RES 7,H" }, + { 0x00BD, 0x00ff, ' ', 1, "RES 7,L" }, + { 0x00BE, 0x00ff, ' ', 1, "RES 7,(HL)" }, + { 0x00BF, 0x00ff, ' ', 1, "RES 7,A" }, + { 0x00C0, 0x00ff, ' ', 1, "SET 0,B" }, + { 0x00C1, 0x00ff, ' ', 1, "SET 0,C" }, + { 0x00C2, 0x00ff, ' ', 1, "SET 0,D" }, + { 0x00C3, 0x00ff, ' ', 1, "SET 0,E" }, + { 0x00C4, 0x00ff, ' ', 1, "SET 0,H" }, + { 0x00C5, 0x00ff, ' ', 1, "SET 0,L" }, + { 0x00C6, 0x00ff, ' ', 1, "SET 0,(HL)" }, + { 0x00C7, 0x00ff, ' ', 1, "SET 0,A" }, + { 0x00C8, 0x00ff, ' ', 1, "SET 1,B" }, + { 0x00C9, 0x00ff, ' ', 1, "SET 1,C" }, + { 0x00CA, 0x00ff, ' ', 1, "SET 1,D" }, + { 0x00CB, 0x00ff, ' ', 1, "SET 1,E" }, + { 0x00CC, 0x00ff, ' ', 1, "SET 1,H" }, + { 0x00CD, 0x00ff, ' ', 1, "SET 1,L" }, + { 0x00CE, 0x00ff, ' ', 1, "SET 1,(HL)" }, + { 0x00CF, 0x00ff, ' ', 1, "SET 1,A" }, + { 0x00D0, 0x00ff, ' ', 1, "SET 2,B" }, + { 0x00D1, 0x00ff, ' ', 1, "SET 2,C" }, + { 0x00D2, 0x00ff, ' ', 1, "SET 2,D" }, + { 0x00D3, 0x00ff, ' ', 1, "SET 2,E" }, + { 0x00D4, 0x00ff, ' ', 1, "SET 2,H" }, + { 0x00D5, 0x00ff, ' ', 1, "SET 2,L" }, + { 0x00D6, 0x00ff, ' ', 1, "SET 2,(HL)" }, + { 0x00D7, 0x00ff, ' ', 1, "SET 2,A" }, + { 0x00D8, 0x00ff, ' ', 1, "SET 3,B" }, + { 0x00D9, 0x00ff, ' ', 1, "SET 3,C" }, + { 0x00DA, 0x00ff, ' ', 1, "SET 3,D" }, + { 0x00DB, 0x00ff, ' ', 1, "SET 3,E" }, + { 0x00DC, 0x00ff, ' ', 1, "SET 3,H" }, + { 0x00DD, 0x00ff, ' ', 1, "SET 3,L" }, + { 0x00DE, 0x00ff, ' ', 1, "SET 3,(HL)" }, + { 0x00DF, 0x00ff, ' ', 1, "SET 3,A" }, + { 0x00E0, 0x00ff, ' ', 1, "SET 4,B" }, + { 0x00E1, 0x00ff, ' ', 1, "SET 4,C" }, + { 0x00E2, 0x00ff, ' ', 1, "SET 4,D" }, + { 0x00E3, 0x00ff, ' ', 1, "SET 4,E" }, + { 0x00E4, 0x00ff, ' ', 1, "SET 4,H" }, + { 0x00E5, 0x00ff, ' ', 1, "SET 4,L" }, + { 0x00E6, 0x00ff, ' ', 1, "SET 4,(HL)" }, + { 0x00E7, 0x00ff, ' ', 1, "SET 4,A" }, + { 0x00E8, 0x00ff, ' ', 1, "SET 5,B" }, + { 0x00E9, 0x00ff, ' ', 1, "SET 5,C" }, + { 0x00EA, 0x00ff, ' ', 1, "SET 5,D" }, + { 0x00EB, 0x00ff, ' ', 1, "SET 5,E" }, + { 0x00EC, 0x00ff, ' ', 1, "SET 5,H" }, + { 0x00ED, 0x00ff, ' ', 1, "SET 5,L" }, + { 0x00EE, 0x00ff, ' ', 1, "SET 5,(HL)" }, + { 0x00EF, 0x00ff, ' ', 1, "SET 5,A" }, + { 0x00F0, 0x00ff, ' ', 1, "SET 6,B" }, + { 0x00F1, 0x00ff, ' ', 1, "SET 6,C" }, + { 0x00F2, 0x00ff, ' ', 1, "SET 6,D" }, + { 0x00F3, 0x00ff, ' ', 1, "SET 6,E" }, + { 0x00F4, 0x00ff, ' ', 1, "SET 6,H" }, + { 0x00F5, 0x00ff, ' ', 1, "SET 6,L" }, + { 0x00F6, 0x00ff, ' ', 1, "SET 6,(HL)" }, + { 0x00F7, 0x00ff, ' ', 1, "SET 6,A" }, + { 0x00F8, 0x00ff, ' ', 1, "SET 7,B" }, + { 0x00F9, 0x00ff, ' ', 1, "SET 7,C" }, + { 0x00FA, 0x00ff, ' ', 1, "SET 7,D" }, + { 0x00FB, 0x00ff, ' ', 1, "SET 7,E" }, + { 0x00FC, 0x00ff, ' ', 1, "SET 7,H" }, + { 0x00FD, 0x00ff, ' ', 1, "SET 7,L" }, + { 0x00FE, 0x00ff, ' ', 1, "SET 7,(HL)" }, + { 0x00FF, 0x00ff, ' ', 1, "SET 7,A" }, + { 0, 0, 0, 0, NULL } +}; diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/z80.src/inst.cc sdcc-3.2.0+dfsg/sim/ucsim/z80.src/inst.cc --- sdcc-3.1.0+dfsg/sim/ucsim/z80.src/inst.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/z80.src/inst.cc 2012-03-14 20:37:02.000000000 +0000 @@ -1068,15 +1068,13 @@ int cl_z80::inst_call(t_mem code) { - int jnk; - switch(code) { case 0xC4: // CALL NZ,nnnn if (!(regs.F & BIT_Z)) { push2(PC+2); PC = fetch2(); } else { - jnk = fetch2(); + fetch2(); } break; case 0xCC: // CALL Z,nnnn @@ -1084,7 +1082,7 @@ push2(PC+2); PC = fetch2(); } else { - jnk = fetch2(); + fetch2(); } break; case 0xCD: // CALL nnnn @@ -1096,7 +1094,7 @@ push2(PC+2); PC = fetch2(); } else { - jnk = fetch2(); + fetch2(); } break; case 0xDC: // CALL C,nnnn @@ -1104,7 +1102,7 @@ push2(PC+2); PC = fetch2(); } else { - jnk = fetch2(); + fetch2(); } break; case 0xE4: // CALL PO,nnnn @@ -1112,7 +1110,7 @@ push2(PC+2); PC = fetch2(); } else { - jnk = fetch2(); + fetch2(); } break; case 0xEC: // CALL PE,nnnn @@ -1120,7 +1118,7 @@ push2(PC+2); PC = fetch2(); } else { - jnk = fetch2(); + fetch2(); } break; case 0xF4: // CALL P,nnnn @@ -1128,7 +1126,7 @@ push2(PC+2); PC = fetch2(); } else { - jnk = fetch2(); + fetch2(); } break; case 0xFC: // CALL M,nnnn @@ -1136,7 +1134,7 @@ push2(PC+2); PC = fetch2(); } else { - jnk = fetch2(); + fetch2(); } break; default: @@ -1280,14 +1278,12 @@ int cl_z80::inst_jp(t_mem code) { - int jnk; - switch (code) { case 0xC2: // JP NZ,nnnn if (!(regs.F & BIT_Z)) { PC = fetch2(); } else { - jnk = fetch2(); + fetch2(); } break; @@ -1299,7 +1295,7 @@ if (regs.F & BIT_Z) { PC = fetch2(); } else { - jnk = fetch2(); + fetch2(); } break; @@ -1307,7 +1303,7 @@ if (!(regs.F & BIT_C)) { PC = fetch2(); } else { - jnk = fetch2(); + fetch2(); } break; @@ -1315,7 +1311,7 @@ if (regs.F & BIT_C) { PC = fetch2(); } else { - jnk = fetch2(); + fetch2(); } break; @@ -1323,7 +1319,7 @@ if (!(regs.F & BIT_P)) { PC = fetch2(); } else { - jnk = fetch2(); + fetch2(); } break; @@ -1335,7 +1331,7 @@ if (regs.F & BIT_P) { PC = fetch2(); } else { - jnk = fetch2(); + fetch2(); } break; @@ -1343,7 +1339,7 @@ if (!(regs.F & BIT_S)) { PC = fetch2(); } else { - jnk = fetch2(); + fetch2(); } break; @@ -1351,7 +1347,7 @@ if (regs.F & BIT_S) { PC = fetch2(); } else { - jnk = fetch2(); + fetch2(); } break; default: diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/z80.src/inst_ed.cc sdcc-3.2.0+dfsg/sim/ucsim/z80.src/inst_ed.cc --- sdcc-3.1.0+dfsg/sim/ucsim/z80.src/inst_ed.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/z80.src/inst_ed.cc 2012-05-15 03:59:44.000000000 +0000 @@ -34,39 +34,25 @@ #include "z80mac.h" -int -cl_z80::inst_ed_(t_mem code) +int cl_z80::inst_ed_(t_mem code) { - switch(code) { - } - return(resGO); -} - -/******** start ED codes *****************/ -int -cl_z80::inst_ed(void) -{ - t_mem code; unsigned short tw; - - if (fetch(&code)) - return(resBREAKPOINT); - - switch (code) - { + + switch(code) + { #if 0 case 0x40: // IN B,(C) - return(resGO); + return(resGO); case 0x41: // OUT (C),B - return(resGO); + return(resGO); #endif case 0x42: // SBC HL,BC sbc_HL_wordreg(regs.BC); - return(resGO); + return(resGO); case 0x43: // LD (nnnn),BC tw = fetch2(); store2(tw, regs.BC); - return(resGO); + return(resGO); case 0x44: // NEG regs.F &= ~(BIT_ALL); /* clear these */ if (regs.A != 0) regs.F |= BIT_C; @@ -76,156 +62,156 @@ regs.F |= BIT_N; /* not addition */ if (regs.A == 0) regs.F |= BIT_Z; if (regs.A & 0x80) regs.F |= BIT_S; - return(resGO); + return(resGO); case 0x45: // RETN (return from non-maskable interrupt) pop2(PC); - return(resGO); + return(resGO); #if 0 case 0x46: // IM 0 /* interrupt device puts opcode on data bus */ - return(resGO); + return(resGO); #endif case 0x47: // LD IV,A regs.iv = regs.A; - return(resGO); + return(resGO); case 0x48: // IN C,(C) - return(resGO); + return(resGO); case 0x49: // OUT (C),C - return(resGO); + return(resGO); case 0x4A: // ADC HL,BC adc_HL_wordreg(regs.BC); - return(resGO); + return(resGO); case 0x4B: // LD BC,(nnnn) tw = fetch2(); regs.BC = get2(tw); - return(resGO); - case 0x4C: // MLT BC + return(resGO); + case 0x4C: // MLT BC if(type != CPU_Z180) return(resINV_INST); regs.BC = (unsigned long)(regs.bc.h) * (unsigned long)(regs.bc.l); - return(resGO); + return(resGO); case 0x4D: // RETI (return from interrupt) pop2(PC); - return(resGO); + return(resGO); case 0x4F: // LD R,A /* Load "refresh" register(whats that?) */ - return(resGO); + return(resGO); case 0x50: // IN D,(C) - return(resGO); + return(resGO); case 0x51: // OUT (C),D - return(resGO); + return(resGO); case 0x52: // SBC HL,DE sbc_HL_wordreg(regs.DE); - return(resGO); + return(resGO); case 0x53: // LD (nnnn),DE tw = fetch2(); store2(tw, regs.DE); - return(resGO); + return(resGO); #if 0 case 0x56: // IM 1 - return(resGO); + return(resGO); #endif case 0x57: // LD A,IV regs.A = regs.iv; - return(resGO); + return(resGO); case 0x58: // IN E,(C) - return(resGO); + return(resGO); case 0x59: // OUT (C),E - return(resGO); + return(resGO); case 0x5A: // ADC HL,DE adc_HL_wordreg(regs.DE); - return(resGO); + return(resGO); case 0x5B: // LD DE,(nnnn) tw = fetch2(); regs.DE = get2(tw); - return(resGO); + return(resGO); case 0x5C: // MLT DE if(type != CPU_Z180) return(resINV_INST); regs.DE = (unsigned long)(regs.de.h) * (unsigned long)(regs.de.l); - return(resGO); + return(resGO); #if 0 case 0x5E: // IM 2 - return(resGO); + return(resGO); case 0x5F: // LD A,R - return(resGO); + return(resGO); case 0x60: // IN H,(C) - return(resGO); + return(resGO); case 0x61: // OUT (C),H - return(resGO); + return(resGO); #endif case 0x62: // SBC HL,HL sbc_HL_wordreg(regs.HL); - return(resGO); + return(resGO); case 0x63: // LD (nnnn),HL opcode 22 does the same faster tw = fetch2(); store2(tw, regs.HL); - return(resGO); + return(resGO); #if 0 case 0x67: // RRD - return(resGO); + return(resGO); #endif case 0x68: // IN L,(C) - return(resGO); + return(resGO); case 0x69: // OUT (C),L - return(resGO); + return(resGO); case 0x6A: // ADC HL,HL adc_HL_wordreg(regs.HL); - return(resGO); + return(resGO); case 0x6B: // LD HL,(nnnn) opcode 2A does the same faster tw = fetch2(); regs.HL = get2(tw); - return(resGO); + return(resGO); case 0x6C: // MLT HL if(type != CPU_Z180) return(resINV_INST); regs.HL = (unsigned long)(regs.hl.h) * (unsigned long)(regs.hl.l); - return(resGO); + return(resGO); #if 0 case 0x6F: // RLD /* rotate 1 bcd digit left between ACC and memory location */ - return(resGO); + return(resGO); #endif case 0x70: // IN (C) set flags only (TSTI) - return(resGO); + return(resGO); case 0x71: // OUT (C),0 - return(resGO); + return(resGO); case 0x72: // SBC HL,SP sbc_HL_wordreg(regs.SP); - return(resGO); + return(resGO); case 0x73: // LD (nnnn),SP tw = fetch2(); store2(tw, regs.SP); - return(resGO); + return(resGO); case 0x78: // IN A,(C) - return(resGO); + return(resGO); case 0x79: // OUT (C),A - return(resGO); + return(resGO); case 0x7A: // ADC HL,SP adc_HL_wordreg(regs.SP); - return(resGO); + return(resGO); case 0x7B: // LD SP,(nnnn) tw = fetch2(); regs.SP = get2(tw); - return(resGO); + return(resGO); case 0x7C: // MLT SP //if(type != CPU_Z180) - return(resINV_INST); + return(resINV_INST); //regs.SP = (unsigned long)(regs.sp.h) * (unsigned long)(regs.sp.l); - return(resGO); + return(resGO); case 0xA0: // LDI // BC - count, sourc=HL, dest=DE. *DE++ = *HL++, --BC until zero regs.F &= ~(BIT_P | BIT_N | BIT_A); /* clear these */ @@ -234,7 +220,7 @@ ++regs.DE; --regs.BC; if (regs.BC != 0) regs.F |= BIT_P; - return(resGO); + return(resGO); case 0xA1: // CPI // compare acc with mem(HL), if ACC=0 set Z flag. Incr HL, decr BC. { @@ -245,12 +231,12 @@ --regs.BC; if (regs.BC != 0) regs.F |= BIT_P; } - return(resGO); + return(resGO); case 0xA2: // INI - return(resGO); + return(resGO); case 0xA3: // OUTI - return(resGO); + return(resGO); case 0xA8: // LDD // BC - count, source=HL, dest=DE. *DE-- = *HL--, --BC until zero @@ -260,7 +246,7 @@ --regs.DE; --regs.BC; if (regs.BC != 0) regs.F |= BIT_P; - return(resGO); + return(resGO); case 0xA9: // CPD /* fixme: checkme, compare to other emul. */ @@ -272,12 +258,12 @@ --regs.BC; if (regs.BC != 0) regs.F |= BIT_P; - return(resGO); + return(resGO); case 0xAA: // IND - return(resGO); + return(resGO); case 0xAB: // OUTD - return(resGO); + return(resGO); case 0xB0: // LDIR // BC - count, sourc=HL, dest=DE. *DE++ = *HL++, --BC until zero @@ -288,7 +274,7 @@ ++regs.DE; --regs.BC; } while (regs.BC != 0); - return(resGO); + return(resGO); case 0xB1: // CPIR // compare acc with mem(HL), if ACC=0 set Z flag. Incr HL, decr BC. @@ -310,12 +296,12 @@ if(regs.BC != 0) regs.F |= BIT_P; - return(resGO); + return(resGO); #if 0 case 0xB2: // INIR - return(resGO); + return(resGO); case 0xB3: // OTIR - return(resGO); + return(resGO); #endif case 0xB8: // LDDR // BC - count, source=HL, dest=DE. *DE-- = *HL--, --BC until zero @@ -326,7 +312,7 @@ --regs.DE; --regs.BC; } while (regs.BC != 0); - return(resGO); + return(resGO); case 0xB9: // CPDR // compare acc with mem(HL), if ACC=0 set Z flag. Incr HL, decr BC. regs.F &= ~(BIT_ALL); /* clear these */ @@ -338,19 +324,30 @@ --regs.HL; --regs.BC; } while (regs.BC != 0); - return(resGO); + return(resGO); #if 0 case 0xBA: // INDR - return(resGO); + return(resGO); case 0xBB: // OTDR - return(resGO); + return(resGO); #endif default: - return(resINV_INST); - } + return(resINV_INST); + } + + return(resGO); +} - return(resINV_INST); +/******** start ED codes *****************/ +int cl_z80::inst_ed(void) +{ + t_mem code; + + if (fetch(&code)) + return(resBREAKPOINT); + + return inst_ed_(code); } /* End of z80.src/inst_ed.cc */ diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/z80.src/inst_ed_r2k.cc sdcc-3.2.0+dfsg/sim/ucsim/z80.src/inst_ed_r2k.cc --- sdcc-3.1.0+dfsg/sim/ucsim/z80.src/inst_ed_r2k.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/z80.src/inst_ed_r2k.cc 2012-05-15 03:59:44.000000000 +0000 @@ -25,6 +25,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*@1@*/ +#include #include "ddconfig.h" @@ -33,26 +34,12 @@ #include "z80mac.h" -int -cl_r2k::inst_ed_(t_mem code) +int cl_r2k::inst_ed_(t_mem code) { - switch(code) { - } - return(resGO); -} - -/******** start ED codes *****************/ -int -cl_r2k::inst_ed(void) -{ - t_mem code; unsigned short tw; - - if (fetch(&code)) - return(resBREAKPOINT); - - switch (code) - { + + switch(code) + { case 0x41: regs.aBC = regs.DE; break; @@ -243,23 +230,29 @@ case 0xB0: // LDIR // BC - count, sourc=HL, dest=DE. *DE++ = *HL++, --BC until zero regs.F &= ~(BIT_P | BIT_N | BIT_A); /* clear these */ - do { - store1(regs.DE, get1(regs.HL)); - ++regs.HL; - ++regs.DE; - --regs.BC; - } while (regs.BC != 0); + + tw = get1(regs.HL); + store1(regs.DE, tw); + ++regs.HL; + ++regs.DE; + --regs.BC; + + if (regs.BC != 0) + PC = ins_start; return(resGO); case 0xB8: // LDDR // BC - count, source=HL, dest=DE. *DE-- = *HL--, --BC until zero regs.F &= ~(BIT_P | BIT_N | BIT_A); /* clear these */ - do { - store1(regs.DE, get1(regs.HL)); - --regs.HL; - --regs.DE; - --regs.BC; - } while (regs.BC != 0); + + tw = get1(regs.HL); + store1(regs.DE, tw); + --regs.HL; + --regs.DE; + --regs.BC; + + if (regs.BC != 0) + PC = ins_start; return(resGO); case 0xEA: // CALL (HL) @@ -270,7 +263,174 @@ default: return(resINV_INST); - } + } return(resGO); } + +int cl_r3ka::inst_ed_(t_mem code) +{ + TYPE_UBYTE tb; + + switch(code) + { + case 0x66: // PUSH SU + push1(SU); + return(resGO); + + case 0x6E: // POP SU + SU = get1(regs.SP); + regs.SP++; + return(resGO); + + case 0x6F: // SETUSR + SU = ((SU << 2) & 0xFC) | 0x01; + return(resGO); + + case 0x7D: // SURES + SU = ((SU >> 2) & 0x3F) | ((SU << 6) & 0xC0); + return(resGO); + + case 0x7F: // RDMODE + regs.F &= ~(BIT_C); + if (SU & 0x01) + regs.F |= BIT_C; + return(resGO); + + case 0x90: // LDISR + // repeat (cnt=BC) { (DE) <= (HL++) } /* normally has io prefix */ + /* TODO: fix IOI/IOE behavior */ + tb = get1(regs.HL); + store1( regs.DE, tb ); + regs.HL++; + regs.BC--; + if (regs.BC) + PC = ins_start; + return(resGO); + + case 0x98: // LDDSR + /* TODO: fix IOI/IOE behavior */ + // repeat (cnt=BC) { (DE) <= (HL--) } /* normally has io prefix */ + tb = get1(regs.HL); + store1( regs.DE, tb ); + regs.HL--; + regs.BC--; + if (regs.BC) + PC = ins_start; + return(resGO); + + case 0xC0: // UMA + // repeat while BC != 0: + // {CF:DE':(HL)} <= (IX) + [(IY)*DE + DE' + CF]; + // BC--; IX++; IY++; HL++; + { + uint32_t tmp; + + /* scale a sum for operand pointed to by IY */ + tmp = get1(regs.IY); + tmp *= regs.DE; + tmp += regs.aDE; + tmp += (regs.F & BIT_C) ? 1 : 0; + + /* simple add for operand pointed to by IX */ + tmp += get1(regs.IX); + + /* store the result(s) */ + store1( regs.HL, tmp & 0xFF ); + regs.aDE = ((tmp >> 8) & 0xFFFF); + regs.F &= ~(BIT_C); + regs.F |= (tmp >> 24) ? BIT_C : 0; + } + + regs.IX++; + regs.IY++; + regs.HL++; + regs.BC--; + if (regs.BC) + PC = ins_start; + return(resGO); + + case 0xC8: // UMS + // repeat while BC != 0: + // {CF:DE':(HL)} <= (IX) - [(IY)*DE + DE' + CF]; + // BC--; IX++; IY++; HL++; + { + uint32_t tmp; + + /* scale a sum for operand pointed to by IY */ + tmp = get1(regs.IY); + tmp *= regs.DE; + tmp += regs.aDE; + tmp += (regs.F & BIT_C) ? 1 : 0; + + /* subtract above from operand pointed to by IX */ + tmp = get1(regs.IX) - tmp; + + /* store the result(s) */ + store1( regs.HL, tmp & 0xFF ); + regs.aDE = ((tmp >> 8) & 0xFFFF); + regs.F &= ~(BIT_C); + regs.F |= (tmp >> 24) ? BIT_C : 0; + } + + regs.IX++; + regs.IY++; + regs.HL++; + regs.BC--; + if (regs.BC) + PC = ins_start; + return(resGO); + + case 0xD0: // LSIDR + /* TODO: fix IOI/IOE behavior */ + // repeat (cnt=BC) { (DE++) <= (HL) } /* normally has io prefix */ + tb = get1( regs.HL ); + store1( regs.DE, tb ); + regs.DE++; + regs.BC--; + if (regs.BC) + PC = ins_start; + return(resGO); + + case 0xD8: // LSDDR + /* TODO: fix IOI/IOE behavior */ + // repeat (cnt=BC) { (DE--) <= (HL) } /* normally has io prefix */ + tb = get1( regs.HL ); + store1( regs.DE, tb ); + regs.DE--; + regs.BC--; + if (regs.BC) + PC = ins_start; + return(resGO); + + case 0xF0: // LSIR + /* TODO: fix IOI/IOE behavior */ + // repeat (cnt=BC) { (DE++) <= (HL++) } + tb = get1( regs.HL ); + store1( regs.DE, tb ); + regs.DE++; + regs.HL++; + regs.BC--; + if (regs.BC) + PC = ins_start; + return(resGO); + + case 0xF8: // LSDR + /* TODO: fix IOI/IOE behavior */ + // repeat (cnt=BC) { (DE--) <= (HL--) } + tb = get1( regs.HL ); + store1( regs.DE, tb ); + regs.DE--; + regs.HL--; + regs.BC--; + if (regs.BC) + PC = ins_start; + return(resGO); + + default: + return cl_r2k::inst_ed_(code); + } +} + +//IDET system mode violation interrupt if in user mode + diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/z80.src/inst_lr35902.cc sdcc-3.2.0+dfsg/sim/ucsim/z80.src/inst_lr35902.cc --- sdcc-3.1.0+dfsg/sim/ucsim/z80.src/inst_lr35902.cc 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/z80.src/inst_lr35902.cc 2012-01-15 19:03:15.000000000 +0000 @@ -0,0 +1,176 @@ +/* + * Simulated instructions specific to the LR35902, the Z-80 derivative used + * in the gameboy. + * + * 2011-12-21 created by Leland Morrison + * + * + +This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ +#include "ddconfig.h" + +#include "lr35902cl.h" + +static TYPE_UBYTE swap_nibbles(TYPE_UBYTE val) { + return ((val >> 4) & 0x0f) | ((val << 4) & 0xf0); +} + +int cl_lr35902::inst_cb(void) { + TYPE_UBYTE result; + t_mem code; + + if ( (peek1( ) & 0xf8) != 0x30 ) + return cl_z80::inst_cb( ); + + code = fetch1(); + + /* perform SWAP instead of slia */ + switch(code) { + case 0x30: result = regs.bc.h = swap_nibbles(regs.bc.h); break; /* b */ + case 0x31: result = regs.bc.l = swap_nibbles(regs.bc.l); break; /* c */ + case 0x32: result = regs.de.h = swap_nibbles(regs.de.h); break; /* d */ + case 0x33: result = regs.de.l = swap_nibbles(regs.de.l); break; /* e */ + case 0x34: result = regs.hl.l = swap_nibbles(regs.hl.h); break; /* h */ + case 0x35: result = regs.hl.h = swap_nibbles(regs.hl.l); break; /* l */ + case 0x36: /* SWAP (HL) */ + { + result = swap_nibbles(get1(regs.HL)); + store1(regs.HL, result); + } + break; + + case 0x37: result = regs.A = swap_nibbles(regs.A); break; /* swap a */ + default: return resINV_INST; + } + regs.F = (result)?0:0x80; // all except zero are simply cleared + return(resGO); +} + +int cl_lr35902::inst_st_sp_abs(t_mem code) { + if (code == 0x08) { + TYPE_UWORD addr = fetch2( ); + store2( addr, regs.SP ); + return(resGO); + } + + return resINV_INST; +} + +int cl_lr35902::inst_stop0 (t_mem code) { + // TODO: change to wait for a signal for simulated hardware + return resHALT; +} + +int cl_lr35902::inst_ldi (t_mem code) { + if (code == 0x22) { + store1( regs.HL, regs.A ); + regs.HL ++; + return resGO; + } else if (code == 0x2A) { + regs.A = get1( regs.HL ); + regs.HL ++; + return resGO; + } + + return resINV_INST; +} + +int cl_lr35902::inst_ldd (t_mem code) { + if (code == 0x32) { + store1( regs.HL, regs.A ); + regs.HL --; + return resGO; + } else if (code == 0x3A) { + regs.A = get1( regs.HL ); + regs.HL --; + return resGO; + } + + return resINV_INST; +} + +int cl_lr35902::inst_ldh (t_mem code) { + TYPE_UWORD addr = 0xFF00 + fetch1( ); + + if (code == 0xE0) { + store1( addr, regs.A ); + return resGO; + } else if (code == 0xF0) { + regs.A = get1( addr ); + return resGO; + } + + return resINV_INST; +} + +int cl_lr35902::inst_reti (t_mem code) { + /* enable interrupts */ + cl_z80::inst_ei(0xFB); + + /* pop2(PC); */ + PC=get2(regs.SP); + regs.SP+=2; + + return resGO; +} + +int cl_lr35902::inst_add_sp_d(t_mem code) { + TYPE_UWORD d = fetch( ); + /* sign-extend d from 8-bits to 16-bits */ + d |= (d>>7)*0xFF00; + + regs.F &= ~(BIT_ALL); /* clear these */ + if ((regs.SP & 0x0FFF) + (d & 0x0FFF) > 0x0FFF) + regs.F |= BIT_A; + if (regs.SP + (int)(d) > 0xffff) + regs.F |= BIT_C; + + regs.SP = (regs.SP + d) & 0xffff; + + return(resGO); +} + +int cl_lr35902::inst_ld16 (t_mem code) { + TYPE_UWORD addr = fetch2( ); + if (code == 0xEA) { + store1( addr, regs.A ); + return resGO; + } else if (code == 0xFA) { + regs.A = get1( addr ); + return resGO; + } + + return resINV_INST; +} + +int cl_lr35902::inst_ldhl_sp (t_mem code) { + TYPE_UWORD d = fetch( ); + /* sign-extend d from 8-bits to 16-bits */ + d |= (d>>7)*0xFF00; + + regs.F &= ~(BIT_ALL); /* clear these */ + if ((regs.SP & 0x0FFF) + (d & 0x0FFF) > 0x0FFF) + regs.F |= BIT_A; + if (regs.SP + (int)(d) > 0xffff) + regs.F |= BIT_C; + + regs.HL = (regs.SP + d) & 0xffff; + return resGO; +} + diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/z80.src/inst_r2k.cc sdcc-3.2.0+dfsg/sim/ucsim/z80.src/inst_r2k.cc --- sdcc-3.1.0+dfsg/sim/ucsim/z80.src/inst_r2k.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/z80.src/inst_r2k.cc 2012-06-21 15:18:30.000000000 +0000 @@ -170,7 +170,10 @@ /******** start rabbit 2000 specific codes *****************/ int cl_r2k::inst_add_sp_d(t_mem code) { - regs.SP = add_u16_disp(regs.SP, fetch()); + TYPE_UWORD d = fetch( ); + /* sign-extend d from 8-bits to 16-bits */ + d |= (d>>7)*0xFF00; + regs.SP = (regs.SP + d) & 0xffff; return(resGO); } @@ -292,8 +295,11 @@ } int cl_r2k::inst_rl_de(t_mem code) { - regs.F = (regs.F & ~BIT_C) | (((regs.DE >> 15) & 1U) << BITPOS_C); - regs.DE = (regs.DE << 1) | ((regs.F & BIT_C) >> BITPOS_C); + unsigned int oldcarry = (regs.F & BIT_C); + + regs.F &= ~BIT_ALL; + regs.F |= (((regs.DE >> 15) & 1U) << BITPOS_C); + regs.DE = (regs.DE << 1) | (oldcarry >> BITPOS_C); if (regs.DE & 0x8000) regs.F |= BIT_S; @@ -305,8 +311,11 @@ } int cl_r2k::inst_rr_de(t_mem code) { - regs.F = (regs.F & ~BIT_C) | ((regs.DE & 1) << BITPOS_C); - regs.DE = (regs.DE >> 1) | ((regs.F & BIT_C) << (15 - BITPOS_C)); + unsigned int oldcarry = (regs.F & BIT_C); + + regs.F &= ~BIT_ALL; + regs.F |= ((regs.DE & 1) << BITPOS_C); + regs.DE = (regs.DE >> 1) | (oldcarry << (15 - BITPOS_C)); if (regs.DE & 0x8000) regs.F |= BIT_S; @@ -319,8 +328,11 @@ int cl_r2k::inst_rr_hl(t_mem code) // RR HL { - regs.F = (regs.F & ~BIT_C) | ((regs.HL & 1) << BITPOS_C); - regs.HL = (regs.HL >> 1) | ((regs.F & BIT_C) << (15 - BITPOS_C)); + unsigned int oldcarry = (regs.F & BIT_C); + + regs.F &= ~BIT_ALL; + regs.F |= ((regs.HL & 1) << BITPOS_C); + regs.HL = (regs.HL >> 1) | (oldcarry << (15 - BITPOS_C)); if (regs.HL & 0x8000) regs.F |= BIT_S; diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/z80.src/lr35902.cc sdcc-3.2.0+dfsg/sim/ucsim/z80.src/lr35902.cc --- sdcc-3.1.0+dfsg/sim/ucsim/z80.src/lr35902.cc 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/z80.src/lr35902.cc 2012-01-10 04:32:27.000000000 +0000 @@ -0,0 +1,571 @@ +/* + * Simulator for the LR35902 used in the gb console. + * The processor is closely related to the Z-80, so the C++ + * emulator object inherits from it. + * + */ + +/* This file is part of microcontroller simulator: ucsim. + + UCSIM 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. + + UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ +/*@1@*/ + +#include "ddconfig.h" + +#include /* for va_list */ +#include +#include +#include +#include "i_string.h" + +// prj +#include "pobjcl.h" + +// sim +#include "simcl.h" + +// local +#include "z80cl.h" +#include "lr35902cl.h" +#include "glob.h" + +#define uint32 t_addr +#define uint8 unsigned char + +/*******************************************************************/ + +lr35902_memory::lr35902_memory( cl_uc &uc_parent_ref ):uc_r(uc_parent_ref) { } + +cl_lr35902::cl_lr35902(int Itype, int Itech, class cl_sim *asim): + cl_z80(Itype, Itech, asim), mem(*this) +{ + type= Itype; +} + +int +cl_lr35902::init(void) +{ + cl_uc::init(); /* Memories now exist */ + + rom= address_space(MEM_ROM_ID); // code goes here... + + // ram= mem(MEM_XRAM); + ram= address_space(MEM_XRAM_ID); // data goes here... + + + // zero out ram(this is assumed in regression tests) + for (int i=0xA000; i<0xFF80; i++) { + ram->set((t_addr) i, 0); + } + + return(0); +} + +const char * +cl_lr35902::id_string(void) +{ + return("LR35902"); +} + + +void +cl_lr35902::mk_hw_elements(void) +{ + //class cl_base *o; + /* t_uc::mk_hw() does nothing */ +} + +void lr35902_memory::init(void) { + cl_address_space *as_rom; + cl_address_space *as_ram; + + as_rom = new cl_address_space(MEM_ROM_ID, + lr35902_rom_start, lr35902_rom_size, 8); + as_rom->init(); + uc_r.address_spaces->add(as_rom); + rom = as_rom; + + as_ram = new cl_address_space(MEM_XRAM_ID, + lr35902_ram_start, lr35902_ram_size, 8); + as_ram->init(); + uc_r.address_spaces->add(as_ram); + ram = as_ram; +} + +void +cl_lr35902::make_memories(void) +{ + mem.init( ); +} + + +void cl_lr35902::store1( TYPE_UWORD addr, t_mem val ) { + mem.store1( addr, val ); +} + +void cl_lr35902::store2( TYPE_UWORD addr, TYPE_UWORD val ) { + mem.store2( addr, val ); +} + +TYPE_UBYTE cl_lr35902::get1( TYPE_UWORD addr ) { + return mem.get1( addr ); +} + +TYPE_UWORD cl_lr35902::get2( TYPE_UWORD addr ) { + return mem.get2( addr ); +} + +void lr35902_memory::store1( TYPE_UWORD addr, t_mem val ) { + if (addr < lr35902_ram_start) { + /* flag illegal operation ? */ + return; + } + + if ((addr- lr35902_ram_start) < lr35902_ram_size) { + ram->set(addr, val); + } +} + +void lr35902_memory::store2( TYPE_UWORD addr, TYPE_UWORD val ) { + store1(addr, val & 0xff); + store1(addr+1, (val >> 8) & 0xff); +} + +TYPE_UBYTE lr35902_memory::get1( TYPE_UWORD addr ) { + if (addr < lr35902_rom_size) { + return rom->get(addr); + } + + if (addr < lr35902_ram_start) { + /* flag illegal operation ? */ + return (addr & 0xff); + } + + if ((addr-lr35902_ram_start) < lr35902_ram_size) { + return ram->get(addr); + } + + return (addr & 0xff); +} + +TYPE_UWORD lr35902_memory::get2( TYPE_UWORD addr ) { + TYPE_UWORD l, h; + + l = get1(addr ); + h = get1(addr+1); + + return (h << 8) | l; +} + +/* + * Help command interpreter + */ + +struct dis_entry * +cl_lr35902::dis_tbl(void) +{ + return(disass_lr35902); +} + + +int +cl_lr35902::inst_length(t_addr addr) +{ + int len = 0; + + get_disasm_info(addr, &len, NULL, NULL); + + return len; +} + +int +cl_lr35902::inst_branch(t_addr addr) +{ + int b; + + get_disasm_info(addr, NULL, &b, NULL); + + return b; +} + +int +cl_lr35902::longest_inst(void) +{ + return 4; +} + + +const char * +cl_lr35902::get_disasm_info(t_addr addr, + int *ret_len, + int *ret_branch, + int *immed_offset) +{ + const char *b = NULL; + uint code; + int len = 0; + int immed_n = 0; + int i; + int start_addr = addr; + struct dis_entry *dis_e; + + code= get_mem(MEM_ROM_ID, addr++); + dis_e = NULL; + + switch(code) { + case 0xcb: /* ESC code to lots of op-codes, all 2-byte */ + code= get_mem(MEM_ROM_ID, addr++); + i= 0; + while ((code & disass_lr35902_cb[i].mask) != disass_lr35902_cb[i].code && + disass_lr35902_cb[i].mnemonic) + i++; + dis_e = &disass_lr35902_cb[i]; + b= disass_lr35902_cb[i].mnemonic; + if (b != NULL) + len += (disass_lr35902_cb[i].length + 1); + break; + + default: + i= 0; + while ((code & disass_lr35902[i].mask) != disass_lr35902[i].code && + disass_lr35902[i].mnemonic) + i++; + dis_e = &disass_lr35902[i]; + b= disass_lr35902[i].mnemonic; + if (b != NULL) + len += (disass_lr35902[i].length); + break; + } + + + if (ret_branch) { + *ret_branch = dis_e->branch; + } + + if (immed_offset) { + if (immed_n > 0) + *immed_offset = immed_n; + else *immed_offset = (addr - start_addr); + } + + if (len == 0) + len = 1; + + if (ret_len) + *ret_len = len; + + return b; +} + +const char * +cl_lr35902::disass(t_addr addr, const char *sep) +{ + char work[256], temp[20]; + const char *b; + char *buf, *p, *t; + int len = 0; + int immed_offset = 0; + + p= work; + + b = get_disasm_info(addr, &len, NULL, &immed_offset); + + if (b == NULL) { + buf= (char*)malloc(30); + strcpy(buf, "UNKNOWN/INVALID"); + return(buf); + } + + while (*b) + { + if (*b == '%') + { + b++; + switch (*(b++)) + { + case 'd': // d jump relative target, signed? byte immediate operand + sprintf(temp, "#%d", (char)get_mem(MEM_ROM_ID, addr+immed_offset)); + ++immed_offset; + break; + case 'w': // w word immediate operand + sprintf(temp, "#0x%04x", + (uint)((get_mem(MEM_ROM_ID, addr+immed_offset)) | + (get_mem(MEM_ROM_ID, addr+immed_offset+1)<<8)) ); + ++immed_offset; + ++immed_offset; + break; + case 'b': // b byte immediate operand + sprintf(temp, "#0x%02x", (uint)get_mem(MEM_ROM_ID, addr+immed_offset)); + ++immed_offset; + break; + default: + strcpy(temp, "?"); + break; + } + t= temp; + while (*t) + *(p++)= *(t++); + } + else + *(p++)= *(b++); + } + *p= '\0'; + + p= strchr(work, ' '); + if (!p) + { + buf= strdup(work); + return(buf); + } + if (sep == NULL) + buf= (char *)malloc(6+strlen(p)+1); + else + buf= (char *)malloc((p-work)+strlen(sep)+strlen(p)+1); + for (p= work, t= buf; *p != ' '; p++, t++) + *t= *p; + p++; + *t= '\0'; + if (sep == NULL) + { + while (strlen(buf) < 6) + strcat(buf, " "); + } + else + strcat(buf, sep); + strcat(buf, p); + return(buf); +} + + +void +cl_lr35902::print_regs(class cl_console_base *con) +{ + con->dd_printf("SZ-A-PNC Flags= 0x%02x %3d %c ", + regs.F, regs.F, isprint(regs.F)?regs.F:'.'); + con->dd_printf("A= 0x%02x %3d %c\n", + regs.A, regs.A, isprint(regs.A)?regs.A:'.'); + con->dd_printf("%c%c-%c-%c%c%c\n", + (regs.F&BIT_S)?'1':'0', + (regs.F&BIT_Z)?'1':'0', + (regs.F&BIT_A)?'1':'0', + (regs.F&BIT_P)?'1':'0', + (regs.F&BIT_N)?'1':'0', + (regs.F&BIT_C)?'1':'0'); + con->dd_printf("BC= 0x%04x [BC]= %02x %3d %c ", + regs.BC, ram->get(regs.BC), ram->get(regs.BC), + isprint(ram->get(regs.BC))?ram->get(regs.BC):'.'); + con->dd_printf("DE= 0x%04x [DE]= %02x %3d %c ", + regs.DE, ram->get(regs.DE), ram->get(regs.DE), + isprint(ram->get(regs.DE))?ram->get(regs.DE):'.'); + con->dd_printf("HL= 0x%04x [HL]= %02x %3d %c\n", + regs.HL, ram->get(regs.HL), ram->get(regs.HL), + isprint(ram->get(regs.HL))?ram->get(regs.HL):'.'); + con->dd_printf("SP= 0x%04x [SP]= %02x %3d %c\n", + regs.SP, ram->get(regs.SP), ram->get(regs.SP), + isprint(ram->get(regs.SP))?ram->get(regs.SP):'.'); + + print_disass(PC, con); +} + +/* + * Execution + */ + +int +cl_lr35902::exec_inst(void) +{ + t_mem code; + + if (fetch(&code)) + return(resBREAKPOINT); + tick(1); + + switch (code) + { + case 0x00: return(inst_nop(code)); + case 0x01: case 0x02: case 0x06: return(inst_ld(code)); + case 0x03: case 0x04: return(inst_inc(code)); + case 0x05: return(inst_dec(code)); + case 0x07: return(inst_rlca(code)); + + case 0x08: return(inst_st_sp_abs(code)); + case 0x09: return(inst_add(code)); + case 0x0a: case 0x0e: return(inst_ld(code)); + case 0x0b: case 0x0d: return(inst_dec(code)); + case 0x0c: return(inst_inc(code)); + case 0x0f: return(inst_rrca(code)); + + + case 0x10: return(inst_stop0(code)); + case 0x11: case 0x12: case 0x16: return(inst_ld(code)); + case 0x13: case 0x14: return(inst_inc(code)); + case 0x15: return(inst_dec(code)); + case 0x17: return(inst_rla(code)); + + case 0x18: return(inst_jr(code)); + case 0x19: return(inst_add(code)); + case 0x1a: case 0x1e: return(inst_ld(code)); + case 0x1b: case 0x1d: return(inst_dec(code)); + case 0x1c: return(inst_inc(code)); + case 0x1f: return(inst_rra(code)); + + + case 0x20: return(inst_jr(code)); + case 0x21: case 0x26: return(inst_ld(code)); + case 0x22: return inst_ldi(code); + case 0x23: case 0x24: return(inst_inc(code)); + case 0x25: return(inst_dec(code)); + case 0x27: return(inst_daa(code)); + + case 0x28: return(inst_jr(code)); + case 0x29: return(inst_add(code)); + case 0x2a: return(inst_ldi(code)); + case 0x2b: case 0x2d: return(inst_dec(code)); + case 0x2c: return(inst_inc(code)); + case 0x2e: return(inst_ld(code)); + case 0x2f: return(inst_cpl(code)); + + case 0x30: return(inst_jr(code)); + case 0x31: case 0x36: return(inst_ld(code)); + case 0x32: return(inst_ldd(code)); + case 0x33: case 0x34: return(inst_inc(code)); + case 0x35: return(inst_dec(code)); + case 0x37: return(inst_scf(code)); + + case 0x38: return(inst_jr(code)); + case 0x39: return(inst_add(code)); + case 0x3a: return inst_ldd(code); + case 0x3b: case 0x3d: return(inst_dec(code)); + case 0x3c: return(inst_inc(code)); + case 0x3e: return(inst_ld(code)); + case 0x3f: return(inst_ccf(code)); + + case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: + case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f: + return(inst_ld(code)); + + case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: + case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: + return(inst_ld(code)); + + case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: + case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: + return(inst_ld(code)); + + case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x77: + case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: + return(inst_ld(code)); + case 0x76: return(inst_halt(code)); + + case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: + return(inst_add(code)); + case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f: + return(inst_adc(code)); + + case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97: + return(inst_sub(code)); + case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f: + return(inst_sbc(code)); + + case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7: + return(inst_and(code)); + case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: + return(inst_xor(code)); + + case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: + return(inst_or(code)); + case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf: + return(inst_cp(code)); + + case 0xc0: return(inst_ret(code)); + case 0xc1: return(inst_pop(code)); + case 0xc2: case 0xc3: return(inst_jp(code)); + case 0xc4: return(inst_call(code)); + case 0xc5: return(inst_push(code)); + case 0xc6: return(inst_add(code)); + case 0xc7: return(inst_rst(code)); + + case 0xc8: case 0xc9: return(inst_ret(code)); + case 0xca: return(inst_jp(code)); + + /* CB escapes out to 2 byte opcodes(CB include), opcodes + to do register bit manipulations */ + case 0xcb: return(inst_cb( )); + case 0xcc: case 0xcd: return(inst_call(code)); + case 0xce: return(inst_adc(code)); + case 0xcf: return(inst_rst(code)); + + case 0xd0: return(inst_ret(code)); + case 0xd1: return(inst_pop(code)); + case 0xd2: return(inst_jp(code)); + case 0xd3: break; + case 0xd4: return(inst_call(code)); + case 0xd5: return(inst_push(code)); + case 0xd6: return(inst_sub(code)); + case 0xd7: return(inst_rst(code)); + + case 0xd8: return(inst_ret(code)); + case 0xd9: return(inst_reti(code)); + case 0xda: return(inst_jp(code)); + case 0xdb: break; + case 0xdc: return(inst_call(code)); + + case 0xdd: break; /* IX register doesn't exist on the LR35902 */ + case 0xde: return(inst_sbc(code)); + case 0xdf: return(inst_rst(code)); + + + case 0xe0: return(inst_ldh(code)); + case 0xe1: return(inst_pop(code)); + case 0xe2: return(inst_ldh(code)); + case 0xe3: + case 0xe4: break; + case 0xe5: return(inst_push(code)); + case 0xe6: return(inst_and(code)); + case 0xe7: return(inst_rst(code)); + + case 0xe8: return(inst_add_sp_d(code)); + case 0xe9: return(inst_jp(code)); + case 0xea: return(inst_ld16(code)); + case 0xeb: + case 0xec: case 0xed: break; + case 0xee: return(inst_xor(code)); + case 0xef: return(inst_rst(code)); + + case 0xf0: return(inst_ldh(code)); + case 0xf1: return(inst_pop(code)); + case 0xf2: return(inst_ldh(code)); + case 0xf3: return(inst_di(code)); + case 0xf4: break; + case 0xf5: return(inst_push(code)); + case 0xf6: return(inst_or(code)); + case 0xf7: return(inst_rst(code)); + + case 0xf8: return(inst_ldhl_sp(code)); + case 0xf9: return(inst_ld(code)); + case 0xfa: return(inst_ld16(code)); + case 0xfb: return(inst_ei(code)); + case 0xfc: + case 0xfd: break; + case 0xfe: return(inst_cp(code)); + case 0xff: return(inst_rst(code)); + } + + PC= rom->inc_address(PC, -1); + + sim->stop(resINV_INST); + return(resINV_INST); +} diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/z80.src/lr35902cl.h sdcc-3.2.0+dfsg/sim/ucsim/z80.src/lr35902cl.h --- sdcc-3.1.0+dfsg/sim/ucsim/z80.src/lr35902cl.h 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/z80.src/lr35902cl.h 2012-01-10 04:32:27.000000000 +0000 @@ -0,0 +1,116 @@ +/* + * Simulator of microcontrollers (lr35902cl.h) + * + */ + +/* This file is part of microcontroller simulator: ucsim. + +UCSIM 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. + +UCSIM 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 UCSIM; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ +/*@1@*/ + +#ifndef LR35902_CL +#define LR35902_CL + +#include "z80cl.h" + +class cl_lr35902; + +const t_addr lr35902_rom_start = 0x0000; +const t_addr lr35902_rom_size = 0x6000; + +const t_addr lr35902_ram_start = 0xA000; +const t_addr lr35902_ram_size = 0x5F80; + +class lr35902_memory +{ + protected: + cl_uc &uc_r; + + public: + cl_memory *rom; + cl_memory *ram; + + lr35902_memory( cl_uc &uc_p ); + + virtual void init( void ); + + + virtual void store1( TYPE_UWORD addr, t_mem val ); + virtual void store2( TYPE_UWORD addr, TYPE_UWORD val ); + + virtual TYPE_UBYTE get1( TYPE_UWORD addr ); + virtual TYPE_UWORD get2( TYPE_UWORD addr ); + + // fetch not included b/c it only uses the rom +}; + + +class cl_lr35902: public cl_z80 +{ +public: + lr35902_memory mem; + +public: + cl_lr35902(int Itype, int Itech, class cl_sim *asim); + virtual int init(void); + virtual const char *id_string(void); + + //virtual t_addr get_mem_size(enum mem_class type); + virtual void mk_hw_elements(void); + virtual void make_memories(void); + + virtual struct dis_entry *dis_tbl(void); + virtual int inst_length(t_addr addr); + virtual int inst_branch(t_addr addr); + virtual int longest_inst(void); + virtual const char *disass(t_addr addr, const char *sep); + virtual void print_regs(class cl_console_base *con); + + virtual int exec_inst(void); + + virtual const char *get_disasm_info(t_addr addr, + int *ret_len, + int *ret_branch, + int *immed_offset); + + + // memory access altered to use the 'mem' object + virtual void store1( TYPE_UWORD addr, t_mem val ); + virtual void store2( TYPE_UWORD addr, TYPE_UWORD val ); + + virtual TYPE_UBYTE get1( TYPE_UWORD addr ); + virtual TYPE_UWORD get2( TYPE_UWORD addr ); + + + // see #include "instcl.h" for Z80 versions + /* instruction function that are add / modified from the Z80 versions */ + virtual int inst_cb(void); + + virtual int inst_st_sp_abs(t_mem code); + virtual int inst_stop0 (t_mem code); + + virtual int inst_ldi (t_mem code); + virtual int inst_ldd (t_mem code); + virtual int inst_ldh (t_mem code); + + virtual int inst_reti (t_mem code); + virtual int inst_add_sp_d(t_mem code); + virtual int inst_ld16 (t_mem code); + virtual int inst_ldhl_sp (t_mem code); + +}; + +#endif /* LR35902_CL */ diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/z80.src/r2k.cc sdcc-3.2.0+dfsg/sim/ucsim/z80.src/r2k.cc --- sdcc-3.1.0+dfsg/sim/ucsim/z80.src/r2k.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/z80.src/r2k.cc 2012-05-15 04:39:50.000000000 +0000 @@ -66,6 +66,12 @@ type= Itype; } +cl_r3ka::cl_r3ka(int Itype, int Itech, class cl_sim *asim): + cl_r2k(Itype, Itech, asim) +{ + SU = 0; +} + int cl_r2k::init(void) { @@ -89,6 +95,11 @@ return("rabbit 2000"); } +const char * +cl_r3ka::id_string(void) +{ + return("rabbit 3000A"); +} /* * Making elements of the controller @@ -436,7 +447,9 @@ cl_r2k::exec_inst(void) { t_mem code; - + + ins_start = PC; + if (fetch(&code)) return(resBREAKPOINT); tick(1); @@ -444,13 +457,18 @@ /* handling for IOI and IOE prefixes */ mmu.io_flag = 0; if ((code == 0xd3) || (code == 0xdb)) { - mmu.io_flag = (code == 0xdb) ? IOI : IOE; + mmu.io_flag = (code == 0xd3) ? IOI : IOE; if (fetch(&code)) return(resBREAKPOINT); tick(1); } + return exec_code( code ); +} + +int cl_r2k::exec_code(t_mem code) +{ switch (code) { case 0x00: return(inst_nop(code)); @@ -466,7 +484,6 @@ case 0x0c: return(inst_inc(code)); case 0x0f: return(inst_rrca(code)); - case 0x10: return(inst_djnz(code)); case 0x11: case 0x12: case 0x16: return(inst_ld(code)); case 0x13: case 0x14: return(inst_inc(code)); @@ -642,5 +659,17 @@ return(resINV_INST); } +int cl_r3ka::exec_code(t_mem code) +{ + if (code == 0x5B) + { + // IDET + // if (EDMR && (SU & 0x01)) + // system violation interrupt... + ; + } + + return cl_r2k::exec_code(code); +} /* End of z80.src/z80.cc */ diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/z80.src/r2kcl.h sdcc-3.2.0+dfsg/sim/ucsim/z80.src/r2kcl.h --- sdcc-3.1.0+dfsg/sim/ucsim/z80.src/r2kcl.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/z80.src/r2kcl.h 2012-05-15 03:59:44.000000000 +0000 @@ -73,7 +73,7 @@ rabbit_mmu mmu; - + TYPE_UWORD ins_start; /* PC value for start of the current instruction */ TYPE_UBYTE ip; /* interrupt priority register */ /* iir, eir registers are not full supported */ @@ -101,7 +101,8 @@ virtual void print_regs(class cl_console_base *con); virtual int exec_inst(void); - + virtual int exec_code(t_mem code); + virtual const char *get_disasm_info(t_addr addr, int *ret_len, int *ret_branch, @@ -144,9 +145,23 @@ virtual int inst_rr_hl(t_mem code); virtual int inst_xd(t_mem prefix); - virtual int inst_ed(void); + + //virtual int inst_ed(void); virtual int inst_ed_(t_mem code); }; +class cl_r3ka: public cl_r2k { + public: + + TYPE_UBYTE SU; + + cl_r3ka(int Itype, int Itech, class cl_sim *asim); + virtual const char *id_string(void); + + virtual int exec_code(t_mem code); + + virtual int inst_ed_(t_mem code); +}; + #endif /* R2KCL_HEADER */ diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/z80.src/simz80.cc sdcc-3.2.0+dfsg/sim/ucsim/z80.src/simz80.cc --- sdcc-3.1.0+dfsg/sim/ucsim/z80.src/simz80.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/z80.src/simz80.cc 2012-05-15 03:59:44.000000000 +0000 @@ -31,6 +31,7 @@ #include "simz80cl.h" #include "z80cl.h" #include "r2kcl.h" +#include "lr35902cl.h" cl_simz80::cl_simz80(class cl_app *the_app): cl_sim(the_app) @@ -67,7 +68,13 @@ // Add Rabbits, etc here. case CPU_R2K: - return(new cl_r2k(cpus_z80[i].type, cpus_z80[i].technology, this)); + return(new cl_r2k (cpus_z80[i].type, cpus_z80[i].technology, this)); + + case CPU_R3KA: + return(new cl_r3ka(cpus_z80[i].type, cpus_z80[i].technology, this)); + + case CPU_LR35902: + return(new cl_lr35902(cpus_z80[i].type, cpus_z80[i].technology, this)); } return(NULL); diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/z80.src/z80.cc sdcc-3.2.0+dfsg/sim/ucsim/z80.src/z80.cc --- sdcc-3.1.0+dfsg/sim/ucsim/z80.src/z80.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/z80.src/z80.cc 2012-01-10 04:32:27.000000000 +0000 @@ -658,4 +658,8 @@ return (c2 << 8) | c1; } +t_mem cl_z80::peek1 ( void ) { + return rom->read(PC); +} + /* End of z80.src/z80.cc */ diff -Nru sdcc-3.1.0+dfsg/sim/ucsim/z80.src/z80cl.h sdcc-3.2.0+dfsg/sim/ucsim/z80.src/z80cl.h --- sdcc-3.1.0+dfsg/sim/ucsim/z80.src/z80cl.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/sim/ucsim/z80.src/z80cl.h 2012-01-10 04:32:27.000000000 +0000 @@ -75,6 +75,7 @@ virtual t_mem fetch1( void ); virtual TYPE_UWORD fetch2( void ); + virtual t_mem peek1 ( void ); //virtual t_mem fetch(void); diff -Nru sdcc-3.1.0+dfsg/src/Makefile.in sdcc-3.2.0+dfsg/src/Makefile.in --- sdcc-3.1.0+dfsg/src/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/Makefile.in 2012-03-30 20:01:27.000000000 +0000 @@ -34,7 +34,7 @@ SDCCBBlock.o SDCCloop.o SDCCcse.o SDCCcflow.o SDCCdflow.o \ SDCClrange.o SDCCptropt.o SDCCpeeph.o SDCCglue.o \ SDCCasm.o SDCCmacro.o SDCCutil.o SDCCdebug.o cdbFile.o SDCCdwarf2.o\ - SDCCerr.o SDCCsystem.o + SDCCerr.o SDCCsystem.o SDCCgen.o SPECIAL = SDCCy.h ifeq ($(USE_ALT_LEX), 1) @@ -45,7 +45,11 @@ endif SLIBSOURCES = $(patsubst %.o,$(SLIB)/%.c,$(SLIBOBJS)) -SOURCES = $(patsubst %.o,%.c,$(OBJECTS)) +SOURCES := $(patsubst %.o,%.c,$(OBJECTS)) + +# C++ sources (.cc extension) +CXXSOURCES += $(notdir $(wildcard $(srcdir)/*.cc)) +OBJECTS += $(patsubst %.cc,%.o,$(CXXSOURCES)) TARGET = $(top_builddir)/bin/sdcc$(EXEEXT) @@ -93,8 +97,8 @@ # --------------------- dep: version.h Makefile.dep -Makefile.dep: version.h $(SOURCES) $(SLIBSOURCES) $(SPECIAL) - $(MAKEDEP) $(CPPFLAGS) $(filter %.c,$^) >Makefile.dep +Makefile.dep: version.h $(SOURCES) $(CXXSOURCES) $(SLIBSOURCES) $(SPECIAL) + $(MAKEDEP) $(CPPFLAGS) $(filter %.c,$^) $(filter %.cc,$^) >Makefile.dep # don't include Makefile.dep for the listed targets: ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs checkconf \ @@ -126,7 +130,7 @@ $(YACC) -d -v -o $@ $< SDCClex.c: SDCC.lex SDCCy.h - $(LEX) -t $< >$@ + $(LEX) -8 -f -t $< >$@ version.h: ../ChangeLog $(AWK) -f $(srcdir)/version.awk $< > $@ diff -Nru sdcc-3.1.0+dfsg/src/SDCC.lex sdcc-3.2.0+dfsg/src/SDCC.lex --- sdcc-3.1.0+dfsg/src/SDCC.lex 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCC.lex 2012-06-27 18:05:30.000000000 +0000 @@ -38,13 +38,18 @@ #include "common.h" #include "newalloc.h" #include "dbuf_string.h" +/* Needed by flex 2.5.4 on NetBSD 5.0.1 sparc64 */ +#ifdef HAVE_UNISTD_H +#include +#endif +/* MSVC has no unistd.h but has read() declaration in io.h */ +#if defined(_MSC_VER) +# include +#endif #define TKEYWORD(token) return (isTargetKeyword(yytext) ? token :\ check_type()) -#define TKEYWORDSDCC(token) return (options.std_sdcc && isTargetKeyword(yytext)\ - ? deprecated_keyword (yytext), token : check_type()) - #define TKEYWORD99(token) return (options.std_c99 ? token : check_type()) int column = 0; /* current column */ @@ -64,21 +69,13 @@ static int process_pragma (const char *); static int check_type (void); static int isTargetKeyword (const char *s); -static int checkCurrFile (const char *s); -static void deprecated_keyword (char *yytext); +static void checkCurrFile (const char *s); %} %x asm %% -_?"_asm" { +"__asm" { count (); - if (yytext[1] != '_') /* deprecated single underscore */ - { - if (!options.std_sdcc) - return check_type (); - else - deprecated_keyword (yytext); - } if (asmbuff.buf == NULL) dbuf_init (&asmbuff, INITIAL_INLINEASM); else @@ -86,129 +83,90 @@ BEGIN (asm); } -_?"_endasm" { +"__endasm" { count (); - if (yytext[1] != '_') /* deprecated single underscore */ - { - if (!options.std_sdcc) - dbuf_append_str (&asmbuff, yytext); - else - { - deprecated_keyword (yytext); - yylval.yyinline = dbuf_c_str (&asmbuff); - BEGIN (INITIAL); - return INLINEASM; - } - } - else - { - yylval.yyinline = dbuf_c_str (&asmbuff); - BEGIN (INITIAL); - return INLINEASM; - } + yylval.yystr = dbuf_c_str (&asmbuff); + BEGIN (INITIAL); + return INLINEASM; } -\n { +\n { count (); dbuf_append_char(&asmbuff, *yytext); } -. { +. { dbuf_append_char(&asmbuff, *yytext); } -"at" { count (); TKEYWORDSDCC (AT); } -"__at" { count (); TKEYWORD (AT); } -"auto" { count (); return AUTO; } -"bit" { count (); TKEYWORDSDCC (BIT); } -"__bit" { count (); TKEYWORD (BIT); } -"_Bool" { count (); TKEYWORD99 (SD_BOOL); } -"break" { count (); return BREAK; } -"case" { count (); return CASE; } -"char" { count (); return SD_CHAR; } -"code" { count (); TKEYWORDSDCC (CODE); } -"__code" { count (); TKEYWORD (CODE); } -"const" { count (); return SD_CONST; } -"continue" { count (); return CONTINUE; } -"critical" { count (); TKEYWORDSDCC (CRITICAL); } -"__critical" { count (); TKEYWORD (CRITICAL); } -"data" { count (); TKEYWORDSDCC (DATA); } -"__data" { count (); TKEYWORD (DATA); } -"default" { count (); return DEFAULT; } -"do" { count (); return DO; } -"double" { count (); werror (W_DOUBLE_UNSUPPORTED); return SD_FLOAT; } -"else" { count (); return ELSE; } -"enum" { count (); return ENUM; } -"extern" { count (); return EXTERN; } -"far" { count (); TKEYWORDSDCC (XDATA); } -"__far" { count (); TKEYWORD (XDATA); } -"eeprom" { count (); TKEYWORDSDCC (EEPROM); } -"__eeprom" { count (); TKEYWORD (EEPROM); } -"float" { count (); return SD_FLOAT; } -"fixed16x16" { count (); TKEYWORDSDCC (FIXED16X16); } -"__fixed16x16" { count (); TKEYWORD (FIXED16X16); } -"flash" { count (); TKEYWORDSDCC (CODE); } -"__flash" { count (); TKEYWORD (CODE); } -"for" { count (); return FOR; } -"goto" { count (); return GOTO; } -"idata" { count (); TKEYWORDSDCC (IDATA); } -"__idata" { count (); TKEYWORD (IDATA); } -"if" { count (); return IF; } -"int" { count (); return SD_INT; } -"interrupt" { count (); TKEYWORDSDCC (INTERRUPT); } -"__interrupt" { count (); TKEYWORD (INTERRUPT); } -"nonbanked" { count (); TKEYWORDSDCC (NONBANKED); } -"__nonbanked" { count (); TKEYWORD (NONBANKED); } -"banked" { count (); TKEYWORDSDCC (BANKED); } -"__banked" { count (); TKEYWORD (BANKED); } -"long" { count (); return SD_LONG; } -"near" { count (); TKEYWORDSDCC (DATA); } -"__near" { count (); TKEYWORD (DATA); } -"pdata" { count (); TKEYWORDSDCC (PDATA); } -"__pdata" { count (); TKEYWORD (PDATA); } -"reentrant" { count (); TKEYWORDSDCC (REENTRANT); } -"__reentrant" { count (); TKEYWORD (REENTRANT); } -"shadowregs" { count (); TKEYWORDSDCC (SHADOWREGS); } -"__shadowregs" { count (); TKEYWORD (SHADOWREGS); } -"wparam" { count (); TKEYWORDSDCC (SD_WPARAM); } -"__wparam" { count (); TKEYWORD (SD_WPARAM); } -"register" { count (); return REGISTER; } -"return" { count (); return RETURN; } -"sfr" { count (); TKEYWORDSDCC (SFR); } -"__sfr" { count (); TKEYWORD (SFR); } -"sfr16" { count (); TKEYWORDSDCC (SFR16); } -"__sfr16" { count (); TKEYWORD (SFR16); } -"sfr32" { count (); TKEYWORDSDCC (SFR32); } -"__sfr32" { count (); TKEYWORD (SFR32); } -"sbit" { count (); TKEYWORDSDCC (SBIT); } -"__sbit" { count (); TKEYWORD (SBIT); } -"short" { count (); return SD_SHORT; } -"signed" { count (); return SIGNED; } -"sizeof" { count (); return SIZEOF; } -"__builtin_offsetof" { count (); return OFFSETOF; } -"sram" { count (); TKEYWORDSDCC (XDATA); } -"__sram" { count (); TKEYWORD (XDATA); } -"static" { count (); return STATIC; } -"struct" { count (); return STRUCT; } -"switch" { count (); return SWITCH; } -"typedef" { count (); return TYPEDEF; } -"union" { count (); return UNION; } -"unsigned" { count (); return UNSIGNED; } -"void" { count (); return SD_VOID; } -"volatile" { count (); return VOLATILE; } -"using" { count (); TKEYWORDSDCC (USING); } -"__using" { count (); TKEYWORD (USING); } -"_naked" { count (); TKEYWORDSDCC (NAKED); } -"__naked" { count (); TKEYWORD (NAKED); } -"while" { count (); return WHILE; } -"xdata" { count (); TKEYWORDSDCC (XDATA); } -"__xdata" { count (); TKEYWORD (XDATA); } -"..." { count (); return VAR_ARGS; } -"__typeof" { count (); return TYPEOF; } -"_JavaNative" { count (); TKEYWORD (JAVANATIVE); } -"_overlay" { count (); TKEYWORDSDCC (OVERLAY); } -"__overlay" { count (); TKEYWORD (OVERLAY); } -"inline" { count (); TKEYWORD99 (INLINE); } -"restrict" { count (); TKEYWORD99 (RESTRICT); } -"__smallc" { count (); return SMALLC; } -{L}({L}|{D})* { +"__asm__" { count (); return ASM; } +"__at" { count (); TKEYWORD (AT); } +"auto" { count (); return AUTO; } +"__bit" { count (); TKEYWORD (BIT); } +"_Bool" { count (); TKEYWORD99 (SD_BOOL); } +"break" { count (); return BREAK; } +"case" { count (); return CASE; } +"char" { count (); return SD_CHAR; } +"__code" { count (); TKEYWORD (CODE); } +"const" { count (); return SD_CONST; } +"continue" { count (); return CONTINUE; } +"__critical" { count (); TKEYWORD (CRITICAL); } +"__data" { count (); TKEYWORD (DATA); } +"default" { count (); return DEFAULT; } +"do" { count (); return DO; } +"double" { count (); werror (W_DOUBLE_UNSUPPORTED); return SD_FLOAT; } +"else" { count (); return ELSE; } +"enum" { count (); return ENUM; } +"extern" { count (); return EXTERN; } +"__far" { count (); TKEYWORD (XDATA); } +"__eeprom" { count (); TKEYWORD (EEPROM); } +"float" { count (); return SD_FLOAT; } +"__fixed16x16" { count (); TKEYWORD (FIXED16X16); } +"__flash" { count (); TKEYWORD (CODE); } +"for" { count (); return FOR; } +"goto" { count (); return GOTO; } +"__idata" { count (); TKEYWORD (IDATA); } +"if" { count (); return IF; } +"int" { count (); return SD_INT; } +"__interrupt" { count (); TKEYWORD (INTERRUPT); } +"__nonbanked" { count (); TKEYWORD (NONBANKED); } +"__banked" { count (); TKEYWORD (BANKED); } +"long" { count (); return SD_LONG; } +"__near" { count (); TKEYWORD (DATA); } +"__pdata" { count (); TKEYWORD (PDATA); } +"__reentrant" { count (); TKEYWORD (REENTRANT); } +"__shadowregs" { count (); TKEYWORD (SHADOWREGS); } +"__wparam" { count (); TKEYWORD (SD_WPARAM); } +"register" { count (); return REGISTER; } +"return" { count (); return RETURN; } +"__sfr" { count (); TKEYWORD (SFR); } +"__sfr16" { count (); TKEYWORD (SFR16); } +"__sfr32" { count (); TKEYWORD (SFR32); } +"__sbit" { count (); TKEYWORD (SBIT); } +"short" { count (); return SD_SHORT; } +"signed" { count (); return SIGNED; } +"sizeof" { count (); return SIZEOF; } +"__builtin_offsetof" { count (); return OFFSETOF; } +"__sram" { count (); TKEYWORD (XDATA); } +"static" { count (); return STATIC; } +"struct" { count (); return STRUCT; } +"switch" { count (); return SWITCH; } +"typedef" { count (); return TYPEDEF; } +"union" { count (); return UNION; } +"unsigned" { count (); return UNSIGNED; } +"void" { count (); return SD_VOID; } +"volatile" { count (); return VOLATILE; } +"__using" { count (); TKEYWORD (USING); } +"__naked" { count (); TKEYWORD (NAKED); } +"while" { count (); return WHILE; } +"__xdata" { count (); TKEYWORD (XDATA); } +"..." { count (); return VAR_ARGS; } +"__typeof" { count (); return TYPEOF; } +"_JavaNative" { count (); TKEYWORD (JAVANATIVE); } +"__overlay" { count (); TKEYWORD (OVERLAY); } +"inline" { count (); TKEYWORD99 (INLINE); } +"_Noreturn" { count (); return NORETURN;} +"restrict" { count (); TKEYWORD99 (RESTRICT); } +"__smallc" { count (); return SMALLC; } +"__addressmod" { count (); return ADDRESSMOD; } +{L}({L}|{D})* { if (!options.dollars_in_ident && strchr (yytext, '$')) { yyerror ("stray '$' in program"); @@ -216,7 +174,7 @@ count (); return check_type(); } -0[bB]{B}+{IS}? { +0[bB]{B}+{IS}? { if (!options.std_sdcc) { yyerror ("binary (0b) constants are not allowed in ISO C"); @@ -225,68 +183,66 @@ yylval.val = constVal (yytext); return CONSTANT; } -0[xX]{H}+{IS}? { count (); yylval.val = constVal (yytext); return CONSTANT; } -0[0-7]*{IS}? { count (); yylval.val = constVal (yytext); return CONSTANT; } -[1-9]{D}*{IS}? { count (); yylval.val = constVal (yytext); return CONSTANT; } -'(\\.|[^\\'])+' { count (); yylval.val = charVal (yytext); return CONSTANT; /* ' make syntax highliter happy */ } -{D}+{E}{FS}? { count (); yylval.val = constFloatVal (yytext);return CONSTANT; } -{D}*"."{D}+({E})?{FS}? { count (); yylval.val = constFloatVal (yytext);return CONSTANT; } -{D}+"."{D}*({E})?{FS}? { count (); yylval.val = constFloatVal (yytext);return CONSTANT; } -\" { count (); yylval.val = strVal (stringLiteral ()); return STRING_LITERAL; } -">>=" { count (); yylval.yyint = RIGHT_ASSIGN; return RIGHT_ASSIGN; } -"<<=" { count (); yylval.yyint = LEFT_ASSIGN; return LEFT_ASSIGN; } -"+=" { count (); yylval.yyint = ADD_ASSIGN; return ADD_ASSIGN; } -"-=" { count (); yylval.yyint = SUB_ASSIGN; return SUB_ASSIGN; } -"*=" { count (); yylval.yyint = MUL_ASSIGN; return MUL_ASSIGN; } -"/=" { count (); yylval.yyint = DIV_ASSIGN; return DIV_ASSIGN; } -"%=" { count (); yylval.yyint = MOD_ASSIGN; return MOD_ASSIGN; } -"&=" { count (); yylval.yyint = AND_ASSIGN; return AND_ASSIGN; } -"^=" { count (); yylval.yyint = XOR_ASSIGN; return XOR_ASSIGN; } -"|=" { count (); yylval.yyint = OR_ASSIGN; return OR_ASSIGN; } -">>" { count (); return RIGHT_OP; } -"<<" { count (); return LEFT_OP; } -"++" { count (); return INC_OP; } -"--" { count (); return DEC_OP; } -"->" { count (); return PTR_OP; } -"&&" { count (); return AND_OP; } -"||" { count (); return OR_OP; } -"<=" { count (); return LE_OP; } -">=" { count (); return GE_OP; } -"==" { count (); return EQ_OP; } -"!=" { count (); return NE_OP; } -";" { count (); return ';'; } -"{"|"<%" { count (); ++NestLevel; ignoreTypedefType = 0; return '{'; } -"}"|"%>" { count (); --NestLevel; return '}'; } -"," { count (); return ','; } -":" { count (); return ':'; } -"=" { count (); return '='; } -"(" { count (); ignoreTypedefType = 0; return '('; } -")" { count (); return ')'; } -"["|"<:" { count (); return '['; } -"]"|":>" { count (); return ']'; } -"." { count (); return '.'; } -"&" { count (); return '&'; } -"!" { count (); return '!'; } -"~" { count (); return '~'; } -"-" { count (); return '-'; } -"+" { count (); return '+'; } -"*" { count (); return '*'; } -"/" { count (); return '/'; } -"%" { count (); return '%'; } -"<" { count (); return '<'; } -">" { count (); return '>'; } -"^" { count (); return '^'; } -"|" { count (); return '|'; } -"?" { count (); return '?'; } -^{HASH}pragma.*$ { count (); process_pragma (yytext); } -^({HASH}line.*"\n")|({HASH}.*"\n") { count (); checkCurrFile (yytext); } - -^[^(]+"("[0-9]+") : error"[^\n]+ { werror (E_PRE_PROC_FAILED, yytext); count (); } -^[^(]+"("[0-9]+") : warning"[^\n]+ { werror (W_PRE_PROC_WARNING, yytext); count (); } -"\r\n" { count (); } -"\n" { count (); } -[ \t\v\f] { count (); } -\\ { +0[xX]{H}+{IS}? { count (); yylval.val = constVal (yytext); return CONSTANT; } +0[0-7]*{IS}? { count (); yylval.val = constVal (yytext); return CONSTANT; } +[1-9]{D}*{IS}? { count (); yylval.val = constVal (yytext); return CONSTANT; } +'(\\.|[^\\'])+' { count (); yylval.val = charVal (yytext); return CONSTANT; /* ' make syntax highliter happy */ } +{D}+{E}{FS}? { count (); yylval.val = constFloatVal (yytext); return CONSTANT; } +{D}*"."{D}+({E})?{FS}? { count (); yylval.val = constFloatVal (yytext); return CONSTANT; } +{D}+"."{D}*({E})?{FS}? { count (); yylval.val = constFloatVal (yytext); return CONSTANT; } +\" { count (); yylval.yystr = stringLiteral (); return STRING_LITERAL; } +">>=" { count (); yylval.yyint = RIGHT_ASSIGN; return RIGHT_ASSIGN; } +"<<=" { count (); yylval.yyint = LEFT_ASSIGN; return LEFT_ASSIGN; } +"+=" { count (); yylval.yyint = ADD_ASSIGN; return ADD_ASSIGN; } +"-=" { count (); yylval.yyint = SUB_ASSIGN; return SUB_ASSIGN; } +"*=" { count (); yylval.yyint = MUL_ASSIGN; return MUL_ASSIGN; } +"/=" { count (); yylval.yyint = DIV_ASSIGN; return DIV_ASSIGN; } +"%=" { count (); yylval.yyint = MOD_ASSIGN; return MOD_ASSIGN; } +"&=" { count (); yylval.yyint = AND_ASSIGN; return AND_ASSIGN; } +"^=" { count (); yylval.yyint = XOR_ASSIGN; return XOR_ASSIGN; } +"|=" { count (); yylval.yyint = OR_ASSIGN; return OR_ASSIGN; } +">>" { count (); return RIGHT_OP; } +"<<" { count (); return LEFT_OP; } +"++" { count (); return INC_OP; } +"--" { count (); return DEC_OP; } +"->" { count (); return PTR_OP; } +"&&" { count (); return AND_OP; } +"||" { count (); return OR_OP; } +"<=" { count (); return LE_OP; } +">=" { count (); return GE_OP; } +"==" { count (); return EQ_OP; } +"!=" { count (); return NE_OP; } +";" { count (); return ';'; } +"{"|"<%" { count (); ignoreTypedefType = 0; return '{'; } +"}"|"%>" { count (); return '}'; } +"," { count (); return ','; } +":" { count (); return ':'; } +"=" { count (); return '='; } +"(" { count (); ignoreTypedefType = 0; return '('; } +")" { count (); return ')'; } +"["|"<:" { count (); return '['; } +"]"|":>" { count (); return ']'; } +"." { count (); return '.'; } +"&" { count (); return '&'; } +"!" { count (); return '!'; } +"~" { count (); return '~'; } +"-" { count (); return '-'; } +"+" { count (); return '+'; } +"*" { count (); return '*'; } +"/" { count (); return '/'; } +"%" { count (); return '%'; } +"<" { count (); return '<'; } +">" { count (); return '>'; } +"^" { count (); return '^'; } +"|" { count (); return '|'; } +"?" { count (); return '?'; } +^{HASH}pragma.* { count (); process_pragma (yytext); } +^{HASH}.* { count (); checkCurrFile (yytext); } + +"\r\n" { count (); } +"\n" { count (); } +[ \t\v\f] { count (); } +\\ { int ch = input (); if (ch == '\n') @@ -298,7 +254,7 @@ unput (ch); } } -. { count (); } +. { count (); } %% /* flex 2.5.31 undefines yytext_ptr, so we have to define it again */ @@ -307,86 +263,67 @@ #endif static void -deprecated_keyword (char *yytext) -{ - struct dbuf_s dbuf; - - dbuf_init (&dbuf, 32); - - dbuf_append_char (&dbuf, '_'); - if ('_' != yytext[0]) - dbuf_append_char (&dbuf, '_'); - dbuf_append_str (&dbuf, yytext); - werror (W_DEPRECATED_KEYWORD, yytext, dbuf_c_str(&dbuf)); - dbuf_destroy (&dbuf); -} - -static int checkCurrFile (const char *s) { - int lNum; + int lNum; char *tptr; /* skip '#' character */ if (*s++ != '#') - return 0; - - /* check if this is a #line - this is not standard and can be removed in the future */ -#define LINE_STR "line" -#define LINE_LEN ((sizeof LINE_STR) - 1) - - if (strncmp(s, LINE_STR, LINE_LEN) == 0) - s += LINE_LEN; + return; /* get the line number */ - lNum = strtol(s, &tptr, 10); - if (tptr == s || !isspace((unsigned char)*tptr)) - return 0; + lNum = strtol (s, &tptr, 10); + if (tptr == s || !isspace ((unsigned char) *tptr)) + return; s = tptr; /* adjust the line number */ - lineno = lexLineno = lNum; + lineno = lexLineno = lNum - 1; /* now see if we have a file name */ while (*s != '"' && *s) ++s; - if (!*s) - { - /* no file name: return */ - return 0; - } - - /* skip the double quote */ - ++s; - - /* get the file name and see if it is different from current one. - in c1mode fullSrcFileName is NULL */ - if (fullSrcFileName && - strncmp(s, fullSrcFileName, strlen(fullSrcFileName)) == 0 && fullSrcFileName[strlen(fullSrcFileName) - 1] == '"') + if (*s) { - lexFilename = (char *) fullSrcFileName; - } - else - { - const char *sb = s; - char *tmpFname; - - /* find the end of the file name */ + /* there is a file name */ + const char *sb; + struct dbuf_s dbuf; + + dbuf_init (&dbuf, 128); + + /* skip the double quote */ + sb = ++s; + + /* preprocessor emits escaped file names + * (e.g. double backslashes on MSDOS-ish file systems), + * so we have to unescape it */ while (*s && *s != '"') - ++s; + { + if (*s == '\\') + { + /* append chars before backslash */ + dbuf_append (&dbuf, sb, s - sb); + if (*++s) + { + /* append char after backslash */ + dbuf_append (&dbuf, s, 1); + sb = ++s; + } + } + else + ++s; + } + dbuf_append (&dbuf, sb, s - sb); - tmpFname = Safe_malloc(s - sb + 1); - memcpy(tmpFname, sb, s - sb); - tmpFname[s - sb] = '\0'; + /* DON'T free the file name referenced by lexFilename + * since it will be dereferenced in the future at least + * by function printCLine(), see struct iCode members + * filename in SDCCicode.c */ - lexFilename = Safe_malloc(s - sb + 1); - copyStr(lexFilename, tmpFname); + filename = lexFilename = dbuf_detach_c_str (&dbuf); } - filename = lexFilename; - - return 0; } static void @@ -429,17 +366,20 @@ if (!ignoreTypedefType && sym && IS_SPEC (sym->etype) && SPEC_TYPEDEF (sym->etype) && findSym(TypedefTab, NULL, yytext)) return (TYPE_NAME); + /* check if it is a named address space */ + else if (findSym (AddrspaceTab, NULL, yytext)) + return (ADDRSPACE_NAME); else return(IDENTIFIER); } /* - * Change by JTV 2001-05-19 to not concantenate strings + * Change by JTV 2001-05-19 to not concatenate strings * to support ANSI hex and octal escape sequences in string literals */ -static const char -*stringLiteral (void) +static const char * +stringLiteral (void) { #define STR_BUF_CHUNCK_LEN 1024 int ch; @@ -601,6 +541,7 @@ P_OPTCODEBALANCED, P_STD_C89, P_STD_C99, + P_STD_C11, P_STD_SDCC89, P_STD_SDCC99, P_CODESEG, @@ -945,6 +886,7 @@ } options.std_c99 = 0; + options.std_c11 = 0; options.std_sdcc = 0; break; @@ -960,6 +902,19 @@ options.std_sdcc = 0; break; + case P_STD_C11: + cp = get_pragma_token(cp, &token); + if (TOKEN_EOL != token.type) + { + err = 1; + break; + } + + options.std_c99 = 1; + options.std_c11 = 1; + options.std_sdcc = 0; + break; + case P_STD_SDCC89: cp = get_pragma_token(cp, &token); if (TOKEN_EOL != token.type) @@ -969,6 +924,7 @@ } options.std_c99 = 0; + options.std_c11 = 0; options.std_sdcc = 1; break; @@ -981,6 +937,7 @@ } options.std_c99 = 1; + options.std_c11 = 0; options.std_sdcc = 1; break; @@ -1050,6 +1007,7 @@ { "opt_code_balanced", P_OPTCODEBALANCED, 0, doPragma }, { "std_c89", P_STD_C89, 0, doPragma }, { "std_c99", P_STD_C99, 0, doPragma }, + { "std_c11", P_STD_C11, 0, doPragma }, { "std_sdcc89", P_STD_SDCC89, 0, doPragma }, { "std_sdcc99", P_STD_SDCC99, 0, doPragma }, { "codeseg", P_CODESEG, 0, doPragma }, @@ -1174,13 +1132,7 @@ { fflush(stdout); - if(options.vc_err_style) - fprintf(stderr, "\n%s(%d) : %s: token -> '%s' ; column %d\n", - lexFilename, lexLineno, s, yytext, column); - else - fprintf(stderr, "\n%s:%d: %s: token -> '%s' ; column %d\n", - lexFilename, lexLineno, s ,yytext, column); - fatalError++; + werror (S_SYNTAX_ERROR, yytext, column); return 0; } diff -Nru sdcc-3.1.0+dfsg/src/SDCC.y sdcc-3.2.0+dfsg/src/SDCC.y --- sdcc-3.1.0+dfsg/src/SDCC.y 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCC.y 2012-06-07 17:36:23.000000000 +0000 @@ -38,19 +38,19 @@ extern int yyerror (char *); extern FILE *yyin; -int NestLevel = 0 ; /* current NestLevel */ -int stackPtr = 1 ; /* stack pointer */ -int xstackPtr = 0 ; /* xstack pointer */ -int reentrant = 0 ; -int blockNo = 0 ; /* sequential block number */ -int currBlockno=0 ; -int inCritical= 0 ; -int seqPointNo= 1 ; /* sequence point number */ +int NestLevel = 0; /* current NestLevel */ +int stackPtr = 1; /* stack pointer */ +int xstackPtr = 0; /* xstack pointer */ +int reentrant = 0; +int blockNo = 0; /* sequential block number */ +int currBlockno=0; +int inCritical= 0; +int seqPointNo= 1; /* sequence point number */ int ignoreTypedefType=0; extern int yylex(); int yyparse(void); -extern int noLineno ; -char lbuff[1024]; /* local buffer */ +extern int noLineno; +char lbuff[1024]; /* local buffer */ /* break & continue stacks */ STACK_DCL(continueStack ,symbol *,MAX_NEST_LEVEL) @@ -59,7 +59,7 @@ STACK_DCL(swStk ,ast *,MAX_NEST_LEVEL) STACK_DCL(blockNum,int,MAX_NEST_LEVEL*3) -value *cenum = NULL ; /* current enumeration type chain*/ +value *cenum = NULL; /* current enumeration type chain*/ bool uselessDecl = TRUE; #define YYDEBUG 1 @@ -68,39 +68,40 @@ %expect 6 %union { - symbol *sym ; /* symbol table pointer */ - structdef *sdef; /* structure definition */ + symbol *sym; /* symbol table pointer */ + structdef *sdef; /* structure definition */ char yychar[SDCC_NAME_MAX+1]; - sym_link *lnk ; /* declarator or specifier */ - int yyint; /* integer value returned */ - value *val ; /* for integer constant */ - initList *ilist; /* initial list */ - designation*dsgn; /* designator */ - const char *yyinline; /* inlined assembler code */ - ast *asts; /* expression tree */ + sym_link *lnk; /* declarator or specifier */ + int yyint; /* integer value returned */ + value *val; /* for integer constant */ + initList *ilist; /* initial list */ + designation*dsgn; /* designator */ + const char *yystr; /* pointer to dynamicaly allocated string */ + ast *asts; /* expression tree */ } -%token IDENTIFIER TYPE_NAME -%token CONSTANT STRING_LITERAL +%token IDENTIFIER TYPE_NAME ADDRSPACE_NAME +%token CONSTANT %token SIZEOF TYPEOF OFFSETOF %token PTR_OP INC_OP DEC_OP LEFT_OP RIGHT_OP LE_OP GE_OP EQ_OP NE_OP %token AND_OP OR_OP %token MUL_ASSIGN DIV_ASSIGN MOD_ASSIGN ADD_ASSIGN %token SUB_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN %token XOR_ASSIGN OR_ASSIGN -%token TYPEDEF EXTERN STATIC AUTO REGISTER CODE EEPROM INTERRUPT SFR SFR16 SFR32 +%token TYPEDEF EXTERN STATIC AUTO REGISTER CODE EEPROM INTERRUPT SFR SFR16 SFR32 ADDRESSMOD %token AT SBIT REENTRANT USING XDATA DATA IDATA PDATA VAR_ARGS CRITICAL %token NONBANKED BANKED SHADOWREGS SD_WPARAM %token SD_BOOL SD_CHAR SD_SHORT SD_INT SD_LONG SIGNED UNSIGNED SD_FLOAT DOUBLE FIXED16X16 SD_CONST VOLATILE SD_VOID BIT %token STRUCT UNION ENUM RANGE SD_FAR %token CASE DEFAULT IF ELSE SWITCH WHILE DO FOR GOTO CONTINUE BREAK RETURN %token NAKED JAVANATIVE OVERLAY -%token INLINEASM +%token STRING_LITERAL INLINEASM %token IFX ADDRESS_OF GET_VALUE_AT_ADDRESS SPIL UNSPIL GETHBIT GETABIT GETBYTE GETWORD %token BITWISEAND UNARYMINUS IPUSH IPOP PCALL ENDFUNCTION JUMPTABLE %token RRC RLC %token CAST CALL PARAM NULLOP BLOCK LABEL RECEIVE SEND ARRAYINIT -%token DUMMY_READ_VOLATILE ENDCRITICAL SWAP INLINE RESTRICT SMALLC +%token DUMMY_READ_VOLATILE ENDCRITICAL SWAP INLINE NORETURN RESTRICT SMALLC +%token ASM %type Interrupt_storage %type identifier declarator declarator2 declarator3 enumerator_list enumerator @@ -109,6 +110,7 @@ %type declaration init_declarator_list init_declarator %type declaration_list identifier_list %type declarator2_function_attributes while do for critical +%type addressmod %type pointer type_specifier_list type_specifier_list_ type_specifier type_name %type storage_class_specifier struct_or_union_specifier function_specifier %type declaration_specifiers declaration_specifiers_ sfr_reg_bit sfr_attributes @@ -124,11 +126,12 @@ %type expr argument_expr_list function_definition expr_opt %type statement_list statement labeled_statement compound_statement %type expression_statement selection_statement iteration_statement -%type jump_statement function_body else_statement string_literal -%type critical_statement +%type jump_statement function_body else_statement string_literal_val +%type critical_statement asm_statement %type designator designator_list designation designation_opt %type initializer initializer_list %type unary_operator assignment_operator struct_or_union +%type asm_string_literal %start file @@ -136,8 +139,8 @@ file : /* empty */ - { if (!options.lessPedantic) - werror(W_EMPTY_SOURCE_FILE); + { + werror(W_EMPTY_SOURCE_FILE); } | program ; @@ -148,32 +151,32 @@ ; external_definition - : function_definition { - blockNo=0; - } - | declaration { - ignoreTypedefType = 0; - if ($1 && $1->type - && IS_FUNC($1->type)) - { - /* The only legal storage classes for - * a function prototype (declaration) - * are extern and static. extern is the - * default. Thus, if this function isn't - * explicitly marked static, mark it - * extern. - */ - if ($1->etype - && IS_SPEC($1->etype) - && !SPEC_STAT($1->etype)) - { - SPEC_EXTR($1->etype) = 1; - } - } - addSymChain (&$1); - allocVariables ($1) ; - cleanUpLevel (SymbolTab,1); - } + : function_definition + { + // blockNo = 0; + } + | declaration + { + ignoreTypedefType = 0; + if ($1 && $1->type && IS_FUNC($1->type)) + { + /* The only legal storage classes for + * a function prototype (declaration) + * are extern and static. extern is the + * default. Thus, if this function isn't + * explicitly marked static, mark it + * extern. + */ + if ($1->etype && IS_SPEC($1->etype) && !SPEC_STAT($1->etype)) + { + SPEC_EXTR($1->etype) = 1; + } + } + addSymChain (&$1); + allocVariables ($1); + cleanUpLevel (SymbolTab, 1); + } + | addressmod ; function_definition @@ -197,7 +200,7 @@ function_attributes : USING constant_expr { - $$ = newLink(SPECIFIER) ; + $$ = newLink(SPECIFIER); FUNC_REGBANK($$) = (int) ulFromVal(constExprValue($2,TRUE)); } | REENTRANT { $$ = newLink (SPECIFIER); @@ -235,8 +238,8 @@ } | Interrupt_storage { - $$ = newLink (SPECIFIER) ; - FUNC_INTNO($$) = $1 ; + $$ = newLink (SPECIFIER); + FUNC_INTNO($$) = $1; FUNC_ISISR($$) = 1; } | SMALLC { $$ = newLink (SPECIFIER); @@ -248,7 +251,7 @@ : compound_statement | declaration_list compound_statement { - werror (E_OLD_STYLE, ($1 ? $1->name: "")) ; + werror (E_OLD_STYLE, ($1 ? $1->name: "")); exit (1); } ; @@ -260,7 +263,7 @@ ignoreTypedefType = 0; $4 = newSymbol ($4->name, NestLevel); $4->implicit = 1; - $$ = newNode ('.', $1, newAst_VALUE (symbolVal ($4))) ; + $$ = newNode ('.', $1, newAst_VALUE (symbolVal ($4))); } | offsetof_member_designator '[' expr ']' { @@ -271,22 +274,22 @@ primary_expr : identifier { $$ = newAst_VALUE (symbolVal ($1)); } | CONSTANT { $$ = newAst_VALUE ($1); } - | string_literal + | string_literal_val | '(' expr ')' { $$ = $2; } ; -string_literal - : STRING_LITERAL { $$ = newAst_VALUE($1); } +string_literal_val + : STRING_LITERAL { $$ = newAst_VALUE (strVal ($1)); } ; postfix_expr : primary_expr - | postfix_expr '[' expr ']' { $$ = newNode ('[', $1, $3) ; } + | postfix_expr '[' expr ']' { $$ = newNode ('[', $1, $3); } | postfix_expr '(' ')' { $$ = newNode (CALL,$1,NULL); $$->left->funcName = 1;} | postfix_expr '(' argument_expr_list ')' { - $$ = newNode (CALL,$1,$3) ; $$->left->funcName = 1; + $$ = newNode (CALL,$1,$3); $$->left->funcName = 1; } | postfix_expr '.' { ignoreTypedefType = 1; } identifier { @@ -325,12 +328,12 @@ ; unary_operator - : '&' { $$ = '&' ;} - | '*' { $$ = '*' ;} - | '+' { $$ = '+' ;} - | '-' { $$ = '-' ;} - | '~' { $$ = '~' ;} - | '!' { $$ = '!' ;} + : '&' { $$ = '&';} + | '*' { $$ = '*';} + | '+' { $$ = '+';} + | '-' { $$ = '-';} + | '~' { $$ = '~';} + | '!' { $$ = '!';} ; cast_expr @@ -402,8 +405,8 @@ : logical_or_expr | logical_or_expr '?' { seqPointNo++;} logical_or_expr ':' conditional_expr { - $$ = newNode(':',$4,$6) ; - $$ = newNode('?',$1,$$) ; + $$ = newNode(':',$4,$6); + $$ = newNode('?',$1,$$); } ; @@ -454,7 +457,7 @@ ; assignment_operator - : '=' { $$ = '=' ;} + : '=' { $$ = '=';} | MUL_ASSIGN | DIV_ASSIGN | MOD_ASSIGN @@ -479,10 +482,27 @@ declaration : declaration_specifiers ';' { + /* Special case: if incomplete struct/union declared without name, */ + /* make sure an incomplete type for it exists in the current scope */ + if (IS_STRUCT($1)) + { + structdef *sdef = SPEC_STRUCT($1); + structdef *osdef; + osdef = findSymWithBlock (StructTab, sdef->tagsym, currBlockno); + if (osdef && osdef->block != currBlockno) + { + sdef = newStruct(osdef->tagsym->name); + sdef->level = NestLevel; + sdef->block = currBlockno; + sdef->tagsym = newSymbol (osdef->tagsym->name, NestLevel); + addSym (StructTab, sdef, sdef->tag, sdef->level, currBlockno, 0); + uselessDecl = FALSE; + } + } if (uselessDecl) werror(W_USELESS_DECL); uselessDecl = TRUE; - $$ = NULL ; + $$ = NULL; } | declaration_specifiers init_declarator_list ';' { @@ -493,15 +513,15 @@ sym_link *lnk = copyLinkChain($1); /* do the pointer stuff */ pointerTypes(sym->type,lnk); - addDecl (sym,0,lnk) ; + addDecl (sym,0,lnk); } uselessDecl = TRUE; - $$ = sym1 ; + $$ = sym1; } ; -declaration_specifiers : declaration_specifiers_ { $$ = finalizeSpec($1); } ; +declaration_specifiers : declaration_specifiers_ { $$ = finalizeSpec($1); }; declaration_specifiers_ : storage_class_specifier { $$ = $1; } @@ -526,12 +546,12 @@ init_declarator_list : init_declarator - | init_declarator_list ',' init_declarator { $3->next = $1 ; $$ = $3;} + | init_declarator_list ',' init_declarator { $3->next = $1; $$ = $3;} ; init_declarator - : declarator { $1->ival = NULL ; } - | declarator '=' initializer { $1->ival = $3 ; } + : declarator { $1->ival = NULL; } + | declarator '=' initializer { $1->ival = $3; } ; designation_opt @@ -576,36 +596,40 @@ storage_class_specifier : TYPEDEF { - $$ = newLink (SPECIFIER) ; - SPEC_TYPEDEF($$) = 1 ; + $$ = newLink (SPECIFIER); + SPEC_TYPEDEF($$) = 1; } | EXTERN { $$ = newLink(SPECIFIER); - SPEC_EXTR($$) = 1 ; + SPEC_EXTR($$) = 1; } | STATIC { $$ = newLink (SPECIFIER); - SPEC_STAT($$) = 1 ; + SPEC_STAT($$) = 1; } | AUTO { - $$ = newLink (SPECIFIER) ; - SPEC_SCLS($$) = S_AUTO ; + $$ = newLink (SPECIFIER); + SPEC_SCLS($$) = S_AUTO; } | REGISTER { $$ = newLink (SPECIFIER); - SPEC_SCLS($$) = S_REGISTER ; + SPEC_SCLS($$) = S_REGISTER; } ; function_specifier : INLINE { - $$ = newLink (SPECIFIER) ; - SPEC_INLINE($$) = 1 ; + $$ = newLink (SPECIFIER); + SPEC_INLINE($$) = 1; + } + | NORETURN { + $$ = newLink (SPECIFIER); + SPEC_NORETURN($$) = 1; } ; Interrupt_storage - : INTERRUPT { $$ = INTNO_UNSPEC ; } + : INTERRUPT { $$ = INTNO_UNSPEC; } | INTERRUPT constant_expr { int intno = (int) ulFromVal(constExprValue($2,TRUE)); if ((intno >= 0) && (intno <= INTNO_MAX)) @@ -621,27 +645,27 @@ type_specifier : SD_BOOL { $$=newLink(SPECIFIER); - SPEC_NOUN($$) = V_BOOL ; + SPEC_NOUN($$) = V_BOOL; ignoreTypedefType = 1; } | SD_CHAR { $$=newLink(SPECIFIER); - SPEC_NOUN($$) = V_CHAR ; + SPEC_NOUN($$) = V_CHAR; ignoreTypedefType = 1; } | SD_SHORT { $$=newLink(SPECIFIER); - SPEC_SHORT($$) = 1 ; + SPEC_SHORT($$) = 1; ignoreTypedefType = 1; } | SD_INT { $$=newLink(SPECIFIER); - SPEC_NOUN($$) = V_INT ; + SPEC_NOUN($$) = V_INT; ignoreTypedefType = 1; } | SD_LONG { $$=newLink(SPECIFIER); - SPEC_LONG($$) = 1 ; + SPEC_LONG($$) = 1; ignoreTypedefType = 1; } | SIGNED { @@ -651,12 +675,12 @@ } | UNSIGNED { $$=newLink(SPECIFIER); - SPEC_USIGN($$) = 1 ; + SPEC_USIGN($$) = 1; ignoreTypedefType = 1; } | SD_VOID { $$=newLink(SPECIFIER); - SPEC_NOUN($$) = V_VOID ; + SPEC_NOUN($$) = V_VOID; ignoreTypedefType = 1; } | SD_CONST { @@ -665,11 +689,15 @@ } | VOLATILE { $$=newLink(SPECIFIER); - SPEC_VOLATILE($$) = 1 ; + SPEC_VOLATILE($$) = 1; } | RESTRICT { $$=newLink(SPECIFIER); - SPEC_RESTRICT($$) = 1 ; + SPEC_RESTRICT($$) = 1; + } + | ADDRSPACE_NAME { + $$=newLink(SPECIFIER); + SPEC_ADDRSPACE($$) = findSym (AddrspaceTab, 0, $1); } | SD_FLOAT { $$=newLink(SPECIFIER); @@ -683,61 +711,59 @@ } | XDATA { $$ = newLink (SPECIFIER); - SPEC_SCLS($$) = S_XDATA ; + SPEC_SCLS($$) = S_XDATA; } | CODE { - $$ = newLink (SPECIFIER) ; - SPEC_SCLS($$) = S_CODE ; + $$ = newLink (SPECIFIER); + SPEC_SCLS($$) = S_CODE; } | EEPROM { - $$ = newLink (SPECIFIER) ; - SPEC_SCLS($$) = S_EEPROM ; + $$ = newLink (SPECIFIER); + SPEC_SCLS($$) = S_EEPROM; } | DATA { $$ = newLink (SPECIFIER); - SPEC_SCLS($$) = S_DATA ; + SPEC_SCLS($$) = S_DATA; } | IDATA { $$ = newLink (SPECIFIER); - SPEC_SCLS($$) = S_IDATA ; + SPEC_SCLS($$) = S_IDATA; } | PDATA { $$ = newLink (SPECIFIER); - SPEC_SCLS($$) = S_PDATA ; + SPEC_SCLS($$) = S_PDATA; } | BIT { $$=newLink(SPECIFIER); - SPEC_NOUN($$) = V_BIT ; - SPEC_SCLS($$) = S_BIT ; + SPEC_NOUN($$) = V_BIT; + SPEC_SCLS($$) = S_BIT; SPEC_BLEN($$) = 1; SPEC_BSTR($$) = 0; ignoreTypedefType = 1; } - | AT constant_expr { $$=newLink(SPECIFIER); /* add this to the storage class specifier */ SPEC_ABSA($$) = 1; /* set the absolute addr flag */ /* now get the abs addr from value */ - SPEC_ADDR($$) = (unsigned int) ulFromVal(constExprValue($2,TRUE)) ; + SPEC_ADDR($$) = (unsigned int) ulFromVal(constExprValue($2,TRUE)); } - | struct_or_union_specifier { uselessDecl = FALSE; - $$ = $1 ; + $$ = $1; ignoreTypedefType = 1; } | enum_specifier { - cenum = NULL ; + cenum = NULL; uselessDecl = FALSE; ignoreTypedefType = 1; - $$ = $1 ; + $$ = $1; } | TYPE_NAME { symbol *sym; - sym_link *p ; - sym = findSym(TypedefTab,NULL,$1) ; + sym_link *p; + sym = findSym(TypedefTab,NULL,$1); $$ = p = copyLinkChain(sym ? sym->type : NULL); SPEC_TYPEDEF(getSpec(p)) = 0; ignoreTypedefType = 1; @@ -747,7 +773,7 @@ sfr_reg_bit : SBIT { - $$ = newLink(SPECIFIER) ; + $$ = newLink(SPECIFIER); SPEC_NOUN($$) = V_SBIT; SPEC_SCLS($$) = S_SBIT; SPEC_BLEN($$) = 1; @@ -759,37 +785,37 @@ sfr_attributes : SFR { - $$ = newLink(SPECIFIER) ; + $$ = newLink(SPECIFIER); FUNC_REGBANK($$) = 0; SPEC_NOUN($$) = V_CHAR; - SPEC_SCLS($$) = S_SFR ; - SPEC_USIGN($$) = 1 ; + SPEC_SCLS($$) = S_SFR; + SPEC_USIGN($$) = 1; ignoreTypedefType = 1; } | SFR BANKED { - $$ = newLink(SPECIFIER) ; + $$ = newLink(SPECIFIER); FUNC_REGBANK($$) = 1; SPEC_NOUN($$) = V_CHAR; - SPEC_SCLS($$) = S_SFR ; - SPEC_USIGN($$) = 1 ; + SPEC_SCLS($$) = S_SFR; + SPEC_USIGN($$) = 1; ignoreTypedefType = 1; } ; sfr_attributes : SFR16 { - $$ = newLink(SPECIFIER) ; + $$ = newLink(SPECIFIER); FUNC_REGBANK($$) = 0; SPEC_NOUN($$) = V_INT; SPEC_SCLS($$) = S_SFR; - SPEC_USIGN($$) = 1 ; + SPEC_USIGN($$) = 1; ignoreTypedefType = 1; } ; sfr_attributes : SFR32 { - $$ = newLink(SPECIFIER) ; + $$ = newLink(SPECIFIER); FUNC_REGBANK($$) = 0; SPEC_NOUN($$) = V_INT; SPEC_SCLS($$) = S_SFR; @@ -802,291 +828,358 @@ struct_or_union_specifier : struct_or_union opt_stag { - if (!$2->type) - { - $2->type = $1; - } - else - { - if ($2->type != $1) - werror(E_BAD_TAG, $2->tag, $1==STRUCT ? "struct" : "union"); - } + structdef *sdef; + if (! $2->tagsym) + { + /* no tag given, so new struct def for current scope */ + addSym (StructTab, $2, $2->tag, $2->level, currBlockno, 0); + } + else + { + sdef = findSymWithBlock (StructTab, $2->tagsym, currBlockno); + if (sdef) + { + /* Error if a complete type already defined in this scope */ + if (sdef->block == currBlockno) + { + if (sdef->fields) + { + werror(E_STRUCT_REDEF, $2->tag); + werrorfl(sdef->tagsym->fileDef, sdef->tagsym->lineDef, E_PREVIOUS_DEF); + } + else + { + $2 = sdef; /* We are completing an incomplete type */ + } + } + else + { + /* There is an existing struct def in an outer scope. */ + /* Create new struct def for current scope */ + addSym (StructTab, $2, $2->tag, $2->level, currBlockno, 0); + } + } + else + { + /* There is no existing struct def at all. */ + /* Create new struct def for current scope */ + addSym (StructTab, $2, $2->tag, $2->level, currBlockno, 0); + } + } + + if (!$2->type) + { + $2->type = $1; + } + else + { + if ($2->type != $1) + werror(E_BAD_TAG, $2->tag, $1==STRUCT ? "struct" : "union"); + } } - '{' struct_declaration_list '}' + '{' struct_declaration_list '}' { - structdef *sdef ; - symbol *sym, *dsym; + structdef *sdef; + symbol *sym, *dsym; - // check for errors in structure members - for (sym=$5; sym; sym=sym->next) { - if (IS_ABSOLUTE(sym->etype)) { - werrorfl(sym->fileDef, sym->lineDef, E_NOT_ALLOWED, "'at'"); - SPEC_ABSA(sym->etype) = 0; - } - if (IS_SPEC(sym->etype) && SPEC_SCLS(sym->etype)) { - werrorfl(sym->fileDef, sym->lineDef, E_NOT_ALLOWED, "storage class"); - printTypeChainRaw (sym->type,NULL); - SPEC_SCLS(sym->etype) = 0; - } - for (dsym=sym->next; dsym; dsym=dsym->next) { - if (*dsym->name && strcmp(sym->name, dsym->name)==0) { - werrorfl(sym->fileDef, sym->lineDef, E_DUPLICATE_MEMBER, - $1==STRUCT ? "struct" : "union", sym->name); - werrorfl(dsym->fileDef, dsym->lineDef, E_PREVIOUS_DEF); - } - } - } + // check for errors in structure members + for (sym=$5; sym; sym=sym->next) + { + if (IS_ABSOLUTE(sym->etype)) + { + werrorfl(sym->fileDef, sym->lineDef, E_NOT_ALLOWED, "'at'"); + SPEC_ABSA(sym->etype) = 0; + } + if (IS_SPEC(sym->etype) && SPEC_SCLS(sym->etype)) + { + werrorfl(sym->fileDef, sym->lineDef, E_NOT_ALLOWED, "storage class"); + printTypeChainRaw (sym->type, NULL); + SPEC_SCLS(sym->etype) = 0; + } + for (dsym=sym->next; dsym; dsym=dsym->next) + { + if (*dsym->name && strcmp(sym->name, dsym->name)==0) + { + werrorfl(sym->fileDef, sym->lineDef, E_DUPLICATE_MEMBER, + $1==STRUCT ? "struct" : "union", sym->name); + werrorfl(dsym->fileDef, dsym->lineDef, E_PREVIOUS_DEF); + } + } + } - /* Create a structdef */ - sdef = $2 ; - sdef->fields = reverseSyms($5) ; /* link the fields */ - sdef->size = compStructSize($1,sdef); /* update size of */ - promoteAnonStructs ($1, sdef); - - /* Create the specifier */ - $$ = newLink (SPECIFIER) ; - SPEC_NOUN($$) = V_STRUCT; - SPEC_STRUCT($$)= sdef ; + /* Create a structdef */ + sdef = $2; + sdef->fields = reverseSyms($5); /* link the fields */ + sdef->size = compStructSize($1, sdef); /* update size of */ + promoteAnonStructs ($1, sdef); + + /* Create the specifier */ + $$ = newLink (SPECIFIER); + SPEC_NOUN($$) = V_STRUCT; + SPEC_STRUCT($$)= sdef; } | struct_or_union stag - { - $$ = newLink(SPECIFIER) ; - SPEC_NOUN($$) = V_STRUCT; - SPEC_STRUCT($$) = $2; + { + structdef *sdef; - if (!$2->type) - { - $2->type = $1; - } - else - { - if ($2->type != $1) - werror(E_BAD_TAG, $2->tag, $1==STRUCT ? "struct" : "union"); - } - } + sdef = findSymWithBlock (StructTab, $2->tagsym, currBlockno); + if (sdef) + $2 = sdef; + else + { + /* new struct def for current scope */ + addSym (StructTab, $2, $2->tag, $2->level, currBlockno, 0); + } + $$ = newLink(SPECIFIER); + SPEC_NOUN($$) = V_STRUCT; + SPEC_STRUCT($$) = $2; + + if (!$2->type) + { + $2->type = $1; + } + else + { + if ($2->type != $1) + werror(E_BAD_TAG, $2->tag, $1==STRUCT ? "struct" : "union"); + } + } ; struct_or_union - : STRUCT { $$ = STRUCT ; ignoreTypedefType = 1; } - | UNION { $$ = UNION ; ignoreTypedefType = 1; } + : STRUCT { $$ = STRUCT; ignoreTypedefType = 1; } + | UNION { $$ = UNION; ignoreTypedefType = 1; } ; opt_stag -: stag -| { /* synthesize a name add to structtable */ - ignoreTypedefType = 0; - $$ = newStruct(genSymName(NestLevel)) ; - $$->level = NestLevel ; - addSym (StructTab, $$, $$->tag, $$->level, currBlockno, 0); -}; + : stag + | { /* synthesize a name add to structtable */ + ignoreTypedefType = 0; + $$ = newStruct(genSymName(NestLevel)); + $$->level = NestLevel; + $$->block = currBlockno; + $$->tagsym = NULL; + //addSym (StructTab, $$, $$->tag, $$->level, currBlockno, 0); + } + ; stag -: identifier { /* add name to structure table */ - ignoreTypedefType = 0; - $$ = findSymWithBlock (StructTab, $1, currBlockno); - if (! $$ ) { - $$ = newStruct($1->name) ; - $$->level = NestLevel ; - addSym (StructTab, $$, $$->tag, $$->level, currBlockno, 0); - } -}; - + : identifier + { /* add name to structure table */ + ignoreTypedefType = 0; + $$ = newStruct($1->name); + $$->level = NestLevel; + $$->block = currBlockno; + $$->tagsym = $1; + //$$ = findSymWithBlock (StructTab, $1, currBlockno); + //if (! $$ ) + // { + // $$ = newStruct($1->name); + // $$->level = NestLevel; + // $$->tagsym = $1; + // //addSym (StructTab, $$, $$->tag, $$->level, currBlockno, 0); + // } + } + ; struct_declaration_list : struct_declaration | struct_declaration_list struct_declaration - { - symbol *sym=$2; + { + symbol *sym = $2; - /* go to the end of the chain */ - while (sym->next) sym=sym->next; - sym->next = $1 ; + /* go to the end of the chain */ + while (sym->next) sym = sym->next; + sym->next = $1; $$ = $2; - } + } ; struct_declaration : type_specifier_list struct_declarator_list ';' - { - /* add this type to all the symbols */ - symbol *sym ; - for ( sym = $2 ; sym != NULL ; sym = sym->next ) { - sym_link *btype = copyLinkChain($1); - - /* make the symbol one level up */ - sym->level-- ; - - pointerTypes(sym->type,btype); - if (!sym->type) { - sym->type = btype; - sym->etype = getSpec(sym->type); - } - else - addDecl (sym,0,btype); - /* make sure the type is complete and sane */ - checkTypeSanity(sym->etype, sym->name); - } - ignoreTypedefType = 0; - $$ = $2; - } + { + /* add this type to all the symbols */ + symbol *sym; + for ( sym = $2; sym != NULL; sym = sym->next ) + { + sym_link *btype = copyLinkChain($1); + + pointerTypes(sym->type, btype); + if (!sym->type) + { + sym->type = btype; + sym->etype = getSpec(sym->type); + } + else + addDecl (sym, 0, btype); + /* make sure the type is complete and sane */ + checkTypeSanity(sym->etype, sym->name); + } + ignoreTypedefType = 0; + $$ = $2; + } ; struct_declarator_list : struct_declarator | struct_declarator_list ',' struct_declarator - { - $3->next = $1 ; - $$ = $3 ; - } + { + $3->next = $1; + $$ = $3; + } ; struct_declarator : declarator - | ':' constant_expr { - unsigned int bitsize; - $$ = newSymbol (genSymName(NestLevel),NestLevel) ; - bitsize = (unsigned int) ulFromVal(constExprValue($2,TRUE)); - if (bitsize > (port->s.int_size * 8)) { - bitsize = port->s.int_size * 8; - werror(E_BITFLD_SIZE, bitsize); - } - if (!bitsize) - bitsize = BITVAR_PAD; - $$->bitVar = bitsize; - $$->bitUnnamed = 1; - } + | ':' constant_expr + { + unsigned int bitsize; + $$ = newSymbol (genSymName(NestLevel), NestLevel); + bitsize = (unsigned int) ulFromVal(constExprValue($2, TRUE)); + if (bitsize > (port->s.int_size * 8)) + { + bitsize = port->s.int_size * 8; + werror(E_BITFLD_SIZE, bitsize); + } + if (!bitsize) + bitsize = BITVAR_PAD; + $$->bitVar = bitsize; + $$->bitUnnamed = 1; + } | declarator ':' constant_expr - { - unsigned int bitsize; - bitsize = (unsigned int) ulFromVal(constExprValue($3,TRUE)); - if (bitsize > (port->s.int_size * 8)) { - bitsize = port->s.int_size * 8; - werror(E_BITFLD_SIZE, bitsize); - } - if (!bitsize) { - $$ = newSymbol (genSymName(NestLevel),NestLevel) ; - $$->bitVar = BITVAR_PAD; - werror(W_BITFLD_NAMED); - } - else - $1->bitVar = bitsize; - } - | { $$ = newSymbol ("", NestLevel) ; } - + { + unsigned int bitsize; + bitsize = (unsigned int) ulFromVal(constExprValue($3, TRUE)); + if (bitsize > (port->s.int_size * 8)) + { + bitsize = port->s.int_size * 8; + werror(E_BITFLD_SIZE, bitsize); + } + if (!bitsize) + { + $$ = newSymbol (genSymName(NestLevel), NestLevel); + $$->bitVar = BITVAR_PAD; + werror(W_BITFLD_NAMED); + } + else + $1->bitVar = bitsize; + } + | { $$ = newSymbol ("", NestLevel); } ; enum_specifier - : ENUM '{' enumerator_list '}' { - $$ = newEnumType ($3); //copyLinkChain(cenum->type); - SPEC_SCLS(getSpec($$)) = 0; - } + : ENUM '{' enumerator_list '}' + { + $$ = newEnumType ($3); + SPEC_SCLS(getSpec($$)) = 0; + } + | ENUM identifier '{' enumerator_list '}' + { + symbol *csym; + sym_link *enumtype; - | ENUM identifier '{' enumerator_list '}' { - symbol *csym ; - sym_link *enumtype; - - csym=findSym(enumTab,$2,$2->name); - if ((csym && csym->level == $2->level)) - { - werrorfl($2->fileDef, $2->lineDef, E_DUPLICATE_TYPEDEF,csym->name); - werrorfl(csym->fileDef, csym->lineDef, E_PREVIOUS_DEF); - } + csym = findSymWithLevel(enumTab, $2); + if ((csym && csym->level == $2->level)) + { + werrorfl($2->fileDef, $2->lineDef, E_DUPLICATE_TYPEDEF, csym->name); + werrorfl(csym->fileDef, csym->lineDef, E_PREVIOUS_DEF); + } - enumtype = newEnumType ($4); //copyLinkChain(cenum->type); - SPEC_SCLS(getSpec(enumtype)) = 0; - $2->type = enumtype; - - /* add this to the enumerator table */ - if (!csym) - addSym ( enumTab,$2,$2->name,$2->level,$2->block, 0); - $$ = copyLinkChain(enumtype); - } - | ENUM identifier { - symbol *csym ; + enumtype = newEnumType ($4); + SPEC_SCLS(getSpec(enumtype)) = 0; + $2->type = enumtype; + + /* add this to the enumerator table */ + if (!csym) + addSym (enumTab, $2, $2->name, $2->level, $2->block, 0); + $$ = copyLinkChain(enumtype); + } + | ENUM identifier + { + symbol *csym; - /* check the enumerator table */ - if ((csym = findSym(enumTab,$2,$2->name))) - $$ = copyLinkChain(csym->type); - else { - $$ = newLink(SPECIFIER) ; - SPEC_NOUN($$) = V_INT ; - } - } + /* check the enumerator table */ + if ((csym = findSymWithLevel(enumTab, $2))) + $$ = copyLinkChain(csym->type); + else + { + $$ = newLink(SPECIFIER); + SPEC_NOUN($$) = V_INT; + } + } ; enumerator_list - : enumerator - | enumerator_list ',' - | enumerator_list ',' enumerator - { - $3->next = $1 ; - $$ = $3 ; - } - ; + : enumerator + | enumerator_list ',' + | enumerator_list ',' enumerator + { + $3->next = $1; + $$ = $3; + } + ; enumerator - : identifier opt_assign_expr - { - symbol *sym; + : identifier opt_assign_expr + { + symbol *sym; - /* make the symbol one level up */ - $1->level-- ; - // check if the symbol at the same level already exists - if ((sym = findSymWithLevel (SymbolTab, $1)) && - sym->level == $1->level) - { - werrorfl ($1->fileDef, $1->lineDef, E_DUPLICATE_MEMBER, "enum", $1->name); - werrorfl (sym->fileDef, sym->lineDef, E_PREVIOUS_DEF); - } - $1->type = copyLinkChain ($2->type); - $1->etype= getSpec ($1->type); - SPEC_ENUM ($1->etype) = 1; - $$ = $1 ; - // do this now, so we can use it for the next enums in the list - addSymChain (&$1); - } - ; + // check if the symbol at the same level already exists + if ((sym = findSymWithLevel (SymbolTab, $1)) && sym->level == $1->level) + { + werrorfl ($1->fileDef, $1->lineDef, E_DUPLICATE_MEMBER, "enum", $1->name); + werrorfl (sym->fileDef, sym->lineDef, E_PREVIOUS_DEF); + } + $1->type = copyLinkChain ($2->type); + $1->etype = getSpec ($1->type); + SPEC_ENUM ($1->etype) = 1; + $$ = $1; + // do this now, so we can use it for the next enums in the list + addSymChain (&$1); + } + ; opt_assign_expr - : '=' constant_expr { - value *val ; + : '=' constant_expr + { + value *val; - val = constExprValue($2,TRUE); - if (!IS_INT(val->type) && !IS_CHAR(val->type) && !IS_BOOL(val->type)) - { - werror(E_ENUM_NON_INTEGER); - SNPRINTF(lbuff, sizeof(lbuff), - "%d", (int) ulFromVal(val)); - val = constVal(lbuff); - } - $$ = cenum = val ; - } - | { - if (cenum) { - SNPRINTF(lbuff, sizeof(lbuff), - "%d", (int) ulFromVal(cenum)+1); - $$ = cenum = constVal(lbuff); - } - else { - $$ = cenum = constCharVal(0); - } - } + val = constExprValue($2, TRUE); + if (!IS_INT(val->type) && !IS_CHAR(val->type) && !IS_BOOL(val->type)) + { + werror(E_ENUM_NON_INTEGER); + SNPRINTF(lbuff, sizeof(lbuff), "%d", (int) ulFromVal(val)); + val = constVal(lbuff); + } + $$ = cenum = val; + } + | { + if (cenum) + { + SNPRINTF(lbuff, sizeof(lbuff), "%d", (int) ulFromVal(cenum)+1); + $$ = cenum = constVal(lbuff); + } + else + { + $$ = cenum = constCharVal(0); + } + } ; declarator - : declarator3 { $$ = $1 ; } + : declarator3 { $$ = $1; } | pointer declarator3 { addDecl ($2,0,reverseLink($1)); - $$ = $2 ; + $$ = $2; } ; declarator3 - : declarator2_function_attributes { $$ = $1 ; } - | declarator2 { $$ = $1 ; } + : declarator2_function_attributes { $$ = $1; } + | declarator2 { $$ = $1; } ; function_declarator @@ -1094,12 +1187,12 @@ | pointer declarator2_function_attributes { addDecl ($2,0,reverseLink($1)); - $$ = $2 ; + $$ = $2; } ; declarator2_function_attributes - : function_declarator2 { $$ = $1 ; } + : function_declarator2 { $$ = $1; } | function_declarator2 function_attribute { // copy the functionAttributes (not the args and hasVargs !!) struct value *args; @@ -1139,8 +1232,8 @@ sym_link *p; p = newLink (DECLARATOR); - DCL_TYPE(p) = ARRAY ; - DCL_ELEM(p) = 0 ; + DCL_TYPE(p) = ARRAY; + DCL_ELEM(p) = 0; addDecl($1,0,p); } | declarator3 '[' constant_expr ']' @@ -1175,84 +1268,94 @@ ; function_declarator2 - : declarator2 '(' ')' { addDecl ($1,FUNCTION,NULL) ; } - | declarator2 '(' { NestLevel++ ; currBlockno++; } - parameter_type_list ')' - { - sym_link *funcType; + : declarator2 '(' ')' + { + addDecl ($1, FUNCTION, NULL); + } + | declarator2 '(' + { + NestLevel++; + STACK_PUSH(blockNum, currBlockno); + currBlockno = ++blockNo; + } + parameter_type_list ')' + { + sym_link *funcType; - addDecl ($1,FUNCTION,NULL) ; + addDecl ($1, FUNCTION, NULL); - funcType = $1->type; - while (funcType && !IS_FUNC(funcType)) - funcType = funcType->next; + funcType = $1->type; + while (funcType && !IS_FUNC(funcType)) + funcType = funcType->next; - assert (funcType); + assert (funcType); - FUNC_HASVARARGS(funcType) = IS_VARG($4); - FUNC_ARGS(funcType) = reverseVal($4); + FUNC_HASVARARGS(funcType) = IS_VARG($4); + FUNC_ARGS(funcType) = reverseVal($4); - /* nest level was incremented to take care of the parms */ - NestLevel-- ; - currBlockno--; + /* nest level was incremented to take care of the parms */ + NestLevel--; + currBlockno = STACK_POP(blockNum); - // if this was a pointer (to a function) - if (!IS_FUNC($1->type)) - cleanUpLevel(SymbolTab,NestLevel+1); + // if this was a pointer (to a function) + if (!IS_FUNC($1->type)) + cleanUpLevel(SymbolTab, NestLevel + 1); - $$ = $1; - } + $$ = $1; + } | declarator2 '(' identifier_list ')' - { - werror(E_OLD_STYLE,$1->name) ; - /* assume it returns an int */ - $1->type = $1->etype = newIntLink(); - $$ = $1 ; - } + { + werror(E_OLD_STYLE,$1->name); + /* assume it returns an int */ + $1->type = $1->etype = newIntLink(); + $$ = $1; + } ; pointer - : unqualified_pointer { $$ = $1 ;} + : unqualified_pointer { $$ = $1;} | unqualified_pointer type_specifier_list { - $$ = $1 ; + $$ = $1; if (IS_SPEC($2)) { DCL_TSPEC($1) = $2; DCL_PTR_CONST($1) = SPEC_CONST($2); DCL_PTR_VOLATILE($1) = SPEC_VOLATILE($2); DCL_PTR_RESTRICT($1) = SPEC_RESTRICT($2); + DCL_PTR_ADDRSPACE($1) = SPEC_ADDRSPACE($2); } else werror (W_PTR_TYPE_INVALID); } | unqualified_pointer pointer { - $$ = $1 ; - $$->next = $2 ; + $$ = $1; + $$->next = $2; DCL_TYPE($2)=port->unqualified_pointer; } | unqualified_pointer type_specifier_list pointer { - $$ = $1 ; + $$ = $1; if (IS_SPEC($2) && DCL_TYPE($3) == UPOINTER) { DCL_PTR_CONST($1) = SPEC_CONST($2); DCL_PTR_VOLATILE($1) = SPEC_VOLATILE($2); DCL_PTR_RESTRICT($1) = SPEC_RESTRICT($2); + DCL_PTR_ADDRSPACE($1) = SPEC_ADDRSPACE($2); switch (SPEC_SCLS($2)) { case S_XDATA: DCL_TYPE($3) = FPOINTER; break; case S_IDATA: - DCL_TYPE($3) = IPOINTER ; + DCL_TYPE($3) = IPOINTER; break; case S_PDATA: - DCL_TYPE($3) = PPOINTER ; + DCL_TYPE($3) = PPOINTER; break; case S_DATA: - DCL_TYPE($3) = POINTER ; + DCL_TYPE($3) = POINTER; break; case S_CODE: - DCL_TYPE($3) = CPOINTER ; + DCL_TYPE($3) = CPOINTER; break; case S_EEPROM: DCL_TYPE($3) = EEPPOINTER; @@ -1265,7 +1368,7 @@ } else werror (W_PTR_TYPE_INVALID); - $$->next = $3 ; + $$->next = $3; } ; @@ -1277,7 +1380,7 @@ } ; -type_specifier_list : type_specifier_list_ { $$ = finalizeSpec($1); } ; +type_specifier_list : type_specifier_list_ { $$ = finalizeSpec($1); }; type_specifier_list_ : type_specifier @@ -1294,7 +1397,7 @@ | identifier_list ',' identifier { $3->next = $1; - $$ = $3 ; + $$ = $3; } ; @@ -1307,8 +1410,8 @@ : parameter_declaration | parameter_list ',' parameter_declaration { - $3->next = $1 ; - $$ = $3 ; + $3->next = $1; + $$ = $3; } ; @@ -1365,9 +1468,9 @@ } else { - p->next = $1 ; + p->next = $1; } - $$ = $2 ; + $$ = $2; ignoreTypedefType = 0; } ; @@ -1375,38 +1478,38 @@ abstract_declarator : pointer { $$ = reverseLink($1); } | abstract_declarator2 - | pointer abstract_declarator2 { $1 = reverseLink($1); $1->next = $2 ; $$ = $1; + | pointer abstract_declarator2 { $1 = reverseLink($1); $1->next = $2; $$ = $1; if (IS_PTR($1) && IS_FUNC($2)) DCL_TYPE($1) = CPOINTER; } ; abstract_declarator2 - : '(' abstract_declarator ')' { $$ = $2 ; } + : '(' abstract_declarator ')' { $$ = $2; } | '[' ']' { $$ = newLink (DECLARATOR); - DCL_TYPE($$) = ARRAY ; - DCL_ELEM($$) = 0 ; + DCL_TYPE($$) = ARRAY; + DCL_ELEM($$) = 0; } | '[' constant_expr ']' { - value *val ; + value *val; $$ = newLink (DECLARATOR); - DCL_TYPE($$) = ARRAY ; + DCL_TYPE($$) = ARRAY; DCL_ELEM($$) = (int) ulFromVal(val = constExprValue($2,TRUE)); } | abstract_declarator2 '[' ']' { $$ = newLink (DECLARATOR); - DCL_TYPE($$) = ARRAY ; - DCL_ELEM($$) = 0 ; - $$->next = $1 ; + DCL_TYPE($$) = ARRAY; + DCL_ELEM($$) = 0; + $$->next = $1; } | abstract_declarator2 '[' constant_expr ']' { - value *val ; + value *val; $$ = newLink (DECLARATOR); - DCL_TYPE($$) = ARRAY ; + DCL_TYPE($$) = ARRAY; DCL_ELEM($$) = (int) ulFromVal(val = constExprValue($3,TRUE)); - $$->next = $1 ; + $$->next = $1; } | '(' ')' { $$ = NULL;} | '(' parameter_type_list ')' { $$ = NULL;} @@ -1422,27 +1525,35 @@ } $1->next=p; } - | abstract_declarator2 '(' { NestLevel++ ; currBlockno++; } parameter_type_list ')' { - sym_link *p = newLink(DECLARATOR); - DCL_TYPE(p) = FUNCTION; - - FUNC_HASVARARGS(p) = IS_VARG($4); - FUNC_ARGS(p) = reverseVal($4); - - /* nest level was incremented to take care of the parms */ - NestLevel--; - currBlockno--; - if (!$1) { - /* ((void (code *) (void)) 0) () */ - $1 = newLink(DECLARATOR); - DCL_TYPE($1) = CPOINTER; - $$ = $1; - } - $1->next = p; + | abstract_declarator2 '(' + { + NestLevel++; + STACK_PUSH(blockNum, currBlockno); + currBlockno = ++blockNo; + } + parameter_type_list ')' + { + sym_link *p = newLink(DECLARATOR); + DCL_TYPE(p) = FUNCTION; + + FUNC_HASVARARGS(p) = IS_VARG($4); + FUNC_ARGS(p) = reverseVal($4); - // disabled to fix bug 3190029 -// // remove the symbol args (if any) -// cleanUpLevel(SymbolTab, NestLevel+1); + /* nest level was incremented to take care of the parms */ + NestLevel--; + currBlockno = STACK_POP(blockNum); + if (!$1) + { + /* ((void (code *) (void)) 0) () */ + $1 = newLink(DECLARATOR); + DCL_TYPE($1) = CPOINTER; + $$ = $1; + } + $1->next = p; + + // disabled to fix bug 3190029 +// // remove the symbol args (if any) +// cleanUpLevel(SymbolTab, NestLevel + 1); } ; @@ -1470,14 +1581,7 @@ | iteration_statement | jump_statement | critical_statement - | INLINEASM ';' { - ast *ex; - seqPointNo++; - ex = newNode(INLINEASM,NULL,NULL); - ex->values.inlineasm = strdup($1); - seqPointNo++; - $$ = ex; - } + | asm_statement ; critical @@ -1518,25 +1622,40 @@ } ; -start_block : '{' - { - STACK_PUSH(blockNum, currBlockno); - currBlockno = ++blockNo ; - ignoreTypedefType = 0; - } - ; +start_block + : '{' + { + NestLevel++; + STACK_PUSH(blockNum, currBlockno); + currBlockno = ++blockNo; + ignoreTypedefType = 0; + } + ; -end_block : '}' { currBlockno = STACK_POP(blockNum); } - ; +end_block + : '}' + { + NestLevel--; + currBlockno = STACK_POP(blockNum); + } + ; compound_statement : start_block end_block { $$ = createBlock(NULL, NULL); } | start_block statement_list end_block { $$ = createBlock(NULL, $2); } - | start_block declaration_list end_block { $$ = createBlock($2, NULL); } + | start_block declaration_list end_block + { + $$ = createBlock($2, NULL); + cleanUpLevel(StructTab, NestLevel + 1); + } | start_block declaration_list statement_list - end_block {$$ = createBlock($2, $3); } - | error ';' { $$ = NULL ; } + end_block + { + $$ = createBlock($2, $3); + cleanUpLevel(StructTab, NestLevel + 1); + } + | error ';' { $$ = NULL; } ; declaration_list @@ -1545,10 +1664,10 @@ /* if this is typedef declare it immediately */ if ( $1 && IS_TYPEDEF($1->etype)) { allocVariables ($1); - $$ = NULL ; + $$ = NULL; } else - $$ = $1 ; + $$ = $1; ignoreTypedefType = 0; addSymChain(&$1); } @@ -1560,18 +1679,18 @@ /* if this is a typedef */ if ($2 && IS_TYPEDEF($2->etype)) { allocVariables ($2); - $$ = $1 ; + $$ = $1; } else { /* get to the end of the previous decl */ if ( $1 ) { - $$ = sym = $1 ; + $$ = sym = $1; while (sym->next) - sym = sym->next ; + sym = sym->next; sym->next = $2; } else - $$ = $2 ; + $$ = $2; } ignoreTypedefType = 0; addSymChain(&$2); @@ -1580,7 +1699,7 @@ statement_list : statement - | statement_list statement { $$ = newNode(NULLOP,$1,$2) ;} + | statement_list statement { $$ = newNode(NULLOP,$1,$2);} ; expression_statement @@ -1589,29 +1708,29 @@ ; else_statement - : ELSE statement { $$ = $2 ; } - | { $$ = NULL;} + : ELSE statement { $$ = $2; } + | { $$ = NULL; } ; selection_statement : IF '(' expr ')' { seqPointNo++;} statement else_statement { - noLineno++ ; + noLineno++; $$ = createIf ($3, $6, $7 ); $$->lineno = $3->lineno; $$->filename = $3->filename; noLineno--; } | SWITCH '(' expr ')' { - ast *ex ; - static int swLabel = 0 ; + ast *ex; + static int swLabel = 0; seqPointNo++; /* create a node for expression */ ex = newNode(SWITCH,$3,NULL); STACK_PUSH(swStk,ex); /* save it in the stack */ - ex->values.switchVals.swNum = swLabel ; + ex->values.switchVals.swNum = swLabel; /* now create the label */ SNPRINTF(lbuff, sizeof(lbuff), @@ -1622,14 +1741,14 @@ } statement { /* get back the switch form the stack */ - $$ = STACK_POP(swStk) ; + $$ = STACK_POP(swStk); $$->right = newNode (NULLOP,$6,createLabel($5,NULL)); STACK_POP(breakStack); } ; while : WHILE { /* create and push the continue , break & body labels */ - static int Lblnum = 0 ; + static int Lblnum = 0; /* continue */ SNPRINTF (lbuff, sizeof(lbuff), "_whilecontinue_%d",Lblnum); STACK_PUSH(continueStack,newSymbol(lbuff,NestLevel)); @@ -1643,7 +1762,7 @@ ; do : DO { /* create and push the continue , break & body Labels */ - static int Lblnum = 0 ; + static int Lblnum = 0; /* continue */ SNPRINTF(lbuff, sizeof(lbuff), "_docontinue_%d",Lblnum); @@ -1658,7 +1777,7 @@ ; for : FOR { /* create & push continue, break & body labels */ - static int Lblnum = 0 ; + static int Lblnum = 0; /* continue */ SNPRINTF(lbuff, sizeof(lbuff), "_forcontinue_%d",Lblnum); @@ -1678,26 +1797,26 @@ iteration_statement : while '(' expr ')' { seqPointNo++;} statement { - noLineno++ ; + noLineno++; $$ = createWhile ( $1, STACK_POP(continueStack), STACK_POP(breakStack), $3, $6 ); $$->lineno = $1->lineDef; $$->filename = $1->fileDef; - noLineno-- ; + noLineno--; } | do statement WHILE '(' expr ')' ';' { seqPointNo++; - noLineno++ ; + noLineno++; $$ = createDo ( $1 , STACK_POP(continueStack), STACK_POP(breakStack), $5, $2); $$->lineno = $1->lineDef; $$->filename = $1->fileDef; - noLineno-- ; + noLineno--; } | for '(' expr_opt ';' expr_opt ';' expr_opt ')' statement { - noLineno++ ; + noLineno++; /* if break or continue statement present then create a general case loop */ @@ -1712,19 +1831,19 @@ AST_FOR($$,trueLabel) = $1; AST_FOR($$,continueLabel) = STACK_POP(continueStack); AST_FOR($$,falseLabel) = STACK_POP(breakStack); - AST_FOR($$,condLabel) = STACK_POP(forStack) ; + AST_FOR($$,condLabel) = STACK_POP(forStack); AST_FOR($$,initExpr) = $3; AST_FOR($$,condExpr) = $5; AST_FOR($$,loopExpr) = $7; } - noLineno-- ; + noLineno--; } ; expr_opt - : { $$ = NULL ; seqPointNo++; } - | expr { $$ = $1 ; seqPointNo++; } + : { $$ = NULL; seqPointNo++; } + | expr { $$ = $1; seqPointNo++; } ; jump_statement @@ -1776,7 +1895,48 @@ } ; +asm_string_literal + : STRING_LITERAL + ; + +asm_statement + : ASM '(' asm_string_literal ')' ';' + { + ast *ex; + + seqPointNo++; + ex = newNode(INLINEASM, NULL, NULL); + ex->values.inlineasm = copyStr ($3, NULL); + seqPointNo++; + $$ = ex; + } + | INLINEASM ';' + { + ast *ex; + + seqPointNo++; + ex = newNode(INLINEASM, NULL, NULL); + ex->values.inlineasm = strdup($1); + seqPointNo++; + $$ = ex; + } + ; + +addressmod + : ADDRESSMOD identifier identifier ';' { + symbol *sym; + if ((sym = findSymWithLevel (AddrspaceTab, $3)) && sym->level == $3->level) + werrorfl (sym->fileDef, sym->lineDef, E_PREVIOUS_DEF); + if (!findSymWithLevel (SymbolTab, $2)) + werror (E_ID_UNDEF, $2->name); + addSym (AddrspaceTab, $3, $3->name, $3->level, $3->block, 0); + sym = findSymWithLevel (AddrspaceTab, $3); + sym->addressmod[0] = findSymWithLevel (SymbolTab, $2); + sym->addressmod[1] = 0; + } + ; + identifier - : IDENTIFIER { $$ = newSymbol ($1,NestLevel) ; } + : IDENTIFIER { $$ = newSymbol ($1, NestLevel); } ; %% diff -Nru sdcc-3.1.0+dfsg/src/SDCCBBlock.c sdcc-3.2.0+dfsg/src/SDCCBBlock.c --- sdcc-3.1.0+dfsg/src/SDCCBBlock.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCBBlock.c 2012-06-09 08:45:58.000000000 +0000 @@ -439,6 +439,7 @@ { ic->filename = ip->filename; ic->lineno = ip->lineno; + ic->eBBlockNum = ip->eBBlockNum; ic->prev = ip->prev; ip->prev = ic; ic->next = ip; diff -Nru sdcc-3.1.0+dfsg/src/SDCCasm.c sdcc-3.2.0+dfsg/src/SDCCasm.c --- sdcc-3.1.0+dfsg/src/SDCCasm.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCasm.c 2012-03-30 20:01:27.000000000 +0000 @@ -1,8 +1,7 @@ /*------------------------------------------------------------------------- SDCCasm.c - header file for all types of stuff to support different assemblers. - - Written By - Michael Hope 2000 + Copyright (C) 2000, Michael Hope 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 @@ -17,74 +16,68 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! -------------------------------------------------------------------------*/ -/* Provides output functions that modify the output string - based on the input tokens and the assembler token mapping - specification loaded. - - Note that the functions below only handle digit format modifiers. - eg %02X is ok, but %lu and %.4u will fail. -*/ +/* Provides output functions that modify the output string + based on the input tokens and the assembler token mapping + specification loaded. + + Note that the functions below only handle digit format modifiers. + eg %02X is ok, but %lu and %.4u will fail. + + A 'token' is like !blah or %24f and is under the programmers + control. */ #include #include "common.h" #include "dbuf_string.h" -/* A 'token' is like !blah or %24f and is under the programmers - control. */ - static hTab *_h; -char * -FileBaseName (char *fileFullName) +const char * +FileBaseName (const char *fileFullName) { - char *p = fileFullName; + const char *p; if (!fileFullName) { return "unknown"; } - while (*fileFullName) - { - if ((*fileFullName == '/') || (*fileFullName == '\\') || (*fileFullName == ':')) - { - p = fileFullName; - p++; - } - fileFullName++; - } - return p; + for (p = fileFullName + strlen (fileFullName) - 1; + p >= fileFullName && (*p != '/' && *p != '\\' && *p != ':'); + --p) + ; + + return p + 1; } void dbuf_tvprintf (struct dbuf_s *dbuf, const char *format, va_list ap) { - // Under Linux PPC va_list is a structure instead of a primitive type, - // and doesnt like being passed around. This version turns everything - // into one function. - - // Supports: - // !tokens - // %[CIFN] - special formats with no argument (ie list isnt touched) - // All of the system formats - - // This is acheived by expanding the tokens and zero arg formats into - // one big format string, which is passed to the native printf. + /* + Under Linux PPC va_list is a structure instead of a primitive type, + and doesnt like being passed around. This version turns everything + into one function. + + Supports: + !tokens + %[CIFN] - special formats with no argument (ie list isnt touched) + All of the system formats + + This is acheived by expanding the tokens and zero arg formats into + one big format string, which is passed to the native printf. + */ static int count; struct dbuf_s tmpDBuf; const char *noTokens; const char *sz = format; + const char *begin = NULL; + /* First pass: expand all of the macros */ dbuf_init (&tmpDBuf, INITIAL_INLINEASM); - /* First pass: expand all of the macros */ while (*sz) { if (*sz == '!') @@ -94,8 +87,15 @@ const char *t; struct dbuf_s token; + if (begin) + { + /* copy what we have until now */ + dbuf_append (&tmpDBuf, begin, sz - begin); + begin = NULL; + } + dbuf_init (&token, 64); - sz++; + ++sz; while (isalpha ((unsigned char) *sz) || *sz == '*') { dbuf_append (&token, sz++, 1); @@ -115,10 +115,19 @@ } else { - dbuf_append_char (&tmpDBuf, *sz++); + if (!begin) + begin = sz; + ++sz; } } + if (begin) + { + /* copy what we have until now */ + dbuf_append (&tmpDBuf, begin, sz - begin); + begin = NULL; + } + /* Second pass: Expand any macros that we own */ sz = noTokens = dbuf_detach_c_str (&tmpDBuf); @@ -129,32 +138,39 @@ { if (*sz == '%') { + if (begin) + { + /* copy what we have until now */ + dbuf_append (&tmpDBuf, begin, sz - begin); + begin = NULL; + } + // See if its one that we handle. - sz++; + ++sz; switch (*sz) { case 'C': // Code segment name. dbuf_append_str (&tmpDBuf, CODE_NAME); - sz++; + ++sz; break; case 'F': // Source file name. dbuf_append_str (&tmpDBuf, fullSrcFileName); - sz++; + ++sz; break; case 'N': // Current function name. dbuf_append_str (&tmpDBuf, currFunc->rname); - sz++; + ++sz; break; case 'I': // Unique ID. dbuf_printf (&tmpDBuf, "%u", ++count); - sz++; + ++sz; break; default: @@ -164,14 +180,24 @@ dbuf_append_char (&tmpDBuf, *sz++); dbuf_append_char (&tmpDBuf, *sz++); + break; } } else { - dbuf_append_char (&tmpDBuf, *sz++); + if (!begin) + begin = sz; + ++sz; } } + if (begin) + { + /* copy what we have until now */ + dbuf_append (&tmpDBuf, begin, sz - begin); + begin = NULL; + } + dbuf_free (noTokens); dbuf_vprintf (dbuf, dbuf_c_str (&tmpDBuf), ap); @@ -193,7 +219,6 @@ { va_list ap; struct dbuf_s dbuf; - size_t len; dbuf_init (&dbuf, INITIAL_INLINEASM); @@ -201,8 +226,7 @@ dbuf_tvprintf (&dbuf, szFormat, ap); va_end (ap); - len = dbuf_get_length (&dbuf); - fwrite (dbuf_get_buf (&dbuf), 1, len, fp); + fwrite (dbuf_get_buf (&dbuf), 1, dbuf_get_length (&dbuf), fp); dbuf_destroy (&dbuf); } @@ -228,36 +252,25 @@ const char * printILine (iCode * ic) { - char *verbalICode; struct dbuf_s tmpBuf; - size_t len; iCodeTable *icTab = getTableEntry (ic->op); dbuf_init (&tmpBuf, 1024); if (INLINEASM == ic->op) - dbuf_append (&tmpBuf, "inline", (sizeof "inline") - 1); + dbuf_append_str (&tmpBuf, "inline"); else { /* stuff the temporary file with the readable icode */ icTab->iCodePrint (&tmpBuf, ic, icTab->printName); } - len = dbuf_get_length (&tmpBuf); - /* null terminate the buffer */ - dbuf_c_str (&tmpBuf); - verbalICode = dbuf_detach (&tmpBuf); - - /* kill the trailing NL */ - if (len > 0 && '\n' == verbalICode[len - 1]) - verbalICode[--len] = '\0'; + dbuf_chomp (&tmpBuf); - /* and throw it up */ - return verbalICode; + return dbuf_detach_c_str (&tmpBuf); } - /*-----------------------------------------------------------------*/ /* skipLine - skip the line from file infp */ /*-----------------------------------------------------------------*/ @@ -335,7 +348,7 @@ don't panic, just return the error message */ dbuf_printf (&line, "ERROR: %s", strerror (errno)); - return dbuf_c_str (&line); + return dbuf_detach_c_str (&line); } else { @@ -363,20 +376,18 @@ /* get the line */ if (0 != (len = dbuf_getline (&line, inFile))) { - const char *inLineString = dbuf_c_str (&line); + const char *inLineString; ++inLineNo; /* remove the trailing NL */ - if (len > 0 && '\n' == inLineString[len - 1]) - { - dbuf_set_length (&line, --len); - inLineString = dbuf_c_str (&line); - } + dbuf_chomp (&line); + + inLineString = dbuf_detach_c_str (&line); /* skip leading spaces */ while (isspace (*inLineString)) - inLineString++; + ++inLineString; return inLineString; } @@ -384,7 +395,7 @@ err_no_line: dbuf_printf (&line, "ERROR: no line number %d in file %s", lineno, srcFile); - return dbuf_c_str (&line); + return dbuf_detach_c_str (&line); } static const ASM_MAPPING _asxxxx_mapping[] = { diff -Nru sdcc-3.1.0+dfsg/src/SDCCasm.h sdcc-3.2.0+dfsg/src/SDCCasm.h --- sdcc-3.1.0+dfsg/src/SDCCasm.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCasm.h 2012-03-30 20:01:27.000000000 +0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- SDCCasm.h - header file for all types of stuff to support different assemblers. - Written By - Michael Hope 2000 + Copyright (C) 2000, Michael Hope 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 @@ -16,10 +16,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! -------------------------------------------------------------------------*/ #ifndef SDCCASM_H @@ -59,7 +55,7 @@ */ void asm_addTree (const ASM_MAPPINGS * pMappings); -char *FileBaseName (char *fileFullName); +const char *FileBaseName (const char *fileFullName); const char *printILine (iCode * ic); const char *printCLine (const char *srcFile, int lineno); diff -Nru sdcc-3.1.0+dfsg/src/SDCCast.c sdcc-3.2.0+dfsg/src/SDCCast.c --- sdcc-3.1.0+dfsg/src/SDCCast.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCast.c 2012-06-10 12:32:06.000000000 +0000 @@ -71,6 +71,7 @@ int inInitMode = 0; memmap *GcurMemmap = NULL; /* points to the memmap that's currently active */ struct dbuf_s *codeOutBuf; + int ptt (ast * tree) { @@ -78,7 +79,6 @@ return 0; } - /*-----------------------------------------------------------------*/ /* newAst - creates a fresh node for an expression tree */ /*-----------------------------------------------------------------*/ @@ -200,6 +200,12 @@ AST_FOR (dest, initExpr) = copyAst (AST_FOR (src, initExpr)); AST_FOR (dest, condExpr) = copyAst (AST_FOR (src, condExpr)); AST_FOR (dest, loopExpr) = copyAst (AST_FOR (src, loopExpr)); + break; + + case CAST: + dest->values.cast.literalFromCast = src->values.cast.literalFromCast; + dest->values.cast.removedCast = src->values.cast.removedCast; + dest->values.cast.implicitCast = src->values.cast.implicitCast; } } @@ -537,6 +543,13 @@ } } + if (tree->type == EX_OP && tree->opval.op == FOR) + { + AST_FOR (tree, initExpr) = resolveSymbols (AST_FOR (tree, initExpr)); + AST_FOR (tree, condExpr) = resolveSymbols (AST_FOR (tree, condExpr)); + AST_FOR (tree, loopExpr) = resolveSymbols (AST_FOR (tree, loopExpr)); + } + /* if this is a label resolve it from the labelTab */ if (IS_AST_VALUE (tree) && tree->opval.val->sym && tree->opval.val->sym->islbl) { @@ -599,6 +612,28 @@ } } + /* If entering a block with symbols defined, mark the symbols in-scope */ + /* before continuing down the tree, and mark them out-of-scope again */ + /* on the way back up */ + if (tree->type == EX_OP && tree->opval.op == BLOCK && tree->values.sym) + { + symbol * sym = tree->values.sym; + while (sym) + { + sym->isinscope = 1; + sym = sym->next; + } + resolveSymbols (tree->left); + resolveSymbols (tree->right); + sym = tree->values.sym; + while (sym) + { + sym->isinscope = 0; + sym = sym->next; + } + return tree; + } + resolveChildren: resolveSymbols (tree->left); resolveSymbols (tree->right); @@ -668,7 +703,7 @@ /* funcOfTypeVarg :- function of type with name and argtype */ /*-----------------------------------------------------------------*/ symbol * -funcOfTypeVarg (char *name, char *rtype, int nArgs, char **atypes) +funcOfTypeVarg (const char *name, const char *rtype, int nArgs, const char **atypes) { symbol *sym; int i; @@ -771,20 +806,6 @@ else functype = func->ftype; - /* if the function is being called via a pointer & */ - /* it has not been defined reentrant then we cannot */ - /* have parameters */ - /* PIC16 port can... */ - if (!TARGET_IS_PIC16) - { - if (func->type != EX_VALUE && !IFFUNC_ISREENT (functype) && !options.stackAuto) - { - werror (E_NONRENT_ARGS); - fatalError++; - return 1; - } - } - /* if defined parameters ended but actual parameters */ /* exist and this is not defined as a variable arg */ if (!defParm && *actParm && !IFFUNC_HASVARARGS (functype)) @@ -894,6 +915,7 @@ *actParm = newNode (CAST, newType, *actParm); (*actParm)->filename = (*actParm)->right->filename; (*actParm)->lineno = (*actParm)->right->lineno; + AST_VALUES (*actParm, cast.implicitCast) = 1; *actParm = decorateType (*actParm, resultType); } @@ -916,19 +938,18 @@ werrorfl ((*actParm)->filename, (*actParm)->lineno, E_STRUCT_AS_ARG, (*actParm)->opval.val->name); else werrorfl ((*actParm)->filename, (*actParm)->lineno, E_STRUCT_AS_ARG, ""); - return 1; } else { werror (E_INCOMPAT_TYPES); printFromToType ((*actParm)->ftype, defParm->type); - return 1; } + return 1; } /* if the parameter is castable then add the cast */ if ((IS_ARRAY((*actParm)->ftype) && IS_PTR(defParm->type)) || - (compareType (defParm->type, (*actParm)->ftype) < 0)) + (compareType (defParm->type, (*actParm)->ftype) == -1)) { ast *pTree; @@ -936,11 +957,10 @@ pTree = resolveSymbols (copyAst (*actParm)); /* now change the current one to a cast */ - (*actParm)->type = EX_OP; - (*actParm)->opval.op = CAST; - (*actParm)->left = newAst_LINK (defParm->type); - (*actParm)->right = pTree; - (*actParm)->decorated = 0; /* force typechecking */ + *actParm = newNode (CAST, newAst_LINK (defParm->type), pTree); + (*actParm)->filename = (*actParm)->right->filename; + (*actParm)->lineno = (*actParm)->right->lineno; + AST_VALUES (*actParm, cast.implicitCast) = 1; *actParm = decorateType (*actParm, IS_GENPTR (defParm->type) ? RESULT_TYPE_GPTR : resultType); } @@ -1227,7 +1247,6 @@ return decorateType (resolveSymbols (rast), RESULT_TYPE_NONE); } - /*-----------------------------------------------------------------*/ /* createIvalCharPtr - generates initial values for char pointers */ /*-----------------------------------------------------------------*/ @@ -1269,7 +1288,7 @@ { /* for each character generate an assignment */ /* to the array element */ - char *s = SPEC_CVAL (iexpr->etype).v_char; + const char *s = SPEC_CVAL (iexpr->etype).v_char; unsigned int i = 0; unsigned int symsize = getSize (type); @@ -1280,7 +1299,13 @@ { char *name = (IS_AST_SYM_VALUE (sym)) ? AST_SYMBOL (sym)->name : ""; - werrorfl (iexpr->filename, iexpr->lineno, W_EXCESS_INITIALIZERS, "string", name); + if (options.std_c99 && s[symsize] == '\0' && size == symsize + 1) + { + if (!options.lessPedantic) + werrorfl (iexpr->filename, iexpr->lineno, W_STRING_CANNOT_BE_TERMINATED, name); + } + else + werrorfl (iexpr->filename, iexpr->lineno, W_EXCESS_INITIALIZERS, "string", name); } size = symsize; } @@ -1581,6 +1606,13 @@ if (tree->type == EX_OP && tree->opval.op == BLOCK) { ast *autoInit; + symbol * sym = tree->values.sym; + + while (sym) + { + sym->isinscope = 1; + sym = sym->next; + } if (action == ALLOCATE) { @@ -1597,6 +1629,19 @@ processBlockVars (tree->left, stack, action); processBlockVars (tree->right, stack, action); + + /* if this is a block */ + if (tree->type == EX_OP && tree->opval.op == BLOCK) + { + symbol * sym = tree->values.sym; + + while (sym) + { + sym->isinscope = 0; + sym = sym->next; + } + } + return tree; } @@ -2014,7 +2059,6 @@ return FALSE; } - /*------------------------------------------------------------------*/ case '|': case '^': @@ -2117,9 +2161,9 @@ /* function call */ /*----------------------------*/ case CALL: - /* if local & not passed as parameter & + /* if local & no parameters & not used to find the function then ok */ - if (sym->level && !astHasSymbol (pbody->right, sym) && !astHasSymbol (pbody->left, sym)) + if (sym->level && !pbody->right && !astHasSymbol (pbody->left, sym)) { return TRUE; } @@ -2409,6 +2453,10 @@ case '~': case LEFT_OP: case LABEL: + case GETHBIT: + case GETABIT: + case GETBYTE: + case GETWORD: return resultType; case '*': case '+': @@ -2494,6 +2542,7 @@ assignee->type = copyLinkChain (TTYPE (dtr)); assignee->etype = getSpec (assignee->type); + SPEC_ADDRSPACE (assignee->etype) = 0; SPEC_SCLS (assignee->etype) = S_AUTO; SPEC_OCLS (assignee->etype) = NULL; SPEC_EXTR (assignee->etype) = 0; @@ -2565,6 +2614,14 @@ checkPtrCast (sym_link * newType, sym_link * orgType, bool implicit) { int errors = 0; + + if (IS_ARRAY (orgType)) + { + value *val; + val = aggregateToPointer (valFromType (orgType)); + orgType = val->type; + Safe_free (val); + } if (IS_PTR (newType)) // to a pointer { @@ -2604,7 +2661,11 @@ } else // from a pointer to a pointer { - if (IS_GENPTR (newType) && IS_VOID (newType->next)) + if (implicit && getAddrspace (newType->next) != getAddrspace (orgType->next)) + { + errors += werror (E_INCOMPAT_PTYPES); + } + else if (IS_GENPTR (newType) && IS_VOID (newType->next)) { // cast to void* is always allowed } else if (IS_GENPTR (orgType) && IS_VOID (orgType->next)) @@ -2735,7 +2796,10 @@ } } else - wassert (0); /* unreached: all values are literals or symbols */ + { + /* unreached: all values are literals or symbols */ + wassert (0); + } return tree; } @@ -2917,6 +2981,7 @@ { setOClass (LTYPE (tree), TETYPE (tree)); SPEC_SCLS (TETYPE (tree)) = sclsFromPtr (LTYPE (tree)); + SPEC_ADDRSPACE (TETYPE (tree)) = DCL_PTR_ADDRSPACE (LTYPE (tree)); } /* This breaks with extern declarations, bit-fields, and perhaps other */ /* cases (gcse). Let's leave this optimization disabled for now and */ @@ -2980,10 +3045,12 @@ /*----------------------------*/ /* bitwise and */ /*----------------------------*/ - case '&': /* can be unary */ - /* if right is NULL then unary operation */ - if (tree->right) /* not an unary operation */ + case '&': /* can be unary */ + /* if right is NULL then unary operation */ + if (tree->right) /* not a unary operation */ { + ast *otree; + if (!IS_INTEGRAL (LTYPE (tree)) || !IS_INTEGRAL (RTYPE (tree))) { werrorfl (tree->filename, tree->lineno, E_BITWISE_OP); @@ -3007,42 +3074,6 @@ return tree; } - /* see if this is a GETHBIT operation if yes - then return that */ - { - ast *otree = optimizeGetHbit (tree, resultType); - - if (otree != tree) - return decorateType (otree, RESULT_TYPE_NONE); - } - - /* see if this is a GETABIT operation if yes - then return that */ - { - ast *otree = optimizeGetAbit (tree, resultType); - - if (otree != tree) - return decorateType (otree, RESULT_TYPE_NONE); - } - - /* see if this is a GETBYTE operation if yes - then return that */ - { - ast *otree = optimizeGetByte (tree, resultType); - - if (otree != tree) - return decorateType (otree, RESULT_TYPE_NONE); - } - - /* see if this is a GETWORD operation if yes - then return that */ - { - ast *otree = optimizeGetWord (tree, resultType); - - if (otree != tree) - return decorateType (otree, RESULT_TYPE_NONE); - } - /* if left is a literal exchange left & right */ if (IS_LITERAL (LTYPE (tree))) { @@ -3068,6 +3099,37 @@ } } + /* if ANDing boolean with literal then reduce literal LSB to boolean */ + if (IS_LITERAL (RTYPE (tree)) && IS_BOOLEAN (LTYPE (tree))) + { + unsigned long litval = AST_ULONG_VALUE (tree->right); + tree->right = decorateType (newAst_VALUE (constBoolVal (litval & 1)), resultType); + } + + /* see if this is a GETHBIT operation if yes + then return that */ + otree = optimizeGetHbit (tree, resultType); + if (otree != tree) + return decorateType (otree, RESULT_TYPE_NONE); + + /* see if this is a GETABIT operation if yes + then return that */ + otree = optimizeGetAbit (tree, resultType); + if (otree != tree) + return decorateType (otree, RESULT_TYPE_NONE); + + /* see if this is a GETBYTE operation if yes + then return that */ + otree = optimizeGetByte (tree, resultType); + if (otree != tree) + return decorateType (otree, RESULT_TYPE_NONE); + + /* see if this is a GETWORD operation if yes + then return that */ + otree = optimizeGetWord (tree, resultType); + if (otree != tree) + return decorateType (otree, RESULT_TYPE_NONE); + LRVAL (tree) = RRVAL (tree) = 1; TTYPE (tree) = computeType (LTYPE (tree), RTYPE (tree), resultType, tree->opval.op); @@ -3080,9 +3142,14 @@ /*----------------------------*/ /* address of */ /*----------------------------*/ - p = newLink (DECLARATOR); + if (IS_FUNC (LTYPE (tree))) + { + // this ought to be ignored + return (tree->left); + } + /* if bit field then error */ - if (IS_BITFIELD (tree->left->etype) || (IS_BITVAR (tree->left->etype) && (TARGET_IS_MCS51 || TARGET_IS_XA51 || TARGET_IS_DS390))) + if (IS_BITFIELD (tree->left->etype) || (IS_BITVAR (tree->left->etype) && TARGET_MCS51_LIKE)) { werrorfl (tree->filename, tree->lineno, E_ILLEGAL_ADDR, "address of bit variable"); goto errorTreeReturn; @@ -3094,12 +3161,6 @@ goto errorTreeReturn; } - if (IS_FUNC (LTYPE (tree))) - { - // this ought to be ignored - return (tree->left); - } - if (IS_LITERAL (LTYPE (tree))) { werrorfl (tree->filename, tree->lineno, E_ILLEGAL_ADDR, "address of literal"); @@ -3111,6 +3172,8 @@ werrorfl (tree->filename, tree->lineno, E_LVALUE_REQUIRED, "address of"); goto errorTreeReturn; } + + p = newLink (DECLARATOR); if (!LETYPE (tree)) DCL_TYPE (p) = POINTER; else if (SPEC_SCLS (LETYPE (tree)) == S_CODE) @@ -3196,6 +3259,17 @@ decorateType (parent, resultType); } } + + /* if ORing boolean with literal then reduce literal to boolean */ + if (IS_LITERAL (RTYPE (tree)) && + IS_BOOLEAN (LTYPE (tree)) && + IS_INTEGRAL (RTYPE (tree)) && + resultType == RESULT_TYPE_BIT) + { + unsigned long litval = AST_ULONG_VALUE (tree->right); + tree->right = decorateType (newAst_VALUE (constBoolVal (litval != 0)), resultType); + } + /* fall through */ /*------------------------------------------------------------------*/ @@ -3250,6 +3324,27 @@ } } + /* if XORing boolean with literal then reduce literal to boolean */ + if (IS_LITERAL (RTYPE (tree)) && + IS_BOOLEAN (LTYPE (tree)) && + IS_INTEGRAL (RTYPE (tree)) && + resultType == RESULT_TYPE_BIT && + tree->opval.op == '^') /* the same source is used by 'bitwise or' */ + { + unsigned long litval = AST_ULONG_VALUE (tree->right); + if (litval == 0 || litval == 1) + { + tree->right = decorateType (newAst_VALUE (constBoolVal (litval != 0)), resultType); + } + else + { + tree->opval.op = '|'; + tree->right = newAst_VALUE (constBoolVal (1)); + tree->decorated = 0; + return decorateType (tree, resultType); + } + } + LRVAL (tree) = RRVAL (tree) = 1; TTYPE (tree) = computeType (LTYPE (tree), RTYPE (tree), resultType, tree->opval.op); @@ -3594,7 +3689,6 @@ /* if right is null then unary */ if (!tree->right) { - if (!IS_ARITHMETIC (LTYPE (tree))) { werrorfl (tree->filename, tree->lineno, E_UNARY_OP, tree->opval.op); @@ -3905,10 +3999,11 @@ if (tree->opval.op == LEFT_OP || (tree->opval.op == RIGHT_OP && SPEC_USIGN (LETYPE (tree)))) { werrorfl (tree->filename, tree->lineno, W_SHIFT_CHANGED, (tree->opval.op == LEFT_OP ? "left" : "right")); - tree->type = EX_VALUE; - tree->left = tree->right = NULL; - tree->opval.val = constCharVal (0); - TETYPE (tree) = TTYPE (tree) = tree->opval.val->type; + /* Change shift op to comma op and replace the right operand with 0. */ + /* This preserves the left operand in case there were side-effects. */ + tree->opval.op = ','; + tree->right->opval.val = constCharVal (0); + TETYPE (tree) = TTYPE (tree) = tree->right->opval.val->type; return tree; } } @@ -4020,7 +4115,6 @@ break; default: gptype = 0; - if (TARGET_IS_PIC16 && (SPEC_SCLS (sym->etype) == S_FIXED)) gptype = GPTYPE_NEAR; } @@ -4111,7 +4205,7 @@ gpVal &= (1 << (getSize (LTYPE (tree)) * 8)) - 1; } } - checkPtrCast (LTYPE (tree), RTYPE (tree), FALSE); + checkPtrCast (LTYPE (tree), RTYPE (tree), tree->values.cast.implicitCast); LRVAL (tree) = 1; tree->type = EX_VALUE; tree->opval.val = valCastLiteral (LTYPE (tree), gpVal | ulFromVal (valFromType (RTYPE (tree)))); @@ -4123,7 +4217,7 @@ return tree; } } - checkPtrCast (LTYPE (tree), RTYPE (tree), FALSE); + checkPtrCast (LTYPE (tree), RTYPE (tree), tree->values.cast.implicitCast); if (IS_GENPTR (LTYPE (tree)) && IS_PTR (RTYPE (tree)) && !IS_GENPTR (RTYPE (tree)) && (resultType != RESULT_TYPE_GPTR)) { DCL_TYPE (LTYPE (tree)) = DCL_TYPE (RTYPE (tree)); @@ -4243,8 +4337,7 @@ { case CCR_ALWAYS_TRUE: case CCR_ALWAYS_FALSE: - if (!options.lessPedantic) - werrorfl (tree->filename, tree->lineno, W_COMP_RANGE, ccr_result == CCR_ALWAYS_TRUE ? "true" : "false"); + werrorfl (tree->filename, tree->lineno, W_COMP_RANGE, ccr_result == CCR_ALWAYS_TRUE ? "true" : "false"); return decorateType (newAst_VALUE (constCharVal ((unsigned char) (ccr_result == CCR_ALWAYS_TRUE))), resultType); case CCR_OK: default: @@ -4582,7 +4675,6 @@ TETYPE (tree) = getSpec (TTYPE (tree)); return tree; - #if 0 // assignment operators are converted by the parser /*------------------------------------------------------------------*/ /*----------------------------*/ @@ -4753,6 +4845,8 @@ if (IS_CONSTANT (LTYPE (tree))) werrorfl (tree->filename, tree->lineno, E_CODE_WRITE, "="); } + if (tree->initMode && SPEC_STAT (getSpec (LTYPE (tree))) && !constExprTree (tree->right)) + werrorfl (tree->filename, tree->lineno, E_CONST_EXPECTED, "="); if (LRVAL (tree)) { werrorfl (tree->filename, tree->lineno, E_LVALUE_REQUIRED, "="); @@ -4842,12 +4936,13 @@ } /* if there is going to be a casting required then add it */ - if (compareType (currFunc->type->next, RTYPE (tree)) < 0) + if (compareType (currFunc->type->next, RTYPE (tree)) == -1) { - tree->right = - decorateType (newNode (CAST, - newAst_LINK (copyLinkChain (currFunc->type->next)), - tree->right), IS_GENPTR (currFunc->type->next) ? RESULT_TYPE_GPTR : RESULT_TYPE_NONE); + tree->right = newNode (CAST, + newAst_LINK (copyLinkChain (currFunc->type->next)), + tree->right); + tree->right->values.cast.implicitCast = 1; + tree->right = decorateType (tree->right, IS_GENPTR (currFunc->type->next) ? RESULT_TYPE_GPTR : RESULT_TYPE_NONE); } RRVAL (tree) = 1; @@ -4958,7 +5053,6 @@ return val; } - #define IS_AND(ex) (ex->type == EX_OP && ex->opval.op == AND_OP ) #define IS_OR(ex) (ex->type == EX_OP && ex->opval.op == OR_OP ) #define IS_NOT(ex) (ex->type == EX_OP && ex->opval.op == '!' ) @@ -4973,7 +5067,6 @@ static ast * backPatchLabels (ast * tree, symbol * trueLabel, symbol * falseLabel) { - if (!tree) return NULL; @@ -5011,8 +5104,8 @@ if (IS_IFX (tree->right)) return newNode (NULLOP, tree->left, createLabel (localLabel, tree->right)); - tree->right = createLabel (localLabel, tree->right); tree->right = newIfxNode (tree->right, trueLabel, falseLabel); + tree->right = createLabel (localLabel, tree->right); return newNode (NULLOP, tree->left, tree->right); } @@ -5040,8 +5133,8 @@ if (IS_IFX (tree->right)) return newNode (NULLOP, tree->left, createLabel (localLabel, tree->right)); - tree->right = createLabel (localLabel, tree->right); tree->right = newIfxNode (tree->right, trueLabel, falseLabel); + tree->right = createLabel (localLabel, tree->right); return newNode (NULLOP, tree->left, tree->right); } @@ -5071,7 +5164,6 @@ return tree; } - /*-----------------------------------------------------------------*/ /* createBlock - create expression tree for block */ /*-----------------------------------------------------------------*/ @@ -5328,16 +5420,18 @@ { ast *doTree; - /* if the body does not exist then it is simple */ if (!doBody) { condAst = backPatchLabels (condAst, continueLabel, falseLabel); - doTree = (IS_IFX (condAst) ? createLabel (continueLabel, condAst) - : newNode (IFX, createLabel (continueLabel, condAst), NULL)); - doTree->trueLabel = continueLabel; - doTree->falseLabel = NULL; + if (condAst && !IS_IFX (condAst)) + { + condAst = newNode (IFX, condAst, NULL); + condAst->trueLabel = continueLabel; + condAst->falseLabel = NULL; + } + doTree = createLabel (continueLabel, condAst); doTree = newNode (NULLOP, doTree, createLabel (falseLabel, NULL)); return doTree; } @@ -5392,7 +5486,6 @@ if (condExpr && !IS_IFX (condExpr)) condExpr = newIfxNode (condExpr, trueLabel, falseLabel); - /* attach condition label to condition */ condExpr = createLabel (condLabel, condExpr); @@ -5432,9 +5525,16 @@ /* put the continue label */ condExpr = backPatchLabels (condExpr, trueLabel, falseLabel); - condExpr = createLabel (continueLabel, condExpr); - condExpr->filename = NULL; - condExpr->lineno = 0; + if (condExpr && !IS_IFX (condExpr)) + { + condExpr = newNode (IFX, condExpr, NULL); + /* put the true & false labels in place */ + condExpr->trueLabel = trueLabel; + condExpr->falseLabel = falseLabel; + } + whileTree = createLabel (continueLabel, condExpr); + whileTree->filename = NULL; + whileTree->lineno = 0; /* put the body label in front of the body */ whileBody = createLabel (trueLabel, whileBody); @@ -5446,16 +5546,6 @@ whileBody, newNode (GOTO, newAst_VALUE (symbolVal (continueLabel)), createLabel (falseLabel, NULL))); /* put it all together */ - if (IS_IFX (condExpr)) - whileTree = condExpr; - else - { - whileTree = newNode (IFX, condExpr, NULL); - /* put the true & false labels in place */ - whileTree->trueLabel = trueLabel; - whileTree->falseLabel = falseLabel; - } - return newNode (NULLOP, whileTree, whileBody); } @@ -5507,30 +5597,32 @@ ast * optimizeGetHbit (ast * tree, RESULT_TYPE resultType) { - unsigned int i, j; + unsigned int bit, msb; ast *expr; expr = isShiftRightLitVal_BitAndLitVal (tree); if (expr) { if ((AST_ULONG_VALUE (tree->right) != 1) || - ((i = AST_ULONG_VALUE (tree->left->right)) != (j = (getSize (TTYPE (expr)) * 8 - 1)))) + ((bit = AST_ULONG_VALUE (tree->left->right)) != (msb = (bitsForType (TTYPE (expr)) - 1)))) expr = NULL; } if (!expr && (resultType == RESULT_TYPE_BIT)) { + int bit = isBitAndPow2 (tree); expr = tree->left; - if (isBitAndPow2 (tree) != (signed) getSize (TTYPE (expr)) * 8 - 1) + msb = bitsForType (TTYPE (expr)) - 1; + if ((bit < 0) || (bit != (int) msb)) expr = NULL; } - if (!expr) + if (!expr || IS_BOOLEAN (TTYPE (expr))) return tree; /* make sure the port supports GETHBIT */ if (port->hasExtBitOp && !port->hasExtBitOp (GETHBIT, getSize (TTYPE (expr)))) return tree; - return decorateType (newNode (GETHBIT, expr, NULL), RESULT_TYPE_NONE); + return decorateType (newNode (GETHBIT, expr, NULL), resultType); } /*-----------------------------------------------------------------*/ @@ -5552,7 +5644,7 @@ if (!expr && (resultType == RESULT_TYPE_BIT)) { int p2 = isBitAndPow2 (tree); - if (p2 >= 0) + if (p2 >= 0 && !IS_BOOLEAN (TTYPE (tree->left))) { expr = tree->left; count = newAst_VALUE (valueFromLit (p2)); @@ -5565,7 +5657,7 @@ if (port->hasExtBitOp && !port->hasExtBitOp (GETABIT, getSize (TTYPE (expr)))) return tree; - return decorateType (newNode (GETABIT, expr, count), RESULT_TYPE_NONE); + return decorateType (newNode (GETABIT, expr, count), resultType); } /*-----------------------------------------------------------------*/ @@ -5574,7 +5666,7 @@ ast * optimizeGetByte (ast * tree, RESULT_TYPE resultType) { - unsigned int i = 0; + unsigned int i = 1; ast *expr; ast *count = NULL; @@ -5596,7 +5688,7 @@ expr = tree->left; } } - if (!expr || (i == 0) || (i % 8) || (i >= getSize (TTYPE (expr)) * 8)) + if (!expr || (i % 8) || (i >= getSize (TTYPE (expr)) * 8)) return tree; /* make sure the port supports GETBYTE */ @@ -5612,7 +5704,7 @@ ast * optimizeGetWord (ast * tree, RESULT_TYPE resultType) { - unsigned int i = 0; + unsigned int i = 1; ast *expr; ast *count = NULL; @@ -5634,7 +5726,7 @@ expr = tree->left; } } - if (!expr || (i == 0) || (i % 8) || (i >= (getSize (TTYPE (expr)) - 1) * 8)) + if (!expr || (i % 8) || (i >= (getSize (TTYPE (expr)) - 1) * 8)) return tree; /* make sure the port supports GETWORD */ @@ -5761,7 +5853,6 @@ /* (?symbol << 7) | (?symbol >> 1) */ if (IS_RIGHT_OP (root->right) && IS_LEFT_OP (root->left)) { - if (!SPEC_USIGN (TETYPE (root->left->left))) return root; @@ -5784,7 +5875,6 @@ /* whew got the first case : create the AST */ return newNode (RRC, root->left->left, NULL); - } /* not found return root */ @@ -5835,7 +5925,6 @@ return newNode (SWAP, root->left->left, NULL); } - /* not found return root */ return root; } @@ -6061,7 +6150,6 @@ } } - /*-----------------------------------------------------------------*/ /* fixupInline - perform various fixups on an inline function tree */ /* to take into account that it is no longer a */ @@ -6250,10 +6338,16 @@ SPEC_OCLS (sym->etype) = NULL; SPEC_EXTR (sym->etype) = 0; SPEC_STAT (sym->etype) = 0; - if IS_SPEC - (sym->type) SPEC_VOLATILE (sym->type) = 0; + if (IS_SPEC (sym->type)) + { + SPEC_VOLATILE (sym->type) = 0; + SPEC_ADDRSPACE (sym->type) = 0; + } else - DCL_PTR_VOLATILE (sym->type) = 0; + { + DCL_PTR_VOLATILE (sym->type) = 0; + DCL_PTR_ADDRSPACE (sym->type) = 0; + } SPEC_ABSA (sym->etype) = 0; return sym; @@ -6319,7 +6413,6 @@ } } - /*-----------------------------------------------------------------*/ /* expandInlineFuncs - replace calls to inline functions with the */ /* function itself */ @@ -6370,7 +6463,6 @@ copyAstLoc (temptree, tree); inlinetree2 = temptree; - /* Handle the return type */ if (!IS_VOID (func->type->next)) { @@ -6387,7 +6479,6 @@ inlineAddDecl (retsym, block, TRUE, TRUE); } - inlinetree = newNode (BLOCK, NULL, inlinetree2); copyAstLoc (inlinetree, tree); @@ -6639,7 +6730,6 @@ } skipall: - /* dealloc the block variables */ processBlockVars (body, &stack, DEALLOCATE); outputDebugStackSymbols (); @@ -6664,12 +6754,43 @@ cleanUpLevel (LabelTab, 0); cleanUpBlock (StructTab, 1); cleanUpBlock (TypedefTab, 1); + cleanUpBlock (AddrspaceTab, 1); xstack->syms = NULL; istack->syms = NULL; + currFunc = NULL; return NULL; } +/*-----------------------------------------------------------------*/ +/* createConfigure - This is the key node that calls the iCode for */ +/* generating the code for a pic16 cofigure. Note */ +/* code is generated function by function, later */ +/* when add inter-procedural analysis this will */ +/* change */ +/*-----------------------------------------------------------------*/ +ast * +createConfigure (ast * body, const char * str) +{ + ast *ex; + + ex = newNode (INLINEASM, NULL, NULL); + ex->values.inlineasm = str; + ex->decorated = 1; + + if (options.dump_tree) + PA (ex); + + if (!fatalError) + { + /* create the node & generate intermediate code */ + GcurMemmap = code; + codeOutBuf = &code->oBuf; + eBBlockFromiCode (iCodeFromAst (ex)); + } + + return NULL; +} #define INDENT(x,f) do { fprintf (f, "%s:%d:", tree->filename, tree->lineno); fprintf (f, "%*s", (x) & 0xff, ""); } while (0) /*-----------------------------------------------------------------*/ @@ -6983,7 +7104,6 @@ ast_print (tree->right, outfile, indent + 2); return; - /*------------------------------------------------------------------*/ /*----------------------------*/ /* unary '+' operator */ @@ -7514,12 +7634,12 @@ * > info node: (gcc-4.1)Offsetof * > * > primary: - * > "__builtin_offsetof" "(" `typename' "," offsetof_member_designator ")" + * > "__builtin_offsetof" "(" `typename' "," offsetof_member_designator ")" * > * > offsetof_member_designator: - * > `identifier' - * > | offsetof_member_designator "." `identifier' - * > | offsetof_member_designator "[" `expr' "]" + * > `identifier' + * > | offsetof_member_designator "." `identifier' + * > | offsetof_member_designator "[" `expr' "]" * > * > This extension is sufficient such that * > diff -Nru sdcc-3.1.0+dfsg/src/SDCCast.h sdcc-3.2.0+dfsg/src/SDCCast.h --- sdcc-3.1.0+dfsg/src/SDCCast.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCast.h 2012-03-29 09:06:54.000000000 +0000 @@ -66,7 +66,7 @@ /* union for special processing */ union { - char *inlineasm; /* pointer to inline assembler code */ + const char *inlineasm; /* pointer to inline assembler code */ literalList *constlist; /* init list for array initializer. */ symbol *sym; /* if block then -> symbols */ value *args; /* if function then args */ @@ -97,6 +97,7 @@ * type resulting from a typecast. */ unsigned removedCast:1; /* true if the explicit cast has been removed */ + unsigned implicitCast:1; /* true if compiler added this cast */ } cast; int argreg; /* argreg number when operand type == EX_OPERAND */ } @@ -200,6 +201,7 @@ value *evalStmnt (ast *); ast *createRMW (ast *, unsigned, ast *); ast *createFunction (symbol *, ast *); +ast *createConfigure (ast *, const char * str); ast *createBlock (symbol *, ast *); ast *createLabel (symbol *, ast *); ast *createCase (ast *, ast *, ast *); @@ -219,7 +221,7 @@ bool constExprTree (ast *); int setAstFileLine (ast *, char *, int); symbol *funcOfType (const char *, sym_link *, sym_link *, int, int); -symbol *funcOfTypeVarg (char *, char *, int, char **); +symbol *funcOfTypeVarg (const char *, const char *, int, const char **); ast *initAggregates (symbol *, initList *, ast *); bool hasSEFcalls (ast *); void addSymToBlock (symbol *, ast *); diff -Nru sdcc-3.1.0+dfsg/src/SDCCbitv.c sdcc-3.2.0+dfsg/src/SDCCbitv.c --- sdcc-3.1.0+dfsg/src/SDCCbitv.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCbitv.c 2012-05-29 07:51:36.000000000 +0000 @@ -97,6 +97,7 @@ int byteSize; int offset; + assert (pos>=0); /* if set is null then allocate it */ if (!bvp) bvp = newBitVect (bitVectDefault); /* allocate for twice the size */ @@ -119,6 +120,7 @@ int byteSize; int offset; + assert (pos>=0); if (!bvp) return; @@ -140,6 +142,7 @@ int byteSize; int offset; + assert (pos>=0); if (!bvp) return 0; diff -Nru sdcc-3.1.0+dfsg/src/SDCCcse.c sdcc-3.2.0+dfsg/src/SDCCcse.c --- sdcc-3.1.0+dfsg/src/SDCCcse.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCcse.c 2012-06-10 12:32:06.000000000 +0000 @@ -34,6 +34,7 @@ newCseDef (operand * sym, iCode * ic) { cseDef *cdp; + memmap *map; assert (sym); cdp = Safe_alloc (sizeof (cseDef)); @@ -45,18 +46,28 @@ cdp->fromGlobal = 0; cdp->fromAddrTaken = 0; - if (ic->op!=IF && ic->op!=JUMPTABLE) + if (ic->op != IF && ic->op != JUMPTABLE) { - if (IC_LEFT (ic) && IS_SYMOP (IC_LEFT (ic))) + if (ic->op != ADDRESS_OF && IC_LEFT (ic) && IS_SYMOP (IC_LEFT (ic))) { bitVectSetBit (cdp->ancestors, IC_LEFT (ic)->key); - cdp->fromGlobal |= isOperandGlobal (IC_LEFT (ic)); + if (isOperandGlobal (IC_LEFT (ic))) + { + map = SPEC_OCLS (getSpec (operandType (IC_LEFT (ic)))); + if (map) + cdp->fromGlobal |= (1 << map->ptrType); + } cdp->fromAddrTaken |= OP_SYMBOL (IC_LEFT (ic))->addrtaken; } if (IC_RIGHT (ic) && IS_SYMOP (IC_RIGHT (ic))) { bitVectSetBit (cdp->ancestors, IC_RIGHT (ic)->key); - cdp->fromGlobal |= isOperandGlobal (IC_RIGHT (ic)); + if (isOperandGlobal (IC_RIGHT (ic))) + { + map = SPEC_OCLS (getSpec (operandType (IC_RIGHT (ic)))); + if (map) + cdp->fromGlobal |= (1 << map->ptrType); + } cdp->fromAddrTaken |= OP_SYMBOL (IC_RIGHT (ic))->addrtaken; } } @@ -73,7 +84,7 @@ if (ic->op!=IF && ic->op!=JUMPTABLE) { - if (IC_LEFT (ic) && IS_SYMOP (IC_LEFT (ic))) + if (ic->op != ADDRESS_OF && IC_LEFT (ic) && IS_SYMOP (IC_LEFT (ic))) { bitVectSetBit (cdp->ancestors, IC_LEFT (ic)->key); for (sl = cseSet; sl; sl = sl->next) @@ -121,7 +132,6 @@ return (src->key == dest->key && src->diCode == dest->diCode); - } /*-----------------------------------------------------------------*/ @@ -345,7 +355,7 @@ /* not found it yet check if this is the one */ /* and this is not the defining one */ - if (cop->key == cdp->key) + if (cop->key && cop->key == cdp->key) { /* do a special check this will help in */ /* constant propagation & dead code elim */ @@ -482,6 +492,7 @@ V_ARG (operand *, rop); if (POINTER_SET (cdp->diCode) && + op->key && IC_RESULT (cdp->diCode)->key == op->key && !isOperandVolatile (IC_RESULT (cdp->diCode), TRUE) && !isOperandVolatile (IC_RIGHT (cdp->diCode), TRUE) && @@ -530,7 +541,7 @@ /* if iCodes are not the same */ /* see the operands maybe interchanged */ if (ic->op == cdp->diCode->op && - IS_ASSOCIATIVE(ic) && + IS_COMMUTATIVE (ic) && isOperandEqual (IC_LEFT (ic), IC_RIGHT (cdp->diCode)) && isOperandEqual (IC_RIGHT (ic), IC_LEFT (cdp->diCode))) { @@ -565,6 +576,23 @@ return cdp->fromGlobal; } +/*-------------------------------------------------------------------*/ +/* ifFromGlobalAliasableByPtr - if definition is derived from global */ +/* that may be aliasble by a particular pointer type */ +/*-------------------------------------------------------------------*/ +DEFSETFUNC (ifFromGlobalAliasableByPtr) +{ + cseDef *cdp = item; + V_ARG (DECLARATOR_TYPE, decl); + + if (decl == GPOINTER && cdp->fromGlobal) + return 1; + else if (cdp->fromGlobal & (1 << decl)) + return 1; + else + return 0; +} + /*-----------------------------------------------------------------*/ /* ifDefGlobal - if definition is global */ /*-----------------------------------------------------------------*/ @@ -575,6 +603,24 @@ return (isOperandGlobal (cdp->sym)); } +/*-----------------------------------------------------------------*/ +/* ifDefGlobalAliasableByPtr - if definition is global */ +/* and may be aliasble by a particular pointer type */ +/*-----------------------------------------------------------------*/ +DEFSETFUNC (ifDefGlobalAliasableByPtr) +{ + cseDef *cdp = item; + V_ARG (DECLARATOR_TYPE, decl); + memmap *map; + + if (!isOperandGlobal (cdp->sym)) + return 0; + if (decl == GPOINTER) + return 1; + map = SPEC_OCLS (getSpec (operandType (cdp->sym))); + return (map->ptrType == decl); +} + /*-------------------------------------------------------------------*/ /* ifFromAddrTaken - if definition is derived from a symbol whose */ /* address was taken */ @@ -600,6 +646,48 @@ } /*-----------------------------------------------------------------*/ +/* ifAnyUnrestrictedGetPointer - if get pointer icode */ +/*-----------------------------------------------------------------*/ +DEFSETFUNC (ifAnyUnrestrictedGetPointer) +{ + cseDef *cdp = item; + V_ARG (DECLARATOR_TYPE, decl); + + if (cdp->diCode && POINTER_GET (cdp->diCode)) + { + sym_link *ptype; + ptype = operandType (IC_LEFT (cdp->diCode)); + if (!IS_PTR_RESTRICT (ptype)) + { + if (DCL_TYPE (ptype) == decl || IS_GENPTR (ptype)) + return 1; + } + } + return 0; +} + +/*-----------------------------------------------------------------*/ +/* ifAnyUnrestrictedSetPointer - if set pointer icode */ +/*-----------------------------------------------------------------*/ +DEFSETFUNC (ifAnyUnrestrictedSetPointer) +{ + cseDef *cdp = item; + V_ARG (DECLARATOR_TYPE, decl); + + if (cdp->diCode && POINTER_SET (cdp->diCode)) + { + sym_link *ptype; + ptype = operandType (IC_RESULT (cdp->diCode)); + if (!IS_PTR_RESTRICT (ptype)) + { + if (DCL_TYPE (ptype) == decl || IS_GENPTR (ptype)) + return 1; + } + } + return 0; +} + +/*-----------------------------------------------------------------*/ /* ifOperandsHave - if any of the operand are the same as this */ /*-----------------------------------------------------------------*/ DEFSETFUNC (ifOperandsHave) @@ -620,6 +708,11 @@ IC_RIGHT (cdp->diCode)->key == op->key) return 1; + if (POINTER_SET (cdp->diCode) && + IS_SYMOP (IC_RESULT (cdp->diCode)) && + IC_RESULT (cdp->diCode)->key == op->key) + return 1; + /* or if any of the operands are volatile */ if (IC_LEFT (cdp->diCode) && IS_OP_VOLATILE (IC_LEFT (cdp->diCode))) @@ -667,7 +760,7 @@ V_ARG (operand *, op); int match; - if (op && cdp->sym) + if (op && cdp->sym && op->key) match = cdp->sym->key == op->key; else match = (isOperandEqual (cdp->sym, op)); @@ -711,7 +804,7 @@ iCode *dic = cdp->diCode; operand *left = IC_LEFT (cdp->diCode); - if (POINTER_GET (dic) && left->key == op->key) + if (POINTER_GET (dic) && op->key && left->key == op->key) return 1; return 0; @@ -725,7 +818,7 @@ cseDef *cdp = item; V_ARG (operand *, op); - if (POINTER_SET (cdp->diCode) && + if (POINTER_SET (cdp->diCode) && op->key && IC_RESULT (cdp->diCode)->key == op->key) return 1; @@ -823,6 +916,11 @@ IC_RESULT (ic) = operandFromOperand (IC_RESULT (ic)); IC_RESULT (ic)->isaddr = 0; setOperandType (IC_RESULT (ic), operandType (IC_RIGHT (ic))); + if (IS_DECL (operandType (IC_RESULT (ic)))) + { + DCL_PTR_VOLATILE (operandType (IC_RESULT (ic))) = 0; + DCL_PTR_ADDRSPACE (operandType (IC_RESULT (ic))) = 0; + } return; } @@ -1221,6 +1319,8 @@ } if (IS_OP_LITERAL (IC_RIGHT (ic))) { + unsigned val; + /* if BITWISEAND then check if one of them is a zero */ /* if yes turn it into 0 assignment */ if (operandLitValue (IC_RIGHT (ic)) == 0.0) @@ -1240,24 +1340,24 @@ } /* if BITWISEAND then check if one of them is 0xff... */ /* if yes turn it into assignment */ - { - unsigned val; - - switch (getSize (operandType (IC_RIGHT (ic)))) - { - case 1: - val = 0xff; - break; - case 2: - val = 0xffff; - break; - case 4: - val = 0xffffffff; - break; - default: - return; - } - if (((unsigned) double2ul (operandLitValue (IC_RIGHT (ic))) & val) == val) + switch (bitsForType (operandType (IC_RIGHT (ic)))) + { + case 1: + val = 0x01; + break; + case 8: + val = 0xff; + break; + case 16: + val = 0xffff; + break; + case 32: + val = 0xffffffff; + break; + default: + return; + } + if (((unsigned) double2ul (operandLitValue (IC_RIGHT (ic))) & val) == val) { ic->op = '='; IC_RIGHT (ic) = IC_LEFT (ic); @@ -1265,7 +1365,6 @@ SET_RESULT_RIGHT (ic); return; } - } } break; case '|': @@ -1311,15 +1410,18 @@ } /* if BITWISEOR then check if one of them is 0xff... */ /* if yes turn it into 0xff... assignment */ - switch (getSize (operandType (IC_RIGHT (ic)))) + switch (bitsForType (operandType (IC_RIGHT (ic)))) { case 1: + val = 0x01; + break; + case 8: val = 0xff; break; - case 2: + case 16: val = 0xffff; break; - case 4: + case 32: val = 0xffffffff; break; default: @@ -1389,6 +1491,29 @@ return; } } + /* if XOR then check if one of them is a zero or one */ + /* if yes turn it into assignment or invert */ + if (IS_OP_LITERAL (IC_RIGHT (ic)) && + IS_BOOLEAN (operandType (IC_LEFT (ic))) && + IS_BOOLEAN (operandType (IC_RESULT (ic))) + ) + { + double litval = operandLitValue (IC_RIGHT (ic)); + if (litval == 1.0) + { + ic->op = '!'; + IC_RIGHT (ic) = NULL; + return; + } + else + { + ic->op = '='; + IC_RIGHT (ic) = operandFromLit (1); + IC_LEFT (ic) = NULL; + SET_RESULT_RIGHT (ic); + return; + } + } break; } @@ -1575,10 +1700,7 @@ /* too often, if it does happen then the user pays */ /* the price */ computeControlFlow (ebbi); - if (!options.lessPedantic) - { - werrorfl (ic->filename, ic->lineno, W_CONTROL_FLOW); - } + werrorfl (ic->filename, ic->lineno, W_CONTROL_FLOW); return; } @@ -1589,10 +1711,7 @@ if (elementsInSet (ebb->succList) == 1 && isinSet (ebb->succList, eBBWithEntryLabel (ebbi, label))) { - if (!options.lessPedantic) - { - werrorfl (ic->filename, ic->lineno, W_CONTROL_FLOW); - } + werrorfl (ic->filename, ic->lineno, W_CONTROL_FLOW); if (IS_OP_VOLATILE (IC_COND (ic))) { IC_RIGHT (ic) = IC_COND (ic); @@ -1984,7 +2103,7 @@ } /* clear the def & use chains for the operands involved */ - /* in this operation . since it can change due to opts */ + /* in this operation since it can change due to opts */ unsetDefsAndUses (ic); if (ic->op == PCALL || ic->op == CALL || ic->op == RECEIVE) @@ -2226,6 +2345,7 @@ { algebraicOpts (ic, ebb); while (constFold (ic, cseSet)); + while (boolCast (ic, cseSet)); } /* if after all this it becomes an assignment to self @@ -2329,8 +2449,18 @@ if (!(POINTER_SET (ic)) && IS_SYMOP (IC_RESULT (ic))) { deleteItemIf (&cseSet, ifOperandsHave, IC_RESULT (ic)); + deleteItemIf (&ptrSetSet, ifOperandsHave, IC_RESULT (ic)); /* delete any previous definitions */ ebb->defSet = bitVectCplAnd (ebb->defSet, OP_DEFS (IC_RESULT (ic))); + + /* Until pointer tracking is complete, by conservative and delete all */ + /* pointer accesses that might alias this symbol. */ + if (isOperandGlobal (IC_RESULT (ic))) + { + memmap *map = SPEC_OCLS (getSpec (operandType (IC_RESULT (ic)))); + deleteItemIf (&cseSet, ifAnyUnrestrictedGetPointer, map->ptrType); + deleteItemIf (&ptrSetSet, ifAnyUnrestrictedSetPointer, map->ptrType); + } } /* add the left & right to the defUse set */ @@ -2353,6 +2483,8 @@ if (POINTER_SET (defic) && (IS_SYMOP (IC_RESULT (ic)) || IS_OP_LITERAL (IC_RESULT (ic)))) { + sym_link *ptype = operandType (IC_RESULT (ic)); + if (IS_SYMOP (IC_RESULT (ic))) { OP_USES (IC_RESULT (ic)) = @@ -2371,6 +2503,20 @@ deleteItemIf (&ptrSetSet, ifPointerSet, IC_RESULT (ic)); /* add to the local pointerset set */ addSetHead (&ptrSetSet, newCseDef (IC_RESULT (ic), ic)); + + /* A write via a non-restrict pointer may modify a global */ + /* variable used by this function, so delete them */ + /* and any derived symbols from cseSet. */ + if (!IS_PTR_RESTRICT (ptype)) + { + deleteItemIf (&cseSet, ifDefGlobalAliasableByPtr); + deleteItemIf (&cseSet, ifFromGlobalAliasableByPtr, DCL_TYPE(ptype)); + } + + /* This could be made more specific for better optimization, but */ + /* for safety, delete anything this write may have modified. */ + deleteItemIf (&cseSet, ifFromAddrTaken); + deleteItemIf (&cseSet, ifAnyGetPointer); } else { diff -Nru sdcc-3.1.0+dfsg/src/SDCCcse.h sdcc-3.2.0+dfsg/src/SDCCcse.h --- sdcc-3.1.0+dfsg/src/SDCCcse.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCcse.h 2012-03-24 06:04:28.000000000 +0000 @@ -35,7 +35,7 @@ operand *sym; /* defining symbol */ iCode *diCode; /* defining instruction */ bitVect *ancestors; /* keys of the symbol's ancestors */ - int fromGlobal:1; /* defining symbol's value computed from a global */ + int fromGlobal; /* defining symbol's value computed from a global */ int fromAddrTaken:1; /* defining symbol's value computed from a */ /* symbol whose address was taken */ } diff -Nru sdcc-3.1.0+dfsg/src/SDCCdebug.c sdcc-3.2.0+dfsg/src/SDCCdebug.c --- sdcc-3.1.0+dfsg/src/SDCCdebug.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCdebug.c 2012-03-30 20:01:27.000000000 +0000 @@ -1,3 +1,23 @@ +/*------------------------------------------------------------------------- + SDCCdebug.c - source file for debug infrastructure + + Copyright (C) 2003, Lenny Story and Bernhard Held + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-------------------------------------------------------------------------*/ + #include "common.h" extern DEBUGFILE cdbDebugFile; diff -Nru sdcc-3.1.0+dfsg/src/SDCCdebug.h sdcc-3.2.0+dfsg/src/SDCCdebug.h --- sdcc-3.1.0+dfsg/src/SDCCdebug.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCdebug.h 2012-03-30 20:01:27.000000000 +0000 @@ -1,3 +1,22 @@ +/*------------------------------------------------------------------------- + SDCCdebug.h - header file debug infrastructure + + Copyright (C) 2003, Lenny Story and Bernhard Held + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-------------------------------------------------------------------------*/ #ifndef _DEBUG_INCLUDE_ #define _DEBUG_INCLUDE_ diff -Nru sdcc-3.1.0+dfsg/src/SDCCerr.c sdcc-3.2.0+dfsg/src/SDCCerr.c --- sdcc-3.1.0+dfsg/src/SDCCerr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCerr.c 2012-06-26 20:34:19.000000000 +0000 @@ -236,10 +236,10 @@ { E_EXTERN_MISMATCH, ERROR_LEVEL_ERROR, "extern definition for '%s' mismatches with declaration.", 0 }, { E_NONRENT_ARGS, ERROR_LEVEL_ERROR, - "Functions called via pointers must be 'reentrant' to take this many arguments", 0 }, + "Functions called via pointers must be 'reentrant' to take this many (bytes for) arguments", 0 }, { W_DOUBLE_UNSUPPORTED, ERROR_LEVEL_WARNING, "type 'double' not supported assuming 'float'", 0 }, - { W_COMP_RANGE, ERROR_LEVEL_WARNING, + { W_COMP_RANGE, ERROR_LEVEL_PEDANTIC, "comparison is always %s due to limited range of data type", 0 }, { W_FUNC_NO_RETURN, ERROR_LEVEL_WARNING, "no 'return' statement found for function '%s'", 0 }, @@ -369,7 +369,7 @@ "symbol name too long, truncated to %d chars", 0 }, { W_CAST_STRUCT_PTR, ERROR_LEVEL_WARNING, "cast of struct %s * to struct %s * ", 0 }, - { W_LIT_OVERFLOW, ERROR_LEVEL_WARNING, + { W_LIT_OVERFLOW, ERROR_LEVEL_PEDANTIC, "overflow in implicit constant conversion", 0 }, { E_PARAM_NAME_OMITTED, ERROR_LEVEL_ERROR, "in function %s: name omitted for parameter %d", 0 }, @@ -434,7 +434,7 @@ "flexible array member not at end of struct", 0 }, { E_FLEXARRAY_INEMPTYSTRCT, ERROR_LEVEL_ERROR, "flexible array in otherwise empty struct", 0 }, - { W_EMPTY_SOURCE_FILE, ERROR_LEVEL_WARNING, + { W_EMPTY_SOURCE_FILE, ERROR_LEVEL_PEDANTIC, "ISO C forbids an empty source file", 0 }, { W_BAD_PRAGMA_ARGUMENTS, ERROR_LEVEL_WARNING, "#pragma %s: bad argument(s); pragma ignored", 0 }, @@ -470,35 +470,46 @@ "invalid combination of short / long", 0 }, { E_INTEGERSUFFIX, ERROR_LEVEL_ERROR, "Invalid integer suffix '%s' in integer constant", 0}, + { E_AUTO_ADDRSPACE, ERROR_LEVEL_ERROR, + "named address space not allowed for automatic var '%s'", 0}, + { W_NORETURNRETURN, ERROR_LEVEL_WARNING, + "return in _Noreturn function", 0}, + { E_STRUCT_REDEF, ERROR_LEVEL_ERROR, + "struct/union '%s' redefined", 0 }, + { W_STRING_CANNOT_BE_TERMINATED, ERROR_LEVEL_PEDANTIC, + "string '%s'cannot be terminated within array", 0 }, + { W_LONGLONG_LITERAL, ERROR_LEVEL_WARNING, + "support for long long literals is incomplete", 0 }, + { S_SYNTAX_ERROR, ERROR_LEVEL_SYNTAX_ERROR, + "token -> '%s' ; column %d", 0 }, }; -/* -------------------------------------------------------------------------------- -SetErrorOut - Set the error output file - -------------------------------------------------------------------------------- -*/ - +/* ------------------------------------------------------------------------------- + * SetErrorOut - Set the error output file + * ------------------------------------------------------------------------------- + */ FILE * SetErrorOut (FILE *NewErrorOut) { - _SDCCERRG.out = NewErrorOut ; + _SDCCERRG.out = NewErrorOut; - return NewErrorOut ; + return NewErrorOut; } +/* ------------------------------------------------------------------------------- + * setErrorLogLevel - Set the error log level: + * which level has to be treated as an error + * ------------------------------------------------------------------------------- + */ void setErrorLogLevel (ERROR_LOG_LEVEL level) { _SDCCERRG.logLevel = level; } -/* -------------------------------------------------------------------------------- -vwerror - Output a standard error message with variable number of arguments - -------------------------------------------------------------------------------- -*/ - +/* ------------------------------------------------------------------------------- + * vwerror - Output a standard error message with variable number of arguments + * ------------------------------------------------------------------------------- + */ int vwerror (int errNum, va_list marker) { @@ -509,28 +520,28 @@ if (errNum > NELEM (ErrTab)) { - fprintf (_SDCCERRG.out, + fprintf (_SDCCERRG.out, "Internal error: bad error number %d.", errNum); return 0; } if (NELEM (ErrTab) != NUMBER_OF_ERROR_MESSAGES || ErrTab[errNum].errIndex != errNum) { - fprintf (_SDCCERRG.out, + fprintf (_SDCCERRG.out, "Internal error: error table entry for %d inconsistent.", errNum); return 0; } if ((ErrTab[errNum].errType >= _SDCCERRG.logLevel) && (!ErrTab[errNum].disabled)) { - if (ErrTab[errNum].errType == ERROR_LEVEL_ERROR || _SDCCERRG.werror) - fatalError++ ; - + if (ErrTab[errNum].errType >= ERROR_LEVEL_ERROR || _SDCCERRG.werror) + fatalError++; + if (filename && lineno) { if (_SDCCERRG.style) - fprintf (_SDCCERRG.out, "%s(%d) : ",filename,lineno); + fprintf (_SDCCERRG.out, "%s(%d) : ", filename, lineno); else - fprintf (_SDCCERRG.out, "%s:%d: ",filename,lineno); + fprintf (_SDCCERRG.out, "%s:%d: ", filename, lineno); } else if (lineno) { @@ -543,6 +554,10 @@ switch (ErrTab[errNum].errType) { + case ERROR_LEVEL_SYNTAX_ERROR: + fprintf (_SDCCERRG.out, "syntax error: "); + break; + case ERROR_LEVEL_ERROR: fprintf (_SDCCERRG.out, "error %d: ", errNum); break; @@ -560,12 +575,12 @@ break; default: - break; + break; } - - vfprintf (_SDCCERRG.out, ErrTab[errNum].errText,marker); - fprintf (_SDCCERRG.out, "\n"); - return 1; + + vfprintf (_SDCCERRG.out, ErrTab[errNum].errText, marker); + fprintf (_SDCCERRG.out, "\n"); + return 1; } else { @@ -574,13 +589,10 @@ } } -/* -------------------------------------------------------------------------------- -werror - Output a standard error message with variable number of arguments - -------------------------------------------------------------------------------- -*/ - +/* ------------------------------------------------------------------------------- + * werror - Output a standard error message with variable number of arguments + * ------------------------------------------------------------------------------- + */ int werror (int errNum, ...) { @@ -592,14 +604,11 @@ return ret; } -/* -------------------------------------------------------------------------------- -werrorfl - Output a standard error message with variable number of arguments. - Use a specified filename and line number instead of the default. - -------------------------------------------------------------------------------- -*/ - +/* ------------------------------------------------------------------------------- + * werrorfl - Output a standard error message with variable number of arguments. + * Use a specified filename and line number instead of the default. + * ------------------------------------------------------------------------------- + */ int werrorfl (char *newFilename, int newLineno, int errNum, ...) { @@ -620,13 +629,11 @@ return ret; } - -/* -------------------------------------------------------------------------------- -fatal - Output a standard error message with variable number of arguments and - call exit() -------------------------------------------------------------------------------- -*/ +/* ------------------------------------------------------------------------------- + * fatal - Output a standard error message with variable number of arguments and + * call exit() + * ------------------------------------------------------------------------------- + */ void fatal (int exitCode, int errNum, ...) { @@ -638,24 +645,20 @@ exit (exitCode); } -/* -------------------------------------------------------------------------------- -style - Change the output error style to MSVC -------------------------------------------------------------------------------- -*/ - +/* ------------------------------------------------------------------------------- + * style - Change the output error style to MSVC + * ------------------------------------------------------------------------------- + */ void MSVC_style (int style) { _SDCCERRG.style = style; } -/* -------------------------------------------------------------------------------- -disabled - Disable output of specified warning -------------------------------------------------------------------------------- -*/ - +/* ------------------------------------------------------------------------------- + * disabled - Disable output of specified warning + * ------------------------------------------------------------------------------- + */ void setWarningDisabled (int errNum) { @@ -663,12 +666,10 @@ ErrTab[errNum].disabled = 1; } -/* -------------------------------------------------------------------------------- -Set the flag to treat warnings as errors -------------------------------------------------------------------------------- -*/ - +/* ------------------------------------------------------------------------------- + * Set the flag to treat warnings as errors + * ------------------------------------------------------------------------------- + */ void setWError (int flag) { diff -Nru sdcc-3.1.0+dfsg/src/SDCCerr.h sdcc-3.2.0+dfsg/src/SDCCerr.h --- sdcc-3.1.0+dfsg/src/SDCCerr.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCerr.h 2012-06-26 20:34:19.000000000 +0000 @@ -234,6 +234,12 @@ W_UNIVERSAL_C99 = 205, /* universal character names are only valid in C99 */ E_SHORTLONG = 206, /* Invalid combination of short / long */ E_INTEGERSUFFIX = 207, /* Invalid integer suffix */ + E_AUTO_ADDRSPACE = 208, /* named address space for auto var */ + W_NORETURNRETURN = 209, /* return in _noreturn function */ + E_STRUCT_REDEF = 210, /* struct or union tag redefined */ + W_STRING_CANNOT_BE_TERMINATED = 211, /* string cannot be terminated within array */ + W_LONGLONG_LITERAL = 212, /* long long literal */ + S_SYNTAX_ERROR = 213, /* syntax error */ /* don't touch this! */ NUMBER_OF_ERROR_MESSAGES /* Number of error messages */ @@ -265,7 +271,9 @@ /** Most warnings. */ ERROR_LEVEL_WARNING, /** Errors only. */ - ERROR_LEVEL_ERROR + ERROR_LEVEL_ERROR, + /** Syntax error only. */ + ERROR_LEVEL_SYNTAX_ERROR }; typedef enum _ERROR_LOG_LEVEL ERROR_LOG_LEVEL; diff -Nru sdcc-3.1.0+dfsg/src/SDCCgen.c sdcc-3.2.0+dfsg/src/SDCCgen.c --- sdcc-3.1.0+dfsg/src/SDCCgen.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCgen.c 2012-04-08 15:21:34.000000000 +0000 @@ -0,0 +1,336 @@ +/*------------------------------------------------------------------------- + SDCCgen.c - source files for target code generation common functions + + Copyright (C) 2012, Borut Razem + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-------------------------------------------------------------------------*/ + +#include "common.h" +#include "dbuf_string.h" + +/* Use the D macro for basic (unobtrusive) debugging messages */ +#define D(x) do if (options.verboseAsm) {x;} while(0) + +genLine_t genLine; + +/*-----------------------------------------------------------------*/ +/* newLineNode - creates a new peep line */ +/*-----------------------------------------------------------------*/ +lineNode * +newLineNode (const char *line) +{ + lineNode *pl; + + pl = Safe_alloc (sizeof (lineNode)); + pl->line = Safe_strdup (line); + pl->ic = NULL; + return pl; +} + +/*-----------------------------------------------------------------*/ +/* connectLine - connects two lines */ +/*-----------------------------------------------------------------*/ +lineNode * +connectLine (lineNode * pl1, lineNode * pl2) +{ + if (!pl1 || !pl2) + { + fprintf (stderr, "trying to connect null line\n"); + return NULL; + } + + pl2->prev = pl1; + pl1->next = pl2; + + return pl2; +} + +void +destroy_line_list (void) +{ + lineNode *pl; + + pl = genLine.lineCurr; + + while (pl) + { + lineNode *p; + + if (pl->line) + Safe_free (pl->line); + + if (pl->aln) + Safe_free (pl->aln); + + p = pl; + pl = pl->prev; + Safe_free (p); + } + genLine.lineHead = genLine.lineCurr = NULL; +} + +/*-----------------------------------------------------------------*/ +/* emit_raw - emit raw unformatted line */ +/*-----------------------------------------------------------------*/ +static void +add_line_node (const char *line) +{ + lineNode *pl; + + pl = Safe_alloc (sizeof (lineNode)); + +#if 1 + memcpy (pl, (lineElem_t *) & genLine.lineElement, sizeof (lineElem_t)); +#else + pl->ic = genLine.lineElement.ic; + pl->isInline = genLine.lineElement.isInline; + pl->isComment = genLine.lineElement.isComment; + pl->isDebug = genLine.lineElement.isDebug; + pl->isLabel = genLine.lineElement.isLabel; + pl->visited = genLine.lineElement.visited; + pl->aln = genLine.lineElement.aln; +#endif + + pl->line = Safe_strdup (line); + + if (genLine.lineCurr) + { + pl->next = NULL; + genLine.lineCurr->next = pl; + pl->prev = genLine.lineCurr; + genLine.lineCurr = pl; + } + else + { + pl->prev = pl->next = NULL; + genLine.lineCurr = genLine.lineHead = pl; + } +} + +void +emit_raw (const char *line) +{ + const char *p = line; + + while (isspace ((unsigned char) *p)) + p++; + + if (*p) + { + genLine.lineElement.isComment = (*p == ';'); + add_line_node (line); + } +} + +/*-----------------------------------------------------------------*/ +/* format_opcode - format the opcode and arguments for emitting */ +/*-----------------------------------------------------------------*/ +const char * +format_opcode (const char *inst, const char *fmt, va_list ap) +{ + struct dbuf_s dbuf; + + dbuf_init (&dbuf, INITIAL_INLINEASM); + + if (inst && *inst) + { + dbuf_append_str (&dbuf, inst); + + if (fmt && *fmt) + { + dbuf_append_char (&dbuf, '\t'); + dbuf_tvprintf (&dbuf, fmt, ap); + } + } + else + { + if (fmt && *fmt) + { + dbuf_tvprintf (&dbuf, fmt, ap); + } + } + + return dbuf_detach_c_str (&dbuf); +} + +void +va_emitcode (const char *inst, const char *fmt, va_list ap) +{ + const char *line = format_opcode (inst, fmt, ap); + emit_raw (line); + dbuf_free (line); +} + +/*-----------------------------------------------------------------*/ +/* emitcode - writes the code into a file : for now it is simple */ +/*-----------------------------------------------------------------*/ +void +emitcode (const char *inst, const char *fmt, ...) +{ + va_list ap; + + va_start (ap, fmt); + va_emitcode (inst, fmt, ap); + va_end (ap); +} + +void +emitLabel (symbol * tlbl) +{ + emitcode ("", "!tlabeldef", labelKey2num (tlbl->key)); + genLine.lineCurr->isLabel = 1; +} + +/*-----------------------------------------------------------------*/ +/* genInline - write the inline code out */ +/*-----------------------------------------------------------------*/ +void +genInline (iCode * ic) +{ + char *buf, *bp, *begin; + bool inComment = FALSE; + + D (emitcode (";", "genInline")); + + genLine.lineElement.isInline += (!options.asmpeep); + + buf = bp = begin = Safe_strdup (IC_INLINE (ic)); + + /* Emit each line as a code */ + while (*bp) + { + switch (*bp) + { + case ';': + inComment = TRUE; + ++bp; + break; + + case '\x87': + case '\n': + inComment = FALSE; + *bp++ = '\0'; + + /* Don't emit leading whitespaces */ + while (isspace (*begin)) + ++begin; + + if (*begin) + emitcode (begin, NULL); + + begin = bp; + break; + + default: + /* Add \n for labels, not dirs such as c:\mydir */ + if (!inComment && (*bp == ':') && (isspace ((unsigned char) bp[1]))) + { + ++bp; + *bp = '\0'; + ++bp; + emitcode (begin, NULL); + begin = bp; + } + else + ++bp; + break; + } + } + if (begin != bp) + { + /* Don't emit leading whitespaces */ + while (isspace (*begin)) + ++begin; + + if (*begin) + emitcode (begin, NULL); + } + + Safe_free (buf); + + /* consumed; we can free it here */ + dbuf_free (IC_INLINE (ic)); + + genLine.lineElement.isInline -= (!options.asmpeep); +} + +/*-----------------------------------------------------------------*/ +/* printLine - prints a line chain into a given file */ +/*-----------------------------------------------------------------*/ +void +printLine (lineNode * head, struct dbuf_s *oBuf) +{ + iCode *last_ic = NULL; + bool debug_iCode_tracking = (getenv ("DEBUG_ICODE_TRACKING") != NULL); + + while (head) + { + if (head->ic != last_ic) + { + last_ic = head->ic; + if (debug_iCode_tracking) + { + if (head->ic) + dbuf_printf (oBuf, "; block = %d, seq = %d\n", head->ic->block, head->ic->seq); + else + dbuf_append_str (oBuf, "; iCode lost\n"); + } + } + + /* don't indent comments & labels */ + if (head->line && (head->isComment || head->isLabel)) + { + dbuf_printf (oBuf, "%s\n", head->line); + } + else + { + if (head->isInline && *head->line == '#') + { + /* comment out preprocessor directives in inline asm */ + dbuf_append_char (oBuf, ';'); + } + dbuf_printf (oBuf, "\t%s\n", head->line); + } + head = head->next; + } +} + +/*-----------------------------------------------------------------*/ +/* ifxForOp - returns the icode containing the ifx for operand */ +/*-----------------------------------------------------------------*/ +iCode * +ifxForOp (operand * op, const iCode * ic) +{ + iCode *ifxIc; + + /* if true symbol then needs to be assigned */ + if (!IS_TRUE_SYMOP (op)) + { + /* if this has register type condition and + while skipping ipop's (see bug 1509084), + the next instruction is ifx with the same operand + and live to of the operand is upto the ifx only then */ + for (ifxIc = ic->next; ifxIc && ifxIc->op == IPOP; ifxIc = ifxIc->next) + ; + + if (ifxIc && ifxIc->op == IFX && + IC_COND (ifxIc)->key == op->key && + OP_SYMBOL (op)->liveTo <= ifxIc->seq) + return ifxIc; + } + + return NULL; +} diff -Nru sdcc-3.1.0+dfsg/src/SDCCgen.h sdcc-3.2.0+dfsg/src/SDCCgen.h --- sdcc-3.1.0+dfsg/src/SDCCgen.h 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCgen.h 2012-04-06 10:47:44.000000000 +0000 @@ -0,0 +1,105 @@ +/*------------------------------------------------------------------------- + SDCCgen.h - header file for target code generation common functions + + Copyright (C) 2012, Borut Razem + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-------------------------------------------------------------------------*/ + +#ifndef SDCCGEN_H +#define SDCCGEN_H 1 + +#include + +#include + +#define initGenLineElement() memset (&genLine.lineElement, 0, sizeof (lineElem_t)) +#define labelKey2num(key) ((key) + 100) + +/* can be inherited by each port */ +typedef struct asmLineNodeBase +{ + int size; + bitVect *regsRead; + bitVect *regsWritten; +} +asmLineNodeBase; + +typedef struct lineElem_s +{ + char *line; + iCode *ic; + unsigned int isInline:1; + unsigned int isComment:1; + unsigned int isDebug:1; + unsigned int isLabel:1; + unsigned int visited:1; + asmLineNodeBase *aln; +} +lineElem_t; + +typedef struct lineNode_s +{ +#ifdef UNNAMED_STRUCT_TAG + struct lineElem_s; +#else + /* exactly the same members as of struct lineElem_s */ + char *line; + iCode *ic; + unsigned int isInline:1; + unsigned int isComment:1; + unsigned int isDebug:1; + unsigned int isLabel:1; + unsigned int visited:1; + asmLineNodeBase *aln; +#endif + struct lineNode_s *prev; + struct lineNode_s *next; +} +lineNode; + +typedef struct genLine_s +{ + /* double linked list of lines */ + lineNode *lineHead; + lineNode *lineCurr; + + /* global line */ + lineElem_t lineElement; +} genLine_t; + +extern genLine_t genLine; + +#ifdef __cplusplus +extern "C" { +#endif + +lineNode *newLineNode (const char *line); +lineNode *connectLine (lineNode * pl1, lineNode * pl2); +void destroy_line_list (void); +const char *format_opcode (const char *inst, const char *fmt, va_list ap); +void emit_raw (const char *line); +void va_emitcode (const char *inst, const char *fmt, va_list ap); +void emitcode (const char *inst, const char *fmt, ...); +void emitLabel (symbol * tlbl); +void genInline (iCode * ic); +void printLine (lineNode *, struct dbuf_s *); +iCode *ifxForOp (operand *op, const iCode *ic); + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru sdcc-3.1.0+dfsg/src/SDCCglobl.h sdcc-3.2.0+dfsg/src/SDCCglobl.h --- sdcc-3.1.0+dfsg/src/SDCCglobl.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCglobl.h 2012-05-03 09:43:26.000000000 +0000 @@ -1,4 +1,22 @@ -/* SDCCglobl.h - global macros etc required by all files */ +/*------------------------------------------------------------------------- + SDCCglobl.h - global macros etc required by all files + + Copyright (C) 1998, Sandeep Dutta . sandeep.dutta@usa.net + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-------------------------------------------------------------------------*/ #ifndef SDCCGLOBL_H #define SDCCGLOBL_H @@ -10,17 +28,29 @@ #ifndef __cplusplus # ifndef _MSC_VER -# include -# define TRUE true -# define FALSE false +# include +# ifndef TRUE +# define TRUE true +# endif +# ifndef FALSE +# define FALSE false +# endif # else typedef unsigned char bool; -# define TRUE 1 -# define FALSE 0 +# ifndef TRUE +# define TRUE 1 +# endif +# ifndef FALSE +# define FALSE 0 +# endif # endif #else -# define TRUE true -# define FALSE false +# ifndef TRUE +# define TRUE true +# endif +# ifndef FALSE +# define FALSE false +# endif #endif #include "SDCCset.h" @@ -33,37 +63,37 @@ #define UNIX_DIR_SEPARATOR_CHAR '/' #if defined(__BORLANDC__) || defined(_MSC_VER) -#define STRCASECMP stricmp -#define STRNCASECMP strnicmp +# define STRCASECMP stricmp +# define STRNCASECMP strnicmp #else -#define STRCASECMP strcasecmp -#define STRNCASECMP strncasecmp +# define STRCASECMP strcasecmp +# define STRNCASECMP strncasecmp #endif #if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) || defined (__CYGWIN__) -#ifndef HAVE_DOS_BASED_FILE_SYSTEM -#define HAVE_DOS_BASED_FILE_SYSTEM 1 -#endif +# ifndef HAVE_DOS_BASED_FILE_SYSTEM +# define HAVE_DOS_BASED_FILE_SYSTEM 1 +# endif -#define IS_DIR_SEPARATOR(c) ((c) == DIR_SEPARATOR_CHAR || (c) == UNIX_DIR_SEPARATOR_CHAR) +# define IS_DIR_SEPARATOR(c) ((c) == DIR_SEPARATOR_CHAR || (c) == UNIX_DIR_SEPARATOR_CHAR) /* Note that IS_ABSOLUTE_PATH accepts d:foo as well, although it is only semi-absolute. This is because the users of IS_ABSOLUTE_PATH want to know whether to prepend the current working directory to a file name, which should not be done with a name like d:foo. */ -#define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]) || (((f)[0]) && ((f)[1] == ':'))) -#define FILENAME_CMP(s1, s2) STRCASECMP(s1, s2) +# define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]) || (((f)[0]) && ((f)[1] == ':'))) +# define FILENAME_CMP(s1, s2) STRCASECMP(s1, s2) #else /* not DOSish */ -#define IS_DIR_SEPARATOR(c) ((c) == DIR_SEPARATOR_CHAR) -#define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0])) -#define FILENAME_CMP(s1, s2) strcmp(s1, s2) +# define IS_DIR_SEPARATOR(c) ((c) == DIR_SEPARATOR_CHAR) +# define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0])) +# define FILENAME_CMP(s1, s2) strcmp(s1, s2) #endif /* not DOSish */ #ifdef WIN32 -# define NATIVE_WIN32 1 +# define NATIVE_WIN32 1 # ifndef __MINGW32__ # define PATH_MAX _MAX_PATH # endif @@ -84,47 +114,49 @@ #include /* PATH_MAX */ #if !defined(PATH_MAX) || (PATH_MAX < 2048) -# undef PATH_MAX -# define PATH_MAX 2048 /* define a reasonable value */ +# undef PATH_MAX +# define PATH_MAX 2048 /* define a reasonable value */ #endif -#define MAX_REG_PARMS 1 +#define MAX_REG_PARMS 1 -#ifndef max -# define max(a,b) (a > b ? a : b) -#endif - -#ifndef min -# define min(a,b) (a < b ? a : b) -#endif +/* C++ doesn't like min and max macros */ +#ifndef __cplusplus +# ifndef max +# define max(a,b) (a > b ? a : b) +# endif +# ifndef min +# define min(a,b) (a < b ? a : b) +# endif +#endif /* __cplusplus */ #ifndef THROWS -#define THROWS -#define THROW_NONE 0 -#define THROW_SRC 1 -#define THROW_DEST 2 -#define THROW_BOTH 3 +# define THROWS +# define THROW_NONE 0 +# define THROW_SRC 1 +# define THROW_DEST 2 +# define THROW_BOTH 3 #endif /* size's in bytes */ -#define BOOLSIZE port->s.char_size -#define CHARSIZE port->s.char_size -#define SHORTSIZE port->s.short_size -#define INTSIZE port->s.int_size -#define LONGSIZE port->s.long_size -#define LONGLONGSIZE port->s.longlong_size -#define PTRSIZE port->s.ptr_size -#define FPTRSIZE port->s.fptr_size -#define GPTRSIZE port->s.gptr_size -#define BITSIZE port->s.bit_size -#define FLOATSIZE port->s.float_size -#define MAXBASESIZE port->s.max_base_size +#define BOOLSIZE port->s.char_size +#define CHARSIZE port->s.char_size +#define SHORTSIZE port->s.short_size +#define INTSIZE port->s.int_size +#define LONGSIZE port->s.long_size +#define LONGLONGSIZE port->s.longlong_size +#define PTRSIZE port->s.ptr_size +#define FPTRSIZE port->s.fptr_size +#define GPTRSIZE port->s.gptr_size +#define BITSIZE port->s.bit_size +#define FLOATSIZE port->s.float_size +#define MAXBASESIZE port->s.max_base_size -#define SMALL_MODEL 0 -#define LARGE_MODEL 1 +#define SMALL_MODEL 0 +#define LARGE_MODEL 1 -#define MAX_TVAR 6 -#define INITIAL_INLINEASM 4*1024 +#define MAX_TVAR 6 +#define INITIAL_INLINEASM (4 * 1024) #define DEFPOOLSTACK(type,size) \ type *type##Pool ; \ type *type##FreeStack [size] ; \ @@ -142,7 +174,7 @@ #endif -#define COPYTYPE(start,end,from) (end = getSpec (start = from)) +#define COPYTYPE(start,end,from) (end = getSpec (start = from)) /* general purpose stack related macros */ @@ -247,10 +279,11 @@ int dump_pack; /* dump after register packing */ int dump_rassgn; /* dump after register assignment */ int dump_tree; /* dump front-end tree before lowering to iCode */ + int dump_graphs; /* Dump graphs in .dot format (control-flow, conflict, etc) */ int cc_only; /* compile only flag */ int intlong_rent; /* integer & long support routines reentrant */ int float_rent; /* floating point routines are reentrant */ - int out_fmt; /* 0 = undefined, 'i' = intel Hex format, 's' = motorola S19 format, 't' = elf format, 'Z' = gb format */ + int out_fmt; /* 0 = undefined, 'i' = intel Hex format, 's' = motorola S19 format, 'E' = elf format, 'Z' = gb format */ int cyclomatic; /* print cyclomatic information */ int noOverlay; /* don't overlay local variables & parameters */ int mainreturn; /* issue a return after main */ @@ -302,6 +335,7 @@ int use_stdout; /* send errors to stdout instead of stderr */ int no_std_crt0; /* for the z80/gbz80 do not link default crt0.o*/ int std_c99; /* enable C99 keywords/constructs */ + int std_c11; /* enable C11 keywords/constructs */ int std_sdcc; /* enable SDCC extensions to C */ int dollars_in_ident; /* zero means dollar signs are punctuation */ int unsigned_char; /* use unsigned for char without signed/unsigned modifier */ @@ -311,8 +345,9 @@ set *calleeSavesSet; /* list of functions using callee save */ set *excludeRegsSet; /* registers excluded from saving */ /* set *olaysSet; * not implemented yet: overlay segments used in #pragma OVERLAY */ - int max_allocs_per_node; /* Maximum number of allocations considered at each node in the tree-decomposition based register allocator */ - int noOptsdccInAsm; /* Do not emit .optsdcc in asm */ + int max_allocs_per_node; /* Maximum number of allocations / combinations considered at each node in the tree-decomposition based algorithms */ + bool noOptsdccInAsm; /* Do not emit .optsdcc in asm */ + bool oldralloc; /* Use old register allocator */ }; /* forward definition for variables accessed globally */ diff -Nru sdcc-3.1.0+dfsg/src/SDCCglue.c sdcc-3.2.0+dfsg/src/SDCCglue.c --- sdcc-3.1.0+dfsg/src/SDCCglue.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCglue.c 2012-05-21 21:40:35.000000000 +0000 @@ -70,13 +70,7 @@ char * aopLiteralLong (value * val, int offset, int size) { - union - { - float f; - unsigned char c[4]; - } - fl; - unsigned long v = ulFromVal (val); + unsigned long v; struct dbuf_s dbuf; if (!val) @@ -87,40 +81,28 @@ dbuf_init (&dbuf, 128); - /* if it is a float then it gets tricky */ - /* otherwise it is fairly simple */ - if (!IS_FLOAT (val->type)) + switch (size) { - v >>= (offset * 8); - switch (size) - { - case 1: - dbuf_tprintf (&dbuf, "!immedbyte", (unsigned int) v & 0xff); - break; - case 2: - dbuf_tprintf (&dbuf, "!immedword", (unsigned int) v & 0xffff); - break; - case 3: - // we don't have a !immedword24 yet for ds390 - dbuf_printf (&dbuf, "#0x%06X", (unsigned int) v & 0xffffff); - break; - default: - /* Hmm. Too big for now. */ - assert (0); - } - return dbuf_detach_c_str (&dbuf); + case 1: + v = byteOfVal (val, offset); + dbuf_tprintf (&dbuf, "!immedbyte", (unsigned int) v & 0xff); + break; + case 2: + v = byteOfVal (val, offset+1); + v = (v << 8) | byteOfVal (val, offset); + dbuf_tprintf (&dbuf, "!immedword", (unsigned int) v & 0xffff); + break; + case 3: + v = byteOfVal (val, offset+2); + v = (v << 8) | byteOfVal (val, offset+1); + v = (v << 8) | byteOfVal (val, offset); + // we don't have a !immedword24 yet for ds390 + dbuf_printf (&dbuf, "#0x%06X", (unsigned int) v & 0xffffff); + break; + default: + /* Hmm. Too big for now. */ + assert (0); } - - /* PENDING: For now size must be 1 */ - assert (size == 1); - - /* it is type float */ - fl.f = (float) floatFromVal (val); -#ifdef WORDS_BIGENDIAN - dbuf_tprintf (&dbuf, "!immedbyte", fl.c[3 - offset]); -#else - dbuf_tprintf (&dbuf, "!immedbyte", fl.c[offset]); -#endif return dbuf_detach_c_str (&dbuf); } @@ -548,7 +530,7 @@ /* printChar - formats and prints a characater string with DB */ /*-----------------------------------------------------------------*/ void -printChar (struct dbuf_s *oBuf, char *s, int plen) +printChar (struct dbuf_s *oBuf, const char *s, int plen) { int i; int len = plen; @@ -704,7 +686,7 @@ } /* check if the literal value is within bounds */ - if (checkConstantRange (type, val->etype, '=', FALSE) == CCR_OVL && !options.lessPedantic) + if (checkConstantRange (type, val->etype, '=', FALSE) == CCR_OVL) { werror (W_LIT_OVERFLOW); } @@ -830,7 +812,7 @@ size = (bit_length + 7) / 8; /* check if the literal value is within bounds */ - if (val && checkConstantRange (lsym->etype, val->etype, '=', FALSE) == CCR_OVL && !options.lessPedantic) + if (val && checkConstantRange (lsym->etype, val->etype, '=', FALSE) == CCR_OVL) { werror (W_LIT_OVERFLOW); } @@ -935,7 +917,7 @@ /* printIvalChar - generates initital value for character array */ /*-----------------------------------------------------------------*/ int -printIvalChar (symbol * sym, sym_link * type, initList * ilist, struct dbuf_s *oBuf, char *s, bool check) +printIvalChar (symbol * sym, sym_link * type, initList * ilist, struct dbuf_s *oBuf, const char *s, bool check) { value *val; unsigned int size = DCL_ELEM (type); @@ -1541,13 +1523,16 @@ void emitMaps (void) { + namedspacemap *nm; int publicsfr = TARGET_IS_MCS51; /* Ideally, this should be true for all */ - /* ports but let's be conservative - EEP */ + /* ports but let's be conservative - EEP */ inInitMode++; /* no special considerations for the following data, idata & bit & xdata */ emitRegularMap (data, TRUE, TRUE); + for (nm = namedspacemaps; nm; nm = nm->next) + emitRegularMap (nm->map, TRUE, TRUE); emitRegularMap (idata, TRUE, TRUE); emitRegularMap (d_abs, TRUE, TRUE); emitRegularMap (i_abs, TRUE, TRUE); @@ -1691,9 +1676,6 @@ { set *ovrset; - if (!elementsInSet (ovrSetSets)) - dbuf_tprintf (aBuf, "\t!area\n", port->mem.overlay_name); - /* for each of the sets in the overlay segment do */ for (ovrset = setFirstItem (ovrSetSets); ovrset; ovrset = setNextItem (ovrSetSets)) { @@ -1701,7 +1683,7 @@ if (elementsInSet (ovrset)) { - /* output the area informtion */ + /* output the area information */ dbuf_printf (aBuf, "\t.area\t%s\n", port->mem.overlay_name); /* MOF */ } @@ -1774,6 +1756,7 @@ struct dbuf_s asmFileName; FILE *asmFile; int mcs51_like; + namedspacemap *nm; dbuf_init (&vBuf, 4096); dbuf_init (&ovrBuf, 4096); @@ -1824,8 +1807,12 @@ /* initial comments */ initialComments (asmFile); - if (TARGET_IS_Z180) + if (TARGET_IS_S08) + fprintf (asmFile, "\t.cs08\n"); + else if (TARGET_IS_Z180) fprintf (asmFile, "\t.hd64\n"); + else if (TARGET_IS_R3KA) + fprintf (asmFile, "\t.r3k\n"); /* print module name */ tfprintf (asmFile, "\t!module\n", moduleName); @@ -1871,7 +1858,7 @@ fprintf (asmFile, " --parms-in-bank1"); fprintf (asmFile, "\n"); } - else if ((TARGET_Z80_LIKE || TARGET_IS_HC08) && !options.noOptsdccInAsm) + else if ((TARGET_Z80_LIKE || TARGET_HC08_LIKE) && !options.noOptsdccInAsm) { fprintf (asmFile, "\t.optsdcc -m%s\n", port->target); } @@ -1941,16 +1928,24 @@ /* copy the data segment */ fprintf (asmFile, "%s", iComments2); - fprintf (asmFile, "; %s ram data\n", mcs51_like ? "internal" : ""); + fprintf (asmFile, ";%s ram data\n", mcs51_like ? " internal" : ""); fprintf (asmFile, "%s", iComments2); dbuf_write_and_destroy (&data->oBuf, asmFile); + /* copy segments for named address spaces */ + for (nm = namedspacemaps; nm; nm = nm->next) + { + fprintf (asmFile, "%s", iComments2); + fprintf (asmFile, "; %s ram data\n", nm->name); + fprintf (asmFile, "%s", iComments2); + dbuf_write_and_destroy (&nm->map->oBuf, asmFile); + } /* create the overlay segments */ if (overlay) { fprintf (asmFile, "%s", iComments2); - fprintf (asmFile, "; overlayable items in %s ram \n", mcs51_like ? "internal" : ""); + fprintf (asmFile, "; overlayable items in%s ram \n", mcs51_like ? " internal" : ""); fprintf (asmFile, "%s", iComments2); dbuf_write_and_destroy (&ovrBuf, asmFile); } @@ -1965,7 +1960,7 @@ } /* create the idata segment */ - if ((idata) && (mcs51_like)) + if (idata) { fprintf (asmFile, "%s", iComments2); fprintf (asmFile, "; indirectly addressable internal ram data\n"); @@ -1974,17 +1969,19 @@ } /* create the absolute idata/data segment */ - if ((i_abs) && (mcs51_like)) + if (d_abs || i_abs) { fprintf (asmFile, "%s", iComments2); - fprintf (asmFile, "; absolute internal ram data\n"); + fprintf (asmFile, "; absolute%s ram data\n", mcs51_like ? " internal" : ""); fprintf (asmFile, "%s", iComments2); - dbuf_write_and_destroy (&d_abs->oBuf, asmFile); - dbuf_write_and_destroy (&i_abs->oBuf, asmFile); + if (d_abs) + dbuf_write_and_destroy (&d_abs->oBuf, asmFile); + if (i_abs) + dbuf_write_and_destroy (&i_abs->oBuf, asmFile); } /* copy the bit segment */ - if (mcs51_like) + if (bit) { fprintf (asmFile, "%s", iComments2); fprintf (asmFile, "; bit data\n"); @@ -1993,7 +1990,7 @@ } /* copy paged external ram data */ - if (mcs51_like) + if (pdata) { fprintf (asmFile, "%s", iComments2); fprintf (asmFile, "; paged external ram data\n"); @@ -2011,7 +2008,7 @@ } /* copy external ram data */ - if (mcs51_like) + if (xdata && mcs51_like) { fprintf (asmFile, "%s", iComments2); fprintf (asmFile, "; external ram data\n"); @@ -2020,7 +2017,7 @@ } /* create the absolute xdata segment */ - if (mcs51_like || TARGET_IS_HC08) + if (x_abs) { fprintf (asmFile, "%s", iComments2); fprintf (asmFile, "; absolute external ram data\n"); @@ -2029,10 +2026,13 @@ } /* copy external initialized ram data */ - fprintf (asmFile, "%s", iComments2); - fprintf (asmFile, "; external initialized ram data\n"); - fprintf (asmFile, "%s", iComments2); - dbuf_write_and_destroy (&xidata->oBuf, asmFile); + if (xidata) + { + fprintf (asmFile, "%s", iComments2); + fprintf (asmFile, "; external initialized ram data\n"); + fprintf (asmFile, "%s", iComments2); + dbuf_write_and_destroy (&xidata->oBuf, asmFile); + } /* If the port wants to generate any extra areas, let it do so. */ if (port->extraAreas.genExtraAreaDeclaration) diff -Nru sdcc-3.1.0+dfsg/src/SDCChasht.h sdcc-3.2.0+dfsg/src/SDCChasht.h --- sdcc-3.1.0+dfsg/src/SDCChasht.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCChasht.h 2011-11-28 14:42:14.000000000 +0000 @@ -100,7 +100,10 @@ hTab *hTabFromTable (hTab *); int isHtabsEqual (hTab *, hTab *, int (*compareFunc) (void *, void *)); hashtItem *hTabSearch (hTab *, int); + +/* return the first item with the given key */ void *hTabItemWithKey (hTab *, int); + void hTabAddItemIfNotP (hTab **, int, void *); void hTabDeleteAll (hTab *); void *hTabFirstItemWK (hTab * htab, int wk); diff -Nru sdcc-3.1.0+dfsg/src/SDCCicode.c sdcc-3.2.0+dfsg/src/SDCCicode.c --- sdcc-3.1.0+dfsg/src/SDCCicode.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCicode.c 2012-06-12 07:56:02.000000000 +0000 @@ -285,6 +285,11 @@ dbuf_append_str (dbuf, " = "); dbuf_append_str (dbuf, "@["); dbuf_printOperand (IC_LEFT (ic), dbuf); + if (IC_RIGHT (ic)) + { + dbuf_append_str (dbuf, " + "); + dbuf_printOperand (IC_RIGHT (ic), dbuf); + } dbuf_append_str (dbuf, "]\n"); } @@ -783,6 +788,12 @@ SPEC_SCLS (itmp->etype) = S_REGISTER; SPEC_OCLS (itmp->etype) = reg; } + + /* iTemps always live in the default address space */ + if (IS_DECL (itmp->type)) + DCL_PTR_ADDRSPACE (itmp->type) = 0; + else + SPEC_ADDRSPACE (itmp->etype) = 0; op->svt.symOperand = itmp; op->key = itmp->key = ++operandKey; @@ -793,8 +804,10 @@ /* operandType - returns the type chain for an operand */ /*-----------------------------------------------------------------*/ sym_link * -operandType (const operand * op) +operandType (const operand *op) { + wassert (op); + /* depending on type of operand */ switch (op->type) { @@ -887,7 +900,7 @@ /* isOperandLiteral - returns 1 if an operand contains a literal */ /*-----------------------------------------------------------------*/ int -isOperandLiteral (operand * op) +isOperandLiteral (const operand *const op) { sym_link *opetype; @@ -1128,13 +1141,6 @@ return ic; } -/* This seems to be a GCC 4.6.[01] bug on i386 Linux and mingw platforms - * see http://sourceforge.net/tracker/?func=detail&aid=3285611&group_id=599&atid=300599 - */ -#if (defined(__linux__) || defined(__MINGW32__)) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ == 6 && (__GNUC_PATCHLEVEL__ == 0 || __GNUC_PATCHLEVEL__ == 1) -#pragma GCC push_options -#pragma GCC optimize ("O0") -#endif /*-----------------------------------------------------------------*/ /* operandOperation - performs operations on operands */ /*-----------------------------------------------------------------*/ @@ -1390,18 +1396,12 @@ return retval; } -/* This seems to be a GCC 4.6.[01] bug on i386 Linux and mingw platforms - * see http://sourceforge.net/tracker/?func=detail&aid=3285611&group_id=599&atid=300599 - */ -#if (defined(__linux__) || defined(__MINGW32__)) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ == 6 && (__GNUC_PATCHLEVEL__ == 0 || __GNUC_PATCHLEVEL__ == 1) -#pragma GCC pop_options -#endif /*-----------------------------------------------------------------*/ /* isOperandEqual - compares two operand & return 1 if they are = */ /*-----------------------------------------------------------------*/ int -isOperandEqual (operand * left, operand * right) +isOperandEqual (const operand * left, const operand * right) { /* if the pointers are equal then they are equal */ if (left == right) @@ -1583,7 +1583,7 @@ /* under the following conditions create a register equivalent for a local symbol */ if (sym->level && sym->etype && SPEC_OCLS (sym->etype) && - (IN_FARSPACE (SPEC_OCLS (sym->etype)) && !TARGET_IS_HC08 && (!(options.model == MODEL_FLAT24))) && options.stackAuto == 0) + (IN_FARSPACE (SPEC_OCLS (sym->etype)) && !TARGET_HC08_LIKE && (!(options.model == MODEL_FLAT24))) && options.stackAuto == 0) { ok = 0; } @@ -1880,7 +1880,7 @@ return op; /* if this is not a temp symbol then */ - if (!IS_ITEMP (op) && !force && !(IN_FARSPACE (SPEC_OCLS (etype)) && !TARGET_IS_HC08)) + if (!IS_ITEMP (op) && !force && !(IN_FARSPACE (SPEC_OCLS (etype)) && !TARGET_HC08_LIKE)) { op = operandFromOperand (op); op->isaddr = 0; @@ -1888,14 +1888,14 @@ } if (IS_SPEC (type) && - IS_TRUE_SYMOP (op) && (!(IN_FARSPACE (SPEC_OCLS (etype)) && !TARGET_IS_HC08) || (options.model == MODEL_FLAT24))) + IS_TRUE_SYMOP (op) && (!(IN_FARSPACE (SPEC_OCLS (etype)) && !TARGET_HC08_LIKE) || (options.model == MODEL_FLAT24))) { op = operandFromOperand (op); op->isaddr = 0; return op; } - ic = newiCode (GET_VALUE_AT_ADDRESS, op, NULL); + ic = newiCode (GET_VALUE_AT_ADDRESS, op, operandFromLit (0)); if (IS_PTR (type) && op->isaddr && force) type = type->next; @@ -1970,15 +1970,7 @@ ic = newiCode (CAST, operandFromLink (type), geniCodeRValue (op, FALSE)); IC_RESULT (ic) = newiTempOperand (type, 0); - /* preserve the storage class & output class */ - /* of the original variable */ restype = getSpec (operandType (IC_RESULT (ic))); - if (!IS_LITERAL (opetype) && !IS_BIT (opetype)) - { - SPEC_SCLS (restype) = SPEC_SCLS (opetype); - SPEC_OCLS (restype) = SPEC_OCLS (opetype); - } - /* Convert cast to _Bool bitfield members to casts to _Bool. */ if (SPEC_NOUN (restype) == V_BBITFIELD) SPEC_NOUN (restype) = V_BOOL; @@ -2075,11 +2067,18 @@ return IC_RESULT (ic); } +static operand * +geniCodeAdd (operand *left, operand *right, RESULT_TYPE resultType, int lvl); +static operand * +geniCodeLogic (operand *left, operand *right, int op, ast *tree); +operand * +geniCodeRightShift (operand *left, operand *right); + /*-----------------------------------------------------------------*/ /* geniCodeDivision - gen intermediate code for division */ /*-----------------------------------------------------------------*/ static operand * -geniCodeDivision (operand * left, operand * right, RESULT_TYPE resultType) +geniCodeDivision (operand *left, operand *right, RESULT_TYPE resultType) { iCode *ic; int p2 = 0; @@ -2092,9 +2091,33 @@ resType = usualBinaryConversions (&left, &right, resultType, '/'); /* if the right is a literal & power of 2 + and left is signed then make it a conditional addition + followed by right shift */ +#if 1 + if (IS_LITERAL (retype) && + !IS_FLOAT (letype) && + !IS_FIXED (letype) && !IS_UNSIGNED (letype) && ((p2 = powof2 ((TYPE_TARGET_ULONG) ulFromVal (OP_VALUE (right)))) > 0) && + (TARGET_Z80_LIKE || TARGET_HC08_LIKE)) + { + operand *tmp; + symbol *label = newiTempLabel (NULL); + + tmp = newiTempOperand (ltype, 0); + geniCodeAssign (tmp, left, 0, 0); + + ic = newiCodeCondition (geniCodeLogic (tmp, operandFromLit (0), '<', 0), 0, label); + ADDTOCHAIN (ic); + + geniCodeAssign (tmp, geniCodeAdd (tmp, operandFromLit ((1 << p2) - 1), 0, 0), 0, 0); + geniCodeLabel (label); + return (geniCodeCast (resType, geniCodeRightShift (tmp, operandFromLit (p2)), TRUE)); + } + /* if the right is a literal & power of 2 and left is unsigned then make it a right shift */ - if (IS_LITERAL (retype) && + else +#endif + if (IS_LITERAL (retype) && !IS_FLOAT (letype) && !IS_FIXED (letype) && IS_UNSIGNED (letype) && ((p2 = powof2 ((TYPE_TARGET_ULONG) ulFromVal (OP_VALUE (right)))) > 0)) { @@ -2227,6 +2250,7 @@ { iCode *ic; sym_link *resType; + unsigned int nBytes; operand *size; int isarray = 0; bool indexUnsigned; @@ -2245,10 +2269,13 @@ if (IS_PTR (ltype) || IS_ARRAY (ltype)) { isarray = left->isaddr; + nBytes = getSize (ltype->next); + if (nBytes == 0) + werror (E_UNKNOWN_SIZE, IS_SYMOP (left) ? OP_SYMBOL (left)->name : ""); // there is no need to multiply with 1 - if (getSize (ltype->next) != 1) + if (nBytes != 1) { - size = operandFromLit (getSize (ltype->next)); + size = operandFromLit (nBytes); SPEC_USIGN (getSpec (operandType (size))) = 1; indexUnsigned = IS_UNSIGNED (getSpec (operandType (right))); right = geniCodeMultiply (right, size, resultType); @@ -2274,8 +2301,7 @@ IC_RESULT (ic) = newiTempOperand (resType, 1); IC_RESULT (ic)->isaddr = (isarray ? 1 : 0); - /* if left or right is a float then support - routine */ + /* if left or right is a float then support routine */ if (IS_FLOAT (ltype) || IS_FLOAT (rtype) || IS_FIXED (ltype) || IS_FIXED (rtype)) ic->supportRtn = 1; @@ -2390,8 +2416,9 @@ ic = newiCode ('+', left, right); - IC_RESULT (ic) = newiTempOperand (((IS_PTR (ltype) && - !IS_AGGREGATE (ltype->next) && !IS_PTR (ltype->next)) ? ltype : ltype->next), 0); + IC_RESULT (ic) = newiTempOperand ((IS_PTR (ltype) && + !IS_AGGREGATE (ltype->next) && + !IS_PTR (ltype->next)) ? ltype : ltype->next, 0); if (!IS_AGGREGATE (ltype->next)) { @@ -2784,6 +2811,16 @@ if (!isLvaluereq (lvl)) op = geniCodeRValue (op, TRUE); + if (IS_DECL (rtype)) + { + DCL_PTR_ADDRSPACE (rtype) = 0; + DCL_PTR_VOLATILE (rtype) = 0; + } + else + { + SPEC_ADDRSPACE (rtype) = 0; + SPEC_VOLATILE (rtype) = 0; + } setOperandType (op, rtype); return op; @@ -2858,8 +2895,7 @@ { case CCR_ALWAYS_TRUE: case CCR_ALWAYS_FALSE: - if (!options.lessPedantic) - werror (W_COMP_RANGE, "true resp. false"); + werror (W_COMP_RANGE, "true resp. false"); return operandFromLit (ccr_result == CCR_ALWAYS_TRUE ? 1 : 0); default: break; @@ -2997,11 +3033,11 @@ /* geniCodeUnary - for a generic unary operation */ /*-----------------------------------------------------------------*/ operand * -geniCodeUnary (operand * op, int oper) +geniCodeUnary (operand * op, int oper, sym_link * resType) { iCode *ic = newiCode (oper, op, NULL); - IC_RESULT (ic) = newiTempOperand (operandType (op), 0); + IC_RESULT (ic) = newiTempOperand (resType, 0); ADDTOCHAIN (ic); return IC_RESULT (ic); } @@ -3010,11 +3046,11 @@ /* geniCodeBinary - for a generic binary operation */ /*-----------------------------------------------------------------*/ operand * -geniCodeBinary (operand * left, operand * right, int oper) +geniCodeBinary (operand * left, operand * right, int oper, sym_link * resType) { iCode *ic = newiCode (oper, left, right); - IC_RESULT (ic) = newiTempOperand (operandType (left), 0); + IC_RESULT (ic) = newiTempOperand (resType, 0); ADDTOCHAIN (ic); return IC_RESULT (ic); } @@ -3065,14 +3101,7 @@ { sym_link *ltype = operandType (left); sym_link *rtype = operandType (right); - - /* left is integral type and right is literal then - check if the literal value is within bounds */ - if (IS_INTEGRAL (ltype) && right->type == VALUE && IS_LITERAL (rtype) && - checkConstantRange (ltype, rtype, '=', FALSE) == CCR_OVL && !options.lessPedantic) - { - werror (W_LIT_OVERFLOW); - } + bool always_cast = FALSE; /* if the left & right type don't exactly match */ /* if pointer set then make sure the check is @@ -3084,22 +3113,25 @@ { if (left->aggr2ptr) { - right = geniCodeCast (ltype, right, TRUE); - checkPtrQualifiers (ltype, rtype); + always_cast = TRUE; } else { - if (compareType (ltype->next, rtype) < 0) - right = geniCodeCast (ltype->next, right, TRUE); - checkPtrQualifiers (ltype->next, rtype); + ltype = ltype->next; } } - else + + /* left is integral type and right is literal then + check if the literal value is within bounds */ + if (IS_INTEGRAL (ltype) && right->type == VALUE && IS_LITERAL (rtype) && + checkConstantRange (ltype, rtype, '=', FALSE) == CCR_OVL) { - if (compareType (ltype, rtype) < 0) - right = geniCodeCast (ltype, right, TRUE); - checkPtrQualifiers (ltype, rtype); + werror (W_LIT_OVERFLOW); } + + if (always_cast || compareType (ltype, rtype) == -1) + right = geniCodeCast (ltype, right, TRUE); + checkPtrQualifiers (ltype, rtype); return right; } @@ -3110,6 +3142,7 @@ geniCodeAssign (operand * left, operand * right, int nosupdate, int strictLval) { iCode *ic; + sym_link *ltype; if (!left->isaddr && (!IS_ITEMP (left) || strictLval)) { @@ -3154,7 +3187,11 @@ ic->nosupdate = nosupdate; /* left could be a pointer assignment, return the properly casted right instead */ - return right; + ltype = operandType (left); + if ((IS_PTR (ltype) && IS_BITVAR (ltype->next)) || IS_BITVAR (ltype)) + return left; + else + return right; } /*-----------------------------------------------------------------*/ @@ -3394,7 +3431,7 @@ if (!sym->addrtaken && !IS_VOLATILE (sym->etype)) { - if ((IN_FARSPACE (SPEC_OCLS (sym->etype)) && !TARGET_IS_HC08) && + if ((IN_FARSPACE (SPEC_OCLS (sym->etype)) && !TARGET_HC08_LIKE) && options.stackAuto == 0 && (!(options.model == MODEL_FLAT24))) { } @@ -3496,6 +3533,10 @@ { iCode *ic; + /* return in _Noreturn function */ + if (currFunc && IFFUNC_ISNORETURN (currFunc->type)) + werror (W_NORETURNRETURN); + /* if the operand is present force an rvalue */ if (op) op = geniCodeRValue (op, FALSE); @@ -3554,7 +3595,10 @@ } exit: - ast2iCode (tree->right, lvl + 1); + if (tree->right && tree->right->type == EX_VALUE) + geniCodeDummyRead (ast2iCode (tree->right, lvl + 1)); + else + ast2iCode (tree->right, lvl + 1); } /*-----------------------------------------------------------------*/ @@ -3817,7 +3861,6 @@ caseVals = caseVals->next; } - defaultOrBreak: /* if default is present then goto break else break */ dbuf_init (&dbuf, 128); @@ -3887,7 +3930,7 @@ operand *op = NULL; sym_link *type; - if (!options.stackAuto && !TARGET_IS_HC08) + if (!options.stackAuto && !TARGET_HC08_LIKE) { type = newLink (SPECIFIER); SPEC_VOLATILE (type) = 1; @@ -4186,30 +4229,26 @@ case RRC: case RLC: case SWAP: - return geniCodeUnary (geniCodeRValue (left, FALSE), tree->opval.op); + return geniCodeUnary (geniCodeRValue (left, FALSE), tree->opval.op, tree->ftype); case '!': case GETHBIT: { - operand *op = geniCodeUnary (geniCodeRValue (left, FALSE), tree->opval.op); - if (!IS_BOOLEAN (operandType (op))) - setOperandType (op, UCHARTYPE); + operand *op = geniCodeUnary (geniCodeRValue (left, FALSE), tree->opval.op, tree->ftype); return op; } case GETABIT: { operand *op = geniCodeBinary (geniCodeRValue (left, FALSE), geniCodeRValue (right, FALSE), - tree->opval.op); - if (!IS_BOOLEAN (operandType (op))) - setOperandType (op, UCHARTYPE); + tree->opval.op, tree->ftype); return op; } case GETBYTE: { operand *op = geniCodeBinary (geniCodeRValue (left, FALSE), geniCodeRValue (right, FALSE), - tree->opval.op); + tree->opval.op, tree->ftype); setOperandType (op, UCHARTYPE); return op; } @@ -4217,7 +4256,7 @@ { operand *op = geniCodeBinary (geniCodeRValue (left, FALSE), geniCodeRValue (right, FALSE), - tree->opval.op); + tree->opval.op, tree->ftype); setOperandType (op, UINTTYPE); return op; } @@ -4346,7 +4385,13 @@ case LABEL: geniCodeLabel (OP_SYMBOL (ast2iCode (tree->left, lvl + 1))); - return ast2iCode (tree->right, lvl + 1); + if (tree->right && tree->right->type == EX_VALUE) + { + geniCodeDummyRead (ast2iCode (tree->right, lvl + 1)); + return NULL; + } + else + return ast2iCode (tree->right, lvl + 1); case GOTO: geniCodeGoto (OP_SYMBOL (ast2iCode (tree->left, lvl + 1))); diff -Nru sdcc-3.1.0+dfsg/src/SDCCicode.h sdcc-3.2.0+dfsg/src/SDCCicode.h --- sdcc-3.1.0+dfsg/src/SDCCicode.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCicode.h 2012-06-07 17:36:23.000000000 +0000 @@ -73,28 +73,28 @@ /* typedef for operand */ typedef struct operand { - OPTYPE type; /* type of operand */ - unsigned int isaddr:1; /* is an address */ - unsigned int aggr2ptr:2; /* 1: must change aggregate to pointer to aggregate */ + OPTYPE type; /* type of operand */ + unsigned int isaddr:1; /* is an address */ + unsigned int aggr2ptr:2; /* 1: must change aggregate to pointer to aggregate */ /* 2: aggregate has been changed to pointer to aggregate */ - unsigned int isvolatile:1; /* is a volatile operand */ - unsigned int isGlobal:1; /* is a global operand */ - unsigned int isPtr:1; /* is assigned a pointer */ - unsigned int isGptr:1; /* is a generic pointer */ - unsigned int isParm:1; /* is a parameter */ - unsigned int isLiteral:1; /* operand is literal */ + unsigned int isvolatile:1; /* is a volatile operand */ + unsigned int isGlobal:1; /* is a global operand */ + unsigned int isPtr:1; /* is assigned a pointer */ + unsigned int isGptr:1; /* is a generic pointer */ + unsigned int isParm:1; /* is a parameter */ + unsigned int isLiteral:1; /* operand is literal */ int key; union { - struct symbol *symOperand; /* operand is of type symbol */ - struct value *valOperand; /* operand is of type value */ - struct sym_link *typeOperand; /* operand is of type typechain */ + struct symbol *symOperand; /* operand is of type symbol */ + struct value *valOperand; /* operand is of type value */ + struct sym_link *typeOperand; /* operand is of type typechain */ } svt; - bitVect *usesDefs; /* which definitions are used by this */ - struct asmop *aop; /* asm op for this operand */ + bitVect *usesDefs; /* which definitions are used by this */ + struct asmop *aop; /* asm op for this operand */ } operand; @@ -117,16 +117,16 @@ #define OP_TYPE(op) validateOpType(op, "OP_TYPE", #op, TYPE, __FILE__, __LINE__)->svt.typeOperand /* definition for intermediate code */ -#define IC_RESULT(x) (x)->ulrrcnd.lrr.result -#define IC_LEFT(x) (x)->ulrrcnd.lrr.left -#define IC_RIGHT(x) (x)->ulrrcnd.lrr.right -#define IC_COND(x) (x)->ulrrcnd.cnd.condition -#define IC_TRUE(x) (x)->ulrrcnd.cnd.trueLabel -#define IC_FALSE(x) (x)->ulrrcnd.cnd.falseLabel -#define IC_LABEL(x) (x)->label -#define IC_JTCOND(x) (x)->ulrrcnd.jmpTab.condition -#define IC_JTLABELS(x) (x)->ulrrcnd.jmpTab.labels -#define IC_INLINE(x) (x)->inlineAsm +#define IC_RESULT(x) (x)->ulrrcnd.lrr.result +#define IC_LEFT(x) (x)->ulrrcnd.lrr.left +#define IC_RIGHT(x) (x)->ulrrcnd.lrr.right +#define IC_COND(x) (x)->ulrrcnd.cnd.condition +#define IC_TRUE(x) (x)->ulrrcnd.cnd.trueLabel +#define IC_FALSE(x) (x)->ulrrcnd.cnd.falseLabel +#define IC_LABEL(x) (x)->label +#define IC_JTCOND(x) (x)->ulrrcnd.jmpTab.condition +#define IC_JTLABELS(x) (x)->ulrrcnd.jmpTab.labels +#define IC_INLINE(x) (x)->inlineAsm #define IC_ARRAYILIST(x) (x)->arrayInitList typedef struct iCode @@ -185,7 +185,7 @@ symbol *label; /* for a goto statement */ - char *inlineAsm; /* pointer to inline assembler code */ + const char *inlineAsm; /* pointer to inline assembler code */ literalList *arrayInitList; /* point to array initializer list. */ int lineno; /* file & lineno for debug information */ @@ -260,7 +260,7 @@ x->op == '|' || \ x->op == '^')) -#define IS_ASSOCIATIVE(x) (x && (x->op == EQ_OP || \ +#define IS_COMMUTATIVE(x) (x && (x->op == EQ_OP || \ x->op == NE_OP || \ x->op == '+' || \ x->op == '*' || \ @@ -311,9 +311,9 @@ void initiCode (); iCode *iCodeFromAst (ast *); int isiCodeEqual (iCode *, iCode *); -int isOperandEqual (operand *, operand *); +int isOperandEqual (const operand *, const operand *); iCodeTable *getTableEntry (int); -int isOperandLiteral (operand *); +int isOperandLiteral (const operand * const); operand *operandOperation (operand *, operand *, int, sym_link *); double operandLitValue (operand *); operand *operandFromLit (double); diff -Nru sdcc-3.1.0+dfsg/src/SDCClabel.c sdcc-3.2.0+dfsg/src/SDCClabel.c --- sdcc-3.1.0+dfsg/src/SDCClabel.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCClabel.c 2012-06-07 17:36:23.000000000 +0000 @@ -43,27 +43,27 @@ for (lic = ic; lic; lic = lic->next) { if (lic->op == GOTO) - hTabAddItem (&labelRef, (IC_LABEL (lic))->key, lic); + hTabAddItem (&labelRef, (IC_LABEL (lic))->key, lic); if (lic->op == JUMPTABLE) - { - symbol *lbl; - for (lbl = setFirstItem (IC_JTLABELS (lic)); lbl; - lbl = setNextItem (IC_JTLABELS (lic))) - { - hTabAddItem (&labelRef, lbl->key, lic); - } - } + { + symbol *lbl; + for (lbl = setFirstItem (IC_JTLABELS (lic)); lbl; + lbl = setNextItem (IC_JTLABELS (lic))) + { + hTabAddItem (&labelRef, lbl->key, lic); + } + } if (lic->op == IFX) - { - if (IC_TRUE (lic)) - hTabAddItem (&labelRef, (IC_TRUE (lic))->key, lic); - else - hTabAddItem (&labelRef, (IC_FALSE (lic))->key, lic); - } + { + if (IC_TRUE (lic)) + hTabAddItem (&labelRef, (IC_TRUE (lic))->key, lic); + else + hTabAddItem (&labelRef, (IC_FALSE (lic))->key, lic); + } if (lic->op == LABEL) - hTabAddItem (&labelDef, (IC_LABEL (lic))->key, lic); + hTabAddItem (&labelDef, (IC_LABEL (lic))->key, lic); } } @@ -80,16 +80,16 @@ for (loop = ic; loop; loop = loop->next) { - if (loop->op == GOTO && /* if this is a goto */ - loop->next && /* and we have a next one */ - loop->next->op == LABEL && /* next one is a label */ - loop->next->label->key == loop->label->key) /* same label */ - { - loop->prev->next = loop->next; /* get this out of the chain */ - loop->next->prev = loop->prev; - hTabDeleteItem (&labelRef, (IC_LABEL (loop))->key, loop, DELETE_ITEM, NULL); - change++; - } + if (loop->op == GOTO && /* if this is a goto */ + loop->next && /* and we have a next one */ + loop->next->op == LABEL && /* next one is a label */ + loop->next->label->key == loop->label->key) /* same label */ + { + loop->prev->next = loop->next; /* get this out of the chain */ + loop->next->prev = loop->prev; + hTabDeleteItem (&labelRef, (IC_LABEL (loop))->key, loop, DELETE_ITEM, NULL); + change++; + } } return change; @@ -101,12 +101,9 @@ static void deleteIfx (iCode * loop, int key) { - if (!options.lessPedantic) - { - werrorfl (loop->filename, loop->lineno, W_CONTROL_FLOW); - } + werrorfl (loop->filename, loop->lineno, W_CONTROL_FLOW); hTabDeleteItem (&labelRef, key, loop, DELETE_ITEM, NULL); - + /* If the condition was volatile, convert IFX to */ /* DUMMY_READ_VOLATILE. Otherwise just delete the */ /* IFX iCode */ @@ -132,6 +129,7 @@ labelIfx (iCode * ic) { iCode *loop; + iCode *stat; int change = 0; for (loop = ic; loop; loop = loop->next) @@ -142,7 +140,7 @@ regardless of the condition in this case the condition can be eliminated with a WARNING ofcource */ if (loop->op == IFX && - loop->next && + loop->next && loop->next->op == GOTO) { if (IC_TRUE (loop) && IC_TRUE (loop)->key == IC_LABEL (loop->next)->key) @@ -165,10 +163,10 @@ /* if condition goto label */ /* label: */ if (loop->op == IFX && - loop->next && - loop->next->op == LABEL && - ((IC_TRUE (loop) && IC_TRUE (loop)->key == IC_LABEL (loop->next)->key) || - (IC_FALSE (loop) && IC_FALSE (loop)->key == IC_LABEL (loop->next)->key))) + loop->next && + loop->next->op == LABEL && + ((IC_TRUE (loop) && IC_TRUE (loop)->key == IC_LABEL (loop->next)->key) || + (IC_FALSE (loop) && IC_FALSE (loop)->key == IC_LABEL (loop->next)->key))) { deleteIfx (loop, IC_LABEL (loop->next)->key); change++; @@ -194,7 +192,7 @@ /* _falseLabel : */ /* ... */ if (loop->op == IFX && loop->next && loop->next->op == GOTO && - loop->next->next && loop->next->next->op == LABEL) + loop->next->next && loop->next->next->op == LABEL) { if (IC_TRUE (loop) && (IC_TRUE (loop))->key != (IC_LABEL (loop->next->next))->key || (IC_FALSE (loop) && (IC_FALSE (loop))->key != (IC_LABEL (loop->next->next))->key)) @@ -204,26 +202,25 @@ /* referenece to the _trueLabel */ if (IC_TRUE (loop) && hTabItemWithKey (labelRef, (IC_TRUE (loop))->key)) { - - /* we just change the falseLabel */ - /* to the next goto statement */ - /* unreferenced label will take */ - /* care of removing the label */ - /* delete reference to the true label */ - - hTabDeleteItem (&labelRef, (IC_TRUE (loop))->key, loop, DELETE_ITEM, NULL); - IC_TRUE (loop) = NULL; - IC_FALSE (loop) = IC_LABEL (loop->next); - /* add reference to the LABEL */ - hTabAddItem (&labelRef, (IC_FALSE (loop))->key, loop); - /* next remove the goto */ - hTabDeleteItem (&labelRef, - (IC_LABEL (loop->next))->key, loop->next, DELETE_ITEM, NULL); - loop->next = loop->next->next; - loop->next->prev = loop; - change++; - continue; - } + /* we just change the falseLabel */ + /* to the next goto statement */ + /* unreferenced label will take */ + /* care of removing the label */ + /* delete reference to the true label */ + + hTabDeleteItem (&labelRef, (IC_TRUE (loop))->key, loop, DELETE_ITEM, NULL); + IC_TRUE (loop) = NULL; + IC_FALSE (loop) = IC_LABEL (loop->next); + /* add reference to the LABEL */ + hTabAddItem (&labelRef, (IC_FALSE (loop))->key, loop); + /* next remove the goto */ + hTabDeleteItem (&labelRef, + (IC_LABEL (loop->next))->key, loop->next, DELETE_ITEM, NULL); + loop->next = loop->next->next; + loop->next->prev = loop; + change++; + continue; + } /* now do the same with the false labels */ if (IC_FALSE (loop) && hTabItemWithKey (labelRef, (IC_FALSE (loop))->key)) @@ -239,6 +236,66 @@ continue; } } + + /* Optimize hidden jump-to-jump: + Simplify + v = 1; stat->prev + goto l1; stat + l0: + v = 0; loop->prev + l1: loop + if (v) goto l3; loop->next + Into + v = 1; + goto l3; + l0: + v = 0; + l1: */ + if (loop->op == LABEL && + loop->next && loop->next->op == IFX && + (stat = hTabFirstItemWK (labelRef, (IC_LABEL (loop))->key)) && + !hTabNextItemWK (labelRef) && + stat && stat->op == GOTO && + stat->prev && stat->prev->op == '=' && IS_OP_LITERAL (IC_RIGHT (stat->prev)) && + loop->prev && loop->prev->op == '=' && IS_OP_LITERAL (IC_RIGHT (loop->prev)) && + IC_RESULT (stat->prev)->key == IC_COND (loop->next)->key && + IC_RESULT (loop->prev)->key == IC_COND (loop->next)->key && + !IS_OP_VOLATILE (IC_COND (loop->next)) && + (!operandLitValue (IC_RIGHT (stat->prev)) ^ !operandLitValue (IC_RIGHT (loop->prev)))) + { + if (IC_FALSE (loop->next) && !operandLitValue (IC_RIGHT (loop->prev)) || + IC_TRUE (loop->next) && operandLitValue (IC_RIGHT (loop->prev))) + /* Complicated case: Insert goto, remove conditional jump. */ + { + /* Change IFX to GOTO. */ + stat = loop->next; + IC_LABEL (stat) = IC_TRUE (stat) ? IC_TRUE (stat) : IC_FALSE (stat); + stat->op = GOTO; + + /* Move to desired location. */ + if (loop->next->next) + loop->next->next->prev = loop; + loop->next = loop->next->next; + stat->prev = loop->prev; + stat->prev->next = stat; + stat->next = loop; + loop->prev = stat; + change++; + continue; + } + else /* Simple case: Redirect goto, remove conditional jump. */ + { + hTabDeleteItem (&labelRef, (IC_LABEL (stat))->key, stat, DELETE_ITEM, NULL); + IC_LABEL (stat) = IC_TRUE (loop->next) ? IC_TRUE (loop->next) : IC_FALSE (loop->next); + hTabAddItem (&labelRef, (IC_LABEL (stat))->key, stat); + hTabDeleteItem (&labelRef, IC_LABEL (stat)->key, loop->next, DELETE_ITEM, NULL); + if (loop->next->next) + loop->next->next->prev = loop; + loop->next = loop->next->next; + change++; + continue; + } + } } return change; @@ -259,60 +316,60 @@ symbol *sLabel = NULL; stat = NULL; switch (loop->op) - { - case GOTO: /* for a goto statement */ - stat = hTabItemWithKey (labelDef, (sLabel = IC_LABEL (loop))->key); - break; - case IFX: /* for a conditional jump */ - if (IC_TRUE (loop)) - stat = hTabItemWithKey (labelDef, (sLabel = IC_TRUE (loop))->key); - else - stat = hTabItemWithKey (labelDef, (sLabel = IC_FALSE (loop))->key); - } + { + case GOTO: /* for a goto statement */ + stat = hTabItemWithKey (labelDef, (sLabel = IC_LABEL (loop))->key); + break; + case IFX: /* for a conditional jump */ + if (IC_TRUE (loop)) + stat = hTabItemWithKey (labelDef, (sLabel = IC_TRUE (loop))->key); + else + stat = hTabItemWithKey (labelDef, (sLabel = IC_FALSE (loop))->key); + } /* if we have a target statement then check if the next */ /* one is a goto: this means target of goto is a goto */ if (stat && stat->next && - (stat->next->op == GOTO || - stat->next->op == LABEL) && - stat->next != loop) - { - - symbol *repLabel = stat->next->label; /* replace with label */ - - /* if they are the same then continue */ - if (repLabel->key == sLabel->key) - continue; - - /* replacement depends on the statement type */ - switch (loop->op) - { - - case GOTO: /* for a goto statement */ - - hTabDeleteItem (&labelRef, (IC_LABEL (loop))->key, loop, DELETE_ITEM, NULL); - loop->label = repLabel; - hTabAddItem (&labelRef, repLabel->key, loop); - break; - - case IFX: /* for a conditional jump */ - if (IC_TRUE (loop)) - { - - hTabDeleteItem (&labelRef, (IC_TRUE (loop))->key, loop, DELETE_ITEM, NULL); - IC_TRUE (loop) = repLabel; - } - else - { - - hTabDeleteItem (&labelRef, (IC_FALSE (loop))->key, loop, DELETE_ITEM, NULL); - IC_FALSE (loop) = repLabel; - } - hTabAddItem (&labelRef, repLabel->key, loop); - - } - change++; - } + (stat->next->op == GOTO || + stat->next->op == LABEL) && + stat->next != loop) + { + + symbol *repLabel = stat->next->label; /* replace with label */ + + /* if they are the same then continue */ + if (repLabel->key == sLabel->key) + continue; + + /* replacement depends on the statement type */ + switch (loop->op) + { + + case GOTO: /* for a goto statement */ + + hTabDeleteItem (&labelRef, (IC_LABEL (loop))->key, loop, DELETE_ITEM, NULL); + loop->label = repLabel; + hTabAddItem (&labelRef, repLabel->key, loop); + break; + + case IFX: /* for a conditional jump */ + if (IC_TRUE (loop)) + { + + hTabDeleteItem (&labelRef, (IC_TRUE (loop))->key, loop, DELETE_ITEM, NULL); + IC_TRUE (loop) = repLabel; + } + else + { + + hTabDeleteItem (&labelRef, (IC_FALSE (loop))->key, loop, DELETE_ITEM, NULL); + IC_FALSE (loop) = repLabel; + } + hTabAddItem (&labelRef, repLabel->key, loop); + + } + change++; + } } return change; @@ -332,19 +389,19 @@ /* if this is a label */ if (loop->op == LABEL) - { - if (((IC_LABEL (loop))->key == returnLabel->key) || - ((IC_LABEL (loop))->key == entryLabel->key)) - continue; - - if (hTabItemWithKey (labelRef, (IC_LABEL (loop))->key)) - continue; - - /* else eliminitate this one */ - loop->prev->next = loop->next; /* get this out of the chain */ - loop->next->prev = loop->prev; - change++; - } + { + if (((IC_LABEL (loop))->key == returnLabel->key) || + ((IC_LABEL (loop))->key == entryLabel->key)) + continue; + + if (hTabItemWithKey (labelRef, (IC_LABEL (loop))->key)) + continue; + + /* else eliminitate this one */ + loop->prev->next = loop->next; /* get this out of the chain */ + loop->next->prev = loop->prev; + change++; + } } return change; @@ -368,45 +425,45 @@ /* found a goto || return && the next */ /* statement is not a label */ - if (loop->op == GOTO || loop->op == RETURN) - { - if (loop->next && - (loop->next->op == LABEL || - loop->next->op == ENDFUNCTION)) - continue; - - /* loop till we find a label */ - loop2 = loop->next; - while (loop2 && loop2->op != LABEL) - loop2 = loop2->next; - - /* throw away those in between */ - for (tic = loop->next; tic && tic != loop2; tic = tic->next) - { - /* remove label references if any */ - switch (tic->op) - { - case GOTO: - hTabDeleteItem (&labelRef, IC_LABEL (tic)->key, tic, DELETE_ITEM, NULL); - break; - case IFX: - werrorfl (tic->filename, tic->lineno, W_CODE_UNREACH); - if (IC_TRUE (tic)) - hTabDeleteItem (&labelRef, IC_TRUE (tic)->key, tic, DELETE_ITEM, NULL); - else - hTabDeleteItem (&labelRef, IC_FALSE (tic)->key, tic, DELETE_ITEM, NULL); - break; - default: - werrorfl (tic->filename, tic->lineno, W_CODE_UNREACH); - } - } - - /* now set up the pointers */ - loop->next = loop2; - if (loop2) - loop2->prev = loop; - change++; - } + if (loop->op == GOTO || loop->op == RETURN || + loop->op == CALL && IFFUNC_ISNORETURN (operandType (IC_LEFT (loop)))) + { + if (loop->next && + (loop->next->op == LABEL || loop->next->op == ENDFUNCTION)) + continue; + + /* loop till we find a label */ + loop2 = loop->next; + while (loop2 && loop2->op != LABEL) + loop2 = loop2->next; + + /* throw away those in between */ + for (tic = loop->next; tic && tic != loop2; tic = tic->next) + { + /* remove label references if any */ + switch (tic->op) + { + case GOTO: + hTabDeleteItem (&labelRef, IC_LABEL (tic)->key, tic, DELETE_ITEM, NULL); + break; + case IFX: + werrorfl (tic->filename, tic->lineno, W_CODE_UNREACH); + if (IC_TRUE (tic)) + hTabDeleteItem (&labelRef, IC_TRUE (tic)->key, tic, DELETE_ITEM, NULL); + else + hTabDeleteItem (&labelRef, IC_FALSE (tic)->key, tic, DELETE_ITEM, NULL); + break; + default: + werrorfl (tic->filename, tic->lineno, W_CODE_UNREACH); + } + } + + /* now set up the pointers */ + loop->next = loop2; + if (loop2) + loop2->prev = loop; + change++; + } } return change; } @@ -452,8 +509,8 @@ /* remove unreachable code */ change += labelUnreach (ic); - if (!change) /* fixed point reached */ - break; + if (!change) /* fixed point reached */ + break; } return ic; diff -Nru sdcc-3.1.0+dfsg/src/SDCClabel.h sdcc-3.2.0+dfsg/src/SDCClabel.h --- sdcc-3.1.0+dfsg/src/SDCClabel.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCClabel.h 2011-11-28 14:42:14.000000000 +0000 @@ -36,3 +36,4 @@ #endif + diff -Nru sdcc-3.1.0+dfsg/src/SDCClrange.c sdcc-3.2.0+dfsg/src/SDCClrange.c --- sdcc-3.1.0+dfsg/src/SDCClrange.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCClrange.c 2012-02-05 23:57:16.000000000 +0000 @@ -814,7 +814,7 @@ /*-----------------------------------------------------------------*/ /* adjustIChain - correct the sch and ech pointers */ /*-----------------------------------------------------------------*/ -static void +void adjustIChain (eBBlock ** ebbs, int count) { int i; diff -Nru sdcc-3.1.0+dfsg/src/SDCClrange.h sdcc-3.2.0+dfsg/src/SDCClrange.h --- sdcc-3.1.0+dfsg/src/SDCClrange.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCClrange.h 2012-02-05 23:57:16.000000000 +0000 @@ -38,4 +38,6 @@ void setToRange (operand *, int, bool); void hashiCodeKeys (eBBlock **, int); +void adjustIChain (eBBlock ** ebbs, int count); + #endif diff -Nru sdcc-3.1.0+dfsg/src/SDCCmain.c sdcc-3.2.0+dfsg/src/SDCCmain.c --- sdcc-3.1.0+dfsg/src/SDCCmain.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCmain.c 2012-06-02 13:19:46.000000000 +0000 @@ -32,13 +32,9 @@ #include #include "common.h" #include -#include "newalloc.h" #include "dbuf_string.h" #include "SDCCerr.h" -#include "SDCCsystem.h" #include "SDCCmacro.h" -#include "SDCCutil.h" -#include "SDCCdebug.h" #include "SDCCargs.h" #ifdef _WIN32 @@ -139,6 +135,7 @@ #define OPTION_OPT_CODE_SIZE "--opt-code-size" #define OPTION_STD_C89 "--std-c89" #define OPTION_STD_C99 "--std-c99" +#define OPTION_STD_C11 "--std-c11" #define OPTION_STD_SDCC89 "--std-sdcc89" #define OPTION_STD_SDCC99 "--std-sdcc99" #define OPTION_CODE_SEG "--codeseg" @@ -149,6 +146,8 @@ #define OPTION_PEEP_RETURN "--peep-return" #define OPTION_NO_PEEP_RETURN "--no-peep-return" #define OPTION_NO_OPTSDCC_IN_ASM "--no-optsdcc-in-asm" +#define OPTION_DUMP_GRAPHS "--dump-graphs" +#define OPTION_MAX_ALLOCS_PER_NODE "--max-allocs-per-node" static const OPTION optionsTable[] = { {0, NULL, NULL, "General options"}, @@ -178,10 +177,11 @@ {0, OPTION_WERROR, NULL, "Treat the warnings as errors"}, {0, OPTION_DEBUG, NULL, "Enable debugging symbol output"}, {0, "--cyclomatic", &options.cyclomatic, "Display complexity of compiled functions"}, - {0, OPTION_STD_C89, NULL, "Use C89 standard only"}, + {0, OPTION_STD_C89, NULL, "Use C89 standard (sligthly incomplete)"}, {0, OPTION_STD_SDCC89, NULL, "Use C89 standard with SDCC extensions (default)"}, - {0, OPTION_STD_C99, NULL, "Use C99 standard only (incomplete)"}, - {0, OPTION_STD_SDCC99, NULL, "Use C99 standard with SDCC extensions (incomplete)"}, + {0, OPTION_STD_C99, NULL, "Use C99 standard (incomplete)"}, + {0, OPTION_STD_SDCC99, NULL, "Use C99 standard with SDCC extensions"}, + {0, OPTION_STD_C11, NULL, "Use C11 standard (very incomplete)"}, {0, OPTION_DOLLARS_IN_IDENT, &options.dollars_in_ident, "Permit '$' as an identifier character"}, {0, OPTION_UNSIGNED_CHAR, &options.unsigned_char, "Make \"char\" unsigned by default"}, {0, OPTION_USE_NON_FREE, &options.use_non_free, "Search / include non-free licensed libraries and header files"}, @@ -228,6 +228,7 @@ {0, OPTION_PEEP_FILE, &options.peep_file, " use this extra peephole file", CLAT_STRING}, {0, OPTION_OPT_CODE_SPEED, NULL, "Optimize for code speed rather than size"}, {0, OPTION_OPT_CODE_SIZE, NULL, "Optimize for code size rather than speed"}, + {0, OPTION_MAX_ALLOCS_PER_NODE, &options.max_allocs_per_node, "Maximum number of register assignments considered at each node of the tree decomposition", CLAT_INTEGER}, {0, NULL, NULL, "Internal debugging options"}, {0, "--dumpraw", &options.dump_raw, "Dump the internal structure after the initial parse"}, @@ -240,6 +241,7 @@ {0, "--dumptree", &options.dump_tree, "dump front-end AST before generating iCode"}, {0, OPTION_DUMP_ALL, NULL, "Dump the internal structure at all stages"}, {0, OPTION_ICODE_IN_ASM, &options.iCodeInAsm, "include i-code as comments in the asm file"}, + {0, OPTION_DUMP_GRAPHS, &options.dump_graphs, "Dump graphs (control-flow, conflict, etc)"}, {0, NULL, NULL, "Linker options"}, {'l', NULL, NULL, "Include the given library in the link"}, @@ -316,6 +318,9 @@ #if !OPT_DISABLE_R2K &r2k_port, #endif +#if !OPT_DISABLE_R3KA + &r3ka_port, +#endif #if !OPT_DISABLE_AVR &avr_port, #endif @@ -340,6 +345,9 @@ #if !OPT_DISABLE_HC08 &hc08_port, #endif +#if !OPT_DISABLE_S08 + &s08_port, +#endif }; #define NUM_PORTS (sizeof(_ports)/sizeof(_ports[0])) @@ -585,11 +593,12 @@ options.shortis8bits = 0; options.std_sdcc = 1; /* enable SDCC language extensions */ options.std_c99 = 0; /* default to C89 until more C99 support */ + options.std_c11 = 0; /* default to C89 until more C11 support */ options.code_seg = CODE_NAME ? Safe_strdup (CODE_NAME) : NULL; /* default to CSEG for generated code */ options.const_seg = CONST_NAME ? Safe_strdup (CONST_NAME) : NULL; /* default to CONST for generated code */ options.stack10bit = 0; options.out_fmt = 0; - options.max_allocs_per_node = 3000; + options.dump_graphs = 0; /* now for the optimizations */ /* turn on the everything */ @@ -600,6 +609,7 @@ optimize.label4 = 1; optimize.loopInvariant = 1; optimize.loopInduction = 1; + options.max_allocs_per_node = 3000; /* now for the ports */ port->setDefaultOptions (); @@ -1114,6 +1124,14 @@ continue; } + if (strcmp (argv[i], OPTION_STD_C11) == 0) + { + options.std_c99 = 1; + options.std_c11 = 1; + options.std_sdcc = 0; + continue; + } + if (strcmp (argv[i], OPTION_STD_SDCC89) == 0) { options.std_c99 = 0; @@ -1617,7 +1635,7 @@ WRITE_SEG_LOC (BIT_NAME, 0); /* stack start */ - if ((options.stack_loc) && (options.stack_loc < 0x100) && !TARGET_IS_HC08) + if ((options.stack_loc) && (options.stack_loc < 0x100) && !TARGET_HC08_LIKE) { WRITE_SEG_LOC ("SSEG", options.stack_loc); } @@ -1945,57 +1963,83 @@ /* if using external stack define the macro */ if (options.useXstack) + addSet (&preArgvSet, Safe_strdup ("-D__SDCC_USE_XSTACK")); + if (options.std_sdcc && options.useXstack) addSet (&preArgvSet, Safe_strdup ("-DSDCC_USE_XSTACK")); /* set the macro for stack autos */ if (options.stackAuto) + addSet (&preArgvSet, Safe_strdup ("-D__SDCC_STACK_AUTO")); + if (options.std_sdcc && options.stackAuto) addSet (&preArgvSet, Safe_strdup ("-DSDCC_STACK_AUTO")); /* set the macro for stack autos */ if (options.stack10bit) + addSet (&preArgvSet, Safe_strdup ("-D__SDCC_STACK_TENBIT")); + if (options.std_sdcc && options.stack10bit) addSet (&preArgvSet, Safe_strdup ("-DSDCC_STACK_TENBIT")); /* set the macro for no overlay */ if (options.noOverlay) + addSet (&preArgvSet, Safe_strdup ("-D__SDCC_NOOVERLAY")); + if (options.std_sdcc && options.noOverlay) addSet (&preArgvSet, Safe_strdup ("-DSDCC_NOOVERLAY")); /* set the macro for unsigned char */ if (options.unsigned_char) + addSet (&preArgvSet, Safe_strdup ("-D__SDCC_CHAR_UNSIGNED")); + if (options.std_sdcc && options.unsigned_char) addSet (&preArgvSet, Safe_strdup ("-DSDCC_CHAR_UNSIGNED")); /* set the macro for non-free */ if (options.use_non_free) + addSet (&preArgvSet, Safe_strdup ("-D__SDCC_USE_NON_FREE")); + if (options.std_sdcc && options.use_non_free) addSet (&preArgvSet, Safe_strdup ("-DSDCC_USE_NON_FREE")); /* set the macro for large model */ switch (options.model) { case MODEL_LARGE: - addSet (&preArgvSet, Safe_strdup ("-DSDCC_MODEL_LARGE")); + addSet (&preArgvSet, Safe_strdup ("-D__SDCC_MODEL_LARGE")); + if (options.std_sdcc) + addSet (&preArgvSet, Safe_strdup ("-DSDCC_MODEL_LARGE")); break; case MODEL_SMALL: - addSet (&preArgvSet, Safe_strdup ("-DSDCC_MODEL_SMALL")); + addSet (&preArgvSet, Safe_strdup ("-D__SDCC_MODEL_SMALL")); + if (options.std_sdcc) + addSet (&preArgvSet, Safe_strdup ("-DSDCC_MODEL_SMALL")); break; case MODEL_COMPACT: - addSet (&preArgvSet, Safe_strdup ("-DSDCC_MODEL_COMPACT")); + addSet (&preArgvSet, Safe_strdup ("-D__SDCC_MODEL_COMPACT")); + if (options.std_sdcc) + addSet (&preArgvSet, Safe_strdup ("-DSDCC_MODEL_COMPACT")); break; case MODEL_MEDIUM: - addSet (&preArgvSet, Safe_strdup ("-DSDCC_MODEL_MEDIUM")); + addSet (&preArgvSet, Safe_strdup ("-D__SDCC_MODEL_MEDIUM")); + if (options.std_sdcc) + addSet (&preArgvSet, Safe_strdup ("-DSDCC_MODEL_MEDIUM")); break; case MODEL_HUGE: - addSet (&preArgvSet, Safe_strdup ("-DSDCC_MODEL_HUGE")); + addSet (&preArgvSet, Safe_strdup ("-D__SDCC_MODEL_HUGE")); + if (options.std_sdcc) + addSet (&preArgvSet, Safe_strdup ("-DSDCC_MODEL_HUGE")); break; case MODEL_FLAT24: - addSet (&preArgvSet, Safe_strdup ("-DSDCC_MODEL_FLAT24")); + addSet (&preArgvSet, Safe_strdup ("-D__SDCC_MODEL_FLAT24")); + if (options.std_sdcc) + addSet (&preArgvSet, Safe_strdup ("-DSDCC_MODEL_FLAT24")); break; case MODEL_PAGE0: - addSet (&preArgvSet, Safe_strdup ("-DSDCC_MODEL_PAGE0")); + addSet (&preArgvSet, Safe_strdup ("-D__SDCC_MODEL_PAGE0")); + if (options.std_sdcc) + addSet (&preArgvSet, Safe_strdup ("-DSDCC_MODEL_PAGE0")); break; case NO_MODEL: @@ -2008,10 +2052,14 @@ /* set macro corresponding to compiler option */ if (options.intlong_rent) + addSet (&preArgvSet, Safe_strdup ("-D__SDCC_INT_LONG_REENT")); + if (options.std_sdcc && options.intlong_rent) addSet (&preArgvSet, Safe_strdup ("-DSDCC_INT_LONG_REENT")); /* set macro corresponding to compiler option */ if (options.float_rent) + addSet (&preArgvSet, Safe_strdup ("-D__SDCC_FLOAT_REENT")); + if (options.std_sdcc && options.float_rent) addSet (&preArgvSet, Safe_strdup ("-DSDCC_FLOAT_REENT")); /* add SDCC version number */ @@ -2019,32 +2067,49 @@ struct dbuf_s dbuf; dbuf_init (&dbuf, 20); - dbuf_printf (&dbuf, "-DSDCC=%d%d%d", SDCC_VERSION_HI, SDCC_VERSION_LO, SDCC_VERSION_P); + dbuf_printf (&dbuf, "-D__SDCC=%d_%d_%d", SDCC_VERSION_HI, SDCC_VERSION_LO, SDCC_VERSION_P); addSet (&preArgvSet, dbuf_detach_c_str (&dbuf)); } + if (options.std_sdcc) + { + struct dbuf_s dbuf; + + dbuf_init (&dbuf, 20); + dbuf_printf (&dbuf, "-DSDCC=%d%d%d", SDCC_VERSION_HI, SDCC_VERSION_LO, SDCC_VERSION_P); + addSet (&preArgvSet, dbuf_detach_c_str (&dbuf)); + } /* add SDCC revision number */ { struct dbuf_s dbuf; dbuf_init (&dbuf, 20); - dbuf_printf (&dbuf, "-DSDCC_REVISION=%s", getBuildNumber ()); + dbuf_printf (&dbuf, "-D__SDCC_REVISION=%s", getBuildNumber ()); addSet (&preArgvSet, dbuf_detach_c_str (&dbuf)); } - - /* add port (processor information to processor */ - addSet (&preArgvSet, Safe_strdup ("-DSDCC_{port}")); - addSet (&preArgvSet, Safe_strdup ("-D__{port}")); - - if (port && port->processor && TARGET_IS_PIC14) + if (options.std_sdcc) { struct dbuf_s dbuf; - dbuf_init (&dbuf, 512); - dbuf_printf (&dbuf, "-DSDCC_PROCESSOR=\"%s\"", port->processor); + dbuf_init (&dbuf, 20); + dbuf_printf (&dbuf, "-DSDCC_REVISION=%s", getBuildNumber ()); addSet (&preArgvSet, dbuf_detach_c_str (&dbuf)); } + /* add port (processor information to processor */ + addSet (&preArgvSet, Safe_strdup ("-D__SDCC_{port}")); + if (options.std_sdcc) + { + addSet (&preArgvSet, Safe_strdup ("-DSDCC_{port}")); + addSet (&preArgvSet, Safe_strdup ("-D__{port}")); + } + + /* Optinal C features not (yet) supported by sdcc */ + addSet (&preArgvSet, Safe_strdup ("-D__STDC_NO_COMPLEX__")); + addSet (&preArgvSet, Safe_strdup ("-D__STDC_NO_THREADS__")); + addSet (&preArgvSet, Safe_strdup ("-D__STDC_NO_ATOMICS__")); + addSet (&preArgvSet, Safe_strdup ("-D__STDC_NO_VLA__")); + /* standard include path */ if (!options.nostdinc) { @@ -2313,16 +2378,8 @@ * Make sure the preprocessor is called with the "-std" option * corresponding to the --std used to start sdcc */ - if (options.std_c99) - { - if (!options.std_sdcc) - setMainValue ("cppstd", "-std=c99 "); - } - else - { - if (!options.std_sdcc) - setMainValue ("cppstd", "-std=c89 "); - } + if (!options.std_sdcc) + setMainValue ("cppstd", options.std_c11 ? "-std=c11 " : (options.std_c99 ? "-std=c99 " : "-std=c89 ")); } static void diff -Nru sdcc-3.1.0+dfsg/src/SDCCmem.c sdcc-3.2.0+dfsg/src/SDCCmem.c --- sdcc-3.1.0+dfsg/src/SDCCmem.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCmem.c 2011-12-29 13:55:21.000000000 +0000 @@ -48,31 +48,35 @@ memmap *overlay = NULL; /* overlay segment */ memmap *eeprom = NULL; /* eeprom location */ memmap *home = NULL; /* Unswitchable code bank */ +namedspacemap *namedspacemaps = 0; /* memory segments for named address spaces */ /* this is a set of sets each set containing symbols in a single overlay */ set *ovrSetSets = NULL; -int fatalError = 0; /* fatal error flag */ +int fatalError = 0; /* fatal error flag */ /*-----------------------------------------------------------------*/ /* allocMap - allocates a memory map */ /*-----------------------------------------------------------------*/ memmap * -allocMap (char rspace, /* sfr space */ - char farmap, /* far or near segment */ - char paged, /* can this segment be paged */ - char direct, /* directly addressable */ - char bitaddr, /* bit addressable space */ - char codemap, /* this is code space */ - unsigned sloc, /* starting location */ - const char *name, /* 2 character name */ - char dbName, /* debug name */ +allocMap (char rspace, /* sfr space */ + char farmap, /* far or near segment */ + char paged, /* can this segment be paged */ + char direct, /* directly addressable */ + char bitaddr, /* bit addressable space */ + char codemap, /* this is code space */ + unsigned sloc, /* starting location */ + const char *name, /* 8 character name */ + char dbName, /* debug name */ int ptrType /* pointer type for this space */ ) { memmap *map; + if (!name) + return NULL; + if (!(map = Safe_alloc (sizeof (memmap)))) { werror (E_OUT_OF_MEM, __FILE__, sizeof (memmap)); @@ -126,14 +130,7 @@ DEBUG-NAME - 'B' POINTER-TYPE - POINTER */ - if (ISTACK_NAME) - { - istack = allocMap (0, 0, 0, 0, 0, 0, options.stack_loc, ISTACK_NAME, 'B', POINTER); - } - else - { - istack = NULL; - } + istack = allocMap (0, 0, 0, 0, 0, 0, options.stack_loc, ISTACK_NAME, 'B', POINTER); /* code segment ; SFRSPACE - NO @@ -205,14 +202,7 @@ DEBUG-NAME - 'E' POINTER-TYPE - POINTER */ - if (IABS_NAME) - { - d_abs = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, IABS_NAME, 'E', POINTER); - } - else - { - d_abs = NULL; - } + d_abs = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, IABS_NAME, 'E', POINTER); /* overlay segment - same as internal storage segment ; SFRSPACE - NO @@ -225,13 +215,7 @@ POINTER-TYPE - POINTER */ if (OVERLAY_NAME) - { overlay = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, DATA_NAME, 'E', POINTER); - } - else - { - overlay = NULL; - } /* Xternal paged segment ; SFRSPACE - NO @@ -243,14 +227,7 @@ DEBUG-NAME - 'P' POINTER-TYPE - PPOINTER */ - if (PDATA_NAME) - { - pdata = allocMap (0, 0, 1, 0, 0, 0, options.xstack_loc, PDATA_NAME, 'P', PPOINTER); - } - else - { - pdata = NULL; - } + pdata = allocMap (0, 0, 1, 0, 0, 0, options.xstack_loc, PDATA_NAME, 'P', PPOINTER); /* Xternal Data segment - SFRSPACE - NO @@ -276,14 +253,7 @@ DEBUG-NAME - 'F' POINTER-TYPE - FPOINTER */ - if (XABS_NAME) - { - x_abs = allocMap (0, 1, 0, 0, 0, 0, options.xdata_loc, XABS_NAME, 'F', FPOINTER); - } - else - { - x_abs = NULL; - } + x_abs = allocMap (0, 1, 0, 0, 0, 0, options.xdata_loc, XABS_NAME, 'F', FPOINTER); /* Indirectly addressed internal data segment SFRSPACE - NO @@ -295,14 +265,7 @@ DEBUG-NAME - 'G' POINTER-TYPE - IPOINTER */ - if (IDATA_NAME) - { - idata = allocMap (0, 0, 0, 0, 0, 0, options.idata_loc, IDATA_NAME, 'G', IPOINTER); - } - else - { - idata = NULL; - } + idata = allocMap (0, 0, 0, 0, 0, 0, options.idata_loc, IDATA_NAME, 'G', IPOINTER); /* Indirectly addressed absolute internal segment SFRSPACE - NO @@ -314,14 +277,7 @@ DEBUG-NAME - 'E' POINTER-TYPE - IPOINTER */ - if (IABS_NAME) - { - i_abs = allocMap (0, 0, 0, 0, 0, 0, options.data_loc, IABS_NAME, 'E', IPOINTER); - } - else - { - i_abs = NULL; - } + i_abs = allocMap (0, 0, 0, 0, 0, 0, options.data_loc, IABS_NAME, 'E', IPOINTER); /* Bit space ; SFRSPACE - NO @@ -392,9 +348,32 @@ /* allocIntoSeg - puts a symbol into a memory segment */ /*-----------------------------------------------------------------*/ void -allocIntoSeg (symbol * sym) +allocIntoSeg (symbol *sym) { - memmap *segment = SPEC_OCLS (sym->etype); + memmap *segment; + + if (SPEC_ADDRSPACE (sym->etype)) + { + namedspacemap *nm; + for (nm = namedspacemaps; nm; nm = nm->next) + if (!strcmp (nm->name, SPEC_ADDRSPACE (sym->etype)->name)) + break; + + if (!nm) + { + nm = Safe_alloc (sizeof (namedspacemap)); + nm->name = Safe_alloc (strlen(SPEC_ADDRSPACE (sym->etype)->name) + 1); + strcpy (nm->name, SPEC_ADDRSPACE (sym->etype)->name); + nm->map = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, SPEC_ADDRSPACE (sym->etype)->name, 'E', POINTER); + nm->next = namedspacemaps; + namedspacemaps = nm; + } + + addSet (&nm->map->syms, sym); + + return; + } + segment = SPEC_OCLS (sym->etype); addSet (&segment->syms, sym); if (segment == pdata) sym->iaccess = 1; @@ -406,9 +385,10 @@ /*-----------------------------------------------------------------*/ void deleteFromSeg(symbol *sym) { - if (SPEC_OCLS(sym->etype)) { - memmap *segment = SPEC_OCLS (sym->etype); - deleteSetItem(&segment->syms,sym); + if (SPEC_OCLS(sym->etype)) + { + memmap *segment = SPEC_OCLS (sym->etype); + deleteSetItem(&segment->syms, sym); } } @@ -416,7 +396,7 @@ /* defaultOClass - set the output segment based on SCLASS */ /*-----------------------------------------------------------------*/ bool -defaultOClass (symbol * sym) +defaultOClass (symbol *sym) { switch (SPEC_SCLS (sym->etype)) { @@ -504,7 +484,7 @@ { allocIntoSeg (sym); return TRUE; - } + } return FALSE; } @@ -520,9 +500,10 @@ "%s%s", port->fun_prefix, sym->name); /* add it to the operandKey reset */ - if (!isinSet (operKeyReset, sym)) { - addSet(&operKeyReset, sym); - } + if (!isinSet (operKeyReset, sym)) + { + addSet(&operKeyReset, sym); + } /* if this is a literal e.g. enumerated type */ /* put it in the data segment & do nothing */ @@ -538,9 +519,9 @@ SPEC_OCLS (sym->etype) = code; /* if this is an interrupt service routine then put it in the interrupt service array */ - if (FUNC_ISISR (sym->type) && !options.noiv - && (FUNC_INTNO (sym->type) != INTNO_UNSPEC)) - { + if (FUNC_ISISR (sym->type) && !options.noiv && + (FUNC_INTNO (sym->type) != INTNO_UNSPEC)) + { if (interrupts[FUNC_INTNO (sym->type)]) werror (E_INT_DEFINED, FUNC_INTNO (sym->type), @@ -551,7 +532,7 @@ /* automagically extend the maximum interrupts */ if (FUNC_INTNO (sym->type) >= maxInterrupts) maxInterrupts = FUNC_INTNO (sym->type) + 1; - } + } /* if it is not compiler defined */ if (!sym->cdef) allocIntoSeg (sym); @@ -568,26 +549,38 @@ return; } - if(!TARGET_IS_PIC16 || (TARGET_IS_PIC16 && sym->level)) - /* register storage class ignored changed to FIXED */ - if (SPEC_SCLS (sym->etype) == S_REGISTER) - SPEC_SCLS (sym->etype) = S_FIXED; + if (!TARGET_IS_PIC16 || sym->level) + /* register storage class ignored changed to FIXED */ + if (SPEC_SCLS (sym->etype) == S_REGISTER) + SPEC_SCLS (sym->etype) = S_FIXED; /* if it is fixed, then allocate depending on the */ /* current memory model, same for automatics */ if (SPEC_SCLS (sym->etype) == S_FIXED || (TARGET_IS_PIC16 && (SPEC_SCLS (sym->etype) == S_REGISTER) && (sym->level==0)) || - SPEC_SCLS (sym->etype) == S_AUTO) { - if (port->mem.default_globl_map != xdata) { - /* set the output class */ - SPEC_OCLS (sym->etype) = port->mem.default_globl_map; - /* generate the symbol */ - allocIntoSeg (sym); - return; - } else { - SPEC_SCLS (sym->etype) = S_XDATA; + SPEC_SCLS (sym->etype) == S_AUTO) + { + if (port->mem.default_globl_map != xdata) + { + if (sym->ival && SPEC_ABSA (sym->etype)) + { + /* absolute initialized global */ + SPEC_OCLS (sym->etype) = x_abs; + } + else + { + /* set the output class */ + SPEC_OCLS (sym->etype) = port->mem.default_globl_map; + } + /* generate the symbol */ + allocIntoSeg (sym); + return; + } + else + { + SPEC_SCLS (sym->etype) = S_XDATA; + } } - } allocDefault (sym); return; @@ -700,7 +693,7 @@ } /*-----------------------------------------------------------------*/ -/* deallocParms - parameters are always passed on stack */ +/* deallocParms - parameters are always passed on stack */ /*-----------------------------------------------------------------*/ void deallocParms (value * val) @@ -783,26 +776,33 @@ /* this is automatic */ /* if it's to be placed on the stack */ - if (options.stackAuto || reentrant) { - sym->onStack = 1; - if (options.useXstack) { - /* PENDING: stack direction for xstack */ - SPEC_OCLS (sym->etype) = xstack; - SPEC_STAK (sym->etype) = sym->stack = (xstackPtr + 1); - xstackPtr += getSize (sym->type); - } else { - SPEC_OCLS (sym->etype) = istack; - if (port->stack.direction > 0) { - SPEC_STAK (sym->etype) = sym->stack = (stackPtr + 1); - stackPtr += getSize (sym->type); - } else { - stackPtr -= getSize (sym->type); - SPEC_STAK (sym->etype) = sym->stack = stackPtr; - } + if (options.stackAuto || reentrant) + { + sym->onStack = 1; + if (options.useXstack) + { + /* PENDING: stack direction for xstack */ + SPEC_OCLS (sym->etype) = xstack; + SPEC_STAK (sym->etype) = sym->stack = (xstackPtr + 1); + xstackPtr += getSize (sym->type); + } + else + { + SPEC_OCLS (sym->etype) = istack; + if (port->stack.direction > 0) + { + SPEC_STAK (sym->etype) = sym->stack = (stackPtr + 1); + stackPtr += getSize (sym->type); + } + else + { + stackPtr -= getSize (sym->type); + SPEC_STAK (sym->etype) = sym->stack = stackPtr; + } + } + allocIntoSeg (sym); + return; } - allocIntoSeg (sym); - return; - } /* else depending on the storage class specified */ @@ -837,12 +837,15 @@ /* again note that we have put it into the overlay segment will remove and put into the 'data' segment if required after overlay analysis has been done */ - if (options.model == MODEL_SMALL) { + if (options.model == MODEL_SMALL) + { SPEC_OCLS (sym->etype) = (options.noOverlay ? port->mem.default_local_map : overlay); - } else { + } + else + { SPEC_OCLS (sym->etype) = port->mem.default_local_map; - } + } allocIntoSeg (sym); } @@ -894,7 +897,6 @@ } setToNull ((void *) &overlay->syms); - } /*-----------------------------------------------------------------*/ @@ -916,7 +918,6 @@ setToNull ((void *) &overlay->syms); addSet (&ovrSetSets, oset); - } /*-----------------------------------------------------------------*/ @@ -933,7 +934,6 @@ /* go thru the symbol chain */ for (sym = symChain; sym; sym = sym->next) { - /* if this is a typedef then add it */ /* to the typedef table */ if (IS_TYPEDEF (sym->etype)) @@ -1008,8 +1008,7 @@ on the stack. We will eliminate those variables which do not have the allocReq flag thus reducing the stack space */ - for (sym = setFirstItem (istack->syms); sym; - sym = setNextItem (istack->syms)) + for (sym = setFirstItem (istack->syms); sym; sym = setNextItem (istack->syms)) { int size = getSize (sym->type); /* nothing to do with parameters so continue */ @@ -1054,8 +1053,7 @@ /* do the same for the external stack */ - for (sym = setFirstItem (xstack->syms); sym; - sym = setNextItem (xstack->syms)) + for (sym = setFirstItem (xstack->syms); sym; sym = setNextItem (xstack->syms)) { int size = getSize (sym->type); /* nothing to do with parameters so continue */ @@ -1081,7 +1079,6 @@ SPEC_STAK (sym->etype) = sym->stack = (xsPtr + 1); xsPtr += size; } - } #define SP_BP(sp, bp) (options.omitFramePtr ? sp : bp) @@ -1170,9 +1167,9 @@ (IFFUNC_ISREENT (currFunc->type) || FUNC_ISISR (currFunc->type))) || elementsInSet (overlay->syms) == 0) - - return FALSE; - + { + return FALSE; + } /* if this is a forces overlay */ if (IFFUNC_ISOVERLAY(currFunc->type)) return TRUE; @@ -1183,12 +1180,18 @@ iCode *ic; for (ic = ebbs[i]->sch; ic; ic = ic->next) - if (ic) { - if (ic->op == CALL) { + if (ic) + { + if (ic->op == CALL) + { sym_link *ftype = operandType(IC_LEFT(ic)); /* builtins only can use overlays */ if (!IFFUNC_ISBUILTIN(ftype)) return FALSE; - } else if (ic->op == PCALL) return FALSE; + } + else if (ic->op == PCALL) + { + return FALSE; + } } } @@ -1202,9 +1205,8 @@ void doOverlays (eBBlock ** ebbs, int count) { - if (!overlay) { + if (!overlay) return; - } /* check if the parameters and local variables of this function can be put in the overlay segment @@ -1229,6 +1231,8 @@ { #define BREAKLINE ";------------------------------------------------------------\n" int cnt = 0; + set *ovrset; + set *tempOverlaySyms; if (!func) return; @@ -1247,19 +1251,16 @@ cnt += printAllocInfoSeg (sfr, func, oBuf); cnt += printAllocInfoSeg (sfrbit, func, oBuf); - { - set *ovrset; - set *tempOverlaySyms = overlay->syms; - - /* search the set of overlay sets for local variables/parameters */ - for (ovrset = setFirstItem (ovrSetSets); ovrset; - ovrset = setNextItem (ovrSetSets)) - { - overlay->syms = ovrset; - cnt += printAllocInfoSeg (overlay, func, oBuf); - } - overlay->syms = tempOverlaySyms; - } + tempOverlaySyms = overlay->syms; + + /* search the set of overlay sets for local variables/parameters */ + for (ovrset = setFirstItem (ovrSetSets); ovrset; + ovrset = setNextItem (ovrSetSets)) + { + overlay->syms = ovrset; + cnt += printAllocInfoSeg (overlay, func, oBuf); + } + overlay->syms = tempOverlaySyms; if (cnt) dbuf_append_str (oBuf, BREAKLINE); diff -Nru sdcc-3.1.0+dfsg/src/SDCCmem.h sdcc-3.2.0+dfsg/src/SDCCmem.h --- sdcc-3.1.0+dfsg/src/SDCCmem.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCmem.h 2011-11-28 11:07:02.000000000 +0000 @@ -30,6 +30,15 @@ } memmap; +/* For performance we might want to use a hash map instead of the linked list */ +typedef struct namedspacemap + { + char *name; + memmap *map; + struct namedspacemap *next; + } +namedspacemap; + extern FILE *junkFile; /* memory map prefixes MOF added the DATA,CODE,XDATA,BIT */ @@ -76,6 +85,8 @@ extern memmap *eeprom; /* eeprom space */ extern memmap *home; /* Non-banked home space */ +extern namedspacemap *namedspacemaps; + extern int fatalError; extern struct set *ovrSetSets; diff -Nru sdcc-3.1.0+dfsg/src/SDCCnaddr.cc sdcc-3.2.0+dfsg/src/SDCCnaddr.cc --- sdcc-3.1.0+dfsg/src/SDCCnaddr.cc 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCnaddr.cc 2012-01-19 13:14:56.000000000 +0000 @@ -0,0 +1,42 @@ +// Philipp Klaus Krause, philipp@informatik.uni-frankfurt.de, pkk@spth.de, 2011 +// +// (c) 2011 Goethe-Universität Frankfurt +// +// This program is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// +// Optimal placement of bank switching instructions for named address spaces. + +#include "SDCCnaddr.hpp" + +int +switchAddressSpacesOptimally (iCode *ic, ebbIndex *ebbi) +{ + cfg_t control_flow_graph; + tree_dec_naddr_t tree_decomposition; + std::map addrspaces; + + create_cfg_naddr(control_flow_graph, ic, ebbi); + annotate_cfg_naddr(control_flow_graph, addrspaces); + + if(options.dump_graphs) + dump_cfg_naddr(control_flow_graph); + + thorup_tree_decomposition(tree_decomposition, control_flow_graph); + nicify(tree_decomposition); + + return(tree_dec_address_switch(tree_decomposition, control_flow_graph, addrspaces)); +} + diff -Nru sdcc-3.1.0+dfsg/src/SDCCnaddr.hpp sdcc-3.2.0+dfsg/src/SDCCnaddr.hpp --- sdcc-3.1.0+dfsg/src/SDCCnaddr.hpp 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCnaddr.hpp 2012-05-05 14:39:36.000000000 +0000 @@ -0,0 +1,510 @@ +// Philipp Klaus Krause, philipp@informatik.uni-frankfurt.de, pkk@spth.de, 2011 +// +// (c) 2011 Goethe-Universität Frankfurt +// +// This program is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// +// Optimal placement of bank switching instructions for named address spaces. + +#ifndef SDCCNADDR_HH +#define SDCCNADDR_HH 1 + + +#include +#include +#include +#include + +#include + +#include "SDCCtree_dec.hpp" + +extern "C" +{ +#include "SDCCsymt.h" +#include "SDCCicode.h" +#include "SDCCBBlock.h" +#include "SDCCopt.h" +#include "SDCCy.h" +} + +#ifdef HAVE_STX_BTREE_SET_H +#include +#endif + +typedef short int naddrspace_t; // Named address spaces. -1: Undefined, Others: see map. + +#ifdef HAVE_STX_BTREE_SET_H +typedef stx::btree_set naddrspaceset_t; // Faster than std::set +#else +typedef std::set naddrspaceset_t; +#endif + +struct assignment_naddr +{ + float s; + naddrspaceset_t local; + std::vector global; + + bool operator<(const assignment_naddr& a) const + { + naddrspaceset_t::const_iterator i, ai, i_end, ai_end; + + i_end = local.end(); + ai_end = a.local.end(); + + for (i = local.begin(), ai = a.local.begin();; ++i, ++ai) + { + if (i == i_end) + return(true); + if (ai == ai_end) + return(false); + + if (*i < *ai) + return(true); + if (*i > *ai) + return(false); + + if (global[*i] < a.global[*ai]) + return(true); + if (global[*i] > a.global[*ai]) + return(false); + } + } +}; + +bool assignments_naddr_locally_same(const assignment_naddr &a1, const assignment_naddr &a2) +{ + if (a1.local != a2.local) + return(false); + + naddrspaceset_t::const_iterator i, i_end; + for (i = a1.local.begin(), i_end = a1.local.end(); i != i_end; ++i) + if (a1.global[*i] != a2.global[*i]) + return(false); + + return(true); +} + +struct cfg_naddr_node +{ + iCode *ic; + naddrspaceset_t possible_naddrspaces; +}; + +typedef std::list assignment_list_naddr_t; + +struct tree_dec_naddr_node +{ + std::set bag; + assignment_list_naddr_t assignments; +}; + +typedef boost::adjacency_list cfg_t; // The edge property is the cost of subdividing he edge and inserting a bank switching instruction. +typedef boost::adjacency_list tree_dec_naddr_t; + +// A quick-and-dirty function to get the CFG from sdcc (a simplified version of the function from SDCCralloc.hpp). +void +create_cfg_naddr(cfg_t &cfg, iCode *start_ic, ebbIndex *ebbi) +{ + iCode *ic; + + std::map key_to_index; + { + int i; + + for (ic = start_ic, i = 0; ic; ic = ic->next, i++) + { + boost::add_vertex(cfg); + key_to_index[ic->key] = i; + cfg[i].ic = ic; + } + } + + // Get control flow graph from sdcc. + for (ic = start_ic; ic; ic = ic->next) + { + if (ic->op != GOTO && ic->op != RETURN && ic->op != JUMPTABLE && ic->next) + boost::add_edge(key_to_index[ic->key], key_to_index[ic->next->key], 3.0f, cfg); + + if (ic->op == GOTO) + boost::add_edge(key_to_index[ic->key], key_to_index[eBBWithEntryLabel(ebbi, ic->label)->sch->key], 6.0f, cfg); + else if (ic->op == RETURN) + boost::add_edge(key_to_index[ic->key], key_to_index[eBBWithEntryLabel(ebbi, returnLabel)->sch->key], 6.0f, cfg); + else if (ic->op == IFX) + boost::add_edge(key_to_index[ic->key], key_to_index[eBBWithEntryLabel(ebbi, IC_TRUE(ic) ? IC_TRUE(ic) : IC_FALSE(ic))->sch->key], 6.0f, cfg); + else if (ic->op == JUMPTABLE) + for (symbol *lbl = (symbol *)(setFirstItem (IC_JTLABELS (ic))); lbl; lbl = (symbol *)(setNextItem (IC_JTLABELS (ic)))) + boost::add_edge(key_to_index[ic->key], key_to_index[eBBWithEntryLabel(ebbi, lbl)->sch->key], 6.0f, cfg); + } +} + +// Annotate nodes of the control flow graph with the set of possible named address spaces active there. +void annotate_cfg_naddr(cfg_t &cfg, std::map &addrspaces) +{ + /* MSVC 2010 doesn't like the typename here, though it accepts it elsewhere */ + typedef /*typename*/ boost::graph_traits::vertex_descriptor vertex_t; + + std::map sym_to_index; + naddrspace_t na_max = -1; + + std::vector predetermined(boost::num_vertices (cfg), false); + + // Initialize the cfg vertices where there is information on the desired named address space. + for (vertex_t i = 0; i < boost::num_vertices (cfg); i++) + { + const iCode *ic = cfg[i].ic; + const symbol *addrspace; + + // We do not know the current named address space when entering a function or after calling one. + if (ic->op == CALL || ic->op == PCALL || ic->op == FUNCTION) + predetermined[i] = true; + + // Set the required named address spaces + if (addrspace = getAddrspaceiCode (ic)) + { + naddrspace_t na; + + if (sym_to_index.find (addrspace) == sym_to_index.end ()) + sym_to_index[addrspace] = ++na_max; + na = sym_to_index[addrspace]; + addrspaces[na] = addrspace; + + cfg[i].possible_naddrspaces.insert (na); + predetermined[i] = true; + } + else + cfg[i].possible_naddrspaces.insert(-1); + } + + // Extend. + bool change; + do + { + change = false; + for (vertex_t i = 0; i < boost::num_vertices (cfg); i++) + { + if (predetermined[i]) + continue; + + size_t oldsize = cfg[i].possible_naddrspaces.size(); + { + /* MSVC 2010 doesn't like the typename here, though it accepts it elsewhere */ + typedef /*typename*/ boost::graph_traits::out_edge_iterator n_iter_t; + n_iter_t n, n_end; + for (boost::tie(n, n_end) = boost::out_edges(i, cfg); n != n_end; ++n) + { + vertex_t v = boost::target(*n, cfg); + cfg[i].possible_naddrspaces.insert(cfg[v].possible_naddrspaces.begin(), cfg[v].possible_naddrspaces.end()); + } + } + { + /* MSVC 2010 doesn't like the typename here, though it accepts it elsewhere */ + typedef /*typename*/ boost::graph_traits::in_edge_iterator n_iter_t; + n_iter_t n, n_end; + for (boost::tie(n, n_end) = boost::in_edges(i, cfg); n != n_end; ++n) + { + vertex_t v = boost::source(*n, cfg); + cfg[i].possible_naddrspaces.insert(cfg[v].possible_naddrspaces.begin(), cfg[v].possible_naddrspaces.end()); + } + } + + if (oldsize != cfg[i].possible_naddrspaces.size()) + change = true; + } + } + while(change); +} + +// Handle Leaf nodes in the nice tree decomposition +template +void tree_dec_naddrswitch_leaf(T_t &T, typename boost::graph_traits::vertex_descriptor t, const G_t &G) +{ + assignment_naddr a; + assignment_list_naddr_t &alist = T[t].assignments; + + a.s = 0; + a.global.resize(boost::num_vertices(G), -2); + alist.push_back(a); +} + +// Handle introduce nodes in the nice tree decomposition +template +int tree_dec_naddrswitch_introduce(T_t &T, typename boost::graph_traits::vertex_descriptor t, const G_t &G) +{ + typedef typename boost::graph_traits::adjacency_iterator adjacency_iter_t; + adjacency_iter_t c, c_end; + assignment_list_naddr_t::iterator ai; + boost::tie(c, c_end) = adjacent_vertices(t, T); + + assignment_list_naddr_t &alist2 = T[t].assignments; + assignment_list_naddr_t &alist = T[*c].assignments; + + std::set new_inst; + std::set_difference(T[t].bag.begin(), T[t].bag.end(), T[*c].bag.begin(), T[*c].bag.end(), std::inserter(new_inst, new_inst.end())); + unsigned short int i = *(new_inst.begin()); + + for(ai = alist.begin(); ai != alist.end(); ++ai) + { + ai->local.insert(i); + + naddrspaceset_t::const_iterator ni, ni_end; + for(ni = G[i].possible_naddrspaces.begin(), ni_end = G[i].possible_naddrspaces.end(); ni != ni_end; ++ni) + { + ai->global[i] = *ni; + alist2.push_back(*ai); + } + } + + alist.clear(); + + return((int)alist2.size() <= options.max_allocs_per_node ? 0 : -1); +} + +// Handle forget nodes in the nice tree decomposition +template +void tree_dec_naddrswitch_forget(T_t &T, typename boost::graph_traits::vertex_descriptor t, const G_t &G) +{ + typedef typename boost::graph_traits::adjacency_iterator adjacency_iter_t; + adjacency_iter_t c, c_end; + boost::tie(c, c_end) = adjacent_vertices(t, T); + + assignment_list_naddr_t &alist = T[t].assignments; + + std::swap(alist, T[*c].assignments); + + std::set old_inst; + std::set_difference(T[*c].bag.begin(), T[*c].bag.end(), T[t].bag.begin(), T[t].bag.end(), std::inserter(old_inst, old_inst.end())); + unsigned short int i = *(old_inst.begin()); + + assignment_list_naddr_t::iterator ai, aif; + + // Restrict assignments (locally) to current variables. + for (ai = alist.begin(); ai != alist.end(); ++ai) + { + ai->local.erase(i); + { + typedef typename boost::graph_traits::out_edge_iterator n_iter_t; + n_iter_t n, n_end; + for (boost::tie(n, n_end) = boost::out_edges(i, G); n != n_end; ++n) + { + if (ai->local.find(boost::target(*n, G)) == ai->local.end() || ai->global[boost::target(*n, G)] == -1) + continue; + if (ai->global[boost::source(*n, G)] == ai->global[boost::target(*n, G)]) + continue; + ai->s += G[*n]; + } + } + { + typedef typename boost::graph_traits::in_edge_iterator n_iter_t; + n_iter_t n, n_end; + for (boost::tie(n, n_end) = boost::in_edges(i, G); n != n_end; ++n) + { + if (ai->local.find(boost::source(*n, G)) == ai->local.end() || ai->global[boost::target(*n, G)] == -1) + continue; + if (ai->global[boost::source(*n, G)] == ai->global[boost::target(*n, G)]) + continue; + ai->s += G[*n]; + } + } + } + + alist.sort(); + + // Collapse (locally) identical assignments. + for (ai = alist.begin(); ai != alist.end();) + { + aif = ai; + + for (++ai; ai != alist.end() && assignments_naddr_locally_same(*aif, *ai);) + { + if (aif->s > ai->s) + { + alist.erase(aif); + aif = ai; + ++ai; + } + else + { + alist.erase(ai); + ai = aif; + ++ai; + } + } + } +} + +// Handle join nodes in the nice tree decomposition +template +void tree_dec_naddrswitch_join(T_t &T, typename boost::graph_traits::vertex_descriptor t, const G_t &G) +{ + typedef typename boost::graph_traits::adjacency_iterator adjacency_iter_t; + adjacency_iter_t c, c_end, c2, c3; + boost::tie(c, c_end) = adjacent_vertices(t, T); + + c2 = c; + ++c; + c3 = c; + + assignment_list_naddr_t &alist1 = T[t].assignments; + assignment_list_naddr_t &alist2 = T[*c2].assignments; + assignment_list_naddr_t &alist3 = T[*c3].assignments; + + alist2.sort(); + alist3.sort(); + + assignment_list_naddr_t::iterator ai2, ai3; + for (ai2 = alist2.begin(), ai3 = alist3.begin(); ai2 != alist2.end() && ai3 != alist3.end();) + { + if (assignments_naddr_locally_same(*ai2, *ai3)) + { + ai2->s += ai3->s; + for (size_t i = 0; i < ai2->global.size(); i++) + ai2->global[i] = ((ai2->global[i] != -2) ? ai2->global[i] : ai3->global[i]); + alist1.push_back(*ai2); + ++ai2; + ++ai3; + } + else if (*ai2 < *ai3) + { + ++ai2; + continue; + } + else if (*ai3 < *ai2) + { + ++ai3; + continue; + } + } + + alist2.clear(); + alist3.clear(); +} + +template +int tree_dec_naddrswitch_nodes(T_t &T, typename boost::graph_traits::vertex_descriptor t, const G_t &G) +{ + typedef typename boost::graph_traits::adjacency_iterator adjacency_iter_t; + + adjacency_iter_t c, c_end; + typename boost::graph_traits::vertex_descriptor c0, c1; + + boost::tie(c, c_end) = adjacent_vertices(t, T); + + switch (out_degree(t, T)) + { + case 0: + tree_dec_naddrswitch_leaf(T, t, G); + break; + case 1: + c0 = *c; + tree_dec_naddrswitch_nodes(T, c0, G); + if (T[c0].bag.size() < T[t].bag.size()) + { + if (tree_dec_naddrswitch_introduce(T, t, G)) + return(-1); + } + else + tree_dec_naddrswitch_forget(T, t, G); + break; + case 2: + c0 = *c++; + c1 = *c; + tree_dec_naddrswitch_nodes(T, c0, G); + tree_dec_naddrswitch_nodes(T, c1, G); + tree_dec_naddrswitch_join(T, t, G); + break; + default: + std::cerr << "Not nice.\n"; + break; + } + return(0); +} + +template +void implement_assignment(const assignment_naddr &a, const G_t &G, const std::map addrspaces) +{ + typedef typename boost::graph_traits::vertex_descriptor vertex_t; + typedef typename boost::graph_traits::edge_iterator ei_t; + ei_t e, e_end; + + for(boost::tie(e, e_end) = boost::edges(G); e != e_end; ++e) + { + const vertex_t source = boost::source(*e, G); + const vertex_t target = boost::target(*e, G); + const naddrspace_t sourcespace = a.global[source]; + const naddrspace_t targetspace = a.global[target]; + + // Nothing to do if the space doesn't change, or we just forget it. + if(targetspace == -1 || sourcespace == targetspace) + continue; + + // This shouldn't happen with the CFGs sdcc generates and a cost function based on code size. + if(G[source].ic->next != G[target].ic) + std::cerr << "Trying to switch address space at weird edge in CFG."; + + switchAddressSpaceAt(G[target].ic, addrspaces.find(targetspace)->second); + } +} + +template +int tree_dec_address_switch(T_t &T, const G_t &G, const std::map addrspaces) +{ + if(tree_dec_naddrswitch_nodes(T, find_root(T), G)) + return(-1); + + const assignment_naddr &winner = *(T[find_root(T)].assignments.begin()); + +#if 0 + std::cout << "Winner: "; + for(unsigned int i = 0; i < boost::num_vertices(G); i++) + { + std::cout << "(" << i << ", " << int(winner.global[i]) << ") "; + } + std::cout << "\n"; + std::cout << "Cost: " << winner.s << "\n"; + std::cout.flush(); +#endif + + implement_assignment(winner, G, addrspaces); + + return(0); +} + +// Dump cfg, with numbered nodes, show possible address spaces at each node. +void dump_cfg_naddr(const cfg_t &cfg) +{ + if(!currFunc) + return; + + std::ofstream dump_file((std::string(dstFileName) + ".dumpnaddrcfg" + currFunc->rname + ".dot").c_str()); + + std::string *name = new std::string[num_vertices(cfg)]; + for (unsigned int i = 0; i < boost::num_vertices(cfg); i++) + { + std::ostringstream os; + os << i << ", " << cfg[i].ic->key << ": "; + naddrspaceset_t::const_iterator n; + for (n = cfg[i].possible_naddrspaces.begin(); n != cfg[i].possible_naddrspaces.end(); ++n) + os << *n << " "; + name[i] = os.str(); + } + boost::write_graphviz(dump_file, cfg, boost::make_label_writer(name)); + delete[] name; +} + +#endif + diff -Nru sdcc-3.1.0+dfsg/src/SDCCopt.c sdcc-3.2.0+dfsg/src/SDCCopt.c --- sdcc-3.1.0+dfsg/src/SDCCopt.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCopt.c 2012-06-18 16:14:27.000000000 +0000 @@ -73,6 +73,8 @@ bitVectUnSetBit (OP_USES (left), ic->key); if (IS_SYMOP (right)) bitVectUnSetBit (OP_USES (right), ic->key); + if (IS_SYMOP (IC_RESULT (ic))) + bitVectUnSetBit (OP_DEFS (IC_RESULT (ic)), ic->key); if (IS_FLOAT (operandType (right))) { @@ -228,7 +230,7 @@ newic = newiCode (CALL, operandFromSymbol (func), NULL); IC_RESULT (newic) = IC_RESULT (ic); bitVectUnSetBit (OP_DEFS (IC_RESULT (ic)), ic->key); - OP_USES (IC_RESULT (newic)) = bitVectSetBit (OP_USES (IC_RESULT (newic)), newic->key); + OP_DEFS (IC_RESULT (newic)) = bitVectSetBit (OP_DEFS (IC_RESULT (newic)), newic->key); newic->filename = filename; newic->lineno = lineno; newic->parmBytes += bytesPushed; @@ -270,8 +272,13 @@ ip = ic->next; /* remove it from the iCode */ remiCodeFromeBBlock (ebp, ic); + if (IS_SYMOP (IC_RIGHT (ic))) + bitVectUnSetBit (OP_USES (IC_RIGHT (ic)), ic->key); + if (IS_SYMOP (IC_RESULT (ic))) + bitVectUnSetBit (OP_DEFS (IC_RESULT (ic)), ic->key); + /* depending on the type */ - for (bwd = 0; bwd < 3; bwd++) + for (bwd = 0; bwd < 4; bwd++) { for (su = 0; su < 2; su++) { @@ -285,7 +292,7 @@ if (compareType (type, fixed16x16Type) == 1) { - func = fp16x16conv[0][3][0]; + func = fp16x16conv[0][4][0]; goto found; } @@ -309,6 +316,8 @@ addiCodeToeBBlock (ebp, newic, ip); newic->filename = filename; newic->lineno = linenno; + if (IS_SYMOP (IC_RIGHT (ic))) + OP_USES (IC_RIGHT (ic)) = bitVectSetBit (OP_USES (IC_RIGHT (ic)), newic->key); } else { @@ -327,6 +336,8 @@ addiCodeToeBBlock (ebp, newic, ip); newic->filename = filename; newic->lineno = linenno; + if (IS_SYMOP (IC_RIGHT (ic))) + OP_USES (IC_RIGHT (ic)) = bitVectSetBit (OP_USES (IC_RIGHT (ic)), newic->key); } /* make the call */ @@ -355,6 +366,8 @@ addiCodeToeBBlock (ebp, newic, ip); newic->filename = filename; newic->lineno = linenno; + if (IS_SYMOP (IC_RESULT (ic))) + OP_DEFS (IC_RESULT (ic)) = bitVectSetBit (OP_DEFS (IC_RESULT (ic)), newic->key); } /*----------------------------------------------------------------------*/ @@ -373,8 +386,13 @@ ip = ic->next; /* remove it from the iCode */ remiCodeFromeBBlock (ebp, ic); + if (IS_SYMOP (IC_RIGHT (ic))) + bitVectUnSetBit (OP_USES (IC_RIGHT (ic)), ic->key); + if (IS_SYMOP (IC_RESULT (ic))) + bitVectUnSetBit (OP_DEFS (IC_RESULT (ic)), ic->key); + /* depending on the type */ - for (bwd = 0; bwd < 3; bwd++) + for (bwd = 0; bwd < 4; bwd++) { for (su = 0; su < 2; su++) { @@ -405,6 +423,8 @@ addiCodeToeBBlock (ebp, newic, ip); newic->filename = filename; newic->lineno = linenno; + if (IS_SYMOP (IC_RIGHT (ic))) + OP_USES (IC_RIGHT (ic)) = bitVectSetBit (OP_USES (IC_RIGHT (ic)), newic->key); } else { @@ -423,6 +443,8 @@ addiCodeToeBBlock (ebp, newic, ip); newic->filename = filename; newic->lineno = linenno; + if (IS_SYMOP (IC_RIGHT (ic))) + OP_USES (IC_RIGHT (ic)) = bitVectSetBit (OP_USES (IC_RIGHT (ic)), newic->key); } /* make the call */ @@ -451,6 +473,8 @@ addiCodeToeBBlock (ebp, newic, ip); newic->filename = filename; newic->lineno = linenno; + if (IS_SYMOP (IC_RESULT (ic))) + OP_DEFS (IC_RESULT (ic)) = bitVectSetBit (OP_DEFS (IC_RESULT (ic)), newic->key); } /*-----------------------------------------------------------------*/ @@ -470,9 +494,13 @@ ip = ic->next; /* remove it from the iCode */ remiCodeFromeBBlock (ebp, ic); + if (IS_SYMOP (IC_RIGHT (ic))) + bitVectUnSetBit (OP_USES (IC_RIGHT (ic)), ic->key); + if (IS_SYMOP (IC_RESULT (ic))) + bitVectUnSetBit (OP_DEFS (IC_RESULT (ic)), ic->key); /* depending on the type */ - for (bwd = 0; bwd < 3; bwd++) + for (bwd = 0; bwd < 4; bwd++) { for (su = 0; su < 2; su++) { @@ -503,6 +531,8 @@ addiCodeToeBBlock (ebp, newic, ip); newic->filename = filename; newic->lineno = lineno; + if (IS_SYMOP (IC_RIGHT (ic))) + OP_USES (IC_RIGHT (ic)) = bitVectSetBit (OP_USES (IC_RIGHT (ic)), newic->key); } else { @@ -521,6 +551,8 @@ addiCodeToeBBlock (ebp, newic, ip); newic->filename = filename; newic->lineno = lineno; + if (IS_SYMOP (IC_RIGHT (ic))) + OP_USES (IC_RIGHT (ic)) = bitVectSetBit (OP_USES (IC_RIGHT (ic)), newic->key); } /* make the call */ @@ -549,6 +581,8 @@ addiCodeToeBBlock (ebp, newic, ip); newic->filename = filename; newic->lineno = lineno; + if (IS_SYMOP (IC_RESULT (ic))) + OP_DEFS (IC_RESULT (ic)) = bitVectSetBit (OP_DEFS (IC_RESULT (ic)), newic->key); } /*--------------------------------------------------------------------------*/ @@ -568,9 +602,13 @@ ip = ic->next; /* remove it from the iCode */ remiCodeFromeBBlock (ebp, ic); + if (IS_SYMOP (IC_RIGHT (ic))) + bitVectUnSetBit (OP_USES (IC_RIGHT (ic)), ic->key); + if (IS_SYMOP (IC_RESULT (ic))) + bitVectUnSetBit (OP_DEFS (IC_RESULT (ic)), ic->key); /* depending on the type */ - for (bwd = 0; bwd < 3; bwd++) + for (bwd = 0; bwd < 4; bwd++) { for (su = 0; su < 2; su++) { @@ -584,7 +622,7 @@ if (compareType (type, floatType) == 1) { - func = fp16x16conv[1][3][0]; + func = fp16x16conv[1][4][0]; goto found; } @@ -608,6 +646,8 @@ addiCodeToeBBlock (ebp, newic, ip); newic->filename = filename; newic->lineno = lineno; + if (IS_SYMOP (IC_RIGHT (ic))) + OP_USES (IC_RIGHT (ic)) = bitVectSetBit (OP_USES (IC_RIGHT (ic)), newic->key); } else { @@ -626,6 +666,8 @@ addiCodeToeBBlock (ebp, newic, ip); newic->filename = filename; newic->lineno = lineno; + if (IS_SYMOP (IC_RIGHT (ic))) + OP_USES (IC_RIGHT (ic)) = bitVectSetBit (OP_USES (IC_RIGHT (ic)), newic->key); } /* make the call */ @@ -654,6 +696,8 @@ addiCodeToeBBlock (ebp, newic, ip); newic->filename = filename; newic->lineno = lineno; + if (IS_SYMOP (IC_RESULT (ic))) + OP_DEFS (IC_RESULT (ic)) = bitVectSetBit (OP_DEFS (IC_RESULT (ic)), newic->key); } extern operand *geniCodeRValue (operand *, bool); @@ -673,11 +717,21 @@ int bwd; int su; int bytesPushed=0; + operand *left; + operand *right; sym_link *leftType = operandType (IC_LEFT (ic)); sym_link *rightType = operandType (IC_RIGHT (ic)); remiCodeFromeBBlock (ebp, ic); + left = IC_LEFT (ic); + right = IC_RIGHT (ic); + + if (IS_SYMOP (left)) + bitVectUnSetBit (OP_USES (left), ic->key); + if (IS_SYMOP (right)) + bitVectUnSetBit (OP_USES (right), ic->key); + if (getSize (leftType) == 1 && getSize (rightType) == 1) { int muldivmod; @@ -703,7 +757,7 @@ } /* depending on the type */ - for (bwd = 0; bwd < 3; bwd++) + for (bwd = 0; bwd < 4; bwd++) { for (su = 0; su < 2; su++) { @@ -737,7 +791,7 @@ } } } - werror (E_INVALID_OP); + werrorfl (filename, lineno, E_INVALID_OP, ""); return; found: /* if int & long support routines NOT compiled as reentrant */ @@ -757,6 +811,8 @@ addiCodeToeBBlock (ebp, newic, ip); newic->filename = filename; newic->lineno = lineno; + if (IS_SYMOP (left)) + OP_USES (left) = bitVectSetBit (OP_USES (left), newic->key); /* second one */ if (IS_REGPARM (FUNC_ARGS(func->type)->next->etype)) @@ -772,6 +828,8 @@ addiCodeToeBBlock (ebp, newic, ip); newic->filename = filename; newic->lineno = lineno; + if (IS_SYMOP (right)) + OP_USES (right) = bitVectSetBit (OP_USES (right), newic->key); } else { @@ -792,6 +850,8 @@ addiCodeToeBBlock (ebp, newic, ip); newic->filename = filename; newic->lineno = lineno; + if (IS_SYMOP (right)) + OP_USES (right) = bitVectSetBit (OP_USES (right), newic->key); /* insert push left */ if (IS_REGPARM (FUNC_ARGS(func->type)->etype)) @@ -809,11 +869,15 @@ addiCodeToeBBlock (ebp, newic, ip); newic->filename = filename; newic->lineno = lineno; + if (IS_SYMOP (left)) + OP_USES (left) = bitVectSetBit (OP_USES (left), newic->key); } /* for the result */ newic = newiCode (CALL, operandFromSymbol (func), NULL); IC_RESULT (newic) = IC_RESULT (ic); + bitVectUnSetBit (OP_DEFS (IC_RESULT (ic)), ic->key); + OP_DEFS (IC_RESULT (newic)) = bitVectSetBit (OP_DEFS (IC_RESULT (newic)), newic->key); newic->filename = filename; newic->lineno = lineno; newic->parmBytes+=bytesPushed; // to clear the stack after the call @@ -870,7 +934,7 @@ /* Now we can be sure to have found a builtin function. */ - if ((TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_R2K) && (!strcmp (bif->name, "__builtin_memcpy") || !strcmp (bif->name, "__builtin_memset"))) + if ((TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_RABBIT) && (!strcmp (bif->name, "__builtin_memcpy") || !strcmp (bif->name, "__builtin_memset"))) { /* Replace iff return value is used or last parameter is not an integer constant. */ if (bitVectIsZero (OP_USES (IC_RESULT (icc))) && IS_OP_LITERAL (IC_LEFT (lastparam))) @@ -916,31 +980,32 @@ static void convsmallc (iCode *ic, eBBlock *ebp) { - iCode *icc, *icp, *ico; + iCode *icc, *icp, *ico = NULL; assert (ic->op == CALL || ic->op == PCALL); - for(icc = ic->prev; icc && icc->op == IPUSH; icc = icc->prev); + for (icc = ic->prev; icc && icc->op == IPUSH; icc = icc->prev) + ; icp = icc; ic = icp->next; /* Reverse parameters. */ for (icc = ic; icc->op != CALL && icc->op != PCALL; icc = icc->next) { - if(icc->next->op != CALL && icc->next->op != PCALL) + if (icc->next->op != CALL && icc->next->op != PCALL) icc->prev = icc->next; else icc->prev = icp; } - if(icc != ic) + if (icc != ic) { - if(icp) + if (icp) icp->next = icc->prev; icc->prev = ic; } - for(; icc != icp; ico = icc, icc = icc->prev) + for (; icc != icp; ico = icc, icc = icc->prev) { - if(icc->op != CALL && icc->op != PCALL) + if (icc->op != CALL && icc->op != PCALL) icc->next = ico; } } @@ -1108,7 +1173,7 @@ case LE_OP: case '>': case GE_OP: - /* Only if the the right operand is literal and left operant is unsigned */ + /* Only if the the right operand is literal and left operand is unsigned */ if (isOperandLiteral (IC_RIGHT (ic)) && IS_UNSIGNED (operandType (IC_LEFT (ic)))) { unsigned litVal = ulFromVal (OP_VALUE (IC_RIGHT (ic))); @@ -1164,6 +1229,243 @@ } /*-----------------------------------------------------------------*/ +/* separateAddressSpaces - enforce restrictions on bank switching */ +/* Operands of a single iCode must be in at most one */ +/* named address space. Use temporaries and additional assignments */ +/* to enforce the rule. */ +/*-----------------------------------------------------------------*/ +static void +separateAddressSpaces (eBBlock ** ebbs, int count) +{ + + int i; + + /* for all blocks do */ + for (i = 0; i < count; ++i) + { + iCode *ic; + symbol *source; + + /* Skip this block if not reachable; other routines may have */ + /* also skipped it, so these iCodes may be undercooked. */ + if (ebbs[i]->noPath) + continue; + + /* for all instructions in the block do */ + for (ic = ebbs[i]->sch; ic; ic = ic->next) + { + iCode *iic = 0, *newic = 0; + operand *left, *right, *result; + const symbol *leftaddrspace = 0, *rightaddrspace = 0, *resultaddrspace = 0; + + /* JUMPTABLE and IFX do not have left/right/result operands. */ + /* However, they only have a single operand so they cannot */ + /* have more than one address space to worry about. */ + if (ic->op == JUMPTABLE || ic->op == IFX) + continue; + + left = IC_LEFT (ic); + right = IC_RIGHT (ic); + result = IC_RESULT (ic); + + /*printf ("Looking at ic %d, op %d\n", ic->key, (int)(ic->op));*/ + + if (left && IS_SYMOP (left)) + { + if (POINTER_GET (ic)) + { + assert (!(IS_DECL (OP_SYMBOL (left)->type) && DCL_PTR_ADDRSPACE (OP_SYMBOL (left)->type))); + leftaddrspace = getAddrspace (OP_SYMBOL (left)->type->next); + } + else + leftaddrspace = getAddrspace (OP_SYMBOL (left)->type); + } + if (right && IS_SYMOP (right)) + rightaddrspace = getAddrspace (OP_SYMBOL (right)->type); + if (result && IS_SYMOP (result)) + { + if (POINTER_SET (ic)) + { + assert (!(IS_DECL (OP_SYMBOL (result)->type) && DCL_PTR_ADDRSPACE (OP_SYMBOL (result)->type))); + resultaddrspace = getAddrspace (OP_SYMBOL (result)->type->next); + } + else + resultaddrspace = getAddrspace (OP_SYMBOL (result)->type); + } + +#if 0 + if (leftaddrspace) + printf("ic %d (dcl? %d) leftaddrspace %s\n", ic->key, (int)(IS_DECL (OP_SYMBOL (left)->type)), leftaddrspace->name); + if (rightaddrspace) + printf("ic %d (dcl? %d) rightaddrspace %s\n", ic->key, (int)(IS_DECL (OP_SYMBOL (right)->type)), rightaddrspace->name); + if (resultaddrspace) + printf("ic %d (dcl? %d) resultaddrspace %s\n", ic->key, (int)(IS_DECL (OP_SYMBOL (result)->type)), resultaddrspace->name); +#endif + + if (ic->op == IPUSH && leftaddrspace) + { + operand *newop; + + source = OP_SYMBOL (left); + newic = newiCode ('=', 0, left); + IC_RESULT (newic) = newop = newiTempOperand (source->type, 0); + IC_LEFT (ic) = newop; + leftaddrspace = 0; + for (iic = ic; iic->prev && iic->prev->op == IPUSH; iic = iic->prev); + } + else if (leftaddrspace && rightaddrspace && leftaddrspace != rightaddrspace) + { + operand *newop; + + if (rightaddrspace == resultaddrspace) + source = OP_SYMBOL (left); + else + source = OP_SYMBOL (right); + newic = newiCode ('=', 0, rightaddrspace == resultaddrspace ? left : right); + IC_RESULT (newic) = newop = newiTempOperand (source->type, 0); + if (rightaddrspace == resultaddrspace) + { + IC_LEFT (ic) = newop; + leftaddrspace = 0; + } + else + { + IC_RIGHT (ic) = newop; + rightaddrspace = 0; + } + iic = ic; + } + + if (newic) + { + newic->filename = ic->filename; + newic->lineno = ic->lineno; + addiCodeToeBBlock (ebbs[i], newic, iic); + } + + assert (!leftaddrspace || !resultaddrspace || leftaddrspace == resultaddrspace); + assert (!rightaddrspace || !resultaddrspace || rightaddrspace == resultaddrspace); + } + } +} + +const symbol * +getAddrspaceiCode (const iCode *ic) +{ + operand *left, *right, *result; + const symbol *leftaddrspace = 0, *rightaddrspace = 0, *resultaddrspace = 0; + const symbol *addrspace; + + /* Not safe to use IC_LEFT, IC_RIGHT, or IC_RESULT macros on */ + /* IFX or JUMPTABLE iCodes. Handle these as a special case. */ + if (ic->op == IFX || ic->op == JUMPTABLE) + { + operand *cond; + if (ic->op == IFX) + cond = IC_COND (ic); + else + cond = IC_JTCOND (ic); + if (IS_SYMOP (cond)) + return getAddrspace (OP_SYMBOL (cond)->type); + else + return NULL; + } + + left = IC_LEFT (ic); + right = IC_RIGHT (ic); + result = IC_RESULT (ic); + + /* Previous transformations in separateAddressSpaces() should + ensure that at most one addressspace occours in each iCode. */ + if (left && IS_SYMOP (left)) + { + if (POINTER_GET (ic)) + { + assert (!(IS_DECL (OP_SYMBOL (left)->type) && DCL_PTR_ADDRSPACE (OP_SYMBOL (left)->type))); + leftaddrspace = getAddrspace (OP_SYMBOL (left)->type->next); + } + else + leftaddrspace = getAddrspace (OP_SYMBOL (left)->type); + } + if (right && IS_SYMOP (right)) + rightaddrspace = getAddrspace (OP_SYMBOL (right)->type); + if (result && IS_SYMOP (result)) + { + if (POINTER_SET (ic)) + { + assert (!(IS_DECL (OP_SYMBOL (result)->type) && DCL_PTR_ADDRSPACE (OP_SYMBOL (result)->type))); + resultaddrspace = getAddrspace (OP_SYMBOL (result)->type->next); + } + else + resultaddrspace = getAddrspace (OP_SYMBOL (result)->type); + } + + addrspace = leftaddrspace; + if (rightaddrspace) + { + wassertl (!addrspace || addrspace == rightaddrspace, "Multiple named address spaces in icode."); + addrspace = rightaddrspace; + } + if (resultaddrspace) + { + wassertl (!addrspace || addrspace == resultaddrspace, "Multiple named address spaces in icode."); + addrspace = resultaddrspace; + } + + return (addrspace); +} + +/*-----------------------------------------------------------------*/ +/* switchAddressSpaceAt - insert a bank selection instruction */ +/*-----------------------------------------------------------------*/ +void +switchAddressSpaceAt (iCode *ic, const symbol *const addrspace) +{ + iCode *newic; + const symbol *const laddrspace = getAddrspaceiCode (ic); + wassertl(!laddrspace || laddrspace == addrspace, "Switching to invalid address space."); + + newic = newiCode (CALL, operandFromSymbol (addrspace->addressmod[0]), 0); + + IC_RESULT (newic) = newiTempOperand (newVoidLink (), 1); + newic->filename = ic->filename; + newic->lineno = ic->lineno; + + newic->next = ic; + newic->prev = ic->prev; + if (ic->prev) + ic->prev->next = newic; + ic->prev = newic; +} + +/*-----------------------------------------------------------------*/ +/* switchAddressSpaces - insert instructions for bank switching */ +/* This is just a fallback, in case the optimal approach fails - */ +/* improbable, but possible depending on sdcc options and code. */ +/*-----------------------------------------------------------------*/ +static void +switchAddressSpaces (iCode *ic) +{ + const symbol *oldaddrspace = 0; + + for (; ic; ic = ic->next) + { + const symbol *const addrspace = getAddrspaceiCode (ic); + + if (addrspace && addrspace != oldaddrspace) + { + switchAddressSpaceAt (ic, addrspace); + + oldaddrspace = addrspace; + } + + /* Address space might not be preserved over these. */ + if (ic->op == LABEL || ic->op == CALL || ic->op == PCALL) + oldaddrspace = 0; + } +} + +/*-----------------------------------------------------------------*/ /* isLocalWithoutDef - return 1 if sym might be used without a */ /* defining iCode */ /*-----------------------------------------------------------------*/ @@ -1207,6 +1509,9 @@ for (i = 0; i < count; i++) { iCode *ic; + + if (ebbs[i]->noPath) + continue; for (ic = ebbs[i]->sch; ic; ic = ic->next) { @@ -1428,6 +1733,10 @@ if (IC_RESULT (ic) && POINTER_SET (ic)) continue; + /* if the results address has been taken then skip */ + if (IS_SYMOP (IC_RESULT (ic)) && OP_SYMBOL (IC_RESULT (ic))->addrtaken) + continue; + if (POINTER_GET (ic) && IS_VOLATILE (operandType (IC_LEFT (ic))->next) && !SPIL_LOC (IC_RESULT (ic))) continue; @@ -1639,6 +1948,7 @@ sym_link * type2; sym_link * type3; symbol * sym; + int size1, size2, size3; for (i = 0; i < count; i++) { @@ -1653,7 +1963,12 @@ /* integer type that has no loss of bits */ if (!IS_INTEGRAL (type1) || !IS_INTEGRAL (type2)) continue; - if (getSize (type2) < getSize (type1)) + size1 = bitsForType (type1); + size2 = bitsForType (type2); + if (size2 < size1) + continue; + /* If they are the same size, they must have the same signedness */ + if (size2 == size1 && SPEC_USIGN (type2) != SPEC_USIGN (type1)) continue; /* There must be only one use of this first result */ @@ -1671,8 +1986,12 @@ type3 = operandType (IC_RESULT (uic)); if (!IS_INTEGRAL (type3)) continue; - if (getSize (type3) < getSize (type2)) + size3 = bitsForType (type3); + if (size3 < size2) continue; + /* If they are the same size, they must have the same signedness */ + if (size3 == size2 && SPEC_USIGN (type3) != SPEC_USIGN (type2)) + continue; /* The signedness between the first and last types */ /* must match */ @@ -1695,6 +2014,55 @@ } } +/* Fold pointer addition into offset of GET_VALUE_AT_ADDRESS. */ +/* The hc08-related ports do a similar thing in hc08/ralloc.c, packPointerOp() */ +static void +offsetFold (eBBlock **ebbs, int count) +{ + int i; + iCode *ic; + iCode *uic; + + if (!TARGET_IS_Z80 && !TARGET_IS_Z180 && !TARGET_IS_RABBIT) + return; + + for (i = 0; i < count; i++) + { + for (ic = ebbs[i]->sch; ic; ic = ic->next) + { + if ((ic->op == '+' || ic->op == '-') && IC_RESULT (ic) && IS_ITEMP (IC_RESULT (ic))) + { + if (!IS_OP_LITERAL (IC_RIGHT (ic))) + continue; + + /* There must be only one use of the result */ + if (bitVectnBitsOn (OP_USES (IC_RESULT (ic))) != 1) + continue; + + /* This use must be a GET_VALUE_ATA_DDRESS */ + uic = hTabItemWithKey (iCodehTab, + bitVectFirstBit (OP_USES (IC_RESULT (ic)))); + if (!POINTER_GET (uic)) + continue; + + /* Historically GET_VALUE_AT_ADDRESS didn't have a right operand */ + wassertl (IC_RIGHT (uic), "GET_VALUE_AT_ADDRESS without right operand"); + wassertl (IS_OP_LITERAL (IC_RIGHT (uic)), "GET_VALUE_AT_ADDRESS with non-literal right operand"); + + if (ic->op == '+') + IC_RIGHT (uic) = operandFromLit (operandLitValue (IC_RIGHT (uic)) + operandLitValue (IC_RIGHT (ic))); + else + IC_RIGHT (uic) = operandFromLit (operandLitValue (IC_RIGHT (uic)) - operandLitValue (IC_RIGHT (ic))); + + ic->op = '='; + IC_RIGHT (ic) = IC_LEFT (ic); + IC_LEFT (ic) = 0; + SET_ISADDR (IC_RESULT (ic), 0); + } + } + } +} + /*-----------------------------------------------------------------*/ /* eBBlockFromiCode - creates extended basic blocks from iCode */ /* will return an array of eBBlock pointers */ @@ -1721,7 +2089,6 @@ /* break it down into basic blocks */ ebbi = iCodeBreakDown (ic); - /* hash the iCode keys so that we can quickly index */ /* them in the rest of the optimization steps */ setToNull ((void *) &iCodehTab); @@ -1730,7 +2097,7 @@ /* compute the control flow */ computeControlFlow (ebbi); - + /* dumpraw if asked for */ if (options.dump_raw) dumpEbbsToFileExt (DUMP_RAW0, ebbi); @@ -1781,6 +2148,8 @@ // compute the dataflow only assert(cseAllBlocks (ebbi, TRUE)==0); } + + /* kill dead code */ kchange = killDeadCode (ebbi); @@ -1816,9 +2185,29 @@ dumpEbbsToFileExt (DUMP_LOOPD, ebbi); } + offsetFold (ebbi->bbOrder, ebbi->count); + /* sort it back by block number */ //qsort (ebbs, saveCount, sizeof (eBBlock *), bbNumCompare); + /* enforce restrictions on acesses to named address spaces */ + separateAddressSpaces (ebbi->bbOrder, ebbi->count); + + /* insert bank switching instructions. Do it here, before the + other support routines, since we can assume that there is no + bank switching happening in those other support routines + (but assume that it can happen in other functions) */ + adjustIChain(ebbi->bbOrder, ebbi->count); + ic = iCodeLabelOptimize (iCodeFromeBBlock (ebbi->bbOrder, ebbi->count)); + if(switchAddressSpacesOptimally (ic, ebbi)) + switchAddressSpaces (ic); /* Fallback. Very unlikely to be triggered, unless --max-allocs-per-node is set to very small values or very weird control-flow graphs */ + + /* Break down again and redo some steps to not confuse live range analysis. */ + ebbi = iCodeBreakDown (ic); + computeControlFlow (ebbi); + loops = createLoopRegions (ebbi); + computeDataFlow (ebbi); + if (!options.lessPedantic) { // this is a good place to check missing return values diff -Nru sdcc-3.1.0+dfsg/src/SDCCopt.h sdcc-3.2.0+dfsg/src/SDCCopt.h --- sdcc-3.1.0+dfsg/src/SDCCopt.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCopt.h 2012-01-19 13:14:56.000000000 +0000 @@ -33,5 +33,8 @@ void printEbbs (eBBlock **); iCode *iCodeLabelOptimize (iCode *); eBBlock *iCode2eBBlock (iCode * ic); +int switchAddressSpacesOptimally (iCode *ic, ebbIndex *ebbi); +const symbol *getAddrspaceiCode (const iCode *ic); +void switchAddressSpaceAt (iCode *ic, const symbol *const addrspace); #endif diff -Nru sdcc-3.1.0+dfsg/src/SDCCpeeph.c sdcc-3.2.0+dfsg/src/SDCCpeeph.c --- sdcc-3.1.0+dfsg/src/SDCCpeeph.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCpeeph.c 2012-05-21 04:40:48.000000000 +0000 @@ -2,25 +2,21 @@ SDCCpeeph.c - The peep hole optimizer: for interpreting the peep hole rules - Written By - Sandeep Dutta . sandeep.dutta@usa.net (1999) + Copyright (C) 1999, Sandeep Dutta . sandeep.dutta@usa.net - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -------------------------------------------------------------------------*/ #include "common.h" @@ -312,7 +308,7 @@ ; retInst = "ret"; - if (TARGET_IS_HC08) + if (TARGET_HC08_LIKE) retInst = "rts"; if (strcmp(p, retInst) == 0) return TRUE; @@ -367,8 +363,11 @@ if (TARGET_MCS51_LIKE) jpInst = "ljmp"; - if (TARGET_IS_HC08) - jpInst = "jmp"; + if (TARGET_HC08_LIKE) + { + jpInst = "jmp"; + jpInst2 = "bra"; + } if (TARGET_Z80_LIKE) { jpInst = "jp"; @@ -907,6 +906,19 @@ if (op[0] == '@') return operandBaseName(op+1); } + if (TARGET_Z80_LIKE) + { + if (!strcmp (op, "d") || !strcmp (op, "e") || !strcmp (op, "(de)")) + return "de"; + if (!strcmp (op, "b") || !strcmp (op, "c") || !strcmp (op, "(bc)")) + return "bc"; + if (!strcmp (op, "h") || !strcmp (op, "l") || !strcmp (op, "(hl)") || !strcmp (op, "(hl+)") || !strcmp (op, "(hl-)")) + return "hl"; + if (!strcmp (op, "iyh") || !strcmp (op, "iyl") || strstr (op, "iy")) + return "iy"; + if (!strcmp (op, "ixh") || !strcmp (op, "ixl") || strstr (op, "ix")) + return "ix"; + } return op; } @@ -917,6 +929,8 @@ FBYNAME (notUsed) { const char *what; + bool ret; + set *operands = setFromConditionArgs (cmdLine, vars); if (!operands || elementsInSet(operands) != 1) @@ -929,11 +943,17 @@ what = setFirstItem (operands); - if (port->peep.notUsed) - return port->peep.notUsed (what, endPl, head); + if (!port->peep.notUsed) + { + fprintf (stderr, "Function notUsed not initialized in port structure\n"); + return FALSE; + } - fprintf (stderr, "Function notUsed not initialized in port structure\n"); - return FALSE; + ret = port->peep.notUsed (what, endPl, head); + + deleteSet(&operands); + + return (ret); } /*-----------------------------------------------------------------*/ @@ -1103,7 +1123,7 @@ for (op = setFirstItem (operands); op; op = setNextItem (operands)) { - if (!isdigit(*op)) + if (!isdigit( (unsigned char)(*op) )) { deleteSet (&operands); return FALSE; @@ -1285,45 +1305,6 @@ } /*-----------------------------------------------------------------*/ -/* printLine - prints a line chain into a given file */ -/*-----------------------------------------------------------------*/ -void -printLine (lineNode * head, struct dbuf_s * oBuf) -{ - iCode *last_ic = NULL; - bool debug_iCode_tracking = (getenv("DEBUG_ICODE_TRACKING")!=NULL); - - while (head) - { - if (head->ic!=last_ic) - { - last_ic = head->ic; - if (debug_iCode_tracking) - { - if (head->ic) - dbuf_printf (oBuf, "; block = %d, seq = %d\n", - head->ic->block, head->ic->seq); - else - dbuf_append_str (oBuf, "; iCode lost\n"); - } - } - - /* don't indent comments & labels */ - if (head->line && - (head->isComment || head->isLabel)) { - dbuf_printf (oBuf, "%s\n", head->line); - } else { - if (head->isInline && *head->line=='#') { - // comment out preprocessor directives in inline asm - dbuf_append_char (oBuf, ';'); - } - dbuf_printf (oBuf, "\t%s\n", head->line); - } - head = head->next; - } -} - -/*-----------------------------------------------------------------*/ /* newPeepRule - creates a new peeprule and attach it to the root */ /*-----------------------------------------------------------------*/ static peepRule * @@ -1359,38 +1340,6 @@ return pr; } -/*-----------------------------------------------------------------*/ -/* newLineNode - creates a new peep line */ -/*-----------------------------------------------------------------*/ -lineNode * -newLineNode (const char *line) -{ - lineNode *pl; - - pl = Safe_alloc ( sizeof (lineNode)); - pl->line = Safe_strdup (line); - pl->ic = NULL; - return pl; -} - -/*-----------------------------------------------------------------*/ -/* connectLine - connects two lines */ -/*-----------------------------------------------------------------*/ -lineNode * -connectLine (lineNode * pl1, lineNode * pl2) -{ - if (!pl1 || !pl2) - { - fprintf (stderr, "trying to connect null line\n"); - return NULL; - } - - pl2->prev = pl1; - pl1->next = pl2; - - return pl2; -} - #define SKIP_SPACE(x,y) { while (*x && (ISCHARSPACE(*x) || *x == '\n')) x++; \ if (!*x) { fprintf(stderr,y); return ; } } diff -Nru sdcc-3.1.0+dfsg/src/SDCCpeeph.h sdcc-3.2.0+dfsg/src/SDCCpeeph.h --- sdcc-3.1.0+dfsg/src/SDCCpeeph.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCpeeph.h 2012-03-30 20:01:27.000000000 +0000 @@ -2,49 +2,29 @@ SDCCpeeph.h - Header file for The peep hole optimizer: for interpreting the peep hole rules - Written By - Sandeep Dutta . sandeep.dutta@usa.net (1999) + Copyright (C) 1999, Sandeep Dutta . sandeep.dutta@usa.net - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -------------------------------------------------------------------------*/ #ifndef SDCCPEEPH_H #define SDCCPEEPH_H 1 -#define MAX_PATTERN_LEN 256 - -struct asmLineNode; /* defined in each port */ -struct lineNode; +#include "SDCCgen.h" -typedef struct lineNode - { - char *line; - iCode *ic; - unsigned int isInline:1; - unsigned int isComment:1; - unsigned int isDebug:1; - unsigned int isLabel:1; - unsigned int visited:1; - struct asmLineNode *aln; - struct lineNode *prev; - struct lineNode *next; - } -lineNode; +#define MAX_PATTERN_LEN 256 typedef struct peepRule { @@ -74,9 +54,6 @@ extern hTab *labelHash; labelHashEntry *getLabelRef (const char *label, lineNode *head); -void printLine (lineNode *, struct dbuf_s *); -lineNode *newLineNode (const char *); -lineNode *connectLine (lineNode *, lineNode *); void initPeepHole (void); void peepHole (lineNode **); diff -Nru sdcc-3.1.0+dfsg/src/SDCCralloc.hpp sdcc-3.2.0+dfsg/src/SDCCralloc.hpp --- sdcc-3.1.0+dfsg/src/SDCCralloc.hpp 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCralloc.hpp 2012-06-22 11:17:10.000000000 +0000 @@ -1,6 +1,6 @@ // Philipp Klaus Krause, philipp@informatik.uni-frankfurt.de, pkk@spth.de, 2010 - 2011 // -// (c) 2010-2011 Goethe-Universität Frankfurt +// (c) 2010-2012 Goethe-Universität Frankfurt // // 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 @@ -46,22 +46,9 @@ #include #include +#include "common.h" #include "SDCCtree_dec.hpp" -extern "C" -{ -#include "SDCCsymt.h" -#include "SDCCicode.h" -#include "SDCCBBlock.h" - -#include "z80.h" -#include "ralloc.h" - -iCode *ifxForOp (operand *op, const iCode *ic); // Todo: Move this port-dependency somewhere else! - -bool assignment_optimal; -} - #ifdef HAVE_STX_BTREE_SET_H #include #endif @@ -72,8 +59,14 @@ typedef short int var_t; typedef signed char reg_t; -// Todo: Move this port-dependency somewehere else? -#define NUM_REGS ((TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_RABBIT) ? (4 + (OPTRALLOC_A ? 1 : 0) + (OPTRALLOC_HL ? 2 : 0) + (OPTRALLOC_IY ? 2 : 0)) : (TARGET_IS_GBZ80 ? 3 : 0)) +#ifndef THIS_IS_THE_Z80_PORT_OR_WHATEVER +// Todo: Move this port-dependency somewehere else? Don't forget to adjust A_IDX in z80/ralloc.c when changing this for a z80-related port! +#define NUM_REGS ((TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_RABBIT) ? 9 : (TARGET_IS_GBZ80 ? 5 : ((TARGET_IS_HC08 || TARGET_IS_S08) ? 3 : 0))) +#else +bool iy_reserved(void); +#define NUM_REGS ((TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_RABBIT) ? (iy_reserved() ? 7 : 9) : (TARGET_IS_GBZ80 ? 5 : ((TARGET_IS_HC08 || TARGET_IS_S08) ? 3 : 0))) +#endif + // Upper bound on NUM_REGS #define MAX_NUM_REGS 9 @@ -201,8 +194,21 @@ operand_map_t operands; std::set alive; std::set dying; + +#ifdef DEBUG_SEGV + cfg_node(void); +#endif }; +#ifdef DEBUG_SEGV +// This only exists to track down #3506333 and #3475617. +bool default_constructor_of_cfg_node_called; +cfg_node::cfg_node(void) +{ + default_constructor_of_cfg_node_called = true; +} +#endif + struct con_node { int v; @@ -219,19 +225,26 @@ // Cost function. Port-specific. template -float instruction_cost(const assignment &a, unsigned short int i, const G_t &G, const I_t &I); +static float instruction_cost(const assignment &a, unsigned short int i, const G_t &G, const I_t &I); // For early removel of assignments that cannot be extended to valid assignments. Port-specific. template -bool assignment_hopeless(const assignment &a, unsigned short int i, const G_t &G, const I_t &I, const var_t lastvar); +static bool assignment_hopeless(const assignment &a, unsigned short int i, const G_t &G, const I_t &I, const var_t lastvar); // Rough cost estimate. Port-specific. template -float rough_cost_estimate(const assignment &a, unsigned short int i, const G_t &G, const I_t &I); +static float rough_cost_estimate(const assignment &a, unsigned short int i, const G_t &G, const I_t &I); // Avoid overwriting operands that are still needed by the result. Port-specific. -template void -add_operand_conflicts_in_node(const cfg_node &n, I_t &I); +template +static void add_operand_conflicts_in_node(const cfg_node &n, I_t &I); + +// Port-specific +template +static void get_best_local_assignment_biased(assignment &a, typename boost::graph_traits::vertex_descriptor t, const T_t &T); + +// Code for anotehr ic is generated when generating this one. Mark the other as generated. Port-specific. +static void extra_ic_generated(const iCode *ic); inline void add_operand_to_cfg_node(cfg_node &n, operand *o, std::map, var_t> &sym_to_index) @@ -261,9 +274,18 @@ { int i; var_t j; + wassertl (!boost::num_vertices(cfg), "CFG non-empty before creation."); for (ic = start_ic, i = 0, j = 0; ic; ic = ic->next, i++) { +#ifdef DEBUG_SEGV + default_constructor_of_cfg_node_called = false; +#endif boost::add_vertex(cfg); + +#ifdef DEBUG_SEGV + wassertl (default_constructor_of_cfg_node_called, "add_vertex failed to call default constructor of cfg_node!"); +#endif + wassertl (cfg[i].alive.empty(), "Alive set non-empty upon creation."); key_to_index[ic->key] = i; if(ic->op == SEND && ic->builtinSEND) // Ensure that only the very first send iCode is active. @@ -273,12 +295,7 @@ getBuiltinParms(ic, &nbi_parms, bi_parms); } - if(ic->op == '>' || ic->op == '<' || ic->op == EQ_OP || ic->op == '^' || ic->op == '|' || ic->op == BITWISEAND) - { - iCode *ifx; - if (ifx = ifxForOp (IC_RESULT (ic), ic)) - ifx->generated = 1; - } + extra_ic_generated(ic); cfg[i].ic = ic; @@ -316,18 +333,35 @@ // Get control flow graph from sdcc. for (ic = start_ic; ic; ic = ic->next) { + wassertl (key_to_index[ic->key] < boost::num_vertices(cfg), "Node not in CFG."); + if (ic->op != GOTO && ic->op != RETURN && ic->op != JUMPTABLE && ic->next) - boost::add_edge(key_to_index[ic->key], key_to_index[ic->next->key], cfg); + { + wassertl (key_to_index[ic->next->key] < boost::num_vertices(cfg), "Next node not in CFG."); + boost::add_edge(key_to_index[ic->key], key_to_index[ic->next->key], cfg); + } if (ic->op == GOTO) - boost::add_edge(key_to_index[ic->key], key_to_index[eBBWithEntryLabel(ebbi, ic->label)->sch->key], cfg); + { + wassertl (key_to_index[eBBWithEntryLabel(ebbi, ic->label)->sch->key] < boost::num_vertices(cfg), "GOTO target not in CFG."); + boost::add_edge(key_to_index[ic->key], key_to_index[eBBWithEntryLabel(ebbi, ic->label)->sch->key], cfg); + } else if (ic->op == RETURN) - boost::add_edge(key_to_index[ic->key], key_to_index[eBBWithEntryLabel(ebbi, returnLabel)->sch->key], cfg); + { + wassertl (key_to_index[eBBWithEntryLabel(ebbi, returnLabel)->sch->key] < boost::num_vertices(cfg), "RETURN target not in CFG."); + boost::add_edge(key_to_index[ic->key], key_to_index[eBBWithEntryLabel(ebbi, returnLabel)->sch->key], cfg); + } else if (ic->op == IFX) - boost::add_edge(key_to_index[ic->key], key_to_index[eBBWithEntryLabel(ebbi, IC_TRUE(ic) ? IC_TRUE(ic) : IC_FALSE(ic))->sch->key], cfg); + { + wassertl (key_to_index[eBBWithEntryLabel(ebbi, IC_TRUE(ic) ? IC_TRUE(ic) : IC_FALSE(ic))->sch->key] < boost::num_vertices(cfg), "IFX target not in CFG."); + boost::add_edge(key_to_index[ic->key], key_to_index[eBBWithEntryLabel(ebbi, IC_TRUE(ic) ? IC_TRUE(ic) : IC_FALSE(ic))->sch->key], cfg); + } else if (ic->op == JUMPTABLE) for (symbol *lbl = (symbol *)(setFirstItem (IC_JTLABELS (ic))); lbl; lbl = (symbol *)(setNextItem (IC_JTLABELS (ic)))) - boost::add_edge(key_to_index[ic->key], key_to_index[eBBWithEntryLabel(ebbi, lbl)->sch->key], cfg); + { + wassertl (key_to_index[eBBWithEntryLabel(ebbi, lbl)->sch->key] < boost::num_vertices(cfg), "GOTO target not in CFG."); + boost::add_edge(key_to_index[ic->key], key_to_index[eBBWithEntryLabel(ebbi, lbl)->sch->key], cfg); + } for (int i = 0; i <= operandKey; i++) { @@ -338,14 +372,26 @@ { symbol *isym = (symbol *)(hTabItemWithKey(liveRanges, i)); for (reg_t k = 0; k < isym->nRegs; k++) - cfg[key_to_index[ic->key]].alive.insert(sym_to_index[std::pair(i, k)]); + { + wassert (key_to_index.find(ic->key) != key_to_index.end()); + wassert (sym_to_index.find(std::pair(i, k)) != sym_to_index.end()); + wassertl (key_to_index[ic->key] < boost::num_vertices(cfg), "Node not in CFG."); + cfg[key_to_index[ic->key]].alive.insert(sym_to_index[std::pair(i, k)]); + } } } - add_operand_to_cfg_node(cfg[key_to_index[ic->key]], IC_RESULT(ic), sym_to_index); - add_operand_to_cfg_node(cfg[key_to_index[ic->key]], IC_LEFT(ic), sym_to_index); - add_operand_to_cfg_node(cfg[key_to_index[ic->key]], IC_RIGHT(ic), sym_to_index); - + if (ic->op == IFX) + add_operand_to_cfg_node(cfg[key_to_index[ic->key]], IC_COND(ic), sym_to_index); + else if (ic->op == JUMPTABLE) + add_operand_to_cfg_node(cfg[key_to_index[ic->key]], IC_JTCOND(ic), sym_to_index); + else + { + add_operand_to_cfg_node(cfg[key_to_index[ic->key]], IC_RESULT(ic), sym_to_index); + add_operand_to_cfg_node(cfg[key_to_index[ic->key]], IC_LEFT(ic), sym_to_index); + add_operand_to_cfg_node(cfg[key_to_index[ic->key]], IC_RIGHT(ic), sym_to_index); + } + add_operand_conflicts_in_node(cfg[key_to_index[ic->key]], con); } @@ -434,7 +480,7 @@ // Conflict between operands are handled by add_operand_conflicts_in_node(). if (cfg[i].dying.find (*v) != cfg[i].dying.end()) continue; - if (IC_RESULT(ic) && IS_SYMOP(IC_RESULT(ic))) + if (ic->op != IFX && ic->op != JUMPTABLE && IC_RESULT(ic) && IS_SYMOP(IC_RESULT(ic))) { operand_map_t::const_iterator oi, oi_end; for(boost::tie(oi, oi_end) = cfg[i].operands.equal_range(OP_SYMBOL_CONST(IC_RESULT(ic))->key); oi != oi_end; ++oi) @@ -516,7 +562,7 @@ } template -void assignments_introduce_variable(assignment_list_t &alist, unsigned short int i, short int v, const G_t &G, const I_t &I) +static void assignments_introduce_variable(assignment_list_t &alist, unsigned short int i, short int v, const G_t &G, const I_t &I) { assignment_list_t::iterator ai; bool a_initialized; @@ -592,7 +638,7 @@ // Ensure that we never get more than options.max_allocs_per_node assignments at a single node of the tree decomposition. // Tries to drop the worst ones first (but never drop the empty assignment, as it's the only one guaranteed to be always valid). template -void drop_worst_assignments(assignment_list_t &alist, unsigned short int i, const G_t &G, const I_t &I, const assignment& ac) +static void drop_worst_assignments(assignment_list_t &alist, unsigned short int i, const G_t &G, const I_t &I, const assignment& ac, bool *const assignment_optimal) { unsigned int n; size_t alist_size; @@ -601,7 +647,7 @@ if ((alist_size = alist.size()) * NUM_REGS <= static_cast(options.max_allocs_per_node) || alist_size <= 1) return; - assignment_optimal = false; + *assignment_optimal = false; #ifdef DEBUG_RALLOC_DEC std::cout << "Too many assignments here (" << i << "):" << alist_size << " > " << options.max_allocs_per_node / NUM_REGS << ". Dropping some.\n"; std::cout.flush(); @@ -627,7 +673,7 @@ // Handle Leaf nodes in the nice tree decomposition template -void tree_dec_ralloc_leaf(T_t &T, typename boost::graph_traits::vertex_descriptor t, const G_t &G, const I_t &I) +static void tree_dec_ralloc_leaf(T_t &T, typename boost::graph_traits::vertex_descriptor t, const G_t &G, const I_t &I) { #ifdef DEBUG_RALLOC_DEC std::cout << "Leaf (" << t << "):\n"; std::cout.flush(); @@ -652,7 +698,7 @@ // Handle introduce nodes in the nice tree decomposition template -void tree_dec_ralloc_introduce(T_t &T, typename boost::graph_traits::vertex_descriptor t, const G_t &G, const I_t &I, const assignment& ac) +static void tree_dec_ralloc_introduce(T_t &T, typename boost::graph_traits::vertex_descriptor t, const G_t &G, const I_t &I, const assignment& ac, bool *const assignment_optimal) { typedef typename boost::graph_traits::adjacency_iterator adjacency_iter_t; adjacency_iter_t c, c_end; @@ -681,7 +727,7 @@ std::set::const_iterator v; for (v = new_vars.begin(); v != new_vars.end(); ++v) { - drop_worst_assignments(alist, i, G, I, ac); + drop_worst_assignments(alist, i, G, I, ac, assignment_optimal); assignments_introduce_variable(alist, i, *v, G, I); } @@ -706,7 +752,7 @@ #endif } -bool assignments_locally_same(const assignment &a1, const assignment &a2) +static bool assignments_locally_same(const assignment &a1, const assignment &a2) { if (a1.local != a2.local) return(false); @@ -721,7 +767,7 @@ // Handle forget nodes in the nice tree decomposition template -void tree_dec_ralloc_forget(T_t &T, typename boost::graph_traits::vertex_descriptor t, const G_t &G, const I_t &I) +static void tree_dec_ralloc_forget(T_t &T, typename boost::graph_traits::vertex_descriptor t, const G_t &G, const I_t &I) { typedef typename boost::graph_traits::adjacency_iterator adjacency_iter_t; adjacency_iter_t c, c_end; @@ -800,7 +846,7 @@ // Handle join nodes in the nice tree decomposition template -void tree_dec_ralloc_join(T_t &T, typename boost::graph_traits::vertex_descriptor t, const G_t &G, const I_t &I) +static void tree_dec_ralloc_join(T_t &T, typename boost::graph_traits::vertex_descriptor t, const G_t &G, const I_t &I) { typedef typename boost::graph_traits::adjacency_iterator adjacency_iter_t; adjacency_iter_t c, c_end, c2, c3; @@ -879,18 +925,14 @@ a = *ai_best; } -template -void get_best_local_assignment_biased(assignment &a, typename boost::graph_traits::vertex_descriptor t, const T_t &T); - // Handle nodes in the tree decomposition, by detecting their type and calling the appropriate function. Recurses. template -void tree_dec_ralloc_nodes(T_t &T, typename boost::graph_traits::vertex_descriptor t, const G_t &G, const I_t &I, const assignment& ac) +static void tree_dec_ralloc_nodes(T_t &T, typename boost::graph_traits::vertex_descriptor t, const G_t &G, const I_t &I, const assignment& ac, bool *const assignment_optimal) { typedef typename boost::graph_traits::adjacency_iterator adjacency_iter_t; adjacency_iter_t c, c_end; typename boost::graph_traits::vertex_descriptor c0, c1; - assignment ac2; boost::tie(c, c_end) = adjacent_vertices(t, T); @@ -901,15 +943,19 @@ break; case 1: c0 = *c; - tree_dec_ralloc_nodes(T, c0, G, I, ac); - T[c0].bag.size() < T[t].bag.size() ? tree_dec_ralloc_introduce(T, t, G, I, ac) : tree_dec_ralloc_forget(T, t, G, I); + tree_dec_ralloc_nodes(T, c0, G, I, ac, assignment_optimal); + T[c0].bag.size() < T[t].bag.size() ? tree_dec_ralloc_introduce(T, t, G, I, ac, assignment_optimal) : tree_dec_ralloc_forget(T, t, G, I); break; case 2: c0 = *c++; c1 = *c; - tree_dec_ralloc_nodes(T, c0, G, I, ac); - get_best_local_assignment_biased(ac2, c0, T); - tree_dec_ralloc_nodes(T, c1, G, I, ac2); + tree_dec_ralloc_nodes(T, c0, G, I, ac, assignment_optimal); + { + assignment *ac2 = new assignment; + get_best_local_assignment_biased(*ac2, c0, T); + tree_dec_ralloc_nodes(T, c1, G, I, *ac2, assignment_optimal); + delete ac2; + } tree_dec_ralloc_join(T, t, G, I); break; default: @@ -920,7 +966,7 @@ // Find the best root selecting from t_old and the leafs under t. template -std::pair::vertex_descriptor, size_t> find_best_root(const T_t &T, typename boost::graph_traits::vertex_descriptor t, size_t t_s, typename boost::graph_traits::vertex_descriptor t_old, size_t t_old_s) +static std::pair::vertex_descriptor, size_t> find_best_root(const T_t &T, typename boost::graph_traits::vertex_descriptor t, size_t t_s, typename boost::graph_traits::vertex_descriptor t_old, size_t t_old_s) { typedef typename boost::graph_traits::adjacency_iterator adjacency_iter_t; adjacency_iter_t c, c_end; @@ -951,7 +997,7 @@ // Change the root to t. template -void re_root(T_t &T, typename boost::graph_traits::vertex_descriptor t) +static void re_root(T_t &T, typename boost::graph_traits::vertex_descriptor t) { typename boost::graph_traits::vertex_descriptor s0, s1, s2; typename boost::graph_traits::in_edge_iterator e, e_end; @@ -977,7 +1023,7 @@ // Change the root to improve the assignment removal heuristic. template -void good_re_root(T_t &T) +static void good_re_root(T_t &T) { typename boost::graph_traits::vertex_descriptor t; @@ -1002,7 +1048,7 @@ } // Dump conflict graph, with numbered nodes, show live variables at each node. -void dump_con(const con_t &con) +static void dump_con(const con_t &con) { std::ofstream dump_file((std::string(dstFileName) + ".dumpcon" + currFunc->rname + ".dot").c_str()); @@ -1020,7 +1066,7 @@ } // Dump cfg, with numbered nodes, show live variables at each node. -void dump_cfg(const cfg_t &cfg) +static void dump_cfg(const cfg_t &cfg) { std::ofstream dump_file((std::string(dstFileName) + ".dumpcfg" + currFunc->rname + ".dot").c_str()); @@ -1039,7 +1085,7 @@ } // Dump tree decomposition, show bag and live variables at each node. -void dump_tree_decomposition(const tree_dec_t &tree_dec) +static void dump_tree_decomposition(const tree_dec_t &tree_dec) { std::ofstream dump_file((std::string(dstFileName) + ".dumpdec" + currFunc->rname + ".dot").c_str()); diff -Nru sdcc-3.1.0+dfsg/src/SDCCset.c sdcc-3.2.0+dfsg/src/SDCCset.c --- sdcc-3.1.0+dfsg/src/SDCCset.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCset.c 2012-05-05 16:16:42.000000000 +0000 @@ -154,6 +154,9 @@ { set *lp; + if (!list) + werror (E_INTERNAL_ERROR,__FILE__,__LINE__, "Invalid set."); + /* item added to the tail of the list */ /* if the list is empty */ diff -Nru sdcc-3.1.0+dfsg/src/SDCCsymt.c sdcc-3.2.0+dfsg/src/SDCCsymt.c --- sdcc-3.1.0+dfsg/src/SDCCsymt.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCsymt.c 2012-06-10 12:32:06.000000000 +0000 @@ -89,6 +89,7 @@ bucket *TypedefTab[256]; /* the typedef table */ bucket *LabelTab[256]; /* the Label table */ bucket *enumTab[256]; /* enumerated table */ +bucket *AddrspaceTab[256]; /* the named address space table */ /*------------------------------------------------------------------*/ /* initSymt () - initialises symbol table related stuff */ @@ -271,8 +272,9 @@ /* if levels match then block numbers should also match */ if (bp->level && bp->level == sym->level && bp->block == sym->block) return (bp->sym); - /* if levels don't match then we are okay */ - if (bp->level && bp->level != sym->level && bp->block <= sym->block) + /* if levels don't match then we are okay if the symbol is in scope */ + if (bp->level && bp->level != sym->level && bp->block <= sym->block + && ((symbol *) (bp->sym))->isinscope) return (bp->sym); /* if this is a global variable then we are ok too */ if (bp->level == 0) @@ -286,7 +288,7 @@ } /*-----------------------------------------------------------------*/ -/* findSymWithBlock - finds a symbol with name in with a block */ +/* findSymWithBlock - finds a symbol with name in a block */ /*-----------------------------------------------------------------*/ void * findSymWithBlock (bucket ** stab, symbol * sym, int block) @@ -320,6 +322,7 @@ sym->lineDef = lexLineno; /* set the line number */ sym->fileDef = lexFilename; sym->for_newralloc = 0; + sym->isinscope = 1; return sym; } @@ -692,7 +695,7 @@ if ((SPEC_SHORT (src) || SPEC_LONG (src) || SPEC_LONGLONG (src)) && (SPEC_SHORT (dest) || SPEC_LONG (dest) || SPEC_LONGLONG (dest))) { - if (!(options.std_c99 && SPEC_LONG (src) && SPEC_LONG (dest) && TARGET_Z80_LIKE)) /* C99 has long long */ + if (!(options.std_c99 && SPEC_LONG (src) && SPEC_LONG (dest) && (TARGET_Z80_LIKE || TARGET_HC08_LIKE))) /* C99 has long long */ werror (E_SHORTLONG, name); } @@ -742,6 +745,7 @@ SPEC_STAT (dest) |= SPEC_STAT (src); SPEC_EXTR (dest) |= SPEC_EXTR (src); SPEC_INLINE (dest) |= SPEC_INLINE (src); + SPEC_NORETURN (dest) |= SPEC_NORETURN(src); SPEC_CONST (dest) |= SPEC_CONST (src); SPEC_ABSA (dest) |= SPEC_ABSA (src); SPEC_VOLATILE (dest) |= SPEC_VOLATILE (src); @@ -772,6 +776,12 @@ FUNC_INTNO (dest) |= FUNC_INTNO (src); FUNC_REGBANK (dest) |= FUNC_REGBANK (src); FUNC_ISINLINE (dest) |= FUNC_ISINLINE (src); + FUNC_ISNORETURN (dest) |= FUNC_ISNORETURN (src); + + if (SPEC_ADDRSPACE (src) && SPEC_ADDRSPACE (dest)) + werror (E_TWO_OR_MORE_STORAGE_CLASSES, name); + if (SPEC_ADDRSPACE (src)) + SPEC_ADDRSPACE (dest) = SPEC_ADDRSPACE (src); return dest; } @@ -814,8 +824,14 @@ DCL_PTR_CONST (decl) |= SPEC_CONST (spec); DCL_PTR_VOLATILE (decl) |= SPEC_VOLATILE (spec); DCL_PTR_RESTRICT (decl) |= SPEC_RESTRICT (spec); + if (DCL_PTR_ADDRSPACE (decl) && SPEC_ADDRSPACE (spec) && + strcmp (DCL_PTR_ADDRSPACE (decl)->name, SPEC_ADDRSPACE (spec)->name)) + werror (E_SYNTAX_ERROR, yytext); + if (SPEC_ADDRSPACE (spec)) + DCL_PTR_ADDRSPACE (decl) = SPEC_ADDRSPACE (spec); SPEC_CONST (spec) = SPEC_VOLATILE (spec) = SPEC_RESTRICT (spec) = 0; + SPEC_ADDRSPACE (spec) = 0; lnk = decl; while (lnk && !IS_SPEC (lnk->next)) @@ -944,7 +960,24 @@ sym_link *p; p = newLink (SPECIFIER); - SPEC_NOUN (p) = V_BIT; + if (bit) + SPEC_NOUN (p) = V_BIT; + else + SPEC_NOUN (p) = V_BOOL; + + return p; +} + +/*------------------------------------------------------------------*/ +/* newVoidLink() - creates an void type */ +/*------------------------------------------------------------------*/ +sym_link * +newVoidLink () +{ + sym_link *p; + + p = newLink (SPECIFIER); + SPEC_NOUN (p) = V_VOID; return p; } @@ -999,8 +1032,6 @@ } else { - // werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - // "can not tell the size of an array[]"); return 0; } case IPOINTER: @@ -1079,7 +1110,6 @@ if (IS_SPEC (p)) { /* if this is the specifier then */ - switch (SPEC_NOUN (p)) { /* depending on the specifier type */ case V_INT: @@ -1125,7 +1155,6 @@ return (FPTRSIZE * 8); case GPOINTER: return (GPTRSIZE * 8); - default: return 0; } @@ -1238,6 +1267,12 @@ changePointer (sym->type); checkTypeSanity (sym->etype, sym->name); + if (IS_NORETURN (sym->etype)) + { + SPEC_NORETURN (sym->etype) = 0; + FUNC_ISNORETURN (sym->type) = 1; + } + if (!sym->level && !(IS_SPEC (sym->etype) && IS_TYPEDEF (sym->etype))) elemsFromIval = checkDecl (sym, 0); else @@ -1446,6 +1481,11 @@ int bitOffset = 0; symbol *loop; + if (!sdef->fields) + { + werror (E_UNKNOWN_SIZE, sdef->tag); + } + /* for the identifiers */ loop = sdef->fields; while (loop) @@ -1683,6 +1723,7 @@ werrorfl (sym->fileDef, sym->lineDef, E_BAD_RESTRICT); SPEC_RESTRICT (sym->etype) = 0; } + t = sym->type; while (t) { @@ -1732,7 +1773,7 @@ /* global variables declared const put into code */ /* if no other storage class specified */ - if (sym->level == 0 && SPEC_SCLS (sym->etype) == S_FIXED && !IS_FUNC (sym->type)) + if ((sym->level == 0 || SPEC_STAT(sym->etype)) && SPEC_SCLS (sym->etype) == S_FIXED && !IS_FUNC (sym->type)) { /* find the first non-array link */ t = sym->type; @@ -1743,7 +1784,7 @@ } /* global variable in code space is a constant */ - if (sym->level == 0 && SPEC_SCLS (sym->etype) == S_CODE && port->mem.code_ro) + if ((sym->level == 0 || SPEC_STAT(sym->etype)) && SPEC_SCLS (sym->etype) == S_CODE && port->mem.code_ro) { /* find the first non-array link */ t = sym->type; @@ -1760,8 +1801,15 @@ if (IS_BITVAR (sym->etype) && (SPEC_SCLS (sym->etype) != S_FIXED && SPEC_SCLS (sym->etype) != S_SBIT && SPEC_SCLS (sym->etype) != S_BIT)) { - werror (E_BITVAR_STORAGE, sym->name); - SPEC_SCLS (sym->etype) = S_FIXED; + /* find out if this is the return type of a function */ + t = sym->type; + while (t && t->next != sym->etype) + t = t->next; + if (t->next != sym->etype || !IS_FUNC (t)) + { + werror (E_BITVAR_STORAGE, sym->name); + SPEC_SCLS (sym->etype) = S_FIXED; + } } /* if this is an automatic symbol */ @@ -1794,14 +1842,31 @@ SPEC_ABSA (sym->etype) = 0; } + if (sym->level && !IS_STATIC (sym->etype) && (IS_DECL (sym->type) ? DCL_PTR_ADDRSPACE (sym->type) : SPEC_ADDRSPACE (sym->type)) && (options.stackAuto || reentrant)) + { + werror (E_AUTO_ADDRSPACE, sym->name); + if (IS_DECL (sym->type)) + DCL_PTR_ADDRSPACE (sym->type) = 0; + else + SPEC_ADDRSPACE (sym->type) = 0; + } + /* arrays & pointers cannot be defined for bits */ /* SBITS or SFRs or BIT */ if ((IS_ARRAY (sym->type) || IS_PTR (sym->type)) && - !IS_FUNCPTR (sym->type) && (SPEC_NOUN (sym->etype) == V_BIT || SPEC_NOUN (sym->etype) == V_SBIT || SPEC_NOUN (sym->etype) == V_BITFIELD || SPEC_NOUN (sym->etype) == V_BBITFIELD || SPEC_SCLS (sym->etype) == S_SFR)) - werror (E_BIT_ARRAY, sym->name); + { + /* find out if this is the return type of a function */ + t = sym->type; + while (t && t->next != sym->etype) + t = t->next; + if (t->next != sym->etype || !IS_FUNC (t)) + { + werror (E_BIT_ARRAY, sym->name); + } + } /* if this is a bit|sbit then set length & start */ if (SPEC_NOUN (sym->etype) == V_BIT || SPEC_NOUN (sym->etype) == V_SBIT) @@ -1828,15 +1893,6 @@ { SPEC_SCLS (sym->etype) = (options.useXstack ? S_XSTACK : S_STACK); } - else - { - /* hack-o-matic! I see no reason why the useXstack option should ever - * control this allocation, but the code was originally that way, and - * changing it for non-390 ports breaks the compiler badly. - */ - bool useXdata = (TARGET_IS_DS390 || TARGET_IS_DS400) ? 1 : options.useXstack; - SPEC_SCLS (sym->etype) = (useXdata ? S_XDATA : S_FIXED); - } } } @@ -1923,7 +1979,7 @@ } /*------------------------------------------------------------------*/ -/* cleanUpLevel - cleansup the symbol table specified for all the */ +/* cleanUpLevel - cleans up the symbol table specified for all the */ /* symbols in the given level */ /*------------------------------------------------------------------*/ void @@ -1945,6 +2001,14 @@ } } +symbol * +getAddrspace (sym_link *type) +{ + if (IS_DECL (type)) + return (DCL_PTR_ADDRSPACE (type)); + return (SPEC_ADDRSPACE (type)); +} + /*------------------------------------------------------------------*/ /* computeTypeOr - computes the resultant type from two types */ /*------------------------------------------------------------------*/ @@ -2043,12 +2107,12 @@ /* If NULL and another pointer, use the non-NULL pointer type. */ /* Note that NULL can be defined as either 0 or (void *)0. */ - if (IS_LITERAL (etype1) && + if (IS_LITERAL (etype1) && ((IS_PTR (type1) && IS_VOID (type1->next)) || IS_INTEGRAL (type1)) && (floatFromVal (valFromType (etype1)) == 0) && IS_PTR (type2)) return copyLinkChain (type2); - else if (IS_LITERAL (etype2) && + else if (IS_LITERAL (etype2) && ((IS_PTR (type2) && IS_VOID (type2->next)) || IS_INTEGRAL (type2)) && (floatFromVal (valFromType (etype2)) == 0) && IS_PTR (type1)) @@ -2062,7 +2126,7 @@ /* Otherwise fall through to the general case */ } - + /* if one of them is a pointer or array then that prevails */ if (IS_PTR (type1) || IS_ARRAY (type1)) @@ -2115,12 +2179,15 @@ /* if result is a literal then make not so */ if (IS_LITERAL (reType)) - SPEC_SCLS (reType) = S_REGISTER; + { + SPEC_SCLS (reType) = S_REGISTER; + SPEC_CONST (reType) = 0; + } switch (resultType) { case RESULT_TYPE_IFX: - if (TARGET_IS_HC08) + if (TARGET_HC08_LIKE) break; //fallthrough case RESULT_TYPE_BIT: @@ -2167,25 +2234,11 @@ /* promotion of some special cases */ switch (op) { - case ':': - /* mcs51, xa51 and ds390 do not really support _Bool yet */ - if (TARGET_IS_MCS51 || TARGET_IS_XA51 || TARGET_IS_DS390) - break; - /* Avoid unnecessary cast to _Bool if both operands are _Bool */ - if ((IS_BOOL (etype1) || (IS_LITERAL (etype1) && - (floatFromVal (valFromType (etype1)) == 1.0 || - floatFromVal (valFromType (etype1)) == 0.0))) && - (IS_BOOL (etype2) || (IS_LITERAL (etype2) && - (floatFromVal (valFromType (etype2)) == 1.0 || - floatFromVal (valFromType (etype2)) == 0.0)))) - { - SPEC_NOUN (reType) = V_BOOL; - } - break; case '|': case '^': return computeTypeOr (etype1, etype2, reType); case '&': + case BITWISEAND: if (SPEC_USIGN (etype1) != SPEC_USIGN (etype2)) { SPEC_USIGN (reType) = 1; @@ -2356,6 +2409,9 @@ { int res; + if (getAddrspace (src->next) != getAddrspace (dest->next)) + bMustCast = 1; + if (IS_VOID (src->next) && IS_VOID (dest->next)) return bMustCast ? -1 : 1; if ((IS_VOID (src->next) && !IS_VOID (dest->next)) || (!IS_VOID (src->next) && IS_VOID (dest->next))) @@ -2364,7 +2420,7 @@ if (res == 1) return bMustCast ? -1 : 1; else if (res == -2) - return -2; + return bMustCast ? -1 : -2; else return 0; } @@ -2465,13 +2521,13 @@ if (SPEC_NOUN (dest) != SPEC_NOUN (src)) { if ((SPEC_USIGN (dest) == SPEC_USIGN (src)) && - IS_INTEGRAL (dest) && IS_INTEGRAL (src) && + IS_INTEGRAL (dest) && IS_INTEGRAL (src) && /* I would prefer bitsForType (dest) == bitsForType (src)) instead of the next two lines, but the regression tests fail with them; I guess it's a problem with replaceCheaperOp */ (getSize (dest) == getSize (src)) && - (IS_BOOLEAN (dest) == IS_BOOLEAN (src))) + (IS_BOOLEAN (dest) == IS_BOOLEAN (src))) return 1; else if (IS_ARITHMETIC (dest) && IS_ARITHMETIC (src)) return -1; @@ -2780,12 +2836,17 @@ return 0; } - /* move inline specifier from return type to function attributes */ + /* move function specifier from return type to function attributes */ if (IS_INLINE (sym->etype)) { SPEC_INLINE (sym->etype) = 0; FUNC_ISINLINE (sym->type) = 1; } + if (IS_NORETURN (sym->etype)) + { + SPEC_NORETURN (sym->etype) = 0; + FUNC_ISNORETURN (sym->type) = 1; + } /* make sure the type is complete and sane */ checkTypeSanity (sym->etype, sym->name); @@ -2799,7 +2860,7 @@ sym->type->next = sym->etype = newIntLink (); /* function cannot return aggregate */ - if (IS_AGGREGATE (sym->type->next) || IS_LONGLONG (sym->type->next)) + if (IS_AGGREGATE (sym->type->next) || IS_LONGLONG (sym->type->next) && !(TARGET_Z80_LIKE || TARGET_HC08_LIKE)) { werror (E_FUNC_AGGR, sym->name); return 0; @@ -3291,7 +3352,7 @@ case ARRAY: if (DCL_ELEM (type)) { - dbuf_printf (dbuf, "[%d]", DCL_ELEM (type)); + dbuf_printf (dbuf, "[%ud]", (unsigned int) DCL_ELEM (type)); } else { @@ -3499,6 +3560,10 @@ { fprintf (of, "inline-"); } + if (IFFUNC_ISNORETURN (type)) + { + fprintf (of, "_Noreturn-"); + } fprintf (of, "function %s %s", (IFFUNC_ISBUILTIN (type) ? "__builtin__" : " "), (IFFUNC_ISJAVANATIVE (type) ? "_JavaNative" : " ")); fprintf (of, "( "); @@ -3537,7 +3602,7 @@ case ARRAY: if (DCL_ELEM (type)) { - fprintf (of, "[%d] ", DCL_ELEM (type)); + fprintf (of, "[%ud] ", (unsigned int) DCL_ELEM (type)); } else { @@ -3604,7 +3669,9 @@ switch (SPEC_NOUN (type)) { case V_INT: - if (IS_LONG (type)) + if (IS_LONGLONG (type)) + fprintf (of, "longlong-"); + else if (IS_LONG (type)) fprintf (of, "long-"); fprintf (of, "int"); break; @@ -3713,16 +3780,16 @@ symbol *fps16x16_gt; symbol *fps16x16_gteq; -/* Dims: mul/div/mod, BYTE/WORD/DWORD, SIGNED/UNSIGNED/BOTH */ -symbol *muldiv[3][3][4]; -/* Dims: BYTE/WORD/DWORD SIGNED/UNSIGNED */ -sym_link *multypes[3][2]; -/* Dims: to/from float, BYTE/WORD/DWORD, SIGNED/USIGNED */ -symbol *conv[2][3][2]; -/* Dims: to/from fixed16x16, BYTE/WORD/DWORD/FLOAT, SIGNED/USIGNED */ -symbol *fp16x16conv[2][4][2]; -/* Dims: shift left/shift right, BYTE/WORD/DWORD, SIGNED/UNSIGNED */ -symbol *rlrr[2][3][2]; +/* Dims: mul/div/mod, BYTE/WORD/DWORD/QWORD, SIGNED/UNSIGNED/BOTH */ +symbol *muldiv[3][4][4]; +/* Dims: BYTE/WORD/DWORD/QWORD SIGNED/UNSIGNED */ +sym_link *multypes[4][2]; +/* Dims: to/from float, BYTE/WORD/DWORD/QWORD, SIGNED/USIGNED */ +symbol *conv[2][4][2]; +/* Dims: to/from fixed16x16, BYTE/WORD/DWORD/QWORD/FLOAT, SIGNED/USIGNED */ +symbol *fp16x16conv[2][5][2]; +/* Dims: shift left/shift right, BYTE/WORD/DWORD/QWORD, SIGNED/UNSIGNED */ +symbol *rlrr[2][4][2]; sym_link *charType; sym_link *floatType; @@ -3748,6 +3815,7 @@ /* 's' - short */ /* 'i' - int */ /* 'l' - long */ +/* 'L' - long long */ /* 'f' - float */ /* 'q' - fixed16x16 */ /* 'v' - void */ @@ -3796,6 +3864,11 @@ SPEC_NOUN (r) = V_INT; SPEC_LONG (r) = 1; break; + case 'L': + r->xclass = SPECIFIER; + SPEC_NOUN (r) = V_INT; + SPEC_LONGLONG (r) = 1; + break; case 'f': r->xclass = SPECIFIER; SPEC_NOUN (r) = V_FLOAT; @@ -3869,10 +3942,10 @@ "mul", "div", "mod" }; const char *sbwd[] = { - "char", "int", "long", "fixed16x16", + "char", "int", "long", "longlong", "fixed16x16", }; const char *fp16x16sbwd[] = { - "char", "int", "long", "float", + "char", "int", "long", "longlong", "float", }; const char *ssu[] = { "s", "su", "us", "u" @@ -3880,6 +3953,11 @@ const char *srlrr[] = { "rl", "rr" }; + /* type as character codes for typeFromStr() */ + const char *sbwdCodes[] = { + "c", "i", "l", "L", + "uc", "ui", "ul", "uL" + }; int bwd, su, muldivmod, tofrom, slsr; @@ -3889,7 +3967,7 @@ return; } - for (bwd = 0; bwd < 3; bwd++) + for (bwd = 0; bwd < 4; bwd++) { sym_link *l = NULL; switch (bwd) @@ -3903,6 +3981,9 @@ case 2: l = newLongLink (); break; + case 3: + l = newLongLongLink (); + break; default: assert (0); } @@ -3939,7 +4020,7 @@ for (tofrom = 0; tofrom < 2; tofrom++) { - for (bwd = 0; bwd < 3; bwd++) + for (bwd = 0; bwd < 4; bwd++) { for (su = 0; su < 2; su++) { @@ -3963,7 +4044,7 @@ for (tofrom = 0; tofrom < 2; tofrom++) { - for (bwd = 0; bwd < 4; bwd++) + for (bwd = 0; bwd < 5; bwd++) { for (su = 0; su < 2; su++) { @@ -3973,7 +4054,7 @@ if (tofrom) { dbuf_printf (&dbuf, "__fps16x162%s%s", ssu[su * 3], fp16x16sbwd[bwd]); - if (bwd == 3) + if (bwd == 4) fp16x16conv[tofrom][bwd][su] = funcOfType (dbuf_c_str (&dbuf), floatType, fixed16x16Type, 1, options.float_rent); else @@ -3983,7 +4064,7 @@ else { dbuf_printf (&dbuf, "__%s%s2fps16x16", ssu[su * 3], fp16x16sbwd[bwd]); - if (bwd == 3) + if (bwd == 4) fp16x16conv[tofrom][bwd][su] = funcOfType (dbuf_c_str (&dbuf), fixed16x16Type, floatType, 1, options.float_rent); else @@ -3998,7 +4079,7 @@ /* for (muldivmod = 0; muldivmod < 3; muldivmod++) { - for (bwd = 0; bwd < 3; bwd++) + for (bwd = 0; bwd < 4; bwd++) { for (su = 0; su < 2; su++) { @@ -4040,7 +4121,7 @@ } } - for (bwd = 1; bwd < 3; bwd++) + for (bwd = 1; bwd < 4; bwd++) { for (su = 0; su < 2; su++) { @@ -4087,8 +4168,8 @@ muldivmod = 0; /* signed only */ su = 0; - /* word and doubleword */ - for (bwd = 1; bwd < 3; bwd++) + /* word, doubleword, and quadword */ + for (bwd = 1; bwd < 4; bwd++) { /* mul, int/long */ struct dbuf_s dbuf; @@ -4104,17 +4185,24 @@ for (slsr = 0; slsr < 2; slsr++) { - for (bwd = 0; bwd < 3; bwd++) + for (bwd = 0; bwd < 4; bwd++) { for (su = 0; su < 2; su++) { struct dbuf_s dbuf; + symbol *sym; + const char *params[2]; + + params[0] = sbwdCodes[bwd + 4*su]; + params[1] = sbwdCodes[0]; dbuf_init (&dbuf, 128); dbuf_printf (&dbuf, "_%s%s%s", srlrr[slsr], ssu[su * 3], sbwd[bwd]); - rlrr[slsr][bwd][su] = - funcOfType (_mangleFunctionName (dbuf_c_str (&dbuf)), multypes[bwd][su], multypes[0][0], 2, - options.intlong_rent); + rlrr[slsr][bwd][su] = sym = + funcOfTypeVarg (_mangleFunctionName (dbuf_c_str (&dbuf)), + sbwdCodes[bwd + 4*su], 2, ¶ms[0]); + FUNC_ISREENT (sym->type) = options.intlong_rent ? 1 : 0; + FUNC_NONBANKED (sym->type) = 1; dbuf_destroy (&dbuf); } } @@ -4136,7 +4224,7 @@ for (i = 0; port->builtintable[i].name; i++) { sym = funcOfTypeVarg (port->builtintable[i].name, port->builtintable[i].rtype, - port->builtintable[i].nParms, port->builtintable[i].parm_types); + port->builtintable[i].nParms, (const char **)port->builtintable[i].parm_types); FUNC_ISBUILTIN (sym->type) = 1; FUNC_ISREENT (sym->type) = 0; /* can never be reentrant */ } diff -Nru sdcc-3.1.0+dfsg/src/SDCCsymt.h sdcc-3.2.0+dfsg/src/SDCCsymt.h --- sdcc-3.1.0+dfsg/src/SDCCsymt.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCsymt.h 2012-06-07 17:36:23.000000000 +0000 @@ -94,11 +94,13 @@ { char tag[SDCC_NAME_MAX + 1]; /* tag part of structure */ unsigned char level; /* Nesting level */ + int block; /* belongs to which block */ struct symbol *fields; /* pointer to fields */ unsigned size; /* sizeof the table in bytes */ int type; /* STRUCT or UNION */ bool b_flexArrayMember; /* has got a flexible array member, only needed for syntax checks */ + struct symbol *tagsym; /* tag symbol (NULL if no tag) */ } structdef; @@ -148,6 +150,8 @@ #define TYPE_TARGET_UCHAR TYPE_UBYTE #define TYPE_TARGET_UINT TYPE_UWORD #define TYPE_TARGET_ULONG TYPE_UDWORD +#define TYPE_TARGET_LONGLONG TYPE_QWORD +#define TYPE_TARGET_ULONGLONG TYPE_UQWORD /* specifier is the last in the type-chain */ typedef struct specifier @@ -163,10 +167,12 @@ unsigned b_static:1; /* 1=static keyword found */ unsigned b_extern:1; /* 1=extern found */ unsigned b_inline:1; /* inline function requested */ + unsigned b_noreturn:1; /* promised not to return */ unsigned b_absadr:1; /* absolute address specfied */ unsigned b_volatile:1; /* is marked as volatile */ unsigned b_const:1; /* is a constant */ unsigned b_restrict:1; /* is restricted */ + struct symbol *addrspace; /* is in named address space */ unsigned b_typedef:1; /* is typedefed */ unsigned b_isregparm:1; /* is the first parameter */ unsigned b_isenum:1; /* is an enumerated type */ @@ -177,15 +183,17 @@ unsigned _stack; /* stack offset for stacked v */ int argreg; /* reg no for regparm */ union - { /* Values if constant or enum */ - TYPE_TARGET_INT v_int; /* 2 bytes: int and char values */ - char *v_char; /* character string */ - TYPE_TARGET_UINT v_uint; /* 2 bytes: unsigned int const value */ - TYPE_TARGET_LONG v_long; /* 4 bytes: long constant value */ - TYPE_TARGET_ULONG v_ulong; /* 4 bytes: unsigned long constant value */ - double v_float; /* floating point constant value */ - TYPE_TARGET_ULONG v_fixed16x16; /* 4 bytes: fixed point constant value */ - struct symbol *v_enum; /* ptr to enum_list if enum==1 */ + { /* Values if constant or enum */ + TYPE_TARGET_INT v_int; /* 2 bytes: int and char values */ + const char *v_char; /* character string */ + TYPE_TARGET_UINT v_uint; /* 2 bytes: unsigned int const value */ + TYPE_TARGET_LONG v_long; /* 4 bytes: long constant value */ + TYPE_TARGET_ULONG v_ulong; /* 4 bytes: unsigned long constant value */ + TYPE_TARGET_LONGLONG v_longlong; /* 8 bytes: long long constant value */ + TYPE_TARGET_ULONGLONG v_ulonglong;/* 8 bytes: unsigned long long const value */ + double v_float; /* floating point constant value */ + TYPE_TARGET_ULONG v_fixed16x16; /* 4 bytes: fixed point constant value */ + struct symbol *v_enum; /* ptr to enum_list if enum==1 */ } const_val; struct structdef *v_struct; /* structure pointer */ @@ -211,11 +219,13 @@ typedef struct declarator { DECLARATOR_TYPE dcl_type; /* POINTER,ARRAY or FUNCTION */ - unsigned int num_elem; /* # of elems if type==array, */ + size_t num_elem; /* # of elems if type==array, */ /* always 0 for flexible arrays */ unsigned ptr_const:1; /* pointer is constant */ unsigned ptr_volatile:1; /* pointer is volatile */ unsigned ptr_restrict:1; /* pointer is resticted */ + struct symbol *ptr_addrspace; /* pointer is in named address space */ + struct sym_link *tspec; /* pointer type specifier */ } declarator; @@ -229,9 +239,9 @@ typedef struct sym_link { - SYM_LINK_CLASS xclass; /* DECLARATOR or SPECIFIER */ - unsigned tdef:1; /* current link created by */ - /* typedef if this flag is set */ + SYM_LINK_CLASS xclass; /* DECLARATOR or SPECIFIER */ + unsigned tdef:1; /* current link created by */ + /* typedef if this flag is set */ union { specifier s; /* if CLASS == SPECIFIER */ @@ -257,6 +267,7 @@ unsigned intrtn:1; /* this is an interrupt routine */ unsigned rbank:1; /* seperate register bank */ unsigned inlinereq:1; /* inlining requested */ + unsigned noreturn:1; /* promised not to return */ unsigned smallc:1; /* Parameters on stack are passed in reverse order */ unsigned intno; /* 1=Interrupt service routine */ short regbank; /* register bank 2b used */ @@ -298,6 +309,7 @@ unsigned isreqv:1; /* is the register equivalent of a symbol */ unsigned udChked:1; /* use def checking has been already done */ unsigned generated:1; /* code generated (function symbols only) */ + unsigned isinscope:1; /* is in scope */ /* following flags are used by the backend for code generation and can be changed @@ -334,7 +346,7 @@ short nRegs; /* number of registers required */ short regType; /* type of register required */ - struct reg_info *regs[4]; /* can have at the most 4 registers */ + struct reg_info *regs[8]; /* can have at the most 8 registers */ struct asmop *aop; /* asmoperand for this symbol */ struct iCode *fuse; /* furthest use */ struct iCode *rematiCode; /* rematerialise with which instruction */ @@ -368,6 +380,7 @@ int recvSize; /* size of first argument */ struct bitVect *clashes; /* overlaps with what other symbols */ struct ast *funcTree; /* function body ast if inlined */ + struct symbol *addressmod[2]; /* access functions for named address spaces */ bool for_newralloc; } @@ -384,6 +397,7 @@ #define DCL_PTR_CONST(l) validateLink(l, "DCL_PTR_CONST", #l, DECLARATOR, __FILE__, __LINE__)->select.d.ptr_const #define DCL_PTR_VOLATILE(l) validateLink(l, "DCL_PTR_VOLATILE", #l, DECLARATOR, __FILE__, __LINE__)->select.d.ptr_volatile #define DCL_PTR_RESTRICT(l) validateLink(l, "DCL_PTR_RESTRICT", #l, DECLARATOR, __FILE__, __LINE__)->select.d.ptr_restrict +#define DCL_PTR_ADDRSPACE(l) validateLink(l, "DCL_PTR_ADDRSPACE", #l, DECLARATOR, __FILE__, __LINE__)->select.d.ptr_addrspace #define DCL_TSPEC(l) validateLink(l, "DCL_TSPEC", #l, DECLARATOR, __FILE__, __LINE__)->select.d.tspec #define FUNC_DEBUG //assert(IS_FUNC(x)); @@ -404,6 +418,8 @@ #define FUNC_HASSTACKPARM(x) (x->funcAttrs.hasStackParms) #define FUNC_ISINLINE(x) (x->funcAttrs.inlinereq) #define IFFUNC_ISINLINE(x) (IS_FUNC(x) && FUNC_ISINLINE(x)) +#define FUNC_ISNORETURN(x) (x->funcAttrs.noreturn) +#define IFFUNC_ISNORETURN(x) (IS_FUNC(x) && FUNC_ISNORETURN(x)) #define FUNC_ISREENT(x) (x->funcAttrs.reent) #define IFFUNC_ISREENT(x) (IS_FUNC(x) && FUNC_ISREENT(x)) @@ -463,11 +479,13 @@ #define SPEC_VOLATILE(x) validateLink(x, "SPEC_NOUN", #x, SPECIFIER, __FILE__, __LINE__)->select.s.b_volatile #define SPEC_CONST(x) validateLink(x, "SPEC_NOUN", #x, SPECIFIER, __FILE__, __LINE__)->select.s.b_const #define SPEC_RESTRICT(x) validateLink(x, "SPEC_NOUN", #x, SPECIFIER, __FILE__, __LINE__)->select.s.b_restrict +#define SPEC_ADDRSPACE(x) validateLink(x, "SPEC_NOUN", #x, SPECIFIER, __FILE__, __LINE__)->select.s.addrspace #define SPEC_STRUCT(x) validateLink(x, "SPEC_NOUN", #x, SPECIFIER, __FILE__, __LINE__)->select.s.v_struct #define SPEC_TYPEDEF(x) validateLink(x, "SPEC_NOUN", #x, SPECIFIER, __FILE__, __LINE__)->select.s.b_typedef #define SPEC_REGPARM(x) validateLink(x, "SPEC_NOUN", #x, SPECIFIER, __FILE__, __LINE__)->select.s.b_isregparm #define SPEC_ARGREG(x) validateLink(x, "SPEC_NOUN", #x, SPECIFIER, __FILE__, __LINE__)->select.s.argreg #define SPEC_INLINE(x) validateLink(x, "SPEC_INLINE", #x, SPECIFIER, __FILE__, __LINE__)->select.s.b_inline +#define SPEC_NORETURN(x) validateLink(x, "SPEC_NORETURN", #x, SPECIFIER, __FILE__, __LINE__)->select.s.b_noreturn /* type check macros */ #define IS_DECL(x) ( x && x->xclass == DECLARATOR ) @@ -505,18 +523,19 @@ #define IS_RENT(x) (IS_SPEC(x) && x->select.s._reent ) #define IS_STATIC(x) (IS_SPEC(x) && SPEC_STAT(x)) #define IS_INLINE(x) (IS_SPEC(x) && SPEC_INLINE(x)) +#define IS_NORETURN(x) (IS_SPEC(x) && SPEC_NORETURN(x)) #define IS_INT(x) (IS_SPEC(x) && x->select.s.noun == V_INT) #define IS_VOID(x) (IS_SPEC(x) && x->select.s.noun == V_VOID) #define IS_BOOL(x) (IS_SPEC(x) && x->select.s.noun == V_BOOL) #define IS_CHAR(x) (IS_SPEC(x) && x->select.s.noun == V_CHAR) #define IS_EXTERN(x) (IS_SPEC(x) && x->select.s.b_extern) #define IS_VOLATILE(x) (isVolatile (x)) -#define IS_INTEGRAL(x) (IS_SPEC(x) && (x->select.s.noun == V_INT || \ - x->select.s.noun == V_BOOL || \ - x->select.s.noun == V_CHAR || \ - x->select.s.noun == V_BITFIELD || \ +#define IS_INTEGRAL(x) (IS_SPEC(x) && (x->select.s.noun == V_INT || \ + x->select.s.noun == V_BOOL || \ + x->select.s.noun == V_CHAR || \ + x->select.s.noun == V_BITFIELD || \ x->select.s.noun == V_BBITFIELD || \ - x->select.s.noun == V_BIT || \ + x->select.s.noun == V_BIT || \ x->select.s.noun == V_SBIT )) #define IS_BITFIELD(x) (IS_SPEC(x) && (x->select.s.noun == V_BITFIELD || \ x->select.s.noun == V_BBITFIELD )) @@ -550,6 +569,7 @@ extern bucket *TypedefTab[]; extern bucket *LabelTab[]; extern bucket *enumTab[]; +extern bucket *AddrspaceTab[]; extern symbol *fsadd; extern symbol *fssub; extern symbol *fsmul; @@ -572,16 +592,16 @@ extern symbol *fps16x16_gt; extern symbol *fps16x16_gteq; -/* Dims: mul/div/mod, BYTE/WORD/DWORD, SIGNED/UNSIGNED/BOTH */ -extern symbol *muldiv[3][3][4]; -/* Dims: BYTE/WORD/DWORD SIGNED/UNSIGNED */ -extern sym_link *multypes[3][2]; -/* Dims: to/from float, BYTE/WORD/DWORD, SIGNED/USIGNED */ -extern symbol *conv[2][3][2]; -/* Dims: to/from fixed16x16, BYTE/WORD/DWORD/FLOAT, SIGNED/USIGNED */ -extern symbol *fp16x16conv[2][4][2]; -/* Dims: shift left/shift right, BYTE/WORD/DWORD, SIGNED/UNSIGNED */ -extern symbol *rlrr[2][3][2]; +/* Dims: mul/div/mod, BYTE/WORD/DWORD/QWORD, SIGNED/UNSIGNED/BOTH */ +extern symbol *muldiv[3][4][4]; +/* Dims: BYTE/WORD/DWORD/QWORD SIGNED/UNSIGNED */ +extern sym_link *multypes[4][2]; +/* Dims: to/from float, BYTE/WORD/DWORD/QWORD, SIGNED/USIGNED */ +extern symbol *conv[2][4][2]; +/* Dims: to/from fixed16x16, BYTE/WORD/DWORD/QWORD/FLOAT, SIGNED/USIGNED */ +extern symbol *fp16x16conv[2][5][2]; +/* Dims: shift left/shift right, BYTE/WORD/DWORD/QWORD, SIGNED/UNSIGNED */ +extern symbol *rlrr[2][4][2]; #define SCHARTYPE multypes[0][0] #define UCHARTYPE multypes[0][1] @@ -589,6 +609,8 @@ #define UINTTYPE multypes[1][1] #define LONGTYPE multypes[2][0] #define ULONGTYPE multypes[2][1] +#define LONGLONGTYPE multypes[3][0] +#define ULONGLONGTYPE multypes[3][1] extern sym_link *floatType; extern sym_link *fixed16x16Type; @@ -638,11 +660,13 @@ sym_link *newCharLink (); sym_link *newLongLink (); sym_link *newBoolLink (); +sym_link *newVoidLink (); int compareType (sym_link *, sym_link *); int compareTypeExact (sym_link *, sym_link *, int); int checkFunction (symbol *, symbol *); void cleanUpLevel (bucket **, int); void cleanUpBlock (bucket **, int); +symbol *getAddrspace (sym_link *type); int funcInChain (sym_link *); void addSymChain (symbol **); sym_link *structElemType (sym_link *, value *); @@ -675,6 +699,7 @@ int isConstant (sym_link * type); int isVolatile (sym_link * type); int isRestrict (sym_link * type); +value *aggregateToPointer (value *); extern char *nounName (sym_link *); /* noun strings */ diff -Nru sdcc-3.1.0+dfsg/src/SDCCtree_dec.hpp sdcc-3.2.0+dfsg/src/SDCCtree_dec.hpp --- sdcc-3.1.0+dfsg/src/SDCCtree_dec.hpp 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCtree_dec.hpp 2012-05-05 14:39:36.000000000 +0000 @@ -23,7 +23,7 @@ // // struct tree_dec_node // { -// std::set bag; +// std::set bag; // }; // typedef boost::adjacency_list tree_dec_t; // @@ -138,8 +138,8 @@ // Not in Thorup's paper, but without this the algorithm gives incorrect results. while(s.size() > 1) { - M.insert(std::pair(s.top().second, s.top().first)); - s.pop(); + M.insert(std::pair(s.top().second, s.top().first)); + s.pop(); } } @@ -189,7 +189,7 @@ t_found = t; } - if (t_found == t_end) // Todo: Better error handling (throw exception?) + if (t_found == t_end) // Todo: Better error handling (throw exception?) { std::cerr << "find_bag() failed.\n"; std::cerr.flush(); @@ -465,5 +465,3 @@ nicify_diffs(T, t); nicify_diffs_more(T, t); } - - diff -Nru sdcc-3.1.0+dfsg/src/SDCCutil.c sdcc-3.2.0+dfsg/src/SDCCutil.c --- sdcc-3.1.0+dfsg/src/SDCCutil.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCutil.c 2012-03-20 14:01:24.000000000 +0000 @@ -847,51 +847,75 @@ } /*! - /fn int copyStr (char *dest, char *src) + /fn const char *copyStr (const char *src, size_t *size) - Copies a source string to a dest buffer interpreting escape sequences - and special characters + Copies source string to a dynamically allocated buffer interpreting + escape sequences and special characters - /param dest Buffer to receive the resultant string /param src Buffer containing the source string with escape sequecnes - /return Number of characters in output string - + /param size Pointer to loction where the resulting buffer length is written + /return Dynamically allocated resulting buffer */ -int -copyStr (char *dest, const char *src) +const char * +copyStr (const char *src, size_t *size) { - char *OriginalDest = dest; + const char *begin = NULL; + struct dbuf_s dbuf; + + dbuf_init(&dbuf, 128); while (*src) { if (*src == '\"') - ++src; + { + if (begin) + { + /* copy what we have until now */ + dbuf_append (&dbuf, begin, src - begin); + begin = NULL; + } + ++src; + } else if (*src == '\\') { + int c; + + if (begin) + { + /* copy what we have until now */ + dbuf_append (&dbuf, begin, src - begin); + begin = NULL; + } ++src; switch (*src) { case 'n': - *dest++ = '\n'; + c = '\n'; break; + case 't': - *dest++ = '\t'; + c = '\t'; break; + case 'v': - *dest++ = '\v'; + c = '\v'; break; + case 'b': - *dest++ = '\b'; + c = '\b'; break; + case 'r': - *dest++ = '\r'; + c = '\r'; break; + case 'f': - *dest++ = '\f'; + c = '\f'; break; + case 'a': - *dest++ = '\a'; + c = '\a'; break; case '0': @@ -902,47 +926,57 @@ case '5': case '6': case '7': - *dest++ = octalEscape (&src); + c = octalEscape (&src); --src; break; case 'x': - *dest++ = hexEscape (&src); + c = hexEscape (&src); --src; break; case 'u': - *dest++ = universalEscape (&src, 4); + c = universalEscape (&src, 4); --src; break; case 'U': - *dest++ = universalEscape (&src, 8); + c = universalEscape (&src, 8); --src; break; case '\\': - *dest++ = '\\'; - break; case '\?': - *dest++ = '\?'; - break; case '\'': - *dest++ = '\''; - break; case '\"': - *dest++ = '\"'; - break; default: - *dest++ = *src; + c = *src; + break; } + dbuf_append_char (&dbuf, c); ++src; } else - *dest++ = *src++; + { + if (!begin) + begin = src; + ++src; + } } - *dest++ = '\0'; + if (begin) + { + /* copy what we have until now */ + dbuf_append (&dbuf, begin, src - begin); + begin = NULL; + } + + if (size) + { + /* include null terminator character + appended by dbuf_detach_c_str() */ + *size = dbuf_get_length (&dbuf) + 1; + } - return dest - OriginalDest; + return dbuf_detach_c_str (&dbuf); } diff -Nru sdcc-3.1.0+dfsg/src/SDCCutil.h sdcc-3.2.0+dfsg/src/SDCCutil.h --- sdcc-3.1.0+dfsg/src/SDCCutil.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCutil.h 2012-03-18 17:16:18.000000000 +0000 @@ -175,6 +175,6 @@ unsigned char hexEscape (const char **src); unsigned char universalEscape (const char **src, unsigned int n); unsigned char octalEscape (const char **src); -int copyStr (char *dest, const char *src); +const char *copyStr (const char *src, size_t *size); #endif diff -Nru sdcc-3.1.0+dfsg/src/SDCCval.c sdcc-3.2.0+dfsg/src/SDCCval.c --- sdcc-3.1.0+dfsg/src/SDCCval.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCval.c 2012-06-17 12:12:00.000000000 +0000 @@ -210,8 +210,6 @@ return head; } - - /*------------------------------------------------------------------*/ /* copyIlist - copy initializer list */ /*------------------------------------------------------------------*/ @@ -669,11 +667,36 @@ reduce it the other way */ if (SPEC_CVAL (val->type).v_int >= 0) { + /* 'bool' promotes to 'signed int' too */ + if (SPEC_CVAL (val->type).v_int <= 1) + { + SPEC_NOUN (val->type) = (bit) ? V_BIT : V_BOOL; + } + SPEC_USIGN (val->type) = 1; } + return (val); } +/*-----------------------------------------------------------------*/ +/* double2ul - double to unsigned long conversion */ +/*-----------------------------------------------------------------*/ +unsigned long +double2ul (double val) +{ +/* + * See ISO/IEC 9899, chapter 6.3.1.4 Real floating and integer: + * If the value of the integral part cannot be represented by the integer type, the behavior is undefined. + * This shows up on Mac OS X i386 platform which useus SSE unit instead of the x87 FPU for floating-point operations + */ +/* + * on Mac OS X ppc (long) 2147483648.0 equals to 2147483647, so we explicitely convert it to 0x80000000 + * on other known platforms (long) 2147483648.0 equals to -2147483648 + */ + return ((val) < 0) ? (((val) < -2147483647.0) ? 0x80000000UL : (unsigned long) -((long) -(val))) : (unsigned long) (val); +} + /*--------------------------------------------------------------------*/ /* checkConstantRange - check if constant fits in numeric range of */ /* var type in comparisons and assignments */ @@ -1067,6 +1090,7 @@ { SPEC_NOUN (val->type) = V_INT; SPEC_LONGLONG (val->type) = 1; + werror (W_LONGLONG_LITERAL, p); p2 += 2; if (strchr (p2, 'l') || strchr (p2, 'L')) werror (E_INTEGERSUFFIX, p); @@ -1078,7 +1102,10 @@ SPEC_LONG (val->type) = 1; p2++; if (strchr (p2, 'l') || strchr (p2, 'L')) - werror (E_INTEGERSUFFIX, p); + werror (E_INTEGERSUFFIX, p); + /* c89 allows unsigned long without explicit u suffix */ + if (!options.std_c99 && dval > 0x7fffffff && dval <= 0xffffffff) + SPEC_USIGN (val->type) = 1; } else { @@ -1088,10 +1115,13 @@ { /* check if we have to promote to int */ SPEC_NOUN (val->type) = V_INT; } - if (dval < -2147483648.0) /* check if we have to promote to long long int */ - SPEC_LONGLONG (val->type) = 1; - else if (dval < -32768) /* check if we have to promote to long int */ + if (dval < -32768) /* check if we have to promote to long int */ SPEC_LONG (val->type) = 1; + if (dval < -2147483648.0) /* check if we have to promote to long long int */ + { + SPEC_LONGLONG (val->type) = 1; + werror (W_LONGLONG_LITERAL, p); + } } else { /* >=0 */ @@ -1121,26 +1151,24 @@ else { SPEC_LONG (val->type) = 1; - if (dval > 0x7fffffff) - SPEC_USIGN (val->type) = 1; } } if (dval > 0xffffffff && SPEC_USIGN (val->type) && !SPEC_LONGLONG (val->type)) { - SPEC_LONG (val->type) = 0; SPEC_LONGLONG (val->type) = 1; + werror (W_LONGLONG_LITERAL, p); } else if (dval > 0x7fffffff && !SPEC_USIGN (val->type)) { - SPEC_LONGLONG (val->type) = 1; -#if defined(_MSC_VER) && _MSC_VER <= 1600 - /* Microsoft C compiler doesn't support - * hexadecimal floating-point literals */ - if (dval > (double)0x7fffffffffffffffll) -#else - if (dval > 0x7fffffffffffffffp0) -#endif + /* integral constants can be unsigned long. */ + /* c89 also allows unsigned long decimal constants without explicit suffix */ + if (is_integral || (!options.std_c99 && dval <= 0xffffffff)) SPEC_USIGN (val->type) = 1; + else + { + SPEC_LONGLONG (val->type) = 1; + werror (W_LONGLONG_LITERAL, p); + } } } } @@ -1151,7 +1179,7 @@ dval = -2147483648.0; werror (W_INVALID_INT_CONST, s, dval); } - if (dval > 2147483647.0 && !SPEC_USIGN (val->type)) + if (dval > 2147483648.0 && !SPEC_USIGN (val->type)) { dval = 2147483647.0; werror (W_INVALID_INT_CONST, s, dval); @@ -1188,6 +1216,9 @@ return val; } +/*-----------------------------------------------------------------*/ +/* constCharVal - converts a CHAR constant to value */ +/*-----------------------------------------------------------------*/ value * constCharVal (unsigned char v) { @@ -1212,6 +1243,25 @@ return val; } +/*-----------------------------------------------------------------*/ +/* constBoolVal - converts a BOOL constant to value */ +/*-----------------------------------------------------------------*/ +value * +constBoolVal (bool v) +{ + value *val = newValue (); /* alloc space for value */ + + val->type = val->etype = newLink (SPECIFIER); /* create the specifier */ + SPEC_SCLS (val->type) = S_LITERAL; + SPEC_CONST (val->type) = 1; + + SPEC_NOUN (val->type) = (bit) ? V_BIT : V_BOOL; + + SPEC_CVAL (val->type).v_uint = (unsigned int) v; + + return val; +} + /*------------------------------------------------------------------*/ /* strVal - converts a string constant to a value */ /*------------------------------------------------------------------*/ @@ -1230,8 +1280,7 @@ SPEC_SCLS (val->etype) = S_LITERAL; SPEC_CONST (val->etype) = 1; - SPEC_CVAL (val->etype).v_char = Safe_alloc (strlen (s) + 1); - DCL_ELEM (val->type) = copyStr (SPEC_CVAL (val->etype).v_char, s); + SPEC_CVAL (val->etype).v_char = copyStr (s, &DCL_ELEM (val->type)); return val; } @@ -1525,6 +1574,87 @@ return 0; } +/*------------------------------------------------------------------*/ +/* byteOfVal - extract a byte of a value */ +/* offset = 0 (LSB) ... n-1 (MSB) */ +/* higher offsets of signed ints will be sign extended, */ +/* other types will be extended with zero padding */ +/*------------------------------------------------------------------*/ +unsigned char +byteOfVal (value * val, int offset) +{ + unsigned char *p; + int shift = 8*offset; + + if (!val) + return 0; + + if (val->etype && SPEC_SCLS (val->etype) != S_LITERAL) + { + werror (E_CONST_EXPECTED, val->name); + return 0; + } + + /* if it is not a specifier then we can assume that */ + /* it will be an unsigned long */ + /* 2012-Apr-30 EEP - Why is this true? */ + if (!IS_SPEC (val->type)) + return offset < 4 ? (SPEC_CVAL (val->etype).v_ulong >> shift) & 0xff : 0; + + if (SPEC_NOUN (val->etype) == V_FLOAT) + { + float f = (float)SPEC_CVAL (val->etype).v_float; + + if (offset > 3) + return 0; + p = (unsigned char *)&f; +#ifdef WORDS_BIGENDIAN + p += 3 - offset; +#else + p += offset; +#endif + return *p; + } + + if (SPEC_NOUN (val->etype) == V_FIXED16X16) + return offset < 4 ? (SPEC_CVAL (val->etype).v_fixed16x16 >> shift) & 0xff : 0; + + if (SPEC_LONG (val->etype)) + { + if (SPEC_USIGN (val->etype)) + return offset < 4 ? (SPEC_CVAL (val->etype).v_ulong >> shift) & 0xff : 0; + else + return offset < 4 ? (SPEC_CVAL (val->etype).v_long >> shift) & 0xff : + (SPEC_CVAL (val->etype).v_long < 0 ? 0xff : 0); + } + + if (SPEC_NOUN (val->etype) == V_INT) + { + if (SPEC_USIGN (val->etype)) + return offset < 2 ? (SPEC_CVAL (val->etype).v_uint >> shift) & 0xff : 0; + else + return offset < 2 ? (SPEC_CVAL (val->etype).v_int >> shift) & 0xff : + (SPEC_CVAL (val->etype).v_int < 0 ? 0xff : 0); + } + + if (SPEC_NOUN (val->etype) == V_CHAR) + { + if (SPEC_USIGN (val->etype)) + return offset < 1 ? SPEC_CVAL (val->etype).v_uint & 0xff : 0; + else + return offset < 1 ? SPEC_CVAL (val->etype).v_int & 0xff : + (SPEC_CVAL (val->etype).v_int < 0 ? 0xff : 0); + } + + if (IS_BOOL (val->etype) || IS_BITVAR (val->etype)) + return offset < 2 ? (SPEC_CVAL (val->etype).v_uint >> shift) & 0xff : 0; + + /* we are lost ! */ + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "byteOfVal: unknown value"); + return 0; +} + + /*-----------------------------------------------------------------*/ /* doubleFromFixed16x16 - convert a fixed16x16 to double */ /*-----------------------------------------------------------------*/ @@ -1592,30 +1722,27 @@ SPEC_CVAL (val->etype).v_float = -1.0 * SPEC_CVAL (val->etype).v_float; else if (SPEC_NOUN (val->etype) == V_FIXED16X16) SPEC_CVAL (val->etype).v_fixed16x16 = (TYPE_TARGET_ULONG) - ((long) SPEC_CVAL (val->etype).v_fixed16x16); + else if (SPEC_LONG (val->etype)) + { + if (SPEC_USIGN (val->etype)) + SPEC_CVAL (val->etype).v_ulong = 0 - SPEC_CVAL (val->etype).v_ulong; + else + SPEC_CVAL (val->etype).v_long = -SPEC_CVAL (val->etype).v_long; + } else { - if (SPEC_LONG (val->etype)) - { - if (SPEC_USIGN (val->etype)) - SPEC_CVAL (val->etype).v_ulong = 0 - SPEC_CVAL (val->etype).v_ulong; - else - SPEC_CVAL (val->etype).v_long = -SPEC_CVAL (val->etype).v_long; - } + if (SPEC_USIGN (val->etype)) + SPEC_CVAL (val->etype).v_uint = 0 - SPEC_CVAL (val->etype).v_uint; else - { - if (SPEC_USIGN (val->etype)) - SPEC_CVAL (val->etype).v_uint = 0 - SPEC_CVAL (val->etype).v_uint; - else - SPEC_CVAL (val->etype).v_int = -SPEC_CVAL (val->etype).v_int; + SPEC_CVAL (val->etype).v_int = -SPEC_CVAL (val->etype).v_int; - if (SPEC_NOUN (val->etype) == V_CHAR) - { - /* promote to 'signed int', cheapestVal() might reduce it again */ - SPEC_USIGN (val->etype) = 0; - SPEC_NOUN (val->etype) = V_INT; - } - return cheapestVal (val); + if (SPEC_NOUN (val->etype) == V_CHAR) + { + /* promote to 'signed int', cheapestVal() might reduce it again */ + SPEC_USIGN (val->etype) = 0; + SPEC_NOUN (val->etype) = V_INT; } + return cheapestVal (val); } return val; } @@ -1922,7 +2049,7 @@ } /*------------------------------------------------------------------*/ -/* valCompare- Compares two literal */ +/* valCompare - Compares two literal */ /*------------------------------------------------------------------*/ value * valCompare (value * lval, value * rval, int ctype) @@ -2117,7 +2244,6 @@ break; } - return val; } @@ -2241,9 +2367,10 @@ // structure designator for array, boo. werrorfl (ilist->filename, ilist->lineno, E_BAD_DESIGNATOR); } - else { - i = ilist->designation->designator.elemno; - } + else + { + i = ilist->designation->designator.elemno; + } } if (size <= i) { diff -Nru sdcc-3.1.0+dfsg/src/SDCCval.h sdcc-3.2.0+dfsg/src/SDCCval.h --- sdcc-3.1.0+dfsg/src/SDCCval.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/SDCCval.h 2012-06-10 12:32:06.000000000 +0000 @@ -26,18 +26,6 @@ #include "SDCCsymt.h" -/* double to unsigned long conversion */ -/* - * See ISO/IEC 9899, chapter 6.3.1.4 Real floating and integer: - * If the value of the integral part cannot be represented by the integer type, the behavior is undefined. - * This shows up on Mac OS X i386 platform which useus SSE unit instead of the x87 FPU for floating-point operations - */ -/* - * on Mac OS X ppc (long) 2147483648.0 equals to 2147483647, so we explicitely convert it to 0x80000000 - * on other known platforms (long) 2147483648.0 equals to -2147483648 - */ -#define double2ul(val) (((val) < 0) ? (((val) < -2147483647.0) ? 0x80000000UL : (unsigned long) -((long) -(val))) : (unsigned long) (val)) - /* value wrapper */ typedef struct value { @@ -96,8 +84,8 @@ char *filename; union { - struct symbol *tag; /* tag part of structure */ - int elemno; /* array element (constant expr) */ + struct symbol *tag; /* tag part of structure */ + int elemno; /* array element (constant expr) */ } designator; @@ -121,6 +109,7 @@ value *newValue (void); value *constVal (const char *); value *constCharVal (unsigned char); +value *constBoolVal (bool v); value *reverseVal (value *); value *reverseValWithType (value *); value *copyValue (value *); @@ -175,4 +164,6 @@ value *valForCastArr (struct ast *, sym_link *); bool convertIListToConstList (initList * src, literalList ** lList, int size); literalList *copyLiteralList (literalList * src); +unsigned long double2ul (double val); +unsigned char byteOfVal (value *, int); #endif diff -Nru sdcc-3.1.0+dfsg/src/avr/gen.c sdcc-3.2.0+dfsg/src/avr/gen.c --- sdcc-3.1.0+dfsg/src/avr/gen.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/avr/gen.c 2012-03-30 20:01:27.000000000 +0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- gen.c - source file for code generation for ATMEL AVR - Written By - Sandeep Dutta . sandeep.dutta@usa.net (2000) + Copyright (C) 2000, Sandeep Dutta . sandeep.dutta@usa.net 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 @@ -16,12 +16,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! - - -------------------------------------------------------------------------*/ #include @@ -234,30 +228,22 @@ emitcode (char *inst, char *fmt, ...) { va_list ap; - char lb[INITIAL_INLINEASM]; - char *lbp = lb; + const char *lbp, *lb; va_start (ap, fmt); - if (inst && *inst) { - if (fmt && *fmt) - sprintf (lb, "%s\t", inst); - else - sprintf (lb, "%s", inst); - vsprintf (lb + (strlen (lb)), fmt, ap); - } - else - vsprintf (lb, fmt, ap); + lbp = lb = format_opcode (inst, va_list ap); while (isspace ((unsigned char)*lbp)) lbp++; if (lbp && *lbp) - lineCurr = (lineCurr ? - connectLine (lineCurr, newLineNode (lb)) : - (lineHead = newLineNode (lb))); - lineCurr->isInline = _G.inLine; - lineCurr->isDebug = _G.debugLine; + { + lineCurr = (lineCurr ? connectLine (lineCurr, newLineNode (lb)) : (lineHead = newLineNode (lb))); + lineCurr->isInline = _G.inLine; + lineCurr->isDebug = _G.debugLine; + } + va_end (ap); } @@ -2986,12 +2972,15 @@ break; } } - if (bp1 != bp) - emitcode (bp1, ""); + if (bp1 != bp) + emitcode (bp1, ""); + + Safe_free (buffer); - Safe_free (buffer); + /* consumed; we can free it here */ + dbuf_free (IC_INLINE (ic)); - _G.inLine -= (!options.asmpeep); + _G.inLine -= (!options.asmpeep); } /*-----------------------------------------------------------------*/ diff -Nru sdcc-3.1.0+dfsg/src/cdbFile.c sdcc-3.2.0+dfsg/src/cdbFile.c --- sdcc-3.1.0+dfsg/src/cdbFile.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/cdbFile.c 2012-03-18 18:01:25.000000000 +0000 @@ -479,7 +479,7 @@ case IPOINTER: fprintf (cdbFilePtr, "DI,"); break; case PPOINTER: fprintf (cdbFilePtr, "DP,"); break; case EEPPOINTER: fprintf (cdbFilePtr, "DA,"); break; - case ARRAY: fprintf (cdbFilePtr, "DA%d,", DCL_ELEM (type)); break; + case ARRAY: fprintf (cdbFilePtr, "DA%ud,", (unsigned int) DCL_ELEM (type)); break; default: break; } } diff -Nru sdcc-3.1.0+dfsg/src/common.h sdcc-3.2.0+dfsg/src/common.h --- sdcc-3.1.0+dfsg/src/common.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/common.h 2012-04-25 16:05:36.000000000 +0000 @@ -1,20 +1,22 @@ -/* - * common.h - include common header files - * - * 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 Library 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. - */ +/*------------------------------------------------------------------------- + common.h - include common header files + + Copyright (C) 2000, KEvin Vigor + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-------------------------------------------------------------------------*/ #include #include @@ -30,6 +32,12 @@ #endif #endif +/* C++ incompatible heared files */ +#ifdef __cplusplus +/* TODO: the extern "C" should be moved to each header file */ +extern "C" { +#endif + #include "SDCCglobl.h" #include "SDCCmem.h" #include "SDCCast.h" @@ -52,9 +60,17 @@ #include "SDCCdebug.h" #include "SDCCutil.h" #include "SDCCasm.h" +#include "SDCCsystem.h" #include "port.h" #include "newalloc.h" +#ifdef __cplusplus +} +#endif + +/* C++ compatible heared files */ +#include "SDCCgen.h" + #endif diff -Nru sdcc-3.1.0+dfsg/src/ds390/ds390.vcxproj sdcc-3.2.0+dfsg/src/ds390/ds390.vcxproj --- sdcc-3.1.0+dfsg/src/ds390/ds390.vcxproj 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/ds390/ds390.vcxproj 2012-03-18 13:40:40.000000000 +0000 @@ -137,10 +137,12 @@ - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph.rul - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph.rul peeph.rul;%(Outputs) peeph.rul;%(Outputs) + Generating Peephole Rule: peeph.rul + Generating Peephole Rule: peeph.rul diff -Nru sdcc-3.1.0+dfsg/src/ds390/gen.c sdcc-3.2.0+dfsg/src/ds390/gen.c --- sdcc-3.1.0+dfsg/src/ds390/gen.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/ds390/gen.c 2012-06-07 17:36:23.000000000 +0000 @@ -1,10 +1,11 @@ /*------------------------------------------------------------------------- gen.c - source file for code generation for DS80C390 - Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998) - and - Jean-Louis VERN.jlvern@writeme.com (1999) - Bug Fixes - Wojciech Stryjewski wstryj1@tiger.lsu.edu (1999 v2.1.9a) - DS390 adaptation by Kevin Vigor + Copyright (C) 1998, Sandeep Dutta . sandeep.dutta@usa.net + Copyright (C) 1999, Jean-Louis VERN.jlvern@writeme.com + Bug Fixes - Wojciech Stryjewski wstryj1@tiger.lsu.edu (1999 v2.1.9a) + DS390 adaptation: + Copyright (C) 2000, Kevin Vigor 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 @@ -15,14 +16,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! -------------------------------------------------------------------------*/ //#define D(x) @@ -32,8 +25,6 @@ #include #include #include -#include "SDCCglobl.h" -#include "newalloc.h" #include "common.h" #include "main.h" @@ -131,25 +122,23 @@ { struct { - short r0InB:2; //2 so we can see it overflow - short r1InB:2; //2 so we can see it overflow - short OpInB:2; //2 so we can see it overflow + short r0InB: 2; //2 so we can see it overflow + short r1InB: 2; //2 so we can see it overflow + short OpInB: 2; //2 so we can see it overflow } bs; short BInUse; } bu; short accInUse; - short inLine; - short debugLine; short nRegsSaved; short dptrInUse; short dptr1InUse; set *sendSet; - iCode *current_iCode; symbol *currentFunc; } _G; -static char *rb1regs[] = { +static char *rb1regs[] = +{ "b1_0", "b1_1", "b1_2", "b1_3", "b1_4", "b1_5", "b1_6", "b1_7", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7" }; @@ -170,16 +159,13 @@ * result bytes from operands in far space via DPTR2. */ #define DP2_RESULT_REG "_ap" -static lineNode *lineHead = NULL; -static lineNode *lineCurr = NULL; - static unsigned char SLMask[] = { 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, - 0xE0, 0xC0, 0x80, 0x00 -}; + 0xE0, 0xC0, 0x80, 0x00 + }; static unsigned char SRMask[] = { 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, - 0x07, 0x03, 0x01, 0x00 -}; + 0x07, 0x03, 0x01, 0x00 + }; #define LSB 0 #define MSB16 1 @@ -190,7 +176,7 @@ { \ symbol *lbl = newiTempLabel (NULL); \ emitcode ("setb", "F1"); \ - emitcode ("jbc", "EA,!tlabel", lbl->key + 100); \ + emitcode ("jbc", "EA,!tlabel", labelKey2num (lbl->key)); \ emitcode ("clr", "F1"); \ emitLabel (lbl); \ } \ @@ -207,74 +193,15 @@ static int _lazyDPS = 0; /* if non-zero, we are doing lazy evaluation of DPS changes. */ /*-----------------------------------------------------------------*/ -/* emitcode - writes the code into a file : for now it is simple */ -/*-----------------------------------------------------------------*/ -static void -emitcode (const char *inst, const char *fmt, ...) -{ - va_list ap; - struct dbuf_s dbuf; - const char *lbp, *lb; - - dbuf_init (&dbuf, INITIAL_INLINEASM); - - va_start (ap, fmt); - - if (inst && *inst) - { - dbuf_append_str (&dbuf, inst); - - if (fmt && *fmt) - { - dbuf_append_char (&dbuf, '\t'); - dbuf_tvprintf (&dbuf, fmt, ap); - } - } - else - { - dbuf_tvprintf (&dbuf, fmt, ap); - } - - lbp = lb = dbuf_c_str (&dbuf); - - while (isspace ((unsigned char) *lbp)) - { - lbp++; - } - - if (lbp) - { - lineCurr = (lineCurr ? connectLine (lineCurr, newLineNode (lb)) : (lineHead = newLineNode (lb))); - - lineCurr->isInline = _G.inLine; - lineCurr->isDebug = _G.debugLine; - lineCurr->ic = _G.current_iCode; - lineCurr->aln = ds390newAsmLineNode (_currentDPS); - lineCurr->isComment = (*lbp == ';'); - } - - va_end (ap); - - dbuf_destroy (&dbuf); -} - -static void -emitLabel (symbol * tlbl) -{ - emitcode ("", "!tlabeldef", tlbl->key + 100); - lineCurr->isLabel = 1; -} - -/*-----------------------------------------------------------------*/ /* ds390_emitDebuggerSymbol - associate the current code location */ /* with a debugger symbol */ /*-----------------------------------------------------------------*/ void ds390_emitDebuggerSymbol (const char *debugSym) { - _G.debugLine = 1; + genLine.lineElement.isDebug = 1; emitcode ("", "%s ==.", debugSym); - _G.debugLine = 0; + genLine.lineElement.isDebug = 0; } /*-----------------------------------------------------------------*/ @@ -314,7 +241,7 @@ /* emitpush - push something on internal stack */ /*-----------------------------------------------------------------*/ static void -emitpush (const char * arg) +emitpush (const char *arg) { char buf[] = "ar?"; @@ -333,7 +260,7 @@ arg = "acc"; } else if (EQ (arg, "r0") || EQ (arg, "r1") || EQ (arg, "r2") || EQ (arg, "r3") || - EQ (arg, "r4") || EQ (arg, "r5") || EQ (arg, "r6") || EQ (arg, "r7") ) + EQ (arg, "r4") || EQ (arg, "r5") || EQ (arg, "r6") || EQ (arg, "r7")) { buf[2] = arg[1]; arg = buf; @@ -345,7 +272,7 @@ /* emitpop - pop something from internal stack */ /*-----------------------------------------------------------------*/ static void -emitpop (const char * arg) +emitpop (const char *arg) { if (!arg) emitcode ("dec", "sp"); @@ -806,7 +733,8 @@ * far data space. */ if (stack_val < 0 && stack_val > -5) - { /* between -5 & -1 */ + { + /* between -5 & -1 */ if (options.model == MODEL_FLAT24) { emitcode ("mov", "%s,#!constbyte", dpx, (options.stack_loc >> 16) & 0xff); @@ -1233,7 +1161,8 @@ } if (sym->dptr) - { /* has been allocated to a DPTRn */ + { + /* has been allocated to a DPTRn */ sym->aop = op->aop = aop = newAsmop (AOP_DPTRn); aop->size = getSize (sym->type); aop->aopu.dptr = sym->dptr; @@ -1333,53 +1262,53 @@ break; case AOP_STK: - { - int sz = aop->size; - int stk = aop->aopu.aop_stk + aop->size; - bitVectUnSetBit (ic->rUsed, R0_IDX); - bitVectUnSetBit (ic->rUsed, R1_IDX); + { + int sz = aop->size; + int stk = aop->aopu.aop_stk + aop->size; + bitVectUnSetBit (ic->rUsed, R0_IDX); + bitVectUnSetBit (ic->rUsed, R1_IDX); - getFreePtr (ic, &aop, FALSE); + getFreePtr (ic, &aop, FALSE); - if (options.stack10bit) - { - /* I'm not sure what to do here yet... */ - /* #STUB */ - fprintf (stderr, "*** Warning: probably generating bad code for " "10 bit stack mode.\n"); - } + if (options.stack10bit) + { + /* I'm not sure what to do here yet... */ + /* #STUB */ + fprintf (stderr, "*** Warning: probably generating bad code for " "10 bit stack mode.\n"); + } - if (stk) - { - emitcode ("mov", "a,_bp"); - emitcode ("add", "a,#!constbyte", ((char) stk) & 0xff); - emitcode ("mov", "%s,a", aop->aopu.aop_ptr->name); - } - else - { - emitcode ("mov", "%s,_bp", aop->aopu.aop_ptr->name); - } + if (stk) + { + emitcode ("mov", "a,_bp"); + emitcode ("add", "a,#!constbyte", ((char) stk) & 0xff); + emitcode ("mov", "%s,a", aop->aopu.aop_ptr->name); + } + else + { + emitcode ("mov", "%s,_bp", aop->aopu.aop_ptr->name); + } - while (sz--) - { - emitpop ("acc"); - emitcode ("mov", "@%s,a", aop->aopu.aop_ptr->name); - if (!sz) - break; - emitcode ("dec", "%s", aop->aopu.aop_ptr->name); - } - op->aop = aop; - freeAsmop (op, NULL, ic, TRUE); - if (_G.r1Pushed) - { - emitpop ("ar1"); - _G.r1Pushed--; - } - if (_G.r0Pushed) - { - emitpop ("ar0"); - _G.r0Pushed--; - } - } + while (sz--) + { + emitpop ("acc"); + emitcode ("mov", "@%s,a", aop->aopu.aop_ptr->name); + if (!sz) + break; + emitcode ("dec", "%s", aop->aopu.aop_ptr->name); + } + op->aop = aop; + freeAsmop (op, NULL, ic, TRUE); + if (_G.r1Pushed) + { + emitpop ("ar1"); + _G.r1Pushed--; + } + if (_G.r0Pushed) + { + emitpop ("ar0"); + _G.r0Pushed--; + } + } case AOP_DPTR2: if (_G.dptr1InUse) { @@ -1513,7 +1442,7 @@ asmop *aop = AOP (oper); static struct dbuf_s dbuf = { 0 }; - if (dbuf_is_initialized(&dbuf)) + if (dbuf_is_initialized (&dbuf)) { /* reuse the dynamically allocated buffer */ dbuf_set_length (&dbuf, 0); @@ -1671,9 +1600,9 @@ break; case AOP_DIR: - if (SPEC_SCLS (getSpec (operandType (oper))) == S_SFR && offset) + if ((SPEC_SCLS (getSpec (operandType (oper))) == S_SFR) && (aop->size > 1)) { - dbuf_printf (&dbuf, "(%s >> %d)", aop->aopu.aop_dir, offset * 8); + dbuf_printf (&dbuf, "((%s >> %d) & 0xFF)", aop->aopu.aop_dir, offset * 8); } else if (offset) { @@ -1701,11 +1630,11 @@ break; case AOP_LIT: - { - int size = 1 + (bit16 ? (options.model == MODEL_FLAT24 ? 2 : 1) : 0); - dbuf_append_str (&dbuf, aopLiteralLong (aop->aopu.aop_lit, offset, size)); - } - break; + { + int size = 1 + (bit16 ? (options.model == MODEL_FLAT24 ? 2 : 1) : 0); + dbuf_append_str (&dbuf, aopLiteralLong (aop->aopu.aop_lit, offset, size)); + } + break; case AOP_STR: aop->coff = offset; @@ -1780,6 +1709,18 @@ bool accuse = FALSE; asmop *aop = AOP (result); const char *d = NULL; + static struct dbuf_s dbuf = { 0 }; + + if (dbuf_is_initialized (&dbuf)) + { + /* reuse the dynamically allocated buffer */ + dbuf_set_length (&dbuf, 0); + } + else + { + /* first time: initialize the dynamically allocated buffer */ + dbuf_init (&dbuf, 128); + } if (aop->size && offset > (aop->size - 1)) { @@ -1797,33 +1738,27 @@ break; case AOP_DIR: - { - struct dbuf_s dbuf; - - dbuf_init (&dbuf, 128); - if (SPEC_SCLS (getSpec (operandType (result))) == S_SFR && offset) - { - dbuf_printf (&dbuf, "(%s >> %d)", aop->aopu.aop_dir, offset * 8); - } - else if (offset) - { - dbuf_printf (&dbuf, "(%s + %d)", aop->aopu.aop_dir, offset); - } - else - { - dbuf_append_str (&dbuf, aop->aopu.aop_dir); - } + if ((SPEC_SCLS (getSpec (operandType (result))) == S_SFR) && (aop->size > 1)) + { + dbuf_printf (&dbuf, "((%s >> %d) & 0xFF)", aop->aopu.aop_dir, offset * 8); + } + else if (offset) + { + dbuf_printf (&dbuf, "(%s + %d)", aop->aopu.aop_dir, offset); + } + else + { + dbuf_append_str (&dbuf, aop->aopu.aop_dir); + } - if (!EQ (dbuf_c_str (&dbuf), s) || bvolatile) - { - emitcode ("mov", "%s,%s", dbuf_c_str (&dbuf), s); - } - if (EQ (dbuf_c_str (&dbuf), "acc")) - { - accuse = TRUE; - } - dbuf_destroy (&dbuf); - } + if (!EQ (dbuf_c_str (&dbuf), s) || bvolatile) + { + emitcode ("mov", "%s,%s", dbuf_c_str (&dbuf), s); + } + if (EQ (dbuf_c_str (&dbuf), "acc")) + { + accuse = TRUE; + } break; case AOP_REG: @@ -1831,7 +1766,7 @@ { if (*s == '@' || EQ (s, "r0") || EQ (s, "r1") || EQ (s, "r2") || EQ (s, "r3") || - EQ (s, "r4") || EQ (s, "r5") || EQ (s, "r6") || EQ (s, "r7") ) + EQ (s, "r4") || EQ (s, "r5") || EQ (s, "r6") || EQ (s, "r7")) { emitcode ("mov", "%s,%s", aop->aopu.aop_reg[offset]->dname, s); } @@ -1911,14 +1846,10 @@ emitcode ("mov", "@%s,a", aop->aopu.aop_ptr->name); } else if (EQ (s, "r0") || EQ (s, "r1") || EQ (s, "r2") || EQ (s, "r3") || - EQ (s, "r4") || EQ (s, "r5") || EQ (s, "r6") || EQ (s, "r7") ) + EQ (s, "r4") || EQ (s, "r5") || EQ (s, "r6") || EQ (s, "r7")) { - struct dbuf_s dbuf; - - dbuf_init (&dbuf, 128); dbuf_printf (&dbuf, "a%s", s); emitcode ("mov", "@%s,%s", aop->aopu.aop_ptr->name, dbuf_c_str (&dbuf)); - dbuf_destroy (&dbuf); } else { @@ -2228,7 +2159,7 @@ } MOVA (aopGet (oper, offset++, FALSE, FALSE, NULL)); if (IS_FLOAT (type)) - emitcode ("anl", "a,#0x7F"); //clear sign bit + emitcode ("anl", "a,#0x7F"); //clear sign bit emitcode ("orl", "a,b"); popB (pushedB); } @@ -2332,7 +2263,7 @@ /* set C, if a == 0 */ tlbl = newiTempLabel (NULL); - emitcode ("cjne", "a,#0x01,!tlabel", tlbl->key + 100); + emitcode ("cjne", "a,#0x01,!tlabel", labelKey2num (tlbl->key)); emitLabel (tlbl); outBitC (IC_RESULT (ic)); @@ -2379,12 +2310,12 @@ if ((AOP_TYPE (IC_LEFT (ic)) == AOP_ACC && offset == 0) || AOP_TYPE (IC_LEFT (ic)) == AOP_REG || IS_AOP_PREG (IC_LEFT (ic))) { - emitcode ("cjne", "%s,#0xFF,!tlabel", l, tlbl->key + 100); + emitcode ("cjne", "%s,#0xFF,!tlabel", l, labelKey2num (tlbl->key)); } else { MOVA (l); - emitcode ("cjne", "a,#0xFF,!tlabel", tlbl->key + 100); + emitcode ("cjne", "a,#0xFF,!tlabel", labelKey2num (tlbl->key)); } emitLabel (tlbl); outBitC (IC_RESULT (ic)); @@ -3169,7 +3100,8 @@ size = getSize (operandType (IC_LEFT (sic))); D (emitcode (";", "genSend argreg = %d, size = %d ", sic->argreg, size)); if (sendCount == 0) - { /* first parameter */ + { + /* first parameter */ // we know that dpl(hxb) is the result, so rb1_count = 0; _startLazyDPSEvaluation (); @@ -3195,7 +3127,8 @@ rb1_count = 0; } else - { /* if more parameter in registers */ + { + /* if more parameter in registers */ aopOp (IC_LEFT (sic), sic, FALSE, TRUE); while (size--) { @@ -3287,7 +3220,8 @@ if (_G.sendSet) { if (IFFUNC_ISREENT (dtype)) - { /* need to reverse the send set */ + { + /* need to reverse the send set */ genSend (reverseSet (_G.sendSet)); } else @@ -3322,12 +3256,10 @@ } /* if we need assign a result value */ - if ((IS_ITEMP (IC_RESULT (ic)) && + if ((IS_ITEMP (IC_RESULT (ic)) && !IS_BIT (OP_SYM_ETYPE (IC_RESULT (ic))) && - (OP_SYMBOL (IC_RESULT (ic))->nRegs || - OP_SYMBOL (IC_RESULT (ic))->accuse || - OP_SYMBOL (IC_RESULT (ic))->spildir ) ) || - IS_TRUE_SYMOP (IC_RESULT (ic))) + (OP_SYMBOL (IC_RESULT (ic))->nRegs || + OP_SYMBOL (IC_RESULT (ic))->accuse || OP_SYMBOL (IC_RESULT (ic))->spildir)) || IS_TRUE_SYMOP (IC_RESULT (ic))) { if (isOperandInFarSpace (IC_RESULT (ic)) && getSize (operandType (IC_RESULT (ic))) <= 2) { @@ -3467,7 +3399,6 @@ genPcall (iCode * ic) { sym_link *dtype; - sym_link *etype; symbol *rlbl = newiTempLabel (NULL); bool restoreBank = FALSE; bool resultInF0 = FALSE; @@ -3475,7 +3406,6 @@ D (emitcode (";", "genPcall")); dtype = operandType (IC_LEFT (ic))->next; - etype = getSpec (dtype); /* if caller saves & we have not saved then */ if (!ic->regsSaved) saveRegisters (ic); @@ -3491,14 +3421,14 @@ } /* push the return address on to the stack */ - emitcode ("mov", "a,#!tlabel", (rlbl->key + 100)); + emitcode ("mov", "a,#!tlabel", labelKey2num (rlbl->key)); emitpush ("acc"); - emitcode ("mov", "a,#!hil", (rlbl->key + 100)); + emitcode ("mov", "a,#!hil", labelKey2num (rlbl->key)); emitpush ("acc"); if (options.model == MODEL_FLAT24) { - emitcode ("mov", "a,#!hihil", (rlbl->key + 100)); + emitcode ("mov", "a,#!hihil", labelKey2num (rlbl->key)); emitpush ("acc"); } @@ -3661,7 +3591,7 @@ emitcode (";", "-----------------------------------------"); emitcode ("", "%s:", sym->rname); - lineCurr->isLabel = 1; + genLine.lineCurr->isLabel = 1; ftype = operandType (IC_LEFT (ic)); _G.currentFunc = sym; @@ -3970,10 +3900,10 @@ { symbol *tlbl = newiTempLabel (NULL); emitcode ("setb", "c"); - emitcode ("jbc", "ea,!tlabel", tlbl->key + 100); /* atomic test & clear */ + emitcode ("jbc", "ea,!tlabel", labelKey2num (tlbl->key)); /* atomic test & clear */ emitcode ("clr", "c"); emitLabel (tlbl); - emitpush ("psw"); /* save old ea via c in psw */ + emitpush ("psw"); /* save old ea via c in psw */ } } @@ -3984,7 +3914,7 @@ genEndFunction (iCode * ic) { symbol *sym = OP_SYMBOL (IC_LEFT (ic)); - lineNode *lnp = lineCurr; + lineNode *lnp = genLine.lineCurr; bitVect *regsUsed; bitVect *regsUsedPrologue; bitVect *regsUnneeded; @@ -4006,13 +3936,13 @@ if (IS_BIT (OP_SYM_ETYPE (IC_LEFT (ic)))) { emitcode ("rlc", "a"); /* save c in a */ - emitpop ("psw"); /* restore ea via c in psw */ + emitpop ("psw"); /* restore ea via c in psw */ emitcode ("mov", "ea,c"); emitcode ("rrc", "a"); /* restore c from a */ } else { - emitpop ("psw"); /* restore ea via c in psw */ + emitpop ("psw"); /* restore ea via c in psw */ emitcode ("mov", "ea,c"); } } @@ -4039,7 +3969,7 @@ if (options.useXstack && sym->stack) { emitcode ("mov", "a,sp"); - emitcode ("add", "a,#!constbyte", ((char) -sym->stack) & 0xff); + emitcode ("add", "a,#!constbyte", ((char) - sym->stack) & 0xff); emitcode ("mov", "sp,a"); } @@ -4414,7 +4344,7 @@ if the next is not the return statement */ if (!(ic->next && ic->next->op == LABEL && IC_LABEL (ic->next) == returnLabel)) { - emitcode ("ljmp", "!tlabel", (returnLabel->key + 100)); + emitcode ("ljmp", "!tlabel", labelKey2num (returnLabel->key)); } } @@ -4441,7 +4371,7 @@ { D (emitcode (";", "genGoto")); - emitcode ("ljmp", "!tlabel", (IC_LABEL (ic)->key + 100)); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_LABEL (ic)->key)); } /*-----------------------------------------------------------------*/ @@ -4536,12 +4466,12 @@ emitcode ("inc", "%s", l); if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG || IS_AOP_PREG (IC_RESULT (ic))) { - emitcode ("cjne", "%s,%s,!tlabel", l, zero, tlbl->key + 100); + emitcode ("cjne", "%s,%s,!tlabel", l, zero, labelKey2num (tlbl->key)); } else { emitcode ("clr", "a"); - emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100); + emitcode ("cjne", "a,%s,!tlabel", l, labelKey2num (tlbl->key)); } l = aopGet (IC_RESULT (ic), MSB16, FALSE, FALSE, NULL); @@ -4550,15 +4480,15 @@ { if (EQ (l, "acc")) { - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); } else if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG || IS_AOP_PREG (IC_RESULT (ic))) { - emitcode ("cjne", "%s,%s,!tlabel", l, zero, tlbl->key + 100); + emitcode ("cjne", "%s,%s,!tlabel", l, zero, labelKey2num (tlbl->key)); } else { - emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100); + emitcode ("cjne", "a,%s,!tlabel", l, labelKey2num (tlbl->key)); } l = aopGet (IC_RESULT (ic), MSB24, FALSE, FALSE, NULL); @@ -4568,15 +4498,15 @@ { if (EQ (l, "acc")) { - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); } else if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG || IS_AOP_PREG (IC_RESULT (ic))) { - emitcode ("cjne", "%s,%s,!tlabel", l, zero, tlbl->key + 100); + emitcode ("cjne", "%s,%s,!tlabel", l, zero, labelKey2num (tlbl->key)); } else { - emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100); + emitcode ("cjne", "a,%s,!tlabel", l, labelKey2num (tlbl->key)); } emitcode ("inc", "%s", aopGet (IC_RESULT (ic), MSB32, FALSE, FALSE, NULL)); @@ -4592,7 +4522,7 @@ if (AOP_TYPE (IC_RESULT (ic)) == AOP_STR && IS_ITEMP (IC_RESULT (ic)) && !AOP_USESDPTR (IC_LEFT (ic)) && icount <= 5 && size <= 3 && options.model == MODEL_FLAT24) { - if (IC_RESULT (ic)->isGptr) + if (AOP_SIZE (IC_RESULT (ic)) == 4) { emitcode ("mov", "b,%s", aopGet (IC_LEFT (ic), 3, FALSE, FALSE, NULL)); } @@ -4668,7 +4598,7 @@ } else { - emitcode ("jz", "!tlabel", tlbl->key + 100); + emitcode ("jz", "!tlabel", labelKey2num (tlbl->key)); emitcode ("mov", "a,%s", one); emitLabel (tlbl); outAcc (result); @@ -4687,7 +4617,7 @@ if (AOP_TYPE (IC_RESULT (ic)) == AOP_CRY) { symbol *lbl = newiTempLabel (NULL); - emitcode ("jnb", "%s,!tlabel", AOP (IC_RIGHT (ic))->aopu.aop_dir, (lbl->key + 100)); + emitcode ("jnb", "%s,!tlabel", AOP (IC_RIGHT (ic))->aopu.aop_dir, labelKey2num (lbl->key)); emitcode ("cpl", "c"); emitLabel (lbl); outBitC (IC_RESULT (ic)); @@ -5044,8 +4974,7 @@ */ assert (AOP_NEEDSACC (IC_RIGHT (ic))); TR_AP ("#3"); - D (emitcode (";", "+ AOP_ACC special case."); - ); + D (emitcode (";", "+ AOP_ACC special case.");); emitcode ("xch", "a, %s", DP2_RESULT_REG); } MOVA (aopGet (IC_RIGHT (ic), offset, FALSE, FALSE, NULL)); @@ -5081,6 +5010,7 @@ if (pushResult) { aopOp (IC_RESULT (ic), ic, TRUE, FALSE); + adjustArithmeticResult (ic); size = getDataSize (IC_LEFT (ic)); rSize = getDataSize (IC_RESULT (ic)); @@ -5095,8 +5025,8 @@ } _endLazyDPSEvaluation (); } - - adjustArithmeticResult (ic); + else + adjustArithmeticResult (ic); release: freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); @@ -5166,12 +5096,12 @@ if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG || AOP_TYPE (IC_RESULT (ic)) == AOP_DPTR || IS_AOP_PREG (IC_RESULT (ic))) { - emitcode ("cjne", "%s,#!constbyte,!tlabel", l, 0xff, tlbl->key + 100); + emitcode ("cjne", "%s,#!constbyte,!tlabel", l, 0xff, labelKey2num (tlbl->key)); } else { emitcode ("mov", "a,#!constbyte", 0xff); - emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100); + emitcode ("cjne", "a,%s,!tlabel", l, labelKey2num (tlbl->key)); } l = aopGet (IC_RESULT (ic), MSB16, FALSE, FALSE, NULL); emitcode ("dec", "%s", l); @@ -5179,17 +5109,16 @@ { if (EQ (l, "acc")) { - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); } else if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG || - AOP_TYPE (IC_RESULT (ic)) == AOP_DPTR || - IS_AOP_PREG (IC_RESULT (ic))) + AOP_TYPE (IC_RESULT (ic)) == AOP_DPTR || IS_AOP_PREG (IC_RESULT (ic))) { - emitcode ("cjne", "%s,#!constbyte,!tlabel", l, 0xff, tlbl->key + 100); + emitcode ("cjne", "%s,#!constbyte,!tlabel", l, 0xff, labelKey2num (tlbl->key)); } else { - emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100); + emitcode ("cjne", "a,%s,!tlabel", l, labelKey2num (tlbl->key)); } l = aopGet (IC_RESULT (ic), MSB24, FALSE, FALSE, NULL); emitcode ("dec", "%s", l); @@ -5198,17 +5127,16 @@ { if (EQ (l, "acc")) { - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); } else if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG || - AOP_TYPE (IC_RESULT (ic)) == AOP_DPTR || - IS_AOP_PREG (IC_RESULT (ic))) + AOP_TYPE (IC_RESULT (ic)) == AOP_DPTR || IS_AOP_PREG (IC_RESULT (ic))) { - emitcode ("cjne", "%s,#!constbyte,!tlabel", l, 0xff, tlbl->key + 100); + emitcode ("cjne", "%s,#!constbyte,!tlabel", l, 0xff, labelKey2num (tlbl->key)); } else { - emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100); + emitcode ("cjne", "a,%s,!tlabel", l, labelKey2num (tlbl->key)); } emitcode ("dec", "%s", aopGet (IC_RESULT (ic), MSB32, FALSE, FALSE, NULL)); } @@ -5300,7 +5228,7 @@ if (AOP_TYPE (IC_RESULT (ic)) == AOP_CRY) { emitcode ("mov", "c,%s", AOP (IC_LEFT (ic))->aopu.aop_dir); - emitcode ("jnb", "%s,!tlabel", AOP (IC_RIGHT (ic))->aopu.aop_dir, (lbl->key + 100)); + emitcode ("jnb", "%s,!tlabel", AOP (IC_RIGHT (ic))->aopu.aop_dir, labelKey2num (lbl->key)); emitcode ("cpl", "c"); emitLabel (lbl); outBitC (IC_RESULT (ic)); @@ -5309,7 +5237,7 @@ { emitcode ("mov", "c,%s", AOP (IC_RIGHT (ic))->aopu.aop_dir); emitcode ("subb", "a,acc"); - emitcode ("jnb", "%s,!tlabel", AOP (IC_LEFT (ic))->aopu.aop_dir, (lbl->key + 100)); + emitcode ("jnb", "%s,!tlabel", AOP (IC_LEFT (ic))->aopu.aop_dir, labelKey2num ((lbl->key))); emitcode ("inc", "a"); emitLabel (lbl); aopPut (IC_RESULT (ic), "a", 0); @@ -5416,6 +5344,7 @@ if (pushResult) { aopOp (IC_RESULT (ic), ic, TRUE, FALSE); + adjustArithmeticResult (ic); size = getDataSize (IC_LEFT (ic)); rSize = getDataSize (IC_RESULT (ic)); @@ -5430,8 +5359,8 @@ } _endLazyDPSEvaluation (); } - - adjustArithmeticResult (ic); + else + adjustArithmeticResult (ic); release: freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); @@ -5488,12 +5417,12 @@ pushedB = pushB (); if ((lUnsigned && rUnsigned) -/* sorry, I don't know how to get size - without calling aopOp (result,...); - see Feature Request */ - /* || size == 1 */ ) - /* no, this is not a bug; with a 1 byte result there's - no need to take care about the signedness! */ + /* sorry, I don't know how to get size + without calling aopOp (result,...); + see Feature Request */ + /* || size == 1 */ ) + /* no, this is not a bug; with a 1 byte result there's + no need to take care about the signedness! */ { /* just an unsigned 8 * 8 = 8 multiply or 8u * 8u = 16u */ @@ -5588,7 +5517,7 @@ { MOVA (aopGet (right, 0, FALSE, FALSE, NULL)); lbl = newiTempLabel (NULL); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "F0"); /* complement sign flag */ emitcode ("cpl", "a"); /* 2's complement */ emitcode ("inc", "a"); @@ -5613,7 +5542,7 @@ if (!lUnsigned) /* emitcode (";", "signed"); */ { lbl = newiTempLabel (NULL); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "F0"); /* complement sign flag */ emitcode ("cpl", "a"); /* 2's complement */ emitcode ("inc", "a"); @@ -5638,7 +5567,7 @@ { lbl = newiTempLabel (NULL); if (runtimeSign) - emitcode ("jnb", "F0,!tlabel", lbl->key + 100); + emitcode ("jnb", "F0,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "a"); /* lsb 2's complement */ if (size != 2) emitcode ("inc", "a"); /* inc doesn't set carry flag */ @@ -5680,7 +5609,7 @@ /* save EA bit in F1 */ lbl = newiTempLabel (NULL); emitcode ("setb", "F1"); - emitcode ("jbc", "EA,!tlabel", lbl->key + 100); + emitcode ("jbc", "EA,!tlabel", labelKey2num (lbl->key)); emitcode ("clr", "F1"); emitLabel (lbl); @@ -5704,7 +5633,7 @@ lbl = newiTempLabel (NULL); emitcode ("mov", "b,%s", aopGet (right, 0, FALSE, FALSE, NULL)); emitcode ("mov", "a,%s", aopGet (right, 1, FALSE, FALSE, NULL)); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("xch", "a,b"); emitcode ("cpl", "a"); emitcode ("add", "a,#1"); @@ -5728,14 +5657,14 @@ lbl = newiTempLabel (NULL); emitcode ("mov", "b,%s", aopGet (left, 0, FALSE, FALSE, NULL)); emitcode ("mov", "a,%s", aopGet (left, 1, FALSE, FALSE, NULL)); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("xch", "a,b"); emitcode ("cpl", "a"); emitcode ("add", "a,#1"); emitcode ("xch", "a,b"); emitcode ("cpl", "a"); // msb emitcode ("addc", "a,#0"); - emitcode ("jbc", "F0,!tlabel", lbl->key + 100); + emitcode ("jbc", "F0,!tlabel", labelKey2num (lbl->key)); emitcode ("setb", "F0"); emitLabel (lbl); emitcode ("mov", "ma,b"); @@ -5751,7 +5680,7 @@ emitLabel (lbl); emitcode ("mov", "a,mcnt1"); emitcode ("anl", "a,#!constbyte", 0x80); - emitcode ("jnz", "!tlabel", lbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (lbl->key)); freeAsmop (left, NULL, ic, TRUE); freeAsmop (right, NULL, ic, TRUE); @@ -5777,7 +5706,7 @@ MOVA ("ma"); /* negate result if needed */ lbl = newiTempLabel (NULL); - emitcode ("jnb", "F0,!tlabel", lbl->key + 100); + emitcode ("jnb", "F0,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "a"); emitcode ("add", "a,#1"); emitLabel (lbl); @@ -5796,7 +5725,7 @@ emitcode ("pop", "acc"); lbl = newiTempLabel (NULL); - emitcode ("jnb", "F0,!tlabel", lbl->key + 100); + emitcode ("jnb", "F0,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "a"); emitcode ("addc", "a,#0"); emitLabel (lbl); @@ -5805,7 +5734,7 @@ if (AOP_SIZE (result) >= 3) { lbl = newiTempLabel (NULL); - emitcode ("jnb", "F0,!tlabel", lbl->key + 100); + emitcode ("jnb", "F0,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "a"); emitcode ("addc", "a,#0"); emitLabel (lbl); @@ -5815,7 +5744,7 @@ if (AOP_SIZE (result) >= 4) { lbl = newiTempLabel (NULL); - emitcode ("jnb", "F0,!tlabel", lbl->key + 100); + emitcode ("jnb", "F0,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "a"); emitcode ("addc", "a,#0"); emitLabel (lbl); @@ -5832,7 +5761,7 @@ /* restore EA bit in F1 */ lbl = newiTempLabel (NULL); - emitcode ("jnb", "F1,!tlabel", lbl->key + 100); + emitcode ("jnb", "F1,!tlabel", labelKey2num (lbl->key)); emitcode ("setb", "EA"); emitLabel (lbl); return; @@ -6011,7 +5940,7 @@ { MOVA (aopGet (right, 0, FALSE, FALSE, NULL)); lbl = newiTempLabel (NULL); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "F0"); /* complement sign flag */ emitcode ("cpl", "a"); /* 2's complement */ emitcode ("inc", "a"); @@ -6036,7 +5965,7 @@ if (!lUnsigned) { lbl = newiTempLabel (NULL); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "F0"); /* complement sign flag */ emitcode ("cpl", "a"); /* 2's complement */ emitcode ("inc", "a"); @@ -6052,7 +5981,7 @@ { lbl = newiTempLabel (NULL); if (runtimeSign) - emitcode ("jnb", "F0,!tlabel", lbl->key + 100); + emitcode ("jnb", "F0,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "a"); /* lsb 2's complement */ emitcode ("inc", "a"); emitLabel (lbl); @@ -6109,7 +6038,7 @@ /* save EA bit in F1 */ lbl = newiTempLabel (NULL); emitcode ("setb", "F1"); - emitcode ("jbc", "EA,!tlabel", lbl->key + 100); + emitcode ("jbc", "EA,!tlabel", labelKey2num (lbl->key)); emitcode ("clr", "F1"); emitLabel (lbl); @@ -6120,7 +6049,7 @@ lbl = newiTempLabel (NULL); emitcode ("mov", "b,%s", aopGet (left, 0, FALSE, FALSE, NULL)); emitcode ("mov", "a,%s", aopGet (left, 1, FALSE, FALSE, NULL)); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("xch", "a,b"); emitcode ("cpl", "a"); emitcode ("add", "a,#1"); @@ -6147,7 +6076,7 @@ if (val < 0) { lbl = newiTempLabel (NULL); - emitcode ("jbc", "F0,!tlabel", lbl->key + 100); + emitcode ("jbc", "F0,!tlabel", labelKey2num (lbl->key)); emitcode ("setb", "F0"); emitLabel (lbl); val = -val; @@ -6160,14 +6089,14 @@ lbl = newiTempLabel (NULL); emitcode ("mov", "b,%s", aopGet (right, 0, FALSE, FALSE, NULL)); emitcode ("mov", "a,%s", aopGet (right, 1, FALSE, FALSE, NULL)); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("xch", "a,b"); emitcode ("cpl", "a"); emitcode ("add", "a,#1"); emitcode ("xch", "a,b"); emitcode ("cpl", "a"); // msb emitcode ("addc", "a,#0"); - emitcode ("jbc", "F0,!tlabel", lbl->key + 100); + emitcode ("jbc", "F0,!tlabel", labelKey2num (lbl->key)); emitcode ("setb", "F0"); emitLabel (lbl); emitcode ("mov", "mb,b"); @@ -6185,7 +6114,7 @@ emitLabel (lbl); emitcode ("mov", "a,mcnt1"); emitcode ("anl", "a,#!constbyte", 0x80); - emitcode ("jnz", "!tlabel", lbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (lbl->key)); freeAsmop (left, NULL, ic, TRUE); freeAsmop (right, NULL, ic, TRUE); @@ -6203,14 +6132,14 @@ MOVA ("ma"); /* negate result if needed */ lbl = newiTempLabel (NULL); - emitcode ("jnb", "F0,!tlabel", lbl->key + 100); + emitcode ("jnb", "F0,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "a"); emitcode ("add", "a,#1"); emitLabel (lbl); aopPut (result, "a", 0); emitcode ("pop", "acc"); lbl = newiTempLabel (NULL); - emitcode ("jnb", "F0,!tlabel", lbl->key + 100); + emitcode ("jnb", "F0,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "a"); emitcode ("addc", "a,#0"); emitLabel (lbl); @@ -6219,7 +6148,7 @@ freeAsmop (result, NULL, ic, TRUE); /* restore EA bit in F1 */ lbl = newiTempLabel (NULL); - emitcode ("jnb", "F1,!tlabel", lbl->key + 100); + emitcode ("jnb", "F1,!tlabel", labelKey2num (lbl->key)); emitcode ("setb", "EA"); emitLabel (lbl); return; @@ -6350,7 +6279,7 @@ { MOVA (aopGet (right, 0, FALSE, FALSE, NULL)); lbl = newiTempLabel (NULL); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "a"); /* 2's complement */ emitcode ("inc", "a"); emitLabel (lbl); @@ -6387,7 +6316,7 @@ emitcode ("clr", "F0"); /* clear sign flag */ lbl = newiTempLabel (NULL); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("setb", "F0"); /* set sign flag */ emitcode ("cpl", "a"); /* 2's complement */ emitcode ("inc", "a"); @@ -6404,7 +6333,7 @@ emitcode ("mov", "a,b"); lbl = newiTempLabel (NULL); if (runtimeSign) - emitcode ("jnb", "F0,!tlabel", lbl->key + 100); + emitcode ("jnb", "F0,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "a"); /* lsb 2's complement */ emitcode ("inc", "a"); emitLabel (lbl); @@ -6462,7 +6391,7 @@ /* save EA bit in F1 */ lbl = newiTempLabel (NULL); emitcode ("setb", "F1"); - emitcode ("jbc", "EA,!tlabel", lbl->key + 100); + emitcode ("jbc", "EA,!tlabel", labelKey2num (lbl->key)); emitcode ("clr", "F1"); emitLabel (lbl); @@ -6471,7 +6400,7 @@ lbl = newiTempLabel (NULL); emitcode ("mov", "b,%s", aopGet (left, 0, FALSE, FALSE, NULL)); emitcode ("mov", "a,%s", aopGet (left, 1, FALSE, FALSE, NULL)); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("xch", "a,b"); emitcode ("cpl", "a"); emitcode ("add", "a,#1"); @@ -6506,7 +6435,7 @@ lbl = newiTempLabel (NULL); emitcode ("mov", "b,%s", aopGet (right, 0, FALSE, FALSE, NULL)); emitcode ("mov", "a,%s", aopGet (right, 1, FALSE, FALSE, NULL)); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("xch", "a,b"); emitcode ("cpl", "a"); emitcode ("add", "a,#1"); @@ -6529,7 +6458,7 @@ emitLabel (lbl); emitcode ("mov", "a,mcnt1"); emitcode ("anl", "a,#!constbyte", 0x80); - emitcode ("jnz", "!tlabel", lbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (lbl->key)); freeAsmop (left, NULL, ic, TRUE); freeAsmop (right, NULL, ic, TRUE); @@ -6541,7 +6470,7 @@ /* restore EA bit in F1 */ lbl = newiTempLabel (NULL); - emitcode ("jnb", "F1,!tlabel", lbl->key + 100); + emitcode ("jnb", "F1,!tlabel", labelKey2num (lbl->key)); emitcode ("setb", "EA"); emitLabel (lbl); } @@ -6621,10 +6550,10 @@ inst = ((EQ (jval, "a") ? "jnz" : (EQ (jval, "c") ? "jc" : "jb"))); } if (EQ (inst, "jb") || EQ (inst, "jnb")) - emitcode (inst, "%s,!tlabel", jval, (tlbl->key + 100)); + emitcode (inst, "%s,!tlabel", jval, labelKey2num ((tlbl->key))); else - emitcode (inst, "!tlabel", tlbl->key + 100); - emitcode ("ljmp", "!tlabel", jlbl->key + 100); + emitcode (inst, "!tlabel", labelKey2num (tlbl->key)); + emitcode ("ljmp", "!tlabel", labelKey2num (jlbl->key)); emitLabel (tlbl); /* mark the icode as generated */ @@ -6672,12 +6601,11 @@ size = max (AOP_SIZE (left), AOP_SIZE (right)); /* if unsigned char cmp with lit, do cjne left,#right,zz */ - if (size == 1 && !sign && AOP_TYPE (right) == AOP_LIT && - AOP_TYPE (left) != AOP_DIR && AOP_TYPE (left) != AOP_STR) + if (size == 1 && !sign && AOP_TYPE (right) == AOP_LIT && AOP_TYPE (left) != AOP_DIR && AOP_TYPE (left) != AOP_STR) { char *l = Safe_strdup (aopGet (left, offset, FALSE, FALSE, NULL)); symbol *lbl = newiTempLabel (NULL); - emitcode ("cjne", "%s,%s,!tlabel", l, aopGet (right, offset, FALSE, FALSE, NULL), lbl->key + 100); + emitcode ("cjne", "%s,%s,!tlabel", l, aopGet (right, offset, FALSE, FALSE, NULL), labelKey2num (lbl->key)); Safe_free (l); emitLabel (lbl); } @@ -6759,7 +6687,7 @@ } release: -/* Don't need the left & right operands any more; do need the result. */ + /* Don't need the left & right operands any more; do need the result. */ freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); @@ -6859,10 +6787,8 @@ /* if the left side is a literal or if the right is in a pointer register and left is not */ - if ((AOP_TYPE (left) == AOP_LIT) || - (AOP_TYPE (left) == AOP_IMMD) || - (AOP_TYPE (left) == AOP_DIR) || - (IS_AOP_PREG (right) && !IS_AOP_PREG (left))) + if ((AOP_TYPE (left) == AOP_LIT) || + (AOP_TYPE (left) == AOP_IMMD) || (AOP_TYPE (left) == AOP_DIR) || (IS_AOP_PREG (right) && !IS_AOP_PREG (left))) { operand *t = right; right = left; @@ -6884,7 +6810,7 @@ emitcode ("lcall", "___gptr_cmp"); for (offset = 0; offset < GPTRSIZE; offset++) emitpop (NULL); - emitcode ("jnz", "!tlabel", lbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (lbl->key)); } /* if the right side is a literal then anything goes */ @@ -6895,7 +6821,7 @@ while (size--) { char *l = Safe_strdup (aopGet (left, offset, FALSE, FALSE, NULL)); - emitcode ("cjne", "%s,%s,!tlabel", l, aopGet (right, offset, FALSE, FALSE, NULL), lbl->key + 100); + emitcode ("cjne", "%s,%s,!tlabel", l, aopGet (right, offset, FALSE, FALSE, NULL), labelKey2num (lbl->key)); Safe_free (l); offset++; } @@ -6907,17 +6833,16 @@ AOP_TYPE (right) == AOP_DIR || AOP_TYPE (right) == AOP_LIT || AOP_TYPE (right) == AOP_IMMD || - (AOP_TYPE (left) == AOP_DIR && AOP_TYPE (right) == AOP_LIT) || - (IS_AOP_PREG (left) && !IS_AOP_PREG (right))) + (AOP_TYPE (left) == AOP_DIR && AOP_TYPE (right) == AOP_LIT) || (IS_AOP_PREG (left) && !IS_AOP_PREG (right))) { while (size--) { MOVA (aopGet (left, offset, FALSE, FALSE, NULL)); if ((AOP_TYPE (left) == AOP_DIR && AOP_TYPE (right) == AOP_LIT) && ((unsigned int) ((lit >> (offset * 8)) & 0x0FFL) == 0)) - emitcode ("jnz", "!tlabel", lbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (lbl->key)); else - emitcode ("cjne", "a,%s,!tlabel", aopGet (right, offset, FALSE, TRUE, DP2_RESULT_REG), lbl->key + 100); + emitcode ("cjne", "a,%s,!tlabel", aopGet (right, offset, FALSE, TRUE, DP2_RESULT_REG), labelKey2num (lbl->key)); offset++; } } @@ -6928,7 +6853,7 @@ { MOVB (aopGet (left, offset, FALSE, FALSE, NULL)); MOVA (aopGet (right, offset, FALSE, FALSE, NULL)); - emitcode ("cjne", "a,b,!tlabel", lbl->key + 100); + emitcode ("cjne", "a,b,!tlabel", labelKey2num (lbl->key)); offset++; } } @@ -6947,7 +6872,7 @@ gencjneshort (left, right, lbl); MOVA (one); - emitcode ("sjmp", "!tlabel", tlbl->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (tlbl->key)); emitLabel (lbl); MOVA (zero); emitLabel (tlbl); @@ -6959,7 +6884,6 @@ static void genCmpEq (iCode * ic, iCode * ifx) { - bool swappedLR = FALSE; operand *left, *right, *result; iCode *popIc = ic->next; @@ -6974,7 +6898,6 @@ if ((AOP_TYPE (left) == AOP_LIT) || (IS_AOP_PREG (right) && !IS_AOP_PREG (left))) { swapOperands (&left, &right); - swappedLR = TRUE; } if (ifx && /* !AOP_SIZE(result) */ @@ -7006,7 +6929,7 @@ { symbol *lbl = newiTempLabel (NULL); emitcode ("mov", "c,%s", AOP (left)->aopu.aop_dir); - emitcode ("jb", "%s,!tlabel", AOP (right)->aopu.aop_dir, (lbl->key + 100)); + emitcode ("jb", "%s,!tlabel", AOP (right)->aopu.aop_dir, labelKey2num (lbl->key)); emitcode ("cpl", "c"); emitLabel (lbl); } @@ -7015,15 +6938,15 @@ tlbl = newiTempLabel (NULL); if (IC_TRUE (ifx)) { - emitcode ("jnc", "!tlabel", tlbl->key + 100); + emitcode ("jnc", "!tlabel", labelKey2num (tlbl->key)); popForBranch (popIc, FALSE); - emitcode ("ljmp", "!tlabel", IC_TRUE (ifx)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_TRUE (ifx)->key)); } else { - emitcode ("jc", "!tlabel", tlbl->key + 100); + emitcode ("jc", "!tlabel", labelKey2num (tlbl->key)); popForBranch (popIc, FALSE); - emitcode ("ljmp", "!tlabel", IC_FALSE (ifx)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_FALSE (ifx)->key)); } emitLabel (tlbl); } @@ -7034,16 +6957,16 @@ if (IC_TRUE (ifx)) { popForBranch (popIc, FALSE); - emitcode ("ljmp", "!tlabel", IC_TRUE (ifx)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_TRUE (ifx)->key)); emitLabel (tlbl); } else { symbol *lbl = newiTempLabel (NULL); - emitcode ("sjmp", "!tlabel", lbl->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (lbl->key)); emitLabel (tlbl); popForBranch (popIc, FALSE); - emitcode ("ljmp", "!tlabel", IC_FALSE (ifx)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_FALSE (ifx)->key)); emitLabel (lbl); } } @@ -7080,7 +7003,7 @@ { symbol *lbl = newiTempLabel (NULL); emitcode ("mov", "c,%s", AOP (left)->aopu.aop_dir); - emitcode ("jb", "%s,!tlabel", AOP (right)->aopu.aop_dir, (lbl->key + 100)); + emitcode ("jb", "%s,!tlabel", AOP (right)->aopu.aop_dir, labelKey2num (lbl->key)); emitcode ("cpl", "c"); emitLabel (lbl); } @@ -7136,29 +7059,6 @@ } /*-----------------------------------------------------------------*/ -/* ifxForOp - returns the icode containing the ifx for operand */ -/*-----------------------------------------------------------------*/ -static iCode * -ifxForOp (operand * op, iCode * ic) -{ - iCode *ifxIc; - - /* if true symbol then needs to be assigned */ - if (IS_TRUE_SYMOP (op)) - return NULL; - - /* if this has register type condition and - while skipping ipop's (see bug 1509084), - the next instruction is ifx with the same operand - and live to of the operand is upto the ifx only then */ - for (ifxIc = ic->next; ifxIc && ifxIc->op == IPOP; ifxIc = ifxIc->next); - if (ifxIc && ifxIc->op == IFX && IC_COND (ifxIc)->key == op->key && OP_SYMBOL (op)->liveTo <= ifxIc->seq) - return ifxIc; - - return NULL; -} - -/*-----------------------------------------------------------------*/ /* hasInc - operand is incremented before any other use */ /*-----------------------------------------------------------------*/ static iCode * @@ -7234,7 +7134,7 @@ { tlbl = newiTempLabel (NULL); toBoolean (left); - emitcode ("jz", "!tlabel", tlbl->key + 100); + emitcode ("jz", "!tlabel", labelKey2num (tlbl->key)); toBoolean (right); emitLabel (tlbl); freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); @@ -7281,7 +7181,7 @@ { tlbl = newiTempLabel (NULL); toBoolean (left); - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); toBoolean (right); emitLabel (tlbl); freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); @@ -7302,13 +7202,13 @@ isLiteralBit (unsigned long lit) { unsigned long pw[32] = { 1L, 2L, 4L, 8L, 16L, 32L, 64L, 128L, - 0x100L, 0x200L, 0x400L, 0x800L, - 0x1000L, 0x2000L, 0x4000L, 0x8000L, - 0x10000L, 0x20000L, 0x40000L, 0x80000L, - 0x100000L, 0x200000L, 0x400000L, 0x800000L, - 0x1000000L, 0x2000000L, 0x4000000L, 0x8000000L, - 0x10000000L, 0x20000000L, 0x40000000L, 0x80000000L - }; + 0x100L, 0x200L, 0x400L, 0x800L, + 0x1000L, 0x2000L, 0x4000L, 0x8000L, + 0x10000L, 0x20000L, 0x40000L, 0x80000L, + 0x100000L, 0x200000L, 0x400000L, 0x800000L, + 0x1000000L, 0x2000000L, 0x4000000L, 0x8000000L, + 0x10000000L, 0x20000000L, 0x40000000L, 0x80000000L + }; int idx; for (idx = 0; idx < 32; idx++) @@ -7325,7 +7225,7 @@ { if (IC_TRUE (ic)) { - emitcode ("ljmp", "!tlabel", IC_TRUE (ic)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_TRUE (ic)->key)); } ic->generated = 1; } @@ -7338,7 +7238,7 @@ { if (!IC_TRUE (ic)) { - emitcode ("ljmp", "!tlabel", IC_FALSE (ic)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_FALSE (ic)->key)); } ic->generated = 1; } @@ -7353,14 +7253,14 @@ if (IC_TRUE (ic)) { symbol *nlbl = newiTempLabel (NULL); - emitcode ("sjmp", "!tlabel", nlbl->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (nlbl->key)); emitLabel (tlbl); - emitcode ("ljmp", "!tlabel", IC_TRUE (ic)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_TRUE (ic)->key)); emitLabel (nlbl); } else { - emitcode ("ljmp", "!tlabel", IC_FALSE (ic)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_FALSE (ic)->key)); emitLabel (tlbl); } ic->generated = 1; @@ -7378,8 +7278,7 @@ int offset = 0; TR_AP ("#5"); - D (emitcode (";", "%s special case for 3 far operands.", logicOp); - ); + D (emitcode (";", "%s special case for 3 far operands.", logicOp);); compSize = AOP_SIZE (IC_LEFT (ic)) < AOP_SIZE (IC_RIGHT (ic)) ? AOP_SIZE (IC_LEFT (ic)) : AOP_SIZE (IC_RIGHT (ic)); _startLazyDPSEvaluation (); @@ -7446,7 +7345,7 @@ #ifdef LOGIC_OPS_BROKEN || AOP_NEEDSACC (left) #endif - ) + ) { operand *tmp = right; right = left; @@ -7601,12 +7500,12 @@ MOVA (aopGet (left, offset, FALSE, FALSE, NULL)); // byte == 2^n ? if ((posbit = isLiteralBit (bytelit)) != 0) - emitcode ("jb", "acc.%d,!tlabel", (posbit - 1) & 0x07, tlbl->key + 100); + emitcode ("jb", "acc.%d,!tlabel", (posbit - 1) & 0x07, labelKey2num (tlbl->key)); else { if (bytelit != 0x0FFL) emitcode ("anl", "a,%s", aopGet (right, offset, FALSE, TRUE, DP2_RESULT_REG)); - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); } } offset++; @@ -7727,7 +7626,8 @@ else if (AOP_TYPE (left) == AOP_ACC) { if (!offset) - { //B contains high byte of left + { + //B contains high byte of left emitpush ("b"); emitcode ("mov", "b,a"); MOVA (aopGet (right, offset, FALSE, FALSE, NULL)); @@ -7757,7 +7657,7 @@ emitcode ("anl", "a,%s", aopGet (left, offset, FALSE, FALSE, DP2_RESULT_REG)); } - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); offset++; } if (size) @@ -7814,7 +7714,8 @@ else if (AOP_TYPE (left) == AOP_ACC) { if (!offset) - { //B contains high byte of left + { + //B contains high byte of left emitpush ("b"); emitcode ("mov", "b,a"); MOVA (aopGet (right, offset, FALSE, FALSE, NULL)); @@ -7888,7 +7789,7 @@ #ifdef LOGIC_OPS_BROKEN || AOP_NEEDSACC (left) // I think this is a net loss now. #endif - ) + ) { operand *tmp = right; right = left; @@ -7970,9 +7871,9 @@ symbol *tlbl = newiTempLabel (NULL); if (!((AOP_TYPE (result) == AOP_CRY) && ifx)) emitcode ("setb", "c"); - emitcode ("jb", "%s,!tlabel", AOP (left)->aopu.aop_dir, tlbl->key + 100); + emitcode ("jb", "%s,!tlabel", AOP (left)->aopu.aop_dir, labelKey2num (tlbl->key)); toBoolean (right); - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); if ((AOP_TYPE (result) == AOP_CRY) && ifx) { jmpTrueOrFalse (ifx, tlbl); @@ -8017,12 +7918,13 @@ if (size) { symbol *tlbl = newiTempLabel (NULL); - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); CLRC; emitLabel (tlbl); } else - { /* FIXME, thats pretty fishy, check for ifx!=0, testcase .. */ + { + /* FIXME, thats pretty fishy, check for ifx!=0, testcase .. */ assert (ifx); genIfxJump (ifx, "a", ic->next); goto release; @@ -8128,7 +8030,8 @@ else if (AOP_TYPE (left) == AOP_ACC) { if (!offset) - { //B contains high byte of left + { + //B contains high byte of left emitpush ("b"); emitcode ("mov", "b,a"); MOVA (aopGet (right, offset, FALSE, FALSE, DP2_RESULT_REG)); @@ -8158,7 +8061,7 @@ emitcode ("orl", "a,%s", aopGet (left, offset, FALSE, FALSE, DP2_RESULT_REG)); } - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); offset++; } if (size) @@ -8208,7 +8111,8 @@ else if (AOP_TYPE (left) == AOP_ACC) { if (!offset) - { //B contains high byte of left + { + //B contains high byte of left emitpush ("b"); emitcode ("mov", "b,a"); MOVA (aopGet (right, offset, FALSE, FALSE, DP2_RESULT_REG)); @@ -8283,7 +8187,7 @@ #ifdef LOGIC_OPS_BROKEN || (AOP_NEEDSACC (left) && !AOP_NEEDSACC (right)) #endif - ) + ) { operand *tmp = right; right = left; @@ -8366,7 +8270,8 @@ { // c = bit ^ bit; if (IS_OP_ACCUSE (left)) - { // left already is in the carry + { + // left already is in the carry operand *tmp = right; right = left; left = tmp; @@ -8381,7 +8286,7 @@ // c = bit ^ val toCarry (right); } - emitcode ("jnb", "%s,!tlabel", AOP (left)->aopu.aop_dir, (tlbl->key + 100)); + emitcode ("jnb", "%s,!tlabel", AOP (left)->aopu.aop_dir, labelKey2num (tlbl->key)); emitcode ("cpl", "c"); emitLabel (tlbl); } @@ -8492,7 +8397,8 @@ else if (AOP_TYPE (left) == AOP_ACC) { if (!offset) - { //B contains high byte of left + { + //B contains high byte of left emitpush ("b"); emitcode ("mov", "b,a"); MOVA (aopGet (right, offset, FALSE, FALSE, DP2_RESULT_REG)); @@ -8522,7 +8428,7 @@ emitcode ("xrl", "a,%s", aopGet (left, offset, FALSE, TRUE, DP2_RESULT_REG)); } - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); offset++; } if (size) @@ -8589,62 +8495,6 @@ } /*-----------------------------------------------------------------*/ -/* genInline - write the inline code out */ -/*-----------------------------------------------------------------*/ -static void -genInline (iCode * ic) -{ - char *buf, *bp, *bp1; - bool inComment = FALSE; - - D (emitcode (";", "genInline")); - - _G.inLine += (!options.asmpeep); - - buf = bp = bp1 = Safe_strdup (IC_INLINE (ic)); - - /* emit each line as a code */ - while (*bp) - { - switch (*bp) - { - case ';': - inComment = TRUE; - ++bp; - break; - - case '\x87': - case '\n': - inComment = FALSE; - *bp++ = '\0'; - emitcode (bp1, ""); - bp1 = bp; - break; - - default: - /* Add \n for labels, not dirs such as c:\mydir */ - if (!inComment && (*bp == ':') && (isspace ((unsigned char) bp[1]))) - { - ++bp; - *bp = '\0'; - ++bp; - emitcode (bp1, ""); - bp1 = bp; - } - else - ++bp; - break; - } - } - if (bp1 != bp) - emitcode (bp1, ""); - - Safe_free (buf); - - _G.inLine -= (!options.asmpeep); -} - -/*-----------------------------------------------------------------*/ /* genRRC - rotate right with carry */ /*-----------------------------------------------------------------*/ static void @@ -8952,7 +8802,7 @@ AccRol (8 - shCount); /* and kill the higher order bits */ emitcode ("anl", "a,#!constbyte", SRMask[shCount]); - emitcode ("jnb", "acc.%d,!tlabel", 7 - shCount, tlbl->key + 100); + emitcode ("jnb", "acc.%d,!tlabel", 7 - shCount, labelKey2num (tlbl->key)); emitcode ("orl", "a,#!constbyte", (unsigned char) ~SRMask[shCount]); emitLabel (tlbl); } @@ -9078,40 +8928,40 @@ break; case 3: case 4: - case 5: // AAAAABBB:CCCCCDDD + case 5: // AAAAABBB:CCCCCDDD mask = SLMask[shCount]; - AccRol (shCount); // BBBAAAAA:CCCCCDDD + AccRol (shCount); // BBBAAAAA:CCCCCDDD emitcode ("anl", "a,#!constbyte", mask); // BBB00000:CCCCCDDD - emitcode ("xch", "a,%s", x); // CCCCCDDD:BBB00000 - AccRol (shCount); // DDDCCCCC:BBB00000 - emitcode ("xch", "a,%s", x); // BBB00000:DDDCCCCC - emitcode ("xrl", "a,%s", x); // (BBB^DDD)CCCCC:DDDCCCCC - emitcode ("xch", "a,%s", x); // DDDCCCCC:(BBB^DDD)CCCCC + emitcode ("xch", "a,%s", x); // CCCCCDDD:BBB00000 + AccRol (shCount); // DDDCCCCC:BBB00000 + emitcode ("xch", "a,%s", x); // BBB00000:DDDCCCCC + emitcode ("xrl", "a,%s", x); // (BBB^DDD)CCCCC:DDDCCCCC + emitcode ("xch", "a,%s", x); // DDDCCCCC:(BBB^DDD)CCCCC emitcode ("anl", "a,#!constbyte", mask); // DDD00000:(BBB^DDD)CCCCC - emitcode ("xch", "a,%s", x); // (BBB^DDD)CCCCC:DDD00000 - emitcode ("xrl", "a,%s", x); // BBBCCCCC:DDD00000 + emitcode ("xch", "a,%s", x); // (BBB^DDD)CCCCC:DDD00000 + emitcode ("xrl", "a,%s", x); // BBBCCCCC:DDD00000 break; - case 6: // AAAAAABB:CCCCCCDD + case 6: // AAAAAABB:CCCCCCDD mask = SRMask[shCount]; emitcode ("anl", "a,#!constbyte", mask); // 000000BB:CCCCCCDD - emitcode ("mov", "c,acc.0"); // c = B - emitcode ("xch", "a,%s", x); // CCCCCCDD:000000BB + emitcode ("mov", "c,acc.0"); // c = B + emitcode ("xch", "a,%s", x); // CCCCCCDD:000000BB emitcode ("rrc", "a"); emitcode ("xch", "a,%s", x); emitcode ("rrc", "a"); - emitcode ("mov", "c,acc.0"); //<< get correct bit + emitcode ("mov", "c,acc.0"); //<< get correct bit emitcode ("xch", "a,%s", x); emitcode ("rrc", "a"); emitcode ("xch", "a,%s", x); emitcode ("rrc", "a"); emitcode ("xch", "a,%s", x); break; - case 7: // a:x <<= 7 + case 7: // a:x <<= 7 mask = SRMask[shCount]; emitcode ("anl", "a,#!constbyte", mask); // 0000000B:CCCCCCCD - emitcode ("mov", "c,acc.0"); // c = B - emitcode ("xch", "a,%s", x); // CCCCCCCD:0000000B - AccAXRrl1 (x); // BCCCCCCC:D0000000 + emitcode ("mov", "c,acc.0"); // c = B + emitcode ("xch", "a,%s", x); // CCCCCCCD:0000000B + AccAXRrl1 (x); // BCCCCCCC:D0000000 break; default: break; @@ -9132,40 +8982,40 @@ break; case 1: CLRC; - AccAXRrl1 (x); // 0->a:x + AccAXRrl1 (x); // 0->a:x break; case 2: CLRC; - AccAXRrl1 (x); // 0->a:x + AccAXRrl1 (x); // 0->a:x CLRC; - AccAXRrl1 (x); // 0->a:x + AccAXRrl1 (x); // 0->a:x break; case 3: case 4: - case 5: // AAAAABBB:CCCCCDDD = a:x - AccRol (8 - shCount); // BBBAAAAA:DDDCCCCC - emitcode ("xch", "a,%s", x); // CCCCCDDD:BBBAAAAA - AccRol (8 - shCount); // DDDCCCCC:BBBAAAAA + case 5: // AAAAABBB:CCCCCDDD = a:x + AccRol (8 - shCount); // BBBAAAAA:DDDCCCCC + emitcode ("xch", "a,%s", x); // CCCCCDDD:BBBAAAAA + AccRol (8 - shCount); // DDDCCCCC:BBBAAAAA emitcode ("anl", "a,#!constbyte", mask); // 000CCCCC:BBBAAAAA - emitcode ("xrl", "a,%s", x); // BBB(CCCCC^AAAAA):BBBAAAAA - emitcode ("xch", "a,%s", x); // BBBAAAAA:BBB(CCCCC^AAAAA) + emitcode ("xrl", "a,%s", x); // BBB(CCCCC^AAAAA):BBBAAAAA + emitcode ("xch", "a,%s", x); // BBBAAAAA:BBB(CCCCC^AAAAA) emitcode ("anl", "a,#!constbyte", mask); // 000AAAAA:BBB(CCCCC^AAAAA) - emitcode ("xch", "a,%s", x); // BBB(CCCCC^AAAAA):000AAAAA - emitcode ("xrl", "a,%s", x); // BBBCCCCC:000AAAAA - emitcode ("xch", "a,%s", x); // 000AAAAA:BBBCCCCC + emitcode ("xch", "a,%s", x); // BBB(CCCCC^AAAAA):000AAAAA + emitcode ("xrl", "a,%s", x); // BBBCCCCC:000AAAAA + emitcode ("xch", "a,%s", x); // 000AAAAA:BBBCCCCC break; - case 6: // AABBBBBB:CCDDDDDD + case 6: // AABBBBBB:CCDDDDDD emitcode ("mov", "c,acc.7"); - AccAXLrl1 (x); // ABBBBBBC:CDDDDDDA + AccAXLrl1 (x); // ABBBBBBC:CDDDDDDA emitcode ("mov", "c,acc.7"); - AccAXLrl1 (x); // BBBBBBCC:DDDDDDAA - emitcode ("xch", "a,%s", x); // DDDDDDAA:BBBBBBCC + AccAXLrl1 (x); // BBBBBBCC:DDDDDDAA + emitcode ("xch", "a,%s", x); // DDDDDDAA:BBBBBBCC emitcode ("anl", "a,#!constbyte", mask); // 000000AA:BBBBBBCC break; - case 7: // ABBBBBBB:CDDDDDDD - emitcode ("mov", "c,acc.7"); // c = A - AccAXLrl1 (x); // BBBBBBBC:DDDDDDDA - emitcode ("xch", "a,%s", x); // DDDDDDDA:BBBBBBCC + case 7: // ABBBBBBB:CDDDDDDD + emitcode ("mov", "c,acc.7"); // c = A + AccAXLrl1 (x); // BBBBBBBC:DDDDDDDA + emitcode ("xch", "a,%s", x); // DDDDDDDA:BBBBBBCC emitcode ("anl", "a,#!constbyte", mask); // 0000000A:BBBBBBBC break; default: @@ -9188,53 +9038,53 @@ break; case 1: emitcode ("mov", "c,acc.7"); - AccAXRrl1 (x); // s->a:x + AccAXRrl1 (x); // s->a:x break; case 2: emitcode ("mov", "c,acc.7"); - AccAXRrl1 (x); // s->a:x + AccAXRrl1 (x); // s->a:x emitcode ("mov", "c,acc.7"); - AccAXRrl1 (x); // s->a:x + AccAXRrl1 (x); // s->a:x break; case 3: case 4: - case 5: // AAAAABBB:CCCCCDDD = a:x + case 5: // AAAAABBB:CCCCCDDD = a:x tlbl = newiTempLabel (NULL); - AccRol (8 - shCount); // BBBAAAAA:CCCCCDDD - emitcode ("xch", "a,%s", x); // CCCCCDDD:BBBAAAAA - AccRol (8 - shCount); // DDDCCCCC:BBBAAAAA + AccRol (8 - shCount); // BBBAAAAA:CCCCCDDD + emitcode ("xch", "a,%s", x); // CCCCCDDD:BBBAAAAA + AccRol (8 - shCount); // DDDCCCCC:BBBAAAAA emitcode ("anl", "a,#!constbyte", mask); // 000CCCCC:BBBAAAAA - emitcode ("xrl", "a,%s", x); // BBB(CCCCC^AAAAA):BBBAAAAA - emitcode ("xch", "a,%s", x); // BBBAAAAA:BBB(CCCCC^AAAAA) + emitcode ("xrl", "a,%s", x); // BBB(CCCCC^AAAAA):BBBAAAAA + emitcode ("xch", "a,%s", x); // BBBAAAAA:BBB(CCCCC^AAAAA) emitcode ("anl", "a,#!constbyte", mask); // 000AAAAA:BBB(CCCCC^AAAAA) - emitcode ("xch", "a,%s", x); // BBB(CCCCC^AAAAA):000AAAAA - emitcode ("xrl", "a,%s", x); // BBBCCCCC:000AAAAA - emitcode ("xch", "a,%s", x); // 000SAAAA:BBBCCCCC - emitcode ("jnb", "acc.%d,!tlabel", 7 - shCount, tlbl->key + 100); + emitcode ("xch", "a,%s", x); // BBB(CCCCC^AAAAA):000AAAAA + emitcode ("xrl", "a,%s", x); // BBBCCCCC:000AAAAA + emitcode ("xch", "a,%s", x); // 000SAAAA:BBBCCCCC + emitcode ("jnb", "acc.%d,!tlabel", 7 - shCount, labelKey2num (tlbl->key)); mask = ~SRMask[shCount]; emitcode ("orl", "a,#!constbyte", mask); // 111AAAAA:BBBCCCCC emitLabel (tlbl); - break; // SSSSAAAA:BBBCCCCC - case 6: // AABBBBBB:CCDDDDDD + break; // SSSSAAAA:BBBCCCCC + case 6: // AABBBBBB:CCDDDDDD tlbl = newiTempLabel (NULL); emitcode ("mov", "c,acc.7"); - AccAXLrl1 (x); // ABBBBBBC:CDDDDDDA + AccAXLrl1 (x); // ABBBBBBC:CDDDDDDA emitcode ("mov", "c,acc.7"); - AccAXLrl1 (x); // BBBBBBCC:DDDDDDAA - emitcode ("xch", "a,%s", x); // DDDDDDAA:BBBBBBCC + AccAXLrl1 (x); // BBBBBBCC:DDDDDDAA + emitcode ("xch", "a,%s", x); // DDDDDDAA:BBBBBBCC emitcode ("anl", "a,#!constbyte", mask); // 000000AA:BBBBBBCC - emitcode ("jnb", "acc.%d,!tlabel", 7 - shCount, tlbl->key + 100); + emitcode ("jnb", "acc.%d,!tlabel", 7 - shCount, labelKey2num (tlbl->key)); mask = ~SRMask[shCount]; emitcode ("orl", "a,#!constbyte", mask); // 111111AA:BBBBBBCC emitLabel (tlbl); break; - case 7: // ABBBBBBB:CDDDDDDD + case 7: // ABBBBBBB:CDDDDDDD tlbl = newiTempLabel (NULL); - emitcode ("mov", "c,acc.7"); // c = A - AccAXLrl1 (x); // BBBBBBBC:DDDDDDDA - emitcode ("xch", "a,%s", x); // DDDDDDDA:BBBBBBCC + emitcode ("mov", "c,acc.7"); // c = A + AccAXLrl1 (x); // BBBBBBBC:DDDDDDDA + emitcode ("xch", "a,%s", x); // DDDDDDDA:BBBBBBCC emitcode ("anl", "a,#!constbyte", mask); // 0000000A:BBBBBBBC - emitcode ("jnb", "acc.%d,!tlabel", 7 - shCount, tlbl->key + 100); + emitcode ("jnb", "acc.%d,!tlabel", 7 - shCount, labelKey2num (tlbl->key)); mask = ~SRMask[shCount]; emitcode ("orl", "a,#!constbyte", mask); // 1111111A:BBBBBBBC emitLabel (tlbl); @@ -9585,7 +9435,8 @@ movLeft2Result (left, LSB, result, MSB16, 0); } else - { /* size = 4 */ + { + /* size = 4 */ if (shCount == 0) { movLeft2Result (left, MSB24, result, MSB32, 0); @@ -9771,11 +9622,11 @@ symbol *tlbl1 = newiTempLabel (NULL); MOVA (aopGet (left, 0, FALSE, FALSE, NULL)); - emitcode ("sjmp", "!tlabel", tlbl1->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (tlbl1->key)); emitLabel (tlbl); emitcode ("add", "a,acc"); emitLabel (tlbl1); - emitcode ("djnz", "b,!tlabel", tlbl->key + 100); + emitcode ("djnz", "b,!tlabel", labelKey2num (tlbl->key)); popB (pushedB); aopPut (result, "a", 0); goto release; @@ -9783,7 +9634,7 @@ reAdjustPreg (AOP (result)); - emitcode ("sjmp", "!tlabel", tlbl1->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (tlbl1->key)); emitLabel (tlbl); MOVA (aopGet (result, offset, FALSE, FALSE, NULL)); emitcode ("add", "a,acc"); @@ -9799,7 +9650,7 @@ reAdjustPreg (AOP (result)); emitLabel (tlbl1); - emitcode ("djnz", "b,!tlabel", tlbl->key + 100); + emitcode ("djnz", "b,!tlabel", labelKey2num (tlbl->key)); popB (pushedB); release: freeAsmop (result, NULL, ic, TRUE); @@ -10178,19 +10029,19 @@ if (size == 1) { MOVA (aopGet (left, 0, FALSE, FALSE, NULL)); - emitcode ("sjmp", "!tlabel", tlbl1->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (tlbl1->key)); emitLabel (tlbl); emitcode ("mov", "c,ov"); emitcode ("rrc", "a"); emitLabel (tlbl1); - emitcode ("djnz", "b,!tlabel", tlbl->key + 100); + emitcode ("djnz", "b,!tlabel", labelKey2num (tlbl->key)); popB (pushedB); aopPut (result, "a", 0); goto release; } reAdjustPreg (AOP (result)); - emitcode ("sjmp", "!tlabel", tlbl1->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (tlbl1->key)); emitLabel (tlbl); emitcode ("mov", "c,ov"); _startLazyDPSEvaluation (); @@ -10203,7 +10054,7 @@ _endLazyDPSEvaluation (); reAdjustPreg (AOP (result)); emitLabel (tlbl1); - emitcode ("djnz", "b,!tlabel", tlbl->key + 100); + emitcode ("djnz", "b,!tlabel", labelKey2num (tlbl->key)); popB (pushedB); release: @@ -10312,19 +10163,19 @@ if (size == 1) { MOVA (aopGet (left, 0, FALSE, FALSE, NULL)); - emitcode ("sjmp", "!tlabel", tlbl1->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (tlbl1->key)); emitLabel (tlbl); CLRC; emitcode ("rrc", "a"); emitLabel (tlbl1); - emitcode ("djnz", "b,!tlabel", tlbl->key + 100); + emitcode ("djnz", "b,!tlabel", labelKey2num (tlbl->key)); popB (pushedB); aopPut (result, "a", 0); goto release; } reAdjustPreg (AOP (result)); - emitcode ("sjmp", "!tlabel", tlbl1->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (tlbl1->key)); emitLabel (tlbl); CLRC; _startLazyDPSEvaluation (); @@ -10338,7 +10189,7 @@ reAdjustPreg (AOP (result)); emitLabel (tlbl1); - emitcode ("djnz", "b,!tlabel", tlbl->key + 100); + emitcode ("djnz", "b,!tlabel", labelKey2num (tlbl->key)); popB (pushedB); release: @@ -10457,13 +10308,13 @@ { emitPtrByteGet (rname, ptype, FALSE); AccRol (8 - bstr); - emitcode ("anl", "a,#!constbyte", ((unsigned char) -1) >> (8 - blen)); + emitcode ("anl", "a,#!constbyte", ((unsigned char) - 1) >> (8 - blen)); if (!SPEC_USIGN (etype)) { /* signed bitfield */ symbol *tlbl = newiTempLabel (NULL); - emitcode ("jnb", "acc.%d,!tlabel", blen - 1, tlbl->key + 100); + emitcode ("jnb", "acc.%d,!tlabel", blen - 1, labelKey2num (tlbl->key)); emitcode ("orl", "a,#0x%02x", (unsigned char) (0xff << blen)); emitLabel (tlbl); } @@ -10485,13 +10336,13 @@ if (rlen) { emitPtrByteGet (rname, ptype, FALSE); - emitcode ("anl", "a,#!constbyte", ((unsigned char) -1) >> (8 - rlen)); + emitcode ("anl", "a,#!constbyte", ((unsigned char) - 1) >> (8 - rlen)); if (!SPEC_USIGN (etype)) { /* signed bitfield */ symbol *tlbl = newiTempLabel (NULL); - emitcode ("jnb", "acc.%d,!tlabel", rlen - 1, tlbl->key + 100); + emitcode ("jnb", "acc.%d,!tlabel", rlen - 1, labelKey2num (tlbl->key)); emitcode ("orl", "a,#0x%02x", (unsigned char) (0xff << rlen)); emitLabel (tlbl); } @@ -10534,7 +10385,7 @@ aopOp (result, ic, TRUE, FALSE); /* get the string representation of the name */ - l = aopGet (left, 0, FALSE, TRUE, NULL) + 1; // remove # + l = aopGet (left, 0, FALSE, TRUE, NULL) + 1; // remove # size = AOP_SIZE (result); _startLazyDPSEvaluation (); while (size--) @@ -10641,7 +10492,8 @@ if (aop) /* we had to allocate for this iCode */ { if (pi) - { /* post increment present */ + { + /* post increment present */ aopPut (left, rname, 0); } freeAsmop (NULL, aop, ic, TRUE); @@ -10971,19 +10823,20 @@ static void genGenPointerGet (operand * left, operand * result, iCode * ic, iCode * pi) { - int size, offset; + int size, offset, dopi; bool pushedB; sym_link *retype = getSpec (operandType (result)); sym_link *letype = getSpec (operandType (left)); D (emitcode (";", "genGenPointerGet")); - aopOp (left, ic, FALSE, (IS_OP_RUONLY (left) ? FALSE : TRUE)); + aopOp (left, ic, FALSE, FALSE); + pushedB = pushB (); - loadDptrFromOperand (left, TRUE); + dopi = loadDptrFromOperand (left, TRUE); /* so dptr-b now contains the address */ - aopOp (result, ic, FALSE, TRUE); + aopOp (result, ic, FALSE, (AOP_INDPTRn (left) ? FALSE : TRUE)); /* if bit then unpack */ if (IS_BITFIELD (retype) || IS_BITFIELD (letype)) @@ -11017,14 +10870,14 @@ aopPut (result, "a", offset++); } - if (size || (pi && AOP_TYPE (left) != AOP_IMMD)) + if (size || (dopi && pi && AOP_TYPE (left) != AOP_IMMD)) { emitcode ("inc", "dptr"); } } } - if (pi && AOP_TYPE (left) != AOP_IMMD) + if (dopi && pi && AOP_TYPE (left) != AOP_IMMD) { _startLazyDPSEvaluation (); @@ -11042,9 +10895,8 @@ pi->generated = 1; } - else if (OP_SYMBOL (left)->ruonly && AOP_SIZE (result) > 1 && (OP_SYMBOL (left)->liveTo > ic->seq || ic->depth)) + else if (IS_OP_RUONLY (left) && AOP_SIZE (result) > 1 && (OP_SYMBOL (left)->liveTo > ic->seq || ic->depth)) { - size = AOP_SIZE (result) - 1; while (size--) emitcode ("lcall", "__decdptr"); @@ -11211,7 +11063,7 @@ /* If there was a partial byte at the end */ if (rlen) { - mask = (((unsigned char) -1 << rlen) & 0xff); + mask = (((unsigned char) - 1 << rlen) & 0xff); if (AOP_TYPE (right) == AOP_LIT) { @@ -11586,20 +11438,19 @@ static void genGenPointerSet (operand * right, operand * result, iCode * ic, iCode * pi) { - int size, offset; + int size, offset, dopi; bool pushedB; sym_link *retype = getSpec (operandType (right)); sym_link *letype = getSpec (operandType (result)); D (emitcode (";", "genGenPointerSet")); - aopOp (result, ic, FALSE, IS_OP_RUONLY (result) ? FALSE : TRUE); - + aopOp (result, ic, FALSE, FALSE); pushedB = pushB (); - loadDptrFromOperand (result, TRUE); + dopi = loadDptrFromOperand (result, TRUE); /* so dptr-b now contains the address */ - aopOp (right, ic, FALSE, TRUE); + aopOp (right, ic, FALSE, (AOP_INDPTRn (result) ? FALSE : TRUE)); /* if bit then unpack */ if (IS_BITFIELD (retype) || IS_BITFIELD (letype)) @@ -11640,7 +11491,7 @@ emitcode ("lcall", "__gptrput"); } - if (size || (pi && AOP_TYPE (result) != AOP_IMMD)) + if (size || (dopi && pi && AOP_TYPE (result) != AOP_IMMD)) { emitcode ("inc", "dptr"); } @@ -11648,7 +11499,7 @@ _endLazyDPSEvaluation (); } - if (pi && AOP_TYPE (result) != AOP_IMMD) + if (dopi && pi && AOP_TYPE (result) != AOP_IMMD) { _startLazyDPSEvaluation (); @@ -11667,7 +11518,7 @@ pi->generated = 1; } - else if (IS_SYMOP (result) && OP_SYMBOL (result)->ruonly && AOP_SIZE (right) > 1 && + else if (IS_SYMOP (result) && IS_OP_RUONLY (result) && AOP_SIZE (right) > 1 && (OP_SYMBOL (result)->liveTo > ic->seq || ic->depth)) { size = AOP_SIZE (right) - 1; @@ -11818,14 +11669,14 @@ dbuf_init (&dbuf, 128); dbuf_tprintf (&dbuf, "#!constbyte", (options.stack_loc >> 16) & 0xff); /* if it has an offset then we need to compute it */ -/* emitcode ("subb", "a,#!constbyte", */ -/* -((sym->stack < 0) ? */ -/* ((short) (sym->stack - _G.nRegsSaved)) : */ -/* ((short) sym->stack)) & 0xff); */ -/* emitcode ("mov","b,a"); */ -/* emitcode ("mov","a,#!constbyte",(-((sym->stack < 0) ? */ -/* ((short) (sym->stack - _G.nRegsSaved)) : */ -/* ((short) sym->stack)) >> 8) & 0xff); */ + /* emitcode ("subb", "a,#!constbyte", */ + /* -((sym->stack < 0) ? */ + /* ((short) (sym->stack - _G.nRegsSaved)) : */ + /* ((short) sym->stack)) & 0xff); */ + /* emitcode ("mov","b,a"); */ + /* emitcode ("mov","a,#!constbyte",(-((sym->stack < 0) ? */ + /* ((short) (sym->stack - _G.nRegsSaved)) : */ + /* ((short) sym->stack)) >> 8) & 0xff); */ if (sym->stack) { emitcode ("mov", "a,_bpx"); @@ -11997,7 +11848,7 @@ freeAsmop (right, NULL, ic, FALSE); #if 0 some alternative code for processors without auto - toggle - no time to test now, so later well put in ... kpb D (emitcode (";", "genFarFarAssign (dual-dptr fun)")); + no time to test now, so later well put in ... kpb D (emitcode (";", "genFarFarAssign (dual-dptr fun)")); emitcode ("mov", "dps,#1"); /* Select DPTR2. */ emitcode ("mov", "dptr,#%s", rSym->rname); /* DP2 = result, DP1 = right, DP1 is current. */ @@ -12054,7 +11905,11 @@ if (operandsEqu (result, right) && !isOperandVolatile (result, FALSE) && !isOperandVolatile (right, FALSE)) return; - aopOp (right, ic, FALSE, FALSE); + /* if both are ruonly */ + if (IS_OP_RUONLY (right) && IS_OP_RUONLY (result)) + return; + + aopOp (right, ic, FALSE, IS_OP_RUONLY (result)); emitcode (";", "genAssign: resultIsFar = %s", isOperandInFarSpace (result) ? "TRUE" : "FALSE"); @@ -12185,12 +12040,12 @@ freeAsmop (IC_JTCOND (ic), NULL, ic, TRUE); jtab = newiTempLabel (NULL); - emitcode ("mov", "dptr,#!tlabel", jtab->key + 100); + emitcode ("mov", "dptr,#!tlabel", labelKey2num (jtab->key)); emitcode ("jmp", "@a+dptr"); emitLabel (jtab); /* now generate the jump labels */ for (jtab = setFirstItem (IC_JTLABELS (ic)); jtab; jtab = setNextItem (IC_JTLABELS (ic))) - emitcode ("ljmp", "!tlabel", jtab->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (jtab->key)); } /*-----------------------------------------------------------------*/ @@ -12471,7 +12326,8 @@ emitcode ("mov", "dptr,%s", aopGet (to, 0, TRUE, FALSE, NULL)); } else - { /* we need to get it byte by byte */ + { + /* we need to get it byte by byte */ emitcode ("mov", "dpl,%s", aopGet (to, 0, FALSE, FALSE, NULL)); emitcode ("mov", "dph,%s", aopGet (to, 1, FALSE, FALSE, NULL)); if (options.model == MODEL_FLAT24) @@ -12523,14 +12379,14 @@ emitcode ("inc", "dptr"); emitcode ("mov", "a,b"); emitcode ("orl", "a,_ap"); - emitcode ("jz", "!tlabel", lbl1->key + 100); + emitcode ("jz", "!tlabel", labelKey2num (lbl1->key)); emitcode ("mov", "a,_ap"); emitcode ("add", "a,#!constbyte", 0xFF); emitcode ("mov", "_ap,a"); emitcode ("mov", "a,b"); emitcode ("addc", "a,#!constbyte", 0xFF); emitcode ("mov", "b,a"); - emitcode ("sjmp", "!tlabel", lbl->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (lbl->key)); emitLabel (lbl1); } emitcode ("mov", "dps,#0"); @@ -12603,7 +12459,8 @@ emitcode ("mov", "dptr,%s", aopGet (to, 0, TRUE, FALSE, NULL)); } else - { /* we need to get it byte by byte */ + { + /* we need to get it byte by byte */ emitcode ("mov", "dpl,%s", aopGet (to, 0, FALSE, FALSE, NULL)); emitcode ("mov", "dph,%s", aopGet (to, 1, FALSE, FALSE, NULL)); if (options.model == MODEL_FLAT24) @@ -12655,19 +12512,19 @@ emitcode ("movx", "a,@dptr"); emitcode ("clr", "c"); emitcode ("subb", "a,r0"); - emitcode ("jnz", "!tlabel", lbl2->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (lbl2->key)); emitcode ("inc", "dptr"); emitcode ("inc", "dptr"); emitcode ("mov", "a,b"); emitcode ("orl", "a,_ap"); - emitcode ("jz", "!tlabel", lbl1->key + 100); + emitcode ("jz", "!tlabel", labelKey2num (lbl1->key)); emitcode ("mov", "a,_ap"); emitcode ("add", "a,#!constbyte", 0xFF); emitcode ("mov", "_ap,a"); emitcode ("mov", "a,b"); emitcode ("addc", "a,#!constbyte", 0xFF); emitcode ("mov", "b,a"); - emitcode ("sjmp", "!tlabel", lbl->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (lbl->key)); emitLabel (lbl1); emitcode ("clr", "a"); emitLabel (lbl2); @@ -12748,7 +12605,8 @@ emitcode ("mov", "dptr,%s", aopGet (to, 0, TRUE, FALSE, NULL)); } else - { /* we need to get it byte by byte */ + { + /* we need to get it byte by byte */ emitcode ("mov", "dpl,%s", aopGet (to, 0, FALSE, FALSE, NULL)); emitcode ("mov", "dph,%s", aopGet (to, 1, FALSE, FALSE, NULL)); if (options.model == MODEL_FLAT24) @@ -12778,7 +12636,7 @@ emitcode ("movx", "@dptr,a"); /* save into location */ emitcode ("inc", "dptr"); /* point to next area */ emitcode ("inc", "dps"); /* switch to DPTR2 */ - emitcode ("djnz", "b,!tlabel", lbl->key + 100); + emitcode ("djnz", "b,!tlabel", labelKey2num (lbl->key)); } else { @@ -12795,18 +12653,18 @@ emitcode ("movx", "@dptr,a"); emitcode ("inc", "dptr"); emitcode ("inc", "dps"); /* switch to DPTR2 */ -/* emitcode ("djnz","b,!tlabel",lbl->key+100); */ -/* emitcode ("djnz","_ap,!tlabel",lbl->key+100); */ + /* emitcode ("djnz","b,!tlabel",lbl->key+100); */ + /* emitcode ("djnz","_ap,!tlabel",lbl->key+100); */ emitcode ("mov", "a,b"); emitcode ("orl", "a,_ap"); - emitcode ("jz", "!tlabel", lbl1->key + 100); + emitcode ("jz", "!tlabel", labelKey2num (lbl1->key)); emitcode ("mov", "a,_ap"); emitcode ("add", "a,#!constbyte", 0xFF); emitcode ("mov", "_ap,a"); emitcode ("mov", "a,b"); emitcode ("addc", "a,#!constbyte", 0xFF); emitcode ("mov", "b,a"); - emitcode ("sjmp", "!tlabel", lbl->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (lbl->key)); emitLabel (lbl1); } emitcode ("mov", "dps,#0"); @@ -12881,7 +12739,8 @@ emitcode ("mov", "dptr,%s", aopGet (to, 0, TRUE, FALSE, NULL)); } else - { /* we need to get it byte by byte */ + { + /* we need to get it byte by byte */ emitcode ("mov", "dpl,%s", aopGet (to, 0, FALSE, FALSE, NULL)); emitcode ("mov", "dph,%s", aopGet (to, 1, FALSE, FALSE, NULL)); if (options.model == MODEL_FLAT24) @@ -12910,7 +12769,7 @@ emitcode ("movx", "@dptr,a"); /* save into location */ emitcode ("inc", "dptr"); /* point to next area */ emitcode ("dec", "dps"); /* switch to DPTR */ - emitcode ("djnz", "b,!tlabel", lbl->key + 100); + emitcode ("djnz", "b,!tlabel", labelKey2num (lbl->key)); freeAsmop (count, NULL, ic, FALSE); } else @@ -12930,14 +12789,14 @@ emitcode ("dec", "dps"); /* switch to DPTR */ emitcode ("mov", "a,b"); emitcode ("orl", "a,_ap"); - emitcode ("jz", "!tlabel", lbl1->key + 100); + emitcode ("jz", "!tlabel", labelKey2num (lbl1->key)); emitcode ("mov", "a,_ap"); emitcode ("add", "a,#!constbyte", 0xFF); emitcode ("mov", "_ap,a"); emitcode ("mov", "a,b"); emitcode ("addc", "a,#!constbyte", 0xFF); emitcode ("mov", "b,a"); - emitcode ("sjmp", "!tlabel", lbl->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (lbl->key)); emitLabel (lbl1); } emitcode ("mov", "dps,#0"); @@ -13027,7 +12886,8 @@ emitcode ("mov", "dptr,%s", aopGet (to, 0, TRUE, FALSE, NULL)); } else - { /* we need to get it byte by byte */ + { + /* we need to get it byte by byte */ emitcode ("mov", "dpl,%s", aopGet (to, 0, FALSE, FALSE, NULL)); emitcode ("mov", "dph,%s", aopGet (to, 1, FALSE, FALSE, NULL)); if (options.model == MODEL_FLAT24) @@ -13053,7 +12913,7 @@ emitLabel (lbl); emitcode ("movx", "@dptr,a"); emitcode ("inc", "dptr"); - emitcode ("djnz", "b,!tlabel", lbl->key + 100); + emitcode ("djnz", "b,!tlabel", labelKey2num (lbl->key)); } else { @@ -13067,14 +12927,14 @@ emitcode ("inc", "dptr"); emitcode ("mov", "a,b"); emitcode ("orl", "a,_ap"); - emitcode ("jz", "!tlabel", lbl1->key + 100); + emitcode ("jz", "!tlabel", labelKey2num (lbl1->key)); emitcode ("mov", "a,_ap"); emitcode ("add", "a,#!constbyte", 0xFF); emitcode ("mov", "_ap,a"); emitcode ("mov", "a,b"); emitcode ("addc", "a,#!constbyte", 0xFF); emitcode ("mov", "b,a"); - emitcode ("sjmp", "!tlabel", lbl->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (lbl->key)); emitLabel (lbl1); } freeAsmop (count, NULL, ic, FALSE); @@ -13254,7 +13114,7 @@ emitcode ("mov", "dptr,#LibraryID"); /* make the call */ emitcode ("lcall", "NatLib_Remove%sStateBlock", name); - emitcode ("jnz", "!tlabel", lbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (lbl->key)); /* put return value into place */ aopOp (IC_RESULT (ic), ic, FALSE, FALSE); @@ -13319,7 +13179,7 @@ /* make the call */ emitcode ("lcall", "MM_%s", name); - emitcode ("jz", "!tlabel", lbl->key + 100); + emitcode ("jz", "!tlabel", labelKey2num (lbl->key)); emitcode ("mov", "r2,#!constbyte", 0xff); emitcode ("mov", "r3,#!constbyte", 0xff); emitLabel (lbl); @@ -13486,7 +13346,8 @@ emitcode ("mov", "dptr,%s", aopGet (pp, 0, TRUE, FALSE, NULL)); } else if (AOP_TYPE (pp) != AOP_STR) - { /* not already in dptr */ + { + /* not already in dptr */ emitcode ("mov", "dpl,%s", aopGet (pp, 0, FALSE, FALSE, NULL)); emitcode ("mov", "dph,%s", aopGet (pp, 1, FALSE, FALSE, NULL)); emitcode ("mov", "dpx,%s", aopGet (pp, 2, FALSE, FALSE, NULL)); @@ -13690,7 +13551,8 @@ emitcode ("mov", "dptr,%s", aopGet (fp, 0, TRUE, FALSE, DP2_RESULT_REG)); } else if (AOP_TYPE (fp) != AOP_STR) - { /* not already in dptr */ + { + /* not already in dptr */ emitcode ("mov", "dpl,%s", aopGet (fp, 0, FALSE, FALSE, DP2_RESULT_REG)); emitcode ("mov", "dph,%s", aopGet (fp, 1, FALSE, FALSE, DP2_RESULT_REG)); emitcode ("mov", "dpx,%s", aopGet (fp, 2, FALSE, FALSE, DP2_RESULT_REG)); @@ -13790,7 +13652,7 @@ } emitcode ("dec", "%s", rByte); aopPut (IC_RESULT (ic), rByte, 0); - emitcode ("jnz", "!tlabel", lbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (lbl->key)); } else if (IS_AOP_PREG (IC_RESULT (ic))) { @@ -13798,15 +13660,15 @@ MOVA (aopGet (IC_RESULT (ic), 0, FALSE, FALSE, NULL)); freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); ifx->generated = 1; - emitcode ("jnz", "!tlabel", lbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (lbl->key)); } else { - emitcode ("djnz", "%s,!tlabel", aopGet (IC_RESULT (ic), 0, FALSE, TRUE, NULL), lbl->key + 100); + emitcode ("djnz", "%s,!tlabel", aopGet (IC_RESULT (ic), 0, FALSE, TRUE, NULL), labelKey2num (lbl->key)); } - emitcode ("sjmp", "!tlabel", lbl1->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (lbl1->key)); emitLabel (lbl); - emitcode ("ljmp", "!tlabel", IC_TRUE (ifx)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_TRUE (ifx)->key)); emitLabel (lbl1); if (!ifx->generated) @@ -13840,7 +13702,7 @@ bool useDp2; useDp2 = isOperandInFarSpace (IC_RESULT (ic)) && - (OP_SYMBOL (IC_RESULT (ic))->isspilt || IS_TRUE_SYMOP (IC_RESULT (ic))); + (OP_SYMBOL (IC_RESULT (ic))->isspilt || IS_TRUE_SYMOP (IC_RESULT (ic))); _G.accInUse++; aopOp (IC_RESULT (ic), ic, FALSE, useDp2); @@ -13855,7 +13717,8 @@ } } else if (ic->argreg > 12) - { /* bit parameters */ + { + /* bit parameters */ reg_info *reg = OP_SYMBOL (IC_RESULT (ic))->regs[0]; if (!reg || reg->rIdx != ic->argreg - 5) @@ -13955,7 +13818,7 @@ { aopOp (IC_RESULT (ic), ic, TRUE, FALSE); aopPut (IC_RESULT (ic), one, 0); /* save old ea in an operand */ - emitcode ("jbc", "ea,!tlabel", tlbl->key + 100); /* atomic test & clear */ + emitcode ("jbc", "ea,!tlabel", labelKey2num (tlbl->key)); /* atomic test & clear */ aopPut (IC_RESULT (ic), zero, 0); emitLabel (tlbl); freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); @@ -13963,10 +13826,10 @@ else { emitcode ("setb", "c"); - emitcode ("jbc", "ea,!tlabel", tlbl->key + 100); /* atomic test & clear */ + emitcode ("jbc", "ea,!tlabel", labelKey2num (tlbl->key)); /* atomic test & clear */ emitcode ("clr", "c"); emitLabel (tlbl); - emitpush ("psw"); /* save old ea via c in psw on top of stack */ + emitpush ("psw"); /* save old ea via c in psw on top of stack */ } } @@ -13996,7 +13859,7 @@ } else { - emitpop ("psw"); /* restore ea via c in psw on top of stack */ + emitpop ("psw"); /* restore ea via c in psw on top of stack */ emitcode ("mov", "ea,c"); } } @@ -14211,7 +14074,7 @@ int cln = 0; _G.currentFunc = NULL; - lineHead = lineCurr = NULL; + dptrn[1][0] = "dpl1"; dptrn[1][1] = "dph1"; dptrn[1][2] = "dpx1"; @@ -14243,7 +14106,9 @@ for (ic = lic; ic; ic = ic->next) { - _G.current_iCode = ic; + initGenLineElement (); + + genLine.lineElement.ic = ic; if (ic->lineno && cln != ic->lineno) { @@ -14291,25 +14156,25 @@ break; case IPOP: - { - iCode *ifxIc, *popIc; - bool CommonRegs = FALSE; + { + iCode *ifxIc, *popIc; + bool CommonRegs = FALSE; - /* IPOP happens only when trying to restore a - spilt live range, if there is an ifx statement - following this pop (or several) then the if statement might - be using some of the registers being popped which - would destroy the contents of the register so - we need to check for this condition and handle it */ - for (ifxIc = ic->next; ifxIc && ifxIc->op == IPOP; ifxIc = ifxIc->next); - for (popIc = ic; popIc && popIc->op == IPOP; popIc = popIc->next) - CommonRegs |= (ifxIc && ifxIc->op == IFX && !ifxIc->generated && regsInCommon (IC_LEFT (popIc), IC_COND (ifxIc))); - if (CommonRegs) - genIfx (ifxIc, ic); - else - genIpop (ic); - } - break; + /* IPOP happens only when trying to restore a + spilt live range, if there is an ifx statement + following this pop (or several) then the if statement might + be using some of the registers being popped which + would destroy the contents of the register so + we need to check for this condition and handle it */ + for (ifxIc = ic->next; ifxIc && ifxIc->op == IPOP; ifxIc = ifxIc->next); + for (popIc = ic; popIc && popIc->op == IPOP; popIc = popIc->next) + CommonRegs |= (ifxIc && ifxIc->op == IFX && !ifxIc->generated && regsInCommon (IC_LEFT (popIc), IC_COND (ifxIc))); + if (CommonRegs) + genIfx (ifxIc, ic); + else + genIpop (ic); + } + break; case CALL: genCall (ic); @@ -14489,9 +14354,11 @@ /* now we are ready to call the peep hole optimizer */ if (!options.nopeep) - peepHole (&lineHead); + peepHole (&genLine.lineHead); /* now do the actual printing */ - printLine (lineHead, codeOutBuf); - return; + printLine (genLine.lineHead, codeOutBuf); + + /* destroy the line list */ + destroy_line_list (); } diff -Nru sdcc-3.1.0+dfsg/src/ds390/gen.h sdcc-3.2.0+dfsg/src/ds390/gen.h --- sdcc-3.1.0+dfsg/src/ds390/gen.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/ds390/gen.h 2012-03-30 20:01:27.000000000 +0000 @@ -1,25 +1,21 @@ /*------------------------------------------------------------------------- gen.h - header file for code generation for DS80C390 - Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998) + Copyright (C) 1998, Sandeep Dutta . sandeep.dutta@usa.net - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -------------------------------------------------------------------------*/ #ifndef SDCCGEN390_H diff -Nru sdcc-3.1.0+dfsg/src/ds390/main.c sdcc-3.2.0+dfsg/src/ds390/main.c --- sdcc-3.1.0+dfsg/src/ds390/main.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/ds390/main.c 2012-04-25 16:05:36.000000000 +0000 @@ -1,17 +1,33 @@ -/** @file main.c - ds390 specific general functions. +/*------------------------------------------------------------------------- + main.h - ds390 specific general functions - Note that mlh prepended _ds390_ on the static functions. Makes - it easier to set a breakpoint using the debugger. + Copyright (C) 2000, Kevin Vigor + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-------------------------------------------------------------------------*/ +/* + Note that mlh prepended _ds390_ on the static functions. Makes + it easier to set a breakpoint using the debugger. */ + #include "common.h" #include "main.h" #include "ralloc.h" #include "gen.h" #include "dbuf_string.h" -#include "../SDCCutil.h" -#include "../SDCCglobl.h" -#include "../SDCCsystem.h" + static char _defaultRules[] = { #include "peeph.rul" @@ -854,12 +870,12 @@ initializeAsmLineNode (lineNode *line) { if (!line->aln) - line->aln = asmLineNodeFromLineNode (line, 0); - else if (line->aln && !line->aln->initialized) + line->aln = (asmLineNodeBase *) asmLineNodeFromLineNode (line, 0); + else if (line->aln && !((asmLineNode *)line->aln)->initialized) { - int currentDPS = line->aln->currentDPS; + int currentDPS = ((asmLineNode *)line->aln)->currentDPS; free(line->aln); - line->aln = asmLineNodeFromLineNode (line, currentDPS); + line->aln = (asmLineNodeBase *) asmLineNodeFromLineNode (line, currentDPS); } } @@ -946,8 +962,8 @@ { _asmCmd, NULL, - "-plosgffwzc", /* Options with debug */ - "-plosgffwz", /* Options without debug */ + "-plosgffwc", /* Options with debug */ + "-plosgffw", /* Options without debug */ 0, ".asm", NULL /* no do_assemble function */ @@ -1544,8 +1560,8 @@ { _asmCmd, NULL, - "-plosgffwzc", /* Options with debug */ - "-plosgffwz", /* Options without debug */ + "-plosgffwc", /* Options with debug */ + "-plosgffw", /* Options without debug */ 0, ".asm", NULL /* no do_assemble function */ diff -Nru sdcc-3.1.0+dfsg/src/ds390/main.h sdcc-3.2.0+dfsg/src/ds390/main.h --- sdcc-3.1.0+dfsg/src/ds390/main.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/ds390/main.h 2012-03-30 20:01:27.000000000 +0000 @@ -1,13 +1,40 @@ +/*------------------------------------------------------------------------- + main.h - ds390 specific general header file + + Copyright (C) 2000, Kevin Vigor + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-------------------------------------------------------------------------*/ + #ifndef MAIN_INCLUDE #define MAIN_INCLUDE +#include "SDCCgen.h" + typedef struct asmLineNode { +#ifdef UNNAMED_STRUCT_TAG + struct asmLineNodeBase; +#else + /* exactly the same members as of struct asmLineNodeBase from SDCCgen.h */ int size; - int currentDPS; - unsigned initialized:1; bitVect *regsRead; bitVect *regsWritten; +#endif + int currentDPS; + unsigned initialized:1; } asmLineNode; diff -Nru sdcc-3.1.0+dfsg/src/ds390/ralloc.c sdcc-3.2.0+dfsg/src/ds390/ralloc.c --- sdcc-3.1.0+dfsg/src/ds390/ralloc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/ds390/ralloc.c 2012-06-05 09:03:12.000000000 +0000 @@ -2608,7 +2608,7 @@ int i, key; symbol *sym; iCode *ic, *dic; - sym_link *type, *etype; + sym_link *type; if (!IS_SYMOP (op) || !IS_ITEMP (op)) return NULL; @@ -2652,7 +2652,7 @@ { if (OP_SYMBOL (IC_RESULT (ic))->liveTo == OP_SYMBOL (IC_RESULT (ic))->liveFrom) continue; - etype = getSpec (type = operandType (IC_RESULT (ic))); + type = operandType (IC_RESULT (ic)); if (getSize (type) == 0 || isOperandEqual (op, IC_RESULT (ic))) continue; return NULL; @@ -2881,6 +2881,7 @@ iCode *dic, *lic; bitVect *dbv; struct eBBlock *ebp = ebpp[blockno]; + int disallowHiddenAssignment = 0; if ((ic->op != IPUSH && ic->op != SEND) || !IS_ITEMP (IC_LEFT (ic))) return; @@ -2899,6 +2900,12 @@ if (dic->eBBlockNum != ic->eBBlockNum) return; + if (IS_OP_VOLATILE (IC_RIGHT (dic))) + return; + + if ((IS_SYMOP (IC_RIGHT (dic)) && OP_SYMBOL (IC_RIGHT (dic))->addrtaken) || isOperandGlobal (IC_RIGHT (dic))) + disallowHiddenAssignment = 1; + /* make sure the right side does not have any definitions inbetween */ dbv = OP_DEFS (IC_RIGHT (dic)); @@ -2906,6 +2913,8 @@ { if (bitVectBitValue (dbv, lic->key)) return; + if (disallowHiddenAssignment && (lic->op == CALL || lic->op == PCALL || POINTER_SET (lic))) + return; } /* make sure they have the same type */ if (IS_SPEC (operandType (IC_LEFT (ic)))) @@ -2929,6 +2938,8 @@ if (IS_ITEMP (IC_RIGHT (dic))) bitVectSetBit (lic->rlive, IC_RIGHT (dic)->key); } + if (IS_ITEMP (IC_RIGHT (dic))) + OP_USES (IC_RIGHT (dic)) = bitVectSetBit (OP_USES (IC_RIGHT (dic)), ic->key); /* we now we know that it has one & only one def & use and the that the definition is an assignment */ IC_LEFT (ic) = IC_RIGHT (dic); @@ -3242,7 +3253,6 @@ packForPush (ic, ebpp, blockno); } - /* pack registers for accumulator use, when the result of an arithmetic or bit wise operation has only one use, that use is immediately following diff -Nru sdcc-3.1.0+dfsg/src/hc08/gen.c sdcc-3.2.0+dfsg/src/hc08/gen.c --- sdcc-3.1.0+dfsg/src/hc08/gen.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/hc08/gen.c 2012-06-14 16:07:45.000000000 +0000 @@ -1,11 +1,11 @@ /*------------------------------------------------------------------------- gen.c - source file for code generation for the 68HC08 - Hacked for the 68HC08 by Erik Petrich (2003) - Adapted from the 8051 code generator by: - Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998) - and - Jean-Louis VERN.jlvern@writeme.com (1999) - Bug Fixes - Wojciech Stryjewski wstryj1@tiger.lsu.edu (1999 v2.1.9a) + Copyright (C) 1998, Sandeep Dutta . sandeep.dutta@usa.net + Copyright (C) 1999, Jean-Louis VERN.jlvern@writeme.com + Bug Fixes - Wojciech Stryjewski wstryj1@tiger.lsu.edu (1999 v2.1.9a) + Hacked for the 68HC08: + Copyright (C) 2003, Erik Petrich 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 @@ -20,15 +20,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! - -------------------------------------------------------------------------*/ /* Use the D macro for basic (unobtrusive) debugging messages */ -#define D(x) do if (options.verboseAsm) {x;} while(0) +#define D(x) do if (options.verboseAsm) { x; } while (0) /* Use the DD macro for detailed debugging messages */ #define DD(x) //#define DD(x) x @@ -37,58 +32,55 @@ #include #include #include -#include "SDCCglobl.h" -#include "newalloc.h" #include "common.h" -#include "SDCCpeeph.h" +#include "hc08.h" #include "ralloc.h" #include "gen.h" +#include "dbuf_string.h" char *aopLiteral (value * val, int offset); char *aopLiteralLong (value * val, int offset, int size); extern int allocInfo; -static int pushReg (reg_info *reg, bool freereg); -static void pullReg (reg_info *reg); -static void transferAopAop (asmop *srcaop, int srcofs, asmop *dstaop, int dstofs); +static int pushReg (reg_info * reg, bool freereg); +static void pullReg (reg_info * reg); +static void transferAopAop (asmop * srcaop, int srcofs, asmop * dstaop, int dstofs); +static void adjustStack (int n); static char *zero = "#0x00"; static char *one = "#0x01"; static char *spname; -char *fReturnhc08[] = -{"a", "x", "_ret2", "_ret3"}; +char *fReturnhc08[] = { "a", "x", "_ret2", "_ret3" }; + unsigned fReturnSizeHC08 = 4; /* shared with ralloc.c */ char **fReturn2 = fReturnhc08; static struct - { - short hxPushed; - short iyPushed; - short accInUse; - short inLine; - short debugLine; - short nRegsSaved; - int stackOfs; - int stackPushes; - short regsinuse; - set *sendSet; - iCode *current_iCode; - } +{ + short hxPushed; + short accInUse; + short nRegsSaved; + int stackOfs; + int stackPushes; + short regsinuse; + set *sendSet; + int tsxStackPushes; +} _G; -static asmop *hc08_aop_pass[4]; +static asmop *hc08_aop_pass[8]; +static asmop tsxaop; extern int hc08_ptrRegReq; extern int hc08_nRegs; extern struct dbuf_s *codeOutBuf; //static void saveRBank (int, iCode *, bool); static bool operandsEqu (operand * op1, operand * op2); -static void loadRegFromConst (reg_info *reg, char *c); -static char *aopName (asmop *aop); -static asmop * newAsmop (short type); -static char * aopAdrStr (asmop * aop, int loffset, bool bit16); +static void loadRegFromConst (reg_info * reg, char *c); +static asmop *newAsmop (short type); +static char *aopAdrStr (asmop * aop, int loffset, bool bit16); #define RESULTONSTACK(x) \ (IC_RESULT(x) && IC_RESULT(x)->aop && \ IC_RESULT(x)->aop->type == AOP_STK ) @@ -96,12 +88,20 @@ #define IS_AOP_HX(x) \ (((x)->type == AOP_REG) \ && ((x)->aopu.aop_reg[0] == hc08_reg_x) \ - && ((x)->aopu.aop_reg[1] == hc08_reg_h) ) + && ((x)->aopu.aop_reg[1] == hc08_reg_h) \ + && ((x)->size == 2) ) #define IS_AOP_XA(x) \ (((x)->type == AOP_REG) \ && ((x)->aopu.aop_reg[0] == hc08_reg_a) \ - && ((x)->aopu.aop_reg[1] == hc08_reg_x) ) + && ((x)->aopu.aop_reg[1] == hc08_reg_x) \ + && ((x)->size == 2) ) + +#define IS_AOP_AX(x) \ + (((x)->type == AOP_REG) \ + && ((x)->aopu.aop_reg[0] == hc08_reg_x) \ + && ((x)->aopu.aop_reg[1] == hc08_reg_a) \ + && ((x)->size == 2) ) #define IS_AOP_A(x) \ (((x)->type == AOP_REG) \ @@ -118,18 +118,26 @@ && ((x)->aopu.aop_reg[0] == hc08_reg_h) \ && ((x)->size == 1) ) -#define CLRC emitcode("clc","") +#define IS_AOP_WITH_A(x) \ + (((x)->type == AOP_REG) \ + && (((x)->aopu.aop_reg[0] == hc08_reg_a) \ + || ((x)->aopu.aop_reg[1] == hc08_reg_a))) -static lineNode *lineHead = NULL; -static lineNode *lineCurr = NULL; + +#define CLRC emitcode("clc","") #if 0 static unsigned char SLMask[] = -{0xFF, 0xFE, 0xFC, 0xF8, 0xF0, - 0xE0, 0xC0, 0x80, 0x00}; +{ + 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, + 0xE0, 0xC0, 0x80, 0x00 +}; + static unsigned char SRMask[] = -{0xFF, 0x7F, 0x3F, 0x1F, 0x0F, - 0x07, 0x03, 0x01, 0x00}; +{ + 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, + 0x07, 0x03, 0x01, 0x00 +}; #endif #define LSB 0 @@ -142,57 +150,15 @@ #define AOP_SIZE(op) AOP(op)->size #define AOP_OP(aop) aop->op - -/*-----------------------------------------------------------------*/ -/* emitcode - writes the code into a file : for now it is simple */ -/*-----------------------------------------------------------------*/ -static void -emitcode (char *inst, char *fmt,...) -{ - va_list ap; - char lb[INITIAL_INLINEASM]; - char *lbp = lb; - - va_start (ap, fmt); - - if (inst && *inst) - { - if (fmt && *fmt) - sprintf (lb, "%s\t", inst); - else - sprintf (lb, "%s", inst); - vsprintf (lb + (strlen (lb)), fmt, ap); - } - else - vsprintf (lb, fmt, ap); - - while (isspace ((unsigned char)*lbp)) - lbp++; - - if (lbp && *lbp) - lineCurr = (lineCurr ? - connectLine (lineCurr, newLineNode (lb)) : - (lineHead = newLineNode (lb))); - lineCurr->isInline = _G.inLine; - lineCurr->isDebug = _G.debugLine; - lineCurr->ic = _G.current_iCode; - lineCurr->isComment = (*lbp==';'); - - //printf("%s\n", lb); - va_end (ap); -} - -static void -emitBranch (char *branchop, symbol *tlbl) -{ - emitcode (branchop, "%05d$", (tlbl->key + 100)); -} +static bool regalloc_dry_run; +static unsigned char regalloc_dry_run_cost; static void -emitLabel (symbol *tlbl) +emitBranch (char *branchop, symbol * tlbl) { - emitcode ("", "%05d$:", (tlbl->key +100)); - lineCurr->isLabel = 1; + if (!regalloc_dry_run) + emitcode (branchop, "%05d$", labelKey2num (tlbl->key)); + regalloc_dry_run_cost += (!strcmp(branchop, "jmp") || !strcmp(branchop, "brclr") || !strcmp(branchop, "brset") ? 3 : 2); } /*-----------------------------------------------------------------*/ @@ -200,11 +166,11 @@ /* with a debugger symbol */ /*-----------------------------------------------------------------*/ void -hc08_emitDebuggerSymbol (const char * debugSym) +hc08_emitDebuggerSymbol (const char *debugSym) { - _G.debugLine = 1; + genLine.lineElement.isDebug = 1; emitcode ("", "%s ==.", debugSym); - _G.debugLine = 0; + genLine.lineElement.isDebug = 0; } @@ -227,105 +193,107 @@ /* But it's definately an error if there's no source. */ if (!sreg) { - werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - "NULL sreg in transferRegReg"); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "NULL sreg in transferRegReg"); return; } - DD(emitcode ("", "; transferRegReg(%s,%s)", - sreg->name, dreg->name)); + DD (emitcode ("", "; transferRegReg(%s,%s)", sreg->name, dreg->name)); srcidx = sreg->rIdx; dstidx = dreg->rIdx; - if (srcidx==dstidx) + if (srcidx == dstidx) { - hc08_useReg(dreg); + hc08_useReg (dreg); return; } switch (dstidx) { - case A_IDX: - switch (srcidx) - { - case H_IDX: /* H to A */ - pushReg (hc08_reg_h, FALSE); - pullReg (hc08_reg_a); - break; - case X_IDX: /* X to A */ - emitcode ("txa", ""); - break; - default: - error=1; - } - break; - case H_IDX: - switch (srcidx) - { - case A_IDX: /* A to H */ - pushReg (hc08_reg_a, FALSE); - pullReg (hc08_reg_h); - break; - case X_IDX: /* X to H */ - pushReg (hc08_reg_x, FALSE); - pullReg (hc08_reg_h); - break; - default: - error=1; - } - break; - case X_IDX: - switch (srcidx) - { - case A_IDX: /* A to X */ - emitcode ("tax", ""); - break; - case H_IDX: /* H to X */ - pushReg (hc08_reg_h, FALSE); - pullReg (hc08_reg_x); - break; - default: - error=1; - } - break; - case HX_IDX: - switch (srcidx) - { - case XA_IDX: /* XA to HX */ - pushReg (hc08_reg_x, FALSE); - pullReg (hc08_reg_h); - emitcode ("tax", ""); - break; - default: - error=1; - } - break; - case XA_IDX: - switch (srcidx) - { - case HX_IDX: /* HX to XA */ - emitcode ("txa", ""); - pushReg (hc08_reg_h, FALSE); - pullReg (hc08_reg_x); - break; - default: - error=1; - } - break; - default: - error=1; + case A_IDX: + switch (srcidx) + { + case H_IDX: /* H to A */ + pushReg (hc08_reg_h, FALSE); + pullReg (hc08_reg_a); + break; + case X_IDX: /* X to A */ + emitcode ("txa", ""); + regalloc_dry_run_cost++; + break; + default: + error = 1; + } + break; + case H_IDX: + switch (srcidx) + { + case A_IDX: /* A to H */ + pushReg (hc08_reg_a, FALSE); + pullReg (hc08_reg_h); + break; + case X_IDX: /* X to H */ + pushReg (hc08_reg_x, FALSE); + pullReg (hc08_reg_h); + break; + default: + error = 1; + } + break; + case X_IDX: + switch (srcidx) + { + case A_IDX: /* A to X */ + emitcode ("tax", ""); + regalloc_dry_run_cost++; + break; + case H_IDX: /* H to X */ + pushReg (hc08_reg_h, FALSE); + pullReg (hc08_reg_x); + break; + default: + error = 1; + } + break; + case HX_IDX: + switch (srcidx) + { + case XA_IDX: /* XA to HX */ + pushReg (hc08_reg_x, FALSE); + pullReg (hc08_reg_h); + emitcode ("tax", ""); + regalloc_dry_run_cost++; + break; + default: + error = 1; + } + break; + case XA_IDX: + switch (srcidx) + { + case HX_IDX: /* HX to XA */ + emitcode ("txa", ""); + regalloc_dry_run_cost++; + pushReg (hc08_reg_h, FALSE); + pullReg (hc08_reg_x); + break; + default: + error = 1; + } + break; + default: + error = 1; } wassertl (!error, "bad combo in transferRegReg"); if (freesrc) - hc08_freeReg(sreg); + hc08_freeReg (sreg); dreg->aop = sreg->aop; dreg->aopofs = sreg->aopofs; dreg->isFree = FALSE; - hc08_useReg(dreg); + hc08_useReg (dreg); } /*--------------------------------------------------------------------------*/ @@ -333,14 +301,13 @@ /* connonical frame address relative to the stack pointer */ /*--------------------------------------------------------------------------*/ static void -updateCFA(void) +updateCFA (void) { /* there is no frame unless there is a function */ if (!currFunc) return; - debugFile->writeFrameAddress (NULL, hc08_reg_sp, - 1 + _G.stackOfs + _G.stackPushes); + debugFile->writeFrameAddress (NULL, hc08_reg_sp, 1 + _G.stackOfs + _G.stackPushes); } /*--------------------------------------------------------------------------*/ @@ -348,97 +315,111 @@ /* marked free and available for reuse. */ /*--------------------------------------------------------------------------*/ static int -pushReg (reg_info *reg, bool freereg) +pushReg (reg_info * reg, bool freereg) { int regidx = reg->rIdx; switch (regidx) { - case A_IDX: - emitcode ("psha", ""); - _G.stackPushes++; - updateCFA(); - break; - case X_IDX: - emitcode ("pshx", ""); - _G.stackPushes++; - updateCFA(); - break; - case H_IDX: - emitcode ("pshh", ""); - _G.stackPushes++; - updateCFA(); - break; - case HX_IDX: - emitcode ("pshx", ""); - _G.stackPushes++; - updateCFA(); - emitcode ("pshh", ""); - _G.stackPushes++; - updateCFA(); - break; - case XA_IDX: - emitcode ("psha", ""); - updateCFA(); - _G.stackPushes++; - emitcode ("pshx", ""); - updateCFA(); - _G.stackPushes++; - break; - default: - break; - } - if (freereg) - hc08_freeReg(reg); - return -_G.stackOfs-_G.stackPushes; + case A_IDX: + emitcode ("psha", ""); + regalloc_dry_run_cost++; + _G.stackPushes++; + updateCFA (); + break; + case X_IDX: + emitcode ("pshx", ""); + regalloc_dry_run_cost++; + _G.stackPushes++; + updateCFA (); + break; + case H_IDX: + emitcode ("pshh", ""); + regalloc_dry_run_cost++; + _G.stackPushes++; + updateCFA (); + break; + case HX_IDX: + emitcode ("pshx", ""); + regalloc_dry_run_cost++; + _G.stackPushes++; + updateCFA (); + emitcode ("pshh", ""); + regalloc_dry_run_cost++; + _G.stackPushes++; + updateCFA (); + break; + case XA_IDX: + emitcode ("psha", ""); + regalloc_dry_run_cost++; + updateCFA (); + _G.stackPushes++; + emitcode ("pshx", ""); + regalloc_dry_run_cost++; + updateCFA (); + _G.stackPushes++; + break; + default: + break; + } + if (freereg) + hc08_freeReg (reg); + return -_G.stackOfs - _G.stackPushes; } /*--------------------------------------------------------------------------*/ /* pullReg - Pull register reg off the stack. */ /*--------------------------------------------------------------------------*/ static void -pullReg (reg_info *reg) +pullReg (reg_info * reg) { int regidx = reg->rIdx; switch (regidx) { - case A_IDX: - emitcode ("pula", ""); - _G.stackPushes--; - updateCFA(); - break; - case X_IDX: - emitcode ("pulx", ""); - _G.stackPushes--; - updateCFA(); - break; - case H_IDX: - emitcode ("pulh", ""); - _G.stackPushes--; - updateCFA(); - break; - case HX_IDX: - emitcode ("pulh", ""); - _G.stackPushes--; - updateCFA(); - emitcode ("pulx", ""); - _G.stackPushes--; - updateCFA(); - break; - case XA_IDX: - emitcode ("pulx", ""); - _G.stackPushes--; - updateCFA(); - emitcode ("pula", ""); - _G.stackPushes--; - updateCFA(); - break; - default: - break; + case A_IDX: + emitcode ("pula", ""); + regalloc_dry_run_cost++; + _G.stackPushes--; + updateCFA (); + break; + case X_IDX: + emitcode ("pulx", ""); + regalloc_dry_run_cost++; + _G.stackPushes--; + updateCFA (); + break; + case H_IDX: + emitcode ("pulh", ""); + regalloc_dry_run_cost++; + _G.stackPushes--; + updateCFA (); + break; + case HX_IDX: + emitcode ("pulh", ""); + regalloc_dry_run_cost++; + _G.stackPushes--; + updateCFA (); + emitcode ("pulx", ""); + regalloc_dry_run_cost++; + _G.stackPushes--; + updateCFA (); + break; + case XA_IDX: + emitcode ("pulx", ""); + regalloc_dry_run_cost++; + _G.stackPushes--; + updateCFA (); + emitcode ("pula", ""); + regalloc_dry_run_cost++; + _G.stackPushes--; + updateCFA (); + break; + default: + break; } - hc08_useReg(reg); - hc08_dirtyReg(reg, FALSE); + hc08_useReg (reg); + hc08_dirtyReg (reg, FALSE); } /*--------------------------------------------------------------------------*/ @@ -447,11 +428,45 @@ static void pullNull (int n) { - if (n) + wassert (n >= 0); + adjustStack (n); +} + +/*--------------------------------------------------------------------------*/ +/* pushConst - Push a constant byte value onto stack */ +/*--------------------------------------------------------------------------*/ +static void +pushConst (char * c) +{ + if (hc08_reg_a->isFree) + { + loadRegFromConst (hc08_reg_a, c); + pushReg (hc08_reg_a, TRUE); + } + else if (hc08_reg_x->isFree) + { + loadRegFromConst (hc08_reg_x, c); + pushReg (hc08_reg_x, TRUE); + } + else if (hc08_reg_h->isFree && !strcmp (c, zero)) + { + loadRegFromConst (hc08_reg_h, c); + pushReg (hc08_reg_h, TRUE); + } + else if (!strcmp (c,zero)) + { + adjustStack (-1); + emitcode ("clr", "1,s"); + regalloc_dry_run_cost += 3; + } + else { - emitcode("ais","#%d",n); - _G.stackPushes -= n; - updateCFA(); + pushReg (hc08_reg_a, FALSE); + pushReg (hc08_reg_a, FALSE); + loadRegFromConst (hc08_reg_a, c); + emitcode ("sta", "2,s"); + regalloc_dry_run_cost += 3; + pullReg (hc08_reg_a); } } @@ -472,11 +487,27 @@ } /*--------------------------------------------------------------------------*/ +/* pushRegIfSurv - Push register reg if marked surviving. Returns true if */ +/* the push was performed, false otherwise. */ +/*--------------------------------------------------------------------------*/ +static bool +pushRegIfSurv (reg_info *reg) +{ + if (!reg->isDead) + { + pushReg (reg, TRUE); + return TRUE; + } + else + return FALSE; +} + +/*--------------------------------------------------------------------------*/ /* pullOrFreeReg - If needpull is true, register reg is pulled from the */ /* stack. Otherwise register reg is marked as free. */ /*--------------------------------------------------------------------------*/ static void -pullOrFreeReg (reg_info *reg, bool needpull) +pullOrFreeReg (reg_info * reg, bool needpull) { if (needpull) pullReg (reg); @@ -492,36 +523,52 @@ { while (n) { - if (n>127) + if (n > 127) { - emitcode ("ais","#127"); + emitcode ("ais", "#127"); + regalloc_dry_run_cost += 2; n -= 127; _G.stackPushes -= 127; - updateCFA(); + updateCFA (); } - else if (n<-128) + else if (n < -128) { - emitcode ("ais","#-128"); + emitcode ("ais", "#-128"); + regalloc_dry_run_cost += 2; n += 128; _G.stackPushes += 128; - updateCFA(); + updateCFA (); } else { - emitcode ("ais", "#%d", n); + if (n == -1) + { + emitcode ("pshh", ""); /* 1 byte, 2 cycles */ + regalloc_dry_run_cost++; + } + else if (n == 1 && optimize.codeSize && hc08_reg_h->isFree) + { + emitcode ("pulh", ""); /* 1 byte, 3 cycles */ + regalloc_dry_run_cost++; + } + else + { + emitcode ("ais", "#%d", n); /* 2 bytes, 2 cycles */ + regalloc_dry_run_cost += 2; + } _G.stackPushes -= n; n = 0; - updateCFA(); + updateCFA (); } } } - +#if DD(1) -1 == 0 /*--------------------------------------------------------------------------*/ /* aopName - Return a string with debugging information about an asmop. */ /*--------------------------------------------------------------------------*/ static char * -aopName (asmop *aop) +aopName (asmop * aop) { static char buffer[256]; char *buf = buffer; @@ -531,46 +578,45 @@ switch (aop->type) { - case AOP_IMMD: - sprintf (buf,"IMMD(%s)", aop->aopu.aop_immd.aop_immd1); - return buf; - case AOP_LIT: - sprintf (buf,"LIT(%s)", aopLiteral (aop->aopu.aop_lit, 0)); - return buf; - case AOP_DIR: - sprintf (buf,"DIR(%s)", aop->aopu.aop_dir); - return buf; - case AOP_EXT: - sprintf (buf,"EXT(%s)", aop->aopu.aop_dir); - return buf; - case AOP_SOF: - sprintf (buf,"SOF(%s)", OP_SYMBOL (aop->op)->name); - return buf; - case AOP_REG: - sprintf (buf, "REG(%s,%s,%s,%s)", - aop->aopu.aop_reg[3] ? aop->aopu.aop_reg[3]->name : "-", - aop->aopu.aop_reg[2] ? aop->aopu.aop_reg[2]->name : "-", - aop->aopu.aop_reg[1] ? aop->aopu.aop_reg[1]->name : "-", - aop->aopu.aop_reg[0] ? aop->aopu.aop_reg[0]->name : "-"); - return buf; - case AOP_STK: - return "STK"; - case AOP_STR: - return "STR"; - default: - sprintf (buf,"?%d", aop->type); - return buf; + case AOP_IMMD: + sprintf (buf, "IMMD(%s)", aop->aopu.aop_immd.aop_immd1); + return buf; + case AOP_LIT: + sprintf (buf, "LIT(%s)", aopLiteral (aop->aopu.aop_lit, 0)); + return buf; + case AOP_DIR: + sprintf (buf, "DIR(%s)", aop->aopu.aop_dir); + return buf; + case AOP_EXT: + sprintf (buf, "EXT(%s)", aop->aopu.aop_dir); + return buf; + case AOP_SOF: + sprintf (buf, "SOF(%s)", OP_SYMBOL (aop->op)->name); + return buf; + case AOP_REG: + sprintf (buf, "REG(%s,%s,%s,%s)", + aop->aopu.aop_reg[3] ? aop->aopu.aop_reg[3]->name : "-", + aop->aopu.aop_reg[2] ? aop->aopu.aop_reg[2]->name : "-", + aop->aopu.aop_reg[1] ? aop->aopu.aop_reg[1]->name : "-", + aop->aopu.aop_reg[0] ? aop->aopu.aop_reg[0]->name : "-"); + return buf; + case AOP_STK: + return "STK"; + default: + sprintf (buf, "?%d", aop->type); + return buf; } return "?"; } - +#endif /*--------------------------------------------------------------------------*/ /* loadRegFromAop - Load register reg from logical offset loffset of aop. */ +/* For multi-byte registers, loffset is of the lsb reg. */ /*--------------------------------------------------------------------------*/ static void -loadRegFromAop (reg_info *reg, asmop *aop, int loffset) +loadRegFromAop (reg_info * reg, asmop * aop, int loffset) { int regidx = reg->rIdx; @@ -581,33 +627,32 @@ } #if 0 - printf("loadRegFromAop called\n"); + printf ("loadRegFromAop called\n"); if (!reg) { - printf(" reg = NULL\n"); + printf (" reg = NULL\n"); return; } - printf(" reg = %s\n", reg->name); + printf (" reg = %s\n", reg->name); if (!aop) { - printf(" aop = NULL\n"); + printf (" aop = NULL\n"); return; } - printf(" aop->type = %d\n", aop->type); - printf(" loffset = %d\n", loffset); + printf (" aop->type = %d\n", aop->type); + printf (" loffset = %d\n", loffset); if (aop->op) - printf(" aop has operand link\n"); + printf (" aop has operand link\n"); else - printf(" aop missing operand link\n"); + printf (" aop missing operand link\n"); if (reg->aop) - printf(" reg has operand link\n"); + printf (" reg has operand link\n"); else - printf(" reg missing operand link\n"); + printf (" reg missing operand link\n"); #endif - DD(emitcode ("", "; loadRegFromAop (%s, %s, %d)", - reg->name, aopName (aop), loffset)); + DD (emitcode ("", "; loadRegFromAop (%s, %s, %d)", reg->name, aopName (aop), loffset)); /* If operand is volatile, we cannot optimize. */ if (!aop->op || isOperandVolatile (aop->op, FALSE)) @@ -616,22 +661,19 @@ /* If this register already has this offset of the operand then we need only mark it as in use. */ - if (reg->aop && reg->aop->op && aop->op - && operandsEqu(reg->aop->op,aop->op) - && (reg->aopofs == loffset)) + if (reg->aop && reg->aop->op && aop->op && operandsEqu (reg->aop->op, aop->op) && (reg->aopofs == loffset)) { - hc08_useReg(reg); - DD(emitcode ("","; already had correct value for %s", reg->name)); + hc08_useReg (reg); + DD (emitcode ("", "; already had correct value for %s", reg->name)); return; } /* TODO: check to see if we can transfer from another register */ if (hc08_reg_h->aop && hc08_reg_h->aop->op && aop->op - && operandsEqu(hc08_reg_h->aop->op,aop->op) - && (hc08_reg_h->aopofs == loffset)) + && operandsEqu (hc08_reg_h->aop->op, aop->op) && (hc08_reg_h->aopofs == loffset)) { - DD(emitcode ("","; found correct value for %s in h", reg->name)); + DD (emitcode ("", "; found correct value for %s in h", reg->name)); transferRegReg (hc08_reg_h, reg, FALSE); hc08_useReg (reg); return; @@ -639,137 +681,190 @@ if (hc08_reg_x->aop && hc08_reg_x->aop->op && aop->op - && operandsEqu(hc08_reg_x->aop->op,aop->op) - && (hc08_reg_x->aopofs == loffset)) + && operandsEqu (hc08_reg_x->aop->op, aop->op) && (hc08_reg_x->aopofs == loffset)) { - DD(emitcode ("","; found correct value for %s in x", reg->name)); + DD (emitcode ("", "; found correct value for %s in x", reg->name)); transferRegReg (hc08_reg_x, reg, FALSE); hc08_useReg (reg); return; } if (hc08_reg_a->aop && hc08_reg_a->aop->op && aop->op - && operandsEqu(hc08_reg_a->aop->op,aop->op) - && (hc08_reg_a->aopofs == loffset)) + && operandsEqu (hc08_reg_a->aop->op, aop->op) && (hc08_reg_a->aopofs == loffset)) { - DD(emitcode ("","; found correct value for %s in a", reg->name)); + DD (emitcode ("", "; found correct value for %s in a", reg->name)); transferRegReg (hc08_reg_a, reg, FALSE); hc08_useReg (reg); return; } forceload: - switch (regidx) { - case A_IDX: - if (aop->type == AOP_REG) - { - if (loffset < aop->size) - transferRegReg(aop->aopu.aop_reg[loffset], reg, FALSE); - else - emitcode ("clra", ""); /* TODO: handle sign extension */ - } - else - { - char * l = aopAdrStr (aop, loffset, FALSE); - if (!strcmp (l, zero)) + case A_IDX: + if (aop->type == AOP_REG) + { + if (loffset < aop->size) + transferRegReg (aop->aopu.aop_reg[loffset], reg, FALSE); + else + { + emitcode ("clra", ""); /* TODO: handle sign extension */ + regalloc_dry_run_cost++; + } + } + else + { + char *l = aopAdrStr (aop, loffset, FALSE); + if (!strcmp (l, zero)) + { emitcode ("clra", ""); - else + regalloc_dry_run_cost++; + } + else + { emitcode ("lda", "%s", l); - } - break; - case X_IDX: - if (aop->type == AOP_REG) - { - if (loffset < aop->size) - transferRegReg(aop->aopu.aop_reg[loffset], reg, FALSE); - else - emitcode ("clrx", ""); /* TODO: handle sign extension */ - } - else - { - char * l = aopAdrStr (aop, loffset, FALSE); - if (!strcmp (l, zero)) + regalloc_dry_run_cost += ((aop->type == AOP_DIR || aop->type == AOP_IMMD || aop->type == AOP_LIT) ? 2 : 3); + } + } + break; + case X_IDX: + if (aop->type == AOP_REG) + { + if (loffset < aop->size) + transferRegReg (aop->aopu.aop_reg[loffset], reg, FALSE); + else + { + emitcode ("clrx", ""); /* TODO: handle sign extension */ + regalloc_dry_run_cost++; + } + } + else + { + char *l = aopAdrStr (aop, loffset, FALSE); + if (!strcmp (l, zero)) + { emitcode ("clrx", ""); - else + regalloc_dry_run_cost++; + } + else + { emitcode ("ldx", "%s", l); + regalloc_dry_run_cost += ((aop->type == AOP_DIR || aop->type == AOP_IMMD || aop->type == AOP_LIT) ? 2 : 3); + } + } + break; + case H_IDX: + { + char *l = aopAdrStr (aop, loffset, FALSE); + if (!strcmp (l, zero)) + { + emitcode ("clrh", ""); + regalloc_dry_run_cost++; + break; } - break; - case H_IDX: + } + if (aop->type == AOP_SOF && !(_G.stackOfs + _G.stackPushes + aop->aopu.aop_stk + aop->size - loffset - 1)) { - char * l = aopAdrStr (aop, loffset, FALSE); - if (!strcmp (l, zero)) + pullReg (hc08_reg_h); + pushReg (hc08_reg_h, FALSE); + break; + } + if (aop->type == AOP_REG && loffset < aop->size) + transferRegReg (aop->aopu.aop_reg[loffset], hc08_reg_h, TRUE); + else if (!(aop->op && isOperandVolatile (aop->op, FALSE)) && (loffset - 1 >= 0 || aop->type == AOP_LIT) && (aop->type == AOP_LIT || aop->type == AOP_IMMD || IS_S08 && aop->type == AOP_EXT)) /* TODO: Allow negative loffset - 1 */ + { + bool pushedx = FALSE; + if (!hc08_reg_x->isFree) { - emitcode ("clrh", ""); - break; + pushReg (hc08_reg_x, TRUE); + pushedx = TRUE; } + if (aop->type == AOP_LIT && loffset == 0) /* Workaround for other things not supporting negative offsets */ + { + emitcode ("ldhx", "#0x%04x", ulFromVal (aop->aopu.aop_lit) << 8); + regalloc_dry_run_cost += 3; + } + else + loadRegFromAop (hc08_reg_hx, aop, loffset - 1); + pullOrFreeReg (hc08_reg_x, pushedx); } - if (hc08_reg_a->isFree) - { - loadRegFromAop (hc08_reg_a, aop, loffset); - transferRegReg (hc08_reg_a, hc08_reg_h, TRUE); - } - else if (hc08_reg_x->isFree) - { - loadRegFromAop (hc08_reg_x, aop, loffset); - transferRegReg (hc08_reg_x, hc08_reg_h, TRUE); - } - else - { - pushReg (hc08_reg_a, TRUE); - loadRegFromAop (hc08_reg_a, aop, loffset); - transferRegReg (hc08_reg_a, hc08_reg_h, TRUE); - pullReg (hc08_reg_a); - } - break; - case HX_IDX: - if (IS_AOP_HX(aop)) + else if (hc08_reg_a->isFree) + { + loadRegFromAop (hc08_reg_a, aop, loffset); + transferRegReg (hc08_reg_a, hc08_reg_h, TRUE); + } + else if (hc08_reg_x->isFree) + { + loadRegFromAop (hc08_reg_x, aop, loffset); + transferRegReg (hc08_reg_x, hc08_reg_h, TRUE); + } + else + { + pushReg (hc08_reg_a, TRUE); + loadRegFromAop (hc08_reg_a, aop, loffset); + transferRegReg (hc08_reg_a, hc08_reg_h, TRUE); + pullReg (hc08_reg_a); + } + break; + case HX_IDX: + if (aop->type == AOP_SOF && !(_G.stackOfs + _G.stackPushes + aop->aopu.aop_stk + aop->size - loffset - 2)) + { + pullReg (hc08_reg_h); + pullReg (hc08_reg_x); + pushReg (hc08_reg_x, FALSE); + pushReg (hc08_reg_h, FALSE); break; - else if (IS_AOP_XA(aop)) - transferRegReg (hc08_reg_xa, hc08_reg_hx, FALSE); - else if ((aop->type == AOP_DIR)) - { - if (aop->size>(loffset+1)) - emitcode ("ldhx","%s", aopAdrStr (aop, loffset+1, TRUE)); - else - { - loadRegFromAop (hc08_reg_x, aop, loffset); - loadRegFromConst (hc08_reg_h, zero); - } - } - else if ((aop->type == AOP_LIT) || (aop->type == AOP_IMMD)) - { - emitcode ("ldhx","%s", aopAdrStr (aop, loffset, TRUE)); - } - else - { - bool needpula; - needpula = pushRegIfUsed (hc08_reg_a); - loadRegFromAop (hc08_reg_a, aop, loffset+1); - loadRegFromAop (hc08_reg_x, aop, loffset); - transferRegReg (hc08_reg_a, hc08_reg_h, TRUE); - pullOrFreeReg (hc08_reg_a, needpula); - } + } + if (IS_AOP_HX (aop)) break; - case XA_IDX: - if (IS_AOP_XA(aop)) - break; - else if (IS_AOP_HX(aop)) - transferRegReg (hc08_reg_hx, hc08_reg_xa, FALSE); - else - { - loadRegFromAop (hc08_reg_a, aop, loffset); - loadRegFromAop (hc08_reg_x, aop, loffset+1); - } + else if (IS_AOP_XA (aop)) + transferRegReg (hc08_reg_xa, hc08_reg_hx, FALSE); + else if (aop->type == AOP_DIR || IS_S08 && aop->type == AOP_EXT) + { + if (aop->size >= (loffset + 2)) + { + emitcode ("ldhx", "%s", aopAdrStr (aop, loffset, TRUE)); + regalloc_dry_run_cost += (aop->type == AOP_DIR ? 2 : 3); + } + else + { + loadRegFromConst (hc08_reg_h, zero); + loadRegFromAop (hc08_reg_x, aop, loffset); + } + } + else if ((aop->type == AOP_LIT) || (aop->type == AOP_IMMD)) + { + emitcode ("ldhx", "%s", aopAdrStr (aop, loffset, TRUE)); + regalloc_dry_run_cost += 3; + } + else + { + loadRegFromAop (hc08_reg_h, aop, loffset + 1); + loadRegFromAop (hc08_reg_x, aop, loffset); + } + break; + case XA_IDX: + if (IS_AOP_XA (aop)) break; + else if (IS_AOP_HX (aop)) + transferRegReg (hc08_reg_hx, hc08_reg_xa, FALSE); + else if (IS_AOP_AX (aop)) + { + pushReg (hc08_reg_a, FALSE); + transferRegReg (hc08_reg_x, hc08_reg_a, FALSE); + pullReg (hc08_reg_x); + } + else + { + loadRegFromAop (hc08_reg_a, aop, loffset); + loadRegFromAop (hc08_reg_x, aop, loffset + 1); + } + break; } // ignore caching for now -#if 0 - reg->aop = aop; - reg->aopofs = loffset; -#endif + hc08_dirtyReg (reg, FALSE); + hc08_useReg (reg); } @@ -779,14 +874,14 @@ /* be copied to the original aop location. */ /*--------------------------------------------------------------------------*/ static asmop * -forceStackedAop (asmop *aop, bool copyOrig) +forceStackedAop (asmop * aop, bool copyOrig) { reg_info *reg; int loffset; asmop *newaop = newAsmop (aop->type); - memcpy (newaop, aop, sizeof(*newaop)); + memcpy (newaop, aop, sizeof (*newaop)); - DD(emitcode("", "; forcedStackAop %s", aopName(aop))); + DD (emitcode ("", "; forcedStackAop %s", aopName (aop))); if (copyOrig && hc08_reg_a->isFree) reg = hc08_reg_a; @@ -795,7 +890,7 @@ else reg = NULL; - for (loffset=0; loffset < newaop->size; loffset++) + for (loffset = 0; loffset < newaop->size; loffset++) { asmop *aopsof = newAsmop (AOP_SOF); aopsof->size = 1; @@ -815,7 +910,7 @@ if (!reg && copyOrig) { - for (loffset=0; loffset < newaop->size; loffset++) + for (loffset = 0; loffset < newaop->size; loffset++) { transferAopAop (aop, loffset, newaop, loffset); } @@ -827,31 +922,30 @@ /*--------------------------------------------------------------------------*/ /* storeRegToAop - Store register reg to logical offset loffset of aop. */ +/* For multi-byte registers, loffset is of the lsb reg. */ /*--------------------------------------------------------------------------*/ static void -storeRegToAop (reg_info *reg, asmop *aop, int loffset) +storeRegToAop (reg_info *reg, asmop * aop, int loffset) { int regidx = reg->rIdx; - #if 0 +#if 0 regs *otherreg; int otheridx; - #endif +#endif - DD(emitcode ("", "; storeRegToAop (%s, %s, %d), stacked=%d, isaddr=%d", - reg->name, aopName (aop), loffset, aop->stacked, aop->isaddr)); + DD (emitcode ("", "; storeRegToAop (%s, %s, %d), stacked=%d, isaddr=%d", + reg->name, aopName (aop), loffset, aop->stacked, aop->isaddr)); - if ((reg->rIdx == HX_IDX) && aop->stacked - && (aop->stk_aop[loffset] || aop->stk_aop[loffset+1])) + if ((reg->rIdx == HX_IDX) && aop->stacked && (aop->stk_aop[loffset] || aop->stk_aop[loffset + 1])) { - storeRegToAop (hc08_reg_h, aop, loffset+1); + storeRegToAop (hc08_reg_h, aop, loffset + 1); storeRegToAop (hc08_reg_x, aop, loffset); return; } - if ((reg->rIdx == XA_IDX) && aop->stacked - && (aop->stk_aop[loffset] || aop->stk_aop[loffset+1])) + if ((reg->rIdx == XA_IDX) && aop->stacked && (aop->stk_aop[loffset] || aop->stk_aop[loffset + 1])) { - storeRegToAop (hc08_reg_x, aop, loffset+1); + storeRegToAop (hc08_reg_x, aop, loffset + 1); storeRegToAop (hc08_reg_a, aop, loffset); return; } @@ -862,119 +956,125 @@ return; } - if (aop->type == AOP_STR) - { - if (loffset==0) - transferRegReg (reg, hc08_reg_x, FALSE); - else if (loffset==1) - transferRegReg (reg, hc08_reg_h, FALSE); - return; - } - if (aop->type == AOP_DUMMY) return; - if (aop->type == AOP_CRY) /* This can only happen if IFX was optimized */ - return; /* away, so just toss the result */ + if (aop->type == AOP_CRY) /* This can only happen if IFX was optimized */ + return; /* away, so just toss the result */ switch (regidx) { - case A_IDX: - if ((aop->type == AOP_REG) && (loffset < aop->size)) - transferRegReg(reg, aop->aopu.aop_reg[loffset], FALSE); - else - emitcode ("sta","%s", aopAdrStr (aop, loffset, FALSE)); - break; - case X_IDX: - if ((aop->type == AOP_REG) && (loffset < aop->size)) - transferRegReg(reg, aop->aopu.aop_reg[loffset], FALSE); - else - emitcode ("stx","%s", aopAdrStr (aop, loffset, FALSE)); - break; - case H_IDX: - if (hc08_reg_a->isFree) - { - transferRegReg (hc08_reg_h, hc08_reg_a, FALSE); - storeRegToAop (hc08_reg_a, aop, loffset); - hc08_freeReg (hc08_reg_a); - } - else if (hc08_reg_x->isFree) - { - transferRegReg (hc08_reg_h, hc08_reg_x, FALSE); - storeRegToAop (hc08_reg_x, aop, loffset); - hc08_freeReg (hc08_reg_x); - } - else - { - pushReg (hc08_reg_a, TRUE); - transferRegReg (hc08_reg_h, hc08_reg_a, FALSE); - storeRegToAop (hc08_reg_a, aop, loffset); - pullReg (hc08_reg_a); - } - break; - case HX_IDX: - if ((aop->type == AOP_DIR) ) - { - emitcode("sthx","%s", aopAdrStr (aop, loffset+1, TRUE)); - } - else if (IS_AOP_XA(aop)) - transferRegReg(reg, hc08_reg_xa, FALSE); - else if (IS_AOP_HX(aop)) - break; - else - { - bool needpula; - needpula = pushRegIfUsed (hc08_reg_a); - transferRegReg (hc08_reg_h, hc08_reg_a, FALSE); - storeRegToAop (hc08_reg_a, aop, loffset+1); - storeRegToAop (hc08_reg_x, aop, loffset); - pullOrFreeReg (hc08_reg_a, needpula); - } + case A_IDX: + if ((aop->type == AOP_REG) && (loffset < aop->size)) + transferRegReg (reg, aop->aopu.aop_reg[loffset], FALSE); + else + { + emitcode ("sta", "%s", aopAdrStr (aop, loffset, FALSE)); + regalloc_dry_run_cost += ((aop->type == AOP_DIR || aop->type == AOP_IMMD) ? 2 :3); + } + break; + case X_IDX: + if ((aop->type == AOP_REG) && (loffset < aop->size)) + transferRegReg (reg, aop->aopu.aop_reg[loffset], FALSE); + else + { + emitcode ("stx", "%s", aopAdrStr (aop, loffset, FALSE)); + regalloc_dry_run_cost += ((aop->type == AOP_DIR || aop->type == AOP_IMMD) ? 2 :3); + } + break; + case H_IDX: + if ((aop->type == AOP_REG) && (loffset < aop->size)) + transferRegReg (reg, aop->aopu.aop_reg[loffset], FALSE); + else if (hc08_reg_a->isFree) + { + transferRegReg (hc08_reg_h, hc08_reg_a, FALSE); + storeRegToAop (hc08_reg_a, aop, loffset); + hc08_freeReg (hc08_reg_a); + } + else if (hc08_reg_x->isFree) + { + transferRegReg (hc08_reg_h, hc08_reg_x, FALSE); + storeRegToAop (hc08_reg_x, aop, loffset); + hc08_freeReg (hc08_reg_x); + } + else + { + pushReg (hc08_reg_a, TRUE); + transferRegReg (hc08_reg_h, hc08_reg_a, FALSE); + storeRegToAop (hc08_reg_a, aop, loffset); + pullReg (hc08_reg_a); + } + break; + case HX_IDX: + if (aop->type == AOP_DIR || IS_S08 && aop->type == AOP_EXT) + { + emitcode ("sthx", "%s", aopAdrStr (aop, loffset, TRUE)); + regalloc_dry_run_cost += (aop->type == AOP_DIR ? 2 : 3);; + } + else if (IS_AOP_XA (aop)) + transferRegReg (reg, hc08_reg_xa, FALSE); + else if (IS_AOP_HX (aop)) break; - case XA_IDX: - if (IS_AOP_HX(aop)) - transferRegReg(reg, hc08_reg_hx, FALSE); - else if (IS_AOP_XA(aop)) - break; - else - { - storeRegToAop (hc08_reg_a, aop, loffset); - storeRegToAop (hc08_reg_x, aop, loffset+1); - } + else + { + bool needpula; + needpula = pushRegIfUsed (hc08_reg_a); + transferRegReg (hc08_reg_h, hc08_reg_a, FALSE); + storeRegToAop (hc08_reg_a, aop, loffset + 1); + storeRegToAop (hc08_reg_x, aop, loffset); + pullOrFreeReg (hc08_reg_a, needpula); + } + break; + case XA_IDX: + if (IS_AOP_HX (aop)) + transferRegReg (reg, hc08_reg_hx, FALSE); + else if (IS_AOP_XA (aop)) break; + else if (IS_AOP_AX (aop)) + { + pushReg (hc08_reg_a, FALSE); + transferRegReg (hc08_reg_x, hc08_reg_a, FALSE); + pullReg (hc08_reg_x); + } + else + { + storeRegToAop (hc08_reg_a, aop, loffset); + storeRegToAop (hc08_reg_x, aop, loffset + 1); + } + break; + default: + wassert (0); } -/* Disable the register tracking for now */ + /* Disable the register tracking for now */ #if 0 //if (!reg->aop || (reg->aop && (reg->aop != aop))) - { - //if (reg->aop!=aop) - for (otheridx=0;otheridxaop!=aop) + for (otheridx = 0; otheridx < hc08_nRegs; otheridx++) + { + otherreg = hc08_regWithIdx (otheridx); + if (otherreg && otherreg->aop + && otherreg->aop->op && aop->op && operandsEqu (otherreg->aop->op, aop->op) && (otherreg->aopofs == loffset)) { - otherreg=hc08_regWithIdx(otheridx); - if (otherreg && otherreg->aop - && otherreg->aop->op && aop->op - && operandsEqu(otherreg->aop->op,aop->op) - && (otherreg->aopofs == loffset)) - { - DD(emitcode("","; marking %s stale", otherreg->name)); - otherreg->aop=NULL; - } + DD (emitcode ("", "; marking %s stale", otherreg->name)); + otherreg->aop = NULL; } - if ((!hc08_reg_x->aop || !hc08_reg_h->aop) && hc08_reg_hx->aop) - { - hc08_reg_hx->aop = NULL; - DD(emitcode("","; marking hx stale")); - } - if ((!hc08_reg_x->aop || !hc08_reg_a->aop) && hc08_reg_xa->aop) - { - hc08_reg_xa->aop = NULL; - DD(emitcode("","; marking xa stale")); - } + } + if ((!hc08_reg_x->aop || !hc08_reg_h->aop) && hc08_reg_hx->aop) + { + hc08_reg_hx->aop = NULL; + DD (emitcode ("", "; marking hx stale")); + } + if ((!hc08_reg_x->aop || !hc08_reg_a->aop) && hc08_reg_xa->aop) + { + hc08_reg_xa->aop = NULL; + DD (emitcode ("", "; marking xa stale")); + } - reg->aop = aop; - reg->aopofs = loffset; - } + reg->aop = aop; + reg->aopofs = loffset; + } #endif } @@ -982,54 +1082,70 @@ /* loadRegFromConst - Load register reg from constant c. */ /*--------------------------------------------------------------------------*/ static void -loadRegFromConst (reg_info *reg, char *c) +loadRegFromConst (reg_info * reg, char *c) { switch (reg->rIdx) { - case A_IDX: - if (!strcmp(c,zero)) + case A_IDX: + if (!strcmp (c, zero)) + { emitcode ("clra", ""); - else + regalloc_dry_run_cost++; + } + else + { emitcode ("lda", "%s", c); - break; - case X_IDX: - if (!strcmp(c,zero)) + regalloc_dry_run_cost += 2; + } + break; + case X_IDX: + if (!strcmp (c, zero)) + { emitcode ("clrx", ""); - else + regalloc_dry_run_cost++; + } + else + { emitcode ("ldx", "%s", c); - break; - case H_IDX: - if (!strcmp(c,zero)) + regalloc_dry_run_cost += 2; + } + break; + case H_IDX: + if (!strcmp (c, zero)) + { emitcode ("clrh", ""); - else if (hc08_reg_a->isFree) - { - loadRegFromConst (hc08_reg_a, c); - transferRegReg (hc08_reg_a, hc08_reg_h, TRUE); - } - else if (hc08_reg_x->isFree) - { - loadRegFromConst (hc08_reg_x, c); - transferRegReg (hc08_reg_x, hc08_reg_h, TRUE); - } - else - { - pushReg (hc08_reg_a, TRUE); - loadRegFromConst (hc08_reg_a, c); - transferRegReg (hc08_reg_a, hc08_reg_h, TRUE); - pullReg (hc08_reg_a); - } - break; - case HX_IDX: - emitcode ("ldhx", "%s", c); - break; - case XA_IDX: - emitcode ("lda", "%s", c); - emitcode ("ldx", "%s >> 8", c); - break; - default: - werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - "Bad rIdx in loadRegFromConst"); - return; + regalloc_dry_run_cost++; + } + else if (hc08_reg_a->isFree) + { + loadRegFromConst (hc08_reg_a, c); + transferRegReg (hc08_reg_a, hc08_reg_h, TRUE); + } + else if (hc08_reg_x->isFree) + { + loadRegFromConst (hc08_reg_x, c); + transferRegReg (hc08_reg_x, hc08_reg_h, TRUE); + } + else + { + pushReg (hc08_reg_a, TRUE); + loadRegFromConst (hc08_reg_a, c); + transferRegReg (hc08_reg_a, hc08_reg_h, TRUE); + pullReg (hc08_reg_a); + } + break; + case HX_IDX: + emitcode ("ldhx", "%s", c); + regalloc_dry_run_cost += 3; + break; + case XA_IDX: + emitcode ("lda", "%s", c); + emitcode ("ldx", "%s >> 8", c); + regalloc_dry_run_cost += 4; + break; + default: + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "Bad rIdx in loadRegFromConst"); + return; } hc08_useReg (reg); } @@ -1039,7 +1155,7 @@ /* storeConstToAop- Store constant c to logical offset loffset of asmop aop.*/ /*--------------------------------------------------------------------------*/ static void -storeConstToAop (char *c, asmop *aop, int loffset) +storeConstToAop (char *c, asmop * aop, int loffset) { if (aop->stacked && aop->stk_aop[loffset]) { @@ -1049,39 +1165,49 @@ switch (aop->type) { - case AOP_DIR: - if (!strcmp(c,zero)) + case AOP_DIR: + /* clr operates with read-modify-write cycles, so don't use if the */ + /* destination is volatile to avoid the read side-effect. */ + if (!strcmp (c, zero) && !(aop->op && isOperandVolatile (aop->op, FALSE)) && optimize.codeSize) + { + /* clr dst : 2 bytes, 5 cycles */ emitcode ("clr", "%s", aopAdrStr (aop, loffset, FALSE)); - else + regalloc_dry_run_cost += 2; + } + else + { + /* mov #0,dst : 3 bytes, 4 cycles */ emitcode ("mov", "%s,%s", c, aopAdrStr (aop, loffset, FALSE)); + regalloc_dry_run_cost += 3; + } + break; + case AOP_REG: + if (loffset > (aop->size - 1)) break; - case AOP_REG: - if (loffset>(aop->size-1)) - break; - loadRegFromConst (aop->aopu.aop_reg[loffset], c); - break; - case AOP_DUMMY: - break; - default: - if (hc08_reg_a->isFree) - { - loadRegFromConst (hc08_reg_a, c); - storeRegToAop( hc08_reg_a, aop, loffset); - hc08_freeReg (hc08_reg_a); - } - else if (hc08_reg_x->isFree) - { - loadRegFromConst (hc08_reg_x, c); - storeRegToAop( hc08_reg_x, aop, loffset); - hc08_freeReg (hc08_reg_x); - } - else - { - pushReg (hc08_reg_a, TRUE); - loadRegFromConst (hc08_reg_a, c); - storeRegToAop( hc08_reg_a, aop, loffset); - pullReg (hc08_reg_a); - } + loadRegFromConst (aop->aopu.aop_reg[loffset], c); + break; + case AOP_DUMMY: + break; + default: + if (hc08_reg_a->isFree) + { + loadRegFromConst (hc08_reg_a, c); + storeRegToAop (hc08_reg_a, aop, loffset); + hc08_freeReg (hc08_reg_a); + } + else if (hc08_reg_x->isFree) + { + loadRegFromConst (hc08_reg_x, c); + storeRegToAop (hc08_reg_x, aop, loffset); + hc08_freeReg (hc08_reg_x); + } + else + { + pushReg (hc08_reg_a, TRUE); + loadRegFromConst (hc08_reg_a, c); + storeRegToAop (hc08_reg_a, aop, loffset); + pullReg (hc08_reg_a); + } } } @@ -1094,29 +1220,30 @@ /* zeroed. reg must be an 8-bit register. */ /*--------------------------------------------------------------------------*/ static void -storeRegSignToUpperAop (reg_info *reg, asmop *aop, int loffset, bool isSigned) +storeRegSignToUpperAop (reg_info * reg, asmop * aop, int loffset, bool isSigned) { // int regidx = reg->rIdx; int size = aop->size; - if (size<=loffset) + if (size <= loffset) return; if (!isSigned) { /* Unsigned case */ - while (loffset 1 && isSigned && aop->type == AOP_REG && aop->aopu.aop_reg[0]->rIdx == A_IDX) + pushReg (hc08_reg_a, TRUE); + storeRegSignToUpperAop (reg, aop, 1, isSigned); + if (size > 1 && isSigned && aop->type == AOP_REG && aop->aopu.aop_reg[0]->rIdx == A_IDX) + pullReg (hc08_reg_a); + break; + case HX_IDX: + if (size == 1) + { + storeRegToAop (hc08_reg_x, aop, 0); + } + else + { + storeRegToAop (reg, aop, 0); + storeRegSignToUpperAop (hc08_reg_h, aop, 2, isSigned); + } + break; + case XA_IDX: + if (size == 1) + { + storeRegToAop (hc08_reg_a, aop, 0); + } + else + { + storeRegToAop (reg, aop, 0); + storeRegSignToUpperAop (hc08_reg_x, aop, 2, isSigned); + } + break; + default: + wassert (0); } } @@ -1175,14 +1308,15 @@ { bool needpula = FALSE; reg_info *reg = NULL; - int regIdx; bool keepreg = FALSE; + bool afree; + + wassert (srcaop && dstaop); /* ignore transfers at the same byte, unless its volatile */ if (srcaop->op && !isOperandVolatile (srcaop->op, FALSE) && dstaop->op && !isOperandVolatile (dstaop->op, FALSE) - && operandsEqu(srcaop->op, dstaop->op) && srcofs == dstofs - && dstaop->type == srcaop->type) + && operandsEqu (srcaop->op, dstaop->op) && srcofs == dstofs && dstaop->type == srcaop->type) return; if (srcaop->stacked && srcaop->stk_aop[srcofs]) @@ -1205,49 +1339,39 @@ if (dstofs >= dstaop->size) return; - if ((dstaop->type == AOP_DIR) - && ((srcaop->type == AOP_DIR) || (srcaop->type == AOP_LIT)) ) + if ((dstaop->type == AOP_DIR) && ((srcaop->type == AOP_DIR) || (srcaop->type == AOP_LIT))) { - if (srcaop->type == AOP_LIT) + char *src = aopAdrStr (srcaop, srcofs, FALSE); + /* clr operates with read-modify-write cycles, so don't use if the */ + /* destination is volatile to avoid the read side-effect. */ + if (!strcmp (src, zero) && !(dstaop->op && isOperandVolatile (dstaop->op, FALSE)) && optimize.codeSize) { - unsigned long lit; - unsigned long bytemask; - - lit = ulFromVal (srcaop->aopu.aop_lit); - bytemask = (lit >> (srcofs*8)) & 0xff; - - if (bytemask == 0) - { - emitcode ("clr", "%s", aopAdrStr(dstaop, dstofs, FALSE)); - return; - } + /* clr dst : 2 bytes, 5 cycles */ + emitcode ("clr", "%s", aopAdrStr (dstaop, dstofs, FALSE)); + regalloc_dry_run_cost += 2; + } + else + { + /* mov #0,dst : 3 bytes, 4 cycles */ + emitcode ("mov", "%s,%s", src, aopAdrStr (dstaop, dstofs, FALSE)); + regalloc_dry_run_cost += 3; } - - emitcode("mov", "%s,%s", aopAdrStr(srcaop, srcofs, FALSE), - aopAdrStr(dstaop, dstofs, FALSE)); return; } if (dstaop->type == AOP_REG) { - regIdx = dstaop->aopu.aop_reg[dstofs]->rIdx; - if ((regIdx == A_IDX) || (regIdx == X_IDX)) - { - reg = dstaop->aopu.aop_reg[dstofs]; - keepreg = TRUE; - } + reg = dstaop->aopu.aop_reg[dstofs]; + keepreg = TRUE; } - - if ((srcaop->type == AOP_REG) && (srcaop->aopu.aop_reg[srcofs])) + else if ((srcaop->type == AOP_REG) && (srcaop->aopu.aop_reg[srcofs])) { - regIdx = srcaop->aopu.aop_reg[srcofs]->rIdx; - if ((regIdx == A_IDX) || (regIdx == X_IDX)) - { - reg = srcaop->aopu.aop_reg[srcofs]; - keepreg = TRUE; - } + reg = srcaop->aopu.aop_reg[srcofs]; + keepreg = TRUE; } + afree = hc08_reg_a->isFree; + if (!reg) { if (hc08_reg_a->isFree) @@ -1267,6 +1391,8 @@ if (!keepreg) pullOrFreeReg (hc08_reg_a, needpula); + + hc08_reg_a->isFree = afree; } @@ -1278,7 +1404,9 @@ accopWithMisc (char *accop, char *param) { emitcode (accop, "%s", param); - hc08_dirtyReg (hc08_reg_a, FALSE); + regalloc_dry_run_cost += ((!param[0] || !strcmp(param, ",x")) ? 1 : ((param[0]=='#' || param[0]=='*') ? 2 : 3)); + if (strcmp (accop, "bit") && strcmp (accop, "cmp") && strcmp (accop, "cpx")) + hc08_dirtyReg (hc08_reg_a, FALSE); } /*--------------------------------------------------------------------------*/ @@ -1298,16 +1426,26 @@ if (aop->type == AOP_DUMMY) return; - if (aop->type == AOP_REG) + if (loffset >= aop->size) + { + emitcode (accop, "#0"); + regalloc_dry_run_cost += 2; + } + else if (aop->type == AOP_REG) { pushReg (aop->aopu.aop_reg[loffset], FALSE); emitcode (accop, "1,s"); + regalloc_dry_run_cost += 3; pullNull (1); } else - emitcode (accop, "%s", aopAdrStr (aop, loffset, FALSE)); + { + emitcode (accop, "%s", aopAdrStr (aop, loffset, FALSE)); + regalloc_dry_run_cost += 3; + } - hc08_dirtyReg (hc08_reg_a, FALSE); + if (strcmp (accop, "bit") && strcmp (accop, "cmp") && strcmp (accop, "cpx")) + hc08_dirtyReg (hc08_reg_a, FALSE); } @@ -1318,47 +1456,51 @@ /* Supports: com, dec, inc, lsl, lsr, neg, rol, ror */ /*--------------------------------------------------------------------------*/ static void -rmwWithReg (char *rmwop, reg_info *reg) +rmwWithReg (char *rmwop, reg_info * reg) { char rmwbuf[10]; char *rmwaop = rmwbuf; if (reg->rIdx == A_IDX) { - sprintf(rmwaop,"%sa", rmwop); + sprintf (rmwaop, "%sa", rmwop); emitcode (rmwaop, ""); + regalloc_dry_run_cost++; hc08_dirtyReg (hc08_reg_a, FALSE); } else if (reg->rIdx == X_IDX) { - sprintf(rmwaop,"%sx", rmwop); + sprintf (rmwaop, "%sx", rmwop); emitcode (rmwaop, ""); - hc08_dirtyReg (hc08_reg_a, FALSE); + regalloc_dry_run_cost++; + hc08_dirtyReg (hc08_reg_x, FALSE); } else if (hc08_reg_a->isFree) { - transferRegReg(reg, hc08_reg_a, FALSE); - sprintf(rmwaop,"%sa", rmwop); + transferRegReg (reg, hc08_reg_a, FALSE); + sprintf (rmwaop, "%sa", rmwop); emitcode (rmwaop, ""); + regalloc_dry_run_cost++; hc08_dirtyReg (hc08_reg_a, FALSE); - transferRegReg(hc08_reg_a, reg, TRUE); + transferRegReg (hc08_reg_a, reg, TRUE); } else { pushReg (reg, FALSE); emitcode (rmwop, "1,s"); + regalloc_dry_run_cost += 3; pullReg (reg); hc08_dirtyReg (reg, FALSE); } } /*--------------------------------------------------------------------------*/ -/* accopWithAop - Emit read/modify/write instruction rmwop with the byte at */ +/* rmwWithAop - Emit read/modify/write instruction rmwop with the byte at */ /* logical offset loffset of asmop aop. */ /* Supports: com, dec, inc, lsl, lsr, neg, rol, ror, tst */ /*--------------------------------------------------------------------------*/ static void -rmwWithAop (char *rmwop, asmop *aop, int loffset) +rmwWithAop (char *rmwop, asmop * aop, int loffset) { bool needpula = FALSE; @@ -1370,23 +1512,249 @@ switch (aop->type) { - case AOP_REG: - rmwWithReg (rmwop, aop->aopu.aop_reg[loffset]); - break; - case AOP_EXT: - needpula = pushRegIfUsed (hc08_reg_a); - loadRegFromAop (hc08_reg_a, aop, loffset); - rmwWithReg (rmwop, hc08_reg_a); - if (strcmp ("tst", rmwop)) - storeRegToAop (hc08_reg_a, aop, loffset); - pullOrFreeReg (hc08_reg_a, needpula); - break; - case AOP_DUMMY: - break; - default: - emitcode (rmwop, "%s", aopAdrStr (aop, loffset, FALSE)); - } + case AOP_REG: + rmwWithReg (rmwop, aop->aopu.aop_reg[loffset]); + break; + case AOP_EXT: + needpula = pushRegIfUsed (hc08_reg_a); + loadRegFromAop (hc08_reg_a, aop, loffset); + rmwWithReg (rmwop, hc08_reg_a); + if (strcmp ("tst", rmwop)) + storeRegToAop (hc08_reg_a, aop, loffset); + pullOrFreeReg (hc08_reg_a, needpula); + break; + case AOP_DUMMY: + break; + case AOP_SOF: + { + int offset = aop->size - 1 - loffset; + offset += _G.stackOfs + _G.stackPushes + aop->aopu.aop_stk + 1; + if (offset > 0xff) + { + /* Unfortunately, the rmw class of instructions only support a */ + /* single byte stack pointer offset and we need two. */ + needpula = pushRegIfUsed (hc08_reg_a); + loadRegFromAop (hc08_reg_a, aop, loffset); + rmwWithReg (rmwop, hc08_reg_a); + if (strcmp ("tst", rmwop)) + storeRegToAop (hc08_reg_a, aop, loffset); + pullOrFreeReg (hc08_reg_a, needpula); + break; + } + /* If the offset is small enough, fall through to default case */ + } + default: + emitcode (rmwop, "%s", aopAdrStr (aop, loffset, FALSE)); + regalloc_dry_run_cost += ((aop->type == AOP_DIR || aop->type == AOP_IMMD) ? 2 : 3); + } + +} + +/*--------------------------------------------------------------------------*/ +/* loadRegIndexed - Load a register using indexed addressing mode. */ +/* NOTE: offset is physical (not logical) */ +/*--------------------------------------------------------------------------*/ +static void +loadRegIndexed (reg_info * reg, int offset, char * rematOfs) +{ + bool needpula = FALSE; + + /* The rematerialized offset may have a "#" prefix; skip over it */ + if (rematOfs && rematOfs[0] == '#') + rematOfs++; + if (rematOfs && !rematOfs[0]) + rematOfs = NULL; + + /* force offset to signed 16-bit range */ + offset &= 0xffff; + if (offset & 0x8000) + offset = 0x10000 - offset; + + switch (reg->rIdx) + { + case A_IDX: + if (rematOfs) + { + if (!offset) + emitcode ("lda", "(%s),x", rematOfs); + else + emitcode ("lda", "(%s+%d),x", rematOfs, offset); + regalloc_dry_run_cost += 3; + } + else if (offset) + { + emitcode ("lda", "%d,x", offset); + if (offset > 1 && offset <= 0xff) + regalloc_dry_run_cost += 2; + else + regalloc_dry_run_cost += 3; + } + else + { + emitcode ("lda", ",x"); + regalloc_dry_run_cost++; + } + hc08_dirtyReg (reg, FALSE); + break; + case X_IDX: + if (rematOfs) + { + if (!offset) + emitcode ("ldx", "(%s),x", rematOfs); + else + emitcode ("ldx", "(%s+%d),x", rematOfs, offset); + regalloc_dry_run_cost += 3; + } + else if (offset) + { + emitcode ("ldx", "%d,x", offset); + if (offset > 1 && offset <= 0xff) + regalloc_dry_run_cost += 2; + else + regalloc_dry_run_cost += 3; + } + else + { + emitcode ("ldx", ",x"); + regalloc_dry_run_cost++; + } + hc08_dirtyReg (reg, FALSE); + break; + case H_IDX: + needpula = pushRegIfUsed (hc08_reg_a); + loadRegIndexed (hc08_reg_a, offset, rematOfs); + transferRegReg (hc08_reg_a, hc08_reg_h, TRUE); + pullOrFreeReg (hc08_reg_a, needpula); + break; + case HX_IDX: + if (!IS_S08) + { + needpula = pushRegIfUsed (hc08_reg_a); + loadRegIndexed (hc08_reg_a, offset, rematOfs); + pushReg (hc08_reg_a, TRUE); + loadRegIndexed (hc08_reg_x, offset+1, rematOfs); + pullReg (hc08_reg_h); + pullOrFreeReg (hc08_reg_a, needpula); + break; + } + else if (rematOfs) + { + if (!offset) + emitcode ("ldhx", "(%s),x", rematOfs); + else + emitcode ("ldhx", "(%s+%d),x", rematOfs, offset); + regalloc_dry_run_cost += 4; + } + else if (offset) + { + emitcode ("ldhx", "%d,x", offset); + if (offset > 1 && offset <= 0xff) + regalloc_dry_run_cost += 3; + else + regalloc_dry_run_cost += 4; + } + else + { + emitcode ("ldhx", ",x"); + regalloc_dry_run_cost += 2; + } + hc08_dirtyReg (reg, FALSE); + break; + case XA_IDX: + loadRegIndexed (hc08_reg_a, offset+1, rematOfs); + loadRegIndexed (hc08_reg_x, offset, rematOfs); + break; + default: + wassert (0); + } +} + +/*--------------------------------------------------------------------------*/ +/* storeRegIndexed - Store a register using indexed addressing mode. */ +/* NOTE: offset is physical (not logical) */ +/*--------------------------------------------------------------------------*/ +static void +storeRegIndexed (reg_info * reg, int offset, char * rematOfs) +{ + bool needpula = FALSE; + + /* The rematerialized offset may have a "#" prefix; skip over it */ + if (rematOfs && rematOfs[0] == '#') + rematOfs++; + if (rematOfs && !rematOfs[0]) + rematOfs = NULL; + + /* force offset to signed 16-bit range */ + offset &= 0xffff; + if (offset & 0x8000) + offset = 0x10000 - offset; + switch (reg->rIdx) + { + case A_IDX: + if (rematOfs) + { + if (!offset) + emitcode ("sta", "(%s),x", rematOfs); + else + emitcode ("sta", "(%s+%d),x", rematOfs, offset); + regalloc_dry_run_cost += 3; + } + else if (offset) + { + emitcode ("sta", "%d,x", offset); + if (offset > 1 && offset <= 0xff) + regalloc_dry_run_cost += 2; + else + regalloc_dry_run_cost += 3; + } + else + { + emitcode ("sta", ",x"); + regalloc_dry_run_cost++; + } + break; + case X_IDX: + if (rematOfs) + { + if (!offset) + emitcode ("stx", "(%s),x", rematOfs); + else + emitcode ("stx", "(%s+%d),x", rematOfs, offset); + regalloc_dry_run_cost += 3; + } + else if (offset) + { + emitcode ("stx", "%d,x", offset); + if (offset > 1 && offset <= 0xff) + regalloc_dry_run_cost += 2; + else + regalloc_dry_run_cost += 3; + } + else + { + emitcode ("stx", ",x"); + regalloc_dry_run_cost++; + } + break; + case H_IDX: + needpula = pushRegIfUsed (hc08_reg_a); + transferRegReg (hc08_reg_h, hc08_reg_a, TRUE); + storeRegIndexed (hc08_reg_a, offset, rematOfs); + pullOrFreeReg (hc08_reg_a, needpula); + break; + case HX_IDX: + storeRegIndexed (hc08_reg_h, offset, rematOfs); + storeRegIndexed (hc08_reg_x, offset+1, rematOfs); + break; + case XA_IDX: + /* This case probably won't happen, but it's easy to implement */ + storeRegIndexed (hc08_reg_x, offset, rematOfs); + storeRegIndexed (hc08_reg_a, offset+1, rematOfs); + break; + default: + wassert (0); + } } @@ -1418,6 +1786,111 @@ #endif /*-----------------------------------------------------------------*/ +/* operandConflictsWithHX - true if operand in h and/or x register */ +/*-----------------------------------------------------------------*/ +static bool +operandConflictsWithHX (operand *op) +{ + symbol *sym; + int i; + + if (IS_ITEMP (op)) + { + sym = OP_SYMBOL (op); + if (!sym->isspilt) + { + for(i = 0; i < sym->nRegs; i++) + if (sym->regs[i] == hc08_reg_h || sym->regs[i] == hc08_reg_x) + return TRUE; + } + } + + return FALSE; +} + +/*-----------------------------------------------------------------*/ +/* operandOnStack - returns True if operand is on the stack */ +/*-----------------------------------------------------------------*/ +static bool +operandOnStack(operand *op) +{ + symbol *sym; + + if (!op || !IS_SYMOP (op)) + return FALSE; + sym = OP_SYMBOL (op); + if (!sym->isspilt && sym->onStack) + return TRUE; + if (sym->isspilt) + { + sym = sym->usl.spillLoc; + if (sym && sym->onStack) + return TRUE; + } + return FALSE; +} + +/*-----------------------------------------------------------------*/ +/* tsxUseful - returns True if tsx could help at least two */ +/* anticipated stack references */ +/*-----------------------------------------------------------------*/ +static bool +tsxUseful(iCode *ic) +{ + int uses = 0; + + if (ic->op == CALL) + { + if (IC_RESULT (ic) && operandSize (IC_RESULT (ic)) < 2 && operandOnStack (IC_RESULT (ic))) + { + uses++; + ic = ic->next; + } + } + + while (ic && uses < 2) + { + if (ic->op == IFX) + { + if (operandOnStack (IC_COND (ic))) + uses += operandSize(IC_COND (ic)); + break; + } + else if (ic->op == JUMPTABLE) + { + if (operandOnStack (IC_JTCOND (ic))) + uses++; + break; + } + else if (ic->op == ADDRESS_OF) + { + if (operandOnStack (IC_RIGHT (ic))) + break; + } + else if (ic->op == LABEL || ic->op == GOTO || ic->op == CALL || ic->op == PCALL) + break; + else if (POINTER_SET (ic) || POINTER_GET (ic)) + break; + else + { + if (operandConflictsWithHX (IC_RESULT (ic))) + break; + if (operandOnStack (IC_LEFT (ic))) + uses += operandSize (IC_LEFT (ic)); + if (operandOnStack (IC_RIGHT (ic))) + uses += operandSize (IC_RIGHT (ic)); + if (operandOnStack (IC_RESULT (ic))) + uses += operandSize (IC_RESULT (ic)); + } + + ic = ic->next; + } + + return uses>=2; +} + + +/*-----------------------------------------------------------------*/ /* aopForSym - for a true symbol */ /*-----------------------------------------------------------------*/ static asmop * @@ -1456,6 +1929,37 @@ aop->aopu.aop_dir = sym->rname; aop->size = getSize (sym->type); aop->aopu.aop_stk = sym->stack; + + if (!regalloc_dry_run && hc08_reg_hx->isFree && hc08_reg_hx->aop != &tsxaop) + { + if (!hc08_reg_h->isDead || !hc08_reg_x->isDead) + return aop; + if (ic->op == IFX && operandConflictsWithHX (IC_COND (ic))) + return aop; + else if (ic->op == JUMPTABLE && operandConflictsWithHX (IC_JTCOND (ic))) + return aop; + else + { + /* If this is a pointer gen/set, then hx is definitely in use */ + if (POINTER_SET (ic) || POINTER_GET (ic)) + return aop; + if (ic->op == ADDRESS_OF) + return aop; + if (operandConflictsWithHX (IC_LEFT (ic))) + return aop; + if (operandConflictsWithHX (IC_RIGHT (ic))) + return aop; + } + /* It's safe to use tsx here. tsx costs 1 byte and 2 cycles but */ + /* can save us 1 byte and 1 cycle for each time we can use x */ + /* instead of sp. For a single use, we break even on bytes, but */ + /* lose a cycle. Make sure there are at least two uses. */ + if (!tsxUseful (ic)) + return aop; + emitcode ("tsx", ""); + hc08_reg_hx->aop = &tsxaop; + _G.tsxStackPushes = _G.stackPushes; + } return aop; } @@ -1479,10 +1983,9 @@ - werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - "aopForSym should never reach here"); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "aopForSym should never reach here"); - exit(1); + exit (1); /* if it is in code space */ if (IN_CODESPACE (space)) @@ -1502,24 +2005,32 @@ int ptr_type = 0; int val = 0; + if (!ic) + { + fprintf (stderr, "Symbol %s to be rematerialized, but has no rematiCode.\n", sym->name); + wassert (0); + } + for (;;) { if (ic->op == '+') val += (int) operandLitValue (IC_RIGHT (ic)); else if (ic->op == '-') val -= (int) operandLitValue (IC_RIGHT (ic)); - else if (IS_CAST_ICODE(ic)) + else if (IS_CAST_ICODE (ic)) { - sym_link *from_type = operandType(IC_RIGHT(ic)); + sym_link *from_type = operandType (IC_RIGHT (ic)); ic = OP_SYMBOL (IC_RIGHT (ic))->rematiCode; - ptr_type = DCL_TYPE(from_type); + ptr_type = DCL_TYPE (from_type); if (ptr_type == IPOINTER) - {// bug #481053 + { + // bug #481053 ptr_type = POINTER; } - continue ; + continue; } - else break; + else + break; ic = OP_SYMBOL (IC_LEFT (ic))->rematiCode; } @@ -1528,33 +2039,29 @@ { if (val) { - SNPRINTF (buffer, sizeof(buffer), - "(%s %c 0x%04x)", - OP_SYMBOL (IC_LEFT (ic))->rname, - val >= 0 ? '+' : '-', - abs (val) & 0xffff); + SNPRINTF (buffer, sizeof (buffer), + "(%s %c 0x%04x)", OP_SYMBOL (IC_LEFT (ic))->rname, val >= 0 ? '+' : '-', abs (val) & 0xffff); } else { - strncpyz (buffer, OP_SYMBOL (IC_LEFT (ic))->rname, sizeof(buffer)); + strncpyz (buffer, OP_SYMBOL (IC_LEFT (ic))->rname, sizeof (buffer)); } aop = newAsmop (AOP_IMMD); - aop->aopu.aop_immd.aop_immd1 = Safe_strdup(buffer); + aop->aopu.aop_immd.aop_immd1 = Safe_strdup (buffer); /* set immd2 field if required */ } else if (ic->op == '=') { val += (int) operandLitValue (IC_RIGHT (ic)); val &= 0xffff; - SNPRINTF (buffer, sizeof(buffer), "0x%04x", val); + SNPRINTF (buffer, sizeof (buffer), "0x%04x", val); aop = newAsmop (AOP_LIT); aop->aopu.aop_lit = constVal (buffer); } else { - werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - "unexpected rematerialization"); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "unexpected rematerialization"); } return aop; @@ -1602,7 +2109,7 @@ /* operandsEqu - equivalent */ /*-----------------------------------------------------------------*/ static bool -operandsEqu (operand * op1, operand * op2) +operandsEqu (operand *op1, operand *op2) { symbol *sym1, *sym2; @@ -1615,8 +2122,7 @@ /* if both are itemps & one is spilt and the other is not then false */ - if (IS_ITEMP (op1) && IS_ITEMP (op2) && - sym1->isspilt != sym2->isspilt) + if (IS_ITEMP (op1) && IS_ITEMP (op2) && sym1->isspilt != sym2->isspilt) return FALSE; /* if they are the same */ @@ -1624,22 +2130,14 @@ return TRUE; /* if they have the same rname */ - if (sym1->rname[0] && sym2->rname[0] - && strcmp (sym1->rname, sym2->rname) == 0) + if (sym1->rname[0] && sym2->rname[0] && strcmp (sym1->rname, sym2->rname) == 0) return TRUE; /* if left is a tmp & right is not */ - if (IS_ITEMP (op1) && - !IS_ITEMP (op2) && - sym1->isspilt && - (sym1->usl.spillLoc == sym2)) + if (IS_ITEMP (op1) && !IS_ITEMP (op2) && sym1->isspilt && (sym1->usl.spillLoc == sym2)) return TRUE; - if (IS_ITEMP (op2) && - !IS_ITEMP (op1) && - sym2->isspilt && - sym1->level > 0 && - (sym2->usl.spillLoc == sym1)) + if (IS_ITEMP (op2) && !IS_ITEMP (op1) && sym2->isspilt && sym1->level > 0 && (sym2->usl.spillLoc == sym1)) return TRUE; return FALSE; @@ -1663,17 +2161,18 @@ { switch (aop1->type) { - case AOP_REG: - for (i = 0; i < aop1->size; i++) - if (aop1->aopu.aop_reg[i] != - aop2->aopu.aop_reg[i]) - return FALSE; - return TRUE; - case AOP_SOF: - return (aop1->aopu.aop_stk == aop2->aopu.aop_stk); - case AOP_DIR: - case AOP_EXT: - return (!strcmp (aop1->aopu.aop_dir, aop2->aopu.aop_dir)); + case AOP_REG: + for (i = 0; i < aop1->size; i++) + if (aop1->aopu.aop_reg[i] != aop2->aopu.aop_reg[i]) + return FALSE; + return TRUE; + case AOP_SOF: + return (aop1->aopu.aop_stk == aop2->aopu.aop_stk); + case AOP_DIR: + if (regalloc_dry_run) + return FALSE; + case AOP_EXT: + return (!strcmp (aop1->aopu.aop_dir, aop2->aopu.aop_dir)); } } @@ -1684,7 +2183,7 @@ /* aopOp - allocates an asmop for an operand : */ /*-----------------------------------------------------------------*/ static void -aopOp (operand * op, iCode * ic, bool result) +aopOp (operand *op, iCode * ic, bool result) { asmop *aop = NULL; symbol *sym; @@ -1695,7 +2194,7 @@ // Is this a pointer set result? // - if ((op==IC_RESULT (ic)) && POINTER_SET (ic)) + if ((op == IC_RESULT (ic)) && POINTER_SET (ic)) { } @@ -1724,20 +2223,20 @@ /* if the underlying symbol has a aop */ if (IS_SYMOP (op) && OP_SYMBOL (op)->aop) { - op->aop = aop = Safe_calloc(1, sizeof(*aop)); - memcpy (aop, OP_SYMBOL (op)->aop, sizeof(*aop)); + op->aop = aop = Safe_calloc (1, sizeof (*aop)); + memcpy (aop, OP_SYMBOL (op)->aop, sizeof (*aop)); //op->aop = aop = OP_SYMBOL (op)->aop; - aop->size = getSize( operandType (op)); + aop->size = getSize (operandType (op)); //printf ("reusing underlying symbol %s\n",OP_SYMBOL (op)->name); //printf (" with size = %d\n", aop->size); aop->op = op; aop->isaddr = op->isaddr; /* if (aop->isaddr & IS_ITEMP (op)) - { - aop->psize=aop->size; - aop->size = getSize( operandType (op)->next); - } */ + { + aop->psize=aop->size; + aop->size = getSize( operandType (op)->next); + } */ return; } @@ -1761,6 +2260,8 @@ d) conditional e) can be a return use only */ + if (!IS_SYMOP (op)) + piCode (ic, NULL); sym = OP_SYMBOL (op); // printf("checking conditional\n"); @@ -1789,56 +2290,35 @@ aop->op = op; aop->isaddr = op->isaddr; /* if (aop->isaddr & IS_ITEMP (op)) - { - aop->psize=aop->size; - aop->size = getSize( operandType (op)->next); - } */ + { + aop->psize=aop->size; + aop->size = getSize( operandType (op)->next); + } */ return; } -// printf("checking accuse\n"); - if (sym->accuse) + wassertl (!sym->ruonly, "sym->ruonly not supported"); + + if (regalloc_dry_run) // Todo: Handle dummy iTemp correctly { - sym->aop = op->aop = aop = newAsmop (AOP_REG); - aop->size = getSize (sym->type); - switch (sym->accuse) + if (options.stackAuto || (currFunc && IFFUNC_ISREENT (currFunc->type))) { - case ACCUSE_XA: - aop->aopu.aop_reg[0] = hc08_reg_a; - aop->aopu.aop_reg[1] = hc08_reg_x; - break; - case ACCUSE_HX: - aop->aopu.aop_reg[0] = hc08_reg_x; - aop->aopu.aop_reg[1] = hc08_reg_h; - break; + sym->aop = op->aop = aop = newAsmop (AOP_SOF); + aop->aopu.aop_stk = 8; /* bogus stack offset, high enough to prevent optimization */ } - aop->op = op; - aop->isaddr = op->isaddr; - return; - } - -// printf("checking ruonly\n"); -#if 1 - if (sym->ruonly) - { - unsigned i; - - sym->aop = op->aop = aop = newAsmop (AOP_STR); + else + sym->aop = op->aop = aop = newAsmop (AOP_DIR); aop->size = getSize (sym->type); - for (i = 0; i < fReturnSizeHC08; i++) - aop->aopu.aop_str[i] = fReturn2[i]; aop->op = op; - aop->isaddr = op->isaddr; return; } -#endif + /* else spill location */ - if (sym->usl.spillLoc) + if (sym->usl.spillLoc || regalloc_dry_run) { asmop *oldAsmOp = NULL; - if (sym->usl.spillLoc->aop - && sym->usl.spillLoc->aop->size != getSize (sym->type)) + if (sym->usl.spillLoc->aop && sym->usl.spillLoc->aop->size != getSize (sym->type)) { /* force a new aop if sizes differ */ oldAsmOp = sym->usl.spillLoc->aop; @@ -1862,15 +2342,20 @@ /* else must be a dummy iTemp */ sym->aop = op->aop = aop = newAsmop (AOP_DUMMY); aop->size = getSize (sym->type); + aop->op = op; return; } // printf("assuming register\n"); /* must be in a register */ + wassert (sym->nRegs); sym->aop = op->aop = aop = newAsmop (AOP_REG); aop->size = sym->nRegs; for (i = 0; i < sym->nRegs; i++) - aop->aopu.aop_reg[i] = sym->regs[i]; + { + wassert (sym->regs[i] < regshc08 + 3); + aop->aopu.aop_reg[i] = sym->regs[i]; + } aop->op = op; aop->isaddr = op->isaddr; } @@ -1901,10 +2386,10 @@ int stackAdjust; int loffset; - DD(emitcode ("","; freeAsmop restoring stacked %s", aopName(aop))); + DD (emitcode ("", "; freeAsmop restoring stacked %s", aopName (aop))); aop->stacked = 0; stackAdjust = 0; - for (loffset=0; loffsetsize; loffset++) + for (loffset = 0; loffset < aop->size; loffset++) if (aop->stk_aop[loffset]) { transferAopAop (aop->stk_aop[loffset], 0, aop, loffset); @@ -1934,16 +2419,15 @@ /* an asmop for the object it references */ /*-----------------------------------------------------------------*/ asmop * -aopDerefAop (asmop *aop) +aopDerefAop (asmop * aop, int offset) { int adr; - char *s = buffer; - char *rs; asmop *newaop = NULL; sym_link *type, *etype; int p_type; + struct dbuf_s dbuf; - DD(emitcode ("", "; aopDerefAop(%s)", aopName(aop))); + DD (emitcode ("", "; aopDerefAop(%s)", aopName (aop))); if (aop->op) { @@ -1968,30 +2452,36 @@ newaop = newAsmop (AOP_DIR); else newaop = newAsmop (AOP_EXT); - newaop->aopu.aop_dir = aop->aopu.aop_immd.aop_immd1; + if (!offset) + newaop->aopu.aop_dir = aop->aopu.aop_immd.aop_immd1; + else + { + dbuf_init (&dbuf, 64); + dbuf_printf (&dbuf, "(%s+%d)", aop->aopu.aop_immd.aop_immd1, offset); + newaop->aopu.aop_dir = dbuf_detach_c_str (&dbuf); + } break; case AOP_LIT: adr = (int) ulFromVal (aop->aopu.aop_lit); if (p_type == POINTER) adr &= 0xff; + adr = (adr + offset) & 0xffff; + dbuf_init (&dbuf, 64); - if (adr<0x100) + if (adr < 0x100) { newaop = newAsmop (AOP_DIR); - sprintf (s, "0x%02x",adr); + dbuf_printf (&dbuf, "0x%02x", adr); } else { newaop = newAsmop (AOP_EXT); - sprintf (s, "0x%04x",adr); + dbuf_printf (&dbuf, "0x%04x", adr); } - rs = Safe_calloc (1, strlen (s) + 1); - strcpy (rs, s); - newaop->aopu.aop_dir = rs; + newaop->aopu.aop_dir = dbuf_detach_c_str (&dbuf); break; default: - werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - "unsupported asmop"); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "unsupported asmop"); return NULL; } @@ -2004,18 +2494,19 @@ /*-----------------------------------------------------------------*/ /* aopAdrStr - for referencing the address of the aop */ /*-----------------------------------------------------------------*/ +/* loffset seems to have a weird meaning here. It seems to be nonzero in some places where one would expect an offset ot be zero */ static char * aopAdrStr (asmop * aop, int loffset, bool bit16) { char *s = buffer; char *rs; - int offset = aop->size - 1 - loffset; + int offset = aop->size - 1 - loffset - (bit16 ? 1 : 0); /* offset is greater than size then zero */ if (loffset > (aop->size - 1) && aop->type != AOP_LIT) return zero; - + /* depending on type */ switch (aop->type) { @@ -2023,36 +2514,24 @@ return zero; case AOP_IMMD: - if (aop->aopu.aop_immd.from_cast_remat && (loffset == (aop->size-1))) - { - sprintf(s,"%s",aop->aopu.aop_immd.aop_immd2); - } - else if (bit16) + if (loffset) { - sprintf (s, "#%s", aop->aopu.aop_immd.aop_immd1); - } - else if (loffset) - { - if (loffset!=1) - sprintf (s, "#(%s >> %d)", - aop->aopu.aop_immd.aop_immd1, - loffset * 8); + if (loffset > 1) + sprintf (s, "#(%s >> %d)", aop->aopu.aop_immd.aop_immd1, loffset * 8); else - sprintf (s, "#>%s", - aop->aopu.aop_immd.aop_immd1); + sprintf (s, "#>%s", aop->aopu.aop_immd.aop_immd1); } else - sprintf (s, "#%s", - aop->aopu.aop_immd.aop_immd1); + sprintf (s, "#%s", aop->aopu.aop_immd.aop_immd1); rs = Safe_calloc (1, strlen (s) + 1); strcpy (rs, s); return rs; case AOP_DIR: + if (regalloc_dry_run) + return "*dry"; if (offset) - sprintf (s, "*(%s + %d)", - aop->aopu.aop_dir, - offset); + sprintf (s, "*(%s + %d)", aop->aopu.aop_dir, offset); else sprintf (s, "*%s", aop->aopu.aop_dir); rs = Safe_calloc (1, strlen (s) + 1); @@ -2060,10 +2539,10 @@ return rs; case AOP_EXT: + if (regalloc_dry_run) + return "dry"; if (offset) - sprintf (s, "(%s + %d)", - aop->aopu.aop_dir, - offset); + sprintf (s, "(%s + %d)", aop->aopu.aop_dir, offset); else sprintf (s, "%s", aop->aopu.aop_dir); rs = Safe_calloc (1, strlen (s) + 1); @@ -2075,24 +2554,27 @@ case AOP_LIT: if (bit16) - return aopLiteralLong (aop->aopu.aop_lit, /*loffset*/ 0, 2); + return aopLiteralLong (aop->aopu.aop_lit, loffset, 2); else return aopLiteral (aop->aopu.aop_lit, loffset); - case AOP_STR: - aop->coff = offset; - return aop->aopu.aop_str[loffset]; - case AOP_SOF: - sprintf (s, "%d,s", - _G.stackOfs + _G.stackPushes + aop->aopu.aop_stk + offset + 1); + if (!regalloc_dry_run && hc08_reg_hx->aop == &tsxaop) + { + int xofs = _G.stackOfs + _G.tsxStackPushes + aop->aopu.aop_stk + offset; + if (xofs) + sprintf (s, "%d,x", xofs); + else + sprintf (s, ",x"); + } + else + sprintf (s, "%d,s", _G.stackOfs + _G.stackPushes + aop->aopu.aop_stk + offset + 1); rs = Safe_calloc (1, strlen (s) + 1); strcpy (rs, s); return rs; } - werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - "aopAdrStr got unsupported aop->type"); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "aopAdrStr got unsupported aop->type"); exit (1); } @@ -2122,7 +2604,7 @@ /* getDataSize - get the operand data size */ /*-----------------------------------------------------------------*/ static int -getDataSize (operand * op) +getDataSize (operand *op) { int size; size = AOP_SIZE (op); @@ -2138,66 +2620,95 @@ static void asmopToBool (asmop *aop, bool resultInA) { - bool isFloat = IS_FLOAT (operandType (AOP_OP (aop))); + bool isFloat; symbol *tlbl, *tlbl1; int size = aop->size; bool needpula = FALSE; bool flagsonly = TRUE; int offset = size - 1; + sym_link *type; + + wassert (aop); + type = operandType (AOP_OP (aop)); + isFloat = IS_FLOAT (type); if (resultInA) - hc08_freeReg(hc08_reg_a); + hc08_freeReg (hc08_reg_a); + + if (IS_BOOL (type)) + { + if (resultInA) + loadRegFromAop (hc08_reg_a, aop, 0); + else + rmwWithAop ("tst", aop, 0); + return; + } + + if (resultInA && size == 1) + { + loadRegFromAop (hc08_reg_a, aop, 0); + rmwWithReg ("neg", hc08_reg_a); + loadRegFromConst (hc08_reg_a, zero); + rmwWithReg ("rol", hc08_reg_a); + return; + } switch (aop->type) { case AOP_REG: - if (IS_AOP_A(aop)) + if (IS_AOP_A (aop)) { emitcode ("tsta", ""); + regalloc_dry_run_cost++; flagsonly = FALSE; } - else if (IS_AOP_X(aop)) + else if (IS_AOP_X (aop)) { emitcode ("tstx", ""); + regalloc_dry_run_cost++; } - else if (IS_AOP_H(aop)) + else if (IS_AOP_H (aop)) { if (hc08_reg_a->isFree) { transferRegReg (hc08_reg_h, hc08_reg_a, FALSE); emitcode ("tsta", ""); + regalloc_dry_run_cost++; flagsonly = FALSE; - hc08_freeReg(hc08_reg_a); + hc08_freeReg (hc08_reg_a); } else if (hc08_reg_x->isFree) { transferRegReg (hc08_reg_h, hc08_reg_x, FALSE); emitcode ("tstx", ""); - hc08_freeReg(hc08_reg_x); + hc08_freeReg (hc08_reg_x); } else { emitcode ("pshh", ""); emitcode ("tst", "1,s"); emitcode ("ais", "#1"); + regalloc_dry_run_cost += 6; } } - else if (IS_AOP_HX(aop)) + else if (IS_AOP_HX (aop)) { emitcode ("cphx", zero); } - else if (IS_AOP_XA(aop)) + else if (IS_AOP_XA (aop) || IS_AOP_AX (aop)) { - symbol *tlbl = newiTempLabel (NULL); + symbol *tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); emitcode ("tsta", ""); - emitcode ("bne", "%05d$", (tlbl->key + 100)); + if (!regalloc_dry_run) + emitcode ("bne", "%05d$", labelKey2num (tlbl->key)); emitcode ("tstx", ""); - emitLabel (tlbl); + regalloc_dry_run_cost += 4; + if (!regalloc_dry_run) + emitLabel (tlbl); } else { - werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - "Bad rIdx in asmToBool"); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "Bad rIdx in asmopToBool"); return; } break; @@ -2208,7 +2719,10 @@ needpula = pushRegIfUsed (hc08_reg_a); loadRegFromAop (hc08_reg_a, aop, offset--); if (isFloat) - emitcode ("and", "#0x7F"); //clear sign bit + { + emitcode ("and", "#0x7F"); //clear sign bit + regalloc_dry_run_cost += 2; + } while (--size) accopWithAop ("ora", aop, offset--); if (needpula) @@ -2225,10 +2739,10 @@ loadRegFromConst (hc08_reg_a, one); else loadRegFromConst (hc08_reg_a, zero); - hc08_freeReg(hc08_reg_a); + hc08_freeReg (hc08_reg_a); break; default: - if (size==1) + if (size == 1) { if (resultInA) { @@ -2237,10 +2751,13 @@ flagsonly = FALSE; } else - emitcode ("tst", "%s", aopAdrStr (aop, 0, FALSE)); + { + emitcode ("tst", "%s", aopAdrStr (aop, 0, FALSE)); + regalloc_dry_run_cost += ((aop->type == AOP_DIR || aop->type == AOP_IMMD) ? 2 : 3); + } break; } - else if (size==2) + else if (size == 2) { if (hc08_reg_a->isFree) { @@ -2251,11 +2768,14 @@ } else { - tlbl = newiTempLabel (NULL); + tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); emitcode ("tst", "%s", aopAdrStr (aop, 0, FALSE)); - emitcode ("bne", "%05d$", (tlbl->key + 100)); + if (!regalloc_dry_run) + emitcode ("bne", "%05d$", labelKey2num (tlbl->key)); emitcode ("tst", "%s", aopAdrStr (aop, 1, FALSE)); - emitLabel (tlbl); + regalloc_dry_run_cost += 4; + if (!regalloc_dry_run) + emitLabel (tlbl); break; } } @@ -2264,7 +2784,10 @@ needpula = pushRegIfUsed (hc08_reg_a); loadRegFromAop (hc08_reg_a, aop, offset--); if (isFloat) - emitcode ("and", "#0x7F"); + { + emitcode ("and", "#0x7F"); + regalloc_dry_run_cost += 2; + } while (--size) accopWithAop ("ora", aop, offset--); if (needpula) @@ -2279,15 +2802,16 @@ if (resultInA) { - tlbl = newiTempLabel (NULL); + tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); if (flagsonly) { - tlbl1 = newiTempLabel (NULL); + tlbl1 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); emitBranch ("bne", tlbl1); loadRegFromConst (hc08_reg_a, zero); emitBranch ("bra", tlbl); - emitLabel (tlbl1); + if (!regalloc_dry_run) + emitLabel (tlbl1); loadRegFromConst (hc08_reg_a, one); } else @@ -2295,28 +2819,106 @@ emitBranch ("beq", tlbl); loadRegFromConst (hc08_reg_a, one); } - emitLabel (tlbl); + if (!regalloc_dry_run) + emitLabel (tlbl); hc08_useReg (hc08_reg_a); } } - - /*-----------------------------------------------------------------*/ -/* genNot - generate code for ! operation */ +/* genCopy - Copy the value from one operand to another */ +/* The caller is responsible for aopOp and freeAsmop */ /*-----------------------------------------------------------------*/ static void -genNot (iCode * ic) +genCopy (operand * result, operand * source) { - D(emitcode ("; genNot","")); - + int size; + int offset = 0; + + /* if they are the same and not volatile */ + if (operandsEqu (result, source) && !isOperandVolatile (result, FALSE) && + !isOperandVolatile (source, FALSE)) + return; + + /* if they are the same registers */ + if (sameRegs (AOP (source), AOP (result))) + return; + + if (IS_AOP_HX (AOP (result))) + { + loadRegFromAop (hc08_reg_hx, AOP (source), 0); + return; + } + + /* If the result and right are 2 bytes and both in registers, we have to be careful */ + /* to make sure the registers are not overwritten prematurely. */ + if (AOP_SIZE (result) == 2 && AOP (result)->type == AOP_REG && AOP (source)->type == AOP_REG) + { + if (AOP (result)->aopu.aop_reg[0] == AOP (source)->aopu.aop_reg[1] && + AOP (result)->aopu.aop_reg[1] == AOP (source)->aopu.aop_reg[0]) + { + pushReg (AOP (source)->aopu.aop_reg[1], TRUE); + transferAopAop (AOP (source), 0, AOP (result), 0); + pullReg (AOP (result)->aopu.aop_reg[1]); + } + else if (AOP (result)->aopu.aop_reg[0] == AOP (source)->aopu.aop_reg[1]) + { + transferAopAop (AOP (source), 1, AOP (result), 1); + transferAopAop (AOP (source), 0, AOP (result), 0); + } + else + { + transferAopAop (AOP (source), 0, AOP (result), 0); + transferAopAop (AOP (source), 1, AOP (result), 1); + } + return; + } + + /* general case */ + /* Copy in msb tot lsb order, since some multi-byte hardware registers */ + /* expect this order. */ + size = AOP_SIZE (result); + offset = size - 1; + while (size) + { + if (size >= 2 && hc08_reg_h->isDead && hc08_reg_x->isDead && + (AOP_TYPE (source) == AOP_IMMD || AOP_TYPE (source) == AOP_LIT ||IS_S08 && AOP_TYPE (source) == AOP_EXT) && + (AOP_TYPE (result) == AOP_DIR || IS_S08 && AOP_TYPE (result) == AOP_EXT)) + { + loadRegFromAop (hc08_reg_hx, AOP (source), offset - 1); + storeRegToAop (hc08_reg_hx, AOP (result), offset - 1); + offset -= 2; + size -= 2; + } + else + { + transferAopAop (AOP (source), offset, AOP (result), offset); + offset--; + size--; + } + } +} + +/*-----------------------------------------------------------------*/ +/* genNot - generate code for ! operation */ +/*-----------------------------------------------------------------*/ +static void +genNot (iCode * ic) +{ + bool needpulla; + + D (emitcode ("; genNot", "")); + /* assign asmOps to operand & result */ aopOp (IC_LEFT (ic), ic, FALSE); aopOp (IC_RESULT (ic), ic, TRUE); + needpulla = pushRegIfSurv (hc08_reg_a); + asmopToBool (AOP (IC_LEFT (ic)), TRUE); - asmopToBool ( AOP (IC_LEFT (ic)), TRUE); emitcode ("eor", one); + regalloc_dry_run_cost += 2; storeRegToFullAop (hc08_reg_a, AOP (IC_RESULT (ic)), FALSE); + pullOrFreeReg (hc08_reg_a, needpulla); freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); freeAsmop (IC_LEFT (ic), NULL, ic, TRUE); @@ -2331,26 +2933,71 @@ { int offset = 0; int size; - reg_info* reg = hc08_reg_a; + reg_info *reg; + bool needpullreg; - D(emitcode ("; genCpl","")); + D (emitcode ("; genCpl", "")); /* assign asmOps to operand & result */ aopOp (IC_LEFT (ic), ic, FALSE); aopOp (IC_RESULT (ic), ic, TRUE); - size = AOP_SIZE (IC_RESULT (ic)); + + if(AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP_TYPE (IC_RESULT (ic)) == AOP_REG && + AOP (IC_RESULT (ic))->aopu.aop_reg[0] == AOP (IC_LEFT (ic))->aopu.aop_reg[0] && + (size < 2 || AOP (IC_RESULT (ic))->aopu.aop_reg[1] == AOP (IC_LEFT (ic))->aopu.aop_reg[1])) + { + while (size--) + rmwWithReg ("com", AOP (IC_RESULT (ic))->aopu.aop_reg[offset++]); + goto release; + } + + if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG && AOP_TYPE (IC_LEFT (ic)) == AOP_REG) + { + while (size--) + { + if ((reg = AOP (IC_RESULT (ic))->aopu.aop_reg[offset]) != hc08_reg_h) + { + transferAopAop (AOP (IC_LEFT (ic)), offset, AOP (IC_RESULT (ic)), offset); + rmwWithReg ("com", reg); + } + else + { + if ((reg = AOP (IC_LEFT (ic))->aopu.aop_reg[offset]) == hc08_reg_h) + reg = hc08_reg_a->isDead ? hc08_reg_a : hc08_reg_x; + needpullreg = pushRegIfSurv (reg); + loadRegFromAop (reg, AOP (IC_LEFT (ic)), offset); + rmwWithReg ("com", reg); + storeRegToAop (reg, AOP (IC_RESULT (ic)), offset); + if (needpullreg) + pullReg (reg); + } + offset++; + } + goto release; + } + + reg = (hc08_reg_a->isDead && !(AOP_TYPE (IC_RESULT (ic)) == AOP_REG && AOP (IC_RESULT (ic))->aopu.aop_reg[0] == hc08_reg_a) ? hc08_reg_a : hc08_reg_x); + + needpullreg = pushRegIfSurv (reg); while (size--) { + bool needpullreg2 = (!size && AOP_TYPE (IC_RESULT (ic)) == AOP_REG && AOP (IC_RESULT (ic))->aopu.aop_reg[0] == reg || size && AOP_TYPE (IC_RESULT (ic)) == AOP_REG && AOP (IC_RESULT (ic))->aopu.aop_reg[1] == reg); + if (needpullreg2) + pushReg (reg, TRUE); loadRegFromAop (reg, AOP (IC_LEFT (ic)), offset); rmwWithReg ("com", reg); hc08_useReg (reg); storeRegToAop (reg, AOP (IC_RESULT (ic)), offset); hc08_freeReg (reg); + if (needpullreg2) + pullReg (reg); offset++; } + pullOrFreeReg (reg, needpullreg); /* release the aops */ +release: freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); freeAsmop (IC_LEFT (ic), NULL, ic, TRUE); } @@ -2364,7 +3011,7 @@ int size, offset = 0; bool needpula; - D(emitcode ("; genUminusFloat","")); + D (emitcode ("; genUminusFloat", "")); /* for this we just copy and then flip the bit */ @@ -2376,9 +3023,10 @@ offset++; } - needpula = pushRegIfUsed (hc08_reg_a); + needpula = pushRegIfSurv (hc08_reg_a); loadRegFromAop (hc08_reg_a, AOP (op), offset); emitcode ("eor", "#0x80"); + regalloc_dry_run_cost += 2; hc08_useReg (hc08_reg_a); storeRegToAop (hc08_reg_a, AOP (result), offset); pullOrFreeReg (hc08_reg_a, needpula); @@ -2391,19 +3039,18 @@ genUminus (iCode * ic) { int offset, size; - sym_link *optype, *rtype; + sym_link *optype; char *sub; bool needpula; asmop *result; - D(emitcode ("; genUminus","")); + D (emitcode ("; genUminus", "")); /* assign asmops */ aopOp (IC_LEFT (ic), ic, FALSE); aopOp (IC_RESULT (ic), ic, TRUE); optype = operandType (IC_LEFT (ic)); - rtype = operandType (IC_RESULT (ic)); /* if float then do float stuff */ if (IS_FLOAT (optype)) @@ -2418,42 +3065,81 @@ if (size == 1) { - if (!IS_AOP_A (AOP (IC_LEFT (ic)))) - needpula = pushRegIfUsed (hc08_reg_a); - else - needpula = FALSE; - loadRegFromAop (hc08_reg_a, AOP( IC_LEFT (ic)), 0); - emitcode ("nega", ""); + needpula = pushRegIfSurv (hc08_reg_a); + loadRegFromAop (hc08_reg_a, AOP (IC_LEFT (ic)), 0); + rmwWithReg ("neg", hc08_reg_a); hc08_freeReg (hc08_reg_a); - storeRegToFullAop (hc08_reg_a, AOP( IC_RESULT (ic)), - SPEC_USIGN (operandType (IC_LEFT (ic)))); + storeRegToFullAop (hc08_reg_a, AOP (IC_RESULT (ic)), SPEC_USIGN (operandType (IC_LEFT (ic)))); pullOrFreeReg (hc08_reg_a, needpula); + goto release; } - else - { - if (IS_AOP_XA (AOP (IC_RESULT (ic)))) - result = forceStackedAop (AOP (IC_RESULT (ic)), FALSE); - else - result = AOP (IC_RESULT (ic)); - needpula = pushRegIfUsed (hc08_reg_a); - sub="sub"; - while (size--) + /* If either left or result are in registers, handle this carefully to */ + /* avoid prematurely overwriting register values. The 1 byte case was */ + /* handled above and there aren't enough registers to handle 4 byte values */ + /* so this case only needs to deal with 2 byte values. */ + if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG || AOP_TYPE (IC_LEFT (ic)) == AOP_REG) + { + reg_info *result0 = NULL; + reg_info *left0 = NULL; + reg_info *left1 = NULL; + if (AOP_TYPE (IC_LEFT (ic)) == AOP_REG) + { + left0 = AOP (IC_LEFT (ic))->aopu.aop_reg[0]; + left1 = AOP (IC_LEFT (ic))->aopu.aop_reg[1]; + } + if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG) + { + result0 = AOP (IC_RESULT (ic))->aopu.aop_reg[0]; + } + needpula = pushRegIfSurv (hc08_reg_a); + if (left1 == hc08_reg_a) + pushReg (left1, TRUE); + + if (left0 == hc08_reg_a) + rmwWithReg ("neg", hc08_reg_a); + else { loadRegFromConst (hc08_reg_a, zero); - accopWithAop (sub, AOP( IC_LEFT (ic)), offset); - storeRegToAop (hc08_reg_a, result, offset++); - sub = "sbc"; + accopWithAop ("sub", AOP (IC_LEFT (ic)), 0); + } + if (result0 == hc08_reg_a || (result0 && result0 == left1)) + pushReg (hc08_reg_a, TRUE); + else + storeRegToAop (hc08_reg_a, AOP (IC_RESULT (ic)), 0); + loadRegFromConst (hc08_reg_a, zero); + if (left1 == hc08_reg_a) + { + emitcode ("sbc","%d,s", (result0 == hc08_reg_a || (result0 && result0 == left1)) ? 2 : 1); + regalloc_dry_run_cost += 3; + hc08_dirtyReg (hc08_reg_a, FALSE); + } + else + { + accopWithAop ("sbc", AOP (IC_LEFT (ic)), 1); } - storeRegSignToUpperAop (hc08_reg_a, result, offset, - SPEC_USIGN (operandType (IC_LEFT (ic)))); + storeRegToAop (hc08_reg_a, AOP (IC_RESULT (ic)), 1); + if (result0 == hc08_reg_a || (result0 && result0 == left1)) + pullReg (result0); + if (left1 == hc08_reg_a) + pullNull (1); pullOrFreeReg (hc08_reg_a, needpula); - - if (IS_AOP_XA (AOP (IC_RESULT (ic)))) - freeAsmop (NULL, result, ic, TRUE); + goto release; } + result = AOP (IC_RESULT (ic)); + needpula = pushRegIfSurv (hc08_reg_a); + sub = "sub"; + while (size--) + { + loadRegFromConst (hc08_reg_a, zero); + accopWithAop (sub, AOP (IC_LEFT (ic)), offset); + storeRegToAop (hc08_reg_a, result, offset++); + sub = "sbc"; + } + storeRegSignToUpperAop (hc08_reg_a, result, offset, SPEC_USIGN (operandType (IC_LEFT (ic)))); + pullOrFreeReg (hc08_reg_a, needpula); release: /* release the aops */ @@ -2465,11 +3151,10 @@ /* saveRegisters - will look for a call and save the registers */ /*-----------------------------------------------------------------*/ static void -saveRegisters (iCode * lic) +saveRegisters (iCode *lic) { int i; iCode *ic; - bitVect *rsave; /* look for call */ for (ic = lic; ic; ic = ic->next) @@ -2486,21 +3171,16 @@ do nothing */ if (ic->regsSaved) return; - if (IS_SYMOP(IC_LEFT(ic)) && - (IFFUNC_CALLEESAVES(OP_SYMBOL(IC_LEFT(ic))->type) || - IFFUNC_ISNAKED(OP_SYM_TYPE(IC_LEFT (ic))))) + if (IS_SYMOP (IC_LEFT (ic)) && + (IFFUNC_CALLEESAVES (OP_SYMBOL (IC_LEFT (ic))->type) || IFFUNC_ISNAKED (OP_SYM_TYPE (IC_LEFT (ic))))) return; - /* safe the registers in use at this time but skip the - ones for the result */ - rsave = bitVectCplAnd (bitVectCopy (ic->rMask), - hc08_rUmaskForOp (IC_RESULT(ic))); - - ic->regsSaved = 1; - for (i = 0; i < hc08_nRegs; i++) + if (!regalloc_dry_run) + ic->regsSaved = 1; + for (i = A_IDX; i <= H_IDX; i++) { - if (bitVectBitValue (rsave, i)) - pushReg ( hc08_regWithIdx (i), FALSE); + if (bitVectBitValue (ic->rSurv, i)) + pushReg (hc08_regWithIdx (i), FALSE); } } @@ -2508,20 +3188,14 @@ /* unsaveRegisters - pop the pushed registers */ /*-----------------------------------------------------------------*/ static void -unsaveRegisters (iCode * ic) +unsaveRegisters (iCode *ic) { int i; - bitVect *rsave; - - /* restore the registers in use at this time but skip the - ones for the result */ - rsave = bitVectCplAnd (bitVectCopy (ic->rMask), - hc08_rUmaskForOp (IC_RESULT(ic))); - for (i = hc08_nRegs; i >= 0; i--) + for (i = H_IDX; i >= A_IDX; i--) { - if (bitVectBitValue (rsave, i)) - pullReg ( hc08_regWithIdx (i)); + if (bitVectBitValue (ic->rSurv, i)) + pullReg (hc08_regWithIdx (i)); } } @@ -2531,89 +3205,103 @@ /* pushSide - */ /*-----------------------------------------------------------------*/ static void -pushSide (operand * oper, int size, iCode * ic) +pushSide (operand *oper, int size, iCode *ic) { int offset = 0; + bool xIsFree = hc08_reg_x->isFree; + hc08_useReg (hc08_reg_x); aopOp (oper, ic, FALSE); while (size--) { - loadRegFromAop (hc08_reg_a, AOP (oper), offset++); - pushReg ( hc08_reg_a, TRUE); + if (AOP_TYPE (oper) == AOP_REG) + pushReg (AOP (oper)->aopu.aop_reg[offset++], TRUE); + else + { + loadRegFromAop (hc08_reg_a, AOP (oper), offset++); + pushReg (hc08_reg_a, TRUE); + } } freeAsmop (oper, NULL, ic, TRUE); + if (xIsFree) + hc08_freeReg (hc08_reg_x); } /*-----------------------------------------------------------------*/ -/* assignResultValue - */ +/* assignResultValue - */ /*-----------------------------------------------------------------*/ static void assignResultValue (operand * oper) { int size = AOP_SIZE (oper); int offset = 0; + bool delayed_x = FALSE; while (size--) { - transferAopAop(hc08_aop_pass[offset], 0, AOP (oper), offset); + if (!offset && AOP_TYPE (oper) == AOP_REG && AOP_SIZE (oper) > 1 && AOP (oper)->aopu.aop_reg[0]->rIdx == X_IDX) + { + pushReg (hc08_reg_a, TRUE); + delayed_x = TRUE; + } + else + transferAopAop (hc08_aop_pass[offset], 0, AOP (oper), offset); if (hc08_aop_pass[offset]->type == AOP_REG) hc08_freeReg (hc08_aop_pass[offset]->aopu.aop_reg[0]); offset++; } + if (delayed_x) + pullReg (hc08_reg_x); } /*-----------------------------------------------------------------*/ -/* genIpush - genrate code for pushing this gets a little complex */ +/* genIpush - generate code for pushing this gets a little complex */ /*-----------------------------------------------------------------*/ static void genIpush (iCode * ic) { int size, offset = 0; - D(emitcode ("; genIpush","")); + D (emitcode (";", "genIpush")); /* if this is not a parm push : ie. it is spill push and spill push is always done on the local stack */ if (!ic->parmPush) { - /* and the item is spilt then do nothing */ if (OP_SYMBOL (IC_LEFT (ic))->isspilt) return; aopOp (IC_LEFT (ic), ic, FALSE); size = AOP_SIZE (IC_LEFT (ic)); - offset = 0; /* push it on the stack */ while (size--) { loadRegFromAop (hc08_reg_a, AOP (IC_LEFT (ic)), offset++); - pushReg ( hc08_reg_a, TRUE); + pushReg (hc08_reg_a, TRUE); } - return; } - /* this is a paramter push: in this case we call + /* this is a parameter push: in this case we call the routine to find the call and save those registers that need to be saved */ - saveRegisters (ic); + if (!regalloc_dry_run) /* Cost for saving registers is counted at CALL or PCALL */ + saveRegisters (ic); /* then do the push */ aopOp (IC_LEFT (ic), ic, FALSE); - // pushSide(IC_LEFT(ic), AOP_SIZE(IC_LEFT(ic))); size = AOP_SIZE (IC_LEFT (ic)); - offset = 0; // l = aopGet (AOP (IC_LEFT (ic)), 0, FALSE, TRUE); - if (AOP_TYPE (IC_LEFT (ic)) == AOP_IMMD) + if (AOP_TYPE (IC_LEFT (ic)) == AOP_IMMD || AOP_TYPE (IC_LEFT (ic)) == AOP_LIT ||IS_AOP_HX (AOP (IC_LEFT (ic)))) { - if ((size==2) && hc08_reg_hx->isFree) + if ((size == 2) && hc08_reg_hx->isDead || IS_AOP_HX (AOP (IC_LEFT (ic)))) { loadRegFromAop (hc08_reg_hx, AOP (IC_LEFT (ic)), 0); pushReg (hc08_reg_hx, TRUE); @@ -2621,6 +3309,13 @@ } } + if (AOP_TYPE (IC_LEFT (ic)) == AOP_REG) + { + while (size--) + pushReg (AOP (IC_LEFT (ic))->aopu.aop_reg[offset++], TRUE); + goto release; + } + while (size--) { // printf("loading %d\n", offset); @@ -2641,7 +3336,7 @@ { int size, offset; - D(emitcode ("; genIpop","")); + D (emitcode (";", "genIpop")); /* if the temp was not pushed then */ if (OP_SYMBOL (IC_LEFT (ic))->isspilt) @@ -2655,32 +3350,87 @@ pullReg (hc08_reg_a); storeRegToAop (hc08_reg_a, AOP (IC_LEFT (ic)), offset--); } + freeAsmop (IC_LEFT (ic), NULL, ic, TRUE); } - /*-----------------------------------------------------------------*/ /* genSend - gen code for SEND */ /*-----------------------------------------------------------------*/ -static void genSend(set *sendSet) +static void +genSend (set *sendSet) { - iCode *sic; + iCode *send1; + iCode *send2; - for (sic = setFirstItem (sendSet); sic; - sic = setNextItem (sendSet)) { - int size, offset = 0; - aopOp (IC_LEFT (sic), sic, FALSE); - size = AOP_SIZE (IC_LEFT (sic)); - - if (sic->argreg) { - offset = size-1; - while (size--) { - transferAopAop( AOP (IC_LEFT (sic)), offset, - hc08_aop_pass[offset+(sic->argreg-1)], 0); - offset--; - } - } - freeAsmop (IC_LEFT (sic), NULL, sic, TRUE); + D (emitcode (";", "genSend")); + + /* case 1: single parameter in A + * case 2: single parameter in XA + * case 3: first parameter in A, second parameter in X + */ + send1 = setFirstItem (sendSet); + send2 = setNextItem (sendSet); + + if (!send2) + { + int size; + /* case 1 or 2, this is fairly easy */ + aopOp (IC_LEFT (send1), send1, FALSE); + size = AOP_SIZE (IC_LEFT (send1)); + wassert (size <= 2); + if (size == 1) + { + loadRegFromAop (send1->argreg == 2 ? hc08_reg_x : hc08_reg_a, AOP (IC_LEFT (send1)), 0); + } + else if (AOP (IC_LEFT (send1))->type == AOP_REG) + loadRegFromAop (hc08_reg_xa, AOP (IC_LEFT (send1)), 0); + else if (isOperandVolatile (IC_LEFT (send1), FALSE)) + { + /* use msb to lsb order for volatile operands */ + loadRegFromAop (hc08_reg_x, AOP (IC_LEFT (send1)), 1); + loadRegFromAop (hc08_reg_a, AOP (IC_LEFT (send1)), 0); + } + else + { + /* otherwise perfer to load x last (lsb to msb order) */ + loadRegFromAop (hc08_reg_a, AOP (IC_LEFT (send1)), 0); + loadRegFromAop (hc08_reg_x, AOP (IC_LEFT (send1)), 1); + } + freeAsmop (IC_LEFT (send1), NULL, send1, TRUE); + } + else + { + /* case 3 */ + /* make sure send1 is the first argument and swap with send2 if not */ + if (send1->argreg > send2->argreg) + { + iCode * sic = send1; + send1 = send2; + send2 = sic; + } + aopOp (IC_LEFT (send1), send1, FALSE); + aopOp (IC_LEFT (send2), send2, FALSE); + if (IS_AOP_X (AOP (IC_LEFT (send1))) && IS_AOP_A (AOP (IC_LEFT (send2)))) + { + /* If the parameters' register assignment is eactly backwards */ + /* from what is needed, then swap the registers. */ + pushReg (hc08_reg_a, FALSE); + transferRegReg (hc08_reg_x, hc08_reg_a, FALSE); + pullReg (hc08_reg_x); + } + else if (IS_AOP_A (AOP (IC_LEFT (send2)))) + { + loadRegFromAop (hc08_reg_x, AOP (IC_LEFT (send2)), 0); + loadRegFromAop (hc08_reg_a, AOP (IC_LEFT (send1)), 0); + } + else + { + loadRegFromAop (hc08_reg_a, AOP (IC_LEFT (send1)), 0); + loadRegFromAop (hc08_reg_x, AOP (IC_LEFT (send2)), 0); + } + freeAsmop (IC_LEFT (send2), NULL, send2, TRUE); + freeAsmop (IC_LEFT (send1), NULL, send1, TRUE); } } @@ -2697,42 +3447,49 @@ D (emitcode (";", "genCall")); + /* if caller saves & we have not saved then */ + if (!ic->regsSaved) + saveRegisters (ic); + dtype = operandType (IC_LEFT (ic)); - etype = getSpec(dtype); + etype = getSpec (dtype); /* if send set is not empty then assign */ - if (_G.sendSet) + if (_G.sendSet && !regalloc_dry_run) { - if (IFFUNC_ISREENT(dtype)) { /* need to reverse the send set */ - genSend(reverseSet(_G.sendSet)); - } else { - genSend(_G.sendSet); + if (IFFUNC_ISREENT (dtype)) /* need to reverse the send set */ + { + genSend (reverseSet (_G.sendSet)); + } + else + { + genSend (_G.sendSet); } _G.sendSet = NULL; } - /* if caller saves & we have not saved then */ - if (!ic->regsSaved) - saveRegisters (ic); - /* make the call */ if (IS_LITERAL (etype)) { emitcode ("jsr", "0x%04X", ulFromVal (OP_VALUE (IC_LEFT (ic)))); + regalloc_dry_run_cost += 3; } else { emitcode ("jsr", "%s", (OP_SYMBOL (IC_LEFT (ic))->rname[0] ? - OP_SYMBOL (IC_LEFT (ic))->rname : - OP_SYMBOL (IC_LEFT (ic))->name)); + OP_SYMBOL (IC_LEFT (ic))->rname : OP_SYMBOL (IC_LEFT (ic))->name)); + regalloc_dry_run_cost += 3; } + hc08_dirtyReg (hc08_reg_a, FALSE); + hc08_dirtyReg (hc08_reg_hx, FALSE); + /* if we need assign a result value */ if ((IS_ITEMP (IC_RESULT (ic)) && - (OP_SYMBOL (IC_RESULT (ic))->nRegs || - OP_SYMBOL (IC_RESULT (ic))->accuse || - OP_SYMBOL (IC_RESULT (ic))->spildir)) || - IS_TRUE_SYMOP (IC_RESULT (ic))) + (OP_SYMBOL (IC_RESULT (ic))->nRegs || OP_SYMBOL (IC_RESULT (ic))->spildir)) || IS_TRUE_SYMOP (IC_RESULT (ic))) { + hc08_useReg (hc08_reg_a); + if (operandSize (IC_RESULT (ic)) > 1) + hc08_useReg (hc08_reg_x); _G.accInUse++; aopOp (IC_RESULT (ic), ic, FALSE); _G.accInUse--; @@ -2749,7 +3506,7 @@ } /* if we had saved some registers then unsave them */ - if (ic->regsSaved && !IFFUNC_CALLEESAVES(dtype)) + if (ic->regsSaved && !IFFUNC_CALLEESAVES (dtype)) unsaveRegisters (ic); } @@ -2760,8 +3517,8 @@ genPcall (iCode * ic) { sym_link *dtype; - symbol *rlbl = newiTempLabel (NULL); - symbol *tlbl = newiTempLabel (NULL); + symbol *rlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); + symbol *tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); // bool restoreBank=FALSE; // bool swapBanks = FALSE; @@ -2779,34 +3536,40 @@ /* push the return address on to the stack */ emitBranch ("bsr", tlbl); emitBranch ("bra", rlbl); - emitLabel (tlbl); - _G.stackPushes += 2; /* account for the bsr return address now on stack */ - updateCFA(); + if (!regalloc_dry_run) + emitLabel (tlbl); + _G.stackPushes += 2; /* account for the bsr return address now on stack */ + updateCFA (); /* now push the function address */ pushSide (IC_LEFT (ic), FPTRSIZE, ic); /* if send set is not empty then assign */ - if (_G.sendSet) + if (_G.sendSet && !regalloc_dry_run) { - genSend(reverseSet(_G.sendSet)); - _G.sendSet = NULL; + genSend (reverseSet (_G.sendSet)); + _G.sendSet = NULL; } /* make the call */ emitcode ("rts", ""); + regalloc_dry_run_cost++; - emitLabel (rlbl); - _G.stackPushes -= 4; /* account for rts here & in called function */ - updateCFA(); + if (!regalloc_dry_run) + emitLabel (rlbl); + _G.stackPushes -= 4; /* account for rts here & in called function */ + updateCFA (); + + hc08_dirtyReg (hc08_reg_a, FALSE); + hc08_dirtyReg (hc08_reg_hx, FALSE); /* if we need assign a result value */ if ((IS_ITEMP (IC_RESULT (ic)) && - (OP_SYMBOL (IC_RESULT (ic))->nRegs || - OP_SYMBOL (IC_RESULT (ic))->spildir)) || - IS_TRUE_SYMOP (IC_RESULT (ic))) + (OP_SYMBOL (IC_RESULT (ic))->nRegs || OP_SYMBOL (IC_RESULT (ic))->spildir)) || IS_TRUE_SYMOP (IC_RESULT (ic))) { - + hc08_useReg (hc08_reg_a); + if (operandSize (IC_RESULT (ic)) > 1) + hc08_useReg (hc08_reg_x); _G.accInUse++; aopOp (IC_RESULT (ic), ic, FALSE); _G.accInUse--; @@ -2850,21 +3613,21 @@ /* inExcludeList - return 1 if the string is in exclude Reg list */ /*-----------------------------------------------------------------*/ static int -regsCmp(void *p1, void *p2) +regsCmp (void *p1, void *p2) { - return (STRCASECMP((char *)p1, (char *)(p2)) == 0); + return (STRCASECMP ((char *) p1, (char *) (p2)) == 0); } static bool inExcludeList (char *s) { - const char *p = setFirstItem(options.excludeRegsSet); + const char *p = setFirstItem (options.excludeRegsSet); - if (p == NULL || STRCASECMP(p, "none") == 0) + if (p == NULL || STRCASECMP (p, "none") == 0) return FALSE; - return isinSetWith(options.excludeRegsSet, s, regsCmp); + return isinSetWith (options.excludeRegsSet, s, regsCmp); } /*-----------------------------------------------------------------*/ @@ -2885,20 +3648,22 @@ emitcode (";", "-----------------------------------------"); emitcode (";", " function %s", sym->name); emitcode (";", "-----------------------------------------"); + emitcode (";", hc08_assignment_optimal ? "Register assignment is optimal." : "Register assignment might be sub-optimal."); + emitcode (";", "Stack space usage: %d bytes.", sym->stack); emitcode ("", "%s:", sym->rname); - lineCurr->isLabel = 1; + genLine.lineCurr->isLabel = 1; ftype = operandType (IC_LEFT (ic)); _G.stackOfs = 0; _G.stackPushes = 0; debugFile->writeFrameAddress (NULL, hc08_reg_sp, 0); - if (IFFUNC_ISNAKED(ftype)) - { - emitcode(";", "naked function: no prologue."); + if (IFFUNC_ISNAKED (ftype)) + { + emitcode (";", "naked function: no prologue."); return; - } + } /* if this is an interrupt service routine then save h */ @@ -2915,14 +3680,14 @@ ric = ric->next; while (ric && IC_RESULT (ric)) { - symbol * rsym = OP_SYMBOL (IC_RESULT (ric)); - int rsymSize = rsym ? getSize(rsym->type) : 0; + symbol *rsym = OP_SYMBOL (IC_RESULT (ric)); + int rsymSize = rsym ? getSize (rsym->type) : 0; if (rsym->isitmp) { if (rsym && rsym->regType == REG_CND) rsym = NULL; - if (rsym && (rsym->accuse || rsym->ruonly)) + if (rsym && (/*rsym->accuse ||*/ rsym->ruonly)) rsym = NULL; if (rsym && (rsym->isspilt || rsym->nRegs == 0) && rsym->usl.spillLoc) rsym = rsym->usl.spillLoc; @@ -2930,21 +3695,21 @@ /* If the RECEIVE operand immediately spills to the first entry on the */ /* stack, we can push it directly rather than use an sp relative store. */ - if (rsym && rsym->onStack && rsym->stack == -_G.stackPushes-rsymSize) + if (rsym && rsym->onStack && rsym->stack == -_G.stackPushes - rsymSize) { int ofs; - _G.current_iCode = ric; - D(emitcode ("; genReceive","")); - for (ofs=0; ofs < rsymSize; ofs++) + genLine.lineElement.ic = ric; + D (emitcode ("; genReceive", "")); + for (ofs = 0; ofs < rsymSize; ofs++) { - reg_info *reg = hc08_aop_pass[ofs+(ric->argreg-1)]->aopu.aop_reg[0]; + reg_info *reg = hc08_aop_pass[ofs + (ric->argreg - 1)]->aopu.aop_reg[0]; pushReg (reg, TRUE); if (reg->rIdx == A_IDX) accIsFree = 1; stackAdjust--; } - _G.current_iCode = ic; + genLine.lineElement.ic = ic; ric->generated = 1; } ric = (ric->prev && ric->prev->op == RECEIVE) ? ric->prev : NULL; @@ -2969,17 +3734,19 @@ emitcode ("tpa", ""); emitcode ("sta", "2,s"); emitcode ("sei", ""); + regalloc_dry_run_cost += 5; pullReg (hc08_reg_a); } else { /* No passed parameters, so A can be freely modified */ emitcode ("tpa", ""); + regalloc_dry_run_cost++; pushReg (hc08_reg_a, TRUE); emitcode ("sei", ""); + regalloc_dry_run_cost++; } } - } /*-----------------------------------------------------------------*/ @@ -2990,22 +3757,23 @@ { symbol *sym = OP_SYMBOL (IC_LEFT (ic)); - if (IFFUNC_ISNAKED(sym->type)) - { - emitcode(";", "naked function: no epilogue."); + if (IFFUNC_ISNAKED (sym->type)) + { + emitcode (";", "naked function: no epilogue."); if (options.debug && currFunc) debugFile->writeEndFunction (currFunc, ic, 0); return; - } + } if (IFFUNC_ISCRITICAL (sym->type)) { - if (!IS_VOID(sym->type->next)) + if (!IS_VOID (sym->type->next)) { /* Function has return value, so make sure A is preserved */ pushReg (hc08_reg_a, FALSE); emitcode ("lda", "2,s"); emitcode ("tap", ""); + regalloc_dry_run_cost += 4; pullReg (hc08_reg_a); pullNull (1); } @@ -3014,6 +3782,7 @@ /* Function returns void, so A can be freely modified */ pullReg (hc08_reg_a); emitcode ("tap", ""); + regalloc_dry_run_cost++; } } @@ -3046,10 +3815,11 @@ } emitcode ("rti", ""); + regalloc_dry_run_cost++; } else { - if (IFFUNC_CALLEESAVES(sym->type)) + if (IFFUNC_CALLEESAVES (sym->type)) { int i; @@ -3059,12 +3829,10 @@ /* save the registers used */ for (i = sym->regsUsed->size; i >= 0; i--) { - if (bitVectBitValue (sym->regsUsed, i) || - (hc08_ptrRegReq && (i == HX_IDX || i == HX_IDX))) - emitcode ("pop", "%s", hc08_regWithIdx (i)->name); + if (bitVectBitValue (sym->regsUsed, i) || (hc08_ptrRegReq && (i == HX_IDX || i == HX_IDX))) + emitcode ("pop", "%s", hc08_regWithIdx (i)->name); /* Todo: Cost. Can't find this instruction in manual! */ } } - } /* if debug then send end of function */ @@ -3074,8 +3842,8 @@ } emitcode ("rts", ""); + regalloc_dry_run_cost++; } - } /*-----------------------------------------------------------------*/ @@ -3086,8 +3854,9 @@ { int size, offset = 0; // int pushed = 0; + bool delayed_x = FALSE; - D(emitcode ("; genRet","")); + D (emitcode ("; genRet", "")); /* if we have no return value then just generate the "ret" */ @@ -3099,49 +3868,34 @@ aopOp (IC_LEFT (ic), ic, FALSE); size = AOP_SIZE (IC_LEFT (ic)); -#if 1 - offset = size - 1; - while (size--) - { - transferAopAop (AOP (IC_LEFT (ic)), offset, hc08_aop_pass[offset], 0); - offset--; - } -#else - switch (size) - { - case 4: - /* 4 byte return: store value in the global return variable */ - offset = size-1; - while (size--) - { - loadRegFromAop (hc08_reg_a, AOP (IC_LEFT (ic)), offset); - STA (fReturn2[offset--], FALSE); - hc08_freeReg (hc08_reg_a); - } - break; - case 2: - /* 2 byte return: store value in x:a */ - loadRegFromAop (hc08_reg_xa, AOP (IC_LEFT (ic)), 0); - hc08_freeReg (hc08_reg_xa); - break; - case 1: - /* 1 byte return: store value in a */ - loadRegFromAop (hc08_reg_a, AOP (IC_LEFT (ic)), 0); - hc08_freeReg (hc08_reg_a); - break; + /* Take care when swapping a and x */ + if (AOP_TYPE (IC_LEFT (ic)) == AOP_REG && size > 1 && AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == X_IDX) + { + delayed_x = TRUE; + pushReg (hc08_reg_x, TRUE); } -#endif + + offset = size - 1; + while (size--) + { + if (!(delayed_x && !offset)) + transferAopAop (AOP (IC_LEFT (ic)), offset, hc08_aop_pass[offset], 0); + offset--; + } + + if (delayed_x) + pullReg (hc08_reg_a); freeAsmop (IC_LEFT (ic), NULL, ic, TRUE); jumpret: /* generate a jump to the return label if the next is not the return statement */ - if (!(ic->next && ic->next->op == LABEL && - IC_LABEL (ic->next) == returnLabel)) - - emitcode ("jmp", "%05d$", (returnLabel->key + 100)); - + if (!(ic->next && ic->next->op == LABEL && IC_LABEL (ic->next) == returnLabel)) + { + emitcode ("jmp", "%05d$", labelKey2num (returnLabel->key)); + regalloc_dry_run_cost += 3; + } } /*-----------------------------------------------------------------*/ @@ -3155,9 +3909,9 @@ /* For the high level labels we cannot depend on any */ /* register's contents. Amnesia time. */ - for (i=A_IDX;i<=XA_IDX;i++) + for (i = A_IDX; i <= XA_IDX; i++) { - reg = hc08_regWithIdx(i); + reg = hc08_regWithIdx (i); if (reg) reg->aop = NULL; } @@ -3166,7 +3920,7 @@ if (IC_LABEL (ic) == entryLabel) return; - debugFile->writeLabel(IC_LABEL (ic), ic); + debugFile->writeLabel (IC_LABEL (ic), ic); emitLabel (IC_LABEL (ic)); @@ -3178,42 +3932,10 @@ static void genGoto (iCode * ic) { - emitcode ("jmp", "%05d$", (IC_LABEL (ic)->key + 100)); + emitcode ("jmp", "%05d$", labelKey2num (IC_LABEL (ic)->key)); + regalloc_dry_run_cost += 3; } -#if 0 -/*-----------------------------------------------------------------*/ -/* findLabelBackwards: walks back through the iCode chain looking */ -/* for the given label. Returns number of iCode instructions */ -/* between that label and given ic. */ -/* Returns zero if label not found. */ -/*-----------------------------------------------------------------*/ -static int -findLabelBackwards (iCode * ic, int key) -{ - int count = 0; - - while (ic->prev) - { - ic = ic->prev; - count++; - - /* If we have any pushes or pops, we cannot predict the distance. - I don't like this at all, this should be dealt with in the - back-end */ - if (ic->op == IPUSH || ic->op == IPOP) { - return 0; - } - - if (ic->op == LABEL && IC_LABEL (ic)->key == key) - { - return count; - } - } - - return 0; -} -#endif /*-----------------------------------------------------------------*/ /* genPlusIncr :- does addition with increment if possible */ @@ -3242,51 +3964,56 @@ icount = (unsigned int) ulFromVal (AOP (IC_RIGHT (ic))->aopu.aop_lit); - DD(emitcode ("", "; IS_AOP_HX = %d", IS_AOP_HX (AOP (left)))); + DD (emitcode ("", "; IS_AOP_HX = %d", IS_AOP_HX (AOP (left)))); - if ((IS_AOP_HX (AOP (left)) || - ( (AOP_TYPE (left) == AOP_DIR) && (AOP_TYPE (result) == AOP_DIR) ) - ) - && (icount>=-128) && (icount<=127) && (size==2)) + if ((IS_AOP_HX (AOP (left)) || IS_AOP_HX (AOP (result)) || + ((AOP_TYPE (left) == AOP_DIR || IS_S08 && AOP_TYPE (left) == AOP_EXT) && (AOP_TYPE (result) == AOP_DIR || IS_S08 && AOP_TYPE (result) == AOP_EXT))) && + (icount >= -128) && (icount <= 127) && (size == 2)) { - if (!IS_AOP_HX (AOP (left))) - { - needpulx = pushRegIfUsed (hc08_reg_x); - needpulh = pushRegIfUsed (hc08_reg_h); - } - else - { - needpulx = FALSE; - needpulh = FALSE; - } - loadRegFromAop (hc08_reg_hx, AOP(left), 0); - emitcode ("aix","#%d", icount); + needpulx = pushRegIfSurv (hc08_reg_x); + needpulh = pushRegIfSurv (hc08_reg_h); + loadRegFromAop (hc08_reg_hx, AOP (left), 0); + emitcode ("aix", "#%d", icount); + regalloc_dry_run_cost += 2; hc08_dirtyReg (hc08_reg_hx, FALSE); - storeRegToAop (hc08_reg_hx, AOP(result), 0); + storeRegToAop (hc08_reg_hx, AOP (result), 0); pullOrFreeReg (hc08_reg_h, needpulh); pullOrFreeReg (hc08_reg_x, needpulx); return TRUE; } + if (size == 1 && (IS_AOP_X (AOP (result)) && (!IS_AOP_A (AOP (left)) || hc08_reg_h->isDead) || IS_AOP_X (AOP (left)) && !IS_AOP_A (AOP (result)) && hc08_reg_x->isDead && hc08_reg_h->isDead)) + { + while (icount < -128) + icount += 256; + while (icount > 127) + icount -= 256; + needpulh = pushRegIfSurv (hc08_reg_h); + loadRegFromAop (hc08_reg_x, AOP (left), 0); + emitcode ("aix", "#%d", icount); + regalloc_dry_run_cost += 2; + storeRegToAop (hc08_reg_x, AOP (result), 0); + pullOrFreeReg (hc08_reg_h, needpulh); + return TRUE; + } - DD(emitcode ("", "; icount = %d, sameRegs=%d", icount, - sameRegs (AOP (left), AOP (result)))); + DD (emitcode ("", "; icount = %d, sameRegs=%d", icount, sameRegs (AOP (left), AOP (result)))); - if ((icount > 255) || (icount<0)) + if ((icount > 255) || (icount < 0)) return FALSE; if (!sameRegs (AOP (left), AOP (result))) return FALSE; - D(emitcode ("; genPlusIncr","")); + D (emitcode ("; genPlusIncr", "")); - if (size>1) - tlbl = newiTempLabel (NULL); + if (size > 1) + tlbl = regalloc_dry_run ? 0 : newiTempLabel (NULL); - if (icount==1) + if (icount == 1) { needpula = FALSE; rmwWithAop ("inc", AOP (result), 0); - if (11) + if (size > 1 && !regalloc_dry_run) emitLabel (tlbl); pullOrFreeReg (hc08_reg_a, needpula); @@ -3329,18 +4056,22 @@ int size, offset = 0; char *add; asmop *leftOp, *rightOp; + bool needpulla; + bool earlystore = FALSE; + bool delayedstore = FALSE; + bool mayskip = TRUE; + bool skip = FALSE; /* special cases :- */ - D(emitcode ("; genPlus","")); + D (emitcode ("; genPlus", "")); aopOp (IC_LEFT (ic), ic, FALSE); aopOp (IC_RIGHT (ic), ic, FALSE); aopOp (IC_RESULT (ic), ic, TRUE); /* we want registers on the left and literals on the right */ - if ((AOP_TYPE (IC_LEFT (ic)) == AOP_LIT) || - (AOP_TYPE (IC_RIGHT (ic)) == AOP_REG)) + if ((AOP_TYPE (IC_LEFT (ic)) == AOP_LIT) || (AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && !IS_AOP_WITH_A (AOP (IC_LEFT (ic))))) { operand *t = IC_RIGHT (ic); IC_RIGHT (ic) = IC_LEFT (ic); @@ -3348,32 +4079,62 @@ } + /* if I can do an increment instead of add then GOOD for ME */ if (genPlusIncr (ic) == TRUE) goto release; - DD(emitcode("","; left size = %d", getDataSize (IC_LEFT(ic)))); - DD(emitcode("","; right size = %d", getDataSize (IC_RIGHT(ic)))); - DD(emitcode("","; result size = %d", getDataSize (IC_RESULT(ic)))); + DD (emitcode ("", "; left size = %d", getDataSize (IC_LEFT (ic)))); + DD (emitcode ("", "; right size = %d", getDataSize (IC_RIGHT (ic)))); + DD (emitcode ("", "; result size = %d", getDataSize (IC_RESULT (ic)))); size = getDataSize (IC_RESULT (ic)); - leftOp = AOP(IC_LEFT(ic)); - rightOp = AOP(IC_RIGHT(ic)); + leftOp = AOP (IC_LEFT (ic)); + rightOp = AOP (IC_RIGHT (ic)); add = "add"; offset = 0; + needpulla = pushRegIfSurv (hc08_reg_a); + + if(size > 1 && IS_AOP_AX (AOP (IC_LEFT (ic)))) + { + earlystore = TRUE; + pushReg (hc08_reg_a, TRUE); + } + while (size--) { - loadRegFromAop (hc08_reg_a, leftOp, offset); - accopWithAop(add, rightOp, offset); - storeRegToAop (hc08_reg_a, AOP (IC_RESULT (ic)), offset++); + if (earlystore && offset == 1) + pullReg (hc08_reg_a); + else + loadRegFromAop (hc08_reg_a, leftOp, offset); + if (!mayskip || AOP_TYPE (IC_RIGHT (ic)) != AOP_LIT || (((ulFromVal (AOP (IC_RIGHT (ic))->aopu.aop_lit) >> (offset * 8)) & 0xff) != 0x00)) + { + accopWithAop (add, rightOp, offset); + mayskip = FALSE; + skip = FALSE; + } + else + skip = TRUE; + if (size && AOP_TYPE (IC_RESULT (ic)) == AOP_REG && AOP (IC_RESULT (ic))->aopu.aop_reg[offset]->rIdx == A_IDX) + { + pushReg (hc08_reg_a, TRUE); + delayedstore = TRUE; + } + else + storeRegToAop (hc08_reg_a, AOP (IC_RESULT (ic)), offset); + offset++; hc08_freeReg (hc08_reg_a); - add = "adc"; /* further adds must propagate carry */ + if (!skip) + add = "adc"; /* further adds must propagate carry */ } + if (delayedstore) + pullReg (hc08_reg_a); + pullOrFreeReg (hc08_reg_a, needpulla); - + wassert (!earlystore || !delayedstore); // adjustArithmeticResult (ic); release: @@ -3408,38 +4169,33 @@ icount = (unsigned int) ulFromVal (AOP (IC_RIGHT (ic))->aopu.aop_lit); - if ((AOP_TYPE (left) == AOP_DIR) && (AOP_TYPE (result) == AOP_DIR) - && (icount>=-127) && (icount<=128) && (size==2)) + if (((AOP_TYPE (left) == AOP_DIR) && (AOP_TYPE (result) == AOP_DIR) && (size == 2) || + (IS_AOP_HX (AOP (left)) || IS_AOP_X (AOP (left))) && (IS_AOP_HX (AOP (result)) || IS_AOP_X (AOP (result)))) && + (icount >= -127) && (icount <= 128)) { - if (!IS_AOP_HX (AOP (left))) - { - needpulx = pushRegIfUsed (hc08_reg_x); - needpulh = pushRegIfUsed (hc08_reg_h); - } - else - { - needpulx = FALSE; - needpulh = FALSE; - } - loadRegFromAop (hc08_reg_hx, AOP(left), 0); - emitcode ("aix","#%d", -(int) icount); + needpulx = pushRegIfSurv (hc08_reg_x); + needpulh = pushRegIfSurv (hc08_reg_h); + + loadRegFromAop (hc08_reg_hx, AOP (left), 0); + emitcode ("aix", "#%d", -(int) icount); + regalloc_dry_run_cost += 2; hc08_dirtyReg (hc08_reg_hx, FALSE); - storeRegToAop (hc08_reg_hx, AOP(result), 0); + storeRegToAop (hc08_reg_hx, AOP (result), 0); pullOrFreeReg (hc08_reg_h, needpulh); pullOrFreeReg (hc08_reg_x, needpulx); return TRUE; } - if ((icount > 1) || (icount<0)) + if ((icount > 1) || (icount < 0)) return FALSE; if (!sameRegs (AOP (left), AOP (result))) return FALSE; - if (size!=1) + if (size != 1) return FALSE; - D(emitcode ("; genMinusDec","")); + D (emitcode ("; genMinusDec", "")); rmwWithAop ("dec", AOP (result), 0); @@ -3460,6 +4216,8 @@ emitcode ("rola", ""); emitcode ("clra", ""); emitcode ("sbc", zero); + hc08_dirtyReg (hc08_reg_a, FALSE); + regalloc_dry_run_cost += 4; while (size--) storeRegToAop (hc08_reg_a, AOP (result), offset++); } @@ -3478,10 +4236,13 @@ { char *sub; int size, offset = 0; + bool needpulla; + bool earlystore = FALSE; + bool delayedstore = FALSE; asmop *leftOp, *rightOp; - D(emitcode ("; genMinus","")); + D (emitcode ("; genMinus", "")); aopOp (IC_LEFT (ic), ic, FALSE); aopOp (IC_RIGHT (ic), ic, FALSE); @@ -3496,28 +4257,63 @@ size = getDataSize (IC_RESULT (ic)); - leftOp = AOP(IC_LEFT(ic)); - rightOp = AOP(IC_RIGHT(ic)); + leftOp = AOP (IC_LEFT (ic)); + rightOp = AOP (IC_RIGHT (ic)); sub = "sub"; offset = 0; + needpulla = pushRegIfSurv (hc08_reg_a); + if (IS_AOP_A (rightOp)) { - loadRegFromAop ( hc08_reg_a, rightOp, offset); + loadRegFromAop (hc08_reg_a, rightOp, offset); accopWithAop (sub, leftOp, offset); accopWithMisc ("nega", ""); storeRegToAop (hc08_reg_a, AOP (IC_RESULT (ic)), offset++); + pullOrFreeReg (hc08_reg_a, needpulla); goto release; } - while (size--) + if (size > 1 && (IS_AOP_AX (AOP (IC_LEFT (ic))) || IS_AOP_AX (AOP (IC_RIGHT (ic))))) { - loadRegFromAop ( hc08_reg_a, leftOp, offset); - accopWithAop (sub, rightOp, offset); - storeRegToAop (hc08_reg_a, AOP (IC_RESULT (ic)), offset++); - sub = "sbc"; + earlystore = TRUE; + pushReg (hc08_reg_a, TRUE); } + while (size--) + { + if (earlystore && + (AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP (IC_LEFT (ic))->aopu.aop_reg[offset]->rIdx == A_IDX || + AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && AOP (IC_RIGHT (ic))->aopu.aop_reg[offset]->rIdx == A_IDX)) + pullReg (hc08_reg_a); + if (AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && AOP (IC_RIGHT (ic))->aopu.aop_reg[offset]->rIdx == A_IDX) + { + pushReg (hc08_reg_a, TRUE); + loadRegFromAop (hc08_reg_a, leftOp, offset); + emitcode (sub, "1, s"); + regalloc_dry_run_cost += 3; + pullNull (1); + } + else + { + loadRegFromAop (hc08_reg_a, leftOp, offset); + accopWithAop (sub, rightOp, offset); + } + if (size && AOP_TYPE (IC_RESULT (ic)) == AOP_REG && AOP (IC_RESULT (ic))->aopu.aop_reg[offset]->rIdx == A_IDX) + { + pushReg (hc08_reg_a, TRUE); + delayedstore = TRUE; + } + else + storeRegToAop (hc08_reg_a, AOP (IC_RESULT (ic)), offset); + offset++; + sub = "sbc"; + } + if(delayedstore) + pullReg (hc08_reg_a); + pullOrFreeReg (hc08_reg_a, needpulla); + + wassert (!earlystore || !delayedstore); // adjustArithmeticResult (ic); @@ -3533,24 +4329,23 @@ /* genMultOneByte : 8*8=8/16 bit multiplication */ /*-----------------------------------------------------------------*/ static void -genMultOneByte (operand * left, - operand * right, - operand * result) +genMultOneByte (operand * left, operand * right, operand * result) { /* sym_link *opetype = operandType (result); */ symbol *tlbl1, *tlbl2, *tlbl3, *tlbl4; - int size=AOP_SIZE(result); + int size = AOP_SIZE (result); bool negLiteral = FALSE; bool lUnsigned, rUnsigned; + bool needpulla, needpullx; - D(emitcode ("; genMultOneByte","")); + D (emitcode ("; genMultOneByte", "")); - if (size<1 || size>2) { - // this should never happen - fprintf (stderr, "size!=1||2 (%d) in %s at line:%d \n", - AOP_SIZE(result), __FILE__, lineno); + if (size < 1 || size > 2) + { + // this should never happen + fprintf (stderr, "size!=1||2 (%d) in %s at line:%d \n", AOP_SIZE (result), __FILE__, lineno); exit (1); - } + } /* (if two literals: the value is computed before) */ /* if one literal, literal on the right */ @@ -3568,6 +4363,9 @@ left = t; } + needpulla = pushRegIfSurv (hc08_reg_a); + needpullx = pushRegIfSurv (hc08_reg_x); + lUnsigned = SPEC_USIGN (getSpec (operandType (left))); rUnsigned = SPEC_USIGN (getSpec (operandType (right))); @@ -3582,8 +4380,7 @@ /* true true true impossible */ /* case 1 */ - if (size == 1 - || (lUnsigned && rUnsigned)) + if (size == 1 || (lUnsigned && rUnsigned)) { // just an unsigned 8*8=8/16 multiply //DD(emitcode (";","unsigned")); @@ -3591,9 +4388,12 @@ loadRegFromAop (hc08_reg_a, AOP (left), 0); loadRegFromAop (hc08_reg_x, AOP (right), 0); emitcode ("mul", ""); + regalloc_dry_run_cost++; hc08_dirtyReg (hc08_reg_xa, FALSE); storeRegToFullAop (hc08_reg_xa, AOP (result), TRUE); hc08_freeReg (hc08_reg_xa); + pullOrFreeReg (hc08_reg_x, needpullx); + pullOrFreeReg (hc08_reg_a, needpulla); return; } @@ -3602,31 +4402,42 @@ /* case 2 */ /* left unsigned, right signed literal -- literal determines sign handling */ - if (AOP_TYPE(right)==AOP_LIT && lUnsigned && !rUnsigned) + if (AOP_TYPE (right) == AOP_LIT && lUnsigned && !rUnsigned) { - signed char val=(signed char) ulFromVal (AOP (right)->aopu.aop_lit); + signed char val = (signed char) ulFromVal (AOP (right)->aopu.aop_lit); loadRegFromAop (hc08_reg_a, AOP (left), 0); if (val < 0) - emitcode ("ldx", "#0x%02x", -val); + { + emitcode ("ldx", "#0x%02x", -val); + regalloc_dry_run_cost += 2; + } else - emitcode ("ldx", "#0x%02x", val); + { + emitcode ("ldx", "#0x%02x", val); + regalloc_dry_run_cost += 2; + } + hc08_dirtyReg (hc08_reg_x, FALSE); emitcode ("mul", ""); + regalloc_dry_run_cost++; + hc08_dirtyReg (hc08_reg_xa, FALSE); if (val < 0) { rmwWithReg ("neg", hc08_reg_a); - tlbl4 = newiTempLabel (NULL); + tlbl4 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); emitBranch ("bcc", tlbl4); rmwWithReg ("inc", hc08_reg_x); - emitLabel (tlbl4); + if (!regalloc_dry_run) + emitLabel (tlbl4); rmwWithReg ("neg", hc08_reg_x); } - hc08_dirtyReg (hc08_reg_xa, FALSE); storeRegToFullAop (hc08_reg_xa, AOP (result), TRUE); hc08_freeReg (hc08_reg_xa); + pullOrFreeReg (hc08_reg_x, needpullx); + pullOrFreeReg (hc08_reg_a, needpulla); return; } @@ -3634,28 +4445,39 @@ /* case 3 */ adjustStack (-1); emitcode ("clr", "1,s"); + regalloc_dry_run_cost += 3; loadRegFromAop (hc08_reg_a, AOP (left), 0); if (!lUnsigned) { - tlbl1 = newiTempLabel (NULL); - emitcode ("tsta",""); + tlbl1 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); + emitcode ("tsta", ""); + regalloc_dry_run_cost++; emitBranch ("bpl", tlbl1); emitcode ("inc", "1,s"); + regalloc_dry_run_cost += 3; rmwWithReg ("neg", hc08_reg_a); - emitLabel (tlbl1); + regalloc_dry_run_cost++; + if (!regalloc_dry_run) + emitLabel (tlbl1); } - if (AOP_TYPE(right)==AOP_LIT && !rUnsigned) + if (AOP_TYPE (right) == AOP_LIT && !rUnsigned) { - signed char val=(signed char) ulFromVal (AOP (right)->aopu.aop_lit); + signed char val = (signed char) ulFromVal (AOP (right)->aopu.aop_lit); /* AND literal negative */ - if (val < 0) { - emitcode ("ldx", "#0x%02x", -val); - negLiteral = TRUE; - } else { - emitcode ("ldx", "#0x%02x", val); - } + if (val < 0) + { + emitcode ("ldx", "#0x%02x", -val); + regalloc_dry_run_cost += 2; + negLiteral = TRUE; + } + else + { + emitcode ("ldx", "#0x%02x", val); + regalloc_dry_run_cost += 2; + } + hc08_dirtyReg (hc08_reg_x, FALSE); hc08_useReg (hc08_reg_x); } else @@ -3663,37 +4485,46 @@ loadRegFromAop (hc08_reg_x, AOP (right), 0); if (!rUnsigned) { - tlbl2 = newiTempLabel (NULL); + tlbl2 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); emitcode ("tstx", ""); + regalloc_dry_run_cost++; emitBranch ("bpl", tlbl2); emitcode ("inc", "1,s"); + regalloc_dry_run_cost += 3; rmwWithReg ("neg", hc08_reg_x); - emitLabel (tlbl2); + regalloc_dry_run_cost++; + if (!regalloc_dry_run) + emitLabel (tlbl2); } } emitcode ("mul", ""); + regalloc_dry_run_cost++; hc08_dirtyReg (hc08_reg_xa, FALSE); - tlbl3 = newiTempLabel (NULL); + tlbl3 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); emitcode ("dec", "1,s"); + regalloc_dry_run_cost += 3; if (!lUnsigned && !rUnsigned && negLiteral) emitBranch ("beq", tlbl3); else emitBranch ("bne", tlbl3); rmwWithReg ("neg", hc08_reg_a); - tlbl4 = newiTempLabel (NULL); + tlbl4 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); emitBranch ("bcc", tlbl4); rmwWithReg ("inc", hc08_reg_x); - emitLabel (tlbl4); + if (!regalloc_dry_run) + emitLabel (tlbl4); rmwWithReg ("neg", hc08_reg_x); - emitLabel (tlbl3); + if (!regalloc_dry_run) + emitLabel (tlbl3); adjustStack (1); storeRegToFullAop (hc08_reg_xa, AOP (result), TRUE); - hc08_freeReg (hc08_reg_xa); - + + pullOrFreeReg (hc08_reg_x, needpullx); + pullOrFreeReg (hc08_reg_a, needpulla); } /*-----------------------------------------------------------------*/ @@ -3706,7 +4537,7 @@ operand *right = IC_RIGHT (ic); operand *result = IC_RESULT (ic); - D(emitcode ("; genMult","")); + D (emitcode ("; genMult", "")); /* assign the amsops */ aopOp (left, ic, FALSE); @@ -3717,18 +4548,15 @@ /* if both are of size == 1 */ // if (getSize(operandType(left)) == 1 && // getSize(operandType(right)) == 1) - if (AOP_SIZE (left) == 1 && - AOP_SIZE (right) == 1) + if (AOP_SIZE (left) == 1 && AOP_SIZE (right) == 1) { genMultOneByte (left, right, result); goto release; } /* should have been converted to function call */ - fprintf (stderr, "left: %d right: %d\n", getSize(OP_SYMBOL(left)->type), - getSize(OP_SYMBOL(right)->type)); - fprintf (stderr, "left: %d right: %d\n", AOP_SIZE (left), - AOP_SIZE (right)); + fprintf (stderr, "left: %d right: %d\n", getSize (OP_SYMBOL (left)->type), getSize (OP_SYMBOL (right)->type)); + fprintf (stderr, "left: %d right: %d\n", AOP_SIZE (left), AOP_SIZE (right)); assert (0); release: @@ -3741,36 +4569,62 @@ /* genDivOneByte : 8 bit division */ /*-----------------------------------------------------------------*/ static void -genDivOneByte (operand * left, - operand * right, - operand * result) +genDivOneByte (operand * left, operand * right, operand * result) { symbol *tlbl1, *tlbl2, *tlbl3; int size; - int offset = 0; bool lUnsigned, rUnsigned; bool runtimeSign, compiletimeSign; + bool needpulla, needpullh; + bool needpullx = FALSE; + bool preload_a = FALSE; lUnsigned = SPEC_USIGN (getSpec (operandType (left))); rUnsigned = SPEC_USIGN (getSpec (operandType (right))); - D(emitcode ("; genDivOneByte","")); + D (emitcode ("; genDivOneByte", "")); + + needpulla = pushRegIfSurv (hc08_reg_a); + needpullh = pushRegIfSurv (hc08_reg_h); + needpullx = pushRegIfSurv (hc08_reg_x); + + /* If both left and right are in registers and backwards from what we need, */ + /* the swap the operands and the registers. */ + if (IS_AOP_A (AOP (right)) && IS_AOP_X (AOP (left))) + { + operand * t; + t = left; + left = right; + right = t; + pushReg (hc08_reg_a, FALSE); + transferRegReg (hc08_reg_x, hc08_reg_a, FALSE); + pullReg (hc08_reg_x); + } size = AOP_SIZE (result); /* signed or unsigned */ if (lUnsigned && rUnsigned) { /* unsigned is easy */ - loadRegFromAop (hc08_reg_h, AOP (left), 1); - loadRegFromAop (hc08_reg_x, AOP (right), 0); - loadRegFromAop (hc08_reg_a, AOP (left), 0); + if (IS_AOP_A (AOP (right))) + { + loadRegFromAop (hc08_reg_x, AOP (right), 0); + loadRegFromAop (hc08_reg_a, AOP (left), 0); + } + else + { + loadRegFromAop (hc08_reg_a, AOP (left), 0); + loadRegFromAop (hc08_reg_x, AOP (right), 0); + } + loadRegFromConst (hc08_reg_h, zero); emitcode ("div", ""); + regalloc_dry_run_cost++; hc08_dirtyReg (hc08_reg_a, FALSE); hc08_dirtyReg (hc08_reg_h, FALSE); storeRegToFullAop (hc08_reg_a, AOP (result), FALSE); - hc08_freeReg (hc08_reg_a); - hc08_freeReg (hc08_reg_x); - hc08_freeReg (hc08_reg_h); + pullOrFreeReg (hc08_reg_x, needpullx); + pullOrFreeReg (hc08_reg_h, needpullh); + pullOrFreeReg (hc08_reg_a, needpulla); return; } @@ -3786,7 +4640,7 @@ if (!lUnsigned) { - if (AOP_TYPE(left) == AOP_LIT) + if (AOP_TYPE (left) == AOP_LIT) { /* signed literal */ signed char val = (char) ulFromVal (AOP (left)->aopu.aop_lit); @@ -3800,7 +4654,7 @@ if (!rUnsigned) { - if (AOP_TYPE(right) == AOP_LIT) + if (AOP_TYPE (right) == AOP_LIT) { /* signed literal */ signed char val = (char) ulFromVal (AOP (right)->aopu.aop_lit); @@ -3816,96 +4670,122 @@ if (runtimeSign) { if (compiletimeSign) - loadRegFromConst (hc08_reg_x, "#1"); /* set sign flag */ + pushConst (one); /* set sign flag */ else - loadRegFromConst (hc08_reg_x, zero); /* reset sign flag */ - pushReg (hc08_reg_x, TRUE); + pushConst (zero); /* reset sign flag */ + } + + if (IS_AOP_X (AOP (left))) + { + loadRegFromAop (hc08_reg_a, AOP (left), 0); + preload_a = TRUE; } /* save the signs of the operands */ - if (AOP_TYPE(right) == AOP_LIT) + if (AOP_TYPE (right) == AOP_LIT) { signed char val = (char) ulFromVal (AOP (right)->aopu.aop_lit); if (!rUnsigned && val < 0) - emitcode ("ldx", "#0x%02x", -val); + { + emitcode ("ldx", "#0x%02x", -val); + regalloc_dry_run_cost += 2; + } else - emitcode ("ldx", "#0x%02x", (unsigned char) val); + { + emitcode ("ldx", "#0x%02x", (unsigned char) val); + regalloc_dry_run_cost += 2; + } + hc08_dirtyReg (hc08_reg_x, FALSE); + hc08_useReg (hc08_reg_x); } - else /* ! literal */ + else /* ! literal */ { loadRegFromAop (hc08_reg_x, AOP (right), 0); if (!rUnsigned) { - tlbl1 = newiTempLabel (NULL); + tlbl1 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); emitcode ("tstx", ""); + regalloc_dry_run_cost++; emitBranch ("bpl", tlbl1); emitcode ("inc", "1,s"); + regalloc_dry_run_cost += 3; rmwWithReg ("neg", hc08_reg_x); - emitLabel (tlbl1); + if (!regalloc_dry_run) + emitLabel (tlbl1); } } - if (AOP_TYPE(left) == AOP_LIT) + if (AOP_TYPE (left) == AOP_LIT) { signed char val = (char) ulFromVal (AOP (left)->aopu.aop_lit); if (!lUnsigned && val < 0) - emitcode ("lda", "#0x%02x", -val); + { + emitcode ("lda", "#0x%02x", -val); + regalloc_dry_run_cost += 2; + } else - emitcode ("lda", "#0x%02x", (unsigned char) val); + { + emitcode ("lda", "#0x%02x", (unsigned char) val); + regalloc_dry_run_cost += 2; + } + hc08_dirtyReg (hc08_reg_a, FALSE); + hc08_useReg (hc08_reg_a); } - else /* ! literal */ + else /* ! literal */ { - loadRegFromAop (hc08_reg_a, AOP (left), 0); + if (!preload_a) + loadRegFromAop (hc08_reg_a, AOP (left), 0); if (!lUnsigned) { - tlbl2 = newiTempLabel (NULL); + tlbl2 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); emitcode ("tsta", ""); + regalloc_dry_run_cost++; emitBranch ("bpl", tlbl2); emitcode ("inc", "1,s"); + regalloc_dry_run_cost += 3; rmwWithReg ("neg", hc08_reg_a); - emitLabel (tlbl2); + if (!regalloc_dry_run) + emitLabel (tlbl2); } } loadRegFromConst (hc08_reg_h, zero); emitcode ("div", ""); + regalloc_dry_run_cost++; hc08_dirtyReg (hc08_reg_x, FALSE); hc08_dirtyReg (hc08_reg_a, FALSE); hc08_dirtyReg (hc08_reg_h, FALSE); if (runtimeSign || compiletimeSign) { - tlbl3 = newiTempLabel (NULL); if (runtimeSign) { + tlbl3 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); pullReg (hc08_reg_x); rmwWithReg ("lsr", hc08_reg_x); - rmwWithReg ("ror", hc08_reg_x); - emitBranch ("bpl", tlbl3); + if (size > 1) + loadRegFromConst (hc08_reg_x, zero); + emitBranch ("bcc", tlbl3); + rmwWithReg ("neg", hc08_reg_a); + if (size > 1) + rmwWithReg ("dec", hc08_reg_x); + if (!regalloc_dry_run) + emitLabel (tlbl3); + /* signed result now in A or XA */ + if (size == 1) + storeRegToAop (hc08_reg_a, AOP (result), 0); + else + storeRegToAop (hc08_reg_xa, AOP (result), 0); } - - rmwWithReg ("neg", hc08_reg_a); - if (runtimeSign) - emitLabel (tlbl3); - - storeRegToAop (hc08_reg_a, AOP (result), 0); - - if (size > 1) + else /* must be compiletimeSign */ { - /* msb is 0x00 or 0xff depending on the sign */ - if (runtimeSign) - { - rmwWithReg ("lsl", hc08_reg_x); - emitcode ("clra", ""); - emitcode ("sbc", "#0"); - while (--size) - storeRegToAop (hc08_reg_a, AOP (result), ++offset); - } - else /* compiletimeSign */ - while (--size) - storeConstToAop ("#0xff", AOP (result), ++offset); + hc08_freeReg (hc08_reg_x); /* in case we need a free reg for the 0xff */ + rmwWithReg ("neg", hc08_reg_a); + storeRegToAop (hc08_reg_a, AOP (result), 0); + if (size > 1) + storeConstToAop ("#0xff", AOP (result), 1); } } else @@ -3913,9 +4793,9 @@ storeRegToFullAop (hc08_reg_a, AOP (result), FALSE); } - hc08_freeReg (hc08_reg_a); - hc08_freeReg (hc08_reg_x); - hc08_freeReg (hc08_reg_h); + pullOrFreeReg (hc08_reg_x, needpullx); + pullOrFreeReg (hc08_reg_h, needpullh); + pullOrFreeReg (hc08_reg_a, needpulla); } /*-----------------------------------------------------------------*/ @@ -3928,7 +4808,7 @@ operand *right = IC_RIGHT (ic); operand *result = IC_RESULT (ic); - D(emitcode ("; genDiv","")); + D (emitcode ("; genDiv", "")); /* assign the amsops */ aopOp (left, ic, FALSE); @@ -3937,8 +4817,7 @@ /* special cases first */ /* if both are of size == 1 */ - if (AOP_SIZE (left) <= 2 && - AOP_SIZE (right) == 1) + if (AOP_SIZE (left) == 1 && AOP_SIZE (right) == 1 && AOP_SIZE (result) <= 2) { genDivOneByte (left, right, result); goto release; @@ -3956,59 +4835,102 @@ /* genModOneByte : 8 bit modulus */ /*-----------------------------------------------------------------*/ static void -genModOneByte (operand * left, - operand * right, - operand * result) +genModOneByte (operand * left, operand * right, operand * result) { symbol *tlbl1, *tlbl2, *tlbl3; int size; - int offset = 0; bool lUnsigned, rUnsigned; bool runtimeSign, compiletimeSign; + bool needpulla, needpullh; + bool needpullx = FALSE; + bool preload_a = FALSE; lUnsigned = SPEC_USIGN (getSpec (operandType (left))); rUnsigned = SPEC_USIGN (getSpec (operandType (right))); - D(emitcode ("; genModOneByte","")); + D (emitcode ("; genModOneByte", "")); size = AOP_SIZE (result); + needpulla = pushRegIfSurv (hc08_reg_a); + needpullh = pushRegIfSurv (hc08_reg_h); + needpullx = pushRegIfSurv (hc08_reg_x); + + /* If both left and right are in registers and backwards from what we need, */ + /* the swap the operands and the registers. */ + if (IS_AOP_A (AOP (right)) && IS_AOP_X (AOP (left))) + { + operand * t; + t = left; + left = right; + right = t; + pushReg (hc08_reg_a, FALSE); + transferRegReg (hc08_reg_x, hc08_reg_a, FALSE); + pullReg (hc08_reg_x); + } + if (lUnsigned && rUnsigned) { /* unsigned is easy */ - loadRegFromAop (hc08_reg_x, AOP (right), 0); - loadRegFromAop (hc08_reg_h, AOP (left), 1); - loadRegFromAop (hc08_reg_a, AOP (left), 0); + if (IS_AOP_A (AOP (right))) + { + loadRegFromAop (hc08_reg_x, AOP (right), 0); + loadRegFromAop (hc08_reg_a, AOP (left), 0); + } + else + { + loadRegFromAop (hc08_reg_a, AOP (left), 0); + loadRegFromAop (hc08_reg_x, AOP (right), 0); + } + loadRegFromConst (hc08_reg_h, zero); emitcode ("div", ""); - hc08_freeReg (hc08_reg_a); + regalloc_dry_run_cost++; hc08_freeReg (hc08_reg_x); + hc08_dirtyReg (hc08_reg_a, TRUE); hc08_dirtyReg (hc08_reg_h, FALSE); storeRegToFullAop (hc08_reg_h, AOP (result), FALSE); - hc08_freeReg (hc08_reg_h); + pullOrFreeReg (hc08_reg_x, needpullx); + pullOrFreeReg (hc08_reg_h, needpullh); + pullOrFreeReg (hc08_reg_a, needpulla); return; } /* signed is a little bit more difficult */ + if (IS_AOP_X (AOP (left))) + { + loadRegFromAop (hc08_reg_a, AOP (left), 0); + preload_a = TRUE; + } - if (AOP_TYPE(right) == AOP_LIT) + if (AOP_TYPE (right) == AOP_LIT) { signed char val = (char) ulFromVal (AOP (right)->aopu.aop_lit); if (!rUnsigned && val < 0) - emitcode ("ldx", "#0x%02x", -val); + { + emitcode ("ldx", "#0x%02x", -val); + regalloc_dry_run_cost += 2; + } else - emitcode ("ldx", "#0x%02x", (unsigned char) val); + { + emitcode ("ldx", "#0x%02x", (unsigned char) val); + regalloc_dry_run_cost += 2; + } + hc08_dirtyReg (hc08_reg_x, FALSE); + hc08_useReg (hc08_reg_x); } - else /* ! literal */ + else /* ! literal */ { loadRegFromAop (hc08_reg_x, AOP (right), 0); if (!rUnsigned) { - tlbl1 = newiTempLabel (NULL); + tlbl1 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); emitcode ("tstx", ""); + regalloc_dry_run_cost++; emitBranch ("bpl", tlbl1); rmwWithReg ("neg", hc08_reg_x); - emitLabel (tlbl1); + if (!regalloc_dry_run) + emitLabel (tlbl1); } } @@ -4019,76 +4941,86 @@ compiletimeSign = FALSE; /* sign adjust left side */ - if (AOP_TYPE(left) == AOP_LIT) + if (AOP_TYPE (left) == AOP_LIT) { signed char val = (char) ulFromVal (AOP (left)->aopu.aop_lit); if (!lUnsigned && val < 0) { - compiletimeSign = TRUE; /* set sign flag */ + compiletimeSign = TRUE; /* set sign flag */ emitcode ("lda", "#0x%02x", -val); + regalloc_dry_run_cost += 2; } else - emitcode ("lda", "#0x%02x", (unsigned char) val); + { + emitcode ("lda", "#0x%02x", (unsigned char) val); + regalloc_dry_run_cost += 2; + } + hc08_dirtyReg (hc08_reg_a, FALSE); + hc08_useReg (hc08_reg_a); } - else /* ! literal */ + else /* ! literal */ { if (lUnsigned) - loadRegFromAop (hc08_reg_a, AOP (left), 0); + { + if (!preload_a) + loadRegFromAop (hc08_reg_a, AOP (left), 0); + } else { runtimeSign = TRUE; - adjustStack (-1); - emitcode ("clr", "1,s"); + pushConst (zero); - loadRegFromAop (hc08_reg_a, AOP (left), 0); - tlbl2 = newiTempLabel (NULL); + if (!preload_a) + loadRegFromAop (hc08_reg_a, AOP (left), 0); + tlbl2 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); emitcode ("tsta", ""); + regalloc_dry_run_cost++; emitBranch ("bpl", tlbl2); emitcode ("inc", "1,s"); + regalloc_dry_run_cost += 3; rmwWithReg ("neg", hc08_reg_a); - emitLabel (tlbl2); + if (!regalloc_dry_run) + emitLabel (tlbl2); } } loadRegFromConst (hc08_reg_h, zero); emitcode ("div", ""); - hc08_freeReg (hc08_reg_a); + regalloc_dry_run_cost++; hc08_freeReg (hc08_reg_x); + hc08_dirtyReg (hc08_reg_a, TRUE); hc08_dirtyReg (hc08_reg_h, FALSE); if (runtimeSign || compiletimeSign) { transferRegReg (hc08_reg_h, hc08_reg_a, TRUE); - tlbl3 = newiTempLabel (NULL); if (runtimeSign) { + tlbl3 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); pullReg (hc08_reg_x); rmwWithReg ("lsr", hc08_reg_x); - rmwWithReg ("ror", hc08_reg_x); - emitBranch ("bpl", tlbl3); + if (size > 1) + loadRegFromConst (hc08_reg_x, zero); + emitBranch ("bcc", tlbl3); + rmwWithReg ("neg", hc08_reg_a); + if (size > 1) + rmwWithReg ("dec", hc08_reg_x); + if (!regalloc_dry_run) + emitLabel (tlbl3); + /* signed result now in A or XA */ + if (size == 1) + storeRegToAop (hc08_reg_a, AOP (result), 0); + else + storeRegToAop (hc08_reg_xa, AOP (result), 0); } - - rmwWithReg ("neg", hc08_reg_a); - if (runtimeSign) - emitLabel (tlbl3); - - storeRegToAop (hc08_reg_a, AOP (result), 0); - - if (size > 1) + else /* must be compiletimeSign */ { - /* msb is 0x00 or 0xff depending on the sign */ - if (runtimeSign) - { - rmwWithReg ("lsl", hc08_reg_x); - emitcode ("clra", ""); - emitcode ("sbc", "#0"); - while (--size) - storeRegToAop (hc08_reg_a, AOP (result), ++offset); - } - else /* compiletimeSign */ - while (--size) - storeConstToAop ("#0xff", AOP (result), ++offset); + hc08_freeReg (hc08_reg_x); /* in case we need a free reg for the 0xff */ + rmwWithReg ("neg", hc08_reg_a); + storeRegToAop (hc08_reg_a, AOP (result), 0); + if (size > 1) + storeConstToAop ("#0xff", AOP (result), 1); } } else @@ -4096,9 +5028,9 @@ storeRegToFullAop (hc08_reg_h, AOP (result), FALSE); } - hc08_freeReg (hc08_reg_a); - hc08_freeReg (hc08_reg_x); - hc08_freeReg (hc08_reg_h); + pullOrFreeReg (hc08_reg_x, needpullx); + pullOrFreeReg (hc08_reg_h, needpullh); + pullOrFreeReg (hc08_reg_a, needpulla); } /*-----------------------------------------------------------------*/ @@ -4111,7 +5043,7 @@ operand *right = IC_RIGHT (ic); operand *result = IC_RESULT (ic); - D(emitcode ("; genMod","")); + D (emitcode ("; genMod", "")); /* assign the amsops */ aopOp (left, ic, FALSE); @@ -4120,8 +5052,7 @@ /* special cases first */ /* if both are of size == 1 */ - if (AOP_SIZE (left) <= 2 && - AOP_SIZE (right) == 1) + if (AOP_SIZE (left) == 1 && AOP_SIZE (right) == 1 && AOP_SIZE (result) <= 2) { genModOneByte (left, right, result); goto release; @@ -4143,10 +5074,10 @@ genIfxJump (iCode * ic, char *jval) { symbol *jlbl; - symbol *tlbl = newiTempLabel (NULL); + symbol *tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); char *inst; - D(emitcode ("; genIfxJump","")); + D (emitcode ("; genIfxJump", "")); /* if true label then we jump if condition supplied is true */ @@ -4157,6 +5088,8 @@ inst = "beq"; else if (!strcmp (jval, "c")) inst = "bcc"; + else if (!strcmp (jval, "n")) + inst = "bpl"; else inst = "bge"; } @@ -4168,12 +5101,15 @@ inst = "bne"; else if (!strcmp (jval, "c")) inst = "bcs"; + else if (!strcmp (jval, "n")) + inst = "bmi"; else inst = "blt"; } emitBranch (inst, tlbl); emitBranch ("jmp", jlbl); - emitLabel (tlbl); + if (!regalloc_dry_run) + emitLabel (tlbl); /* mark the icode as generated */ ic->generated = 1; @@ -4202,10 +5138,9 @@ case EQ_OP: return EQ_OP; default: - werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - "opcode not a comparison"); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "opcode not a comparison"); } - return EQ_OP; /* shouldn't happen, but need to return something */ + return EQ_OP; /* shouldn't happen, but need to return something */ } /*------------------------------------------------------------------*/ @@ -4230,10 +5165,9 @@ case EQ_OP: return NE_OP; default: - werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - "opcode not a comparison"); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "opcode not a comparison"); } - return EQ_OP; /* shouldn't happen, but need to return something */ + return EQ_OP; /* shouldn't happen, but need to return something */ } /*------------------------------------------------------------------*/ @@ -4274,7 +5208,7 @@ if (sign) return "blt"; else - return "bcs"; /* same as blo */ + return "bcs"; /* same as blo */ case '>': if (sign) return "bgt"; @@ -4289,14 +5223,13 @@ if (sign) return "bge"; else - return "bcc"; /* same as bhs */ + return "bcc"; /* same as bhs */ case NE_OP: return "bne"; case EQ_OP: return "beq"; default: - werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - "opcode not a comparison"); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "opcode not a comparison"); } return "brn"; } @@ -4315,18 +5248,24 @@ unsigned long lit = 0L; char *sub; symbol *jlbl = NULL; + bool needpulla = FALSE; opcode = ic->op; - D(emitcode ("; genCmp", "(%s)",nameCmp (opcode))); + D (emitcode ("; genCmp", "(%s)", nameCmp (opcode))); result = IC_RESULT (ic); left = IC_LEFT (ic); right = IC_RIGHT (ic); - letype = getSpec (operandType (left)); - retype = getSpec (operandType (right)); - sign = !(SPEC_USIGN (letype) | SPEC_USIGN (retype)); + sign = 0; + if (IS_SPEC (operandType (left)) && IS_SPEC (operandType (right))) + { + letype = getSpec (operandType (left)); + retype = getSpec (operandType (right)); + sign = !(SPEC_USIGN (letype) | SPEC_USIGN (retype)); + } + /* assign the amsops */ aopOp (left, ic, FALSE); aopOp (right, ic, FALSE); @@ -4357,14 +5296,17 @@ size = max (AOP_SIZE (left), AOP_SIZE (right)); - if ((size == 2) - && ((AOP_TYPE (left) == AOP_DIR) && (AOP_SIZE (left) == 2)) - && ((AOP_TYPE (right) == AOP_LIT) || - ((AOP_TYPE (right) == AOP_DIR) && (AOP_SIZE (right) == 2)) ) - && hc08_reg_hx->isFree) + if (size == 1 && IS_AOP_X (AOP (left))) + { + accopWithAop ("cpx", AOP (right), offset); + } + else if ((size == 2) + && ((AOP_TYPE (left) == AOP_DIR || IS_AOP_HX (AOP (left))) && (AOP_SIZE (left) == 2)) + && ((AOP_TYPE (right) == AOP_LIT) || ((AOP_TYPE (right) == AOP_DIR || IS_S08 && AOP_TYPE (right) == AOP_EXT) && (AOP_SIZE (right) == 2))) && (hc08_reg_h->isDead && hc08_reg_x->isDead || IS_AOP_HX (AOP (left)))) { loadRegFromAop (hc08_reg_hx, AOP (left), 0); - emitcode ("cphx","%s", aopAdrStr (AOP (right), 1, TRUE)); + emitcode ("cphx", "%s", aopAdrStr (AOP (right), 0, TRUE)); + regalloc_dry_run_cost += (AOP_TYPE (right) == AOP_DIR ? 2 : 3); hc08_freeReg (hc08_reg_hx); } else @@ -4393,17 +5335,29 @@ if ((AOP_TYPE (right) == AOP_LIT) && !isOperandVolatile (left, FALSE)) { lit = ulFromVal (AOP (right)->aopu.aop_lit); - while ((size > 1) && (((lit >> (8*offset)) & 0xff) == 0)) + while ((size > 1) && (((lit >> (8 * offset)) & 0xff) == 0)) { offset++; size--; } } } + needpulla = pushRegIfSurv (hc08_reg_a); while (size--) { - loadRegFromAop (hc08_reg_a, AOP (left), offset); - accopWithAop (sub, AOP (right), offset); + if (AOP_TYPE (right) == AOP_REG && AOP(right)->aopu.aop_reg[offset]->rIdx == A_IDX) + { + pushReg (hc08_reg_a, TRUE); + loadRegFromAop (hc08_reg_a, AOP (left), offset); + emitcode (sub, "1, s"); + regalloc_dry_run_cost += 3; + pullReg (hc08_reg_a); + } + else + { + loadRegFromAop (hc08_reg_a, AOP (left), offset); + accopWithAop (sub, AOP (right), offset); + } hc08_freeReg (hc08_reg_a); offset++; sub = "sbc"; @@ -4414,34 +5368,42 @@ if (ifx) { - symbol *tlbl = newiTempLabel (NULL); + symbol *tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); char *inst; + pullOrFreeReg (hc08_reg_a, needpulla); + freeAsmop (result, NULL, ic, TRUE); inst = branchInstCmp (opcode, sign); emitBranch (inst, tlbl); emitBranch ("jmp", jlbl); - emitLabel (tlbl); + if (!regalloc_dry_run) + emitLabel (tlbl); /* mark the icode as generated */ ifx->generated = 1; } else { - symbol *tlbl1 = newiTempLabel (NULL); - symbol *tlbl2 = newiTempLabel (NULL); + symbol *tlbl1 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); + symbol *tlbl2 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); + + if (!needpulla) + needpulla = pushRegIfSurv (hc08_reg_a); emitBranch (branchInstCmp (opcode, sign), tlbl1); loadRegFromConst (hc08_reg_a, zero); emitBranch ("bra", tlbl2); - emitLabel (tlbl1); + if (!regalloc_dry_run) + emitLabel (tlbl1); loadRegFromConst (hc08_reg_a, one); - emitLabel (tlbl2); - storeRegToFullAop (hc08_reg_a, AOP(result), FALSE); + if (!regalloc_dry_run) + emitLabel (tlbl2); + storeRegToFullAop (hc08_reg_a, AOP (result), FALSE); + pullOrFreeReg (hc08_reg_a, needpulla); freeAsmop (result, NULL, ic, TRUE); } - } /*-----------------------------------------------------------------*/ @@ -4451,25 +5413,21 @@ genCmpEQorNE (iCode * ic, iCode * ifx) { operand *left, *right, *result; - sym_link *letype, *retype; - int sign, opcode; + int opcode; int size, offset = 0; - char *sub; symbol *jlbl = NULL; symbol *tlbl_NE = NULL; symbol *tlbl_EQ = NULL; + bool needpulla = FALSE; opcode = ic->op; - D(emitcode ("; genCmpEQorNE", "(%s)",nameCmp (opcode))); + D (emitcode ("; genCmpEQorNE", "(%s)", nameCmp (opcode))); result = IC_RESULT (ic); left = IC_LEFT (ic); right = IC_RIGHT (ic); - letype = getSpec (operandType (left)); - retype = getSpec (operandType (right)); - sign = !(SPEC_USIGN (letype) | SPEC_USIGN (retype)); /* assign the amsops */ aopOp (left, ic, FALSE); aopOp (right, ic, FALSE); @@ -4501,32 +5459,45 @@ size = max (AOP_SIZE (left), AOP_SIZE (right)); if ((size == 2) - && ((AOP_TYPE (left) == AOP_DIR) && (AOP_SIZE (left) == 2)) - && ((AOP_TYPE (right) == AOP_LIT) || - ((AOP_TYPE (right) == AOP_DIR) && (AOP_SIZE (right) == 2)) ) - && hc08_reg_hx->isFree) + && ((AOP_TYPE (left) == AOP_DIR || IS_AOP_HX (AOP (left))) && (AOP_SIZE (left) == 2)) + && ((AOP_TYPE (right) == AOP_LIT) || ((AOP_TYPE (right) == AOP_DIR || IS_S08 && AOP_TYPE (right) == AOP_EXT) && (AOP_SIZE (right) == 2))) && hc08_reg_h->isDead && hc08_reg_x->isDead) { loadRegFromAop (hc08_reg_hx, AOP (left), 0); - emitcode ("cphx","%s", aopAdrStr (AOP (right), 1, TRUE)); + emitcode ("cphx", "%s", aopAdrStr (AOP (right), 0, TRUE)); + regalloc_dry_run_cost += (AOP_TYPE (right) == AOP_DIR ? 2 : 3); hc08_freeReg (hc08_reg_hx); } else { offset = 0; - sub = "cmp"; while (size--) { - loadRegFromAop (hc08_reg_a, AOP (left), offset); - accopWithAop (sub, AOP (right), offset); + if (AOP_TYPE (left) == AOP_REG && AOP (left)->aopu.aop_reg[offset]->rIdx == X_IDX) + accopWithAop ("cpx", AOP (right), offset); + else + { + if (!(AOP_TYPE (left) == AOP_REG && AOP (left)->aopu.aop_reg[offset]->rIdx == A_IDX)) + { + needpulla = pushRegIfSurv (hc08_reg_a); + loadRegFromAop (hc08_reg_a, AOP (left), offset); + } + accopWithAop ("cmp", AOP (right), offset); + if (!(AOP_TYPE (left) == AOP_REG && AOP (left)->aopu.aop_reg[offset]->rIdx == A_IDX)) + pullOrFreeReg (hc08_reg_a, needpulla); + needpulla = FALSE; + } if (size) { - if (!tlbl_NE) + if (!needpulla && !ifx) + needpulla = pushRegIfSurv (hc08_reg_a); + if (!tlbl_NE && !regalloc_dry_run) tlbl_NE = newiTempLabel (NULL); emitBranch ("bne", tlbl_NE); + pullOrFreeReg (hc08_reg_a, needpulla); + needpulla = FALSE; } - hc08_freeReg (hc08_reg_a); offset++; - } + } } freeAsmop (right, NULL, ic, FALSE); freeAsmop (left, NULL, ic, FALSE); @@ -4537,21 +5508,23 @@ if (opcode == EQ_OP) { - if (!tlbl_EQ) + if (!tlbl_EQ && !regalloc_dry_run) tlbl_EQ = newiTempLabel (NULL); emitBranch ("beq", tlbl_EQ); if (tlbl_NE) emitLabel (tlbl_NE); emitBranch ("jmp", jlbl); - emitLabel (tlbl_EQ); + if (!regalloc_dry_run) + emitLabel (tlbl_EQ); } else { - if (!tlbl_NE) + if (!tlbl_NE && !regalloc_dry_run) tlbl_NE = newiTempLabel (NULL); emitBranch ("bne", tlbl_NE); emitBranch ("jmp", jlbl); - emitLabel (tlbl_NE); + if (!regalloc_dry_run) + emitLabel (tlbl_NE); } /* mark the icode as generated */ @@ -4559,336 +5532,174 @@ } else { - symbol *tlbl = newiTempLabel (NULL); + symbol *tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); + if (!needpulla) + needpulla = pushRegIfSurv (hc08_reg_a); if (opcode == EQ_OP) { - if (!tlbl_EQ) + if (!tlbl_EQ && !regalloc_dry_run) tlbl_EQ = newiTempLabel (NULL); emitBranch ("beq", tlbl_EQ); if (tlbl_NE) emitLabel (tlbl_NE); loadRegFromConst (hc08_reg_a, zero); emitBranch ("bra", tlbl); - emitLabel (tlbl_EQ); + if (!regalloc_dry_run) + emitLabel (tlbl_EQ); loadRegFromConst (hc08_reg_a, one); } else { - if (!tlbl_NE) + if (!tlbl_NE && !regalloc_dry_run) tlbl_NE = newiTempLabel (NULL); emitBranch ("bne", tlbl_NE); loadRegFromConst (hc08_reg_a, zero); emitBranch ("bra", tlbl); - emitLabel (tlbl_NE); + if (!regalloc_dry_run) + emitLabel (tlbl_NE); loadRegFromConst (hc08_reg_a, one); } - emitLabel (tlbl); - storeRegToFullAop (hc08_reg_a, AOP(result), FALSE); + if (!regalloc_dry_run) + emitLabel (tlbl); + storeRegToFullAop (hc08_reg_a, AOP (result), FALSE); + pullOrFreeReg (hc08_reg_a, needpulla); freeAsmop (result, NULL, ic, TRUE); } - } - /*-----------------------------------------------------------------*/ -/* ifxForOp - returns the icode containing the ifx for operand */ +/* hasInchc08 - operand is incremented before any other use */ /*-----------------------------------------------------------------*/ -static iCode * -ifxForOp (operand * op, iCode * ic) +iCode * +hasInchc08 (operand *op, const iCode *ic, int osize) { - /* if true symbol then needs to be assigned */ - if (IS_TRUE_SYMOP (op)) + sym_link *type = operandType (op); + sym_link *retype = getSpec (type); + iCode *lic = ic->next; + int isize; + + /* this could from a cast, e.g.: "(char xdata *) 0x7654;" */ + if (!IS_SYMOP (op)) return NULL; - /* if this has register type condition and - the next instruction is ifx with the same operand - and live to of the operand is upto the ifx only then */ - if (ic->next && - ic->next->op == IFX && - IC_COND (ic->next)->key == op->key && - OP_SYMBOL (op)->liveTo <= ic->next->seq) - return ic->next; + if (IS_BITVAR (retype) || !IS_PTR (type)) + return NULL; + if (IS_AGGREGATE (type->next)) + return NULL; + if (osize != (isize = getSize (type->next))) + return NULL; + while (lic) + { + /* if operand of the form op = op + */ + if (lic->op == '+' && isOperandEqual (IC_LEFT (lic), op) && + isOperandEqual (IC_RESULT (lic), op) && + isOperandLiteral (IC_RIGHT (lic)) && operandLitValue (IC_RIGHT (lic)) == isize) + { + return lic; + } + /* if the operand used or deffed */ + if (bitVectBitValue (OP_USES (op), lic->key) || lic->defKey == op->key) + { + return NULL; + } + /* if GOTO or IFX */ + if (lic->op == IFX || lic->op == GOTO || lic->op == LABEL) + break; + lic = lic->next; + } return NULL; } -static bool -genPointerGetSetOfs (iCode *ic) +/*-----------------------------------------------------------------*/ +/* genAndOp - for && operation */ +/*-----------------------------------------------------------------*/ +static void +genAndOp (iCode * ic) { - iCode *lic = ic->next; - bool pset, pget; - int size; - symbol *sym; - asmop *derefaop; + operand *left, *right, *result; + symbol *tlbl, *tlbl0; + bool needpulla; - /* Make sure we have a next iCode */ - DD(emitcode("","; checking lic")); - if (!lic) - return FALSE; + D (emitcode ("; genAndOp", "")); - /* Make sure the result of the addition is an iCode */ - DD(emitcode("","; checking IS_ITEMP")); - if (!IS_ITEMP (IC_RESULT (ic))) - return FALSE; + /* note here that && operations that are in an + if statement are taken away by backPatchLabels + only those used in arthmetic operations remain */ + aopOp ((left = IC_LEFT (ic)), ic, FALSE); + aopOp ((right = IC_RIGHT (ic)), ic, FALSE); + aopOp ((result = IC_RESULT (ic)), ic, FALSE); - /* Make sure the next iCode is a pointer set or get */ - pset = POINTER_SET(lic); - pget = POINTER_GET(lic); - DD(emitcode("","; pset=%d, pget=%d",pset,pget)); - if (!pset && !pget) - return FALSE; + tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); + tlbl0 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); - /* Make sure this is the only use of the pointer */ - if (bitVectnBitsOn (OP_USES (IC_RESULT (ic))) > 1) - return FALSE; + needpulla = pushRegIfSurv (hc08_reg_a); + asmopToBool (AOP (left), FALSE); + emitBranch ("beq", tlbl0); + asmopToBool (AOP (right), FALSE); + emitBranch ("beq", tlbl0); + loadRegFromConst (hc08_reg_a, one); + emitBranch ("bra", tlbl); + if (!regalloc_dry_run) + emitLabel (tlbl0); + loadRegFromConst (hc08_reg_a, zero); + if (!regalloc_dry_run) + emitLabel (tlbl); - DD(emitcode("", "; checking pset operandsEqu")); - if (pset & !operandsEqu (IC_RESULT (ic), IC_RESULT (lic))) - return FALSE; + hc08_useReg (hc08_reg_a); + hc08_freeReg (hc08_reg_a); - DD(emitcode("", "; checking pget operandsEqu")); - if (pget & !operandsEqu (IC_RESULT (ic), IC_LEFT (lic))) - return FALSE; + storeRegToFullAop (hc08_reg_a, AOP (result), FALSE); + pullOrFreeReg(hc08_reg_a, needpulla); - DD(emitcode("", "; checking IS_SYMOP")); - if (!IS_SYMOP (IC_LEFT (ic))) - return FALSE; + freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (result, NULL, ic, TRUE); +} - DD(emitcode("", "; checking !IS_TRUE_SYMOP")); - if (IS_TRUE_SYMOP (IC_LEFT (ic))) - return FALSE; - sym = OP_SYMBOL (IC_LEFT (ic)); +/*-----------------------------------------------------------------*/ +/* genOrOp - for || operation */ +/*-----------------------------------------------------------------*/ +static void +genOrOp (iCode * ic) +{ + operand *left, *right, *result; + symbol *tlbl, *tlbl0; + bool needpulla; - DD(emitcode("", "; checking remat")); - if (!sym->remat) - return FALSE; + D (emitcode ("; genOrOp", "")); + /* note here that || operations that are in an + if statement are taken away by backPatchLabels + only those used in arthmetic operations remain */ + aopOp ((left = IC_LEFT (ic)), ic, FALSE); + aopOp ((right = IC_RIGHT (ic)), ic, FALSE); + aopOp ((result = IC_RESULT (ic)), ic, FALSE); - if (pget) - { - D(emitcode ("; genPointerGetOfs","")); - aopOp (IC_LEFT(ic), ic, FALSE); - derefaop = aopDerefAop (AOP (IC_LEFT (ic))); - freeAsmop (IC_LEFT(ic), NULL, ic, TRUE); + tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); + tlbl0 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); - aopOp (IC_RIGHT(ic), ic, FALSE); - aopOp (IC_RESULT(lic), lic, FALSE); - - if (AOP_SIZE (IC_RIGHT (ic)) == 1) - { - if (SPEC_USIGN (getSpec (operandType (IC_RIGHT (ic))))) - { - loadRegFromAop (hc08_reg_x, AOP (IC_RIGHT (ic)), 0); - loadRegFromConst (hc08_reg_h, zero); - } - else - { - loadRegFromAop (hc08_reg_a, AOP (IC_RIGHT (ic)), 0); - transferRegReg (hc08_reg_a, hc08_reg_x, FALSE); - emitcode ("rola",""); - emitcode ("clra",""); - emitcode ("sbc", "#0"); - hc08_useReg (hc08_reg_a); - transferRegReg (hc08_reg_a, hc08_reg_h, FALSE); - } - } - else - loadRegFromAop (hc08_reg_hx, AOP (IC_RIGHT (ic)), 0); - size = AOP_SIZE (IC_RESULT(lic)); - derefaop->size = size; - - while (size--) - { - emitcode ("lda", "%s,x", - aopAdrStr (derefaop, size, TRUE)); - hc08_useReg (hc08_reg_a); - storeRegToAop (hc08_reg_a, AOP (IC_RESULT (lic)), size); - hc08_freeReg (hc08_reg_a); - } - - lic->generated = 1; - hc08_freeReg (hc08_reg_hx); - - freeAsmop (NULL, derefaop, ic, TRUE); - freeAsmop (IC_RIGHT(ic), NULL, ic, TRUE); - freeAsmop (IC_RESULT(lic), NULL, lic, TRUE); - - return TRUE; - } - - if (pset) - { - D(emitcode ("; genPointerSetOfs","")); - aopOp (IC_LEFT(ic), ic, FALSE); - derefaop = aopDerefAop (AOP (IC_LEFT (ic))); - freeAsmop (IC_LEFT(ic), NULL, ic, TRUE); - - aopOp (IC_RIGHT(ic), ic, FALSE); - aopOp (IC_RIGHT(lic), lic, FALSE); - - if (AOP_SIZE (IC_RIGHT (ic)) == 1) - { - if (SPEC_USIGN (getSpec (operandType (IC_RIGHT (ic))))) - { - loadRegFromAop (hc08_reg_x, AOP (IC_RIGHT (ic)), 0); - loadRegFromConst (hc08_reg_h, zero); - } - else - { - loadRegFromAop (hc08_reg_a, AOP (IC_RIGHT (ic)), 0); - transferRegReg (hc08_reg_a, hc08_reg_x, FALSE); - emitcode ("rola",""); - emitcode ("clra",""); - emitcode ("sbc", "#0"); - hc08_useReg (hc08_reg_a); - transferRegReg (hc08_reg_a, hc08_reg_h, FALSE); - } - } - else - loadRegFromAop (hc08_reg_hx, AOP (IC_RIGHT (ic)), 0); - size = AOP_SIZE (IC_RIGHT(lic)); - derefaop->size = size; - - while (size--) - { - loadRegFromAop (hc08_reg_a, AOP (IC_RIGHT (lic)), size); - emitcode ("sta", "%s,x", - aopAdrStr (derefaop, size, TRUE)); - hc08_freeReg (hc08_reg_a); - } - - lic->generated = 1; - hc08_freeReg (hc08_reg_hx); - - freeAsmop (NULL, derefaop, ic, TRUE); - freeAsmop (IC_RIGHT(ic), NULL, ic, TRUE); - freeAsmop (IC_RIGHT(lic), NULL, lic, TRUE); - - return TRUE; - } - - return FALSE; -} - - -/*-----------------------------------------------------------------*/ -/* hasInc - operand is incremented before any other use */ -/*-----------------------------------------------------------------*/ -static iCode * -hasInc (operand *op, iCode *ic,int osize) -{ - sym_link *type = operandType(op); - sym_link *retype = getSpec (type); - iCode *lic = ic->next; - int isize ; - - /* this could from a cast, e.g.: "(char xdata *) 0x7654;" */ - if (!IS_SYMOP(op)) return NULL; - - if (IS_BITVAR(retype)||!IS_PTR(type)) return NULL; - if (IS_AGGREGATE(type->next)) return NULL; - if (osize != (isize = getSize(type->next))) return NULL; - - while (lic) { - /* if operand of the form op = op + */ - if (lic->op == '+' && isOperandEqual(IC_LEFT(lic),op) && - isOperandEqual(IC_RESULT(lic),op) && - isOperandLiteral(IC_RIGHT(lic)) && - operandLitValue(IC_RIGHT(lic)) == isize) { - return lic; - } - /* if the operand used or deffed */ - if (bitVectBitValue(OP_USES(op),lic->key) || lic->defKey == op->key) { - return NULL; - } - /* if GOTO or IFX */ - if (lic->op == IFX || lic->op == GOTO || lic->op == LABEL) break; - lic = lic->next; - } - return NULL; -} - -/*-----------------------------------------------------------------*/ -/* genAndOp - for && operation */ -/*-----------------------------------------------------------------*/ -static void -genAndOp (iCode * ic) -{ - operand *left, *right, *result; - symbol *tlbl, *tlbl0; - - D(emitcode ("; genAndOp","")); - - /* note here that && operations that are in an - if statement are taken away by backPatchLabels - only those used in arthmetic operations remain */ - aopOp ((left = IC_LEFT (ic)), ic, FALSE); - aopOp ((right = IC_RIGHT (ic)), ic, FALSE); - aopOp ((result = IC_RESULT (ic)), ic, FALSE); - - tlbl = newiTempLabel (NULL); - tlbl0 = newiTempLabel (NULL); - - asmopToBool (AOP (left), FALSE); - emitBranch ("beq", tlbl0); - asmopToBool (AOP (right), FALSE); - emitBranch ("beq", tlbl0); - loadRegFromConst (hc08_reg_a,one); - emitBranch ("bra", tlbl); - emitLabel (tlbl0); - loadRegFromConst (hc08_reg_a,zero); - emitLabel (tlbl); - - hc08_useReg (hc08_reg_a); - hc08_freeReg (hc08_reg_a); - - storeRegToFullAop (hc08_reg_a, AOP (result), FALSE); - - freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); - freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); - freeAsmop (result, NULL, ic, TRUE); -} - - -/*-----------------------------------------------------------------*/ -/* genOrOp - for || operation */ -/*-----------------------------------------------------------------*/ -static void -genOrOp (iCode * ic) -{ - operand *left, *right, *result; - symbol *tlbl, *tlbl0; - - D(emitcode ("; genOrOp","")); - - /* note here that || operations that are in an - if statement are taken away by backPatchLabels - only those used in arthmetic operations remain */ - aopOp ((left = IC_LEFT (ic)), ic, FALSE); - aopOp ((right = IC_RIGHT (ic)), ic, FALSE); - aopOp ((result = IC_RESULT (ic)), ic, FALSE); - - tlbl = newiTempLabel (NULL); - tlbl0 = newiTempLabel (NULL); - - asmopToBool (AOP (left), FALSE); - emitBranch ("bne", tlbl0); - asmopToBool (AOP (right), FALSE); - emitBranch ("bne", tlbl0); - loadRegFromConst (hc08_reg_a,zero); - emitBranch ("bra", tlbl); - emitLabel (tlbl0); - loadRegFromConst (hc08_reg_a,one); - emitLabel (tlbl); + needpulla = pushRegIfSurv (hc08_reg_a); + asmopToBool (AOP (left), FALSE); + emitBranch ("bne", tlbl0); + asmopToBool (AOP (right), FALSE); + emitBranch ("bne", tlbl0); + loadRegFromConst (hc08_reg_a, zero); + emitBranch ("bra", tlbl); + if (!regalloc_dry_run) + emitLabel (tlbl0); + loadRegFromConst (hc08_reg_a, one); + if (!regalloc_dry_run) + emitLabel (tlbl); hc08_useReg (hc08_reg_a); hc08_freeReg (hc08_reg_a); storeRegToFullAop (hc08_reg_a, AOP (result), FALSE); - + pullOrFreeReg(hc08_reg_a, needpulla); freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); @@ -4902,13 +5713,15 @@ isLiteralBit (unsigned long lit) { unsigned long pw[32] = - {1L, 2L, 4L, 8L, 16L, 32L, 64L, 128L, - 0x100L, 0x200L, 0x400L, 0x800L, - 0x1000L, 0x2000L, 0x4000L, 0x8000L, - 0x10000L, 0x20000L, 0x40000L, 0x80000L, - 0x100000L, 0x200000L, 0x400000L, 0x800000L, - 0x1000000L, 0x2000000L, 0x4000000L, 0x8000000L, - 0x10000000L, 0x20000000L, 0x40000000L, 0x80000000L}; + { + 1L, 2L, 4L, 8L, 16L, 32L, 64L, 128L, + 0x100L, 0x200L, 0x400L, 0x800L, + 0x1000L, 0x2000L, 0x4000L, 0x8000L, + 0x10000L, 0x20000L, 0x40000L, 0x80000L, + 0x100000L, 0x200000L, 0x400000L, 0x800000L, + 0x1000000L, 0x2000000L, 0x4000000L, 0x8000000L, + 0x10000000L, 0x20000000L, 0x40000000L, 0x80000000L + }; int idx; for (idx = 0; idx < 32; idx++) @@ -4917,52 +5730,6 @@ return 0; } -#if 0 -/*-----------------------------------------------------------------*/ -/* continueIfTrue - */ -/*-----------------------------------------------------------------*/ -static void -continueIfTrue (iCode * ic) -{ - if (IC_TRUE (ic)) - emitBranch ("jmp", IC_TRUE (ic)); - ic->generated = 1; -} - -/*-----------------------------------------------------------------*/ -/* jmpIfTrue - */ -/*-----------------------------------------------------------------*/ -static void -jumpIfTrue (iCode * ic) -{ - if (!IC_TRUE (ic)) - emitBranch ("jmp", IC_FALSE (ic)); - ic->generated = 1; -} - -/*-----------------------------------------------------------------*/ -/* jmpTrueOrFalse - */ -/*-----------------------------------------------------------------*/ -static void -jmpTrueOrFalse (iCode * ic, symbol * tlbl) -{ - // ugly but optimized by peephole - if (IC_TRUE (ic)) - { - symbol *nlbl = newiTempLabel (NULL); - emitBranch ("bra", nlbl); - emitLabel (tlbl); - emitBranch ("jmp", IC_TRUE (ic)); - emitLabel (nlbl); - } - else - { - emitBranch ("jmp", IC_FALSE (ic)); - emitLabel (tlbl); - } - ic->generated = 1; -} -#endif /*-----------------------------------------------------------------*/ /* genAnd - code for and */ @@ -4974,25 +5741,23 @@ int size, offset = 0; unsigned long lit = 0L; unsigned long litinv; + int bitpos = -1; unsigned char bytemask; - + bool needpulla = FALSE; + bool earlystore = FALSE; // int bytelit = 0; // char buffer[10]; - D(emitcode ("; genAnd","")); + D (emitcode ("; genAnd", "")); aopOp ((left = IC_LEFT (ic)), ic, FALSE); aopOp ((right = IC_RIGHT (ic)), ic, FALSE); aopOp ((result = IC_RESULT (ic)), ic, TRUE); #ifdef DEBUG_TYPE - DD(emitcode ("", "; Type res[%d] = l[%d]&r[%d]", - AOP_TYPE (result), - AOP_TYPE (left), AOP_TYPE (right))); - DD(emitcode ("", "; Size res[%d] = l[%d]&r[%d]", - AOP_SIZE (result), - AOP_SIZE (left), AOP_SIZE (right))); + DD (emitcode ("", "; Type res[%d] = l[%d]&r[%d]", AOP_TYPE (result), AOP_TYPE (left), AOP_TYPE (right))); + DD (emitcode ("", "; Size res[%d] = l[%d]&r[%d]", AOP_SIZE (result), AOP_SIZE (left), AOP_SIZE (right))); #endif /* if left is a literal & right is not then exchange them */ @@ -5004,22 +5769,60 @@ } /* if right is accumulator & left is not then exchange them */ - if (AOP_TYPE (right) == AOP_REG && AOP_TYPE (left) != AOP_REG) + if (AOP_TYPE (right) == AOP_REG && ! IS_AOP_WITH_A (AOP (left))) { operand *tmp = right; right = left; left = tmp; } + size = (AOP_SIZE (left) >= AOP_SIZE (right)) ? AOP_SIZE (left) : AOP_SIZE (right); + if (AOP_TYPE (right) == AOP_LIT) - lit = ulFromVal (AOP (right)->aopu.aop_lit); + { + lit = ulFromVal (AOP (right)->aopu.aop_lit); + if (size == 1) + lit &= 0xff; + else if (size == 2) + lit &= 0xffff; + else if (size == 4) + lit &= 0xffffffff; + bitpos = isLiteralBit (lit) - 1; + } - size = (AOP_SIZE (left) >= AOP_SIZE (right)) ? AOP_SIZE (left) : AOP_SIZE (right); + if (ifx && AOP_TYPE (result) == AOP_CRY && AOP_TYPE (right) == AOP_LIT && AOP_TYPE (left) == AOP_DIR && bitpos >= 0) + { + symbol *tlbl = NULL; + if (!regalloc_dry_run) + tlbl = newiTempLabel (NULL); + if (IC_TRUE (ifx)) + { + if (!regalloc_dry_run) + emitcode ("brclr", "#%d,%s,%05d$", bitpos & 7, aopAdrStr (AOP (left), bitpos >> 3, FALSE), labelKey2num ((tlbl->key))); + regalloc_dry_run_cost += 3; + emitBranch ("jmp", IC_TRUE (ifx)); + if (!regalloc_dry_run) + emitLabel (tlbl); + if (IC_FALSE (ifx)) + emitBranch ("jmp", IC_FALSE (ifx)); + } + else + { + if (!regalloc_dry_run) + emitcode ("brset", "#%d,%s,%05d$", bitpos & 7, aopAdrStr (AOP (left), bitpos >> 3, FALSE), labelKey2num ((tlbl->key))); + regalloc_dry_run_cost += 3; + emitBranch ("jmp", IC_FALSE (ifx)); + if (!regalloc_dry_run) + emitLabel (tlbl); + } + ifx->generated = TRUE; + goto release; + } - if (AOP_TYPE (result) == AOP_CRY - && size > 1 - && (isOperandVolatile (left, FALSE) || isOperandVolatile (right, FALSE))) + if (AOP_TYPE (result) == AOP_CRY && size > 1 && (isOperandVolatile (left, FALSE) || isOperandVolatile (right, FALSE))) { + needpulla = pushRegIfSurv (hc08_reg_a); + /* this generates ugly code, but meets volatility requirements */ loadRegFromConst (hc08_reg_a, zero); pushReg (hc08_reg_a, TRUE); @@ -5031,11 +5834,37 @@ accopWithAop ("and", AOP (right), offset); emitcode ("ora", "1,s"); emitcode ("sta", "1,s"); + regalloc_dry_run_cost += 6; offset++; } pullReg (hc08_reg_a); emitcode ("tsta", ""); + regalloc_dry_run_cost++; + + pullOrFreeReg (hc08_reg_a, needpulla); + + genIfxJump (ifx, "a"); + + goto release; + } + + if (AOP_TYPE (result) == AOP_CRY && AOP_TYPE (right) == AOP_LIT) + { + if (bitpos >= 0 && (bitpos & 7) == 7) + { + rmwWithAop ("tst", AOP (left), bitpos >> 3); + genIfxJump (ifx, "n"); + goto release; + } + } + + if (AOP_TYPE (result) == AOP_CRY && size == 1 && (IS_AOP_A (AOP (left)) || IS_AOP_A (AOP (right)))) + { + if (IS_AOP_A (AOP (left))) + accopWithAop ("bit", AOP (right), 0); + else + accopWithAop ("bit", AOP (left), 0); genIfxJump (ifx, "a"); goto release; } @@ -5044,10 +5873,12 @@ { symbol *tlbl = NULL; + needpulla = pushRegIfSurv (hc08_reg_a); + offset = 0; while (size--) { - bytemask = (lit >> (offset*8)) & 0xff; + bytemask = (lit >> (offset * 8)) & 0xff; if (AOP_TYPE (right) == AOP_LIT && bytemask == 0) { @@ -5058,7 +5889,7 @@ rmwWithAop ("tst", AOP (left), offset); if (size) { - if (!tlbl) + if (!tlbl && !regalloc_dry_run) tlbl = newiTempLabel (NULL); emitBranch ("bne", tlbl); } @@ -5066,50 +5897,61 @@ else { loadRegFromAop (hc08_reg_a, AOP (left), offset); - accopWithAop ("and", AOP (right), offset); - hc08_freeReg( hc08_reg_a); + accopWithAop ("bit", AOP (right), offset); + hc08_freeReg (hc08_reg_a); if (size) { - if (!tlbl) + if (!tlbl && !regalloc_dry_run) tlbl = newiTempLabel (NULL); emitBranch ("bne", tlbl); } } offset++; } - if (tlbl) - emitLabel (tlbl); - if(ifx) - genIfxJump (ifx, "a"); - goto release; + if (tlbl) + emitLabel (tlbl); + + pullOrFreeReg (hc08_reg_a, needpulla); + + if (ifx) + genIfxJump (ifx, "a"); + goto release; } size = AOP_SIZE (result); if (AOP_TYPE (right) == AOP_LIT) { - litinv = (~lit) & (((unsigned int)0xffffffff) >> (8*(4-size))) ; - if (sameRegs (AOP (IC_LEFT (ic)), AOP (IC_RESULT (ic))) && - (AOP_TYPE (left) == AOP_DIR) && isLiteralBit(litinv)) - { - int bitpos = isLiteralBit(litinv)-1; - emitcode ("bclr","#%d,%s",bitpos & 7, - aopAdrStr (AOP (left), bitpos >> 3, FALSE)); + litinv = (~lit) & (((unsigned int) 0xffffffff) >> (8 * (4 - size))); + if (sameRegs (AOP (IC_LEFT (ic)), AOP (IC_RESULT (ic))) && (AOP_TYPE (left) == AOP_DIR) && isLiteralBit (litinv)) + { + bitpos = isLiteralBit (litinv) - 1; + emitcode ("bclr", "#%d,%s", bitpos & 7, aopAdrStr (AOP (left), bitpos >> 3, FALSE)); + regalloc_dry_run_cost += 2; goto release; } } + needpulla = pushRegIfSurv (hc08_reg_a); + offset = 0; + if (size >= 2 && IS_AOP_AX (AOP (left))) + { + pushReg (hc08_reg_a, TRUE); + earlystore = TRUE; + } while (size--) { - bytemask = (lit >> (offset*8)) & 0xff; + bytemask = (lit >> (offset * 8)) & 0xff; + if (earlystore && offset == 1) + pullReg (hc08_reg_a); if (AOP_TYPE (right) == AOP_LIT && bytemask == 0) { if (isOperandVolatile (left, FALSE)) { loadRegFromAop (hc08_reg_a, AOP (left), offset); - hc08_freeReg( hc08_reg_a); + hc08_freeReg (hc08_reg_a); } storeConstToAop (zero, AOP (result), offset); } @@ -5124,9 +5966,16 @@ storeRegToAop (hc08_reg_a, AOP (result), offset); hc08_freeReg (hc08_reg_a); } + if (AOP_TYPE (result) == AOP_REG && size && AOP (result)->aopu.aop_reg[offset]->rIdx == A_IDX) + { + pushReg (hc08_reg_a, TRUE); + needpulla = TRUE; + } offset++; } + pullOrFreeReg (hc08_reg_a, needpulla); + release: freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); @@ -5143,20 +5992,18 @@ int size, offset = 0; unsigned long lit = 0L; unsigned char bytemask; + bool needpulla = FALSE; + bool earlystore = FALSE; - D(emitcode ("; genOr","")); + D (emitcode ("; genOr", "")); aopOp ((left = IC_LEFT (ic)), ic, FALSE); aopOp ((right = IC_RIGHT (ic)), ic, FALSE); aopOp ((result = IC_RESULT (ic)), ic, TRUE); #ifdef DEBUG_TYPE - DD(emitcode ("", "; Type res[%d] = l[%d]&r[%d]", - AOP_TYPE (result), - AOP_TYPE (left), AOP_TYPE (right))); - DD(emitcode ("", "; Size res[%d] = l[%d]&r[%d]", - AOP_SIZE (result), - AOP_SIZE (left), AOP_SIZE (right))); + DD (emitcode ("", "; Type res[%d] = l[%d]&r[%d]", AOP_TYPE (result), AOP_TYPE (left), AOP_TYPE (right))); + DD (emitcode ("", "; Size res[%d] = l[%d]&r[%d]", AOP_SIZE (result), AOP_SIZE (left), AOP_SIZE (right))); #endif /* if left is a literal & right is not then exchange them */ @@ -5168,7 +6015,7 @@ } /* if left is accumulator & right is not then exchange them */ - if (AOP_TYPE (right) == AOP_REG && AOP_TYPE (left) != AOP_REG) + if (AOP_TYPE (right) == AOP_REG && !IS_AOP_WITH_A (AOP (left))) { operand *tmp = right; right = left; @@ -5180,10 +6027,10 @@ size = (AOP_SIZE (left) >= AOP_SIZE (right)) ? AOP_SIZE (left) : AOP_SIZE (right); - if (AOP_TYPE (result) == AOP_CRY - && size > 1 - && (isOperandVolatile (left, FALSE) || isOperandVolatile (right, FALSE))) + if (AOP_TYPE (result) == AOP_CRY && size > 1 && (isOperandVolatile (left, FALSE) || isOperandVolatile (right, FALSE))) { + needpulla = pushRegIfSurv (hc08_reg_a); + /* this generates ugly code, but meets volatility requirements */ loadRegFromConst (hc08_reg_a, zero); pushReg (hc08_reg_a, TRUE); @@ -5195,12 +6042,18 @@ accopWithAop ("ora", AOP (right), offset); emitcode ("ora", "1,s"); emitcode ("sta", "1,s"); + regalloc_dry_run_cost += 6; offset++; } pullReg (hc08_reg_a); emitcode ("tsta", ""); + regalloc_dry_run_cost++; + + pullOrFreeReg (hc08_reg_a, needpulla); + genIfxJump (ifx, "a"); + goto release; } @@ -5208,17 +6061,19 @@ { symbol *tlbl = NULL; + needpulla = pushRegIfSurv (hc08_reg_a); + offset = 0; while (size--) { - bytemask = (lit >> (offset*8)) & 0xff; + bytemask = (lit >> (offset * 8)) & 0xff; if (AOP_TYPE (right) == AOP_LIT && bytemask == 0x00) { rmwWithAop ("tst", AOP (left), offset); if (size) { - if (!tlbl) + if (!tlbl && !regalloc_dry_run) tlbl = newiTempLabel (NULL); emitBranch ("bne", tlbl); } @@ -5227,20 +6082,25 @@ { loadRegFromAop (hc08_reg_a, AOP (left), offset); accopWithAop ("ora", AOP (right), offset); - hc08_freeReg( hc08_reg_a); + hc08_freeReg (hc08_reg_a); if (size) { - if (!tlbl) + if (!tlbl && !regalloc_dry_run) tlbl = newiTempLabel (NULL); emitBranch ("bne", tlbl); } } offset++; } - if (tlbl) - emitLabel (tlbl); - if(ifx) - genIfxJump (ifx, "a"); + if (tlbl) + emitLabel (tlbl); + + pullOrFreeReg (hc08_reg_a, needpulla); + + if (ifx) + genIfxJump (ifx, "a"); + + goto release; } if (AOP_TYPE (right) == AOP_LIT) @@ -5249,26 +6109,34 @@ size = AOP_SIZE (result); if (sameRegs (AOP (IC_LEFT (ic)), AOP (IC_RESULT (ic))) && - (AOP_TYPE (right) == AOP_LIT) && isLiteralBit(lit) && - (AOP_TYPE (left) == AOP_DIR)) + (AOP_TYPE (right) == AOP_LIT) && isLiteralBit (lit) && (AOP_TYPE (left) == AOP_DIR)) { - int bitpos = isLiteralBit(lit)-1; - emitcode ("bset","#%d,%s",bitpos & 7, - aopAdrStr (AOP (left), bitpos >> 3, FALSE)); + int bitpos = isLiteralBit (lit) - 1; + emitcode ("bset", "#%d,%s", bitpos & 7, aopAdrStr (AOP (left), bitpos >> 3, FALSE)); + regalloc_dry_run_cost += 2; goto release; } + needpulla = pushRegIfSurv (hc08_reg_a); + offset = 0; + if (size >= 2 && IS_AOP_AX (AOP (left))) + { + pushReg (hc08_reg_a, TRUE); + earlystore = TRUE; + } while (size--) { - bytemask = (lit >> (offset*8)) & 0xff; + bytemask = (lit >> (offset * 8)) & 0xff; + if (earlystore && offset == 1) + pullReg (hc08_reg_a); if (AOP_TYPE (right) == AOP_LIT && bytemask == 0xff) { if (isOperandVolatile (left, FALSE)) { loadRegFromAop (hc08_reg_a, AOP (left), offset); - hc08_freeReg( hc08_reg_a); + hc08_freeReg (hc08_reg_a); } transferAopAop (AOP (right), offset, AOP (result), offset); } @@ -5283,9 +6151,15 @@ storeRegToAop (hc08_reg_a, AOP (result), offset); hc08_freeReg (hc08_reg_a); } + if (AOP_TYPE (result) == AOP_REG && size && AOP (result)->aopu.aop_reg[offset]->rIdx == A_IDX) + { + pushReg (hc08_reg_a, TRUE); + needpulla = TRUE; + } offset++; } + pullOrFreeReg (hc08_reg_a, needpulla); release: freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); @@ -5294,27 +6168,25 @@ } /*-----------------------------------------------------------------*/ -/* genXor - code for xclusive or */ +/* genXor - code for Exclusive or */ /*-----------------------------------------------------------------*/ static void genXor (iCode * ic, iCode * ifx) { operand *left, *right, *result; int size, offset = 0; + bool needpulla = FALSE; + bool earlystore = FALSE; - D(emitcode ("; genXor","")); + D (emitcode ("; genXor", "")); aopOp ((left = IC_LEFT (ic)), ic, FALSE); aopOp ((right = IC_RIGHT (ic)), ic, FALSE); aopOp ((result = IC_RESULT (ic)), ic, TRUE); #ifdef DEBUG_TYPE - DD(emitcode ("", "; Type res[%d] = l[%d]&r[%d]", - AOP_TYPE (result), - AOP_TYPE (left), AOP_TYPE (right))); - DD(emitcode ("", "; Size res[%d] = l[%d]&r[%d]", - AOP_SIZE (result), - AOP_SIZE (left), AOP_SIZE (right))); + DD (emitcode ("", "; Type res[%d] = l[%d]&r[%d]", AOP_TYPE (result), AOP_TYPE (left), AOP_TYPE (right))); + DD (emitcode ("", "; Size res[%d] = l[%d]&r[%d]", AOP_SIZE (result), AOP_SIZE (left), AOP_SIZE (right))); #endif /* if left is a literal & right is not || @@ -5327,27 +6199,30 @@ } /* if left is accumulator & right is not then exchange them */ - if (AOP_TYPE (right) == AOP_REG && AOP_TYPE (left) != AOP_REG) + if (AOP_TYPE (right) == AOP_REG && !IS_AOP_WITH_A (AOP (left))) { operand *tmp = right; right = left; left = tmp; } + needpulla = pushRegIfSurv (hc08_reg_a); + if (AOP_TYPE (result) == AOP_CRY) { symbol *tlbl; - // this can just happen, if ifx has been optimized away - // wassertl (ifx, "AOP_CPY result without ifx"); - tlbl = newiTempLabel (NULL); + tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); size = (AOP_SIZE (left) >= AOP_SIZE (right)) ? AOP_SIZE (left) : AOP_SIZE (right); offset = 0; while (size--) { loadRegFromAop (hc08_reg_a, AOP (left), offset); if (AOP_TYPE (right) == AOP_LIT && ((ulFromVal (AOP (right)->aopu.aop_lit) >> (offset * 8)) & 0xff) == 0) - emitcode ("tsta", ""); + { + emitcode ("tsta", ""); + regalloc_dry_run_cost++; + } else accopWithAop ("eor", AOP (right), offset); @@ -5361,116 +6236,138 @@ * multiple calls to emitLabel() ?! * and we can't genIfxJump, if there is none */ - emitLabel (tlbl); - if(ifx) + if (!regalloc_dry_run) + emitLabel (tlbl); + pullOrFreeReg (hc08_reg_a, needpulla); + if (ifx) genIfxJump (ifx, "a"); } offset++; } + goto release; } size = AOP_SIZE (result); offset = 0; + if (size >= 2 && IS_AOP_AX (AOP (left))) + { + pushReg (hc08_reg_a, TRUE); + earlystore = TRUE; + } while (size--) { + if (earlystore && offset == 1) + pullReg (hc08_reg_a); loadRegFromAop (hc08_reg_a, AOP (left), offset); accopWithAop ("eor", AOP (right), offset); - storeRegToAop (hc08_reg_a, AOP (result), offset++); + storeRegToAop (hc08_reg_a, AOP (result), offset); + if (AOP_TYPE (result) == AOP_REG && size && AOP (result)->aopu.aop_reg[offset]->rIdx == A_IDX) + { + pushReg (hc08_reg_a, TRUE); + needpulla = TRUE; + } hc08_freeReg (hc08_reg_a); + offset++; } -//release: + pullOrFreeReg (hc08_reg_a, needpulla); + +release: + freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); freeAsmop (result, NULL, ic, TRUE); } -static void -emitinline (iCode * ic, char *inlin) +static const char * +expand_symbols (iCode * ic, const char *inlin) { - char buffer[512]; - char *symname; - char c; - char *bp=buffer; - symbol *sym, *tempsym; - asmop *aop; - char *l; + const char *begin = NULL, *p = inlin; + bool inIdent = FALSE; + struct dbuf_s dbuf; - while (*inlin) + dbuf_init (&dbuf, 128); + + while (*p) { - if (*inlin == '_') + if (inIdent) { - symname = ++inlin; - while (isalnum((unsigned char)*inlin) || (*inlin == '_')) - inlin++; - c = *inlin; - *inlin = '\0'; - //printf("Found possible symbol '%s'\n",symname); - tempsym = newSymbol (symname, ic->level); - tempsym->block = ic->block; - sym = (symbol *) findSymWithLevel(SymbolTab,tempsym); - *inlin = c; - if (!sym) - { - *bp++ = '_'; - inlin = symname; - } + if ('_' == *p || isalnum (*p)) + /* in the middle of identifier */ + ++p; else { - aop = aopForSym (ic, sym, FALSE); - l = aopAdrStr (aop, aop->size - 1, TRUE); - if (*l=='#') - l++; - sym->isref = 1; - if (sym->level && !sym->allocreq && !sym->ismyparm) + /* end of identifier */ + symbol *sym, *tempsym; + char *symname = Safe_strndup (p + 1, p - begin - 1); + + inIdent = 0; + + tempsym = newSymbol (symname, ic->level); + tempsym->block = ic->block; + sym = (symbol *) findSymWithLevel (SymbolTab, tempsym); + if (!sym) { - werror (E_ID_UNDEF, sym->name); - werror (W_CONTINUE, - " Add 'volatile' to the variable declaration so that it\n" - " can be referenced within inline assembly"); + dbuf_append (&dbuf, begin, p - begin); } - //printf("Replacing with '%s'\n",l); - while (*l) + else { - *bp++ = *l++; - if ((2+bp-buffer)>sizeof(buffer)) - goto endofline; + asmop *aop = aopForSym (ic, sym, FALSE); + char *l = aopAdrStr (aop, aop->size - 1, TRUE); + + if ('#' == *l) + l++; + sym->isref = 1; + if (sym->level && !sym->allocreq && !sym->ismyparm) + { + werror (E_ID_UNDEF, sym->name); + werror (W_CONTINUE, + " Add 'volatile' to the variable declaration so that it\n" + " can be referenced within inline assembly"); + } + dbuf_append_str (&dbuf, l); } + Safe_free (symname); + begin = p++; } } + else if ('_' == *p) + { + /* begin of identifier */ + inIdent = TRUE; + if (begin) + dbuf_append (&dbuf, begin, p - begin); + begin = p++; + } else { - *bp++ = *inlin++; + if (!begin) + begin = p; + p++; } - if ((2+bp-buffer)>sizeof(buffer)) - goto endofline; } -endofline: - *bp = '\0'; - - if ((2+bp-buffer)>sizeof(buffer)) - fprintf(stderr, "Inline assembly buffer overflow\n"); + if (begin) + dbuf_append (&dbuf, begin, p - begin); - //printf("%s\n",buffer); - emitcode (buffer,""); + return dbuf_detach_c_str (&dbuf); } - /*-----------------------------------------------------------------*/ /* genInline - write the inline code out */ /*-----------------------------------------------------------------*/ static void -genInline (iCode * ic) +hc08_genInline (iCode * ic) { - char *buffer, *bp, *bp1; + char *buf, *bp, *begin; + const char *expanded; bool inComment = FALSE; - D(emitcode ("; genInline","")); + D (emitcode (";", "genInline")); - _G.inLine += (!options.asmpeep); + genLine.lineElement.isInline += (!options.asmpeep); - buffer = bp = bp1 = Safe_strdup (IC_INLINE(ic)); + buf = bp = begin = Safe_strdup (IC_INLINE (ic)); /* emit each line as a code */ while (*bp) @@ -5486,31 +6383,40 @@ case '\n': inComment = FALSE; *bp++ = '\0'; - emitinline (ic, bp1); - bp1 = bp; + expanded = expand_symbols (ic, begin); + emitcode (expanded, NULL); + dbuf_free (expanded); + begin = bp; break; default: /* Add \n for labels, not dirs such as c:\mydir */ - if (!inComment && (*bp == ':') && (isspace((unsigned char)bp[1]))) + if (!inComment && (*bp == ':') && (isspace ((unsigned char) bp[1]))) { ++bp; *bp = '\0'; ++bp; - emitcode (bp1, ""); - bp1 = bp; + emitcode (begin, NULL); + begin = bp; } else ++bp; break; } } - if (bp1 != bp) - emitinline (ic, bp1); + if (begin != bp) + { + expanded = expand_symbols (ic, begin); + emitcode (expanded, NULL); + dbuf_free (expanded); + } + + Safe_free (buf); - Safe_free (buffer); + /* consumed; we can free it here */ + dbuf_free (IC_INLINE (ic)); - _G.inLine -= (!options.asmpeep); + genLine.lineElement.isInline -= (!options.asmpeep); } /*-----------------------------------------------------------------*/ @@ -5525,7 +6431,7 @@ bool resultInA = FALSE; char *shift; - D(emitcode ("; genRRC","")); + D (emitcode ("; genRRC", "")); /* rotate right with carry */ left = IC_LEFT (ic); @@ -5533,20 +6439,19 @@ aopOp (left, ic, FALSE); aopOp (result, ic, FALSE); - if ((AOP_TYPE (result) == AOP_REG) - && (AOP (result)->aopu.aop_reg[0]->rIdx == A_IDX)) - resultInA = TRUE; + if ((AOP_TYPE (result) == AOP_REG) && (AOP (result)->aopu.aop_reg[0]->rIdx == A_IDX)) + resultInA = TRUE; size = AOP_SIZE (result); - offset = size-1; + offset = size - 1; - shift="lsr"; + shift = "lsr"; if (sameRegs (AOP (IC_LEFT (ic)), AOP (IC_RESULT (ic)))) { while (size--) { rmwWithAop (shift, AOP (result), offset--); - shift="ror"; + shift = "ror"; } } else @@ -5557,7 +6462,7 @@ rmwWithReg (shift, hc08_reg_a); storeRegToAop (hc08_reg_a, AOP (result), offset--); hc08_freeReg (hc08_reg_a); - shift="ror"; + shift = "ror"; } } @@ -5570,13 +6475,15 @@ /* now we need to put the carry into the highest order byte of the result */ offset = AOP_SIZE (result) - 1; - emitcode ("clra",""); - emitcode ("rora",""); + emitcode ("clra", ""); + emitcode ("rora", ""); + regalloc_dry_run_cost += 2; hc08_dirtyReg (hc08_reg_a, FALSE); if (resultInA) { emitcode ("ora", "1,s"); - emitcode ("ais", "#1"); + pullNull (1); + regalloc_dry_run_cost += 3; hc08_dirtyReg (hc08_reg_a, FALSE); needpula = FALSE; } @@ -5602,7 +6509,7 @@ bool resultInA = FALSE; bool needpula = FALSE; - D(emitcode ("; genRLC","")); + D (emitcode ("; genRLC", "")); /* rotate right with carry */ left = IC_LEFT (ic); @@ -5610,20 +6517,19 @@ aopOp (left, ic, FALSE); aopOp (result, ic, FALSE); - if ((AOP_TYPE (result) == AOP_REG) - && (AOP (result)->aopu.aop_reg[0]->rIdx == A_IDX)) - resultInA = TRUE; + if ((AOP_TYPE (result) == AOP_REG) && (AOP (result)->aopu.aop_reg[0]->rIdx == A_IDX)) + resultInA = TRUE; size = AOP_SIZE (result); offset = 0; - shift="lsl"; + shift = "lsl"; if (sameRegs (AOP (IC_LEFT (ic)), AOP (IC_RESULT (ic)))) { while (size--) { - rmwWithAop (shift, AOP (result), offset--); - shift="rol"; + rmwWithAop (shift, AOP (result), offset++); + shift = "rol"; } } else @@ -5634,7 +6540,7 @@ rmwWithReg (shift, hc08_reg_a); storeRegToAop (hc08_reg_a, AOP (result), offset++); hc08_freeReg (hc08_reg_a); - shift="rol"; + shift = "rol"; } } @@ -5647,13 +6553,15 @@ /* now we need to put the carry into the lowest order byte of the result */ offset = 0; - emitcode ("clra",""); - emitcode ("rola",""); + emitcode ("clra", ""); + emitcode ("rola", ""); + regalloc_dry_run_cost += 2; hc08_dirtyReg (hc08_reg_a, FALSE); if (resultInA) { emitcode ("ora", "1,s"); - emitcode ("ais", "#1"); + pullNull (1); + regalloc_dry_run_cost += 3; hc08_dirtyReg (hc08_reg_a, FALSE); needpula = FALSE; } @@ -5674,8 +6582,9 @@ genGetHbit (iCode * ic) { operand *left, *result; + bool needpulla; - D(emitcode ("; genGetHbit","")); + D (emitcode ("; genGetHbit", "")); left = IC_LEFT (ic); result = IC_RESULT (ic); @@ -5683,16 +6592,154 @@ aopOp (result, ic, FALSE); /* get the highest order byte into a */ + needpulla = pushRegIfSurv (hc08_reg_a); loadRegFromAop (hc08_reg_a, AOP (left), AOP_SIZE (left) - 1); emitcode ("rola", ""); emitcode ("clra", ""); emitcode ("rola", ""); + regalloc_dry_run_cost += 3; hc08_dirtyReg (hc08_reg_a, FALSE); storeRegToFullAop (hc08_reg_a, AOP (result), FALSE); - hc08_freeReg (hc08_reg_a); + pullOrFreeReg (hc08_reg_a, needpulla); + + freeAsmop (left, NULL, ic, TRUE); + freeAsmop (result, NULL, ic, TRUE); +} + + +/*-----------------------------------------------------------------*/ +/* genGetAbit - generates code get a single bit */ +/*-----------------------------------------------------------------*/ +static void +genGetAbit (iCode * ic) +{ + operand *left, *right, *result; + int shCount; + bool needpulla; + + D (emitcode ("; genGetAbit", "")); + + left = IC_LEFT (ic); + right = IC_RIGHT (ic); + result = IC_RESULT (ic); + aopOp (left, ic, FALSE); + aopOp (right, ic, FALSE); + aopOp (result, ic, FALSE); + + shCount = (int) ulFromVal (AOP (IC_RIGHT (ic))->aopu.aop_lit); + + needpulla = pushRegIfSurv (hc08_reg_a); + + /* get the needed byte into a */ + loadRegFromAop (hc08_reg_a, AOP (left), shCount / 8); + shCount %= 8; + if (AOP_TYPE (result) == AOP_CRY) + { + emitcode ("and", "#0x%02x", 1 << shCount); + regalloc_dry_run_cost += 2; + hc08_dirtyReg (hc08_reg_a, FALSE); + } + else + { + switch (shCount) + { + case 3: + emitcode ("lsra", ""); + regalloc_dry_run_cost++; + //fallthrough + case 2: + emitcode ("lsra", ""); + regalloc_dry_run_cost++; + //fallthrough + case 1: + emitcode ("lsra", ""); + regalloc_dry_run_cost++; + //fallthrough + case 0: + emitcode ("and", "#0x01"); + regalloc_dry_run_cost += 2; + break; + case 4: + emitcode ("nsa", ""); + emitcode ("and", "#0x01"); + regalloc_dry_run_cost += 3; + break; + case 5: + emitcode ("rola", ""); + regalloc_dry_run_cost++; + //fallthrough + case 6: + emitcode ("rola", ""); + regalloc_dry_run_cost++; + //fallthrough + case 7: + emitcode ("rola", ""); + emitcode ("clra", ""); + emitcode ("rola", ""); + regalloc_dry_run_cost += 3; + break; + } + hc08_dirtyReg (hc08_reg_a, FALSE); + storeRegToFullAop (hc08_reg_a, AOP (result), FALSE); + } + pullOrFreeReg (hc08_reg_a, needpulla); + + freeAsmop (result, NULL, ic, TRUE); + freeAsmop (right, NULL, ic, TRUE); + freeAsmop (left, NULL, ic, TRUE); +} + +/*-----------------------------------------------------------------*/ +/* genGetByte - generates code get a single byte */ +/*-----------------------------------------------------------------*/ +static void +genGetByte (iCode * ic) +{ + operand *left, *right, *result; + int offset; + + D (emitcode (";", "genGetByte")); + + left = IC_LEFT (ic); + right = IC_RIGHT (ic); + result = IC_RESULT (ic); + aopOp (left, ic, FALSE); + aopOp (right, ic, FALSE); + aopOp (result, ic, FALSE); + + offset = (int) ulFromVal (AOP (right)->aopu.aop_lit) / 8; + transferAopAop (AOP (left), offset, AOP (result), 0); + freeAsmop (result, NULL, ic, TRUE); + freeAsmop (right, NULL, ic, TRUE); freeAsmop (left, NULL, ic, TRUE); +} + +/*-----------------------------------------------------------------*/ +/* genGetWord - generates code get two bytes */ +/*-----------------------------------------------------------------*/ +static void +genGetWord (iCode * ic) +{ + operand *left, *right, *result; + int offset; + + D (emitcode (";", "genGetWord")); + + left = IC_LEFT (ic); + right = IC_RIGHT (ic); + result = IC_RESULT (ic); + aopOp (left, ic, FALSE); + aopOp (right, ic, FALSE); + aopOp (result, ic, FALSE); + + offset = (int) ulFromVal (AOP (right)->aopu.aop_lit) / 8; + transferAopAop (AOP (left), offset + 1, AOP (result), 1); + transferAopAop (AOP (left), offset, AOP (result), 0); + freeAsmop (result, NULL, ic, TRUE); + freeAsmop (right, NULL, ic, TRUE); + freeAsmop (left, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ @@ -5702,8 +6749,9 @@ genSwap (iCode * ic) { operand *left, *result; + bool needpulla; - D(emitcode ("; genSwap","")); + D (emitcode ("; genSwap", "")); left = IC_LEFT (ic); result = IC_RESULT (ic); @@ -5712,21 +6760,35 @@ switch (AOP_SIZE (left)) { - case 1: /* swap nibbles in byte */ + case 1: /* swap nibbles in byte */ + needpulla = pushRegIfSurv (hc08_reg_a); loadRegFromAop (hc08_reg_a, AOP (left), 0); emitcode ("nsa", ""); + regalloc_dry_run_cost++; hc08_dirtyReg (hc08_reg_a, FALSE); storeRegToAop (hc08_reg_a, AOP (result), 0); - hc08_freeReg (hc08_reg_a); + pullOrFreeReg (hc08_reg_a, needpulla); break; - case 2: /* swap bytes in a word */ - if (operandsEqu (left, result) || sameRegs (AOP (left), AOP (result))) + case 2: /* swap bytes in a word */ + if (IS_AOP_XA (AOP (left)) && IS_AOP_AX (AOP (result)) || + IS_AOP_AX (AOP (left)) && IS_AOP_XA (AOP (result))) + break; + if (AOP_TYPE (result) == AOP_REG && AOP_TYPE (left) == AOP_REG) + { + if (AOP (result)->aopu.aop_reg[1] != AOP (left)->aopu.aop_reg[0]); + pushReg (AOP (left)->aopu.aop_reg[0], TRUE); + storeRegToAop (AOP (left)->aopu.aop_reg[1], AOP (result), 0); + if (AOP (result)->aopu.aop_reg[1] != AOP (left)->aopu.aop_reg[0]); + pullReg (AOP (result)->aopu.aop_reg[1]); + } + else if (operandsEqu (left, result) || sameRegs (AOP (left), AOP (result))) { + needpulla = pushRegIfSurv (hc08_reg_a); loadRegFromAop (hc08_reg_a, AOP (left), 0); hc08_useReg (hc08_reg_a); transferAopAop (AOP (left), 1, AOP (result), 0); storeRegToAop (hc08_reg_a, AOP (result), 1); - hc08_freeReg (hc08_reg_a); + pullOrFreeReg (hc08_reg_a, needpulla); } else { @@ -5735,7 +6797,7 @@ } break; default: - wassertl(FALSE, "unsupported SWAP operand size"); + wassertl (FALSE, "unsupported SWAP operand size"); } freeAsmop (left, NULL, ic, TRUE); @@ -5834,10 +6896,10 @@ return; } - /* lsla is only 1 cycle and byte, so an unrolled loop is often */ - /* the fastest (shCount<6) and shortest (shCount<4). */ - for (i=0;i=8) + if (shCount >= 8) { - AccLsh (shCount-8); + AccLsh (shCount - 8); transferRegReg (hc08_reg_a, hc08_reg_x, FALSE); loadRegFromConst (hc08_reg_a, zero); return; @@ -5945,14 +7007,14 @@ { case 7: /* bytes cycles reg x reg a carry - ** abcd efgh ijkl mnop ? - ** lsrx 1 1 0abc defg ijkl mnop h - ** rora 1 1 0abc defg hijk lmno p - ** tax 1 1 hijk lmno hijk lmno p - ** clra 1 1 hijk lmno 0000 0000 p - ** rora 1 1 hijk lmno p000 0000 0 - ** total: 5 cycles, 5 bytes (beats 14 cycles, 14 bytes) - */ + ** abcd efgh ijkl mnop ? + ** lsrx 1 1 0abc defg ijkl mnop h + ** rora 1 1 0abc defg hijk lmno p + ** tax 1 1 hijk lmno hijk lmno p + ** clra 1 1 hijk lmno 0000 0000 p + ** rora 1 1 hijk lmno p000 0000 0 + ** total: 5 cycles, 5 bytes (beats 14 cycles, 14 bytes) + */ rmwWithReg ("lsr", hc08_reg_x); rmwWithReg ("ror", hc08_reg_a); transferRegReg (hc08_reg_a, hc08_reg_x, FALSE); @@ -5966,7 +7028,7 @@ /* lsla/rolx is only 2 cycles and bytes, so an unrolled loop is often */ /* the fastest and shortest. */ - for (i=0;i=8)) - */ + ** abcd efgh ijkl mnop ? + ** txa 1 1 abcd efgh abcd efgh ? + ** (AccSRsh) <8 <8 abcd efgh LSBresult ? + ** lsla 1 1 abcd efgh ???? ???? a + ** clrx 1 1 0000 0000 ???? ???? a + ** rolx 1 1 0000 000a ???? ???? 0 + ** negx 1 1 aaaa aaaa ???? ???? a + ** rora 1 1 aaaa aaaa LSBresult 0 + ** total: n-2 cycles, n-2 bytes (beats 2n cycles, 2n bytes (for n>=8)) + */ transferRegReg (hc08_reg_x, hc08_reg_a, FALSE); - AccSRsh (shCount-8); + AccSRsh (shCount - 8); rmwWithReg ("lsl", hc08_reg_a); loadRegFromConst (hc08_reg_x, zero); rmwWithReg ("rol", hc08_reg_x); @@ -6036,7 +7098,7 @@ /* asrx/rora is only 2 cycles and bytes, so an unrolled loop is often */ /* the fastest and shortest. */ - for (i=0;i 1) { loadRegFromAop (hc08_reg_a, AOP (left), 0); AccLsh (shCount); storeRegToAop (hc08_reg_a, AOP (result), 1); } - storeConstToAop(zero, AOP (result), LSB); + storeConstToAop (zero, AOP (result), LSB); + pullOrFreeReg (hc08_reg_a, needpulla); } /* 1 <= shCount <= 7 */ else { + needpulla = pushRegIfSurv (hc08_reg_a); + needpullx = pushRegIfSurv (hc08_reg_x); loadRegFromAop (hc08_reg_xa, AOP (left), 0); XAccLsh (shCount); storeRegToFullAop (hc08_reg_xa, AOP (result), 0); + pullOrFreeReg (hc08_reg_x, needpullx); + pullOrFreeReg (hc08_reg_a, needpulla); } } @@ -6376,21 +7377,21 @@ rmwWithReg ("lsl", hc08_reg_a); rmwWithReg ("rol", hc08_reg_x); - if (offr==LSB) + if (offr == LSB) { storeRegToAop (hc08_reg_xa, AOP (result), offr); loadRegFromAop (hc08_reg_xa, AOP (left), MSB24); rmwWithReg ("rol", hc08_reg_a); rmwWithReg ("rol", hc08_reg_x); - storeRegToAop (hc08_reg_xa, AOP (result), offr+2); + storeRegToAop (hc08_reg_xa, AOP (result), offr + 2); } - else if (offr==MSB16) + else if (offr == MSB16) { storeRegToAop (hc08_reg_a, AOP (result), offr); loadRegFromAop (hc08_reg_a, AOP (left), MSB24); - storeRegToAop (hc08_reg_x, AOP (result), offr+1); + storeRegToAop (hc08_reg_x, AOP (result), offr + 1); rmwWithReg ("rol", hc08_reg_a); - storeRegToAop (hc08_reg_a, AOP (result), offr+2); + storeRegToAop (hc08_reg_a, AOP (result), offr + 2); storeConstToAop (zero, AOP (result), 0); } @@ -6406,7 +7407,7 @@ { int size; - D(emitcode ("; genlshFour","")); + D (emitcode ("; genlshFour", "")); size = AOP_SIZE (result); @@ -6459,7 +7460,8 @@ movLeft2Result (left, LSB, result, MSB16, 0); } else - { /* size = 4 */ + { + /* size = 4 */ if (shCount == 0) { movLeft2Result (left, MSB24, result, MSB32, 0); @@ -6499,15 +7501,12 @@ /* genLeftShiftLiteral - left shifting by known count */ /*-----------------------------------------------------------------*/ static void -genLeftShiftLiteral (operand * left, - operand * right, - operand * result, - iCode * ic) +genLeftShiftLiteral (operand * left, operand * right, operand * result, iCode * ic) { int shCount = (int) ulFromVal (AOP (right)->aopu.aop_lit); int size; - D(emitcode ("; genLeftShiftLiteral","")); + D (emitcode ("; genLeftShiftLiteral", "")); freeAsmop (right, NULL, ic, TRUE); @@ -6518,14 +7517,12 @@ size = AOP_SIZE (result); #if VIEW_SIZE - DD(emitcode ("; shift left ", "result %d, left %d", size, - AOP_SIZE (left))); + DD (emitcode ("; shift left ", "result %d, left %d", size, AOP_SIZE (left))); #endif if (shCount == 0) { - while (size--) - transferAopAop( AOP(left), size, AOP(result), size); + genCopy (result, left); } else if (shCount >= (size * 8)) { @@ -6548,8 +7545,7 @@ genlshFour (result, left, shCount); break; default: - werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - "*** ack! mystery literal shift!\n"); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "*** ack! mystery literal shift!\n"); break; } } @@ -6568,8 +7564,10 @@ symbol *tlbl, *tlbl1; char *shift; asmop *aopResult; + bool needpullcountreg; + reg_info *countreg = NULL; - D(emitcode ("; genLeftShift","")); + D (emitcode ("; genLeftShift", "")); right = IC_RIGHT (ic); left = IC_LEFT (ic); @@ -6595,13 +7593,21 @@ aopOp (left, ic, FALSE); aopResult = AOP (result); - if (sameRegs(AOP (right), AOP (result)) || IS_AOP_XA (AOP (result)) - || isOperandVolatile (result, FALSE)) - aopResult = forceStackedAop (AOP (result), sameRegs ( AOP (left), AOP (result))); + if (sameRegs (AOP (right), AOP (result)) || IS_AOP_XA (AOP (result)) || isOperandVolatile (result, FALSE)) + aopResult = forceStackedAop (AOP (result), sameRegs (AOP (left), AOP (result))); /* now move the left to the result if they are not the same */ - if (!sameRegs (AOP (left), aopResult)) + if (IS_AOP_HX (AOP (result))) + loadRegFromAop (hc08_reg_hx, AOP (left), 0); + else if (IS_AOP_AX (AOP (result)) && IS_AOP_XA (AOP (left)) || IS_AOP_XA (AOP (result)) && IS_AOP_AX (AOP (left))) + { + pushReg (hc08_reg_x, TRUE); + emitcode("tax", ""); + regalloc_dry_run_cost++; + pullReg (hc08_reg_a); + } + else if (!sameRegs (AOP (left), aopResult)) { size = AOP_SIZE (result); offset = 0; @@ -6614,26 +7620,58 @@ freeAsmop (left, NULL, ic, TRUE); AOP (result) = aopResult; - tlbl = newiTempLabel (NULL); + tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); size = AOP_SIZE (result); offset = 0; - tlbl1 = newiTempLabel (NULL); + tlbl1 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); + + if (hc08_reg_x->isDead && !IS_AOP_X (AOP (result)) && !IS_AOP_XA (AOP (result)) && !IS_AOP_AX (AOP (result)) && !IS_AOP_HX (AOP (result))) + countreg = hc08_reg_x; + else if (hc08_reg_a->isDead && !IS_AOP_A (AOP (result)) && !IS_AOP_XA (AOP (result)) && !IS_AOP_AX (AOP (result))) + countreg = hc08_reg_a; + else if (!IS_AOP_X (AOP (result)) && !IS_AOP_XA (AOP (result)) && !IS_AOP_AX (AOP (result)) && !IS_AOP_HX (AOP (result))) + countreg = hc08_reg_x; + else if(!IS_AOP_A (AOP (result)) && !IS_AOP_XA (AOP (result)) && !IS_AOP_AX (AOP (result))) + countreg = hc08_reg_a; + needpullcountreg = (countreg && pushRegIfSurv (countreg)); + if(countreg) + { + countreg->isFree = FALSE; + loadRegFromAop (countreg, AOP (right), 0); + } + else + { + pushReg (hc08_reg_a, FALSE); + pushReg (hc08_reg_a, TRUE); + loadRegFromAop (hc08_reg_a, AOP (right), 0); + emitcode ("sta", "2, s"); + regalloc_dry_run_cost += 3; + pullReg (hc08_reg_a); + } + emitcode (countreg == hc08_reg_a ? "tsta" : (countreg ? "tstx" : "tst 1, s"), ""); + regalloc_dry_run_cost += (countreg ? 1 : 3); - loadRegFromAop (hc08_reg_x, AOP (right), 0); - emitcode ("tstx", ""); emitBranch ("beq", tlbl1); - emitLabel (tlbl); + if (!regalloc_dry_run) + emitLabel (tlbl); - shift="lsl"; - for (offset=0;offsetkey)); + regalloc_dry_run_cost += (countreg ? 2 : 4); + + if (!regalloc_dry_run) + emitLabel (tlbl1); + + if (!countreg) + pullNull (1); + else + pullOrFreeReg (countreg, needpullcountreg); freeAsmop (result, NULL, ic, TRUE); freeAsmop (right, NULL, ic, TRUE); @@ -6643,33 +7681,36 @@ /* genrshOne - right shift a one byte quantity by known count */ /*-----------------------------------------------------------------*/ static void -genrshOne (operand * result, operand * left, - int shCount, int sign) +genrshOne (operand * result, operand * left, int shCount, int sign) { - D(emitcode ("; genrshOne","")); - + bool needpulla; + D (emitcode ("; genrshOne", "")); + needpulla = pushRegIfSurv (hc08_reg_a); loadRegFromAop (hc08_reg_a, AOP (left), 0); AccRsh (shCount, sign); storeRegToFullAop (hc08_reg_a, AOP (result), sign); + pullOrFreeReg (hc08_reg_a, needpulla); } /*-----------------------------------------------------------------*/ /* genrshTwo - right shift two bytes by known amount != 0 */ /*-----------------------------------------------------------------*/ static void -genrshTwo (operand * result, operand * left, - int shCount, int sign) +genrshTwo (operand * result, operand * left, int shCount, int sign) { - D(emitcode ("; genrshTwo","")); + bool needpulla, needpullx; + D (emitcode ("; genrshTwo", "")); /* if shCount >= 8 */ if (shCount >= 8) { - if (shCount || sign) + if (shCount != 8 || sign) { + needpulla = pushRegIfSurv (hc08_reg_a); loadRegFromAop (hc08_reg_a, AOP (left), 1); - AccRsh (shCount-8, sign); + AccRsh (shCount - 8, sign); storeRegToFullAop (hc08_reg_a, AOP (result), sign); + pullOrFreeReg (hc08_reg_a, needpulla); } else { @@ -6681,9 +7722,13 @@ /* 1 <= shCount <= 7 */ else { + needpulla = pushRegIfSurv (hc08_reg_a); + needpullx = pushRegIfSurv (hc08_reg_x); loadRegFromAop (hc08_reg_xa, AOP (left), 0); XAccRsh (shCount, sign); storeRegToAop (hc08_reg_xa, AOP (result), 0); + pullOrFreeReg (hc08_reg_x, needpullx); + pullOrFreeReg (hc08_reg_a, needpulla); } } @@ -6692,19 +7737,12 @@ /* offl = LSB or MSB16 */ /*-----------------------------------------------------------------*/ static void -shiftRLong (operand * left, int offl, - operand * result, int sign) +shiftRLong (operand * left, int offl, operand * result, int sign) { -// char *l; - // int size = AOP_SIZE (result); - - bool needpula = FALSE; - bool needpulx = FALSE; - - needpula = pushRegIfUsed (hc08_reg_a); - needpulx = pushRegIfUsed (hc08_reg_x); + bool needpula = pushRegIfSurv (hc08_reg_a); + bool needpulx = pushRegIfSurv (hc08_reg_x); - if (offl==LSB) + if (offl == LSB) { loadRegFromAop (hc08_reg_xa, AOP (left), MSB24); if (sign) @@ -6715,7 +7753,7 @@ storeRegToAop (hc08_reg_xa, AOP (result), MSB24); loadRegFromAop (hc08_reg_xa, AOP (left), LSB); } - else if (offl==MSB16) + else if (offl == MSB16) { loadRegFromAop (hc08_reg_a, AOP (left), MSB32); if (sign) @@ -6731,7 +7769,7 @@ rmwWithReg ("ror", hc08_reg_a); storeRegToAop (hc08_reg_xa, AOP (result), LSB); - if (offl==MSB16) + if (offl == MSB16) { if (sign) { @@ -6752,70 +7790,84 @@ /* genrshFour - shift four byte by a known amount != 0 */ /*-----------------------------------------------------------------*/ static void -genrshFour (operand * result, operand * left, - int shCount, int sign) +genrshFour (operand * result, operand * left, int shCount, int sign) { + bool needpulla = FALSE; + bool needpullx = FALSE; + /* TODO: handle cases where left == result */ - D(emitcode ("; genrshFour","")); + D (emitcode ("; genrshFour", "")); /* if shifting more that 3 bytes */ if (shCount >= 24) { + needpulla = pushRegIfSurv (hc08_reg_a); loadRegFromAop (hc08_reg_a, AOP (left), 3); - AccRsh (shCount-24, sign); + AccRsh (shCount - 24, sign); storeRegToFullAop (hc08_reg_a, AOP (result), sign); - return; } else if (shCount >= 16) { + needpulla = pushRegIfSurv (hc08_reg_a); + needpullx = pushRegIfSurv (hc08_reg_x); loadRegFromAop (hc08_reg_xa, AOP (left), 2); - XAccRsh (shCount-16, sign); + XAccRsh (shCount - 16, sign); storeRegToFullAop (hc08_reg_xa, AOP (result), sign); - return; } else if (shCount >= 8) { if (shCount == 1) - shiftRLong (left, MSB16, result, sign); + { + shiftRLong (left, MSB16, result, sign); + return; + } else if (shCount == 8) { + needpulla = pushRegIfSurv (hc08_reg_a); transferAopAop (AOP (left), 1, AOP (result), 0); transferAopAop (AOP (left), 2, AOP (result), 1); loadRegFromAop (hc08_reg_a, AOP (left), 3); storeRegToAop (hc08_reg_a, AOP (result), 2); - storeRegSignToUpperAop (hc08_reg_a, AOP(result), 3, sign); + storeRegSignToUpperAop (hc08_reg_a, AOP (result), 3, sign); } else if (shCount == 9) { shiftRLong (left, MSB16, result, sign); + return; } else { + needpulla = pushRegIfSurv (hc08_reg_a); + needpullx = pushRegIfSurv (hc08_reg_x); loadRegFromAop (hc08_reg_xa, AOP (left), 1); - XAccRsh (shCount-8, FALSE); + XAccRsh (shCount - 8, FALSE); storeRegToAop (hc08_reg_xa, AOP (result), 0); loadRegFromAop (hc08_reg_x, AOP (left), 3); loadRegFromConst (hc08_reg_a, zero); - XAccRsh (shCount-8, sign); + XAccRsh (shCount - 8, sign); accopWithAop ("ora", AOP (result), 1); storeRegToAop (hc08_reg_xa, AOP (result), 1); - storeRegSignToUpperAop (hc08_reg_x, AOP(result), 3, sign); + storeRegSignToUpperAop (hc08_reg_x, AOP (result), 3, sign); } } else - { /* 1 <= shCount <= 7 */ + { + /* 1 <= shCount <= 7 */ if (shCount == 1) { shiftRLong (left, LSB, result, sign); + return; } else { + needpulla = pushRegIfSurv (hc08_reg_a); + needpullx = pushRegIfSurv (hc08_reg_x); loadRegFromAop (hc08_reg_xa, AOP (left), 0); XAccRsh (shCount, FALSE); storeRegToAop (hc08_reg_xa, AOP (result), 0); loadRegFromAop (hc08_reg_a, AOP (left), 2); - AccLsh (8-shCount); + AccLsh (8 - shCount); accopWithAop ("ora", AOP (result), 1); storeRegToAop (hc08_reg_a, AOP (result), 1); loadRegFromAop (hc08_reg_xa, AOP (left), 2); @@ -6823,22 +7875,20 @@ storeRegToAop (hc08_reg_xa, AOP (result), 2); } } + pullOrFreeReg (hc08_reg_x, needpullx); + pullOrFreeReg (hc08_reg_a, needpulla); } /*-----------------------------------------------------------------*/ /* genRightShiftLiteral - right shifting by known count */ /*-----------------------------------------------------------------*/ static void -genRightShiftLiteral (operand * left, - operand * right, - operand * result, - iCode * ic, - int sign) +genRightShiftLiteral (operand * left, operand * right, operand * result, iCode * ic, int sign) { int shCount = (int) ulFromVal (AOP (right)->aopu.aop_lit); int size; - D(emitcode ("; genRightShiftLiteral","")); + D (emitcode ("; genRightShiftLiteral", "")); freeAsmop (right, NULL, ic, TRUE); @@ -6846,8 +7896,7 @@ aopOp (result, ic, FALSE); #if VIEW_SIZE - DD(emitcode ("; shift right ", "result %d, left %d", AOP_SIZE (result), - AOP_SIZE (left))); + DD (emitcode ("; shift right ", "result %d, left %d", AOP_SIZE (result), AOP_SIZE (left))); #endif size = getDataSize (left); @@ -6856,17 +7905,19 @@ /* I suppose that the left size >= result size */ if (shCount == 0) { - size = getDataSize (result); - while (size--) - transferAopAop (AOP (left), size, AOP(result), size); + genCopy (result, left); } else if (shCount >= (size * 8)) { - if (sign) { - /* get sign in acc.7 */ - loadRegFromAop (hc08_reg_a, AOP (left), size -1); - } + bool needpulla = pushRegIfSurv (hc08_reg_a); + if (sign) + { + + /* get sign in acc.7 */ + loadRegFromAop (hc08_reg_a, AOP (left), size - 1); + } addSign (result, LSB, sign); + pullOrFreeReg (hc08_reg_a, needpulla); } else { @@ -6884,6 +7935,7 @@ genrshFour (result, left, shCount, sign); break; default: + wassertl (0, "Invalid operand size in right shift."); break; } } @@ -6905,8 +7957,10 @@ char *shift; bool sign; asmop *aopResult; + bool needpullcountreg; + reg_info *countreg = NULL; - D(emitcode ("; genRightShift","")); + D (emitcode ("; genRightShift", "")); /* if signed then we do it the hard way preserve the sign bit moving it inwards */ @@ -6944,13 +7998,21 @@ aopOp (left, ic, FALSE); aopResult = AOP (result); - if (sameRegs(AOP (right), AOP (result)) || IS_AOP_XA (AOP (result)) - || isOperandVolatile (result, FALSE)) - aopResult = forceStackedAop (AOP (result), sameRegs ( AOP (left), AOP (result))); + if (sameRegs (AOP (right), AOP (result)) || IS_AOP_XA (AOP (result)) || isOperandVolatile (result, FALSE)) + aopResult = forceStackedAop (AOP (result), sameRegs (AOP (left), AOP (result))); /* now move the left to the result if they are not the same */ - if (!sameRegs (AOP (left), aopResult)) + if (IS_AOP_HX (AOP (result))) + loadRegFromAop (hc08_reg_hx, AOP (left), 0); + else if (IS_AOP_AX (AOP (result)) && IS_AOP_XA (AOP (left)) || IS_AOP_XA (AOP (result)) && IS_AOP_AX (AOP (left))) + { + pushReg (hc08_reg_x, TRUE); + emitcode("tax", ""); + regalloc_dry_run_cost++; + pullReg (hc08_reg_a); + } + else if (!sameRegs (AOP (left), aopResult)) { size = AOP_SIZE (result); offset = 0; @@ -6963,61 +8025,130 @@ freeAsmop (left, NULL, ic, TRUE); AOP (result) = aopResult; - tlbl = newiTempLabel (NULL); + tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); size = AOP_SIZE (result); offset = 0; - tlbl1 = newiTempLabel (NULL); + tlbl1 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); + + if (hc08_reg_x->isDead && !IS_AOP_X (AOP (result)) && !IS_AOP_XA (AOP (result)) && !IS_AOP_AX (AOP (result)) && !IS_AOP_HX (AOP (result))) + countreg = hc08_reg_x; + else if (hc08_reg_a->isDead && !IS_AOP_A (AOP (result)) && !IS_AOP_XA (AOP (result)) && !IS_AOP_AX (AOP (result))) + countreg = hc08_reg_a; + else if (!IS_AOP_X (AOP (result)) && !IS_AOP_XA (AOP (result)) && !IS_AOP_AX (AOP (result)) && !IS_AOP_HX (AOP (result))) + countreg = hc08_reg_x; + else if(!IS_AOP_A (AOP (result)) && !IS_AOP_XA (AOP (result)) && !IS_AOP_AX (AOP (result))) + countreg = hc08_reg_a; + needpullcountreg = (countreg && pushRegIfSurv (countreg)); + if(countreg) + { + countreg->isFree = FALSE; + loadRegFromAop (countreg, AOP (right), 0); + } + else + { + pushReg (hc08_reg_a, FALSE); + pushReg (hc08_reg_a, TRUE); + loadRegFromAop (hc08_reg_a, AOP (right), 0); + emitcode ("sta", "2, s"); + regalloc_dry_run_cost += 3; + pullReg (hc08_reg_a); + } + emitcode (countreg == hc08_reg_a ? "tsta" : (countreg ? "tstx" : "tst 1, s"), ""); + regalloc_dry_run_cost += (countreg ? 1 : 3); - loadRegFromAop (hc08_reg_x, AOP (right), 0); - emitcode ("tstx", ""); emitBranch ("beq", tlbl1); - emitLabel (tlbl); + if (!regalloc_dry_run) + emitLabel (tlbl); - shift= sign ? "asr" : "lsr"; - for (offset=size-1;offset>=0;offset--) + shift = sign ? "asr" : "lsr"; + for (offset = size - 1; offset >= 0; offset--) { rmwWithAop (shift, AOP (result), offset); - shift="ror"; + shift = "ror"; } - rmwWithReg ("dec", hc08_reg_x); - emitBranch ("bne", tlbl); - emitLabel (tlbl1); - hc08_freeReg (hc08_reg_x); + + if (!regalloc_dry_run) + emitcode (countreg == hc08_reg_a ? "dbnza" : (countreg ? "dbnzx" : "dbnz 1, s"), "%05d$", labelKey2num (tlbl->key)); + regalloc_dry_run_cost += (countreg ? 2 : 4); + + if (!regalloc_dry_run) + emitLabel (tlbl1); + + if (!countreg) + pullNull (1); + else + pullOrFreeReg (countreg, needpullcountreg); freeAsmop (result, NULL, ic, TRUE); freeAsmop (right, NULL, ic, TRUE); } +/*-----------------------------------------------------------------*/ +/* decodePointerOffset - decode a pointer offset operand into a */ +/* literal offset and a rematerializable offset */ +/*-----------------------------------------------------------------*/ +static void +decodePointerOffset (operand * opOffset, int * litOffset, char ** rematOffset) +{ + *litOffset = 0; + *rematOffset = NULL; + + if (!opOffset) + return; + + if (IS_OP_LITERAL (opOffset)) + { + *litOffset = (int)operandLitValue (opOffset); + } + else if (IS_ITEMP (opOffset) && OP_SYMBOL (opOffset)->remat) + { + asmop * aop = aopForRemat (OP_SYMBOL (opOffset)); + + if (aop->type == AOP_LIT) + *litOffset = (int) floatFromVal (aop->aopu.aop_lit); + else if (aop->type == AOP_IMMD) + *rematOffset = aop->aopu.aop_immd.aop_immd1; + } + else + wassertl (0, "Pointer get/set with non-constant offset"); +} + /*-----------------------------------------------------------------*/ /* genUnpackBits - generates code for unpacking bits */ /*-----------------------------------------------------------------*/ static void -genUnpackBits (operand * result, iCode *ifx) +genUnpackBits (operand * result, operand * right, iCode * ifx) { - int offset = 0; /* result byte offset */ - int rsize; /* result size */ - int rlen = 0; /* remaining bitfield length */ - sym_link *etype; /* bitfield type information */ - int blen; /* bitfield length */ - int bstr; /* bitfield starting bit within byte */ + int offset = 0; /* result byte offset */ + int rsize; /* result size */ + int rlen = 0; /* remaining bitfield length */ + sym_link *etype; /* bitfield type information */ + int blen; /* bitfield length */ + int bstr; /* bitfield starting bit within byte */ + bool needpulla = FALSE; + int litOffset = 0; + char * rematOffset = NULL; - D(emitcode ("; genUnpackBits","")); + D (emitcode ("; genUnpackBits", "")); + decodePointerOffset (right, &litOffset, &rematOffset); etype = getSpec (operandType (result)); rsize = getSize (operandType (result)); blen = SPEC_BLEN (etype); bstr = SPEC_BSTR (etype); + needpulla = pushRegIfSurv (hc08_reg_a); + if (ifx && blen <= 8) { - emitcode ("lda", ",x"); - hc08_dirtyReg (hc08_reg_a, FALSE); + loadRegIndexed (hc08_reg_a, litOffset, rematOffset); if (blen < 8) { - emitcode ("and", "#0x%02x", - (((unsigned char) -1) >> (8 - blen)) << bstr); + emitcode ("and", "#0x%02x", (((unsigned char) - 1) >> (8 - blen)) << bstr); + regalloc_dry_run_cost += 2; } + pullOrFreeReg (hc08_reg_a, needpulla); genIfxJump (ifx, "a"); return; } @@ -7026,19 +8157,22 @@ /* If the bitfield length is less than a byte */ if (blen < 8) { - emitcode ("lda", ",x"); - hc08_dirtyReg (hc08_reg_a, FALSE); + loadRegIndexed (hc08_reg_a, litOffset, rematOffset); AccRsh (bstr, FALSE); - emitcode ("and", "#0x%02x", ((unsigned char) -1) >> (8 - blen)); + emitcode ("and", "#0x%02x", ((unsigned char) - 1) >> (8 - blen)); + regalloc_dry_run_cost += 2; if (!SPEC_USIGN (etype)) { /* signed bitfield */ - symbol *tlbl = newiTempLabel (NULL); + symbol *tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); - emitcode ("bit", "#0x%02x", 1<<(blen - 1)); - emitcode ("beq", "%05d$", tlbl->key + 100); + emitcode ("bit", "#0x%02x", 1 << (blen - 1)); + if (!regalloc_dry_run) + emitcode ("beq", "%05d$", labelKey2num (tlbl->key)); emitcode ("ora", "#0x%02x", (unsigned char) (0xff << blen)); - emitLabel (tlbl); + regalloc_dry_run_cost += 6; + if (!regalloc_dry_run) + emitLabel (tlbl); } storeRegToAop (hc08_reg_a, AOP (result), offset++); goto finish; @@ -7046,33 +8180,45 @@ /* Bit field did not fit in a byte. Copy all but the partial byte at the end. */ - for (rlen=blen;rlen>=8;rlen-=8) + for (rlen = blen; rlen >= 8; rlen -= 8) { - emitcode ("lda", ",x"); - hc08_dirtyReg (hc08_reg_a, FALSE); - storeRegToAop (hc08_reg_a, AOP (result), offset); + loadRegIndexed (hc08_reg_a, litOffset, rematOffset); + if (rlen > 8 && AOP_TYPE (result) == AOP_REG) + pushReg (hc08_reg_a, TRUE); + else + storeRegToAop (hc08_reg_a, AOP (result), offset); offset++; - if (rlen>8) - emitcode ("aix", "#1"); + if (rlen > 8) + { + litOffset++; + } } /* Handle the partial byte at the end */ if (rlen) { - emitcode ("lda", ",x"); - emitcode ("and", "#0x%02x", ((unsigned char) -1) >> (8-rlen)); + loadRegIndexed (hc08_reg_a, litOffset, rematOffset); + emitcode ("and", "#0x%02x", ((unsigned char) - 1) >> (8 - rlen)); + regalloc_dry_run_cost += 3; if (!SPEC_USIGN (etype)) { /* signed bitfield */ - symbol *tlbl = newiTempLabel (NULL); + symbol *tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); - emitcode ("bit", "#0x%02x", 1<<(rlen - 1)); - emitcode ("beq", "%05d$", tlbl->key + 100); + emitcode ("bit", "#0x%02x", 1 << (rlen - 1)); + if (!regalloc_dry_run) + emitcode ("beq", "%05d$", labelKey2num (tlbl->key)); emitcode ("ora", "#0x%02x", (unsigned char) (0xff << rlen)); - emitLabel (tlbl); + regalloc_dry_run_cost += 6; + if (!regalloc_dry_run) + emitLabel (tlbl); } storeRegToAop (hc08_reg_a, AOP (result), offset++); } + if (blen > 8 && AOP_TYPE (result) == AOP_REG) + { + pullReg (AOP (result)->aopu.aop_reg[0]); + } finish: if (offset < rsize) @@ -7089,11 +8235,13 @@ emitcode ("rola", ""); emitcode ("clra", ""); emitcode ("sbc", zero); + regalloc_dry_run_cost += 4; while (rsize--) storeRegToAop (hc08_reg_a, AOP (result), offset++); } } + pullOrFreeReg (hc08_reg_a, needpulla); } @@ -7101,26 +8249,31 @@ /* genUnpackBitsImmed - generates code for unpacking bits */ /*-----------------------------------------------------------------*/ static void -genUnpackBitsImmed (operand * left, - operand * result, - iCode *ic, - iCode *ifx) +genUnpackBitsImmed (operand * left, operand *right, operand * result, iCode * ic, iCode * ifx) { int size; - int offset = 0; /* result byte offset */ - int rsize; /* result size */ - int rlen = 0; /* remaining bitfield length */ - sym_link *etype; /* bitfield type information */ - int blen; /* bitfield length */ - int bstr; /* bitfield starting bit within byte */ + int offset = 0; /* result byte offset */ + int litOffset = 0; + char * rematOffset = NULL; + int rsize; /* result size */ + int rlen = 0; /* remaining bitfield length */ + sym_link *etype; /* bitfield type information */ + int blen; /* bitfield length */ + int bstr; /* bitfield starting bit within byte */ asmop *derefaop; + bool delayed_a = FALSE; + bool assigned_a = FALSE; + bool needpulla = FALSE; - D(emitcode ("; genUnpackBitsImmed","")); + D (emitcode ("; genUnpackBitsImmed", "")); + + decodePointerOffset (right, &litOffset, &rematOffset); + wassert (rematOffset==NULL); aopOp (result, ic, TRUE); size = AOP_SIZE (result); - derefaop = aopDerefAop (AOP (left)); + derefaop = aopDerefAop (AOP (left), litOffset); freeAsmop (left, NULL, ic, TRUE); derefaop->size = size; @@ -7129,32 +8282,37 @@ blen = SPEC_BLEN (etype); bstr = SPEC_BSTR (etype); + needpulla = pushRegIfSurv (hc08_reg_a); + /* if the bitfield is a single bit in the direct page */ if (blen == 1 && derefaop->type == AOP_DIR) { if (!ifx && bstr) { - symbol *tlbl = newiTempLabel (NULL); + symbol *tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); loadRegFromConst (hc08_reg_a, zero); - emitcode ("brclr", "#%d,%s,%05d$", - bstr, aopAdrStr (derefaop, 0, FALSE), - (tlbl->key + 100)); + if (!regalloc_dry_run) + emitcode ("brclr", "#%d,%s,%05d$", bstr, aopAdrStr (derefaop, 0, FALSE), labelKey2num ((tlbl->key))); + regalloc_dry_run_cost += 3; if (SPEC_USIGN (etype)) rmwWithReg ("inc", hc08_reg_a); else rmwWithReg ("dec", hc08_reg_a); - emitLabel (tlbl); + if (!regalloc_dry_run) + emitLabel (tlbl); storeRegToAop (hc08_reg_a, AOP (result), offset); + if (AOP_TYPE (result) == AOP_REG && AOP(result)->aopu.aop_reg[offset]->rIdx == A_IDX) + assigned_a = TRUE; hc08_freeReg (hc08_reg_a); offset++; goto finish; } else if (ifx) { - symbol *tlbl = newiTempLabel (NULL); + symbol *tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); symbol *jlbl; - char * inst; + char *inst; if (IC_TRUE (ifx)) { @@ -7166,11 +8324,12 @@ jlbl = IC_FALSE (ifx); inst = "brset"; } - emitcode (inst, "#%d,%s,%05d$", - bstr, aopAdrStr (derefaop, 0, FALSE), - (tlbl->key + 100)); + if (!regalloc_dry_run) + emitcode (inst, "#%d,%s,%05d$", bstr, aopAdrStr (derefaop, 0, FALSE), labelKey2num ((tlbl->key))); + regalloc_dry_run_cost += 3; emitBranch ("jmp", jlbl); - emitLabel (tlbl); + if (!regalloc_dry_run) + emitLabel (tlbl); ifx->generated = 1; offset++; goto finish; @@ -7184,24 +8343,30 @@ if (!ifx) { AccRsh (bstr, FALSE); - emitcode ("and", "#0x%02x", ((unsigned char) -1) >> (8 - blen)); + emitcode ("and", "#0x%02x", ((unsigned char) - 1) >> (8 - blen)); + regalloc_dry_run_cost += 2; hc08_dirtyReg (hc08_reg_a, FALSE); if (!SPEC_USIGN (etype)) { /* signed bitfield */ - symbol *tlbl = newiTempLabel (NULL); + symbol *tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); - emitcode ("bit", "#0x%02x", 1<<(blen - 1)); - emitcode ("beq", "%05d$", tlbl->key + 100); + emitcode ("bit", "#0x%02x", 1 << (blen - 1)); + if (!regalloc_dry_run) + emitcode ("beq", "%05d$", labelKey2num (tlbl->key)); emitcode ("ora", "#0x%02x", (unsigned char) (0xff << blen)); - emitLabel (tlbl); + regalloc_dry_run_cost += 6; + if (!regalloc_dry_run) + emitLabel (tlbl); } storeRegToAop (hc08_reg_a, AOP (result), offset); + if (AOP_TYPE (result) == AOP_REG && AOP(result)->aopu.aop_reg[offset]->rIdx == A_IDX) + assigned_a = TRUE; } else { - emitcode ("and", "#0x%02x", - (((unsigned char) -1) >> (8 - blen)) << bstr); + emitcode ("and", "#0x%02x", (((unsigned char) - 1) >> (8 - blen)) << bstr); + regalloc_dry_run_cost += 2; hc08_dirtyReg (hc08_reg_a, FALSE); } offset++; @@ -7210,32 +8375,56 @@ /* Bit field did not fit in a byte. Copy all but the partial byte at the end. */ - for (rlen=blen;rlen>=8;rlen-=8) + for (rlen = blen; rlen >= 8; rlen -= 8) { - loadRegFromAop (hc08_reg_a, derefaop, size-offset-1); + if (assigned_a && !delayed_a) + { + pushReg (hc08_reg_a, TRUE); + delayed_a = TRUE; + } + loadRegFromAop (hc08_reg_a, derefaop, size - offset - 1); if (!ifx) - storeRegToAop (hc08_reg_a, AOP (result), offset); + { + storeRegToAop (hc08_reg_a, AOP (result), offset); + if (AOP_TYPE (result) == AOP_REG && AOP(result)->aopu.aop_reg[offset]->rIdx == A_IDX) + assigned_a = TRUE; + } else - emitcode ("tsta", ""); + { + emitcode ("tsta", ""); + regalloc_dry_run_cost++; + } offset++; } /* Handle the partial byte at the end */ if (rlen) { - loadRegFromAop (hc08_reg_a, derefaop, size-offset-1); - emitcode ("and", "#0x%02x", ((unsigned char) -1) >> (8-rlen)); + if (assigned_a && !delayed_a) + { + pushReg (hc08_reg_a, TRUE); + delayed_a = TRUE; + } + loadRegFromAop (hc08_reg_a, derefaop, size - offset - 1); + emitcode ("and", "#0x%02x", ((unsigned char) - 1) >> (8 - rlen)); + regalloc_dry_run_cost += 2; if (!SPEC_USIGN (etype)) { /* signed bitfield */ - symbol *tlbl = newiTempLabel (NULL); + symbol *tlbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); - emitcode ("bit", "#0x%02x", 1<<(rlen - 1)); - emitcode ("beq", "%05d$", tlbl->key + 100); + emitcode ("bit", "#0x%02x", 1 << (rlen - 1)); + if (!regalloc_dry_run) + emitcode ("beq", "%05d$", labelKey2num (tlbl->key)); emitcode ("ora", "#0x%02x", (unsigned char) (0xff << rlen)); - emitLabel (tlbl); + regalloc_dry_run_cost += 6; + if (!regalloc_dry_run) + emitLabel (tlbl); } - storeRegToAop (hc08_reg_a, AOP (result), offset++); + storeRegToAop (hc08_reg_a, AOP (result), offset); + if (AOP_TYPE (result) == AOP_REG && AOP(result)->aopu.aop_reg[offset]->rIdx == A_IDX) + assigned_a = TRUE; + offset++; } finish: @@ -7249,10 +8438,17 @@ } else { + if (assigned_a && !delayed_a) + { + pushReg (hc08_reg_a, TRUE); + delayed_a = TRUE; + } + /* signed bitfield: sign extension with 0x00 or 0xff */ emitcode ("rola", ""); emitcode ("clra", ""); emitcode ("sbc", zero); + regalloc_dry_run_cost += 4; while (rsize--) storeRegToAop (hc08_reg_a, AOP (result), offset++); @@ -7266,6 +8462,10 @@ { genIfxJump (ifx, "a"); } + if (delayed_a) + pullReg (hc08_reg_a); + + pullOrFreeReg (hc08_reg_a, needpulla); } @@ -7273,30 +8473,35 @@ /* genDataPointerGet - generates code when ptr offset is known */ /*-----------------------------------------------------------------*/ static void -genDataPointerGet (operand * left, - operand * result, - iCode * ic, - iCode * ifx) +genDataPointerGet (operand * left, operand * right, operand * result, iCode * ic, iCode * ifx) { int size; + int litOffset = 0; + char * rematOffset = NULL; asmop *derefaop; - D(emitcode ("; genDataPointerGet","")); + D (emitcode ("; genDataPointerGet", "")); + + decodePointerOffset (right, &litOffset, &rematOffset); + wassert (rematOffset==NULL); aopOp (result, ic, TRUE); size = AOP_SIZE (result); - derefaop = aopDerefAop (AOP (left)); + derefaop = aopDerefAop (AOP (left), litOffset); freeAsmop (left, NULL, ic, TRUE); derefaop->size = size; - while (size--) - { - if (!ifx) - transferAopAop (derefaop, size, AOP (result), size); - else - loadRegFromAop (hc08_reg_a, derefaop, size); - } + if (IS_AOP_HX (AOP (result))) + loadRegFromAop (hc08_reg_hx, derefaop, 0); + else + while (size--) + { + if (!ifx) + transferAopAop (derefaop, size, AOP (result), size); + else + loadRegFromAop (hc08_reg_a, derefaop, size); + } freeAsmop (NULL, derefaop, ic, TRUE); freeAsmop (result, NULL, ic, TRUE); @@ -7312,147 +8517,211 @@ /* genPointerGet - generate code for pointer get */ /*-----------------------------------------------------------------*/ static void -genPointerGet (iCode * ic, iCode *pi, iCode *ifx) +genPointerGet (iCode * ic, iCode * pi, iCode * ifx) { operand *left = IC_LEFT (ic); + operand *right = IC_RIGHT (ic); operand *result = IC_RESULT (ic); - int size, offset; + int size, offset, xoffset; + int litOffset = 0; + char * rematOffset = NULL; sym_link *retype = getSpec (operandType (result)); + bool postH = FALSE; + bool postX = FALSE; + bool postA = FALSE; + bool needpulla = FALSE; - D(emitcode ("; genPointerGet","")); + D (emitcode ("; genPointerGet", "")); - if (getSize (operandType (result))>1) + if ((size = getSize (operandType (result))) > 1) ifx = NULL; aopOp (left, ic, FALSE); - /* if left is rematerialisable and - result is not bit variable type */ + /* if left is rematerialisable */ if (AOP_TYPE (left) == AOP_IMMD || AOP_TYPE (left) == AOP_LIT) { + /* if result is not bit variable type */ if (!IS_BITVAR (retype)) { - genDataPointerGet (left, result, ic, ifx); + genDataPointerGet (left, right, result, ic, ifx); return; } else { - genUnpackBitsImmed (left, result, ic, ifx); + genUnpackBitsImmed (left, right, result, ic, ifx); return; } } + needpulla = pushRegIfSurv (hc08_reg_a); + /* if the operand is already in hx then we do nothing else we move the value to hx */ - if (AOP_TYPE (left) != AOP_STR) - { - /* if this is remateriazable */ - loadRegFromAop (hc08_reg_hx, AOP (left), 0); - } + loadRegFromAop (hc08_reg_hx, AOP (left), 0); /* so hx now contains the address */ aopOp (result, ic, FALSE); + + if (AOP_TYPE (result) == AOP_REG && pi) + { + int i; + for (i = 0; i < AOP_SIZE (result); i++) + AOP (result)->aopu.aop_reg[i]->isDead = TRUE; + } + /* if bit then unpack */ if (IS_BITVAR (retype)) - genUnpackBits (result, ifx); + { + genUnpackBits (result, right, ifx); + goto release; + } + + decodePointerOffset (right, &litOffset, &rematOffset); + + if (!pi && !ifx && size == 2 && IS_S08 && (IS_AOP_HX (AOP (result)) || AOP_TYPE (result) == AOP_EXT)) /* Todo: Use this for bigger sizes, too */ + { + loadRegIndexed (hc08_reg_hx, litOffset, rematOffset); + storeRegToAop (hc08_reg_hx, AOP (result), 0); + } + else if (!pi && !ifx && size == 1 && (IS_AOP_X (AOP (result)) || hc08_reg_x->isDead && !hc08_reg_a->isDead)) + { + loadRegIndexed (hc08_reg_x, litOffset, rematOffset); + storeRegToAop (hc08_reg_x, AOP (result), 0); + } else { - size = AOP_SIZE (result); - offset = size-1; + offset = size - 1; while (size--) { - accopWithMisc ("lda", ",x"); - if (size || pi) + xoffset = litOffset + (AOP_SIZE (result) - offset - 1); + if (!size && !pi && !ifx && AOP_TYPE (result) == AOP_REG && AOP (result)->aopu.aop_reg[offset] == hc08_reg_x) + { + loadRegIndexed (hc08_reg_x, xoffset, rematOffset); + continue; + } + loadRegIndexed (hc08_reg_a, xoffset, rematOffset); + if (!ifx && (pi || size) && AOP_TYPE (result) == AOP_REG && AOP (result)->aopu.aop_reg[offset] == hc08_reg_h) + { + pushReg(hc08_reg_a, FALSE); + postH = TRUE; + } + else if (!ifx && (pi || size) && AOP_TYPE (result) == AOP_REG && AOP (result)->aopu.aop_reg[offset] == hc08_reg_x) { - emitcode ("aix", "#1"); - hc08_dirtyReg (hc08_reg_hx, FALSE); + pushReg(hc08_reg_a, FALSE); + postX = TRUE; } - if (!ifx) + else if (!ifx && (pi || size) && AOP_TYPE (result) == AOP_REG && AOP (result)->aopu.aop_reg[offset] == hc08_reg_a) + { + pushReg(hc08_reg_a, FALSE); + postA = TRUE; + } + else if (!ifx) storeRegToAop (hc08_reg_a, AOP (result), offset); offset--; } } +release: + size = AOP_SIZE (result); freeAsmop (left, NULL, ic, TRUE); freeAsmop (result, NULL, ic, TRUE); - if (pi) { - aopOp (IC_RESULT (pi), pi, FALSE); - storeRegToAop (hc08_reg_hx, AOP (IC_RESULT (pi)), 0); - freeAsmop (IC_RESULT (pi), NULL, pi, TRUE); - pi->generated = 1; - } + if (pi) + { + emitcode ("aix", "#%d", size); + regalloc_dry_run_cost += 2; + hc08_dirtyReg (hc08_reg_hx, FALSE); + aopOp (IC_RESULT (pi), pi, FALSE); + storeRegToAop (hc08_reg_hx, AOP (IC_RESULT (pi)), 0); + freeAsmop (IC_RESULT (pi), NULL, pi, TRUE); + pi->generated = 1; + } + + if (postA) + pullReg (hc08_reg_a); + if (postX) + pullReg (hc08_reg_x); + if (postH) + pullReg (hc08_reg_h); + + pullOrFreeReg (hc08_reg_a, needpulla); if (ifx && !ifx->generated) { genIfxJump (ifx, "a"); } - - hc08_freeReg (hc08_reg_hx); - } /*-----------------------------------------------------------------*/ /* genPackBits - generates code for packed bit storage */ /*-----------------------------------------------------------------*/ static void -genPackBits (sym_link * etype, - operand * right) +genPackBits (operand * left, sym_link * etype, operand * right) { - int offset = 0; /* source byte offset */ - int rlen = 0; /* remaining bitfield length */ - int blen; /* bitfield length */ - int bstr; /* bitfield starting bit within byte */ - int litval; /* source literal value (if AOP_LIT) */ - unsigned char mask; /* bitmask within current byte */ - int xoffset = 0; + int offset = 0; /* source byte offset */ + int rlen = 0; /* remaining bitfield length */ + int blen; /* bitfield length */ + int bstr; /* bitfield starting bit within byte */ + int litval; /* source literal value (if AOP_LIT) */ + unsigned char mask; /* bitmask within current byte */ + int litOffset = 0; + char *rematOffset = NULL; - D(emitcode ("; genPackBits","")); + D (emitcode ("; genPackBits", "")); + decodePointerOffset (left, &litOffset, &rematOffset); blen = SPEC_BLEN (etype); bstr = SPEC_BSTR (etype); /* If the bitfield length is less than a byte */ if (blen < 8) { - mask = ((unsigned char) (0xFF << (blen + bstr)) | - (unsigned char) (0xFF >> (8 - bstr))); + mask = ((unsigned char) (0xFF << (blen + bstr)) | (unsigned char) (0xFF >> (8 - bstr))); if (AOP_TYPE (right) == AOP_LIT) { /* Case with a bitfield length <8 and literal source - */ + */ litval = (int) ulFromVal (AOP (right)->aopu.aop_lit); litval <<= bstr; litval &= (~mask) & 0xff; - emitcode ("lda", ",x"); - if ((mask|litval)!=0xff) - emitcode ("and","#0x%02x", mask); + loadRegIndexed (hc08_reg_a, litOffset, rematOffset); + if ((mask | litval) != 0xff) + { + emitcode ("and", "#0x%02x", mask); + regalloc_dry_run_cost += 2; + } if (litval) - emitcode ("ora","#0x%02x", litval); + { + emitcode ("ora", "#0x%02x", litval); + regalloc_dry_run_cost += 2; + } hc08_dirtyReg (hc08_reg_a, FALSE); - emitcode ("sta", ",x"); + storeRegIndexed (hc08_reg_a, litOffset, rematOffset); hc08_freeReg (hc08_reg_a); return; } /* Case with a bitfield length < 8 and arbitrary source - */ + */ loadRegFromAop (hc08_reg_a, AOP (right), 0); /* shift and mask source value */ AccLsh (bstr); emitcode ("and", "#0x%02x", (~mask) & 0xff); + regalloc_dry_run_cost += 2; hc08_dirtyReg (hc08_reg_a, FALSE); pushReg (hc08_reg_a, TRUE); - emitcode ("lda", ",x"); + loadRegIndexed (hc08_reg_a, litOffset, rematOffset); emitcode ("and", "#0x%02x", mask); emitcode ("ora", "1,s"); - emitcode ("sta", ",x"); + regalloc_dry_run_cost += 5; + storeRegIndexed (hc08_reg_a, litOffset, rematOffset); pullReg (hc08_reg_a); hc08_freeReg (hc08_reg_a); @@ -7461,17 +8730,18 @@ /* Bit length is greater than 7 bits. In this case, copy */ /* all except the partial byte at the end */ - for (rlen=blen;rlen>=8;rlen-=8) + for (rlen = blen; rlen >= 8; rlen -= 8) { - if (AOP (right)->type == AOP_DIR) + if (!litOffset && !rematOffset && AOP (right)->type == AOP_DIR) { - emitcode ("mov", "%s,x+", aopAdrStr(AOP (right), offset, FALSE)); - xoffset++; + emitcode ("mov", "%s,x+", aopAdrStr (AOP (right), offset, FALSE)); + regalloc_dry_run_cost += 2; + litOffset--; } else { loadRegFromAop (hc08_reg_a, AOP (right), offset); - emitcode ("sta", "%d,x", offset); + storeRegIndexed (hc08_reg_a, litOffset+offset, rematOffset); } offset++; } @@ -7479,38 +8749,45 @@ /* If there was a partial byte at the end */ if (rlen) { - mask = (((unsigned char) -1 << rlen) & 0xff); + mask = (((unsigned char) - 1 << rlen) & 0xff); if (AOP_TYPE (right) == AOP_LIT) { /* Case with partial byte and literal source - */ + */ litval = (int) ulFromVal (AOP (right)->aopu.aop_lit); - litval >>= (blen-rlen); + litval >>= (blen - rlen); litval &= (~mask) & 0xff; - emitcode ("lda", "%d,x", offset - xoffset); - hc08_dirtyReg (hc08_reg_a, FALSE); - if ((mask|litval)!=0xff) - emitcode ("and","#0x%02x", mask); + loadRegIndexed (hc08_reg_a, litOffset+offset, rematOffset); + if ((mask | litval) != 0xff) + { + emitcode ("and", "#0x%02x", mask); + regalloc_dry_run_cost += 2; + } if (litval) - emitcode ("ora","#0x%02x", litval); - emitcode ("sta", "%d,x", offset - xoffset); + { + emitcode ("ora", "#0x%02x", litval); + regalloc_dry_run_cost += 2; + } hc08_dirtyReg (hc08_reg_a, FALSE); + storeRegIndexed (hc08_reg_a, litOffset+offset, rematOffset); hc08_freeReg (hc08_reg_a); return; } /* Case with partial byte and arbitrary source - */ + */ loadRegFromAop (hc08_reg_a, AOP (right), offset); emitcode ("and", "#0x%02x", (~mask) & 0xff); + regalloc_dry_run_cost += 2; hc08_dirtyReg (hc08_reg_a, FALSE); pushReg (hc08_reg_a, TRUE); - emitcode ("lda", "%d,x", offset - xoffset); + loadRegIndexed(hc08_reg_a, litOffset+offset, rematOffset); emitcode ("and", "#0x%02x", mask); emitcode ("ora", "1,s"); - emitcode ("sta", "%d,x", offset - xoffset); + regalloc_dry_run_cost += 5; + storeRegIndexed (hc08_reg_a, litOffset+offset, rematOffset); pullReg (hc08_reg_a); } @@ -7521,26 +8798,31 @@ /* genPackBitsImmed - generates code for packed bit storage */ /*-----------------------------------------------------------------*/ static void -genPackBitsImmed (operand *result, sym_link * etype, operand * right, iCode * ic) +genPackBitsImmed (operand * result, operand * left, sym_link * etype, operand * right, iCode * ic) { asmop *derefaop; int size; - int offset = 0; /* source byte offset */ - int rlen = 0; /* remaining bitfield length */ - int blen; /* bitfield length */ - int bstr; /* bitfield starting bit within byte */ - int litval; /* source literal value (if AOP_LIT) */ - unsigned char mask; /* bitmask within current byte */ + int offset = 0; /* source byte offset */ + int rlen = 0; /* remaining bitfield length */ + int blen; /* bitfield length */ + int bstr; /* bitfield starting bit within byte */ + int litval; /* source literal value (if AOP_LIT) */ + unsigned char mask; /* bitmask within current byte */ + bool needpulla; + int litOffset = 0; + char *rematOffset = NULL; - D(emitcode ("; genPackBitsImmed","")); + D (emitcode ("; genPackBitsImmed", "")); blen = SPEC_BLEN (etype); bstr = SPEC_BSTR (etype); aopOp (right, ic, FALSE); size = AOP_SIZE (right); + decodePointerOffset (left, &litOffset, &rematOffset); + wassert (!rematOffset); - derefaop = aopDerefAop (AOP (result)); + derefaop = aopDerefAop (AOP (result), litOffset); freeAsmop (result, NULL, ic, TRUE); derefaop->size = size; @@ -7551,23 +8833,29 @@ { litval = (int) ulFromVal (AOP (right)->aopu.aop_lit); - emitcode ((litval & 1) ? "bset" : "bclr", - "#%d,%s", bstr, aopAdrStr (derefaop, 0, FALSE)); + emitcode ((litval & 1) ? "bset" : "bclr", "#%d,%s", bstr, aopAdrStr (derefaop, 0, FALSE)); + regalloc_dry_run_cost += 2; } else { - symbol *tlbl1 = newiTempLabel (NULL); - symbol *tlbl2 = newiTempLabel (NULL); + symbol *tlbl1 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); + symbol *tlbl2 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); + needpulla = pushRegIfSurv (hc08_reg_a); loadRegFromAop (hc08_reg_a, AOP (right), 0); - emitcode ("bit", "#1"); - emitBranch ("bne", tlbl1); + emitcode ("lsra", ""); + regalloc_dry_run_cost++; + emitBranch ("bcs", tlbl1); emitcode ("bclr", "#%d,%s", bstr, aopAdrStr (derefaop, 0, FALSE)); + regalloc_dry_run_cost += 2; emitBranch ("bra", tlbl2); - emitLabel (tlbl1); + if (!regalloc_dry_run) + emitLabel (tlbl1); emitcode ("bset", "#%d,%s", bstr, aopAdrStr (derefaop, 0, FALSE)); - emitLabel (tlbl2); - hc08_freeReg (hc08_reg_a); + regalloc_dry_run_cost += 2; + if (!regalloc_dry_run) + emitLabel (tlbl2); + pullOrFreeReg (hc08_reg_a, needpulla); } goto release; } @@ -7575,92 +8863,112 @@ /* If the bitfield length is less than a byte */ if (blen < 8) { - mask = ((unsigned char) (0xFF << (blen + bstr)) | - (unsigned char) (0xFF >> (8 - bstr))); + mask = ((unsigned char) (0xFF << (blen + bstr)) | (unsigned char) (0xFF >> (8 - bstr))); if (AOP_TYPE (right) == AOP_LIT) { /* Case with a bitfield length <8 and literal source - */ + */ litval = (int) ulFromVal (AOP (right)->aopu.aop_lit); litval <<= bstr; litval &= (~mask) & 0xff; + needpulla = pushRegIfSurv (hc08_reg_a); loadRegFromAop (hc08_reg_a, derefaop, 0); - if ((mask|litval)!=0xff) - emitcode ("and","#0x%02x", mask); + if ((mask | litval) != 0xff) + { + emitcode ("and", "#0x%02x", mask); + regalloc_dry_run_cost += 2; + } if (litval) - emitcode ("ora","#0x%02x", litval); + { + emitcode ("ora", "#0x%02x", litval); + regalloc_dry_run_cost += 2; + } hc08_dirtyReg (hc08_reg_a, FALSE); storeRegToAop (hc08_reg_a, derefaop, 0); - hc08_freeReg (hc08_reg_a); + pullOrFreeReg (hc08_reg_a, needpulla); goto release; } /* Case with a bitfield length < 8 and arbitrary source - */ + */ + needpulla = pushRegIfSurv (hc08_reg_a); loadRegFromAop (hc08_reg_a, AOP (right), 0); /* shift and mask source value */ AccLsh (bstr); emitcode ("and", "#0x%02x", (~mask) & 0xff); + regalloc_dry_run_cost += 2; hc08_dirtyReg (hc08_reg_a, FALSE); pushReg (hc08_reg_a, TRUE); loadRegFromAop (hc08_reg_a, derefaop, 0); emitcode ("and", "#0x%02x", mask); emitcode ("ora", "1,s"); + regalloc_dry_run_cost += 5; storeRegToAop (hc08_reg_a, derefaop, 0); pullReg (hc08_reg_a); - hc08_freeReg (hc08_reg_a); + pullOrFreeReg (hc08_reg_a, needpulla); goto release; } /* Bit length is greater than 7 bits. In this case, copy */ /* all except the partial byte at the end */ - for (rlen=blen;rlen>=8;rlen-=8) + for (rlen = blen; rlen >= 8; rlen -= 8) { - transferAopAop (AOP (right), offset, derefaop, size-offset-1); + transferAopAop (AOP (right), offset, derefaop, size - offset - 1); offset++; } /* If there was a partial byte at the end */ if (rlen) { - mask = (((unsigned char) -1 << rlen) & 0xff); + mask = (((unsigned char) - 1 << rlen) & 0xff); if (AOP_TYPE (right) == AOP_LIT) { /* Case with partial byte and literal source - */ + */ litval = (int) ulFromVal (AOP (right)->aopu.aop_lit); - litval >>= (blen-rlen); + litval >>= (blen - rlen); litval &= (~mask) & 0xff; - loadRegFromAop (hc08_reg_a, derefaop, size-offset-1); - if ((mask|litval)!=0xff) - emitcode ("and","#0x%02x", mask); + needpulla = pushRegIfSurv (hc08_reg_a); + loadRegFromAop (hc08_reg_a, derefaop, size - offset - 1); + if ((mask | litval) != 0xff) + { + emitcode ("and", "#0x%02x", mask); + regalloc_dry_run_cost += 2; + } if (litval) - emitcode ("ora","#0x%02x", litval); + { + emitcode ("ora", "#0x%02x", litval); + regalloc_dry_run_cost += 2; + } hc08_dirtyReg (hc08_reg_a, FALSE); - storeRegToAop (hc08_reg_a, derefaop, size-offset-1); + storeRegToAop (hc08_reg_a, derefaop, size - offset - 1); hc08_dirtyReg (hc08_reg_a, FALSE); - hc08_freeReg (hc08_reg_a); + pullOrFreeReg (hc08_reg_a, needpulla); goto release; } /* Case with partial byte and arbitrary source - */ + */ + needpulla = pushRegIfSurv (hc08_reg_a); loadRegFromAop (hc08_reg_a, AOP (right), offset); emitcode ("and", "#0x%02x", (~mask) & 0xff); + regalloc_dry_run_cost += 2; hc08_dirtyReg (hc08_reg_a, FALSE); pushReg (hc08_reg_a, TRUE); - loadRegFromAop (hc08_reg_a, derefaop, size-offset-1); + loadRegFromAop (hc08_reg_a, derefaop, size - offset - 1); emitcode ("and", "#0x%02x", mask); emitcode ("ora", "1,s"); - storeRegToAop (hc08_reg_a, derefaop, size-offset-1); + regalloc_dry_run_cost += 5; + storeRegToAop (hc08_reg_a, derefaop, size - offset - 1); pullReg (hc08_reg_a); + pullOrFreeReg (hc08_reg_a, needpulla); } hc08_freeReg (hc08_reg_a); @@ -7674,19 +8982,21 @@ /* genDataPointerSet - remat pointer to data space */ /*-----------------------------------------------------------------*/ static void -genDataPointerSet (operand * right, - operand * result, - iCode * ic) +genDataPointerSet (operand * left, operand * right, operand * result, iCode * ic) { int size; asmop *derefaop; + int litOffset = 0; + char *rematOffset = NULL; - D(emitcode ("; genDataPointerSet","")); + D (emitcode ("; genDataPointerSet", "")); aopOp (right, ic, FALSE); size = AOP_SIZE (right); + decodePointerOffset (left, &litOffset, &rematOffset); + wassert (!rematOffset); - derefaop = aopDerefAop (AOP (result)); + derefaop = aopDerefAop (AOP (result), litOffset); freeAsmop (result, NULL, ic, TRUE); derefaop->size = size; @@ -7704,19 +9014,20 @@ /* genPointerSet - stores the value into a pointer location */ /*-----------------------------------------------------------------*/ static void -genPointerSet (iCode * ic, iCode *pi) +genPointerSet (iCode * ic, iCode * pi) { + operand *left = IC_LEFT (ic); operand *right = IC_RIGHT (ic); operand *result = IC_RESULT (ic); - sym_link *type, *etype; int size, offset; sym_link *retype = getSpec (operandType (right)); sym_link *letype = getSpec (operandType (result)); + bool needpullx = FALSE; + bool needpullh = FALSE; + int litOffset = 0; + char *rematOffset = NULL; - D(emitcode ("; genPointerSet","")); - - type = operandType (result); - etype = getSpec (type); + D (emitcode ("; genPointerSet", "")); aopOp (result, ic, FALSE); @@ -7725,41 +9036,45 @@ { if (!IS_BITVAR (retype) && !IS_BITVAR (letype)) { - genDataPointerSet (right, result, ic); + genDataPointerSet (left, right, result, ic); return; } else { - genPackBitsImmed (result, (IS_BITVAR (retype) ? retype : letype), right, ic); + genPackBitsImmed (result, left, (IS_BITVAR (retype) ? retype : letype), right, ic); return; } } + if (AOP_TYPE (result) == AOP_REG && pi) + { + int i; + for (i = 0; i < AOP_SIZE (result); i++) + AOP (result)->aopu.aop_reg[i]->isDead = TRUE; + } + + needpullx = pushRegIfSurv (hc08_reg_x); + needpullh = pushRegIfSurv (hc08_reg_h); + /* if the operand is already in hx then we do nothing else we move the value to hx */ - if (AOP_TYPE (result) != AOP_STR) - { - loadRegFromAop (hc08_reg_hx, AOP (result), 0); - } + loadRegFromAop (hc08_reg_hx, AOP (result), 0); /* so hx now contains the address */ aopOp (right, ic, FALSE); + size = AOP_SIZE (right); /* if bit then unpack */ if (IS_BITVAR (retype) || IS_BITVAR (letype)) - genPackBits ((IS_BITVAR (retype) ? retype : letype), right); + genPackBits (left, (IS_BITVAR (retype) ? retype : letype), right); else { - size = AOP_SIZE (right); - offset = size-1; + decodePointerOffset (left, &litOffset, &rematOffset); + offset = size; - while (size--) + while (offset--) { - loadRegFromAop (hc08_reg_a, AOP (right), offset--); - accopWithMisc ("sta", ",x"); - if (size || pi) - { - emitcode ("aix", "#1"); - } + loadRegFromAop (hc08_reg_a, AOP (right), offset); + storeRegIndexed (hc08_reg_a, litOffset + size - offset - 1, rematOffset); hc08_freeReg (hc08_reg_a); } } @@ -7767,15 +9082,18 @@ freeAsmop (result, NULL, ic, TRUE); freeAsmop (right, NULL, ic, TRUE); - if (pi) { - aopOp (IC_RESULT (pi), pi, FALSE); - storeRegToAop (hc08_reg_hx, AOP (IC_RESULT (pi)), 0); - freeAsmop (IC_RESULT (pi), NULL, pi, TRUE); - pi->generated=1; - } - - hc08_freeReg (hc08_reg_hx); + if (pi) + { + aopOp (IC_RESULT (pi), pi, FALSE); + emitcode ("aix", "#%d", size); + hc08_dirtyReg (hc08_reg_hx, FALSE); + storeRegToAop (hc08_reg_hx, AOP (IC_RESULT (pi)), 0); + freeAsmop (IC_RESULT (pi), NULL, pi, TRUE); + pi->generated = 1; + } + pullOrFreeReg (hc08_reg_h, needpullh); + pullOrFreeReg (hc08_reg_x, needpullx); } /*-----------------------------------------------------------------*/ @@ -7787,7 +9105,7 @@ operand *cond = IC_COND (ic); int isbit = 0; - D(emitcode ("; genIfx","")); + D (emitcode ("; genIfx", "")); aopOp (cond, ic, FALSE); @@ -7828,8 +9146,7 @@ genIpop (popIc); /* if the condition is a bit variable */ - if (isbit && IS_ITEMP (cond) && - SPIL_LOC (cond)) + if (isbit && IS_ITEMP (cond) && SPIL_LOC (cond)) genIfxJump (ic, SPIL_LOC (cond)->rname); else if (isbit && !IS_ITEMP (cond)) genIfxJump (ic, OP_SYMBOL (cond)->rname); @@ -7847,8 +9164,9 @@ { symbol *sym = OP_SYMBOL (IC_LEFT (ic)); int size, offset; + bool needpullx, needpullh; - D(emitcode ("; genAddrOf","")); + D (emitcode ("; genAddrOf", "")); aopOp (IC_RESULT (ic), ic, FALSE); @@ -7857,24 +9175,31 @@ variable */ if (sym->onStack) { + needpullx = pushRegIfSurv (hc08_reg_x); + needpullh = pushRegIfSurv (hc08_reg_h); /* if it has an offset then we need to compute it */ offset = _G.stackOfs + _G.stackPushes + sym->stack; hc08_useReg (hc08_reg_hx); emitcode ("tsx", ""); + hc08_dirtyReg (hc08_reg_hx, FALSE); + regalloc_dry_run_cost++; while (offset > 127) { emitcode ("aix", "#127"); + regalloc_dry_run_cost += 2; offset -= 127; } while (offset < -128) { emitcode ("aix", "#-128"); + regalloc_dry_run_cost += 2; offset += 128; } emitcode ("aix", "#%d", offset); + regalloc_dry_run_cost += 2; storeRegToFullAop (hc08_reg_hx, AOP (IC_RESULT (ic)), FALSE); - hc08_freeReg (hc08_reg_hx); - + pullOrFreeReg (hc08_reg_h, needpullh); + pullOrFreeReg (hc08_reg_x, needpullx); goto release; } @@ -7884,8 +9209,9 @@ while (size--) { - char s[SDCC_NAME_MAX+10]; - switch (offset) { + char s[SDCC_NAME_MAX + 10]; + switch (offset) + { case 0: sprintf (s, "#%s", sym->rname); break; @@ -7893,11 +9219,9 @@ sprintf (s, "#>%s", sym->rname); break; default: - sprintf (s, "#(%s >> %d)", - sym->rname, - offset * 8); - } - storeConstToAop(s, AOP (IC_RESULT (ic)), offset++); + sprintf (s, "#(%s >> %d)", sym->rname, offset * 8); + } + storeConstToAop (s, AOP (IC_RESULT (ic)), offset++); } release: @@ -7911,41 +9235,17 @@ genAssign (iCode * ic) { operand *result, *right; - int size; -// unsigned long lit = 0L; - D(emitcode("; genAssign","")); + D (emitcode ("; genAssign", "")); result = IC_RESULT (ic); right = IC_RIGHT (ic); - - /* if they are the same */ - if (operandsEqu (result, right)) { - return; - } - + aopOp (right, ic, FALSE); aopOp (result, ic, TRUE); - /* if they are the same registers */ - if (sameRegs (AOP (right), AOP (result))) - goto release; - - if ((AOP_TYPE (right) == AOP_LIT) - && (IS_AOP_HX(AOP(result)))) - { - loadRegFromAop(hc08_reg_hx, AOP (right), 0); - goto release; - } + genCopy (result, right); - /* general case */ - size = AOP_SIZE (result); - while (size--) - { - transferAopAop (AOP (right), size, AOP (result), size); - } - -release: freeAsmop (right, NULL, ic, TRUE); freeAsmop (result, NULL, ic, TRUE); } @@ -7957,58 +9257,73 @@ genJumpTab (iCode * ic) { symbol *jtab; - symbol *jtablo = newiTempLabel (NULL); - symbol *jtabhi = newiTempLabel (NULL); + symbol *jtablo = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); + symbol *jtabhi = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); - D(emitcode ("; genJumpTab","")); + D (emitcode ("; genJumpTab", "")); aopOp (IC_JTCOND (ic), ic, FALSE); - if (hc08_reg_x->isFree && hc08_reg_x->isFree) + if (hc08_reg_x->isFree && hc08_reg_h->isFree) { /* get the condition into x */ loadRegFromAop (hc08_reg_x, AOP (IC_JTCOND (ic)), 0); freeAsmop (IC_JTCOND (ic), NULL, ic, TRUE); loadRegFromConst (hc08_reg_h, zero); - emitcode ("lda", "%05d$,x", jtabhi->key + 100); - emitcode ("ldx", "%05d$,x", jtablo->key + 100); + if (!regalloc_dry_run) + { + emitcode ("lda", "%05d$,x", labelKey2num (jtabhi->key)); + emitcode ("ldx", "%05d$,x", labelKey2num (jtablo->key)); + } + regalloc_dry_run_cost += 6; transferRegReg (hc08_reg_a, hc08_reg_h, TRUE); emitcode ("jmp", ",x"); + regalloc_dry_run_cost++; hc08_dirtyReg (hc08_reg_a, TRUE); hc08_dirtyReg (hc08_reg_hx, TRUE); } else { - adjustStack(-2); - pushReg(hc08_reg_hx, TRUE); + adjustStack (-2); + pushReg (hc08_reg_hx, TRUE); /* get the condition into x */ loadRegFromAop (hc08_reg_x, AOP (IC_JTCOND (ic)), 0); freeAsmop (IC_JTCOND (ic), NULL, ic, TRUE); loadRegFromConst (hc08_reg_h, zero); - emitcode ("lda", "%05d$,x", jtabhi->key + 100); + if (!regalloc_dry_run) + emitcode ("lda", "%05d$,x", labelKey2num (jtabhi->key)); emitcode ("sta", "3,s"); - emitcode ("lda", "%05d$,x", jtablo->key + 100); + if (!regalloc_dry_run) + emitcode ("lda", "%05d$,x", labelKey2num (jtablo->key)); emitcode ("sta", "4,s"); + regalloc_dry_run_cost += 12; - pullReg(hc08_reg_hx); + pullReg (hc08_reg_hx); emitcode ("rts", ""); - _G.stackPushes += 2; - updateCFA(); + regalloc_dry_run_cost++; + _G.stackPushes -= 2; + updateCFA (); } /* now generate the jump labels */ - emitLabel (jtablo); - for (jtab = setFirstItem (IC_JTLABELS (ic)); jtab; - jtab = setNextItem (IC_JTLABELS (ic))) - emitcode (".db", "%05d$", jtab->key + 100); - emitLabel (jtabhi); - for (jtab = setFirstItem (IC_JTLABELS (ic)); jtab; - jtab = setNextItem (IC_JTLABELS (ic))) - emitcode (".db", ">%05d$", jtab->key + 100); + if (!regalloc_dry_run) + emitLabel (jtablo); + for (jtab = setFirstItem (IC_JTLABELS (ic)); jtab; jtab = setNextItem (IC_JTLABELS (ic))) + { + emitcode (".db", "%05d$", labelKey2num (jtab->key)); + regalloc_dry_run_cost++; + } + if (!regalloc_dry_run) + emitLabel (jtabhi); + for (jtab = setFirstItem (IC_JTLABELS (ic)); jtab; jtab = setNextItem (IC_JTLABELS (ic))) + { + emitcode (".db", ">%05d$", labelKey2num (jtab->key)); + regalloc_dry_run_cost++; + } } /*-----------------------------------------------------------------*/ @@ -8018,12 +9333,13 @@ genCast (iCode * ic) { operand *result = IC_RESULT (ic); - sym_link *ctype = operandType (IC_LEFT (ic)); sym_link *rtype = operandType (IC_RIGHT (ic)); operand *right = IC_RIGHT (ic); int size, offset; + bool signExtend; + bool save_a; - D(emitcode("; genCast","")); + D (emitcode ("; genCast", "")); /* if they are equivalent then do nothing */ if (operandsEqu (IC_RESULT (ic), IC_RIGHT (ic))) @@ -8034,100 +9350,129 @@ if (IS_BOOL (operandType (result))) { + bool needpulla = pushRegIfSurv (hc08_reg_a); asmopToBool (AOP (right), TRUE); storeRegToAop (hc08_reg_a, AOP (result), 0); + pullOrFreeReg (hc08_reg_a, needpulla); goto release; } - /* if they are the same size : or less */ - if (AOP_SIZE (result) <= AOP_SIZE (right)) + /* If the result is 1 byte, then just copy the one byte; there is */ + /* nothing special required. */ + if (AOP_SIZE (result) == 1) { - /* if they are in the same place */ - #if 0 - if (sameRegs (AOP (right), AOP (result))) - goto release; - #endif - - /* if they in different places then copy */ - size = AOP_SIZE (result); - offset = 0; - while (size--) - { - transferAopAop(AOP (right), offset, AOP (result), offset); - offset++; - } + transferAopAop (AOP (right), 0, AOP (result), 0); goto release; } - /* if the result is of type pointer */ - if (IS_PTR (ctype)) + signExtend = AOP_SIZE (result) > AOP_SIZE (right) && IS_SPEC (rtype) && !SPEC_USIGN (rtype); + + /* If the result is 2 bytes and in registers, we have to be careful */ + /* to make sure the registers are not overwritten prematurely. */ + if (AOP_SIZE (result) == 2 && AOP (result)->type == AOP_REG) { - int p_type; - sym_link *type = operandType (right); - sym_link *etype = getSpec (type); + if (IS_AOP_HX (AOP (result)) && (AOP_SIZE (right) == 2)) + { + loadRegFromAop (hc08_reg_hx, AOP (right), 0); + goto release; + } - /* pointer to generic pointer */ - if (IS_GENPTR (ctype)) + if (AOP_SIZE (right) == 1) { - if (IS_PTR (type)) - p_type = DCL_TYPE (type); + transferAopAop (AOP (right), 0, AOP (result), 0); + if (!signExtend) + storeConstToAop (zero, AOP (result), 1); else { - if (SPEC_SCLS(etype)==S_REGISTER) { - // let's assume it is a generic pointer - p_type=GPOINTER; - } else { - /* we have to go by the storage class */ - p_type = PTR_TYPE (SPEC_OCLS (etype)); - } + save_a = (AOP (result)->aopu.aop_reg[0] == hc08_reg_a || !hc08_reg_a->isDead); + + /* we need to extend the sign :{ */ + if (save_a) + pushReg(hc08_reg_a, FALSE); + if (AOP (result)->aopu.aop_reg[0] != hc08_reg_a) + loadRegFromAop (hc08_reg_a, AOP (right), 0); + accopWithMisc ("rola", ""); + accopWithMisc ("clra", ""); + accopWithMisc ("sbc", zero); + storeRegToAop (hc08_reg_a, AOP (result), 1); + if (save_a) + pullReg(hc08_reg_a); } + goto release; + } - /* the first two bytes are known */ - size = GPTRSIZE - 1; - offset = 0; - while (size--) + if (AOP (right)->type == AOP_REG) + { + wassert (AOP_SIZE (right) == 2); + /* Source and destination are the same size; no need for sign */ + /* extension or zero padding. Just copy in the order that */ + /* won't prematurely overwrite the source. */ + if (AOP (result)->aopu.aop_reg[0] == AOP (right)->aopu.aop_reg[1]) { - transferAopAop(AOP (right), offset, AOP (result), offset); - offset++; + transferAopAop (AOP (right), 1, AOP (result), 1); + transferAopAop (AOP (right), 0, AOP (result), 0); + } + else + { + transferAopAop (AOP (right), 0, AOP (result), 0); + transferAopAop (AOP (right), 1, AOP (result), 1); } - /* the last byte depending on type */ goto release; } - - /* just copy the pointers */ - size = AOP_SIZE (result); - offset = 0; - while (size--) + else { - transferAopAop(AOP (right), offset, AOP (result), offset); - offset++; + /* Source is at least 2 bytes and not in registers; no need */ + /* for sign extension or zero padding. Just copy. */ + transferAopAop (AOP (right), 0, AOP (result), 0); + transferAopAop (AOP (right), 1, AOP (result), 1); + goto release; } - goto release; } - /* so we now know that the size of destination is greater - than the size of the source */ - /* we move to result for the size of source */ - size = AOP_SIZE (right); + wassert (AOP (result)->type != AOP_REG); + + save_a = !hc08_reg_a->isDead && signExtend; + if (save_a) + pushReg(hc08_reg_a, TRUE); + offset = 0; - while (size--) + size = AOP_SIZE (right); + if (AOP_SIZE (result) < size) + size = AOP_SIZE (result); + while (size) { - transferAopAop(AOP (right), offset, AOP (result), offset); - offset++; + if (size == 1 && signExtend) + { + loadRegFromAop (hc08_reg_a, AOP (right), offset); + storeRegToAop (hc08_reg_a, AOP (result), offset); + offset++; + size--; + } + else if ((size > 2 || size >= 2 && !signExtend) && hc08_reg_h->isDead && hc08_reg_x->isDead && + (AOP_TYPE (right) == AOP_IMMD || IS_S08 && AOP_TYPE (right) == AOP_EXT) && + (AOP_TYPE (result) == AOP_DIR || IS_S08 && AOP_TYPE (result) == AOP_EXT)) + { + loadRegFromAop (hc08_reg_hx, AOP (right), offset); + storeRegToAop (hc08_reg_hx, AOP (result), offset); + offset += 2; + size -= 2; + } + else + { + transferAopAop (AOP (right), offset, AOP (result), offset); + offset++; + size--; + } } - /* now depending on the sign of the source && destination */ - size = AOP_SIZE (result) - AOP_SIZE (right); - /* if unsigned or not an integral type */ - if (!IS_SPEC (rtype) || SPEC_USIGN (rtype) || AOP_TYPE(right)==AOP_CRY) + size = AOP_SIZE (result) - offset; + if (size && !signExtend) { while (size--) storeConstToAop (zero, AOP (result), offset++); } - else + else if (size) { - /* we need to extend the sign :{ */ - loadRegFromAop (hc08_reg_a, AOP (right), AOP_SIZE (right) -1); accopWithMisc ("rola", ""); accopWithMisc ("clra", ""); accopWithMisc ("sbc", zero); @@ -8135,6 +9480,9 @@ storeRegToAop (hc08_reg_a, AOP (result), offset++); } + if (save_a) + pullReg(hc08_reg_a); + /* we are done hurray !!!! */ release: @@ -8153,7 +9501,7 @@ if (!ifx) return 0; - D(emitcode ("; genDjnz","")); + D (emitcode ("; genDjnz", "")); /* if the if condition has a false label then we cannot save */ @@ -8162,8 +9510,7 @@ /* if the minus is not of the form a = a - 1 */ - if (!isOperandEqual (IC_RESULT (ic), IC_LEFT (ic)) || - !IS_OP_LITERAL (IC_RIGHT (ic))) + if (!isOperandEqual (IC_RESULT (ic), IC_LEFT (ic)) || !IS_OP_LITERAL (IC_RIGHT (ic))) return 0; if (operandLitValue (IC_RIGHT (ic)) != 1) @@ -8178,24 +9525,41 @@ // if (getSize (operandType (IC_RESULT (ic))) > 1) // return 0; aopOp (IC_RESULT (ic), ic, FALSE); - if (AOP_SIZE (IC_RESULT (ic))>1) + if (AOP_SIZE (IC_RESULT (ic)) > 1 || IS_AOP_H (AOP (IC_RESULT (ic)))) { freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); return 0; } /* otherwise we can save BIG */ - lbl = newiTempLabel (NULL); - lbl1 = newiTempLabel (NULL); - + lbl = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); + lbl1 = (regalloc_dry_run ? 0 : newiTempLabel (NULL)); - emitcode ("dbnz", "%s,%05d$", aopAdrStr (AOP (IC_RESULT (ic)), 0, FALSE), - lbl->key + 100); + if (IS_AOP_A (AOP (IC_RESULT (ic)))) + { + if (!regalloc_dry_run) + emitcode ("dbnza", "%05d$", labelKey2num (lbl->key)); + regalloc_dry_run_cost += 2; + } + else if (IS_AOP_X (AOP (IC_RESULT (ic)))) + { + if (!regalloc_dry_run) + emitcode ("dbnzx", "%05d$", labelKey2num (lbl->key)); + regalloc_dry_run_cost += 2; + } + else + { + if (!regalloc_dry_run) + emitcode ("dbnz", "%s,%05d$", aopAdrStr (AOP (IC_RESULT (ic)), 0, FALSE), labelKey2num (lbl->key)); + regalloc_dry_run_cost += 3; // TODO: Stack aop cost. + } emitBranch ("bra", lbl1); - emitLabel (lbl); + if (!regalloc_dry_run) + emitLabel (lbl); emitBranch ("jmp", IC_TRUE (ifx)); - emitLabel (lbl1); + if (!regalloc_dry_run) + emitLabel (lbl1); freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); ifx->generated = 1; @@ -8210,21 +9574,40 @@ { int size; int offset; - D(emitcode ("; genReceive","")); + bool delayed_x = FALSE; + + D (emitcode (";", "genReceive")); aopOp (IC_RESULT (ic), ic, FALSE); size = AOP_SIZE (IC_RESULT (ic)); offset = 0; - if (ic->argreg) { - while (size--) { - transferAopAop( hc08_aop_pass[offset+(ic->argreg-1)], 0, - AOP (IC_RESULT (ic)), offset); + if (ic->argreg && IS_AOP_HX (AOP (IC_RESULT (ic))) && (offset + (ic->argreg - 1)) == 0) + { + pushReg (hc08_reg_x, TRUE); + emitcode ("tax", ""); + regalloc_dry_run_cost++; + pullReg (hc08_reg_h); + } + else if (ic->argreg) + { + while (size--) + { + if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG && !(offset + (ic->argreg - 1)) && AOP (IC_RESULT (ic))->aopu.aop_reg[0]->rIdx == X_IDX && size) + { + pushReg (hc08_reg_a, TRUE); + delayed_x = TRUE; + } + else + transferAopAop (hc08_aop_pass[offset + (ic->argreg - 1)], 0, AOP (IC_RESULT (ic)), offset); if (hc08_aop_pass[offset]->type == AOP_REG) hc08_freeReg (hc08_aop_pass[offset]->aopu.aop_reg[0]); offset++; - } - } + } + } + + if (delayed_x) + pullReg (hc08_reg_x); freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); } @@ -8237,27 +9620,30 @@ { operand *op; int size, offset; + bool needpulla; - D(emitcode("; genDummyRead","")); + D (emitcode ("; genDummyRead", "")); op = IC_RIGHT (ic); + + needpulla = pushRegIfSurv (hc08_reg_a); if (op && IS_SYMOP (op)) { aopOp (op, ic, FALSE); size = AOP_SIZE (op); - offset = 0; + offset = size - 1; while (size--) { loadRegFromAop (hc08_reg_a, AOP (op), offset); hc08_freeReg (hc08_reg_a); - offset++; + offset--; } freeAsmop (op, NULL, ic, TRUE); - } + } op = IC_LEFT (ic); if (op && IS_SYMOP (op)) { @@ -8265,33 +9651,36 @@ aopOp (op, ic, FALSE); size = AOP_SIZE (op); - offset = 0; + offset = size - 1; while (size--) { loadRegFromAop (hc08_reg_a, AOP (op), offset); hc08_freeReg (hc08_reg_a); - offset++; + offset--; } freeAsmop (op, NULL, ic, TRUE); - } + } + pullOrFreeReg (hc08_reg_a, needpulla); } /*-----------------------------------------------------------------*/ /* genCritical - generate code for start of a critical sequence */ /*-----------------------------------------------------------------*/ static void -genCritical (iCode *ic) +genCritical (iCode * ic) { - D(emitcode("; genCritical","")); + D (emitcode ("; genCritical", "")); if (IC_RESULT (ic)) aopOp (IC_RESULT (ic), ic, TRUE); emitcode ("tpa", ""); + regalloc_dry_run_cost++; hc08_dirtyReg (hc08_reg_a, FALSE); emitcode ("sei", ""); + regalloc_dry_run_cost++; if (IC_RESULT (ic)) storeRegToAop (hc08_reg_a, AOP (IC_RESULT (ic)), 0); @@ -8307,15 +9696,16 @@ /* genEndCritical - generate code for end of a critical sequence */ /*-----------------------------------------------------------------*/ static void -genEndCritical (iCode *ic) +genEndCritical (iCode * ic) { - D(emitcode("; genEndCritical","")); + D (emitcode ("; genEndCritical", "")); if (IC_RIGHT (ic)) { aopOp (IC_RIGHT (ic), ic, FALSE); loadRegFromAop (hc08_reg_a, AOP (IC_RIGHT (ic)), 0); emitcode ("tap", ""); + regalloc_dry_run_cost++; hc08_freeReg (hc08_reg_a); freeAsmop (IC_RIGHT (ic), NULL, ic, TRUE); } @@ -8323,380 +9713,479 @@ { pullReg (hc08_reg_a); emitcode ("tap", ""); + regalloc_dry_run_cost++; } } - - -/*-----------------------------------------------------------------*/ -/* genhc08Code - generate code for HC08 based controllers */ -/*-----------------------------------------------------------------*/ -void -genhc08Code (iCode * lic) +static void +updateiTempRegisterUse (operand * op) { - iCode *ic; - int cln = 0; - int clevel = 0; - int cblock = 0; - - lineHead = lineCurr = NULL; + symbol *sym; - /* print the allocation information */ - if (allocInfo && currFunc) - printAllocInfo (currFunc, codeOutBuf); - /* if debug information required */ - if (options.debug && currFunc) + if (IS_ITEMP (op)) { - debugFile->writeFunction (currFunc, lic); - #if 0 - _G.debugLine = 1; - if (IS_STATIC (currFunc->etype)) - emitcode ("", "F%s$%s$0$0 ==.", moduleName, currFunc->name); - else - emitcode ("", "G$%s$0$0 ==.", currFunc->name); - _G.debugLine = 0; - #endif + sym = OP_SYMBOL (op); + if (!sym->isspilt) + { + /* If only used by IFX, there might not be any register assigned */ + int i; + for(i = 0; i < sym->nRegs; i++) + if (sym->regs[i]) + hc08_useReg (sym->regs[i]); + } } - /* stack pointer name */ - if (options.useXstack) - spname = "_spx"; - else - spname = "sp"; - - debugFile->writeFrameAddress (NULL, NULL, 0); /* have no idea where frame is now */ - - hc08_aop_pass[0] = newAsmop (AOP_REG); - hc08_aop_pass[0]->size=1; - hc08_aop_pass[0]->aopu.aop_reg[0] = hc08_reg_a; - hc08_aop_pass[1] = newAsmop (AOP_REG); - hc08_aop_pass[1]->size=1; - hc08_aop_pass[1]->aopu.aop_reg[0] = hc08_reg_x; - hc08_aop_pass[2] = newAsmop (AOP_DIR); - hc08_aop_pass[2]->size=1; - hc08_aop_pass[2]->aopu.aop_dir = "__ret2"; - hc08_aop_pass[3] = newAsmop (AOP_DIR); - hc08_aop_pass[3]->size=1; - hc08_aop_pass[3]->aopu.aop_dir = "__ret3"; +} - for (ic = lic; ic; ic = ic->next) - { +/*---------------------------------------------------------------------------------------*/ +/* genhc08iode - generate code for HC08 based controllers for a single iCode instruction */ +/*---------------------------------------------------------------------------------------*/ +static void +genhc08iCode (iCode *ic) +{ + /* if the result is marked as + spilt and rematerializable or code for + this has already been generated then + do nothing */ + if (resultRemat (ic) || ic->generated) + return; - _G.current_iCode = ic; + { + int i; + reg_info *reg; - if (ic->level != clevel || ic->block != cblock) - { - if (options.debug) - { - debugFile->writeScope(ic); - } - clevel = ic->level; - cblock = ic->block; - } + initGenLineElement (); + genLine.lineElement.ic = ic; - if (ic->lineno && cln != ic->lineno) - { - if (options.debug) - { - debugFile->writeCLine(ic); - #if 0 - _G.debugLine = 1; - emitcode ("", "C$%s$%d$%d$%d ==.", - FileBaseName (ic->filename), ic->lineno, - ic->level, ic->block); - _G.debugLine = 0; - #endif - } - if (!options.noCcodeInAsm) { - emitcode ("", ";%s:%d: %s", ic->filename, ic->lineno, - printCLine(ic->filename, ic->lineno)); - } - cln = ic->lineno; - } - if (options.iCodeInAsm) { - char regsInUse[80]; - int i; - const char *iLine; - - for (i=0; i<6; i++) { - sprintf (®sInUse[i], - "%c", ic->riu & (1<seq, printILine(ic)); - dbuf_free(iLine); + for (i = A_IDX; i <= XA_IDX; i++) + { + reg = hc08_regWithIdx (i); + //if (reg->aop) + // emitcode ("", "; %s = %s offset %d", reg->name, aopName (reg->aop), reg->aopofs); + reg->isFree = TRUE; } - /* if the result is marked as - spilt and rematerializable or code for - this has already been generated then - do nothing */ - if (resultRemat (ic) || ic->generated) - continue; + if (ic->op == IFX) + updateiTempRegisterUse (IC_COND (ic)); + else if (ic->op == JUMPTABLE) + updateiTempRegisterUse (IC_JTCOND (ic)); + else if (ic->op == RECEIVE) + { + hc08_useReg (hc08_reg_a); + hc08_useReg (hc08_reg_x); // TODO: x really is free if function only receives 1 byte + } + else { - int i; - reg_info *reg; - symbol *sym; + if (POINTER_SET (ic)) + updateiTempRegisterUse (IC_RESULT (ic)); + updateiTempRegisterUse (IC_LEFT (ic)); + updateiTempRegisterUse (IC_RIGHT (ic)); + } - for (i=A_IDX;i<=XA_IDX;i++) - { - reg = hc08_regWithIdx(i); - if (reg->aop) - emitcode("","; %s = %s offset %d", reg->name, - aopName(reg->aop), reg->aopofs); - reg->isFree = TRUE; - } - if (IC_LEFT (ic) && IS_ITEMP (IC_LEFT (ic))) - { - sym = OP_SYMBOL (IC_LEFT (ic)); - if (sym->accuse == ACCUSE_HX) - { - hc08_reg_h->isFree = FALSE; - hc08_reg_x->isFree = FALSE; - } - else if (sym->accuse == ACCUSE_XA) - { - hc08_reg_a->isFree = FALSE; - if (sym->nRegs>1) - hc08_reg_x->isFree = FALSE; - } - } - if (IC_RIGHT (ic) && IS_ITEMP (IC_RIGHT (ic))) + for (i = A_IDX; i <= H_IDX; i++) + { + if (bitVectBitValue (ic->rSurv, i)) { - sym = OP_SYMBOL (IC_RIGHT (ic)); - if (sym->accuse == ACCUSE_HX) - { - hc08_reg_h->isFree = FALSE; - hc08_reg_x->isFree = FALSE; - } - else if (sym->accuse == ACCUSE_XA) - { - hc08_reg_a->isFree = FALSE; - if (sym->nRegs>1) - hc08_reg_x->isFree = FALSE; - } + hc08_regWithIdx (i)->isDead = FALSE; + hc08_regWithIdx (i)->isFree = FALSE; } + else + hc08_regWithIdx (i)->isDead = TRUE; } + } - /* depending on the operation */ - switch (ic->op) - { - case '!': - genNot (ic); - break; + /* depending on the operation */ + switch (ic->op) + { + case '!': + genNot (ic); + break; - case '~': - genCpl (ic); - break; + case '~': + genCpl (ic); + break; - case UNARYMINUS: + case UNARYMINUS: genUminus (ic); break; - case IPUSH: + case IPUSH: genIpush (ic); break; - case IPOP: - /* IPOP happens only when trying to restore a - spilt live range, if there is an ifx statement - following this pop then the if statement might - be using some of the registers being popped which - would destory the contents of the register so - we need to check for this condition and handle it */ - if (ic->next && - ic->next->op == IFX && - regsInCommon (IC_LEFT (ic), IC_COND (ic->next))) - genIfx (ic->next, ic); - else - genIpop (ic); - break; + case IPOP: + /* IPOP happens only when trying to restore a + spilt live range, if there is an ifx statement + following this pop then the if statement might + be using some of the registers being popped which + would destory the contents of the register so + we need to check for this condition and handle it */ + if (ic->next && ic->next->op == IFX && regsInCommon (IC_LEFT (ic), IC_COND (ic->next))) + genIfx (ic->next, ic); + else + genIpop (ic); + break; - case CALL: - genCall (ic); - break; + case CALL: + genCall (ic); + break; - case PCALL: - genPcall (ic); - break; + case PCALL: + genPcall (ic); + break; - case FUNCTION: - genFunction (ic); - break; + case FUNCTION: + genFunction (ic); + break; - case ENDFUNCTION: - genEndFunction (ic); - break; + case ENDFUNCTION: + genEndFunction (ic); + break; - case RETURN: - genRet (ic); - break; + case RETURN: + genRet (ic); + break; - case LABEL: - genLabel (ic); - break; + case LABEL: + genLabel (ic); + break; - case GOTO: - genGoto (ic); - break; + case GOTO: + genGoto (ic); + break; - case '+': - if (!genPointerGetSetOfs (ic)) - genPlus (ic); - break; + case '+': + genPlus (ic); + break; - case '-': - if (!genDjnz (ic, ifxForOp (IC_RESULT (ic), ic))) - genMinus (ic); - break; + case '-': + if (!genDjnz (ic, ifxForOp (IC_RESULT (ic), ic))) + genMinus (ic); + break; - case '*': - genMult (ic); - break; + case '*': + genMult (ic); + break; - case '/': - genDiv (ic); - break; + case '/': + genDiv (ic); + break; - case '%': - genMod (ic); - break; + case '%': + genMod (ic); + break; - case '>': - case '<': - case LE_OP: - case GE_OP: - genCmp (ic, ifxForOp (IC_RESULT (ic), ic)); - break; + case '>': + case '<': + case LE_OP: + case GE_OP: + genCmp (ic, ifxForOp (IC_RESULT (ic), ic)); + break; - case NE_OP: - case EQ_OP: - genCmpEQorNE (ic, ifxForOp (IC_RESULT (ic), ic)); - break; + case NE_OP: + case EQ_OP: + genCmpEQorNE (ic, ifxForOp (IC_RESULT (ic), ic)); + break; - case AND_OP: - genAndOp (ic); - break; + case AND_OP: + genAndOp (ic); + break; - case OR_OP: - genOrOp (ic); - break; + case OR_OP: + genOrOp (ic); + break; - case '^': - genXor (ic, ifxForOp (IC_RESULT (ic), ic)); - break; + case '^': + genXor (ic, ifxForOp (IC_RESULT (ic), ic)); + break; - case '|': - genOr (ic, ifxForOp (IC_RESULT (ic), ic)); - break; + case '|': + genOr (ic, ifxForOp (IC_RESULT (ic), ic)); + break; - case BITWISEAND: - genAnd (ic, ifxForOp (IC_RESULT (ic), ic)); - break; + case BITWISEAND: + genAnd (ic, ifxForOp (IC_RESULT (ic), ic)); + break; - case INLINEASM: - genInline (ic); - break; + case INLINEASM: + hc08_genInline (ic); + break; - case RRC: - genRRC (ic); - break; + case RRC: + genRRC (ic); + break; - case RLC: - genRLC (ic); - break; + case RLC: + genRLC (ic); + break; - case GETHBIT: - genGetHbit (ic); - break; + case GETHBIT: + genGetHbit (ic); + break; - case LEFT_OP: - genLeftShift (ic); - break; + case GETABIT: + genGetAbit (ic); + break; - case RIGHT_OP: - genRightShift (ic); - break; + case GETBYTE: + genGetByte (ic); + break; - case GET_VALUE_AT_ADDRESS: - genPointerGet (ic, - hasInc (IC_LEFT (ic), ic, - getSize (operandType (IC_RESULT (ic)))), - ifxForOp (IC_RESULT (ic), ic) ); - break; + case GETWORD: + genGetWord (ic); + break; - case '=': - if (POINTER_SET (ic)) - genPointerSet (ic, hasInc (IC_RESULT(ic),ic,getSize(operandType(IC_RIGHT(ic))))); - else - genAssign (ic); - break; + case LEFT_OP: + genLeftShift (ic); + break; - case IFX: - genIfx (ic, NULL); - break; + case RIGHT_OP: + genRightShift (ic); + break; - case ADDRESS_OF: - genAddrOf (ic); - break; + case GET_VALUE_AT_ADDRESS: + genPointerGet (ic, hasInchc08 (IC_LEFT (ic), ic, getSize (operandType (IC_RESULT (ic)))), ifxForOp (IC_RESULT (ic), ic)); + break; - case JUMPTABLE: - genJumpTab (ic); - break; + case '=': + if (POINTER_SET (ic)) + genPointerSet (ic, hasInchc08 (IC_RESULT (ic), ic, getSize (operandType (IC_RIGHT (ic))))); + else + genAssign (ic); + break; - case CAST: - genCast (ic); - break; + case IFX: + genIfx (ic, NULL); + break; - case RECEIVE: - genReceive (ic); - break; + case ADDRESS_OF: + genAddrOf (ic); + break; - case SEND: - addSet (&_G.sendSet, ic); - break; + case JUMPTABLE: + genJumpTab (ic); + break; - case DUMMY_READ_VOLATILE: - genDummyRead (ic); - break; + case CAST: + genCast (ic); + break; - case CRITICAL: - genCritical (ic); - break; + case RECEIVE: + genReceive (ic); + break; - case ENDCRITICAL: - genEndCritical (ic); - break; + case SEND: + if (!regalloc_dry_run) + addSet (&_G.sendSet, ic); + else + { + set * sendSet = NULL; + addSet (&sendSet, ic); + genSend (sendSet); + deleteSet (&sendSet); + } + break; - case SWAP: - genSwap (ic); - break; + case DUMMY_READ_VOLATILE: + genDummyRead (ic); + break; - default: - ic = ic; + case CRITICAL: + genCritical (ic); + break; + + case ENDCRITICAL: + genEndCritical (ic); + break; + + case SWAP: + genSwap (ic); + break; + + default: + wassertl (0, "Unknown iCode"); + } +} + +unsigned char +dryhc08iCode (iCode *ic) +{ + regalloc_dry_run = TRUE; + regalloc_dry_run_cost = 0; + + hc08_aop_pass[0] = newAsmop (AOP_REG); + hc08_aop_pass[0]->size = 1; + hc08_aop_pass[0]->aopu.aop_reg[0] = hc08_reg_a; + hc08_aop_pass[1] = newAsmop (AOP_REG); + hc08_aop_pass[1]->size = 1; + hc08_aop_pass[1]->aopu.aop_reg[0] = hc08_reg_x; + hc08_aop_pass[2] = newAsmop (AOP_DIR); + hc08_aop_pass[2]->size = 1; + hc08_aop_pass[2]->aopu.aop_dir = "___SDCC_hc08_ret2"; + hc08_aop_pass[3] = newAsmop (AOP_DIR); + hc08_aop_pass[3]->size = 1; + hc08_aop_pass[3]->aopu.aop_dir = "___SDCC_hc08_ret3"; + hc08_aop_pass[4] = newAsmop (AOP_DIR); + hc08_aop_pass[4]->size = 1; + hc08_aop_pass[4]->aopu.aop_dir = "___SDCC_hc08_ret4"; + hc08_aop_pass[5] = newAsmop (AOP_DIR); + hc08_aop_pass[5]->size = 1; + hc08_aop_pass[5]->aopu.aop_dir = "___SDCC_hc08_ret5"; + hc08_aop_pass[6] = newAsmop (AOP_DIR); + hc08_aop_pass[6]->size = 1; + hc08_aop_pass[6]->aopu.aop_dir = "___SDCC_hc08_ret6"; + hc08_aop_pass[7] = newAsmop (AOP_DIR); + hc08_aop_pass[7]->size = 1; + hc08_aop_pass[7]->aopu.aop_dir = "___SDCC_hc08_ret7"; + + genhc08iCode (ic); + + destroy_line_list (); + /*freeTrace (&_G.trace.aops);*/ + + return (regalloc_dry_run_cost); +} + +/*-----------------------------------------------------------------*/ +/* genhc08Code - generate code for HC08 based controllers */ +/*-----------------------------------------------------------------*/ +void +genhc08Code (iCode *lic) +{ + iCode *ic; + int cln = 0; + int clevel = 0; + int cblock = 0; + + regalloc_dry_run = FALSE; + + /* print the allocation information */ + if (allocInfo && currFunc) + printAllocInfo (currFunc, codeOutBuf); + /* if debug information required */ + if (options.debug && currFunc) + { + debugFile->writeFunction (currFunc, lic); +#if 0 + genLine.lineElement.isDebug = 1; + if (IS_STATIC (currFunc->etype)) + emitcode ("", "F%s$%s$0$0 ==.", moduleName, currFunc->name); + else + emitcode ("", "G$%s$0$0 ==.", currFunc->name); + genLine.lineElement.isDebug = 0; +#endif + } + /* stack pointer name */ + if (options.useXstack) + spname = "_spx"; + else + spname = "sp"; + + debugFile->writeFrameAddress (NULL, NULL, 0); /* have no idea where frame is now */ + + hc08_aop_pass[0] = newAsmop (AOP_REG); + hc08_aop_pass[0]->size = 1; + hc08_aop_pass[0]->aopu.aop_reg[0] = hc08_reg_a; + hc08_aop_pass[1] = newAsmop (AOP_REG); + hc08_aop_pass[1]->size = 1; + hc08_aop_pass[1]->aopu.aop_reg[0] = hc08_reg_x; + hc08_aop_pass[2] = newAsmop (AOP_DIR); + hc08_aop_pass[2]->size = 1; + hc08_aop_pass[2]->aopu.aop_dir = "___SDCC_hc08_ret2"; + hc08_aop_pass[3] = newAsmop (AOP_DIR); + hc08_aop_pass[3]->size = 1; + hc08_aop_pass[3]->aopu.aop_dir = "___SDCC_hc08_ret3"; + hc08_aop_pass[4] = newAsmop (AOP_DIR); + hc08_aop_pass[4]->size = 1; + hc08_aop_pass[4]->aopu.aop_dir = "___SDCC_hc08_ret4"; + hc08_aop_pass[5] = newAsmop (AOP_DIR); + hc08_aop_pass[5]->size = 1; + hc08_aop_pass[5]->aopu.aop_dir = "___SDCC_hc08_ret5"; + hc08_aop_pass[6] = newAsmop (AOP_DIR); + hc08_aop_pass[6]->size = 1; + hc08_aop_pass[6]->aopu.aop_dir = "___SDCC_hc08_ret6"; + hc08_aop_pass[7] = newAsmop (AOP_DIR); + hc08_aop_pass[7]->size = 1; + hc08_aop_pass[7]->aopu.aop_dir = "___SDCC_hc08_ret7"; + + for (ic = lic; ic; ic = ic->next) + ic->generated = FALSE; + + for (ic = lic; ic; ic = ic->next) + { + initGenLineElement (); + + genLine.lineElement.ic = ic; + + if (ic->level != clevel || ic->block != cblock) + { + if (options.debug) + { + debugFile->writeScope (ic); + } + clevel = ic->level; + cblock = ic->block; } + if (ic->lineno && cln != ic->lineno) + { + if (options.debug) + { + debugFile->writeCLine (ic); +#if 0 + genLine.lineElement.isDebug = 1; + emitcode ("", "C$%s$%d$%d$%d ==.", FileBaseName (ic->filename), ic->lineno, ic->level, ic->block); + genLine.lineElement.isDebug = 0; +#endif + } + if (!options.noCcodeInAsm) + { + emitcode ("", ";%s:%d: %s", ic->filename, ic->lineno, printCLine (ic->filename, ic->lineno)); + } + cln = ic->lineno; + } + if (options.iCodeInAsm) + { + char regsSurv[4]; + const char *iLine; + + regsSurv[0] = (bitVectBitValue (ic->rSurv, A_IDX)) ? 'a' : '-'; + regsSurv[1] = (bitVectBitValue (ic->rSurv, H_IDX)) ? 'h' : '-'; + regsSurv[2] = (bitVectBitValue (ic->rSurv, X_IDX)) ? 'x' : '-'; + regsSurv[3] = 0; + iLine = printILine (ic); + emitcode ("", "; [%s] ic:%d: %s", regsSurv, ic->seq, printILine (ic)); + dbuf_free (iLine); + } + + regalloc_dry_run_cost = 0; + genhc08iCode(ic); + if (options.verboseAsm) + emitcode (";", "iCode %d (key %d) total cost: %d\n", ic->seq, ic->key, (int) regalloc_dry_run_cost); + if (!hc08_reg_a->isFree) - DD(emitcode("","; forgot to free a")); + DD (emitcode ("", "; forgot to free a")); if (!hc08_reg_x->isFree) - DD(emitcode("","; forgot to free x")); + DD (emitcode ("", "; forgot to free x")); if (!hc08_reg_h->isFree) - DD(emitcode("","; forgot to free h")); + DD (emitcode ("", "; forgot to free h")); if (!hc08_reg_hx->isFree) - DD(emitcode("","; forgot to free hx")); + DD (emitcode ("", "; forgot to free hx")); if (!hc08_reg_xa->isFree) - DD(emitcode("","; forgot to free xa")); + DD (emitcode ("", "; forgot to free xa")); } - debugFile->writeFrameAddress (NULL, NULL, 0); /* have no idea where frame is now */ + debugFile->writeFrameAddress (NULL, NULL, 0); /* have no idea where frame is now */ /* now we are ready to call the peep hole optimizer */ if (!options.nopeep) - peepHole (&lineHead); + peepHole (&genLine.lineHead); /* now do the actual printing */ - printLine (lineHead, codeOutBuf); - return; + printLine (genLine.lineHead, codeOutBuf); + + /* destroy the line list */ + destroy_line_list (); } + diff -Nru sdcc-3.1.0+dfsg/src/hc08/gen.h sdcc-3.2.0+dfsg/src/hc08/gen.h --- sdcc-3.1.0+dfsg/src/hc08/gen.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/hc08/gen.h 2012-05-10 19:46:35.000000000 +0000 @@ -94,4 +94,8 @@ extern unsigned fReturnSizeHC08; //extern char **fReturn; +iCode *hasInchc08 (operand *op, const iCode *ic, int osize); +extern bool hc08_assignment_optimal; + #endif + diff -Nru sdcc-3.1.0+dfsg/src/hc08/hc08.h sdcc-3.2.0+dfsg/src/hc08/hc08.h --- sdcc-3.1.0+dfsg/src/hc08/hc08.h 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/hc08/hc08.h 2012-05-18 16:09:24.000000000 +0000 @@ -0,0 +1,18 @@ +typedef enum + { + SUB_HC08, + SUB_S08 + } +HC08_SUB_PORT; + +typedef struct + { + HC08_SUB_PORT sub; + } +HC08_OPTS; + +extern HC08_OPTS hc08_opts; + +#define IS_HC08 (hc08_opts.sub == SUB_HC08) +#define IS_S08 (hc08_opts.sub == SUB_S08) + diff -Nru sdcc-3.1.0+dfsg/src/hc08/hc08.vcxproj sdcc-3.2.0+dfsg/src/hc08/hc08.vcxproj --- sdcc-3.1.0+dfsg/src/hc08/hc08.vcxproj 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/hc08/hc08.vcxproj 2012-05-10 19:46:35.000000000 +0000 @@ -48,7 +48,7 @@ Disabled - ..;.;..\..;..\..\support\util;%(AdditionalIncludeDirectories) + ..;.;..\..;..\..\support\util;C:\Program Files\boost\boost_1_47;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) true EnableFastChecks @@ -79,7 +79,7 @@ MaxSpeed OnlyExplicitInline - ..;.;..\..;..\..\support\util;%(AdditionalIncludeDirectories) + ..;.;..\..;..\..\support\util;C:\Program Files\boost\boost_1_47;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_LIB;NDEBUG;%(PreprocessorDefinitions) true MultiThreaded @@ -123,6 +123,7 @@ %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) + @@ -132,10 +133,12 @@ - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph.rul - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph.rul peeph.rul;%(Outputs) peeph.rul;%(Outputs) + Generating Peephole Rule: peeph.rul + Generating Peephole Rule: peeph.rul diff -Nru sdcc-3.1.0+dfsg/src/hc08/hc08.vcxproj.filters sdcc-3.2.0+dfsg/src/hc08/hc08.vcxproj.filters --- sdcc-3.1.0+dfsg/src/hc08/hc08.vcxproj.filters 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/hc08/hc08.vcxproj.filters 2012-05-10 19:46:35.000000000 +0000 @@ -23,6 +23,9 @@ Source Files + + Source Files + diff -Nru sdcc-3.1.0+dfsg/src/hc08/main.c sdcc-3.2.0+dfsg/src/hc08/main.c --- sdcc-3.1.0+dfsg/src/hc08/main.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/hc08/main.c 2012-05-19 21:42:02.000000000 +0000 @@ -1,25 +1,49 @@ -/** @file main.c - hc08 specific general functions. +/*------------------------------------------------------------------------- + main.h - hc08 specific general function + Copyright (C) 2003, Erik Petrich + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-------------------------------------------------------------------------*/ +/* Note that mlh prepended _hc08_ on the static functions. Makes it easier to set a breakpoint using the debugger. */ #include "common.h" +#include "hc08.h" #include "main.h" #include "ralloc.h" #include "gen.h" #include "dbuf_string.h" -#include "../SDCCutil.h" extern char * iComments2; extern DEBUGFILE dwarf2DebugFile; extern int dwarf2FinalizeFile(FILE *); -static char _defaultRules[] = +static char _hc08_defaultRules[] = +{ +#include "peeph.rul" +}; + +static char _s08_defaultRules[] = { #include "peeph.rul" }; +HC08_OPTS hc08_opts; + /* list of key words used by msc51 */ static char *_hc08_keywords[] = { @@ -58,6 +82,14 @@ static void _hc08_init (void) { + hc08_opts.sub = SUB_HC08; + asm_addTree (&asm_asxxxx_mapping); +} + +static void +_s08_init (void) +{ + hc08_opts.sub = SUB_S08; asm_addTree (&asm_asxxxx_mapping); } @@ -105,21 +137,27 @@ return TRUE; } + if (!strcmp (argv[*i], "--oldralloc")) + { + options.oldralloc = TRUE; + return TRUE; + } + return FALSE; } static OPTION _hc08_options[] = { - { 0, "--out-fmt-elf", NULL, "Output executable in ELF format" }, - { 0, NULL } + {0, "--out-fmt-elf", NULL, "Output executable in ELF format" }, + {0, "--oldralloc", NULL, "Use old register allocator"}, + {0, NULL } }; static void _hc08_finaliseOptions (void) { - if (options.noXinitOpt) { - port->genXINIT=0; - } + if (options.noXinitOpt) + port->genXINIT = 0; if (options.model == MODEL_LARGE) { port->mem.default_local_map = xdata; @@ -172,7 +210,6 @@ fprintf (of, "\t.area %s\n",port->mem.const_name); fprintf (of, "\t.area %s\n",port->mem.data_name); fprintf (of, "\t.area %s\n",port->mem.overlay_name); - fprintf (of, "\t.area %s\n",port->mem.bit_name); fprintf (of, "\t.area %s\n",port->mem.xdata_name); fprintf (of, "\t.area %s\n",port->mem.xidata_name); @@ -289,8 +326,6 @@ operand *result = IC_RESULT(ic); sym_link *result_type = operandType(result); - return 0; /* disable CSE */ - /* if it is a pointer then return ok for now */ if (IC_RESULT(ic) && IS_PTR(result_type)) return 1; @@ -318,6 +353,9 @@ || op == RLC || op == GETHBIT || (op == SWAP && size <= 2) + || op == GETABIT + || op == GETBYTE + || op == GETWORD ) return TRUE; else @@ -335,8 +373,8 @@ return -2; if (IN_FARSPACE (oclass)) /* extended addressing mode is almost at fast */ return -1; - if (oclass == istack) /* stack is the slowest, but still faster than */ - return 0; /* trying to copy to a temp location elsewhere */ + if (oclass == istack) /* stack is the slowest, but still faster than */ + return 0; /* trying to copy to a temp location elsewhere */ return 0; /* anything we missed */ } @@ -377,7 +415,8 @@ "sdas6808", "$l", "$3", "\"$2\"", "\"$1.asm\"", NULL }; -static const char * const _libs[] = { "hc08", NULL, }; +static const char * const _libs_hc08[] = { "hc08", NULL, }; +static const char * const _libs_s08[] = { "s08", NULL, }; /* Globals */ PORT hc08_port = @@ -396,8 +435,8 @@ { _asmCmd, NULL, - "-plosgffwzc", /* Options with debug */ - "-plosgffwz", /* Options without debug */ + "-plosgffwc", /* Options with debug */ + "-plosgffw", /* Options without debug */ 0, ".asm", NULL /* no do_assemble function */ @@ -409,10 +448,10 @@ ".rel", 1, NULL, /* crt */ - _libs, /* libs */ + _libs_hc08, /* libs */ }, { /* Peephole optimizer */ - _defaultRules + _hc08_defaultRules }, { /* Sizes: char, short, int, long, long long, ptr, fptr, gptr, bit, float, max */ @@ -420,23 +459,22 @@ }, /* tags for generic pointers */ { 0x00, 0x40, 0x60, 0x80 }, /* far, near, xstack, code */ - { "XSEG", "STACK", - "CSEG (CODE)", - "DSEG", + "CSEG (CODE)", + "DSEG (PAG)", NULL, /* "ISEG" */ NULL, /* "PSEG" */ "XSEG", - "BSEG", - "RSEG (ABS)", - "GSINIT (CODE)", - "OSEG (OVR)", + NULL, /* "BSEG" */ + "RSEG (ABS)", + "GSINIT (CODE)", + "OSEG (PAG, OVR)", "GSFINAL (CODE)", - "HOME (CODE)", - "XISEG", // initialized xdata - "XINIT", // a code copy of xiseg + "HOME (CODE)", + "XISEG", // initialized xdata + "XINIT", // a code copy of xiseg "CONST (CODE)", // const_name - const data (code or not) "CABS (ABS,CODE)", // cabs_name - const absolute data (code or not) "XABS (ABS)", // xabs_name - absolute xdata @@ -457,7 +495,7 @@ }, /* hc08 has an 8 bit mul */ { - 1, -1 + 1, 5 }, { hc08_emitDebuggerSymbol, @@ -518,3 +556,142 @@ 1, /* globals & local static allowed */ PORT_MAGIC }; + +PORT s08_port = +{ + TARGET_ID_S08, + "s08", + "S08", /* Target name */ + NULL, /* Processor name */ + { + glue, + FALSE, /* Emit glue around main */ + MODEL_SMALL | MODEL_LARGE, + MODEL_LARGE, + NULL, /* model == target */ + }, + { + _asmCmd, + NULL, + "-plosgffwc", /* Options with debug */ + "-plosgffw", /* Options without debug */ + 0, + ".asm", + NULL /* no do_assemble function */ + }, + { /* Linker */ + _linkCmd, + NULL, + NULL, + ".rel", + 1, + NULL, /* crt */ + _libs_s08, /* libs */ + }, + { /* Peephole optimizer */ + _s08_defaultRules + }, + { + /* Sizes: char, short, int, long, long long, ptr, fptr, gptr, bit, float, max */ + 1, 2, 2, 4, 8, 2, 2, 2, 1, 4, 4 + }, + /* tags for generic pointers */ + { 0x00, 0x40, 0x60, 0x80 }, /* far, near, xstack, code */ + { + "XSEG", + "STACK", + "CSEG (CODE)", + "DSEG (PAG)", + NULL, /* "ISEG" */ + NULL, /* "PSEG" */ + "XSEG", + NULL, /* "BSEG" */ + "RSEG (ABS)", + "GSINIT (CODE)", + "OSEG (PAG, OVR)", + "GSFINAL (CODE)", + "HOME (CODE)", + "XISEG", // initialized xdata + "XINIT", // a code copy of xiseg + "CONST (CODE)", // const_name - const data (code or not) + "CABS (ABS,CODE)", // cabs_name - const absolute data (code or not) + "XABS (ABS)", // xabs_name - absolute xdata + "IABS (ABS)", // iabs_name - absolute data + NULL, + NULL, + 1 + }, + { _hc08_genExtraAreas, + NULL }, + { + -1, /* direction (-1 = stack grows down) */ + 0, /* bank_overhead (switch between register banks) */ + 4, /* isr_overhead */ + 2, /* call_overhead */ + 0, /* reent_overhead */ + 0 /* banked_overhead (switch between code banks) */ + }, + /* hc08 has an 8 bit mul */ + { + 1, 5 + }, + { + hc08_emitDebuggerSymbol, + { + hc08_dwarfRegNum, + NULL, + NULL, + 4, /* addressSize */ + 14, /* regNumRet */ + 15, /* regNumSP */ + -1, /* regNumBP */ + 1, /* offsetSP */ + }, + }, + { + 256, /* maxCount */ + 2, /* sizeofElement */ + {8,16,32}, /* sizeofMatchJump[] */ + {8,16,32}, /* sizeofRangeCompare[] */ + 5, /* sizeofSubtract */ + 10, /* sizeofDispatch */ + }, + "_", + _s08_init, + _hc08_parseOptions, + _hc08_options, + NULL, + _hc08_finaliseOptions, + _hc08_setDefaultOptions, + hc08_assignRegisters, + _hc08_getRegName, + _hc08_keywords, + _hc08_genAssemblerPreamble, + _hc08_genAssemblerEnd, /* no genAssemblerEnd */ + _hc08_genIVT, + _hc08_genXINIT, + NULL, /* genInitStartup */ + _hc08_reset_regparm, + _hc08_regparm, + NULL, /* process_pragma */ + NULL, /* getMangledFunctionName */ + NULL, /* hasNativeMulFor */ + hasExtBitOp, /* hasExtBitOp */ + oclsExpense, /* oclsExpense */ + TRUE, /* use_dw_for_init */ + FALSE, /* little_endian */ + 0, /* leave lt */ + 0, /* leave gt */ + 1, /* transform <= to ! > */ + 1, /* transform >= to ! < */ + 1, /* transform != to !(a == b) */ + 0, /* leave == */ + FALSE, /* No array initializer support. */ + cseCostEstimation, + NULL, /* no builtin functions */ + GPOINTER, /* treat unqualified pointers as "generic" pointers */ + 1, /* reset labelKey to 1 */ + 1, /* globals & local static allowed */ + PORT_MAGIC +}; + diff -Nru sdcc-3.1.0+dfsg/src/hc08/peeph.def sdcc-3.2.0+dfsg/src/hc08/peeph.def --- sdcc-3.1.0+dfsg/src/hc08/peeph.def 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/hc08/peeph.def 2012-05-24 09:37:00.000000000 +0000 @@ -34,7 +34,7 @@ ; Peephole 2a - eliminated jmp bcc %5 %1: -} if labelInRange +} if labelInRange(), labelRefCountChange(%1 -1) replace { bcc %1 @@ -44,7 +44,7 @@ ; Peephole 2b - eliminated jmp bcs %5 %1: -} if labelInRange +} if labelInRange(), labelRefCountChange(%1 -1) replace { beq %1 @@ -54,7 +54,7 @@ ; Peephole 2c - eliminated jmp bne %5 %1: -} if labelInRange +} if labelInRange(), labelRefCountChange(%1 -1) replace { bne %1 @@ -64,7 +64,7 @@ ; Peephole 2d - eliminated jmp beq %5 %1: -} if labelInRange +} if labelInRange(), labelRefCountChange(%1 -1) replace { brclr %3,%2,%1 @@ -74,7 +74,7 @@ ; Peephole 2e - eliminated jmp brset %3,%2,%5 %1: -} if labelInRange +} if labelInRange(), labelRefCountChange(%1 -1) replace { brset %3,%2,%1 @@ -84,69 +84,89 @@ ; Peephole 2f - eliminated jmp brclr %3,%2,%5 %1: -} if labelInRange +} if labelInRange(), labelRefCountChange(%1 -1) replace { bls %1 jmp %5 %1: } by { - ; Peephole 2g - eliminated bra + ; Peephole 2g - eliminated jmp bhi %5 %1: -} if labelInRange +} if labelInRange(), labelRefCountChange(%1 -1) replace { bhi %1 jmp %5 %1: } by { - ; Peephole 2h - eliminated bra + ; Peephole 2h - eliminated jmp bls %5 %1: -} if labelInRange +} if labelInRange(), labelRefCountChange(%1 -1) replace { ble %1 jmp %5 %1: } by { - ; Peephole 2i - eliminated bra + ; Peephole 2i - eliminated jmp bgt %5 %1: +} if labelInRange(), labelRefCountChange(%1 -1) -} if labelInRange replace { bgt %1 jmp %5 %1: } by { - ; Peephole 2j - eliminated bra + ; Peephole 2j - eliminated jmp ble %5 %1: -} if labelInRange +} if labelInRange(), labelRefCountChange(%1 -1) replace { bge %1 jmp %5 %1: } by { - ; Peephole 2k - eliminated bra + ; Peephole 2k - eliminated jmp blt %5 %1: -} if labelInRange +} if labelInRange(), labelRefCountChange(%1 -1) replace { blt %1 jmp %5 %1: } by { - ; Peephole 2l - eliminated bra + ; Peephole 2l - eliminated jmp bge %5 %1: -} if labelInRange +} if labelInRange(), labelRefCountChange(%1 -1) + +replace { + bmi %1 + jmp %5 +%1: +} by { + ; Peephole 2m - eliminated jmp + bpl %5 +%1: +} if labelInRange(), labelRefCountChange(%1 -1) replace { + bpl %1 + jmp %5 +%1: +} by { + ; Peephole 2n - eliminated jmp + bmi %5 +%1: +} if labelInRange(), labelRefCountChange(%1 -1) + +replace restart { jmp %5 } by { ; Peephole 3 - shortened jmp to bra @@ -280,14 +300,14 @@ } by { ; Peephole 6a - replaced jmp to rts with rts rts -} if labelIsReturnOnly +} if optimizeReturn(), labelIsReturnOnly(), labelRefCountChange(%5 -1) replace { bra %5 } by { ; Peephole 6b - replaced jmp to rts with rts rts -} if labelIsReturnOnly +} if optimizeReturn(), labelIsReturnOnly(), labelRefCountChange(%5 -1) replace restart { psha @@ -317,3 +337,76 @@ // sta %1 //} if notVolatile %1 +replace { + bne %1 +%1: +} by { + ; Peephole 9a - eliminated branch +%1: +} if labelRefCountChange(%1 -1) + +replace { + beq %1 +%1: +} by { + ; Peephole 9b - eliminated branch +%1: +} if labelRefCountChange(%1 -1) + +replace restart { + bra %1 +%1: +} by { + ; Peephole 9c - eliminated branch +%1: +} if labelRefCountChange(%1 -1) + +replace restart { + bra %1 +%2: +%1: +} by { + ; Peephole 9d - eliminated branch +%2: +%1: +} if labelRefCountChange(%1 -1) + +replace { + cmp #%2 + beq %1 +} by { + ; Peephole 10a - combined cmp/beq + cbeqa #%2,%1 +} + +replace { + cmp *%2 + beq %1 +} by { + ; Peephole 10b - combined cmp/beq + cbeq *%2,%1 +} + +replace { + cmp %2,s + beq %1 +} by { + ; Peephole 10c - combined cmp/beq + cbeq %2,s,%1 +} + +// should be one of the last peepholes +replace restart { +%1: +} by { + ; Peephole 500 removed redundant label %1 +} if labelRefCount(%1 0) + +replace restart { + jsr %1 + rts +} by { + ; Peephole 501 did tail call optimization. + jmp %1 +} if optimizeReturn() + diff -Nru sdcc-3.1.0+dfsg/src/hc08/ralloc.c sdcc-3.2.0+dfsg/src/hc08/ralloc.c --- sdcc-3.1.0+dfsg/src/hc08/ralloc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/hc08/ralloc.c 2012-06-28 14:09:28.000000000 +0000 @@ -26,6 +26,7 @@ #include "common.h" #include "ralloc.h" #include "gen.h" +#include "dbuf_string.h" /*-----------------------------------------------------------------*/ /* At this point we start getting processor specific although */ @@ -39,6 +40,9 @@ extern void genhc08Code (iCode *); #define D(x) +// Build the old allocator. It can be used by command-line options +#define OLDRALLOC 1 + /* Global data */ static struct { @@ -57,7 +61,7 @@ /* Shared with gen.c */ int hc08_ptrRegReq; /* one byte pointer register required */ -/* 8051 registers */ +/* 6808 registers */ reg_info regshc08[] = { @@ -530,10 +534,9 @@ createStackSpil (symbol * sym) { symbol *sloc = NULL; + struct dbuf_s dbuf; int useXstack, model; - char slocBuffer[30]; - /* first go try and find a free one that is already existing on the stack */ if (applyToSet (_G.stackSpil, isFree, &sloc, sym)) @@ -550,14 +553,10 @@ we need to allocate this on the stack : this is really a hack!! but cannot think of anything better at this time */ - if (sprintf (slocBuffer, "sloc%d", _G.slocNum++) >= sizeof (slocBuffer)) - { - fprintf (stderr, "***Internal error: slocBuffer overflowed: %s:%d\n", - __FILE__, __LINE__); - exit (1); - } - - sloc = newiTemp (slocBuffer); + dbuf_init (&dbuf, 128); + dbuf_printf (&dbuf, "sloc%d", _G.slocNum++); + sloc = newiTemp (dbuf_c_str (&dbuf)); + dbuf_destroy (&dbuf); /* set the type to the spilling symbol */ sloc->type = copyLinkChain (sym->type); @@ -1201,8 +1200,10 @@ if (!sym->nRegs) return; if (sym->regs[0]) return; - werrorfl (ic->filename, ic->lineno, W_LOCAL_NOINIT, - sym->prereqv ? sym->prereqv->name : sym->name); + /* Don't warn for new allocator, since this is not used by default (until Thoruop is implemented for spillocation compaction). */ + /*if (z80_opts.oldralloc) + werrorfl (ic->filename, ic->lineno, W_LOCAL_NOINIT, sym->prereqv ? sym->prereqv->name : sym->name);*/ + spillThis (sym); } @@ -1703,10 +1704,9 @@ /* rematStr - returns the rematerialized string for a remat var */ /*-----------------------------------------------------------------*/ static char * -rematStr (symbol * sym) +rematStr (symbol * sym, int offset) { iCode *ic = sym->rematiCode; - int offset = 0; while (1) { @@ -1805,7 +1805,10 @@ { if (ptrPseudoSymSafe (sym, ic)) { - ptrPseudoSymConvert (sym, ic, rematStr (OP_SYMBOL (IC_LEFT (ic)))); + int rightval = 0; + if (IC_RIGHT (ic)) + rightval = (int)operandLitValue (IC_RIGHT (ic)); + ptrPseudoSymConvert (sym, ic, rematStr (OP_SYMBOL (IC_LEFT (ic)), rightval)); continue; } @@ -1818,9 +1821,9 @@ getSize (sym->type = aggrToPtr (sym->type, FALSE)) : getSize (sym->type)); - if (sym->nRegs > 4) + if (sym->nRegs > 8) { - fprintf (stderr, "allocated more than 4 or 0 registers for type "); + fprintf (stderr, "allocated more than 8 registers for type "); printTypeChain (sym->type, stderr); fprintf (stderr, "\n"); } @@ -2102,24 +2105,6 @@ } } - /* if the result is on stack or iaccess then it must be - the same atleast one of the operands */ - if (OP_SYMBOL (IC_RESULT (ic))->onStack || - OP_SYMBOL (IC_RESULT (ic))->iaccess) - { - /* the operation has only one symbol - operator then we can pack */ - if ((IC_LEFT (dic) && !IS_SYMOP (IC_LEFT (dic))) || - (IC_RIGHT (dic) && !IS_SYMOP (IC_RIGHT (dic)))) - goto pack; - - if (!((IC_LEFT (dic) && - IC_RESULT (ic)->key == IC_LEFT (dic)->key) || - (IC_RIGHT (dic) && - IC_RESULT (ic)->key == IC_RIGHT (dic)->key))) - return 0; - } -pack: /* found the definition */ /* replace the result with the result of */ /* this assignment and remove this assignment */ @@ -2165,10 +2150,8 @@ and eliminate the use of iTempAA, freeing up its register for other uses. */ - for (dic = ic->prev; dic; dic = dic->prev) { - /* if definition by assignment */ if (dic->op == '=' && !POINTER_SET (dic) && IC_RESULT (dic)->key == op->key @@ -2189,7 +2172,6 @@ if (!dic) return NULL; /* didn't find any assignment to op */ - /* we are interested only if defined in far space */ /* or in stack space in case of + & - */ @@ -2197,6 +2179,11 @@ if (!IS_SYMOP (IC_RIGHT (dic))) return NULL; + /* if the symbol's address has been taken, there might be a */ + /* non-obvious assignment to it, and so we should not */ + if (OP_SYMBOL (IC_RIGHT (dic))->addrtaken) + return NULL; + /* if the symbol is volatile then we should not */ if (isOperandVolatile (IC_RIGHT (dic), TRUE)) return NULL; @@ -2624,7 +2611,6 @@ canUseAccOperand (iCode * ic, operand * op) { int size; - operand * otherOp; if (ic->op == IFX) { @@ -2645,11 +2631,7 @@ if (POINTER_SET (ic) && isOperandEqual (op, IC_RESULT (ic))) return 1; - if (isOperandEqual (op, IC_LEFT (ic))) - otherOp = IC_RIGHT (ic); - else if (isOperandEqual (op, IC_RIGHT (ic))) - otherOp = IC_LEFT (ic); - else + if (!isOperandEqual (op, IC_LEFT (ic)) && !isOperandEqual (op, IC_RIGHT (ic))) return 0; /* Generation of SEND is deferred until CALL; not safe */ @@ -2732,8 +2714,9 @@ iCode *dic, *lic; bitVect *dbv; struct eBBlock * ebp=ebpp[blockno]; + int disallowHiddenAssignment = 0; - if (ic->op != IPUSH || !IS_ITEMP (IC_LEFT (ic))) + if ((ic->op != IPUSH && ic->op != SEND) || !IS_ITEMP (IC_LEFT (ic))) return; /* must have only definition & one usage */ @@ -2765,6 +2748,12 @@ if (IS_SYMOP(IC_RIGHT(dic))) { + if (IC_RIGHT (dic)->isvolatile) + return; + + if (OP_SYMBOL (IC_RIGHT (dic))->addrtaken || isOperandGlobal (IC_RIGHT (dic))) + disallowHiddenAssignment = 1; + /* make sure the right side does not have any definitions inbetween */ dbv = OP_DEFS(IC_RIGHT(dic)); @@ -2772,6 +2761,8 @@ { if (bitVectBitValue(dbv,lic->key)) return ; + if (disallowHiddenAssignment && (lic->op == CALL || lic->op == PCALL || POINTER_SET (lic))) + return; } /* make sure they have the same type */ if (IS_SPEC(operandType(IC_LEFT(ic)))) @@ -2790,6 +2781,8 @@ } bitVectUnSetBit(OP_SYMBOL(IC_RESULT(dic))->defs,dic->key); } + if (IS_ITEMP (IC_RIGHT (dic))) + OP_USES (IC_RIGHT (dic)) = bitVectSetBit (OP_USES (IC_RIGHT (dic)), ic->key); /* we now we know that it has one & only one def & use and the that the definition is an assignment */ @@ -2798,6 +2791,174 @@ hTabDeleteItem (&iCodehTab, dic->key, dic, DELETE_ITEM, NULL); } +/*------------------------------------------------------------------*/ +/* moveSendToCall - move SEND to immediately precede its CALL/PCALL */ +/*------------------------------------------------------------------*/ +static iCode * +moveSendToCall (iCode *sic, eBBlock *ebp) +{ + iCode * prev = sic->prev; + iCode * sic2 = NULL; + iCode * cic; + + /* Go find the CALL/PCALL */ + cic = sic; + while (cic && cic->op != CALL && cic->op != PCALL) + cic = cic->next; + if (!cic) + return sic; + + /* Is there a second SEND? If so, we'll need to move it too. */ + if (sic->next->op == SEND) + sic2 = sic->next; + + /* relocate the SEND(s) */ + remiCodeFromeBBlock (ebp, sic); + addiCodeToeBBlock (ebp, sic, cic); + if (sic2) + { + remiCodeFromeBBlock (ebp, sic2); + addiCodeToeBBlock (ebp, sic2, cic); + } + + /* Return the iCode to continue processing at. */ + if (prev) + return prev->next; + else + return ebp->sch; +} + + +/*---------------------------------------------------------------------*/ +/* packPointerOp - see if we can move an offset from addition iCode */ +/* to the pointer iCode to used indexed addr mode */ +/* The z80-related ports do a similar thing in SDCCopt.c, offsetFold() */ +/*---------------------------------------------------------------------*/ +static void +packPointerOp (iCode * ic, eBBlock ** ebpp) +{ + operand * pointer; + operand * offsetOp; + operand * nonOffsetOp; + iCode * dic; + iCode * uic; + int key; + + if (POINTER_SET (ic)) + { + pointer = IC_RESULT (ic); + offsetOp = IC_LEFT (ic); + } + else if (POINTER_GET (ic)) + { + pointer = IC_LEFT (ic); + offsetOp = IC_RIGHT (ic); + } + else + return; + + if (!IS_ITEMP (pointer)) + return; + + /* If the pointer is rematerializable, it's already fully optimized */ + if (OP_SYMBOL (pointer)->remat) + return; + + if (offsetOp && IS_OP_LITERAL (offsetOp) && operandLitValue (offsetOp) != 0) + return; + if (offsetOp && IS_SYMOP (offsetOp)) + return; + + /* There must be only one definition */ + if (bitVectnBitsOn (OP_DEFS (pointer)) != 1) + return; + /* find the definition */ + if (!(dic = hTabItemWithKey (iCodehTab, bitVectFirstBit (OP_DEFS (pointer))))) + return; + + if (dic->op == '+' && (IS_OP_LITERAL (IC_RIGHT (dic)) || + (IS_ITEMP (IC_RIGHT (dic)) && OP_SYMBOL (IC_RIGHT (dic))->remat))) + { + nonOffsetOp = IC_LEFT (dic); + offsetOp = IC_RIGHT (dic); + } + else if (dic->op == '+' && IS_ITEMP (IC_LEFT (dic)) && OP_SYMBOL (IC_LEFT (dic))->remat) + { + nonOffsetOp = IC_RIGHT (dic); + offsetOp = IC_LEFT (dic); + } + else + return; + + + /* Now check all of the uses to make sure they are all get/set pointer */ + /* and don't already have a non-zero offset operand */ + for (key=0; keysize; key++) + { + if (bitVectBitValue (OP_USES (pointer), key)) + { + uic = hTabItemWithKey (iCodehTab, key); + if (POINTER_GET (uic)) + { + if (IC_RIGHT (uic) && IS_OP_LITERAL (IC_RIGHT (uic)) && operandLitValue (IC_RIGHT (uic)) != 0) + return; + if (IC_RIGHT (uic) && IS_SYMOP (IC_RIGHT (uic))) + return; + } + else if (POINTER_SET (uic)) + { + if (IC_LEFT (uic) && IS_OP_LITERAL (IC_LEFT (uic)) && operandLitValue (IC_LEFT (uic)) != 0) + return; + if (IC_LEFT (uic) && IS_SYMOP (IC_LEFT (uic))) + return; + } + else + return; + } + } + + /* Everything checks out. Move the literal or rematerializable offset */ + /* to the pointer get/set iCodes */ + for (key=0; keysize; key++) + { + if (bitVectBitValue (OP_USES (pointer), key)) + { + uic = hTabItemWithKey (iCodehTab, key); + if (POINTER_GET (uic)) + { + IC_RIGHT (uic) = offsetOp; + if (IS_SYMOP (offsetOp)) + OP_USES (offsetOp) = bitVectSetBit (OP_USES (offsetOp), key); + } + else if (POINTER_SET (uic)) + { + IC_LEFT (uic) = offsetOp; + if (IS_SYMOP (offsetOp)) + OP_USES (offsetOp) = bitVectSetBit (OP_USES (offsetOp), key); + } + else + return; + } + } + + /* Put the remaining operand on the right and convert to assignment */ + /* or cast (Sometimes the operands to the addition are different sizes, */ + /* so there is an implicit cast. If so, need to make it explicit so */ + /* that all the bytes of the pointer are defined. */ + if (IS_SYMOP (offsetOp)) + bitVectUnSetBit (OP_USES (offsetOp), dic->key); + IC_RIGHT (dic) = nonOffsetOp; + IC_LEFT (dic) = NULL; + SET_ISADDR (IC_RESULT (dic), 0); + if (getSize (operandType (pointer)) == getSize (operandType (nonOffsetOp))) + dic->op = '='; + else + { + dic->op = CAST; + IC_LEFT (dic) = operandFromLink (operandType (pointer)); + } +} + /*-----------------------------------------------------------------*/ /* packRegisters - does some transformations to reduce register */ /* pressure */ @@ -2829,7 +2990,14 @@ for (ic = ebp->sch; ic; ic = ic->next) { //packRegsForLiteral (ic); - + + /* move SEND to immediately precede its CALL/PCALL */ + if (ic->op == SEND && ic->next && + ic->next->op != CALL && ic->next->op != PCALL) + { + ic = moveSendToCall (ic, ebp); + } + /* if this is an itemp & result of an address of a true sym then mark this as rematerialisable */ if (ic->op == ADDRESS_OF && @@ -2842,18 +3010,7 @@ OP_SYMBOL (IC_RESULT (ic))->rematiCode = ic; OP_SYMBOL (IC_RESULT (ic))->usl.spillLoc = NULL; } -#if 1 - if (ic->op == '=' && - !POINTER_SET (ic) && - IS_ITEMP (IC_RESULT (ic)) && - IS_VALOP (IC_RIGHT (ic)) && - bitVectnBitsOn (OP_DEFS (IC_RESULT (ic))) == 1) - { - OP_SYMBOL (IC_RESULT (ic))->remat = 1; - OP_SYMBOL (IC_RESULT (ic))->rematiCode = ic; - OP_SYMBOL (IC_RESULT (ic))->usl.spillLoc = NULL; - } -#endif + /* if straight assignment then carry remat flag if this is the only definition */ if (ic->op == '=' && @@ -2898,7 +3055,6 @@ OP_SYMBOL (IC_RESULT (ic))->rematiCode = ic; OP_SYMBOL (IC_RESULT (ic))->usl.spillLoc = NULL; } - /* mark the pointer usages */ if (POINTER_SET (ic) && IS_SYMOP (IC_RESULT (ic))) OP_SYMBOL (IC_RESULT (ic))->uptr = 1; @@ -2906,31 +3062,9 @@ if (POINTER_GET (ic) && IS_SYMOP (IC_LEFT (ic))) OP_SYMBOL (IC_LEFT (ic))->uptr = 1; - if (!SKIP_IC2 (ic)) - { -#if 0 - /* if we are using a symbol on the stack - then we should say hc08_ptrRegReq */ - if (ic->op == IFX && IS_SYMOP (IC_COND (ic))) - hc08_ptrRegReq += ((OP_SYMBOL (IC_COND (ic))->onStack || - OP_SYMBOL (IC_COND (ic))->iaccess) ? 1 : 0); - else if (ic->op == JUMPTABLE && IS_SYMOP (IC_JTCOND (ic))) - hc08_ptrRegReq += ((OP_SYMBOL (IC_JTCOND (ic))->onStack || - OP_SYMBOL (IC_JTCOND (ic))->iaccess) ? 1 : 0); - else - { - if (IS_SYMOP (IC_LEFT (ic))) - hc08_ptrRegReq += ((OP_SYMBOL (IC_LEFT (ic))->onStack || - OP_SYMBOL (IC_LEFT (ic))->iaccess) ? 1 : 0); - if (IS_SYMOP (IC_RIGHT (ic))) - hc08_ptrRegReq += ((OP_SYMBOL (IC_RIGHT (ic))->onStack || - OP_SYMBOL (IC_RIGHT (ic))->iaccess) ? 1 : 0); - if (IS_SYMOP (IC_RESULT (ic))) - hc08_ptrRegReq += ((OP_SYMBOL (IC_RESULT (ic))->onStack || - OP_SYMBOL (IC_RESULT (ic))->iaccess) ? 1 : 0); - } -#endif - } + /* reduce for support function calls */ + if (ic->supportRtn || (ic->op != IFX && ic->op != JUMPTABLE)) + packRegsForSupport (ic, ebp); /* if the condition of an if instruction is defined in the previous instruction and @@ -2947,169 +3081,275 @@ continue; } - #if 0 - /* if the condition of an if instruction - is defined in the previous GET_POINTER instruction and - this is the only usage then - mark the itemp as accumulator use */ - if ((POINTER_GET (ic) && getSize (operandType (IC_RESULT (ic))) <=1) && - ic->next && ic->next->op == IFX && - bitVectnBitsOn (OP_USES(IC_RESULT(ic)))==1 && - isOperandEqual (IC_RESULT (ic), IC_COND (ic->next)) && - OP_SYMBOL (IC_RESULT (ic))->liveTo <= ic->next->seq) + /* pack for PUSH + iTempNN := (some variable in farspace) V1 + push iTempNN ; + ------------- + push V1 + */ + if (ic->op == IPUSH || ic->op == SEND) { - OP_SYMBOL (IC_RESULT (ic))->accuse = 1; - continue; + packForPush (ic, ebpp, blockno); } - if (ic->op != IFX && ic->op !=JUMPTABLE && !POINTER_SET (ic) - && IC_RESULT (ic) && IS_ITEMP (IC_RESULT (ic)) - && getSize (operandType (IC_RESULT (ic))) == 1 - && bitVectnBitsOn (OP_USES (IC_RESULT (ic))) == 1 - && ic->next - && OP_SYMBOL (IC_RESULT (ic))->liveTo <= ic->next->seq) + if (POINTER_SET (ic) || POINTER_GET (ic)) + packPointerOp (ic, ebpp); + + if (0) /* TODO: Old allocator! */ + packRegsForAccUse (ic); + } +} + +static void +RegFix (eBBlock ** ebbs, int count) +{ + int i; + + /* Check for and fix any problems with uninitialized operands */ + for (i = 0; i < count; i++) + { + iCode *ic; + + if (ebbs[i]->noPath && (ebbs[i]->entryLabel != entryLabel && ebbs[i]->entryLabel != returnLabel)) + continue; + + for (ic = ebbs[i]->sch; ic; ic = ic->next) { - int accuse = 0; + deassignLRs (ic, ebbs[i]); - if (ic->next->op == IFX) - { - if (isOperandEqual (IC_RESULT (ic), IC_COND (ic->next))) - accuse = 1; - } - else if (ic->next->op == JUMPTABLE) - { - if (isOperandEqual (IC_RESULT (ic), IC_JTCOND (ic->next))) - accuse = 1; - } - else + if (SKIP_IC2 (ic)) + continue; + + if (ic->op == IFX) { - if (isOperandEqual (IC_RESULT (ic), IC_LEFT (ic->next))) - accuse = 1; - if (isOperandEqual (IC_RESULT (ic), IC_RIGHT (ic->next))) - accuse = 1; + verifyRegsAssigned (IC_COND (ic), ic); + continue; } - if (accuse) + if (ic->op == JUMPTABLE) { - OP_SYMBOL (IC_RESULT (ic))->accuse = 1; + verifyRegsAssigned (IC_JTCOND (ic), ic); continue; } + verifyRegsAssigned (IC_RESULT (ic), ic); + verifyRegsAssigned (IC_LEFT (ic), ic); + verifyRegsAssigned (IC_RIGHT (ic), ic); } - #endif + } +} - /* reduce for support function calls */ - if (ic->supportRtn || (ic->op != IFX && ic->op != JUMPTABLE)) - packRegsForSupport (ic, ebp); +#ifdef OLDRALLOC +/*-----------------------------------------------------------------*/ +/* Old, obsolete register allocator */ +/*-----------------------------------------------------------------*/ +void +hc08_oldralloc (ebbIndex * ebbi) +{ + eBBlock ** ebbs = ebbi->bbOrder; + int count = ebbi->count; + iCode *ic; + int i; - #if 0 - /* some cases the redundant moves can - can be eliminated for return statements */ - if ((ic->op == RETURN || (ic->op == SEND && ic->argreg == 1)) && - /* !isOperandInFarSpace (IC_LEFT (ic)) && */ - options.model == MODEL_SMALL) - { - packRegsForOneuse (ic, IC_LEFT (ic), ebp); - } + setToNull ((void *) &_G.funcrUsed); + setToNull ((void *) &_G.regAssigned); + setToNull ((void *) &_G.totRegAssigned); + hc08_ptrRegReq = _G.stackExtend = _G.dataExtend = 0; + hc08_nRegs = 7; + hc08_reg_a = hc08_regWithIdx(A_IDX); + hc08_reg_x = hc08_regWithIdx(X_IDX); + hc08_reg_h = hc08_regWithIdx(H_IDX); + hc08_reg_hx = hc08_regWithIdx(HX_IDX); + hc08_reg_xa = hc08_regWithIdx(XA_IDX); + hc08_reg_sp = hc08_regWithIdx(SP_IDX); + hc08_nRegs = 5; - /* if pointer set & left has a size more than - one and right is not in far space */ - if (POINTER_SET (ic) && - /* !isOperandInFarSpace (IC_RIGHT (ic)) && */ - !OP_SYMBOL (IC_RESULT (ic))->remat && - !IS_OP_RUONLY (IC_RIGHT (ic)) - /* && getSize (aggrToPtr (operandType (IC_RESULT (ic)), FALSE)) > 1 */ ) - { - packRegsForOneuse (ic, IC_RESULT (ic), ebp); - } + /* change assignments this will remove some + live ranges reducing some register pressure */ - /* if pointer get */ - if (POINTER_GET (ic) && - IS_SYMOP (IC_LEFT (ic)) && - /* !isOperandInFarSpace (IC_RESULT (ic)) && */ - !OP_SYMBOL (IC_LEFT (ic))->remat && - !IS_OP_RUONLY (IC_RESULT (ic)) - /* && getSize (aggrToPtr (operandType (IC_LEFT (ic)), FALSE)) > 1 */) - { - packRegsForOneuse (ic, IC_LEFT (ic), ebp); - } + for (i = 0; i < count; i++) + packRegisters (ebbs, i); + + /* liveranges probably changed by register packing + so we compute them again */ + recomputeLiveRanges (ebbs, count); - /* if this is a cast for integral promotion then - check if it's the only use of the definition of the - operand being casted/ if yes then replace - the result of that arithmetic operation with - this result and get rid of the cast */ - if (ic->op == CAST) + if (options.dump_pack) + dumpEbbsToFileExt (DUMP_PACK, ebbi); + + /* first determine for each live range the number of + registers & the type of registers required for each */ + regTypeNum (*ebbs); + + /* and serially allocate registers */ + serialRegAssign (ebbs, count); + + freeAllRegs (); + //setToNull ((void *) &_G.regAssigned); + //setToNull ((void *) &_G.totRegAssigned); + fillGaps(); + + /* if stack was extended then tell the user */ + if (_G.stackExtend) + { +/* werror(W_TOOMANY_SPILS,"stack", */ +/* _G.stackExtend,currFunc->name,""); */ + _G.stackExtend = 0; + } + + if (_G.dataExtend) + { +/* werror(W_TOOMANY_SPILS,"data space", */ +/* _G.dataExtend,currFunc->name,""); */ + _G.dataExtend = 0; + } + + /* after that create the register mask + for each of the instruction */ + createRegMask (ebbs, count); + + /* redo that offsets for stacked automatic variables */ + if (currFunc) + { + redoStackOffsets (); + } + + if (options.dump_rassgn) + { + dumpEbbsToFileExt (DUMP_RASSGN, ebbi); + dumpLiveRanges (DUMP_LRANGE, liveRanges); + } + + /* do the overlaysegment stuff SDCCmem.c */ + doOverlays (ebbs, count); + + /* now get back the chain */ + ic = iCodeLabelOptimize (iCodeFromeBBlock (ebbs, count)); + + genhc08Code (ic); + + /* free up any _G.stackSpil locations allocated */ + applyToSet (_G.stackSpil, deallocStackSpil); + _G.slocNum = 0; + setToNull ((void *) &_G.stackSpil); + setToNull ((void *) &_G.spiltSet); + /* mark all registers as free */ + freeAllRegs (); + + return; +} +#endif + +/** Serially allocate registers to the variables. + This was the main register allocation function. It is called after + packing. + In the new register allocator it only serves to mark variables for the new register allocator. + */ +static void +serialRegMark (eBBlock ** ebbs, int count) +{ + int i; + short int max_alloc_bytes = SHRT_MAX; // Byte limit. Set this to a low value to pass only few variables to the register allocator. This can be useful for debugging. + + /* for all blocks */ + for (i = 0; i < count; i++) + { + iCode *ic; + + if (ebbs[i]->noPath && + (ebbs[i]->entryLabel != entryLabel && + ebbs[i]->entryLabel != returnLabel)) + continue; + + /* for all instructions do */ + for (ic = ebbs[i]->sch; ic; ic = ic->next) { - sym_link *fromType = operandType (IC_RIGHT (ic)); - sym_link *toType = operandType (IC_LEFT (ic)); + updateRegUsage(ic); - if (IS_INTEGRAL (fromType) && IS_INTEGRAL (toType) && - getSize (fromType) != getSize (toType) && - SPEC_USIGN (fromType) == SPEC_USIGN (toType)) + /* if this is an ipop that means some live + range will have to be assigned again */ + if (ic->op == IPOP) + reassignLR (IC_LEFT (ic)); + + /* if result is present && is a true symbol */ + if (IC_RESULT (ic) && ic->op != IFX && + IS_TRUE_SYMOP (IC_RESULT (ic))) { - iCode *dic = packRegsForOneuse (ic, IC_RIGHT (ic), ebp); - if (dic) - { - if (IS_ARITHMETIC_OP (dic)) - { - bitVectUnSetBit(OP_SYMBOL(IC_RESULT(dic))->defs,dic->key); - ReplaceOpWithCheaperOp(&IC_RESULT (dic), IC_RESULT (ic)); - remiCodeFromeBBlock (ebp, ic); - bitVectUnSetBit(OP_SYMBOL(IC_RESULT(ic))->defs,ic->key); - hTabDeleteItem (&iCodehTab, ic->key, ic, DELETE_ITEM, NULL); - OP_DEFS(IC_RESULT (dic))=bitVectSetBit (OP_DEFS (IC_RESULT (dic)), dic->key); - ic = ic->prev; - } - else - { - OP_SYMBOL (IC_RIGHT (ic))->ruonly = 0; - } - } + OP_SYMBOL (IC_RESULT (ic))->allocreq++; } - else + + /* take away registers from live + ranges that end at this instruction */ + deassignLRs (ic, ebbs[i]); + + /* some don't need registers */ + if (SKIP_IC2 (ic) || + ic->op == JUMPTABLE || + ic->op == IFX || + ic->op == IPUSH || + ic->op == IPOP || + (IC_RESULT (ic) && POINTER_SET (ic))) + { + continue; + } + + /* now we need to allocate registers only for the result */ + if (IC_RESULT (ic)) { - /* if the type from and type to are the same - then if this is the only use then pack it */ - if (compareType (operandType (IC_RIGHT (ic)), - operandType (IC_LEFT (ic))) == 1) + symbol *sym = OP_SYMBOL (IC_RESULT (ic)); + + /* Make sure any spill location is definitely allocated */ + if (sym->isspilt && !sym->remat && sym->usl.spillLoc && + !sym->usl.spillLoc->allocreq) { - iCode *dic = packRegsForOneuse (ic, IC_RIGHT (ic), ebp); - if (dic) - { - bitVectUnSetBit(OP_SYMBOL(IC_RESULT(dic))->defs,dic->key); - ReplaceOpWithCheaperOp(&IC_RESULT (dic), IC_RESULT (ic)); - remiCodeFromeBBlock (ebp, ic); - bitVectUnSetBit(OP_SYMBOL(IC_RESULT(ic))->defs,ic->key); - hTabDeleteItem (&iCodehTab, ic->key, ic, DELETE_ITEM, NULL); - OP_DEFS(IC_RESULT (dic))=bitVectSetBit (OP_DEFS (IC_RESULT (dic)), dic->key); - ic = ic->prev; - } + sym->usl.spillLoc->allocreq++; } - } - } - #endif - /* pack for PUSH - iTempNN := (some variable in farspace) V1 - push iTempNN ; - ------------- - push V1 - */ - if (ic->op == IPUSH) - { - packForPush (ic, ebpp, blockno); - } + /* if it does not need or is spilt + or is already assigned to registers + or will not live beyond this instructions */ + if (!sym->nRegs || + sym->isspilt || + bitVectBitValue (_G.regAssigned, sym->key) || + sym->liveTo <= ic->seq) + { + continue; + } + + /* if some liverange has been spilt at the block level + and this one live beyond this block then spil this + to be safe */ + if (_G.blockSpil && sym->liveTo > ebbs[i]->lSeq) + { + spillThis (sym); + continue; + } + + if (sym->remat) + { + spillThis (sym); + continue; + } - packRegsForAccUse (ic); + if (max_alloc_bytes >= sym->nRegs) + { + sym->for_newralloc = 1; + max_alloc_bytes -= sym->nRegs; + } + else if (!sym->for_newralloc) + { + spillThis (sym); + printf ("Spilt %s due to byte limit.\n", sym->name); + } + } + } } } - /*-----------------------------------------------------------------*/ -/* assignRegisters - assigns registers to each live range as need */ +/* New register allocator */ /*-----------------------------------------------------------------*/ void -hc08_assignRegisters (ebbIndex * ebbi) +hc08_ralloc (ebbIndex * ebbi) { eBBlock ** ebbs = ebbi->bbOrder; int count = ebbi->count; @@ -3147,12 +3387,12 @@ regTypeNum (*ebbs); /* and serially allocate registers */ - serialRegAssign (ebbs, count); + serialRegMark (ebbs, count); - freeAllRegs (); - //setToNull ((void *) &_G.regAssigned); - //setToNull ((void *) &_G.totRegAssigned); - fillGaps(); + /* The new register allocator invokes its magic */ + ic = hc08_ralloc2_cc (ebbi); + + RegFix (ebbs, count); /* if stack was extended then tell the user */ if (_G.stackExtend) @@ -3203,3 +3443,18 @@ return; } + +/*-----------------------------------------------------------------*/ +/* assignRegisters - assigns registers to each live range as need */ +/*-----------------------------------------------------------------*/ +void +hc08_assignRegisters (ebbIndex * ebbi) +{ +#ifdef OLDRALLOC + if (options.oldralloc) + hc08_oldralloc (ebbi); + else +#endif + hc08_ralloc (ebbi); +} + diff -Nru sdcc-3.1.0+dfsg/src/hc08/ralloc.h sdcc-3.2.0+dfsg/src/hc08/ralloc.h --- sdcc-3.1.0+dfsg/src/hc08/ralloc.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/hc08/ralloc.h 2012-05-05 16:16:42.000000000 +0000 @@ -30,8 +30,8 @@ enum { A_IDX, - H_IDX, X_IDX, + H_IDX, HX_IDX, XA_IDX, CND_IDX, @@ -53,7 +53,8 @@ short mask; /* bitmask for pair allocation */ struct asmop *aop; /* last operand */ int aopofs; /* last operand offset */ - unsigned isFree:1; /* is currently unassigned */ + unsigned isFree:1; /* is currently unassigned */ + unsigned isDead:1; /* does not need to survive current instruction */ } reg_info; extern reg_info regshc08[]; @@ -70,4 +71,6 @@ void hc08_dirtyReg (reg_info * reg, bool freereg); bitVect *hc08_rUmaskForOp (operand * op); +iCode *hc08_ralloc2_cc(ebbIndex *ebbi); + #endif diff -Nru sdcc-3.1.0+dfsg/src/hc08/ralloc2.cc sdcc-3.2.0+dfsg/src/hc08/ralloc2.cc --- sdcc-3.1.0+dfsg/src/hc08/ralloc2.cc 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/hc08/ralloc2.cc 2012-05-30 05:06:55.000000000 +0000 @@ -0,0 +1,667 @@ +// Philipp Klaus Krause, philipp@informatik.uni-frankfurt.de, pkk@spth.de, 2010 - 2011 +// +// (c) 2012 Goethe-Universität Frankfurt +// +// This program is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +//#define DEBUG_RALLOC_DEC // Uncomment to get debug messages while doing register allocation on the tree decomposition. +//#define DEBUG_RALLOC_DEC_ASS // Uncomment to get debug messages about assignments while doing register allocation on the tree decomposition (much more verbose than the one above). + +#define TD_SALLOC +#define CH_SALLOC + +#include "SDCCralloc.hpp" + +extern "C" +{ + #include "ralloc.h" + #include "gen.h" + unsigned char dryhc08iCode (iCode *ic); + bool hc08_assignment_optimal; +}; + +#define REG_A 0 +#define REG_X 1 +#define REG_H 2 + +template +static void add_operand_conflicts_in_node(const cfg_node &n, I_t &I) +{ + const iCode *ic = n.ic; + + const operand *result = IC_RESULT(ic); + const operand *left = IC_LEFT(ic); + const operand *right = IC_RIGHT(ic); + + if(!result || !IS_SYMOP(result)) + return; + + // Todo: Identify more operations that code generation can always handle and exclude them (as done for the z80-like ports). + if (ic->op == '=') + return; + + operand_map_t::const_iterator oir, oir_end, oirs; + boost::tie(oir, oir_end) = n.operands.equal_range(OP_SYMBOL_CONST(result)->key); + if(oir == oir_end) + return; + + operand_map_t::const_iterator oio, oio_end; + + if(left && IS_SYMOP(left)) + for(boost::tie(oio, oio_end) = n.operands.equal_range(OP_SYMBOL_CONST(left)->key); oio != oio_end; ++oio) + for(oirs = oir; oirs != oir_end; ++oirs) + { + var_t rvar = oirs->second; + var_t ovar = oio->second; + if(I[rvar].byte < I[ovar].byte) + boost::add_edge(rvar, ovar, I); + } + + if(right && IS_SYMOP(right)) + for(boost::tie(oio, oio_end) = n.operands.equal_range(OP_SYMBOL_CONST(right)->key); oio != oio_end; ++oio) + for(oirs = oir; oirs != oir_end; ++oirs) + { + var_t rvar = oirs->second; + var_t ovar = oio->second; + if(I[rvar].byte < I[ovar].byte) + boost::add_edge(rvar, ovar, I); + } +} + +// Return true, iff the operand is placed (partially) in r. +template +static bool operand_in_reg(const operand *o, reg_t r, const i_assignment_t &ia, unsigned short int i, const G_t &G) +{ + if(!o || !IS_SYMOP(o)) + return(false); + + operand_map_t::const_iterator oi, oi_end; + for(boost::tie(oi, oi_end) = G[i].operands.equal_range(OP_SYMBOL_CONST(o)->key); oi != oi_end; ++oi) + if(oi->second == ia.registers[r][1] || oi->second == ia.registers[r][0]) + return(true); + + return(false); +} + +// Check that the operand is either fully in registers or fully in memory. +template +static bool operand_sane(const operand *o, const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +{ + if(!o || !IS_SYMOP(o)) + return(true); + + operand_map_t::const_iterator oi, oi2, oi_end; + boost::tie(oi, oi_end) = G[i].operands.equal_range(OP_SYMBOL_CONST(o)->key); + + if(oi == oi_end) + return(true); + + // Go to the second byte. If the operand is only a single byte, it cannot be + // an unsupported register combination or split between register and memory. + oi2 = oi; + oi2++; + if (oi2 == oi_end) + return(true); + + // Register combinations code generation cannot handle yet (AH, XH, HA). + if(a.local.find(oi->second) != a.local.end() && a.local.find(oi2->second) != a.local.end()) + { + const reg_t l = a.global[oi->second]; + const reg_t h = a.global[oi2->second]; + if(l == REG_A && h == REG_H || l == REG_H) + return(false); + } + + // In registers. + if(a.local.find(oi->second) != a.local.end()) + { + while(++oi != oi_end) + if(a.local.find(oi->second) == a.local.end()) + return(false); + } + else + { + while(++oi != oi_end) + if(a.local.find(oi->second) != a.local.end()) + return(false); + } + + return(true); +} + +template +static bool inst_sane(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +{ + const iCode *ic = G[i].ic; + + return(operand_sane(IC_RESULT(ic), a, i, G, I) && operand_sane(IC_LEFT(ic), a, i, G, I) && operand_sane(IC_RIGHT(ic), a, i, G, I)); +} + +template +static bool operand_is_ax(const operand *o, const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +{ + if(!o || !IS_SYMOP(o)) + return(false); + + operand_map_t::const_iterator oi, oi2, oi_end; + boost::tie(oi, oi_end) = G[i].operands.equal_range(OP_SYMBOL_CONST(o)->key); + + if(oi == oi_end) + return(false); + + // Register combinations code generation cannot handle yet (AX, AH, XH, HA). + if(a.local.find(oi->second) != a.local.end() && a.local.find((oi2 = oi, ++oi2)->second) != a.local.end()) + { + const reg_t l = a.global[oi->second]; + const reg_t h = a.global[oi2->second]; + if(l == REG_X && h == REG_A) + return(true); + } + + return(false); +} + +template +static bool XAinst_ok(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +{ + const iCode *ic = G[i].ic; + + // Instructions that can handle anything. + if(ic->op == '!' || + ic->op == '~' || + ic->op == UNARYMINUS || + ic->op == CALL || + ic->op == PCALL || + ic->op == FUNCTION || + ic->op == ENDFUNCTION || + ic->op == RETURN || + ic->op == LABEL || + ic->op == GOTO || + ic->op == '+' || + ic->op == '-' || + ic->op == '*' || + ic->op == '/' || + ic->op == '%' || + ic->op == '<' || ic->op == '>' || ic->op == LE_OP || ic->op == GE_OP || + ic->op == NE_OP || ic->op == EQ_OP || + ic->op == AND_OP || + ic->op == OR_OP || + ic->op == '^' || + ic->op == '|' || + ic->op == BITWISEAND || + ic->op == GETHBIT || + ic->op == GETABIT || + ic->op == GETBYTE || + ic->op == GETWORD || + ic->op == LEFT_OP || + ic->op == RIGHT_OP || + ic->op == '=' && !POINTER_SET(ic) || + ic->op == ADDRESS_OF || + ic->op == CAST || + ic->op == DUMMY_READ_VOLATILE || + ic->op == SWAP) + return(true); + + if(ic->op == IFX && ic->generated) + return(true); + + const i_assignment_t &ia = a.i_assignment; + + bool unused_A = (ia.registers[REG_A][1] < 0); + bool unused_H = (ia.registers[REG_H][1] < 0); + bool unused_X = (ia.registers[REG_X][1] < 0); + + if(unused_X && unused_A && unused_H) + return(true); + +#if 0 + std::cout << "XAinst_ok: at (" << i << ", " << ic->key << ")\nX = (" << ia.registers[REG_X][0] << ", " << ia.registers[REG_X][1] << "), A = (" << ia.registers[REG_A][0] << ", " << ia.registers[REG_A][1] << ")inst " << i << ", " << ic->key << "\n"; +#endif + + const operand *left = IC_LEFT(ic); + const operand *right = IC_RIGHT(ic); + const operand *result = IC_RESULT(ic); + + bool result_in_A = operand_in_reg(result, REG_A, ia, i, G) && !(ic->op == '=' && POINTER_SET(ic)); + bool result_in_H = operand_in_reg(result, REG_H, ia, i, G) && !(ic->op == '=' && POINTER_SET(ic)); + bool result_in_X = operand_in_reg(result, REG_X, ia, i, G) && !(ic->op == '=' && POINTER_SET(ic)); + bool left_in_A = operand_in_reg(result, REG_A, ia, i, G); + bool left_in_X = operand_in_reg(result, REG_X, ia, i, G); + + const std::set &dying = G[i].dying; + + bool dying_A = result_in_A || dying.find(ia.registers[REG_A][1]) != dying.end() || dying.find(ia.registers[REG_A][0]) != dying.end(); + bool dying_H = result_in_H || dying.find(ia.registers[REG_H][1]) != dying.end() || dying.find(ia.registers[REG_H][0]) != dying.end(); + bool dying_X = result_in_X || dying.find(ia.registers[REG_X][1]) != dying.end() || dying.find(ia.registers[REG_X][0]) != dying.end(); + + bool result_only_XA = (result_in_X || unused_X || dying_X) && (result_in_A || unused_A || dying_A); + + if((ic->op == IFX || ic->op == JUMPTABLE) && (unused_A || dying_A)) + return(true); + + if(ic->op == IPUSH && (unused_A || dying_A || left_in_A || operand_in_reg(left, REG_H, ia, i, G) || left_in_X)) + return(true); + + if(ic->op == GET_VALUE_AT_ADDRESS && (unused_X || dying_X) && (unused_H || dying_H)) + return(true); + + if(ic->op == '=' && POINTER_SET(ic) && (unused_A || dying_A) && !operand_in_reg(right, REG_H, ia, i, G) && !operand_in_reg(right, REG_X, ia, i, G)) + return(true); + + if(ic->op == RECEIVE && (!ic->next || !(ic->next->op == RECEIVE) || !result_in_X || getSize(operandType(result)) >= 2)) + return(true); + + if(ic->op == SEND && ic->next && ic->next->op == SEND && ic->next->next && ic->next->next->op == SEND) + return(true); + + if(ic->op == SEND && ic->next && ic->next->op == SEND && (unused_X || dying_X)) + return(true); + + if(ic->op == SEND && (unused_X || dying_X) && (unused_A || dying_A)) + return(true); + + if(ic->op == SEND && ic->next && (ic->next->op == CALL || ic->next->op == PCALL)) // Might mess up A and X, but these would have been saved before if surviving, and will not be needed again before the call. + return(true); + + if((ic->op == CRITICAL || ic->op == ENDCRITICAL) && (unused_A || dying_A)) + return(true); + + return(false); +} + +template +static bool AXinst_ok(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +{ + const iCode *ic = G[i].ic; + + const i_assignment_t &ia = a.i_assignment; + + if(ic->op == '!' || + ic->op == '~' || + ic->op == IPUSH || + ic->op == CALL || + ic->op == FUNCTION || + ic->op == ENDFUNCTION || + ic->op == RETURN || + ic->op == LABEL || + ic->op == GOTO || + ic->op == '+' || + ic->op == '-' || + ic->op == NE_OP || ic->op == EQ_OP || + ic->op == '^' || + ic->op == '|' || + ic->op == BITWISEAND || + ic->op == GETHBIT || + ic->op == GETABIT || + ic->op == GETBYTE || + ic->op == GETWORD || + /*ic->op == LEFT_OP || + ic->op == RIGHT_OP ||*/ + ic->op == GET_VALUE_AT_ADDRESS || + ic->op == '=' || + ic->op == ADDRESS_OF || + ic->op == RECEIVE || + ic->op == SEND || + ic->op == DUMMY_READ_VOLATILE || + ic->op == CRITICAL || + ic->op == ENDCRITICAL || + ic->op == SWAP) + return(true); + + bool unused_A = (ia.registers[REG_A][1] < 0); + bool unused_X = (ia.registers[REG_X][1] < 0); + + if (unused_A || unused_X) + return(true); + + const operand *left = IC_LEFT(ic); + const operand *right = IC_RIGHT(ic); + const operand *result = IC_RESULT(ic); + + bool result_in_A = operand_in_reg(result, REG_A, ia, i, G) && !(ic->op == '=' && POINTER_SET(ic)); + bool result_in_X = operand_in_reg(result, REG_X, ia, i, G) && !(ic->op == '=' && POINTER_SET(ic)); + bool left_in_A = operand_in_reg(result, REG_A, ia, i, G); + bool left_in_X = operand_in_reg(result, REG_X, ia, i, G); + bool right_in_A = operand_in_reg(result, REG_A, ia, i, G); + bool right_in_X = operand_in_reg(result, REG_X, ia, i, G); + + bool result_is_ax = operand_is_ax (result, a, i, G, I); + bool left_is_ax = operand_is_ax (left, a, i, G, I); + bool right_is_ax = operand_is_ax (right, a, i, G, I); + + if (!result_is_ax && !left_is_ax && !right_is_ax) + return(true); + + return(false); +} + +template +static void set_surviving_regs(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +{ + iCode *ic = G[i].ic; + + ic->rSurv = newBitVect(NUM_REGS); + + std::set::const_iterator v, v_end; + for (v = G[i].alive.begin(), v_end = G[i].alive.end(); v != v_end; ++v) + if(a.global[*v] >= 0 && G[i].dying.find(*v) == G[i].dying.end()) + if(!((IC_RESULT(ic) && !POINTER_SET(ic)) && IS_SYMOP(IC_RESULT(ic)) && OP_SYMBOL_CONST(IC_RESULT(ic))->key == I[*v].v)) + ic->rSurv = bitVectSetBit(ic->rSurv, a.global[*v]); +} + +template +static void unset_surviving_regs(unsigned short int i, const G_t &G) +{ + iCode *ic = G[i].ic; + + freeBitVect(ic->rSurv); +} + +template +void assign_operand_for_cost(operand *o, const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +{ + if(!o || !IS_SYMOP(o)) + return; + symbol *sym = OP_SYMBOL(o); + operand_map_t::const_iterator oi, oi_end; + for(boost::tie(oi, oi_end) = G[i].operands.equal_range(OP_SYMBOL_CONST(o)->key); oi != oi_end; ++oi) + { + var_t v = oi->second; + if(a.global[v] >= 0) + { + sym->regs[I[v].byte] = regshc08 + a.global[v]; + sym->isspilt = false; + sym->nRegs = I[v].size; + sym->accuse = 0; + } + else + { + for(int i = 0; i < I[v].size; i++) + sym->regs[i] = 0; + sym->accuse = 0; + sym->nRegs = I[v].size; + sym->isspilt = true; + } + } +} + +template +static void assign_operands_for_cost(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +{ + const iCode *ic = G[i].ic; + + if(ic->op == IFX) + assign_operand_for_cost(IC_COND(ic), a, i, G, I); + else if(ic->op == JUMPTABLE) + assign_operand_for_cost(IC_JTCOND(ic), a, i, G, I); + else + { + assign_operand_for_cost(IC_LEFT(ic), a, i, G, I); + assign_operand_for_cost(IC_RIGHT(ic), a, i, G, I); + assign_operand_for_cost(IC_RESULT(ic), a, i, G, I); + } + + if(ic->op == SEND && ic->builtinSEND) + { + assign_operands_for_cost(a, *(adjacent_vertices(i, G).first), G, I); + } +} + +// Cost function. +template +static float instruction_cost(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +{ + iCode *ic = G[i].ic; + float c; + + wassert (TARGET_IS_HC08 || TARGET_IS_S08); + + if(!inst_sane(a, i, G, I)) + return(std::numeric_limits::infinity()); + + if(!XAinst_ok(a, i, G, I)) + return(std::numeric_limits::infinity()); + + if(!AXinst_ok(a, i, G, I)) + return(std::numeric_limits::infinity()); + +#if 0 + std::cout << "Calculating at cost at ic " << ic->key << " for: "; + for(unsigned int i = 0; i < boost::num_vertices(I); i++) + { + std::cout << "(" << i << ", " << int(a.global[i]) << ") "; + } + std::cout << "\n"; + std::cout.flush(); +#endif + + if(ic->generated) + return(0.0f); + + switch(ic->op) + { + // Register assignment doesn't matter for these: + case FUNCTION: + case ENDFUNCTION: + case LABEL: + case GOTO: + case INLINEASM: + return(0.0f); + case '!': + case '~': + case UNARYMINUS: + case '+': + case '-': + case '^': + case '|': + case BITWISEAND: + case IPUSH: + //case IPOP: + case CALL: + case PCALL: + case RETURN: + case '*': + case '/': + case '%': + case '>': + case '<': + case LE_OP: + case GE_OP: + case EQ_OP: + case NE_OP: + case AND_OP: + case OR_OP: + case GETHBIT: + case GETABIT: + case GETBYTE: + case GETWORD: + case LEFT_OP: + case RIGHT_OP: + case GET_VALUE_AT_ADDRESS: + case '=': + case IFX: + case ADDRESS_OF: + case JUMPTABLE: + case CAST: + case RECEIVE: + case SEND: + case DUMMY_READ_VOLATILE: + case CRITICAL: + case ENDCRITICAL: + case SWAP: + assign_operands_for_cost(a, i, G, I); + set_surviving_regs(a, i, G, I); + c = dryhc08iCode(ic); + unset_surviving_regs(i, G); + return(c); + default: + return(0.0f); + } +} + +// For early removal of assignments that cannot be extended to valid assignments. This is just a dummy for now, it probably isn't really needed for hc08 due to the low number of registers. +template +static bool assignment_hopeless(const assignment &a, unsigned short int i, const G_t &G, const I_t &I, const var_t lastvar) +{ + return(false); +} + +// Increase chance of finding good compatible assignments at join nodes. This is just a dummy for now, it probably isn't really needed for hc08 due to the low number of registers. +template +static void get_best_local_assignment_biased(assignment &a, typename boost::graph_traits::vertex_descriptor t, const T_t &T) +{ + a = *T[t].assignments.begin(); + + std::set::const_iterator vi, vi_end; + for(vi = T[t].alive.begin(), vi_end = T[t].alive.end(); vi != vi_end; ++vi) + a.local.insert(*vi); +} + +// This is just a dummy for now, it probably isn't really needed for hc08 due to the low number of registers. +template +static float rough_cost_estimate(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +{ + return(0.0f); +} + +// Code for another ic is generated when generating this one. Mark the other as generated. +static void extra_ic_generated(const iCode *ic) +{ + if(ic->op == '>' || ic->op == '<' || ic->op == LE_OP || ic->op == GE_OP || ic->op == EQ_OP || ic->op == NE_OP || ic->op == '^' || ic->op == '|' || ic->op == BITWISEAND) + { + iCode *ifx; + if (ifx = ifxForOp (IC_RESULT (ic), ic)) + ifx->generated = 1; + } + if(ic->op == '-' && IS_VALOP (IC_RIGHT (ic)) && operandLitValue (IC_RIGHT (ic)) == 1 && getSize(operandType(IC_RESULT (ic))) == 1 && !isOperandInFarSpace (IC_RESULT (ic)) && isOperandEqual (IC_RESULT (ic), IC_LEFT (ic))) + { + iCode *ifx; + if (ifx = ifxForOp (IC_RESULT (ic), ic)) + ifx->generated = 1; + } + if(ic->op == GET_VALUE_AT_ADDRESS) + { + iCode *inc; + if (inc = hasInchc08 (IC_LEFT (ic), ic, getSize (operandType (IC_RIGHT (ic))))) + inc->generated = 1; + } +} + +template +static bool tree_dec_ralloc(T_t &T, G_t &G, const I_t &I) +{ + bool assignment_optimal; + + con2_t I2(boost::num_vertices(I)); + for(unsigned int i = 0; i < boost::num_vertices(I); i++) + { + I2[i].v = I[i].v; + I2[i].byte = I[i].byte; + I2[i].size = I[i].size; + I2[i].name = I[i].name; + } + typename boost::graph_traits::edge_iterator e, e_end; + for(boost::tie(e, e_end) = boost::edges(I); e != e_end; ++e) + add_edge(boost::source(*e, I), boost::target(*e, I), I2); + + assignment ac; + assignment_optimal = true; + tree_dec_ralloc_nodes(T, find_root(T), G, I2, ac, &assignment_optimal); + + const assignment &winner = *(T[find_root(T)].assignments.begin()); +#ifdef DEBUG_RALLOC_DEC + std::cout << "Winner: "; + for(unsigned int i = 0; i < boost::num_vertices(I); i++) + { + std::cout << "(" << i << ", " << int(winner.global[i]) << ") "; + } + std::cout << "\n"; + std::cout << "Cost: " << winner.s << "\n"; + std::cout.flush(); +#endif + // Todo: Make this an assertion + if(winner.global.size() != boost::num_vertices(I)) + { + std::cerr << "ERROR: No Assignments at root\n"; + exit(-1); + } + + for(unsigned int v = 0; v < boost::num_vertices(I); v++) + { + symbol *sym = (symbol *)(hTabItemWithKey(liveRanges, I[v].v)); + if(winner.global[v] >= 0) + { + sym->regs[I[v].byte] = regshc08 + winner.global[v]; + sym->isspilt = false; + sym->nRegs = I[v].size; + sym->accuse = 0; + } + else + { + for(int i = 0; i < I[v].size; i++) + sym->regs[i] = 0; + sym->accuse = 0; + sym->nRegs = I[v].size; + wassert (sym->nRegs); + //spillThis(sym); Leave it to regFix, which can do some spillocation compaction. Todo: Use Thorup instead. + sym->isspilt = false; + } + } + + for(unsigned int i = 0; i < boost::num_vertices(G); i++) + set_surviving_regs(winner, i, G, I); // Never freed. Memory leak? + + return(!assignment_optimal); +} + +iCode *hc08_ralloc2_cc(ebbIndex *ebbi) +{ + iCode *ic; + +#ifdef DEBUG_RALLOC_DEC + std::cout << "Processing " << currFunc->name << " from " << dstFileName << "\n"; std::cout.flush(); +#endif + + cfg_t control_flow_graph; + + con_t conflict_graph; + + ic = create_cfg(control_flow_graph, conflict_graph, ebbi); + + if(options.dump_graphs) + dump_cfg(control_flow_graph); + + if(options.dump_graphs) + dump_con(conflict_graph); + + tree_dec_t tree_decomposition; + + thorup_tree_decomposition(tree_decomposition, control_flow_graph); + + nicify(tree_decomposition); + + alive_tree_dec(tree_decomposition, control_flow_graph); + + good_re_root(tree_decomposition); + nicify(tree_decomposition); + alive_tree_dec(tree_decomposition, control_flow_graph); + + if(options.dump_graphs) + dump_tree_decomposition(tree_decomposition); + + hc08_assignment_optimal = !tree_dec_ralloc(tree_decomposition, control_flow_graph, conflict_graph); + + return(ic); +} + diff -Nru sdcc-3.1.0+dfsg/src/mcs51/gen.c sdcc-3.2.0+dfsg/src/mcs51/gen.c --- sdcc-3.1.0+dfsg/src/mcs51/gen.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/mcs51/gen.c 2012-06-24 08:47:17.000000000 +0000 @@ -1,8 +1,8 @@ /*------------------------------------------------------------------------- gen.c - source file for code generation for 8051 - Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998) - and - Jean-Louis VERN.jlvern@writeme.com (1999) + Copyright (C) 1998, Sandeep Dutta . sandeep.dutta@usa.net + Copyright (C) 1999, Jean-Louis VERN.jlvern@writeme.com Bug Fixes - Wojciech Stryjewski wstryj1@tiger.lsu.edu (1999 v2.1.9a) This program is free software; you can redistribute it and/or modify it @@ -18,15 +18,12 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! - +-------------------------------------------------------------------*/ +/* Notes: 000123 mlh Moved aopLiteral to SDCCglue.c to help the split - Made everything static --------------------------------------------------------------------------*/ + Made everything static +*/ #define D(x) do if (options.verboseAsm) {x;} while(0) @@ -34,11 +31,8 @@ #include #include #include -#include "SDCCglobl.h" -#include "newalloc.h" #include "common.h" -#include "SDCCpeeph.h" #include "ralloc.h" #include "rtrack.h" #include "gen.h" @@ -46,7 +40,7 @@ char *aopLiteral (value * val, int offset); char *aopLiteralLong (value * val, int offset, int size); -char *aopLiteralGptr (const char * name, value * val); +char *aopLiteralGptr (const char *name, value * val); extern int allocInfo; /* this is the down and dirty file with all kinds of @@ -101,16 +95,14 @@ { struct { - short r0InB:2; //2 so we can see it overflow - short r1InB:2; //2 so we can see it overflow - short OpInB:2; //2 so we can see it overflow - short bitsInB:2; //2 so we can see it overflow + short r0InB: 2; //2 so we can see it overflow + short r1InB: 2; //2 so we can see it overflow + short OpInB: 2; //2 so we can see it overflow + short bitsInB: 2; //2 so we can see it overflow } bs; short BInUse; } bu; short accInUse; - short inLine; - short debugLine; struct { int pushed; @@ -122,12 +114,12 @@ int xoffset; } stack; set *sendSet; - iCode *current_iCode; symbol *currentFunc; } _G; -static char *rb1regs[] = { +static char *rb1regs[] = +{ "b1_0", "b1_1", "b1_2", "b1_3", "b1_4", "b1_5", "b1_6", "b1_7", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7" }; @@ -144,16 +136,13 @@ #define CLRC emitcode ("clr","c") #define SETC emitcode ("setb","c") -static lineNode *lineHead = NULL; -static lineNode *lineCurr = NULL; - static unsigned char SLMask[] = { 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, - 0xE0, 0xC0, 0x80, 0x00 -}; + 0xE0, 0xC0, 0x80, 0x00 + }; static unsigned char SRMask[] = { 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, - 0x07, 0x03, 0x01, 0x00 -}; + 0x07, 0x03, 0x01, 0x00 + }; #define LSB 0 #define MSB16 1 @@ -161,75 +150,15 @@ #define MSB32 3 /*-----------------------------------------------------------------*/ -/* emitcode - writes the code into a file : for now it is simple */ -/*-----------------------------------------------------------------*/ -void -emitcode (const char *inst, const char *fmt, ...) -{ - va_list ap; - struct dbuf_s dbuf; - const char *lbp, *lb; - - dbuf_init (&dbuf, INITIAL_INLINEASM); - - va_start (ap, fmt); - - if (inst && *inst) - { - dbuf_append_str (&dbuf, inst); - - if (fmt && *fmt) - { - dbuf_append_char (&dbuf, '\t'); - dbuf_tvprintf (&dbuf, fmt, ap); - } - } - else - { - dbuf_tvprintf (&dbuf, fmt, ap); - } - - lbp = lb = dbuf_c_str (&dbuf); - - while (isspace ((unsigned char) *lbp)) - { - lbp++; - } - - if (lbp) - { - rtrackUpdate (lbp); - - lineCurr = (lineCurr ? connectLine (lineCurr, newLineNode (lb)) : (lineHead = newLineNode (lb))); - - lineCurr->isInline = _G.inLine; - lineCurr->isDebug = _G.debugLine; - lineCurr->ic = _G.current_iCode; - lineCurr->isComment = (*lbp == ';'); - } - - va_end (ap); - - dbuf_destroy (&dbuf); -} - -static void -emitLabel (symbol * tlbl) -{ - emitcode ("", "!tlabeldef", tlbl->key + 100); - lineCurr->isLabel = 1; -} - -/*-----------------------------------------------------------------*/ /* mcs51_emitDebuggerSymbol - associate the current code location */ /* with a debugger symbol */ /*-----------------------------------------------------------------*/ void mcs51_emitDebuggerSymbol (const char *debugSym) { - _G.debugLine = 1; + genLine.lineElement.isDebug = 1; emitcode ("", "%s ==.", debugSym); - _G.debugLine = 0; + genLine.lineElement.isDebug = 0; } /*-----------------------------------------------------------------*/ @@ -280,7 +209,7 @@ /* emitpush - push something on internal stack */ /*-----------------------------------------------------------------*/ static void -emitpush (const char * arg) +emitpush (const char *arg) { char buf[] = "ar?"; @@ -300,7 +229,7 @@ arg = "acc"; } else if (EQ (arg, "r0") || EQ (arg, "r1") || EQ (arg, "r2") || EQ (arg, "r3") || - EQ (arg, "r4") || EQ (arg, "r5") || EQ (arg, "r6") || EQ (arg, "r7") ) + EQ (arg, "r4") || EQ (arg, "r5") || EQ (arg, "r6") || EQ (arg, "r7")) { buf[2] = arg[1]; arg = buf; @@ -312,7 +241,7 @@ /* emitpop - pop something from internal stack */ /*-----------------------------------------------------------------*/ static void -emitpop (const char * arg) +emitpop (const char *arg) { if (!arg) emitcode ("dec", "sp"); @@ -520,7 +449,7 @@ int offset; if (!ic) - ic = _G.current_iCode; + ic = genLine.lineElement.ic; if (!ic) return 0; if (!_G.currentFunc) @@ -686,7 +615,7 @@ } base = dbuf_detach_c_str (&tmpBuf); - offset += stackoffset(sym); + offset += stackoffset (sym); if ((abs (offset) < 3) || (accuse && (abs (offset) < 4))) { @@ -814,12 +743,12 @@ static asmop * aopForRemat (symbol * sym) { - iCode * ic = sym->rematiCode; - asmop * aop = newAsmop (AOP_IMMD); + iCode *ic = sym->rematiCode; + asmop *aop = newAsmop (AOP_IMMD); int ptr_type = 0; int val = 0; - sym_link * from_type = NULL; - const char * from_name = NULL; + sym_link *from_type = NULL; + const char *from_name = NULL; struct dbuf_s dbuf; for (;;) @@ -1191,41 +1120,41 @@ break; case AOP_STK: - { - int sz = aop->size; - symbol *sym = aop->aopu.aop_sym; - bitVectUnSetBit (ic->rUsed, R0_IDX); - bitVectUnSetBit (ic->rUsed, R1_IDX); + { + int sz = aop->size; + symbol *sym = aop->aopu.aop_sym; + bitVectUnSetBit (ic->rUsed, R0_IDX); + bitVectUnSetBit (ic->rUsed, R1_IDX); - getFreePtr (ic, aop, FALSE); + getFreePtr (ic, aop, FALSE); - aopPtrForSym (sym, FALSE, aop->size - 1, aop); + aopPtrForSym (sym, FALSE, aop->size - 1, aop); - while (sz--) - { - emitpop ("acc"); - if (aop->paged) - emitcode ("movx", "@%s,a", aop->aopu.aop_ptr->name); - else - emitcode ("mov", "@%s,a", aop->aopu.aop_ptr->name); - if (!sz) - break; - emitcode ("dec", "%s", aop->aopu.aop_ptr->name); - } - op->aop = aop; - freeAsmop (op, NULL, ic, TRUE); - if (_G.r1Pushed) - { - emitpop ("ar1"); - _G.r1Pushed--; - } - if (_G.r0Pushed) - { - emitpop ("ar0"); - _G.r0Pushed--; - } - } - break; + while (sz--) + { + emitpop ("acc"); + if (aop->paged) + emitcode ("movx", "@%s,a", aop->aopu.aop_ptr->name); + else + emitcode ("mov", "@%s,a", aop->aopu.aop_ptr->name); + if (!sz) + break; + emitcode ("dec", "%s", aop->aopu.aop_ptr->name); + } + op->aop = aop; + freeAsmop (op, NULL, ic, TRUE); + if (_G.r1Pushed) + { + emitpop ("ar1"); + _G.r1Pushed--; + } + if (_G.r0Pushed) + { + emitpop ("ar0"); + _G.r0Pushed--; + } + } + break; } dealloc: @@ -1272,7 +1201,7 @@ } else if (_G.r0Pushed) { - emitcode ("pop", "ar0"); /* without pushed-- */ + emitcode ("pop", "ar0"); /* without pushed-- */ } break; @@ -1283,30 +1212,30 @@ } else if (_G.r1Pushed) { - emitcode ("pop", "ar1"); /* without pushed-- */ + emitcode ("pop", "ar1"); /* without pushed-- */ } break; case AOP_STK: - { - int sz = aop->size; + { + int sz = aop->size; - emitcode ("mov", "b,r0"); - aopPtrForSym (aop->aopu.aop_sym, FALSE, 0, aop); + emitcode ("mov", "b,r0"); + aopPtrForSym (aop->aopu.aop_sym, FALSE, 0, aop); - while (sz--) - { - emitcode ("pop", "acc"); /* without pushed-- */ - if (aop->paged) - emitcode ("movx", "@r0,a"); - else - emitcode ("mov", "@r0,a"); - if (!sz) - break; - emitcode ("dec", "r0"); - } - emitcode ("mov", "r0,b"); - } + while (sz--) + { + emitcode ("pop", "acc"); /* without pushed-- */ + if (aop->paged) + emitcode ("movx", "@r0,a"); + else + emitcode ("mov", "@r0,a"); + if (!sz) + break; + emitcode ("dec", "r0"); + } + emitcode ("mov", "r0,b"); + } } } @@ -1416,7 +1345,7 @@ asmop *aop = AOP (oper); static struct dbuf_s dbuf = { 0 }; - if (dbuf_is_initialized(&dbuf)) + if (dbuf_is_initialized (&dbuf)) { /* reuse the dynamically allocated buffer */ dbuf_set_length (&dbuf, 0); @@ -1523,9 +1452,9 @@ break; case AOP_DIR: - if (SPEC_SCLS (getSpec (operandType (oper))) == S_SFR && offset) + if ((SPEC_SCLS (getSpec (operandType (oper))) == S_SFR) && (aop->size > 1)) { - dbuf_printf (&dbuf, "(%s >> %d)", aop->aopu.aop_dir, offset * 8); + dbuf_printf (&dbuf, "((%s >> %d) & 0xFF)", aop->aopu.aop_dir, offset * 8); } else if (offset) { @@ -1554,7 +1483,7 @@ break; case AOP_LIT: - if (opIsGptr(oper) && IS_FUNCPTR (operandType(oper)) && offset == GPTRSIZE-1) + if (opIsGptr (oper) && IS_FUNCPTR (operandType (oper)) && offset == GPTRSIZE - 1) { dbuf_append_str (&dbuf, aopLiteralGptr (NULL, aop->aopu.aop_lit)); } @@ -1637,7 +1566,7 @@ const char *d = NULL; static struct dbuf_s dbuf = { 0 }; - if (dbuf_is_initialized(&dbuf)) + if (dbuf_is_initialized (&dbuf)) { /* reuse the dynamically allocated buffer */ dbuf_set_length (&dbuf, 0); @@ -1664,29 +1593,27 @@ break; case AOP_DIR: - { - if (SPEC_SCLS (getSpec (operandType (result))) == S_SFR && offset) - { - dbuf_printf (&dbuf, "(%s >> %d)", aop->aopu.aop_dir, offset * 8); - } - else if (offset) - { - dbuf_printf (&dbuf, "(%s + %d)", aop->aopu.aop_dir, offset); - } - else - { - dbuf_append_str (&dbuf, aop->aopu.aop_dir); - } + if ((SPEC_SCLS (getSpec (operandType (result))) == S_SFR) && (aop->size > 1)) + { + dbuf_printf (&dbuf, "((%s >> %d) & 0xFF)", aop->aopu.aop_dir, offset * 8); + } + else if (offset) + { + dbuf_printf (&dbuf, "(%s + %d)", aop->aopu.aop_dir, offset); + } + else + { + dbuf_append_str (&dbuf, aop->aopu.aop_dir); + } - if (!EQ (dbuf_c_str (&dbuf), s) || bvolatile) - { - emitcode ("mov", "%s,%s", dbuf_c_str (&dbuf), s); - } - if (EQ (dbuf_c_str (&dbuf), "acc")) - { - accuse = TRUE; - } - } + if (!EQ (dbuf_c_str (&dbuf), s) || bvolatile) + { + emitcode ("mov", "%s,%s", dbuf_c_str (&dbuf), s); + } + if (EQ (dbuf_c_str (&dbuf), "acc")) + { + accuse = TRUE; + } break; case AOP_REG: @@ -1694,7 +1621,7 @@ { if (*s == '@' || EQ (s, "r0") || EQ (s, "r1") || EQ (s, "r2") || EQ (s, "r3") || - EQ (s, "r4") || EQ (s, "r5") || EQ (s, "r6") || EQ (s, "r7") ) + EQ (s, "r4") || EQ (s, "r5") || EQ (s, "r6") || EQ (s, "r7")) { emitcode ("mov", "%s,%s", aop->aopu.aop_reg[offset]->dname, s); } @@ -1757,7 +1684,7 @@ emitcode ("mov", "@%s,a", aop->aopu.aop_ptr->name); } else if (EQ (s, "r0") || EQ (s, "r1") || EQ (s, "r2") || EQ (s, "r3") || - EQ (s, "r4") || EQ (s, "r5") || EQ (s, "r6") || EQ (s, "r7") ) + EQ (s, "r4") || EQ (s, "r5") || EQ (s, "r6") || EQ (s, "r7")) { dbuf_printf (&dbuf, "a%s", s); emitcode ("mov", "@%s,%s", aop->aopu.aop_ptr->name, dbuf_c_str (&dbuf)); @@ -2028,7 +1955,7 @@ } MOVA (aopGet (oper, offset++, FALSE, FALSE)); if (IS_FLOAT (type)) - emitcode ("anl", "a,#0x7F"); //clear sign bit + emitcode ("anl", "a,#0x7F"); //clear sign bit emitcode ("orl", "a,b"); popB (pushedB); } @@ -2089,7 +2016,7 @@ else { toCarry (right); - aopPut (result, "c", 0); + outBitC (result); } } @@ -2153,7 +2080,7 @@ /* set C, if a == 0 */ tlbl = newiTempLabel (NULL); - emitcode ("cjne", "a,#0x01,!tlabel", tlbl->key + 100); + emitcode ("cjne", "a,#0x01,!tlabel", labelKey2num (tlbl->key)); emitLabel (tlbl); outBitC (IC_RESULT (ic)); @@ -2200,12 +2127,12 @@ if ((AOP_TYPE (IC_LEFT (ic)) == AOP_ACC && offset == 0) || AOP_TYPE (IC_LEFT (ic)) == AOP_REG || IS_AOP_PREG (IC_LEFT (ic))) { - emitcode ("cjne", "%s,#0xFF,!tlabel", l, tlbl->key + 100); + emitcode ("cjne", "%s,#0xFF,!tlabel", l, labelKey2num (tlbl->key)); } else { MOVA (l); - emitcode ("cjne", "a,#0xFF,!tlabel", tlbl->key + 100); + emitcode ("cjne", "a,#0xFF,!tlabel", labelKey2num (tlbl->key)); } emitLabel (tlbl); outBitC (IC_RESULT (ic)); @@ -2451,7 +2378,7 @@ emitcode ("lcall", "___sdcc_xpush_regs_r0\t;(%s)", szRegs); else emitcode ("lcall", "___sdcc_xpush_regs\t;(%s)", szRegs); - lineCurr->isInline = 1; + genLine.lineCurr->isInline = 1; if (BINUSE) emitpop ("b"); _G.stack.xpushed += count; @@ -2563,7 +2490,7 @@ emitcode ("lcall", "___sdcc_xpop_regs_r0\t;(%s)", szRegs); else emitcode ("lcall", "___sdcc_xpop_regs\t;(%s)", szRegs); - lineCurr->isInline = 1; + genLine.lineCurr->isInline = 1; _G.stack.xpushed -= count; } else @@ -2827,7 +2754,7 @@ aopOp (IC_LEFT (ic), ic, FALSE); size = AOP_SIZE (IC_LEFT (ic)); - offset = (size - 1); + offset = size - 1; while (size--) { emitpop (aopGet (IC_LEFT (ic), offset--, FALSE, TRUE)); @@ -3127,7 +3054,8 @@ if (_G.sendSet) { if (IFFUNC_ISREENT (dtype)) - { /* need to reverse the send set */ + { + /* need to reverse the send set */ genSend (reverseSet (_G.sendSet)); } else @@ -3200,13 +3128,11 @@ } /* if we need assign a result value */ - if ((IS_ITEMP (IC_RESULT (ic)) && + if ((IS_ITEMP (IC_RESULT (ic)) && !IS_BIT (OP_SYM_ETYPE (IC_RESULT (ic))) && - (OP_SYMBOL (IC_RESULT (ic))->nRegs || - OP_SYMBOL (IC_RESULT (ic))->accuse || - OP_SYMBOL (IC_RESULT (ic))->spildir || - IS_BIT (etype) ) ) || - IS_TRUE_SYMOP (IC_RESULT (ic))) + (OP_SYMBOL (IC_RESULT (ic))->nRegs || + OP_SYMBOL (IC_RESULT (ic))->accuse || + OP_SYMBOL (IC_RESULT (ic))->spildir || IS_BIT (etype))) || IS_TRUE_SYMOP (IC_RESULT (ic))) { _G.accInUse++; aopOp (IC_RESULT (ic), ic, FALSE); @@ -3408,9 +3334,9 @@ else if (_G.sendSet) { /* push the return address on to the stack */ - emitcode ("mov", "a,#!tlabel", (rlbl->key + 100)); + emitcode ("mov", "a,#!tlabel", labelKey2num (rlbl->key)); emitpush ("acc"); - emitcode ("mov", "a,#(!tlabel >> 8)", (rlbl->key + 100)); + emitcode ("mov", "a,#(!tlabel >> 8)", labelKey2num (rlbl->key)); emitpush ("acc"); /* now push the function address */ @@ -3593,7 +3519,7 @@ emitcode (";", "-----------------------------------------"); emitcode ("", "%s:", sym->rname); - lineCurr->isLabel = 1; + genLine.lineCurr->isLabel = 1; ftype = operandType (IC_LEFT (ic)); _G.currentFunc = sym; @@ -3873,14 +3799,14 @@ { int ofs; - _G.current_iCode = ric; + genLine.lineElement.ic = ric; D (emitcode (";", "genReceive")); for (ofs = 0; ofs < sym->recvSize; ofs++) { if (EQ (fReturn[ofs], "a")) - emitcode ("push", "acc"); /* without pushed++ */ + emitcode ("push", "acc"); /* without pushed++ */ else - emitcode ("push", fReturn[ofs]); /* without pushed++ */ + emitcode ("push", fReturn[ofs]); /* without pushed++ */ } stackAdjust -= sym->recvSize; if (stackAdjust < 0) @@ -3888,7 +3814,7 @@ assert (stackAdjust >= 0); stackAdjust = 0; } - _G.current_iCode = ic; + genLine.lineElement.ic = ic; ric->generated = 1; accIsFree = 1; } @@ -3898,13 +3824,13 @@ { int ofs; - _G.current_iCode = ric; + genLine.lineElement.ic = ric; D (emitcode (";", "genReceive")); for (ofs = 0; ofs < sym->recvSize; ofs++) { emitcode ("mov", "%s,%s", rsym->regs[ofs]->name, fReturn[ofs]); } - _G.current_iCode = ic; + genLine.lineElement.ic = ic; ric->generated = 1; accIsFree = 1; } @@ -4009,10 +3935,10 @@ { symbol *tlbl = newiTempLabel (NULL); emitcode ("setb", "c"); - emitcode ("jbc", "ea,!tlabel", tlbl->key + 100); /* atomic test & clear */ + emitcode ("jbc", "ea,!tlabel", labelKey2num (tlbl->key)); /* atomic test & clear */ emitcode ("clr", "c"); emitLabel (tlbl); - emitpush ("psw"); /* save old ea via c in psw */ + emitpush ("psw"); /* save old ea via c in psw */ } } @@ -4024,7 +3950,7 @@ { symbol *sym = OP_SYMBOL (IC_LEFT (ic)); bool fReentrant = (IFFUNC_ISREENT (sym->type) || options.stackAuto); - lineNode *lineBodyEnd = lineCurr; + lineNode *lineBodyEnd = genLine.lineCurr; lineNode *linePrologueStart = NULL; lineNode *lnp; bitVect *regsUsed; @@ -4045,13 +3971,13 @@ if (IS_BIT (OP_SYM_ETYPE (IC_LEFT (ic)))) { emitcode ("rlc", "a"); /* save c in a */ - emitpop ("psw"); /* restore ea via c in psw */ + emitpop ("psw"); /* restore ea via c in psw */ emitcode ("mov", "ea,c"); emitcode ("rrc", "a"); /* restore c from a */ } else { - emitpop ("psw"); /* restore ea via c in psw */ + emitpop ("psw"); /* restore ea via c in psw */ emitcode ("mov", "ea,c"); } } @@ -4116,10 +4042,10 @@ } if (acc_in_r0) - emitcode ("xch", "a,r0"); /* restore a from r0 */ + emitcode ("xch", "a,r0"); /* restore a from r0 */ if (cy_in_r0) - emitcode ("mov", "psw,r0"); /* restore c from r0 */ + emitcode ("mov", "psw,r0"); /* restore c from r0 */ } else { @@ -4131,7 +4057,7 @@ emitcode ("dec", "sp"); else emitcode ("mov", "sp,_bp"); - emitcode ("pop", "_bp"); /* without pushed-- */ + emitcode ("pop", "_bp"); /* without pushed-- */ } if (sym->xstack || FUNC_HASSTACKPARM (sym->type)) { @@ -4140,7 +4066,7 @@ emitcode ("dec", "r0"); emitcode ("movx", "a,@r0"); emitcode ("xch", "a,_bpx"); - emitcode ("mov", "%s,r0", spname); //read before freeing stack space (interrupts) + emitcode ("mov", "%s,r0", spname); //read before freeing stack space (interrupts) } } else if (sym->stack || FUNC_HASSTACKPARM (sym->type)) @@ -4149,7 +4075,7 @@ emitcode ("dec", "sp"); else if (sym->stack) emitcode ("mov", "sp,_bp"); - emitcode ("pop", "_bp"); /* without pushed-- */ + emitcode ("pop", "_bp"); /* without pushed-- */ } } } @@ -4323,9 +4249,8 @@ { /* Remove change of register bank if no registers used */ if (lnp->ic && lnp->ic->op == FUNCTION && - !strncmp(lnp->line, "mov", 3) && - bitVectFirstBit (port->peep.getRegsWritten(lnp)) == CND_IDX && - !bitVectBitsInCommon (mcs51_allBankregs (), regsUsed)) + !strncmp (lnp->line, "mov", 3) && + bitVectFirstBit (port->peep.getRegsWritten (lnp)) == CND_IDX && !bitVectBitsInCommon (mcs51_allBankregs (), regsUsed)) { emitcode (";", "eliminated unneeded mov psw,# (no regs used in bank)"); connectLine (lnp->prev, lnp->next); @@ -4357,7 +4282,7 @@ /* Remove the unneeded push/pops */ regsUnneeded = newBitVect (mcs51_nRegs); - for (lnp = lineCurr; lnp != linePrologueStart; lnp = lnp->prev) + for (lnp = genLine.lineCurr; lnp != linePrologueStart; lnp = lnp->prev) { if (lnp->ic) { @@ -4449,7 +4374,7 @@ if the next is not the return statement */ if (!(ic->next && ic->next->op == LABEL && IC_LABEL (ic->next) == returnLabel)) { - emitcode ("ljmp", "!tlabel", (returnLabel->key + 100)); + emitcode ("ljmp", "!tlabel", labelKey2num (returnLabel->key)); } } @@ -4472,7 +4397,7 @@ static void genGoto (iCode * ic) { - emitcode ("ljmp", "!tlabel", (IC_LABEL (ic)->key + 100)); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_LABEL (ic)->key)); } /*-----------------------------------------------------------------*/ @@ -4509,12 +4434,12 @@ emitcode ("inc", "%s", l); if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG || IS_AOP_PREG (IC_RESULT (ic))) { - emitcode ("cjne", "%s,%s,!tlabel", l, zero, tlbl->key + 100); + emitcode ("cjne", "%s,%s,!tlabel", l, zero, labelKey2num (tlbl->key)); } else { emitcode ("clr", "a"); - emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100); + emitcode ("cjne", "a,%s,!tlabel", l, labelKey2num (tlbl->key)); } l = aopGet (IC_RESULT (ic), MSB16, FALSE, FALSE); @@ -4523,15 +4448,15 @@ { if (EQ (l, "acc")) { - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); } else if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG || IS_AOP_PREG (IC_RESULT (ic))) { - emitcode ("cjne", "%s,%s,!tlabel", l, zero, tlbl->key + 100); + emitcode ("cjne", "%s,%s,!tlabel", l, zero, labelKey2num (tlbl->key)); } else { - emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100); + emitcode ("cjne", "a,%s,!tlabel", l, labelKey2num (tlbl->key)); } l = aopGet (IC_RESULT (ic), MSB24, FALSE, FALSE); @@ -4541,15 +4466,15 @@ { if (EQ (l, "acc")) { - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); } else if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG || IS_AOP_PREG (IC_RESULT (ic))) { - emitcode ("cjne", "%s,%s,!tlabel", l, zero, tlbl->key + 100); + emitcode ("cjne", "%s,%s,!tlabel", l, zero, labelKey2num (tlbl->key)); } else { - emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100); + emitcode ("cjne", "a,%s,!tlabel", l, labelKey2num (tlbl->key)); } emitcode ("inc", "%s", aopGet (IC_RESULT (ic), MSB32, FALSE, FALSE)); @@ -4636,7 +4561,7 @@ } else { - emitcode ("jz", "!tlabel", tlbl->key + 100); + emitcode ("jz", "!tlabel", labelKey2num (tlbl->key)); emitcode ("mov", "a,%s", one); emitLabel (tlbl); outAcc (result); @@ -4655,7 +4580,7 @@ if (AOP_TYPE (IC_RESULT (ic)) == AOP_CRY) { symbol *lbl = newiTempLabel (NULL); - emitcode ("jnb", "%s,!tlabel", AOP (IC_RIGHT (ic))->aopu.aop_dir, (lbl->key + 100)); + emitcode ("jnb", "%s,!tlabel", AOP (IC_RIGHT (ic))->aopu.aop_dir, labelKey2num (lbl->key)); emitcode ("cpl", "c"); emitLabel (lbl); outBitC (IC_RESULT (ic)); @@ -4908,12 +4833,12 @@ if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG || IS_AOP_PREG (IC_RESULT (ic))) { - emitcode ("cjne", "%s,#!constbyte,!tlabel", l, 0xff, tlbl->key + 100); + emitcode ("cjne", "%s,#!constbyte,!tlabel", l, 0xff, labelKey2num (tlbl->key)); } else { emitcode ("mov", "a,#!constbyte", 0xff); - emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100); + emitcode ("cjne", "a,%s,!tlabel", l, labelKey2num (tlbl->key)); } l = aopGet (IC_RESULT (ic), MSB16, FALSE, FALSE); emitcode ("dec", "%s", l); @@ -4921,16 +4846,15 @@ { if (EQ (l, "acc")) { - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); } - else if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG || - IS_AOP_PREG (IC_RESULT (ic))) + else if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG || IS_AOP_PREG (IC_RESULT (ic))) { - emitcode ("cjne", "%s,#!constbyte,!tlabel", l, 0xff, tlbl->key + 100); + emitcode ("cjne", "%s,#!constbyte,!tlabel", l, 0xff, labelKey2num (tlbl->key)); } else { - emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100); + emitcode ("cjne", "a,%s,!tlabel", l, labelKey2num (tlbl->key)); } l = aopGet (IC_RESULT (ic), MSB24, FALSE, FALSE); emitcode ("dec", "%s", l); @@ -4939,16 +4863,15 @@ { if (EQ (l, "acc")) { - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); } - else if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG || - IS_AOP_PREG (IC_RESULT (ic))) + else if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG || IS_AOP_PREG (IC_RESULT (ic))) { - emitcode ("cjne", "%s,#!constbyte,!tlabel", l, 0xff, tlbl->key + 100); + emitcode ("cjne", "%s,#!constbyte,!tlabel", l, 0xff, labelKey2num (tlbl->key)); } else { - emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100); + emitcode ("cjne", "a,%s,!tlabel", l, labelKey2num (tlbl->key)); } emitcode ("dec", "%s", aopGet (IC_RESULT (ic), MSB32, FALSE, FALSE)); } @@ -5040,7 +4963,7 @@ if (AOP_TYPE (IC_RESULT (ic)) == AOP_CRY) { emitcode ("mov", "c,%s", AOP (IC_LEFT (ic))->aopu.aop_dir); - emitcode ("jnb", "%s,!tlabel", AOP (IC_RIGHT (ic))->aopu.aop_dir, (lbl->key + 100)); + emitcode ("jnb", "%s,!tlabel", AOP (IC_RIGHT (ic))->aopu.aop_dir, labelKey2num (lbl->key)); emitcode ("cpl", "c"); emitLabel (lbl); outBitC (IC_RESULT (ic)); @@ -5049,7 +4972,7 @@ { emitcode ("mov", "c,%s", AOP (IC_RIGHT (ic))->aopu.aop_dir); emitcode ("subb", "a,acc"); - emitcode ("jnb", "%s,!tlabel", AOP (IC_LEFT (ic))->aopu.aop_dir, (lbl->key + 100)); + emitcode ("jnb", "%s,!tlabel", AOP (IC_LEFT (ic))->aopu.aop_dir, labelKey2num (lbl->key)); emitcode ("inc", "a"); emitLabel (lbl); aopPut (IC_RESULT (ic), "a", 0); @@ -5100,7 +5023,7 @@ if (useCarry || ((lit >> (offset * 8)) & 0x0FFL)) { MOVA (aopGet (IC_LEFT (ic), offset, FALSE, FALSE)); - if (!offset && !size && lit == (unsigned long) -1) + if (!offset && !size && lit == (unsigned long) - 1) { emitcode ("dec", "a"); } @@ -5338,7 +5261,7 @@ { MOVA (aopGet (right, 0, FALSE, FALSE)); lbl = newiTempLabel (NULL); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "F0"); /* complement sign flag */ emitcode ("cpl", "a"); /* 2's complement */ emitcode ("inc", "a"); @@ -5363,7 +5286,7 @@ if (!lUnsigned) { lbl = newiTempLabel (NULL); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "F0"); /* complement sign flag */ emitcode ("cpl", "a"); /* 2's complement */ emitcode ("inc", "a"); @@ -5377,7 +5300,7 @@ { lbl = newiTempLabel (NULL); if (runtimeSign) - emitcode ("jnb", "F0,!tlabel", lbl->key + 100); + emitcode ("jnb", "F0,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "a"); /* lsb 2's complement */ if (size != 2) emitcode ("inc", "a"); /* inc doesn't set carry flag */ @@ -5597,7 +5520,7 @@ { MOVA (aopGet (right, 0, FALSE, FALSE)); lbl = newiTempLabel (NULL); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "F0"); /* complement sign flag */ emitcode ("cpl", "a"); /* 2's complement */ emitcode ("inc", "a"); @@ -5622,7 +5545,7 @@ if (!lUnsigned) { lbl = newiTempLabel (NULL); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "F0"); /* complement sign flag */ emitcode ("cpl", "a"); /* 2's complement */ emitcode ("inc", "a"); @@ -5637,7 +5560,7 @@ { lbl = newiTempLabel (NULL); if (runtimeSign) - emitcode ("jnb", "F0,!tlabel", lbl->key + 100); + emitcode ("jnb", "F0,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "a"); /* lsb 2's complement */ emitcode ("inc", "a"); emitLabel (lbl); @@ -5792,8 +5715,8 @@ emitcode ("mov", "c,acc.7"); emitcode ("anl", "a,#0x%02x", val - 1); lbl = newiTempLabel (NULL); - emitcode ("jz", "!tlabel", lbl->key + 100); - emitcode ("jnc", "!tlabel", lbl->key + 100); + emitcode ("jz", "!tlabel", labelKey2num (lbl->key)); + emitcode ("jnc", "!tlabel", labelKey2num (lbl->key)); emitcode ("orl", "a,#0x%02x", 0xff ^ (val - 1)); if (size) { @@ -5804,7 +5727,7 @@ while (size2--) aopPut (result, "#0xff", offs2++); lbl2 = newiTempLabel (NULL); - emitcode ("sjmp", "!tlabel", lbl2->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (lbl2->key)); } emitLabel (lbl); aopPut (result, "a", 0); @@ -5860,7 +5783,7 @@ { MOVA (aopGet (right, 0, FALSE, FALSE)); lbl = newiTempLabel (NULL); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "a"); /* 2's complement */ emitcode ("inc", "a"); emitLabel (lbl); @@ -5897,7 +5820,7 @@ emitcode ("clr", "F0"); /* clear sign flag */ lbl = newiTempLabel (NULL); - emitcode ("jnb", "acc.7,!tlabel", lbl->key + 100); + emitcode ("jnb", "acc.7,!tlabel", labelKey2num (lbl->key)); emitcode ("setb", "F0"); /* set sign flag */ emitcode ("cpl", "a"); /* 2's complement */ emitcode ("inc", "a"); @@ -5913,7 +5836,7 @@ emitcode ("mov", "a,b"); lbl = newiTempLabel (NULL); if (runtimeSign) - emitcode ("jnb", "F0,!tlabel", lbl->key + 100); + emitcode ("jnb", "F0,!tlabel", labelKey2num (lbl->key)); emitcode ("cpl", "a"); /* 2's complement */ emitcode ("inc", "a"); emitLabel (lbl); @@ -6014,11 +5937,11 @@ inst = ((EQ (jval, "a") ? "jnz" : (EQ (jval, "c") ? "jc" : "jb"))); } if (EQ (inst, "jb") || EQ (inst, "jnb")) - emitcode (inst, "%s,!tlabel", jval, (tlbl->key + 100)); + emitcode (inst, "%s,!tlabel", jval, labelKey2num (tlbl->key)); else - emitcode (inst, "!tlabel", tlbl->key + 100); + emitcode (inst, "!tlabel", labelKey2num (tlbl->key)); freeForBranchAsmops (result, right, left); - emitcode ("ljmp", "!tlabel", jlbl->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (jlbl->key)); emitLabel (tlbl); /* mark the icode as generated */ @@ -6064,12 +5987,11 @@ size = max (AOP_SIZE (left), AOP_SIZE (right)); /* if unsigned char cmp with lit, do cjne left,#right,zz */ - if (size == 1 && !sign && AOP_TYPE (right) == AOP_LIT && - AOP_TYPE (left) != AOP_DIR && AOP_TYPE (left) != AOP_STR) + if (size == 1 && !sign && AOP_TYPE (right) == AOP_LIT && AOP_TYPE (left) != AOP_DIR && AOP_TYPE (left) != AOP_STR) { char *l = Safe_strdup (aopGet (left, offset, FALSE, FALSE)); symbol *lbl = newiTempLabel (NULL); - emitcode ("cjne", "%s,%s,!tlabel", l, aopGet (right, offset, FALSE, FALSE), lbl->key + 100); + emitcode ("cjne", "%s,%s,!tlabel", l, aopGet (right, offset, FALSE, FALSE), labelKey2num (lbl->key)); Safe_free (l); emitLabel (lbl); } @@ -6104,7 +6026,8 @@ goto release; } else - { //nonzero literal + { + //nonzero literal int bytelit = ((lit >> (offset * 8)) & 0x0FFL); while (size && (bytelit == 0)) { @@ -6265,25 +6188,19 @@ { int size = max (AOP_SIZE (left), AOP_SIZE (right)); int offset = 0; - unsigned long lit = 0L; D (emitcode (";", "gencjneshort")); /* if the left side is a literal or if the right is in a pointer register and left is not */ - if ((AOP_TYPE (left) == AOP_LIT) || - (AOP_TYPE (left) == AOP_IMMD) || - (AOP_TYPE (left) == AOP_DIR) || - (IS_AOP_PREG (right) && !IS_AOP_PREG (left))) + if ((AOP_TYPE (left) == AOP_LIT) || + (AOP_TYPE (left) == AOP_IMMD) || (AOP_TYPE (left) == AOP_DIR) || (IS_AOP_PREG (right) && !IS_AOP_PREG (left))) { operand *t = right; right = left; left = t; } - if (AOP_TYPE (right) == AOP_LIT) - lit = ulFromVal (AOP (right)->aopu.aop_lit); - /* generic pointers require special handling since all NULL pointers must compare equal */ if (opIsGptr (left) || opIsGptr (right)) { @@ -6296,22 +6213,21 @@ emitcode ("lcall", "___gptr_cmp"); for (offset = 0; offset < GPTRSIZE; offset++) emitpop (NULL); - emitcode ("jnz", "!tlabel", lbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (lbl->key)); } /* if the right side is a literal then anything goes */ else if (AOP_TYPE (right) == AOP_LIT && - AOP_TYPE (left) != AOP_DIR && AOP_TYPE (left) != AOP_IMMD && - AOP_TYPE (left) != AOP_STR) + AOP_TYPE (left) != AOP_DIR && AOP_TYPE (left) != AOP_IMMD && AOP_TYPE (left) != AOP_STR) { while (size--) { char *l = Safe_strdup (aopGet (left, offset, FALSE, FALSE)); const char *r = aopGet (right, offset, FALSE, FALSE); - if (EQ(l, "a") && EQ(r, zero)) - emitcode ("jnz", "!tlabel", lbl->key + 100); + if (EQ (l, "a") && EQ (r, zero)) + emitcode ("jnz", "!tlabel", labelKey2num (lbl->key)); else - emitcode ("cjne", "%s,%s,!tlabel", l, r, lbl->key + 100); + emitcode ("cjne", "%s,%s,!tlabel", l, r, labelKey2num (lbl->key)); Safe_free (l); offset++; } @@ -6323,8 +6239,7 @@ AOP_TYPE (right) == AOP_DIR || AOP_TYPE (right) == AOP_LIT || AOP_TYPE (right) == AOP_IMMD || - (AOP_TYPE (left) == AOP_DIR && AOP_TYPE (right) == AOP_LIT) || - (IS_AOP_PREG (left) && !IS_AOP_PREG (right))) + (AOP_TYPE (left) == AOP_DIR && AOP_TYPE (right) == AOP_LIT) || (IS_AOP_PREG (left) && !IS_AOP_PREG (right))) { while (size--) { @@ -6332,9 +6247,9 @@ MOVA (aopGet (left, offset, FALSE, FALSE)); r = aopGet (right, offset, FALSE, TRUE); if (EQ (r, zero)) - emitcode ("jnz", "!tlabel", lbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (lbl->key)); else - emitcode ("cjne", "a,%s,!tlabel", r, lbl->key + 100); + emitcode ("cjne", "a,%s,!tlabel", r, labelKey2num (lbl->key)); offset++; } } @@ -6347,7 +6262,7 @@ wassertl (!BINUSE, "B was in use"); MOVB (aopGet (left, offset, FALSE, FALSE)); MOVA (aopGet (right, offset, FALSE, FALSE)); - emitcode ("cjne", "a,b,!tlabel", lbl->key + 100); + emitcode ("cjne", "a,b,!tlabel", labelKey2num (lbl->key)); offset++; } } @@ -6369,7 +6284,7 @@ SETC; else MOVA (one); - emitcode ("sjmp", "!tlabel", tlbl->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (tlbl->key)); emitLabel (lbl); if (useCarry) CLRC; @@ -6431,7 +6346,7 @@ { symbol *lbl = newiTempLabel (NULL); emitcode ("mov", "c,%s", AOP (left)->aopu.aop_dir); - emitcode ("jb", "%s,!tlabel", AOP (right)->aopu.aop_dir, (lbl->key + 100)); + emitcode ("jb", "%s,!tlabel", AOP (right)->aopu.aop_dir, labelKey2num ((lbl->key))); emitcode ("cpl", "c"); emitLabel (lbl); } @@ -6440,17 +6355,17 @@ tlbl = newiTempLabel (NULL); if (IC_TRUE (ifx)) { - emitcode ("jnc", "!tlabel", tlbl->key + 100); + emitcode ("jnc", "!tlabel", labelKey2num (tlbl->key)); freeForBranchAsmops (result, right, left); popForBranch (popIc, FALSE); - emitcode ("ljmp", "!tlabel", IC_TRUE (ifx)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_TRUE (ifx)->key)); } else { - emitcode ("jc", "!tlabel", tlbl->key + 100); + emitcode ("jc", "!tlabel", labelKey2num (tlbl->key)); freeForBranchAsmops (result, right, left); popForBranch (popIc, FALSE); - emitcode ("ljmp", "!tlabel", IC_FALSE (ifx)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_FALSE (ifx)->key)); } emitLabel (tlbl); } @@ -6462,17 +6377,17 @@ { freeForBranchAsmops (result, right, left); popForBranch (popIc, FALSE); - emitcode ("ljmp", "!tlabel", IC_TRUE (ifx)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_TRUE (ifx)->key)); emitLabel (tlbl); } else { symbol *lbl = newiTempLabel (NULL); - emitcode ("sjmp", "!tlabel", lbl->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (lbl->key)); emitLabel (tlbl); freeForBranchAsmops (result, right, left); popForBranch (popIc, FALSE); - emitcode ("ljmp", "!tlabel", IC_FALSE (ifx)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_FALSE (ifx)->key)); emitLabel (lbl); } } @@ -6506,7 +6421,7 @@ { symbol *lbl = newiTempLabel (NULL); emitcode ("mov", "c,%s", AOP (left)->aopu.aop_dir); - emitcode ("jb", "%s,!tlabel", AOP (right)->aopu.aop_dir, (lbl->key + 100)); + emitcode ("jb", "%s,!tlabel", AOP (right)->aopu.aop_dir, labelKey2num (lbl->key)); emitcode ("cpl", "c"); emitLabel (lbl); } @@ -6555,29 +6470,6 @@ } /*-----------------------------------------------------------------*/ -/* ifxForOp - returns the icode containing the ifx for operand */ -/*-----------------------------------------------------------------*/ -static iCode * -ifxForOp (operand * op, iCode * ic) -{ - iCode *ifxIc; - - /* if true symbol then needs to be assigned */ - if (IS_TRUE_SYMOP (op)) - return NULL; - - /* if this has register type condition and - while skipping ipop's (see bug 1509084), - the next instruction is ifx with the same operand - and live to of the operand is upto the ifx only then */ - for (ifxIc = ic->next; ifxIc && ifxIc->op == IPOP; ifxIc = ifxIc->next); - if (ifxIc && ifxIc->op == IFX && IC_COND (ifxIc)->key == op->key && OP_SYMBOL (op)->liveTo <= ifxIc->seq) - return ifxIc; - - return NULL; -} - -/*-----------------------------------------------------------------*/ /* hasInc - operand is incremented before any other use */ /*-----------------------------------------------------------------*/ static iCode * @@ -6650,7 +6542,7 @@ { tlbl = newiTempLabel (NULL); toBoolean (left); - emitcode ("jz", "!tlabel", tlbl->key + 100); + emitcode ("jz", "!tlabel", labelKey2num (tlbl->key)); toBoolean (right); emitLabel (tlbl); outBitAcc (result); @@ -6691,7 +6583,7 @@ { tlbl = newiTempLabel (NULL); toBoolean (left); - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); toBoolean (right); emitLabel (tlbl); outBitAcc (result); @@ -6709,13 +6601,13 @@ isLiteralBit (unsigned long lit) { unsigned long pw[32] = { 1L, 2L, 4L, 8L, 16L, 32L, 64L, 128L, - 0x100L, 0x200L, 0x400L, 0x800L, - 0x1000L, 0x2000L, 0x4000L, 0x8000L, - 0x10000L, 0x20000L, 0x40000L, 0x80000L, - 0x100000L, 0x200000L, 0x400000L, 0x800000L, - 0x1000000L, 0x2000000L, 0x4000000L, 0x8000000L, - 0x10000000L, 0x20000000L, 0x40000000L, 0x80000000L - }; + 0x100L, 0x200L, 0x400L, 0x800L, + 0x1000L, 0x2000L, 0x4000L, 0x8000L, + 0x10000L, 0x20000L, 0x40000L, 0x80000L, + 0x100000L, 0x200000L, 0x400000L, 0x800000L, + 0x1000000L, 0x2000000L, 0x4000000L, 0x8000000L, + 0x10000000L, 0x20000000L, 0x40000000L, 0x80000000L + }; int idx; for (idx = 0; idx < 32; idx++) @@ -6733,7 +6625,7 @@ if (IC_TRUE (ic)) { popForBranch (popIc, TRUE); - emitcode ("ljmp", "!tlabel", IC_TRUE (ic)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_TRUE (ic)->key)); } ic->generated = 1; } @@ -6747,7 +6639,7 @@ if (!IC_TRUE (ic)) { popForBranch (popIc, TRUE); - emitcode ("ljmp", "!tlabel", IC_FALSE (ic)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_FALSE (ic)->key)); } ic->generated = 1; } @@ -6762,18 +6654,18 @@ if (IC_TRUE (ic)) { symbol *nlbl = newiTempLabel (NULL); - emitcode ("sjmp", "!tlabel", nlbl->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (nlbl->key)); emitLabel (tlbl); popForBranch (popIc, FALSE); freeForBranchAsmops (result, right, left); - emitcode ("ljmp", "!tlabel", IC_TRUE (ic)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_TRUE (ic)->key)); emitLabel (nlbl); } else { popForBranch (popIc, FALSE); freeForBranchAsmops (result, right, left); - emitcode ("ljmp", "!tlabel", IC_FALSE (ic)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_FALSE (ic)->key)); emitLabel (tlbl); } ic->generated = 1; @@ -6957,12 +6849,12 @@ MOVA (aopGet (left, offset, FALSE, FALSE)); // byte == 2^n ? if ((posbit = isLiteralBit (bytelit)) != 0) - emitcode ("jb", "acc.%d,!tlabel", (posbit - 1) & 0x07, tlbl->key + 100); + emitcode ("jb", "acc.%d,!tlabel", (posbit - 1) & 0x07, labelKey2num (tlbl->key)); else { if (bytelit != 0x0FFL) emitcode ("anl", "a,%s", aopGet (right, offset, FALSE, TRUE)); - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); } } offset++; @@ -7083,7 +6975,8 @@ else if (AOP_TYPE (left) == AOP_ACC) { if (!offset) - { //B contains high byte of left + { + //B contains high byte of left emitpush ("b"); emitcode ("mov", "b,a"); MOVA (aopGet (right, offset, FALSE, FALSE)); @@ -7113,7 +7006,7 @@ emitcode ("anl", "a,%s", aopGet (left, offset, FALSE, FALSE)); } - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); offset++; } if (size) @@ -7170,7 +7063,8 @@ else if (AOP_TYPE (left) == AOP_ACC) { if (!offset) - { //B contains high byte of left + { + //B contains high byte of left emitpush ("b"); emitcode ("mov", "b,a"); MOVA (aopGet (right, offset, FALSE, FALSE)); @@ -7315,9 +7209,9 @@ if ((AOP_TYPE (result) == AOP_CRY) && ifx) { symbol *tlbl = newiTempLabel (NULL); - emitcode ("jb", "%s,!tlabel", AOP (left)->aopu.aop_dir, tlbl->key + 100); + emitcode ("jb", "%s,!tlabel", AOP (left)->aopu.aop_dir, labelKey2num (tlbl->key)); toBoolean (right); - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); jmpTrueOrFalse (ifx, tlbl, left, right, result, ic->next); goto release; } @@ -7360,12 +7254,13 @@ if (size) { symbol *tlbl = newiTempLabel (NULL); - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); CLRC; emitLabel (tlbl); } else - { /* FIXME, thats pretty fishy, check for ifx!=0, testcase .. */ + { + /* FIXME, thats pretty fishy, check for ifx!=0, testcase .. */ assert (ifx); genIfxJump (ifx, "a", left, right, result, ic->next); goto release; @@ -7474,7 +7369,8 @@ else if (AOP_TYPE (left) == AOP_ACC) { if (!offset) - { //B contains high byte of left + { + //B contains high byte of left emitpush ("b"); emitcode ("mov", "b,a"); MOVA (aopGet (right, offset, FALSE, FALSE)); @@ -7504,7 +7400,7 @@ emitcode ("orl", "a,%s", aopGet (left, offset, FALSE, FALSE)); } - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); offset++; } if (size) @@ -7541,7 +7437,8 @@ continue; } else if (AOP_TYPE (left) == AOP_ACC) - { // this should be the only use of left so A,B can be overwritten + { + // this should be the only use of left so A,B can be overwritten char *l = Safe_strdup (aopGet (left, offset, FALSE, FALSE)); emitcode ("orl", "%s,%s", l, aopGet (right, offset, FALSE, FALSE)); aopPut (result, l, offset); @@ -7561,7 +7458,8 @@ else if (AOP_TYPE (left) == AOP_ACC) { if (!offset) - { //B contains high byte of left + { + //B contains high byte of left emitpush ("b"); emitcode ("mov", "b,a"); MOVA (aopGet (right, offset, FALSE, FALSE)); @@ -7708,7 +7606,8 @@ { // c = bit ^ bit; if (IS_OP_ACCUSE (left)) - { // left already is in the carry + { + // left already is in the carry operand *tmp = right; right = left; left = tmp; @@ -7723,7 +7622,7 @@ // c = bit ^ val toCarry (right); } - emitcode ("jnb", "%s,!tlabel", AOP (left)->aopu.aop_dir, (tlbl->key + 100)); + emitcode ("jnb", "%s,!tlabel", AOP (left)->aopu.aop_dir, labelKey2num (tlbl->key)); emitcode ("cpl", "c"); emitLabel (tlbl); } @@ -7834,7 +7733,8 @@ else if (AOP_TYPE (left) == AOP_ACC) { if (!offset) - { //B contains high byte of left + { + //B contains high byte of left emitpush ("b"); emitcode ("mov", "b,a"); MOVA (aopGet (right, offset, FALSE, FALSE)); @@ -7864,7 +7764,7 @@ emitcode ("xrl", "a,%s", aopGet (left, offset, FALSE, FALSE)); } - emitcode ("jnz", "!tlabel", tlbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (tlbl->key)); offset++; } if (size) @@ -7893,7 +7793,8 @@ continue; } else if (AOP_TYPE (left) == AOP_ACC) - { // this should be the only use of left so A,B can be overwritten + { + // this should be the only use of left so A,B can be overwritten char *l = Safe_strdup (aopGet (left, offset, FALSE, FALSE)); emitcode ("xrl", "%s,%s", l, aopGet (right, offset, FALSE, FALSE)); aopPut (result, l, offset); @@ -7913,7 +7814,8 @@ else if (AOP_TYPE (left) == AOP_ACC) { if (!offset) - { //B contains high byte of left + { + //B contains high byte of left emitpush ("b"); emitcode ("mov", "b,a"); MOVA (aopGet (right, offset, FALSE, FALSE)); @@ -7954,62 +7856,6 @@ } /*-----------------------------------------------------------------*/ -/* genInline - write the inline code out */ -/*-----------------------------------------------------------------*/ -static void -genInline (iCode * ic) -{ - char *buf, *bp, *bp1; - bool inComment = FALSE; - - D (emitcode (";", "genInline")); - - _G.inLine += (!options.asmpeep); - - buf = bp = bp1 = Safe_strdup (IC_INLINE (ic)); - - /* emit each line as a code */ - while (*bp) - { - switch (*bp) - { - case ';': - inComment = TRUE; - ++bp; - break; - - case '\x87': - case '\n': - inComment = FALSE; - *bp++ = '\0'; - emitcode (bp1, ""); - bp1 = bp; - break; - - default: - /* Add \n for labels, not dirs such as c:\mydir */ - if (!inComment && (*bp == ':') && (isspace ((unsigned char) bp[1]))) - { - ++bp; - *bp = '\0'; - ++bp; - emitcode (bp1, ""); - bp1 = bp; - } - else - ++bp; - break; - } - } - if (bp1 != bp) - emitcode (bp1, ""); - - Safe_free (buf); - - _G.inLine -= (!options.asmpeep); -} - -/*-----------------------------------------------------------------*/ /* genRRC - rotate right with carry */ /*-----------------------------------------------------------------*/ static void @@ -8030,7 +7876,8 @@ size = AOP_SIZE (result); offset = size - 1; if (size == 1) - { /* special case for 1 byte */ + { + /* special case for 1 byte */ MOVA (aopGet (left, offset, FALSE, FALSE)); emitcode ("rr", "a"); goto release; @@ -8080,7 +7927,8 @@ { MOVA (aopGet (left, offset, FALSE, FALSE)); if (size == 0) - { /* special case for 1 byte */ + { + /* special case for 1 byte */ emitcode ("rl", "a"); goto release; } @@ -8447,7 +8295,7 @@ AccRol (8 - shCount); /* and kill the higher order bits */ emitcode ("anl", "a,#!constbyte", SRMask[shCount]); - emitcode ("jnb", "acc.%d,!tlabel", 7 - shCount, tlbl->key + 100); + emitcode ("jnb", "acc.%d,!tlabel", 7 - shCount, labelKey2num (tlbl->key)); emitcode ("orl", "a,#!constbyte", (unsigned char) ~SRMask[shCount]); emitLabel (tlbl); } @@ -8573,40 +8421,40 @@ break; case 3: case 4: - case 5: // AAAAABBB:CCCCCDDD + case 5: // AAAAABBB:CCCCCDDD mask = SLMask[shCount]; - AccRol (shCount); // BBBAAAAA:CCCCCDDD + AccRol (shCount); // BBBAAAAA:CCCCCDDD emitcode ("anl", "a,#!constbyte", mask); // BBB00000:CCCCCDDD - emitcode ("xch", "a,%s", x); // CCCCCDDD:BBB00000 - AccRol (shCount); // DDDCCCCC:BBB00000 - emitcode ("xch", "a,%s", x); // BBB00000:DDDCCCCC - emitcode ("xrl", "a,%s", x); // (BBB^DDD)CCCCC:DDDCCCCC - emitcode ("xch", "a,%s", x); // DDDCCCCC:(BBB^DDD)CCCCC + emitcode ("xch", "a,%s", x); // CCCCCDDD:BBB00000 + AccRol (shCount); // DDDCCCCC:BBB00000 + emitcode ("xch", "a,%s", x); // BBB00000:DDDCCCCC + emitcode ("xrl", "a,%s", x); // (BBB^DDD)CCCCC:DDDCCCCC + emitcode ("xch", "a,%s", x); // DDDCCCCC:(BBB^DDD)CCCCC emitcode ("anl", "a,#!constbyte", mask); // DDD00000:(BBB^DDD)CCCCC - emitcode ("xch", "a,%s", x); // (BBB^DDD)CCCCC:DDD00000 - emitcode ("xrl", "a,%s", x); // BBBCCCCC:DDD00000 + emitcode ("xch", "a,%s", x); // (BBB^DDD)CCCCC:DDD00000 + emitcode ("xrl", "a,%s", x); // BBBCCCCC:DDD00000 break; - case 6: // AAAAAABB:CCCCCCDD + case 6: // AAAAAABB:CCCCCCDD mask = SRMask[shCount]; emitcode ("anl", "a,#!constbyte", mask); // 000000BB:CCCCCCDD - emitcode ("mov", "c,acc.0"); // c = B - emitcode ("xch", "a,%s", x); // CCCCCCDD:000000BB + emitcode ("mov", "c,acc.0"); // c = B + emitcode ("xch", "a,%s", x); // CCCCCCDD:000000BB emitcode ("rrc", "a"); emitcode ("xch", "a,%s", x); emitcode ("rrc", "a"); - emitcode ("mov", "c,acc.0"); //<< get correct bit + emitcode ("mov", "c,acc.0"); //<< get correct bit emitcode ("xch", "a,%s", x); emitcode ("rrc", "a"); emitcode ("xch", "a,%s", x); emitcode ("rrc", "a"); emitcode ("xch", "a,%s", x); break; - case 7: // a:x <<= 7 + case 7: // a:x <<= 7 mask = SRMask[shCount]; emitcode ("anl", "a,#!constbyte", mask); // 0000000B:CCCCCCCD - emitcode ("mov", "c,acc.0"); // c = B - emitcode ("xch", "a,%s", x); // CCCCCCCD:0000000B - AccAXRrl1 (x); // BCCCCCCC:D0000000 + emitcode ("mov", "c,acc.0"); // c = B + emitcode ("xch", "a,%s", x); // CCCCCCCD:0000000B + AccAXRrl1 (x); // BCCCCCCC:D0000000 break; default: break; @@ -8627,40 +8475,40 @@ break; case 1: CLRC; - AccAXRrl1 (x); // 0->a:x + AccAXRrl1 (x); // 0->a:x break; case 2: CLRC; - AccAXRrl1 (x); // 0->a:x + AccAXRrl1 (x); // 0->a:x CLRC; - AccAXRrl1 (x); // 0->a:x + AccAXRrl1 (x); // 0->a:x break; case 3: case 4: - case 5: // AAAAABBB:CCCCCDDD = a:x - AccRol (8 - shCount); // BBBAAAAA:DDDCCCCC - emitcode ("xch", "a,%s", x); // CCCCCDDD:BBBAAAAA - AccRol (8 - shCount); // DDDCCCCC:BBBAAAAA + case 5: // AAAAABBB:CCCCCDDD = a:x + AccRol (8 - shCount); // BBBAAAAA:DDDCCCCC + emitcode ("xch", "a,%s", x); // CCCCCDDD:BBBAAAAA + AccRol (8 - shCount); // DDDCCCCC:BBBAAAAA emitcode ("anl", "a,#!constbyte", mask); // 000CCCCC:BBBAAAAA - emitcode ("xrl", "a,%s", x); // BBB(CCCCC^AAAAA):BBBAAAAA - emitcode ("xch", "a,%s", x); // BBBAAAAA:BBB(CCCCC^AAAAA) + emitcode ("xrl", "a,%s", x); // BBB(CCCCC^AAAAA):BBBAAAAA + emitcode ("xch", "a,%s", x); // BBBAAAAA:BBB(CCCCC^AAAAA) emitcode ("anl", "a,#!constbyte", mask); // 000AAAAA:BBB(CCCCC^AAAAA) - emitcode ("xch", "a,%s", x); // BBB(CCCCC^AAAAA):000AAAAA - emitcode ("xrl", "a,%s", x); // BBBCCCCC:000AAAAA - emitcode ("xch", "a,%s", x); // 000AAAAA:BBBCCCCC + emitcode ("xch", "a,%s", x); // BBB(CCCCC^AAAAA):000AAAAA + emitcode ("xrl", "a,%s", x); // BBBCCCCC:000AAAAA + emitcode ("xch", "a,%s", x); // 000AAAAA:BBBCCCCC break; - case 6: // AABBBBBB:CCDDDDDD + case 6: // AABBBBBB:CCDDDDDD emitcode ("mov", "c,acc.7"); - AccAXLrl1 (x); // ABBBBBBC:CDDDDDDA + AccAXLrl1 (x); // ABBBBBBC:CDDDDDDA emitcode ("mov", "c,acc.7"); - AccAXLrl1 (x); // BBBBBBCC:DDDDDDAA - emitcode ("xch", "a,%s", x); // DDDDDDAA:BBBBBBCC + AccAXLrl1 (x); // BBBBBBCC:DDDDDDAA + emitcode ("xch", "a,%s", x); // DDDDDDAA:BBBBBBCC emitcode ("anl", "a,#!constbyte", mask); // 000000AA:BBBBBBCC break; - case 7: // ABBBBBBB:CDDDDDDD - emitcode ("mov", "c,acc.7"); // c = A - AccAXLrl1 (x); // BBBBBBBC:DDDDDDDA - emitcode ("xch", "a,%s", x); // DDDDDDDA:BBBBBBCC + case 7: // ABBBBBBB:CDDDDDDD + emitcode ("mov", "c,acc.7"); // c = A + AccAXLrl1 (x); // BBBBBBBC:DDDDDDDA + emitcode ("xch", "a,%s", x); // DDDDDDDA:BBBBBBCC emitcode ("anl", "a,#!constbyte", mask); // 0000000A:BBBBBBBC break; default: @@ -8683,53 +8531,53 @@ break; case 1: emitcode ("mov", "c,acc.7"); - AccAXRrl1 (x); // s->a:x + AccAXRrl1 (x); // s->a:x break; case 2: emitcode ("mov", "c,acc.7"); - AccAXRrl1 (x); // s->a:x + AccAXRrl1 (x); // s->a:x emitcode ("mov", "c,acc.7"); - AccAXRrl1 (x); // s->a:x + AccAXRrl1 (x); // s->a:x break; case 3: case 4: - case 5: // AAAAABBB:CCCCCDDD = a:x + case 5: // AAAAABBB:CCCCCDDD = a:x tlbl = newiTempLabel (NULL); - AccRol (8 - shCount); // BBBAAAAA:CCCCCDDD - emitcode ("xch", "a,%s", x); // CCCCCDDD:BBBAAAAA - AccRol (8 - shCount); // DDDCCCCC:BBBAAAAA + AccRol (8 - shCount); // BBBAAAAA:CCCCCDDD + emitcode ("xch", "a,%s", x); // CCCCCDDD:BBBAAAAA + AccRol (8 - shCount); // DDDCCCCC:BBBAAAAA emitcode ("anl", "a,#!constbyte", mask); // 000CCCCC:BBBAAAAA - emitcode ("xrl", "a,%s", x); // BBB(CCCCC^AAAAA):BBBAAAAA - emitcode ("xch", "a,%s", x); // BBBAAAAA:BBB(CCCCC^AAAAA) + emitcode ("xrl", "a,%s", x); // BBB(CCCCC^AAAAA):BBBAAAAA + emitcode ("xch", "a,%s", x); // BBBAAAAA:BBB(CCCCC^AAAAA) emitcode ("anl", "a,#!constbyte", mask); // 000AAAAA:BBB(CCCCC^AAAAA) - emitcode ("xch", "a,%s", x); // BBB(CCCCC^AAAAA):000AAAAA - emitcode ("xrl", "a,%s", x); // BBBCCCCC:000AAAAA - emitcode ("xch", "a,%s", x); // 000SAAAA:BBBCCCCC - emitcode ("jnb", "acc.%d,!tlabel", 7 - shCount, tlbl->key + 100); + emitcode ("xch", "a,%s", x); // BBB(CCCCC^AAAAA):000AAAAA + emitcode ("xrl", "a,%s", x); // BBBCCCCC:000AAAAA + emitcode ("xch", "a,%s", x); // 000SAAAA:BBBCCCCC + emitcode ("jnb", "acc.%d,!tlabel", 7 - shCount, labelKey2num (tlbl->key)); mask = ~SRMask[shCount]; emitcode ("orl", "a,#!constbyte", mask); // 111AAAAA:BBBCCCCC emitLabel (tlbl); - break; // SSSSAAAA:BBBCCCCC - case 6: // AABBBBBB:CCDDDDDD + break; // SSSSAAAA:BBBCCCCC + case 6: // AABBBBBB:CCDDDDDD tlbl = newiTempLabel (NULL); emitcode ("mov", "c,acc.7"); - AccAXLrl1 (x); // ABBBBBBC:CDDDDDDA + AccAXLrl1 (x); // ABBBBBBC:CDDDDDDA emitcode ("mov", "c,acc.7"); - AccAXLrl1 (x); // BBBBBBCC:DDDDDDAA - emitcode ("xch", "a,%s", x); // DDDDDDAA:BBBBBBCC + AccAXLrl1 (x); // BBBBBBCC:DDDDDDAA + emitcode ("xch", "a,%s", x); // DDDDDDAA:BBBBBBCC emitcode ("anl", "a,#!constbyte", mask); // 000000AA:BBBBBBCC - emitcode ("jnb", "acc.%d,!tlabel", 7 - shCount, tlbl->key + 100); + emitcode ("jnb", "acc.%d,!tlabel", 7 - shCount, labelKey2num (tlbl->key)); mask = ~SRMask[shCount]; emitcode ("orl", "a,#!constbyte", mask); // 111111AA:BBBBBBCC emitLabel (tlbl); break; - case 7: // ABBBBBBB:CDDDDDDD + case 7: // ABBBBBBB:CDDDDDDD tlbl = newiTempLabel (NULL); - emitcode ("mov", "c,acc.7"); // c = A - AccAXLrl1 (x); // BBBBBBBC:DDDDDDDA - emitcode ("xch", "a,%s", x); // DDDDDDDA:BBBBBBCC + emitcode ("mov", "c,acc.7"); // c = A + AccAXLrl1 (x); // BBBBBBBC:DDDDDDDA + emitcode ("xch", "a,%s", x); // DDDDDDDA:BBBBBBCC emitcode ("anl", "a,#!constbyte", mask); // 0000000A:BBBBBBBC - emitcode ("jnb", "acc.%d,!tlabel", 7 - shCount, tlbl->key + 100); + emitcode ("jnb", "acc.%d,!tlabel", 7 - shCount, labelKey2num (tlbl->key)); mask = ~SRMask[shCount]; emitcode ("orl", "a,#!constbyte", mask); // 1111111A:BBBBBBBC emitLabel (tlbl); @@ -9052,7 +8900,8 @@ movLeft2Result (left, LSB, result, MSB16, 0); } else - { /* size = 4 */ + { + /* size = 4 */ if (shCount == 0) { movLeft2Result (left, MSB24, result, MSB32, 0); @@ -9094,8 +8943,8 @@ static void genLeftShiftLiteral (operand * left, operand * right, operand * result, iCode * ic) { - int shCount = (int) ulFromVal (AOP (right)->aopu.aop_lit); - int size; + unsigned int shCount = (unsigned int) ulFromVal (AOP (right)->aopu.aop_lit); + unsigned int size; size = getSize (operandType (result)); @@ -9111,6 +8960,8 @@ #endif /* I suppose that the left size >= result size */ +// wassert (getSize (operandType (left)) >= size); + if (shCount == 0) { while (size--) @@ -9232,11 +9083,11 @@ symbol *tlbl1 = newiTempLabel (NULL); MOVA (aopGet (left, 0, FALSE, FALSE)); - emitcode ("sjmp", "!tlabel", tlbl1->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (tlbl1->key)); emitLabel (tlbl); emitcode ("add", "a,acc"); emitLabel (tlbl1); - emitcode ("djnz", "b,!tlabel", tlbl->key + 100); + emitcode ("djnz", "b,!tlabel", labelKey2num (tlbl->key)); popB (pushedB); aopPut (result, "a", 0); goto release; @@ -9244,7 +9095,7 @@ reAdjustPreg (AOP (result)); - emitcode ("sjmp", "!tlabel", tlbl1->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (tlbl1->key)); emitLabel (tlbl); MOVA (aopGet (result, offset, FALSE, FALSE)); emitcode ("add", "a,acc"); @@ -9258,7 +9109,7 @@ reAdjustPreg (AOP (result)); emitLabel (tlbl1); - emitcode ("djnz", "b,!tlabel", tlbl->key + 100); + emitcode ("djnz", "b,!tlabel", labelKey2num (tlbl->key)); popB (pushedB); release: freeAsmop (result, NULL, ic, TRUE); @@ -9484,7 +9335,7 @@ int shCount = (int) ulFromVal (AOP (right)->aopu.aop_lit); int size; - size = getSize (operandType (result)); //getDataSize (left); + size = getSize (operandType (result)); //getDataSize (left); D (emitcode (";", "genRightShiftLiteral (%d), size %d", shCount, size)); @@ -9625,19 +9476,19 @@ if (size == 1) { MOVA (aopGet (left, 0, FALSE, FALSE)); - emitcode ("sjmp", "!tlabel", tlbl1->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (tlbl1->key)); emitLabel (tlbl); emitcode ("mov", "c,ov"); emitcode ("rrc", "a"); emitLabel (tlbl1); - emitcode ("djnz", "b,!tlabel", tlbl->key + 100); + emitcode ("djnz", "b,!tlabel", labelKey2num (tlbl->key)); popB (pushedB); aopPut (result, "a", 0); goto release; } reAdjustPreg (AOP (result)); - emitcode ("sjmp", "!tlabel", tlbl1->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (tlbl1->key)); emitLabel (tlbl); emitcode ("mov", "c,ov"); while (size--) @@ -9648,7 +9499,7 @@ } reAdjustPreg (AOP (result)); emitLabel (tlbl1); - emitcode ("djnz", "b,!tlabel", tlbl->key + 100); + emitcode ("djnz", "b,!tlabel", labelKey2num (tlbl->key)); popB (pushedB); release: @@ -9755,19 +9606,19 @@ if (size == 1) { MOVA (aopGet (left, 0, FALSE, FALSE)); - emitcode ("sjmp", "!tlabel", tlbl1->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (tlbl1->key)); emitLabel (tlbl); CLRC; emitcode ("rrc", "a"); emitLabel (tlbl1); - emitcode ("djnz", "b,!tlabel", tlbl->key + 100); + emitcode ("djnz", "b,!tlabel", labelKey2num (tlbl->key)); popB (pushedB); aopPut (result, "a", 0); goto release; } reAdjustPreg (AOP (result)); - emitcode ("sjmp", "!tlabel", tlbl1->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (tlbl1->key)); emitLabel (tlbl); CLRC; while (size--) @@ -9779,7 +9630,7 @@ reAdjustPreg (AOP (result)); emitLabel (tlbl1); - emitcode ("djnz", "b,!tlabel", tlbl->key + 100); + emitcode ("djnz", "b,!tlabel", labelKey2num (tlbl->key)); popB (pushedB); release: @@ -9886,8 +9737,8 @@ int blen; /* bitfield length */ int bstr; /* bitfield starting bit within byte */ static char *const accBits[] = { "acc.0", "acc.1", "acc.2", "acc.3", - "acc.4", "acc.5", "acc.6", "acc.7" - }; + "acc.4", "acc.5", "acc.6", "acc.7" + }; D (emitcode (";", "genUnpackBits")); @@ -9906,7 +9757,7 @@ else { if (blen < 8) - emitcode ("anl", "a,#!constbyte", (((unsigned char) -1) >> (8 - blen)) << bstr); + emitcode ("anl", "a,#!constbyte", (((unsigned char) - 1) >> (8 - blen)) << bstr); return "a"; } } @@ -9917,13 +9768,13 @@ { emitPtrByteGet (rname, ptype, FALSE); AccRol (8 - bstr); - emitcode ("anl", "a,#!constbyte", ((unsigned char) -1) >> (8 - blen)); + emitcode ("anl", "a,#!constbyte", ((unsigned char) - 1) >> (8 - blen)); if (!SPEC_USIGN (etype)) { /* signed bitfield */ symbol *tlbl = newiTempLabel (NULL); - emitcode ("jnb", "acc.%d,!tlabel", blen - 1, tlbl->key + 100); + emitcode ("jnb", "acc.%d,!tlabel", blen - 1, labelKey2num (tlbl->key)); emitcode ("orl", "a,#0x%02x", (unsigned char) (0xff << blen)); emitLabel (tlbl); } @@ -9945,13 +9796,13 @@ if (rlen) { emitPtrByteGet (rname, ptype, FALSE); - emitcode ("anl", "a,#!constbyte", ((unsigned char) -1) >> (8 - rlen)); + emitcode ("anl", "a,#!constbyte", ((unsigned char) - 1) >> (8 - rlen)); if (!SPEC_USIGN (etype)) { /* signed bitfield */ symbol *tlbl = newiTempLabel (NULL); - emitcode ("jnb", "acc.%d,!tlabel", rlen - 1, tlbl->key + 100); + emitcode ("jnb", "acc.%d,!tlabel", rlen - 1, labelKey2num (tlbl->key)); emitcode ("orl", "a,#0x%02x", (unsigned char) (0xff << rlen)); emitLabel (tlbl); } @@ -10124,7 +9975,8 @@ if (aop) /* we had to allocate for this iCode */ { if (pi) - { /* post increment present */ + { + /* post increment present */ aopPut (left, rname, 0); } freeAsmop (NULL, aop, ic, RESULTONSTACK (ic) ? FALSE : TRUE); @@ -10565,7 +10417,7 @@ /* If there was a partial byte at the end */ if (rlen) { - mask = (((unsigned char) -1 << rlen) & 0xff); + mask = (((unsigned char) - 1 << rlen) & 0xff); if (AOP_TYPE (right) == AOP_LIT) { @@ -10656,16 +10508,16 @@ /* clr a needs an extra byte. If two bytes are zero it starts to pay off to preload the accumulator */ int clr_num_bytes_saved = -1 + /* size of clr a */ - (int) ((((lit >> 0) & 0xff) == 0) && (size >= 1)) + - (int) ((((lit >> 8) & 0xff) == 0) && (size >= 2)) + - (int) ((((lit >> 16) & 0xff) == 0) && (size >= 3)) + (int) ((((lit >> 24) & 0xff) == 0) && (size >= 4)); + (int) ((((lit >> 0) & 0xff) == 0) && (size >= 1)) + + (int) ((((lit >> 8) & 0xff) == 0) && (size >= 2)) + + (int) ((((lit >> 16) & 0xff) == 0) && (size >= 3)) + (int) ((((lit >> 24) & 0xff) == 0) && (size >= 4)); /* mov a,#something needs two extra bytes. If three bytes are identical it starts to pay off */ int mov_num_bytes_saved = -2 + /* size of mov a,#something */ - (int) ((lit & 0xff) == ((lit >> 0) & 0xff) && (size >= 1)) + /* true */ - (int) ((lit & 0xff) == ((lit >> 8) & 0xff) && (size >= 2)) + - (int) ((lit & 0xff) == ((lit >> 16) & 0xff) && (size >= 3)) + - (int) ((lit & 0xff) == ((lit >> 24) & 0xff) && (size >= 4)); + (int) ((lit & 0xff) == ((lit >> 0) & 0xff) && (size >= 1)) + /* true */ + (int) ((lit & 0xff) == ((lit >> 8) & 0xff) && (size >= 2)) + + (int) ((lit & 0xff) == ((lit >> 16) & 0xff) && (size >= 3)) + + (int) ((lit & 0xff) == ((lit >> 24) & 0xff) && (size >= 4)); int num_bytes_to_save_before_using_acc_takes_effect = 1; @@ -11212,7 +11064,7 @@ variable */ if (sym->onStack) { - int stack_offset = stackoffset(sym); + int stack_offset = stackoffset (sym); /* if it has an offset then we need to compute it */ if (stack_offset) @@ -11333,9 +11185,7 @@ aopOp (right, ic, FALSE); /* special case both in far space */ - if (AOP_TYPE (right) == AOP_DPTR && - IS_TRUE_SYMOP (result) && - isOperandInFarSpace (result)) + if (AOP_TYPE (right) == AOP_DPTR && IS_TRUE_SYMOP (result) && isOperandInFarSpace (result)) { genFarFarAssign (result, right, ic); return; @@ -11386,8 +11236,10 @@ static void genJumpTab (iCode * ic) { + operand *cond = IC_JTCOND (ic); symbol *jtab, *jtablo, *jtabhi; unsigned int count; + const char *l; D (emitcode (";", "genJumpTab")); @@ -11402,38 +11254,41 @@ /* Peephole may not convert ljmp to sjmp or ret labelIsReturnOnly & labelInRange must check currPl->ic->op != JUMPTABLE */ - aopOp (IC_JTCOND (ic), ic, FALSE); + aopOp (cond, ic, FALSE); /* get the condition into accumulator */ - MOVA (aopGet (IC_JTCOND (ic), 0, FALSE, FALSE)); + l = aopGet (cond, 0, FALSE, FALSE); + MOVA (l); /* multiply by three */ - if (aopGetUsesAcc (IC_JTCOND (ic), 0)) + if ((AOP_TYPE (cond) == AOP_REG) || (IS_AOP_PREG (cond) && !AOP (cond)->paged && !IS_VOLATILE (operandType (cond)))) { + emitcode ("add", "a,%s", l); if (options.acall_ajmp == 0) - emitcode ("mov", "b,#0x03"); - else - emitcode ("mov", "b,#0x02"); - emitcode ("mul", "ab"); + emitcode ("add", "a,%s", l); } else { - emitcode ("add", "a,acc"); if (options.acall_ajmp == 0) - emitcode ("add", "a,%s", aopGet (IC_JTCOND (ic), 0, FALSE, FALSE)); + { + emitcode ("mov", "b,#0x03"); + emitcode ("mul", "ab"); + } + else + { + emitcode ("add", "a,acc"); + } } - freeAsmop (IC_JTCOND (ic), NULL, ic, TRUE); + freeAsmop (cond, NULL, ic, TRUE); jtab = newiTempLabel (NULL); - emitcode ("mov", "dptr,#!tlabel", jtab->key + 100); + emitcode ("mov", "dptr,#!tlabel", labelKey2num (jtab->key)); emitcode ("jmp", "@a+dptr"); emitLabel (jtab); /* now generate the jump labels */ for (jtab = setFirstItem (IC_JTLABELS (ic)); jtab; jtab = setNextItem (IC_JTLABELS (ic))) - emitcode ("ljmp", "!tlabel", jtab->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (jtab->key)); } else { - const char *l; - /* this algorithm needs 14 cycles and 13 + 2*n bytes if the switch argument is in a register. For n>6 this algorithm may be more compact */ @@ -11442,25 +11297,26 @@ /* get the condition into accumulator. Using b as temporary storage, if register push/pop is needed */ - aopOp (IC_JTCOND (ic), ic, FALSE); - l = aopGet (IC_JTCOND (ic), 0, FALSE, FALSE); - if ((AOP_TYPE (IC_JTCOND (ic)) == AOP_R0 && _G.r0Pushed) || (AOP_TYPE (IC_JTCOND (ic)) == AOP_R1 && _G.r1Pushed)) + aopOp (cond, ic, FALSE); + l = aopGet (cond, 0, FALSE, FALSE); + if ((AOP_TYPE (cond) == AOP_R0 && _G.r0Pushed) || + (AOP_TYPE (cond) == AOP_R1 && _G.r1Pushed) || EQ (l, "a") || EQ (l, "acc") || IS_VOLATILE (operandType (cond))) { // (MB) what if B is in use??? wassertl (!BINUSE, "B was in use"); emitcode ("mov", "b,%s", l); l = "b"; } - freeAsmop (IC_JTCOND (ic), NULL, ic, TRUE); + freeAsmop (cond, NULL, ic, TRUE); MOVA (l); if (count <= 112) { - emitcode ("add", "a,#(!tlabel-3-.)", jtablo->key + 100); + emitcode ("add", "a,#(!tlabel-3-.)", labelKey2num (jtablo->key)); emitcode ("movc", "a,@a+pc"); emitpush ("acc"); MOVA (l); - emitcode ("add", "a,#(!tlabel-3-.)", jtabhi->key + 100); + emitcode ("add", "a,#(!tlabel-3-.)", labelKey2num (jtabhi->key)); emitcode ("movc", "a,@a+pc"); emitpush ("acc"); } @@ -11468,12 +11324,12 @@ { /* this scales up to n<=255, but needs two more bytes and changes dptr */ - emitcode ("mov", "dptr,#!tlabel", jtablo->key + 100); + emitcode ("mov", "dptr,#!tlabel", labelKey2num (jtablo->key)); emitcode ("movc", "a,@a+dptr"); emitpush ("acc"); MOVA (l); - emitcode ("mov", "dptr,#!tlabel", jtabhi->key + 100); + emitcode ("mov", "dptr,#!tlabel", labelKey2num (jtabhi->key)); emitcode ("movc", "a,@a+dptr"); emitpush ("acc"); } @@ -11484,12 +11340,12 @@ /* now generate jump table, LSB */ emitLabel (jtablo); for (jtab = setFirstItem (IC_JTLABELS (ic)); jtab; jtab = setNextItem (IC_JTLABELS (ic))) - emitcode (".db", "!tlabel", jtab->key + 100); + emitcode (".db", "!tlabel", labelKey2num (jtab->key)); /* now generate jump table, MSB */ emitLabel (jtabhi); for (jtab = setFirstItem (IC_JTLABELS (ic)); jtab; jtab = setNextItem (IC_JTLABELS (ic))) - emitcode (".db", "!tlabel>>8", jtab->key + 100); + emitcode (".db", "!tlabel>>8", labelKey2num (jtab->key)); } } @@ -11515,20 +11371,20 @@ aopOp (result, ic, FALSE); /* if the result is a bit (and not a bitfield) */ - if (IS_BIT (OP_SYMBOL (result)->type)) + if (IS_BOOLEAN (OP_SYMBOL (result)->type)) { assignBit (result, right); goto release; } /* if they are the same size : or less */ - if (AOP_SIZE (result) <= AOP_SIZE (right)) + if (AOP_SIZE (result) <= AOP_SIZE (right) && !IS_BOOLEAN (operandType (result))) { /* if they are in the same place */ if (sameRegs (AOP (right), AOP (result))) goto release; - /* if they in different places then copy */ + /* if they are in different places then copy */ size = AOP_SIZE (result); offset = 0; while (size--) @@ -11539,15 +11395,15 @@ goto release; } - /* if the result is of type pointer */ - if (IS_PTR (ctype)) + /* if the either is of type pointer */ + if (IS_PTR (ctype) || IS_PTR (rtype)) { int p_type; sym_link *type = operandType (right); sym_link *etype = getSpec (type); - /* pointer to generic pointer */ - if (IS_GENPTR (ctype)) + /* pointer to generic pointer or long */ + if (AOP_SIZE (result) >= GPTRSIZE) { if (IS_PTR (type)) { @@ -11575,9 +11431,16 @@ aopPut (result, aopGet (right, offset, FALSE, FALSE), offset); offset++; } - /* the last byte depending on type */ + /* the third byte depending on type */ { - int gpVal = pointerTypeToGPByte (p_type, NULL, NULL); + int gpVal; + + /* If there will be no loss of precision, handle generic */ + /* pointer as special case to avoid generating warning */ + if (p_type == GPOINTER && AOP_SIZE (result) >= GPTRSIZE) + gpVal = -1; + else + gpVal = pointerTypeToGPByte (p_type, NULL, NULL); if (gpVal == -1) { @@ -11594,6 +11457,15 @@ dbuf_destroy (&dbuf); } } + + /* 8051 uses unsigned address spaces, so no sign extension needed. */ + /* Pad the remaining bytes of the result (if any) with 0. */ + size = AOP_SIZE (result) - GPTRSIZE; + offset = GPTRSIZE; + while (size--) + { + aopPut (result, zero, offset++); + } goto release; } @@ -11703,7 +11575,7 @@ } emitcode ("dec", "%s", rByte); aopPut (IC_RESULT (ic), rByte, 0); - emitcode ("jnz", "!tlabel", lbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (lbl->key)); } else if (IS_AOP_PREG (IC_RESULT (ic))) { @@ -11711,15 +11583,15 @@ MOVA (aopGet (IC_RESULT (ic), 0, FALSE, FALSE)); freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); ifx->generated = 1; - emitcode ("jnz", "!tlabel", lbl->key + 100); + emitcode ("jnz", "!tlabel", labelKey2num (lbl->key)); } else { - emitcode ("djnz", "%s,!tlabel", aopGet (IC_RESULT (ic), 0, FALSE, FALSE), lbl->key + 100); + emitcode ("djnz", "%s,!tlabel", aopGet (IC_RESULT (ic), 0, FALSE, FALSE), labelKey2num (lbl->key)); } - emitcode ("sjmp", "!tlabel", lbl1->key + 100); + emitcode ("sjmp", "!tlabel", labelKey2num (lbl1->key)); emitLabel (lbl); - emitcode ("ljmp", "!tlabel", IC_TRUE (ifx)->key + 100); + emitcode ("ljmp", "!tlabel", labelKey2num (IC_TRUE (ifx)->key)); emitLabel (lbl1); if (!ifx->generated) @@ -11740,7 +11612,8 @@ D (emitcode (";", "genReceive")); if (ic->argreg == 1) - { /* first parameter */ + { + /* first parameter */ if ((isOperandInFarSpace (IC_RESULT (ic)) || isOperandInPagedSpace (IC_RESULT (ic))) && (OP_SYMBOL (IC_RESULT (ic))->isspilt || IS_TRUE_SYMOP (IC_RESULT (ic)))) { @@ -11784,8 +11657,7 @@ offset = fReturnSizeMCS51 - size; while (size--) { - emitpush ( (!EQ (fReturn[fReturnSizeMCS51 - offset - 1], "a") ? - fReturn[fReturnSizeMCS51 - offset - 1] : "acc")); + emitpush ((!EQ (fReturn[fReturnSizeMCS51 - offset - 1], "a") ? fReturn[fReturnSizeMCS51 - offset - 1] : "acc")); offset++; } aopOp (IC_RESULT (ic), ic, FALSE); @@ -11806,7 +11678,8 @@ } } else if (ic->argreg > 12) - { /* bit parameters */ + { + /* bit parameters */ reg_info *reg = OP_SYMBOL (IC_RESULT (ic))->regs[0]; BitBankUsed = 1; @@ -11818,7 +11691,8 @@ } } else - { /* other parameters */ + { + /* other parameters */ int rb1off; aopOp (IC_RESULT (ic), ic, FALSE); rb1off = ic->argreg; @@ -11906,7 +11780,7 @@ { aopOp (IC_RESULT (ic), ic, TRUE); aopPut (IC_RESULT (ic), one, 0); /* save old ea in an operand */ - emitcode ("jbc", "ea,!tlabel", tlbl->key + 100); /* atomic test & clear */ + emitcode ("jbc", "ea,!tlabel", labelKey2num (tlbl->key)); /* atomic test & clear */ aopPut (IC_RESULT (ic), zero, 0); emitLabel (tlbl); freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); @@ -11914,10 +11788,10 @@ else { emitcode ("setb", "c"); - emitcode ("jbc", "ea,!tlabel", tlbl->key + 100); /* atomic test & clear */ + emitcode ("jbc", "ea,!tlabel", labelKey2num (tlbl->key)); /* atomic test & clear */ emitcode ("clr", "c"); emitLabel (tlbl); - emitpush ("psw"); /* save old ea via c in psw on top of stack */ + emitpush ("psw"); /* save old ea via c in psw on top of stack */ } } @@ -11948,7 +11822,7 @@ } else { - emitpop ("psw"); /* restore ea via c in psw on top of stack */ + emitpop ("psw"); /* restore ea via c in psw on top of stack */ emitcode ("mov", "ea,c"); } } @@ -11966,7 +11840,6 @@ #endif _G.currentFunc = NULL; - lineHead = lineCurr = NULL; /* print the allocation information */ if (allocInfo && currFunc) @@ -11984,7 +11857,9 @@ for (ic = lic; ic; ic = ic->next) { - _G.current_iCode = ic; + initGenLineElement (); + + genLine.lineElement.ic = ic; if (ic->lineno && cln != ic->lineno) { @@ -12059,25 +11934,25 @@ break; case IPOP: - { - iCode *ifxIc, *popIc; - bool CommonRegs = FALSE; + { + iCode *ifxIc, *popIc; + bool CommonRegs = FALSE; - /* IPOP happens only when trying to restore a - spilt live range, if there is an ifx statement - following this pop (or several) then the if statement might - be using some of the registers being popped which - would destroy the contents of the register so - we need to check for this condition and handle it */ - for (ifxIc = ic->next; ifxIc && ifxIc->op == IPOP; ifxIc = ifxIc->next); - for (popIc = ic; popIc && popIc->op == IPOP; popIc = popIc->next) - CommonRegs |= (ifxIc && ifxIc->op == IFX && !ifxIc->generated && regsInCommon (IC_LEFT (popIc), IC_COND (ifxIc))); - if (CommonRegs) - genIfx (ifxIc, ic); - else - genIpop (ic); - } - break; + /* IPOP happens only when trying to restore a + spilt live range, if there is an ifx statement + following this pop (or several) then the if statement might + be using some of the registers being popped which + would destroy the contents of the register so + we need to check for this condition and handle it */ + for (ifxIc = ic->next; ifxIc && ifxIc->op == IPOP; ifxIc = ifxIc->next); + for (popIc = ic; popIc && popIc->op == IPOP; popIc = popIc->next) + CommonRegs |= (ifxIc && ifxIc->op == IFX && !ifxIc->generated && regsInCommon (IC_LEFT (popIc), IC_COND (ifxIc))); + if (CommonRegs) + genIfx (ifxIc, ic); + else + genIpop (ic); + } + break; case CALL: genCall (ic); @@ -12261,14 +12136,16 @@ } } - _G.current_iCode = NULL; + genLine.lineElement.ic = NULL; /* now we are ready to call the peep hole optimizer */ if (!options.nopeep) - peepHole (&lineHead); + peepHole (&genLine.lineHead); /* now do the actual printing */ - printLine (lineHead, codeOutBuf); - return; + printLine (genLine.lineHead, codeOutBuf); + + /* destroy the line list */ + destroy_line_list (); } diff -Nru sdcc-3.1.0+dfsg/src/mcs51/main.c sdcc-3.2.0+dfsg/src/mcs51/main.c --- sdcc-3.1.0+dfsg/src/mcs51/main.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/mcs51/main.c 2012-03-30 20:01:27.000000000 +0000 @@ -1,6 +1,25 @@ -/** @file main.c - mcs51 specific general functions. +/*------------------------------------------------------------------------- + main.c - mcs51 specific general functions + Copyright (C) 1998, Sandeep Dutta . sandeep.dutta@usa.net + Copyright (C) 1999, Jean-Louis VERN.jlvern@writeme.com + Copyright (C) 2000, Michael Hope + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-------------------------------------------------------------------*/ +/* Note that mlh prepended _mcs51_ on the static functions. Makes it easier to set a breakpoint using the debugger. */ @@ -102,7 +121,7 @@ else { int size = getSize(l); - int remain ; + int remain; /* first one goes the usual way to DPTR */ if (regParmFlg == 0) @@ -683,7 +702,7 @@ getInstructionSize (lineNode *line) { if (!line->aln) - line->aln = asmLineNodeFromLineNode (line); + line->aln = (asmLineNodeBase *) asmLineNodeFromLineNode (line); return line->aln->size; } @@ -692,7 +711,7 @@ getRegsRead (lineNode *line) { if (!line->aln) - line->aln = asmLineNodeFromLineNode (line); + line->aln = (asmLineNodeBase *) asmLineNodeFromLineNode (line); return line->aln->regsRead; } @@ -701,7 +720,7 @@ getRegsWritten (lineNode *line) { if (!line->aln) - line->aln = asmLineNodeFromLineNode (line); + line->aln = (asmLineNodeBase *) asmLineNodeFromLineNode (line); return line->aln->regsWritten; } @@ -780,8 +799,8 @@ { /* Assembler */ _asmCmd, NULL, - "-plosgffwzc", /* Options with debug */ - "-plosgffwz", /* Options without debug */ + "-plosgffwc", /* Options with debug */ + "-plosgffw", /* Options without debug */ 0, ".asm", NULL /* no do_assemble function */ diff -Nru sdcc-3.1.0+dfsg/src/mcs51/main.h sdcc-3.2.0+dfsg/src/mcs51/main.h --- sdcc-3.1.0+dfsg/src/mcs51/main.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/mcs51/main.h 2012-03-30 20:01:27.000000000 +0000 @@ -1,11 +1,40 @@ +/*------------------------------------------------------------------------- + main.c - mcs51 specific general header file + + Copyright (C) 1998, Sandeep Dutta . sandeep.dutta@usa.net + Copyright (C) 1999, Jean-Louis VERN.jlvern@writeme.com + Copyright (C) 2000, Michael Hope + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-------------------------------------------------------------------*/ + #ifndef MAIN_INCLUDE #define MAIN_INCLUDE +#include "SDCCgen.h" + typedef struct asmLineNode { +#ifdef UNNAMED_STRUCT_TAG + struct asmLineNodeBase; +#else + /* exactly the same members as of struct asmLineNodeBase from SDCCgen.h */ int size; bitVect *regsRead; bitVect *regsWritten; +#endif } asmLineNode; diff -Nru sdcc-3.1.0+dfsg/src/mcs51/mcs51.vcxproj sdcc-3.2.0+dfsg/src/mcs51/mcs51.vcxproj --- sdcc-3.1.0+dfsg/src/mcs51/mcs51.vcxproj 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/mcs51/mcs51.vcxproj 2012-03-18 13:40:40.000000000 +0000 @@ -151,10 +151,12 @@ - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph.rul - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph.rul peeph.rul;%(Outputs) peeph.rul;%(Outputs) + Generating Peephole Rule: peeph.rul + Generating Peephole Rule: peeph.rul diff -Nru sdcc-3.1.0+dfsg/src/mcs51/peeph.def sdcc-3.2.0+dfsg/src/mcs51/peeph.def --- sdcc-3.1.0+dfsg/src/mcs51/peeph.def 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/mcs51/peeph.def 2012-02-22 09:24:36.000000000 +0000 @@ -4885,7 +4885,7 @@ } by { ; Peephole 400.a replaced lcall/ret with ljmp ljmp %1 -} if optimizeReturn() +} if optimizeReturn(), notSame(%1 '_longjmp') // applies to: void test( char c ) { if( c ) func1(); else func2(); } replace { @@ -4896,7 +4896,7 @@ ; Peephole 400.b replaced lcall/ret with ljmp ljmp %1 ; -} if optimizeReturn(), labelRefCount(%2 0) +} if optimizeReturn(), notSame(%1 '_longjmp'), labelRefCount(%2 0) // applies to f.e. scott-bool1.c replace { @@ -4908,7 +4908,7 @@ ljmp %1 %2: ret -} if optimizeReturn() +} if optimizeReturn(), notSame(%1 '_longjmp') // for programs less than 2k replace { diff -Nru sdcc-3.1.0+dfsg/src/mcs51/ralloc.c sdcc-3.2.0+dfsg/src/mcs51/ralloc.c --- sdcc-3.1.0+dfsg/src/mcs51/ralloc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/mcs51/ralloc.c 2012-06-05 09:03:12.000000000 +0000 @@ -1033,15 +1033,23 @@ /* if the result of this one needs registers and does not have it then assign it right away */ - if (IC_RESULT (ic) && !(SKIP_IC2 (ic) || /* not a special icode */ - ic->op == JUMPTABLE || ic->op == IFX || ic->op == IPUSH || ic->op == IPOP || ic->op == RETURN || POINTER_SET (ic)) && (result = OP_SYMBOL (IC_RESULT (ic))) && /* has a result */ - result->liveTo > ic->seq && /* and will live beyond this */ - result->liveTo <= ebp->lSeq && /* does not go beyond this block */ - result->liveFrom == ic->seq && /* does not start before here */ + if (IC_RESULT (ic) && + !( SKIP_IC2 (ic) || /* not a special icode */ + ic->op == JUMPTABLE || + ic->op == IFX || + ic->op == IPUSH || + ic->op == IPOP || + ic->op == RETURN || + POINTER_SET (ic) ) && + (result = OP_SYMBOL (IC_RESULT (ic))) && /* has a result */ + result->liveTo > ic->seq && /* and will live beyond this */ + result->liveTo <= ebp->lSeq && /* does not go beyond this block */ + result->liveFrom == ic->seq && /* does not start before here */ result->regType == sym->regType && /* same register types */ - result->nRegs && /* which needs registers */ - !result->isspilt && /* and does not already have them */ - !result->remat && !bitVectBitValue (_G.regAssigned, result->key) && + result->nRegs && /* which needs registers */ + !result->isspilt && /* and does not already have them */ + !result->remat && + !bitVectBitValue (_G.regAssigned, result->key) && /* the number of free regs + number of regs in this LR can accomodate the what result Needs */ ((nfreeRegsType (result->regType) + sym->nRegs) >= result->nRegs)) @@ -1054,7 +1062,6 @@ _G.regAssigned = bitVectSetBit (_G.regAssigned, result->key); _G.totRegAssigned = bitVectSetBit (_G.totRegAssigned, result->key); - } /* free the remaining */ @@ -1243,8 +1250,12 @@ deassignLRs (ic, ebbs[i]); /* some don't need registers */ - if (SKIP_IC2 (ic) || - ic->op == JUMPTABLE || ic->op == IFX || ic->op == IPUSH || ic->op == IPOP || (IC_RESULT (ic) && POINTER_SET (ic))) + if (SKIP_IC2 (ic) || + ic->op == JUMPTABLE || + ic->op == IFX || + ic->op == IPUSH || + ic->op == IPOP || + (IC_RESULT (ic) && POINTER_SET (ic))) { continue; } @@ -2797,7 +2808,6 @@ accuse: OP_SYMBOL (IC_RESULT (ic))->accuse = 1; - } /*-----------------------------------------------------------------*/ @@ -2809,6 +2819,7 @@ iCode *dic, *lic; bitVect *dbv; struct eBBlock *ebp = ebpp[blockno]; + int disallowHiddenAssignment = 0; if (ic->op != IPUSH || !IS_ITEMP (IC_LEFT (ic))) return; @@ -2817,6 +2828,22 @@ if (bitVectnBitsOn (OP_DEFS (IC_LEFT (ic))) != 1 || bitVectnBitsOn (OP_USES (IC_LEFT (ic))) != 1) return; + /* The changes in SDCCopt.c #7741 should correct the use info, making */ + /* this extra test redundant. */ + if (ic->parmPush) + {// find Send or other Push for this func call + for (lic = ic->next; lic && lic->op != CALL; lic = lic->next) + { + if ((lic->op == IPUSH || lic->op == SEND) && IS_ITEMP (IC_LEFT (lic))) + {// and check parameter is not passed again + symbol * parm = OP_SYMBOL (IC_LEFT (ic)); + symbol * other = OP_SYMBOL (IC_LEFT (lic)); + if (other == parm) + return; + } + } + } + /* find the definition */ if (!(dic = hTabItemWithKey (iCodehTab, bitVectFirstBit (OP_DEFS (IC_LEFT (ic)))))) return; @@ -2840,6 +2867,12 @@ if (IS_SYMOP (IC_RIGHT (dic))) { + if (IC_RIGHT (dic)->isvolatile) + return; + + if (OP_SYMBOL (IC_RIGHT (dic))->addrtaken || isOperandGlobal (IC_RIGHT (dic))) + disallowHiddenAssignment = 1; + /* make sure the right side does not have any definitions inbetween */ dbv = OP_DEFS (IC_RIGHT (dic)); @@ -2847,6 +2880,8 @@ { if (bitVectBitValue (dbv, lic->key)) return; + if (disallowHiddenAssignment && (lic->op == CALL || lic->op == PCALL || POINTER_SET (lic))) + return; } /* make sure they have the same type */ if (IS_SPEC (operandType (IC_LEFT (ic)))) @@ -2864,8 +2899,10 @@ } bitVectUnSetBit (OP_SYMBOL (IC_RESULT (dic))->defs, dic->key); } + if (IS_ITEMP (IC_RIGHT (dic))) + OP_USES (IC_RIGHT (dic)) = bitVectSetBit (OP_USES (IC_RIGHT (dic)), ic->key); - /* we now we know that it has one & only one def & use + /* now we know that it has one & only one def & use and the that the definition is an assignment */ ReplaceOpWithCheaperOp (&IC_LEFT (ic), IC_RIGHT (dic)); remiCodeFromeBBlock (ebp, dic); diff -Nru sdcc-3.1.0+dfsg/src/pic14/Makefile.in sdcc-3.2.0+dfsg/src/pic14/Makefile.in --- sdcc-3.1.0+dfsg/src/pic14/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic14/Makefile.in 2012-03-30 10:48:18.000000000 +0000 @@ -1,9 +1,7 @@ -VPATH = @srcdir@ -srcdir = @srcdir@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +srcdir = @srcdir@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ # Make all in this directory -PORT = pic - include $(srcdir)/../port.mk diff -Nru sdcc-3.1.0+dfsg/src/pic14/gen.c sdcc-3.2.0+dfsg/src/pic14/gen.c --- sdcc-3.1.0+dfsg/src/pic14/gen.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic14/gen.c 2012-06-28 14:09:28.000000000 +0000 @@ -1,11 +1,12 @@ /*------------------------------------------------------------------------- gen.c - source file for code generation for pic - Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998) - and - Jean-Louis VERN.jlvern@writeme.com (1999) + Copyright (C) 1998, Sandeep Dutta . sandeep.dutta@usa.net + Copyright (C) 1999, Jean-Louis VERN.jlvern@writeme.com Bug Fixes - Wojciech Stryjewski wstryj1@tiger.lsu.edu (1999 v2.1.9a) - PIC port - Scott Dattalo scott@dattalo.com (2000) - cont'd - Raphael Neider (2005) + PIC port: + Copyright (C) 2000, Scott Dattalo scott@dattalo.com + Copyright (C) 2005, Raphael Neider 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 @@ -20,15 +21,12 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! - +-------------------------------------------------------------------------*/ +/* Notes: 000123 mlh Moved aopLiteral to SDCCglue.c to help the split - Made everything static --------------------------------------------------------------------------*/ + Made everything static +*/ /* * This is the down and dirty file with all kinds of @@ -40,6 +38,7 @@ #include "device.h" #include "gen.h" #include "glue.h" +#include "dbuf_string.h" /* * Imports @@ -48,9 +47,11 @@ extern set *externs; -static pCodeOp *popGetImmd(char *name, unsigned int offset, int index,int is_func); -static pCodeOp *popRegFromString(char *str, int size, int offset); -static int aop_isLitLike(asmop *aop); +static pCodeOp *popGetImmd (char *name, unsigned int offset, int index, int is_func); +static pCodeOp *popRegFromString (char *str, int size, int offset); +static int aop_isLitLike (asmop * aop); +static void genCritical (iCode * ic); +static void genEndCritical (iCode * ic); /* The PIC port(s) need not differentiate between POINTER and FPOINTER. */ #define PIC_IS_DATA_PTR(x) (IS_DATA_PTR(x) || IS_FARPTR(x)) @@ -66,34 +67,33 @@ static int pic14_inISR = 0; static char *zero = "0x00"; -static char *one = "0x01"; +static char *one = "0x01"; static char *spname = "sp"; -unsigned fReturnSizePic = 4; /* shared with ralloc.c */ -static char *fReturnpic14[] = {"temp1","temp2","temp3","temp4" }; +unsigned fReturnSizePic = 4; /* shared with ralloc.c */ +static char *fReturnpic14[] = { "temp1", "temp2", "temp3", "temp4" }; + static char **fReturn = fReturnpic14; -static struct { - short accInUse; - short inLine; - short debugLine; - short nRegsSaved; - set *sendSet; +static struct +{ + short accInUse; + short nRegsSaved; + set *sendSet; } _G; /* * Resolved ifx structure. This structure stores information * about an iCode ifx that makes it easier to generate code. */ -typedef struct resolvedIfx { - symbol *lbl; /* pointer to a label */ - int condition; /* true or false ifx */ - int generated; /* set true when the code associated with the ifx - * is generated */ +typedef struct resolvedIfx +{ + symbol *lbl; /* pointer to a label */ + int condition; /* true or false ifx */ + int generated; /* set true when the code associated with the ifx + * is generated */ } resolvedIfx; -static lineNode *lineHead = NULL; -static lineNode *lineCurr = NULL; static pBlock *pb; /*-----------------------------------------------------------------*/ @@ -105,186 +105,141 @@ /* return y; */ /* return -1; */ /*-----------------------------------------------------------------*/ -static int my_powof2 (unsigned long num) +static int +my_powof2 (unsigned long num) { - if(num) { - if( (num & (num-1)) == 0) { - int nshifts = -1; - while(num) { - num>>=1; - nshifts++; + if (num) + { + if ((num & (num - 1)) == 0) + { + int nshifts = -1; + while (num) + { + num >>= 1; + nshifts++; } - return nshifts; + return nshifts; } } - return -1; + return -1; } -void DEBUGpic14_AopType(int line_no, operand *left, operand *right, operand *result) +void +DEBUGpic14_AopType (int line_no, operand * left, operand * right, operand * result) { - DEBUGpic14_emitcode ("; ","line = %d result %s=%s, size=%d, left %s=%s, size=%d, right %s=%s, size=%d", - line_no, - ((result) ? AopType(AOP_TYPE(result)) : "-"), - ((result) ? aopGet(AOP(result),0,TRUE,FALSE) : "-"), - ((result) ? AOP_SIZE(result) : 0), - ((left) ? AopType(AOP_TYPE(left)) : "-"), - ((left) ? aopGet(AOP(left),0,TRUE,FALSE) : "-"), - ((left) ? AOP_SIZE(left) : 0), - ((right) ? AopType(AOP_TYPE(right)) : "-"), - ((right) ? aopGet(AOP(right),0,FALSE,FALSE) : "-"), - ((right) ? AOP_SIZE(right) : 0)); + DEBUGpic14_emitcode ("; ", "line = %d result %s=%s, size=%d, left %s=%s, size=%d, right %s=%s, size=%d", + line_no, + ((result) ? AopType (AOP_TYPE (result)) : "-"), + ((result) ? aopGet (AOP (result), 0, TRUE, FALSE) : "-"), + ((result) ? AOP_SIZE (result) : 0), + ((left) ? AopType (AOP_TYPE (left)) : "-"), + ((left) ? aopGet (AOP (left), 0, TRUE, FALSE) : "-"), + ((left) ? AOP_SIZE (left) : 0), + ((right) ? AopType (AOP_TYPE (right)) : "-"), + ((right) ? aopGet (AOP (right), 0, FALSE, FALSE) : "-"), ((right) ? AOP_SIZE (right) : 0)); } -static void DEBUGpic14_AopTypeSign(int line_no, operand *left, operand *right, operand *result) +static void +DEBUGpic14_AopTypeSign (int line_no, operand * left, operand * right, operand * result) { - DEBUGpic14_emitcode ("; ","line = %d, signs: result %s=%c, left %s=%c, right %s=%c", - line_no, - ((result) ? AopType(AOP_TYPE(result)) : "-"), - ((result) ? (SPEC_USIGN(operandType(result)) ? 'u' : 's') : '-'), - ((left) ? AopType(AOP_TYPE(left)) : "-"), - ((left) ? (SPEC_USIGN(operandType(left)) ? 'u' : 's') : '-'), - ((right) ? AopType(AOP_TYPE(right)) : "-"), - ((right) ? (SPEC_USIGN(operandType(right)) ? 'u' : 's') : '-')); + DEBUGpic14_emitcode ("; ", "line = %d, signs: result %s=%c, left %s=%c, right %s=%c", + line_no, + ((result) ? AopType (AOP_TYPE (result)) : "-"), + ((result) ? (SPEC_USIGN (operandType (result)) ? 'u' : 's') : '-'), + ((left) ? AopType (AOP_TYPE (left)) : "-"), + ((left) ? (SPEC_USIGN (operandType (left)) ? 'u' : 's') : '-'), + ((right) ? AopType (AOP_TYPE (right)) : "-"), + ((right) ? (SPEC_USIGN (operandType (right)) ? 'u' : 's') : '-')); } -void DEBUGpic14_emitcode (char *inst,char *fmt, ...) +void +DEBUGpic14_emitcode (char *inst, char *fmt, ...) { - va_list ap; - char lb[INITIAL_INLINEASM]; - unsigned char *lbp = (unsigned char *)lb; - - if(!debug_verbose && !options.debug) - return; - - va_start(ap,fmt); + va_list ap; - if (inst && *inst) { - if (fmt && *fmt) - sprintf(lb,"%s\t",inst); - else - sprintf(lb,"%s",inst); - vsprintf(lb+(strlen(lb)),fmt,ap); - } else - vsprintf(lb,fmt,ap); - - while (isspace(*lbp)) lbp++; - - if (lbp && *lbp) - lineCurr = (lineCurr ? - connectLine(lineCurr,newLineNode(lb)) : - (lineHead = newLineNode(lb))); - lineCurr->isInline = _G.inLine; - lineCurr->isDebug = _G.debugLine; + if (!debug_verbose && !options.debug) + return; - addpCode2pBlock(pb,newpCodeCharP(lb)); + va_start (ap, fmt); + va_emitcode (inst, fmt, ap); + va_end (ap); - va_end(ap); + addpCode2pBlock (pb, newpCodeCharP (genLine.lineCurr->line)); } -static void Safe_vsnprintf (char *buf, size_t size, const char *fmt, va_list ap) +void +emitpComment (const char *fmt, ...) { -#if defined (HAVE_VSNPRINTF) - vsnprintf (buf, size, fmt, ap); -#elif defined (HAVE_VSPRINTF) - vsprintf (buf, size, fmt, ap); - if (strlen (buf) >= size) - { - fprintf (stderr, "Safe_vsnprintf: buffer (size %u) has overflown\n", size); - } -#elif defined (HAVE_SNPRINTF) - snprintf (buf, size, "vs(n)printf required"); -#elif defined (HAVE_SRINTF) - sprintf (buf, "vs(n)printf required"); - if (strlen (buf) >= size) - { - fprintf (stderr, "Safe_vsnprintf: buffer (size %u) has overflown\n", size); - } -#else - assert ( !"neither vsnprintf nor vsprintf is present -- unable to proceed" ); -#endif -} + va_list ap; + struct dbuf_s dbuf; + const char *line; -void emitpComment (const char *fmt, ...) -{ - va_list va; - char buffer[4096]; + dbuf_init (&dbuf, INITIAL_INLINEASM); - va_start (va, fmt); - if (pb) { - Safe_vsnprintf (buffer, 4096, fmt, va); - //fprintf (stderr, "%s\n" ,buffer); - addpCode2pBlock (pb, newpCodeCharP (buffer)); - } - va_end (va); + dbuf_append_char (&dbuf, ';'); + va_start (ap, fmt); + dbuf_vprintf (&dbuf, fmt, ap); + va_end (ap); + + line = dbuf_detach_c_str (&dbuf); + emit_raw (line); + dbuf_free (line); + + addpCode2pBlock (pb, newpCodeCharP (genLine.lineCurr->line)); } -void emitpLabel(int key) +void +emitpLabel (int key) { - addpCode2pBlock(pb,newpCodeLabel(NULL,key+100+labelOffset)); + addpCode2pBlock (pb, newpCodeLabel (NULL, labelKey2num (key + labelOffset))); } /* gen.h defines a macro emitpcode that should be used to call emitpcode * as this allows for easy debugging (ever asked the question: where was * this instruction geenrated? Here is the answer... */ -void emitpcode_real(PIC_OPCODE poc, pCodeOp *pcop) +void +emitpcode_real (PIC_OPCODE poc, pCodeOp * pcop) { - if(pcop) - addpCode2pBlock(pb,newpCode(poc,pcop)); - else { - static int has_warned = 0; + if (pcop) + addpCode2pBlock (pb, newpCode (poc, pcop)); + else + { + static int has_warned = 0; - DEBUGpic14_emitcode(";","%s ignoring NULL pcop",__FUNCTION__); - if (!has_warned) { - has_warned = 1; - fprintf( stderr, "WARNING: encountered NULL pcop--this is probably a compiler bug...\n" ); + DEBUGpic14_emitcode (";", "%s ignoring NULL pcop", __FUNCTION__); + if (!has_warned) + { + has_warned = 1; + fprintf (stderr, "WARNING: encountered NULL pcop--this is probably a compiler bug...\n"); } } } -static void emitpcodeNULLop(PIC_OPCODE poc) +static void +emitpcodeNULLop (PIC_OPCODE poc) { - addpCode2pBlock(pb,newpCode(poc,NULL)); + addpCode2pBlock (pb, newpCode (poc, NULL)); } /*-----------------------------------------------------------------*/ /* pic14_emitcode - writes the code into a file : for now it is simple */ /*-----------------------------------------------------------------*/ -void pic14_emitcode (char *inst,char *fmt, ...) +void +pic14_emitcode (char *inst, char *fmt, ...) { - va_list ap; - char lb[INITIAL_INLINEASM]; - char *lbp = lb; - - va_start(ap,fmt); + va_list ap; - if (inst && *inst) { - if (fmt && *fmt) - sprintf(lb,"%s\t",inst); - else - sprintf(lb,"%s",inst); - vsprintf(lb+(strlen(lb)),fmt,ap); - } else - vsprintf(lb,fmt,ap); - - while (isspace(*lbp)) lbp++; - - if (lbp && *lbp) - lineCurr = (lineCurr ? - connectLine(lineCurr,newLineNode(lb)) : - (lineHead = newLineNode(lb))); - lineCurr->isInline = _G.inLine; - lineCurr->isDebug = _G.debugLine; - lineCurr->isLabel = (lbp[strlen (lbp) - 1] == ':'); - - if(debug_verbose) - addpCode2pBlock(pb,newpCodeCharP(lb)); + va_start (ap, fmt); + va_emitcode (inst, fmt, ap); + va_end (ap); - va_end(ap); + if (debug_verbose) + addpCode2pBlock (pb, newpCodeCharP (genLine.lineCurr->line)); } /*-----------------------------------------------------------------*/ @@ -292,465 +247,485 @@ /* with a debugger symbol */ /*-----------------------------------------------------------------*/ void -pic14_emitDebuggerSymbol (const char * debugSym) +pic14_emitDebuggerSymbol (const char *debugSym) { - _G.debugLine = 1; - pic14_emitcode ("", ";%s ==.", debugSym); - _G.debugLine = 0; + genLine.lineElement.isDebug = 1; + pic14_emitcode ("", ";%s ==.", debugSym); + genLine.lineElement.isDebug = 0; } /*-----------------------------------------------------------------*/ /* newAsmop - creates a new asmOp */ /*-----------------------------------------------------------------*/ -static asmop *newAsmop (short type) +static asmop * +newAsmop (short type) { - asmop *aop; + asmop *aop; - aop = Safe_calloc(1,sizeof(asmop)); - aop->type = type; - return aop; + aop = Safe_calloc (1, sizeof (asmop)); + aop->type = type; + return aop; } /*-----------------------------------------------------------------*/ /* resolveIfx - converts an iCode ifx into a form more useful for */ /* generating code */ /*-----------------------------------------------------------------*/ -static void resolveIfx(resolvedIfx *resIfx, iCode *ifx) +static void +resolveIfx (resolvedIfx * resIfx, iCode * ifx) { - if(!resIfx) - return; + if (!resIfx) + return; - // DEBUGpic14_emitcode("; ***","%s %d",__FUNCTION__,__LINE__); + // DEBUGpic14_emitcode("; ***","%s %d",__FUNCTION__,__LINE__); - resIfx->condition = 1; /* assume that the ifx is true */ - resIfx->generated = 0; /* indicate that the ifx has not been used */ + resIfx->condition = 1; /* assume that the ifx is true */ + resIfx->generated = 0; /* indicate that the ifx has not been used */ - if(!ifx) { - resIfx->lbl = NULL; /* this is wrong: newiTempLabel(NULL); / * oops, there is no ifx. so create a label */ - } else { - if(IC_TRUE(ifx)) { - resIfx->lbl = IC_TRUE(ifx); - } else { - resIfx->lbl = IC_FALSE(ifx); - resIfx->condition = 0; + if (!ifx) + { + resIfx->lbl = NULL; /* this is wrong: newiTempLabel(NULL); / * oops, there is no ifx. so create a label */ + } + else + { + if (IC_TRUE (ifx)) + { + resIfx->lbl = IC_TRUE (ifx); + } + else + { + resIfx->lbl = IC_FALSE (ifx); + resIfx->condition = 0; } } - // DEBUGpic14_emitcode("; ***","%s lbl->key=%d, (lab offset=%d)",__FUNCTION__,resIfx->lbl->key,labelOffset); + // DEBUGpic14_emitcode("; ***","%s lbl->key=%d, (lab offset=%d)",__FUNCTION__,resIfx->lbl->key,labelOffset); } /*-----------------------------------------------------------------*/ /* aopForSym - for a true symbol */ /*-----------------------------------------------------------------*/ -static asmop *aopForSym (iCode *ic,symbol *sym,bool result) +static asmop * +aopForSym (iCode * ic, symbol * sym, bool result) { - asmop *aop; - memmap *space= SPEC_OCLS(sym->etype); + asmop *aop; + memmap *space = SPEC_OCLS (sym->etype); - DEBUGpic14_emitcode("; ***","%s %d",__FUNCTION__,__LINE__); - /* if already has one */ - if (sym->aop) - return sym->aop; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* if already has one */ + if (sym->aop) + return sym->aop; - //DEBUGpic14_emitcode(";","%d",__LINE__); - /* if it is in direct space */ - if (IN_DIRSPACE(space)) { - sym->aop = aop = newAsmop (AOP_DIR); - aop->aopu.aop_dir = sym->rname ; - aop->size = getSize(sym->type); - DEBUGpic14_emitcode(";","%d sym->rname = %s, size = %d",__LINE__,sym->rname,aop->size); - return aop; + //DEBUGpic14_emitcode(";","%d",__LINE__); + /* if it is in direct space */ + if (IN_DIRSPACE (space)) + { + sym->aop = aop = newAsmop (AOP_DIR); + aop->aopu.aop_dir = sym->rname; + aop->size = getSize (sym->type); + DEBUGpic14_emitcode (";", "%d sym->rname = %s, size = %d", __LINE__, sym->rname, aop->size); + return aop; } - /* special case for a function */ - if (IS_FUNC(sym->type)) { + /* special case for a function */ + if (IS_FUNC (sym->type)) + { - sym->aop = aop = newAsmop(AOP_PCODE); - aop->aopu.pcop = popGetImmd(sym->rname,0,0,1); - PCOI(aop->aopu.pcop)->_const = IN_CODESPACE(space); - PCOI(aop->aopu.pcop)->_function = 1; - PCOI(aop->aopu.pcop)->index = 0; - aop->size = FPTRSIZE; - DEBUGpic14_emitcode(";","%d size = %d, name =%s",__LINE__,aop->size,sym->rname); - return aop; + sym->aop = aop = newAsmop (AOP_PCODE); + aop->aopu.pcop = popGetImmd (sym->rname, 0, 0, 1); + PCOI (aop->aopu.pcop)->_const = IN_CODESPACE (space); + PCOI (aop->aopu.pcop)->_function = 1; + PCOI (aop->aopu.pcop)->index = 0; + aop->size = FPTRSIZE; + DEBUGpic14_emitcode (";", "%d size = %d, name =%s", __LINE__, aop->size, sym->rname); + return aop; } - if (IS_ARRAY(sym->type)) { - sym->aop = aop = newAsmop(AOP_PCODE); - aop->aopu.pcop = popGetImmd(sym->rname,0,0,1); - PCOI(aop->aopu.pcop)->_const = IN_CODESPACE(space); - PCOI(aop->aopu.pcop)->_function = 0; - PCOI(aop->aopu.pcop)->index = 0; - aop->size = getSize(sym->etype) * DCL_ELEM(sym->type); + if (IS_ARRAY (sym->type)) + { + sym->aop = aop = newAsmop (AOP_PCODE); + aop->aopu.pcop = popGetImmd (sym->rname, 0, 0, 1); + PCOI (aop->aopu.pcop)->_const = IN_CODESPACE (space); + PCOI (aop->aopu.pcop)->_function = 0; + PCOI (aop->aopu.pcop)->index = 0; + aop->size = getSize (sym->etype) * DCL_ELEM (sym->type); - DEBUGpic14_emitcode(";","%d size = %d, name =%s",__LINE__,aop->size,sym->rname); - return aop; + DEBUGpic14_emitcode (";", "%d size = %d, name =%s", __LINE__, aop->size, sym->rname); + return aop; } - /* only remaining is far space */ - /* in which case DPTR gets the address */ - sym->aop = aop = newAsmop(AOP_PCODE); + /* only remaining is far space */ + /* in which case DPTR gets the address */ + sym->aop = aop = newAsmop (AOP_PCODE); - aop->aopu.pcop = popGetImmd(sym->rname,0,0,0); - PCOI(aop->aopu.pcop)->_const = IN_CODESPACE(space); - PCOI(aop->aopu.pcop)->index = 0; + aop->aopu.pcop = popGetImmd (sym->rname, 0, 0, 0); + PCOI (aop->aopu.pcop)->_const = IN_CODESPACE (space); + PCOI (aop->aopu.pcop)->index = 0; - DEBUGpic14_emitcode(";","%d: rname %s, val %d, const = %d", - __LINE__,sym->rname, 0, PCOI(aop->aopu.pcop)->_const); + DEBUGpic14_emitcode (";", "%d: rname %s, val %d, const = %d", __LINE__, sym->rname, 0, PCOI (aop->aopu.pcop)->_const); - allocDirReg (IC_LEFT(ic)); + allocDirReg (IC_LEFT (ic)); - aop->size = FPTRSIZE; + aop->size = FPTRSIZE; - /* if it is in code space */ - if (IN_CODESPACE(space)) - aop->code = 1; + /* if it is in code space */ + if (IN_CODESPACE (space)) + aop->code = 1; - return aop; + return aop; } /*-----------------------------------------------------------------*/ /* aopForRemat - rematerialzes an object */ /*-----------------------------------------------------------------*/ -static asmop *aopForRemat (operand *op) // x symbol *sym) +static asmop * +aopForRemat (operand * op) // x symbol *sym) { - symbol *sym = OP_SYMBOL(op); - iCode *ic = NULL; - asmop *aop = newAsmop(AOP_PCODE); - int val = 0; - int offset = 0; + symbol *sym = OP_SYMBOL (op); + iCode *ic = NULL; + asmop *aop = newAsmop (AOP_PCODE); + int val = 0; - ic = sym->rematiCode; + ic = sym->rematiCode; - DEBUGpic14_emitcode(";","%s %d",__FUNCTION__,__LINE__); - if(IS_OP_POINTER(op)) { - DEBUGpic14_emitcode(";","%s %d IS_OP_POINTER",__FUNCTION__,__LINE__); - } - for (;;) { - if (ic->op == '+') { - val += (int) operandLitValue(IC_RIGHT(ic)); - } else if (ic->op == '-') { - val -= (int) operandLitValue(IC_RIGHT(ic)); - } else - break; + DEBUGpic14_emitcode (";", "%s %d", __FUNCTION__, __LINE__); + if (IS_OP_POINTER (op)) + { + DEBUGpic14_emitcode (";", "%s %d IS_OP_POINTER", __FUNCTION__, __LINE__); + } + for (;;) + { + if (ic->op == '+') + { + val += (int) operandLitValue (IC_RIGHT (ic)); + } + else if (ic->op == '-') + { + val -= (int) operandLitValue (IC_RIGHT (ic)); + } + else + break; - ic = OP_SYMBOL(IC_LEFT(ic))->rematiCode; + ic = OP_SYMBOL (IC_LEFT (ic))->rematiCode; } - offset = OP_SYMBOL(IC_LEFT(ic))->offset; - aop->aopu.pcop = popGetImmd(OP_SYMBOL(IC_LEFT(ic))->rname,0,val,0); - PCOI(aop->aopu.pcop)->_const = IS_PTR_CONST(operandType(op)); - PCOI(aop->aopu.pcop)->index = val; + aop->aopu.pcop = popGetImmd (OP_SYMBOL (IC_LEFT (ic))->rname, 0, val, 0); + PCOI (aop->aopu.pcop)->_const = IS_PTR_CONST (operandType (op)); + PCOI (aop->aopu.pcop)->index = val; - DEBUGpic14_emitcode(";","%d: rname %s, val %d, const = %d", - __LINE__,OP_SYMBOL(IC_LEFT(ic))->rname, - val, IS_PTR_CONST(operandType(op))); + DEBUGpic14_emitcode (";", "%d: rname %s, val %d, const = %d", + __LINE__, OP_SYMBOL (IC_LEFT (ic))->rname, val, IS_PTR_CONST (operandType (op))); - // DEBUGpic14_emitcode(";","aop type %s",AopType(AOP_TYPE(IC_LEFT(ic)))); + // DEBUGpic14_emitcode(";","aop type %s",AopType(AOP_TYPE(IC_LEFT(ic)))); - allocDirReg (IC_LEFT(ic)); + allocDirReg (IC_LEFT (ic)); - return aop; + return aop; } -static int aopIdx (asmop *aop, int offset) +static int +aopIdx (asmop * aop, int offset) { - if(!aop) - return -1; + if (!aop) + return -1; - if(aop->type != AOP_REG) - return -2; + if (aop->type != AOP_REG) + return -2; - return aop->aopu.aop_reg[offset]->rIdx; + return aop->aopu.aop_reg[offset]->rIdx; } /*-----------------------------------------------------------------*/ /* regsInCommon - two operands have some registers in common */ /*-----------------------------------------------------------------*/ -static bool regsInCommon (operand *op1, operand *op2) +static bool +regsInCommon (operand * op1, operand * op2) { - symbol *sym1, *sym2; - int i; + symbol *sym1, *sym2; + int i; - /* if they have registers in common */ - if (!IS_SYMOP(op1) || !IS_SYMOP(op2)) - return FALSE ; + /* if they have registers in common */ + if (!IS_SYMOP (op1) || !IS_SYMOP (op2)) + return FALSE; - sym1 = OP_SYMBOL(op1); - sym2 = OP_SYMBOL(op2); + sym1 = OP_SYMBOL (op1); + sym2 = OP_SYMBOL (op2); - if (sym1->nRegs == 0 || sym2->nRegs == 0) - return FALSE ; + if (sym1->nRegs == 0 || sym2->nRegs == 0) + return FALSE; - for (i = 0 ; i < sym1->nRegs ; i++) { - int j; - if (!sym1->regs[i]) - continue ; + for (i = 0; i < sym1->nRegs; i++) + { + int j; + if (!sym1->regs[i]) + continue; - for (j = 0 ; j < sym2->nRegs ;j++ ) { - if (!sym2->regs[j]) - continue ; + for (j = 0; j < sym2->nRegs; j++) + { + if (!sym2->regs[j]) + continue; - if (sym2->regs[j] == sym1->regs[i]) - return TRUE ; + if (sym2->regs[j] == sym1->regs[i]) + return TRUE; } } - return FALSE ; + return FALSE; } /*-----------------------------------------------------------------*/ /* operandsEqu - equivalent */ /*-----------------------------------------------------------------*/ -static bool operandsEqu ( operand *op1, operand *op2) +static bool +operandsEqu (operand * op1, operand * op2) { - symbol *sym1, *sym2; + symbol *sym1, *sym2; + + /* if they not symbols */ + if (!IS_SYMOP (op1) || !IS_SYMOP (op2)) + return FALSE; + + sym1 = OP_SYMBOL (op1); + sym2 = OP_SYMBOL (op2); + + /* if both are itemps & one is spilt + and the other is not then false */ + if (IS_ITEMP (op1) && IS_ITEMP (op2) && sym1->isspilt != sym2->isspilt) + return FALSE; + + /* if they are the same */ + if (sym1 == sym2) + return TRUE; - /* if they not symbols */ - if (!IS_SYMOP(op1) || !IS_SYMOP(op2)) - return FALSE; - - sym1 = OP_SYMBOL(op1); - sym2 = OP_SYMBOL(op2); - - /* if both are itemps & one is spilt - and the other is not then false */ - if (IS_ITEMP(op1) && IS_ITEMP(op2) && - sym1->isspilt != sym2->isspilt ) - return FALSE ; - - /* if they are the same */ - if (sym1 == sym2) - return TRUE ; - - if (sym1->rname[0] && sym2->rname[0] - && strcmp (sym1->rname, sym2->rname) == 0) - return TRUE; - - - /* if left is a tmp & right is not */ - if (IS_ITEMP(op1) && - !IS_ITEMP(op2) && - sym1->isspilt && - (sym1->usl.spillLoc == sym2)) - return TRUE; - - if (IS_ITEMP(op2) && - !IS_ITEMP(op1) && - sym2->isspilt && - sym1->level > 0 && - (sym2->usl.spillLoc == sym1)) - return TRUE ; + if (sym1->rname[0] && sym2->rname[0] && strcmp (sym1->rname, sym2->rname) == 0) + return TRUE; - return FALSE ; + + /* if left is a tmp & right is not */ + if (IS_ITEMP (op1) && !IS_ITEMP (op2) && sym1->isspilt && (sym1->usl.spillLoc == sym2)) + return TRUE; + + if (IS_ITEMP (op2) && !IS_ITEMP (op1) && sym2->isspilt && sym1->level > 0 && (sym2->usl.spillLoc == sym1)) + return TRUE; + + return FALSE; } /*-----------------------------------------------------------------*/ /* pic14_sameRegs - two asmops have the same registers */ /*-----------------------------------------------------------------*/ -bool pic14_sameRegs (asmop *aop1, asmop *aop2 ) +bool +pic14_sameRegs (asmop * aop1, asmop * aop2) { - int i; + int i; - if (aop1 == aop2) - return TRUE ; + if (aop1 == aop2) + return TRUE; - if (aop1->type != AOP_REG || - aop2->type != AOP_REG ) - return FALSE ; - - if (aop1->size != aop2->size ) - return FALSE ; - - for (i = 0 ; i < aop1->size ; i++ ) - if (aop1->aopu.aop_reg[i] != - aop2->aopu.aop_reg[i] ) - return FALSE ; + if (aop1->type != AOP_REG || aop2->type != AOP_REG) + return FALSE; - return TRUE ; + if (aop1->size != aop2->size) + return FALSE; + + for (i = 0; i < aop1->size; i++) + if (aop1->aopu.aop_reg[i] != aop2->aopu.aop_reg[i]) + return FALSE; + + return TRUE; } /*-----------------------------------------------------------------*/ /* aopOp - allocates an asmop for an operand : */ /*-----------------------------------------------------------------*/ -void aopOp (operand *op, iCode *ic, bool result) +void +aopOp (operand * op, iCode * ic, bool result) { - asmop *aop; - symbol *sym; - int i; + asmop *aop; + symbol *sym; + int i; - if (!op) - return ; + if (!op) + return; - /* if this a literal */ - if (IS_OP_LITERAL(op)) { - op->aop = aop = newAsmop(AOP_LIT); - aop->aopu.aop_lit = OP_VALUE (op); - aop->size = getSize(operandType(op)); - return; + /* if this a literal */ + if (IS_OP_LITERAL (op)) + { + op->aop = aop = newAsmop (AOP_LIT); + aop->aopu.aop_lit = OP_VALUE (op); + aop->size = getSize (operandType (op)); + return; } + { + sym_link *type = operandType (op); + if (IS_PTR_CONST (type)) + DEBUGpic14_emitcode (";", "%d aop type is const pointer", __LINE__); + } + + /* if already has a asmop then continue */ + if (op->aop) + return; + + /* if the underlying symbol has a aop */ + if (IS_SYMOP (op) && OP_SYMBOL (op)->aop) { - sym_link *type = operandType(op); - if(IS_PTR_CONST(type)) - DEBUGpic14_emitcode(";","%d aop type is const pointer",__LINE__); + DEBUGpic14_emitcode (";", "%d", __LINE__); + op->aop = OP_SYMBOL (op)->aop; + return; } - /* if already has a asmop then continue */ - if (op->aop) - return ; - - /* if the underlying symbol has a aop */ - if (IS_SYMOP(op) && OP_SYMBOL(op)->aop) { - DEBUGpic14_emitcode(";","%d",__LINE__); - op->aop = OP_SYMBOL(op)->aop; - return; + /* if this is a true symbol */ + if (IS_TRUE_SYMOP (op)) + { + //DEBUGpic14_emitcode(";","%d - true symop",__LINE__); + op->aop = aopForSym (ic, OP_SYMBOL (op), result); + return; } - /* if this is a true symbol */ - if (IS_TRUE_SYMOP(op)) { - //DEBUGpic14_emitcode(";","%d - true symop",__LINE__); - op->aop = aopForSym(ic,OP_SYMBOL(op),result); - return ; - } - - /* this is a temporary : this has - only four choices : - a) register - b) spillocation - c) rematerialize - d) conditional - e) can be a return use only */ - - sym = OP_SYMBOL(op); - - - /* if the type is a conditional */ - if (sym->regType == REG_CND) { - aop = op->aop = sym->aop = newAsmop(AOP_CRY); - aop->size = 0; - return; + /* this is a temporary : this has + only four choices : + a) register + b) spillocation + c) rematerialize + d) conditional + e) can be a return use only */ + + sym = OP_SYMBOL (op); + + + /* if the type is a conditional */ + if (sym->regType == REG_CND) + { + aop = op->aop = sym->aop = newAsmop (AOP_CRY); + aop->size = 0; + return; } - /* if it is spilt then two situations - a) is rematerialize - b) has a spill location */ - if (sym->isspilt || sym->nRegs == 0) { + /* if it is spilt then two situations + a) is rematerialize + b) has a spill location */ + if (sym->isspilt || sym->nRegs == 0) + { - DEBUGpic14_emitcode(";","%d",__LINE__); - /* rematerialize it NOW */ - if (sym->remat) { + DEBUGpic14_emitcode (";", "%d", __LINE__); + /* rematerialize it NOW */ + if (sym->remat) + { - sym->aop = op->aop = aop = aopForRemat (op); - aop->size = getSize(sym->type); - //DEBUGpic14_emitcode(";"," %d: size %d, %s\n",__LINE__,aop->size,aop->aopu.aop_immd); - return; + sym->aop = op->aop = aop = aopForRemat (op); + aop->size = getSize (sym->type); + //DEBUGpic14_emitcode(";"," %d: size %d, %s\n",__LINE__,aop->size,aop->aopu.aop_immd); + return; } - if (sym->ruonly ) { - if(sym->isptr) { // && sym->uptr - aop = op->aop = sym->aop = newAsmop(AOP_PCODE); - aop->aopu.pcop = newpCodeOp(NULL,PO_GPR_POINTER); //popCopyReg(&pc_fsr); - - //PCOI(aop->aopu.pcop)->_const = 0; - //PCOI(aop->aopu.pcop)->index = 0; - /* - DEBUGpic14_emitcode(";","%d: rname %s, val %d, const = %d", - __LINE__,sym->rname, 0, PCOI(aop->aopu.pcop)->_const); - */ - //allocDirReg (IC_LEFT(ic)); + if (sym->ruonly) + { + if (sym->isptr) // && sym->uptr + { + aop = op->aop = sym->aop = newAsmop (AOP_PCODE); + aop->aopu.pcop = newpCodeOp (NULL, PO_GPR_POINTER); //popCopyReg(&pc_fsr); - aop->size = getSize(sym->type); - DEBUGpic14_emitcode(";","%d",__LINE__); - return; + //PCOI(aop->aopu.pcop)->_const = 0; + //PCOI(aop->aopu.pcop)->index = 0; + /* + DEBUGpic14_emitcode(";","%d: rname %s, val %d, const = %d", + __LINE__,sym->rname, 0, PCOI(aop->aopu.pcop)->_const); + */ + //allocDirReg (IC_LEFT(ic)); + + aop->size = getSize (sym->type); + DEBUGpic14_emitcode (";", "%d", __LINE__); + return; - } else { + } + else + { - unsigned i; + unsigned i; - aop = op->aop = sym->aop = newAsmop(AOP_STR); - aop->size = getSize(sym->type); - for ( i = 0 ; i < fReturnSizePic ; i++ ) - aop->aopu.aop_str[i] = fReturn[i]; + aop = op->aop = sym->aop = newAsmop (AOP_STR); + aop->size = getSize (sym->type); + for (i = 0; i < fReturnSizePic; i++) + aop->aopu.aop_str[i] = fReturn[i]; - DEBUGpic14_emitcode(";","%d",__LINE__); - return; + DEBUGpic14_emitcode (";", "%d", __LINE__); + return; } } - /* else spill location */ - if (sym->usl.spillLoc) + /* else spill location */ + if (sym->usl.spillLoc) { - asmop *oldAsmOp = NULL; + asmop *oldAsmOp = NULL; - if (getSize(sym->type) != getSize(sym->usl.spillLoc->type)) + if (getSize (sym->type) != getSize (sym->usl.spillLoc->type)) { - /* force a new aop if sizes differ */ - oldAsmOp = sym->usl.spillLoc->aop; - sym->usl.spillLoc->aop = NULL; + /* force a new aop if sizes differ */ + oldAsmOp = sym->usl.spillLoc->aop; + sym->usl.spillLoc->aop = NULL; } - DEBUGpic14_emitcode(";","%s %d %s sym->rname = %s, offset %d", - __FUNCTION__,__LINE__, - sym->usl.spillLoc->rname, - sym->rname, sym->usl.spillLoc->offset); + DEBUGpic14_emitcode (";", "%s %d %s sym->rname = %s, offset %d", + __FUNCTION__, __LINE__, sym->usl.spillLoc->rname, sym->rname, sym->usl.spillLoc->offset); - sym->aop = op->aop = aop = newAsmop(AOP_PCODE); - if (getSize(sym->type) != getSize(sym->usl.spillLoc->type)) + sym->aop = op->aop = aop = newAsmop (AOP_PCODE); + if (getSize (sym->type) != getSize (sym->usl.spillLoc->type)) { - /* Don't reuse the new aop, go with the last one */ - sym->usl.spillLoc->aop = oldAsmOp; + /* Don't reuse the new aop, go with the last one */ + sym->usl.spillLoc->aop = oldAsmOp; } - //aop->aopu.pcop = popGetImmd(sym->usl.spillLoc->rname,0,sym->usl.spillLoc->offset); - aop->aopu.pcop = popRegFromString(sym->usl.spillLoc->rname, - getSize(sym->type), - sym->usl.spillLoc->offset); - aop->size = getSize(sym->type); + //aop->aopu.pcop = popGetImmd(sym->usl.spillLoc->rname,0,sym->usl.spillLoc->offset); + aop->aopu.pcop = popRegFromString (sym->usl.spillLoc->rname, getSize (sym->type), sym->usl.spillLoc->offset); + aop->size = getSize (sym->type); - return; + return; } } - { - sym_link *type = operandType(op); - if(IS_PTR_CONST(type)) - DEBUGpic14_emitcode(";","%d aop type is const pointer",__LINE__); - } + { + sym_link *type = operandType (op); + if (IS_PTR_CONST (type)) + DEBUGpic14_emitcode (";", "%d aop type is const pointer", __LINE__); + } - /* must be in a register */ - DEBUGpic14_emitcode(";","%d register type nRegs=%d",__LINE__,sym->nRegs); - sym->aop = op->aop = aop = newAsmop(AOP_REG); - aop->size = sym->nRegs; - for ( i = 0 ; i < sym->nRegs ;i++) - aop->aopu.aop_reg[i] = sym->regs[i]; + /* must be in a register */ + DEBUGpic14_emitcode (";", "%d register type nRegs=%d", __LINE__, sym->nRegs); + sym->aop = op->aop = aop = newAsmop (AOP_REG); + aop->size = sym->nRegs; + for (i = 0; i < sym->nRegs; i++) + aop->aopu.aop_reg[i] = sym->regs[i]; } /*-----------------------------------------------------------------*/ /* freeAsmop - free up the asmop given to an operand */ /*----------------------------------------------------------------*/ -void freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop) +void +freeAsmop (operand * op, asmop * aaop, iCode * ic, bool pop) { - asmop *aop ; + asmop *aop; - if (!op) - aop = aaop; - else - aop = op->aop; - - if (!aop) - return ; - - aop->freed = 1; - - /* all other cases just dealloc */ - if (op) { - op->aop = NULL; - if (IS_SYMOP(op)) { - OP_SYMBOL(op)->aop = NULL; - /* if the symbol has a spill */ - if (SPIL_LOC(op)) - SPIL_LOC(op)->aop = NULL; + if (!op) + aop = aaop; + else + aop = op->aop; + + if (!aop) + return; + + aop->freed = 1; + + /* all other cases just dealloc */ + if (op) + { + op->aop = NULL; + if (IS_SYMOP (op)) + { + OP_SYMBOL (op)->aop = NULL; + /* if the symbol has a spill */ + if (SPIL_LOC (op)) + SPIL_LOC (op)->aop = NULL; } } } @@ -758,560 +733,601 @@ /*-----------------------------------------------------------------*/ /* pic14aopLiteral - string from a literal value */ /*-----------------------------------------------------------------*/ -static unsigned int pic14aopLiteral (value *val, int offset) +static unsigned int +pic14aopLiteral (value * val, int offset) { - union { - float f; - unsigned char c[4]; - } fl; + union + { + float f; + unsigned char c[4]; + } fl; - /* if it is a float then it gets tricky */ - /* otherwise it is fairly simple */ - if (!IS_FLOAT(val->type)) { - unsigned long v = ulFromVal (val); + /* if it is a float then it gets tricky */ + /* otherwise it is fairly simple */ + if (!IS_FLOAT (val->type)) + { + unsigned long v = ulFromVal (val); - return ( (v >> (offset * 8)) & 0xff); - } + return ((v >> (offset * 8)) & 0xff); + } - /* it is type float */ - fl.f = (float) floatFromVal(val); + /* it is type float */ + fl.f = (float) floatFromVal (val); #ifdef WORDS_BIGENDIAN - return fl.c[3-offset]; + return fl.c[3 - offset]; #else - return fl.c[offset]; + return fl.c[offset]; #endif } /*-----------------------------------------------------------------*/ /* aopGet - for fetching value of the aop */ /*-----------------------------------------------------------------*/ -char *aopGet (asmop *aop, int offset, bool bit16, bool dname) +char * +aopGet (asmop * aop, int offset, bool bit16, bool dname) { - char *s = buffer ; - char *rs; + char *s = buffer; + char *rs; - //DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* offset is greater than - size then zero */ - assert(aop); - if (offset > (aop->size - 1) && - aop->type != AOP_LIT) - return zero; + //DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + /* offset is greater than + size then zero */ + assert (aop); + if (offset > (aop->size - 1) && aop->type != AOP_LIT) + return zero; - /* depending on type */ - switch (aop->type) { + /* depending on type */ + switch (aop->type) + { case AOP_IMMD: - if (bit16) - sprintf (s,"%s",aop->aopu.aop_immd); - else - if (offset) - sprintf(s,"(%s >> %d)", - aop->aopu.aop_immd, - offset*8); - else - sprintf(s,"%s", - aop->aopu.aop_immd); - DEBUGpic14_emitcode(";","%d immd %s",__LINE__,s); - rs = Safe_calloc(1,strlen(s)+1); - strcpy(rs,s); - return rs; + if (bit16) + sprintf (s, "%s", aop->aopu.aop_immd); + else if (offset) + sprintf (s, "(%s >> %d)", aop->aopu.aop_immd, offset * 8); + else + sprintf (s, "%s", aop->aopu.aop_immd); + DEBUGpic14_emitcode (";", "%d immd %s", __LINE__, s); + rs = Safe_calloc (1, strlen (s) + 1); + strcpy (rs, s); + return rs; case AOP_DIR: - if (offset) { - sprintf(s,"(%s + %d)", - aop->aopu.aop_dir, - offset); - DEBUGpic14_emitcode(";","oops AOP_DIR did this %s\n",s); - } else - sprintf(s,"%s",aop->aopu.aop_dir); - rs = Safe_calloc(1,strlen(s)+1); - strcpy(rs,s); - return rs; + if (offset) + { + sprintf (s, "(%s + %d)", aop->aopu.aop_dir, offset); + DEBUGpic14_emitcode (";", "oops AOP_DIR did this %s\n", s); + } + else + sprintf (s, "%s", aop->aopu.aop_dir); + rs = Safe_calloc (1, strlen (s) + 1); + strcpy (rs, s); + return rs; case AOP_REG: - //if (dname) - // return aop->aopu.aop_reg[offset]->dname; - //else - return aop->aopu.aop_reg[offset]->name; + //if (dname) + // return aop->aopu.aop_reg[offset]->dname; + //else + return aop->aopu.aop_reg[offset]->name; case AOP_CRY: - //pic14_emitcode(";","%d",__LINE__); - return aop->aopu.aop_dir; + //pic14_emitcode(";","%d",__LINE__); + return aop->aopu.aop_dir; case AOP_LIT: - sprintf(s, "0x%02x", pic14aopLiteral (aop->aopu.aop_lit, offset)); - rs = Safe_strdup(s); - return rs; + sprintf (s, "0x%02x", pic14aopLiteral (aop->aopu.aop_lit, offset)); + rs = Safe_strdup (s); + return rs; case AOP_STR: - aop->coff = offset ; - if (strcmp(aop->aopu.aop_str[offset],"a") == 0 && - dname) - return "acc"; - DEBUGpic14_emitcode(";","%d - %s",__LINE__, aop->aopu.aop_str[offset]); + aop->coff = offset; + if (strcmp (aop->aopu.aop_str[offset], "a") == 0 && dname) + return "acc"; + DEBUGpic14_emitcode (";", "%d - %s", __LINE__, aop->aopu.aop_str[offset]); - return aop->aopu.aop_str[offset]; + return aop->aopu.aop_str[offset]; case AOP_PCODE: + { + pCodeOp *pcop = aop->aopu.pcop; + DEBUGpic14_emitcode (";", "%d: aopGet AOP_PCODE type %s", __LINE__, pCodeOpType (pcop)); + if (pcop->name) { - pCodeOp *pcop = aop->aopu.pcop; - DEBUGpic14_emitcode(";","%d: aopGet AOP_PCODE type %s",__LINE__,pCodeOpType(pcop)); - if(pcop->name) { - if (pcop->type == PO_IMMEDIATE) { - offset += PCOI(pcop)->index; - } - if (offset) { - DEBUGpic14_emitcode(";","%s offset %d",pcop->name,offset); - sprintf(s,"(%s+%d)", pcop->name,offset); - } else { - DEBUGpic14_emitcode(";","%s",pcop->name); - sprintf(s,"%s", pcop->name); - } - } else - sprintf(s,"0x%02x", PCOI(aop->aopu.pcop)->offset); - + if (pcop->type == PO_IMMEDIATE) + { + offset += PCOI (pcop)->index; + } + if (offset) + { + DEBUGpic14_emitcode (";", "%s offset %d", pcop->name, offset); + sprintf (s, "(%s+%d)", pcop->name, offset); + } + else + { + DEBUGpic14_emitcode (";", "%s", pcop->name); + sprintf (s, "%s", pcop->name); + } } - rs = Safe_calloc(1,strlen(s)+1); - strcpy(rs,s); - return rs; + else + sprintf (s, "0x%02x", PCOI (aop->aopu.pcop)->offset); - } + } + rs = Safe_calloc (1, strlen (s) + 1); + strcpy (rs, s); + return rs; + + } - werror(E_INTERNAL_ERROR,__FILE__,__LINE__, - "aopget got unsupported aop->type"); - exit(0); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "aopget got unsupported aop->type"); + exit (0); } /*-----------------------------------------------------------------*/ /* popGetTempReg - create a new temporary pCodeOp */ /*-----------------------------------------------------------------*/ -static pCodeOp *popGetTempReg(void) +static pCodeOp * +popGetTempReg (void) { - pCodeOp *pcop; + pCodeOp *pcop; - pcop = newpCodeOp(NULL, PO_GPR_TEMP); - if(pcop && pcop->type == PO_GPR_TEMP && PCOR(pcop)->r) { - PCOR(pcop)->r->wasUsed=1; - PCOR(pcop)->r->isFree=0; + pcop = newpCodeOp (NULL, PO_GPR_TEMP); + if (pcop && pcop->type == PO_GPR_TEMP && PCOR (pcop)->r) + { + PCOR (pcop)->r->wasUsed = 1; + PCOR (pcop)->r->isFree = 0; } - return pcop; + return pcop; } /*-----------------------------------------------------------------*/ /* popReleaseTempReg - create a new temporary pCodeOp */ /*-----------------------------------------------------------------*/ -static void popReleaseTempReg(pCodeOp *pcop) +static void +popReleaseTempReg (pCodeOp * pcop) { - if(pcop && pcop->type == PO_GPR_TEMP && PCOR(pcop)->r) - PCOR(pcop)->r->isFree = 1; + if (pcop && pcop->type == PO_GPR_TEMP && PCOR (pcop)->r) + PCOR (pcop)->r->isFree = 1; } /*-----------------------------------------------------------------*/ /* popGetLabel - create a new pCodeOp of type PO_LABEL */ /*-----------------------------------------------------------------*/ -pCodeOp *popGetLabel(unsigned int key) +pCodeOp * +popGetLabel (unsigned int key) { - DEBUGpic14_emitcode ("; ***","%s key=%d, label offset %d",__FUNCTION__,key, labelOffset); + DEBUGpic14_emitcode ("; ***", "%s key=%d, label offset %d", __FUNCTION__, key, labelOffset); - if(key>(unsigned int)max_key) - max_key = key; + if (key > (unsigned int) max_key) + max_key = key; - return newpCodeOpLabel(NULL,key+100+labelOffset); + return newpCodeOpLabel (NULL, labelKey2num (key + labelOffset)); } /*-------------------------------------------------------------------*/ /* popGetHighLabel - create a new pCodeOp of type PO_LABEL with offset=1 */ /*-------------------------------------------------------------------*/ -static pCodeOp *popGetHighLabel(unsigned int key) +static pCodeOp * +popGetHighLabel (unsigned int key) { - pCodeOp *pcop; - pcop = popGetLabel(key); - PCOLAB(pcop)->offset = 1; - return pcop; + pCodeOp *pcop; + pcop = popGetLabel (key); + PCOLAB (pcop)->offset = 1; + return pcop; } /*-----------------------------------------------------------------*/ /* popGetLit - asm operator to pcode operator conversion */ /*-----------------------------------------------------------------*/ -pCodeOp *popGetLit(unsigned int lit) +pCodeOp * +popGetLit (unsigned int lit) { - return newpCodeOpLit((unsigned char)lit); + return newpCodeOpLit ((unsigned char) lit); } /*-----------------------------------------------------------------*/ /* popGetImmd - asm operator to pcode immediate conversion */ /*-----------------------------------------------------------------*/ -static pCodeOp *popGetImmd(char *name, unsigned int offset, int index,int is_func) +static pCodeOp * +popGetImmd (char *name, unsigned int offset, int index, int is_func) { - return newpCodeOpImmd(name, offset,index, 0, is_func); + return newpCodeOpImmd (name, offset, index, 0, is_func); } /*-----------------------------------------------------------------*/ /* popGetWithString - asm operator to pcode operator conversion */ /*-----------------------------------------------------------------*/ -static pCodeOp *popGetWithString(char *str, int isExtern) +static pCodeOp * +popGetWithString (char *str, int isExtern) { - pCodeOp *pcop; + pCodeOp *pcop; - if(!str) { - fprintf(stderr,"NULL string %s %d\n",__FILE__,__LINE__); - exit (1); + if (!str) + { + fprintf (stderr, "NULL string %s %d\n", __FILE__, __LINE__); + exit (1); } - pcop = newpCodeOp(str,PO_STR); - PCOS(pcop)->isPublic = isExtern ? 1 : 0; + pcop = newpCodeOp (str, PO_STR); + PCOS (pcop)->isPublic = isExtern ? 1 : 0; - return pcop; + return pcop; } -pCodeOp *popGetExternal (char *str, int isReg) +pCodeOp * +popGetExternal (char *str, int isReg) { - pCodeOp *pcop; + pCodeOp *pcop; - if (isReg) { - pcop = newpCodeOpRegFromStr(str); - } else { - pcop = popGetWithString (str, 1); + if (isReg) + { + pcop = newpCodeOpRegFromStr (str); + } + else + { + pcop = popGetWithString (str, 1); } - if (str) { + if (str) + { symbol *sym; for (sym = setFirstItem (externs); sym; sym = setNextItem (externs)) - { - if (!strcmp (str, sym->rname)) break; - } + { + if (!strcmp (str, sym->rname)) + break; + } if (!sym) - { - sym = newSymbol(str, 0); - strncpy(sym->rname, str, SDCC_NAME_MAX); - addSet (&externs, sym); - } // if + { + sym = newSymbol (str, 0); + strncpy (sym->rname, str, SDCC_NAME_MAX); + addSet (&externs, sym); + } // if sym->used++; } - return pcop; + return pcop; } /*-----------------------------------------------------------------*/ /* popRegFromString - */ /*-----------------------------------------------------------------*/ -static pCodeOp *popRegFromString(char *str, int size, int offset) +static pCodeOp * +popRegFromString (char *str, int size, int offset) { - pCodeOp *pcop = Safe_calloc(1,sizeof(pCodeOpReg) ); - pcop->type = PO_DIR; + pCodeOp *pcop = Safe_calloc (1, sizeof (pCodeOpReg)); + pcop->type = PO_DIR; - DEBUGpic14_emitcode(";","%d",__LINE__); + DEBUGpic14_emitcode (";", "%d", __LINE__); - if(!str) - str = "BAD_STRING"; + if (!str) + str = "BAD_STRING"; - pcop->name = Safe_calloc(1,strlen(str)+1); - strcpy(pcop->name,str); + pcop->name = Safe_calloc (1, strlen (str) + 1); + strcpy (pcop->name, str); - //pcop->name = Safe_strdup( ( (str) ? str : "BAD STRING")); + //pcop->name = Safe_strdup( ( (str) ? str : "BAD STRING")); - PCOR(pcop)->r = dirregWithName(pcop->name); - if(PCOR(pcop)->r == NULL) { - //fprintf(stderr,"%d - couldn't find %s in allocated registers, size =%d\n",__LINE__,aop->aopu.aop_dir,aop->size); - PCOR(pcop)->r = allocRegByName (pcop->name,size); - DEBUGpic14_emitcode(";","%d %s offset=%d - had to alloc by reg name",__LINE__,pcop->name,offset); - } else { - DEBUGpic14_emitcode(";","%d %s offset=%d",__LINE__,pcop->name,offset); + PCOR (pcop)->r = dirregWithName (pcop->name); + if (PCOR (pcop)->r == NULL) + { + //fprintf(stderr,"%d - couldn't find %s in allocated registers, size =%d\n",__LINE__,aop->aopu.aop_dir,aop->size); + PCOR (pcop)->r = allocRegByName (pcop->name, size); + DEBUGpic14_emitcode (";", "%d %s offset=%d - had to alloc by reg name", __LINE__, pcop->name, offset); + } + else + { + DEBUGpic14_emitcode (";", "%d %s offset=%d", __LINE__, pcop->name, offset); } - PCOR(pcop)->instance = offset; + PCOR (pcop)->instance = offset; - return pcop; + return pcop; } /*-----------------------------------------------------------------*/ /*-----------------------------------------------------------------*/ -static pCodeOp *popRegFromIdx(int rIdx) +static pCodeOp * +popRegFromIdx (int rIdx) { - pCodeOp *pcop; + pCodeOp *pcop; - DEBUGpic14_emitcode ("; ***","%s,%d , rIdx=0x%x", - __FUNCTION__,__LINE__,rIdx); + DEBUGpic14_emitcode ("; ***", "%s,%d , rIdx=0x%x", __FUNCTION__, __LINE__, rIdx); - pcop = Safe_calloc(1,sizeof(pCodeOpReg) ); + pcop = Safe_calloc (1, sizeof (pCodeOpReg)); - PCOR(pcop)->rIdx = rIdx; - PCOR(pcop)->r = typeRegWithIdx(rIdx,REG_STK,1); - PCOR(pcop)->r->isFree = 0; - PCOR(pcop)->r->wasUsed = 1; + PCOR (pcop)->rIdx = rIdx; + PCOR (pcop)->r = typeRegWithIdx (rIdx, REG_STK, 1); + PCOR (pcop)->r->isFree = 0; + PCOR (pcop)->r->wasUsed = 1; - pcop->type = PCOR(pcop)->r->pc_type; + pcop->type = PCOR (pcop)->r->pc_type; - return pcop; + return pcop; } /*-----------------------------------------------------------------*/ /* popGet - asm operator to pcode operator conversion */ /*-----------------------------------------------------------------*/ -pCodeOp *popGet (asmop *aop, int offset) //, bool bit16, bool dname) +pCodeOp * +popGet (asmop * aop, int offset) //, bool bit16, bool dname) { - //char *s = buffer ; - //char *rs; + //char *s = buffer ; + //char *rs; - pCodeOp *pcop; + pCodeOp *pcop; - //DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* offset is greater than - size then zero */ + //DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + /* offset is greater than + size then zero */ - assert (aop); + assert (aop); - /* XXX: still needed for BIT operands (AOP_CRY) */ - if (offset > (aop->size - 1) && - aop->type != AOP_LIT && - aop->type != AOP_PCODE) + /* XXX: still needed for BIT operands (AOP_CRY) */ + if (offset > (aop->size - 1) && aop->type != AOP_LIT && aop->type != AOP_PCODE) { - printf( "%s: (offset[%d] > AOP_SIZE(op)[%d]-1) && AOP_TYPE(op) != AOP_LIT)\n", __FUNCTION__, offset, aop->size); - return NULL; //zero; + printf ("%s: (offset[%d] > AOP_SIZE(op)[%d]-1) && AOP_TYPE(op) != AOP_LIT)\n", __FUNCTION__, offset, aop->size); + return NULL; //zero; } - /* depending on type */ - switch (aop->type) { + /* depending on type */ + switch (aop->type) + { case AOP_IMMD: - DEBUGpic14_emitcode(";","%d",__LINE__); - return popGetImmd(aop->aopu.aop_immd,offset,0,0); + DEBUGpic14_emitcode (";", "%d", __LINE__); + return popGetImmd (aop->aopu.aop_immd, offset, 0, 0); case AOP_DIR: - return popRegFromString(aop->aopu.aop_dir, aop->size, offset); + return popRegFromString (aop->aopu.aop_dir, aop->size, offset); case AOP_REG: - { - int rIdx; - assert (offset < aop->size); - rIdx = aop->aopu.aop_reg[offset]->rIdx; - - pcop = Safe_calloc(1,sizeof(pCodeOpReg) ); - PCOR(pcop)->rIdx = rIdx; - PCOR(pcop)->r = pic14_regWithIdx(rIdx); - PCOR(pcop)->r->wasUsed=1; - PCOR(pcop)->r->isFree=0; - - PCOR(pcop)->instance = offset; - pcop->type = PCOR(pcop)->r->pc_type; - //rs = aop->aopu.aop_reg[offset]->name; - DEBUGpic14_emitcode(";","%d rIdx = r0x%X ",__LINE__,rIdx); - return pcop; - } + { + int rIdx; + assert (offset < aop->size); + rIdx = aop->aopu.aop_reg[offset]->rIdx; + + pcop = Safe_calloc (1, sizeof (pCodeOpReg)); + PCOR (pcop)->rIdx = rIdx; + PCOR (pcop)->r = pic14_regWithIdx (rIdx); + PCOR (pcop)->r->wasUsed = 1; + PCOR (pcop)->r->isFree = 0; + + PCOR (pcop)->instance = offset; + pcop->type = PCOR (pcop)->r->pc_type; + //rs = aop->aopu.aop_reg[offset]->name; + DEBUGpic14_emitcode (";", "%d rIdx = r0x%X ", __LINE__, rIdx); + return pcop; + } case AOP_CRY: - pcop = newpCodeOpBit(aop->aopu.aop_dir,-1,1); - PCOR(pcop)->r = dirregWithName(aop->aopu.aop_dir); - //if(PCOR(pcop)->r == NULL) - //fprintf(stderr,"%d - couldn't find %s in allocated registers\n",__LINE__,aop->aopu.aop_dir); - return pcop; + pcop = newpCodeOpBit (aop->aopu.aop_dir, -1, 1); + PCOR (pcop)->r = dirregWithName (aop->aopu.aop_dir); + //if(PCOR(pcop)->r == NULL) + //fprintf(stderr,"%d - couldn't find %s in allocated registers\n",__LINE__,aop->aopu.aop_dir); + return pcop; case AOP_LIT: - return newpCodeOpLit(pic14aopLiteral (aop->aopu.aop_lit,offset)); + return newpCodeOpLit (pic14aopLiteral (aop->aopu.aop_lit, offset)); case AOP_STR: - DEBUGpic14_emitcode(";","%d %s",__LINE__,aop->aopu.aop_str[offset]); - return newpCodeOpRegFromStr(aop->aopu.aop_str[offset]); + DEBUGpic14_emitcode (";", "%d %s", __LINE__, aop->aopu.aop_str[offset]); + return newpCodeOpRegFromStr (aop->aopu.aop_str[offset]); case AOP_PCODE: - pcop = NULL; - DEBUGpic14_emitcode(";","popGet AOP_PCODE (%s + %i) %d %s",pCodeOpType(aop->aopu.pcop), offset, - __LINE__, - ((aop->aopu.pcop->name)? (aop->aopu.pcop->name) : "no name")); - //emitpComment ("popGet; name %s, offset: %i, pcop-type: %s\n", aop->aopu.pcop->name, offset, pCodeOpType (aop->aopu.pcop)); - switch (aop->aopu.pcop->type) + pcop = NULL; + DEBUGpic14_emitcode (";", "popGet AOP_PCODE (%s + %i) %d %s", pCodeOpType (aop->aopu.pcop), offset, + __LINE__, ((aop->aopu.pcop->name) ? (aop->aopu.pcop->name) : "no name")); + //emitpComment ("popGet; name %s, offset: %i, pcop-type: %s\n", aop->aopu.pcop->name, offset, pCodeOpType (aop->aopu.pcop)); + switch (aop->aopu.pcop->type) { case PO_IMMEDIATE: pcop = pCodeOpCopy (aop->aopu.pcop); /* usually we want to access the memory at " + offset" (using ->index), * but sometimes we want to access the high byte of the symbol's address (using ->offset) */ - PCOI(pcop)->index += offset; + PCOI (pcop)->index += offset; //PCOI(pcop)->offset = 0; break; case PO_DIR: pcop = pCodeOpCopy (aop->aopu.pcop); - PCOR(pcop)->instance = offset; + PCOR (pcop)->instance = offset; break; default: - assert ( !"unhandled pCode type" ); + assert (!"unhandled pCode type"); break; - } // switch - return pcop; + } // switch + return pcop; } - werror(E_INTERNAL_ERROR,__FILE__,__LINE__, - "popGet got unsupported aop->type"); - exit(0); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "popGet got unsupported aop->type"); + exit (0); } /*-----------------------------------------------------------------*/ /* popGetAddr - access the low/high word of a symbol (immediate) */ /* (for non-PO_IMMEDIATEs this is the same as popGet) */ /*-----------------------------------------------------------------*/ -pCodeOp *popGetAddr (asmop *aop, int offset, int index) +pCodeOp * +popGetAddr (asmop * aop, int offset, int index) { if (aop->type == AOP_PCODE && aop->aopu.pcop->type == PO_IMMEDIATE) - { - pCodeOp *pcop = aop->aopu.pcop; - assert (offset <= GPTRSIZE); - - /* special case: index >= 2 should return GPOINTER-style values */ - if (offset == 2) { - pcop = popGetLit (aop->code ? GPTRTAG_CODE : GPTRTAG_DATA); + pCodeOp *pcop = aop->aopu.pcop; + assert (offset <= GPTRSIZE); + + /* special case: index >= 2 should return GPOINTER-style values */ + if (offset == 2) + { + pcop = popGetLit (aop->code ? GPTRTAG_CODE : GPTRTAG_DATA); + return pcop; + } + + pcop = pCodeOpCopy (pcop); + /* usually we want to access the memory at " + offset" (using ->index), + * but sometimes we want to access the high byte of the symbol's address (using ->offset) */ + PCOI (pcop)->offset += offset; + PCOI (pcop)->index += index; + //fprintf (stderr, "is PO_IMMEDIATE: %s+o%d+i%d (new o%d,i%d)\n", pcop->name,PCOI(pcop)->offset,PCOI(pcop)->index, offset, index); return pcop; } - - pcop = pCodeOpCopy (pcop); - /* usually we want to access the memory at " + offset" (using ->index), - * but sometimes we want to access the high byte of the symbol's address (using ->offset) */ - PCOI(pcop)->offset += offset; - PCOI(pcop)->index += index; - //fprintf (stderr, "is PO_IMMEDIATE: %s+o%d+i%d (new o%d,i%d)\n", pcop->name,PCOI(pcop)->offset,PCOI(pcop)->index, offset, index); - return pcop; - } else { - return popGet (aop, offset + index); - } + else + { + return popGet (aop, offset + index); + } } /*-----------------------------------------------------------------*/ /* aopPut - puts a string for a aop */ /*-----------------------------------------------------------------*/ -void aopPut (asmop *aop, char *s, int offset) +void +aopPut (asmop * aop, char *s, int offset) { - char *d = buffer ; - symbol *lbl ; + char *d = buffer; + symbol *lbl; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - if (aop->size && offset > ( aop->size - 1)) { - werror(E_INTERNAL_ERROR,__FILE__,__LINE__, - "aopPut got offset > aop->size"); - exit(0); + if (aop->size && offset > (aop->size - 1)) + { + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "aopPut got offset > aop->size"); + exit (0); } - /* will assign value to value */ - /* depending on where it is ofcourse */ - switch (aop->type) { + /* will assign value to value */ + /* depending on where it is ofcourse */ + switch (aop->type) + { case AOP_DIR: - if (offset) { - sprintf(d,"(%s + %d)", - aop->aopu.aop_dir,offset); - fprintf(stderr,"oops aopPut:AOP_DIR did this %s\n",s); - - } else - sprintf(d,"%s",aop->aopu.aop_dir); - - if (strcmp(d,s)) { - DEBUGpic14_emitcode(";","%d",__LINE__); - if(strcmp(s,"W")) - pic14_emitcode("movf","%s,w",s); - pic14_emitcode("movwf","%s",d); - - if(strcmp(s,"W")) { - pic14_emitcode(";BUG!? should have this:movf","%s,w %d",s,__LINE__); - if(offset >= aop->size) { - emitpcode(POC_CLRF,popGet(aop,offset)); - break; - } else { - emitpcode(POC_MOVFW, popGetImmd(s,0,offset,0)); + if (offset) + { + sprintf (d, "(%s + %d)", aop->aopu.aop_dir, offset); + fprintf (stderr, "oops aopPut:AOP_DIR did this %s\n", s); + + } + else + sprintf (d, "%s", aop->aopu.aop_dir); + + if (strcmp (d, s)) + { + DEBUGpic14_emitcode (";", "%d", __LINE__); + if (strcmp (s, "W")) + pic14_emitcode ("movf", "%s,w", s); + pic14_emitcode ("movwf", "%s", d); + + if (strcmp (s, "W")) + { + pic14_emitcode (";BUG!? should have this:movf", "%s,w %d", s, __LINE__); + if (offset >= aop->size) + { + emitpcode (POC_CLRF, popGet (aop, offset)); + break; + } + else + { + emitpcode (POC_MOVFW, popGetImmd (s, 0, offset, 0)); } } - emitpcode(POC_MOVWF,popGet(aop,offset)); + emitpcode (POC_MOVWF, popGet (aop, offset)); } - break; + break; case AOP_REG: - if (strcmp(aop->aopu.aop_reg[offset]->name,s) != 0) { - if(strcmp(s,"W")==0 ) - pic14_emitcode("movf","%s,w ; %d",s,__LINE__); - - pic14_emitcode("movwf","%s", - aop->aopu.aop_reg[offset]->name); - - if(strcmp(s,zero)==0) { - emitpcode(POC_CLRF,popGet(aop,offset)); - - } else if(strcmp(s,"W")==0) { - pCodeOp *pcop = Safe_calloc(1,sizeof(pCodeOpReg) ); - pcop->type = PO_GPR_REGISTER; - - PCOR(pcop)->rIdx = -1; - PCOR(pcop)->r = NULL; - - DEBUGpic14_emitcode(";","%d",__LINE__); - pcop->name = Safe_strdup(s); - emitpcode(POC_MOVFW,pcop); - emitpcode(POC_MOVWF,popGet(aop,offset)); - } else if(strcmp(s,one)==0) { - emitpcode(POC_CLRF,popGet(aop,offset)); - emitpcode(POC_INCF,popGet(aop,offset)); - } else { - emitpcode(POC_MOVWF,popGet(aop,offset)); + if (strcmp (aop->aopu.aop_reg[offset]->name, s) != 0) + { + if (strcmp (s, "W") == 0) + pic14_emitcode ("movf", "%s,w ; %d", s, __LINE__); + + pic14_emitcode ("movwf", "%s", aop->aopu.aop_reg[offset]->name); + + if (strcmp (s, zero) == 0) + { + emitpcode (POC_CLRF, popGet (aop, offset)); + + } + else if (strcmp (s, "W") == 0) + { + pCodeOp *pcop = Safe_calloc (1, sizeof (pCodeOpReg)); + pcop->type = PO_GPR_REGISTER; + + PCOR (pcop)->rIdx = -1; + PCOR (pcop)->r = NULL; + + DEBUGpic14_emitcode (";", "%d", __LINE__); + pcop->name = Safe_strdup (s); + emitpcode (POC_MOVFW, pcop); + emitpcode (POC_MOVWF, popGet (aop, offset)); + } + else if (strcmp (s, one) == 0) + { + emitpcode (POC_CLRF, popGet (aop, offset)); + emitpcode (POC_INCF, popGet (aop, offset)); + } + else + { + emitpcode (POC_MOVWF, popGet (aop, offset)); } } - break; + break; case AOP_STK: - if (strcmp(s,"a") == 0) - pic14_emitcode("push","acc"); - else - pic14_emitcode("push","%s",s); + if (strcmp (s, "a") == 0) + pic14_emitcode ("push", "acc"); + else + pic14_emitcode ("push", "%s", s); - break; + break; case AOP_CRY: - /* if bit variable */ - if (!aop->aopu.aop_dir) { - pic14_emitcode("clr","a"); - pic14_emitcode("rlc","a"); - } else { - if (s == zero) - pic14_emitcode("clr","%s",aop->aopu.aop_dir); - else - if (s == one) - pic14_emitcode("setb","%s",aop->aopu.aop_dir); - else - if (!strcmp(s,"c")) - pic14_emitcode("mov","%s,c",aop->aopu.aop_dir); - else { - lbl = newiTempLabel(NULL); + /* if bit variable */ + if (!aop->aopu.aop_dir) + { + pic14_emitcode ("clr", "a"); + pic14_emitcode ("rlc", "a"); + } + else + { + if (s == zero) + pic14_emitcode ("clr", "%s", aop->aopu.aop_dir); + else if (s == one) + pic14_emitcode ("setb", "%s", aop->aopu.aop_dir); + else if (!strcmp (s, "c")) + pic14_emitcode ("mov", "%s,c", aop->aopu.aop_dir); + else + { + lbl = newiTempLabel (NULL); - if (strcmp(s,"a")) { - MOVA(s); - } - pic14_emitcode("clr","c"); - pic14_emitcode("jz","%05d_DS_",lbl->key+100); - pic14_emitcode("cpl","c"); - pic14_emitcode("","%05d_DS_:",lbl->key+100); - pic14_emitcode("mov","%s,c",aop->aopu.aop_dir); - } + if (strcmp (s, "a")) + { + MOVA (s); + } + pic14_emitcode ("clr", "c"); + pic14_emitcode ("jz", "%05d_DS_", labelKey2num (lbl->key)); + pic14_emitcode ("cpl", "c"); + pic14_emitcode ("", "%05d_DS_:", labelKey2num (lbl->key)); + pic14_emitcode ("mov", "%s,c", aop->aopu.aop_dir); + } } - break; + break; case AOP_STR: - aop->coff = offset; - if (strcmp(aop->aopu.aop_str[offset],s)) - pic14_emitcode ("mov","%s,%s ; %d",aop->aopu.aop_str[offset],s,__LINE__); - break; + aop->coff = offset; + if (strcmp (aop->aopu.aop_str[offset], s)) + pic14_emitcode ("mov", "%s,%s ; %d", aop->aopu.aop_str[offset], s, __LINE__); + break; - default : - werror(E_INTERNAL_ERROR,__FILE__,__LINE__, - "aopPut got unsupported aop->type"); - exit(0); + default: + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "aopPut got unsupported aop->type"); + exit (0); } } @@ -1319,28 +1335,34 @@ /*-----------------------------------------------------------------*/ /* mov2w_op - generate either a MOVLW or MOVFW based operand type */ /*-----------------------------------------------------------------*/ -static void mov2w_op (operand *op, int offset) +static void +mov2w_op (operand * op, int offset) { - assert (op); - FENTRY; + assert (op); + FENTRY; - /* for PO_IMMEDIATEs: use address or value? */ - if (op_isLitLike (op)) + /* for PO_IMMEDIATEs: use address or value? */ + if (op_isLitLike (op)) { - /* access address of op */ - if (AOP_TYPE(op) != AOP_LIT) { assert (offset < 3); } - if (IS_SYMOP(op) && IS_GENPTR(OP_SYM_TYPE(op)) && AOP_SIZE(op) < offset) + /* access address of op */ + if (AOP_TYPE (op) != AOP_LIT) { - if (offset == GPTRSIZE-1) - emitpcode (POC_MOVLW, popGetLit (GPTRTAG_DATA)); - else - emitpcode (POC_MOVLW, popGetLit (0)); + assert (offset < 3); } - else - emitpcode (POC_MOVLW, popGetAddr(AOP(op), offset, 0)); - } else { - /* access value stored in op */ - mov2w (AOP(op), offset); + if (IS_SYMOP (op) && IS_GENPTR (OP_SYM_TYPE (op)) && AOP_SIZE (op) < offset) + { + if (offset == GPTRSIZE - 1) + emitpcode (POC_MOVLW, popGetLit (GPTRTAG_DATA)); + else + emitpcode (POC_MOVLW, popGetLit (0)); + } + else + emitpcode (POC_MOVLW, popGetAddr (AOP (op), offset, 0)); + } + else + { + /* access value stored in op */ + mov2w (AOP (op), offset); } } @@ -1348,104 +1370,115 @@ /*-----------------------------------------------------------------*/ /* mov2w - generate either a MOVLW or MOVFW based operand type */ /*-----------------------------------------------------------------*/ -void mov2w (asmop *aop, int offset) +void +mov2w (asmop * aop, int offset) { - if(!aop) - return; + if (!aop) + return; - DEBUGpic14_emitcode ("; ***","%s %d offset=%d",__FUNCTION__,__LINE__,offset); + DEBUGpic14_emitcode ("; ***", "%s %d offset=%d", __FUNCTION__, __LINE__, offset); - if ( aop_isLitLike (aop) ) - emitpcode(POC_MOVLW,popGetAddr(aop,offset,0)); - else - emitpcode(POC_MOVFW,popGet(aop,offset)); + if (aop_isLitLike (aop)) + emitpcode (POC_MOVLW, popGetAddr (aop, offset, 0)); + else + emitpcode (POC_MOVFW, popGet (aop, offset)); } -static void movwf (asmop *op, int offset) +static void +movwf (asmop * op, int offset) { - emitpcode (POC_MOVWF, popGet(op, offset)); + emitpcode (POC_MOVWF, popGet (op, offset)); } -static pCodeOp *get_argument_pcop (int idx) +static pCodeOp * +get_argument_pcop (int idx) { - assert (idx > 0 && "the 0th (first) argument is passed via WREG"); - return popRegFromIdx (Gstack_base_addr - (idx - 1)); + assert (idx > 0 && "the 0th (first) argument is passed via WREG"); + return popRegFromIdx (Gstack_base_addr - (idx - 1)); } -static pCodeOp *get_return_val_pcop (int offset) +static pCodeOp * +get_return_val_pcop (int offset) { - assert (offset > 0 && "the most significant byte is returned via WREG"); - return popRegFromIdx (Gstack_base_addr - (offset - 1)); + assert (offset > 0 && "the most significant byte is returned via WREG"); + return popRegFromIdx (Gstack_base_addr - (offset - 1)); } -static void pass_argument (operand *op, int offset, int idx) +static void +pass_argument (operand * op, int offset, int idx) { - if (op) - mov2w_op (op, offset); - if (idx != 0) - emitpcode(POC_MOVWF, get_argument_pcop (idx)); + if (op) + mov2w_op (op, offset); + if (idx != 0) + emitpcode (POC_MOVWF, get_argument_pcop (idx)); } -static void get_returnvalue (operand *op, int offset, int idx) +static void +get_returnvalue (operand * op, int offset, int idx) { - if (idx != 0) - emitpcode(POC_MOVFW, get_return_val_pcop (idx)); - movwf(AOP(op), offset); + if (idx != 0) + emitpcode (POC_MOVFW, get_return_val_pcop (idx)); + movwf (AOP (op), offset); } -static void call_libraryfunc (char *name) +static void +call_libraryfunc (char *name) { - symbol *sym; + symbol *sym; - /* library code might reside in different page... */ - emitpcode (POC_PAGESEL, popGetWithString (name, 1)); - /* call the library function */ - emitpcode (POC_CALL, popGetExternal (name, 0)); - /* might return from different page... */ - emitpcode (POC_PAGESEL, popGetWithString ("$", 0)); - - /* create symbol, mark it as `extern' */ - sym = findSym(SymbolTab, NULL, name); - if (!sym) { - sym = newSymbol(name, 0); - strncpy(sym->rname, name, SDCC_NAME_MAX); - addSym(SymbolTab, sym, sym->rname, 0, 0, 0); - addSet(&externs, sym); - } // if - sym->used++; + /* library code might reside in different page... */ + emitpcode (POC_PAGESEL, popGetWithString (name, 1)); + /* call the library function */ + emitpcode (POC_CALL, popGetExternal (name, 0)); + /* might return from different page... */ + emitpcode (POC_PAGESEL, popGetWithString ("$", 0)); + + /* create symbol, mark it as `extern' */ + sym = findSym (SymbolTab, NULL, name); + if (!sym) + { + sym = newSymbol (name, 0); + strncpy (sym->rname, name, SDCC_NAME_MAX); + addSym (SymbolTab, sym, sym->rname, 0, 0, 0); + addSet (&externs, sym); + } // if + sym->used++; } /*-----------------------------------------------------------------*/ /* pic14_getDataSize - get the operand data size */ /*-----------------------------------------------------------------*/ -int pic14_getDataSize(operand *op) +int +pic14_getDataSize (operand * op) { - int size; + int size; - size = AOP_SIZE(op); - return size; + size = AOP_SIZE (op); + return size; } /*-----------------------------------------------------------------*/ /* pic14_outAcc - output Acc */ /*-----------------------------------------------------------------*/ -void pic14_outAcc(operand *result) +void +pic14_outAcc (operand * result) { - int size,offset; - DEBUGpic14_emitcode ("; ***","%s %d - ",__FUNCTION__,__LINE__); - DEBUGpic14_AopType(__LINE__,NULL,NULL,result); + int size, offset; + DEBUGpic14_emitcode ("; ***", "%s %d - ", __FUNCTION__, __LINE__); + DEBUGpic14_AopType (__LINE__, NULL, NULL, result); - size = pic14_getDataSize(result); - if(size){ - emitpcode(POC_MOVWF,popGet(AOP(result),0)); - size--; - offset = 1; - /* unsigned or positive */ - while(size--) - emitpcode(POC_CLRF,popGet(AOP(result),offset++)); + size = pic14_getDataSize (result); + if (size) + { + emitpcode (POC_MOVWF, popGet (AOP (result), 0)); + size--; + offset = 1; + /* unsigned or positive */ + while (size--) + emitpcode (POC_CLRF, popGet (AOP (result), offset++)); } } @@ -1453,358 +1486,387 @@ /*-----------------------------------------------------------------*/ /* pic14_outBitC - output a bit C */ /*-----------------------------------------------------------------*/ -static void pic14_outBitC(operand *result) +static void +pic14_outBitC (operand * result) { - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* if the result is bit */ - if (AOP_TYPE(result) == AOP_CRY) - aopPut(AOP(result),"c",0); - else { - pic14_emitcode("clr","a ; %d", __LINE__); - pic14_emitcode("rlc","a"); - pic14_outAcc(result); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* if the result is bit */ + if (AOP_TYPE (result) == AOP_CRY) + aopPut (AOP (result), "c", 0); + else + { + pic14_emitcode ("clr", "a ; %d", __LINE__); + pic14_emitcode ("rlc", "a"); + pic14_outAcc (result); } } /*-----------------------------------------------------------------*/ /* pic14_toBoolean - emit code for orl a,operator(sizeop) */ /*-----------------------------------------------------------------*/ -static void pic14_toBoolean(operand *oper) +static void +pic14_toBoolean (operand * oper) { - int size = AOP_SIZE(oper); - int offset = 0; + int size = AOP_SIZE (oper); + int offset = 0; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - assert (size > 0); + assert (size > 0); - if (size == 1) { - /* MOVFW does not load the flags... */ - emitpcode(POC_MOVLW, popGetLit(0)); - offset = 0; - } else { - emitpcode(POC_MOVFW,popGet(AOP(oper),0)); - offset = 1; + if (size == 1) + { + /* MOVFW does not load the flags... */ + emitpcode (POC_MOVLW, popGetLit (0)); + offset = 0; + } + else + { + emitpcode (POC_MOVFW, popGet (AOP (oper), 0)); + offset = 1; } - while (offset < size) { - emitpcode(POC_IORFW, popGet(AOP(oper),offset++)); + while (offset < size) + { + emitpcode (POC_IORFW, popGet (AOP (oper), offset++)); } - /* Z is set iff (oper == 0) */ + /* Z is set iff (oper == 0) */ } /*-----------------------------------------------------------------*/ /* genNot - generate code for ! operation */ /*-----------------------------------------------------------------*/ -static void genNot (iCode *ic) +static void +genNot (iCode * ic) { - //symbol *tlbl; - int size; + //symbol *tlbl; + int size; - FENTRY; + FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* assign asmOps to operand & result */ - aopOp (IC_LEFT(ic),ic,FALSE); - aopOp (IC_RESULT(ic),ic,TRUE); - - DEBUGpic14_AopType(__LINE__,IC_LEFT(ic),NULL,IC_RESULT(ic)); - /* if in bit space then a special case */ - if (AOP_TYPE(IC_LEFT(ic)) == AOP_CRY) { - if (AOP_TYPE(IC_RESULT(ic)) == AOP_CRY) { - emitpcode(POC_MOVLW,popGet(AOP(IC_LEFT(ic)),0)); - emitpcode(POC_XORWF,popGet(AOP(IC_RESULT(ic)),0)); - } else { - emitpcode(POC_CLRF,popGet(AOP(IC_RESULT(ic)),0)); - emitpcode(POC_BTFSS,popGet(AOP(IC_LEFT(ic)),0)); - emitpcode(POC_INCF,popGet(AOP(IC_RESULT(ic)),0)); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* assign asmOps to operand & result */ + aopOp (IC_LEFT (ic), ic, FALSE); + aopOp (IC_RESULT (ic), ic, TRUE); + + DEBUGpic14_AopType (__LINE__, IC_LEFT (ic), NULL, IC_RESULT (ic)); + /* if in bit space then a special case */ + if (AOP_TYPE (IC_LEFT (ic)) == AOP_CRY) + { + if (AOP_TYPE (IC_RESULT (ic)) == AOP_CRY) + { + emitpcode (POC_MOVLW, popGet (AOP (IC_LEFT (ic)), 0)); + emitpcode (POC_XORWF, popGet (AOP (IC_RESULT (ic)), 0)); } - goto release; + else + { + emitpcode (POC_CLRF, popGet (AOP (IC_RESULT (ic)), 0)); + emitpcode (POC_BTFSS, popGet (AOP (IC_LEFT (ic)), 0)); + emitpcode (POC_INCF, popGet (AOP (IC_RESULT (ic)), 0)); + } + goto release; } - size = AOP_SIZE(IC_LEFT(ic)); - mov2w (AOP(IC_LEFT(ic)),0); - while (--size > 0) + size = AOP_SIZE (IC_LEFT (ic)); + mov2w (AOP (IC_LEFT (ic)), 0); + while (--size > 0) { - if (op_isLitLike (IC_LEFT(ic))) - emitpcode (POC_IORLW, popGetAddr (AOP(IC_LEFT(ic)), size, 0)); + if (op_isLitLike (IC_LEFT (ic))) + emitpcode (POC_IORLW, popGetAddr (AOP (IC_LEFT (ic)), size, 0)); else - emitpcode (POC_IORFW, popGet (AOP(IC_LEFT(ic)), size)); + emitpcode (POC_IORFW, popGet (AOP (IC_LEFT (ic)), size)); } - emitpcode(POC_MOVLW, popGetLit (0)); - emitSKPNZ; - emitpcode(POC_MOVLW, popGetLit (1)); - movwf(AOP(IC_RESULT(ic)), 0); + emitpcode (POC_MOVLW, popGetLit (0)); + emitSKPNZ; + emitpcode (POC_MOVLW, popGetLit (1)); + movwf (AOP (IC_RESULT (ic)), 0); - for (size = 1; size < AOP_SIZE(IC_RESULT(ic)); size++) + for (size = 1; size < AOP_SIZE (IC_RESULT (ic)); size++) { - emitpcode(POC_CLRF, popGet (AOP(IC_RESULT(ic)), size)); + emitpcode (POC_CLRF, popGet (AOP (IC_RESULT (ic)), size)); } - goto release; + goto release; release: - /* release the aops */ - freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? 0 : 1)); - freeAsmop(IC_RESULT(ic),NULL,ic,TRUE); + /* release the aops */ + freeAsmop (IC_LEFT (ic), NULL, ic, (RESULTONSTACK (ic) ? 0 : 1)); + freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genCpl - generate code for complement */ /*-----------------------------------------------------------------*/ -static void genCpl (iCode *ic) +static void +genCpl (iCode * ic) { - operand *left, *result; - int size, offset=0; + operand *left, *result; + int size, offset = 0; - FENTRY; + FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - aopOp((left = IC_LEFT(ic)),ic,FALSE); - aopOp((result=IC_RESULT(ic)),ic,TRUE); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + aopOp ((left = IC_LEFT (ic)), ic, FALSE); + aopOp ((result = IC_RESULT (ic)), ic, TRUE); - /* if both are in bit space then - a special case */ - if (AOP_TYPE(result) == AOP_CRY && - AOP_TYPE(left) == AOP_CRY ) { + /* if both are in bit space then + a special case */ + if (AOP_TYPE (result) == AOP_CRY && AOP_TYPE (left) == AOP_CRY) + { - pic14_emitcode("mov","c,%s",left->aop->aopu.aop_dir); - pic14_emitcode("cpl","c"); - pic14_emitcode("mov","%s,c",result->aop->aopu.aop_dir); - goto release; + pic14_emitcode ("mov", "c,%s", left->aop->aopu.aop_dir); + pic14_emitcode ("cpl", "c"); + pic14_emitcode ("mov", "%s,c", result->aop->aopu.aop_dir); + goto release; } - size = AOP_SIZE(result); - if (AOP_SIZE(left) < size) size = AOP_SIZE(left); - while (size--) { - emitpcode(POC_COMFW,popGet(AOP(left),offset)); - emitpcode(POC_MOVWF,popGet(AOP(result),offset)); - offset++; + size = AOP_SIZE (result); + if (AOP_SIZE (left) < size) + size = AOP_SIZE (left); + while (size--) + { + emitpcode (POC_COMFW, popGet (AOP (left), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); + offset++; } - addSign (result, AOP_SIZE(left), !SPEC_USIGN(operandType(result))); + addSign (result, AOP_SIZE (left), !SPEC_USIGN (operandType (result))); release: - /* release the aops */ - freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? 0 : 1)); - freeAsmop(result,NULL,ic,TRUE); + /* release the aops */ + freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? 0 : 1)); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genUminusFloat - unary minus for floating points */ /*-----------------------------------------------------------------*/ static void -genUminusFloat(operand *op, operand *result) +genUminusFloat (operand * op, operand * result) { int size; FENTRY; - DEBUGpic14_emitcode("; ***", "%s %d", __FUNCTION__, __LINE__); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); /* for this we just need to flip the first it then copy the rest in place */ - size = AOP_SIZE(op) - 1; + size = AOP_SIZE (op) - 1; - mov2w_op(op, size); - emitpcode(POC_XORLW, popGetLit(0x80)); - movwf(AOP(result), size); + mov2w_op (op, size); + emitpcode (POC_XORLW, popGetLit (0x80)); + movwf (AOP (result), size); while (size--) { - mov2w_op(op, size); - movwf(AOP(result), size); - } // while + mov2w_op (op, size); + movwf (AOP (result), size); + } // while } /*-----------------------------------------------------------------*/ /* genUminus - unary minus code generation */ /*-----------------------------------------------------------------*/ -static void genUminus (iCode *ic) +static void +genUminus (iCode * ic) { - int size, i; - sym_link *optype, *rtype; + int size, i; + sym_link *optype; + + FENTRY; - FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* assign asmops */ + aopOp (IC_LEFT (ic), ic, FALSE); + aopOp (IC_RESULT (ic), ic, TRUE); + + /* if both in bit space then special + case */ + if (AOP_TYPE (IC_RESULT (ic)) == AOP_CRY && AOP_TYPE (IC_LEFT (ic)) == AOP_CRY) + { - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* assign asmops */ - aopOp(IC_LEFT(ic),ic,FALSE); - aopOp(IC_RESULT(ic),ic,TRUE); - - /* if both in bit space then special - case */ - if (AOP_TYPE(IC_RESULT(ic)) == AOP_CRY && - AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) { - - emitpcode(POC_BCF, popGet(AOP(IC_RESULT(ic)),0)); - emitpcode(POC_BTFSS, popGet(AOP(IC_LEFT(ic)),0)); - emitpcode(POC_BSF, popGet(AOP(IC_RESULT(ic)),0)); + emitpcode (POC_BCF, popGet (AOP (IC_RESULT (ic)), 0)); + emitpcode (POC_BTFSS, popGet (AOP (IC_LEFT (ic)), 0)); + emitpcode (POC_BSF, popGet (AOP (IC_RESULT (ic)), 0)); - goto release; + goto release; } - optype = operandType(IC_LEFT(ic)); - rtype = operandType(IC_RESULT(ic)); + optype = operandType (IC_LEFT (ic)); - /* if float then do float stuff */ - if (IS_FLOAT(optype)) { - genUminusFloat(IC_LEFT(ic),IC_RESULT(ic)); - goto release; + /* if float then do float stuff */ + if (IS_FLOAT (optype)) + { + genUminusFloat (IC_LEFT (ic), IC_RESULT (ic)); + goto release; } - /* otherwise subtract from zero by taking the 2's complement */ - size = AOP_SIZE(IC_LEFT(ic)); + /* otherwise subtract from zero by taking the 2's complement */ + size = AOP_SIZE (IC_LEFT (ic)); - for(i=0; iname); + aop = newAsmop (0); + r = getFreePtr (ic, &aop, FALSE); + pic14_emitcode ("mov", "%s,_spx", r->name); } - for (i = 0 ; i < pic14_nRegs ;i++) { - if (options.useXstack) { - pic14_emitcode("inc","%s",r->name); - //pic14_emitcode("mov","a,(%s+%d)", - // regspic14[i].base,8*bank+regspic14[i].offset); - pic14_emitcode("movx","@%s,a",r->name); - } else - pic14_emitcode("push","");// "(%s+%d)", - //regspic14[i].base,8*bank+regspic14[i].offset); + for (i = 0; i < pic14_nRegs; i++) + { + if (options.useXstack) + { + pic14_emitcode ("inc", "%s", r->name); + //pic14_emitcode("mov","a,(%s+%d)", + // regspic14[i].base,8*bank+regspic14[i].offset); + pic14_emitcode ("movx", "@%s,a", r->name); + } + else + pic14_emitcode ("push", ""); // "(%s+%d)", + //regspic14[i].base,8*bank+regspic14[i].offset); } - if (pushPsw) { - if (options.useXstack) { - pic14_emitcode("mov","a,psw"); - pic14_emitcode("movx","@%s,a",r->name); - pic14_emitcode("inc","%s",r->name); - pic14_emitcode("mov","_spx,%s",r->name); - freeAsmop (NULL,aop,ic,TRUE); + if (pushPsw) + { + if (options.useXstack) + { + pic14_emitcode ("mov", "a,psw"); + pic14_emitcode ("movx", "@%s,a", r->name); + pic14_emitcode ("inc", "%s", r->name); + pic14_emitcode ("mov", "_spx,%s", r->name); + freeAsmop (NULL, aop, ic, TRUE); - } else - pic14_emitcode("push","psw"); + } + else + pic14_emitcode ("push", "psw"); - pic14_emitcode("mov","psw,#0x%02x",(bank << 3)&0x00ff); + pic14_emitcode ("mov", "psw,#0x%02x", (bank << 3) & 0x00ff); } - ic->bankSaved = 1; + ic->bankSaved = 1; #endif } /*-----------------------------------------------------------------*/ /* saveRegisters - will look for a call and save the registers */ /*-----------------------------------------------------------------*/ -static void saveRegisters(iCode *lic) +static void +saveRegisters (iCode * lic) { - iCode *ic; - bitVect *rsave; - sym_link *dtype; - - FENTRY; - - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* look for call */ - for (ic = lic ; ic ; ic = ic->next) - if (ic->op == CALL || ic->op == PCALL) - break; + iCode *ic; + sym_link *dtype; - if (!ic) { - fprintf(stderr,"found parameter push with no function call\n"); - return ; - } + FENTRY; - /* if the registers have been saved already then - do nothing */ - if (ic->regsSaved || IFFUNC_CALLEESAVES(OP_SYMBOL(IC_LEFT(ic))->type)) - return ; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + + /* look for call */ + for (ic = lic; ic; ic = ic->next) + if (ic->op == CALL || ic->op == PCALL) + break; - /* find the registers in use at this time - and push them away to safety */ - rsave = bitVectCplAnd(bitVectCopy(ic->rMask), - ic->rUsed); + if (!ic) + { + fprintf (stderr, "found parameter push with no function call\n"); + return; + } - ic->regsSaved = 1; + /* if the registers have been saved already then do nothing */ + if (ic->regsSaved || IFFUNC_CALLEESAVES (OP_SYMBOL (IC_LEFT (ic))->type)) + return; - //fprintf(stderr, "ERROR: saveRegisters did not do anything to save registers, please report this as a bug.\n"); + /* find the registers in use at this time + and push them away to safety */ + bitVectCplAnd (bitVectCopy (ic->rMask), ic->rUsed); - dtype = operandType(IC_LEFT(ic)); - if (currFunc && dtype && - (FUNC_REGBANK(currFunc->type) != FUNC_REGBANK(dtype)) && - IFFUNC_ISISR(currFunc->type) && - !ic->bankSaved) + ic->regsSaved = 1; - saverbank(FUNC_REGBANK(dtype),ic,TRUE); + //fprintf(stderr, "ERROR: saveRegisters did not do anything to save registers, please report this as a bug.\n"); + dtype = operandType (IC_LEFT (ic)); + if (currFunc && dtype && + (FUNC_REGBANK (currFunc->type) != FUNC_REGBANK (dtype)) && IFFUNC_ISISR (currFunc->type) && !ic->bankSaved) + { + saverbank (FUNC_REGBANK (dtype), ic, TRUE); + } } + /*-----------------------------------------------------------------*/ /* unsaveRegisters - pop the pushed registers */ /*-----------------------------------------------------------------*/ -static void unsaveRegisters (iCode *ic) +static void +unsaveRegisters (iCode * ic) { - int i; - bitVect *rsave; + int i; + bitVect *rsave; - FENTRY; + FENTRY; + + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* find the registers in use at this time + and push them away to safety */ + rsave = bitVectCplAnd (bitVectCopy (ic->rMask), ic->rUsed); - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* find the registers in use at this time - and push them away to safety */ - rsave = bitVectCplAnd(bitVectCopy(ic->rMask), - ic->rUsed); - - if (options.useXstack) { - pic14_emitcode("mov","r0,%s",spname); - for (i = pic14_nRegs ; i >= 0 ; i--) { - if (bitVectBitValue(rsave,i)) { - pic14_emitcode("dec","r0"); - pic14_emitcode("movx","a,@r0"); - pic14_emitcode("mov","%s,a",pic14_regWithIdx(i)->name); + if (options.useXstack) + { + pic14_emitcode ("mov", "r0,%s", spname); + for (i = pic14_nRegs; i >= 0; i--) + { + if (bitVectBitValue (rsave, i)) + { + pic14_emitcode ("dec", "r0"); + pic14_emitcode ("movx", "a,@r0"); + pic14_emitcode ("mov", "%s,a", pic14_regWithIdx (i)->name); } } - pic14_emitcode("mov","%s,r0",spname); - } //else - //for (i = pic14_nRegs ; i >= 0 ; i--) { - // if (bitVectBitValue(rsave,i)) - // pic14_emitcode("pop","%s",pic14_regWithIdx(i)->dname); - //} + pic14_emitcode ("mov", "%s,r0", spname); + } //else + //for (i = pic14_nRegs ; i >= 0 ; i--) { + // if (bitVectBitValue(rsave,i)) + // pic14_emitcode("pop","%s",pic14_regWithIdx(i)->dname); + //} } @@ -1812,20 +1874,22 @@ /*-----------------------------------------------------------------*/ /* pushSide - */ /*-----------------------------------------------------------------*/ -static void pushSide(operand * oper, int size) +static void +pushSide (operand * oper, int size) { #if 0 - int offset = 0; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - while (size--) { - char *l = aopGet(AOP(oper),offset++,FALSE,TRUE); - if (AOP_TYPE(oper) != AOP_REG && - AOP_TYPE(oper) != AOP_DIR && - strcmp(l,"a") ) { - pic14_emitcode("mov","a,%s",l); - pic14_emitcode("push","acc"); - } else - pic14_emitcode("push","%s",l); + int offset = 0; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + while (size--) + { + char *l = aopGet (AOP (oper), offset++, FALSE, TRUE); + if (AOP_TYPE (oper) != AOP_REG && AOP_TYPE (oper) != AOP_DIR && strcmp (l, "a")) + { + pic14_emitcode ("mov", "a,%s", l); + pic14_emitcode ("push", "acc"); + } + else + pic14_emitcode ("push", "%s", l); } #endif } @@ -1833,21 +1897,23 @@ /*-----------------------------------------------------------------*/ /* assignResultValue - */ /*-----------------------------------------------------------------*/ -static void assignResultValue(operand * oper) +static void +assignResultValue (operand * oper) { - int size = AOP_SIZE(oper); - int offset = 0; + int size = AOP_SIZE (oper); + int offset = 0; - FENTRY; + FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - DEBUGpic14_AopType(__LINE__,oper,NULL,NULL); + DEBUGpic14_AopType (__LINE__, oper, NULL, NULL); - /* assign MSB first (passed via WREG) */ - while (size--) { - get_returnvalue (oper, size, offset + GpsuedoStkPtr); - GpsuedoStkPtr++; + /* assign MSB first (passed via WREG) */ + while (size--) + { + get_returnvalue (oper, size, offset + GpsuedoStkPtr); + GpsuedoStkPtr++; } } @@ -1855,138 +1921,151 @@ /*-----------------------------------------------------------------*/ /* genIpush - genrate code for pushing this gets a little complex */ /*-----------------------------------------------------------------*/ -static void genIpush (iCode *ic) +static void +genIpush (iCode * ic) { - FENTRY; + FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d - WARNING no code generated",__FUNCTION__,__LINE__); + DEBUGpic14_emitcode ("; ***", "%s %d - WARNING no code generated", __FUNCTION__, __LINE__); #if 0 - int size, offset = 0 ; - char *l; + int size, offset = 0; + char *l; - /* if this is not a parm push : ie. it is spill push - and spill push is always done on the local stack */ - if (!ic->parmPush) { + /* if this is not a parm push : ie. it is spill push + and spill push is always done on the local stack */ + if (!ic->parmPush) + { - /* and the item is spilt then do nothing */ - if (OP_SYMBOL(IC_LEFT(ic))->isspilt) - return ; + /* and the item is spilt then do nothing */ + if (OP_SYMBOL (IC_LEFT (ic))->isspilt) + return; - aopOp(IC_LEFT(ic),ic,FALSE); - size = AOP_SIZE(IC_LEFT(ic)); - /* push it on the stack */ - while(size--) { - l = aopGet(AOP(IC_LEFT(ic)),offset++,FALSE,TRUE); - if (*l == '#') { - MOVA(l); - l = "acc"; + aopOp (IC_LEFT (ic), ic, FALSE); + size = AOP_SIZE (IC_LEFT (ic)); + /* push it on the stack */ + while (size--) + { + l = aopGet (AOP (IC_LEFT (ic)), offset++, FALSE, TRUE); + if (*l == '#') + { + MOVA (l); + l = "acc"; } - pic14_emitcode("push","%s",l); + pic14_emitcode ("push", "%s", l); } - return ; + return; } - /* this is a paramter push: in this case we call - the routine to find the call and save those - registers that need to be saved */ - saveRegisters(ic); + /* this is a paramter push: in this case we call + the routine to find the call and save those + registers that need to be saved */ + saveRegisters (ic); - /* then do the push */ - aopOp(IC_LEFT(ic),ic,FALSE); + /* then do the push */ + aopOp (IC_LEFT (ic), ic, FALSE); - // pushSide(IC_LEFT(ic), AOP_SIZE(IC_LEFT(ic))); - size = AOP_SIZE(IC_LEFT(ic)); + // pushSide(IC_LEFT(ic), AOP_SIZE(IC_LEFT(ic))); + size = AOP_SIZE (IC_LEFT (ic)); - while (size--) { - l = aopGet(AOP(IC_LEFT(ic)),offset++,FALSE,TRUE); - if (AOP_TYPE(IC_LEFT(ic)) != AOP_REG && - AOP_TYPE(IC_LEFT(ic)) != AOP_DIR && - strcmp(l,"a") ) { - pic14_emitcode("mov","a,%s",l); - pic14_emitcode("push","acc"); - } else - pic14_emitcode("push","%s",l); + while (size--) + { + l = aopGet (AOP (IC_LEFT (ic)), offset++, FALSE, TRUE); + if (AOP_TYPE (IC_LEFT (ic)) != AOP_REG && AOP_TYPE (IC_LEFT (ic)) != AOP_DIR && strcmp (l, "a")) + { + pic14_emitcode ("mov", "a,%s", l); + pic14_emitcode ("push", "acc"); + } + else + pic14_emitcode ("push", "%s", l); } - freeAsmop(IC_LEFT(ic),NULL,ic,TRUE); + freeAsmop (IC_LEFT (ic), NULL, ic, TRUE); #endif } /*-----------------------------------------------------------------*/ /* genIpop - recover the registers: can happen only for spilling */ /*-----------------------------------------------------------------*/ -static void genIpop (iCode *ic) +static void +genIpop (iCode * ic) { - FENTRY; + FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d - WARNING no code generated",__FUNCTION__,__LINE__); - assert (!"genIpop -- unimplemented"); + DEBUGpic14_emitcode ("; ***", "%s %d - WARNING no code generated", __FUNCTION__, __LINE__); + assert (!"genIpop -- unimplemented"); #if 0 - int size,offset ; + int size, offset; - /* if the temp was not pushed then */ - if (OP_SYMBOL(IC_LEFT(ic))->isspilt) - return ; + /* if the temp was not pushed then */ + if (OP_SYMBOL (IC_LEFT (ic))->isspilt) + return; - aopOp(IC_LEFT(ic),ic,FALSE); - size = AOP_SIZE(IC_LEFT(ic)); - offset = (size-1); - while (size--) - pic14_emitcode("pop","%s",aopGet(AOP(IC_LEFT(ic)),offset--, - FALSE,TRUE)); + aopOp (IC_LEFT (ic), ic, FALSE); + size = AOP_SIZE (IC_LEFT (ic)); + offset = (size - 1); + while (size--) + pic14_emitcode ("pop", "%s", aopGet (AOP (IC_LEFT (ic)), offset--, FALSE, TRUE)); - freeAsmop(IC_LEFT(ic),NULL,ic,TRUE); + freeAsmop (IC_LEFT (ic), NULL, ic, TRUE); #endif } /*-----------------------------------------------------------------*/ /* unsaverbank - restores the resgister bank from stack */ /*-----------------------------------------------------------------*/ -static void unsaverbank (int bank,iCode *ic,bool popPsw) +static void +unsaverbank (int bank, iCode * ic, bool popPsw) { - FENTRY; + FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d - WARNING no code generated",__FUNCTION__,__LINE__); + DEBUGpic14_emitcode ("; ***", "%s %d - WARNING no code generated", __FUNCTION__, __LINE__); #if 0 - int i; - asmop *aop ; - regs *r = NULL; + int i; + asmop *aop; + regs *r = NULL; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if (popPsw) { - if (options.useXstack) { - aop = newAsmop(0); - r = getFreePtr(ic,&aop,FALSE); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + if (popPsw) + { + if (options.useXstack) + { + aop = newAsmop (0); + r = getFreePtr (ic, &aop, FALSE); - pic14_emitcode("mov","%s,_spx",r->name); - pic14_emitcode("movx","a,@%s",r->name); - pic14_emitcode("mov","psw,a"); - pic14_emitcode("dec","%s",r->name); + pic14_emitcode ("mov", "%s,_spx", r->name); + pic14_emitcode ("movx", "a,@%s", r->name); + pic14_emitcode ("mov", "psw,a"); + pic14_emitcode ("dec", "%s", r->name); - }else - pic14_emitcode ("pop","psw"); + } + else + pic14_emitcode ("pop", "psw"); } - for (i = (pic14_nRegs - 1) ; i >= 0 ;i--) { - if (options.useXstack) { - pic14_emitcode("movx","a,@%s",r->name); - //pic14_emitcode("mov","(%s+%d),a", - // regspic14[i].base,8*bank+regspic14[i].offset); - pic14_emitcode("dec","%s",r->name); + for (i = (pic14_nRegs - 1); i >= 0; i--) + { + if (options.useXstack) + { + pic14_emitcode ("movx", "a,@%s", r->name); + //pic14_emitcode("mov","(%s+%d),a", + // regspic14[i].base,8*bank+regspic14[i].offset); + pic14_emitcode ("dec", "%s", r->name); - } else - pic14_emitcode("pop",""); //"(%s+%d)", - //regspic14[i].base,8*bank); //+regspic14[i].offset); + } + else + pic14_emitcode ("pop", ""); //"(%s+%d)", + //regspic14[i].base,8*bank); //+regspic14[i].offset); } - if (options.useXstack) { + if (options.useXstack) + { - pic14_emitcode("mov","_spx,%s",r->name); - freeAsmop(NULL,aop,ic,TRUE); + pic14_emitcode ("mov", "_spx,%s", r->name); + freeAsmop (NULL, aop, ic, TRUE); } #endif @@ -1995,134 +2074,135 @@ /*-----------------------------------------------------------------*/ /* genCall - generates a call statement */ /*-----------------------------------------------------------------*/ -static void genCall (iCode *ic) +static void +genCall (iCode * ic) { - sym_link *dtype; - symbol *sym; - char *name; - int isExtern; - - FENTRY; - - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - /* if caller saves & we have not saved then */ - if (!ic->regsSaved) - saveRegisters(ic); - - /* if we are calling a function that is not using - the same register bank then we need to save the - destination registers on the stack */ - dtype = operandType(IC_LEFT(ic)); - if (currFunc && dtype && - (FUNC_REGBANK(currFunc->type) != FUNC_REGBANK(dtype)) && - IFFUNC_ISISR(currFunc->type) && - !ic->bankSaved) - - saverbank(FUNC_REGBANK(dtype),ic,TRUE); - - /* if send set is not empty the assign */ - if (_G.sendSet) { - iCode *sic; - /* For the Pic port, there is no data stack. - * So parameters passed to functions are stored - * in registers. (The pCode optimizer will get - * rid of most of these :). - */ - int psuedoStkPtr=-1; - int firstTimeThruLoop = 1; - - _G.sendSet = reverseSet(_G.sendSet); - - /* First figure how many parameters are getting passed */ - for (sic = setFirstItem(_G.sendSet) ; sic ; - sic = setNextItem(_G.sendSet)) { - - aopOp(IC_LEFT(sic),sic,FALSE); - psuedoStkPtr += AOP_SIZE(IC_LEFT(sic)); - freeAsmop (IC_LEFT(sic),NULL,sic,FALSE); - } - - for (sic = setFirstItem(_G.sendSet) ; sic ; - sic = setNextItem(_G.sendSet)) { - int size, offset = 0; - - aopOp(IC_LEFT(sic),sic,FALSE); - size = AOP_SIZE(IC_LEFT(sic)); - - while (size--) { - DEBUGpic14_emitcode ("; ","%d left %s",__LINE__, - AopType(AOP_TYPE(IC_LEFT(sic)))); - - if(!firstTimeThruLoop) { - /* If this is not the first time we've been through the loop - * then we need to save the parameter in a temporary - * register. The last byte of the last parameter is - * passed in W. */ - emitpcode(POC_MOVWF,popRegFromIdx(Gstack_base_addr - --psuedoStkPtr)); + sym_link *dtype; + symbol *sym; + char *name; + int isExtern; + + FENTRY; + + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + + /* if caller saves & we have not saved then */ + if (!ic->regsSaved) + saveRegisters (ic); + + /* if we are calling a function that is not using + the same register bank then we need to save the + destination registers on the stack */ + dtype = operandType (IC_LEFT (ic)); + if (currFunc && dtype && + (FUNC_REGBANK (currFunc->type) != FUNC_REGBANK (dtype)) && IFFUNC_ISISR (currFunc->type) && !ic->bankSaved) + + saverbank (FUNC_REGBANK (dtype), ic, TRUE); + + /* if send set is not empty the assign */ + if (_G.sendSet) + { + iCode *sic; + /* For the Pic port, there is no data stack. + * So parameters passed to functions are stored + * in registers. (The pCode optimizer will get + * rid of most of these :). + */ + int psuedoStkPtr = -1; + int firstTimeThruLoop = 1; + + _G.sendSet = reverseSet (_G.sendSet); + + /* First figure how many parameters are getting passed */ + for (sic = setFirstItem (_G.sendSet); sic; sic = setNextItem (_G.sendSet)) + { + + aopOp (IC_LEFT (sic), sic, FALSE); + psuedoStkPtr += AOP_SIZE (IC_LEFT (sic)); + freeAsmop (IC_LEFT (sic), NULL, sic, FALSE); + } + + for (sic = setFirstItem (_G.sendSet); sic; sic = setNextItem (_G.sendSet)) + { + int size, offset = 0; + + aopOp (IC_LEFT (sic), sic, FALSE); + size = AOP_SIZE (IC_LEFT (sic)); + + while (size--) + { + DEBUGpic14_emitcode ("; ", "%d left %s", __LINE__, AopType (AOP_TYPE (IC_LEFT (sic)))); + + if (!firstTimeThruLoop) + { + /* If this is not the first time we've been through the loop + * then we need to save the parameter in a temporary + * register. The last byte of the last parameter is + * passed in W. */ + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr - --psuedoStkPtr)); } - firstTimeThruLoop=0; + firstTimeThruLoop = 0; - mov2w_op (IC_LEFT(sic), offset); - offset++; + mov2w_op (IC_LEFT (sic), offset); + offset++; } - freeAsmop (IC_LEFT(sic),NULL,sic,TRUE); + freeAsmop (IC_LEFT (sic), NULL, sic, TRUE); } - _G.sendSet = NULL; + _G.sendSet = NULL; + } + /* make the call */ + sym = OP_SYMBOL (IC_LEFT (ic)); + name = sym->rname[0] ? sym->rname : sym->name; + /* + * As SDCC emits code as soon as it reaches the end of each + * function's definition, prototyped functions that are implemented + * after the current one are always considered EXTERN, which + * introduces many unneccessary PAGESEL instructions. + * XXX: Use a post pass to iterate over all `CALL _name' statements + * and insert `PAGESEL _name' and `PAGESEL $' around the CALL + * only iff there is no definition of the function in the whole + * file (might include this in the PAGESEL pass). + */ + isExtern = IS_EXTERN (sym->etype) || pic14_inISR; + if (isExtern) + { + /* Extern functions and ISRs maybe on a different page; + * must call pagesel */ + emitpcode (POC_PAGESEL, popGetWithString (name, 1)); + } + emitpcode (POC_CALL, popGetWithString (name, isExtern)); + if (isExtern) + { + /* May have returned from a different page; + * must use pagesel to restore PCLATH before next + * goto or call instruction */ + emitpcode (POC_PAGESEL, popGetWithString ("$", 0)); + } + GpsuedoStkPtr = 0; + /* if we need assign a result value */ + if ((IS_ITEMP (IC_RESULT (ic)) && + (OP_SYMBOL (IC_RESULT (ic))->nRegs || OP_SYMBOL (IC_RESULT (ic))->spildir)) || IS_TRUE_SYMOP (IC_RESULT (ic))) + { + + _G.accInUse++; + aopOp (IC_RESULT (ic), ic, FALSE); + _G.accInUse--; + + assignResultValue (IC_RESULT (ic)); + + DEBUGpic14_emitcode ("; ", "%d left %s", __LINE__, AopType (AOP_TYPE (IC_RESULT (ic)))); + + freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); } - /* make the call */ - sym = OP_SYMBOL(IC_LEFT(ic)); - name = sym->rname[0] ? sym->rname : sym->name; - /* - * As SDCC emits code as soon as it reaches the end of each - * function's definition, prototyped functions that are implemented - * after the current one are always considered EXTERN, which - * introduces many unneccessary PAGESEL instructions. - * XXX: Use a post pass to iterate over all `CALL _name' statements - * and insert `PAGESEL _name' and `PAGESEL $' around the CALL - * only iff there is no definition of the function in the whole - * file (might include this in the PAGESEL pass). - */ - isExtern = IS_EXTERN(sym->etype) || pic14_inISR; - if (isExtern) { - /* Extern functions and ISRs maybe on a different page; - * must call pagesel */ - emitpcode(POC_PAGESEL,popGetWithString(name,1)); - } - emitpcode(POC_CALL,popGetWithString(name,isExtern)); - if (isExtern) { - /* May have returned from a different page; - * must use pagesel to restore PCLATH before next - * goto or call instruction */ - emitpcode(POC_PAGESEL,popGetWithString("$",0)); - } - GpsuedoStkPtr=0; - /* if we need assign a result value */ - if ((IS_ITEMP(IC_RESULT(ic)) && - (OP_SYMBOL(IC_RESULT(ic))->nRegs || - OP_SYMBOL(IC_RESULT(ic))->spildir )) || - IS_TRUE_SYMOP(IC_RESULT(ic)) ) { - - _G.accInUse++; - aopOp(IC_RESULT(ic),ic,FALSE); - _G.accInUse--; - - assignResultValue(IC_RESULT(ic)); - - DEBUGpic14_emitcode ("; ","%d left %s",__LINE__, - AopType(AOP_TYPE(IC_RESULT(ic)))); - - freeAsmop(IC_RESULT(ic),NULL, ic,TRUE); - } - - /* if register bank was saved then pop them */ - if (ic->bankSaved) - unsaverbank(FUNC_REGBANK(dtype),ic,TRUE); - - /* if we hade saved some registers then unsave them */ - if (ic->regsSaved && !IFFUNC_CALLEESAVES(dtype)) - unsaveRegisters (ic); + + /* if register bank was saved then pop them */ + if (ic->bankSaved) + unsaverbank (FUNC_REGBANK (dtype), ic, TRUE); + + /* if we hade saved some registers then unsave them */ + if (ic->regsSaved && !IFFUNC_CALLEESAVES (dtype)) + unsaveRegisters (ic); } @@ -2130,280 +2210,303 @@ /*-----------------------------------------------------------------*/ /* genPcall - generates a call by pointer statement */ /*-----------------------------------------------------------------*/ -static void genPcall (iCode *ic) +static void +genPcall (iCode * ic) { - sym_link *dtype; - symbol *albl = newiTempLabel(NULL); - symbol *blbl = newiTempLabel(NULL); - PIC_OPCODE poc; - pCodeOp *pcop; - operand *left; - - FENTRY; - - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* if caller saves & we have not saved then */ - if (!ic->regsSaved) - saveRegisters(ic); - - /* if we are calling a function that is not using - the same register bank then we need to save the - destination registers on the stack */ - dtype = operandType(IC_LEFT(ic)); - if (currFunc && dtype && - IFFUNC_ISISR(currFunc->type) && - (FUNC_REGBANK(currFunc->type) != FUNC_REGBANK(dtype))) - saverbank(FUNC_REGBANK(dtype),ic,TRUE); - - left = IC_LEFT(ic); - aopOp(left,ic,FALSE); - DEBUGpic14_AopType(__LINE__,left,NULL,NULL); - - poc = ( op_isLitLike (IC_LEFT(ic)) ? POC_MOVLW : POC_MOVFW ); - - pushSide(IC_LEFT(ic), FPTRSIZE); - - /* if send set is not empty, assign parameters */ - if (_G.sendSet) { - - DEBUGpic14_emitcode ("; ***","%s %d - WARNING arg-passing to indirect call not supported",__FUNCTION__,__LINE__); - /* no way to pass args - W always gets used to make the call */ - } - /* first idea - factor out a common helper function and call it. - But don't know how to get it generated only once in its own block - - if(AOP_TYPE(IC_LEFT(ic)) == AOP_DIR) { - char *rname; - char *buffer; - rname = IC_LEFT(ic)->aop->aopu.aop_dir; - DEBUGpic14_emitcode ("; ***","%s %d AOP_DIR %s",__FUNCTION__,__LINE__,rname); - buffer = Safe_calloc(1,strlen(rname)+16); - sprintf(buffer, "%s_goto_helper", rname); - addpCode2pBlock(pb,newpCode(POC_CALL,newpCodeOp(buffer,PO_STR))); - free(buffer); - } - */ - emitpcode(POC_CALL,popGetLabel(albl->key)); - pcop = popGetLabel(blbl->key); - emitpcode(POC_PAGESEL,pcop); /* Must restore PCLATH before goto, without destroying W */ - emitpcode(POC_GOTO,pcop); - emitpLabel(albl->key); - - emitpcode(poc,popGetAddr(AOP(left),1,0)); - emitpcode(POC_MOVWF,popCopyReg(&pc_pclath)); - emitpcode(poc,popGetAddr(AOP(left),0,0)); - emitpcode(POC_MOVWF,popCopyReg(&pc_pcl)); - - emitpLabel(blbl->key); - - freeAsmop(IC_LEFT(ic),NULL,ic,TRUE); - - /* if we need to assign a result value */ - if ((IS_ITEMP(IC_RESULT(ic)) && - (OP_SYMBOL(IC_RESULT(ic))->nRegs || - OP_SYMBOL(IC_RESULT(ic))->spildir)) || - IS_TRUE_SYMOP(IC_RESULT(ic)) ) { - - _G.accInUse++; - aopOp(IC_RESULT(ic),ic,FALSE); - _G.accInUse--; - - GpsuedoStkPtr = 0; - - assignResultValue(IC_RESULT(ic)); - - freeAsmop(IC_RESULT(ic),NULL,ic,TRUE); - } - - /* if register bank was saved then unsave them */ - if (currFunc && dtype && - (FUNC_REGBANK(currFunc->type) != FUNC_REGBANK(dtype))) - unsaverbank(FUNC_REGBANK(dtype),ic,TRUE); - - /* if we hade saved some registers then - unsave them */ - if (ic->regsSaved) - unsaveRegisters (ic); + sym_link *dtype; + symbol *albl = newiTempLabel (NULL); + symbol *blbl = newiTempLabel (NULL); + PIC_OPCODE poc; + pCodeOp *pcop; + operand *left; + + FENTRY; + + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* if caller saves & we have not saved then */ + if (!ic->regsSaved) + saveRegisters (ic); + + /* if we are calling a function that is not using + the same register bank then we need to save the + destination registers on the stack */ + dtype = operandType (IC_LEFT (ic)); + if (currFunc && dtype && IFFUNC_ISISR (currFunc->type) && (FUNC_REGBANK (currFunc->type) != FUNC_REGBANK (dtype))) + saverbank (FUNC_REGBANK (dtype), ic, TRUE); + + left = IC_LEFT (ic); + aopOp (left, ic, FALSE); + DEBUGpic14_AopType (__LINE__, left, NULL, NULL); + + poc = (op_isLitLike (IC_LEFT (ic)) ? POC_MOVLW : POC_MOVFW); + + pushSide (IC_LEFT (ic), FPTRSIZE); + + /* if send set is not empty, assign parameters */ + if (_G.sendSet) + { + + DEBUGpic14_emitcode ("; ***", "%s %d - WARNING arg-passing to indirect call not supported", __FUNCTION__, __LINE__); + /* no way to pass args - W always gets used to make the call */ + } + /* first idea - factor out a common helper function and call it. + But don't know how to get it generated only once in its own block + + if(AOP_TYPE(IC_LEFT(ic)) == AOP_DIR) { + char *rname; + char *buffer; + rname = IC_LEFT(ic)->aop->aopu.aop_dir; + DEBUGpic14_emitcode ("; ***","%s %d AOP_DIR %s",__FUNCTION__,__LINE__,rname); + buffer = Safe_calloc(1,strlen(rname)+16); + sprintf(buffer, "%s_goto_helper", rname); + addpCode2pBlock(pb,newpCode(POC_CALL,newpCodeOp(buffer,PO_STR))); + free(buffer); + } + */ + emitpcode (POC_CALL, popGetLabel (albl->key)); + pcop = popGetLabel (blbl->key); + emitpcode (POC_PAGESEL, pcop); /* Must restore PCLATH before goto, without destroying W */ + emitpcode (POC_GOTO, pcop); + emitpLabel (albl->key); + + emitpcode (poc, popGetAddr (AOP (left), 1, 0)); + emitpcode (POC_MOVWF, popCopyReg (&pc_pclath)); + emitpcode (poc, popGetAddr (AOP (left), 0, 0)); + emitpcode (POC_MOVWF, popCopyReg (&pc_pcl)); + + emitpLabel (blbl->key); + + freeAsmop (IC_LEFT (ic), NULL, ic, TRUE); + + /* if we need to assign a result value */ + if ((IS_ITEMP (IC_RESULT (ic)) && + (OP_SYMBOL (IC_RESULT (ic))->nRegs || OP_SYMBOL (IC_RESULT (ic))->spildir)) || IS_TRUE_SYMOP (IC_RESULT (ic))) + { + + _G.accInUse++; + aopOp (IC_RESULT (ic), ic, FALSE); + _G.accInUse--; + + GpsuedoStkPtr = 0; + + assignResultValue (IC_RESULT (ic)); + + freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); + } + + /* if register bank was saved then unsave them */ + if (currFunc && dtype && (FUNC_REGBANK (currFunc->type) != FUNC_REGBANK (dtype))) + unsaverbank (FUNC_REGBANK (dtype), ic, TRUE); + + /* if we hade saved some registers then + unsave them */ + if (ic->regsSaved) + unsaveRegisters (ic); } /*-----------------------------------------------------------------*/ /* resultRemat - result is rematerializable */ /*-----------------------------------------------------------------*/ -static int resultRemat (iCode *ic) +static int +resultRemat (iCode * ic) { - // DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - FENTRY; + // DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + FENTRY; - if (SKIP_IC(ic) || ic->op == IFX) - return 0; + if (SKIP_IC (ic) || ic->op == IFX) + return 0; - if (IC_RESULT(ic) && IS_ITEMP(IC_RESULT(ic))) { - symbol *sym = OP_SYMBOL(IC_RESULT(ic)); - if (sym->remat && !POINTER_SET(ic)) - return 1; + if (IC_RESULT (ic) && IS_ITEMP (IC_RESULT (ic))) + { + symbol *sym = OP_SYMBOL (IC_RESULT (ic)); + if (sym->remat && !POINTER_SET (ic)) + return 1; } - return 0; + return 0; } /*-----------------------------------------------------------------*/ /* genFunction - generated code for function entry */ /*-----------------------------------------------------------------*/ -static void genFunction (iCode *ic) +static void +genFunction (iCode * ic) { - symbol *sym; - sym_link *ftype; - - FENTRY; - - DEBUGpic14_emitcode ("; ***","%s %d curr label offset=%dprevious max_key=%d ",__FUNCTION__,__LINE__,labelOffset,max_key); + symbol *sym; + sym_link *ftype; - labelOffset += (max_key+4); - max_key=0; - GpsuedoStkPtr=0; - _G.nRegsSaved = 0; - /* create the function header */ - pic14_emitcode(";","-----------------------------------------"); - pic14_emitcode(";"," function %s",(sym = OP_SYMBOL(IC_LEFT(ic)))->name); - pic14_emitcode(";","-----------------------------------------"); - - /* prevent this symbol from being emitted as 'extern' */ - pic14_stringInSet(sym->rname, &pic14_localFunctions, 1); - - pic14_emitcode("","%s:",sym->rname); - addpCode2pBlock(pb,newpCodeFunction(NULL,sym->rname,!IS_STATIC (sym->etype))); + FENTRY; - /* mark symbol as NOT extern (even if it was declared so previously) */ - assert(IS_SPEC(sym->etype)); - SPEC_EXTR(sym->etype) = 0; - sym->cdef = 0; - if (!SPEC_OCLS(sym->etype)) SPEC_OCLS(sym->etype) = code; - addSetIfnotP(&SPEC_OCLS(sym->etype)->syms, sym); + DEBUGpic14_emitcode ("; ***", "%s %d curr label offset=%dprevious max_key=%d ", __FUNCTION__, __LINE__, labelOffset, + max_key); - ftype = operandType(IC_LEFT(ic)); + labelOffset += (max_key + 4); + max_key = 0; + GpsuedoStkPtr = 0; + _G.nRegsSaved = 0; + /* create the function header */ + pic14_emitcode (";", "-----------------------------------------"); + pic14_emitcode (";", " function %s", (sym = OP_SYMBOL (IC_LEFT (ic)))->name); + pic14_emitcode (";", "-----------------------------------------"); + + /* prevent this symbol from being emitted as 'extern' */ + pic14_stringInSet (sym->rname, &pic14_localFunctions, 1); + + pic14_emitcode ("", "%s:", sym->rname); + addpCode2pBlock (pb, newpCodeFunction (NULL, sym->rname, !IS_STATIC (sym->etype))); + + /* mark symbol as NOT extern (even if it was declared so previously) */ + assert (IS_SPEC (sym->etype)); + SPEC_EXTR (sym->etype) = 0; + sym->cdef = 0; + if (!SPEC_OCLS (sym->etype)) + SPEC_OCLS (sym->etype) = code; + addSetIfnotP (&SPEC_OCLS (sym->etype)->syms, sym); - /* if critical function then turn interrupts off */ - if (IFFUNC_ISCRITICAL(ftype)) - pic14_emitcode("clr","ea"); + ftype = operandType (IC_LEFT (ic)); - /* here we need to generate the equates for the - register bank if required */ + /* here we need to generate the equates for the + register bank if required */ #if 0 - if (FUNC_REGBANK(ftype) != rbank) { - int i ; + if (FUNC_REGBANK (ftype) != rbank) + { + int i; - rbank = FUNC_REGBANK(ftype); - for ( i = 0 ; i < pic14_nRegs ; i++ ) { - if (strcmp(regspic14[i].base,"0") == 0) - pic14_emitcode("","%s = 0x%02x", - regspic14[i].dname, - 8*rbank+regspic14[i].offset); - else - pic14_emitcode ("","%s = %s + 0x%02x", - regspic14[i].dname, - regspic14[i].base, - 8*rbank+regspic14[i].offset); + rbank = FUNC_REGBANK (ftype); + for (i = 0; i < pic14_nRegs; i++) + { + if (strcmp (regspic14[i].base, "0") == 0) + pic14_emitcode ("", "%s = 0x%02x", regspic14[i].dname, 8 * rbank + regspic14[i].offset); + else + pic14_emitcode ("", "%s = %s + 0x%02x", regspic14[i].dname, regspic14[i].base, 8 * rbank + regspic14[i].offset); } } #endif - /* if this is an interrupt service routine */ - pic14_inISR = 0; - if (IFFUNC_ISISR(sym->type)) { - pic14_inISR = 1; - if (pic14_getPIC()->isEnhancedCore) { - /* - * Enhanced CPUs have automatic context saving for W, - * STATUS, BSR, FSRx, and PCLATH in shadow registers. - */ - emitpcode(POC_CLRF, popCopyReg(&pc_pclath)); - } else { - emitpcode(POC_MOVWF, popCopyReg(&pc_wsave)); - emitpcode(POC_SWAPFW, popCopyReg(&pc_status)); - /* XXX: Why? Does this assume that ssave and psave reside - * in a shared bank or bank0? We cannot guarantee the - * latter... - */ - emitpcode(POC_CLRF, popCopyReg(&pc_status)); - emitpcode(POC_MOVWF, popCopyReg(&pc_ssave)); - //emitpcode(POC_MOVWF, popGetExternal("___sdcc_saved_status",1 )); - emitpcode(POC_MOVFW, popCopyReg(&pc_pclath)); - /* during an interrupt PCLATH must be cleared before a goto or call statement */ - emitpcode(POC_CLRF, popCopyReg(&pc_pclath)); - emitpcode(POC_MOVWF, popCopyReg(&pc_psave)); - //emitpcode(POC_MOVWF, popGetExternal("___sdcc_saved_pclath", 1)); - emitpcode(POC_MOVFW, popCopyReg(&pc_fsr)); - emitpcode(POC_MOVWF, popGetExternal("___sdcc_saved_fsr", 1)); - } // if - - pBlockConvert2ISR(pb); - pic14_hasInterrupt = 1; - } else { - /* if callee-save to be used for this function - then save the registers being used in this function */ - if (IFFUNC_CALLEESAVES(sym->type)) { - int i; - - /* if any registers used */ - if (sym->regsUsed) { - /* save the registers used */ - for ( i = 0 ; i < sym->regsUsed->size ; i++) { - if (bitVectBitValue(sym->regsUsed,i)) { - //pic14_emitcode("push","%s",pic14_regWithIdx(i)->dname); - _G.nRegsSaved++; + /* if this is an interrupt service routine */ + pic14_inISR = 0; + if (IFFUNC_ISISR (sym->type)) + { + pic14_inISR = 1; + if (pic14_getPIC ()->isEnhancedCore) + { + /* + * Enhanced CPUs have automatic context saving for W, + * STATUS, BSR, FSRx, and PCLATH in shadow registers. + */ + emitpcode (POC_CLRF, popCopyReg (&pc_pclath)); + } + else + { + emitpcode (POC_MOVWF, popCopyReg (&pc_wsave)); + emitpcode (POC_SWAPFW, popCopyReg (&pc_status)); + /* XXX: Why? Does this assume that ssave and psave reside + * in a shared bank or bank0? We cannot guarantee the + * latter... + */ + emitpcode (POC_CLRF, popCopyReg (&pc_status)); + emitpcode (POC_MOVWF, popCopyReg (&pc_ssave)); + //emitpcode(POC_MOVWF, popGetExternal("___sdcc_saved_status",1 )); + emitpcode (POC_MOVFW, popCopyReg (&pc_pclath)); + /* during an interrupt PCLATH must be cleared before a goto or call statement */ + emitpcode (POC_CLRF, popCopyReg (&pc_pclath)); + emitpcode (POC_MOVWF, popCopyReg (&pc_psave)); + //emitpcode(POC_MOVWF, popGetExternal("___sdcc_saved_pclath", 1)); + emitpcode (POC_MOVFW, popCopyReg (&pc_fsr)); + emitpcode (POC_MOVWF, popGetExternal ("___sdcc_saved_fsr", 1)); + } // if + + pBlockConvert2ISR (pb); + pic14_hasInterrupt = 1; + } + else + { + /* if callee-save to be used for this function + then save the registers being used in this function */ + if (IFFUNC_CALLEESAVES (sym->type)) + { + int i; + + /* if any registers used */ + if (sym->regsUsed) + { + /* save the registers used */ + for (i = 0; i < sym->regsUsed->size; i++) + { + if (bitVectBitValue (sym->regsUsed, i)) + { + //pic14_emitcode("push","%s",pic14_regWithIdx(i)->dname); + _G.nRegsSaved++; } } } } } - /* set the register bank to the desired value */ - if (FUNC_REGBANK(sym->type) || FUNC_ISISR(sym->type)) { - pic14_emitcode("push","psw"); - pic14_emitcode("mov","psw,#0x%02x",(FUNC_REGBANK(sym->type) << 3)&0x00ff); + /* if critical function then turn interrupts off */ + if (IFFUNC_ISCRITICAL (ftype)) + { + genCritical (NULL); + if (IFFUNC_ARGS (sym->type)) + { + fprintf (stderr, "PIC14: Functions with __critical (%s) must not have arguments for now.\n", sym->name); + exit (1); + } // if + } // if + + /* set the register bank to the desired value */ + if (FUNC_REGBANK (sym->type) || FUNC_ISISR (sym->type)) + { + pic14_emitcode ("push", "psw"); + pic14_emitcode ("mov", "psw,#0x%02x", (FUNC_REGBANK (sym->type) << 3) & 0x00ff); } - if (IFFUNC_ISREENT(sym->type) || options.stackAuto) { - - if (options.useXstack) { - pic14_emitcode("mov","r0,%s",spname); - pic14_emitcode("mov","a,_bp"); - pic14_emitcode("movx","@r0,a"); - pic14_emitcode("inc","%s",spname); + if (IFFUNC_ISREENT (sym->type) || options.stackAuto) + { + + if (options.useXstack) + { + pic14_emitcode ("mov", "r0,%s", spname); + pic14_emitcode ("mov", "a,_bp"); + pic14_emitcode ("movx", "@r0,a"); + pic14_emitcode ("inc", "%s", spname); } - else + else { - /* set up the stack */ - pic14_emitcode ("push","_bp"); /* save the callers stack */ + /* set up the stack */ + pic14_emitcode ("push", "_bp"); /* save the callers stack */ } - pic14_emitcode ("mov","_bp,%s",spname); + pic14_emitcode ("mov", "_bp,%s", spname); } - /* adjust the stack for the function */ - if (sym->stack) { + /* adjust the stack for the function */ + if (sym->stack) + { - int i = sym->stack; - if (i > 256 ) - werror(W_STACK_OVERFLOW,sym->name); + int i = sym->stack; + if (i > 256) + werror (W_STACK_OVERFLOW, sym->name); - if (i > 3 && sym->recvSize < 4) { + if (i > 3 && sym->recvSize < 4) + { - pic14_emitcode ("mov","a,sp"); - pic14_emitcode ("add","a,#0x%02x",((char)sym->stack & 0xff)); - pic14_emitcode ("mov","sp,a"); + pic14_emitcode ("mov", "a,sp"); + pic14_emitcode ("add", "a,#0x%02x", ((char) sym->stack & 0xff)); + pic14_emitcode ("mov", "sp,a"); } - else - while(i--) - pic14_emitcode("inc","sp"); + else + while (i--) + pic14_emitcode ("inc", "sp"); } - if (sym->xstack) { + if (sym->xstack) + { - pic14_emitcode ("mov","a,_spx"); - pic14_emitcode ("add","a,#0x%02x",((char)sym->xstack & 0xff)); - pic14_emitcode ("mov","_spx,a"); + pic14_emitcode ("mov", "a,_spx"); + pic14_emitcode ("add", "a,#0x%02x", ((char) sym->xstack & 0xff)); + pic14_emitcode ("mov", "_spx,a"); } } @@ -2411,129 +2514,157 @@ /*-----------------------------------------------------------------*/ /* genEndFunction - generates epilogue for functions */ /*-----------------------------------------------------------------*/ -static void genEndFunction (iCode *ic) +static void +genEndFunction (iCode * ic) { - symbol *sym = OP_SYMBOL(IC_LEFT(ic)); + symbol *sym = OP_SYMBOL (IC_LEFT (ic)); - FENTRY; + FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - if (IFFUNC_ISREENT(sym->type) || options.stackAuto) + if (IFFUNC_ISREENT (sym->type) || options.stackAuto) { - pic14_emitcode ("mov","%s,_bp",spname); + pic14_emitcode ("mov", "%s,_bp", spname); } - /* if use external stack but some variables were - added to the local stack then decrement the - local stack */ - if (options.useXstack && sym->stack) { - pic14_emitcode("mov","a,sp"); - pic14_emitcode("add","a,#0x%02x",((char)-sym->stack) & 0xff); - pic14_emitcode("mov","sp,a"); + /* if use external stack but some variables were + added to the local stack then decrement the + local stack */ + if (options.useXstack && sym->stack) + { + pic14_emitcode ("mov", "a,sp"); + pic14_emitcode ("add", "a,#0x%02x", ((char) - sym->stack) & 0xff); + pic14_emitcode ("mov", "sp,a"); } - if ((IFFUNC_ISREENT(sym->type) || options.stackAuto)) { - if (options.useXstack) { - pic14_emitcode("mov","r0,%s",spname); - pic14_emitcode("movx","a,@r0"); - pic14_emitcode("mov","_bp,a"); - pic14_emitcode("dec","%s",spname); + if ((IFFUNC_ISREENT (sym->type) || options.stackAuto)) + { + if (options.useXstack) + { + pic14_emitcode ("mov", "r0,%s", spname); + pic14_emitcode ("movx", "a,@r0"); + pic14_emitcode ("mov", "_bp,a"); + pic14_emitcode ("dec", "%s", spname); } - else + else { - pic14_emitcode ("pop","_bp"); + pic14_emitcode ("pop", "_bp"); } } - /* restore the register bank */ - if (FUNC_REGBANK(sym->type) || FUNC_ISISR(sym->type)) - pic14_emitcode ("pop","psw"); - - if (IFFUNC_ISISR(sym->type)) { - - /* now we need to restore the registers */ - /* if this isr has no bank i.e. is going to - run with bank 0 , then we need to save more -registers :-) */ - if (!FUNC_REGBANK(sym->type)) { - - /* if this function does not call any other - function then we can be economical and - save only those registers that are used */ - if (! IFFUNC_HASFCALL(sym->type)) { - int i; - - /* if any registers used */ - if (sym->regsUsed) { - /* save the registers used */ - for ( i = sym->regsUsed->size ; i >= 0 ; i--) { - if (bitVectBitValue(sym->regsUsed,i)) { - pic14_emitcode("pop","junk");//"%s",pic14_regWithIdx(i)->dname); + /* restore the register bank */ + if (FUNC_REGBANK (sym->type) || FUNC_ISISR (sym->type)) + pic14_emitcode ("pop", "psw"); + + /* if critical function then turn interrupts off */ + if (IFFUNC_ISCRITICAL (sym->type)) + { + genEndCritical (NULL); + } // if + + if (IFFUNC_ISISR (sym->type)) + { + + /* now we need to restore the registers */ + /* if this isr has no bank i.e. is going to + run with bank 0 , then we need to save more + registers :-) */ + if (!FUNC_REGBANK (sym->type)) + { + + /* if this function does not call any other + function then we can be economical and + save only those registers that are used */ + if (!IFFUNC_HASFCALL (sym->type)) + { + int i; + + /* if any registers used */ + if (sym->regsUsed) + { + /* save the registers used */ + for (i = sym->regsUsed->size; i >= 0; i--) + { + if (bitVectBitValue (sym->regsUsed, i)) + { + pic14_emitcode ("pop", "junk"); //"%s",pic14_regWithIdx(i)->dname); } } } - } else { - /* this function has a function call; cannot - determines register usage so we will have the - entire bank */ - unsaverbank(0,ic,FALSE); } + else + { + /* this function has a function call; cannot + determines register usage so we will have the + entire bank */ + unsaverbank (0, ic, FALSE); + } + } + + /* if debug then send end of function */ + if (options.debug && debugFile && currFunc) + { + debugFile->writeEndFunction (currFunc, ic, 1); + } + + if (pic14_getPIC ()->isEnhancedCore) + { + /* Nothing to do. */ } + else + { + emitpcode (POC_MOVFW, popGetExternal ("___sdcc_saved_fsr", 1)); + emitpcode (POC_MOVWF, popCopyReg (&pc_fsr)); + //emitpcode(POC_MOVFW, popGetExternal("___sdcc_saved_pclath", 1)); + emitpcode (POC_MOVFW, popCopyReg (&pc_psave)); + emitpcode (POC_MOVWF, popCopyReg (&pc_pclath)); + emitpcode (POC_CLRF, popCopyReg (&pc_status)); // see genFunction + //emitpcode(POC_SWAPFW, popGetExternal("___sdcc_saved_status", 1)); + emitpcode (POC_SWAPFW, popCopyReg (&pc_ssave)); + emitpcode (POC_MOVWF, popCopyReg (&pc_status)); + emitpcode (POC_SWAPF, popCopyReg (&pc_wsave)); + emitpcode (POC_SWAPFW, popCopyReg (&pc_wsave)); + } // if + addpCode2pBlock (pb, newpCodeLabel ("END_OF_INTERRUPT", -1)); + emitpcodeNULLop (POC_RETFIE); + } + else + { + if (IFFUNC_ISCRITICAL (sym->type)) + pic14_emitcode ("setb", "ea"); + + if (IFFUNC_CALLEESAVES (sym->type)) + { + int i; - /* if debug then send end of function */ - if (options.debug && debugFile && currFunc) { - debugFile->writeEndFunction (currFunc, ic, 1); - } - - if (pic14_getPIC()->isEnhancedCore) { - /* Nothing to do. */ - } else { - emitpcode(POC_MOVFW, popGetExternal("___sdcc_saved_fsr", 1)); - emitpcode(POC_MOVWF, popCopyReg(&pc_fsr)); - //emitpcode(POC_MOVFW, popGetExternal("___sdcc_saved_pclath", 1)); - emitpcode(POC_MOVFW, popCopyReg(&pc_psave)); - emitpcode(POC_MOVWF, popCopyReg(&pc_pclath)); - emitpcode(POC_CLRF, popCopyReg(&pc_status)); // see genFunction - //emitpcode(POC_SWAPFW, popGetExternal("___sdcc_saved_status", 1)); - emitpcode(POC_SWAPFW, popCopyReg(&pc_ssave)); - emitpcode(POC_MOVWF, popCopyReg(&pc_status)); - emitpcode(POC_SWAPF, popCopyReg(&pc_wsave)); - emitpcode(POC_SWAPFW, popCopyReg(&pc_wsave)); - } // if - addpCode2pBlock(pb,newpCodeLabel("END_OF_INTERRUPT",-1)); - emitpcodeNULLop(POC_RETFIE); - } - else { - if (IFFUNC_ISCRITICAL(sym->type)) - pic14_emitcode("setb","ea"); - - if (IFFUNC_CALLEESAVES(sym->type)) { - int i; - - /* if any registers used */ - if (sym->regsUsed) { - /* save the registers used */ - for ( i = sym->regsUsed->size ; i >= 0 ; i--) { - if (bitVectBitValue(sym->regsUsed,i)) { - pic14_emitcode("pop","junk");//"%s",pic14_regWithIdx(i)->dname); + /* if any registers used */ + if (sym->regsUsed) + { + /* save the registers used */ + for (i = sym->regsUsed->size; i >= 0; i--) + { + if (bitVectBitValue (sym->regsUsed, i)) + { + pic14_emitcode ("pop", "junk"); //"%s",pic14_regWithIdx(i)->dname); } } } } - /* if debug then send end of function */ - if (options.debug && debugFile && currFunc) { - debugFile->writeEndFunction (currFunc, ic, 1); + /* if debug then send end of function */ + if (options.debug && debugFile && currFunc) + { + debugFile->writeEndFunction (currFunc, ic, 1); } - pic14_emitcode ("return",""); - emitpcodeNULLop(POC_RETURN); + pic14_emitcode ("return", ""); + emitpcodeNULLop (POC_RETURN); - /* Mark the end of a function */ - addpCode2pBlock(pb,newpCodeFunction(NULL,NULL,0)); + /* Mark the end of a function */ + addpCode2pBlock (pb, newpCodeFunction (NULL, NULL, 0)); } } @@ -2541,86 +2672,128 @@ /*-----------------------------------------------------------------*/ /* genRet - generate code for return statement */ /*-----------------------------------------------------------------*/ -static void genRet (iCode *ic) +static void +genRet (iCode * ic) { - int size,offset = 0; + int size, offset = 0; - FENTRY; + FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* if we have no return value then - just generate the "ret" */ - if (!IC_LEFT(ic)) - goto jumpret; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* if we have no return value then + just generate the "ret" */ + if (!IC_LEFT (ic)) + goto jumpret; - /* we have something to return then - move the return value into place */ - aopOp(IC_LEFT(ic),ic,FALSE); - size = AOP_SIZE(IC_LEFT(ic)); + /* we have something to return then + move the return value into place */ + aopOp (IC_LEFT (ic), ic, FALSE); + size = AOP_SIZE (IC_LEFT (ic)); - for (offset = 0; offset < size; offset++) + for (offset = 0; offset < size; offset++) { - pass_argument (IC_LEFT(ic), offset, size - 1 - offset); + pass_argument (IC_LEFT (ic), offset, size - 1 - offset); } - freeAsmop (IC_LEFT(ic),NULL,ic,TRUE); + freeAsmop (IC_LEFT (ic), NULL, ic, TRUE); jumpret: - /* generate a jump to the return label - if the next is not the return statement */ - if (!(ic->next && ic->next->op == LABEL && - IC_LABEL(ic->next) == returnLabel)) { + /* generate a jump to the return label + if the next is not the return statement */ + if (!(ic->next && ic->next->op == LABEL && IC_LABEL (ic->next) == returnLabel)) + { - emitpcode(POC_GOTO,popGetLabel(returnLabel->key)); + emitpcode (POC_GOTO, popGetLabel (returnLabel->key)); } } +static set *critical_temps = NULL; + +static void +genCritical (iCode * ic) +{ + pCodeOp *saved_intcon; + + (void) ic; + + if (!critical_temps) + critical_temps = newSet (); + + saved_intcon = popGetTempReg (); + addSetHead (&critical_temps, saved_intcon); + + /* This order saves one BANKSEL back to INTCON. */ + emitpcode (POC_MOVFW, popCopyReg (&pc_intcon)); + emitpcode (POC_BCF, popCopyGPR2Bit (popCopyReg (&pc_intcon), 7)); + emitpcode (POC_MOVWF, pCodeOpCopy (saved_intcon)); +} + +static void +genEndCritical (iCode * ic) +{ + pCodeOp *saved_intcon = NULL; + + (void) ic; + + saved_intcon = getSet (&critical_temps); + if (!saved_intcon) + { + fprintf (stderr, "Critical section left, but none entered -- ignoring for now.\n"); + return; + } // if + + emitpcode (POC_BTFSC, popCopyGPR2Bit (pCodeOpCopy (saved_intcon), 7)); + emitpcode (POC_BSF, popCopyGPR2Bit (popCopyReg (&pc_intcon), 7)); + popReleaseTempReg (saved_intcon); +} + /*-----------------------------------------------------------------*/ /* genLabel - generates a label */ /*-----------------------------------------------------------------*/ -static void genLabel (iCode *ic) +static void +genLabel (iCode * ic) { - FENTRY; + FENTRY; - /* special case never generate */ - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if (IC_LABEL(ic) == entryLabel) - return ; + /* special case never generate */ + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + if (IC_LABEL (ic) == entryLabel) + return; - emitpLabel(IC_LABEL(ic)->key); - pic14_emitcode("","_%05d_DS_:",(IC_LABEL(ic)->key+100 + labelOffset)); + emitpLabel (IC_LABEL (ic)->key); + pic14_emitcode ("", "_%05d_DS_:", labelKey2num (IC_LABEL (ic)->key + labelOffset)); } /*-----------------------------------------------------------------*/ /* genGoto - generates a goto */ /*-----------------------------------------------------------------*/ //tsd -static void genGoto (iCode *ic) +static void +genGoto (iCode * ic) { - FENTRY; + FENTRY; - emitpcode(POC_GOTO,popGetLabel(IC_LABEL(ic)->key)); - pic14_emitcode ("goto","_%05d_DS_",(IC_LABEL(ic)->key+100)+labelOffset); + emitpcode (POC_GOTO, popGetLabel (IC_LABEL (ic)->key)); + pic14_emitcode ("goto", "_%05d_DS_", labelKey2num (IC_LABEL (ic)->key + labelOffset)); } /*-----------------------------------------------------------------*/ /* genMultbits :- multiplication of bits */ /*-----------------------------------------------------------------*/ -static void genMultbits (operand *left, - operand *right, - operand *result) -{ - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - if(!pic14_sameRegs(AOP(result),AOP(right))) - emitpcode(POC_BSF, popGet(AOP(result),0)); - - emitpcode(POC_BTFSC,popGet(AOP(right),0)); - emitpcode(POC_BTFSS,popGet(AOP(left),0)); - emitpcode(POC_BCF, popGet(AOP(result),0)); +static void +genMultbits (operand * left, operand * right, operand * result) +{ + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + + if (!pic14_sameRegs (AOP (result), AOP (right))) + emitpcode (POC_BSF, popGet (AOP (result), 0)); + + emitpcode (POC_BTFSC, popGet (AOP (right), 0)); + emitpcode (POC_BTFSS, popGet (AOP (left), 0)); + emitpcode (POC_BCF, popGet (AOP (result), 0)); } @@ -2628,379 +2801,374 @@ /*-----------------------------------------------------------------*/ /* genMultOneByte : 8 bit multiplication & division */ /*-----------------------------------------------------------------*/ -static void genMultOneByte (operand *left, - operand *right, - operand *result) +static void +genMultOneByte (operand * left, operand * right, operand * result) { - char *func[] = { NULL, "__mulchar", "__mulint", NULL, "__mullong" }; + char *func[] = { NULL, "__mulchar", "__mulint", NULL, "__mullong" }; - // symbol *lbl ; - int size,offset,i; + // symbol *lbl ; + int size, offset, i; - FENTRY; + FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - DEBUGpic14_AopType(__LINE__,left,right,result); - DEBUGpic14_AopTypeSign(__LINE__,left,right,result); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + DEBUGpic14_AopType (__LINE__, left, right, result); + DEBUGpic14_AopTypeSign (__LINE__, left, right, result); - /* (if two literals, the value is computed before) */ - /* if one literal, literal on the right */ - if (AOP_TYPE(left) == AOP_LIT){ - operand *t = right; - right = left; - left = t; + /* (if two literals, the value is computed before) */ + /* if one literal, literal on the right */ + if (AOP_TYPE (left) == AOP_LIT) + { + operand *t = right; + right = left; + left = t; } - assert (AOP_SIZE(left) == AOP_SIZE(right)); - - size = min(AOP_SIZE(result),AOP_SIZE(left)); - offset = Gstack_base_addr - (2*size - 1); + assert (AOP_SIZE (left) == AOP_SIZE (right)); - /* pass right operand as argument */ - for (i=0; i < size; i++) - { - mov2w (AOP(right), i); - emitpcode(POC_MOVWF, popRegFromIdx (++offset)); - } // for + size = min (AOP_SIZE (result), AOP_SIZE (left)); + offset = Gstack_base_addr - (2 * size - 1); - /* pass left operand as argument */ - for (i=0; i < size; i++) + /* pass right operand as argument */ + for (i = 0; i < size; i++) { - mov2w (AOP(left), i); - if (i != size-1) emitpcode(POC_MOVWF, popRegFromIdx (++offset)); - } // for - assert (offset == Gstack_base_addr); - - /* call library routine */ - assert (size > 0 && size <= 4); - call_libraryfunc (func[size]); - - /* assign result */ - movwf (AOP(result), size-1); - for (i=0; i < size - 1; i++) - { - emitpcode(POC_MOVFW, popRegFromIdx (Gstack_base_addr - i)); - movwf (AOP(result), size - 2 - i); - } // for + mov2w (AOP (right), i); + emitpcode (POC_MOVWF, popRegFromIdx (++offset)); + } // for + + /* pass left operand as argument */ + for (i = 0; i < size; i++) + { + mov2w (AOP (left), i); + if (i != size - 1) + emitpcode (POC_MOVWF, popRegFromIdx (++offset)); + } // for + assert (offset == Gstack_base_addr); + + /* call library routine */ + assert (size > 0 && size <= 4); + call_libraryfunc (func[size]); + + /* assign result */ + movwf (AOP (result), size - 1); + for (i = 0; i < size - 1; i++) + { + emitpcode (POC_MOVFW, popRegFromIdx (Gstack_base_addr - i)); + movwf (AOP (result), size - 2 - i); + } // for - /* now (zero-/sign) extend the result to its size */ - addSign (result, AOP_SIZE(left), !SPEC_USIGN(operandType(result))); + /* now (zero-/sign) extend the result to its size */ + addSign (result, AOP_SIZE (left), !SPEC_USIGN (operandType (result))); } /*-----------------------------------------------------------------*/ /* genMult - generates code for multiplication */ /*-----------------------------------------------------------------*/ -static void genMult (iCode *ic) +static void +genMult (iCode * ic) { - operand *left = IC_LEFT(ic); - operand *right = IC_RIGHT(ic); - operand *result= IC_RESULT(ic); + operand *left = IC_LEFT (ic); + operand *right = IC_RIGHT (ic); + operand *result = IC_RESULT (ic); - FENTRY; + FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* assign the amsops */ - aopOp (left,ic,FALSE); - aopOp (right,ic,FALSE); - aopOp (result,ic,TRUE); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* assign the amsops */ + aopOp (left, ic, FALSE); + aopOp (right, ic, FALSE); + aopOp (result, ic, TRUE); - DEBUGpic14_AopType(__LINE__,left,right,result); + DEBUGpic14_AopType (__LINE__, left, right, result); - /* special cases first */ - /* both are bits */ - if (AOP_TYPE(left) == AOP_CRY && - AOP_TYPE(right)== AOP_CRY) { - genMultbits(left,right,result); - goto release ; + /* special cases first */ + /* both are bits */ + if (AOP_TYPE (left) == AOP_CRY && AOP_TYPE (right) == AOP_CRY) + { + genMultbits (left, right, result); + goto release; } - /* if both are of size == 1 */ - if (AOP_SIZE(left) == 1 && - AOP_SIZE(right) == 1 ) { - genMultOneByte(left,right,result); - goto release ; + /* if both are of size == 1 */ + if (AOP_SIZE (left) == 1 && AOP_SIZE (right) == 1) + { + genMultOneByte (left, right, result); + goto release; } - /* should have been converted to function call */ - assert(0) ; + /* should have been converted to function call */ + assert (0); -release : - freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(result,NULL,ic,TRUE); +release: + freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genDivbits :- division of bits */ /*-----------------------------------------------------------------*/ -static void genDivbits (operand *left, - operand *right, - operand *result) +static void +genDivbits (operand * left, operand * right, operand * result) { - char *l; + char *l; - FENTRY; - - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* the result must be bit */ - pic14_emitcode("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE)); - l = aopGet(AOP(left),0,FALSE,FALSE); - - MOVA(l); + FENTRY; - pic14_emitcode("div","ab"); - pic14_emitcode("rrc","a"); - aopPut(AOP(result),"c",0); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* the result must be bit */ + pic14_emitcode ("mov", "b,%s", aopGet (AOP (right), 0, FALSE, FALSE)); + l = aopGet (AOP (left), 0, FALSE, FALSE); + + MOVA (l); + + pic14_emitcode ("div", "ab"); + pic14_emitcode ("rrc", "a"); + aopPut (AOP (result), "c", 0); } /*-----------------------------------------------------------------*/ /* genDivOneByte : 8 bit division */ /*-----------------------------------------------------------------*/ -static void genDivOneByte (operand *left, - operand *right, - operand *result) -{ - int size; - int sign; - - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - assert (AOP_SIZE(right) == 1); - assert (AOP_SIZE(left) == 1); - - size = min(AOP_SIZE(result),AOP_SIZE(left)); - sign = !(SPEC_USIGN(operandType(left)) - && SPEC_USIGN(operandType(right))); - - if (AOP_TYPE(right) == AOP_LIT) - { - /* XXX: might add specialized code */ - } - - if (!sign) - { - /* unsigned division */ - #if 1 - mov2w(AOP(right),0); - emitpcode(POC_MOVWF, popRegFromIdx(Gstack_base_addr)); - mov2w(AOP(left),0); - call_libraryfunc("__divuchar"); - movwf(AOP(result),0); - #else - pCodeOp *temp; - symbol *lbl; - - temp = popGetTempReg(); - lbl = newiTempLabel(NULL); - - /* XXX: improve this naive approach: - [result] = [a] / [b] - ::= [result] = 0; while ([a] > [b]) do [a] -= [b]; [result]++ done - - In PIC assembler: - movf left,W - movwf temp // temp <-- left - movf right,W // W <-- right - clrf result - label1: - incf result - subwf temp,F // temp <-- temp - W - skipNC // subwf clears CARRY (i.e. sets BORROW) if temp < W - goto label1 - decf result // we just subtract once too often - */ - - /* XXX: This loops endlessly on DIVIDE BY ZERO */ - /* We need 1..128 iterations of the loop body (`4 / 5' .. `255 / 2'). */ - - mov2w(AOP(left),0); - emitpcode(POC_MOVWF, temp); - mov2w(AOP(right),0); - emitpcode(POC_CLRF, popGet(AOP(result),0)); - - emitpLabel(lbl->key); - emitpcode(POC_INCF, popGet(AOP(result),0)); - emitpcode(POC_SUBWF, temp); - emitSKPNC; - emitpcode(POC_GOTO, popGetLabel(lbl->key)); - emitpcode(POC_DECF, popGet(AOP(result),0)); - popReleaseTempReg(temp); - #endif - } - else - { - /* signed division */ - mov2w(AOP(right),0); - emitpcode(POC_MOVWF, popRegFromIdx(Gstack_base_addr)); - mov2w(AOP(left),0); - call_libraryfunc("__divschar"); - movwf(AOP(result),0); +static void +genDivOneByte (operand * left, operand * right, operand * result) +{ + int sign; + + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + + assert (AOP_SIZE (right) == 1); + assert (AOP_SIZE (left) == 1); + + sign = !(SPEC_USIGN (operandType (left)) && SPEC_USIGN (operandType (right))); + + if (AOP_TYPE (right) == AOP_LIT) + { + /* XXX: might add specialized code */ + } + + if (!sign) + { + /* unsigned division */ +#if 1 + mov2w (AOP (right), 0); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr)); + mov2w (AOP (left), 0); + call_libraryfunc ("__divuchar"); + movwf (AOP (result), 0); +#else + pCodeOp *temp; + symbol *lbl; + + temp = popGetTempReg (); + lbl = newiTempLabel (NULL); + + /* XXX: improve this naive approach: + [result] = [a] / [b] + ::= [result] = 0; while ([a] > [b]) do [a] -= [b]; [result]++ done + + In PIC assembler: + movf left,W + movwf temp // temp <-- left + movf right,W // W <-- right + clrf result + label1: + incf result + subwf temp,F // temp <-- temp - W + skipNC // subwf clears CARRY (i.e. sets BORROW) if temp < W + goto label1 + decf result // we just subtract once too often + */ + + /* XXX: This loops endlessly on DIVIDE BY ZERO */ + /* We need 1..128 iterations of the loop body (`4 / 5' .. `255 / 2'). */ + + mov2w (AOP (left), 0); + emitpcode (POC_MOVWF, temp); + mov2w (AOP (right), 0); + emitpcode (POC_CLRF, popGet (AOP (result), 0)); + + emitpLabel (lbl->key); + emitpcode (POC_INCF, popGet (AOP (result), 0)); + emitpcode (POC_SUBWF, temp); + emitSKPNC; + emitpcode (POC_GOTO, popGetLabel (lbl->key)); + emitpcode (POC_DECF, popGet (AOP (result), 0)); + popReleaseTempReg (temp); +#endif + } + else + { + /* signed division */ + mov2w (AOP (right), 0); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr)); + mov2w (AOP (left), 0); + call_libraryfunc ("__divschar"); + movwf (AOP (result), 0); } - /* now performed the signed/unsigned division -- extend result */ - addSign(result, 1, sign); + /* now performed the signed/unsigned division -- extend result */ + addSign (result, 1, sign); } /*-----------------------------------------------------------------*/ /* genDiv - generates code for division */ /*-----------------------------------------------------------------*/ -static void genDiv (iCode *ic) +static void +genDiv (iCode * ic) { - operand *left = IC_LEFT(ic); - operand *right = IC_RIGHT(ic); - operand *result= IC_RESULT(ic); - - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* assign the amsops */ - aopOp (left,ic,FALSE); - aopOp (right,ic,FALSE); - aopOp (result,ic,TRUE); - - /* special cases first */ - /* both are bits */ - if (AOP_TYPE(left) == AOP_CRY && - AOP_TYPE(right)== AOP_CRY) { - genDivbits(left,right,result); - goto release ; - } - - /* if both are of size == 1 */ - if (AOP_SIZE(left) == 1 && - AOP_SIZE(right) == 1 ) { - genDivOneByte(left,right,result); - goto release ; - } - - /* should have been converted to function call */ - assert(0); -release : - freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(result,NULL,ic,TRUE); + operand *left = IC_LEFT (ic); + operand *right = IC_RIGHT (ic); + operand *result = IC_RESULT (ic); + + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* assign the amsops */ + aopOp (left, ic, FALSE); + aopOp (right, ic, FALSE); + aopOp (result, ic, TRUE); + + /* special cases first */ + /* both are bits */ + if (AOP_TYPE (left) == AOP_CRY && AOP_TYPE (right) == AOP_CRY) + { + genDivbits (left, right, result); + goto release; + } + + /* if both are of size == 1 */ + if (AOP_SIZE (left) == 1 && AOP_SIZE (right) == 1) + { + genDivOneByte (left, right, result); + goto release; + } + + /* should have been converted to function call */ + assert (0); +release: + freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genModOneByte : 8 bit modulus */ /*-----------------------------------------------------------------*/ -static void genModOneByte (operand *left, - operand *right, - operand *result) +static void +genModOneByte (operand * left, operand * right, operand * result) { - int size; - int sign; + int sign; - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - assert (AOP_SIZE(right) == 1); - assert (AOP_SIZE(left) == 1); + assert (AOP_SIZE (right) == 1); + assert (AOP_SIZE (left) == 1); - size = min(AOP_SIZE(result),AOP_SIZE(left)); - sign = !(SPEC_USIGN(operandType(left)) - && SPEC_USIGN(operandType(right))); + sign = !(SPEC_USIGN (operandType (left)) && SPEC_USIGN (operandType (right))); - if (AOP_TYPE(right) == AOP_LIT) + if (AOP_TYPE (right) == AOP_LIT) { - /* XXX: might add specialized code */ + /* XXX: might add specialized code */ } - if (!sign) + if (!sign) { - /* unsigned division */ - #if 1 - mov2w(AOP(right),0); - emitpcode(POC_MOVWF, popRegFromIdx(Gstack_base_addr)); - mov2w(AOP(left),0); - call_libraryfunc("__moduchar"); - movwf(AOP(result),0); - #else - pCodeOp *temp; - symbol *lbl; - - lbl = newiTempLabel(NULL); + /* unsigned division */ +#if 1 + mov2w (AOP (right), 0); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr)); + mov2w (AOP (left), 0); + call_libraryfunc ("__moduchar"); + movwf (AOP (result), 0); +#else + pCodeOp *temp; + symbol *lbl; - assert(!pic14_sameRegs(AOP(right),AOP(result))); + lbl = newiTempLabel (NULL); - /* XXX: improve this naive approach: - [result] = [a] % [b] - ::= [result] = [a]; while ([result] > [b]) do [result] -= [b]; done + assert (!pic14_sameRegs (AOP (right), AOP (result))); - In PIC assembler: - movf left,W - movwf result // result <-- left - movf right,W // W <-- right - label1: - subwf result,F // result <-- result - W - skipNC // subwf clears CARRY (i.e. sets BORROW) if result < W - goto label1 - addwf result, F // we just subtract once too often - */ + /* XXX: improve this naive approach: + [result] = [a] % [b] + ::= [result] = [a]; while ([result] > [b]) do [result] -= [b]; done + + In PIC assembler: + movf left,W + movwf result // result <-- left + movf right,W // W <-- right + label1: + subwf result,F // result <-- result - W + skipNC // subwf clears CARRY (i.e. sets BORROW) if result < W + goto label1 + addwf result, F // we just subtract once too often + */ - /* XXX: This loops endlessly on DIVIDE BY ZERO */ - /* We need 1..128 iterations of the loop body (`4 % 5' .. `255 % 2'). */ + /* XXX: This loops endlessly on DIVIDE BY ZERO */ + /* We need 1..128 iterations of the loop body (`4 % 5' .. `255 % 2'). */ - if (!pic14_sameRegs(AOP(left), AOP(result))) + if (!pic14_sameRegs (AOP (left), AOP (result))) { - mov2w(AOP(left),0); - emitpcode(POC_MOVWF, popGet(AOP(result),0)); + mov2w (AOP (left), 0); + emitpcode (POC_MOVWF, popGet (AOP (result), 0)); } - mov2w(AOP(right),0); + mov2w (AOP (right), 0); - emitpLabel(lbl->key); - emitpcode(POC_SUBWF, popGet(AOP(result),0)); - emitSKPNC; - emitpcode(POC_GOTO, popGetLabel(lbl->key)); - emitpcode(POC_ADDWF, popGet(AOP(result),0)); - #endif - } - else - { - /* signed division */ - mov2w(AOP(right),0); - emitpcode(POC_MOVWF, popRegFromIdx(Gstack_base_addr)); - mov2w(AOP(left),0); - call_libraryfunc("__modschar"); - movwf(AOP(result),0); + emitpLabel (lbl->key); + emitpcode (POC_SUBWF, popGet (AOP (result), 0)); + emitSKPNC; + emitpcode (POC_GOTO, popGetLabel (lbl->key)); + emitpcode (POC_ADDWF, popGet (AOP (result), 0)); +#endif + } + else + { + /* signed division */ + mov2w (AOP (right), 0); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr)); + mov2w (AOP (left), 0); + call_libraryfunc ("__modschar"); + movwf (AOP (result), 0); } - /* now we performed the signed/unsigned modulus -- extend result */ - addSign(result, 1, sign); + /* now we performed the signed/unsigned modulus -- extend result */ + addSign (result, 1, sign); } /*-----------------------------------------------------------------*/ /* genMod - generates code for division */ /*-----------------------------------------------------------------*/ -static void genMod (iCode *ic) +static void +genMod (iCode * ic) { - operand *left = IC_LEFT(ic); - operand *right = IC_RIGHT(ic); - operand *result= IC_RESULT(ic); - - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* assign the amsops */ - aopOp (left,ic,FALSE); - aopOp (right,ic,FALSE); - aopOp (result,ic,TRUE); - - /* if both are of size == 1 */ - if (AOP_SIZE(left) == 1 && - AOP_SIZE(right) == 1 ) { - genModOneByte(left,right,result); - goto release ; - } - - /* should have been converted to function call */ - assert(0); - -release : - freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(result,NULL,ic,TRUE); + operand *left = IC_LEFT (ic); + operand *right = IC_RIGHT (ic); + operand *result = IC_RESULT (ic); + + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* assign the amsops */ + aopOp (left, ic, FALSE); + aopOp (right, ic, FALSE); + aopOp (result, ic, TRUE); + + /* if both are of size == 1 */ + if (AOP_SIZE (left) == 1 && AOP_SIZE (right) == 1) + { + genModOneByte (left, right, result); + goto release; + } + + /* should have been converted to function call */ + assert (0); + +release: + freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ @@ -3009,66 +3177,72 @@ /* note: May need to add parameter to indicate when a variable is in bit space. */ -static void genIfxJump (iCode *ic, char *jval) +static void +genIfxJump (iCode * ic, char *jval) { - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* if true label then we jump if condition - supplied is true */ - if ( IC_TRUE(ic) ) { + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* if true label then we jump if condition + supplied is true */ + if (IC_TRUE (ic)) + { - if(strcmp(jval,"a") == 0) - emitSKPZ; - else if (strcmp(jval,"c") == 0) - emitSKPC; - else { - DEBUGpic14_emitcode ("; ***","%d - assuming %s is in bit space",__LINE__,jval); - emitpcode(POC_BTFSC, newpCodeOpBit(jval,-1,1)); + if (strcmp (jval, "a") == 0) + emitSKPZ; + else if (strcmp (jval, "c") == 0) + emitSKPC; + else + { + DEBUGpic14_emitcode ("; ***", "%d - assuming %s is in bit space", __LINE__, jval); + emitpcode (POC_BTFSC, newpCodeOpBit (jval, -1, 1)); } - emitpcode(POC_GOTO,popGetLabel(IC_TRUE(ic)->key)); - pic14_emitcode(" goto","_%05d_DS_",IC_TRUE(ic)->key+100 + labelOffset); + emitpcode (POC_GOTO, popGetLabel (IC_TRUE (ic)->key)); + pic14_emitcode (" goto", "_%05d_DS_", labelKey2num (IC_TRUE (ic)->key + labelOffset)); } - else { - /* false label is present */ - if(strcmp(jval,"a") == 0) - emitSKPNZ; - else if (strcmp(jval,"c") == 0) - emitSKPNC; - else { - DEBUGpic14_emitcode ("; ***","%d - assuming %s is in bit space",__LINE__,jval); - emitpcode(POC_BTFSS, newpCodeOpBit(jval,-1,1)); + else + { + /* false label is present */ + if (strcmp (jval, "a") == 0) + emitSKPNZ; + else if (strcmp (jval, "c") == 0) + emitSKPNC; + else + { + DEBUGpic14_emitcode ("; ***", "%d - assuming %s is in bit space", __LINE__, jval); + emitpcode (POC_BTFSS, newpCodeOpBit (jval, -1, 1)); } - emitpcode(POC_GOTO,popGetLabel(IC_FALSE(ic)->key)); - pic14_emitcode(" goto","_%05d_DS_",IC_FALSE(ic)->key+100 + labelOffset); + emitpcode (POC_GOTO, popGetLabel (IC_FALSE (ic)->key)); + pic14_emitcode (" goto", "_%05d_DS_", labelKey2num (IC_FALSE (ic)->key + labelOffset)); } - /* mark the icode as generated */ - ic->generated = 1; + /* mark the icode as generated */ + ic->generated = 1; } /*-----------------------------------------------------------------*/ /* genSkipc */ /*-----------------------------------------------------------------*/ -static void genSkipc(resolvedIfx *rifx) +static void +genSkipc (resolvedIfx * rifx) { - FENTRY; - if(!rifx) - return; + FENTRY; + if (!rifx) + return; - if(rifx->condition) - emitSKPNC; - else - emitSKPC; + if (rifx->condition) + emitSKPNC; + else + emitSKPC; - emitpcode(POC_GOTO,popGetLabel(rifx->lbl->key)); - emitpComment ("%s:%u: created from rifx:%p", __FUNCTION__, __LINE__, rifx); - rifx->generated = 1; + emitpcode (POC_GOTO, popGetLabel (rifx->lbl->key)); + emitpComment ("%s:%u: created from rifx:%p", __FUNCTION__, __LINE__, rifx); + rifx->generated = 1; } #define isAOP_REGlike(x) (AOP_TYPE(x) == AOP_REG || AOP_TYPE(x) == AOP_DIR || AOP_TYPE(x) == AOP_PCODE) @@ -3080,13 +3254,17 @@ /* aop (if it's NOT a literal) or from lit (if */ /* aop is a literal) */ /*-----------------------------------------------------------------*/ -static void pic14_mov2w_regOrLit (asmop *aop, unsigned long lit, int offset) +static void +pic14_mov2w_regOrLit (asmop * aop, unsigned long lit, int offset) { - if (aop->type == AOP_LIT) { - emitpcode (POC_MOVLW, popGetLit((lit >> (offset*8)) & 0x00FF)); - } else { - emitpcode (POC_MOVFW, popGet (aop, offset)); - } + if (aop->type == AOP_LIT) + { + emitpcode (POC_MOVLW, popGetLit ((lit >> (offset * 8)) & 0x00FF)); + } + else + { + emitpcode (POC_MOVFW, popGet (aop, offset)); + } } /* genCmp performs a left < right comparison, stores @@ -3097,8 +3275,8 @@ * "B[CS]F STATUS,0; BTFS[CS] STATUS,0" * which should be optmized by the peephole * optimizer - RN 2005-01-01 */ -static void genCmp (operand *left,operand *right, - operand *result, iCode *ifx, int sign) +static void +genCmp (operand * left, operand * right, operand * result, iCode * ifx, int sign) { resolvedIfx rIfx; int size; @@ -3141,10 +3319,10 @@ pic16_emitpcode (POC_BTFSS, pic16_popGet (AOP (left), 0)); // {0,1} < 0 is false --> clear C by NOT skipping the next instruction pic16_emitpcode (POC_BTFSS, pic16_popCopyGPR2Bit (pic16_popGet (AOP (right), 0), PCORB (pcright)->bit)); - emitCLRC; // only skipped for left=0 && right=1 + emitCLRC; // only skipped for left=0 && right=1 goto correct_result_in_carry; - } // if + } // if #endif /************************************************* @@ -3167,7 +3345,7 @@ else emitSETC; goto correct_result_in_carry; - } // if + } // if // This fails for lit = 0xFF (unsigned) AND lit = 0x7F (signed), // that's why we handled it above. @@ -3177,15 +3355,15 @@ left = right; right = dummy; - performedLt ^= 1; // instead of "left < right" we check for "right >= left+1, i.e. "right < left+1" + performedLt ^= 1; // instead of "left < right" we check for "right >= left+1, i.e. "right < left+1" } else if (isAOP_LIT (right)) { lit = ulFromVal (AOP (right)->aopu.aop_lit); - } // if + } // if - assert (isAOP_REGlike (left)); // left must be register or the like - assert (isAOP_REGlike (right) || isAOP_LIT (right)); // right may be register-like or a literal + assert (isAOP_REGlike (left)); // left must be register or the like + assert (isAOP_REGlike (right) || isAOP_LIT (right)); // right may be register-like or a literal /************************************************* * special cases go here * @@ -3196,7 +3374,7 @@ if (!sign) { // unsigned comparison to a literal - DEBUGpc ("unsigned compare: left %s lit(0x%X=%lu), size=%d", performedLt ? "<" : ">=", lit, lit, size+1); + DEBUGpc ("unsigned compare: left %s lit(0x%X=%lu), size=%d", performedLt ? "<" : ">=", lit, lit, size + 1); if (lit == 0) { // unsigned left < 0? always false @@ -3210,8 +3388,9 @@ else { // signed comparison to a literal - DEBUGpc ("signed compare: left %s lit(0x%X=%ld), size=%d, mask=%x", performedLt ? "<" : ">=", lit, lit, size+1, mask); - if ((lit & mask) == ((0x80 << (size*8)) & mask)) + DEBUGpc ("signed compare: left %s lit(0x%X=%ld), size=%d, mask=%x", performedLt ? "<" : ">=", lit, lit, size + 1, + mask); + if ((lit & mask) == ((0x80 << (size * 8)) & mask)) { // signed left < 0x80000000? always false if (performedLt) @@ -3234,8 +3413,8 @@ emitSETC; goto correct_result_in_carry; } - } // if (!sign) - } // right is literal + } // if (!sign) + } // right is literal /************************************************* * perform a general case comparison * @@ -3256,13 +3435,13 @@ if (isAOP_LIT (right)) { // left >= LIT <-> LIT-left <= 0 <-> LIT-left == 0 OR !(LIT-left >= 0) - unsigned char litbyte = (lit >> (8*size)) & 0xFF; + unsigned char litbyte = (lit >> (8 * size)) & 0xFF; if (litbyte == 0x80) { // left >= 0x80 -- always true, but more bytes to come mov2w (AOP (left), size); - emitpcode (POC_XORLW, popGetLit (0x80)); // set ZERO flag + emitpcode (POC_XORLW, popGetLit (0x80)); // set ZERO flag emitSETC; } else @@ -3271,7 +3450,7 @@ mov2w (AOP (left), size); emitpcode (POC_ADDLW, popGetLit (0x80)); emitpcode (POC_ADDLW, popGetLit ((0x100 - (litbyte + 0x80)) & 0x00FF)); - } // if + } // if } else { @@ -3284,7 +3463,7 @@ emitpcode (POC_SUBFW, pctemp); popReleaseTempReg (pctemp); } - } // if (!sign) + } // if (!sign) // compare remaining bytes (treat as unsigned case from above) templbl = newiTempLabel (NULL); @@ -3296,7 +3475,7 @@ emitpcode (POC_GOTO, popGetLabel (templbl->key)); pic14_mov2w_regOrLit (AOP (right), lit, offs); emitpcode (POC_SUBFW, popGet (AOP (left), offs)); - } // while (offs) + } // while (offs) emitpLabel (templbl->key); goto result_in_carry; @@ -3314,7 +3493,7 @@ invert_result = 1; // value will be used in the following genSkipc () rIfx.condition ^= 1; - } // if + } // if correct_result_in_carry: @@ -3326,7 +3505,7 @@ while (size--) { emitpcode (POC_CLRF, popGet (AOP (result), size)); - } // while + } // while if (invert_result) { emitSKPC; @@ -3339,9 +3518,9 @@ { /* Result is expected to be in CARRY by genSkipc () below. */ emitpcode (POC_RRFW, popGet (AOP (result), 0)); - } // if - } // if - } // if (result) + } // if + } // if + } // if (result) // perform conditional jump if (ifx) @@ -3349,275 +3528,249 @@ //DEBUGpc ("generate control flow"); genSkipc (&rIfx); ifx->generated = 1; - } // if + } // if } /*-----------------------------------------------------------------*/ /* genCmpGt :- greater than comparison */ /*-----------------------------------------------------------------*/ -static void genCmpGt (iCode *ic, iCode *ifx) +static void +genCmpGt (iCode * ic, iCode * ifx) { - operand *left, *right, *result; - sym_link *letype , *retype; - int sign ; - - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - left = IC_LEFT(ic); - right= IC_RIGHT(ic); - result = IC_RESULT(ic); - - letype = getSpec(operandType(left)); - retype =getSpec(operandType(right)); - sign = !(SPEC_USIGN(letype) | SPEC_USIGN(retype)); - /* assign the amsops */ - aopOp (left,ic,FALSE); - aopOp (right,ic,FALSE); - aopOp (result,ic,TRUE); - - genCmp(right, left, result, ifx, sign); - - freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(result,NULL,ic,TRUE); + operand *left, *right, *result; + sym_link *letype, *retype; + int sign; + + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + left = IC_LEFT (ic); + right = IC_RIGHT (ic); + result = IC_RESULT (ic); + + sign = 0; + if (IS_SPEC (operandType (left)) && IS_SPEC (operandType (right))) + { + letype = getSpec (operandType (left)); + retype = getSpec (operandType (right)); + sign = !(SPEC_USIGN (letype) | SPEC_USIGN (retype)); + } + + /* assign the amsops */ + aopOp (left, ic, FALSE); + aopOp (right, ic, FALSE); + aopOp (result, ic, TRUE); + + genCmp (right, left, result, ifx, sign); + + freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genCmpLt - less than comparisons */ /*-----------------------------------------------------------------*/ -static void genCmpLt (iCode *ic, iCode *ifx) +static void +genCmpLt (iCode * ic, iCode * ifx) { - operand *left, *right, *result; - sym_link *letype , *retype; - int sign ; - - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - left = IC_LEFT(ic); - right= IC_RIGHT(ic); - result = IC_RESULT(ic); - - letype = getSpec(operandType(left)); - retype =getSpec(operandType(right)); - sign = !(SPEC_USIGN(letype) | SPEC_USIGN(retype)); - - /* assign the amsops */ - aopOp (left,ic,FALSE); - aopOp (right,ic,FALSE); - aopOp (result,ic,TRUE); - - genCmp(left, right, result, ifx, sign); - - freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(result,NULL,ic,TRUE); + operand *left, *right, *result; + sym_link *letype, *retype; + int sign; + + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + left = IC_LEFT (ic); + right = IC_RIGHT (ic); + result = IC_RESULT (ic); + + sign = 0; + if (IS_SPEC (operandType (left)) && IS_SPEC (operandType (right))) + { + letype = getSpec (operandType (left)); + retype = getSpec (operandType (right)); + sign = !(SPEC_USIGN (letype) | SPEC_USIGN (retype)); + } + + /* assign the amsops */ + aopOp (left, ic, FALSE); + aopOp (right, ic, FALSE); + aopOp (result, ic, TRUE); + + genCmp (left, right, result, ifx, sign); + + freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genCmpEq - generates code for equal to */ /*-----------------------------------------------------------------*/ -static void genCmpEq (iCode *ic, iCode *ifx) +static void +genCmpEq (iCode * ic, iCode * ifx) { operand *left, *right, *result; int size; symbol *false_label; FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - if(ifx) - DEBUGpic14_emitcode ("; ifx is non-null",""); + if (ifx) + DEBUGpic14_emitcode ("; ifx is non-null", ""); else - DEBUGpic14_emitcode ("; ifx is null",""); + DEBUGpic14_emitcode ("; ifx is null", ""); - aopOp((left=IC_LEFT(ic)),ic,FALSE); - aopOp((right=IC_RIGHT(ic)),ic,FALSE); - aopOp((result=IC_RESULT(ic)),ic,TRUE); + aopOp ((left = IC_LEFT (ic)), ic, FALSE); + aopOp ((right = IC_RIGHT (ic)), ic, FALSE); + aopOp ((result = IC_RESULT (ic)), ic, TRUE); - DEBUGpic14_AopType(__LINE__,left,right,result); + DEBUGpic14_AopType (__LINE__, left, right, result); /* if literal, move literal to right */ - if (op_isLitLike (IC_LEFT(ic))) { - operand *tmp = right ; - right = left; - left = tmp; - } + if (op_isLitLike (IC_LEFT (ic))) + { + operand *tmp = right; + right = left; + left = tmp; + } false_label = NULL; - if (ifx && !IC_TRUE(ifx)) - { - assert (IC_FALSE(ifx)); - false_label = IC_FALSE(ifx); - } + if (ifx && !IC_TRUE (ifx)) + { + assert (IC_FALSE (ifx)); + false_label = IC_FALSE (ifx); + } - size = min(AOP_SIZE(left),AOP_SIZE(right)); - assert(!pic14_sameRegs(AOP(result),AOP(left))); - assert(!pic14_sameRegs(AOP(result),AOP(right))); + size = min (AOP_SIZE (left), AOP_SIZE (right)); + assert (!pic14_sameRegs (AOP (result), AOP (left))); + assert (!pic14_sameRegs (AOP (result), AOP (right))); /* assume left != right */ { int i; - for (i=0; i < AOP_SIZE(result); i++) - { - emitpcode(POC_CLRF, popGet(AOP(result),i)); - } + for (i = 0; i < AOP_SIZE (result); i++) + { + emitpcode (POC_CLRF, popGet (AOP (result), i)); + } } - if (AOP_TYPE(right) == AOP_LIT) - { - unsigned long lit = ulFromVal (AOP(right)->aopu.aop_lit); - int i; - size = AOP_SIZE(left); - assert(!op_isLitLike(left)); - - switch (lit) + if (AOP_TYPE (right) == AOP_LIT) { - case 0: - mov2w(AOP(left), 0); - for (i=1; i < size; i++) - emitpcode(POC_IORFW,popGet(AOP(left),i)); - /* now Z is set iff `left == right' */ - emitSKPZ; - if (!false_label) false_label = newiTempLabel(NULL); - emitpcode(POC_GOTO, popGetLabel(false_label->key)); - break; - - default: - for (i=0; i < size; i++) - { - mov2w(AOP(left),i); - emitpcode(POC_XORLW, popGetLit(lit >> (8*i))); - /* now Z is cleared if `left != right' */ - emitSKPZ; - if (!false_label) false_label = newiTempLabel(NULL); - emitpcode(POC_GOTO, popGetLabel(false_label->key)); - } // for i - break; - } // switch (lit) - } - else - { - /* right is no literal */ - int i; + unsigned long lit = ulFromVal (AOP (right)->aopu.aop_lit); + int i; + size = AOP_SIZE (left); + assert (!op_isLitLike (left)); - for (i=0; i < size; i++) + switch (lit) + { + case 0: + mov2w (AOP (left), 0); + for (i = 1; i < size; i++) + emitpcode (POC_IORFW, popGet (AOP (left), i)); + /* now Z is set iff `left == right' */ + emitSKPZ; + if (!false_label) + false_label = newiTempLabel (NULL); + emitpcode (POC_GOTO, popGetLabel (false_label->key)); + break; + + default: + for (i = 0; i < size; i++) + { + mov2w (AOP (left), i); + emitpcode (POC_XORLW, popGetLit (lit >> (8 * i))); + /* now Z is cleared if `left != right' */ + emitSKPZ; + if (!false_label) + false_label = newiTempLabel (NULL); + emitpcode (POC_GOTO, popGetLabel (false_label->key)); + } // for i + break; + } // switch (lit) + } + else { - mov2w(AOP(right),i); - emitpcode(POC_XORFW,popGet(AOP(left),i)); - /* now Z is cleared if `left != right' */ - emitSKPZ; - if (!false_label) false_label = newiTempLabel(NULL); - emitpcode(POC_GOTO, popGetLabel(false_label->key)); - } // for i - } + /* right is no literal */ + int i; + + for (i = 0; i < size; i++) + { + mov2w (AOP (right), i); + emitpcode (POC_XORFW, popGet (AOP (left), i)); + /* now Z is cleared if `left != right' */ + emitSKPZ; + if (!false_label) + false_label = newiTempLabel (NULL); + emitpcode (POC_GOTO, popGetLabel (false_label->key)); + } // for i + } /* if we reach here, left == right */ - if (AOP_SIZE(result) > 0) - { - emitpcode(POC_INCF, popGet(AOP(result),0)); - } - - if (ifx && IC_TRUE(ifx)) - { - emitpcode(POC_GOTO,popGetLabel(IC_TRUE(ifx)->key)); - } - - if (false_label && (!ifx || IC_TRUE(ifx))) - emitpLabel(false_label->key); - - if (ifx) ifx->generated = 1; - - freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(result,NULL,ic,TRUE); -} - -/*-----------------------------------------------------------------*/ -/* ifxForOp - returns the icode containing the ifx for operand */ -/*-----------------------------------------------------------------*/ -static iCode *ifxForOp ( operand *op, iCode *ic ) -{ - FENTRY; - /* if true symbol then needs to be assigned */ - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if (IS_TRUE_SYMOP(op)) - return NULL ; - - /* if this has register type condition and - the next instruction is ifx with the same operand - and live to of the operand is upto the ifx only then */ - if (ic->next && - ic->next->op == IFX && - IC_COND(ic->next)->key == op->key && - OP_SYMBOL(op)->liveTo <= ic->next->seq ) - return ic->next; - - if (ic->next && - ic->next->op == IFX && - IC_COND(ic->next)->key == op->key) { - DEBUGpic14_emitcode ("; WARNING ","%d IGNORING liveTo range in %s",__LINE__,__FUNCTION__); - return ic->next; + if (AOP_SIZE (result) > 0) + { + emitpcode (POC_INCF, popGet (AOP (result), 0)); } - DEBUGpic14_emitcode ("; NULL :(","%d",__LINE__); - if (ic->next && - ic->next->op == IFX) - DEBUGpic14_emitcode ("; ic-next"," is an IFX"); - - if (ic->next && - ic->next->op == IFX && - IC_COND(ic->next)->key == op->key) { - DEBUGpic14_emitcode ("; "," key is okay"); - DEBUGpic14_emitcode ("; "," key liveTo %d, next->seq = %d", - OP_SYMBOL(op)->liveTo, - ic->next->seq); + if (ifx && IC_TRUE (ifx)) + { + emitpcode (POC_GOTO, popGetLabel (IC_TRUE (ifx)->key)); } + if (false_label && (!ifx || IC_TRUE (ifx))) + emitpLabel (false_label->key); + + if (ifx) + ifx->generated = 1; - return NULL; + freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (result, NULL, ic, TRUE); } + /*-----------------------------------------------------------------*/ /* genAndOp - for && operation */ /*-----------------------------------------------------------------*/ -static void genAndOp (iCode *ic) +static void +genAndOp (iCode * ic) { - operand *left,*right, *result; - /* symbol *tlbl; */ + operand *left, *right, *result; + /* symbol *tlbl; */ - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* note here that && operations that are in an - if statement are taken away by backPatchLabels - only those used in arthmetic operations remain */ - aopOp((left=IC_LEFT(ic)),ic,FALSE); - aopOp((right=IC_RIGHT(ic)),ic,FALSE); - aopOp((result=IC_RESULT(ic)),ic,FALSE); - - DEBUGpic14_AopType(__LINE__,left,right,result); - - emitpcode(POC_MOVFW,popGet(AOP(left),0)); - emitpcode(POC_ANDFW,popGet(AOP(right),0)); - emitpcode(POC_MOVWF,popGet(AOP(result),0)); - - /* if both are bit variables */ - /* if (AOP_TYPE(left) == AOP_CRY && */ - /* AOP_TYPE(right) == AOP_CRY ) { */ - /* pic14_emitcode("mov","c,%s",AOP(left)->aopu.aop_dir); */ - /* pic14_emitcode("anl","c,%s",AOP(right)->aopu.aop_dir); */ - /* pic14_outBitC(result); */ - /* } else { */ - /* tlbl = newiTempLabel(NULL); */ - /* pic14_toBoolean(left); */ - /* pic14_emitcode("jz","%05d_DS_",tlbl->key+100); */ - /* pic14_toBoolean(right); */ - /* pic14_emitcode("","%05d_DS_:",tlbl->key+100); */ - /* pic14_outBitAcc(result); */ - /* } */ - - freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(result,NULL,ic,TRUE); + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* note here that && operations that are in an + if statement are taken away by backPatchLabels + only those used in arthmetic operations remain */ + aopOp ((left = IC_LEFT (ic)), ic, FALSE); + aopOp ((right = IC_RIGHT (ic)), ic, FALSE); + aopOp ((result = IC_RESULT (ic)), ic, FALSE); + + DEBUGpic14_AopType (__LINE__, left, right, result); + + emitpcode (POC_MOVFW, popGet (AOP (left), 0)); + emitpcode (POC_ANDFW, popGet (AOP (right), 0)); + emitpcode (POC_MOVWF, popGet (AOP (result), 0)); + + /* if both are bit variables */ + /* if (AOP_TYPE(left) == AOP_CRY && */ + /* AOP_TYPE(right) == AOP_CRY ) { */ + /* pic14_emitcode("mov","c,%s",AOP(left)->aopu.aop_dir); */ + /* pic14_emitcode("anl","c,%s",AOP(right)->aopu.aop_dir); */ + /* pic14_outBitC(result); */ + /* } else { */ + /* tlbl = newiTempLabel(NULL); */ + /* pic14_toBoolean(left); */ + /* pic14_emitcode("jz","%05d_DS_",labelKey2num (tlbl->key)); */ + /* pic14_toBoolean(right); */ + /* pic14_emitcode("","%05d_DS_:",labelKey2num (tlbl->key)); */ + /* pic14_outBitAcc(result); */ + /* } */ + + freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (result, NULL, ic, TRUE); } @@ -3629,840 +3782,966 @@ modified this code, but it doesn't appear to ever get called */ -static void genOrOp (iCode *ic) +static void +genOrOp (iCode * ic) { - operand *left,*right, *result; - symbol *tlbl; - int i; + operand *left, *right, *result; + symbol *tlbl; + int i; - /* note here that || operations that are in an - if statement are taken away by backPatchLabels - only those used in arthmetic operations remain */ - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - aopOp((left=IC_LEFT(ic)),ic,FALSE); - aopOp((right=IC_RIGHT(ic)),ic,FALSE); - aopOp((result=IC_RESULT(ic)),ic,FALSE); - - DEBUGpic14_AopType(__LINE__,left,right,result); - - for (i=0; i < AOP_SIZE(result); i++) - { - emitpcode(POC_CLRF, popGet(AOP(result), i)); - } // for i - - tlbl = newiTempLabel(NULL); - pic14_toBoolean(left); - emitSKPZ; - emitpcode(POC_GOTO, popGetLabel(tlbl->key)); - pic14_toBoolean(right); - emitpLabel(tlbl->key); - /* here Z is clear IFF `left || right' */ - emitSKPZ; - emitpcode(POC_INCF, popGet(AOP(result), 0)); - - freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(result,NULL,ic,TRUE); + /* note here that || operations that are in an + if statement are taken away by backPatchLabels + only those used in arthmetic operations remain */ + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + aopOp ((left = IC_LEFT (ic)), ic, FALSE); + aopOp ((right = IC_RIGHT (ic)), ic, FALSE); + aopOp ((result = IC_RESULT (ic)), ic, FALSE); + + DEBUGpic14_AopType (__LINE__, left, right, result); + + for (i = 0; i < AOP_SIZE (result); i++) + { + emitpcode (POC_CLRF, popGet (AOP (result), i)); + } // for i + + tlbl = newiTempLabel (NULL); + pic14_toBoolean (left); + emitSKPZ; + emitpcode (POC_GOTO, popGetLabel (tlbl->key)); + pic14_toBoolean (right); + emitpLabel (tlbl->key); + /* here Z is clear IFF `left || right' */ + emitSKPZ; + emitpcode (POC_INCF, popGet (AOP (result), 0)); + + freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* isLiteralBit - test if lit == 2^n */ /*-----------------------------------------------------------------*/ -static int isLiteralBit(unsigned long lit) +static int +isLiteralBit (unsigned long lit) { - unsigned long pw[32] = {1L,2L,4L,8L,16L,32L,64L,128L, - 0x100L,0x200L,0x400L,0x800L, - 0x1000L,0x2000L,0x4000L,0x8000L, - 0x10000L,0x20000L,0x40000L,0x80000L, - 0x100000L,0x200000L,0x400000L,0x800000L, - 0x1000000L,0x2000000L,0x4000000L,0x8000000L, - 0x10000000L,0x20000000L,0x40000000L,0x80000000L}; - int idx; - - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - for(idx = 0; idx < 32; idx++) - if(lit == pw[idx]) - return idx+1; - return 0; + unsigned long pw[32] = { 1L, 2L, 4L, 8L, 16L, 32L, 64L, 128L, + 0x100L, 0x200L, 0x400L, 0x800L, + 0x1000L, 0x2000L, 0x4000L, 0x8000L, + 0x10000L, 0x20000L, 0x40000L, 0x80000L, + 0x100000L, 0x200000L, 0x400000L, 0x800000L, + 0x1000000L, 0x2000000L, 0x4000000L, 0x8000000L, + 0x10000000L, 0x20000000L, 0x40000000L, 0x80000000L + }; + int idx; + + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + for (idx = 0; idx < 32; idx++) + if (lit == pw[idx]) + return idx + 1; + return 0; } /*-----------------------------------------------------------------*/ /* continueIfTrue - */ /*-----------------------------------------------------------------*/ -static void continueIfTrue (iCode *ic) +static void +continueIfTrue (iCode * ic) { - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if(IC_TRUE(ic)) + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + if (IC_TRUE (ic)) { - // Why +100?!? - emitpcode(POC_GOTO, popGetLabel(IC_TRUE(ic)->key+100)); - pic14_emitcode("ljmp","%05d_DS_",IC_FALSE(ic)->key+100); + emitpcode (POC_GOTO, popGetLabel (labelKey2num (IC_TRUE (ic)->key))); + pic14_emitcode ("ljmp", "%05d_DS_", labelKey2num (IC_FALSE (ic)->key)); } - ic->generated = 1; + ic->generated = 1; } /*-----------------------------------------------------------------*/ /* jmpIfTrue - */ /*-----------------------------------------------------------------*/ -static void jumpIfTrue (iCode *ic) +static void +jumpIfTrue (iCode * ic) { - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if(!IC_TRUE(ic)) + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + if (!IC_TRUE (ic)) { - // Why +100?!? - emitpcode(POC_GOTO, popGetLabel(IC_TRUE(ic)->key+100)); - pic14_emitcode("ljmp","%05d_DS_",IC_FALSE(ic)->key+100); + emitpcode (POC_GOTO, labelKey2num (popGetLabel (IC_TRUE (ic)->key))); + pic14_emitcode ("ljmp", "%05d_DS_", labelKey2num (IC_FALSE (ic)->key)); } - ic->generated = 1; + ic->generated = 1; } /*-----------------------------------------------------------------*/ /* jmpTrueOrFalse - */ /*-----------------------------------------------------------------*/ -static void jmpTrueOrFalse (iCode *ic, symbol *tlbl) +static void +jmpTrueOrFalse (iCode * ic, symbol * tlbl) { - FENTRY; - // ugly but optimized by peephole - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if(IC_TRUE(ic)){ - symbol *nlbl = newiTempLabel(NULL); - pic14_emitcode("sjmp","%05d_DS_",nlbl->key+100); - pic14_emitcode("","%05d_DS_:",tlbl->key+100); - pic14_emitcode("ljmp","%05d_DS_",IC_TRUE(ic)->key+100); - pic14_emitcode("","%05d_DS_:",nlbl->key+100); - } - else{ - pic14_emitcode("ljmp","%05d_DS_",IC_FALSE(ic)->key+100); - pic14_emitcode("","%05d_DS_:",tlbl->key+100); + FENTRY; + // ugly but optimized by peephole + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + if (IC_TRUE (ic)) + { + symbol *nlbl = newiTempLabel (NULL); + pic14_emitcode ("sjmp", "%05d_DS_", labelKey2num (nlbl->key)); + pic14_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key)); + pic14_emitcode ("ljmp", "%05d_DS_", labelKey2num (IC_TRUE (ic)->key)); + pic14_emitcode ("", "%05d_DS_:", labelKey2num (nlbl->key)); } - ic->generated = 1; + else + { + pic14_emitcode ("ljmp", "%05d_DS_", labelKey2num (IC_FALSE (ic)->key)); + pic14_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key)); + } + ic->generated = 1; } /*-----------------------------------------------------------------*/ /* genAnd - code for and */ /*-----------------------------------------------------------------*/ -static void genAnd (iCode *ic, iCode *ifx) +static void +genAnd (iCode * ic, iCode * ifx) { - operand *left, *right, *result; - int size, offset=0; - unsigned long lit = 0L; - int bytelit = 0; - resolvedIfx rIfx; - - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - aopOp((left = IC_LEFT(ic)),ic,FALSE); - aopOp((right= IC_RIGHT(ic)),ic,FALSE); - aopOp((result=IC_RESULT(ic)),ic,TRUE); - - resolveIfx(&rIfx,ifx); - - /* if left is a literal & right is not then exchange them */ - if ((AOP_TYPE(left) == AOP_LIT && AOP_TYPE(right) != AOP_LIT) || - AOP_NEEDSACC(left)) { - operand *tmp = right ; - right = left; - left = tmp; - } - - /* if result = right then exchange them */ - if(pic14_sameRegs(AOP(result),AOP(right))){ - operand *tmp = right ; - right = left; - left = tmp; - } - - /* if right is bit then exchange them */ - if (AOP_TYPE(right) == AOP_CRY && - AOP_TYPE(left) != AOP_CRY){ - operand *tmp = right ; - right = left; - left = tmp; - } - if(AOP_TYPE(right) == AOP_LIT) - lit = ulFromVal (AOP(right)->aopu.aop_lit); - - size = AOP_SIZE(result); - - DEBUGpic14_AopType(__LINE__,left,right,result); - - // if(bit & yy) - // result = bit & yy; - if (AOP_TYPE(left) == AOP_CRY){ - // c = bit & literal; - if(AOP_TYPE(right) == AOP_LIT){ - if(lit & 1) { - if(size && pic14_sameRegs(AOP(result),AOP(left))) - // no change - goto release; - pic14_emitcode("mov","c,%s",AOP(left)->aopu.aop_dir); - } else { - // bit(result) = 0; - if(size && (AOP_TYPE(result) == AOP_CRY)){ - pic14_emitcode("clr","%s",AOP(result)->aopu.aop_dir); - goto release; + operand *left, *right, *result; + int size, offset = 0; + unsigned long lit = 0L; + int bytelit = 0; + resolvedIfx rIfx; + + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + aopOp ((left = IC_LEFT (ic)), ic, FALSE); + aopOp ((right = IC_RIGHT (ic)), ic, FALSE); + aopOp ((result = IC_RESULT (ic)), ic, TRUE); + + resolveIfx (&rIfx, ifx); + + /* if left is a literal & right is not then exchange them */ + if ((AOP_TYPE (left) == AOP_LIT && AOP_TYPE (right) != AOP_LIT) || AOP_NEEDSACC (left)) + { + operand *tmp = right; + right = left; + left = tmp; + } + + /* if result = right then exchange them */ + if (pic14_sameRegs (AOP (result), AOP (right))) + { + operand *tmp = right; + right = left; + left = tmp; + } + + /* if right is bit then exchange them */ + if (AOP_TYPE (right) == AOP_CRY && AOP_TYPE (left) != AOP_CRY) + { + operand *tmp = right; + right = left; + left = tmp; + } + if (AOP_TYPE (right) == AOP_LIT) + lit = ulFromVal (AOP (right)->aopu.aop_lit); + + size = AOP_SIZE (result); + + DEBUGpic14_AopType (__LINE__, left, right, result); + + // if(bit & yy) + // result = bit & yy; + if (AOP_TYPE (left) == AOP_CRY) + { + // c = bit & literal; + if (AOP_TYPE (right) == AOP_LIT) + { + if (lit & 1) + { + if (size && pic14_sameRegs (AOP (result), AOP (left))) + // no change + goto release; + pic14_emitcode ("mov", "c,%s", AOP (left)->aopu.aop_dir); + } + else + { + // bit(result) = 0; + if (size && (AOP_TYPE (result) == AOP_CRY)) + { + pic14_emitcode ("clr", "%s", AOP (result)->aopu.aop_dir); + goto release; } - if((AOP_TYPE(result) == AOP_CRY) && ifx){ - jumpIfTrue(ifx); - goto release; + if ((AOP_TYPE (result) == AOP_CRY) && ifx) + { + jumpIfTrue (ifx); + goto release; } - pic14_emitcode("clr","c"); + pic14_emitcode ("clr", "c"); + } + } + else + { + if (AOP_TYPE (right) == AOP_CRY) + { + // c = bit & bit; + pic14_emitcode ("mov", "c,%s", AOP (right)->aopu.aop_dir); + pic14_emitcode ("anl", "c,%s", AOP (left)->aopu.aop_dir); } - } else { - if (AOP_TYPE(right) == AOP_CRY){ - // c = bit & bit; - pic14_emitcode("mov","c,%s",AOP(right)->aopu.aop_dir); - pic14_emitcode("anl","c,%s",AOP(left)->aopu.aop_dir); - } else { - // c = bit & val; - MOVA(aopGet(AOP(right),0,FALSE,FALSE)); - // c = lsb - pic14_emitcode("rrc","a"); - pic14_emitcode("anl","c,%s",AOP(left)->aopu.aop_dir); - } - } - // bit = c - // val = c - if(size) - pic14_outBitC(result); - // if(bit & ...) - else if((AOP_TYPE(result) == AOP_CRY) && ifx) - genIfxJump(ifx, "c"); - goto release ; - } - - // if(val & 0xZZ) - size = 0, ifx != FALSE - - // bit = val & 0xZZ - size = 1, ifx = FALSE - - if((AOP_TYPE(right) == AOP_LIT) && - (AOP_TYPE(result) == AOP_CRY) && - (AOP_TYPE(left) != AOP_CRY)){ - int posbit = isLiteralBit(lit); - /* left & 2^n */ - if(posbit){ - posbit--; - //MOVA(aopGet(AOP(left),posbit>>3,FALSE,FALSE)); - // bit = left & 2^n - if(size) - pic14_emitcode("mov","c,acc.%d",posbit&0x07); - // if(left & 2^n) - else{ - if(ifx){ - int offset = 0; - while (posbit > 7) { - posbit -= 8; - offset++; + else + { + // c = bit & val; + MOVA (aopGet (AOP (right), 0, FALSE, FALSE)); + // c = lsb + pic14_emitcode ("rrc", "a"); + pic14_emitcode ("anl", "c,%s", AOP (left)->aopu.aop_dir); + } + } + // bit = c + // val = c + if (size) + pic14_outBitC (result); + // if(bit & ...) + else if ((AOP_TYPE (result) == AOP_CRY) && ifx) + genIfxJump (ifx, "c"); + goto release; + } + + // if(val & 0xZZ) - size = 0, ifx != FALSE - + // bit = val & 0xZZ - size = 1, ifx = FALSE - + if ((AOP_TYPE (right) == AOP_LIT) && (AOP_TYPE (result) == AOP_CRY) && (AOP_TYPE (left) != AOP_CRY)) + { + int posbit = isLiteralBit (lit); + /* left & 2^n */ + if (posbit) + { + posbit--; + //MOVA(aopGet(AOP(left),posbit>>3,FALSE,FALSE)); + // bit = left & 2^n + if (size) + pic14_emitcode ("mov", "c,acc.%d", posbit & 0x07); + // if(left & 2^n) + else + { + if (ifx) + { + int offset = 0; + while (posbit > 7) + { + posbit -= 8; + offset++; } - emitpcode(((rIfx.condition) ? POC_BTFSC : POC_BTFSS), - newpCodeOpBit(aopGet(AOP(left),offset,FALSE,FALSE),posbit,0)); - emitpcode(POC_GOTO,popGetLabel(rIfx.lbl->key)); + emitpcode (((rIfx.condition) ? POC_BTFSC : POC_BTFSS), + newpCodeOpBit (aopGet (AOP (left), offset, FALSE, FALSE), posbit, 0)); + emitpcode (POC_GOTO, popGetLabel (rIfx.lbl->key)); - ifx->generated = 1; + ifx->generated = 1; } - goto release; + goto release; } - } else { - symbol *tlbl = newiTempLabel(NULL); - int sizel = AOP_SIZE(left); - if(size) - pic14_emitcode("setb","c"); - while(sizel--){ - if((bytelit = ((lit >> (offset*8)) & 0x0FFL)) != 0x0L){ - mov2w( AOP(left), offset); - // byte == 2^n ? - if((posbit = isLiteralBit(bytelit)) != 0) { - emitpcode(rIfx.condition ? POC_BTFSC : POC_BTFSS, // XXX: or the other way round? - newpCodeOpBit(aopGet(AOP(left),offset,FALSE,FALSE),posbit - 1, 0)); - pic14_emitcode("jb","acc.%d,%05d_DS_",(posbit-1)&0x07,tlbl->key+100); + } + else + { + symbol *tlbl = newiTempLabel (NULL); + int sizel = AOP_SIZE (left); + if (size) + pic14_emitcode ("setb", "c"); + while (sizel--) + { + if ((bytelit = ((lit >> (offset * 8)) & 0x0FFL)) != 0x0L) + { + mov2w (AOP (left), offset); + // byte == 2^n ? + if ((posbit = isLiteralBit (bytelit)) != 0) + { + emitpcode (rIfx.condition ? POC_BTFSC : POC_BTFSS, // XXX: or the other way round? + newpCodeOpBit (aopGet (AOP (left), offset, FALSE, FALSE), posbit - 1, 0)); + pic14_emitcode ("jb", "acc.%d,%05d_DS_", (posbit - 1) & 0x07, labelKey2num (tlbl->key)); } - else{ - emitpcode(POC_ANDLW, newpCodeOpLit(bytelit & 0x0ff)); - if (rIfx.condition) emitSKPZ; - else emitSKPNZ; + else + { + emitpcode (POC_ANDLW, newpCodeOpLit (bytelit & 0x0ff)); + if (rIfx.condition) + emitSKPZ; + else + emitSKPNZ; - if(bytelit != 0x0FFL) + if (bytelit != 0x0FFL) { - pic14_emitcode("anl","a,%s", - aopGet(AOP(right),offset,FALSE,TRUE)); + pic14_emitcode ("anl", "a,%s", aopGet (AOP (right), offset, FALSE, TRUE)); } - pic14_emitcode("jnz","%05d_DS_",tlbl->key+100); + pic14_emitcode ("jnz", "%05d_DS_", labelKey2num (tlbl->key)); } - emitpcode(POC_GOTO, popGetLabel(rIfx.lbl->key)); - ifx->generated = 1; + emitpcode (POC_GOTO, popGetLabel (rIfx.lbl->key)); + ifx->generated = 1; } - offset++; + offset++; + } + // bit = left & literal + if (size) + { + pic14_emitcode ("clr", "c"); + pic14_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key)); + } + // if(left & literal) + else + { + if (ifx) + jmpTrueOrFalse (ifx, tlbl); + goto release; } - // bit = left & literal - if(size){ - pic14_emitcode("clr","c"); - pic14_emitcode("","%05d_DS_:",tlbl->key+100); - } - // if(left & literal) - else{ - if(ifx) - jmpTrueOrFalse(ifx, tlbl); - goto release ; - } - } - pic14_outBitC(result); - goto release ; - } - - /* if left is same as result */ - if(pic14_sameRegs(AOP(result),AOP(left))){ - int know_W = -1; - for(;size--; offset++,lit>>=8) { - if(AOP_TYPE(right) == AOP_LIT){ - switch(lit & 0xff) { + } + pic14_outBitC (result); + goto release; + } + + /* if left is same as result */ + if (pic14_sameRegs (AOP (result), AOP (left))) + { + int know_W = -1; + for (; size--; offset++, lit >>= 8) + { + if (AOP_TYPE (right) == AOP_LIT) + { + switch (lit & 0xff) + { case 0x00: - /* and'ing with 0 has clears the result */ - emitpcode(POC_CLRF,popGet(AOP(result),offset)); - break; + /* and'ing with 0 has clears the result */ + emitpcode (POC_CLRF, popGet (AOP (result), offset)); + break; case 0xff: - /* and'ing with 0xff is a nop when the result and left are the same */ - break; + /* and'ing with 0xff is a nop when the result and left are the same */ + break; default: + { + int p = my_powof2 ((~lit) & 0xff); + if (p >= 0) { - int p = my_powof2( (~lit) & 0xff ); - if(p>=0) { - /* only one bit is set in the literal, so use a bcf instruction */ - emitpcode(POC_BCF,newpCodeOpBit(aopGet(AOP(left),offset,FALSE,FALSE),p,0)); - - } else { - if(know_W != (int)(lit&0xff)) - emitpcode(POC_MOVLW, popGetLit(lit & 0xff)); - know_W = lit &0xff; - emitpcode(POC_ANDWF,popGet(AOP(left),offset)); - } + /* only one bit is set in the literal, so use a bcf instruction */ + emitpcode (POC_BCF, newpCodeOpBit (aopGet (AOP (left), offset, FALSE, FALSE), p, 0)); + + } + else + { + if (know_W != (int) (lit & 0xff)) + emitpcode (POC_MOVLW, popGetLit (lit & 0xff)); + know_W = lit & 0xff; + emitpcode (POC_ANDWF, popGet (AOP (left), offset)); } } - } else { - emitpcode(POC_MOVFW,popGet(AOP(right),offset)); - emitpcode(POC_ANDWF,popGet(AOP(left),offset)); + } + } + else + { + emitpcode (POC_MOVFW, popGet (AOP (right), offset)); + emitpcode (POC_ANDWF, popGet (AOP (left), offset)); } } - } else { - // left & result in different registers - if(AOP_TYPE(result) == AOP_CRY){ - // result = bit - // if(size), result in bit - // if(!size && ifx), conditional oper: if(left & right) - symbol *tlbl = newiTempLabel(NULL); - int sizer = min(AOP_SIZE(left),AOP_SIZE(right)); - if(size) - pic14_emitcode("setb","c"); - while(sizer--){ - MOVA(aopGet(AOP(right),offset,FALSE,FALSE)); - pic14_emitcode("anl","a,%s", - aopGet(AOP(left),offset,FALSE,FALSE)); - pic14_emitcode("jnz","%05d_DS_",tlbl->key+100); - offset++; - } - if(size){ - CLRC; - pic14_emitcode("","%05d_DS_:",tlbl->key+100); - pic14_outBitC(result); - } else if(ifx) - jmpTrueOrFalse(ifx, tlbl); - } else { - for(;(size--);offset++) { - // normal case - // result = left & right - if(AOP_TYPE(right) == AOP_LIT){ - int t = (lit >> (offset*8)) & 0x0FFL; - switch(t) { + } + else + { + // left & result in different registers + if (AOP_TYPE (result) == AOP_CRY) + { + // result = bit + // if(size), result in bit + // if(!size && ifx), conditional oper: if(left & right) + symbol *tlbl = newiTempLabel (NULL); + int sizer = min (AOP_SIZE (left), AOP_SIZE (right)); + if (size) + pic14_emitcode ("setb", "c"); + while (sizer--) + { + MOVA (aopGet (AOP (right), offset, FALSE, FALSE)); + pic14_emitcode ("anl", "a,%s", aopGet (AOP (left), offset, FALSE, FALSE)); + pic14_emitcode ("jnz", "%05d_DS_", labelKey2num (tlbl->key)); + offset++; + } + if (size) + { + CLRC; + pic14_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key)); + pic14_outBitC (result); + } + else if (ifx) + jmpTrueOrFalse (ifx, tlbl); + } + else + { + for (; (size--); offset++) + { + // normal case + // result = left & right + if (AOP_TYPE (right) == AOP_LIT) + { + int t = (lit >> (offset * 8)) & 0x0FFL; + switch (t) + { case 0x00: - emitpcode(POC_CLRF,popGet(AOP(result),offset)); - break; + emitpcode (POC_CLRF, popGet (AOP (result), offset)); + break; case 0xff: - emitpcode(POC_MOVFW,popGet(AOP(left),offset)); - emitpcode(POC_MOVWF,popGet(AOP(result),offset)); - break; + emitpcode (POC_MOVFW, popGet (AOP (left), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); + break; default: - emitpcode(POC_MOVLW, popGetLit(t)); - emitpcode(POC_ANDFW,popGet(AOP(left),offset)); - emitpcode(POC_MOVWF,popGet(AOP(result),offset)); + emitpcode (POC_MOVLW, popGetLit (t)); + emitpcode (POC_ANDFW, popGet (AOP (left), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); } - continue; + continue; } - emitpcode(POC_MOVFW,popGet(AOP(right),offset)); - emitpcode(POC_ANDFW,popGet(AOP(left),offset)); - emitpcode(POC_MOVWF,popGet(AOP(result),offset)); + emitpcode (POC_MOVFW, popGet (AOP (right), offset)); + emitpcode (POC_ANDFW, popGet (AOP (left), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); } } } -release : - freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(result,NULL,ic,TRUE); +release: + freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genOr - code for or */ /*-----------------------------------------------------------------*/ -static void genOr (iCode *ic, iCode *ifx) +static void +genOr (iCode * ic, iCode * ifx) { - operand *left, *right, *result; - int size, offset=0; - unsigned long lit = 0L; - - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - aopOp((left = IC_LEFT(ic)),ic,FALSE); - aopOp((right= IC_RIGHT(ic)),ic,FALSE); - aopOp((result=IC_RESULT(ic)),ic,TRUE); - - DEBUGpic14_AopType(__LINE__,left,right,result); - - /* if left is a literal & right is not then exchange them */ - if ((AOP_TYPE(left) == AOP_LIT && AOP_TYPE(right) != AOP_LIT) || - AOP_NEEDSACC(left)) { - operand *tmp = right ; - right = left; - left = tmp; - } - - /* if result = right then exchange them */ - if(pic14_sameRegs(AOP(result),AOP(right))){ - operand *tmp = right ; - right = left; - left = tmp; - } - - /* if right is bit then exchange them */ - if (AOP_TYPE(right) == AOP_CRY && - AOP_TYPE(left) != AOP_CRY){ - operand *tmp = right ; - right = left; - left = tmp; - } - - DEBUGpic14_AopType(__LINE__,left,right,result); - - if(AOP_TYPE(right) == AOP_LIT) - lit = ulFromVal (AOP(right)->aopu.aop_lit); - - size = AOP_SIZE(result); - - // if(bit | yy) - // xx = bit | yy; - if (AOP_TYPE(left) == AOP_CRY){ - if(AOP_TYPE(right) == AOP_LIT){ - // c = bit & literal; - if(lit){ - // lit != 0 => result = 1 - if(AOP_TYPE(result) == AOP_CRY){ - if(size) - emitpcode(POC_BSF, popGet(AOP(result),0)); - //pic14_emitcode("bsf","(%s >> 3), (%s & 7)", - // AOP(result)->aopu.aop_dir, - // AOP(result)->aopu.aop_dir); - else if(ifx) - continueIfTrue(ifx); - goto release; + operand *left, *right, *result; + int size, offset = 0; + unsigned long lit = 0L; + + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + + aopOp ((left = IC_LEFT (ic)), ic, FALSE); + aopOp ((right = IC_RIGHT (ic)), ic, FALSE); + aopOp ((result = IC_RESULT (ic)), ic, TRUE); + + DEBUGpic14_AopType (__LINE__, left, right, result); + + /* if left is a literal & right is not then exchange them */ + if ((AOP_TYPE (left) == AOP_LIT && AOP_TYPE (right) != AOP_LIT) || AOP_NEEDSACC (left)) + { + operand *tmp = right; + right = left; + left = tmp; + } + + /* if result = right then exchange them */ + if (pic14_sameRegs (AOP (result), AOP (right))) + { + operand *tmp = right; + right = left; + left = tmp; + } + + /* if right is bit then exchange them */ + if (AOP_TYPE (right) == AOP_CRY && AOP_TYPE (left) != AOP_CRY) + { + operand *tmp = right; + right = left; + left = tmp; + } + + DEBUGpic14_AopType (__LINE__, left, right, result); + + if (AOP_TYPE (right) == AOP_LIT) + lit = ulFromVal (AOP (right)->aopu.aop_lit); + + size = AOP_SIZE (result); + + // if(bit | yy) + // xx = bit | yy; + if (AOP_TYPE (left) == AOP_CRY) + { + if (AOP_TYPE (right) == AOP_LIT) + { + // c = bit & literal; + if (lit) + { + // lit != 0 => result = 1 + if (AOP_TYPE (result) == AOP_CRY) + { + if (size) + emitpcode (POC_BSF, popGet (AOP (result), 0)); + //pic14_emitcode("bsf","(%s >> 3), (%s & 7)", + // AOP(result)->aopu.aop_dir, + // AOP(result)->aopu.aop_dir); + else if (ifx) + continueIfTrue (ifx); + goto release; } - } else { - // lit == 0 => result = left - if(size && pic14_sameRegs(AOP(result),AOP(left))) - goto release; - pic14_emitcode(";XXX mov","c,%s %s,%d",AOP(left)->aopu.aop_dir,__FILE__,__LINE__); } - } else { - if (AOP_TYPE(right) == AOP_CRY){ - if(pic14_sameRegs(AOP(result),AOP(left))){ - // c = bit | bit; - emitpcode(POC_BCF, popGet(AOP(result),0)); - emitpcode(POC_BTFSC, popGet(AOP(right),0)); - emitpcode(POC_BSF, popGet(AOP(result),0)); - - pic14_emitcode("bcf","(%s >> 3), (%s & 7)", - AOP(result)->aopu.aop_dir, - AOP(result)->aopu.aop_dir); - pic14_emitcode("btfsc","(%s >> 3), (%s & 7)", - AOP(right)->aopu.aop_dir, - AOP(right)->aopu.aop_dir); - pic14_emitcode("bsf","(%s >> 3), (%s & 7)", - AOP(result)->aopu.aop_dir, - AOP(result)->aopu.aop_dir); - } else { - emitpcode(POC_BCF, popGet(AOP(result),0)); - emitpcode(POC_BTFSS, popGet(AOP(right),0)); - emitpcode(POC_BTFSC, popGet(AOP(left),0)); - emitpcode(POC_BSF, popGet(AOP(result),0)); + else + { + // lit == 0 => result = left + if (size && pic14_sameRegs (AOP (result), AOP (left))) + goto release; + pic14_emitcode (";XXX mov", "c,%s %s,%d", AOP (left)->aopu.aop_dir, __FILE__, __LINE__); + } + } + else + { + if (AOP_TYPE (right) == AOP_CRY) + { + if (pic14_sameRegs (AOP (result), AOP (left))) + { + // c = bit | bit; + emitpcode (POC_BCF, popGet (AOP (result), 0)); + emitpcode (POC_BTFSC, popGet (AOP (right), 0)); + emitpcode (POC_BSF, popGet (AOP (result), 0)); + + pic14_emitcode ("bcf", "(%s >> 3), (%s & 7)", AOP (result)->aopu.aop_dir, AOP (result)->aopu.aop_dir); + pic14_emitcode ("btfsc", "(%s >> 3), (%s & 7)", AOP (right)->aopu.aop_dir, AOP (right)->aopu.aop_dir); + pic14_emitcode ("bsf", "(%s >> 3), (%s & 7)", AOP (result)->aopu.aop_dir, AOP (result)->aopu.aop_dir); } - } else { - // c = bit | val; - symbol *tlbl = newiTempLabel(NULL); - pic14_emitcode(";XXX "," %s,%d",__FILE__,__LINE__); - - - emitpcode(POC_BCF, popGet(AOP(result),0)); - - if(!((AOP_TYPE(result) == AOP_CRY) && ifx)) - pic14_emitcode(";XXX setb","c"); - pic14_emitcode(";XXX jb","%s,%05d_DS_", - AOP(left)->aopu.aop_dir,tlbl->key+100); - pic14_toBoolean(right); - pic14_emitcode(";XXX jnz","%05d_DS_",tlbl->key+100); - if((AOP_TYPE(result) == AOP_CRY) && ifx){ - jmpTrueOrFalse(ifx, tlbl); - goto release; - } else { - CLRC; - pic14_emitcode("","%05d_DS_:",tlbl->key+100); + else + { + emitpcode (POC_BCF, popGet (AOP (result), 0)); + emitpcode (POC_BTFSS, popGet (AOP (right), 0)); + emitpcode (POC_BTFSC, popGet (AOP (left), 0)); + emitpcode (POC_BSF, popGet (AOP (result), 0)); + } + } + else + { + // c = bit | val; + symbol *tlbl = newiTempLabel (NULL); + pic14_emitcode (";XXX ", " %s,%d", __FILE__, __LINE__); + + + emitpcode (POC_BCF, popGet (AOP (result), 0)); + + if (!((AOP_TYPE (result) == AOP_CRY) && ifx)) + pic14_emitcode (";XXX setb", "c"); + pic14_emitcode (";XXX jb", "%s,%05d_DS_", AOP (left)->aopu.aop_dir, labelKey2num (tlbl->key)); + pic14_toBoolean (right); + pic14_emitcode (";XXX jnz", "%05d_DS_", labelKey2num (tlbl->key)); + if ((AOP_TYPE (result) == AOP_CRY) && ifx) + { + jmpTrueOrFalse (ifx, tlbl); + goto release; + } + else + { + CLRC; + pic14_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key)); } } } - // bit = c - // val = c - if(size) - pic14_outBitC(result); - // if(bit | ...) - else if((AOP_TYPE(result) == AOP_CRY) && ifx) - genIfxJump(ifx, "c"); - goto release ; - } - - // if(val | 0xZZ) - size = 0, ifx != FALSE - - // bit = val | 0xZZ - size = 1, ifx = FALSE - - if((AOP_TYPE(right) == AOP_LIT) && - (AOP_TYPE(result) == AOP_CRY) && - (AOP_TYPE(left) != AOP_CRY)){ - if(lit){ - pic14_emitcode(";XXX "," %s,%d",__FILE__,__LINE__); - // result = 1 - if(size) - pic14_emitcode(";XXX setb","%s",AOP(result)->aopu.aop_dir); - else - continueIfTrue(ifx); - goto release; - } else { - pic14_emitcode(";XXX "," %s,%d",__FILE__,__LINE__); - // lit = 0, result = boolean(left) - if(size) - pic14_emitcode(";XXX setb","c"); - pic14_toBoolean(right); - if(size){ - symbol *tlbl = newiTempLabel(NULL); - pic14_emitcode(";XXX jnz","%05d_DS_",tlbl->key+100); - CLRC; - pic14_emitcode("","%05d_DS_:",tlbl->key+100); - } else { - genIfxJump (ifx,"a"); - goto release; + // bit = c + // val = c + if (size) + pic14_outBitC (result); + // if(bit | ...) + else if ((AOP_TYPE (result) == AOP_CRY) && ifx) + genIfxJump (ifx, "c"); + goto release; + } + + // if(val | 0xZZ) - size = 0, ifx != FALSE - + // bit = val | 0xZZ - size = 1, ifx = FALSE - + if ((AOP_TYPE (right) == AOP_LIT) && (AOP_TYPE (result) == AOP_CRY) && (AOP_TYPE (left) != AOP_CRY)) + { + if (lit) + { + pic14_emitcode (";XXX ", " %s,%d", __FILE__, __LINE__); + // result = 1 + if (size) + pic14_emitcode (";XXX setb", "%s", AOP (result)->aopu.aop_dir); + else + continueIfTrue (ifx); + goto release; + } + else + { + pic14_emitcode (";XXX ", " %s,%d", __FILE__, __LINE__); + // lit = 0, result = boolean(left) + if (size) + pic14_emitcode (";XXX setb", "c"); + pic14_toBoolean (right); + if (size) + { + symbol *tlbl = newiTempLabel (NULL); + pic14_emitcode (";XXX jnz", "%05d_DS_", labelKey2num (tlbl->key)); + CLRC; + pic14_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key)); + } + else + { + genIfxJump (ifx, "a"); + goto release; } } - pic14_outBitC(result); - goto release ; + pic14_outBitC (result); + goto release; } - /* if left is same as result */ - if(pic14_sameRegs(AOP(result),AOP(left))){ - int know_W = -1; - for(;size--; offset++,lit>>=8) { - if(AOP_TYPE(right) == AOP_LIT){ - if((lit & 0xff) == 0) - /* or'ing with 0 has no effect */ - continue; - else { - int p = my_powof2(lit & 0xff); - if(p>=0) { - /* only one bit is set in the literal, so use a bsf instruction */ - emitpcode(POC_BSF, - newpCodeOpBit(aopGet(AOP(left),offset,FALSE,FALSE),p,0)); - } else { - if(know_W != (int)(lit & 0xff)) - emitpcode(POC_MOVLW, popGetLit(lit & 0xff)); - know_W = lit & 0xff; - emitpcode(POC_IORWF, popGet(AOP(left),offset)); + /* if left is same as result */ + if (pic14_sameRegs (AOP (result), AOP (left))) + { + int know_W = -1; + for (; size--; offset++, lit >>= 8) + { + if (AOP_TYPE (right) == AOP_LIT) + { + if ((lit & 0xff) == 0) + /* or'ing with 0 has no effect */ + continue; + else + { + int p = my_powof2 (lit & 0xff); + if (p >= 0) + { + /* only one bit is set in the literal, so use a bsf instruction */ + emitpcode (POC_BSF, newpCodeOpBit (aopGet (AOP (left), offset, FALSE, FALSE), p, 0)); + } + else + { + if (know_W != (int) (lit & 0xff)) + emitpcode (POC_MOVLW, popGetLit (lit & 0xff)); + know_W = lit & 0xff; + emitpcode (POC_IORWF, popGet (AOP (left), offset)); } } - } else { - emitpcode(POC_MOVFW, popGet(AOP(right),offset)); - emitpcode(POC_IORWF, popGet(AOP(left),offset)); - } - } - } else { - // left & result in different registers - if(AOP_TYPE(result) == AOP_CRY){ - // result = bit - // if(size), result in bit - // if(!size && ifx), conditional oper: if(left | right) - symbol *tlbl = newiTempLabel(NULL); - int sizer = max(AOP_SIZE(left),AOP_SIZE(right)); - pic14_emitcode(";XXX "," %s,%d",__FILE__,__LINE__); - - - if(size) - pic14_emitcode(";XXX setb","c"); - while(sizer--){ - MOVA(aopGet(AOP(right),offset,FALSE,FALSE)); - pic14_emitcode(";XXX orl","a,%s", - aopGet(AOP(left),offset,FALSE,FALSE)); - pic14_emitcode(";XXX jnz","%05d_DS_",tlbl->key+100); - offset++; - } - if(size){ - CLRC; - pic14_emitcode("","%05d_DS_:",tlbl->key+100); - pic14_outBitC(result); - } else if(ifx) - jmpTrueOrFalse(ifx, tlbl); - } else for(;(size--);offset++){ + } + else + { + emitpcode (POC_MOVFW, popGet (AOP (right), offset)); + emitpcode (POC_IORWF, popGet (AOP (left), offset)); + } + } + } + else + { + // left & result in different registers + if (AOP_TYPE (result) == AOP_CRY) + { + // result = bit + // if(size), result in bit + // if(!size && ifx), conditional oper: if(left | right) + symbol *tlbl = newiTempLabel (NULL); + int sizer = max (AOP_SIZE (left), AOP_SIZE (right)); + pic14_emitcode (";XXX ", " %s,%d", __FILE__, __LINE__); + + + if (size) + pic14_emitcode (";XXX setb", "c"); + while (sizer--) + { + MOVA (aopGet (AOP (right), offset, FALSE, FALSE)); + pic14_emitcode (";XXX orl", "a,%s", aopGet (AOP (left), offset, FALSE, FALSE)); + pic14_emitcode (";XXX jnz", "%05d_DS_", labelKey2num (tlbl->key)); + offset++; + } + if (size) + { + CLRC; + pic14_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key)); + pic14_outBitC (result); + } + else if (ifx) + jmpTrueOrFalse (ifx, tlbl); + } + else + for (; (size--); offset++) + { // normal case // result = left | right - if(AOP_TYPE(right) == AOP_LIT){ - int t = (lit >> (offset*8)) & 0x0FFL; - switch(t) { - case 0x00: - emitpcode(POC_MOVFW, popGet(AOP(left),offset)); - emitpcode(POC_MOVWF, popGet(AOP(result),offset)); + if (AOP_TYPE (right) == AOP_LIT) + { + int t = (lit >> (offset * 8)) & 0x0FFL; + switch (t) + { + case 0x00: + emitpcode (POC_MOVFW, popGet (AOP (left), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); break; - default: - emitpcode(POC_MOVLW, popGetLit(t)); - emitpcode(POC_IORFW, popGet(AOP(left),offset)); - emitpcode(POC_MOVWF, popGet(AOP(result),offset)); - } + default: + emitpcode (POC_MOVLW, popGetLit (t)); + emitpcode (POC_IORFW, popGet (AOP (left), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); + } continue; - } + } // faster than result <- left, anl result,right // and better if result is SFR - emitpcode(POC_MOVFW,popGet(AOP(right),offset)); - emitpcode(POC_IORFW,popGet(AOP(left),offset)); - emitpcode(POC_MOVWF, popGet(AOP(result),offset)); - } + emitpcode (POC_MOVFW, popGet (AOP (right), offset)); + emitpcode (POC_IORFW, popGet (AOP (left), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); + } } -release : - freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(result,NULL,ic,TRUE); +release: + freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genXor - code for xclusive or */ /*-----------------------------------------------------------------*/ -static void genXor (iCode *ic, iCode *ifx) +static void +genXor (iCode * ic, iCode * ifx) { - operand *left, *right, *result; - int size, offset=0; - unsigned long lit = 0L; - - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - aopOp((left = IC_LEFT(ic)),ic,FALSE); - aopOp((right= IC_RIGHT(ic)),ic,FALSE); - aopOp((result=IC_RESULT(ic)),ic,TRUE); - - /* if left is a literal & right is not || - if left needs acc & right does not */ - if ((AOP_TYPE(left) == AOP_LIT && AOP_TYPE(right) != AOP_LIT) || - (AOP_NEEDSACC(left) && !AOP_NEEDSACC(right))) { - operand *tmp = right ; - right = left; - left = tmp; - } - - /* if result = right then exchange them */ - if(pic14_sameRegs(AOP(result),AOP(right))){ - operand *tmp = right ; - right = left; - left = tmp; - } - - /* if right is bit then exchange them */ - if (AOP_TYPE(right) == AOP_CRY && - AOP_TYPE(left) != AOP_CRY){ - operand *tmp = right ; - right = left; - left = tmp; - } - if(AOP_TYPE(right) == AOP_LIT) - lit = ulFromVal (AOP(right)->aopu.aop_lit); - - size = AOP_SIZE(result); - - // if(bit ^ yy) - // xx = bit ^ yy; - if (AOP_TYPE(left) == AOP_CRY){ - if(AOP_TYPE(right) == AOP_LIT){ - // c = bit & literal; - if(lit>>1){ - // lit>>1 != 0 => result = 1 - if(AOP_TYPE(result) == AOP_CRY){ - if(size) - {emitpcode(POC_BSF, popGet(AOP(result),offset)); - pic14_emitcode("setb","%s",AOP(result)->aopu.aop_dir);} - else if(ifx) - continueIfTrue(ifx); + operand *left, *right, *result; + int size, offset = 0; + unsigned long lit = 0L; + + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + + aopOp ((left = IC_LEFT (ic)), ic, FALSE); + aopOp ((right = IC_RIGHT (ic)), ic, FALSE); + aopOp ((result = IC_RESULT (ic)), ic, TRUE); + + /* if left is a literal & right is not || + if left needs acc & right does not */ + if ((AOP_TYPE (left) == AOP_LIT && AOP_TYPE (right) != AOP_LIT) || (AOP_NEEDSACC (left) && !AOP_NEEDSACC (right))) + { + operand *tmp = right; + right = left; + left = tmp; + } + + /* if result = right then exchange them */ + if (pic14_sameRegs (AOP (result), AOP (right))) + { + operand *tmp = right; + right = left; + left = tmp; + } + + /* if right is bit then exchange them */ + if (AOP_TYPE (right) == AOP_CRY && AOP_TYPE (left) != AOP_CRY) + { + operand *tmp = right; + right = left; + left = tmp; + } + if (AOP_TYPE (right) == AOP_LIT) + lit = ulFromVal (AOP (right)->aopu.aop_lit); + + size = AOP_SIZE (result); + + // if(bit ^ yy) + // xx = bit ^ yy; + if (AOP_TYPE (left) == AOP_CRY) + { + if (AOP_TYPE (right) == AOP_LIT) + { + // c = bit & literal; + if (lit >> 1) + { + // lit>>1 != 0 => result = 1 + if (AOP_TYPE (result) == AOP_CRY) + { + if (size) + { + emitpcode (POC_BSF, popGet (AOP (result), offset)); + pic14_emitcode ("setb", "%s", AOP (result)->aopu.aop_dir); + } + else if (ifx) + continueIfTrue (ifx); + goto release; + } + pic14_emitcode ("setb", "c"); + } + else + { + // lit == (0 or 1) + if (lit == 0) + { + // lit == 0, result = left + if (size && pic14_sameRegs (AOP (result), AOP (left))) goto release; + pic14_emitcode ("mov", "c,%s", AOP (left)->aopu.aop_dir); } - pic14_emitcode("setb","c"); - } else{ - // lit == (0 or 1) - if(lit == 0){ - // lit == 0, result = left - if(size && pic14_sameRegs(AOP(result),AOP(left))) - goto release; - pic14_emitcode("mov","c,%s",AOP(left)->aopu.aop_dir); - } else{ - // lit == 1, result = not(left) - if(size && pic14_sameRegs(AOP(result),AOP(left))){ - emitpcode(POC_MOVLW, popGet(AOP(result),offset)); - emitpcode(POC_XORWF, popGet(AOP(result),offset)); - pic14_emitcode("cpl","%s",AOP(result)->aopu.aop_dir); - goto release; - } else { - assert ( !"incomplete genXor" ); - pic14_emitcode("mov","c,%s",AOP(left)->aopu.aop_dir); - pic14_emitcode("cpl","c"); + else + { + // lit == 1, result = not(left) + if (size && pic14_sameRegs (AOP (result), AOP (left))) + { + emitpcode (POC_MOVLW, popGet (AOP (result), offset)); + emitpcode (POC_XORWF, popGet (AOP (result), offset)); + pic14_emitcode ("cpl", "%s", AOP (result)->aopu.aop_dir); + goto release; + } + else + { + assert (!"incomplete genXor"); + pic14_emitcode ("mov", "c,%s", AOP (left)->aopu.aop_dir); + pic14_emitcode ("cpl", "c"); } } } - } else { - // right != literal - symbol *tlbl = newiTempLabel(NULL); - if (AOP_TYPE(right) == AOP_CRY){ - // c = bit ^ bit; - pic14_emitcode("mov","c,%s",AOP(right)->aopu.aop_dir); - } - else{ - int sizer = AOP_SIZE(right); - // c = bit ^ val - // if val>>1 != 0, result = 1 - pic14_emitcode("setb","c"); - while(sizer){ - MOVA(aopGet(AOP(right),sizer-1,FALSE,FALSE)); - if(sizer == 1) - // test the msb of the lsb - pic14_emitcode("anl","a,#0xfe"); - pic14_emitcode("jnz","%05d_DS_",tlbl->key+100); - sizer--; + } + else + { + // right != literal + symbol *tlbl = newiTempLabel (NULL); + if (AOP_TYPE (right) == AOP_CRY) + { + // c = bit ^ bit; + pic14_emitcode ("mov", "c,%s", AOP (right)->aopu.aop_dir); + } + else + { + int sizer = AOP_SIZE (right); + // c = bit ^ val + // if val>>1 != 0, result = 1 + pic14_emitcode ("setb", "c"); + while (sizer) + { + MOVA (aopGet (AOP (right), sizer - 1, FALSE, FALSE)); + if (sizer == 1) + // test the msb of the lsb + pic14_emitcode ("anl", "a,#0xfe"); + pic14_emitcode ("jnz", "%05d_DS_", labelKey2num (tlbl->key)); + sizer--; } - // val = (0,1) - pic14_emitcode("rrc","a"); + // val = (0,1) + pic14_emitcode ("rrc", "a"); } - pic14_emitcode("jnb","%s,%05d_DS_",AOP(left)->aopu.aop_dir,(tlbl->key+100)); - pic14_emitcode("cpl","c"); - pic14_emitcode("","%05d_DS_:",(tlbl->key+100)); - } - // bit = c - // val = c - if(size) - pic14_outBitC(result); - // if(bit | ...) - else if((AOP_TYPE(result) == AOP_CRY) && ifx) - genIfxJump(ifx, "c"); - goto release ; - } - - if(pic14_sameRegs(AOP(result),AOP(left))){ - /* if left is same as result */ - for(;size--; offset++) { - if(AOP_TYPE(right) == AOP_LIT){ - int t = (lit >> (offset*8)) & 0x0FFL; - if(t == 0x00L) - continue; - else { - emitpcode(POC_MOVLW, popGetLit(t)); - emitpcode(POC_XORWF,popGet(AOP(left),offset)); + pic14_emitcode ("jnb", "%s,%05d_DS_", AOP (left)->aopu.aop_dir, (labelKey2num (tlbl->key))); + pic14_emitcode ("cpl", "c"); + pic14_emitcode ("", "%05d_DS_:", (labelKey2num (tlbl->key))); + } + // bit = c + // val = c + if (size) + pic14_outBitC (result); + // if(bit | ...) + else if ((AOP_TYPE (result) == AOP_CRY) && ifx) + genIfxJump (ifx, "c"); + goto release; + } + + if (pic14_sameRegs (AOP (result), AOP (left))) + { + /* if left is same as result */ + for (; size--; offset++) + { + if (AOP_TYPE (right) == AOP_LIT) + { + int t = (lit >> (offset * 8)) & 0x0FFL; + if (t == 0x00L) + continue; + else + { + emitpcode (POC_MOVLW, popGetLit (t)); + emitpcode (POC_XORWF, popGet (AOP (left), offset)); + } + } + else + { + emitpcode (POC_MOVFW, popGet (AOP (right), offset)); + emitpcode (POC_XORWF, popGet (AOP (left), offset)); + } + } + } + else + { + // left & result in different registers + if (AOP_TYPE (result) == AOP_CRY) + { + // result = bit + // if(size), result in bit + // if(!size && ifx), conditional oper: if(left ^ right) + symbol *tlbl = newiTempLabel (NULL); + int sizer = max (AOP_SIZE (left), AOP_SIZE (right)); + if (size) + pic14_emitcode ("setb", "c"); + while (sizer--) + { + if ((AOP_TYPE (right) == AOP_LIT) && (((lit >> (offset * 8)) & 0x0FFL) == 0x00L)) + { + MOVA (aopGet (AOP (left), offset, FALSE, FALSE)); } - } else { - emitpcode(POC_MOVFW,popGet(AOP(right),offset)); - emitpcode(POC_XORWF,popGet(AOP(left),offset)); - } - } - } else { - // left & result in different registers - if(AOP_TYPE(result) == AOP_CRY){ - // result = bit - // if(size), result in bit - // if(!size && ifx), conditional oper: if(left ^ right) - symbol *tlbl = newiTempLabel(NULL); - int sizer = max(AOP_SIZE(left),AOP_SIZE(right)); - if(size) - pic14_emitcode("setb","c"); - while(sizer--){ - if((AOP_TYPE(right) == AOP_LIT) && - (((lit >> (offset*8)) & 0x0FFL) == 0x00L)){ - MOVA(aopGet(AOP(left),offset,FALSE,FALSE)); - } else { - MOVA(aopGet(AOP(right),offset,FALSE,FALSE)); - pic14_emitcode("xrl","a,%s", - aopGet(AOP(left),offset,FALSE,FALSE)); + else + { + MOVA (aopGet (AOP (right), offset, FALSE, FALSE)); + pic14_emitcode ("xrl", "a,%s", aopGet (AOP (left), offset, FALSE, FALSE)); } - pic14_emitcode("jnz","%05d_DS_",tlbl->key+100); - offset++; + pic14_emitcode ("jnz", "%05d_DS_", labelKey2num (tlbl->key)); + offset++; + } + if (size) + { + CLRC; + pic14_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key)); + pic14_outBitC (result); } - if(size){ - CLRC; - pic14_emitcode("","%05d_DS_:",tlbl->key+100); - pic14_outBitC(result); - } else if(ifx) - jmpTrueOrFalse(ifx, tlbl); - } else for(;(size--);offset++){ + else if (ifx) + jmpTrueOrFalse (ifx, tlbl); + } + else + for (; (size--); offset++) + { // normal case // result = left & right - if(AOP_TYPE(right) == AOP_LIT){ - int t = (lit >> (offset*8)) & 0x0FFL; - switch(t) { - case 0x00: - emitpcode(POC_MOVFW,popGet(AOP(left),offset)); - emitpcode(POC_MOVWF,popGet(AOP(result),offset)); + if (AOP_TYPE (right) == AOP_LIT) + { + int t = (lit >> (offset * 8)) & 0x0FFL; + switch (t) + { + case 0x00: + emitpcode (POC_MOVFW, popGet (AOP (left), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); break; - case 0xff: - emitpcode(POC_COMFW,popGet(AOP(left),offset)); - emitpcode(POC_MOVWF,popGet(AOP(result),offset)); + case 0xff: + emitpcode (POC_COMFW, popGet (AOP (left), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); break; - default: - emitpcode(POC_MOVLW, popGetLit(t)); - emitpcode(POC_XORFW,popGet(AOP(left),offset)); - emitpcode(POC_MOVWF,popGet(AOP(result),offset)); - } + default: + emitpcode (POC_MOVLW, popGetLit (t)); + emitpcode (POC_XORFW, popGet (AOP (left), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); + } continue; - } + } // faster than result <- left, anl result,right // and better if result is SFR - emitpcode(POC_MOVFW,popGet(AOP(right),offset)); - emitpcode(POC_XORFW,popGet(AOP(left),offset)); - emitpcode(POC_MOVWF,popGet(AOP(result),offset)); - } + emitpcode (POC_MOVFW, popGet (AOP (right), offset)); + emitpcode (POC_XORFW, popGet (AOP (left), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); + } } -release : - freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(result,NULL,ic,TRUE); +release: + freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genInline - write the inline code out */ /*-----------------------------------------------------------------*/ -static void genInline (iCode *ic) +static void +pic14_genInline (iCode * ic) { char *buffer, *bp, *bp1; bool inComment = FALSE; FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - _G.inLine += (!options.asmpeep); + genLine.lineElement.isInline += (!options.asmpeep); buffer = bp = bp1 = Safe_strdup (IC_INLINE (ic)); @@ -4480,20 +4759,20 @@ inComment = FALSE; *bp++ = '\0'; if (*bp1) - addpCode2pBlock(pb, newpCodeAsmDir(bp1, NULL)); // inline directly, no process + addpCode2pBlock (pb, newpCodeAsmDir (bp1, NULL)); // inline directly, no process bp1 = bp; break; default: /* Add \n for labels, not dirs such as c:\mydir */ - if (!inComment && (*bp == ':') && (isspace((unsigned char)bp[1]))) + if (!inComment && (*bp == ':') && (isspace ((unsigned char) bp[1]))) { ++bp; *bp = '\0'; ++bp; /* print label, use this special format with NULL directive * to denote that the argument should not be indented with tab */ - addpCode2pBlock(pb, newpCodeAsmDir(NULL, bp1)); // inline directly, no process + addpCode2pBlock (pb, newpCodeAsmDir (NULL, bp1)); // inline directly, no process bp1 = bp; } else @@ -4502,178 +4781,246 @@ } } if ((bp1 != bp) && *bp1) - addpCode2pBlock(pb, newpCodeAsmDir(bp1, NULL)); // inline directly, no process + addpCode2pBlock (pb, newpCodeAsmDir (bp1, NULL)); // inline directly, no process Safe_free (buffer); - _G.inLine -= (!options.asmpeep); + /* consumed; we can free it here */ + dbuf_free (IC_INLINE (ic)); + + genLine.lineElement.isInline -= (!options.asmpeep); } /*-----------------------------------------------------------------*/ /* genRRC - rotate right with carry */ /*-----------------------------------------------------------------*/ -static void genRRC (iCode *ic) +static void +genRRC (iCode * ic) { - operand *left , *result ; - int size, offset = 0, same; + operand *left, *result; + int size, offset = 0, same; - FENTRY; - /* rotate right with carry */ - left = IC_LEFT(ic); - result=IC_RESULT(ic); - aopOp (left,ic,FALSE); - aopOp (result,ic,FALSE); + FENTRY; + /* rotate right with carry */ + left = IC_LEFT (ic); + result = IC_RESULT (ic); + aopOp (left, ic, FALSE); + aopOp (result, ic, FALSE); - DEBUGpic14_AopType(__LINE__,left,NULL,result); + DEBUGpic14_AopType (__LINE__, left, NULL, result); - same = pic14_sameRegs(AOP(result),AOP(left)); + same = pic14_sameRegs (AOP (result), AOP (left)); - size = AOP_SIZE(result); + size = AOP_SIZE (result); - /* get the lsb and put it into the carry */ - emitpcode(POC_RRFW, popGet(AOP(left),size-1)); + /* get the lsb and put it into the carry */ + emitpcode (POC_RRFW, popGet (AOP (left), size - 1)); - offset = 0 ; + offset = 0; - while(size--) { + while (size--) + { - if(same) { - emitpcode(POC_RRF, popGet(AOP(left),offset)); - } else { - emitpcode(POC_RRFW, popGet(AOP(left),offset)); - emitpcode(POC_MOVWF, popGet(AOP(result),offset)); + if (same) + { + emitpcode (POC_RRF, popGet (AOP (left), offset)); + } + else + { + emitpcode (POC_RRFW, popGet (AOP (left), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); } - offset++; + offset++; } - freeAsmop(left,NULL,ic,TRUE); - freeAsmop(result,NULL,ic,TRUE); + freeAsmop (left, NULL, ic, TRUE); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genRLC - generate code for rotate left with carry */ /*-----------------------------------------------------------------*/ -static void genRLC (iCode *ic) +static void +genRLC (iCode * ic) { - operand *left , *result ; - int size, offset = 0; - int same; + operand *left, *result; + int size, offset = 0; + int same; - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* rotate right with carry */ - left = IC_LEFT(ic); - result=IC_RESULT(ic); - aopOp (left,ic,FALSE); - aopOp (result,ic,FALSE); + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* rotate right with carry */ + left = IC_LEFT (ic); + result = IC_RESULT (ic); + aopOp (left, ic, FALSE); + aopOp (result, ic, FALSE); - DEBUGpic14_AopType(__LINE__,left,NULL,result); + DEBUGpic14_AopType (__LINE__, left, NULL, result); - same = pic14_sameRegs(AOP(result),AOP(left)); + same = pic14_sameRegs (AOP (result), AOP (left)); - /* move it to the result */ - size = AOP_SIZE(result); + /* move it to the result */ + size = AOP_SIZE (result); - /* get the msb and put it into the carry */ - emitpcode(POC_RLFW, popGet(AOP(left),size-1)); + /* get the msb and put it into the carry */ + emitpcode (POC_RLFW, popGet (AOP (left), size - 1)); - offset = 0 ; + offset = 0; - while(size--) { + while (size--) + { - if(same) { - emitpcode(POC_RLF, popGet(AOP(left),offset)); - } else { - emitpcode(POC_RLFW, popGet(AOP(left),offset)); - emitpcode(POC_MOVWF, popGet(AOP(result),offset)); + if (same) + { + emitpcode (POC_RLF, popGet (AOP (left), offset)); + } + else + { + emitpcode (POC_RLFW, popGet (AOP (left), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); } - offset++; + offset++; } - freeAsmop(left,NULL,ic,TRUE); - freeAsmop(result,NULL,ic,TRUE); + freeAsmop (left, NULL, ic, TRUE); + freeAsmop (result, NULL, ic, TRUE); +} + +static void +genGetABit (iCode * ic) +{ + operand *left, *right, *result; + int shCount; + int offset; + int i; + + left = IC_LEFT (ic); + right = IC_RIGHT (ic); + result = IC_RESULT (ic); + + aopOp (left, ic, FALSE); + aopOp (right, ic, FALSE); + aopOp (result, ic, TRUE); + + shCount = (int) ulFromVal (AOP (right)->aopu.aop_lit); + offset = shCount / 8; + shCount %= 8; + + /* load and mask the source byte */ + mov2w (AOP (left), offset); + emitpcode (POC_ANDLW, popGetLit (1 << shCount)); + + /* move selected bit to bit 0 */ + switch (shCount) + { + case 0: + /* nothing more to do */ + break; + default: + /* keep W==0, force W=0x01 otherwise */ + emitSKPZ; + emitpcode (POC_MOVLW, popGetLit (1)); + break; + } // switch + + /* write result */ + emitpcode (POC_MOVWF, popGet (AOP (result), 0)); + + for (i = 1; i < AOP_SIZE (result); ++i) + { + emitpcode (POC_CLRF, popGet (AOP (result), i)); + } // for + + freeAsmop (left, NULL, ic, TRUE); + freeAsmop (right, NULL, ic, TRUE); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genGetHbit - generates code get highest order bit */ /*-----------------------------------------------------------------*/ -static void genGetHbit (iCode *ic) +static void +genGetHbit (iCode * ic) { - operand *left, *result; - left = IC_LEFT(ic); - result=IC_RESULT(ic); - aopOp (left,ic,FALSE); - aopOp (result,ic,FALSE); - - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* get the highest order byte into a */ - MOVA(aopGet(AOP(left),AOP_SIZE(left) - 1,FALSE,FALSE)); - if(AOP_TYPE(result) == AOP_CRY){ - pic14_emitcode("rlc","a"); - pic14_outBitC(result); - } - else{ - pic14_emitcode("rl","a"); - pic14_emitcode("anl","a,#0x01"); - pic14_outAcc(result); + operand *left, *result; + left = IC_LEFT (ic); + result = IC_RESULT (ic); + aopOp (left, ic, FALSE); + aopOp (result, ic, FALSE); + + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* get the highest order byte into a */ + MOVA (aopGet (AOP (left), AOP_SIZE (left) - 1, FALSE, FALSE)); + if (AOP_TYPE (result) == AOP_CRY) + { + pic14_emitcode ("rlc", "a"); + pic14_outBitC (result); + } + else + { + pic14_emitcode ("rl", "a"); + pic14_emitcode ("anl", "a,#0x01"); + pic14_outAcc (result); } - freeAsmop(left,NULL,ic,TRUE); - freeAsmop(result,NULL,ic,TRUE); + freeAsmop (left, NULL, ic, TRUE); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* AccLsh - shift left accumulator by known count */ /* MARK: pic14 always rotates through CARRY! */ /*-----------------------------------------------------------------*/ -static void AccLsh (pCodeOp *pcop,int shCount) +static void +AccLsh (pCodeOp * pcop, int shCount) { - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - shCount &= 0x0007; // shCount : 0..7 - switch(shCount){ - case 0 : - return; - break; - case 1 : - emitCLRC; - emitpcode(POC_RLF,pcop); - return; - break; - case 2 : - emitpcode(POC_RLF,pcop); - emitpcode(POC_RLF,pcop); - break; - case 3 : - emitpcode(POC_RLF,pcop); - emitpcode(POC_RLF,pcop); - emitpcode(POC_RLF,pcop); - break; - case 4 : - emitpcode(POC_SWAPF,pcop); - break; - case 5 : - emitpcode(POC_SWAPF,pcop); - emitpcode(POC_RLF,pcop); - break; - case 6 : - emitpcode(POC_SWAPF,pcop); - emitpcode(POC_RLF,pcop); - emitpcode(POC_RLF,pcop); - break; - case 7 : - emitpcode(POC_RRFW,pcop); - emitpcode(POC_RRF,pcop); - break; + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + shCount &= 0x0007; // shCount : 0..7 + switch (shCount) + { + case 0: + return; + break; + case 1: + emitCLRC; + emitpcode (POC_RLF, pcop); + return; + break; + case 2: + emitpcode (POC_RLF, pcop); + emitpcode (POC_RLF, pcop); + break; + case 3: + emitpcode (POC_RLF, pcop); + emitpcode (POC_RLF, pcop); + emitpcode (POC_RLF, pcop); + break; + case 4: + emitpcode (POC_SWAPF, pcop); + break; + case 5: + emitpcode (POC_SWAPF, pcop); + emitpcode (POC_RLF, pcop); + break; + case 6: + emitpcode (POC_SWAPF, pcop); + emitpcode (POC_RLF, pcop); + emitpcode (POC_RLF, pcop); + break; + case 7: + emitpcode (POC_RRFW, pcop); + emitpcode (POC_RRF, pcop); + break; } - /* clear invalid bits */ - emitpcode(POC_MOVLW, popGetLit ((unsigned char)(~((1UL << shCount) - 1)))); - emitpcode(POC_ANDWF, pcop); + /* clear invalid bits */ + emitpcode (POC_MOVLW, popGetLit ((unsigned char) (~((1UL << shCount) - 1)))); + emitpcode (POC_ANDWF, pcop); } /*-----------------------------------------------------------------*/ @@ -4683,102 +5030,117 @@ /* 1: mask out invalid bits (zero-extend) */ /* 2: sign-extend result (pretty slow) */ /*-----------------------------------------------------------------*/ -static void AccRsh (pCodeOp *pcop,int shCount, int mask_mode) +static void +AccRsh (pCodeOp * pcop, int shCount, int mask_mode) { - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - shCount &= 0x0007; // shCount : 0..7 - switch(shCount){ - case 0 : + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + shCount &= 0x0007; // shCount : 0..7 + switch (shCount) + { + case 0: + return; + break; + case 1: + /* load sign if needed */ + if (mask_mode == 2) + emitpcode (POC_RLFW, pcop); + else if (mask_mode == 1) + emitCLRC; + emitpcode (POC_RRF, pcop); + return; + break; + case 2: + /* load sign if needed */ + if (mask_mode == 2) + emitpcode (POC_RLFW, pcop); + emitpcode (POC_RRF, pcop); + /* load sign if needed */ + if (mask_mode == 2) + emitpcode (POC_RLFW, pcop); + emitpcode (POC_RRF, pcop); + if (mask_mode == 2) return; - break; - case 1 : - /* load sign if needed */ - if (mask_mode == 2) emitpcode(POC_RLFW,pcop); - else if (mask_mode == 1) emitCLRC; - emitpcode(POC_RRF,pcop); + break; + case 3: + /* load sign if needed */ + if (mask_mode == 2) + emitpcode (POC_RLFW, pcop); + emitpcode (POC_RRF, pcop); + /* load sign if needed */ + if (mask_mode == 2) + emitpcode (POC_RLFW, pcop); + emitpcode (POC_RRF, pcop); + /* load sign if needed */ + if (mask_mode == 2) + emitpcode (POC_RLFW, pcop); + emitpcode (POC_RRF, pcop); + if (mask_mode == 2) return; - break; - case 2 : - /* load sign if needed */ - if (mask_mode == 2) emitpcode(POC_RLFW,pcop); - emitpcode(POC_RRF,pcop); - /* load sign if needed */ - if (mask_mode == 2) emitpcode(POC_RLFW,pcop); - emitpcode(POC_RRF,pcop); - if (mask_mode == 2) return; - break; - case 3 : - /* load sign if needed */ - if (mask_mode == 2) emitpcode(POC_RLFW,pcop); - emitpcode(POC_RRF,pcop); - /* load sign if needed */ - if (mask_mode == 2) emitpcode(POC_RLFW,pcop); - emitpcode(POC_RRF,pcop); - /* load sign if needed */ - if (mask_mode == 2) emitpcode(POC_RLFW,pcop); - emitpcode(POC_RRF,pcop); - if (mask_mode == 2) return; - break; - case 4 : - emitpcode(POC_SWAPF,pcop); - break; - case 5 : - emitpcode(POC_SWAPF,pcop); - emitpcode(POC_RRF,pcop); - break; - case 6 : - emitpcode(POC_SWAPF,pcop); - emitpcode(POC_RRF,pcop); - emitpcode(POC_RRF,pcop); - break; - case 7 : - if (mask_mode == 2) + break; + case 4: + emitpcode (POC_SWAPF, pcop); + break; + case 5: + emitpcode (POC_SWAPF, pcop); + emitpcode (POC_RRF, pcop); + break; + case 6: + emitpcode (POC_SWAPF, pcop); + emitpcode (POC_RRF, pcop); + emitpcode (POC_RRF, pcop); + break; + case 7: + if (mask_mode == 2) { - /* load sign */ - emitpcode(POC_RLFW,pcop); - emitpcode(POC_CLRF,pcop); - emitSKPNC; - emitpcode(POC_COMF,pcop); - return; - } else { - emitpcode(POC_RLFW,pcop); - emitpcode(POC_RLF,pcop); + /* load sign */ + emitpcode (POC_RLFW, pcop); + emitpcode (POC_CLRF, pcop); + emitSKPNC; + emitpcode (POC_COMF, pcop); + return; } - break; + else + { + emitpcode (POC_RLFW, pcop); + emitpcode (POC_RLF, pcop); + } + break; } - if (mask_mode == 0) + if (mask_mode == 0) { - /* leave invalid bits undefined */ - return; + /* leave invalid bits undefined */ + return; } - /* clear invalid bits -- zero-extend */ - emitpcode(POC_MOVLW, popGetLit (0x00ff >> shCount)); - emitpcode(POC_ANDWF, pcop); + /* clear invalid bits -- zero-extend */ + emitpcode (POC_MOVLW, popGetLit (0x00ff >> shCount)); + emitpcode (POC_ANDWF, pcop); - if (mask_mode == 2) { + if (mask_mode == 2) + { /* sign-extend */ - emitpcode(POC_MOVLW, popGetLit (0x00ff << (8 - shCount))); - emitpcode(POC_BTFSC, newpCodeOpBit (get_op(pcop,NULL,0), 7 - shCount ,0)); - emitpcode(POC_IORWF, pcop); + emitpcode (POC_MOVLW, popGetLit (0x00ff << (8 - shCount))); + emitpcode (POC_BTFSC, newpCodeOpBit (get_op (pcop, NULL, 0), 7 - shCount, 0)); + emitpcode (POC_IORWF, pcop); } } /*-----------------------------------------------------------------*/ /* movLeft2Result - move byte from left to result */ /*-----------------------------------------------------------------*/ -static void movLeft2Result (operand *left, int offl, - operand *result, int offr) +static void +movLeft2Result (operand * left, int offl, operand * result, int offr) { - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if(!pic14_sameRegs(AOP(left),AOP(result)) || (offl != offr)){ - aopGet(AOP(left),offl,FALSE,FALSE); + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + if (!pic14_sameRegs (AOP (left), AOP (result)) || (offl != offr)) + { + aopGet (AOP (left), offl, FALSE, FALSE); - emitpcode(POC_MOVFW, popGet(AOP(left),offl)); - emitpcode(POC_MOVWF, popGet(AOP(result),offr)); + emitpcode (POC_MOVFW, popGet (AOP (left), offl)); + emitpcode (POC_MOVWF, popGet (AOP (result), offr)); } } @@ -4786,187 +5148,214 @@ /* shiftLeft_Left2ResultLit - shift left by known count */ /*-----------------------------------------------------------------*/ -static void shiftLeft_Left2ResultLit (operand *left, operand *result, int shCount) +static void +shiftLeft_Left2ResultLit (operand * left, operand * result, int shCount) { - int size, same, offr, i; + int size, same, offr, i; - size = AOP_SIZE(left); - if (AOP_SIZE(result) < size) size = AOP_SIZE(result); + size = AOP_SIZE (left); + if (AOP_SIZE (result) < size) + size = AOP_SIZE (result); - same = pic14_sameRegs (AOP(left), AOP(result)); + same = pic14_sameRegs (AOP (left), AOP (result)); - offr = shCount / 8; - shCount = shCount & 0x07; + offr = shCount / 8; + shCount = shCount & 0x07; - size -= offr; + size -= offr; - switch (shCount) + switch (shCount) { - case 0: /* takes 0 or 2N cycles (for offr==0) */ - if (!same || offr) { - for (i=size-1; i >= 0; i--) - movLeft2Result (left, i, result, offr + i); - } // if - break; + case 0: /* takes 0 or 2N cycles (for offr==0) */ + if (!same || offr) + { + for (i = size - 1; i >= 0; i--) + movLeft2Result (left, i, result, offr + i); + } // if + break; - case 1: /* takes 1N+1 or 2N+1 cycles (or offr==0) */ - if (same && offr) { - shiftLeft_Left2ResultLit (left, result, 8 * offr); - shiftLeft_Left2ResultLit (result, result, shCount); - return; /* prevent clearing result again */ - } else { - emitCLRC; - for (i=0; i < size; i++) { - if (same && !offr) { - emitpcode (POC_RLF, popGet (AOP(left), i)); - } else { - emitpcode (POC_RLFW, popGet (AOP(left), i)); - emitpcode (POC_MOVWF, popGet (AOP(result), i + offr)); - } // if - } // for - } // if (offr) - break; + case 1: /* takes 1N+1 or 2N+1 cycles (or offr==0) */ + if (same && offr) + { + shiftLeft_Left2ResultLit (left, result, 8 * offr); + shiftLeft_Left2ResultLit (result, result, shCount); + return; /* prevent clearing result again */ + } + else + { + emitCLRC; + for (i = 0; i < size; i++) + { + if (same && !offr) + { + emitpcode (POC_RLF, popGet (AOP (left), i)); + } + else + { + emitpcode (POC_RLFW, popGet (AOP (left), i)); + emitpcode (POC_MOVWF, popGet (AOP (result), i + offr)); + } // if + } // for + } // if (offr) + break; - case 4: /* takes 3+5(N-1) = 5N-2 cycles (for offr==0) */ - /* works in-place/with offr as well */ - emitpcode (POC_SWAPFW, popGet (AOP(left), size-1)); - emitpcode (POC_ANDLW, popGetLit (0xF0)); - emitpcode (POC_MOVWF, popGet(AOP(result), size-1+offr)); - - for (i = size - 2; i >= 0; i--) - { - emitpcode (POC_SWAPFW, popGet (AOP(left), i)); - emitpcode (POC_MOVWF, popGet (AOP(result), i + offr)); - emitpcode (POC_ANDLW, popGetLit (0x0F)); - emitpcode (POC_IORWF, popGet (AOP(result), i + offr + 1)); - emitpcode (POC_XORWF, popGet (AOP(result), i + offr)); - } // for i - break; + case 4: /* takes 3+5(N-1) = 5N-2 cycles (for offr==0) */ + /* works in-place/with offr as well */ + emitpcode (POC_SWAPFW, popGet (AOP (left), size - 1)); + emitpcode (POC_ANDLW, popGetLit (0xF0)); + emitpcode (POC_MOVWF, popGet (AOP (result), size - 1 + offr)); - case 7: /* takes 2(N-1)+3 = 2N+1 cycles */ - /* works in-place/with offr as well */ - emitpcode (POC_RRFW, popGet (AOP(left), size-1)); - for (i = size-2; i >= 0; i--) { - emitpcode (POC_RRFW, popGet (AOP(left), i)); - emitpcode (POC_MOVWF, popGet (AOP(result), offr + i + 1)); - } // for i - emitpcode (POC_CLRF, popGet (AOP(result), offr)); - emitpcode (POC_RRF, popGet (AOP(result), offr)); - break; + for (i = size - 2; i >= 0; i--) + { + emitpcode (POC_SWAPFW, popGet (AOP (left), i)); + emitpcode (POC_MOVWF, popGet (AOP (result), i + offr)); + emitpcode (POC_ANDLW, popGetLit (0x0F)); + emitpcode (POC_IORWF, popGet (AOP (result), i + offr + 1)); + emitpcode (POC_XORWF, popGet (AOP (result), i + offr)); + } // for i + break; + + case 7: /* takes 2(N-1)+3 = 2N+1 cycles */ + /* works in-place/with offr as well */ + emitpcode (POC_RRFW, popGet (AOP (left), size - 1)); + for (i = size - 2; i >= 0; i--) + { + emitpcode (POC_RRFW, popGet (AOP (left), i)); + emitpcode (POC_MOVWF, popGet (AOP (result), offr + i + 1)); + } // for i + emitpcode (POC_CLRF, popGet (AOP (result), offr)); + emitpcode (POC_RRF, popGet (AOP (result), offr)); + break; default: - shiftLeft_Left2ResultLit (left, result, offr * 8 + shCount-1); - shiftLeft_Left2ResultLit (result, result, 1); - return; /* prevent clearing result again */ - break; - } // switch + shiftLeft_Left2ResultLit (left, result, offr * 8 + shCount - 1); + shiftLeft_Left2ResultLit (result, result, 1); + return; /* prevent clearing result again */ + break; + } // switch - while (0 < offr--) + while (0 < offr--) { - emitpcode (POC_CLRF, popGet (AOP(result), offr)); - } // while + emitpcode (POC_CLRF, popGet (AOP (result), offr)); + } // while } /*-----------------------------------------------------------------*/ /* shiftRight_Left2ResultLit - shift right by known count */ /*-----------------------------------------------------------------*/ -static void shiftRight_Left2ResultLit (operand *left, operand *result, int shCount, int sign) +static void +shiftRight_Left2ResultLit (operand * left, operand * result, int shCount, int sign) { - int size, same, offr, i; + int size, same, offr, i; - size = AOP_SIZE(left); - if (AOP_SIZE(result) < size) size = AOP_SIZE(result); + size = AOP_SIZE (left); + if (AOP_SIZE (result) < size) + size = AOP_SIZE (result); - same = pic14_sameRegs (AOP(left), AOP(result)); + same = pic14_sameRegs (AOP (left), AOP (result)); - offr = shCount / 8; - shCount = shCount & 0x07; + offr = shCount / 8; + shCount = shCount & 0x07; - size -= offr; + size -= offr; - if (size) + if (size) { - switch (shCount) + switch (shCount) { - case 0: /* takes 0 or 2N cycles (for offr==0) */ - if (!same || offr) { - for (i=0; i < size; i++) - movLeft2Result (left, i + offr, result, i); - } // if - break; + case 0: /* takes 0 or 2N cycles (for offr==0) */ + if (!same || offr) + { + for (i = 0; i < size; i++) + movLeft2Result (left, i + offr, result, i); + } // if + break; - case 1: /* takes 1N+1(3) or 2N+1(3) cycles (or offr==0) */ - emitpComment ("%s:%d: shCount=%d, size=%d, sign=%d, same=%d, offr=%d", __FUNCTION__, __LINE__, shCount, size, sign, same, offr); - if (same && offr) { - shiftRight_Left2ResultLit (left, result, 8 * offr, sign); - shiftRight_Left2ResultLit (result, result, shCount, sign); - return; /* prevent sign-extending result again */ - } else { - emitCLRC; - if (sign) { - emitpcode (POC_BTFSC, newpCodeOpBit (aopGet (AOP(left), AOP_SIZE(left)-1, FALSE, FALSE), 7, 0)); - emitSETC; + case 1: /* takes 1N+1(3) or 2N+1(3) cycles (or offr==0) */ + emitpComment ("%s:%d: shCount=%d, size=%d, sign=%d, same=%d, offr=%d", __FUNCTION__, __LINE__, shCount, size, sign, + same, offr); + if (same && offr) + { + shiftRight_Left2ResultLit (left, result, 8 * offr, sign); + shiftRight_Left2ResultLit (result, result, shCount, sign); + return; /* prevent sign-extending result again */ + } + else + { + emitCLRC; + if (sign) + { + emitpcode (POC_BTFSC, newpCodeOpBit (aopGet (AOP (left), AOP_SIZE (left) - 1, FALSE, FALSE), 7, 0)); + emitSETC; } - for (i = size-1; i >= 0; i--) { - if (same && !offr) { - emitpcode (POC_RRF, popGet (AOP(left), i)); - } else { - emitpcode (POC_RRFW, popGet (AOP(left), i + offr)); - emitpcode (POC_MOVWF, popGet (AOP(result), i)); + for (i = size - 1; i >= 0; i--) + { + if (same && !offr) + { + emitpcode (POC_RRF, popGet (AOP (left), i)); } - } // for i - } // if (offr) - break; + else + { + emitpcode (POC_RRFW, popGet (AOP (left), i + offr)); + emitpcode (POC_MOVWF, popGet (AOP (result), i)); + } + } // for i + } // if (offr) + break; - case 4: /* takes 3(6)+5(N-1) = 5N-2(+1) cycles (for offr==0) */ - /* works in-place/with offr as well */ - emitpcode (POC_SWAPFW, popGet (AOP(left), offr)); - emitpcode (POC_ANDLW, popGetLit (0x0F)); - emitpcode (POC_MOVWF, popGet(AOP(result), 0)); - - for (i = 1; i < size; i++) - { - emitpcode (POC_SWAPFW, popGet (AOP(left), i + offr)); - emitpcode (POC_MOVWF, popGet (AOP(result), i)); - emitpcode (POC_ANDLW, popGetLit (0xF0)); - emitpcode (POC_IORWF, popGet (AOP(result), i - 1)); - emitpcode (POC_XORWF, popGet (AOP(result), i)); - } // for i - - if (sign) - { - emitpcode (POC_MOVLW, popGetLit (0xF0)); - emitpcode (POC_BTFSC, newpCodeOpBit (aopGet (AOP(result), size-1, FALSE, FALSE), 3, 0)); - emitpcode (POC_IORWF, popGet (AOP(result), size-1)); - } // if - break; + case 4: /* takes 3(6)+5(N-1) = 5N-2(+1) cycles (for offr==0) */ + /* works in-place/with offr as well */ + emitpcode (POC_SWAPFW, popGet (AOP (left), offr)); + emitpcode (POC_ANDLW, popGetLit (0x0F)); + emitpcode (POC_MOVWF, popGet (AOP (result), 0)); + + for (i = 1; i < size; i++) + { + emitpcode (POC_SWAPFW, popGet (AOP (left), i + offr)); + emitpcode (POC_MOVWF, popGet (AOP (result), i)); + emitpcode (POC_ANDLW, popGetLit (0xF0)); + emitpcode (POC_IORWF, popGet (AOP (result), i - 1)); + emitpcode (POC_XORWF, popGet (AOP (result), i)); + } // for i - case 7: /* takes 2(N-1)+3(4) = 2N+1(2) cycles */ - /* works in-place/with offr as well */ - emitpcode (POC_RLFW, popGet (AOP(left), offr)); - for (i = 0; i < size-1; i++) { - emitpcode (POC_RLFW, popGet (AOP(left), offr + i + 1)); - emitpcode (POC_MOVWF, popGet (AOP(result), i)); - } // for i - emitpcode (POC_CLRF, popGet (AOP(result), size-1)); - if (!sign) { - emitpcode (POC_RLF, popGet (AOP(result), size-1)); - } else { - emitSKPNC; - emitpcode (POC_DECF, popGet (AOP(result), size-1)); + if (sign) + { + emitpcode (POC_MOVLW, popGetLit (0xF0)); + emitpcode (POC_BTFSC, newpCodeOpBit (aopGet (AOP (result), size - 1, FALSE, FALSE), 3, 0)); + emitpcode (POC_IORWF, popGet (AOP (result), size - 1)); + } // if + break; + + case 7: /* takes 2(N-1)+3(4) = 2N+1(2) cycles */ + /* works in-place/with offr as well */ + emitpcode (POC_RLFW, popGet (AOP (left), offr)); + for (i = 0; i < size - 1; i++) + { + emitpcode (POC_RLFW, popGet (AOP (left), offr + i + 1)); + emitpcode (POC_MOVWF, popGet (AOP (result), i)); + } // for i + emitpcode (POC_CLRF, popGet (AOP (result), size - 1)); + if (!sign) + { + emitpcode (POC_RLF, popGet (AOP (result), size - 1)); } - break; + else + { + emitSKPNC; + emitpcode (POC_DECF, popGet (AOP (result), size - 1)); + } + break; default: - shiftRight_Left2ResultLit (left, result, offr * 8 + shCount-1, sign); - shiftRight_Left2ResultLit (result, result, 1, sign); - return; /* prevent sign extending result again */ - break; - } // switch - } // if + shiftRight_Left2ResultLit (left, result, offr * 8 + shCount - 1, sign); + shiftRight_Left2ResultLit (result, result, 1, sign); + return; /* prevent sign extending result again */ + break; + } // switch + } // if - addSign (result, size, sign); + addSign (result, size, sign); } /*-----------------------------------------------------------------* @@ -4974,27 +5363,32 @@ * if endian == 1, then the high byte (i.e base address + size of * register) is used first else the low byte is used first; *-----------------------------------------------------------------*/ -static void genMultiAsm( PIC_OPCODE poc, operand *reg, int size, int endian) +static void +genMultiAsm (PIC_OPCODE poc, operand * reg, int size, int endian) { - int offset = 0; + int offset = 0; - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - if(!reg) - return; + if (!reg) + return; - if(!endian) { - endian = 1; - } else { - endian = -1; - offset = size-1; + if (!endian) + { + endian = 1; + } + else + { + endian = -1; + offset = size - 1; } - while(size--) { - emitpcode(poc, popGet(AOP(reg),offset)); - offset += endian; + while (size--) + { + emitpcode (poc, popGet (AOP (reg), offset)); + offset += endian; } } @@ -5003,194 +5397,207 @@ /* loadSignToC - load the operand's sign bit into CARRY */ /*-----------------------------------------------------------------*/ -static void loadSignToC (operand *op) +static void +loadSignToC (operand * op) { - FENTRY; - assert (op && AOP(op) && AOP_SIZE(op)); + FENTRY; + assert (op && AOP (op) && AOP_SIZE (op)); - emitCLRC; - emitpcode(POC_BTFSC, newpCodeOpBit(aopGet(AOP(op),AOP_SIZE(op)-1,FALSE,FALSE),7,0)); - emitSETC; + emitCLRC; + emitpcode (POC_BTFSC, newpCodeOpBit (aopGet (AOP (op), AOP_SIZE (op) - 1, FALSE, FALSE), 7, 0)); + emitSETC; } /*-----------------------------------------------------------------*/ /* genRightShift - generate code for right shifting */ /*-----------------------------------------------------------------*/ -static void genGenericShift (iCode *ic, int shiftRight) +static void +genGenericShift (iCode * ic, int shiftRight) { - operand *right, *left, *result; - sym_link *retype ; - int size; - symbol *tlbl, *tlbl1, *inverselbl; - - FENTRY; - /* if signed then we do it the hard way preserve the - sign bit moving it inwards */ - retype = getSpec(operandType(IC_RESULT(ic))); - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - /* signed & unsigned types are treated the same : i.e. the - signed is NOT propagated inwards : quoting from the - ANSI - standard : "for E1 >> E2, is equivalent to division - by 2**E2 if unsigned or if it has a non-negative value, - otherwise the result is implementation defined ", MY definition - is that the sign does not get propagated */ - - right = IC_RIGHT(ic); - left = IC_LEFT(ic); - result = IC_RESULT(ic); - - aopOp(right,ic,FALSE); - aopOp(left,ic,FALSE); - aopOp(result,ic,FALSE); - - /* if the shift count is known then do it - as efficiently as possible */ - if (AOP_TYPE(right) == AOP_LIT) { - int lit = (int) ulFromVal (AOP(right)->aopu.aop_lit); - if (lit < 0) - { - lit = -lit; - shiftRight = !shiftRight; - } + operand *right, *left, *result; + int size; + symbol *tlbl, *tlbl1, *inverselbl; - if (shiftRight) - shiftRight_Left2ResultLit (left, result, lit, !SPEC_USIGN(operandType(left))); - else - shiftLeft_Left2ResultLit (left, result, lit); - //genRightShiftLiteral (left,right,result,ic, 0); - return ; - } - - /* shift count is unknown then we have to form - a loop get the loop count in B : Note: we take - only the lower order byte since shifting - more that 32 bits make no sense anyway, ( the - largest size of an object can be only 32 bits ) */ - - /* we must not overwrite the shift counter */ - assert (!pic14_sameRegs(AOP(right),AOP(result))); - - /* now move the left to the result if they are not the - same */ - if (!pic14_sameRegs(AOP(left),AOP(result))) - { - size = min(AOP_SIZE(result), AOP_SIZE(left)); - while (size--) { - mov2w(AOP(left), size); - movwf(AOP(result), size); - } - addSign (result, AOP_SIZE(left), !SPEC_USIGN(operandType(left))); - } - - tlbl = newiTempLabel(NULL); - tlbl1= newiTempLabel(NULL); - inverselbl = NULL; - size = AOP_SIZE(result); - - mov2w(AOP(right),0); - if (!SPEC_USIGN(operandType(right))) - { - inverselbl = newiTempLabel(NULL); - /* signed shift count -- invert shift direction for c<0 */ - emitpcode(POC_BTFSC, newpCodeOpBit(aopGet(AOP(right),0,FALSE,FALSE),7,0)); - emitpcode(POC_GOTO, popGetLabel(inverselbl->key)); - } // if - emitpcode(POC_SUBLW, popGetLit(0)); /* -count in WREG, 0-x > 0 --> BORROW = !CARRY --> CARRY is clear! */ - /* check for `a = b >> c' with `-c == 0' */ - emitSKPNZ; - emitpcode(POC_GOTO, popGetLabel(tlbl1->key)); - emitpLabel(tlbl->key); - /* propagate the sign bit inwards for SIGNED result */ - if (shiftRight && !SPEC_USIGN(operandType(result))) loadSignToC(result); - genMultiAsm(shiftRight ? POC_RRF : POC_RLF, result, size, shiftRight); - emitpcode(POC_ADDLW, popGetLit(1)); /* clears CARRY (unless W==0 afterwards) */ - emitSKPC; - emitpcode(POC_GOTO,popGetLabel(tlbl->key)); + FENTRY; + /* if signed then we do it the hard way preserve the + sign bit moving it inwards */ + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - if (!SPEC_USIGN(operandType(right))) + /* signed & unsigned types are treated the same : i.e. the + signed is NOT propagated inwards : quoting from the + ANSI - standard : "for E1 >> E2, is equivalent to division + by 2**E2 if unsigned or if it has a non-negative value, + otherwise the result is implementation defined ", MY definition + is that the sign does not get propagated */ + + right = IC_RIGHT (ic); + left = IC_LEFT (ic); + result = IC_RESULT (ic); + + aopOp (right, ic, FALSE); + aopOp (left, ic, FALSE); + aopOp (result, ic, FALSE); + + /* if the shift count is known then do it + as efficiently as possible */ + if (AOP_TYPE (right) == AOP_LIT) { - symbol *inv_loop = newiTempLabel(NULL); + int lit = (int) ulFromVal (AOP (right)->aopu.aop_lit); + if (lit < 0) + { + lit = -lit; + shiftRight = !shiftRight; + } - shiftRight = !shiftRight; /* invert shift direction */ + if (shiftRight) + shiftRight_Left2ResultLit (left, result, lit, !SPEC_USIGN (operandType (left))); + else + shiftLeft_Left2ResultLit (left, result, lit); + //genRightShiftLiteral (left,right,result,ic, 0); + return; + } - /* we came here from the code above -- we are done */ - emitpcode(POC_GOTO, popGetLabel(tlbl1->key)); + /* shift count is unknown then we have to form + a loop get the loop count in B : Note: we take + only the lower order byte since shifting + more that 32 bits make no sense anyway, ( the + largest size of an object can be only 32 bits ) */ + + /* we must not overwrite the shift counter */ + assert (!pic14_sameRegs (AOP (right), AOP (result))); + + /* now move the left to the result if they are not the + same */ + if (!pic14_sameRegs (AOP (left), AOP (result))) + { + size = min (AOP_SIZE (result), AOP_SIZE (left)); + while (size--) + { + mov2w (AOP (left), size); + movwf (AOP (result), size); + } + addSign (result, AOP_SIZE (left), !SPEC_USIGN (operandType (left))); + } - /* emit code for shifting N<0 steps, count is already in W */ - emitpLabel(inverselbl->key); - if (!shiftRight || SPEC_USIGN(operandType(result))) emitCLRC; - emitpLabel(inv_loop->key); - /* propagate the sign bit inwards for SIGNED result */ - if (shiftRight && !SPEC_USIGN(operandType(result))) loadSignToC(result); - genMultiAsm(shiftRight ? POC_RRF : POC_RLF, result, size, shiftRight); - emitpcode(POC_ADDLW, popGetLit(1)); - emitSKPC; - emitpcode(POC_GOTO, popGetLabel(inv_loop->key)); - } // if + tlbl = newiTempLabel (NULL); + tlbl1 = newiTempLabel (NULL); + inverselbl = NULL; + size = AOP_SIZE (result); + + mov2w (AOP (right), 0); + if (!SPEC_USIGN (operandType (right))) + { + inverselbl = newiTempLabel (NULL); + /* signed shift count -- invert shift direction for c<0 */ + emitpcode (POC_BTFSC, newpCodeOpBit (aopGet (AOP (right), 0, FALSE, FALSE), 7, 0)); + emitpcode (POC_GOTO, popGetLabel (inverselbl->key)); + } // if + emitpcode (POC_SUBLW, popGetLit (0)); /* -count in WREG, 0-x > 0 --> BORROW = !CARRY --> CARRY is clear! */ + /* check for `a = b >> c' with `-c == 0' */ + emitSKPNZ; + emitpcode (POC_GOTO, popGetLabel (tlbl1->key)); + emitpLabel (tlbl->key); + /* propagate the sign bit inwards for SIGNED result */ + if (shiftRight && !SPEC_USIGN (operandType (result))) + loadSignToC (result); + genMultiAsm (shiftRight ? POC_RRF : POC_RLF, result, size, shiftRight); + emitpcode (POC_ADDLW, popGetLit (1)); /* clears CARRY (unless W==0 afterwards) */ + emitSKPC; + emitpcode (POC_GOTO, popGetLabel (tlbl->key)); + + if (!SPEC_USIGN (operandType (right))) + { + symbol *inv_loop = newiTempLabel (NULL); + + shiftRight = !shiftRight; /* invert shift direction */ + + /* we came here from the code above -- we are done */ + emitpcode (POC_GOTO, popGetLabel (tlbl1->key)); + + /* emit code for shifting N<0 steps, count is already in W */ + emitpLabel (inverselbl->key); + if (!shiftRight || SPEC_USIGN (operandType (result))) + emitCLRC; + emitpLabel (inv_loop->key); + /* propagate the sign bit inwards for SIGNED result */ + if (shiftRight && !SPEC_USIGN (operandType (result))) + loadSignToC (result); + genMultiAsm (shiftRight ? POC_RRF : POC_RLF, result, size, shiftRight); + emitpcode (POC_ADDLW, popGetLit (1)); + emitSKPC; + emitpcode (POC_GOTO, popGetLabel (inv_loop->key)); + } // if - emitpLabel(tlbl1->key); + emitpLabel (tlbl1->key); - freeAsmop(left,NULL,ic,TRUE); - freeAsmop (right,NULL,ic,TRUE); - freeAsmop(result,NULL,ic,TRUE); + freeAsmop (left, NULL, ic, TRUE); + freeAsmop (right, NULL, ic, TRUE); + freeAsmop (result, NULL, ic, TRUE); } -static void genRightShift (iCode *ic) +static void +genRightShift (iCode * ic) { - genGenericShift(ic, 1); + genGenericShift (ic, 1); } -static void genLeftShift (iCode *ic) +static void +genLeftShift (iCode * ic) { - genGenericShift(ic, 0); + genGenericShift (ic, 0); } /*-----------------------------------------------------------------*/ /* SetIrp - Set IRP bit */ /*-----------------------------------------------------------------*/ -static void SetIrp(operand *result) +static void +SetIrp (operand * result) { - FENTRY; - if (AOP_TYPE(result) == AOP_LIT) { - unsigned lit = (unsigned) double2ul (operandLitValue(result)); - if (lit&0x100) + FENTRY; + if (AOP_TYPE (result) == AOP_LIT) + { + unsigned lit = (unsigned) double2ul (operandLitValue (result)); + if (lit & 0x100) + emitSETIRP; + else + emitCLRIRP; + } + else + { + if ((AOP_TYPE (result) == AOP_PCODE) && (AOP (result)->aopu.pcop->type == PO_LITERAL)) + { + int addrs = PCOL (AOP (result)->aopu.pcop)->lit; + if (addrs & 0x100) emitSETIRP; - else + else emitCLRIRP; - } else { - if ((AOP_TYPE(result) == AOP_PCODE) - && (AOP(result)->aopu.pcop->type == PO_LITERAL)) - { - int addrs = PCOL(AOP(result)->aopu.pcop)->lit; - if (addrs & 0x100) - emitSETIRP; - else - emitCLRIRP; - } else { - emitCLRIRP; /* always ensure this is clear as it may have previouly been set */ - if(AOP_SIZE(result) > 1) { - emitpcode(POC_BTFSC,newpCodeOpBit(aopGet(AOP(result),1,FALSE,FALSE),0,0)); - emitSETIRP; + } + else + { + emitCLRIRP; /* always ensure this is clear as it may have previouly been set */ + if (AOP_SIZE (result) > 1) + { + emitpcode (POC_BTFSC, newpCodeOpBit (aopGet (AOP (result), 1, FALSE, FALSE), 0, 0)); + emitSETIRP; } } } } static void -setup_fsr (operand *ptr) +setup_fsr (operand * ptr) { - if (pic14_getPIC()->isEnhancedCore) + if (pic14_getPIC ()->isEnhancedCore) { - mov2w_op(ptr, 0); - emitpcode(POC_MOVWF, popCopyReg (&pc_fsr0l)); - mov2w_op(ptr, 1); - emitpcode(POC_MOVWF, popCopyReg (&pc_fsr0h)); + mov2w_op (ptr, 0); + emitpcode (POC_MOVWF, popCopyReg (&pc_fsr0l)); + mov2w_op (ptr, 1); + emitpcode (POC_MOVWF, popCopyReg (&pc_fsr0h)); } else { - mov2w_op(ptr, 0); - emitpcode(POC_MOVWF, popCopyReg (&pc_fsr)); + mov2w_op (ptr, 0); + emitpcode (POC_MOVWF, popCopyReg (&pc_fsr)); /* also setup-up IRP */ SetIrp (ptr); @@ -5200,44 +5607,45 @@ static void inc_fsr (int delta) { - if (0 == delta) { + if (0 == delta) + { /* Nothing to do. */ return; - } // if + } // if - if (pic14_getPIC()->isEnhancedCore) + if (pic14_getPIC ()->isEnhancedCore) { - assert(delta >= -32); - assert(delta < 32); + assert (delta >= -32); + assert (delta < 32); /* Hack: Turn this into a PCI (not that easy due to the argument structure). */ - addpCode2pBlock(pb,newpCodeAsmDir("ADDFSR", "FSR0, %d", delta)); + addpCode2pBlock (pb, newpCodeAsmDir ("ADDFSR", "FSR0, %d", delta)); } else { switch (delta) { - case 1: - emitpcode(POC_INCF, popCopyReg(&pc_fsr)); - break; - case -1: - emitpcode(POC_DECF, popCopyReg(&pc_fsr)); - break; - case 0: - break; - default: - while (delta > 0) - { - inc_fsr (1); - --delta; - } - while (delta < 0) - { - inc_fsr(-1); - ++delta; - } - break; - } // switch - } // if + case 1: + emitpcode (POC_INCF, popCopyReg (&pc_fsr)); + break; + case -1: + emitpcode (POC_DECF, popCopyReg (&pc_fsr)); + break; + case 0: + break; + default: + while (delta > 0) + { + inc_fsr (1); + --delta; + } + while (delta < 0) + { + inc_fsr (-1); + ++delta; + } + break; + } // switch + } // if } /*-----------------------------------------------------------------*/ @@ -5245,39 +5653,40 @@ /* arbitrary pointer (__code, __data, generic) */ /*-----------------------------------------------------------------*/ static void -emitPtrByteGet (operand *src, int p_type, bool alreadyAddressed) +emitPtrByteGet (operand * src, int p_type, bool alreadyAddressed) { - FENTRY; - switch (p_type) + FENTRY; + switch (p_type) { case POINTER: case FPOINTER: - if (!alreadyAddressed) setup_fsr (src); - emitpcode(POC_MOVFW, popCopyReg (pc_indf)); + if (!alreadyAddressed) + setup_fsr (src); + emitpcode (POC_MOVFW, popCopyReg (pc_indf)); break; case CPOINTER: - assert( AOP_SIZE(src) == 2 ); - mov2w_op(src, 0); - emitpcode(POC_MOVWF, popRegFromIdx (Gstack_base_addr-1)); - mov2w_op(src, 1); - emitpcode(POC_MOVWF, popRegFromIdx (Gstack_base_addr)); - emitpcode(POC_MOVLW, popGetLit (GPTRTAG_CODE)); /* GPOINTER tag for __code space */ + assert (AOP_SIZE (src) == 2); + mov2w_op (src, 0); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr - 1)); + mov2w_op (src, 1); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr)); + emitpcode (POC_MOVLW, popGetLit (GPTRTAG_CODE)); /* GPOINTER tag for __code space */ call_libraryfunc ("__gptrget1"); break; case GPOINTER: - assert( AOP_SIZE(src) == 3 ); - mov2w_op(src, 0); - emitpcode(POC_MOVWF, popRegFromIdx (Gstack_base_addr-1)); - mov2w_op(src, 1); - emitpcode(POC_MOVWF, popRegFromIdx (Gstack_base_addr)); - mov2w_op(src, 2); + assert (AOP_SIZE (src) == 3); + mov2w_op (src, 0); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr - 1)); + mov2w_op (src, 1); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr)); + mov2w_op (src, 2); call_libraryfunc ("__gptrget1"); break; default: - assert( !"unhandled pointer type" ); + assert (!"unhandled pointer type"); break; } } @@ -5287,33 +5696,34 @@ /* pointer register INDF (legacy 8051 uses R0, R1, or DPTR). */ /*-----------------------------------------------------------------*/ static void -emitPtrByteSet (operand *dst, int p_type, bool alreadyAddressed) +emitPtrByteSet (operand * dst, int p_type, bool alreadyAddressed) { - FENTRY; - switch (p_type) + FENTRY; + switch (p_type) { case POINTER: case FPOINTER: - if (!alreadyAddressed) setup_fsr (dst); - emitpcode(POC_MOVWF, popCopyReg (pc_indf)); + if (!alreadyAddressed) + setup_fsr (dst); + emitpcode (POC_MOVWF, popCopyReg (pc_indf)); break; case CPOINTER: - assert( !"trying to assign to __code pointer" ); + assert (!"trying to assign to __code pointer"); break; case GPOINTER: - emitpcode(POC_MOVWF, popRegFromIdx (Gstack_base_addr-2)); - mov2w_op(dst, 0); - emitpcode(POC_MOVWF, popRegFromIdx (Gstack_base_addr-1)); - mov2w_op(dst, 1); - emitpcode(POC_MOVWF, popRegFromIdx (Gstack_base_addr)); - mov2w_op(dst, 2); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr - 2)); + mov2w_op (dst, 0); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr - 1)); + mov2w_op (dst, 1); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr)); + mov2w_op (dst, 2); call_libraryfunc ("__gptrput1"); break; default: - assert( !"unhandled pointer type" ); + assert (!"unhandled pointer type"); break; } } @@ -5322,17 +5732,15 @@ /* genUnpackBits - generates code for unpacking bits */ /*-----------------------------------------------------------------*/ static void -genUnpackBits (operand *result, operand *left, int ptype, iCode *ifx) +genUnpackBits (operand * result, operand * left, int ptype, iCode * ifx) { - int rsize; /* result size */ - sym_link *etype; /* bitfield type information */ - int blen; /* bitfield length */ - int bstr; /* bitfield starting bit within byte */ + sym_link *etype; /* bitfield type information */ + int blen; /* bitfield length */ + int bstr; /* bitfield starting bit within byte */ FENTRY; DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); etype = getSpec (operandType (result)); - rsize = getSize (operandType (result)); blen = SPEC_BLEN (etype); bstr = SPEC_BSTR (etype); @@ -5346,7 +5754,7 @@ resolvedIfx rIfx; resolveIfx (&rIfx, ifx); - if (ptype == -1) /* direct */ + if (ptype == -1) /* direct */ pcop = newpCodeOpBit (aopGet (AOP (left), 0, FALSE, FALSE), bstr, 0); else { @@ -5367,24 +5775,24 @@ switch (ptype) { - case -1: - emitpcode (POC_BTFSC, newpCodeOpBit (aopGet (AOP (left), 0, FALSE, FALSE), bstr, 0)); - /* adjust result below */ - break; + case -1: + emitpcode (POC_BTFSC, newpCodeOpBit (aopGet (AOP (left), 0, FALSE, FALSE), bstr, 0)); + /* adjust result below */ + break; - case POINTER: - case FPOINTER: - case GPOINTER: - case CPOINTER: - emitPtrByteGet (left, ptype, FALSE); - emitpcode (POC_ANDLW, popGetLit (1UL << bstr)); - emitSKPZ; - /* adjust result below */ - break; + case POINTER: + case FPOINTER: + case GPOINTER: + case CPOINTER: + emitPtrByteGet (left, ptype, FALSE); + emitpcode (POC_ANDLW, popGetLit (1UL << bstr)); + emitSKPZ; + /* adjust result below */ + break; - default: - assert (!"unhandled pointer type" ); - } // switch + default: + assert (!"unhandled pointer type"); + } // switch /* move sign-/zero extended bit to result */ if (SPEC_USIGN (OP_SYM_ETYPE (left))) @@ -5392,9 +5800,9 @@ else emitpcode (POC_DECF, popGet (AOP (result), 0)); addSign (result, 1, !SPEC_USIGN (OP_SYM_ETYPE (left))); - } + } return; - } + } else if (blen <= 8 && ((blen + bstr) <= 8)) { /* blen > 1 */ @@ -5405,25 +5813,25 @@ switch (ptype) { - case -1: - mov2w (AOP (left), 0); - break; + case -1: + mov2w (AOP (left), 0); + break; - case POINTER: - case FPOINTER: - case GPOINTER: - case CPOINTER: - emitPtrByteGet (left, ptype, FALSE); - break; + case POINTER: + case FPOINTER: + case GPOINTER: + case CPOINTER: + emitPtrByteGet (left, ptype, FALSE); + break; - default: - assert (!"unhandled pointer type" ); - } // switch + default: + assert (!"unhandled pointer type"); + } // switch if (blen < 8) - emitpcode (POC_ANDLW, popGetLit ((((1UL << blen)-1) << bstr) & 0x00ff)); + emitpcode (POC_ANDLW, popGetLit ((((1UL << blen) - 1) << bstr) & 0x00ff)); movwf (AOP (result), 0); - AccRsh (popGet (AOP (result), 0), bstr, 1); /* zero extend the bitfield */ + AccRsh (popGet (AOP (result), 0), bstr, 1); /* zero extend the bitfield */ if (!SPEC_USIGN (OP_SYM_ETYPE (left)) && (bstr + blen != 8)) { @@ -5437,350 +5845,355 @@ return; } - assert (!"bitfields larger than 8 bits or crossing byte boundaries are not yet supported" ); + assert (!"bitfields larger than 8 bits or crossing byte boundaries are not yet supported"); } #if 1 /*-----------------------------------------------------------------*/ /* genDataPointerGet - generates code when ptr offset is known */ /*-----------------------------------------------------------------*/ -static void genDataPointerGet (operand *left, - operand *result, - iCode *ic) +static void +genDataPointerGet (operand * left, operand * result, iCode * ic) { - int size , offset = 0; + unsigned int size; + int offset = 0; - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - /* optimization - most of the time, left and result are the same - * address, but different types. for the pic code, we could omit - * the following - */ - aopOp(result,ic,TRUE); + /* optimization - most of the time, left and result are the same + * address, but different types. for the pic code, we could omit + * the following + */ + aopOp (result, ic, TRUE); - if (pic14_sameRegs (AOP(left), AOP(result))) - return; + if (pic14_sameRegs (AOP (left), AOP (result))) + return; - DEBUGpic14_AopType(__LINE__,left,NULL,result); + DEBUGpic14_AopType (__LINE__, left, NULL, result); - //emitpcode(POC_MOVFW, popGet(AOP(left),0)); + //emitpcode(POC_MOVFW, popGet(AOP(left),0)); - size = AOP_SIZE(result); - if (size > getSize(OP_SYM_ETYPE(left))) size = getSize(OP_SYM_ETYPE(left)); + size = AOP_SIZE (result); + if (size > getSize (OP_SYM_ETYPE (left))) + size = getSize (OP_SYM_ETYPE (left)); - offset = 0; - while (size--) { - emitpcode(POC_MOVFW, popGet(AOP(left),offset)); - emitpcode(POC_MOVWF, popGet(AOP(result),offset)); - offset++; + offset = 0; + while (size--) + { + emitpcode (POC_MOVFW, popGet (AOP (left), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); + offset++; } - freeAsmop(left,NULL,ic,TRUE); - freeAsmop(result,NULL,ic,TRUE); + freeAsmop (left, NULL, ic, TRUE); + freeAsmop (result, NULL, ic, TRUE); } #endif /*-----------------------------------------------------------------*/ /* genNearPointerGet - pic14_emitcode for near pointer fetch */ /*-----------------------------------------------------------------*/ -static void genNearPointerGet (operand *left, - operand *result, - iCode *ic) +static void +genNearPointerGet (operand * left, operand * result, iCode * ic) { - asmop *aop = NULL; - sym_link *ltype = operandType(left); - sym_link *rtype = operandType(result); - sym_link *retype= getSpec(rtype); /* bitfield type information */ - int direct = 0; + asmop *aop = NULL; + sym_link *ltype = operandType (left); + sym_link *rtype = operandType (result); + sym_link *retype = getSpec (rtype); /* bitfield type information */ + int direct = 0; - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - aopOp(left,ic,FALSE); + aopOp (left, ic, FALSE); - /* if left is rematerialisable and - result is not bit variable type and - the left is pointer to data space i.e - lower 128 bytes of space */ - if (AOP_TYPE(left) == AOP_PCODE && //AOP_TYPE(left) == AOP_IMMD && - !IS_BITVAR(retype) && - PIC_IS_DATA_PTR(ltype)) { - genDataPointerGet (left,result,ic); - return ; + /* if left is rematerialisable and + result is not bit variable type and + the left is pointer to data space i.e + lower 128 bytes of space */ + if (AOP_TYPE (left) == AOP_PCODE && //AOP_TYPE(left) == AOP_IMMD && + !IS_BITVAR (retype) && PIC_IS_DATA_PTR (ltype)) + { + genDataPointerGet (left, result, ic); + return; } - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - aopOp (result,ic,FALSE); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + aopOp (result, ic, FALSE); - /* Check if can access directly instead of via a pointer */ - if ((AOP_TYPE(left) == AOP_PCODE) - && (AOP(left)->aopu.pcop->type == PO_IMMEDIATE) - && (AOP_SIZE(result) == 1)) + /* Check if can access directly instead of via a pointer */ + if ((AOP_TYPE (left) == AOP_PCODE) && (AOP (left)->aopu.pcop->type == PO_IMMEDIATE) && (AOP_SIZE (result) == 1)) { - direct = 1; + direct = 1; } - if (IS_BITFIELD(getSpec(operandType(result)))) + if (IS_BITFIELD (getSpec (operandType (result)))) { - genUnpackBits (result,left,direct?-1:POINTER,ifxForOp(IC_RESULT(ic),ic)); - goto release; + genUnpackBits (result, left, direct ? -1 : POINTER, ifxForOp (IC_RESULT (ic), ic)); + goto release; } - /* If the pointer value is not in a the FSR then need to put it in */ - /* Must set/reset IRP bit for use with FSR. */ - if (!direct) - setup_fsr (left); + /* If the pointer value is not in a the FSR then need to put it in */ + /* Must set/reset IRP bit for use with FSR. */ + if (!direct) + setup_fsr (left); // sym_link *etype; - /* if bitfield then unpack the bits */ - { - /* we have can just get the values */ - int size = AOP_SIZE(result); - int offset = 0 ; + /* if bitfield then unpack the bits */ + { + /* we have can just get the values */ + int size = AOP_SIZE (result); + int offset = 0; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - while(size--) { - if (direct) - emitpcode(POC_MOVWF,popGet(AOP(left),0)); - else - emitpcode(POC_MOVFW,popCopyReg(pc_indf)); - if (AOP_TYPE(result) == AOP_LIT) { - emitpcode(POC_MOVLW,popGet(AOP(result),offset)); - } else { - emitpcode(POC_MOVWF,popGet(AOP(result),offset)); - } - if (size && !direct) - { - inc_fsr(1); - } - offset++; - } - } + while (size--) + { + if (direct) + emitpcode (POC_MOVWF, popGet (AOP (left), 0)); + else + emitpcode (POC_MOVFW, popCopyReg (pc_indf)); + if (AOP_TYPE (result) == AOP_LIT) + { + emitpcode (POC_MOVLW, popGet (AOP (result), offset)); + } + else + { + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); + } + if (size && !direct) + { + inc_fsr (1); + } + offset++; + } + } - /* now some housekeeping stuff */ - if (aop) { - /* we had to allocate for this iCode */ - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - freeAsmop(NULL,aop,ic,TRUE); - } else if (!direct) { - /* nothing to do */ - } else { - /* we did not allocate which means left - already in a pointer register, then - if size > 0 && this could be used again - we have to point it back to where it - belongs */ - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if (AOP_SIZE(result) > 1 && - !OP_SYMBOL(left)->remat && - ( OP_SYMBOL(left)->liveTo > ic->seq || - ic->depth )) { - int size = AOP_SIZE(result) - 1; - inc_fsr(-size); + /* now some housekeeping stuff */ + if (aop) + { + /* we had to allocate for this iCode */ + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + freeAsmop (NULL, aop, ic, TRUE); + } + else if (!direct) + { + /* nothing to do */ + } + else + { + /* we did not allocate which means left + already in a pointer register, then + if size > 0 && this could be used again + we have to point it back to where it + belongs */ + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + if (AOP_SIZE (result) > 1 && !OP_SYMBOL (left)->remat && (OP_SYMBOL (left)->liveTo > ic->seq || ic->depth)) + { + int size = AOP_SIZE (result) - 1; + inc_fsr (-size); } } release: - /* done */ - freeAsmop(left,NULL,ic,TRUE); - freeAsmop(result,NULL,ic,TRUE); + /* done */ + freeAsmop (left, NULL, ic, TRUE); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genGenPointerGet - gget value from generic pointer space */ /*-----------------------------------------------------------------*/ -static void genGenPointerGet (operand *left, - operand *result, iCode *ic) +static void +genGenPointerGet (operand * left, operand * result, iCode * ic) { - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - aopOp(left,ic,FALSE); - aopOp(result,ic,FALSE); + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + aopOp (left, ic, FALSE); + aopOp (result, ic, FALSE); - DEBUGpic14_AopType(__LINE__,left,NULL,result); + DEBUGpic14_AopType (__LINE__, left, NULL, result); - if (IS_BITFIELD(getSpec(operandType(result)))) + if (IS_BITFIELD (getSpec (operandType (result)))) { - genUnpackBits (result, left, GPOINTER, ifxForOp (IC_RESULT(ic), ic)); + genUnpackBits (result, left, GPOINTER, ifxForOp (IC_RESULT (ic), ic)); return; } - { - /* emit call to __gptrget */ - char *func[] = {NULL, "__gptrget1", "__gptrget2", "__gptrget3", "__gptrget4"}; - int size = AOP_SIZE(result); - int idx = 0; - - assert (size > 0 && size <= 4); - - /* pass arguments */ - assert (AOP_SIZE(left) == 3); - mov2w(AOP(left), 0); - emitpcode(POC_MOVWF, popRegFromIdx (Gstack_base_addr-1)); - mov2w(AOP(left), 1); - emitpcode(POC_MOVWF, popRegFromIdx (Gstack_base_addr)); - mov2w(AOP(left), 2); - call_libraryfunc (func[size]); - - /* save result */ - movwf (AOP(result), --size); - while (size--) { - emitpcode (POC_MOVFW,popRegFromIdx (Gstack_base_addr - idx++)); - movwf (AOP(result), size); - } // while - } + { + /* emit call to __gptrget */ + char *func[] = { NULL, "__gptrget1", "__gptrget2", "__gptrget3", "__gptrget4" }; + int size = AOP_SIZE (result); + int idx = 0; + + assert (size > 0 && size <= 4); + + /* pass arguments */ + assert (AOP_SIZE (left) == 3); + mov2w (AOP (left), 0); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr - 1)); + mov2w (AOP (left), 1); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr)); + mov2w (AOP (left), 2); + call_libraryfunc (func[size]); + + /* save result */ + movwf (AOP (result), --size); + while (size--) + { + emitpcode (POC_MOVFW, popRegFromIdx (Gstack_base_addr - idx++)); + movwf (AOP (result), size); + } // while + } - freeAsmop(left,NULL,ic,TRUE); - freeAsmop(result,NULL,ic,TRUE); + freeAsmop (left, NULL, ic, TRUE); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genConstPointerGet - get value from const generic pointer space */ /*-----------------------------------------------------------------*/ -static void genConstPointerGet (operand *left, - operand *result, iCode *ic) +static void +genConstPointerGet (operand * left, operand * result, iCode * ic) { - //sym_link *retype = getSpec(operandType(result)); - #if 0 - symbol *albl, *blbl;//, *clbl; - pCodeOp *pcop; - #endif - PIC_OPCODE poc; - int i, size, lit; - - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - aopOp(left,ic,FALSE); - aopOp(result,ic,FALSE); + //sym_link *retype = getSpec(operandType(result)); +#if 0 + symbol *albl, *blbl; //, *clbl; + pCodeOp *pcop; +#endif + int i, lit; - size = AOP_SIZE(result); + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + aopOp (left, ic, FALSE); + aopOp (result, ic, FALSE); - DEBUGpic14_AopType(__LINE__,left,NULL,result); + DEBUGpic14_AopType (__LINE__, left, NULL, result); - DEBUGpic14_emitcode ("; "," %d getting const pointer",__LINE__); + DEBUGpic14_emitcode ("; ", " %d getting const pointer", __LINE__); - lit = op_isLitLike (left); - poc = lit ? POC_MOVLW : POC_MOVFW; + lit = op_isLitLike (left); - if (IS_BITFIELD(getSpec(operandType(result)))) + if (IS_BITFIELD (getSpec (operandType (result)))) { - genUnpackBits (result, left, lit ? -1 : CPOINTER, ifxForOp (IC_RESULT(ic), ic)); - goto release; + genUnpackBits (result, left, lit ? -1 : CPOINTER, ifxForOp (IC_RESULT (ic), ic)); + goto release; } - { - char *func[] = { NULL, "__gptrget1", "__gptrget2", "__gptrget3", "__gptrget4" }; - int size = min(getSize(OP_SYM_ETYPE(left)), AOP_SIZE(result)); - assert (size > 0 && size <= 4); - - mov2w_op(left, 0); - emitpcode(POC_MOVWF, popRegFromIdx (Gstack_base_addr-1)); - mov2w_op(left, 1); - emitpcode(POC_MOVWF, popRegFromIdx (Gstack_base_addr)); - emitpcode(POC_MOVLW, popGetLit (GPTRTAG_CODE)); /* GPOINTER tag for __code space */ - call_libraryfunc (func[size]); - - movwf(AOP(result),size-1); - for (i = 1; i < size; i++) - { - emitpcode(POC_MOVFW, popRegFromIdx (Gstack_base_addr+1-i)); - movwf(AOP(result),size - 1 - i); - } // for - } + { + char *func[] = { NULL, "__gptrget1", "__gptrget2", "__gptrget3", "__gptrget4" }; + int size = min ((int)getSize (OP_SYM_ETYPE (left)), AOP_SIZE (result)); + assert (size > 0 && size <= 4); + + mov2w_op (left, 0); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr - 1)); + mov2w_op (left, 1); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr)); + emitpcode (POC_MOVLW, popGetLit (GPTRTAG_CODE)); /* GPOINTER tag for __code space */ + call_libraryfunc (func[size]); + + movwf (AOP (result), size - 1); + for (i = 1; i < size; i++) + { + emitpcode (POC_MOVFW, popRegFromIdx (Gstack_base_addr + 1 - i)); + movwf (AOP (result), size - 1 - i); + } // for + } release: - freeAsmop(left,NULL,ic,TRUE); - freeAsmop(result,NULL,ic,TRUE); + freeAsmop (left, NULL, ic, TRUE); + freeAsmop (result, NULL, ic, TRUE); } + /*-----------------------------------------------------------------*/ /* genPointerGet - generate code for pointer get */ /*-----------------------------------------------------------------*/ -static void genPointerGet (iCode *ic) +static void +genPointerGet (iCode * ic) { - operand *left, *result ; - sym_link *type, *etype; - int p_type = -1; - - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - left = IC_LEFT(ic); - result = IC_RESULT(ic) ; - - /* depending on the type of pointer we need to - move it to the correct pointer register */ - type = operandType(left); - etype = getSpec(type); - - if (IS_PTR_CONST(type)) - DEBUGpic14_emitcode ("; ***","%d - const pointer",__LINE__); - - /* if left is of type of pointer then it is simple */ - if (IS_PTR(type) && !IS_FUNC(type->next)) - p_type = DCL_TYPE(type); - else { - /* we have to go by the storage class */ - p_type = PTR_TYPE(SPEC_OCLS(etype)); - - DEBUGpic14_emitcode ("; ***","%d - resolve pointer by storage class",__LINE__); - - if (SPEC_OCLS(etype)->codesp ) { - DEBUGpic14_emitcode ("; ***","%d - cpointer",__LINE__); - //p_type = CPOINTER ; + operand *left, *result; + sym_link *type, *etype; + int p_type = -1; + + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + + left = IC_LEFT (ic); + result = IC_RESULT (ic); + + /* depending on the type of pointer we need to + move it to the correct pointer register */ + type = operandType (left); + etype = getSpec (type); + + if (IS_PTR_CONST (type)) + DEBUGpic14_emitcode ("; ***", "%d - const pointer", __LINE__); + + /* if left is of type of pointer then it is simple */ + if (IS_PTR (type) && !IS_FUNC (type->next)) + p_type = DCL_TYPE (type); + else + { + /* we have to go by the storage class */ + p_type = PTR_TYPE (SPEC_OCLS (etype)); + + DEBUGpic14_emitcode ("; ***", "%d - resolve pointer by storage class", __LINE__); + + if (SPEC_OCLS (etype)->codesp) + { + DEBUGpic14_emitcode ("; ***", "%d - cpointer", __LINE__); + //p_type = CPOINTER ; } - else - if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) - DEBUGpic14_emitcode ("; ***","%d - fpointer",__LINE__); - /*p_type = FPOINTER ;*/ - else - if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) - DEBUGpic14_emitcode ("; ***","%d - ppointer",__LINE__); - /* p_type = PPOINTER; */ - else - if (SPEC_OCLS(etype) == idata ) - DEBUGpic14_emitcode ("; ***","%d - ipointer",__LINE__); - /* p_type = IPOINTER; */ - else - DEBUGpic14_emitcode ("; ***","%d - pointer",__LINE__); - /* p_type = POINTER ; */ + else if (SPEC_OCLS (etype)->fmap && !SPEC_OCLS (etype)->paged) + DEBUGpic14_emitcode ("; ***", "%d - fpointer", __LINE__); + /*p_type = FPOINTER ; */ + else if (SPEC_OCLS (etype)->fmap && SPEC_OCLS (etype)->paged) + DEBUGpic14_emitcode ("; ***", "%d - ppointer", __LINE__); + /* p_type = PPOINTER; */ + else if (SPEC_OCLS (etype) == idata) + DEBUGpic14_emitcode ("; ***", "%d - ipointer", __LINE__); + /* p_type = IPOINTER; */ + else + DEBUGpic14_emitcode ("; ***", "%d - pointer", __LINE__); + /* p_type = POINTER ; */ } - /* now that we have the pointer type we assign - the pointer values */ - switch (p_type) { + /* now that we have the pointer type we assign + the pointer values */ + switch (p_type) + { case POINTER: case FPOINTER: - //case IPOINTER: - genNearPointerGet (left,result,ic); - break; -/* - case PPOINTER: - genPagedPointerGet(left,result,ic); - break; - - case FPOINTER: - genFarPointerGet (left,result,ic); - break; -*/ + //case IPOINTER: + genNearPointerGet (left, result, ic); + break; + /* + case PPOINTER: + genPagedPointerGet(left,result,ic); + break; + + case FPOINTER: + genFarPointerGet (left,result,ic); + break; + */ case CPOINTER: - genConstPointerGet (left,result,ic); - break; + genConstPointerGet (left, result, ic); + break; case GPOINTER: - genGenPointerGet (left,result,ic); - break; + genGenPointerGet (left, result, ic); + break; default: - assert ( !"unhandled pointer type" ); - break; + assert (!"unhandled pointer type"); + break; } } @@ -5788,832 +6201,886 @@ /*-----------------------------------------------------------------*/ /* genPackBits - generates code for packed bit storage */ /*-----------------------------------------------------------------*/ -static void genPackBits(sym_link *etype,operand *result,operand *right,int p_type) +static void +genPackBits (sym_link * etype, operand * result, operand * right, int p_type) { - int blen; /* bitfield length */ - int bstr; /* bitfield starting bit within byte */ - int litval; /* source literal value (if AOP_LIT) */ - unsigned char mask; /* bitmask within current byte */ + int blen; /* bitfield length */ + int bstr; /* bitfield starting bit within byte */ + int litval; /* source literal value (if AOP_LIT) */ + unsigned char mask; /* bitmask within current byte */ FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); blen = SPEC_BLEN (etype); bstr = SPEC_BSTR (etype); /* If the bitfield length is less than a byte and does not cross byte boundaries */ if ((blen <= 8) && ((bstr + blen) <= 8)) - { - mask = ((unsigned char) (0xFF << (blen + bstr)) | - (unsigned char) (0xFF >> (8 - bstr))); - - if (AOP_TYPE (right) == AOP_LIT) { - /* Case with a bitfield length <8 and literal source */ - int lit = (int) ulFromVal (AOP (right)->aopu.aop_lit); - if (blen == 1) { - pCodeOp *pcop; + mask = ((unsigned char) (0xFF << (blen + bstr)) | (unsigned char) (0xFF >> (8 - bstr))); - switch (p_type) - { - case -1: - if (AOP(result)->type == AOP_PCODE) - pcop = newpCodeOpBit(aopGet(AOP(result),0,FALSE,FALSE),bstr,0); - else - pcop = popGet(AOP(result),0); - emitpcode(lit?POC_BSF:POC_BCF,pcop); - break; + if (AOP_TYPE (right) == AOP_LIT) + { + /* Case with a bitfield length <8 and literal source */ + int lit = (int) ulFromVal (AOP (right)->aopu.aop_lit); + if (blen == 1) + { + pCodeOp *pcop; - case POINTER: - case FPOINTER: - setup_fsr (result); - emitpcode(lit?POC_BSF:POC_BCF,newpCodeOpBit(PCOP(pc_indf)->name,bstr,0)); - break; + switch (p_type) + { + case -1: + if (AOP (result)->type == AOP_PCODE) + pcop = newpCodeOpBit (aopGet (AOP (result), 0, FALSE, FALSE), bstr, 0); + else + pcop = popGet (AOP (result), 0); + emitpcode (lit ? POC_BSF : POC_BCF, pcop); + break; - case CPOINTER: - assert( !"trying to assign to bitfield via pointer to __code space" ); - break; + case POINTER: + case FPOINTER: + setup_fsr (result); + emitpcode (lit ? POC_BSF : POC_BCF, newpCodeOpBit (PCOP (pc_indf)->name, bstr, 0)); + break; - case GPOINTER: - emitPtrByteGet(result, p_type, FALSE); - if (lit) { - emitpcode(POC_IORLW, newpCodeOpLit (1UL << bstr)); - } else { - emitpcode(POC_ANDLW, newpCodeOpLit ((~(1UL << bstr)) & 0x0ff)); - } - emitPtrByteSet(result, p_type, TRUE); - break; + case CPOINTER: + assert (!"trying to assign to bitfield via pointer to __code space"); + break; - default: - assert( !"unhandled pointer type" ); - break; - } // switch (p_type) - } else { - /* blen > 1 */ - litval = lit << bstr; - litval &= (~mask) & 0x00ff; - - switch (p_type) - { - case -1: - mov2w (AOP(result), 0); - if ((litval|mask) != 0x00ff) - emitpcode(POC_ANDLW, popGetLit (mask)); - if (litval != 0x00) - emitpcode(POC_IORLW, popGetLit (litval)); - movwf (AOP(result), 0); - break; + case GPOINTER: + emitPtrByteGet (result, p_type, FALSE); + if (lit) + { + emitpcode (POC_IORLW, newpCodeOpLit (1UL << bstr)); + } + else + { + emitpcode (POC_ANDLW, newpCodeOpLit ((~(1UL << bstr)) & 0x0ff)); + } + emitPtrByteSet (result, p_type, TRUE); + break; - case POINTER: - case FPOINTER: - case GPOINTER: - emitPtrByteGet(result, p_type, FALSE); - if ((litval|mask) != 0x00ff) - emitpcode(POC_ANDLW, popGetLit (mask)); - if (litval != 0x00) - emitpcode(POC_IORLW, popGetLit (litval)); - emitPtrByteSet(result, p_type, TRUE); - break; + default: + assert (!"unhandled pointer type"); + break; + } // switch (p_type) + } + else + { + /* blen > 1 */ + litval = lit << bstr; + litval &= (~mask) & 0x00ff; - case CPOINTER: - assert( !"trying to assign to bitfield via pointer to __code space" ); - break; + switch (p_type) + { + case -1: + mov2w (AOP (result), 0); + if ((litval | mask) != 0x00ff) + emitpcode (POC_ANDLW, popGetLit (mask)); + if (litval != 0x00) + emitpcode (POC_IORLW, popGetLit (litval)); + movwf (AOP (result), 0); + break; - default: - assert( !"unhandled pointer type" ); - break; - } // switch - } // if (blen > 1) - } - else - { - /* right is no literal */ - if (blen==1) { - switch (p_type) - { - case -1: - /* Note more efficient code, of pre clearing bit then only setting it if required, - * can only be done if it is known that the result is not a SFR */ - emitpcode(POC_RRFW,popGet(AOP(right),0)); - emitSKPC; - emitpcode(POC_BCF,newpCodeOpBit (aopGet(AOP(result), 0, FALSE, FALSE), bstr, 0)); - emitSKPNC; - emitpcode(POC_BSF,newpCodeOpBit (aopGet(AOP(result), 0, FALSE, FALSE), bstr, 0)); - break; + case POINTER: + case FPOINTER: + case GPOINTER: + emitPtrByteGet (result, p_type, FALSE); + if ((litval | mask) != 0x00ff) + emitpcode (POC_ANDLW, popGetLit (mask)); + if (litval != 0x00) + emitpcode (POC_IORLW, popGetLit (litval)); + emitPtrByteSet (result, p_type, TRUE); + break; - case POINTER: - case FPOINTER: - case GPOINTER: - emitPtrByteGet (result, p_type, FALSE); - emitpcode(POC_BTFSS, newpCodeOpBit (aopGet(AOP(right), 0, FALSE, FALSE), bstr, 0)); - emitpcode(POC_ANDLW, newpCodeOpLit (~(1UL << bstr) & 0x0ff)); - emitpcode(POC_BTFSC, newpCodeOpBit (aopGet(AOP(right), 0, FALSE, FALSE), bstr, 0)); - emitpcode(POC_IORLW, newpCodeOpLit ((1UL << bstr) & 0x0ff)); - emitPtrByteSet (result, p_type, TRUE); - break; + case CPOINTER: + assert (!"trying to assign to bitfield via pointer to __code space"); + break; - case CPOINTER: - assert( !"trying to assign to bitfield via pointer to __code space" ); - break; + default: + assert (!"unhandled pointer type"); + break; + } // switch + } // if (blen > 1) + } + else + { + /* right is no literal */ + if (blen == 1) + { + switch (p_type) + { + case -1: + /* Note more efficient code, of pre clearing bit then only setting it if required, + * can only be done if it is known that the result is not a SFR */ + emitpcode (POC_RRFW, popGet (AOP (right), 0)); + emitSKPC; + emitpcode (POC_BCF, newpCodeOpBit (aopGet (AOP (result), 0, FALSE, FALSE), bstr, 0)); + emitSKPNC; + emitpcode (POC_BSF, newpCodeOpBit (aopGet (AOP (result), 0, FALSE, FALSE), bstr, 0)); + break; - default: - assert( !"unhandled pointer type" ); - break; - } // switch - return; - } else { - /* Case with a bitfield 1 < length <= 8 and arbitrary source */ - pCodeOp *temp = popGetTempReg (); - - mov2w (AOP(right), 0); - if (blen < 8) { - emitpcode (POC_ANDLW, popGetLit ((1UL << blen)-1)); - } - emitpcode(POC_MOVWF, temp); - if (bstr) { - AccLsh (temp, bstr); - } - - switch (p_type) - { - case -1: - mov2w (AOP(result), 0); - emitpcode(POC_ANDLW, popGetLit (mask)); - emitpcode(POC_IORFW, temp); - movwf (AOP(result), 0); - break; + case POINTER: + case FPOINTER: + case GPOINTER: + emitPtrByteGet (result, p_type, FALSE); + emitpcode (POC_BTFSS, newpCodeOpBit (aopGet (AOP (right), 0, FALSE, FALSE), bstr, 0)); + emitpcode (POC_ANDLW, newpCodeOpLit (~(1UL << bstr) & 0x0ff)); + emitpcode (POC_BTFSC, newpCodeOpBit (aopGet (AOP (right), 0, FALSE, FALSE), bstr, 0)); + emitpcode (POC_IORLW, newpCodeOpLit ((1UL << bstr) & 0x0ff)); + emitPtrByteSet (result, p_type, TRUE); + break; - case POINTER: - case FPOINTER: - case GPOINTER: - emitPtrByteGet (result, p_type, FALSE); - emitpcode(POC_ANDLW, popGetLit (mask)); - emitpcode(POC_IORFW, temp); - emitPtrByteSet (result, p_type, TRUE); - break; + case CPOINTER: + assert (!"trying to assign to bitfield via pointer to __code space"); + break; - case CPOINTER: - assert( !"trying to assign to bitfield via pointer to __code space" ); - break; + default: + assert (!"unhandled pointer type"); + break; + } // switch + return; + } + else + { + /* Case with a bitfield 1 < length <= 8 and arbitrary source */ + pCodeOp *temp = popGetTempReg (); - default: - assert( !"unhandled pointer type" ); - break; - } // switch + mov2w (AOP (right), 0); + if (blen < 8) + { + emitpcode (POC_ANDLW, popGetLit ((1UL << blen) - 1)); + } + emitpcode (POC_MOVWF, temp); + if (bstr) + { + AccLsh (temp, bstr); + } - popReleaseTempReg (temp); - } // if (blen > 1) - } // if (AOP(right)->type != AOP_LIT) - return; - } // if (blen <= 8 && ((blen + bstr) <= 8)) + switch (p_type) + { + case -1: + mov2w (AOP (result), 0); + emitpcode (POC_ANDLW, popGetLit (mask)); + emitpcode (POC_IORFW, temp); + movwf (AOP (result), 0); + break; + + case POINTER: + case FPOINTER: + case GPOINTER: + emitPtrByteGet (result, p_type, FALSE); + emitpcode (POC_ANDLW, popGetLit (mask)); + emitpcode (POC_IORFW, temp); + emitPtrByteSet (result, p_type, TRUE); + break; + + case CPOINTER: + assert (!"trying to assign to bitfield via pointer to __code space"); + break; - assert( !"bitfields larger than 8 bits or crossing byte boundaries are not yet supported" ); + default: + assert (!"unhandled pointer type"); + break; + } // switch + + popReleaseTempReg (temp); + } // if (blen > 1) + } // if (AOP(right)->type != AOP_LIT) + return; + } // if (blen <= 8 && ((blen + bstr) <= 8)) + + assert (!"bitfields larger than 8 bits or crossing byte boundaries are not yet supported"); } /*-----------------------------------------------------------------*/ /* genDataPointerSet - remat pointer to data space */ /*-----------------------------------------------------------------*/ -static void genDataPointerSet(operand *right, - operand *result, - iCode *ic) +static void +genDataPointerSet (operand * right, operand * result, iCode * ic) { - int size = 0; - int offset = 0; - int ressize; + int size = 0; + int offset = 0; + int ressize; + + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + aopOp (right, ic, FALSE); + aopOp (result, ic, FALSE); + + assert (IS_SYMOP (result)); + assert (IS_PTR (OP_SYM_TYPE (result))); + + /* + * Determine size from right operand (not result): + * The result might be a rematerialized pointer to (the first field in) a struct, + * which then assumes the type (and size) of the struct rather than the first field. + */ + if (IS_SYMOP (right)) + size = getSize (OP_SYM_ETYPE (right)); + else if (IS_VALOP (right)) + size = getSize (OP_VALUE (right)->type); + else + assert (!"Invalid operand."); + + ressize = getSize (OP_SYM_ETYPE (result)); + + //assert( !"what's going on here?" ); + + /* + if ( AOP_TYPE(result) == AOP_PCODE) { + fprintf(stderr,"genDataPointerSet %s, %d\n", + AOP(result)->aopu.pcop->name, + PCOI(AOP(result)->aopu.pcop)->offset); + } + */ - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - aopOp(right,ic,FALSE); - aopOp(result,ic,FALSE); - - assert (IS_SYMOP(result)); - assert (IS_PTR(OP_SYM_TYPE(result))); - - /* - * Determine size from right operand (not result): - * The result might be a rematerialized pointer to (the first field in) a struct, - * which then assumes the type (and size) of the struct rather than the first field. - */ - if (IS_SYMOP (right)) - size = getSize (OP_SYM_ETYPE (right)); - else if (IS_VALOP (right)) - size = getSize (OP_VALUE (right)->type); - else - assert (!"Invalid operand."); - - ressize = getSize (OP_SYM_ETYPE (result)); - - //assert( !"what's going on here?" ); - - /* - if ( AOP_TYPE(result) == AOP_PCODE) { - fprintf(stderr,"genDataPointerSet %s, %d\n", - AOP(result)->aopu.pcop->name, - PCOI(AOP(result)->aopu.pcop)->offset); - } - */ - - // tsd, was l+1 - the underline `_' prefix was being stripped - while (size--) { - emitpComment ("%s:%u: size=%d/%d, offset=%d, AOP_TYPE(res)=%d", __FILE__,__LINE__, size, ressize, offset, AOP_TYPE(result)); - - if (AOP_TYPE(right) == AOP_LIT) { - unsigned int lit = pic14aopLiteral(AOP(IC_RIGHT(ic))->aopu.aop_lit, offset); - //fprintf (stderr, "%s:%u: lit %d 0x%x\n", __FUNCTION__,__LINE__, lit, lit); - if(lit&0xff) { - emitpcode(POC_MOVLW, popGetLit(lit&0xff)); - emitpcode(POC_MOVWF, popGet(AOP(result), offset)); - } else { - emitpcode(POC_CLRF, popGet(AOP(result), offset)); - } - } else { - //fprintf (stderr, "%s:%u: no lit\n", __FUNCTION__,__LINE__); - emitpcode(POC_MOVFW, popGet(AOP(right), offset)); - emitpcode(POC_MOVWF, popGet(AOP(result), offset)); + // tsd, was l+1 - the underline `_' prefix was being stripped + while (size--) + { + emitpComment ("%s:%u: size=%d/%d, offset=%d, AOP_TYPE(res)=%d", __FILE__, __LINE__, size, ressize, offset, + AOP_TYPE (result)); + + if (AOP_TYPE (right) == AOP_LIT) + { + unsigned int lit = pic14aopLiteral (AOP (IC_RIGHT (ic))->aopu.aop_lit, offset); + //fprintf (stderr, "%s:%u: lit %d 0x%x\n", __FUNCTION__,__LINE__, lit, lit); + if (lit & 0xff) + { + emitpcode (POC_MOVLW, popGetLit (lit & 0xff)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); + } + else + { + emitpcode (POC_CLRF, popGet (AOP (result), offset)); + } + } + else + { + //fprintf (stderr, "%s:%u: no lit\n", __FUNCTION__,__LINE__); + emitpcode (POC_MOVFW, popGet (AOP (right), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); } - offset++; + offset++; } - freeAsmop(right,NULL,ic,TRUE); - freeAsmop(result,NULL,ic,TRUE); + freeAsmop (right, NULL, ic, TRUE); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genNearPointerSet - pic14_emitcode for near pointer put */ /*-----------------------------------------------------------------*/ -static void genNearPointerSet (operand *right, - operand *result, - iCode *ic) -{ - asmop *aop = NULL; - sym_link *ptype = operandType(result); - sym_link *retype = getSpec(operandType(right)); - sym_link *letype = getSpec(ptype); - int direct = 0; +static void +genNearPointerSet (operand * right, operand * result, iCode * ic) +{ + asmop *aop = NULL; + sym_link *ptype = operandType (result); + sym_link *retype = getSpec (operandType (right)); + sym_link *letype = getSpec (ptype); + int direct = 0; - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - aopOp(result,ic,FALSE); + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + aopOp (result, ic, FALSE); #if 1 - /* if the result is rematerializable & - in data space & not a bit variable */ - //if (AOP_TYPE(result) == AOP_IMMD && - if (AOP_TYPE(result) == AOP_PCODE && - PIC_IS_DATA_PTR(ptype) && - !IS_BITVAR (retype) && - !IS_BITVAR (letype)) { - genDataPointerSet (right,result,ic); - freeAsmop(result,NULL,ic,TRUE); - return; + /* if the result is rematerializable & + in data space & not a bit variable */ + //if (AOP_TYPE(result) == AOP_IMMD && + if (AOP_TYPE (result) == AOP_PCODE && PIC_IS_DATA_PTR (ptype) && !IS_BITVAR (retype) && !IS_BITVAR (letype)) + { + genDataPointerSet (right, result, ic); + freeAsmop (result, NULL, ic, TRUE); + return; } #endif - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - aopOp(right,ic,FALSE); - DEBUGpic14_AopType(__LINE__,NULL,right,result); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + aopOp (right, ic, FALSE); + DEBUGpic14_AopType (__LINE__, NULL, right, result); - /* Check if can access directly instead of via a pointer */ - if ((AOP_TYPE(result) == AOP_PCODE) - && (AOP(result)->aopu.pcop->type == PO_IMMEDIATE) - && (AOP_SIZE(right) == 1)) + /* Check if can access directly instead of via a pointer */ + if ((AOP_TYPE (result) == AOP_PCODE) && (AOP (result)->aopu.pcop->type == PO_IMMEDIATE) && (AOP_SIZE (right) == 1)) { - direct = 1; + direct = 1; } - if (IS_BITFIELD (letype)) + if (IS_BITFIELD (letype)) { - genPackBits (letype, result, right, direct?-1:POINTER); + genPackBits (letype, result, right, direct ? -1 : POINTER); return; } - /* If the pointer value is not in a the FSR then need to put it in */ - /* Must set/reset IRP bit for use with FSR. */ - /* Note only do this once - assuming that never need to cross a bank boundary at address 0x100. */ - if (!direct) - setup_fsr (result); - - { - /* we have can just get the values */ - int size = AOP_SIZE(right); - int offset = 0 ; - - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - while (size--) { - char *l = aopGet(AOP(right),offset,FALSE,TRUE); - if (*l == '@' ) { - emitpcode(POC_MOVFW,popCopyReg(pc_indf)); - } else { - if (AOP_TYPE(right) == AOP_LIT) { - emitpcode(POC_MOVLW,popGet(AOP(right),offset)); - } else { - emitpcode(POC_MOVFW,popGet(AOP(right),offset)); - } - if (direct) - emitpcode(POC_MOVWF,popGet(AOP(result),0)); - else - emitpcode(POC_MOVWF,popCopyReg(pc_indf)); - } - if (size && !direct) - inc_fsr(1); - offset++; - } - } + /* If the pointer value is not in a the FSR then need to put it in */ + /* Must set/reset IRP bit for use with FSR. */ + /* Note only do this once - assuming that never need to cross a bank boundary at address 0x100. */ + if (!direct) + setup_fsr (result); + + { + /* we have can just get the values */ + int size = AOP_SIZE (right); + int offset = 0; + + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + while (size--) + { + char *l = aopGet (AOP (right), offset, FALSE, TRUE); + if (*l == '@') + { + emitpcode (POC_MOVFW, popCopyReg (pc_indf)); + } + else + { + if (AOP_TYPE (right) == AOP_LIT) + { + emitpcode (POC_MOVLW, popGet (AOP (right), offset)); + } + else + { + emitpcode (POC_MOVFW, popGet (AOP (right), offset)); + } + if (direct) + emitpcode (POC_MOVWF, popGet (AOP (result), 0)); + else + emitpcode (POC_MOVWF, popCopyReg (pc_indf)); + } + if (size && !direct) + inc_fsr (1); + offset++; + } + } - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* now some housekeeping stuff */ - if (aop) { - /* we had to allocate for this iCode */ - freeAsmop(NULL,aop,ic,TRUE); - } else if (!direct) { - /* nothing to do */ - } else { - /* we did not allocate which means left - already in a pointer register, then - if size > 0 && this could be used again - we have to point it back to where it - belongs */ - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if (AOP_SIZE(right) > 1 && - !OP_SYMBOL(result)->remat && - ( OP_SYMBOL(result)->liveTo > ic->seq || - ic->depth )) { - int size = AOP_SIZE(right) - 1; - inc_fsr(-size); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* now some housekeeping stuff */ + if (aop) + { + /* we had to allocate for this iCode */ + freeAsmop (NULL, aop, ic, TRUE); + } + else if (!direct) + { + /* nothing to do */ + } + else + { + /* we did not allocate which means left + already in a pointer register, then + if size > 0 && this could be used again + we have to point it back to where it + belongs */ + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + if (AOP_SIZE (right) > 1 && !OP_SYMBOL (result)->remat && (OP_SYMBOL (result)->liveTo > ic->seq || ic->depth)) + { + int size = AOP_SIZE (right) - 1; + inc_fsr (-size); } } - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* done */ + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* done */ - freeAsmop(right,NULL,ic,TRUE); - freeAsmop(result,NULL,ic,TRUE); + freeAsmop (right, NULL, ic, TRUE); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genGenPointerSet - set value from generic pointer space */ /*-----------------------------------------------------------------*/ -static void genGenPointerSet (operand *right, operand *result, iCode *ic) +static void +genGenPointerSet (operand * right, operand * result, iCode * ic) { - sym_link *retype = getSpec(operandType(result)); + sym_link *retype = getSpec (operandType (result)); - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - aopOp(right,ic,FALSE); - aopOp(result,ic,FALSE); + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + aopOp (right, ic, FALSE); + aopOp (result, ic, FALSE); - DEBUGpic14_AopType(__LINE__,right,NULL,result); + DEBUGpic14_AopType (__LINE__, right, NULL, result); - if (IS_BITFIELD(retype)) + if (IS_BITFIELD (retype)) { genPackBits (retype, result, right, GPOINTER); return; } - { - /* emit call to __gptrput */ - char *func[] = {NULL, "__gptrput1", "__gptrput2", "__gptrput3", "__gptrput4"}; - int size = AOP_SIZE(right); - int idx = 0; - - /* The following assertion fails for - * struct foo { char a; char b; } bar; - * void demo(struct foo *dst, char c) { dst->b = c; } - * as size will be 1 (sizeof(c)), whereas dst->b will be accessed - * using (((char *)dst)+1), whose OP_SYM_ETYPE still is struct foo - * of size 2. - * The frontend seems to guarantee that IC_LEFT has the correct size, - * it works fine both for larger and smaller types of `char c'. - * */ - //assert (size == getSize(OP_SYM_ETYPE(result))); - assert (size > 0 && size <= 4); + { + /* emit call to __gptrput */ + char *func[] = { NULL, "__gptrput1", "__gptrput2", "__gptrput3", "__gptrput4" }; + int size = AOP_SIZE (right); + int idx = 0; + + /* The following assertion fails for + * struct foo { char a; char b; } bar; + * void demo(struct foo *dst, char c) { dst->b = c; } + * as size will be 1 (sizeof(c)), whereas dst->b will be accessed + * using (((char *)dst)+1), whose OP_SYM_ETYPE still is struct foo + * of size 2. + * The frontend seems to guarantee that IC_LEFT has the correct size, + * it works fine both for larger and smaller types of `char c'. + * */ + //assert (size == getSize(OP_SYM_ETYPE(result))); + assert (size > 0 && size <= 4); - /* pass arguments */ - /* - value (MSB in Gstack_base_addr-2, growing downwards) */ - { - int off = size; - idx = 2; - while (off--) + /* pass arguments */ + /* - value (MSB in Gstack_base_addr-2, growing downwards) */ + { + int off = size; + idx = 2; + while (off--) { mov2w_op (right, off); emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr - idx++)); } - idx = 0; - } - /* - address */ - assert (AOP_SIZE(result) == 3); - mov2w(AOP(result), 0); - emitpcode(POC_MOVWF, popRegFromIdx (Gstack_base_addr - 1)); - mov2w(AOP(result), 1); - emitpcode(POC_MOVWF, popRegFromIdx (Gstack_base_addr)); - mov2w(AOP(result), 2); - call_libraryfunc (func[size]); + idx = 0; } + /* - address */ + assert (AOP_SIZE (result) == 3); + mov2w (AOP (result), 0); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr - 1)); + mov2w (AOP (result), 1); + emitpcode (POC_MOVWF, popRegFromIdx (Gstack_base_addr)); + mov2w (AOP (result), 2); + call_libraryfunc (func[size]); + } - freeAsmop(right,NULL,ic,TRUE); - freeAsmop(result,NULL,ic,TRUE); + freeAsmop (right, NULL, ic, TRUE); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genPointerSet - stores the value into a pointer location */ /*-----------------------------------------------------------------*/ -static void genPointerSet (iCode *ic) +static void +genPointerSet (iCode * ic) { - operand *right, *result ; - sym_link *type, *etype; - int p_type; - - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - right = IC_RIGHT(ic); - result = IC_RESULT(ic) ; - - /* depending on the type of pointer we need to - move it to the correct pointer register */ - type = operandType(result); - etype = getSpec(type); - /* if left is of type of pointer then it is simple */ - if (IS_PTR(type) && !IS_FUNC(type->next)) { - p_type = DCL_TYPE(type); - } - else { - /* we have to go by the storage class */ - p_type = PTR_TYPE(SPEC_OCLS(etype)); - - /* if (SPEC_OCLS(etype)->codesp ) { */ - /* p_type = CPOINTER ; */ - /* } */ - /* else */ - /* if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */ - /* p_type = FPOINTER ; */ - /* else */ - /* if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */ - /* p_type = PPOINTER ; */ - /* else */ - /* if (SPEC_OCLS(etype) == idata ) */ - /* p_type = IPOINTER ; */ - /* else */ - /* p_type = POINTER ; */ - } - - /* now that we have the pointer type we assign - the pointer values */ - switch (p_type) { + operand *right, *result; + sym_link *type, *etype; + int p_type; - case POINTER: - case FPOINTER: - //case IPOINTER: - genNearPointerSet (right,result,ic); - break; -/* - case PPOINTER: - genPagedPointerSet (right,result,ic); - break; + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + + right = IC_RIGHT (ic); + result = IC_RESULT (ic); + /* depending on the type of pointer we need to + move it to the correct pointer register */ + type = operandType (result); + etype = getSpec (type); + /* if left is of type of pointer then it is simple */ + if (IS_PTR (type) && !IS_FUNC (type->next)) + { + p_type = DCL_TYPE (type); + } + else + { + /* we have to go by the storage class */ + p_type = PTR_TYPE (SPEC_OCLS (etype)); + + /* if (SPEC_OCLS(etype)->codesp ) { */ + /* p_type = CPOINTER ; */ + /* } */ + /* else */ + /* if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */ + /* p_type = FPOINTER ; */ + /* else */ + /* if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */ + /* p_type = PPOINTER ; */ + /* else */ + /* if (SPEC_OCLS(etype) == idata ) */ + /* p_type = IPOINTER ; */ + /* else */ + /* p_type = POINTER ; */ + } + + /* now that we have the pointer type we assign + the pointer values */ + switch (p_type) + { + + case POINTER: case FPOINTER: - genFarPointerSet (right,result,ic); - break; -*/ + //case IPOINTER: + genNearPointerSet (right, result, ic); + break; + /* + case PPOINTER: + genPagedPointerSet (right,result,ic); + break; + + case FPOINTER: + genFarPointerSet (right,result,ic); + break; + */ case GPOINTER: - genGenPointerSet (right,result,ic); - break; + genGenPointerSet (right, result, ic); + break; default: - werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - "genPointerSet: illegal pointer type"); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "genPointerSet: illegal pointer type"); } } /*-----------------------------------------------------------------*/ /* genIfx - generate code for Ifx statement */ /*-----------------------------------------------------------------*/ -static void genIfx (iCode *ic, iCode *popIc) +static void +genIfx (iCode * ic, iCode * popIc) { - operand *cond = IC_COND(ic); - int isbit =0; + operand *cond = IC_COND (ic); + int isbit = 0; - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - aopOp(cond,ic,FALSE); + aopOp (cond, ic, FALSE); - /* get the value into acc */ - if (AOP_TYPE(cond) != AOP_CRY) - pic14_toBoolean(cond); - else - isbit = 1; + /* get the value into acc */ + if (AOP_TYPE (cond) != AOP_CRY) + pic14_toBoolean (cond); + else + isbit = 1; - /* if there was something to be popped then do it */ - if (popIc) - genIpop(popIc); + /* if there was something to be popped then do it */ + if (popIc) + genIpop (popIc); - if (isbit) + if (isbit) { - /* This assumes that CARRY is set iff cond is true */ - if (IC_TRUE(ic)) + /* This assumes that CARRY is set iff cond is true */ + if (IC_TRUE (ic)) + { + assert (!IC_FALSE (ic)); + emitpcode (POC_BTFSC, popGet (AOP (cond), 0)); + //emitSKPNC; + emitpcode (POC_GOTO, popGetLabel (IC_TRUE (ic)->key)); + } + else { - assert (!IC_FALSE(ic)); - emitpcode(POC_BTFSC, popGet(AOP(cond), 0)); - //emitSKPNC; - emitpcode(POC_GOTO, popGetLabel(IC_TRUE(ic)->key)); - } else { - assert (IC_FALSE(ic)); - emitpcode(POC_BTFSS, popGet(AOP(cond), 0)); - //emitSKPC; - emitpcode(POC_GOTO, popGetLabel(IC_FALSE(ic)->key)); + assert (IC_FALSE (ic)); + emitpcode (POC_BTFSS, popGet (AOP (cond), 0)); + //emitSKPC; + emitpcode (POC_GOTO, popGetLabel (IC_FALSE (ic)->key)); } - if (0) + if (0) { - static int hasWarned = 0; - if (!hasWarned) + static int hasWarned = 0; + if (!hasWarned) { - fprintf (stderr, "WARNING: using untested code for %s:%u -- please check the .asm output and report bugs.\n", ic->filename, ic->lineno); - hasWarned = 1; + fprintf (stderr, "WARNING: using untested code for %s:%u -- please check the .asm output and report bugs.\n", + ic->filename, ic->lineno); + hasWarned = 1; } } } - else + else { - /* now Z is set iff !cond */ - if (IC_TRUE(ic)) + /* now Z is set iff !cond */ + if (IC_TRUE (ic)) + { + assert (!IC_FALSE (ic)); + emitSKPZ; + emitpcode (POC_GOTO, popGetLabel (IC_TRUE (ic)->key)); + } + else { - assert (!IC_FALSE(ic)); - emitSKPZ; - emitpcode(POC_GOTO, popGetLabel(IC_TRUE(ic)->key)); - } else { - emitSKPNZ; - emitpcode(POC_GOTO, popGetLabel(IC_FALSE(ic)->key)); + emitSKPNZ; + emitpcode (POC_GOTO, popGetLabel (IC_FALSE (ic)->key)); } } - ic->generated = 1; + ic->generated = 1; - /* the result is now in the accumulator */ - freeAsmop(cond,NULL,ic,TRUE); + /* the result is now in the accumulator */ + freeAsmop (cond, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genAddrOf - generates code for address of */ /*-----------------------------------------------------------------*/ -static void genAddrOf (iCode *ic) +static void +genAddrOf (iCode * ic) { - operand *right, *result, *left; - int size, offset ; + operand *right, *result, *left; + int size, offset; - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - //aopOp(IC_RESULT(ic),ic,FALSE); + //aopOp(IC_RESULT(ic),ic,FALSE); - aopOp((left=IC_LEFT(ic)),ic,FALSE); - aopOp((right=IC_RIGHT(ic)),ic,FALSE); - aopOp((result=IC_RESULT(ic)),ic,TRUE); + aopOp ((left = IC_LEFT (ic)), ic, FALSE); + aopOp ((right = IC_RIGHT (ic)), ic, FALSE); + aopOp ((result = IC_RESULT (ic)), ic, TRUE); - DEBUGpic14_AopType(__LINE__,left,right,result); - assert (IS_SYMOP (left)); + DEBUGpic14_AopType (__LINE__, left, right, result); + assert (IS_SYMOP (left)); - /* sanity check: generic pointers to code space are not yet supported, - * pionters to codespace must not be assigned addresses of __data values. */ - #if 0 - fprintf (stderr, "result: %s, left: %s\n", OP_SYMBOL(result)->name, OP_SYMBOL(left)->name); - fprintf (stderr, "result->type : "); printTypeChain (OP_SYM_TYPE(result), stderr); fprintf (stderr, ", codesp:%d, codeptr:%d, constptr:%d\n", IN_CODESPACE(SPEC_OCLS(getSpec (OP_SYM_TYPE(result)))), IS_CODEPTR(OP_SYM_TYPE(result)), IS_PTR_CONST(OP_SYM_TYPE(result))); - fprintf (stderr, "result->etype: "); printTypeChain (OP_SYM_ETYPE(result), stderr); fprintf (stderr, ", codesp:%d, codeptr:%d, constptr:%d\n", IN_CODESPACE(SPEC_OCLS(getSpec (OP_SYM_ETYPE(result)))), IS_CODEPTR(OP_SYM_ETYPE(result)), IS_PTR_CONST(OP_SYM_ETYPE(result))); - fprintf (stderr, "left->type : "); printTypeChain (OP_SYM_TYPE(left), stderr); fprintf (stderr, ", codesp:%d, codeptr:%d, constptr:%d\n", IN_CODESPACE(SPEC_OCLS(getSpec (OP_SYM_TYPE(left)))), IS_CODEPTR(OP_SYM_TYPE(left)), IS_PTR_CONST(OP_SYM_TYPE(left))); - fprintf (stderr, "left->etype : "); printTypeChain (OP_SYM_ETYPE(left), stderr); fprintf (stderr, ", codesp:%d, codeptr:%d, constptr:%d\n",IN_CODESPACE(SPEC_OCLS(getSpec (OP_SYM_ETYPE(left)))), IS_CODEPTR(OP_SYM_ETYPE(left)), IS_PTR_CONST(OP_SYM_ETYPE(left))); + /* sanity check: generic pointers to code space are not yet supported, + * pionters to codespace must not be assigned addresses of __data values. */ +#if 0 + fprintf (stderr, "result: %s, left: %s\n", OP_SYMBOL (result)->name, OP_SYMBOL (left)->name); + fprintf (stderr, "result->type : "); + printTypeChain (OP_SYM_TYPE (result), stderr); + fprintf (stderr, ", codesp:%d, codeptr:%d, constptr:%d\n", IN_CODESPACE (SPEC_OCLS (getSpec (OP_SYM_TYPE (result)))), + IS_CODEPTR (OP_SYM_TYPE (result)), IS_PTR_CONST (OP_SYM_TYPE (result))); + fprintf (stderr, "result->etype: "); + printTypeChain (OP_SYM_ETYPE (result), stderr); + fprintf (stderr, ", codesp:%d, codeptr:%d, constptr:%d\n", IN_CODESPACE (SPEC_OCLS (getSpec (OP_SYM_ETYPE (result)))), + IS_CODEPTR (OP_SYM_ETYPE (result)), IS_PTR_CONST (OP_SYM_ETYPE (result))); + fprintf (stderr, "left->type : "); + printTypeChain (OP_SYM_TYPE (left), stderr); + fprintf (stderr, ", codesp:%d, codeptr:%d, constptr:%d\n", IN_CODESPACE (SPEC_OCLS (getSpec (OP_SYM_TYPE (left)))), + IS_CODEPTR (OP_SYM_TYPE (left)), IS_PTR_CONST (OP_SYM_TYPE (left))); + fprintf (stderr, "left->etype : "); + printTypeChain (OP_SYM_ETYPE (left), stderr); + fprintf (stderr, ", codesp:%d, codeptr:%d, constptr:%d\n", IN_CODESPACE (SPEC_OCLS (getSpec (OP_SYM_ETYPE (left)))), + IS_CODEPTR (OP_SYM_ETYPE (left)), IS_PTR_CONST (OP_SYM_ETYPE (left))); #endif - if (IS_SYMOP(result) && IS_CODEPTR(OP_SYM_TYPE(result)) && !IN_CODESPACE(SPEC_OCLS(getSpec (OP_SYM_TYPE(left))))) { + if (IS_SYMOP (result) && IS_CODEPTR (OP_SYM_TYPE (result)) && !IN_CODESPACE (SPEC_OCLS (getSpec (OP_SYM_TYPE (left))))) + { fprintf (stderr, "trying to assign __code pointer (%s) an address in __data space (&%s) -- expect trouble\n", - IS_SYMOP(result) ? OP_SYMBOL(result)->name : "unknown", - OP_SYMBOL(left)->name); - } else if (IS_SYMOP(result) && !IS_CODEPTR (OP_SYM_TYPE(result)) && IN_CODESPACE(SPEC_OCLS(getSpec(OP_SYM_TYPE(left))))) { + IS_SYMOP (result) ? OP_SYMBOL (result)->name : "unknown", OP_SYMBOL (left)->name); + } + else if (IS_SYMOP (result) && !IS_CODEPTR (OP_SYM_TYPE (result)) && IN_CODESPACE (SPEC_OCLS (getSpec (OP_SYM_TYPE (left))))) + { fprintf (stderr, "trying to assign __data pointer (%s) an address in __code space (&%s) -- expect trouble\n", - IS_SYMOP(result) ? OP_SYMBOL(result)->name : "unknown", - OP_SYMBOL(left)->name); + IS_SYMOP (result) ? OP_SYMBOL (result)->name : "unknown", OP_SYMBOL (left)->name); } - size = AOP_SIZE(IC_RESULT(ic)); - if (IS_SYMOP(result) && IS_GENPTR(OP_SYM_TYPE(result))) { - /* strip tag */ - if (size > GPTRSIZE-1) size = GPTRSIZE-1; + size = AOP_SIZE (IC_RESULT (ic)); + if (IS_SYMOP (result) && IS_GENPTR (OP_SYM_TYPE (result))) + { + /* strip tag */ + if (size > GPTRSIZE - 1) + size = GPTRSIZE - 1; } - offset = 0; + offset = 0; - while (size--) { - /* fixing bug #863624, reported from (errolv) */ - emitpcode(POC_MOVLW, popGetImmd(OP_SYMBOL(left)->rname, offset, 0, IS_FUNC(OP_SYM_TYPE(left)))); - emitpcode(POC_MOVWF, popGet(AOP(result), offset)); + while (size--) + { + /* fixing bug #863624, reported from (errolv) */ + emitpcode (POC_MOVLW, popGetImmd (OP_SYMBOL (left)->rname, offset, 0, IS_FUNC (OP_SYM_TYPE (left)))); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); #if 0 - emitpcode(POC_MOVLW, popGet(AOP(left),offset)); - emitpcode(POC_MOVWF, popGet(AOP(result),offset)); + emitpcode (POC_MOVLW, popGet (AOP (left), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); #endif - offset++; + offset++; + } + + if (IS_SYMOP (result) && IS_GENPTR (OP_SYM_TYPE (result))) + { + /* provide correct tag */ + int isCode = IN_CODESPACE (SPEC_OCLS (getSpec (OP_SYM_TYPE (left)))); + emitpcode (POC_MOVLW, popGetLit (isCode ? GPTRTAG_CODE : GPTRTAG_DATA)); + movwf (AOP (result), 2); + } + + freeAsmop (left, NULL, ic, FALSE); + freeAsmop (result, NULL, ic, TRUE); + +} + +/*-----------------------------------------------------------------*/ +/* genAssign - generate code for assignment */ +/*-----------------------------------------------------------------*/ +static void +genAssign (iCode * ic) +{ + operand *result, *right; + int size, offset, know_W; + unsigned long lit = 0L; + + result = IC_RESULT (ic); + right = IC_RIGHT (ic); + + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + + /* if they are the same */ + if (operandsEqu (IC_RESULT (ic), IC_RIGHT (ic))) + return; + + aopOp (right, ic, FALSE); + aopOp (result, ic, TRUE); + + DEBUGpic14_AopType (__LINE__, NULL, right, result); + + /* if they are the same registers */ + if (pic14_sameRegs (AOP (right), AOP (result))) + goto release; + + /* special case: assign from __code */ + if (!IS_ITEMP (right) /* --> iTemps never reside in __code */ + && IS_SYMOP (right) /* --> must be an immediate (otherwise we would be in genConstPointerGet) */ + && !IS_FUNC (OP_SYM_TYPE (right)) /* --> we would want its address instead of the first instruction */ + && !IS_CODEPTR (OP_SYM_TYPE (right)) /* --> get symbols address instread */ + && IN_CODESPACE (SPEC_OCLS (getSpec (OP_SYM_TYPE (right))))) + { + emitpComment ("genAssign from CODESPACE"); + genConstPointerGet (right, result, ic); + goto release; } - if (IS_SYMOP(result) && IS_GENPTR(OP_SYM_TYPE(result))) + /* just for symmetry reasons... */ + if (!IS_ITEMP (result) && IS_SYMOP (result) && IN_CODESPACE (SPEC_OCLS (getSpec (OP_SYM_TYPE (result))))) { - /* provide correct tag */ - int isCode = IN_CODESPACE(SPEC_OCLS(getSpec(OP_SYM_TYPE(left)))); - emitpcode (POC_MOVLW, popGetLit (isCode ? GPTRTAG_CODE : GPTRTAG_DATA)); - movwf (AOP(result), 2); + assert (!"cannot write to CODESPACE"); } - freeAsmop(left,NULL,ic,FALSE); - freeAsmop(result,NULL,ic,TRUE); - -} - -/*-----------------------------------------------------------------*/ -/* genAssign - generate code for assignment */ -/*-----------------------------------------------------------------*/ -static void genAssign (iCode *ic) -{ - operand *result, *right; - int size, offset,know_W; - unsigned long lit = 0L; - - result = IC_RESULT(ic); - right = IC_RIGHT(ic) ; - - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + /* if the result is a bit */ + if (AOP_TYPE (result) == AOP_CRY) + { - /* if they are the same */ - if (operandsEqu (IC_RESULT(ic),IC_RIGHT(ic))) - return ; + /* if the right size is a literal then + we know what the value is */ + if (AOP_TYPE (right) == AOP_LIT) + { - aopOp(right,ic,FALSE); - aopOp(result,ic,TRUE); + emitpcode ((((int) operandLitValue (right)) ? POC_BSF : POC_BCF), popGet (AOP (result), 0)); - DEBUGpic14_AopType(__LINE__,NULL,right,result); + if (((int) operandLitValue (right))) + pic14_emitcode ("bsf", "(%s >> 3),(%s & 7)", AOP (result)->aopu.aop_dir, AOP (result)->aopu.aop_dir); + else + pic14_emitcode ("bcf", "(%s >> 3),(%s & 7)", AOP (result)->aopu.aop_dir, AOP (result)->aopu.aop_dir); + goto release; + } - /* if they are the same registers */ - if (pic14_sameRegs(AOP(right),AOP(result))) - goto release; + /* the right is also a bit variable */ + if (AOP_TYPE (right) == AOP_CRY) + { + emitpcode (POC_BCF, popGet (AOP (result), 0)); + emitpcode (POC_BTFSC, popGet (AOP (right), 0)); + emitpcode (POC_BSF, popGet (AOP (result), 0)); + + pic14_emitcode ("bcf", "(%s >> 3),(%s & 7)", AOP (result)->aopu.aop_dir, AOP (result)->aopu.aop_dir); + pic14_emitcode ("btfsc", "(%s >> 3),(%s & 7)", AOP (right)->aopu.aop_dir, AOP (right)->aopu.aop_dir); + pic14_emitcode ("bsf", "(%s >> 3),(%s & 7)", AOP (result)->aopu.aop_dir, AOP (result)->aopu.aop_dir); + goto release; + } - /* special case: assign from __code */ - if (!IS_ITEMP(right) /* --> iTemps never reside in __code */ - && IS_SYMOP (right) /* --> must be an immediate (otherwise we would be in genConstPointerGet) */ - && !IS_FUNC(OP_SYM_TYPE(right)) /* --> we would want its address instead of the first instruction */ - && !IS_CODEPTR(OP_SYM_TYPE(right)) /* --> get symbols address instread */ - && IN_CODESPACE (SPEC_OCLS (getSpec (OP_SYM_TYPE(right))))) - { - emitpComment ("genAssign from CODESPACE"); - genConstPointerGet (right, result, ic); + /* we need to or */ + emitpcode (POC_BCF, popGet (AOP (result), 0)); + pic14_toBoolean (right); + emitSKPZ; + emitpcode (POC_BSF, popGet (AOP (result), 0)); + //aopPut(AOP(result),"a",0); goto release; } - /* just for symmetry reasons... */ - if (!IS_ITEMP(result) - && IS_SYMOP (result) - && IN_CODESPACE (SPEC_OCLS (getSpec (OP_SYM_TYPE(result))))) + /* bit variables done */ + /* general case */ + size = AOP_SIZE (result); + offset = 0; + if (AOP_TYPE (right) == AOP_DIR && (AOP_TYPE (result) == AOP_REG) && size == 1) { - assert ( !"cannot write to CODESPACE" ); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + if (aopIdx (AOP (result), 0) == 4) + { + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + emitpcode (POC_MOVFW, popGet (AOP (right), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); + goto release; + } + else + DEBUGpic14_emitcode ("; WARNING", "%s %d ignoring register storage", __FUNCTION__, __LINE__); } - /* if the result is a bit */ - if (AOP_TYPE(result) == AOP_CRY) { - - /* if the right size is a literal then - we know what the value is */ - if (AOP_TYPE(right) == AOP_LIT) { + know_W = -1; + while (size--) + { - emitpcode( ( ((int) operandLitValue(right)) ? POC_BSF : POC_BCF), - popGet(AOP(result),0)); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + if (AOP_TYPE (right) == AOP_LIT) + { + lit = (unsigned long) pic14aopLiteral (AOP (right)->aopu.aop_lit, offset) & 0x0ff; + if (lit & 0xff) + { + if (know_W != (int) (lit & 0xff)) + emitpcode (POC_MOVLW, popGetLit (lit & 0xff)); + know_W = lit & 0xff; + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); + } + else + emitpcode (POC_CLRF, popGet (AOP (result), offset)); - if (((int) operandLitValue(right))) - pic14_emitcode("bsf","(%s >> 3),(%s & 7)", - AOP(result)->aopu.aop_dir, - AOP(result)->aopu.aop_dir); - else - pic14_emitcode("bcf","(%s >> 3),(%s & 7)", - AOP(result)->aopu.aop_dir, - AOP(result)->aopu.aop_dir); - goto release; - } - - /* the right is also a bit variable */ - if (AOP_TYPE(right) == AOP_CRY) { - emitpcode(POC_BCF, popGet(AOP(result),0)); - emitpcode(POC_BTFSC, popGet(AOP(right),0)); - emitpcode(POC_BSF, popGet(AOP(result),0)); - - pic14_emitcode("bcf","(%s >> 3),(%s & 7)", - AOP(result)->aopu.aop_dir, - AOP(result)->aopu.aop_dir); - pic14_emitcode("btfsc","(%s >> 3),(%s & 7)", - AOP(right)->aopu.aop_dir, - AOP(right)->aopu.aop_dir); - pic14_emitcode("bsf","(%s >> 3),(%s & 7)", - AOP(result)->aopu.aop_dir, - AOP(result)->aopu.aop_dir); - goto release ; - } - - /* we need to or */ - emitpcode(POC_BCF, popGet(AOP(result),0)); - pic14_toBoolean(right); - emitSKPZ; - emitpcode(POC_BSF, popGet(AOP(result),0)); - //aopPut(AOP(result),"a",0); - goto release ; - } - - /* bit variables done */ - /* general case */ - size = AOP_SIZE(result); - offset = 0 ; - if( AOP_TYPE(right) == AOP_DIR && (AOP_TYPE(result) == AOP_REG) && size==1) { - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if(aopIdx(AOP(result),0) == 4) { - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - emitpcode(POC_MOVFW, popGet(AOP(right),offset)); - emitpcode(POC_MOVWF, popGet(AOP(result),offset)); - goto release; - } else - DEBUGpic14_emitcode ("; WARNING","%s %d ignoring register storage",__FUNCTION__,__LINE__); - } - - know_W=-1; - while (size--) { - - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if(AOP_TYPE(right) == AOP_LIT) { - lit = (unsigned long)pic14aopLiteral(AOP(right)->aopu.aop_lit, offset) & 0x0ff; - if(lit&0xff) { - if(know_W != (int)(lit&0xff)) - emitpcode(POC_MOVLW,popGetLit(lit&0xff)); - know_W = lit&0xff; - emitpcode(POC_MOVWF, popGet(AOP(result),offset)); - } else - emitpcode(POC_CLRF, popGet(AOP(result),offset)); - - } else if (AOP_TYPE(right) == AOP_CRY) { - emitpcode(POC_CLRF, popGet(AOP(result),offset)); - if(offset == 0) { - emitpcode(POC_BTFSS, popGet(AOP(right),0)); - emitpcode(POC_INCF, popGet(AOP(result),0)); - } - } else { - mov2w_op (right, offset); - emitpcode(POC_MOVWF, popGet(AOP(result),offset)); + } + else if (AOP_TYPE (right) == AOP_CRY) + { + emitpcode (POC_CLRF, popGet (AOP (result), offset)); + if (offset == 0) + { + emitpcode (POC_BTFSS, popGet (AOP (right), 0)); + emitpcode (POC_INCF, popGet (AOP (result), 0)); + } + } + else + { + mov2w_op (right, offset); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); } - offset++; + offset++; } release: - freeAsmop (right,NULL,ic,FALSE); - freeAsmop (result,NULL,ic,TRUE); + freeAsmop (right, NULL, ic, FALSE); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genJumpTab - genrates code for jump table */ /*-----------------------------------------------------------------*/ -static void genJumpTab (iCode *ic) +static void +genJumpTab (iCode * ic) { - symbol *jtab; - char *l; + symbol *jtab; + char *l; - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - aopOp(IC_JTCOND(ic),ic,FALSE); - /* get the condition into accumulator */ - l = aopGet(AOP(IC_JTCOND(ic)),0,FALSE,FALSE); - MOVA(l); - /* multiply by three */ - pic14_emitcode("add","a,acc"); - pic14_emitcode("add","a,%s",aopGet(AOP(IC_JTCOND(ic)),0,FALSE,FALSE)); - - jtab = newiTempLabel(NULL); - pic14_emitcode("mov","dptr,#%05d_DS_",jtab->key+100); - pic14_emitcode("jmp","@a+dptr"); - pic14_emitcode("","%05d_DS_:",jtab->key+100); - - emitpcode(POC_MOVLW, popGetHighLabel(jtab->key)); - emitpcode(POC_MOVWF, popCopyReg(&pc_pclath)); - emitpcode(POC_MOVLW, popGetLabel(jtab->key)); - emitpcode(POC_ADDFW, popGet(AOP(IC_JTCOND(ic)),0)); - emitSKPNC; - emitpcode(POC_INCF, popCopyReg(&pc_pclath)); - emitpcode(POC_MOVWF, popCopyReg(&pc_pcl)); - emitpLabel(jtab->key); - - freeAsmop(IC_JTCOND(ic),NULL,ic,TRUE); - - /* now generate the jump labels */ - for (jtab = setFirstItem(IC_JTLABELS(ic)) ; jtab; - jtab = setNextItem(IC_JTLABELS(ic))) { - pic14_emitcode("ljmp","%05d_DS_",jtab->key+100); - emitpcode(POC_GOTO,popGetLabel(jtab->key)); + aopOp (IC_JTCOND (ic), ic, FALSE); + /* get the condition into accumulator */ + l = aopGet (AOP (IC_JTCOND (ic)), 0, FALSE, FALSE); + MOVA (l); + /* multiply by three */ + pic14_emitcode ("add", "a,acc"); + pic14_emitcode ("add", "a,%s", aopGet (AOP (IC_JTCOND (ic)), 0, FALSE, FALSE)); + + jtab = newiTempLabel (NULL); + pic14_emitcode ("mov", "dptr,#%05d_DS_", labelKey2num (jtab->key)); + pic14_emitcode ("jmp", "@a+dptr"); + pic14_emitcode ("", "%05d_DS_:", labelKey2num (jtab->key)); + + emitpcode (POC_MOVLW, popGetHighLabel (jtab->key)); + emitpcode (POC_MOVWF, popCopyReg (&pc_pclath)); + emitpcode (POC_MOVLW, popGetLabel (jtab->key)); + emitpcode (POC_ADDFW, popGet (AOP (IC_JTCOND (ic)), 0)); + emitSKPNC; + emitpcode (POC_INCF, popCopyReg (&pc_pclath)); + emitpcode (POC_MOVWF, popCopyReg (&pc_pcl)); + emitpLabel (jtab->key); + + freeAsmop (IC_JTCOND (ic), NULL, ic, TRUE); + + /* now generate the jump labels */ + for (jtab = setFirstItem (IC_JTLABELS (ic)); jtab; jtab = setNextItem (IC_JTLABELS (ic))) + { + pic14_emitcode ("ljmp", "%05d_DS_", labelKey2num (jtab->key)); + emitpcode (POC_GOTO, popGetLabel (jtab->key)); } @@ -6622,272 +7089,287 @@ /*-----------------------------------------------------------------*/ /* genCast - gen code for casting */ /*-----------------------------------------------------------------*/ -static void genCast (iCode *ic) +static void +genCast (iCode * ic) { - operand *result = IC_RESULT(ic); - sym_link *restype = operandType(result); - sym_link *rtype = operandType(IC_RIGHT(ic)); - operand *right = IC_RIGHT(ic); - int size, offset ; + operand *result = IC_RESULT (ic); + sym_link *restype = operandType (result); + sym_link *rtype = operandType (IC_RIGHT (ic)); + operand *right = IC_RIGHT (ic); + int size, offset; - FENTRY; - DEBUGpic14_emitcode("; ***","%s %d",__FUNCTION__,__LINE__); - /* if they are equivalent then do nothing */ - if (operandsEqu(IC_RESULT(ic),IC_RIGHT(ic))) - return ; + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* if they are equivalent then do nothing */ + if (operandsEqu (IC_RESULT (ic), IC_RIGHT (ic))) + return; - aopOp(right,ic,FALSE) ; - aopOp(result,ic,FALSE); + aopOp (right, ic, FALSE); + aopOp (result, ic, FALSE); - DEBUGpic14_AopType(__LINE__,NULL,right,result); + DEBUGpic14_AopType (__LINE__, NULL, right, result); - /* if the result is a bit */ - if (AOP_TYPE(result) == AOP_CRY) { - assert(!"assigning to bit variables is not supported"); + /* if the result is a bit */ + if (AOP_TYPE (result) == AOP_CRY) + { + assert (!"assigning to bit variables is not supported"); } - if ((AOP_TYPE(right) == AOP_CRY) && (AOP_TYPE(result) == AOP_REG)) { - int offset = 1; - size = AOP_SIZE(result); + if ((AOP_TYPE (right) == AOP_CRY) && (AOP_TYPE (result) == AOP_REG)) + { + int offset = 1; + size = AOP_SIZE (result); - DEBUGpic14_emitcode("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - emitpcode(POC_CLRF, popGet(AOP(result),0)); - emitpcode(POC_BTFSC, popGet(AOP(right),0)); - emitpcode(POC_INCF, popGet(AOP(result),0)); + emitpcode (POC_CLRF, popGet (AOP (result), 0)); + emitpcode (POC_BTFSC, popGet (AOP (right), 0)); + emitpcode (POC_INCF, popGet (AOP (result), 0)); - while (size--) - emitpcode(POC_CLRF, popGet(AOP(result),offset++)); + while (size--) + emitpcode (POC_CLRF, popGet (AOP (result), offset++)); - goto release; + goto release; + } + + if (IS_BOOL (operandType (result))) + { + pic14_toBoolean (right); + emitSKPNZ; + emitpcode (POC_MOVLW, popGetLit (1)); + emitpcode (POC_MOVWF, popGet (AOP (result), 0)); + goto release; } - - if (IS_BOOL(operandType(result))) - { - pic14_toBoolean (right); - emitSKPNZ; - emitpcode(POC_MOVLW, popGetLit(1)); - emitpcode(POC_MOVWF, popGet(AOP(result),0)); - goto release; - } - if (IS_PTR(restype)) + if (IS_PTR (restype)) { - operand *result = IC_RESULT(ic); + operand *result = IC_RESULT (ic); //operand *left = IC_LEFT(ic); - operand *right = IC_RIGHT(ic); + operand *right = IC_RIGHT (ic); int tag = 0xff; /* copy common part */ - int max, size = AOP_SIZE(result); - if (size > AOP_SIZE(right)) size = AOP_SIZE(right); - DEBUGpic14_emitcode("; ***","%s %d",__FUNCTION__,__LINE__); + int max, size = AOP_SIZE (result); + if (size > AOP_SIZE (right)) + size = AOP_SIZE (right); + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); /* warn if we discard generic opinter tag */ - if (!IS_GENPTR(restype) && IS_GENPTR(rtype) && (AOP_SIZE(result) < AOP_SIZE(right))) - { - //fprintf (stderr, "%s:%u: discarding generic pointer type tag\n", __FUNCTION__, __LINE__); - } // if + if (!IS_GENPTR (restype) && IS_GENPTR (rtype) && (AOP_SIZE (result) < AOP_SIZE (right))) + { + //fprintf (stderr, "%s:%u: discarding generic pointer type tag\n", __FUNCTION__, __LINE__); + } // if max = size; while (size--) - { - mov2w_op (right, size); - movwf (AOP(result), size); - } // while + { + mov2w_op (right, size); + movwf (AOP (result), size); + } // while /* upcast into generic pointer type? */ - if (IS_GENPTR(restype) - && (size < AOP_SIZE(result)) - && (!IS_GENPTR(rtype) || AOP_SIZE(right) < GPTRSIZE)) - { - //fprintf (stderr, "%s:%u: must determine pointer type\n", __FUNCTION__, __LINE__); - if (IS_PTR(rtype)) + if (IS_GENPTR (restype) && (size < AOP_SIZE (result)) && (!IS_GENPTR (rtype) || AOP_SIZE (right) < GPTRSIZE)) { - switch (DCL_TYPE(rtype)) - { - case POINTER: /* __data */ - case FPOINTER: /* __data */ - assert (AOP_SIZE(right) == 2); - tag = GPTRTAG_DATA; - break; + //fprintf (stderr, "%s:%u: must determine pointer type\n", __FUNCTION__, __LINE__); + if (IS_PTR (rtype)) + { + switch (DCL_TYPE (rtype)) + { + case POINTER: /* __data */ + case FPOINTER: /* __data */ + assert (AOP_SIZE (right) == 2); + tag = GPTRTAG_DATA; + break; - case CPOINTER: /* __code */ - assert (AOP_SIZE(right) == 2); - tag = GPTRTAG_CODE; - break; + case CPOINTER: /* __code */ + assert (AOP_SIZE (right) == 2); + tag = GPTRTAG_CODE; + break; - case GPOINTER: /* unknown destination, __data or __code */ - /* assume __data space (address of immediate) */ - assert (AOP_TYPE(right) == AOP_PCODE && AOP(right)->aopu.pcop->type == PO_IMMEDIATE); - if (AOP(right)->code) - tag = GPTRTAG_CODE; - else - tag = GPTRTAG_DATA; - break; + case GPOINTER: /* unknown destination, __data or __code */ + /* assume __data space (address of immediate) */ + assert (AOP_TYPE (right) == AOP_PCODE && AOP (right)->aopu.pcop->type == PO_IMMEDIATE); + if (AOP (right)->code) + tag = GPTRTAG_CODE; + else + tag = GPTRTAG_DATA; + break; + + default: + assert (!"unhandled pointer type"); + } // switch + } + else + { + /* convert other values into pointers to __data space */ + tag = GPTRTAG_DATA; + } - default: - assert (!"unhandled pointer type"); - } // switch - } else { - /* convert other values into pointers to __data space */ - tag = GPTRTAG_DATA; - } - - assert (AOP_SIZE(result) == 3); - if (tag == 0) { - emitpcode(POC_CLRF, popGet(AOP(result), 2)); - } else { - emitpcode(POC_MOVLW, popGetLit(tag)); - movwf(AOP(result), 2); - } - } else { - addSign(result, max, 0); - } // if + assert (AOP_SIZE (result) == 3); + if (tag == 0) + { + emitpcode (POC_CLRF, popGet (AOP (result), 2)); + } + else + { + emitpcode (POC_MOVLW, popGetLit (tag)); + movwf (AOP (result), 2); + } + } + else + { + addSign (result, max, 0); + } // if goto release; } - /* if they are the same size : or less */ - if (AOP_SIZE(result) <= AOP_SIZE(right)) { + /* if they are the same size : or less */ + if (AOP_SIZE (result) <= AOP_SIZE (right)) + { + + /* if they are in the same place */ + if (pic14_sameRegs (AOP (right), AOP (result))) + goto release; + + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + if (IS_PTR_CONST (rtype)) + DEBUGpic14_emitcode ("; ***", "%d - right is const pointer", __LINE__); + if (IS_PTR_CONST (operandType (IC_RESULT (ic)))) + DEBUGpic14_emitcode ("; ***", "%d - result is const pointer", __LINE__); + + if ((AOP_TYPE (right) == AOP_PCODE) && AOP (right)->aopu.pcop->type == PO_IMMEDIATE) + { + emitpcode (POC_MOVLW, popGetAddr (AOP (right), 0, 0)); + emitpcode (POC_MOVWF, popGet (AOP (result), 0)); + emitpcode (POC_MOVLW, popGetAddr (AOP (right), 1, 0)); + emitpcode (POC_MOVWF, popGet (AOP (result), 1)); + if (AOP_SIZE (result) < 2) + fprintf (stderr, "%d -- result is not big enough to hold a ptr\n", __LINE__); + + } + else + { + + /* if they in different places then copy */ + size = AOP_SIZE (result); + offset = 0; + while (size--) + { + emitpcode (POC_MOVFW, popGet (AOP (right), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); - /* if they are in the same place */ - if (pic14_sameRegs(AOP(right),AOP(result))) - goto release; - - DEBUGpic14_emitcode("; ***","%s %d",__FUNCTION__,__LINE__); - if (IS_PTR_CONST(rtype)) - DEBUGpic14_emitcode ("; ***","%d - right is const pointer",__LINE__); - if (IS_PTR_CONST(operandType(IC_RESULT(ic)))) - DEBUGpic14_emitcode ("; ***","%d - result is const pointer",__LINE__); - - if ((AOP_TYPE(right) == AOP_PCODE) && AOP(right)->aopu.pcop->type == PO_IMMEDIATE) { - emitpcode(POC_MOVLW, popGetAddr(AOP(right),0,0)); - emitpcode(POC_MOVWF, popGet(AOP(result),0)); - emitpcode(POC_MOVLW, popGetAddr(AOP(right),1,0)); - emitpcode(POC_MOVWF, popGet(AOP(result),1)); - if(AOP_SIZE(result) <2) - fprintf(stderr,"%d -- result is not big enough to hold a ptr\n",__LINE__); - - } else { - - /* if they in different places then copy */ - size = AOP_SIZE(result); - offset = 0 ; - while (size--) { - emitpcode(POC_MOVFW, popGet(AOP(right),offset)); - emitpcode(POC_MOVWF, popGet(AOP(result),offset)); - - //aopPut(AOP(result), - // aopGet(AOP(right),offset,FALSE,FALSE), - // offset); + //aopPut(AOP(result), + // aopGet(AOP(right),offset,FALSE,FALSE), + // offset); - offset++; + offset++; } } - goto release; + goto release; } - /* so we now know that the size of destination is greater - than the size of the source. */ + /* so we now know that the size of destination is greater + than the size of the source. */ - /* we move to result for the size of source */ - size = AOP_SIZE(right); - offset = 0 ; - while (size--) { - emitpcode(POC_MOVFW, popGet(AOP(right),offset)); - emitpcode(POC_MOVWF, popGet(AOP(result),offset)); - offset++; + /* we move to result for the size of source */ + size = AOP_SIZE (right); + offset = 0; + while (size--) + { + emitpcode (POC_MOVFW, popGet (AOP (right), offset)); + emitpcode (POC_MOVWF, popGet (AOP (result), offset)); + offset++; } - addSign (result, AOP_SIZE(right), !SPEC_USIGN(rtype)); + addSign (result, AOP_SIZE (right), !SPEC_USIGN (rtype)); release: - freeAsmop(right,NULL,ic,TRUE); - freeAsmop(result,NULL,ic,TRUE); + freeAsmop (right, NULL, ic, TRUE); + freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genDjnz - generate decrement & jump if not zero instrucion */ /*-----------------------------------------------------------------*/ -static int genDjnz (iCode *ic, iCode *ifx) +static int +genDjnz (iCode * ic, iCode * ifx) { - symbol *lbl, *lbl1; - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - if (!ifx) - return 0; + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - /* if the if condition has a false label - then we cannot save */ - if (IC_FALSE(ifx)) - return 0; + if (!ifx) + return 0; - /* if the minus is not of the form - a = a - 1 */ - if (!isOperandEqual(IC_RESULT(ic),IC_LEFT(ic)) || - !IS_OP_LITERAL(IC_RIGHT(ic))) - return 0; + /* if the if condition has a false label + then we cannot save */ + if (IC_FALSE (ifx)) + return 0; - if (operandLitValue(IC_RIGHT(ic)) != 1) - return 0; + /* if the minus is not of the form + a = a - 1 */ + if (!isOperandEqual (IC_RESULT (ic), IC_LEFT (ic)) || !IS_OP_LITERAL (IC_RIGHT (ic))) + return 0; - /* if the size of this greater than one then no - saving */ - if (getSize(operandType(IC_RESULT(ic))) > 1) - return 0; + if (operandLitValue (IC_RIGHT (ic)) != 1) + return 0; - /* otherwise we can save BIG */ - lbl = newiTempLabel(NULL); - lbl1= newiTempLabel(NULL); + /* if the size of this greater than one then no + saving */ + if (getSize (operandType (IC_RESULT (ic))) > 1) + return 0; - aopOp(IC_RESULT(ic),ic,FALSE); + /* otherwise we can save BIG */ + aopOp (IC_RESULT (ic), ic, FALSE); - emitpcode(POC_DECFSZ,popGet(AOP(IC_RESULT(ic)),0)); - emitpcode(POC_GOTO,popGetLabel(IC_TRUE(ifx)->key)); + emitpcode (POC_DECFSZ, popGet (AOP (IC_RESULT (ic)), 0)); + emitpcode (POC_GOTO, popGetLabel (IC_TRUE (ifx)->key)); - freeAsmop(IC_RESULT(ic),NULL,ic,TRUE); - ifx->generated = 1; - return 1; + freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); + ifx->generated = 1; + return 1; } /*-----------------------------------------------------------------*/ /* genReceive - generate code for a receive iCode */ /*-----------------------------------------------------------------*/ -static void genReceive (iCode *ic) +static void +genReceive (iCode * ic) { - FENTRY; - DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + FENTRY; + DEBUGpic14_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + + if (isOperandInFarSpace (IC_RESULT (ic)) && (OP_SYMBOL (IC_RESULT (ic))->isspilt || IS_TRUE_SYMOP (IC_RESULT (ic)))) + { + + int size = getSize (operandType (IC_RESULT (ic))); + int offset = fReturnSizePic - size; + while (size--) + { + pic14_emitcode ("push", "%s", (strcmp (fReturn[fReturnSizePic - offset - 1], "a") ? + fReturn[fReturnSizePic - offset - 1] : "acc")); + offset++; + } + aopOp (IC_RESULT (ic), ic, FALSE); + size = AOP_SIZE (IC_RESULT (ic)); + offset = 0; + while (size--) + { + pic14_emitcode ("pop", "acc"); + aopPut (AOP (IC_RESULT (ic)), "a", offset++); + } - if (isOperandInFarSpace(IC_RESULT(ic)) && - ( OP_SYMBOL(IC_RESULT(ic))->isspilt || - IS_TRUE_SYMOP(IC_RESULT(ic))) ) { - - int size = getSize(operandType(IC_RESULT(ic))); - int offset = fReturnSizePic - size; - while (size--) { - pic14_emitcode ("push","%s", (strcmp(fReturn[fReturnSizePic - offset - 1],"a") ? - fReturn[fReturnSizePic - offset - 1] : "acc")); - offset++; - } - aopOp(IC_RESULT(ic),ic,FALSE); - size = AOP_SIZE(IC_RESULT(ic)); - offset = 0; - while (size--) { - pic14_emitcode ("pop","acc"); - aopPut (AOP(IC_RESULT(ic)),"a",offset++); - } - - } else { - _G.accInUse++; - aopOp(IC_RESULT(ic),ic,FALSE); - _G.accInUse--; - GpsuedoStkPtr = ic->parmBytes; // address used arg on stack - assignResultValue(IC_RESULT(ic)); + } + else + { + _G.accInUse++; + aopOp (IC_RESULT (ic), ic, FALSE); + _G.accInUse--; + GpsuedoStkPtr = ic->parmBytes; // address used arg on stack + assignResultValue (IC_RESULT (ic)); } - freeAsmop(IC_RESULT(ic),NULL,ic,TRUE); + freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ @@ -6896,11 +7378,11 @@ static void genDummyRead (iCode * ic) { - FENTRY; - pic14_emitcode ("; genDummyRead",""); - pic14_emitcode ("; not implemented",""); + FENTRY; + pic14_emitcode ("; genDummyRead", ""); + pic14_emitcode ("; not implemented", ""); - ic = ic; + ic = ic; } /*-----------------------------------------------------------------*/ @@ -6915,294 +7397,314 @@ * peep hole optimizer and the pCode optimizer. *-----------------------------------------------------------------*/ -void genpic14Code (iCode *lic) +void +genpic14Code (iCode * lic) { - iCode *ic; - int cln = 0; - const char *cline; + iCode *ic; + int cln = 0; + const char *cline; - FENTRY; - lineHead = lineCurr = NULL; + FENTRY; - pb = newpCodeChain(GcurMemmap,0,newpCodeCharP("; Starting pCode block")); - addpBlock(pb); + pb = newpCodeChain (GcurMemmap, 0, newpCodeCharP ("; Starting pCode block")); + addpBlock (pb); - /* if debug information required */ - if (options.debug && debugFile && currFunc) { - debugFile->writeFunction (currFunc, lic); + /* if debug information required */ + if (options.debug && debugFile && currFunc) + { + debugFile->writeFunction (currFunc, lic); } - for (ic = lic ; ic ; ic = ic->next ) { + for (ic = lic; ic; ic = ic->next) + { + initGenLineElement (); - //DEBUGpic14_emitcode(";ic",""); - //fprintf (stderr, "in ic loop\n"); - //pic14_emitcode ("", ";\t%s:%d: %s", ic->filename, - //ic->lineno, printCLine(ic->filename, ic->lineno)); + //DEBUGpic14_emitcode(";ic",""); + //fprintf (stderr, "in ic loop\n"); + //pic14_emitcode ("", ";\t%s:%d: %s", ic->filename, + //ic->lineno, printCLine(ic->filename, ic->lineno)); - if (!options.noCcodeInAsm && (cln != ic->lineno)) { + if (!options.noCcodeInAsm && (cln != ic->lineno)) + { cln = ic->lineno; //fprintf (stderr, "%s\n", printCLine (ic->filename, ic->lineno)); cline = printCLine (ic->filename, ic->lineno); - if (!cline || strlen (cline) == 0) cline = printCLine (ic->filename, ic->lineno); + if (!cline || strlen (cline) == 0) + cline = printCLine (ic->filename, ic->lineno); addpCode2pBlock (pb, newpCodeCSource (ic->lineno, ic->filename, cline)); //emitpComment ("[C-SRC] %s:%d: %s", ic->filename, cln, cline); } - if (options.iCodeInAsm) { - const char *iLine = printILine(ic); + if (options.iCodeInAsm) + { + const char *iLine = printILine (ic); emitpComment ("[ICODE] %s:%d: %s", ic->filename, ic->lineno, printILine (ic)); - dbuf_free(iLine); + dbuf_free (iLine); } - /* if the result is marked as - spilt and rematerializable or code for - this has already been generated then - do nothing */ - if (resultRemat(ic) || ic->generated ) - continue ; - - /* depending on the operation */ - switch (ic->op) { - case '!' : - genNot(ic); - break; + /* if the result is marked as + spilt and rematerializable or code for + this has already been generated then + do nothing */ + if (resultRemat (ic) || ic->generated) + continue; - case '~' : - genCpl(ic); - break; + /* depending on the operation */ + switch (ic->op) + { + case '!': + genNot (ic); + break; + + case '~': + genCpl (ic); + break; case UNARYMINUS: - genUminus (ic); - break; + genUminus (ic); + break; case IPUSH: - genIpush (ic); - break; + genIpush (ic); + break; case IPOP: - /* IPOP happens only when trying to restore a - spilt live range, if there is an ifx statement - following this pop then the if statement might - be using some of the registers being popped which - would destory the contents of the register so - we need to check for this condition and handle it */ - if (ic->next && - ic->next->op == IFX && - regsInCommon(IC_LEFT(ic),IC_COND(ic->next))) - genIfx (ic->next,ic); - else - genIpop (ic); - break; + /* IPOP happens only when trying to restore a + spilt live range, if there is an ifx statement + following this pop then the if statement might + be using some of the registers being popped which + would destory the contents of the register so + we need to check for this condition and handle it */ + if (ic->next && ic->next->op == IFX && regsInCommon (IC_LEFT (ic), IC_COND (ic->next))) + genIfx (ic->next, ic); + else + genIpop (ic); + break; case CALL: - genCall (ic); - break; + genCall (ic); + break; case PCALL: - genPcall (ic); - break; + genPcall (ic); + break; case FUNCTION: - genFunction (ic); - break; + genFunction (ic); + break; case ENDFUNCTION: - genEndFunction (ic); - break; + genEndFunction (ic); + break; case RETURN: - genRet (ic); - break; + genRet (ic); + break; case LABEL: - genLabel (ic); - break; + genLabel (ic); + break; case GOTO: - genGoto (ic); - break; + genGoto (ic); + break; - case '+' : - genPlus (ic) ; - break; + case '+': + genPlus (ic); + break; - case '-' : - if ( ! genDjnz (ic,ifxForOp(IC_RESULT(ic),ic))) - genMinus (ic); - break; + case '-': + if (!genDjnz (ic, ifxForOp (IC_RESULT (ic), ic))) + genMinus (ic); + break; - case '*' : - genMult (ic); - break; + case '*': + genMult (ic); + break; - case '/' : - genDiv (ic) ; - break; + case '/': + genDiv (ic); + break; - case '%' : - genMod (ic); - break; + case '%': + genMod (ic); + break; - case '>' : - genCmpGt (ic,ifxForOp(IC_RESULT(ic),ic)); - break; + case '>': + genCmpGt (ic, ifxForOp (IC_RESULT (ic), ic)); + break; - case '<' : - genCmpLt (ic,ifxForOp(IC_RESULT(ic),ic)); - break; + case '<': + genCmpLt (ic, ifxForOp (IC_RESULT (ic), ic)); + break; case LE_OP: case GE_OP: case NE_OP: - /* note these two are xlated by algebraic equivalence - during parsing SDCC.y */ - werror(E_INTERNAL_ERROR,__FILE__,__LINE__, - "got '>=' or '<=' shouldn't have come here"); - break; + /* note these two are xlated by algebraic equivalence + during parsing SDCC.y */ + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "got '>=' or '<=' shouldn't have come here"); + break; case EQ_OP: - genCmpEq (ic,ifxForOp(IC_RESULT(ic),ic)); - break; + genCmpEq (ic, ifxForOp (IC_RESULT (ic), ic)); + break; case AND_OP: - genAndOp (ic); - break; + genAndOp (ic); + break; case OR_OP: - genOrOp (ic); - break; + genOrOp (ic); + break; - case '^' : - genXor (ic,ifxForOp(IC_RESULT(ic),ic)); - break; + case '^': + genXor (ic, ifxForOp (IC_RESULT (ic), ic)); + break; - case '|' : - genOr (ic,ifxForOp(IC_RESULT(ic),ic)); - break; + case '|': + genOr (ic, ifxForOp (IC_RESULT (ic), ic)); + break; case BITWISEAND: - genAnd (ic,ifxForOp(IC_RESULT(ic),ic)); - break; + genAnd (ic, ifxForOp (IC_RESULT (ic), ic)); + break; case INLINEASM: - genInline (ic); - break; + pic14_genInline (ic); + break; case RRC: - genRRC (ic); - break; + genRRC (ic); + break; case RLC: - genRLC (ic); - break; + genRLC (ic); + break; + + case GETABIT: + genGetABit (ic); + break; case GETHBIT: - genGetHbit (ic); - break; + genGetHbit (ic); + break; case LEFT_OP: - genLeftShift (ic); - break; + genLeftShift (ic); + break; case RIGHT_OP: - genRightShift (ic); - break; + genRightShift (ic); + break; case GET_VALUE_AT_ADDRESS: - genPointerGet(ic); - break; + genPointerGet (ic); + break; - case '=' : - if (POINTER_SET(ic)) - genPointerSet(ic); - else - genAssign(ic); - break; + case '=': + if (POINTER_SET (ic)) + genPointerSet (ic); + else + genAssign (ic); + break; case IFX: - genIfx (ic,NULL); - break; + genIfx (ic, NULL); + break; case ADDRESS_OF: - genAddrOf (ic); - break; + genAddrOf (ic); + break; case JUMPTABLE: - genJumpTab (ic); - break; + genJumpTab (ic); + break; case CAST: - genCast (ic); - break; + genCast (ic); + break; case RECEIVE: - genReceive(ic); - break; + genReceive (ic); + break; case SEND: - addSet(&_G.sendSet,ic); - break; + addSet (&_G.sendSet, ic); + break; case DUMMY_READ_VOLATILE: - genDummyRead (ic); - break; + genDummyRead (ic); + break; - default : - fprintf(stderr, "UNHANDLED iCode: "); piCode(ic, stderr); - ic = ic; - break; + case CRITICAL: + genCritical (ic); + break; + + case ENDCRITICAL: + genEndCritical (ic); + break; + + default: + fprintf (stderr, "UNHANDLED iCode: "); + piCode (ic, stderr); + ic = ic; + break; } } - /* now we are ready to call the - peep hole optimizer */ - if (!options.nopeep) { - peepHole (&lineHead); + /* now we are ready to call the + peep hole optimizer */ + if (!options.nopeep) + { + peepHole (&genLine.lineHead); } - /* now do the actual printing */ - printLine (lineHead,codeOutBuf); + /* now do the actual printing */ + printLine (genLine.lineHead, codeOutBuf); #ifdef PCODE_DEBUG - DFPRINTF((stderr,"printing pBlock\n\n")); - printpBlock(stdout,pb); + DFPRINTF ((stderr, "printing pBlock\n\n")); + printpBlock (stdout, pb); #endif - return; + /* destroy the line list */ + destroy_line_list (); } /* This is not safe, as a AOP_PCODE/PO_IMMEDIATE might be used both as literal * (meaning: representing its own address) or not (referencing its contents). * This can only be decided based on the operand's type. */ static int -aop_isLitLike (asmop *aop) +aop_isLitLike (asmop * aop) { assert (aop); - if (aop->type == AOP_LIT) return 1; - if (aop->type == AOP_IMMD) return 1; - if ((aop->type == AOP_PCODE) && - ((aop->aopu.pcop->type == PO_LITERAL))) - { - /* this should be treated like a literal/immediate (use MOVLW/ADDLW/SUBLW - * instead of MOVFW/ADDFW/SUBFW, use popGetAddr instead of popGet) */ + if (aop->type == AOP_LIT) return 1; - } + if (aop->type == AOP_IMMD) + return 1; + if ((aop->type == AOP_PCODE) && ((aop->aopu.pcop->type == PO_LITERAL))) + { + /* this should be treated like a literal/immediate (use MOVLW/ADDLW/SUBLW + * instead of MOVFW/ADDFW/SUBFW, use popGetAddr instead of popGet) */ + return 1; + } return 0; } int -op_isLitLike (operand *op) +op_isLitLike (operand * op) { assert (op); - if (aop_isLitLike (AOP(op))) return 1; - if (IS_SYMOP(op) && IS_FUNC(OP_SYM_TYPE(op))) return 1; - if (IS_SYMOP(op) && IS_PTR(OP_SYM_TYPE(op)) - && (AOP_TYPE(op) == AOP_PCODE) - && (AOP(op)->aopu.pcop->type == PO_IMMEDIATE)) { + if (aop_isLitLike (AOP (op))) return 1; - } + if (IS_SYMOP (op) && IS_FUNC (OP_SYM_TYPE (op))) + return 1; + if (IS_SYMOP (op) && IS_PTR (OP_SYM_TYPE (op)) && (AOP_TYPE (op) == AOP_PCODE) && (AOP (op)->aopu.pcop->type == PO_IMMEDIATE)) + { + return 1; + } return 0; } - diff -Nru sdcc-3.1.0+dfsg/src/pic14/genarith.c sdcc-3.2.0+dfsg/src/pic14/genarith.c --- sdcc-3.1.0+dfsg/src/pic14/genarith.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic14/genarith.c 2012-06-28 14:09:28.000000000 +0000 @@ -260,24 +260,53 @@ static void genAddLit (iCode *ic, int lit) { - - int size,same; + int size, same; int lo; - + operand *result; operand *left; - + FENTRY; DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - + left = IC_LEFT(ic); result = IC_RESULT(ic); same = pic14_sameRegs(AOP(left), AOP(result)); size = pic14_getDataSize(result); if (size > pic14_getDataSize(left)) size = pic14_getDataSize(left); - + + /* + * Fix accessing libsdcc/<*>/idata.c:_cinit in __code space. + */ + if (AOP_PCODE == AOP_TYPE(IC_LEFT(ic))) + { + int u; + if (debug_verbose) + { + printf("%s:%u: CHECK: using address of '%s' instead of contents\n", + ic->filename, ic->lineno, + popGetAddr(AOP(IC_LEFT(ic)), 0, lit & 0xff)->name); + } // if + for (u = 0; u < size; ++u) + { + emitpcode(POC_MOVLW, popGetAddr(AOP(IC_LEFT(ic)), u, lit)); + emitpcode(POC_MOVWF, popGet(AOP(IC_RESULT(ic)), u)); + } // for + + if (size < pic14_getDataSize(result)) + { + for (u = size; u < pic14_getDataSize(result); ++u) + { + /* XXX: Might fail for u >= size?!? */ + emitpcode(POC_MOVLW, popGetAddr(AOP(IC_LEFT(ic)), u, lit)); + emitpcode(POC_MOVWF, popGet(AOP(IC_RESULT(ic)), u)); + } // for + } // if + + goto out; + } // if + if(same) { /* Handle special cases first */ @@ -466,7 +495,6 @@ switch(lit & 0xff) { case 0: emitpcode(POC_MOVFW, popGet(AOP(left),0)); - emitMOVWF(result, 0); emitMOVWF(result,0); break; case 1: @@ -530,6 +558,7 @@ } } +out: size = pic14_getDataSize(result); if (size > pic14_getDataSize(left)) size = pic14_getDataSize(left); diff -Nru sdcc-3.1.0+dfsg/src/pic14/glue.c sdcc-3.2.0+dfsg/src/pic14/glue.c --- sdcc-3.1.0+dfsg/src/pic14/glue.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic14/glue.c 2012-06-28 14:09:28.000000000 +0000 @@ -70,7 +70,6 @@ emitPseudoStack(struct dbuf_s *oBuf, struct dbuf_s *oBufExt) { int shared, low, high, size, i; - PIC_device *pic; /* also emit STK symbols * XXX: This is ugly and fails as soon as devices start to get @@ -80,8 +79,6 @@ shared = pic14_getSharedStack(&low, &high, &size); if (!pic14_options.isLibrarySource) { - pic = pic14_getPIC(); - dbuf_printf (oBuf, "\n"); dbuf_printf (oBuf, "\tglobal PSAVE\n"); dbuf_printf (oBuf, "\tglobal SSAVE\n"); @@ -145,7 +142,7 @@ symbol *sym; set *aliases; int addr, min=-1, max=-1; - int size; + unsigned int size; for (i=0; maps[i] != NULL; i++) { @@ -919,7 +916,7 @@ emitInitVal(struct dbuf_s *oBuf, symbol *topsym, sym_link *my_type, initList *list) { symbol *sym; - int size, i; + int size; long lit; unsigned char *str; @@ -966,7 +963,9 @@ } if (IS_ARRAY(my_type)) { - DEBUGprintf ("(array, %d items, %d byte) below\n", DCL_ELEM(my_type), size); + size_t i; + + DEBUGprintf ("(array, %d items, %ud byte) below\n", (unsigned int) DCL_ELEM(my_type), size); assert (!list || list->type == INIT_DEEP); if (list) list = list->init.deep; for (i = 0; i < DCL_ELEM(my_type); i++) { diff -Nru sdcc-3.1.0+dfsg/src/pic14/main.c sdcc-3.2.0+dfsg/src/pic14/main.c --- sdcc-3.1.0+dfsg/src/pic14/main.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic14/main.c 2012-06-03 17:48:05.000000000 +0000 @@ -5,7 +5,7 @@ it easier to set a breakpoint using the debugger. */ #include "common.h" -#include "SDCCsystem.h" +#include "dbuf_string.h" #include "SDCCmacro.h" #include "device.h" @@ -113,7 +113,7 @@ can pass only the first parameter in a register */ //if (regParmFlg) // return 0; - + regParmFlg++;// = 1; return 1; } @@ -130,10 +130,43 @@ static void _pic14_finaliseOptions (void) { + struct dbuf_s dbuf; + pCodeInitRegisters(); - + port->mem.default_local_map = data; port->mem.default_globl_map = data; + + dbuf_init (&dbuf, 512); + dbuf_printf (&dbuf, "-D__SDCC_PROCESSOR=\"%s\"", port->processor); + addSet (&preArgvSet, Safe_strdup (dbuf_detach_c_str (&dbuf))); + +/* + * deprecated in sdcc 3.2.0 + * TODO: should be obsoleted in sdcc 3.3.0 or later + if (options.std_sdcc) + */ + { + dbuf_set_length (&dbuf, 0); + dbuf_printf (&dbuf, "-DSDCC_PROCESSOR=\"%s\"", port->processor); + addSet (&preArgvSet, dbuf_detach_c_str (&dbuf)); + } + + { + char *upperProc, *p1, *p2; + int len; + + dbuf_set_length (&dbuf, 0); + len = strlen (port->processor); + upperProc = Safe_malloc (len); + for (p1 = port->processor, p2 = upperProc; *p1; ++p1, ++p2) + { + *p2 = toupper (*p1); + } + dbuf_append (&dbuf, "-D__SDCC_PIC", sizeof ("-D__SDCC_PIC") - 1); + dbuf_append (&dbuf, upperProc, len); + addSet (&preArgvSet, dbuf_detach_c_str (&dbuf)); + } } static void @@ -153,13 +186,13 @@ _pic14_genAssemblerPreamble (FILE * of) { char * name = processor_base_name(); - + if(!name) { - + name = "16f877"; fprintf(stderr,"WARNING: No Pic has been selected, defaulting to %s\n",name); } - + fprintf (of, "\tlist\tp=%s\n",name); fprintf (of, "\tradix dec\n"); fprintf (of, "\tinclude \"p%s.inc\"\n",name); @@ -180,11 +213,11 @@ { return FALSE; } - + /* multiply chars in-place */ if (getSize(left) == 1 && getSize(right) == 1) return TRUE; - + /* use library functions for more complex maths */ return FALSE; } @@ -195,6 +228,7 @@ { if (op == RRC || op == RLC + || op == GETABIT /* || op == GETHBIT */ /* GETHBIT doesn't look complete for PIC */ ) return TRUE; @@ -225,7 +259,7 @@ set *tSet = NULL; int ret; char * procName; - + /* * link command format: * {linker} {incdirs} {lflags} -o {outfile} {spec_ofiles} {ofiles} {libs} @@ -243,7 +277,7 @@ joinStrSet (appendStrSet (libDirsSet, "-I\"", "\"")); shash_add (&linkValues, "sysincdirs", joinStrSet (appendStrSet (libDirsSet, "-I\"", "\""))); - + shash_add (&linkValues, "lflags", joinStrSet (linkOptionsSet)); shash_add (&linkValues, "outfile", fullDstFileName ? fullDstFileName : dstFileName); @@ -302,8 +336,8 @@ { _asmCmd, NULL, - "-g", /* options with --debug */ - NULL, /* options without --debug */ + "-g", /* options with --debug */ + NULL, /* options without --debug */ //"-plosgffc", /* Options with debug */ //"-plosgff", /* Options without debug */ 0, @@ -343,7 +377,7 @@ "GSINIT (CODE)", "udata_ovr", "GSFINAL (CODE)", - "HOME (CODE)", + "HOME (CODE)", NULL, // xidata NULL, // xinit "CONST (CODE)", // const_name - const data (code or not) diff -Nru sdcc-3.1.0+dfsg/src/pic14/pcode.c sdcc-3.2.0+dfsg/src/pic14/pcode.c --- sdcc-3.1.0+dfsg/src/pic14/pcode.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic14/pcode.c 2012-02-12 19:33:02.000000000 +0000 @@ -2150,8 +2150,8 @@ PCORB(pcop)->bit = ibit; PCORB(pcop)->inBitSpace = inBitSpace; - if (name) r = regFindWithName(name); - if (!r) { + if (name) r = regFindWithName(name); + if (name && !r) { // Register has not been allocated - check for symbol information symbol *sym; sym = symFindWithName(bit, name); @@ -2170,11 +2170,13 @@ pcop->name = NULL; PCOR(pcop)->r = r; PCOR(pcop)->rIdx = r->rIdx; - } else { + } else if (name) { pcop->name = Safe_strdup(name); PCOR(pcop)->r = NULL; PCOR(pcop)->rIdx = 0; - } + } else { + //fprintf(stderr, "Unnamed register duplicated for bit-access?!? Hope for the best ...\n"); + } return pcop; } @@ -2247,7 +2249,7 @@ switch(type) { case PO_BIT: case PO_GPR_BIT: - pcop = newpCodeOpBit(name, -1,0); + pcop = newpCodeOpBit(name, -1, 0); break; case PO_LITERAL: @@ -4500,9 +4502,9 @@ pCodeOp *popCopyGPR2Bit(pCodeOp *pc, int bitval) { pCodeOp *pcop; - + pcop = newpCodeOpBit(pc->name, bitval, 0); - + if( !( (pcop->type == PO_LABEL) || (pcop->type == PO_LITERAL) || (pcop->type == PO_STR) )) diff -Nru sdcc-3.1.0+dfsg/src/pic14/pcodepeep.c sdcc-3.2.0+dfsg/src/pic14/pcodepeep.c --- sdcc-3.1.0+dfsg/src/pic14/pcodepeep.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic14/pcodepeep.c 2012-01-26 17:33:28.000000000 +0000 @@ -598,13 +598,10 @@ { parsedPattern *p = pp; int opcode; - int dest; // or could be bit position in the register pCodeInstruction *pci=NULL; pCodeOp *pcosubtype=NULL; - dest = cvt_extract_destination(&p[3]); - DFPRINTF((stderr,"altpat_mnem3 %s var %s bit (%d)\n", p->pct[0].tok.s, p[1].pct[0].tok.s, @@ -918,10 +915,6 @@ int j=0; int k=0; - char * cPmnem = NULL; // Pointer to non-wild mnemonic (if any) - char * cP1stop = NULL; - char * cP2ndop = NULL; - //pCodeOp *pcl = NULL; // Storage for a label //pCodeOp *pco1 = NULL; // 1st operand //pCodeOp *pco2 = NULL; // 2nd operand @@ -966,12 +959,10 @@ case PS_START: case PS_HAVE_LABEL: DFPRINTF((stderr," mnem\n")); - cPmnem = tokArr[ltokIdx].tok.s; state = PS_HAVE_MNEM; break; case PS_HAVE_MNEM: DFPRINTF((stderr," 1st operand\n")); - cP1stop = tokArr[ltokIdx].tok.s; //pco1 = newpCodeOp(NULL,PO_GPR_REGISTER); state = PS_HAVE_1OPERAND; break; @@ -980,7 +971,6 @@ break; case PS_HAVE_COMMA: DFPRINTF((stderr," 2 operands\n")); - cP2ndop = tokArr[ltokIdx].tok.s; break; case PS_HAVE_2OPERANDS: break; @@ -1273,21 +1263,22 @@ //return; // debug ... don't want to go through all the rules yet } - { - pCodePeep *peepBlock; - DLList *peeprules; - - peeprules = (DLList *)peepSnippets; - //fprintf(stderr,"target rules\n"); - while(peeprules) { - //fprintf(stderr," rule:\n"); - peepBlock = ((pCodePeepSnippets*)peeprules)->peep; - //printpBlock(stderr, peepBlock->target.pb); - peeprules = peeprules->next; - } - //fprintf(stderr," ... done\n"); - } + if (0) + { + pCodePeep *peepBlock; + DLList *peeprules; + peeprules = (DLList *)peepSnippets; + fprintf(stderr,"target rules\n"); + while (peeprules) + { + fprintf(stderr," rule:\n"); + peepBlock = ((pCodePeepSnippets*)peeprules)->peep; + printpBlock(stderr, peepBlock->target.pb); + peeprules = peeprules->next; + } // while + fprintf(stderr," ... done\n"); + } // if } /*-----------------------------------------------------------------*/ diff -Nru sdcc-3.1.0+dfsg/src/pic14/pic14.vcxproj sdcc-3.2.0+dfsg/src/pic14/pic14.vcxproj --- sdcc-3.1.0+dfsg/src/pic14/pic14.vcxproj 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic14/pic14.vcxproj 2012-03-18 13:40:40.000000000 +0000 @@ -178,10 +178,12 @@ - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph.rul peeph.rul;%(Outputs) - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph.rul peeph.rul;%(Outputs) + Generating Peephole Rule: peeph.rul + Generating Peephole Rule: peeph.rul diff -Nru sdcc-3.1.0+dfsg/src/pic14/ralloc.c sdcc-3.2.0+dfsg/src/pic14/ralloc.c --- sdcc-3.1.0+dfsg/src/pic14/ralloc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic14/ralloc.c 2012-06-05 09:03:12.000000000 +0000 @@ -3374,7 +3374,9 @@ static void packForPush (iCode * ic, eBBlock * ebp) { - iCode *dic; + iCode *dic, *lic; + bitVect *dbv; + int disallowHiddenAssignment = 0; debugLog ("%s\n", __FUNCTION__); if (ic->op != IPUSH || !IS_ITEMP (IC_LEFT (ic))) @@ -3393,6 +3395,45 @@ if (dic->op != '=' || POINTER_SET (dic)) return; + /* If the defining iCode is outside of this block, we need to recompute */ + /* ebp (see the mcs51 version of packForPush), but we weren't passed */ + /* enough data to do that. Just bail out instead if that happens. */ + if (dic->seq < ebp->fSeq) + return; + + if (IS_SYMOP (IC_RIGHT (dic))) { + if (IC_RIGHT (dic)->isvolatile) + return; + + if (OP_SYMBOL (IC_RIGHT (dic))->addrtaken || isOperandGlobal (IC_RIGHT (dic))) + disallowHiddenAssignment = 1; + + /* make sure the right side does not have any definitions + inbetween */ + dbv = OP_DEFS (IC_RIGHT (dic)); + for (lic = ic; lic && lic != dic; lic = lic->prev) { + if (bitVectBitValue (dbv, lic->key)) + return; + if (disallowHiddenAssignment && (lic->op == CALL || lic->op == PCALL || POINTER_SET (lic))) + return; + } + /* make sure they have the same type */ + if (IS_SPEC (operandType (IC_LEFT (ic)))) { + sym_link *itype = operandType (IC_LEFT (ic)); + sym_link *ditype = operandType (IC_RIGHT (dic)); + + if (SPEC_USIGN (itype) != SPEC_USIGN (ditype) || SPEC_LONG (itype) != SPEC_LONG (ditype)) + return; + } + /* extend the live range of replaced operand if needed */ + if (OP_SYMBOL (IC_RIGHT (dic))->liveTo < ic->seq) { + OP_SYMBOL (IC_RIGHT (dic))->liveTo = ic->seq; + } + bitVectUnSetBit (OP_SYMBOL (IC_RESULT (dic))->defs, dic->key); + } + if (IS_ITEMP (IC_RIGHT (dic))) + OP_USES (IC_RIGHT (dic)) = bitVectSetBit (OP_USES (IC_RIGHT (dic)), ic->key); + /* we now we know that it has one & only one def & use and the that the definition is an assignment */ IC_LEFT (ic) = IC_RIGHT (dic); diff -Nru sdcc-3.1.0+dfsg/src/pic16/device.c sdcc-3.2.0+dfsg/src/pic16/device.c --- sdcc-3.1.0+dfsg/src/pic16/device.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic16/device.c 2012-04-07 17:15:16.000000000 +0000 @@ -1,23 +1,23 @@ /*------------------------------------------------------------------------- - device.c - Accomodates subtle variations in PIC16 devices - Written By - Scott Dattalo scott@dattalo.com - Ported to PIC16 By - Martin Dubuc m.dubuc@rogers.com - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + Copyright (C) 2000, Scott Dattalo scott@dattalo.com + PIC16 port: + Copyright (C) 2002, Martin Dubuc m.dubuc@rogers.com + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -------------------------------------------------------------------------*/ #include @@ -32,7 +32,7 @@ #include "device.h" void pic16_printIval (symbol * sym, sym_link * type, initList * ilist, char ptype, void *p); -extern void pic16_pCodeConstString (char *name, char *value, unsigned length); +extern void pic16_pCodeConstString (char *name, const char *value, unsigned length); stats_t statistics = { 0, 0, 0, 0 }; @@ -77,13 +77,13 @@ if (!r) return; - fprintf (of, "%s", iComments2); + fprintf (of, "\n%s", iComments2); fprintf (of, ";\tEquates to used internal registers\n"); fprintf (of, "%s", iComments2); for (; r; r = setNextItem (equs)) { - fprintf (of, "%s\tequ\t0x%02x\n", r->name, r->address); + fprintf (of, "%s\tequ\t0x%03x\n", r->name, r->address); } // for } @@ -347,7 +347,6 @@ else { unsigned int j = 0; - symbol *s1; sprev = NULL; init_addr = SPEC_ADDR (slist[j]->etype); @@ -356,10 +355,6 @@ for (j = 0; j < i; j++) { s = slist[j]; - s1 = NULL; - if (j < i - 1) - s1 = slist[j + 1]; - init_addr = SPEC_ADDR (s->etype); if (sprev && (init_addr > (SPEC_ADDR (sprev->etype) + getSize (sprev->etype)))) diff -Nru sdcc-3.1.0+dfsg/src/pic16/device.h sdcc-3.2.0+dfsg/src/pic16/device.h --- sdcc-3.1.0+dfsg/src/pic16/device.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic16/device.h 2012-06-28 14:09:28.000000000 +0000 @@ -63,8 +63,8 @@ typedef struct PIC16_device { char *name[PROCESSOR_NAMES]; /* aliases for the processor name */ /* RAMsize *must* be the first item to copy for 'using' */ - int RAMsize; /* size of Data RAM - VR 031120 */ - int acsSplitOfs; /* access bank split offset */ + unsigned int RAMsize; /* size of Data RAM - VR 031120 */ + unsigned int acsSplitOfs; /* access bank split offset */ configWordsInfo_t cwInfo; /* configuration words info */ idBytesInfo_t idInfo; /* ID Locations info */ /* next *must* be the first field NOT being copied via 'using' */ diff -Nru sdcc-3.1.0+dfsg/src/pic16/gen.c sdcc-3.2.0+dfsg/src/pic16/gen.c --- sdcc-3.1.0+dfsg/src/pic16/gen.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic16/gen.c 2012-06-28 14:09:28.000000000 +0000 @@ -1,12 +1,14 @@ - /*------------------------------------------------------------------------- - gen.c - source file for code generation for pic16 +/*------------------------------------------------------------------------- + gen.c - source file for code generation for pic16 - Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998) - and - Jean-Louis VERN.jlvern@writeme.com (1999) + Copyright (C) 1998, Sandeep Dutta . sandeep.dutta@usa.net + Copyright (C) 1999, Jean-Louis VERN.jlvern@writeme.com Bug Fixes - Wojciech Stryjewski wstryj1@tiger.lsu.edu (1999 v2.1.9a) - PIC port - Scott Dattalo scott@dattalo.com (2000) - PIC16 port - Martin Dubuc m.dubuc@rogers.com (2002) - - Vangelis Rokas (2003-2006) + PIC port: + Copyright (C) 2000, Scott Dattalo scott@dattalo.com + PIC16 port: + Copyright (C) 2002, Martin Dubuc m.dubuc@rogers.com + Copyright (C) 2003-2006,Vangelis Rokas Bug Fixes - Raphael Neider (2004,2005) Bug Fixes - Borut Razem (2007) Bug Fixes - Mauro Giachero (2008) @@ -24,25 +26,19 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! - +-------------------------------------------------------------------------*/ +/* Notes: 000123 mlh Moved aopLiteral to SDCCglue.c to help the split Made everything static --------------------------------------------------------------------------*/ +*/ #include #include #include #include -#include "SDCCglobl.h" -#include "newalloc.h" #include "common.h" -#include "SDCCpeeph.h" #include "ralloc.h" #include "pcode.h" #include "gen.h" @@ -50,6 +46,7 @@ #include "device.h" #include "main.h" #include "glue.h" +#include "dbuf_string.h" /* The PIC port(s) do not need to distinguish between POINTER and FPOINTER. */ #define PIC_IS_DATA_PTR(x) (IS_DATA_PTR(x) || IS_FARPTR(x)) @@ -60,15 +57,17 @@ /* Wrapper to execute `code' at most once. */ #define PERFORM_ONCE(id,code) do { static char id = 0; if (!id) { id = 1; code } } while (0) -void pic16_genMult8X8_n (operand *, operand *,operand *); -extern void pic16_printpBlock(FILE *of, pBlock *pb); +void pic16_genMult8X8_n (operand *, operand *, operand *); +extern void pic16_printpBlock (FILE * of, pBlock * pb); static asmop *newAsmop (short type); -static pCodeOp *pic16_popRegFromString(char *str, int size, int offset, operand *op); -extern pCode *pic16_newpCodeAsmDir(char *asdir, char *argfmt, ...); -static void mov2fp(pCodeOp *dst, asmop *src, int offset); -static pCodeOp *pic16_popRegFromIdx(int rIdx); +static pCodeOp *pic16_popRegFromString (char *str, int size, int offset, operand * op); +extern pCode *pic16_newpCodeAsmDir (char *asdir, char *argfmt, ...); +static void mov2fp (pCodeOp * dst, asmop * src, int offset); +static pCodeOp *pic16_popRegFromIdx (int rIdx); +static void genCritical (iCode * ic); +static void genEndCritical (iCode * ic); -int pic16_labelOffset=0; +int pic16_labelOffset = 0; extern int pic16_debug_verbose; extern set *externs; @@ -77,16 +76,15 @@ a function. This is then used to adjust the label offset for the next function. */ -static int max_key=0; -static int GpsuedoStkPtr=0; +static int max_key = 0; +static int GpsuedoStkPtr = 0; -pCodeOp *pic16_popGetImmd(char *name, unsigned int offset, int index); +pCodeOp *pic16_popGetImmd (char *name, unsigned int offset, int index); -const char *pic16_AopType(short type); -static iCode *ifxForOp ( operand *op, iCode *ic ); +const char *pic16_AopType (short type); -void pic16_pushpCodeOp(pCodeOp *pcop); -void pic16_poppCodeOp(pCodeOp *pcop); +void pic16_pushpCodeOp (pCodeOp * pcop); +void pic16_poppCodeOp (pCodeOp * pcop); #define BYTEofLONG(l,b) ( (l>> (b<<3)) & 0xff) @@ -101,7 +99,7 @@ CODE GENERATION for a specific MCU . some of the routines may be reusable, will have to see */ static char *zero = "#0x00"; -static char *one = "#0x01"; +static char *one = "#0x01"; /* @@ -114,38 +112,40 @@ */ char *fReturnpic16[] = { "WREG", "PRODL", "PRODH", "FSR0L" }; int fReturnIdx[] = { IDX_WREG, IDX_PRODL, IDX_PRODH, IDX_FSR0L }; -unsigned pic16_fReturnSizePic = 4; /* shared with ralloc.c */ + +unsigned pic16_fReturnSizePic = 4; /* shared with ralloc.c */ static char **fReturn = fReturnpic16; -static char *accUse[] = {"WREG"}; +static char *accUse[] = { "WREG" }; -static struct { - short accInUse; - short inLine; - short debugLine; - short nRegsSaved; - set *sendSet; - set *stackRegSet; - int usefastretfie; - bitVect *fregsUsed; /* registers used in function */ - bitVect *sregsAlloc; - set *sregsAllocSet; /* registers used to store stack variables */ - int stack_lat; /* stack offset latency */ - int resDirect; - int useWreg; /* flag when WREG is used to pass function parameter */ +static struct +{ + short accInUse; + short inLine; + short debugLine; + short nRegsSaved; + set *sendSet; + set *stackRegSet; + int usefastretfie; + bitVect *fregsUsed; /* registers used in function */ + bitVect *sregsAlloc; + set *sregsAllocSet; /* registers used to store stack variables */ + int stack_lat; /* stack offset latency */ + int resDirect; + int useWreg; /* flag when WREG is used to pass function parameter */ } _G; extern struct dbuf_s *codeOutBuf; -static lineNode *lineHead = NULL; -static lineNode *lineCurr = NULL; +static unsigned char SLMask[] = { 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, + 0xE0, 0xC0, 0x80, 0x00 + }; + +static unsigned char SRMask[] = { 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, + 0x07, 0x03, 0x01, 0x00 + }; -static unsigned char SLMask[] = {0xFF ,0xFE, 0xFC, 0xF8, 0xF0, -0xE0, 0xC0, 0x80, 0x00}; -static unsigned char SRMask[] = {0xFF, 0x7F, 0x3F, 0x1F, 0x0F, -0x07, 0x03, 0x01, 0x00}; - -static pBlock *pb; +static pBlock *pb; /*-----------------------------------------------------------------*/ /* my_powof2(n) - If `n' is an integaer power of 2, then the */ @@ -156,152 +156,134 @@ /* return y; */ /* return -1; */ /*-----------------------------------------------------------------*/ -int pic16_my_powof2 (unsigned long num) +int +pic16_my_powof2 (unsigned long num) { - if(num) { - if( (num & (num-1)) == 0) { - int nshifts = -1; - while(num) { - num>>=1; - nshifts++; - } - return nshifts; + if (num) + { + if ((num & (num - 1)) == 0) + { + int nshifts = -1; + while (num) + { + num >>= 1; + nshifts++; + } + return nshifts; + } } - } return -1; } -void DEBUGpic16_pic16_AopType(int line_no, operand *left, operand *right, operand *result) +void +DEBUGpic16_pic16_AopType (int line_no, operand * left, operand * right, operand * result) { - DEBUGpic16_emitcode ("; ","line = %d result %s=%s, left %s=%s, right %s=%s, size = %d", + DEBUGpic16_emitcode ("; ", "line = %d result %s=%s, left %s=%s, right %s=%s, size = %d", line_no, - ((result) ? pic16_AopType(AOP_TYPE(result)) : "-"), - ((result) ? pic16_aopGet(AOP(result),0,TRUE,FALSE) : "-"), - ((left) ? pic16_AopType(AOP_TYPE(left)) : "-"), - ((left) ? pic16_aopGet(AOP(left),0,TRUE,FALSE) : "-"), - ((right) ? pic16_AopType(AOP_TYPE(right)) : "-"), - ((right) ? pic16_aopGet(AOP(right),0,FALSE,FALSE) : "-"), - ((result) ? AOP_SIZE(result) : 0)); + ((result) ? pic16_AopType (AOP_TYPE (result)) : "-"), + ((result) ? pic16_aopGet (AOP (result), 0, TRUE, FALSE) : "-"), + ((left) ? pic16_AopType (AOP_TYPE (left)) : "-"), + ((left) ? pic16_aopGet (AOP (left), 0, TRUE, FALSE) : "-"), + ((right) ? pic16_AopType (AOP_TYPE (right)) : "-"), + ((right) ? pic16_aopGet (AOP (right), 0, FALSE, FALSE) : "-"), ((result) ? AOP_SIZE (result) : 0)); } -void DEBUGpic16_pic16_AopTypeSign(int line_no, operand *left, operand *right, operand *result) +void +DEBUGpic16_pic16_AopTypeSign (int line_no, operand * left, operand * right, operand * result) { - DEBUGpic16_emitcode ("; ","line = %d, signs: result %s=%c, left %s=%c, right %s=%c", + DEBUGpic16_emitcode ("; ", "line = %d, signs: result %s=%c, left %s=%c, right %s=%c", line_no, - ((result) ? pic16_AopType(AOP_TYPE(result)) : "-"), - ((result) ? (SPEC_USIGN(operandType(result)) ? 'u' : 's') : '-'), - ((left) ? pic16_AopType(AOP_TYPE(left)) : "-"), - ((left) ? (SPEC_USIGN(operandType(left)) ? 'u' : 's') : '-'), - ((right) ? pic16_AopType(AOP_TYPE(right)) : "-"), - ((right) ? (SPEC_USIGN(operandType(right)) ? 'u' : 's') : '-')); + ((result) ? pic16_AopType (AOP_TYPE (result)) : "-"), + ((result) ? (SPEC_USIGN (operandType (result)) ? 'u' : 's') : '-'), + ((left) ? pic16_AopType (AOP_TYPE (left)) : "-"), + ((left) ? (SPEC_USIGN (operandType (left)) ? 'u' : 's') : '-'), + ((right) ? pic16_AopType (AOP_TYPE (right)) : "-"), + ((right) ? (SPEC_USIGN (operandType (right)) ? 'u' : 's') : '-')); } -void pic16_emitpcomment (char *fmt, ...) +void +pic16_emitpcomment (char *fmt, ...) { - va_list ap; - char lb[INITIAL_INLINEASM]; - unsigned char *lbp = (unsigned char *)lb; - - va_start(ap,fmt); + va_list ap; + struct dbuf_s dbuf; + const char *line; - lb[0] = ';'; - vsprintf(lb+1,fmt,ap); + dbuf_init (&dbuf, INITIAL_INLINEASM); - while (isspace(*lbp)) lbp++; + dbuf_append_char (&dbuf, ';'); + va_start (ap, fmt); + dbuf_vprintf (&dbuf, fmt, ap); + va_end (ap); - if (lbp && *lbp) - lineCurr = (lineCurr ? - connectLine(lineCurr,newLineNode(lb)) : - (lineHead = newLineNode(lb))); - lineCurr->isInline = _G.inLine; - lineCurr->isDebug = _G.debugLine; - lineCurr->isComment = 1; + line = dbuf_detach_c_str (&dbuf); + emit_raw (line); + dbuf_free (line); - pic16_addpCode2pBlock(pb,pic16_newpCodeCharP(lb)); - va_end(ap); - -// fprintf(stderr, "%s\n", lb); + pic16_addpCode2pBlock (pb, pic16_newpCodeCharP (genLine.lineCurr->line)); } -void DEBUGpic16_emitcode (char *inst,char *fmt, ...) +void +DEBUGpic16_emitcode (char *inst, char *fmt, ...) { - va_list ap; - char lb[INITIAL_INLINEASM]; - unsigned char *lbp = (unsigned char *)lb; - - if(!pic16_debug_verbose) - return; + va_list ap; - va_start(ap,fmt); - - if (inst && *inst) { - if (fmt && *fmt) - sprintf(lb,"%s\t",inst); - else - sprintf(lb,"%s",inst); - vsprintf(lb+(strlen(lb)),fmt,ap); - } else - vsprintf(lb,fmt,ap); - - while (isspace(*lbp)) lbp++; - - if (lbp && *lbp) - lineCurr = (lineCurr ? - connectLine(lineCurr,newLineNode(lb)) : - (lineHead = newLineNode(lb))); - lineCurr->isInline = _G.inLine; - lineCurr->isDebug = _G.debugLine; + if (!pic16_debug_verbose) + return; - pic16_addpCode2pBlock(pb,pic16_newpCodeCharP(lb)); - va_end(ap); + va_start (ap, fmt); + va_emitcode (inst, fmt, ap); + va_end (ap); -// fprintf(stderr, "%s\n", lb); + pic16_addpCode2pBlock (pb, pic16_newpCodeCharP (genLine.lineCurr->line)); } - - -void pic16_emitpLabel(int key) +void +pic16_emitpLabel (int key) { - if(key>max_key) + if (key > max_key) max_key = key; - pic16_addpCode2pBlock(pb,pic16_newpCodeLabel(NULL,key+100+pic16_labelOffset)); + pic16_addpCode2pBlock (pb, pic16_newpCodeLabel (NULL, labelKey2num (key + pic16_labelOffset))); } -void pic16_emitpLabelFORCE(int key) +void +pic16_emitpLabelFORCE (int key) { - if(key>max_key) + if (key > max_key) max_key = key; - pic16_addpCode2pBlock(pb,pic16_newpCodeLabelFORCE(NULL,key+100+pic16_labelOffset)); + pic16_addpCode2pBlock (pb, pic16_newpCodeLabelFORCE (NULL, labelKey2num (key + pic16_labelOffset))); } /* gen.h defines a macro pic16_emitpcode that allows for debug information to be inserted on demand * NEVER call pic16_emitpcode_real directly, please... */ -void pic16_emitpcode_real(PIC_OPCODE poc, pCodeOp *pcop) +void +pic16_emitpcode_real (PIC_OPCODE poc, pCodeOp * pcop) { - if(pcop) - pic16_addpCode2pBlock(pb,pic16_newpCode(poc,pcop)); + if (pcop) + pic16_addpCode2pBlock (pb, pic16_newpCode (poc, pcop)); else - DEBUGpic16_emitcode(";","%s ignoring NULL pcop",__FUNCTION__); + DEBUGpic16_emitcode (";", "%s ignoring NULL pcop", __FUNCTION__); } -void pic16_emitpinfo(INFO_TYPE itype, pCodeOp *pcop) +void +pic16_emitpinfo (INFO_TYPE itype, pCodeOp * pcop) { - if(pcop) - pic16_addpCode2pBlock(pb, pic16_newpCodeInfo(itype, pcop)); + if (pcop) + pic16_addpCode2pBlock (pb, pic16_newpCodeInfo (itype, pcop)); else - DEBUGpic16_emitcode(";","%s ignoring NULL pcop",__FUNCTION__); + DEBUGpic16_emitcode (";", "%s ignoring NULL pcop", __FUNCTION__); } -void pic16_emitpcodeNULLop(PIC_OPCODE poc) +void +pic16_emitpcodeNULLop (PIC_OPCODE poc) { - pic16_addpCode2pBlock(pb,pic16_newpCode(poc,NULL)); + pic16_addpCode2pBlock (pb, pic16_newpCode (poc, NULL)); } @@ -312,40 +294,43 @@ /*-----------------------------------------------------------------*/ /* pic16_emitcode - writes the code into a file : for now it is simple */ /*-----------------------------------------------------------------*/ -void pic16_emitcode (char *inst,char *fmt, ...) +void +pic16_emitcode (char *inst, char *fmt, ...) { - va_list ap; - char lb[INITIAL_INLINEASM]; - unsigned char *lbp = lb; - - va_start(ap,fmt); - - if (inst && *inst) { - if (fmt && *fmt) - sprintf(lb,"%s\t",inst); - else - sprintf(lb,"%s",inst); - vsprintf(lb+(strlen(lb)),fmt,ap); - } else - vsprintf(lb,fmt,ap); - - while (isspace(*lbp)) lbp++; - - if (lbp && *lbp) - lineCurr = (lineCurr ? - connectLine(lineCurr,newLineNode(lb)) : - (lineHead = newLineNode(lb))); - lineCurr->isInline = _G.inLine; - lineCurr->isDebug = _G.debugLine; - lineCurr->isLabel = (lbp[strlen (lbp) - 1] == ':'); - lineCurr->isComment = (*lbp == ';'); + va_list ap; + char lb[INITIAL_INLINEASM]; + unsigned char *lbp = lb; + + va_start (ap, fmt); + + if (inst && *inst) + { + if (fmt && *fmt) + sprintf (lb, "%s\t", inst); + else + sprintf (lb, "%s", inst); + vsprintf (lb + (strlen (lb)), fmt, ap); + } + else + vsprintf (lb, fmt, ap); + + while (isspace (*lbp)) + lbp++; + + if (lbp && *lbp) + genLine.lineCurr = (genLine.lineCurr ? + connectLine (genLine.lineCurr, newLineNode (lb)) : (genLine.lineHead = newLineNode (lb))); + genLine.lineCurr->isInline = genLine.lineElement.isInline; + genLine.lineCurr->isDebug = genLine.lineElement.isDebug; + genLine.lineCurr->isLabel = (lbp[strlen (lbp) - 1] == ':'); + genLine.lineCurr->isComment = (*lbp == ';'); // VR fprintf(stderr, "lb = <%s>\n", lbp); // if(pic16_debug_verbose) // pic16_addpCode2pBlock(pb,pic16_newpCodeCharP(lb)); - va_end(ap); + va_end (ap); } #endif @@ -355,81 +340,90 @@ /* with a debugger symbol */ /*-----------------------------------------------------------------*/ void -pic16_emitDebuggerSymbol (const char * debugSym) +pic16_emitDebuggerSymbol (const char *debugSym) { - _G.debugLine = 1; + genLine.lineElement.isDebug = 1; pic16_emitcode (";", "%s ==.", debugSym); - _G.debugLine = 0; + genLine.lineElement.isDebug = 0; } /*-----------------------------------------------------------------*/ /* newAsmop - creates a new asmOp */ /*-----------------------------------------------------------------*/ -static asmop *newAsmop (short type) +static asmop * +newAsmop (short type) { - asmop *aop; + asmop *aop; - aop = Safe_calloc(1,sizeof(asmop)); - aop->type = type; - return aop; + aop = Safe_calloc (1, sizeof (asmop)); + aop->type = type; + return aop; } /*-----------------------------------------------------------------*/ /* resolveIfx - converts an iCode ifx into a form more useful for */ /* generating code */ /*-----------------------------------------------------------------*/ -static void resolveIfx(resolvedIfx *resIfx, iCode *ifx) +static void +resolveIfx (resolvedIfx * resIfx, iCode * ifx) { FENTRY2; // DEBUGpic16_emitcode("; ***","%s %d",__FUNCTION__,__LINE__); - if(!resIfx) + if (!resIfx) return; - resIfx->condition = 1; /* assume that the ifx is true */ - resIfx->generated = 0; /* indicate that the ifx has not been used */ + resIfx->condition = 1; /* assume that the ifx is true */ + resIfx->generated = 0; /* indicate that the ifx has not been used */ - if(!ifx) { - resIfx->lbl = newiTempLabel(NULL); /* oops, there is no ifx. so create a label */ + if (!ifx) + { + resIfx->lbl = newiTempLabel (NULL); /* oops, there is no ifx. so create a label */ #if 1 - DEBUGpic16_emitcode("; ***","%s %d null ifx creating new label key =%d", - __FUNCTION__,__LINE__,resIfx->lbl->key); + DEBUGpic16_emitcode ("; ***", "%s %d null ifx creating new label key =%d", __FUNCTION__, __LINE__, resIfx->lbl->key); #endif - } else { - if(IC_TRUE(ifx)) { - resIfx->lbl = IC_TRUE(ifx); - } else { - resIfx->lbl = IC_FALSE(ifx); - resIfx->condition = 0; } + else + { + if (IC_TRUE (ifx)) + { + resIfx->lbl = IC_TRUE (ifx); + } + else + { + resIfx->lbl = IC_FALSE (ifx); + resIfx->condition = 0; + } #if 1 - if(IC_TRUE(ifx)) - DEBUGpic16_emitcode("; +++","ifx true is non-null"); - else - DEBUGpic16_emitcode("; +++","ifx true is null"); - if(IC_FALSE(ifx)) - DEBUGpic16_emitcode("; +++","ifx false is non-null"); - else - DEBUGpic16_emitcode("; +++","ifx false is null"); + if (IC_TRUE (ifx)) + DEBUGpic16_emitcode ("; +++", "ifx true is non-null"); + else + DEBUGpic16_emitcode ("; +++", "ifx true is null"); + if (IC_FALSE (ifx)) + DEBUGpic16_emitcode ("; +++", "ifx false is non-null"); + else + DEBUGpic16_emitcode ("; +++", "ifx false is null"); #endif - } + } - DEBUGpic16_emitcode("; ***","%s lbl->key=%d, (lab offset=%d)",__FUNCTION__,resIfx->lbl->key,pic16_labelOffset); + DEBUGpic16_emitcode ("; ***", "%s lbl->key=%d, (lab offset=%d)", __FUNCTION__, resIfx->lbl->key, pic16_labelOffset); } + #if 0 /*-----------------------------------------------------------------*/ /* pointerCode - returns the code for a pointer type */ /*-----------------------------------------------------------------*/ -static int pointerCode (sym_link *etype) +static int +pointerCode (sym_link * etype) { - return PTR_TYPE(SPEC_OCLS(etype)); + return PTR_TYPE (SPEC_OCLS (etype)); } #endif @@ -437,103 +431,116 @@ /*-----------------------------------------------------------------*/ /* aopForSym - for a true symbol */ /*-----------------------------------------------------------------*/ -static asmop *aopForSym (iCode *ic, operand *op, bool result) +static asmop * +aopForSym (iCode * ic, operand * op, bool result) { - symbol *sym=OP_SYMBOL(op); - asmop *aop; - memmap *space= SPEC_OCLS(sym->etype); + symbol *sym = OP_SYMBOL (op); + asmop *aop; + memmap *space = SPEC_OCLS (sym->etype); - FENTRY2; + FENTRY2; - _G.resDirect = 0; /* clear flag that instructs the result is loaded directly from aopForSym */ + _G.resDirect = 0; /* clear flag that instructs the result is loaded directly from aopForSym */ // sym = OP_SYMBOL(op); - /* if already has one */ - if (sym->aop) { - DEBUGpic16_emitcode("; ***", "already has sym %s %d", __FUNCTION__, __LINE__); - return sym->aop; + /* if already has one */ + if (sym->aop) + { + DEBUGpic16_emitcode ("; ***", "already has sym %s %d", __FUNCTION__, __LINE__); + return sym->aop; } #if 0 - /* if symbol was initially placed onStack then we must re-place it - * to direct memory, since pic16 does not have a specific stack */ - if(sym->onStack) { - fprintf(stderr, "%s:%d symbol %s on stack\n", __FILE__, __LINE__, OP_SYMBOL(op)->name); + /* if symbol was initially placed onStack then we must re-place it + * to direct memory, since pic16 does not have a specific stack */ + if (sym->onStack) + { + fprintf (stderr, "%s:%d symbol %s on stack\n", __FILE__, __LINE__, OP_SYMBOL (op)->name); } #endif #if 0 - if(sym->iaccess) { - if(space->paged) { - fprintf(stderr, "%s:%d symbol %s points to paged data\n", __FILE__, __LINE__, sym->name); + if (sym->iaccess) + { + if (space->paged) + { + fprintf (stderr, "%s:%d symbol %s points to paged data\n", __FILE__, __LINE__, sym->name); - sym->aop = aop = newAsmop (AOP_PAGED); - aop->aopu.aop_dir = sym->rname ; - aop->size = getSize(sym->type); - DEBUGpic16_emitcode(";","%d sym->rname = %s, size = %d",__LINE__,sym->rname,aop->size); - pic16_allocDirReg( IC_LEFT(ic) ); - return aop; - } - assert( 0 ); + sym->aop = aop = newAsmop (AOP_PAGED); + aop->aopu.aop_dir = sym->rname; + aop->size = getSize (sym->type); + DEBUGpic16_emitcode (";", "%d sym->rname = %s, size = %d", __LINE__, sym->rname, aop->size); + pic16_allocDirReg (IC_LEFT (ic)); + return aop; + } + assert (0); } #endif #if 1 - /* assign depending on the storage class */ - /* if it is on the stack or indirectly addressable */ - /* space we need to assign either r0 or r1 to it */ - if (sym->onStack) // || sym->iaccess) + /* assign depending on the storage class */ + /* if it is on the stack or indirectly addressable */ + /* space we need to assign either r0 or r1 to it */ + if (sym->onStack) // || sym->iaccess) { pCodeOp *pcop[4]; int i; - DEBUGpic16_emitcode("; ***", "%s:%d sym->onStack:%d || sym->iaccess:%d", - __FUNCTION__, __LINE__, sym->onStack, sym->iaccess); + DEBUGpic16_emitcode ("; ***", "%s:%d sym->onStack:%d || sym->iaccess:%d", + __FUNCTION__, __LINE__, sym->onStack, sym->iaccess); - /* acquire a temporary register -- it is saved in function */ + /* acquire a temporary register -- it is saved in function */ - sym->aop = aop = newAsmop(AOP_STA); - aop->aopu.stk.stk = sym->stack; - aop->size = getSize(sym->type); + sym->aop = aop = newAsmop (AOP_STA); + aop->aopu.stk.stk = sym->stack; + aop->size = getSize (sym->type); - DEBUGpic16_emitcode("; +++ ", "%s:%d\top = %s", __FILE__, __LINE__, pic16_decodeOp(ic->op)); - if((ic->op == '=' /*|| ic->op == CAST*/) && IC_RESULT(ic) && AOP( IC_RESULT(ic) ) - && (AOP_TYPE(IC_RESULT(ic)) == AOP_REG)) { + DEBUGpic16_emitcode ("; +++ ", "%s:%d\top = %s", __FILE__, __LINE__, pic16_decodeOp (ic->op)); + if ((ic->op == '=' /*|| ic->op == CAST */ ) && IC_RESULT (ic) && AOP (IC_RESULT (ic)) + && (AOP_TYPE (IC_RESULT (ic)) == AOP_REG)) + { // pic16_DumpAop("aopForSym", AOP( IC_RESULT(ic) )); - for(i=0;isize;i++) - aop->aopu.stk.pop[i] = pcop[i] = pic16_popRegFromIdx( AOP(IC_RESULT(ic))->aopu.aop_reg[i]->rIdx); - _G.resDirect = 1; /* notify that result will be loaded directly from aopForSym */ - } else - if(1 && ic->op == SEND) { + for (i = 0; i < aop->size; i++) + aop->aopu.stk.pop[i] = pcop[i] = pic16_popRegFromIdx (AOP (IC_RESULT (ic))->aopu.aop_reg[i]->rIdx); + _G.resDirect = 1; /* notify that result will be loaded directly from aopForSym */ + } + else if (1 && ic->op == SEND) + { /* if SEND do the send here */ _G.resDirect = 1; - } else { + } + else + { // debugf3("symbol `%s' level = %d / %d\n", sym->name, ic->level, ic->seq); - for(i=0;isize;i++) { - aop->aopu.stk.pop[i] = pcop[i] = pic16_popGetTempRegCond(_G.fregsUsed, _G.sregsAlloc, 0 ); - _G.sregsAlloc = bitVectSetBit(_G.sregsAlloc, PCOR(pcop[i])->r->rIdx); - } + for (i = 0; i < aop->size; i++) + { + aop->aopu.stk.pop[i] = pcop[i] = pic16_popGetTempRegCond (_G.fregsUsed, _G.sregsAlloc, 0); + _G.sregsAlloc = bitVectSetBit (_G.sregsAlloc, PCOR (pcop[i])->r->rIdx); + } } // fprintf(stderr, "%s:%d\t%s\tsym size %d\n", __FILE__, __LINE__, __FUNCTION__, aop->size); #if 1 - DEBUGpic16_emitcode(";","%d sym->rname = %s, size = %d stack = %d",__LINE__,sym->rname,aop->size, sym->stack); + DEBUGpic16_emitcode (";", "%d sym->rname = %s, size = %d stack = %d", __LINE__, sym->rname, aop->size, sym->stack); - // we do not need to load the value if it is to be defined... - if (result) return aop; + // we do not need to load the value if it is to be defined... + if (result) + return aop; - if(_G.accInUse) { - pic16_pushpCodeOp( pic16_popCopyReg(&pic16_pc_wreg) ); + if (_G.accInUse) + { + pic16_pushpCodeOp (pic16_popCopyReg (&pic16_pc_wreg)); } - for(i=0;isize;i++) { + for (i = 0; i < aop->size; i++) + { /* initialise for stack access via frame pointer */ // operands on stack are accessible via "{FRAME POINTER} + index" with index @@ -541,258 +548,284 @@ // local variables (index == 0 is not assigned so we add one here) { int soffs = sym->stack; - if (soffs <= 0) { - assert (soffs < 0); - soffs++; - } // if + if (soffs <= 0) + { + assert (soffs < 0); + soffs++; + } // if - if(1 && ic->op == SEND) { - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(soffs + aop->size - i - 1 /*+ _G.stack_lat*/)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg( pic16_frame_plusw ), - pic16_popCopyReg(pic16_stack_postdec ))); - } else { - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(soffs + i /*+ _G.stack_lat*/)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg( pic16_frame_plusw ), pcop[i])); - } + if (1 && ic->op == SEND) + { + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (soffs + aop->size - i - 1 /*+ _G.stack_lat */ )); + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popCopyReg (pic16_frame_plusw), + pic16_popCopyReg (pic16_stack_postdec))); + } + else + { + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (soffs + i /*+ _G.stack_lat */ )); + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popCopyReg (pic16_frame_plusw), pcop[i])); + } } } - if(_G.accInUse) { - pic16_poppCodeOp( pic16_popCopyReg(&pic16_pc_wreg) ); + if (_G.accInUse) + { + pic16_poppCodeOp (pic16_popCopyReg (&pic16_pc_wreg)); } - return (aop); + return (aop); #endif #if 0 - /* now assign the address of the variable to - the pointer register */ - if (aop->type != AOP_STK) { - - if (sym->onStack) { - if ( _G.accInUse ) - pic16_emitcode("push","acc"); - - pic16_emitcode("mov","a,_bp"); - pic16_emitcode("add","a,#0x%02x", - ((sym->stack < 0) ? - ((char)(sym->stack - _G.nRegsSaved )) : - ((char)sym->stack)) & 0xff); - pic16_emitcode("mov","%s,a", - aop->aopu.aop_ptr->name); - - if ( _G.accInUse ) - pic16_emitcode("pop","acc"); - } else - pic16_emitcode("mov","%s,#%s", - aop->aopu.aop_ptr->name, - sym->rname); - aop->paged = space->paged; - } else - aop->aopu.aop_stk = sym->stack; - return aop; + /* now assign the address of the variable to + the pointer register */ + if (aop->type != AOP_STK) + { + + if (sym->onStack) + { + if (_G.accInUse) + pic16_emitcode ("push", "acc"); + + pic16_emitcode ("mov", "a,_bp"); + pic16_emitcode ("add", "a,#0x%02x", + ((sym->stack < 0) ? ((char) (sym->stack - _G.nRegsSaved)) : ((char) sym->stack)) & 0xff); + pic16_emitcode ("mov", "%s,a", aop->aopu.aop_ptr->name); + + if (_G.accInUse) + pic16_emitcode ("pop", "acc"); + } + else + pic16_emitcode ("mov", "%s,#%s", aop->aopu.aop_ptr->name, sym->rname); + aop->paged = space->paged; + } + else + aop->aopu.aop_stk = sym->stack; + return aop; #endif } #endif #if 1 - /* special case for a function */ - if (IS_FUNC(sym->type)) { - sym->aop = aop = newAsmop(AOP_PCODE); - aop->aopu.pcop = pic16_popGetImmd(sym->rname, 0, 0); - PCOI(aop->aopu.pcop)->_const = IN_CODESPACE(space); - PCOI(aop->aopu.pcop)->index = 0; - aop->size = FPTRSIZE; - DEBUGpic16_emitcode(";","%d size = %d, name =%s",__LINE__,aop->size,sym->rname); - return aop; + /* special case for a function */ + if (IS_FUNC (sym->type)) + { + sym->aop = aop = newAsmop (AOP_PCODE); + aop->aopu.pcop = pic16_popGetImmd (sym->rname, 0, 0); + PCOI (aop->aopu.pcop)->_const = IN_CODESPACE (space); + PCOI (aop->aopu.pcop)->index = 0; + aop->size = FPTRSIZE; + DEBUGpic16_emitcode (";", "%d size = %d, name =%s", __LINE__, aop->size, sym->rname); + return aop; } #endif - //DEBUGpic16_emitcode(";","%d",__LINE__); - /* if in bit space */ - if (IN_BITSPACE(space)) { - sym->aop = aop = newAsmop (AOP_CRY); - aop->aopu.aop_dir = sym->rname ; - aop->size = getSize(sym->type); - DEBUGpic16_emitcode(";","%d sym->rname = %s, size = %d",__LINE__,sym->rname,aop->size); - return aop; + //DEBUGpic16_emitcode(";","%d",__LINE__); + /* if in bit space */ + if (IN_BITSPACE (space)) + { + sym->aop = aop = newAsmop (AOP_CRY); + aop->aopu.aop_dir = sym->rname; + aop->size = getSize (sym->type); + DEBUGpic16_emitcode (";", "%d sym->rname = %s, size = %d", __LINE__, sym->rname, aop->size); + return aop; } - /* if it is in direct space */ - if (IN_DIRSPACE(space)) { - if(!strcmp(sym->rname, "_WREG")) { - sym->aop = aop = newAsmop (AOP_ACC); - aop->size = getSize(sym->type); /* should always be 1 */ - assert(aop->size == 1); - DEBUGpic16_emitcode(";","%d sym->rname (AOP_ACC) = %s, size = %d",__LINE__,sym->rname,aop->size); - return (aop); - } else { - sym->aop = aop = newAsmop (AOP_DIR); - aop->aopu.aop_dir = sym->rname ; - aop->size = getSize(sym->type); - DEBUGpic16_emitcode(";","%d sym->rname (AOP_DIR) = %s, size = %d",__LINE__,sym->rname,aop->size); - pic16_allocDirReg( IC_LEFT(ic) ); - return (aop); - } + /* if it is in direct space */ + if (IN_DIRSPACE (space)) + { + if (!strcmp (sym->rname, "_WREG")) + { + sym->aop = aop = newAsmop (AOP_ACC); + aop->size = getSize (sym->type); /* should always be 1 */ + assert (aop->size == 1); + DEBUGpic16_emitcode (";", "%d sym->rname (AOP_ACC) = %s, size = %d", __LINE__, sym->rname, aop->size); + return (aop); + } + else + { + sym->aop = aop = newAsmop (AOP_DIR); + aop->aopu.aop_dir = sym->rname; + aop->size = getSize (sym->type); + DEBUGpic16_emitcode (";", "%d sym->rname (AOP_DIR) = %s, size = %d", __LINE__, sym->rname, aop->size); + pic16_allocDirReg (IC_LEFT (ic)); + return (aop); } + } - if (IN_FARSPACE(space) && !IN_CODESPACE(space)) { - sym->aop = aop = newAsmop (AOP_DIR); - aop->aopu.aop_dir = sym->rname ; - aop->size = getSize(sym->type); - DEBUGpic16_emitcode(";","%d sym->rname = %s, size = %d",__LINE__,sym->rname,aop->size); - pic16_allocDirReg( IC_LEFT(ic) ); - return aop; + if (IN_FARSPACE (space) && !IN_CODESPACE (space)) + { + sym->aop = aop = newAsmop (AOP_DIR); + aop->aopu.aop_dir = sym->rname; + aop->size = getSize (sym->type); + DEBUGpic16_emitcode (";", "%d sym->rname = %s, size = %d", __LINE__, sym->rname, aop->size); + pic16_allocDirReg (IC_LEFT (ic)); + return aop; } - /* only remaining is far space */ - sym->aop = aop = newAsmop(AOP_PCODE); + /* only remaining is far space */ + sym->aop = aop = newAsmop (AOP_PCODE); -/* change the next if to 1 to revert to good old immediate code */ - if(IN_CODESPACE(space)) { - aop->aopu.pcop = pic16_popGetImmd(sym->rname, 0, 0); - PCOI(aop->aopu.pcop)->_const = IN_CODESPACE(space); - PCOI(aop->aopu.pcop)->index = 0; - } else { - /* try to allocate via direct register */ - aop->aopu.pcop = pic16_popRegFromString(sym->rname, getSize(sym->type), sym->offset, op); // Patch 8 + /* change the next if to 1 to revert to good old immediate code */ + if (IN_CODESPACE (space)) + { + aop->aopu.pcop = pic16_popGetImmd (sym->rname, 0, 0); + PCOI (aop->aopu.pcop)->_const = IN_CODESPACE (space); + PCOI (aop->aopu.pcop)->index = 0; + } + else + { + /* try to allocate via direct register */ + aop->aopu.pcop = pic16_popRegFromString (sym->rname, getSize (sym->type), sym->offset, op); // Patch 8 // aop->size = getSize( sym->type ); - } + } - DEBUGpic16_emitcode(";","%d: rname %s, val %d, const = %d", - __LINE__,sym->rname, 0, PCOI(aop->aopu.pcop)->_const); + DEBUGpic16_emitcode (";", "%d: rname %s, val %d, const = %d", __LINE__, sym->rname, 0, PCOI (aop->aopu.pcop)->_const); #if 0 - if(!pic16_allocDirReg (IC_LEFT(ic))) - return NULL; + if (!pic16_allocDirReg (IC_LEFT (ic))) + return NULL; #endif - if(IN_DIRSPACE( space )) - aop->size = PTRSIZE; - else if(IN_CODESPACE( space ) || IN_FARSPACE( space )) - aop->size = FPTRSIZE; - else if(IC_LEFT(ic) && AOP(IC_LEFT(ic))) aop->size = AOP_SIZE( IC_LEFT(ic) ); - else if(IC_RIGHT(ic) && AOP(IC_RIGHT(ic))) aop->size = AOP_SIZE( IC_RIGHT(ic) ); - else if(sym->onStack) { - aop->size = PTRSIZE; - } else { - if(SPEC_SCLS(sym->etype) == S_PDATA) { - fprintf(stderr, "%s: %d symbol in PDATA space\n", __FILE__, __LINE__); - aop->size = FPTRSIZE; - } else - assert( 0 ); + if (IN_DIRSPACE (space)) + aop->size = PTRSIZE; + else if (IN_CODESPACE (space) || IN_FARSPACE (space)) + aop->size = FPTRSIZE; + else if (IC_LEFT (ic) && AOP (IC_LEFT (ic))) + aop->size = AOP_SIZE (IC_LEFT (ic)); + else if (IC_RIGHT (ic) && AOP (IC_RIGHT (ic))) + aop->size = AOP_SIZE (IC_RIGHT (ic)); + else if (sym->onStack) + { + aop->size = PTRSIZE; + } + else + { + if (SPEC_SCLS (sym->etype) == S_PDATA) + { + fprintf (stderr, "%s: %d symbol in PDATA space\n", __FILE__, __LINE__); + aop->size = FPTRSIZE; } + else + assert (0); + } - DEBUGpic16_emitcode(";","%d size = %d",__LINE__,aop->size); + DEBUGpic16_emitcode (";", "%d size = %d", __LINE__, aop->size); - /* if it is in code space */ - if (IN_CODESPACE(space)) - aop->code = 1; + /* if it is in code space */ + if (IN_CODESPACE (space)) + aop->code = 1; - return aop; + return aop; } /*-----------------------------------------------------------------*/ /* aopForRemat - rematerialzes an object */ /*-----------------------------------------------------------------*/ -static asmop *aopForRemat (operand *op, bool result) // x symbol *sym) +static asmop * +aopForRemat (operand * op, bool result) // x symbol *sym) { - symbol *sym = OP_SYMBOL(op); + symbol *sym = OP_SYMBOL (op); operand *refop; - iCode *ic = NULL, *oldic; - asmop *aop = newAsmop(AOP_PCODE); + iCode *ic = NULL; + asmop *aop = newAsmop (AOP_PCODE); int val = 0; - int offset = 0; - int viaimmd=0; + int viaimmd = 0; - FENTRY2; + FENTRY2; - ic = sym->rematiCode; + ic = sym->rematiCode; - if(IS_OP_POINTER(op)) { - DEBUGpic16_emitcode(";","%s %d IS_OP_POINTER",__FUNCTION__,__LINE__); - } + if (IS_OP_POINTER (op)) + { + DEBUGpic16_emitcode (";", "%s %d IS_OP_POINTER", __FUNCTION__, __LINE__); + } // if(!result) /* fixme-vr */ - for (;;) { - oldic = ic; - + for (;;) + { // chat *iLine = printILine(ic); // pic16_emitpcomment("ic: %s\n", iLine); // dbuf_free(iLine); - if (ic->op == '+') { - val += (int) operandLitValue(IC_RIGHT(ic)); - } else if (ic->op == '-') { - val -= (int) operandLitValue(IC_RIGHT(ic)); - } else - break; - - ic = OP_SYMBOL(IC_LEFT(ic))->rematiCode; + if (ic->op == '+') + { + val += (int) operandLitValue (IC_RIGHT (ic)); } + else if (ic->op == '-') + { + val -= (int) operandLitValue (IC_RIGHT (ic)); + } + else + break; - offset = OP_SYMBOL(IC_LEFT(ic))->offset; - refop = IC_LEFT(ic); + ic = OP_SYMBOL (IC_LEFT (ic))->rematiCode; + } + + refop = IC_LEFT (ic); - if(!op->isaddr)viaimmd++; else viaimmd=0; + if (!op->isaddr) + viaimmd++; + else + viaimmd = 0; -/* set the following if to 1 to revert to good old immediate code */ - if(IN_CODESPACE( SPEC_OCLS( OP_SYM_ETYPE(refop))) - || viaimmd) { + /* set the following if to 1 to revert to good old immediate code */ + if (IN_CODESPACE (SPEC_OCLS (OP_SYM_ETYPE (refop))) || viaimmd) + { - DEBUGpic16_emitcode(";", "%s:%d immediate, size: %d", __FILE__, __LINE__, getSize( sym->type )); + DEBUGpic16_emitcode (";", "%s:%d immediate, size: %d", __FILE__, __LINE__, getSize (sym->type)); - aop->aopu.pcop = pic16_popGetImmd(OP_SYMBOL(IC_LEFT(ic))->rname, 0, val); + aop->aopu.pcop = pic16_popGetImmd (OP_SYMBOL (IC_LEFT (ic))->rname, 0, val); #if 0 - PCOI(aop->aopu.pcop)->_const = IS_PTR_CONST(operandType(op)); + PCOI (aop->aopu.pcop)->_const = IS_PTR_CONST (operandType (op)); #else - PCOI(aop->aopu.pcop)->_const = IS_CODEPTR(operandType(op)); + PCOI (aop->aopu.pcop)->_const = IS_CODEPTR (operandType (op)); #endif - PCOI(aop->aopu.pcop)->index = val; + PCOI (aop->aopu.pcop)->index = val; - aop->size = getSize( sym->type ); - } else { - DEBUGpic16_emitcode(";", "%s:%d dir size: %d", __FILE__, __LINE__, getSize( OP_SYMBOL( IC_LEFT(ic))->type)); + aop->size = getSize (sym->type); + } + else + { + DEBUGpic16_emitcode (";", "%s:%d dir size: %d", __FILE__, __LINE__, getSize (OP_SYMBOL (IC_LEFT (ic))->type)); - aop->aopu.pcop = pic16_popRegFromString(OP_SYMBOL(IC_LEFT(ic))->rname, - getSize( OP_SYMBOL( IC_LEFT(ic))->type), val, op); + aop->aopu.pcop = pic16_popRegFromString (OP_SYMBOL (IC_LEFT (ic))->rname, + getSize (OP_SYMBOL (IC_LEFT (ic))->type), val, op); - aop->size = getSize( OP_SYMBOL( IC_LEFT(ic))->type ); - } + aop->size = getSize (OP_SYMBOL (IC_LEFT (ic))->type); + } - DEBUGpic16_emitcode(";","%d: rname %s, val %d, const = %d", - __LINE__,OP_SYMBOL(IC_LEFT(ic))->rname, + DEBUGpic16_emitcode (";", "%d: rname %s, val %d, const = %d", __LINE__, OP_SYMBOL (IC_LEFT (ic))->rname, #if 0 - val, IS_PTR_CONST(operandType(op))); + val, IS_PTR_CONST (operandType (op))); #else - val, IS_CODEPTR(operandType(op))); + val, IS_CODEPTR (operandType (op))); #endif // DEBUGpic16_emitcode(";","aop type %s",pic16_AopType(AOP_TYPE(IC_LEFT(ic)))); - pic16_allocDirReg (IC_LEFT(ic)); + pic16_allocDirReg (IC_LEFT (ic)); - if(IN_CODESPACE( SPEC_OCLS( OP_SYM_ETYPE(op)) )) - aop->code = 1; + if (IN_CODESPACE (SPEC_OCLS (OP_SYM_ETYPE (op)))) + aop->code = 1; return aop; } #if 0 -static int aopIdx (asmop *aop, int offset) +static int +aopIdx (asmop * aop, int offset) { - if(!aop) + if (!aop) return -1; - if(aop->type != AOP_REG) + if (aop->type != AOP_REG) return -2; return aop->aopu.aop_reg[offset]->rIdx; @@ -803,128 +836,129 @@ /*-----------------------------------------------------------------*/ /* regsInCommon - two operands have some registers in common */ /*-----------------------------------------------------------------*/ -static bool regsInCommon (operand *op1, operand *op2) +static bool +regsInCommon (operand * op1, operand * op2) { - symbol *sym1, *sym2; - int i; + symbol *sym1, *sym2; + int i; - /* if they have registers in common */ - if (!IS_SYMOP(op1) || !IS_SYMOP(op2)) - return FALSE ; + /* if they have registers in common */ + if (!IS_SYMOP (op1) || !IS_SYMOP (op2)) + return FALSE; - sym1 = OP_SYMBOL(op1); - sym2 = OP_SYMBOL(op2); + sym1 = OP_SYMBOL (op1); + sym2 = OP_SYMBOL (op2); - if (sym1->nRegs == 0 || sym2->nRegs == 0) - return FALSE ; + if (sym1->nRegs == 0 || sym2->nRegs == 0) + return FALSE; - for (i = 0 ; i < sym1->nRegs ; i++) { - int j; - if (!sym1->regs[i]) - continue ; + for (i = 0; i < sym1->nRegs; i++) + { + int j; + if (!sym1->regs[i]) + continue; - for (j = 0 ; j < sym2->nRegs ;j++ ) { - if (!sym2->regs[j]) - continue ; + for (j = 0; j < sym2->nRegs; j++) + { + if (!sym2->regs[j]) + continue; - if (sym2->regs[j] == sym1->regs[i]) - return TRUE ; + if (sym2->regs[j] == sym1->regs[i]) + return TRUE; } } - return FALSE ; + return FALSE; } /*-----------------------------------------------------------------*/ /* operandsEqu - equivalent */ /*-----------------------------------------------------------------*/ -static bool operandsEqu ( operand *op1, operand *op2) +static bool +operandsEqu (operand * op1, operand * op2) { - symbol *sym1, *sym2; + symbol *sym1, *sym2; - /* if they not symbols */ - if (!IS_SYMOP(op1) || !IS_SYMOP(op2)) - return FALSE; + /* if they not symbols */ + if (!IS_SYMOP (op1) || !IS_SYMOP (op2)) + return FALSE; - sym1 = OP_SYMBOL(op1); - sym2 = OP_SYMBOL(op2); + sym1 = OP_SYMBOL (op1); + sym2 = OP_SYMBOL (op2); - /* if both are itemps & one is spilt - and the other is not then false */ - if (IS_ITEMP(op1) && IS_ITEMP(op2) && - sym1->isspilt != sym2->isspilt ) - return FALSE ; - - /* if they are the same */ - if (sym1 == sym2) - return TRUE ; + /* if both are itemps & one is spilt + and the other is not then false */ + if (IS_ITEMP (op1) && IS_ITEMP (op2) && sym1->isspilt != sym2->isspilt) + return FALSE; - if (sym1->rname[0] && sym2->rname[0] - && strcmp (sym1->rname, sym2->rname) == 0) - return TRUE; + /* if they are the same */ + if (sym1 == sym2) + return TRUE; + if (sym1->rname[0] && sym2->rname[0] && strcmp (sym1->rname, sym2->rname) == 0) + return TRUE; - /* if left is a tmp & right is not */ - if (IS_ITEMP(op1) && - !IS_ITEMP(op2) && - sym1->isspilt && - (SYM_SPIL_LOC(sym1) == sym2)) - return TRUE; - if (IS_ITEMP(op2) && - !IS_ITEMP(op1) && - sym2->isspilt && - sym1->level > 0 && - (SYM_SPIL_LOC(sym2) == sym1)) - return TRUE ; + /* if left is a tmp & right is not */ + if (IS_ITEMP (op1) && !IS_ITEMP (op2) && sym1->isspilt && (SYM_SPIL_LOC (sym1) == sym2)) + return TRUE; - return FALSE ; + if (IS_ITEMP (op2) && !IS_ITEMP (op1) && sym2->isspilt && sym1->level > 0 && (SYM_SPIL_LOC (sym2) == sym1)) + return TRUE; + + return FALSE; } /*-----------------------------------------------------------------*/ /* pic16_sameRegs - two asmops have the same registers */ /*-----------------------------------------------------------------*/ -bool pic16_sameRegs (asmop *aop1, asmop *aop2 ) +bool +pic16_sameRegs (asmop * aop1, asmop * aop2) { - int i; + int i; - if (aop1 == aop2) - return TRUE ; + if (aop1 == aop2) + return TRUE; - DEBUGpic16_emitcode(";***", "%s aop1->type = %s\taop2->type = %s\n", __FUNCTION__, - pic16_AopType(aop1->type), pic16_AopType(aop2->type)); + DEBUGpic16_emitcode (";***", "%s aop1->type = %s\taop2->type = %s\n", __FUNCTION__, + pic16_AopType (aop1->type), pic16_AopType (aop2->type)); - if(aop1->type == AOP_ACC && aop2->type == AOP_ACC)return TRUE; + if (aop1->type == AOP_ACC && aop2->type == AOP_ACC) + return TRUE; - if (aop1->type != AOP_REG || - aop2->type != AOP_REG ) - return FALSE ; + if (aop1->type != AOP_REG || aop2->type != AOP_REG) + return FALSE; - /* This is a bit too restrictive if one is a subset of the other... - if (aop1->size != aop2->size ) - return FALSE ; - */ + /* This is a bit too restrictive if one is a subset of the other... + if (aop1->size != aop2->size ) + return FALSE ; + */ - for (i = 0 ; i < min(aop1->size, aop2->size) ; i++ ) { + for (i = 0; i < min (aop1->size, aop2->size); i++) + { // if(aop1->aopu.aop_reg[i]->type != aop2->aopu.aop_reg[i]->type)return FALSE; // if(aop1->aopu.aop_reg[i]->type == AOP_REG) - if (strcmp(aop1->aopu.aop_reg[i]->name, aop2->aopu.aop_reg[i]->name )) - return FALSE ; + if (strcmp (aop1->aopu.aop_reg[i]->name, aop2->aopu.aop_reg[i]->name)) + return FALSE; } - return TRUE ; + return TRUE; } -bool pic16_sameRegsOfs(asmop *aop1, asmop *aop2, int offset) +bool +pic16_sameRegsOfs (asmop * aop1, asmop * aop2, int offset) { - DEBUGpic16_emitcode(";***", "%s aop1->type = %s\taop2->type = %s (offset = %d)\n", __FUNCTION__, - pic16_AopType(aop1->type), pic16_AopType(aop2->type), offset); + DEBUGpic16_emitcode (";***", "%s aop1->type = %s\taop2->type = %s (offset = %d)\n", __FUNCTION__, + pic16_AopType (aop1->type), pic16_AopType (aop2->type), offset); - if(aop1 == aop2)return TRUE; - if(aop1->type != AOP_REG || aop2->type != AOP_REG)return FALSE; + if (aop1 == aop2) + return TRUE; + if (aop1->type != AOP_REG || aop2->type != AOP_REG) + return FALSE; - if(strcmp(aop1->aopu.aop_reg[offset]->name, aop2->aopu.aop_reg[offset]->name))return FALSE; + if (strcmp (aop1->aopu.aop_reg[offset]->name, aop2->aopu.aop_reg[offset]->name)) + return FALSE; return TRUE; } @@ -933,308 +967,340 @@ /*-----------------------------------------------------------------*/ /* pic16_aopOp - allocates an asmop for an operand : */ /*-----------------------------------------------------------------*/ -void pic16_aopOp (operand *op, iCode *ic, bool result) +void +pic16_aopOp (operand * op, iCode * ic, bool result) { - asmop *aop; - symbol *sym; - int i; + asmop *aop; + symbol *sym; + int i; - if (!op) - return ; + if (!op) + return; - DEBUGpic16_emitcode(";","%s %d",__FUNCTION__, __LINE__); + DEBUGpic16_emitcode (";", "%s %d", __FUNCTION__, __LINE__); - /* if this a literal */ - if (IS_OP_LITERAL(op)) { - op->aop = aop = newAsmop(AOP_LIT); - aop->aopu.aop_lit = OP_VALUE (op); - aop->size = getSize(operandType(op)); - return; + /* if this a literal */ + if (IS_OP_LITERAL (op)) + { + op->aop = aop = newAsmop (AOP_LIT); + aop->aopu.aop_lit = OP_VALUE (op); + aop->size = getSize (operandType (op)); + return; } - { - sym_link *type = operandType(op); + { + sym_link *type = operandType (op); #if 0 - if(IS_PTR_CONST(type)) + if (IS_PTR_CONST (type)) #else - if(IS_CODEPTR(type)) + if (IS_CODEPTR (type)) #endif - DEBUGpic16_emitcode(";","%d aop type is const pointer",__LINE__); - } + DEBUGpic16_emitcode (";", "%d aop type is const pointer", __LINE__); + } - /* if already has a asmop then continue */ - if (op->aop) - return ; + /* if already has a asmop then continue */ + if (op->aop) + return; - /* if the underlying symbol has a aop */ - if (IS_SYMOP(op) && OP_SYMBOL(op)->aop) { - DEBUGpic16_emitcode(";","%d has symbol",__LINE__); - op->aop = OP_SYMBOL(op)->aop; - return; + /* if the underlying symbol has a aop */ + if (IS_SYMOP (op) && OP_SYMBOL (op)->aop) + { + DEBUGpic16_emitcode (";", "%d has symbol", __LINE__); + op->aop = OP_SYMBOL (op)->aop; + return; } - /* if this is a true symbol */ - if (IS_TRUE_SYMOP(op)) { - DEBUGpic16_emitcode(";","%d - true symop",__LINE__); - op->aop = aopForSym(ic, op, result); - return ; - } - - /* this is a temporary : this has - only four choices : - a) register - b) spillocation - c) rematerialize - d) conditional - e) can be a return use only */ - - sym = OP_SYMBOL(op); - - DEBUGpic16_emitcode("; ***", "%d: symbol name = %s, regType = %d", __LINE__, sym->name, sym->regType); - /* if the type is a conditional */ - if (sym->regType == REG_CND) { - aop = op->aop = sym->aop = newAsmop(AOP_CRY); - aop->size = 0; - return; + /* if this is a true symbol */ + if (IS_TRUE_SYMOP (op)) + { + DEBUGpic16_emitcode (";", "%d - true symop", __LINE__); + op->aop = aopForSym (ic, op, result); + return; + } + + /* this is a temporary : this has + only four choices : + a) register + b) spillocation + c) rematerialize + d) conditional + e) can be a return use only */ + + sym = OP_SYMBOL (op); + + DEBUGpic16_emitcode ("; ***", "%d: symbol name = %s, regType = %d", __LINE__, sym->name, sym->regType); + /* if the type is a conditional */ + if (sym->regType == REG_CND) + { + aop = op->aop = sym->aop = newAsmop (AOP_CRY); + aop->size = 0; + return; } - /* if it is spilt then two situations - a) is rematerialize - b) has a spill location */ - if (sym->isspilt || sym->nRegs == 0) { + /* if it is spilt then two situations + a) is rematerialize + b) has a spill location */ + if (sym->isspilt || sym->nRegs == 0) + { // debugf3("symbol %s\tisspilt: %d\tnRegs: %d\n", sym->rname, sym->isspilt, sym->nRegs); - DEBUGpic16_emitcode(";","%d",__LINE__); - /* rematerialize it NOW */ - if (sym->remat) { + DEBUGpic16_emitcode (";", "%d", __LINE__); + /* rematerialize it NOW */ + if (sym->remat) + { - sym->aop = op->aop = aop = aopForRemat (op, result); - return; + sym->aop = op->aop = aop = aopForRemat (op, result); + return; } #if 1 - if (sym->accuse) { - int i; - aop = op->aop = sym->aop = newAsmop(AOP_ACC); - aop->size = getSize(sym->type); - for ( i = 0 ; i < 1 ; i++ ) { - aop->aopu.aop_str[i] = accUse[i]; + if (sym->accuse) + { + int i; + aop = op->aop = sym->aop = newAsmop (AOP_ACC); + aop->size = getSize (sym->type); + for (i = 0; i < 1; i++) + { + aop->aopu.aop_str[i] = accUse[i]; // aop->aopu.pcop = pic16_popRegFromString("WREG", aop->size, SYM_SPIL_LOC(sym)->offset); } - fprintf(stderr, "%s:%d allocating AOP_ACC for sym= %s\n", __FILE__, __LINE__, sym->name); - DEBUGpic16_emitcode(";","%d size=%d",__LINE__,aop->size); - return; + fprintf (stderr, "%s:%d allocating AOP_ACC for sym= %s\n", __FILE__, __LINE__, sym->name); + DEBUGpic16_emitcode (";", "%d size=%d", __LINE__, aop->size); + return; } #endif #if 1 - if (sym->ruonly) { + if (sym->ruonly) + { /* - sym->aop = op->aop = aop = newAsmop(AOP_PCODE); - aop->aopu.pcop = pic16_popGetImmd(SYM_SPIL_LOC(sym)->rname,0,SYM_SPIL_LOC(sym)->offset); - //pic16_allocDirReg (IC_LEFT(ic)); - aop->size = getSize(sym->type); - */ + sym->aop = op->aop = aop = newAsmop(AOP_PCODE); + aop->aopu.pcop = pic16_popGetImmd(SYM_SPIL_LOC(sym)->rname,0,SYM_SPIL_LOC(sym)->offset); + //pic16_allocDirReg (IC_LEFT(ic)); + aop->size = getSize(sym->type); + */ unsigned i; - aop = op->aop = sym->aop = newAsmop(AOP_REG); - aop->size = getSize(sym->type); - for ( i = 0 ; i < pic16_fReturnSizePic ; i++ ) - aop->aopu.aop_reg[i] = PCOR(pic16_popRegFromIdx( fReturnIdx[i] ))->r; + aop = op->aop = sym->aop = newAsmop (AOP_REG); + aop->size = getSize (sym->type); + for (i = 0; i < pic16_fReturnSizePic; i++) + aop->aopu.aop_reg[i] = PCOR (pic16_popRegFromIdx (fReturnIdx[i]))->r; - DEBUGpic16_emitcode(";","%d",__LINE__); + DEBUGpic16_emitcode (";", "%d", __LINE__); return; } #endif - /* else spill location */ - if (SYM_SPIL_LOC(sym) && getSize(sym->type) != getSize(SYM_SPIL_LOC(sym)->type)) { - /* force a new aop if sizes differ */ - SYM_SPIL_LOC(sym)->aop = NULL; + /* else spill location */ + if (SYM_SPIL_LOC (sym) && getSize (sym->type) != getSize (SYM_SPIL_LOC (sym)->type)) + { + /* force a new aop if sizes differ */ + SYM_SPIL_LOC (sym)->aop = NULL; } #if 0 - DEBUGpic16_emitcode(";","%s %d %s sym->rname = %s, offset %d", - __FUNCTION__,__LINE__, - SYM_SPIL_LOC(sym)->rname, - sym->rname, SYM_SPIL_LOC(sym)->offset); -#endif - - //aop->aopu.pcop = pic16_popGetImmd(SYM_SPIL_LOC(sym)->rname,0,SYM_SPIL_LOC(sym)->offset); - if (SYM_SPIL_LOC(sym) && SYM_SPIL_LOC(sym)->rname) { - sym->aop = op->aop = aop = newAsmop(AOP_PCODE); - aop->aopu.pcop = pic16_popRegFromString(SYM_SPIL_LOC(sym)->rname, - getSize(sym->type), - SYM_SPIL_LOC(sym)->offset, op); - } else if (getSize(sym->type) <= 1) { + DEBUGpic16_emitcode (";", "%s %d %s sym->rname = %s, offset %d", + __FUNCTION__, __LINE__, SYM_SPIL_LOC (sym)->rname, sym->rname, SYM_SPIL_LOC (sym)->offset); +#endif + + //aop->aopu.pcop = pic16_popGetImmd(SYM_SPIL_LOC(sym)->rname,0,SYM_SPIL_LOC(sym)->offset); + if (SYM_SPIL_LOC (sym) && SYM_SPIL_LOC (sym)->rname) + { + sym->aop = op->aop = aop = newAsmop (AOP_PCODE); + aop->aopu.pcop = pic16_popRegFromString (SYM_SPIL_LOC (sym)->rname, + getSize (sym->type), SYM_SPIL_LOC (sym)->offset, op); + } + else if (getSize (sym->type) <= 1) + { //fprintf (stderr, "%s:%d called for a spillLocation -- assigning WREG instead --- CHECK (size:%u)!\n", __FUNCTION__, __LINE__, getSize(sym->type)); - pic16_emitpcomment (";!!! %s:%d called for a spillLocation -- assigning WREG instead --- CHECK", __FUNCTION__, __LINE__); - assert (getSize(sym->type) <= 1); - sym->aop = op->aop = aop = newAsmop(AOP_PCODE); + pic16_emitpcomment (";!!! %s:%d called for a spillLocation -- assigning WREG instead --- CHECK", __FUNCTION__, + __LINE__); + assert (getSize (sym->type) <= 1); + sym->aop = op->aop = aop = newAsmop (AOP_PCODE); aop->aopu.pcop = pic16_popCopyReg (&pic16_pc_wreg); - } else { + } + else + { /* We need some kind of dummy area for getSize(sym->type) byte, * use WREG for all storage locations. * XXX: This only works if we are implementing a `dummy read', * the stored value will not be retrievable... * See #1503234 for a case requiring this. */ - sym->aop = op->aop = aop = newAsmop(AOP_REG); - aop->size = getSize(sym->type); - for ( i = 0 ; i < aop->size ;i++) + sym->aop = op->aop = aop = newAsmop (AOP_REG); + aop->size = getSize (sym->type); + for (i = 0; i < aop->size; i++) aop->aopu.aop_reg[i] = pic16_pc_wreg.r; } - aop->size = getSize(sym->type); + aop->size = getSize (sym->type); - return; + return; } - { - sym_link *type = operandType(op); + { + sym_link *type = operandType (op); #if 0 - if(IS_PTR_CONST(type)) + if (IS_PTR_CONST (type)) #else - if(IS_CODEPTR(type)) + if (IS_CODEPTR (type)) #endif - DEBUGpic16_emitcode(";","%d aop type is const pointer",__LINE__); - } + DEBUGpic16_emitcode (";", "%d aop type is const pointer", __LINE__); + } - /* must be in a register */ - DEBUGpic16_emitcode(";","%d register type nRegs=%d",__LINE__,sym->nRegs); - sym->aop = op->aop = aop = newAsmop(AOP_REG); - aop->size = sym->nRegs; - for ( i = 0 ; i < sym->nRegs ;i++) - aop->aopu.aop_reg[i] = sym->regs[i]; + /* must be in a register */ + DEBUGpic16_emitcode (";", "%d register type nRegs=%d", __LINE__, sym->nRegs); + sym->aop = op->aop = aop = newAsmop (AOP_REG); + aop->size = sym->nRegs; + for (i = 0; i < sym->nRegs; i++) + aop->aopu.aop_reg[i] = sym->regs[i]; } /*-----------------------------------------------------------------*/ /* pic16_freeAsmop - free up the asmop given to an operand */ /*----------------------------------------------------------------*/ -void pic16_freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop) +void +pic16_freeAsmop (operand * op, asmop * aaop, iCode * ic, bool pop) { - asmop *aop ; + asmop *aop; - if (!op) - aop = aaop; - else - aop = op->aop; + if (!op) + aop = aaop; + else + aop = op->aop; - if (!aop) - return ; + if (!aop) + return; - if (aop->freed) - goto dealloc; + if (aop->freed) + goto dealloc; - aop->freed = 1; + aop->freed = 1; #if 1 - switch (aop->type) { - case AOP_STA: - { - int i; + switch (aop->type) + { + case AOP_STA: + { + int i; - /* we must store the result on stack */ - if((op == IC_RESULT(ic)) && RESULTONSTA(ic)) { - // operands on stack are accessible via "FSR2 + index" with index - // starting at 2 for arguments and growing from 0 downwards for - // local variables (index == 0 is not assigned so we add one here) - int soffs = OP_SYMBOL(IC_RESULT(ic))->stack; - if (soffs <= 0) { - assert (soffs < 0); - soffs++; - } // if - if(_G.accInUse)pic16_pushpCodeOp( pic16_popCopyReg(&pic16_pc_wreg) ); - for(i=0;isize;i++) { - /* initialise for stack access via frame pointer */ - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(soffs + i /*+ _G.stack_lat*/)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - aop->aopu.stk.pop[i], pic16_popCopyReg(pic16_frame_plusw))); - } + /* we must store the result on stack */ + if ((op == IC_RESULT (ic)) && RESULTONSTA (ic)) + { + // operands on stack are accessible via "FSR2 + index" with index + // starting at 2 for arguments and growing from 0 downwards for + // local variables (index == 0 is not assigned so we add one here) + int soffs = OP_SYMBOL (IC_RESULT (ic))->stack; + if (soffs <= 0) + { + assert (soffs < 0); + soffs++; + } // if + if (_G.accInUse) + pic16_pushpCodeOp (pic16_popCopyReg (&pic16_pc_wreg)); + for (i = 0; i < aop->size; i++) + { + /* initialise for stack access via frame pointer */ + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (soffs + i /*+ _G.stack_lat */ )); + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (aop->aopu.stk.pop[i], pic16_popCopyReg (pic16_frame_plusw))); + } - if(_G.accInUse)pic16_poppCodeOp( pic16_popCopyReg(&pic16_pc_wreg) ); - } + if (_G.accInUse) + pic16_poppCodeOp (pic16_popCopyReg (&pic16_pc_wreg)); + } - if(!_G.resDirect) { - for(i=0;isize;i++) { - PCOR(aop->aopu.stk.pop[i] )->r->isFree = 1; + if (!_G.resDirect) + { + for (i = 0; i < aop->size; i++) + { + PCOR (aop->aopu.stk.pop[i])->r->isFree = 1; - if(bitVectBitValue(_G.sregsAlloc, PCOR(aop->aopu.stk.pop[i])->r->rIdx)) { - bitVectUnSetBit(_G.sregsAlloc, PCOR(aop->aopu.stk.pop[i])->r->rIdx); + if (bitVectBitValue (_G.sregsAlloc, PCOR (aop->aopu.stk.pop[i])->r->rIdx)) + { + bitVectUnSetBit (_G.sregsAlloc, PCOR (aop->aopu.stk.pop[i])->r->rIdx); // pic16_popReleaseTempReg(aop->aopu.stk.pop[i], 0); - } - } - - if (_G.sregsAllocSet) { - reg_info *sr; - - _G.sregsAllocSet = reverseSet( _G.sregsAllocSet ); - for(sr=setFirstItem(_G.sregsAllocSet) ; sr; sr=setFirstItem(_G.sregsAllocSet)) { - pic16_poppCodeOp( pic16_popRegFromIdx( sr->rIdx ) ); - deleteSetItem( &_G.sregsAllocSet, sr ); - } } - } - _G.resDirect = 0; - } - break; -#if 0 - case AOP_STK : - { - int sz = aop->size; - int stk = aop->aopu.aop_stk + aop->size; - bitVectUnSetBit(ic->rUsed,R0_IDX); - bitVectUnSetBit(ic->rUsed,R1_IDX); - - getFreePtr(ic,&aop,FALSE); + } - if (options.stack10bit) + if (_G.sregsAllocSet) { - /* I'm not sure what to do here yet... */ - /* #STUB */ - fprintf(stderr, - "*** Warning: probably generating bad code for " - "10 bit stack mode.\n"); - } + reg_info *sr; - if (stk) { - pic16_emitcode ("mov","a,_bp"); - pic16_emitcode ("add","a,#0x%02x",((char)stk) & 0xff); - pic16_emitcode ("mov","%s,a",aop->aopu.aop_ptr->name); - } else { - pic16_emitcode ("mov","%s,_bp",aop->aopu.aop_ptr->name); + _G.sregsAllocSet = reverseSet (_G.sregsAllocSet); + for (sr = setFirstItem (_G.sregsAllocSet); sr; sr = setFirstItem (_G.sregsAllocSet)) + { + pic16_poppCodeOp (pic16_popRegFromIdx (sr->rIdx)); + deleteSetItem (&_G.sregsAllocSet, sr); + } } + } + _G.resDirect = 0; + } + break; +#if 0 + case AOP_STK: + { + int sz = aop->size; + int stk = aop->aopu.aop_stk + aop->size; + bitVectUnSetBit (ic->rUsed, R0_IDX); + bitVectUnSetBit (ic->rUsed, R1_IDX); - while (sz--) { - pic16_emitcode("pop","acc"); - pic16_emitcode("mov","@%s,a",aop->aopu.aop_ptr->name); - if (!sz) break; - pic16_emitcode("dec","%s",aop->aopu.aop_ptr->name); - } - op->aop = aop; - pic16_freeAsmop(op,NULL,ic,TRUE); - if (_G.r0Pushed) { - pic16_emitcode("pop","ar0"); - _G.r0Pushed--; - } + getFreePtr (ic, &aop, FALSE); - if (_G.r1Pushed) { - pic16_emitcode("pop","ar1"); - _G.r1Pushed--; - } + if (options.stack10bit) + { + /* I'm not sure what to do here yet... */ + /* #STUB */ + fprintf (stderr, "*** Warning: probably generating bad code for " "10 bit stack mode.\n"); } -#endif + + if (stk) + { + pic16_emitcode ("mov", "a,_bp"); + pic16_emitcode ("add", "a,#0x%02x", ((char) stk) & 0xff); + pic16_emitcode ("mov", "%s,a", aop->aopu.aop_ptr->name); + } + else + { + pic16_emitcode ("mov", "%s,_bp", aop->aopu.aop_ptr->name); + } + + while (sz--) + { + pic16_emitcode ("pop", "acc"); + pic16_emitcode ("mov", "@%s,a", aop->aopu.aop_ptr->name); + if (!sz) + break; + pic16_emitcode ("dec", "%s", aop->aopu.aop_ptr->name); + } + op->aop = aop; + pic16_freeAsmop (op, NULL, ic, TRUE); + if (_G.r0Pushed) + { + pic16_emitcode ("pop", "ar0"); + _G.r0Pushed--; + } + + if (_G.r1Pushed) + { + pic16_emitcode ("pop", "ar1"); + _G.r1Pushed--; + } + } +#endif } #endif dealloc: - /* all other cases just dealloc */ - if (op ) { - op->aop = NULL; - if (IS_SYMOP(op)) { - OP_SYMBOL(op)->aop = NULL; - /* if the symbol has a spill */ - if (SPIL_LOC(op)) - SPIL_LOC(op)->aop = NULL; + /* all other cases just dealloc */ + if (op) + { + op->aop = NULL; + if (IS_SYMOP (op)) + { + OP_SYMBOL (op)->aop = NULL; + /* if the symbol has a spill */ + if (SPIL_LOC (op)) + SPIL_LOC (op)->aop = NULL; } } } @@ -1242,31 +1308,32 @@ /*-----------------------------------------------------------------*/ /* pic16_aopGet - for fetching value of the aop */ /*-----------------------------------------------------------------*/ -char *pic16_aopGet (asmop *aop, int offset, bool bit16, bool dname) +char * +pic16_aopGet (asmop * aop, int offset, bool bit16, bool dname) { - char *s = buffer ; - char *rs; + char *s = buffer; + char *rs; - //DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + //DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* offset is greater than size then zero */ - if (offset > (aop->size - 1) && - aop->type != AOP_LIT) - return zero; + /* offset is greater than size then zero */ + if (offset > (aop->size - 1) && aop->type != AOP_LIT) + return zero; - /* depending on type */ - switch (aop->type) { + /* depending on type */ + switch (aop->type) + { case AOP_DIR: - if (offset) { - sprintf(s,"(%s + %d)", - aop->aopu.aop_dir, - offset); - DEBUGpic16_emitcode(";","oops AOP_DIR did this %s\n",s); - } else - sprintf(s,"%s",aop->aopu.aop_dir); - rs = Safe_calloc(1,strlen(s)+1); - strcpy(rs,s); - return rs; + if (offset) + { + sprintf (s, "(%s + %d)", aop->aopu.aop_dir, offset); + DEBUGpic16_emitcode (";", "oops AOP_DIR did this %s\n", s); + } + else + sprintf (s, "%s", aop->aopu.aop_dir); + rs = Safe_calloc (1, strlen (s) + 1); + strcpy (rs, s); + return rs; case AOP_REG: return aop->aopu.aop_reg[offset]->name; @@ -1275,82 +1342,87 @@ return aop->aopu.aop_dir; case AOP_ACC: - DEBUGpic16_emitcode(";Warning -pic port ignoring get(AOP_ACC)","%d\toffset: %d",__LINE__, offset); + DEBUGpic16_emitcode (";Warning -pic port ignoring get(AOP_ACC)", "%d\toffset: %d", __LINE__, offset); // fprintf(stderr, "%s:%d Warning -pic port ignoring get(AOP_ACC)\n",__FILE__, __LINE__); // assert( 0 ); // return aop->aopu.aop_str[offset]; //->"AOP_accumulator_bug"; - rs = Safe_strdup("WREG"); - return (rs); + rs = Safe_strdup ("WREG"); + return (rs); case AOP_LIT: - sprintf(s,"0x%02x", pic16aopLiteral (aop->aopu.aop_lit,offset)); - rs = Safe_calloc(1,strlen(s)+1); - strcpy(rs,s); - return rs; + sprintf (s, "0x%02x", pic16aopLiteral (aop->aopu.aop_lit, offset)); + rs = Safe_calloc (1, strlen (s) + 1); + strcpy (rs, s); + return rs; case AOP_STR: - aop->coff = offset ; + aop->coff = offset; // if (strcmp(aop->aopu.aop_str[offset],"a") == 0 && // dname) // return "acc"; - if(!strcmp(aop->aopu.aop_str[offset], "WREG")) { + if (!strcmp (aop->aopu.aop_str[offset], "WREG")) + { aop->type = AOP_ACC; - return Safe_strdup("_WREG"); + return Safe_strdup ("_WREG"); } - DEBUGpic16_emitcode(";","%d - %s",__LINE__, aop->aopu.aop_str[offset]); + DEBUGpic16_emitcode (";", "%d - %s", __LINE__, aop->aopu.aop_str[offset]); - return aop->aopu.aop_str[offset]; + return aop->aopu.aop_str[offset]; case AOP_PCODE: - { - pCodeOp *pcop = aop->aopu.pcop; - DEBUGpic16_emitcode(";","%d: pic16_aopGet AOP_PCODE type %s",__LINE__,pic16_pCodeOpType(pcop)); - if(pcop->name) { - DEBUGpic16_emitcode(";","%s offset %d",pcop->name,PCOI(pcop)->offset); + { + pCodeOp *pcop = aop->aopu.pcop; + DEBUGpic16_emitcode (";", "%d: pic16_aopGet AOP_PCODE type %s", __LINE__, pic16_pCodeOpType (pcop)); + if (pcop->name) + { + DEBUGpic16_emitcode (";", "%s offset %d", pcop->name, PCOI (pcop)->offset); //sprintf(s,"(%s+0x%02x)", pcop->name,PCOI(aop->aopu.pcop)->offset); - if (offset) { - sprintf(s,"(%s + %d)", pic16_get_op (pcop, NULL, 0), offset); - } else { - sprintf(s,"%s", pic16_get_op (pcop, NULL, 0)); - } - } else - sprintf(s,"0x%02x", PCOI(aop->aopu.pcop)->offset); + if (offset) + { + sprintf (s, "(%s + %d)", pic16_get_op (pcop, NULL, 0), offset); + } + else + { + sprintf (s, "%s", pic16_get_op (pcop, NULL, 0)); + } + } + else + sprintf (s, "0x%02x", PCOI (aop->aopu.pcop)->offset); - } - rs = Safe_calloc(1,strlen(s)+1); - strcpy(rs,s); - return rs; + } + rs = Safe_calloc (1, strlen (s) + 1); + strcpy (rs, s); + return rs; #if 0 case AOP_PAGED: - DEBUGpic16_emitcode(";","oops AOP_PAGED did this %s\n",s); - if (offset) { - sprintf(s,"(%s + %d)", - aop->aopu.aop_dir, - offset); - } else - sprintf(s,"%s",aop->aopu.aop_dir); - DEBUGpic16_emitcode(";","oops AOP_PAGED did this %s\n",s); - rs = Safe_calloc(1,strlen(s)+1); - strcpy(rs,s); + DEBUGpic16_emitcode (";", "oops AOP_PAGED did this %s\n", s); + if (offset) + { + sprintf (s, "(%s + %d)", aop->aopu.aop_dir, offset); + } + else + sprintf (s, "%s", aop->aopu.aop_dir); + DEBUGpic16_emitcode (";", "oops AOP_PAGED did this %s\n", s); + rs = Safe_calloc (1, strlen (s) + 1); + strcpy (rs, s); return rs; #endif case AOP_STA: - rs = Safe_strdup(PCOR(aop->aopu.stk.pop[offset])->r->name); - return (rs); + rs = Safe_strdup (PCOR (aop->aopu.stk.pop[offset])->r->name); + return (rs); case AOP_STK: // pCodeOp *pcop = aop->aop - break; + break; } - fprintf(stderr, "%s:%d unsupported aop->type: %s\n", __FILE__, __LINE__, pic16_AopType(aop->type)); - werror(E_INTERNAL_ERROR,__FILE__,__LINE__, - "aopget got unsupported aop->type"); - exit(0); + fprintf (stderr, "%s:%d unsupported aop->type: %s\n", __FILE__, __LINE__, pic16_AopType (aop->type)); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "aopget got unsupported aop->type"); + exit (0); } @@ -1371,31 +1443,34 @@ /*-----------------------------------------------------------------*/ /* pic16_popGetTempReg - create a new temporary pCodeOp */ /*-----------------------------------------------------------------*/ -pCodeOp *pic16_popGetTempReg(int lock) +pCodeOp * +pic16_popGetTempReg (int lock) { - pCodeOp *pcop=NULL; + pCodeOp *pcop = NULL; symbol *cfunc; // DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if(_TempReg_lock) { + if (_TempReg_lock) + { // werror(W_POSSBUG2, __FILE__, __LINE__); } - _TempReg_lock += lock; + _TempReg_lock += lock; - cfunc = currFunc; - currFunc = NULL; + cfunc = currFunc; + currFunc = NULL; - pcop = pic16_newpCodeOp(NULL, PO_GPR_TEMP); - if(pcop && pcop->type == PO_GPR_TEMP && PCOR(pcop)->r) { - PCOR(pcop)->r->wasUsed=1; - PCOR(pcop)->r->isFree=0; + pcop = pic16_newpCodeOp (NULL, PO_GPR_TEMP); + if (pcop && pcop->type == PO_GPR_TEMP && PCOR (pcop)->r) + { + PCOR (pcop)->r->wasUsed = 1; + PCOR (pcop)->r->isFree = 0; /* push value on stack */ - pic16_pushpCodeOp( pic16_pCodeOpCopy(pcop) ); + pic16_pushpCodeOp (pic16_pCodeOpCopy (pcop)); } - currFunc = cfunc; + currFunc = cfunc; return pcop; } @@ -1405,78 +1480,87 @@ /* is not part of f, but don't save if */ /* inside v */ /*-----------------------------------------------------------------*/ -pCodeOp *pic16_popGetTempRegCond(bitVect *f, bitVect *v, int lock) +pCodeOp * +pic16_popGetTempRegCond (bitVect * f, bitVect * v, int lock) { - pCodeOp *pcop=NULL; + pCodeOp *pcop = NULL; symbol *cfunc; int i; // DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if(_TempReg_lock) { + if (_TempReg_lock) + { // werror(W_POSSBUG2, __FILE__, __LINE__); } - _TempReg_lock += lock; + _TempReg_lock += lock; - cfunc = currFunc; - currFunc = NULL; + cfunc = currFunc; + currFunc = NULL; - i = bitVectFirstBit(f); - while(i < 128) { + i = bitVectFirstBit (f); + while (i < 128) + { /* bypass registers that are used by function */ - if(!bitVectBitValue(f, i)) { + if (!bitVectBitValue (f, i)) + { - /* bypass registers that are already allocated for stack access */ - if(!bitVectBitValue(v, i)) { + /* bypass registers that are already allocated for stack access */ + if (!bitVectBitValue (v, i)) + { // debugf("getting register rIdx = %d\n", i); - /* ok, get the operand */ - pcop = pic16_newpCodeOpReg( i ); + /* ok, get the operand */ + pcop = pic16_newpCodeOpReg (i); - /* should never by NULL */ - assert( pcop != NULL ); + /* should never by NULL */ + assert (pcop != NULL); - /* sanity check */ - if(pcop && pcop->type == PO_GPR_TEMP && PCOR(pcop)->r) { - int found=0; + /* sanity check */ + if (pcop && pcop->type == PO_GPR_TEMP && PCOR (pcop)->r) + { + int found = 0; - PCOR(pcop)->r->wasUsed=1; - PCOR(pcop)->r->isFree=0; + PCOR (pcop)->r->wasUsed = 1; + PCOR (pcop)->r->isFree = 0; - { - reg_info *sr; + { + reg_info *sr; - for(sr=setFirstItem(_G.sregsAllocSet);sr;sr=setNextItem(_G.sregsAllocSet)) { + for (sr = setFirstItem (_G.sregsAllocSet); sr; sr = setNextItem (_G.sregsAllocSet)) + { - if(sr->rIdx == PCOR(pcop)->r->rIdx) { - /* already used in previous steps, break */ - found=1; - break; - } + if (sr->rIdx == PCOR (pcop)->r->rIdx) + { + /* already used in previous steps, break */ + found = 1; + break; + } + } } - } - /* caller takes care of the following */ + /* caller takes care of the following */ // bitVectSetBit(v, i); - if(!found) { - /* push value on stack */ - pic16_pushpCodeOp( pic16_pCodeOpCopy(pcop) ); - addSet(&_G.sregsAllocSet, PCOR(pcop)->r); - } + if (!found) + { + /* push value on stack */ + pic16_pushpCodeOp (pic16_pCodeOpCopy (pcop)); + addSet (&_G.sregsAllocSet, PCOR (pcop)->r); + } - break; - } + break; + } + } } - } i++; } - currFunc = cfunc; + currFunc = cfunc; return pcop; } @@ -1485,48 +1569,55 @@ /*-----------------------------------------------------------------*/ /* pic16_popReleaseTempReg - create a new temporary pCodeOp */ /*-----------------------------------------------------------------*/ -void pic16_popReleaseTempReg(pCodeOp *pcop, int lock) +void +pic16_popReleaseTempReg (pCodeOp * pcop, int lock) { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); _TempReg_lock -= lock; - if(pcop && pcop->type == PO_GPR_TEMP && PCOR(pcop)->r) { - PCOR(pcop)->r->isFree = 1; + if (pcop && pcop->type == PO_GPR_TEMP && PCOR (pcop)->r) + { + PCOR (pcop)->r->isFree = 1; - pic16_poppCodeOp( pic16_pCodeOpCopy(pcop) ); - } + pic16_poppCodeOp (pic16_pCodeOpCopy (pcop)); + } } + /*-----------------------------------------------------------------*/ /* pic16_popGetLabel - create a new pCodeOp of type PO_LABEL */ /*-----------------------------------------------------------------*/ -pCodeOp *pic16_popGetLabel(int key) +pCodeOp * +pic16_popGetLabel (int key) { - DEBUGpic16_emitcode ("; ***","%s key=%d, label offset %d",__FUNCTION__,key, pic16_labelOffset); + DEBUGpic16_emitcode ("; ***", "%s key=%d, label offset %d", __FUNCTION__, key, pic16_labelOffset); - if(key>max_key) + if (key > max_key) max_key = key; - return pic16_newpCodeOpLabel(NULL,key+100+pic16_labelOffset); + return pic16_newpCodeOpLabel (NULL, labelKey2num (key + pic16_labelOffset)); } /*-----------------------------------------------------------------*/ /* pic16_popCopyReg - copy a pcode operator */ /*-----------------------------------------------------------------*/ -pCodeOp *pic16_popCopyReg(pCodeOpReg *pc) +pCodeOp * +pic16_popCopyReg (pCodeOpReg * pc) { pCodeOpReg *pcor; - pcor = Safe_calloc(1,sizeof(pCodeOpReg) ); + pcor = Safe_calloc (1, sizeof (pCodeOpReg)); memcpy (pcor, pc, sizeof (pCodeOpReg)); pcor->r->wasUsed = 1; //pcor->pcop.type = pc->pcop.type; - if(pc->pcop.name) { - if(!(pcor->pcop.name = Safe_strdup(pc->pcop.name))) - fprintf(stderr,"oops %s %d",__FILE__,__LINE__); - } else + if (pc->pcop.name) + { + if (!(pcor->pcop.name = Safe_strdup (pc->pcop.name))) + fprintf (stderr, "oops %s %d", __FILE__, __LINE__); + } + else pcor->pcop.name = NULL; //pcor->r = pc->r; @@ -1536,55 +1627,61 @@ // DEBUGpic16_emitcode ("; ***","%s , copying %s, rIdx=%d",__FUNCTION__,pc->pcop.name,pc->rIdx); - return PCOP(pcor); + return PCOP (pcor); } /*-----------------------------------------------------------------*/ /* pic16_popGetLit - asm operator to pcode operator conversion */ /*-----------------------------------------------------------------*/ -pCodeOp *pic16_popGetLit(int lit) +pCodeOp * +pic16_popGetLit (int lit) { - return pic16_newpCodeOpLit(lit); + return pic16_newpCodeOpLit (lit); } /* Allow for 12 bit literals (LFSR x, ). */ -pCodeOp *pic16_popGetLit12(int lit) +pCodeOp * +pic16_popGetLit12 (int lit) { - return pic16_newpCodeOpLit12(lit); + return pic16_newpCodeOpLit12 (lit); } /*-----------------------------------------------------------------*/ /* pic16_popGetLit2 - asm operator to pcode operator conversion */ /*-----------------------------------------------------------------*/ -pCodeOp *pic16_popGetLit2(int lit, pCodeOp *arg2) +pCodeOp * +pic16_popGetLit2 (int lit, pCodeOp * arg2) { - return pic16_newpCodeOpLit2(lit, arg2); + return pic16_newpCodeOpLit2 (lit, arg2); } /*-----------------------------------------------------------------*/ /* pic16_popGetImmd - asm operator to pcode immediate conversion */ /*-----------------------------------------------------------------*/ -pCodeOp *pic16_popGetImmd(char *name, unsigned int offset, int index) +pCodeOp * +pic16_popGetImmd (char *name, unsigned int offset, int index) { - return pic16_newpCodeOpImmd(name, offset,index, 0); + return pic16_newpCodeOpImmd (name, offset, index, 0); } /*-----------------------------------------------------------------*/ /* pic16_popGet - asm operator to pcode operator conversion */ /*-----------------------------------------------------------------*/ -pCodeOp *pic16_popGetWithString(char *str) +pCodeOp * +pic16_popGetWithString (char *str) { pCodeOp *pcop; - if(!str) { - fprintf(stderr,"NULL string %s %d\n",__FILE__,__LINE__); - exit (1); - } + if (!str) + { + fprintf (stderr, "NULL string %s %d\n", __FILE__, __LINE__); + exit (1); + } - pcop = pic16_newpCodeOp(str,PO_STR); + pcop = pic16_newpCodeOp (str, PO_STR); return pcop; } @@ -1592,61 +1689,62 @@ /*-----------------------------------------------------------------*/ /* pic16_popRegFromString - */ /*-----------------------------------------------------------------*/ -static pCodeOp *pic16_popRegFromString(char *str, int size, int offset, operand *op) +static pCodeOp * +pic16_popRegFromString (char *str, int size, int offset, operand * op) { - pCodeOp *pcop = Safe_calloc(1,sizeof(pCodeOpReg) ); + pCodeOp *pcop = Safe_calloc (1, sizeof (pCodeOpReg)); pcop->type = PO_DIR; - DEBUGpic16_emitcode(";","%d %s %s %d/%d",__LINE__, __FUNCTION__, str, size, offset); // patch 14 + DEBUGpic16_emitcode (";", "%d %s %s %d/%d", __LINE__, __FUNCTION__, str, size, offset); // patch 14 // fprintf(stderr, "%s:%d: register name = %s pos = %d/%d\n", __FUNCTION__, __LINE__, str, offset, size); - if(!str) + if (!str) str = "BAD_STRING"; - pcop->name = Safe_calloc(1,strlen(str)+1); - strcpy(pcop->name,str); + pcop->name = Safe_calloc (1, strlen (str) + 1); + strcpy (pcop->name, str); //pcop->name = Safe_strdup( ( (str) ? str : "BAD STRING")); - PCOR(pcop)->r = pic16_dirregWithName(pcop->name); + PCOR (pcop)->r = pic16_dirregWithName (pcop->name); // PCOR(pcop)->r->wasUsed = 1; /* make sure that register doesn't exist, * and operand isn't NULL * and symbol isn't in codespace (codespace symbols are handled elsewhere) */ - if((PCOR(pcop)->r == NULL) - && (op) - && !IN_CODESPACE(SPEC_OCLS(OP_SYM_ETYPE(op)))) { + if ((PCOR (pcop)->r == NULL) && (op) && !IN_CODESPACE (SPEC_OCLS (OP_SYM_ETYPE (op)))) + { // fprintf(stderr, "%s:%d - couldn't find %s in allocated regsters, size= %d ofs= %d\n", // __FUNCTION__, __LINE__, str, size, offset); - PCOR(pcop)->r = pic16_allocRegByName (pcop->name,size, op); - //fprintf(stderr, "%s:%d: WARNING: need to allocate new register by name -> %s\n", __FILE__, __LINE__, str); + PCOR (pcop)->r = pic16_allocRegByName (pcop->name, size, op); + //fprintf(stderr, "%s:%d: WARNING: need to allocate new register by name -> %s\n", __FILE__, __LINE__, str); - } - PCOR(pcop)->instance = offset; + } + PCOR (pcop)->instance = offset; return pcop; } -static pCodeOp *pic16_popRegFromIdx(int rIdx) +static pCodeOp * +pic16_popRegFromIdx (int rIdx) { pCodeOp *pcop; // DEBUGpic16_emitcode ("; ***","%s,%d\trIdx=0x%x", __FUNCTION__,__LINE__,rIdx); // fprintf(stderr, "%s:%d rIdx = 0x%0x\n", __FUNCTION__, __LINE__, rIdx); - pcop = Safe_calloc(1,sizeof(pCodeOpReg) ); - PCOR(pcop)->rIdx = rIdx; - PCOR(pcop)->r = pic16_regWithIdx(rIdx); - if(!PCOR(pcop)->r) - PCOR(pcop)->r = pic16_allocWithIdx(rIdx); + pcop = Safe_calloc (1, sizeof (pCodeOpReg)); + PCOR (pcop)->rIdx = rIdx; + PCOR (pcop)->r = pic16_regWithIdx (rIdx); + if (!PCOR (pcop)->r) + PCOR (pcop)->r = pic16_allocWithIdx (rIdx); - PCOR(pcop)->r->isFree = 0; - PCOR(pcop)->r->wasUsed = 1; + PCOR (pcop)->r->isFree = 0; + PCOR (pcop)->r->wasUsed = 1; - pcop->type = PCOR(pcop)->r->pc_type; + pcop->type = PCOR (pcop)->r->pc_type; return pcop; } @@ -1655,11 +1753,11 @@ /* pic16_popGet2 - a variant of pic16_popGet to handle two memory operand commands */ /* VR 030601 */ /*---------------------------------------------------------------------------------*/ -pCodeOp *pic16_popGet2(asmop *aop_src, asmop *aop_dst, int offset) +pCodeOp * +pic16_popGet2 (asmop * aop_src, asmop * aop_dst, int offset) { - pCodeOp2 *pcop2 = (pCodeOp2 *)pic16_newpCodeOp2( - pic16_popGet(aop_src, offset), pic16_popGet(aop_dst, offset)); - return PCOP(pcop2); + pCodeOp2 *pcop2 = (pCodeOp2 *) pic16_newpCodeOp2 (pic16_popGet (aop_src, offset), pic16_popGet (aop_dst, offset)); + return PCOP (pcop2); } @@ -1668,315 +1766,367 @@ /* pic16_popGet2p - a variant of pic16_popGet to handle two memory operand commands */ /* VR 030601 , adapted by Hans Dorn */ /*--------------------------------------------------------------------------------.-*/ -pCodeOp *pic16_popGet2p(pCodeOp *src, pCodeOp *dst) +pCodeOp * +pic16_popGet2p (pCodeOp * src, pCodeOp * dst) { pCodeOp2 *pcop2; - pcop2 = (pCodeOp2 *)pic16_newpCodeOp2(src, dst); - return PCOP(pcop2); + pcop2 = (pCodeOp2 *) pic16_newpCodeOp2 (src, dst); + return PCOP (pcop2); } /*---------------------------------------------------------------------------------*/ /* pic16_popCombine2 - combine two pCodeOpReg variables into one for use with */ /* movff instruction */ /*---------------------------------------------------------------------------------*/ -pCodeOp *pic16_popCombine2(pCodeOpReg *src, pCodeOpReg *dst, int noalloc) +pCodeOp * +pic16_popCombine2 (pCodeOpReg * src, pCodeOpReg * dst, int noalloc) { - pCodeOp2 *pcop2 = (pCodeOp2 *)pic16_newpCodeOp2( - pic16_popCopyReg(src), pic16_popCopyReg(dst) ); + pCodeOp2 *pcop2 = (pCodeOp2 *) pic16_newpCodeOp2 (pic16_popCopyReg (src), pic16_popCopyReg (dst)); - return PCOP(pcop2); + return PCOP (pcop2); } /*-----------------------------------------------------------------*/ /* pic16_popGet - asm operator to pcode operator conversion */ /*-----------------------------------------------------------------*/ -pCodeOp *pic16_popGet (asmop *aop, int offset) //, bool bit16, bool dname) +pCodeOp * +pic16_popGet (asmop * aop, int offset) //, bool bit16, bool dname) { // char *s = buffer ; // char *rs; pCodeOp *pcop; - FENTRY2; + FENTRY2; - /* offset is greater than size then zero */ + /* offset is greater than size then zero */ // if (offset > (aop->size - 1) && // aop->type != AOP_LIT) // return NULL; //zero; - /* depending on type */ - switch (aop->type) { - case AOP_STA: - /* pCodeOp is already allocated from aopForSym */ - DEBUGpic16_emitcode(";---", "%d getting stack + offset %d\n", __LINE__, offset); - pcop = pic16_pCodeOpCopy(aop->aopu.stk.pop[offset]); - return (pcop); + /* depending on type */ + switch (aop->type) + { + case AOP_STA: + /* pCodeOp is already allocated from aopForSym */ + DEBUGpic16_emitcode (";---", "%d getting stack + offset %d\n", __LINE__, offset); + pcop = pic16_pCodeOpCopy (aop->aopu.stk.pop[offset]); + return (pcop); - case AOP_ACC: - { - int rIdx = IDX_WREG; //aop->aopu.aop_reg[offset]->rIdx; + case AOP_ACC: + { + int rIdx = IDX_WREG; //aop->aopu.aop_reg[offset]->rIdx; - fprintf(stderr, "%s:%d returning register AOP_ACC %s\n", __FILE__, __LINE__, aop->aopu.aop_str[offset]); +// fprintf (stderr, "%s:%d returning register AOP_ACC %s\n", __FILE__, __LINE__, aop->aopu.aop_str[offset]); - DEBUGpic16_emitcode(";","%d\tAOP_ACC", __LINE__); + DEBUGpic16_emitcode (";", "%d\tAOP_ACC", __LINE__); - pcop = Safe_calloc(1,sizeof(pCodeOpReg) ); - PCOR(pcop)->rIdx = rIdx; - PCOR(pcop)->r = pic16_typeRegWithIdx(rIdx, REG_SFR, 1); // pic16_regWithIdx(rIdx); - PCOR(pcop)->r->wasUsed=1; - PCOR(pcop)->r->isFree=0; + pcop = Safe_calloc (1, sizeof (pCodeOpReg)); + PCOR (pcop)->rIdx = rIdx; + PCOR (pcop)->r = pic16_typeRegWithIdx (rIdx, REG_SFR, 1); // pic16_regWithIdx(rIdx); + PCOR (pcop)->r->wasUsed = 1; + PCOR (pcop)->r->isFree = 0; - PCOR(pcop)->instance = offset; - pcop->type = PCOR(pcop)->r->pc_type; + PCOR (pcop)->instance = offset; + pcop->type = PCOR (pcop)->r->pc_type; // DEBUGpic16_emitcode(";","%d register idx = %d name =%s",__LINE__,rIdx,rs); - return pcop; + return pcop; // return pic16_popRegFromString(aop->aopu.aop_str[offset], aop->size, offset); // return pic16_newpCodeOpRegFromStr(aop->aopu.aop_str[offset]); // assert( 0 ); - } + } case AOP_DIR: - DEBUGpic16_emitcode(";","%d\tAOP_DIR (name = %s)", __LINE__, aop->aopu.aop_dir); - return pic16_popRegFromString(aop->aopu.aop_dir, aop->size, offset, NULL); + DEBUGpic16_emitcode (";", "%d\tAOP_DIR (name = %s)", __LINE__, aop->aopu.aop_dir); + return pic16_popRegFromString (aop->aopu.aop_dir, aop->size, offset, NULL); #if 0 case AOP_PAGED: - DEBUGpic16_emitcode(";","%d\tAOP_DIR", __LINE__); - return pic16_popRegFromString(aop->aopu.aop_dir, aop->size, offset, NULL); + DEBUGpic16_emitcode (";", "%d\tAOP_DIR", __LINE__); + return pic16_popRegFromString (aop->aopu.aop_dir, aop->size, offset, NULL); #endif case AOP_REG: - { - int rIdx; + { + int rIdx; // debugf2("aop = %p\toffset = %d\n", aop, offset); // assert (aop && aop->aopu.aop_reg[offset] != NULL); - rIdx = aop->aopu.aop_reg[offset]->rIdx; + rIdx = aop->aopu.aop_reg[offset]->rIdx; - DEBUGpic16_emitcode(";","%d\tAOP_REG", __LINE__); + DEBUGpic16_emitcode (";", "%d\tAOP_REG", __LINE__); - pcop = Safe_calloc(1,sizeof(pCodeOpReg) ); + pcop = Safe_calloc (1, sizeof (pCodeOpReg)); // pcop->type = PO_GPR_REGISTER; - PCOR(pcop)->rIdx = rIdx; - PCOR(pcop)->r = pic16_allocWithIdx( rIdx ); //pic16_regWithIdx(rIdx); - PCOR(pcop)->r->wasUsed=1; - PCOR(pcop)->r->isFree=0; + PCOR (pcop)->rIdx = rIdx; + PCOR (pcop)->r = pic16_allocWithIdx (rIdx); //pic16_regWithIdx(rIdx); + PCOR (pcop)->r->wasUsed = 1; + PCOR (pcop)->r->isFree = 0; - PCOR(pcop)->instance = offset; - pcop->type = PCOR(pcop)->r->pc_type; + PCOR (pcop)->instance = offset; + pcop->type = PCOR (pcop)->r->pc_type; - DEBUGpic16_emitcode(";*+*", "%d\tAOP_REG type = %s", __LINE__, dumpPicOptype(pcop->type)); + DEBUGpic16_emitcode (";*+*", "%d\tAOP_REG type = %s", __LINE__, dumpPicOptype (pcop->type)); // rs = aop->aopu.aop_reg[offset]->name; // DEBUGpic16_emitcode(";","%d register idx = %d name = %s",__LINE__,rIdx,rs); - return pcop; - } + return pcop; + } case AOP_CRY: - DEBUGpic16_emitcode(";","%d\tAOP_CRY", __LINE__); + DEBUGpic16_emitcode (";", "%d\tAOP_CRY", __LINE__); - pcop = pic16_newpCodeOpBit(aop->aopu.aop_dir,-1,1, PO_GPR_REGISTER); - PCOR(pcop)->instance = offset; - PCOR(pcop)->r = pic16_dirregWithName(aop->aopu.aop_dir); + pcop = pic16_newpCodeOpBit (aop->aopu.aop_dir, -1, 1, PO_GPR_REGISTER); + PCOR (pcop)->instance = offset; + PCOR (pcop)->r = pic16_dirregWithName (aop->aopu.aop_dir); //if(PCOR(pcop)->r == NULL) //fprintf(stderr,"%d - couldn't find %s in allocated registers\n",__LINE__,aop->aopu.aop_dir); return pcop; case AOP_LIT: - DEBUGpic16_emitcode(";","%d\tAOP_LIT", __LINE__); - return pic16_newpCodeOpLit(pic16aopLiteral (aop->aopu.aop_lit,offset)); + DEBUGpic16_emitcode (";", "%d\tAOP_LIT", __LINE__); + return pic16_newpCodeOpLit (pic16aopLiteral (aop->aopu.aop_lit, offset)); case AOP_STR: - DEBUGpic16_emitcode(";","%d AOP_STR %s",__LINE__,aop->aopu.aop_str[offset]); - return pic16_newpCodeOpRegFromStr(aop->aopu.aop_str[offset]); + DEBUGpic16_emitcode (";", "%d AOP_STR %s", __LINE__, aop->aopu.aop_str[offset]); + return pic16_newpCodeOpRegFromStr (aop->aopu.aop_str[offset]); /* - pcop = Safe_calloc(1,sizeof(pCodeOpReg) ); - PCOR(pcop)->r = pic16_allocRegByName(aop->aopu.aop_str[offset]); - PCOR(pcop)->rIdx = PCOR(pcop)->r->rIdx; - pcop->type = PCOR(pcop)->r->pc_type; - pcop->name = PCOR(pcop)->r->name; + pcop = Safe_calloc(1,sizeof(pCodeOpReg) ); + PCOR(pcop)->r = pic16_allocRegByName(aop->aopu.aop_str[offset]); + PCOR(pcop)->rIdx = PCOR(pcop)->r->rIdx; + pcop->type = PCOR(pcop)->r->pc_type; + pcop->name = PCOR(pcop)->r->name; - return pcop; - */ + return pcop; + */ case AOP_PCODE: - DEBUGpic16_emitcode(";","pic16_popGet AOP_PCODE (%s) %d %s offset %d",pic16_pCodeOpType(aop->aopu.pcop), - __LINE__, - ((aop->aopu.pcop->name)? (aop->aopu.pcop->name) : "no name"), offset); - pcop = pic16_pCodeOpCopy(aop->aopu.pcop); - switch( aop->aopu.pcop->type ) { - case PO_DIR: PCOR(pcop)->instance += offset; break; - case PO_IMMEDIATE: PCOI(pcop)->offset = offset; break; + DEBUGpic16_emitcode (";", "pic16_popGet AOP_PCODE (%s) %d %s offset %d", pic16_pCodeOpType (aop->aopu.pcop), + __LINE__, ((aop->aopu.pcop->name) ? (aop->aopu.pcop->name) : "no name"), offset); + pcop = pic16_pCodeOpCopy (aop->aopu.pcop); + switch (aop->aopu.pcop->type) + { + case PO_DIR: + PCOR (pcop)->instance += offset; + break; + case PO_IMMEDIATE: + PCOI (pcop)->offset = offset; + break; case PO_WREG: - assert (offset==0); - break; + assert (offset == 0); + break; default: fprintf (stderr, "%s: unhandled aop->aopu.pcop->type %d\n", __FUNCTION__, aop->aopu.pcop->type); - assert( 0 ); /* should never reach here */; - } + assert (0); /* should never reach here */ ; + } return pcop; } - werror(E_INTERNAL_ERROR,__FILE__,__LINE__, - "pic16_popGet got unsupported aop->type"); - exit(0); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "pic16_popGet got unsupported aop->type"); + exit (0); +} + +/*-------------------------------------------------------------------------*/ +/* pic16_popGetImmed - immediate asm operator to pcode operator conversion */ +/*-------------------------------------------------------------------------*/ +static pCodeOp * +pic16_popGetImmed(asmop *aop, int offset, int overload) +{ + pCodeOp *pcop; + + FENTRY2; + + if (aop->type == AOP_PCODE) + { + if (aop->aopu.pcop->type == PO_IMMEDIATE) + { + pcop = pic16_pCodeOpCopy(aop->aopu.pcop); + PCOI(pcop)->offset = offset; // offset: "LOW", "HIGH", "UPPER" + PCOI(pcop)->index += overload; // LOW(ptr + index + overload) + return pcop; + } + + fprintf(stderr, "%s: Only handled PO_IMMEDIATE.\n", __FUNCTION__); + assert(0); + } + + werror(E_INTERNAL_ERROR, __FILE__, __LINE__, "pic16_popGetImmed supported only AOP_PCODE."); + exit(0); } + /*-----------------------------------------------------------------*/ /* pic16_aopPut - puts a string for a aop */ /*-----------------------------------------------------------------*/ -void pic16_aopPut (asmop *aop, char *s, int offset) +void +pic16_aopPut (asmop * aop, char *s, int offset) { - char *d = buffer ; - symbol *lbl ; + char *d = buffer; + symbol *lbl; - return; + return; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - if (aop->size && offset > ( aop->size - 1)) { - werror(E_INTERNAL_ERROR,__FILE__,__LINE__, - "pic16_aopPut got offset > aop->size"); - exit(0); + if (aop->size && offset > (aop->size - 1)) + { + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "pic16_aopPut got offset > aop->size"); + exit (0); } - /* will assign value to value */ - /* depending on where it is ofcourse */ - switch (aop->type) { + /* will assign value to value */ + /* depending on where it is ofcourse */ + switch (aop->type) + { case AOP_DIR: - if (offset) { - sprintf(d,"(%s + %d)", - aop->aopu.aop_dir,offset); - fprintf(stderr,"oops pic16_aopPut:AOP_DIR did this %s\n",s); - - } else - sprintf(d,"%s",aop->aopu.aop_dir); - - if (strcmp(d,s)) { - DEBUGpic16_emitcode(";","%d",__LINE__); - if(strcmp(s,"W")) - pic16_emitcode("movf","%s,w",s); - pic16_emitcode("movwf","%s",d); - - if(strcmp(s,"W")) { - pic16_emitcode(";BUG!? should have this:movf","%s,w %d",s,__LINE__); - if(offset >= aop->size) { - pic16_emitpcode(POC_CLRF,pic16_popGet(aop,offset)); - break; - } else - pic16_emitpcode(POC_MOVLW,pic16_popGetImmd(s,offset,0)); - } + if (offset) + { + sprintf (d, "(%s + %d)", aop->aopu.aop_dir, offset); + fprintf (stderr, "oops pic16_aopPut:AOP_DIR did this %s\n", s); + + } + else + sprintf (d, "%s", aop->aopu.aop_dir); + + if (strcmp (d, s)) + { + DEBUGpic16_emitcode (";", "%d", __LINE__); + if (strcmp (s, "W")) + pic16_emitcode ("movf", "%s,w", s); + pic16_emitcode ("movwf", "%s", d); + + if (strcmp (s, "W")) + { + pic16_emitcode (";BUG!? should have this:movf", "%s,w %d", s, __LINE__); + if (offset >= aop->size) + { + pic16_emitpcode (POC_CLRF, pic16_popGet (aop, offset)); + break; + } + else + pic16_emitpcode (POC_MOVLW, pic16_popGetImmd (s, offset, 0)); + } - pic16_emitpcode(POC_MOVWF,pic16_popGet(aop,offset)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (aop, offset)); } - break; + break; case AOP_REG: - if (strcmp(aop->aopu.aop_reg[offset]->name,s) != 0) { // && - //strcmp(aop->aopu.aop_reg[offset]->dname,s)!= 0){ + if (strcmp (aop->aopu.aop_reg[offset]->name, s) != 0) // && + { + //strcmp(aop->aopu.aop_reg[offset]->dname,s)!= 0){ /* - if (*s == '@' || - strcmp(s,"r0") == 0 || - strcmp(s,"r1") == 0 || - strcmp(s,"r2") == 0 || - strcmp(s,"r3") == 0 || - strcmp(s,"r4") == 0 || - strcmp(s,"r5") == 0 || - strcmp(s,"r6") == 0 || - strcmp(s,"r7") == 0 ) - pic16_emitcode("mov","%s,%s ; %d", - aop->aopu.aop_reg[offset]->dname,s,__LINE__); - else - */ + if (*s == '@' || + strcmp(s,"r0") == 0 || + strcmp(s,"r1") == 0 || + strcmp(s,"r2") == 0 || + strcmp(s,"r3") == 0 || + strcmp(s,"r4") == 0 || + strcmp(s,"r5") == 0 || + strcmp(s,"r6") == 0 || + strcmp(s,"r7") == 0 ) + pic16_emitcode("mov","%s,%s ; %d", + aop->aopu.aop_reg[offset]->dname,s,__LINE__); + else + */ - if(strcmp(s,"W")==0 ) - pic16_emitcode("movf","%s,w ; %d",s,__LINE__); + if (strcmp (s, "W") == 0) + pic16_emitcode ("movf", "%s,w ; %d", s, __LINE__); - pic16_emitcode("movwf","%s", - aop->aopu.aop_reg[offset]->name); + pic16_emitcode ("movwf", "%s", aop->aopu.aop_reg[offset]->name); - if(strcmp(s,zero)==0) { - pic16_emitpcode(POC_CLRF,pic16_popGet(aop,offset)); - - } else if(strcmp(s,"W")==0) { - pCodeOp *pcop = Safe_calloc(1,sizeof(pCodeOpReg) ); - pcop->type = PO_GPR_REGISTER; - - PCOR(pcop)->rIdx = -1; - PCOR(pcop)->r = NULL; - - DEBUGpic16_emitcode(";","%d",__LINE__); - pcop->name = Safe_strdup(s); - pic16_emitpcode(POC_MOVFW,pcop); - pic16_emitpcode(POC_MOVWF,pic16_popGet(aop,offset)); - } else if(strcmp(s,one)==0) { - pic16_emitpcode(POC_CLRF,pic16_popGet(aop,offset)); - pic16_emitpcode(POC_INCF,pic16_popGet(aop,offset)); - } else { - pic16_emitpcode(POC_MOVWF,pic16_popGet(aop,offset)); - } + if (strcmp (s, zero) == 0) + { + pic16_emitpcode (POC_CLRF, pic16_popGet (aop, offset)); + + } + else if (strcmp (s, "W") == 0) + { + pCodeOp *pcop = Safe_calloc (1, sizeof (pCodeOpReg)); + pcop->type = PO_GPR_REGISTER; + + PCOR (pcop)->rIdx = -1; + PCOR (pcop)->r = NULL; + + DEBUGpic16_emitcode (";", "%d", __LINE__); + pcop->name = Safe_strdup (s); + pic16_emitpcode (POC_MOVFW, pcop); + pic16_emitpcode (POC_MOVWF, pic16_popGet (aop, offset)); + } + else if (strcmp (s, one) == 0) + { + pic16_emitpcode (POC_CLRF, pic16_popGet (aop, offset)); + pic16_emitpcode (POC_INCF, pic16_popGet (aop, offset)); + } + else + { + pic16_emitpcode (POC_MOVWF, pic16_popGet (aop, offset)); + } } - break; + break; case AOP_STK: - if (strcmp(s,"a") == 0) - pic16_emitcode("push","acc"); - else - pic16_emitcode("push","%s",s); + if (strcmp (s, "a") == 0) + pic16_emitcode ("push", "acc"); + else + pic16_emitcode ("push", "%s", s); - break; + break; case AOP_CRY: - /* if bit variable */ - if (!aop->aopu.aop_dir) { - pic16_emitcode("clr","a"); - pic16_emitcode("rlc","a"); - } else { - if (s == zero) - pic16_emitcode("clr","%s",aop->aopu.aop_dir); - else - if (s == one) - pic16_emitcode("setb","%s",aop->aopu.aop_dir); - else - if (!strcmp(s,"c")) - pic16_emitcode("mov","%s,c",aop->aopu.aop_dir); - else { - lbl = newiTempLabel(NULL); + /* if bit variable */ + if (!aop->aopu.aop_dir) + { + pic16_emitcode ("clr", "a"); + pic16_emitcode ("rlc", "a"); + } + else + { + if (s == zero) + pic16_emitcode ("clr", "%s", aop->aopu.aop_dir); + else if (s == one) + pic16_emitcode ("setb", "%s", aop->aopu.aop_dir); + else if (!strcmp (s, "c")) + pic16_emitcode ("mov", "%s,c", aop->aopu.aop_dir); + else + { + lbl = newiTempLabel (NULL); - if (strcmp(s,"a")) { - MOVA(s); - } - pic16_emitcode("clr","c"); - pic16_emitcode("jz","%05d_DS_",lbl->key+100); - pic16_emitcode("cpl","c"); - pic16_emitcode("","%05d_DS_:",lbl->key+100); - pic16_emitcode("mov","%s,c",aop->aopu.aop_dir); - } + if (strcmp (s, "a")) + { + MOVA (s); + } + pic16_emitcode ("clr", "c"); + pic16_emitcode ("jz", "%05d_DS_", labelKey2num (lbl->key)); + pic16_emitcode ("cpl", "c"); + pic16_emitcode ("", "%05d_DS_:", labelKey2num (lbl->key)); + pic16_emitcode ("mov", "%s,c", aop->aopu.aop_dir); + } } - break; + break; case AOP_STR: - aop->coff = offset; - if (strcmp(aop->aopu.aop_str[offset],s)) - pic16_emitcode ("mov","%s,%s ; %d",aop->aopu.aop_str[offset],s,__LINE__); - break; + aop->coff = offset; + if (strcmp (aop->aopu.aop_str[offset], s)) + pic16_emitcode ("mov", "%s,%s ; %d", aop->aopu.aop_str[offset], s, __LINE__); + break; case AOP_ACC: - aop->coff = offset; - if (!offset && (strcmp(s,"acc") == 0)) - break; - - if (strcmp(aop->aopu.aop_str[offset],s)) - pic16_emitcode ("mov","%s,%s ; %d",aop->aopu.aop_str[offset],s, __LINE__); + aop->coff = offset; + if (!offset && (strcmp (s, "acc") == 0)) break; - default : - fprintf(stderr, "%s:%d: unknown aop->type = 0x%x\n", __FILE__, __LINE__, aop->type); + if (strcmp (aop->aopu.aop_str[offset], s)) + pic16_emitcode ("mov", "%s,%s ; %d", aop->aopu.aop_str[offset], s, __LINE__); + break; + + default: + fprintf (stderr, "%s:%d: unknown aop->type = 0x%x\n", __FILE__, __LINE__, aop->type); // werror(E_INTERNAL_ERROR,__FILE__,__LINE__, // "pic16_aopPut got unsupported aop->type"); // exit(0); @@ -1987,218 +2137,299 @@ /*-----------------------------------------------------------------*/ /* pic16_mov2w - generate either a MOVLW or MOVFW based operand type */ /*-----------------------------------------------------------------*/ -void pic16_mov2w (asmop *aop, int offset) +void +pic16_mov2w (asmop * aop, int offset) { - DEBUGpic16_emitcode ("; ***","%s %d offset=%d",__FUNCTION__,__LINE__,offset); + int isWREG = (aop->type != AOP_STA && ! strcmp (pic16_aopGet(aop, 0, TRUE, FALSE), "WREG")); + + DEBUGpic16_emitcode ("; ***", "%s %d offset=%d", __FUNCTION__, __LINE__, offset); - if(pic16_isLitAop(aop)) - pic16_emitpcode(POC_MOVLW,pic16_popGet(aop,offset)); + if (pic16_isLitAop (aop)) + pic16_emitpcode (POC_MOVLW, pic16_popGet (aop, offset)); + else if (isWREG) + DEBUGpic16_emitcode ("; ***", "ignore MOVF\tWREG, W", __FUNCTION__, __LINE__); else - pic16_emitpcode(POC_MOVFW,pic16_popGet(aop,offset)); + pic16_emitpcode (POC_MOVFW, pic16_popGet (aop, offset)); } -void pic16_mov2w_volatile (asmop *aop) +void +pic16_mov2w_volatile (asmop * aop) { int i; - if(!pic16_isLitAop(aop)) { - // may need to protect this from the peepholer -- this is not nice but works... - pic16_addpCode2pBlock(pb, pic16_newpCodeAsmDir(";", "VOLATILE READ - BEGIN")); - for (i = 0; i < aop->size; i++) { - if (i > 0) { - pic16_addpCode2pBlock(pb, pic16_newpCodeAsmDir(";", "VOLATILE READ - MORE")); - } // if - pic16_emitpcode(POC_MOVFW, pic16_popGet(aop, i)); - } // for - pic16_addpCode2pBlock(pb, pic16_newpCodeAsmDir(";", "VOLATILE READ - END")); - } + if (!pic16_isLitAop (aop)) + { + // may need to protect this from the peepholer -- this is not nice but works... + pic16_addpCode2pBlock (pb, pic16_newpCodeAsmDir (";", "VOLATILE READ - BEGIN")); + for (i = 0; i < aop->size; i++) + { + if (i > 0) + { + pic16_addpCode2pBlock (pb, pic16_newpCodeAsmDir (";", "VOLATILE READ - MORE")); + } // if + pic16_emitpcode (POC_MOVFW, pic16_popGet (aop, i)); + } // for + pic16_addpCode2pBlock (pb, pic16_newpCodeAsmDir (";", "VOLATILE READ - END")); + } } -void pic16_mov2f(asmop *dst, asmop *src, int offset) +void +pic16_mov2f (asmop * dst, asmop * src, int offset) { - if(pic16_isLitAop(src)) { - pic16_emitpcode(POC_MOVLW, pic16_popGet(src, offset)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(dst, offset)); - } else { - if(pic16_sameRegsOfs(src, dst, offset))return; - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( pic16_popGet(src, offset), - pic16_popGet(dst, offset))); - } + if (pic16_isLitAop (src)) + { + int dstIsWREG = (dst->type != AOP_STA && ! strcmp(pic16_aopGet(dst, 0, TRUE, FALSE), "WREG")); + + pic16_emitpcode (POC_MOVLW, pic16_popGet (src, offset)); + + if (! dstIsWREG) + { + pic16_emitpcode (POC_MOVWF, pic16_popGet(dst, offset)); + } + } + else + { + int srcIsWREG; + + if (pic16_sameRegsOfs (src, dst, offset)) + return; + + srcIsWREG = (src->type != AOP_STA && ! strcmp (pic16_aopGet (src, 0, TRUE, FALSE), "WREG")); + + if (srcIsWREG) + { + pic16_emitpcode (POC_MOVWF, pic16_popGet (dst, offset)); + } + else + { + int dstIsINTCON = (src->type != AOP_STA && ! strcmp (pic16_aopGet(src, 0, TRUE, FALSE), "INTCON")); + int dstIsPCL = (src->type != AOP_STA && ! strcmp (pic16_aopGet(src, 0, TRUE, FALSE), "PCL")); + + if (dstIsINTCON || dstIsPCL) + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (src, offset)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (dst, offset)); + } + else + { + pic16_emitpcode(POC_MOVFF, pic16_popGet2p (pic16_popGet (src, offset), + pic16_popGet (dst, offset))); + } + } + } } -static void pic16_movLit2f(pCodeOp *pc, int lit) +static void +pic16_movLit2f (pCodeOp * pc, int lit) { if (0 == (lit & 0x00ff)) - { - pic16_emitpcode (POC_CLRF, pc); - } else if (0xff == (lit & 0x00ff)) - { - pic16_emitpcode (POC_SETF, pc); - } else { - pic16_emitpcode (POC_MOVLW, pic16_popGetLit (lit & 0x00ff)); - if (pc->type != PO_WREG) pic16_emitpcode (POC_MOVWF, pc); - } + { + pic16_emitpcode (POC_CLRF, pc); + } + else if (0xff == (lit & 0x00ff)) + { + pic16_emitpcode (POC_SETF, pc); + } + else + { + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (lit & 0x00ff)); + if (pc->type != PO_WREG) + pic16_emitpcode (POC_MOVWF, pc); + } } -static void mov2fp(pCodeOp *dst, asmop *src, int offset) +static void +mov2fp (pCodeOp * dst, asmop * src, int offset) { - if(pic16_isLitAop(src)) { - pic16_emitpcode(POC_MOVLW, pic16_popGet(src, offset)); - pic16_emitpcode(POC_MOVWF, dst); - } else { - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popGet(src, offset), dst)); - } + if (pic16_isLitAop (src)) + { + pic16_emitpcode (POC_MOVLW, pic16_popGet (src, offset)); + + if (dst->type != PO_WREG) + { + pic16_emitpcode (POC_MOVWF, dst); + } + } + else + { + if (dst->type == PO_INTCON || dst->type == PO_PCL) + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (src, offset)); + pic16_emitpcode (POC_MOVWF, dst); + } + else + { + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popGet (src, offset), dst)); + } + } } -void pic16_testStackOverflow(void) +void +pic16_testStackOverflow (void) { #define GSTACK_TEST_NAME "_gstack_test" - pic16_emitpcode(POC_CALL, pic16_popGetWithString( GSTACK_TEST_NAME )); + pic16_emitpcode (POC_CALL, pic16_popGetWithString (GSTACK_TEST_NAME)); { symbol *sym; - sym = newSymbol( GSTACK_TEST_NAME , 0 ); - sprintf(sym->rname, "%s", /*port->fun_prefix,*/ GSTACK_TEST_NAME); + sym = newSymbol (GSTACK_TEST_NAME, 0); + sprintf (sym->rname, "%s", /*port->fun_prefix, */ GSTACK_TEST_NAME); // strcpy(sym->rname, GSTACK_TEST_NAME); - checkAddSym(&externs, sym); + checkAddSym (&externs, sym); } } /* push pcop into stack */ -void pic16_pushpCodeOp(pCodeOp *pcop) +void +pic16_pushpCodeOp (pCodeOp * pcop) { // DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if (pcop->type == PO_LITERAL) { - pic16_emitpcode(POC_MOVLW, pcop); - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg( pic16_stack_postdec )); - } else { - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pcop, pic16_popCopyReg( pic16_stack_postdec ))); - } - if(pic16_options.gstack) - pic16_testStackOverflow(); + if (pcop->type == PO_LITERAL) + { + pic16_emitpcode (POC_MOVLW, pcop); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (pic16_stack_postdec)); + } + else + { + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pcop, pic16_popCopyReg (pic16_stack_postdec))); + } + if (pic16_options.gstack) + pic16_testStackOverflow (); } /* pop pcop from stack */ -void pic16_poppCodeOp(pCodeOp *pcop) +void +pic16_poppCodeOp (pCodeOp * pcop) { - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popCopyReg( pic16_stack_preinc ), pcop)); - if(pic16_options.gstack) - pic16_testStackOverflow(); + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popCopyReg (pic16_stack_preinc), pcop)); + if (pic16_options.gstack) + pic16_testStackOverflow (); } /*-----------------------------------------------------------------*/ /* pushw - pushes wreg to stack */ /*-----------------------------------------------------------------*/ -void pushw(void) +void +pushw (void) { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg( pic16_stack_postdec )); - if(pic16_options.gstack) - pic16_testStackOverflow(); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (pic16_stack_postdec)); + if (pic16_options.gstack) + pic16_testStackOverflow (); } /*-----------------------------------------------------------------*/ /* pushaop - pushes aop to stack */ /*-----------------------------------------------------------------*/ -void pushaop(asmop *aop, int offset) +void +pushaop (asmop * aop, int offset) { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - if(_G.resDirect)return; - - if(pic16_isLitAop(aop)) { - pic16_emitpcode(POC_MOVLW, pic16_popGet(aop, offset)); - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg( pic16_stack_postdec )); - } else { - pic16_emitpcode(POC_MOVFF, - pic16_popGet2p(pic16_popGet(aop, offset), pic16_popCopyReg( pic16_stack_postdec ))); - } + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - if(pic16_options.gstack) - pic16_testStackOverflow(); -} + if (_G.resDirect) + return; -/*-----------------------------------------------------------------*/ + if (pic16_isLitAop (aop)) + { + pic16_emitpcode (POC_MOVLW, pic16_popGet (aop, offset)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (pic16_stack_postdec)); + } + else + { + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popGet (aop, offset), pic16_popCopyReg (pic16_stack_postdec))); + } + + if (pic16_options.gstack) + pic16_testStackOverflow (); +} + +/*-----------------------------------------------------------------*/ /* popaop - pops aop from stack */ /*-----------------------------------------------------------------*/ -void popaop(asmop *aop, int offset) +void +popaop (asmop * aop, int offset) { - DEBUGpic16_emitcode("; ***", "%s %d", __FUNCTION__, __LINE__); - pic16_emitpcode(POC_MOVFF, pic16_popCombine2(pic16_stack_preinc, PCOR(pic16_popGet(aop, offset)), 0)); - if(pic16_options.gstack) - pic16_testStackOverflow(); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + pic16_emitpcode (POC_MOVFF, pic16_popCombine2 (pic16_stack_preinc, PCOR (pic16_popGet (aop, offset)), 0)); + if (pic16_options.gstack) + pic16_testStackOverflow (); } -void popaopidx(asmop *aop, int offset, int index) +void +popaopidx (asmop * aop, int offset, int index) { - int ofs=1; + int ofs = 1; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - if(STACK_MODEL_LARGE)ofs++; + if (STACK_MODEL_LARGE) + ofs++; - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(index + ofs)); - pic16_emitpcode(POC_MOVFF, pic16_popCombine2(pic16_frame_plusw, PCOR(pic16_popGet(aop, offset)), 0)); - if(pic16_options.gstack) - pic16_testStackOverflow(); + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (index + ofs)); + pic16_emitpcode (POC_MOVFF, pic16_popCombine2 (pic16_frame_plusw, PCOR (pic16_popGet (aop, offset)), 0)); + if (pic16_options.gstack) + pic16_testStackOverflow (); } /*-----------------------------------------------------------------*/ /* pic16_getDataSize - get the operand data size */ /*-----------------------------------------------------------------*/ -int pic16_getDataSize(operand *op) +int +pic16_getDataSize (operand * op) { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - return AOP_SIZE(op); + return AOP_SIZE (op); - // tsd- in the pic port, the genptr size is 1, so this code here - // fails. ( in the 8051 port, the size was 4). + // tsd- in the pic port, the genptr size is 1, so this code here + // fails. ( in the 8051 port, the size was 4). #if 0 - int size; - size = AOP_SIZE(op); - if (size == GPTRSIZE) + int size; + size = AOP_SIZE (op); + if (size == GPTRSIZE) { - sym_link *type = operandType(op); - if (IS_GENPTR(type)) + sym_link *type = operandType (op); + if (IS_GENPTR (type)) { - /* generic pointer; arithmetic operations - * should ignore the high byte (pointer type). - */ - size--; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + /* generic pointer; arithmetic operations + * should ignore the high byte (pointer type). + */ + size--; + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); } } - return size; + return size; #endif } /*-----------------------------------------------------------------*/ /* pic16_outAcc - output Acc */ /*-----------------------------------------------------------------*/ -void pic16_outAcc(operand *result) +void +pic16_outAcc (operand * result) { - int size,offset; - DEBUGpic16_emitcode ("; ***","%s %d - ",__FUNCTION__,__LINE__); - DEBUGpic16_pic16_AopType(__LINE__,NULL,NULL,result); + int size, offset; + DEBUGpic16_emitcode ("; ***", "%s %d - ", __FUNCTION__, __LINE__); + DEBUGpic16_pic16_AopType (__LINE__, NULL, NULL, result); - size = pic16_getDataSize(result); - if(size){ - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),0)); - size--; - offset = 1; - /* unsigned or positive */ - while(size--) - pic16_emitpcode(POC_CLRF,pic16_popGet(AOP(result),offset++)); - } + size = pic16_getDataSize (result); + if (size) + { + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); + size--; + offset = 1; + /* unsigned or positive */ + while (size--) + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offset++)); + } } @@ -2206,23 +2437,28 @@ /* pic16_outBitC - output a bit C */ /* Move to result the value of Carry flag -- VR */ /*-----------------------------------------------------------------*/ -void pic16_outBitC(operand *result) +void +pic16_outBitC (operand * result) { int i; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + + /* if the result is bit */ + if (AOP_TYPE (result) == AOP_CRY) + { + fprintf (stderr, "%s:%d: pic16 port warning: unsupported case\n", __FILE__, __LINE__); + pic16_aopPut (AOP (result), "c", 0); + } + else + { - /* if the result is bit */ - if (AOP_TYPE(result) == AOP_CRY) { - fprintf(stderr, "%s:%d: pic16 port warning: unsupported case\n", __FILE__, __LINE__); - pic16_aopPut(AOP(result),"c",0); - } else { - - i = AOP_SIZE(result); - while(i--) { - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result), i)); + i = AOP_SIZE (result); + while (i--) + { + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), i)); } - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result), 0)); + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), 0)); } } @@ -2230,274 +2466,363 @@ /* pic16_outBitOp - output a bit from Op */ /* Move to result the value of set/clr op -- VR */ /*-----------------------------------------------------------------*/ -void pic16_outBitOp(operand *result, pCodeOp *pcop) +void +pic16_outBitOp (operand * result, pCodeOp * pcop) { int i; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + + /* if the result is bit */ + if (AOP_TYPE (result) == AOP_CRY) + { + fprintf (stderr, "%s:%d: pic16 port warning: unsupported case\n", __FILE__, __LINE__); + pic16_aopPut (AOP (result), "c", 0); + } + else + { - /* if the result is bit */ - if (AOP_TYPE(result) == AOP_CRY) { - fprintf(stderr, "%s:%d: pic16 port warning: unsupported case\n", __FILE__, __LINE__); - pic16_aopPut(AOP(result),"c",0); - } else { - - i = AOP_SIZE(result); - while(i--) { - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result), i)); + i = AOP_SIZE (result); + while (i--) + { + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), i)); } - pic16_emitpcode(POC_RRCF, pcop); - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result), 0)); + pic16_emitpcode (POC_RRCF, pcop); + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), 0)); } } /*-----------------------------------------------------------------*/ /* pic16_toBoolean - emit code for orl a,operator(sizeop) */ /*-----------------------------------------------------------------*/ -void pic16_toBoolean(operand *oper) +void +pic16_toBoolean (operand * oper) { - int size = AOP_SIZE(oper) - 1; - int offset = 1; + int size = AOP_SIZE (oper) - 1; + int offset = 1; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - if ( AOP_TYPE(oper) != AOP_ACC) { - pic16_emitpcode(POC_MOVFW,pic16_popGet(AOP(oper),0)); + if (AOP_TYPE (oper) != AOP_ACC) + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (oper), 0)); } - while (size--) { - pic16_emitpcode(POC_IORFW, pic16_popGet(AOP(oper),offset++)); + while (size--) + { + pic16_emitpcode (POC_IORFW, pic16_popGet (AOP (oper), offset++)); } } /*-----------------------------------------------------------------*/ /* genUminusFloat - unary minus for floating points */ /*-----------------------------------------------------------------*/ -static void genUminusFloat(operand *op,operand *result) +static void +genUminusFloat (operand * op, operand * result) { - int size ,offset =0 ; + int size, offset = 0; - FENTRY; - /* for this we just need to flip the - first it then copy the rest in place */ - size = AOP_SIZE(op); - assert( size == AOP_SIZE(result) ); + FENTRY; + /* for this we just need to flip the + first it then copy the rest in place */ + size = AOP_SIZE (op); + assert (size == AOP_SIZE (result)); - while(size--) { - pic16_mov2f(AOP(result), AOP(op), offset); + while (size--) + { + pic16_mov2f (AOP (result), AOP (op), offset); offset++; } - /* toggle the MSB's highest bit */ - pic16_emitpcode(POC_BTG, pic16_popCopyGPR2Bit(pic16_popGet(AOP(result), offset-1), 7)); + /* toggle the MSB's highest bit */ + pic16_emitpcode (POC_BTG, pic16_popCopyGPR2Bit (pic16_popGet (AOP (result), offset - 1), 7)); } /*-----------------------------------------------------------------*/ /* genUminus - unary minus code generation */ /*-----------------------------------------------------------------*/ -static void genUminus (iCode *ic) +static void +genUminus (iCode * ic) { int lsize, rsize, i; - sym_link *optype, *rtype; + sym_link *optype; symbol *label; - int needLabel=0; + int needLabel = 0; - FENTRY; + FENTRY; - /* assign asmops */ - pic16_aopOp(IC_LEFT(ic),ic,FALSE); - pic16_aopOp(IC_RESULT(ic),ic,TRUE); + /* assign asmops */ + pic16_aopOp (IC_LEFT (ic), ic, FALSE); + pic16_aopOp (IC_RESULT (ic), ic, TRUE); - /* if both in bit space then special case */ - if (AOP_TYPE(IC_RESULT(ic)) == AOP_CRY - && AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) { + /* if both in bit space then special case */ + if (AOP_TYPE (IC_RESULT (ic)) == AOP_CRY && AOP_TYPE (IC_LEFT (ic)) == AOP_CRY) + { - pic16_emitpcode(POC_BCF, pic16_popGet(AOP(IC_RESULT(ic)),0)); - pic16_emitpcode(POC_BTFSS, pic16_popGet(AOP(IC_LEFT(ic)),0)); - pic16_emitpcode(POC_BSF, pic16_popGet(AOP(IC_RESULT(ic)),0)); - goto release; + pic16_emitpcode (POC_BCF, pic16_popGet (AOP (IC_RESULT (ic)), 0)); + pic16_emitpcode (POC_BTFSS, pic16_popGet (AOP (IC_LEFT (ic)), 0)); + pic16_emitpcode (POC_BSF, pic16_popGet (AOP (IC_RESULT (ic)), 0)); + goto release; } - optype = operandType(IC_LEFT(ic)); - rtype = operandType(IC_RESULT(ic)); + optype = operandType (IC_LEFT (ic)); + /* if float then do float stuff */ + if (IS_FLOAT (optype) || IS_FIXED (optype)) + { + if (IS_FIXED (optype)) + debugf ("implement fixed16x16 type\n", 0); - /* if float then do float stuff */ - if (IS_FLOAT(optype) || IS_FIXED(optype)) { - if(IS_FIXED(optype)) - debugf("implement fixed16x16 type\n", 0); - - genUminusFloat(IC_LEFT(ic),IC_RESULT(ic)); - goto release; + genUminusFloat (IC_LEFT (ic), IC_RESULT (ic)); + goto release; } - /* otherwise subtract from zero by taking the 2's complement */ - lsize = AOP_SIZE(IC_LEFT(ic)); - rsize = AOP_SIZE(IC_RESULT(ic)); - label = newiTempLabel ( NULL ); + /* otherwise subtract from zero by taking the 2's complement */ + lsize = AOP_SIZE (IC_LEFT (ic)); + rsize = AOP_SIZE (IC_RESULT (ic)); + label = newiTempLabel (NULL); - if (pic16_sameRegs (AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic)))) { + if (pic16_sameRegs (AOP (IC_LEFT (ic)), AOP (IC_RESULT (ic)))) + { /* If the result is longer than the operand, store sign extension (0x00 or 0xff) in W */ - if (rsize > lsize) { - pic16_emitpcode (POC_MOVLW, pic16_popGetLit(0x00)); - pic16_emitpcode (POC_BTFSS, pic16_popCopyGPR2Bit(pic16_popGet(AOP(IC_LEFT(ic)), lsize-1), 7)); - pic16_emitpcode (POC_MOVLW, pic16_popGetLit(0xFF)); - } - for (i = rsize - 1; i > 0; --i) { - if (i > lsize - 1) { - pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP(IC_RESULT(ic)), i)); - } else { - pic16_emitpcode (POC_COMF, pic16_popGet (AOP(IC_RESULT(ic)), i)); - } // if - } // for - pic16_emitpcode (POC_NEGF, pic16_popGet (AOP(IC_RESULT(ic)), 0)); - for (i = 1; i < rsize; ++i) { - if (i == rsize - 1) { - emitSKPNZ; - } else { - pic16_emitpcode (POC_BNZ, pic16_popGetLabel (label->key)); needLabel++; + if (rsize > lsize) + { + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (0x00)); + pic16_emitpcode (POC_BTFSS, pic16_popCopyGPR2Bit (pic16_popGet (AOP (IC_LEFT (ic)), lsize - 1), 7)); + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (0xFF)); } - pic16_emitpcode (POC_INCF, pic16_popGet (AOP(IC_RESULT(ic)), i)); - } // for - } else { - for (i = min(rsize, lsize) - 1; i >= 0; i--) { - pic16_emitpcode (POC_COMFW, pic16_popGet (AOP(IC_LEFT(ic)), i)); - pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP(IC_RESULT(ic)), i)); - } // for + for (i = rsize - 1; i > 0; --i) + { + if (i > lsize - 1) + { + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (IC_RESULT (ic)), i)); + } + else + { + pic16_emitpcode (POC_COMF, pic16_popGet (AOP (IC_RESULT (ic)), i)); + } // if + } // for + pic16_emitpcode (POC_NEGF, pic16_popGet (AOP (IC_RESULT (ic)), 0)); + for (i = 1; i < rsize; ++i) + { + if (i == rsize - 1) + { + emitSKPNZ; + } + else + { + pic16_emitpcode (POC_BNZ, pic16_popGetLabel (label->key)); + needLabel++; + } + pic16_emitpcode (POC_INCF, pic16_popGet (AOP (IC_RESULT (ic)), i)); + } // for + } + else + { + for (i = min (rsize, lsize) - 1; i >= 0; i--) + { + pic16_emitpcode (POC_COMFW, pic16_popGet (AOP (IC_LEFT (ic)), i)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (IC_RESULT (ic)), i)); + } // for /* Sign extend if the result is longer than the operand */ - if (rsize > lsize) { - pic16_emitpcode (POC_MOVLW, pic16_popGetLit(0x00)); - pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit(pic16_popGet(AOP(IC_RESULT(ic)), lsize - 1), 7)); - pic16_emitpcode (POC_MOVLW, pic16_popGetLit(0xFF)); - for (i = rsize - 1; i > lsize - 1; --i) { - pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP(IC_RESULT(ic)), i)); - } // for - } // if - if (rsize > 1) { - for (i = 0; i < rsize - 2; i++) { - pic16_emitpcode (POC_INCF, pic16_popGet (AOP(IC_RESULT(ic)),i)); - pic16_emitpcode (POC_BNZ, pic16_popGetLabel (label->key)); - needLabel++; - } // for - pic16_emitpcode (POC_INFSNZ, pic16_popGet (AOP(IC_RESULT(ic)), rsize - 2)); - } // if - pic16_emitpcode (POC_INCF, pic16_popGet(AOP(IC_RESULT(ic)), rsize - 1)); + if (rsize > lsize) + { + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (0x00)); + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (pic16_popGet (AOP (IC_RESULT (ic)), lsize - 1), 7)); + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (0xFF)); + for (i = rsize - 1; i > lsize - 1; --i) + { + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (IC_RESULT (ic)), i)); + } // for + } // if + if (rsize > 1) + { + for (i = 0; i < rsize - 2; i++) + { + pic16_emitpcode (POC_INCF, pic16_popGet (AOP (IC_RESULT (ic)), i)); + pic16_emitpcode (POC_BNZ, pic16_popGetLabel (label->key)); + needLabel++; + } // for + pic16_emitpcode (POC_INFSNZ, pic16_popGet (AOP (IC_RESULT (ic)), rsize - 2)); + } // if + pic16_emitpcode (POC_INCF, pic16_popGet (AOP (IC_RESULT (ic)), rsize - 1)); } - if (needLabel) - pic16_emitpLabel (label->key); + if (needLabel) + pic16_emitpLabel (label->key); release: - /* release the aops */ - pic16_freeAsmop(IC_LEFT(ic), NULL, ic, (RESULTONSTACK(ic) ? 0 : 1)); - pic16_freeAsmop(IC_RESULT(ic), NULL, ic, TRUE); + /* release the aops */ + pic16_freeAsmop (IC_LEFT (ic), NULL, ic, (RESULTONSTACK (ic) ? 0 : 1)); + pic16_freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); } -void pic16_loadFromReturn(operand *op, int offset, pCodeOp *src) -{ - if((AOP(op)->type == AOP_PCODE) && (AOP(op)->aopu.pcop->type == PO_IMMEDIATE)) { - pic16_emitpcode(POC_MOVFW, src); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(op), offset)); - } else { - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - src, pic16_popGet(AOP(op), offset))); - } +void +pic16_loadFromReturn (operand * op, int offset, pCodeOp * src) +{ + if ((AOP (op)->type == AOP_PCODE) && (AOP (op)->aopu.pcop->type == PO_IMMEDIATE)) + { + pic16_emitpcode (POC_MOVFW, src); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (op), offset)); + } + else + { + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (src, pic16_popGet (AOP (op), offset))); + } } +/*-----------------------------------------------------------------*/ + +static void +free_stack_parameters (int Parameter_count) +{ + if (Parameter_count < 1) + { + return; + } + + if (Parameter_count == 1) + { + pic16_emitpcode (POC_MOVF, pic16_popCopyReg (pic16_stack_postinc)); + } + else if (Parameter_count == 2) + { + pic16_emitpcode (POC_MOVF, pic16_popCopyReg (pic16_stack_postinc)); + pic16_emitpcode (POC_MOVF, pic16_popCopyReg (pic16_stack_postinc)); + } + else + { + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (Parameter_count)); + pic16_emitpcode (POC_ADDWF, pic16_popCopyReg (pic16_stackpnt_lo)); // &pic16_pc_fsr1l)); + + if (STACK_MODEL_LARGE) + { + emitSKPNC; + pic16_emitpcode (POC_INCF, pic16_popCopyReg (pic16_stackpnt_hi)); // &pic16_pc_fsr1h)); + } + } +} /*-----------------------------------------------------------------*/ /* assignResultValue - assign results to oper, rescall==1 is */ /* called from genCall() or genPcall() */ /*-----------------------------------------------------------------*/ -static void assignResultValue(operand * oper, int res_size, int rescall) +static void +assignResultValue (operand * oper, int res_size, int rescall) { - int size = AOP_SIZE(oper); - int offset=0; + int size = AOP_SIZE (oper); + int offset = 0; - FENTRY2; + FENTRY2; // DEBUGpic16_emitcode ("; ***","%s %d rescall:%d size:%d",__FUNCTION__,__LINE__,rescall,size); // patch 14 - DEBUGpic16_pic16_AopType(__LINE__,oper,NULL,NULL); + DEBUGpic16_pic16_AopType (__LINE__, oper, NULL, NULL); - if(rescall) { + if (rescall) + { /* assign result from a call/pcall function() */ /* function results are stored in a special order, * see top of file with Function return policy, or manual */ - if(size <= 4) { - /* 8-bits, result in WREG */ - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(oper), 0)); + if (size <= 4) + { + /* 8-bits, result in WREG */ + if (AOP_TYPE(oper) != AOP_ACC) + { + /* If destination NOT WREG. */ + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (oper), 0)); + } + else + { + DEBUGpic16_emitcode ("; ***", "ignore MOVWF\tWREG", __FUNCTION__, __LINE__); + } - if(size > 1 && res_size > 1) { - /* 16-bits, result in PRODL:WREG */ - pic16_loadFromReturn(oper, 1, pic16_popCopyReg(&pic16_pc_prodl)); - } + if (size > 1 && res_size > 1) + { + /* 16-bits, result in PRODL:WREG */ + pic16_loadFromReturn (oper, 1, pic16_popCopyReg (&pic16_pc_prodl)); + } - if(size > 2 && res_size > 2) { - /* 24-bits, result in PRODH:PRODL:WREG */ - pic16_loadFromReturn(oper, 2, pic16_popCopyReg(&pic16_pc_prodh)); // patch 14 - } + if (size > 2 && res_size > 2) + { + /* 24-bits, result in PRODH:PRODL:WREG */ + pic16_loadFromReturn (oper, 2, pic16_popCopyReg (&pic16_pc_prodh)); // patch 14 + } - if(size > 3 && res_size > 3) { - /* 32-bits, result in FSR0L:PRODH:PRODL:WREG */ - pic16_loadFromReturn(oper, 3, pic16_popCopyReg(&pic16_pc_fsr0l)); // patch14 - } + if (size > 3 && res_size > 3) + { + /* 32-bits, result in FSR0L:PRODH:PRODL:WREG */ + pic16_loadFromReturn (oper, 3, pic16_popCopyReg (&pic16_pc_fsr0l)); // patch14 + } - pic16_addSign(oper, res_size, IS_UNSIGNED(operandType(oper))); + pic16_addSign (oper, res_size, IS_UNSIGNED (operandType (oper))); - } else { - /* >32-bits, result on stack, and FSR0 points to beginning. - * Fix stack when done */ - /* FIXME FIXME */ + } + else + { + /* >32-bits, result on stack, and FSR0 points to beginning. + * Fix stack when done */ + /* FIXME FIXME */ // debugf("WARNING: Possible bug when returning more than 4-bytes\n"); - while (size--) { + while (size--) + { // DEBUGpic16_emitcode("; ", "POC_MOVLW %d", GpsuedoStkPtr); // DEBUGpic16_emitcode("; ", "POC_MOVFW PLUSW2"); - popaopidx(AOP(oper), size, GpsuedoStkPtr); - GpsuedoStkPtr++; - } + popaopidx (AOP (oper), size, GpsuedoStkPtr); + GpsuedoStkPtr++; + } - /* fix stack */ - pic16_emitpcode(POC_MOVLW, pic16_popGetLit( AOP_SIZE(oper) )); - pic16_emitpcode(POC_ADDWF, pic16_popCopyReg( pic16_stackpnt_lo )); //&pic16_pc_fsr1l )); - if(STACK_MODEL_LARGE) { - emitSKPNC; - pic16_emitpcode(POC_INCF, pic16_popCopyReg( pic16_stackpnt_hi )); //&pic16_pc_fsr1h )); + /* fix stack */ + free_stack_parameters (AOP_SIZE (oper)); } - } - } else { + } + else + { int areg = 0; /* matching argument register */ // debugf("_G.useWreg = %d\tGpsuedoStkPtr = %d\n", _G.useWreg, GpsuedoStkPtr); - areg = SPEC_ARGREG( OP_SYM_ETYPE( oper ) ) - 1; + areg = SPEC_ARGREG (OP_SYM_ETYPE (oper)) - 1; /* its called from genReceive (probably) -- VR */ /* I hope this code will not be called from somewhere else in the future! * We manually set the pseudo stack pointer in genReceive. - dw */ - if(!GpsuedoStkPtr && _G.useWreg) { + if (!GpsuedoStkPtr && _G.useWreg) + { // DEBUGpic16_emitcode("; ", "pop %d", GpsuedoStkPtr); - /* The last byte in the assignment is in W */ - if(areg <= GpsuedoStkPtr) { - size--; - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(oper), offset /*size*/)); - offset++; + /* The last byte in the assignment is in W */ + if (areg <= GpsuedoStkPtr) + { + size--; + + if (AOP_TYPE(oper) != AOP_ACC) + { + /* If destination NOT WREG. */ + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (oper), offset /*size*/)); + } + else + { + DEBUGpic16_emitcode ("; ***", "ignore MOVWF\tWREG", __FUNCTION__, __LINE__); + } + + offset++; // debugf("receive from WREG\n", 0); + } + GpsuedoStkPtr++; /* otherwise the calculation below fails (-_G.useWreg) */ } - GpsuedoStkPtr++; /* otherwise the calculation below fails (-_G.useWreg) */ - } // GpsuedoStkPtr++; - _G.stack_lat = AOP_SIZE(oper)-1; + _G.stack_lat = AOP_SIZE (oper) - 1; - while (size) { - size--; - GpsuedoStkPtr++; - popaopidx(AOP(oper), offset, GpsuedoStkPtr - _G.useWreg); + while (size) + { + size--; + GpsuedoStkPtr++; + popaopidx (AOP (oper), offset, GpsuedoStkPtr - _G.useWreg); // debugf("receive from STACK\n", 0); - offset++; - } + offset++; + } } } @@ -2505,261 +2830,267 @@ /*-----------------------------------------------------------------*/ /* genIpush - generate code for pushing this gets a little complex */ /*-----------------------------------------------------------------*/ -static void genIpush (iCode *ic) +static void +genIpush (iCode * ic) { // int size, offset=0; FENTRY; - DEBUGpic16_emitcode ("; ***","%s %d - WARNING no code generated",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d - WARNING no code generated", __FUNCTION__, __LINE__); - if(ic->parmPush) { - pic16_aopOp(IC_LEFT(ic), ic, FALSE ); + if (ic->parmPush) + { + pic16_aopOp (IC_LEFT (ic), ic, FALSE); - /* send to stack as normal */ - addSet(&_G.sendSet,ic); + /* send to stack as normal */ + addSet (&_G.sendSet, ic); // addSetHead(&_G.sendSet,ic); - pic16_freeAsmop(IC_LEFT(ic),NULL,ic,TRUE); - } + pic16_freeAsmop (IC_LEFT (ic), NULL, ic, TRUE); + } #if 0 - int size, offset = 0 ; - char *l; + int size, offset = 0; + char *l; - /* if this is not a parm push : ie. it is spill push - and spill push is always done on the local stack */ - if (!ic->parmPush) { + /* if this is not a parm push : ie. it is spill push + and spill push is always done on the local stack */ + if (!ic->parmPush) + { - /* and the item is spilt then do nothing */ - if (OP_SYMBOL(IC_LEFT(ic))->isspilt) - return ; + /* and the item is spilt then do nothing */ + if (OP_SYMBOL (IC_LEFT (ic))->isspilt) + return; - pic16_aopOp(IC_LEFT(ic),ic,FALSE); - size = AOP_SIZE(IC_LEFT(ic)); - /* push it on the stack */ - while(size--) { - l = pic16_aopGet(AOP(IC_LEFT(ic)),offset++,FALSE,TRUE); - if (*l == '#') { - MOVA(l); - l = "acc"; + pic16_aopOp (IC_LEFT (ic), ic, FALSE); + size = AOP_SIZE (IC_LEFT (ic)); + /* push it on the stack */ + while (size--) + { + l = pic16_aopGet (AOP (IC_LEFT (ic)), offset++, FALSE, TRUE); + if (*l == '#') + { + MOVA (l); + l = "acc"; } - pic16_emitcode("push","%s",l); + pic16_emitcode ("push", "%s", l); } - return ; + return; } - pic16_freeAsmop(IC_LEFT(ic),NULL,ic,TRUE); + pic16_freeAsmop (IC_LEFT (ic), NULL, ic, TRUE); #endif } /*-----------------------------------------------------------------*/ /* genIpop - recover the registers: can happen only for spilling */ /*-----------------------------------------------------------------*/ -static void genIpop (iCode *ic) +static void +genIpop (iCode * ic) { FENTRY; - DEBUGpic16_emitcode ("; ***","%s %d - WARNING no code generated",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d - WARNING no code generated", __FUNCTION__, __LINE__); #if 0 - int size,offset ; + int size, offset; - /* if the temp was not pushed then */ - if (OP_SYMBOL(IC_LEFT(ic))->isspilt) - return ; + /* if the temp was not pushed then */ + if (OP_SYMBOL (IC_LEFT (ic))->isspilt) + return; - pic16_aopOp(IC_LEFT(ic),ic,FALSE); - size = AOP_SIZE(IC_LEFT(ic)); - offset = (size-1); - while (size--) - pic16_emitcode("pop","%s",pic16_aopGet(AOP(IC_LEFT(ic)),offset--, - FALSE,TRUE)); + pic16_aopOp (IC_LEFT (ic), ic, FALSE); + size = AOP_SIZE (IC_LEFT (ic)); + offset = (size - 1); + while (size--) + pic16_emitcode ("pop", "%s", pic16_aopGet (AOP (IC_LEFT (ic)), offset--, FALSE, TRUE)); - pic16_freeAsmop(IC_LEFT(ic),NULL,ic,TRUE); + pic16_freeAsmop (IC_LEFT (ic), NULL, ic, TRUE); #endif } -static int wparamCmp(void *p1, void *p2) +static int +wparamCmp (void *p1, void *p2) { - return (!strcmp((char *)p1, (char *)p2)); + return (!strcmp ((char *) p1, (char *) p2)); } -int inWparamList(char *s) +int +inWparamList (char *s) { - return isinSetWith(wparamList, s, wparamCmp); + return isinSetWith (wparamList, s, wparamCmp); } /*-----------------------------------------------------------------*/ /* genCall - generates a call statement */ /*-----------------------------------------------------------------*/ -static void genCall (iCode *ic) +static void +genCall (iCode * ic) { sym_link *ftype; - int stackParms=0; - int use_wreg=0; - int inwparam=0; + int stackParms = 0; + int use_wreg = 0; + int inwparam = 0; char *fname; - FENTRY; + FENTRY; - ftype = OP_SYM_TYPE(IC_LEFT(ic)); - /* if caller saves & we have not saved then */ + ftype = OP_SYM_TYPE (IC_LEFT (ic)); + /* if caller saves & we have not saved then */ // if (!ic->regsSaved) // saveRegisters(ic); - /* initialise stackParms for IPUSH pushes */ + /* initialise stackParms for IPUSH pushes */ // stackParms = psuedoStkPtr; // fprintf(stderr, "%s:%d ic parmBytes = %d\n", __FILE__, __LINE__, ic->parmBytes); - fname = OP_SYMBOL(IC_LEFT(ic))->rname[0]?OP_SYMBOL(IC_LEFT(ic))->rname:OP_SYMBOL(IC_LEFT(ic))->name; - inwparam = (inWparamList(OP_SYMBOL(IC_LEFT(ic))->name)) || (FUNC_ISWPARAM(OP_SYM_TYPE(IC_LEFT(ic)))); + fname = OP_SYMBOL (IC_LEFT (ic))->rname[0] ? OP_SYMBOL (IC_LEFT (ic))->rname : OP_SYMBOL (IC_LEFT (ic))->name; + inwparam = (inWparamList (OP_SYMBOL (IC_LEFT (ic))->name)) || (FUNC_ISWPARAM (OP_SYM_TYPE (IC_LEFT (ic)))); #if 0 - gpsimDebug_StackDump(__FILE__, __LINE__, fname ); + gpsimDebug_StackDump (__FILE__, __LINE__, fname); #endif - /* if send set is not empty the assign */ - if (_G.sendSet) { + /* if send set is not empty the assign */ + if (_G.sendSet) + { iCode *sic; - int psuedoStkPtr=-1; + int psuedoStkPtr = -1; int firstTimeThruLoop = 1; - /* reverse sendSet if function is not reentrant */ - if(!IFFUNC_ISREENT(ftype)) - _G.sendSet = reverseSet(_G.sendSet); + /* reverse sendSet if function is not reentrant */ + if (!IFFUNC_ISREENT (ftype)) + _G.sendSet = reverseSet (_G.sendSet); - /* First figure how many parameters are getting passed */ - stackParms = 0; - use_wreg = 0; + /* First figure how many parameters are getting passed */ + stackParms = 0; + use_wreg = 0; - for (sic = setFirstItem(_G.sendSet) ; sic ; sic = setNextItem(_G.sendSet)) { + for (sic = setFirstItem (_G.sendSet); sic; sic = setNextItem (_G.sendSet)) + { int size; // int offset = 0; - pic16_aopOp(IC_LEFT(sic),sic,FALSE); - size = AOP_SIZE(IC_LEFT(sic)); + pic16_aopOp (IC_LEFT (sic), sic, FALSE); + size = AOP_SIZE (IC_LEFT (sic)); + + stackParms += size; - stackParms += size; + /* pass the last byte through WREG */ + if (inwparam) + { - /* pass the last byte through WREG */ - if(inwparam) { + while (size--) + { + DEBUGpic16_emitcode ("; ", "%d left %s", __LINE__, pic16_AopType (AOP_TYPE (IC_LEFT (sic)))); + DEBUGpic16_emitcode ("; ", "push %d", psuedoStkPtr - 1); - while (size--) { - DEBUGpic16_emitcode ("; ","%d left %s",__LINE__, - pic16_AopType(AOP_TYPE(IC_LEFT(sic)))); - DEBUGpic16_emitcode("; ", "push %d", psuedoStkPtr-1); - - if(!firstTimeThruLoop) { - /* If this is not the first time we've been through the loop - * then we need to save the parameter in a temporary - * register. The last byte of the last parameter is - * passed in W. */ + if (!firstTimeThruLoop) + { + /* If this is not the first time we've been through the loop + * then we need to save the parameter in a temporary + * register. The last byte of the last parameter is + * passed in W. */ - pushw(); + pushw (); // --psuedoStkPtr; // sanity check - use_wreg = 1; - } + use_wreg = 1; + } - firstTimeThruLoop=0; + firstTimeThruLoop = 0; - pic16_mov2w (AOP(IC_LEFT(sic)), size); + pic16_mov2w (AOP (IC_LEFT (sic)), size); // offset++; - } - } else { + } + } + else + { /* all arguments are passed via stack */ use_wreg = 0; - while (size--) { - DEBUGpic16_emitcode ("; ","%d left %s",__LINE__, - pic16_AopType(AOP_TYPE(IC_LEFT(sic)))); - DEBUGpic16_emitcode("; ", "push %d", psuedoStkPtr-1); + while (size--) + { + DEBUGpic16_emitcode ("; ", "%d left %s", __LINE__, pic16_AopType (AOP_TYPE (IC_LEFT (sic)))); + DEBUGpic16_emitcode ("; ", "push %d", psuedoStkPtr - 1); // pushaop(AOP(IC_LEFT(sic)), size); - pic16_mov2w( AOP(IC_LEFT(sic)), size ); + pic16_mov2w (AOP (IC_LEFT (sic)), size); - if(!_G.resDirect) - pushw(); - } + if (!_G.resDirect) + pushw (); + } } - pic16_freeAsmop (IC_LEFT(sic),NULL,sic,TRUE); - } + pic16_freeAsmop (IC_LEFT (sic), NULL, sic, TRUE); + } - if(inwparam) { - if(IFFUNC_HASVARARGS(ftype) || IFFUNC_ISREENT(ftype)) { - pushw(); /* save last parameter to stack if functions has varargs */ + if (inwparam) + { + if (IFFUNC_HASVARARGS (ftype) || IFFUNC_ISREENT (ftype)) + { + pushw (); /* save last parameter to stack if functions has varargs */ use_wreg = 0; - } else - use_wreg = 1; - } else use_wreg = 0; + } + else + use_wreg = 1; + } + else + use_wreg = 0; - _G.stackRegSet = _G.sendSet; - _G.sendSet = NULL; + _G.stackRegSet = _G.sendSet; + _G.sendSet = NULL; } - /* make the call */ - pic16_emitpcode(POC_CALL,pic16_popGetWithString(fname)); + /* make the call */ + pic16_emitpcode (POC_CALL, pic16_popGetWithString (fname)); - GpsuedoStkPtr=0; + GpsuedoStkPtr = 0; - /* if we need to assign a result value */ - if ((IS_ITEMP(IC_RESULT(ic)) - && (OP_SYMBOL(IC_RESULT(ic))->nRegs - || OP_SYMBOL(IC_RESULT(ic))->spildir )) - || IS_TRUE_SYMOP(IC_RESULT(ic)) ) { + /* if we need to assign a result value */ + if ((IS_ITEMP (IC_RESULT (ic)) + && (OP_SYMBOL (IC_RESULT (ic))->nRegs || OP_SYMBOL (IC_RESULT (ic))->spildir)) || IS_TRUE_SYMOP (IC_RESULT (ic))) + { _G.accInUse++; - pic16_aopOp(IC_RESULT(ic),ic,FALSE); + pic16_aopOp (IC_RESULT (ic), ic, FALSE); _G.accInUse--; /* Must not assign an 8-bit result to a 16-bit variable; * this would use (used...) the uninitialized PRODL! */ /* FIXME: Need a proper way to obtain size of function result type, * OP_SYM_ETYPE does not work: it dereferences pointer types! */ - assignResultValue(IC_RESULT(ic), getSize(OP_SYM_TYPE(IC_LEFT(ic))->next), 1); + assignResultValue (IC_RESULT (ic), getSize (OP_SYM_TYPE (IC_LEFT (ic))->next), 1); - DEBUGpic16_emitcode ("; ","%d left %s",__LINE__, - pic16_AopType(AOP_TYPE(IC_RESULT(ic)))); + DEBUGpic16_emitcode ("; ", "%d left %s", __LINE__, pic16_AopType (AOP_TYPE (IC_RESULT (ic)))); - pic16_freeAsmop(IC_RESULT(ic),NULL, ic,TRUE); + pic16_freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); } - if(!stackParms && ic->parmBytes) { + if (!stackParms && ic->parmBytes) + { stackParms = ic->parmBytes; } - stackParms -= use_wreg; - - if(stackParms>0) { - if(stackParms == 1) { - pic16_emitpcode(POC_INCF, pic16_popCopyReg(pic16_stackpnt_lo )); //&pic16_pc_fsr1l)); - } else { - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(stackParms)); - pic16_emitpcode(POC_ADDWF, pic16_popCopyReg( pic16_stackpnt_lo )); //&pic16_pc_fsr1l )); - } - if(STACK_MODEL_LARGE) { - emitSKPNC; - pic16_emitpcode(POC_INCF, pic16_popCopyReg( pic16_stackpnt_hi )); //&pic16_pc_fsr1h )); - } - } + stackParms -= use_wreg; + free_stack_parameters (stackParms); #if 0 - gpsimDebug_StackDump(__FILE__, __LINE__, fname); + gpsimDebug_StackDump (__FILE__, __LINE__, fname); #endif - /* adjust the stack for parameters if required */ + /* adjust the stack for parameters if required */ // fprintf(stderr, "%s:%d: %s ic->parmBytes= %d\n", __FILE__, __LINE__, OP_SYMBOL(IC_LEFT(ic))->name, ic->parmBytes); #if 0 - /* if register bank was saved then pop them */ - if (ic->bankSaved) - unsaverbank(FUNC_REGBANK(dtype),ic,TRUE); - - /* if we hade saved some registers then unsave them */ - if (ic->regsSaved && !IFFUNC_CALLEESAVES(dtype)) - unsaveRegisters (ic); + /* if register bank was saved then pop them */ + if (ic->bankSaved) + unsaverbank (FUNC_REGBANK (dtype), ic, TRUE); + + /* if we hade saved some registers then unsave them */ + if (ic->regsSaved && !IFFUNC_CALLEESAVES (dtype)) + unsaveRegisters (ic); #endif } @@ -2769,138 +3100,134 @@ /* genPcall - generates a call by pointer statement */ /* new version, created from genCall - HJD */ /*-----------------------------------------------------------------*/ -static void genPcall (iCode *ic) +static void +genPcall (iCode * ic) { sym_link *fntype; - int stackParms=0; - symbol *retlbl = newiTempLabel(NULL); - pCodeOp *pcop_lbl = pic16_popGetLabel(retlbl->key); + int stackParms = 0; + symbol *retlbl = newiTempLabel (NULL); + pCodeOp *pcop_lbl = pic16_popGetLabel (retlbl->key); - FENTRY; + FENTRY; - fntype = operandType( IC_LEFT(ic) )->next; + fntype = operandType (IC_LEFT (ic))->next; - /* if send set is not empty the assign */ - if (_G.sendSet) { + /* if send set is not empty the assign */ + if (_G.sendSet) + { iCode *sic; - int psuedoStkPtr=-1; + int psuedoStkPtr = -1; /* reverse sendSet if function is not reentrant */ - if(!IFFUNC_ISREENT(fntype)) - _G.sendSet = reverseSet(_G.sendSet); + if (!IFFUNC_ISREENT (fntype)) + _G.sendSet = reverseSet (_G.sendSet); stackParms = 0; - for (sic = setFirstItem(_G.sendSet) ; sic ; sic = setNextItem(_G.sendSet)) { - int size; + for (sic = setFirstItem (_G.sendSet); sic; sic = setNextItem (_G.sendSet)) + { + int size; - pic16_aopOp(IC_LEFT(sic),sic,FALSE); - size = AOP_SIZE(IC_LEFT(sic)); + pic16_aopOp (IC_LEFT (sic), sic, FALSE); + size = AOP_SIZE (IC_LEFT (sic)); stackParms += size; /* all parameters are passed via stack, since WREG is clobbered * by the calling sequence */ - while (size--) { - DEBUGpic16_emitcode ("; ","%d left %s",__LINE__, - pic16_AopType(AOP_TYPE(IC_LEFT(sic)))); - DEBUGpic16_emitcode("; ", "push %d", psuedoStkPtr-1); + while (size--) + { + DEBUGpic16_emitcode ("; ", "%d left %s", __LINE__, pic16_AopType (AOP_TYPE (IC_LEFT (sic)))); + DEBUGpic16_emitcode ("; ", "push %d", psuedoStkPtr - 1); - pic16_mov2w (AOP(IC_LEFT(sic)), size); - pushw(); - } + pic16_mov2w (AOP (IC_LEFT (sic)), size); + pushw (); + } - pic16_freeAsmop (IC_LEFT(sic),NULL,sic,TRUE); - } + pic16_freeAsmop (IC_LEFT (sic), NULL, sic, TRUE); + } _G.stackRegSet = _G.sendSet; _G.sendSet = NULL; } - pic16_aopOp(IC_LEFT(ic),ic,FALSE); + pic16_aopOp (IC_LEFT (ic), ic, FALSE); + + // push return address + // push $ on return stack, then replace with retlbl + + /* Thanks to Thorsten Klose for pointing out that the following + * snippet should be interrupt safe */ + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popCopyReg (&pic16_pc_intcon), pic16_popCopyReg (&pic16_pc_postdec1))); + pic16_emitpcode (POC_BCF, pic16_popCopyGPR2Bit (pic16_popCopyReg (&pic16_pc_intcon), 7)); + + pic16_emitpcodeNULLop (POC_PUSH); + + pic16_emitpcode (POC_MOVLW, pic16_popGetImmd (pcop_lbl->name, 0, 0)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_tosl)); + pic16_emitpcode (POC_MOVLW, pic16_popGetImmd (pcop_lbl->name, 1, 0)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_tosh)); + pic16_emitpcode (POC_MOVLW, pic16_popGetImmd (pcop_lbl->name, 2, 0)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_tosu)); + + /* Conditionally re-enable interrupts, but keep interrupt flags in + * INTCON intact (thanks to J. van der Boon, #3420588). */ + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (pic16_popCopyReg (&pic16_pc_preinc1), 7)); + pic16_emitpcode (POC_BSF, pic16_popCopyGPR2Bit (pic16_popCopyReg (&pic16_pc_intcon), 7)); + + /* make the call by writing the pointer into pc */ + mov2fp (pic16_popCopyReg (&pic16_pc_pclatu), AOP (IC_LEFT (ic)), 2); + mov2fp (pic16_popCopyReg (&pic16_pc_pclath), AOP (IC_LEFT (ic)), 1); - // push return address - // push $ on return stack, then replace with retlbl + // note: MOVFF to PCL not allowed + pic16_mov2w (AOP (IC_LEFT (ic)), 0); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_pcl)); - /* Thanks to Thorsten Klose for pointing out that the following - * snippet should be interrupt safe */ - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popCopyReg(&pic16_pc_intcon), pic16_popCopyReg(&pic16_pc_postdec1))); - pic16_emitpcode(POC_BCF, pic16_popCopyGPR2Bit(pic16_popCopyReg(&pic16_pc_intcon), 7)); - - pic16_emitpcodeNULLop(POC_PUSH); - - pic16_emitpcode(POC_MOVLW, pic16_popGetImmd(pcop_lbl->name, 0, 0)); - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_tosl)); - pic16_emitpcode(POC_MOVLW, pic16_popGetImmd(pcop_lbl->name, 1, 0)); - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_tosh)); - pic16_emitpcode(POC_MOVLW, pic16_popGetImmd(pcop_lbl->name, 2, 0)); - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_tosu)); - - /* Conditionally re-enable interrupts, but keep interrupt flags in - * INTCON intact (thanks to J. van der Boon, #3420588). */ - pic16_emitpcode(POC_BTFSC, pic16_popCopyGPR2Bit(pic16_popCopyReg(&pic16_pc_preinc1), 7)); - pic16_emitpcode(POC_BSF, pic16_popCopyGPR2Bit(pic16_popCopyReg(&pic16_pc_intcon), 7)); - - /* make the call by writing the pointer into pc */ - mov2fp(pic16_popCopyReg(&pic16_pc_pclatu), AOP(IC_LEFT(ic)), 2); - mov2fp(pic16_popCopyReg(&pic16_pc_pclath), AOP(IC_LEFT(ic)), 1); - - // note: MOVFF to PCL not allowed - pic16_mov2w(AOP(IC_LEFT(ic)), 0); - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_pcl)); - - - /* return address is here: (X) */ - pic16_emitpLabelFORCE(retlbl->key); - - pic16_freeAsmop (IC_LEFT(ic),NULL,ic,TRUE); - - GpsuedoStkPtr=0; - /* if we need assign a result value */ - if ((IS_ITEMP(IC_RESULT(ic)) - && (OP_SYMBOL(IC_RESULT(ic))->nRegs - || OP_SYMBOL(IC_RESULT(ic))->spildir )) - || IS_TRUE_SYMOP(IC_RESULT(ic)) ) { + + /* return address is here: (X) */ + pic16_emitpLabelFORCE (retlbl->key); + + pic16_freeAsmop (IC_LEFT (ic), NULL, ic, TRUE); + + GpsuedoStkPtr = 0; + /* if we need assign a result value */ + if ((IS_ITEMP (IC_RESULT (ic)) + && (OP_SYMBOL (IC_RESULT (ic))->nRegs || OP_SYMBOL (IC_RESULT (ic))->spildir)) || IS_TRUE_SYMOP (IC_RESULT (ic))) + { _G.accInUse++; - pic16_aopOp(IC_RESULT(ic),ic,FALSE); + pic16_aopOp (IC_RESULT (ic), ic, FALSE); _G.accInUse--; /* FIXME: Need proper way to obtain the function result's type. * OP_SYM_TYPE(IC_LEFT(ic))->next does not work --> points to function pointer */ - assignResultValue(IC_RESULT(ic), getSize(OP_SYM_TYPE(IC_LEFT(ic))->next->next), 1); + assignResultValue (IC_RESULT (ic), getSize (OP_SYM_TYPE (IC_LEFT (ic))->next->next), 1); - DEBUGpic16_emitcode ("; ","%d left %s",__LINE__, - pic16_AopType(AOP_TYPE(IC_RESULT(ic)))); + DEBUGpic16_emitcode ("; ", "%d left %s", __LINE__, pic16_AopType (AOP_TYPE (IC_RESULT (ic)))); - pic16_freeAsmop(IC_RESULT(ic),NULL, ic,TRUE); + pic16_freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); } // stackParms -= use_wreg; - if(stackParms>0) { - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(stackParms)); - pic16_emitpcode(POC_ADDWF, pic16_popCopyReg( pic16_stackpnt_lo )); - if(STACK_MODEL_LARGE) { - emitSKPNC; - pic16_emitpcode(POC_INCF, pic16_popCopyReg( pic16_stackpnt_hi )); - } - } + free_stack_parameters (stackParms); } /*-----------------------------------------------------------------*/ /* resultRemat - result is rematerializable */ /*-----------------------------------------------------------------*/ -static int resultRemat (iCode *ic) +static int +resultRemat (iCode * ic) { // DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if (SKIP_IC(ic) || ic->op == IFX) + if (SKIP_IC (ic) || ic->op == IFX) return 0; - if (IC_RESULT(ic) && IS_ITEMP(IC_RESULT(ic))) { - symbol *sym = OP_SYMBOL(IC_RESULT(ic)); - if (sym->remat && !POINTER_SET(ic)) - return 1; - } + if (IC_RESULT (ic) && IS_ITEMP (IC_RESULT (ic))) + { + symbol *sym = OP_SYMBOL (IC_RESULT (ic)); + if (sym->remat && !POINTER_SET (ic)) + return 1; + } return 0; } @@ -2909,559 +3236,639 @@ /*-----------------------------------------------------------------*/ /* inExcludeList - return 1 if the string is in exclude Reg list */ /*-----------------------------------------------------------------*/ -static bool inExcludeList(char *s) +static bool +inExcludeList (char *s) { - DEBUGpic16_emitcode ("; ***","%s %d - WARNING no code generated",__FUNCTION__,__LINE__); - int i =0; + DEBUGpic16_emitcode ("; ***", "%s %d - WARNING no code generated", __FUNCTION__, __LINE__); + int i = 0; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if (options.excludeRegs[i] && - STRCASECMP(options.excludeRegs[i],"none") == 0) - return FALSE ; - - for ( i = 0 ; options.excludeRegs[i]; i++) { - if (options.excludeRegs[i] && - STRCASECMP(s,options.excludeRegs[i]) == 0) - return TRUE; + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + if (options.excludeRegs[i] && STRCASECMP (options.excludeRegs[i], "none") == 0) + return FALSE; + + for (i = 0; options.excludeRegs[i]; i++) + { + if (options.excludeRegs[i] && STRCASECMP (s, options.excludeRegs[i]) == 0) + return TRUE; } - return FALSE ; + return FALSE; } #endif /*-----------------------------------------------------------------*/ /* genFunction - generated code for function entry */ /*-----------------------------------------------------------------*/ -static void genFunction (iCode *ic) +static void +genFunction (iCode * ic) { symbol *sym; sym_link *ftype; - FENTRY; - DEBUGpic16_emitcode ("; ***","%s %d curr label offset=%dprevious max_key=%d ",__FUNCTION__,__LINE__,pic16_labelOffset,max_key); + FENTRY; + DEBUGpic16_emitcode ("; ***", "%s %d curr label offset=%dprevious max_key=%d ", __FUNCTION__, __LINE__, pic16_labelOffset, + max_key); - pic16_labelOffset += (max_key+4); - max_key=0; - GpsuedoStkPtr=0; - _G.nRegsSaved = 0; + pic16_labelOffset += (max_key + 4); + max_key = 0; + GpsuedoStkPtr = 0; + _G.nRegsSaved = 0; - ftype = operandType(IC_LEFT(ic)); - sym = OP_SYMBOL(IC_LEFT(ic)); + ftype = operandType (IC_LEFT (ic)); + sym = OP_SYMBOL (IC_LEFT (ic)); - if(IFFUNC_ISISR(sym->type /*ftype*/)) { + if (IFFUNC_ISISR (sym->type)) + { /* create an absolute section at the interrupt vector: * that is 0x0008 for interrupt 1 (high), 0x0018 interrupt 2 (low) */ symbol *asym; char asymname[128]; pBlock *apb; -// debugf("interrupt number: %hhi\n", FUNC_INTNO(sym->type)); + //debugf ("interrupt number: %hhi\n", FUNC_INTNO (sym->type)); - if(FUNC_INTNO(sym->type) == INTNO_UNSPEC) - sprintf(asymname, "ivec_%s", sym->name); - else - sprintf(asymname, "ivec_0x%x_%s", FUNC_INTNO(sym->type), sym->name); - - /* when an interrupt is declared as naked, do not emit the special - * wrapper segment at vector address. The user should take care for - * this instead. -- VR */ - - if(!IFFUNC_ISNAKED(ftype) && (FUNC_INTNO(sym->type) != INTNO_UNSPEC)) { - asym = newSymbol(asymname, 0); - apb = pic16_newpCodeChain(NULL, 'A', pic16_newpCodeCharP("; Starting pCode block for absolute section")); - pic16_addpBlock( apb ); - - pic16_addpCode2pBlock(apb, pic16_newpCodeCharP(";-----------------------------------------")); - pic16_addpCode2pBlock(apb, pic16_newpCodeFunction(moduleName, asym->name)); - //pic16_addpCode2pBlock(apb, pic16_newpCode(POC_GOTO, pic16_popGetWithString( sym->rname ))); - //pic16_addpCode2pBlock(apb, pic16_newpCode(POC_GOTO, pic16_newpCodeOpLabel (sym->rname, 0))); - pic16_addpCode2pBlock(apb, pic16_newpCodeAsmDir ("GOTO", "%s", sym->rname)); /* this suppresses a warning in LinkFlow */ + if (FUNC_INTNO (sym->type) == INTNO_UNSPEC) + sprintf (asymname, "ivec_%s", sym->name); + else + sprintf (asymname, "ivec_0x%x_%s", FUNC_INTNO (sym->type), sym->name); - /* mark the end of this tiny function */ - pic16_addpCode2pBlock(apb,pic16_newpCodeFunction(NULL,NULL)); - } else { - sprintf(asymname, "%s", sym->rname); - } + /* when an interrupt is declared as naked, do not emit the special + * wrapper segment at vector address. The user should take care for + * this instead. -- VR */ + if (!IFFUNC_ISNAKED (ftype) && (FUNC_INTNO (sym->type) != INTNO_UNSPEC)) { - absSym *abSym; - - abSym = Safe_calloc(1, sizeof(absSym)); - strcpy(abSym->name, asymname); - - switch( FUNC_INTNO(sym->type) ) { - case 0: abSym->address = 0x000000; break; - case 1: abSym->address = 0x000008; break; - case 2: abSym->address = 0x000018; break; - - default: -// fprintf(stderr, "no interrupt number is given\n"); - abSym->address = -1; break; - } + asym = newSymbol (asymname, 0); + apb = pic16_newpCodeChain (NULL, 'A', pic16_newpCodeCharP ("; Starting pCode block for absolute section")); + pic16_addpBlock (apb); + + pic16_addpCode2pBlock (apb, pic16_newpCodeCharP (";-----------------------------------------")); + pic16_addpCode2pBlock (apb, pic16_newpCodeFunction (moduleName, asym->name)); + //pic16_addpCode2pBlock (apb, pic16_newpCode (POC_GOTO, pic16_popGetWithString (sym->rname))); + //pic16_addpCode2pBlock (apb, pic16_newpCode (POC_GOTO, pic16_newpCodeOpLabel (sym->rname, 0))); + pic16_addpCode2pBlock (apb, pic16_newpCodeAsmDir ("GOTO", "%s", sym->rname)); /* this suppresses a warning in LinkFlow */ - /* relocate interrupt vectors if needed */ - if(abSym->address != -1) - abSym->address += pic16_options.ivt_loc; - - addSet(&absSymSet, abSym); + /* mark the end of this tiny function */ + pic16_addpCode2pBlock (apb, pic16_newpCodeFunction (NULL, NULL)); + } + else + { + sprintf (asymname, "%s", sym->rname); } - } - - /* create the function header */ - pic16_emitcode(";","-----------------------------------------"); - pic16_emitcode(";"," function %s",sym->name); - pic16_emitcode(";","-----------------------------------------"); - /* prevent this symbol from being emitted as 'extern' */ - pic16_stringInSet(sym->rname, &pic16_localFunctions, 1); + { + absSym *abSym; - pic16_emitcode("","%s:",sym->rname); - pic16_addpCode2pBlock(pb,pic16_newpCodeFunction(moduleName,sym->rname)); + abSym = Safe_calloc (1, sizeof (absSym)); + strcpy (abSym->name, asymname); - { - absSym *ab; - - for(ab = setFirstItem(absSymSet); ab; ab = setNextItem(absSymSet)) { - if(!strcmp(ab->name, sym->rname)) { - pic16_pBlockConvert2Absolute(pb); + switch (FUNC_INTNO (sym->type)) + { + case 0: + abSym->address = 0x000000; + break; + case 1: + abSym->address = 0x000008; + break; + case 2: + abSym->address = 0x000018; + break; + default: + //fprintf (stderr, "no interrupt number is given\n"); + abSym->address = -1; break; } - } - } - if(IFFUNC_ISNAKED(ftype)) { - DEBUGpic16_emitcode("; ***", "__naked function, no prologue"); - return; - } + /* relocate interrupt vectors if needed */ + if (abSym->address != -1) + abSym->address += pic16_options.ivt_loc; - /* if critical function then turn interrupts off */ - if (IFFUNC_ISCRITICAL(ftype)) { - //pic16_emitcode("clr","ea"); + addSet (&absSymSet, abSym); + } } - currFunc = sym; /* update the currFunc symbol */ - _G.fregsUsed = sym->regsUsed; - _G.sregsAlloc = newBitVect(128); + /* create the function header */ + pic16_emitcode (";", "-----------------------------------------"); + pic16_emitcode (";", " function %s", sym->name); + pic16_emitcode (";", "-----------------------------------------"); + + /* prevent this symbol from being emitted as 'extern' */ + pic16_stringInSet (sym->rname, &pic16_localFunctions, 1); + + pic16_emitcode ("", "%s:", sym->rname); + pic16_addpCode2pBlock (pb, pic16_newpCodeFunction (moduleName, sym->rname)); + + { + absSym *ab; + + for (ab = setFirstItem (absSymSet); ab; ab = setNextItem (absSymSet)) + { + if (!strcmp (ab->name, sym->rname)) + { + pic16_pBlockConvert2Absolute (pb); + break; + } + } + } + + currFunc = sym; /* update the currFunc symbol */ + _G.fregsUsed = sym->regsUsed; + _G.sregsAlloc = newBitVect (128); + if (IFFUNC_ISNAKED (ftype)) + { + DEBUGpic16_emitcode ("; ***", "__naked function, no prologue"); + return; + } - /* if this is an interrupt service routine then - * save wreg, status, bsr, prodl, prodh, fsr0l, fsr0h */ - if (IFFUNC_ISISR(sym->type)) { - _G.usefastretfie = 1; /* use shadow registers by default */ + /* if this is an interrupt service routine then + * save wreg, status, bsr, prodl, prodh, fsr0l, fsr0h */ + if (IFFUNC_ISISR (sym->type)) + { + _G.usefastretfie = 1; /* use shadow registers by default */ - /* an ISR should save: WREG, STATUS, BSR, PRODL, PRODH, FSR0L, FSR0H */ - if(!FUNC_ISSHADOWREGS(sym->type)) { - /* do not save WREG,STATUS,BSR for high priority interrupts + /* an ISR should save: WREG, STATUS, BSR, PRODL, PRODH, FSR0L, FSR0H */ + if (!FUNC_ISSHADOWREGS (sym->type)) + { + /* do not save WREG, STATUS, BSR for high priority interrupts * because they are stored in the hardware shadow registers already */ _G.usefastretfie = 0; - pic16_pushpCodeOp( pic16_popCopyReg( &pic16_pc_wreg )); - pic16_pushpCodeOp( pic16_popCopyReg( &pic16_pc_status )); - pic16_pushpCodeOp( pic16_popCopyReg( &pic16_pc_bsr )); - } - - /* these should really be optimized somehow, because not all - * interrupt handlers modify them */ - pic16_pushpCodeOp( pic16_popCopyReg( &pic16_pc_prodl )); - pic16_pushpCodeOp( pic16_popCopyReg( &pic16_pc_prodh )); - pic16_pushpCodeOp( pic16_popCopyReg( &pic16_pc_fsr0l )); - pic16_pushpCodeOp( pic16_popCopyReg( &pic16_pc_fsr0h )); - pic16_pushpCodeOp( pic16_popCopyReg( &pic16_pc_pclath )); - pic16_pushpCodeOp( pic16_popCopyReg( &pic16_pc_pclatu )); - -// pic16_pBlockConvert2ISR(pb); - } - - /* emit code to setup stack frame if user enabled, - * and function is not main() */ - -// debugf(stderr, "function name: %s ARGS=%p\n", sym->name, FUNC_ARGS(sym->type)); - if(strcmp(sym->name, "main")) { - if(0 - || !options.omitFramePtr -// || sym->regsUsed - || IFFUNC_ARGS(sym->type) - || FUNC_HASSTACKPARM(sym->etype) - ) { - /* setup the stack frame */ - if(STACK_MODEL_LARGE) - pic16_pushpCodeOp(pic16_popCopyReg(pic16_framepnt_hi)); - pic16_pushpCodeOp(pic16_popCopyReg(pic16_framepnt_lo)); - - if(STACK_MODEL_LARGE) - pic16_emitpcode(POC_MOVFF, pic16_popCombine2( pic16_stackpnt_hi, pic16_framepnt_hi, 0)); - pic16_emitpcode(POC_MOVFF, pic16_popCombine2( pic16_stackpnt_lo, pic16_framepnt_lo, 0)); - } + pic16_pushpCodeOp (pic16_popCopyReg (&pic16_pc_status)); + pic16_pushpCodeOp (pic16_popCopyReg (&pic16_pc_bsr)); + pushw (); + } + + /* these should really be optimized somehow, because not all + * interrupt handlers modify them */ + pic16_pushpCodeOp (pic16_popCopyReg (&pic16_pc_prodl)); + pic16_pushpCodeOp (pic16_popCopyReg (&pic16_pc_prodh)); + pic16_pushpCodeOp (pic16_popCopyReg (&pic16_pc_fsr0l)); + pic16_pushpCodeOp (pic16_popCopyReg (&pic16_pc_fsr0h)); + pic16_pushpCodeOp (pic16_popCopyReg (&pic16_pc_pclath)); + pic16_pushpCodeOp (pic16_popCopyReg (&pic16_pc_pclatu)); + + //pic16_pBlockConvert2ISR (pb); } - if ((IFFUNC_ISREENT(sym->type) || options.stackAuto) - && sym->stack) { + /* emit code to setup stack frame if user enabled, + * and function is not main () */ + + //debugf (stderr, "function name: %s ARGS=%p\n", sym->name, FUNC_ARGS (sym->type)); + if (strcmp (sym->name, "main")) + { + if (0 || !options.omitFramePtr + //|| sym->regsUsed + || IFFUNC_ARGS (sym->type) || FUNC_HASSTACKPARM (sym->etype)) + { + /* setup the stack frame */ + if (STACK_MODEL_LARGE) + pic16_pushpCodeOp (pic16_popCopyReg (pic16_framepnt_hi)); + pic16_pushpCodeOp (pic16_popCopyReg (pic16_framepnt_lo)); + + if (STACK_MODEL_LARGE) + pic16_emitpcode (POC_MOVFF, pic16_popCombine2 (pic16_stackpnt_hi, pic16_framepnt_hi, 0)); + pic16_emitpcode (POC_MOVFF, pic16_popCombine2 (pic16_stackpnt_lo, pic16_framepnt_lo, 0)); + } + } - if (sym->stack > 127)werror(W_STACK_OVERFLOW, sym->name); + if ((IFFUNC_ISREENT (sym->type) || options.stackAuto) && sym->stack) + { + if (sym->stack > 127) + werror (W_STACK_OVERFLOW, sym->name); - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(sym->stack)); - pic16_emitpcode(POC_SUBWF, pic16_popCopyReg( pic16_stackpnt_lo )); //&pic16_pc_fsr1l)); + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (sym->stack)); + pic16_emitpcode (POC_SUBWF, pic16_popCopyReg (pic16_stackpnt_lo)); //&pic16_pc_fsr1l)); emitSKPC; - pic16_emitpcode(POC_DECF, pic16_popCopyReg( pic16_stackpnt_hi )); //&pic16_pc_fsr1h)); + pic16_emitpcode (POC_DECF, pic16_popCopyReg (pic16_stackpnt_hi)); //&pic16_pc_fsr1h)); } - if(inWparamList(sym->name) || FUNC_ISWPARAM(sym->type)) { - if(IFFUNC_HASVARARGS(sym->type) || IFFUNC_ISREENT(sym->type)) + if (inWparamList (sym->name) || FUNC_ISWPARAM (sym->type)) + { + if (IFFUNC_HASVARARGS (sym->type) || IFFUNC_ISREENT (sym->type)) _G.useWreg = 0; else _G.useWreg = 1; - } else - _G.useWreg = 0; + } + else + _G.useWreg = 0; - /* if callee-save to be used for this function - * then save the registers being used in this function */ -// if (IFFUNC_CALLEESAVES(sym->type)) - if(strcmp(sym->name, "main")) { + /* if callee-save to be used for this function + * then save the registers being used in this function */ + //if (IFFUNC_CALLEESAVES (sym->type)) + if (strcmp (sym->name, "main")) + { int i; - /* if any registers used */ - if (sym->regsUsed) { - pic16_emitpinfo(INF_LOCALREGS, pic16_newpCodeOpLocalRegs(LR_ENTRY_BEGIN)); - - if(!pic16_options.xinst) { - /* save the registers used */ - DEBUGpic16_emitcode("; **", "Saving used registers in stack"); - for ( i = 0 ; i < sym->regsUsed->size ; i++) { - if (bitVectBitValue(sym->regsUsed,i)) { -#if 0 - fprintf(stderr, "%s:%d local register w/rIdx = %d is used in function\n", __FUNCTION__, __LINE__, i); -#endif - pic16_pushpCodeOp( pic16_popRegFromIdx(i) ); - _G.nRegsSaved++; - - if(!pic16_regWithIdx(i)->wasUsed) { - fprintf(stderr, "%s:%d register %s is used in function but was wasUsed = 0\n", - __FILE__, __LINE__, pic16_regWithIdx(i)->name); - pic16_regWithIdx(i)->wasUsed = 1; + /* if any registers used */ + if (sym->regsUsed) + { + pic16_emitpinfo (INF_LOCALREGS, pic16_newpCodeOpLocalRegs (LR_ENTRY_BEGIN)); + + if (!pic16_options.xinst) + { + /* save the registers used */ + DEBUGpic16_emitcode ("; **", "Saving used registers in stack"); + for (i = 0; i < sym->regsUsed->size; i++) + { + if (bitVectBitValue (sym->regsUsed, i)) + { +#if 0 + fprintf (stderr, "%s:%d local register w/rIdx = %d is used in function\n", __FUNCTION__, __LINE__, i); +#endif + pic16_pushpCodeOp (pic16_popRegFromIdx (i)); + _G.nRegsSaved++; + + if (!pic16_regWithIdx (i)->wasUsed) + { + fprintf (stderr, "%s:%d register %s is used in function but was wasUsed = 0\n", + __FILE__, __LINE__, pic16_regWithIdx (i)->name); + pic16_regWithIdx (i)->wasUsed = 1; + } + } } - } } - } else { + else + { + /* xinst */ + DEBUGpic16_emitcode ("; **", "Allocate a space in stack to be used as temporary registers"); + for (i = 0; i < sym->regsUsed->size; i++) + { + if (bitVectBitValue (sym->regsUsed, i)) + _G.nRegsSaved++; + } - /* xinst */ - DEBUGpic16_emitcode("; **", "Allocate a space in stack to be used as temporary registers"); - for(i=0;iregsUsed->size;i++) { - if(bitVectBitValue(sym->regsUsed, i)) { - _G.nRegsSaved++; - } + //pic16_emitpcode (POC_ADDFSR, pic16_popGetLit2 (2, pic16_popGetLit (_G.nRegsSaved))); } -// pic16_emitpcode(POC_ADDFSR, pic16_popGetLit2(2, pic16_popGetLit(_G.nRegsSaved))); - } - - pic16_emitpinfo(INF_LOCALREGS, pic16_newpCodeOpLocalRegs(LR_ENTRY_END)); - + pic16_emitpinfo (INF_LOCALREGS, pic16_newpCodeOpLocalRegs (LR_ENTRY_END)); } } - DEBUGpic16_emitcode("; ", "need to adjust stack = %d", sym->stack); -// fprintf(stderr, "Function '%s' uses %d bytes of stack\n", sym->name, sym->stack); + /* if critical function then turn interrupts off */ + if (IFFUNC_ISCRITICAL (ftype)) + { + genCritical (NULL); + } // if + + DEBUGpic16_emitcode ("; ", "need to adjust stack = %d", sym->stack); + //fprintf (stderr, "Function '%s' uses %d bytes of stack\n", sym->name, sym->stack); } /*-----------------------------------------------------------------*/ /* genEndFunction - generates epilogue for functions */ /*-----------------------------------------------------------------*/ -static void genEndFunction (iCode *ic) +static void +genEndFunction (iCode * ic) { - symbol *sym = OP_SYMBOL(IC_LEFT(ic)); + symbol *sym = OP_SYMBOL (IC_LEFT (ic)); - FENTRY; + FENTRY; - if(IFFUNC_ISNAKED(sym->type)) { - DEBUGpic16_emitcode("; ***", "__naked function, no epilogue"); + if (IFFUNC_ISNAKED (sym->type)) + { + DEBUGpic16_emitcode ("; ***", "__naked function, no epilogue"); return; } - _G.stack_lat = 0; - - /* add code for ISCRITICAL */ - if(IFFUNC_ISCRITICAL(sym->type)) { - /* if critical function, turn on interrupts */ + if (IFFUNC_ISCRITICAL (sym->type)) + { + genEndCritical (NULL); + } // if - /* TODO: add code here -- VR */ - } + _G.stack_lat = 0; -// sym->regsUsed = _G.fregsUsed; + //sym->regsUsed = _G.fregsUsed; - /* now we need to restore the registers */ - /* if any registers used */ + /* now we need to restore the registers */ + /* if any registers used */ - /* first restore registers that might be used for stack access */ - if(_G.sregsAllocSet) { - reg_info *sr; + /* first restore registers that might be used for stack access */ + if (_G.sregsAllocSet) + { + reg_info *sr; - _G.sregsAllocSet = reverseSet( _G.sregsAllocSet ); - for(sr=setFirstItem(_G.sregsAllocSet) ; sr; sr=setNextItem(_G.sregsAllocSet)) { - pic16_poppCodeOp( pic16_popRegFromIdx( sr->rIdx ) ); - } + _G.sregsAllocSet = reverseSet (_G.sregsAllocSet); + for (sr = setFirstItem (_G.sregsAllocSet); sr; sr = setNextItem (_G.sregsAllocSet)) + { + pic16_poppCodeOp (pic16_popRegFromIdx (sr->rIdx)); + } } - if (strcmp(sym->name, "main") && sym->regsUsed) { + if (strcmp (sym->name, "main") && sym->regsUsed) + { int i; - pic16_emitpinfo(INF_LOCALREGS, pic16_newpCodeOpLocalRegs(LR_EXIT_BEGIN)); - /* restore registers used */ - DEBUGpic16_emitcode("; **", "Restoring used registers from stack"); - for ( i = sym->regsUsed->size; i >= 0; i--) { - if (bitVectBitValue(sym->regsUsed,i)) { - pic16_poppCodeOp( pic16_popRegFromIdx(i) ); - _G.nRegsSaved--; - } + pic16_emitpinfo (INF_LOCALREGS, pic16_newpCodeOpLocalRegs (LR_EXIT_BEGIN)); + /* restore registers used */ + DEBUGpic16_emitcode ("; **", "Restoring used registers from stack"); + for (i = sym->regsUsed->size; i >= 0; i--) + { + if (bitVectBitValue (sym->regsUsed, i)) + { + pic16_poppCodeOp (pic16_popRegFromIdx (i)); + _G.nRegsSaved--; + } } - pic16_emitpinfo(INF_LOCALREGS, pic16_newpCodeOpLocalRegs(LR_EXIT_END)); + pic16_emitpinfo (INF_LOCALREGS, pic16_newpCodeOpLocalRegs (LR_EXIT_END)); } - - - if ((IFFUNC_ISREENT(sym->type) || options.stackAuto) - && sym->stack) { - if (sym->stack == 1) { - pic16_emitpcode(POC_INFSNZ, pic16_popCopyReg( pic16_stackpnt_lo )); - pic16_emitpcode(POC_INCF, pic16_popCopyReg( pic16_stackpnt_hi )); - } else { - // we have to add more than one... - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg( pic16_stack_postinc )); // this holds a return value! - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(sym->stack-1)); - pic16_emitpcode(POC_ADDWF, pic16_popCopyReg( pic16_stackpnt_lo )); - emitSKPNC; - pic16_emitpcode(POC_INCF, pic16_popCopyReg( pic16_stackpnt_hi )); - pic16_emitpcode(POC_COMF, pic16_popCopyReg(&pic16_pc_wreg)); // WREG = -(WREG+1)! - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(pic16_stack_plusw)); // this holds a retrun value! - } + if ((IFFUNC_ISREENT (sym->type) || options.stackAuto) && sym->stack) + { + if (sym->stack == 1) + { + pic16_emitpcode (POC_INFSNZ, pic16_popCopyReg (pic16_stackpnt_lo)); + pic16_emitpcode (POC_INCF, pic16_popCopyReg (pic16_stackpnt_hi)); + } + else + { + // we have to add more than one... + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (pic16_stack_postinc)); // this holds a return value! + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (sym->stack - 1)); + pic16_emitpcode (POC_ADDWF, pic16_popCopyReg (pic16_stackpnt_lo)); + emitSKPNC; + pic16_emitpcode (POC_INCF, pic16_popCopyReg (pic16_stackpnt_hi)); + pic16_emitpcode (POC_COMF, pic16_popCopyReg (&pic16_pc_wreg)); // WREG = - (WREG+1)! + pic16_emitpcode (POC_MOVFW, pic16_popCopyReg (pic16_stack_plusw)); // this holds a retrun value! + } } - if(strcmp(sym->name, "main")) { - if(0 - || !options.omitFramePtr -// || sym->regsUsed - || IFFUNC_ARGS(sym->type) - || FUNC_HASSTACKPARM(sym->etype) - ) { - /* restore stack frame */ - pic16_poppCodeOp( pic16_popCopyReg( pic16_framepnt_lo )); - if(STACK_MODEL_LARGE) - pic16_poppCodeOp( pic16_popCopyReg( pic16_framepnt_hi )); - } + if (strcmp (sym->name, "main")) + { + if (0 || !options.omitFramePtr + //|| sym->regsUsed + || IFFUNC_ARGS (sym->type) || FUNC_HASSTACKPARM (sym->etype)) + { + /* restore stack frame */ + pic16_poppCodeOp (pic16_popCopyReg (pic16_framepnt_lo)); + if (STACK_MODEL_LARGE) + pic16_poppCodeOp (pic16_popCopyReg (pic16_framepnt_hi)); + } } - _G.useWreg = 0; + _G.useWreg = 0; - if (IFFUNC_ISISR(sym->type)) { - pic16_poppCodeOp( pic16_popCopyReg( &pic16_pc_pclatu )); - pic16_poppCodeOp( pic16_popCopyReg( &pic16_pc_pclath )); - pic16_poppCodeOp( pic16_popCopyReg( &pic16_pc_fsr0h )); - pic16_poppCodeOp( pic16_popCopyReg( &pic16_pc_fsr0l)); - pic16_poppCodeOp( pic16_popCopyReg( &pic16_pc_prodh )); - pic16_poppCodeOp( pic16_popCopyReg( &pic16_pc_prodl )); - - if(!FUNC_ISSHADOWREGS(sym->type)) { - /* do not restore interrupt vector for WREG,STATUS,BSR - * for high priority interrupt, see genFunction */ - pic16_poppCodeOp( pic16_popCopyReg( &pic16_pc_bsr )); - pic16_poppCodeOp( pic16_popCopyReg( &pic16_pc_status )); - pic16_poppCodeOp( pic16_popCopyReg( &pic16_pc_wreg )); - } -// _G.interruptvector = 0; /* sanity check */ + if (IFFUNC_ISISR (sym->type)) + { + pic16_poppCodeOp (pic16_popCopyReg (&pic16_pc_pclatu)); + pic16_poppCodeOp (pic16_popCopyReg (&pic16_pc_pclath)); + pic16_poppCodeOp (pic16_popCopyReg (&pic16_pc_fsr0h)); + pic16_poppCodeOp (pic16_popCopyReg (&pic16_pc_fsr0l)); + pic16_poppCodeOp (pic16_popCopyReg (&pic16_pc_prodh)); + pic16_poppCodeOp (pic16_popCopyReg (&pic16_pc_prodl)); + if (!FUNC_ISSHADOWREGS (sym->type)) + { + /* do not restore interrupt vector for WREG, STATUS, BSR + * for high priority interrupt, see genFunction */ + pic16_emitpcode (POC_MOVFW, pic16_popCopyReg (pic16_stack_preinc)); + pic16_poppCodeOp (pic16_popCopyReg (&pic16_pc_bsr)); + pic16_poppCodeOp (pic16_popCopyReg (&pic16_pc_status)); + } + //_G.interruptvector = 0; /* sanity check */ /* if debug then send end of function */ -/* if (options.debug && currFunc) */ - if (currFunc) { - debugFile->writeEndFunction (currFunc, ic, 1); - } + /* if (options.debug && currFunc) */ + if (currFunc) + { + debugFile->writeEndFunction (currFunc, ic, 1); + } - if(_G.usefastretfie) - pic16_emitpcode(POC_RETFIE, pic16_newpCodeOpLit(1)); + if (_G.usefastretfie) + pic16_emitpcode (POC_RETFIE, pic16_newpCodeOpLit (1)); else - pic16_emitpcodeNULLop(POC_RETFIE); + pic16_emitpcodeNULLop (POC_RETFIE); - pic16_addpCode2pBlock(pb,pic16_newpCodeFunction(NULL,NULL)); + pic16_addpCode2pBlock (pb, pic16_newpCodeFunction (NULL, NULL)); _G.usefastretfie = 0; return; } - if (IFFUNC_ISCRITICAL(sym->type)) { - pic16_emitcode("setb","ea"); - } - - /* if debug then send end of function */ - if (currFunc) { + /* if debug then send end of function */ + if (currFunc) + { debugFile->writeEndFunction (currFunc, ic, 1); } - /* insert code to restore stack frame, if user enabled it - * and function is not main() */ + /* insert code to restore stack frame, if user enabled it + * and function is not main () */ + pic16_emitpcodeNULLop (POC_RETURN); - pic16_emitpcodeNULLop(POC_RETURN); - - /* Mark the end of a function */ - pic16_addpCode2pBlock(pb,pic16_newpCodeFunction(NULL,NULL)); + /* Mark the end of a function */ + pic16_addpCode2pBlock (pb, pic16_newpCodeFunction (NULL, NULL)); } -void pic16_storeForReturn(iCode *ic, /*operand *op,*/ int offset, pCodeOp *dest) +void +pic16_storeForReturn (iCode * ic, /*operand *op, */ int offset, pCodeOp * dest) { - unsigned long lit=1; + unsigned long lit = 1; operand *op; - op = IC_LEFT(ic); + op = IC_LEFT (ic); - // this fails for pic16_isLitOp(op) (if op is an AOP_PCODE) - if(AOP_TYPE(op) == AOP_LIT) { - if(!IS_FLOAT(operandType( op ))) { - lit = ulFromVal (AOP(op)->aopu.aop_lit); - } else { - union { - unsigned long lit_int; - float lit_float; - } info; - - /* take care if literal is a float */ - info.lit_float = floatFromVal(AOP(op)->aopu.aop_lit); - lit = info.lit_int; - } + // this fails for pic16_isLitOp(op) (if op is an AOP_PCODE) + if (AOP_TYPE (op) == AOP_LIT) + { + if (!IS_FLOAT (operandType (op))) + { + lit = ulFromVal (AOP (op)->aopu.aop_lit); + } + else + { + union + { + unsigned long lit_int; + float lit_float; + } info; + + /* take care if literal is a float */ + info.lit_float = (float)floatFromVal (AOP (op)->aopu.aop_lit); + lit = info.lit_int; + } } - if (AOP_TYPE(op) == AOP_LIT) { + if (AOP_TYPE (op) == AOP_LIT) + { /* FIXME: broken for * char __at(0x456) foo; * return &foo; * (upper byte is 0x00 (__code space) instead of 0x80 (__data) */ - pic16_movLit2f(dest, (lit >> (8ul*offset))); - } else if (AOP_TYPE(op) == AOP_PCODE - && AOP(op)->aopu.pcop->type == PO_IMMEDIATE) { + pic16_movLit2f (dest, (lit >> (8ul * offset))); + } + else if (AOP_TYPE (op) == AOP_PCODE && AOP (op)->aopu.pcop->type == PO_IMMEDIATE) + { /* char *s= "aaa"; return s; */ /* XXX: Using UPPER(__str_0) will yield 0b00XXXXXX, so * that the generic pointer is interpreted correctly * as referring to __code space, but this is fragile! */ - pic16_emitpcode(POC_MOVLW, pic16_popGet( AOP(op), offset )); + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (op), offset)); /* XXX: should check that dest != WREG */ - pic16_emitpcode(POC_MOVWF, dest); - } else { - if(dest->type == PO_WREG && (offset == 0)) { - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(op), offset)); - return; - } - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popGet(AOP(op), offset), dest)); + pic16_emitpcode (POC_MOVWF, dest); + } + else + { + if (dest->type == PO_WREG && (offset == 0)) + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (op), offset)); + return; + } + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popGet (AOP (op), offset), dest)); } } /*-----------------------------------------------------------------*/ /* genRet - generate code for return statement */ /*-----------------------------------------------------------------*/ -static void genRet (iCode *ic) +static void +genRet (iCode * ic) { int size; operand *left; - FENTRY; - /* if we have no return value then - * just generate the "ret" */ + FENTRY; + /* if we have no return value then + * just generate the "ret" */ - if (!IC_LEFT(ic)) - goto jumpret; + if (!IC_LEFT (ic)) + goto jumpret; - /* we have something to return then - * move the return value into place */ - pic16_aopOp((left=IC_LEFT(ic)),ic,FALSE); - size = AOP_SIZE(IC_LEFT(ic)); + /* we have something to return then + * move the return value into place */ + pic16_aopOp ((left = IC_LEFT (ic)), ic, FALSE); + size = AOP_SIZE (IC_LEFT (ic)); - if(size <= 4) { - if(size>3) - pic16_storeForReturn(ic, /*IC_LEFT(ic),*/ 3, pic16_popCopyReg(&pic16_pc_fsr0l)); + if (size <= 4) + { + if (size > 3) + pic16_storeForReturn (ic, /*IC_LEFT(ic), */ 3, pic16_popCopyReg (&pic16_pc_fsr0l)); - if(size>2) - pic16_storeForReturn(ic, /*IC_LEFT(ic),*/ 2, pic16_popCopyReg(&pic16_pc_prodh)); + if (size > 2) + pic16_storeForReturn (ic, /*IC_LEFT(ic), */ 2, pic16_popCopyReg (&pic16_pc_prodh)); - if(size>1) - pic16_storeForReturn(ic, /*IC_LEFT(ic),*/ 1, pic16_popCopyReg(&pic16_pc_prodl)); + if (size > 1) + pic16_storeForReturn (ic, /*IC_LEFT(ic), */ 1, pic16_popCopyReg (&pic16_pc_prodl)); - pic16_storeForReturn(ic, /*IC_LEFT(ic),*/ 0, pic16_popCopyReg(&pic16_pc_wreg)); + pic16_storeForReturn (ic, /*IC_LEFT(ic), */ 0, pic16_popCopyReg (&pic16_pc_wreg)); - } else { - /* >32-bits, setup stack and FSR0 */ - while (size--) { + } + else + { + /* >32-bits, setup stack and FSR0 */ + while (size--) + { // DEBUGpic16_emitcode("; ", "POC_MOVLW %d", GpsuedoStkPtr); // DEBUGpic16_emitcode("; ", "POC_MOVFW PLUSW2"); - pic16_pushpCodeOp( pic16_popGet( AOP( IC_LEFT(ic) ), size) ); + pic16_pushpCodeOp (pic16_popGet (AOP (IC_LEFT (ic)), size)); // popaopidx(AOP(oper), size, GpseudoStkPtr); - GpsuedoStkPtr++; - } + GpsuedoStkPtr++; + } - /* setup FSR0 */ - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg( pic16_stackpnt_lo ), pic16_popCopyReg(&pic16_pc_fsr0l))); + /* setup FSR0 */ + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popCopyReg (pic16_stackpnt_lo), pic16_popCopyReg (&pic16_pc_fsr0l))); - if(STACK_MODEL_LARGE) { - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg( pic16_stackpnt_hi ), pic16_popCopyReg(&pic16_pc_fsr0h))); - } else { - pic16_emitpcode(POC_CLRF, pic16_popCopyReg( pic16_stackpnt_hi )); - } + if (STACK_MODEL_LARGE) + { + pic16_emitpcode (POC_MOVFF, + pic16_popGet2p (pic16_popCopyReg (pic16_stackpnt_hi), pic16_popCopyReg (&pic16_pc_fsr0h))); } + else + { + pic16_emitpcode (POC_CLRF, pic16_popCopyReg (pic16_stackpnt_hi)); + } + } - pic16_freeAsmop (IC_LEFT(ic),NULL,ic,TRUE); + pic16_freeAsmop (IC_LEFT (ic), NULL, ic, TRUE); jumpret: - /* generate a jump to the return label - * if the next is not the return statement */ - if (!(ic->next && ic->next->op == LABEL - && IC_LABEL(ic->next) == returnLabel)) { + /* generate a jump to the return label + * if the next is not the return statement */ + if (!(ic->next && ic->next->op == LABEL && IC_LABEL (ic->next) == returnLabel)) + { - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(returnLabel->key)); - pic16_emitcode("goto","_%05d_DS_",returnLabel->key+100 + pic16_labelOffset); - } + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (returnLabel->key)); + pic16_emitcode ("goto", "_%05d_DS_", labelKey2num (returnLabel->key + pic16_labelOffset)); + } +} + +static set *critical_temps = NULL; + +static void +genCritical (iCode * ic) +{ + pCodeOp *saved_intcon; + + if (!critical_temps) + critical_temps = newSet (); + + saved_intcon = pic16_popGetTempReg (0); + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popCopyReg (&pic16_pc_intcon), saved_intcon)); + pic16_emitpcode (POC_BCF, pic16_popCopyGPR2Bit (pic16_popCopyReg (&pic16_pc_intcon), 7)); + addSetHead (&critical_temps, saved_intcon); +} + +static void +genEndCritical (iCode * ic) +{ + pCodeOp *saved_intcon = NULL; + + saved_intcon = getSet (&critical_temps); + if (!saved_intcon) + { + fprintf (stderr, "Critical section left, but none entered -- ignoring for now.\n"); + return; + } // if + + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (saved_intcon, 7)); + pic16_emitpcode (POC_BSF, pic16_popCopyGPR2Bit (pic16_popCopyReg (&pic16_pc_intcon), 7)); + pic16_popReleaseTempReg (saved_intcon, 0); } /*-----------------------------------------------------------------*/ /* genLabel - generates a label */ /*-----------------------------------------------------------------*/ -static void genLabel (iCode *ic) +static void +genLabel (iCode * ic) { FENTRY; /* special case never generate */ - if (IC_LABEL(ic) == entryLabel) - return ; + if (IC_LABEL (ic) == entryLabel) + return; - pic16_emitpLabel(IC_LABEL(ic)->key); -// pic16_emitcode("","_%05d_DS_:",(IC_LABEL(ic)->key+100 + pic16_labelOffset)); + pic16_emitpLabel (IC_LABEL (ic)->key); +// pic16_emitcode("","_%05d_DS_:",labelKey2num (IC_LABEL(ic)->key + pic16_labelOffset)); } /*-----------------------------------------------------------------*/ /* genGoto - generates a goto */ /*-----------------------------------------------------------------*/ //tsd -static void genGoto (iCode *ic) +static void +genGoto (iCode * ic) { FENTRY; - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_LABEL(ic)->key)); -// pic16_emitcode ("goto","_%05d_DS_",(IC_LABEL(ic)->key+100)+pic16_labelOffset); + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_LABEL (ic)->key)); +// pic16_emitcode ("goto","_%05d_DS_",labelKey2num (IC_LABEL(ic)->key + pic16_labelOffset)); } /*-----------------------------------------------------------------*/ /* genMultbits :- multiplication of bits */ /*-----------------------------------------------------------------*/ -static void genMultbits (operand *left, - operand *right, - operand *result) +static void +genMultbits (operand * left, operand * right, operand * result) { FENTRY; - if(!pic16_sameRegs(AOP(result),AOP(right))) - pic16_emitpcode(POC_BSF, pic16_popGet(AOP(result),0)); + if (!pic16_sameRegs (AOP (result), AOP (right))) + pic16_emitpcode (POC_BSF, pic16_popGet (AOP (result), 0)); - pic16_emitpcode(POC_BTFSC,pic16_popGet(AOP(right),0)); - pic16_emitpcode(POC_BTFSS,pic16_popGet(AOP(left),0)); - pic16_emitpcode(POC_BCF, pic16_popGet(AOP(result),0)); + pic16_emitpcode (POC_BTFSC, pic16_popGet (AOP (right), 0)); + pic16_emitpcode (POC_BTFSS, pic16_popGet (AOP (left), 0)); + pic16_emitpcode (POC_BCF, pic16_popGet (AOP (result), 0)); } @@ -3469,77 +3876,79 @@ /*-----------------------------------------------------------------*/ /* genMultOneByte : 8 bit multiplication & division */ /*-----------------------------------------------------------------*/ -static void genMultOneByte (operand *left, - operand *right, - operand *result) +static void +genMultOneByte (operand * left, operand * right, operand * result) { FENTRY; - DEBUGpic16_pic16_AopType(__LINE__,left,right,result); - DEBUGpic16_pic16_AopTypeSign(__LINE__,left,right,result); + DEBUGpic16_pic16_AopType (__LINE__, left, right, result); + DEBUGpic16_pic16_AopTypeSign (__LINE__, left, right, result); /* (if two literals, the value is computed before) */ /* if one literal, literal on the right */ - if (AOP_TYPE(left) == AOP_LIT){ - operand *t = right; - right = left; - left = t; - } + if (AOP_TYPE (left) == AOP_LIT) + { + operand *t = right; + right = left; + left = t; + } - /* size is already checked in genMult == 1 */ + /* size is already checked in genMult == 1 */ // size = AOP_SIZE(result); - if (AOP_TYPE(right) == AOP_LIT){ - pic16_emitpcomment("multiply lit val:%s by variable %s and store in %s", - pic16_aopGet(AOP(right),0,FALSE,FALSE), - pic16_aopGet(AOP(left),0,FALSE,FALSE), - pic16_aopGet(AOP(result),0,FALSE,FALSE)); - } else { - pic16_emitpcomment("multiply variable :%s by variable %s and store in %s", - pic16_aopGet(AOP(right),0,FALSE,FALSE), - pic16_aopGet(AOP(left),0,FALSE,FALSE), - pic16_aopGet(AOP(result),0,FALSE,FALSE)); - } + if (AOP_TYPE (right) == AOP_LIT) + { + pic16_emitpcomment ("multiply lit val:%s by variable %s and store in %s", + pic16_aopGet (AOP (right), 0, FALSE, FALSE), + pic16_aopGet (AOP (left), 0, FALSE, FALSE), pic16_aopGet (AOP (result), 0, FALSE, FALSE)); + } + else + { + pic16_emitpcomment ("multiply variable :%s by variable %s and store in %s", + pic16_aopGet (AOP (right), 0, FALSE, FALSE), + pic16_aopGet (AOP (left), 0, FALSE, FALSE), pic16_aopGet (AOP (result), 0, FALSE, FALSE)); + } - pic16_genMult8X8_n (left, right,result); + pic16_genMult8X8_n (left, right, result); } #if 0 /*-----------------------------------------------------------------*/ /* genMultOneWord : 16 bit multiplication */ /*-----------------------------------------------------------------*/ -static void genMultOneWord (operand *left, - operand *right, - operand *result) +static void +genMultOneWord (operand * left, operand * right, operand * result) { FENTRY; - DEBUGpic16_pic16_AopType(__LINE__,left,right,result); - DEBUGpic16_pic16_AopTypeSign(__LINE__,left,right,result); + DEBUGpic16_pic16_AopType (__LINE__, left, right, result); + DEBUGpic16_pic16_AopTypeSign (__LINE__, left, right, result); /* (if two literals, the value is computed before) * if one literal, literal on the right */ - if (AOP_TYPE(left) == AOP_LIT){ - operand *t = right; - right = left; - left = t; - } + if (AOP_TYPE (left) == AOP_LIT) + { + operand *t = right; + right = left; + left = t; + } /* size is checked already == 2 */ // size = AOP_SIZE(result); - if (AOP_TYPE(right) == AOP_LIT) { - pic16_emitpcomment("multiply lit val:%s by variable %s and store in %s", - pic16_aopGet(AOP(right),0,FALSE,FALSE), - pic16_aopGet(AOP(left),0,FALSE,FALSE), - pic16_aopGet(AOP(result),0,FALSE,FALSE)); - } else { - pic16_emitpcomment("multiply variable :%s by variable %s and store in %s", - pic16_aopGet(AOP(right),0,FALSE,FALSE), - pic16_aopGet(AOP(left),0,FALSE,FALSE), - pic16_aopGet(AOP(result),0,FALSE,FALSE)); - } + if (AOP_TYPE (right) == AOP_LIT) + { + pic16_emitpcomment ("multiply lit val:%s by variable %s and store in %s", + pic16_aopGet (AOP (right), 0, FALSE, FALSE), + pic16_aopGet (AOP (left), 0, FALSE, FALSE), pic16_aopGet (AOP (result), 0, FALSE, FALSE)); + } + else + { + pic16_emitpcomment ("multiply variable :%s by variable %s and store in %s", + pic16_aopGet (AOP (right), 0, FALSE, FALSE), + pic16_aopGet (AOP (left), 0, FALSE, FALSE), pic16_aopGet (AOP (result), 0, FALSE, FALSE)); + } - pic16_genMult16X16_16(left, right,result); + pic16_genMult16X16_16 (left, right, result); } #endif @@ -3547,38 +3956,39 @@ /*-----------------------------------------------------------------*/ /* genMultOneLong : 32 bit multiplication */ /*-----------------------------------------------------------------*/ -static void genMultOneLong (operand *left, - operand *right, - operand *result) +static void +genMultOneLong (operand * left, operand * right, operand * result) { FENTRY; - DEBUGpic16_pic16_AopType(__LINE__,left,right,result); - DEBUGpic16_pic16_AopTypeSign(__LINE__,left,right,result); + DEBUGpic16_pic16_AopType (__LINE__, left, right, result); + DEBUGpic16_pic16_AopTypeSign (__LINE__, left, right, result); /* (if two literals, the value is computed before) * if one literal, literal on the right */ - if (AOP_TYPE(left) == AOP_LIT){ - operand *t = right; - right = left; - left = t; - } + if (AOP_TYPE (left) == AOP_LIT) + { + operand *t = right; + right = left; + left = t; + } /* size is checked already == 4 */ // size = AOP_SIZE(result); - if (AOP_TYPE(right) == AOP_LIT) { - pic16_emitpcomment("multiply lit val:%s by variable %s and store in %s", - pic16_aopGet(AOP(right),0,FALSE,FALSE), - pic16_aopGet(AOP(left),0,FALSE,FALSE), - pic16_aopGet(AOP(result),0,FALSE,FALSE)); - } else { - pic16_emitpcomment("multiply variable :%s by variable %s and store in %s", - pic16_aopGet(AOP(right),0,FALSE,FALSE), - pic16_aopGet(AOP(left),0,FALSE,FALSE), - pic16_aopGet(AOP(result),0,FALSE,FALSE)); - } + if (AOP_TYPE (right) == AOP_LIT) + { + pic16_emitpcomment ("multiply lit val:%s by variable %s and store in %s", + pic16_aopGet (AOP (right), 0, FALSE, FALSE), + pic16_aopGet (AOP (left), 0, FALSE, FALSE), pic16_aopGet (AOP (result), 0, FALSE, FALSE)); + } + else + { + pic16_emitpcomment ("multiply variable :%s by variable %s and store in %s", + pic16_aopGet (AOP (right), 0, FALSE, FALSE), + pic16_aopGet (AOP (left), 0, FALSE, FALSE), pic16_aopGet (AOP (result), 0, FALSE, FALSE)); + } - pic16_genMult32X32_32(left, right,result); + pic16_genMult32X32_32 (left, right, result); } #endif @@ -3587,374 +3997,396 @@ /*-----------------------------------------------------------------*/ /* genMult - generates code for multiplication */ /*-----------------------------------------------------------------*/ -static void genMult (iCode *ic) +static void +genMult (iCode * ic) { - operand *left = IC_LEFT(ic); - operand *right = IC_RIGHT(ic); - operand *result= IC_RESULT(ic); + operand *left = IC_LEFT (ic); + operand *right = IC_RIGHT (ic); + operand *result = IC_RESULT (ic); - FENTRY; - /* assign the amsops */ - pic16_aopOp (left,ic,FALSE); - pic16_aopOp (right,ic,FALSE); - pic16_aopOp (result,ic,TRUE); + FENTRY; + /* assign the amsops */ + pic16_aopOp (left, ic, FALSE); + pic16_aopOp (right, ic, FALSE); + pic16_aopOp (result, ic, TRUE); - DEBUGpic16_pic16_AopType(__LINE__,left,right,result); + DEBUGpic16_pic16_AopType (__LINE__, left, right, result); - /* special cases first * - * both are bits */ - if (AOP_TYPE(left) == AOP_CRY - && AOP_TYPE(right)== AOP_CRY) { - genMultbits(left,right,result); - goto release ; - } + /* special cases first * + * both are bits */ + if (AOP_TYPE (left) == AOP_CRY && AOP_TYPE (right) == AOP_CRY) + { + genMultbits (left, right, result); + goto release; + } - /* if both are of size == 1 */ - if(AOP_SIZE(left) == 1 - && AOP_SIZE(right) == 1) { - genMultOneByte(left,right,result); - goto release ; - } + /* if both are of size == 1 */ + if (AOP_SIZE (left) == 1 && AOP_SIZE (right) == 1) + { + genMultOneByte (left, right, result); + goto release; + } #if 0 - /* if both are of size == 2 */ - if(AOP_SIZE(left) == 2 - && AOP_SIZE(right) == 2) { - genMultOneWord(left, right, result); - goto release; - } + /* if both are of size == 2 */ + if (AOP_SIZE (left) == 2 && AOP_SIZE (right) == 2) + { + genMultOneWord (left, right, result); + goto release; + } - /* if both are of size == 4 */ - if(AOP_SIZE(left) == 4 - && AOP_SIZE(right) == 4) { - genMultOneLong(left, right, result); - goto release; - } + /* if both are of size == 4 */ + if (AOP_SIZE (left) == 4 && AOP_SIZE (right) == 4) + { + genMultOneLong (left, right, result); + goto release; + } #endif - fprintf( stderr, "%s: should have been transformed into function call\n",__FUNCTION__ ); - assert( !"Multiplication should have been transformed into function call!" ); + fprintf (stderr, "%s: should have been transformed into function call\n", __FUNCTION__); + assert (!"Multiplication should have been transformed into function call!"); - pic16_emitcode("multiply ","sizes are greater than 4 ... need to insert proper algor."); + pic16_emitcode ("multiply ", "sizes are greater than 4 ... need to insert proper algor."); - fprintf(stderr, "operand sizes result: %d left: %d right: %d\n", AOP_SIZE(result), AOP_SIZE(left), AOP_SIZE(right)); - /* should have been converted to function call */ - assert(0) ; + fprintf (stderr, "operand sizes result: %d left: %d right: %d\n", AOP_SIZE (result), AOP_SIZE (left), AOP_SIZE (right)); + /* should have been converted to function call */ + assert (0); -release : - pic16_freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(result,NULL,ic,TRUE); +release: + pic16_freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (result, NULL, ic, TRUE); } #if 0 /*-----------------------------------------------------------------*/ /* genDivbits :- division of bits */ /*-----------------------------------------------------------------*/ -static void genDivbits (operand *left, - operand *right, - operand *result) +static void +genDivbits (operand * left, operand * right, operand * result) { char *l; - FENTRY; - /* the result must be bit */ - pic16_emitcode("mov","b,%s",pic16_aopGet(AOP(right),0,FALSE,FALSE)); - l = pic16_aopGet(AOP(left),0,FALSE,FALSE); - - MOVA(l); - - pic16_emitcode("div","ab"); - pic16_emitcode("rrc","a"); - pic16_aopPut(AOP(result),"c",0); + FENTRY; + /* the result must be bit */ + pic16_emitcode ("mov", "b,%s", pic16_aopGet (AOP (right), 0, FALSE, FALSE)); + l = pic16_aopGet (AOP (left), 0, FALSE, FALSE); + + MOVA (l); + + pic16_emitcode ("div", "ab"); + pic16_emitcode ("rrc", "a"); + pic16_aopPut (AOP (result), "c", 0); } /*-----------------------------------------------------------------*/ /* genDivOneByte : 8 bit division */ /*-----------------------------------------------------------------*/ -static void genDivOneByte (operand *left, - operand *right, - operand *result) -{ - sym_link *opetype = operandType(result); - char *l ; - symbol *lbl ; - int size,offset; - - /* result = divident / divisor - * - divident may be a register or a literal, - * - divisor may be a register or a literal, - * so there are 3 cases (literal / literal is optimized - * by the front-end) to handle. - * In addition we must handle signed and unsigned, which - * result in 6 final different cases -- VR */ - - FENTRY; - - size = AOP_SIZE(result) - 1; - offset = 1; - /* signed or unsigned */ - if (SPEC_USIGN(opetype)) { - pCodeOp *pct1, /* count */ - *pct2, /* reste */ - *pct3; /* temp */ - symbol *label1, *label2, *label3;; +static void +genDivOneByte (operand * left, operand * right, operand * result) +{ + sym_link *opetype = operandType (result); + char *l; + symbol *lbl; + int size, offset; + /* result = divident / divisor + * - divident may be a register or a literal, + * - divisor may be a register or a literal, + * so there are 3 cases (literal / literal is optimized + * by the front-end) to handle. + * In addition we must handle signed and unsigned, which + * result in 6 final different cases -- VR */ - /* unsigned is easy */ + FENTRY; - pct1 = pic16_popGetTempReg(1); - pct2 = pic16_popGetTempReg(1); - pct3 = pic16_popGetTempReg(1); + size = AOP_SIZE (result) - 1; + offset = 1; + /* signed or unsigned */ + if (SPEC_USIGN (opetype)) + { + pCodeOp *pct1, /* count */ + *pct2, /* reste */ + *pct3; /* temp */ + symbol *label1, *label2, *label3;; - label1 = newiTempLabel(NULL); - label2 = newiTempLabel(NULL); - label3 = newiTempLabel(NULL); - /* the following algorithm is extracted from divuint.c */ + /* unsigned is easy */ - pic16_emitpcode(POC_MOVLW, pic16_popGetLit( 8 )); - pic16_emitpcode(POC_MOVWF, pic16_pCodeOpCopy( pct1 )); + pct1 = pic16_popGetTempReg (1); + pct2 = pic16_popGetTempReg (1); + pct3 = pic16_popGetTempReg (1); - pic16_emitpcode(POC_CLRF, pic16_pCodeOpCopy( pct2 )); + label1 = newiTempLabel (NULL); + label2 = newiTempLabel (NULL); + label3 = newiTempLabel (NULL); - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(left), 0)); + /* the following algorithm is extracted from divuint.c */ - pic16_emitpLabel(label1->key); + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (8)); + pic16_emitpcode (POC_MOVWF, pic16_pCodeOpCopy (pct1)); - emitCLRC; - pic16_emitpcode(POC_RLCF, pic16_pCodeOpCopy( pct2 )); + pic16_emitpcode (POC_CLRF, pic16_pCodeOpCopy (pct2)); + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), 0)); - emitCLRC; - pic16_emitpcode(POC_RLCF, pic16_popCopyReg( &pic16_pc_wreg )); + pic16_emitpLabel (label1->key); + emitCLRC; + pic16_emitpcode (POC_RLCF, pic16_pCodeOpCopy (pct2)); - emitSKPNC; - pic16_emitpcode(POC_INCF, pic16_pCodeOpCopy( pct2 )); - pic16_emitpcode(POC_MOVWF, pic16_pCodeOpCopy( pct3 )); - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(right), 0)); + emitCLRC; + pic16_emitpcode (POC_RLCF, pic16_popCopyReg (&pic16_pc_wreg)); - pic16_emitpcode(POC_CPFSLT, pic16_pCodeOpCopy(pct2)); - pic16_emitpcode(POC_BRA, pic16_popGetLabel(label3->key)); - pic16_emitpcode(POC_BRA, pic16_popGetLabel(label2->key)); - - pic16_emitpLabel( label3->key ); - pic16_emitpcode(POC_SUBWF, pic16_pCodeOpCopy(pct2)); - pic16_emitpcode(POC_INCF, pic16_pCodeOpCopy(pct3)); - - - - pic16_emitpLabel(label2->key); - pic16_emitpcode(POC_MOVFW, pic16_pCodeOpCopy(pct3)); - pic16_emitpcode(POC_DECFSZ, pic16_pCodeOpCopy(pct1)); - pic16_emitpcode(POC_BRA, pic16_popGetLabel( label1->key )); - - /* result is in wreg */ - if(AOP_TYPE(result) != AOP_ACC) - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 0)); - - pic16_popReleaseTempReg( pct3, 1); - pic16_popReleaseTempReg( pct2, 1); - pic16_popReleaseTempReg( pct1, 1); - - return ; - } - - /* signed is a little bit more difficult */ - - /* save the signs of the operands */ - l = pic16_aopGet(AOP(left),0,FALSE,FALSE); - MOVA(l); - pic16_emitcode("xrl","a,%s",pic16_aopGet(AOP(right),0,FALSE,TRUE)); - pic16_emitcode("push","acc"); /* save it on the stack */ - - /* now sign adjust for both left & right */ - l = pic16_aopGet(AOP(right),0,FALSE,FALSE); - MOVA(l); - lbl = newiTempLabel(NULL); - pic16_emitcode("jnb","acc.7,%05d_DS_",(lbl->key+100)); - pic16_emitcode("cpl","a"); - pic16_emitcode("inc","a"); - pic16_emitcode("","%05d_DS_:",(lbl->key+100)); - pic16_emitcode("mov","b,a"); - - /* sign adjust left side */ - l = pic16_aopGet(AOP(left),0,FALSE,FALSE); - MOVA(l); - - lbl = newiTempLabel(NULL); - pic16_emitcode("jnb","acc.7,%05d_DS_",(lbl->key+100)); - pic16_emitcode("cpl","a"); - pic16_emitcode("inc","a"); - pic16_emitcode("","%05d_DS_:",(lbl->key+100)); - - /* now the division */ - pic16_emitcode("div","ab"); - /* we are interested in the lower order - only */ - pic16_emitcode("mov","b,a"); - lbl = newiTempLabel(NULL); - pic16_emitcode("pop","acc"); - /* if there was an over flow we don't - adjust the sign of the result */ - pic16_emitcode("jb","ov,%05d_DS_",(lbl->key+100)); - pic16_emitcode("jnb","acc.7,%05d_DS_",(lbl->key+100)); - CLRC; - pic16_emitcode("clr","a"); - pic16_emitcode("subb","a,b"); - pic16_emitcode("mov","b,a"); - pic16_emitcode("","%05d_DS_:",(lbl->key+100)); - - /* now we are done */ - pic16_aopPut(AOP(result),"b",0); - if(size > 0){ - pic16_emitcode("mov","c,b.7"); - pic16_emitcode("subb","a,acc"); - } - while (size--) - pic16_aopPut(AOP(result),"a",offset++); -} -#endif + emitSKPNC; + pic16_emitpcode (POC_INCF, pic16_pCodeOpCopy (pct2)); -/*-----------------------------------------------------------------*/ -/* genDiv - generates code for division */ -/*-----------------------------------------------------------------*/ -static void genDiv (iCode *ic) -{ - operand *left = IC_LEFT(ic); - operand *right = IC_RIGHT(ic); - operand *result= IC_RESULT(ic); - int negated = 0; - int leftVal = 0, rightVal = 0; - int signedLits = 0; - char *functions[2][2] = { { "__divschar", "__divuchar" }, { "__modschar", "__moduchar" } }; - int op = 0; - - /* Division is a very lengthy algorithm, so it is better - * to call support routines than inlining algorithm. - * Division functions written here just in case someone - * wants to inline and not use the support libraries -- VR */ - - FENTRY; - - /* assign the amsops */ - pic16_aopOp (left,ic,FALSE); - pic16_aopOp (right,ic,FALSE); - pic16_aopOp (result,ic,TRUE); - - if (ic->op == '/') - op = 0; - else if (ic->op == '%') - op = 1; - else - assert( !"invalid operation requested in genDivMod" ); - - /* get literal values */ - if (IS_VALOP(left)) { - leftVal = (int) ulFromVal ( OP_VALUE(left) ); - assert( leftVal >= -128 && leftVal < 256 ); - if (leftVal < 0) { signedLits++; } - } - if (IS_VALOP(right)) { - rightVal = (int) ulFromVal ( OP_VALUE(right) ); - assert( rightVal >= -128 && rightVal < 256 ); - if (rightVal < 0) { signedLits++; } - } - - /* We should only come here to convert all - * / : {u8_t, s8_t} x {u8_t, s8_t} -> {u8_t, s8_t} - * with exactly one operand being s8_t into - * u8_t x u8_t -> u8_t. All other cases should have been - * turned into calls to support routines beforehand... */ - if ((AOP_SIZE(left) == 1 || IS_VALOP(left)) - && (AOP_SIZE(right) == 1 || IS_VALOP(right))) - { - if ((!IS_UNSIGNED(operandType(right)) || rightVal < 0) - && (!IS_UNSIGNED(operandType(left)) || leftVal < 0)) - { - /* Both operands are signed or negative, use _divschar - * instead of _divuchar */ - pushaop(AOP(right), 0); - pushaop(AOP(left), 0); + pic16_emitpcode (POC_MOVWF, pic16_pCodeOpCopy (pct3)); + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (right), 0)); - /* call _divschar */ - pic16_emitpcode(POC_CALL, pic16_popGetWithString(functions[op][0])); + pic16_emitpcode (POC_CPFSLT, pic16_pCodeOpCopy (pct2)); + pic16_emitpcode (POC_BRA, pic16_popGetLabel (label3->key)); + pic16_emitpcode (POC_BRA, pic16_popGetLabel (label2->key)); + pic16_emitpLabel (label3->key); + pic16_emitpcode (POC_SUBWF, pic16_pCodeOpCopy (pct2)); + pic16_emitpcode (POC_INCF, pic16_pCodeOpCopy (pct3)); + + + + pic16_emitpLabel (label2->key); + pic16_emitpcode (POC_MOVFW, pic16_pCodeOpCopy (pct3)); + pic16_emitpcode (POC_DECFSZ, pic16_pCodeOpCopy (pct1)); + pic16_emitpcode (POC_BRA, pic16_popGetLabel (label1->key)); + + /* result is in wreg */ + if (AOP_TYPE (result) != AOP_ACC) + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); + + pic16_popReleaseTempReg (pct3, 1); + pic16_popReleaseTempReg (pct2, 1); + pic16_popReleaseTempReg (pct1, 1); + + return; + } + + /* signed is a little bit more difficult */ + + /* save the signs of the operands */ + l = pic16_aopGet (AOP (left), 0, FALSE, FALSE); + MOVA (l); + pic16_emitcode ("xrl", "a,%s", pic16_aopGet (AOP (right), 0, FALSE, TRUE)); + pic16_emitcode ("push", "acc"); /* save it on the stack */ + + /* now sign adjust for both left & right */ + l = pic16_aopGet (AOP (right), 0, FALSE, FALSE); + MOVA (l); + lbl = newiTempLabel (NULL); + pic16_emitcode ("jnb", "acc.7,%05d_DS_", labelKey2num (lbl->key)); + pic16_emitcode ("cpl", "a"); + pic16_emitcode ("inc", "a"); + pic16_emitcode ("", "%05d_DS_:", labelKey2num (lbl->key)); + pic16_emitcode ("mov", "b,a"); + + /* sign adjust left side */ + l = pic16_aopGet (AOP (left), 0, FALSE, FALSE); + MOVA (l); + + lbl = newiTempLabel (NULL); + pic16_emitcode ("jnb", "acc.7,%05d_DS_", labelKey2num (lbl->key)); + pic16_emitcode ("cpl", "a"); + pic16_emitcode ("inc", "a"); + pic16_emitcode ("", "%05d_DS_:", labelKey2num (lbl->key)); + + /* now the division */ + pic16_emitcode ("div", "ab"); + /* we are interested in the lower order + only */ + pic16_emitcode ("mov", "b,a"); + lbl = newiTempLabel (NULL); + pic16_emitcode ("pop", "acc"); + /* if there was an over flow we don't + adjust the sign of the result */ + pic16_emitcode ("jb", "ov,%05d_DS_", labelKey2num (lbl->key)); + pic16_emitcode ("jnb", "acc.7,%05d_DS_", labelKey2num (lbl->key)); + CLRC; + pic16_emitcode ("clr", "a"); + pic16_emitcode ("subb", "a,b"); + pic16_emitcode ("mov", "b,a"); + pic16_emitcode ("", "%05d_DS_:", labelKey2num (lbl->key)); + + /* now we are done */ + pic16_aopPut (AOP (result), "b", 0); + if (size > 0) + { + pic16_emitcode ("mov", "c,b.7"); + pic16_emitcode ("subb", "a,acc"); + } + while (size--) + pic16_aopPut (AOP (result), "a", offset++); + +} +#endif + +/*-----------------------------------------------------------------*/ +/* genDiv - generates code for division */ +/*-----------------------------------------------------------------*/ +static void +genDiv (iCode * ic) +{ + operand *left = IC_LEFT (ic); + operand *right = IC_RIGHT (ic); + operand *result = IC_RESULT (ic); + int negated = 0; + int leftVal = 0, rightVal = 0; + int signedLits = 0; + char *functions[2][2] = { {"__divschar", "__divuchar"}, {"__modschar", "__moduchar"} }; + int op = 0; + + /* Division is a very lengthy algorithm, so it is better + * to call support routines than inlining algorithm. + * Division functions written here just in case someone + * wants to inline and not use the support libraries -- VR */ + + FENTRY; + + /* assign the amsops */ + pic16_aopOp (left, ic, FALSE); + pic16_aopOp (right, ic, FALSE); + pic16_aopOp (result, ic, TRUE); + + if (ic->op == '/') + op = 0; + else if (ic->op == '%') + op = 1; + else + assert (!"invalid operation requested in genDivMod"); + + /* get literal values */ + if (IS_VALOP (left)) + { + leftVal = (int) ulFromVal (OP_VALUE (left)); + assert (leftVal >= -128 && leftVal < 256); + if (leftVal < 0) { - symbol *sym; - sym = newSymbol( functions[op][0], 0 ); - sym->used++; - strcpy(sym->rname, functions[op][0]); - checkAddSym(&externs, sym); + signedLits++; } - - /* assign result */ - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 0)); - if (AOP_SIZE(result) > 1) + } + if (IS_VALOP (right)) + { + rightVal = (int) ulFromVal (OP_VALUE (right)); + assert (rightVal >= -128 && rightVal < 256); + if (rightVal < 0) { - pic16_emitpcode(POC_MOVFF, - pic16_popGet2p(pic16_popCopyReg(&pic16_pc_prodl), - pic16_popGet(AOP(result), 1))); - /* sign extend */ - pic16_addSign(result, 2, 1); + signedLits++; } + } + + /* We should only come here to convert all + * / : {u8_t, s8_t} x {u8_t, s8_t} -> {u8_t, s8_t} + * with exactly one operand being s8_t into + * u8_t x u8_t -> u8_t. All other cases should have been + * turned into calls to support routines beforehand... */ + if ((AOP_SIZE (left) == 1 || IS_VALOP (left)) && (AOP_SIZE (right) == 1 || IS_VALOP (right))) + { + if ((!IS_UNSIGNED (operandType (right)) || rightVal < 0) && (!IS_UNSIGNED (operandType (left)) || leftVal < 0)) + { + /* Both operands are signed or negative, use _divschar + * instead of _divuchar */ + pushaop (AOP (right), 0); + pushaop (AOP (left), 0); - /* clean up stack */ - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(pic16_stack_preinc)); - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(pic16_stack_preinc)); + /* call _divschar */ + pic16_emitpcode (POC_CALL, pic16_popGetWithString (functions[op][0])); - goto release; - } + { + symbol *sym; + sym = newSymbol (functions[op][0], 0); + sym->used++; + strcpy (sym->rname, functions[op][0]); + checkAddSym (&externs, sym); + } + + /* assign result */ + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); + if (AOP_SIZE (result) > 1) + { + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popCopyReg (&pic16_pc_prodl), pic16_popGet (AOP (result), 1))); + /* sign extend */ + pic16_addSign (result, 2, 1); + } + + /* clean up stack */ + pic16_emitpcode (POC_MOVFW, pic16_popCopyReg (pic16_stack_preinc)); + pic16_emitpcode (POC_MOVFW, pic16_popCopyReg (pic16_stack_preinc)); + + goto release; + } /* push right operand */ - if (IS_VALOP(right)) { - if (rightVal < 0) { - pic16_pushpCodeOp( pic16_popGetLit(-rightVal) ); + if (IS_VALOP (right)) + { + if (rightVal < 0) + { + pic16_pushpCodeOp (pic16_popGetLit (-rightVal)); + negated++; + } + else + { + pushaop (AOP (right), 0); + } + } + else if (!IS_UNSIGNED (operandType (right))) + { + pic16_mov2w (AOP (right), 0); + pic16_emitpcode (POC_BTFSC, pic16_newpCodeOpBit_simple (AOP (right), 0, 7)); + pic16_emitpcode (POC_NEGF, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (pic16_stack_postdec)); negated++; - } else { - pushaop(AOP(right), 0); } - } else if (!IS_UNSIGNED(operandType(right))) { - pic16_mov2w(AOP(right), 0); - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit_simple(AOP(right), 0, 7)); - pic16_emitpcode(POC_NEGF, pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(pic16_stack_postdec)); - negated++; - } else { - pushaop(AOP(right), 0); - } + else + { + pushaop (AOP (right), 0); + } /* push left operand */ - if (IS_VALOP(left)) { - if (leftVal < 0) { - pic16_pushpCodeOp(pic16_popGetLit(-leftVal)); + if (IS_VALOP (left)) + { + if (leftVal < 0) + { + pic16_pushpCodeOp (pic16_popGetLit (-leftVal)); + negated++; + } + else + { + pushaop (AOP (left), 0); + } + } + else if (!IS_UNSIGNED (operandType (left))) + { + pic16_mov2w (AOP (left), 0); + pic16_emitpcode (POC_BTFSC, pic16_newpCodeOpBit_simple (AOP (left), 0, 7)); + pic16_emitpcode (POC_NEGF, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (pic16_stack_postdec)); negated++; - } else { - pushaop(AOP(left), 0); } - } else if (!IS_UNSIGNED(operandType(left))) { - pic16_mov2w(AOP(left),0); - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit_simple(AOP(left), 0, 7)); - pic16_emitpcode(POC_NEGF, pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(pic16_stack_postdec)); - negated++; - } else { - pushaop(AOP(left), 0); - } + else + { + pushaop (AOP (left), 0); + } /* call _divuchar */ - pic16_emitpcode(POC_CALL, pic16_popGetWithString(functions[op][1])); + pic16_emitpcode (POC_CALL, pic16_popGetWithString (functions[op][1])); { symbol *sym; - sym = newSymbol( functions[op][1], 0 ); + sym = newSymbol (functions[op][1], 0); sym->used++; - strcpy(sym->rname, functions[op][1]); - checkAddSym(&externs, sym); + strcpy (sym->rname, functions[op][1]); + checkAddSym (&externs, sym); } /* Revert negation(s) from above. @@ -3973,202 +4405,219 @@ * a<0, b<0 --> a/b >= 0 and a%b < 0 (e.g. -128 / -5 = 25, 25*(-5) = -125 and -3 remaining) * Only invert the result if the left operand is negative (sigh). */ - if (AOP_SIZE(result) <= 1 || !negated) - { - if (ic->op == '/') + if (AOP_SIZE (result) <= 1 || !negated) { - if (IS_VALOP(right)) { - if (rightVal < 0) { - /* we negated this operand above */ - pic16_emitpcode(POC_NEGF, pic16_popCopyReg(&pic16_pc_wreg)); - } - } else if (!IS_UNSIGNED(operandType(right))) { - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit_simple(AOP(right), 0, 7)); - pic16_emitpcode(POC_NEGF, pic16_popCopyReg(&pic16_pc_wreg)); - } - } + if (ic->op == '/') + { + if (IS_VALOP (right)) + { + if (rightVal < 0) + { + /* we negated this operand above */ + pic16_emitpcode (POC_NEGF, pic16_popCopyReg (&pic16_pc_wreg)); + } + } + else if (!IS_UNSIGNED (operandType (right))) + { + pic16_emitpcode (POC_BTFSC, pic16_newpCodeOpBit_simple (AOP (right), 0, 7)); + pic16_emitpcode (POC_NEGF, pic16_popCopyReg (&pic16_pc_wreg)); + } + } - if (IS_VALOP(left)) { - if (leftVal < 0) { - /* we negated this operand above */ - pic16_emitpcode(POC_NEGF, pic16_popCopyReg(&pic16_pc_wreg)); - } - } else if (!IS_UNSIGNED(operandType(left))) { - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit_simple(AOP(left), 0, 7)); - pic16_emitpcode(POC_NEGF, pic16_popCopyReg(&pic16_pc_wreg)); - } - - /* Move result to destination. */ - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 0)); - - /* Zero-extend: no operand was signed (or result is just a byte). */ - pic16_addSign(result, 1, 0); - } else { - assert( AOP_SIZE(result) > 1 ); - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result), 1)); - if (ic->op == '/') - { - if (IS_VALOP(right)) { - if (rightVal < 0) { - /* we negated this operand above */ - pic16_emitpcode(POC_COMF, pic16_popGet(AOP(result), 1)); - } - } else if (!IS_UNSIGNED(operandType(right))) { - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit_simple(AOP(right), 0, 7)); - pic16_emitpcode(POC_COMF, pic16_popGet(AOP(result), 1)); - } - } + if (IS_VALOP (left)) + { + if (leftVal < 0) + { + /* we negated this operand above */ + pic16_emitpcode (POC_NEGF, pic16_popCopyReg (&pic16_pc_wreg)); + } + } + else if (!IS_UNSIGNED (operandType (left))) + { + pic16_emitpcode (POC_BTFSC, pic16_newpCodeOpBit_simple (AOP (left), 0, 7)); + pic16_emitpcode (POC_NEGF, pic16_popCopyReg (&pic16_pc_wreg)); + } - if (IS_VALOP(left)) { - if (leftVal < 0) { - /* we negated this operand above */ - pic16_emitpcode(POC_COMF, pic16_popGet(AOP(result), 1)); - } - } else if (!IS_UNSIGNED(operandType(left))) { - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit_simple(AOP(left), 0, 7)); - pic16_emitpcode(POC_COMF, pic16_popGet(AOP(result), 1)); + /* Move result to destination. */ + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); + + /* Zero-extend: no operand was signed (or result is just a byte). */ + pic16_addSign (result, 1, 0); } + else + { + assert (AOP_SIZE (result) > 1); + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), 1)); + if (ic->op == '/') + { + if (IS_VALOP (right)) + { + if (rightVal < 0) + { + /* we negated this operand above */ + pic16_emitpcode (POC_COMF, pic16_popGet (AOP (result), 1)); + } + } + else if (!IS_UNSIGNED (operandType (right))) + { + pic16_emitpcode (POC_BTFSC, pic16_newpCodeOpBit_simple (AOP (right), 0, 7)); + pic16_emitpcode (POC_COMF, pic16_popGet (AOP (result), 1)); + } + } + + if (IS_VALOP (left)) + { + if (leftVal < 0) + { + /* we negated this operand above */ + pic16_emitpcode (POC_COMF, pic16_popGet (AOP (result), 1)); + } + } + else if (!IS_UNSIGNED (operandType (left))) + { + pic16_emitpcode (POC_BTFSC, pic16_newpCodeOpBit_simple (AOP (left), 0, 7)); + pic16_emitpcode (POC_COMF, pic16_popGet (AOP (result), 1)); + } - /* Move result to destination. */ - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 0)); + /* Move result to destination. */ + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); - /* Negate result if required. */ - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit_simple(AOP(result), 1, 7)); - pic16_emitpcode(POC_NEGF, pic16_popGet(AOP(result), 0)); + /* Negate result if required. */ + pic16_emitpcode (POC_BTFSC, pic16_newpCodeOpBit_simple (AOP (result), 1, 7)); + pic16_emitpcode (POC_NEGF, pic16_popGet (AOP (result), 0)); - /* Sign-extend. */ - pic16_addSign(result, 2, 1); - } + /* Sign-extend. */ + pic16_addSign (result, 2, 1); + } /* clean up stack */ - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(pic16_stack_preinc)); - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(pic16_stack_preinc)); + pic16_emitpcode (POC_MOVFW, pic16_popCopyReg (pic16_stack_preinc)); + pic16_emitpcode (POC_MOVFW, pic16_popCopyReg (pic16_stack_preinc)); goto release; } #if 0 - /* special cases first */ - /* both are bits */ - if (AOP_TYPE(left) == AOP_CRY && - AOP_TYPE(right)== AOP_CRY) { - genDivbits(left,right,result); - goto release ; - } - - /* if both are of size == 1 */ - if (AOP_SIZE(left) == 1 && - AOP_SIZE(right) == 1 ) { - genDivOneByte(left,right,result); - goto release ; + /* special cases first */ + /* both are bits */ + if (AOP_TYPE (left) == AOP_CRY && AOP_TYPE (right) == AOP_CRY) + { + genDivbits (left, right, result); + goto release; + } + + /* if both are of size == 1 */ + if (AOP_SIZE (left) == 1 && AOP_SIZE (right) == 1) + { + genDivOneByte (left, right, result); + goto release; } #endif - /* should have been converted to function call */ - assert(0); -release : - pic16_freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(result,NULL,ic,TRUE); + /* should have been converted to function call */ + assert (0); +release: + pic16_freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (result, NULL, ic, TRUE); } #if 0 /*-----------------------------------------------------------------*/ /* genModbits :- modulus of bits */ /*-----------------------------------------------------------------*/ -static void genModbits (operand *left, - operand *right, - operand *result) +static void +genModbits (operand * left, operand * right, operand * result) { char *l; - FENTRY; + FENTRY; - werror(W_POSSBUG2, __FILE__, __LINE__); - /* the result must be bit */ - pic16_emitcode("mov","b,%s",pic16_aopGet(AOP(right),0,FALSE,FALSE)); - l = pic16_aopGet(AOP(left),0,FALSE,FALSE); - - MOVA(l); - - pic16_emitcode("div","ab"); - pic16_emitcode("mov","a,b"); - pic16_emitcode("rrc","a"); - pic16_aopPut(AOP(result),"c",0); + werror (W_POSSBUG2, __FILE__, __LINE__); + /* the result must be bit */ + pic16_emitcode ("mov", "b,%s", pic16_aopGet (AOP (right), 0, FALSE, FALSE)); + l = pic16_aopGet (AOP (left), 0, FALSE, FALSE); + + MOVA (l); + + pic16_emitcode ("div", "ab"); + pic16_emitcode ("mov", "a,b"); + pic16_emitcode ("rrc", "a"); + pic16_aopPut (AOP (result), "c", 0); } /*-----------------------------------------------------------------*/ /* genModOneByte : 8 bit modulus */ /*-----------------------------------------------------------------*/ -static void genModOneByte (operand *left, - operand *right, - operand *result) -{ - sym_link *opetype = operandType(result); - char *l ; - symbol *lbl ; - - FENTRY; - werror(W_POSSBUG2, __FILE__, __LINE__); - - /* signed or unsigned */ - if (SPEC_USIGN(opetype)) { - /* unsigned is easy */ - pic16_emitcode("mov","b,%s", pic16_aopGet(AOP(right),0,FALSE,FALSE)); - l = pic16_aopGet(AOP(left),0,FALSE,FALSE); - MOVA(l); - pic16_emitcode("div","ab"); - pic16_aopPut(AOP(result),"b",0); - return ; - } - - /* signed is a little bit more difficult */ - - /* save the signs of the operands */ - l = pic16_aopGet(AOP(left),0,FALSE,FALSE); - MOVA(l); - - pic16_emitcode("xrl","a,%s",pic16_aopGet(AOP(right),0,FALSE,FALSE)); - pic16_emitcode("push","acc"); /* save it on the stack */ - - /* now sign adjust for both left & right */ - l = pic16_aopGet(AOP(right),0,FALSE,FALSE); - MOVA(l); - - lbl = newiTempLabel(NULL); - pic16_emitcode("jnb","acc.7,%05d_DS_",(lbl->key+100)); - pic16_emitcode("cpl","a"); - pic16_emitcode("inc","a"); - pic16_emitcode("","%05d_DS_:",(lbl->key+100)); - pic16_emitcode("mov","b,a"); - - /* sign adjust left side */ - l = pic16_aopGet(AOP(left),0,FALSE,FALSE); - MOVA(l); - - lbl = newiTempLabel(NULL); - pic16_emitcode("jnb","acc.7,%05d_DS_",(lbl->key+100)); - pic16_emitcode("cpl","a"); - pic16_emitcode("inc","a"); - pic16_emitcode("","%05d_DS_:",(lbl->key+100)); - - /* now the multiplication */ - pic16_emitcode("div","ab"); - /* we are interested in the lower order - only */ - lbl = newiTempLabel(NULL); - pic16_emitcode("pop","acc"); - /* if there was an over flow we don't - adjust the sign of the result */ - pic16_emitcode("jb","ov,%05d_DS_",(lbl->key+100)); - pic16_emitcode("jnb","acc.7,%05d_DS_",(lbl->key+100)); - CLRC ; - pic16_emitcode("clr","a"); - pic16_emitcode("subb","a,b"); - pic16_emitcode("mov","b,a"); - pic16_emitcode("","%05d_DS_:",(lbl->key+100)); +static void +genModOneByte (operand * left, operand * right, operand * result) +{ + sym_link *opetype = operandType (result); + char *l; + symbol *lbl; + + FENTRY; + werror (W_POSSBUG2, __FILE__, __LINE__); + + /* signed or unsigned */ + if (SPEC_USIGN (opetype)) + { + /* unsigned is easy */ + pic16_emitcode ("mov", "b,%s", pic16_aopGet (AOP (right), 0, FALSE, FALSE)); + l = pic16_aopGet (AOP (left), 0, FALSE, FALSE); + MOVA (l); + pic16_emitcode ("div", "ab"); + pic16_aopPut (AOP (result), "b", 0); + return; + } - /* now we are done */ - pic16_aopPut(AOP(result),"b",0); + /* signed is a little bit more difficult */ + + /* save the signs of the operands */ + l = pic16_aopGet (AOP (left), 0, FALSE, FALSE); + MOVA (l); + + pic16_emitcode ("xrl", "a,%s", pic16_aopGet (AOP (right), 0, FALSE, FALSE)); + pic16_emitcode ("push", "acc"); /* save it on the stack */ + + /* now sign adjust for both left & right */ + l = pic16_aopGet (AOP (right), 0, FALSE, FALSE); + MOVA (l); + + lbl = newiTempLabel (NULL); + pic16_emitcode ("jnb", "acc.7,%05d_DS_", labelKey2num (lbl->key)); + pic16_emitcode ("cpl", "a"); + pic16_emitcode ("inc", "a"); + pic16_emitcode ("", "%05d_DS_:", labelKey2num (lbl->key)); + pic16_emitcode ("mov", "b,a"); + + /* sign adjust left side */ + l = pic16_aopGet (AOP (left), 0, FALSE, FALSE); + MOVA (l); + + lbl = newiTempLabel (NULL); + pic16_emitcode ("jnb", "acc.7,%05d_DS_", labelKey2num (lbl->key)); + pic16_emitcode ("cpl", "a"); + pic16_emitcode ("inc", "a"); + pic16_emitcode ("", "%05d_DS_:", labelKey2num (lbl->key)); + + /* now the multiplication */ + pic16_emitcode ("div", "ab"); + /* we are interested in the lower order + only */ + lbl = newiTempLabel (NULL); + pic16_emitcode ("pop", "acc"); + /* if there was an over flow we don't + adjust the sign of the result */ + pic16_emitcode ("jb", "ov,%05d_DS_", labelKey2num (lbl->key)); + pic16_emitcode ("jnb", "acc.7,%05d_DS_", labelKey2num (lbl->key)); + CLRC; + pic16_emitcode ("clr", "a"); + pic16_emitcode ("subb", "a,b"); + pic16_emitcode ("mov", "b,a"); + pic16_emitcode ("", "%05d_DS_:", labelKey2num (lbl->key)); + + /* now we are done */ + pic16_aopPut (AOP (result), "b", 0); } #endif @@ -4176,44 +4625,45 @@ /*-----------------------------------------------------------------*/ /* genMod - generates code for division */ /*-----------------------------------------------------------------*/ -static void genMod (iCode *ic) +static void +genMod (iCode * ic) { /* Task deferred to genDiv */ - genDiv(ic); + genDiv (ic); #if 0 - operand *left = IC_LEFT(ic); - operand *right = IC_RIGHT(ic); - operand *result= IC_RESULT(ic); - - FENTRY; + operand *left = IC_LEFT (ic); + operand *right = IC_RIGHT (ic); + operand *result = IC_RESULT (ic); - /* assign the amsops */ - pic16_aopOp (left,ic,FALSE); - pic16_aopOp (right,ic,FALSE); - pic16_aopOp (result,ic,TRUE); + FENTRY; - /* special cases first */ - /* both are bits */ - if (AOP_TYPE(left) == AOP_CRY && - AOP_TYPE(right)== AOP_CRY) { - genModbits(left,right,result); - goto release ; + /* assign the amsops */ + pic16_aopOp (left, ic, FALSE); + pic16_aopOp (right, ic, FALSE); + pic16_aopOp (result, ic, TRUE); + + /* special cases first */ + /* both are bits */ + if (AOP_TYPE (left) == AOP_CRY && AOP_TYPE (right) == AOP_CRY) + { + genModbits (left, right, result); + goto release; } - /* if both are of size == 1 */ - if (AOP_SIZE(left) == 1 && - AOP_SIZE(right) == 1 ) { - genModOneByte(left,right,result); - goto release ; + /* if both are of size == 1 */ + if (AOP_SIZE (left) == 1 && AOP_SIZE (right) == 1) + { + genModOneByte (left, right, result); + goto release; } - /* should have been converted to function call */ - assert(0); + /* should have been converted to function call */ + assert (0); -release : - pic16_freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(result,NULL,ic,TRUE); +release: + pic16_freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (result, NULL, ic, TRUE); #endif } @@ -4223,73 +4673,82 @@ /* note: May need to add parameter to indicate when a variable is in bit space. */ -static void genIfxJump (iCode *ic, char *jval) +static void +genIfxJump (iCode * ic, char *jval) { FENTRY; - /* if true label then we jump if condition - supplied is true */ - if ( IC_TRUE(ic) ) { + /* if true label then we jump if condition + supplied is true */ + if (IC_TRUE (ic)) + { - if(strcmp(jval,"a") == 0) - emitSKPZ; - else if (strcmp(jval,"c") == 0) - emitSKPNC; - else { - DEBUGpic16_emitcode ("; ***","%d - assuming %s is in bit space",__LINE__,jval); - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit(jval,-1,1, PO_GPR_REGISTER)); + if (strcmp (jval, "a") == 0) + emitSKPZ; + else if (strcmp (jval, "c") == 0) + emitSKPNC; + else + { + DEBUGpic16_emitcode ("; ***", "%d - assuming %s is in bit space", __LINE__, jval); + pic16_emitpcode (POC_BTFSC, pic16_newpCodeOpBit (jval, -1, 1, PO_GPR_REGISTER)); } - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_TRUE(ic)->key)); - pic16_emitcode(" goto","_%05d_DS_",IC_TRUE(ic)->key+100 + pic16_labelOffset); + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_TRUE (ic)->key)); + pic16_emitcode (" goto", "_%05d_DS_", labelKey2num (IC_TRUE (ic)->key + pic16_labelOffset)); } - else { - /* false label is present */ - if(strcmp(jval,"a") == 0) - emitSKPNZ; - else if (strcmp(jval,"c") == 0) - emitSKPC; - else { - DEBUGpic16_emitcode ("; ***","%d - assuming %s is in bit space",__LINE__,jval); - pic16_emitpcode(POC_BTFSS, pic16_newpCodeOpBit(jval,-1,1, PO_GPR_REGISTER)); + else + { + /* false label is present */ + if (strcmp (jval, "a") == 0) + emitSKPNZ; + else if (strcmp (jval, "c") == 0) + emitSKPC; + else + { + DEBUGpic16_emitcode ("; ***", "%d - assuming %s is in bit space", __LINE__, jval); + pic16_emitpcode (POC_BTFSS, pic16_newpCodeOpBit (jval, -1, 1, PO_GPR_REGISTER)); } - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_FALSE(ic)->key)); - pic16_emitcode(" goto","_%05d_DS_",IC_FALSE(ic)->key+100 + pic16_labelOffset); + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_FALSE (ic)->key)); + pic16_emitcode (" goto", "_%05d_DS_", labelKey2num (IC_FALSE (ic)->key + pic16_labelOffset)); } - /* mark the icode as generated */ - ic->generated = 1; + /* mark the icode as generated */ + ic->generated = 1; } -static void genIfxpCOpJump (iCode *ic, pCodeOp *jop) +static void +genIfxpCOpJump (iCode * ic, pCodeOp * jop) { FENTRY; - /* if true label then we jump if condition - supplied is true */ - if ( IC_TRUE(ic) ) { - DEBUGpic16_emitcode ("; ***","%d - assuming is in bit space",__LINE__); - pic16_emitpcode(POC_BTFSC, jop); + /* if true label then we jump if condition + supplied is true */ + if (IC_TRUE (ic)) + { + DEBUGpic16_emitcode ("; ***", "%d - assuming is in bit space", __LINE__); + pic16_emitpcode (POC_BTFSC, jop); - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_TRUE(ic)->key)); - pic16_emitcode(" goto","_%05d_DS_",IC_TRUE(ic)->key+100 + pic16_labelOffset); + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_TRUE (ic)->key)); + pic16_emitcode (" goto", "_%05d_DS_", labelKey2num (IC_TRUE (ic)->key + pic16_labelOffset)); - } else { + } + else + { /* false label is present */ - DEBUGpic16_emitcode ("; ***","%d - assuming is in bit space",__LINE__); - pic16_emitpcode(POC_BTFSS, jop); + DEBUGpic16_emitcode ("; ***", "%d - assuming is in bit space", __LINE__); + pic16_emitpcode (POC_BTFSS, jop); - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_FALSE(ic)->key)); - pic16_emitcode(" goto","_%05d_DS_",IC_FALSE(ic)->key+100 + pic16_labelOffset); + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_FALSE (ic)->key)); + pic16_emitcode (" goto", "_%05d_DS_", labelKey2num (IC_FALSE (ic)->key + pic16_labelOffset)); } - /* mark the icode as generated */ - ic->generated = 1; + /* mark the icode as generated */ + ic->generated = 1; } #if 0 @@ -4298,51 +4757,57 @@ /*-----------------------------------------------------------------*/ /* genSkip */ /*-----------------------------------------------------------------*/ -static void genSkip(iCode *ifx,int status_bit) +static void +genSkip (iCode * ifx, int status_bit) { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if(!ifx) + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + if (!ifx) return; - if ( IC_TRUE(ifx) ) { - switch(status_bit) { - case 'z': - emitSKPNZ; - break; + if (IC_TRUE (ifx)) + { + switch (status_bit) + { + case 'z': + emitSKPNZ; + break; - case 'c': - emitSKPNC; - break; + case 'c': + emitSKPNC; + break; - case 'd': - emitSKPDC; - break; + case 'd': + emitSKPDC; + break; - } + } - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_TRUE(ifx)->key)); - // pic16_emitcode("goto","_%05d_DS_",IC_TRUE(ifx)->key+100+pic16_labelOffset); + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_TRUE (ifx)->key)); + // pic16_emitcode("goto","_%05d_DS_",labelKey2num (IC_TRUE(ifx)->key + pic16_labelOffset)); - } else { + } + else + { - switch(status_bit) { + switch (status_bit) + { - case 'z': - emitSKPZ; - break; + case 'z': + emitSKPZ; + break; - case 'c': - emitSKPC; - break; + case 'c': + emitSKPC; + break; - case 'd': - emitSKPDC; - break; - } - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_FALSE(ifx)->key)); - // pic16_emitcode("goto","_%05d_DS_",IC_FALSE(ifx)->key+100+pic16_labelOffset); + case 'd': + emitSKPDC; + break; + } + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_FALSE (ifx)->key)); + // pic16_emitcode("goto","_%05d_DS_",labelKey2num (IC_FALSE(ifx)->key + pic16_labelOffset)); - } + } } #endif @@ -4350,19 +4815,20 @@ /*-----------------------------------------------------------------*/ /* genSkipc */ /*-----------------------------------------------------------------*/ -static void genSkipc(resolvedIfx *rifx) +static void +genSkipc (resolvedIfx * rifx) { - DEBUGpic16_emitcode ("; ***","%s %d rifx= %p",__FUNCTION__,__LINE__, rifx); + DEBUGpic16_emitcode ("; ***", "%s %d rifx= %p", __FUNCTION__, __LINE__, rifx); - if(!rifx) + if (!rifx) return; - if(rifx->condition) + if (rifx->condition) emitSKPNC; else emitSKPC; - pic16_emitpcode(POC_GOTO, pic16_popGetLabel(rifx->lbl->key)); + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (rifx->lbl->key)); rifx->generated = 1; } @@ -4371,12 +4837,17 @@ /* aop (if it's NOT a literal) or from lit (if */ /* aop is a literal) */ /*-----------------------------------------------------------------*/ -void mov2w_regOrLit (asmop *aop, unsigned long lit, int offset) { - if (aop->type == AOP_LIT) { - pic16_emitpcode (POC_MOVLW, pic16_popGetLit(lit >> (offset*8))); - } else { - pic16_emitpcode (POC_MOVFW, pic16_popGet (aop, offset)); - } +void +mov2w_regOrLit (asmop * aop, unsigned long lit, int offset) +{ + if (aop->type == AOP_LIT) + { + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (lit >> (offset * 8))); + } + else + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (aop, offset)); + } } /*-----------------------------------------------------------------*/ @@ -4391,8 +4862,8 @@ * "B[CS]F STATUS,0; BTFS[CS] STATUS,0" * which should be optmized by the peephole * optimizer - RN 2005-01-01 */ -static void genCmp (operand *left,operand *right, - operand *result, iCode *ifx, int sign) +static void +genCmp (operand * left, operand * right, operand * result, iCode * ifx, int sign) { resolvedIfx rIfx; int size; @@ -4406,10 +4877,10 @@ FENTRY; assert (left && right); - assert (AOP_SIZE(left) == AOP_SIZE(right)); + assert (AOP_SIZE (left) == AOP_SIZE (right)); - size = AOP_SIZE(right) - 1; - mask = (0x100UL << (size*8)) - 1; + size = AOP_SIZE (right) - 1; + mask = (0x100UL << (size * 8)) - 1; // in the end CARRY holds "left < right" (performedLt == 1) or "left >= right" (performedLt == 0) performedLt = 1; templbl = NULL; @@ -4418,93 +4889,122 @@ resolveIfx (&rIfx, ifx); /* handle for special cases */ - if(pic16_genCmp_special(left, right, result, ifx, &rIfx, sign)) - return; + if (pic16_genCmp_special (left, right, result, ifx, &rIfx, sign)) + return; /********************************************************************** * handle bits - bit compares are promoted to int compares seemingly! * **********************************************************************/ #if 0 // THIS IS COMPLETELY UNTESTED! - if (AOP_TYPE(left) == AOP_CRY && AOP_TYPE(right) == AOP_CRY) { - pCodeOp *pcleft = pic16_popGet(AOP(left), 0); - pCodeOp *pcright = pic16_popGet(AOP(right), 0); - assert (pcleft->type == PO_GPR_BIT && pcright->type == PO_GPR_BIT); - - emitSETC; - // 1 < {0,1} is false --> clear C by skipping the next instruction - //pic16_emitpcode (POC_BTFSS, pic16_popCopyGPR2Bit (AOP(left),0), PCORB(pcleft)->bit); - pic16_emitpcode (POC_BTFSS, pic16_popGet (AOP(left), 0)); - // {0,1} < 0 is false --> clear C by NOT skipping the next instruction - pic16_emitpcode (POC_BTFSS, pic16_popCopyGPR2Bit (pic16_popGet(AOP(right),0), PCORB(pcright)->bit)); - emitCLRC; // only skipped for left=0 && right=1 + if (AOP_TYPE (left) == AOP_CRY && AOP_TYPE (right) == AOP_CRY) + { + pCodeOp *pcleft = pic16_popGet (AOP (left), 0); + pCodeOp *pcright = pic16_popGet (AOP (right), 0); + assert (pcleft->type == PO_GPR_BIT && pcright->type == PO_GPR_BIT); + + emitSETC; + // 1 < {0,1} is false --> clear C by skipping the next instruction + //pic16_emitpcode (POC_BTFSS, pic16_popCopyGPR2Bit (AOP(left),0), PCORB(pcleft)->bit); + pic16_emitpcode (POC_BTFSS, pic16_popGet (AOP (left), 0)); + // {0,1} < 0 is false --> clear C by NOT skipping the next instruction + pic16_emitpcode (POC_BTFSS, pic16_popCopyGPR2Bit (pic16_popGet (AOP (right), 0), PCORB (pcright)->bit)); + emitCLRC; // only skipped for left=0 && right=1 - goto correct_result_in_carry; - } // if + goto correct_result_in_carry; + } // if #endif /************************************************* * make sure that left is register (or the like) * *************************************************/ - if (!isAOP_REGlike(left)) { - DEBUGpc ("swapping arguments (AOP_TYPEs %d/%d)", AOP_TYPE(left), AOP_TYPE(right)); - assert (isAOP_LIT(left)); - assert (isAOP_REGlike(right)); - // swap left and right - // left < right <==> right > left <==> (right >= left + 1) - lit = ulFromVal (AOP(left)->aopu.aop_lit); - - if ( (!sign && (lit & mask) == mask) || (sign && (lit & mask) == (mask >> 1)) ) { - // MAXVALUE < right? always false - if (performedLt) emitCLRC; else emitSETC; - goto correct_result_in_carry; - } // if + if (!isAOP_REGlike (left)) + { + DEBUGpc ("swapping arguments (AOP_TYPEs %d/%d)", AOP_TYPE (left), AOP_TYPE (right)); + assert (isAOP_LIT (left)); + assert (isAOP_REGlike (right)); + // swap left and right + // left < right <==> right > left <==> (right >= left + 1) + lit = ulFromVal (AOP (left)->aopu.aop_lit); + + if ((!sign && (lit & mask) == mask) || (sign && (lit & mask) == (mask >> 1))) + { + // MAXVALUE < right? always false + if (performedLt) + emitCLRC; + else + emitSETC; + goto correct_result_in_carry; + } // if + + // This fails for lit = 0xFF (unsigned) AND lit = 0x7F (signed), + // that's why we handled it above. + lit++; - // This fails for lit = 0xFF (unsigned) AND lit = 0x7F (signed), - // that's why we handled it above. - lit++; - - dummy = left; - left = right; - right = dummy; - - performedLt ^= 1; // instead of "left < right" we check for "right >= left+1, i.e. "right < left+1" - } else if (isAOP_LIT(right)) { - lit = ulFromVal (AOP(right)->aopu.aop_lit); - } // if + dummy = left; + left = right; + right = dummy; - assert (isAOP_REGlike(left)); // left must be register or the like - assert (isAOP_REGlike(right) || isAOP_LIT(right)); // right may be register-like or a literal + performedLt ^= 1; // instead of "left < right" we check for "right >= left+1, i.e. "right < left+1" + } + else if (isAOP_LIT (right)) + { + lit = ulFromVal (AOP (right)->aopu.aop_lit); + } // if + + assert (isAOP_REGlike (left)); // left must be register or the like + assert (isAOP_REGlike (right) || isAOP_LIT (right)); // right may be register-like or a literal /************************************************* * special cases go here * *************************************************/ - if (isAOP_LIT(right)) { - if (!sign) { - // unsigned comparison to a literal - DEBUGpc ("unsigned compare: left %s lit(0x%X=%lu), size=%d", performedLt ? "<" : ">=", lit, lit, size+1); - if (lit == 0) { - // unsigned left < 0? always false - if (performedLt) emitCLRC; else emitSETC; - goto correct_result_in_carry; - } - } else { - // signed comparison to a literal - DEBUGpc ("signed compare: left %s lit(0x%X=%ld), size=%d, mask=%x", performedLt ? "<" : ">=", lit, lit, size+1, mask); - if ((lit & mask) == ((0x80 << (size*8)) & mask)) { - // signed left < 0x80000000? always false - if (performedLt) emitCLRC; else emitSETC; - goto correct_result_in_carry; - } else if (lit == 0) { - // compare left < 0; set CARRY if SIGNBIT(left) is set - if (performedLt) emitSETC; else emitCLRC; - pic16_emitpcode (POC_BTFSS, pic16_popCopyGPR2Bit(pic16_popGet (AOP(left), size), 7)); - if (performedLt) emitCLRC; else emitSETC; - goto correct_result_in_carry; - } - } // if (!sign) - } // right is literal + if (isAOP_LIT (right)) + { + if (!sign) + { + // unsigned comparison to a literal + DEBUGpc ("unsigned compare: left %s lit(0x%X=%lu), size=%d", performedLt ? "<" : ">=", lit, lit, size + 1); + if (lit == 0) + { + // unsigned left < 0? always false + if (performedLt) + emitCLRC; + else + emitSETC; + goto correct_result_in_carry; + } + } + else + { + // signed comparison to a literal + DEBUGpc ("signed compare: left %s lit(0x%X=%ld), size=%d, mask=%x", performedLt ? "<" : ">=", lit, lit, size + 1, + mask); + if ((lit & mask) == ((0x80 << (size * 8)) & mask)) + { + // signed left < 0x80000000? always false + if (performedLt) + emitCLRC; + else + emitSETC; + goto correct_result_in_carry; + } + else if (lit == 0) + { + // compare left < 0; set CARRY if SIGNBIT(left) is set + if (performedLt) + emitSETC; + else + emitCLRC; + pic16_emitpcode (POC_BTFSS, pic16_popCopyGPR2Bit (pic16_popGet (AOP (left), size), 7)); + if (performedLt) + emitCLRC; + else + emitSETC; + goto correct_result_in_carry; + } + } // if (!sign) + } // right is literal /************************************************* * perform a general case comparison * @@ -4512,52 +5012,95 @@ *************************************************/ // compare most significant bytes //DEBUGpc ("comparing bytes at offset %d", size); - if (!sign) { - // unsigned comparison - mov2w_regOrLit (AOP(right), lit, size); - pic16_emitpcode (POC_SUBFW, pic16_popGet (AOP(left), size)); - } else { - // signed comparison - // (add 2^n to both operands then perform an unsigned comparison) - if (isAOP_LIT(right)) { - // left >= LIT <-> LIT-left <= 0 <-> LIT-left == 0 OR !(LIT-left >= 0) - unsigned char litbyte = (lit >> (8*size)) & 0xFF; - - if (litbyte == 0x80) { - // left >= 0x80 -- always true, but more bytes to come - pic16_mov2w (AOP(left), size); - pic16_emitpcode (POC_XORLW, pic16_popGetLit (0x80)); // set ZERO flag - emitSETC; - } else { - // left >= LIT <-> left + (-LIT) >= 0 <-> left + (0x100-LIT) >= 0x100 - pic16_mov2w (AOP(left), size); - pic16_emitpcode (POC_ADDLW, pic16_popGetLit (0x80)); - pic16_emitpcode (POC_ADDLW, pic16_popGetLit ((0x100 - (litbyte + 0x80)) & 0x00FF)); - } // if - } else { - /* using PRODL as a temporary register here */ - pCodeOp *pctemp = pic16_popCopyReg(&pic16_pc_prodl); - //pCodeOp *pctemp = pic16_popGetTempReg(1); - pic16_mov2w (AOP(left), size); - pic16_emitpcode (POC_ADDLW, pic16_popGetLit (0x80)); - pic16_emitpcode (POC_MOVWF, pctemp); - pic16_mov2w (AOP(right), size); - pic16_emitpcode (POC_ADDLW, pic16_popGetLit (0x80)); - pic16_emitpcode (POC_SUBFW, pctemp); - //pic16_popReleaseTempReg(pctemp, 1); + if (!sign) + { + // unsigned comparison + if (AOP_TYPE (left) == AOP_PCODE && AOP (left)->aopu.pcop->type == PO_IMMEDIATE) + { + // right >= left(PO_IMMEDIATE) + pic16_emitpcode (POC_MOVLW, pic16_popGetImmed (AOP (left), size, 1)); // left+1 + pic16_emitpcode (POC_SUBFW, pic16_popGet(AOP (right), size)); + performedLt = 0; + } + else if (AOP_TYPE (right) == AOP_PCODE && AOP (right)->aopu.pcop->type == PO_IMMEDIATE) + { + // left < right(PO_IMMEDIATE) + pic16_emitpcode (POC_MOVLW, pic16_popGetImmed (AOP (right), size, 0)); // right+0 + pic16_emitpcode (POC_SUBFW, pic16_popGet (AOP (left), size)); + } + else + { + mov2w_regOrLit (AOP(right), lit, size); + pic16_emitpcode (POC_SUBFW, pic16_popGet (AOP (left), size)); + } } - } // if (!sign) + else + { + // signed comparison + // (add 2^n to both operands then perform an unsigned comparison) + if (isAOP_LIT (right)) + { + // left >= LIT <-> LIT-left <= 0 <-> LIT-left == 0 OR !(LIT-left >= 0) + unsigned char litbyte = (lit >> (8 * size)) & 0xFF; - // compare remaining bytes (treat as unsigned case from above) - templbl = newiTempLabel ( NULL ); - offs = size; - while (offs--) { - //DEBUGpc ("comparing bytes at offset %d", offs); - pic16_emitpcode (POC_BNZ, pic16_popGetLabel (templbl->key)); - mov2w_regOrLit (AOP(right), lit, offs); - pic16_emitpcode (POC_SUBFW, pic16_popGet (AOP(left), offs)); - } // while (offs) - pic16_emitpLabel (templbl->key); + if (litbyte == 0x80) + { + // left >= 0x80 -- always true, but more bytes to come + pic16_mov2w (AOP (left), size); + pic16_emitpcode (POC_XORLW, pic16_popGetLit (0x80)); // set ZERO flag + emitSETC; + } + else + { + // left >= LIT <-> left + (-LIT) >= 0 <-> left + (0x100-LIT) >= 0x100 + pic16_mov2w (AOP (left), size); + pic16_emitpcode (POC_ADDLW, pic16_popGetLit (0x80)); + pic16_emitpcode (POC_ADDLW, pic16_popGetLit ((0x100 - (litbyte + 0x80)) & 0x00FF)); + } // if + } + else + { + /* using PRODL as a temporary register here */ + pCodeOp *pctemp = pic16_popCopyReg (&pic16_pc_prodl); + //pCodeOp *pctemp = pic16_popGetTempReg(1); + pic16_mov2w (AOP (left), size); + pic16_emitpcode (POC_ADDLW, pic16_popGetLit (0x80)); + pic16_emitpcode (POC_MOVWF, pctemp); + pic16_mov2w (AOP (right), size); + pic16_emitpcode (POC_ADDLW, pic16_popGetLit (0x80)); + pic16_emitpcode (POC_SUBFW, pctemp); + //pic16_popReleaseTempReg(pctemp, 1); + } + } // if (!sign) + + // compare remaining bytes (treat as unsigned case from above) + templbl = newiTempLabel (NULL); + offs = size; + while (offs--) + { + //DEBUGpc ("comparing bytes at offset %d", offs); + pic16_emitpcode (POC_BNZ, pic16_popGetLabel (templbl->key)); + + if (AOP_TYPE (left) == AOP_PCODE && AOP (left)->aopu.pcop->type == PO_IMMEDIATE) + { + // right >= left(PO_IMMEDIATE) + pic16_emitpcode (POC_MOVLW, pic16_popGetImmed( AOP (left), offs, 1)); // left+1 + pic16_emitpcode (POC_SUBFW, pic16_popGet (AOP (right), offs)); + performedLt = 0; + } + else if (AOP_TYPE (right) == AOP_PCODE && AOP (right)->aopu.pcop->type == PO_IMMEDIATE) + { + // left < right(PO_IMMEDIATE) + pic16_emitpcode (POC_MOVLW, pic16_popGetImmed (AOP (right), offs, 0)); // right+0 + pic16_emitpcode (POC_SUBFW, pic16_popGet (AOP (left), offs)); + } + else + { + mov2w_regOrLit (AOP (right), lit, offs); + pic16_emitpcode (POC_SUBFW, pic16_popGet (AOP (left), offs)); + } + } // while (offs) + pic16_emitpLabel (templbl->key); goto result_in_carry; result_in_carry: @@ -4569,117 +5112,134 @@ * (F=left, W=right) * ****************************************************/ - if (performedLt) { - if (result && AOP_TYPE(result) != AOP_CRY) { - // value will be stored - emitTOGC; - } else { - // value wil only be used in the following genSkipc() - rIfx.condition ^= 1; - } - } // if + if (performedLt) + { + if (result && AOP_TYPE (result) != AOP_CRY) + { + // value will be stored + emitTOGC; + } + else + { + // value wil only be used in the following genSkipc() + rIfx.condition ^= 1; + } + } // if correct_result_in_carry: // assign result to variable (if neccessary) - if (result && AOP_TYPE(result) != AOP_CRY) { - //DEBUGpc ("assign result"); - size = AOP_SIZE(result); - while (size--) { - pic16_emitpcode (POC_CLRF, pic16_popGet (AOP(result), size)); - } // while - pic16_emitpcode (POC_RLCF, pic16_popGet (AOP(result), 0)); - } // if (result) + if (result && AOP_TYPE (result) != AOP_CRY) + { + //DEBUGpc ("assign result"); + size = AOP_SIZE (result); + while (size--) + { + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), size)); + } // while + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), 0)); + } // if (result) // perform conditional jump - if (ifx) { - //DEBUGpc ("generate control flow"); - genSkipc (&rIfx); - ifx->generated = 1; - } // if + if (ifx) + { + //DEBUGpc ("generate control flow"); + genSkipc (&rIfx); + ifx->generated = 1; + } // if } /*-----------------------------------------------------------------*/ /* genCmpGt :- greater than comparison */ /*-----------------------------------------------------------------*/ -static void genCmpGt (iCode *ic, iCode *ifx) +static void +genCmpGt (iCode * ic, iCode * ifx) { operand *left, *right, *result; - sym_link *letype , *retype; - int sign ; + sym_link *letype, *retype; + int sign; + + FENTRY; + + left = IC_LEFT (ic); + right = IC_RIGHT (ic); + result = IC_RESULT (ic); + + sign = 0; + if (IS_SPEC (operandType (left)) && IS_SPEC (operandType (right))) + { + letype = getSpec (operandType (left)); + retype = getSpec (operandType (right)); + sign = !(SPEC_USIGN (letype) | SPEC_USIGN (retype)); + } - FENTRY; + /* assign the amsops */ + pic16_aopOp (left, ic, FALSE); + pic16_aopOp (right, ic, FALSE); + pic16_aopOp (result, ic, TRUE); - left = IC_LEFT(ic); - right= IC_RIGHT(ic); - result = IC_RESULT(ic); - - letype = getSpec(operandType(left)); - retype =getSpec(operandType(right)); - sign = !(SPEC_USIGN(letype) | SPEC_USIGN(retype)); - /* assign the amsops */ - pic16_aopOp (left,ic,FALSE); - pic16_aopOp (right,ic,FALSE); - pic16_aopOp (result,ic,TRUE); - - genCmp(right, left, result, ifx, sign); - - pic16_freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(result,NULL,ic,TRUE); + genCmp (right, left, result, ifx, sign); + + pic16_freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genCmpLt - less than comparisons */ /*-----------------------------------------------------------------*/ -static void genCmpLt (iCode *ic, iCode *ifx) +static void +genCmpLt (iCode * ic, iCode * ifx) { operand *left, *right, *result; - sym_link *letype , *retype; - int sign ; + sym_link *letype, *retype; + int sign; - FENTRY; + FENTRY; - left = IC_LEFT(ic); - right= IC_RIGHT(ic); - result = IC_RESULT(ic); + left = IC_LEFT (ic); + right = IC_RIGHT (ic); + result = IC_RESULT (ic); - letype = getSpec(operandType(left)); - retype =getSpec(operandType(right)); - sign = !(SPEC_USIGN(letype) | SPEC_USIGN(retype)); + sign = 0; + if (IS_SPEC (operandType (left)) && IS_SPEC (operandType (right))) + { + letype = getSpec (operandType (left)); + retype = getSpec (operandType (right)); + sign = !(SPEC_USIGN (letype) | SPEC_USIGN (retype)); + } - /* assign the amsops */ - pic16_aopOp (left,ic,FALSE); - pic16_aopOp (right,ic,FALSE); - pic16_aopOp (result,ic,TRUE); + /* assign the amsops */ + pic16_aopOp (left, ic, FALSE); + pic16_aopOp (right, ic, FALSE); + pic16_aopOp (result, ic, TRUE); - genCmp(left, right, result, ifx, sign); + genCmp (left, right, result, ifx, sign); - pic16_freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* pic16_isLitOp - check if operand has to be treated as literal */ /*-----------------------------------------------------------------*/ -bool pic16_isLitOp(operand *op) +bool +pic16_isLitOp (operand * op) { - return ((AOP_TYPE(op) == AOP_LIT) - || ( (AOP_TYPE(op) == AOP_PCODE) - && ( (AOP(op)->aopu.pcop->type == PO_LITERAL) - || (AOP(op)->aopu.pcop->type == PO_IMMEDIATE) ))); + return ((AOP_TYPE (op) == AOP_LIT) + || ((AOP_TYPE (op) == AOP_PCODE) + && ((AOP (op)->aopu.pcop->type == PO_LITERAL) || (AOP (op)->aopu.pcop->type == PO_IMMEDIATE)))); } /*-----------------------------------------------------------------*/ /* pic16_isLitAop - check if operand has to be treated as literal */ /*-----------------------------------------------------------------*/ -bool pic16_isLitAop(asmop *aop) +bool +pic16_isLitAop (asmop * aop) { return ((aop->type == AOP_LIT) - || ( (aop->type == AOP_PCODE) - && ( (aop->aopu.pcop->type == PO_LITERAL) - || (aop->aopu.pcop->type == PO_IMMEDIATE) ))); + || ((aop->type == AOP_PCODE) && ((aop->aopu.pcop->type == PO_LITERAL) || (aop->aopu.pcop->type == PO_IMMEDIATE)))); } @@ -4687,118 +5247,123 @@ /*-----------------------------------------------------------------*/ /* genCmpEq - generates code for equal to */ /*-----------------------------------------------------------------*/ -static void genCmpEq (iCode *ic, iCode *ifx) +static void +genCmpEq (iCode * ic, iCode * ifx) { operand *left, *right, *result; - symbol *falselbl = newiTempLabel(NULL); - symbol *donelbl = newiTempLabel(NULL); + symbol *falselbl = newiTempLabel (NULL); + symbol *donelbl = newiTempLabel (NULL); int preserve_result = 0; int generate_result = 0; - int i=0; + int i = 0; unsigned long lit = -1; FENTRY; - pic16_aopOp((left=IC_LEFT(ic)),ic,FALSE); - pic16_aopOp((right=IC_RIGHT(ic)),ic,FALSE); - pic16_aopOp((result=IC_RESULT(ic)),ic,TRUE); + pic16_aopOp ((left = IC_LEFT (ic)), ic, FALSE); + pic16_aopOp ((right = IC_RIGHT (ic)), ic, FALSE); + pic16_aopOp ((result = IC_RESULT (ic)), ic, TRUE); - DEBUGpic16_pic16_AopType(__LINE__,left,right,result); + DEBUGpic16_pic16_AopType (__LINE__, left, right, result); - if( (AOP_TYPE(right) == AOP_CRY) || (AOP_TYPE(left) == AOP_CRY) ) + if ((AOP_TYPE (right) == AOP_CRY) || (AOP_TYPE (left) == AOP_CRY)) { - werror(W_POSSBUG2, __FILE__, __LINE__); - DEBUGpic16_emitcode ("; ***","%s %d -- ERROR",__FUNCTION__,__LINE__); - fprintf(stderr, "%s %d error - left/right CRY operands not supported\n",__FUNCTION__,__LINE__); + werror (W_POSSBUG2, __FILE__, __LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d -- ERROR", __FUNCTION__, __LINE__); + fprintf (stderr, "%s %d error - left/right CRY operands not supported\n", __FUNCTION__, __LINE__); goto release; } - if (pic16_isLitOp(left) || (AOP_TYPE(right) == AOP_ACC)) + if (pic16_isLitOp (left) || (AOP_TYPE (right) == AOP_ACC)) { - operand *tmp = right ; + operand *tmp = right; right = left; left = tmp; } - if (AOP_TYPE(right) == AOP_LIT) { - lit = ulFromVal (AOP(right)->aopu.aop_lit); - } + if (AOP_TYPE (right) == AOP_LIT) + { + lit = ulFromVal (AOP (right)->aopu.aop_lit); + } - if ( regsInCommon(left, result) || regsInCommon(right, result) ) + if (regsInCommon (left, result) || regsInCommon (right, result)) preserve_result = 1; - if(result && AOP_SIZE(result)) + if (result && AOP_SIZE (result)) generate_result = 1; - if(generate_result && !preserve_result) + if (generate_result && !preserve_result) { - for(i = 0; i < AOP_SIZE(result); i++) - pic16_emitpcode(POC_CLRF,pic16_popGet(AOP(result),i)); + for (i = 0; i < AOP_SIZE (result); i++) + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), i)); } - assert( AOP_SIZE(left) == AOP_SIZE(right) ); - for(i=0; i < AOP_SIZE(left); i++) + assert (AOP_SIZE (left) == AOP_SIZE (right)); + for (i = 0; i < AOP_SIZE (left); i++) { - if(AOP_TYPE(left) != AOP_ACC) + if (AOP_TYPE (left) != AOP_ACC) { - if(pic16_isLitOp(left)) - pic16_emitpcode(POC_MOVLW, pic16_popGet(AOP(left), i)); + if (pic16_isLitOp (left)) + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (left), i)); else - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(left), i)); + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), i)); } - if(pic16_isLitOp(right)) { - if (pic16_isLitOp(left) || (0 != ((lit >> (8*i))&0x00FF))) { - pic16_emitpcode(POC_XORLW, pic16_popGet(AOP(right), i)); + if (pic16_isLitOp (right)) + { + if (pic16_isLitOp (left) || (0 != ((lit >> (8 * i)) & 0x00FF))) + { + pic16_emitpcode (POC_XORLW, pic16_popGet (AOP (right), i)); + } } - } else - pic16_emitpcode(POC_XORFW, pic16_popGet(AOP(right), i)); + else + pic16_emitpcode (POC_XORFW, pic16_popGet (AOP (right), i)); - pic16_emitpcode(POC_BNZ,pic16_popGetLabel(falselbl->key)); + pic16_emitpcode (POC_BNZ, pic16_popGetLabel (falselbl->key)); } // result == true - if(generate_result && preserve_result) + if (generate_result && preserve_result) { - for(i = 0; i < AOP_SIZE(result); i++) - pic16_emitpcode(POC_CLRF,pic16_popGet(AOP(result),i)); + for (i = 0; i < AOP_SIZE (result); i++) + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), i)); } - if(generate_result) - pic16_emitpcode(POC_INCF, pic16_popGet(AOP(result), 0)); // result = true + if (generate_result) + pic16_emitpcode (POC_INCF, pic16_popGet (AOP (result), 0)); // result = true - if(generate_result && preserve_result) - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(donelbl->key)); + if (generate_result && preserve_result) + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (donelbl->key)); - if(ifx && IC_TRUE(ifx)) - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_TRUE(ifx)->key)); + if (ifx && IC_TRUE (ifx)) + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_TRUE (ifx)->key)); - if(ifx && IC_FALSE(ifx)) - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(donelbl->key)); + if (ifx && IC_FALSE (ifx)) + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (donelbl->key)); - pic16_emitpLabel(falselbl->key); + pic16_emitpLabel (falselbl->key); // result == false - if(ifx && IC_FALSE(ifx)) - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_FALSE(ifx)->key)); + if (ifx && IC_FALSE (ifx)) + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_FALSE (ifx)->key)); - if(generate_result && preserve_result) + if (generate_result && preserve_result) { - for(i = 0; i < AOP_SIZE(result); i++) - pic16_emitpcode(POC_CLRF,pic16_popGet(AOP(result),i)); + for (i = 0; i < AOP_SIZE (result); i++) + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), i)); } - pic16_emitpLabel(donelbl->key); + pic16_emitpLabel (donelbl->key); - if(ifx) + if (ifx) ifx->generated = 1; release: - pic16_freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (result, NULL, ic, TRUE); } @@ -4809,440 +5374,420 @@ /*-----------------------------------------------------------------*/ /* genCmpEq - generates code for equal to */ /*-----------------------------------------------------------------*/ -static void genCmpEq (iCode *ic, iCode *ifx) +static void +genCmpEq (iCode * ic, iCode * ifx) { - operand *left, *right, *result; - unsigned long lit = 0L; - int size,offset=0; - symbol *falselbl = newiTempLabel(NULL); + operand *left, *right, *result; + unsigned long lit = 0L; + int size, offset = 0; + symbol *falselbl = newiTempLabel (NULL); - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - if(ifx) - DEBUGpic16_emitcode ("; ifx is non-null",""); - else - DEBUGpic16_emitcode ("; ifx is null",""); + if (ifx) + DEBUGpic16_emitcode ("; ifx is non-null", ""); + else + DEBUGpic16_emitcode ("; ifx is null", ""); - pic16_aopOp((left=IC_LEFT(ic)),ic,FALSE); - pic16_aopOp((right=IC_RIGHT(ic)),ic,FALSE); - pic16_aopOp((result=IC_RESULT(ic)),ic,TRUE); + pic16_aopOp ((left = IC_LEFT (ic)), ic, FALSE); + pic16_aopOp ((right = IC_RIGHT (ic)), ic, FALSE); + pic16_aopOp ((result = IC_RESULT (ic)), ic, TRUE); - size = max(AOP_SIZE(left),AOP_SIZE(right)); + size = max (AOP_SIZE (left), AOP_SIZE (right)); - DEBUGpic16_pic16_AopType(__LINE__,left,right,result); + DEBUGpic16_pic16_AopType (__LINE__, left, right, result); - /* if literal, literal on the right or - if the right is in a pointer register and left - is not */ - if ((AOP_TYPE(IC_LEFT(ic)) == AOP_LIT)) { - operand *tmp = right ; + /* if literal, literal on the right or + if the right is in a pointer register and left + is not */ + if ((AOP_TYPE (IC_LEFT (ic)) == AOP_LIT)) + { + operand *tmp = right; right = left; left = tmp; } - if(ifx && !AOP_SIZE(result)){ - symbol *tlbl; - DEBUGpic16_emitcode ("; ***","%s %d CASE 1",__FUNCTION__,__LINE__); - /* if they are both bit variables */ - if (AOP_TYPE(left) == AOP_CRY && - ((AOP_TYPE(right) == AOP_CRY) || (AOP_TYPE(right) == AOP_LIT))) { - DEBUGpic16_emitcode ("; ***","%s %d CASE 11",__FUNCTION__,__LINE__); - if(AOP_TYPE(right) == AOP_LIT){ - unsigned long lit = ulFromVal (AOP(right)->aopu.aop_lit); - if(lit == 0L){ - pic16_emitcode("mov","c,%s",AOP(left)->aopu.aop_dir); - pic16_emitcode("cpl","c"); - } else if(lit == 1L) { - pic16_emitcode("mov","c,%s",AOP(left)->aopu.aop_dir); - } else { - pic16_emitcode("clr","c"); - } - /* AOP_TYPE(right) == AOP_CRY */ - } else { - symbol *lbl = newiTempLabel(NULL); - pic16_emitcode("mov","c,%s",AOP(left)->aopu.aop_dir); - pic16_emitcode("jb","%s,%05d_DS_",AOP(right)->aopu.aop_dir,(lbl->key+100)); - pic16_emitcode("cpl","c"); - pic16_emitcode("","%05d_DS_:",(lbl->key+100)); - } - /* if true label then we jump if condition - supplied is true */ - tlbl = newiTempLabel(NULL); - if ( IC_TRUE(ifx) ) { - pic16_emitcode("jnc","%05d_DS_",tlbl->key+100); - pic16_emitcode("ljmp","%05d_DS_",IC_TRUE(ifx)->key+100); - } else { - pic16_emitcode("jc","%05d_DS_",tlbl->key+100); - pic16_emitcode("ljmp","%05d_DS_",IC_FALSE(ifx)->key+100); - } - pic16_emitcode("","%05d_DS_:",tlbl->key+100+pic16_labelOffset); - - { - /* left and right are both bit variables, result is carry */ - resolvedIfx rIfx; - - resolveIfx(&rIfx,ifx); - - pic16_emitpcode(POC_MOVLW,pic16_popGet(AOP(left),0)); - pic16_emitpcode(POC_ANDFW,pic16_popGet(AOP(left),0)); - pic16_emitpcode(POC_BTFSC,pic16_popGet(AOP(right),0)); - pic16_emitpcode(POC_ANDLW,pic16_popGet(AOP(left),0)); - genSkipz2(&rIfx,0); - } - } else { - - DEBUGpic16_emitcode ("; ***","%s %d CASE 12",__FUNCTION__,__LINE__); - - /* They're not both bit variables. Is the right a literal? */ - if(AOP_TYPE(right) == AOP_LIT) { - lit = ulFromVal (AOP(right)->aopu.aop_lit); - - switch(size) { - - case 1: - switch(lit & 0xff) { - case 1: - if ( IC_TRUE(ifx) ) { - pic16_emitpcode(POC_DECFW,pic16_popGet(AOP(left),offset)); - emitSKPNZ; - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_TRUE(ifx)->key)); - } else { - pic16_emitpcode(POC_DECFSZW,pic16_popGet(AOP(left),offset)); - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_FALSE(ifx)->key)); - } - break; - case 0xff: - if ( IC_TRUE(ifx) ) { - pic16_emitpcode(POC_INCFW,pic16_popGet(AOP(left),offset)); - emitSKPNZ; - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_TRUE(ifx)->key)); - } else { - pic16_emitpcode(POC_INCFSZW,pic16_popGet(AOP(left),offset)); - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_FALSE(ifx)->key)); - } - break; - default: - pic16_emitpcode(POC_MOVFW,pic16_popGet(AOP(left),offset)); - if(lit) - pic16_emitpcode(POC_XORLW,pic16_popGetLit(lit & 0xff)); - genSkip(ifx,'z'); - } // switch lit - - - /* end of size == 1 */ - break; - - case 2: - genc16bit2lit(left,lit,offset); - genSkip(ifx,'z'); - break; - /* end of size == 2 */ - - default: - /* size is 4 */ - if(lit==0) { - pic16_emitpcode(POC_MOVFW,pic16_popGet(AOP(left),0)); - pic16_emitpcode(POC_IORFW,pic16_popGet(AOP(left),1)); - pic16_emitpcode(POC_IORFW,pic16_popGet(AOP(left),2)); - pic16_emitpcode(POC_IORFW,pic16_popGet(AOP(left),3)); - genSkip(ifx,'z'); - } else { - /* search for patterns that can be optimized */ - - genc16bit2lit(left,lit,0); - lit >>= 16; - if(lit) { - if(IC_TRUE(ifx)) - emitSKPZ; // if hi word unequal - else - emitSKPNZ; // if hi word equal - // fail early - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(falselbl->key)); - genc16bit2lit(left,lit,2); - genSkip(ifx,'z'); - } else { - pic16_emitpcode(POC_IORFW,pic16_popGet(AOP(left),2)); - pic16_emitpcode(POC_IORFW,pic16_popGet(AOP(left),3)); - genSkip(ifx,'z'); - } - } - pic16_emitpLabel(falselbl->key); - break; - - } // switch size - - ifx->generated = 1; - goto release ; - - - } else if(AOP_TYPE(right) == AOP_CRY ) { - /* we know the left is not a bit, but that the right is */ - pic16_emitpcode(POC_MOVFW,pic16_popGet(AOP(left),offset)); - pic16_emitpcode( ( (IC_TRUE(ifx)) ? POC_BTFSC : POC_BTFSS), - pic16_popGet(AOP(right),offset)); - pic16_emitpcode(POC_XORLW,pic16_popGetLit(1)); - - /* if the two are equal, then W will be 0 and the Z bit is set - * we could test Z now, or go ahead and check the high order bytes if - * the variable we're comparing is larger than a byte. */ + if (ifx && !AOP_SIZE (result)) + { + symbol *tlbl; + DEBUGpic16_emitcode ("; ***", "%s %d CASE 1", __FUNCTION__, __LINE__); + /* if they are both bit variables */ + if (AOP_TYPE (left) == AOP_CRY && ((AOP_TYPE (right) == AOP_CRY) || (AOP_TYPE (right) == AOP_LIT))) + { + DEBUGpic16_emitcode ("; ***", "%s %d CASE 11", __FUNCTION__, __LINE__); + if (AOP_TYPE (right) == AOP_LIT) + { + unsigned long lit = ulFromVal (AOP (right)->aopu.aop_lit); + if (lit == 0L) + { + pic16_emitcode ("mov", "c,%s", AOP (left)->aopu.aop_dir); + pic16_emitcode ("cpl", "c"); + } + else if (lit == 1L) + { + pic16_emitcode ("mov", "c,%s", AOP (left)->aopu.aop_dir); + } + else + { + pic16_emitcode ("clr", "c"); + } + /* AOP_TYPE(right) == AOP_CRY */ + } + else + { + symbol *lbl = newiTempLabel (NULL); + pic16_emitcode ("mov", "c,%s", AOP (left)->aopu.aop_dir); + pic16_emitcode ("jb", "%s,%05d_DS_", AOP (right)->aopu.aop_dir, labelKey2num (lbl->key)); + pic16_emitcode ("cpl", "c"); + pic16_emitcode ("", "%05d_DS_:", labelKey2num (lbl->key)); + } + /* if true label then we jump if condition + supplied is true */ + tlbl = newiTempLabel (NULL); + if (IC_TRUE (ifx)) + { + pic16_emitcode ("jnc", "%05d_DS_", labelKey2num (tlbl->key)); + pic16_emitcode ("ljmp", "%05d_DS_", labelKey2num (IC_TRUE (ifx)->key)); + } + else + { + pic16_emitcode ("jc", "%05d_DS_", labelKey2num (tlbl->key)); + pic16_emitcode ("ljmp", "%05d_DS_", labelKey2num (IC_FALSE (ifx)->key)); + } + pic16_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key + pic16_labelOffset)); - while(--size) - pic16_emitpcode(POC_IORFW,pic16_popGet(AOP(left),offset)); + { + /* left and right are both bit variables, result is carry */ + resolvedIfx rIfx; - if ( IC_TRUE(ifx) ) { - emitSKPNZ; - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_TRUE(ifx)->key)); - // pic16_emitcode(" goto","_%05d_DS_",IC_TRUE(ifx)->key+100+pic16_labelOffset); - } else { - emitSKPZ; - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_FALSE(ifx)->key)); - // pic16_emitcode(" goto","_%05d_DS_",IC_FALSE(ifx)->key+100+pic16_labelOffset); - } - - } else { - /* They're both variables that are larger than bits */ - int s = size; - - tlbl = newiTempLabel(NULL); - - while(size--) { - pic16_emitpcode(POC_MOVFW,pic16_popGet(AOP(left),offset)); - pic16_emitpcode(POC_XORFW,pic16_popGet(AOP(right),offset)); + resolveIfx (&rIfx, ifx); - if ( IC_TRUE(ifx) ) { - if(size) { - emitSKPZ; + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (left), 0)); + pic16_emitpcode (POC_ANDFW, pic16_popGet (AOP (left), 0)); + pic16_emitpcode (POC_BTFSC, pic16_popGet (AOP (right), 0)); + pic16_emitpcode (POC_ANDLW, pic16_popGet (AOP (left), 0)); + genSkipz2 (&rIfx, 0); + } + } + else + { - DEBUGpic16_emitcode (";","\tIC_TRUE emitSKPZ"); + DEBUGpic16_emitcode ("; ***", "%s %d CASE 12", __FUNCTION__, __LINE__); - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(tlbl->key)); - pic16_emitcode(" goto","_%05d_DS_",tlbl->key+100+pic16_labelOffset); - } else { - emitSKPNZ; + /* They're not both bit variables. Is the right a literal? */ + if (AOP_TYPE (right) == AOP_LIT) + { + lit = ulFromVal (AOP (right)->aopu.aop_lit); + + switch (size) + { + + case 1: + switch (lit & 0xff) + { + case 1: + if (IC_TRUE (ifx)) + { + pic16_emitpcode (POC_DECFW, pic16_popGet (AOP (left), offset)); + emitSKPNZ; + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_TRUE (ifx)->key)); + } + else + { + pic16_emitpcode (POC_DECFSZW, pic16_popGet (AOP (left), offset)); + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_FALSE (ifx)->key)); + } + break; + case 0xff: + if (IC_TRUE (ifx)) + { + pic16_emitpcode (POC_INCFW, pic16_popGet (AOP (left), offset)); + emitSKPNZ; + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_TRUE (ifx)->key)); + } + else + { + pic16_emitpcode (POC_INCFSZW, pic16_popGet (AOP (left), offset)); + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_FALSE (ifx)->key)); + } + break; + default: + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), offset)); + if (lit) + pic16_emitpcode (POC_XORLW, pic16_popGetLit (lit & 0xff)); + genSkip (ifx, 'z'); + } // switch lit + + + /* end of size == 1 */ + break; + + case 2: + genc16bit2lit (left, lit, offset); + genSkip (ifx, 'z'); + break; + /* end of size == 2 */ + + default: + /* size is 4 */ + if (lit == 0) + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), 0)); + pic16_emitpcode (POC_IORFW, pic16_popGet (AOP (left), 1)); + pic16_emitpcode (POC_IORFW, pic16_popGet (AOP (left), 2)); + pic16_emitpcode (POC_IORFW, pic16_popGet (AOP (left), 3)); + genSkip (ifx, 'z'); + } + else + { + /* search for patterns that can be optimized */ + + genc16bit2lit (left, lit, 0); + lit >>= 16; + if (lit) + { + if (IC_TRUE (ifx)) + emitSKPZ; // if hi word unequal + else + emitSKPNZ; // if hi word equal + // fail early + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (falselbl->key)); + genc16bit2lit (left, lit, 2); + genSkip (ifx, 'z'); + } + else + { + pic16_emitpcode (POC_IORFW, pic16_popGet (AOP (left), 2)); + pic16_emitpcode (POC_IORFW, pic16_popGet (AOP (left), 3)); + genSkip (ifx, 'z'); + } + } + pic16_emitpLabel (falselbl->key); + break; + + } // switch size + + ifx->generated = 1; + goto release; + + + } + else if (AOP_TYPE (right) == AOP_CRY) + { + /* we know the left is not a bit, but that the right is */ + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), offset)); + pic16_emitpcode (((IC_TRUE (ifx)) ? POC_BTFSC : POC_BTFSS), pic16_popGet (AOP (right), offset)); + pic16_emitpcode (POC_XORLW, pic16_popGetLit (1)); - DEBUGpic16_emitcode (";","\tIC_TRUE emitSKPNZ"); + /* if the two are equal, then W will be 0 and the Z bit is set + * we could test Z now, or go ahead and check the high order bytes if + * the variable we're comparing is larger than a byte. */ + while (--size) + pic16_emitpcode (POC_IORFW, pic16_popGet (AOP (left), offset)); - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_TRUE(ifx)->key)); - pic16_emitcode(" goto","_%05d_DS_",IC_TRUE(ifx)->key+100+pic16_labelOffset); + if (IC_TRUE (ifx)) + { + emitSKPNZ; + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_TRUE (ifx)->key)); + // pic16_emitcode(" goto","_%05d_DS_",labelKey2num (IC_TRUE(ifx)->key + pic16_labelOffset)); } - } else { - emitSKPZ; + else + { + emitSKPZ; + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_FALSE (ifx)->key)); + // pic16_emitcode(" goto","_%05d_DS_",labelKey2num (IC_FALSE(ifx)->key + pic16_labelOffset)); + } + + } + else + { + /* They're both variables that are larger than bits */ + int s = size; - DEBUGpic16_emitcode (";","\tnot IC_TRUE emitSKPZ"); + tlbl = newiTempLabel (NULL); - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_FALSE(ifx)->key)); - pic16_emitcode(" goto","_%05d_DS_",IC_FALSE(ifx)->key+100+pic16_labelOffset); - } - offset++; + while (size--) + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), offset)); + pic16_emitpcode (POC_XORFW, pic16_popGet (AOP (right), offset)); + + if (IC_TRUE (ifx)) + { + if (size) + { + emitSKPZ; + + DEBUGpic16_emitcode (";", "\tIC_TRUE emitSKPZ"); + + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (tlbl->key)); + pic16_emitcode (" goto", "_%05d_DS_", labelKey2num (tlbl->key + pic16_labelOffset)); + } + else + { + emitSKPNZ; + + DEBUGpic16_emitcode (";", "\tIC_TRUE emitSKPNZ"); + + + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_TRUE (ifx)->key)); + pic16_emitcode (" goto", "_%05d_DS_", labelKey2num (IC_TRUE (ifx)->key + pic16_labelOffset)); + } + } + else + { + emitSKPZ; + + DEBUGpic16_emitcode (";", "\tnot IC_TRUE emitSKPZ"); + + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_FALSE (ifx)->key)); + pic16_emitcode (" goto", "_%05d_DS_", labelKey2num (IC_FALSE (ifx)->key + pic16_labelOffset)); + } + offset++; + } + if (s > 1 && IC_TRUE (ifx)) + { + pic16_emitpLabel (tlbl->key); + pic16_emitcode ("", "_%05d_DS_:", labelKey2num (tlbl->key + pic16_labelOffset)); + } + } + } + /* mark the icode as generated */ + ifx->generated = 1; + goto release; + } + + /* if they are both bit variables */ + if (AOP_TYPE (left) == AOP_CRY && ((AOP_TYPE (right) == AOP_CRY) || (AOP_TYPE (right) == AOP_LIT))) + { + DEBUGpic16_emitcode ("; ***", "%s %d CASE 2", __FUNCTION__, __LINE__); + if (AOP_TYPE (right) == AOP_LIT) + { + unsigned long lit = ulFromVal (AOP (right)->aopu.aop_lit); + if (lit == 0L) + { + pic16_emitcode ("mov", "c,%s", AOP (left)->aopu.aop_dir); + pic16_emitcode ("cpl", "c"); } - if(s>1 && IC_TRUE(ifx)) { - pic16_emitpLabel(tlbl->key); - pic16_emitcode("","_%05d_DS_:",tlbl->key+100+pic16_labelOffset); + else if (lit == 1L) + { + pic16_emitcode ("mov", "c,%s", AOP (left)->aopu.aop_dir); } - } + else + { + pic16_emitcode ("clr", "c"); + } + /* AOP_TYPE(right) == AOP_CRY */ + } + else + { + symbol *lbl = newiTempLabel (NULL); + pic16_emitcode ("mov", "c,%s", AOP (left)->aopu.aop_dir); + pic16_emitcode ("jb", "%s,%05d_DS_", AOP (right)->aopu.aop_dir, labelKey2num (lbl->key)); + pic16_emitcode ("cpl", "c"); + pic16_emitcode ("", "%05d_DS_:", labelKey2num (lbl->key)); + } + /* c = 1 if egal */ + if (AOP_TYPE (result) == AOP_CRY && AOP_SIZE (result)) + { + pic16_outBitC (result); + goto release; + } + if (ifx) + { + genIfxJump (ifx, "c"); + goto release; } - /* mark the icode as generated */ - ifx->generated = 1; - goto release ; - } - - /* if they are both bit variables */ - if (AOP_TYPE(left) == AOP_CRY && - ((AOP_TYPE(right) == AOP_CRY) || (AOP_TYPE(right) == AOP_LIT))) { - DEBUGpic16_emitcode ("; ***","%s %d CASE 2",__FUNCTION__,__LINE__); - if(AOP_TYPE(right) == AOP_LIT){ - unsigned long lit = ulFromVal (AOP(right)->aopu.aop_lit); - if(lit == 0L){ - pic16_emitcode("mov","c,%s",AOP(left)->aopu.aop_dir); - pic16_emitcode("cpl","c"); - } else if(lit == 1L) { - pic16_emitcode("mov","c,%s",AOP(left)->aopu.aop_dir); - } else { - pic16_emitcode("clr","c"); - } - /* AOP_TYPE(right) == AOP_CRY */ - } else { - symbol *lbl = newiTempLabel(NULL); - pic16_emitcode("mov","c,%s",AOP(left)->aopu.aop_dir); - pic16_emitcode("jb","%s,%05d_DS_",AOP(right)->aopu.aop_dir,(lbl->key+100)); - pic16_emitcode("cpl","c"); - pic16_emitcode("","%05d_DS_:",(lbl->key+100)); - } - /* c = 1 if egal */ - if (AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result)){ - pic16_outBitC(result); - goto release ; - } - if (ifx) { - genIfxJump (ifx,"c"); - goto release ; - } - /* if the result is used in an arithmetic operation - then put the result in place */ - pic16_outBitC(result); - } else { + /* if the result is used in an arithmetic operation + then put the result in place */ + pic16_outBitC (result); + } + else + { - DEBUGpic16_emitcode ("; ***","%s %d CASE 3",__FUNCTION__,__LINE__); - gencjne(left,right,result,ifx); -/* - if(ifx) - gencjne(left,right,newiTempLabel(NULL)); - else { - if(IC_TRUE(ifx)->key) - gencjne(left,right,IC_TRUE(ifx)->key); - else - gencjne(left,right,IC_FALSE(ifx)->key); - ifx->generated = 1; - goto release ; - } - if (AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result)) { - pic16_aopPut(AOP(result),"a",0); - goto release ; - } + DEBUGpic16_emitcode ("; ***", "%s %d CASE 3", __FUNCTION__, __LINE__); + gencjne (left, right, result, ifx); + /* + if(ifx) + gencjne(left,right,newiTempLabel(NULL)); + else { + if(IC_TRUE(ifx)->key) + gencjne(left,right,IC_TRUE(ifx)->key); + else + gencjne(left,right,IC_FALSE(ifx)->key); + ifx->generated = 1; + goto release ; + } + if (AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result)) { + pic16_aopPut(AOP(result),"a",0); + goto release ; + } - if (ifx) { - genIfxJump (ifx,"a"); - goto release ; - } -*/ + if (ifx) { + genIfxJump (ifx,"a"); + goto release ; + } + */ /* if the result is used in an arithmetic operation then put the result in place */ -/* - if (AOP_TYPE(result) != AOP_CRY) - pic16_outAcc(result); -*/ + /* + if (AOP_TYPE(result) != AOP_CRY) + pic16_outAcc(result); + */ /* leave the result in acc */ } release: - pic16_freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (result, NULL, ic, TRUE); } #endif /*-----------------------------------------------------------------*/ -/* ifxForOp - returns the icode containing the ifx for operand */ +/* genAndOp - for && operation */ /*-----------------------------------------------------------------*/ -static iCode *ifxForOp ( operand *op, iCode *ic ) +static void +genAndOp (iCode * ic) { - FENTRY2; - - /* if true symbol then needs to be assigned */ - if (IS_TRUE_SYMOP(op)) - return NULL ; - - /* if this has register type condition and - the next instruction is ifx with the same operand - and live to of the operand is upto the ifx only then */ - if (ic->next - && ic->next->op == IFX - && IC_COND(ic->next)->key == op->key - && OP_SYMBOL(op)->liveTo <= ic->next->seq - ) { - DEBUGpic16_emitcode(";", "%d %s", __LINE__, __FUNCTION__); - return ic->next; - } - - /* - if (ic->next && - ic->next->op == IFX && - IC_COND(ic->next)->key == op->key) { - DEBUGpic16_emitcode ("; WARNING ","%d IGNORING liveTo range in %s",__LINE__,__FUNCTION__); - return ic->next; - } - */ - - DEBUGpic16_emitcode ("; NULL :(","%d",__LINE__); - if (ic->next && - ic->next->op == IFX) - DEBUGpic16_emitcode ("; ic-next"," is an IFX"); - - if (ic->next && - ic->next->op == IFX && - IC_COND(ic->next)->key == op->key) { - DEBUGpic16_emitcode ("; "," key is okay"); - DEBUGpic16_emitcode ("; "," key liveTo %d, next->seq = %d", - OP_SYMBOL(op)->liveTo, - ic->next->seq); - } - -#if 0 - /* the code below is completely untested - * it just allows ulong2fs.c compile -- VR */ - - ic = ic->next; - fprintf(stderr, "WARNING (%s:%s:%d) untested hack might produce wrong code\n", - __FILE__, __FUNCTION__, __LINE__); - - /* if this has register type condition and - the next instruction is ifx with the same operand - and live to of the operand is upto the ifx only then */ - if (ic->next && - ic->next->op == IFX && - IC_COND(ic->next)->key == op->key && - OP_SYMBOL(op)->liveTo <= ic->next->seq ) - return ic->next; - - if (ic->next && - ic->next->op == IFX && - IC_COND(ic->next)->key == op->key) { - DEBUGpic16_emitcode ("; WARNING ","%d IGNORING liveTo range in %s",__LINE__,__FUNCTION__); - return ic->next; - } - - fprintf(stderr, "WARNING (%s:%s:%d) untested hack might produce wrong code (returning NULL)\n", - __FILE__, __FUNCTION__, __LINE__); + operand *left, *right, *result; + /* symbol *tlbl; */ -// return ic->next->next; /* this just might work */ /* FIXME FIXME */ -#endif + FENTRY; - return NULL; -} -/*-----------------------------------------------------------------*/ -/* genAndOp - for && operation */ -/*-----------------------------------------------------------------*/ -static void genAndOp (iCode *ic) -{ - operand *left,*right, *result; -/* symbol *tlbl; */ + /* note here that && operations that are in an + if statement are taken away by backPatchLabels + only those used in arthmetic operations remain */ + pic16_aopOp ((left = IC_LEFT (ic)), ic, FALSE); + pic16_aopOp ((right = IC_RIGHT (ic)), ic, FALSE); + pic16_aopOp ((result = IC_RESULT (ic)), ic, TRUE); - FENTRY; + DEBUGpic16_pic16_AopType (__LINE__, left, right, result); - /* note here that && operations that are in an - if statement are taken away by backPatchLabels - only those used in arthmetic operations remain */ - pic16_aopOp((left=IC_LEFT(ic)),ic,FALSE); - pic16_aopOp((right=IC_RIGHT(ic)),ic,FALSE); - pic16_aopOp((result=IC_RESULT(ic)),ic,TRUE); - - DEBUGpic16_pic16_AopType(__LINE__,left,right,result); - - pic16_emitpcode(POC_MOVFW,pic16_popGet(AOP(left),0)); - pic16_emitpcode(POC_ANDFW,pic16_popGet(AOP(right),0)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),0)); - - /* if both are bit variables */ -/* if (AOP_TYPE(left) == AOP_CRY && */ -/* AOP_TYPE(right) == AOP_CRY ) { */ -/* pic16_emitcode("mov","c,%s",AOP(left)->aopu.aop_dir); */ -/* pic16_emitcode("anl","c,%s",AOP(right)->aopu.aop_dir); */ -/* pic16_outBitC(result); */ -/* } else { */ -/* tlbl = newiTempLabel(NULL); */ -/* pic16_toBoolean(left); */ -/* pic16_emitcode("jz","%05d_DS_",tlbl->key+100); */ -/* pic16_toBoolean(right); */ -/* pic16_emitcode("","%05d_DS_:",tlbl->key+100); */ -/* pic16_outBitAcc(result); */ -/* } */ - - pic16_freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), 0)); + pic16_emitpcode (POC_ANDFW, pic16_popGet (AOP (right), 0)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); + + /* if both are bit variables */ + /* if (AOP_TYPE(left) == AOP_CRY && */ + /* AOP_TYPE(right) == AOP_CRY ) { */ + /* pic16_emitcode("mov","c,%s",AOP(left)->aopu.aop_dir); */ + /* pic16_emitcode("anl","c,%s",AOP(right)->aopu.aop_dir); */ + /* pic16_outBitC(result); */ + /* } else { */ + /* tlbl = newiTempLabel(NULL); */ + /* pic16_toBoolean(left); */ + /* pic16_emitcode("jz","%05d_DS_",labelKey2num (tlbl->key)); */ + /* pic16_toBoolean(right); */ + /* pic16_emitcode("","%05d_DS_:",labelKey2num (tlbl->key)); */ + /* pic16_outBitAcc(result); */ + /* } */ + + pic16_freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (result, NULL, ic, TRUE); } @@ -5254,117 +5799,125 @@ modified this code, but it doesn't appear to ever get called */ -static void genOrOp (iCode *ic) +static void +genOrOp (iCode * ic) { - operand *left,*right, *result; + operand *left, *right, *result; symbol *tlbl; - FENTRY; + FENTRY; /* note here that || operations that are in an - if statement are taken away by backPatchLabels - only those used in arthmetic operations remain */ - pic16_aopOp((left=IC_LEFT(ic)),ic,FALSE); - pic16_aopOp((right=IC_RIGHT(ic)),ic,FALSE); - pic16_aopOp((result=IC_RESULT(ic)),ic,TRUE); - - DEBUGpic16_pic16_AopType(__LINE__,left,right,result); - - /* if both are bit variables */ - if (AOP_TYPE(left) == AOP_CRY && - AOP_TYPE(right) == AOP_CRY ) { - pic16_emitcode("clrc",""); - pic16_emitcode("btfss","(%s >> 3), (%s & 7)", - AOP(left)->aopu.aop_dir, - AOP(left)->aopu.aop_dir); - pic16_emitcode("btfsc","(%s >> 3), (%s & 7)", - AOP(right)->aopu.aop_dir, - AOP(right)->aopu.aop_dir); - pic16_emitcode("setc",""); - - } else { - tlbl = newiTempLabel(NULL); - pic16_toBoolean(left); - emitSKPZ; - pic16_emitcode("goto","%05d_DS_",tlbl->key+100+pic16_labelOffset); - pic16_toBoolean(right); - pic16_emitcode("","%05d_DS_:",tlbl->key+100+pic16_labelOffset); + if statement are taken away by backPatchLabels + only those used in arthmetic operations remain */ + pic16_aopOp ((left = IC_LEFT (ic)), ic, FALSE); + pic16_aopOp ((right = IC_RIGHT (ic)), ic, FALSE); + pic16_aopOp ((result = IC_RESULT (ic)), ic, TRUE); + + DEBUGpic16_pic16_AopType (__LINE__, left, right, result); + + /* if both are bit variables */ + if (AOP_TYPE (left) == AOP_CRY && AOP_TYPE (right) == AOP_CRY) + { + pic16_emitcode ("clrc", ""); + pic16_emitcode ("btfss", "(%s >> 3), (%s & 7)", AOP (left)->aopu.aop_dir, AOP (left)->aopu.aop_dir); + pic16_emitcode ("btfsc", "(%s >> 3), (%s & 7)", AOP (right)->aopu.aop_dir, AOP (right)->aopu.aop_dir); + pic16_emitcode ("setc", ""); + + } + else + { + tlbl = newiTempLabel (NULL); + pic16_toBoolean (left); + emitSKPZ; + pic16_emitcode ("goto", "%05d_DS_", labelKey2num (tlbl->key + pic16_labelOffset)); + pic16_toBoolean (right); + pic16_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key + pic16_labelOffset)); - pic16_outBitAcc(result); + pic16_outBitAcc (result); } - pic16_freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* isLiteralBit - test if lit == 2^n */ /*-----------------------------------------------------------------*/ -static int isLiteralBit(unsigned long lit) +static int +isLiteralBit (unsigned long lit) { - unsigned long pw[32] = {1L,2L,4L,8L,16L,32L,64L,128L, - 0x100L,0x200L,0x400L,0x800L, - 0x1000L,0x2000L,0x4000L,0x8000L, - 0x10000L,0x20000L,0x40000L,0x80000L, - 0x100000L,0x200000L,0x400000L,0x800000L, - 0x1000000L,0x2000000L,0x4000000L,0x8000000L, - 0x10000000L,0x20000000L,0x40000000L,0x80000000L}; - int idx; - - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - for(idx = 0; idx < 32; idx++) - if(lit == pw[idx]) - return idx+1; - return 0; + unsigned long pw[32] = { 1L, 2L, 4L, 8L, 16L, 32L, 64L, 128L, + 0x100L, 0x200L, 0x400L, 0x800L, + 0x1000L, 0x2000L, 0x4000L, 0x8000L, + 0x10000L, 0x20000L, 0x40000L, 0x80000L, + 0x100000L, 0x200000L, 0x400000L, 0x800000L, + 0x1000000L, 0x2000000L, 0x4000000L, 0x8000000L, + 0x10000000L, 0x20000000L, 0x40000000L, 0x80000000L + }; + int idx; + + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + for (idx = 0; idx < 32; idx++) + if (lit == pw[idx]) + return idx + 1; + return 0; } /*-----------------------------------------------------------------*/ /* continueIfTrue - */ /*-----------------------------------------------------------------*/ -static void continueIfTrue (iCode *ic) +static void +continueIfTrue (iCode * ic) { FENTRY; - if(IC_TRUE(ic)) - pic16_emitcode("ljmp","%05d_DS_",IC_TRUE(ic)->key+100); + if (IC_TRUE (ic)) + pic16_emitcode ("ljmp", "%05d_DS_", labelKey2num (IC_TRUE (ic)->key)); ic->generated = 1; } /*-----------------------------------------------------------------*/ /* jmpIfTrue - */ /*-----------------------------------------------------------------*/ -static void jumpIfTrue (iCode *ic) +static void +jumpIfTrue (iCode * ic) { FENTRY; - if(!IC_TRUE(ic)) - pic16_emitcode("ljmp","%05d_DS_",IC_FALSE(ic)->key+100); + if (!IC_TRUE (ic)) + pic16_emitcode ("ljmp", "%05d_DS_", labelKey2num (IC_FALSE (ic)->key)); ic->generated = 1; } /*-----------------------------------------------------------------*/ /* jmpTrueOrFalse - */ /*-----------------------------------------------------------------*/ -static void jmpTrueOrFalse (iCode *ic, symbol *tlbl) +static void +jmpTrueOrFalse (iCode * ic, symbol * tlbl) { // ugly but optimized by peephole FENTRY; - if(IC_TRUE(ic)){ - symbol *nlbl = newiTempLabel(NULL); - pic16_emitcode("sjmp","%05d_DS_",nlbl->key+100); - pic16_emitcode("","%05d_DS_:",tlbl->key+100); - pic16_emitcode("ljmp","%05d_DS_",IC_TRUE(ic)->key+100); - pic16_emitcode("","%05d_DS_:",nlbl->key+100); - } else { - pic16_emitcode("ljmp","%05d_DS_",IC_FALSE(ic)->key+100); - pic16_emitcode("","%05d_DS_:",tlbl->key+100); - } + if (IC_TRUE (ic)) + { + symbol *nlbl = newiTempLabel (NULL); + pic16_emitcode ("sjmp", "%05d_DS_", labelKey2num (nlbl->key)); + pic16_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key)); + pic16_emitcode ("ljmp", "%05d_DS_", labelKey2num (IC_TRUE (ic)->key)); + pic16_emitcode ("", "%05d_DS_:", labelKey2num (nlbl->key)); + } + else + { + pic16_emitcode ("ljmp", "%05d_DS_", labelKey2num (IC_FALSE (ic)->key)); + pic16_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key)); + } ic->generated = 1; } /*-----------------------------------------------------------------*/ /* genAnd - code for and */ /*-----------------------------------------------------------------*/ -static void genAnd (iCode *ic, iCode *ifx) +static void +genAnd (iCode * ic, iCode * ifx) { operand *left, *right, *result; int size, offset = 0; @@ -5380,8 +5933,7 @@ resolveIfx (&rIfx, ifx); /* if left is a literal & right is not then exchange them */ - if ((AOP_TYPE (left) == AOP_LIT && AOP_TYPE (right) != AOP_LIT) || - AOP_NEEDSACC (left)) + if ((AOP_TYPE (left) == AOP_LIT && AOP_TYPE (right) != AOP_LIT) || AOP_NEEDSACC (left)) { operand *tmp = right; right = left; @@ -5397,8 +5949,7 @@ } /* if right is bit then exchange them */ - if (AOP_TYPE (right) == AOP_CRY && - AOP_TYPE (left) != AOP_CRY) + if (AOP_TYPE (right) == AOP_CRY && AOP_TYPE (left) != AOP_CRY) { operand *tmp = right; right = left; @@ -5414,54 +5965,64 @@ // if(bit & yy) // result = bit & yy; - if (AOP_TYPE(left) == AOP_CRY){ - // c = bit & literal; - if(AOP_TYPE(right) == AOP_LIT){ - if(lit & 1) { - if(size && pic16_sameRegs(AOP(result),AOP(left))) - // no change - goto release; - pic16_emitcode("mov","c,%s",AOP(left)->aopu.aop_dir); - } else { - // bit(result) = 0; - if(size && (AOP_TYPE(result) == AOP_CRY)){ - pic16_emitcode("clr","%s",AOP(result)->aopu.aop_dir); - goto release; + if (AOP_TYPE (left) == AOP_CRY) + { + // c = bit & literal; + if (AOP_TYPE (right) == AOP_LIT) + { + if (lit & 1) + { + if (size && pic16_sameRegs (AOP (result), AOP (left))) + // no change + goto release; + pic16_emitcode ("mov", "c,%s", AOP (left)->aopu.aop_dir); + } + else + { + // bit(result) = 0; + if (size && (AOP_TYPE (result) == AOP_CRY)) + { + pic16_emitcode ("clr", "%s", AOP (result)->aopu.aop_dir); + goto release; + } + if ((AOP_TYPE (result) == AOP_CRY) && ifx) + { + jumpIfTrue (ifx); + goto release; + } + pic16_emitcode ("clr", "c"); + } } - if((AOP_TYPE(result) == AOP_CRY) && ifx){ - jumpIfTrue(ifx); - goto release; + else + { + if (AOP_TYPE (right) == AOP_CRY) + { + // c = bit & bit; + pic16_emitcode ("mov", "c,%s", AOP (right)->aopu.aop_dir); + pic16_emitcode ("anl", "c,%s", AOP (left)->aopu.aop_dir); + } + else + { + // c = bit & val; + MOVA (pic16_aopGet (AOP (right), 0, FALSE, FALSE)); + // c = lsb + pic16_emitcode ("rrc", "a"); + pic16_emitcode ("anl", "c,%s", AOP (left)->aopu.aop_dir); + } } - pic16_emitcode("clr","c"); - } - } else { - if (AOP_TYPE(right) == AOP_CRY){ - // c = bit & bit; - pic16_emitcode("mov","c,%s",AOP(right)->aopu.aop_dir); - pic16_emitcode("anl","c,%s",AOP(left)->aopu.aop_dir); - } else { - // c = bit & val; - MOVA(pic16_aopGet(AOP(right),0,FALSE,FALSE)); - // c = lsb - pic16_emitcode("rrc","a"); - pic16_emitcode("anl","c,%s",AOP(left)->aopu.aop_dir); - } + // bit = c + // val = c + if (size) + pic16_outBitC (result); + // if(bit & ...) + else if ((AOP_TYPE (result) == AOP_CRY) && ifx) + genIfxJump (ifx, "c"); + goto release; } - // bit = c - // val = c - if(size) - pic16_outBitC(result); - // if(bit & ...) - else if((AOP_TYPE(result) == AOP_CRY) && ifx) - genIfxJump(ifx, "c"); - goto release ; - } // if (val & 0xZZ) - size = 0, ifx != FALSE - // bit = val & 0xZZ - size = 1, ifx = FALSE - - if ((AOP_TYPE (right) == AOP_LIT) && - (AOP_TYPE (result) == AOP_CRY) && - (AOP_TYPE (left) != AOP_CRY)) + if ((AOP_TYPE (right) == AOP_LIT) && (AOP_TYPE (result) == AOP_CRY) && (AOP_TYPE (left) != AOP_CRY)) { symbol *tlbl = newiTempLabel (NULL); int sizel = AOP_SIZE (left); @@ -5482,7 +6043,7 @@ for (sizel = AOP_SIZE (left); sizel--; ++offset, lit >>= 8) { - unsigned char bytelit = lit; + unsigned char bytelit = lit & 0xFF; if (bytelit != 0) { @@ -5495,12 +6056,16 @@ { if (nonnull) { - pic16_emitpcode (POC_BTFSC, pic16_newpCodeOpBit(pic16_aopGet (AOP (left), offset, FALSE, FALSE), posbit - 1, 0, PO_GPR_REGISTER)); + pic16_emitpcode (POC_BTFSC, + pic16_newpCodeOpBit (pic16_aopGet (AOP (left), offset, FALSE, FALSE), posbit - 1, 0, + PO_GPR_REGISTER)); pic16_emitpcode (POC_GOTO, pic16_popGetLabel (rIfx.condition ? rIfx.lbl->key : tlbl->key)); } else { - pic16_emitpcode (rIfx.condition ? POC_BTFSC :POC_BTFSS, pic16_newpCodeOpBit(pic16_aopGet (AOP (left), offset, FALSE, FALSE), posbit - 1, 0, PO_GPR_REGISTER)); + pic16_emitpcode (rIfx.condition ? POC_BTFSC : POC_BTFSS, + pic16_newpCodeOpBit (pic16_aopGet (AOP (left), offset, FALSE, FALSE), posbit - 1, 0, + PO_GPR_REGISTER)); } } else @@ -5521,11 +6086,11 @@ if (rIfx.condition) { emitSKPZ; - pic16_emitpcode (POC_GOTO, pic16_popGetLabel (rIfx.lbl->key)); /* to false */ + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (rIfx.lbl->key)); /* to false */ } else { - pic16_emitpcode (POC_BNZ, pic16_popGetLabel (tlbl->key)); /* to true */ + pic16_emitpcode (POC_BNZ, pic16_popGetLabel (tlbl->key)); /* to true */ } } else @@ -5564,132 +6129,185 @@ } /* if left is same as result */ - if(pic16_sameRegs(AOP(result),AOP(left))){ - int know_W = -1; - for(;size--; offset++,lit>>=8) { - if(AOP_TYPE(right) == AOP_LIT){ - switch(lit & 0xff) { - case 0x00: - /* and'ing with 0 has clears the result */ + if (pic16_sameRegs (AOP (result), AOP (left))) + { + int know_W = -1; + for (; size--; offset++, lit >>= 8) + { + if (AOP_TYPE (right) == AOP_LIT) + { + switch (lit & 0xff) + { + case 0x00: + /* and'ing with 0 has clears the result */ // pic16_emitcode("clrf","%s",pic16_aopGet(AOP(result),offset,FALSE,FALSE)); - pic16_emitpcode(POC_CLRF,pic16_popGet(AOP(result),offset)); - break; - case 0xff: - /* and'ing with 0xff is a nop when the result and left are the same */ - break; + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offset)); + break; + case 0xff: + /* and'ing with 0xff is a nop when the result and left are the same */ + break; - default: - { - int p = pic16_my_powof2( (~lit) & 0xff ); - if(p>=0) { - /* only one bit is set in the literal, so use a bcf instruction */ + default: + { + int p = pic16_my_powof2 ((~lit) & 0xff); + if (p >= 0) + { + /* only one bit is clear in the literal, so use a bcf instruction */ // pic16_emitcode("bcf","%s,%d",pic16_aopGet(AOP(left),offset,FALSE,TRUE),p); - pic16_emitpcode(POC_BCF,pic16_newpCodeOpBit(pic16_aopGet(AOP(left),offset,FALSE,FALSE),p,0, PO_GPR_REGISTER)); + pic16_emitpcode (POC_BCF, + pic16_newpCodeOpBit (pic16_aopGet (AOP (left), offset, FALSE, FALSE), p, 0, + PO_GPR_REGISTER)); - } else { - pic16_emitcode("movlw","0x%x", (lit & 0xff)); - pic16_emitcode("andwf","%s,f",pic16_aopGet(AOP(left),offset,FALSE,TRUE)); - if(know_W != (lit&0xff)) - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(lit & 0xff)); - know_W = lit &0xff; - pic16_emitpcode(POC_ANDWF,pic16_popGet(AOP(left),offset)); + } + else + { + if (AOP_TYPE (left) == AOP_ACC) + { + pic16_emitcode ("andlw", "0x%x", lit & 0xff); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (lit & 0xff)); + know_W = -1; + } + else + { + if (know_W != (lit & 0xff)) + { + pic16_emitcode ("movlw", "0x%x", lit & 0xff); + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (lit & 0xff)); + } + + know_W = lit & 0xff; + pic16_emitcode ("andwf", "%s,f", pic16_aopGet (AOP (left), offset, FALSE, TRUE)); + pic16_emitpcode (POC_ANDWF, pic16_popGet (AOP (left), offset)); + } + } + } + } } - } - } - } else { - if (AOP_TYPE(left) == AOP_ACC) { - pic16_emitpcode(POC_ANDFW,pic16_popGet(AOP(right),offset)); - } else { - pic16_emitpcode(POC_MOVFW,pic16_popGet(AOP(right),offset)); - pic16_emitpcode(POC_ANDWF,pic16_popGet(AOP(left),offset)); + else + { + if (AOP_TYPE (left) == AOP_ACC) + { + pic16_emitpcode (POC_ANDFW, pic16_popGet (AOP (right), offset)); + } + else + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (right), offset)); + pic16_emitpcode (POC_ANDWF, pic16_popGet (AOP (left), offset)); + } + } } - } - } - } else { - // left & result in different registers - if(AOP_TYPE(result) == AOP_CRY){ - // result = bit - // if(size), result in bit - // if(!size && ifx), conditional oper: if(left & right) - symbol *tlbl = newiTempLabel(NULL); - int sizer = min(AOP_SIZE(left),AOP_SIZE(right)); - if(size) - pic16_emitcode("setb","c"); - while(sizer--){ - MOVA(pic16_aopGet(AOP(right),offset,FALSE,FALSE)); - pic16_emitcode("anl","a,%s", - pic16_aopGet(AOP(left),offset,FALSE,FALSE)); - pic16_emitcode("jnz","%05d_DS_",tlbl->key+100); - offset++; - } - if(size){ - CLRC; - pic16_emitcode("","%05d_DS_:",tlbl->key+100); - pic16_outBitC(result); - } else if(ifx) - jmpTrueOrFalse(ifx, tlbl); - } else { - for(;(size--);offset++) { - // normal case - // result = left & right - if(AOP_TYPE(right) == AOP_LIT){ - int t = (lit >> (offset*8)) & 0x0FFL; - switch(t) { - case 0x00: - pic16_emitcode("clrf","%s", - pic16_aopGet(AOP(result),offset,FALSE,FALSE)); - pic16_emitpcode(POC_CLRF,pic16_popGet(AOP(result),offset)); - break; - case 0xff: - pic16_emitcode("movf","%s,w", - pic16_aopGet(AOP(left),offset,FALSE,FALSE)); - pic16_emitcode("movwf","%s", - pic16_aopGet(AOP(result),offset,FALSE,FALSE)); - pic16_emitpcode(POC_MOVFW,pic16_popGet(AOP(left),offset)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),offset)); - break; - default: - pic16_emitcode("movlw","0x%x",t); - pic16_emitcode("andwf","%s,w", - pic16_aopGet(AOP(left),offset,FALSE,FALSE)); - pic16_emitcode("movwf","%s", - pic16_aopGet(AOP(result),offset,FALSE,FALSE)); - - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(t)); - pic16_emitpcode(POC_ANDFW,pic16_popGet(AOP(left),offset)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),offset)); - } - continue; + } + else + { + // left & result in different registers + if (AOP_TYPE (result) == AOP_CRY) + { + // result = bit + // if(size), result in bit + // if(!size && ifx), conditional oper: if(left & right) + symbol *tlbl = newiTempLabel (NULL); + int sizer = min (AOP_SIZE (left), AOP_SIZE (right)); + if (size) + pic16_emitcode ("setb", "c"); + while (sizer--) + { + MOVA (pic16_aopGet (AOP (right), offset, FALSE, FALSE)); + pic16_emitcode ("anl", "a,%s", pic16_aopGet (AOP (left), offset, FALSE, FALSE)); + pic16_emitcode ("jnz", "%05d_DS_", labelKey2num (tlbl->key)); + offset++; + } + if (size) + { + CLRC; + pic16_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key)); + pic16_outBitC (result); + } + else if (ifx) + jmpTrueOrFalse (ifx, tlbl); } + else + { + for (; (size--); offset++) + { + // normal case + // result = left & right + if (AOP_TYPE (right) == AOP_LIT) + { + int t = (lit >> (offset * 8)) & 0x0FFL; + switch (t) + { + case 0x00: + pic16_emitcode ("clrf", "%s", pic16_aopGet (AOP (result), offset, FALSE, FALSE)); + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offset)); + break; + case 0xff: + pic16_emitcode ("movf", "%s,w", pic16_aopGet (AOP (left), offset, FALSE, FALSE)); + pic16_emitcode ("movwf", "%s", pic16_aopGet (AOP (result), offset, FALSE, FALSE)); + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), offset)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + break; + default: + { + if (AOP_TYPE (left) == AOP_ACC) + { + pic16_emitcode ("andlw", "0x%02x", t); + pic16_emitcode ("movwf", "%s", pic16_aopGet (AOP (result), offset, FALSE, FALSE)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (t)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + } + else + { + pic16_emitcode ("movlw", "0x%02x", t); + pic16_emitcode ("andwf", "%s,w", pic16_aopGet (AOP (left), offset, FALSE, FALSE)); + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (t)); + pic16_emitpcode (POC_ANDFW, pic16_popGet (AOP (left), offset)); + + if (AOP_TYPE (result) != AOP_ACC) + { + pic16_emitcode ("movwf", "%s", pic16_aopGet (AOP (result), offset, FALSE, FALSE)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + } + else + { + DEBUGpic16_emitcode ("; ***", "ignore MOVWF\tWREG", __FUNCTION__, __LINE__); + } + } + } + } + continue; + } - if (AOP_TYPE(left) == AOP_ACC) { - pic16_emitcode("andwf","%s,w",pic16_aopGet(AOP(right),offset,FALSE,FALSE)); - pic16_emitpcode(POC_ANDFW,pic16_popGet(AOP(right),offset)); - } else { - pic16_emitcode("movf","%s,w",pic16_aopGet(AOP(right),offset,FALSE,FALSE)); - pic16_emitcode("andwf","%s,w", - pic16_aopGet(AOP(left),offset,FALSE,FALSE)); - pic16_emitpcode(POC_MOVFW,pic16_popGet(AOP(right),offset)); - pic16_emitpcode(POC_ANDFW,pic16_popGet(AOP(left),offset)); + if (AOP_TYPE (left) == AOP_ACC) + { + pic16_emitcode ("andwf", "%s,w", pic16_aopGet (AOP (right), offset, FALSE, FALSE)); + pic16_emitpcode (POC_ANDFW, pic16_popGet (AOP (right), offset)); + } + else + { + pic16_emitcode ("movf", "%s,w", pic16_aopGet (AOP (right), offset, FALSE, FALSE)); + pic16_emitcode ("andwf", "%s,w", pic16_aopGet (AOP (left), offset, FALSE, FALSE)); + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (right), offset)); + pic16_emitpcode (POC_ANDFW, pic16_popGet (AOP (left), offset)); + } + pic16_emitcode ("movwf", "%s", pic16_aopGet (AOP (result), offset, FALSE, FALSE)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + } } - pic16_emitcode("movwf","%s",pic16_aopGet(AOP(result),offset,FALSE,FALSE)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),offset)); - } } - } -release : - pic16_freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(result,NULL,ic,TRUE); +release: + pic16_freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genOr - code for or */ /*-----------------------------------------------------------------*/ -static void genOr (iCode *ic, iCode *ifx) +static void +genOr (iCode * ic, iCode * ifx) { operand *left, *right, *result; int size, offset = 0; @@ -5699,14 +6317,13 @@ FENTRY; pic16_aopOp ((left = IC_LEFT (ic)), ic, FALSE); - pic16_aopOp ((right= IC_RIGHT (ic)), ic, FALSE); - pic16_aopOp ((result=IC_RESULT (ic)), ic, TRUE); + pic16_aopOp ((right = IC_RIGHT (ic)), ic, FALSE); + pic16_aopOp ((result = IC_RESULT (ic)), ic, TRUE); resolveIfx (&rIfx, ifx); /* if left is a literal & right is not then exchange them */ - if ((AOP_TYPE (left) == AOP_LIT && AOP_TYPE (right) != AOP_LIT) || - AOP_NEEDSACC (left)) + if ((AOP_TYPE (left) == AOP_LIT && AOP_TYPE (right) != AOP_LIT) || AOP_NEEDSACC (left)) { operand *tmp = right; right = left; @@ -5722,8 +6339,7 @@ } /* if right is bit then exchange them */ - if (AOP_TYPE (right) == AOP_CRY && - AOP_TYPE (left) != AOP_CRY) + if (AOP_TYPE (right) == AOP_CRY && AOP_TYPE (left) != AOP_CRY) { operand *tmp = right; right = left; @@ -5733,216 +6349,298 @@ DEBUGpic16_pic16_AopType (__LINE__, left, right, result); if (AOP_TYPE (right) == AOP_LIT) - lit = ulFromVal (AOP (right)->aopu.aop_lit); + lit = ulFromVal (AOP (right)->aopu.aop_lit); size = AOP_SIZE (result); // if(bit | yy) // xx = bit | yy; - if (AOP_TYPE(left) == AOP_CRY){ - if(AOP_TYPE(right) == AOP_LIT){ + if (AOP_TYPE (left) == AOP_CRY) + { + if (AOP_TYPE (right) == AOP_LIT) + { // c = bit & literal; - if(lit){ + if (lit) + { // lit != 0 => result = 1 - if(AOP_TYPE(result) == AOP_CRY){ - if(size) - pic16_emitpcode(POC_BSF, pic16_popGet(AOP(result),0)); - //pic16_emitcode("bsf","(%s >> 3), (%s & 7)", - // AOP(result)->aopu.aop_dir, - // AOP(result)->aopu.aop_dir); - else if(ifx) - continueIfTrue(ifx); + if (AOP_TYPE (result) == AOP_CRY) + { + if (size) + pic16_emitpcode (POC_BSF, pic16_popGet (AOP (result), 0)); + //pic16_emitcode("bsf","(%s >> 3), (%s & 7)", + // AOP(result)->aopu.aop_dir, + // AOP(result)->aopu.aop_dir); + else if (ifx) + continueIfTrue (ifx); goto release; - } - } else { + } + } + else + { // lit == 0 => result = left - if(size && pic16_sameRegs(AOP(result),AOP(left))) - goto release; - pic16_emitcode(";XXX mov","c,%s %s,%d",AOP(left)->aopu.aop_dir,__FILE__,__LINE__); - } - } else { - if (AOP_TYPE(right) == AOP_CRY){ - if(pic16_sameRegs(AOP(result),AOP(left))){ - // c = bit | bit; - pic16_emitpcode(POC_BCF, pic16_popGet(AOP(result),0)); - pic16_emitpcode(POC_BTFSC, pic16_popGet(AOP(right),0)); - pic16_emitpcode(POC_BSF, pic16_popGet(AOP(result),0)); - - } else { - if( AOP_TYPE(result) == AOP_ACC) { - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(0)); - pic16_emitpcode(POC_BTFSS, pic16_popGet(AOP(right),0)); - pic16_emitpcode(POC_BTFSC, pic16_popGet(AOP(left),0)); - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(1)); - - } else { - - pic16_emitpcode(POC_BCF, pic16_popGet(AOP(result),0)); - pic16_emitpcode(POC_BTFSS, pic16_popGet(AOP(right),0)); - pic16_emitpcode(POC_BTFSC, pic16_popGet(AOP(left),0)); - pic16_emitpcode(POC_BSF, pic16_popGet(AOP(result),0)); + if (size && pic16_sameRegs (AOP (result), AOP (left))) + goto release; + pic16_emitcode (";XXX mov", "c,%s %s,%d", AOP (left)->aopu.aop_dir, __FILE__, __LINE__); + } + } + else + { + if (AOP_TYPE (right) == AOP_CRY) + { + if (pic16_sameRegs (AOP (result), AOP (left))) + { + // c = bit | bit; + pic16_emitpcode (POC_BCF, pic16_popGet (AOP (result), 0)); + pic16_emitpcode (POC_BTFSC, pic16_popGet (AOP (right), 0)); + pic16_emitpcode (POC_BSF, pic16_popGet (AOP (result), 0)); - } + } + else + { + if (AOP_TYPE (result) == AOP_ACC) + { + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (0)); + pic16_emitpcode (POC_BTFSS, pic16_popGet (AOP (right), 0)); + pic16_emitpcode (POC_BTFSC, pic16_popGet (AOP (left), 0)); + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (1)); + + } + else + { + + pic16_emitpcode (POC_BCF, pic16_popGet (AOP (result), 0)); + pic16_emitpcode (POC_BTFSS, pic16_popGet (AOP (right), 0)); + pic16_emitpcode (POC_BTFSC, pic16_popGet (AOP (left), 0)); + pic16_emitpcode (POC_BSF, pic16_popGet (AOP (result), 0)); + + } + } } - } else { + else + { // c = bit | val; - symbol *tlbl = newiTempLabel(NULL); - pic16_emitcode(";XXX "," %s,%d",__FILE__,__LINE__); + symbol *tlbl = newiTempLabel (NULL); + pic16_emitcode (";XXX ", " %s,%d", __FILE__, __LINE__); - pic16_emitpcode(POC_BCF, pic16_popGet(AOP(result),0)); - if( AOP_TYPE(right) == AOP_ACC) { - pic16_emitpcode(POC_IORLW, pic16_popGetLit(0)); - emitSKPNZ; - pic16_emitpcode(POC_BTFSC, pic16_popGet(AOP(left),0)); - pic16_emitpcode(POC_BSF, pic16_popGet(AOP(result),0)); - } + pic16_emitpcode (POC_BCF, pic16_popGet (AOP (result), 0)); + if (AOP_TYPE (right) == AOP_ACC) + { + pic16_emitpcode (POC_IORLW, pic16_popGetLit (0)); + emitSKPNZ; + pic16_emitpcode (POC_BTFSC, pic16_popGet (AOP (left), 0)); + pic16_emitpcode (POC_BSF, pic16_popGet (AOP (result), 0)); + } - if(!((AOP_TYPE(result) == AOP_CRY) && ifx)) - pic16_emitcode(";XXX setb","c"); - pic16_emitcode(";XXX jb","%s,%05d_DS_", - AOP(left)->aopu.aop_dir,tlbl->key+100); - pic16_toBoolean(right); - pic16_emitcode(";XXX jnz","%05d_DS_",tlbl->key+100); - if((AOP_TYPE(result) == AOP_CRY) && ifx){ - jmpTrueOrFalse(ifx, tlbl); + if (!((AOP_TYPE (result) == AOP_CRY) && ifx)) + pic16_emitcode (";XXX setb", "c"); + pic16_emitcode (";XXX jb", "%s,%05d_DS_", AOP (left)->aopu.aop_dir, labelKey2num (tlbl->key)); + pic16_toBoolean (right); + pic16_emitcode (";XXX jnz", "%05d_DS_", labelKey2num (tlbl->key)); + if ((AOP_TYPE (result) == AOP_CRY) && ifx) + { + jmpTrueOrFalse (ifx, tlbl); goto release; - } else { + } + else + { CLRC; - pic16_emitcode("","%05d_DS_:",tlbl->key+100); - } - } - } + pic16_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key)); + } + } + } // bit = c // val = c - if(size) - pic16_outBitC(result); + if (size) + pic16_outBitC (result); // if(bit | ...) - else if((AOP_TYPE(result) == AOP_CRY) && ifx) - genIfxJump(ifx, "c"); - goto release ; - } + else if ((AOP_TYPE (result) == AOP_CRY) && ifx) + genIfxJump (ifx, "c"); + goto release; + } // if(val | 0xZZ) - size = 0, ifx != FALSE - // bit = val | 0xZZ - size = 1, ifx = FALSE - - if ((AOP_TYPE (right) == AOP_LIT) && - (AOP_TYPE (result) == AOP_CRY) && - (AOP_TYPE (left) != AOP_CRY)) - { - if (IS_OP_VOLATILE(left)) { - pic16_mov2w_volatile(AOP(left)); - } // if + if ((AOP_TYPE (right) == AOP_LIT) && (AOP_TYPE (result) == AOP_CRY) && (AOP_TYPE (left) != AOP_CRY)) + { + if (IS_OP_VOLATILE (left)) + { + pic16_mov2w_volatile (AOP (left)); + } // if if (lit) { if (rIfx.condition) - pic16_emitpcode (POC_GOTO, pic16_popGetLabel (rIfx.lbl->key)); /* to false */ + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (rIfx.lbl->key)); /* to false */ ifx->generated = 1; } else wassert (0); goto release; - } + } /* if left is same as result */ - if(pic16_sameRegs(AOP(result),AOP(left))){ - int know_W = -1; - for(;size--; offset++,lit>>=8) { - if(AOP_TYPE(right) == AOP_LIT){ - if(((lit & 0xff) == 0) && !IS_OP_VOLATILE(left)) { - /* or'ing with 0 has no effect */ - continue; - } else { - int p = pic16_my_powof2(lit & 0xff); - if(p>=0) { - /* only one bit is set in the literal, so use a bsf instruction */ - pic16_emitpcode(POC_BSF, - pic16_newpCodeOpBit(pic16_aopGet(AOP(left),offset,FALSE,FALSE),p,0, PO_GPR_REGISTER)); - } else { - if(know_W != (lit & 0xff)) - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(lit & 0xff)); - know_W = lit & 0xff; - pic16_emitpcode(POC_IORWF, pic16_popGet(AOP(left),offset)); - } + if (pic16_sameRegs (AOP (result), AOP (left))) + { + int know_W = -1; + for (; size--; offset++, lit >>= 8) + { + if (AOP_TYPE (right) == AOP_LIT) + { + if (((lit & 0xff) == 0) && !IS_OP_VOLATILE (left)) + { + /* or'ing with 0 has no effect */ + continue; + } + else + { + int p = pic16_my_powof2 (lit & 0xff); + if (p >= 0) + { + /* only one bit is set in the literal, so use a bsf instruction */ + pic16_emitpcode (POC_BSF, + pic16_newpCodeOpBit (pic16_aopGet (AOP (left), offset, FALSE, FALSE), p, 0, + PO_GPR_REGISTER)); + } + else + { + if (AOP_TYPE (left) == AOP_ACC) + { + pic16_emitpcode (POC_IORLW, pic16_popGetLit (lit & 0xff)); + know_W = -1; + } + else + { + if (know_W != (lit & 0xff)) + { + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (lit & 0xff)); + } + know_W = lit & 0xff; + pic16_emitpcode (POC_IORWF, pic16_popGet (AOP(left), offset)); + } + } + + } + } + else + { + if (AOP_TYPE (left) == AOP_ACC) + { + pic16_emitpcode (POC_IORFW, pic16_popGet (AOP (right), offset)); + } + else + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (right), offset)); + pic16_emitpcode (POC_IORWF, pic16_popGet (AOP (left), offset)); + } + } } - } else { - if (AOP_TYPE(left) == AOP_ACC) { - pic16_emitpcode(POC_IORFW, pic16_popGet(AOP(right),offset)); - } else { - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(right),offset)); - pic16_emitpcode(POC_IORWF, pic16_popGet(AOP(left),offset)); - } - } } - } else { + else + { // left & result in different registers - if(AOP_TYPE(result) == AOP_CRY){ + if (AOP_TYPE (result) == AOP_CRY) + { // result = bit // if(size), result in bit // if(!size && ifx), conditional oper: if(left | right) - symbol *tlbl = newiTempLabel(NULL); - int sizer = max(AOP_SIZE(left),AOP_SIZE(right)); - pic16_emitcode(";XXX "," %s,%d",__FILE__,__LINE__); + symbol *tlbl = newiTempLabel (NULL); + int sizer = max (AOP_SIZE (left), AOP_SIZE (right)); + pic16_emitcode (";XXX ", " %s,%d", __FILE__, __LINE__); - if(size) - pic16_emitcode(";XXX setb","c"); - while(sizer--){ - MOVA(pic16_aopGet(AOP(right),offset,FALSE,FALSE)); - pic16_emitcode(";XXX orl","a,%s", - pic16_aopGet(AOP(left),offset,FALSE,FALSE)); - pic16_emitcode(";XXX jnz","%05d_DS_",tlbl->key+100); + if (size) + pic16_emitcode (";XXX setb", "c"); + while (sizer--) + { + MOVA (pic16_aopGet (AOP (right), offset, FALSE, FALSE)); + pic16_emitcode (";XXX orl", "a,%s", pic16_aopGet (AOP (left), offset, FALSE, FALSE)); + pic16_emitcode (";XXX jnz", "%05d_DS_", labelKey2num (tlbl->key)); offset++; - } - if(size){ + } + if (size) + { CLRC; - pic16_emitcode("","%05d_DS_:",tlbl->key+100); - pic16_outBitC(result); - } else if(ifx) - jmpTrueOrFalse(ifx, tlbl); - } else for(;(size--);offset++){ - // normal case - // result = left & right - if(AOP_TYPE(right) == AOP_LIT){ - int t = (lit >> (offset*8)) & 0x0FFL; - switch(t) { - case 0x00: - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(left),offset)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offset)); - break; - default: - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(t)); - pic16_emitpcode(POC_IORFW, pic16_popGet(AOP(left),offset)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offset)); - } - continue; + pic16_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key)); + pic16_outBitC (result); + } + else if (ifx) + jmpTrueOrFalse (ifx, tlbl); } + else + for (; (size--); offset++) + { + // normal case + // result = left & right + if (AOP_TYPE (right) == AOP_LIT) + { + int t = (lit >> (offset * 8)) & 0x0FFL; + switch (t) + { + case 0x00: + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), offset)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + break; + default: + { + if (AOP_TYPE (left) == AOP_ACC) + { + pic16_emitcode ("iorlw", "0x%02x", t); + pic16_emitcode ("movwf", "%s", pic16_aopGet (AOP (result), offset, FALSE, FALSE)); + pic16_emitpcode (POC_IORLW, pic16_popGetLit (t)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + } + else + { + pic16_emitcode("movlw", "0x%02x", t); + pic16_emitcode("iorwf", "%s", pic16_aopGet (AOP (left), offset, FALSE, FALSE)); + pic16_emitpcode(POC_MOVLW, pic16_popGetLit (t)); + pic16_emitpcode(POC_IORFW, pic16_popGet (AOP (left), offset)); + + if (AOP_TYPE (result) != AOP_ACC) + { + pic16_emitcode ("movwf", "%s", pic16_aopGet (AOP (result), offset, FALSE, FALSE)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + } + else + { + DEBUGpic16_emitcode ("; ***", "ignore MOVWF\tWREG", __FUNCTION__, __LINE__); + } + } + } + } + continue; + } - // faster than result <- left, anl result,right - // and better if result is SFR - if (AOP_TYPE(left) == AOP_ACC) { - pic16_emitpcode(POC_IORWF, pic16_popGet(AOP(right),offset)); - } else { - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(right),offset)); - pic16_emitpcode(POC_IORFW, pic16_popGet(AOP(left),offset)); - } - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offset)); - } - } + // faster than result <- left, anl result,right + // and better if result is SFR + if (AOP_TYPE (left) == AOP_ACC) + { + pic16_emitpcode (POC_IORWF, pic16_popGet (AOP (right), offset)); + } + else + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (right), offset)); + pic16_emitpcode (POC_IORFW, pic16_popGet (AOP (left), offset)); + } + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + } + } -release : - pic16_freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(result,NULL,ic,TRUE); +release: + pic16_freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genXor - code for xclusive or */ /*-----------------------------------------------------------------*/ -static void genXor (iCode *ic, iCode *ifx) +static void +genXor (iCode * ic, iCode * ifx) { operand *left, *right, *result; int size, offset = 0; @@ -5955,12 +6653,11 @@ pic16_aopOp ((right = IC_RIGHT (ic)), ic, FALSE); pic16_aopOp ((result = IC_RESULT (ic)), ic, TRUE); - resolveIfx (&rIfx,ifx); + resolveIfx (&rIfx, ifx); /* if left is a literal & right is not || if left needs acc & right does not */ - if ((AOP_TYPE (left) == AOP_LIT && AOP_TYPE (right) != AOP_LIT) || - (AOP_NEEDSACC (left) && !AOP_NEEDSACC (right))) + if ((AOP_TYPE (left) == AOP_LIT && AOP_TYPE (right) != AOP_LIT) || (AOP_NEEDSACC (left) && !AOP_NEEDSACC (right))) { operand *tmp = right; right = left; @@ -5970,16 +6667,15 @@ /* if result = right then exchange them */ if (pic16_sameRegs (AOP (result), AOP (right))) { - operand *tmp = right ; + operand *tmp = right; right = left; left = tmp; } /* if right is bit then exchange them */ - if (AOP_TYPE (right) == AOP_CRY && - AOP_TYPE (left) != AOP_CRY) + if (AOP_TYPE (right) == AOP_CRY && AOP_TYPE (left) != AOP_CRY) { - operand *tmp = right ; + operand *tmp = right; right = left; left = tmp; } @@ -5991,25 +6687,25 @@ // if(bit ^ yy) // xx = bit ^ yy; - if (AOP_TYPE(left) == AOP_CRY) + if (AOP_TYPE (left) == AOP_CRY) { - if (AOP_TYPE(right) == AOP_LIT) + if (AOP_TYPE (right) == AOP_LIT) { // c = bit & literal; if (lit >> 1) { // lit>>1 != 0 => result = 1 - if (AOP_TYPE(result) == AOP_CRY) + if (AOP_TYPE (result) == AOP_CRY) { if (size) { - pic16_emitpcode(POC_BSF, pic16_popGet(AOP(result), offset)); + pic16_emitpcode (POC_BSF, pic16_popGet (AOP (result), offset)); } else if (ifx) - continueIfTrue(ifx); + continueIfTrue (ifx); goto release; } - pic16_emitcode("setb", "c"); + pic16_emitcode ("setb", "c"); } else { @@ -6017,24 +6713,24 @@ if (lit == 0) { // lit == 0, result = left - if (size && pic16_sameRegs(AOP(result), AOP(left))) + if (size && pic16_sameRegs (AOP (result), AOP (left))) goto release; - pic16_emitcode("mov", "c,%s", AOP(left)->aopu.aop_dir); + pic16_emitcode ("mov", "c,%s", AOP (left)->aopu.aop_dir); } else { // lit == 1, result = not(left) - if (size && pic16_sameRegs(AOP(result), AOP(left))) + if (size && pic16_sameRegs (AOP (result), AOP (left))) { - pic16_emitpcode(POC_MOVLW, pic16_popGet(AOP(result), offset)); - pic16_emitpcode(POC_XORWF, pic16_popGet(AOP(result), offset)); - pic16_emitcode("cpl", "%s", AOP(result)->aopu.aop_dir); + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (result), offset)); + pic16_emitpcode (POC_XORWF, pic16_popGet (AOP (result), offset)); + pic16_emitcode ("cpl", "%s", AOP (result)->aopu.aop_dir); goto release; } else { - pic16_emitcode("mov", "c,%s", AOP(left)->aopu.aop_dir); - pic16_emitcode("cpl", "c"); + pic16_emitcode ("mov", "c,%s", AOP (left)->aopu.aop_dir); + pic16_emitcode ("cpl", "c"); } } } @@ -6042,49 +6738,47 @@ else { // right != literal - symbol *tlbl = newiTempLabel(NULL); - if (AOP_TYPE(right) == AOP_CRY) + symbol *tlbl = newiTempLabel (NULL); + if (AOP_TYPE (right) == AOP_CRY) { // c = bit ^ bit; - pic16_emitcode("mov", "c,%s", AOP(right)->aopu.aop_dir); + pic16_emitcode ("mov", "c,%s", AOP (right)->aopu.aop_dir); } else { - int sizer = AOP_SIZE(right); + int sizer = AOP_SIZE (right); // c = bit ^ val // if val>>1 != 0, result = 1 - pic16_emitcode("setb", "c"); + pic16_emitcode ("setb", "c"); while (sizer) { - MOVA(pic16_aopGet(AOP(right), sizer - 1, FALSE, FALSE)); + MOVA (pic16_aopGet (AOP (right), sizer - 1, FALSE, FALSE)); if (sizer == 1) // test the msb of the lsb - pic16_emitcode("anl", "a,#0xfe"); - pic16_emitcode("jnz", "%05d_DS_", tlbl->key+100); + pic16_emitcode ("anl", "a,#0xfe"); + pic16_emitcode ("jnz", "%05d_DS_", labelKey2num (tlbl->key)); sizer--; } // val = (0,1) - pic16_emitcode("rrc", "a"); + pic16_emitcode ("rrc", "a"); } - pic16_emitcode("jnb", "%s,%05d_DS_", AOP(left)->aopu.aop_dir, (tlbl->key + 100)); - pic16_emitcode("cpl", "c"); - pic16_emitcode("", "%05d_DS_:", (tlbl->key + 100)); + pic16_emitcode ("jnb", "%s,%05d_DS_", AOP (left)->aopu.aop_dir, labelKey2num (tlbl->key)); + pic16_emitcode ("cpl", "c"); + pic16_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key)); } // bit = c // val = c if (size) - pic16_outBitC(result); + pic16_outBitC (result); // if(bit | ...) - else if ((AOP_TYPE(result) == AOP_CRY) && ifx) - genIfxJump(ifx, "c"); + else if ((AOP_TYPE (result) == AOP_CRY) && ifx) + genIfxJump (ifx, "c"); goto release; } // if(val ^ 0xZZ) - size = 0, ifx != FALSE - // bit = val ^ 0xZZ - size = 1, ifx = FALSE - - if ((AOP_TYPE (right) == AOP_LIT) && - (AOP_TYPE (result) == AOP_CRY) && - (AOP_TYPE (left) != AOP_CRY)) + if ((AOP_TYPE (right) == AOP_LIT) && (AOP_TYPE (result) == AOP_CRY) && (AOP_TYPE (left) != AOP_CRY)) { symbol *tlbl = newiTempLabel (NULL); int sizel; @@ -6092,9 +6786,9 @@ if (size) emitSETC; - for (sizel = AOP_SIZE(left); sizel--; ++offset, lit >>= 8) + for (sizel = AOP_SIZE (left); sizel--; ++offset, lit >>= 8) { - unsigned char bytelit = lit; + unsigned char bytelit = lit & 0xFF; switch (bytelit) { @@ -6117,11 +6811,11 @@ { /* rIfx.lbl might be far away... */ emitSKPZ; - pic16_emitpcode (POC_GOTO, pic16_popGetLabel (rIfx.lbl->key)); /* to false */ + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (rIfx.lbl->key)); /* to false */ } else { - pic16_emitpcode (POC_BNZ, pic16_popGetLabel (tlbl->key)); /* to true */ + pic16_emitpcode (POC_BNZ, pic16_popGetLabel (tlbl->key)); /* to true */ } } else @@ -6154,203 +6848,260 @@ pic16_outBitC (result); goto release; - } + } - if (pic16_sameRegs(AOP(result), AOP(left))) + if (pic16_sameRegs (AOP (result), AOP (left))) { /* if left is same as result */ + int know_W = -1; + for (; size--; offset++) { - if (AOP_TYPE(right) == AOP_LIT) + if (AOP_TYPE (right) == AOP_LIT) { - int t = (lit >> (offset * 8)) & 0x0FFL; - if (t == 0x00L) + int t = (lit >> (offset * 8)) & 0x0FFL; + if (t == 0x00L) continue; else { - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(t)); - pic16_emitpcode(POC_XORWF, pic16_popGet(AOP(left), offset)); + int p = pic16_my_powof2 (t); + + if (p >= 0) + { + /* Only one bit is toggle in the literal, so use a btg instruction. */ + pic16_emitpcode (POC_BTG, + pic16_newpCodeOpBit (pic16_aopGet (AOP (left), offset, FALSE, FALSE), p, 0, PO_GPR_REGISTER)); + } + else + { + if (AOP_TYPE (left) == AOP_ACC) + { + pic16_emitcode ("xorlw", "0x%02x", t); + pic16_emitpcode (POC_XORLW, pic16_popGetLit (t)); + know_W = -1; + } + else + { + if (know_W != t) + { + pic16_emitcode ("movlw", "0x%02x", t); + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (t)); + } + + know_W = t; + } + + pic16_emitcode ("xorwf", "%s", pic16_aopGet (AOP (left), offset, FALSE, FALSE)); + pic16_emitpcode (POC_XORWF, pic16_popGet (AOP (left), offset)); + } } } else { - if (AOP_TYPE(left) == AOP_ACC) - pic16_emitcode("xrl", "a,%s", pic16_aopGet(AOP(right), offset, FALSE, FALSE)); + if (AOP_TYPE (left) == AOP_ACC) + pic16_emitcode ("xrl", "a,%s", pic16_aopGet (AOP (right), offset, FALSE, FALSE)); else { - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(right), offset)); - pic16_emitpcode(POC_XORWF, pic16_popGet(AOP(left), offset)); + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (right), offset)); + pic16_emitpcode (POC_XORWF, pic16_popGet (AOP (left), offset)); } } } } else { - // left ^ result in different registers - if (AOP_TYPE(result) == AOP_CRY) - { - // result = bit - // if(size), result in bit - // if(!size && ifx), conditional oper: if(left ^ right) - symbol *tlbl = newiTempLabel(NULL); - int sizer = max(AOP_SIZE(left), AOP_SIZE(right)); - if (size) - pic16_emitcode("setb", "c"); - while (sizer--) - { - if ((AOP_TYPE(right) == AOP_LIT) && - (((lit >> (offset*8)) & 0x0FFL) == 0x00L)) - { - MOVA(pic16_aopGet(AOP(left), offset, FALSE, FALSE)); - } - else - { - MOVA(pic16_aopGet(AOP(right), offset, FALSE, FALSE)); - pic16_emitcode("xrl", "a,%s", - pic16_aopGet(AOP(left), offset, FALSE, FALSE)); - } - pic16_emitcode("jnz", "%05d_DS_", tlbl->key + 100); - offset++; - } - if (size) - { - CLRC; - pic16_emitcode("", "%05d_DS_:", tlbl->key + 100); - pic16_outBitC(result); - } - else if (ifx) - jmpTrueOrFalse(ifx, tlbl); - } - else - { - for (; (size--); offset++) - { - // normal case - // result = left ^ right - if (AOP_TYPE(right) == AOP_LIT) - { - int t = (lit >> (offset * 8)) & 0x0FFL; - switch(t) - { - case 0x00: - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(left), offset)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offset)); - break; + // left ^ result in different registers + if (AOP_TYPE (result) == AOP_CRY) + { + // result = bit + // if(size), result in bit + // if(!size && ifx), conditional oper: if(left ^ right) + symbol *tlbl = newiTempLabel (NULL); + int sizer = max (AOP_SIZE (left), AOP_SIZE (right)); + if (size) + pic16_emitcode ("setb", "c"); + while (sizer--) + { + if ((AOP_TYPE (right) == AOP_LIT) && (((lit >> (offset * 8)) & 0x0FFL) == 0x00L)) + { + MOVA (pic16_aopGet (AOP (left), offset, FALSE, FALSE)); + } + else + { + MOVA (pic16_aopGet (AOP (right), offset, FALSE, FALSE)); + pic16_emitcode ("xrl", "a,%s", pic16_aopGet (AOP (left), offset, FALSE, FALSE)); + } + pic16_emitcode ("jnz", "%05d_DS_", labelKey2num (tlbl->key)); + offset++; + } + if (size) + { + CLRC; + pic16_emitcode ("", "%05d_DS_:", labelKey2num (tlbl->key)); + pic16_outBitC (result); + } + else if (ifx) + jmpTrueOrFalse (ifx, tlbl); + } + else + { + for (; (size--); offset++) + { + // normal case + // result = left ^ right + if (AOP_TYPE (right) == AOP_LIT) + { + int t = (lit >> (offset * 8)) & 0x0FFL; + switch (t) + { + case 0x00: + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), offset)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + break; - case 0xff: - pic16_emitpcode(POC_COMFW, pic16_popGet(AOP(left), offset)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offset)); - break; + case 0xff: + pic16_emitpcode (POC_COMFW, pic16_popGet (AOP (left), offset)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + break; - default: - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(t)); - pic16_emitpcode(POC_XORFW, pic16_popGet(AOP(left), offset)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offset)); - } - continue; - } + default: + { + if (AOP_TYPE (left) == AOP_ACC) + { + pic16_emitcode ("xorlw", "0x%02x", t); + pic16_emitpcode (POC_XORLW, pic16_popGetLit (t)); + } + else + { + pic16_emitcode ("movlw", "0x%02x", t); + pic16_emitcode ("xorwf", "%s", pic16_aopGet (AOP (left), offset, FALSE, FALSE)); + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (t)); + pic16_emitpcode (POC_XORFW, pic16_popGet (AOP (left), offset)); + } - // faster than result <- left, anl result,right - // and better if result is SFR - if (AOP_TYPE(left) == AOP_ACC) - { - pic16_emitpcode(POC_XORFW, pic16_popGet(AOP(right), offset)); - } - else - { - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(right), offset)); - pic16_emitpcode(POC_XORFW, pic16_popGet(AOP(left), offset)); - } - if ( AOP_TYPE(result) != AOP_ACC) - { - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offset)); - } - } - } - } + pic16_emitcode ("movwf", "%s", pic16_aopGet (AOP (result), offset, FALSE, FALSE)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + } + } + continue; + } -release : - pic16_freeAsmop(left, NULL, ic, (RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(right, NULL, ic, (RESULTONSTACK(ic) ? FALSE : TRUE)); - pic16_freeAsmop(result, NULL, ic, TRUE); + // faster than result <- left, anl result,right + // and better if result is SFR + if (AOP_TYPE (left) == AOP_ACC) + { + pic16_emitpcode (POC_XORFW, pic16_popGet (AOP (right), offset)); + } + else + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (right), offset)); + pic16_emitpcode (POC_XORFW, pic16_popGet (AOP (left), offset)); + } + if (AOP_TYPE (result) != AOP_ACC) + { + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + } + else + { + DEBUGpic16_emitcode ("; ***", "ignore MOVWF\tWREG", __FUNCTION__, __LINE__); + } + } + } + } + +release: + pic16_freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE)); + pic16_freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genInline - write the inline code out */ /*-----------------------------------------------------------------*/ -static void genInline (iCode *ic) +static void +pic16_genInline (iCode * ic) { char *buffer, *bp, *bp1; bool inComment = FALSE; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - _G.inLine += (!options.asmpeep); + genLine.lineElement.isInline += (!options.asmpeep); buffer = bp = bp1 = Safe_strdup (IC_INLINE (ic)); - while((bp1=strstr(bp, "\\n"))) { - *bp1++ = '\n'; - *bp1++ = ' '; - bp = bp1; - } + while ((bp1 = strstr (bp, "\\n"))) + { + *bp1++ = '\n'; + *bp1++ = ' '; + bp = bp1; + } bp = bp1 = buffer; #if 0 /* This is an experimental code for #pragma inline and is temporarily disabled for 2.5.0 release */ - if(asmInlineMap) - { - symbol *sym; - char *s; - char *cbuf; - int cblen; - - cbuf = Safe_strdup(buffer); - cblen = strlen(buffer)+1; - memset(cbuf, 0, cblen); + if (asmInlineMap) + { + symbol *sym; + char *s; + char *cbuf; + int cblen; + + cbuf = Safe_strdup (buffer); + cblen = strlen (buffer) + 1; + memset (cbuf, 0, cblen); bp = buffer; bp1 = cbuf; - while(*bp) { - if(*bp != '%')*bp1++ = *bp++; - else { - int i; + while (*bp) + { + if (*bp != '%') + *bp1++ = *bp++; + else + { + int i; - bp++; - i = *bp - '0'; - if(i>elementsInSet(asmInlineMap))break; - - bp++; - s = indexSet(asmInlineMap, i); - DEBUGpc("searching symbol s = `%s'", s); - sym = findSym(SymbolTab, NULL, s); - - if(sym->reqv) { - strcat(bp1, sym->reqv->operand.symOperand->regs[0]->name); - } else { - strcat(bp1, sym->rname); - } - - while(*bp1)bp1++; - } - - if(strlen(bp1) > cblen - 16) { - int i = strlen(cbuf); - cblen += 50; - cbuf = realloc(cbuf, cblen); - memset(cbuf+i, 0, 50); - bp1 = cbuf + i; + bp++; + i = *bp - '0'; + if (i > elementsInSet (asmInlineMap)) + break; + + bp++; + s = indexSet (asmInlineMap, i); + DEBUGpc ("searching symbol s = `%s'", s); + sym = findSym (SymbolTab, NULL, s); + + if (sym->reqv) + { + strcat (bp1, sym->reqv->operand.symOperand->regs[0]->name); + } + else + { + strcat (bp1, sym->rname); + } + + while (*bp1) + bp1++; + } + + if (strlen (bp1) > cblen - 16) + { + int i = strlen (cbuf); + cblen += 50; + cbuf = realloc (cbuf, cblen); + memset (cbuf + i, 0, 50); + bp1 = cbuf + i; + } } - } - free(buffer); - buffer = Safe_strdup( cbuf ); - free(cbuf); + free (buffer); + buffer = Safe_strdup (cbuf); + free (cbuf); bp = bp1 = buffer; - } -#endif /* 0 */ + } +#endif /* 0 */ /* emit each line as a code */ while (*bp) @@ -6367,20 +7118,20 @@ inComment = FALSE; *bp++ = '\0'; if (*bp1) - pic16_addpCode2pBlock(pb, pic16_newpCodeAsmDir(bp1, NULL)); // inline directly, no process + pic16_addpCode2pBlock (pb, pic16_newpCodeAsmDir (bp1, NULL)); // inline directly, no process bp1 = bp; break; default: /* Add \n for labels, not dirs such as c:\mydir */ - if (!inComment && (*bp == ':') && (isspace((unsigned char)bp[1]))) + if (!inComment && (*bp == ':') && (isspace ((unsigned char) bp[1]))) { ++bp; *bp = '\0'; ++bp; /* print label, use this special format with NULL directive * to denote that the argument should not be indented with tab */ - pic16_addpCode2pBlock(pb, pic16_newpCodeAsmDir(NULL, bp1)); // inline directly, no process + pic16_addpCode2pBlock (pb, pic16_newpCodeAsmDir (NULL, bp1)); // inline directly, no process bp1 = bp; } else @@ -6390,97 +7141,110 @@ } if ((bp1 != bp) && *bp1) - pic16_addpCode2pBlock(pb, pic16_newpCodeAsmDir(bp1, NULL)); // inline directly, no process + pic16_addpCode2pBlock (pb, pic16_newpCodeAsmDir (bp1, NULL)); // inline directly, no process Safe_free (buffer); - _G.inLine -= (!options.asmpeep); + /* consumed; we can free it here */ + dbuf_free (IC_INLINE (ic)); + + genLine.lineElement.isInline -= (!options.asmpeep); } /*-----------------------------------------------------------------*/ /* genRRC - rotate right with carry */ /*-----------------------------------------------------------------*/ -static void genRRC (iCode *ic) +static void +genRRC (iCode * ic) { - operand *left , *result ; + operand *left, *result; int size, same; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); /* rotate right with carry */ - left = IC_LEFT(ic); - result=IC_RESULT(ic); - pic16_aopOp (left,ic,FALSE); - pic16_aopOp (result,ic,TRUE); + left = IC_LEFT (ic); + result = IC_RESULT (ic); + pic16_aopOp (left, ic, FALSE); + pic16_aopOp (result, ic, TRUE); - DEBUGpic16_pic16_AopType(__LINE__,left,NULL,result); + DEBUGpic16_pic16_AopType (__LINE__, left, NULL, result); - same = pic16_sameRegs(AOP(result),AOP(left)); + same = pic16_sameRegs (AOP (result), AOP (left)); - size = AOP_SIZE(result); + size = AOP_SIZE (result); - DEBUGpic16_emitcode ("; ***","%s %d size:%d same:%d",__FUNCTION__,__LINE__,size,same); + DEBUGpic16_emitcode ("; ***", "%s %d size:%d same:%d", __FUNCTION__, __LINE__, size, same); /* get the lsb and put it into the carry */ - pic16_emitpcode(POC_RRCFW, pic16_popGet(AOP(left),0)); + pic16_emitpcode (POC_RRCFW, pic16_popGet (AOP (left), 0)); - while(size--) { + while (size--) + { - if(same) { - pic16_emitpcode(POC_RRCF, pic16_popGet(AOP(left),size)); - } else { - pic16_emitpcode(POC_RRCFW, pic16_popGet(AOP(left),size)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),size)); + if (same) + { + pic16_emitpcode (POC_RRCF, pic16_popGet (AOP (left), size)); + } + else + { + pic16_emitpcode (POC_RRCFW, pic16_popGet (AOP (left), size)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), size)); + } } - } - pic16_freeAsmop(left,NULL,ic,TRUE); - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (left, NULL, ic, TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genRLC - generate code for rotate left with carry */ /*-----------------------------------------------------------------*/ -static void genRLC (iCode *ic) +static void +genRLC (iCode * ic) { - operand *left , *result ; + operand *left, *result; int size, offset = 0; int same; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); /* rotate right with carry */ - left = IC_LEFT(ic); - result=IC_RESULT(ic); - pic16_aopOp (left,ic,FALSE); - pic16_aopOp (result,ic,TRUE); + left = IC_LEFT (ic); + result = IC_RESULT (ic); + pic16_aopOp (left, ic, FALSE); + pic16_aopOp (result, ic, TRUE); - DEBUGpic16_pic16_AopType(__LINE__,left,NULL,result); + DEBUGpic16_pic16_AopType (__LINE__, left, NULL, result); - same = pic16_sameRegs(AOP(result),AOP(left)); + same = pic16_sameRegs (AOP (result), AOP (left)); /* move it to the result */ - size = AOP_SIZE(result); + size = AOP_SIZE (result); /* get the msb and put it into the carry */ - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(left),size-1)); + pic16_emitpcode (POC_RLCFW, pic16_popGet (AOP (left), size - 1)); - offset = 0 ; + offset = 0; - while(size--) { + while (size--) + { - if(same) { - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(left),offset)); - } else { - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(left),offset)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offset)); - } + if (same) + { + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (left), offset)); + } + else + { + pic16_emitpcode (POC_RLCFW, pic16_popGet (AOP (left), offset)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + } - offset++; - } + offset++; + } - pic16_freeAsmop(left,NULL,ic,TRUE); - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (left, NULL, ic, TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); } @@ -6490,68 +7254,135 @@ /*-----------------------------------------------------------------*/ /* genGetHbit - generates code get highest order bit */ /*-----------------------------------------------------------------*/ -static void genGetHbit (iCode *ic) +static void +genGetHbit (iCode * ic) { - operand *left, *result; - left = IC_LEFT(ic); - result=IC_RESULT(ic); - pic16_aopOp (left,ic,FALSE); - pic16_aopOp (result,ic,FALSE); - - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* get the highest order byte into a */ - MOVA(pic16_aopGet(AOP(left),AOP_SIZE(left) - 1,FALSE,FALSE)); - if(AOP_TYPE(result) == AOP_CRY){ - pic16_emitcode("rlc","a"); - pic16_outBitC(result); - } - else{ - pic16_emitcode("rl","a"); - pic16_emitcode("anl","a,#0x01"); - pic16_outAcc(result); + operand *left, *result; + left = IC_LEFT (ic); + result = IC_RESULT (ic); + pic16_aopOp (left, ic, FALSE); + pic16_aopOp (result, ic, FALSE); + + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* get the highest order byte into a */ + MOVA (pic16_aopGet (AOP (left), AOP_SIZE (left) - 1, FALSE, FALSE)); + if (AOP_TYPE (result) == AOP_CRY) + { + pic16_emitcode ("rlc", "a"); + pic16_outBitC (result); + } + else + { + pic16_emitcode ("rl", "a"); + pic16_emitcode ("anl", "a,#0x01"); + pic16_outAcc (result); } - pic16_freeAsmop(left,NULL,ic,TRUE); - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (left, NULL, ic, TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); +} + +static void +genGetABit (iCode * ic) +{ + operand *left, *right, *result; + int shCount; + int offset; + int i; + + left = IC_LEFT (ic); + right = IC_RIGHT (ic); + result = IC_RESULT (ic); + + pic16_aopOp (left, ic, FALSE); + pic16_aopOp (right, ic, FALSE); + pic16_aopOp (result, ic, TRUE); + + shCount = (int) ulFromVal (AOP (right)->aopu.aop_lit); + offset = shCount / 8; + shCount %= 8; + + /* load and mask the source byte */ + pic16_mov2w (AOP (left), offset); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (1 << shCount)); + + /* move selected bit to bit 0 */ + switch (shCount) + { + case 0: + /* nothing more to do */ + break; + case 1: + /* shift bit 1 into bit 0 */ + pic16_emitpcode (POC_RRNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + case 4: + /* shift bit 4 into bit 0 */ + pic16_emitpcode (POC_SWAPFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + case 7: + /* shift bit 7 into bit 0 */ + pic16_emitpcode (POC_RLNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + default: + /* keep W==0, force W=0x01 otherwise */ + emitSKPZ; + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (1)); + break; + } // switch + + /* write result */ + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); + + for (i = 1; i < AOP_SIZE (result); ++i) + { + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), i)); + } // for + + pic16_freeAsmop (left, NULL, ic, TRUE); + pic16_freeAsmop (right, NULL, ic, TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); } #if 0 /*-----------------------------------------------------------------*/ /* AccRol - rotate left accumulator by known count */ /*-----------------------------------------------------------------*/ -static void AccRol (int shCount) +static void +AccRol (int shCount) { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - shCount &= 0x0007; // shCount : 0..7 - switch(shCount){ - case 0 : - break; - case 1 : - pic16_emitcode("rl","a"); - break; - case 2 : - pic16_emitcode("rl","a"); - pic16_emitcode("rl","a"); - break; - case 3 : - pic16_emitcode("swap","a"); - pic16_emitcode("rr","a"); - break; - case 4 : - pic16_emitcode("swap","a"); - break; - case 5 : - pic16_emitcode("swap","a"); - pic16_emitcode("rl","a"); - break; - case 6 : - pic16_emitcode("rr","a"); - pic16_emitcode("rr","a"); - break; - case 7 : - pic16_emitcode("rr","a"); - break; + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + shCount &= 0x0007; // shCount : 0..7 + switch (shCount) + { + case 0: + break; + case 1: + pic16_emitcode ("rl", "a"); + break; + case 2: + pic16_emitcode ("rl", "a"); + pic16_emitcode ("rl", "a"); + break; + case 3: + pic16_emitcode ("swap", "a"); + pic16_emitcode ("rr", "a"); + break; + case 4: + pic16_emitcode ("swap", "a"); + break; + case 5: + pic16_emitcode ("swap", "a"); + pic16_emitcode ("rl", "a"); + break; + case 6: + pic16_emitcode ("rr", "a"); + pic16_emitcode ("rr", "a"); + break; + case 7: + pic16_emitcode ("rr", "a"); + break; } } #endif @@ -6559,713 +7390,807 @@ /*-----------------------------------------------------------------*/ /* AccLsh - left shift accumulator by known count */ /*-----------------------------------------------------------------*/ -static void AccLsh (int shCount, int doMask) +static void +AccLsh (int shCount, int doMask) { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - switch(shCount){ - case 0 : - return; - break; - case 1 : - pic16_emitpcode(POC_RLNCFW,pic16_popCopyReg(&pic16_pc_wreg)); - break; - case 2 : - pic16_emitpcode(POC_RLNCFW,pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_RLNCFW,pic16_popCopyReg(&pic16_pc_wreg)); - break; - case 3 : - pic16_emitpcode(POC_SWAPFW,pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_RRNCFW,pic16_popCopyReg(&pic16_pc_wreg)); - break; - case 4 : - pic16_emitpcode(POC_SWAPFW,pic16_popCopyReg(&pic16_pc_wreg)); - break; - case 5 : - pic16_emitpcode(POC_SWAPFW,pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_RLNCFW,pic16_popCopyReg(&pic16_pc_wreg)); - break; - case 6 : - pic16_emitpcode(POC_RRNCFW,pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_RRNCFW,pic16_popCopyReg(&pic16_pc_wreg)); - break; - case 7 : - pic16_emitpcode(POC_RRNCFW,pic16_popCopyReg(&pic16_pc_wreg)); - break; - } - if (doMask) { - /* no masking is required in genPackBits */ - pic16_emitpcode(POC_ANDLW,pic16_popGetLit(SLMask[shCount])); - } + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + switch (shCount) + { + case 0: + return; + break; + case 1: + pic16_emitpcode (POC_RLNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + case 2: + pic16_emitpcode (POC_RLNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_RLNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + case 3: + pic16_emitpcode (POC_SWAPFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_RRNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + case 4: + pic16_emitpcode (POC_SWAPFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + case 5: + pic16_emitpcode (POC_SWAPFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_RLNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + case 6: + pic16_emitpcode (POC_RRNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_RRNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + case 7: + pic16_emitpcode (POC_RRNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + } + if (doMask) + { + /* no masking is required in genPackBits */ + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (SLMask[shCount])); + } } /*-----------------------------------------------------------------*/ /* AccRsh - right shift accumulator by known count */ /*-----------------------------------------------------------------*/ -static void AccRsh (int shCount, int andmask) +static void +AccRsh (int shCount, int andmask) { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - assert ((shCount >= 0) && (shCount <= 8)); - switch (shCount) { - case 0 : - return; break; - case 1 : - pic16_emitpcode(POC_RRNCFW,pic16_popCopyReg(&pic16_pc_wreg)); - break; - case 2 : - pic16_emitpcode(POC_RRNCFW,pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_RRNCFW,pic16_popCopyReg(&pic16_pc_wreg)); - break; - case 3 : - pic16_emitpcode(POC_SWAPFW,pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_RLNCFW,pic16_popCopyReg(&pic16_pc_wreg)); - break; - case 4 : - pic16_emitpcode(POC_SWAPFW,pic16_popCopyReg(&pic16_pc_wreg)); - break; - case 5 : - pic16_emitpcode(POC_SWAPFW,pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_RRNCFW,pic16_popCopyReg(&pic16_pc_wreg)); - break; - case 6 : - pic16_emitpcode(POC_RLNCFW,pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_RLNCFW,pic16_popCopyReg(&pic16_pc_wreg)); - break; - case 7 : - pic16_emitpcode(POC_RLNCFW,pic16_popCopyReg(&pic16_pc_wreg)); - break; - default: - // Rotating by 8 is a NOP. - break; - } + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + assert ((shCount >= 0) && (shCount <= 8)); + switch (shCount) + { + case 0: + return; + break; + case 1: + pic16_emitpcode (POC_RRNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + case 2: + pic16_emitpcode (POC_RRNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_RRNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + case 3: + pic16_emitpcode (POC_SWAPFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_RLNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + case 4: + pic16_emitpcode (POC_SWAPFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + case 5: + pic16_emitpcode (POC_SWAPFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_RRNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + case 6: + pic16_emitpcode (POC_RLNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_RLNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + case 7: + pic16_emitpcode (POC_RLNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + break; + default: + // Rotating by 8 is a NOP. + break; + } - if (andmask) - pic16_emitpcode(POC_ANDLW,pic16_popGetLit(SRMask[shCount])); - else - DEBUGpic16_emitcode("; ***", "%s omitting masking the result", __FUNCTION__); + if (andmask) + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (SRMask[shCount])); + else + DEBUGpic16_emitcode ("; ***", "%s omitting masking the result", __FUNCTION__); } /*-----------------------------------------------------------------*/ /* shiftR1Left2Result - shift right one byte from left to result */ /*-----------------------------------------------------------------*/ -static void shiftR1Left2ResultSigned (operand *left, int offl, - operand *result, int offr, - int shCount) +static void +shiftR1Left2ResultSigned (operand * left, int offl, operand * result, int offr, int shCount) { int same; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); assert ((shCount >= 0) && (shCount <= 8)); - same = ((left == result) || (AOP(left) == AOP(result))) && (offl == offr); + same = ((left == result) || (AOP (left) == AOP (result))) && (offl == offr); /* Do NOT use result for intermediate results, it might be an SFR!. */ - switch (shCount) { - case 0: - if (!same) { - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - } - break; + switch (shCount) + { + case 0: + if (!same) + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + } + break; - case 1: - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(left), offl)); - if (same) - pic16_emitpcode(POC_RRCF, pic16_popGet(AOP(result), offr)); - else { - pic16_emitpcode(POC_RRCFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - } - break; + case 1: + pic16_emitpcode (POC_RLCFW, pic16_popGet (AOP (left), offl)); + if (same) + pic16_emitpcode (POC_RRCF, pic16_popGet (AOP (result), offr)); + else + { + pic16_emitpcode (POC_RRCFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + } + break; - case 2: - pic16_emitpcode(POC_RRNCFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_RRNCFW, pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0x3f)); // keep sign bit in W<5> - pic16_emitpcode(POC_BTFSC, pic16_popCopyGPR2Bit(PCOP(&pic16_pc_wreg), 5)); - pic16_emitpcode(POC_IORLW, pic16_popGetLit(0xc0)); // sign-extend - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 2: + pic16_emitpcode (POC_RRNCFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_RRNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x3f)); // keep sign bit in W<5> + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (PCOP (&pic16_pc_wreg), 5)); + pic16_emitpcode (POC_IORLW, pic16_popGetLit (0xc0)); // sign-extend + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + break; - case 3: - pic16_emitpcode(POC_SWAPFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_RLNCFW, pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0x1f)); // keep sign in W<4> - pic16_emitpcode(POC_BTFSC, pic16_popCopyGPR2Bit(PCOP(&pic16_pc_wreg), 4)); - pic16_emitpcode(POC_IORLW, pic16_popGetLit(0xe0)); // sign-extend - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 3: + pic16_emitpcode (POC_SWAPFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_RLNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x1f)); // keep sign in W<4> + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (PCOP (&pic16_pc_wreg), 4)); + pic16_emitpcode (POC_IORLW, pic16_popGetLit (0xe0)); // sign-extend + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + break; - case 4: - pic16_emitpcode(POC_SWAPFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0x0f)); // keep sign in W<3> - pic16_emitpcode(POC_BTFSC, pic16_popCopyGPR2Bit(PCOP(&pic16_pc_wreg), 3)); - pic16_emitpcode(POC_IORLW, pic16_popGetLit(0xf0)); // sign-extend - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 4: + pic16_emitpcode (POC_SWAPFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x0f)); // keep sign in W<3> + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (PCOP (&pic16_pc_wreg), 3)); + pic16_emitpcode (POC_IORLW, pic16_popGetLit (0xf0)); // sign-extend + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + break; - case 5: - pic16_emitpcode(POC_SWAPFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_RRNCFW, pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0x07)); // keep sign in W<2> - pic16_emitpcode(POC_BTFSC, pic16_popCopyGPR2Bit(PCOP(&pic16_pc_wreg), 2)); - pic16_emitpcode(POC_IORLW, pic16_popGetLit(0xf8)); // sign-extend - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 5: + pic16_emitpcode (POC_SWAPFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_RRNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x07)); // keep sign in W<2> + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (PCOP (&pic16_pc_wreg), 2)); + pic16_emitpcode (POC_IORLW, pic16_popGetLit (0xf8)); // sign-extend + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + break; - case 6: - pic16_emitpcode(POC_RLNCFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_RLNCFW, pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0x03)); // keep sign bit in W<1> - pic16_emitpcode(POC_BTFSC, pic16_popCopyGPR2Bit(PCOP(&pic16_pc_wreg), 1)); - pic16_emitpcode(POC_IORLW, pic16_popGetLit(0xfc)); // sign-extend - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 6: + pic16_emitpcode (POC_RLNCFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_RLNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x03)); // keep sign bit in W<1> + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (PCOP (&pic16_pc_wreg), 1)); + pic16_emitpcode (POC_IORLW, pic16_popGetLit (0xfc)); // sign-extend + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + break; - case 7: - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(0x00)); - pic16_emitpcode(POC_BTFSC, pic16_popCopyGPR2Bit(pic16_popGet(AOP(left), offl), 7)); - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(0xff)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 7: + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (0x00)); + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (pic16_popGet (AOP (left), offl), 7)); + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (0xff)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + break; - default: - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result), offr)); - break; - } + default: + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offr)); + break; + } } /*-----------------------------------------------------------------*/ /* shiftR1Left2Result - shift right one byte from left to result */ /*-----------------------------------------------------------------*/ -static void shiftR1Left2Result (operand *left, int offl, - operand *result, int offr, - int shCount, int sign) +static void +shiftR1Left2Result (operand * left, int offl, operand * result, int offr, int shCount, int sign) { int same; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); assert ((shCount >= 0) && (shCount <= 8)); - same = ((left == result) || (AOP(left) == AOP(result))) && (offl == offr); + same = ((left == result) || (AOP (left) == AOP (result))) && (offl == offr); /* Copy the msb into the carry if signed. */ - if (sign) { - shiftR1Left2ResultSigned(left, offl, result, offr, shCount); - return; - } + if (sign) + { + shiftR1Left2ResultSigned (left, offl, result, offr, shCount); + return; + } /* Do NOT use result for intermediate results, it might be an SFR!. */ - switch (shCount) { - case 0: - if (!same) { - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - } - break; + switch (shCount) + { + case 0: + if (!same) + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + } + break; - case 1: - if (same) { - emitCLRC; - pic16_emitpcode(POC_RRCF, pic16_popGet(AOP(result), offr)); - } else { - pic16_emitpcode(POC_RRNCFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0x7f)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - } - break; + case 1: + if (same) + { + emitCLRC; + pic16_emitpcode (POC_RRCF, pic16_popGet (AOP (result), offr)); + } + else + { + pic16_emitpcode (POC_RRNCFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x7f)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + } + break; - case 2: - pic16_emitpcode(POC_RRNCFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_RRNCFW, pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0x3f)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 2: + pic16_emitpcode (POC_RRNCFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_RRNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x3f)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + break; - case 3: - pic16_emitpcode(POC_SWAPFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_RLNCFW, pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0x1f)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 3: + pic16_emitpcode (POC_SWAPFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_RLNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x1f)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + break; - case 4: - pic16_emitpcode(POC_SWAPFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0x0f)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 4: + pic16_emitpcode (POC_SWAPFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x0f)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + break; - case 5: - pic16_emitpcode(POC_SWAPFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_RRNCFW, pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0x07)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 5: + pic16_emitpcode (POC_SWAPFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_RRNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x07)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + break; - case 6: - pic16_emitpcode(POC_RLNCFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_RLNCFW, pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0x03)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 6: + pic16_emitpcode (POC_RLNCFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_RLNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x03)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + break; - case 7: - pic16_emitpcode(POC_RLNCFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0x01)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 7: + pic16_emitpcode (POC_RLNCFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x01)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + break; - default: - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result), offr)); - break; - } + default: + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offr)); + break; + } } /*-----------------------------------------------------------------*/ /* shiftL1Left2Result - shift left one byte from left to result */ /*-----------------------------------------------------------------*/ -static void shiftL1Left2Result (operand *left, int offl, - operand *result, int offr, int shCount) +static void +shiftL1Left2Result (operand * left, int offl, operand * result, int offr, int shCount) { int same; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); assert ((shCount >= 0) && (shCount <= 8)); - same = ((left == result) || (AOP(left) == AOP(result))) && (offl==offr); + same = ((left == result) || (AOP (left) == AOP (result))) && (offl == offr); /* Do NOT use result for intermediate results, it might be an SFR!. */ - switch (shCount) { - case 0: - if (!same) { - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - } - break; + switch (shCount) + { + case 0: + if (!same) + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + } + break; - case 1: - if (same) { - emitCLRC; - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(left), offl)); - } else { - pic16_emitpcode(POC_RLNCFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0xfe)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - } - break; + case 1: + if (same) + { + emitCLRC; + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (left), offl)); + } + else + { + pic16_emitpcode (POC_RLNCFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0xfe)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + } + break; - case 2: - pic16_emitpcode(POC_RLNCFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_RLNCFW, pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0xfc)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 2: + { + if (same) + { + if (AOP_TYPE (left) == AOP_ACC) + { + /* Reduces the number of instructions. */ + pic16_emitpcode(POC_ADDFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode(POC_ADDFW, pic16_popGet (AOP (left), offl)); + } + else + { + emitCLRC; + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (left), offl)); + emitCLRC; + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (left), offl)); + } + } + else + { + pic16_emitpcode (POC_RLNCFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_RLNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0xfc)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + } - case 3: - pic16_emitpcode(POC_SWAPFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_RRNCFW, pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0xf8)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + break; + } - case 4: - pic16_emitpcode(POC_SWAPFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0xf0)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 3: + if (same && AOP_TYPE(left) == AOP_ACC) + { + /* Reduces the number of instructions. */ + pic16_emitpcode (POC_ADDFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_ADDFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_ADDFW, pic16_popGet (AOP (left), offl)); + } + else + { + pic16_emitpcode (POC_SWAPFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_RRNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0xf8)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + } + break; - case 5: - pic16_emitpcode(POC_SWAPFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_RLNCFW, pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0xe0)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 4: + pic16_emitpcode (POC_SWAPFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0xf0)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + break; - case 6: - pic16_emitpcode(POC_RRNCFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_RRNCFW, pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0xc0)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 5: + pic16_emitpcode (POC_SWAPFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_RLNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0xe0)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + break; - case 7: - pic16_emitpcode(POC_RRNCFW, pic16_popGet(AOP(left), offl)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0x80)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offr)); - break; + case 6: + pic16_emitpcode (POC_RRNCFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_RRNCFW, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0xc0)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + break; - default: - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result), offr)); - break; - } + case 7: + pic16_emitpcode (POC_RRNCFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x80)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + break; + + default: + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offr)); + break; + } } /*-----------------------------------------------------------------*/ /* movLeft2Result - move byte from left to result */ /*-----------------------------------------------------------------*/ -static void movLeft2Result (operand *left, int offl, - operand *result, int offr) +static void +movLeft2Result (operand * left, int offl, operand * result, int offr) { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if (!pic16_sameRegs(AOP(left),AOP(result)) || (offl != offr)) { - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(left),offl)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offr)); - } + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + if (!pic16_sameRegs (AOP (left), AOP (result)) || (offl != offr)) + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + } } /*-----------------------------------------------------------------*/ /* shiftL2Left2Result - shift left two bytes from left to result */ /*-----------------------------------------------------------------*/ -static void shiftL2Left2Result (operand *left, int offl, - operand *result, int offr, int shCount) +static void +shiftL2Left2Result (operand * left, int offl, operand * result, int offr, int shCount) { - int same = pic16_sameRegs(AOP(result), AOP(left)); + int same = pic16_sameRegs (AOP (result), AOP (left)); int i; - DEBUGpic16_emitcode ("; ***","%s %d shCount:%d same:%d offl:%d offr:%d",__FUNCTION__,__LINE__,shCount,same,offl,offr); + DEBUGpic16_emitcode ("; ***", "%s %d shCount:%d same:%d offl:%d offr:%d", __FUNCTION__, __LINE__, shCount, same, offl, offr); - if (same && (offl != offr)) { // shift bytes - if (offr > offl) { - for(i=1;i>-1;i--) { - pic16_emitpcode(POC_MOVFW,pic16_popGet(AOP(result),offl+i)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),offr+i)); - } - } else { // just treat as different later on - same = 0; + if (same && (offl != offr)) // shift bytes + { + if (offr > offl) + { + for (i = 1; i > -1; i--) + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (result), offl + i)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr + i)); + } + } + else // just treat as different later on + { + same = 0; + } } - } - if(same) { - switch(shCount) { - case 0: - break; - case 1: - case 2: - case 3: + if (same) + { + switch (shCount) + { + case 0: + break; + case 1: + case 2: + case 3: - pic16_emitpcode(POC_MOVFW,pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_ADDWF,pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr+MSB16)); + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_ADDWF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), offr + MSB16)); - while(--shCount) { - emitCLRC; - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr+MSB16)); - } + while (--shCount) + { + emitCLRC; + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), offr + MSB16)); + } - break; - case 4: - case 5: - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(0x0f)); - pic16_emitpcode(POC_ANDWF, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_SWAPF, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_SWAPF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_ANDFW, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_XORWF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_ADDWF, pic16_popGet(AOP(result),offr+MSB16)); - if(shCount >=5) { - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr+MSB16)); - } - break; - case 6: - pic16_emitpcode(POC_RRCF, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_RRCF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RRCF, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_RRCF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RRCFW, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_ANDLW,pic16_popGetLit(0xc0)); - pic16_emitpcode(POC_XORFW,pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_XORWF,pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_XORFW,pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),offr+MSB16)); - break; - case 7: - pic16_emitpcode(POC_RRCFW, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_RRCFW, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RRCF, pic16_popGet(AOP(result),offr)); - } + break; + case 4: + case 5: + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (0x0f)); + pic16_emitpcode (POC_ANDWF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_SWAPF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_SWAPF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_ANDFW, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_XORWF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_ADDWF, pic16_popGet (AOP (result), offr + MSB16)); + if (shCount >= 5) + { + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), offr + MSB16)); + } + break; + case 6: + pic16_emitpcode (POC_RRCF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_RRCF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_RRCF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_RRCF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_RRCFW, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0xc0)); + pic16_emitpcode (POC_XORFW, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_XORWF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_XORFW, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr + MSB16)); + break; + case 7: + pic16_emitpcode (POC_RRCFW, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_RRCFW, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_RRCF, pic16_popGet (AOP (result), offr)); + } - } else { - switch(shCount) { - case 0: - break; - case 1: - case 2: - case 3: - /* note, use a mov/add for the shift since the mov has a - chance of getting optimized out */ - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(left),offl)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_ADDWF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(left),offl+MSB16)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offr+MSB16)); + } + else + { + switch (shCount) + { + case 0: + break; + case 1: + case 2: + case 3: + /* note, use a mov/add for the shift since the mov has a + chance of getting optimized out */ + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_ADDWF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_RLCFW, pic16_popGet (AOP (left), offl + MSB16)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr + MSB16)); - while(--shCount) { - emitCLRC; - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr+MSB16)); - } - break; + while (--shCount) + { + emitCLRC; + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), offr + MSB16)); + } + break; - case 4: - case 5: - pic16_emitpcode(POC_SWAPFW,pic16_popGet(AOP(left),offl+MSB16)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0xF0)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_SWAPFW,pic16_popGet(AOP(left),offl)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0x0F)); - pic16_emitpcode(POC_XORWF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_ADDWF, pic16_popGet(AOP(result),offr+MSB16)); + case 4: + case 5: + pic16_emitpcode (POC_SWAPFW, pic16_popGet (AOP (left), offl + MSB16)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0xF0)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_SWAPFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x0F)); + pic16_emitpcode (POC_XORWF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_ADDWF, pic16_popGet (AOP (result), offr + MSB16)); - if(shCount == 5) { - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr+MSB16)); - } - break; - case 6: - pic16_emitpcode(POC_RRNCFW, pic16_popGet(AOP(left),offl)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RRNCF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RRNCFW, pic16_popGet(AOP(left),offl+MSB16)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_RRNCF, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(0xc0)); - pic16_emitpcode(POC_ANDWF, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_ANDFW, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_XORFW, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_IORWF, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_XORWF, pic16_popGet(AOP(result),offr)); - break; - case 7: - pic16_emitpcode(POC_RRCFW, pic16_popGet(AOP(left),offl+MSB16)); - pic16_emitpcode(POC_RRCFW, pic16_popGet(AOP(left),offl)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RRCF, pic16_popGet(AOP(result),offr)); + if (shCount == 5) + { + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), offr + MSB16)); + } + break; + case 6: + pic16_emitpcode (POC_RRNCFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_RRNCF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_RRNCFW, pic16_popGet (AOP (left), offl + MSB16)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_RRNCF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (0xc0)); + pic16_emitpcode (POC_ANDWF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_ANDFW, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_XORFW, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_IORWF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_XORWF, pic16_popGet (AOP (result), offr)); + break; + case 7: + pic16_emitpcode (POC_RRCFW, pic16_popGet (AOP (left), offl + MSB16)); + pic16_emitpcode (POC_RRCFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_RRCF, pic16_popGet (AOP (result), offr)); + } } - } } + /*-----------------------------------------------------------------*/ /* shiftR2Left2Result - shift right two bytes from left to result */ /*-----------------------------------------------------------------*/ -static void shiftR2Left2Result (operand *left, int offl, - operand *result, int offr, - int shCount, int sign) +static void +shiftR2Left2Result (operand * left, int offl, operand * result, int offr, int shCount, int sign) { - int same = pic16_sameRegs(AOP(result), AOP(left)); + int same = pic16_sameRegs (AOP (result), AOP (left)); int i; - DEBUGpic16_emitcode ("; ***","%s %d shCount:%d same:%d sign:%d",__FUNCTION__,__LINE__,shCount,same,sign); + DEBUGpic16_emitcode ("; ***", "%s %d shCount:%d same:%d sign:%d", __FUNCTION__, __LINE__, shCount, same, sign); - if (same && (offl != offr)) { // shift right bytes - if (offr < offl) { - for(i=0;i<2;i++) { - pic16_emitpcode(POC_MOVFW,pic16_popGet(AOP(result),offl+i)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),offr+i)); - } - } else { // just treat as different later on - same = 0; + if (same && (offl != offr)) // shift right bytes + { + if (offr < offl) + { + for (i = 0; i < 2; i++) + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (result), offl + i)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr + i)); + } + } + else // just treat as different later on + { + same = 0; + } } - } - switch(shCount) { - case 0: - break; - case 1: - case 2: - case 3: - /* obtain sign from left operand */ - if(sign) - pic16_emitpcode(POC_RLCFW,pic16_popGet(AOP(left),offr+MSB16)); - else - emitCLRC; + switch (shCount) + { + case 0: + break; + case 1: + case 2: + case 3: + /* obtain sign from left operand */ + if (sign) + pic16_emitpcode (POC_RLCFW, pic16_popGet (AOP (left), offr + MSB16)); + else + emitCLRC; + + if (same) + { + pic16_emitpcode (POC_RRCF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_RRCF, pic16_popGet (AOP (result), offr)); + } + else + { + pic16_emitpcode (POC_RRCFW, pic16_popGet (AOP (left), offl + MSB16)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_RRCFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + } + + while (--shCount) + { + if (sign) + /* now get sign from already assigned result (avoid BANKSEL) */ + pic16_emitpcode (POC_RLCFW, pic16_popGet (AOP (result), offr + MSB16)); + else + emitCLRC; + pic16_emitpcode (POC_RRCF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_RRCF, pic16_popGet (AOP (result), offr)); + } + break; + case 4: + case 5: + if (same) + { + + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (0xf0)); + pic16_emitpcode (POC_ANDWF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_SWAPF, pic16_popGet (AOP (result), offr)); + + pic16_emitpcode (POC_SWAPF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_ANDFW, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_XORWF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_ADDWF, pic16_popGet (AOP (result), offr)); + } + else + { + pic16_emitpcode (POC_SWAPFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x0f)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + + pic16_emitpcode (POC_SWAPFW, pic16_popGet (AOP (left), offl + MSB16)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0xf0)); + pic16_emitpcode (POC_XORWF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_ADDWF, pic16_popGet (AOP (result), offr)); + } + + if (shCount >= 5) + { + pic16_emitpcode (POC_RRCF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_RRCF, pic16_popGet (AOP (result), offr)); + } - if(same) { - pic16_emitpcode(POC_RRCF,pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_RRCF,pic16_popGet(AOP(result),offr)); - } else { - pic16_emitpcode(POC_RRCFW, pic16_popGet(AOP(left),offl+MSB16)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_RRCFW, pic16_popGet(AOP(left),offl)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),offr)); - } + if (sign) + { + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (0xf0 + (shCount - 4) * 8)); + pic16_emitpcode (POC_BTFSC, + pic16_newpCodeOpBit (pic16_aopGet (AOP (result), offr + MSB16, FALSE, FALSE), 7 - shCount, 0, + PO_GPR_REGISTER)); + pic16_emitpcode (POC_ADDWF, pic16_popGet (AOP (result), offr + MSB16)); + } - while(--shCount) { - if(sign) - /* now get sign from already assigned result (avoid BANKSEL) */ - pic16_emitpcode(POC_RLCFW,pic16_popGet(AOP(result),offr+MSB16)); - else - emitCLRC; - pic16_emitpcode(POC_RRCF,pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_RRCF,pic16_popGet(AOP(result),offr)); - } - break; - case 4: - case 5: - if(same) { - - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(0xf0)); - pic16_emitpcode(POC_ANDWF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_SWAPF, pic16_popGet(AOP(result),offr)); - - pic16_emitpcode(POC_SWAPF, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_ANDFW, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_XORWF, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_ADDWF, pic16_popGet(AOP(result),offr)); - } else { - pic16_emitpcode(POC_SWAPFW,pic16_popGet(AOP(left),offl)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0x0f)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offr)); - - pic16_emitpcode(POC_SWAPFW,pic16_popGet(AOP(left),offl+MSB16)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(0xf0)); - pic16_emitpcode(POC_XORWF, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_ADDWF, pic16_popGet(AOP(result),offr)); - } - - if(shCount >=5) { - pic16_emitpcode(POC_RRCF, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_RRCF, pic16_popGet(AOP(result),offr)); - } - - if(sign) { - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(0xf0 + (shCount-4)*8 )); - pic16_emitpcode(POC_BTFSC, - pic16_newpCodeOpBit(pic16_aopGet(AOP(result),offr+MSB16,FALSE,FALSE),7-shCount,0, PO_GPR_REGISTER)); - pic16_emitpcode(POC_ADDWF, pic16_popGet(AOP(result),offr+MSB16)); - } + break; - break; + case 6: + if (same) + { - case 6: - if(same) { + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), offr + MSB16)); - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr+MSB16)); + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_RLCFW, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x03)); + if (sign) + { + pic16_emitpcode (POC_BTFSC, + pic16_newpCodeOpBit (pic16_aopGet (AOP (result), offr, FALSE, FALSE), 0, 0, PO_GPR_REGISTER)); + pic16_emitpcode (POC_IORLW, pic16_popGetLit (0xfc)); + } + pic16_emitpcode (POC_XORFW, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_XORWF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_XORFW, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + } + else + { + pic16_emitpcode (POC_RLCFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_RLCFW, pic16_popGet (AOP (left), offl + MSB16)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_RLCFW, pic16_popGet (AOP (result), offr + MSB16)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit (0x03)); + if (sign) + { + pic16_emitpcode (POC_BTFSC, + pic16_newpCodeOpBit (pic16_aopGet (AOP (result), offr + MSB16, FALSE, FALSE), 0, 0, + PO_GPR_REGISTER)); + pic16_emitpcode (POC_IORLW, pic16_popGetLit (0xfc)); + } + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr + MSB16)); + //pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_ANDLW,pic16_popGetLit(0x03)); - if(sign) { - pic16_emitpcode(POC_BTFSC, - pic16_newpCodeOpBit(pic16_aopGet(AOP(result),offr,FALSE,FALSE),0,0, PO_GPR_REGISTER)); - pic16_emitpcode(POC_IORLW,pic16_popGetLit(0xfc)); - } - pic16_emitpcode(POC_XORFW,pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_XORWF,pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_XORFW,pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),offr)); - } else { - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(left),offl)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(left),offl+MSB16)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(result),offr+MSB16)); - pic16_emitpcode(POC_ANDLW,pic16_popGetLit(0x03)); - if(sign) { - pic16_emitpcode(POC_BTFSC, - pic16_newpCodeOpBit(pic16_aopGet(AOP(result),offr+MSB16,FALSE,FALSE),0,0, PO_GPR_REGISTER)); - pic16_emitpcode(POC_IORLW,pic16_popGetLit(0xfc)); - } - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),offr+MSB16)); - //pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr)); + } + break; + case 7: + pic16_emitpcode (POC_RLCFW, pic16_popGet (AOP (left), offl)); + pic16_emitpcode (POC_RLCFW, pic16_popGet (AOP (left), offl + MSB16)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offr)); + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offr + MSB16)); + if (sign) + { + emitSKPNC; + pic16_emitpcode (POC_DECF, pic16_popGet (AOP (result), offr + MSB16)); + } + else + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (result), offr + MSB16)); } - - break; - case 7: - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(left),offl)); - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(left),offl+MSB16)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),offr)); - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),offr+MSB16)); - if(sign) { - emitSKPNC; - pic16_emitpcode(POC_DECF, pic16_popGet(AOP(result),offr+MSB16)); - } else - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),offr+MSB16)); - } } /*-----------------------------------------------------------------*/ /* shiftLLeftOrResult - shift left one byte from left, or to result*/ /*-----------------------------------------------------------------*/ -static void shiftLLeftOrResult (operand *left, int offl, - operand *result, int offr, int shCount) +static void +shiftLLeftOrResult (operand * left, int offl, operand * result, int offr, int shCount) { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - pic16_emitpcode(POC_MOVFW,pic16_popGet(AOP(left),offl)); - /* shift left accumulator */ - AccLsh(shCount, 1); - /* or with result */ - /* back to result */ - pic16_emitpcode(POC_IORWF,pic16_popGet(AOP(result),offr)); + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), offl)); + /* shift left accumulator */ + AccLsh (shCount, 1); + /* or with result */ + /* back to result */ + pic16_emitpcode (POC_IORWF, pic16_popGet (AOP (result), offr)); } /*-----------------------------------------------------------------*/ /* shiftRLeftOrResult - shift right one byte from left,or to result*/ /*-----------------------------------------------------------------*/ -static void shiftRLeftOrResult (operand *left, int offl, - operand *result, int offr, int shCount) +static void +shiftRLeftOrResult (operand * left, int offl, operand * result, int offr, int shCount) { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - pic16_emitpcode(POC_MOVFW,pic16_popGet(AOP(left),offl)); - /* shift right accumulator */ - AccRsh(shCount, 1); - /* or with result */ - /* back to result */ - pic16_emitpcode(POC_IORWF,pic16_popGet(AOP(result),offr)); + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), offl)); + /* shift right accumulator */ + AccRsh (shCount, 1); + /* or with result */ + /* back to result */ + pic16_emitpcode (POC_IORWF, pic16_popGet (AOP (result), offr)); } /*-----------------------------------------------------------------*/ /* genlshOne - left shift a one byte quantity by known count */ /*-----------------------------------------------------------------*/ -static void genlshOne (operand *result, operand *left, int shCount) +static void +genlshOne (operand * result, operand * left, int shCount) { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - shiftL1Left2Result(left, LSB, result, LSB, shCount); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + shiftL1Left2Result (left, LSB, result, LSB, shCount); } /*-----------------------------------------------------------------*/ /* genlshTwo - left shift two bytes by known amount != 0 */ /*-----------------------------------------------------------------*/ -static void genlshTwo (operand *result,operand *left, int shCount) +static void +genlshTwo (operand * result, operand * left, int shCount) { - int size; + int size; - DEBUGpic16_emitcode ("; ***","%s %d shCount:%d",__FUNCTION__,__LINE__,shCount); - size = pic16_getDataSize(result); + DEBUGpic16_emitcode ("; ***", "%s %d shCount:%d", __FUNCTION__, __LINE__, shCount); + size = pic16_getDataSize (result); - /* if shCount >= 8 */ - if (shCount >= 8) { - shCount -= 8 ; + /* if shCount >= 8 */ + if (shCount >= 8) + { + shCount -= 8; - if (size > 1){ - if (shCount) - shiftL1Left2Result(left, LSB, result, MSB16, shCount); - else - movLeft2Result(left, LSB, result, MSB16); + if (size > 1) + { + if (shCount) + shiftL1Left2Result (left, LSB, result, MSB16, shCount); + else + movLeft2Result (left, LSB, result, MSB16); } - pic16_emitpcode(POC_CLRF,pic16_popGet(AOP(result),LSB)); + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), LSB)); } - /* 1 <= shCount <= 7 */ - else { - if(size == 1) - shiftL1Left2Result(left, LSB, result, LSB, shCount); - else - shiftL2Left2Result(left, LSB, result, LSB, shCount); + /* 1 <= shCount <= 7 */ + else + { + if (size == 1) + shiftL1Left2Result (left, LSB, result, LSB, shCount); + else + shiftL2Left2Result (left, LSB, result, LSB, shCount); } } @@ -7273,202 +8198,234 @@ /* shiftLLong - shift left one long from left to result */ /* offr = LSB or MSB16 */ /*-----------------------------------------------------------------*/ -static void shiftLLong (operand *left, operand *result, int offr ) +static void +shiftLLong (operand * left, operand * result, int offr) { - int size = AOP_SIZE(result); - int same = pic16_sameRegs(AOP(left),AOP(result)); - int i; + int size = AOP_SIZE (result); + int same = pic16_sameRegs (AOP (left), AOP (result)); + int i; - DEBUGpic16_emitcode ("; ***","%s %d offr:%d size:%d",__FUNCTION__,__LINE__,offr,size); + DEBUGpic16_emitcode ("; ***", "%s %d offr:%d size:%d", __FUNCTION__, __LINE__, offr, size); - if (same && (offr == MSB16)) { //shift one byte - for(i=size-1;i>=MSB16;i--) { - pic16_emitpcode(POC_MOVFW,pic16_popGet(AOP(left),i-1)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(left),i)); - } - } else { - pic16_emitpcode(POC_MOVFW,pic16_popGet(AOP(left),LSB)); + if (same && (offr == MSB16)) //shift one byte + { + for (i = size - 1; i >= MSB16; i--) + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), i - 1)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (left), i)); } + } + else + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (left), LSB)); + } - if (size > LSB+offr ){ - if (same) { - pic16_emitpcode(POC_ADDWF,pic16_popGet(AOP(left),LSB+offr)); - } else { - pic16_emitpcode(POC_ADDFW,pic16_popGet(AOP(left),LSB)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),LSB+offr)); - } - } + if (size > LSB + offr) + { + if (same) + { + pic16_emitpcode (POC_ADDWF, pic16_popGet (AOP (left), LSB + offr)); + } + else + { + pic16_emitpcode (POC_ADDFW, pic16_popGet (AOP (left), LSB)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), LSB + offr)); + } + } - if(size > MSB16+offr){ - if (same) { - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(left),MSB16+offr)); - } else { - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(left),MSB16)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),MSB16+offr)); - } + if (size > MSB16 + offr) + { + if (same) + { + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (left), MSB16 + offr)); + } + else + { + pic16_emitpcode (POC_RLCFW, pic16_popGet (AOP (left), MSB16)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), MSB16 + offr)); + } } - if(size > MSB24+offr){ - if (same) { - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(left),MSB24+offr)); - } else { - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(left),MSB24)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),MSB24+offr)); - } + if (size > MSB24 + offr) + { + if (same) + { + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (left), MSB24 + offr)); + } + else + { + pic16_emitpcode (POC_RLCFW, pic16_popGet (AOP (left), MSB24)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), MSB24 + offr)); + } } - if(size > MSB32+offr){ - if (same) { - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(left),MSB32+offr)); - } else { - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(left),MSB32)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),MSB32+offr)); - } + if (size > MSB32 + offr) + { + if (same) + { + pic16_emitpcode (POC_RLCF, pic16_popGet (AOP (left), MSB32 + offr)); + } + else + { + pic16_emitpcode (POC_RLCFW, pic16_popGet (AOP (left), MSB32)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), MSB32 + offr)); + } } - if(offr != LSB) - pic16_emitpcode(POC_CLRF,pic16_popGet(AOP(result),LSB)); + if (offr != LSB) + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), LSB)); } /*-----------------------------------------------------------------*/ /* genlshFour - shift four byte by a known amount != 0 */ /*-----------------------------------------------------------------*/ -static void genlshFour (operand *result, operand *left, int shCount) +static void +genlshFour (operand * result, operand * left, int shCount) { - int size; + int size; + + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + size = AOP_SIZE (result); - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - size = AOP_SIZE(result); + /* if shifting more that 3 bytes */ + if (shCount >= 24) + { + shCount -= 24; + if (shCount) + /* lowest order of left goes to the highest + order of the destination */ + shiftL1Left2Result (left, LSB, result, MSB32, shCount); + else + movLeft2Result (left, LSB, result, MSB32); - /* if shifting more that 3 bytes */ - if (shCount >= 24 ) { - shCount -= 24; - if (shCount) - /* lowest order of left goes to the highest - order of the destination */ - shiftL1Left2Result(left, LSB, result, MSB32, shCount); - else - movLeft2Result(left, LSB, result, MSB32); - - pic16_emitpcode(POC_CLRF,pic16_popGet(AOP(result),LSB)); - pic16_emitpcode(POC_CLRF,pic16_popGet(AOP(result),MSB16)); - pic16_emitpcode(POC_CLRF,pic16_popGet(AOP(result),MSB24)); + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), LSB)); + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), MSB16)); + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), MSB24)); - return; + return; } - /* more than two bytes */ - else if ( shCount >= 16 ) { - /* lower order two bytes goes to higher order two bytes */ - shCount -= 16; - /* if some more remaining */ - if (shCount) - shiftL2Left2Result(left, LSB, result, MSB24, shCount); - else { - movLeft2Result(left, MSB16, result, MSB32); - movLeft2Result(left, LSB, result, MSB24); + /* more than two bytes */ + else if (shCount >= 16) + { + /* lower order two bytes goes to higher order two bytes */ + shCount -= 16; + /* if some more remaining */ + if (shCount) + shiftL2Left2Result (left, LSB, result, MSB24, shCount); + else + { + movLeft2Result (left, MSB16, result, MSB32); + movLeft2Result (left, LSB, result, MSB24); } - pic16_emitpcode(POC_CLRF,pic16_popGet(AOP(result),LSB)); - pic16_emitpcode(POC_CLRF,pic16_popGet(AOP(result),MSB16)); - return; + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), LSB)); + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), MSB16)); + return; } - /* if more than 1 byte */ - else if ( shCount >= 8 ) { - /* lower order three bytes goes to higher order three bytes */ - shCount -= 8; - if(size == 2){ - if(shCount) - shiftL1Left2Result(left, LSB, result, MSB16, shCount); - else - movLeft2Result(left, LSB, result, MSB16); + /* if more than 1 byte */ + else if (shCount >= 8) + { + /* lower order three bytes goes to higher order three bytes */ + shCount -= 8; + if (size == 2) + { + if (shCount) + shiftL1Left2Result (left, LSB, result, MSB16, shCount); + else + movLeft2Result (left, LSB, result, MSB16); } - else{ /* size = 4 */ - if(shCount == 0){ - movLeft2Result(left, MSB24, result, MSB32); - movLeft2Result(left, MSB16, result, MSB24); - movLeft2Result(left, LSB, result, MSB16); - pic16_emitpcode(POC_CLRF,pic16_popGet(AOP(result),LSB)); - } - else if(shCount == 1) - shiftLLong(left, result, MSB16); - else{ - shiftL2Left2Result(left, MSB16, result, MSB24, shCount); - shiftL1Left2Result(left, LSB, result, MSB16, shCount); - shiftRLeftOrResult(left, LSB, result, MSB24, 8 - shCount); - pic16_emitpcode(POC_CLRF,pic16_popGet(AOP(result),LSB)); + else /* size = 4 */ + { + if (shCount == 0) + { + movLeft2Result (left, MSB24, result, MSB32); + movLeft2Result (left, MSB16, result, MSB24); + movLeft2Result (left, LSB, result, MSB16); + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), LSB)); + } + else if (shCount == 1) + shiftLLong (left, result, MSB16); + else + { + shiftL2Left2Result (left, MSB16, result, MSB24, shCount); + shiftL1Left2Result (left, LSB, result, MSB16, shCount); + shiftRLeftOrResult (left, LSB, result, MSB24, 8 - shCount); + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), LSB)); } } } - /* 1 <= shCount <= 7 */ - else if(shCount <= 3) - { - shiftLLong(left, result, LSB); - while(--shCount >= 1) - shiftLLong(result, result, LSB); - } - /* 3 <= shCount <= 7, optimize */ - else{ - shiftL2Left2Result(left, MSB24, result, MSB24, shCount); - shiftRLeftOrResult(left, MSB16, result, MSB24, 8 - shCount); - shiftL2Left2Result(left, LSB, result, LSB, shCount); + /* 1 <= shCount <= 7 */ + else if (shCount <= 3) + { + shiftLLong (left, result, LSB); + while (--shCount >= 1) + shiftLLong (result, result, LSB); + } + /* 3 <= shCount <= 7, optimize */ + else + { + shiftL2Left2Result (left, MSB24, result, MSB24, shCount); + shiftRLeftOrResult (left, MSB16, result, MSB24, 8 - shCount); + shiftL2Left2Result (left, LSB, result, LSB, shCount); } } /*-----------------------------------------------------------------*/ /* genLeftShiftLiteral - left shifting by known count */ /*-----------------------------------------------------------------*/ -void pic16_genLeftShiftLiteral (operand *left, - operand *right, - operand *result, - iCode *ic) -{ - int shCount = abs((int) ulFromVal (AOP(right)->aopu.aop_lit)); - int size; - - FENTRY; - DEBUGpic16_emitcode ("; ***","shCount:%d", shCount); - pic16_freeAsmop(right,NULL,ic,TRUE); +void +pic16_genLeftShiftLiteral (operand * left, operand * right, operand * result, iCode * ic) +{ + int shCount = abs ((int) ulFromVal (AOP (right)->aopu.aop_lit)); + int size; + + FENTRY; + DEBUGpic16_emitcode ("; ***", "shCount:%d", shCount); + pic16_freeAsmop (right, NULL, ic, TRUE); - pic16_aopOp(left,ic,FALSE); - pic16_aopOp(result,ic,TRUE); + pic16_aopOp (left, ic, FALSE); + pic16_aopOp (result, ic, TRUE); - size = getSize(operandType(result)); + size = getSize (operandType (result)); #if VIEW_SIZE - pic16_emitcode("; shift left ","result %d, left %d",size, - AOP_SIZE(left)); + pic16_emitcode ("; shift left ", "result %d, left %d", size, AOP_SIZE (left)); #endif - /* I suppose that the left size >= result size */ - if(shCount == 0){ - while(size--){ - movLeft2Result(left, size, result, size); + /* I suppose that the left size >= result size */ + if (shCount == 0) + { + while (size--) + { + movLeft2Result (left, size, result, size); } } - else if(shCount >= (size * 8)) - while(size--) - pic16_aopPut(AOP(result),zero,size); - else{ - switch (size) { - case 1: - genlshOne (result,left,shCount); - break; + else if (shCount >= (size * 8)) + while (size--) + pic16_aopPut (AOP (result), zero, size); + else + { + switch (size) + { + case 1: + genlshOne (result, left, shCount); + break; - case 2: - case 3: - genlshTwo (result,left,shCount); - break; + case 2: + case 3: + genlshTwo (result, left, shCount); + break; - case 4: - genlshFour (result,left,shCount); - break; + case 4: + genlshFour (result, left, shCount); + break; } } - pic16_freeAsmop(left,NULL,ic,TRUE); - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (left, NULL, ic, TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------* @@ -7476,266 +8433,306 @@ * if endian == 1, then the high byte (i.e base address + size of * register) is used first else the low byte is used first; *-----------------------------------------------------------------*/ -static void genMultiAsm( PIC_OPCODE poc, operand *reg, int size, int endian) +static void +genMultiAsm (PIC_OPCODE poc, operand * reg, int size, int endian) { int offset = 0; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - if(!reg) + if (!reg) return; - if(!endian) { - endian = 1; - } else { - endian = -1; - offset = size-1; - } + if (!endian) + { + endian = 1; + } + else + { + endian = -1; + offset = size - 1; + } - while(size--) { - pic16_emitpcode(poc, pic16_popGet(AOP(reg),offset)); - offset += endian; - } + while (size--) + { + pic16_emitpcode (poc, pic16_popGet (AOP (reg), offset)); + offset += endian; + } } /*-----------------------------------------------------------------*/ /* genrshOne - right shift a one byte quantity by known count */ /*-----------------------------------------------------------------*/ -static void genrshOne (operand *result, operand *left, - int shCount, int sign) +static void +genrshOne (operand * result, operand * left, int shCount, int sign) { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - shiftR1Left2Result(left, LSB, result, LSB, shCount, sign); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + shiftR1Left2Result (left, LSB, result, LSB, shCount, sign); } /*-----------------------------------------------------------------*/ /* genrshTwo - right shift two bytes by known amount != 0 */ /*-----------------------------------------------------------------*/ -static void genrshTwo (operand *result,operand *left, - int shCount, int sign) +static void +genrshTwo (operand * result, operand * left, int shCount, int sign) { - DEBUGpic16_emitcode ("; ***","%s %d shCount:%d",__FUNCTION__,__LINE__,shCount); + DEBUGpic16_emitcode ("; ***", "%s %d shCount:%d", __FUNCTION__, __LINE__, shCount); /* if shCount >= 8 */ - if (shCount >= 8) { - shCount -= 8 ; - if (shCount) - shiftR1Left2Result(left, MSB16, result, LSB, - shCount, sign); - else - movLeft2Result(left, MSB16, result, LSB); + if (shCount >= 8) + { + shCount -= 8; + if (shCount) + shiftR1Left2Result (left, MSB16, result, LSB, shCount, sign); + else + movLeft2Result (left, MSB16, result, LSB); - pic16_addSign (result, 1, sign); - } + pic16_addSign (result, 1, sign); + } /* 1 <= shCount <= 7 */ else - shiftR2Left2Result(left, LSB, result, LSB, shCount, sign); + shiftR2Left2Result (left, LSB, result, LSB, shCount, sign); } /*-----------------------------------------------------------------*/ /* shiftRLong - shift right one long from left to result */ /* offl = LSB or MSB16 */ /*-----------------------------------------------------------------*/ -static void shiftRLong (operand *left, int offl, - operand *result, int sign) +static void +shiftRLong (operand * left, int offl, operand * result, int sign) { - int size = AOP_SIZE(result); - int same = pic16_sameRegs(AOP(left),AOP(result)); - int i; - DEBUGpic16_emitcode ("; ***","%s %d offl:%d size:%d",__FUNCTION__,__LINE__,offl,size); + int size = AOP_SIZE (result); + int same = pic16_sameRegs (AOP (left), AOP (result)); + int i; + DEBUGpic16_emitcode ("; ***", "%s %d offl:%d size:%d", __FUNCTION__, __LINE__, offl, size); - if (same && (offl == MSB16)) { //shift one byte right - for(i=MSB16;i= 24 ) { - shCount -= 24; - if(shCount) - shiftR1Left2Result(left, MSB32, result, LSB, shCount, sign); - else - movLeft2Result(left, MSB32, result, LSB); + if (shCount >= 24) + { + shCount -= 24; + if (shCount) + shiftR1Left2Result (left, MSB32, result, LSB, shCount, sign); + else + movLeft2Result (left, MSB32, result, LSB); - pic16_addSign(result, MSB16, sign); - } - else if(shCount >= 16){ - shCount -= 16; - if(shCount) - shiftR2Left2Result(left, MSB24, result, LSB, shCount, sign); - else{ - movLeft2Result(left, MSB24, result, LSB); - movLeft2Result(left, MSB32, result, MSB16); + pic16_addSign (result, MSB16, sign); } - pic16_addSign(result, MSB24, sign); - } - else if(shCount >= 8){ - shCount -= 8; - if(shCount == 1) - shiftRLong(left, MSB16, result, sign); - else if(shCount == 0){ - movLeft2Result(left, MSB16, result, LSB); - movLeft2Result(left, MSB24, result, MSB16); - movLeft2Result(left, MSB32, result, MSB24); - pic16_addSign(result, MSB32, sign); - } - else{ //shcount >= 2 - shiftR2Left2Result(left, MSB16, result, LSB, shCount, 0); - shiftLLeftOrResult(left, MSB32, result, MSB16, 8 - shCount); - /* the last shift is signed */ - shiftR1Left2Result(left, MSB32, result, MSB24, shCount, sign); - pic16_addSign(result, MSB32, sign); + else if (shCount >= 16) + { + shCount -= 16; + if (shCount) + shiftR2Left2Result (left, MSB24, result, LSB, shCount, sign); + else + { + movLeft2Result (left, MSB24, result, LSB); + movLeft2Result (left, MSB32, result, MSB16); + } + pic16_addSign (result, MSB24, sign); } - } - else{ /* 1 <= shCount <= 7 */ - if(shCount <= 2){ - shiftRLong(left, LSB, result, sign); - if(shCount == 2) - shiftRLong(result, LSB, result, sign); - } - else{ - shiftR2Left2Result(left, LSB, result, LSB, shCount, 0); - shiftLLeftOrResult(left, MSB24, result, MSB16, 8 - shCount); - shiftR2Left2Result(left, MSB24, result, MSB24, shCount, sign); + else if (shCount >= 8) + { + shCount -= 8; + if (shCount == 1) + shiftRLong (left, MSB16, result, sign); + else if (shCount == 0) + { + movLeft2Result (left, MSB16, result, LSB); + movLeft2Result (left, MSB24, result, MSB16); + movLeft2Result (left, MSB32, result, MSB24); + pic16_addSign (result, MSB32, sign); + } + else //shcount >= 2 + { + shiftR2Left2Result (left, MSB16, result, LSB, shCount, 0); + shiftLLeftOrResult (left, MSB32, result, MSB16, 8 - shCount); + /* the last shift is signed */ + shiftR1Left2Result (left, MSB32, result, MSB24, shCount, sign); + pic16_addSign (result, MSB32, sign); + } + } + else /* 1 <= shCount <= 7 */ + { + if (shCount <= 2) + { + shiftRLong (left, LSB, result, sign); + if (shCount == 2) + shiftRLong (result, LSB, result, sign); + } + else + { + shiftR2Left2Result (left, LSB, result, LSB, shCount, 0); + shiftLLeftOrResult (left, MSB24, result, MSB16, 8 - shCount); + shiftR2Left2Result (left, MSB24, result, MSB24, shCount, sign); + } } - } } /*-----------------------------------------------------------------*/ /* genRightShiftLiteral - right shifting by known count */ /*-----------------------------------------------------------------*/ -static void genRightShiftLiteral (operand *left, - operand *right, - operand *result, - iCode *ic, - int sign) +static void +genRightShiftLiteral (operand * left, operand * right, operand * result, iCode * ic, int sign) { - int shCount = abs((int) ulFromVal (AOP(right)->aopu.aop_lit)); - int lsize,res_size; + int shCount = abs ((int) ulFromVal (AOP (right)->aopu.aop_lit)); + int lsize, res_size; - pic16_freeAsmop(right,NULL,ic,TRUE); + pic16_freeAsmop (right, NULL, ic, TRUE); - pic16_aopOp(left,ic,FALSE); - pic16_aopOp(result,ic,TRUE); + pic16_aopOp (left, ic, FALSE); + pic16_aopOp (result, ic, TRUE); - DEBUGpic16_emitcode ("; ***","%s %d shCount:%d result:%d left:%d",__FUNCTION__,__LINE__,shCount,AOP_SIZE(result),AOP_SIZE(left)); + DEBUGpic16_emitcode ("; ***", "%s %d shCount:%d result:%d left:%d", __FUNCTION__, __LINE__, shCount, AOP_SIZE (result), + AOP_SIZE (left)); #if VIEW_SIZE - pic16_emitcode("; shift right ","result %d, left %d",AOP_SIZE(result), - AOP_SIZE(left)); + pic16_emitcode ("; shift right ", "result %d, left %d", AOP_SIZE (result), AOP_SIZE (left)); #endif - lsize = pic16_getDataSize(left); - res_size = pic16_getDataSize(result); + lsize = pic16_getDataSize (left); + res_size = pic16_getDataSize (result); /* test the LEFT size !!! */ /* I suppose that the left size >= result size */ - if (shCount == 0) { - assert (res_size <= lsize); - while (res_size--) { - pic16_mov2f (AOP(result), AOP(left), res_size); - } // for - } else if (shCount >= (lsize * 8)) { - if (sign) { - /* - * Do NOT use - * CLRF result - * BTFSC left, 7 - * SETF result - * even for 8-bit operands; result might be an SFR. - */ - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(0x00)); - pic16_emitpcode(POC_BTFSC, pic16_popCopyGPR2Bit(pic16_popGet(AOP(left), lsize-1), 7)); - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(0xff)); - while (res_size--) { - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), res_size)); - } - } else { // unsigned - while (res_size--) { - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result), res_size)); - } + if (shCount == 0) + { + assert (res_size <= lsize); + while (res_size--) + { + pic16_mov2f (AOP (result), AOP (left), res_size); + } // for } - } else { // 0 < shCount < 8*lsize - switch (res_size) { - case 1: - genrshOne (result,left,shCount,sign); - break; + else if (shCount >= (lsize * 8)) + { + if (sign) + { + /* + * Do NOT use + * CLRF result + * BTFSC left, 7 + * SETF result + * even for 8-bit operands; result might be an SFR. + */ + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (0x00)); + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (pic16_popGet (AOP (left), lsize - 1), 7)); + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (0xff)); + while (res_size--) + { + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), res_size)); + } + } + else // unsigned + { + while (res_size--) + { + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), res_size)); + } + } + } + else // 0 < shCount < 8*lsize + { + switch (res_size) + { + case 1: + genrshOne (result, left, shCount, sign); + break; - case 2: - genrshTwo (result,left,shCount,sign); - break; + case 2: + genrshTwo (result, left, shCount, sign); + break; - case 4: - genrshFour (result,left,shCount,sign); - break; - default : - break; + case 4: + genrshFour (result, left, shCount, sign); + break; + default: + break; + } } - } - pic16_freeAsmop(left,NULL,ic,TRUE); - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (left, NULL, ic, TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genGenericShift - generates code for left or right shifting */ /*-----------------------------------------------------------------*/ -static void genGenericShift (iCode *ic, int isShiftLeft) +static void +genGenericShift (iCode * ic, int isShiftLeft) { - operand *left,*right, *result; + operand *left, *right, *result; int offset; int sign, signedCount; symbol *label_complete, *label_loop_pos, *label_loop_neg, *label_negative; @@ -7743,32 +8740,37 @@ FENTRY; - right = IC_RIGHT(ic); - left = IC_LEFT(ic); - result = IC_RESULT(ic); - - pic16_aopOp(right,ic,FALSE); - pic16_aopOp(left,ic,FALSE); - pic16_aopOp(result,ic,TRUE); + right = IC_RIGHT (ic); + left = IC_LEFT (ic); + result = IC_RESULT (ic); + + pic16_aopOp (right, ic, FALSE); + pic16_aopOp (left, ic, FALSE); + pic16_aopOp (result, ic, TRUE); - sign = !SPEC_USIGN(operandType (left)); - signedCount = !SPEC_USIGN(operandType (right)); + sign = !SPEC_USIGN (operandType (left)); + signedCount = !SPEC_USIGN (operandType (right)); /* if the shift count is known then do it as efficiently as possible */ - if (AOP_TYPE(right) == AOP_LIT) { - long lit = (long) ulFromVal (AOP(right)->aopu.aop_lit); - if (signedCount && lit < 0) { lit = -lit; isShiftLeft = !isShiftLeft; } - // we should modify right->aopu.aop_lit here! - // Instead we use abs(shCount) in genXXXShiftLiteral()... - // lit > 8*size is handled in pic16_genXXXShiftLiteral() - if (isShiftLeft) - pic16_genLeftShiftLiteral (left,right,result,ic); - else - genRightShiftLiteral (left,right,result,ic, sign); + if (AOP_TYPE (right) == AOP_LIT) + { + long lit = (long) ulFromVal (AOP (right)->aopu.aop_lit); + if (signedCount && lit < 0) + { + lit = -lit; + isShiftLeft = !isShiftLeft; + } + // we should modify right->aopu.aop_lit here! + // Instead we use abs(shCount) in genXXXShiftLiteral()... + // lit > 8*size is handled in pic16_genXXXShiftLiteral() + if (isShiftLeft) + pic16_genLeftShiftLiteral (left, right, result, ic); + else + genRightShiftLiteral (left, right, result, ic, sign); - goto release; - } // if (right is literal) + goto release; + } // if (right is literal) /* shift count is unknown then we have to form a loop. * Note: we take only the lower order byte since shifting @@ -7778,18 +8780,19 @@ * signed and we do an (effective) right shift, i. e. we * shift in the sign bit from the left. */ - label_complete = newiTempLabel ( NULL ); - label_loop_pos = newiTempLabel ( NULL ); + label_complete = newiTempLabel (NULL); + label_loop_pos = newiTempLabel (NULL); label_loop_neg = NULL; label_negative = NULL; pos_shift = isShiftLeft ? POC_RLCF : POC_RRCF; neg_shift = isShiftLeft ? POC_RRCF : POC_RLCF; - if (signedCount) { - // additional labels needed - label_loop_neg = newiTempLabel ( NULL ); - label_negative = newiTempLabel ( NULL ); - } // if + if (signedCount) + { + // additional labels needed + label_loop_neg = newiTempLabel (NULL); + label_negative = newiTempLabel (NULL); + } // if /* * The code below overwrites the shift count for `val = (1 << val)' @@ -7797,46 +8800,58 @@ * XXX: This problem should have been/is also addressed in ralloc.c, * but the code there seems not to catch this case ... */ - if (pic16_sameRegs (AOP(right), AOP(result))) { - // We abuse FSR0L as a temporary, pic16_popGetTempReg() is too costly. - pic16_mov2w (AOP(right), 0); - pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_fsr0l)); - } // if + if (pic16_sameRegs (AOP (right), AOP (result))) + { + // We abuse FSR0L as a temporary, pic16_popGetTempReg() is too costly. + pic16_mov2w (AOP (right), 0); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_fsr0l)); + } // if // copy source to result -- this will effectively truncate the left operand to the size of result! // (e.g. char c = 0x100 << -3 will become c = 0x00 >> 3 == 0x00 instad of 0x20) // This is fine, as it only occurs for left shifting with negative count which is not standardized! - for (offset=0; offset < min(AOP_SIZE(left), AOP_SIZE(result)); offset++) { - pic16_mov2f (AOP(result),AOP(left), offset); - } // for + for (offset = 0; offset < min (AOP_SIZE (left), AOP_SIZE (result)); offset++) + { + pic16_mov2f (AOP (result), AOP (left), offset); + } // for // if result is longer than left, fill with zeros (or sign) - if (AOP_SIZE(left) < AOP_SIZE(result)) { - if (sign && AOP_SIZE(left) > 0) { - // shift signed operand -- fill with sign - pic16_emitpcode (POC_CLRF, pic16_popCopyReg (&pic16_pc_wreg)); - pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit(pic16_popGet(AOP(result), AOP_SIZE(left)-1), 7)); - pic16_emitpcode (POC_MOVLW, pic16_popGetLit (0xFF)); - for (offset=AOP_SIZE(left); offset < AOP_SIZE(result); offset++) { - pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP(result), offset)); - } // for - } else { - // shift unsigned operand -- fill result with zeros - for (offset=AOP_SIZE(left); offset < AOP_SIZE(result); offset++) { - pic16_emitpcode (POC_CLRF, pic16_popGet (AOP(result), offset)); - } // for - } - } // if (size mismatch) + if (AOP_SIZE (left) < AOP_SIZE (result)) + { + if (sign && AOP_SIZE (left) > 0) + { + // shift signed operand -- fill with sign + pic16_emitpcode (POC_CLRF, pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (pic16_popGet (AOP (result), AOP_SIZE (left) - 1), 7)); + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (0xFF)); + for (offset = AOP_SIZE (left); offset < AOP_SIZE (result); offset++) + { + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + } // for + } + else + { + // shift unsigned operand -- fill result with zeros + for (offset = AOP_SIZE (left); offset < AOP_SIZE (result); offset++) + { + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offset)); + } // for + } + } // if (size mismatch) /* load/restore shift count */ - if (pic16_sameRegs (AOP(right), AOP(result))) { - pic16_emitpcode (POC_MOVFW, pic16_popCopyReg (&pic16_pc_fsr0l)); - } else { - pic16_mov2w (AOP(right), 0); - } // if + if (pic16_sameRegs (AOP (right), AOP (result))) + { + pic16_emitpcode (POC_MOVFW, pic16_popCopyReg (&pic16_pc_fsr0l)); + } + else + { + pic16_mov2w (AOP (right), 0); + } // if pic16_emitpcode (POC_BZ, pic16_popGetLabel (label_complete->key)); - if (signedCount) pic16_emitpcode (POC_BN, pic16_popGetLabel (label_negative->key)); + if (signedCount) + pic16_emitpcode (POC_BN, pic16_popGetLabel (label_negative->key)); #if 0 // perform a shift by one (shift count is positive) @@ -7844,11 +8859,12 @@ // 2n+[2,3]+({1,3}+n+3)c-2+[0,2]=({4,6}+n)c+2n+[0,3] ({5,7}c+[2,5] / {6,8}c+[4, 7] / {8,10}c+[ 8,11]) pic16_emitpLabel (label_loop_pos->key); emitCLRC; - if (sign && (pos_shift == POC_RRCF)) { - pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit(pic16_popGet(AOP(result), AOP_SIZE(result)-1), 7)); - emitSETC; - } // if - genMultiAsm (pos_shift, result, AOP_SIZE(result), pos_shift == POC_RRCF); + if (sign && (pos_shift == POC_RRCF)) + { + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (pic16_popGet (AOP (result), AOP_SIZE (result) - 1), 7)); + emitSETC; + } // if + genMultiAsm (pos_shift, result, AOP_SIZE (result), pos_shift == POC_RRCF); pic16_emitpcode (POC_DECFSZ, pic16_popCopyReg (&pic16_pc_wreg)); pic16_emitpcode (POC_BRA, pic16_popGetLabel (label_loop_pos->key)); #else @@ -7859,73 +8875,87 @@ pic16_emitpcode (POC_NEGF, pic16_popCopyReg (&pic16_pc_wreg)); emitCLRC; pic16_emitpLabel (label_loop_pos->key); - if (sign && (pos_shift == POC_RRCF)) { - pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit(pic16_popGet(AOP(result), AOP_SIZE(result)-1), 7)); - emitSETC; - } // if - genMultiAsm (pos_shift, result, AOP_SIZE(result), pos_shift == POC_RRCF); + if (sign && (pos_shift == POC_RRCF)) + { + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (pic16_popGet (AOP (result), AOP_SIZE (result) - 1), 7)); + emitSETC; + } // if + genMultiAsm (pos_shift, result, AOP_SIZE (result), pos_shift == POC_RRCF); //pic16_emitpcode (POC_INCF, pic16_popCopyReg (&pic16_pc_wreg)); // gpsim does not like this... pic16_emitpcode (POC_ADDLW, pic16_popGetLit (0x01)); pic16_emitpcode (POC_BNC, pic16_popGetLabel (label_loop_pos->key)); #endif - if (signedCount) { - pic16_emitpcode (POC_BRA, pic16_popGetLabel (label_complete->key)); + if (signedCount) + { + pic16_emitpcode (POC_BRA, pic16_popGetLabel (label_complete->key)); - pic16_emitpLabel (label_negative->key); - // perform a shift by -1 (shift count is negative) - // 2n+4+1+({0,2}+n+3)*c-1=({3,5}+n)c+2n+4 ({4,6}c+6 / {5,7}c+8 / {7,9}c+12) - emitCLRC; - pic16_emitpLabel (label_loop_neg->key); - if (sign && (neg_shift == POC_RRCF)) { - pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit(pic16_popGet(AOP(result), AOP_SIZE(result)-1), 7)); - emitSETC; - } // if - genMultiAsm (neg_shift, result, AOP_SIZE(result), neg_shift == POC_RRCF); - //pic16_emitpcode (POC_INCF, pic16_popCopyReg (&pic16_pc_wreg)); // gpsim does not like this... - pic16_emitpcode (POC_ADDLW, pic16_popGetLit (0x01)); - pic16_emitpcode (POC_BNC, pic16_popGetLabel (label_loop_neg->key)); - } // if (signedCount) + pic16_emitpLabel (label_negative->key); + // perform a shift by -1 (shift count is negative) + // 2n+4+1+({0,2}+n+3)*c-1=({3,5}+n)c+2n+4 ({4,6}c+6 / {5,7}c+8 / {7,9}c+12) + emitCLRC; + pic16_emitpLabel (label_loop_neg->key); + if (sign && (neg_shift == POC_RRCF)) + { + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (pic16_popGet (AOP (result), AOP_SIZE (result) - 1), 7)); + emitSETC; + } // if + genMultiAsm (neg_shift, result, AOP_SIZE (result), neg_shift == POC_RRCF); + //pic16_emitpcode (POC_INCF, pic16_popCopyReg (&pic16_pc_wreg)); // gpsim does not like this... + pic16_emitpcode (POC_ADDLW, pic16_popGetLit (0x01)); + pic16_emitpcode (POC_BNC, pic16_popGetLabel (label_loop_neg->key)); + } // if (signedCount) pic16_emitpLabel (label_complete->key); release: - pic16_freeAsmop (right,NULL,ic,TRUE); - pic16_freeAsmop(left,NULL,ic,TRUE); - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (right, NULL, ic, TRUE); + pic16_freeAsmop (left, NULL, ic, TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); } -static void genLeftShift (iCode *ic) { +static void +genLeftShift (iCode * ic) +{ genGenericShift (ic, 1); } -static void genRightShift (iCode *ic) { +static void +genRightShift (iCode * ic) +{ genGenericShift (ic, 0); } /* load FSR0 with address of/from op according to pic16_isLitOp() or if lit is 1 */ -void pic16_loadFSR0(operand *op, int lit) +void +pic16_loadFSR0 (operand * op, int lit) { - if((IS_SYMOP(op) && OP_SYMBOL(op)->remat) || pic16_isLitOp( op )) { - if (AOP_TYPE(op) == AOP_LIT) { - /* handle 12 bit integers correctly */ - unsigned int val = (unsigned int) ulFromVal (AOP(op)->aopu.aop_lit); - if ((val & 0x0fff) != val) { - fprintf (stderr, "WARNING: Accessing memory at 0x%x truncated to 0x%x.\n", - val, (val & 0x0fff) ); - val &= 0x0fff; - } - pic16_emitpcode(POC_LFSR, pic16_popGetLit2(0, pic16_popGetLit12(val))); - } else { - pic16_emitpcode(POC_LFSR, pic16_popGetLit2(0, pic16_popGet(AOP(op), 0))); - } - } else { - assert (!IS_SYMOP(op) || !OP_SYMBOL(op)->remat); - // set up FSR0 with address of result - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popGet(AOP(op),0), pic16_popCopyReg(&pic16_pc_fsr0l))); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popGet(AOP(op),1), pic16_popCopyReg(&pic16_pc_fsr0h))); - } + if ((IS_SYMOP (op) && OP_SYMBOL (op)->remat) || pic16_isLitOp (op)) + { + if (AOP_TYPE (op) == AOP_LIT) + { + /* handle 12 bit integers correctly */ + unsigned int val = (unsigned int) ulFromVal (AOP (op)->aopu.aop_lit); + if ((val & 0x0fff) != val) + { + fprintf (stderr, "WARNING: Accessing memory at 0x%x truncated to 0x%x.\n", val, (val & 0x0fff)); + val &= 0x0fff; + } + pic16_emitpcode (POC_LFSR, pic16_popGetLit2 (0, pic16_popGetLit12 (val))); + } + else + { + pic16_emitpcode (POC_LFSR, pic16_popGetLit2 (0, pic16_popGet (AOP (op), 0))); + } + } + else + { + assert (!IS_SYMOP (op) || !OP_SYMBOL (op)->remat); + // set up FSR0 with address of result + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popGet (AOP (op), 0), pic16_popCopyReg (&pic16_pc_fsr0l))); + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popGet (AOP (op), 1), pic16_popCopyReg (&pic16_pc_fsr0h))); + } } /*----------------------------------------------------------------*/ @@ -7933,75 +8963,86 @@ /* to WREG (doWrite == 0) or one byte from WREG */ /* to the location ptr points to (doWrite != 0) */ /*----------------------------------------------------------------*/ -static void pic16_derefPtr (operand *ptr, int p_type, int doWrite, int *fsr0_setup) +static void +pic16_derefPtr (operand * ptr, int p_type, int doWrite, int *fsr0_setup) { - if (!IS_PTR(operandType(ptr))) - { - if (doWrite) pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP(ptr), 0)); - else pic16_mov2w (AOP(ptr), 0); - return; - } + if (!IS_PTR (operandType (ptr))) + { + if (doWrite) + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (ptr), 0)); + else + pic16_mov2w (AOP (ptr), 0); + return; + } //assert (IS_DECL(operandType(ptr)) && (p_type == DCL_TYPE(operandType(ptr)))); /* We might determine pointer type right here: */ - p_type = DCL_TYPE(operandType(ptr)); + p_type = DCL_TYPE (operandType (ptr)); - switch (p_type) { + switch (p_type) + { case POINTER: case FPOINTER: case IPOINTER: case PPOINTER: if (!fsr0_setup || !*fsr0_setup) - { - pic16_loadFSR0( ptr, 0 ); - if (fsr0_setup) *fsr0_setup = 1; - } + { + pic16_loadFSR0 (ptr, 0); + if (fsr0_setup) + *fsr0_setup = 1; + } if (doWrite) - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_indf0)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_indf0)); else - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(&pic16_pc_indf0)); + pic16_emitpcode (POC_MOVFW, pic16_popCopyReg (&pic16_pc_indf0)); break; case GPOINTER: - if (AOP(ptr)->aopu.aop_reg[2]) { - if (doWrite) pic16_emitpcode (POC_MOVWF, pic16_popCopyReg(pic16_stack_postdec)); - // prepare call to __gptrget1, this is actually genGenPointerGet(result, WREG, ?ic?) - mov2fp(pic16_popCopyReg(&pic16_pc_fsr0l), AOP(ptr), 0); - mov2fp(pic16_popCopyReg(&pic16_pc_prodl), AOP(ptr), 1); - pic16_mov2w(AOP(ptr), 2); - pic16_callGenericPointerRW(doWrite, 1); - } else { - // data pointer (just 2 byte given) - if (!fsr0_setup || !*fsr0_setup) - { - pic16_loadFSR0( ptr, 0 ); - if (fsr0_setup) *fsr0_setup = 1; - } - if (doWrite) - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_indf0)); - else - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(&pic16_pc_indf0)); - } + if (AOP (ptr)->aopu.aop_reg[2]) + { + if (doWrite) + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (pic16_stack_postdec)); + // prepare call to __gptrget1, this is actually genGenPointerGet(result, WREG, ?ic?) + mov2fp (pic16_popCopyReg (&pic16_pc_fsr0l), AOP (ptr), 0); + mov2fp (pic16_popCopyReg (&pic16_pc_prodl), AOP (ptr), 1); + pic16_mov2w (AOP (ptr), 2); + pic16_callGenericPointerRW (doWrite, 1); + } + else + { + // data pointer (just 2 byte given) + if (!fsr0_setup || !*fsr0_setup) + { + pic16_loadFSR0 (ptr, 0); + if (fsr0_setup) + *fsr0_setup = 1; + } + if (doWrite) + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_indf0)); + else + pic16_emitpcode (POC_MOVFW, pic16_popCopyReg (&pic16_pc_indf0)); + } break; case CPOINTER: /* XXX: Writing to CPOINTERs not (yet) implemented. */ - assert ( !doWrite && "Cannot write into __code space!" ); - if( (AOP_TYPE(ptr) == AOP_PCODE) - && ((AOP(ptr)->aopu.pcop->type == PO_IMMEDIATE) - || (AOP(ptr)->aopu.pcop->type == PO_DIR))) - { - pic16_emitpcode(POC_MOVLW, pic16_popGet (AOP (ptr), 0)); - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg (&pic16_pc_tblptrl)); - pic16_emitpcode(POC_MOVLW, pic16_popGet (AOP (ptr), 1)); - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg (&pic16_pc_tblptrh)); - pic16_emitpcode(POC_MOVLW, pic16_popGet (AOP (ptr), 2)); - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg (&pic16_pc_tblptru)); - } else { - mov2fp(pic16_popCopyReg(&pic16_pc_tblptrl), AOP(ptr), 0); - mov2fp(pic16_popCopyReg(&pic16_pc_tblptrh), AOP(ptr), 1); - mov2fp(pic16_popCopyReg(&pic16_pc_tblptru), AOP(ptr), 2); - } // if + assert (!doWrite && "Cannot write into __code space!"); + if ((AOP_TYPE (ptr) == AOP_PCODE) + && ((AOP (ptr)->aopu.pcop->type == PO_IMMEDIATE) || (AOP (ptr)->aopu.pcop->type == PO_DIR))) + { + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (ptr), 0)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_tblptrl)); + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (ptr), 1)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_tblptrh)); + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (ptr), 2)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_tblptru)); + } + else + { + mov2fp (pic16_popCopyReg (&pic16_pc_tblptrl), AOP (ptr), 0); + mov2fp (pic16_popCopyReg (&pic16_pc_tblptrh), AOP (ptr), 1); + mov2fp (pic16_popCopyReg (&pic16_pc_tblptru), AOP (ptr), 2); + } // if pic16_emitpcodeNULLop (POC_TBLRD_POSTINC); pic16_emitpcode (POC_MOVFW, pic16_popCopyReg (&pic16_pc_tablat)); @@ -8010,165 +9051,173 @@ default: assert (0 && "invalid pointer type specified"); break; - } + } } /*-----------------------------------------------------------------*/ /* genUnpackBits - generates code for unpacking bits */ /*-----------------------------------------------------------------*/ -static void genUnpackBits (operand *result, operand *left, char *rname, int ptype) +static void +genUnpackBits (operand * result, operand * left, char *rname, int ptype) { - int shCnt ; - sym_link *etype, *letype; - int blen=0, bstr=0; - int lbstr; + int shCnt; + sym_link *etype; + int blen = 0, bstr = 0; int same; pCodeOp *op; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - etype = getSpec(operandType(result)); - letype = getSpec(operandType(left)); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + etype = getSpec (operandType (result)); // if(IS_BITFIELD(etype)) { - blen = SPEC_BLEN(etype); - bstr = SPEC_BSTR(etype); + blen = SPEC_BLEN (etype); + bstr = SPEC_BSTR (etype); // } - lbstr = SPEC_BSTR( letype ); - - DEBUGpic16_emitcode ("; ***","%s %d - reading %s bitfield int %s destination",__FUNCTION__,__LINE__, - SPEC_USIGN(OP_SYM_ETYPE(left)) ? "an unsigned" : "a signed", SPEC_USIGN(OP_SYM_TYPE(result)) ? "an unsigned" : "a signed"); + DEBUGpic16_emitcode ("; ***", "%s %d - reading %s bitfield int %s destination", __FUNCTION__, __LINE__, + SPEC_USIGN (OP_SYM_ETYPE (left)) ? "an unsigned" : "a signed", + SPEC_USIGN (OP_SYM_TYPE (result)) ? "an unsigned" : "a signed"); #if 1 - if((blen == 1) && (bstr < 8) - && (!IS_PTR(operandType(left)) || IS_DIRECT(left) || PIC_IS_DATA_PTR(operandType(left)))) { - /* it is a single bit, so use the appropriate bit instructions */ - DEBUGpic16_emitcode (";","%s %d optimize bit read",__FUNCTION__,__LINE__); - - same = pic16_sameRegs(AOP(left),AOP(result)); - op = (same ? pic16_popCopyReg(&pic16_pc_wreg) : pic16_popGet (AOP(result),0)); - pic16_emitpcode(POC_CLRF, op); - - if(!IS_PTR(operandType(left)) || IS_DIRECT(left)) { - /* workaround to reduce the extra lfsr instruction */ - pic16_emitpcode(POC_BTFSC, - pic16_popCopyGPR2Bit(pic16_popGet(AOP(left), 0), bstr)); - } else { - assert (PIC_IS_DATA_PTR (operandType(left))); - pic16_loadFSR0 (left, 0); - pic16_emitpcode(POC_BTFSC, - pic16_popCopyGPR2Bit(pic16_popCopyReg(&pic16_pc_indf0), bstr)); - } + if ((blen == 1) && (bstr < 8) && (!IS_PTR (operandType (left)) || IS_DIRECT (left) || PIC_IS_DATA_PTR (operandType (left)))) + { + /* it is a single bit, so use the appropriate bit instructions */ + DEBUGpic16_emitcode (";", "%s %d optimize bit read", __FUNCTION__, __LINE__); - if (SPEC_USIGN(OP_SYM_ETYPE(left))) { - /* unsigned bitfields result in either 0 or 1 */ - pic16_emitpcode(POC_INCF, op); - } else { - /* signed bitfields result in either 0 or -1 */ - pic16_emitpcode(POC_DECF, op); - } - if (same) { - pic16_emitpcode(POC_MOVWF, pic16_popGet( AOP(result), 0 )); - } + same = pic16_sameRegs (AOP (left), AOP (result)); + op = (same ? pic16_popCopyReg (&pic16_pc_wreg) : pic16_popGet (AOP (result), 0)); + pic16_emitpcode (POC_CLRF, op); - pic16_addSign (result, 1, !SPEC_USIGN(OP_SYM_TYPE(result))); - return; - } + if (!IS_PTR (operandType (left)) || IS_DIRECT (left)) + { + /* workaround to reduce the extra lfsr instruction */ + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (pic16_popGet (AOP (left), 0), bstr)); + } + else + { + assert (PIC_IS_DATA_PTR (operandType (left))); + pic16_loadFSR0 (left, 0); + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (pic16_popCopyReg (&pic16_pc_indf0), bstr)); + } + + if (SPEC_USIGN (OP_SYM_ETYPE (left))) + { + /* unsigned bitfields result in either 0 or 1 */ + pic16_emitpcode (POC_INCF, op); + } + else + { + /* signed bitfields result in either 0 or -1 */ + pic16_emitpcode (POC_DECF, op); + } + if (same) + { + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); + } + + pic16_addSign (result, 1, !SPEC_USIGN (OP_SYM_TYPE (result))); + return; + } #endif - if (!IS_PTR(operandType(left)) || IS_DIRECT(left)) { - // access symbol directly - pic16_mov2w (AOP(left), 0); - } else { - pic16_derefPtr (left, ptype, 0, NULL); - } + if (!IS_PTR (operandType (left)) || IS_DIRECT (left)) + { + // access symbol directly + pic16_mov2w (AOP (left), 0); + } + else + { + pic16_derefPtr (left, ptype, 0, NULL); + } /* if we have bitdisplacement then it fits */ /* into this byte completely or if length is */ /* less than a byte */ - if ((shCnt = SPEC_BSTR(etype)) || (SPEC_BLEN(etype) <= 8)) { - - /* shift right acc */ - AccRsh(shCnt, 0); + if ((shCnt = SPEC_BSTR (etype)) || (SPEC_BLEN (etype) <= 8)) + { - pic16_emitpcode(POC_ANDLW, pic16_popGetLit( - (((unsigned char) -1)>>(8 - SPEC_BLEN(etype))) & SRMask[ shCnt ])); + /* shift right acc */ + AccRsh (shCnt, 0); - /* VR -- normally I would use the following, but since we use the hack, - * to avoid the masking from AccRsh, why not mask it right now? */ + pic16_emitpcode (POC_ANDLW, pic16_popGetLit ((((unsigned char) - 1) >> (8 - SPEC_BLEN (etype))) & SRMask[shCnt])); - /* - pic16_emitpcode(POC_ANDLW, pic16_popGetLit(((unsigned char) -1)>>(8 - SPEC_BLEN(etype)))); - */ + /* VR -- normally I would use the following, but since we use the hack, + * to avoid the masking from AccRsh, why not mask it right now? */ - /* extend signed bitfields to 8 bits */ - if (!SPEC_USIGN(OP_SYM_ETYPE(left)) && (bstr + blen < 8)) - { - assert (blen + bstr > 0); - pic16_emitpcode(POC_BTFSC, pic16_popCopyGPR2Bit(pic16_popCopyReg(&pic16_pc_wreg), bstr + blen - 1)); - pic16_emitpcode(POC_IORLW, pic16_popGetLit(0xFF << (bstr + blen))); - } + /* + pic16_emitpcode(POC_ANDLW, pic16_popGetLit(((unsigned char) -1)>>(8 - SPEC_BLEN(etype)))); + */ - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 0)); + /* extend signed bitfields to 8 bits */ + if (!SPEC_USIGN (OP_SYM_ETYPE (left)) && (bstr + blen < 8)) + { + assert (blen + bstr > 0); + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (pic16_popCopyReg (&pic16_pc_wreg), bstr + blen - 1)); + pic16_emitpcode (POC_IORLW, pic16_popGetLit (0xFF << (bstr + blen))); + } - pic16_addSign (result, 1, !SPEC_USIGN(OP_SYM_TYPE(result))); - return ; - } + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); - fprintf(stderr, "SDCC pic16 port error: the port currently does not support *reading*\n"); - fprintf(stderr, "bitfields of size >=8. Instead of generating wrong code, bailing out...\n"); - exit(EXIT_FAILURE); + pic16_addSign (result, 1, !SPEC_USIGN (OP_SYM_TYPE (result))); + return; + } - return ; + fprintf (stderr, "SDCC pic16 port error: the port currently does not support *reading*\n"); + fprintf (stderr, "bitfields of size >=8. Instead of generating wrong code, bailing out...\n"); + exit (EXIT_FAILURE); } -static void genDataPointerGet(operand *left, operand *result, iCode *ic) +static void +genDataPointerGet (operand * left, operand * result, iCode * ic) { - int size, offset = 0, leoffset=0 ; + int size, offset = 0, leoffset = 0; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - pic16_aopOp(result, ic, TRUE); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + pic16_aopOp (result, ic, TRUE); - FENTRY; + FENTRY; - size = AOP_SIZE(result); + size = AOP_SIZE (result); // fprintf(stderr, "%s:%d size= %d\n", __FILE__, __LINE__, size); #if 1 - if(!strcmp(pic16_aopGet(AOP(result), 0, TRUE, FALSE), - pic16_aopGet(AOP(left), 0, TRUE, FALSE))) { - DEBUGpic16_emitcode("; ***", "left and result names are same, skipping moving"); - goto release; - } + if (!strcmp (pic16_aopGet (AOP (result), 0, TRUE, FALSE), pic16_aopGet (AOP (left), 0, TRUE, FALSE))) + { + DEBUGpic16_emitcode ("; ***", "left and result names are same, skipping moving"); + goto release; + } #endif - if(AOP(left)->aopu.pcop->type == PO_DIR) - leoffset=PCOR(AOP(left)->aopu.pcop)->instance; + if (AOP (left)->aopu.pcop->type == PO_DIR) + leoffset = PCOR (AOP (left)->aopu.pcop)->instance; - DEBUGpic16_pic16_AopType(__LINE__,left,NULL,result); + DEBUGpic16_pic16_AopType (__LINE__, left, NULL, result); - while (size--) { - DEBUGpic16_emitcode("; ***", "%s loop offset=%d leoffset=%d", __FUNCTION__, offset, leoffset); + while (size--) + { + DEBUGpic16_emitcode ("; ***", "%s loop offset=%d leoffset=%d", __FUNCTION__, offset, leoffset); // pic16_DumpOp("(result)",result); - if(pic16_isLitAop(AOP(result))) { - pic16_mov2w(AOP(left), offset); // patch 8 - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offset)); - } else { - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popGet(AOP(left), offset), //patch 8 - pic16_popGet(AOP(result), offset))); - } - - offset++; - leoffset++; + if (pic16_isLitAop (AOP (result))) + { + pic16_mov2w (AOP (left), offset); // patch 8 + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + } + else + { + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popGet (AOP (left), offset), //patch 8 + pic16_popGet (AOP (result), offset))); } + offset++; + leoffset++; + } + release: - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); } @@ -8176,127 +9225,127 @@ /*-----------------------------------------------------------------*/ /* genNearPointerGet - pic16_emitcode for near pointer fetch */ /*-----------------------------------------------------------------*/ -static void genNearPointerGet (operand *left, - operand *result, - iCode *ic) +static void +genNearPointerGet (operand * left, operand * result, iCode * ic) { // asmop *aop = NULL; //regs *preg = NULL ; sym_link *rtype, *retype; sym_link *ltype, *letype; - FENTRY; + FENTRY; - rtype = operandType(result); - retype= getSpec(rtype); - ltype = operandType(left); - letype= getSpec(ltype); + rtype = operandType (result); + retype = getSpec (rtype); + ltype = operandType (left); + letype = getSpec (ltype); - pic16_aopOp(left,ic,FALSE); + pic16_aopOp (left, ic, FALSE); // pic16_DumpOp("(left)",left); // pic16_DumpOp("(result)",result); - /* if left is rematerialisable and - * result is not bit variable type and - * the left is pointer to data space i.e - * lower 128 bytes of space */ + /* if left is rematerialisable and + * result is not bit variable type and + * the left is pointer to data space i.e + * lower 128 bytes of space */ - if (AOP_TYPE(left) == AOP_PCODE - && !IS_BITFIELD(retype) - && DCL_TYPE(ltype) == POINTER) { + if (AOP_TYPE (left) == AOP_PCODE && !IS_BITFIELD (retype) && DCL_TYPE (ltype) == POINTER) + { - genDataPointerGet (left,result,ic); - pic16_freeAsmop(left, NULL, ic, TRUE); - return ; + genDataPointerGet (left, result, ic); + pic16_freeAsmop (left, NULL, ic, TRUE); + return; } - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - pic16_aopOp (result,ic,TRUE); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + pic16_aopOp (result, ic, TRUE); - DEBUGpic16_pic16_AopType(__LINE__, left, NULL, result); + DEBUGpic16_pic16_AopType (__LINE__, left, NULL, result); #if 1 - if(IS_BITFIELD( retype ) - && (SPEC_BLEN(retype)==1) - ) { + if (IS_BITFIELD (retype) && (SPEC_BLEN (retype) == 1)) + { iCode *nextic; pCodeOp *jop; - int bitstrt, bytestrt; + int bitstrt; - /* if this is bitfield of size 1, see if we are checking the value - * of a single bit in an if-statement, - * if yes, then don't generate usual code, but execute the - * genIfx directly -- VR */ - - nextic = ic->next; - - /* CHECK: if next iCode is IFX - * and current result operand is nextic's conditional operand - * and current result operand live ranges ends at nextic's key number - */ - if((nextic->op == IFX) - && (result == IC_COND(nextic)) - && (OP_LIVETO(result) == nextic->seq) - && (OP_SYMBOL(left)->remat) // below fails for "if (p->bitfield)" - ) { - /* everything is ok then */ - /* find a way to optimize the genIfx iCode */ + /* if this is bitfield of size 1, see if we are checking the value + * of a single bit in an if-statement, + * if yes, then don't generate usual code, but execute the + * genIfx directly -- VR */ + + nextic = ic->next; + + /* CHECK: if next iCode is IFX + * and current result operand is nextic's conditional operand + * and current result operand live ranges ends at nextic's key number + */ + if ((nextic->op == IFX) && (result == IC_COND (nextic)) && (OP_LIVETO (result) == nextic->seq) && (OP_SYMBOL (left)->remat) // below fails for "if (p->bitfield)" + ) + { + /* everything is ok then */ + /* find a way to optimize the genIfx iCode */ - bytestrt = SPEC_BSTR(retype)/8; - bitstrt = SPEC_BSTR(retype)%8; + bitstrt = SPEC_BSTR (retype) % 8; - jop = pic16_popCopyGPR2Bit(pic16_popGet(AOP(left), 0), bitstrt); + jop = pic16_popCopyGPR2Bit (pic16_popGet (AOP (left), 0), bitstrt); - genIfxpCOpJump(nextic, jop); + genIfxpCOpJump (nextic, jop); - pic16_freeAsmop(left, NULL, ic, TRUE); - pic16_freeAsmop(result, NULL, ic, TRUE); - return; + pic16_freeAsmop (left, NULL, ic, TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); + return; } } #endif - /* if bitfield then unpack the bits */ - if (IS_BITFIELD(letype)) - genUnpackBits (result, left, NULL, POINTER); - else { + /* if bitfield then unpack the bits */ + if (IS_BITFIELD (letype)) + genUnpackBits (result, left, NULL, POINTER); + else + { /* we have can just get the values */ - int size = AOP_SIZE(result); + int size = AOP_SIZE (result); int offset = 0; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - pic16_loadFSR0( left, 0 ); + pic16_loadFSR0 (left, 0); - while(size--) { - if(size) { - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popCopyReg(&pic16_pc_postinc0), - pic16_popGet(AOP(result), offset++))); - } else { - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popCopyReg(&pic16_pc_indf0), - pic16_popGet(AOP(result), offset++))); + while (size--) + { + if (size) + { + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popCopyReg (&pic16_pc_postinc0), + pic16_popGet (AOP (result), offset++))); + } + else + { + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popCopyReg (&pic16_pc_indf0), + pic16_popGet (AOP (result), offset++))); + } } - } } #if 0 - /* now some housekeeping stuff */ - if (aop) { + /* now some housekeeping stuff */ + if (aop) + { /* we had to allocate for this iCode */ - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - pic16_freeAsmop(NULL,aop,ic,TRUE); - } else { + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + pic16_freeAsmop (NULL, aop, ic, TRUE); + } + else + { /* we did not allocate which means left * already in a pointer register, then * if size > 0 && this could be used again * we have to point it back to where it * belongs */ - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if (AOP_SIZE(result) > 1 - && !OP_SYMBOL(left)->remat - && ( OP_SYMBOL(left)->liveTo > ic->seq - || ic->depth )) { + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + if (AOP_SIZE (result) > 1 && !OP_SYMBOL (left)->remat && (OP_SYMBOL (left)->liveTo > ic->seq || ic->depth)) + { // int size = AOP_SIZE(result) - 1; // while (size--) // pic16_emitcode("dec","%s",rname); @@ -8304,51 +9353,52 @@ } #endif - /* done */ - pic16_freeAsmop(left,NULL,ic,TRUE); - pic16_freeAsmop(result,NULL,ic,TRUE); + /* done */ + pic16_freeAsmop (left, NULL, ic, TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genGenPointerGet - gget value from generic pointer space */ /*-----------------------------------------------------------------*/ -static void genGenPointerGet (operand *left, - operand *result, iCode *ic) +static void +genGenPointerGet (operand * left, operand * result, iCode * ic) { int size; - sym_link *letype = getSpec(operandType(left)); + sym_link *letype = getSpec (operandType (left)); - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - pic16_aopOp(left,ic,FALSE); - pic16_aopOp(result,ic,TRUE); - size = AOP_SIZE(result); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + pic16_aopOp (left, ic, FALSE); + pic16_aopOp (result, ic, TRUE); + size = AOP_SIZE (result); - DEBUGpic16_pic16_AopType(__LINE__,left,NULL,result); + DEBUGpic16_pic16_AopType (__LINE__, left, NULL, result); /* if bit then unpack */ - if (IS_BITFIELD(letype)) { - genUnpackBits(result,left,"BAD",GPOINTER); - goto release; - } + if (IS_BITFIELD (letype)) + { + genUnpackBits (result, left, "BAD", GPOINTER); + goto release; + } /* set up WREG:PRODL:FSR0L with address from left */ - mov2fp(pic16_popCopyReg(&pic16_pc_fsr0l), AOP(left), 0); - mov2fp(pic16_popCopyReg(&pic16_pc_prodl), AOP(left), 1); - pic16_mov2w(AOP(left), 2); - pic16_callGenericPointerRW(0, size); + mov2fp (pic16_popCopyReg (&pic16_pc_fsr0l), AOP (left), 0); + mov2fp (pic16_popCopyReg (&pic16_pc_prodl), AOP (left), 1); + pic16_mov2w (AOP (left), 2); + pic16_callGenericPointerRW (0, size); - assignResultValue(result, size, 1); + assignResultValue (result, size, 1); release: - pic16_freeAsmop(left,NULL,ic,TRUE); - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (left, NULL, ic, TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genConstPointerGet - get value from const generic pointer space */ /*-----------------------------------------------------------------*/ -static void genConstPointerGet (operand *left, - operand *result, iCode *ic) +static void +genConstPointerGet (operand * left, operand * result, iCode * ic) { //sym_link *retype = getSpec(operandType(result)); // symbol *albl = newiTempLabel(NULL); // patch 15 @@ -8357,133 +9407,144 @@ int size; int offset = 0; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - pic16_aopOp(left,ic,FALSE); - pic16_aopOp(result,ic,TRUE); - size = AOP_SIZE(result); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + pic16_aopOp (left, ic, FALSE); + pic16_aopOp (result, ic, TRUE); + size = AOP_SIZE (result); /* if bit then unpack */ - if (IS_BITFIELD(getSpec (operandType (left)))) { - genUnpackBits(result,left,"BAD",GPOINTER); - goto release; - } // if + if (IS_BITFIELD (getSpec (operandType (left)))) + { + genUnpackBits (result, left, "BAD", GPOINTER); + goto release; + } // if - DEBUGpic16_pic16_AopType(__LINE__,left,NULL,result); + DEBUGpic16_pic16_AopType (__LINE__, left, NULL, result); - DEBUGpic16_emitcode ("; "," %d getting const pointer",__LINE__); + DEBUGpic16_emitcode ("; ", " %d getting const pointer", __LINE__); // set up table pointer - if( (AOP_TYPE(left) == AOP_PCODE) - && ((AOP(left)->aopu.pcop->type == PO_IMMEDIATE) - || (AOP(left)->aopu.pcop->type == PO_DIR))) - { - pic16_emitpcode(POC_MOVLW,pic16_popGet(AOP(left),0)); - pic16_emitpcode(POC_MOVWF,pic16_popCopyReg(&pic16_pc_tblptrl)); - pic16_emitpcode(POC_MOVLW,pic16_popGet(AOP(left),1)); - pic16_emitpcode(POC_MOVWF,pic16_popCopyReg(&pic16_pc_tblptrh)); - pic16_emitpcode(POC_MOVLW,pic16_popGet(AOP(left),2)); - pic16_emitpcode(POC_MOVWF,pic16_popCopyReg(&pic16_pc_tblptru)); - } else { - mov2fp(pic16_popCopyReg(&pic16_pc_tblptrl), AOP(left), 0); - mov2fp(pic16_popCopyReg(&pic16_pc_tblptrh), AOP(left), 1); - mov2fp(pic16_popCopyReg(&pic16_pc_tblptru), AOP(left), 2); - } + if ((AOP_TYPE (left) == AOP_PCODE) + && ((AOP (left)->aopu.pcop->type == PO_IMMEDIATE) || (AOP (left)->aopu.pcop->type == PO_DIR))) + { + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (left), 0)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_tblptrl)); + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (left), 1)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_tblptrh)); + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (left), 2)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_tblptru)); + } + else + { + mov2fp (pic16_popCopyReg (&pic16_pc_tblptrl), AOP (left), 0); + mov2fp (pic16_popCopyReg (&pic16_pc_tblptrh), AOP (left), 1); + mov2fp (pic16_popCopyReg (&pic16_pc_tblptru), AOP (left), 2); + } - while(size--) { - pic16_emitpcodeNULLop(POC_TBLRD_POSTINC); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popCopyReg(&pic16_pc_tablat), pic16_popGet(AOP(result),offset))); - offset++; - } + while (size--) + { + pic16_emitpcodeNULLop (POC_TBLRD_POSTINC); + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popCopyReg (&pic16_pc_tablat), pic16_popGet (AOP (result), offset))); + offset++; + } release: - pic16_freeAsmop(left,NULL,ic,TRUE); - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (left, NULL, ic, TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genPointerGet - generate code for pointer get */ /*-----------------------------------------------------------------*/ -static void genPointerGet (iCode *ic) +static void +genPointerGet (iCode * ic) { - operand *left, *result ; + operand *left, *result; sym_link *type, *etype; int p_type; - FENTRY; + FENTRY; - left = IC_LEFT(ic); - result = IC_RESULT(ic) ; + left = IC_LEFT (ic); + result = IC_RESULT (ic); - /* depending on the type of pointer we need to - move it to the correct pointer register */ - type = operandType(left); - etype = getSpec(type); + /* depending on the type of pointer we need to + move it to the correct pointer register */ + type = operandType (left); + etype = getSpec (type); #if 0 - if (IS_PTR_CONST(type)) + if (IS_PTR_CONST (type)) #else - if (IS_CODEPTR(type)) + if (IS_CODEPTR (type)) #endif - DEBUGpic16_emitcode ("; ***","%d - const pointer",__LINE__); + DEBUGpic16_emitcode ("; ***", "%d - const pointer", __LINE__); - /* if left is of type of pointer then it is simple */ - if (IS_PTR(type) && !IS_FUNC(type->next)) - p_type = DCL_TYPE(type); - else { + /* if left is of type of pointer then it is simple */ + if (IS_PTR (type) && !IS_FUNC (type->next)) + p_type = DCL_TYPE (type); + else + { /* we have to go by the storage class */ - p_type = PTR_TYPE(SPEC_OCLS(etype)); + p_type = PTR_TYPE (SPEC_OCLS (etype)); - DEBUGpic16_emitcode ("; ***","%d - resolve pointer by storage class",__LINE__); + DEBUGpic16_emitcode ("; ***", "%d - resolve pointer by storage class", __LINE__); - if (SPEC_OCLS(etype)->codesp ) { - DEBUGpic16_emitcode ("; ***","%d - cpointer",__LINE__); - //p_type = CPOINTER ; - } else - if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) { - DEBUGpic16_emitcode ("; ***","%d - fpointer",__LINE__); - /*p_type = FPOINTER ;*/ - } else - if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) { - DEBUGpic16_emitcode ("; ***","%d - ppointer",__LINE__); - /* p_type = PPOINTER; */ - } else - if (SPEC_OCLS(etype) == idata ) { - DEBUGpic16_emitcode ("; ***","%d - ipointer",__LINE__); - /* p_type = IPOINTER; */ - } else { - DEBUGpic16_emitcode ("; ***","%d - pointer",__LINE__); - /* p_type = POINTER ; */ - } + if (SPEC_OCLS (etype)->codesp) + { + DEBUGpic16_emitcode ("; ***", "%d - cpointer", __LINE__); + //p_type = CPOINTER ; + } + else if (SPEC_OCLS (etype)->fmap && !SPEC_OCLS (etype)->paged) + { + DEBUGpic16_emitcode ("; ***", "%d - fpointer", __LINE__); + /*p_type = FPOINTER ; */ + } + else if (SPEC_OCLS (etype)->fmap && SPEC_OCLS (etype)->paged) + { + DEBUGpic16_emitcode ("; ***", "%d - ppointer", __LINE__); + /* p_type = PPOINTER; */ + } + else if (SPEC_OCLS (etype) == idata) + { + DEBUGpic16_emitcode ("; ***", "%d - ipointer", __LINE__); + /* p_type = IPOINTER; */ + } + else + { + DEBUGpic16_emitcode ("; ***", "%d - pointer", __LINE__); + /* p_type = POINTER ; */ + } } - /* now that we have the pointer type we assign - the pointer values */ - switch (p_type) { - case POINTER: - case FPOINTER: - case IPOINTER: - case PPOINTER: - genNearPointerGet (left,result,ic); - break; + /* now that we have the pointer type we assign + the pointer values */ + switch (p_type) + { + case POINTER: + case FPOINTER: + case IPOINTER: + case PPOINTER: + genNearPointerGet (left, result, ic); + break; - case CPOINTER: - genConstPointerGet (left,result,ic); - //pic16_emitcodePointerGet (left,result,ic); - break; + case CPOINTER: + genConstPointerGet (left, result, ic); + //pic16_emitcodePointerGet (left,result,ic); + break; - case GPOINTER: + case GPOINTER: #if 0 - if (IS_PTR_CONST(type)) - genConstPointerGet (left,result,ic); + if (IS_PTR_CONST (type)) + genConstPointerGet (left, result, ic); else #endif - genGenPointerGet (left,result,ic); + genGenPointerGet (left, result, ic); break; default: - werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - "genPointerGet: illegal pointer type"); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "genPointerGet: illegal pointer type"); } } @@ -8491,238 +9552,265 @@ /*-----------------------------------------------------------------*/ /* genPackBits - generates code for packed bit storage */ /*-----------------------------------------------------------------*/ -static void genPackBits (sym_link *etype , operand *result, - operand *right , - char *rname, int p_type) -{ - int shCnt = 0 ; - int offset = 0 ; - int rLen = 0 ; - int blen, bstr ; +static void +genPackBits (sym_link * etype, operand * result, operand * right, char *rname, int p_type) +{ + int shCnt = 0; + int offset = 0; + int rLen = 0; + int blen, bstr; int shifted_and_masked = 0; - unsigned long lit = (unsigned long)-1; + unsigned long lit = (unsigned long) - 1; sym_link *retype; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - blen = SPEC_BLEN(etype); - bstr = SPEC_BSTR(etype); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + blen = SPEC_BLEN (etype); + bstr = SPEC_BSTR (etype); - retype = getSpec(operandType(right)); + retype = getSpec (operandType (right)); - if(AOP_TYPE(right) == AOP_LIT) { - lit = ulFromVal (AOP(right)->aopu.aop_lit); + if (AOP_TYPE (right) == AOP_LIT) + { + lit = ulFromVal (AOP (right)->aopu.aop_lit); - if((blen == 1) && (bstr < 8)) { - /* it is a single bit, so use the appropriate bit instructions */ + if ((blen == 1) && (bstr < 8)) + { + /* it is a single bit, so use the appropriate bit instructions */ - DEBUGpic16_emitcode (";","%s %d optimize bit assignment",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode (";", "%s %d optimize bit assignment", __FUNCTION__, __LINE__); - if(!IS_PTR(operandType(result)) || IS_DIRECT(result)) { - /* workaround to reduce the extra lfsr instruction */ - if(lit) { - pic16_emitpcode(POC_BSF, - pic16_popCopyGPR2Bit(pic16_popGet(AOP(result), 0), bstr)); - } else { - pic16_emitpcode(POC_BCF, - pic16_popCopyGPR2Bit(pic16_popGet(AOP(result), 0), bstr)); - } - } else { - if (PIC_IS_DATA_PTR(operandType(result))) { - pic16_loadFSR0(result, 0); - pic16_emitpcode(lit ? POC_BSF : POC_BCF, - pic16_popCopyGPR2Bit(pic16_popCopyReg(&pic16_pc_indf0), bstr)); - } else { - /* get old value */ - pic16_derefPtr (result, p_type, 0, NULL); - pic16_emitpcode(lit ? POC_BSF : POC_BCF, - pic16_popCopyGPR2Bit(pic16_popCopyReg(&pic16_pc_wreg), bstr)); - /* write back new value */ - pic16_derefPtr (result, p_type, 1, NULL); - } - } + if (!IS_PTR (operandType (result)) || IS_DIRECT (result)) + { + /* workaround to reduce the extra lfsr instruction */ + if (lit) + { + pic16_emitpcode (POC_BSF, pic16_popCopyGPR2Bit (pic16_popGet (AOP (result), 0), bstr)); + } + else + { + pic16_emitpcode (POC_BCF, pic16_popCopyGPR2Bit (pic16_popGet (AOP (result), 0), bstr)); + } + } + else + { + if (PIC_IS_DATA_PTR (operandType (result))) + { + pic16_loadFSR0 (result, 0); + pic16_emitpcode (lit ? POC_BSF : POC_BCF, pic16_popCopyGPR2Bit (pic16_popCopyReg (&pic16_pc_indf0), bstr)); + } + else + { + /* get old value */ + pic16_derefPtr (result, p_type, 0, NULL); + pic16_emitpcode (lit ? POC_BSF : POC_BCF, pic16_popCopyGPR2Bit (pic16_popCopyReg (&pic16_pc_wreg), bstr)); + /* write back new value */ + pic16_derefPtr (result, p_type, 1, NULL); + } + } - return; + return; + } + /* IORLW below is more efficient */ + //pic16_emitpcode(POC_MOVLW, pic16_popGetLit((lit & ((1UL << blen) - 1)) << bstr)); + lit = (lit & ((1UL << blen) - 1)) << bstr; + shifted_and_masked = 1; + offset++; } - /* IORLW below is more efficient */ - //pic16_emitpcode(POC_MOVLW, pic16_popGetLit((lit & ((1UL << blen) - 1)) << bstr)); - lit = (lit & ((1UL << blen) - 1)) << bstr; - shifted_and_masked = 1; - offset++; - } else - if (IS_DIRECT(result) && !IS_PTR(operandType(result)) - && IS_BITFIELD(retype) - && (AOP_TYPE(right) == AOP_REG || AOP_TYPE(right) == AOP_DIR) - && (blen == 1)) { - int rblen, rbstr; - - rblen = SPEC_BLEN( retype ); - rbstr = SPEC_BSTR( retype ); - - if(IS_BITFIELD(etype)) { - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(result), 0)); - pic16_emitpcode(POC_BCF, pic16_popCopyGPR2Bit(pic16_popCopyReg(&pic16_pc_wreg), bstr)); - } else { - pic16_emitpcode(POC_CLRF, pic16_popCopyReg(&pic16_pc_wreg)); - } + else if (IS_DIRECT (result) && !IS_PTR (operandType (result)) + && IS_BITFIELD (retype) && (AOP_TYPE (right) == AOP_REG || AOP_TYPE (right) == AOP_DIR) && (blen == 1)) + { + int rbstr; - pic16_emitpcode(POC_BTFSC, pic16_popCopyGPR2Bit(pic16_popGet(AOP(right), 0), rbstr)); + rbstr = SPEC_BSTR (retype); - if(IS_BITFIELD(etype)) { - pic16_emitpcode(POC_BSF, pic16_popCopyGPR2Bit(pic16_popCopyReg(&pic16_pc_wreg), bstr)); - } else { - pic16_emitpcode(POC_INCF, pic16_popCopyReg(&pic16_pc_wreg)); - } + if (IS_BITFIELD (etype)) + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (result), 0)); + pic16_emitpcode (POC_BCF, pic16_popCopyGPR2Bit (pic16_popCopyReg (&pic16_pc_wreg), bstr)); + } + else + { + pic16_emitpcode (POC_CLRF, pic16_popCopyReg (&pic16_pc_wreg)); + } - pic16_emitpcode(POC_MOVWF, pic16_popGet( AOP(result), 0)); + pic16_emitpcode (POC_BTFSC, pic16_popCopyGPR2Bit (pic16_popGet (AOP (right), 0), rbstr)); + + if (IS_BITFIELD (etype)) + { + pic16_emitpcode (POC_BSF, pic16_popCopyGPR2Bit (pic16_popCopyReg (&pic16_pc_wreg), bstr)); + } + else + { + pic16_emitpcode (POC_INCF, pic16_popCopyReg (&pic16_pc_wreg)); + } + + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); return; - } else { + } + else + { /* move right to W */ - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(right), offset++)); + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (right), offset++)); } /* if the bit length is less than or */ /* it exactly fits a byte then */ - if((shCnt=SPEC_BSTR(etype)) - || SPEC_BLEN(etype) <= 8 ) { - int fsr0_setup = 0; - - if (blen != 8 || (bstr % 8) != 0) { - // we need to combine the value with the old value - if(!shifted_and_masked) - { - pic16_emitpcode(POC_ANDLW, pic16_popGetLit((1U << blen)-1)); + if ((shCnt = SPEC_BSTR (etype)) || SPEC_BLEN (etype) <= 8) + { + int fsr0_setup = 0; - DEBUGpic16_emitcode(";", "shCnt = %d SPEC_BSTR(etype) = %d:%d", shCnt, - SPEC_BSTR(etype), SPEC_BLEN(etype)); + if (blen != 8 || (bstr % 8) != 0) + { + // we need to combine the value with the old value + if (!shifted_and_masked) + { + pic16_emitpcode (POC_ANDLW, pic16_popGetLit ((1U << blen) - 1)); - /* shift left acc, do NOT mask the result again */ - AccLsh(shCnt, 0); + DEBUGpic16_emitcode (";", "shCnt = %d SPEC_BSTR(etype) = %d:%d", shCnt, SPEC_BSTR (etype), SPEC_BLEN (etype)); - /* using PRODH as a temporary register here */ - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_prodh)); - } + /* shift left acc, do NOT mask the result again */ + AccLsh (shCnt, 0); - if ((IS_SYMOP(result) && !IS_PTR(operandType (result))) - || IS_DIRECT(result)) { - /* access symbol directly */ - pic16_mov2w (AOP(result), 0); - } else { - /* get old value */ - pic16_derefPtr (result, p_type, 0, &fsr0_setup); - } + /* using PRODH as a temporary register here */ + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_prodh)); + } + + if ((IS_SYMOP (result) && !IS_PTR (operandType (result))) || IS_DIRECT (result)) + { + /* access symbol directly */ + pic16_mov2w (AOP (result), 0); + } + else + { + /* get old value */ + pic16_derefPtr (result, p_type, 0, &fsr0_setup); + } #if 1 - pic16_emitpcode(POC_ANDLW, pic16_popGetLit( - (unsigned char)((unsigned char)(0xff << (blen+bstr)) | - (unsigned char)(0xff >> (8-bstr))) )); - if (!shifted_and_masked) { - pic16_emitpcode(POC_IORFW, pic16_popCopyReg(&pic16_pc_prodh)); - } else { - /* We have the shifted and masked (literal) right value in `lit' */ - if (lit != 0) - pic16_emitpcode(POC_IORLW, pic16_popGetLit(lit)); - } - } else { // if (blen == 8 && (bstr % 8) == 0) - if (shifted_and_masked) { - // move right (literal) to WREG (only case where right is not yet in WREG) - pic16_mov2w(AOP(right), (bstr / 8)); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit ((unsigned char) ((unsigned char) (0xff << (blen + bstr)) | + (unsigned char) (0xff >> (8 - bstr))))); + if (!shifted_and_masked) + { + pic16_emitpcode (POC_IORFW, pic16_popCopyReg (&pic16_pc_prodh)); + } + else + { + /* We have the shifted and masked (literal) right value in `lit' */ + if (lit != 0) + pic16_emitpcode (POC_IORLW, pic16_popGetLit (lit)); + } + } + else // if (blen == 8 && (bstr % 8) == 0) + { + if (shifted_and_masked) + { + // move right (literal) to WREG (only case where right is not yet in WREG) + pic16_mov2w (AOP (right), (bstr / 8)); + } } - } - /* write new value back */ - if ((IS_SYMOP(result) && !IS_PTR(operandType(result))) - || IS_DIRECT(result)) { - pic16_emitpcode (POC_MOVWF, pic16_popGet(AOP(result),0)); - } else { - pic16_derefPtr (result, p_type, 1, &fsr0_setup); - } + /* write new value back */ + if ((IS_SYMOP (result) && !IS_PTR (operandType (result))) || IS_DIRECT (result)) + { + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); + } + else + { + pic16_derefPtr (result, p_type, 1, &fsr0_setup); + } #endif - return; - } + return; + } #if 0 - fprintf(stderr, "SDCC pic16 port error: the port currently does not support\n"); - fprintf(stderr, "bitfields of size >=8. Instead of generating wrong code, bailing out...\n"); - exit(EXIT_FAILURE); + fprintf (stderr, "SDCC pic16 port error: the port currently does not support\n"); + fprintf (stderr, "bitfields of size >=8. Instead of generating wrong code, bailing out...\n"); + exit (EXIT_FAILURE); #endif - pic16_loadFSR0(result, 0); // load FSR0 with address of result - rLen = SPEC_BLEN(etype)-8; + pic16_loadFSR0 (result, 0); // load FSR0 with address of result + rLen = SPEC_BLEN (etype) - 8; /* now generate for lengths greater than one byte */ - while (1) { - rLen -= 8 ; - if (rLen <= 0 ) { - mov2fp(pic16_popCopyReg(&pic16_pc_prodh), AOP(right), offset); - break ; - } + while (1) + { + rLen -= 8; + if (rLen <= 0) + { + mov2fp (pic16_popCopyReg (&pic16_pc_prodh), AOP (right), offset); + break; + } - switch (p_type) { - case POINTER: - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_postinc0)); - break; + switch (p_type) + { + case POINTER: + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_postinc0)); + break; - /* - case FPOINTER: - MOVA(l); - pic16_emitcode("movx","@dptr,a"); - break; - - case GPOINTER: - MOVA(l); - DEBUGpic16_emitcode(";lcall","__gptrput"); - break; - */ - default: - assert(0); - } + /* + case FPOINTER: + MOVA(l); + pic16_emitcode("movx","@dptr,a"); + break; + + case GPOINTER: + MOVA(l); + DEBUGpic16_emitcode(";lcall","__gptrput"); + break; + */ + default: + assert (0); + } - pic16_mov2w(AOP(right), offset++); - } + pic16_mov2w (AOP (right), offset++); + } /* last last was not complete */ - if (rLen) { - /* save the byte & read byte */ - switch (p_type) { - case POINTER: - // pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_prodl)); - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(&pic16_pc_indf0)); - break; + if (rLen) + { + /* save the byte & read byte */ + switch (p_type) + { + case POINTER: + // pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_prodl)); + pic16_emitpcode (POC_MOVFW, pic16_popCopyReg (&pic16_pc_indf0)); + break; - /* - case FPOINTER: - pic16_emitcode ("mov","b,a"); - pic16_emitcode("movx","a,@dptr"); - break; - - case GPOINTER: - pic16_emitcode ("push","b"); - pic16_emitcode ("push","acc"); - pic16_emitcode ("lcall","__gptrget"); - pic16_emitcode ("pop","b"); - break; - */ - default: - assert(0); - } - DEBUGpic16_emitcode(";", "rLen = %i", rLen); - pic16_emitpcode(POC_ANDLW, pic16_popGetLit((unsigned char)-1 << -rLen)); - pic16_emitpcode(POC_IORFW, pic16_popCopyReg(&pic16_pc_prodh)); - // pic16_emitcode ("anl","a,#0x%02x",((unsigned char)-1 << -rLen) ); - // pic16_emitcode ("orl","a,b"); - } + /* + case FPOINTER: + pic16_emitcode ("mov","b,a"); + pic16_emitcode("movx","a,@dptr"); + break; + + case GPOINTER: + pic16_emitcode ("push","b"); + pic16_emitcode ("push","acc"); + pic16_emitcode ("lcall","__gptrget"); + pic16_emitcode ("pop","b"); + break; + */ + default: + assert (0); + } + DEBUGpic16_emitcode (";", "rLen = %i", rLen); + pic16_emitpcode (POC_ANDLW, pic16_popGetLit ((unsigned char) - 1 << -rLen)); + pic16_emitpcode (POC_IORFW, pic16_popCopyReg (&pic16_pc_prodh)); + // pic16_emitcode ("anl","a,#0x%02x",((unsigned char)-1 << -rLen) ); + // pic16_emitcode ("orl","a,b"); + } // if (p_type == GPOINTER) // pic16_emitcode("pop","b"); - switch (p_type) { + switch (p_type) + { case POINTER: - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_indf0)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_indf0)); // pic16_emitcode("mov","@%s,a",rname); break; /* @@ -8735,8 +9823,8 @@ break; */ default: - assert(0); - } + assert (0); + } // pic16_freeAsmop(right, NULL, ic, TRUE); } @@ -8744,45 +9832,48 @@ /*-----------------------------------------------------------------*/ /* genDataPointerSet - remat pointer to data space */ /*-----------------------------------------------------------------*/ -static void genDataPointerSet(operand *right, - operand *result, - iCode *ic) +static void +genDataPointerSet (operand * right, operand * result, iCode * ic) { - int size, offset = 0, resoffset=0 ; + int size, offset = 0, resoffset = 0; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - pic16_aopOp(right,ic,FALSE); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + pic16_aopOp (right, ic, FALSE); - size = AOP_SIZE(right); + size = AOP_SIZE (right); // fprintf(stderr, "%s:%d size= %d\n", __FILE__, __LINE__, size); #if 0 - if ( AOP_TYPE(result) == AOP_PCODE) { - fprintf(stderr,"genDataPointerSet %s, %d\n", - AOP(result)->aopu.pcop->name, - (AOP(result)->aopu.pcop->type == PO_DIR)? - PCOR(AOP(result)->aopu.pcop)->instance: - PCOI(AOP(result)->aopu.pcop)->offset); + if (AOP_TYPE (result) == AOP_PCODE) + { + fprintf (stderr, "genDataPointerSet %s, %d\n", + AOP (result)->aopu.pcop->name, + (AOP (result)->aopu.pcop->type == PO_DIR) ? + PCOR (AOP (result)->aopu.pcop)->instance : PCOI (AOP (result)->aopu.pcop)->offset); } #endif - if(AOP(result)->aopu.pcop->type == PO_DIR) - resoffset=PCOR(AOP(result)->aopu.pcop)->instance; - - while (size--) { - if (AOP_TYPE(right) == AOP_LIT) { - unsigned int lit = pic16aopLiteral(AOP(IC_RIGHT(ic))->aopu.aop_lit, offset); - pic16_movLit2f(pic16_popGet(AOP(result), offset), lit); - } else { - pic16_mov2w(AOP(right), offset); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offset)); // patch 8 - } + if (AOP (result)->aopu.pcop->type == PO_DIR) + resoffset = PCOR (AOP (result)->aopu.pcop)->instance; + + while (size--) + { + if (AOP_TYPE (right) == AOP_LIT) + { + unsigned int lit = pic16aopLiteral (AOP (IC_RIGHT (ic))->aopu.aop_lit, offset); + pic16_movLit2f (pic16_popGet (AOP (result), offset), lit); + } + else + { + pic16_mov2w (AOP (right), offset); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); // patch 8 + } offset++; resoffset++; } - pic16_freeAsmop(right,NULL,ic,TRUE); + pic16_freeAsmop (right, NULL, ic, TRUE); } @@ -8790,305 +9881,325 @@ /*-----------------------------------------------------------------*/ /* genNearPointerSet - pic16_emitcode for near pointer put */ /*-----------------------------------------------------------------*/ -static void genNearPointerSet (operand *right, - operand *result, - iCode *ic) +static void +genNearPointerSet (operand * right, operand * result, iCode * ic) { asmop *aop = NULL; sym_link *retype; - sym_link *ptype = operandType(result); + sym_link *ptype = operandType (result); sym_link *resetype; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - retype= getSpec(operandType(right)); - resetype = getSpec(operandType(result)); - - pic16_aopOp(result,ic,FALSE); - - /* if the result is rematerializable & - * in data space & not a bit variable */ - - /* and result is not a bit variable */ - if (AOP_TYPE(result) == AOP_PCODE - && DCL_TYPE(ptype) == POINTER - && !IS_BITFIELD(retype) - && !IS_BITFIELD(resetype)) { + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + retype = getSpec (operandType (right)); + resetype = getSpec (operandType (result)); + + pic16_aopOp (result, ic, FALSE); + + /* if the result is rematerializable & + * in data space & not a bit variable */ - genDataPointerSet (right,result,ic); - pic16_freeAsmop(result,NULL,ic,TRUE); + /* and result is not a bit variable */ + if (AOP_TYPE (result) == AOP_PCODE && DCL_TYPE (ptype) == POINTER && !IS_BITFIELD (retype) && !IS_BITFIELD (resetype)) + { + + genDataPointerSet (right, result, ic); + pic16_freeAsmop (result, NULL, ic, TRUE); return; } - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - pic16_aopOp(right,ic,FALSE); - DEBUGpic16_pic16_AopType(__LINE__,NULL,right,result); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + pic16_aopOp (right, ic, FALSE); + DEBUGpic16_pic16_AopType (__LINE__, NULL, right, result); - /* if bitfield then unpack the bits */ - if (IS_BITFIELD(resetype)) { + /* if bitfield then unpack the bits */ + if (IS_BITFIELD (resetype)) + { genPackBits (resetype, result, right, NULL, POINTER); - } else { + } + else + { /* we have can just get the values */ - int size = AOP_SIZE(right); - int offset = 0 ; + int size = AOP_SIZE (right); + int offset = 0; - pic16_loadFSR0(result, 0); + pic16_loadFSR0 (result, 0); - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - while (size--) { - if (pic16_isLitOp(right)) { - pic16_emitpcode(POC_MOVLW, pic16_popGet(AOP(right),offset)); - if (size) { - pic16_emitpcode(POC_MOVWF,pic16_popCopyReg(&pic16_pc_postinc0)); - } else { - pic16_emitpcode(POC_MOVWF,pic16_popCopyReg(&pic16_pc_indf0)); - } - } else { // no literal - if(size) { - pic16_emitpcode(POC_MOVFF, - pic16_popGet2p(pic16_popGet(AOP(right),offset), - pic16_popCopyReg(&pic16_pc_postinc0))); - } else { - pic16_emitpcode(POC_MOVFF, - pic16_popGet2p(pic16_popGet(AOP(right),offset), - pic16_popCopyReg(&pic16_pc_indf0))); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + while (size--) + { + if (pic16_isLitOp (right)) + { + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (right), offset)); + if (size) + { + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_postinc0)); + } + else + { + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_indf0)); + } + } + else // no literal + { + if (size) + { + pic16_emitpcode (POC_MOVFF, + pic16_popGet2p (pic16_popGet (AOP (right), offset), pic16_popCopyReg (&pic16_pc_postinc0))); + } + else + { + pic16_emitpcode (POC_MOVFF, + pic16_popGet2p (pic16_popGet (AOP (right), offset), pic16_popCopyReg (&pic16_pc_indf0))); + } } - } offset++; } } - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* now some housekeeping stuff */ - if (aop) { + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* now some housekeeping stuff */ + if (aop) + { /* we had to allocate for this iCode */ - pic16_freeAsmop(NULL,aop,ic,TRUE); - } else { + pic16_freeAsmop (NULL, aop, ic, TRUE); + } + else + { /* we did not allocate which means left * already in a pointer register, then * if size > 0 && this could be used again * we have to point it back to where it * belongs */ - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - if (AOP_SIZE(right) > 1 - && !OP_SYMBOL(result)->remat - && ( OP_SYMBOL(result)->liveTo > ic->seq - || ic->depth )) { - - int size = AOP_SIZE(right) - 1; - - while (size--) - pic16_emitcode("decf","fsr0,f"); - //pic16_emitcode("dec","%s",rname); - } + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + if (AOP_SIZE (right) > 1 && !OP_SYMBOL (result)->remat && (OP_SYMBOL (result)->liveTo > ic->seq || ic->depth)) + { + + int size = AOP_SIZE (right) - 1; + + while (size--) + pic16_emitcode ("decf", "fsr0,f"); + //pic16_emitcode("dec","%s",rname); + } } - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - /* done */ + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + /* done */ //release: - pic16_freeAsmop(right,NULL,ic,TRUE); - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (right, NULL, ic, TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genGenPointerSet - set value from generic pointer space */ /*-----------------------------------------------------------------*/ -static void genGenPointerSet (operand *right, - operand *result, iCode *ic) +static void +genGenPointerSet (operand * right, operand * result, iCode * ic) { int size; - sym_link *retype = getSpec(operandType(result)); + sym_link *retype = getSpec (operandType (result)); - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - pic16_aopOp(result,ic,FALSE); - pic16_aopOp(right,ic,FALSE); - size = AOP_SIZE(right); + pic16_aopOp (result, ic, FALSE); + pic16_aopOp (right, ic, FALSE); + size = AOP_SIZE (right); - DEBUGpic16_pic16_AopType(__LINE__,NULL,right,result); + DEBUGpic16_pic16_AopType (__LINE__, NULL, right, result); - /* if bit then unpack */ - if (IS_BITFIELD(retype)) { + /* if bit then unpack */ + if (IS_BITFIELD (retype)) + { // pic16_emitpcode(POC_LFSR,pic16_popGetLit2(0,pic16_popGetLit(lit))); - genPackBits(retype,result,right,"dptr",GPOINTER); + genPackBits (retype, result, right, "dptr", GPOINTER); goto release; } - size = AOP_SIZE(right); + size = AOP_SIZE (right); - DEBUGpic16_emitcode ("; ***","%s %d size=%d",__FUNCTION__,__LINE__,size); + DEBUGpic16_emitcode ("; ***", "%s %d size=%d", __FUNCTION__, __LINE__, size); - /* load value to write in TBLPTRH:TBLPTRL:PRODH:[stack] */ + /* load value to write in TBLPTRH:TBLPTRL:PRODH:[stack] */ - /* value of right+0 is placed on stack, which will be retrieved - * by the support function thus restoring the stack. The important - * thing is that there is no need to manually restore stack pointer - * here */ - pushaop(AOP(right), 0); + /* value of right+0 is placed on stack, which will be retrieved + * by the support function thus restoring the stack. The important + * thing is that there is no need to manually restore stack pointer + * here */ + pushaop (AOP (right), 0); // mov2fp(pic16_popCopyReg(&pic16_pc_postdec1), AOP(right), 0); - if(size>1)mov2fp(pic16_popCopyReg(&pic16_pc_prodh), AOP(right), 1); - if(size>2)mov2fp(pic16_popCopyReg(&pic16_pc_tblptrl), AOP(right), 2); - if(size>3)mov2fp(pic16_popCopyReg(&pic16_pc_tblptrh), AOP(right), 3); - - /* load address to write to in WREG:FSR0H:FSR0L */ - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popGet(AOP(result), 0), - pic16_popCopyReg(&pic16_pc_fsr0l))); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popGet(AOP(result), 1), - pic16_popCopyReg(&pic16_pc_prodl))); - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(result), 2)); + if (size > 1) + mov2fp (pic16_popCopyReg (&pic16_pc_prodh), AOP (right), 1); + if (size > 2) + mov2fp (pic16_popCopyReg (&pic16_pc_tblptrl), AOP (right), 2); + if (size > 3) + mov2fp (pic16_popCopyReg (&pic16_pc_tblptrh), AOP (right), 3); + + /* load address to write to in WREG:FSR0H:FSR0L */ + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popGet (AOP (result), 0), pic16_popCopyReg (&pic16_pc_fsr0l))); + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popGet (AOP (result), 1), pic16_popCopyReg (&pic16_pc_prodl))); + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (result), 2)); - pic16_callGenericPointerRW(1, size); + pic16_callGenericPointerRW (1, size); release: - pic16_freeAsmop(right,NULL,ic,TRUE); - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (right, NULL, ic, TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genPointerSet - stores the value into a pointer location */ /*-----------------------------------------------------------------*/ -static void genPointerSet (iCode *ic) +static void +genPointerSet (iCode * ic) { - operand *right, *result ; + operand *right, *result; sym_link *type, *etype; int p_type; - FENTRY; + FENTRY; - right = IC_RIGHT(ic); - result = IC_RESULT(ic) ; + right = IC_RIGHT (ic); + result = IC_RESULT (ic); - /* depending on the type of pointer we need to - move it to the correct pointer register */ - type = operandType(result); - etype = getSpec(type); - - /* if left is of type of pointer then it is simple */ - if (IS_PTR(type) && !IS_FUNC(type->next)) { - p_type = DCL_TYPE(type); - } - else { - /* we have to go by the storage class */ - p_type = PTR_TYPE(SPEC_OCLS(etype)); - -/* if (SPEC_OCLS(etype)->codesp ) { */ -/* p_type = CPOINTER ; */ -/* } */ -/* else */ -/* if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */ -/* p_type = FPOINTER ; */ -/* else */ -/* if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */ -/* p_type = PPOINTER ; */ -/* else */ -/* if (SPEC_OCLS(etype) == idata ) */ -/* p_type = IPOINTER ; */ -/* else */ -/* p_type = POINTER ; */ - } - - /* now that we have the pointer type we assign - the pointer values */ - switch (p_type) { - case POINTER: - case FPOINTER: - case IPOINTER: - case PPOINTER: - genNearPointerSet (right,result,ic); - break; + /* depending on the type of pointer we need to + move it to the correct pointer register */ + type = operandType (result); + etype = getSpec (type); - case GPOINTER: - genGenPointerSet (right,result,ic); - break; + /* if left is of type of pointer then it is simple */ + if (IS_PTR (type) && !IS_FUNC (type->next)) + { + p_type = DCL_TYPE (type); + } + else + { + /* we have to go by the storage class */ + p_type = PTR_TYPE (SPEC_OCLS (etype)); + + /* if (SPEC_OCLS(etype)->codesp ) { */ + /* p_type = CPOINTER ; */ + /* } */ + /* else */ + /* if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */ + /* p_type = FPOINTER ; */ + /* else */ + /* if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */ + /* p_type = PPOINTER ; */ + /* else */ + /* if (SPEC_OCLS(etype) == idata ) */ + /* p_type = IPOINTER ; */ + /* else */ + /* p_type = POINTER ; */ + } + + /* now that we have the pointer type we assign + the pointer values */ + switch (p_type) + { + case POINTER: + case FPOINTER: + case IPOINTER: + case PPOINTER: + genNearPointerSet (right, result, ic); + break; - default: - werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - "genPointerSet: illegal pointer type"); + case GPOINTER: + genGenPointerSet (right, result, ic); + break; + + default: + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "genPointerSet: illegal pointer type"); } } /*-----------------------------------------------------------------*/ /* genIfx - generate code for Ifx statement */ /*-----------------------------------------------------------------*/ -static void genIfx (iCode *ic, iCode *popIc) +static void +genIfx (iCode * ic, iCode * popIc) { - operand *cond = IC_COND(ic); - int isbit =0; + operand *cond = IC_COND (ic); + int isbit = 0; + + FENTRY; - FENTRY; + pic16_aopOp (cond, ic, FALSE); - pic16_aopOp(cond,ic,FALSE); + /* get the value into acc */ + if (AOP_TYPE (cond) != AOP_CRY) + pic16_toBoolean (cond); + else + isbit = 1; + /* the result is now in the accumulator */ + pic16_freeAsmop (cond, NULL, ic, TRUE); + + /* if there was something to be popped then do it */ + if (popIc) + genIpop (popIc); - /* get the value into acc */ - if (AOP_TYPE(cond) != AOP_CRY) - pic16_toBoolean(cond); - else - isbit = 1; - /* the result is now in the accumulator */ - pic16_freeAsmop(cond,NULL,ic,TRUE); - - /* if there was something to be popped then do it */ - if (popIc) - genIpop(popIc); - - /* if the condition is a bit variable */ - if (isbit && IS_ITEMP(cond) && - SPIL_LOC(cond)) { - genIfxJump(ic,"c"); - DEBUGpic16_emitcode ("; isbit SPIL_LOC","%s",SPIL_LOC(cond)->rname); - } else { - if (isbit && !IS_ITEMP(cond)) - genIfxJump(ic,OP_SYMBOL(cond)->rname); - else - genIfxJump(ic,"a"); + /* if the condition is a bit variable */ + if (isbit && IS_ITEMP (cond) && SPIL_LOC (cond)) + { + genIfxJump (ic, "c"); + DEBUGpic16_emitcode ("; isbit SPIL_LOC", "%s", SPIL_LOC (cond)->rname); + } + else + { + if (isbit && !IS_ITEMP (cond)) + genIfxJump (ic, OP_SYMBOL (cond)->rname); + else + genIfxJump (ic, "a"); } - ic->generated = 1; + ic->generated = 1; } /*-----------------------------------------------------------------*/ /* genAddrOf - generates code for address of */ /*-----------------------------------------------------------------*/ -static void genAddrOf (iCode *ic) +static void +genAddrOf (iCode * ic) { operand *result, *left; int size; - symbol *sym; // = OP_SYMBOL(IC_LEFT(ic)); + symbol *sym; // = OP_SYMBOL(IC_LEFT(ic)); pCodeOp *pcop0, *pcop1, *pcop2; - FENTRY; + FENTRY; - pic16_aopOp((result=IC_RESULT(ic)),ic,TRUE); + pic16_aopOp ((result = IC_RESULT (ic)), ic, TRUE); - sym = OP_SYMBOL( IC_LEFT(ic) ); + sym = OP_SYMBOL (IC_LEFT (ic)); - if(sym->onStack) { + if (sym->onStack) + { /* get address of symbol on stack */ - DEBUGpic16_emitcode("; ", "%s symbol %s on stack", __FUNCTION__, sym->name); + DEBUGpic16_emitcode ("; ", "%s symbol %s on stack", __FUNCTION__, sym->name); #if 0 - fprintf(stderr, "%s:%d symbol %s on stack offset %i\n", __FILE__, __LINE__, - OP_SYMBOL(IC_LEFT(ic))->name, OP_SYMBOL(IC_LEFT(ic))->stack); + fprintf (stderr, "%s:%d symbol %s on stack offset %i\n", __FILE__, __LINE__, + OP_SYMBOL (IC_LEFT (ic))->name, OP_SYMBOL (IC_LEFT (ic))->stack); #endif // operands on stack are accessible via "FSR2 + index" with index // starting at 2 for arguments and growing from 0 downwards for // local variables (index == 0 is not assigned so we add one here) { - int soffs = OP_SYMBOL( IC_LEFT(ic))->stack; + int soffs = OP_SYMBOL (IC_LEFT (ic))->stack; - if (soffs <= 0) { + if (soffs <= 0) + { assert (soffs < 0); soffs++; - } // if + } // if - DEBUGpic16_emitcode("*!*", "accessing stack symbol at offset=%d", soffs); - pic16_emitpcode(POC_MOVLW , pic16_popGetLit( soffs & 0x00FF )); - pic16_emitpcode(POC_ADDFW , pic16_popCopyReg(pic16_framepnt_lo)); - pic16_emitpcode(POC_MOVWF , pic16_popGet(AOP(result), 0)); - pic16_emitpcode(POC_MOVLW , pic16_popGetLit( (soffs >> 8) & 0x00FF )); - pic16_emitpcode(POC_ADDFWC, pic16_popCopyReg(pic16_framepnt_hi)); - pic16_emitpcode(POC_MOVWF , pic16_popGet(AOP(result), 1)); + DEBUGpic16_emitcode ("*!*", "accessing stack symbol at offset=%d", soffs); + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (soffs & 0x00FF)); + pic16_emitpcode (POC_ADDFW, pic16_popCopyReg (pic16_framepnt_lo)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); + pic16_emitpcode (POC_MOVLW, pic16_popGetLit ((soffs >> 8) & 0x00FF)); + pic16_emitpcode (POC_ADDFWC, pic16_popCopyReg (pic16_framepnt_hi)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 1)); } goto release; @@ -9099,383 +10210,418 @@ // __FILE__, __LINE__, __FUNCTION__, sym->name, IN_CODESPACE( SPEC_OCLS(sym->etype))); // } - pic16_aopOp((left=IC_LEFT(ic)), ic, FALSE); - size = AOP_SIZE(IC_RESULT(ic)); + pic16_aopOp ((left = IC_LEFT (ic)), ic, FALSE); + size = AOP_SIZE (IC_RESULT (ic)); + + pcop0 = PCOP (pic16_newpCodeOpImmd (sym->rname, 0, 0, IN_CODESPACE (SPEC_OCLS (sym->etype)))); + pcop1 = PCOP (pic16_newpCodeOpImmd (sym->rname, 1, 0, IN_CODESPACE (SPEC_OCLS (sym->etype)))); + pcop2 = PCOP (pic16_newpCodeOpImmd (sym->rname, 2, 0, IN_CODESPACE (SPEC_OCLS (sym->etype)))); - pcop0 = PCOP(pic16_newpCodeOpImmd(sym->rname, 0, 0, IN_CODESPACE( SPEC_OCLS(sym->etype)))); - pcop1 = PCOP(pic16_newpCodeOpImmd(sym->rname, 1, 0, IN_CODESPACE( SPEC_OCLS(sym->etype)))); - pcop2 = PCOP(pic16_newpCodeOpImmd(sym->rname, 2, 0, IN_CODESPACE( SPEC_OCLS(sym->etype)))); - - if (size == 3) { - pic16_emitpcode(POC_MOVLW, pcop0); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 0)); - pic16_emitpcode(POC_MOVLW, pcop1); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 1)); - pic16_emitpcode(POC_MOVLW, pcop2); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 2)); - } else - if (size == 2) { - pic16_emitpcode(POC_MOVLW, pcop0); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),0)); - pic16_emitpcode(POC_MOVLW, pcop1); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),1)); - } else { - pic16_emitpcode(POC_MOVLW, pcop0); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),0)); + if (size == 3) + { + pic16_emitpcode (POC_MOVLW, pcop0); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); + pic16_emitpcode (POC_MOVLW, pcop1); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 1)); + pic16_emitpcode (POC_MOVLW, pcop2); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 2)); + } + else if (size == 2) + { + pic16_emitpcode (POC_MOVLW, pcop0); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); + pic16_emitpcode (POC_MOVLW, pcop1); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 1)); + } + else + { + pic16_emitpcode (POC_MOVLW, pcop0); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); } - pic16_freeAsmop(left, NULL, ic, FALSE); + pic16_freeAsmop (left, NULL, ic, FALSE); release: - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genAssign - generate code for assignment */ /*-----------------------------------------------------------------*/ -static void genAssign (iCode *ic) +static void +genAssign (iCode * ic) { operand *result, *right; sym_link *restype, *rtype; - int size, offset,know_W; + int size, offset, know_W; unsigned long lit = 0L; - result = IC_RESULT(ic); - right = IC_RIGHT(ic) ; + result = IC_RESULT (ic); + right = IC_RIGHT (ic); - FENTRY; + FENTRY; - /* if they are the same */ - if (operandsEqu (IC_RESULT(ic),IC_RIGHT(ic))) - return ; + /* if they are the same */ + if (operandsEqu (IC_RESULT (ic), IC_RIGHT (ic))) + return; - /* reversed order operands are aopOp'ed so that result operand - * is effective in case right is a stack symbol. This maneauver - * allows to use the _G.resDirect flag later */ - pic16_aopOp(result,ic,TRUE); - pic16_aopOp(right,ic,FALSE); + /* reversed order operands are aopOp'ed so that result operand + * is effective in case right is a stack symbol. This maneauver + * allows to use the _G.resDirect flag later */ + pic16_aopOp (result, ic, TRUE); + pic16_aopOp (right, ic, FALSE); - DEBUGpic16_pic16_AopType(__LINE__,NULL,right,result); + DEBUGpic16_pic16_AopType (__LINE__, NULL, right, result); - /* if they are the same registers */ - if (pic16_sameRegs(AOP(right),AOP(result))) - goto release; + /* if they are the same registers */ + if (pic16_sameRegs (AOP (right), AOP (result))) + goto release; - /* if the result is a bit */ - if (AOP_TYPE(result) == AOP_CRY) { + /* if the result is a bit */ + if (AOP_TYPE (result) == AOP_CRY) + { /* if the right size is a literal then we know what the value is */ - if (AOP_TYPE(right) == AOP_LIT) { + if (AOP_TYPE (right) == AOP_LIT) + { - pic16_emitpcode( ( ((int) operandLitValue(right)) ? POC_BSF : POC_BCF), - pic16_popGet(AOP(result),0)); + pic16_emitpcode ((((int) operandLitValue (right)) ? POC_BSF : POC_BCF), pic16_popGet (AOP (result), 0)); - if (((int) operandLitValue(right))) - pic16_emitcode("bsf","(%s >> 3),(%s & 7)", - AOP(result)->aopu.aop_dir, - AOP(result)->aopu.aop_dir); - else - pic16_emitcode("bcf","(%s >> 3),(%s & 7)", - AOP(result)->aopu.aop_dir, - AOP(result)->aopu.aop_dir); + if (((int) operandLitValue (right))) + pic16_emitcode ("bsf", "(%s >> 3),(%s & 7)", AOP (result)->aopu.aop_dir, AOP (result)->aopu.aop_dir); + else + pic16_emitcode ("bcf", "(%s >> 3),(%s & 7)", AOP (result)->aopu.aop_dir, AOP (result)->aopu.aop_dir); - goto release; - } + goto release; + } /* the right is also a bit variable */ - if (AOP_TYPE(right) == AOP_CRY) { - pic16_emitpcode(POC_BCF, pic16_popGet(AOP(result),0)); - pic16_emitpcode(POC_BTFSC, pic16_popGet(AOP(right),0)); - pic16_emitpcode(POC_BSF, pic16_popGet(AOP(result),0)); + if (AOP_TYPE (right) == AOP_CRY) + { + pic16_emitpcode (POC_BCF, pic16_popGet (AOP (result), 0)); + pic16_emitpcode (POC_BTFSC, pic16_popGet (AOP (right), 0)); + pic16_emitpcode (POC_BSF, pic16_popGet (AOP (result), 0)); - goto release ; - } + goto release; + } /* we need to or */ - pic16_emitpcode(POC_BCF, pic16_popGet(AOP(result),0)); - pic16_toBoolean(right); + pic16_emitpcode (POC_BCF, pic16_popGet (AOP (result), 0)); + pic16_toBoolean (right); emitSKPZ; - pic16_emitpcode(POC_BSF, pic16_popGet(AOP(result),0)); + pic16_emitpcode (POC_BSF, pic16_popGet (AOP (result), 0)); //pic16_aopPut(AOP(result),"a",0); - goto release ; + goto release; } - /* bit variables done */ - /* general case */ - size = AOP_SIZE(result); - offset = 0 ; + /* bit variables done */ + /* general case */ + size = AOP_SIZE (result); + offset = 0; /* bit variables done */ /* general case */ - size = AOP_SIZE(result); - restype = operandType(result); - rtype = operandType(right); - offset = 0 ; - - if(AOP_TYPE(right) == AOP_LIT) { - if(!(IS_FLOAT(operandType( right )) || IS_FIXED(operandType(right)))) - { - lit = ulFromVal (AOP(right)->aopu.aop_lit); - - /* patch tag for literals that are cast to pointers */ - if (IS_CODEPTR(restype)) { - //fprintf (stderr, "%s:%u: INFO: `(__code*)literal'\n", ic->filename, ic->lineno); - lit = (lit & 0x00ffff) | (GPTR_TAG_CODE << 16); - } else { - if (IS_GENPTR(restype)) - { - if (IS_CODEPTR(rtype)) { - //fprintf (stderr, "%s:%u: INFO: `(generic*)(literal __code*)'\n", ic->filename, ic->lineno); - lit = (lit & 0x00ffff) | (GPTR_TAG_CODE << 16); - } else if (PIC_IS_DATA_PTR(rtype)) { - //fprintf (stderr, "%s:%u: INFO: `(generic*)(literal __data*)'\n", ic->filename, ic->lineno); - lit = (lit & 0x00ffff) | (GPTR_TAG_DATA << 16); - } else if (!IS_PTR(rtype) || IS_GENPTR(rtype)) { - //fprintf (stderr, "%s:%u: INFO: `(generic*)literal' -- accepting specified tag %02x\n", ic->filename, ic->lineno, (unsigned char)(lit >> 16)); - } else if (IS_PTR(rtype)) { - fprintf (stderr, "%s:%u: WARNING: `(generic*)literal' -- assuming __data space\n", ic->filename, ic->lineno); - lit = (lit & 0x00ffff) | (GPTR_TAG_DATA << 16); - } + size = AOP_SIZE (result); + restype = operandType (result); + rtype = operandType (right); + offset = 0; + + if (AOP_TYPE (right) == AOP_LIT) + { + if (!(IS_FLOAT (operandType (right)) || IS_FIXED (operandType (right)))) + { + lit = ulFromVal (AOP (right)->aopu.aop_lit); + + /* patch tag for literals that are cast to pointers */ + if (IS_CODEPTR (restype)) + { + //fprintf (stderr, "%s:%u: INFO: `(__code*)literal'\n", ic->filename, ic->lineno); + lit = (lit & 0x00ffff) | (GPTR_TAG_CODE << 16); + } + else + { + if (IS_GENPTR (restype)) + { + if (IS_CODEPTR (rtype)) + { + //fprintf (stderr, "%s:%u: INFO: `(generic*)(literal __code*)'\n", ic->filename, ic->lineno); + lit = (lit & 0x00ffff) | (GPTR_TAG_CODE << 16); + } + else if (PIC_IS_DATA_PTR (rtype)) + { + //fprintf (stderr, "%s:%u: INFO: `(generic*)(literal __data*)'\n", ic->filename, ic->lineno); + lit = (lit & 0x00ffff) | (GPTR_TAG_DATA << 16); + } + else if (!IS_PTR (rtype) || IS_GENPTR (rtype)) + { + //fprintf (stderr, "%s:%u: INFO: `(generic*)literal' -- accepting specified tag %02x\n", ic->filename, ic->lineno, (unsigned char)(lit >> 16)); + } + else if (IS_PTR (rtype)) + { + fprintf (stderr, "%s:%u: WARNING: `(generic*)literal' -- assuming __data space\n", ic->filename, + ic->lineno); + lit = (lit & 0x00ffff) | (GPTR_TAG_DATA << 16); + } + } + } } - } - } else { - union { - unsigned long lit_int; - float lit_float; - } info; + else + { + union + { + unsigned long lit_int; + float lit_float; + } info; - if(IS_FIXED16X16(operandType(right))) { - lit = (unsigned long)fixed16x16FromDouble( floatFromVal( AOP(right)->aopu.aop_lit)); - } else { - /* take care if literal is a float */ - info.lit_float = floatFromVal(AOP(right)->aopu.aop_lit); - lit = info.lit_int; - } + if (IS_FIXED16X16 (operandType (right))) + { + lit = (unsigned long) fixed16x16FromDouble (floatFromVal (AOP (right)->aopu.aop_lit)); + } + else + { + /* take care if literal is a float */ + info.lit_float = (float)floatFromVal (AOP (right)->aopu.aop_lit); + lit = info.lit_int; + } + } } - } // fprintf(stderr, "%s:%d: assigning value 0x%04lx (%d:%d)\n", __FUNCTION__, __LINE__, lit, // sizeof(unsigned long int), sizeof(float)); - if (AOP_TYPE(right) == AOP_REG) { - DEBUGpic16_emitcode("; ", "%s:%d assign from register\n", __FUNCTION__, __LINE__); - while (size--) { - pic16_emitpcode (POC_MOVFF, pic16_popGet2(AOP(right), AOP(result), offset++)); - } // while + if (AOP_TYPE (right) == AOP_REG) + { + DEBUGpic16_emitcode ("; ", "%s:%d assign from register\n", __FUNCTION__, __LINE__); + while (size--) + { + pic16_emitpcode (POC_MOVFF, pic16_popGet2 (AOP (right), AOP (result), offset++)); + } // while goto release; } - /* when do we have to read the program memory? - * - if right itself is a symbol in code space - * (we don't care what it points to if it's a pointer) - * - AND right is not a function (we would want its address) - */ - if(AOP_TYPE(right) != AOP_LIT - && IN_CODESPACE(SPEC_OCLS(OP_SYM_ETYPE(right))) - && !IS_FUNC(OP_SYM_TYPE(right)) - && !IS_ITEMP(right)) { + /* when do we have to read the program memory? + * - if right itself is a symbol in code space + * (we don't care what it points to if it's a pointer) + * - AND right is not a function (we would want its address) + */ + if (AOP_TYPE (right) != AOP_LIT + && IN_CODESPACE (SPEC_OCLS (OP_SYM_ETYPE (right))) && !IS_FUNC (OP_SYM_TYPE (right)) && !IS_ITEMP (right)) + { - DEBUGpic16_emitcode("; ", "%s:%d symbol in code space, take special care\n", __FUNCTION__, __LINE__); + DEBUGpic16_emitcode ("; ", "%s:%d symbol in code space, take special care\n", __FUNCTION__, __LINE__); //fprintf(stderr, "%s:%d symbol %s = [ %s ] is in code space\n", __FILE__, __LINE__, OP_SYMBOL(result)->name, OP_SYMBOL(right)->name); // set up table pointer - if(pic16_isLitOp(right)) { + if (pic16_isLitOp (right)) + { // fprintf(stderr, "%s:%d inside block 1\n", __FILE__, __LINE__); - pic16_emitpcode(POC_MOVLW,pic16_popGet(AOP(right),0)); - pic16_emitpcode(POC_MOVWF,pic16_popCopyReg(&pic16_pc_tblptrl)); - pic16_emitpcode(POC_MOVLW,pic16_popGet(AOP(right),1)); - pic16_emitpcode(POC_MOVWF,pic16_popCopyReg(&pic16_pc_tblptrh)); - pic16_emitpcode(POC_MOVLW,pic16_popGet(AOP(right),2)); - pic16_emitpcode(POC_MOVWF,pic16_popCopyReg(&pic16_pc_tblptru)); - } else { + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (right), 0)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_tblptrl)); + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (right), 1)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_tblptrh)); + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (right), 2)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_tblptru)); + } + else + { // fprintf(stderr, "%s:%d inside block 2\n", __FILE__, __LINE__); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popGet(AOP(right),0), - pic16_popCopyReg(&pic16_pc_tblptrl))); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popGet(AOP(right),1), - pic16_popCopyReg(&pic16_pc_tblptrh))); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popGet(AOP(right),2), - pic16_popCopyReg(&pic16_pc_tblptru))); - } + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popGet (AOP (right), 0), pic16_popCopyReg (&pic16_pc_tblptrl))); + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popGet (AOP (right), 1), pic16_popCopyReg (&pic16_pc_tblptrh))); + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popGet (AOP (right), 2), pic16_popCopyReg (&pic16_pc_tblptru))); + } /* must fetch 3 bytes for pointers (was OP_SYM_ETYPE before) */ - size = min(getSize(OP_SYM_TYPE(right)), AOP_SIZE(result)); - while(size--) { - pic16_emitpcodeNULLop(POC_TBLRD_POSTINC); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popCopyReg(&pic16_pc_tablat), - pic16_popGet(AOP(result),offset))); - offset++; - } + size = min ((int)getSize (OP_SYM_TYPE (right)), AOP_SIZE (result)); + while (size--) + { + pic16_emitpcodeNULLop (POC_TBLRD_POSTINC); + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popCopyReg (&pic16_pc_tablat), + pic16_popGet (AOP (result), offset))); + offset++; + } /* FIXME: for pointers we need to extend differently (according * to pointer type DATA/CODE/EEPROM/... :*/ - size = getSize(OP_SYM_TYPE(right)); - if(AOP_SIZE(result) > size) { - size = AOP_SIZE(result) - size; - while(size--) { - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result), offset)); - offset++; + size = getSize (OP_SYM_TYPE (right)); + if (AOP_SIZE (result) > size) + { + size = AOP_SIZE (result) - size; + while (size--) + { + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offset)); + offset++; + } } - } goto release; } #if 0 - /* VR - What is this?! */ - if( AOP_TYPE(right) == AOP_DIR && (AOP_TYPE(result) == AOP_REG) && size==1) { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - if(aopIdx(AOP(result),0) == 4) { - /* this is a workaround to save value of right into wreg too, - * value of wreg is going to be used later */ - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(right),offset)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offset)); - goto release; - } else + /* VR - What is this?! */ + if (AOP_TYPE (right) == AOP_DIR && (AOP_TYPE (result) == AOP_REG) && size == 1) + { + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + + if (aopIdx (AOP (result), 0) == 4) + { + /* this is a workaround to save value of right into wreg too, + * value of wreg is going to be used later */ + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (right), offset)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + goto release; + } + else // assert(0); - DEBUGpic16_emitcode ("; WARNING","%s %d ignoring register storage",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; WARNING", "%s %d ignoring register storage", __FUNCTION__, __LINE__); } #endif - size = AOP_SIZE(right); - if (size > AOP_SIZE(result)) size = AOP_SIZE(result); - know_W=-1; - while (size--) { - DEBUGpic16_emitcode ("; ***","%s %d size %d",__FUNCTION__,__LINE__, size); - if(AOP_TYPE(right) == AOP_LIT) { - if(lit&0xff) { - if(know_W != (lit&0xff)) - pic16_emitpcode(POC_MOVLW,pic16_popGetLit(lit&0xff)); - know_W = lit&0xff; - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offset)); - } else - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),offset)); - - lit >>= 8; - - } else if (AOP_TYPE(right) == AOP_CRY) { - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),offset)); - if(offset == 0) { - //debugf("%s: BTFSS offset == 0\n", __FUNCTION__); - pic16_emitpcode(POC_BTFSC, pic16_popGet(AOP(right),0)); - pic16_emitpcode(POC_INCF, pic16_popGet(AOP(result),0)); - } - } else if ( (AOP_TYPE(right) == AOP_PCODE) && (AOP(right)->aopu.pcop->type == PO_IMMEDIATE) ) { - pic16_emitpcode(POC_MOVLW, pic16_popGet(AOP(right),offset)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offset)); - } else { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - if(!_G.resDirect) { /* use this aopForSym feature */ - if(AOP_TYPE(result) == AOP_ACC) { - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(right), offset)); - } else - if(AOP_TYPE(right) == AOP_ACC) { - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), offset)); - } else { - pic16_emitpcode(POC_MOVFF, pic16_popGet2(AOP(right), AOP(result), offset)); + size = AOP_SIZE (right); + if (size > AOP_SIZE (result)) + size = AOP_SIZE (result); + know_W = -1; + while (size--) + { + DEBUGpic16_emitcode ("; ***", "%s %d size %d", __FUNCTION__, __LINE__, size); + if (AOP_TYPE (right) == AOP_LIT) + { + if (lit & 0xff) + { + if (know_W != (lit & 0xff)) + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (lit & 0xff)); + know_W = lit & 0xff; + + if (AOP_TYPE (result) != AOP_ACC) + { + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + } + } + else + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offset)); + + lit >>= 8; + + } + else if (AOP_TYPE (right) == AOP_CRY) + { + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offset)); + if (offset == 0) + { + //debugf("%s: BTFSS offset == 0\n", __FUNCTION__); + pic16_emitpcode (POC_BTFSC, pic16_popGet (AOP (right), 0)); + pic16_emitpcode (POC_INCF, pic16_popGet (AOP (result), 0)); + } + } + else if ((AOP_TYPE (right) == AOP_PCODE) && (AOP (right)->aopu.pcop->type == PO_IMMEDIATE)) + { + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (right), offset)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + } + else + { + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); + + if (!_G.resDirect) /* use this aopForSym feature */ + { + if (AOP_TYPE (result) == AOP_ACC) + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (right), offset)); + } + else if (AOP_TYPE (right) == AOP_ACC) + { + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + } + else + { + pic16_emitpcode (POC_MOVFF, pic16_popGet2 (AOP (right), AOP (result), offset)); + } } } - } offset++; } - pic16_addSign(result, AOP_SIZE(right), !IS_UNSIGNED(operandType(right))); + pic16_addSign (result, AOP_SIZE (right), !IS_UNSIGNED (operandType (right))); release: - pic16_freeAsmop (result,NULL,ic,TRUE); - pic16_freeAsmop (right,NULL,ic,FALSE); + pic16_freeAsmop (result, NULL, ic, TRUE); + pic16_freeAsmop (right, NULL, ic, FALSE); } /*-----------------------------------------------------------------*/ /* genJumpTab - generates code for jump table */ /*-----------------------------------------------------------------*/ -static void genJumpTab (iCode *ic) +static void +genJumpTab (iCode * ic) { symbol *jtab; char *l; - pCodeOp *jt_offs; - pCodeOp *jt_offs_hi; pCodeOp *jt_label; - FENTRY; - - pic16_aopOp(IC_JTCOND(ic),ic,FALSE); - /* get the condition into accumulator */ - l = pic16_aopGet(AOP(IC_JTCOND(ic)),0,FALSE,FALSE); - MOVA(l); - /* multiply by three */ - pic16_emitcode("add","a,acc"); - pic16_emitcode("add","a,%s",pic16_aopGet(AOP(IC_JTCOND(ic)),0,FALSE,FALSE)); - - jtab = newiTempLabel(NULL); - pic16_emitcode("mov","dptr,#%05d_DS_",jtab->key+100); - pic16_emitcode("jmp","@a+dptr"); - pic16_emitcode("","%05d_DS_:",jtab->key+100); + FENTRY; -#if 0 - pic16_emitpcode(POC_MOVLW, pic16_popGetLabel(jtab->key)); - pic16_emitpcode(POC_ADDFW, pic16_popGet(AOP(IC_JTCOND(ic)),0)); - emitSKPNC; - pic16_emitpcode(POC_INCF, pic16_popCopyReg(&pic16_pc_pclath)); - pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_pcl)); - pic16_emitpLabel(jtab->key); + pic16_aopOp (IC_JTCOND (ic), ic, FALSE); + /* get the condition into accumulator */ + l = pic16_aopGet (AOP (IC_JTCOND (ic)), 0, FALSE, FALSE); + MOVA (l); + /* multiply by three */ + pic16_emitcode ("add", "a,acc"); + pic16_emitcode ("add", "a,%s", pic16_aopGet (AOP (IC_JTCOND (ic)), 0, FALSE, FALSE)); + + jtab = newiTempLabel (NULL); + pic16_emitcode ("mov", "dptr,#%05d_DS_", labelKey2num (jtab->key)); + pic16_emitcode ("jmp", "@a+dptr"); + pic16_emitcode ("", "%05d_DS_:", labelKey2num (jtab->key)); + +#if 0 + pic16_emitpcode (POC_MOVLW, pic16_popGetLabel (jtab->key)); + pic16_emitpcode (POC_ADDFW, pic16_popGet (AOP (IC_JTCOND (ic)), 0)); + emitSKPNC; + pic16_emitpcode (POC_INCF, pic16_popCopyReg (&pic16_pc_pclath)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_pcl)); + pic16_emitpLabel (jtab->key); #else - jt_offs = pic16_popGetTempReg(0); - jt_offs_hi = pic16_popGetTempReg(1); - jt_label = pic16_popGetLabel (jtab->key); - //fprintf (stderr, "Creating jump table...\n"); - - // calculate offset into jump table (idx * sizeof (GOTO)) - pic16_emitpcode(POC_CLRF , jt_offs_hi); - pic16_emitpcode(POC_RLCFW , pic16_popGet(AOP(IC_JTCOND(ic)),0)); - pic16_emitpcode(POC_RLCF , jt_offs_hi); - pic16_emitpcode(POC_RLCFW , pic16_popCopyReg(&pic16_pc_wreg)); - pic16_emitpcode(POC_RLCF , jt_offs_hi); - pic16_emitpcode(POC_ANDLW , pic16_popGetLit (0xFC)); - pic16_emitpcode(POC_MOVWF , jt_offs); - - // prepare PCLATx (set to first entry in jump table) - pic16_emitpcode(POC_MOVLW , pic16_popGetImmd(jt_label->name, 2, 0)); - pic16_emitpcode(POC_MOVWF , pic16_popCopyReg(&pic16_pc_pclatu)); - pic16_emitpcode(POC_MOVLW , pic16_popGetImmd(jt_label->name, 1, 0)); - pic16_emitpcode(POC_MOVWF , pic16_popCopyReg(&pic16_pc_pclath)); - pic16_emitpcode(POC_MOVLW , pic16_popGetImmd(jt_label->name, 0, 0)); - - // set PCLATx to selected entry (new PCL is stored in jt_offs) - pic16_emitpcode(POC_ADDWF , jt_offs); - pic16_emitpcode(POC_MOVFW , jt_offs_hi); - pic16_emitpcode(POC_ADDWFC, pic16_popCopyReg(&pic16_pc_pclath)); - emitSKPNC; - pic16_emitpcode(POC_INCF , pic16_popCopyReg(&pic16_pc_pclatu)); - - // release temporaries and prepare jump into table (new PCL --> WREG) - pic16_emitpcode(POC_MOVFW , jt_offs); - pic16_popReleaseTempReg (jt_offs_hi, 1); - pic16_popReleaseTempReg (jt_offs, 0); + jt_label = pic16_popGetLabel (jtab->key); + //fprintf (stderr, "Creating jump table...\n"); - // jump into the table - pic16_emitpcode(POC_MOVWF , pic16_popCopyReg(&pic16_pc_pcl)); + // calculate offset into jump table (idx * sizeof(GOTO)) + // This solution does not use temporary registers and the code is shorter. + pic16_emitpcode (POC_CLRF , pic16_popCopyReg (&pic16_pc_pclath)); + pic16_emitpcode (POC_CLRF , pic16_popCopyReg (&pic16_pc_pclatu)); + pic16_emitpcode (POC_RLCFW , pic16_popGet (AOP (IC_JTCOND (ic)), 0)); + pic16_emitpcode (POC_RLCF , pic16_popCopyReg (&pic16_pc_pclath)); + pic16_emitpcode (POC_RLCFW , pic16_popCopyReg (&pic16_pc_wreg)); + pic16_emitpcode (POC_RLCF , pic16_popCopyReg (&pic16_pc_pclath)); + pic16_emitpcode (POC_ANDLW , pic16_popGetLit (0xFC)); + pic16_emitpcode (POC_ADDLW , pic16_popGetImmd (jt_label->name, 0, 0)); + pic16_emitpcode (POC_MOVWF , pic16_popCopyReg (pic16_stack_postdec)); + pic16_emitpcode (POC_MOVLW , pic16_popGetImmd (jt_label->name, 1, 0)); + pic16_emitpcode (POC_ADDWFC, pic16_popCopyReg (&pic16_pc_pclath)); + pic16_emitpcode (POC_MOVLW , pic16_popGetImmd (jt_label->name, 2, 0)); + pic16_emitpcode (POC_ADDWFC, pic16_popCopyReg (&pic16_pc_pclatu)); + + // jump into the table + pic16_emitpcode (POC_MOVFW, pic16_popCopyReg (pic16_stack_preinc)); + pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (&pic16_pc_pcl)); - pic16_emitpLabelFORCE(jtab->key); + pic16_emitpLabelFORCE (jtab->key); #endif - pic16_freeAsmop(IC_JTCOND(ic),NULL,ic,TRUE); + pic16_freeAsmop (IC_JTCOND (ic), NULL, ic, TRUE); // pic16_emitpinfo(INF_LOCALREGS, pic16_newpCodeOpLocalRegs(LR_ENTRY_BEGIN)); - pic16_emitpinfo (INF_OPTIMIZATION, pic16_newpCodeOpOpt (OPT_JUMPTABLE_BEGIN, "")); - /* now generate the jump labels */ - for (jtab = setFirstItem(IC_JTLABELS(ic)) ; jtab; - jtab = setNextItem(IC_JTLABELS(ic))) { -// pic16_emitcode("ljmp","%05d_DS_",jtab->key+100); - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(jtab->key)); + pic16_emitpinfo (INF_OPTIMIZATION, pic16_newpCodeOpOpt (OPT_JUMPTABLE_BEGIN, "")); + /* now generate the jump labels */ + for (jtab = setFirstItem (IC_JTLABELS (ic)); jtab; jtab = setNextItem (IC_JTLABELS (ic))) + { +// pic16_emitcode("ljmp","%05d_DS_",labelKey2num (jtab->key)); + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (jtab->key)); } - pic16_emitpinfo (INF_OPTIMIZATION, pic16_newpCodeOpOpt (OPT_JUMPTABLE_END, "")); + pic16_emitpinfo (INF_OPTIMIZATION, pic16_newpCodeOpOpt (OPT_JUMPTABLE_END, "")); } @@ -9490,119 +10636,137 @@ used in other places. So until I know how to really parse the iCode tree, I'm going to not be using this routine :(. */ -static int genMixedOperation (iCode *ic) +static int +genMixedOperation (iCode * ic) { #if 0 - operand *result = IC_RESULT(ic); - sym_link *ctype = operandType(IC_LEFT(ic)); - operand *right = IC_RIGHT(ic); + operand *result = IC_RESULT (ic); + sym_link *ctype = operandType (IC_LEFT (ic)); + operand *right = IC_RIGHT (ic); int ret = 0; - int big,small; + int big, small; int offset; iCode *nextic; - operand *nextright=NULL,*nextleft=NULL,*nextresult=NULL; + operand *nextright = NULL, *nextleft = NULL, *nextresult = NULL; - pic16_emitcode("; ***","%s %d",__FUNCTION__,__LINE__); + pic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); nextic = ic->next; - if(!nextic) + if (!nextic) return 0; - nextright = IC_RIGHT(nextic); - nextleft = IC_LEFT(nextic); - nextresult = IC_RESULT(nextic); + nextright = IC_RIGHT (nextic); + nextleft = IC_LEFT (nextic); + nextresult = IC_RESULT (nextic); + + pic16_aopOp (right, ic, FALSE); + pic16_aopOp (result, ic, FALSE); + pic16_aopOp (nextright, nextic, FALSE); + pic16_aopOp (nextleft, nextic, FALSE); + pic16_aopOp (nextresult, nextic, FALSE); - pic16_aopOp(right,ic,FALSE); - pic16_aopOp(result,ic,FALSE); - pic16_aopOp(nextright, nextic, FALSE); - pic16_aopOp(nextleft, nextic, FALSE); - pic16_aopOp(nextresult, nextic, FALSE); - - if (pic16_sameRegs(AOP(IC_RESULT(ic)), AOP(IC_RIGHT(nextic)))) { + if (pic16_sameRegs (AOP (IC_RESULT (ic)), AOP (IC_RIGHT (nextic)))) + { - operand *t = right; - right = nextright; - nextright = t; + operand *t = right; + right = nextright; + nextright = t; - pic16_emitcode(";remove right +",""); + pic16_emitcode (";remove right +", ""); - } else if (pic16_sameRegs(AOP(IC_RESULT(ic)), AOP(IC_LEFT(nextic)))) { -/* - operand *t = right; - right = nextleft; - nextleft = t; -*/ - pic16_emitcode(";remove left +",""); - } else + } + else if (pic16_sameRegs (AOP (IC_RESULT (ic)), AOP (IC_LEFT (nextic)))) + { + /* + operand *t = right; + right = nextleft; + nextleft = t; + */ + pic16_emitcode (";remove left +", ""); + } + else return 0; - big = AOP_SIZE(nextleft); - small = AOP_SIZE(nextright); + big = AOP_SIZE (nextleft); + small = AOP_SIZE (nextright); + + switch (nextic->op) + { + + case '+': + pic16_emitcode (";optimize a +", ""); + /* if unsigned or not an integral type */ + if (AOP_TYPE (IC_LEFT (nextic)) == AOP_CRY) + { + pic16_emitcode (";add a bit to something", ""); + } + else + { - switch(nextic->op) { + pic16_emitcode ("movf", "%s,w", AOP (nextright)->aopu.aop_dir); - case '+': - pic16_emitcode(";optimize a +",""); - /* if unsigned or not an integral type */ - if (AOP_TYPE(IC_LEFT(nextic)) == AOP_CRY) { - pic16_emitcode(";add a bit to something",""); - } else { - - pic16_emitcode("movf","%s,w",AOP(nextright)->aopu.aop_dir); - - if (!pic16_sameRegs(AOP(IC_LEFT(nextic)), AOP(IC_RESULT(nextic))) ) { - pic16_emitcode("addwf","%s,w",AOP(nextleft)->aopu.aop_dir); - pic16_emitcode("movwf","%s",pic16_aopGet(AOP(IC_RESULT(nextic)),0,FALSE,FALSE)); - } else - pic16_emitcode("addwf","%s,f",AOP(nextleft)->aopu.aop_dir); + if (!pic16_sameRegs (AOP (IC_LEFT (nextic)), AOP (IC_RESULT (nextic)))) + { + pic16_emitcode ("addwf", "%s,w", AOP (nextleft)->aopu.aop_dir); + pic16_emitcode ("movwf", "%s", pic16_aopGet (AOP (IC_RESULT (nextic)), 0, FALSE, FALSE)); + } + else + pic16_emitcode ("addwf", "%s,f", AOP (nextleft)->aopu.aop_dir); - offset = 0; - while(--big) { + offset = 0; + while (--big) + { - offset++; + offset++; - if(--small) { - if (!pic16_sameRegs(AOP(IC_LEFT(nextic)), AOP(IC_RESULT(nextic))) ){ - pic16_emitcode("movf","%s,w",pic16_aopGet(AOP(IC_LEFT(nextic)),offset,FALSE,FALSE)); - pic16_emitcode("movwf","%s,f",pic16_aopGet(AOP(IC_RESULT(nextic)),offset,FALSE,FALSE) ); - } + if (--small) + { + if (!pic16_sameRegs (AOP (IC_LEFT (nextic)), AOP (IC_RESULT (nextic)))) + { + pic16_emitcode ("movf", "%s,w", pic16_aopGet (AOP (IC_LEFT (nextic)), offset, FALSE, FALSE)); + pic16_emitcode ("movwf", "%s,f", pic16_aopGet (AOP (IC_RESULT (nextic)), offset, FALSE, FALSE)); + } - pic16_emitcode("movf","%s,w", pic16_aopGet(AOP(IC_LEFT(nextic)),offset,FALSE,FALSE)); - emitSKPNC; - pic16_emitcode("btfsc","(%s >> 3), (%s & 7)", - AOP(IC_RIGHT(nextic))->aopu.aop_dir, - AOP(IC_RIGHT(nextic))->aopu.aop_dir); - pic16_emitcode(" incf","%s,w", pic16_aopGet(AOP(IC_LEFT(nextic)),offset,FALSE,FALSE)); - pic16_emitcode("movwf","%s", pic16_aopGet(AOP(IC_RESULT(nextic)),offset,FALSE,FALSE)); + pic16_emitcode ("movf", "%s,w", pic16_aopGet (AOP (IC_LEFT (nextic)), offset, FALSE, FALSE)); + emitSKPNC; + pic16_emitcode ("btfsc", "(%s >> 3), (%s & 7)", + AOP (IC_RIGHT (nextic))->aopu.aop_dir, AOP (IC_RIGHT (nextic))->aopu.aop_dir); + pic16_emitcode (" incf", "%s,w", pic16_aopGet (AOP (IC_LEFT (nextic)), offset, FALSE, FALSE)); + pic16_emitcode ("movwf", "%s", pic16_aopGet (AOP (IC_RESULT (nextic)), offset, FALSE, FALSE)); - } else { - pic16_emitcode("rlf","known_zero,w"); + } + else + { + pic16_emitcode ("rlf", "known_zero,w"); - /* - if right is signed - btfsc right,7 - addlw ff - */ - if (!pic16_sameRegs(AOP(IC_LEFT(nextic)), AOP(IC_RESULT(nextic))) ){ - pic16_emitcode("addwf","%s,w",pic16_aopGet(AOP(IC_LEFT(nextic)),offset,FALSE,FALSE)); - pic16_emitcode("movwf","%s,f",pic16_aopGet(AOP(IC_RESULT(nextic)),offset,FALSE,FALSE) ); - } else { - pic16_emitcode("addwf","%s,f",pic16_aopGet(AOP(IC_RESULT(nextic)),offset,FALSE,FALSE) ); - } + /* + if right is signed + btfsc right,7 + addlw ff + */ + if (!pic16_sameRegs (AOP (IC_LEFT (nextic)), AOP (IC_RESULT (nextic)))) + { + pic16_emitcode ("addwf", "%s,w", pic16_aopGet (AOP (IC_LEFT (nextic)), offset, FALSE, FALSE)); + pic16_emitcode ("movwf", "%s,f", pic16_aopGet (AOP (IC_RESULT (nextic)), offset, FALSE, FALSE)); + } + else + { + pic16_emitcode ("addwf", "%s,f", pic16_aopGet (AOP (IC_RESULT (nextic)), offset, FALSE, FALSE)); + } + } + } + ret = 1; } - } - ret = 1; } - } ret = 1; release: - pic16_freeAsmop(right,NULL,ic,TRUE); - pic16_freeAsmop(result,NULL,ic,TRUE); - pic16_freeAsmop(nextright,NULL,ic,TRUE); - pic16_freeAsmop(nextleft,NULL,ic,TRUE); - if(ret) + pic16_freeAsmop (right, NULL, ic, TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); + pic16_freeAsmop (nextright, NULL, ic, TRUE); + pic16_freeAsmop (nextleft, NULL, ic, TRUE); + if (ret) nextic->generated = 1; return ret; @@ -9610,477 +10774,514 @@ return 0; #endif } + /*-----------------------------------------------------------------*/ /* genCast - gen code for casting */ /*-----------------------------------------------------------------*/ -static void genCast (iCode *ic) +static void +genCast (iCode * ic) { - operand *result = IC_RESULT(ic); - sym_link *ctype = operandType(IC_LEFT(ic)); - sym_link *rtype = operandType(IC_RIGHT(ic)); - sym_link *restype = operandType(IC_RESULT(ic)); - operand *right = IC_RIGHT(ic); - int size, offset ; + operand *result = IC_RESULT (ic); + sym_link *ctype = operandType (IC_LEFT (ic)); + sym_link *rtype = operandType (IC_RIGHT (ic)); + sym_link *restype = operandType (IC_RESULT (ic)); + operand *right = IC_RIGHT (ic); + int size, offset; - FENTRY; + FENTRY; - /* if they are equivalent then do nothing */ + /* if they are equivalent then do nothing */ // if (operandsEqu(IC_RESULT(ic),IC_RIGHT(ic))) // return ; - pic16_aopOp(result,ic,FALSE); - pic16_aopOp(right,ic,FALSE) ; + pic16_aopOp (result, ic, FALSE); + pic16_aopOp (right, ic, FALSE); - DEBUGpic16_pic16_AopType(__LINE__,NULL,right,result); + DEBUGpic16_pic16_AopType (__LINE__, NULL, right, result); - /* if the result is a bit */ - if (AOP_TYPE(result) == AOP_CRY) { + /* if the result is a bit */ + if (AOP_TYPE (result) == AOP_CRY) + { - /* if the right size is a literal then - * we know what the value is */ - DEBUGpic16_emitcode("; ***","%s %d",__FUNCTION__,__LINE__); + /* if the right size is a literal then + * we know what the value is */ + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - if (AOP_TYPE(right) == AOP_LIT) { - pic16_emitpcode( ( ((int) operandLitValue(right)) ? POC_BSF : POC_BCF), - pic16_popGet(AOP(result),0)); + if (AOP_TYPE (right) == AOP_LIT) + { + pic16_emitpcode ((((int) operandLitValue (right)) ? POC_BSF : POC_BCF), pic16_popGet (AOP (result), 0)); - if (((int) operandLitValue(right))) - pic16_emitcode("bsf","(%s >> 3), (%s & 7)", - AOP(result)->aopu.aop_dir, - AOP(result)->aopu.aop_dir); - else - pic16_emitcode("bcf","(%s >> 3), (%s & 7)", - AOP(result)->aopu.aop_dir, - AOP(result)->aopu.aop_dir); - goto release; - } + if (((int) operandLitValue (right))) + pic16_emitcode ("bsf", "(%s >> 3), (%s & 7)", AOP (result)->aopu.aop_dir, AOP (result)->aopu.aop_dir); + else + pic16_emitcode ("bcf", "(%s >> 3), (%s & 7)", AOP (result)->aopu.aop_dir, AOP (result)->aopu.aop_dir); + goto release; + } - /* the right is also a bit variable */ - if (AOP_TYPE(right) == AOP_CRY) { - emitCLRC; - pic16_emitpcode(POC_BTFSC, pic16_popGet(AOP(right),0)); + /* the right is also a bit variable */ + if (AOP_TYPE (right) == AOP_CRY) + { + emitCLRC; + pic16_emitpcode (POC_BTFSC, pic16_popGet (AOP (right), 0)); - pic16_emitcode("clrc",""); - pic16_emitcode("btfsc","(%s >> 3), (%s & 7)", - AOP(right)->aopu.aop_dir, - AOP(right)->aopu.aop_dir); - pic16_aopPut(AOP(result),"c",0); - goto release ; - } + pic16_emitcode ("clrc", ""); + pic16_emitcode ("btfsc", "(%s >> 3), (%s & 7)", AOP (right)->aopu.aop_dir, AOP (right)->aopu.aop_dir); + pic16_aopPut (AOP (result), "c", 0); + goto release; + } - /* we need to or */ - if (AOP_TYPE(right) == AOP_REG) { - pic16_emitpcode(POC_BCF, pic16_popGet(AOP(result),0)); - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit(pic16_aopGet(AOP(right),0,FALSE,FALSE),0,0, PO_GPR_REGISTER)); - pic16_emitpcode(POC_BSF, pic16_popGet(AOP(result),0)); - } - pic16_toBoolean(right); - pic16_aopPut(AOP(result),"a",0); - goto release ; + /* we need to or */ + if (AOP_TYPE (right) == AOP_REG) + { + pic16_emitpcode (POC_BCF, pic16_popGet (AOP (result), 0)); + pic16_emitpcode (POC_BTFSC, pic16_newpCodeOpBit (pic16_aopGet (AOP (right), 0, FALSE, FALSE), 0, 0, PO_GPR_REGISTER)); + pic16_emitpcode (POC_BSF, pic16_popGet (AOP (result), 0)); } + pic16_toBoolean (right); + pic16_aopPut (AOP (result), "a", 0); + goto release; + } - if ((AOP_TYPE(right) == AOP_CRY) && (AOP_TYPE(result) == AOP_REG)) { - int offset = 1; + if ((AOP_TYPE (right) == AOP_CRY) && (AOP_TYPE (result) == AOP_REG)) + { + int offset = 1; - size = AOP_SIZE(result); + size = AOP_SIZE (result); - DEBUGpic16_emitcode("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),0)); - pic16_emitpcode(POC_BTFSC, pic16_popGet(AOP(right),0)); - pic16_emitpcode(POC_INCF, pic16_popGet(AOP(result),0)); + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), 0)); + pic16_emitpcode (POC_BTFSC, pic16_popGet (AOP (right), 0)); + pic16_emitpcode (POC_INCF, pic16_popGet (AOP (result), 0)); - while (size--) - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),offset++)); + while (size--) + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offset++)); - goto release; - } - - if (IS_BOOL(operandType(result))) - { - pic16_toBoolean (right); - emitSKPNZ; - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(1)); - pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(result),0)); - goto release; - } + goto release; + } - if(IS_BITFIELD(getSpec(restype)) - && IS_BITFIELD(getSpec(rtype))) { - DEBUGpic16_emitcode("***", "%d casting a bit to another bit", __LINE__); - } + if (IS_BOOL (operandType (result))) + { + pic16_toBoolean (right); + emitSKPNZ; + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (1)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); + goto release; + } - /* port from pic14 to cope with generic pointers */ - if (PIC_IS_TAGGED(restype)) - { - operand *result = IC_RESULT(ic); - //operand *left = IC_LEFT(ic); - operand *right = IC_RIGHT(ic); - int tag = 0xff; + if (IS_BITFIELD (getSpec (restype)) && IS_BITFIELD (getSpec (rtype))) + { + DEBUGpic16_emitcode ("***", "%d casting a bit to another bit", __LINE__); + } - /* copy common part */ - int max, size = AOP_SIZE(result); - if (size > AOP_SIZE(right)) size = AOP_SIZE(right); - DEBUGpic16_emitcode("; ***","%s %d",__FUNCTION__,__LINE__); + /* port from pic14 to cope with generic pointers */ + if (PIC_IS_TAGGED (restype)) + { + operand *result = IC_RESULT (ic); + //operand *left = IC_LEFT(ic); + operand *right = IC_RIGHT (ic); + int tag = 0xff; + + /* copy common part */ + int max, size = AOP_SIZE (result); + if (size > AOP_SIZE (right)) + size = AOP_SIZE (right); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - max = size; - while (size--) - { - pic16_mov2w (AOP(right), size); - pic16_emitpcode(POC_MOVWF, pic16_popGet (AOP(result), size)); - } // while - - /* upcast into generic pointer type? */ - if (IS_GENPTR(restype) - && !PIC_IS_TAGGED(rtype) - && (AOP_SIZE(result) > max)) - { - /* determine appropriate tag for right */ - if (PIC_IS_DATA_PTR(rtype)) - tag = GPTR_TAG_DATA; - else if (IS_CODEPTR(rtype)) - tag = GPTR_TAG_CODE; - else if (PIC_IS_DATA_PTR(ctype)) { + max = size; + while (size--) + { + pic16_mov2w (AOP (right), size); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), size)); + } // while + + /* upcast into generic pointer type? */ + if (IS_GENPTR (restype) && !PIC_IS_TAGGED (rtype) && (AOP_SIZE (result) > max)) + { + /* determine appropriate tag for right */ + if (PIC_IS_DATA_PTR (rtype)) + tag = GPTR_TAG_DATA; + else if (IS_CODEPTR (rtype)) + tag = GPTR_TAG_CODE; + else if (PIC_IS_DATA_PTR (ctype)) + { //fprintf (stderr, "%s:%u: WARNING: casting `(generic*)(__data*)(non-pointer)'\n", ic->filename, ic->lineno); tag = GPTR_TAG_DATA; - } else if (IS_CODEPTR(ctype)) { + } + else if (IS_CODEPTR (ctype)) + { //fprintf (stderr, "%s:%u: WARNING: casting `(generic*)(__code*)(non-pointer)'\n", ic->filename, ic->lineno); tag = GPTR_TAG_CODE; - } else if (IS_PTR(rtype)) { - PERFORM_ONCE(weirdcast, - fprintf (stderr, "%s:%u: WARNING: casting `(generic*)(unknown*)' -- assuming __data space\n", ic->filename, ic->lineno); - ); + } + else if (IS_PTR (rtype)) + { + PERFORM_ONCE (weirdcast, + fprintf (stderr, "%s:%u: WARNING: casting `(generic*)(unknown*)' -- assuming __data space\n", + ic->filename, ic->lineno);); tag = GPTR_TAG_DATA; - } else { - PERFORM_ONCE(weirdcast, - fprintf (stderr, "%s:%u: WARNING: casting `(generic*)(non-pointer)' -- assuming __data space\n", ic->filename, ic->lineno); - ); + } + else + { + PERFORM_ONCE (weirdcast, + fprintf (stderr, "%s:%u: WARNING: casting `(generic*)(non-pointer)' -- assuming __data space\n", + ic->filename, ic->lineno);); tag = GPTR_TAG_DATA; } - assert (AOP_SIZE(result) == 3); - /* zero-extend address... */ - for (size = max; size < AOP_SIZE(result)-1; size++) - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),size)); - /* ...and add tag */ - pic16_movLit2f(pic16_popGet(AOP(result), AOP_SIZE(result)-1), tag); - } else if (IS_CODEPTR(restype) && AOP_SIZE(result) > max) { - //fprintf (stderr, "%s:%u: INFO: code pointer\n", ic->filename, ic->lineno); - for (size = max; size < AOP_SIZE(result)-1; size++) - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result), size)); - /* add __code tag */ - pic16_movLit2f (pic16_popGet(AOP(result), AOP_SIZE(result)-1), GPTR_TAG_CODE); - } else if (AOP_SIZE(result) > max) { - /* extend non-pointers */ - //fprintf (stderr, "%s:%u: zero-extending value cast to pointer\n", ic->filename, ic->lineno); - pic16_addSign(result, max, 0); - } // if - goto release; + assert (AOP_SIZE (result) == 3); + /* zero-extend address... */ + for (size = max; size < AOP_SIZE (result) - 1; size++) + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), size)); + /* ...and add tag */ + pic16_movLit2f (pic16_popGet (AOP (result), AOP_SIZE (result) - 1), tag); + } + else if (IS_CODEPTR (restype) && AOP_SIZE (result) > max) + { + //fprintf (stderr, "%s:%u: INFO: code pointer\n", ic->filename, ic->lineno); + for (size = max; size < AOP_SIZE (result) - 1; size++) + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), size)); + /* add __code tag */ + pic16_movLit2f (pic16_popGet (AOP (result), AOP_SIZE (result) - 1), GPTR_TAG_CODE); } + else if (AOP_SIZE (result) > max) + { + /* extend non-pointers */ + //fprintf (stderr, "%s:%u: zero-extending value cast to pointer\n", ic->filename, ic->lineno); + pic16_addSign (result, max, 0); + } // if + goto release; + } - /* if they are the same size : or less */ - if (AOP_SIZE(result) <= AOP_SIZE(right)) { + /* if they are the same size : or less */ + if (AOP_SIZE (result) <= AOP_SIZE (right)) + { - /* if they are in the same place */ - if (pic16_sameRegs(AOP(right),AOP(result))) - goto release; + /* if they are in the same place */ + if (pic16_sameRegs (AOP (right), AOP (result))) + goto release; - DEBUGpic16_emitcode("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); #if 0 - if (IS_PTR_CONST(rtype)) + if (IS_PTR_CONST (rtype)) #else - if (IS_CODEPTR(rtype)) + if (IS_CODEPTR (rtype)) #endif - DEBUGpic16_emitcode ("; ***","%d - right is const pointer",__LINE__); + DEBUGpic16_emitcode ("; ***", "%d - right is const pointer", __LINE__); #if 0 - if (IS_PTR_CONST(operandType(IC_RESULT(ic)))) + if (IS_PTR_CONST (operandType (IC_RESULT (ic)))) #else - if (IS_CODEPTR(operandType(IC_RESULT(ic)))) + if (IS_CODEPTR (operandType (IC_RESULT (ic)))) #endif - DEBUGpic16_emitcode ("; ***","%d - result is const pointer",__LINE__); + DEBUGpic16_emitcode ("; ***", "%d - result is const pointer", __LINE__); - if ((AOP_TYPE(right) == AOP_PCODE) && AOP(right)->aopu.pcop->type == PO_IMMEDIATE) { - pic16_emitpcode(POC_MOVLW, pic16_popGet(AOP(right),0)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),0)); - - if(AOP_SIZE(result) < 2) { - fprintf(stderr,"%d -- casting a ptr to a char\n",__LINE__); - } else { - pic16_emitpcode(POC_MOVLW, pic16_popGet(AOP(right),1)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),1)); - } - } else { - /* if they in different places then copy */ - size = AOP_SIZE(result); - offset = 0 ; - while (size--) { - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(right),offset)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offset)); - offset++; - } - } - goto release; + if ((AOP_TYPE (right) == AOP_PCODE) && AOP (right)->aopu.pcop->type == PO_IMMEDIATE) + { + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (right), 0)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 0)); + + if (AOP_SIZE (result) < 2) + { + fprintf (stderr, "%d -- casting a ptr to a char\n", __LINE__); + } + else + { + pic16_emitpcode (POC_MOVLW, pic16_popGet (AOP (right), 1)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 1)); + } + } + else + { + /* if they in different places then copy */ + size = AOP_SIZE (result); + offset = 0; + while (size--) + { + pic16_emitpcode (POC_MOVFW, pic16_popGet (AOP (right), offset)); + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset)); + offset++; + } } + goto release; + } - /* if the result is of type pointer */ - if (IS_PTR(ctype)) { - int p_type; - sym_link *type = operandType(right); - sym_link *etype = getSpec(type); - - DEBUGpic16_emitcode("; ***","%s %d - pointer cast",__FUNCTION__,__LINE__); - - /* pointer to generic pointer */ - if (IS_GENPTR(ctype)) { - - if (IS_PTR(type)) - p_type = DCL_TYPE(type); - else { - /* we have to go by the storage class */ - p_type = PTR_TYPE(SPEC_OCLS(etype)); - -/* if (SPEC_OCLS(etype)->codesp ) */ -/* p_type = CPOINTER ; */ -/* else */ -/* if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */ -/* p_type = FPOINTER ; */ -/* else */ -/* if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */ -/* p_type = PPOINTER; */ -/* else */ -/* if (SPEC_OCLS(etype) == idata ) */ -/* p_type = IPOINTER ; */ -/* else */ -/* p_type = POINTER ; */ - } - - /* the first two bytes are known */ - DEBUGpic16_emitcode("; ***","%s %d - pointer cast2",__FUNCTION__,__LINE__); - size = GPTRSIZE - 1; - offset = 0 ; - while (size--) { - if(offset < AOP_SIZE(right)) { - DEBUGpic16_emitcode("; ***","%s %d - pointer cast3 ptype = 0x%x",__FUNCTION__,__LINE__, p_type); - pic16_mov2f(AOP(result), AOP(right), offset); -/* - if ((AOP_TYPE(right) == AOP_PCODE) && - AOP(right)->aopu.pcop->type == PO_IMMEDIATE) { - pic16_emitpcode(POC_MOVLW, pic16_popGet(AOP(right),offset)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offset)); - } else { - - pic16_aopPut(AOP(result), - pic16_aopGet(AOP(right),offset,FALSE,FALSE), - offset); + /* if the result is of type pointer */ + if (IS_PTR (ctype)) + { + int p_type; + sym_link *type = operandType (right); + sym_link *etype = getSpec (type); + + DEBUGpic16_emitcode ("; ***", "%s %d - pointer cast", __FUNCTION__, __LINE__); + + /* pointer to generic pointer */ + if (IS_GENPTR (ctype)) + { + + if (IS_PTR (type)) + p_type = DCL_TYPE (type); + else + { + /* we have to go by the storage class */ + p_type = PTR_TYPE (SPEC_OCLS (etype)); + + /* if (SPEC_OCLS(etype)->codesp ) */ + /* p_type = CPOINTER ; */ + /* else */ + /* if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */ + /* p_type = FPOINTER ; */ + /* else */ + /* if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */ + /* p_type = PPOINTER; */ + /* else */ + /* if (SPEC_OCLS(etype) == idata ) */ + /* p_type = IPOINTER ; */ + /* else */ + /* p_type = POINTER ; */ + } + + /* the first two bytes are known */ + DEBUGpic16_emitcode ("; ***", "%s %d - pointer cast2", __FUNCTION__, __LINE__); + size = GPTRSIZE - 1; + offset = 0; + while (size--) + { + if (offset < AOP_SIZE (right)) + { + DEBUGpic16_emitcode ("; ***", "%s %d - pointer cast3 ptype = 0x%x", __FUNCTION__, __LINE__, p_type); + pic16_mov2f (AOP (result), AOP (right), offset); + /* + if ((AOP_TYPE(right) == AOP_PCODE) && + AOP(right)->aopu.pcop->type == PO_IMMEDIATE) { + pic16_emitpcode(POC_MOVLW, pic16_popGet(AOP(right),offset)); + pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offset)); + } else { + + pic16_aopPut(AOP(result), + pic16_aopGet(AOP(right),offset,FALSE,FALSE), + offset); + } + */ } -*/ - } else - pic16_emitpcode(POC_CLRF,pic16_popGet(AOP(result),offset)); + else + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offset)); offset++; } - /* the last byte depending on type */ - switch (p_type) { + /* the last byte depending on type */ + switch (p_type) + { case POINTER: case FPOINTER: case IPOINTER: case PPOINTER: - pic16_movLit2f(pic16_popGet(AOP(result), GPTRSIZE-1), GPTR_TAG_DATA); - break; + pic16_movLit2f (pic16_popGet (AOP (result), GPTRSIZE - 1), GPTR_TAG_DATA); + break; case CPOINTER: - pic16_emitpcode(POC_MOVFF, pic16_popGet2(AOP(right), AOP(result), GPTRSIZE-1)); - break; + pic16_emitpcode (POC_MOVFF, pic16_popGet2 (AOP (right), AOP (result), GPTRSIZE - 1)); + break; case GPOINTER: - if (GPTRSIZE > AOP_SIZE(right)) { + if (GPTRSIZE > AOP_SIZE (right)) + { // assume __data pointer... THIS MIGHT BE WRONG! - pic16_movLit2f(pic16_popGet(AOP(result), GPTRSIZE-1), GPTR_TAG_DATA); - } else { - pic16_emitpcode(POC_MOVFF, pic16_popGet2(AOP(right), AOP(result), GPTRSIZE-1)); + pic16_movLit2f (pic16_popGet (AOP (result), GPTRSIZE - 1), GPTR_TAG_DATA); + } + else + { + pic16_emitpcode (POC_MOVFF, pic16_popGet2 (AOP (right), AOP (result), GPTRSIZE - 1)); } break; default: - /* this should never happen */ - werror(E_INTERNAL_ERROR,__FILE__,__LINE__, - "got unknown pointer type"); - exit(1); + /* this should never happen */ + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "got unknown pointer type"); + exit (1); } - //pic16_aopPut(AOP(result),l, GPTRSIZE - 1); - goto release ; + //pic16_aopPut(AOP(result),l, GPTRSIZE - 1); + goto release; } - assert( 0 ); - /* just copy the pointers */ - size = AOP_SIZE(result); - offset = 0 ; - while (size--) { - pic16_aopPut(AOP(result), - pic16_aopGet(AOP(right),offset,FALSE,FALSE), - offset); - offset++; + assert (0); + /* just copy the pointers */ + size = AOP_SIZE (result); + offset = 0; + while (size--) + { + pic16_aopPut (AOP (result), pic16_aopGet (AOP (right), offset, FALSE, FALSE), offset); + offset++; } - goto release ; + goto release; } - /* so we now know that the size of destination is greater - than the size of the source. - Now, if the next iCode is an operator then we might be - able to optimize the operation without performing a cast. - */ - if(genMixedOperation(ic)) - goto release; + /* so we now know that the size of destination is greater + than the size of the source. + Now, if the next iCode is an operator then we might be + able to optimize the operation without performing a cast. + */ + if (genMixedOperation (ic)) + goto release; - DEBUGpic16_emitcode("; ***","%s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - /* we move to result for the size of source */ - size = AOP_SIZE(right); - offset = 0 ; - - while (size--) { - if(!_G.resDirect) - pic16_mov2f(AOP(result), AOP(right), offset); + /* we move to result for the size of source */ + size = AOP_SIZE (right); + offset = 0; + + while (size--) + { + if (!_G.resDirect) + pic16_mov2f (AOP (result), AOP (right), offset); offset++; } - /* now depending on the sign of the destination */ - size = AOP_SIZE(result) - AOP_SIZE(right); - /* if unsigned or not an integral type */ - if (SPEC_USIGN( getSpec(rtype) ) || !IS_SPEC(rtype)) { + /* now depending on the sign of the destination */ + size = AOP_SIZE (result) - AOP_SIZE (right); + /* if unsigned or not an integral type */ + if (SPEC_USIGN (getSpec (rtype)) || !IS_SPEC (rtype)) + { while (size--) - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),offset++)); - } else { + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offset++)); + } + else + { /* we need to extend the sign :( */ - if(size == 1) { - /* Save one instruction of casting char to int */ - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),offset)); - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit(pic16_aopGet(AOP(right),offset-1,FALSE,FALSE),7,0, PO_GPR_REGISTER)); - pic16_emitpcode(POC_SETF, pic16_popGet(AOP(result),offset)); - } else { - pic16_emitpcode(POC_CLRF,pic16_popCopyReg(&pic16_pc_wreg)); - - if(offset) - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit(pic16_aopGet(AOP(right),offset-1,FALSE,FALSE),7,0, PO_GPR_REGISTER)); - else - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit(pic16_aopGet(AOP(right),offset,FALSE,FALSE),7,0, PO_GPR_REGISTER)); + if (size == 1) + { + /* Save one instruction of casting char to int */ + pic16_emitpcode (POC_CLRF, pic16_popGet (AOP (result), offset)); + pic16_emitpcode (POC_BTFSC, + pic16_newpCodeOpBit (pic16_aopGet (AOP (right), offset - 1, FALSE, FALSE), 7, 0, PO_GPR_REGISTER)); + pic16_emitpcode (POC_SETF, pic16_popGet (AOP (result), offset)); + } + else + { + pic16_emitpcode (POC_CLRF, pic16_popCopyReg (&pic16_pc_wreg)); - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(0xff)); + if (offset) + pic16_emitpcode (POC_BTFSC, + pic16_newpCodeOpBit (pic16_aopGet (AOP (right), offset - 1, FALSE, FALSE), 7, 0, PO_GPR_REGISTER)); + else + pic16_emitpcode (POC_BTFSC, + pic16_newpCodeOpBit (pic16_aopGet (AOP (right), offset, FALSE, FALSE), 7, 0, PO_GPR_REGISTER)); - while (size--) - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offset++)); - } + pic16_emitpcode (POC_MOVLW, pic16_popGetLit (0xff)); + + while (size--) + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), offset++)); + } } release: - pic16_freeAsmop(right,NULL,ic,TRUE); - pic16_freeAsmop(result,NULL,ic,TRUE); + pic16_freeAsmop (right, NULL, ic, TRUE); + pic16_freeAsmop (result, NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ /* genDjnz - generate decrement & jump if not zero instrucion */ /*-----------------------------------------------------------------*/ -static int genDjnz (iCode *ic, iCode *ifx) +static int +genDjnz (iCode * ic, iCode * ifx) { - symbol *lbl, *lbl1; - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - if (!ifx) - return 0; + DEBUGpic16_emitcode ("; ***", "%s %d", __FUNCTION__, __LINE__); - /* if the if condition has a false label - then we cannot save */ - if (IC_FALSE(ifx)) - return 0; + if (!ifx) + return 0; - /* if the minus is not of the form - a = a - 1 */ - if (!isOperandEqual(IC_RESULT(ic),IC_LEFT(ic)) || - !IS_OP_LITERAL(IC_RIGHT(ic))) - return 0; + /* if the if condition has a false label + then we cannot save */ + if (IC_FALSE (ifx)) + return 0; - if (operandLitValue(IC_RIGHT(ic)) != 1) - return 0; + /* if the minus is not of the form + a = a - 1 */ + if (!isOperandEqual (IC_RESULT (ic), IC_LEFT (ic)) || !IS_OP_LITERAL (IC_RIGHT (ic))) + return 0; - /* if the size of this greater than one then no - saving */ - if (getSize(operandType(IC_RESULT(ic))) > 1) - return 0; + if (operandLitValue (IC_RIGHT (ic)) != 1) + return 0; - /* otherwise we can save BIG */ - lbl = newiTempLabel(NULL); - lbl1= newiTempLabel(NULL); + /* if the size of this greater than one then no + saving */ + if (getSize (operandType (IC_RESULT (ic))) > 1) + return 0; - pic16_aopOp(IC_RESULT(ic),ic,FALSE); + /* otherwise we can save BIG */ + pic16_aopOp (IC_RESULT (ic), ic, FALSE); - pic16_emitpcode(POC_DECFSZ,pic16_popGet(AOP(IC_RESULT(ic)),0)); - pic16_emitpcode(POC_GOTO,pic16_popGetLabel(IC_TRUE(ifx)->key)); + pic16_emitpcode (POC_DECFSZ, pic16_popGet (AOP (IC_RESULT (ic)), 0)); + pic16_emitpcode (POC_GOTO, pic16_popGetLabel (IC_TRUE (ifx)->key)); - pic16_freeAsmop(IC_RESULT(ic),NULL,ic,TRUE); - ifx->generated = 1; - return 1; + pic16_freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); + ifx->generated = 1; + return 1; } /*-----------------------------------------------------------------*/ /* genReceive - generate code for a receive iCode */ /*-----------------------------------------------------------------*/ -static void genReceive (iCode *ic) +static void +genReceive (iCode * ic) { FENTRY; #if 0 - fprintf(stderr, "%s:%d %s for symbol %s\tonStack: %d\n", __FILE__, __LINE__, __FUNCTION__, - OP_SYMBOL( IC_RESULT(ic) )->rname, OP_SYMBOL( IC_RESULT(ic) )->onStack); + fprintf (stderr, "%s:%d %s for symbol %s\tonStack: %d\n", __FILE__, __LINE__, __FUNCTION__, + OP_SYMBOL (IC_RESULT (ic))->rname, OP_SYMBOL (IC_RESULT (ic))->onStack); #endif // pic16_DumpOp(__FUNCTION__, IC_RESULT(ic)); - if (isOperandInFarSpace(IC_RESULT(ic)) - && ( OP_SYMBOL(IC_RESULT(ic))->isspilt - || IS_TRUE_SYMOP(IC_RESULT(ic))) ) { + if (isOperandInFarSpace (IC_RESULT (ic)) && (OP_SYMBOL (IC_RESULT (ic))->isspilt || IS_TRUE_SYMOP (IC_RESULT (ic)))) + { - int size = getSize(operandType(IC_RESULT(ic))); - int offset = pic16_fReturnSizePic - size; + int size = getSize (operandType (IC_RESULT (ic))); + int offset = pic16_fReturnSizePic - size; - assert( 0 ); - while (size--) { - pic16_emitcode ("push","%s", (strcmp(fReturn[pic16_fReturnSizePic - offset - 1],"a") ? - fReturn[pic16_fReturnSizePic - offset - 1] : "acc")); - offset++; + assert (0); + while (size--) + { + pic16_emitcode ("push", "%s", (strcmp (fReturn[pic16_fReturnSizePic - offset - 1], "a") ? + fReturn[pic16_fReturnSizePic - offset - 1] : "acc")); + offset++; } - DEBUGpic16_emitcode ("; ***","1 %s %d",__FUNCTION__,__LINE__); + DEBUGpic16_emitcode ("; ***", "1 %s %d", __FUNCTION__, __LINE__); - pic16_aopOp(IC_RESULT(ic),ic,FALSE); - size = AOP_SIZE(IC_RESULT(ic)); + pic16_aopOp (IC_RESULT (ic), ic, FALSE); + size = AOP_SIZE (IC_RESULT (ic)); offset = 0; - while (size--) { - pic16_emitcode ("pop","acc"); - pic16_aopPut (AOP(IC_RESULT(ic)),"a",offset++); - } - } else { - DEBUGpic16_emitcode ("; ***","2 %s %d argreg = %d",__FUNCTION__,__LINE__, SPEC_ARGREG(OP_SYM_ETYPE(IC_RESULT(ic)) )); - _G.accInUse++; - pic16_aopOp(IC_RESULT(ic),ic,FALSE); - _G.accInUse--; - - /* set pseudo stack pointer to where it should be - dw*/ - GpsuedoStkPtr = ic->parmBytes; - - /* setting GpsuedoStkPtr has side effects here: */ - /* FIXME: What's the correct size of the return(ed) value? - * For now, assuming '4' as before... */ - assignResultValue(IC_RESULT(ic), 4, 0); - } + while (size--) + { + pic16_emitcode ("pop", "acc"); + pic16_aopPut (AOP (IC_RESULT (ic)), "a", offset++); + } + } + else + { + DEBUGpic16_emitcode ("; ***", "2 %s %d argreg = %d", __FUNCTION__, __LINE__, + SPEC_ARGREG (OP_SYM_ETYPE (IC_RESULT (ic)))); + _G.accInUse++; + pic16_aopOp (IC_RESULT (ic), ic, FALSE); + _G.accInUse--; + + /* set pseudo stack pointer to where it should be - dw */ + GpsuedoStkPtr = ic->parmBytes; + + /* setting GpsuedoStkPtr has side effects here: */ + /* FIXME: What's the correct size of the return(ed) value? + * For now, assuming '4' as before... */ + assignResultValue (IC_RESULT (ic), 4, 0); + } - pic16_freeAsmop(IC_RESULT(ic),NULL,ic,TRUE); + pic16_freeAsmop (IC_RESULT (ic), NULL, ic, TRUE); } /*-----------------------------------------------------------------*/ @@ -10091,18 +11292,22 @@ { operand *op; - op = IC_RIGHT(ic); - if (op && IS_SYMOP(op)) { - if (IN_CODESPACE(SPEC_OCLS(OP_SYM_ETYPE(op)))) { - fprintf (stderr, "%s: volatile symbols in codespace?!? -- might go wrong...\n", __FUNCTION__); - return; + op = IC_RIGHT (ic); + if (op && IS_SYMOP (op)) + { + if (IN_CODESPACE (SPEC_OCLS (OP_SYM_ETYPE (op)))) + { + fprintf (stderr, "%s: volatile symbols in codespace?!? -- might go wrong...\n", __FUNCTION__); + return; + } + pic16_aopOp (op, ic, FALSE); + pic16_mov2w_volatile (AOP (op)); + pic16_freeAsmop (op, NULL, ic, TRUE); } - pic16_aopOp (op, ic, FALSE); - pic16_mov2w_volatile(AOP(op)); - pic16_freeAsmop (op, NULL, ic, TRUE); - } else if (op) { - fprintf (stderr, "%s: not implemented for non-symbols (volatile operand might not be read)\n", __FUNCTION__); - } // if + else if (op) + { + fprintf (stderr, "%s: not implemented for non-symbols (volatile operand might not be read)\n", __FUNCTION__); + } // if } /*-----------------------------------------------------------------*/ @@ -10117,65 +11322,73 @@ * peep hole optimizer and the pCode optimizer. *-----------------------------------------------------------------*/ -void genpic16Code (iCode *lic) +void +genpic16Code (iCode * lic) { iCode *ic; int cln = 0; - lineHead = lineCurr = NULL; - - pb = pic16_newpCodeChain(GcurMemmap,0,pic16_newpCodeCharP("; Starting pCode block")); - pic16_addpBlock(pb); + pb = pic16_newpCodeChain (GcurMemmap, 0, pic16_newpCodeCharP ("; Starting pCode block")); + pic16_addpBlock (pb); #if 0 - /* if debug information required */ - if (options.debug && currFunc) { - if (currFunc) { - cdbSymbol(currFunc,cdbFile,FALSE,TRUE); - } + /* if debug information required */ + if (options.debug && currFunc) + { + if (currFunc) + { + cdbSymbol (currFunc, cdbFile, FALSE, TRUE); + } } #endif - for (ic = lic ; ic ; ic = ic->next ) { + for (ic = lic; ic; ic = ic->next) + { + initGenLineElement (); - DEBUGpic16_emitcode(";ic ", "\t%c 0x%x\t(%s)",ic->op, ic->op, pic16_decodeOp(ic->op)); - if ( cln != ic->lineno ) { - if ( options.debug ) { - debugFile->writeCLine (ic); - } + DEBUGpic16_emitcode (";ic ", "\t%c 0x%x\t(%s)", ic->op, ic->op, pic16_decodeOp (ic->op)); + if (cln != ic->lineno) + { + if (options.debug) + { + debugFile->writeCLine (ic); + } - if(!options.noCcodeInAsm) { - pic16_addpCode2pBlock(pb, pic16_newpCodeCSource(ic->lineno, ic->filename, - printCLine(ic->filename, ic->lineno))); - } + if (!options.noCcodeInAsm) + { + pic16_addpCode2pBlock (pb, pic16_newpCodeCSource (ic->lineno, ic->filename, + printCLine (ic->filename, ic->lineno))); + } - cln = ic->lineno ; - } + cln = ic->lineno; + } - if(options.iCodeInAsm) { - const char *iLine; + if (options.iCodeInAsm) + { + const char *iLine; - /* insert here code to print iCode as comment */ - iLine = printILine(ic); - pic16_emitpcomment("ic:%d: %s", ic->seq, iLine); - dbuf_free(iLine); - } + /* insert here code to print iCode as comment */ + iLine = printILine (ic); + pic16_emitpcomment ("ic:%d: %s", ic->seq, iLine); + dbuf_free (iLine); + } /* if the result is marked as * spilt and rematerializable or code for * this has already been generated then * do nothing */ - if (resultRemat(ic) || ic->generated ) - continue ; + if (resultRemat (ic) || ic->generated) + continue; /* depending on the operation */ - switch (ic->op) { - case '!' : - pic16_genNot(ic); + switch (ic->op) + { + case '!': + pic16_genNot (ic); break; - case '~' : - pic16_genCpl(ic); + case '~': + pic16_genCpl (ic); break; case UNARYMINUS: @@ -10193,10 +11406,8 @@ * be using some of the registers being popped which * would destroy the contents of the register so * we need to check for this condition and handle it */ - if (ic->next - && ic->next->op == IFX - && regsInCommon(IC_LEFT(ic),IC_COND(ic->next))) - genIfx (ic->next,ic); + if (ic->next && ic->next->op == IFX && regsInCommon (IC_LEFT (ic), IC_COND (ic->next))) + genIfx (ic->next, ic); else genIpop (ic); break; @@ -10229,33 +11440,33 @@ genGoto (ic); break; - case '+' : - pic16_genPlus (ic) ; + case '+': + pic16_genPlus (ic); break; - case '-' : - if ( ! genDjnz (ic,ifxForOp(IC_RESULT(ic),ic))) + case '-': + if (!genDjnz (ic, ifxForOp (IC_RESULT (ic), ic))) pic16_genMinus (ic); break; - case '*' : + case '*': genMult (ic); break; - case '/' : - genDiv (ic) ; + case '/': + genDiv (ic); break; - case '%' : + case '%': genMod (ic); break; - case '>' : - genCmpGt (ic,ifxForOp(IC_RESULT(ic),ic)); + case '>': + genCmpGt (ic, ifxForOp (IC_RESULT (ic), ic)); break; - case '<' : - genCmpLt (ic,ifxForOp(IC_RESULT(ic),ic)); + case '<': + genCmpLt (ic, ifxForOp (IC_RESULT (ic), ic)); break; case LE_OP: @@ -10263,12 +11474,11 @@ case NE_OP: /* note these two are xlated by algebraic equivalence * during parsing SDCC.y */ - werror(E_INTERNAL_ERROR,__FILE__,__LINE__, - "got '>=' or '<=' shouldn't have come here"); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "got '>=' or '<=' shouldn't have come here"); break; case EQ_OP: - genCmpEq (ic,ifxForOp(IC_RESULT(ic),ic)); + genCmpEq (ic, ifxForOp (IC_RESULT (ic), ic)); break; case AND_OP: @@ -10279,20 +11489,20 @@ genOrOp (ic); break; - case '^' : - genXor (ic,ifxForOp(IC_RESULT(ic),ic)); + case '^': + genXor (ic, ifxForOp (IC_RESULT (ic), ic)); break; - case '|' : - genOr (ic,ifxForOp(IC_RESULT(ic),ic)); + case '|': + genOr (ic, ifxForOp (IC_RESULT (ic), ic)); break; case BITWISEAND: - genAnd (ic,ifxForOp(IC_RESULT(ic),ic)); + genAnd (ic, ifxForOp (IC_RESULT (ic), ic)); break; case INLINEASM: - genInline (ic); + pic16_genInline (ic); break; case RRC: @@ -10303,6 +11513,10 @@ genRLC (ic); break; + case GETABIT: + genGetABit (ic); + break; + case GETHBIT: genGetHbit (ic); break; @@ -10316,18 +11530,18 @@ break; case GET_VALUE_AT_ADDRESS: - genPointerGet(ic); + genPointerGet (ic); break; - case '=' : - if (POINTER_SET(ic)) - genPointerSet(ic); + case '=': + if (POINTER_SET (ic)) + genPointerSet (ic); else - genAssign(ic); + genAssign (ic); break; case IFX: - genIfx (ic,NULL); + genIfx (ic, NULL); break; case ADDRESS_OF: @@ -10343,35 +11557,46 @@ break; case RECEIVE: - genReceive(ic); + genReceive (ic); break; case SEND: - addSet(&_G.sendSet,ic); + addSet (&_G.sendSet, ic); break; case DUMMY_READ_VOLATILE: genDummyRead (ic); break; - default : + case CRITICAL: + genCritical (ic); + break; + + case ENDCRITICAL: + genEndCritical (ic); + break; + + default: + fprintf (stderr, "UNHANDLED iCode: "); + piCode (ic, stderr); ic = ic; - } + } } - /* now we are ready to call the - peep hole optimizer */ - if (!options.nopeep) - peepHole (&lineHead); + /* now we are ready to call the + peep hole optimizer */ + if (!options.nopeep) + peepHole (&genLine.lineHead); - /* now do the actual printing */ - printLine (lineHead, codeOutBuf); + /* now do the actual printing */ + printLine (genLine.lineHead, codeOutBuf); #ifdef PCODE_DEBUG - DFPRINTF((stderr,"printing pBlock\n\n")); - pic16_printpBlock(stdout,pb); + DFPRINTF ((stderr, "printing pBlock\n\n")); + pic16_printpBlock (stdout, pb); #endif - return; + /* destroy the line list */ + destroy_line_list (); } diff -Nru sdcc-3.1.0+dfsg/src/pic16/genarith.c sdcc-3.2.0+dfsg/src/pic16/genarith.c --- sdcc-3.1.0+dfsg/src/pic16/genarith.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic16/genarith.c 2012-04-14 17:44:08.000000000 +0000 @@ -1,12 +1,13 @@ /*------------------------------------------------------------------------- + genarith.c - source file for code generation - arithmetic - genarith.c - source file for code generation - arithmetic - - Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998) - and - Jean-Louis VERN.jlvern@writeme.com (1999) + Copyright (C) 1998, Sandeep Dutta . sandeep.dutta@usa.net + Copyright (C) 1999, Jean-Louis VERN.jlvern@writeme.com Bug Fixes - Wojciech Stryjewski wstryj1@tiger.lsu.edu (1999 v2.1.9a) - PIC port - Scott Dattalo scott@dattalo.com (2000) - PIC16 port - Martin Dubuc m.dubuc@rogers.com (2002) + PIC port: + Copyright (C) 2000, Scott Dattalo scott@dattalo.com + PIC16 port: + Copyright (C) 2002, Martin Dubuc m.dubuc@rogers.com 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 @@ -21,15 +22,12 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! - +-------------------------------------------------------------------------*/ +/* Notes: 000123 mlh Moved aopLiteral to SDCCglue.c to help the split Made everything static --------------------------------------------------------------------------*/ +*/ #include #include @@ -52,7 +50,10 @@ #define pic16_emitcode DEBUGpic16_emitcode #endif +extern void pic16_emitpLabelFORCE(int key); + #define BYTEofLONG(l,b) ( (l>> (b<<3)) & 0xff) + void DEBUGpic16_pic16_AopType(int line_no, operand *left, operand *right, operand *result); void pic16_emitpcomment(char *, ...); pCodeOp *pic16_popGet2p(pCodeOp *src, pCodeOp *dst); @@ -158,7 +159,7 @@ /*-----------------------------------------------------------------*/ bool pic16_genPlusIncr (iCode *ic) { - unsigned int icount ; + unsigned int icount; unsigned int size = pic16_getDataSize(IC_RESULT(ic)); FENTRY; @@ -172,28 +173,58 @@ /* if the right side is not a literal we cannot */ if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT) - return FALSE ; + { + return FALSE; + } DEBUGpic16_emitcode ("; ","%s %d",__FUNCTION__,__LINE__); /* if the literal value of the right hand side is greater than 2 then it is faster to add */ - if ((icount = (unsigned int) ulFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit)) > 2) - return FALSE ; + if ((icount = (unsigned int)ulFromVal(AOP(IC_RIGHT(ic))->aopu.aop_lit)) > 2) + { + return FALSE; + } /* if increment 16 bits in register */ - if (pic16_sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) && - (icount == 1)) { + if (pic16_sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) && icount == 1) + { + int offset = LSB; + + switch (size) + { + case 2: + pic16_emitpcode(POC_INFSNZ, pic16_popGet(AOP(IC_RESULT(ic)), offset++)); + case 1: + pic16_emitpcode(POC_INCF, pic16_popGet(AOP(IC_RESULT(ic)), offset)); + break; - int offset = MSB16; + default: + { + symbol *inclbl = newiTempLabel(NULL); + pCodeOp *pcop_lbl = pic16_popGetLabel(inclbl->key); + int label_use = 0; - pic16_emitpcode(POC_INCF, pic16_popGet(AOP(IC_RESULT(ic)),LSB)); - //pic16_emitcode("incf","%s,f",pic16_aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE)); + size -= 2; + if (size) + { + label_use = 1; + } - while(--size) { - emitSKPNC; - pic16_emitpcode(POC_INCF, pic16_popGet(AOP(IC_RESULT(ic)),offset++)); - //pic16_emitcode(" incf","%s,f",pic16_aopGet(AOP(IC_RESULT(ic)),offset++,FALSE,FALSE)); - } + while (size--) + { + pic16_emitpcode(POC_INCF, pic16_popGet(AOP(IC_RESULT(ic)), offset++)); + pic16_emitpcode(POC_BNC, pcop_lbl); + } + + pic16_emitpcode(POC_INFSNZ, pic16_popGet(AOP(IC_RESULT(ic)), offset++)); + pic16_emitpcode(POC_INCF, pic16_popGet(AOP(IC_RESULT(ic)), offset)); + + if (label_use) + { + pic16_emitpLabelFORCE(inclbl->key); + } + } + } // switch (size) return TRUE; } @@ -386,20 +417,34 @@ { FENTRY; - switch(lit & 0xff) { - case 0: - break; - case 1: - pic16_emitpcode(POC_INCF, pic16_popGet(AOP(result),offr)); - break; - case 0xff: - pic16_emitpcode(POC_DECF, pic16_popGet(AOP(result),offr)); - break; - default: - pic16_emitpcode(POC_MOVLW,pic16_popGetLit(lit&0xff)); - pic16_emitpcode(POC_ADDWF,pic16_popGet(AOP(result),offr)); - } + switch(lit & 0xff) + { + case 0: + break; + case 1: + pic16_emitpcode(POC_INCF, pic16_popGet(AOP(result),offr)); + break; + + case 0xff: + pic16_emitpcode(POC_DECF, pic16_popGet(AOP(result),offr)); + break; + + default: + { + int resultIsWREG = (AOP_TYPE(result) != AOP_STA && ! strcmp(pic16_aopGet(AOP(result), 0, TRUE, FALSE), "WREG")); + + if (resultIsWREG) + { + pic16_emitpcode(POC_ADDLW, pic16_popGetLit(lit & 0xff)); + } + else + { + pic16_emitpcode(POC_MOVLW,pic16_popGetLit(lit & 0xff)); + pic16_emitpcode(POC_ADDWF,pic16_popGet(AOP(result),offr)); + } + } + } } #endif @@ -466,11 +511,12 @@ switch(lo) { case 0: break; + case 1: - pic16_emitpcode(POC_INCF, pic16_popGet(AOP(result),0)); - emitSKPNZ; + pic16_emitpcode(POC_INFSNZ, pic16_popGet(AOP(result),0)); pic16_emitpcode(POC_INCF, pic16_popGet(AOP(result),MSB16)); break; + case 0xff: pic16_emitpcode(POC_DECF, pic16_popGet(AOP(result),0)); pic16_emitpcode(POC_INCFSZW, pic16_popGet(AOP(result),0)); @@ -482,8 +528,6 @@ pic16_emitpcode(POC_ADDWF,pic16_popGet(AOP(result),0)); emitSKPNC; pic16_emitpcode(POC_INCF, pic16_popGet(AOP(result),MSB16)); - - } break; @@ -526,12 +570,13 @@ pic16_emitpcode(POC_INCFSZ, pic16_popGet(AOP(result),0)); pic16_emitpcode(POC_DECF, pic16_popGet(AOP(result),MSB16)); break; -/* case 0xff: * 0xffff * - pic16_emitpcode(POC_INCFSZW, pic16_popGet(AOP(result),0,FALSE,FALSE)); - pic16_emitpcode(POC_INCF, pic16_popGet(AOP(result),MSB16,FALSE,FALSE)); - pic16_emitpcode(POC_DECF, pic16_popGet(AOP(result),0,FALSE,FALSE)); + + case 0xff: /* 0xffff */ + pic16_emitpcode(POC_MOVLW, pic16_popGetLit(lo)); + pic16_emitpcode(POC_ADDWF, pic16_popGet(AOP(result),0)); + pic16_emitpcode(POC_ADDWFC, pic16_popGet(AOP(result),MSB16)); break; -*/ + default: pic16_emitpcode(POC_MOVLW,pic16_popGetLit(lo)); pic16_emitpcode(POC_ADDWF,pic16_popGet(AOP(result),0)); @@ -572,35 +617,55 @@ } } else { int carry_info = 0; - int offset = 0; + int prev_W = -1; /* size > 2 */ DEBUGpic16_emitcode ("; add lit to long","%s %d",__FUNCTION__,__LINE__); - while(size--) { + offset = 0; + while (size--) + { lo = BYTEofLONG(lit,0); - if(carry_info) { - pic16_emitpcode(POC_MOVLW,pic16_popGetLit(lo)); - pic16_emitpcode(POC_ADDWFC, pic16_popGet(AOP(result),offset)); - }else { + if (carry_info) + { + if (prev_W != (lo & 0xFF)) + { + pic16_emitpcode(POC_MOVLW, pic16_popGetLit(lo)); + prev_W = lo & 0xFF; + } + + pic16_emitpcode(POC_ADDWFC, pic16_popGet(AOP(result),offset)); + } + else { /* no carry info from previous step */ /* this means this is the first time to add */ - switch(lo) { - case 0: - break; - case 1: - pic16_emitpcode(POC_INCF, pic16_popGet(AOP(result),offset)); - carry_info=1; - break; - default: - pic16_emitpcode(POC_MOVLW,pic16_popGetLit(lo)); - pic16_emitpcode(POC_ADDWF, pic16_popGet(AOP(result),offset)); - if(lit <0x100) - carry_info = 3; /* Were adding only one byte and propogating the carry */ - else - carry_info = 2; - break; - } + switch (lo) + { + case 0: + break; + + case 1: + pic16_emitpcode(POC_INCF, pic16_popGet(AOP(result),offset)); + carry_info = 1; + break; + + default: + { + if (prev_W != (lo & 0xFF)) + { + pic16_emitpcode(POC_MOVLW, pic16_popGetLit(lo)); + prev_W = lo & 0xFF; + } + + pic16_emitpcode(POC_ADDWF, pic16_popGet(AOP(result),offset)); + + if (lit < 0x100) + carry_info = 3; /* Were adding only one byte and propogating the carry. */ + else + carry_info = 2; + break; + } + } } offset++; lit >>= 8; @@ -720,7 +785,7 @@ { int size,sizeL,same; - int i, llit; + int i, llit, prev_W; operand *result; operand *left; @@ -772,12 +837,18 @@ /* general case */ /* add literal to result */ - for (i=0; i < size; i++) { - pic16_emitpcode (POC_MOVLW, pic16_popGetLit (llit)); - llit >>= 8; /* FIXME: arithmetic right shift for signed literals? */ - pic16_emitpcode (i == 0 ? POC_ADDWF : POC_ADDWFC, - pic16_popGet (AOP(result), i)); - } + prev_W = -1; + for (i = 0; i < size; i++) + { + if (prev_W != (llit & 0xFF)) + { + pic16_emitpcode(POC_MOVLW, pic16_popGetLit(llit)); + prev_W = llit & 0xFF; + } + + llit >>= 8; /* FIXME: arithmetic right shift for signed literals? */ + pic16_emitpcode(i == 0 ? POC_ADDWF : POC_ADDWFC, pic16_popGet(AOP(result), i)); + } } #if 0 @@ -801,8 +872,7 @@ case 0: break; case 1: - pic16_emitpcode(POC_INCF, pic16_popGet(AOP(result),0)); - emitSKPNZ; + pic16_emitpcode(POC_INFSNZ, pic16_popGet(AOP(result),0)); pic16_emitpcode(POC_INCF, pic16_popGet(AOP(result),MSB16)); break; case 0xff: @@ -1275,12 +1345,12 @@ } else { // add regs - if (pic16_sameRegs(AOP(left), AOP(result)) - && (AOP_SIZE(left) < AOP_SIZE(result))) - { - // extend left operand, sign-bit still intact - pic16_addSign (result, AOP_SIZE(left), !SPEC_USIGN(getSpec(operandType(left)))); - } + if (pic16_sameRegs(AOP(left), AOP(result)) + && (AOP_SIZE(left) < AOP_SIZE(result))) + { + // extend left operand, sign-bit still intact + pic16_addSign (result, AOP_SIZE(left), !SPEC_USIGN(getSpec(operandType(left)))); + } // add first bytes for(i=0; iaopu.aop_lit); - assert( (lit >= -128) && (lit < 256) ); - pic16_emitpcomment("Unrolled 8 X 8 multiplication"); - pic16_emitpcomment("FIXME: the function does not support result==WREG"); - - same = pic16_sameRegs(AOP(left), AOP(result)); - if(same) { - switch(lit & 0x00ff) { - case 0: - while (size--) { - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),size)); - } // while - return; - - case 2: - /* sign extend left in result */ - pic16_addSign(result, 1, !IS_UNSIGNED(operandType(left))); - // its faster to left shift - emitCLRC; - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(left),0)); - if (size > 1) - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),1)); - return; - - default: - if(AOP_TYPE(left) != AOP_ACC) - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(left), 0)); - pic16_emitpcode(POC_MULLW, pic16_popGetLit(lit & 0x00ff)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popCopyReg( - &pic16_pc_prodl), pic16_popGet(AOP(result), 0))); - /* Adjust result's high bytes below! */ - } - } else { - // operands different - switch(lit & 0x00ff) { - case 0: - while (size--) { - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),size)); - } // while - return; - - case 2: - if (IS_UNSIGNED(operandType(result))) { - for (i=1; i < size; i++) { - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),i)); - } // for - } else { - /* sign extend left to result */ - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(0)); - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit_simple(AOP(left), 0, 7)); - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(0xff)); - for (i=1; i < size; i++) { - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),i)); - } // for - } - emitCLRC; - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(left), 0)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 0)); - if (size > 1) - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(result),1)); - return; - - default: - if(AOP_TYPE(left) != AOP_ACC) - pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(left), 0)); - pic16_emitpcode(POC_MULLW, pic16_popGetLit(lit)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popCopyReg( - &pic16_pc_prodl), pic16_popGet(AOP(result), 0))); - /* Adjust result's high bytes below! */ - } - } - - if (size > 1) { - /* We need to fix PRODH for - * (a) literals < 0 and - * (b) signed register operands < 0. - */ - //printf( "%s: lit %d, left unsigned: %d\n", __FUNCTION__, lit, SPEC_USIGN(getSpec(operandType(left)))); - if (lit < 0) { - /* literal negative (i.e. in [-128..-1]), high byte == -1 */ - pic16_mov2w(AOP(left), 0); - pic16_emitpcode(POC_SUBWF, pic16_popCopyReg(&pic16_pc_prodh)); - } - - if (!SPEC_USIGN(getSpec(operandType(left)))) { - /* register operand signed, determine signedness of high byte */ - pic16_emitpcode(POC_MOVLW, pic16_popGetLit(lit & 0x00ff)); - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit_simple(AOP(left), 0, 7)); - pic16_emitpcode(POC_SUBWF, pic16_popCopyReg(&pic16_pc_prodh)); + if (AOP_TYPE (right) != AOP_LIT) + { + fprintf (stderr, "%s %d - right operand is not a literal\n", __FILE__, __LINE__); + exit (1); } - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popCopyReg( - &pic16_pc_prodh), pic16_popGet(AOP(result), 1))); - - /* Need to sign-extend here. */ - pic16_addSign(result, 2, !IS_UNSIGNED(operandType(result))); - } // if -} - -#if 0 -/*-----------------------------------------------------------------------* - * pic_genUMult16XLit_16 - unsigned multiplication of two 16-bit numbers * - *-----------------------------------------------------------------------*/ -void pic16_genUMult16XLit_16 (operand *left, - operand *right, - operand *result) -{ - pCodeOp *pct1, *pct2, *pct3, *pct4; - unsigned int lit; - int same; + lit = (int) ulFromVal (AOP (right)->aopu.aop_lit); + assert ((lit >= -128) && (lit < 256) ); + /* We need to adjust the high byte of the result (in PRODH) if + * (a) literals < 0 or + * (b) signed register operands < 0. + * + * If lit >= 0 and val is unsigned, MULLW will do the trick. + * + * If val is signed and 8 bit: + * val = -2^7 * v_7 + SUM(2^i * v_i, i=0..6) + * = -2^7 * v_7 + -2^7 * v_7 + SUM(2^i * v_i, i=0..7) + * = -2^8 * v_7 + SUM(2^i * v_i, i=0..7) + * = -2^8 * v_7 + UNSIGNED(val) + * + * For lit >= 0: + * lit * val = lit * UNSIGNED(val) - 2^8 * v_7 * lit + * + * For lit < 0, lit = l_7 .. l_0: + * + * lit * val = (-2^8 * l_7 + UNSIGNED(lit)) * (-2^8 * v_7 + UNSIGNED(val)) + * = 2^8 * l_7 * 2^8 * v_7 + * - 2^8 * l_7 * UNSIGNED(val) + * - 2^8 * v_7 * UNSIGNED(lit) + * + UNSIGNED(lit) * UNSIGNED(val) + * = 2^16 * l_7 * v_7 + * - 2^8 * (l_7 * UNSIGNED(val) + v_7 * UNSIGNED(lit)) + * + UNSIGNED(lit) * UNSIGNED(val) + * + * '2^16 * X' is only of interest if the result is larger than 16 * bit + * ==> ignored. + * '-2^8 * X' requires subtracting the original values of 'val' + * respectively 'lit' from the high byte of the result. + * UNSIGNED(lit) * UNSIGNED(val) can be computed via a MUL instruction. + * + * So, we do: + * MOVF val, W + * MULLW lit + * # Now, PRODH:PRODL hold UNSIGNED(val) * UNSIGNED(lit) + * if result > 8 bit: + * if lit < 0: + * SUBWF PRODH, F # -2^8 * l_7 * UNSIGNED(val) + * MOVF PRODH, W + * BTFSC val, 7 + * SUBLW lit # -2^8 * v_7 * UNSIGNED(lit) + * MOVWF result[1] # this might overwrite val! + * MOVFF PRODL, result[0] # this might overwrite val! + */ - FENTRY; + pic16_mov2w (AOP (left), 0); + pic16_emitpcode (POC_MULLW, pic16_popGetLit (lit & 0x00ff)); - if (AOP_TYPE(right) != AOP_LIT){ - fprintf(stderr,"%s %d - right operand is not a literal\n",__FILE__,__LINE__); - exit(1); - } - - lit = (unsigned int) ulFromVal (AOP(right)->aopu.aop_lit); - lit &= 0xffff; - - same = pic16_sameRegs(AOP(left), AOP(result)); - if(same) { - switch(lit) { - case 0: - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),0)); - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),1)); - return; - case 2: - // its faster to left shift - emitCLRC; - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(left),0)); - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(left),1)); - return; - - default: { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - pct1 = pic16_popGetTempReg(1); - pct2 = pic16_popGetTempReg(1); - pct3 = pic16_popGetTempReg(1); - pct4 = pic16_popGetTempReg(1); - - pic16_emitpcode(POC_MOVLW, pic16_popGetLit( lit & 0xff)); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(left), 0)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodl), pic16_pCodeOpCopy(pct1))); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodh), pic16_pCodeOpCopy(pct2))); - - /* WREG still holds the low literal */ - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(left), 1)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodl), pic16_pCodeOpCopy(pct3))); - - pic16_emitpcode(POC_MOVLW, pic16_popGetLit( lit>>8 )); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(left), 0)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodl), pic16_pCodeOpCopy(pct4))); - - /* load result */ - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pct1, pic16_popGet(AOP(result), 0))); - pic16_emitpcode(POC_MOVFW, pic16_pCodeOpCopy(pct2)); - pic16_emitpcode(POC_ADDFW, pic16_pCodeOpCopy(pct3)); - pic16_emitpcode(POC_ADDFWC, pic16_pCodeOpCopy(pct4)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 1)); - - pic16_popReleaseTempReg(pct4,1); - pic16_popReleaseTempReg(pct3,1); - pic16_popReleaseTempReg(pct2,1); - pic16_popReleaseTempReg(pct1,1); - }; return; - } - } else { - // operands different - switch(lit) { - case 0: - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result), 0)); - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result), 1)); - return; - case 2: - emitCLRC; - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(left), 0)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 0)); - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(left), 1)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 1)); - return; - default: { - - pic16_emitpcode(POC_MOVLW, pic16_popGetLit( lit & 0xff)); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(left), 0)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodl), pic16_popGet(AOP(result), 0))); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodh), pic16_popGet(AOP(result), 1))); - - /* WREG still holds the low literal */ - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(left), 1)); - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(&pic16_pc_prodl)); - pic16_emitpcode(POC_ADDWF, pic16_popGet(AOP(result), 1)); - - pic16_emitpcode(POC_MOVLW, pic16_popGetLit( lit>>8 )); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(left), 0)); - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(&pic16_pc_prodl)); - pic16_emitpcode(POC_ADDWFC, pic16_popGet(AOP(result), 1)); + if (size > 1) + { + /* Adjust PRODH for signed operands. */ + if (lit < 0) + { + /* left is still in WREG */ + pic16_emitpcode (POC_SUBWF, pic16_popCopyReg (&pic16_pc_prodh)); + } // if + + pic16_emitpcode (POC_MOVFW, pic16_popCopyReg (&pic16_pc_prodh)); + if (!SPEC_USIGN (operandType (left))) + { + pic16_emitpcode (POC_BTFSC, + pic16_newpCodeOpBit (pic16_aopGet (AOP (left), 0, FALSE, FALSE), + 7, 0, PO_GPR_REGISTER)); + pic16_emitpcode (POC_SUBLW, pic16_popGetLit (lit & 0x00ff)); + } // if + + /* Assign result (high byte) -- this may overwrite val. */ + pic16_emitpcode (POC_MOVWF, pic16_popGet (AOP (result), 1)); + } // if + + /* Assign result (low byte) -- this may overwrite val. */ + pic16_emitpcode (POC_MOVFF, + pic16_popGet2p (pic16_popCopyReg (&pic16_pc_prodl), + pic16_popGet (AOP (result), 0))); - }; return; - } - } + /* Must sign/zero-extend here if size > 2. */ + if (size > 2) + { + pic16_addSign (result, 2, !IS_UNSIGNED (operandType (left))); + } // if } -#endif - /*-----------------------------------------------------------------* * genMult8X8_n - multiplication of two 8-bit numbers. * * *-----------------------------------------------------------------*/ -void pic16_genMult8X8_n (operand *left, operand *right, operand *result) - +void +pic16_genMult8X8_n (operand *left, operand *right, operand *result) { FENTRY; - - if (AOP_TYPE(right) == AOP_LIT) { - pic16_genMult8XLit_n(left,right,result); - return; - } + /* Special case: multiply by literal. */ + if (AOP_TYPE (right) == AOP_LIT) + { + pic16_genMult8XLit_n (left, right, result); + return; + } + else if (AOP_TYPE (left) == AOP_LIT) + { + pic16_genMult8XLit_n (right, left, result); + return; + } // if /* cases: A = A x B B = A x B A = B x C W = A x B W = W x B W = B x W - */ + */ /* if result == right then exchange left and right */ - if(pic16_sameRegs(AOP(result), AOP(right))) { - operand *tmp; - tmp = left; - left = right; - right = tmp; - } + if (pic16_sameRegs (AOP (result), AOP (right))) + { + operand *tmp; + tmp = left; + left = right; + right = tmp; + } // if - if(AOP_TYPE(left) != AOP_ACC) { - // left is not WREG - if(AOP_TYPE(right) != AOP_ACC) { - pic16_mov2w(AOP(left), 0); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(right), 0)); - } else { - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(left), 0)); + if (AOP_TYPE (left) != AOP_ACC) + { + // left is not WREG + if (AOP_TYPE (right) != AOP_ACC) + { + pic16_mov2w (AOP (left), 0); + pic16_emitpcode (POC_MULWF, pic16_popGet (AOP (right), 0)); + } + else + { + pic16_emitpcode (POC_MULWF, pic16_popGet (AOP (left), 0)); + } // if } - } else { - // left is WREG, right cannot be WREG (or can?!) - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(right), 0)); - } + else + { + pic16_emitpcode (POC_MULWF, pic16_popGet (AOP (right), 0)); + } // if /* result is in PRODL:PRODH */ - if(AOP_TYPE(result) != AOP_ACC) { - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popCopyReg( - &pic16_pc_prodl), pic16_popGet(AOP(result), 0))); - - - if(AOP_SIZE(result)>1) { - - /* If s8 x s8 --> s16 multiplication was called for, fixup high byte. - * (left=a1a0, right=b1b0, X1: high byte, X0: low byte) - * - * a1a0 * b1b0 - * -------------- - * a1b0 a0b0 - * a1b1 a0b1 - * --------------- - * a0b0 a1= 0, b1= 0 (both unsigned) - * -b0 a0b0 a1=-1, b1= 0 (a signed and < 0, b unsigned or >= 0) - * -a0 a0b0 a1= 0, b1=-1 (b signed and < 0, a unsigned or >= 0) - * -(a0+b0) a0b0 a1=-1, b1=-1 (a and b signed and < 0) - * - * Currently, PRODH:PRODL holds a0b0 as 16 bit value; we need to - * subtract a0 and/or b0 from PRODH. */ - if (!IS_UNSIGNED(operandType(right))) { - /* right operand (b1) signed and < 0, then subtract left op (a0) */ - pic16_mov2w( AOP(left), 0 ); - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit_simple(AOP(right), 0, 7)); - pic16_emitpcode(POC_SUBWF, pic16_popCopyReg(&pic16_pc_prodh)); - } - - if (!IS_UNSIGNED(getSpec(operandType(left)))) { - /* left operand (a1) signed and < 0, then subtract right op (b0) */ - pic16_mov2w( AOP(right), 0 ); - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit_simple(AOP(left), 0, 7)); - pic16_emitpcode(POC_SUBWF, pic16_popCopyReg(&pic16_pc_prodh)); - } - - pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popCopyReg( - &pic16_pc_prodh), pic16_popGet(AOP(result), 1))); + if (AOP_TYPE (result) != AOP_ACC) + { + int isPRODL = (AOP (result)->type != AOP_STA && ! strcmp (pic16_aopGet (AOP (result), 0, TRUE, FALSE), "_PRODL")); - /* Must sign-extend here. */ - pic16_addSign(result, 2, !IS_UNSIGNED(operandType(left))); + if (AOP_SIZE (result) > 1) + { + /* If s8 x s8 --> s16 multiplication was called for, fixup high byte. + * (left=a1a0, right=b1b0, X1: high byte, X0: low byte) + * + * a1a0 * b1b0 + * -------------- + * a1b0 a0b0 + * a1b1 a0b1 + * --------------- + * a0b0 a1= 0, b1= 0 (both unsigned) + * -b0 a0b0 a1=-1, b1= 0 (a signed and < 0, b unsigned or >= 0) + * -a0 a0b0 a1= 0, b1=-1 (b signed and < 0, a unsigned or >= 0) + * -(a0+b0) a0b0 a1=-1, b1=-1 (a and b signed and < 0) + * + * Currently, PRODH:PRODL holds a0b0 as 16 bit value; we need to + * subtract a0 and/or b0 from PRODH. */ + if (!IS_UNSIGNED (operandType (right))) + { + /* right operand (b1) signed and < 0, then subtract left op (a0) */ + pic16_mov2w (AOP (left), 0); + pic16_emitpcode (POC_BTFSC, pic16_newpCodeOpBit_simple (AOP (right), 0, 7)); + pic16_emitpcode (POC_SUBWF, pic16_popCopyReg (&pic16_pc_prodh)); + } // if + + if (!IS_UNSIGNED (getSpec (operandType (left)))) + { + /* left operand (a1) signed and < 0, then subtract right op (b0) */ + pic16_mov2w (AOP (right), 0 ); + pic16_emitpcode (POC_BTFSC, pic16_newpCodeOpBit_simple (AOP (left), 0, 7)); + pic16_emitpcode (POC_SUBWF, pic16_popCopyReg (&pic16_pc_prodh)); + } // if + + /* Assing high byte of result -- this may overwrite one of the operands. */ + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popCopyReg(&pic16_pc_prodh), pic16_popGet (AOP (result), 1))); + } // if + + /* Assign low byte of result -- this may overwrite one of the operands. */ + if (!isPRODL) + { + pic16_emitpcode (POC_MOVFF, pic16_popGet2p (pic16_popCopyReg (&pic16_pc_prodl), pic16_popGet (AOP (result), 0))); + } // if + + /* Must sign/zero-extend here if size > 2. */ + if (AOP_SIZE (result) > 2) + { + pic16_addSign (result, 2, !IS_UNSIGNED (operandType (left))); + } // if } - } else { - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(&pic16_pc_prodl)); - } -} - -#if 0 -/*------------------------------------------------------------------* - * genUMult16X16_16 - unsigned multiplication of two 16-bit numbers * - *------------------------------------------------------------------*/ -void pic16_genUMult16X16_16 (operand *left, - operand *right, - operand *result) - -{ - pCodeOp *pct1, *pct2, *pct3, *pct4; - - FENTRY; - - - if (AOP_TYPE(right) == AOP_LIT) { - pic16_genMult8XLit_n(left,right,result); - return; - } - - /* cases: - A = A x B B = A x B - A = B x C - */ - /* if result == right then exchange left and right */ - if(pic16_sameRegs(AOP(result), AOP(right))) { - operand *tmp; - tmp = left; - left = right; - right = tmp; - } - - - if(pic16_sameRegs(AOP(result), AOP(left))) { - - pct1 = pic16_popGetTempReg(1); - pct2 = pic16_popGetTempReg(1); - pct3 = pic16_popGetTempReg(1); - pct4 = pic16_popGetTempReg(1); - - pic16_mov2w(AOP(left), 0); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(right), 0)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodl), pic16_pCodeOpCopy(pct1))); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodh), pic16_pCodeOpCopy(pct2))); - - /* WREG still holds the lower left */ - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(right), 1)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodl), pic16_pCodeOpCopy(pct3))); - - pic16_mov2w(AOP(left), 1); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(right), 0)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodl), pic16_pCodeOpCopy(pct4))); - - /* load result */ - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_pCodeOpCopy( pct1 ), pic16_popGet(AOP(result), 0))); - pic16_emitpcode(POC_MOVFW, pic16_pCodeOpCopy( pct2 )); - pic16_emitpcode(POC_ADDFW, pic16_pCodeOpCopy(pct3)); - pic16_emitpcode(POC_ADDFWC, pic16_pCodeOpCopy(pct4)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 1)); - - pic16_popReleaseTempReg( pct4, 1 ); - pic16_popReleaseTempReg( pct3, 1 ); - pic16_popReleaseTempReg( pct2, 1 ); - pic16_popReleaseTempReg( pct1, 1 ); - - } else { - - pic16_mov2w(AOP(left), 0); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(right), 0)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodl), pic16_popGet(AOP(result), 0))); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodh), pic16_popGet(AOP(result), 1))); - - /* WREG still holds the lower left */ - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(right), 1)); - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(&pic16_pc_prodl)); - pic16_emitpcode(POC_ADDWF, pic16_popGet(AOP(result), 1)); - - pic16_mov2w(AOP(left), 1); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(right), 0)); - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(&pic16_pc_prodl)); - pic16_emitpcode(POC_ADDWFC, pic16_popGet(AOP(result), 1)); - } -} -#endif - -#if 0 -void pic16_genSMult16X16_16(operand *left, - operand *right, - operand *result) -{ - -} -#endif - -#if 0 -/*-----------------------------------------------------------------* - * pic16_genSMult8X8_16 - signed multiplication of two 8-bit numbers - * - * this routine will call the unsigned multiply routine and then - * post-fix the sign bit. - *-----------------------------------------------------------------*/ -void pic16_genSMult8X8_8 (operand *left, - operand *right, - operand *result, - pCodeOpReg *result_hi) -{ - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - - if(!result_hi) { - result_hi = PCOR(pic16_popGet(AOP(result),1)); - } - - - pic16_genUMult8X8_8(left,right,result); - - -#if 0 - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit(pic16_aopGet(AOP(left),0,FALSE,FALSE),7,0, PO_GPR_REGISTER)); - pic16_emitpcode(POC_SUBWF, pic16_popCopyReg(result_hi)); - pic16_mov2w(AOP(left),0); - pic16_emitpcode(POC_BTFSC, pic16_newpCodeOpBit(pic16_aopGet(AOP(right),0,FALSE,FALSE),7,0, PO_GPR_REGISTER)); - pic16_emitpcode(POC_SUBWF, pic16_popGet(AOP(result),1)); -#endif -} -#endif - -/*-----------------------------------------------------------------* - * pic16_genMult8X8_8 - multiplication of two 8-bit numbers * - *-----------------------------------------------------------------*/ -void pic16_genMult8X8_8 (operand *left, - operand *right, - operand *result) -{ - FENTRY; - - if(AOP_TYPE(right) == AOP_LIT) - pic16_genMult8XLit_n(left,right,result); - else - pic16_genMult8X8_n(left,right,result); -} - - -#if 0 -/*-----------------------------------------------------------------* - * pic16_genMult16X16_16 - multiplication of two 16-bit numbers * - *-----------------------------------------------------------------*/ -void pic16_genMult16X16_16 (operand *left, - operand *right, - operand *result) -{ - FENTRY; - - if (AOP_TYPE(right) == AOP_LIT) - pic16_genUMult16XLit_16(left,right,result); else - pic16_genUMult16X16_16(left,right,result); -} -#endif - - -#if 0 -/*-----------------------------------------------------------------------* - * pic_genUMult32XLit_32 - unsigned multiplication of two 32-bit numbers * - *-----------------------------------------------------------------------*/ -void pic16_genUMult32XLit_32 (operand *left, - operand *right, - operand *result) -{ - pCodeOp *pct1, *pct2, *pct3, *pct4; - unsigned int lit; - int same; - - - FENTRY; - - if (AOP_TYPE(right) != AOP_LIT){ - fprintf(stderr,"%s %d - right operand is not a literal\n",__FILE__,__LINE__); - exit(1); - } - - lit = (unsigned int) ulFromVal (AOP(right)->aopu.aop_lit); - lit &= 0xffff; - - same = pic16_sameRegs(AOP(left), AOP(result)); - if(same) { - switch(lit) { - case 0: - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),0)); - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result),1)); - return; - case 2: - // its faster to left shift - emitCLRC; - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(left),0)); - pic16_emitpcode(POC_RLCF, pic16_popGet(AOP(left),1)); - return; - - default: { - DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); - - pct1 = pic16_popGetTempReg(1); - pct2 = pic16_popGetTempReg(1); - pct3 = pic16_popGetTempReg(1); - pct4 = pic16_popGetTempReg(1); - - pic16_emitpcode(POC_MOVLW, pic16_popGetLit( lit & 0xff)); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(left), 0)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodl), pic16_pCodeOpCopy(pct1))); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodh), pic16_pCodeOpCopy(pct2))); - - /* WREG still holds the low literal */ - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(left), 1)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodl), pic16_pCodeOpCopy(pct3))); - - pic16_emitpcode(POC_MOVLW, pic16_popGetLit( lit>>8 )); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(left), 0)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodl), pic16_pCodeOpCopy(pct4))); - - /* load result */ - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pct1, pic16_popGet(AOP(result), 0))); - pic16_emitpcode(POC_MOVFW, pic16_pCodeOpCopy(pct2)); - pic16_emitpcode(POC_ADDFW, pic16_pCodeOpCopy(pct3)); - pic16_emitpcode(POC_ADDFWC, pic16_pCodeOpCopy(pct4)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 1)); - - pic16_popReleaseTempReg( pct4, 1 ); - pic16_popReleaseTempReg( pct3, 1 ); - pic16_popReleaseTempReg( pct2, 1 ); - pic16_popReleaseTempReg( pct1, 1 ); - }; return; - } - } else { - // operands different - switch(lit) { - case 0: - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result), 0)); - pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result), 1)); - return; - case 2: - emitCLRC; - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(left), 0)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 0)); - pic16_emitpcode(POC_RLCFW, pic16_popGet(AOP(left), 1)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 1)); - return; - default: { - - pic16_emitpcode(POC_MOVLW, pic16_popGetLit( lit & 0xff)); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(left), 0)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodl), pic16_popGet(AOP(result), 0))); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodh), pic16_popGet(AOP(result), 1))); - - /* WREG still holds the low literal */ - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(left), 1)); - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(&pic16_pc_prodl)); - pic16_emitpcode(POC_ADDWF, pic16_popGet(AOP(result), 1)); - - pic16_emitpcode(POC_MOVLW, pic16_popGetLit( lit>>8 )); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(left), 0)); - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(&pic16_pc_prodl)); - pic16_emitpcode(POC_ADDWFC, pic16_popGet(AOP(result), 1)); - - }; return; - } - } -} -#endif - -#if 0 -/*------------------------------------------------------------------* - * genUMult32X32_32 - unsigned multiplication of two 32-bit numbers * - *------------------------------------------------------------------*/ -void pic16_genUMult32X32_32 (operand *left, - operand *right, - operand *result) - -{ - pCodeOp *pct1, *pct2, *pct3, *pct4; - - FENTRY; - - if (AOP_TYPE(right) == AOP_LIT) { - pic16_genMult8XLit_n(left,right,result); - return; - } - - /* cases: - A = A x B B = A x B - A = B x C - */ - /* if result == right then exchange left and right */ - if(pic16_sameRegs(AOP(result), AOP(right))) { - operand *tmp; - tmp = left; - left = right; - right = tmp; - } - - - if(pic16_sameRegs(AOP(result), AOP(left))) { - - pct1 = pic16_popGetTempReg(1); - pct2 = pic16_popGetTempReg(1); - pct3 = pic16_popGetTempReg(1); - pct4 = pic16_popGetTempReg(1); - - pic16_mov2w(AOP(left), 0); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(right), 0)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodl), pic16_pCodeOpCopy(pct1))); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodh), pic16_pCodeOpCopy(pct2))); - - /* WREG still holds the lower left */ - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(right), 1)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodl), pic16_pCodeOpCopy(pct3))); - - pic16_mov2w(AOP(left), 1); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(right), 0)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodl), pic16_pCodeOpCopy(pct4))); - - /* load result */ - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_pCodeOpCopy( pct1 ), pic16_popGet(AOP(result), 0))); - pic16_emitpcode(POC_MOVFW, pic16_pCodeOpCopy( pct2 )); - pic16_emitpcode(POC_ADDFW, pic16_pCodeOpCopy(pct3)); - pic16_emitpcode(POC_ADDFWC, pic16_pCodeOpCopy(pct4)); - pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result), 1)); - - pic16_popReleaseTempReg( pct4, 1 ); - pic16_popReleaseTempReg( pct3, 1 ); - pic16_popReleaseTempReg( pct2, 1 ); - pic16_popReleaseTempReg( pct1, 1 ); - - } else { - - pic16_mov2w(AOP(left), 0); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(right), 0)); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodl), pic16_popGet(AOP(result), 0))); - pic16_emitpcode(POC_MOVFF, pic16_popGet2p( - pic16_popCopyReg(&pic16_pc_prodh), pic16_popGet(AOP(result), 1))); - - /* WREG still holds the lower left */ - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(right), 1)); - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(&pic16_pc_prodl)); - pic16_emitpcode(POC_ADDWF, pic16_popGet(AOP(result), 1)); - - pic16_mov2w(AOP(left), 1); - pic16_emitpcode(POC_MULWF, pic16_popGet(AOP(right), 0)); - pic16_emitpcode(POC_MOVFW, pic16_popCopyReg(&pic16_pc_prodl)); - pic16_emitpcode(POC_ADDWFC, pic16_popGet(AOP(result), 1)); - } -} -#endif - - -#if 0 -/*-----------------------------------------------------------------* - * pic16_genMult32X32_32 - multiplication of two 32-bit numbers * - *-----------------------------------------------------------------*/ -void pic16_genMult32X32_32 (operand *left, - operand *right, - operand *result) -{ - FENTRY; - - if (AOP_TYPE(right) == AOP_LIT) - pic16_genUMult32XLit_32(left,right,result); - else - pic16_genUMult32X32_32(left,right,result); -} -#endif - - - - - - - -#if 0 -/*-----------------------------------------------------------------*/ -/* constMult - generates code for multiplication by a constant */ -/*-----------------------------------------------------------------*/ -void genMultConst(unsigned C) -{ - - unsigned lit; - unsigned sr3; // Shift right 3 - unsigned mask; - - int size = 1; - - /* - Convert a string of 3 binary 1's in the lit into - 0111 = 1000 - 1; - */ - - mask = 7 << ( (size*8) - 3); - lit = C; - sr3 = 0; - - while(mask < (1<>= 1; - - } - } - -#endif diff -Nru sdcc-3.1.0+dfsg/src/pic16/genutils.c sdcc-3.2.0+dfsg/src/pic16/genutils.c --- sdcc-3.1.0+dfsg/src/pic16/genutils.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic16/genutils.c 2012-01-26 17:33:28.000000000 +0000 @@ -69,9 +69,6 @@ /*-----------------------------------------------------------------*/ void pic16_genNot (iCode *ic) { - int size; -// symbol *tlbl; - /* * result[AOP_CRY,AOP_REG] = ! left[AOP_CRY, AOP_REG] */ @@ -96,9 +93,8 @@ goto release; } - size = AOP_SIZE(IC_LEFT(ic)); #if 0 - if(size == 1) { + if(AOP_SIZE(IC_LEFT(ic)) == 1) { pic16_emitpcode(POC_COMFW,pic16_popGet(AOP(IC_LEFT(ic)),0)); pic16_emitpcode(POC_ANDLW,pic16_popGetLit(1)); pic16_emitpcode(POC_MOVWF,pic16_popGet(AOP(IC_RESULT(ic)),0)); diff -Nru sdcc-3.1.0+dfsg/src/pic16/glue.c sdcc-3.2.0+dfsg/src/pic16/glue.c --- sdcc-3.1.0+dfsg/src/pic16/glue.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic16/glue.c 2012-06-28 14:09:28.000000000 +0000 @@ -1,25 +1,21 @@ /*------------------------------------------------------------------------- - glue.c - glues everything we have done together into one file. - Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998) - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! + Copyright (C) 1998, Sandeep Dutta . sandeep.dutta@usa.net + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -------------------------------------------------------------------------*/ #include "../common.h" @@ -65,7 +61,7 @@ void pic16_pCodeInitRegisters (void); pCodeOp *pic16_popCopyReg (pCodeOpReg *pc); -extern void pic16_pCodeConstString (char *name, char *value, unsigned length); +extern void pic16_pCodeConstString (char *name, const char *value, unsigned length); /*-----------------------------------------------------------------*/ @@ -166,6 +162,10 @@ !IS_STATIC (sym->etype) && !IS_FUNC(sym->type)) { checkAddSym(&publics, sym); + } else if (IS_AGGREGATE(sym->type) && sym->level == 0 && ! IS_STATIC(sym->etype)) { + /* If a global variable is not static and will be included in the published list. */ + + checkAddSym(&publics, sym); } else /* new version */ if(IS_STATIC(sym->etype) @@ -613,7 +613,7 @@ val = valCastLiteral(type, floatFromVal(val)); } - for (i = 0; i < getSize (type); i++) { + for (i = 0; i < (int)getSize (type); i++) { pic16_emitDB(pic16aopLiteral(val, i), ptype, p); } // for } @@ -622,10 +622,11 @@ /* pic16_printIvalChar - generates initital value for character array */ /*--------------------------------------------------------------------*/ static int -pic16_printIvalChar (symbol *sym, sym_link * type, initList * ilist, char *s, char ptype, void *p) +pic16_printIvalChar (symbol *sym, sym_link * type, initList * ilist, const char *s, char ptype, void *p) { value *val; - int remain, len, ilen; + int len; + size_t remain, ilen; if(!p) return 0; @@ -781,7 +782,7 @@ unsigned long ival = 0; int size = 0; int bit_start = 0; - unsigned long i; + int i; #if DEBUG_PRINTIVAL @@ -886,7 +887,7 @@ { //symbol *sflds; initList *iloop = NULL; - int size; + unsigned int size; symbol *sflds = NULL; #if DEBUG_PRINTIVAL @@ -1438,7 +1439,7 @@ for(i=0;i<=(pic16->cwInfo.confAddrEnd-pic16->cwInfo.confAddrStart);i++) if(pic16->cwInfo.crInfo[i].emit) //mask != -1) - fprintf (of, "\t__config 0x%x, 0x%02x\n", + fprintf (of, "\t__config 0x%06x, 0x%02x\n", pic16->cwInfo.confAddrStart+i, (unsigned char) pic16->cwInfo.crInfo[i].value); } @@ -1575,7 +1576,7 @@ for(sym = setFirstItem (publics); sym; sym = setNextItem (publics)) /* sanity check */ if(!IS_STATIC(sym->etype)) - pic16_emitSymbolIfNew(afile, "\tglobal %s\n", sym->rname, 0); + pic16_emitSymbolIfNew(afile, "\tglobal\t%s\n", sym->rname, 0); } /*-----------------------------------------------------------------*/ @@ -1595,10 +1596,10 @@ fprintf(afile, "%s", iComments2); for(sym = setFirstItem(externs); sym; sym = setNextItem(externs)) - pic16_emitSymbolIfNew(afile, "\textern %s\n", sym->rname, 1); + pic16_emitSymbolIfNew(afile, "\textern\t%s\n", sym->rname, 1); for(sym = setFirstItem(pic16_builtin_functions); sym; sym = setNextItem(pic16_builtin_functions)) - pic16_emitSymbolIfNew(afile, "\textern _%s\n", sym->name, 1); + pic16_emitSymbolIfNew(afile, "\textern\t_%s\n", sym->name, 1); } /*-----------------------------------------------------------------*/ @@ -1692,8 +1693,8 @@ { unsigned long isize, udsize, ramsize; statistics.isize = pic16_countInstructions(); - isize = (statistics.isize >= 0) ? statistics.isize : 0; - udsize = (statistics.udsize >= 0) ? statistics.udsize : 0; + isize = (((long)statistics.isize) >= 0) ? statistics.isize : 0; + udsize = (((long)statistics.udsize) >= 0) ? statistics.udsize : 0; ramsize = pic16 ? pic16->RAMsize : 0x200; ramsize -= 256; /* ignore access bank and SFRs */ if (ramsize == 0) ramsize = 64; /* prevent division by zero (below) */ @@ -1860,7 +1861,7 @@ /* if external stack then reserve space of it */ if(mainf && IFFUNC_HASBODY(mainf->type) && options.useXstack ) { fprintf (asmFile, "%s", iComments2); - fprintf (asmFile, "; external stack \n"); + fprintf (asmFile, "; external stack\n"); fprintf (asmFile, "%s", iComments2); fprintf (asmFile,";\t.area XSEG (XDATA)\n"); /* MOF */ fprintf (asmFile,";\t.ds 256\n"); @@ -1887,7 +1888,7 @@ /* copy the interrupt vector table */ if(mainf && IFFUNC_HASBODY(mainf->type)) { fprintf (asmFile, "\n%s", iComments2); - fprintf (asmFile, "; interrupt vector \n"); + fprintf (asmFile, "; interrupt vector\n"); fprintf (asmFile, "%s", iComments2); dbuf_write_and_destroy (&vBuf, asmFile); } diff -Nru sdcc-3.1.0+dfsg/src/pic16/main.c sdcc-3.2.0+dfsg/src/pic16/main.c --- sdcc-3.1.0+dfsg/src/pic16/main.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic16/main.c 2012-07-06 08:41:29.000000000 +0000 @@ -25,11 +25,11 @@ -------------------------------------------------------------------------*/ #include "common.h" -#include "SDCCsystem.h" +#include "dbuf_string.h" + #include "main.h" #include "ralloc.h" #include "device.h" -#include "SDCCutil.h" #include "glue.h" #include "pcode.h" #include "SDCCargs.h" @@ -163,7 +163,8 @@ P_STACK = 1, P_CODE, P_UDATA, - P_LIBRARY + P_LIBRARY, + P_CONFIG }; static int @@ -184,7 +185,7 @@ reg_info *reg; symbol *sym; - cp = get_pragma_token(cp, &token); + cp = get_pragma_token (cp, &token); if (TOKEN_INT != token.type) { err = 1; @@ -192,7 +193,7 @@ } stackPos = token.val.int_val; - cp = get_pragma_token(cp, &token); + cp = get_pragma_token (cp, &token); if (TOKEN_INT != token.type) { err = 1; @@ -200,7 +201,7 @@ } stackLen = token.val.int_val; - cp = get_pragma_token(cp, &token); + cp = get_pragma_token (cp, &token); if (TOKEN_EOL != token.type) { err = 1; @@ -209,7 +210,7 @@ if (stackLen < 1) { stackLen = 64; - fprintf(stderr, "%s:%d: warning: setting stack to default size %d (0x%04x)\n", + fprintf (stderr, "%s:%d: warning: setting stack to default size %d (0x%04x)\n", filename, lineno, stackLen, stackLen); } @@ -238,19 +239,19 @@ } } - reg = newReg(REG_SFR, PO_SFR_REGISTER, stackPos, "_stack", stackLen-1, 0, NULL); - addSet(&pic16_fix_udata, reg); + reg = newReg (REG_SFR, PO_SFR_REGISTER, stackPos, "_stack", stackLen-1, 0, NULL); + addSet (&pic16_fix_udata, reg); - reg = newReg(REG_SFR, PO_SFR_REGISTER, stackPos + stackLen-1, "_stack_end", 1, 0, NULL); - addSet(&pic16_fix_udata, reg); + reg = newReg (REG_SFR, PO_SFR_REGISTER, stackPos + stackLen-1, "_stack_end", 1, 0, NULL); + addSet (&pic16_fix_udata, reg); - sym = newSymbol("stack", 0); - sprintf(sym->rname, "_%s", sym->name); - addSet(&publics, sym); - - sym = newSymbol("stack_end", 0); - sprintf(sym->rname, "_%s", sym->name); - addSet(&publics, sym); + sym = newSymbol ("stack", 0); + sprintf (sym->rname, "_%s", sym->name); + addSet (&publics, sym); + + sym = newSymbol ("stack_end", 0); + sprintf (sym->rname, "_%s", sym->name); + addSet (&publics, sym); initsfpnt = 1; // force glue() to initialize stack/frame pointers */ } @@ -261,14 +262,14 @@ { absSym *absS; - cp = get_pragma_token(cp, &token); + cp = get_pragma_token (cp, &token); if (TOKEN_STR != token.type) goto code_err; - absS = Safe_calloc(1, sizeof(absSym)); - sprintf(absS->name, "_%s", get_pragma_string(&token)); + absS = Safe_calloc (1, sizeof (absSym)); + sprintf (absS->name, "_%s", get_pragma_string (&token)); - cp = get_pragma_token(cp, &token); + cp = get_pragma_token (cp, &token); if (TOKEN_INT != token.type) { code_err: @@ -278,7 +279,7 @@ } absS->address = token.val.int_val; - cp = get_pragma_token(cp, &token); + cp = get_pragma_token (cp, &token); if (TOKEN_EOL != token.type) { err = 1; @@ -287,11 +288,11 @@ if ((absS->address % 2) != 0) { absS->address--; - fprintf(stderr, "%s:%d: warning: code memory locations should be word aligned, will locate to 0x%06x instead\n", - filename, lineno, absS->address); + fprintf (stderr, "%s:%d: warning: code memory locations should be word aligned, will locate to 0x%06x instead\n", + filename, lineno, absS->address); } - addSet(&absSymSet, absS); + addSet (&absSymSet, absS); // fprintf(stderr, "%s:%d symbol %s will be placed in location 0x%06x in code memory\n", // __FILE__, __LINE__, symname, absS->address); } @@ -307,18 +308,18 @@ sectName *snam; int found = 0; - cp = get_pragma_token(cp, &token); + cp = get_pragma_token (cp, &token); if (TOKEN_STR == token.type) - sectname = Safe_strdup(get_pragma_string(&token)); + sectname = Safe_strdup (get_pragma_string (&token)); else { err = 1; break; } - cp = get_pragma_token(cp, &token); + cp = get_pragma_token (cp, &token); if (TOKEN_STR == token.type) - symname = get_pragma_string(&token); + symname = get_pragma_string (&token); else { //fprintf (stderr, "%s:%d: #pragma udata [section-name] [symbol] -- section-name or symbol missing!\n", filename, lineno); @@ -328,24 +329,24 @@ while (symname) { - ssym = Safe_calloc(1, sizeof(sectSym)); - ssym->name = Safe_calloc(1, strlen(symname) + 2); - sprintf(ssym->name, "%s%s", port->fun_prefix, symname); + ssym = Safe_calloc (1, sizeof (sectSym)); + ssym->name = Safe_calloc (1, strlen (symname) + 2); + sprintf (ssym->name, "%s%s", port->fun_prefix, symname); ssym->reg = NULL; - addSet(§Syms, ssym); + addSet (§Syms, ssym); - nsym = newSymbol((char *)symname, 0); + nsym = newSymbol ((char *)symname, 0); strcpy(nsym->rname, ssym->name); #if 0 - checkAddSym(&publics, nsym); + checkAddSym (&publics, nsym); #endif found = 0; - for (snam = setFirstItem(sectNames);snam;snam=setNextItem(sectNames)) + for (snam = setFirstItem (sectNames); snam; snam = setNextItem (sectNames)) { - if (!strcmp(sectname, snam->name)) + if (!strcmp (sectname, snam->name)) { found=1; break; @@ -354,23 +355,23 @@ if(!found) { - snam = Safe_calloc(1, sizeof(sectName)); - snam->name = Safe_strdup(sectname); + snam = Safe_calloc (1, sizeof (sectName)); + snam->name = Safe_strdup (sectname); snam->regsSet = NULL; - addSet(§Names, snam); + addSet (§Names, snam); } ssym->section = snam; #if 0 - fprintf(stderr, "%s:%d placing symbol %s at section %s (%p)\n", __FILE__, __LINE__, - ssym->name, snam->name, snam); + fprintf (stderr, "%s:%d placing symbol %s at section %s (%p)\n", __FILE__, __LINE__, + ssym->name, snam->name, snam); #endif - cp = get_pragma_token(cp, &token); + cp = get_pragma_token (cp, &token); if (TOKEN_STR == token.type) - symname = get_pragma_string(&token); + symname = get_pragma_string (&token); else if (TOKEN_EOL == token.type) symname = NULL; else @@ -380,7 +381,7 @@ } } - Safe_free(sectname); + Safe_free (sectname); } break; @@ -389,10 +390,10 @@ { const char *lmodule; - cp = get_pragma_token(cp, &token); + cp = get_pragma_token (cp, &token); if (TOKEN_EOL != token.type) { - lmodule = get_pragma_string(&token); + lmodule = get_pragma_string (&token); /* lmodule can be: * c link the C library @@ -401,22 +402,22 @@ * debug link the debug libary * anything else, will link as-is */ - if(!strcmp(lmodule, "c")) + if(!strcmp (lmodule, "c")) libflags.want_libc = 1; - else if(!strcmp(lmodule, "math")) + else if(!strcmp (lmodule, "math")) libflags.want_libm = 1; - else if(!strcmp(lmodule, "io")) + else if(!strcmp (lmodule, "io")) libflags.want_libio = 1; - else if(!strcmp(lmodule, "debug")) + else if(!strcmp (lmodule, "debug")) libflags.want_libdebug = 1; - else if(!strcmp(lmodule, "ignore")) + else if(!strcmp (lmodule, "ignore")) libflags.ignore = 1; else { if(!libflags.ignore) { - fprintf(stderr, "link library %s\n", lmodule); - addSetHead(&libFilesSet, (char *)lmodule); + fprintf (stderr, "link library %s\n", lmodule); + addSetHead (&libFilesSet, (char *)lmodule); } } } @@ -426,7 +427,7 @@ break; } - cp = get_pragma_token(cp, &token); + cp = get_pragma_token (cp, &token); if (TOKEN_EOL != token.type) { err = 1; @@ -435,25 +436,102 @@ } break; + case P_CONFIG: + { + const char *begin; + struct dbuf_s dbuf; + bool first = TRUE; + + token.type = TOKEN_EOL; /* just to make the final error test happy */ + + dbuf_init (&dbuf, 128); + dbuf_append_str (&dbuf, "CONFIG\t"); + + do + { + if (first) + first = FALSE; + else + { + if (',' == *cp) + ++cp; + else + goto error; + + dbuf_append_char (&dbuf, ','); + } + + + while (isspace (*cp)) + ++cp; + + if (*cp == '_' || isalpha (*cp)) + { + begin = cp++; + while (*cp == '_' || isalnum (*cp)) + ++cp; + dbuf_append (&dbuf, begin, cp - begin); + } + else + goto error; + + while (isspace (*cp)) + ++cp; + + if ('=' == *cp) + dbuf_append_char (&dbuf, *cp++); + else + goto error; + + while (isspace (*cp)) + ++cp; + + if (*cp == '_' || isalnum (*cp)) + { + begin = cp++; + while (*cp == '_' || isalnum (*cp)) + ++cp; + dbuf_append (&dbuf, begin, cp - begin); + } + else + goto error; + + while (isspace (*cp)) + ++cp; + } + while ('\0' != *cp); + + dbuf_append_str (&dbuf, "\n\tcode"); + createConfigure(NULL, dbuf_detach_c_str (&dbuf)); + break; + + error: + dbuf_destroy(&dbuf); + err = 1; + } + break; + #if 0 /* This is an experimental code for #pragma inline and is temporarily disabled for 2.5.0 release */ case P_INLINE: { - char *tmp = strtok((char *)NULL, WHITECOMMA); + char *tmp = strtok ((char *)NULL, WHITECOMMA); - while(tmp) { - addSet(&asmInlineMap, Safe_strdup( tmp )); - tmp = strtok((char *)NULL, WHITECOMMA); - } + while (tmp) + { + addSet (&asmInlineMap, Safe_strdup ( tmp )); + tmp = strtok ((char *)NULL, WHITECOMMA); + } - { - char *s; + { + char *s; - for(s = setFirstItem(asmInlineMap); s ; s = setNextItem(asmInlineMap)) { - debugf("inline asm: `%s'\n", s); + for (s = setFirstItem (asmInlineMap); s ; s = setNextItem (asmInlineMap)) + { + debugf ("inline asm: `%s'\n", s); + } } - } } break; #endif /* 0 */ @@ -463,12 +541,12 @@ break; } - get_pragma_token(cp, &token); + get_pragma_token (cp, &token); - if (1 == err) - werror(W_BAD_PRAGMA_ARGUMENTS, name); + if (1 == err || token.type != TOKEN_EOL) + werror (W_BAD_PRAGMA_ARGUMENTS, name); - free_pragma_token(&token); + free_pragma_token (&token); return processed; } @@ -477,6 +555,7 @@ { "code", P_CODE, 0, do_pragma }, { "udata", P_UDATA, 0, do_pragma }, { "library", P_LIBRARY, 0, do_pragma }, + { "config", P_CONFIG, 0, do_pragma }, /*{ "inline", P_INLINE, 0, do_pragma }, */ { NULL, 0, 0, NULL }, }; @@ -715,6 +794,8 @@ static void _pic16_finaliseOptions (void) { + struct dbuf_s dbuf; + port->mem.default_local_map = data; port->mem.default_globl_map = data; @@ -732,22 +813,48 @@ options.intlong_rent = 1; #endif - setMainValue("mcu", pic16->name[2] ); - addSet(&preArgvSet, Safe_strdup("-D{mcu}")); + dbuf_init (&dbuf, 128); - setMainValue("mcu1", pic16->name[1] ); - addSet(&preArgvSet, Safe_strdup("-D__{mcu1}")); +/* + * deprecated in sdcc 3.2.0 + * TODO: should be obsoleted in sdcc 3.3.0 or later + if (options.std_sdcc) + */ + { + dbuf_append (&dbuf, "-D", sizeof ("-D") - 1); + dbuf_append_str (&dbuf, pic16->name[2]); + addSet (&preArgvSet, Safe_strdup (dbuf_c_str (&dbuf))); + } + + dbuf_set_length (&dbuf, 0); + dbuf_append (&dbuf, "-D__", sizeof ("-D__") - 1); + dbuf_append_str (&dbuf, pic16->name[1]); + addSet (&preArgvSet, Safe_strdup (dbuf_c_str (&dbuf))); - if (!pic16_options.nodefaultlibs) { - char devlib[512]; + char *upperProc, *p1, *p2; + int len; + dbuf_set_length (&dbuf, 0); + len = strlen (port->processor); + upperProc = Safe_malloc (len); + for (p1 = port->processor, p2 = upperProc; *p1; ++p1, ++p2) + { + *p2 = toupper (*p1); + } + dbuf_append (&dbuf, "-D__SDCC_PIC", sizeof ("-D__SDCC_PIC") - 1); + dbuf_append (&dbuf, upperProc, len); + addSet (&preArgvSet, dbuf_detach_c_str (&dbuf)); + } + if (!pic16_options.nodefaultlibs) + { /* now add the library for the device */ - sprintf(devlib, "libdev%s.lib", pic16->name[1]); /* e.g., libdev18f452.lib */ - addSet(&libFilesSet, Safe_strdup(devlib)); + dbuf_set_length (&dbuf, 0); + dbuf_printf (&dbuf, "libdev%s.lib", pic16->name[1]); /* e.g., libdev18f452.lib */ + addSet (&libFilesSet, Safe_strdup (dbuf_c_str (&dbuf))); /* add the internal SDCC library */ - addSet(&libFilesSet, Safe_strdup( "libsdcc.lib" )); + addSet (&libFilesSet, Safe_strdup ("libsdcc.lib" )); } if (alt_asm && alt_asm[0] != '\0') @@ -768,29 +875,54 @@ if (options.model == MODEL_SMALL) { - addSet(&asmOptionsSet, Safe_strdup("-DSDCC_MODEL_SMALL")); + addSet (&asmOptionsSet, Safe_strdup ("-DSDCC_MODEL_SMALL")); } else if (options.model == MODEL_LARGE) { - char buf[128]; + char *s, *p; - addSet(&asmOptionsSet, Safe_strdup("-DSDCC_MODEL_LARGE")); + addSet (&asmOptionsSet, Safe_strdup ("-DSDCC_MODEL_LARGE")); - sprintf(buf, "-D%s -D__%s", pic16->name[2], pic16->name[1]); - *(strrchr(buf, 'f')) = 'F'; - addSet(&asmOptionsSet, Safe_strdup(buf)); + dbuf_printf (&dbuf, "-D%s -D__%s", pic16->name[2], pic16->name[1]); + s = Safe_strdup (dbuf_c_str (&dbuf)); + /* TODO: borut - why only the first 'f' is converted to upper case? + * What if there is an other letter instead 'f'? + */ + if (NULL != (p = strrchr (s, 'f'))) + *p = 'F'; + addSet (&asmOptionsSet, s); } if (STACK_MODEL_LARGE) { - addSet(&preArgvSet, Safe_strdup("-DSTACK_MODEL_LARGE")); - addSet(&asmOptionsSet, Safe_strdup("-DSTACK_MODEL_LARGE")); +/* + * deprecated in sdcc 3.2.0 + * TODO: should be obsoleted in sdcc 3.3.0 or later + if (options.std_sdcc) + */ + { + addSet (&preArgvSet, Safe_strdup ("-DSTACK_MODEL_LARGE")); + addSet (&asmOptionsSet, Safe_strdup ("-DSTACK_MODEL_LARGE")); + } + addSet (&preArgvSet, Safe_strdup ("-D__STACK_MODEL_LARGE")); + addSet (&asmOptionsSet, Safe_strdup ("-D__STACK_MODEL_LARGE")); } else { - addSet(&preArgvSet, Safe_strdup("-DSTACK_MODEL_SMALL")); - addSet(&asmOptionsSet, Safe_strdup("-DSTACK_MODEL_SMALL")); +/* + * deprecated in sdcc 3.2.0 + * TODO: should be obsoleted in sdcc 3.3.0 or later + if (options.std_sdcc) + */ + { + addSet (&preArgvSet, Safe_strdup ("-DSTACK_MODEL_SMALL")); + addSet (&asmOptionsSet, Safe_strdup ("-DSTACK_MODEL_SMALL")); + } + addSet (&preArgvSet, Safe_strdup ("-D__STACK_MODEL_SMALL")); + addSet (&asmOptionsSet, Safe_strdup ("-D__STACK_MODEL_SMALL")); } + + dbuf_destroy (&dbuf); } @@ -1065,6 +1197,7 @@ { if (op == RRC || op == RLC + || op == GETABIT /* || op == GETHBIT */ /* GETHBIT doesn't look complete for PIC */ ) return TRUE; @@ -1113,7 +1246,7 @@ TARGET_ID_PIC16, "pic16", "MCU PIC16", /* Target name */ - "p18f452", /* Processor */ + "18f452", /* Processor */ { pic16glue, TRUE, /* Emit glue around main */ diff -Nru sdcc-3.1.0+dfsg/src/pic16/pcode.c sdcc-3.2.0+dfsg/src/pic16/pcode.c --- sdcc-3.1.0+dfsg/src/pic16/pcode.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic16/pcode.c 2012-04-07 17:15:16.000000000 +0000 @@ -1,23 +1,23 @@ /*------------------------------------------------------------------------- - pcode.c - post code generation - Written By - Scott Dattalo scott@dattalo.com - Ported to PIC16 By - Martin Dubuc m.dubuc@rogers.com - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + Copyright (C) 2000, Scott Dattalo scott@dattalo.com + PIC16 port: + Copyright (C) 2002, Martin Dubuc m.dubuc@rogers.com + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -------------------------------------------------------------------------*/ #include @@ -193,6 +193,7 @@ pCodeOp *pic16_popGetLit2(int, pCodeOp *); pCodeOp *pic16_popGetLit(int); pCodeOp *pic16_popGetWithString(char *); +int isBanksel(pCode *pc); extern int inWparamList(char *s); /** data flow optimization helpers **/ @@ -431,7 +432,8 @@ 0, // second literal operand POC_NOP, (PCC_W | PCC_REGISTER), // inCond - (PCC_W | PCC_Z | PCC_N) // outCond + (PCC_W | PCC_Z | PCC_N), // outCond + PCI_MAGIC }; pCodeInstruction pic16_pciBC = { // mdubuc - New @@ -4444,7 +4446,7 @@ /*-----------------------------------------------------------------*/ /*-----------------------------------------------------------------*/ -void pic16_pCodeConstString(char *name, char *value, unsigned length) +void pic16_pCodeConstString(char *name, const char *value, unsigned length) { pBlock *pb; char *item; @@ -6058,14 +6060,12 @@ static int isBankInstruction(pCode *pc) { reg_info *reg; - int bank = -1; if(!isPCI(pc)) return 0; if( PCI(pc)->op == POC_MOVLB || (( (reg = pic16_getRegFromInstruction(pc)) != NULL) && isBSR_REG(reg))) { - bank = PCOL(pc)->lit; } return 1; @@ -6078,7 +6078,6 @@ { pCode *pc; - int cur_bank; if(!isPCFL(pcflow)) return; @@ -6092,8 +6091,6 @@ return; } - cur_bank = -1; - do { isBankInstruction(pc); pc = pc->next; @@ -6374,7 +6371,7 @@ symbol *tlbl; pCode *pcnext, *pcprev, *npci, *ppc; PIC_OPCODE ipci; - int ofs1=0, ofs2=0, len=0; + int ofs1=0, ofs2=0; /* just like 0, but previous was a skip instruction, * so some care should be taken */ @@ -6391,7 +6388,6 @@ /* copy info from old pCode */ ofs1 = ofs2 = sizeof( pCode ) + sizeof(PIC_OPCODE); - len = sizeof(pCodeInstruction) - ofs1 - sizeof( char const * const *); ofs1 += strlen( PCI(pcprev)->mnemonic) + 1; ofs2 += strlen( PCI(npci)->mnemonic) + 1; memcpy(&PCI(npci)->from, &PCI(pcprev)->from, (char *)(&(PCI(npci)->pci_magic)) - (char *)(&(PCI(npci)->from))); @@ -10076,7 +10072,7 @@ dynstack_t *todo; /** stack of state_t */ dynstack_t *done; /** stack of state_t */ - int firstState, n_defs; + int n_defs; assert (pc && isPCI(pc) && PCI(pc)->pcflow); assert (chain); @@ -10126,7 +10122,7 @@ /* no definition found in pc's flow preceeding pc */ todo = newStack (); done = newStack (); - n_defs = 0; firstState = 1; + n_defs = 0; stackPush (todo, newState (PCI(pic16_findNextInstruction(pc->pb->pcHead))->pcflow, res)); while (!stackIsEmpty (todo)) { @@ -10171,54 +10167,58 @@ #else // !FORWARD_FLOW_ANALYSIS - /* no definition found in pc's flow preceeding pc */ - todo = newStack (); - done = newStack (); - n_defs = 0; firstState = 1; - stackPush (todo, newState (PCI(pc)->pcflow, res)); - - while (!stackIsEmpty (todo)) { - state = (state_t *) stackPop (todo); - curr = state->flow; + { + int firstState = 1; - if (firstState) { - firstState = 0; - /* only check predecessor flows */ - } else { - /* get (last) definition of sym in this flow */ - res = defmapFindDef (curr->defmap, sym, NULL); - } + /* no definition found in pc's flow preceeding pc */ + todo = newStack (); + done = newStack (); + n_defs = 0; + stackPush (todo, newState (PCI(pc)->pcflow, res)); + + while (!stackIsEmpty (todo)) { + state = (state_t *) stackPop (todo); + curr = state->flow; + + if (firstState) { + firstState = 0; + /* only check predecessor flows */ + } else { + /* get (last) definition of sym in this flow */ + res = defmapFindDef (curr->defmap, sym, NULL); + } - if (res) { - /* definition found */ - //fprintf (stderr, "reaching definition for %s @ %p found @ %p (val: %x)\n", strFromSym(sym), pc, res->pc, res->val); - if (defmapAddCopyIfNew (chain, res)) n_defs++; - } else { - /* no definition found -- check predecessor flows */ - state = newState (NULL, NULL); - succ = (pCodeFlowLink *) setFirstItem (curr->from); - - /* if no flow predecessor available -- sym might be uninitialized */ - if (!succ) { - //fprintf (stder, "sym %s might be used uninitialized at %p\n", strFromSym (sym), pc); - res = newDefmap (sym, 0xff, 0, 1, NULL, 0, *chain); - if (defmapAddCopyIfNew (chain, res)) n_defs++; - deleteDefmap (res); res = NULL; - } + if (res) { + /* definition found */ + //fprintf (stderr, "reaching definition for %s @ %p found @ %p (val: %x)\n", strFromSym(sym), pc, res->pc, res->val); + if (defmapAddCopyIfNew (chain, res)) n_defs++; + } else { + /* no definition found -- check predecessor flows */ + state = newState (NULL, NULL); + succ = (pCodeFlowLink *) setFirstItem (curr->from); + + /* if no flow predecessor available -- sym might be uninitialized */ + if (!succ) { + //fprintf (stder, "sym %s might be used uninitialized at %p\n", strFromSym (sym), pc); + res = newDefmap (sym, 0xff, 0, 1, NULL, 0, *chain); + if (defmapAddCopyIfNew (chain, res)) n_defs++; + deleteDefmap (res); res = NULL; + } - while (succ) { - //fprintf (stderr, " %p --> %p with %x\n", curr, succ->pcflow, res ? res->val : 0); - state->flow = succ->pcflow; - state->lastdef = res; - if (stateIsNew (state, todo, done)) { - stackPush (todo, state); - state = newState (NULL, NULL); - } // if - succ = (pCodeFlowLink *) setNextItem (curr->from); + while (succ) { + //fprintf (stderr, " %p --> %p with %x\n", curr, succ->pcflow, res ? res->val : 0); + state->flow = succ->pcflow; + state->lastdef = res; + if (stateIsNew (state, todo, done)) { + stackPush (todo, state); + state = newState (NULL, NULL); + } // if + succ = (pCodeFlowLink *) setNextItem (curr->from); + } // while + deleteState (state); + } } // while - deleteState (state); } - } // while #endif @@ -10428,7 +10428,6 @@ /* Check whether a symbol is alive (AFTER pc). */ static int pic16_isAlive (symbol_t sym, pCode *pc) { int mask, visit; - defmap_t *map; dynstack_t *todo, *done; state_t *state; pCodeFlow *pcfl; @@ -10438,7 +10437,6 @@ assert (isPCI(pc)); pcfl = PCI(pc)->pcflow; - map = pcfl->defmap; todo = newStack (); done = newStack (); @@ -10552,7 +10550,7 @@ * Returns 0 if no symbol is used later on, 1 otherwise. */ static int pic16_pCodeIsAlive (pCode *pc) { pCodeInstruction *pci; - defmap_t *map, *lastpc; + defmap_t *map; reg_info *checkreg; /* we can only handle PCIs */ @@ -10638,9 +10636,6 @@ return 1; } - /* remember first item assigned to pc for later use */ - lastpc = map; - /* check all symbols being modified by pc */ while (map && map->pc == pc) { if (map->sym == 0) { map = map->next; continue; } @@ -10830,7 +10825,6 @@ pCodeInstruction *pci; int cond, inCond, outCond; int mask = 0xff, smask; - int isSpecial, isSpecial2; symbol_t sym, sym2; char *name; @@ -11002,19 +10996,18 @@ //fprintf (stderr, "pc %p: def STATUS & %02x\n", pc, smask); } // if - isSpecial = isSpecial2 = 0; sym = sym2 = 0; if (cond & PCC_REGISTER) { name = pic16_get_op (pci->pcop, NULL, 0); sym = symFromStr (name); - isSpecial = fixupSpecialOperands (sym, mask, mask, pc, newValnum(), &list, inCond & PCC_REGISTER, outCond & PCC_REGISTER); + fixupSpecialOperands (sym, mask, mask, pc, newValnum(), &list, inCond & PCC_REGISTER, outCond & PCC_REGISTER); //fprintf (stderr, "pc %p: def REG %s(%x) & %02x\n", pc, name, sym, mask); } if (cond & PCC_REGISTER2) { name = pic16_get_op2 (pci->pcop, NULL, 0); sym2 = symFromStr (name); - isSpecial2 = fixupSpecialOperands (sym2, mask, mask, pc, newValnum(), &list, inCond & PCC_REGISTER2, outCond & PCC_REGISTER2); + fixupSpecialOperands (sym2, mask, mask, pc, newValnum(), &list, inCond & PCC_REGISTER2, outCond & PCC_REGISTER2); //fprintf (stderr, "pc %p: def REG2 %s(%x) & %02x\n", pc, name, sym2, mask); } @@ -11332,9 +11325,8 @@ /* safepCodeUnlink and remove pc from defmap. */ static int pic16_safepCodeRemove (pCode *pc, char *comment) { defmap_t *map, *next, **head; - int res, ispci; + int res; - ispci = isPCI(pc); map = isPCI(pc) ? PCI(pc)->pcflow->defmap : NULL; head = isPCI(pc) ? &PCI(pc)->pcflow->defmap : NULL; res = pic16_safepCodeUnlink (pc, comment); diff -Nru sdcc-3.1.0+dfsg/src/pic16/pcodepeep.c sdcc-3.2.0+dfsg/src/pic16/pcodepeep.c --- sdcc-3.1.0+dfsg/src/pic16/pcodepeep.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic16/pcodepeep.c 2012-01-26 17:33:28.000000000 +0000 @@ -780,13 +780,10 @@ { parsedPattern *p = pp; int opcode; - int dest; // or could be bit position in the register pCodeInstruction *pci=NULL; pCodeOp *pcosubtype=NULL; - dest = cvt_extract_destination(&p[3]); - DFPRINTF((stderr,"altpat_mnem3 %s var %s bit (%d)\n", p->pct[0].tok.s, p[1].pct[0].tok.s, @@ -838,13 +835,10 @@ { parsedPattern *p = pp; int opcode; - int dest; // or could be bit position in the register pCodeInstruction *pci=NULL; pCodeOp *pcosubtype=NULL; - dest = cvt_extract_destination(&p[3]); - DFPRINTF((stderr,"altpat_mnem4 %s fsr %d source %s\n", p->pct[0].tok.s, p[1].pct[0].tok.n, @@ -890,13 +884,10 @@ { parsedPattern *p = pp; int opcode; - int dest; // or could be bit position in the register pCodeInstruction *pci=NULL; pCodeOp *pcosubtype=NULL; - dest = cvt_extract_destination(&p[3]); - DFPRINTF((stderr,"altpat_mnem4a %s fsr %d value 0x%02x\n", p->pct[0].tok.s, p[1].pct[0].tok.n, @@ -1199,21 +1190,12 @@ #endif { - int lparsedPatIdx=0; + int lparsedPatIdx = 0; int lpcpIdx; - int ltokIdx =0; + int ltokIdx = 0; int matching = 0; - int j=0; - int k=0; - - char * cPmnem = NULL; // Pointer to non-wild mnemonic (if any) - char * cP1stop = NULL; - char * cP2ndop = NULL; - - //pCodeOp *pcl = NULL; // Storage for a label - //pCodeOp *pco1 = NULL; // 1st operand - //pCodeOp *pco2 = NULL; // 2nd operand - //pCode *pc = NULL; // Mnemonic + int j = 0; + int k = 0; typedef enum { PS_START, @@ -1254,12 +1236,10 @@ case PS_START: case PS_HAVE_LABEL: DFPRINTF((stderr," mnem\n")); - cPmnem = tokArr[ltokIdx].tok.s; state = PS_HAVE_MNEM; break; case PS_HAVE_MNEM: DFPRINTF((stderr," 1st operand\n")); - cP1stop = tokArr[ltokIdx].tok.s; //pco1 = pic16_newpCodeOp(NULL,PO_GPR_REGISTER); state = PS_HAVE_1OPERAND; break; @@ -1268,7 +1248,6 @@ break; case PS_HAVE_COMMA: DFPRINTF((stderr," 2 operands\n")); - cP2ndop = tokArr[ltokIdx].tok.s; break; case PS_HAVE_2OPERANDS: break; @@ -1607,21 +1586,22 @@ //return; // debug ... don't want to go through all the rules yet } - { - pCodePeep *peepBlock; - DLList *peeprules; - - peeprules = (DLList *)peepSnippets; - //fprintf(stderr,"target rules\n"); - while(peeprules) { - //fprintf(stderr," rule:\n"); - peepBlock = ((pCodePeepSnippets*)peeprules)->peep; - //pic16_printpBlock(stderr, peepBlock->target.pb); - peeprules = peeprules->next; - } - //fprintf(stderr," ... done\n"); - } + if (0) + { + pCodePeep *peepBlock; + DLList *peeprules; + peeprules = (DLList *)peepSnippets; + fprintf(stderr,"target rules\n"); + while (peeprules) + { + fprintf(stderr," rule:\n"); + peepBlock = ((pCodePeepSnippets*)peeprules)->peep; + pic16_printpBlock(stderr, peepBlock->target.pb); + peeprules = peeprules->next; + } // while + fprintf(stderr," ... done\n"); + } // if } #if 0 static void printpCodeString(FILE *of, pCode *pc, int max) diff -Nru sdcc-3.1.0+dfsg/src/pic16/pcoderegs.c sdcc-3.2.0+dfsg/src/pic16/pcoderegs.c --- sdcc-3.1.0+dfsg/src/pic16/pcoderegs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic16/pcoderegs.c 2012-01-26 17:33:28.000000000 +0000 @@ -156,9 +156,7 @@ *-----------------------------------------------------------------*/ static void pCodeRegMapLiveRangesInFlow(pCodeFlow *pcfl) { - pCode *pc=NULL; - pCode *pcprev=NULL; reg_info *reg; @@ -168,65 +166,60 @@ pc = pic16_findNextInstruction(pcfl->pc.next); - while(pic16_isPCinFlow(pc,PCODE(pcfl))) { - - - reg = pic16_getRegFromInstruction(pc); - - if(reg && (reg->type != REG_TMP)) { + while (pic16_isPCinFlow(pc,PCODE(pcfl))) + { + reg = pic16_getRegFromInstruction(pc); + if (reg && (reg->type != REG_TMP)) + { #if 0 - fprintf(stderr, "reg= %p\n", reg); - fprintf(stderr, "flow seq %d, inst seq %d %s ",PCODE(pcfl)->seq,pc->seq,reg->name); - fprintf(stderr, "addr = 0x%03x, type = %d rIdx=0x%03x ", - reg->address,reg->type,reg->rIdx); - fprintf(stderr, "command = %s\n", PCI(pc)->mnemonic); - + fprintf(stderr, "reg= %p\n", reg); + fprintf(stderr, "flow seq %d, inst seq %d %s ",PCODE(pcfl)->seq,pc->seq,reg->name); + fprintf(stderr, "addr = 0x%03x, type = %d rIdx=0x%03x ", + reg->address,reg->type,reg->rIdx); + fprintf(stderr, "command = %s\n", PCI(pc)->mnemonic); #endif -// fprintf(stderr, "%s:%d: trying to get first operand from pCode reg= %s\n", __FILE__, __LINE__, reg->name); - addSetIfnotP(& (PCFL(pcfl)->registers), reg); + //fprintf(stderr, "%s:%d: trying to get first operand from pCode reg= %s\n", __FILE__, __LINE__, reg->name); + addSetIfnotP(& (PCFL(pcfl)->registers), reg); - if((PCC_REGISTER | PCC_LITERAL) & PCI(pc)->inCond) - addSetIfnotP(& (reg->reglives.usedpFlows), pcfl); + if ((PCC_REGISTER | PCC_LITERAL) & PCI(pc)->inCond) + addSetIfnotP(& (reg->reglives.usedpFlows), pcfl); - if(PCC_REGISTER & PCI(pc)->outCond) - addSetIfnotP(& (reg->reglives.assignedpFlows), pcfl); + if (PCC_REGISTER & PCI(pc)->outCond) + addSetIfnotP(& (reg->reglives.assignedpFlows), pcfl); - addSetIfnotP(& (reg->reglives.usedpCodes), pc); + addSetIfnotP(& (reg->reglives.usedpCodes), pc); -// reg->wasUsed=1; + //reg->wasUsed=1; #if 1 - /* check to see if this pCode has 2 memory operands, - and set up the second operand too */ - if(PCI(pc)->is2MemOp) { - reg = pic16_getRegFromInstruction2(pc); - if(reg) { -// fprintf(stderr, "%s:%d: trying to get second operand from pCode reg= %s\n", __FILE__, __LINE__, reg->name); - addSetIfnotP(& (PCFL(pcfl)->registers), reg); - - if((PCC_REGISTER | PCC_LITERAL) & PCI(pc)->inCond) - addSetIfnotP(& (reg->reglives.usedpFlows), pcfl); - - if((PCC_REGISTER | PCC_REGISTER2) & PCI(pc)->outCond) - addSetIfnotP(& (reg->reglives.assignedpFlows), pcfl); - - addSetIfnotP(& (reg->reglives.usedpCodes), pc); - -// reg->wasUsed=1; - } - } + /* check to see if this pCode has 2 memory operands, + and set up the second operand too */ + if (PCI(pc)->is2MemOp) + { + reg = pic16_getRegFromInstruction2(pc); + if (reg) + { + //fprintf(stderr, "%s:%d: trying to get second operand from pCode reg= %s\n", __FILE__, __LINE__, reg->name); + addSetIfnotP(& (PCFL(pcfl)->registers), reg); + + if ((PCC_REGISTER | PCC_LITERAL) & PCI(pc)->inCond) + addSetIfnotP(& (reg->reglives.usedpFlows), pcfl); + + if ((PCC_REGISTER | PCC_REGISTER2) & PCI(pc)->outCond) + addSetIfnotP(& (reg->reglives.assignedpFlows), pcfl); + + addSetIfnotP(& (reg->reglives.usedpCodes), pc); + + //reg->wasUsed=1; + } // if + } // if #endif + } // if - } - - - pcprev = pc; - pc = pic16_findNextInstruction(pc->next); - - } - + pc = pic16_findNextInstruction(pc->next); + } // while } /*-----------------------------------------------------------------* diff -Nru sdcc-3.1.0+dfsg/src/pic16/pic16.vcxproj sdcc-3.2.0+dfsg/src/pic16/pic16.vcxproj --- sdcc-3.1.0+dfsg/src/pic16/pic16.vcxproj 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic16/pic16.vcxproj 2012-03-18 13:40:40.000000000 +0000 @@ -190,10 +190,12 @@ - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph.rul - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph.rul peeph.rul;%(Outputs) peeph.rul;%(Outputs) + Generating Peephole Rule: peeph.rul + Generating Peephole Rule: peeph.rul diff -Nru sdcc-3.1.0+dfsg/src/pic16/ralloc.c sdcc-3.2.0+dfsg/src/pic16/ralloc.c --- sdcc-3.1.0+dfsg/src/pic16/ralloc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/pic16/ralloc.c 2012-06-05 09:03:12.000000000 +0000 @@ -311,7 +311,7 @@ case SEND: return "SEND"; case DUMMY_READ_VOLATILE: return "DUMMY_READ_VOLATILE"; } - sprintf (buffer, "unkown op %d %c", op, op & 0xff); + sprintf (buffer, "unknown op %d %c", op, op & 0xff); return buffer; } @@ -844,14 +844,15 @@ reg = pic16_dirregWithName(name); if(!reg) { - int address = 0; int regtype = REG_GPR; /* if this is at an absolute address, then get the address. */ - if (SPEC_ABSA ( OP_SYM_ETYPE(op)) ) { - address = SPEC_ADDR ( OP_SYM_ETYPE(op)); -// fprintf(stderr,"reg %s is at an absolute address: 0x%03x\n",name,address); - } + if (0 && SPEC_ABSA ( OP_SYM_ETYPE(op)) ) + { + int address = 0; + address = SPEC_ADDR ( OP_SYM_ETYPE(op)); + fprintf(stderr,"reg %s is at an absolute address: 0x%03x\n",name,address); + } /* Register wasn't found in hash, so let's create * a new one and put it in the hash table AND in the @@ -3755,8 +3756,10 @@ static void packForPush (iCode * ic, eBBlock * ebp) { - iCode *dic; + iCode *dic, *lic; const char *iLine; + bitVect *dbv; + int disallowHiddenAssignment = 0; debugLog ("%s\n", __FUNCTION__); if (ic->op != IPUSH || !IS_ITEMP (IC_LEFT (ic))) @@ -3797,7 +3800,41 @@ if((OP_LIVEFROM(IC_RIGHT(dic))==0) || (OP_LIVETO(IC_RIGHT(dic))==0)) return; // debugf2("IC_RIGHT(dic): from %d to %d\n", OP_LIVEFROM(IC_RIGHT(dic)), OP_LIVETO(IC_RIGHT(dic))); + + /* If the defining iCode is outside of this block, we need to recompute */ + /* ebp (see the mcs51 version of packForPush), but we weren't passed */ + /* enough data to do that. Just bail out instead if that happens. */ + if (dic->seq < ebp->fSeq) + return; + + if (IS_SYMOP (IC_RIGHT (dic))) + { + if (IC_RIGHT (dic)->isvolatile) + return; + + if (OP_SYMBOL (IC_RIGHT (dic))->addrtaken || isOperandGlobal (IC_RIGHT (dic))) + disallowHiddenAssignment = 1; + /* make sure the right side does not have any definitions + inbetween */ + dbv = OP_DEFS (IC_RIGHT (dic)); + for (lic = ic; lic && lic != dic; lic = lic->prev) + { + if (bitVectBitValue (dbv, lic->key)) + return; + if (disallowHiddenAssignment && (lic->op == CALL || lic->op == PCALL || POINTER_SET (lic))) + return; + } + /* make sure they have the same type */ + if (IS_SPEC (operandType (IC_LEFT (ic)))) + { + sym_link *itype = operandType (IC_LEFT (ic)); + sym_link *ditype = operandType (IC_RIGHT (dic)); + + if (SPEC_USIGN (itype) != SPEC_USIGN (ditype) || SPEC_LONG (itype) != SPEC_LONG (ditype)) + return; + } + } /* @@ -3809,6 +3846,16 @@ { /* we now we know that it has one & only one def & use and the that the definition is an assignment */ + + /* extend the live range of replaced operand if needed */ + if (IS_SYMOP (IC_RIGHT (dic)) && OP_SYMBOL (IC_RIGHT (dic))->liveTo < ic->seq) + { + OP_SYMBOL (IC_RIGHT (dic))->liveTo = ic->seq; + } + bitVectUnSetBit (OP_SYMBOL (IC_RESULT (dic))->defs, dic->key); + if (IS_ITEMP (IC_RIGHT (dic))) + OP_USES (IC_RIGHT (dic)) = bitVectSetBit (OP_USES (IC_RIGHT (dic)), ic->key); + IC_LEFT (ic) = IC_RIGHT (dic); iLine = printILine(dic); @@ -4401,22 +4448,20 @@ pic16_packRegisters (ebbs[i]); - { - reg_info *reg; - int hkey; + if (0) + { + reg_info *reg; + int hkey; - debugLog("dir registers allocated so far:\n"); - reg = hTabFirstItem(dynDirectRegNames, &hkey); + debugLog("dir registers allocated so far:\n"); + reg = hTabFirstItem(dynDirectRegNames, &hkey); -#if 0 - while(reg) { - debugLog(" -- #%d reg = %s key %d, rIdx = %d, size %d\n",i++,reg->name,hkey, reg->rIdx,reg->size); -// fprintf(stderr, " -- #%d reg = %s key %d, rIdx = %d, size %d\n",i++,reg->name,hkey, reg->rIdx,reg->size); - reg = hTabNextItem(dynDirectRegNames, &hkey); + while(reg) { + debugLog(" -- #%d reg = %s key %d, rIdx = %d, size %d\n",i++,reg->name,hkey, reg->rIdx,reg->size); + // fprintf(stderr, " -- #%d reg = %s key %d, rIdx = %d, size %d\n",i++,reg->name,hkey, reg->rIdx,reg->size); + reg = hTabNextItem(dynDirectRegNames, &hkey); + } } -#endif - - } /* liveranges probably changed by register packing so we compute them again */ diff -Nru sdcc-3.1.0+dfsg/src/port.h sdcc-3.2.0+dfsg/src/port.h --- sdcc-3.1.0+dfsg/src/port.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/port.h 2012-06-02 17:22:53.000000000 +0000 @@ -22,28 +22,31 @@ #define TARGET_ID_HC08 11 #define TARGET_ID_Z180 12 #define TARGET_ID_R2K 13 +#define TARGET_ID_R3KA 14 +#define TARGET_ID_S08 15 /* Macro to test the target we are compiling for. Can only be used after SDCCmain has defined the port */ #define TARGET_IS_MCS51 (port->id == TARGET_ID_MCS51) -#define TARGET_IS_Z80 (port->id == TARGET_ID_Z80) -#define TARGET_IS_Z180 (port->id == TARGET_ID_Z180) -#define TARGET_IS_GBZ80 (port->id == TARGET_ID_GBZ80) #define TARGET_IS_AVR (port->id == TARGET_ID_AVR) #define TARGET_IS_DS390 (port->id == TARGET_ID_DS390) #define TARGET_IS_DS400 (port->id == TARGET_ID_DS400) #define TARGET_IS_PIC14 (port->id == TARGET_ID_PIC14) #define TARGET_IS_PIC16 (port->id == TARGET_ID_PIC16) #define TARGET_IS_XA51 (port->id == TARGET_ID_XA51) -#define TARGET_IS_HC08 (port->id == TARGET_ID_HC08) +#define TARGET_IS_Z80 (port->id == TARGET_ID_Z80) +#define TARGET_IS_Z180 (port->id == TARGET_ID_Z180) #define TARGET_IS_R2K (port->id == TARGET_ID_R2K) +#define TARGET_IS_R3KA (port->id == TARGET_ID_R3KA) +#define TARGET_IS_GBZ80 (port->id == TARGET_ID_GBZ80) +#define TARGET_IS_HC08 (port->id == TARGET_ID_HC08) +#define TARGET_IS_S08 (port->id == TARGET_ID_S08) #define TARGET_MCS51_LIKE (TARGET_IS_MCS51 || TARGET_IS_DS390 || TARGET_IS_DS400) -#define TARGET_Z80_LIKE (TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GBZ80 || TARGET_IS_R2K) -#define TARGET_IS_RABBIT (TARGET_IS_R2K) - -#define TARGET_HC08_LIKE (TARGET_IS_HC08) +#define TARGET_Z80_LIKE (TARGET_IS_Z80 || TARGET_IS_Z180 || TARGET_IS_GBZ80 || TARGET_IS_R2K || TARGET_IS_R3KA) +#define TARGET_IS_RABBIT (TARGET_IS_R2K || TARGET_IS_R3KA) +#define TARGET_HC08_LIKE (TARGET_IS_HC08 || TARGET_IS_S08) #define TARGET_PIC_LIKE (TARGET_IS_PIC14 || TARGET_IS_PIC16) /* is using sdas / sdld assembler / linker */ #define IS_SDASLD (TARGET_Z80_LIKE || TARGET_MCS51_LIKE || TARGET_HC08_LIKE) @@ -398,7 +401,10 @@ extern PORT z180_port; #endif #if !OPT_DISABLE_R2K -extern PORT r2k_port; /* rabbit 2000/3000 */ +extern PORT r2k_port; /* Rabbit 2000/3000 */ +#endif +#if !OPT_DISABLE_R3KA +extern PORT r3ka_port; /* Rabbit 3000A */ #endif #if !OPT_DISABLE_GBZ80 extern PORT gbz80_port; @@ -427,5 +433,8 @@ #if !OPT_DISABLE_HC08 extern PORT hc08_port; #endif +#if !OPT_DISABLE_S08 +extern PORT s08_port; +#endif #endif /* PORT_INCLUDE */ diff -Nru sdcc-3.1.0+dfsg/src/regression/Makefile sdcc-3.2.0+dfsg/src/regression/Makefile --- sdcc-3.1.0+dfsg/src/regression/Makefile 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/regression/Makefile 2012-06-25 07:07:00.000000000 +0000 @@ -68,7 +68,7 @@ CFLAGS += -Wl,-q CFLAGS += -Wl,--map CFLAGS += -I $(SDCC_SRC)/device/include/$(DIR) -I $(SDCC_SRC)/device/non-free/include/$(DIR) -CFLAGS += -L $(SDCC_BIN)/device/lib/$(DIR)/bin -L $(SDCC_BIN)/device/non-free/lib/$(DIR)/bin +CFLAGS += -L $(SDCC_BIN)/device/lib/build/$(DIR) -L $(SDCC_BIN)/device/non-free/lib/build/$(DIR) #CFLAGS += --no-pcode-opt #CFLAGS += -V diff -Nru sdcc-3.1.0+dfsg/src/sdcc.vcxproj sdcc-3.2.0+dfsg/src/sdcc.vcxproj --- sdcc-3.1.0+dfsg/src/sdcc.vcxproj 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/sdcc.vcxproj 2012-06-28 14:09:28.000000000 +0000 @@ -0,0 +1,525 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {F9485499-151B-4886-935C-7D687C4A0549} + sdcc + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\bin_vc\ + $(Configuration)\ + true + ..\bin_vc\ + $(Configuration)\ + true + sdcc + sdcc + + + + .\Debug/src.tlb + + + + + Disabled + .;..;..\support\util;C:\Program Files\boost\boost_1_47;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_CONSOLE;_DEBUG;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + .\Debug/src.pch + .\Debug/ + .\Debug/ + .\Debug/ + true + Level3 + true + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + ..\bin_vc\$(TargetFileName) + true + true + .\Debug/sdcc.pdb + Console + false + + + MachineX86 + C:\Program Files\boost\boost_1_44\lib;%(AdditionalLibraryDirectories) + 0x2000000 + + + true + .\Debug/src.bsc + + + + + .\Release/src.tlb + + + + + MaxSpeed + OnlyExplicitInline + .;..;..\support\util;C:\Program Files\boost\boost_1_47;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_CONSOLE;NDEBUG;%(PreprocessorDefinitions) + true + MultiThreaded + true + .\Release/src.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + ..\bin_vc\$(TargetFileName) + true + Console + false + + + MachineX86 + C:\Program Files\boost\boost_1_44\lib;%(AdditionalLibraryDirectories) + 0x2000000 + + + true + .\Release/src.bsc + + + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + + + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + ..;%(AdditionalIncludeDirectories) + ..;%(AdditionalIncludeDirectories) + + + + + flex -8 -f -oSDCClex.c SDCC.lex + SDCCy.h;%(AdditionalInputs) + SDCClex.c;%(Outputs) + flex -8 -f -oSDCClex.c SDCC.lex + SDCCy.h;%(AdditionalInputs) + SDCClex.c;%(Outputs) + Generating Lexer: SDCClex.c + Generating Lexer: SDCClex.c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {2f87ba6f-8ee1-48d0-9817-6ba30bddb3c1} + false + + + {14a8a991-bad6-49eb-84fb-6f6cf12b436d} + false + + + {6fa87476-0fab-4518-9845-12efebbce03f} + false + + + {9facdb81-be66-42d0-95f5-ea2fa3b09065} + false + + + {b96e942e-39f5-4c7c-97fd-a095de6847c6} + false + + + {7e09a25e-1c9d-438d-85db-8535f134890d} + false + + + {7444a72f-c7c6-4f90-9a62-2d46240b52db} + false + + + + + + \ No newline at end of file diff -Nru sdcc-3.1.0+dfsg/src/sdcc.vcxproj.filters sdcc-3.2.0+dfsg/src/sdcc.vcxproj.filters --- sdcc-3.1.0+dfsg/src/sdcc.vcxproj.filters 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/sdcc.vcxproj.filters 2012-03-30 20:25:20.000000000 +0000 @@ -0,0 +1,300 @@ + + + + + {d62eee26-dbd0-4367-9726-8be6e7a7de74} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {542d6692-b312-430e-b08c-25d50a679c72} + h;hpp;hxx;hm;inl + + + {294f3d1a-92d6-4c47-884a-62ffa390e878} + + + {ffdab0d0-444f-4892-8854-39c4adee434b} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Regression Test + + + Regression Test + + + Regression Test + + + Regression Test + + + Regression Test + + + Regression Test + + + Regression Test + + + Regression Test + + + Regression Test + + + Regression Test + + + Regression Test + + + Regression Test + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Source Files + + + + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Custom Build + + + Custom Build + + + \ No newline at end of file diff -Nru sdcc-3.1.0+dfsg/src/src.vcxproj sdcc-3.2.0+dfsg/src/src.vcxproj --- sdcc-3.1.0+dfsg/src/src.vcxproj 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/src.vcxproj 1970-01-01 00:00:00.000000000 +0000 @@ -1,518 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {F9485499-151B-4886-935C-7D687C4A0549} - - - - Application - false - MultiByte - - - Application - false - MultiByte - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\bin_vc\ - $(Configuration)\ - true - ..\bin_vc\ - $(Configuration)\ - true - sdcc - sdcc - - - - .\Debug/src.tlb - - - - - Disabled - .;..;..\support\util;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_CONSOLE;_DEBUG;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - .\Debug/src.pch - .\Debug/ - .\Debug/ - .\Debug/ - true - Level3 - true - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ..\bin_vc\$(TargetFileName) - true - true - .\Debug/sdcc.pdb - Console - false - - - MachineX86 - C:\Program Files\boost\boost_1_44\lib;%(AdditionalLibraryDirectories) - - - true - .\Debug/src.bsc - - - - - .\Release/src.tlb - - - - - MaxSpeed - OnlyExplicitInline - .;..;..\support\util;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_CONSOLE;NDEBUG;%(PreprocessorDefinitions) - true - MultiThreaded - true - .\Release/src.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ..\bin_vc\$(TargetFileName) - true - Console - false - - - MachineX86 - C:\Program Files\boost\boost_1_44\lib;%(AdditionalLibraryDirectories) - - - true - .\Release/src.bsc - - - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - true - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - ..;%(AdditionalIncludeDirectories) - ..;%(AdditionalIncludeDirectories) - - - - - flex -osdcclex.c sdcc.lex - sdccy.h;%(AdditionalInputs) - SDCClex.c;%(Outputs) - flex -osdcclex.c sdcc.lex - sdccy.h;%(AdditionalInputs) - SDCClex.c;%(Outputs) - - - - Document - bison -d -v -o sdccy.c sdcc.y - bison -d -v -o sdccy.c sdcc.y - sdccy.c;sdccy.h - sdccy.c;sdccy.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {2f87ba6f-8ee1-48d0-9817-6ba30bddb3c1} - false - - - {14a8a991-bad6-49eb-84fb-6f6cf12b436d} - false - - - {6fa87476-0fab-4518-9845-12efebbce03f} - false - - - {9facdb81-be66-42d0-95f5-ea2fa3b09065} - false - - - {b96e942e-39f5-4c7c-97fd-a095de6847c6} - false - - - {7e09a25e-1c9d-438d-85db-8535f134890d} - false - - - {7444a72f-c7c6-4f90-9a62-2d46240b52db} - false - - - - - - \ No newline at end of file diff -Nru sdcc-3.1.0+dfsg/src/src.vcxproj.filters sdcc-3.2.0+dfsg/src/src.vcxproj.filters --- sdcc-3.1.0+dfsg/src/src.vcxproj.filters 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/src.vcxproj.filters 1970-01-01 00:00:00.000000000 +0000 @@ -1,273 +0,0 @@ - - - - - {d62eee26-dbd0-4367-9726-8be6e7a7de74} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {542d6692-b312-430e-b08c-25d50a679c72} - h;hpp;hxx;hm;inl - - - {294f3d1a-92d6-4c47-884a-62ffa390e878} - - - {ffdab0d0-444f-4892-8854-39c4adee434b} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Regression Test - - - Regression Test - - - Regression Test - - - Regression Test - - - Regression Test - - - Regression Test - - - Regression Test - - - Regression Test - - - Regression Test - - - Regression Test - - - Regression Test - - - Regression Test - - - Source Files - - - - - Source Files - - - - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Custom Build - - - Custom Build - - - \ No newline at end of file diff -Nru sdcc-3.1.0+dfsg/src/yacc.vcxproj sdcc-3.2.0+dfsg/src/yacc.vcxproj --- sdcc-3.1.0+dfsg/src/yacc.vcxproj 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/yacc.vcxproj 2012-06-28 14:09:28.000000000 +0000 @@ -65,10 +65,12 @@ Document - bison -d -v -o sdccy.c sdcc.y - sdccy.c;sdccy.h;%(Outputs) - bison -d -v -o sdccy.c sdcc.y - sdccy.c;sdccy.h;%(Outputs) + bison -d -v -o SDCCy.c SDCC.y + bison -d -v -o SDCCy.c SDCC.y + SDCCy.c;SDCCy.h;%(Outputs) + SDCCy.c;SDCCy.h;%(Outputs) + Generating Parser: SDCCy.c + Generating Parser: SDCCy.c diff -Nru sdcc-3.1.0+dfsg/src/z80/gen.c sdcc-3.2.0+dfsg/src/z80/gen.c --- sdcc-3.1.0+dfsg/src/z80/gen.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/z80/gen.c 2012-06-21 14:48:56.000000000 +0000 @@ -1,11 +1,10 @@ /*------------------------------------------------------------------------- gen.c - code generator for Z80 / Z180 / GBZ80. - Philipp Klaus Krause pkk@spth.de, philipp@informatik.uni-frankfurt.de (2011) - Michael Hope 2000 - Based on the mcs51 generator - - Sandeep Dutta . sandeep.dutta@usa.net (1998) - and - Jean-Louis VERN.jlvern@writeme.com (1999) + Copyright (C) 1998, Sandeep Dutta . sandeep.dutta@usa.net + Copyright (C) 1999, Jean-Louis VERN.jlvern@writeme.com + Copyright (C) 2000, Michael Hope + Copyright (C) 2011, Philipp Klaus Krause pkk@spth.de, philipp@informatik.uni-frankfurt.de) 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 @@ -17,15 +16,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! - -------------------------------------------------------------------------*/ /* @@ -89,11 +82,7 @@ #include #include "z80.h" -#include "SDCCglobl.h" -#include "SDCCpeeph.h" #include "gen.h" -#include "SDCCglue.h" -#include "newalloc.h" #include "dbuf_string.h" /* This is the down and dirty file with all kinds of kludgy & hacky @@ -125,12 +114,9 @@ //#define DEBUG_DRY_COST -static char *_z80_return[] = - {"l", "h", "e", "d"}; -static char *_gbz80_return[] = - {"e", "d", "l", "h"}; -static char *_fReceive[] = - { "c", "b", "e", "d" }; +static char *_z80_return[] = { "l", "h", "e", "d" }; +static char *_gbz80_return[] = { "e", "d", "l", "h" }; +static char *_fReceive[] = { "c", "b", "e", "d" }; static char **_fReturn; static char **_fTmp; @@ -138,102 +124,117 @@ extern struct dbuf_s *codeOutBuf; enum - { - INT8MIN = -128, - INT8MAX = 127 - }; +{ + INT8MIN = -128, + INT8MAX = 127 +}; /** Enum covering all the possible register pairs. */ typedef enum - { - PAIR_INVALID, - PAIR_AF, - PAIR_BC, - PAIR_DE, - PAIR_HL, - PAIR_IY, - PAIR_IX, - NUM_PAIRS - } PAIR_ID; +{ + PAIR_INVALID, + PAIR_AF, + PAIR_BC, + PAIR_DE, + PAIR_HL, + PAIR_IY, + PAIR_IX, + NUM_PAIRS +} PAIR_ID; static struct { const char *name; const char *l; const char *h; -} _pairs[NUM_PAIRS] = { - { "??1", "?2", "?3" }, - { "af", "f", "a" }, - { "bc", "c", "b" }, - { "de", "e", "d" }, - { "hl", "l", "h" }, - { "iy", "iyl", "iyh" }, - { "ix", "ixl", "ixh" } +} _pairs[NUM_PAIRS] = +{ + { + "??1", "?2", "?3" + }, + { + "af", "f", "a" + }, + { + "bc", "c", "b" + }, + { + "de", "e", "d" + }, + { + "hl", "l", "h" + }, + { + "iy", "iyl", "iyh" + }, + { + "ix", "ixl", "ixh" + } }; // PENDING #define ACC_NAME _pairs[PAIR_AF].h enum - { - LSB, - MSB16, - MSB24, - MSB32 - }; - +{ + LSB, + MSB16, + MSB24, + MSB32 +}; + enum asminst - { - A_ADD, - A_ADC, - A_AND, - A_CP, - A_CPL, - A_DEC, - A_INC, - A_LD, - A_OR, - A_RL, - A_RLA, - A_RLC, - A_RLCA, - A_RR, - A_RRC, - A_RRCA, - A_SBC, - A_SLA, - A_SRA, - A_SRL, - A_SUB, - A_XOR - }; - +{ + A_ADD, + A_ADC, + A_AND, + A_CP, + A_CPL, + A_DEC, + A_INC, + A_LD, + A_OR, + A_RL, + A_RLA, + A_RLC, + A_RLCA, + A_RR, + A_RRC, + A_RRCA, + A_SBC, + A_SLA, + A_SRA, + A_SRL, + A_SUB, + A_XOR +}; + const char *asminstnames[] = - { - "add", - "adc", - "and", - "cp", - "cpl", - "dec", - "inc", - "ld", - "or", - "rl", - "rla", - "rlc", - "rlca", - "rr", - "rrc", - "rrca", - "sbc", - "sla", - "sra", - "srl", - "sub", - "xor" - }; +{ + "add", + "adc", + "and", + "cp", + "cpl", + "dec", + "inc", + "ld", + "or", + "rl", + "rla", + "rlc", + "rlca", + "rr", + "rrc", + "rrca", + "sbc", + "sla", + "sra", + "srl", + "sub", + "xor" +}; /** Code generator persistent data. */ @@ -254,6 +255,7 @@ int pushed; int param_offset; int offset; + int pushedHL; int pushedBC; int pushedDE; int pushedIY; @@ -284,10 +286,6 @@ struct { - lineNode *head; - lineNode *current; - int isInline; - int isDebug; allocTrace trace; } lines; @@ -297,7 +295,7 @@ } trace; } _G; -static const char *aopGet (asmop *aop, int offset, bool bit16); +static const char *aopGet (asmop * aop, int offset, bool bit16); struct asmop asmop_a, asmop_b, asmop_c, asmop_d, asmop_e, asmop_h, asmop_l, asmop_iyh, asmop_iyl, asmop_zero, asmop_one; struct asmop *const ASMOP_A = &asmop_a; @@ -312,23 +310,20 @@ struct asmop *const ASMOP_ZERO = &asmop_zero; struct asmop *const ASMOP_ONE = &asmop_one; -static asmop *_z80_return3[] = - {&asmop_l, &asmop_h, &asmop_e, &asmop_d}; -static asmop *_gbz80_return3[] = - {&asmop_e, &asmop_d, &asmop_l, &asmop_h}; - -static asmop *asmopregs[] = - {&asmop_c, &asmop_b, &asmop_e, &asmop_d, &asmop_l, &asmop_h, &asmop_iyl, &asmop_iyh}; +static asmop *_z80_return3[] = { &asmop_l, &asmop_h, &asmop_e, &asmop_d }; +static asmop *_gbz80_return3[] = { &asmop_e, &asmop_d, &asmop_l, &asmop_h }; + +static asmop *asmopregs[] = { &asmop_c, &asmop_b, &asmop_e, &asmop_d, &asmop_l, &asmop_h, &asmop_iyl, &asmop_iyh }; static asmop **_fReturn3; void -z80_init_asmops(void) +z80_init_asmops (void) { asmop_a.type = AOP_ACC; asmop_a.size = 1; asmop_a.aopu.aop_str[0] = "a"; - + asmop_b.type = AOP_REG; asmop_b.size = 1; asmop_b.aopu.aop_reg[0] = regsZ80 + B_IDX; @@ -353,11 +348,11 @@ asmop_iyl.type = AOP_REG; asmop_iyl.size = 1; asmop_iyl.aopu.aop_reg[0] = regsZ80 + IYL_IDX; - + asmop_zero.type = AOP_SIMPLELIT; asmop_zero.aopu.aop_simplelit = 0; asmop_zero.size = 1; - + asmop_one.type = AOP_SIMPLELIT; asmop_one.aopu.aop_simplelit = 1; asmop_one.size = 1; @@ -365,15 +360,15 @@ _fReturn3 = IS_GB ? _gbz80_return3 : _z80_return3; } -extern bool regalloc_dry_run; -unsigned char regalloc_dry_run_cost; +static bool regalloc_dry_run; +static unsigned char regalloc_dry_run_cost; /* WARNING: This function is dangerous to use. It works literally: It will return true if ic the the last use of op, even if ic might be executed again, e.g. due to a loop. Most of the time you will want to use isPairDead(), or ic->rSurv instead of this function. */ static bool -isLastUse (const iCode *ic, operand *op) +isLastUse (const iCode * ic, operand * op) { bitVect *uses = bitVectCopy (OP_USES (op)); @@ -397,7 +392,7 @@ } static PAIR_ID -_getTempPairId(void) +_getTempPairId (void) { if (IS_GB) { @@ -410,21 +405,21 @@ } static const char * -_getTempPairName(void) +_getTempPairName (void) { - return _pairs[_getTempPairId()].name; + return _pairs[_getTempPairId ()].name; } static bool -isPairInUse (PAIR_ID id, const iCode *ic) +isPairInUse (PAIR_ID id, const iCode * ic) { if (id == PAIR_DE) { - return bitVectBitValue (ic->rMask, D_IDX) || bitVectBitValue(ic->rMask, E_IDX); + return bitVectBitValue (ic->rMask, D_IDX) || bitVectBitValue (ic->rMask, E_IDX); } else if (id == PAIR_BC) { - return bitVectBitValue (ic->rMask, B_IDX) || bitVectBitValue(ic->rMask, C_IDX); + return bitVectBitValue (ic->rMask, B_IDX) || bitVectBitValue (ic->rMask, C_IDX); } else { @@ -434,26 +429,20 @@ } static bool -isPairDead(PAIR_ID id, const iCode *ic) +isPairDead (PAIR_ID id, const iCode * ic) { - const bitVect *r = (z80_opts.oldralloc ? bitVectCplAnd (bitVectCopy (ic->rMask), z80_rUmaskForOp (IC_RESULT (ic))) : ic->rSurv); + const bitVect *r = (!options.oldralloc ? ic->rSurv : + (POINTER_SET (ic) ? ic->rMask : + (bitVectCplAnd (bitVectCopy (ic->rMask), z80_rUmaskForOp (IC_RESULT (ic)))))); if (id == PAIR_DE) - { - return !(bitVectBitValue (r, D_IDX) || bitVectBitValue(r, E_IDX)); - } + return !(bitVectBitValue (r, D_IDX) || bitVectBitValue (r, E_IDX)); else if (id == PAIR_BC) - { - return !(bitVectBitValue (r, B_IDX) || bitVectBitValue(r, C_IDX)); - } + return !(bitVectBitValue (r, B_IDX) || bitVectBitValue (r, C_IDX)); else if (id == PAIR_HL) - { - return !(bitVectBitValue (r, H_IDX) || bitVectBitValue(r, L_IDX)); - } + return !(bitVectBitValue (r, H_IDX) || bitVectBitValue (r, L_IDX)); else if (id == PAIR_IY) - { - return !(bitVectBitValue (r, IYH_IDX) || bitVectBitValue(r, IYL_IDX)); - } + return !(bitVectBitValue (r, IYH_IDX) || bitVectBitValue (r, IYL_IDX)); else { wassertl (0, "Only implemented for DE, BC, HL and IY"); @@ -462,7 +451,7 @@ } static PAIR_ID -getDeadPairId (const iCode *ic) +getDeadPairId (const iCode * ic) { if (isPairDead (PAIR_BC, ic)) { @@ -479,7 +468,7 @@ } static PAIR_ID -getFreePairId (const iCode *ic) // Todo: Cost +getFreePairId (const iCode * ic) // Todo: Cost { if (!isPairInUse (PAIR_BC, ic)) { @@ -499,49 +488,24 @@ _tidyUp (char *buf) { /* Clean up the line so that it is 'prettier' */ - if (strchr (buf, ':')) - { - /* Is a label - cant do anything */ - return; - } - /* Change the first (and probably only) ' ' to a tab so - everything lines up. - */ - while (*buf) + /* If it is a label - can't do anything */ + if (!strchr (buf, ':')) { - if (*buf == ' ') + /* Change the first (and probably only) ' ' to a tab so + everything lines up. + */ + while (*buf) { - *buf = '\t'; - break; + if (*buf == ' ') + { + *buf = '\t'; + break; + } + buf++; } - buf++; } } -static lineNode * -_newLineNode (const char *line) -{ - lineNode *pl; - - pl = traceAlloc(&_G.lines.trace, Safe_alloc ( sizeof (lineNode))); - pl->line = traceAlloc(&_G.lines.trace, Safe_strdup (line)); - - return pl; -} - -static void -_add_line (const char *buffer) -{ - _G.lines.current = (_G.lines.current ? - connectLine (_G.lines.current, _newLineNode (buffer)) : - (_G.lines.head = _newLineNode (buffer))); - - _G.lines.current->isInline = _G.lines.isInline; - _G.lines.current->isDebug = _G.lines.isDebug; - _G.lines.current->ic = _G.current_iCode; - _G.lines.current->isComment = (*buffer == ';'); -} - static void _vemit2 (const char *szFormat, va_list ap) { @@ -560,43 +524,50 @@ while ((nextp = strchr (p, '\n'))) { *nextp = '\0'; - _add_line (p); + emit_raw (p); p = nextp + 1; } - _add_line (p); + emit_raw (p); - Safe_free (buffer); + dbuf_free (buffer); } static void -emitDebug (const char *szFormat,...) +emitDebug (const char *szFormat, ...) { - if(regalloc_dry_run) - return; - if (!options.verboseAsm) - return; - if (!DISABLE_DEBUG) + if (!DISABLE_DEBUG && !regalloc_dry_run && options.verboseAsm) { va_list ap; va_start (ap, szFormat); - _vemit2 (szFormat, ap); + va_end (ap); + } +} + +static void +emit2 (const char *szFormat, ...) +{ + if (!regalloc_dry_run) + { + va_list ap; + va_start (ap, szFormat); + _vemit2 (szFormat, ap); va_end (ap); } } static PAIR_ID -getPairId (const asmop *aop) +getPairId (const asmop * aop) { if (aop->size == 2) { if (aop->type == AOP_REG) { wassert (aop->aopu.aop_reg[0] && aop->aopu.aop_reg[1]); - + if ((aop->aopu.aop_reg[0]->rIdx == C_IDX) && (aop->aopu.aop_reg[1]->rIdx == B_IDX)) { return PAIR_BC; @@ -623,43 +594,28 @@ return PAIR_INVALID; } -static void -emit2 (const char *szFormat,...) -{ - va_list ap; - - if(regalloc_dry_run) - return; - - va_start (ap, szFormat); - - _vemit2 (szFormat, ap); - - va_end (ap); -} - /*-----------------------------------------------------------------*/ /* z80_emitDebuggerSymbol - associate the current code location */ /* with a debugger symbol */ /*-----------------------------------------------------------------*/ void -z80_emitDebuggerSymbol (const char * debugSym) +z80_emitDebuggerSymbol (const char *debugSym) { - _G.lines.isDebug = 1; + genLine.lineElement.isDebug = 1; emit2 ("%s !equ .", debugSym); emit2 ("!global", debugSym); - _G.lines.isDebug = 0; + genLine.lineElement.isDebug = 0; } // Todo: Handle IY (when used as AOP_HLREG or AOP_REG) correctly. static unsigned char -ld_cost(asmop *op1, asmop *op2) +ld_cost (asmop * op1, asmop * op2) { AOP_TYPE op1type = op1->type; AOP_TYPE op2type = op2->type; - + /* Costs are symmetric */ - if(op2type == AOP_ACC || op2type == AOP_REG || op2type == AOP_HLREG || op2type == AOP_DUMMY) + if (op2type == AOP_ACC || op2type == AOP_REG || op2type == AOP_HLREG || op2type == AOP_DUMMY) { asmop *tmp = op1; op1 = op2; @@ -667,131 +623,136 @@ op1type = op1->type; op2type = op2->type; } - - switch(op1type) + + switch (op1type) { case AOP_ACC: case AOP_REG: case AOP_HLREG: case AOP_DUMMY: - switch(op2type) + switch (op2type) { case AOP_ACC: case AOP_REG: case AOP_HLREG: case AOP_DUMMY: - return(1); + return (1); case AOP_IMMD: case AOP_LIT: case AOP_SIMPLELIT: - return(2); - case AOP_SFR: /* 2 from in a, (...) */ - return((op1type == AOP_ACC || op1type == AOP_DUMMY) ? 2 : 3); + return (2); + case AOP_SFR: /* 2 from in a, (...) */ + return ((op1type == AOP_ACC || op1type == AOP_DUMMY) ? 2 : 3); case AOP_STK: - return(3); - case AOP_HL: /* 3 from ld hl, #... */ - return(4); - case AOP_IY: /* 4 from ld iy, #... */ - case AOP_EXSTK: /* 4 from ld iy, #... */ - return(7); + return (3); + case AOP_HL: /* 3 from ld hl, #... */ + return (4); + case AOP_IY: /* 4 from ld iy, #... */ + case AOP_EXSTK: /* 4 from ld iy, #... */ + return (7); case AOP_PAIRPTR: - if(op2->aopu.aop_pairId == PAIR_HL) - return(1); - if(op2->aopu.aop_pairId == PAIR_IY || op2->aopu.aop_pairId == PAIR_IX) - return(3); - if(op2->aopu.aop_pairId == PAIR_BC || op2->aopu.aop_pairId == PAIR_DE) - return((op1type == AOP_ACC || op1type == AOP_DUMMY) ? 1 : 2); - default:printf("ld_cost op1: AOP_REG, op2: %d", (int)(op2type)); - wassert(0); + if (op2->aopu.aop_pairId == PAIR_HL) + return (1); + if (op2->aopu.aop_pairId == PAIR_IY || op2->aopu.aop_pairId == PAIR_IX) + return (3); + if (op2->aopu.aop_pairId == PAIR_BC || op2->aopu.aop_pairId == PAIR_DE) + return ((op1type == AOP_ACC || op1type == AOP_DUMMY) ? 1 : 2); + default: + printf ("ld_cost op1: AOP_REG, op2: %d", (int) (op2type)); + wassert (0); } - case AOP_SFR: /* 2 from out (...), a */ - switch(op2type) + case AOP_SFR: /* 2 from out (...), a */ + switch (op2type) { case AOP_ACC: case AOP_REG: case AOP_HLREG: case AOP_DUMMY: - return(2); + return (2); case AOP_IMMD: case AOP_LIT: case AOP_SIMPLELIT: - return(4); + return (4); case AOP_STK: - return(5); - case AOP_HL: /* 3 from ld hl, #... */ - return(6); + return (5); + case AOP_HL: /* 3 from ld hl, #... */ + return (6); case AOP_SFR: - return(4); - case AOP_IY: /* 4 from ld iy, #... */ - case AOP_EXSTK: /* 4 from ld iy, #... */ - return(9); - default:printf("ld_cost op1: AOP_SFR, op2: %d", (int)(op2type)); - wassert(0); - } - case AOP_IY: /* 4 from ld iy, #... */ - case AOP_EXSTK: /* 4 from ld iy, #... */ - switch(op2type) + return (4); + case AOP_IY: /* 4 from ld iy, #... */ + case AOP_EXSTK: /* 4 from ld iy, #... */ + return (9); + default: + printf ("ld_cost op1: AOP_SFR, op2: %d", (int) (op2type)); + wassert (0); + } + case AOP_IY: /* 4 from ld iy, #... */ + case AOP_EXSTK: /* 4 from ld iy, #... */ + switch (op2type) { case AOP_IMMD: case AOP_LIT: case AOP_SIMPLELIT: - return(8); - case AOP_SFR: /* 2 from in a, (...) */ - return(9); + return (8); + case AOP_SFR: /* 2 from in a, (...) */ + return (9); case AOP_STK: - case AOP_HL: /* 3 from ld hl, #... */ - return(10); + case AOP_HL: /* 3 from ld hl, #... */ + return (10); case AOP_IY: case AOP_EXSTK: - return(16); - default:printf("ld_cost op1: AOP_IY, op2: %d", (int)(op2type)); - wassert(0); + return (16); + default: + printf ("ld_cost op1: AOP_IY, op2: %d", (int) (op2type)); + wassert (0); } case AOP_STK: - switch(op2type) + switch (op2type) { case AOP_IMMD: case AOP_LIT: case AOP_SIMPLELIT: - return(4); - case AOP_SFR: /* 2 from in a, (...) */ - return(5); + return (4); + case AOP_SFR: /* 2 from in a, (...) */ + return (5); case AOP_STK: - return(6); + return (6); case AOP_HL: - return(7); - case AOP_IY: /* 4 from ld iy, #... */ + return (7); + case AOP_IY: /* 4 from ld iy, #... */ case AOP_EXSTK: - return(10); + return (10); case AOP_PAIRPTR: - if(op2->aopu.aop_pairId == PAIR_HL || op2->aopu.aop_pairId == PAIR_BC || op2->aopu.aop_pairId == PAIR_DE) - return(4); - if(op2->aopu.aop_pairId == PAIR_IY || op2->aopu.aop_pairId == PAIR_IX) - return(6); - default:printf("ld_cost op1: AOP_STK, op2: %d", (int)(op2type)); - wassert(0); + if (op2->aopu.aop_pairId == PAIR_HL || op2->aopu.aop_pairId == PAIR_BC || op2->aopu.aop_pairId == PAIR_DE) + return (4); + if (op2->aopu.aop_pairId == PAIR_IY || op2->aopu.aop_pairId == PAIR_IX) + return (6); + default: + printf ("ld_cost op1: AOP_STK, op2: %d", (int) (op2type)); + wassert (0); } - case AOP_HL: /* 3 from ld hl, #... */ - switch(op2type) + case AOP_HL: /* 3 from ld hl, #... */ + switch (op2type) { case AOP_ACC: case AOP_REG: case AOP_HLREG: case AOP_DUMMY: - return(4); + return (4); case AOP_IMMD: case AOP_LIT: case AOP_SIMPLELIT: - return(5); + return (5); case AOP_STK: - return(7); + return (7); case AOP_HL: - return(6); - case AOP_IY: /* 4 from ld iy, #... */ + return (6); + case AOP_IY: /* 4 from ld iy, #... */ case AOP_EXSTK: - return(11); - default:printf("ld_cost op1: AOP_HL, op2: %d", (int)(op2type)); - wassert(0); + return (11); + default: + printf ("ld_cost op1: AOP_HL, op2: %d", (int) (op2type)); + wassert (0); } case AOP_LIT: case AOP_SIMPLELIT: @@ -799,84 +760,84 @@ wassertl (0, "Trying to assign a value to a literal"); break; default: - printf("ld_cost op1: %d", (int)(op1type)); - wassert(0); + printf ("ld_cost op1: %d", (int) (op1type)); + wassert (0); } - return(8); // Fallback + return (8); // Fallback } static unsigned char -op8_cost(asmop *op2) +op8_cost (asmop * op2) { - switch(op2->type) + switch (op2->type) { case AOP_ACC: case AOP_REG: case AOP_HLREG: case AOP_DUMMY: - return(1); + return (1); case AOP_IMMD: case AOP_LIT: case AOP_SIMPLELIT: - return(2); + return (2); case AOP_STK: - return(3); + return (3); case AOP_HL: - return(4); - case AOP_IY: /* 4 from ld iy, #... */ - case AOP_EXSTK: /* 4 from ld iy, #... */ - return(7); + return (4); + case AOP_IY: /* 4 from ld iy, #... */ + case AOP_EXSTK: /* 4 from ld iy, #... */ + return (7); case AOP_PAIRPTR: - if(op2->aopu.aop_pairId == PAIR_HL) - return(1); - if(op2->aopu.aop_pairId == PAIR_IY || op2->aopu.aop_pairId == PAIR_IX) - return(3); + if (op2->aopu.aop_pairId == PAIR_HL) + return (1); + if (op2->aopu.aop_pairId == PAIR_IY || op2->aopu.aop_pairId == PAIR_IX) + return (3); default: - printf("op8_cost op2: %d", (int)(op2->type)); - wassert(0); + printf ("op8_cost op2: %d", (int) (op2->type)); + wassert (0); } - return(8); // Fallback + return (8); // Fallback } static unsigned char -bit8_cost(asmop *op1) +bit8_cost (asmop * op1) { - switch(op1->type) + switch (op1->type) { case AOP_ACC: case AOP_REG: case AOP_HLREG: case AOP_DUMMY: - return(2); + return (2); case AOP_STK: - return(4); + return (4); case AOP_HL: - return(5); - case AOP_IY: /* 4 from ld iy, #... */ - case AOP_EXSTK: /* 4 from ld iy, #... */ - return(8); + return (5); + case AOP_IY: /* 4 from ld iy, #... */ + case AOP_EXSTK: /* 4 from ld iy, #... */ + return (8); default: - printf("bit8_cost op1: %d", (int)(op1->type)); - wassert(0); + printf ("bit8_cost op1: %d", (int) (op1->type)); + wassert (0); } - return(8); //Fallback + return (8); //Fallback } static unsigned char -emit3Cost(enum asminst inst, asmop *op1, int offset1, asmop *op2, int offset2) +emit3Cost (enum asminst inst, asmop * op1, int offset1, asmop * op2, int offset2) { if (op2 && offset2 >= op2->size) op2 = ASMOP_ZERO; - switch(inst) + switch (inst) { case A_CPL: case A_RLA: case A_RLCA: case A_RRCA: - return(1); + return (1); case A_LD: - return(ld_cost(op1, op2)); + return (ld_cost (op1, op2)); break; case A_ADD: case A_ADC: @@ -886,10 +847,10 @@ case A_SBC: case A_SUB: case A_XOR: - return(op8_cost(op2)); + return (op8_cost (op2)); case A_DEC: case A_INC: - return(op8_cost(op1)); + return (op8_cost (op1)); case A_RL: case A_RLC: case A_RR: @@ -897,27 +858,27 @@ case A_SLA: case A_SRA: case A_SRL: - return(bit8_cost(op1)); + return (bit8_cost (op1)); default: - wassertl(0, "Tried get cost for unknown instruction"); + wassertl (0, "Tried get cost for unknown instruction"); } - return(0); + return (0); } static void -emit3_o (enum asminst inst, asmop *op1, int offset1, asmop *op2, int offset2) +emit3_o (enum asminst inst, asmop * op1, int offset1, asmop * op2, int offset2) { unsigned char cost; - regalloc_dry_run_cost += emit3Cost(inst, op1, offset1, op2, offset2); - if(regalloc_dry_run) + regalloc_dry_run_cost += emit3Cost (inst, op1, offset1, op2, offset2); + if (regalloc_dry_run) return; cost = regalloc_dry_run_cost; - if(!op1) - emit2("%s", asminstnames[inst]); - else if(!op2) - emit2("%s %s", asminstnames[inst], aopGet(op1, offset1, FALSE)); + if (!op1) + emit2 ("%s", asminstnames[inst]); + else if (!op2) + emit2 ("%s %s", asminstnames[inst], aopGet (op1, offset1, FALSE)); else { char *l = Safe_strdup (aopGet (op1, offset1, FALSE)); @@ -931,17 +892,17 @@ } static void -emit3 (enum asminst inst, asmop *op1, asmop *op2) +emit3 (enum asminst inst, asmop * op1, asmop * op2) { - emit3_o(inst, op1, 0, op2, 0); + emit3_o (inst, op1, 0, op2, 0); } static void -_emitMove(const char *to, const char *from) +_emitMove (const char *to, const char *from) { - if (STRCASECMP(to, from) != 0) + if (STRCASECMP (to, from) != 0) { - emit2("ld %s,%s", to, from); + emit2 ("ld %s,%s", to, from); } else { @@ -951,10 +912,10 @@ } static void -_emitMove3(asmop *to, int to_offset, asmop *from, int from_offset) +_emitMove3 (asmop * to, int to_offset, asmop * from, int from_offset) { /* Todo: Longer list of moves that can be optimized out. */ - if(to_offset == from_offset) + if (to_offset == from_offset) { if (to->type == AOP_ACC && from->type == AOP_ACC) return; @@ -962,11 +923,12 @@ return; } - emit3_o(A_LD, to, to_offset, from, from_offset); + emit3_o (A_LD, to, to_offset, from, from_offset); } #if 0 -static const char *aopNames[] = { +static const char *aopNames[] = +{ "AOP_INVALID", "AOP_LIT", "AOP_REG", @@ -987,27 +949,27 @@ }; static void -aopDump(const char *plabel, asmop *aop) +aopDump (const char *plabel, asmop * aop) { int i; char regbuf[9]; char *rbp = regbuf; - emitDebug("; Dump of %s: type %s size %u", plabel, aopNames[aop->type], aop->size); + emitDebug ("; Dump of %s: type %s size %u", plabel, aopNames[aop->type], aop->size); switch (aop->type) { case AOP_EXSTK: case AOP_STK: - emitDebug("; aop_stk %d", aop->aopu.aop_stk); + emitDebug ("; aop_stk %d", aop->aopu.aop_stk); break; case AOP_REG: - for (i=aop->size-1;i>=0;i--) + for (i = aop->size - 1; i >= 0; i--) *rbp++ = *(aop->aopu.aop_reg[i]->name); *rbp = '\0'; - emitDebug("; reg = %s", regbuf); + emitDebug ("; reg = %s", regbuf); break; case AOP_PAIRPTR: - emitDebug("; pairptr = (%s)", _pairs[aop->aopu.aop_pairId].name); + emitDebug ("; pairptr = (%s)", _pairs[aop->aopu.aop_pairId].name); default: /* No information. */ @@ -1017,20 +979,20 @@ #endif static void -_moveA(const char *moveFrom) +_moveA (const char *moveFrom) { - _emitMove(ACC_NAME, moveFrom); + _emitMove (ACC_NAME, moveFrom); } /* Load aop into A */ static void -_moveA3(asmop *from, int offset) +_moveA3 (asmop * from, int offset) { - _emitMove3(ASMOP_A, 0, from, offset); + _emitMove3 (ASMOP_A, 0, from, offset); } static void -_clearCarry(void) +_clearCarry (void) { emit3 (A_XOR, ASMOP_A, ASMOP_A); } @@ -1058,7 +1020,7 @@ int i; for (i = 0; i < NUM_PAIRS; i++) { - if (strcmp(aop->aopu.aop_str[0], _pairs[i].l) == 0) + if (strcmp (aop->aopu.aop_str[0], _pairs[i].l) == 0) return _pairs[i].name; } } @@ -1068,7 +1030,7 @@ /** Returns TRUE if the registers used in aop form a pair (BC, DE, HL) */ static bool -isPair (const asmop *aop) +isPair (const asmop * aop) { return (getPairId (aop) != PAIR_INVALID); } @@ -1076,7 +1038,7 @@ /** Returns TRUE if the registers used in aop cannot be split into high and low halves */ static bool -isUnsplitable (const asmop *aop) +isUnsplitable (const asmop * aop) { switch (getPairId (aop)) { @@ -1090,7 +1052,7 @@ } static bool -isPtrPair (const asmop *aop) +isPtrPair (const asmop * aop) { PAIR_ID pairId = getPairId (aop); switch (pairId) @@ -1115,21 +1077,21 @@ static void spillPairReg (const char *regname) { - if (strlen(regname)==1) + if (strlen (regname) == 1) { switch (*regname) { case 'h': case 'l': - spillPair(PAIR_HL); + spillPair (PAIR_HL); break; case 'd': case 'e': - spillPair(PAIR_DE); + spillPair (PAIR_DE); break; case 'b': case 'c': - spillPair(PAIR_BC); + spillPair (PAIR_BC); break; } } @@ -1139,7 +1101,7 @@ _push (PAIR_ID pairId) { emit2 ("push %s", _pairs[pairId].name); - regalloc_dry_run_cost += (pairId == PAIR_IX || pairId == PAIR_IY? 2 : 1); + regalloc_dry_run_cost += (pairId == PAIR_IX || pairId == PAIR_IY ? 2 : 1); _G.stack.pushed += 2; } @@ -1149,7 +1111,7 @@ if (pairId != PAIR_INVALID) { emit2 ("pop %s", _pairs[pairId].name); - regalloc_dry_run_cost += (pairId == PAIR_IX || pairId == PAIR_IY? 2 : 1); + regalloc_dry_run_cost += (pairId == PAIR_IX || pairId == PAIR_IY ? 2 : 1); _G.stack.pushed -= 2; spillPair (pairId); } @@ -1163,25 +1125,25 @@ case PAIR_IX: case PAIR_IY: case PAIR_AF: - _push(srcPair); - _pop(dstPair); + _push (srcPair); + _pop (dstPair); break; case PAIR_BC: case PAIR_DE: case PAIR_HL: if (srcPair == PAIR_IX || srcPair == PAIR_IY) { - _push(srcPair); - _pop(dstPair); + _push (srcPair); + _pop (dstPair); } else { - emit2("ld %s,%s",_pairs[dstPair].l,_pairs[srcPair].l); - emit2("ld %s,%s",_pairs[dstPair].h,_pairs[srcPair].h); + emit2 ("ld %s,%s", _pairs[dstPair].l, _pairs[srcPair].l); + emit2 ("ld %s,%s", _pairs[dstPair].h, _pairs[srcPair].h); regalloc_dry_run_cost += 2; } - default: - wassertl (0, "Tried to move a nonphysical pair"); + default: + wassertl (0, "Tried to move a nonphysical pair"); } _G.pairs[dstPair].last_type = _G.pairs[srcPair].last_type; _G.pairs[dstPair].base = _G.pairs[srcPair].base; @@ -1197,7 +1159,7 @@ { asmop *aop; - aop = traceAlloc(&_G.trace.aops, Safe_alloc (sizeof (asmop))); + aop = traceAlloc (&_G.trace.aops, Safe_alloc (sizeof (asmop))); aop->type = type; return aop; } @@ -1229,10 +1191,11 @@ /* The pointer that is used depends on how big the offset is. Normally everything is AOP_STK, but for offsets of < -128 or > 127 on the Z80 an extended stack pointer is used. - */ - if (!IS_GB && (_G.omitFramePtr || sym->stack < INT8MIN || sym->stack > (int)(INT8MAX-getSize (sym->type)))) + */ + if (!IS_GB && (_G.omitFramePtr || sym->stack < INT8MIN || sym->stack > (int) (INT8MAX - getSize (sym->type)))) { - emitDebug ("; AOP_EXSTK for %s, _G.omitFramePtr %d, sym->stack %d, size %d", sym->rname, (int)(_G.omitFramePtr), sym->stack, getSize (sym->type)); + emitDebug ("; AOP_EXSTK for %s, _G.omitFramePtr %d, sym->stack %d, size %d", sym->rname, (int) (_G.omitFramePtr), + sym->stack, getSize (sym->type)); sym->aop = aop = newAsmop (AOP_EXSTK); } else @@ -1250,38 +1213,40 @@ if (IS_FUNC (sym->type)) { sym->aop = aop = newAsmop (AOP_IMMD); - aop->aopu.aop_immd = traceAlloc(&_G.trace.aops, Safe_strdup (sym->rname)); + aop->aopu.aop_immd = traceAlloc (&_G.trace.aops, Safe_strdup (sym->rname)); aop->size = 2; return aop; } - if( IN_REGSP( space )) - { /*.p.t.20030716 minor restructure to add SFR support to the Z80 */ - if (IS_GB) + if (IN_REGSP (space)) { - /* if it is in direct space */ - if( !requires_a ) - { - sym->aop = aop = newAsmop (AOP_SFR); - aop->aopu.aop_dir = sym->rname; - aop->size = getSize (sym->type); - emitDebug ("; AOP_SFR for %s", sym->rname); - return aop; - } - } - else - { /*.p.t.20030716 adding SFR support to the Z80 port */ - aop = newAsmop (AOP_SFR); - sym->aop = aop; - aop->aopu.aop_dir = sym->rname; - aop->size = getSize( sym->type ); - aop->paged = FUNC_REGBANK(sym->type); - aop->bcInUse = isPairInUse( PAIR_BC, ic ); - emitDebug( ";Z80 AOP_SFR for %s banked:%d bc:%d", sym->rname, FUNC_REGBANK(sym->type), aop->bcInUse ); + /*.p.t.20030716 minor restructure to add SFR support to the Z80 */ + if (IS_GB) + { + /* if it is in direct space */ + if (!requires_a) + { + sym->aop = aop = newAsmop (AOP_SFR); + aop->aopu.aop_dir = sym->rname; + aop->size = getSize (sym->type); + emitDebug ("; AOP_SFR for %s", sym->rname); + return aop; + } + } + else + { + /*.p.t.20030716 adding SFR support to the Z80 port */ + aop = newAsmop (AOP_SFR); + sym->aop = aop; + aop->aopu.aop_dir = sym->rname; + aop->size = getSize (sym->type); + aop->paged = FUNC_REGBANK (sym->type); + aop->bcInUse = isPairInUse (PAIR_BC, ic); + emitDebug (";Z80 AOP_SFR for %s banked:%d bc:%d", sym->rname, FUNC_REGBANK (sym->type), aop->bcInUse); - return( aop ); + return (aop); + } } - } /* only remaining is far space */ /* in which case DPTR gets the address */ @@ -1291,7 +1256,7 @@ sym->aop = aop = newAsmop (AOP_HL); } else - sym->aop = aop = newAsmop (AOP_IY); + sym->aop = aop = newAsmop (AOP_IY); aop->size = getSize (sym->type); aop->aopu.aop_dir = sym->rname; @@ -1314,20 +1279,22 @@ int val = 0; struct dbuf_s dbuf; + wassert(ic); + for (;;) { if (ic->op == '+') { - if(isOperandLiteral (IC_RIGHT (ic))) + if (isOperandLiteral (IC_RIGHT (ic))) { val += (int) operandLitValue (IC_RIGHT (ic)); ic = OP_SYMBOL (IC_LEFT (ic))->rematiCode; } else - { - val += (int) operandLitValue (IC_LEFT (ic)); + { + val += (int) operandLitValue (IC_LEFT (ic)); ic = OP_SYMBOL (IC_RIGHT (ic))->rematiCode; - } + } } else if (ic->op == '-') { @@ -1411,30 +1378,21 @@ /* if both are itemps & one is spilt and the other is not then false */ - if (IS_ITEMP (op1) && IS_ITEMP (op2) && - sym1->isspilt != sym2->isspilt) + if (IS_ITEMP (op1) && IS_ITEMP (op2) && sym1->isspilt != sym2->isspilt) return FALSE; /* if they are the same */ if (sym1 == sym2) return 1; - if (sym1->rname[0] && sym2->rname[0] - && strcmp (sym1->rname, sym2->rname) == 0) + if (sym1->rname[0] && sym2->rname[0] && strcmp (sym1->rname, sym2->rname) == 0) return 2; /* if left is a tmp & right is not */ - if (IS_ITEMP (op1) && - !IS_ITEMP (op2) && - sym1->isspilt && - (sym1->usl.spillLoc == sym2)) + if (IS_ITEMP (op1) && !IS_ITEMP (op2) && sym1->isspilt && (sym1->usl.spillLoc == sym2)) return 3; - if (IS_ITEMP (op2) && - !IS_ITEMP (op1) && - sym2->isspilt && - sym1->level > 0 && - (sym2->usl.spillLoc == sym1)) + if (IS_ITEMP (op2) && !IS_ITEMP (op1) && sym2->isspilt && sym1->level > 0 && (sym2->usl.spillLoc == sym1)) return 4; return FALSE; @@ -1448,23 +1406,20 @@ { int i; - if (aop1->type == AOP_SFR || - aop2->type == AOP_SFR) + if (aop1->type == AOP_SFR || aop2->type == AOP_SFR) return FALSE; if (aop1 == aop2) return TRUE; - if (aop1->type != AOP_REG || - aop2->type != AOP_REG) + if (aop1->type != AOP_REG || aop2->type != AOP_REG) return FALSE; if (aop1->size != aop2->size) return FALSE; for (i = 0; i < aop1->size; i++) - if (aop1->aopu.aop_reg[i] != - aop2->aopu.aop_reg[i]) + if (aop1->aopu.aop_reg[i] != aop2->aopu.aop_reg[i]) return FALSE; return TRUE; @@ -1474,7 +1429,7 @@ /* aopOp - allocates an asmop for an operand : */ /*-----------------------------------------------------------------*/ static void -aopOp (operand *op, const iCode *ic, bool result, bool requires_a) +aopOp (operand * op, const iCode * ic, bool result, bool requires_a) { asmop *aop; symbol *sym; @@ -1497,7 +1452,7 @@ { if (op->aop->type == AOP_SFR) { - op->aop->bcInUse = isPairInUse( PAIR_BC, ic ); + op->aop->bcInUse = isPairInUse (PAIR_BC, ic); } return; } @@ -1508,7 +1463,7 @@ op->aop = OP_SYMBOL (op)->aop; if (op->aop->type == AOP_SFR) { - op->aop->bcInUse = isPairInUse( PAIR_BC, ic ); + op->aop->bcInUse = isPairInUse (PAIR_BC, ic); } return; } @@ -1559,62 +1514,62 @@ { aop = op->aop = sym->aop = newAsmop (AOP_ACC); aop->size = getSize (sym->type); - wassertl(aop->size == 1, "Internal error: Caching in A, but too big to fit in A"); + wassertl (aop->size == 1, "Internal error: Caching in A, but too big to fit in A"); aop->aopu.aop_str[0] = _pairs[PAIR_AF].h; } +#if 0 // HL is not handled as any other register pair. else if (sym->accuse == ACCUSE_SCRATCH) { aop = op->aop = sym->aop = newAsmop (AOP_HLREG); aop->size = getSize (sym->type); - wassertl(aop->size <= 2, "Internal error: Caching in HL, but too big to fit in HL"); + wassertl (aop->size <= 2, "Internal error: Caching in HL, but too big to fit in HL"); aop->aopu.aop_str[0] = _pairs[PAIR_HL].l; aop->aopu.aop_str[1] = _pairs[PAIR_HL].h; } +#endif else if (sym->accuse == ACCUSE_IY) { aop = op->aop = sym->aop = newAsmop (AOP_HLREG); aop->size = getSize (sym->type); - wassertl(aop->size <= 2, "Internal error: Caching in IY, but too big to fit in IY"); + wassertl (aop->size <= 2, "Internal error: Caching in IY, but too big to fit in IY"); aop->aopu.aop_str[0] = _pairs[PAIR_IY].l; aop->aopu.aop_str[1] = _pairs[PAIR_IY].h; } else { - wassertl (0, "Marked as being allocated into A or HL but is actually in neither"); + wassertl (0, "Marked as being allocated into A or IY but is actually in neither"); } return; } - + /* rematerialize it NOW */ if (sym->remat) { - sym->aop = op->aop = aop = - aopForRemat (sym); + sym->aop = op->aop = aop = aopForRemat (sym); aop->size = getSize (sym->type); return; } - if (regalloc_dry_run) // Todo: Handle dummy iTemp correctly + if (regalloc_dry_run) // Todo: Handle dummy iTemp correctly { sym->aop = op->aop = aop = newAsmop (AOP_STK); aop->size = getSize (sym->type); return; } - + if (sym->usl.spillLoc) { asmop *oldAsmOp = NULL; - if (getSize(sym->type) != getSize(sym->usl.spillLoc->type)) + if (getSize (sym->type) != getSize (sym->usl.spillLoc->type)) { /* force a new aop if sizes differ */ oldAsmOp = sym->usl.spillLoc->aop; sym->usl.spillLoc->aop = NULL; } - sym->aop = op->aop = aop = - aopForSym (ic, sym->usl.spillLoc, result, requires_a); - if (getSize(sym->type) != getSize(sym->usl.spillLoc->type)) + sym->aop = op->aop = aop = aopForSym (ic, sym->usl.spillLoc, result, requires_a); + if (getSize (sym->type) != getSize (sym->usl.spillLoc->type)) { /* Don't reuse the new aop, go with the last one */ sym->usl.spillLoc->aop = oldAsmOp; @@ -1643,7 +1598,7 @@ /* freeAsmop - free up the asmop given to an operand */ /*----------------------------------------------------------------*/ static void -freeAsmop (operand *op, asmop *aaop, const iCode *ic) +freeAsmop (operand * op, asmop * aaop, const iCode * ic) { asmop *aop; @@ -1687,7 +1642,7 @@ } static bool -isLitWord (const asmop *aop) +isLitWord (const asmop * aop) { /* if (aop->size != 2) return FALSE; */ @@ -1702,7 +1657,7 @@ } static const char * -aopGetLitWordLong (const asmop *aop, int offset, bool with_hash) +aopGetLitWordLong (const asmop * aop, int offset, bool with_hash) { static struct dbuf_s dbuf = { 0 }; @@ -1737,50 +1692,51 @@ break; case AOP_LIT: - { - value *val = aop->aopu.aop_lit; - /* if it is a float then it gets tricky */ - /* otherwise it is fairly simple */ - if (!IS_FLOAT (val->type)) - { - unsigned long v = ulFromVal (val); + { + value *val = aop->aopu.aop_lit; + /* if it is a float then it gets tricky */ + /* otherwise it is fairly simple */ + if (!IS_FLOAT (val->type)) + { + unsigned long v = ulFromVal (val); - if (offset == 2) - { - v >>= 16; - } - else if (offset == 0) - { - // OK - } - else - { - wassertl(0, "Encountered an invalid offset while fetching a literal"); - } + if (offset == 2) + { + v >>= 16; + } + else if (offset == 0) + { + // OK + } + else + { + wassertl (0, "Encountered an invalid offset while fetching a literal"); + } - dbuf_tprintf (&dbuf, with_hash ? "!immedword" : "!constword", v); - } - else + dbuf_tprintf (&dbuf, with_hash ? "!immedword" : "!constword", v & 0xfffful); + } + else + { + union { - union { - float f; - unsigned char c[4]; - } - fl; - unsigned int i; + float f; + unsigned char c[4]; + } + fl; + unsigned int i; - /* it is type float */ - fl.f = (float) floatFromVal (val); + /* it is type float */ + fl.f = (float) floatFromVal (val); #ifdef WORDS_BIGENDIAN - i = fl.c[3-offset] | (fl.c[3-offset-1]<<8); + i = fl.c[3 - offset] | (fl.c[3 - offset - 1] << 8); #else - i = fl.c[offset] | (fl.c[offset+1]<<8); + i = fl.c[offset] | (fl.c[offset + 1] << 8); #endif - dbuf_tprintf (&dbuf, with_hash ? "!immedword" : "!constword", i); - } - } - break; + dbuf_tprintf (&dbuf, with_hash ? "!immedword" : "!constword", i); + } + } + break; case AOP_HLREG: case AOP_REG: @@ -1841,34 +1797,36 @@ } static bool -requiresHL (const asmop *aop) +requiresHL (const asmop * aop) { switch (aop->type) { case AOP_IY: case AOP_HL: - case AOP_STK: case AOP_EXSTK: case AOP_HLREG: - return TRUE; + case AOP_STK: + return (IS_GB || _G.omitFramePtr); case AOP_REG: - { - int i; - for (i = 0; i < aop->size; i++) - { - wassert (aop->aopu.aop_reg[i]); - if (aop->aopu.aop_reg[i]->rIdx == L_IDX || aop->aopu.aop_reg[i]->rIdx == H_IDX) - return TRUE; - } - } + { + int i; + for (i = 0; i < aop->size; i++) + { + wassert (aop->aopu.aop_reg[i]); + if (aop->aopu.aop_reg[i]->rIdx == L_IDX || aop->aopu.aop_reg[i]->rIdx == H_IDX) + return TRUE; + } + } + case AOP_PAIRPTR: + return (aop->aopu.aop_pairId == PAIR_HL); default: return FALSE; } } static void -fetchLitPair (PAIR_ID pairId, asmop *left, int offset) +fetchLitPair (PAIR_ID pairId, asmop * left, int offset) { const char *pair = _pairs[pairId].name; char *l = Safe_strdup (aopGetLitWordLong (left, offset, FALSE)); @@ -1877,27 +1835,27 @@ wassert (pair); - emitDebug(";fetchLitPair"); + emitDebug (";fetchLitPair"); if (isPtr (pair)) { if (pairId == PAIR_HL || pairId == PAIR_IY) { - if (pairId == PAIR_HL && base[0] == '0') // Ugly workaround + if (pairId == PAIR_HL && base[0] == '0') // Ugly workaround { - unsigned int tmpoffset; - const char *tmpbase; - if(sscanf(base, "%xd", &tmpoffset) && (tmpbase = strchr(base , '+'))) - { - offset = tmpoffset; - base = tmpbase++; - } + unsigned int tmpoffset; + const char *tmpbase; + if (sscanf (base, "%xd", &tmpoffset) && (tmpbase = strchr (base, '+'))) + { + offset = tmpoffset; + base = tmpbase++; + } } if ((_G.pairs[pairId].last_type == AOP_IMMD && left->type == AOP_IMMD) || - (_G.pairs[pairId].last_type == AOP_IY && left->type == AOP_IY) || - (_G.pairs[pairId].last_type == AOP_HL && left->type == AOP_HL)) + (_G.pairs[pairId].last_type == AOP_IY && left->type == AOP_IY) || + (_G.pairs[pairId].last_type == AOP_HL && left->type == AOP_HL)) { - if (!regalloc_dry_run && _G.pairs[pairId].base && !strcmp (_G.pairs[pairId].base, base)) // Todo: Exact cost. + if (!regalloc_dry_run && _G.pairs[pairId].base && !strcmp (_G.pairs[pairId].base, base)) // Todo: Exact cost. { if (pairId == PAIR_HL && abs (_G.pairs[pairId].offset - offset) < 3) { @@ -1913,7 +1871,7 @@ } if (pairId == PAIR_HL && left->type == AOP_LIT && _G.pairs[pairId].last_type == AOP_LIT && - !IS_FLOAT (left->aopu.aop_lit->type) && offset == 0 && _G.pairs[pairId].offset == 0) + !IS_FLOAT (left->aopu.aop_lit->type) && offset == 0 && _G.pairs[pairId].offset == 0) { unsigned new_low, new_high, old_low, old_high; unsigned long v_new = ulFromVal (left->aopu.aop_lit); @@ -1924,13 +1882,13 @@ old_high = (v_old >> 8) & 0xff; /* Change lower byte only. */ - if(new_high == old_high) + if (new_high == old_high) { emit3_o (A_LD, ASMOP_L, 0, left, 0); goto adjusted; } /* Change upper byte only. */ - else if(new_low == old_low) + else if (new_low == old_low) { emit3_o (A_LD, ASMOP_H, 0, left, 1); goto adjusted; @@ -1939,7 +1897,7 @@ _G.pairs[pairId].last_type = left->type; - _G.pairs[pairId].base = traceAlloc(&_G.trace.aops, Safe_strdup (base)); + _G.pairs[pairId].base = traceAlloc (&_G.trace.aops, Safe_strdup (base)); _G.pairs[pairId].offset = offset; } /* Both a lit on the right and a true symbol on the left */ @@ -1951,24 +1909,24 @@ adjusted: _G.pairs[pairId].last_type = left->type; - _G.pairs[pairId].base = traceAlloc(&_G.trace.aops, Safe_strdup (base)); + _G.pairs[pairId].base = traceAlloc (&_G.trace.aops, Safe_strdup (base)); _G.pairs[pairId].offset = offset; Safe_free (base_str); Safe_free (l); } static PAIR_ID -makeFreePairId (const iCode *ic, bool *pisUsed) +makeFreePairId (const iCode * ic, bool * pisUsed) { *pisUsed = FALSE; if (ic != NULL) { - if (!bitVectBitValue (ic->rMask, B_IDX) && !bitVectBitValue(ic->rMask, C_IDX)) + if (!bitVectBitValue (ic->rMask, B_IDX) && !bitVectBitValue (ic->rMask, C_IDX)) { return PAIR_BC; } - else if (!IS_GB && !bitVectBitValue (ic->rMask, D_IDX) && !bitVectBitValue(ic->rMask, E_IDX)) + else if (!IS_GB && !bitVectBitValue (ic->rMask, D_IDX) && !bitVectBitValue (ic->rMask, E_IDX)) { return PAIR_DE; } @@ -1985,37 +1943,61 @@ } } +/* If ic != 0, we can safely use isPairDead(). */ static void -fetchPairLong (PAIR_ID pairId, asmop *aop, const iCode *ic, int offset) +fetchPairLong (PAIR_ID pairId, asmop * aop, const iCode * ic, int offset) { - emitDebug(";fetchPairLong"); + emitDebug (";fetchPairLong"); - /* if this is rematerializable */ - if (isLitWord (aop)) - fetchLitPair (pairId, aop, offset); - else - { - if (getPairId (aop) == pairId) - { - /* Do nothing */ - } - /* we need to get it byte by byte */ - else if (pairId == PAIR_HL && (IS_GB || (IY_RESERVED && aop->type == AOP_HL)) && requiresHL (aop)) - { - if (!regalloc_dry_run) // TODO: Fix this to get correct cost! - aopGet (aop, offset, FALSE); - switch (aop->size - offset) { + /* if this is rematerializable */ + if (isLitWord (aop)) + fetchLitPair (pairId, aop, offset); + else + { + if (getPairId (aop) == pairId) + { + /* Do nothing */ + } + /* Getting the parameter by a pop / push sequence is cheaper when we have a free pair (except for the Rabbit, which has an even cheaper sp-relative load). + Stack allocation can change after register allocation, so assume this optimization is not possible for the allcoator's cost function. */ + else if (!regalloc_dry_run && !IS_RAB && aop->size - offset >= 2 && + (aop->type == AOP_STK || aop->type == AOP_EXSTK) + && (aop->aopu.aop_stk + offset + _G.stack.offset + (aop->aopu.aop_stk > 0 ? _G.stack.param_offset : 0) + + _G.stack.pushed) == 2 && ic && (pairId != PAIR_BC && isPairDead (PAIR_BC, ic) || pairId != PAIR_DE + && isPairDead (PAIR_DE, ic))) + { + PAIR_ID extrapair = (pairId != PAIR_BC && isPairDead (PAIR_BC, ic)) ? PAIR_BC : PAIR_DE; + _pop (extrapair); + _pop (pairId); + _push (pairId); + _push (extrapair); + } + /* Todo: Use even cheaper ex hl, (sp) and ex iy, (sp) when possible. */ + else if (!regalloc_dry_run && (!IS_RAB || pairId == PAIR_BC || pairId == PAIR_DE) && aop->size - offset >= 2 && + (aop->type == AOP_STK || aop->type == AOP_EXSTK) + && (aop->aopu.aop_stk + offset + _G.stack.offset + (aop->aopu.aop_stk > 0 ? _G.stack.param_offset : 0) + + _G.stack.pushed) == 0) + { + _pop (pairId); + _push (pairId); + } + /* we need to get it byte by byte */ + else if (pairId == PAIR_HL && (IS_GB || (IY_RESERVED && aop->type == AOP_HL)) && requiresHL (aop)) + { + if (!regalloc_dry_run) // TODO: Fix this to get correct cost! + aopGet (aop, offset, FALSE); + switch (aop->size - offset) + { case 1: emit2 ("ld l,!*hl"); emit2 ("ld h,!immedbyte", 0); regalloc_dry_run_cost += 3; break; - case 2: - // PENDING: Requires that you are only fetching two bytes. - case 4: - if (IS_R2K) + default: + wassertl (aop->size - offset > 1, "Attempted to fetch no data into HL"); + if (IS_RAB) { - emit2 ("ld hl, (hl)"); + emit2 ("ld hl, 0 (hl)"); regalloc_dry_run_cost += 3; } else @@ -2027,115 +2009,127 @@ regalloc_dry_run_cost += 4; } break; - default: - wassertl (0, "Attempted to fetch too much data into HL"); - break; } - } - else if (!IS_GB && aop->type == AOP_IY && !(pairId == PAIR_IY && aop->size < 2)) { + } + else if (!IS_GB && aop->type == AOP_IY && !(pairId == PAIR_IY && aop->size < 2)) + { /* Instead of fetching relative to IY, just grab directly from the address IY refers to */ emit2 ("ld %s,(%s)", _pairs[pairId].name, aopGetLitWordLong (aop, offset, FALSE)); regalloc_dry_run_cost += (pairId == PAIR_IY ? 4 : 3); - if (aop->size < 2) { - emit2("ld %s,!zero", _pairs[pairId].h); - regalloc_dry_run_cost += 2; - } + if (aop->size < 2) + { + emit2 ("ld %s,!zero", _pairs[pairId].h); + regalloc_dry_run_cost += 2; + } } - else if (pairId == PAIR_IY) - { -#ifdef ALL_RABBIT - if (isPair (aop) && IS_R2K && getPairId (aop) == PAIR_HL) - { - emit2 ("ld iy, hl"); - regalloc_dry_run_cost += 2; - } -#endif - if (isPair (aop)) - { - emit2 ("push %s", _pairs[getPairId(aop)].name); - emit2 ("pop iy"); - regalloc_dry_run_cost += 3; - } - else - { - bool isUsed; - PAIR_ID id = makeFreePairId (ic, &isUsed); - if (isUsed) - _push (id); - /* Can't load into parts, so load into HL then exchange. */ - if (!regalloc_dry_run) - { - emit2 ("ld %s,%s", _pairs[id].l, aopGet (aop, offset, FALSE)); - emit2 ("ld %s,%s", _pairs[id].h, aopGet (aop, offset + 1, FALSE)); - - } - regalloc_dry_run_cost += ld_cost(ASMOP_L, aop) + ld_cost(ASMOP_H, aop); -#ifdef ALL_RABBIT - if (IS_R2K && id == PAIR_HL) ld iy, hl is not yet supported by the assembler - { - emit2 ("ld iy, hl"); - regalloc_dry_run_cost += 2; - } - else -#endif - { - emit2 ("push %s", _pairs[id].name); - emit2 ("pop iy"); - regalloc_dry_run_cost += 3; - } - if (isUsed) - _pop (id); - } - } - else if (isUnsplitable(aop)) - { - emit2("push %s", _pairs[getPairId(aop)].name); - emit2("pop %s", _pairs[pairId].name); - regalloc_dry_run_cost += (pairId == PAIR_IY ? 2 : 1) + (getPairId(aop) == PAIR_IY ? 2 : 1); - } - else - { - /* The Rabbit has the ld hl, n (sp) and ld hl, n (ix) instructions. */ - int fp_offset = aop->aopu.aop_stk + offset + _G.stack.offset + (aop->aopu.aop_stk > 0 ? _G.stack.param_offset : 0); - int sp_offset = fp_offset + _G.stack.pushed; - if (IS_GB && aop->size - offset >= 2 && aop->type == AOP_STK && pairId == PAIR_HL && abs (sp_offset) <= 127) - { - emit2 ("ld hl, %d (sp)", sp_offset); /* Fetch relative to stack pointer. */ - } - else if (IS_R2K && aop->size - offset >= 2 && aop->type == AOP_STK && (pairId == PAIR_HL || pairId == PAIR_IY) && - (abs (fp_offset) <= 127 && pairId == PAIR_HL || abs (sp_offset) <= 127)) - { - if (abs (sp_offset) <= 127) - emit2 ("ld %s, %d (sp)", pairId == PAIR_IY ? "iy" : "hl", sp_offset); /* Fetch relative to stack pointer. */ - else - emit2 ("ld hl, %d (ix)", fp_offset); /* Fetch relative to frame pointer. */ - regalloc_dry_run_cost += (pairId == PAIR_HL ? 2 : 3); - } + else if (pairId == PAIR_IY) + { + if (isPair (aop) && IS_RAB && getPairId (aop) == PAIR_HL) + { + emit2 ("ld iy, hl"); + regalloc_dry_run_cost += 2; + } + else if (isPair (aop)) + { + emit2 ("push %s", _pairs[getPairId (aop)].name); + emit2 ("pop iy"); + regalloc_dry_run_cost += 3; + } + else + { + bool isUsed; + PAIR_ID id = makeFreePairId (ic, &isUsed); + if (isUsed) + _push (id); + /* Can't load into parts, so load into HL then exchange. */ + if (!regalloc_dry_run) + { + emit2 ("ld %s,%s", _pairs[id].l, aopGet (aop, offset, FALSE)); + emit2 ("ld %s,%s", _pairs[id].h, aopGet (aop, offset + 1, FALSE)); + } + regalloc_dry_run_cost += ld_cost (ASMOP_L, aop) + ld_cost (ASMOP_H, aop); - /* Operand resides (partially) in the pair */ - else if (!regalloc_dry_run && !strcmp(aopGet (aop, offset + 1, FALSE), _pairs[pairId].l)) // Todo: Exact cost - { - _moveA3 (aop, offset + 1); - if(!regalloc_dry_run) + if (IS_RAB && id == PAIR_HL) + { + emit2 ("ld iy, hl"); + regalloc_dry_run_cost += 2; + } + else + { + emit2 ("push %s", _pairs[id].name); + emit2 ("pop iy"); + regalloc_dry_run_cost += 3; + } + if (isUsed) + _pop (id); + } + } + else if (isUnsplitable (aop)) + { + emit2 ("push %s", _pairs[getPairId (aop)].name); + emit2 ("pop %s", _pairs[pairId].name); + regalloc_dry_run_cost += (pairId == PAIR_IY ? 2 : 1) + (getPairId (aop) == PAIR_IY ? 2 : 1); + } + else + { + /* The Rabbit has the ld hl, n (sp) and ld hl, n (ix) instructions. */ + int fp_offset = aop->aopu.aop_stk + offset + _G.stack.offset + (aop->aopu.aop_stk > 0 ? _G.stack.param_offset : 0); + int sp_offset = fp_offset + _G.stack.pushed; + if (IS_RAB && aop->size - offset >= 2 && (aop->type == AOP_STK || aop->type == AOP_EXSTK) + && (pairId == PAIR_HL || pairId == PAIR_IY || pairId == PAIR_DE) && (abs (fp_offset) <= 127 && pairId == PAIR_HL + && aop->type == AOP_STK + || abs (sp_offset) <= 127)) + { + if (pairId == PAIR_DE) + { + emit2 ("ex de, hl"); + regalloc_dry_run_cost += 1; + } + if (abs (sp_offset) <= 127) + emit2 ("ld %s, %d (sp)", pairId == PAIR_IY ? "iy" : "hl", sp_offset); /* Fetch relative to stack pointer. */ + else + emit2 ("ld hl, %d (ix)", fp_offset); /* Fetch relative to frame pointer. */ + regalloc_dry_run_cost += (pairId == PAIR_IY ? 3 : 2); + if (pairId == PAIR_DE) + { + emit2 ("ex de, hl"); + regalloc_dry_run_cost += 1; + } + } + + /* Operand resides (partially) in the pair */ + else if (!regalloc_dry_run && !strcmp (aopGet (aop, offset + 1, FALSE), _pairs[pairId].l)) // aopGet (aop, offset + 1, FALSE) is problematic: It prevents calcualtion of exact cost, and results in redundatn code being generated. Todo: Exact cost + { + _moveA3 (aop, offset + 1); + if (!regalloc_dry_run) + emit2 ("ld %s,%s", _pairs[pairId].l, aopGet (aop, offset, FALSE)); + regalloc_dry_run_cost += ld_cost (ASMOP_A, aop); + emit2 ("ld %s,a", _pairs[pairId].h); + regalloc_dry_run_cost += 1; + } + /* The Rabbit's cast to bool is a cheap way of zeroing h (similar to xor a, a for a for the Z80). */ + else if (pairId == PAIR_HL && IS_RAB && aop->size - offset == 1 && !(aop->type == AOP_REG && (aop->aopu.aop_reg[offset]->rIdx == L_IDX || aop->aopu.aop_reg[offset]->rIdx == H_IDX))) + { + emit2 ("bool hl"); + regalloc_dry_run_cost++; + if (!regalloc_dry_run) + emit2 ("ld %s,%s", _pairs[pairId].l, aopGet (aop, offset, FALSE)); + regalloc_dry_run_cost += ld_cost (ASMOP_L, aop); + } + else + { + if (!regalloc_dry_run) + { emit2 ("ld %s,%s", _pairs[pairId].l, aopGet (aop, offset, FALSE)); - regalloc_dry_run_cost += ld_cost(ASMOP_A, aop); - emit2 ("ld %s,a", _pairs[pairId].h); - regalloc_dry_run_cost += 1; - } - else - { - if(!regalloc_dry_run) - { - emit2 ("ld %s,%s", _pairs[pairId].l, aopGet (aop, offset, FALSE)); - emit2 ("ld %s,%s", _pairs[pairId].h, aopGet (aop, offset + 1, FALSE)); - } - regalloc_dry_run_cost += ld_cost(ASMOP_L, aop) * 2; - } - } - /* PENDING: check? */ - spillPair (pairId); + emit2 ("ld %s,%s", _pairs[pairId].h, aopGet (aop, offset + 1, FALSE)); + } + regalloc_dry_run_cost += ld_cost (ASMOP_L, aop) * 2; + } + } + /* PENDING: check? */ + spillPair (pairId); } } @@ -2146,12 +2140,6 @@ } static void -fetchHL (asmop * aop) -{ - fetchPair (PAIR_HL, aop); -} - -static void setupPairFromSP (PAIR_ID id, int offset) { wassertl (id == PAIR_HL, "Setup relative to SP only implemented for HL"); @@ -2171,7 +2159,7 @@ else { emit2 ("!ldahlsp", offset); - regalloc_dry_run_cost += 4; // Todo: More exact cost. + regalloc_dry_run_cost += 3; } if (_G.preserveCarry) @@ -2182,7 +2170,7 @@ } static void -setupPair (PAIR_ID pairId, asmop *aop, int offset) +setupPair (PAIR_ID pairId, asmop * aop, int offset) { switch (aop->type) { @@ -2233,27 +2221,27 @@ break; case AOP_STK: - { - /* Doesnt include _G.stack.pushed */ - int abso = aop->aopu.aop_stk + offset + _G.stack.offset + (aop->aopu.aop_stk > 0 ? _G.stack.param_offset : 0); + { + /* Doesnt include _G.stack.pushed */ + int abso = aop->aopu.aop_stk + offset + _G.stack.offset + (aop->aopu.aop_stk > 0 ? _G.stack.param_offset : 0); - assert (pairId == PAIR_HL); - /* In some cases we can still inc or dec hl */ - if (_G.pairs[pairId].last_type == AOP_STK && abs (_G.pairs[pairId].offset - abso) < 3) - { - adjustPair (_pairs[pairId].name, &_G.pairs[pairId].offset, abso); - } - else - { - setupPairFromSP (PAIR_HL, abso + _G.stack.pushed); - } - _G.pairs[pairId].offset = abso; - break; - } + assert (pairId == PAIR_HL); + /* In some cases we can still inc or dec hl */ + if (_G.pairs[pairId].last_type == AOP_STK && abs (_G.pairs[pairId].offset - abso) < 3) + { + adjustPair (_pairs[pairId].name, &_G.pairs[pairId].offset, abso); + } + else + { + setupPairFromSP (PAIR_HL, abso + _G.stack.pushed); + } + _G.pairs[pairId].offset = abso; + break; + } case AOP_PAIRPTR: if (pairId != aop->aopu.aop_pairId) - genMovePairPair(aop->aopu.aop_pairId, pairId); + genMovePairPair (aop->aopu.aop_pairId, pairId); adjustPair (_pairs[pairId].name, &_G.pairs[pairId].offset, offset); break; @@ -2263,19 +2251,10 @@ _G.pairs[pairId].last_type = aop->type; } -/* Can be used for local labels where Code generation takes care of spilling */ -static void -emitLabelNoSpill (int key) -{ - emit2 ("!tlabeldef", key); - _G.lines.current->isLabel = 1; -} - static void -emitLabel (int key) +emitLabelSpill (symbol * tlbl) { - emit2 ("!tlabeldef", key); - _G.lines.current->isLabel = 1; + emitLabel (tlbl); spillCached (); } @@ -2344,6 +2323,7 @@ case AOP_DIR: wassert (IS_GB); emit2 ("ld a,(%s+%d)", aop->aopu.aop_dir, offset); + regalloc_dry_run_cost += 3; dbuf_append_char (&dbuf, 'a'); break; @@ -2351,29 +2331,34 @@ if (IS_GB) { emit2 ("ldh a,(%s+%d)", aop->aopu.aop_dir, offset); + regalloc_dry_run_cost += 2; dbuf_append_char (&dbuf, 'a'); } - else if (IS_R2K) + else if (IS_RAB) { emit2 ("ioi"); emit2 ("ld a,(%s)", aop->aopu.aop_dir); - emit2 ("nop"); /* Workaround for Rabbit 2000 hardware bug. see TN302 for details. */ + emit2 ("nop"); /* Workaround for Rabbit 2000 hardware bug. see TN302 for details. */ dbuf_append_char (&dbuf, 'a'); } else - { /*.p.t.20030716 handling for i/o port read access for Z80 */ + { + /*.p.t.20030716 handling for i/o port read access for Z80 */ if (aop->paged) - { /* banked mode */ + { + /* banked mode */ /* reg A goes to address bits 15-8 during "in a,(x)" instruction */ emit2 ("ld a,!msbimmeds", aop->aopu.aop_dir); emit2 ("in a,(!lsbimmeds)", aop->aopu.aop_dir); } else if (z80_opts.port_mode == 180) - { /* z180 in0/out0 mode */ + { + /* z180 in0/out0 mode */ emit2 ("in0 a,(%s)", aop->aopu.aop_dir); } else - { /* 8 bit mode */ + { + /* 8 bit mode */ emit2 ("in a,(%s)", aop->aopu.aop_dir); } @@ -2447,13 +2432,16 @@ break; case AOP_SIMPLELIT: - { - unsigned long v = aop->aopu.aop_simplelit; + { + unsigned long v = aop->aopu.aop_simplelit; + if (offset >= sizeof(v)) + v = 0; + else v >>= (offset * 8); - dbuf_tprintf (&dbuf, "!immedbyte", (unsigned int) v & 0xff); - } - break; + dbuf_tprintf (&dbuf, "!immedbyte", (unsigned int) v & 0xff); + } + break; case AOP_STR: aop->coff = offset; @@ -2483,12 +2471,7 @@ isRegString (const char *s) { if (!strcmp (s, "b") || - !strcmp (s, "c") || - !strcmp (s, "d") || - !strcmp (s, "e") || - !strcmp (s, "a") || - !strcmp (s, "h") || - !strcmp (s, "l")) + !strcmp (s, "c") || !strcmp (s, "d") || !strcmp (s, "e") || !strcmp (s, "a") || !strcmp (s, "h") || !strcmp (s, "l")) return TRUE; return FALSE; } @@ -2500,6 +2483,12 @@ return (*s == '#' || *s == '$'); } +#define AOP(op) op->aop +#define AOP_TYPE(op) AOP(op)->type +#define AOP_SIZE(op) AOP(op)->size +#define AOP_NEEDSACC(x) (AOP(x) && ((AOP_TYPE(x) == AOP_CRY) || (AOP_TYPE(x) == AOP_SFR))) +#define AOP_IS_PAIRPTR(x, p) (AOP_TYPE (x) == AOP_PAIRPTR && AOP (x)->aopu.aop_pairId == p) + static bool canAssignToPtr (const char *s) { @@ -2511,20 +2500,20 @@ } static bool -canAssignToPtr3 (const asmop *aop) +canAssignToPtr3 (const asmop * aop) { - if(aop->type == AOP_ACC || aop->type == AOP_REG || aop->type == AOP_HLREG) - return(TRUE); - if(aop->type == AOP_IMMD || aop->type == AOP_LIT || aop->type == AOP_SIMPLELIT) - return(TRUE); - return(FALSE); + if (aop->type == AOP_ACC || aop->type == AOP_REG || aop->type == AOP_HLREG) + return (TRUE); + if (aop->type == AOP_IMMD || aop->type == AOP_LIT || aop->type == AOP_SIMPLELIT) + return (TRUE); + return (FALSE); } /*-----------------------------------------------------------------*/ /* aopPut - puts a string for a aop */ /*-----------------------------------------------------------------*/ static void -aopPut (asmop *aop, const char *s, int offset) +aopPut (asmop * aop, const char *s, int offset) { struct dbuf_s dbuf; @@ -2532,8 +2521,7 @@ if (aop->size && offset > (aop->size - 1)) { - werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - "aopPut got offset > aop->size"); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "aopPut got offset > aop->size"); exit (0); } @@ -2547,7 +2535,7 @@ switch (aop->type) { case AOP_DUMMY: - _moveA (s); /* in case s is volatile */ + _moveA (s); /* in case s is volatile */ break; case AOP_DIR: @@ -2566,50 +2554,52 @@ emit2 ("ld a,%s", s); emit2 ("ldh (%s+%d),a", aop->aopu.aop_dir, offset); } - else if (IS_R2K) + else if (IS_RAB) { if (strcmp (s, "a")) emit2 ("ld a,%s", s); - + /* LM 20110928: Need to fix to emit either "ioi" or "ioe" * (for internal vs. external I/O space */ emit2 ("ioi"); emit2 ("ld (%s),a", aop->aopu.aop_dir); - emit2 ("nop"); /* Workaround for Rabbit 2000 hardware bug. see TN302 for details. */ + emit2 ("nop"); /* Workaround for Rabbit 2000 hardware bug. see TN302 for details. */ } else - { /*.p.t.20030716 handling for i/o port read access for Z80 */ + { + /*.p.t.20030716 handling for i/o port read access for Z80 */ if (aop->paged) - { /* banked mode */ + { + /* banked mode */ if (aop->bcInUse) - emit2( "push bc" ); + emit2 ("push bc"); - if (strlen(s) != 1 - || (s[0] != 'a' && s[0] != 'd' && s[0] != 'e' - && s[0] != 'h' && s[0] != 'l')) + if (strlen (s) != 1 || (s[0] != 'a' && s[0] != 'd' && s[0] != 'e' && s[0] != 'h' && s[0] != 'l')) { - emit2( "ld a,%s", s ); + emit2 ("ld a,%s", s); s = "a"; } - emit2( "ld bc,#%s", aop->aopu.aop_dir ); - emit2( "out (c),%s", s ); + emit2 ("ld bc,#%s", aop->aopu.aop_dir); + emit2 ("out (c),%s", s); - if( aop->bcInUse ) - emit2( "pop bc" ); + if (aop->bcInUse) + emit2 ("pop bc"); else spillPair (PAIR_BC); } - else if( z80_opts.port_mode == 180 ) - { /* z180 in0/out0 mode */ - emit2( "ld a,%s", s ); - emit2( "out0 (%s),a", aop->aopu.aop_dir ); + else if (z80_opts.port_mode == 180) + { + /* z180 in0/out0 mode */ + emit2 ("ld a,%s", s); + emit2 ("out0 (%s),a", aop->aopu.aop_dir); } else - { /* 8 bit mode */ - emit2( "ld a,%s", s ); - emit2( "out (%s),a", aop->aopu.aop_dir ); + { + /* 8 bit mode */ + emit2 ("ld a,%s", s); + emit2 ("out (%s),a", aop->aopu.aop_dir); } } break; @@ -2618,9 +2608,8 @@ if (!strcmp (s, "!*hl")) emit2 ("ld %s,!*hl", aop->aopu.aop_reg[offset]->name); else - emit2 ("ld %s,%s", - aop->aopu.aop_reg[offset]->name, s); - spillPairReg(aop->aopu.aop_reg[offset]->name); + emit2 ("ld %s,%s", aop->aopu.aop_reg[offset]->name, s); + spillPairReg (aop->aopu.aop_reg[offset]->name); break; case AOP_IY: @@ -2646,6 +2635,11 @@ emit2 ("ld a,!*hl"); s = "a"; } + else if (strstr (s, "(ix)") || strstr (s, "(iy)")) + { + emit2 ("ld a, %s", s); + s = "a"; + } setupPair (PAIR_HL, aop, offset); emit2 ("ld !*hl,%s", s); @@ -2720,7 +2714,7 @@ { emit2 ("ld %s,%s", aop->aopu.aop_str[offset], s); } - spillPairReg(aop->aopu.aop_str[offset]); + spillPairReg (aop->aopu.aop_str[offset]); break; case AOP_ACC: @@ -2738,7 +2732,7 @@ if (strcmp (aop->aopu.aop_str[offset], s)) { emit2 ("ld %s,%s", aop->aopu.aop_str[offset], s); - spillPairReg(aop->aopu.aop_str[offset]); + spillPairReg (aop->aopu.aop_str[offset]); } } break; @@ -2746,14 +2740,14 @@ case AOP_HLREG: wassert (offset < 2); emit2 ("ld %s,%s", aop->aopu.aop_str[offset], s); - spillPairReg(aop->aopu.aop_str[offset]); + spillPairReg (aop->aopu.aop_str[offset]); break; case AOP_PAIRPTR: setupPair (aop->aopu.aop_pairId, aop, offset); - if (aop->aopu.aop_pairId==PAIR_IX) + if (aop->aopu.aop_pairId == PAIR_IX) emit2 ("ld !*ixx,%s", 0, s); - else if (aop->aopu.aop_pairId==PAIR_IY) + else if (aop->aopu.aop_pairId == PAIR_IY) emit2 ("ld !*iyx,%s", 0, s); else emit2 ("ld (%s),%s", _pairs[aop->aopu.aop_pairId].name, s); @@ -2768,68 +2762,104 @@ } static void -aopPut3 (asmop *op1, int offset1, asmop *op2, int offset2) +aopPut3 (asmop * op1, int offset1, asmop * op2, int offset2) { unsigned char cost = regalloc_dry_run_cost; + int fp_offset=0; + int sp_offset=0; + + if (!regalloc_dry_run) + { + if ((op1->type == AOP_STK || op1->type == AOP_EXSTK)) + { + fp_offset = op1->aopu.aop_stk + _G.stack.offset + offset1 + (op1->aopu.aop_stk > 0 ? _G.stack.param_offset : 0); + sp_offset = fp_offset + _G.stack.pushed; + } + + if ((op1->type == AOP_STK || op1->type == AOP_EXSTK) && !sp_offset && _G.omitFramePtr && op1->size == 1 && + (op2->type == AOP_REG && (op2->aopu.aop_reg[offset2]->rIdx == B_IDX || op2->aopu.aop_reg[offset2]->rIdx == D_IDX || op2->aopu.aop_reg[offset2]->rIdx == H_IDX) || + op2->type == AOP_ACC && op2->size == 1) && !offset2) + { + emit2 ("inc sp"); + emit2 ("push %s", op2->type == AOP_ACC ? "af" : (op2->aopu.aop_reg[offset2]->rIdx == B_IDX ? "bc" : (op2->aopu.aop_reg[offset2]->rIdx == D_IDX ? "de" : "hl"))); + emit2 ("inc sp"); + regalloc_dry_run_cost += 4; + } + else + aopPut (op1, aopGet (op2, offset2, FALSE), offset1); + } - if(!regalloc_dry_run) - aopPut (op1, aopGet(op2, offset2, FALSE), offset1); - regalloc_dry_run_cost = cost + ld_cost(op1, offset2 < op2->size ? op2 : ASMOP_ZERO); + regalloc_dry_run_cost = cost + ld_cost (op1, offset2 < op2->size ? op2 : ASMOP_ZERO); } // Move, but try not to. static void -cheapMove (asmop *to, int to_offset, asmop *from, int from_offset) +cheapMove (asmop * to, int to_offset, asmop * from, int from_offset) { /* Todo: Longer list of moves that can be optimized out. */ if (to->type == AOP_ACC && from->type == AOP_ACC && to_offset == from_offset) return; if (to->type == AOP_REG && from->type == AOP_REG && to->aopu.aop_reg[to_offset] == from->aopu.aop_reg[from_offset]) return; - if (to->type == AOP_HLREG && from->type == AOP_HLREG && !strcmp(to->aopu.aop_str[to_offset], from->aopu.aop_str[from_offset])) + if (to->type == AOP_HLREG && from->type == AOP_HLREG + && !strcmp (to->aopu.aop_str[to_offset], from->aopu.aop_str[from_offset])) return; aopPut3 (to, to_offset, from, from_offset); } -#define AOP(op) op->aop -#define AOP_TYPE(op) AOP(op)->type -#define AOP_SIZE(op) AOP(op)->size -#define AOP_NEEDSACC(x) (AOP(x) && ((AOP_TYPE(x) == AOP_CRY) || (AOP_TYPE(x) == AOP_SFR))) -#define AOP_IS_PAIRPTR(x, p) (AOP_TYPE (x) == AOP_PAIRPTR && AOP (x)->aopu.aop_pairId == p) - static void -commitPair (asmop * aop, PAIR_ID id) +commitPair (asmop *aop, PAIR_ID id, const iCode *ic, bool dont_destroy) { int fp_offset = aop->aopu.aop_stk + _G.stack.offset + (aop->aopu.aop_stk > 0 ? _G.stack.param_offset : 0); int sp_offset = fp_offset + _G.stack.pushed; - if (IS_R2K && aop->type == AOP_STK && (id == PAIR_HL || id == PAIR_IY) && - (id == PAIR_HL && abs (fp_offset) <= 127 || abs (sp_offset) <= 127)) + + /* Stack positions will change, so do not assume this is possible in the cost function. */ + if (!regalloc_dry_run && !IS_GB && (aop->type == AOP_STK || aop->type == AOP_EXSTK) && !sp_offset + && ((!IS_RAB && id == PAIR_HL) || id == PAIR_IY) && !dont_destroy) + { + emit2 ("ex (sp), %s", _pairs[id].name); + regalloc_dry_run_cost += ((id == PAIR_IY || IS_RAB) ? 2 : 1); + spillPair (id); + } + else if (IS_RAB && (aop->type == AOP_STK || aop->type == AOP_EXSTK) && (id == PAIR_HL || id == PAIR_IY) && + (id == PAIR_HL && abs (fp_offset) <= 127 && aop->type == AOP_STK || abs (sp_offset) <= 127)) { if (abs (sp_offset) <= 127) - emit2 ("ld %d (sp), %s", sp_offset, id == PAIR_IY ? "iy" : "hl"); /* Relative to stack pointer. */ + emit2 ("ld %d (sp), %s", sp_offset, id == PAIR_IY ? "iy" : "hl"); /* Relative to stack pointer. */ else - emit2 ("ld %d (ix), hl", fp_offset); /* Relative to frame pointer. */ + emit2 ("ld %d (ix), hl", fp_offset); /* Relative to frame pointer. */ regalloc_dry_run_cost += (id == PAIR_HL ? 2 : 3); } + else if (!regalloc_dry_run && (aop->type == AOP_STK || aop->type == AOP_EXSTK) && !sp_offset) + { + emit2 ("inc sp"); + emit2 ("inc sp"); + emit2 ("push %s", _pairs[id].name); + regalloc_dry_run_cost += (id == PAIR_IY ? 5 : 4); + } /* PENDING: Verify this. */ else if (id == PAIR_HL && requiresHL (aop) && (IS_GB || IY_RESERVED)) { - if(!regalloc_dry_run) + if (bitVectBitValue (ic->rSurv, D_IDX)) + _push (PAIR_DE); + if (!regalloc_dry_run) { emit2 ("ld a,l"); emit2 ("ld d,h"); aopPut (aop, "a", 0); aopPut (aop, "d", 1); } - regalloc_dry_run_cost += (2 + ld_cost(aop, ASMOP_A) + ld_cost(aop, ASMOP_D)); + regalloc_dry_run_cost += (2 + ld_cost (aop, ASMOP_A) + ld_cost (aop, ASMOP_D)); + if (bitVectBitValue (ic->rSurv, D_IDX)) + _pop (PAIR_DE); } else { /* Special cases */ if (id == PAIR_HL && aop->type == AOP_IY && aop->size == 2) { - if(!regalloc_dry_run) + if (!regalloc_dry_run) { emit2 ("ld (%s),%s", aopGetLitWordLong (aop, 0, FALSE), _pairs[id].name); } @@ -2848,13 +2878,13 @@ cheapMove (aop, 1, ASMOP_D, 0); break; case PAIR_HL: - if (aop->type == AOP_REG && aop->aopu.aop_reg[0]->rIdx == H_IDX && aop->aopu.aop_reg[1]->rIdx == L_IDX) + if (aop->type == AOP_REG && aop->aopu.aop_reg[0]->rIdx == H_IDX && aop->aopu.aop_reg[1]->rIdx == L_IDX) { cheapMove (ASMOP_A, 0, ASMOP_L, 0); cheapMove (aop, 1, ASMOP_H, 0); cheapMove (aop, 0, ASMOP_A, 0); } - else if (aop->type == AOP_REG && aop->aopu.aop_reg[0]->rIdx == H_IDX) // Do not overwrite upper byte. + else if (aop->type == AOP_REG && aop->aopu.aop_reg[0]->rIdx == H_IDX) // Do not overwrite upper byte. { cheapMove (aop, 1, ASMOP_H, 0); cheapMove (aop, 0, ASMOP_L, 0); @@ -2892,8 +2922,7 @@ /* movLeft2Result - move byte from left to result */ /*-----------------------------------------------------------------*/ static void -movLeft2Result (operand * left, int offl, - operand * result, int offr, int sign) +movLeft2Result (operand * left, int offl, operand * result, int offr, int sign) { if (!sameRegs (AOP (left), AOP (result)) || (offl != offr)) { @@ -2911,9 +2940,7 @@ } static void -movLeft2ResultLong (operand * left, int offl, - operand * result, int offr, int sign, - int size) +movLeft2ResultLong (operand * left, int offl, operand * result, int offr, int sign, int size) { if (size == 1) movLeft2Result (left, offl, result, offr, sign); @@ -2922,20 +2949,20 @@ wassertl (offl == 0 && offr == 0, "Only implemented for zero offset"); wassertl (size == 2, "Only implemented for two bytes or one"); - if ( IS_GB && requiresHL ( AOP (left)) && getPairId ( AOP (result)) == PAIR_HL) + if (IS_GB && requiresHL (AOP (left)) && getPairId (AOP (result)) == PAIR_HL) { - emit2 ("ld a,%s", aopGet (AOP (left), LSB, FALSE)); - emit2 ("ld h,%s", aopGet (AOP (left), MSB16, FALSE)); - emit2 ("ld l,a"); + cheapMove (ASMOP_A, 0, AOP (left), LSB); + cheapMove (ASMOP_H, 0, AOP (left), MSB16); + cheapMove (ASMOP_L, 0, ASMOP_A, 0); spillPair (PAIR_HL); } - else if ( getPairId ( AOP (result)) == PAIR_IY) + else if (getPairId (AOP (result)) == PAIR_IY) { PAIR_ID id = getPairId (AOP (left)); if (id != PAIR_INVALID) { - emit2("push %s", _pairs[id].name); - emit2("pop iy"); + emit2 ("push %s", _pairs[id].name); + emit2 ("pop iy"); regalloc_dry_run_cost += 3; } else @@ -2946,7 +2973,7 @@ else { movLeft2Result (left, offl, result, offr, sign); - movLeft2Result (left, offl+1, result, offr+1, sign); + movLeft2Result (left, offl + 1, result, offr + 1, sign); } } } @@ -2978,7 +3005,7 @@ if (AOP_TYPE (result) == AOP_CRY) { if (!IS_OP_RUONLY (result) && !regalloc_dry_run) - aopPut (AOP (result), "c", 0); // Todo: Cost. + aopPut (AOP (result), "c", 0); // Todo: Cost. } else { @@ -2993,7 +3020,7 @@ /* toBoolean - emit code for or a,operator(sizeop) */ /*-----------------------------------------------------------------*/ static void -_toBoolean (const operand *oper, bool needflag) +_toBoolean (const operand * oper, bool needflag) { int size = AOP_SIZE (oper); sym_link *type = operandType (oper); @@ -3004,7 +3031,7 @@ { if (IS_FLOAT (type)) { - emit2 ("res 7, a"); //clear sign bit + emit2 ("res 7, a"); //clear sign bit regalloc_dry_run_cost += 2; while (--size) emit3_o (A_OR, ASMOP_A, 0, AOP (oper), offset--); @@ -3025,12 +3052,12 @@ /* castBoolean - emit code for casting operand to boolean in a */ /*-----------------------------------------------------------------*/ static void -_castBoolean (const operand *right) +_castBoolean (const operand * right) { emitDebug ("; Casting to bool"); /* Can do without OR-ing for small arguments */ - if (AOP_SIZE (right)== 1 && AOP_TYPE (right) != AOP_ACC) + if (AOP_SIZE (right) == 1 && AOP_TYPE (right) != AOP_ACC) { emit3 (A_XOR, ASMOP_A, ASMOP_A); emit3 (A_CP, ASMOP_A, AOP (right)); @@ -3047,47 +3074,50 @@ } /* Shuffle src reg array into dst reg array. */ -static void regMove(short *dst, short *src, size_t n) +static void +regMove (const short *dst, const short *src, size_t n) { - bool assigned[8] = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}; + bool assigned[8] = { FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }; int cached_byte = -1; size_t size = n; - + wassert (n < 6); // We need to be able to handle any assignment here, ensuring not to overwrite any parts of the source that we still need. - while (size--) + while (size) { size_t i; - + // Find lowest byte that can be assigned and needs to be assigned. for (i = 0; i < n; i++) { size_t j; - + if (assigned[i]) continue; - + for (j = 0; j < n; j++) { if (!assigned[j] && i != j && dst[i] == src[j]) goto skip_byte; // We can't write this one without overwriting the source. } - - break; // Found byte that can be written safely. - - skip_byte:; + + break; // Found byte that can be written safely. + +skip_byte: + ; } if (i < n) { - cheapMove (asmopregs[dst[i]], 0, asmopregs[src[i]], 0); // We can safely assign a byte. + cheapMove (asmopregs[dst[i]], 0, asmopregs[src[i]], 0); // We can safely assign a byte. + size--; assigned[i] = TRUE; continue; } - + // No byte can be assigned safely (i.e. the assignment is a permutation). Cache one in the accumulator. - + if (cached_byte != -1) { // Already one cached. Can happen when the assignment is a permutation consisting of multiple cycles. @@ -3095,16 +3125,18 @@ cached_byte = -1; continue; } - + for (i = 0; i < n; i++) if (!assigned[i]) break; - wassertl (i != n, "regMove error: Trying to cache non-existant byte in accumulator."); + + wassertl (i != n, "regMove error: Trying to cache non-existant byte in accumulator."); cheapMove (ASMOP_A, 0, asmopregs[src[i]], 0); + size--; assigned[i] = TRUE; cached_byte = i; } - + if (cached_byte != -1) cheapMove (asmopregs[dst[cached_byte]], 0, ASMOP_A, 0); } @@ -3115,8 +3147,8 @@ static void genNot (const iCode * ic) { - operand *left = IC_LEFT(ic); - operand *result = IC_RESULT(ic); + operand *left = IC_LEFT (ic); + operand *result = IC_RESULT (ic); /* assign asmOps to operand & result */ aopOp (left, ic, FALSE, TRUE); @@ -3130,7 +3162,7 @@ else if (IS_BOOL (operandType (left))) { cheapMove (ASMOP_A, 0, AOP (left), 0); - emit2 ("xor a,#0x01"); + emit2 ("xor a, !immedbyte", 0x01); regalloc_dry_run_cost += 2; cheapMove (AOP (result), 0, ASMOP_A, 0); goto release; @@ -3149,14 +3181,14 @@ release: /* release the aops */ freeAsmop (left, NULL, ic); - freeAsmop (result, NULL, ic); + freeAsmop (result, NULL, ic); } /*-----------------------------------------------------------------*/ /* genCpl - generate code for complement */ /*-----------------------------------------------------------------*/ static void -genCpl (const iCode *ic) +genCpl (const iCode * ic) { int offset = 0; int size; @@ -3168,8 +3200,7 @@ /* if both are in bit space then a special case */ - if (AOP_TYPE (IC_RESULT (ic)) == AOP_CRY && - AOP_TYPE (IC_LEFT (ic)) == AOP_CRY) + if (AOP_TYPE (IC_RESULT (ic)) == AOP_CRY && AOP_TYPE (IC_LEFT (ic)) == AOP_CRY) { wassertl (0, "Left and the result are in bit space"); } @@ -3188,58 +3219,62 @@ } static void -_gbz80_emitAddSubLongLong (const iCode *ic, asmop *left, asmop *right, bool isAdd) +_gbz80_emitAddSubLongLong (const iCode * ic, asmop * left, asmop * right, bool isAdd) { - const char *first = isAdd ? "add" : "sub"; - const char *later = isAdd ? "adc" : "sbc"; - + enum asminst first = isAdd ? A_ADD : A_SUB; + enum asminst later = isAdd ? A_ADC : A_SBC; - wassert (!regalloc_dry_run); /* Logic: - ld de,right.lw - setup hl to left - de = hl - de - push flags - store de into result - pop flags - ld de,right.hw - setup hl - de = hl -de - store de into result - */ + ld de,right.lw + setup hl to left + de = hl - de + push flags + store de into result + pop flags + ld de,right.hw + setup hl + de = hl -de + store de into result + */ wassertl (IS_GB, "Code is only relevant to the gbz80"); - wassertl (AOP( IC_RESULT (ic))->size == 4, "Only works for four bytes"); + wassertl (AOP (IC_RESULT (ic))->size == 4, "Only works for four bytes"); fetchPair (PAIR_DE, left); emit2 ("ld a,e"); - emit2 ("%s a,%s", first, aopGet( right, LSB, FALSE)); + regalloc_dry_run_cost += 1; + emit3_o (first, ASMOP_A, 0, right, LSB); emit2 ("ld e,a"); emit2 ("ld a,d"); - emit2 ("%s a,%s", later, aopGet( right, MSB16, FALSE)); + regalloc_dry_run_cost += 2; + emit3_o (later, ASMOP_A, 0, right, MSB16); _push (PAIR_AF); - aopPut ( AOP (IC_RESULT (ic)), "a", MSB16); - aopPut ( AOP (IC_RESULT (ic)), "e", LSB); + + cheapMove (AOP (IC_RESULT (ic)), MSB16, ASMOP_A, 0); + cheapMove (AOP (IC_RESULT (ic)), LSB, ASMOP_E, 0); fetchPairLong (PAIR_DE, left, NULL, MSB24); - aopGet (right, MSB24, FALSE); + + if (!regalloc_dry_run) + aopGet (right, MSB24, FALSE); _pop (PAIR_AF); emit2 ("ld a,e"); - emit2 ("%s a,%s", later, aopGet( right, MSB24, FALSE)); + emit3_o (later, ASMOP_A, 0, right, MSB24); emit2 ("ld e,a"); emit2 ("ld a,d"); - emit2 ("%s a,%s", later, aopGet( right, MSB32, FALSE)); + regalloc_dry_run_cost += 2; + emit3_o (later, ASMOP_A, 0, right, MSB32); - aopPut ( AOP (IC_RESULT (ic)), "a", MSB32); - aopPut ( AOP (IC_RESULT (ic)), "e", MSB24); + cheapMove (AOP (IC_RESULT (ic)), MSB32, ASMOP_A, 0); + cheapMove (AOP (IC_RESULT (ic)), MSB24, ASMOP_E, 0); } static void -_gbz80_emitAddSubLong (const iCode *ic, bool isAdd) +_gbz80_emitAddSubLong (const iCode * ic, bool isAdd) { _gbz80_emitAddSubLongLong (ic, AOP (IC_LEFT (ic)), AOP (IC_RIGHT (ic)), isAdd); } @@ -3252,7 +3287,7 @@ { int size, offset = 0; - emitDebug("; genUminusFloat"); + emitDebug ("; genUminusFloat"); /* for this we just need to flip the first bit then copy the rest in place */ @@ -3269,7 +3304,7 @@ while (size--) { - cheapMove (AOP (result), offset,AOP (op), offset); + cheapMove (AOP (result), offset, AOP (op), offset); offset++; } } @@ -3278,7 +3313,7 @@ /* genUminus - unary minus code generation */ /*-----------------------------------------------------------------*/ static void -genUminus (const iCode *ic) +genUminus (const iCode * ic) { int offset, size; sym_link *optype; @@ -3289,8 +3324,7 @@ /* if both in bit space then special case */ - if (AOP_TYPE (IC_RESULT (ic)) == AOP_CRY && - AOP_TYPE (IC_LEFT (ic)) == AOP_CRY) + if (AOP_TYPE (IC_RESULT (ic)) == AOP_CRY && AOP_TYPE (IC_LEFT (ic)) == AOP_CRY) { wassertl (0, "Left and right are in bit space"); goto release; @@ -3320,14 +3354,32 @@ offset = 0; - _clearCarry(); - while (size--) + if (size == 2 && IS_GB && requiresHL (AOP (IC_RESULT (ic)))) { + cheapMove (ASMOP_E, 0, AOP (IC_LEFT (ic)), 0); + cheapMove (ASMOP_D, 0, AOP (IC_LEFT (ic)), 1); + emit3 (A_XOR, ASMOP_A, ASMOP_A); + emit3 (A_SUB, ASMOP_A, ASMOP_E); + emit3 (A_LD, ASMOP_E, ASMOP_A); emit3 (A_LD, ASMOP_A, ASMOP_ZERO); - emit3_o (A_SBC, ASMOP_A, 0, AOP (IC_LEFT (ic)), offset); - cheapMove (AOP (IC_RESULT (ic)), offset++, ASMOP_A, 0); + emit3 (A_SBC, ASMOP_A, ASMOP_D); + cheapMove (AOP (IC_RESULT (ic)), 1, ASMOP_A, 0); + cheapMove (AOP (IC_RESULT (ic)), 0, ASMOP_E, 0); + offset = 2; + goto remaining; } + emit3 (A_XOR, ASMOP_A, ASMOP_A); /* Clear accumulator - for first byte. */ + while (size--) + { + emit3_o (offset ? A_SBC : A_SUB, ASMOP_A, 0, AOP (IC_LEFT (ic)), offset); + _G.preserveCarry = (size ? 1 : 0); + cheapMove (AOP (IC_RESULT (ic)), offset++, ASMOP_A, 0); /* Uses add iy, sp for AOP_EXSTK when omitting frame pointer, potentially destroying carry flag. */ + if (size) + emit3 (A_LD, ASMOP_A, ASMOP_ZERO); /* Clear accumulator, but not carry - for subsequent bytes. */ + } + +remaining: /* if any remaining bytes in the result */ /* we just need to propagate the sign */ if ((size = (AOP_SIZE (IC_RESULT (ic)) - AOP_SIZE (IC_LEFT (ic))))) @@ -3358,11 +3410,11 @@ { /* We do it the hard way here. */ _push (PAIR_HL); - aopPut (AOP (oper), _fReturn[0], 0); - aopPut (AOP (oper), _fReturn[1], 1); + cheapMove (AOP (oper), 0, _fReturn3[0], 0); + cheapMove (AOP (oper), 1, _fReturn3[1], 0); _pop (PAIR_DE); - aopPut (AOP (oper), _fReturn[0], 2); - aopPut (AOP (oper), _fReturn[1], 3); + cheapMove (AOP (oper), 2, _fReturn3[0], 0); + cheapMove (AOP (oper), 3, _fReturn3[1], 0); } else { @@ -3370,14 +3422,14 @@ { int i; short retarray[4], oparray[4]; - - for(i = 0; i < size; i++) - { - retarray[i] = _fReturn3[i]->aopu.aop_reg[0]->rIdx; - oparray[i] = AOP (oper)->aopu.aop_reg[i]->rIdx; - } - - regMove(oparray, retarray, size); + + for (i = 0; i < size; i++) + { + retarray[i] = _fReturn3[i]->aopu.aop_reg[0]->rIdx; + oparray[i] = AOP (oper)->aopu.aop_reg[i]->rIdx; + } + + regMove (oparray, retarray, size); } else while (size--) @@ -3389,100 +3441,119 @@ return. */ static void -_restoreRegsAfterCall(void) +_restoreRegsAfterCall (void) { + if (_G.stack.pushedIY) + { + _pop (PAIR_IY); + _G.stack.pushedIY = FALSE; + } if (_G.stack.pushedDE) { - _pop ( PAIR_DE); + _pop (PAIR_DE); _G.stack.pushedDE = FALSE; } if (_G.stack.pushedBC) { - _pop ( PAIR_BC); + _pop (PAIR_BC); _G.stack.pushedBC = FALSE; } - if (_G.stack.pushedIY) + if (_G.stack.pushedHL) { - _pop ( PAIR_IY); - _G.stack.pushedIY = FALSE; + _pop (PAIR_HL); + _G.stack.pushedHL = FALSE; } + _G.saves.saved = FALSE; } static void -_saveRegsForCall(const iCode *ic, int sendSetSize, bool dontsaveIY) +_saveRegsForCall (const iCode * ic, int sendSetSize, bool dontsaveIY) { /* Rules: - o Stack parameters are pushed before this function enters - o DE and BC may be used in this function. - o HL and DE may be used to return the result. - o HL and DE may be used to send variables. - o DE and BC may be used to store the result value. - o HL may be used in computing the sent value of DE - o The iPushes for other parameters occur before any addSets + o Stack parameters are pushed before this function enters + o DE and BC may be used in this function. + o HL and DE may be used to return the result. + o HL and DE may be used to send variables. + o DE and BC may be used to store the result value. + o HL may be used in computing the sent value of DE + o The iPushes for other parameters occur before any addSets Logic: (to be run inside the first iPush or if none, before sending) - o Compute if DE and/or BC are in use over the call - o Compute if DE is used in the send set - o Compute if DE and/or BC are used to hold the result value - o If (DE is used, or in the send set) and is not used in the result, push. - o If BC is used and is not in the result, push - o - o If DE is used in the send set, fetch - o If HL is used in the send set, fetch - o Call - o ... - */ - - if (_G.saves.saved == FALSE) { - bool push_bc, push_de, push_iy; - - if(z80_opts.oldralloc) - { - bool deInUse, bcInUse; - bool deSending; - bool bcInRet = FALSE, deInRet = FALSE; - bitVect *rInUse; + o Compute if DE, BC, HL, IY are in use over the call + o Compute if DE is used in the send set + o Compute if DE and/or BC are used to hold the result value + o If (DE is used, or in the send set) and is not used in the result, push. + o If BC is used and is not in the result, push + o + o If DE is used in the send set, fetch + o If HL is used in the send set, fetch + o Call + o ... + */ - rInUse = bitVectCplAnd (bitVectCopy (ic->rMask), z80_rUmaskForOp (IC_RESULT(ic))); + if (_G.saves.saved == FALSE) + { + bool push_bc, push_de, push_hl, push_iy; - deInUse = bitVectBitValue (rInUse, D_IDX) || bitVectBitValue(rInUse, E_IDX); - bcInUse = bitVectBitValue (rInUse, B_IDX) || bitVectBitValue(rInUse, C_IDX); + if (options.oldralloc) + { + bool deInUse, bcInUse; + bool deSending; + bool bcInRet = FALSE, deInRet = FALSE; + bitVect *rInUse; - deSending = (sendSetSize > 1); + rInUse = bitVectCplAnd (bitVectCopy (ic->rMask), z80_rUmaskForOp (IC_RESULT (ic))); - emitDebug ("; _saveRegsForCall: sendSetSize: %u deInUse: %u bcInUse: %u deSending: %u", sendSetSize, deInUse, bcInUse, deSending); + deInUse = bitVectBitValue (rInUse, D_IDX) || bitVectBitValue (rInUse, E_IDX); + bcInUse = bitVectBitValue (rInUse, B_IDX) || bitVectBitValue (rInUse, C_IDX); - push_bc = bcInUse && !bcInRet; - push_de = deInUse && !deInRet; - push_iy = FALSE; - } - else - { - push_bc = bitVectBitValue (ic->rSurv, B_IDX) || bitVectBitValue (ic->rSurv, C_IDX); - push_de = bitVectBitValue (ic->rSurv, D_IDX) || bitVectBitValue (ic->rSurv, E_IDX); - push_iy = !dontsaveIY && (bitVectBitValue (ic->rSurv, IYH_IDX) || bitVectBitValue (ic->rSurv, IYL_IDX)); - } + deSending = (sendSetSize > 1); - if (push_bc) { - _push(PAIR_BC); - _G.stack.pushedBC = TRUE; - } - if (push_de) { - _push(PAIR_DE); - _G.stack.pushedDE = TRUE; + emitDebug ("; _saveRegsForCall: sendSetSize: %u deInUse: %u bcInUse: %u deSending: %u", sendSetSize, deInUse, bcInUse, + deSending); + + push_bc = bcInUse && !bcInRet; + push_de = deInUse && !deInRet; + push_hl = FALSE; + push_iy = FALSE; + } + else + { + push_bc = bitVectBitValue (ic->rSurv, B_IDX) || bitVectBitValue (ic->rSurv, C_IDX); + push_de = bitVectBitValue (ic->rSurv, D_IDX) || bitVectBitValue (ic->rSurv, E_IDX); + push_hl = bitVectBitValue (ic->rSurv, H_IDX) || bitVectBitValue (ic->rSurv, L_IDX); + push_iy = !dontsaveIY && (bitVectBitValue (ic->rSurv, IYH_IDX) || bitVectBitValue (ic->rSurv, IYL_IDX)); + } + + if (push_hl) + { + _push (PAIR_HL); + _G.stack.pushedHL = TRUE; + } + if (push_bc) + { + _push (PAIR_BC); + _G.stack.pushedBC = TRUE; + } + if (push_de) + { + _push (PAIR_DE); + _G.stack.pushedDE = TRUE; + } + if (push_iy) + { + _push (PAIR_IY); + _G.stack.pushedIY = TRUE; + } + + if (!regalloc_dry_run) + _G.saves.saved = TRUE; } - if (push_iy) { - _push(PAIR_IY); - _G.stack.pushedIY = TRUE; + else + { + /* Already saved. */ } - - if(!regalloc_dry_run) - _G.saves.saved = TRUE; - } - else { - /* Already saved. */ - } } /*-----------------------------------------------------------------*/ @@ -3497,34 +3568,39 @@ and spill push is always done on the local stack */ if (!ic->parmPush) { - wassertl(0, "Encountered an unsupported spill push."); + wassertl (0, "Encountered an unsupported spill push."); return; } - if (_G.saves.saved == FALSE && !regalloc_dry_run /* Cost is counted at CALL or PCALL instead */) { - /* Caller saves, and this is the first iPush. */ - /* Scan ahead until we find the function that we are pushing parameters to. - Count the number of addSets on the way to figure out what registers - are used in the send set. - */ - int nAddSets = 0; - iCode *walk = ic->next; - - while (walk) { - if (walk->op == SEND) { - nAddSets++; - } - else if (walk->op == CALL || walk->op == PCALL) { - /* Found it. */ - break; - } - else { - /* Keep looking. */ - } - walk = walk->next; + if (_G.saves.saved == FALSE && !regalloc_dry_run /* Cost is counted at CALL or PCALL instead */ ) + { + /* Caller saves, and this is the first iPush. */ + /* Scan ahead until we find the function that we are pushing parameters to. + Count the number of addSets on the way to figure out what registers + are used in the send set. + */ + int nAddSets = 0; + iCode *walk = ic->next; + + while (walk) + { + if (walk->op == SEND) + { + nAddSets++; + } + else if (walk->op == CALL || walk->op == PCALL) + { + /* Found it. */ + break; + } + else + { + /* Keep looking. */ + } + walk = walk->next; + } + _saveRegsForCall (walk, nAddSets, FALSE); } - _saveRegsForCall(walk, nAddSets, FALSE); - } /* then do the push */ aopOp (IC_LEFT (ic), ic, FALSE, FALSE); @@ -3533,10 +3609,10 @@ if (isPair (AOP (IC_LEFT (ic))) && size == 2) { - if(!regalloc_dry_run) + if (!regalloc_dry_run) { - _G.stack.pushed += 2; - emit2 ("push %s", getPairName (AOP (IC_LEFT (ic)))); + _G.stack.pushed += 2; + emit2 ("push %s", getPairName (AOP (IC_LEFT (ic)))); } regalloc_dry_run_cost += (getPairId (AOP (IC_LEFT (ic))) == PAIR_IY ? 2 : 1); } @@ -3544,10 +3620,14 @@ { if (size == 2) { - fetchHL (AOP (IC_LEFT (ic))); - if(!regalloc_dry_run) + PAIR_ID pair = getDeadPairId (ic); + if (pair == PAIR_INVALID || isPairDead (PAIR_HL, ic)) + pair = PAIR_HL; /* hl sometimes is cheaper to load than other pairs. */ + + fetchPairLong (pair, AOP (IC_LEFT (ic)), ic, 0); + if (!regalloc_dry_run) { - emit2 ("push hl"); + emit2 ("push %s", _pairs[pair].name); _G.stack.pushed += 2; } regalloc_dry_run_cost += 1; @@ -3555,44 +3635,48 @@ } if (size == 4) { - if (AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP (IC_LEFT (ic))->aopu.aop_reg[2]->rIdx == C_IDX && AOP (IC_LEFT (ic))->aopu.aop_reg[3]->rIdx == B_IDX) + if (AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP (IC_LEFT (ic))->aopu.aop_reg[2]->rIdx == C_IDX + && AOP (IC_LEFT (ic))->aopu.aop_reg[3]->rIdx == B_IDX) { emit2 ("push bc"); regalloc_dry_run_cost += 1; } - else if (AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP (IC_LEFT (ic))->aopu.aop_reg[2]->rIdx == E_IDX && AOP (IC_LEFT (ic))->aopu.aop_reg[3]->rIdx == D_IDX) + else if (AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP (IC_LEFT (ic))->aopu.aop_reg[2]->rIdx == E_IDX + && AOP (IC_LEFT (ic))->aopu.aop_reg[3]->rIdx == D_IDX) { emit2 ("push de"); regalloc_dry_run_cost += 1; } else { - fetchPairLong (PAIR_HL, AOP (IC_LEFT (ic)), ic, 2); + fetchPairLong (PAIR_HL, AOP (IC_LEFT (ic)), 0, 2); emit2 ("push hl"); regalloc_dry_run_cost += 1; } if (!regalloc_dry_run) _G.stack.pushed += 2; - - if (AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == C_IDX && AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx == B_IDX) + + if (AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == C_IDX + && AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx == B_IDX) { emit2 ("push bc"); regalloc_dry_run_cost += 1; } - else if (AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == E_IDX && AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx == D_IDX) + else if (AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == E_IDX + && AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx == D_IDX) { emit2 ("push de"); regalloc_dry_run_cost += 1; } else { - fetchPairLong (PAIR_HL, AOP (IC_LEFT (ic)), ic, 0); + fetchPairLong (PAIR_HL, AOP (IC_LEFT (ic)), 0, 0); emit2 ("push hl"); regalloc_dry_run_cost += 1; } if (!regalloc_dry_run) _G.stack.pushed += 2; - + goto release; } offset = size; @@ -3619,14 +3703,14 @@ } else { - if (!regalloc_dry_run && !strcmp(aopGet (AOP (IC_LEFT (ic)), offset, FALSE), "h")) // todo: More exact cost! + if (!regalloc_dry_run && !strcmp (aopGet (AOP (IC_LEFT (ic)), offset, FALSE), "h")) // todo: More exact cost! emit2 ("push hl"); else { cheapMove (ASMOP_A, 0, AOP (IC_LEFT (ic)), offset); emit2 ("push af"); } - regalloc_dry_run_cost += (ld_cost(ASMOP_A, AOP (IC_LEFT (ic))) + 1); + regalloc_dry_run_cost += (ld_cost (ASMOP_A, AOP (IC_LEFT (ic))) + 1); } } if (!regalloc_dry_run) @@ -3681,7 +3765,7 @@ setArea (int inHome) { /* - static int lastArea = 0; + static int lastArea = 0; if (_G.in_home != inHome) { if (inHome) { @@ -3750,11 +3834,12 @@ /** Emit the code for a call statement */ static void -emitCall (const iCode *ic, bool ispcall) +emitCall (const iCode * ic, bool ispcall) { - bool bInRet, cInRet, dInRet, eInRet; + bool bInRet, cInRet, dInRet, eInRet, hInRet, lInRet, SomethingReturned, bigreturn; sym_link *dtype = operandType (IC_LEFT (ic)); - sym_link *etype = getSpec(dtype); + sym_link *etype = getSpec (dtype); + sym_link *ftype = IS_FUNCPTR (dtype) ? dtype->next : dtype; /* if caller saves & we have not saved then */ if (!ic->regsSaved) @@ -3762,41 +3847,43 @@ /* PENDING */ } - _saveRegsForCall(ic, _G.sendSet ? elementsInSet(_G.sendSet) : 0, FALSE); + _saveRegsForCall (ic, _G.sendSet ? elementsInSet (_G.sendSet) : 0, FALSE); /* if send set is not empty then assign */ if (_G.sendSet) { iCode *sic; int send = 0; - int nSend = elementsInSet(_G.sendSet); + int nSend = elementsInSet (_G.sendSet); bool swapped = FALSE; - int _z80_sendOrder[] = { + int _z80_sendOrder[] = + { PAIR_BC, PAIR_DE }; - if (nSend > 1) { - /* Check if the parameters are swapped. If so route through hl instead. */ - wassertl (nSend == 2, "Pedantic check. Code only checks for the two send items case."); - - sic = setFirstItem(_G.sendSet); - sic = setNextItem(_G.sendSet); - - if (_opUsesPair (IC_LEFT(sic), sic, _z80_sendOrder[0])) { - /* The second send value is loaded from one the one that holds the first - send, i.e. it is overwritten. */ - /* Cache the first in HL, and load the second from HL instead. */ - emit2 ("ld h,%s", _pairs[_z80_sendOrder[0]].h); - emit2 ("ld l,%s", _pairs[_z80_sendOrder[0]].l); - regalloc_dry_run_cost += 2; + if (nSend > 1) + { + /* Check if the parameters are swapped. If so route through hl instead. */ + wassertl (nSend == 2, "Pedantic check. Code only checks for the two send items case."); + + sic = setFirstItem (_G.sendSet); + sic = setNextItem (_G.sendSet); - swapped = TRUE; + if (_opUsesPair (IC_LEFT (sic), sic, _z80_sendOrder[0])) + { + /* The second send value is loaded from one the one that holds the first + send, i.e. it is overwritten. */ + /* Cache the first in HL, and load the second from HL instead. */ + emit2 ("ld h,%s", _pairs[_z80_sendOrder[0]].h); + emit2 ("ld l,%s", _pairs[_z80_sendOrder[0]].l); + regalloc_dry_run_cost += 2; + + swapped = TRUE; + } } - } - for (sic = setFirstItem (_G.sendSet); sic; - sic = setNextItem (_G.sendSet)) + for (sic = setFirstItem (_G.sendSet); sic; sic = setNextItem (_G.sendSet)) { int size; aopOp (IC_LEFT (sic), sic, FALSE, FALSE); @@ -3806,21 +3893,25 @@ wassertl (_z80_sendOrder[send] != PAIR_INVALID, "Tried to send more parameters than we have registers for"); // PENDING: Mild hack - if (swapped == TRUE && send == 1) { - if (size > 1) { - emit2 ("ld %s,h", _pairs[_z80_sendOrder[send]].h); + if (swapped == TRUE && send == 1) + { + if (size > 1) + { + emit2 ("ld %s,h", _pairs[_z80_sendOrder[send]].h); + regalloc_dry_run_cost += 1; + } + else + { + emit2 ("ld %s,!zero", _pairs[_z80_sendOrder[send]].h); + regalloc_dry_run_cost += 2; + } + emit2 ("ld %s,l", _pairs[_z80_sendOrder[send]].l); regalloc_dry_run_cost += 1; } - else { - emit2 ("ld %s,!zero", _pairs[_z80_sendOrder[send]].h); - regalloc_dry_run_cost += 2; + else + { + fetchPair (_z80_sendOrder[send], AOP (IC_LEFT (sic))); } - emit2 ("ld %s,l", _pairs[_z80_sendOrder[send]].l); - regalloc_dry_run_cost += 1; - } - else { - fetchPair(_z80_sendOrder[send], AOP (IC_LEFT (sic))); - } send++; freeAsmop (IC_LEFT (sic), NULL, sic); @@ -3828,6 +3919,41 @@ _G.sendSet = NULL; } + /* Return value of big type or returning struct or union. */ + bigreturn = (getSize (ftype->next) > 4); + if (bigreturn) + { + PAIR_ID pair; + int fp_offset, sp_offset; + + if (ispcall && IS_GB) + _push (PAIR_HL); + aopOp (IC_RESULT (ic), ic, FALSE, FALSE); + wassertl (IC_RESULT (ic), "Unused return value in call to function returning large type."); + wassert (AOP_TYPE (IC_RESULT (ic)) == AOP_STK || AOP_TYPE (IC_RESULT (ic)) == AOP_EXSTK); + fp_offset = + AOP (IC_RESULT (ic))->aopu.aop_stk + _G.stack.offset + (AOP (IC_RESULT (ic))->aopu.aop_stk > + 0 ? _G.stack.param_offset : 0); + sp_offset = fp_offset + _G.stack.pushed; + pair = (ispcall && !IS_GB) ? PAIR_IY : PAIR_HL; + emit2 ("ld %s,!immedword", _pairs[pair].name, sp_offset); + emit2 ("add %s, sp", _pairs[pair].name); + regalloc_dry_run_cost += (pair == PAIR_IY ? 6 : 4); + if (ispcall && IS_GB) + { + emit2 ("ld e, l"); + emit2 ("ld d, h"); + regalloc_dry_run_cost += 2; + _pop (PAIR_HL); + pair = PAIR_DE; + } + emit2 ("push %s", _pairs[pair].name); + regalloc_dry_run_cost += (pair == PAIR_IY ? 2 : 1); + if (!regalloc_dry_run) + _G.stack.pushed += 2; + freeAsmop (IC_RESULT (ic), NULL, ic); + } + if (ispcall) { if (IFFUNC_ISBANKEDCALL (dtype)) @@ -3844,7 +3970,7 @@ else { spillPair (PAIR_HL); - fetchHL (AOP (IC_LEFT (ic))); + fetchPairLong (PAIR_HL, AOP (IC_LEFT (ic)), ic, 0); emit2 ("call __sdcc_call_hl"); } freeAsmop (IC_LEFT (ic), NULL, ic); @@ -3854,9 +3980,7 @@ /* make the call */ if (IFFUNC_ISBANKEDCALL (dtype)) { - char *name = OP_SYMBOL (IC_LEFT (ic))->rname[0] ? - OP_SYMBOL (IC_LEFT (ic))->rname : - OP_SYMBOL (IC_LEFT (ic))->name; + char *name = OP_SYMBOL (IC_LEFT (ic))->rname[0] ? OP_SYMBOL (IC_LEFT (ic))->rname : OP_SYMBOL (IC_LEFT (ic))->name; emit2 ("call banked_call"); emit2 ("!dws", name); emit2 ("!dw !bankimmeds", name); @@ -3872,32 +3996,74 @@ else { emit2 ("call %s", (OP_SYMBOL (IC_LEFT (ic))->rname[0] ? - OP_SYMBOL (IC_LEFT (ic))->rname : - OP_SYMBOL (IC_LEFT (ic))->name)); + OP_SYMBOL (IC_LEFT (ic))->rname : OP_SYMBOL (IC_LEFT (ic))->name)); regalloc_dry_run_cost += 3; } } } - spillCached (); - - /* Mark the registers as restored. */ - _G.saves.saved = FALSE; + spillCached (); + + /* Mark the registers as restored. */ + _G.saves.saved = FALSE; + + SomethingReturned = (IS_ITEMP (IC_RESULT (ic)) && + (OP_SYMBOL (IC_RESULT (ic))->nRegs || + OP_SYMBOL (IC_RESULT (ic))->spildir || + OP_SYMBOL (IC_RESULT (ic))->accuse == ACCUSE_A)) || IS_TRUE_SYMOP (IC_RESULT (ic)); + + if (SomethingReturned) + { + bitVect *result = z80_rUmaskForOp (IC_RESULT (ic)); + bInRet = bitVectBitValue (result, B_IDX); + cInRet = bitVectBitValue (result, C_IDX); + dInRet = bitVectBitValue (result, D_IDX); + eInRet = bitVectBitValue (result, E_IDX); + hInRet = bitVectBitValue (result, H_IDX); + lInRet = bitVectBitValue (result, L_IDX); + freeBitVect (result); + } + else + { + bInRet = FALSE; + cInRet = FALSE; + dInRet = FALSE; + eInRet = FALSE; + hInRet = FALSE; + lInRet = FALSE; + } /* adjust the stack for parameters if required */ - if (ic->parmBytes) + if ((ic->parmBytes || bigreturn) && IFFUNC_ISNORETURN (OP_SYMBOL (IC_LEFT (ic))->type)) + { + /* This is just a workaround to not confuse the peephole optimizer too much. */ + /* Todo: Check fo _Noreturn in the peephole optimizer and do not emit the inc sp here. */ + emit2 ("inc sp"); + regalloc_dry_run_cost += 1; + if (!regalloc_dry_run) + _G.stack.pushed -= (ic->parmBytes + bigreturn * 2); + } + else if (ic->parmBytes || bigreturn) { - int i = ic->parmBytes; + int i = ic->parmBytes + bigreturn * 2; if (!regalloc_dry_run) _G.stack.pushed -= i; - if (IS_GB) + if (IS_GB && i > 2) { - emit2 ("!ldaspsp", i); + emit2 ("add sp, #%d", i); + regalloc_dry_run_cost += 3; } else { spillCached (); - if (IS_R2K ? i > 127 * 4 - 1 : i > 8) + if ((IS_RAB ? i > 127 * 4 - 1 : i > (optimize.codeSize ? 8 : 5)) && !SomethingReturned) + { + emit2 ("ld hl,!immedword", i); + emit2 ("add hl,sp"); + emit2 ("ld sp,hl"); + regalloc_dry_run_cost += 5; + } + else if (IS_RAB ? i > 127 * 4 - 1 : i > 8) { emit2 ("ld iy,!immedword", i); emit2 ("add iy,sp"); @@ -3909,7 +4075,7 @@ while (i > 1) { - if (IS_R2K && (!optimize.codeSize || i > 2)) + if (IS_RAB && (!optimize.codeSize || i > 2)) { int d = (i < 127 ? i : 127); emit2 ("add sp, #%d", d); @@ -3933,11 +4099,7 @@ } /* if we need assign a result value */ - if ((IS_ITEMP (IC_RESULT (ic)) && - (OP_SYMBOL (IC_RESULT (ic))->nRegs || - OP_SYMBOL (IC_RESULT (ic))->spildir || - OP_SYMBOL (IC_RESULT (ic))->accuse == ACCUSE_A)) || - IS_TRUE_SYMOP (IC_RESULT (ic))) + if (SomethingReturned && !bigreturn) { aopOp (IC_RESULT (ic), ic, FALSE, FALSE); @@ -3947,22 +4109,6 @@ } spillCached (); - - if (IC_RESULT (ic)) - { - bitVect *result = z80_rUmaskForOp (IC_RESULT (ic)); - bInRet = bitVectBitValue(result, B_IDX); - cInRet = bitVectBitValue(result, C_IDX); - dInRet = bitVectBitValue(result, D_IDX); - eInRet = bitVectBitValue(result, E_IDX); - } - else - { - bInRet = FALSE; - cInRet = FALSE; - dInRet = FALSE; - eInRet = FALSE; - } if (_G.stack.pushedIY) { @@ -4027,13 +4173,42 @@ } _G.stack.pushedBC = FALSE; } + + if (_G.stack.pushedHL) + { + if (hInRet && lInRet) + { + wassertl (0, "Shouldn't push HL if it's wiped out by the return"); + } + else if (hInRet) + { + /* Only restore E */ + emit2 ("ld a,h"); + regalloc_dry_run_cost += 1; + _pop (PAIR_HL); + emit2 ("ld h,a"); + regalloc_dry_run_cost += 1; + } + else if (lInRet) + { + /* Only restore D */ + _pop (PAIR_AF); + emit2 ("ld h,a"); + regalloc_dry_run_cost += 1; + } + else + { + _pop (PAIR_HL); + } + _G.stack.pushedHL = FALSE; + } } /*-----------------------------------------------------------------*/ /* genCall - generates a call statement */ /*-----------------------------------------------------------------*/ static void -genCall (const iCode *ic) +genCall (const iCode * ic) { emitCall (ic, FALSE); } @@ -4042,7 +4217,7 @@ /* genPcall - generates a call by pointer statement */ /*-----------------------------------------------------------------*/ static void -genPcall (const iCode *ic) +genPcall (const iCode * ic) { emitCall (ic, TRUE); } @@ -4051,7 +4226,7 @@ /* resultRemat - result is rematerializable */ /*-----------------------------------------------------------------*/ static int -resultRemat (const iCode *ic) +resultRemat (const iCode * ic) { if (SKIP_IC (ic) || ic->op == IFX) return 0; @@ -4079,12 +4254,14 @@ bool bcInUse = FALSE; bool deInUse = FALSE; + bool bigreturn; setArea (IFFUNC_NONBANKED (sym->type)); + wassert (!_G.stack.pushed); /* PENDING: Reset the receive offset as it doesn't seem to get reset anywhere else. - */ + */ _G.receiveOffset = 0; /* Record the last function name for debugging. */ @@ -4093,10 +4270,10 @@ /* Create the function header */ emit2 ("!functionheader", sym->name); - emitDebug(assignment_optimal ? "; Register assignment is optimal." : "; Register assignment might be sub-optimal."); - emitDebug("; Stack space usage: %d bytes.", sym->stack); + emitDebug (z80_assignment_optimal ? "; Register assignment is optimal." : "; Register assignment might be sub-optimal."); + emitDebug ("; Stack space usage: %d bytes.", sym->stack); - if (!IS_STATIC(sym->etype)) + if (!IS_STATIC (sym->etype)) { struct dbuf_s dbuf; @@ -4104,18 +4281,18 @@ dbuf_printf (&dbuf, "%s_start", sym->rname); emit2 ("!labeldef", dbuf_c_str (&dbuf)); dbuf_detach (&dbuf); - if(!regalloc_dry_run) - _G.lines.current->isLabel = 1; + if (!regalloc_dry_run) + genLine.lineCurr->isLabel = 1; } emit2 ("!functionlabeldef", sym->rname); - if(!regalloc_dry_run) - _G.lines.current->isLabel = 1; + if (!regalloc_dry_run) + genLine.lineCurr->isLabel = 1; ftype = operandType (IC_LEFT (ic)); - if (IFFUNC_ISNAKED(ftype)) + if (IFFUNC_ISNAKED (ftype)) { - emitDebug("; naked function: no prologue."); + emitDebug ("; naked function: no prologue."); return; } @@ -4123,12 +4300,12 @@ then save all potentially used registers. */ if (IFFUNC_ISISR (sym->type)) { - if (IS_R2K) + if (IS_RAB) emit2 ("push ip"); - + /* If critical function then turn interrupts off */ /* except when no interrupt number is given then it implies the NMI handler */ - if (IFFUNC_ISCRITICAL (sym->type) && (FUNC_INTNO(sym->type) != INTNO_UNSPEC)) + if (IFFUNC_ISCRITICAL (sym->type) && (FUNC_INTNO (sym->type) != INTNO_UNSPEC)) { emit2 ("!di"); } @@ -4141,7 +4318,7 @@ If critical function then turn interrupts off */ if (IFFUNC_ISCRITICAL (sym->type)) { - if (IS_GB || IS_R2K) + if (IS_GB || IS_RAB) { emit2 ("!di"); } @@ -4171,7 +4348,7 @@ } /* Detect which registers are used. */ - if (IFFUNC_CALLEESAVES(sym->type) && sym->regsUsed) + if (IFFUNC_CALLEESAVES (sym->type) && sym->regsUsed) { int i; for (i = 0; i < sym->regsUsed->size; i++) @@ -4186,12 +4363,14 @@ break; case D_IDX: case E_IDX: - if (!IS_GB) { - deInUse = TRUE; - } - else { - /* Other systems use DE as a temporary. */ - } + if (!IS_GB) + { + deInUse = TRUE; + } + else + { + /* Other systems use DE as a temporary. */ + } break; } } @@ -4217,9 +4396,11 @@ /* adjust the stack for the function */ // _G.stack.last = sym->stack; + bigreturn = (getSize (ftype->next) > 4); + _G.stack.param_offset += bigreturn * 2; + stackParm = FALSE; - for (sym = setFirstItem (istack->syms); sym; - sym = setNextItem (istack->syms)) + for (sym = setFirstItem (istack->syms); sym; sym = setNextItem (istack->syms)) { if (sym->_isparm && !IS_REGPARM (sym->etype)) { @@ -4229,7 +4410,7 @@ } sym = OP_SYMBOL (IC_LEFT (ic)); - _G.omitFramePtr = (!IS_GB && options.omitFramePtr); + _G.omitFramePtr = options.oldralloc ? (!IS_GB && options.omitFramePtr) : should_omit_frame_ptr; if (!IS_GB && !IY_RESERVED && !stackParm && !sym->stack) { @@ -4237,7 +4418,7 @@ /* the above !sym->stack condition can be removed. -- EEP */ if (sym->stack) emit2 ("!ldaspsp", -sym->stack); - if(!regalloc_dry_run) + if (!regalloc_dry_run) _G.omitFramePtr = TRUE; } else if (sym->stack && IS_GB && sym->stack > -INT8MIN) @@ -4246,14 +4427,14 @@ emit2 ("!enterx", sym->stack); else if (sym->stack) { - if ((optimize.codeSize && sym->stack <= 8) || sym->stack <= 4 || IS_R2K && sym->stack <= 254) + if ((optimize.codeSize && sym->stack <= 8) || sym->stack <= 4 || IS_RAB && sym->stack <= 254) { int stack = sym->stack; if (!_G.omitFramePtr) emit2 ("!enter"); while (stack > 1) { - if (IS_R2K && (!optimize.codeSize || stack > 2)) + if (IS_RAB && (!optimize.codeSize || stack > 2)) { int d = (stack < 127 ? -stack : -127); emit2 ("add sp, #%d", d); @@ -4265,7 +4446,7 @@ stack -= 2; } } - if(stack > 0) + if (stack > 0) emit2 ("dec sp"); } else @@ -4276,7 +4457,7 @@ emit2 ("!enterx", sym->stack); } } - else if(!_G.omitFramePtr) + else if (!_G.omitFramePtr) { if (!_G.omitFramePtr) emit2 ("!enter"); @@ -4294,11 +4475,12 @@ symbol *sym = OP_SYMBOL (IC_LEFT (ic)); wassert (!regalloc_dry_run); + wassert (!_G.stack.pushed); - if (IFFUNC_ISNAKED(sym->type)) + if (IFFUNC_ISNAKED (sym->type) || IFFUNC_ISNORETURN (sym->type)) { - emitDebug("; naked function: no epilogue."); - if (!IS_STATIC(sym->etype)) + emitDebug (IFFUNC_ISNAKED (sym->type) ? "; naked function: No epilogue." : "; _Noreturn function: No epilogue."); + if (!IS_STATIC (sym->etype)) { struct dbuf_s dbuf; @@ -4306,7 +4488,7 @@ dbuf_printf (&dbuf, "%s_end", sym->rname); emit2 ("!labeldef", dbuf_c_str (&dbuf)); dbuf_destroy (&dbuf); - _G.lines.current->isLabel = 1; + genLine.lineCurr->isLabel = 1; } return; } @@ -4355,7 +4537,7 @@ /* If critical function then turn interrupts back on */ /* except when no interrupt number is given then it implies the NMI handler */ - if (IFFUNC_ISCRITICAL (sym->type) && (FUNC_INTNO(sym->type) != INTNO_UNSPEC)) + if (IFFUNC_ISCRITICAL (sym->type) && (FUNC_INTNO (sym->type) != INTNO_UNSPEC)) { emit2 ("!ei"); } @@ -4367,9 +4549,9 @@ if (IFFUNC_ISCRITICAL (sym->type)) { if (IS_GB) - emit2 ("!ei"); - else if (IS_R2K) - emit2( "ipres" ); + emit2 ("!ei"); + else if (IS_RAB) + emit2 ("ipres"); else { symbol *tlbl = newiTempLabel (NULL); @@ -4377,10 +4559,10 @@ emit2 ("pop af"); //parity odd <==> P/O=0 <==> interrupt enable flag IFF2 was 0 <==> //don't enable interrupts as they were off before - emit2 ("jp PO,!tlabel", tlbl->key + 100); + emit2 ("jp PO,!tlabel", labelKey2num (tlbl->key)); emit2 ("!ei"); - emit2 ("!tlabeldef", (tlbl->key + 100)); - _G.lines.current->isLabel = 1; + emit2 ("!tlabeldef", labelKey2num (tlbl->key)); + genLine.lineCurr->isLabel = 1; } } } @@ -4393,9 +4575,9 @@ if (IFFUNC_ISISR (sym->type)) { /* "critical interrupt" is used to imply NMI handler */ - if (!IS_GB && IFFUNC_ISCRITICAL (sym->type) && FUNC_INTNO(sym->type) == INTNO_UNSPEC) + if (!IS_GB && IFFUNC_ISCRITICAL (sym->type) && FUNC_INTNO (sym->type) == INTNO_UNSPEC) emit2 ("retn"); - else if (IS_R2K && IFFUNC_ISCRITICAL (sym->type) && FUNC_INTNO(sym->type) == INTNO_UNSPEC) + else if (IS_RAB && IFFUNC_ISCRITICAL (sym->type) && FUNC_INTNO (sym->type) == INTNO_UNSPEC) { // ISR exit sequence that works on the rabbit 4000 emit2 ("pop ip"); @@ -4411,7 +4593,7 @@ emit2 ("ret"); } - if (!IS_STATIC(sym->etype)) + if (!IS_STATIC (sym->etype)) { struct dbuf_s dbuf; @@ -4419,7 +4601,7 @@ dbuf_printf (&dbuf, "%s_end", sym->rname); emit2 ("!labeldef", dbuf_c_str (&dbuf)); dbuf_destroy (&dbuf); - _G.lines.current->isLabel = 1; + genLine.lineCurr->isLabel = 1; } _G.flushStatics = 1; @@ -4431,7 +4613,7 @@ /* genRet - generate code for return statement */ /*-----------------------------------------------------------------*/ static void -genRet (const iCode *ic) +genRet (const iCode * ic) { /* Errk. This is a hack until I can figure out how to cause dehl to spill on a call */ @@ -4447,29 +4629,29 @@ aopOp (IC_LEFT (ic), ic, FALSE, FALSE); size = AOP_SIZE (IC_LEFT (ic)); - if (size==2) + if (size == 2) { - fetchPair(IS_GB ? PAIR_DE : PAIR_HL, AOP (IC_LEFT (ic))); + fetchPairLong (IS_GB ? PAIR_DE : PAIR_HL, AOP (IC_LEFT (ic)), ic, 0); } - else + else if (size <= 4) { if (IS_GB && size == 4 && requiresHL (AOP (IC_LEFT (ic)))) { - fetchPair (PAIR_DE, AOP (IC_LEFT (ic))); - fetchPairLong (PAIR_HL, AOP (IC_LEFT (ic)), ic, 2); + fetchPairLong (PAIR_DE, AOP (IC_LEFT (ic)), 0, 0); + fetchPairLong (PAIR_HL, AOP (IC_LEFT (ic)), 0, 2); } else if (AOP_TYPE (IC_LEFT (ic)) == AOP_REG) { int i; short retarray[4], oparray[4]; - - for(i = 0; i < AOP_SIZE (IC_LEFT (ic)); i++) - { - retarray[i] = _fReturn3[i]->aopu.aop_reg[0]->rIdx; - oparray[i] = AOP (IC_LEFT (ic))->aopu.aop_reg[i]->rIdx; - } - - regMove(retarray, oparray, AOP_SIZE (IC_LEFT (ic))); + + for (i = 0; i < AOP_SIZE (IC_LEFT (ic)); i++) + { + retarray[i] = _fReturn3[i]->aopu.aop_reg[0]->rIdx; + oparray[i] = AOP (IC_LEFT (ic))->aopu.aop_reg[i]->rIdx; + } + + regMove (retarray, oparray, AOP_SIZE (IC_LEFT (ic))); } else { @@ -4480,16 +4662,89 @@ } } } + else if (AOP_TYPE (IC_LEFT (ic)) == AOP_LIT) + { + unsigned long lit = ulFromVal (AOP (IC_LEFT (ic))->aopu.aop_lit); + emit2 ("ld hl, #%d", _G.stack.offset + _G.stack.param_offset + _G.stack.pushed + (_G.omitFramePtr || IS_GB ? 0 : 2)); + emit2 ("add hl, sp"); + emit2 ("ld a, (hl)"); + emit2 ("inc hl"); + emit2 ("ld h, (hl)"); + emit2 ("ld l, a"); + regalloc_dry_run_cost += 8; + do + { + emit2 ("ld (hl), !immedbyte", lit & 0xff); + regalloc_dry_run_cost += 2; + lit >>= 8; + if (size > 1) + { + emit2 ("inc hl"); + regalloc_dry_run_cost++; + } + } + while (--size); + } + else if (!IS_GB && AOP_TYPE (IC_LEFT (ic)) == AOP_STK || AOP_TYPE (IC_LEFT (ic)) == AOP_EXSTK + || AOP_TYPE (IC_LEFT (ic)) == AOP_DIR || AOP_TYPE (IC_LEFT (ic)) == AOP_IY) + { + emit2 ("ld hl, #%d", _G.stack.offset + _G.stack.param_offset + _G.stack.pushed + (_G.omitFramePtr || IS_GB ? 0 : 2)); + emit2 ("add hl, sp"); + emit2 ("ld e, (hl)"); + emit2 ("inc hl"); + emit2 ("ld d, (hl)"); + regalloc_dry_run_cost += 7; + if (AOP_TYPE (IC_LEFT (ic)) == AOP_STK || AOP_TYPE (IC_LEFT (ic)) == AOP_EXSTK) + { + int sp_offset, fp_offset; + fp_offset = + AOP (IC_LEFT (ic))->aopu.aop_stk + _G.stack.offset + (AOP (IC_LEFT (ic))->aopu.aop_stk > + 0 ? _G.stack.param_offset : 0); + sp_offset = fp_offset + _G.stack.pushed; + emit2 ("ld hl, #%d", sp_offset); + emit2 ("add hl, sp"); + regalloc_dry_run_cost += 4; + } + else + { + emit2 ("ld hl, #%s", AOP (IC_LEFT (ic))->aopu.aop_dir); + regalloc_dry_run_cost += 3; + } + emit2 ("ld bc, #%d", size); + emit2 ("ldir"); + regalloc_dry_run_cost += 5; + } + else + { + emit2 ("ld hl, #%d", _G.stack.offset + _G.stack.param_offset + _G.stack.pushed + (_G.omitFramePtr || IS_GB ? 0 : 2)); + emit2 ("add hl, sp"); + emit2 ("ld c, (hl)"); + emit2 ("inc hl"); + emit2 ("ld b, (hl)"); + regalloc_dry_run_cost += 7; + spillPair (PAIR_HL); + do + { + cheapMove (ASMOP_A, 0, AOP (IC_LEFT (ic)), offset++); + emit2 ("ld (bc), a"); + regalloc_dry_run_cost++; + if (size > 1) + { + emit2 ("inc bc"); + regalloc_dry_run_cost++; + } + } + while (--size); + } freeAsmop (IC_LEFT (ic), NULL, ic); jumpret: /* generate a jump to the return label if the next is not the return statement */ - if (!(ic->next && ic->next->op == LABEL && - IC_LABEL (ic->next) == returnLabel)) + if (!(ic->next && ic->next->op == LABEL && IC_LABEL (ic->next) == returnLabel)) { - if(!regalloc_dry_run) - emit2 ("jp !tlabel", returnLabel->key + 100); + if (!regalloc_dry_run) + emit2 ("jp !tlabel", labelKey2num (returnLabel->key)); regalloc_dry_run_cost += 3; } } @@ -4498,29 +4753,29 @@ /* genLabel - generates a label */ /*-----------------------------------------------------------------*/ static void -genLabel (const iCode *ic) +genLabel (const iCode * ic) { /* special case never generate */ if (IC_LABEL (ic) == entryLabel) return; - emitLabel (IC_LABEL (ic)->key + 100); + emitLabelSpill (IC_LABEL (ic)); } /*-----------------------------------------------------------------*/ /* genGoto - generates a ljmp */ /*-----------------------------------------------------------------*/ static void -genGoto (const iCode *ic) +genGoto (const iCode * ic) { - emit2 ("jp !tlabel", IC_LABEL (ic)->key + 100); + emit2 ("jp !tlabel", labelKey2num (IC_LABEL (ic)->key)); } /*-----------------------------------------------------------------*/ /* genPlusIncr :- does addition with increment if possible */ /*-----------------------------------------------------------------*/ static bool -genPlusIncr (const iCode *ic) +genPlusIncr (const iCode * ic) { unsigned int icount; unsigned int size = getDataSize (IC_RESULT (ic)); @@ -4532,13 +4787,12 @@ if (AOP_TYPE (IC_RIGHT (ic)) != AOP_LIT) return FALSE; - emitDebug ("; genPlusIncr"); - icount = (unsigned int) ulFromVal (AOP (IC_RIGHT (ic))->aopu.aop_lit); /* If result is a pair */ if (resultId != PAIR_INVALID) { + bool delayed_move; if (isLitWord (AOP (IC_LEFT (ic)))) { fetchLitPair (getPairId (AOP (IC_RESULT (ic))), AOP (IC_LEFT (ic)), icount); @@ -4568,24 +4822,30 @@ if (icount > 5) return FALSE; /* Inc a pair */ + delayed_move = (getPairId (AOP (IC_RESULT (ic))) == PAIR_IY && getPairId (AOP (IC_LEFT (ic))) != PAIR_INVALID + && isPairDead (getPairId (AOP (IC_LEFT (ic))), ic)); if (!sameRegs (AOP (IC_LEFT (ic)), AOP (IC_RESULT (ic)))) { if (icount > 3) return FALSE; - movLeft2ResultLong (IC_LEFT (ic), 0, IC_RESULT (ic), 0, 0, 2); + if (!delayed_move) + fetchPair (getPairId (AOP (IC_RESULT (ic))), AOP (IC_LEFT (ic))); } while (icount--) { - emit2 ("inc %s", getPairName (AOP (IC_RESULT (ic)))); - regalloc_dry_run_cost += (getPairId (AOP (IC_RESULT (ic))) == PAIR_IY ? 2 : 1); + PAIR_ID pair = delayed_move ? getPairId (AOP (IC_LEFT (ic))) : getPairId (AOP (IC_RESULT (ic))); + emit2 ("inc %s", _pairs[pair].name); + regalloc_dry_run_cost += (pair == PAIR_IY ? 2 : 1); } + if (delayed_move) + fetchPair (getPairId (AOP (IC_RESULT (ic))), AOP (IC_LEFT (ic))); return TRUE; } - if (!IS_GB && isLitWord (AOP (IC_LEFT (ic))) && size == 2) + if (!IS_GB && isLitWord (AOP (IC_LEFT (ic))) && size == 2 && isPairDead (PAIR_HL, ic)) { fetchLitPair (PAIR_HL, AOP (IC_LEFT (ic)), icount); - commitPair (AOP (IC_RESULT (ic)), PAIR_HL); + commitPair (AOP (IC_RESULT (ic)), PAIR_HL, ic, FALSE); return TRUE; } @@ -4595,10 +4855,7 @@ return FALSE; /* if increment 16 bits in register */ - if (sameRegs (AOP (IC_LEFT (ic)), AOP (IC_RESULT (ic))) && - size > 1 && - icount == 1 - ) + if (sameRegs (AOP (IC_LEFT (ic)), AOP (IC_RESULT (ic))) && size > 1 && icount == 1) { int offset = 0; symbol *tlbl = regalloc_dry_run ? 0 : newiTempLabel (0); @@ -4607,21 +4864,21 @@ emit3_o (A_INC, AOP (IC_RESULT (ic)), offset++, 0, 0); if (size) { - if(!regalloc_dry_run) - emit2 ("jp NZ,!tlabel", tlbl->key + 100); + if (!regalloc_dry_run) + emit2 ("jp NZ,!tlabel", labelKey2num (tlbl->key)); regalloc_dry_run_cost += 3; } } if (!regalloc_dry_run) - AOP_TYPE (IC_LEFT (ic)) == AOP_HL ? emitLabel (tlbl->key + 100) : emitLabelNoSpill (tlbl->key + 100); + (AOP_TYPE (IC_LEFT (ic)) == AOP_HL || IS_GB + && AOP_TYPE (IC_LEFT (ic)) == AOP_STK) ? emitLabelSpill (tlbl) : emitLabel (tlbl); else if (AOP_TYPE (IC_LEFT (ic)) == AOP_HL) spillCached (); return TRUE; } /* if the sizes are greater than 1 then we cannot */ - if (AOP_SIZE (IC_RESULT (ic)) > 1 || - AOP_SIZE (IC_LEFT (ic)) > 1) + if (AOP_SIZE (IC_RESULT (ic)) > 1 || AOP_SIZE (IC_LEFT (ic)) > 1) return FALSE; /* If the result is in a register then we can load then increment. @@ -4630,7 +4887,7 @@ { cheapMove (AOP (IC_RESULT (ic)), LSB, AOP (IC_LEFT (ic)), LSB); while (icount--) - emit3_o (A_INC, AOP (IC_RESULT (ic)), LSB, 0, 0); + emit3_o (A_INC, AOP (IC_RESULT (ic)), LSB, 0, 0); return TRUE; } @@ -4661,11 +4918,11 @@ } else { - if(!regalloc_dry_run) + if (!regalloc_dry_run) { - emit2 ("jp Z,!tlabel", tlbl->key + 100); + emit2 ("jp Z,!tlabel", labelKey2num (tlbl->key)); emit2 ("ld a,!one"); - emitLabelNoSpill (tlbl->key + 100); + emitLabel (tlbl); } regalloc_dry_run_cost += 5; outAcc (result); @@ -4673,7 +4930,7 @@ } static bool -couldDestroyCarry (asmop *aop) +couldDestroyCarry (asmop * aop) { if (aop) { @@ -4686,12 +4943,11 @@ } static void -shiftIntoPair (int idx, asmop *aop) +shiftIntoPair (int idx, asmop * aop) { PAIR_ID id = PAIR_INVALID; wassertl (!IS_GB, "Not implemented for the GBZ80"); - // wassertl (aop->type == AOP_EXSTK, "Only implemented for EXSTK"); emitDebug ("; Shift into pair idx %u", idx); @@ -4723,10 +4979,10 @@ } static void -setupToPreserveCarry (const iCode *ic) +setupToPreserveCarry (const iCode * ic) { - asmop *left = AOP (IC_LEFT (ic)); - asmop *right = AOP (IC_RIGHT (ic)); + asmop *left = AOP (IC_LEFT (ic)); + asmop *right = AOP (IC_RIGHT (ic)); asmop *result = AOP (IC_RESULT (ic)); wassert (left && right); @@ -4739,7 +4995,7 @@ /* check result again, in case right == result */ if (couldDestroyCarry (result)) { - if (!isPairInUse (PAIR_DE, ic)) + if (couldDestroyCarry (left)) shiftIntoPair (1, result); else shiftIntoPair (2, result); @@ -4770,6 +5026,7 @@ genPlus (iCode * ic) { int size, offset = 0; + signed char cached[2]; bool premoved; /* special cases :- */ @@ -4783,9 +5040,7 @@ if literal, literal on the right or if left requires ACC or right is already in ACC */ - if ((AOP_TYPE (IC_LEFT (ic)) == AOP_LIT) || - (AOP_NEEDSACC (IC_RIGHT (ic))) || - AOP_TYPE (IC_RIGHT (ic)) == AOP_ACC) + if ((AOP_TYPE (IC_LEFT (ic)) == AOP_LIT) || (AOP_NEEDSACC (IC_RIGHT (ic))) || AOP_TYPE (IC_RIGHT (ic)) == AOP_ACC) { operand *t = IC_RIGHT (ic); IC_RIGHT (ic) = IC_LEFT (ic); @@ -4794,16 +5049,14 @@ /* if both left & right are in bit space */ - if (AOP_TYPE (IC_LEFT (ic)) == AOP_CRY && - AOP_TYPE (IC_RIGHT (ic)) == AOP_CRY) + if (AOP_TYPE (IC_LEFT (ic)) == AOP_CRY && AOP_TYPE (IC_RIGHT (ic)) == AOP_CRY) { /* Cant happen */ wassertl (0, "Tried to add two bits"); } /* if left in bit space & right literal */ - if (AOP_TYPE (IC_LEFT (ic)) == AOP_CRY && - AOP_TYPE (IC_RIGHT (ic)) == AOP_LIT) + if (AOP_TYPE (IC_LEFT (ic)) == AOP_CRY && AOP_TYPE (IC_RIGHT (ic)) == AOP_LIT) { /* Can happen I guess */ wassertl (0, "Tried to add a bit to a literal"); @@ -4822,8 +5075,7 @@ char *left = Safe_strdup (aopGetLitWordLong (AOP (IC_LEFT (ic)), 0, FALSE)); const char *right = aopGetLitWordLong (AOP (IC_RIGHT (ic)), 0, FALSE); - if (AOP_TYPE(IC_LEFT(ic)) == AOP_LIT && AOP_TYPE(IC_RIGHT(ic)) == AOP_LIT && - left && right) + if (AOP_TYPE (IC_LEFT (ic)) == AOP_LIT && AOP_TYPE (IC_RIGHT (ic)) == AOP_LIT && left && right) { struct dbuf_s dbuf; @@ -4874,19 +5126,72 @@ regalloc_dry_run_cost += 1; goto release; } + else if (left == PAIR_HL && (isPairDead (PAIR_DE, ic) || isPairDead (PAIR_BC, ic))) + { + PAIR_ID pair = (isPairDead (PAIR_DE, ic) ? PAIR_DE : PAIR_BC); + fetchPair (pair, AOP (IC_RIGHT (ic))); + emit2 ("add hl,%s", _pairs[pair].name); + regalloc_dry_run_cost += 1; + goto release; + } + else if (right == PAIR_HL && (isPairDead (PAIR_DE, ic) || isPairDead (PAIR_BC, ic))) + { + PAIR_ID pair = (isPairDead (PAIR_DE, ic) ? PAIR_DE : PAIR_BC); + fetchPair (pair, AOP (IC_LEFT (ic))); + emit2 ("add hl,%s", _pairs[pair].name); + regalloc_dry_run_cost += 1; + goto release; + } else { /* Can't do it */ } } + /* Addition of interleaved pairs */ + if (getPairId (AOP (IC_RESULT (ic))) == PAIR_HL && AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP_SIZE (IC_LEFT (ic)) >= 2 && AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && AOP_SIZE (IC_RIGHT (ic)) >= 2) + { + if (AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == L_IDX && AOP (IC_RIGHT (ic))->aopu.aop_reg[1]->rIdx == H_IDX) + { + if (AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx == D_IDX && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == E_IDX) + { + emit2 ("add hl, de"); + regalloc_dry_run_cost += 1; + goto release; + } + else if (AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx == B_IDX && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == C_IDX) + { + emit2 ("add hl, bc"); + regalloc_dry_run_cost += 1; + goto release; + } + } + else if (AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx == H_IDX && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == L_IDX) + { + if (AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == E_IDX && AOP (IC_RIGHT (ic))->aopu.aop_reg[1]->rIdx == D_IDX) + { + emit2 ("add hl, de"); + regalloc_dry_run_cost += 1; + goto release; + } + else if (AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == C_IDX && AOP (IC_RIGHT (ic))->aopu.aop_reg[1]->rIdx == B_IDX) + { + emit2 ("add hl, bc"); + regalloc_dry_run_cost += 1; + goto release; + } + } + } + if (getPairId (AOP (IC_RESULT (ic))) == PAIR_IY) { bool save_pair = FALSE; PAIR_ID pair; - if (getPairId (AOP (IC_RIGHT (ic))) == PAIR_IY || getPairId (AOP (IC_LEFT (ic))) == PAIR_BC || getPairId (AOP (IC_LEFT (ic))) == PAIR_DE || - getPairId (AOP (IC_LEFT (ic))) != PAIR_IY && (AOP_TYPE (IC_RIGHT (ic)) == AOP_IMMD || AOP_TYPE (IC_RIGHT (ic)) == AOP_LIT || AOP_TYPE (IC_RIGHT (ic)) == AOP_SIMPLELIT)) + if (getPairId (AOP (IC_RIGHT (ic))) == PAIR_IY || getPairId (AOP (IC_LEFT (ic))) == PAIR_BC + || getPairId (AOP (IC_LEFT (ic))) == PAIR_DE || getPairId (AOP (IC_LEFT (ic))) != PAIR_IY + && (AOP_TYPE (IC_RIGHT (ic)) == AOP_IMMD || AOP_TYPE (IC_RIGHT (ic)) == AOP_LIT + || AOP_TYPE (IC_RIGHT (ic)) == AOP_SIMPLELIT)) { operand *t = IC_RIGHT (ic); IC_RIGHT (ic) = IC_LEFT (ic); @@ -4895,7 +5200,14 @@ pair = getPairId (AOP (IC_RIGHT (ic))); if (pair != PAIR_BC && pair != PAIR_DE) { - pair = isPairDead (PAIR_DE, ic) ? PAIR_DE : PAIR_BC; + if (AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == C_IDX + && (!bitVectBitValue (ic->rSurv, B_IDX) || !isPairDead (PAIR_DE, ic))) + pair = PAIR_BC; + else if (AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == E_IDX + && (!bitVectBitValue (ic->rSurv, D_IDX) || !isPairDead (PAIR_BC, ic))) + pair = PAIR_DE; + else + pair = isPairDead (PAIR_DE, ic) ? PAIR_DE : PAIR_BC; if (!isPairDead (pair, ic)) save_pair = TRUE; } @@ -4910,48 +5222,53 @@ goto release; } - if (isPair (AOP (IC_RIGHT (ic))) && AOP_TYPE (IC_LEFT (ic)) == AOP_IMMD && getPairId (AOP (IC_RIGHT (ic))) != PAIR_HL) + if (isPair (AOP (IC_RIGHT (ic))) && AOP_TYPE (IC_LEFT (ic)) == AOP_IMMD && getPairId (AOP (IC_RIGHT (ic))) != PAIR_HL + && isPairDead (PAIR_HL, ic)) { fetchPair (PAIR_HL, AOP (IC_LEFT (ic))); emit2 ("add hl,%s", getPairName (AOP (IC_RIGHT (ic)))); regalloc_dry_run_cost += 1; spillPair (PAIR_HL); - commitPair (AOP (IC_RESULT (ic)), PAIR_HL); + commitPair (AOP (IC_RESULT (ic)), PAIR_HL, ic, FALSE); goto release; } - if (isPair (AOP (IC_LEFT (ic))) && AOP_TYPE (IC_RIGHT (ic)) == AOP_LIT && getPairId (AOP (IC_LEFT (ic))) != PAIR_HL) + if (isPair (AOP (IC_LEFT (ic))) && AOP_TYPE (IC_RIGHT (ic)) == AOP_LIT && getPairId (AOP (IC_LEFT (ic))) != PAIR_HL + && isPairDead (PAIR_HL, ic)) { fetchPair (PAIR_HL, AOP (IC_RIGHT (ic))); emit2 ("add hl,%s", getPairName (AOP (IC_LEFT (ic)))); regalloc_dry_run_cost += 1; spillPair (PAIR_HL); - commitPair (AOP (IC_RESULT (ic)), PAIR_HL); + commitPair (AOP (IC_RESULT (ic)), PAIR_HL, ic, FALSE); goto release; } - if (isPair (AOP (IC_LEFT (ic))) && isPair (AOP (IC_RIGHT (ic))) && getPairId (AOP (IC_LEFT (ic))) == PAIR_HL) + if (isPair (AOP (IC_LEFT (ic))) && isPair (AOP (IC_RIGHT (ic))) && getPairId (AOP (IC_LEFT (ic))) == PAIR_HL + && isPairDead (PAIR_HL, ic)) { emit2 ("add hl,%s", getPairName (AOP (IC_RIGHT (ic)))); regalloc_dry_run_cost += 1; spillPair (PAIR_HL); - commitPair (AOP (IC_RESULT (ic)), PAIR_HL); + commitPair (AOP (IC_RESULT (ic)), PAIR_HL, ic, FALSE); goto release; } - if (isPair (AOP (IC_LEFT (ic))) && isPair (AOP (IC_RIGHT (ic))) && getPairId (AOP (IC_RIGHT (ic))) == PAIR_HL) + if (isPair (AOP (IC_LEFT (ic))) && isPair (AOP (IC_RIGHT (ic))) && getPairId (AOP (IC_RIGHT (ic))) == PAIR_HL + && isPairDead (PAIR_HL, ic)) { emit2 ("add hl,%s", getPairName (AOP (IC_LEFT (ic)))); regalloc_dry_run_cost += 1; spillPair (PAIR_HL); - commitPair (AOP (IC_RESULT (ic)), PAIR_HL); + commitPair (AOP (IC_RESULT (ic)), PAIR_HL, ic, FALSE); goto release; } if (getPairId (AOP (IC_RESULT (ic))) == PAIR_HL && AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && - AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == C_IDX && !bitVectBitValue(ic->rSurv, B_IDX)) + AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == C_IDX && !bitVectBitValue (ic->rSurv, B_IDX)) { - if (AOP (IC_RIGHT (ic))->aopu.aop_reg[1] && (AOP (IC_RIGHT (ic))->aopu.aop_reg[1]->rIdx == H_IDX || AOP (IC_RIGHT (ic))->aopu.aop_reg[1]->rIdx == L_IDX)) + if (AOP (IC_RIGHT (ic))->aopu.aop_reg[1] + && (AOP (IC_RIGHT (ic))->aopu.aop_reg[1]->rIdx == H_IDX || AOP (IC_RIGHT (ic))->aopu.aop_reg[1]->rIdx == L_IDX)) { cheapMove (ASMOP_B, 0, AOP (IC_RIGHT (ic)), 1); fetchPair (PAIR_HL, AOP (IC_LEFT (ic))); @@ -4965,10 +5282,11 @@ regalloc_dry_run_cost += 1; goto release; } - if (!z80_opts.oldralloc && getPairId (AOP (IC_RESULT (ic))) == PAIR_HL && AOP_TYPE (IC_LEFT (ic)) == AOP_REG && - AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == C_IDX && !bitVectBitValue(ic->rSurv, B_IDX)) + if (!options.oldralloc && getPairId (AOP (IC_RESULT (ic))) == PAIR_HL && AOP_TYPE (IC_LEFT (ic)) == AOP_REG && + AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == C_IDX && !bitVectBitValue (ic->rSurv, B_IDX)) { - if (AOP (IC_LEFT (ic))->aopu.aop_reg[1] && (AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx == H_IDX || AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx == L_IDX)) + if (AOP (IC_LEFT (ic))->aopu.aop_reg[1] + && (AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx == H_IDX || AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx == L_IDX)) { cheapMove (ASMOP_B, 0, AOP (IC_LEFT (ic)), 1); fetchPair (PAIR_HL, AOP (IC_RIGHT (ic))); @@ -4983,10 +5301,11 @@ goto release; } - if (!z80_opts.oldralloc && getPairId (AOP (IC_RESULT (ic))) == PAIR_HL && AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && - AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == E_IDX && !bitVectBitValue(ic->rSurv, D_IDX)) + if (!options.oldralloc && getPairId (AOP (IC_RESULT (ic))) == PAIR_HL && AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && + AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == E_IDX && !bitVectBitValue (ic->rSurv, D_IDX)) { - if (AOP (IC_RIGHT (ic))->aopu.aop_reg[1] && (AOP (IC_RIGHT (ic))->aopu.aop_reg[1]->rIdx == H_IDX || AOP (IC_RIGHT (ic))->aopu.aop_reg[1]->rIdx == L_IDX)) + if (AOP (IC_RIGHT (ic))->aopu.aop_reg[1] + && (AOP (IC_RIGHT (ic))->aopu.aop_reg[1]->rIdx == H_IDX || AOP (IC_RIGHT (ic))->aopu.aop_reg[1]->rIdx == L_IDX)) { cheapMove (ASMOP_D, 0, AOP (IC_RIGHT (ic)), 1); fetchPair (PAIR_HL, AOP (IC_LEFT (ic))); @@ -5000,10 +5319,11 @@ regalloc_dry_run_cost += 1; goto release; } - if (!z80_opts.oldralloc && getPairId (AOP (IC_RESULT (ic))) == PAIR_HL && AOP_TYPE (IC_LEFT (ic)) == AOP_REG && - AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == E_IDX && !bitVectBitValue(ic->rSurv, D_IDX)) + if (!options.oldralloc && getPairId (AOP (IC_RESULT (ic))) == PAIR_HL && AOP_TYPE (IC_LEFT (ic)) == AOP_REG && + AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == E_IDX && !bitVectBitValue (ic->rSurv, D_IDX)) { - if (AOP (IC_LEFT (ic))->aopu.aop_reg[1] && (AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx == H_IDX || AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx == L_IDX)) + if (AOP (IC_LEFT (ic))->aopu.aop_reg[1] + && (AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx == H_IDX || AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx == L_IDX)) { cheapMove (ASMOP_D, 0, AOP (IC_LEFT (ic)), 1); fetchPair (PAIR_HL, AOP (IC_RIGHT (ic))); @@ -5017,7 +5337,51 @@ regalloc_dry_run_cost += 1; goto release; } - + + if (getPairId (AOP (IC_RESULT (ic))) == PAIR_HL && getPairId (AOP (IC_LEFT (ic))) == PAIR_HL + && AOP_TYPE (IC_RIGHT (ic)) == AOP_LIT) + { + PAIR_ID pair = getFreePairId (ic); + bool pair_alive; + if (pair == PAIR_INVALID) + pair = PAIR_DE; + if (pair_alive = !isPairDead (pair, ic)) + _push (pair); + fetchPair (pair, AOP (IC_RIGHT (ic))); + emit2 ("add hl, %s", _pairs[pair].name); + regalloc_dry_run_cost += 1; + if (pair_alive) + _pop (pair); + goto release; + } + + /* Using the 16 bit addition results in smaller and faster code than using the 8-bit addition. */ + if (size == 1 && isPairDead (PAIR_HL, ic) && AOP_TYPE (IC_RESULT (ic)) == AOP_REG && AOP_TYPE (IC_LEFT (ic)) == AOP_REG + && AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && AOP (IC_RESULT (ic))->aopu.aop_reg[0]->rIdx == L_IDX + && (AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == L_IDX || AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == L_IDX) + && (AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == C_IDX || AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == C_IDX + || AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == E_IDX || AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == E_IDX)) + { + PAIR_ID pair = (AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == C_IDX + || AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == C_IDX) ? PAIR_BC : PAIR_DE; + emit2 ("add hl, %s", _pairs[pair].name); + regalloc_dry_run_cost += 1; + goto release; + } + + /* When adding a literal, the 16 bit addition results in smaller, slower code. */ + if (optimize.codeSize && size == 1 && isPairDead (PAIR_HL, ic) && AOP_TYPE (IC_RESULT (ic)) == AOP_REG + && AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP_TYPE (IC_RIGHT (ic)) == AOP_LIT + && AOP (IC_RESULT (ic))->aopu.aop_reg[0]->rIdx == L_IDX && AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == L_IDX + && (!bitVectBitValue (ic->rSurv, C_IDX) || !bitVectBitValue (ic->rSurv, E_IDX))) + { + PAIR_ID pair = bitVectBitValue (ic->rSurv, C_IDX) ? PAIR_DE : PAIR_BC; + emit2 ("ld %s, !immedbyte", _pairs[pair].l, ((unsigned int) ulFromVal (AOP (IC_RIGHT (ic))->aopu.aop_lit)) & 0xff); + emit2 ("add hl, %s", _pairs[pair].name); + regalloc_dry_run_cost += 3; + goto release; + } + /* Special case: ld hl,sp+n trashes C so we can't afford to do it during an add with stack based variables. Worst case is: @@ -5048,16 +5412,12 @@ */ if (IS_GB) { - if (AOP_TYPE (IC_LEFT (ic)) == AOP_STK || - AOP_TYPE (IC_RIGHT (ic)) == AOP_STK || - AOP_TYPE (IC_RESULT (ic)) == AOP_STK) + if (AOP_TYPE (IC_LEFT (ic)) == AOP_STK || AOP_TYPE (IC_RIGHT (ic)) == AOP_STK || AOP_TYPE (IC_RESULT (ic)) == AOP_STK) { if ((AOP_SIZE (IC_LEFT (ic)) == 2 || - AOP_SIZE (IC_RIGHT (ic)) == 2) && - (AOP_SIZE (IC_LEFT (ic)) <= 2 && - AOP_SIZE (IC_RIGHT (ic)) <= 2)) + AOP_SIZE (IC_RIGHT (ic)) == 2) && (AOP_SIZE (IC_LEFT (ic)) <= 2 && AOP_SIZE (IC_RIGHT (ic)) <= 2 || size == 2)) { - if (getPairId (AOP (IC_RIGHT (ic))) == PAIR_BC) + if (getPairId (AOP (IC_RIGHT (ic))) == PAIR_BC || getPairId (AOP (IC_RIGHT (ic))) == PAIR_DE) { /* Swap left and right */ operand *t = IC_RIGHT (ic); @@ -5072,12 +5432,46 @@ } else { - fetchPair (PAIR_DE, AOP (IC_LEFT (ic))); - fetchPair (PAIR_HL, AOP (IC_RIGHT (ic))); + if (AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && AOP_TYPE (IC_LEFT (ic)) == AOP_REG) + { + const short dst[4] = { E_IDX, L_IDX, D_IDX, H_IDX }; + short src[4]; + if (AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == E_IDX + || AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == L_IDX) + { + src[0] = AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx; + src[1] = AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx; + src[2] = AOP (IC_RIGHT (ic))->aopu.aop_reg[1]->rIdx; + src[3] = AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx; + } + else + { + src[1] = AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx; + src[0] = AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx; + src[3] = AOP (IC_RIGHT (ic))->aopu.aop_reg[1]->rIdx; + src[2] = AOP (IC_LEFT (ic))->aopu.aop_reg[1]->rIdx; + } + regMove (dst, src, size); + } + else if (AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && + (AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == E_IDX + || AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == D_IDX || AOP_SIZE (IC_RIGHT (ic)) == 2 + && (AOP (IC_RIGHT (ic))->aopu.aop_reg[1]->rIdx == E_IDX + || AOP (IC_RIGHT (ic))->aopu.aop_reg[1]->rIdx == D_IDX))) + { + fetchPair (PAIR_DE, AOP (IC_RIGHT (ic))); + fetchPair (PAIR_HL, AOP (IC_LEFT (ic))); + } + else + { + fetchPair (PAIR_DE, AOP (IC_LEFT (ic))); + fetchPair (PAIR_HL, AOP (IC_RIGHT (ic))); + } emit2 ("add hl,de"); regalloc_dry_run_cost += 1; } - commitPair (AOP (IC_RESULT (ic)), PAIR_HL); + spillPair (PAIR_HL); + commitPair (AOP (IC_RESULT (ic)), PAIR_HL, ic, FALSE); goto release; } } @@ -5085,40 +5479,59 @@ { /* Be paranoid on the GB with 4 byte variables due to how C can be trashed by lda hl,n(sp). - */ + */ _gbz80_emitAddSubLong (ic, TRUE); goto release; } } - + // Avoid overwriting operand in h or l when setupToPreserveCarry () loads hl. - if(!couldDestroyCarry (AOP (IC_LEFT (ic)))) + if (!couldDestroyCarry (AOP (IC_LEFT (ic)))) { cheapMove (ASMOP_A, 0, AOP (IC_LEFT (ic)), offset); premoved = TRUE; } else premoved = FALSE; - + setupToPreserveCarry (ic); + cached[0] = -1; + cached[1] = -1; while (size--) { - if(!premoved) + if (!premoved) cheapMove (ASMOP_A, 0, AOP (IC_LEFT (ic)), offset); else premoved = FALSE; if (offset == 0) - { - if(size == 0 && AOP_TYPE (IC_RIGHT (ic)) == AOP_LIT && ulFromVal (AOP (IC_RIGHT (ic))->aopu.aop_lit) == 1) - emit3 (A_INC, ASMOP_A, 0); - else - emit3_o (A_ADD, ASMOP_A, 0, AOP (IC_RIGHT (ic)), offset); - } + { + if (size == 0 && AOP_TYPE (IC_RIGHT (ic)) == AOP_LIT && ulFromVal (AOP (IC_RIGHT (ic))->aopu.aop_lit) == 1) + emit3 (A_INC, ASMOP_A, 0); + else + emit3_o (A_ADD, ASMOP_A, 0, AOP (IC_RIGHT (ic)), offset); + } else emit3_o (A_ADC, ASMOP_A, 0, AOP (IC_RIGHT (ic)), offset); - cheapMove (AOP (IC_RESULT (ic)), offset++, ASMOP_A, 0); + if (size && + (requiresHL (AOP (IC_RIGHT (ic))) && AOP_TYPE (IC_RIGHT (ic)) != AOP_REG || requiresHL (AOP (IC_LEFT (ic))) + && AOP_TYPE (IC_LEFT (ic)) != AOP_REG) && AOP_TYPE (IC_RESULT (ic)) == AOP_REG + && (AOP (IC_RESULT (ic))->aopu.aop_reg[offset]->rIdx == L_IDX + || AOP (IC_RESULT (ic))->aopu.aop_reg[offset]->rIdx == H_IDX)) + { + wassert (cached[0] == -1 || cached[1] == -1); + cached[cached[0] == -1 ? 0 : 1] = offset++; + _push (PAIR_AF); + } + else + cheapMove (AOP (IC_RESULT (ic)), offset++, ASMOP_A, 0); } + for (size = 0; size < 2; size++) + if (cached[size] != -1) + { + _pop (PAIR_AF); + cheapMove (AOP (IC_RESULT (ic)), cached[size], ASMOP_A, 0); + } release: _G.preserveCarry = FALSE; freeAsmop (IC_LEFT (ic), NULL, ic); @@ -5148,8 +5561,7 @@ size = getDataSize (IC_RESULT (ic)); /* if decrement 16 bits in register */ - if (sameRegs (AOP (IC_LEFT (ic)), AOP (IC_RESULT (ic))) && - (size > 1) && isPair (AOP (IC_RESULT (ic)))) + if (sameRegs (AOP (IC_LEFT (ic)), AOP (IC_RESULT (ic))) && (size > 1) && isPair (AOP (IC_RESULT (ic)))) { while (icount--) emit2 ("dec %s", getPairName (AOP (IC_RESULT (ic)))); @@ -5163,31 +5575,28 @@ while (icount--) if (!regalloc_dry_run) emit2 ("dec %s", getPairName (AOP (IC_RESULT (ic)))); - regalloc_dry_run_cost += 1; + regalloc_dry_run_cost += 1; return TRUE; } - /* if increment 16 bits in register */ - if (sameRegs (AOP (IC_LEFT (ic)), AOP (IC_RESULT (ic))) && - (size == 2) - ) + /* if decrement 16 bits in register */ + if (sameRegs (AOP (IC_LEFT (ic)), AOP (IC_RESULT (ic))) && size == 2 && isPairDead (_getTempPairId (), ic)) { - fetchPair (_getTempPairId(), AOP (IC_RESULT (ic))); + fetchPair (_getTempPairId (), AOP (IC_RESULT (ic))); while (icount--) if (!regalloc_dry_run) - emit2 ("dec %s", _getTempPairName()); - regalloc_dry_run_cost += 1; + emit2 ("dec %s", _getTempPairName ()); + regalloc_dry_run_cost += 1; - commitPair (AOP (IC_RESULT (ic)), _getTempPairId()); + commitPair (AOP (IC_RESULT (ic)), _getTempPairId (), ic, FALSE); return TRUE; } /* if the sizes are greater than 1 then we cannot */ - if (AOP_SIZE (IC_RESULT (ic)) > 1 || - AOP_SIZE (IC_LEFT (ic)) > 1) + if (AOP_SIZE (IC_RESULT (ic)) > 1 || AOP_SIZE (IC_LEFT (ic)) > 1) return FALSE; /* we can if the aops of the left & result match or if they are in @@ -5199,6 +5608,14 @@ return TRUE; } + if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG) + { + cheapMove (AOP (IC_RESULT (ic)), 0, AOP (IC_LEFT (ic)), 0); + while (icount--) + emit3 (A_DEC, AOP (IC_RESULT (ic)), 0); + return TRUE; + } + return FALSE; } @@ -5217,8 +5634,7 @@ /* special cases :- */ /* if both left & right are in bit space */ - if (AOP_TYPE (IC_LEFT (ic)) == AOP_CRY && - AOP_TYPE (IC_RIGHT (ic)) == AOP_CRY) + if (AOP_TYPE (IC_LEFT (ic)) == AOP_CRY && AOP_TYPE (IC_RIGHT (ic)) == AOP_CRY) { wassertl (0, "Tried to subtract two bits"); goto release; @@ -5242,14 +5658,10 @@ /* Same logic as genPlus */ if (IS_GB) { - if (AOP_TYPE (IC_LEFT (ic)) == AOP_STK || - AOP_TYPE (IC_RIGHT (ic)) == AOP_STK || - AOP_TYPE (IC_RESULT (ic)) == AOP_STK) + if (AOP_TYPE (IC_LEFT (ic)) == AOP_STK || AOP_TYPE (IC_RIGHT (ic)) == AOP_STK || AOP_TYPE (IC_RESULT (ic)) == AOP_STK) { if ((AOP_SIZE (IC_LEFT (ic)) == 2 || - AOP_SIZE (IC_RIGHT (ic)) == 2) && - (AOP_SIZE (IC_LEFT (ic)) <= 2 && - AOP_SIZE (IC_RIGHT (ic)) <= 2)) + AOP_SIZE (IC_RIGHT (ic)) == 2) && (AOP_SIZE (IC_LEFT (ic)) <= 2 && AOP_SIZE (IC_RIGHT (ic)) <= 2)) { PAIR_ID left = getPairId (AOP (IC_LEFT (ic))); PAIR_ID right = getPairId (AOP (IC_RIGHT (ic))); @@ -5268,7 +5680,7 @@ /* Order is important. Right may be HL */ fetchPair (right, AOP (IC_RIGHT (ic))); - if(!regalloc_dry_run) + if (!regalloc_dry_run) { emit2 ("ld a,%s", _pairs[left].l); emit2 ("sub a,%s", _pairs[right].l); @@ -5278,9 +5690,9 @@ } regalloc_dry_run_cost += 5; - if ( AOP_SIZE (IC_RESULT (ic)) > 1) + if (AOP_SIZE (IC_RESULT (ic)) > 1) cheapMove (AOP (IC_RESULT (ic)), 1, ASMOP_A, 0); - aopPut (AOP (IC_RESULT (ic)), "e", 0); + cheapMove (AOP (IC_RESULT (ic)), 0, ASMOP_E, 0); goto release; } } @@ -5288,7 +5700,7 @@ { /* Be paranoid on the GB with 4 byte variables due to how C can be trashed by lda hl,n(sp). - */ + */ _gbz80_emitAddSubLong (ic, FALSE); goto release; } @@ -5316,7 +5728,7 @@ emit3 (A_DEC, ASMOP_A, 0); else { - if(!regalloc_dry_run) + if (!regalloc_dry_run) emit2 ("add a,!immedbyte", (unsigned int) (lit & 0x0FFL)); regalloc_dry_run_cost += 2; } @@ -5327,9 +5739,7 @@ cheapMove (AOP (IC_RESULT (ic)), offset++, ASMOP_A, 0); } - if (AOP_SIZE (IC_RESULT (ic)) == 3 && - AOP_SIZE (IC_LEFT (ic)) == 3 && - !sameRegs (AOP (IC_RESULT (ic)), AOP (IC_LEFT (ic)))) + if (AOP_SIZE (IC_RESULT (ic)) == 3 && AOP_SIZE (IC_LEFT (ic)) == 3 && !sameRegs (AOP (IC_RESULT (ic)), AOP (IC_LEFT (ic)))) { wassertl (0, "Tried to subtract on a long pointer"); } @@ -5353,57 +5763,55 @@ asmop *result = AOP (IC_RESULT (ic)); int resultsize = AOP_SIZE (IC_RESULT (ic)); - if(IS_GB) + if (IS_GB) { wassertl (0, "Multiplication is handled through support function calls on gbz80"); return; } - if (IS_Z180 && - /*AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP_TYPE (IC_RIGHT (ic)) == AOP_REG &&*/ AOP_TYPE (IC_RESULT (ic)) == AOP_REG) + if (IS_Z180 && AOP_TYPE (IC_RESULT (ic)) == AOP_REG) { - if (/*(AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == B_IDX && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == C_IDX || - AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == C_IDX && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == B_IDX) &&*/ - (resultsize > 1 ? result->aopu.aop_reg[1]->rIdx == B_IDX : !bitVectBitValue (ic->rSurv, B_IDX)) && result->aopu.aop_reg[0]->rIdx == C_IDX) + if ((resultsize > 1 ? result->aopu.aop_reg[1]->rIdx == B_IDX : !bitVectBitValue (ic->rSurv, B_IDX)) + && result->aopu.aop_reg[0]->rIdx == C_IDX) { - if(AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == C_IDX || - AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == B_IDX) + if (AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == C_IDX || + AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == B_IDX) { - cheapMove(ASMOP_C, 0, AOP (IC_LEFT (ic)), LSB); - cheapMove(ASMOP_B, 0, AOP (IC_RIGHT (ic)), LSB); + cheapMove (ASMOP_C, 0, AOP (IC_LEFT (ic)), LSB); + cheapMove (ASMOP_B, 0, AOP (IC_RIGHT (ic)), LSB); } else { - cheapMove(ASMOP_B, 0, AOP (IC_LEFT (ic)), LSB); - cheapMove(ASMOP_C, 0, AOP (IC_RIGHT (ic)), LSB); + cheapMove (ASMOP_B, 0, AOP (IC_LEFT (ic)), LSB); + cheapMove (ASMOP_C, 0, AOP (IC_RIGHT (ic)), LSB); } emit2 ("mlt bc"); regalloc_dry_run_cost += 2; return; } - if (/*(AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == D_IDX && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == E_IDX || - AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == E_IDX && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == D_IDX) &&*/ - (resultsize > 1 ? result->aopu.aop_reg[1]->rIdx == D_IDX : !bitVectBitValue (ic->rSurv, D_IDX)) && result->aopu.aop_reg[0]->rIdx == E_IDX) + if ((resultsize > 1 ? result->aopu.aop_reg[1]->rIdx == D_IDX : !bitVectBitValue (ic->rSurv, D_IDX)) + && result->aopu.aop_reg[0]->rIdx == E_IDX) { - if(AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == E_IDX || - AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == D_IDX) + if (AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == E_IDX || + AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == D_IDX) { - cheapMove(ASMOP_E, 0, AOP (IC_LEFT (ic)), LSB); - cheapMove(ASMOP_D, 0, AOP (IC_RIGHT (ic)), LSB); + cheapMove (ASMOP_E, 0, AOP (IC_LEFT (ic)), LSB); + cheapMove (ASMOP_D, 0, AOP (IC_RIGHT (ic)), LSB); } else { - cheapMove(ASMOP_D, 0, AOP (IC_LEFT (ic)), LSB); - cheapMove(ASMOP_E, 0, AOP (IC_RIGHT (ic)), LSB); + cheapMove (ASMOP_D, 0, AOP (IC_LEFT (ic)), LSB); + cheapMove (ASMOP_E, 0, AOP (IC_RIGHT (ic)), LSB); } emit2 ("mlt de"); regalloc_dry_run_cost += 2; return; } if (AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && - ((AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == H_IDX && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == L_IDX || - AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == L_IDX && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == H_IDX) && - (resultsize > 1 ? result->aopu.aop_reg[1]->rIdx == H_IDX : !bitVectBitValue (ic->rSurv, H_IDX)) && result->aopu.aop_reg[0]->rIdx == L_IDX)) + ((AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == H_IDX && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == L_IDX || + AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == L_IDX && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == H_IDX) && + (resultsize > 1 ? result->aopu.aop_reg[1]->rIdx == H_IDX : !bitVectBitValue (ic->rSurv, H_IDX)) + && result->aopu.aop_reg[0]->rIdx == L_IDX)) { emit2 ("mlt hl"); regalloc_dry_run_cost += 2; @@ -5416,9 +5824,9 @@ _push (PAIR_DE); _G.stack.pushedDE = TRUE; } - if (IS_R2K && !isPairDead (PAIR_BC, ic) || - !IS_Z180 && (!z80_opts.oldralloc && bitVectBitValue (ic->rSurv, B_IDX) || - z80_opts.oldralloc && bitVectBitValue (ic->rMask, B_IDX) && !(getPairId (AOP (IC_RESULT (ic))) == PAIR_BC))) + if (IS_RAB && !isPairDead (PAIR_BC, ic) || + !IS_Z180 && (!options.oldralloc && bitVectBitValue (ic->rSurv, B_IDX) || + options.oldralloc && bitVectBitValue (ic->rMask, B_IDX) && !(getPairId (AOP (IC_RESULT (ic))) == PAIR_BC))) { _push (PAIR_BC); savedB = TRUE; @@ -5426,7 +5834,8 @@ // genMult() already swapped operands if necessary. if (AOP_TYPE (IC_LEFT (ic)) == AOP_REG && AOP (IC_LEFT (ic))->aopu.aop_reg[0]->rIdx == E_IDX || - AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == H_IDX && !requiresHL (AOP (IC_LEFT (ic)))) + AOP_TYPE (IC_RIGHT (ic)) == AOP_REG && AOP (IC_RIGHT (ic))->aopu.aop_reg[0]->rIdx == H_IDX + && !requiresHL (AOP (IC_LEFT (ic)))) { cheapMove (ASMOP_E, 0, AOP (IC_LEFT (ic)), LSB); cheapMove (ASMOP_H, 0, AOP (IC_RIGHT (ic)), LSB); @@ -5443,10 +5852,10 @@ emit2 ("mlt hl"); regalloc_dry_run_cost += 3; } - else if(IS_R2K) + else if (IS_RAB) { emit2 ("ld c, h"); - emit2 ("ld d, #0x00"); + emit2 ("ld d, !immedbyte", 0x00); emit2 ("ld b, d"); emit2 ("mul"); emit2 ("ld l, c"); @@ -5457,22 +5866,22 @@ { tlbl1 = newiTempLabel (NULL); tlbl2 = newiTempLabel (NULL); - emit2 ("ld l,#0x00"); - emit2 ("ld d,l"); - emit2 ("ld b,#0x08"); - emitLabelNoSpill (tlbl1->key + 100); + emit2 ("ld l, !immedbyte", 0x00); + emit2 ("ld d, l"); + emit2 ("ld b, !immedbyte", 0x08); + emitLabel (tlbl1); emit2 ("add hl,hl"); - emit2 ("jp NC,!tlabel", tlbl2->key + 100); + emit2 ("jp NC,!tlabel", labelKey2num (tlbl2->key)); emit2 ("add hl,de"); - emitLabelNoSpill (tlbl2->key + 100); - emit2 ("djnz !tlabel", tlbl1->key + 100); + emitLabel (tlbl2); + emit2 ("djnz !tlabel", labelKey2num (tlbl1->key)); regalloc_dry_run_cost += 12; } else regalloc_dry_run_cost += 12; - spillPair(PAIR_HL); + spillPair (PAIR_HL); if (savedB) { @@ -5484,38 +5893,38 @@ _G.stack.pushedDE = FALSE; } - if(result->type != AOP_HL) + if (result->type != AOP_HL) { - if (resultsize == 1) - cheapMove (result, 0, ASMOP_L, 0); - else - commitPair (result, PAIR_HL); + if (resultsize == 1) + cheapMove (result, 0, ASMOP_L, 0); + else + commitPair (result, PAIR_HL, ic, FALSE); } else { - if (resultsize == 1) - { - emit2("ld a, l"); - regalloc_dry_run_cost += 1; - cheapMove (result, 0, ASMOP_A, 0); - } - else - { - if(!isPairDead (PAIR_DE, ic)) - { - _push (PAIR_DE); - _G.stack.pushedDE = TRUE; - } - emit2("ld e, l"); - emit2("ld d, h"); - regalloc_dry_run_cost += 2; - commitPair (result, PAIR_DE); - if(!isPairDead (PAIR_DE, ic)) - { - _pop (PAIR_DE); - _G.stack.pushedDE = FALSE; - } - } + if (resultsize == 1) + { + emit2 ("ld a, l"); + regalloc_dry_run_cost += 1; + cheapMove (result, 0, ASMOP_A, 0); + } + else + { + if (!isPairDead (PAIR_DE, ic)) + { + _push (PAIR_DE); + _G.stack.pushedDE = TRUE; + } + emit2 ("ld e, l"); + emit2 ("ld d, h"); + regalloc_dry_run_cost += 2; + commitPair (result, PAIR_DE, ic, FALSE); + if (!isPairDead (PAIR_DE, ic)) + { + _pop (PAIR_DE); + _G.stack.pushedDE = FALSE; + } + } } } @@ -5523,7 +5932,7 @@ /* genMult - generates code for multiplication */ /*-----------------------------------------------------------------*/ static void -genMult (iCode *ic) +genMult (iCode * ic) { int val; int count, i; @@ -5536,11 +5945,9 @@ aopOp (IC_RIGHT (ic), ic, FALSE, FALSE); aopOp (IC_RESULT (ic), ic, TRUE, FALSE); - byteResult = (AOP_SIZE (IC_RESULT (ic)) == 1); + byteResult = (AOP_SIZE (IC_RESULT (ic)) == 1); - if (AOP_SIZE (IC_LEFT (ic)) > 2 || - AOP_SIZE (IC_RIGHT (ic)) > 2 || - AOP_SIZE (IC_RESULT (ic)) > 2) + if (AOP_SIZE (IC_LEFT (ic)) > 2 || AOP_SIZE (IC_RIGHT (ic)) > 2 || AOP_SIZE (IC_RESULT (ic)) > 2) { wassertl (0, "Multiplication is handled through support function calls."); } @@ -5561,18 +5968,19 @@ wassertl (AOP_TYPE (IC_RIGHT (ic)) == AOP_LIT, "Right must be a literal."); - val = (int) ulFromVal ( AOP (IC_RIGHT (ic))->aopu.aop_lit); + val = (int) ulFromVal (AOP (IC_RIGHT (ic))->aopu.aop_lit); // wassertl (val > 0, "Multiply must be positive"); wassertl (val != 1, "Can't multiply by 1"); - if (!IS_GB && (byteResult ? bitVectBitValue (ic->rSurv, E_IDX) : !isPairDead (PAIR_DE, ic))) { - _push (PAIR_DE); - _G.stack.pushedDE = TRUE; - } + if (!IS_GB && (byteResult ? bitVectBitValue (ic->rSurv, E_IDX) : !isPairDead (PAIR_DE, ic))) + { + _push (PAIR_DE); + _G.stack.pushedDE = TRUE; + } if (byteResult) cheapMove (ASMOP_A, 0, AOP (IC_LEFT (ic)), LSB); - else if ( AOP_SIZE (IC_LEFT (ic)) == 1 && !SPEC_USIGN (getSpec (operandType ( IC_LEFT (ic))))) + else if (AOP_SIZE (IC_LEFT (ic)) == 1 && !SPEC_USIGN (getSpec (operandType (IC_LEFT (ic))))) { cheapMove (ASMOP_E, 0, AOP (IC_LEFT (ic)), LSB); if (!byteResult) @@ -5625,7 +6033,7 @@ i <<= 1; } - spillPair(PAIR_HL); + spillPair (PAIR_HL); if (!IS_GB && _G.stack.pushedDE) { @@ -5636,7 +6044,7 @@ if (byteResult) cheapMove (AOP (IC_RESULT (ic)), 0, ASMOP_A, 0); else - commitPair ( AOP (IC_RESULT (ic)), PAIR_HL); + commitPair (AOP (IC_RESULT (ic)), PAIR_HL, ic, FALSE); release: freeAsmop (IC_LEFT (ic), NULL, ic); @@ -5648,7 +6056,7 @@ /* genDiv - generates code for division */ /*-----------------------------------------------------------------*/ static void -genDiv (const iCode *ic) +genDiv (const iCode * ic) { /* Shouldn't occur - all done through function calls */ wassertl (0, "Division is handled through support function calls"); @@ -5658,7 +6066,7 @@ /* genMod - generates code for division */ /*-----------------------------------------------------------------*/ static void -genMod (const iCode *ic) +genMod (const iCode * ic) { /* Shouldn't occur - all done through function calls */ wassert (0); @@ -5668,7 +6076,7 @@ /* genIfxJump :- will create a jump depending on the ifx */ /*-----------------------------------------------------------------*/ static void -genIfxJump (iCode *ic, char *jval) +genIfxJump (iCode * ic, char *jval) { symbol *jlbl; const char *inst; @@ -5683,6 +6091,14 @@ emit3 (A_OR, ASMOP_A, ASMOP_A); inst = "NZ"; } + else if (!strcmp (jval, "z")) + { + inst = "Z"; + } + else if (!strcmp (jval, "nz")) + { + inst = "NZ"; + } else if (!strcmp (jval, "c")) { inst = "C"; @@ -5724,6 +6140,14 @@ emit3 (A_OR, ASMOP_A, ASMOP_A); inst = "Z"; } + else if (!strcmp (jval, "z")) + { + inst = "NZ"; + } + else if (!strcmp (jval, "nz")) + { + inst = "Z"; + } else if (!strcmp (jval, "c")) { inst = "NC"; @@ -5757,12 +6181,12 @@ } } /* Z80 can do a conditional long jump */ - if(!regalloc_dry_run) - emit2 ("jp %s,!tlabel", inst, jlbl->key + 100); + if (!regalloc_dry_run) + emit2 ("jp %s,!tlabel", inst, labelKey2num (jlbl->key)); regalloc_dry_run_cost += 3; /* mark the icode as generated */ - if(!regalloc_dry_run) + if (!regalloc_dry_run) ic->generated = 1; } @@ -5777,16 +6201,14 @@ /** Generic compare for > or < */ static void -genCmp (operand * left, operand * right, - operand * result, iCode * ifx, int sign) +genCmp (operand * left, operand * right, operand * result, iCode * ifx, int sign, const iCode * ic) { int size, offset = 0; unsigned long lit = 0L; bool result_in_carry = FALSE; /* if left & right are bit variables */ - if (AOP_TYPE (left) == AOP_CRY && - AOP_TYPE (right) == AOP_CRY) + if (AOP_TYPE (left) == AOP_CRY && AOP_TYPE (right) == AOP_CRY) { /* Can't happen on the Z80 */ wassertl (0, "Tried to compare two bits"); @@ -5796,110 +6218,167 @@ /* Do a long subtract of right from left. */ size = max (AOP_SIZE (left), AOP_SIZE (right)); + if (AOP_TYPE (right) == AOP_SFR) /* Avoid overwriting A */ + { + bool save_a, save_b, save_bc; + wassertl (size == 1, "Right side sfr in comparison with more than 8 bits."); + + save_b = bitVectBitValue (ic->rSurv, B_IDX); + save_bc = (save_b && bitVectBitValue (ic->rSurv, C_IDX)); + save_a = ((AOP_TYPE (left) == AOP_ACC) || + AOP_TYPE (left) == AOP_REG && AOP (left)->aopu.aop_reg[0]->rIdx == B_IDX && save_b || + AOP_TYPE (left) == AOP_REG && AOP (left)->aopu.aop_reg[0]->rIdx == C_IDX && !save_b && save_bc); + + if (save_bc) + _push (PAIR_BC); + if (save_a) + { + cheapMove (ASMOP_A, 0, AOP (right), 0); + _push (PAIR_AF); + } + else + cheapMove (ASMOP_A, 0, AOP (right), 0); + cheapMove (save_b ? ASMOP_C : ASMOP_B, 0, ASMOP_A, 0); + if (save_a) + _pop (PAIR_AF); + else + cheapMove (ASMOP_A, 0, AOP (left), 0); + emit3_o (A_SUB, ASMOP_A, 0, save_b ? ASMOP_C : ASMOP_B, offset); + if (save_bc) + _pop (PAIR_BC); + result_in_carry = TRUE; + goto fix; + } + // On the Gameboy we can't afford to adjust HL as it may trash the carry. - if (size > 1 && IS_GB && (requiresHL(AOP(right)) && requiresHL(AOP(left)))) + if (size > 1 && IS_GB && (requiresHL (AOP (right)) && requiresHL (AOP (left)))) { // Pull left into DE and right into HL - aopGet (AOP(left), LSB, FALSE); - emit2 ("ld d, h"); - emit2 ("ld e, l"); - aopGet (AOP(right), LSB, FALSE); + if (!regalloc_dry_run) + { + aopGet (AOP (left), LSB, FALSE); + emit2 ("ld d, h"); + emit2 ("ld e, l"); + aopGet (AOP (right), LSB, FALSE); + } while (size--) { emit2 ("ld a, (de)"); emit2 ("%s a, (hl)", offset == 0 ? "sub" : "sbc"); + regalloc_dry_run_cost += 2; if (size != 0) { emit2 ("inc hl"); emit2 ("inc de"); + regalloc_dry_run_cost += 2; } offset++; } - if(sign) + if (sign) { - emit2("ld a, (de)"); - emit2("ld d, a"); - emit2("ld e, (hl)"); + emit2 ("ld a, (de)"); + emit2 ("ld d, a"); + emit2 ("ld e, (hl)"); + regalloc_dry_run_cost += 3; } spillPair (PAIR_HL); result_in_carry = TRUE; goto fix; } - else if (size > 1 && IS_GB && (requiresHL(AOP(right)) && !requiresHL(AOP(left)))) + else if (size > 1 && IS_GB && (requiresHL (AOP (right)) && !requiresHL (AOP (left)))) { - aopGet (AOP(right), LSB, FALSE); + if (!regalloc_dry_run) + aopGet (AOP (right), LSB, FALSE); while (size--) { - emit2 ("ld a, %s", aopGet (AOP (left), offset, FALSE)); + cheapMove (ASMOP_A, 0, AOP (left), offset); emit2 ("%s a, (hl)", offset == 0 ? "sub" : "sbc"); + regalloc_dry_run_cost += 1; if (size != 0) { emit2 ("inc hl"); + regalloc_dry_run_cost += 1; } offset++; } - if(sign) + if (sign) { - emit2("ld a, %s", aopGet (AOP (left), offset, FALSE)); - emit2("ld d, a"); - emit2("ld e, (hl)"); + cheapMove (ASMOP_A, 0, AOP (left), offset - 1); + emit2 ("ld d, a"); + emit2 ("ld e, (hl)"); + regalloc_dry_run_cost += 2; } spillPair (PAIR_HL); result_in_carry = TRUE; goto fix; } - else if (size > 1 && IS_GB && (!requiresHL(AOP(right)) && requiresHL(AOP(left)))) + else if (size > 1 && IS_GB && (!requiresHL (AOP (right)) && requiresHL (AOP (left)))) { - aopGet (AOP(left), LSB, FALSE); + if (!regalloc_dry_run) + aopGet (AOP (left), LSB, FALSE); while (size--) { emit2 ("ld a, (hl)"); - emit2 ("%s a, %s", offset == 0 ? "sub" : "sbc", aopGet (AOP (right), offset, FALSE)); + regalloc_dry_run_cost += 1; + emit3_o (offset == 0 ? A_SUB : A_SBC, ASMOP_A, 0, AOP (right), offset); if (size != 0) { emit2 ("inc hl"); + regalloc_dry_run_cost += 1; } offset++; } - if(sign) - { - emit2("ld d, (hl)"); - emit2("ld a, %s", aopGet (AOP (right), offset, FALSE)); - emit2("ld e, a"); + if (sign) + { + emit2 ("ld d, (hl)"); + regalloc_dry_run_cost += 1; + cheapMove (ASMOP_A, 0, AOP (right), offset - 1); + emit2 ("ld e, a"); + regalloc_dry_run_cost += 1; } spillPair (PAIR_HL); result_in_carry = TRUE; goto fix; } - if(IS_GB && sign) + if (IS_GB && sign) { - emit2 ("ld a, %s", aopGet (AOP (right), size - 1, FALSE)); - emit2 ("ld e, a"); - emit2 ("ld a, %s", aopGet (AOP (left), size - 1, FALSE)); - emit2 ("ld d, a"); + cheapMove (ASMOP_A, 0, AOP (right), size - 1); + cheapMove (ASMOP_E, 0, ASMOP_A, 0); + cheapMove (ASMOP_A, 0, AOP (left), size - 1); + cheapMove (ASMOP_D, 0, ASMOP_A, 0); } if (AOP_TYPE (right) == AOP_LIT) { lit = ulFromVal (AOP (right)->aopu.aop_lit); + /* optimize if(x < 0) or if(x >= 0) */ if (lit == 0) { if (!sign) { /* No sign so it's always false */ - _clearCarry(); + _clearCarry (); result_in_carry = TRUE; } else { + if (!(AOP_TYPE (result) == AOP_CRY && AOP_SIZE (result)) && ifx && + (AOP_TYPE (left) == AOP_REG || AOP_TYPE (left) == AOP_STK && !IS_GB)) + { + if (!regalloc_dry_run) + emit2 ("bit 7, %s", aopGet (AOP (left), AOP_SIZE (left) - 1, FALSE)); + regalloc_dry_run_cost += ((AOP_TYPE (left) == AOP_REG) ? 2 : 4); + genIfxJump (ifx, "nz"); + return; + } /* Just load in the top most bit */ cheapMove (ASMOP_A, 0, AOP (left), AOP_SIZE (left) - 1); if (!(AOP_TYPE (result) == AOP_CRY && AOP_SIZE (result)) && ifx) @@ -5919,12 +6398,69 @@ } goto release; } - else - while (!((lit >> (offset * 8)) & 0xff)) - { - size--; - offset++; - } + + while (!((lit >> (offset * 8)) & 0xff)) + { + size--; + offset++; + } + + if (sign) /* Map signed operands to unsigned ones. This pre-subtraction workaroud to lack of signed comparison is cheaper than the post-subtraction one at fix. */ + { + if (size == 2 && !(IS_GB || !ifx && requiresHL(AOP(result)) && AOP_TYPE (result) != AOP_REG) && isPairDead (PAIR_HL, ic) && (isPairDead (PAIR_DE, ic) || isPairDead (PAIR_BC, ic)) && (getPairId (AOP (left)) == PAIR_HL || IS_RAB && (AOP_TYPE (left) == AOP_STK || AOP_TYPE (left) == AOP_EXSTK))) + { + PAIR_ID litpair = (isPairDead (PAIR_DE, ic) ? PAIR_DE : PAIR_BC); + fetchPair (PAIR_HL, AOP (left)); + emit2 ("ld %s, !immedbyte", _pairs[litpair].name, (lit ^ 0x8000u) & 0xffffu); + regalloc_dry_run_cost += 3; + emit2 ("add hl, hl"); + emit2 ("ccf"); + regalloc_dry_run_cost += 2; + if (IS_RAB) + { + emit2 ("rr hl"); + regalloc_dry_run_cost += 1; + } + else + { + emit2 ("rr h"); + emit2 ("rr l"); + regalloc_dry_run_cost += 2; + } + emit2 ("sbc hl, %s", _pairs[litpair].name); + regalloc_dry_run_cost += 2; + result_in_carry = TRUE; + goto release; + } + + cheapMove (ASMOP_A, 0, AOP (left), offset); + if (size == 1) + { + emit2 ("xor a, !immedbyte", 0x80); + regalloc_dry_run_cost += 2; + } + emit2 ("sub a, !immedbyte", ((lit >> (offset * 8)) & 0xff) ^ (size == 1 ? 0x80 : 0x00)); + regalloc_dry_run_cost += 2; + size--; + offset++; + + while (size--) + { + cheapMove (ASMOP_A, 0, AOP (left), offset); + if (!size) + { + emit2 ("rla"); + emit2 ("ccf"); + emit2 ("rra"); + regalloc_dry_run_cost += 3; + } + /* Subtract through, propagating the carry */ + emit2 ("sbc a, !immedbyte", ((lit >> (offset++ * 8)) & 0xff) ^ (size ? 0x00 : 0x80)); + regalloc_dry_run_cost += 2; + } + result_in_carry = TRUE; + goto release; + } } cheapMove (ASMOP_A, 0, AOP (left), offset); @@ -5943,39 +6479,41 @@ /* There is no good signed compare in the Z80, so we need workarounds */ if (sign) { - if (!IS_GB) /* Directly check for overflow, can't be done on GBZ80 */ + if (!IS_GB) /* Directly check for overflow, can't be done on GBZ80 */ { - symbol *tlbl; if (!regalloc_dry_run) { - tlbl = newiTempLabel (NULL); - emit2 ("jp PO, !tlabel", tlbl->key + 100); + symbol *tlbl = newiTempLabel (NULL); + emit2 ("jp PO, !tlabel", labelKey2num (tlbl->key)); emit2 ("xor a, !immedbyte", 0x80); + emitLabelSpill (tlbl); } regalloc_dry_run_cost += 5; - if (!regalloc_dry_run) - emitLabel (tlbl->key + 100); result_in_carry = FALSE; } - else /* Do it the hard way */ + else /* Do it the hard way */ { /* Test if one operand is negative, while the other is not. If this is the case we can easily decide which one is greater, and we set/reset the carry flag. If not, then the unsigned compare gave the correct result and we don't change the carry flag. */ - symbol *tlbl1 = newiTempLabel (NULL); - symbol *tlbl2 = newiTempLabel (NULL); - emit2 ("bit 7, e"); - emit2 ("jp Z, !tlabel", tlbl1->key + 100); - emit2 ("bit 7, d"); - emit2 ("jp NZ, !tlabel", tlbl2->key + 100); - emit2 ("cp a, a"); - emit2 ("jp !tlabel", tlbl2->key + 100); - emitLabel (tlbl1->key + 100); - emit2 ("bit 7, d"); - emit2 ("jp Z, !tlabel", tlbl2->key + 100); - emit2 ("scf"); - emitLabel (tlbl2->key + 100); + if (!regalloc_dry_run) + { + symbol *tlbl1 = newiTempLabel (NULL); + symbol *tlbl2 = newiTempLabel (NULL); + emit2 ("bit 7, e"); + emit2 ("jp Z, !tlabel", labelKey2num (tlbl1->key)); + emit2 ("bit 7, d"); + emit2 ("jp NZ, !tlabel", labelKey2num (tlbl2->key)); + emit2 ("cp a, a"); + emit2 ("jp !tlabel", labelKey2num (tlbl2->key)); + emitLabelSpill (tlbl1); + emit2 ("bit 7, d"); + emit2 ("jp Z, !tlabel", labelKey2num (tlbl2->key)); + emit2 ("scf"); + emitLabelSpill (tlbl2); + } + regalloc_dry_run_cost += 20; result_in_carry = TRUE; } } @@ -6003,11 +6541,11 @@ { if (!result_in_carry) { - if(!IS_GB) + if (!IS_GB) genIfxJump (ifx, "m"); else { - emit2("rlca"); + emit2 ("rlca"); regalloc_dry_run_cost += 1; genIfxJump (ifx, "c"); } @@ -6033,7 +6571,7 @@ /* genCmpGt :- greater than comparison */ /*-----------------------------------------------------------------*/ static void -genCmpGt (iCode *ic, iCode *ifx) +genCmpGt (iCode * ic, iCode * ifx) { operand *left, *right, *result; sym_link *letype, *retype; @@ -6043,9 +6581,14 @@ right = IC_RIGHT (ic); result = IC_RESULT (ic); - letype = getSpec (operandType (left)); - retype = getSpec (operandType (right)); - sign = !(SPEC_USIGN (letype) | SPEC_USIGN (retype)); + sign = 0; + if (IS_SPEC (operandType (left)) && IS_SPEC (operandType (right))) + { + letype = getSpec (operandType (left)); + retype = getSpec (operandType (right)); + sign = !(SPEC_USIGN (letype) | SPEC_USIGN (retype)); + } + /* assign the asmops */ aopOp (left, ic, FALSE, FALSE); aopOp (right, ic, FALSE, FALSE); @@ -6053,7 +6596,7 @@ setupToPreserveCarry (ic); - genCmp (right, left, result, ifx, sign); + genCmp (right, left, result, ifx, sign, ic); _G.preserveCarry = FALSE; freeAsmop (left, NULL, ic); @@ -6065,7 +6608,7 @@ /* genCmpLt - less than comparisons */ /*-----------------------------------------------------------------*/ static void -genCmpLt (iCode *ic, iCode *ifx) +genCmpLt (iCode * ic, iCode * ifx) { operand *left, *right, *result; sym_link *letype, *retype; @@ -6075,9 +6618,13 @@ right = IC_RIGHT (ic); result = IC_RESULT (ic); - letype = getSpec (operandType (left)); - retype = getSpec (operandType (right)); - sign = !(SPEC_USIGN (letype) | SPEC_USIGN (retype)); + sign = 0; + if (IS_SPEC (operandType (left)) && IS_SPEC (operandType (right))) + { + letype = getSpec (operandType (left)); + retype = getSpec (operandType (right)); + sign = !(SPEC_USIGN (letype) | SPEC_USIGN (retype)); + } /* assign the asmops */ aopOp (left, ic, FALSE, FALSE); @@ -6086,7 +6633,7 @@ setupToPreserveCarry (ic); - genCmp (left, right, result, ifx, sign); + genCmp (left, right, result, ifx, sign, ic); _G.preserveCarry = FALSE; freeAsmop (left, NULL, ic); @@ -6127,8 +6674,8 @@ } else emit3 (A_OR, ASMOP_A, ASMOP_A); - if(!regalloc_dry_run) - emit2 ("jp NZ,!tlabel", lbl->key + 100); + if (!regalloc_dry_run) + emit2 ("jp NZ,!tlabel", labelKey2num (lbl->key)); regalloc_dry_run_cost += 3; } else @@ -6136,12 +6683,12 @@ while (size--) { cheapMove (ASMOP_A, 0, AOP (left), offset); - if ((unsigned int) ((lit >> (offset * 8)) & 0x0FFL) == 0) + if (byteOfVal (AOP (right)->aopu.aop_lit, offset) == 0) emit3 (A_OR, ASMOP_A, ASMOP_A); else emit3_o (A_SUB, ASMOP_A, 0, AOP (right), offset); if (!regalloc_dry_run) - emit2 ("jp NZ,!tlabel", lbl->key + 100); + emit2 ("jp NZ,!tlabel", labelKey2num (lbl->key)); regalloc_dry_run_cost += 3; offset++; } @@ -6150,29 +6697,28 @@ /* if the right side is in a register or pointed to by HL, IX or IY */ else if (AOP_TYPE (right) == AOP_REG || - AOP_TYPE (right) == AOP_HL || - AOP_TYPE (right) == AOP_IY || + AOP_TYPE (right) == AOP_HL || + AOP_TYPE (right) == AOP_IY || AOP_TYPE (right) == AOP_STK || - AOP_IS_PAIRPTR (right, PAIR_HL) || - AOP_IS_PAIRPTR (right, PAIR_IX) || - AOP_IS_PAIRPTR (right, PAIR_IY)) + AOP_TYPE (right) == AOP_EXSTK || + AOP_TYPE (right) == AOP_IMMD || + AOP_IS_PAIRPTR (right, PAIR_HL) || AOP_IS_PAIRPTR (right, PAIR_IX) || AOP_IS_PAIRPTR (right, PAIR_IY)) { while (size--) { cheapMove (ASMOP_A, 0, AOP (left), offset); - if (AOP_TYPE (right) == AOP_LIT && - ((unsigned int) ((lit >> (offset * 8)) & 0x0FFL) == 0)) + if (AOP_TYPE (right) == AOP_LIT && byteOfVal (AOP (right)->aopu.aop_lit, offset) == 0) { emit3 (A_OR, ASMOP_A, ASMOP_A); if (!regalloc_dry_run) - emit2 ("jp NZ,!tlabel", lbl->key + 100); + emit2 ("jp NZ,!tlabel", labelKey2num (lbl->key)); regalloc_dry_run_cost += 3; } else { emit3_o (A_SUB, ASMOP_A, 0, AOP (right), offset); if (!regalloc_dry_run) - emit2 ("jp NZ,!tlabel", lbl->key + 100); + emit2 ("jp NZ,!tlabel", labelKey2num (lbl->key)); regalloc_dry_run_cost += 3; } offset++; @@ -6184,7 +6730,7 @@ PAIR_ID pair; for (pair = PAIR_BC; pair <= PAIR_HL; pair++) { - if (((AOP_TYPE (left) != AOP_PAIRPTR) || (AOP (left)->aopu.aop_pairId != pair)) && + if (((AOP_TYPE (left) != AOP_PAIRPTR) || (AOP (left)->aopu.aop_pairId != pair)) && ((AOP_TYPE (right) != AOP_PAIRPTR) || (AOP (right)->aopu.aop_pairId != pair))) { break; @@ -6193,16 +6739,15 @@ _push (pair); while (size--) { - emit2 ("; direct compare"); - if(!regalloc_dry_run) + if (!regalloc_dry_run) _emitMove (_pairs[pair].l, aopGet (AOP (left), offset, FALSE)); else - regalloc_dry_run_cost += ld_cost(ASMOP_E, AOP (left)); + regalloc_dry_run_cost += ld_cost (ASMOP_E, AOP (left)); cheapMove (ASMOP_A, 0, AOP (right), offset); emit2 ("sub a,%s", _pairs[pair].l); regalloc_dry_run_cost += 1; - if(!regalloc_dry_run) - emit2 ("jp NZ,!tlabel", lbl->key + 100); + if (!regalloc_dry_run) + emit2 ("jp NZ,!tlabel", labelKey2num (lbl->key)); regalloc_dry_run_cost += 3; offset++; } @@ -6226,10 +6771,10 @@ if (!regalloc_dry_run) { emit2 ("ld a,!one"); - emit2 ("jp !tlabel", tlbl->key + 100); - emitLabel (lbl->key + 100); + emit2 ("jp !tlabel", labelKey2num (tlbl->key)); + emitLabelSpill (lbl); emit2 ("xor a,a"); - emitLabelNoSpill (tlbl->key + 100); + emitLabel (tlbl); } regalloc_dry_run_cost += 6; _pop (pop); @@ -6248,14 +6793,17 @@ aopOp ((right = IC_RIGHT (ic)), ic, FALSE, FALSE); aopOp ((result = IC_RESULT (ic)), ic, TRUE, FALSE); - hl_touched = (AOP_TYPE (IC_LEFT (ic)) == AOP_HL || AOP_TYPE (IC_RIGHT (ic)) == AOP_HL); + hl_touched = (AOP_TYPE (IC_LEFT (ic)) == AOP_HL || AOP_TYPE (IC_RIGHT (ic)) == AOP_HL || IS_GB + && AOP_TYPE (IC_LEFT (ic)) == AOP_STK || IS_GB && AOP_TYPE (IC_RIGHT (ic)) == AOP_STK); - emitDebug ("; genCmpEq: left %u, right %u, result %u", AOP_SIZE(IC_LEFT(ic)), AOP_SIZE(IC_RIGHT(ic)), AOP_SIZE(IC_RESULT(ic))); + emitDebug ("; genCmpEq: left %u, right %u, result %u", AOP_SIZE (IC_LEFT (ic)), AOP_SIZE (IC_RIGHT (ic)), + AOP_SIZE (IC_RESULT (ic))); /* Swap operands if it makes the operation easier. ie if: 1. Left is a literal. */ - if (AOP_TYPE (IC_LEFT (ic)) == AOP_LIT) + if (AOP_TYPE (IC_LEFT (ic)) == AOP_LIT || AOP_TYPE (IC_RIGHT (ic)) != AOP_LIT && AOP_TYPE (IC_RIGHT (ic)) != AOP_REG + && AOP_TYPE (IC_LEFT (ic)) == AOP_REG) { operand *t = IC_RIGHT (ic); IC_RIGHT (ic) = IC_LEFT (ic); @@ -6265,8 +6813,7 @@ if (ifx && !AOP_SIZE (result)) { /* if they are both bit variables */ - if (AOP_TYPE (left) == AOP_CRY && - ((AOP_TYPE (right) == AOP_CRY) || (AOP_TYPE (right) == AOP_LIT))) + if (AOP_TYPE (left) == AOP_CRY && ((AOP_TYPE (right) == AOP_CRY) || (AOP_TYPE (right) == AOP_LIT))) { wassertl (0, "Tried to compare two bits"); } @@ -6277,41 +6824,41 @@ pop = gencjneshort (left, right, tlbl); if (IC_TRUE (ifx)) { - if(pop != PAIR_INVALID) + if (pop != PAIR_INVALID) { emit2 ("pop %s", _pairs[pop].name); regalloc_dry_run_cost += 1; } - if(!regalloc_dry_run) - emit2 ("jp !tlabel", IC_TRUE (ifx)->key + 100); + if (!regalloc_dry_run) + emit2 ("jp !tlabel", labelKey2num (IC_TRUE (ifx)->key)); regalloc_dry_run_cost += 3; - if(!regalloc_dry_run) - hl_touched ? emitLabel (tlbl->key + 100) : emitLabelNoSpill (tlbl->key + 100); - else if(hl_touched) - spillCached(); + if (!regalloc_dry_run) + hl_touched ? emitLabelSpill (tlbl) : emitLabel (tlbl); + else if (hl_touched) + spillCached (); _pop (pop); } else { /* PENDING: do this better */ symbol *lbl = regalloc_dry_run ? 0 : newiTempLabel (0); - if(pop != PAIR_INVALID) + if (pop != PAIR_INVALID) { emit2 ("pop %s", _pairs[pop].name); regalloc_dry_run_cost += 1; } - if(!regalloc_dry_run) - emit2 ("jp !tlabel", lbl->key + 100); + if (!regalloc_dry_run) + emit2 ("jp !tlabel", labelKey2num (lbl->key)); regalloc_dry_run_cost += 3; if (!regalloc_dry_run) - hl_touched ? emitLabel (tlbl->key + 100) : emitLabelNoSpill (tlbl->key + 100); + hl_touched ? emitLabelSpill (tlbl) : emitLabel (tlbl); else if (hl_touched) - spillCached(); + spillCached (); _pop (pop); - if(!regalloc_dry_run) + if (!regalloc_dry_run) { - emit2 ("jp !tlabel", IC_FALSE (ifx)->key + 100); - emitLabelNoSpill (lbl->key + 100); + emit2 ("jp !tlabel", labelKey2num (IC_FALSE (ifx)->key)); + emitLabel (lbl); } regalloc_dry_run_cost += 3; } @@ -6322,8 +6869,7 @@ } /* if they are both bit variables */ - if (AOP_TYPE (left) == AOP_CRY && - ((AOP_TYPE (right) == AOP_CRY) || (AOP_TYPE (right) == AOP_LIT))) + if (AOP_TYPE (left) == AOP_CRY && ((AOP_TYPE (right) == AOP_CRY) || (AOP_TYPE (right) == AOP_LIT))) { wassertl (0, "Tried to compare a bit to either a literal or another bit"); } @@ -6342,7 +6888,7 @@ /* if the result is used in an arithmetic operation then put the result in place */ if (AOP_TYPE (result) != AOP_CRY) - outAcc (result); + outAcc (result); /* leave the result in acc */ } @@ -6353,32 +6899,10 @@ } /*-----------------------------------------------------------------*/ -/* ifxForOp - returns the icode containing the ifx for operand */ -/*-----------------------------------------------------------------*/ -iCode * -ifxForOp (operand *op, const iCode *ic) -{ - /* if true symbol then needs to be assigned */ - if (IS_TRUE_SYMOP (op)) - return NULL; - - /* if this has register type condition and - the next instruction is ifx with the same operand - and live to of the operand is upto the ifx only then */ - if (ic->next && - ic->next->op == IFX && - IC_COND (ic->next)->key == op->key && - OP_SYMBOL (op)->liveTo <= ic->next->seq) - return ic->next; - - return NULL; -} - -/*-----------------------------------------------------------------*/ /* genAndOp - for && operation */ /*-----------------------------------------------------------------*/ static void -genAndOp (const iCode *ic) +genAndOp (const iCode * ic) { operand *left, *right, *result; @@ -6390,8 +6914,7 @@ aopOp ((result = IC_RESULT (ic)), ic, FALSE, FALSE); /* if both are bit variables */ - if (AOP_TYPE (left) == AOP_CRY && - AOP_TYPE (right) == AOP_CRY) + if (AOP_TYPE (left) == AOP_CRY && AOP_TYPE (right) == AOP_CRY) { wassertl (0, "Tried to and two bits"); } @@ -6400,11 +6923,11 @@ symbol *tlbl = regalloc_dry_run ? 0 : newiTempLabel (0); _toBoolean (left, TRUE); if (!regalloc_dry_run) - emit2 ("jp Z,!tlabel", tlbl->key + 100); + emit2 ("jp Z,!tlabel", labelKey2num (tlbl->key)); regalloc_dry_run_cost += 3; _toBoolean (right, FALSE); if (!regalloc_dry_run) - emitLabelNoSpill (tlbl->key + 100); + emitLabel (tlbl); outBitAcc (result); } @@ -6417,7 +6940,7 @@ /* genOrOp - for || operation */ /*-----------------------------------------------------------------*/ static void -genOrOp (const iCode *ic) +genOrOp (const iCode * ic) { operand *left, *right, *result; @@ -6429,8 +6952,7 @@ aopOp ((result = IC_RESULT (ic)), ic, FALSE, FALSE); /* if both are bit variables */ - if (AOP_TYPE (left) == AOP_CRY && - AOP_TYPE (right) == AOP_CRY) + if (AOP_TYPE (left) == AOP_CRY && AOP_TYPE (right) == AOP_CRY) { wassertl (0, "Tried to OR two bits"); } @@ -6439,11 +6961,11 @@ symbol *tlbl = regalloc_dry_run ? 0 : newiTempLabel (0); _toBoolean (left, TRUE); if (!regalloc_dry_run) - emit2 ("jp NZ,!tlabel", tlbl->key + 100); + emit2 ("jp NZ,!tlabel", labelKey2num (tlbl->key)); regalloc_dry_run_cost += 3; _toBoolean (right, FALSE); if (!regalloc_dry_run) - emitLabelNoSpill (tlbl->key + 100); + emitLabel (tlbl); outBitAcc (result); } @@ -6459,13 +6981,15 @@ isLiteralBit (unsigned long lit) { unsigned long pw[32] = - {1L, 2L, 4L, 8L, 16L, 32L, 64L, 128L, - 0x100L, 0x200L, 0x400L, 0x800L, - 0x1000L, 0x2000L, 0x4000L, 0x8000L, - 0x10000L, 0x20000L, 0x40000L, 0x80000L, - 0x100000L, 0x200000L, 0x400000L, 0x800000L, - 0x1000000L, 0x2000000L, 0x4000000L, 0x8000000L, - 0x10000000L, 0x20000000L, 0x40000000L, 0x80000000L}; + { + 1L, 2L, 4L, 8L, 16L, 32L, 64L, 128L, + 0x100L, 0x200L, 0x400L, 0x800L, + 0x1000L, 0x2000L, 0x4000L, 0x8000L, + 0x10000L, 0x20000L, 0x40000L, 0x80000L, + 0x100000L, 0x200000L, 0x400000L, 0x800000L, + 0x1000000L, 0x2000000L, 0x4000000L, 0x8000000L, + 0x10000000L, 0x20000000L, 0x40000000L, 0x80000000L + }; int idx; for (idx = 0; idx < 32; idx++) @@ -6481,32 +7005,32 @@ jmpTrueOrFalse (iCode * ic, symbol * tlbl) { // ugly but optimized by peephole - // Using emitLabel instead of emitLabelNoSpill (esp. on gbz80) + // Using emitLabelSpill instead of emitLabel (esp. on gbz80) // We could jump there from locations with different values in hl. // This should be changed to a more efficient solution that spills // only what and when necessary. if (IC_TRUE (ic)) - { - if(!regalloc_dry_run) + { + if (!regalloc_dry_run) { symbol *nlbl = newiTempLabel (NULL); - emit2 ("jp !tlabel", nlbl->key + 100); - emitLabel (tlbl->key + 100); - emit2 ("jp !tlabel", IC_TRUE (ic)->key + 100); - emitLabel (nlbl->key + 100); + emit2 ("jp !tlabel", labelKey2num (nlbl->key)); + emitLabelSpill (tlbl); + emit2 ("jp !tlabel", labelKey2num (IC_TRUE (ic)->key)); + emitLabelSpill (nlbl); } regalloc_dry_run_cost += 6; } else { - if(!regalloc_dry_run) + if (!regalloc_dry_run) { - emit2 ("jp !tlabel", IC_FALSE (ic)->key + 100); - emitLabel (tlbl->key + 100); + emit2 ("jp !tlabel", labelKey2num (IC_FALSE (ic)->key)); + emitLabelSpill (tlbl); } regalloc_dry_run_cost += 3; } - if(!regalloc_dry_run) + if (!regalloc_dry_run) ic->generated = 1; } @@ -6514,7 +7038,7 @@ /* genAnd - code for and */ /*-----------------------------------------------------------------*/ static void -genAnd (const iCode *ic, iCode * ifx) +genAnd (const iCode * ic, iCode * ifx) { operand *left, *right, *result; int size, offset = 0; @@ -6526,8 +7050,7 @@ aopOp ((result = IC_RESULT (ic)), ic, TRUE, FALSE); /* if left is a literal & right is not then exchange them */ - if ((AOP_TYPE (left) == AOP_LIT && AOP_TYPE (right) != AOP_LIT) || - (AOP_NEEDSACC (right) && !AOP_NEEDSACC (left))) + if ((AOP_TYPE (left) == AOP_LIT && AOP_TYPE (right) != AOP_LIT) || (AOP_NEEDSACC (right) && !AOP_NEEDSACC (left))) { operand *tmp = right; right = left; @@ -6543,8 +7066,7 @@ } /* if right is bit then exchange them */ - if (AOP_TYPE (right) == AOP_CRY && - AOP_TYPE (left) != AOP_CRY) + if (AOP_TYPE (right) == AOP_CRY && AOP_TYPE (left) != AOP_CRY) { operand *tmp = right; right = left; @@ -6563,7 +7085,7 @@ /* Make sure A is on the left to not overwrite it. */ if (AOP_TYPE (right) == AOP_ACC || - isPair (AOP (right)) && (getPairId (AOP (right)) == PAIR_HL || getPairId (AOP (right)) == PAIR_IY)) + isPair (AOP (right)) && (getPairId (AOP (right)) == PAIR_HL || getPairId (AOP (right)) == PAIR_IY)) { operand *tmp = right; right = left; @@ -6572,9 +7094,7 @@ // if(val & 0xZZ) - size = 0, ifx != FALSE - // bit = val & 0xZZ - size = 1, ifx = FALSE - - if ((AOP_TYPE (right) == AOP_LIT) && - (AOP_TYPE (result) == AOP_CRY) && - (AOP_TYPE (left) != AOP_CRY)) + if ((AOP_TYPE (right) == AOP_LIT) && (AOP_TYPE (result) == AOP_CRY) && (AOP_TYPE (left) != AOP_CRY)) { symbol *tlbl = regalloc_dry_run ? 0 : newiTempLabel (0); int sizel; @@ -6586,35 +7106,47 @@ emit2 ("scf"); regalloc_dry_run_cost += 1; } + /*else if(AOP_TYPE (left) == AOP_IY && !IS_GB && isLiteralBit (lit & 0xff) >= 0) + { + emit2 ("bit %d, %s", isLiteralBit (bytelit), aopGet (AOP (left), offset, FALSE)); + }*/ while (sizel--) { if ((bytelit = ((lit >> (offset * 8)) & 0x0FFL)) != 0x0L) { - cheapMove (ASMOP_A, 0, AOP (left), offset); - if (bytelit != 0x0FFL) - emit3_o (A_AND, ASMOP_A, 0, AOP (right), offset); + if (isLiteralBit (bytelit) >= 0 && ifx + && (AOP_TYPE (left) == AOP_STK || AOP_TYPE (left) == AOP_ACC || AOP_TYPE (left) == AOP_IY || AOP_TYPE (left) == AOP_REG + && AOP (left)->aopu.aop_reg[0]->rIdx != IYL_IDX)) + { + if (!regalloc_dry_run) + emit2 ("bit %d, %s", isLiteralBit (bytelit), aopGet (AOP (left), offset, FALSE)); + regalloc_dry_run_cost += AOP_TYPE (left) == AOP_STK ? 4 : 2; + } else { - /* For the flags */ - emit3 (A_OR, ASMOP_A, ASMOP_A); + cheapMove (ASMOP_A, 0, AOP (left), offset); + if (bytelit != 0x0FFL) + emit3_o (A_AND, ASMOP_A, 0, AOP (right), offset); + else + emit3 (A_OR, ASMOP_A, ASMOP_A); /* For the flags */ } if (size || ifx) /* emit jmp only, if it is actually used */ { if (!regalloc_dry_run) - emit2 ("jp NZ,!tlabel", tlbl->key + 100); + emit2 ("jp NZ,!tlabel", labelKey2num (tlbl->key)); regalloc_dry_run_cost += 3; } } - offset++; + offset++; } // bit = left & literal if (size) { emit2 ("clr c"); if (!regalloc_dry_run) - emit2 ("!tlabeldef", tlbl->key + 100); + emit2 ("!tlabeldef", labelKey2num (tlbl->key)); regalloc_dry_run_cost += 3; - _G.lines.current->isLabel = 1; + genLine.lineCurr->isLabel = 1; } // if(left & literal) else @@ -6629,14 +7161,15 @@ goto release; } - if (IS_R2K && isPair (AOP (result)) && - (getPairId (AOP (result)) == PAIR_HL && isPair (AOP (right)) && getPairId (AOP (right)) == PAIR_DE || - getPairId (AOP (result)) == PAIR_HL && isPair (AOP (left)) && getPairId (AOP (left)) == PAIR_DE || - isPair (AOP (left)) && getPairId (AOP (left)) == PAIR_IY && getPairId (AOP (result)) == PAIR_IY && isPair (AOP (right)) && getPairId (AOP (right)) == PAIR_DE)) + if (IS_RAB && isPair (AOP (result)) && + (getPairId (AOP (result)) == PAIR_HL && isPair (AOP (right)) && getPairId (AOP (right)) == PAIR_DE || + getPairId (AOP (result)) == PAIR_HL && isPair (AOP (left)) && getPairId (AOP (left)) == PAIR_DE || + isPair (AOP (left)) && getPairId (AOP (left)) == PAIR_IY && getPairId (AOP (result)) == PAIR_IY && isPair (AOP (right)) + && getPairId (AOP (right)) == PAIR_DE)) { if (isPair (AOP (left)) && getPairId (AOP (left)) == PAIR_DE) fetchPair (PAIR_HL, AOP (right)); - else /* right operand in DE */ + else /* right operand in DE */ fetchPair (getPairId (AOP (result)), AOP (left)); emit2 ("and hl, de"); regalloc_dry_run_cost += (getPairId (AOP (result)) == PAIR_HL ? 1 : 2); @@ -6726,7 +7259,7 @@ /* genOr - code for or */ /*-----------------------------------------------------------------*/ static void -genOr (const iCode *ic, iCode * ifx) +genOr (const iCode * ic, iCode * ifx) { operand *left, *right, *result; int size, offset = 0; @@ -6738,8 +7271,7 @@ aopOp ((result = IC_RESULT (ic)), ic, TRUE, FALSE); /* if left is a literal & right is not then exchange them */ - if ((AOP_TYPE (left) == AOP_LIT && AOP_TYPE (right) != AOP_LIT) || - (AOP_NEEDSACC (right) && !AOP_NEEDSACC (left))) + if ((AOP_TYPE (left) == AOP_LIT && AOP_TYPE (right) != AOP_LIT) || (AOP_NEEDSACC (right) && !AOP_NEEDSACC (left))) { operand *tmp = right; right = left; @@ -6755,8 +7287,7 @@ } /* if right is bit then exchange them */ - if (AOP_TYPE (right) == AOP_CRY && - AOP_TYPE (left) != AOP_CRY) + if (AOP_TYPE (right) == AOP_CRY && AOP_TYPE (left) != AOP_CRY) { operand *tmp = right; right = left; @@ -6783,9 +7314,7 @@ // if(val | 0xZZ) - size = 0, ifx != FALSE - // bit = val | 0xZZ - size = 1, ifx = FALSE - - if ((AOP_TYPE (right) == AOP_LIT) && - (AOP_TYPE (result) == AOP_CRY) && - (AOP_TYPE (left) != AOP_CRY)) + if ((AOP_TYPE (right) == AOP_LIT) && (AOP_TYPE (result) == AOP_CRY) && (AOP_TYPE (left) != AOP_CRY)) { symbol *tlbl = regalloc_dry_run ? 0 : newiTempLabel (0); int sizel; @@ -6811,10 +7340,10 @@ emit3 (A_OR, ASMOP_A, ASMOP_A); } - if (ifx) /* emit jmp only, if it is actually used */ + if (ifx) /* emit jmp only, if it is actually used */ { - if(!regalloc_dry_run) - emit2 ("jp NZ,!tlabel", tlbl->key + 100); + if (!regalloc_dry_run) + emit2 ("jp NZ,!tlabel", labelKey2num (tlbl->key)); regalloc_dry_run_cost += 3; } @@ -6840,10 +7369,10 @@ else { cheapMove (ASMOP_A, 0, AOP (left), offset); - if (isLiteralBit(bytelit) >= 0) - emit2 ("set %d, a", isLiteralBit(bytelit)); + if (isLiteralBit (bytelit) >= 0) + emit2 ("set %d, a", isLiteralBit (bytelit)); else - emit3_o(A_OR, ASMOP_A, 0, AOP (right), offset); + emit3_o (A_OR, ASMOP_A, 0, AOP (right), offset); cheapMove (AOP (result), offset, ASMOP_A, 0); } } @@ -6876,10 +7405,10 @@ } } // This is a bit broken, there will be problems for y_0 = x_0 | z_0, x_0 = y_0 | z_1 as either order of the two byte ors will result in the result destroying the second part of the operand. Currently, we use a workaround in the register allocator to avoid this. See also the comment on the 2-byte addition workaround above. - if(AOP_TYPE (left) != AOP_ACC) + if (AOP_TYPE (left) != AOP_ACC) cheapMove (ASMOP_A, 0, AOP (left), offset); - if(AOP_TYPE (right) == AOP_LIT && isLiteralBit(((lit >> (offset * 8)) & 0x0FFL)) >= 0) - emit2 ("set %d, a", isLiteralBit(((lit >> (offset * 8)) & 0x0FFL))); + if (AOP_TYPE (right) == AOP_LIT && isLiteralBit (((lit >> (offset * 8)) & 0x0FFL)) >= 0) + emit2 ("set %d, a", isLiteralBit (((lit >> (offset * 8)) & 0x0FFL))); else emit3_o (A_OR, ASMOP_A, 0, AOP (right), offset); cheapMove (AOP (result), offset, ASMOP_A, 0); @@ -6899,7 +7428,7 @@ /* genXor - code for xclusive or */ /*-----------------------------------------------------------------*/ static void -genXor (const iCode *ic, iCode * ifx) +genXor (const iCode * ic, iCode * ifx) { operand *left, *right, *result; int size, offset = 0; @@ -6910,8 +7439,7 @@ aopOp ((result = IC_RESULT (ic)), ic, TRUE, FALSE); /* if left is a literal & right is not then exchange them */ - if ((AOP_TYPE (left) == AOP_LIT && AOP_TYPE (right) != AOP_LIT) || - (AOP_NEEDSACC (right) && !AOP_NEEDSACC (left))) + if ((AOP_TYPE (left) == AOP_LIT && AOP_TYPE (right) != AOP_LIT) || (AOP_NEEDSACC (right) && !AOP_NEEDSACC (left))) { operand *tmp = right; right = left; @@ -6927,8 +7455,7 @@ } /* if right is bit then exchange them */ - if (AOP_TYPE (right) == AOP_CRY && - AOP_TYPE (left) != AOP_CRY) + if (AOP_TYPE (right) == AOP_CRY && AOP_TYPE (left) != AOP_CRY) { operand *tmp = right; right = left; @@ -6952,12 +7479,10 @@ right = left; left = tmp; } - + // if(val & 0xZZ) - size = 0, ifx != FALSE - // bit = val & 0xZZ - size = 1, ifx = FALSE - - if ((AOP_TYPE (right) == AOP_LIT) && - (AOP_TYPE (result) == AOP_CRY) && - (AOP_TYPE (left) != AOP_CRY)) + if ((AOP_TYPE (right) == AOP_LIT) && (AOP_TYPE (result) == AOP_CRY) && (AOP_TYPE (left) != AOP_CRY)) { symbol *tlbl = regalloc_dry_run ? 0 : newiTempLabel (0); int sizel; @@ -6973,17 +7498,17 @@ { cheapMove (ASMOP_A, 0, AOP (left), offset); emit3_o (A_XOR, ASMOP_A, 0, AOP (right), offset); - if (ifx) /* emit jmp only, if it is actually used * */ - if(!regalloc_dry_run) - emit2 ("jp NZ,!tlabel", tlbl->key + 100); - regalloc_dry_run_cost += 3; + if (ifx) /* emit jmp only, if it is actually used * */ + if (!regalloc_dry_run) + emit2 ("jp NZ,!tlabel", labelKey2num (tlbl->key)); + regalloc_dry_run_cost += 3; offset++; } if (ifx) { jmpTrueOrFalse (ifx, tlbl); } - else if(size) + else if (size) { wassertl (0, "Result of XOR was destined for a bit"); } @@ -7059,74 +7584,10 @@ } /*-----------------------------------------------------------------*/ -/* genInline - write the inline code out */ -/*-----------------------------------------------------------------*/ -static void -genInline (const iCode *ic) -{ - char *buffer, *bp, *bp1; - bool inComment = FALSE; - - _G.lines.isInline += (!options.asmpeep); - - buffer = bp = bp1 = Safe_strdup (IC_INLINE (ic)); - - /* emit each line as a code */ - while (*bp) - { - switch (*bp) - { - case ';': - inComment = TRUE; - ++bp; - break; - - case '\x87': - case '\n': - inComment = FALSE; - *bp++ = '\0'; - /* Don't emit whitespace */ - while(isspace(*bp1)) - bp1++; - if(*bp1) - emit2 (bp1); - bp1 = bp; - break; - - default: - /* Add \n for labels, not dirs such as c:\mydir */ - if (!inComment && (*bp == ':') && (isspace((unsigned char)bp[1]))) - { - ++bp; - *bp = '\0'; - ++bp; - emit2 (bp1); - bp1 = bp; - } - else - ++bp; - break; - } - } - if (bp1 != bp) - { - while(isspace(*bp1)) - bp1++; - if(*bp1) - emit2 (bp1); - } - - Safe_free (buffer); - - _G.lines.isInline -= (!options.asmpeep); - -} - -/*-----------------------------------------------------------------*/ /* genRRC - rotate right with carry */ /*-----------------------------------------------------------------*/ static void -genRRC (const iCode *ic) +genRRC (const iCode * ic) { wassert (0); } @@ -7135,7 +7596,7 @@ /* genRLC - generate code for rotate left with carry */ /*-----------------------------------------------------------------*/ static void -genRLC (const iCode *ic) +genRLC (const iCode * ic) { wassert (0); } @@ -7144,7 +7605,7 @@ /* genGetHbit - generates code get highest order bit */ /*-----------------------------------------------------------------*/ static void -genGetHbit (const iCode *ic) +genGetHbit (const iCode * ic) { operand *left, *result; left = IC_LEFT (ic); @@ -7178,13 +7639,13 @@ /* genGetAbit - generates code get a single bit */ /*-----------------------------------------------------------------*/ static void -genGetAbit (const iCode *ic) +genGetAbit (const iCode * ic) { wassert (0); } static void -emitRsh2 (asmop *aop, int size, int is_signed) +emitRsh2 (asmop * aop, int size, int is_signed) { int offset = 0; @@ -7202,19 +7663,18 @@ /* shiftR2Left2Result - shift right two bytes from left to result */ /*-----------------------------------------------------------------*/ static void -shiftR2Left2Result (const iCode *ic, operand * left, int offl, - operand * result, int offr, - int shCount, int is_signed) +shiftR2Left2Result (const iCode *ic, operand *left, int offl, operand *result, int offr, int shCount, int is_signed) { int size = 2; symbol *tlbl; - - if (IS_R2K && !is_signed && shCount >= 2 && isPairDead (PAIR_HL, ic) && - ((isPair (AOP (left)) && getPairId (AOP (left)) == PAIR_HL || isPair (AOP (result)) && getPairId (AOP (result)) == PAIR_HL) && isPairDead (PAIR_DE, ic) || - isPair (AOP (left)) && getPairId (AOP (left)) == PAIR_DE)) + + if (IS_RAB && !is_signed && shCount >= 2 && isPairDead (PAIR_HL, ic) && + ((isPair (AOP (left)) && getPairId (AOP (left)) == PAIR_HL || isPair (AOP (result)) + && getPairId (AOP (result)) == PAIR_HL) && isPairDead (PAIR_DE, ic) || isPair (AOP (left)) + && getPairId (AOP (left)) == PAIR_DE)) { bool op_de = (getPairId (AOP (left)) == PAIR_DE); - if(op_de) + if (op_de) emit2 ("ld hl, !immedword", 0xffff >> shCount); else { @@ -7222,9 +7682,9 @@ emit2 ("ld de, !immedword", 0xffff >> shCount); } regalloc_dry_run_cost += 3; - while(shCount--) + while (shCount--) { - if(op_de) + if (op_de) emit2 ("rr de"); else emit2 ("rr hl"); @@ -7232,20 +7692,23 @@ } emit2 ("and hl, de"); regalloc_dry_run_cost += 1; - commitPair (AOP (IC_RESULT (ic)), PAIR_HL); + commitPair (AOP (IC_RESULT (ic)), PAIR_HL, ic, TRUE); return; } - movLeft2Result (left, offl, result, offr, 0); - movLeft2Result (left, offl + 1, result, offr + 1, 0); + if (isPair (AOP (result)) && !offr) + fetchPairLong (getPairId (AOP (result)), AOP(left), ic, offl); + else + { + movLeft2Result (left, offl, result, offr, 0); + movLeft2Result (left, offl + 1, result, offr + 1, 0); + } if (shCount == 0) return; /* if (AOP(result)->type == AOP_REG) { */ - tlbl = regalloc_dry_run ? 0 : newiTempLabel (NULL); - /* Left is already in result - so now do the shift */ /* Optimizing for speed by default. */ if (!optimize.codeSize || shCount <= 2) @@ -7257,21 +7720,32 @@ } else { - if(!regalloc_dry_run) + bool use_b = (!IS_GB && !bitVectBitValue (ic->rSurv, B_IDX) + && !(AOP_TYPE (result) == AOP_REG + && (AOP (result)->aopu.aop_reg[0]->rIdx == B_IDX || AOP (result)->aopu.aop_reg[1]->rIdx == B_IDX))); + + tlbl = regalloc_dry_run ? 0 : newiTempLabel (NULL); + + if (!regalloc_dry_run) { - emit2 ("ld a,!immedbyte", shCount); - emitLabelNoSpill (tlbl->key + 100); + emit2 ("ld %s,!immedbyte", use_b ? "b" : "a", shCount); + emitLabel (tlbl); } regalloc_dry_run_cost += 2; emitRsh2 (AOP (result), size, is_signed); - if(!regalloc_dry_run) + if (!regalloc_dry_run) { - emit2 ("dec a"); - emit2 ("jp NZ,!tlabel", tlbl->key + 100); + if (use_b) + emit2 ("djnz !tlabel", labelKey2num (tlbl->key)); + else + { + emit2 ("dec a"); + emit2 ("jp NZ,!tlabel", labelKey2num (tlbl->key)); + } } - regalloc_dry_run_cost += 4; + regalloc_dry_run_cost += use_b ? 2 : 4; } } @@ -7279,14 +7753,14 @@ /* shiftL2Left2Result - shift left two bytes from left to result */ /*-----------------------------------------------------------------*/ static void -shiftL2Left2Result (operand * left, int offl, - operand * result, int offr, int shCount) +shiftL2Left2Result (operand *left, int offl, operand *result, int offr, int shCount, const iCode *ic) { - if (sameRegs (AOP (result), AOP (left)) && - ((offl + MSB16) == offr)) + if (sameRegs (AOP (result), AOP (left)) && ((offl + MSB16) == offr)) { wassert (0); } + else if (isPair (AOP (result)) && !offr) + fetchPairLong (getPairId (AOP (result)), AOP(left), ic, offl); else { /* Copy left into result */ @@ -7315,51 +7789,51 @@ } else { - int size = 2; - int offset = 0; - symbol *tlbl = regalloc_dry_run ? 0 : newiTempLabel (0); - symbol *tlbl1 = regalloc_dry_run ? 0 : newiTempLabel (0); + int size = 2; + int offset = 0; + symbol *tlbl = regalloc_dry_run ? 0 : newiTempLabel (0); + symbol *tlbl1 = regalloc_dry_run ? 0 : newiTempLabel (0); - if (AOP (result)->type == AOP_REG) - { - while (shCount--) - { - for (offset = 0; offset < size; offset++) - emit3_o (offset ? A_RL : A_SLA, AOP (result), offset, 0, 0); - } - } - else - { - /* Left is already in result - so now do the shift */ - if (shCount > 1) - { - if (!regalloc_dry_run) - { - emit2 ("ld a,!immedbyte+1", shCount); - emit2 ("jp !tlabel", tlbl1->key + 100); - emitLabelNoSpill (tlbl->key + 100); - } - regalloc_dry_run_cost += 4; - } + if (AOP (result)->type == AOP_REG) + { + while (shCount--) + { + for (offset = 0; offset < size; offset++) + emit3_o (offset ? A_RL : A_SLA, AOP (result), offset, 0, 0); + } + } + else + { + /* Left is already in result - so now do the shift */ + if (shCount > 1) + { + if (!regalloc_dry_run) + { + emit2 ("ld a,!immedbyte+1", shCount); + emit2 ("jp !tlabel", labelKey2num (tlbl1->key)); + emitLabel (tlbl); + } + regalloc_dry_run_cost += 4; + } - while (size--) - { - emit3_o (offset ? A_RL : A_SLA, AOP (result), offset, 0, 0); + while (size--) + { + emit3_o (offset ? A_RL : A_SLA, AOP (result), offset, 0, 0); - offset++; - } - if (shCount > 1) - { - if (!regalloc_dry_run) - { - emitLabelNoSpill (tlbl1->key + 100); - emit2 ("dec a"); - emit2 ("jp NZ,!tlabel", tlbl->key + 100); - } - regalloc_dry_run_cost += 4; - } - } - } + offset++; + } + if (shCount > 1) + { + if (!regalloc_dry_run) + { + emitLabel (tlbl1); + emit2 ("dec a"); + emit2 ("jp NZ,!tlabel", labelKey2num (tlbl->key)); + } + regalloc_dry_run_cost += 4; + } + } + } } /*-----------------------------------------------------------------*/ @@ -7373,6 +7847,12 @@ switch (shCount) { case 4: + if (IS_GB) + { + emit2 ("swap a"); + regalloc_dry_run_cost += 2; + break; + } emit3 (A_RLCA, 0, 0); case 3: emit3 (A_RLCA, 0, 0); @@ -7383,11 +7863,11 @@ case 0: break; case 5: - emit3 (A_RRCA, 0 ,0); + emit3 (A_RRCA, 0, 0); case 6: - emit3 (A_RRCA, 0 ,0); + emit3 (A_RRCA, 0, 0); case 7: - emit3 (A_RRCA, 0 ,0); + emit3 (A_RRCA, 0, 0); break; } } @@ -7399,9 +7879,9 @@ AccLsh (int shCount) { static const unsigned char SLMask[] = - { - 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x00 - }; + { + 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x00 + }; if (shCount != 0) { @@ -7429,8 +7909,7 @@ /* shiftL1Left2Result - shift left one byte from left to result */ /*-----------------------------------------------------------------*/ static void -shiftL1Left2Result (operand * left, int offl, - operand * result, int offr, int shCount) +shiftL1Left2Result (operand * left, int offl, operand * result, int offr, int shCount) { /* If operand and result are the same we can shift in place. However shifting in acc using add is cheaper than shifting @@ -7454,7 +7933,7 @@ /* genlshTwo - left shift two bytes by known amount */ /*-----------------------------------------------------------------*/ static void -genlshTwo (operand * result, operand * left, int shCount) +genlshTwo (operand *result, operand *left, int shCount, const iCode *ic) { int size = AOP_SIZE (result); @@ -7490,7 +7969,7 @@ } else { - shiftL2Left2Result (left, LSB, result, LSB, shCount); + shiftL2Left2Result (left, LSB, result, LSB, shCount, ic); } } } @@ -7508,10 +7987,7 @@ /* genLeftShiftLiteral - left shifting by known count */ /*-----------------------------------------------------------------*/ static void -genLeftShiftLiteral (operand *left, - operand *right, - operand *result, - const iCode *ic) +genLeftShiftLiteral (operand * left, operand * right, operand * result, const iCode *ic) { int shCount = (int) ulFromVal (AOP (right)->aopu.aop_lit); int size; @@ -7538,7 +8014,7 @@ genlshOne (result, left, shCount); break; case 2: - genlshTwo (result, left, shCount); + genlshTwo (result, left, shCount, ic); break; case 4: wassertl (0, "Shifting of longs is currently unsupported"); @@ -7555,7 +8031,7 @@ /* genLeftShift - generates code for left shifting */ /*-----------------------------------------------------------------*/ static void -genLeftShift (const iCode *ic) +genLeftShift (const iCode * ic) { int size, offset; symbol *tlbl = 0, *tlbl1 = 0; @@ -7605,7 +8081,7 @@ } } - if(!regalloc_dry_run) + if (!regalloc_dry_run) { tlbl = newiTempLabel (NULL); tlbl1 = newiTempLabel (NULL); @@ -7614,12 +8090,12 @@ offset = 0; if (AOP_TYPE (left) != AOP_REG || AOP_TYPE (result) != AOP_REG) - _pop (PAIR_AF); + _pop (PAIR_AF); - if(!regalloc_dry_run) + if (!regalloc_dry_run) { - emit2 ("jp !tlabel", tlbl1->key + 100); - emitLabelNoSpill (tlbl->key + 100); + emit2 ("jp !tlabel", labelKey2num (tlbl1->key)); + emitLabel (tlbl); } regalloc_dry_run_cost += 3; @@ -7629,11 +8105,11 @@ offset++; } - if(!regalloc_dry_run) + if (!regalloc_dry_run) { - emitLabelNoSpill (tlbl1->key + 100); + emitLabel (tlbl1); emit2 ("dec a"); - emit2 ("jp NZ,!tlabel", tlbl->key + 100); + emit2 ("jp NZ,!tlabel", labelKey2num (tlbl->key)); } regalloc_dry_run_cost += 4; @@ -7675,16 +8151,16 @@ AccRsh (int shCount) { static const unsigned char SRMask[] = - { - 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x00 - }; + { + 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x00 + }; if (shCount != 0) { /* rotate right accumulator */ AccRol (8 - shCount); /* and kill the higher order bits */ - if(!regalloc_dry_run) + if (!regalloc_dry_run) emit2 ("and a,!immedbyte", SRMask[shCount]); regalloc_dry_run_cost += 2; } @@ -7694,9 +8170,7 @@ /* shiftR1Left2Result - shift right one byte from left to result */ /*-----------------------------------------------------------------*/ static void -shiftR1Left2Result (operand * left, int offl, - operand * result, int offr, - int shCount, int sign) +shiftR1Left2Result (operand * left, int offl, operand * result, int offr, int shCount, int sign) { cheapMove (ASMOP_A, 0, AOP (left), offl); if (sign) @@ -7713,8 +8187,7 @@ /* genrshTwo - right shift two bytes by known amount */ /*-----------------------------------------------------------------*/ static void -genrshTwo (const iCode *ic, operand * result, operand * left, - int shCount, int sign) +genrshTwo (const iCode * ic, operand * result, operand * left, int shCount, int sign) { /* if shCount >= 8 */ if (shCount >= 8) @@ -7722,8 +8195,7 @@ shCount -= 8; if (shCount) { - shiftR1Left2Result (left, MSB16, result, LSB, - shCount, sign); + shiftR1Left2Result (left, MSB16, result, LSB, shCount, sign); } else { @@ -7749,14 +8221,10 @@ /* genRightShiftLiteral - right shifting by known count */ /*-----------------------------------------------------------------*/ static void -genRightShiftLiteral (operand *left, - operand *right, - operand *result, - const iCode *ic, - int sign) +genRightShiftLiteral (operand * left, operand * right, operand * result, const iCode * ic, int sign) { - int shCount = (int) ulFromVal (AOP (right)->aopu.aop_lit); - int size; + unsigned int shCount = (unsigned int) ulFromVal (AOP (right)->aopu.aop_lit); + unsigned int size; freeAsmop (right, NULL, ic); @@ -7766,20 +8234,25 @@ size = getSize (operandType (result)); /* I suppose that the left size >= result size */ + wassert (getSize (operandType (left)) >= size); - if (shCount >= (size * 8)) { - asmop *s; - if (!SPEC_USIGN(getSpec(operandType(left)))) { - cheapMove (ASMOP_A, 0, AOP (left), 0); - emit3 (A_RLC, ASMOP_A, 0); - emit3 (A_SBC, ASMOP_A, ASMOP_A); - s=ASMOP_A; - } else { - s=ASMOP_ZERO; + if (shCount >= (size * 8)) + { + asmop *s; + if (!SPEC_USIGN (getSpec (operandType (left)))) + { + cheapMove (ASMOP_A, 0, AOP (left), 0); + emit3 (A_RLC, ASMOP_A, 0); + emit3 (A_SBC, ASMOP_A, ASMOP_A); + s = ASMOP_A; + } + else + { + s = ASMOP_ZERO; + } + while (size--) + cheapMove (AOP (result), size, s, 0); } - while (size--) - cheapMove (AOP (result), size, s, 0); - } else { switch (size) @@ -7805,7 +8278,7 @@ /* genRightShift - generate code for right shifting */ /*-----------------------------------------------------------------*/ static void -genRightShift (const iCode *ic) +genRightShift (const iCode * ic) { operand *right, *left, *result; sym_link *retype; @@ -7844,7 +8317,7 @@ aopOp (result, ic, FALSE, FALSE); if (AOP_TYPE (left) != AOP_REG || AOP_TYPE (result) != AOP_REG) - _push (PAIR_AF); + _push (PAIR_AF); /* now move the left to the result if they are not the same */ @@ -7869,15 +8342,15 @@ offset = size - 1; if (AOP_TYPE (left) != AOP_REG || AOP_TYPE (result) != AOP_REG) - _pop (PAIR_AF); + _pop (PAIR_AF); - if(!regalloc_dry_run) + if (!regalloc_dry_run) { - emit2 ("jp !tlabel", tlbl1->key + 100); - emitLabelNoSpill (tlbl->key + 100); + emit2 ("jp !tlabel", labelKey2num (tlbl1->key)); + IS_GB ? emitLabelSpill (tlbl) : emitLabel (tlbl); } regalloc_dry_run_cost += 3; - + while (size--) { if (first) @@ -7891,11 +8364,11 @@ } offset--; } - if(!regalloc_dry_run) + if (!regalloc_dry_run) { - emitLabelNoSpill (tlbl1->key + 100); + IS_GB ? emitLabelSpill (tlbl1) : emitLabel (tlbl1); emit2 ("dec a"); - emit2 ("jp NZ,!tlabel", tlbl->key + 100); + emit2 ("jp NZ,!tlabel", labelKey2num (tlbl->key)); } regalloc_dry_run_cost += 4; @@ -7910,12 +8383,12 @@ static void genUnpackBits (operand * result, int pair) { - int offset = 0; /* result byte offset */ - int rsize; /* result size */ - int rlen = 0; /* remaining bit-field length */ - sym_link *etype; /* bit-field type information */ - int blen; /* bit-field length */ - int bstr; /* bit-field starting bit within byte */ + int offset = 0; /* result byte offset */ + int rsize; /* result size */ + int rlen = 0; /* remaining bit-field length */ + sym_link *etype; /* bit-field type information */ + int blen; /* bit-field length */ + int bstr; /* bit-field starting bit within byte */ emitDebug ("; genUnpackBits"); @@ -7930,18 +8403,18 @@ emit2 ("ld a,!*pair", _pairs[pair].name); regalloc_dry_run_cost += (pair == PAIR_IX || pair == PAIR_IY) ? 3 : 1; AccRol (8 - bstr); - emit2 ("and a,!immedbyte", ((unsigned char) -1) >> (8 - blen)); + emit2 ("and a,!immedbyte", ((unsigned char) - 1) >> (8 - blen)); regalloc_dry_run_cost += 2; if (!SPEC_USIGN (etype)) { /* signed bit-field */ - if(!regalloc_dry_run) + if (!regalloc_dry_run) { symbol *tlbl = newiTempLabel (NULL); emit2 ("bit %d,a", blen - 1); - emit2 ("jp Z,!tlabel", tlbl->key + 100); + emit2 ("jp Z,!tlabel", labelKey2num (tlbl->key)); emit2 ("or a,!immedbyte", (unsigned char) (0xff << blen)); - emitLabelNoSpill (tlbl->key + 100); + emitLabel (tlbl); } regalloc_dry_run_cost += 7; } @@ -7951,12 +8424,13 @@ /* TODO: what if pair == PAIR_DE ? */ if (getPairId (AOP (result)) == PAIR_HL || - AOP_TYPE (result) == AOP_REG && rsize >= 2 && (AOP (result)->aopu.aop_reg[0]->rIdx == L_IDX || AOP (result)->aopu.aop_reg[0]->rIdx == H_IDX)) + AOP_TYPE (result) == AOP_REG && rsize >= 2 && (AOP (result)->aopu.aop_reg[0]->rIdx == L_IDX + || AOP (result)->aopu.aop_reg[0]->rIdx == H_IDX)) { wassertl (rsize == 2, "HL must be of size 2"); emit2 ("ld a,!*hl"); emit2 ("inc hl"); - if(AOP_TYPE (result) != AOP_REG || AOP (result)->aopu.aop_reg[0]->rIdx != H_IDX) + if (AOP_TYPE (result) != AOP_REG || AOP (result)->aopu.aop_reg[0]->rIdx != H_IDX) { emit2 ("ld h,!*hl"); cheapMove (AOP (result), offset++, ASMOP_A, 0); @@ -7968,18 +8442,18 @@ cheapMove (AOP (result), offset++, ASMOP_A, 0); emit2 ("ld a,l"); } - emit2 ("and a,!immedbyte", ((unsigned char) -1) >> (16 - blen)); + emit2 ("and a,!immedbyte", ((unsigned char) - 1) >> (16 - blen)); regalloc_dry_run_cost += 7; if (!SPEC_USIGN (etype)) { /* signed bit-field */ - if(!regalloc_dry_run) + if (!regalloc_dry_run) { symbol *tlbl = newiTempLabel (NULL); emit2 ("bit %d,a", blen - 1 - 8); - emit2 ("jp Z,!tlabel", tlbl->key + 100); + emit2 ("jp Z,!tlabel", labelKey2num (tlbl->key)); emit2 ("or a,!immedbyte", (unsigned char) (0xff << (blen - 8))); - emitLabelNoSpill (tlbl->key + 100); + emitLabel (tlbl); } regalloc_dry_run_cost += 7; } @@ -7991,12 +8465,12 @@ /* Bit field did not fit in a byte. Copy all but the partial byte at the end. */ - for (rlen=blen;rlen>=8;rlen-=8) + for (rlen = blen; rlen >= 8; rlen -= 8) { emit2 ("ld a,!*pair", _pairs[pair].name); regalloc_dry_run_cost += 1; cheapMove (AOP (result), offset++, ASMOP_A, 0); - if (rlen>8) + if (rlen > 8) { emit2 ("inc %s", _pairs[pair].name); regalloc_dry_run_cost += 1; @@ -8008,18 +8482,18 @@ if (rlen) { emit2 ("ld a,!*pair", _pairs[pair].name); - emit2 ("and a,!immedbyte", ((unsigned char) -1) >> (8 - rlen)); + emit2 ("and a,!immedbyte", ((unsigned char) - 1) >> (8 - rlen)); regalloc_dry_run_cost += 3; if (!SPEC_USIGN (etype)) { /* signed bit-field */ - if(!regalloc_dry_run) + if (!regalloc_dry_run) { symbol *tlbl = newiTempLabel (NULL); emit2 ("bit %d,a", rlen - 1); - emit2 ("jp Z,!tlabel", tlbl->key + 100); + emit2 ("jp Z,!tlabel", labelKey2num (tlbl->key)); emit2 ("or a,!immedbyte", (unsigned char) (0xff << rlen)); - emitLabelNoSpill (tlbl->key + 100); + emitLabel (tlbl); } regalloc_dry_run_cost += 7; } @@ -8047,19 +8521,45 @@ } static void -_moveFrom_tpair_(asmop *aop, int offset, PAIR_ID pair) +_moveFrom_tpair_ (asmop * aop, int offset, PAIR_ID pair) { if (!IS_GB && aop->type == AOP_REG) { - if(!regalloc_dry_run) + if (!regalloc_dry_run) aopPut (aop, "!*hl", offset); regalloc_dry_run_cost += ld_cost (aop, ASMOP_A); } else { - emit2 ("ld a,!*pair", _pairs[pair].name); - regalloc_dry_run_cost += 1; - cheapMove (aop, offset, ASMOP_A, 0); + emit2 ("ld a,!*pair", _pairs[pair].name); + regalloc_dry_run_cost += 1; + cheapMove (aop, offset, ASMOP_A, 0); + } +} + +static void offsetPair (PAIR_ID pair, PAIR_ID extrapair, bool save_extrapair, int val) +{ + if (abs (val) < (save_extrapair ? 6 : 4) || pair != PAIR_HL && pair != PAIR_IY && pair != PAIR_IX) + { + while (val) + { + emit2 (val > 0 ? "inc %s" : "dec %s", _pairs[pair].name); + if (val > 0) + val--; + else + val++; + regalloc_dry_run_cost++; + } + } + else + { + if (save_extrapair) + _push (extrapair); + emit2 ("ld %s, !immedword", _pairs[extrapair].name, val); + emit2 ("add %s, %s", _pairs[pair].name, _pairs[extrapair].name); + regalloc_dry_run_cost += (pair == PAIR_HL ? 4 : 5); + if (save_extrapair) + _pop (extrapair); } } @@ -8069,29 +8569,48 @@ static void genPointerGet (const iCode *ic) { - operand *left, *result; - int size, offset; - int pair = PAIR_HL; + operand *left, *right, *result; + int size, offset, rightval; + int pair = PAIR_HL, extrapair; sym_link *retype; + bool pushed_pair = FALSE; + bool pushed_a = FALSE; + bool surviving_a = !options.oldralloc && bitVectBitValue (ic->rSurv, A_IDX); + bool rightval_in_range; left = IC_LEFT (ic); + right = IC_RIGHT (ic); result = IC_RESULT (ic); retype = getSpec (operandType (result)); - if (IS_GB) - pair = PAIR_DE; - aopOp (left, ic, FALSE, FALSE); aopOp (result, ic, FALSE, FALSE); - size = AOP_SIZE (result); - if (isPair (AOP (left)) && size == 1 && !IS_BITVAR (retype)) + /* Historically GET_VALUE_AT_ADDRESS didn't have a right operand */ + wassertl (right, "GET_VALUE_AT_ADDRESS without right operand"); + wassertl (IS_OP_LITERAL (IC_RIGHT (ic)), "GET_VALUE_AT_ADDRESS with non-literal right operand"); + rightval = (int)operandLitValue (right); + rightval_in_range = (rightval >= -128 && rightval + size - 1 < 127); + if (IS_GB) + wassert (!rightval); + + if (IS_GB || IY_RESERVED && requiresHL (AOP (result)) && size > 1 && AOP_TYPE (result) != AOP_REG) + pair = PAIR_DE; + + if (AOP_TYPE (left) == AOP_IMMD && size == 1 && AOP_TYPE (result) == AOP_ACC && !IS_BITVAR (retype)) + { + emit2 ("ld a, (%s)", aopGetLitWordLong (AOP (left), rightval, TRUE)); + regalloc_dry_run_cost += 3; + goto release; + } + + if (isPair (AOP (left)) && size == 1 && !IS_BITVAR (retype) && !rightval) { /* Just do it */ if (isPtrPair (AOP (left))) { - if(!regalloc_dry_run) // Todo: More exact cost. + if (!regalloc_dry_run) // Todo: More exact cost. { struct dbuf_s dbuf; @@ -8104,6 +8623,8 @@ } else { + if (surviving_a && !pushed_a) + _push (PAIR_AF), pushed_a = TRUE; emit2 ("ld a,!*pair", getPairName (AOP (left))); regalloc_dry_run_cost += (getPairId (AOP (left)) == PAIR_IY ? 3 : 1); cheapMove (AOP (result), 0, ASMOP_A, 0); @@ -8112,11 +8633,11 @@ goto release; } - if (getPairId (AOP (left)) == PAIR_IY && !IS_BITVAR (retype)) + if (getPairId (AOP (left)) == PAIR_IY && !IS_BITVAR (retype) && rightval_in_range) { - if (IS_R2K && getPairId (AOP (result)) == PAIR_HL) + if (IS_RAB && getPairId (AOP (result)) == PAIR_HL) { - emit2 ("ld hl, (iy)"); + emit2 ("ld hl, %d (iy)", rightval); regalloc_dry_run_cost += 3; goto release; } @@ -8130,54 +8651,88 @@ struct dbuf_s dbuf; dbuf_init (&dbuf, 128); - dbuf_tprintf (&dbuf, "!*iyx", offset); + dbuf_tprintf (&dbuf, "!*iyx", rightval + offset); aopPut (AOP (result), dbuf_c_str (&dbuf), offset); dbuf_destroy (&dbuf); } - regalloc_dry_run_cost += ld_cost (AOP (result), ASMOP_A) + 2; // Todo: More exact cost. + regalloc_dry_run_cost += ld_cost (AOP (result), ASMOP_A) + 2; // Todo: More exact cost. offset++; } goto release; } + extrapair = isPairDead (PAIR_DE, ic) ? PAIR_DE : PAIR_BC; + /* For now we always load into temp pair */ /* if this is rematerializable */ - if(!IS_GB && (getPairId (AOP (left)) == PAIR_BC || getPairId (AOP (left)) == PAIR_DE) && AOP_TYPE (result) == AOP_STK || getPairId (AOP (left)) == PAIR_IY && SPEC_BLEN (getSpec (operandType (result))) < 8) + if (!IS_GB && (getPairId (AOP (left)) == PAIR_BC || getPairId (AOP (left)) == PAIR_DE) && AOP_TYPE (result) == AOP_STK && !rightval + || getPairId (AOP (left)) == PAIR_IY && SPEC_BLEN (getSpec (operandType (result))) < 8 && rightval_in_range) pair = getPairId (AOP (left)); else - fetchPair (pair, AOP (left)); + { + if (!isPairDead (pair, ic) && size > 1) + _push (pair), pushed_pair = TRUE; + if (AOP_TYPE(left) == AOP_IMMD) + { + emit2 ("ld %s, %s", _pairs[pair].name, aopGetLitWordLong (AOP (left), rightval, TRUE)); + regalloc_dry_run_cost += 3; + rightval = 0; + } + else + fetchPair (pair, AOP (left)); + } /* if bit then unpack */ if (IS_BITVAR (retype)) { + offsetPair (pair, extrapair, !isPairDead (extrapair, ic), rightval); genUnpackBits (result, pair); + if (rightval) + spillPair (pair); + goto release; } - else if (getPairId (AOP (result)) == PAIR_HL || size == 2 && AOP_TYPE (result) == AOP_REG && (AOP (result)->aopu.aop_reg[0] == regsZ80 + L_IDX || AOP (result)->aopu.aop_reg[0] == regsZ80 + H_IDX)) + + + if (getPairId (AOP (result)) == PAIR_HL || size == 2 && AOP_TYPE (result) == AOP_REG + && (AOP (result)->aopu.aop_reg[0] == regsZ80 + L_IDX || AOP (result)->aopu.aop_reg[0] == regsZ80 + H_IDX)) { - wassertl (size == 2, "HL must be of size 2"); - if (IS_R2K && getPairId (AOP (result)) == PAIR_HL) + wassertl (size == 2, "HL must be of size 2"); + if (IS_RAB && getPairId (AOP (result)) == PAIR_HL && rightval_in_range) { - emit2 ("ld hl, (hl)"); + emit2 ("ld hl, %d (hl)", rightval); regalloc_dry_run_cost += 3; } else { + if (surviving_a && !pushed_a) + _push (PAIR_AF), pushed_a = TRUE; + offsetPair (pair, extrapair, !isPairDead (extrapair, ic), rightval); emit2 ("ld a,!*hl"); emit2 ("inc hl"); - if(!regalloc_dry_run) + if (!regalloc_dry_run) aopPut (AOP (result), "!*hl", 1); regalloc_dry_run_cost += 3; cheapMove (AOP (result), 0, ASMOP_A, 0); } spillPair (PAIR_HL); + goto release; } - else if (pair == PAIR_HL || (!IS_GB && (getPairId (AOP (left)) == PAIR_BC || getPairId (AOP (left)) == PAIR_DE) && AOP_TYPE (result) == AOP_STK)) + + offsetPair (pair, extrapair, !isPairDead (extrapair, ic), rightval); + + if (pair == PAIR_HL + || (!IS_GB && (getPairId (AOP (left)) == PAIR_BC || getPairId (AOP (left)) == PAIR_DE) + && AOP_TYPE (result) == AOP_STK)) { size = AOP_SIZE (result); offset = 0; + /* might use ld a,(hl) followed by ld d (iy),a */ + if ((AOP_TYPE (result) == AOP_EXSTK || AOP_TYPE (result) == AOP_STK) && surviving_a && !pushed_a) + _push (PAIR_AF), pushed_a = TRUE; + if (size >= 2 && pair == PAIR_HL && AOP_TYPE (result) == AOP_REG) { int i, l = -10, h = -10, r; @@ -8189,7 +8744,7 @@ h = i; } - if (l == -10 && h >= 0 && h < size - 1 || h == -10 && l >= 0 && l < size - 1) // One byte of result somewehere in hl. Just assign it last. + if (l == -10 && h >= 0 && h < size - 1 || h == -10 && l >= 0 && l < size - 1) // One byte of result somewehere in hl. Just assign it last. { r = (l == -10 ? h : l); @@ -8199,12 +8754,12 @@ _moveFrom_tpair_ (AOP (result), offset, pair); if (size) - { - offset++; - emit2 ("inc %s", _pairs[pair].name); - regalloc_dry_run_cost += 1; - _G.pairs[pair].offset++; - } + { + offset++; + emit2 ("inc %s", _pairs[pair].name); + regalloc_dry_run_cost += 1; + _G.pairs[pair].offset++; + } } for (size = offset; size != r; size--) @@ -8216,10 +8771,10 @@ _moveFrom_tpair_ (AOP (result), r, pair); // No fixup since result uses HL. - + spillPair (pair); goto release; } - else if (l >= 0 && h >= 0 ) // Two bytes of result somewehere in hl. Assign it last and use a for caching. + else if (l >= 0 && h >= 0) // Two bytes of result somewehere in hl. Assign it last and use a for caching. { while (size--) { @@ -8227,12 +8782,12 @@ _moveFrom_tpair_ (AOP (result), offset, pair); if (size) - { - offset++; - emit2 ("inc %s", _pairs[pair].name); - regalloc_dry_run_cost += 1; - _G.pairs[pair].offset++; - } + { + offset++; + emit2 ("inc %s", _pairs[pair].name); + regalloc_dry_run_cost += 1; + _G.pairs[pair].offset++; + } } r = (l > h ? l : h); @@ -8241,6 +8796,8 @@ emit2 ("dec %s", _pairs[pair].name); regalloc_dry_run_cost += 1; } + if (surviving_a && !pushed_a) + _push (PAIR_AF), pushed_a = TRUE; _moveFrom_tpair_ (ASMOP_A, 0, pair); r = (l < h ? l : h); @@ -8255,7 +8812,7 @@ cheapMove (AOP (result), r, ASMOP_A, 0); // No fixup since result uses HL. - + spillPair (pair); goto release; } } @@ -8273,12 +8830,14 @@ } /* Fixup HL back down */ if (getPairId (AOP (left)) == pair && !isPairDead (pair, ic)) - for (size = AOP_SIZE (result)-1; size; size--) + for (size = AOP_SIZE (result) - 1; size; size--) { emit2 ("dec %s", _pairs[pair].name); regalloc_dry_run_cost += 1; _G.pairs[pair].offset--; } + else if (rightval || AOP_SIZE (result)) + spillPair (pair); } else { @@ -8287,11 +8846,13 @@ while (size--) { + if (surviving_a && !pushed_a) + _push (PAIR_AF), pushed_a = TRUE; + /* PENDING: make this better */ - if (!IS_GB && - (AOP_TYPE (result) == AOP_REG || AOP_TYPE (result) == AOP_HLREG)) + if (!IS_GB && (AOP_TYPE (result) == AOP_REG || AOP_TYPE (result) == AOP_HLREG)) { - if(!regalloc_dry_run) + if (!regalloc_dry_run) aopPut (AOP (result), "!*hl", offset++); regalloc_dry_run_cost += ld_cost (AOP (result), ASMOP_A); } @@ -8308,9 +8869,16 @@ _G.pairs[pair].offset++; } } + if (rightval || AOP_SIZE (result)) + spillPair (pair); } release: + if (pushed_a) + _pop (PAIR_AF); + if (pushed_pair) + _pop (pair); + freeAsmop (left, NULL, ic); freeAsmop (result, NULL, ic); } @@ -8328,22 +8896,20 @@ /* genPackBits - generates code for packed bit storage */ /*-----------------------------------------------------------------*/ static void -genPackBits (sym_link * etype, - operand * right, - int pair, - const iCode *ic) +genPackBits (sym_link * etype, operand * right, int pair, const iCode * ic) { - int offset = 0; /* source byte offset */ + int offset = 0; /* source byte offset */ int pair_offset = 0; - int rlen = 0; /* remaining bit-field length */ - int blen; /* bit-field length */ - int bstr; /* bit-field starting bit within byte */ - int litval; /* source literal value (if AOP_LIT) */ - unsigned char mask; /* bitmask within current byte */ - int extraPair; /* a tempory register */ - bool needPopExtra=0; /* need to restore original value of temp reg */ + int rlen = 0; /* remaining bit-field length */ + int blen; /* bit-field length */ + int bstr; /* bit-field starting bit within byte */ + int litval; /* source literal value (if AOP_LIT) */ + unsigned char mask; /* bitmask within current byte */ + int extraPair; /* a tempory register */ + bool needPopExtra = 0; /* need to restore original value of temp reg */ + unsigned int pairincrement = 0; - emitDebug ("; genPackBits",""); + emitDebug ("; genPackBits", ""); blen = SPEC_BLEN (etype); bstr = SPEC_BSTR (etype); @@ -8351,8 +8917,7 @@ /* If the bit-field length is less than a byte */ if (blen < 8) { - mask = ((unsigned char) (0xFF << (blen + bstr)) | - (unsigned char) (0xFF >> (8 - bstr))); + mask = ((unsigned char) (0xFF << (blen + bstr)) | (unsigned char) (0xFF >> (8 - bstr))); if (AOP_TYPE (right) == AOP_LIT) { @@ -8362,7 +8927,7 @@ litval &= (~mask) & 0xff; emit2 ("ld a,!*pair", _pairs[pair].name); regalloc_dry_run_cost += (pair == PAIR_IX || pair == PAIR_IY) ? 3 : 1; - if ((mask|litval)!=0xff) + if ((mask | litval) != 0xff) { emit2 ("and a,!immedbyte", mask); regalloc_dry_run_cost += 2; @@ -8385,7 +8950,7 @@ emit2 ("and a,!immedbyte", (~mask) & 0xff); regalloc_dry_run_cost += 2; - extraPair = getFreePairId(ic); + extraPair = getFreePairId (ic); if (extraPair == PAIR_INVALID) { if (pair != PAIR_HL) @@ -8401,6 +8966,7 @@ } } emit2 ("ld %s,a", _pairs[extraPair].l); + spillPair (extraPair); regalloc_dry_run_cost += 1; emit2 ("ld a,!*pair", _pairs[pair].name); regalloc_dry_run_cost += (pair == PAIR_IX || pair == PAIR_IY) ? 3 : 1; @@ -8419,7 +8985,7 @@ /* Bit length is greater than 7 bits. In this case, copy */ /* all except the partial byte at the end */ - for (rlen=blen;rlen>=8;rlen-=8) + for (rlen = blen; rlen >= 8; rlen -= 8) { cheapMove (ASMOP_A, 0, AOP (right), offset++); if (pair == PAIR_IX || pair == PAIR_IY) @@ -8436,6 +9002,7 @@ { emit2 ("inc %s", _pairs[pair].name); regalloc_dry_run_cost += 1; + pairincrement++; _G.pairs[pair].offset++; } else @@ -8445,15 +9012,15 @@ /* If there was a partial byte at the end */ if (rlen) { - mask = (((unsigned char) -1 << rlen) & 0xff); + mask = (((unsigned char) - 1 << rlen) & 0xff); if (AOP_TYPE (right) == AOP_LIT) { /* Case with partial byte and literal source */ litval = (int) ulFromVal (AOP (right)->aopu.aop_lit); - litval >>= (blen-rlen); + litval >>= (blen - rlen); litval &= (~mask) & 0xff; - + if (pair == PAIR_IX || pair == PAIR_IY) { emit2 ("ld a, %d !*pair", pair_offset, _pairs[pair].name); @@ -8465,7 +9032,7 @@ regalloc_dry_run_cost += 1; } - if ((mask|litval)!=0xff) + if ((mask | litval) != 0xff) emit2 ("and a,!immedbyte", mask); if (litval) emit2 ("or a,!immedbyte", litval); @@ -8477,7 +9044,7 @@ emit2 ("and a,!immedbyte", (~mask) & 0xff); regalloc_dry_run_cost += 2; - extraPair = getFreePairId(ic); + extraPair = getFreePairId (ic); if (extraPair == PAIR_INVALID) { if (pair != PAIR_HL) @@ -8492,10 +9059,11 @@ } } } - + emit2 ("ld %s,a", _pairs[extraPair].l); + spillPair (extraPair); regalloc_dry_run_cost += 1; - + if (pair == PAIR_IX || pair == PAIR_IY) { emit2 ("ld a, %d !*pair", pair_offset, _pairs[pair].name); @@ -8526,6 +9094,14 @@ regalloc_dry_run_cost += 1; } } + if (!isPairDead(pair, ic)) + while (pairincrement) + { + emit2 ("dec %s", _pairs[pair].name); + regalloc_dry_run_cost += 1; + pairincrement--; + _G.pairs[pair].offset--; + } } /*-----------------------------------------------------------------*/ @@ -8534,13 +9110,15 @@ static void genPointerSet (iCode * ic) { - int size, offset; + int size, offset = 0; operand *right, *result; PAIR_ID pairId = PAIR_HL; bool isBitvar; - sym_link *retype; + sym_link *retype; sym_link *letype; - + bool pushed_a = FALSE; + bool surviving_a = !options.oldralloc && bitVectBitValue (ic->rSurv, A_IDX); + right = IC_RIGHT (ic); result = IC_RESULT (ic); retype = getSpec (operandType (right)); @@ -8550,26 +9128,30 @@ aopOp (right, ic, FALSE, FALSE); if (IS_GB) - pairId = PAIR_DE; + pairId = isRegOrLit (AOP (right)) ? PAIR_HL : PAIR_DE; + if (isPair (AOP (result)) && isPairDead (getPairId (AOP (result)), ic)) + pairId = getPairId (AOP (result)); size = AOP_SIZE (right); - isBitvar = IS_BITVAR(retype) || IS_BITVAR(letype); - emitDebug("; isBitvar = %d", isBitvar); + isBitvar = IS_BITVAR (retype) || IS_BITVAR (letype); + emitDebug ("; isBitvar = %d", isBitvar); /* Handle the exceptions first */ if (isPair (AOP (result)) && size == 1 && !isBitvar) { /* Just do it */ const char *pair = getPairName (AOP (result)); - if (canAssignToPtr3 (AOP (right)) && isPtr (pair)) // Todo: correct cost for pair iy. + if (canAssignToPtr3 (AOP (right)) && isPtr (pair)) // Todo: correct cost for pair iy. { - if(!regalloc_dry_run) + if (!regalloc_dry_run) emit2 ("ld !*pair,%s", pair, aopGet (AOP (right), 0, FALSE)); - regalloc_dry_run_cost += ld_cost(ASMOP_A, AOP (right)) + (getPairId (AOP (result)) != PAIR_IY ? 0 : 2); + regalloc_dry_run_cost += ld_cost (ASMOP_A, AOP (right)) + (getPairId (AOP (result)) != PAIR_IY ? 0 : 2); } else { + if (surviving_a && !pushed_a && AOP_TYPE (right) != AOP_ACC) + _push (PAIR_AF), pushed_a = TRUE; cheapMove (ASMOP_A, 0, AOP (right), 0); emit2 ("ld !*pair,a", pair); regalloc_dry_run_cost += (getPairId (AOP (result)) != PAIR_IY ? 1 : 3); @@ -8577,17 +9159,16 @@ goto release; } - if ( getPairId( AOP (result)) == PAIR_IY && !isBitvar) + if (getPairId (AOP (result)) == PAIR_IY && !isBitvar) { /* Just do it */ - offset = 0; while (size--) { if (canAssignToPtr3 (AOP (right))) { - if(!regalloc_dry_run) - emit2 ("ld !*iyx,%s", offset, aopGet( AOP(right), offset, FALSE)); - regalloc_dry_run_cost += 3; // Todo: More exact cost here! + if (!regalloc_dry_run) + emit2 ("ld !*iyx,%s", offset, aopGet (AOP (right), offset, FALSE)); + regalloc_dry_run_cost += 3; // Todo: More exact cost here! } else { @@ -8599,21 +9180,20 @@ } goto release; } - else if (getPairId (AOP (result)) == PAIR_HL && !isLastUse (ic, result) - && !isBitvar) + else if (getPairId (AOP (result)) == PAIR_HL && !isPairDead (PAIR_HL, ic) && !isBitvar) { - offset = 0; - while (size--) { if (isRegOrLit (AOP (right)) && !IS_GB) { - if(!regalloc_dry_run) + if (!regalloc_dry_run) emit2 ("ld !*pair,%s", _pairs[PAIR_HL].name, aopGet (AOP (right), offset, FALSE)); - regalloc_dry_run_cost += ld_cost(ASMOP_A, AOP (right)); + regalloc_dry_run_cost += ld_cost (ASMOP_A, AOP (right)); } else { + if (surviving_a && !pushed_a && (AOP_TYPE (right) != AOP_ACC || offset)) + _push (PAIR_AF), pushed_a = TRUE; cheapMove (ASMOP_A, 0, AOP (right), offset); emit2 ("ld !*pair,a", _pairs[PAIR_HL].name); regalloc_dry_run_cost += 1; @@ -8628,7 +9208,7 @@ } /* Fixup HL back down */ - for (size = AOP_SIZE (right)-1; size; size--) + for (size = AOP_SIZE (right) - 1; size; size--) { emit2 ("dec %s", _pairs[PAIR_HL].name); regalloc_dry_run_cost += 1; @@ -8636,18 +9216,34 @@ goto release; } + if (!IS_GB && !isBitvar && isLitWord (AOP (result)) && size == 2 && + (AOP_TYPE (right) == AOP_REG && getPairId (AOP (right)) != PAIR_INVALID || isLitWord (AOP (right)))) + { + if (isLitWord (AOP (right))) + { + pairId = PAIR_HL; + fetchPair (pairId, AOP (right)); + } + else + pairId = getPairId (AOP (right)); + + fetchPair (pairId, AOP (right)); + emit2 ("ld (%s), %s", aopGetLitWordLong (AOP (result), offset, FALSE), _pairs[pairId].name); + regalloc_dry_run_cost += (pairId == PAIR_HL) ? 3 : 4; + goto release; + } + /* if the operand is already in dptr then we do nothing else we move the value to dptr */ if (AOP_TYPE (result) != AOP_STR) { - if (isBitvar && getPairId( AOP (result)) != PAIR_INVALID && - (getPairId( AOP (result)) != PAIR_IY || SPEC_BLEN (IS_BITVAR (retype) ? retype : letype) < 8 || isLastUse (ic, result))) /* Avoid destroying result by increments */ - pairId = getPairId( AOP (result)); + if (isBitvar && getPairId (AOP (result)) != PAIR_INVALID && (getPairId (AOP (result)) != PAIR_IY || SPEC_BLEN (IS_BITVAR (retype) ? retype : letype) < 8 || isPairDead (getPairId (AOP (result)), ic))) /* Avoid destroying result by increments */ + pairId = getPairId (AOP (result)); else fetchPair (pairId, AOP (result)); } /* so hl now contains the address */ - freeAsmop (result, NULL, ic); + /*freeAsmop (result, NULL, ic);*/ /* if bit then unpack */ if (isBitvar) @@ -8661,14 +9257,16 @@ while (size--) { - if (isRegOrLit (AOP (right)) && !IS_GB) + if (isRegOrLit (AOP (right)) && pairId == PAIR_HL) { - if(!regalloc_dry_run) + if (!regalloc_dry_run) emit2 ("ld !*pair,%s", _pairs[pairId].name, aopGet (AOP (right), offset, FALSE)); - regalloc_dry_run_cost += ld_cost(ASMOP_A, AOP (right)); + regalloc_dry_run_cost += ld_cost (ASMOP_A, AOP (right)); } else { + if (surviving_a && !pushed_a && (AOP_TYPE (right) != AOP_ACC || offset)) + _push (PAIR_AF), pushed_a = TRUE; cheapMove (ASMOP_A, 0, AOP (right), offset); emit2 ("ld !*pair,a", _pairs[pairId].name); regalloc_dry_run_cost += 1; @@ -8681,8 +9279,22 @@ } offset++; } + /* Restore operand partially in HL. */ + if (!isPairDead (pairId, ic)) + { + while(offset-- > 1) + { + emit2 ("dec %s", _pairs[pairId].name); + regalloc_dry_run_cost += 1; + _G.pairs[pairId].offset--; + } + commitPair (AOP (result), pairId, ic, FALSE); + } } release: + if (pushed_a) + _pop (PAIR_AF); + freeAsmop (right, NULL, ic); freeAsmop (result, NULL, ic); } @@ -8699,20 +9311,18 @@ aopOp (cond, ic, FALSE, TRUE); /* get the value into acc */ - if(AOP_TYPE (cond) != AOP_CRY && - !IS_BOOL (operandType(cond))) + if (AOP_TYPE (cond) != AOP_CRY && !IS_BOOL (operandType (cond))) _toBoolean (cond, FALSE); /* Special case: Condition is bool */ - else if(IS_BOOL (operandType(cond))) + else if (IS_BOOL (operandType (cond))) { - if(!regalloc_dry_run) + if (!regalloc_dry_run) { emit2 ("bit 0,%s", aopGet (AOP (cond), 0, FALSE)); - emit2 ("jp %s,!tlabel", IC_TRUE (ic) ? "NZ" : "Z", - (IC_TRUE (ic) ? IC_TRUE (ic) : IC_FALSE (ic))->key + 100); + emit2 ("jp %s,!tlabel", IC_TRUE (ic) ? "NZ" : "Z", labelKey2num ((IC_TRUE (ic) ? IC_TRUE (ic) : IC_FALSE (ic))->key)); } - regalloc_dry_run_cost += (bit8_cost(AOP (cond)) + 3); - + regalloc_dry_run_cost += (bit8_cost (AOP (cond)) + 3); + freeAsmop (cond, NULL, ic); if (!regalloc_dry_run) ic->generated = 1; @@ -8728,8 +9338,7 @@ genIpop (popIc); /* if the condition is a bit variable */ - if (isbit && IS_ITEMP (cond) && - SPIL_LOC (cond)) + if (isbit && IS_ITEMP (cond) && SPIL_LOC (cond)) genIfxJump (ic, SPIL_LOC (cond)->rname); else if (isbit && !IS_ITEMP (cond)) genIfxJump (ic, OP_SYMBOL (cond)->rname); @@ -8744,7 +9353,7 @@ /* genAddrOf - generates code for address of */ /*-----------------------------------------------------------------*/ static void -genAddrOf (const iCode *ic) +genAddrOf (const iCode * ic) { symbol *sym = OP_SYMBOL (IC_LEFT (ic)); @@ -8766,35 +9375,51 @@ { setupPairFromSP (PAIR_HL, sym->stack + _G.stack.pushed + _G.stack.offset + _G.stack.param_offset); } - commitPair (AOP (IC_RESULT (ic)), PAIR_HL); + commitPair (AOP (IC_RESULT (ic)), PAIR_HL, ic, FALSE); } else { emit2 ("ld de,!hashedstr", sym->rname); regalloc_dry_run_cost += 3; - commitPair (AOP (IC_RESULT (ic)), PAIR_DE); + commitPair (AOP (IC_RESULT (ic)), PAIR_DE, ic, FALSE); } } else { - spillPair (PAIR_HL); + PAIR_ID pair; + if (sym->onStack) { + if (getPairId (AOP (IC_RESULT (ic))) == PAIR_IY) + pair = PAIR_IY; + else + { + pair = PAIR_HL; + spillPair (PAIR_HL); + } + /* if it has an offset then we need to compute it */ if (sym->stack > 0) - emit2 ("ld hl,!immedword", sym->stack + _G.stack.pushed + _G.stack.offset + _G.stack.param_offset); + emit2 ("ld %s,!immedword", _pairs[pair].name, + sym->stack + _G.stack.pushed + _G.stack.offset + _G.stack.param_offset); else - emit2 ("ld hl,!immedword", sym->stack + _G.stack.pushed + _G.stack.offset); - regalloc_dry_run_cost += 3; - emit2 ("add hl,sp"); - regalloc_dry_run_cost += 1; + emit2 ("ld %s,!immedword", _pairs[pair].name, sym->stack + _G.stack.pushed + _G.stack.offset); + regalloc_dry_run_cost += (pair == PAIR_IY ? 4 : 3); + emit2 ("add %s,sp", _pairs[pair].name); + regalloc_dry_run_cost += (pair == PAIR_IY ? 2 : 1); } else { - emit2 ("ld hl,!hashedstr", sym->rname); - regalloc_dry_run_cost += 3; + pair = getPairId (AOP (IC_RESULT (ic))); + if (pair == PAIR_INVALID) + { + pair = PAIR_HL; + spillPair (PAIR_HL); + } + emit2 ("ld %s,!hashedstr", _pairs[pair].name, sym->rname); + regalloc_dry_run_cost += (pair == PAIR_IY ? 4 : 3); } - commitPair (AOP (IC_RESULT (ic)), PAIR_HL); + commitPair (AOP (IC_RESULT (ic)), pair, ic, FALSE); } freeAsmop (IC_RESULT (ic), NULL, ic); } @@ -8803,7 +9428,7 @@ /* genAssign - generate code for assignment */ /*-----------------------------------------------------------------*/ static void -genAssign (const iCode *ic) +genAssign (const iCode * ic) { operand *result, *right; int size, offset; @@ -8845,35 +9470,73 @@ { fetchPairLong (getPairId (AOP (result)), AOP (right), ic, LSB); } + else if (isPair (AOP (right)) && AOP_TYPE (result) == AOP_IY && size == 2) + { + /* Assigning directly is cheaper than using IY. */ + emit2 ("ld (%s), %s", AOP (result)->aopu.aop_dir, getPairName (AOP (right))); + regalloc_dry_run_cost += (getPairId (AOP (right)) == PAIR_HL) ? 3 : 4; + } + else if (size == 2 && isPairDead (PAIR_HL, ic) && + (!IS_GB && AOP_TYPE (right) == AOP_STK && AOP_TYPE (result) == AOP_IY || + IS_RAB && (AOP_TYPE(result) == AOP_STK || AOP_TYPE(result) == AOP_EXSTK) && (AOP_TYPE(right) == AOP_LIT || AOP_TYPE (right) == AOP_IMMD))) + { + fetchPair (PAIR_HL, AOP (right)); + commitPair (AOP (result), PAIR_HL, ic, FALSE); + } + else if (size == 2 && getPairId (AOP (right)) != PAIR_INVALID && getPairId (AOP (right)) != PAIR_IY && AOP_TYPE (result) != AOP_REG) + { + commitPair (AOP (result), getPairId (AOP (right)), ic, TRUE); + } else if (getPairId (AOP (right)) == PAIR_IY) { while (size--) { - if(size == 0) + if (size == 0) { emit2 ("push iy"); emit2 ("dec sp"); emit2 ("pop af"); emit2 ("inc sp"); regalloc_dry_run_cost += 5; - cheapMove (AOP (result), size, ASMOP_A , 0); + if (AOP_TYPE (result) == AOP_IY) /* Take care not to overwrite iy */ + { + emit2 ("ld (%s+%d), a", AOP (result)->aopu.aop_dir, size); + regalloc_dry_run_cost += 3; + } + else + cheapMove (AOP (result), size, ASMOP_A, 0); } - else if(size == 1) + else if (size == 1) { - emit2 ("push iy"); - emit2 ("pop af"); - regalloc_dry_run_cost += 3; - cheapMove (AOP (result), size, ASMOP_A , 0); + if (AOP_TYPE (result) == AOP_IY) /* Take care not to overwrite iy */ + { + emit2 ("ld (%s), iy", AOP (result)->aopu.aop_dir); + regalloc_dry_run_cost += 4; + size--; + } + else + { + emit2 ("push iy"); + emit2 ("pop af"); + regalloc_dry_run_cost += 3; + cheapMove (AOP (result), size, ASMOP_A, 0); + } } else - cheapMove (AOP (result), size, ASMOP_ZERO, 0); + { + if (AOP_TYPE (result) == AOP_IY) /* Take care not to overwrite iy */ + { + cheapMove (ASMOP_A, 0, ASMOP_ZERO, 0); + emit2 ("ld (%s+%d), a", AOP (result)->aopu.aop_dir, size); + regalloc_dry_run_cost += 3; + } + else + cheapMove (AOP (result), size, ASMOP_ZERO, 0); + } } } else if ((size > 1) && - (AOP_TYPE (result) != AOP_REG) && - (AOP_TYPE (right) == AOP_LIT) && - !IS_FLOAT (operandType (right)) && - (lit < 256L)) + (AOP_TYPE (result) != AOP_REG) && (AOP_TYPE (right) == AOP_LIT) && !IS_FLOAT (operandType (right)) && (lit < 256L)) { bool fXored = FALSE; offset = 0; @@ -8896,7 +9559,7 @@ offset++; } } - else if (size == 2 && requiresHL (AOP (right)) && requiresHL (AOP (result)) && (IS_GB /*|| IY_RESERVED*/)) + else if (size == 2 && requiresHL (AOP (right)) && requiresHL (AOP (result)) && isPairDead (PAIR_DE, ic) && (IS_GB /*|| IY_RESERVED */ )) { /* Special case. Load into a and d, then load out. */ cheapMove (ASMOP_A, 0, AOP (right), 0); @@ -8904,7 +9567,7 @@ cheapMove (AOP (result), 0, ASMOP_A, 0); cheapMove (AOP (result), 1, ASMOP_E, 0); } - else if (size == 4 && requiresHL (AOP (right)) && requiresHL (AOP (result)) && (IS_GB /*|| IY_RESERVED*/)) + else if (size == 4 && requiresHL (AOP (right)) && requiresHL (AOP (result)) && isPairDead (PAIR_DE, ic) && (IS_GB /*|| IY_RESERVED */ )) { /* Special case - simple memcpy */ if (!regalloc_dry_run) @@ -8914,7 +9577,7 @@ emit2 ("ld e,l"); aopGet (AOP (result), LSB, FALSE); } - regalloc_dry_run_cost += 8; // Todo: More exact cost here! + regalloc_dry_run_cost += 8; // Todo: More exact cost here! while (size--) { @@ -8933,45 +9596,142 @@ } else { + if (!IS_GB && /* gbz80 doesn't have ldir */ + (AOP_TYPE (result) == AOP_STK || AOP_TYPE (result) == AOP_EXSTK || AOP_TYPE (result) == AOP_DIR + || AOP_TYPE (result) == AOP_IY) && (AOP_TYPE (right) == AOP_STK || AOP_TYPE (right) == AOP_EXSTK + || AOP_TYPE (right) == AOP_DIR || AOP_TYPE (right) == AOP_IY) && size >= 2) + { + /* This estimation is only accurate, if neither operand is AOP_EXSTK, and we are optimizing for code size or targeting the z80 or z180. */ + int sizecost_n, sizecost_l, cyclecost_n, cyclecost_l; + const bool hl_alive = !isPairDead (PAIR_HL, ic); + const bool de_alive = !isPairDead (PAIR_DE, ic); + const bool bc_alive = !isPairDead (PAIR_BC, ic); + bool l_better; + sizecost_n = 6 * size; + sizecost_l = 13 + hl_alive * 2 + de_alive * 2 + bc_alive * 2 - (AOP_TYPE (right) == AOP_DIR + || AOP_TYPE (right) == AOP_IY) - (AOP_TYPE (result) == + AOP_DIR + || AOP_TYPE (result) + == AOP_IY) * 2; + if (IS_Z180) + cyclecost_n = 30 * size; + else /* Z80 */ + cyclecost_n = 38 * size; + if (IS_Z180) + cyclecost_l = 14 * size + 42 + hl_alive * 22 + de_alive * 22 + bc_alive * 22 - (AOP_TYPE (right) == AOP_DIR + || AOP_TYPE (right) == + AOP_IY) * 7 - (AOP_TYPE (result) == + AOP_DIR + || AOP_TYPE (result) + == AOP_IY) * 10; + else /* Z80 */ + cyclecost_l = 21 * size + 51 + hl_alive * 20 + de_alive * 20 + bc_alive * 20 - (AOP_TYPE (right) == AOP_DIR + || AOP_TYPE (right) == + AOP_IY) * 11 - (AOP_TYPE (result) == + AOP_DIR + || AOP_TYPE (result) + == AOP_IY) * 15; + + if (optimize.codeSize) + l_better = (sizecost_l < sizecost_n || sizecost_l == sizecost_n && cyclecost_l < cyclecost_n); + else + l_better = (cyclecost_l < cyclecost_n || cyclecost_l == cyclecost_n && sizecost_l < sizecost_n); + if (l_better) + { + if (hl_alive) + _push (PAIR_HL); + if (de_alive) + _push (PAIR_DE); + if (bc_alive) + _push (PAIR_BC); + + if (AOP_TYPE (result) == AOP_STK || AOP_TYPE (result) == AOP_EXSTK) + { + int fp_offset = + AOP (result)->aopu.aop_stk + offset + _G.stack.offset + (AOP (result)->aopu.aop_stk > + 0 ? _G.stack.param_offset : 0); + int sp_offset = fp_offset + _G.stack.pushed; + emit2 ("ld hl, #%d", sp_offset); + emit2 ("add hl, sp"); + emit2 ("ex de, hl"); + regalloc_dry_run_cost += 5; + } + else + { + emit2 ("ld de, #%s", AOP (IC_RESULT (ic))->aopu.aop_dir); + regalloc_dry_run_cost += 3; + } + + if (AOP_TYPE (right) == AOP_STK || AOP_TYPE (right) == AOP_EXSTK) + { + int fp_offset = + AOP (right)->aopu.aop_stk + offset + _G.stack.offset + (AOP (right)->aopu.aop_stk > + 0 ? _G.stack.param_offset : 0); + int sp_offset = fp_offset + _G.stack.pushed; + emit2 ("ld hl, #%d", sp_offset); + emit2 ("add hl, sp"); + regalloc_dry_run_cost += 4; + } + else + { + emit2 ("ld hl, #%s", AOP (IC_RIGHT (ic))->aopu.aop_dir); + regalloc_dry_run_cost += 3; + } + + emit2 ("ld bc, #%d", size); + emit2 ("ldir"); + regalloc_dry_run_cost += 5; + + if (bc_alive) + _pop (PAIR_BC); + if (de_alive) + _pop (PAIR_DE); + if (hl_alive) + _pop (PAIR_HL); + + goto release; + } + } if (AOP_TYPE (result) == AOP_REG && AOP_TYPE (right) == AOP_REG) { // We need to be able to handle any assignment here, ensuring not to overwrite any parts of the source that we still need. - - bool assigned[8] = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}; // This has to be made bigger when sdcc supports variables larger than 8 bytes in registers. + + bool assigned[8] = { FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }; // This has to be made bigger when sdcc supports variables larger than 8 bytes in registers. int cached_byte = -1; while (size--) { int i; - + // Find lowest byte that can be assigned and needs to be assigned. for (i = 0; i < AOP_SIZE (result); i++) { int j; - + if (assigned[i]) continue; - + for (j = 0; j < (AOP_SIZE (result) < AOP_SIZE (right) ? AOP_SIZE (result) : AOP_SIZE (right)); j++) { if (!assigned[j] && i != j && AOP (result)->aopu.aop_reg[i]->rIdx == AOP (right)->aopu.aop_reg[j]->rIdx) goto skip_byte; // We can't write this one without overwriting the source. } - - break; // Found byte that can be written safely. - - skip_byte:; + + break; // Found byte that can be written safely. + +skip_byte: + ; } if (i < AOP_SIZE (result)) { - cheapMove (AOP (result), i, AOP(right), i); // We can safely assign a byte. + cheapMove (AOP (result), i, AOP (right), i); // We can safely assign a byte. assigned[i] = TRUE; continue; } - + // No byte can be assigned safely (i.e. the assignment is a permutation). Cache one in the accumulator. - + if (cached_byte != -1) { // Already one cached. Can happen when the assignment is a permutation consisting of multiple cycles. @@ -8979,16 +9739,16 @@ cached_byte = -1; continue; } - + for (i = 0; i < AOP_SIZE (result); i++) if (!assigned[i]) break; - wassertl (i != AOP_SIZE (result), "genAssign error: Trying to cache non-existant byte in accumulator."); + wassertl (i != AOP_SIZE (result), "genAssign error: Trying to cache non-existant byte in accumulator."); cheapMove (ASMOP_A, 0, AOP (right), i); assigned[i] = TRUE; cached_byte = i; } - + if (cached_byte != -1) cheapMove (AOP (result), cached_byte, ASMOP_A, 0); } @@ -9019,57 +9779,58 @@ /* genJumpTab - genrates code for jump table */ /*-----------------------------------------------------------------*/ static void -genJumpTab (const iCode *ic) +genJumpTab (const iCode * ic) { symbol *jtab = NULL; aopOp (IC_JTCOND (ic), ic, FALSE, FALSE); /* get the condition into accumulator */ - if (!IS_GB && !isPairDead(PAIR_DE, ic)) + if (!IS_GB && !isPairDead (PAIR_DE, ic)) _push (PAIR_DE); cheapMove (ASMOP_E, 0, AOP (IC_JTCOND (ic)), 0); - if(!regalloc_dry_run) + if (!regalloc_dry_run) { emit2 ("ld d,!zero"); jtab = newiTempLabel (NULL); } regalloc_dry_run_cost += 2; spillPair (PAIR_HL); - if(!regalloc_dry_run) + if (!regalloc_dry_run) { - emit2 ("ld hl,!immed!tlabel", jtab->key + 100); + emit2 ("ld hl,!immed!tlabel", labelKey2num (jtab->key)); emit2 ("add hl,de"); emit2 ("add hl,de"); emit2 ("add hl,de"); } regalloc_dry_run_cost += 5; freeAsmop (IC_JTCOND (ic), NULL, ic); - if (!IS_GB && !isPairDead(PAIR_DE, ic)) + if (!IS_GB && !isPairDead (PAIR_DE, ic)) _pop (PAIR_DE); - if(!regalloc_dry_run) + if (!regalloc_dry_run) { emit2 ("jp !*hl"); - emitLabel (jtab->key + 100); + emitLabelSpill (jtab); } regalloc_dry_run_cost += 1; /* now generate the jump labels */ - for (jtab = setFirstItem (IC_JTLABELS (ic)); jtab; - jtab = setNextItem (IC_JTLABELS (ic))) - if(!regalloc_dry_run) - emit2 ("jp !tlabel", jtab->key + 100); - /*regalloc_dry_run_cost += 3 doesn't matter and might overflow cost*/ + for (jtab = setFirstItem (IC_JTLABELS (ic)); jtab; jtab = setNextItem (IC_JTLABELS (ic))) + if (!regalloc_dry_run) + emit2 ("jp !tlabel", labelKey2num (jtab->key)); + /*regalloc_dry_run_cost += 3 doesn't matter and might overflow cost */ } /*-----------------------------------------------------------------*/ /* genCast - gen code for casting */ /*-----------------------------------------------------------------*/ static void -genCast (const iCode *ic) +genCast (const iCode * ic) { operand *result = IC_RESULT (ic); sym_link *rtype = operandType (IC_RIGHT (ic)); operand *right = IC_RIGHT (ic); int size, offset; + bool surviving_a = !options.oldralloc && bitVectBitValue (ic->rSurv, A_IDX); + bool pushed_a = FALSE; /* if they are equivalent then do nothing */ if (operandsEqu (IC_RESULT (ic), IC_RIGHT (ic))) @@ -9085,7 +9846,7 @@ } /* casting to bool */ - if (IS_BOOL(operandType(result))) + if (IS_BOOL (operandType (result))) { _castBoolean (right); outAcc (result); @@ -9113,13 +9874,15 @@ /* now depending on the sign of the destination */ size = AOP_SIZE (result) - AOP_SIZE (right); /* Unsigned or not an integral type - right fill with zeros */ - if (!IS_SPEC (rtype) || SPEC_USIGN (rtype) || AOP_TYPE(right)==AOP_CRY) + if (!IS_SPEC (rtype) || SPEC_USIGN (rtype) || AOP_TYPE (right) == AOP_CRY) { while (size--) aopPut3 (AOP (result), offset++, ASMOP_ZERO, 0); } else { + if (surviving_a && !pushed_a) + _push (PAIR_AF), pushed_a = TRUE; /* we need to extend the sign :{ */ cheapMove (ASMOP_A, 0, AOP (right), AOP_SIZE (right) - 1); emit3 (A_RLA, 0, 0); @@ -9129,6 +9892,8 @@ } release: + if (pushed_a) + _pop (PAIR_AF); freeAsmop (right, NULL, ic); freeAsmop (result, NULL, ic); } @@ -9137,27 +9902,26 @@ /* genReceive - generate code for a receive iCode */ /*-----------------------------------------------------------------*/ static void -genReceive (const iCode *ic) +genReceive (const iCode * ic) { - wassert(!regalloc_dry_run); + wassert (!regalloc_dry_run); - if (isOperandInFarSpace (IC_RESULT (ic)) && - (OP_SYMBOL (IC_RESULT (ic))->isspilt || - IS_TRUE_SYMOP (IC_RESULT (ic)))) + if (isOperandInFarSpace (IC_RESULT (ic)) && (OP_SYMBOL (IC_RESULT (ic))->isspilt || IS_TRUE_SYMOP (IC_RESULT (ic)))) { wassert (0); } else { - // PENDING: HACK - int size; - int i; + // PENDING: HACK + int size; + int i; - aopOp (IC_RESULT (ic), ic, FALSE, FALSE); - size = AOP_SIZE(IC_RESULT(ic)); + aopOp (IC_RESULT (ic), ic, FALSE, FALSE); + size = AOP_SIZE (IC_RESULT (ic)); - for (i = 0; i < size; i++) { - aopPut(AOP(IC_RESULT(ic)), _fReceive[_G.receiveOffset++], i); + for (i = 0; i < size; i++) + { + aopPut (AOP (IC_RESULT (ic)), _fReceive[_G.receiveOffset++], i); } } @@ -9168,7 +9932,7 @@ /* genDummyRead - generate code for dummy read of volatiles */ /*-----------------------------------------------------------------*/ static void -genDummyRead (const iCode *ic) +genDummyRead (const iCode * ic) { operand *op; int size, offset; @@ -9214,11 +9978,11 @@ /* genCritical - generate code for start of a critical sequence */ /*-----------------------------------------------------------------*/ static void -genCritical (const iCode *ic) +genCritical (const iCode * ic) { symbol *tlbl = regalloc_dry_run ? 0 : newiTempLabel (0); - if (IS_GB || IS_R2K) + if (IS_GB || IS_RAB) { emit2 ("!di"); regalloc_dry_run_cost += 1; @@ -9227,22 +9991,22 @@ { aopOp (IC_RESULT (ic), ic, TRUE, FALSE); aopPut3 (AOP (IC_RESULT (ic)), 0, ASMOP_ZERO, 0); - if(!regalloc_dry_run) + if (!regalloc_dry_run) { //get interrupt enable flag IFF2 into P/O emit2 ("ld a,i"); - + //disable interrupt emit2 ("!di"); //parity odd <==> P/O=0 <==> interrupt enable flag IFF2=0 - emit2 ("jp PO,!tlabel", tlbl->key + 100); + emit2 ("jp PO,!tlabel", labelKey2num (tlbl->key)); } regalloc_dry_run_cost += 5; aopPut3 (AOP (IC_RESULT (ic)), 0, ASMOP_ONE, 0); - if(!regalloc_dry_run_cost) + if (!regalloc_dry_run) { - emit2 ("!tlabeldef", (tlbl->key + 100)); - _G.lines.current->isLabel = 1; + emit2 ("!tlabeldef", labelKey2num ((tlbl->key))); + genLine.lineCurr->isLabel = 1; } freeAsmop (IC_RESULT (ic), NULL, ic); } @@ -9250,12 +10014,15 @@ { //get interrupt enable flag IFF2 into P/O emit2 ("ld a,i"); - + //disable interrupt emit2 ("!di"); regalloc_dry_run_cost += 2; //save P/O flag - _push (PAIR_AF); + if (!regalloc_dry_run) // _push unbalances _G.stack.pushed. + _push (PAIR_AF); + else + regalloc_dry_run_cost++; } } @@ -9263,7 +10030,7 @@ /* genEndCritical - generate code for end of a critical sequence */ /*-----------------------------------------------------------------*/ static void -genEndCritical (const iCode *ic) +genEndCritical (const iCode * ic) { symbol *tlbl = regalloc_dry_run ? 0 : newiTempLabel (0); @@ -9272,7 +10039,7 @@ emit2 ("!ei"); regalloc_dry_run_cost += 1; } - else if (IS_R2K) + else if (IS_RAB) { emit2 ("ipres"); regalloc_dry_run_cost += 1; @@ -9281,13 +10048,13 @@ { aopOp (IC_RIGHT (ic), ic, FALSE, TRUE); _toBoolean (IC_RIGHT (ic), TRUE); - - if(!regalloc_dry_run) + + if (!regalloc_dry_run) { //don't enable interrupts if they were off before - emit2 ("jp Z,!tlabel", tlbl->key + 100); + emit2 ("jp Z,!tlabel", labelKey2num (tlbl->key)); emit2 ("!ei"); - emitLabel (tlbl->key + 100); + emitLabelSpill (tlbl); } regalloc_dry_run_cost += 4; freeAsmop (IC_RIGHT (ic), NULL, ic); @@ -9295,26 +10062,29 @@ else { //restore P/O flag - _pop (PAIR_AF); + if (!regalloc_dry_run) // _pop unbalances _G.stack.pushed. + _pop (PAIR_AF); + else + regalloc_dry_run_cost++; //parity odd <==> P/O=0 <==> interrupt enable flag IFF2 was 0 <==> //don't enable interrupts as they were off before - if(!regalloc_dry_run) + if (!regalloc_dry_run) { - emit2 ("jp PO,!tlabel", tlbl->key + 100); + emit2 ("jp PO,!tlabel", labelKey2num (tlbl->key)); emit2 ("!ei"); - emit2 ("!tlabeldef", (tlbl->key + 100)); - _G.lines.current->isLabel = 1; + emit2 ("!tlabeldef", labelKey2num ((tlbl->key))); + genLine.lineCurr->isLabel = 1; } regalloc_dry_run_cost += 4; } } -#if 0 //Disabled since it doesn't work for arrays of float. +#if 0 //Disabled since it doesn't work for arrays of float. enum - { - /** Maximum number of bytes to emit per line. */ - DBEMIT_MAX_RUN = 8 - }; +{ + /** Maximum number of bytes to emit per line. */ + DBEMIT_MAX_RUN = 8 +}; /** Context for the byte output chunker. */ typedef struct @@ -9328,20 +10098,20 @@ reseting. */ static void -_dbFlush(DBEMITCTX *self) +_dbFlush (DBEMITCTX * self) { char line[256]; if (self->pos > 0) { int i; - sprintf(line, ".db 0x%02X", self->buffer[0]); + sprintf (line, ".db 0x%02X", self->buffer[0]); for (i = 1; i < self->pos; i++) { - sprintf(line + strlen(line), ", 0x%02X", self->buffer[i]); + sprintf (line + strlen (line), ", 0x%02X", self->buffer[i]); } - emit2(line); + emit2 (line); } self->pos = 0; } @@ -9350,11 +10120,11 @@ generated. */ static void -_dbEmit(DBEMITCTX *self, int c) +_dbEmit (DBEMITCTX * self, int c) { if (self->pos == DBEMIT_MAX_RUN) { - _dbFlush(self); + _dbFlush (self); } self->buffer[self->pos++] = c; } @@ -9370,30 +10140,30 @@ } RLECTX; enum - { - RLE_CHANGE_COST = 4, - RLE_MAX_BLOCK = 127 - }; +{ + RLE_CHANGE_COST = 4, + RLE_MAX_BLOCK = 127 +}; /** Flush the buffer of a run length encoder by writing out the run or data that it currently contains. */ static void -_rleCommit(RLECTX *self) +_rleCommit (RLECTX * self) { int i; if (self->pos != 0) { DBEMITCTX db; - memset(&db, 0, sizeof(db)); + memset (&db, 0, sizeof (db)); - emit2(".db %u", self->pos); + emit2 (".db %u", self->pos); for (i = 0; i < self->pos; i++) { - _dbEmit(&db, self->buffer[i]); + _dbEmit (&db, self->buffer[i]); } - _dbFlush(&db); + _dbFlush (&db); } /* Reset */ self->pos = 0; @@ -9420,7 +10190,7 @@ chunks. */ static void -_rleAppend(RLECTX *self, unsigned c) +_rleAppend (RLECTX * self, unsigned c) { int i; @@ -9429,13 +10199,13 @@ /* The run has stopped. See if it is worthwhile writing it out as a run. Note that the random data comes in as runs of length one. - */ + */ if (self->runLen > RLE_CHANGE_COST) { /* Yes, worthwhile. */ /* Commit whatever was in the buffer. */ - _rleCommit(self); - emit2("!db !immed-%u,!immedbyte", self->runLen, self->last); + _rleCommit (self); + emit2 ("!db !immed-%u,!immedbyte", self->runLen, self->last); } else { @@ -9445,7 +10215,7 @@ if (self->pos >= RLE_MAX_BLOCK) { /* Commit. */ - _rleCommit(self); + _rleCommit (self); } self->buffer[self->pos++] = self->last; } @@ -9458,7 +10228,7 @@ if (self->runLen >= RLE_MAX_BLOCK) { /* Commit whatever was in the buffer. */ - _rleCommit(self); + _rleCommit (self); emit2 ("!db !immed-%u,!immedbyte", self->runLen, self->last); self->runLen = 0; @@ -9468,10 +10238,10 @@ } static void -_rleFlush(RLECTX *self) +_rleFlush (RLECTX * self) { - _rleAppend(self, -1); - _rleCommit(self); + _rleAppend (self, -1); + _rleCommit (self); self->pos = 0; self->last = 0; self->runLen = 0; @@ -9485,32 +10255,32 @@ genArrayInit (iCode * ic) { literalList *iLoop; - int ix; - int elementSize = 0, eIndex, i; - unsigned val, lastVal; - sym_link *type; - RLECTX rle; + int ix; + int elementSize = 0, eIndex, i; + unsigned val, lastVal; + sym_link *type; + RLECTX rle; - memset(&rle, 0, sizeof(rle)); + memset (&rle, 0, sizeof (rle)); - aopOp (IC_LEFT(ic), ic, FALSE, FALSE); + aopOp (IC_LEFT (ic), ic, FALSE, FALSE); - _saveRegsForCall(ic, 0); + _saveRegsForCall (ic, 0); fetchPair (PAIR_HL, AOP (IC_LEFT (ic))); emit2 ("call __initrleblock"); - type = operandType(IC_LEFT(ic)); + type = operandType (IC_LEFT (ic)); if (type && type->next) { - if (IS_SPEC(type->next) || IS_PTR(type->next)) + if (IS_SPEC (type->next) || IS_PTR (type->next)) { - elementSize = getSize(type->next); + elementSize = getSize (type->next); } - else if (IS_ARRAY(type->next) && type->next->next) + else if (IS_ARRAY (type->next) && type->next->next) { - elementSize = getSize(type->next->next); + elementSize = getSize (type->next->next); } else { @@ -9525,14 +10295,14 @@ wassertl ((elementSize > 0) && (elementSize <= 4), "Illegal element size in genArrayInit."); - iLoop = IC_ARRAYILIST(ic); - lastVal = (unsigned)-1; + iLoop = IC_ARRAYILIST (ic); + lastVal = (unsigned) - 1; /* Feed all the bytes into the run length encoder which will handle the actual output. This works well for mixed char data, and for random int and long data. - */ + */ while (iLoop) { ix = iLoop->count; @@ -9541,23 +10311,23 @@ { for (eIndex = 0; eIndex < elementSize; eIndex++) { - val = (((int)iLoop->literalValue) >> (eIndex * 8)) & 0xff; - _rleAppend(&rle, val); + val = (((int) iLoop->literalValue) >> (eIndex * 8)) & 0xff; + _rleAppend (&rle, val); } } iLoop = iLoop->next; } - _rleFlush(&rle); + _rleFlush (&rle); /* Mark the end of the run. */ - emit2(".db 0"); + emit2 (".db 0"); - _restoreRegsAfterCall(); + _restoreRegsAfterCall (); spillCached (); - freeAsmop (IC_LEFT(ic), NULL, ic); + freeAsmop (IC_LEFT (ic), NULL, ic); } #endif @@ -9582,10 +10352,11 @@ #endif static int -setupForMemcpy (const iCode *ic, int nparams, operand **pparams) +setupForMemcpy (const iCode * ic, int nparams, operand ** pparams) { PAIR_ID ids[NUM_PAIRS][NUM_PAIRS]; - PAIR_ID dest[3] = { + PAIR_ID dest[3] = + { PAIR_DE, PAIR_HL, PAIR_BC }; @@ -9594,7 +10365,7 @@ int nunity = 0; #endif - bool skip[3] = {FALSE, FALSE, FALSE}; + bool skip[3] = { FALSE, FALSE, FALSE }; short dstregs[4]; short srcregs[4]; size_t regparamsize = 0; @@ -9606,7 +10377,7 @@ for (i = 0; i < nparams; i++) { - aopOp (pparams[i], ic, FALSE, FALSE); // Todo: Free these. + aopOp (pparams[i], ic, FALSE, FALSE); // Todo: Free these. ids[dest[i]][getPairId (AOP (pparams[i]))] = TRUE; } @@ -9617,24 +10388,24 @@ return (0); #ifndef UNITY - if(AOP_TYPE (pparams[0]) == AOP_REG) - { - srcregs[regparamsize] = AOP (pparams[0])->aopu.aop_reg[0]->rIdx; - dstregs[regparamsize++] = E_IDX; - srcregs[regparamsize] = AOP (pparams[0])->aopu.aop_reg[1]->rIdx; - dstregs[regparamsize++] = D_IDX; - skip[0] = TRUE; - } - if(AOP_TYPE (pparams[1]) == AOP_REG) - { - srcregs[regparamsize] = AOP (pparams[1])->aopu.aop_reg[0]->rIdx; - dstregs[regparamsize++] = L_IDX; - srcregs[regparamsize] = AOP (pparams[1])->aopu.aop_reg[1]->rIdx; - dstregs[regparamsize++] = H_IDX; - skip[1] = TRUE; - } + if (AOP_TYPE (pparams[0]) == AOP_REG) + { + srcregs[regparamsize] = AOP (pparams[0])->aopu.aop_reg[0]->rIdx; + dstregs[regparamsize++] = E_IDX; + srcregs[regparamsize] = AOP (pparams[0])->aopu.aop_reg[1]->rIdx; + dstregs[regparamsize++] = D_IDX; + skip[0] = TRUE; + } + if (AOP_TYPE (pparams[1]) == AOP_REG) + { + srcregs[regparamsize] = AOP (pparams[1])->aopu.aop_reg[0]->rIdx; + dstregs[regparamsize++] = L_IDX; + srcregs[regparamsize] = AOP (pparams[1])->aopu.aop_reg[1]->rIdx; + dstregs[regparamsize++] = H_IDX; + skip[1] = TRUE; + } - if(regparamsize) + if (regparamsize) regMove (dstregs, srcregs, regparamsize); for (i = 0; i < 3; i++) @@ -9644,7 +10415,7 @@ } return (1); -#else +#else /* Count the number of unity or iTemp assigns. */ for (i = 0; i < 3; i++) { @@ -9677,7 +10448,7 @@ } else { - fetchPair(dest[i], AOP (pparams[i])); + fetchPair (dest[i], AOP (pparams[i])); goto done; } } @@ -9704,11 +10475,11 @@ else { /* Found one. */ - if(ids[j][dest[i]] == TRUE) + if (ids[j][dest[i]] == TRUE) { /* Just swap. */ - _swap (j, dest[i]); - goto done; + _swap (j, dest[i]); + goto done; } else { @@ -9723,19 +10494,19 @@ } } } - if(dest_pairs[0] != src_pairs[1]) - { - fetchPair (dest_pairs[0], AOP (pparams[i_pairs[0]])); - fetchPair (dest_pairs[1], AOP (pparams[i_pairs[1]])); - } - else - { - fetchPair (dest_pairs[1], AOP (pparams[i_pairs[1]])); - fetchPair (dest_pairs[0], AOP (pparams[i_pairs[0]])); - } + if (dest_pairs[0] != src_pairs[1]) + { + fetchPair (dest_pairs[0], AOP (pparams[i_pairs[0]])); + fetchPair (dest_pairs[1], AOP (pparams[i_pairs[1]])); + } + else + { + fetchPair (dest_pairs[1], AOP (pparams[i_pairs[1]])); + fetchPair (dest_pairs[0], AOP (pparams[i_pairs[0]])); + } } - done: +done: /* Finally pull out all of the iTemps */ for (i = 0; i < 3; i++) { @@ -9750,7 +10521,7 @@ } static void -genBuiltInMemcpy (const iCode *ic, int nParams, operand **pparams) +genBuiltInMemcpy (const iCode * ic, int nParams, operand ** pparams) { operand *from, *to, *count; @@ -9779,10 +10550,12 @@ } static void -genBuiltInMemset (const iCode *ic, int nParams, operand **pparams) +genBuiltInMemset (const iCode * ic, int nParams, operand ** pparams) { operand *dst, *c, *n; bool direct_c; + bool indirect_c; + bool preinc = FALSE; wassertl (nParams == 3, "Built-in memset() must have three parameters"); @@ -9800,23 +10573,39 @@ if (!(ulFromVal (AOP (n)->aopu.aop_lit))) goto done; - direct_c = (AOP_TYPE (c) == AOP_LIT || AOP_TYPE (c) == AOP_REG && AOP (c)->aopu.aop_reg[1]->rIdx != H_IDX && AOP (c)->aopu.aop_reg[1]->rIdx != L_IDX); + direct_c = (AOP_TYPE (c) == AOP_LIT || AOP_TYPE (c) == AOP_REG && AOP (c)->aopu.aop_reg[1]->rIdx != H_IDX + && AOP (c)->aopu.aop_reg[1]->rIdx != L_IDX); + indirect_c = IS_R3KA && ulFromVal (AOP (n)->aopu.aop_lit) > 1 && AOP_TYPE (c) == AOP_IY; - if (!direct_c) - cheapMove(ASMOP_A, 0, AOP (c), 0); - fetchPair (PAIR_HL, AOP (dst)); - if (!regalloc_dry_run) - emit2 ( "ld (hl), %s", aopGet(direct_c ? AOP (c) : ASMOP_A, 0, FALSE)); - regalloc_dry_run_cost += (direct_c && AOP_TYPE (c) == AOP_LIT) ? 2 : 1; - if (ulFromVal (AOP (n)->aopu.aop_lit) <= 1) - goto done; + if (indirect_c) + { + fetchPair (PAIR_DE, AOP (dst)); + emit2 ("ld hl, #%s", AOP (c)->aopu.aop_dir); + regalloc_dry_run_cost += 3; + } + else + { + if (!direct_c) + cheapMove (ASMOP_A, 0, AOP (c), 0); + fetchPair (PAIR_HL, AOP (dst)); + if (!regalloc_dry_run) + emit2 ("ld (hl), %s", aopGet (direct_c ? AOP (c) : ASMOP_A, 0, FALSE)); + regalloc_dry_run_cost += (direct_c && AOP_TYPE (c) == AOP_LIT) ? 2 : 1; + if (ulFromVal (AOP (n)->aopu.aop_lit) <= 1) + goto done; - emit2 ("ld e, l"); - emit2 ("ld d, h"); - emit2 ("inc de"); - regalloc_dry_run_cost += 3; - emit2 ("ld bc, #%d", ulFromVal (AOP (n)->aopu.aop_lit) - 1); - emit2 ("ldir"); + emit2 ("ld e, l"); + emit2 ("ld d, h"); + regalloc_dry_run_cost += 2; + if (!IS_R3KA || !optimize.codeSize) + { + emit2 ("inc de"); + regalloc_dry_run_cost++; + preinc = TRUE; + } + } + emit2 ("ld bc, !immedword", ulFromVal (AOP (n)->aopu.aop_lit) - preinc); + emit2 (IS_R3KA ? "lsidr" : "ldir"); regalloc_dry_run_cost += 5; done: @@ -9828,7 +10617,7 @@ _restoreRegsAfterCall (); - /* No need to assign result - would have used ordinary memcpy() call instead. */ + /* No need to assign result - would have used ordinary memset() call instead. */ } /*-----------------------------------------------------------------*/ @@ -9836,40 +10625,40 @@ /* for a built in function */ /*-----------------------------------------------------------------*/ static void -genBuiltIn (iCode *ic) +genBuiltIn (iCode * ic) { - operand *bi_parms[MAX_BUILTIN_ARGS]; - int nbi_parms; - iCode *bi_iCode; - symbol *bif; + operand *bi_parms[MAX_BUILTIN_ARGS]; + int nbi_parms; + iCode *bi_iCode; + symbol *bif; - /* get all the arguments for a built in function */ - bi_iCode = getBuiltinParms(ic, &nbi_parms, bi_parms); + /* get all the arguments for a built in function */ + bi_iCode = getBuiltinParms (ic, &nbi_parms, bi_parms); - /* which function is it */ - bif = OP_SYMBOL(IC_LEFT(bi_iCode)); + /* which function is it */ + bif = OP_SYMBOL (IC_LEFT (bi_iCode)); - if (!strcmp(bif->name, "__builtin_memcpy")) - { - genBuiltInMemcpy(bi_iCode, nbi_parms, bi_parms); - } - else if (!strcmp(bif->name, "__builtin_memset")) - { - genBuiltInMemset(bi_iCode, nbi_parms, bi_parms); - } - else - { - wassertl (0, "Unknown builtin function encountered"); - } + if (!strcmp (bif->name, "__builtin_memcpy")) + { + genBuiltInMemcpy (bi_iCode, nbi_parms, bi_parms); + } + else if (!strcmp (bif->name, "__builtin_memset")) + { + genBuiltInMemset (bi_iCode, nbi_parms, bi_parms); + } + else + { + wassertl (0, "Unknown builtin function encountered"); + } } /*-------------------------------------------------------------------------------------*/ /* genZ80Code - generate code for Z80 based controllers for a single iCode instruction */ /*-------------------------------------------------------------------------------------*/ static void -genZ80iCode (iCode *ic) +genZ80iCode (iCode * ic) { - _G.current_iCode = ic; + genLine.lineElement.ic = ic; /* if the result is marked as spilt and rematerializable or code for @@ -9908,9 +10697,7 @@ be using some of the registers being popped which would destroy the contents of the register so we need to check for this condition and handle it */ - if (ic->next && - ic->next->op == IFX && - regsInCommon (IC_LEFT (ic), IC_COND (ic->next))) + if (ic->next && ic->next->op == IFX && regsInCommon (IC_LEFT (ic), IC_COND (ic->next))) { emitDebug ("; genIfx"); genIfx (ic->next, ic); @@ -9998,8 +10785,7 @@ /* note these two are xlated by algebraic equivalence during parsing SDCC.y */ - werror (E_INTERNAL_ERROR, __FILE__, __LINE__, - "got '>=' or '<=' shouldn't have come here"); + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, "got '>=' or '<=' shouldn't have come here"); break; case EQ_OP: @@ -10115,9 +10901,9 @@ if (ic->builtinSEND) { emitDebug ("; genBuiltIn"); - genBuiltIn(ic); + genBuiltIn (ic); } - else if(!regalloc_dry_run) + else if (!regalloc_dry_run) { emitDebug ("; addSet"); addSet (&_G.sendSet, ic); @@ -10127,7 +10913,7 @@ #if 0 case ARRAYINIT: emitDebug ("; genArrayInit"); - genArrayInit(ic); + genArrayInit (ic); break; #endif @@ -10152,7 +10938,7 @@ } unsigned char -dryZ80iCode (iCode *ic) +dryZ80iCode (iCode * ic) { regalloc_dry_run = TRUE; regalloc_dry_run_cost = 0; @@ -10168,21 +10954,22 @@ _fReturn = _z80_return; _fTmp = _z80_return; } - - _G.lines.head = _G.lines.current = NULL; - - genZ80iCode(ic); - - freeTrace(&_G.lines.trace); - freeTrace(&_G.trace.aops); + + initGenLineElement (); + _G.omitFramePtr = should_omit_frame_ptr; + + genZ80iCode (ic); + + destroy_line_list (); + freeTrace (&_G.trace.aops); { int pairId; - for(pairId = 0; pairId < NUM_PAIRS; pairId++) + for (pairId = 0; pairId < NUM_PAIRS; pairId++) spillPair (pairId); } - return(regalloc_dry_run_cost); + return (regalloc_dry_run_cost); } #ifdef DEBUG_DRY_COST @@ -10192,8 +10979,8 @@ iCode *ic; for (ic = lic; ic; ic = ic->next) - if(ic->op != FUNCTION && ic->op != ENDFUNCTION && ic->op != LABEL && ic->op != GOTO && ic->op != INLINEASM) - printf("; iCode %d total cost: %d\n", ic->key, (int)(dryZ80iCode (ic))); + if (ic->op != FUNCTION && ic->op != ENDFUNCTION && ic->op != LABEL && ic->op != GOTO && ic->op != INLINEASM) + printf ("; iCode %d total cost: %d\n", ic->key, (int) (dryZ80iCode (ic))); } #endif @@ -10201,10 +10988,10 @@ /* genZ80Code - generate code for Z80 based controllers for a block of intructions */ /*-------------------------------------------------------------------------------------*/ void -genZ80Code (iCode *lic) +genZ80Code (iCode * lic) { #ifdef DEBUG_DRY_COST - dryZ80Code(lic); + dryZ80Code (lic); #endif iCode *ic; @@ -10223,7 +11010,7 @@ _fTmp = _z80_return; } - _G.lines.head = _G.lines.current = NULL; + initGenLineElement (); /* if debug information required */ if (options.debug && currFunc) @@ -10240,27 +11027,27 @@ if (ic->lineno && cln != ic->lineno) { if (options.debug) - debugFile->writeCLine (ic); + debugFile->writeCLine (ic); if (!options.noCcodeInAsm) - emit2 (";%s:%d: %s", ic->filename, ic->lineno, printCLine(ic->filename, ic->lineno)); + emit2 (";%s:%d: %s", ic->filename, ic->lineno, printCLine (ic->filename, ic->lineno)); cln = ic->lineno; } if (options.iCodeInAsm) { - const char *iLine = printILine(ic); + const char *iLine = printILine (ic); emit2 (";ic:%d: %s", ic->key, iLine); - dbuf_free(iLine); + dbuf_free (iLine); } regalloc_dry_run_cost = 0; genZ80iCode (ic); - //emitDebug("; iCode %d total cost: %d", ic->key, (int)(regalloc_dry_run_cost)); + /*emitDebug("; iCode %d total cost: %d", ic->key, (int)(regalloc_dry_run_cost)); */ } /* now we are ready to call the peep hole optimizer */ if (!options.nopeep) - peepHole (&_G.lines.head); + peepHole (&genLine.lineHead); /* This is unfortunate */ /* now do the actual printing */ @@ -10268,7 +11055,7 @@ struct dbuf_s *buf = codeOutBuf; if (isInHome () && codeOutBuf == &code->oBuf) codeOutBuf = &home->oBuf; - printLine (_G.lines.head, codeOutBuf); + printLine (genLine.lineHead, codeOutBuf); if (_G.flushStatics) { flushStatics (); @@ -10279,32 +11066,10 @@ { int pairId; - for(pairId = 0; pairId < NUM_PAIRS; pairId++) + for (pairId = 0; pairId < NUM_PAIRS; pairId++) spillPair (pairId); } - freeTrace(&_G.lines.trace); - freeTrace(&_G.trace.aops); + destroy_line_list (); + freeTrace (&_G.trace.aops); } - -/* - Attic -static int -_isPairUsed (iCode * ic, PAIR_ID pairId) -{ - int ret = 0; - switch (pairId) - { - case PAIR_DE: - if (bitVectBitValue (ic->rMask, D_IDX)) - ret++; - if (bitVectBitValue (ic->rMask, E_IDX)) - ret++; - break; - default: - wassert (0); - } - return ret; -} -*/ - diff -Nru sdcc-3.1.0+dfsg/src/z80/gen.h sdcc-3.2.0+dfsg/src/z80/gen.h --- sdcc-3.1.0+dfsg/src/z80/gen.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/z80/gen.h 2012-04-05 14:43:44.000000000 +0000 @@ -16,10 +16,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! -------------------------------------------------------------------------*/ #ifndef Z80GEN_H @@ -93,6 +89,8 @@ void genZ80Code (iCode *); void z80_emitDebuggerSymbol (const char *); -extern bool assignment_optimal; +extern bool z80_assignment_optimal; +extern bool should_omit_frame_ptr; #endif + diff -Nru sdcc-3.1.0+dfsg/src/z80/main.c sdcc-3.2.0+dfsg/src/z80/main.c --- sdcc-3.1.0+dfsg/src/z80/main.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/z80/main.c 2012-06-08 12:57:12.000000000 +0000 @@ -38,8 +38,6 @@ #define OPTION_ASM "--asm=" #define OPTION_NO_STD_CRT0 "--no-std-crt0" #define OPTION_RESERVE_IY "--reserve-regs-iy" -#define OPTION_DUMP_GRAPHS "--dump-graphs" -#define OPTION_MAX_ALLOCS_NODE "--max-allocs-per-node" #define OPTION_OLDRALLOC "--oldralloc" static char _z80_defaultRules[] = { @@ -67,9 +65,7 @@ {0, OPTION_CONST_SEG, &options.const_seg, " use this name for the const segment", CLAT_STRING}, {0, OPTION_NO_STD_CRT0, &options.no_std_crt0, "For the z80/gbz80 do not link default crt0.rel"}, {0, OPTION_RESERVE_IY, &z80_opts.reserveIY, "Do not use IY (incompatible with --fomit-frame-pointer)"}, - {0, OPTION_MAX_ALLOCS_NODE, &options.max_allocs_per_node, "Maximum number of register assignments considered at each node of the tree decomposition", CLAT_INTEGER}, - {0, OPTION_DUMP_GRAPHS, &z80_opts.dump_graphs, "Dump control flow graph, conflict graph and tree decomposition in register allocator"}, - {0, OPTION_OLDRALLOC, &z80_opts.oldralloc, "Use old register allocator"}, + {0, OPTION_OLDRALLOC, &options.oldralloc, "Use old register allocator"}, {0, NULL} }; @@ -80,8 +76,6 @@ {0, OPTION_CODE_SEG, &options.code_seg, " use this name for the code segment", CLAT_STRING}, {0, OPTION_CONST_SEG, &options.const_seg, " use this name for the const segment", CLAT_STRING}, {0, OPTION_NO_STD_CRT0, &options.no_std_crt0, "For the z80/gbz80 do not link default crt0.rel"}, - {0, OPTION_MAX_ALLOCS_NODE, &options.max_allocs_per_node, "Maximum number of register assignments considered at each node of the tree decomposition", CLAT_INTEGER}, - {0, OPTION_DUMP_GRAPHS, &z80_opts.dump_graphs, "Dump control flow graph, conflict graph and tree decomposition in register allocator"}, {0, NULL} }; @@ -148,6 +142,13 @@ } static void +_r3ka_init (void) +{ + z80_opts.sub = SUB_R3KA; + asm_addTree (&_asxxxx_r2k); +} + +static void _gbz80_init (void) { z80_opts.sub = SUB_GBZ80; @@ -596,8 +597,9 @@ setMainValue ("z80bases", dbuf_c_str (&dbuf)); dbuf_destroy (&dbuf); - if ((IS_Z80 || IS_Z180) && options.omitFramePtr) - z80_port.stack.call_overhead = 2; + /* For the old register allocator (with the new one we decide to omit the frame pointer for each function individually) */ + if (!IS_GB && options.omitFramePtr) + port->stack.call_overhead = 2; } static void @@ -626,14 +628,6 @@ options.data_loc = IS_GB ? 0xC000 : 0x8000; options.out_fmt = 'i'; /* Default output format is ihx */ - optimize.global_cse = 1; - optimize.label1 = 1; - optimize.label2 = 1; - optimize.label3 = 1; - optimize.label4 = 1; - optimize.loopInvariant = 1; - optimize.loopInduction = 1; - z80_opts.dump_graphs = 0; } /* Mangling format: @@ -661,6 +655,9 @@ { struct dbuf_s dbuf; + if (strstr (original, "longlong")) + return (original); + dbuf_init (&dbuf, 128); dbuf_printf (&dbuf, "%s_rr%s_%s", original, options.profile ? "f" : "x", options.noRegParams ? "s" : "bds" /* MB: but the library only has hds variants ??? */ ); @@ -683,7 +680,6 @@ _hasNativeMulFor (iCode * ic, sym_link * left, sym_link * right) { sym_link *test = NULL; - value *val; int result_size = IS_SYMOP(IC_RESULT(ic)) ? getSize(OP_SYM_TYPE(IC_RESULT(ic))) : 4; if (ic->op != '*') @@ -692,15 +688,9 @@ } if (IS_LITERAL (left)) - { - test = left; - val = OP_VALUE (IC_LEFT (ic)); - } + test = left; else if (IS_LITERAL (right)) - { - test = right; - val = OP_VALUE (IC_RIGHT (ic)); - } + test = right; /* 8x8 unsigned multiplication code is shorter than call overhead for the multiplication routine. */ else if (IS_CHAR (right) && IS_UNSIGNED (right) && IS_CHAR (left) && IS_UNSIGNED (left) && !IS_GB) @@ -783,6 +773,7 @@ static const char *const _libs_z80[] = { "z80", NULL, }; static const char *const _libs_z180[] = { "z180", NULL, }; static const char *const _libs_r2k[] = { "r2k", NULL, }; +static const char *const _libs_r3ka[] = { "r3ka", NULL, }; static const char *const _libs_gb[] = { "gbz80", NULL, }; /* Globals */ @@ -801,8 +792,8 @@ { /* Assembler */ _z80AsmCmd, NULL, - "-plosgffwzc", /* Options with debug */ - "-plosgffwz", /* Options without debug */ + "-plosgffwc", /* Options with debug */ + "-plosgffw", /* Options without debug */ 0, ".asm"}, { /* Linker */ @@ -834,20 +825,20 @@ "STACK", "CODE", "DATA", - "ISEG", + NULL, /* idata */ NULL, /* pdata */ - "XSEG", - "BSEG", + NULL, /* xdata */ + NULL, /* bit */ "RSEG (ABS)", "GSINIT", - "OVERLAY", + NULL, /* overlay */ "GSFINAL", "HOME", NULL, /* xidata */ NULL, /* xinit */ NULL, /* const_name */ - "CABS", /* cabs_name */ - NULL, /* xabs_name */ + "CABS (ABS)", /* cabs_name */ + "DABS (ABS)", /* xabs_name */ NULL, /* iabs_name */ NULL, NULL, @@ -925,8 +916,8 @@ { /* Assembler */ _z80AsmCmd, NULL, - "-plosgffwzc", /* Options with debug */ - "-plosgffwz", /* Options without debug */ + "-plosgffwc", /* Options with debug */ + "-plosgffw", /* Options without debug */ 0, ".asm"}, { /* Linker */ @@ -958,20 +949,20 @@ "STACK", "CODE", "DATA", - "ISEG", + NULL, /* idata */ NULL, /* pdata */ - "XSEG", - "BSEG", + NULL, /* xdata */ + NULL, /* bit */ "RSEG (ABS)", "GSINIT", - "OVERLAY", + NULL, /* overlay */ "GSFINAL", "HOME", NULL, /* xidata */ NULL, /* xinit */ NULL, /* const_name */ - "CABS", /* cabs_name */ - NULL, /* xabs_name */ + "CABS (ABS)", /* cabs_name */ + "DABS (ABS)", /* xabs_name */ NULL, /* iabs_name */ NULL, NULL, @@ -1034,12 +1025,11 @@ PORT_MAGIC }; -/* Globals */ -PORT gbz80_port = { - TARGET_ID_GBZ80, - "gbz80", - "Gameboy Z80-like", /* Target name */ - NULL, +PORT r2k_port = { + TARGET_ID_R2K, + "r2k", + "Rabbit 2000", /* Target name */ + NULL, /* Processor name */ { glue, FALSE, @@ -1048,31 +1038,30 @@ NULL, /* model == target */ }, { /* Assembler */ - _gbAsmCmd, + _r2kAsmCmd, NULL, - "-plosgffwzc", /* Options with debug */ - "-plosgffwz", /* Options without debug */ + "-plosgffwc", /* Options with debug */ + "-plosgffw", /* Options without debug */ 0, - ".asm", - NULL /* no do_assemble function */ - }, + ".asm"}, { /* Linker */ - _gbLinkCmd, //NULL, + _z80LinkCmd, //NULL, NULL, //LINKCMD, NULL, ".rel", 1, _crt, /* crt */ - _libs_gb, /* libs */ + _libs_r2k, /* libs */ }, { /* Peephole optimizer */ - _gbz80_defaultRules, - 0, - 0, - 0, + _r2k_defaultRules, + z80instructionSize, 0, 0, 0, + z80notUsed, + z80canAssign, + z80notUsedFrom, }, { /* Sizes: char, short, int, long, long long, ptr, fptr, gptr, bit, float, max */ @@ -1084,29 +1073,29 @@ "STACK", "CODE", "DATA", - "ISEG", + NULL, /* idata */ NULL, /* pdata */ - "XSEG", - "BSEG", - "RSEG", + NULL, /* xdata */ + NULL, /* bit */ + "RSEG (ABS)", "GSINIT", - "OVERLAY", + NULL, /* overlay */ "GSFINAL", "HOME", NULL, /* xidata */ NULL, /* xinit */ NULL, /* const_name */ - "CABS", /* cabs_name */ - NULL, /* xabs_name */ + "CABS (ABS)", /* cabs_name */ + "DABS (ABS)", /* xabs_name */ NULL, /* iabs_name */ NULL, NULL, - 1 /* CODE is read-only */ + 1 /* CODE is read-only */ }, {NULL, NULL}, { - -1, 0, 0, 2, 0, 4}, - /* gbZ80 has no native mul/div commands */ + -1, 0, 0, 4, 0, 2}, + /* Z80 has no native mul/div commands */ { 0, 2}, { @@ -1122,9 +1111,9 @@ 3, /* sizeofDispatch */ }, "_", - _gbz80_init, + _r2k_init, _parseOptions, - _gbz80_options, + _z80_options, NULL, _finaliseOptions, _setDefaultOptions, @@ -1153,19 +1142,17 @@ 0, /* leave == */ FALSE, /* Array initializer support. */ 0, /* no CSE cost estimation yet */ - NULL, /* no builtin functions */ + _z80_builtins, /* builtin functions */ GPOINTER, /* treat unqualified pointers as "generic" pointers */ 1, /* reset labelKey to 1 */ 1, /* globals & local static allowed */ PORT_MAGIC }; - - -PORT r2k_port = { - TARGET_ID_R2K, - "r2k", - "Rabbit 2000", /* Target name */ +PORT r3ka_port = { + TARGET_ID_R3KA, + "r3ka", + "Rabbit 3000A", /* Target name */ NULL, /* Processor name */ { glue, @@ -1177,8 +1164,8 @@ { /* Assembler */ _r2kAsmCmd, NULL, - "-plosgffwzc", /* Options with debug */ - "-plosgffwz", /* Options without debug */ + "-plosgffwc", /* Options with debug */ + "-plosgffw", /* Options without debug */ 0, ".asm"}, { /* Linker */ @@ -1188,7 +1175,7 @@ ".rel", 1, _crt, /* crt */ - _libs_r2k, /* libs */ + _libs_r3ka, /* libs */ }, { /* Peephole optimizer */ _r2k_defaultRules, @@ -1210,20 +1197,20 @@ "STACK", "CODE", "DATA", - "ISEG", + NULL, /* idata */ NULL, /* pdata */ - "XSEG", - "BSEG", + NULL, /* xdata */ + NULL, /* bit */ "RSEG (ABS)", "GSINIT", - "OVERLAY", + NULL, /* overlay */ "GSFINAL", "HOME", NULL, /* xidata */ NULL, /* xinit */ NULL, /* const_name */ - "CABS", /* cabs_name */ - NULL, /* xabs_name */ + "CABS (ABS)", /* cabs_name */ + "DABS (ABS)", /* xabs_name */ NULL, /* iabs_name */ NULL, NULL, @@ -1248,7 +1235,7 @@ 3, /* sizeofDispatch */ }, "_", - _r2k_init, + _r3ka_init, _parseOptions, _z80_options, NULL, @@ -1285,3 +1272,130 @@ 1, /* globals & local static allowed */ PORT_MAGIC }; + +/* Globals */ +PORT gbz80_port = { + TARGET_ID_GBZ80, + "gbz80", + "Gameboy Z80-like", /* Target name */ + NULL, + { + glue, + FALSE, + NO_MODEL, + NO_MODEL, + NULL, /* model == target */ + }, + { /* Assembler */ + _gbAsmCmd, + NULL, + "-plosgffwc", /* Options with debug */ + "-plosgffw", /* Options without debug */ + 0, + ".asm", + NULL /* no do_assemble function */ + }, + { /* Linker */ + _gbLinkCmd, //NULL, + NULL, //LINKCMD, + NULL, + ".rel", + 1, + _crt, /* crt */ + _libs_gb, /* libs */ + }, + { /* Peephole optimizer */ + _gbz80_defaultRules, + 0, + 0, + 0, + 0, + 0, + 0, + }, + { + /* Sizes: char, short, int, long, long long, ptr, fptr, gptr, bit, float, max */ + 1, 2, 2, 4, 8, 2, 2, 2, 1, 4, 4}, + /* tags for generic pointers */ + {0x00, 0x40, 0x60, 0x80}, /* far, near, xstack, code */ + { + "XSEG", + "STACK", + "CODE", + "DATA", + NULL, /* idata */ + NULL, /* pdata */ + NULL, /* xdata */ + NULL, /* bit */ + "RSEG", + "GSINIT", + NULL, /* overlay */ + "GSFINAL", + "HOME", + NULL, /* xidata */ + NULL, /* xinit */ + NULL, /* const_name */ + "CABS (ABS)", /* cabs_name */ + "DABS (ABS)", /* xabs_name */ + NULL, /* iabs_name */ + NULL, + NULL, + 1 /* CODE is read-only */ + }, + {NULL, NULL}, + { + -1, 0, 0, 2, 0, 4}, + /* gbZ80 has no native mul/div commands */ + { + 0, 2}, + { + z80_emitDebuggerSymbol}, + { + 255, /* maxCount */ + 3, /* sizeofElement */ + /* The rest of these costs are bogus. They approximate */ + /* the behavior of src/SDCCicode.c 1.207 and earlier. */ + {4, 4, 4}, /* sizeofMatchJump[] */ + {0, 0, 0}, /* sizeofRangeCompare[] */ + 0, /* sizeofSubtract */ + 3, /* sizeofDispatch */ + }, + "_", + _gbz80_init, + _parseOptions, + _gbz80_options, + NULL, + _finaliseOptions, + _setDefaultOptions, + z80_assignRegisters, + _getRegName, + _keywords, + 0, /* no assembler preamble */ + NULL, /* no genAssemblerEnd */ + 0, /* no local IVT generation code */ + 0, /* no genXINIT code */ + NULL, /* genInitStartup */ + _reset_regparm, + _reg_parm, + _process_pragma, + _mangleSupportFunctionName, + _hasNativeMulFor, + hasExtBitOp, /* hasExtBitOp */ + oclsExpense, /* oclsExpense */ + TRUE, + TRUE, /* little endian */ + 0, /* leave lt */ + 0, /* leave gt */ + 1, /* transform <= to ! > */ + 1, /* transform >= to ! < */ + 1, /* transform != to !(a == b) */ + 0, /* leave == */ + FALSE, /* Array initializer support. */ + 0, /* no CSE cost estimation yet */ + NULL, /* no builtin functions */ + GPOINTER, /* treat unqualified pointers as "generic" pointers */ + 1, /* reset labelKey to 1 */ + 1, /* globals & local static allowed */ + PORT_MAGIC +}; + diff -Nru sdcc-3.1.0+dfsg/src/z80/mappings.i sdcc-3.2.0+dfsg/src/z80/mappings.i --- sdcc-3.1.0+dfsg/src/z80/mappings.i 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/z80/mappings.i 2012-02-19 14:22:39.000000000 +0000 @@ -11,11 +11,11 @@ /*{ "ldahli", "ldi\ta,(hl)" }, use when assembler update is complete*/ {"ldahli", "ld\ta,(hl)\ninc\thl"}, { "ldahlsp", "ldhl\tsp,#%d" }, - { "ldaspsp", "lda sp,%d(sp)" }, + { "ldaspsp", "add sp, #%d" }, { "*pair", "(%s)" }, { "enter", "" }, { "enterx", - "lda sp,-%d(sp)" }, + "add sp, #-%d" }, { "enterxl", "ld hl,#-%d\n" "add\thl,sp\n" @@ -23,7 +23,7 @@ }, { "leave", "" }, - { "leavex", "lda sp,%d(sp)" + { "leavex", "add\tsp,#%d" }, { "leavexl", "ld hl,#%d\n" diff -Nru sdcc-3.1.0+dfsg/src/z80/peep.c sdcc-3.2.0+dfsg/src/z80/peep.c --- sdcc-3.1.0+dfsg/src/z80/peep.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/z80/peep.c 2012-06-29 07:51:14.000000000 +0000 @@ -243,11 +243,7 @@ ISINST(pl->line, "sub\t") || ISINST(pl->line, "xor\t")) { - if(argCont(pl->line + 4, what)) - return TRUE; - if(strstr(pl->line + 4, "hl") == 0 && strcmp("a", what) == 0) - return TRUE; - return FALSE; + return(argCont(pl->line + 4, what)); } if(ISINST(pl->line, "or\t") || ISINST(pl->line, "cp\t") ) @@ -691,18 +687,33 @@ { const char *op1start, *op2start; - op1start = strchr(pl->line, '\t'); - if(op1start) + /* move to the first operand: + * leading spaces are already removed, skip the mnenonic */ + for (op1start = pl->line; *op1start && !isspace (*op1start); ++op1start); + + /* skip the spaces between mnemonic and the operand */ + while (isspace (*op1start)) + ++op1start; + if ('\0' == *op1start) + op1start = NULL; + + if (op1start) { - op1start++; + /* move to the second operand: + * find the comma and skip the following spaces */ op2start = strchr(op1start, ','); - if(op2start) - do - op2start++; - while(op2start && (*op2start == ' ' || *op2start == '\t')); + if (op2start) + { + do + ++op2start; + while (isspace (*op2start)); + + if ('\0' == *op2start) + op2start = NULL; + } } else - op2start = 0; + op2start = NULL; /* All ld instructions */ if(ISINST(pl->line, "ld\t")) @@ -717,9 +728,9 @@ strncmp(op2start, "hl", 2) && strncmp(op2start, "a", 2)) return(4); - if(IS_R2K && !strncmp(op1start, "hl", 2) && (argCont(op2start, "(hl)") || argCont(op2start, "(iy)"))) + if(IS_RAB && !strncmp(op1start, "hl", 2) && (argCont(op2start, "(hl)") || argCont(op2start, "(iy)"))) return(4); - if(IS_R2K && !strncmp(op1start, "hl", 2) && (argCont(op2start, "(sp)") || argCont(op2start, "(ix)"))) + if(IS_RAB && !strncmp(op1start, "hl", 2) && (argCont(op2start, "(sp)") || argCont(op2start, "(ix)"))) return(3); /* These 4 are the only remaining cases of 3 byte long ld instructions. */ @@ -730,7 +741,7 @@ if((op1start[0] == '(' && strncmp(op1start, "(bc)", 4) && strncmp(op1start, "(de)", 4) && strncmp(op1start, "(hl)", 4)) || (op2start[0] == '(' && strncmp(op1start, "(bc)", 4) && strncmp(op1start, "(de)", 4) && strncmp(op1start, "(hl)", 4))) return(3); - if((op1start[1] == 'c' || op1start[1] == 'd' || op1start[1] == 'l' || op1start[1] == 'p') && op2start[0] == '#') + if((op1start[1] == 'c' || op1start[1] == 'e' || op1start[1] == 'l' || op1start[1] == 'p') && op2start[0] == '#') return(3); /* These 3 are the only remaining cases of 2 byte long ld instructions. */ @@ -755,7 +766,7 @@ fprintf(stderr, "Warning: z80instructionSize() failed to parse line node %s\n", pl->line); return(4); } - if(argCont(op1start, "(sp)") && (IS_R2K || !strncmp(op2start, "ix", 2) || !strncmp(op2start, "iy", 2))) + if(argCont(op1start, "(sp)") && (IS_RAB || !strncmp(op2start, "ix", 2) || !strncmp(op2start, "iy", 2))) return(2); return(1); } @@ -769,7 +780,7 @@ } /* 16 bit add / subtract / and */ - if((ISINST(pl->line, "add") || ISINST(pl->line, "adc") || ISINST(pl->line, "sbc") || IS_R2K && ISINST(pl->line, "and")) && !strncmp(op1start, "hl", 2)) + if((ISINST(pl->line, "add") || ISINST(pl->line, "adc") || ISINST(pl->line, "sbc") || IS_RAB && ISINST(pl->line, "and")) && !strncmp(op1start, "hl", 2)) { if(ISINST(pl->line, "add") || ISINST(pl->line, "and")) return(1); @@ -778,9 +789,10 @@ if(ISINST(pl->line, "add") && (!strncmp(op1start, "ix", 2) || !strncmp(op1start, "iy", 2))) return(2); - if(IS_R2K && ISINST(pl->line, "add") && !strncmp(op1start, "sp", 2)) + /* signed 8 bit adjustment to stack pointer */ + if( (IS_RAB) && ISINST(pl->line, "add") && !strncmp(op1start, "sp", 2)) return(2); - + /* 8 bit arithmetic, two operands */ if(op2start && op1start[0] == 'a' && (ISINST(pl->line, "add") || ISINST(pl->line, "adc") || ISINST(pl->line, "sub") || ISINST(pl->line, "sbc") || ISINST(pl->line, "cp") || ISINST(pl->line, "and") || ISINST(pl->line, "or") || ISINST(pl->line, "xor"))) { @@ -834,7 +846,7 @@ return(3); } - if (TARGET_IS_R2K && + if (IS_RAB && (ISINST(pl->line, "ipset3") || ISINST(pl->line, "ipset2") || ISINST(pl->line, "ipset1") || ISINST(pl->line, "ipset0") || ISINST(pl->line, "ipres"))) @@ -869,10 +881,24 @@ if(IS_Z180 && ISINST(pl->line, "mlt")) return(2); - - if(IS_R2K && ISINST(pl->line, "mul")) + + if(IS_RAB && ISINST(pl->line, "mul")) return(1); + if(ISINST(pl->line, "lddr") || ISINST(pl->line, "ldir")) + return(2); + + if(IS_R3KA && + (ISINST(pl->line, "lddsr") || ISINST(pl->line, "ldisr") || + ISINST(pl->line, "lsdr") || ISINST(pl->line, "lsir") || ISINST(pl->line, "lsddr") || ISINST(pl->line, "lsidr"))) + return(2); + + if(IS_R3KA && (ISINST(pl->line, "uma") || ISINST(pl->line, "ums"))) + return(2); + + if(IS_RAB && ISINST(pl->line, "bool")) + return(!strncmp(op1start, "hl", 2) ? 1 : 2); + if(ISINST(pl->line, ".db")) { int i, j; @@ -884,4 +910,3 @@ return(4); } - diff -Nru sdcc-3.1.0+dfsg/src/z80/peeph-gbz80.def sdcc-3.2.0+dfsg/src/z80/peeph-gbz80.def --- sdcc-3.1.0+dfsg/src/z80/peeph-gbz80.def 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/z80/peeph-gbz80.def 2012-05-24 14:44:37.000000000 +0000 @@ -33,7 +33,7 @@ %1: } by { jp C,%2 - ; peephole 3 removed jp by using inverse jump logic + ; peephole 60 removed jp by using inverse jump logic %1: } if labelRefCountChange(%1 -1) @@ -43,7 +43,7 @@ %1: } by { jp NC,%2 - ; peephole 4 removed jp by using inverse jump logic + ; peephole 61 removed jp by using inverse jump logic %1: } if labelRefCountChange(%1 -1) @@ -53,7 +53,7 @@ %1: } by { jp Z,%2 - ; peephole 5 removed jp by using inverse jump logic + ; peephole 62 removed jp by using inverse jump logic %1: } if labelRefCountChange(%1 -1) @@ -63,7 +63,7 @@ %1: } by { jp NZ,%2 - ; peephole 6 removed jp by using inverse jump logic + ; peephole 63 removed jp by using inverse jump logic %1: } if labelRefCountChange(%1 -1) @@ -71,28 +71,69 @@ jp %5 } by { jp %6 - ; peephole 7 redirected jump-to-jump at %5 by jump to %6 + ; peephole 64 jumped to %6 directly instead of via %5. } if labelIsUncondJump(), notSame(%5 %6), labelRefCountChange(%5 -1), labelRefCountChange(%6 +1) replace restart { jp %1,%5 } by { jp %1,%6 - ; peephole 8 redirected jump-to-jump at %5 by jump to %6 + ; peephole 65 jumped to %6 directly instead of via %5. } if labelIsUncondJump(), notSame(%5 %6), labelRefCountChange(%5 -1), labelRefCountChange(%6 +1) +// A peephole that makes the code longer. Let's hope it's worth it in speed gain and furhter optimization potential. replace restart { - ld %2,%3 + ld a,#0x00 +%1: + bit %2,a + jp Z,%3 +} by { + ld a,#0x00 + jp %3 + ; peephole 65a jumped directly to %3 instead of testing a first. +%1: + bit %2,a + jp Z,%3 +} if labelRefCountChange(%3 +1) + +replace restart { + jp %1 +%2: +%1: +} by { + ; peephole 65a' eliminated jump. +%2: +%1: +} if labelRefCountChange(%1 -1) + +replace restart { + ld %1, %2 + jp %3 jp %4 -%5: - ld %2,%3 -%4: } by { - ; peephole 9 removed jump and redundant load. -%5: - ld %2,%3 -%4: -} if labelRefCountChange(%4 -1) + ld %1, %2 + jp %3 + ; peephole 65b removed unreachable jump to %3. +} + +replace restart { + ld %1, %2 + jp %3 +%3: +} by { + ld %1, %2 +%3: + ; peephole 65c removed redundant jump to %3. +} if labelRefCountChange(%3 -1) + +replace restart { + ld %1, #0x01 + bit 0, %1 + jp Z, %2 +} by { + ld %1, #0x01 + ; peephole 65d removed impossible jump to %2. +} if labelRefCountChange(%2 -1) replace restart { xor a,a @@ -132,9 +173,7 @@ } by { ld %1,a ; peephole 14 removed redundant load from %1 into a. -} if notVolatile(%1) -// This gives many false negatives and without the test no problems are encountered in the regression tests -// Maybe we can try this after 2.7.0 release +} if notVolatile(%1), notSame(%1 '(hl+)'), notSame(%1 '(hl-)') replace restart { ld a,%1 @@ -142,9 +181,7 @@ } by { ld a,%1 ; peephole 15 removed redundant load from a into %1. -} if notVolatile(%1) -// This gives many false negatives and without the test no problems are encountered in the regression tests -// Maybe we can try this after 2.7.0 release +} if notVolatile(%1), notSame(%1 '(hl+)'), notSame(%1 '(hl-)') replace restart { ld %2,%3 @@ -535,18 +572,6 @@ } replace restart { - or a,%1 - jp NZ,%2 - ld a,%3 - or a,a -} by { - or a,%1 - jp NZ,%2 - or a,%3 - ; peephole 49 shortened or using a (which has just been tested to be #0x00). -} - -replace restart { and a,%1 jp NZ,%2 ld a,%3 @@ -733,27 +758,46 @@ ; peephole 66 replaced call at end of function by jump moving call beyond pop ix. } +replace { + ld a,(hl) + inc hl +} by { + ld a,(hl+) + ; peephole GB1 used ldi to increment hl after load +} + +replace { + ld a,(hl) + dec hl +} by { + ld a,(hl-) + ; peephole GB2 used ldd to decrement hl after load +} + +replace { + ld (hl),a + inc hl +} by { + ld (hl+),a + ; peephole GB3 used ldi to increment hl after load +} + +replace { + ld (hl),a + dec hl +} by { + ld (hl-),a + ; peephole GB4 used ldd to decrement hl after load +} + +replace { + inc hl + dec hl +} by { + ; peephole GB5 removed inc hl / dec hl pair +} + // Old gbz80 rules from here onward -// Commented out until des assembler update is complete. -//replace { -// ld (hl),a -// dec hl -//} by { -// ldd (hl),a -//} -//replace { -// ld (hl),a -// inc hl -//} by { -// ldi (hl),a -//} -//replace { -// ld a,(hl) -// inc hl -//} by { -// ldi a,(hl) -//} -// //} //replace { // ldi (hl),a @@ -776,24 +820,290 @@ // ld (hl),a // ld %1,a //} -//replace { -// ld (hl),a -// inc de -// ld a,(de) -// inc hl -//} by { -// ldi (hl),a -// inc de -// ld a,(de) -//} + +replace { + ld (hl),a + inc de + ld a,(de) + inc hl +} by { + ld (hl+),a + ; peephole E used ldi to increment hl + inc de + ld a,(de) +} + +barrier + +// Should be one of the last ones. Opens the code to further peephole optimization. +replace restart { +%1: +} by { + ; peephole 149 removed unused label %1. +} if labelRefCount(%1 0) // Ensure that all rules above see only jp, not jr. barrier replace { + add hl,de + pop de + jp (hl) +%1: jp %5 + jp %6 + jp %7 +%2: } by { + ; peephole 150-3 removed addition using short jumps in jump-table. + pop de + jp (hl) +%1: jr %5 - ; peephole z14 changed absolute to relative unconditional jump. + jr %6 + jr %7 +%2: +} if labelJTInRange + +replace { + add hl,de + jp (hl) +%1: + jp %5 + jp %6 + jp %7 +%2: +} by { + ; peephole 150-3' removed addition using short jumps in jump-table. + jp (hl) +%1: + jr %5 + jr %6 + jr %7 +%2: +} if labelJTInRange + +replace { + add hl,de + pop de + jp (hl) +%1: + jp %5 + jp %6 + jp %7 + jp %8 +%2: +} by { + ; peephole 150-4 removed addition using short jumps in jump-table. + pop de + jp (hl) +%1: + jr %5 + jr %6 + jr %7 + jr %8 +%2: +} if labelJTInRange + +replace { + add hl,de + jp (hl) +%1: + jp %5 + jp %6 + jp %7 + jp %8 +%2: +} by { + ; peephole 150-4' removed addition using short jumps in jump-table. + jp (hl) +%1: + jr %5 + jr %6 + jr %7 + jr %8 +%2: +} if labelJTInRange + +replace { + add hl,de + pop de + jp (hl) +%1: + jp %5 + jp %6 + jp %7 + jp %8 + jp %9 +%2: +} by { + ; peephole 150-5 removed addition using short jumps in jump-table. + pop de + jp (hl) +%1: + jr %5 + jr %6 + jr %7 + jr %8 + jr %9 +%2: +} if labelJTInRange + +replace { + add hl,de + jp (hl) +%1: + jp %5 + jp %6 + jp %7 + jp %8 + jp %9 +%2: +} by { + ; peephole 150-5' removed addition using short jumps in jump-table. + jp (hl) +%1: + jr %5 + jr %6 + jr %7 + jr %8 + jr %9 +%2: +} if labelJTInRange + +replace { + add hl,de + pop de + jp (hl) +%1: + jp %5 + jp %6 + jp %7 + jp %8 + jp %9 + jp %10 +%2: +} by { + ; peephole 150-6 removed addition using short jumps in jump-table. + pop de + jp (hl) +%1: + jr %5 + jr %6 + jr %7 + jr %8 + jr %9 + jr %10 +%2: +} if labelJTInRange + +replace { + add hl,de + jp (hl) +%1: + jp %5 + jp %6 + jp %7 + jp %8 + jp %9 + jp %10 +%2: +} by { + ; peephole 150-6' removed addition using short jumps in jump-table. + jp (hl) +%1: + jr %5 + jr %6 + jr %7 + jr %8 + jr %9 + jr %10 +%2: +} if labelJTInRange + +replace { + add hl,de + pop de + jp (hl) +%1: + jp %5 + jp %6 + jp %7 + jp %8 + jp %9 + jp %10 + jp %11 +%2: +} by { + ; peephole 150-7 removed addition using short jumps in jump-table. + pop de + jp (hl) +%1: + jr %5 + jr %6 + jr %7 + jr %8 + jr %9 + jr %10 + jr %11 +%2: +} if labelJTInRange + +replace { + add hl,de + jp (hl) +%1: + jp %5 + jp %6 + jp %7 + jp %8 + jp %9 + jp %10 + jp %11 +%2: +} by { + ; peephole 150-7' removed addition using short jumps in jump-table. + jp (hl) +%1: + jr %5 + jr %6 + jr %7 + jr %8 + jr %9 + jr %10 + jr %11 +%2: +} if labelJTInRange + +barrier + +// Do all jump optimizations before replacing by ret. + +replace restart { + jp %5 +} by { + ret + ; peephole 151 replaced jump by return. +} if labelIsReturnOnly(), labelRefCountChange(%5 -1) + +replace restart { + jp %1,%5 +} by { + ret %1 + ; peephole 152 replaced jump by return. +} if labelIsReturnOnly(), labelRefCountChange(%5 -1) + +replace { + jp %5 +} by { + jr %5 + ; peephole 153 changed absolute to relative unconditional jump. +} if labelInRange() + +replace { + jp %1,%5 +} by { + jr %1,%5 + ; peephole 154 changed absolute to relative conditional jump. } if labelInRange() diff -Nru sdcc-3.1.0+dfsg/src/z80/peeph-r2k.def sdcc-3.2.0+dfsg/src/z80/peeph-r2k.def --- sdcc-3.1.0+dfsg/src/z80/peeph-r2k.def 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/z80/peeph-r2k.def 2012-06-19 16:14:17.000000000 +0000 @@ -148,7 +148,7 @@ ld %7, %2 (%3) ; peephole 15 loaded %2 (%3) into %7 directly instead of going through %1. ld %4, %5 -} if canAssign(%7 %2 %3), notVolatile(%1), notUsed(%1), notSame(%1 %5), notSame(%7 %4), notSame(%4 '(hl)' '(de)' '(bc)'), notSame(%5 '(hl)' '(de)' '(bc)' '(iy)') +} if canAssign(%7 %2 %3), notVolatile(%1), notUsed(%1), notSame(%1 %5), notSame(%7 %4), notSame(%7 %5), notSame(%4 '(hl)' '(de)' '(bc)'), notSame(%5 '(hl)' '(de)' '(bc)' '(iy)') replace restart { ld %1,#%2 @@ -213,6 +213,19 @@ } if notUsed('a') replace restart { + ld iy, #%1 + ld %2, %3 (iy) + srl %2 + bit %4, %3 (iy) +} by { + ld hl, #%1 + %3 + ; peephole 21c used hl instead of iy. + ld %2, (hl) + srl %2 + bit %4, (hl) +} if notUsed('iy'), notUsed('hl') + +replace restart { ld %1,(hl) ld a,%2 (%3) sub a,%1 @@ -518,7 +531,7 @@ ld %2, (hl) inc hl ld %3, (hl) -} if notUsed('iy'), notUsed('hl'), operandsNotRelated(%2 'h'), operandsNotRelated(%2 'l') +} if notUsed('iy'), notUsed('hl'), operandsNotRelated(%2 'hl') replace restart { ld iy,#%1 @@ -538,7 +551,7 @@ ; peephole 49 used hl instead of iy. ld hl,#%1 + %2 ld (hl), %4 -} if notUsed('iy'), notUsed('hl'), operandsNotRelated(%4 'h'), operandsNotRelated(%4 'l') +} if notUsed('iy'), notUsed('hl'), operandsNotRelated(%4 'hl') replace restart { ld iy,#%1 @@ -550,12 +563,66 @@ } if notUsed('iy'), notUsed('hl') replace restart { + ld iy, #%1 + add iy, sp + ld %2, %3 (iy) +} by { + ; peephole 49b used hl instead of iy. + ld hl, #%1+%3 + add hl, sp + ld %2, (hl) +} if notUsed('iy'), notUsed('hl') + +replace restart { + ld iy, #%1 + add iy, sp + ld %2, 0 (iy) + ld %3, 1 (iy) +} by { + ; peephole 49c used hl instead of iy. + ld hl, #%1 + add hl, sp + ld %2, (hl) + inc hl + ld %3, (hl) +} if notUsed('iy'), notUsed('hl') + +replace restart { + ld iy, #%1 + add iy, sp + ld l, 0 (iy) + ld h, 1 (iy) +} by { + ; peephole 49d used hl instead of iy. + ld hl, #%1 + add hl, sp + ld a, (hl) + inc hl + ld h, (hl) + ld l, a +} if notUsed('iy'), notUsed('a') + +replace restart { + ld iy, #%1 + add iy, sp + ld 0 (iy), #%2 + ld 1 (iy), #%3 +} by { + ; peephole 49e used hl instead of iy. + ld hl, #%1 + add hl, sp + ld (hl), #%2 + inc hl + ld (hl), #%3 +} if notUsed('iy'), notUsed('hl') + +replace restart { ld %1,(hl) or a,%1 } by { or a,(hl) ; peephole 50 used (hl) directly instead of going through %1. -} if notUsed(%1), operandsNotRelated(%1 'a') +} if notUsed(%1), notSame(%1 'a') replace restart { ld c,l @@ -702,7 +769,17 @@ ; peephole 65 jumped to %6 directly instead of via %5. } if labelIsUncondJump(), notSame(%5 %6), labelRefCountChange(%5 -1), labelRefCountChange(%6 +1) -// A peephole that makes the code longer. Let's hope it's worth it in speed gain and furhter optimization potential. +replace restart { + jp %1 +%2: +%1: +} by { + ; peephole 65a eliminated jump. +%2: +%1: +} if labelRefCountChange(%1 -1) + +// A peephole that makes the code longer. Let's hope it's worth it in speed gain and further optimization potential. replace restart { ld a,#0x00 %1: @@ -1048,7 +1125,7 @@ inc %2 (%3) ld %1, %2 (%3) ; peephole 93a incremented in %2 (%3) instead of going through %1. -} +} if notSame(%3 'sp') replace restart { ld %1,a @@ -1058,7 +1135,7 @@ ld %1, a ; peephole 94 removed load by exploiting commutativity of addition. add a,%2 -} if operandsNotRelated(%2 '(bc)' '(de)'), canAssign('b' %2) +} if notSame(%2 '(bc)' '(de)'), canAssign('b' %2) // canAssign('b' %2) is true, iff add a,%2 is possible. replace restart { @@ -1622,7 +1699,7 @@ ; peephole 138 used #%2 directly instead of going through %1 using indirect addressing. pop af ld %1,#%5 -} if operandsNotRelated(%3 'a') +} if notSame(%3 'a') replace restart { ld %1,a diff -Nru sdcc-3.1.0+dfsg/src/z80/peeph-z80.def sdcc-3.2.0+dfsg/src/z80/peeph-z80.def --- sdcc-3.1.0+dfsg/src/z80/peeph-z80.def 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/z80/peeph-z80.def 2012-06-19 16:14:17.000000000 +0000 @@ -22,7 +22,7 @@ replace restart { ld %1, %1 } by { - ; peephole 0 removed redundant load. + ; peephole 0 removed redundant load from %1 into %1. } if notVolatile(%1) replace restart { @@ -139,7 +139,6 @@ ld %2 (%3), %7 } if canAssign(%2 %3 %7), notVolatile(%1), notUsed(%1), notSame(%1 %4) -// Broken= What if %1 == h and %5 == (hl)? Real bug on r2k, thus removed there. replace restart { ld %1, %2 (%3) ld %4, %5 @@ -148,7 +147,7 @@ ld %7, %2 (%3) ; peephole 15 loaded %2 (%3) into %7 directly instead of going through %1. ld %4, %5 -} if canAssign(%7 %2 %3), notVolatile(%1), notUsed(%1), notSame(%1 %5), notSame(%7 %4), notSame(%4 '(hl)' '(de)' '(bc)'), notSame(%5 '(hl)' '(de)' '(bc)') +} if canAssign(%7 %2 %3), notVolatile(%1), notUsed(%1), notSame(%1 %5), notSame(%7 %4), notSame(%7 %5), notSame(%4 '(hl)' '(de)' '(bc)'), notSame(%5 '(hl)' '(de)' '(bc)' '(iy)') replace restart { ld %1,#%2 @@ -209,8 +208,32 @@ ld e, l ld d, h srl (hl) + ld a, (hl) ; peephole 21a shifted in (hl) instead of a. -} if notUsed('a') +} + +replace restart { + ld a, %1 (%2) + srl a + ld %1 (%2), a +} by { + srl %1 (%2) + ld a, %1 (%2) + ; peephole 21b shifted in (hl) instead of a. +} + +replace restart { + ld iy, #%1 + ld %2, %3 (iy) + srl %2 + bit %4, %3 (iy) +} by { + ld hl, #%1 + %3 + ; peephole 21c used hl instead of iy. + ld %2, (hl) + srl %2 + bit %4, (hl) +} if notUsed('iy'), notUsed('hl') replace restart { ld %1,(hl) @@ -443,16 +466,16 @@ } if notUsed(%1) replace restart { - ld a,%1 (ix) + ld a,%1 (%3) push af inc sp - ld a,%2 (ix) + ld a,%2 (%3) push af inc sp } by { - ; peephole 42 pushed %1 (ix), %2(ix) through hl instead of af. - ld h,%1 (ix) - ld l,%2 (ix) + ; peephole 42 pushed %1 (%3), %2(%3) through hl instead of af. + ld h,%1 (%3) + ld l,%2 (%3) push hl } if notUsed('a'), notUsed('hl') @@ -466,6 +489,20 @@ } if notUsed('bc') replace restart { + ld a, (hl) + inc hl + ld h, (hl) + ld l, a + push hl +} by { + ; peephole 43a pushed bc instead of hl. + ld c, (hl) + inc hl + ld b, (hl) + push bc +} if notUsed('bc'), notUsed('hl') + +replace restart { pop %1 push %1 } by { @@ -473,6 +510,24 @@ } if notUsed(%1) replace restart { + push hl + pop bc +} by { + ld c, l + ld b, h + ; peephole 44a replaced push/pop pair by loads. +} if notUsed('hl') + +replace restart { + push hl + pop de +} by { + ld e, l + ld d, h + ; peephole 44b replaced push/pop pair by loads. +} if notUsed('hl') + +replace restart { ld iy,#%1 or a,%2 (iy) } by { @@ -518,7 +573,7 @@ ld %2, (hl) inc hl ld %3, (hl) -} if notUsed('iy'), notUsed('hl'), operandsNotRelated(%2 'h'), operandsNotRelated(%2 'l') +} if notUsed('iy'), notUsed('hl'), operandsNotRelated(%2 'hl') replace restart { ld iy,#%1 @@ -538,7 +593,7 @@ ; peephole 49 used hl instead of iy. ld hl,#%1 + %2 ld (hl), %4 -} if notUsed('iy'), notUsed('hl'), operandsNotRelated(%4 'h'), operandsNotRelated(%4 'l') +} if notUsed('iy'), notUsed('hl'), operandsNotRelated(%4 'hl') replace restart { ld iy,#%1 @@ -550,12 +605,66 @@ } if notUsed('iy'), notUsed('hl') replace restart { + ld iy, #%1 + add iy, sp + ld %2, %3 (iy) +} by { + ; peephole 49b used hl instead of iy. + ld hl, #%1+%3 + add hl, sp + ld %2, (hl) +} if notUsed('iy'), notUsed('hl') + +replace restart { + ld iy, #%1 + add iy, sp + ld %2, 0 (iy) + ld %3, 1 (iy) +} by { + ; peephole 49c used hl instead of iy. + ld hl, #%1 + add hl, sp + ld %2, (hl) + inc hl + ld %3, (hl) +} if notUsed('iy'), notUsed('hl') + +replace restart { + ld iy, #%1 + add iy, sp + ld l, 0 (iy) + ld h, 1 (iy) +} by { + ; peephole 49d used hl instead of iy. + ld hl, #%1 + add hl, sp + ld a, (hl) + inc hl + ld h, (hl) + ld l, a +} if notUsed('iy'), notUsed('a') + +replace restart { + ld iy, #%1 + add iy, sp + ld 0 (iy), #%2 + ld 1 (iy), #%3 +} by { + ; peephole 49e used hl instead of iy. + ld hl, #%1 + add hl, sp + ld (hl), #%2 + inc hl + ld (hl), #%3 +} if notUsed('iy'), notUsed('hl') + +replace restart { ld %1,(hl) or a,%1 } by { or a,(hl) ; peephole 50 used (hl) directly instead of going through %1. -} if notUsed(%1), operandsNotRelated(%1 'a') +} if notUsed(%1), notSame(%1 'a') replace restart { ld c,l @@ -569,6 +678,71 @@ } if notUsed('hl') replace restart { + ld iy, #%1 + inc %2 (iy) +} by { + ; peephole 51a incremented in (hl) instead of %2 (iy). + ld hl, #%1+%2 + inc (hl) +} if notUsed('hl'), notUsed('iy') + +replace restart { + ld iy, #%1 + dec %2 (iy) +} by { + ; peephole 51a' decremented in (hl) instead of %2 (iy). + ld hl, #%1+%2 + dec (hl) +} if notUsed('hl'), notUsed('iy') + +replace restart { + add hl, hl + ld e, l + ld d, h + inc de + inc de +} by { + inc hl + ; peephole 51b incremented once in hl instead of incrementing in de twice. + add hl, hl + ld e, l + ld d, h +} if notUsed('hl') + +replace restart { + add hl, hl + inc hl + inc hl +} by { + inc hl + ; peephole 51c incremented once in hl instead of incrementing in hl twice. + add hl, hl +} + +replace restart { + add a, a + add a, a + add a, #0x04 +} by { + inc a + ; peephole 51d incremented a once instead of adding #0x04 to a. + add a, a + add a, a +} + +replace restart { + add hl, hl + pop de + inc hl + inc hl +} by { + inc hl + ; peephole 51e incremented once in hl instead of incrementing in hl twice. + add hl, hl + pop de +} + +replace restart { ld a,%1 (%2) bit %3,a } by { @@ -702,7 +876,17 @@ ; peephole 65 jumped to %6 directly instead of via %5. } if labelIsUncondJump(), notSame(%5 %6), labelRefCountChange(%5 -1), labelRefCountChange(%6 +1) -// A peephole that makes the code longer. Let's hope it's worth it in speed gain and furhter optimization potential. +replace restart { + jp %1 +%2: +%1: +} by { + ; peephole 65a eliminated jump. +%2: +%1: +} if labelRefCountChange(%1 -1) + +// A peephole that makes the code longer. Let's hope it's worth it in speed gain and further optimization potential. replace restart { ld a,#0x00 %1: @@ -763,6 +947,14 @@ } replace { + ld d,#0x%1 + ld e,#0x%2 +} by { + ld de,#0x%1%2 + ; peephole 67a combined constant loads into register pair. +} + +replace { ld l,#0x%1 ld h,#0x%2 } by { @@ -771,6 +963,14 @@ } replace { + ld h,#0x%1 + ld l,#0x%2 +} by { + ld hl,#0x%1%2 + ; peephole 68a combined constant loads into register pair. +} + +replace { ld c,#0x%1 ld b,#0x%2 } by { @@ -778,6 +978,14 @@ ; peephole 69 combined constant loads into register pair. } +replace { + ld b,#0x%1 + ld c,#0x%2 +} by { + ld bc,#0x%1%2 + ; peephole 69a combined constant loads into register pair. +} + replace restart { ld %1,a ld a,%1 @@ -1041,6 +1249,16 @@ } if notUsed('a') replace restart { + ld a,(hl) + inc a + ld (hl),a +} by { + inc (hl) + ; peephole 93' incremented in (hl) instead of going through a. +} if notUsed('a') + +// TODO: Check for volatile? +replace restart { ld %1, %2 (%3) inc %1 ld %2 (%3), %1 @@ -1050,6 +1268,17 @@ ; peephole 93a incremented in %2 (%3) instead of going through %1. } +// TODO: Check for volatile? +replace restart { + ld %1, %2 (%3) + dec %1 + ld %2 (%3), %1 +} by { + dec %2 (%3) + ld %1, %2 (%3) + ; peephole 93b decremented in %2 (%3) instead of going through %1. +} + replace restart { ld %1,a ld a,%2 @@ -1058,7 +1287,7 @@ ld %1, a ; peephole 94 removed load by exploiting commutativity of addition. add a,%2 -} if operandsNotRelated(%2 '(bc)' '(de)'), canAssign('b' %2) +} if notSame(%2 '(bc)' '(de)'), canAssign('b' %2) // canAssign('b' %2) is true, iff add a,%2 is possible. replace restart { @@ -1263,6 +1492,28 @@ } if notUsed('hl') replace restart { + push bc + pop iy + inc iy +} by { + inc bc + push bc + pop iy + ; peephole 111b incremented in bc instead of iy. +} if notUsed('bc') + +replace restart { + push de + pop iy + inc iy +} by { + inc de + push de + pop iy + ; peephole 111c incremented in de instead of iy. +} if notUsed('de') + +replace restart { ld hl,%1 add hl,%2 push hl @@ -1595,7 +1846,7 @@ ; peephole 138 used #%2 directly instead of going through %1 using indirect addressing. pop af ld %1,#%5 -} if operandsNotRelated(%3 'a') +} if notSame(%3 'a') replace restart { ld %1,a diff -Nru sdcc-3.1.0+dfsg/src/z80/ralloc.c sdcc-3.2.0+dfsg/src/z80/ralloc.c --- sdcc-3.1.0+dfsg/src/z80/ralloc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/z80/ralloc.c 2012-05-05 16:16:42.000000000 +0000 @@ -481,10 +481,13 @@ sloc->isref = 1; /* to prevent compiler warning */ + wassertl (currFunc, "Local variable used outside of function."); + /* if it is on the stack then update the stack */ if (IN_STACK (sloc->etype)) { - currFunc->stack += getSize (sloc->type); + if (currFunc) + currFunc->stack += getSize (sloc->type); _G.stackExtend += getSize (sloc->type); } else @@ -859,7 +862,7 @@ /* if the result of this one needs registers and does not have it then assign it right away */ - if (z80_opts.oldralloc && IC_RESULT (ic) && + if (options.oldralloc && IC_RESULT (ic) && !(SKIP_IC2 (ic) || ic->op == JUMPTABLE || ic->op == IFX || ic->op == IPUSH || ic->op == IPOP || ic->op == RETURN) && IS_SYMOP (IC_RESULT (ic)) && (result = OP_SYMBOL (IC_RESULT (ic))) && /* has a result */ result->liveTo > ic->seq && /* and will live beyond this */ @@ -961,7 +964,7 @@ int i, j = 0, shared = 0; int change = 0; - D (D_ALLOC, ("positionRegs: on result %p opsum %p line %u\n", result, opsym, lineno)); + D (D_ALLOC, ("positionRegs: on result %p opsym %p line %u\n", result, opsym, lineno)); /* if the result has been spilt then cannot share */ if (opsym->isspilt) @@ -969,6 +972,7 @@ again: shared = 0; /* first make sure that they actually share */ + for (i = 0; i < count; i++) { for (j = 0; j < count; j++) @@ -1048,8 +1052,8 @@ if (sym->regs[0]) return; - // Don't warn for new allocator , since this is not used by default (until Thoruop is implemented for spillocation compaction). - if (z80_opts.oldralloc) + // Don't warn for new allocator, since this is not used by default (until Thoruop is implemented for spillocation compaction). + if (options.oldralloc) werrorfl (ic->filename, ic->lineno, W_LOCAL_NOINIT, sym->prereqv ? sym->prereqv->name : sym->name); spillThis (sym); } @@ -1288,6 +1292,16 @@ int i; int pdone = 0; + if (sym->accuse == ACCUSE_SCRATCH) + { + sym->nRegs = getSize (sym->type); + sym->regs[0] = regsZ80 + L_IDX; + sym->regs[1] = regsZ80 + H_IDX; + sym->accuse = 0; + sym->isspilt = FALSE; + continue; + } + if (!sym->spillA || !sym->clashes || sym->remat) continue; @@ -1360,7 +1374,7 @@ continue; if (SKIP_IC (ic)) continue; - if (!IS_ASSIGN_ICODE (ic)) + if (IS_ASSIGN_ICODE (ic)) continue; /* if result is assigned to registers */ @@ -1416,7 +1430,7 @@ if (sym->isspilt || !sym->nRegs) return NULL; - rumask = newBitVect (_G.nRegs); + rumask = newBitVect (_G.nRegs + (IS_GB ? 0 : 2)); for (j = 0; j < sym->nRegs; j++) { @@ -1442,7 +1456,7 @@ bitVect * regsUsedIniCode (iCode * ic) { - bitVect *rmask = newBitVect (_G.nRegs); + bitVect *rmask = newBitVect (_G.nRegs + (IS_GB ? 0 : 2)); /* do the special cases first */ if (ic->op == IFX) @@ -1506,7 +1520,7 @@ /* now create the register mask for those registers that are in use : this is a super set of ic->rUsed */ - ic->rMask = newBitVect (_G.nRegs + 1); + ic->rMask = newBitVect (_G.nRegs + 1 + (IS_GB ? 0 : 2)); /* for all live Ranges alive at this point */ for (j = 1; j < ic->rlive->size; j++) @@ -1688,9 +1702,11 @@ D (D_ALLOC, ("packRegsForAssign: running on ic %p\n", ic)); if (!IS_ITEMP (IC_RIGHT (ic)) || OP_SYMBOL (IC_RIGHT (ic))->isind || OP_LIVETO (IC_RIGHT (ic)) > ic->seq) - { - return 0; - } + return 0; + + /* Avoid having multiple named address spaces in one iCode. */ + if (IS_SYMOP (IC_RESULT (ic)) && SPEC_ADDRSPACE (OP_SYMBOL (IC_RESULT (ic))->etype)) + return 0; /* find the definition of iTempNN scanning backwards if we find a a use of the true symbol in before we find the definition then @@ -1751,7 +1767,6 @@ dic = NULL; break; } - } } @@ -2091,7 +2106,6 @@ return FALSE; } -// HL handled by new register allocator static iCode * packRegsForHLUse3 (iCode * lic, operand * op, eBBlock * ebp) { @@ -2099,6 +2113,7 @@ symbol *sym; iCode *ic, *dic; bool isFirst = TRUE; + bool exstk = (currFunc && currFunc->stack > 127); D (D_PACK_HLUSE3, ("Checking HL on %p lic key %u first def %u line %u:\n", OP_SYMBOL (op), lic->key, bitVectFirstBit (OP_DEFS (op)), @@ -2120,7 +2135,7 @@ if (bitVectnBitsOn (OP_DEFS (op)) > 1) return NULL; - if ((!z80_opts.oldralloc && OPTRALLOC_A) ? getSize (operandType (op)) != 2 : getSize (operandType (op)) > 2) + if (!options.oldralloc ? getSize (operandType (op)) != 2 : getSize (operandType (op)) > 2) return NULL; /* And this is the definition */ @@ -2167,7 +2182,7 @@ continue; } - if (IC_RESULT (ic) && IS_SYMOP (IC_RESULT (ic)) && isOperandInDirSpace (IC_RESULT (ic))) + if (IC_RESULT (ic) && IS_SYMOP (IC_RESULT (ic)) && (isOperandInDirSpace (IC_RESULT (ic)) || exstk)) return NULL; if (IC_LEFT (ic) && IS_SYMOP (IC_LEFT (ic)) && isOperandInDirSpace (IC_LEFT (ic))) @@ -2207,20 +2222,13 @@ ic->op == UNARYMINUS || ic->op == RETURN || ic->op == RIGHT_OP || - ic->op == '-' || + (ic->op == '-' && getSize (operandType (IC_RESULT (ic))) == 1) || ic->op == BITWISEAND || ic->op == '|' || ic->op == '>' || ic->op == '<' || ic->op == EQ_OP || (ic->op == '+' && getSize (operandType (IC_RESULT (ic))) == 1)) /* 16 bit addition uses add hl, rr */ continue; - /* Strangely this leads to a code size increase for some functions. */ - if(!z80_opts.oldralloc) - { - if (ic->op == '+' && getSize (operandType (IC_RESULT (ic))) == 2 && isOperandEqual (op, IC_RESULT (ic))) - continue; - } - if (ic->op == '*' && isOperandEqual (op, IC_LEFT (ic))) continue; @@ -2774,14 +2782,14 @@ result of that operation is not on stack then we can leave the result of this operation in acc:b combination */ - if ((z80_opts.oldralloc || !OPTRALLOC_HL) && !DISABLE_PACK_HL && IS_ITEMP (IC_RESULT (ic))) + if ((options.oldralloc || !OPTRALLOC_HL) && !DISABLE_PACK_HL && IS_ITEMP (IC_RESULT (ic))) if (!IS_GB && !IY_RESERVED) packRegsForHLUse3 (ic, IC_RESULT (ic), ebp); - if ((z80_opts.oldralloc || !OPTRALLOC_IY) && !DISABLE_PACK_IY && !IY_RESERVED && IS_ITEMP (IC_RESULT (ic)) && !IS_GB) + if ((options.oldralloc || !OPTRALLOC_IY) && !DISABLE_PACK_IY && !IY_RESERVED && IS_ITEMP (IC_RESULT (ic)) && !IS_GB) packRegsForIYUse (ic, IC_RESULT (ic), ebp); - if ((z80_opts.oldralloc || !OPTRALLOC_A) && !DISABLE_PACK_ACC && IS_ITEMP (IC_RESULT (ic)) && + if (options.oldralloc && !DISABLE_PACK_ACC && IS_ITEMP (IC_RESULT (ic)) && getSize (operandType (IC_RESULT (ic))) == 1) packRegsForAccUse2 (ic); } @@ -2950,7 +2958,7 @@ } } -void +static void RegFix (eBBlock ** ebbs, int count) { int i; @@ -3147,10 +3155,6 @@ RegFix (ebbs, count); - /* When --max-allocs-per-node is too low, there can be gaps. */ - //freeAllRegs (); - //fillGaps(); - /* New register allcoator here. */ /* if stack was extended then tell the user */ @@ -3203,7 +3207,7 @@ z80_assignRegisters (ebbIndex * ebbi) { #ifdef OLDRALLOC - if (z80_opts.oldralloc) + if (options.oldralloc) z80_oldralloc (ebbi); else #endif diff -Nru sdcc-3.1.0+dfsg/src/z80/ralloc.h sdcc-3.2.0+dfsg/src/z80/ralloc.h --- sdcc-3.1.0+dfsg/src/z80/ralloc.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/z80/ralloc.h 2012-06-22 11:17:10.000000000 +0000 @@ -52,6 +52,8 @@ CND_IDX }; +#define A_IDX (IS_GB ? 4 : (IY_RESERVED ? 6 : 8)) + enum { REG_PTR = 1, diff -Nru sdcc-3.1.0+dfsg/src/z80/ralloc2.cc sdcc-3.2.0+dfsg/src/z80/ralloc2.cc --- sdcc-3.1.0+dfsg/src/z80/ralloc2.cc 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/z80/ralloc2.cc 2012-06-28 14:09:28.000000000 +0000 @@ -21,14 +21,24 @@ //#define DEBUG_RALLOC_DEC // Uncomment to get debug messages while doing register allocation on the tree decomposition. //#define DEBUG_RALLOC_DEC_ASS // Uncomment to get debug messages about assignments while doing register allocation on the tree decomposition (much more verbose than the one above). -#include "SDCCralloc.hpp" +#define THIS_IS_THE_Z80_PORT_OR_WHATEVER +#include "SDCCralloc.hpp" extern "C" { + #include "z80.h" unsigned char dryZ80iCode (iCode * ic); + bool z80_assignment_optimal; + bool should_omit_frame_ptr; }; +bool +iy_reserved(void) +{ + return(bool)(IY_RESERVED); +} + #define REG_C 0 #define REG_B 1 #define REG_E 2 @@ -79,12 +89,12 @@ c += 2.0f; // Code generator cannot handle variables only partially in A. - if(OPTRALLOC_A && size > 1) + if(size > 1) for(unsigned short int i = 0; i < size; i++) if(byteregs[i] == REG_A) c += std::numeric_limits::infinity(); - if(OPTRALLOC_A && byteregs[0] == REG_A) + if(byteregs[0] == REG_A) c -= 0.4f; else if(OPTRALLOC_HL && byteregs[0] == REG_L) c -= 0.1f; @@ -109,7 +119,7 @@ // Check that the operand is either fully in registers or fully in memory. template -bool operand_sane(const operand *o, const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +static bool operand_sane(const operand *o, const assignment &a, unsigned short int i, const G_t &G, const I_t &I) { if(!o || !IS_SYMOP(o)) return(true); @@ -137,8 +147,8 @@ return(true); } -template static float -default_instruction_cost(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +template +static float default_instruction_cost(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) { float c = 0.0f; @@ -151,8 +161,8 @@ return(c); } -template bool -inst_sane(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +template +static bool inst_sane(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) { const iCode *ic = G[i].ic; @@ -200,12 +210,12 @@ } // Code generator cannot handle variables only partially in A. - if(OPTRALLOC_A && size1 > 1) + if(size1 > 1) for(unsigned short int i = 0; i < size1; i++) if(byteregs[i] == REG_A) c += std::numeric_limits::infinity(); - if(OPTRALLOC_A && byteregs[0] == REG_A) + if(byteregs[0] == REG_A) c -= 0.4f; else if(OPTRALLOC_IY && byteregs[0] == REG_IYL || byteregs[0] == REG_IYH) c += 0.1f; @@ -236,7 +246,7 @@ size2++; } - if(OPTRALLOC_A && byteregs[0] == REG_A) + if(byteregs[0] == REG_A) c -= 0.4f; else if(OPTRALLOC_IY && byteregs[0] == REG_IYL || byteregs[0] == REG_IYH) c += 0.1f; @@ -286,7 +296,7 @@ size++; } - if(OPTRALLOC_A && byteregs[0] == REG_A) + if(byteregs[0] == REG_A) c -= 0.4f; if(byteregs[0] == REG_L) @@ -341,12 +351,12 @@ } // Code generator cannot handle variables only partially in A. - if(OPTRALLOC_A && size > 1) + if(size > 1) for(unsigned short int i = 0; i < size; i++) if(byteregs[i] == REG_A) c += std::numeric_limits::infinity(); - if(OPTRALLOC_A && byteregs[0] == REG_A) + if(byteregs[0] == REG_A) c -= 0.4f; if(byteregs[0] == REG_L) @@ -378,8 +388,8 @@ return(default_operand_cost(IC_JTCOND(ic), a, i, G, I)); } -template void -add_operand_conflicts_in_node(const cfg_node &n, I_t &I) +template +static void add_operand_conflicts_in_node(const cfg_node &n, I_t &I) { const iCode *ic = n.ic; @@ -391,7 +401,7 @@ return; if(!(ic->op == '~' || ic->op == UNARYMINUS || ic->op == '+' || ic->op == '-' || ic->op == '^' || ic->op == '|' || ic->op == BITWISEAND)) - return; // Code generation can always handle all other operations. Todo: Handle ^, |, BITWISEAND there as well. + return; // Code generation can always handle all other operations. Todo: Handle ^, |, BITWISEAND and float UNARYMINUS there as well. operand_map_t::const_iterator oir, oir_end, oirs; boost::tie(oir, oir_end) = n.operands.equal_range(OP_SYMBOL_CONST(result)->key); @@ -423,7 +433,7 @@ // Return true, iff the operand is placed (partially) in r. template -bool operand_in_reg(const operand *o, reg_t r, const i_assignment_t &ia, unsigned short int i, const G_t &G) +static bool operand_in_reg(const operand *o, reg_t r, const i_assignment_t &ia, unsigned short int i, const G_t &G) { if(!o || !IS_SYMOP(o)) return(false); @@ -436,8 +446,29 @@ return(false); } +// Return true, iff the operand is placed on the stack. +template +bool operand_on_stack(const operand *o, const assignment &a, unsigned short int i, const G_t &G) +{ + if(!o || !IS_SYMOP(o)) + return(false); + + if(OP_SYMBOL_CONST(o)->remat) + return(false); + + if(OP_SYMBOL_CONST(o)->_isparm && !IS_REGPARM (OP_SYMBOL_CONST(o)->etype)) + return(true); + + operand_map_t::const_iterator oi, oi_end; + for(boost::tie(oi, oi_end) = G[i].operands.equal_range(OP_SYMBOL_CONST(o)->key); oi != oi_end; ++oi) + if(a.global[oi->second] < 0) + return(true); + + return(false); +} + template -bool operand_is_pair(const operand *o, const assignment &a, unsigned short int i, const G_t &G) +static bool operand_is_pair(const operand *o, const assignment &a, unsigned short int i, const G_t &G) { if(!o || !IS_SYMOP(o)) return(false); @@ -464,15 +495,20 @@ } template -bool Ainst_ok(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +static bool Ainst_ok(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) { const iCode *ic = G[i].ic; + const i_assignment_t &ia = a.i_assignment; + const operand *const left = IC_LEFT(ic); + const operand *const right = IC_RIGHT(ic); + const operand *const result = IC_RESULT(ic); + if(ia.registers[REG_A][1] < 0) return(true); // Register A not in use. - //if(i == 15) std::cout << "Ainst_ok: A = (" << ia.registers[REG_A][0] << ", " << ia.registers[REG_A][1] << "), inst " << i << ", " << ic->key << "\n"; + //std::cout << "Ainst_ok: A = (" << ia.registers[REG_A][0] << ", " << ia.registers[REG_A][1] << "), inst " << i << ", " << ic->key << "\n"; // Code generator cannot handle variables that are only partially in A. if(I[ia.registers[REG_A][1]].size > 1 || ia.registers[REG_A][0] >= 0 && I[ia.registers[REG_A][0]].size > 1) @@ -492,41 +528,75 @@ input_in_A = operand_in_reg(IC_JTCOND(ic), REG_A, ia, i, G); break; default: - input_in_A = operand_in_reg(IC_LEFT(ic), REG_A, ia, i, G) || operand_in_reg(IC_RIGHT(ic), REG_A, ia, i, G); + input_in_A = operand_in_reg(left, REG_A, ia, i, G) || operand_in_reg(right, REG_A, ia, i, G); break; } - if(!result_in_A && !input_in_A) + // bit instructions do not disturb a. + if(!IS_GB && ic->op == BITWISEAND && ifxForOp (IC_RESULT(ic), ic) && (IS_OP_LITERAL(left) && IS_TRUE_SYMOP (IC_RIGHT(ic)) || IS_OP_LITERAL(right) && IS_TRUE_SYMOP (left))) + { + operand *const litop = IS_OP_LITERAL(left) ? IC_LEFT(ic) : IC_RIGHT(ic); + for(unsigned int i = 0; i < getSize(operandType(result)); i++) + { + unsigned char byte = (ulFromVal (OP_VALUE (litop)) >> (i * 8) & 0xff); + if (byte != 0x00 && byte != 0x01 && byte != 0x02 && byte != 0x04 && byte != 0x08 && byte != 0x10 && byte != 0x20 && byte != 0x40 && byte != 0x80) + goto nobit; + } + //std::cout << "Bit: Accepting at " << i << ", " << ic->key << "(" << int(ic->op) << ")\n"; + return(true); + } + nobit: + + const std::set &dying = G[i].dying; + + if(ic->op == GET_VALUE_AT_ADDRESS) + return(result_in_A || !IS_BITVAR(getSpec(operandType (result)))); + if(ic->op == '=' && POINTER_SET (ic)) + return(dying.find(ia.registers[REG_A][1]) != dying.end() || dying.find(ia.registers[REG_A][0]) != dying.end() || !(IS_BITVAR(getSpec(operandType (result))) || IS_BITVAR(getSpec(operandType (right))))); + + if(1) { // Variable in A is not used by this instruction - if(ic->op == '+' && IS_ITEMP (IC_LEFT (ic)) && IS_ITEMP (IC_RESULT (ic)) && IS_OP_LITERAL (IC_RIGHT (ic)) && - ulFromVal (OP_VALUE (IC_RIGHT (ic))) == 1 && - OP_KEY (IC_RESULT (ic)) == OP_KEY (IC_LEFT (ic))) + if(ic->op == '+' && IS_ITEMP (IC_LEFT(ic)) && IS_ITEMP (IC_RESULT(ic)) && IS_OP_LITERAL (right) && + ulFromVal (OP_VALUE (IC_RIGHT(ic))) == 1 && + OP_KEY (IC_RESULT(ic)) == OP_KEY (IC_LEFT(ic))) return(true); - if((ic->op == '=' || ic->op == CAST) && !POINTER_SET (ic) && isOperandEqual(IC_RESULT(ic), IC_RIGHT(ic))) + if((ic->op == '=' || ic->op == CAST) && !POINTER_SET (ic) && isOperandEqual (result, right)) + return(true); + + if((ic->op == '=' || ic->op == CAST) && !POINTER_SET (ic) && !(ic->op == CAST && IS_BOOL (operandType (result))) && + (operand_in_reg(right, REG_A, ia, i, G) || operand_in_reg(right, REG_B, ia, i, G) || operand_in_reg(right, REG_C, ia, i, G) || operand_in_reg(right, REG_D, ia, i, G) || operand_in_reg(right, REG_E, ia, i, G) || operand_in_reg(right, REG_H, ia, i, G) || operand_in_reg(right, REG_L, ia, i, G)) && + (operand_in_reg(right, REG_A, ia, i, G) || operand_in_reg(result, REG_B, ia, i, G) || operand_in_reg(result, REG_C, ia, i, G) || operand_in_reg(result, REG_D, ia, i, G) || operand_in_reg(result, REG_E, ia, i, G) || operand_in_reg(right, REG_H, ia, i, G) || operand_in_reg(right, REG_L, ia, i, G))) return(true); if(ic->op == GOTO || ic->op == LABEL) return(true); - //if(i == 15) std::cout << "Not Used: Dropping at " << i << ", " << ic->key << "(" << int(ic->op) << "\n"; - return(false); + if(ic->op == IPUSH && getSize(operandType(IC_LEFT(ic))) <= 2 && + (operand_in_reg(left, REG_A, ia, i, G) || + operand_in_reg(left, REG_C, ia, i, G) && I[ia.registers[REG_C][1]].byte == 0 && (getSize(operandType(left)) < 2 || operand_in_reg(left, REG_B, ia, i, G)) || + operand_in_reg(left, REG_E, ia, i, G) && I[ia.registers[REG_E][1]].byte == 0 && (getSize(operandType(left)) < 2 || operand_in_reg(left, REG_D, ia, i, G)) || + operand_in_reg(left, REG_L, ia, i, G) && I[ia.registers[REG_L][1]].byte == 0 && (getSize(operandType(left)) < 2 || operand_in_reg(left, REG_H, ia, i, G)) || + operand_in_reg(left, REG_IYL, ia, i, G) && I[ia.registers[REG_IYL][1]].byte == 0 && (getSize(operandType(left)) < 2 || operand_in_reg(left, REG_IYH, ia, i, G)))) + return(true); + if(!result_in_A && !input_in_A) + return(false); } // Last use of operand in A. - const std::set &dying = G[i].dying; if(input_in_A && (result_in_A || dying.find(ia.registers[REG_A][1]) != dying.end() || dying.find(ia.registers[REG_A][0]) != dying.end())) { if(ic->op != IFX && - !((ic->op == RIGHT_OP || ic->op == LEFT_OP) && (IS_OP_LITERAL(IC_RIGHT(ic)) || operand_in_reg(IC_RIGHT(ic), REG_A, ia, i, G))) && + ic->op != RETURN && + !((ic->op == RIGHT_OP || ic->op == LEFT_OP) && (IS_OP_LITERAL(right) || operand_in_reg(right, REG_A, ia, i, G))) && !((ic->op == '=' || ic->op == CAST) && !(IY_RESERVED && POINTER_SET(ic))) && !IS_BITWISE_OP (ic) && !(ic->op == '~') && - !(ic->op == '*' && IS_ITEMP(IC_LEFT(ic)) && IS_ITEMP(IC_RIGHT(ic))) && + !(ic->op == '*' && (IS_ITEMP(IC_LEFT(ic)) || IS_OP_LITERAL(IC_LEFT(ic))) && (IS_ITEMP(IC_RIGHT(ic)) || IS_OP_LITERAL(IC_RIGHT(ic)))) && !((ic->op == '-' || ic->op == '+' || ic->op == EQ_OP) && IS_OP_LITERAL(IC_RIGHT(ic)))) { - //if(i == 15) std::cout << "Last use: Dropping at " << i << ", " << ic->key << "(" << int(ic->op) << ")\n"; + //std::cout << "Last use: Dropping at " << i << ", " << ic->key << "(" << int(ic->op) << ")\n"; return(false); } } @@ -544,7 +614,9 @@ !POINTER_GET(ic) && ic->op != '+' && ic->op != '-' && + (ic->op != '*' || !IS_OP_LITERAL(IC_LEFT(ic)) && !IS_OP_LITERAL(right)) && !IS_BITWISE_OP(ic) && + ic->op != GET_VALUE_AT_ADDRESS && ic->op != '=' && ic->op != EQ_OP && ic->op != '<' && @@ -553,19 +625,19 @@ ic->op != CALL && ic->op != PCALL && ic->op != GETHBIT && - !((ic->op == LEFT_OP || ic->op == RIGHT_OP) && IS_OP_LITERAL(IC_RIGHT(ic)))) + !((ic->op == LEFT_OP || ic->op == RIGHT_OP) && IS_OP_LITERAL(right))) { - //if(i == 15) std::cout << "First use: Dropping at " << i << ", " << ic->key << "(" << int(ic->op) << "\n"; + //std::cout << "First use: Dropping at " << i << ", " << ic->key << "(" << int(ic->op) << "\n"; return(false); } - //if(i == 15) std::cout << "Default OK\n"; + //std::cout << "Default OK\n"; return(true); } template -bool HLinst_ok(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +static bool HLinst_ok(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) { const iCode *ic = G[i].ic; @@ -573,6 +645,8 @@ if(TARGET_IS_GBZ80) return(true); + bool exstk = (should_omit_frame_ptr || (currFunc && currFunc->stack > 127) || IS_GB); + const i_assignment_t &ia = a.i_assignment; bool unused_L = (ia.registers[REG_L][1] < 0); @@ -582,7 +656,8 @@ return(true); // Register HL not in use. #if 0 - std::cout << "HLinst_ok: at (" << i << ", " << ic->key << ")\nL = (" << ia.registers[REG_L][0] << ", " << ia.registers[REG_L][1] << "), H = (" << ia.registers[REG_H][0] << ", " << ia.registers[REG_H][1] << ")inst " << i << ", " << ic->key << "\n"; + if (ic->key == 40) + std::cout << "HLinst_ok: at (" << i << ", " << ic->key << ")\nL = (" << ia.registers[REG_L][0] << ", " << ia.registers[REG_L][1] << "), H = (" << ia.registers[REG_H][0] << ", " << ia.registers[REG_H][1] << ")inst " << i << ", " << ic->key << "\n"; #endif const operand *left = IC_LEFT(ic); @@ -631,19 +706,24 @@ if((IS_GB || IY_RESERVED) && (IS_TRUE_SYMOP(left) || IS_TRUE_SYMOP(right))) return(false); - if(options.omitFramePtr) // Todo: Make this more accurate to get better code when using --fomit-frame-pointer - return(false); + if((IS_GB || IY_RESERVED) && IS_TRUE_SYMOP(result) && getSize(operandType(IC_RESULT(ic))) > 2) + return(false); if(result_only_HL && ic->op == PCALL) return(true); - if(ic->op == '+' && getSize(operandType(IC_RESULT(ic))) >= 2 && - (IS_TRUE_SYMOP (result) || IS_TRUE_SYMOP (left) || IS_TRUE_SYMOP (right))) // Might use (hl). + if(exstk && (operand_on_stack(result, a, i, G) + operand_on_stack(left, a, i, G) + operand_on_stack(right, a, i, G) >= 2) && (result && IS_SYMOP(result) && getSize(operandType(result)) >= 2 || !result_only_HL)) // Todo: Make this more accurate to get better code when using --fomit-frame-pointer + return(false); + if(exstk && (operand_on_stack(left, a, i, G) || operand_on_stack(right, a, i, G)) && ic->op == '>' || ic->op == '<') return(false); - if(ic->op == '+' && input_in_HL && IS_TRUE_SYMOP (result)) // Might use (hl) for result. + if(ic->op == '+' && getSize(operandType(result)) >= 2 && + (IS_TRUE_SYMOP (result) || IS_TRUE_SYMOP (left) || exstk && operand_on_stack(left, a, i, G) || IS_TRUE_SYMOP (right) || exstk && operand_on_stack(right, a, i, G))) // Might use (hl). return(false); - + + if(ic->op == '+' && input_in_HL && (IS_TRUE_SYMOP (result) || operand_on_stack(result, a, i, G) && exstk)) // Might use (hl) for result. + return(false); + // HL overwritten by result. if(result_only_HL && !POINTER_SET(ic) && (ic->op == ADDRESS_OF || @@ -654,7 +734,7 @@ ic->op == CAST)) return(true); - if(IC_RESULT(ic) && IS_SYMOP(result) && isOperandInDirSpace(IC_RESULT(ic))) + if(result && IS_SYMOP(result) && isOperandInDirSpace(IC_RESULT(ic))) return(false); if((input_in_HL || !result_only_HL) && left && IS_SYMOP(left) && isOperandInDirSpace(IC_LEFT(ic))) @@ -668,13 +748,32 @@ return(true); if(SKIP_IC2(ic)) return(true); - if(ic->op == IPUSH && input_in_H && (getSize(operandType(IC_LEFT(ic))) <= 2 || I[ia.registers[REG_L][1]].byte == 2 && I[ia.registers[REG_H][1]].byte == 3)) + if(ic->op == IPUSH && input_in_H && (getSize(operandType(IC_LEFT(ic))) <= 2 || ia.registers[REG_L][1] > 0 && I[ia.registers[REG_L][1]].byte == 2 && ia.registers[REG_H][1] > 0 && I[ia.registers[REG_H][1]].byte == 3)) + return(true); + if(ic->op == IPUSH && ic->next && ic->next->op == CALL) + return(true); + if(ic->op == IPUSH && getSize(operandType(left)) == 2 && + (ia.registers[REG_C][1] < 0 && ia.registers[REG_B][1] < 0 || ia.registers[REG_E][1] < 0 && ia.registers[REG_D][1] < 0)) // Can use pair other than HL. + return(true); + if(ic->op == IPUSH && getSize(operandType(left)) <= 2 && + (operand_in_reg(left, REG_C, ia, i, G) && I[ia.registers[REG_C][1]].byte == 0 && (getSize(operandType(left)) < 2 || operand_in_reg(left, REG_B, ia, i, G))|| + operand_in_reg(left, REG_E, ia, i, G) && I[ia.registers[REG_E][1]].byte == 0 && (getSize(operandType(left)) < 2 || operand_in_reg(left, REG_D, ia, i, G)) || + operand_in_reg(left, REG_IYL, ia, i, G) && I[ia.registers[REG_IYL][1]].byte == 0 && (getSize(operandType(left)) < 2 || operand_in_reg(left, REG_IYH, ia, i, G)))) return(true); if(POINTER_GET(ic) && input_in_L && input_in_H && (getSize(operandType(IC_RESULT(ic))) == 1 || !result_in_HL)) return(true); + if(!IS_GB && ic->op == ADDRESS_OF && + (operand_in_reg(result, REG_IYL, ia, i, G) && ia.registers[REG_IYL][1] > 0 && I[ia.registers[REG_IYL][1]].byte == 0 && operand_in_reg(result, REG_IYH, ia, i, G) || + !OP_SYMBOL_CONST (left)->onStack && operand_in_reg(result, REG_C, ia, i, G) && ia.registers[REG_C][1] > 0 && I[ia.registers[REG_C][1]].byte == 0 && operand_in_reg(result, REG_B, ia, i, G) || + !OP_SYMBOL_CONST (left)->onStack && operand_in_reg(result, REG_E, ia, i, G) && ia.registers[REG_E][1] > 0 && I[ia.registers[REG_E][1]].byte == 0 && operand_in_reg(result, REG_D, ia, i, G))) + return(true); + if(ic->op == LEFT_OP && isOperandLiteral(IC_RIGHT(ic))) return(true); + if(exstk && !result_only_HL && (operand_on_stack(left, a, i, G) || operand_on_stack(right, a, i, G) || operand_on_stack(result, a, i, G)) && ic->op == '+') + return(false); + if((!POINTER_SET(ic) && !POINTER_GET(ic) && ( (ic->op == '=' || ic->op == CAST || @@ -686,17 +785,29 @@ ic->op == '<' || ic->op == EQ_OP ||*/ (ic->op == '+' && getSize(operandType(IC_RESULT(ic))) == 1) || - (ic->op == '+' && getSize(operandType(IC_RESULT(ic))) <= 2 && result_only_HL) )))) // 16 bit addition might use add hl, rr + (ic->op == '+' && getSize(operandType(IC_RESULT(ic))) <= 2 && (result_only_HL || !IS_GB)) )))) // 16 bit addition on gbz80 might need to use add hl, rr. return(true); if((ic->op == '<' || ic->op == '>') && (IS_ITEMP(left) || IS_OP_LITERAL(left) || IS_ITEMP(right) || IS_OP_LITERAL(right))) // Todo: Fix for large stack. return(true); - if(IS_VALOP(right) && ic->op == EQ_OP) + if(ic->op == EQ_OP && IS_VALOP(right)) + return(true); + + if(ic->op == CALL) return(true); // HL overwritten by result. - if(result_only_HL && (ic->op == CALL || ic->op == PCALL)) + if(result_only_HL && ic->op == PCALL) + return(true); + + if(POINTER_GET(ic) && getSize(operandType(IC_RESULT(ic))) == 1 && !IS_BITVAR(getSpec(operandType(result))) && + (operand_in_reg(right, REG_C, ia, i, G) && I[ia.registers[REG_C][1]].byte == 0 && operand_in_reg(right, REG_B, ia, i, G) || // Uses ld a, (bc) + operand_in_reg(right, REG_E, ia, i, G) && I[ia.registers[REG_E][1]].byte == 0 && operand_in_reg(right, REG_D, ia, i, G) || // Uses ld a, (de) + operand_in_reg(right, REG_IYL, ia, i, G) && I[ia.registers[REG_IYL][1]].byte == 0 && operand_in_reg(right, REG_IYH, ia, i, G))) // Uses ld r, 0 (iy) + return(true); + + if((ic->op == '=') && POINTER_SET(ic) && operand_in_reg(result, REG_IYL, ia, i, G) && I[ia.registers[REG_IYL][1]].byte == 0 && operand_in_reg(result, REG_IYH, ia, i, G)) // Uses ld 0 (iy), l etc return(true); if((ic->op == '=' || ic->op == CAST) && POINTER_SET(ic) && !result_only_HL) // loads result pointer into (hl) first. @@ -715,7 +826,7 @@ } template -bool IYinst_ok(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +static bool IYinst_ok(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) { const iCode *ic = G[i].ic; @@ -725,8 +836,10 @@ const i_assignment_t &ia = a.i_assignment; - //if(ic->key == 118) -// std::cout << "1IYinst_ok: at (" << i << ", " << ic->key << ")\nIYL = (" << ia.registers[REG_IYL][0] << ", " << ia.registers[REG_IYL][1] << "), IYH = (" << ia.registers[REG_IYH][0] << ", " << ia.registers[REG_IYH][1] << ")inst " << i << ", " << ic->key << "\n"; + /*if(ic->key == 40) + std::cout << "1IYinst_ok: at (" << i << ", " << ic->key << ")\nIYL = (" << ia.registers[REG_IYL][0] << ", " << ia.registers[REG_IYL][1] << "), IYH = (" << ia.registers[REG_IYH][0] << ", " << ia.registers[REG_IYH][1] << ")inst " << i << ", " << ic->key << "\n";*/ + + bool exstk = (should_omit_frame_ptr || (currFunc && currFunc->stack > 127)); bool unused_IYL = (ia.registers[REG_IYL][1] < 0); bool unused_IYH = (ia.registers[REG_IYH][1] < 0); @@ -766,9 +879,9 @@ if(unused_IYL && unused_IYH) return(true); // Register IY not in use. - - if(options.omitFramePtr) // Todo: Make this more accurate to get better code when using --fomit-frame-pointer - return(false); + + if(exstk && (operand_on_stack(result, a, i, G) || operand_on_stack(left, a, i, G) || operand_on_stack(right, a, i, G))) // Todo: Make this more accurate to get better code when using --fomit-frame-pointer + return(false); // Code generator cannot handle variables that are only partially in IY. if(unused_IYL ^ unused_IYH) @@ -848,7 +961,54 @@ } template -void set_surviving_regs(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +bool DEinst_ok(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +{ + if(!IS_GB) // Only gbz80 might need de for code generation. + return(true); + + const i_assignment_t &ia = a.i_assignment; + + bool unused_E = (ia.registers[REG_E][1] < 0); + bool unused_D = (ia.registers[REG_D][1] < 0); + + if(unused_E && unused_D) + return(true); // Register DE not in use. + + const iCode *ic = G[i].ic; + const operand *left = IC_LEFT(ic); + const operand *right = IC_RIGHT(ic); + const operand *result = IC_RESULT(ic); + + //const std::set &dying = G[i].dying; + + if(ic->op == PCALL) + return(false); + + if(ic->op == GET_VALUE_AT_ADDRESS && (getSize(operandType(result)) >= 2 || !operand_is_pair(left, a, i, G))) + return(false); + + if (ic->op == '=' && POINTER_SET(ic) && !operand_is_pair(result, a, i, G)) + return(false); + + if((ic->op == '=' || ic->op == CAST) && getSize(operandType(result)) >= 2 && + (operand_on_stack(right, a, i, G) || operand_in_reg(right, REG_L, ia, i, G) || operand_in_reg(right, REG_H, ia, i, G)) && + (operand_on_stack(result, a, i, G) || operand_in_reg(result, REG_L, ia, i, G) || operand_in_reg(result, REG_H, ia, i, G))) + return(false); + + if(ic->op == '+' && getSize(operandType(result)) >= 2) + return(false); + + if(ic->op == UNARYMINUS || ic->op == '-' || ic->op == '*') + return(false); + + if(ic->op == '>' || ic->op == '<') + return(false); + + return(true); +} + +template +static void set_surviving_regs(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) { iCode *ic = G[i].ic; @@ -856,13 +1016,13 @@ std::set::const_iterator v, v_end; for (v = G[i].alive.begin(), v_end = G[i].alive.end(); v != v_end; ++v) - if(G[i].dying.find(*v) == G[i].dying.end()) - if(!(IC_RESULT(ic) && IS_SYMOP(IC_RESULT(ic)) && OP_SYMBOL_CONST(IC_RESULT(ic))->key == I[*v].v)) + if(a.global[*v] >= 0 && G[i].dying.find(*v) == G[i].dying.end()) + if(!((IC_RESULT(ic) && !POINTER_SET(ic)) && IS_SYMOP(IC_RESULT(ic)) && OP_SYMBOL_CONST(IC_RESULT(ic))->key == I[*v].v)) ic->rSurv = bitVectSetBit(ic->rSurv, a.global[*v]); } template -void unset_surviving_regs(unsigned short int i, const G_t &G) +static void unset_surviving_regs(unsigned short int i, const G_t &G) { iCode *ic = G[i].ic; @@ -870,7 +1030,7 @@ } template -void assign_operand_for_cost(operand *o, const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +static void assign_operand_for_cost(operand *o, const assignment &a, unsigned short int i, const G_t &G, const I_t &I) { if(!o || !IS_SYMOP(o)) return; @@ -881,7 +1041,7 @@ var_t v = oi->second; if(a.global[v] >= 0) { - if((a.global[v] != REG_A || !OPTRALLOC_A) && (a.global[v] != REG_IYL && a.global[v] != REG_IYH || !OPTRALLOC_IY)) + if(a.global[v] != REG_A && (a.global[v] != REG_IYL && a.global[v] != REG_IYH || !OPTRALLOC_IY)) { sym->regs[I[v].byte] = regsZ80 + a.global[v]; sym->accuse = 0; @@ -914,7 +1074,7 @@ } template -void assign_operands_for_cost(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +static void assign_operands_for_cost(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) { const iCode *ic = G[i].ic; @@ -937,20 +1097,28 @@ // Cost function. template -float instruction_cost(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +static float instruction_cost(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) { iCode *ic = G[i].ic; float c; + wassert (TARGET_Z80_LIKE); + if(!inst_sane(a, i, G, I)) return(std::numeric_limits::infinity()); - if(OPTRALLOC_A && !Ainst_ok(a, i, G, I)) + if(ic->generated) + return(0.0f); + + if(!Ainst_ok(a, i, G, I)) return(std::numeric_limits::infinity()); if(OPTRALLOC_HL && !HLinst_ok(a, i, G, I)) return(std::numeric_limits::infinity()); + if(!DEinst_ok(a, i, G, I)) + return(std::numeric_limits::infinity()); + if(OPTRALLOC_IY && !IYinst_ok(a, i, G, I)) return(std::numeric_limits::infinity()); @@ -1082,12 +1250,12 @@ return(false); } -// For early removel of assignments that cannot be extended to valid assignments. +// For early removal of assignments that cannot be extended to valid assignments. template -bool assignment_hopeless(const assignment &a, unsigned short int i, const G_t &G, const I_t &I, const var_t lastvar) +static bool assignment_hopeless(const assignment &a, unsigned short int i, const G_t &G, const I_t &I, const var_t lastvar) { // Can check for Ainst_ok() since A only contains 1-byte variables. - if(OPTRALLOC_A && !Ainst_ok(a, i, G, I)) + if(!G[i].ic->generated && !Ainst_ok(a, i, G, I)) return(true); if(local_assignment_insane(a, I, lastvar)) @@ -1120,8 +1288,9 @@ return(false); } +// Increase chance of finding good compatible assignments at join nodes. template -void get_best_local_assignment_biased(assignment &a, typename boost::graph_traits::vertex_descriptor t, const T_t &T) +static void get_best_local_assignment_biased(assignment &a, typename boost::graph_traits::vertex_descriptor t, const T_t &T) { const assignment_list_t &alist = T[t].assignments; @@ -1132,7 +1301,7 @@ { varset_t::const_iterator vi, vi_end; for(vi = ai->local.begin(), vi_end = ai->local.end(); vi != vi_end; ++vi) - if(OPTRALLOC_A && ai->global[*vi] == REG_A || OPTRALLOC_HL && (ai->global[*vi] == REG_H || ai->global[*vi] == REG_L) || OPTRALLOC_IY && (ai->global[*vi] == REG_IYH || ai->global[*vi] == REG_IYL)) + if(ai->global[*vi] == REG_A || OPTRALLOC_HL && (ai->global[*vi] == REG_H || ai->global[*vi] == REG_L) || OPTRALLOC_IY && (ai->global[*vi] == REG_IYH || ai->global[*vi] == REG_IYL)) goto too_risky; ai_best = ai; } @@ -1148,7 +1317,7 @@ } template -float rough_cost_estimate(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) +static float rough_cost_estimate(const assignment &a, unsigned short int i, const G_t &G, const I_t &I) { const i_assignment_t &ia = a.i_assignment; @@ -1162,7 +1331,7 @@ !HLinst_ok(a, i, G, I)) c += 8.0f; - if(OPTRALLOC_A && ia.registers[REG_A][1] < 0) + if(ia.registers[REG_A][1] < 0) c += 0.03f; if(OPTRALLOC_HL && ia.registers[REG_L][1] < 0) @@ -1200,9 +1369,22 @@ return(c); } +// Code for another ic is generated when generating this one. Mark the other as generated. +static void extra_ic_generated(const iCode *ic) +{ + if(ic->op == '>' || ic->op == '<' || ic->op == LE_OP || ic->op == GE_OP || ic->op == EQ_OP || ic->op == NE_OP || ic->op == '^' || ic->op == '|' || ic->op == BITWISEAND) + { + iCode *ifx; + if (ifx = ifxForOp (IC_RESULT (ic), ic)) + ifx->generated = 1; + } +} + template -void tree_dec_ralloc(T_t &T, const G_t &G, const I_t &I) +static bool tree_dec_ralloc(T_t &T, const G_t &G, const I_t &I) { + bool assignment_optimal; + con2_t I2(boost::num_vertices(I)); for(unsigned int i = 0; i < boost::num_vertices(I); i++) { @@ -1217,7 +1399,7 @@ assignment ac; assignment_optimal = true; - tree_dec_ralloc_nodes(T, find_root(T), G, I2, ac); + tree_dec_ralloc_nodes(T, find_root(T), G, I2, ac, &assignment_optimal); const assignment &winner = *(T[find_root(T)].assignments.begin()); @@ -1244,7 +1426,7 @@ symbol *sym = (symbol *)(hTabItemWithKey(liveRanges, I[v].v)); if(winner.global[v] >= 0) { - if((winner.global[v] != REG_A || !OPTRALLOC_A) && (winner.global[v] != REG_IYL && winner.global[v] != REG_IYH || !OPTRALLOC_IY)) + if(winner.global[v] != REG_A && (winner.global[v] != REG_IYL && winner.global[v] != REG_IYH || !OPTRALLOC_IY)) { sym->regs[I[v].byte] = regsZ80 + winner.global[v]; sym->accuse = 0; @@ -1276,9 +1458,61 @@ sym->isspilt = false; } } - + for(unsigned int i = 0; i < boost::num_vertices(G); i++) set_surviving_regs(winner, i, G, I); // Never freed. Memory leak? + + return(!assignment_optimal); +} + +// Omit the frame pointer for functions with low register pressure and few parameter accesses. +template +static bool omit_frame_ptr(const G_t &G) +{ + if(IS_GB) + return(false); + + if(options.omitFramePtr) + return(true); + + signed char omitcost = -16; + for(unsigned int i = 0; i < boost::num_vertices(G); i++) + { + if((int)G[i].alive.size() > NUM_REGS - 4) + return(false); + + const iCode *const ic = G[i].ic; + const operand *o; + o = IC_RESULT(ic); + if(o && IS_SYMOP(o) && OP_SYMBOL_CONST(o)->_isparm && !IS_REGPARM (OP_SYMBOL_CONST(o)->etype)) + omitcost += 6; + o = IC_LEFT(ic); + if(o && IS_SYMOP(o) && OP_SYMBOL_CONST(o)->_isparm && !IS_REGPARM (OP_SYMBOL_CONST(o)->etype)) + omitcost += 6; + o = IC_RIGHT(ic); + if(o && IS_SYMOP(o) && OP_SYMBOL_CONST(o)->_isparm && !IS_REGPARM (OP_SYMBOL_CONST(o)->etype)) + omitcost += 6; + + if(omitcost > 14) // Chosen greater than zero, since the peephole optimizer often can optimize the use of iy into use of hl, reducing the cost. + return(false); + } + + return(true); +} + +// Adjust stack location when deciding to omit frame pointer. +void move_parms(void) +{ + if(!currFunc || IS_GB || options.omitFramePtr || !should_omit_frame_ptr) + return; + + for(value *val = FUNC_ARGS (currFunc->type); val; val = val->next) + { + if(IS_REGPARM(val->sym->etype) || !val->sym->onStack) + continue; + + val->sym->stack -= 2; + } } iCode *z80_ralloc2_cc(ebbIndex *ebbi) @@ -1295,10 +1529,13 @@ ic = create_cfg(control_flow_graph, conflict_graph, ebbi); - if(z80_opts.dump_graphs) + should_omit_frame_ptr = omit_frame_ptr(control_flow_graph); + move_parms(); + + if(options.dump_graphs) dump_cfg(control_flow_graph); - if(z80_opts.dump_graphs) + if(options.dump_graphs) dump_con(conflict_graph); tree_dec_t tree_decomposition; @@ -1313,10 +1550,10 @@ nicify(tree_decomposition); alive_tree_dec(tree_decomposition, control_flow_graph); - if(z80_opts.dump_graphs) + if(options.dump_graphs) dump_tree_decomposition(tree_decomposition); - tree_dec_ralloc(tree_decomposition, control_flow_graph, conflict_graph); + z80_assignment_optimal = !tree_dec_ralloc(tree_decomposition, control_flow_graph, conflict_graph); return(ic); } diff -Nru sdcc-3.1.0+dfsg/src/z80/z80.h sdcc-3.2.0+dfsg/src/z80/z80.h --- sdcc-3.1.0+dfsg/src/z80/z80.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/z80/z80.h 2012-05-18 10:47:44.000000000 +0000 @@ -12,6 +12,7 @@ SUB_Z80, SUB_Z180, SUB_R2K, + SUB_R3KA, SUB_GBZ80 } Z80_SUB_PORT; @@ -23,8 +24,6 @@ int port_mode; int port_back; int reserveIY; - int dump_graphs; - int oldralloc; } Z80_OPTS; @@ -32,16 +31,17 @@ #define IS_Z80 (z80_opts.sub == SUB_Z80) #define IS_Z180 (z80_opts.sub == SUB_Z180) -#define IS_GB (z80_opts.sub == SUB_GBZ80) -#define IS_R2K (z80_opts.sub == SUB_R2K) +#define IS_GB (z80_opts.sub == SUB_GBZ80) +#define IS_R2K (z80_opts.sub == SUB_R2K) +#define IS_R3KA (z80_opts.sub == SUB_R3KA) +#define IS_RAB (IS_R2K || IS_R3KA) #define IY_RESERVED (z80_opts.reserveIY) -#define OPTRALLOC_REMAT (IS_Z80 || IS_Z180 || IS_R2K) /* Enable rematerialization in the new allocator for the ports with exact cost function */ -#define OPTRALLOC_EXACT_COST (!IS_GB) // Todo: Implement exact cost for gbz80. +#define OPTRALLOC_EXACT_COST 1 +#define OPTRALLOC_REMAT (OPTRALLOC_EXACT_COST && !IS_GB) #define OPTRALLOC_HL (!IS_GB) -#define OPTRALLOC_A 1 -#define OPTRALLOC_IY !IY_RESERVED +#define OPTRALLOC_IY !(IY_RESERVED || IS_GB) enum { diff -Nru sdcc-3.1.0+dfsg/src/z80/z80.vcxproj sdcc-3.2.0+dfsg/src/z80/z80.vcxproj --- sdcc-3.1.0+dfsg/src/z80/z80.vcxproj 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/src/z80/z80.vcxproj 2012-03-18 13:40:40.000000000 +0000 @@ -48,7 +48,7 @@ Disabled - ..;.;..\..;..\..\support\util;C:\Program Files\boost\boost_1_44;%(AdditionalIncludeDirectories) + ..;.;..\..;..\..\support\util;C:\Program Files\boost\boost_1_47;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) true EnableFastChecks @@ -80,7 +80,7 @@ MaxSpeed OnlyExplicitInline - ..;.;..\..;..\..\support\util;C:\Program Files\boost\boost_1_44;%(AdditionalIncludeDirectories) + ..;.;..\..;..\..\support\util;C:\Program Files\boost\boost_1_47;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_LIB;NDEBUG;%(PreprocessorDefinitions) true MultiThreaded @@ -164,30 +164,38 @@ - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph-gbz80.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph-gbz80.rul peeph-gbz80.rul;%(Outputs) - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph-gbz80.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph-gbz80.rul peeph-gbz80.rul;%(Outputs) + Generating Peephole Rule: peeph-gbz80.rul + Generating Peephole Rule: peeph-gbz80.rul - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph-z80.rul - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph-z80.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph-z80.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph-z80.rul peeph-z80.rul;%(Outputs) peeph-z80.rul;%(Outputs) + Generating Peephole Rule: peeph-z80.rul + Generating Peephole Rule: peeph-z80.rul - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph.rul - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph.rul peeph.rul;%(Outputs) peeph.rul;%(Outputs) + Generating Peephole Rule: peeph.ru + Generating Peephole Rule: peeph.ru - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph-r2k.rul - gawk -f ../SDCCpeeph.awk %(FullPath) >peeph-r2k.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph-r2k.rul + gawk -f ../SDCCpeeph.awk %(Identity) >peeph-r2k.rul peeph-r2k.rul;%(Outputs) peeph-r2k.rul;%(Outputs) + Generating Peephole Rule: peeph-r2k.rul + Generating Peephole Rule: peeph-r2k.rul diff -Nru sdcc-3.1.0+dfsg/support/cpp/config.in sdcc-3.2.0+dfsg/support/cpp/config.in --- sdcc-3.1.0+dfsg/support/cpp/config.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/cpp/config.in 2012-03-28 12:38:08.000000000 +0000 @@ -31,6 +31,9 @@ #undef PREFIX_INCLUDE_DIR +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Define as the number of bits in a byte, if \`limits.h' doesn't. */ #undef CHAR_BIT @@ -163,10 +166,6 @@ /* Define if the host execution character set is EBCDIC. */ #undef HOST_EBCDIC -/* Define if the host machine stores words of multi-word integers in - big-endian order. */ -#undef HOST_WORDS_BIG_ENDIAN - /* Define if host mkdir takes a single argument. */ #undef MKDIR_TAKES_ONE_ARG @@ -219,6 +218,18 @@ /* Define to the version of the distribution. */ #undef VERSION +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus diff -Nru sdcc-3.1.0+dfsg/support/cpp/configure sdcc-3.2.0+dfsg/support/cpp/configure --- sdcc-3.1.0+dfsg/support/cpp/configure 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/cpp/configure 2012-05-18 10:47:44.000000000 +0000 @@ -1,11 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68. +# Generated by GNU Autoconf 2.69. # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -134,6 +132,31 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -167,7 +190,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -212,21 +236,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -328,6 +356,14 @@ } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -449,6 +485,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # 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). @@ -483,16 +523,16 @@ # ... 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'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -504,28 +544,8 @@ 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 +as_test_x='test -x' +as_executable_p=as_fn_executable_p # 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'" @@ -1179,8 +1199,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_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 @@ -1431,9 +1449,9 @@ if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.68 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1706,7 +1724,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -1850,7 +1868,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2294,16 +2312,16 @@ # Check whether --with-local-prefix was given. if test "${with_local_prefix+set}" = set; then : withval=$with_local_prefix; case "${withval}" in -yes) as_fn_error $? "bad value ${withval} given for local include directory prefix" "$LINENO" 5 ;; -no) ;; -*) local_prefix=$with_local_prefix ;; +yes) as_fn_error $? "bad value ${withval} given for local include directory prefix" "$LINENO" 5 ;; +no) ;; +*) local_prefix=$with_local_prefix ;; esac fi # Default local prefix if it is empty if test x$local_prefix = x; then - local_prefix=/usr/local + local_prefix=/usr/local fi test "$program_prefix" != NONE && @@ -2351,7 +2369,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2391,7 +2409,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2444,7 +2462,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2485,7 +2503,7 @@ 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 as_fn_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 @@ -2543,7 +2561,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2587,7 +2605,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3033,8 +3051,7 @@ /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* 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); @@ -3592,7 +3609,7 @@ 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 + as_fn_executable_p "$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 @@ -3658,7 +3675,7 @@ 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 + as_fn_executable_p "$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 @@ -3798,10 +3815,10 @@ $as_echo_n "checking whether a default assembler was specified... " >&6; } if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then if test x"$gas_flag" = x"no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEFAULT_ASSEMBLER)" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEFAULT_ASSEMBLER)" >&5 $as_echo "yes ($DEFAULT_ASSEMBLER)" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEFAULT_ASSEMBLER - GNU as)" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEFAULT_ASSEMBLER - GNU as)" >&5 $as_echo "yes ($DEFAULT_ASSEMBLER - GNU as)" >&6; } fi else @@ -3813,10 +3830,10 @@ $as_echo_n "checking whether a default linker was specified... " >&6; } if test x"${DEFAULT_LINKER+set}" = x"set"; then if test x"$gnu_ld_flag" = x"no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEFAULT_LINKER)" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEFAULT_LINKER)" >&5 $as_echo "yes ($DEFAULT_LINKER)" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEFAULT_LINKER - GNU ld)" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEFAULT_LINKER - GNU ld)" >&5 $as_echo "yes ($DEFAULT_LINKER - GNU ld)" >&6; } fi else @@ -3843,7 +3860,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3960,7 +3977,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4000,7 +4017,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4395,9 +4412,9 @@ for ac_header in limits.h stddef.h string.h strings.h stdlib.h time.h \ - fcntl.h unistd.h sys/file.h sys/time.h \ - sys/param.h sys/stat.h \ - direct.h malloc.h + fcntl.h unistd.h sys/file.h sys/time.h \ + sys/param.h sys/stat.h \ + direct.h malloc.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -4484,79 +4501,229 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking byte ordering" >&5 -$as_echo_n "checking byte ordering... " >&6; } -if ${ac_cv_c_compile_endian+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_c_compile_endian=unknown + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; -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 +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : -cat > conftest.$ac_ext <conftest.$ac_ext +/* end confdefs.h. */ +#include + #include -#ifdef HAVE_LIMITS_H -# include -#endif -/* This structure must have no internal padding. */ - struct { - char prefix[sizeof "\nendian:" - 1]; - short word; - char postfix[2]; - } tester = { - "\nendian:", -#if SIZEOF_SHORT == 4 - ('A' << (CHAR_BIT * 3)) | ('B' << (CHAR_BIT * 2)) | -#endif - ('A' << CHAR_BIT) | 'B', - 'X', '\n' -}; -EOF -if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - od -c conftest.o | - sed 's/^[0-7]*[ ]*/ / - s/\*/./g - s/ \\n/*/g - s/ [0-9][0-9][0-9]/./g - s/ \\[^ ]/./g' | - tr -d ' - ' | tr -s '*' ' -' | fold | sed '$a\ -' > conftest.dmp - if grep 'endian:AB' conftest.dmp >/dev/null 2>&1; then - ac_cv_c_compile_endian=big-endian - elif grep 'endian:BA' conftest.dmp >/dev/null 2>&1; then - ac_cv_c_compile_endian=little-endian - fi +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 +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no fi -rm -rf conftest* -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 +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 $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=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 $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; 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 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compile_endian" >&5 -$as_echo "$ac_cv_c_compile_endian" >&6; } -if test $ac_cv_c_compile_endian = unknown; then - as_fn_error $? "*** unable to determine endianness" "$LINENO" 5 -elif test $ac_cv_c_compile_endian = big-endian; then +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ -$as_echo "#define HOST_WORDS_BIG_ENDIAN 1" >>confdefs.h + /* 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 +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac # See if we have the mktemp command. @@ -4576,7 +4743,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_have_mktemp_command="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4615,7 +4782,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5105,9 +5272,9 @@ # We will need to find libiberty.h and ansidecl.h saved_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include" +CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/libiberty -I${srcdir}/libcpp/include" for ac_func in getenv abort strsignal errno \ - malloc realloc calloc free clock + malloc realloc calloc free clock do ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ac_func is declared" >&5 @@ -5246,7 +5413,7 @@ # then we decode the target machine and forget everything else # that came from the host machine. #for machine in $build $host $target; do -# . ${srcdir}/config.gcc +# . ${srcdir}/config.gcc #done extra_objs="${host_extra_objs} ${extra_objs}" @@ -5285,29 +5452,29 @@ # work to find out the build config parameters. if test x$host = x$build then - build_auto=auto-host.h + build_auto=auto-host.h else - # We create a subdir, then run autoconf in the subdir. - # To prevent recursion we set host and build for the new - # invocation of configure to the build for this invocation - # of configure. - tempdir=build.$$ - rm -rf $tempdir - mkdir $tempdir - cd $tempdir - case ${srcdir} in - /* | A-Za-z:\\/* ) realsrcdir=${srcdir};; - *) realsrcdir=../${srcdir};; - esac - CC=${CC_FOR_BUILD} ${realsrcdir}/configure \ - --target=$target --host=$build --build=$build - - # We just finished tests for the build machine, so rename - # the file auto-build.h in the gcc directory. - mv auto-host.h ../auto-build.h - cd .. - rm -rf $tempdir - build_auto=auto-build.h + # We create a subdir, then run autoconf in the subdir. + # To prevent recursion we set host and build for the new + # invocation of configure to the build for this invocation + # of configure. + tempdir=build.$$ + rm -rf $tempdir + mkdir $tempdir + cd $tempdir + case ${srcdir} in + /* | A-Za-z:\\/* ) realsrcdir=${srcdir};; + *) realsrcdir=../${srcdir};; + esac + CC=${CC_FOR_BUILD} ${realsrcdir}/configure \ + --target=$target --host=$build --build=$build + + # We just finished tests for the build machine, so rename + # the file auto-build.h in the gcc directory. + mv auto-host.h ../auto-build.h + cd .. + rm -rf $tempdir + build_auto=auto-build.h fi tm_file="${tm_file} defaults.h" @@ -5317,14 +5484,14 @@ # Truncate the target if necessary if test x$host_truncate_target != x; then - target=`echo $target | sed -e 's/\(..............\).*/\1/'` + target=`echo $target | sed -e 's/\(..............\).*/\1/'` fi # Get the version trigger filename from the toplevel if test "${with_gcc_version_trigger+set}" = set; then - gcc_version_trigger=$with_gcc_version_trigger + gcc_version_trigger=$with_gcc_version_trigger else - gcc_version_trigger=${srcdir}/version.c + gcc_version_trigger=${srcdir}/version.c fi gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'` gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'` @@ -5364,76 +5531,76 @@ gcc_cv_gas_minor_version= gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas if test -x "$DEFAULT_ASSEMBLER"; then - gcc_cv_as="$DEFAULT_ASSEMBLER" + gcc_cv_as="$DEFAULT_ASSEMBLER" elif test -x "$AS"; then - gcc_cv_as="$AS" + gcc_cv_as="$AS" elif test -x as$host_exeext; then - # Build using assembler in the current directory. - gcc_cv_as=./as$host_exeext + # Build using assembler in the current directory. + gcc_cv_as=./as$host_exeext elif test -f $gcc_cv_as_gas_srcdir/configure.in -a -f ../gas/Makefile; then - # Single tree build which includes gas. - for f in $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in - do - gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f` - if test x$gcc_cv_gas_version != x; then - break - fi - done - gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"` - gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"` + # Single tree build which includes gas. + for f in $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in + do + gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f` + if test x$gcc_cv_gas_version != x; then + break + fi + done + gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"` + gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"` fi if test "x$gcc_cv_as" = x -a x$host = x$target; then - # Native build. - # Search the same directories that the installed compiler will - # search. Else we may find the wrong assembler and lose. If we - # do not find a suitable assembler binary, then try the user's - # path. - # - # Also note we have to check MD_EXEC_PREFIX before checking the - # user's path. Unfortunately, there is no good way to get at the - # value of MD_EXEC_PREFIX here. So we do a brute force search - # through all the known MD_EXEC_PREFIX values. Ugh. This needs - # to be fixed as part of the make/configure rewrite too. - - if test "x$exec_prefix" = xNONE; then - if test "x$prefix" = xNONE; then - test_prefix=/usr/local - else - test_prefix=$prefix - fi - else - test_prefix=$exec_prefix - fi - - # If the loop below does not find an assembler, then use whatever - # one we can find in the users's path. - # user's path. - gcc_cv_as=as$host_exeext - - test_dirs="$test_prefix/lib/gcc-lib/$target/$gcc_version \ - $test_prefix/lib/gcc-lib/$target \ - /usr/lib/gcc/$target/$gcc_version \ - /usr/lib/gcc/$target \ - $test_prefix/$target/bin/$target/$gcc_version \ - $test_prefix/$target/bin \ - /usr/libexec \ - /usr/ccs/gcc \ - /usr/ccs/bin \ - /udk/usr/ccs/bin \ - /bsd43/usr/lib/cmplrs/cc \ - /usr/cross64/usr/bin \ - /usr/lib/cmplrs/cc \ - /sysv/usr/lib/cmplrs/cc \ - /svr4/usr/lib/cmplrs/cc \ - /usr/bin" - - for dir in $test_dirs; do - if test -f $dir/as$host_exeext; then - gcc_cv_as=$dir/as$host_exeext - break; - fi - done + # Native build. + # Search the same directories that the installed compiler will + # search. Else we may find the wrong assembler and lose. If we + # do not find a suitable assembler binary, then try the user's + # path. + # + # Also note we have to check MD_EXEC_PREFIX before checking the + # user's path. Unfortunately, there is no good way to get at the + # value of MD_EXEC_PREFIX here. So we do a brute force search + # through all the known MD_EXEC_PREFIX values. Ugh. This needs + # to be fixed as part of the make/configure rewrite too. + + if test "x$exec_prefix" = xNONE; then + if test "x$prefix" = xNONE; then + test_prefix=/usr/local + else + test_prefix=$prefix + fi + else + test_prefix=$exec_prefix + fi + + # If the loop below does not find an assembler, then use whatever + # one we can find in the users's path. + # user's path. + gcc_cv_as=as$host_exeext + + test_dirs="$test_prefix/lib/gcc-lib/$target/$gcc_version \ + $test_prefix/lib/gcc-lib/$target \ + /usr/lib/gcc/$target/$gcc_version \ + /usr/lib/gcc/$target \ + $test_prefix/$target/bin/$target/$gcc_version \ + $test_prefix/$target/bin \ + /usr/libexec \ + /usr/ccs/gcc \ + /usr/ccs/bin \ + /udk/usr/ccs/bin \ + /bsd43/usr/lib/cmplrs/cc \ + /usr/cross64/usr/bin \ + /usr/lib/cmplrs/cc \ + /sysv/usr/lib/cmplrs/cc \ + /svr4/usr/lib/cmplrs/cc \ + /usr/bin" + + for dir in $test_dirs; do + if test -f $dir/as$host_exeext; then + gcc_cv_as=$dir/as$host_exeext + break; + fi + done fi if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"newly built gas\"" >&5 @@ -5447,10 +5614,10 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking what nm to use" >&5 $as_echo_n "checking what nm to use... " >&6; } if test -x nm$host_exeext; then - gcc_cv_nm=./nm$host_exeext + gcc_cv_nm=./nm$host_exeext elif test x$host = x$target; then - # Native build. - gcc_cv_nm=nm$host_exeext + # Native build. + gcc_cv_nm=nm$host_exeext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_nm" >&5 $as_echo "$gcc_cv_nm" >&6; } @@ -5668,6 +5835,7 @@ + : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files @@ -5965,16 +6133,16 @@ # ... 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'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -6034,28 +6202,16 @@ 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 + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # 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'" @@ -6077,7 +6233,7 @@ # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -6143,10 +6299,10 @@ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.68, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -6235,7 +6391,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' diff -Nru sdcc-3.1.0+dfsg/support/cpp/configure.in sdcc-3.2.0+dfsg/support/cpp/configure.in --- sdcc-3.1.0+dfsg/support/cpp/configure.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/cpp/configure.in 2012-04-06 15:59:24.000000000 +0000 @@ -49,7 +49,7 @@ gnu_ld_flag=yes fi AC_DEFINE_UNQUOTED(DEFAULT_LINKER,"$DEFAULT_LINKER", - [Define to enable the use of a default linker.]) + [Define to enable the use of a default linker.]) fi # With GNU as @@ -68,7 +68,7 @@ gas_flag=yes fi AC_DEFINE_UNQUOTED(DEFAULT_ASSEMBLER,"$DEFAULT_ASSEMBLER", - [Define to enable the use of a default assembler.]) + [Define to enable the use of a default assembler.]) fi # With stabs @@ -88,14 +88,14 @@ AC_ARG_WITH(local-prefix, [ --with-local-prefix=DIR specifies directory to put local include], [case "${withval}" in -yes) AC_MSG_ERROR(bad value ${withval} given for local include directory prefix) ;; -no) ;; -*) local_prefix=$with_local_prefix ;; +yes) AC_MSG_ERROR(bad value ${withval} given for local include directory prefix) ;; +no) ;; +*) local_prefix=$with_local_prefix ;; esac]) # Default local prefix if it is empty if test x$local_prefix = x; then - local_prefix=/usr/local + local_prefix=/usr/local fi AC_ARG_PROGRAM @@ -147,9 +147,9 @@ AC_MSG_CHECKING([whether a default assembler was specified]) if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then if test x"$gas_flag" = x"no"; then - AC_MSG_RESULT([yes ($DEFAULT_ASSEMBLER)]) + AC_MSG_RESULT([yes ($DEFAULT_ASSEMBLER)]) else - AC_MSG_RESULT([yes ($DEFAULT_ASSEMBLER - GNU as)]) + AC_MSG_RESULT([yes ($DEFAULT_ASSEMBLER - GNU as)]) fi else AC_MSG_RESULT(no) @@ -158,9 +158,9 @@ AC_MSG_CHECKING([whether a default linker was specified]) if test x"${DEFAULT_LINKER+set}" = x"set"; then if test x"$gnu_ld_flag" = x"no"; then - AC_MSG_RESULT([yes ($DEFAULT_LINKER)]) + AC_MSG_RESULT([yes ($DEFAULT_LINKER)]) else - AC_MSG_RESULT([yes ($DEFAULT_LINKER - GNU ld)]) + AC_MSG_RESULT([yes ($DEFAULT_LINKER - GNU ld)]) fi else AC_MSG_RESULT(no) @@ -185,15 +185,15 @@ gcc_AC_HEADER_STRING AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h \ - fcntl.h unistd.h sys/file.h sys/time.h \ - sys/param.h sys/stat.h \ - direct.h malloc.h) + fcntl.h unistd.h sys/file.h sys/time.h \ + sys/param.h sys/stat.h \ + direct.h malloc.h) # Check for thread headers. # These tests can't be done till we know if we have limits.h. gcc_AC_C_CHAR_BIT -gcc_AC_C_COMPILE_ENDIAN +AC_C_BIGENDIAN # See if we have the mktemp command. AC_CHECK_PROG(have_mktemp_command, mktemp, yes, no) @@ -216,9 +216,9 @@ # We will need to find libiberty.h and ansidecl.h saved_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include" +CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/libiberty -I${srcdir}/libcpp/include" gcc_AC_CHECK_DECLS(getenv abort strsignal errno \ - malloc realloc calloc free clock, , ,[ + malloc realloc calloc free clock, , ,[ #include "ansidecl.h" #include "system.h"]) @@ -249,7 +249,7 @@ # then we decode the target machine and forget everything else # that came from the host machine. #for machine in $build $host $target; do -# . ${srcdir}/config.gcc +# . ${srcdir}/config.gcc #done extra_objs="${host_extra_objs} ${extra_objs}" @@ -288,29 +288,29 @@ # work to find out the build config parameters. if test x$host = x$build then - build_auto=auto-host.h + build_auto=auto-host.h else - # We create a subdir, then run autoconf in the subdir. - # To prevent recursion we set host and build for the new - # invocation of configure to the build for this invocation - # of configure. - tempdir=build.$$ - rm -rf $tempdir - mkdir $tempdir - cd $tempdir - case ${srcdir} in - /* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};; - *) realsrcdir=../${srcdir};; - esac - CC=${CC_FOR_BUILD} ${realsrcdir}/configure \ - --target=$target --host=$build --build=$build - - # We just finished tests for the build machine, so rename - # the file auto-build.h in the gcc directory. - mv auto-host.h ../auto-build.h - cd .. - rm -rf $tempdir - build_auto=auto-build.h + # We create a subdir, then run autoconf in the subdir. + # To prevent recursion we set host and build for the new + # invocation of configure to the build for this invocation + # of configure. + tempdir=build.$$ + rm -rf $tempdir + mkdir $tempdir + cd $tempdir + case ${srcdir} in + /* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};; + *) realsrcdir=../${srcdir};; + esac + CC=${CC_FOR_BUILD} ${realsrcdir}/configure \ + --target=$target --host=$build --build=$build + + # We just finished tests for the build machine, so rename + # the file auto-build.h in the gcc directory. + mv auto-host.h ../auto-build.h + cd .. + rm -rf $tempdir + build_auto=auto-build.h fi tm_file="${tm_file} defaults.h" @@ -320,14 +320,14 @@ # Truncate the target if necessary if test x$host_truncate_target != x; then - target=`echo $target | sed -e 's/\(..............\).*/\1/'` + target=`echo $target | sed -e 's/\(..............\).*/\1/'` fi # Get the version trigger filename from the toplevel if test "${with_gcc_version_trigger+set}" = set; then - gcc_version_trigger=$with_gcc_version_trigger + gcc_version_trigger=$with_gcc_version_trigger else - gcc_version_trigger=${srcdir}/version.c + gcc_version_trigger=${srcdir}/version.c fi changequote(,)dnl gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'` @@ -339,9 +339,9 @@ PACKAGE=sdcc VERSION="$gcc_version" AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", - [Define to the name of the distribution.]) + [Define to the name of the distribution.]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", - [Define to the version of the distribution.]) + [Define to the version of the distribution.]) AC_SUBST(PACKAGE) AC_SUBST(VERSION) @@ -362,80 +362,80 @@ gcc_cv_gas_minor_version= gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas if test -x "$DEFAULT_ASSEMBLER"; then - gcc_cv_as="$DEFAULT_ASSEMBLER" + gcc_cv_as="$DEFAULT_ASSEMBLER" elif test -x "$AS"; then - gcc_cv_as="$AS" + gcc_cv_as="$AS" elif test -x as$host_exeext; then - # Build using assembler in the current directory. - gcc_cv_as=./as$host_exeext + # Build using assembler in the current directory. + gcc_cv_as=./as$host_exeext elif test -f $gcc_cv_as_gas_srcdir/configure.in -a -f ../gas/Makefile; then - # Single tree build which includes gas. - for f in $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in - do + # Single tree build which includes gas. + for f in $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in + do changequote(,)dnl - gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f` + gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f` changequote([,])dnl - if test x$gcc_cv_gas_version != x; then - break - fi - done + if test x$gcc_cv_gas_version != x; then + break + fi + done changequote(,)dnl - gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"` - gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"` + gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"` + gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"` changequote([,])dnl fi if test "x$gcc_cv_as" = x -a x$host = x$target; then - # Native build. - # Search the same directories that the installed compiler will - # search. Else we may find the wrong assembler and lose. If we - # do not find a suitable assembler binary, then try the user's - # path. - # - # Also note we have to check MD_EXEC_PREFIX before checking the - # user's path. Unfortunately, there is no good way to get at the - # value of MD_EXEC_PREFIX here. So we do a brute force search - # through all the known MD_EXEC_PREFIX values. Ugh. This needs - # to be fixed as part of the make/configure rewrite too. - - if test "x$exec_prefix" = xNONE; then - if test "x$prefix" = xNONE; then - test_prefix=/usr/local - else - test_prefix=$prefix - fi - else - test_prefix=$exec_prefix - fi - - # If the loop below does not find an assembler, then use whatever - # one we can find in the users's path. - # user's path. - gcc_cv_as=as$host_exeext - - test_dirs="$test_prefix/lib/gcc-lib/$target/$gcc_version \ - $test_prefix/lib/gcc-lib/$target \ - /usr/lib/gcc/$target/$gcc_version \ - /usr/lib/gcc/$target \ - $test_prefix/$target/bin/$target/$gcc_version \ - $test_prefix/$target/bin \ - /usr/libexec \ - /usr/ccs/gcc \ - /usr/ccs/bin \ - /udk/usr/ccs/bin \ - /bsd43/usr/lib/cmplrs/cc \ - /usr/cross64/usr/bin \ - /usr/lib/cmplrs/cc \ - /sysv/usr/lib/cmplrs/cc \ - /svr4/usr/lib/cmplrs/cc \ - /usr/bin" - - for dir in $test_dirs; do - if test -f $dir/as$host_exeext; then - gcc_cv_as=$dir/as$host_exeext - break; - fi - done + # Native build. + # Search the same directories that the installed compiler will + # search. Else we may find the wrong assembler and lose. If we + # do not find a suitable assembler binary, then try the user's + # path. + # + # Also note we have to check MD_EXEC_PREFIX before checking the + # user's path. Unfortunately, there is no good way to get at the + # value of MD_EXEC_PREFIX here. So we do a brute force search + # through all the known MD_EXEC_PREFIX values. Ugh. This needs + # to be fixed as part of the make/configure rewrite too. + + if test "x$exec_prefix" = xNONE; then + if test "x$prefix" = xNONE; then + test_prefix=/usr/local + else + test_prefix=$prefix + fi + else + test_prefix=$exec_prefix + fi + + # If the loop below does not find an assembler, then use whatever + # one we can find in the users's path. + # user's path. + gcc_cv_as=as$host_exeext + + test_dirs="$test_prefix/lib/gcc-lib/$target/$gcc_version \ + $test_prefix/lib/gcc-lib/$target \ + /usr/lib/gcc/$target/$gcc_version \ + /usr/lib/gcc/$target \ + $test_prefix/$target/bin/$target/$gcc_version \ + $test_prefix/$target/bin \ + /usr/libexec \ + /usr/ccs/gcc \ + /usr/ccs/bin \ + /udk/usr/ccs/bin \ + /bsd43/usr/lib/cmplrs/cc \ + /usr/cross64/usr/bin \ + /usr/lib/cmplrs/cc \ + /sysv/usr/lib/cmplrs/cc \ + /svr4/usr/lib/cmplrs/cc \ + /usr/bin" + + for dir in $test_dirs; do + if test -f $dir/as$host_exeext; then + gcc_cv_as=$dir/as$host_exeext + break; + fi + done fi if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then AC_MSG_RESULT("newly built gas") @@ -446,10 +446,10 @@ # Figure out what nm we will be using. AC_MSG_CHECKING(what nm to use) if test -x nm$host_exeext; then - gcc_cv_nm=./nm$host_exeext + gcc_cv_nm=./nm$host_exeext elif test x$host = x$target; then - # Native build. - gcc_cv_nm=nm$host_exeext + # Native build. + gcc_cv_nm=nm$host_exeext fi AC_MSG_RESULT($gcc_cv_nm) diff -Nru sdcc-3.1.0+dfsg/support/cpp/libcpp/internal.h sdcc-3.2.0+dfsg/support/cpp/libcpp/internal.h --- sdcc-3.1.0+dfsg/support/cpp/libcpp/internal.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/cpp/libcpp/internal.h 2012-01-26 11:38:07.000000000 +0000 @@ -231,9 +231,7 @@ cpp_hashnode *n_false; /* C++ keyword false */ cpp_hashnode *n__VA_ARGS__; /* C99 vararg macros */ /* SDCC _asm specific */ - cpp_hashnode *n__asm1; /* _asm ... _endasm ; */ cpp_hashnode *n__asm; /* __asm ... __endasm ; */ - cpp_hashnode *n__endasm1; /* _asm ... _endasm ; */ cpp_hashnode *n__endasm; /* __asm ... __endasm ; */ }; diff -Nru sdcc-3.1.0+dfsg/support/cpp/libcpp/lex.c sdcc-3.2.0+dfsg/support/cpp/libcpp/lex.c --- sdcc-3.1.0+dfsg/support/cpp/libcpp/lex.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/cpp/libcpp/lex.c 2012-01-26 11:38:07.000000000 +0000 @@ -98,6 +98,176 @@ buffer->notes_used++; } + +/* Fast path to find line special characters using optimized character + scanning algorithms. Anything complicated falls back to the slow + path below. Since this loop is very hot it's worth doing these kinds + of optimizations. + + One of the paths through the ifdefs should provide + + const uchar *search_line_fast (const uchar *s, const uchar *end); + + Between S and END, search for \n, \r, \\, ?. Return a pointer to + the found character. + + Note that the last character of the buffer is *always* a newline, + as forced by _cpp_convert_input. This fact can be used to avoid + explicitly looking for the end of the buffer. */ + +/* Configure gives us an ifdef test. */ +#ifndef WORDS_BIGENDIAN +#define WORDS_BIGENDIAN 0 +#endif + +/* We'd like the largest integer that fits into a register. There's nothing + in that gives us that. For most hosts this is unsigned long, + but MS decided on an LLP64 model. Thankfully when building with GCC we + can get the "real" word size. */ +#ifdef __GNUC__ +typedef unsigned int word_type __attribute__((__mode__(__word__))); +#else +typedef unsigned long word_type; +#endif + +/* The code below is only expecting sizes 4 or 8. + Die at compile-time if this expectation is violated. */ +typedef char check_word_type_size + [(sizeof(word_type) == 8 || sizeof(word_type) == 4) * 2 - 1]; + +/* Return X with the first N bytes forced to values that won't match one + of the interesting characters. Note that NUL is not interesting. */ + +static inline word_type +acc_char_mask_misalign (word_type val, unsigned int n) +{ + word_type mask = -1; + if (WORDS_BIGENDIAN) + mask >>= n * 8; + else + mask <<= n * 8; + return val & mask; +} + +/* Return X replicated to all byte positions within WORD_TYPE. */ + +static inline word_type +acc_char_replicate (uchar x) +{ + word_type ret; + + ret = (x << 24) | (x << 16) | (x << 8) | x; + if (sizeof(word_type) == 8) + ret = (ret << 16 << 16) | ret; + return ret; +} + +/* Return non-zero if some byte of VAL is (probably) C. */ + +static inline word_type +acc_char_cmp (word_type val, word_type c) +{ +#if defined(__GNUC__) && defined(__alpha__) + /* We can get exact results using a compare-bytes instruction. + Get (val == c) via (0 >= (val ^ c)). */ + return __builtin_alpha_cmpbge (0, val ^ c); +#else + word_type magic = 0x7efefefeU; + if (sizeof(word_type) == 8) + magic = (magic << 16 << 16) | 0xfefefefeU; + magic |= 1; + + val ^= c; + return ((val + magic) ^ ~val) & ~magic; +#endif +} + +/* Given the result of acc_char_cmp is non-zero, return the index of + the found character. If this was a false positive, return -1. */ + +static inline int +acc_char_index (word_type cmp ATTRIBUTE_UNUSED, + word_type val ATTRIBUTE_UNUSED) +{ +#if defined(__GNUC__) && defined(__alpha__) && !WORDS_BIGENDIAN + /* The cmpbge instruction sets *bits* of the result corresponding to + matches in the bytes with no false positives. */ + return __builtin_ctzl (cmp); +#else + unsigned int i; + + /* ??? It would be nice to force unrolling here, + and have all of these constants folded. */ + for (i = 0; i < sizeof(word_type); ++i) + { + uchar c; + if (WORDS_BIGENDIAN) + c = (val >> (sizeof(word_type) - i - 1) * 8) & 0xff; + else + c = (val >> i * 8) & 0xff; + + if (c == '\n' || c == '\r' || c == '\\' || c == '?') + return i; + } + + return -1; +#endif +} + +/* A version of the fast scanner using bit fiddling techniques. + + For 32-bit words, one would normally perform 16 comparisons and + 16 branches. With this algorithm one performs 24 arithmetic + operations and one branch. Whether this is faster with a 32-bit + word size is going to be somewhat system dependent. + + For 64-bit words, we eliminate twice the number of comparisons + and branches without increasing the number of arithmetic operations. + It's almost certainly going to be a win with 64-bit word size. */ + +static const uchar * search_line_acc_char (const uchar *, const uchar *) + ATTRIBUTE_UNUSED; + +static const uchar * +search_line_acc_char (const uchar *s, const uchar *end ATTRIBUTE_UNUSED) +{ + const word_type repl_nl = acc_char_replicate ('\n'); + const word_type repl_cr = acc_char_replicate ('\r'); + const word_type repl_bs = acc_char_replicate ('\\'); + const word_type repl_qm = acc_char_replicate ('?'); + + unsigned int misalign; + const word_type *p; + word_type val, t; + + /* Align the buffer. Mask out any bytes from before the beginning. */ + p = (word_type *)((uintptr_t)s & -sizeof(word_type)); + val = *p; + misalign = (uintptr_t)s & (sizeof(word_type) - 1); + if (misalign) + val = acc_char_mask_misalign (val, misalign); + + /* Main loop. */ + while (1) + { + t = acc_char_cmp (val, repl_nl); + t |= acc_char_cmp (val, repl_cr); + t |= acc_char_cmp (val, repl_bs); + t |= acc_char_cmp (val, repl_qm); + + if (__builtin_expect (t != 0, 0)) + { + int i = acc_char_index (t, val); + if (i >= 0) + return (const uchar *)p + i; + } + + val = *++p; + } +} + +#define search_line_fast search_line_acc_char + /* Returns with a logical line that contains no escaped newlines or trigraphs. This is a time-critical inner loop. */ void @@ -111,82 +281,91 @@ buffer->cur_note = buffer->notes_used = 0; buffer->cur = buffer->line_base = buffer->next_line; buffer->need_line = false; - s = buffer->next_line - 1; + s = buffer->next_line; if (!buffer->from_stage3) { const uchar *pbackslash = NULL; - /* Short circuit for the common case of an un-escaped line with + /* Fast path. This is the common case of an un-escaped line with no trigraphs. The primary win here is by not writing any data back to memory until we have to. */ - for (;;) + while (1) { - c = *++s; - if (__builtin_expect (c == '\n', false) - || __builtin_expect (c == '\r', false)) - { - d = (uchar *) s; - - if (__builtin_expect (s == buffer->rlimit, false)) - goto done; - - /* DOS line ending? */ - if (__builtin_expect (c == '\r', false) - && s[1] == '\n') - { - s++; - if (s == buffer->rlimit) - goto done; - } - - if (__builtin_expect (pbackslash == NULL, true)) - goto done; + /* Perform an optimized search for \n, \r, \\, ?. */ + s = search_line_fast (s, buffer->rlimit); - /* Check for escaped newline. */ - p = d; - while (is_nvspace (p[-1])) - p--; - if (p - 1 != pbackslash) - goto done; - - /* Have an escaped newline; process it and proceed to - the slow path. */ - add_line_note (buffer, p - 1, p != d ? ' ' : '\\'); - d = p - 2; - buffer->next_line = p - 1; - break; + c = *s; + if (c == '\\') + { + /* Record the location of the backslash and continue. */ + pbackslash = s++; } - if (__builtin_expect (c == '\\', false)) - pbackslash = s; - else if (__builtin_expect (c == '?', false) - && __builtin_expect (s[1] == '?', false) - && _cpp_trigraph_map[s[2]]) + else if (__builtin_expect (c == '?', 0)) { - /* Have a trigraph. We may or may not have to convert - it. Add a line note regardless, for -Wtrigraphs. */ - add_line_note (buffer, s, s[2]); - if (CPP_OPTION (pfile, trigraphs)) + if (__builtin_expect (s[1] == '?', false) + && _cpp_trigraph_map[s[2]]) { - /* We do, and that means we have to switch to the - slow path. */ - d = (uchar *) s; - *d = _cpp_trigraph_map[s[2]]; - s += 2; - break; + /* Have a trigraph. We may or may not have to convert + it. Add a line note regardless, for -Wtrigraphs. */ + add_line_note (buffer, s, s[2]); + if (CPP_OPTION (pfile, trigraphs)) + { + /* We do, and that means we have to switch to the + slow path. */ + d = (uchar *) s; + *d = _cpp_trigraph_map[s[2]]; + s += 2; + goto slow_path; + } } + /* Not a trigraph. Continue on fast-path. */ + s++; } + else + break; } + /* This must be \r or \n. We're either done, or we'll be forced + to write back to the buffer and continue on the slow path. */ + d = (uchar *) s; + + if (__builtin_expect (s == buffer->rlimit, false)) + goto done; + + /* DOS line ending? */ + if (__builtin_expect (c == '\r', false) && s[1] == '\n') + { + s++; + if (s == buffer->rlimit) + goto done; + } + + if (__builtin_expect (pbackslash == NULL, true)) + goto done; + + /* Check for escaped newline. */ + p = d; + while (is_nvspace (p[-1])) + p--; + if (p - 1 != pbackslash) + goto done; + + /* Have an escaped newline; process it and proceed to + the slow path. */ + add_line_note (buffer, p - 1, p != d ? ' ' : '\\'); + d = p - 2; + buffer->next_line = p - 1; - for (;;) + slow_path: + while (1) { c = *++s; *++d = c; if (c == '\n' || c == '\r') { - /* Handle DOS line endings. */ + /* Handle DOS line endings. */ if (c == '\r' && s != buffer->rlimit && s[1] == '\n') s++; if (s == buffer->rlimit) @@ -217,9 +396,8 @@ } else { - do + while (*s != '\n' && *s != '\r') s++; - while (*s != '\n' && *s != '\r'); d = (uchar *) s; /* Handle DOS line endings. */ @@ -313,8 +491,8 @@ (int) _cpp_trigraph_map[note->type]); else { - cpp_warning_with_line - (pfile, CPP_W_TRIGRAPHS, + cpp_warning_with_line + (pfile, CPP_W_TRIGRAPHS, pfile->line_table->highest_line, col, "trigraph ??%c ignored, use -trigraphs to enable", note->type); @@ -329,15 +507,15 @@ return ret; } -/* SDCC _asm specific */ -/* Skip an _asm ... _endasm block. We find the end of the comment by - seeing _endasm. Returns non-zero if _asm terminated by EOF, zero +/* SDCC __asm specific */ +/* Skip an __asm ... __endasm block. We find the end of the comment by + seeing __endasm. Returns non-zero if _asm terminated by EOF, zero otherwise. */ static int _sdcpp_skip_asm_block (cpp_reader *pfile) { -#define _ENDASM_STR "endasm" -#define _ENDASM_LEN ((sizeof _ENDASM_STR) - 1) +#define ENDASM_STR "endasm" +#define ENDASM_LEN ((sizeof ENDASM_STR) - 1) cpp_buffer *buffer = pfile->buffer; uchar c = EOF; @@ -348,15 +526,14 @@ prev_space = is_space(c); c = *buffer->cur++; - if (prev_space && c == '_') + if (prev_space && c == '_' && *buffer->cur == '_') { - /* check if it is _endasm or __endasm */ - if (*buffer->cur == '_') - ++buffer->cur; - if (buffer->cur + _ENDASM_LEN <= buffer->rlimit && - strncmp((const char *)buffer->cur, _ENDASM_STR, _ENDASM_LEN) == 0) + /* check if it is __endasm */ + ++buffer->cur; + if (buffer->cur + ENDASM_LEN <= buffer->rlimit && + strncmp((const char *)buffer->cur, ENDASM_STR, ENDASM_LEN) == 0) { - buffer->cur += _ENDASM_LEN; + buffer->cur += ENDASM_LEN; break; } } @@ -503,7 +680,7 @@ /* After parsing an identifier or other sequence, produce a warning about sequences not in NFC/NFKC. */ static void -warn_about_normalization (cpp_reader *pfile, +warn_about_normalization (cpp_reader *pfile, const cpp_token *token, const struct normalize_state *s) { @@ -1200,8 +1377,8 @@ raw_prefix_len) == 0 && cur[raw_prefix_len+1] == '"') { - BUF_APPEND (")", 1); - base++; + BUF_APPEND (")", 1); + base++; cur += raw_prefix_len + 2; goto break_outer_loop; } @@ -1449,14 +1626,14 @@ } /* Append a comment to the end of the comment table. */ -static void -store_comment (cpp_reader *pfile, cpp_token *token) +static void +store_comment (cpp_reader *pfile, cpp_token *token) { int len; if (pfile->comments.allocated == 0) { - pfile->comments.allocated = 256; + pfile->comments.allocated = 256; pfile->comments.entries = (cpp_comment *) xmalloc (pfile->comments.allocated * sizeof (cpp_comment)); } @@ -1472,7 +1649,7 @@ len = token->val.str.len; /* Copy comment. Note, token may not be NULL terminated. */ - pfile->comments.entries[pfile->comments.count].comment = + pfile->comments.entries[pfile->comments.count].comment = (char *) xmalloc (sizeof (char) * (len + 1)); memcpy (pfile->comments.entries[pfile->comments.count].comment, token->val.str.text, len); @@ -1507,7 +1684,7 @@ Note that the only time we encounter a directive here is when we are saving comments in a "#define". */ clen = ((pfile->state.in_directive || pfile->state.parsing_args) - && type == '/') ? len + 2 : len; + && type == '/') ? len + 2 : len; buffer = _cpp_unaligned_alloc (pfile, clen); @@ -1905,21 +2082,21 @@ warn_about_normalization (pfile, result, &nst); } - /* SDCC _asm specific */ - /* handle _asm ... _endasm ; */ - if (result->val.node.node == pfile->spec_nodes.n__asm || result->val.node.node == pfile->spec_nodes.n__asm1) + /* SDCC __asm specific */ + /* handle __asm ... __endasm ; */ + if (result->val.node.node == pfile->spec_nodes.n__asm) { if (CPP_OPTION (pfile, preproc_asm) == 0) { comment_start = buffer->cur; result->type = CPP_ASM; _sdcpp_skip_asm_block (pfile); - /* Save the _asm block as a token in its own right. */ + /* Save the __asm block as a token in its own right. */ _sdcpp_save_asm (pfile, result, comment_start, result->val.node.node == pfile->spec_nodes.n__asm); } result->flags |= ENTER_ASM; } - else if (result->val.node.node == pfile->spec_nodes.n__endasm || result->val.node.node == pfile->spec_nodes.n__endasm1) + else if (result->val.node.node == pfile->spec_nodes.n__endasm) { result->flags |= EXIT_ASM; } @@ -1940,7 +2117,7 @@ /* A potential block or line comment. */ comment_start = buffer->cur; c = *buffer->cur; - + if (c == '*') { if (_cpp_skip_block_comment (pfile)) @@ -1962,7 +2139,7 @@ } if (skip_line_comment (pfile) && CPP_OPTION (pfile, warn_comments)) - cpp_warning (pfile, CPP_W_COMMENTS, "multi-line comment"); + cpp_warning (pfile, CPP_W_COMMENTS, "multi-line comment"); } else if (c == '=') { @@ -2196,21 +2373,21 @@ int ucn_len_c; unsigned t; unsigned long utf32; - + /* Compute the length of the UTF-8 sequence. */ for (t = *name; t & 0x80; t <<= 1) ucn_len++; - + utf32 = *name & (0x7F >> ucn_len); for (ucn_len_c = 1; ucn_len_c < ucn_len; ucn_len_c++) { utf32 = (utf32 << 6) | (*++name & 0x3F); - + /* Ill-formed UTF-8. */ if ((*name & ~0x3F) != 0x80) abort (); } - + *buffer++ = '\\'; *buffer++ = 'U'; for (j = 7; j >= 0; j--) @@ -2267,7 +2444,7 @@ { size_t i; const unsigned char * name = NODE_NAME (token->val.node.node); - + for (i = 0; i < NODE_LEN (token->val.node.node); i++) if (name[i] & ~0x7F) { @@ -2297,7 +2474,7 @@ freed when the reader is destroyed. Useful for diagnostics. */ unsigned char * cpp_token_as_text (cpp_reader *pfile, const cpp_token *token) -{ +{ unsigned int len = cpp_token_len (token) + 1; unsigned char *start = _cpp_unaligned_alloc (pfile, len), *end; @@ -2358,7 +2535,7 @@ { size_t i; const unsigned char * name = NODE_NAME (token->val.node.node); - + for (i = 0; i < NODE_LEN (token->val.node.node); i++) if (name[i] & ~0x7F) { diff -Nru sdcc-3.1.0+dfsg/support/cpp/libiberty/filenames.h sdcc-3.2.0+dfsg/support/cpp/libiberty/filenames.h --- sdcc-3.1.0+dfsg/support/cpp/libiberty/filenames.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/cpp/libiberty/filenames.h 2012-04-04 16:17:23.000000000 +0000 @@ -34,10 +34,18 @@ # ifndef HAVE_DOS_BASED_FILE_SYSTEM # define HAVE_DOS_BASED_FILE_SYSTEM 1 # endif +# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM +# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 +# endif # define HAS_DRIVE_SPEC(f) HAS_DOS_DRIVE_SPEC (f) # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) #else /* not DOSish */ +# if defined(__APPLE__) +# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM +# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 +# endif +# endif /* __APPLE__ */ # define HAS_DRIVE_SPEC(f) (0) # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) # define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f) diff -Nru sdcc-3.1.0+dfsg/support/cpp/libiberty/md5.c sdcc-3.2.0+dfsg/support/cpp/libiberty/md5.c --- sdcc-3.1.0+dfsg/support/cpp/libiberty/md5.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/cpp/libiberty/md5.c 2012-04-04 16:17:23.000000000 +0000 @@ -1,6 +1,6 @@ /* md5.c - Functions to compute MD5 message digest of files or memory blocks according to the definition of MD5 in RFC 1321 from April 1992. - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 2011 Free Software Foundation, Inc. NOTE: This source is derived from an old version taken from the GNU C Library (glibc). @@ -76,15 +76,19 @@ /* Put result from CTX in first 16 bytes following RESBUF. The result must be in little endian byte order. - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32 bits value. */ + IMPORTANT: RESBUF may not be aligned as strongly as MD5_UNIT32 so we + put things in a local (aligned) buffer first, then memcpy into RESBUF. */ void * md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) { - ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A); - ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B); - ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C); - ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D); + md5_uint32 buffer[4]; + + buffer[0] = SWAP (ctx->A); + buffer[1] = SWAP (ctx->B); + buffer[2] = SWAP (ctx->C); + buffer[3] = SWAP (ctx->D); + + memcpy (resbuf, buffer, 16); return resbuf; } @@ -241,9 +245,11 @@ } else #endif - md5_process_block (buffer, len & ~63, ctx); - buffer = (const void *) ((const char *) buffer + (len & ~63)); - len &= 63; + { + md5_process_block (buffer, len & ~63, ctx); + buffer = (const void *) ((const char *) buffer + (len & ~63)); + len &= 63; + } } /* Move remaining bytes in internal buffer. */ diff -Nru sdcc-3.1.0+dfsg/support/cpp/libiberty/obstack.h sdcc-3.2.0+dfsg/support/cpp/libiberty/obstack.h --- sdcc-3.1.0+dfsg/support/cpp/libiberty/obstack.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/cpp/libiberty/obstack.h 2012-04-04 16:17:23.000000000 +0000 @@ -532,9 +532,9 @@ # define obstack_free(h,obj) \ ( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \ (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\ - ? (int) ((h)->next_free = (h)->object_base \ - = (h)->temp + (char *) (h)->chunk) \ - : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0))) + ? (((h)->next_free = (h)->object_base \ + = (h)->temp + (char *) (h)->chunk), 0) \ + : ((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0))) #endif /* not __GNUC__ or not __STDC__ */ diff -Nru sdcc-3.1.0+dfsg/support/cpp/opts.c sdcc-3.2.0+dfsg/support/cpp/opts.c --- sdcc-3.1.0+dfsg/support/cpp/opts.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/cpp/opts.c 2012-03-04 17:39:37.000000000 +0000 @@ -25,6 +25,7 @@ #include "intl.h" #include "opts.h" #include "options.h" +#include "version.h" /* True if we should exit after parsing options. */ bool exit_after_options; @@ -403,6 +404,9 @@ lang_names[i]); print_filtered_help (1U << i); } + + printf (_("\nFor bug reporting instructions, please see:\n")); + printf ("%s.\n", bug_report_url); } /* Print help for a specific front-end, etc. */ diff -Nru sdcc-3.1.0+dfsg/support/cpp/sdcpp.c sdcc-3.2.0+dfsg/support/cpp/sdcpp.c --- sdcc-3.1.0+dfsg/support/cpp/sdcpp.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/cpp/sdcpp.c 2012-03-04 17:39:37.000000000 +0000 @@ -234,9 +234,7 @@ cpp_register_pragma(parse_in, 0, "pedantic_parse_number", do_pragma_pedantic_parse_number, false); /* SDCC _asm specific */ - parse_in->spec_nodes.n__asm1 = cpp_lookup (parse_in, DSC("_asm")); parse_in->spec_nodes.n__asm = cpp_lookup (parse_in, DSC("__asm")); - parse_in->spec_nodes.n__endasm1 = cpp_lookup (parse_in, DSC("_endasm")); parse_in->spec_nodes.n__endasm = cpp_lookup (parse_in, DSC("__endasm")); return ret; @@ -245,11 +243,12 @@ void print_version (FILE *file, const char *indent) { - fprintf (file, _("GNU CPP version %s (cpplib)"), version_string); -#ifdef TARGET_VERSION - TARGET_VERSION; -#endif - fputc ('\n', file); + printf (_("%s %s%s\n"), progname, pkgversion_string, version_string); + printf ("Copyright %s 2011 Free Software Foundation, Inc.\n", + _("(C)")); + fputs (_("This is free software; see the source for copying conditions. There is NO\n" + "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"), + stdout); } /* Initialization of the front end environment, before command line diff -Nru sdcc-3.1.0+dfsg/support/cpp/sdcpp.vcxproj sdcc-3.2.0+dfsg/support/cpp/sdcpp.vcxproj --- sdcc-3.1.0+dfsg/support/cpp/sdcpp.vcxproj 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/cpp/sdcpp.vcxproj 2012-04-04 16:17:23.000000000 +0000 @@ -386,10 +386,12 @@ - copy auto-host_vc_in.h auto-host.h > nul - copy auto-host_vc_in.h auto-host.h > nul + copy %(Identity) auto-host.h > nul + copy %(Identity) auto-host.h > nul auto-host.h;%(Outputs) auto-host.h;%(Outputs) + Generating: auto-host.h + Generating: auto-host.h @@ -424,16 +426,18 @@ Document - gawk -f opt-gather.awk sdcpp.opt > $(TMP)\genopts.tmp + gawk -f opt-gather.awk %(Identity) > $(TMP)\genopts.tmp gawk -f opt-functions.awk -f optc-gen.awk -v header_name="config.h system.h options.h" $(TMP)\genopts.tmp > options.c gawk -f opt-functions.awk -f opth-gen.awk $(TMP)\genopts.tmp > options.h del $(TMP)\genopts.tmp - gawk -f opt-gather.awk sdcpp.opt > $(TMP)\genopts.tmp + gawk -f opt-gather.awk %(Identity) > $(TMP)\genopts.tmp gawk -f opt-functions.awk -f optc-gen.awk -v header_name="config.h system.h options.h" $(TMP)\genopts.tmp > options.c gawk -f opt-functions.awk -f opth-gen.awk $(TMP)\genopts.tmp > options.h del $(TMP)\genopts.tmp options.c;options.h;%(Outputs) options.c;options.h;%(Outputs) + Generating: options.c and options.h + Generating: options.c and options.h diff -Nru sdcc-3.1.0+dfsg/support/cpp/system.h sdcc-3.2.0+dfsg/support/cpp/system.h --- sdcc-3.1.0+dfsg/support/cpp/system.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/cpp/system.h 2012-04-06 15:59:24.000000000 +0000 @@ -1,6 +1,7 @@ /* Get common system includes and various definitions and declarations based on autoconf macros. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, + 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of GCC. @@ -46,6 +47,14 @@ #endif /* Use the unlocked open routines from libiberty. */ + +/* Some of these are #define on some systems, e.g. on AIX to redirect + the names to 64bit capable functions for LARGE_FILES support. These + redefs are pointless here so we can override them. */ + +#undef fopen +#undef freopen + #define fopen(PATH,MODE) fopen_unlocked(PATH,MODE) #define fdopen(FILDES,MODE) fdopen_unlocked(FILDES,MODE) #define freopen(PATH,MODE,STREAM) freopen_unlocked(PATH,MODE,STREAM) @@ -86,6 +95,10 @@ # define fputc(C, Stream) fputc_unlocked (C, Stream) # endif +#ifdef __cplusplus +extern "C" { +#endif + # ifdef HAVE_CLEARERR_UNLOCKED # undef clearerr # define clearerr(Stream) clearerr_unlocked (Stream) @@ -166,6 +179,10 @@ # endif # endif +#ifdef __cplusplus +} +#endif + #endif /* ??? Glibc's fwrite/fread_unlocked macros cause @@ -176,11 +193,7 @@ /* There are an extraordinary number of issues with . The last straw is that it varies with the locale. Use libiberty's replacement instead. */ -#if defined(__APPLE__) && defined(__MACH__) -#include -#else -#include -#endif +#include "safe-ctype.h" #include @@ -190,6 +203,10 @@ extern int errno; #endif +#ifdef __cplusplus +# include +#endif + /* Some of glibc's string inlines cause warnings. Plus we'd rather rely on (and therefore test) GCC's string builtins. */ #define __NO_STRING_INLINES @@ -314,6 +331,9 @@ #ifndef O_WRONLY # define O_WRONLY 1 #endif +#ifndef O_BINARY +# define O_BINARY 0 +#endif /* Some systems define these in, e.g., param.h. We undefine these names here to avoid the warnings. We prefer to use our definitions since we @@ -353,11 +373,40 @@ #define WCOREFLG 0200 #endif +#include +#if !defined (SIGCHLD) && defined (SIGCLD) +# define SIGCHLD SIGCLD +#endif + +#ifdef HAVE_SYS_MMAN_H +# include +#endif + +#ifndef MAP_FAILED +# define MAP_FAILED ((void *)-1) +#endif + +#if !defined (MAP_ANONYMOUS) && defined (MAP_ANON) +# define MAP_ANONYMOUS MAP_ANON +#endif + +#ifdef HAVE_SYS_RESOURCE_H +# include +#endif + +#ifdef HAVE_SYS_TIMES_H +# include +#endif + /* The HAVE_DECL_* macros are three-state, undefined, 0 or 1. If they are defined to 0 then we must provide the relevant declaration here. These checks will be in the undefined state while configure is running so be careful to test "defined (HAVE_DECL_*)". */ +#ifdef __cplusplus +extern "C" { +#endif + #if defined (HAVE_DECL_ATOF) && !HAVE_DECL_ATOF extern double atof (const char *); #endif @@ -398,10 +447,22 @@ extern char *strstr (const char *, const char *); #endif +#if defined (HAVE_DECL_STPCPY) && !HAVE_DECL_STPCPY +extern char *stpcpy (char *, const char *); +#endif + +#ifdef __cplusplus +} +#endif + #ifdef HAVE_MALLOC_H #include #endif +#ifdef __cplusplus +extern "C" { +#endif + #if defined (HAVE_DECL_MALLOC) && !HAVE_DECL_MALLOC extern void *malloc (size_t); #endif @@ -414,16 +475,30 @@ extern void *realloc (void *, size_t); #endif +#ifdef __cplusplus +} +#endif + +#ifdef HAVE_STDINT_H +#include +#endif + +#ifdef HAVE_INTTYPES_H +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + /* If the system doesn't provide strsignal, we get it defined in libiberty but no declaration is supplied. */ -/* Disabled since it causes errors on solaris #if !defined (HAVE_STRSIGNAL) \ || (defined (HAVE_DECL_STRSIGNAL) && !HAVE_DECL_STRSIGNAL) # ifndef strsignal extern const char *strsignal (int); # endif #endif -*/ #ifdef HAVE_GETRLIMIT # if defined (HAVE_DECL_GETRLIMIT) && !HAVE_DECL_GETRLIMIT @@ -455,14 +530,21 @@ extern int vsnprintf(char *, size_t, const char *, va_list); #endif +#ifdef __cplusplus +} +#endif + /* 1 if we have C99 designated initializers. */ #if !defined(HAVE_DESIGNATED_INITIALIZERS) -# if defined(__APPLE__) && (__MACH__) -#define HAVE_DESIGNATED_INITIALIZERS 0 -# else #define HAVE_DESIGNATED_INITIALIZERS \ - ((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L)) -# endif + (((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L)) \ + && !defined(__cplusplus)) +#endif + +#if !defined(HAVE_DESIGNATED_UNION_INITIALIZERS) +#define HAVE_DESIGNATED_UNION_INITIALIZERS \ + (((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L)) \ + && (!defined(__cplusplus) || (GCC_VERSION >= 4007))) #endif #if HAVE_SYS_STAT_H @@ -523,6 +605,15 @@ # define mkdir(a,b) mkdir(a) #endif +#ifndef HAVE_KILL +# define kill(p,s) raise(s) +#endif + +/* Provide a way to print an address via printf. */ +#ifndef HOST_PTR_PRINTF +#define HOST_PTR_PRINTF "%p" +#endif /* ! HOST_PTR_PRINTF */ + /* By default, colon separates directories in a path. */ #ifndef PATH_SEPARATOR #define PATH_SEPARATOR ':' @@ -539,6 +630,11 @@ # endif #endif +#if defined (ENABLE_PLUGIN) && defined (HAVE_DLFCN_H) +/* If plugin support is enabled, we could use libdl. */ +#include +#endif + /* Get libiberty declarations. */ #include "libiberty.h" @@ -559,7 +655,7 @@ #endif #ifndef offsetof -#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER) +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER) #endif /* Various error reporting routines want to use __FUNCTION__. */ @@ -583,16 +679,29 @@ /* Use gcc_assert(EXPR) to test invariants. */ #if ENABLE_ASSERT_CHECKING -#define gcc_assert(EXPR) \ +#define gcc_assert(EXPR) \ ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0)) +#elif (GCC_VERSION >= 4005) +#define gcc_assert(EXPR) \ + ((void)(__builtin_expect(!(EXPR), 0) ? __builtin_unreachable(), 0 : 0)) #else /* Include EXPR, so that unused variable warnings do not occur. */ #define gcc_assert(EXPR) ((void)(0 && (EXPR))) #endif +#ifdef ENABLE_CHECKING +#define gcc_checking_assert(EXPR) gcc_assert (EXPR) +#else +#define gcc_checking_assert(EXPR) ((void)(0 && (EXPR))) +#endif + /* Use gcc_unreachable() to mark unreachable locations (like an unreachable default case of a switch. Do not use gcc_assert(0). */ +#if (GCC_VERSION >= 4005) && !ENABLE_ASSERT_CHECKING +#define gcc_unreachable() __builtin_unreachable() +#else #define gcc_unreachable() (fancy_abort (__FILE__, __LINE__, __FUNCTION__)) +#endif /* Provide a fake boolean type. We make no attempt to use the C99 _Bool, as it may not be available in the bootstrap compiler, @@ -663,101 +772,146 @@ #pragma GCC poison malloc realloc #endif +/* The %m format should be used when GCC's main diagnostic functions + supporting %m are available, and xstrerror from libiberty + otherwise. */ +#undef strerror + #pragma GCC poison strerror + /* Old target macros that have moved to the target hooks structure. */ - #pragma GCC poison ASM_OPEN_PAREN ASM_CLOSE_PAREN \ - FUNCTION_PROLOGUE FUNCTION_EPILOGUE \ - FUNCTION_END_PROLOGUE FUNCTION_BEGIN_EPILOGUE \ - DECL_MACHINE_ATTRIBUTES COMP_TYPE_ATTRIBUTES INSERT_ATTRIBUTES \ - VALID_MACHINE_DECL_ATTRIBUTE VALID_MACHINE_TYPE_ATTRIBUTE \ - SET_DEFAULT_TYPE_ATTRIBUTES SET_DEFAULT_DECL_ATTRIBUTES \ - MERGE_MACHINE_TYPE_ATTRIBUTES MERGE_MACHINE_DECL_ATTRIBUTES \ - MD_INIT_BUILTINS MD_EXPAND_BUILTIN ASM_OUTPUT_CONSTRUCTOR \ - ASM_OUTPUT_DESTRUCTOR SIGNED_CHAR_SPEC MAX_CHAR_TYPE_SIZE \ - WCHAR_UNSIGNED UNIQUE_SECTION SELECT_SECTION SELECT_RTX_SECTION \ - ENCODE_SECTION_INFO STRIP_NAME_ENCODING ASM_GLOBALIZE_LABEL \ - ASM_OUTPUT_MI_THUNK CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS \ + #pragma GCC poison ASM_OPEN_PAREN ASM_CLOSE_PAREN \ + FUNCTION_PROLOGUE FUNCTION_EPILOGUE \ + FUNCTION_END_PROLOGUE FUNCTION_BEGIN_EPILOGUE \ + DECL_MACHINE_ATTRIBUTES COMP_TYPE_ATTRIBUTES INSERT_ATTRIBUTES \ + VALID_MACHINE_DECL_ATTRIBUTE VALID_MACHINE_TYPE_ATTRIBUTE \ + SET_DEFAULT_TYPE_ATTRIBUTES SET_DEFAULT_DECL_ATTRIBUTES \ + MERGE_MACHINE_TYPE_ATTRIBUTES MERGE_MACHINE_DECL_ATTRIBUTES \ + MD_INIT_BUILTINS MD_EXPAND_BUILTIN ASM_OUTPUT_CONSTRUCTOR \ + ASM_OUTPUT_DESTRUCTOR SIGNED_CHAR_SPEC MAX_CHAR_TYPE_SIZE \ + WCHAR_UNSIGNED UNIQUE_SECTION SELECT_SECTION SELECT_RTX_SECTION \ + ENCODE_SECTION_INFO STRIP_NAME_ENCODING ASM_GLOBALIZE_LABEL \ + ASM_OUTPUT_MI_THUNK CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS \ ADDRESS_COST MACHINE_DEPENDENT_REORG ASM_FILE_START ASM_FILE_END \ ASM_SIMPLIFY_DWARF_ADDR INIT_TARGET_OPTABS INIT_SUBTARGET_OPTABS \ INIT_GOFAST_OPTABS MULSI3_LIBCALL MULDI3_LIBCALL DIVSI3_LIBCALL \ - DIVDI3_LIBCALL UDIVSI3_LIBCALL UDIVDI3_LIBCALL MODSI3_LIBCALL \ + DIVDI3_LIBCALL UDIVSI3_LIBCALL UDIVDI3_LIBCALL MODSI3_LIBCALL \ MODDI3_LIBCALL UMODSI3_LIBCALL UMODDI3_LIBCALL BUILD_VA_LIST_TYPE \ - PRETEND_OUTGOING_VARARGS_NAMED STRUCT_VALUE_INCOMING_REGNUM \ - ASM_OUTPUT_SECTION_NAME PROMOTE_FUNCTION_ARGS \ - STRUCT_VALUE_INCOMING STRICT_ARGUMENT_NAMING \ - PROMOTE_FUNCTION_RETURN PROMOTE_PROTOTYPES STRUCT_VALUE_REGNUM \ - SETUP_INCOMING_VARARGS EXPAND_BUILTIN_SAVEREGS \ - DEFAULT_SHORT_ENUMS SPLIT_COMPLEX_ARGS MD_ASM_CLOBBERS \ - HANDLE_PRAGMA_REDEFINE_EXTNAME HANDLE_PRAGMA_EXTERN_PREFIX \ + PRETEND_OUTGOING_VARARGS_NAMED STRUCT_VALUE_INCOMING_REGNUM \ + ASM_OUTPUT_SECTION_NAME PROMOTE_FUNCTION_ARGS PROMOTE_FUNCTION_MODE \ + STRUCT_VALUE_INCOMING STRICT_ARGUMENT_NAMING \ + PROMOTE_FUNCTION_RETURN PROMOTE_PROTOTYPES STRUCT_VALUE_REGNUM \ + SETUP_INCOMING_VARARGS EXPAND_BUILTIN_SAVEREGS \ + DEFAULT_SHORT_ENUMS SPLIT_COMPLEX_ARGS MD_ASM_CLOBBERS \ + HANDLE_PRAGMA_REDEFINE_EXTNAME HANDLE_PRAGMA_EXTERN_PREFIX \ MUST_PASS_IN_STACK FUNCTION_ARG_PASS_BY_REFERENCE \ - VECTOR_MODE_SUPPORTED_P TARGET_SUPPORTS_HIDDEN \ - FUNCTION_ARG_PARTIAL_NREGS ASM_OUTPUT_DWARF_DTPREL \ - ALLOCATE_INITIAL_VALUE + VECTOR_MODE_SUPPORTED_P TARGET_SUPPORTS_HIDDEN \ + FUNCTION_ARG_PARTIAL_NREGS ASM_OUTPUT_DWARF_DTPREL \ + ALLOCATE_INITIAL_VALUE LEGITIMIZE_ADDRESS FRAME_POINTER_REQUIRED \ + CAN_ELIMINATE TRAMPOLINE_TEMPLATE INITIALIZE_TRAMPOLINE \ + TRAMPOLINE_ADJUST_ADDRESS STATIC_CHAIN STATIC_CHAIN_INCOMING \ + RETURN_POPS_ARGS UNITS_PER_SIMD_WORD OVERRIDE_OPTIONS \ + OPTIMIZATION_OPTIONS CLASS_LIKELY_SPILLED_P \ + USING_SJLJ_EXCEPTIONS TARGET_UNWIND_INFO \ + LABEL_ALIGN_MAX_SKIP LOOP_ALIGN_MAX_SKIP \ + LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP JUMP_ALIGN_MAX_SKIP \ + CAN_DEBUG_WITHOUT_FP UNLIKELY_EXECUTED_TEXT_SECTION_NAME \ + HOT_TEXT_SECTION_NAME LEGITIMATE_CONSTANT_P ALWAYS_STRIP_DOTDOT \ + OUTPUT_ADDR_CONST_EXTRA SMALL_REGISTER_CLASSES + +/* Target macros only used for code built for the target, that have + moved to libgcc-tm.h or have never been present elsewhere. */ + #pragma GCC poison DECLARE_LIBRARY_RENAMES LIBGCC2_GNU_PREFIX \ + MD_UNWIND_SUPPORT MD_FROB_UPDATE_CONTEXT ENABLE_EXECUTE_STACK \ + REG_VALUE_IN_UNWIND_CONTEXT ASSUME_EXTENDED_UNWIND_CONTEXT /* Other obsolete target macros, or macros that used to be in target headers and were not used, and may be obsolete or may never have been used. */ - #pragma GCC poison INT_ASM_OP ASM_OUTPUT_EH_REGION_BEG CPP_PREDEFINES \ + #pragma GCC poison INT_ASM_OP ASM_OUTPUT_EH_REGION_BEG CPP_PREDEFINES \ ASM_OUTPUT_EH_REGION_END ASM_OUTPUT_LABELREF_AS_INT SMALL_STACK \ DOESNT_NEED_UNWINDER EH_TABLE_LOOKUP OBJC_SELECTORS_WITHOUT_LABELS \ - OMIT_EH_TABLE EASY_DIV_EXPR IMPLICIT_FIX_EXPR \ - LONGJMP_RESTORE_FROM_STACK MAX_INT_TYPE_SIZE ASM_IDENTIFY_GCC \ - STDC_VALUE TRAMPOLINE_ALIGN ASM_IDENTIFY_GCC_AFTER_SOURCE \ + OMIT_EH_TABLE EASY_DIV_EXPR IMPLICIT_FIX_EXPR \ + LONGJMP_RESTORE_FROM_STACK MAX_INT_TYPE_SIZE ASM_IDENTIFY_GCC \ + STDC_VALUE TRAMPOLINE_ALIGN ASM_IDENTIFY_GCC_AFTER_SOURCE \ SLOW_ZERO_EXTEND SUBREG_REGNO_OFFSET DWARF_LINE_MIN_INSTR_LENGTH \ - TRADITIONAL_RETURN_FLOAT NO_BUILTIN_SIZE_TYPE \ + TRADITIONAL_RETURN_FLOAT NO_BUILTIN_SIZE_TYPE \ NO_BUILTIN_PTRDIFF_TYPE NO_BUILTIN_WCHAR_TYPE NO_BUILTIN_WINT_TYPE \ - BLOCK_PROFILER BLOCK_PROFILER_CODE FUNCTION_BLOCK_PROFILER \ - FUNCTION_BLOCK_PROFILER_EXIT MACHINE_STATE_SAVE \ - MACHINE_STATE_RESTORE SCCS_DIRECTIVE SECTION_ASM_OP BYTEORDER \ - ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL HOST_WORDS_BIG_ENDIAN \ - OBJC_PROLOGUE ALLOCATE_TRAMPOLINE HANDLE_PRAGMA ROUND_TYPE_SIZE \ - ROUND_TYPE_SIZE_UNIT CONST_SECTION_ASM_OP CRT_GET_RFIB_TEXT \ - DBX_LBRAC_FIRST DBX_OUTPUT_ENUM DBX_OUTPUT_SOURCE_FILENAME \ - DBX_WORKING_DIRECTORY INSN_CACHE_DEPTH INSN_CACHE_SIZE \ - INSN_CACHE_LINE_WIDTH INIT_SECTION_PREAMBLE NEED_ATEXIT ON_EXIT \ - EXIT_BODY OBJECT_FORMAT_ROSE MULTIBYTE_CHARS MAP_CHARACTER \ - LIBGCC_NEEDS_DOUBLE FINAL_PRESCAN_LABEL DEFAULT_CALLER_SAVES \ - LOAD_ARGS_REVERSED MAX_INTEGER_COMPUTATION_MODE \ - CONVERT_HARD_REGISTER_TO_SSA_P ASM_OUTPUT_MAIN_SOURCE_FILENAME \ - FIRST_INSN_ADDRESS TEXT_SECTION SHARED_BSS_SECTION_ASM_OP \ - PROMOTED_MODE EXPAND_BUILTIN_VA_END \ - LINKER_DOES_NOT_WORK_WITH_DWARF2 FUNCTION_ARG_KEEP_AS_REFERENCE \ - GIV_SORT_CRITERION MAX_LONG_TYPE_SIZE MAX_LONG_DOUBLE_TYPE_SIZE \ + BLOCK_PROFILER BLOCK_PROFILER_CODE FUNCTION_BLOCK_PROFILER \ + FUNCTION_BLOCK_PROFILER_EXIT MACHINE_STATE_SAVE \ + MACHINE_STATE_RESTORE SCCS_DIRECTIVE SECTION_ASM_OP BYTEORDER \ + ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL HOST_WORDS_BIG_ENDIAN \ + OBJC_PROLOGUE ALLOCATE_TRAMPOLINE HANDLE_PRAGMA ROUND_TYPE_SIZE \ + ROUND_TYPE_SIZE_UNIT CONST_SECTION_ASM_OP CRT_GET_RFIB_TEXT \ + DBX_LBRAC_FIRST DBX_OUTPUT_ENUM DBX_OUTPUT_SOURCE_FILENAME \ + DBX_WORKING_DIRECTORY INSN_CACHE_DEPTH INSN_CACHE_SIZE \ + INSN_CACHE_LINE_WIDTH INIT_SECTION_PREAMBLE NEED_ATEXIT ON_EXIT \ + EXIT_BODY OBJECT_FORMAT_ROSE MULTIBYTE_CHARS MAP_CHARACTER \ + LIBGCC_NEEDS_DOUBLE FINAL_PRESCAN_LABEL DEFAULT_CALLER_SAVES \ + LOAD_ARGS_REVERSED MAX_INTEGER_COMPUTATION_MODE \ + CONVERT_HARD_REGISTER_TO_SSA_P ASM_OUTPUT_MAIN_SOURCE_FILENAME \ + FIRST_INSN_ADDRESS TEXT_SECTION SHARED_BSS_SECTION_ASM_OP \ + PROMOTED_MODE EXPAND_BUILTIN_VA_END \ + LINKER_DOES_NOT_WORK_WITH_DWARF2 FUNCTION_ARG_KEEP_AS_REFERENCE \ + GIV_SORT_CRITERION MAX_LONG_TYPE_SIZE MAX_LONG_DOUBLE_TYPE_SIZE \ MAX_WCHAR_TYPE_SIZE SHARED_SECTION_ASM_OP INTEGRATE_THRESHOLD \ - FINAL_REG_PARM_STACK_SPACE MAYBE_REG_PARM_STACK_SPACE \ - TRADITIONAL_PIPELINE_INTERFACE DFA_PIPELINE_INTERFACE \ - DBX_OUTPUT_STANDARD_TYPES BUILTIN_SETJMP_FRAME_VALUE \ - SUNOS4_SHARED_LIBRARIES PROMOTE_FOR_CALL_ONLY \ - SPACE_AFTER_L_OPTION NO_RECURSIVE_FUNCTION_CSE \ - DEFAULT_MAIN_RETURN TARGET_MEM_FUNCTIONS EXPAND_BUILTIN_VA_ARG \ + FINAL_REG_PARM_STACK_SPACE MAYBE_REG_PARM_STACK_SPACE \ + TRADITIONAL_PIPELINE_INTERFACE DFA_PIPELINE_INTERFACE \ + DBX_OUTPUT_STANDARD_TYPES BUILTIN_SETJMP_FRAME_VALUE \ + SUNOS4_SHARED_LIBRARIES PROMOTE_FOR_CALL_ONLY \ + SPACE_AFTER_L_OPTION NO_RECURSIVE_FUNCTION_CSE \ + DEFAULT_MAIN_RETURN TARGET_MEM_FUNCTIONS EXPAND_BUILTIN_VA_ARG \ COLLECT_PARSE_FLAG DWARF2_GENERATE_TEXT_SECTION_LABEL WINNING_GDB \ - ASM_OUTPUT_FILENAME ASM_OUTPUT_SOURCE_LINE FILE_NAME_JOINER \ - GDB_INV_REF_REGPARM_STABS_LETTER DBX_MEMPARM_STABS_LETTER \ - PUT_SDB_SRC_FILE STABS_GCC_MARKER DBX_OUTPUT_FUNCTION_END \ - DBX_OUTPUT_GCC_MARKER DBX_FINISH_SYMBOL SDB_GENERATE_FAKE \ - NON_SAVING_SETJMP TARGET_LATE_RTL_PROLOGUE_EPILOGUE \ + ASM_OUTPUT_FILENAME ASM_OUTPUT_SOURCE_LINE FILE_NAME_JOINER \ + GDB_INV_REF_REGPARM_STABS_LETTER DBX_MEMPARM_STABS_LETTER \ + PUT_SDB_SRC_FILE STABS_GCC_MARKER DBX_OUTPUT_FUNCTION_END \ + DBX_OUTPUT_GCC_MARKER DBX_FINISH_SYMBOL SDB_GENERATE_FAKE \ + NON_SAVING_SETJMP TARGET_LATE_RTL_PROLOGUE_EPILOGUE \ CASE_DROPS_THROUGH TARGET_BELL TARGET_BS TARGET_CR TARGET_DIGIT0 \ TARGET_ESC TARGET_FF TARGET_NEWLINE TARGET_TAB TARGET_VT \ - LINK_LIBGCC_SPECIAL DONT_ACCESS_GBLS_AFTER_EPILOGUE \ - TARGET_OPTIONS TARGET_SWITCHES EXTRA_CC_MODES FINALIZE_PIC \ - PREDICATE_CODES SPECIAL_MODE_PREDICATES HOST_PTR_PRINTF \ - EXTRA_SECTIONS EXTRA_SECTION_FUNCTIONS READONLY_DATA_SECTION \ + LINK_LIBGCC_SPECIAL DONT_ACCESS_GBLS_AFTER_EPILOGUE \ + TARGET_OPTIONS TARGET_SWITCHES EXTRA_CC_MODES FINALIZE_PIC \ + PREDICATE_CODES SPECIAL_MODE_PREDICATES UNALIGNED_WORD_ASM_OP \ + EXTRA_SECTIONS EXTRA_SECTION_FUNCTIONS READONLY_DATA_SECTION \ TARGET_ASM_EXCEPTION_SECTION TARGET_ASM_EH_FRAME_SECTION \ - SMALL_ARG_MAX ASM_OUTPUT_SHARED_BSS ASM_OUTPUT_SHARED_COMMON \ - ASM_OUTPUT_SHARED_LOCAL UNALIGNED_WORD_ASM_OP \ - ASM_MAKE_LABEL_LINKONCE + SMALL_ARG_MAX ASM_OUTPUT_SHARED_BSS ASM_OUTPUT_SHARED_COMMON \ + ASM_OUTPUT_SHARED_LOCAL ASM_MAKE_LABEL_LINKONCE \ + STACK_CHECK_PROBE_INTERVAL STACK_CHECK_PROBE_LOAD \ + ORDER_REGS_FOR_LOCAL_ALLOC FUNCTION_OUTGOING_VALUE \ + ASM_DECLARE_CONSTANT_NAME MODIFY_TARGET_NAME SWITCHES_NEED_SPACES \ + SWITCH_CURTAILS_COMPILATION SWITCH_TAKES_ARG WORD_SWITCH_TAKES_ARG \ + TARGET_OPTION_TRANSLATE_TABLE HANDLE_PRAGMA_PACK_PUSH_POP \ + HANDLE_SYSV_PRAGMA HANDLE_PRAGMA_WEAK CONDITIONAL_REGISTER_USAGE \ + FUNCTION_ARG_BOUNDARY MUST_USE_SJLJ_EXCEPTIONS US_SOFTWARE_GOFAST \ + USING_SVR4_H SVR4_ASM_SPEC FUNCTION_ARG FUNCTION_ARG_ADVANCE \ + FUNCTION_INCOMING_ARG IRA_COVER_CLASSES TARGET_VERSION \ + MACHINE_TYPE TARGET_HAS_TARGETCM ASM_OUTPUT_BSS \ + SETJMP_VIA_SAVE_AREA FORBIDDEN_INC_DEC_CLASSES \ + PREFERRED_OUTPUT_RELOAD_CLASS SYSTEM_INCLUDE_DIR \ + STANDARD_INCLUDE_DIR STANDARD_INCLUDE_COMPONENT /* Hooks that are no longer used. */ - #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \ + #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \ LANG_HOOKS_MARK_TREE LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES \ LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS \ LANG_HOOKS_PUSHLEVEL LANG_HOOKS_SET_BLOCK \ LANG_HOOKS_MAYBE_BUILD_CLEANUP LANG_HOOKS_UPDATE_DECL_AFTER_SAVING \ - LANG_HOOKS_POPLEVEL LANG_HOOKS_TRUTHVALUE_CONVERSION + LANG_HOOKS_POPLEVEL LANG_HOOKS_TRUTHVALUE_CONVERSION \ + TARGET_PROMOTE_FUNCTION_ARGS TARGET_PROMOTE_FUNCTION_RETURN \ + LANG_HOOKS_MISSING_ARGUMENT LANG_HOOKS_HASH_TYPES \ + TARGET_HANDLE_OFAST TARGET_OPTION_OPTIMIZATION \ + TARGET_IRA_COVER_CLASSES TARGET_HELP + +/* Arrays that were deleted in favor of a functional interface. */ + #pragma GCC poison built_in_decls implicit_built_in_decls + +/* Hooks into libgcc2. */ + #pragma GCC poison LIBGCC2_DOUBLE_TYPE_SIZE LIBGCC2_WORDS_BIG_ENDIAN \ + LIBGCC2_FLOAT_WORDS_BIG_ENDIAN /* Miscellaneous macros that are no longer used. */ - #pragma GCC poison USE_MAPPED_LOCATION + #pragma GCC poison USE_MAPPED_LOCATION GET_ENVIRONMENT - /* Libiberty macros that are no longer used in GCC. */ +/* Libiberty macros that are no longer used in GCC. */ #undef ANSI_PROTOTYPES #undef PTR_CONST #undef LONG_DOUBLE @@ -770,6 +924,12 @@ VA_FIXEDARG VA_CLOSE VA_START #endif /* IN_GCC */ +/* Front ends should never have to include middle-end headers. Enforce + this by poisoning the header double-include protection defines. */ +#ifdef IN_GCC_FRONTEND +#pragma GCC poison GCC_RTL_H GCC_EXCEPT_H GCC_EXPR_H +#endif + /* Note: not all uses of the `index' token (e.g. variable names and structure members) have been eliminated. */ #undef bcopy @@ -796,13 +956,31 @@ change after the fact). Beyond these uses, most other cases of using this macro should be viewed with extreme caution. */ +#ifdef __cplusplus +#define CONST_CAST2(TOTYPE,FROMTYPE,X) (const_cast (X)) +#else #if defined(__GNUC__) && GCC_VERSION > 4000 /* GCC 4.0.x has a bug where it may ICE on this expression, so does GCC 3.4.x (PR17436). */ #define CONST_CAST2(TOTYPE,FROMTYPE,X) ((__extension__(union {FROMTYPE _q; TOTYPE _nq;})(X))._nq) +#elif defined(__GNUC__) +static inline char * +helper_const_non_const_cast (const char *p) +{ + union { + const char *const_c; + char *c; + } val; + val.const_c = p; + return val.c; +} + +#define CONST_CAST2(TOTYPE,FROMTYPE,X) \ + ((TOTYPE) helper_const_non_const_cast ((const char *) (FROMTYPE) (X))) #else #define CONST_CAST2(TOTYPE,FROMTYPE,X) ((TOTYPE)(FROMTYPE)(X)) #endif +#endif #define CONST_CAST(TYPE,X) CONST_CAST2(TYPE, const TYPE, (X)) #define CONST_CAST_TREE(X) CONST_CAST(union tree_node *, (X)) #define CONST_CAST_RTX(X) CONST_CAST(struct rtx_def *, (X)) @@ -844,6 +1022,16 @@ #define VALGRIND_FREELIKE_BLOCK(x,y) #endif +/* In LTO -fwhole-program build we still want to keep the debug functions available + for debugger. Mark them as used to prevent removal. */ +#if (GCC_VERSION > 4000) +#define DEBUG_FUNCTION __attribute__ ((__used__)) +#define DEBUG_VARIABLE __attribute__ ((__used__)) +#else +#define DEBUG_FUNCTION +#define DEBUG_VARIABLE +#endif + /* SDCC specific */ #include "sdcpp.h" diff -Nru sdcc-3.1.0+dfsg/support/cpp/version.c sdcc-3.2.0+dfsg/support/cpp/version.c --- sdcc-3.1.0+dfsg/support/cpp/version.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/cpp/version.c 2012-03-04 17:39:37.000000000 +0000 @@ -1,3 +1,22 @@ +/* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2007 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC 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. + +GCC 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 GCC; see the file COPYING3. If not see +. */ + #include "version.h" /* This is the trailing component of the string reported as the @@ -8,21 +27,24 @@ in parentheses. You may also wish to include a number indicating the revision of your modified compiler. */ -#define BASEVER "4.6.1" +#define BASEVER "4.6.3" #define DATESTAMP #define DEVPHASE -#define VERSUFFIX " + SDCC" +#define VERSUFFIX " (GNU cpp adapted for SDCC)" +#define PKGVERSION "(SDCC) " /* This is the location of the online document giving instructions for reporting bugs. If you distribute a modified version of GCC, - please change this to refer to a document giving instructions for - reporting bugs to you, not us. (You are of course welcome to - forward us bugs reported to you, if you determine that they are - not bugs in your modifications.) */ + please configure with --with-bugurl pointing to a document giving + instructions for reporting bugs to you, not us. (You are of course + welcome to forward us bugs reported to you, if you determine that + they are not bugs in your modifications.) */ -const char bug_report_url[] = ""; +const char bug_report_url[] = ""; /* The complete version string, assembled from several pieces. - BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */ + BASEVER, DATESTAMP, DEVPHASE, and REVISION are defined by the + Makefile. */ const char version_string[] = BASEVER DATESTAMP DEVPHASE VERSUFFIX; +const char pkgversion_string[] = PKGVERSION; \ No newline at end of file diff -Nru sdcc-3.1.0+dfsg/support/cpp/version.h sdcc-3.2.0+dfsg/support/cpp/version.h --- sdcc-3.1.0+dfsg/support/cpp/version.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/cpp/version.h 2012-03-04 17:39:37.000000000 +0000 @@ -1,5 +1,6 @@ #ifndef GCC_VERSION_H #define GCC_VERSION_H extern const char version_string[]; +extern const char pkgversion_string[]; extern const char bug_report_url[]; #endif /* ! GCC_VERSION_H */ diff -Nru sdcc-3.1.0+dfsg/support/librarian/sdcclib.c sdcc-3.2.0+dfsg/support/librarian/sdcclib.c --- sdcc-3.1.0+dfsg/support/librarian/sdcclib.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/librarian/sdcclib.c 2012-04-26 14:14:27.000000000 +0000 @@ -24,12 +24,11 @@ #include #endif -char ProgName[PATH_MAX]; -char LibName[PATH_MAX]; -char LibNameTmp[PATH_MAX]; -char IndexName[PATH_MAX]; -char AdbName[PATH_MAX]; -char ListName[PATH_MAX]; +char ProgName[FILENAME_MAX]; +char LibName[FILENAME_MAX]; +char LibNameTmp[FILENAME_MAX]; +char IndexName[FILENAME_MAX]; +char ListName[FILENAME_MAX]; char **RelName; int NumRelFiles=0; @@ -183,6 +182,11 @@ else { cont_par++; + if(strlen(LibName) > FILENAME_MAX - 1) + { + printf("ERROR: Library name too long.\n"); + exit(2); + } strcpy(LibName, argv[j]); } break; @@ -200,13 +204,12 @@ printf("ERROR: Insufficient memory.\n"); exit(2); } - RelName[0]=(char *)malloc(PATH_MAX); + RelName[0]=strdup(argv[j]); if(RelName[0]==NULL) { printf("ERROR: Insufficient memory.\n"); exit(2); } - strcpy(RelName[0], argv[j]); } break; @@ -219,13 +222,12 @@ printf("ERROR: Insufficient memory.\n"); exit(2); } - RelName[NumRelFiles-1]=(char *)malloc(PATH_MAX); + RelName[NumRelFiles-1]=strdup(argv[j]); if(RelName[NumRelFiles-1]==NULL) { printf("ERROR: Insufficient memory.\n"); exit(2); } - strcpy(RelName[NumRelFiles-1], argv[j]); break; } } @@ -251,6 +253,7 @@ char symname[MAXLINE+1]; char c; int IsDOSStyle=0; + char *AdbName = 0; strcpy(LibNameTmp, LibName); ChangeExtension(LibNameTmp, "__L"); @@ -258,7 +261,7 @@ strcpy(IndexName, LibName); ChangeExtension(IndexName, "__I"); - strcpy(AdbName, RelName); + AdbName = strdup (RelName); ChangeExtension(AdbName, "adb"); lib=fopen(LibName, "r"); @@ -270,6 +273,7 @@ { printf("ERROR: Couldn't open file '%s'\n", RelName); if(lib!=NULL) fclose(lib); + free(AdbName); return; } } @@ -281,6 +285,7 @@ printf("ERROR: Couldn't create temporary file '%s'\n", LibNameTmp); if(lib!=NULL) fclose(lib); fclose(rel); + free(AdbName); return; } fprintf(newlib, "\n\n"); @@ -292,6 +297,7 @@ if(lib!=NULL) fclose(lib); fclose(newlib); fclose(rel); + free(AdbName); return; } @@ -437,19 +443,23 @@ remove(LibNameTmp); remove(IndexName); + + free(AdbName); } void ExtractRel(char * RelName) { int state=0; + char *AdbName = 0; - strcpy(AdbName, RelName); + AdbName = strdup(RelName); ChangeExtension(AdbName, "adb"); lib=fopen(LibName, "r"); if(lib==NULL) { printf("ERROR: Couldn't open file '%s'\n", LibName); + free(AdbName); return; } @@ -458,6 +468,7 @@ { printf("ERROR: Couldn't create file '%s'\n", RelName); fclose(lib); + free(AdbName); return; } GetNameFromPath(RelName, ModName); @@ -468,6 +479,7 @@ printf("ERROR: Couldn't create file '%s'\n", AdbName); fclose(lib); fclose(rel); + free(AdbName); return; } @@ -515,6 +527,8 @@ fclose(rel); fclose(lib); fclose(adb); + + free(AdbName); } void DumpSymbols(void) @@ -604,8 +618,8 @@ char *cc; char *as; char CmdLine[1024]; - char SrcName[PATH_MAX]; - char RelName[PATH_MAX]; + char SrcName[FILENAME_MAX]; + char RelName[FILENAME_MAX]; list=fopen(ListName, "r"); if(list==NULL) @@ -621,7 +635,7 @@ while(!feof(list)) { RelName[0]=0; - if (fgets(RelName, PATH_MAX, list) == NULL) + if (fgets(RelName, FILENAME_MAX, list) == NULL) break; CleanLine(RelName); if(strlen(RelName)>0) //Skip empty lines @@ -707,3 +721,4 @@ } return 0; //Success!!! } + diff -Nru sdcc-3.1.0+dfsg/support/makebin/makebin.c sdcc-3.2.0+dfsg/support/makebin/makebin.c --- sdcc-3.1.0+dfsg/support/makebin/makebin.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/makebin/makebin.c 2012-03-24 22:04:34.000000000 +0000 @@ -3,6 +3,7 @@ Copyright (c) 2000 Michael Hope Copyright (c) 2010 Borut Razem + Copyright (c) 2012 Noel Lemouel This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -112,6 +113,21 @@ gb_postproc (BYTE * rom, int size, int *real_size, struct gb_opt_s *o) { int i, chk; + static const BYTE gb_logo[] = + { + 0xce, 0xed, 0x66, 0x66, 0xcc, 0x0d, 0x00, 0x0b, + 0x03, 0x73, 0x00, 0x83, 0x00, 0x0c, 0x00, 0x0d, + 0x00, 0x08, 0x11, 0x1f, 0x88, 0x89, 0x00, 0x0e, + 0xdc, 0xcc, 0x6e, 0xe6, 0xdd, 0xdd, 0xd9, 0x99, + 0xbb, 0xbb, 0x67, 0x63, 0x6e, 0x0e, 0xec, 0xcc, + 0xdd, 0xdc, 0x99, 0x9f, 0xbb, 0xb9, 0x33, 0x3e + }; + + /* $0104-$0133: Nintendo logo + * If missing, an actual Game Boy won't run the ROM. + */ + + memcpy (&rom[0x104], gb_logo, sizeof (gb_logo)); /* * 0134-0142: Title of the game in UPPER CASE ASCII. If it diff -Nru sdcc-3.1.0+dfsg/support/packihx/configure sdcc-3.2.0+dfsg/support/packihx/configure --- sdcc-3.1.0+dfsg/support/packihx/configure 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/packihx/configure 2012-05-18 10:47:44.000000000 +0000 @@ -1,11 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68. +# Generated by GNU Autoconf 2.69. # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -134,6 +132,31 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -167,7 +190,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -212,21 +236,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -328,6 +356,14 @@ } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -449,6 +485,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # 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). @@ -483,16 +523,16 @@ # ... 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'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -504,28 +544,8 @@ 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 +as_test_x='test -x' +as_executable_p=as_fn_executable_p # 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'" @@ -1117,8 +1137,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_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 @@ -1344,9 +1362,9 @@ if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.68 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1454,7 +1472,8 @@ main () { static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1470,7 +1489,8 @@ main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1496,7 +1516,8 @@ main () { static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1512,7 +1533,8 @@ main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1546,7 +1568,8 @@ main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1687,7 +1710,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2060,7 +2083,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2100,7 +2123,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2153,7 +2176,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2194,7 +2217,7 @@ 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 as_fn_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 @@ -2252,7 +2275,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2296,7 +2319,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2742,8 +2765,7 @@ /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* 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); @@ -2984,7 +3006,7 @@ 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 + as_fn_executable_p "$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 @@ -3050,7 +3072,7 @@ 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 + as_fn_executable_p "$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 @@ -3860,16 +3882,16 @@ # ... 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'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -3929,28 +3951,16 @@ 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 + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # 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'" @@ -3972,7 +3982,7 @@ # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -4034,10 +4044,10 @@ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.68, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -4125,7 +4135,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' diff -Nru sdcc-3.1.0+dfsg/support/regression/Makefile.in sdcc-3.2.0+dfsg/support/regression/Makefile.in --- sdcc-3.1.0+dfsg/support/regression/Makefile.in 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/Makefile.in 2012-05-21 12:06:27.000000000 +0000 @@ -20,7 +20,7 @@ # o Provides the emulators # * The gbdk-lib package from gbdk. # o cvs -d cvs.gbdk.sourceforge.net:/cvsroot/gbdk co gbdk-lib -# o Proviles mul, div, and include files for the z80 tests. +# o Provides mul, div, and include files for the z80 tests. # * python 1.5 or above # * uCsim for the mcs51 port # @@ -68,7 +68,7 @@ # Each directory under ports/ is used as a port name. Each port is tested. # Each port must have a spec.mk which describes how to build the object # files and how to run the emulator. -ALL_PORTS = $(filter-out .svn xa51 z80 gbz80 pic16 pic14 mcs51-common,$(notdir $(wildcard $(PORTS_DIR)/*))) +ALL_PORTS = $(filter-out .svn xa51 rrz80 rrgbz80 pic16 pic14 mcs51-common,$(notdir $(wildcard $(PORTS_DIR)/*))) # These ports will be cleaned with 'make clean' CLEAN_PORTS = $(filter-out .svn mcs51-common,$(notdir $(wildcard $(PORTS_DIR)/*))) @@ -82,74 +82,111 @@ # Test all of the ports test-ports: + $(MAKE) test-common for i in $(ALL_PORTS); do $(MAKE) make_library test-port PORT=$$i; done -# Helper rule for testing the z80 port only -test-z80: - $(MAKE) test-port PORT=z80 - -# Helper rule for testing the z80 port only -test-gbz80: - $(MAKE) test-port PORT=gbz80 +# Helper rule for testing the z80 port only (use rrz80 simulator) +test-rrz80: + $(MAKE) test-common + $(MAKE) test-port PORT=rrz80 + +# Helper rule for testing the z80 port only (use rrgb simulator) +test-rrgbz80: + $(MAKE) test-common + $(MAKE) test-port PORT=rrgbz80 # Helper rule for testing the mcs51 port only test-mcs51: test-mcs51-small test-mcs51-medium test-mcs51-large test-mcs51-huge test-mcs51-stack-auto test-mcs51-xstack-auto test-mcs51-small: + $(MAKE) test-common $(MAKE) test-port PORT=mcs51-small test-mcs51-medium: + $(MAKE) test-common $(MAKE) test-port PORT=mcs51-medium test-mcs51-large: + $(MAKE) test-common $(MAKE) test-port PORT=mcs51-large test-mcs51-huge: + $(MAKE) test-common $(MAKE) make_library test-port PORT=mcs51-huge test-mcs51-stack-auto: + $(MAKE) test-common $(MAKE) test-port PORT=mcs51-stack-auto test-mcs51-xstack-auto: + $(MAKE) test-common $(MAKE) make_library test-port PORT=mcs51-xstack-auto # Helper rule for testing the ds390 port only test-ds390: + $(MAKE) test-common $(MAKE) test-port PORT=ds390 +# Helper rule for testing the z80 related ports only +test-z80: test-ucz80 test-ucz180 test-ucgbz80 test-ucr2k test-ucr3ka + # Helper rule for testing the z80 port only(use ucSim simulator) test-ucz80: + $(MAKE) test-common $(MAKE) test-port PORT=ucz80 # Helper rule for testing the z180 port only(use ucSim simulator) test-ucz180: + $(MAKE) test-common $(MAKE) test-port PORT=ucz180 +# Helper rule for testing the gb/lr35902 port only(use ucSim simulator) +test-ucgbz80: + $(MAKE) test-common + $(MAKE) test-port PORT=ucgbz80 + # Helper rule for testing the r2k port only(use ucSim simulator) test-ucr2k: + $(MAKE) test-common $(MAKE) test-port PORT=ucr2k +# Helper rule for testing the r3k port only(use ucSim simulator) +test-ucr3ka: + $(MAKE) test-common + $(MAKE) test-port PORT=ucr3ka + # Helper rule for testing the hc08 port only(use ucSim simulator) test-hc08: + $(MAKE) test-common $(MAKE) test-port PORT=hc08 +# Helper rule for testing the s08 port only(use ucSim simulator) +test-s08: + $(MAKE) test-common + $(MAKE) test-port PORT=s08 + # Helper rule for testing the xa51 port only(use ucSim simulator) test-xa51: + $(MAKE) test-common $(MAKE) test-port PORT=xa51 # Helper rule for testing the pic16 port only(use gpsim simulator) test-pic16: + $(MAKE) test-common $(MAKE) test-port PORT=pic16 # Helper rule for testing the pic14 port only(use gpsim simulator) test-pic14: + $(MAKE) test-common $(MAKE) test-port PORT=pic14 ### Helper rule for testing the host cc only test-host: + $(MAKE) test-common $(MAKE) test-port PORT=host test-host2: + $(MAKE) test-common $(MAKE) test-port PORT=host # Begin per-port rules @@ -184,6 +221,8 @@ # Currently unused. Extension to append to intermediate directories. DIREXT = +CC_FOR_BUILD = $(CC) + # Only include if we're in a per-port call. ifdef PORT # include ./$(PORT)/spec.mk if exists, else include $(PORTS_DIR)/$(PORT)/spec.mk @@ -205,11 +244,17 @@ # disk space is free. .PRECIOUS: $(PORT_CASES_DIR)/% %$(OBJEXT) %$(EXEEXT) %$(BINEXT) -$(CASES_DIR): - mkdir -p $@ +# $(CASES_DIR)/stamp is really a proxy for $(CASES_DIR). We shouldn't use +# $(CASES_DIR) as a dependency directly, because as a directory its time +# stamp updates every time something in the directory is updated (which +# can then cause spurious rebuilds of other targets that can conflict +# with parallel make jobs) +$(CASES_DIR)/stamp: + mkdir -p $(CASES_DIR) + touch $@ # Rule to generate .c files from .m4 files -$(CASES_DIR)/%.c: $(TESTS_DIR)/%.m4 +$(CASES_DIR)/%.c: $(TESTS_DIR)/%.m4 $(CASES_DIR)/stamp m4 -I $(srcdir)/m4include rtmacros.m4 $< > $@ # Rule to generate the iterations of a test suite off the source suite. @@ -227,16 +272,23 @@ # Rule to summarise the results for one port after all of the tests # have been run. -port-results: port-dirs $(PORT_RESULTS) - echo Summary for \'$(PORT)\': `cat $(PORT_RESULTS) | python $(srcdir)/collate-results.py` - echo +port-results: $(PORT_RESULTS) + cat $(PORT_RESULTS) | python $(srcdir)/collate-results.py $(PORT) + +port-fwklib: $(EXTRAS) $(FWKLIB) port-dirs: mkdir -p $(PORT_CASES_DIR) $(PORT_RESULTS_DIR) echo Running $(PORT) regression tests -test-port: $(CASES_DIR) $(M_CASES) +# Files shared between all ports need to be built by the test-common target, +# which should always be built before the port specific targets. +test-common: $(CASES_DIR)/stamp $(M_CASES) $(CASES_DIR)/timeout + +test-port: # recurse: force vpath to re-read the $(CASES_DIR) + $(MAKE) port-dirs PORT=$(PORT) + $(MAKE) port-fwklib PORT=$(PORT) $(MAKE) port-results PORT=$(PORT) # Begin rules that process each iteration generated from the source @@ -255,6 +307,9 @@ $(RESULTS): $(SUB_RESULTS) cat $(SUB_RESULTS) > $@ +$(CASES_DIR)/timeout: $(srcdir)/fwk/lib/timeout.c $(CASES_DIR)/stamp + $(CC_FOR_BUILD) $(CFLAGS) $< -o $@ + # The remainder of the rules are in $PORT/spec.mk. The port needs to # be able to turn an iterated test suite into a sub result, normally # by: diff -Nru sdcc-3.1.0+dfsg/support/regression/collate-results.py sdcc-3.2.0+dfsg/support/regression/collate-results.py --- sdcc-3.1.0+dfsg/support/regression/collate-results.py 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/collate-results.py 2012-04-09 22:14:34.000000000 +0000 @@ -15,6 +15,7 @@ bytes = 0 ticks = 0 invalid = 0 +messagelog = [] # hack for valdiag name = "" @@ -39,7 +40,7 @@ tests = tests + string.atof(ntests) cases = cases + string.atof(ncases) if (string.atof(nfailures)): - print "Failure: %s" % name + messagelog.append("Failure: %s" % name) # '--- Simulator: b/t: ...', where b = # bytes, t = # ticks if (re.search(r'^--- Simulator:', line)): @@ -50,9 +51,14 @@ # Stop at 0x000228: (106) Invalid instruction 0x00fd if (re.search(r'Invalid instruction', line)): - invalid += 1; - print "Invalid instruction: %s" % name + invalid += 1 + messagelog.append("Invalid instruction: %s" % name) +if (len(sys.argv) > 1): + print "Summary for '%s':" % sys.argv[1], if (invalid > 0): print "%d invalid instructions," % invalid, print "%.0f failures, %.0f tests, %.0f test cases, %.0f bytes, %.0f ticks" % (failures, tests, cases, bytes, ticks) +for msg in messagelog: + print " ",msg +print diff -Nru sdcc-3.1.0+dfsg/support/regression/compact-results.py sdcc-3.2.0+dfsg/support/regression/compact-results.py --- sdcc-3.1.0+dfsg/support/regression/compact-results.py 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/compact-results.py 2012-05-13 10:47:19.000000000 +0000 @@ -26,10 +26,10 @@ if (m): name = m.group(1) - # in case the test program crashes before the "--- Running" message - m = re.match(r'^[0-9]+ words read from (.*)\.ihx$',line) - if (m): - name = m.group(1) + # in case the test program crashes before the "--- Running" message + m = re.match(r'^[0-9]+ words read from (.*)\.ihx$',line) + if (m): + name = m.group(1) base = name m = re.match(r'([^/]*)/([^/]*)/([^/]*)/(.*)$', name) @@ -59,8 +59,8 @@ invalid += 1; print "Invalid instruction: %s" % name -print "%-20.20s" % base, +print "%-35.35s" % base, if (invalid > 0): print "%d invalid instructions," % invalid, -print "(f: %.0f, t: %.0f, c: %.0f, b: %.0f, t: %.0f)" % (failures, tests, cases, bytes, ticks) +print "(f: %2.0f, t: %3.0f, c: %2.0f, b: %6.0f, t: %8.0f)" % (failures, tests, cases, bytes, ticks) diff -Nru sdcc-3.1.0+dfsg/support/regression/fwk/include/testfwk.h sdcc-3.2.0+dfsg/support/regression/fwk/include/testfwk.h --- sdcc-3.1.0+dfsg/support/regression/fwk/include/testfwk.h 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/fwk/include/testfwk.h 2012-05-21 02:54:59.000000000 +0000 @@ -11,14 +11,14 @@ #define LOG(_a) /* hollow log */ #endif -#ifdef SDCC +#ifdef __SDCC #include #else #define _AUTOMEM #define _STATMEM #endif -#if defined(PORT_HOST) || defined(SDCC_z80) || defined(SDCC_z180) || defined(SDCC_r2k)|| defined(SDCC_gbz80) +#if defined(PORT_HOST) || defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_r2k) || defined(__SDCC_r3ka) || defined(__SDCC_gbz80) # define __data # define __idata # define __pdata @@ -26,16 +26,19 @@ # define __code # define __near # define __far -# define __at(x) # define __reentrant #endif -#if defined(SDCC_hc08) +#if defined(PORT_HOST) +# define __at(x) +#endif + +#if defined(__SDCC_hc08) || defined(__SDCC_s08) # define __idata __data # define __pdata __data #endif -#if defined(SDCC_pic16) +#if defined(__SDCC_pic16) # define __idata __data # define __xdata __data # define __pdata __data diff -Nru sdcc-3.1.0+dfsg/support/regression/fwk/lib/extern1.c sdcc-3.2.0+dfsg/support/regression/fwk/lib/extern1.c --- sdcc-3.1.0+dfsg/support/regression/fwk/lib/extern1.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/fwk/lib/extern1.c 2012-02-22 14:45:17.000000000 +0000 @@ -1,6 +1,6 @@ /* needed by tests/inline.c */ -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/fwk/lib/extern2.c sdcc-3.2.0+dfsg/support/regression/fwk/lib/extern2.c --- sdcc-3.1.0+dfsg/support/regression/fwk/lib/extern2.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/fwk/lib/extern2.c 2012-02-22 14:45:17.000000000 +0000 @@ -1,6 +1,6 @@ /* needed by tests/inline.c */ -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/fwk/lib/testfwk.c sdcc-3.2.0+dfsg/support/regression/fwk/lib/testfwk.c --- sdcc-3.1.0+dfsg/support/regression/fwk/lib/testfwk.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/fwk/lib/testfwk.c 2012-02-22 14:45:17.000000000 +0000 @@ -5,11 +5,11 @@ #include #endif -#ifdef SDCC_ds390 +#ifdef __SDCC_ds390 #include /* main() must see the ISR declarations */ #endif -#ifdef SDCC_mcs51 +#ifdef __SDCC_mcs51 /* until changed, isr's must have a prototype in the module containing main */ void T2_isr (void) __interrupt 5; #define MEMSPACE_BUF __idata diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/ds390/spec.mk sdcc-3.2.0+dfsg/support/regression/ports/ds390/spec.mk --- sdcc-3.1.0+dfsg/support/regression/ports/ds390/spec.mk 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/ds390/spec.mk 2012-05-07 17:21:45.000000000 +0000 @@ -4,6 +4,9 @@ CC_FOR_BUILD = $(CC) +# simulation timeout in seconds +SIM_TIMEOUT = 60 + # path to uCsim ifdef SDCC_BIN_PATH S51 = $(SDCC_BIN_PATH)/s51$(EXEEXT) @@ -56,15 +59,13 @@ $(PORT_CASES_DIR)/fwk.lib: $(srcdir)/fwk/lib/fwk.lib cat < $(srcdir)/fwk/lib/fwk.lib > $@ -# run simulator with 25 seconds timeout +# run simulator with SIM_TIMEOUT seconds timeout %.out: %$(BINEXT) $(CASES_DIR)/timeout mkdir -p $(dir $@) - -$(CASES_DIR)/timeout 25 $(EMU) -tds390 -S in=$(DEV_NULL),out=$@ $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $(@:.out=.sim) \ + -$(CASES_DIR)/timeout $(SIM_TIMEOUT) $(EMU) -tds390 -S in=$(DEV_NULL),out=$@ $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $(@:.out=.sim) \ || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(BINEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@ python $(srcdir)/get_ticks.py < $(@:.out=.sim) >> $@ -grep -n FAIL $@ /dev/null || true -$(CASES_DIR)/timeout: $(srcdir)/fwk/lib/timeout.c - $(CC_FOR_BUILD) $(CFLAGS) $< -o $@ _clean: diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/gbz80/spec.mk sdcc-3.2.0+dfsg/support/regression/ports/gbz80/spec.mk --- sdcc-3.1.0+dfsg/support/regression/ports/gbz80/spec.mk 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/gbz80/spec.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -# Regression test specification for the gbz80 target. - -EMU = $(SDCC_EXTRA_DIR)/emu/rrgb/rrgb$(EXEEXT) -MAKEBIN = $(top_builddir)/bin/makebin$(EXEEXT) - -SDCCFLAGS += --nostdinc -I$(top_srcdir) -LINKFLAGS += --nostdlib -L$(top_builddir)/device/lib/build/gbz80 - -SDCCFLAGS += -mgbz80 --less-pedantic -DREENTRANT= -LINKFLAGS += --out-fmt-ihx gbz80.lib - -OBJEXT = .rel -BINEXT = .gb - -# otherwise `make` deletes testfwk.rel and `make -j` will fail -.PRECIOUS: $(PORT_CASES_DIR)/%$(OBJEXT) - -# Needs parts of gbdk-lib, namely the internal mul/div/mod functions. -EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT) -include $(srcdir)/fwk/lib/spec.mk - -# Rule to convert .ihx to .gb -%$(BINEXT): %.ihx - $(MAKEBIN) -Z -yn ABS $< $@ - -# Rule to link into .ihx -%.ihx: %$(OBJEXT) $(EXTRAS) $(FWKLIB) $(PORT_CASES_DIR)/fwk.lib - $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) $(EXTRAS) $(PORT_CASES_DIR)/fwk.lib $< -o $@ - -$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.asm - @# TODO: sdas should place it\'s output in the current dir - cp $< $(PORT_CASES_DIR) - $(top_builddir)/bin/sdasgb -plosgff $(PORT_CASES_DIR)/$(notdir $<) - rm $(PORT_CASES_DIR)/$(notdir $<) - -%$(OBJEXT): %.c - $(SDCC) $(SDCCFLAGS) -c $< -o $@ - -$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c - $(SDCC) $(SDCCFLAGS) -c $< -o $@ - -$(PORT_CASES_DIR)/%$(OBJEXT): $(srcdir)/fwk/lib/%.c - $(SDCC) $(SDCCFLAGS) -c $< -o $@ - -$(PORT_CASES_DIR)/fwk.lib: $(srcdir)/fwk/lib/fwk.lib - cat < $(srcdir)/fwk/lib/fwk.lib > $@ - -# PENDING: Path to sdcc-extra -%.out: %$(BINEXT) - mkdir -p $(dir $@) - $(EMU) -k $< > $@ - -grep -n FAIL $@ /dev/null || true - -_clean: diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/gbz80/support.asm sdcc-3.2.0+dfsg/support/regression/ports/gbz80/support.asm --- sdcc-3.1.0+dfsg/support/regression/ports/gbz80/support.asm 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/gbz80/support.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ - .area _CODE - .globl _putchar - .globl _exit - -__putchar:: - jp _putchar - -__initEmu:: - ret - -__exitEmu:: - jp _exit diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/hc08/spec.mk sdcc-3.2.0+dfsg/support/regression/ports/hc08/spec.mk --- sdcc-3.1.0+dfsg/support/regression/ports/hc08/spec.mk 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/hc08/spec.mk 2012-05-05 07:20:39.000000000 +0000 @@ -1,6 +1,7 @@ # Regression test specification for the hc08 target running with uCsim -CC_FOR_BUILD = $(CC) +# simulation timeout in seconds +SIM_TIMEOUT = 30 # path to uCsim ifdef SDCC_BIN_PATH @@ -57,15 +58,12 @@ $(PORT_CASES_DIR)/fwk.lib: $(srcdir)/fwk/lib/fwk.lib cat < $(srcdir)/fwk/lib/fwk.lib > $@ -# run simulator with 10 seconds timeout +# run simulator with SIM_TIMEOUT seconds timeout %.out: %$(BINEXT) $(CASES_DIR)/timeout mkdir -p $(dir $@) - -$(CASES_DIR)/timeout 10 $(EMU) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \ + -$(CASES_DIR)/timeout $(SIM_TIMEOUT) $(EMU) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \ || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(BINEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@ python $(srcdir)/get_ticks.py < $@ >> $@ -grep -n FAIL $@ /dev/null || true -$(CASES_DIR)/timeout: $(srcdir)/fwk/lib/timeout.c - $(CC_FOR_BUILD) $(CFLAGS) $< -o $@ - _clean: diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/mcs51-common/spec.mk sdcc-3.2.0+dfsg/support/regression/ports/mcs51-common/spec.mk --- sdcc-3.1.0+dfsg/support/regression/ports/mcs51-common/spec.mk 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/mcs51-common/spec.mk 2012-05-05 14:39:36.000000000 +0000 @@ -1,6 +1,7 @@ # Common regression test specification for the mcs51 targets running with uCsim -CC_FOR_BUILD = $(CC) +# simulation timeout in seconds +SIM_TIMEOUT = 30 # path to uCsim ifdef SDCC_BIN_PATH @@ -55,15 +56,12 @@ cat < $(srcdir)/fwk/lib/fwk.lib > $@ cat < $(PORTS_DIR)/mcs51-common/fwk.lib >> $@ -# run simulator with 30 seconds timeout +# run simulator with SIM_TIMEOUT seconds timeout %.out: %$(BINEXT) $(CASES_DIR)/timeout mkdir -p $(dir $@) - -$(CASES_DIR)/timeout 30 $(EMU) -t32 -S in=$(DEV_NULL),out=$@ $< < $(PORTS_DIR)/mcs51-common/uCsim.cmd > $(@:.out=.sim) \ + -$(CASES_DIR)/timeout $(SIM_TIMEOUT) $(EMU) -t32 -S in=$(DEV_NULL),out=$@ $< < $(PORTS_DIR)/mcs51-common/uCsim.cmd > $(@:.out=.sim) \ || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(BINEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@ python $(srcdir)/get_ticks.py < $(@:.out=.sim) >> $@ -grep -n FAIL $@ /dev/null || true -$(CASES_DIR)/timeout: $(srcdir)/fwk/lib/timeout.c - $(CC_FOR_BUILD) $(CFLAGS) $< -o $@ - _clean: diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/pic14/spec.mk sdcc-3.2.0+dfsg/support/regression/ports/pic14/spec.mk --- sdcc-3.1.0+dfsg/support/regression/ports/pic14/spec.mk 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/pic14/spec.mk 2012-06-09 20:45:46.000000000 +0000 @@ -1,6 +1,7 @@ # Regression test specification for the pic14 target running with gpsim -CC_FOR_BUILD = $(CC) +# simulation timeout in seconds +SIM_TIMEOUT = 25 # path to gpsim ifdef GPSIM_PATH @@ -11,13 +12,13 @@ ifndef SDCC_BIN_PATH ifndef CROSSCOMPILING - SDCCFLAGS += --nostdinc -I$(top_srcdir)/device/include/pic14 -I$(top_srcdir)/device/non-free/include/pic -I$(top_srcdir) - LINKFLAGS += --nostdlib -L$(top_builddir)/device/lib/build/pic14 -L$(top_builddir)/device/non-free/lib/build/pic + SDCCFLAGS += --nostdinc -I$(top_srcdir)/device/include/pic14 -I$(top_srcdir)/device/non-free/include/pic14 -I$(top_srcdir) + LINKFLAGS += --nostdlib -L$(top_builddir)/device/lib/build/pic14 -L$(top_builddir)/device/non-free/lib/build/pic14 else - SDCCFLAGS += --non-free + SDCCFLAGS += --use-non-free endif else - SDCCFLAGS += --non-free + SDCCFLAGS += --use-non-free endif ifdef CROSSCOMPILING @@ -47,15 +48,12 @@ $(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c $(SDCC) $(SDCCFLAGS) -c $< -o $@ -# run simulator with 25 seconds timeout +# run simulator with SIM_TIMEOUT seconds timeout %.out: %$(BINEXT) $(CASES_DIR)/timeout mkdir -p $(dir $@) - -$(CASES_DIR)/timeout 25 $(GPSIM) -i -s $< -c $(PORTS_DIR)/pic14/gpsim.cmd > $@ || \ + -$(CASES_DIR)/timeout $(SIM_TIMEOUT) $(GPSIM) -i -s $< -c $(PORTS_DIR)/pic14/gpsim.cmd > $@ || \ echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(BINEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@ python $(srcdir)/get_ticks.py < $@ >> $@ -grep -n FAIL $@ /dev/null || true -$(CASES_DIR)/timeout: fwk/lib/timeout.c - $(CC_FOR_BUILD) $(CFLAGS) $< -o $@ - _clean: diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/pic14/support.c sdcc-3.2.0+dfsg/support/regression/ports/pic14/support.c --- sdcc-3.1.0+dfsg/support/regression/ports/pic14/support.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/pic14/support.c 2012-06-15 15:27:39.000000000 +0000 @@ -40,7 +40,7 @@ _initEmu(void) { /* load and configure the libgpsim_modules module */ - _asm + __asm ;; Set frequency to 20MHz .direct "e", ".frequency=20e6" @@ -59,7 +59,7 @@ ;; Display the received character on terminal .direct "e", "U1.console = true" - _endasm; + __endasm; /* USART initialization */ PORTC |= 0x40; // Set TX pin to 1 @@ -101,3 +101,4 @@ .direct "a", "\"\"" __endasm; } + diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/pic16/spec.mk sdcc-3.2.0+dfsg/support/regression/ports/pic16/spec.mk --- sdcc-3.1.0+dfsg/support/regression/ports/pic16/spec.mk 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/pic16/spec.mk 2012-06-09 20:45:46.000000000 +0000 @@ -1,6 +1,7 @@ # Regression test specification for the pic16 target running with gpsim -CC_FOR_BUILD = $(CC) +# simulation timeout in seconds +SIM_TIMEOUT = 25 # path to gpsim ifdef GPSIM_PATH @@ -14,10 +15,10 @@ SDCCFLAGS += --nostdinc -I$(top_srcdir)/device/include/pic16 -I$(top_srcdir)/device/non-free/include/pic16 -I$(top_srcdir) LINKFLAGS += --nostdlib -L$(top_builddir)/device/lib/build/pic16 -L$(top_builddir)/device/non-free/lib/build/pic16 else - SDCCFLAGS += --non-free + SDCCFLAGS += --use-non-free endif else - SDCCFLAGS += --non-free + SDCCFLAGS += --use-non-free endif ifdef CROSSCOMPILING @@ -48,15 +49,12 @@ $(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c $(SDCC) $(SDCCFLAGS) -c $< -o $@ -# run simulator with 25 seconds timeout +# run simulator with SIM_TIMEOUT seconds timeout %.out: %$(BINEXT) $(CASES_DIR)/timeout mkdir -p $(dir $@) - -$(CASES_DIR)/timeout 25 $(GPSIM) -i -s $< -c $(PORTS_DIR)/pic16/gpsim.cmd > $@ || \ + -$(CASES_DIR)/timeout $(SIM_TIMEOUT) $(GPSIM) -i -s $< -c $(PORTS_DIR)/pic16/gpsim.cmd > $@ || \ echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(BINEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@ python $(srcdir)/get_ticks.py < $@ >> $@ -grep -n FAIL $@ /dev/null || true -$(CASES_DIR)/timeout: fwk/lib/timeout.c - $(CC_FOR_BUILD) $(CFLAGS) $< -o $@ - _clean: diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/rrgbz80/spec.mk sdcc-3.2.0+dfsg/support/regression/ports/rrgbz80/spec.mk --- sdcc-3.1.0+dfsg/support/regression/ports/rrgbz80/spec.mk 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/rrgbz80/spec.mk 2011-05-11 15:18:49.000000000 +0000 @@ -0,0 +1,54 @@ +# Regression test specification for the gbz80 target. + +EMU = $(SDCC_EXTRA_DIR)/emu/rrgb/rrgb$(EXEEXT) +MAKEBIN = $(top_builddir)/bin/makebin$(EXEEXT) + +SDCCFLAGS += --nostdinc -I$(top_srcdir) +LINKFLAGS += --nostdlib -L$(top_builddir)/device/lib/build/gbz80 + +SDCCFLAGS += -mgbz80 --less-pedantic -DREENTRANT= +LINKFLAGS += --out-fmt-ihx gbz80.lib + +OBJEXT = .rel +BINEXT = .gb + +# otherwise `make` deletes testfwk.rel and `make -j` will fail +.PRECIOUS: $(PORT_CASES_DIR)/%$(OBJEXT) + +# Needs parts of gbdk-lib, namely the internal mul/div/mod functions. +EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT) +include $(srcdir)/fwk/lib/spec.mk + +# Rule to convert .ihx to .gb +%$(BINEXT): %.ihx + $(MAKEBIN) -Z -yn ABS $< $@ + +# Rule to link into .ihx +%.ihx: %$(OBJEXT) $(EXTRAS) $(FWKLIB) $(PORT_CASES_DIR)/fwk.lib + $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) $(EXTRAS) $(PORT_CASES_DIR)/fwk.lib $< -o $@ + +$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.asm + @# TODO: sdas should place it\'s output in the current dir + cp $< $(PORT_CASES_DIR) + $(top_builddir)/bin/sdasgb -plosgff $(PORT_CASES_DIR)/$(notdir $<) + rm $(PORT_CASES_DIR)/$(notdir $<) + +%$(OBJEXT): %.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/%$(OBJEXT): $(srcdir)/fwk/lib/%.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/fwk.lib: $(srcdir)/fwk/lib/fwk.lib + cat < $(srcdir)/fwk/lib/fwk.lib > $@ + +# PENDING: Path to sdcc-extra +%.out: %$(BINEXT) + mkdir -p $(dir $@) + $(EMU) -k $< > $@ + -grep -n FAIL $@ /dev/null || true + +_clean: diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/rrgbz80/support.asm sdcc-3.2.0+dfsg/support/regression/ports/rrgbz80/support.asm --- sdcc-3.1.0+dfsg/support/regression/ports/rrgbz80/support.asm 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/rrgbz80/support.asm 2006-03-03 19:32:46.000000000 +0000 @@ -0,0 +1,12 @@ + .area _CODE + .globl _putchar + .globl _exit + +__putchar:: + jp _putchar + +__initEmu:: + ret + +__exitEmu:: + jp _exit diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/rrz80/spec.mk sdcc-3.2.0+dfsg/support/regression/ports/rrz80/spec.mk --- sdcc-3.1.0+dfsg/support/regression/ports/rrz80/spec.mk 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/rrz80/spec.mk 2011-05-11 15:18:49.000000000 +0000 @@ -0,0 +1,55 @@ +# Regression test specification for the z80 target running on top of the Java based +# 'ConsoleZ80' emulator. + +EMU = $(SDCC_EXTRA_DIR)/emu/rrz80/rrz80$(EXEEXT) +MAKEBIN = $(top_builddir)/bin/makebin$(EXEEXT) + +SDCCFLAGS += --nostdinc -I$(top_srcdir) +LINKFLAGS += --nostdlib -L$(top_builddir)/device/lib/build/z80 + +SDCCFLAGS += -mz80 --less-pedantic --profile -DREENTRANT= +LINKFLAGS += --out-fmt-ihx z80.lib + +OBJEXT = .rel +BINEXT = .bin + +# otherwise `make` deletes testfwk.rel and `make -j` will fail +.PRECIOUS: $(PORT_CASES_DIR)/%$(OBJEXT) + +# Needs parts of gbdk-lib, namely the internal mul/div/mod functions. +EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT) +include $(srcdir)/fwk/lib/spec.mk + +# Rule to generate a Emulator .bin file from the .ihx linker output. +%$(BINEXT): %.ihx + $(MAKEBIN) -s 32768 < $< > $@ + +# Rule to link into .ihx +%.ihx: %$(OBJEXT) $(EXTRAS) $(FWKLIB) $(PORT_CASES_DIR)/fwk.lib + $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) $(EXTRAS) $(PORT_CASES_DIR)/fwk.lib $< -o $@ + +$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.asm + @# TODO: sdas should place it\'s output in the current dir + cp $< $(PORT_CASES_DIR) + $(top_builddir)/bin/sdasz80 -plosgff $(PORT_CASES_DIR)/$(notdir $<) + rm $(PORT_CASES_DIR)/$(notdir $<) + +%$(OBJEXT): %.s + $(top_builddir)/bin/sdasz80 -plosgff $< + +%$(OBJEXT): %.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/%$(OBJEXT): $(srcdir)/fwk/lib/%.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/fwk.lib: $(srcdir)/fwk/lib/fwk.lib + cat < $(srcdir)/fwk/lib/fwk.lib > $@ + +# PENDING: Path to sdcc-extra +%.out: %$(BINEXT) + mkdir -p $(dir $@) + $(EMU) --maxruntime=3 --mapfile=$(<:.bin=.sym) $< > $@ + -grep -n FAIL $@ /dev/null || true + +_clean: diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/rrz80/support.asm sdcc-3.2.0+dfsg/support/regression/ports/rrz80/support.asm --- sdcc-3.1.0+dfsg/support/regression/ports/rrz80/support.asm 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/rrz80/support.asm 2006-03-03 19:32:46.000000000 +0000 @@ -0,0 +1,12 @@ + .area _CODE + .globl _putchar + .globl _exit + +__putchar:: + jp _putchar + +__initEmu:: + ret + +__exitEmu:: + jp _exit diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/s08/spec.mk sdcc-3.2.0+dfsg/support/regression/ports/s08/spec.mk --- sdcc-3.1.0+dfsg/support/regression/ports/s08/spec.mk 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/s08/spec.mk 2012-05-18 18:01:17.000000000 +0000 @@ -0,0 +1,71 @@ +# Regression test specification for the s08 target running with uCsim + +# simulation timeout in seconds +SIM_TIMEOUT = 30 + +EMU_PORT_FLAG=-thcs08 + +# path to uCsim +ifdef SDCC_BIN_PATH + UCHC08C = $(SDCC_BIN_PATH)/shc08$(EXEEXT) + + AS_HC08C = $(SDCC_BIN_PATH)/sdas6808$(EXEEXT) +else + UCHC08A = $(top_builddir)/sim/ucsim/hc08.src/shc08$(EXEEXT) + UCHC08B = $(top_builddir)/bin/shc08$(EXEEXT) + + EMU = $(WINE) $(shell if [ -f $(UCHC08A) ]; then echo $(UCHC08A); else echo $(UCHC08B); fi) + + AS = $(WINE) $(top_builddir)/bin/sdas6808$(EXEEXT) + +ifndef CROSSCOMPILING + SDCCFLAGS += --nostdinc -I$(top_srcdir) + LINKFLAGS += --nostdlib -L$(top_builddir)/device/lib/build/s08 +endif +endif + +ifdef CROSSCOMPILING + SDCCFLAGS += -I$(top_srcdir) +endif + +SDCCFLAGS += -ms08 --less-pedantic --out-fmt-ihx -DREENTRANT=__reentrant +LINKFLAGS += s08.lib + +OBJEXT = .rel +BINEXT = .ihx + +# otherwise `make` deletes testfwk.rel and `make -j` will fail +.PRECIOUS: $(PORT_CASES_DIR)/%$(OBJEXT) + +# Required extras +EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT) +include $(srcdir)/fwk/lib/spec.mk + +# Rule to link into .ihx +%$(BINEXT): %$(OBJEXT) $(EXTRAS) $(FWKLIB) $(PORT_CASES_DIR)/fwk.lib + $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) $(EXTRAS) $(PORT_CASES_DIR)/fwk.lib $< -o $@ + +%$(OBJEXT): %.asm + $(AS) -plosgff $< + +%$(OBJEXT): %.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/%$(OBJEXT): $(srcdir)/fwk/lib/%.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/fwk.lib: $(srcdir)/fwk/lib/fwk.lib + cat < $(srcdir)/fwk/lib/fwk.lib > $@ + +# run simulator with SIM_TIMEOUT seconds timeout +%.out: %$(BINEXT) $(CASES_DIR)/timeout + mkdir -p $(dir $@) + -$(CASES_DIR)/timeout $(SIM_TIMEOUT) $(EMU) $(EMU_PORT_FLAG) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \ + || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(BINEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@ + python $(srcdir)/get_ticks.py < $@ >> $@ + -grep -n FAIL $@ /dev/null || true + +_clean: diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/s08/support.c sdcc-3.2.0+dfsg/support/regression/ports/s08/support.c --- sdcc-3.1.0+dfsg/support/regression/ports/s08/support.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/s08/support.c 2010-01-15 13:26:59.000000000 +0000 @@ -0,0 +1,22 @@ + +void +_putchar(unsigned char c) +{ + c; + __asm + .db 0x9e, 0xed + __endasm; +} + +void +_initEmu(void) +{ +} + +void +_exitEmu(void) +{ + __asm + .db 0x9e, 0xec + __endasm; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/s08/uCsim.cmd sdcc-3.2.0+dfsg/support/regression/ports/s08/uCsim.cmd --- sdcc-3.1.0+dfsg/support/regression/ports/s08/uCsim.cmd 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/s08/uCsim.cmd 2005-12-07 12:49:32.000000000 +0000 @@ -0,0 +1,7 @@ +set error non-classified off +set error unknown_code off +set error memory off +set error stack off +run +state +quit diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/ucgbz80/spec.mk sdcc-3.2.0+dfsg/support/regression/ports/ucgbz80/spec.mk --- sdcc-3.1.0+dfsg/support/regression/ports/ucgbz80/spec.mk 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/ucgbz80/spec.mk 2012-05-05 07:20:39.000000000 +0000 @@ -0,0 +1,74 @@ +# Regression test specification for the gbz80 target running with uCsim + +# simulation timeout in seconds +SIM_TIMEOUT = 30 + +EMU_PORT_FLAG=-tlr35902 + +# path to uCsim +ifdef SDCC_BIN_PATH + UCZ80C = $(SDCC_BIN_PATH)/sz80$(EXEEXT) + + AS_Z80C = $(SDCC_BIN_PATH)/sdasgb$(EXEEXT) +else + SZ80A = $(top_builddir)/sim/ucsim/z80.src/sz80$(EXEEXT) + SZ80B = $(top_builddir)/bin/sz80$(EXEEXT) + + EMU = $(WINE) $(shell if [ -f $(SZ80A) ]; then echo $(SZ80A); else echo $(SZ80B); fi) + + AS = $(WINE) $(top_builddir)/bin/sdasgb$(EXEEXT) + +ifndef CROSSCOMPILING + SDCCFLAGS += --nostdinc -I$(top_srcdir) + LINKFLAGS += --nostdlib -L$(top_builddir)/device/lib/build/gbz80 +endif +endif + +ifdef CROSSCOMPILING + SDCCFLAGS += -I$(top_srcdir) +endif + +SDCCFLAGS += -mgbz80 --less-pedantic --profile -DREENTRANT= +LINKFLAGS += gbz80.lib + +OBJEXT = .rel +BINEXT = .ihx + +# otherwise `make` deletes testfwk.rel and `make -j` will fail +.PRECIOUS: $(PORT_CASES_DIR)/%$(OBJEXT) + +# Required extras +EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT) +include $(srcdir)/fwk/lib/spec.mk + +# Rule to link into .ihx +%.ihx: %$(OBJEXT) $(EXTRAS) $(FWKLIB) $(PORT_CASES_DIR)/fwk.lib + $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) $(EXTRAS) $(PORT_CASES_DIR)/fwk.lib $< -o $@ + +$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.asm + @# TODO: sdas should place it\'s output in the current dir + cp $< $(PORT_CASES_DIR) + $(AS) -plosgff $(PORT_CASES_DIR)/$(notdir $<) + rm $(PORT_CASES_DIR)/$(notdir $<) + +%$(OBJEXT): %.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/%$(OBJEXT): $(srcdir)/fwk/lib/%.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/fwk.lib: $(srcdir)/fwk/lib/fwk.lib + cat < $(srcdir)/fwk/lib/fwk.lib > $@ + +# run simulator with SIM_TIMEOUT seconds timeout +%.out: %$(BINEXT) $(CASES_DIR)/timeout + mkdir -p $(dir $@) + -$(CASES_DIR)/timeout $(SIM_TIMEOUT) $(EMU) $(EMU_PORT_FLAG) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \ + || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(BINEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@ + python $(srcdir)/get_ticks.py < $@ >> $@ + -grep -n FAIL $@ /dev/null || true + +_clean: diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/ucgbz80/support.asm sdcc-3.2.0+dfsg/support/regression/ports/ucgbz80/support.asm --- sdcc-3.1.0+dfsg/support/regression/ports/ucgbz80/support.asm 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/ucgbz80/support.asm 2011-12-28 00:10:47.000000000 +0000 @@ -0,0 +1,12 @@ + .area _CODE + .globl _putchar + .globl _exit + +__putchar:: + jp _putchar + +__initEmu:: + ret + +__exitEmu:: + jp _exit diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/ucgbz80/uCsim.cmd sdcc-3.2.0+dfsg/support/regression/ports/ucgbz80/uCsim.cmd --- sdcc-3.1.0+dfsg/support/regression/ports/ucgbz80/uCsim.cmd 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/ucgbz80/uCsim.cmd 2011-12-28 00:10:47.000000000 +0000 @@ -0,0 +1,7 @@ +set error non-classified off +set error unknown_code off +set error memory off +set error stack off +run +state +quit diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/ucr2k/spec.mk sdcc-3.2.0+dfsg/support/regression/ports/ucr2k/spec.mk --- sdcc-3.1.0+dfsg/support/regression/ports/ucr2k/spec.mk 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/ucr2k/spec.mk 2012-06-12 07:56:30.000000000 +0000 @@ -1,6 +1,7 @@ # Regression test specification for the z80 target running with uCsim -CC_FOR_BUILD = $(CC) +# simulation timeout in seconds +SIM_TIMEOUT = 10 EMU_PORT_FLAG=-tr2k @@ -62,15 +63,12 @@ $(PORT_CASES_DIR)/fwk.lib: $(srcdir)/fwk/lib/fwk.lib cat < $(srcdir)/fwk/lib/fwk.lib > $@ -# run simulator with 10 seconds timeout +# run simulator with SIM_TIMEOUT seconds timeout %.out: %$(BINEXT) $(CASES_DIR)/timeout mkdir -p $(dir $@) - -$(CASES_DIR)/timeout 10 $(EMU) $(EMU_PORT_FLAG) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \ + -$(CASES_DIR)/timeout $(SIM_TIMEOUT) $(EMU) $(EMU_PORT_FLAG) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \ || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(BINEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@ python $(srcdir)/get_ticks.py < $@ >> $@ -grep -n FAIL $@ /dev/null || true -$(CASES_DIR)/timeout: $(srcdir)/fwk/lib/timeout.c - $(CC_FOR_BUILD) $(CFLAGS) $< -o $@ - _clean: diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/ucr3ka/spec.mk sdcc-3.2.0+dfsg/support/regression/ports/ucr3ka/spec.mk --- sdcc-3.1.0+dfsg/support/regression/ports/ucr3ka/spec.mk 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/ucr3ka/spec.mk 2012-05-21 02:54:59.000000000 +0000 @@ -0,0 +1,77 @@ +# Regression test specification for the z80 target running with uCsim + +# simulation timeout in seconds +SIM_TIMEOUT = 10 + +EMU_PORT_FLAG=-tr3ka + +# path to uCsim +ifdef SDCC_BIN_PATH + UCZ80C = $(SDCC_BIN_PATH)/sz80$(EXEEXT) + + AS_Z80C = $(SDCC_BIN_PATH)/sdasrab$(EXEEXT) +else + SZ80A = $(top_builddir)/sim/ucsim/z80.src/sz80$(EXEEXT) + SZ80B = $(top_builddir)/bin/sz80$(EXEEXT) + + EMU = $(WINE) $(shell if [ -f $(SZ80A) ]; then echo $(SZ80A); else echo $(SZ80B); fi) + + AS = $(WINE) $(top_builddir)/bin/sdasrab$(EXEEXT) + +ifndef CROSSCOMPILING + SDCCFLAGS += --nostdinc -I$(top_srcdir) + LINKFLAGS += --nostdlib -L$(top_builddir)/device/lib/build/r3ka +endif +endif + +ifdef CROSSCOMPILING + SDCCFLAGS += -I$(top_srcdir) +endif + +SDCCFLAGS += -mr3ka --less-pedantic --profile -DREENTRANT= +LINKFLAGS += r3ka.lib + +OBJEXT = .rel +BINEXT = .ihx + +# otherwise `make` deletes testfwk.rel and `make -j` will fail +.PRECIOUS: $(PORT_CASES_DIR)/%$(OBJEXT) + +# Required extras +EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT) +include $(srcdir)/fwk/lib/spec.mk + +# Rule to link into .ihx +%.ihx: %$(OBJEXT) $(EXTRAS) $(FWKLIB) $(PORT_CASES_DIR)/fwk.lib + $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) $(EXTRAS) $(PORT_CASES_DIR)/fwk.lib $< -o $@ + +$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.asm + @# TODO: sdas should place it\'s output in the current dir + cp $< $(PORT_CASES_DIR) + $(AS) -plosgff $(PORT_CASES_DIR)/$(notdir $<) + rm $(PORT_CASES_DIR)/$(notdir $<) + +%$(OBJEXT): %.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/%$(OBJEXT): $(srcdir)/fwk/lib/%.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/fwk.lib: $(srcdir)/fwk/lib/fwk.lib + cat < $(srcdir)/fwk/lib/fwk.lib > $@ + +# run simulator with SIM_TIMEOUT seconds timeout +%.out: %$(BINEXT) $(CASES_DIR)/timeout + mkdir -p $(dir $@) + -$(CASES_DIR)/timeout $(SIM_TIMEOUT) $(EMU) $(EMU_PORT_FLAG) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \ + || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(BINEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@ + python $(srcdir)/get_ticks.py < $@ >> $@ + -grep -n FAIL $@ /dev/null || true + + +# echo Running $(CASES_DIR)/timeout $(SIM_TIMEOUT) $(EMU) $(EMU_PORT_FLAG) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd + +_clean: diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/ucr3ka/support.asm sdcc-3.2.0+dfsg/support/regression/ports/ucr3ka/support.asm --- sdcc-3.1.0+dfsg/support/regression/ports/ucr3ka/support.asm 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/ucr3ka/support.asm 2012-05-21 02:54:59.000000000 +0000 @@ -0,0 +1,16 @@ + .area _CODE + .globl _putchar + .globl _exit + +SADR=0xC0 + +__putchar:: + ioi + ld (SADR),a + ret + +__initEmu:: + ret + +__exitEmu:: + jp _exit diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/ucr3ka/uCsim.cmd sdcc-3.2.0+dfsg/support/regression/ports/ucr3ka/uCsim.cmd --- sdcc-3.1.0+dfsg/support/regression/ports/ucr3ka/uCsim.cmd 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/ucr3ka/uCsim.cmd 2012-05-21 02:54:59.000000000 +0000 @@ -0,0 +1,7 @@ +set error non-classified off +set error unknown_code off +set error memory off +set error stack off +run +state +quit diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/ucz180/spec.mk sdcc-3.2.0+dfsg/support/regression/ports/ucz180/spec.mk --- sdcc-3.1.0+dfsg/support/regression/ports/ucz180/spec.mk 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/ucz180/spec.mk 2012-05-05 07:20:39.000000000 +0000 @@ -1,6 +1,7 @@ # Regression test specification for the z80 target running with uCsim -CC_FOR_BUILD = $(CC) +# simulation timeout in seconds +SIM_TIMEOUT = 20 # path to uCsim ifdef SDCC_BIN_PATH @@ -60,15 +61,12 @@ $(PORT_CASES_DIR)/fwk.lib: $(srcdir)/fwk/lib/fwk.lib cat < $(srcdir)/fwk/lib/fwk.lib > $@ -# run simulator with 10 seconds timeout +# run simulator with SIM_TIMEOUT seconds timeout %.out: %$(BINEXT) $(CASES_DIR)/timeout mkdir -p $(dir $@) - -$(CASES_DIR)/timeout 10 $(EMU) -tz180 $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \ + -$(CASES_DIR)/timeout $(SIM_TIMEOUT) $(EMU) -tz180 $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \ || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(BINEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@ python $(srcdir)/get_ticks.py < $@ >> $@ -grep -n FAIL $@ /dev/null || true -$(CASES_DIR)/timeout: $(srcdir)/fwk/lib/timeout.c - $(CC_FOR_BUILD) $(CFLAGS) $< -o $@ - _clean: diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/ucz80/spec.mk sdcc-3.2.0+dfsg/support/regression/ports/ucz80/spec.mk --- sdcc-3.1.0+dfsg/support/regression/ports/ucz80/spec.mk 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/ucz80/spec.mk 2012-06-22 12:36:51.000000000 +0000 @@ -1,6 +1,7 @@ # Regression test specification for the z80 target running with uCsim -CC_FOR_BUILD = $(CC) +# simulation timeout in seconds +SIM_TIMEOUT = 40 # path to uCsim ifdef SDCC_BIN_PATH @@ -60,15 +61,12 @@ $(PORT_CASES_DIR)/fwk.lib: $(srcdir)/fwk/lib/fwk.lib cat < $(srcdir)/fwk/lib/fwk.lib > $@ -# run simulator with 10 seconds timeout +# run simulator with SIM_TIMEOUT seconds timeout %.out: %$(BINEXT) $(CASES_DIR)/timeout mkdir -p $(dir $@) - -$(CASES_DIR)/timeout 10 $(EMU) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \ + -$(CASES_DIR)/timeout $(SIM_TIMEOUT) $(EMU) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \ || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(BINEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@ python $(srcdir)/get_ticks.py < $@ >> $@ -grep -n FAIL $@ /dev/null || true -$(CASES_DIR)/timeout: $(srcdir)/fwk/lib/timeout.c - $(CC_FOR_BUILD) $(CFLAGS) $< -o $@ - _clean: diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/xa51/spec.mk sdcc-3.2.0+dfsg/support/regression/ports/xa51/spec.mk --- sdcc-3.1.0+dfsg/support/regression/ports/xa51/spec.mk 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/xa51/spec.mk 2012-03-24 09:51:32.000000000 +0000 @@ -37,7 +37,4 @@ echo -e --- FAIL: \"timeout, simulation killed\" in $(<:.ihx=.c)"\n"--- Summary: 1/1/1: timeout >> $@ -grep -n FAIL $@ /dev/null || true -$(CASES_DIR)/timeout$(EXEEXT): fwk/lib/timeout.c - $(CC) $(CFLAGS) $< -o $@ - _clean: diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/z80/spec.mk sdcc-3.2.0+dfsg/support/regression/ports/z80/spec.mk --- sdcc-3.1.0+dfsg/support/regression/ports/z80/spec.mk 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/z80/spec.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -# Regression test specification for the z80 target running on top of the Java based -# 'ConsoleZ80' emulator. - -EMU = $(SDCC_EXTRA_DIR)/emu/rrz80/rrz80$(EXEEXT) -MAKEBIN = $(top_builddir)/bin/makebin$(EXEEXT) - -SDCCFLAGS += --nostdinc -I$(top_srcdir) -LINKFLAGS += --nostdlib -L$(top_builddir)/device/lib/build/z80 - -SDCCFLAGS += -mz80 --less-pedantic --profile -DREENTRANT= -LINKFLAGS += --out-fmt-ihx z80.lib - -OBJEXT = .rel -BINEXT = .bin - -# otherwise `make` deletes testfwk.rel and `make -j` will fail -.PRECIOUS: $(PORT_CASES_DIR)/%$(OBJEXT) - -# Needs parts of gbdk-lib, namely the internal mul/div/mod functions. -EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT) -include $(srcdir)/fwk/lib/spec.mk - -# Rule to generate a Emulator .bin file from the .ihx linker output. -%$(BINEXT): %.ihx - $(MAKEBIN) -s 32768 < $< > $@ - -# Rule to link into .ihx -%.ihx: %$(OBJEXT) $(EXTRAS) $(FWKLIB) $(PORT_CASES_DIR)/fwk.lib - $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) $(EXTRAS) $(PORT_CASES_DIR)/fwk.lib $< -o $@ - -$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.asm - @# TODO: sdas should place it\'s output in the current dir - cp $< $(PORT_CASES_DIR) - $(top_builddir)/bin/sdasz80 -plosgff $(PORT_CASES_DIR)/$(notdir $<) - rm $(PORT_CASES_DIR)/$(notdir $<) - -%$(OBJEXT): %.s - $(top_builddir)/bin/sdasz80 -plosgff $< - -%$(OBJEXT): %.c - $(SDCC) $(SDCCFLAGS) -c $< -o $@ - -$(PORT_CASES_DIR)/%$(OBJEXT): $(srcdir)/fwk/lib/%.c - $(SDCC) $(SDCCFLAGS) -c $< -o $@ - -$(PORT_CASES_DIR)/fwk.lib: $(srcdir)/fwk/lib/fwk.lib - cat < $(srcdir)/fwk/lib/fwk.lib > $@ - -# PENDING: Path to sdcc-extra -%.out: %$(BINEXT) - mkdir -p $(dir $@) - $(EMU) --maxruntime=3 --mapfile=$(<:.bin=.sym) $< > $@ - -grep -n FAIL $@ /dev/null || true - -_clean: diff -Nru sdcc-3.1.0+dfsg/support/regression/ports/z80/support.asm sdcc-3.2.0+dfsg/support/regression/ports/z80/support.asm --- sdcc-3.1.0+dfsg/support/regression/ports/z80/support.asm 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/ports/z80/support.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ - .area _CODE - .globl _putchar - .globl _exit - -__putchar:: - jp _putchar - -__initEmu:: - ret - -__exitEmu:: - jp _exit diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/abs.c sdcc-3.2.0+dfsg/support/regression/tests/abs.c --- sdcc-3.1.0+dfsg/support/regression/tests/abs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/abs.c 2012-02-22 14:45:17.000000000 +0000 @@ -14,3 +14,4 @@ ASSERT( labs(-1000000L) == 1000000L ); ASSERT( labs(-2147483647L) == 2147483647L ); } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/absolute.c sdcc-3.2.0+dfsg/support/regression/tests/absolute.c --- sdcc-3.1.0+dfsg/support/regression/tests/absolute.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/absolute.c 2012-02-22 14:45:17.000000000 +0000 @@ -5,7 +5,7 @@ #include #include -#ifdef SDCC_pic16 +#ifdef __SDCC_pic16 # define ADDRESS(x) (0x02 ## x) #else # define ADDRESS(x) (0xCA ## x) @@ -38,7 +38,7 @@ void testAbsolute(void) { -#if defined(SDCC_mcs51) || defined(SDCC_ds390) || defined(SDCC_hc08) +#if !defined(PORT_HOST) static {mem} __at(ADDRESS(B6)) char s = 's'; char {mem} *pC = (char {mem} *)(ADDRESS(B0)); int {mem} *pI = (int {mem} *)(ADDRESS(B0)); @@ -59,7 +59,7 @@ #endif } -#if defined(SDCC_mcs51) || defined(SDCC_ds390) +#if defined(__SDCC_mcs51) || defined(__SDCC_ds390) volatile __data __at(0x20) unsigned char Byte0 = 0x00; volatile __data __at(0x22) unsigned char Byte1 = 0x00; volatile __bit Bit0, Bit1, Bit2, Bit3, Bit4, Bit5, Bit6, Bit7, Bit8; @@ -68,7 +68,7 @@ void testAbsBdata(void) { -#if defined(SDCC_mcs51) || defined(SDCC_ds390) +#if defined(__SDCC_mcs51) || defined(__SDCC_ds390) Bit0 = 1; ASSERT(Byte0 == 0x00); Byte0 = 0xFF; @@ -76,3 +76,4 @@ ASSERT(Byte0 == 0xFF); #endif } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/and_survive.c sdcc-3.2.0+dfsg/support/regression/tests/and_survive.c --- sdcc-3.1.0+dfsg/support/regression/tests/and_survive.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/and_survive.c 2012-06-15 09:41:13.000000000 +0000 @@ -0,0 +1,127 @@ +/* + This test is meant to test the backend's generation of + non-destructive and available on some architectures. + Also serves as a regression test for bug #3534833. +*/ + +#include + +/* Some architectures have non-destructive and when one operand is a literal with exactly one bit set (e.g. all Z80-related ) */ +int litbitchar (unsigned char a) +{ + register unsigned char b = a + 1; /* Suggest allocating b to accumulator */ + + if (b & 0x01) + return(0); + else if (b & 0x04) + return(1); + else if (b & 0x20) + return(2); + else + return(3); +} + +/* Some architectures have non-destructive and when one operand is a literal with exactly one bit set, and the other operand can be in any register or even spilt (e.g. S08) */ +int litbitchar2 (unsigned char a, unsigned char c, unsigned char e) +{ + unsigned char b = a + 1; + unsigned char d = c + 1; + + if (b & 0x01) + { + if (d & 0x01) + return(8); + else if (d & 0x04) + return(9); + else + return(10); + } + else if (b & 0x04) + return(1); + else if (b & 0x20) + { + if (e & 0x01) + return(4); + else if (e & 0x04) + return(5); + else + return(6); + } + else + return(3); +} + +/* Some architectures have non-destructive and when one operand is a literal with at most one bit per byte set (e.g. Z80) */ +int litbitint (unsigned int a) +{ + register unsigned int b = a + 1; /* Suggest allocating b to accumulator */ + + if (b & 0x0001) + return(0); + else if (b & 0x0004) + return(1); + else if (b & 0x2010) + return(2); + else + return(3); +} + +/* Some architectures have non-destructive and when one operand is a one-byte literal (e.g. Z180) */ +int litchar (unsigned char a) +{ + register unsigned char b = a + 1; /* Suggest allocating b to accumulator */ + + if (b & 0x33) + return(0); + else if (b & 0x44) + return(1); + else if (b & 0x1f) + return(2); + else + return(3); +} + +/* Some architectures have non-destructive and when one operand is in a register (e.g. Z180) */ +int regchar (unsigned char a, unsigned char c) +{ + register unsigned char b = a + 1; /* Suggest allocating b to accumulator */ + register unsigned char d = c + 1; + + if (b & 0x11) + return(0); + else if (b & d) + return(1); + else if (b & 0x33) + return(2); + else + return(3); +} + +void testAndSurvive (void) +{ + ASSERT (litbitchar (0x77u - 1) == 0); + ASSERT (litbitchar (0x74u - 1) == 1); + ASSERT (litbitchar (0x70u - 1) == 2); + ASSERT (litbitchar (0x80u - 1) == 3); + + ASSERT (litbitchar2 (0x01u - 1, 0x01u - 1, 0x01u) == 8); + ASSERT (litbitchar2 (0x01u - 1, 0x80u - 1, 0x01u) == 10); + ASSERT (litbitchar2 (0x74u - 1, 0x01u - 1, 0x01u) == 1); + ASSERT (litbitchar2 (0x80u - 1, 0x01u - 1, 0x01u) == 3); + ASSERT (litbitchar2 (0x20u - 1, 0x01u - 1, 0x04u) == 5); + + ASSERT (litbitint (0x0001u - 1) == 0); + ASSERT (litbitint (0x8fe8u - 1) == 3); + ASSERT (litbitint (0x3030u - 1) == 2); + + ASSERT (litchar (0x77u - 1) == 0); + ASSERT (litchar (0x88u - 1) == 2); + ASSERT (litchar (0x48u - 1) == 1); + ASSERT (litchar (0x80u - 1) == 3); + + ASSERT (regchar (0x77u - 1, 0x00u - 1) == 0); + ASSERT (regchar (0x88u - 1, 0x08u - 1) == 1); + ASSERT (regchar (0x80u - 1, 0x88u - 1) == 1); + ASSERT (regchar (0x80u - 1, 0x08u - 1) == 3); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bitfields.c sdcc-3.2.0+dfsg/support/regression/tests/bitfields.c --- sdcc-3.1.0+dfsg/support/regression/tests/bitfields.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bitfields.c 2012-06-15 15:43:51.000000000 +0000 @@ -10,7 +10,7 @@ char c3_5 : 5; } c_bf; -#if !defined(SDCC_pic16) +#if !defined(__SDCC_pic16) struct { int i0_7 : 7; int i7_9 : 9; @@ -34,7 +34,7 @@ unsigned int b8 : 1; unsigned int b9 : 1; } sb_bf; -#endif /* !SDCC_pic16 */ +#endif /* !__SDCC_pic16 */ struct { unsigned int b0 : 1; @@ -59,7 +59,7 @@ unsigned int b1 : 1; } size2a_bf; -#if !defined(SDCC_pic16) +#if !defined(__SDCC_pic16) struct { unsigned int b0 : 1; unsigned int b1 : 1; @@ -94,7 +94,7 @@ signed int s7_1 : 1; signed int s8_9 : 9; } s_bf; -#endif /* !SDCC_pic16 */ +#endif /* !__SDCC_pic16 */ void testBitfieldSizeof(void) @@ -106,13 +106,13 @@ ASSERT( sizeof(size1a_bf) >= 1); ASSERT( sizeof(size1b_bf) >= 1); ASSERT( sizeof(size1c_bf) >= 1); -#if !defined(SDCC_pic16) +#if !defined(__SDCC_pic16) ASSERT( sizeof(size2b_bf) >= 2); ASSERT( sizeof(size2c_bf) >= 2); ASSERT( sizeof(size2d_bf) >= 2); ASSERT( sizeof(size3a_bf) >= 2); ASSERT( sizeof(size1a_bf) <= sizeof(size1b_bf)); -#endif /* !SDCC_pic16 */ +#endif /* !__SDCC_pic16 */ /* Some SDCC specific assertions. SDCC uses 8 bit storage units. Bitfields that are less than 8 bits, but would (due to earlier bitfield declarations) span a storage unit boundary are @@ -120,17 +120,17 @@ 8 or greater bits are always aligned to start on a storage unit boundary. */ -#ifdef SDCC +#ifdef __SDCC ASSERT( sizeof(size1a_bf) == 1); ASSERT( sizeof(size1b_bf) == 1); ASSERT( sizeof(size1c_bf) == 1); ASSERT( sizeof(size2a_bf) == 2); -#if !defined(SDCC_pic16) +#if !defined(__SDCC_pic16) ASSERT( sizeof(size2b_bf) == 2); ASSERT( sizeof(size2c_bf) == 2); ASSERT( sizeof(size2d_bf) == 2); ASSERT( sizeof(size3a_bf) == 3); -#endif /* !SDCC_pic16 */ +#endif /* !__SDCC_pic16 */ #endif } @@ -138,7 +138,7 @@ void testBitfieldsSingleBitLiteral(void) { -#if !defined(SDCC_pic16) +#if !defined(__SDCC_pic16) size2b_bf.b0 = 0; size2b_bf.b1 = 0; size2b_bf.b2 = 0; @@ -186,13 +186,13 @@ ASSERT(size2b_bf.b7==0); ASSERT(size2b_bf.b8==0); ASSERT(size2b_bf.b9==1); -#endif /* !SDCC_pic16 */ +#endif /* !__SDCC_pic16 */ } void testBitfieldsSingleBit(void) { -#if !defined(SDCC_pic16) +#if !defined(__SDCC_pic16) volatile unsigned char c; c = 0; @@ -245,13 +245,13 @@ ASSERT(size2b_bf.b7==0); ASSERT(size2b_bf.b8==0); ASSERT(size2b_bf.b9==1); -#endif /* !SDCC_pic16 */ +#endif /* !__SDCC_pic16 */ } void testBitfieldsMultibitLiteral(void) { -#if !defined(SDCC_pic16) +#if !defined(__SDCC_pic16) size2c_bf.b0 = 0xff; /* should truncate to 0x0f */ size2c_bf.b1 = 0; ASSERT(size2c_bf.b0==0x0f); @@ -291,13 +291,13 @@ size2d_bf.b1 = 5; ASSERT(size2d_bf.b0==0x0a46); ASSERT(size2d_bf.b1==5); -#endif /* !SDCC_pic16 */ +#endif /* !__SDCC_pic16 */ } void testBitfieldsMultibit(void) { -#if !defined(SDCC_pic16) +#if !defined(__SDCC_pic16) volatile int allones = 0xffff; volatile int zero = 0; volatile int x; @@ -335,7 +335,7 @@ size2d_bf.b1 = x; ASSERT(size2d_bf.b0==0x0a46); ASSERT(size2d_bf.b1==5); -#endif /* !SDCC_pic16 */ +#endif /* !__SDCC_pic16 */ } void @@ -365,7 +365,7 @@ void testSignedBitfields(void) { -#if !defined(SDCC_pic16) +#if !defined(__SDCC_pic16) s_bf.s0_7 = 0xf0; s_bf.s7_1 = 1; s_bf.s8_9 = 0xfff8; @@ -384,7 +384,7 @@ ASSERT(s_bf.s8_9 == 0xff); ASSERT(s_bf.s0_7 > 0); ASSERT(s_bf.s8_9 > 0); -#endif /* !SDCC_pic16 */ +#endif /* !__SDCC_pic16 */ } /* test case for enhancement request #2291335 : Unnamed bit-field initialization */ @@ -431,6 +431,7 @@ /* test case for const struct with bitfields */ +#ifndef __SDCC_pic16 // TODO: enable when the pic16 ports supports bitfields of size greater than 8 bits! const struct { unsigned int a : 4; @@ -442,6 +443,7 @@ unsigned int f : 2; unsigned int g; } cs = { 1, 2, 345, 6, 2, 1, 54321}; +#endif #if defined(PORT_HOST) && (defined(__x86_64__) || defined(__i386__)) && defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 6) /* Workaround to fix the (cs.f == 1) test failure, which appeared in svn build 6665, when -O2 gcc option was included. @@ -454,6 +456,7 @@ void testCS(void) { +#ifndef __SDCC_pic16 // TODO: enable when the pic16 ports supports bitfields of size greater than 8 bits! ASSERT(cs.a == 1); ASSERT(cs.b == 2); ASSERT(cs.c == 345); @@ -461,7 +464,9 @@ ASSERT(cs.e == 2); ASSERT(cs.f == 1); ASSERT(cs.g == 54321U); +#endif } #if defined(PORT_HOST) && defined(__sun) && defined(__i386__) && defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 6) #pragma GCC pop_options #endif + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bitopcse.c sdcc-3.2.0+dfsg/support/regression/tests/bitopcse.c --- sdcc-3.1.0+dfsg/support/regression/tests/bitopcse.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bitopcse.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,7 +4,7 @@ */ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif @@ -154,3 +154,4 @@ ASSERT( v == ({type}) MASK); ASSERT(uv == MASK); } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bitvars.c sdcc-3.2.0+dfsg/support/regression/tests/bitvars.c --- sdcc-3.1.0+dfsg/support/regression/tests/bitvars.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bitvars.c 2012-02-22 14:45:17.000000000 +0000 @@ -5,7 +5,7 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif @@ -46,7 +46,7 @@ #if !(defined(__SUNPRO_C) && defined(__i386)) /* this test fails on Solaris i386 SunPro C compiler with -xO2 option; it pass without -xO2 option !? */ -#if defined TYPE_char && !defined SDCC_CHAR_UNSIGNED +#if defined TYPE_char && !defined __SDCC_CHAR_UNSIGNED ASSERT (complement (~_ff, 0)); #else ASSERT (complement (~_ff, 1)); @@ -55,7 +55,7 @@ #if defined TYPE_bool ASSERT (complement (~_ffff, 1)); -#elif defined TYPE_char && !defined SDCC_CHAR_UNSIGNED +#elif defined TYPE_char && !defined __SDCC_CHAR_UNSIGNED ASSERT (complement (~_ffff, 0)); #else if (sizeof({type}) < sizeof(int)) @@ -66,3 +66,4 @@ #endif //__bool_true_false_are_defined } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bool.c sdcc-3.2.0+dfsg/support/regression/tests/bool.c --- sdcc-3.1.0+dfsg/support/regression/tests/bool.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bool.c 2012-02-22 14:45:17.000000000 +0000 @@ -3,7 +3,7 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_c99 #endif @@ -26,9 +26,9 @@ volatile bool E; -#if (__SDCC_WEIRD_BOOL == 0) bool (* const pa[])(void) = {&ret_true, &ret_false}; +#if (__SDCC_WEIRD_BOOL == 0) struct s { bool b; @@ -45,13 +45,13 @@ { volatile unsigned char z = 2; -#if (__SDCC_WEIRD_BOOL == 0) const char *BOOL = "George Boole"; ASSERT(true); ASSERT((*(pa[0]))() == true); ASSERT((*(pa[1]))() == false); +#if (__SDCC_WEIRD_BOOL == 0) s2.b = (z & 2); ASSERT(s2.b); s2.b = (bool)(z & 2); @@ -81,3 +81,4 @@ E = true; E--; ASSERT(!E); // sets E to 1-E } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bp.c sdcc-3.2.0+dfsg/support/regression/tests/bp.c --- sdcc-3.1.0+dfsg/support/regression/tests/bp.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bp.c 2012-02-22 14:45:17.000000000 +0000 @@ -20,7 +20,7 @@ return a; } -#if defined(SDCC_mcs51) || defined(SDCC_pic16) +#if defined(__SDCC_mcs51) || defined(__SDCC_pic16) // test devices with much less memory #define ABOVE_MEM_SIZE 30 @@ -57,3 +57,4 @@ ASSERT(verifyBlock(below, BELOW_MEM_TEST_SIZE, sizeof(below))); } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug-221100.c sdcc-3.2.0+dfsg/support/regression/tests/bug-221100.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug-221100.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug-221100.c 2012-02-22 14:45:17.000000000 +0000 @@ -7,7 +7,7 @@ #define ARRAY_SIZE 130 -#ifdef SDCC_pic16 +#ifdef __SDCC_pic16 /* not enough pic16 data space, so put the array into the code memory */ __code static unsigned int testArray[ARRAY_SIZE] = { @@ -43,7 +43,7 @@ static void testUnsignedCharIndex (void) { -#ifndef SDCC_pic16 +#ifndef __SDCC_pic16 int i; for (i = 0; i < 130; i++) { testArray[i] = i; diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug-3495411.c sdcc-3.2.0+dfsg/support/regression/tests/bug-3495411.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug-3495411.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug-3495411.c 2012-05-05 14:39:36.000000000 +0000 @@ -0,0 +1,186 @@ +/* + bug-3495411.c +*/ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#pragma disable_warning 88 +#endif + +// Type defines +#define UCHAR unsigned char +#define USHORT unsigned short +#define ULONG unsigned long +//#define BOOLEAN unsigned char +#define BOOLEAN _Bool + +#define PCHAR unsigned char * +#define PSHORT unsigned short * +#define PLONG unsigned long * + +#ifndef NULL +#define NULL (void *)0 +#endif + +#define TRUE 1 +#define FALSE 0 + +#define IP_ALEN 4 +#define RTP_SSRC_LEN 4 +#define MAX_USER_NAME_LEN 32 +#define MAX_USER_NUMBER_LEN 32 +#define MAX_TAG_LEN 16 + +typedef struct _CALL_TIME +{ + UCHAR iSec; + UCHAR iMin; + UCHAR iHour; +} CALL_TIME; + +struct ucb +{ + UCHAR iState; + USHORT sSrcPort; + UCHAR iBankOffset; /* Bank offset of call back function */ + USHORT sCallBack; /* Address of call back function */ + USHORT sDstPort; + UCHAR pDstIP[IP_ALEN]; + USHORT sLen; +}; + +typedef struct ucb * UDP_SOCKET; + +typedef struct sip_lcb * SIP_LCB_HANDLE; +typedef struct sip_tcb * SIP_TCB_HANDLE; + +struct sip_tcb +{ + UCHAR iState; + UCHAR iMethod; + UCHAR pDstIP[IP_ALEN]; + USHORT sDstPort; + UCHAR iTimer0; + UCHAR iTimer1; + UCHAR iTimer2; + BOOLEAN b100rel; + PCHAR pBranch; + PCHAR pData; + SIP_LCB_HANDLE pLcb; +}; + +struct sip_lcb +{ + UCHAR iState; // State of this line + BOOLEAN bCallee; // Caller or callee + UCHAR iTimer; // No anser timer + UCHAR iRemoteRb; // ringback tone type + BOOLEAN bHolding; + BOOLEAN bEarlyDlg; // already received a 1xx response + + UCHAR iVoiceCoder; // voice coder used by this line + BOOLEAN bVad; + UCHAR iRemoteMode; // remote voice transmission mode + UCHAR pRtpDstIP[IP_ALEN]; // RTP dst IP + USHORT sRtpDstPort; // RTP dst port + UCHAR iCoderPayload; // Peer's coder payload + UCHAR iDtmfPayload; // Peer's DTMF payload + + UCHAR iLocalMode; // local voice transmission mode + UCHAR iSdpType; + UCHAR pSdpSessionId[9]; + ULONG lSdpVersion; + UDP_SOCKET pRtpSocket; + USHORT sRtpPort; // local RTP port + USHORT sRtpSeq; // RTP sequence + UCHAR pRtpSSRC[RTP_SSRC_LEN]; + UCHAR pRtpDstSSRC[RTP_SSRC_LEN]; + ULONG lRtpTimeStamp; // RTP timestamp + ULONG lRtpOffset; + BOOLEAN bVoiceStart; + BOOLEAN bSendingKey; // RFC2833 send key + UCHAR iSendKey; // Key being sent + USHORT sSendKeyLen; // Duration in timestamp + BOOLEAN bKeyRecved; + UCHAR pKeyTimeStamp[4]; + + UCHAR pDstIP[IP_ALEN]; // Dst IP of this call + USHORT sDstPort; // Dst port of this call + ULONG lRseq; // RSEQ for PRACK + ULONG lCurSeq; // Current sequence of this call + ULONG lInvSeq; // Sequence of INVITE request + PCHAR pInvUri; // Original request Uri of this call + PCHAR pReqUri; // Request URI of this call + PCHAR pBranch; // Invite branch + PCHAR pCallId; // Call-ID header of this call + PCHAR pFrom; // From header of this call + PCHAR pTo; // To header + PCHAR pFromTag; // Local tag + PCHAR pToTag; // Remote tag + PCHAR pProxyAuth; // Proxy-Authenticate information + PCHAR pWWWAuth; // WWW-Authenticate information + PCHAR pRoute; // Route header to be included in request + PCHAR pInvHeader; // Invite header to be included in response + SIP_TCB_HANDLE pInvTcb; // Transaction control block of INVITE request + + UCHAR pRespDstIP[IP_ALEN]; + USHORT sRespDstPort; + PCHAR pReferredBy; + PCHAR pReplaces; + UCHAR iXferPart; // which role do we play? transferor, transferee or transfer-to? + + UCHAR iRefresher; + ULONG lSessionExpires; + ULONG lSessionTimer; + ULONG lMinSE; + + UCHAR pPeerName[MAX_USER_NAME_LEN]; + UCHAR pPeerNumber[MAX_USER_NUMBER_LEN]; + CALL_TIME ct; + UCHAR pKeyOut[MAX_USER_NUMBER_LEN]; + UCHAR iKeyIndex; + BOOLEAN bMemCall; +}; + +__xdata struct sip_lcb l; +extern SIP_LCB_HANDLE Sip_pCurLcb = &l; + +void line_start(PCHAR pDst) {} +void sip_add_local_uri(BOOLEAN bIP, BOOLEAN bPort) {} +void sip_new_token(PCHAR pDst, UCHAR iLen) {} +void sip_add_token(PCHAR pToken, PCHAR pValue) {} +void dummy_free(void *p) {} +PCHAR heap_save_str(PCHAR pStr) { return ((PCHAR) 42);} +BOOLEAN Sys_bRegister; +const UCHAR _cTokenTag[] = ""; + +void sip_new_from() +{ +#ifdef __SDCC_mcs51 + UCHAR pBuf[64]; +#else + UCHAR pBuf[128]; +#endif + UCHAR pTag[MAX_TAG_LEN+1]; + + line_start(pBuf); + sip_add_local_uri(!Sys_bRegister, FALSE); + sip_new_token(pTag, MAX_TAG_LEN); + sip_add_token(_cTokenTag, pTag); + dummy_free(Sip_pCurLcb->pFrom); + Sip_pCurLcb->pFrom = heap_save_str(pBuf); + dummy_free(Sip_pCurLcb->pFromTag); + Sip_pCurLcb->pFromTag = heap_save_str(pTag); +} + +void +testBug (void) +{ + l.pFrom = (PCHAR) 23; + sip_new_from(); + ASSERT (l.pFrom == (PCHAR) 42); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug-460010.c sdcc-3.2.0+dfsg/support/regression/tests/bug-460010.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug-460010.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug-460010.c 2012-02-22 14:45:17.000000000 +0000 @@ -2,8 +2,8 @@ */ #include -#ifdef SDCC -#ifdef SDCC_pic16 +#ifdef __SDCC +#ifdef __SDCC_pic16 #define ADDRESS 0x0070 #else #define ADDRESS 0xa000 @@ -19,7 +19,7 @@ void testBadPromotion (void) { -#ifdef SDCC +#ifdef __SDCC unsigned char c = *((unsigned __xdata char*)(ADDRESS)); #else unsigned char loc_c; diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug-524697.c sdcc-3.2.0+dfsg/support/regression/tests/bug-524697.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug-524697.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug-524697.c 2012-02-22 14:45:17.000000000 +0000 @@ -2,7 +2,7 @@ */ #include -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) #define SZ_SIZE 89 #else #define SZ_SIZE 90 diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug-716242.c sdcc-3.2.0+dfsg/support/regression/tests/bug-716242.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug-716242.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug-716242.c 2012-02-22 14:45:17.000000000 +0000 @@ -22,7 +22,7 @@ void f1 () { -#if defined(SDCC_ds390) +#if defined(__SDCC_ds390) p = (void __code *) mul2; #else p = (void *) mul2; diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug-908454.c sdcc-3.2.0+dfsg/support/regression/tests/bug-908454.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug-908454.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug-908454.c 2012-02-22 14:45:17.000000000 +0000 @@ -2,7 +2,7 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1057979.c sdcc-3.2.0+dfsg/support/regression/tests/bug1057979.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1057979.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1057979.c 2012-02-22 14:45:17.000000000 +0000 @@ -37,7 +37,7 @@ sprintf (s, "%-3.3s", "ab"); ASSERT (0 == strcmp (s, "ab ")); -#if defined(SDCC_ds390) || defined(PORT_HOST) +#if defined(__SDCC_ds390) || defined(PORT_HOST) //and from bug 1358192 sprintf (s, "%f", 10.1); LOG ((s)); @@ -54,3 +54,4 @@ ASSERT (s[12] == 0x12); } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1115321.c sdcc-3.2.0+dfsg/support/regression/tests/bug1115321.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1115321.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1115321.c 2012-02-22 14:45:17.000000000 +0000 @@ -49,10 +49,14 @@ #define SUPPORT_CHAR_C -#ifndef SDCC -# define VA_ARG(args,type) (type)va_arg((args),int) +/* Normally a char is promoted to int when passed as varargs parameter */ +/* but SDCC leaves it as char. */ +#ifndef __SDCC +# define VA_ARG_CHAR int +# define VA_ARG(args,type) va_arg((args),type) # define SDCC_SNPRINTF sdcc_snprintf #else +# define VA_ARG_CHAR char # define VA_ARG(args,type) va_arg((args),type) # define SDCC_SNPRINTF snprintf #endif @@ -113,7 +117,7 @@ switch( *format ) { #ifdef SUPPORT_CHAR_C case 'c': - *buffer = VA_ARG( args, char ); + *buffer = VA_ARG( args, VA_ARG_CHAR ); buffer++; break; #endif /* SUPPORT_CHAR_C */ @@ -246,7 +250,7 @@ ASSERT (ret == 10); } -#if defined SDCC && !defined SDCC_z80 && !defined SDCC_z180 && !defined SDCC_r2k +#if defined SDCC && !defined __SDCC_z80 && !defined __SDCC_z180 && !defined __SDCC_r2k && !defined __SDCC_gbz80 extern void _putchar(char c); void putchar(char c) diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1198642.c sdcc-3.2.0+dfsg/support/regression/tests/bug1198642.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1198642.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1198642.c 2012-02-22 14:45:17.000000000 +0000 @@ -7,7 +7,7 @@ void test_cse_generic_ptr (void) { -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) volatile void *p1; volatile void *p2; diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1337835.c sdcc-3.2.0+dfsg/support/regression/tests/bug1337835.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1337835.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1337835.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,19 +4,15 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif #include -#ifndef BOOL -#define BOOL bool -#endif - char e; -void foo (unsigned long ul, BOOL b, char c) REENTRANT +void foo (unsigned long ul, bool b, char c) REENTRANT { if (b && (long) ul < 0) e = 0; diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1505956.c sdcc-3.2.0+dfsg/support/regression/tests/bug1505956.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1505956.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1505956.c 2012-02-22 14:45:17.000000000 +0000 @@ -6,7 +6,7 @@ #include -#if defined SDCC_mcs51 || defined SDCC_ds390 +#if defined __SDCC_mcs51 || defined __SDCC_ds390 #define TEST_MACRO_20() { \ /*this macro has 20 instructions in it*/ \ @@ -145,3 +145,4 @@ { ASSERT(bug3407279(0) == 0); } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1509084.c sdcc-3.2.0+dfsg/support/regression/tests/bug1509084.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1509084.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1509084.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,7 +4,7 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif @@ -43,3 +43,4 @@ leds_name_repaint(); ASSERT(aa == 17); } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1535242.c sdcc-3.2.0+dfsg/support/regression/tests/bug1535242.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1535242.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1535242.c 2012-02-22 14:45:17.000000000 +0000 @@ -2,7 +2,7 @@ */ #include -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) #include <8052.h> #include @@ -22,7 +22,7 @@ void testSaveBits (void) { -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) //enable the interrupt and set it ET2 = 1; EA = 1; @@ -44,7 +44,7 @@ #endif } -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) void T2_isr (void) __interrupt 5 __using 2 { @@ -54,3 +54,4 @@ manipulate_bits (true); } #endif + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1546986.c sdcc-3.2.0+dfsg/support/regression/tests/bug1546986.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1546986.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1546986.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,7 +4,7 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1565152.c sdcc-3.2.0+dfsg/support/regression/tests/bug1565152.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1565152.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1565152.c 2012-02-22 14:45:17.000000000 +0000 @@ -7,7 +7,7 @@ // no need to call this, it generates compiler error for xstack-auto // error 9: FATAL Compiler Internal Error -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) #include <8051.h> unsigned int foo(void) diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1678803.c sdcc-3.2.0+dfsg/support/regression/tests/bug1678803.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1678803.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1678803.c 2012-02-22 14:45:17.000000000 +0000 @@ -11,14 +11,14 @@ { } -#ifdef SDCC_mcs51 +#ifdef __SDCC_mcs51 func GetFunc(void) __naked { __asm ; some assembler code mov dptr,#_foo -#ifdef SDCC_MODEL_HUGE +#ifdef __SDCC_MODEL_HUGE mov B,#_foo>>16 ljmp __sdcc_banked_ret #else @@ -30,7 +30,7 @@ void testCaller(void) { -#ifdef SDCC_mcs51 +#ifdef __SDCC_mcs51 GetFunc()(); #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1712928.c sdcc-3.2.0+dfsg/support/regression/tests/bug1712928.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1712928.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1712928.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,12 +4,12 @@ #include -#if defined (SDCC_mcs51) +#if defined (__SDCC_mcs51) unsigned char NakedFunc(void) __naked { __asm mov dpl,#0x01 -#if defined (SDCC_MODEL_HUGE) +#if defined (__SDCC_MODEL_HUGE) ljmp __sdcc_banked_ret #else ret @@ -21,7 +21,7 @@ void testBug(void) { -#if defined (SDCC_mcs51) +#if defined (__SDCC_mcs51) unsigned char hsum, sum; hsum = NakedFunc(); diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1723128.c sdcc-3.2.0+dfsg/support/regression/tests/bug1723128.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1723128.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1723128.c 2012-05-18 17:15:09.000000000 +0000 @@ -4,7 +4,7 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif @@ -29,7 +29,7 @@ unsigned char CRC; // 10 } AUTOCAL_CFG; -#ifndef SDCC_hc08 +#if !defined(__SDCC_hc08) && !defined(__SDCC_s08) __code __at (0x8000) AUTOCAL_CFG AutoCal_CFG = {0}; #else /* The "__at (0x8000)" is suppressed on the hc08 to avoid */ diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1734654.c sdcc-3.2.0+dfsg/support/regression/tests/bug1734654.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1734654.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1734654.c 2012-02-22 14:45:17.000000000 +0000 @@ -2,7 +2,7 @@ */ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1738367.c sdcc-3.2.0+dfsg/support/regression/tests/bug1738367.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1738367.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1738367.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,7 +4,7 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1745717.c sdcc-3.2.0+dfsg/support/regression/tests/bug1745717.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1745717.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1745717.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,7 +4,7 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1788177.c sdcc-3.2.0+dfsg/support/regression/tests/bug1788177.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1788177.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1788177.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,7 +4,7 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1810965.c sdcc-3.2.0+dfsg/support/regression/tests/bug1810965.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1810965.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1810965.c 2011-12-27 19:41:39.000000000 +0000 @@ -0,0 +1,50 @@ +/* + bug1810965.c +*/ + +#include + +/* bug 1810965 */ +typedef union data_packet +{ + struct + { + enum + { + READ_VERSION = 0x00, + RESET = 0xFF + }cmd; + }t; +} data_packet; + +data_packet dataPacket; + +void bug1810965(void) +{ + switch(dataPacket.t.cmd) + { + case READ_VERSION: //error 20: Undefined identifier 'READ_VERSION' + //error 62: 'case' expression not constant. Statement ignored + break; + } +} + +/* bug 2698805 */ +static void foo(void) +{ + enum foo_tag { e_foo }; + volatile unsigned char a = e_foo; +} + +static void bar(void) +{ + enum foo_tag { e_foo }; //error 163: duplicate enum member 'e_foo' + //error 0: Duplicate symbol 'e_foo', symbol IGNORED + //error 51: typedef/enum 'foo_tag' duplicate. Previous definiton Ignored + volatile unsigned char a = e_foo; +} + +void testBug(void) +{ + ASSERT(1); +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1921073.c sdcc-3.2.0+dfsg/support/regression/tests/bug1921073.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1921073.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1921073.c 2012-02-22 14:45:17.000000000 +0000 @@ -10,7 +10,7 @@ unsigned long v = (unsigned long)p; c; v; -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) ASSERT ((unsigned char)(v >> 16) == 0x80); #endif } @@ -20,7 +20,7 @@ { unsigned long v = (unsigned long)p; v; -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) ASSERT ((unsigned char)(v>>16)==0x80); #endif } @@ -31,3 +31,4 @@ f1(5, (__code void *)0x1234); f2((__code void *)0x1234); } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug1938300.c sdcc-3.2.0+dfsg/support/regression/tests/bug1938300.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug1938300.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug1938300.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,7 +4,7 @@ #include -#if (defined PORT_HOST) || defined (SDCC_STACK_AUTO) +#if (defined PORT_HOST) || defined (__SDCC_STACK_AUTO) /***************************************************************************** * Product; Jongle Reconfigurable USB hardware diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug2077267.c sdcc-3.2.0+dfsg/support/regression/tests/bug2077267.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug2077267.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug2077267.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,7 +4,7 @@ #include -#ifndef SDCC +#ifndef __SDCC #define __critical #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug2094505.c sdcc-3.2.0+dfsg/support/regression/tests/bug2094505.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug2094505.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug2094505.c 2012-02-22 14:45:17.000000000 +0000 @@ -7,7 +7,7 @@ void testBug(void) { -#if !defined(SDCC) || !defined(SDCC_mcs51) || defined(SDCC_MODEL_LARGE) +#if !defined(__SDCC) || !defined(__SDCC_mcs51) || defined(__SDCC_MODEL_LARGE) // varA has to be declared for the bug to manifest itself volatile char varA[256] = {0}; volatile unsigned int varB = 0x1; diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug2655200.c sdcc-3.2.0+dfsg/support/regression/tests/bug2655200.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug2655200.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug2655200.c 2012-02-22 14:45:17.000000000 +0000 @@ -13,7 +13,7 @@ #include char thing; -#if defined (SDCC_mcs51) || defined (SDCC_ds390) +#if defined (__SDCC_mcs51) || defined (__SDCC_ds390) __code char thing_code = 0; __data char thing_data; __idata char thing_idata; @@ -25,7 +25,7 @@ const char * __code test_array[] = { &thing -#if defined (SDCC_mcs51) || defined (SDCC_ds390) +#if defined (__SDCC_mcs51) || defined (__SDCC_ds390) , &thing_code , &thing_data, &thing_idata, &thing_xdata, &thing_pdata , thing_apdata, (char *)thing_apdata @@ -34,7 +34,7 @@ const char *gime_thing() { return &thing; } -#if defined (SDCC_mcs51) || defined (SDCC_ds390) +#if defined (__SDCC_mcs51) || defined (__SDCC_ds390) const char *gime_thing_code() { return &thing_code; } const char *gime_thing_data() { return &thing_data; } const char *gime_thing_idata() { return &thing_idata; } @@ -49,7 +49,7 @@ { ASSERT(test_array[0] == gime_thing()); -#if defined (SDCC_mcs51) || defined (SDCC_ds390) +#if defined (__SDCC_mcs51) || defined (__SDCC_ds390) ASSERT(test_array[1] == gime_thing_code()); ASSERT(test_array[2] == gime_thing_data()); ASSERT(test_array[3] == gime_thing_idata()); diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug2686159.c sdcc-3.2.0+dfsg/support/regression/tests/bug2686159.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug2686159.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug2686159.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,7 +4,7 @@ #include -#ifdef SDCC_pic16 +#ifdef __SDCC_pic16 # define ADDRESS(x) (0x02 ## x) #else # define ADDRESS(x) (0xCA ## x) @@ -30,7 +30,7 @@ void testBug(void) { -#ifdef SDCC +#ifdef __SDCC REG_1 = 0x40; incorrect(); ASSERT (REG_1 == 0x43); diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug2719592.c sdcc-3.2.0+dfsg/support/regression/tests/bug2719592.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug2719592.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug2719592.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,17 +4,13 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif #include -#ifndef BOOL -#define BOOL bool -#endif - -BOOL foo(char i, BOOL bv) +bool foo(char i, bool bv) { bv &= (i == 1); return bv; diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug2729218.c sdcc-3.2.0+dfsg/support/regression/tests/bug2729218.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug2729218.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug2729218.c 2012-02-22 14:45:17.000000000 +0000 @@ -29,7 +29,11 @@ unsigned char input_cnt; }; +#ifndef __SDCC_gbz80 #define ig (*(__idata struct iglobals *) 0xf0) +#else +struct iglobals ig; +#endif unsigned char count; @@ -47,7 +51,7 @@ void testBug(void) { -#ifdef SDCC +#ifdef __SDCC ig.rx_byte = 0; ig.input_cnt = 1; diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug2761883.c sdcc-3.2.0+dfsg/support/regression/tests/bug2761883.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug2761883.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug2761883.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,7 +4,7 @@ #include -#ifdef SDCC_STACK_AUTO +#ifdef __SDCC_STACK_AUTO #define __xdata #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug2805333.c sdcc-3.2.0+dfsg/support/regression/tests/bug2805333.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug2805333.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug2805333.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,22 +4,18 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif #include -#ifndef BOOL -#define BOOL bool -#endif - void g(char c) { c; } -BOOL b; +bool b; void test_bug(void) { diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug2862308.c sdcc-3.2.0+dfsg/support/regression/tests/bug2862308.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug2862308.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug2862308.c 2012-01-04 08:48:57.000000000 +0000 @@ -0,0 +1,54 @@ +/* + bug2862308.c +*/ + +#include + +char case1(void) +{ + char j = 0; + char *z = &j; + + j = 1; + + if (j) + return 1; + else + return 0; /* We incorrectly end up here when using '*z' instead of '*(char *) &j'. */ +} + +char case2(void) +{ + char j = 0; + char *z = &j; + + j = 1; + + if (*(char *) &j) /* Does *not* work with: + * sdcc -mmcs51 --model-large sample.c */ + return 1; + else + return 0; /* We incorrectly end up here when using '*z' instead of '*(char *) &j'. */ +} + +char case3(void) +{ + char j = 0; + char *z = &j; + + j = 1; + + if (*z) /* Does *not* work with: + * sdcc -mmcs51 --model-large sample.c + * sdcc -mmcs51 sample.c */ + return 1; + else + return 0; /* We incorrectly end up here when using '*z' instead of '*(char *) &j'. */ +} + +void testBug(void) +{ + ASSERT(case1()); + ASSERT(case2()); + ASSERT(case3()); +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug2935162.c sdcc-3.2.0+dfsg/support/regression/tests/bug2935162.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug2935162.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug2935162.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,59 @@ +/* + bug2935162.c +*/ + +#pragma disable_warning 184 + +#include +#include + +#if defined(__STDC_VERSION__) +# if (__STDC_VERSION__ >= 199901L) +# define IS_C99 +# endif +#endif + +const float a[] = +{ + LONG_MAX, /* .byte #0x00,#0x00,#0x00,#0x4F ; +2.147484e+09 */ + LONG_MIN, /* .byte #0x00,#0x00,#0x00,#0x4F ; +2.147484e+09 ? */ + + 12345678901, /* .byte #0x00,#0x00,#0x80,#0x4F ; +4.294967e+09 */ + -12345678901, /* .byte #0x00,#0x00,#0x80,#0x3F ; +1.000000e+00 ? */ + + 12345678901L, /* .byte #0x00,#0x00,#0x00,#0x4F ; +2.147484e+09 */ + -12345678901L, /* .byte #0x00,#0x00,#0x00,#0xCF ; -2.147484e+09 */ + + 2147483647L, /* .byte #0x00,#0x00,#0x00,#0x4F ; +2.147484e+09 */ +#ifdef IS_C99 + -2147483648L, /* .byte #0x00,#0x00,#0x00,#0xCF ; -2.147484e+09 */ +#else + -2147483647L-1, /* .byte #0x00,#0x00,#0x00,#0xCF ; -2.147484e+09 */ +#endif + ULONG_MAX, /* .byte #0x00,#0x00,#0x80,#0x4F ; +4.294967e+09 */ + 1.0, /* .byte #0x00,#0x00,#0x80,#0x3F ; +1.000000e+00 */ + + 0.0, /* .byte #0x00,#0x00,#0x00,#0x00 ; +0.000000e+00 */ + -0.0 /* .byte #0x00,#0x00,#0x00,#0x80 ; -0.000000e+00 */ +}; + +void testBug (void) +{ + volatile int right; + + right = -120; + +/* These first two tests assume LONG_MAX and LONG_MIN are 32-bit. This */ +/* is not true for some 64-bit host compilers. Check SDCC only. */ +#ifdef __SDCC + ASSERT(a[0] > +2.1e9 && a[0] < +2.2e9); + ASSERT(a[1] < -2.1e9 && a[1] > -2.2e9); +#endif + ASSERT(a[2] > +2.1e9); + ASSERT(a[3] < -2.1e9); + ASSERT(a[4] > +2.1e9); + ASSERT(a[5] < -2.1e9); + ASSERT(a[6] > +2.1e9); + ASSERT(a[7] < -2.1e9); + ASSERT(a[8] > +4.2e9); +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug2942343.c sdcc-3.2.0+dfsg/support/regression/tests/bug2942343.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug2942343.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug2942343.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,23 @@ +/* + bug2942343.c + */ +#pragma std_sdcc99 + +#include + +const unsigned char x[3] = {255, 256, 257}; //gives a warning about out-of-range values. + unsigned char y[3] = {255, 256, 257}; //does not. + +const _Bool foo[4] = {1, 2, 3, 4}; //creates an array of 4 _Bools which all have the value true. + _Bool bar[4] = {1, 2, 3, 4}; //creates an array with true in foo[0], but 2,3,4 in the rest. + +void testBug(void) +{ +/* Test fails on big endian hosts that use a _Bool larger than char */ +/* (for example, Mac PPC), so just skip this test for non-SDCC */ +#ifdef __SDCC + ASSERT(1 == *(char*)(&foo[1])); + ASSERT(1 == *(char*)(&bar[2])); +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3004918.c sdcc-3.2.0+dfsg/support/regression/tests/bug3004918.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3004918.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3004918.c 2012-02-22 14:45:17.000000000 +0000 @@ -5,7 +5,7 @@ #include #include -#ifdef SDCC_STACK_AUTO +#ifdef __SDCC_STACK_AUTO #define XDATA #else #define XDATA __xdata diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3027957.c sdcc-3.2.0+dfsg/support/regression/tests/bug3027957.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3027957.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3027957.c 2012-02-22 14:45:17.000000000 +0000 @@ -17,7 +17,7 @@ void testBug(void) { -#ifdef SDCC +#ifdef __SDCC foo(); ASSERT (*(unsigned char __xdata *)(0xF064) == 0x12); #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3037889.c sdcc-3.2.0+dfsg/support/regression/tests/bug3037889.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3037889.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3037889.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,7 +4,7 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma disable_warning 88 //no warning about casting LITERAL value to 'generic' pointer #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3223041.c sdcc-3.2.0+dfsg/support/regression/tests/bug3223041.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3223041.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3223041.c 2012-05-19 07:51:05.000000000 +0000 @@ -4,33 +4,29 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif #include -#ifndef BOOL -#define BOOL bool -#endif - -#ifdef SDCC_hc08 +#if 0 #define CAST(x) (x ? true : false) #else #define CAST(x) (x) #endif -BOOL and(BOOL a, BOOL b, BOOL c, BOOL d) +bool and(bool a, bool b, bool c, bool d) { return a & b & c & d; } -BOOL or(BOOL a, BOOL b, BOOL c, BOOL d) +bool or(bool a, bool b, bool c, bool d) { return a | b | c | d; } -BOOL xor(BOOL a, BOOL b, BOOL c, BOOL d) +bool xor(bool a, bool b, bool c, bool d) { return a ^ b ^ c ^ d; } diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3290691.c sdcc-3.2.0+dfsg/support/regression/tests/bug3290691.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3290691.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3290691.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,17 +4,13 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif #include -#ifndef BOOL -#define BOOL bool -#endif - -BOOL foo_b(BOOL b) +bool foo_b(bool b) { return !b; } @@ -29,7 +25,7 @@ return !c; } -BOOL bar_b(BOOL c) +bool bar_b(bool c) { return foo_c(c); } diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3379723.c sdcc-3.2.0+dfsg/support/regression/tests/bug3379723.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3379723.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3379723.c 2012-05-18 16:39:12.000000000 +0000 @@ -4,7 +4,7 @@ #include -#if !defined(PORT_HOST) && !defined(SDCC_hc08) +#if !defined(PORT_HOST) && !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_gbz80) #define UCHAR unsigned char diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3381400.c sdcc-3.2.0+dfsg/support/regression/tests/bug3381400.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3381400.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3381400.c 2012-02-22 14:45:17.000000000 +0000 @@ -10,7 +10,7 @@ #define USHORT unsigned short #define PCHAR unsigned char * -#ifdef SDCC_z80 +#ifdef __SDCC_z80 __sfr __at 0x05 rSRAM_Page; #endif @@ -51,7 +51,7 @@ for (i = 0; i < BUF_PAGE_NUM+2; i ++) { } -#ifdef SDCC_z80 +#ifdef __SDCC_z80 rSRAM_Page = DEFAULT_MEMORY_PAGE; #endif } diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3389647.c sdcc-3.2.0+dfsg/support/regression/tests/bug3389647.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3389647.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3389647.c 2012-02-22 14:45:17.000000000 +0000 @@ -5,7 +5,7 @@ #include -#if defined (SDCC) +#if defined (__SDCC) #pragma disable_warning 196 //no warning about pointer const qualifier (W_TARGET_LOST_QUALIFIER) #include /* just to get _STATMEM */ #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3403429.c sdcc-3.2.0+dfsg/support/regression/tests/bug3403429.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3403429.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3403429.c 2012-02-19 07:01:11.000000000 +0000 @@ -58,11 +58,9 @@ Sub_9000(); -#ifdef PORT_HOST for(i = 1; i <= 4; i++) { ASSERT(C[i][1] == 0); ASSERT(C[i][2] == 0); } -#endif } diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3404101.c sdcc-3.2.0+dfsg/support/regression/tests/bug3404101.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3404101.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3404101.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,7 +4,7 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_c99 #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3410620.c sdcc-3.2.0+dfsg/support/regression/tests/bug3410620.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3410620.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3410620.c 2012-02-22 14:45:17.000000000 +0000 @@ -7,7 +7,7 @@ #define INTREGBANK {bank} -#if defined(SDCC_mcs51) || defined (SDCC_ds390) +#if defined(__SDCC_mcs51) || defined (__SDCC_ds390) void handler1(void) __using(INTREGBANK) { diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3440327.c sdcc-3.2.0+dfsg/support/regression/tests/bug3440327.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3440327.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3440327.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,69 @@ +/* + bug3440327.c + */ + +#include +#include + +#if defined(__SDCC_mcs51) || defined(__SDCC_z80) || defined(__PORT_HOST) + +jmp_buf b; + +#define DIM 2 +typedef struct +{ + char id; + int (*f)(char c); +} fstruct; + +int j; + +int fnct(char c) +{ + static int i; + i = i + c + 1; + if (i == 4) + { + j = 42; + longjmp (b, 0); + } + return 0; +} + +fstruct tab[DIM]={{2, fnct}, {3, 0}}; + +int bug(void) +{ + register fstruct *dt = tab; + char val; + + while (dt < tab+DIM) + { + val = 0; + while (val < dt->id) + { + (dt->f)(val); /* Wrong pointer used here */ + } + ++dt; + } + + return 0; +} + +#endif + +void testBug (void) +{ +#if defined(__SDCC_mcs51) || defined(__SDCC_z80) || defined(__PORT_HOST) + if (setjmp (b)) + { + ASSERT (j == 42); + } + else + { + bug (); + ASSERT (0); + } +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3444293.c sdcc-3.2.0+dfsg/support/regression/tests/bug3444293.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3444293.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3444293.c 2011-12-03 14:39:33.000000000 +0000 @@ -0,0 +1,23 @@ +/* + bug3444293.c +*/ + +#include + +void __code* s[3]; + +void f(void) +{ + s[0] = 0; + s[1] = 0; // Access to s is off by one byte here. +} + +void testBug(void) +{ + s[0] = (void __code*)(0xffff); + s[1] = (void __code*)(0xffff); + f(); + ASSERT(!s[0]); + ASSERT(!s[1]); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3474855.c sdcc-3.2.0+dfsg/support/regression/tests/bug3474855.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3474855.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3474855.c 2012-01-18 08:21:04.000000000 +0000 @@ -0,0 +1,25 @@ +/* + bug3474855.c +*/ + +#include + +float mult(float x) +{ + return 0.8 * x; +} + +void +testBug (void) +{ + unsigned char i = 64; + float result = 1e-38; + + do + { + ASSERT (result < 1.5e-38); + result = mult(result); //make denormalized float + } + while (--i); + ASSERT (result < 1e-44); +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3475630.c sdcc-3.2.0+dfsg/support/regression/tests/bug3475630.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3475630.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3475630.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,137 @@ +/* + bug3475630.c + + Register allocator allocated variable to iy, which is needed for stack access when accessing local variables unreachable by the frame pointer. +*/ + +#include + +#include + +/* + * Raw directory item (32 bytes). + * +*/ +typedef struct { + unsigned char ftype; + unsigned char fname[16]; + unsigned char str_terminator; // 0x0d + unsigned char unused1[2]; + unsigned int fsize; + unsigned int fstrt; + unsigned int fexec; + unsigned char unused2[4]; + unsigned int block; +} FS_MZ_DITEM; + + +/* + * Raw directory sektor. + * + * Has 8 directory items (256 bytes). +*/ +typedef struct { + FS_MZ_DITEM ditem[8]; +} FS_MZ_BLDIR; + + +/* + * Elementary file descriptor + * +*/ +typedef struct { + unsigned char ftype; + unsigned char fname[17]; + unsigned int fsize; + unsigned int fstrt; + unsigned int fexec; + unsigned int block; +} FS_MZ_FHEADER; + + +/* + * Directory handler with cache for 8 file descriptors. + * +*/ +typedef struct { + unsigned char position; + FS_MZ_FHEADER fheader[8]; +} FS_MZDIR; + + +#pragma disable_warning 85 // Unreferenced function arguments in fd_read_sector(), my_strncpy(). +extern char fd_read_sector ( unsigned int block, void* dma ) +{ + unsigned char i; + FS_MZ_BLDIR *bl_dir = dma; + + for(i = 0; i < 8; i++) + { + bl_dir->ditem[i].ftype = i + 0; + bl_dir->ditem[i].fsize = i + 1; + bl_dir->ditem[i].fstrt = i + 2; + bl_dir->ditem[i].fexec = i + 3; + bl_dir->ditem[i].block = i + 4; + } + + return(0); +} + +char* my_strncpy ( char *dst, const char *src, size_t n, char terminator ) +{ + return(0); +} + +/* + * Read raw directory data and transform into FS_MZDIR *dir. + * + */ +char fs_read_directory_block ( FS_MZDIR *dir, unsigned int block ) +{ + char res; +#if defined(__SDCC_mcs51) + static __xdata FS_MZ_BLDIR bl_dir; +#else + FS_MZ_BLDIR bl_dir; +#endif + FS_MZ_DITEM *dir_item; + FS_MZ_FHEADER *fil_header; + unsigned char i; + + res = fd_read_sector ( block, &bl_dir ); + if ( res ) return ( res ); + + for ( i = 0; i < 8; i++ ) { + + dir_item = &bl_dir.ditem[i]; + fil_header = &dir->fheader[i]; + + fil_header->ftype = dir_item->ftype; + fil_header->fsize = dir_item->fsize; + fil_header->fstrt = dir_item->fstrt; + fil_header->fexec = dir_item->fexec; + fil_header->block = dir_item->block; + + my_strncpy ( fil_header->fname, dir_item->fname, sizeof ( fil_header->fname ), 0x0d ); + }; + + return ( 0 ); +} + +__xdata FS_MZDIR dir; + +void testBug(void) +{ + unsigned char i; + + fs_read_directory_block(&dir, 0); + + for(i = 0; i < 8; i++) + { + ASSERT(dir.fheader[i].ftype == i + 0); + ASSERT(dir.fheader[i].fsize == i + 1); + ASSERT(dir.fheader[i].fstrt == i + 2); + ASSERT(dir.fheader[i].fexec == i + 3); + ASSERT(dir.fheader[i].block == i + 4); + } +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3475656.c sdcc-3.2.0+dfsg/support/regression/tests/bug3475656.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3475656.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3475656.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,73 @@ +/* + bug3475656.c + + Digits in output were reversed (e.g. 192 was written as "291"). +*/ + +#include + +#ifdef __SDCC +#pragma disable_warning 85 +#endif + +#define UCHAR unsigned char +#define USHORT unsigned short +#define PCHAR unsigned char * + +UCHAR mod_16x8(USHORT s16, UCHAR i8) +{ + return(s16 % i8); +} + +USHORT div_16x8(USHORT s16, UCHAR i8) +{ + return(s16 / i8); +} + +#if 0 +void itoa(USHORT sVal, PCHAR pBuf, UCHAR iRadix) +{ + PCHAR p; // pointer to traverse string + PCHAR pFirstDigit; // pointer to first digit + UCHAR iTmp; // temp UCHAR + + p = pBuf; + pFirstDigit = p; // save pointer to first digit + + do + { + iTmp = mod_16x8(sVal, iRadix); + sVal = div_16x8(sVal, iRadix); + + // convert to ascii and store + *p++ = (iTmp > 9) ? iTmp - 10 + 'A' : iTmp + '0'; // a letter or a digit + } while (sVal > 0); + + // We now have the digit of the number in the buffer, but in reverse order. Thus we reverse them now. + + *p-- = '\0'; // terminate string; p points to last digit + + do + { + iTmp = *p; + *p = *pFirstDigit; + *pFirstDigit = iTmp; // swap *p and *pFirstDigit + --p; + ++pFirstDigit; // advance to next two digits + } while (pFirstDigit < p); // repeat until halfway +} +#endif + +void testBug(void) +{ + unsigned char c[8]; + unsigned short i; + + i = 192; +#if 0 + itoa(i, c, 10); + ASSERT(c[0] == '1'); + ASSERT(c[1] == '9'); + ASSERT(c[2] == '2'); +#endif +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3475990.c sdcc-3.2.0+dfsg/support/regression/tests/bug3475990.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3475990.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3475990.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,42 @@ +/* Due to the specific structure of the control-flow graph there was a segmentation fault in iCode generatuion. */ + +#include + +void set_b(void) +{ +} + +#if defined(__SDCC) +__addressmod set_b b; +#else +#define b +#endif + +int a0, a1, a2; +b int b0; +int b2, b1; +int x0, x1; + +int f(void) +{ + switch(x0) + { + case 0: + if(a0 && b0) + { + } + else + { + x0++; + } + return(b2); + default: + return(x1); + } + return(a2); +} + +void testBug(void) +{ +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3480545.c sdcc-3.2.0+dfsg/support/regression/tests/bug3480545.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3480545.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3480545.c 2012-01-28 13:26:16.000000000 +0000 @@ -0,0 +1,40 @@ +/* + bug3480545.c +*/ + +#include + +unsigned char var = 1; + +char do_switch(void) +{ + switch( var ) + { + case 0 : return 0; + case 1 : return 1; + case 2 : return 2; + case 3 : return 3; + case 4 : return 3; + case 5 : return 3; + case 6 : return 3; + case 7 : return 3; + case 8 : return 0; + case 9 : return 1; + case 10 : return 2; + case 11 : return 3; + case 12 : return 3; + case 13 : return 3; + case 14 : return 3; + case 15 : return 3; + case 16 : return 3; + case 17 : return 3; + } + + return 0; +} + +void +testBug (void) +{ + ASSERT (do_switch() == 1); +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3482146.c sdcc-3.2.0+dfsg/support/regression/tests/bug3482146.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3482146.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3482146.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,26 @@ +/* + Bug #3482146. +*/ + +#include + +void +testBug(void) +{ +#if !defined(__SDCC_mcs51) + unsigned char buff[176]; + unsigned char i; + for(i = 0; i < 22*8; ++i) + buff[i] = 0xff; + buff[0] = buff[1] = 0x42; + i = buff[0] - buff[1]; // The bug doesn't occur if you just use "i=0;" + + buff[88 + i] = buff[16 + i]; + + buff[8 + i] = buff[i] >> 1; + buff[16 + i] = buff[8+i] >> 1; // This operation will not write into the right memory address + + ASSERT(buff[16] == 0x10); +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3482217.c sdcc-3.2.0+dfsg/support/regression/tests/bug3482217.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3482217.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3482217.c 2012-02-05 23:57:16.000000000 +0000 @@ -0,0 +1,21 @@ +/* + bug3482217.c +*/ + +#include + +unsigned char *p; + +void f() +{ + *p++ = 0; +} + +void testBug(void) +{ + unsigned char a[2]; + p = a; + f(); + ASSERT(p == a + 1); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3482753.c sdcc-3.2.0+dfsg/support/regression/tests/bug3482753.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3482753.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3482753.c 2012-02-21 06:56:07.000000000 +0000 @@ -0,0 +1,24 @@ +/* + bug3482753.c +*/ + +#include + +struct {char a;} x; +volatile char d = 7; + +int f(void) +{ + char t = d; + + x.a = t; + t = x.a + 2; + d = t; + t = x.a + 3; /* bug: x.a was optimized to t, dispite redefinition of t */ + return t; +} + +void testBug(void) +{ + ASSERT(f() == 10); +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3501942.c sdcc-3.2.0+dfsg/support/regression/tests/bug3501942.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3501942.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3501942.c 2012-03-11 18:56:50.000000000 +0000 @@ -0,0 +1,26 @@ +/* bug3501942, an issue with operandsNotrelated() in peepholes for z80-related ports. + */ + +#include +#include + +int value; + +int f(void) +{ + return 1; +} + +void g(void) +{ + if (value = f()) /* Bug was triggered here. */ + return; +} + +void testBug(void) +{ + value = 0; + g(); + ASSERT (value == 1); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3502965.c sdcc-3.2.0+dfsg/support/regression/tests/bug3502965.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3502965.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3502965.c 2012-03-14 14:38:57.000000000 +0000 @@ -0,0 +1,73 @@ +/* + bug3502965.c +*/ + +#include + +#ifndef __SDCC_mcs51 +#pragma disable_warning 85 + +#define UCHAR unsigned char +#define USHORT unsigned short +#define PCHAR unsigned char * +#define HW_ALEN 6 +#define IP_ALEN 4 + +typedef struct _PACKET_LIST PACKET_LIST; +struct _PACKET_LIST +{ + PACKET_LIST * next; + USHORT sLen; + USHORT sAddr; + UCHAR pRecvIP[IP_ALEN]; +}; + +void memcpy4(PCHAR dst) {} + +#define EP_TYPE (HW_ALEN + HW_ALEN) +#define EP_DATA (EP_TYPE + 2) +#define IP_DATA 20 +#define ETHERNET_MAX_SIZE 1514 +#define IP_DATA_MAX_SIZE (ETHERNET_MAX_SIZE - EP_DATA - IP_DATA) +UCHAR Adapter_pPacketBuf[ETHERNET_MAX_SIZE + 1 + IP_DATA_MAX_SIZE + 1]; +#define Adapter_pReceivePacket (PCHAR)(Adapter_pPacketBuf + ETHERNET_MAX_SIZE + 1) + +#define TCP_OFFSET 12 +PCHAR _pReceive; +UCHAR _pReceiveIP[IP_ALEN]; +USHORT _sReceiveDataLen; + +void TcpRun(PACKET_LIST * p) +{ + UCHAR iHeadLen; + USHORT sLen; + PCHAR pRecvIP; + + sLen = p->sLen; + + _pReceive = Adapter_pReceivePacket; + + memcpy4(_pReceiveIP); + + // check if packet length is valid + iHeadLen = (_pReceive[TCP_OFFSET] & 0xf0) >> 2; + if (sLen < iHeadLen) + { + return; + } + _sReceiveDataLen = sLen - iHeadLen; +} +#endif + +void testBug(void) +{ +#ifndef __SDCC_mcs51 + PACKET_LIST pl; + pl.sLen = 0xff; + (Adapter_pReceivePacket)[TCP_OFFSET] = 0x00; + _sReceiveDataLen = 0xaa55; + TcpRun(&pl); + ASSERT(_sReceiveDataLen == 0xff); +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3521024.c sdcc-3.2.0+dfsg/support/regression/tests/bug3521024.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3521024.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3521024.c 2012-05-17 09:57:34.000000000 +0000 @@ -0,0 +1,408 @@ +#include + +struct cvu_huffman_node +{ + unsigned char left; /* Position of left node in tree or character. */ + unsigned char right; /* Position of right node in tree or character. */ +}; + +struct cvu_huffman_state +{ + unsigned char (*input)(void); + const struct cvu_huffman_node *nodes; /* Array of nodes */ + unsigned char root; /* Position of root node among nodes */ + unsigned char ls, bs, rs; + unsigned char bit; /* Position of currently processed bit */ + unsigned char buffer; /* Currently processed input byte */ + unsigned char current; /* Currently processed node */ +}; + +const unsigned char HUFFMAN_ROOT = 124; +const unsigned char HUFFMAN_LS = 125, HUFFMAN_BS = 127, HUFFMAN_RS = 253; +const struct cvu_huffman_node huffman_tree[255] = { + +/* Node 0 */ {128, 129}, +/* Node 1 */ {130, 131}, +/* Node 2 */ {132, 133}, +/* Node 3 */ {134, 135}, +/* Node 4 */ {136, 137}, +/* Node 5 */ {138, 139}, +/* Node 6 */ {140, 141}, +/* Node 7 */ {142, 143}, +/* Node 8 */ {144, 145}, +/* Node 9 */ {146, 147}, +/* Node 10 */ {148, 149}, +/* Node 11 */ {150, 151}, +/* Node 12 */ {152, 153}, +/* Node 13 */ {154, 155}, +/* Node 14 */ {156, 157}, +/* Node 15 */ {158, 159}, +/* Node 16 */ {160, 161}, +/* Node 17 */ {162, 163}, +/* Node 18 */ {164, 165}, +/* Node 19 */ {166, 167}, +/* Node 20 */ {168, 169}, +/* Node 21 */ {170, 171}, +/* Node 22 */ {172, 173}, +/* Node 23 */ {174, 175}, +/* Node 24 */ {176, 177}, +/* Node 25 */ {178, 179}, +/* Node 26 */ {180, 181}, +/* Node 27 */ {182, 183}, +/* Node 28 */ {184, 185}, +/* Node 29 */ {186, 187}, +/* Node 30 */ {188, 189}, +/* Node 31 */ {190, 191}, +/* Node 32 */ {192, 193}, +/* Node 33 */ {194, 195}, +/* Node 34 */ {196, 197}, +/* Node 35 */ {198, 199}, +/* Node 36 */ {200, 201}, +/* Node 37 */ {202, 203}, +/* Node 38 */ {204, 205}, +/* Node 39 */ {206, 207}, +/* Node 40 */ {208, 209}, +/* Node 41 */ {210, 211}, +/* Node 42 */ {212, 213}, +/* Node 43 */ {214, 215}, +/* Node 44 */ {216, 217}, +/* Node 45 */ {218, 219}, +/* Node 46 */ {220, 221}, +/* Node 47 */ {222, 223}, +/* Node 48 */ {224, 225}, +/* Node 49 */ {226, 227}, +/* Node 50 */ {228, 229}, +/* Node 51 */ {230, 231}, +/* Node 52 */ {232, 233}, +/* Node 53 */ {234, 235}, +/* Node 54 */ {236, 237}, +/* Node 55 */ {238, 239}, +/* Node 56 */ {240, 241}, +/* Node 57 */ {242, 243}, +/* Node 58 */ {244, 245}, +/* Node 59 */ {246, 247}, +/* Node 60 */ {248, 249}, +/* Node 61 */ {125, 0}, +/* Node 62 */ {1, 2}, +/* Node 63 */ {3, 4}, +/* Node 64 */ {5, 6}, +/* Node 65 */ {7, 8}, +/* Node 66 */ {9, 10}, +/* Node 67 */ {11, 12}, +/* Node 68 */ {13, 14}, +/* Node 69 */ {15, 16}, +/* Node 70 */ {17, 18}, +/* Node 71 */ {19, 20}, +/* Node 72 */ {21, 22}, +/* Node 73 */ {23, 24}, +/* Node 74 */ {25, 26}, +/* Node 75 */ {27, 28}, +/* Node 76 */ {29, 30}, +/* Node 77 */ {31, 32}, +/* Node 78 */ {33, 34}, +/* Node 79 */ {35, 36}, +/* Node 80 */ {37, 38}, +/* Node 81 */ {39, 40}, +/* Node 82 */ {41, 42}, +/* Node 83 */ {43, 44}, +/* Node 84 */ {45, 46}, +/* Node 85 */ {47, 48}, +/* Node 86 */ {49, 50}, +/* Node 87 */ {51, 52}, +/* Node 88 */ {53, 54}, +/* Node 89 */ {55, 56}, +/* Node 90 */ {57, 58}, +/* Node 91 */ {59, 60}, +/* Node 92 */ {61, 62}, +/* Node 93 */ {63, 64}, +/* Node 94 */ {65, 66}, +/* Node 95 */ {67, 68}, +/* Node 96 */ {69, 70}, +/* Node 97 */ {71, 72}, +/* Node 98 */ {73, 74}, +/* Node 99 */ {75, 76}, +/* Node 100 */ {77, 78}, +/* Node 101 */ {79, 80}, +/* Node 102 */ {81, 82}, +/* Node 103 */ {83, 84}, +/* Node 104 */ {85, 86}, +/* Node 105 */ {87, 88}, +/* Node 106 */ {89, 90}, +/* Node 107 */ {91, 92}, +/* Node 108 */ {93, 94}, +/* Node 109 */ {95, 96}, +/* Node 110 */ {97, 98}, +/* Node 111 */ {99, 100}, +/* Node 112 */ {101, 102}, +/* Node 113 */ {103, 104}, +/* Node 114 */ {105, 106}, +/* Node 115 */ {107, 108}, +/* Node 116 */ {109, 110}, +/* Node 117 */ {111, 112}, +/* Node 118 */ {113, 114}, +/* Node 119 */ {115, 116}, +/* Node 120 */ {117, 118}, +/* Node 121 */ {119, 120}, +/* Node 122 */ {253, 250}, +/* Node 123 */ {251, 252}, +/* Node 124 */ {254, 126}, +/* Node 125 */ {255, 127}, +/* Node 126 */ {170, 123}, +/* Node 127 */ {0, 5}, +/* Node 128 */ {6, 7}, +/* Node 129 */ {8, 9}, +/* Node 130 */ {10, 11}, +/* Node 131 */ {12, 16}, +/* Node 132 */ {17, 18}, +/* Node 133 */ {19, 20}, +/* Node 134 */ {21, 22}, +/* Node 135 */ {23, 24}, +/* Node 136 */ {25, 26}, +/* Node 137 */ {27, 28}, +/* Node 138 */ {29, 30}, +/* Node 139 */ {31, 32}, +/* Node 140 */ {33, 34}, +/* Node 141 */ {35, 36}, +/* Node 142 */ {37, 38}, +/* Node 143 */ {39, 40}, +/* Node 144 */ {41, 42}, +/* Node 145 */ {43, 44}, +/* Node 146 */ {45, 46}, +/* Node 147 */ {47, 48}, +/* Node 148 */ {49, 50}, +/* Node 149 */ {51, 52}, +/* Node 150 */ {53, 54}, +/* Node 151 */ {55, 56}, +/* Node 152 */ {57, 58}, +/* Node 153 */ {59, 60}, +/* Node 154 */ {61, 62}, +/* Node 155 */ {63, 64}, +/* Node 156 */ {65, 66}, +/* Node 157 */ {67, 68}, +/* Node 158 */ {69, 70}, +/* Node 159 */ {71, 72}, +/* Node 160 */ {73, 74}, +/* Node 161 */ {75, 76}, +/* Node 162 */ {77, 78}, +/* Node 163 */ {79, 80}, +/* Node 164 */ {81, 82}, +/* Node 165 */ {83, 84}, +/* Node 166 */ {86, 87}, +/* Node 167 */ {88, 89}, +/* Node 168 */ {90, 91}, +/* Node 169 */ {92, 93}, +/* Node 170 */ {94, 95}, +/* Node 171 */ {96, 97}, +/* Node 172 */ {98, 99}, +/* Node 173 */ {100, 101}, +/* Node 174 */ {102, 103}, +/* Node 175 */ {104, 105}, +/* Node 176 */ {106, 107}, +/* Node 177 */ {108, 109}, +/* Node 178 */ {110, 111}, +/* Node 179 */ {112, 113}, +/* Node 180 */ {114, 115}, +/* Node 181 */ {116, 117}, +/* Node 182 */ {118, 119}, +/* Node 183 */ {120, 121}, +/* Node 184 */ {122, 123}, +/* Node 185 */ {124, 125}, +/* Node 186 */ {126, 127}, +/* Node 187 */ {128, 129}, +/* Node 188 */ {130, 131}, +/* Node 189 */ {132, 133}, +/* Node 190 */ {134, 135}, +/* Node 191 */ {136, 137}, +/* Node 192 */ {138, 139}, +/* Node 193 */ {140, 141}, +/* Node 194 */ {142, 143}, +/* Node 195 */ {144, 145}, +/* Node 196 */ {146, 147}, +/* Node 197 */ {148, 149}, +/* Node 198 */ {150, 151}, +/* Node 199 */ {152, 153}, +/* Node 200 */ {154, 155}, +/* Node 201 */ {156, 157}, +/* Node 202 */ {158, 159}, +/* Node 203 */ {160, 161}, +/* Node 204 */ {162, 163}, +/* Node 205 */ {164, 165}, +/* Node 206 */ {166, 167}, +/* Node 207 */ {168, 169}, +/* Node 208 */ {171, 172}, +/* Node 209 */ {173, 174}, +/* Node 210 */ {175, 176}, +/* Node 211 */ {177, 178}, +/* Node 212 */ {179, 180}, +/* Node 213 */ {181, 182}, +/* Node 214 */ {183, 184}, +/* Node 215 */ {185, 186}, +/* Node 216 */ {187, 188}, +/* Node 217 */ {189, 190}, +/* Node 218 */ {191, 192}, +/* Node 219 */ {193, 194}, +/* Node 220 */ {195, 196}, +/* Node 221 */ {197, 198}, +/* Node 222 */ {199, 200}, +/* Node 223 */ {201, 202}, +/* Node 224 */ {203, 204}, +/* Node 225 */ {205, 206}, +/* Node 226 */ {207, 208}, +/* Node 227 */ {209, 210}, +/* Node 228 */ {211, 212}, +/* Node 229 */ {213, 214}, +/* Node 230 */ {215, 216}, +/* Node 231 */ {217, 218}, +/* Node 232 */ {219, 220}, +/* Node 233 */ {221, 222}, +/* Node 234 */ {223, 224}, +/* Node 235 */ {225, 226}, +/* Node 236 */ {227, 228}, +/* Node 237 */ {229, 230}, +/* Node 238 */ {231, 232}, +/* Node 239 */ {233, 234}, +/* Node 240 */ {235, 236}, +/* Node 241 */ {237, 238}, +/* Node 242 */ {239, 240}, +/* Node 243 */ {241, 242}, +/* Node 244 */ {243, 244}, +/* Node 245 */ {245, 246}, +/* Node 246 */ {247, 248}, +/* Node 247 */ {249, 250}, +/* Node 248 */ {251, 252}, +/* Node 249 */ {253, 254}, +/* Node 250 */ {2, 3}, +/* Node 251 */ {4, 13}, +/* Node 252 */ {14, 15}, +/* Node 253 */ {121, 1}, +/* Node 254 */ {122, 85}}; + +const unsigned char data[] = {72, 60, 102, 102, 123, 15}; +const unsigned char udata[] = {0x01, 0x02, 0x03, 0x04, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x0d, 0x0e, 0x0f}; + +unsigned char get_data(void) +{ + static int i; + return(data[i++]); +} + +unsigned char get_data2(void) +{ + static int i; + return(data[i++]); +} + +unsigned char huffman_recursive(struct cvu_huffman_state *state) +{ + unsigned char direction; + unsigned char ret; + + state->buffer >>= 1; + if(state->bit == 8) + { + state->buffer = (state->input)(); + state->bit = 0; + } + direction = state->buffer & 0x01; + state->bit++; + + if(!direction) /* Left */ + { + if(state->current >= state->ls && state->current < state->rs) + { + ret = state->nodes[state->current].left; + state->current = state->root; + } + else + { + state->current = state->nodes[state->current].left; + ret = huffman_recursive(state); + } + } + else /* Right */ + { + if(state->current >= state->bs) + { + ret = state->nodes[state->current].right; + state->current = state->root; + } + else + { + state->current = state->nodes[state->current].right; + ret = huffman_recursive(state); + } + } + + return(ret); +} + +unsigned char huffman_iterative(struct cvu_huffman_state *state) +{ + unsigned char current; + unsigned char ret; + + current = state->root; + + for(;;) + { + state->buffer >>= 1; + if(state->bit == 8) + { + state->buffer = (state->input)(); + state->bit = 0; + } + state->bit++; + + if(!(state->buffer & 0x01)) /* Left */ + { + if(current >= state->ls && current < state->rs) + { + ret = state->nodes[current].left; + break; + } + + current = state->nodes[current].left; + } + else /* Right */ + { + if(current >= state->bs) + { + ret = state->nodes[current].right; + break; + } + + current = state->nodes[current].right; + } + } + + return(ret); +} + +void init_huffman(struct cvu_huffman_state *state, unsigned char (*input)(void), const struct cvu_huffman_node *tree, unsigned char root, unsigned char ls, unsigned char bs, unsigned char rs) +{ + state->input = input; + state->nodes = tree; + state->root = root; + state->ls = ls; + state->bs = bs; + state->rs = rs; + state->bit = 8; + state->current = state->root; +} + +void testBug(void) +{ + unsigned char i; + struct cvu_huffman_state state; + + init_huffman(&state, &get_data, huffman_tree, HUFFMAN_ROOT, HUFFMAN_LS, HUFFMAN_BS, HUFFMAN_RS); + + for(i = 0; i < 15; i++) + ASSERT(huffman_recursive(&state) == udata[i]); + + init_huffman(&state, &get_data2, huffman_tree, HUFFMAN_ROOT, HUFFMAN_LS, HUFFMAN_BS, HUFFMAN_RS); + + for(i = 0; i < 15; i++) + ASSERT(huffman_iterative(&state) == udata[i]); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug3531687.c sdcc-3.2.0+dfsg/support/regression/tests/bug3531687.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug3531687.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug3531687.c 2012-06-10 12:32:06.000000000 +0000 @@ -0,0 +1,20 @@ +/* + bug3531687.c + + The bug resulted in wrong comparisons of char to bool, casting the char operand to bool. +*/ + +#include + +int f(char a, char flag) +{ + if (a == (flag ? 1 : 0)) + return 0; + return 1; +} + +void +testBug(void) +{ + ASSERT(f(2, 1)); +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug608752.c sdcc-3.2.0+dfsg/support/regression/tests/bug608752.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug608752.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug608752.c 2012-02-22 14:45:17.000000000 +0000 @@ -2,7 +2,7 @@ */ #include -#ifdef SDCC +#ifdef __SDCC #include #else #define _STATMEM diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/bug663539.c sdcc-3.2.0+dfsg/support/regression/tests/bug663539.c --- sdcc-3.1.0+dfsg/support/regression/tests/bug663539.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/bug663539.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,7 +4,7 @@ #include -#if defined (SDCC_ds390) || defined (SDCC_mcs51) +#if defined (__SDCC_ds390) || defined (__SDCC_mcs51) volatile __xdata __at 0x7654 char x; #endif @@ -13,9 +13,10 @@ { ASSERT (1); -#if defined (SDCC_ds390) || defined (SDCC_mcs51) +#if defined (__SDCC_ds390) || defined (__SDCC_mcs51) x; //this should end the simulation while (1); //let the "watchdog" bite #endif } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/constantRange.c sdcc-3.2.0+dfsg/support/regression/tests/constantRange.c --- sdcc-3.1.0+dfsg/support/regression/tests/constantRange.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/constantRange.c 2012-02-22 14:45:17.000000000 +0000 @@ -4,7 +4,7 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/critical.c sdcc-3.2.0+dfsg/support/regression/tests/critical.c --- sdcc-3.1.0+dfsg/support/regression/tests/critical.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/critical.c 2012-02-22 14:45:17.000000000 +0000 @@ -2,7 +2,7 @@ */ #include -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) #include <8052.h> typedef union @@ -29,7 +29,7 @@ void testCritical (void) { -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) big x; unsigned char i; @@ -63,7 +63,7 @@ #endif } -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) void T2_isr (void) __interrupt 5 __using 2 { diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/cse.c sdcc-3.2.0+dfsg/support/regression/tests/cse.c --- sdcc-3.1.0+dfsg/support/regression/tests/cse.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/cse.c 2012-05-18 17:36:32.000000000 +0000 @@ -0,0 +1,403 @@ +/* Test CSE - make sure CSE does not use stale data + + */ + +#include + +/* Need to locate a variable at an absolute address, but without */ +/* the linker's help. Pick an address and address space that is */ +/* likely free based on cpu and compile model. If ABSADDR is */ +/* left undefined, the tests that needs it will be skipped. */ +#if defined(SDCC) || defined(__SDCC) +# if defined(SDCC_mcs51) || defined(__SDCC_mcs51) +# if defined(SDCC_MODEL_LARGE) || defined(__SDCC_MODEL_LARGE) +# define ABSADDRSPACE __xdata +# define ABSADDR 0x8000 +# else +# define ABSADDRSPACE __data +# define ABSADDR 0x70 +# endif +# endif +# if defined(SDCC_ds390) || defined(__SDCC_ds390) +# define ABSADDRSPACE __xdata +# define ABSADDR 0x8000 +# endif +# if defined(SDCC_hc08) || defined(__SDCC_s08) +# define ABSADDRSPACE __xdata +# define ABSADDR 0x7f00 +# endif +# if defined(SDCC_z80) || defined(__SDCC_z80) +# define ABSADDRSPACE __xdata +# define ABSADDR 0x7f00 +# endif +#endif + + +typedef struct { + unsigned char x1; + unsigned char x2; + unsigned char *p; +} packet_t; + +unsigned char gx; +unsigned char *px; + +packet_t gpacket; +#ifdef ABSADDR +# define apacket1 (*((ABSADDRSPACE packet_t *)ABSADDR)) +ABSADDRSPACE packet_t __at ABSADDR apacket2; +#endif + +unsigned char a1,a2,a3,a4,a5; + +void +setgx(unsigned char x) +{ + gx = x; +} + +unsigned char +passthrough(unsigned char i) +{ + return i; +} + +void +zeroAndKeepAddress(unsigned char *p) +{ + px = p; + *p = 0; +} + +void +keepAddressFromPacket(packet_t *pp) +{ + px = pp->p; +} + +void +incIndirect(void) +{ + (*px)++; +} + +packet_t * +getaddrgpacket(void) +{ + return &gpacket; +} + +void +incx1(packet_t *pp) +{ + pp->x1++; +} + +void +incx2(packet_t *pp) +{ + pp->x2++; +} + +void +incgpx1(void) +{ + gpacket.x1++; +} + +/* Be sneaky and define this later so that the addrtaken flag of gx is not */ +/* set until after the test functions are compiled. Not important now, but */ +/* this should remove the temptation to misuse reliance on addrtaken later. */ +unsigned char * getaddrgx(void); + + +/* The ASSERT macro, since it branches based on a condition, will break up a */ +/* extended basic block. So to test for CSE problems within a single EBBlock */ +/* we will save intermediate results in global variables a1..a5 and do all */ +/* of the ASSERTs at the end of the function. For some tests it may make */ +/* more sense to use local variables, but I'm intentionally trying to keep */ +/* register pressure low. */ + +void +test_FuncCall1(void) +{ + unsigned char lx; + + gx = 1; + setgx(2); + /* Cannot CSE global variable assignment across function call */ + a1 = gx; /* ASSERT(gx == 2) */ + + lx = gx; + setgx(3); + /* Cannot CSE global variable read across function call */ + a2 = gx; /* ASSERT(gx == 3) */ + a3 = lx; /* ASSERT(lx == 2) */ + + lx = gx<<1; + a4 = lx; /* ASSERT(lx == 6) */ + setgx(1); + lx = gx<<1; + /* Cannot CSE expression based on global variable across function call */ + a5 = lx; /* ASSERT(lx == 2) */ + + ASSERT(a1 == 2); + ASSERT(a2 == 3); + ASSERT(a3 == 2); + ASSERT(a4 == 6); + ASSERT(a5 == 2); +} + +void +test_FuncCall2(void) +{ + unsigned char lx,ly; + + lx = passthrough(2); + ly = lx<<1; + zeroAndKeepAddress(&lx); + + /* Cannot CSE local variable if a pointer to it was passed as parameter */ + a1 = lx; /* ASSERT(lx == 0) */ + + incIndirect(); + /* Cannot CSE local variable across function call even if its address */ + /* was not a parameter if its address was taken at all */ + a2 = lx; /* ASSERT(lx == 1) */ + + + a3 = ly; /* ASSERT(ly == 4) */ + ly = lx<<1; + /* Cannot CSE expression based on local variable whose address was */ + /* taken across function call */ + a4 = ly; /* ASSERT(ly == 2) */ + + ASSERT(a1 == 0); + ASSERT(a2 == 1); + ASSERT(a3 == 4); + ASSERT(a4 == 2); +} + +void +test_FuncCall3(void) +{ + unsigned char lx,ly; + + lx = passthrough(2); + ly = lx<<1; + px = &lx; + incIndirect(); + /* Cannot CSE local variable across function call if address was taken at all */ + a1 = lx; /* ASSERT(lx == 3) */ + + a2 = ly; /* ASSERT(ly == 4) */ + ly = lx<<1; + /* Cannot CSE expression based on local variable whose address was */ + /* taken across function call */ + a3 = ly; /* ASSERT(ly == 6) */ + + ASSERT(a1 == 3); + ASSERT(a2 == 4); + ASSERT(a3 == 6); +} + +void +test_FuncCall4(void) +{ + packet_t packet1,packet2; + + packet1.p = &packet2.x1; + keepAddressFromPacket(&packet1); + packet2.x1 = 1; + packet2.x2 = 3; + incIndirect(); + /* Cannot CSE members of local variables whose address was taken */ + /* across function call */ + a1 = packet2.x1; /* ASSERT(packet2.x1 == 2) */ + a2 = packet2.x2; /* ASSERT(packet2.x2 == 3) */ + + ASSERT(a1 == 2); + ASSERT(a2 == 3); +} + +void +test_FuncCall5(void) +{ + packet_t *pp; + unsigned char i; + + gpacket.x1 = 1; + gpacket.x2 = 10; + pp = getaddrgpacket(); + + i = pp->x1; + a1 = i; /* ASSERT(i == 1) */ + incx1(pp); + i = pp->x1; + a2 = i; /* ASSERT(i == 2) */ + i = pp->x2; + a3 = i; /* ASSERT(i == 10) */ + incx2(pp); + i = pp->x2; + a4 = i; /* ASSERT(i == 11) */ + + ASSERT(a1 == 1); + ASSERT(a2 == 2); + ASSERT(a3 == 10); + ASSERT(a4 == 11); +} + +void +test_FuncCall6(void) +{ + unsigned char lx; + + lx = passthrough(1); + gpacket.x1 = lx; + incgpx1(); + lx = gpacket.x1; + ASSERT(lx == 2); +} + +/* test_Struct1 through test_Struct4 are checking for cases in which */ +/* operand keys are erroneously equal or unassigned, causing CSE to */ +/* use the wrong substitution. */ +void +test_Struct1(void) +{ + packet_t packet; + unsigned char one; + unsigned char ten; + + one = passthrough(1); + ten = passthrough(10); + + gx = 100; + packet.x1 = one; + packet.x2 = ten; + setgx(packet.x2); + /* CSE of "apacket.x2" allowed above , but make sure it was x2 not x1*/ + ASSERT(gx == 10); +} + +void +test_Struct2(void) +{ + unsigned char one; + unsigned char ten; + + one = passthrough(1); + ten = passthrough(10); + + gx = 100; + gpacket.x1 = one; + gpacket.x2 = ten; + setgx(gpacket.x2); + /* CSE of "apacket.x2" allowed above , but make sure it was x2 not x1*/ + ASSERT(gx == 10); +} + +void +test_Struct3(void) +{ +#ifdef ABSADDR + unsigned char one; + unsigned char ten; + + one = passthrough(1); + ten = passthrough(10); + apacket1.x2 = ten; + + setgx(100); + apacket1.x1 = one; + setgx(apacket1.x2); + /* CSE must not substitute x1 in place of x2 */ + ASSERT(gx == 10); +#endif +} + +void +test_Struct4(void) +{ +#ifdef ABSADDR + unsigned char one; + unsigned char ten; + + one = passthrough(1); + ten = passthrough(10); + apacket2.x2 = ten; + + setgx(100); + apacket2.x1 = one; + setgx(apacket2.x2); + /* CSE must not substitute x1 in place of x2 */ + ASSERT(gx == 10); +#endif +} + +void +test_Struct5(void) +{ +/* ASSERT(a2 == 2) currently fails in this test (2012-02-29) */ +#if 0 + packet_t *pp1; + packet_t *pp2; + unsigned char lx; + + pp1 = getaddrgpacket(); + pp2 = getaddrgpacket(); + + /* Since the declarations of pp1 and pp2 did not use the restrict */ + /* qualifier, the compiler must assume they might point to the */ + /* same object and so should not CSE pointer dereferences across */ + /* other pointer dereferenced assingments of the same type. */ + gpacket.x1 = 0; + pp1->x1 = 1; + lx = pp2->x1; + a1 = lx; + + pp1->x1 = 2; + lx = pp2->x1; + a2 = lx; + + pp2->x1 = 3; + lx = pp1->x1; + a3 = lx; + + ASSERT(a1 == 1); + ASSERT(a2 == 2); + ASSERT(a3 == 3); +#endif +} + +void +test_Global1(void) +{ +/* ASSERT(a2 == 2) currently fails in this test (2012-02-29) */ +#if 0 + unsigned char lx; + unsigned char *px; + + /* Since the declaration of px did not use the restrict */ + /* qualifier, the compiler must assume it might point */ + /* to a global variable and so should not CSE any */ + /* read of or expression using a global variable. */ + gx = 0; + px = getaddrgx(); + lx = gx<<1; + a1 = lx; + *px = 1; + lx = gx<<1; + a2 = lx; + + ASSERT(a1 == 0); + ASSERT(a2 == 2); +#endif +} + +/* Hide taking the address of gx by defining this function last */ +unsigned char +*getaddrgx(void) +{ + return &gx; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/float.c sdcc-3.2.0+dfsg/support/regression/tests/float.c --- sdcc-3.1.0+dfsg/support/regression/tests/float.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/float.c 2012-02-22 14:45:17.000000000 +0000 @@ -21,10 +21,10 @@ #define REVDIV 1 #endif -#ifdef SDCC_mcs51 +#ifdef __SDCC_mcs51 # define STORAGE __xdata # define XDATA __xdata -#elif SDCC_pic16 +#elif __SDCC_pic16 # define STORAGE __code # define XDATA #else diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/float_single.c sdcc-3.2.0+dfsg/support/regression/tests/float_single.c --- sdcc-3.1.0+dfsg/support/regression/tests/float_single.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/float_single.c 2012-05-18 16:46:53.000000000 +0000 @@ -25,9 +25,8 @@ #define TOLERANCE (1e-5) /* now exceptions for targets/functions which would not pass */ -#if defined(SDCC_hc08) +#if defined(__SDCC_hc08) || defined(__SDCC_s08) # define EXPF_DISABLED (1) -# define TANF_DISABLED (1) #endif static float diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/float_trans.c sdcc-3.2.0+dfsg/support/regression/tests/float_trans.c --- sdcc-3.1.0+dfsg/support/regression/tests/float_trans.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/float_trans.c 2012-02-22 14:45:17.000000000 +0000 @@ -6,7 +6,7 @@ #include #include -#if defined (__STDC_IEC_559__) || defined (SDCC) +#if defined (__STDC_IEC_559__) || defined (__SDCC) #define {func} 1 #endif @@ -22,7 +22,7 @@ #endif #ifdef POWF /* too big for small model */ -# ifndef SDCC_MODEL_SMALL +# ifndef __SDCC_MODEL_SMALL ASSERT(fabsf (powf (1.5, 2.0) - 2.24999976) < 0.00001); # endif #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/funptrs.c sdcc-3.2.0+dfsg/support/regression/tests/funptrs.c --- sdcc-3.1.0+dfsg/support/regression/tests/funptrs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/funptrs.c 2012-02-22 14:45:17.000000000 +0000 @@ -1,19 +1,15 @@ /** Function pointer tests. - type: BOOL, char, int, long + type: bool, char, int, long */ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif #include -#ifndef BOOL -#define BOOL bool -#endif - #define TYPE_{type} /* Must use a typedef as there is no way of adding the code modifier diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/funsigned-char.c sdcc-3.2.0+dfsg/support/regression/tests/funsigned-char.c --- sdcc-3.1.0+dfsg/support/regression/tests/funsigned-char.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/funsigned-char.c 2012-02-22 14:45:17.000000000 +0000 @@ -26,7 +26,7 @@ void testBug(void) { -#ifdef SDCC_CHAR_UNSIGNED +#ifdef __SDCC_CHAR_UNSIGNED ASSERT(CHAR_MAX == 255); ASSERT(CHAR_MIN == 0); #else @@ -40,7 +40,7 @@ ASSERT(tst_schar_to_int() == 127); ASSERT(glb_schar_to_int == 127); -#ifdef SDCC_CHAR_UNSIGNED +#ifdef __SDCC_CHAR_UNSIGNED ASSERT(tst_char_to_int() == -129); ASSERT(glb_char_to_int == -129); #else diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000113-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000113-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000113-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000113-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,34 @@ +/* + 20000113-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct x { + unsigned x1:1; + unsigned x2:2; + unsigned x3:3; +}; + +void foobar (int x, int y, int z) +{ + struct x a = {x, y, z}; + struct x b = {x, y, z}; + struct x *c = &b; + + c->x3 += (a.x2 - a.x1) * c->x2; + if (a.x1 != 1 || c->x3 != 5) + ASSERT (0); + return; +} + +void +testTortureExecute (void) +{ + foobar (1, 2, 3); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000121-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000121-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000121-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000121-1.c 2012-04-02 09:59:13.000000000 +0000 @@ -0,0 +1,32 @@ +/* + 20000121-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +// Some ports do not support long long yet +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) +void big(long long u) { } + +void doit(unsigned int a,unsigned int b,char *id) +{ + big(*id); + big(a); + big(b); +} +#endif + +void +testTortureExecute (void) +{ +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + doit(1,1,"\n"); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000205-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000205-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000205-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000205-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,29 @@ +/* + 20000205-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +static int f (int a) +{ + if (a == 0) + return 0; + do + if (a & 128) + return 1; + while (f (0)); + return 0; +} + +void +testTortureExecute (void) +{ + if (f (~128)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000217-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000217-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000217-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000217-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 20000217-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +unsigned short int showbug(unsigned short int *a, unsigned short int *b) +{ + *a += *b -8; + return (*a >= 8); +} + +void +testTortureExecute (void) +{ + unsigned short int x = 0; + unsigned short int y = 10; + + if (showbug(&x, &y) != 0) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000224-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000224-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000224-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000224-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,39 @@ +/* + 20000224-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int loop_1 = 100; +int loop_2 = 7; +int flag = 0; + +int test (void) +{ + int i; + int counter = 0; + + while (loop_1 > counter) { + if (flag & 1) { + for (i = 0; i < loop_2; i++) { + counter++; + } + } + flag++; + } + return 1; +} + +void +testTortureExecute (void) +{ + if (test () != 1) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000225-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000225-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000225-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000225-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,31 @@ +/* + 20000225-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ + int nResult; + int b=0; + int i = -1; + + do + { + if (b!=0) { + ASSERT (0); + nResult=1; + } else { + nResult=0; + } + i++; + b=(i+2)*4; + } while (i < 0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000227-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000227-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000227-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000227-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,27 @@ +/* + 20000227-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +static const unsigned char f[] = "\0\377"; +static const unsigned char g[] = "\0"; + +void +testTortureExecute (void) +{ + if (sizeof f != 3 || sizeof g != 3) + ASSERT (0); + if (f[0] != g[0]) + ASSERT (0); + if (f[1] != g[1]) + ASSERT (0); + if (f[2] != g[2]) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000313-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000313-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000313-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000313-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,32 @@ +/* + 20000227-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +unsigned int buggy (unsigned int *param) +{ + unsigned int accu, zero = 0, borrow; + accu = - *param; + borrow = - (accu > zero); + *param += accu; + return borrow; +} + +void +testTortureExecute (void) +{ + unsigned int param = 1; + unsigned int borrow = buggy (¶m); + + if (param != 0) + ASSERT (0); + if (borrow + 1 != 0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000314-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000314-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000314-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000314-1.c 2012-02-28 10:25:29.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 20000313-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 127 +#endif + +void +testTortureExecute (void) +{ + long winds = 0; + + while (winds != 0) + { + if (*(char *) winds) + break; + } + + if (winds == 0 || winds != 0 || *(char *) winds) + return; + + ASSERT (0); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000314-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000314-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000314-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000314-2.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,39 @@ +/* + 20000314-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// sdcc cannot return long long yet. +#if 0 + +typedef unsigned long long uint64; +const uint64 bigconst = 1ULL << 34; + +int a = 1; + +static +uint64 getmask(void) +{ + if (a) + return bigconst; + else + return 0; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + uint64 f = getmask(); + if (sizeof (long long) == 8 + && f != bigconst) ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000314-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000314-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000314-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000314-3.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,49 @@ +/* + 20000314-3.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +static char arg0[] = "arg0"; +static char arg1[] = "arg1"; + +static void attr_rtx (char *, char *); +static char *attr_string (char *); +static void attr_eq (char *, char *); + +static void +attr_rtx (char *varg0, char *varg1) +{ + if (varg0 != arg0) + ASSERT (0); + + if (varg1 != arg1) + ASSERT (0); + + return; +} + +static void +attr_eq (char *name, char *value) +{ + return attr_rtx (attr_string (name), + attr_string (value)); +} + +static char * +attr_string (char *str) +{ + return str; +} + +void +testTortureExecute (void) +{ + attr_eq (arg0, arg1); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000402-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000402-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000402-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000402-1.c 2012-03-30 09:18:32.000000000 +0000 @@ -0,0 +1,47 @@ +/* + 20000402-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +// TODO: Enable when sdcc supports long long constants! +/*#if ULONG_LONG_MAX != 18446744073709551615ull && ULONG_MAX != 18446744073709551615ull +void +testTortureExecute (void) { return; } +#else +#if ULONG_MAX != 18446744073709551615ull +typedef unsigned long long ull; +#else +typedef unsigned long ull; +#endif + +#include + +void checkit(int);*/ + +void +testTortureExecute (void) { + /*const ull a = 0x1400000000ULL; + const ull b = 0x80000000ULL; + const ull c = a/b; + const ull d = 0x1400000000ULL / 0x80000000ULL; + + checkit ((int) c); + checkit ((int) d); + + return;*/ +} + +/*void checkit (int a) +{ + if (a != 40) + ASSERT (0); +} +#endif*/ + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000403-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000403-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000403-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000403-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,41 @@ +/* + 20000403-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +extern unsigned long aa[], bb[]; + +int seqgt (unsigned long a, unsigned short win, unsigned long b); + +int seqgt2 (unsigned long a, unsigned short win, unsigned long b); + +void +testTortureExecute (void) +{ + if (! seqgt (*aa, 0x1000, *bb) || ! seqgt2 (*aa, 0x1000, *bb)) + ASSERT (0); + + return; +} + +int +seqgt (unsigned long a, unsigned short win, unsigned long b) +{ + return (long) ((a + win) - b) > 0; +} + +int +seqgt2 (unsigned long a, unsigned short win, unsigned long b) +{ + long l = ((a + win) - b); + return l > 0; +} + +unsigned long aa[] = { (1UL << (sizeof (long) * 8 - 1)) - 0xfff }; +unsigned long bb[] = { (1UL << (sizeof (long) * 8 - 1)) - 0xfff }; + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,32 @@ +/* + 20000412-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#if 0 +short int i = -1; +const char * const wordlist[207]; + +const char * const * +foo(void) +{ + register const char * const *wordptr = &wordlist[207u + i]; + return wordptr; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + if (foo() != &wordlist[206]) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-2.c 2012-05-18 16:46:53.000000000 +0000 @@ -0,0 +1,32 @@ +/* + 20000412-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#if !(defined (__SDCC_mcs51) || defined (__SDCC_hc08) || defined (__SDCC_s08) || defined (__SDCC_ds390)) +int f(int a,int *y) +{ + int x = a; + + if (a==0) + return *y; + + return f(a-1,&x); +} +#endif + +void +testTortureExecute (void) +{ +#if !(defined (__SDCC_mcs51) || defined (__SDCC_hc08) || defined (__SDCC_s08) || defined (__SDCC_ds390)) + if (f (10, (int *) 0) != 1) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-3.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,52 @@ +/* + 20000412-3.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when struct passing is supported. +#if 0 +typedef struct { + char y; + char x[32]; +} X; + +int f(X x, X y); + +int z (void) +{ + X xxx; + xxx.x[0] = + xxx.x[31] = '0'; + xxx.y = 0xf; + return f (xxx, xxx); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + int val; + + val = z (); + if (val != 0x60) + ASSERT (0); + return; +#endif +} + +#if 0 +int f(X x, X y) +{ + if (x.y != y.y) + return 'F'; + + return x.x[0] + y.x[0]; +} +#endif + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-4.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-4.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-4.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-4.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,38 @@ +/* + 20000412-4.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + + void f(int i, int j, int radius, int width, int N) + { + const int diff = i-radius; + const int lowk = (diff>0 ? diff : 0 ); + int k; + + for(k=lowk; k<= 2; k++){ + int idx = ((k-i+radius)*width-j+radius); + if (idx < 0) + ASSERT (0); + } + + for(k=lowk; k<= 2; k++); + } + + + void + testTortureExecute (void) + { + int exc_rad=2; + int N=8; + int i; + for(i=1; i<4; i++) + f(i,1,exc_rad,2*exc_rad + 1, N); + return; + } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-5.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-5.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-5.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-5.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,22 @@ +/* + 20000412-5.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) { + struct { + int node; + int type; + } lastglob[1] = { { 0 , 1 } }; + + if (lastglob[0].node != 0 || lastglob[0].type != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-6.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-6.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-6.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000412-6.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,34 @@ +/* + 20000412-6.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +unsigned bug (unsigned short value, unsigned short *buffer, + unsigned short *bufend); + +unsigned short buf[] = {1, 4, 16, 64, 256}; + +void +testTortureExecute (void) +{ + if (bug (512, buf, buf + 3) != 491) + ASSERT (0); + + return; +} + +unsigned +bug (unsigned short value, unsigned short *buffer, unsigned short *bufend) +{ + unsigned short *tmp; + + for (tmp = buffer; tmp < bufend; tmp++) + value -= *tmp; + + return value; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000419-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000419-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000419-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000419-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,38 @@ +/* + 20000419-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports passing of structs! +#if 0 +struct foo { int a, b, c; }; + +void +brother (int a, int b, int c) +{ + if (a) + ASSERT (0); +} + +void +sister (struct foo f, int b, int c) +{ + brother ((f.b == b), b, c); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct foo f = { 7, 8, 9 }; + sister (f, 1, 2); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000422-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000422-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000422-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000422-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,50 @@ +/* + 20000422-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int ops[13] = +{ + 11, 12, 46, 3, 2, 2, 3, 2, 1, 3, 2, 1, 2 +}; + +int correct[13] = +{ + 46, 12, 11, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1 +}; + +int num = 13; + +void +testTortureExecute (void) +{ + int i; + + for (i = 0; i < num; i++) + { + int j; + + for (j = num - 1; j > i; j--) + { + if (ops[j-1] < ops[j]) + { + int op = ops[j]; + ops[j] = ops[j-1]; + ops[j-1] = op; + } + } + } + + + for (i = 0; i < num; i++) + if (ops[i] != correct[i]) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000503-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000503-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000503-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000503-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,25 @@ +/* + 20000503-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +unsigned long +sub (int a) +{ + return ((0 > a - 2) ? 0 : a - 2) * sizeof (long); +} + +void +testTortureExecute (void) +{ + if (sub (0) != 0) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000511-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000511-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000511-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000511-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,45 @@ +/* + 20000511-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void f (int value, int expect) +{ + if (value != expect) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + int a = 7, b = 6, c = 4, d = 7, e = 2; + + f (a||b%c, 1); + f (a?b%c:0, 2); + f (a=b%c, 2); + f (a*=b%c, 4); + f (a/=b%c, 2); + f (a%=b%c, 0); + f (a+=b%c, 2); + f (d||c&&e, 1); + f (d?c&&e:0, 1); + f (d=c&&e, 1); + f (d*=c&&e, 1); + f (d%=c&&e, 0); + f (d+=c&&e, 1); + f (d-=c&&e, 0); + f (d||c||e, 1); + f (d?c||e:0, 0); + f (d=c||e, 1); + f (d*=c||e, 1); + f (d%=c||e, 0); + f (d+=c||e, 1); + f (d-=c||e, 0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000519-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000519-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000519-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000519-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,41 @@ +/* + 20000519-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +int +bar (int a, va_list ap) +{ + int b; + + do + b = va_arg (ap, int); + while (b > 10); + + return a + b; +} + +int +foo (int a, ...) +{ + va_list ap; + + va_start (ap, a); + return bar (a, ap); +} + +void +testTortureExecute (void) +{ + if (foo (1, 2, 3) != 3) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000519-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000519-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000519-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000519-2.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,23 @@ +/* + 20000519-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +long x = -1L; + +void +testTortureExecute (void) +{ + long b = (x != -1L); + + if (b) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000523-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000523-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000523-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000523-1.c 2012-04-01 11:33:10.000000000 +0000 @@ -0,0 +1,36 @@ +/* + 20000523-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ +// Todo: Enable when sdcc supports long long constants! +#if 0 + long long x; + int n; + + if (sizeof (long long) < 8) + return; + + n = 9; + x = (((long long) n) << 55) / 0xff; + + if (x == 0) + ASSERT (0); + + x = (((long long) 9) << 55) / 0xff; + + if (x == 0) + ASSERT (0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000528-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000528-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000528-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000528-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,25 @@ +/* + 20000528-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Copyright (C) 2000 Free Software Foundation */ +/* Contributed by Alexandre Oliva */ + +unsigned long l = (unsigned long)-2; +unsigned short s; + +void +testTortureExecute (void) { + long t = l; + s = t; + if (s != (unsigned short)-2) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000603-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000603-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000603-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000603-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 20000603-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +/* It is not clear whether this test is conforming. See DR#236 + http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_236.htm. However, + there seems to be consensus that the presence of a union to aggregate + struct s1 and struct s2 should make it conforming. */ +struct s1 { double d; }; +struct s2 { double d; }; +union u { struct s1 x; struct s2 y; }; + +double f(struct s1 *a, struct s2 *b) +{ + a->d = 1.0; + return b->d + 1.0; +} + +void +testTortureExecute (void) +{ + union u a; + a.x.d = 0.0; + if (f (&a.x, &a.y) != 2.0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000605-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000605-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000605-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000605-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,60 @@ +/* + 20000605-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +typedef struct _RenderInfo RenderInfo; +struct _RenderInfo +{ + int y; + float scaley; + int src_y; +}; + +static void bar(void) { } + +static int +render_image_rgb_a (RenderInfo * info) +{ + int y, ye; + float error; + float step; + + y = info->y; + ye = 256; + + step = 1.0 / info->scaley; + + error = y * step; + error -= ((int) error) - step; + + for (; y < ye; y++) { + if (error >= 1.0) { + info->src_y += (int) error; + error -= (int) error; + bar(); + } + error += step; + } + return info->src_y; +} + +void +testTortureExecute (void) +{ + RenderInfo info; + + info.y = 0; + info.src_y = 0; + info.scaley = 1.0; + + if (render_image_rgb_a(&info) != 256) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000605-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000605-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000605-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000605-2.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,30 @@ +/* + 20000605-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct F { int i; }; + +void f1(struct F *x, struct F *y) +{ + int timeout = 0; + for (; ((const struct F*)x)->i < y->i ; x->i++) + if (++timeout > 5) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + struct F x, y; + x.i = 0; + y.i = 1; + f1 (&x, &y); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000605-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000605-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000605-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000605-3.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,30 @@ +/* + 20000605-3.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct F { int x; int y; }; + +void +testTortureExecute (void) +{ + int timeout = 0; + int x = 0; + while (1) + { + const struct F i = { x++, }; + if (i.x > 0) + break; + if (++timeout > 5) + goto die; + } + return; + die: + ASSERT (0); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000622-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000622-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000622-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000622-1.c 2012-05-05 14:39:36.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 20000622-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#pragma disable_warning 88 +#endif + +long foo(long a, long b, long c) +{ + if (a != 12 || b != 1 || c != 11) + ASSERT (0); + return 0; +} +long bar (long a, long b) +{ + return b; +} +void baz (long a, long b, void *c) +{ + long d; + d = (long)c; + foo(d, bar (a, 1), b); +} +void +testTortureExecute (void) +{ + baz (10, 11, (void *)12); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000703-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000703-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000703-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000703-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,51 @@ +/* + 20000703-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +struct baz +{ + char a[17]; + char b[3]; + unsigned int c; + unsigned int d; +}; + +void foo(struct baz *p, unsigned int c, unsigned int d) +{ + memcpy (p->b, "abc", 3); + p->c = c; + p->d = d; +} + +void bar(struct baz *p, unsigned int c, unsigned int d) +{ + { void *s = (p); + memset (s, '\0', sizeof (struct baz)); + s; }; + memcpy (p->a, "01234567890123456", 17); + memcpy (p->b, "abc", 3); + p->c = c; + p->d = d; +} + +void +testTortureExecute (void) +{ + struct baz p; + foo(&p, 71, 18); + if (p.c != 71 || p.d != 18) + ASSERT (0); + bar(&p, 59, 26); + if (p.c != 59 || p.d != 26) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,45 @@ +/* + 20000706-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable once sdcc supports passing of struct as parameter! +#if 0 +struct baz { + int a, b, c, d, e; +}; + +void bar(struct baz *x, int f, int g, int h, int i, int j) +{ + if (x->a != 1 || x->b != 2 || x->c != 3 || x->d != 4 || x->e != 5 || + f != 6 || g != 7 || h != 8 || i != 9 || j != 10) + ASSERT (0); +} + +void foo(struct baz x, char **y) +{ + bar(&x,6,7,8,9,10); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct baz x; + + x.a = 1; + x.b = 2; + x.c = 3; + x.d = 4; + x.e = 5; + foo(x,(char **)0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-2.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,44 @@ +/* + 20000706-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#if 0 +struct baz { + int a, b, c, d, e; +}; + +void bar(struct baz *x, int f, int g, int h, int i, int j) +{ + if (x->a != 1 || x->b != 2 || x->c != 3 || x->d != 4 || x->e != 5 || + f != 6 || g != 7 || h != 8 || i != 9 || j != 10) + ASSERT(0); +} + +void foo(char *z, struct baz x, char *y) +{ + bar(&x,6,7,8,9,10); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct baz x; + + x.a = 1; + x.b = 2; + x.c = 3; + x.d = 4; + x.e = 5; + foo((char *)0,x,(char *)0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-3.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,36 @@ +/* + 20000706-3.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int c; + +void baz(int *p) +{ + c = *p; +} + +void bar(int b) +{ + if (c != 1 || b != 2) + ASSERT(0); +} + +void foo(int a, int b) +{ + baz(&a); + bar(b); +} + +void +testTortureExecute (void) +{ + foo(1, 2); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-4.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-4.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-4.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-4.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,31 @@ +/* + 20000706-4.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int *c; + +void bar(int b) +{ + if (*c != 1 || b != 2) + ASSERT(0); +} + +void foo(int a, int b) +{ + c = &a; + bar(b); +} + +void +testTortureExecute (void) +{ + foo(1, 2); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-5.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-5.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-5.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000706-5.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,42 @@ +/* + 20000706-5.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports. +#if 0 +struct baz { int a, b, c; }; + +struct baz *c; + +void bar(int b) +{ + if (c->a != 1 || c->b != 2 || c->c != 3 || b != 4) + ASSERT(0); +} + +void foo(struct baz a, int b) +{ + c = &a; + bar(b); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct baz a; + a.a = 1; + a.b = 2; + a.c = 3; + foo(a, 4); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000707-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000707-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000707-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000707-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,40 @@ +/* + 20000707-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports struct +#if 0 +struct baz { + int a, b, c; +}; + +void +foo (int a, int b, int c) +{ + if (a != 4) + ASSERT (0); +} + +void +bar (struct baz x, int b, int c) +{ + foo (x.b, b, c); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct baz x = { 3, 4, 5 }; + bar (x, 1, 2); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000715-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000715-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000715-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000715-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,126 @@ +/* + 20000715-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +test1(void) +{ + int x = 3, y = 2; + + if ((x < y ? x++ : y++) != 2) + ASSERT (0); + + if (x != 3) + ASSERT (0); + + if (y != 3) + ASSERT (0); +} + +void +test2(void) +{ + int x = 3, y = 2, z; + + z = (x < y) ? x++ : y++; + if (z != 2) + ASSERT (0); + + if (x != 3) + ASSERT (0); + + if (y != 3) + ASSERT (0); +} + +void +test3(void) +{ + int x = 3, y = 2; + int xx = 3, yy = 2; + + if ((xx < yy ? x++ : y++) != 2) + ASSERT (0); + + if (x != 3) + ASSERT (0); + + if (y != 3) + ASSERT (0); +} + +int x, y; + +static void +init_xy(void) +{ + x = 3; + y = 2; +} + +void +test4(void) +{ + init_xy(); + if ((x < y ? x++ : y++) != 2) + ASSERT (0); + + if (x != 3) + ASSERT (0); + + if (y != 3) + ASSERT (0); +} + +void +test5(void) +{ + int z; + + init_xy(); + z = (x < y) ? x++ : y++; + if (z != 2) + ASSERT (0); + + if (x != 3) + ASSERT (0); + + if (y != 3) + ASSERT (0); +} + +void +test6(void) +{ + int xx = 3, yy = 2; + int z; + + init_xy(); + z = (xx < y) ? x++ : y++; + if (z != 2) + ASSERT (0); + + if (x != 3) + ASSERT (0); + + if (y != 3) + ASSERT (0); +} + +void +testTortureExecute (void){ + test1 (); + test2 (); + test3 (); + test4 (); + test5 (); + test6 (); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000715-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000715-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000715-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000715-2.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,23 @@ +/* + 20000715-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +unsigned int foo(unsigned int a) +{ + return ((unsigned char)(a + 1)) * 4; +} + +void +testTortureExecute (void) +{ + if (foo((unsigned char)~0)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,39 @@ +/* + 20000717-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports struct +#if 0 +typedef struct trio { int a, b, c; } trio; + +int +bar (int i, trio t) +{ + if (t.a == t.b || t.a == t.c) + ASSERT (0); +} + +int +foo (trio t, int i) +{ + return bar (i, t); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + trio t = { 1, 2, 3 }; + + foo (t, 4); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-2.c 2012-03-30 09:18:32.000000000 +0000 @@ -0,0 +1,29 @@ +/* + 20000717-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports long long constants! +#if 0 +static void +compare (long long foo) +{ + if (foo < 4294967297LL) + ASSERT (0); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + compare (8589934591LL); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-3.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,36 @@ +/* + 20000717-3.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int c = -1; + +foo (int *p) +{ + int x; + int a; + + a = p[0]; + x = a + 5; + a = c; + p[0] = x - 15; + return a; +} + +void +testTortureExecute (void) +{ + int b = 1; + int a = foo(&b); + + if (a != -1 || b != (1 + 5 - 15)) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-4.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-4.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-4.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-4.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,37 @@ +/* + 20000717-4.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Extracted from gas. Incorrectly generated non-pic code at -O0 for + IA-64, which produces linker errors on some operating systems. */ + +struct +{ + int offset; + struct slot + { + int field[6]; + } + slot[4]; +} s; + +int +x () +{ + int toggle = 0; + int r = s.slot[0].field[!toggle]; + return r; +} + +void +testTortureExecute (void) +{ + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-5.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-5.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-5.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000717-5.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,40 @@ +/* + 20000717-5.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports struct! +#if 0 +typedef struct trio { int a, b, c; } trio; + +int +bar (int i, int j, int k, trio t) +{ + if (t.a != 1 || t.b != 2 || t.c != 3 || + i != 4 || j != 5 || k != 6) + ASSERT (0); +} + +int +foo (trio t, int i, int j, int k) +{ + return bar (i, j, k, t); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + trio t = { 1, 2, 3 }; + + foo (t, 4, 5, 6); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000722-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000722-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000722-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000722-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,44 @@ +/* + 20000722-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable whens dcc supports this! +#if 0 +struct s { char *p; int t; }; + +extern void bar (void); +extern void foo (struct s *); +#endif + +void +testTortureExecute (void) +{ +#if 0 + bar (); + bar (); + return; +#endif +} + +#if 0 +void +bar (void) +{ + foo (& (struct s) { "hi", 1 }); +} +#endif + +#if 0 +void foo (struct s *p) +{ + if (p->t != 1) + ASSERT (0); + p->t = 2; +} +#endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000726-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000726-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000726-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000726-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,41 @@ +/* + 20000726-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void adjust_xy (short *, short *); + +struct adjust_template +{ + short kx_x; + short kx_y; + short kx; + short kz; +}; + +static struct adjust_template adjust = {0, 0, 1, 1}; + +void +testTortureExecute (void) +{ + short x = 1, y = 1; + + adjust_xy (&x, &y); + + if (x != 1) + ASSERT (0); + + return; +} + +void +adjust_xy (short *x, short *y) +{ + *x = adjust.kx_x * *x + adjust.kx_y * *y + adjust.kx; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000731-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000731-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000731-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000731-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 20000731-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +double +foo (void) +{ + return 0.0; +} + +void +do_sibcall (void) +{ + (void) foo (); +} + +void +testTortureExecute (void) +{ + double x; + + for (x = 0; x < 20; x++) + do_sibcall (); + if (!(x >= 10)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000731-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000731-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000731-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000731-2.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,27 @@ +/* + 20000731-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ + int i = 1; + int j = 0; + + while (i != 1024 || j <= 0) { + i *= 2; + ++ j; + } + + if (j != 10) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000801-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000801-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000801-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000801-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,48 @@ +/* + 20000801-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +foo (char *bp, unsigned n) +{ + register char c; + register char *ep = bp + n; + register char *sp; + + while (bp < ep) + { + sp = bp + 3; + c = *sp; + *sp = *bp; + *bp++ = c; + sp = bp + 1; + c = *sp; + *sp = *bp; + *bp++ = c; + bp += 2; + } +} + +void +testTortureExecute (void) +{ + int one = 1; + + if (sizeof(int) != 4 * sizeof(char)) + return; + + foo ((char *)&one, sizeof(one)); + foo ((char *)&one, sizeof(one)); + + if (one != 1) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000801-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000801-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000801-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000801-2.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,50 @@ +/* + 20000801-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int bar(void); +int baz(void); + +struct foo { + struct foo *next; +}; + +struct foo *test(struct foo *node) +{ + while (node) { + if (bar() && !baz()) + break; + node = node->next; + } + return node; +} + +int bar (void) +{ + return 0; +} + +int baz (void) +{ + return 0; +} + +void +testTortureExecute (void) +{ + struct foo a, b, *c; + + a.next = &b; + b.next = (struct foo *)0; + c = test (&a); + if (c) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000801-4.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000801-4.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000801-4.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000801-4.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,42 @@ +/* + 20000801-4.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Origin: PR c/128 from Martin Sebor , adapted + as a testcase by Joseph Myers . +*/ +/* Character arrays initialized by a string literal must have + uninitialized elements zeroed. This isn't clear in the 1990 + standard, but was fixed in TC2 and C99; see DRs #060, #092. +*/ + +int +foo (void) +{ + char s[2] = ""; + return 0 == s[1]; +} + +char *t; + +void +testTortureExecute (void) +{ +#if 0 + { + char s[] = "x"; + t = s; + } + if (foo ()) + return; + else + ASSERT (0); +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000815-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000815-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000815-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000815-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,87 @@ +/* + 20000815-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +#ifndef __SDCC_mcs51 +#include + +struct table_elt +{ + void *exp; + struct table_elt *next_same_hash; + struct table_elt *prev_same_hash; + struct table_elt *next_same_value; + struct table_elt *prev_same_value; + struct table_elt *first_same_value; + struct table_elt *related_value; + int cost; + int mode; + char in_memory; + char in_struct; + char is_const; + char flag; +}; + +struct write_data +{ + int sp : 1; + int var : 1; + int nonscalar : 1; + int all : 1; +}; + +int cse_rtx_addr_varies_p(void *); +void remove_from_table(struct table_elt *, int); +static struct table_elt *table[32]; + +void +invalidate_memory (struct write_data *writes) +{ + register int i; + register struct table_elt *p, *next; + int all = writes->all; + int nonscalar = writes->nonscalar; + + for (i = 0; i < 31; i++) + for (p = table[i]; p; p = next) + { + next = p->next_same_hash; + if (p->in_memory + && (all + || (nonscalar && p->in_struct) + || cse_rtx_addr_varies_p (p->exp))) + remove_from_table (p, i); + } +} + +int cse_rtx_addr_varies_p(void *x) { return 0; } +void remove_from_table(struct table_elt *x, int y) { ASSERT (0); } +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + struct write_data writes; + struct table_elt elt; + + memset(&elt, 0, sizeof(elt)); + elt.in_memory = 1; + table[0] = &elt; + + memset(&writes, 0, sizeof(writes)); + writes.var = 1; + writes.nonscalar = 1; + + invalidate_memory(&writes); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000818-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000818-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000818-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000818-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,72 @@ +/* + 20000818-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +/* Copyright (C) 2000 Free Software Foundation. + + by Manfred Hollstein */ + +void *temporary_obstack; + +static int input (void); +static int ISALNUM (int ch); +static void obstack_1grow (void **ptr, int ch); + +int yylex (void); + +void +testTortureExecute (void) +{ + int ch = yylex (); + + return; +} + +int yylex (void) +{ + int ch; + +#ifndef WORK_AROUND + for (;;) + { + ch = input (); + if (ISALNUM (ch)) + obstack_1grow (&temporary_obstack, ch); + else if (ch != '_') + break; + } +#else + do + { + ch = input (); + if (ISALNUM (ch)) + obstack_1grow (&temporary_obstack, ch); + } while (ch == '_'); +#endif + + return ch; +} + +static int input (void) +{ + return 0; +} + +static int ISALNUM (int ch) +{ + return ((ch >= 'A' && ch <= 'Z') + || (ch >= 'a' && ch <= 'z') + || (ch >= '0' && ch <= '0')); +} + +static void obstack_1grow (void **ptr, int ch) +{ +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000910-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000910-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20000910-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20000910-2.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,40 @@ +/* + 20000010-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Copyright (C) 2000 Free Software Foundation */ +/* by Alexandre Oliva */ + +#include +#include + +const char *list[] = { "*", "e" }; + +static int bar (const char *fmt) { + return (strchr (fmt, '*') != 0); +} + +static void foo () { + int i; + for (i = 0; i < sizeof (list) / sizeof (*list); i++) { + const char *fmt = list[i]; + if (bar (fmt)) + continue; + if (i == 0) + ASSERT (0); + else + return; + } +} + +void +testTortureExecute (void) { + foo (); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001009-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001009-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001009-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001009-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,25 @@ +/* + 20001009-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int a,b; + +void +testTortureExecute (void) +{ + int c=-2; + int d=0xfe; + int e=a&1; + int f=b&2; + if ((char)(c|(e&f)) == (char)d) + return; + else + ASSERT (0); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001011-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001011-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001011-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001011-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,27 @@ +/* + 20001011-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +int foo(const char *a) +{ + return strcmp(a, "testTortureExecute"); +} + +void +testTortureExecute (void) +{ +#if 0 + if(foo(__func__)) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001013-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001013-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001013-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001013-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,29 @@ +/* + 20001013-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct x { + int a, b; +} z = { -4028, 4096 }; + +int foo(struct x *p, int y) +{ + if ((y & 0xff) != y || -p->b >= p->a) + return 1; + return 0; +} + +void +testTortureExecute (void) +{ + if (foo (&z, 10)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001017-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001017-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001017-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001017-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,29 @@ +/* + 20001017-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#pragma disable_warning 85 +#endif + +void bug (double *Cref, char transb, int m, int n, int k, + double a, double *A, int fdA, double *B, int fdB, + double b, double *C, int fdC) +{ + if (C != Cref) ASSERT (0); +} + +void +testTortureExecute (void) +{ + double A[1], B[1], C[1]; + + bug (C, 'B', 1, 2, 3, 4.0, A, 5, B, 6, 7.0, C, 8); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001017-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001017-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001017-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001017-2.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,29 @@ +/* + 20001017-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +void +fn_4parms (unsigned char a, long *b, long *c, unsigned int *d) +{ + if (*b != 1 || *c != 2 || *d != 3) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + unsigned char a = 0; + unsigned long b = 1, c = 2; + unsigned int d = 3; + + fn_4parms (a, &b, &c, &d); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001024-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001024-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001024-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001024-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,51 @@ +/* + 20001024-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +#include + +struct a; + +extern int baz (struct a *restrict x); + +struct a { + long v; + long w; +}; + +struct b { + struct a c; + struct a d; +}; + +int bar (int x, const struct b *restrict y, struct b *restrict z) +{ + if (y->c.v || y->c.w != 250000 || y->d.v || y->d.w != 250000) + ASSERT (0); +} + +void foo(void) +{ + struct b x; + x.c.v = 0; + x.c.w = 250000; +// Not supported by sdcc yet! +// x.d = x.c; + memcpy(&x.d, &x.c, sizeof(struct a)); + bar(0, &x, ((void *)0)); +} + +void +testTortureExecute (void) +{ + foo(); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001026-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001026-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001026-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001026-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,61 @@ +/* + 20001026-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +// TODO: Enable when sdcc supports struct! +#if 0 +typedef struct { + long r[(19 + sizeof (long))/(sizeof (long))]; +} realvaluetype; + +typedef void *tree; + +static realvaluetype +real_value_from_int_cst (tree x, tree y) +{ + realvaluetype r; + int i; + for (i = 0; i < sizeof(r.r)/sizeof(long); ++i) + r.r[i] = -1; + return r; +} + +struct brfic_args +{ + tree type; + tree i; + realvaluetype d; +}; + +static void +build_real_from_int_cst_1 (data) + void * data; +{ + struct brfic_args *args = (struct brfic_args *) data; + args->d = real_value_from_int_cst (args->type, args->i); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct brfic_args args; + + memset (&args, 0, sizeof(args)); + build_real_from_int_cst_1 (&args); + + if (args.d.r[0] == 0) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001027-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001027-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001027-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001027-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,25 @@ +/* + 20001027-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int x,*p=&x; + +void +testTortureExecute (void) +{ +#if 0 + int i=0; + x=1; + *p=2; + if (x != 2) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001031-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001031-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001031-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001031-1.c 2012-03-30 09:18:32.000000000 +0000 @@ -0,0 +1,51 @@ +/* + 20001031-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports long long constants! +#if 0 +void t1 (int x) +{ + if (x != 4100) + abort (); +} + +int t2 (void) +{ + int i; + t1 ((i = 4096) + 4); + return i; +} + +void t3 (long long x) +{ + if (x != 0x80000fffULL) + abort (); +} + +long long t4 (void) +{ + long long i; + t3 ((i = 4096) + 0x7fffffffULL); + return i; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + if (t2 () != 4096) + ASSERT (0); + if (t4 () != 4096) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001101.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001101.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001101.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001101.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,46 @@ +/* + 20001101-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 88 +#endif + +typedef struct +{ + unsigned int unchanging : 1; +} struc, *rtx; + +rtx dummy ( int *a, rtx *b) +{ + *a = 1; + *b = (rtx)7; + return (rtx)1; +} + +void bogus (rtx insn, rtx thread, rtx delay_list) +{ + rtx new_thread; + int must_annul; + + delay_list = dummy ( &must_annul, &new_thread); + if (delay_list == 0 && new_thread ) + { + thread = new_thread; + } + if (delay_list && must_annul) + insn->unchanging = 1; + if (new_thread != thread ) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + struc baz; + bogus (&baz, (rtx)7, 0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001108-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001108-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001108-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001108-1.c 2012-05-18 17:36:32.000000000 +0000 @@ -0,0 +1,45 @@ +/* + 20001108-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) +long long +signed_poly (long long sum, long x) +{ + sum += (long long) (long) sum * (long long) x; + return sum; +} + +unsigned long long +unsigned_poly (unsigned long long sum, unsigned long x) +{ + sum += (unsigned long long) (unsigned long) sum * (unsigned long long) x; + return sum; +} +#endif + +void +testTortureExecute (void) +{ +// Test fails on 32-bit systems +#if 0 +//#if !defined(__SDCC_mcs51) && !defined(__SDCC_hc08) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) +// TODO: Enable when sdcc supports long long constants! +#if 0 + if (signed_poly (2LL, -3) != -4LL) + ASSERT (0); +#endif + + if (unsigned_poly (2ULL, 3) != 8ULL) + ASSERT (0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001112-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001112-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001112-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001112-1.c 2012-04-02 09:59:13.000000000 +0000 @@ -0,0 +1,25 @@ +/* + 20001112-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ +// Some ports do not support long long yet. +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + long long i = 1; + + i = i * 2 + 1; + + if (i != 3) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001121-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001121-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001121-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001121-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,32 @@ +/* + 20001121-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +double d; + +inline double foo (void) +{ + return d; +} + +inline int bar (void) +{ + foo(); + return 0; +} + +void +testTortureExecute (void) +{ + if (bar ()) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001130-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001130-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001130-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001130-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,33 @@ +/* + 20001130-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +static inline int bar(void) { return 1; } +static int mem[3]; + +static int foo(int x) +{ + if (x != 0) + return x; + + mem[x++] = foo(bar()); + + if (x != 1) + ASSERT(0); + + return 0; +} + +void +testTortureExecute (void) +{ + foo(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001130-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001130-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001130-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001130-2.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,44 @@ +/* + 20001130-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +static int which_alternative = 3; + +static const char *i960_output_ldconst (void); + +static const char * +output_25 (void) +{ + switch (which_alternative) + { + case 0: + return "mov %1,%0"; + case 1: + return i960_output_ldconst (); + case 2: + return "ld %1,%0"; + case 3: + return "st %1,%0"; + } +} + +static const char *i960_output_ldconst (void) +{ + return "foo"; +} + +void +testTortureExecute (void) +{ + const char *s = output_25 () ; + if (s[0] != 's') + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001203-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001203-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001203-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001203-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,33 @@ +/* + 20001203-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Origin: PR c/410 from Jan Echternach + , + adapted to a testcase by Joseph Myers . +*/ + +static void +foo (void) +{ + struct { + long a; + char b[1]; + } x = { 2, { 0 } }; +} + +void +testTortureExecute (void) +{ + int tmp; + foo (); + tmp = 1; + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001221-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001221-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001221-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001221-1.c 2012-05-18 17:15:09.000000000 +0000 @@ -0,0 +1,23 @@ +/* + 20001221-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 184 +#endif + +void +testTortureExecute (void) +{ +// TODO: Enable when more ports support long long! +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + unsigned long long a; + if (! (a = 0xfedcba9876543210ULL)) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001228-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001228-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20001228-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20001228-1.c 2012-02-28 14:50:19.000000000 +0000 @@ -0,0 +1,40 @@ +/* + 20001228-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int foo1(void) +{ + union { + char a[sizeof (unsigned)]; + unsigned b; + } u; + + u.b = 0x01; + return u.a[0]; +} + +int foo2(void) +{ + volatile union { + char a[sizeof (unsigned)]; + unsigned b; + } u; + + u.b = 0x01; + return u.a[0]; +} + +void +testTortureExecute (void) +{ + if (foo1() != foo2()) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010106-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010106-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010106-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010106-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,42 @@ +/* + 20010106-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Copyright 2001 Free Software Foundation + Contributed by Alexandre Oliva */ + +int f(int i) { + switch (i) + { + case -2: + return 33; + case -1: + return 0; + case 0: + return 7; + case 1: + return 4; + case 2: + return 3; + case 3: + return 15; + case 4: + return 9; + default: + ASSERT(0); + } +} + +void +testTortureExecute (void) { + if (f(-1)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010114-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010114-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010114-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010114-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,24 @@ +/* + 20010114-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Origin: PR c/1540 from Mattias Lampe , + adapted to a testcase by Joseph Myers . + GCC 2.95.2 fails, CVS GCC of 2001-01-13 passes. */ + +void +testTortureExecute (void) +{ + int array1[1] = { 1 }; + int array2[2][1]= { { 1 }, { 0 } }; + if (array1[0] != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010118-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010118-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010118-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010118-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,53 @@ +/* + 20010118-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#pragma disable_warning 93 +#endif + +typedef struct { + int a, b, c, d, e, f; +} A; + +void foo (A *v, int w, int x, int *y, int *z) +{ +} + +void +bar (A *v, int x, int y, int w, int h) +{ + if (v->a != x || v->b != y) { + int oldw = w; + int oldh = h; + int e = v->e; + int f = v->f; + int dx, dy; + foo(v, 0, 0, &w, &h); + dx = (oldw - w) * (double) e/2.0; + dy = (oldh - h) * (double) f/2.0; + x += dx; + y += dy; + v->a = x; + v->b = y; + v->c = w; + v->d = h; + } +} + +void +testTortureExecute (void) +{ +#ifndef SDCC_ds390 + A w = { 100, 110, 20, 30, -1, -1 }; + bar (&w,400,420,50,70); + if (w.d != 70) + ASSERT(0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010123-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010123-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010123-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010123-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,36 @@ +/* + 20010123-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when supported by sdcc! + +struct s +{ + int value; + char *string; +}; + +void +testTortureExecute (void) +{ +#if 0 + int i; + for (i = 0; i < 4; i++) + { + struct s *t = & (struct s) { 3, "hey there" }; + if (t->value != 3) + ASSERT (0); + t->value = 4; + if (t->value != 4) + ASSERT (0); + } + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010129-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010129-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010129-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010129-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,81 @@ +/* + 20010129-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +long baz1 (void *a) +{ + static long l; + return l++; +} + +int baz2 (const char *a) +{ + return 0; +} + +int baz3 (int i) +{ + if (!i) + ASSERT (0); + return 1; +} + +void **bar; + +#ifndef __SDCC_mcs51 +int foo (void *a, long b, int c) +{ + int d = 0, e, f = 0, i; + char g[256]; + void **h; + + g[0] = '\n'; + g[1] = 0; + + while (baz1 (a) < b) { + if (g[0] != ' ' && g[0] != '\t') { + f = 1; + e = 0; + if (!d && baz2 (g) == 0) { + if ((c & 0x10) == 0) + continue; + e = d = 1; + } + if (!((c & 0x10) && (c & 0x4000) && e) && (c & 2)) + continue; + if ((c & 0x2000) && baz2 (g) == 0) + continue; + if ((c & 0x1408) && baz2 (g) == 0) + continue; + if ((c & 0x200) && baz2 (g) == 0) + continue; + if (c & 0x80) { + for (h = bar, i = 0; h; h = (void **)*h, i++) + if (baz3 (i)) + break; + } + f = 0; + } + } + return 0; +} +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + void *n = 0; + bar = &n; + foo (&n, 1, 0xc811); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010209-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010209-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010209-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010209-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,39 @@ +/* + 20010209-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports VLA! + +#if 0 +int b; +int foo (void) +{ + int x[b]; + int bar (int t[b]) + { + int i; + for (i = 0; i < b; i++) + t[i] = i + (i > 0 ? t[i-1] : 0); + return t[b-1]; + } + return bar (x); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + b = 6; + if (foo () != 15) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010221-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010221-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010221-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010221-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 20010221-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int n = 2; + +void +testTortureExecute (void) +{ + int i, x = 45; + + for (i = 0; i < n; i++) + { + if (i != 0) + x = ( i > 0 ) ? i : 0; + } + + if (x != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010222-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010222-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010222-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010222-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,21 @@ +/* + 20010222-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int a[2] = { 18, 6 }; + +void +testTortureExecute (void) +{ + int b = (-3 * a[0] -3 * a[1]) / 12; + if (b != -6) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010224-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010224-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010224-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010224-1.c 2012-05-21 12:05:21.000000000 +0000 @@ -0,0 +1,55 @@ +/* + 20010224-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +#include + +int16_t logadd (int16_t *a, int16_t *b); +void ba_compute_psd (int16_t start); + +int16_t masktab[6] = { 1, 2, 3, 4, 5}; +int16_t psd[6] = { 50, 40, 30, 20, 10}; +int16_t bndpsd[6] = { 1, 2, 3, 4, 5}; + +void ba_compute_psd (int16_t start) +{ + int i,j,k; + int16_t lastbin = 4; + + j = start; + k = masktab[start]; + + bndpsd[k] = psd[j]; + j++; + + for (i = j; i < lastbin; i++) { + bndpsd[k] = logadd(&bndpsd[k], &psd[j]); + j++; + } +} + +int16_t logadd (int16_t *a, int16_t *b) +{ + return *a + *b; +} + +void +testTortureExecute (void) +{ +#if !defined (__SDCC_z80) && !defined (__SDCC_z180) && !defined (__SDCC_r2k) && !defined (__SDCC_r3ka) && !defined (__SDCC_gbz80) + int i; + + ba_compute_psd (0); + + if (bndpsd[1] != 140) ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010403-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010403-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010403-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010403-1.c 2012-03-26 06:35:09.000000000 +0000 @@ -0,0 +1,49 @@ +/* + 20010403-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +void b (int *); +void c (int, int); +void d (int); + +int e; + +void a (int x, int y) +{ + int f = x ? e : 0; + int z = y; + + b (&y); + c (z, y); + d (f); +} + +void b (int *y) +{ + (*y)++; +} + +void c (int x, int y) +{ + if (x == y) + ASSERT (0); +} + +void d (int x) +{ +} + +void +testTortureExecute (void) +{ + a (0, 0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010409-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010409-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010409-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010409-1.c 2012-03-13 11:03:51.000000000 +0000 @@ -0,0 +1,57 @@ +/* + 20010409-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +#include + +typedef struct A { + int a, b; +} A; + +typedef struct B { + struct A **a; + int b; +} B; + +A *a; +int b = 1, c; +B d[1]; + +void foo (A *x, const char *y, int z) +{ + c = y[4] + z * 25; +} + +A *bar (const char *v, int w, int x, const char *y, int z) +{ + if (w) + ASSERT (0); + return 0; +} + +void test (const char *x, int *y) +{ + foo (d->a[d->b], "test", 200); + d->a[d->b] = bar (x, b ? 0 : 65536, strlen (x), "test", 201); + d->a[d->b]->a++; + if (y) + d->a[d->b]->b = *y; +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5)) + d->b = 0; + d->a = &a; + test ("", 0); +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010422-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010422-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010422-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010422-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,27 @@ +/* + 20010422-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +unsigned int foo(unsigned int x) +{ + if (x < 5) + x = 4; + else + x = 8; + return x; +} + +void +testTortureExecute (void) +{ + if (foo (8) != 8) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010518-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010518-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010518-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010518-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,39 @@ +/* + 20010518-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Leaf functions with many arguments. */ + +int +add (int a, + int b, + int c, + int d, + int e, + int f, + int g, + int h, + int i, + int j, + int k, + int l, + int m) +{ + return a+b+c+d+e+f+g+h+i+j+k+l+m; +} + +void +testTortureExecute (void) +{ + if (add (1,2,3,4,5,6,7,8,9,10,11,12,13) != 91) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010520-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010520-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010520-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010520-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,23 @@ +/* + 20010520-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +static unsigned int expr_hash_table_size = 1; + +void +testTortureExecute (void) +{ + int del = 1; + unsigned int i = 0; + + if (i < expr_hash_table_size && del) + return; + ASSERT (0); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010604-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010604-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010604-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010604-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,26 @@ +/* + 20010604-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +int func (int a, int b, int c, _Bool d, _Bool e, _Bool f, char g) +{ + if (g != 1 || d != true || e != true || f != true) ASSERT (0); + return a + b + c; +} + +void +testTortureExecute (void) +{ + if (func (1, 2, -3, true, true, true, '\001')) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010711-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010711-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010711-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010711-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,26 @@ +/* + 20010711-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +void foo (int *a) {} + +void +testTortureExecute (void) +{ + int a; + if (&a == 0) + ASSERT (0); + else + { + foo (&a); + return; + } +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010717-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010717-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010717-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010717-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,31 @@ +/* + 20010717-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ + int i, j; + unsigned long u, r1, r2; + + i = -16; + j = 1; + u = i + j; + + /* no sign extension upon shift */ + r1 = u >> 1; + /* sign extension upon shift, but there shouldn't be */ + r2 = ((unsigned long) (i + j)) >> 1; + + if (r1 != r2) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010723-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010723-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010723-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010723-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,27 @@ +/* + 200107231.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +f () +{ + int biv,giv; + for (biv = 0, giv = 0; giv != 8; biv++) + giv = biv*8; + return giv; +} + +void +testTortureExecute (void) +{ + if (f () != 8) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010910-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010910-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010910-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010910-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,71 @@ +/* + 20010910-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Test case contributed by Ingo Rohloff . + Code distilled from Linux kernel. */ + +/* Compile this program with a gcc-2.95.2 using + "gcc -O2" and run it. The result will be that + rx_ring[1].next == 0 (it should be == 14) + and + ep.skbuff[4] == 5 (it should be 0) +*/ + +extern void abort(void); + +struct epic_rx_desc +{ + unsigned int next; +}; + +struct epic_private +{ + struct epic_rx_desc *rx_ring; + unsigned int rx_skbuff[5]; +}; + +static void epic_init_ring(struct epic_private *ep) +{ + int i; + + for (i = 0; i < 5; i++) + { + ep->rx_ring[i].next = 10 + (i+1)*2; + ep->rx_skbuff[i] = 0; + } + ep->rx_ring[i-1].next = 10; +} + +static int check_rx_ring[5] = { 12,14,16,18,10 }; + +void +testTortureExecute (void) +{ + struct epic_private ep; + struct epic_rx_desc rx_ring[5]; + int i; + + for (i=0;i<5;i++) + { + rx_ring[i].next=0; + ep.rx_skbuff[i]=5; + } + + ep.rx_ring=rx_ring; + epic_init_ring(&ep); + + for (i=0;i<5;i++) + { + if ( rx_ring[i].next != check_rx_ring[i] ) ASSERT(0); + if ( ep.rx_skbuff[i] != 0 ) ASSERT(0); + } + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010915-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010915-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010915-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010915-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,86 @@ +/* + 20010915-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +#include + +/* Bug in reorg.c, deleting the "++" in the last loop in main. + Origin: . */ + +extern void f (void); +extern int x (int, const char **); +extern int r (const char *); +extern char *s (const char *, const char **); +extern char *m (const char *); +char *u; +char *h; +int check = 0; +int o = 0; + +void +testTortureExecute (void) +{ + const char *args[] = {"a", "b", "c", "d", "e"}; + if (x (5, args) != 0 || check != 2 || o != 5) + ASSERT (0); + return; +} + +int x (int argc, const char **argv) +{ + int opt = 0; + char *g = 0; + const char *p = 0; + + if (argc > o && argc > 2 && argv[o]) + { + g = s (argv[o], &p); + if (g) + { + *g++ = '\0'; + h = s (g, &p); + if (g == p) + h = m (g); + } + u = s (argv[o], &p); + if (argv[o] == p) + u = m (argv[o]); + } + else + ASSERT (0); + + while (++o < argc) + if (r (argv[o]) == 0) + return 1; + + return 0; +} + +char *m (const char *x) { ASSERT (0); return 0;} +char *s (const char *v, const char **pp) +{ + if (strcmp (v, "a") != 0 || check++ > 1) + ASSERT (0); + *pp = v+1; + return 0; +} + +int r (const char *f) +{ + static char c[2] = "b"; + static int cnt = 0; + + if (*f != *c || f[1] != c[1] || cnt > 3) + ASSERT (0); + c[0]++; + cnt++; + return 1; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010924-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010924-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010924-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010924-1.c 2012-05-05 14:39:36.000000000 +0000 @@ -0,0 +1,85 @@ +/* + 20010924-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 147 +#pragma disable_warning 196 +#endif + +/* Verify that flexible arrays can be initialized from STRING_CST + constructors. */ + +/* Baselines. */ +struct { + char a1c; + char *a1p; +} a1 = { + '4', + "62" +}; + +struct { + char a2c; + char a2p[2]; +} a2 = { + 'v', + "cq" +}; + +/* The tests. */ +struct { + char a3c; + char a3p[]; +} a3 = { + 'o', + "wx" +}; + +struct { + char a4c; + char a4p[]; +} a4 = { + '9', + { 'e', 'b' } +}; + +void +testTortureExecute (void) +{ + if (a1.a1c != '4') + ASSERT(0); + if (a1.a1p[0] != '6') + ASSERT(0); + if (a1.a1p[1] != '2') + ASSERT(0); + if (a1.a1p[2] != '\0') + ASSERT(0); + + if (a2.a2c != 'v') + ASSERT(0); + if (a2.a2p[0] != 'c') + ASSERT(0); + if (a2.a2p[1] != 'q') + ASSERT(0); + + if (a3.a3c != 'o') + ASSERT(0); + if (a3.a3p[0] != 'w') + ASSERT(0); + if (a3.a3p[1] != 'x') + ASSERT(0); + + if (a4.a4c != '9') + ASSERT(0); + if (a4.a4p[0] != 'e') + ASSERT(0); + if (a4.a4p[1] != 'b') + ASSERT(0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010925-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010925-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20010925-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20010925-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,34 @@ +/* + 20010925-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +int foo (void *, void *, unsigned int c); + +int src[10]; +int dst[10]; + +void +testTortureExecute (void) +{ + if (foo (dst, src, 10) != 0) + ASSERT (0); + return; +} + +int foo (void *a, void *b, unsigned int c) +{ + if (c == 0) + return 1; + + memcpy (a, b, c); + return 0; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011008-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011008-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011008-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011008-3.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,118 @@ +/* + 20011008-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +// Hmm, this test uses identifiers tarting in __, which are reserved for the implementation. We probably should rename them. Philipp + +// TODO: Enable when sdcc supports struct assignment. +#if 0 +#include + +typedef uint32_t u_int32_t; +typedef uint8_t u_int8_t; + +typedef enum { + TXNLIST_DELETE, + TXNLIST_LSN, + TXNLIST_TXNID, + TXNLIST_PGNO +} db_txnlist_type; + +struct __db_lsn; typedef struct __db_lsn DB_LSN; +struct __db_lsn { + u_int32_t file; + u_int32_t offset; +}; +struct __db_txnlist; typedef struct __db_txnlist DB_TXNLIST; + +struct __db_txnlist { + db_txnlist_type type; + struct { struct __db_txnlist *le_next; struct __db_txnlist **le_prev; } links; + union { + struct { + u_int32_t txnid; + int32_t generation; + int32_t aborted; + } t; + struct { + + + u_int32_t flags; + int32_t fileid; + u_int32_t count; + char *fname; + } d; + struct { + int32_t ntxns; + int32_t maxn; + DB_LSN *lsn_array; + } l; + struct { + int32_t nentries; + int32_t maxentry; + char *fname; + int32_t fileid; + void *pgno_array; + u_int8_t uid[20]; + } p; + } u; +}; + +int log_compare (const DB_LSN *a, const DB_LSN *b) +{ + return 1; +} + +int +__db_txnlist_lsnadd(int val, DB_TXNLIST *elp, DB_LSN *lsnp, u_int32_t flags) +{ + int i; + + for (i = 0; i < (!(flags & (0x1)) ? 1 : elp->u.l.ntxns); i++) + { + int __j; + DB_LSN __tmp; + val++; + for (__j = 0; __j < elp->u.l.ntxns - 1; __j++) + if (log_compare(&elp->u.l.lsn_array[__j], &elp->u.l.lsn_array[__j + 1]) < 0) + { + __tmp = elp->u.l.lsn_array[__j]; + elp->u.l.lsn_array[__j] = elp->u.l.lsn_array[__j + 1]; + elp->u.l.lsn_array[__j + 1] = __tmp; + } + } + + *lsnp = elp->u.l.lsn_array[0]; + return val; +} + +#define VLEN 1235 +#endif + +void +testTortureExecute (void) +{ +#if 0 + DB_TXNLIST el; + DB_LSN lsn, lsn_a[VLEN]; + + el.u.l.ntxns = VLEN-1; + el.u.l.lsn_array = lsn_a; + + if (__db_txnlist_lsnadd (0, &el, &lsn, 0) != 1) + ASSERT (0); + + if (__db_txnlist_lsnadd (0, &el, &lsn, 1) != VLEN-1) + ASSERT (0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011019-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011019-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011019-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011019-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,27 @@ +/* + 20011019-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct { int a; int b[5]; } x; +int *y; + +int foo (void) +{ + return y - x.b; +} + +void +testTortureExecute (void) +{ + y = x.b; + if (foo ()) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011024-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011024-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011024-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011024-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,31 @@ +/* + 20011024-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Test whether store motion recognizes pure functions as potentially reading + any memory. */ + +#include + +char buf[50]; + +static void foo (void) +{ + if (memcpy (buf, "abc", 4) != buf) ASSERT (0); + if (strcmp (buf, "abc")) ASSERT (0); + memcpy (buf, "abcdefgh", strlen ("abcdefgh") + 1); +} + +void +testTortureExecute (void) +{ + foo (); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011109-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011109-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011109-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011109-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,70 @@ +/* + 20011109-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void fail1(void) +{ + ASSERT (0); +} +void fail2(void) +{ + ASSERT (0); +} +void fail3(void) +{ + ASSERT (0); +} +void fail4(void) +{ + ASSERT (0); +} + + +void foo(long x) +{ + switch (x) + { + case -6: + fail1 (); break; + case 0: + fail2 (); break; + case 1: case 2: + break; + case 3: case 4: case 5: + fail3 (); + break; + default: + fail4 (); + break; + } + switch (x) + { + + case -3: + fail1 (); break; + case 0: case 4: + fail2 (); break; + case 1: case 3: + break; + case 2: case 8: + ASSERT (0); + break; + default: + fail4 (); + break; + } +} + +void +testTortureExecute (void) +{ + foo (1); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011109-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011109-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011109-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011109-2.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,22 @@ +/* + 20011109-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ + const char *c1 = "foo"; + const char *c2 = "foo"; + int i; + for (i = 0; i < 3; i++) + if (c1[i] != c2[i]) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011113-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011113-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011113-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011113-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,69 @@ +/* + 20011113-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports struct assignment! +#if 0 +#include + +typedef struct t +{ + unsigned a : 16; + unsigned b : 8; + unsigned c : 8; + long d[4]; +} *T; + +typedef struct { + long r[3]; +} U; + +T bar (U, unsigned int); + +T foo (T x) +{ + U d, u; + + memcpy (&u, &x->d[1], sizeof u); + d = u; + return bar (d, x->b); +} + +T baz (T x) +{ + U d, u; + + d.r[0] = 0x123456789; + d.r[1] = 0xfedcba987; + d.r[2] = 0xabcdef123; + memcpy (&u, &x->d[1], sizeof u); + d = u; + return bar (d, x->b); +} + +T bar (U d, unsigned int m) +{ + if (d.r[0] != 21 || d.r[1] != 22 || d.r[2] != 23) + ASSERT (0); + return 0; +} + +struct t t = { 26, 0, 0, { 0, 21, 22, 23 }}; +#endif + +void +testTortureExecute (void) +{ +#if 0 + baz (&t); + foo (&t); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011114-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011114-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011114-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011114-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,23 @@ +/* + 20011114-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +char foo(char bar[]) +{ + return bar[1]; +} +extern char foo(char *); +void +testTortureExecute (void) +{ + if (foo("xy") != 'y') + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011126-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011126-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011126-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011126-1.c 2012-03-30 11:52:34.000000000 +0000 @@ -0,0 +1,34 @@ +/* + 20011126-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Produced a overflow in ifcvt.c, causing S to contain 0xffffffff7fffffff. */ + +int a = 1; + +void +testTortureExecute (void) +{ +// TODO: Enable when sdcc supports long long constants! +#if 0 + long long s; + + s = a; + if (s < 0) + s = -2147483648LL; + else + s = 2147483647LL; + + if (s < 0) + ASSERT (0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011126-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011126-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011126-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011126-2.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,55 @@ +/* + 20011126-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Problem originally visible on ia64. + + There is a partial redundancy of "in + 1" that makes GCSE want to + transform the final while loop to + + p = in + 1; + tmp = p; + ... + goto start; + top: + tmp = tmp + 1; + start: + in = tmp; + if (in < p) goto top; + + We miscalculate the number of loop iterations as (p - tmp) = 0 + instead of (p - in) = 1, which results in overflow in the doloop + optimization. */ + +static const char * +test (const char *in, char *out) +{ + while (1) + { + if (*in == 'a') + { + const char *p = in + 1; + while (*p == 'x') + ++p; + if (*p == 'b') + return p; + while (in < p) + *out++ = *in++; + } + } +} + +void +testTortureExecute (void) +{ + char out[4]; + test ("aab", out); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011128-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011128-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011128-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011128-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,17 @@ +/* + 20011128-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ + char blah[33] = "01234567890123456789"; + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011217-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011217-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011217-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011217-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,22 @@ +/* + 20011217-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +void +testTortureExecute (void) +{ + double x = 1.0; + double y = 2.0; + + if ((y > x--) != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011219-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011219-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011219-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011219-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,59 @@ +/* + 20011219-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#pragma disable_warning 84 +#endif + +/* This testcase failed on IA-32 at -O and above, because combine attached + a REG_LABEL note to jump instruction already using JUMP_LABEL. */ + +enum X { A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q }; + +void +bar (const char *x, int y, const char *z) +{ +} + +long +foo (enum X x, const void *y) +{ + long a; + + switch (x) + { + case K: + a = *(long *)y; + break; + case L: + a = *(long *)y; + break; + case M: + a = *(long *)y; + break; + case N: + a = *(long *)y; + break; + case O: + a = *(long *)y; + break; + default: + bar ("foo", 1, "bar"); + } + return a; +} + +void +testTortureExecute (void) +{ + long i = 24; + if (foo (N, &i) != 24) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011223-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011223-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20011223-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20011223-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,30 @@ +/* + 20011223-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Origin: Joseph Myers . */ +/* Case labels in a switch statement are converted to the promoted + type of the controlling expression, not an unpromoted version. + Reported as PR c/2454 by + Andreas Krakowczyk . */ + +static int i; + +void +testTortureExecute (void) +{ + i = -1; + switch ((signed char) i) { + case 255: + ASSERT (0); + default: + return; + } +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030105-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030105-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030105-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030105-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,30 @@ +/* + 20030105-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +foo () +{ + const int a[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; + int i, sum; + + sum = 0; + for (i = 0; i < sizeof (a) / sizeof (*a); i++) + sum += a[i]; + + return sum; +} + +void +testTortureExecute (void) +{ + if (foo () != 28) + ASSERT (0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030117-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030117-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030117-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030117-1.c 2012-03-25 20:53:53.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 20030117-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int foo (int, int, int); +int bar (int, int, int); + +void +testTortureExecute (void) +{ + if (foo (5, 10, 21) != 12) + ASSERT (0); + + if (bar (9, 12, 15) != 150) + ASSERT (0); + + return; +} + +int foo (int x, int y, int z) +{ + return (x + y + z) / 3; +} + +int bar (int x, int y, int z) +{ + return foo (x * x, y * y, z * z); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030120-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030120-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030120-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030120-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,61 @@ +/* + 20030120-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* On H8/300 port, NOTICE_UPDATE_CC had a bug that causes the final + pass to remove test insns that should be kept. */ + +unsigned short +t1 (unsigned short w) +{ + if ((w & 0xff00) == 0) + { + if (w == 0) + w = 2; + } + return w; +} + +unsigned long +t2 (unsigned long w) +{ + if ((w & 0xffff0000) == 0) + { + if (w == 0) + w = 2; + } + return w; +} + +int +t3 (unsigned short a) +{ + if (a & 1) + return 1; + else if (a) + return 1; + else + return 0; +} + +void +testTortureExecute (void) +{ + if (t1 (1) != 1) + ASSERT (0); + + if (t2 (1) != 1) + ASSERT (0); + + if (t3 (2) != 1) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030120-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030120-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030120-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030120-2.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,29 @@ +/* + 20030120-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR 8848 */ + +int foo(int status) +{ + int s = 0; + if (status == 1) s=1; + if (status == 3) s=3; + if (status == 4) s=4; + return s; +} + +void +testTortureExecute (void) +{ + if (foo (3) != 3) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030125-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030125-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030125-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030125-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,47 @@ +/* + 20030125-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports double! +#if 0 +/* Verify whether math functions are simplified. */ +#include + +float +t(float a) +{ + return sin(a); +} +float +q(float a) +{ + return floor(a); +} +double +q1(float a) +{ + return floor(a); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + if (t(0)!=0) + ASSERT (0); + if (q(0)!=0) + ASSERT (0); + if (q1(0)!=0) + ASSERT (0); + return; +#endif +} + + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030128-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030128-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030128-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030128-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,22 @@ +/* + 20030128-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +unsigned char x = 50; +volatile short y = -5; + +void +testTortureExecute (void) +{ + x /= y; + if (x != (unsigned char) -10) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030203-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030203-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030203-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030203-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 20030203-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +void f(int); +int do_layer3(int single) +{ + int stereo1; + + if(single >= 0) /* stream is stereo, but force to mono */ + stereo1 = 1; + else + stereo1 = 2; + f(single); + + return stereo1; +} + +void +testTortureExecute (void) +{ + if (do_layer3(-1) != 2) + ASSERT (0); + return; +} + +void f(int i) {} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030209-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030209-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030209-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030209-1.c 2012-05-18 17:15:09.000000000 +0000 @@ -0,0 +1,40 @@ +/* + 20030209-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +#ifndef __SDCC_mcs51 +#ifndef __SDCC_gbz80 +#ifndef __SDCC_hc08 +#ifndef __SDCC_s08 +double x[100][100]; /* Too big for mcs51 and gbz80. */ +#endif +#endif +#endif +#endif +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 +#ifndef __SDCC_gbz80 +#ifndef __SDCC_hc08 +#ifndef __SDCC_s08 + int i; + + i = 99; + x[i][0] = 42; + if (x[99][0] != 42) + ASSERT (0); + return; +#endif +#endif +#endif +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030218-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030218-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030218-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030218-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,33 @@ +/* + 20030218-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* On H8, the predicate general_operand_src(op,mode) used to ignore + mode when op is a (mem (post_inc ...)). As a result, the pattern + for extendhisi2 was recognized as extendqisi2. */ + +short *q; + +long +foo (short *p) +{ + long b = *p; + q = p + 1; + return b; +} + +void +testTortureExecute (void) +{ + short a = 0xff00; + if (foo (&a) != (long) (short) 0xff00) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030221-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030221-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030221-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030221-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,29 @@ +/* + 20030221-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +/* PR optimization/8613 */ +/* Contributed by Glen Nakamura */ + +void +testTortureExecute (void) +{ + char buf[16] = "1234567890"; + char *p = buf; + + *p++ = (char) strlen (buf); + + if ((buf[0] != 10) || (p - buf != 1)) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030307-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030307-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030307-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030307-1.c 2012-05-18 17:15:09.000000000 +0000 @@ -0,0 +1,42 @@ +/* + 20030307-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif +// TODO: Enable when all ports support long long! +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + +/* PR optimization/8726 */ +/* Originator: Paul Eggert */ + +/* Verify that GCC doesn't miscompile tail calls on Sparc. */ + +int fcntl_lock(int fd, int op, long long offset, long long count, int type); + +int vfswrap_lock(char *fsp, int fd, int op, long long offset, long long count, int type) +{ + return fcntl_lock(fd, op, offset, count, type); +} + +int fcntl_lock(int fd, int op, long long offset, long long count, int type) +{ + return type; +} +#endif + +void +testTortureExecute (void) +{ +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + if (vfswrap_lock (0, 1, 2, 3, 4, 5) != 5) + ASSERT (0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030313-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030313-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030313-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030313-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,81 @@ +/* + 20030313-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct A +{ + unsigned long p, q, r, s; +} x = { 13, 14, 15, 16 }; + +extern void abort (void); +extern void exit (int); + +static inline struct A * +bar (void) +{ + struct A *r; + + switch (8) + { + case 2: + ASSERT (0); + break; + case 8: + r = &x; + break; + default: + ASSERT (0); + break; + } + return r; +} + +void +foo (unsigned long *x, int y) +{ + if (y != 12) + ASSERT (0); + if (x[0] != 1 || x[1] != 11) + ASSERT (0); + if (x[2] != 2 || x[3] != 12) + ASSERT (0); + if (x[4] != 3 || x[5] != 13) + ASSERT (0); + if (x[6] != 4 || x[7] != 14) + ASSERT (0); + if (x[8] != 5 || x[9] != 15) + ASSERT (0); + if (x[10] != 6 || x[11] != 16) + ASSERT (0); +} + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + unsigned long a[40]; + int b = 0; + + a[b++] = 1; + a[b++] = 11; + a[b++] = 2; + a[b++] = 12; + a[b++] = 3; + a[b++] = bar()->p; + a[b++] = 4; + a[b++] = bar()->q; + a[b++] = 5; + a[b++] = bar()->r; + a[b++] = 6; + a[b++] = bar()->s; + foo (a, b); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030316-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030316-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030316-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030316-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,23 @@ +/* + 20030316-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR target/9164 */ +/* The comparison operand was sign extended erraneously. */ + +void +testTortureExecute (void) +{ + long j = 0x40000000; + if ((unsigned int) (0x40000000 + j) < 0L) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030401-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030401-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030401-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030401-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,36 @@ +/* + 20030401-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Testcase for PR fortran/9974. This was a miscompilation of the g77 + front-end caused by the jump bypassing optimizations not handling + instructions inserted on CFG edges. */ + +int bar () +{ + return 1; +} + +void foo (int x) +{ + unsigned char error = 0; + + if (! (error = ((x == 0) || bar ()))) + bar (); + if (! error) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + foo (1); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030403-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030403-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030403-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030403-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,26 @@ +/* + 20030403-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* The non-destructive folder was always emitting >= when folding + comparisons to signed_max+1. */ + +#include + +void +testTortureExecute (void) +{ + unsigned long count = 8; + + if (count > INT_MAX) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030408-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030408-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030408-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030408-1.c 2012-05-21 12:05:21.000000000 +0000 @@ -0,0 +1,69 @@ +/* + 20030408-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +/* PR optimization/8634 */ +/* Contributed by Glen Nakamura */ + +struct foo { + char a, b, c, d, e, f, g, h, i, j; +}; + +int test1 () +{ + const char X[8] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' }; + char buffer[8]; + memcpy (buffer, X, 8); + if (buffer[0] != 'A' || buffer[1] != 'B' + || buffer[2] != 'C' || buffer[3] != 'D' + || buffer[4] != 'E' || buffer[5] != 'F' + || buffer[6] != 'G' || buffer[7] != 'H') + ASSERT (0); + return 0; +} + +int test2 () +{ + const char X[10] = { 'A', 'B', 'C', 'D', 'E' }; + char buffer[10]; + memcpy (buffer, X, 10); + if (buffer[0] != 'A' || buffer[1] != 'B' + || buffer[2] != 'C' || buffer[3] != 'D' + || buffer[4] != 'E' || buffer[5] != '\0' + || buffer[6] != '\0' || buffer[7] != '\0' + || buffer[8] != '\0' || buffer[9] != '\0') + ASSERT (0); + return 0; +} + +int test4 () +{ + const struct foo X = { .b = 'B', .d = 'D', .f = 'F', .h = 'H' , .j = 'J' }; + char buffer[10]; + memcpy (buffer, &X, 10); + if (buffer[0] != '\0' || buffer[1] != 'B' + || buffer[2] != '\0' || buffer[3] != 'D' + || buffer[4] != '\0' || buffer[5] != 'F' + || buffer[6] != '\0' || buffer[7] != 'H' + || buffer[8] != '\0' || buffer[9] != 'J') + ASSERT (0); + return 0; +} + +void +testTortureExecute (void) +{ +#if !defined (__SDCC_z80) && !defined (__SDCC_z180) && !defined (__SDCC_r2k) && !defined (__SDCC_r3ka) && !defined (__SDCC_gbz80) && !defined (__SDCC_mcs51) + test1 (); test2 (); test4 (); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030606-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030606-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030606-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030606-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,40 @@ +/* + 20030606-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +int * foo (int *x, int b) +{ + + *(x++) = 55; + if (b) + *(x++) = b; + + return x; +} + +void +testTortureExecute (void) +{ + int a[5]; + + memset (a, 1, sizeof (a)); + + if (foo (a, 0) - a != 1 || a[0] != 55 || a[1] != a[4]) + ASSERT (0); + + memset (a, 1, sizeof (a)); + + if (foo (a, 2) - a != 2 || a[0] != 55 || a[1] != 2) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030613-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030613-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030613-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030613-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,76 @@ +/* + 20030613-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports struct assignment! +#if 0 +/* PR optimization/10955 */ +/* Originator: */ + +/* This used to fail on SPARC32 at -O3 because the loop unroller + wrongly thought it could eliminate a pseudo in a loop, while + the pseudo was used outside the loop. */ + +#define COMPLEX struct CS + +COMPLEX { + long x; + long y; +}; + + +static COMPLEX CCID (COMPLEX x) +{ + COMPLEX a; + + a.x = x.x; + a.y = x.y; + + return a; +} + + +static COMPLEX CPOW (COMPLEX x, int y) +{ + COMPLEX a; + a = x; + + while (--y > 0) + a=CCID(a); + + return a; +} + + +static int c5p (COMPLEX x) +{ + COMPLEX a,b; + a = CPOW (x, 2); + b = CCID( CPOW(a,2) ); + + return (b.x == b.y); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + COMPLEX x; + + x.x = -7; + x.y = -7; + + if (!c5p(x)) + ASSERT(0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030626-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030626-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030626-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030626-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,23 @@ +/* + 20030626-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +char buf[10]; + +void +testTortureExecute (void) +{ + int l = sprintf (buf, "foo\0bar"); + if (l != 3) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030626-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030626-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030626-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030626-2.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,24 @@ +/* + 20030626-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +char buf[40]; + +void +testTortureExecute (void) +{ + int i = 0; + int l = sprintf (buf, "%s", i++ ? "string" : "other string"); + if (l != sizeof ("other string") - 1 || i != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030714-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030714-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030714-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030714-1.c 2012-03-13 11:03:51.000000000 +0000 @@ -0,0 +1,205 @@ +/* + 20030714-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5)) +/* derived from PR optimization/11440 */ + +typedef _Bool bool; +const bool false = 0; +const bool true = 1; + +enum EPosition +{ + STATIC, RELATIVE, ABSOLUTE, FIXED +}; +typedef enum EPosition EPosition; + +enum EFloat +{ + FNONE = 0, FLEFT, FRIGHT +}; +typedef enum EFloat EFloat; + +struct RenderBox +{ + int unused[6]; + short m_verticalPosition; + + bool m_layouted : 1; + bool m_unused : 1; + bool m_minMaxKnown : 1; + bool m_floating : 1; + + bool m_positioned : 1; + bool m_overhangingContents : 1; + bool m_relPositioned : 1; + bool m_paintSpecial : 1; + + bool m_isAnonymous : 1; + bool m_recalcMinMax : 1; + bool m_isText : 1; + bool m_inline : 1; + + bool m_replaced : 1; + bool m_mouseInside : 1; + bool m_hasFirstLine : 1; + bool m_isSelectionBorder : 1; + + bool (*isTableCell) (struct RenderBox *this); +}; + +typedef struct RenderBox RenderBox; + +struct RenderStyle +{ + struct NonInheritedFlags + { + union + { + struct + { + unsigned int _display : 4; + unsigned int _bg_repeat : 2; + bool _bg_attachment : 1; + unsigned int _overflow : 4 ; + unsigned int _vertical_align : 4; + unsigned int _clear : 2; + EPosition _position : 2; + EFloat _floating : 2; + unsigned int _table_layout : 1; + bool _flowAroundFloats :1; + + unsigned int _styleType : 3; + bool _hasHover : 1; + bool _hasActive : 1; + bool _clipSpecified : 1; + unsigned int _unicodeBidi : 2; + int _unused : 1; + } f; + int _niflags; + }; + } noninherited_flags; +}; + +typedef struct RenderStyle RenderStyle; + +extern void RenderObject_setStyle(RenderBox *this, RenderStyle *_style); +extern void removeFromSpecialObjects(RenderBox *this); + + + +void RenderBox_setStyle(RenderBox *thisin, RenderStyle *_style) +{ + RenderBox *this = thisin; + bool oldpos, tmp; + EPosition tmppo; + + tmp = this->m_positioned; + + oldpos = tmp; + + RenderObject_setStyle(this, _style); + + tmppo = _style->noninherited_flags.f._position; + + switch(tmppo) + { + case ABSOLUTE: + case FIXED: + { + bool ltrue = true; + this->m_positioned = ltrue; + break; + } + + default: + { + EFloat tmpf; + EPosition tmpp; + if (oldpos) + { + bool ltrue = true; + this->m_positioned = ltrue; + removeFromSpecialObjects(this); + } + { + bool lfalse = false; + this->m_positioned = lfalse; + } + + tmpf = _style->noninherited_flags.f._floating; + + if(!this->isTableCell (this) && !(tmpf == FNONE)) + { + bool ltrue = true; + this->m_floating = ltrue; + } + else + { + tmpp = _style->noninherited_flags.f._position; + if (tmpp == RELATIVE) + { + bool ltrue = true; + this->m_relPositioned = ltrue; + } + } + } + } +} + + + + +RenderBox g_this; +RenderStyle g__style; + +void RenderObject_setStyle(RenderBox *this, RenderStyle *_style) +{ + (void) this; + (void) _style; +} + +void removeFromSpecialObjects(RenderBox *this) +{ + (void) this; +} + +bool RenderBox_isTableCell (RenderBox *this) +{ + (void) this; + return false; +} +#endif + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5)) + g_this.m_relPositioned = false; + g_this.m_positioned = false; + g_this.m_floating = false; + g_this.isTableCell = RenderBox_isTableCell; + + g__style.noninherited_flags.f._position = FIXED; + g__style.noninherited_flags.f._floating = FNONE; + + RenderBox_setStyle (&g_this, &g__style); + + if (g_this.m_positioned != true) + ASSERT (0); + if (g_this.m_relPositioned != false) + ASSERT (0); + if (g_this.m_floating != false) + ASSERT (0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030715-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030715-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030715-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030715-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,49 @@ +/* + 20030715-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +#include + +/* PR optimization/11320 */ +/* Origin: Andreas Schwab */ + +/* Verify that the scheduler correctly computes the dependencies + in the presence of conditional instructions. */ + +int ap_standalone; + +const char *ap_check_cmd_context (void *a, int b) +{ + return 0; +} + +const char *server_type (void *a, void *b, char *arg) +{ + const char *err = ap_check_cmd_context (a, 0x01|0x02|0x04|0x08|0x10); + if (err) + return err; + + if (!strcmp (arg, "inetd")) + ap_standalone = 0; + else if (!strcmp (arg, "standalone")) + ap_standalone = 1; + else + return "ServerType must be either 'inetd' or 'standalone'"; + + return 0; +} + +void +testTortureExecute (void) +{ + server_type (0, 0, "standalone"); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030717-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030717-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030717-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030717-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,82 @@ +/* + 20030717-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +/* PR target/11087 + This testcase was miscompiled on ppc64, because basic_induction_var called + convert_modes, yet did not expect it to emit any new instructions. + Those were emitted at the end of the function and destroyed during life + analysis, while the program used uninitialized pseudos created by + convert_modes. */ + +struct A +{ + unsigned short a1; + unsigned long a2; +}; + +struct B +{ + int b1, b2, b3, b4, b5; +}; + +struct C +{ + struct B c1[1]; + int c2, c3; +}; + +static +int foo (int x) +{ + return x < 0 ? -x : x; +} + +int bar (struct C *x, struct A *y) +{ + int a = x->c3; + const int b = y->a1 >> 9; + const unsigned long c = y->a2; + int d = a; + unsigned long e, f; + + f = foo (c - x->c1[d].b4); + do + { + if (d <= 0) + d = x->c2; + d--; + + e = foo (c-x->c1[d].b4); + if (e < f) + a = d; + } + while (d != x->c3); + x->c1[a].b4 = c + b; + return a; +} + +void +testTortureExecute (void) +{ + struct A a; + struct C b; + int c; + + a.a1 = 512; + a.a2 = 4242; + memset (&b, 0, sizeof (b)); + b.c1[0].b3 = 424242; + b.c2 = 1; + c = bar (&b, &a); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030718-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030718-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030718-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030718-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,23 @@ +/* + 20030718-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR c/10320 + The function temp was not being emitted in a prerelease of 3.4 20030406. + Contributed by pinskia@physics.uc.edu */ + +static inline void temp(); +void +testTortureExecute (void) +{ + temp(); + return; +} +static void temp(){} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030828-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030828-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030828-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030828-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,30 @@ +/* + 20030828-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +const int *p; + +int bar (void) +{ + return *p + 1; +} + +void +testTortureExecute (void) +{ + /* Variable 'i' is never used but it's aliased to a global pointer. The + alias analyzer was not considering that 'i' may be used in the call to + bar(). */ + const int i = 5; + p = &i; + if (bar() != 6) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030828-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030828-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030828-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030828-2.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,40 @@ +/* + 20030828-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct rtx_def +{ + int code; +}; + +void +testTortureExecute (void) +{ + int tmp[2]; + struct rtx_def *r, s; + int *p, *q; + + /* The alias analyzer was creating the same memory tag for r, p and q + because 'struct rtx_def *' is type-compatible with 'int *'. However, + the alias set of 'int[2]' is not the same as 'int *', so variable + 'tmp' was deemed not aliased with anything. */ + r = &s; + r->code = 39; + + /* If 'r' wasn't declared, then q and tmp would have had the same memory + tag. */ + p = tmp; + q = p + 1; + *q = 0; + tmp[1] = 39; + if (*q != 39) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030903-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030903-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030903-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030903-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,34 @@ +/* + 20030903-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +/* Test that we don't let stmt.c think that the enumeration's values are + the entire set of possibilities. Such an assumption is false for C, + but true for other languages. */ + +enum X { X1 = 1, X2, X3, X4 }; +static volatile enum X test = 0; +static void y(int); + +void +testTortureExecute (void) +{ + switch (test) + { + case X1: y(1); break; + case X2: y(2); break; + case X3: y(3); break; + case X4: y(4); break; + } + return; +} + +static void y(int x) { ASSERT (0); } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030909-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030909-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030909-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030909-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,42 @@ +/* + 20030909-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void test(int x, int y) +{ + if (x == y) + ASSERT (0); +} + +void foo(int x, int y) +{ + if (x == y) + goto a; + else + { +a:; + if (x == y) + goto b; + else + { +b:; + if (x != y) + test (x, y); + } + } +} + +void +testTortureExecute (void) +{ + foo (0, 0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030913-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030913-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030913-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030913-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,38 @@ +/* + 20030913-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Assignments via pointers pointing to global variables were being killed + by SSA-DCE. Test contributed by Paul Brook */ + +int glob; + +void +fn2(int ** q) +{ + *q = &glob; +} + +void test() +{ + int *p; + + fn2(&p); + + *p=42; +} + +void +testTortureExecute (void) +{ + test(); + if (glob != 42) ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030914-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030914-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030914-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030914-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,43 @@ +/* + 20030914-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports long double! +#if 0 +/* On IRIX 6, PB is passed partially in registers and partially on the + stack, with an odd number of words in the register part. Check that + the long double stack argument (PC) is still accessed properly. */ + +struct s { int val[16]; }; + +long double f (int pa, struct s pb, long double pc) +{ + int i; + + for (i = 0; i < 16; i++) + pc += pb.val[i]; + return pc; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct s x; + int i; + + for (i = 0; i < 16; i++) + x.val[i] = i + 1; + if (f (1, x, 10000.0L) != 10136.0L) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030914-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030914-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030914-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030914-2.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,38 @@ +/* + 20030914-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports struct assignment! +#if 0 +/* On IRIX 6, PA is passed partially in registers and partially on the + stack. We therefore have two potential uses of pretend_args_size: + one for the partial argument and one for the varargs save area. + Make sure that these uses don't conflict. */ + +struct s { int i[18]; }; + +int f (struct s pa, int pb, ...) +{ + return pb; +} + +struct s gs; +#endif + +void +testTortureExecute (void) +{ +#if 0 + if (f (gs, 0x1234) != 0x1234) + ASSERT (0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030916-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030916-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20030916-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20030916-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,50 @@ +/* + 20030916-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* "i" overflows in f(). Check that x[i] is not treated as a giv. */ +#include + +#if CHAR_BIT == 8 + +void f (unsigned int *x) +{ + unsigned char i; + int j; + + i = 0x10; + for (j = 0; j < 0x10; j++) + { + i += 0xe8; + x[i] = 0; + i -= 0xe7; + } +} + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + unsigned int x[256]; + int i; + + for (i = 0; i < 256; i++) + x[i] = 1; + f (x); + for (i = 0; i < 256; i++) + if (x[i] != (i >= 0x08 && i < 0xf8)) + ASSERT (0); + return; +#endif +} +#else +void +testTortureExecute (void) { return; } +#endif + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031010-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031010-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031010-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031010-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,47 @@ +/* + 20031010-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + + +/* A reminder to process ops in generate_expr_as_of_bb exactly once. */ + +long +foo (long ct, long cf, _Bool p1, _Bool p2, _Bool p3) +{ + long diff; + + diff = ct - cf; + + if (p1) + { + if (p2) + { + if (p3) + { + long tmp = ct; + ct = cf; + cf = tmp; + } + diff = ct - cf; + } + + return diff; + } + + ASSERT (0); +} + +void +testTortureExecute (void) +{ + if (foo(2, 3, 1, 1, 1) == 0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031011-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031011-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031011-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031011-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,40 @@ +/* + 20031011-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Check that MAX_EXPR and MIN_EXPR are working properly. */ + +#define MAX(X,Y) ((X) > (Y) ? (X) : (Y)) +#define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) + +void +testTortureExecute (void) +{ + int ll_bitsize, ll_bitpos; + int rl_bitsize, rl_bitpos; + int end_bit; + + ll_bitpos = 32; ll_bitsize = 32; + rl_bitpos = 0; rl_bitsize = 32; + + end_bit = MAX (ll_bitpos + ll_bitsize, rl_bitpos + rl_bitsize); + if (end_bit != 64) + ASSERT (0); + end_bit = MAX (rl_bitpos + rl_bitsize, ll_bitpos + ll_bitsize); + if (end_bit != 64) + ASSERT (0); + end_bit = MIN (ll_bitpos + ll_bitsize, rl_bitpos + rl_bitsize); + if (end_bit != 32) + ASSERT (0); + end_bit = MIN (rl_bitpos + rl_bitsize, ll_bitpos + ll_bitsize); + if (end_bit != 32) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031012-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031012-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031012-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031012-1.c 2012-03-14 14:38:57.000000000 +0000 @@ -0,0 +1,51 @@ +/* + 20031012-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR optimization/8750 + Used to fail under Cygwin with + -O2 -fomit-frame-pointer + Testcase by David B. Trout */ + +#if defined(STACK_SIZE) && STACK_SIZE < 16000 +#define ARRAY_SIZE (STACK_SIZE / 2) +#define STRLEN (ARRAY_SIZE - 9) +#else +#define ARRAY_SIZE 15000 +#define STRLEN 13371 +#endif + +#include + +static void foo () +{ +#ifndef __SDCC_gbz80 +#ifndef __SDCC_mcs51 + char a[ARRAY_SIZE]; /* Too big for mcs51 and gbz80. */ + + a[0]=0; + memset( &a[0], 0xCD, STRLEN ); + a[STRLEN]=0; + if (strlen(a) != STRLEN) + ASSERT (0); +#endif +#endif +} + +void +testTortureExecute (void) +{ +#ifndef __SDCC_gbz80 +#ifndef __SDCC_mcs51 + foo(); + return; +#endif +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031020-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031020-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031020-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031020-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,32 @@ +/* + 20031020-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR target/12654 + The Alpha backend tried to do a >= 1024 as (a - 1024) >= 0, which fails + for very large negative values. */ +/* Origin: tg@swox.com */ + +#include + +void +foo (long x) +{ + if (x >= 1024) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + foo (LONG_MIN); + foo (LONG_MIN + 10000); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031204-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031204-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031204-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031204-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,62 @@ +/* + 20031204-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +/* PR optimization/13260 */ + +#include +#include + +typedef uint32_t u32; + +u32 in_aton(const char* x) +{ + return 0x0a0b0c0d; +} + +u32 root_nfs_parse_addr(char *name) +{ + u32 addr; + int octets = 0; + char *cp, *cq; + + cp = cq = name; + while (octets < 4) { + while (*cp >= '0' && *cp <= '9') + cp++; + if (cp == cq || cp - cq > 3) + break; + if (*cp == '.' || octets == 3) + octets++; + if (octets < 4) + cp++; + cq = cp; + } + + if (octets == 4 && (*cp == ':' || *cp == '\0')) { + if (*cp == ':') + *cp++ = '\0'; + addr = in_aton(name); + strcpy(name, cp); + } else + addr = (-1); + + return addr; +} + +void +testTortureExecute (void) +{ + static char addr[] = "10.11.12.13:/hello"; + u32 result = root_nfs_parse_addr(addr); + if (result != 0x0a0b0c0d) { ASSERT(0); } + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031211-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031211-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031211-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031211-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,26 @@ +/* + 20031211-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + + +struct a { unsigned int bitfield : 1; }; + +unsigned int x; + +void +testTortureExecute (void) +{ + struct a a = {0}; + x = 0xbeef; + a.bitfield |= x; + if (a.bitfield != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031211-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031211-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031211-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031211-2.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,33 @@ +/* + 20031211-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct a +{ + unsigned int bitfield : 3; +}; + +void foo(unsigned int z); + +void +testTortureExecute (void) +{ + struct a a; + + a.bitfield = 131; + foo (a.bitfield); + return; +} + +void foo(unsigned int z) +{ + if (z != 3) + ASSERT (0); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031214-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031214-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031214-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031214-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,45 @@ +/* + 20031214-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#pragma disable_warning 93 +#endif + +/* PR optimization/10312 */ +/* Originator: Peter van Hoof

*/ + +/* Verify that the strength reduction pass doesn't find + illegitimate givs. */ + +struct +{ + double a; + int n[2]; +} g = { 0., { 1, 2}}; + +int k = 0; + +void +b (int *j) +{ +} + +void +testTortureExecute (void) +{ + int j; + + for (j = 0; j < 2; j++) + k = (k > g.n[j]) ? k : g.n[j]; + + k++; + b (&j); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031215-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031215-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031215-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031215-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,49 @@ +/* + 20031215-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR middle-end/13400 */ +/* The following test used to fail at run-time with a write to read-only + memory, caused by if-conversion converting a conditional write into an + unconditional write. */ + +typedef struct {int c, l; char ch[3];} pstr; +const pstr ao = {2, 2, "OK"}; +const pstr * const a = &ao; + +void test1(void) +{ + if (a->ch[a->l]) { + ((char *)a->ch)[a->l] = 0; + } +} + +void test2(void) +{ + if (a->ch[a->l]) { + ((char *)a->ch)[a->l] = -1; + } +} + +void test3(void) +{ + if (a->ch[a->l]) { + ((char *)a->ch)[a->l] = 1; + } +} + +void +testTortureExecute (void) +{ + test1(); + test2(); + test3(); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031216-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031216-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20031216-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20031216-1.c 2012-03-12 13:38:11.000000000 +0000 @@ -0,0 +1,33 @@ +/* + 20031216-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR optimization/13313 */ +/* Origin: Mike Lerwill */ + +void DisplayNumber (unsigned long v) +{ + if (v != 0x9aL) + ASSERT (0); +} + +unsigned long ReadNumber (void) +{ + return 0x009a0000L; +} + +void +testTortureExecute (void) +{ + unsigned long tmp; + tmp = (ReadNumber() & 0x00ff0000L) >> 16; + DisplayNumber (tmp); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080117-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080117-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080117-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080117-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,37 @@ +/* + 20080117-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +typedef struct gs_imager_state_s { + struct { + int half_width; + int cap; + float miter_limit; + } line_params; +} gs_imager_state; +static const gs_imager_state gstate_initial = { { 1 } }; +void gstate_path_memory(gs_imager_state *pgs) { + /**pgs = gstate_initial; not yet supported by sdcc */ + memcpy (pgs, &gstate_initial, sizeof (gstate_initial)); +} +int gs_state_update_overprint(void) +{ + return gstate_initial.line_params.half_width; +} + +void +testTortureExecute (void) +{ + if (gs_state_update_overprint() != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080408-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080408-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080408-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080408-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,21 @@ +/* + 20080408-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ + short ssi = 126; + unsigned short usi = 65280; + int fail = !(ssi < usi); + if (fail) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080424-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080424-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080424-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080424-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,44 @@ +/* + 20080424-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR tree-optimization/36008 */ + +#ifndef __SDCC_mcs51 +int g[48][3][3]; + +void +bar (int x[3][3], int y[3][3]) +{ + static int i; + if (x != g[i + 8] || y != g[i++]) + ASSERT (0); +} + +static inline void +foo (int x[][3][3]) +{ + int i; + for (i = 0; i < 8; i++) + { + int k = i + 8; + bar (x[k], x[k - 8]); + } +} +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + foo (g); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080506-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080506-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080506-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080506-1.c 2012-03-01 19:24:53.000000000 +0000 @@ -0,0 +1,33 @@ +/* + 20080506-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR middle-end/36137 */ + +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && (__GNUC__ < 5)) + unsigned int u; + int i = -1; + + u = MAX ((unsigned int) MAX (i, 0), 1); + if (u != 1) + ASSERT (0); + + u = MIN ((unsigned int) MAX (i, 0), (unsigned int) i); + if (u != 0) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080506-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080506-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080506-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080506-2.c 2012-03-01 19:24:53.000000000 +0000 @@ -0,0 +1,32 @@ +/* + 20080506-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR middle-end/36013 */ + +void +foo (int **restrict p, int **restrict q) +{ + *p[0] = 1; + *q[0] = 2; + if (*p[0] != 2) + ASSERT (0); +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && (__GNUC__ < 5)) + int a; + int *p1 = &a, *p2 = &a; + foo (&p1, &p2); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080519-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080519-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080519-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080519-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,68 @@ +/* + 20080506-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +typedef unsigned long HARD_REG_SET[2]; +HARD_REG_SET reg_class_contents[2]; + +struct du_chain +{ + struct du_chain *next_use; + int cl; +}; + +void +merge_overlapping_regs (HARD_REG_SET *p) +{ + if ((*p)[0] != -1 || (*p)[1] != -1) + ASSERT (0); +} + +void +regrename_optimize (struct du_chain *this) +{ + HARD_REG_SET this_unavailable; + unsigned long *scan_fp_; + int n_uses; + struct du_chain *last; + + this_unavailable[0] = 0; + this_unavailable[1] = 0; + + n_uses = 0; + for (last = this; last->next_use; last = last->next_use) + { + scan_fp_ = reg_class_contents[last->cl]; + n_uses++; + this_unavailable[0] |= ~ scan_fp_[0]; + this_unavailable[1] |= ~ scan_fp_[1]; + } + if (n_uses < 1) + return; + + scan_fp_ = reg_class_contents[last->cl]; + this_unavailable[0] |= ~ scan_fp_[0]; + this_unavailable[1] |= ~ scan_fp_[1]; + + merge_overlapping_regs (&this_unavailable); +} + +void +testTortureExecute (void) +{ + struct du_chain du1 = { 0, 0 }; + struct du_chain du0 = { &du1, 1 }; + reg_class_contents[0][0] = -1; + reg_class_contents[0][1] = -1; + reg_class_contents[1][0] = 0; + reg_class_contents[1][1] = 0; + regrename_optimize (&du0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080522-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080522-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080522-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080522-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,53 @@ +/* + 20080522-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* This testcase is to make sure we have i in referenced vars and that we + properly compute aliasing for the loads and stores. */ + +static int i; +static int *p = &i; + +int +foo(int *q) +{ + *p = 1; + *q = 2; + return *p; +} + +int +bar(int *q) +{ + *q = 2; + *p = 1; + return *q; +} + +void +testTortureExecute (void) +{ + int j = 0; + + if (foo(&i) != 2) + ASSERT (0); + if (bar(&i) != 1) + ASSERT (0); + if (foo(&j) != 1) + ASSERT (0); + if (j != 2) + ASSERT (0); + if (bar(&j) != 2) + ASSERT (0); + if (j != 2) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080529-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080529-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080529-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080529-1.c 2012-05-18 16:46:53.000000000 +0000 @@ -0,0 +1,33 @@ +/* + 20080529-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR target/36362 */ +#if !(defined (__GNUC__) && __GNUC__ < 5) +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) +int +test (float c) +{ + return !!c * 7LL == 0; +} +#endif +#endif + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && __GNUC__ < 5) +#if !defined(__SDCC_mcs51) && !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + if (test (1.0f) != 0) + ASSERT (0); +#endif + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080604-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080604-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080604-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080604-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,44 @@ +/* + 20080604-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct barstruct { char const* some_string; } x; + +void +foo(void) +{ + if (!x.some_string) + ASSERT (0); +} +void baz(int b) +{ + struct barstruct bar; + struct barstruct* barptr; + if (b) + barptr = &bar; + else + { + barptr = &x + 1; + barptr = barptr - 1; + } + barptr->some_string = "Everything OK"; + foo(); + barptr->some_string = "Everything OK"; +} + +void +testTortureExecute (void) +{ + x.some_string = (void *)0; + baz(0); + if (!x.some_string) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080719-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080719-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20080719-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20080719-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,79 @@ +/* + 20080117-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +typedef uint32_t u32; + +static const u32 deadfish = 0xdeadf155; + +static const u32 cfb_tab8_be[] = { + 0x00000000,0x000000ff,0x0000ff00,0x0000ffff, + 0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff, + 0xff000000,0xff0000ff,0xff00ff00,0xff00ffff, + 0xffff0000,0xffff00ff,0xffffff00,0xffffffff +}; + +static const u32 cfb_tab8_le[] = { + 0x00000000,0xff000000,0x00ff0000,0xffff0000, + 0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00, + 0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff, + 0x0000ffff,0xff00ffff,0x00ffffff,0xffffffff +}; + +static const u32 cfb_tab16_be[] = { + 0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff +}; + +static const u32 cfb_tab16_le[] = { + 0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff +}; + +static const u32 cfb_tab32[] = { + 0x00000000, 0xffffffff +}; + + + + + + +const u32 *xxx(int bpp) +{ + const u32 *tab; + +if (0) return &deadfish; + + switch (bpp) { + case 8: + tab = cfb_tab8_be; + break; + case 16: + tab = cfb_tab16_be; + break; + case 32: + default: + tab = cfb_tab32; + break; + } + + return tab; +} + +void +testTortureExecute (void) +{ + const u32 *a = xxx(8); + int32_t b = a[0]; + if (b != cfb_tab8_be[0]) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20081103-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20081103-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20081103-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20081103-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,36 @@ +/* + 20081103-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +// TODO: Enable when sdcc can pass structures as paramters. + +struct S { char c; char arr[4]; float f; }; + +char A[4] = { '1', '2', '3', '4' }; +#if 0 +void foo (struct S s) +{ + if (memcmp (s.arr, A, 4)) + ASSERT (0); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct S s; + memcpy (s.arr, A, 4); + foo (s); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20081112-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20081112-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20081112-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20081112-1.c 2012-02-27 19:06:03.000000000 +0000 @@ -0,0 +1,27 @@ +/* + 20081112-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +static void foo (int a) +{ + int b = (a - 1) + INT_MIN; + + if (b != INT_MIN) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + foo (1); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20090113-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20090113-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20090113-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20090113-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,77 @@ +/* + 20090113-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#ifndef __SDCC_mcs51 +typedef struct descriptor_dimension +{ + int stride; + int lbound; + int ubound; +} descriptor_dimension; +typedef struct { + int *data; + int dtype; + descriptor_dimension dim[7]; +} gfc_array_i4; + +void +msum_i4 (gfc_array_i4 * const retarray, + gfc_array_i4 * const array, + const int * const pdim) +{ + int count[7]; + int extent[7]; + int * dest; + const int * base; + int dim; + int n; + int len; + + dim = (*pdim) - 1; + len = array->dim[dim].ubound + 1 - array->dim[dim].lbound; + + for (n = 0; n < dim; n++) + { + extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound; + count[n] = 0; + } + + dest = retarray->data; + base = array->data; + + do + { + int result = 0; + + for (n = 0; n < len; n++, base++) + result += *base; + *dest = result; + + count[0]++; + dest += 1; + } + while (count[0] != extent[0]); +} +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + int rdata[3]; + int adata[9]; + gfc_array_i4 retarray = { rdata, 265, { { 1, 1, 3 } } }; + gfc_array_i4 array = { adata, 266, { { 1, 1, 3 }, { 3, 1, 3 } } }; + int dim = 2; + msum_i4 (&retarray, &array, &dim); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20090207-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20090207-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20090207-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20090207-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 20090207-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int foo(int i) +{ + int a[32]; + a[1] = 3; + a[0] = 1; + a[i] = 2; + return a[0]; +} + +void +testTortureExecute (void) +{ + if (foo (0) != 2 + || foo (1) != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20090527-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20090527-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20090527-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20090527-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,50 @@ +/* + 20090527-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +typedef enum { POSITION_ASIS, POSITION_UNSPECIFIED } unit_position; + +typedef enum { STATUS_UNKNOWN, STATUS_UNSPECIFIED } unit_status; + +typedef struct +{ + unit_position position; + unit_status status; +} unit_flags; + +extern void abort (void); + +void +new_unit (unit_flags * flags) +{ + if (flags->status == STATUS_UNSPECIFIED) + flags->status = STATUS_UNKNOWN; + + if (flags->position == POSITION_UNSPECIFIED) + flags->position = POSITION_ASIS; + + switch (flags->status) + { + case STATUS_UNKNOWN: + break; + + default: + ASSERT (0); + } +} + +void +testTortureExecute (void) +{ + unit_flags f; + f.status = STATUS_UNSPECIFIED; + new_unit (&f); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20090623-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20090623-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20090623-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20090623-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 20090623-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int *restrict x; + +int foo (int y) +{ + *x = y; + return *x; +} + +void +testTortureExecute (void) +{ + int i = 0; + x = &i; + if (foo(1) != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20090814-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20090814-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20090814-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20090814-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,34 @@ +/* + 20090814-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +bar (int *a) +{ + return *a; +} +int i; +int +foo (int (*a)[2]) +{ + return bar (&(*a)[i]); +} + +int a[2]; +void +testTortureExecute (void) +{ + a[0] = -1; + a[1] = 42; + i = 1; + if (foo (&a) != 42) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20100316-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20100316-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20100316-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20100316-1.c 2012-06-15 15:43:51.000000000 +0000 @@ -0,0 +1,38 @@ +/* + 20100316-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#ifndef __SDCC_pic16 // TODO: enable when the pic16 ports supports bitfields of size greater than 8 bits! +struct Foo { + int i; + unsigned precision : 10; + unsigned blah : 3; +} f; + +int +foo (struct Foo *p) +{ + struct Foo *q = p; + return (*q).precision; +} +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_pic16 + f.i = -1; + f.precision = 0; + f.blah = -1; + if (foo (&f) != 0) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20100805-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20100805-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20100805-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20100805-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,27 @@ +/* + 20100805.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +unsigned int foo (unsigned int a, unsigned int b) +{ + unsigned i; + a = a & 1; + for (i = 0; i < b; ++i) + a = a << 1 | a >> (sizeof (unsigned int) * 8 - 1); + return a; +} + +void +testTortureExecute (void) +{ + if (foo (1, sizeof (unsigned int) * 8 + 1) != 2) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20100827-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20100827-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20100827-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20100827-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 20100827-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +foo (char *p) +{ + int h = 0; + do + { + if (*p == '\0') + break; + ++h; + if (p == 0) + ASSERT (0); + ++p; + } + while (1); + return h; +} + +void +testTortureExecute (void) +{ + if (foo("a") != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20101013-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20101013-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20101013-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20101013-1.c 2012-05-02 14:14:57.000000000 +0000 @@ -0,0 +1,52 @@ +/* + 20101013-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Some ports do not yet support long long +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + +/* PR rtl-optimization/45912 */ + +static void* +get_addr_base_and_unit_offset (void *base, long long *i) +{ + *i = 0; + return base; +} + +static void* +build_int_cst (void *base, long long offset) +{ + if (offset != 4) + ASSERT (0); + + return base; +} + +static void* +build_ref_for_offset (void *base, long long offset) +{ + long long base_offset; + base = get_addr_base_and_unit_offset (base, &base_offset); + return build_int_cst (base, base_offset + offset / 8); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 // TODO: Renebale when long long integer constants (the 32 below) work! +//#if !defined(__SDCC_mcs51) && !defined(__SDCC_hc08) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + void *ret = build_ref_for_offset ((void *)0, 32); + if (ret != (void *)0) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20101025-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20101025-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-20101025-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-20101025-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,42 @@ +/* + 20101025-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +static int g_7; +static int *volatile g_6 = &g_7; +int g_3; + +static int f1 (int *p_58) +{ + return *p_58; +} + +void f2 (int i); +void f2 (int i) +{ + g_3 = i; +} + +int f3 (void); +int f3 (void) +{ + *g_6 = 1; + f2 (f1 (&g_7)); + return 0; +} + +void +testTortureExecute (void) +{ + f3 (); + if (g_3 != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920202-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920202-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920202-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920202-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,30 @@ +/* + 920202-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +static int rule_text_needs_stack_pop = 0; +static int input_stack_pos = 1; + +f (void) +{ + rule_text_needs_stack_pop = 1; + + if (input_stack_pos <= 0) + return 1; + else + return 0; +} + +void +testTortureExecute (void) +{ + f (); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920409-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920409-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920409-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920409-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,16 @@ +/* + 920409-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +x(void){signed char c=-1;return c<0;} + +void +testTortureExecute (void){if(x()!=1)ASSERT(0);return;} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920411-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920411-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920411-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920411-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 920411-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +long f (char *w) +{ + long k, i, c = 0, x; + char *p = (char*) &x; + for (i = 0; i < 1; i++) + { + for (k = 0; k < sizeof (long); k++) + p[k] = w[k]; + c += x; + } + return c; +} + +void +testTortureExecute (void) +{ + int i; + char a[sizeof (long)]; + + for (i = sizeof (long); --i >= 0;) a[i] = ' '; + if (f (a) != ~0UL / (unsigned char) ~0 * ' ') + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920428-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920428-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920428-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920428-1.c 2012-04-12 17:22:46.000000000 +0000 @@ -0,0 +1,26 @@ +/* + 920428-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +x (const char*s) +{ + char a[1]; + const char *ss = s; + a[*s++] |= 1; + return (int)ss + 1 == (int)s; +} + +void +testTortureExecute (void) +{ + if (x("") != 1) + ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920429-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920429-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920429-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920429-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,16 @@ +/* + 920429-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +typedef unsigned char t;int i,j; +t*f(const t*p){t c;c=*p++;i=((c&2)?1:0);j=(c&7)+1;return p;} + +void +testTortureExecute (void){const t*p0="ab",*p1;p1=f(p0);if(p0+1!=p1)ASSERT(0);return;} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920501-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920501-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920501-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920501-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,26 @@ +/* + 920501-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +int s[2]; + +int +x(int parm) +{ + if(!s[0]) + { + s[1+s[1]]=s[1]; + return 1; + } +} + +void +testTortureExecute (void){s[0]=s[1]=0;if(x(0)!=1)ASSERT(0);return;} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920501-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920501-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920501-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920501-2.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,131 @@ +/* + 920501-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports long long +#if 0 +unsigned long +gcd_ll (unsigned long long x, unsigned long long y) +{ + for (;;) + { + if (y == 0) + return (unsigned long) x; + x = x % y; + if (x == 0) + return (unsigned long) y; + y = y % x; + } +} + +unsigned long long +powmod_ll (unsigned long long b, unsigned e, unsigned long long m) +{ + unsigned t; + unsigned long long pow; + int i; + + if (e == 0) + return 1; + + /* Find the most significant bit in E. */ + t = e; + for (i = 0; t != 0; i++) + t >>= 1; + + /* The most sign bit in E is handled outside of the loop, by beginning + with B in POW, and decrementing I. */ + pow = b; + i -= 2; + + for (; i >= 0; i--) + { + pow = pow * pow % m; + if ((1 << i) & e) + pow = pow * b % m; + } + + return pow; +} + +unsigned long factab[10]; + +void +facts (t, a_int, x0, p) + unsigned long long t; + int a_int; + int x0; + unsigned p; +{ + unsigned long *xp = factab; + unsigned long long x, y; + unsigned long q = 1; + unsigned long long a = a_int; + int i; + unsigned long d; + int j = 1; + unsigned long tmp; + int jj = 0; + + x = x0; + y = x0; + + for (i = 1; i < 10000; i++) + { + x = powmod_ll (x, p, t) + a; + y = powmod_ll (y, p, t) + a; + y = powmod_ll (y, p, t) + a; + + if (x > y) + tmp = x - y; + else + tmp = y - x; + q = (unsigned long long) q * tmp % t; + + if (i == j) + { + jj += 1; + j += jj; + d = gcd_ll (q, t); + if (d != 1) + { + *xp++ = d; + t /= d; + if (t == 1) + { + return; + *xp = 0; + } + } + } + } +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + unsigned long long t; + unsigned x0, a; + unsigned p; + + p = 27; + t = (1ULL << p) - 1; + + a = -1; + x0 = 3; + + facts (t, a, x0, p); + if (factab[0] != 7 || factab[1] != 73 || factab[2] != 262657) + ASSERT(0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920501-6.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920501-6.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920501-6.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920501-6.c 2012-03-30 09:18:32.000000000 +0000 @@ -0,0 +1,106 @@ +/* + 920501-6.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports long long constants! +#if 0 +#include + +/* Convert a decimal string to a long long unsigned. No error check is + performed. */ + +long long unsigned +str2llu (str) + char *str; +{ + long long unsigned acc; + int d; + acc = *str++ - '0'; + for (;;) + { + d = *str++; + if (d == '\0') + break; + d -= '0'; + acc = acc * 10 + d; + } + + return acc; +} + +/* isqrt(t) - computes the square root of t. (tege 86-10-27) */ + +long unsigned +sqrtllu (long long unsigned t) +{ + long long unsigned s; + long long unsigned b; + + for (b = 0, s = t; b++, (s >>= 1) != 0; ) + ; + + s = 1LL << (b >> 1); + + if (b & 1) + s += s >> 1; + + do + { + b = t / s; + s = (s + b) >> 1; + } + while (b < s); + + return s; +} + + +int plist (p0, p1, tab) + long long unsigned p0, p1; + long long unsigned *tab; +{ + long long unsigned p; + long unsigned d; + long unsigned s; + long long unsigned *xp = tab; + + for (p = p0; p <= p1; p += 2) + { + s = sqrtllu (p); + + for (d = 3; d <= s; d += 2) + { + long long unsigned q = p % d; + if (q == 0) + goto not_prime; + } + + *xp++ = p; + not_prime:; + } + *xp = 0; + return xp - tab; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + long long tab[10]; + int nprimes; + nprimes = plist (str2llu ("1234111111"), str2llu ("1234111127"), tab); + + if(tab[0]!=1234111117LL||tab[1]!=1234111121LL||tab[2]!=1234111127LL||tab[3]!=0) + ASSERT(0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920501-8.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920501-8.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920501-8.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920501-8.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,57 @@ +/* + 920501-8.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when double is fully supported! +#if 0 +#include + +#include +#include + +char buf[50]; +int +va (int a, double b, int c, ...) +{ + va_list ap; + int d, e, f, g, h, i, j, k, l, m, n, o, p; + va_start (ap, c); + + d = va_arg (ap, int); + e = va_arg (ap, int); + f = va_arg (ap, int); + g = va_arg (ap, int); + h = va_arg (ap, int); + i = va_arg (ap, int); + j = va_arg (ap, int); + k = va_arg (ap, int); + l = va_arg (ap, int); + m = va_arg (ap, int); + n = va_arg (ap, int); + o = va_arg (ap, int); + p = va_arg (ap, int); + + sprintf (buf, + "%d,%f,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", + a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p); + va_end (ap); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + va (1, 1.0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); + if (strcmp ("1,1.000000,2,3,4,5,6,7,8,9,10,11,12,13,14,15", buf)) + ASSERT(0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920501-9.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920501-9.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920501-9.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920501-9.c 2012-03-30 09:18:32.000000000 +0000 @@ -0,0 +1,45 @@ +/* + 920501-9.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +// Todo: Enable when sdcc supports long long constants! +#if 0 +long long proc1(){return 1LL;} +long long proc2(){return 0x12345678LL;} +long long proc3(){return 0xaabbccdd12345678LL;} +long long proc4(){return -1LL;} +long long proc5(){return 0xaabbccddLL;} + +print_longlong(x,buf) + long long x; + char *buf; +{ + unsigned long l; + l= (x >> 32) & 0xffffffff; + if (l != 0) + sprintf(buf,"%lx%08.lx",l,((unsigned long)x & 0xffffffff)); + else + sprintf(buf,"%lx",((unsigned long)x & 0xffffffff)); +} +#endif + +void +testTortureExecute (void){ +#if 0 +char buf[100]; +print_longlong(proc1(),buf);if(strcmp("1",buf))abort(); +print_longlong(proc2(),buf);if(strcmp("12345678",buf))abort(); +print_longlong(proc3(),buf);if(strcmp("aabbccdd12345678",buf))abort(); +print_longlong(proc4(),buf);if(strcmp("ffffffffffffffff",buf))abort(); +print_longlong(proc5(),buf);if(strcmp("aabbccdd",buf))abort(); +#endif +return;} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920506-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920506-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920506-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920506-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,14 @@ +/* + 920506-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int l[]={0,1}; + +void +testTortureExecute (void){int*p=l;switch(*p++){case 0:return;case 1:break;case 2:break;case 3:case 4:break;}ASSERT(0);} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920520-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920520-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920520-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920520-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,48 @@ +/* + 920520-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +foo(int *bar) +{ + *bar = 8; +} + +bugger() +{ + int oldDepth, newDepth; + + foo(&oldDepth); + + switch (oldDepth) + { + case 8: + case 500: + newDepth = 8; + break; + + case 5000: + newDepth = 500; + break; + + default: + newDepth = 17; + break; + } + + return newDepth - oldDepth; +} + +void +testTortureExecute (void) +{ + if (bugger() != 0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920603-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920603-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920603-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920603-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,20 @@ +/* + 920603-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +f(int got) +{ + if (got!=0xffff) + ASSERT(0); +} + +void +testTortureExecute (void){signed char c=-1;unsigned u=(unsigned short)c;f(u);return;} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920604-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920604-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920604-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920604-1.c 2012-03-30 09:18:32.000000000 +0000 @@ -0,0 +1,29 @@ +/* + 920604-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports long long mod! +#if 0 +long long +mod (a, b) + long long a, b; +{ + return a % b; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + mod (1LL, 2LL); + exit (0); +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920612-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920612-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920612-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920612-1.c 2012-04-01 11:33:10.000000000 +0000 @@ -0,0 +1,26 @@ +/* + 920612-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +f(int j) +{ + return ++j > 0; +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && (__GNUC__ < 5)) + if(f ((~0U) >> 1)) + ASSERT(0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920618-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920618-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920618-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920618-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,13 @@ +/* + 920618-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void){if(1.17549435e-38F<=1.1)return;ASSERT(0);} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920625-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920625-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920625-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920625-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,55 @@ +/* + 920625-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +// Todo. Enable when sdcc supports struct assignment! +#if 0 +typedef struct{double x,y;}point; +point pts[]={{1.0,2.0},{3.0,4.0},{5.0,6.0},{7.0,8.0}}; +static int va1(int nargs,...) +{ + va_list args; + int i; + point pi; + va_start(args,nargs); + for(i=0;i + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ +// Enable when sdcc supports double and unsigned long long. +#if 0 + if ((double) 18446744073709551615ULL < 1.84467440737095e+19 || + (double) 18446744073709551615ULL > 1.84467440737096e+19) + ASSERT(0); + + if (16777217L != (float)16777217e0) + ASSERT(0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920711-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920711-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920711-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920711-1.c 2012-04-01 11:33:10.000000000 +0000 @@ -0,0 +1,25 @@ +/* + 920711-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +f(long a) +{ + return (--a > 0); +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && (__GNUC__ < 5)) + if(f (0x80000000L) == 0) + ASSERT(0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920721-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920721-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920721-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920721-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,13 @@ +/* + 920721-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +long f(short a,short b){return (long)a/b;} +void +testTortureExecute (void){if(f(-32768,-1)!=32768L)ASSERT(0);else return;} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920721-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920721-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920721-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920721-2.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,26 @@ +/* + 920721-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo. Enable when sdcc supports VLA! +#if 0 +void f(void){} +#endif + +void +testTortureExecute (void) +{ +#if 0 + int n=2; + double x[n]; + f(); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920721-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920721-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920721-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920721-3.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,41 @@ +/* + 920721-3.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +static inline fu (unsigned short data) +{ + return data; +} + +void ru(int i) +{ + if(fu(i++)!=5)ASSERT(0); + if(fu(++i)!=7)ASSERT(0); +} + +static inline fs (signed short data) +{ + return data; +} + +void rs(int i) +{ + if(fs(i++)!=5)ASSERT(0); + if(fs(++i)!=7)ASSERT(0); +} + + +void +testTortureExecute (void) +{ + ru(5); + rs(5); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920726-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920726-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920726-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920726-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,82 @@ +/* + 920726-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +// Todo: Enable when sdcc supports returning struct! +#if 0 +#include +#include + +struct spurious +{ + int anumber; +}; + +int first(char *buf, char *fmt, ...) +{ + int pos, number; + va_list args; + int dummy; + char *bp = buf; + + va_start(args, fmt); + for (pos = 0; fmt[pos]; pos++) + if (fmt[pos] == 'i') + { + number = va_arg(args, int); + sprintf(bp, "%d", number); + bp += strlen(bp); + } + else + *bp++ = fmt[pos]; + + va_end(args); + *bp = 0; + return dummy; +} + +struct spurious second(char *buf,char *fmt, ...) +{ + int pos, number; + va_list args; + struct spurious dummy; + char *bp = buf; + + va_start(args, fmt); + for (pos = 0; fmt[pos]; pos++) + if (fmt[pos] == 'i') + { + number = va_arg(args, int); + sprintf(bp, "%d", number); + bp += strlen(bp); + } + else + *bp++ = fmt[pos]; + + va_end(args); + *bp = 0; + return dummy; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + char buf1[100], buf2[100]; + first(buf1, "i i ", 5, 20); + second(buf2, "i i ", 5, 20); + if (strcmp ("5 20 ", buf1) || strcmp ("5 20 ", buf2)) + ASSERT(0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920730-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920730-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920730-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920730-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,44 @@ +/* + 920730-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* 920730-1.c */ +#include +int f1() +{ + int b=INT_MIN; + return b>=INT_MIN; +} + +int f2() +{ + int b=INT_MIN+1; + return b>= (unsigned)(INT_MAX+2); +} + +int f3() +{ + int b=INT_MAX; + return b>=INT_MAX; +} + +int f4() +{ + int b=-1; + return b>=UINT_MAX; +} + +void +testTortureExecute (void) +{ + if((f1()&f2()&f3()&f4())!=1) + ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920731-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920731-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920731-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920731-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,14 @@ +/* + 920731-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int f(int x){int i;for(i=0;i<8&&(x&1)==0;x>>=1,i++);return i;} +void +testTortureExecute (void){if(f(4)!=2)ASSERT(0);return;} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920810-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920810-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920810-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920810-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 920810-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include +#include +#include + +typedef struct{void*super;int name;int size;}t; +t*f(t*clas,int size) +{ + t*child=(t*)malloc(size); + memcpy(child,clas,clas->size); + child->super=clas; + child->name=0; + child->size=size; + return child; +} +void +testTortureExecute (void) +{ + t foo,*bar; + memset(&foo,37,sizeof(t)); + foo.size=sizeof(t); + bar=f(&foo,sizeof(t)); + if(bar->super!=&foo||bar->name!=0||bar->size!=sizeof(t))ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920812-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920812-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920812-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920812-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,15 @@ +/* + 920812-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +typedef int t; +f(t y){switch(y){case 1:return 1;}return 0;} +void +testTortureExecute (void){if(f((t)1)!=1)ASSERT(0);return;} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920829-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920829-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920829-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920829-1.c 2012-03-30 09:18:32.000000000 +0000 @@ -0,0 +1,25 @@ +/* + 920829-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports long long constants! +#if 0 +long long c=2863311530LL,c3=2863311530LL*3; +#endif + +void +testTortureExecute (void) +{ +#if 0 + if(c*3!=c3) + ASSERT(0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920908-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920908-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920908-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920908-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,45 @@ +/* + 920908-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports returning struct! +#if 0 +/* REPRODUCED:RUN:SIGNAL MACHINE:mips OPTIONS: */ + +#include + +typedef struct{int A;}T; + +T f(int x,...) +{ +va_list ap; +T X; +va_start(ap,x); +X=va_arg(ap,T); +if(X.A!=10)abort(); +X=va_arg(ap,T); +if(X.A!=20)abort(); +va_end(ap); +return X; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 +T X,Y; +int i; +X.A=10; +Y.A=20; +f(2,X,Y); +return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920909-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920909-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920909-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920909-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,14 @@ +/* + 920909-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int f(int a){switch(a){case 0x402:return a+1;case 0x403:return a+2;case 0x404:return a+3;case 0x405:return a+4;case 0x406:return 1;case 0x407:return 4;}return 0;} +void +testTortureExecute (void){if(f(1))ASSERT(0);return;} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920922-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920922-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920922-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920922-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 920922-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +unsigned long* +f(unsigned long *p) +{ + unsigned long a = (*p++) >> 24; + return p + a; +} + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + unsigned long x = 0x80000000UL; + if (f(&x) != &x + 0x81) + ASSERT(0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920929-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920929-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-920929-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-920929-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,31 @@ +/* + 920929-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports VLA! +#if 0 +/* REPRODUCED:RUN:SIGNAL MACHINE:sparc OPTIONS: */ +f(int n) +{ +int i; +double v[n]; +for(i=0;i + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +/* REPRODUCED:RUN:SIGNAL MACHINE:i386 OPTIONS:-O */ +void +testTortureExecute (void) +{ +if(strcmp("X","")<0)ASSERT(0); +return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921013-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921013-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921013-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921013-1.c 2012-05-16 16:46:57.000000000 +0000 @@ -0,0 +1,31 @@ +/* + 921013-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void f(int *d, float *x, float *y,int n) +{ + while(n--){*d++=*x++==*y++;} +} + +void +testTortureExecute (void) +{ + int r[4]={2,2,2,2}; + float a[]={5,1,3,5}; + float b[]={2,4,3,0}; + + f(r,a,b,4); +#ifndef __SDCC_USE_XSTACK + ASSERT ((a[0]==b[0]) == r[0]); + ASSERT ((a[1]==b[1]) == r[1]); + ASSERT ((a[2]==b[2]) == r[2]); + ASSERT ((a[3]==b[3]) == r[3]); +#endif + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921016-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921016-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921016-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921016-1.c 2012-06-15 15:43:51.000000000 +0000 @@ -0,0 +1,25 @@ +/* + 921016-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_pic16 // TODO: enable when the pic16 ports supports bitfields of size greater than 8 bits! + int j=1081; + struct + { + signed int m:11; + } l; + if((l.m = j) == j) + ASSERT(0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921019-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921019-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921019-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921019-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,20 @@ +/* + 921019-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void *foo[]={(void *)&("X"[0])}; + +void +testTortureExecute (void) +{ + if (((char*)foo[0])[0] != 'X') + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921019-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921019-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921019-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921019-2.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,21 @@ +/* + 921019-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +void +testTortureExecute (void) +{ + double x,y=0.5; + x=y/0.2; + if(x!=x) + ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921029-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921029-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921029-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921029-1.c 2012-03-30 09:18:32.000000000 +0000 @@ -0,0 +1,59 @@ +/* + 921029-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports unsigned long long constants! +#if 0 +typedef unsigned long long ULL; +ULL back; +ULL hpart, lpart; +ULL +build(long h, long l) +{ + hpart = h; + hpart <<= 32; + lpart = l; + lpart &= 0xFFFFFFFFLL; + back = hpart | lpart; + return back; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + if (build(0, 1) != 0x0000000000000001LL) + ASSERT(0); + if (build(0, 0) != 0x0000000000000000LL) + ASSERT(0); + if (build(0, 0xFFFFFFFF) != 0x00000000FFFFFFFFLL) + ASSERT(0); + if (build(0, 0xFFFFFFFE) != 0x00000000FFFFFFFELL) + ASSERT(0); + if (build(1, 1) != 0x0000000100000001LL) + ASSERT(0); + if (build(1, 0) != 0x0000000100000000LL) + ASSERT(0); + if (build(1, 0xFFFFFFFF) != 0x00000001FFFFFFFFLL) + ASSERT(0); + if (build(1, 0xFFFFFFFE) != 0x00000001FFFFFFFELL) + ASSERT(0); + if (build(0xFFFFFFFF, 1) != 0xFFFFFFFF00000001LL) + ASSERT(0); + if (build(0xFFFFFFFF, 0) != 0xFFFFFFFF00000000LL) + ASSERT(0); + if (build(0xFFFFFFFF, 0xFFFFFFFF) != 0xFFFFFFFFFFFFFFFFLL) + ASSERT(0); + if (build(0xFFFFFFFF, 0xFFFFFFFE) != 0xFFFFFFFFFFFFFFFELL) + ASSERT(0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921104-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921104-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921104-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921104-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,19 @@ +/* + 921104-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ + unsigned long val = 1; + + if (val > (unsigned long) ~0) + ASSERT(0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921112-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921112-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921112-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921112-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,38 @@ +/* + 921112-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +// TODO: Enable when sdcc supports struct! +#if 0 +union u { + struct { int i1, i2; } t; + double d; +} x[2], v; + +void f (union u *x, union u *v) +{ + *++x = v; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + x[1].t.i1 = x[1].t.i2 = 0; + v.t.i1 = 1; + v.t.i2 = 2; + f (x, v); + if (x[1].t.i1 != 1 || x[1].t.i2 != 2) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921117-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921117-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921117-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921117-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,39 @@ +/* + 921117-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports struct! +#if 0 +struct s { + char text[11]; + int flag; +} cell; + +int +check (struct s p) +{ + if (p.flag != 99) + return 1; + return strcmp (p.text, "0123456789"); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + cell.flag = 99; + strcpy (cell.text, "0123456789"); + + if (check (cell)) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921123-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921123-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921123-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921123-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,25 @@ +/* + 921123-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +f(short *p) +{ + short x = *p; + return (--x < 0); +} + +void +testTortureExecute (void) +{ + short x = -10; + if (!f(&x)) + ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921123-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921123-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921123-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921123-2.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,41 @@ +/* + 921123-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports struct! +#if 0 +typedef struct +{ + unsigned short b0, b1, b2, b3; +} four_quarters; + +four_quarters x; +int a, b; + +void f (four_quarters j) +{ + b = j.b2; + a = j.b3; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + four_quarters x; + x.b0 = x.b1 = x.b2 = 0; + x.b3 = 38; + f(x); + if (a != 38) + ASSERT(0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921124-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921124-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921124-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921124-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,30 @@ +/* + 921124-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#pragma disable_warning 85 +#endif + +int f(int x, double d1, double d2, double d3) +{ + return x; +} + +void g(char *b, char *s, double x, double y, int i, int j) +{ + if (x != 1.0 || y != 2.0 || i != 3 || j != 4) + ASSERT(0); +} + +void +testTortureExecute (void) +{ + g("","", 1.0, 2.0, f(3, 0.0, 0.0, 0.0), f(4, 0.0, 0.0, 0.0)); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921202-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921202-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921202-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921202-2.c 2012-03-30 09:18:32.000000000 +0000 @@ -0,0 +1,29 @@ +/* + 921202-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports long long constants! +#if 0 +int +f(long long x) +{ + x >>= 8; + return x & 0xff; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + if (f(0x0123456789ABCDEFLL) != 0xCD) + ASSERT(0); + return; +#endif +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921207-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921207-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921207-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921207-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,27 @@ +/* + 921207-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int f(void) +{ + unsigned b = 0; + + if (b > ~0U) + b = ~0U; + + return b; +} +void +testTortureExecute (void) +{ + if (f()!=0) + ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921208-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921208-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921208-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921208-1.c 2012-05-18 16:39:12.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 921208-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +#if !defined(__SDCC_hc08) && !defined(__SDCC_s08) +double +f(double x) +{ + return x*x; +} + +double +Int(double (*f)(double), double a) +{ + return (*f)(a); +} +#endif + +void +testTortureExecute (void) +{ +#if !defined(__SDCC_hc08) && !defined(__SDCC_s08) + if (Int(&f,2.0) != 4.0) + ASSERT(0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921218-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921218-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921218-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921218-1.c 2012-03-25 06:43:22.000000000 +0000 @@ -0,0 +1,23 @@ +/* + 921218-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int f() +{ + return (unsigned char)("\377"[0]); +} + +void +testTortureExecute (void) +{ + if (f() != (unsigned char)(0377)) + ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921218-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921218-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-921218-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-921218-2.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,29 @@ +/* + 921218-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int f() +{ + long l2; + unsigned short us; + unsigned long ul; + short s2; + + ul = us = l2 = s2 = -1; + return ul; +} + +void +testTortureExecute (void) +{ + if (f()!=(unsigned short)-1) + ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930106-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930106-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930106-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930106-1.c 2012-03-28 07:58:33.000000000 +0000 @@ -0,0 +1,37 @@ +/* + 930106-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#pragma disable_warning 85 +#endif + +#define DUMMY_SIZE 9 + +double g() +{ + return 1.0; +} + +f() +{ + char dummy[DUMMY_SIZE]; + double f1, f2, f3; + f1 = g(); + f2 = g(); + f3 = g(); + return f1 + f2 + f3; +} + +void +testTortureExecute (void) +{ + if (f() != 3.0) + ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930111-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930111-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930111-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930111-1.c 2012-04-02 09:59:13.000000000 +0000 @@ -0,0 +1,43 @@ +/* + 930111-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Some ports do not support long long yet. +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) +int +wwrite(long long i); +#endif + +void +testTortureExecute (void) +{ +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + if (wwrite((long long) 0) != 123) + ASSERT(0); + return; +#endif +} + +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) +int +wwrite(long long i) +{ + switch(i) + { + case 3: + case 10: + case 23: + case 28: + case 47: + return 0; + default: + return 123; + } +} +#endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930123-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930123-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930123-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930123-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 930123-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +f(int *x) +{ + *x = 0; +} + +void +testTortureExecute (void) +{ + int s, c, x; + char a[] = "c"; + + f(&s); + a[c = 0] = s == 0 ? (x=1, 'a') : (x=2, 'b'); + if (a[c] != 'a') + ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930126-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930126-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930126-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930126-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,37 @@ +/* + 930126-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports bitfields alrger than int +#if 0 +struct s { + unsigned long long a:8, b:32; +}; + +struct s +f(struct s x) +{ + x.b = 0xcdef1234; + return x; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + static struct s i; + i.a = 12; + i = f(i); + if (i.a != 12 || i.b != 0xcdef1234) + ASSERT(0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930208-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930208-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930208-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930208-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,40 @@ +/* + 930208-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports union! +#if 0 +typedef union { + long l; + struct { char b3, b2, b1, b0; } c; +} T; + +f (T u) +{ + ++u.c.b0; + ++u.c.b3; + return (u.c.b1 != 2 || u.c.b2 != 2); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + T u; + u.c.b1 = 2; + u.c.b2 = 2; + u.c.b0 = ~0; + u.c.b3 = ~0; + if (f (u)) + ASSERT(0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930406-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930406-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930406-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930406-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 930406-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +void f() +{ + int x = 1; +#ifndef __SDCC_mcs51 + char big[2048]; +#else + char big[2]; +#endif + + { + mylabel: + x++; + if (x != 3) + goto mylabel; + } + return; +} + +void +testTortureExecute (void) +{ + f(); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930408-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930408-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930408-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930408-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,39 @@ +/* + 930408-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +typedef enum foo E; +enum foo { e0, e1 }; + +struct { + E eval; +} s; + +void p() +{ + ASSERT(0); +} + +void f() +{ + switch (s.eval) + { + case e0: + p(); + } +} + +void +testTortureExecute (void) +{ + s.eval = e1; + f(); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930429-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930429-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930429-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930429-1.c 2012-03-25 06:43:22.000000000 +0000 @@ -0,0 +1,26 @@ +/* + 930429-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +const char * +f (const char *p) +{ + short x = *p++ << 16; + return p; +} + +void +testTortureExecute (void) +{ + const char *p = ""; + if (f (p) != p + 1) + ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930429-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930429-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930429-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930429-2.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,26 @@ +/* + 930429-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +f (int b) +{ + return (b >> 1) > 0; +} + +void +testTortureExecute (void) +{ + if (!f (9)) + ASSERT (0); + if (f (-9)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930513-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930513-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930513-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930513-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,29 @@ +/* + 930513-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include +char buf[2]; + +void f (int (*fp)(char *, const char *, ...)) +{ + (*fp)(buf, "%.0f", 5.0); +} + +void +testTortureExecute (void) +{ +#if 0 + f (&sprintf); + if (buf[0] != '5' || buf[1] != 0) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930513-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930513-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930513-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930513-2.c 2012-03-25 06:43:22.000000000 +0000 @@ -0,0 +1,39 @@ +/* + 930513-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +void sub3 (const int *i) +{ +} + +void eq (int a, int b) +{ + static int i = 0; + if (a != i) + ASSERT (0); + i++; +} + +void +testTortureExecute (void) +{ + int i; + + for (i = 0; i < 4; i++) + { + const int j = i; + int k; + sub3 (&j); + k = j; + eq (k, k); + } + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930518-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930518-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930518-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930518-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 930518-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int bar = 0; + +f (int *p) +{ + int foo = 2; + + while (foo > bar) + { + foo -= bar; + *p++ = foo; + bar = 1; + } +} + +void +testTortureExecute (void) +{ + int tab[2]; + tab[0] = tab[1] = 0; + f (tab); + if (tab[0] != 2 || tab[1] != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930526-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930526-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930526-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930526-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,34 @@ +/* + 930526-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#if 0 +inline +void f (int x) +{ + int *(p[25]); + int m[25*7]; + int i; + + for (i = 0; i < 25; i++) + p[i] = m + x*i; + + p[1][0] = 0; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + f (7); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930527-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930527-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930527-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930527-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,23 @@ +/* + 930527-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int f (unsigned char x) +{ + return (0x50 | (x >> 4)) ^ 0xff; +} + +void +testTortureExecute (void) +{ + if (f (0) != 0xaf) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930529-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930529-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930529-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930529-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,57 @@ +/* + 930529-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int dd (int x, int d) { return x / d; } + +void +testTortureExecute (void) +{ + int i; + for (i = -3; i <= 3; i++) + { + if (dd (i, 1) != i / 1) + ASSERT (0); + if (dd (i, 2) != i / 2) + ASSERT (0); + if (dd (i, 3) != i / 3) + ASSERT (0); + if (dd (i, 4) != i / 4) + ASSERT (0); + if (dd (i, 5) != i / 5) + ASSERT (0); + if (dd (i, 6) != i / 6) + ASSERT (0); + if (dd (i, 7) != i / 7) + ASSERT (0); + if (dd (i, 8) != i / 8) + ASSERT (0); + } + for (i = ((unsigned) ~0 >> 1) - 3; i <= ((unsigned) ~0 >> 1) + 3; i++) + { + if (dd (i, 1) != i / 1) + ASSERT (0); + if (dd (i, 2) != i / 2) + ASSERT (0); + if (dd (i, 3) != i / 3) + ASSERT (0); + if (dd (i, 4) != i / 4) + ASSERT (0); + if (dd (i, 5) != i / 5) + ASSERT (0); + if (dd (i, 6) != i / 6) + ASSERT (0); + if (dd (i, 7) != i / 7) + ASSERT (0); + if (dd (i, 8) != i / 8) + ASSERT (0); + } + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930603-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930603-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930603-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930603-1.c 2012-03-22 04:52:47.000000000 +0000 @@ -0,0 +1,37 @@ +/* + 930603-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +float fx (float x) +{ + return 1.0 + 3.0 / (2.302585093 * x); +} + +float inita (); +float initc (); +void f (); + +void +testTortureExecute (void) +{ + float a, b, c; + a = inita (); + c = initc (); + f (); + b = fx (c) + a; + f (); + if (a != 3.0 || b < 4.3257 || b > 4.3258 || c != 4.0) + ASSERT (0); + return; +} + +float inita () { return 3.0; } +float initc () { return 4.0; } +void f () {} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930603-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930603-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930603-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930603-2.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,31 @@ +/* + 930603-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int w[2][2]; + +f () +{ + int i, j; + + for (i = 0; i < 2; i++) + for (j = 0; j < 2; j++) + if (i == j) + w[i][j] = 1; +} + +void +testTortureExecute (void) +{ + f (); + if (w[0][0] != 1 || w[1][1] != 1 || w[1][0] != 0 || w[0][1] != 0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930603-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930603-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930603-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930603-3.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,40 @@ +/* + 930603-3.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int f (unsigned char *b, int c) +{ + unsigned long v = 0; + switch (c) + { + case 'd': + v = ((unsigned long)b[0] << 8) + b[1]; + v >>= 9; + break; + + case 'k': + v = b[3] >> 4; + break; + + default: + ASSERT (0); + } + + return v; +} +void +testTortureExecute (void) +{ + char buf[4]; + buf[0] = 170; buf[1] = 5; + if (f (buf, 'd') != 85) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930614-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930614-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930614-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930614-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,33 @@ +/* + 930614-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#pragma disable_warning 85 +#endif + +void f (double *ty) +{ + *ty = -1.0; +} + +void +testTortureExecute (void) +{ + double foo[6]; + double tx = 0.0, ty, d; + + f (&ty); + + if (ty < 0) + ty = -ty; + d = (tx > ty) ? tx : ty; + if (ty != d) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930614-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930614-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930614-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930614-2.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,34 @@ +/* + 930614-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + int i, j, k, l; + float x[8][2][8][2]; + + for (i = 0; i < 8; i++) + for (j = i; j < 8; j++) + for (k = 0; k < 2; k++) + for (l = 0; l < 2; l++) + { + if ((i == j) && (k == l)) + x[i][k][j][l] = 0.8; + else + x[i][k][j][l] = 0.8; + if (x[i][k][j][l] < 0.0) + ASSERT (0); + } + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930622-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930622-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930622-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930622-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 930622-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +int a = 1, b; + +int g () { return 0; } +void h (int x) {} + +int f () +{ + if (g () == -1) + return 0; + a = g (); + if (b >= 1) + h (a); + return 0; +} + +void +testTortureExecute (void) +{ + f (); + if (a != 0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930622-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930622-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930622-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930622-2.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,41 @@ +/* + 930622-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports long double and long long! +#if 0 +long double +ll_to_ld (long long n) +{ + return n; +} + +long long +ld_to_ll (long double n) +{ + return n; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + long long n; + + if (ll_to_ld (10LL) != 10.0) + ASSERT (0); + + if (ld_to_ll (10.0) != 10) + ASSERT (0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930628-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930628-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930628-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930628-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,42 @@ +/* + 930628-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +void f (double x[2], double y[2]) +{ + if (x == y) + ASSERT (0); +} + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + struct { int f[3]; double x[1][2]; } tp[4][2]; + int i, j, ki, kj, mi, mj; + float bdm[4][2][4][2]; + + for (i = 0; i < 4; i++) + for (j = i; j < 4; j++) + for (ki = 0; ki < 2; ki++) + for (kj = 0; kj < 2; kj++) + if ((j == i) && (ki == kj)) + bdm[i][ki][j][kj] = 1000.0; + else + { + for (mi = 0; mi < 1; mi++) + for (mj = 0; mj < 1; mj++) + f (tp[i][ki].x[mi], tp[j][kj].x[mj]); + bdm[i][ki][j][kj] = 1000.0; + } + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930702-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930702-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930702-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930702-1.c 2012-05-18 16:39:12.000000000 +0000 @@ -0,0 +1,32 @@ +/* + 930702-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +#if !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_ds390) && !defined(__SDCC_mcs51) +int fp (double a, int b) +{ + if (a != 33 || b != 11) + ASSERT (0); + return (0); +} +#endif + +void +testTortureExecute (void) +{ +#if !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_ds390) && !defined(__SDCC_mcs51) + int (*f) (double, int) = fp; + + fp (33, 11); + f (33, 11); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930713-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930713-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930713-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930713-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,40 @@ +/* + 930713-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports returning struct! +#if 0 +typedef struct +{ + char x; +} T; + +T +f (s1) + T s1; +{ + T s1a; + s1a.x = 17; + return s1a; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + T s1a, s1b; + s1a.x = 13; + s1b = f (s1a); + if (s1a.x != 13 || s1b.x != 17) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930718-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930718-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930718-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930718-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,45 @@ +/* + 930718-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +typedef struct rtx_def +{ + int f1 :1; + int f2 :1; +} *rtx; + +static rtx +f (register rtx orig) +{ + if (orig->f1 || orig->f2) + return orig; + orig->f2 = 1; + return orig; +} + +void +f2 () +{ + ASSERT (0); +} + +void +testTortureExecute (void) +{ + struct rtx_def foo; + rtx bar; + + foo.f1 = 1; + foo.f2 = 0; + bar = f (&foo); + if (bar != &foo || bar->f2 != 0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930719-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930719-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930719-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930719-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 930719-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +f (int foo, int bar, int com) +{ + unsigned align = 0; + if (foo) + return 0; + while (1) + { + switch (bar) + { + case 1: + if (com != 0) + return align; + *(char *) 0 = 0; + } + } +} + +void +testTortureExecute (void) +{ + f (0, 1, 1); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930725-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930725-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930725-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930725-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 930725-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +int v; + +const char * +g () +{ + return ""; +} + +const char * +f () +{ + return (v == 0 ? g () : "abc"); +} + +void +testTortureExecute (void) +{ + v = 1; + if (!strcmp (f (), "abc")) + return; + ASSERT (0); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930818-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930818-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930818-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930818-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 930818-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +static double one = 1.0; + +int f() +{ + int colinear; + colinear = (one == 0.0); + if (colinear) + ASSERT (0); + return colinear; +} +void +testTortureExecute (void) +{ + if (f()) ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930916-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930916-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930916-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930916-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,24 @@ +/* + 930916-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void f (unsigned n) +{ + if ((int) n >= 0) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + unsigned x = ~0; + f (x); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930929-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930929-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-930929-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-930929-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,44 @@ +/* + 930929-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int sub1 (int i) +{ + return i - (5 - i); +} + +int sub2 (int i) +{ + return i + (5 + i); +} + +int sub3 (int i) +{ + return i - (5 + i); +} + +int sub4 (int i) +{ + return i + (5 - i); +} + +void +testTortureExecute (void) +{ + if (sub1 (20) != 35) + ASSERT (0); + if (sub2 (20) != 45) + ASSERT (0); + if (sub3 (20) != -5) + ASSERT (0); + if (sub4 (20) != 5) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,46 @@ +/* + 931004-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports struct! +#if 0 +struct tiny +{ + int c; +}; + +f (int n, struct tiny x, struct tiny y, struct tiny z, long l) +{ + if (x.c != 10) + ASSERT (0); + + if (y.c != 11) + ASSERT (0); + + if (z.c != 12) + ASSERT (0); + + if (l != 123) + ASSERT (0); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct tiny x[3]; + x[0].c = 10; + x[1].c = 11; + x[2].c = 12; + f (3, x[0], x[1], x[2], (long) 123); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-10.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-10.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-10.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-10.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,60 @@ +/* + 931004-10.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports struct! +#if 0 +#include + +struct tiny +{ + char c; + char d; +}; + +void f (int n, ...) +{ + struct tiny x; + int i; + + va_list ap; + va_start (ap,n); + for (i = 0; i < n; i++) + { + x = va_arg (ap,struct tiny); + if (x.c != i + 10) + ASSERT (0); + if (x.d != i + 20) + ASSERT (0); + } + { + long x = va_arg (ap, long); + if (x != 123) + ASSERT (0); + } + va_end (ap); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct tiny x[3]; + x[0].c = 10; + x[1].c = 11; + x[2].c = 12; + x[0].d = 20; + x[1].d = 21; + x[2].d = 22; + f (3, x[0], x[1], x[2], (long) 123); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-11.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-11.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-11.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-11.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,66 @@ +/* + 931004-11.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports struct! +#if 0 +struct tiny +{ + char c; + char d; + char e; +}; + +void f (int n, struct tiny x, struct tiny y, struct tiny z, long l) +{ + if (x.c != 10) + ASSERT (0); + if (x.d != 20) + ASSERT (0); + if (x.e != 30) + ASSERT (0); + + if (y.c != 11) + ASSERT (0); + if (y.d != 21) + ASSERT (0); + if (y.e != 31) + ASSERT (0); + + if (z.c != 12) + ASSERT (0); + if (z.d != 22) + ASSERT (0); + if (z.e != 32) + ASSERT (0); + + if (l != 123) + ASSERT (0); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct tiny x[3]; + x[0].c = 10; + x[1].c = 11; + x[2].c = 12; + x[0].d = 20; + x[1].d = 21; + x[2].d = 22; + x[0].e = 30; + x[1].e = 31; + x[2].e = 32; + f (3, x[0], x[1], x[2], (long) 123); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-13.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-13.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-13.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-13.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,76 @@ +/* + 931004-13.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports struct! +#if 0 +struct tiny +{ + char c; + char d; + char e; + char f; +}; + +f (int n, struct tiny x, struct tiny y, struct tiny z, long l) +{ + if (x.c != 10) + ASSERT (0); + if (x.d != 20) + ASSERT (0); + if (x.e != 30) + ASSERT (0); + if (x.f != 40) + ASSERT (0); + + if (y.c != 11) + ASSERT (0); + if (y.d != 21) + ASSERT (0); + if (y.e != 31) + ASSERT (0); + if (y.f != 41) + ASSERT (0); + + if (z.c != 12) + ASSERT (0); + if (z.d != 22) + ASSERT (0); + if (z.e != 32) + ASSERT (0); + if (z.f != 42) + ASSERT (0); + + if (l != 123) + ASSERT (0); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct tiny x[3]; + x[0].c = 10; + x[1].c = 11; + x[2].c = 12; + x[0].d = 20; + x[1].d = 21; + x[2].d = 22; + x[0].e = 30; + x[1].e = 31; + x[2].e = 32; + x[0].f = 40; + x[1].f = 41; + x[2].f = 42; + f (3, x[0], x[1], x[2], (long) 123); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-14.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-14.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-14.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-14.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,72 @@ +/* + 931004-14.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports struct! +#if 0 +#include + +struct tiny +{ + char c; + char d; + char e; + char f; +}; + +f (int n, ...) +{ + struct tiny x; + int i; + + va_list ap; + va_start (ap,n); + for (i = 0; i < n; i++) + { + x = va_arg (ap,struct tiny); + if (x.c != i + 10) + ASSERT (0); + if (x.d != i + 20) + ASSERT (0); + if (x.e != i + 30) + ASSERT (0); + if (x.f != i + 40) + ASSERT (0); + } + { + long x = va_arg (ap, long); + if (x != 123) + ASSERT (0); + } + va_end (ap); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct tiny x[3]; + x[0].c = 10; + x[1].c = 11; + x[2].c = 12; + x[0].d = 20; + x[1].d = 21; + x[2].d = 22; + x[0].e = 30; + x[1].e = 31; + x[2].e = 32; + x[0].f = 40; + x[1].f = 41; + x[2].f = 42; + f (3, x[0], x[1], x[2], (long) 123); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-2.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,54 @@ +/* + 931004-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports struct! +#if 0 +#include + +struct tiny +{ + int c; +}; + +f (int n, ...) +{ + struct tiny x; + int i; + + va_list ap; + va_start (ap,n); + for (i = 0; i < n; i++) + { + x = va_arg (ap,struct tiny); + if (x.c != i + 10) + ASSERT (0); + } + { + long x = va_arg (ap, long); + if (x != 123) + ASSERT (0); + } + va_end (ap); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct tiny x[3]; + x[0].c = 10; + x[1].c = 11; + x[2].c = 12; + f (3, x[0], x[1], x[2], (long) 123); + exit(0); +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-3.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,46 @@ +/* + 931004-3.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: enable when sdcc supports struct! +#if 0 +struct tiny +{ + short c; +}; + +f (int n, struct tiny x, struct tiny y, struct tiny z, long l) +{ + if (x.c != 10) + ASSERT (0); + + if (y.c != 11) + ASSERT (0); + + if (z.c != 12) + ASSERT (0); + + if (l != 123) + ASSERT (0); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct tiny x[3]; + x[0].c = 10; + x[1].c = 11; + x[2].c = 12; + f (3, x[0], x[1], x[2], (long) 123); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-4.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-4.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-4.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-4.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,54 @@ +/* + 931004-4.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports struct! +#if 0 +#include + +struct tiny +{ + short c; +}; + +f (int n, ...) +{ + struct tiny x; + int i; + + va_list ap; + va_start (ap,n); + for (i = 0; i < n; i++) + { + x = va_arg (ap,struct tiny); + if (x.c != i + 10) + ASSERT (0); + } + { + long x = va_arg (ap, long); + if (x != 123) + ASSERT (0); + } + va_end (ap); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct tiny x[3]; + x[0].c = 10; + x[1].c = 11; + x[2].c = 12; + f (3, x[0], x[1], x[2], (long) 123); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-5.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-5.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-5.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-5.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,56 @@ +/* + 931004-5.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable shen sdcc supports struct! +#if 0 +struct tiny +{ + short c; + short d; +}; + +f (int n, struct tiny x, struct tiny y, struct tiny z, long l) +{ + if (x.c != 10) + ASSERT (0); + if (x.d != 20) + ASSERT (0); + + if (y.c != 11) + ASSERT (0); + if (y.d != 21) + ASSERT (0); + + if (z.c != 12) + ASSERT (0); + if (z.d != 22) + ASSERT (0); + + if (l != 123) + ASSERT (0); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct tiny x[3]; + x[0].c = 10; + x[1].c = 11; + x[2].c = 12; + x[0].d = 20; + x[1].d = 21; + x[2].d = 22; + f (3, x[0], x[1], x[2], (long) 123); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-6.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-6.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-6.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-6.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,60 @@ +/* + 931004-6.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports struct! +#if 0 +#include + +struct tiny +{ + short c; + short d; +}; + +f (int n, ...) +{ + struct tiny x; + int i; + + va_list ap; + va_start (ap,n); + for (i = 0; i < n; i++) + { + x = va_arg (ap,struct tiny); + if (x.c != i + 10) + ASSERT (0); + if (x.d != i + 20) + ASSERT (0); + } + { + long x = va_arg (ap, long); + if (x != 123) + ASSERT (0); + } + va_end (ap); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct tiny x[3]; + x[0].c = 10; + x[1].c = 11; + x[2].c = 12; + x[0].d = 20; + x[1].d = 21; + x[2].d = 22; + f (3, x[0], x[1], x[2], (long) 123); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-7.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-7.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-7.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-7.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,46 @@ +/* + 931004-7.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports struct! +#if 0 +struct tiny +{ + char c; +}; + +f (int n, struct tiny x, struct tiny y, struct tiny z, long l) +{ + if (x.c != 10) + ASSERT (0); + + if (y.c != 11) + ASSERT (0); + + if (z.c != 12) + ASSERT (0); + + if (l != 123) + ASSERT (0); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct tiny x[3]; + x[0].c = 10; + x[1].c = 11; + x[2].c = 12; + f (3, x[0], x[1], x[2], (long) 123); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-8.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-8.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-8.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-8.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,54 @@ +/* + 931004-8.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports struct! +#if 0 +#include + +struct tiny +{ + char c; +}; + +f (int n, ...) +{ + struct tiny x; + int i; + + va_list ap; + va_start (ap,n); + for (i = 0; i < n; i++) + { + x = va_arg (ap,struct tiny); + if (x.c != i + 10) + abort(); + } + { + long x = va_arg (ap, long); + if (x != 123) + abort(); + } + va_end (ap); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct tiny x[3]; + x[0].c = 10; + x[1].c = 11; + x[2].c = 12; + f (3, x[0], x[1], x[2], (long) 123); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-9.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-9.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931004-9.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931004-9.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,56 @@ +/* + 931004-9.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports struct! +#if 0 +struct tiny +{ + char c; + char d; +}; + +f (int n, struct tiny x, struct tiny y, struct tiny z, long l) +{ + if (x.c != 10) + ASSERT (0); + if (x.d != 20) + ASSERT (0); + + if (y.c != 11) + ASSERT (0); + if (y.d != 21) + ASSERT (0); + + if (z.c != 12) + ASSERT (0); + if (z.d != 22) + ASSERT (0); + + if (l != 123) + ASSERT (0); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct tiny x[3]; + x[0].c = 10; + x[1].c = 11; + x[2].c = 12; + x[0].d = 20; + x[1].d = 21; + x[2].d = 22; + f (3, x[0], x[1], x[2], (long) 123); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931005-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931005-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931005-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931005-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,40 @@ +/* + 931005-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports struct! +#if 0 +typedef struct +{ + char x; +} T; + +T +f (s1) + T s1; +{ + T s1a; + s1a.x = s1.x; + return s1a; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + T s1a, s1b; + s1a.x = 100; + s1b = f (s1a); + if (s1b.x != 100) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931009-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931009-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931009-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931009-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,39 @@ +/* + 931009-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void f (); + +void +testTortureExecute (void) +{ + f (); + return; +} + +static void +g (int *out, int size, int lo, int hi) +{ + int j; + + for (j = 0; j < size; j++) + out[j] = j * (hi - lo); +} + + +void f () +{ + int a[2]; + + g (a, 2, 0, 1); + + if (a[0] != 0 || a[1] != 1) + ASSERT (0); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931012-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931012-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931012-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931012-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,25 @@ +/* + 931012-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int f (int b, int c) +{ + if (b != 0 && b != 1 && c != 0) + b = 0; + return b; +} + +void +testTortureExecute (void) +{ + if (!f (1, 2)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931017-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931017-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931017-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931017-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,66 @@ +/* + 931017-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int v; + +void f (); + +void +testTortureExecute (void) +{ + f (); + return; +} + +h1 () +{ + return 0; +} + +int h2 (int *e) +{ + if (e != &v) + ASSERT (0); + return 0; +} + +int g (char *c) +{ + int i; + int b; + + do + { + i = h1 (); + if (i == -1) + return 0; + else if (i == 1) + h1 (); + } + while (i == 1); + + do + b = h2 (&v); + while (i == 5); + + if (i != 2) + return b; + *c = 'a'; + + return 0; +} + + +void f () +{ + char c; + g (&c); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931018-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931018-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931018-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931018-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,31 @@ +/* + 931018-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c89 +#endif + +unsigned int a[/*0x1000*/20]; +extern const unsigned long v; + +void f (unsigned long a); + +void +testTortureExecute (void) +{ + f (v); + f (v); + return; +} + +void f (unsigned long a) +{ + if (a != 0xdeadbeefL) + ASSERT (0); +} + +const unsigned long v = 0xdeadbeefL; + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931102-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931102-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931102-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931102-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,40 @@ +/* + 931102-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +typedef union +{ + struct + { + char h, l; + } b; +} T; + +int f (int x) +{ + int num = 0; + T reg; + + reg.b.l = x; + while ((reg.b.l & 1) == 0) + { + num++; + reg.b.l >>= 1; + } + return num; +} + +void +testTortureExecute (void) +{ + if (f (2) != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931102-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931102-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931102-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931102-2.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,41 @@ +/* + 931102-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +typedef union +{ + long align; + struct + { + short h, l; + } b; +} T; + +int f (int x) +{ + int num = 0; + T reg; + + reg.b.l = x; + while ((reg.b.l & 1) == 0) + { + num++; + reg.b.l >>= 1; + } + return num; +} + +void +testTortureExecute (void) +{ + if (f (2) != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931110-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931110-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931110-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931110-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,30 @@ +/* + 931110-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +typedef struct +{ + short f:3, g:3, h:10; +} small; + +struct +{ + int i; + small s[10]; +} x; + +void +testTortureExecute (void) +{ + int i; + for (i = 0; i < 10; i++) + x.s[i].f = 0; + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931110-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931110-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931110-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931110-2.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,24 @@ +/* + 931110-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ + static int a[] = {3, 4}; + register int *b; + int c; + + b = a; + c = *b++ % 8; + if (c != 3) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931208-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931208-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-931208-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-931208-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,26 @@ +/* + 931208-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int f () +{ + unsigned long x, y = 1; + + x = ((y * 8192) - 216) / 16; + return x; +} + +void +testTortureExecute (void) +{ + if (f () != 498) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-940122-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-940122-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-940122-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-940122-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,32 @@ +/* + 940122-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +char *a = 0; +char *b = 0; + +void g (int x) +{ + if ((!!a) != (!!b)) + ASSERT (0); +} + +void f (int x) +{ + g (x * x); +} + +void +testTortureExecute (void) +{ + f (100); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-941014-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-941014-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-941014-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-941014-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 941014-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +int f (int a, int b) { } + +void +testTortureExecute (void) +{ + unsigned long addr1; + unsigned long addr2; + + addr1 = (unsigned long) &f; + addr1 += 5; + addr2 = 5 + (unsigned long) &f; + + if (addr1 != addr2) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-941015-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-941015-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-941015-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-941015-1.c 2012-03-30 11:52:34.000000000 +0000 @@ -0,0 +1,50 @@ +/* + 941015-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports long long constants! +#if 0 +int +foo1 (long long value) +{ + register const long long constant = 0xc000000080000000LL; + + if (value < constant) + return 1; + else + return 2; +} + +int +foo2 (unsigned long long value) +{ + register const unsigned long long constant = 0xc000000080000000LL; + + if (value < constant) + return 1; + else + return 2; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + unsigned long long value = 0xc000000000000001LL; + int x, y; + + x = foo1 (value); + y = foo2 (value); + if (x != y || x != 1) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-941021-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-941021-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-941021-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-941021-1.c 2012-03-22 21:42:57.000000000 +0000 @@ -0,0 +1,33 @@ +/* + 941021-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +double glob_dbl; + +void f (double *pdbl, double value) +{ + if (pdbl == 0) + pdbl = &glob_dbl; + + *pdbl = value; +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5)) + f ((void *) 0, 55.1); + + if (glob_dbl != 55.1) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-941025-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-941025-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-941025-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-941025-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,23 @@ +/* + 941025-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +long f (long x, long y) +{ + return (x > 1) ? y : (y & 1); +} + +void +testTortureExecute (void) +{ + if (f (2L, 0xdecadeL) != 0xdecadeL) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-941031-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-941031-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-941031-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-941031-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,39 @@ +/* + 941031-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +typedef long mpt; + +int +f (mpt us, mpt vs) +{ + long aus; + long avs; + + aus = us >= 0 ? us : -us; + avs = vs >= 0 ? vs : -vs; + + if (aus < avs) + { + long t = aus; + aus = avs; + avs = aus; + } + + return avs; +} + +void +testTortureExecute (void) +{ + if (f ((mpt) 3, (mpt) 17) != 17) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-941101-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-941101-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-941101-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-941101-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,27 @@ +/* + 941101-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int f () +{ + int var = 7; + + if ((var/7) == 1) + return var/7; + return 0; +} + +void +testTortureExecute (void) +{ + if (f () != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-941110-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-941110-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-941110-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-941110-1.c 2012-03-21 13:11:20.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 941110-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int f (const int x) +{ + int y = 0; + y = x ? y : -y; + { + const int *p = &x; + } + return y; +} + +void +testTortureExecute (void) +{ + if (f (0)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950322-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950322-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950322-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950322-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,42 @@ +/* + 950322-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +f (unsigned char *a) +{ + int i, j; + int x, y; + + j = a[1]; + i = a[0] - j; + if (i < 0) + { + x = 1; + y = -i; + } + else + { + x = 0; + y = i; + } + return x + y; +} + + +void +testTortureExecute (void) +{ + unsigned char a[2]; + a[0] = 8; + a[1] = 9; + if (f (a) != 2) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950426-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950426-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950426-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950426-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,52 @@ +/* + 950426-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +#include + +struct tag { + int m1; + char *m2[5]; +} s1, *p1; + +int i; + +int func1(int *p); + +void foo (char *s); + +void +testTortureExecute (void) +{ +#if 0 + s1.m1 = -1; + p1 = &s1; + + if ( func1( &p1->m1 ) == -1 ) + foo ("ok"); + else + ASSERT (0); + + i = 3; + s1.m2[3]= "123"; + + if ( strlen( (p1->m2[i])++ ) == 3 ) + foo ("ok"); + else + ASSERT (0); + + return; +#endif +} + +int func1(int *p) { return(*p); } + +void foo (char *s) {} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950503-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950503-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950503-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950503-1.c 2012-04-21 13:19:52.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 950503-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + int tmp; + unsigned long long utmp1, utmp2; + + tmp = 16; + + utmp1 = (~((unsigned long long) 0)) >> tmp; + utmp2 = (~((unsigned long long) 0)) >> 16; + + if (utmp1 != utmp2) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950511-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950511-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950511-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950511-1.c 2012-03-30 11:52:34.000000000 +0000 @@ -0,0 +1,26 @@ +/* + 950511-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ +// TODO: Enable when sdcc supports long long constants! +#if 0 + unsigned long long xx; + unsigned long long *x = (unsigned long long *) &xx; + + *x = -3; + *x = *x * *x; + if (*x != 9) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950512-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950512-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950512-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950512-1.c 2012-04-01 11:33:10.000000000 +0000 @@ -0,0 +1,42 @@ +/* + 950512-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports long long constants! +#if 0 + +unsigned +f1 (int x) +{ + return ((unsigned) (x != 0) - 3) / 2; +} + +unsigned long long +f2 (int x) +{ + return ((unsigned long long) (x != 0) - 3) / 2; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + if (f1 (1) != (~(unsigned) 0) >> 1) + ASSERT (0); + if (f1 (0) != ((~(unsigned) 0) >> 1) - 1) + ASSERT (0); + if (f2 (1) != (~(unsigned long long) 0) >> 1) + ASSERT (0); + if (f2 (0) != ((~(unsigned long long) 0) >> 1) - 1) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950605-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950605-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950605-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950605-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,23 @@ +/* + 950605-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void f (unsigned char c) +{ + if (c != 0xFF) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + f (-1); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950607-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950607-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950607-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950607-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,21 @@ +/* + 950607-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ + struct { long status; } h; + + h.status = 0; + if (((h.status & 128) == 1) && ((h.status & 32) == 0)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950607-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950607-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950607-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950607-2.c 2012-03-30 11:52:34.000000000 +0000 @@ -0,0 +1,58 @@ +/* + 950607-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports struct parameters! +#if 0 +typedef struct { + long int p_x, p_y; +} Point; + +int +f (Point basePt, Point pt1, Point pt2) +{ + long long vector; + + vector = + (long long) (pt1.p_x - basePt.p_x) * (long long) (pt2.p_y - basePt.p_y) - + (long long) (pt1.p_y - basePt.p_y) * (long long) (pt2.p_x - basePt.p_x); + + if (vector > (long long) 0) + return 0; + else if (vector < (long long) 0) + return 1; + else + return 2; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + Point b, p1, p2; + int answer; + + b.p_x = -23250; + b.p_y = 23250; + + p1.p_x = 23250; + p1.p_y = -23250; + + p2.p_x = -23250; + p2.p_y = -23250; + + answer = f (b, p1, p2); + + if (answer != 1) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950612-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950612-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950612-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950612-1.c 2012-05-18 17:36:32.000000000 +0000 @@ -0,0 +1,64 @@ +/* + 950612-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) +unsigned int +f1 (int diff) +{ + return ((unsigned int) (diff < 0 ? -diff : diff)); +} + +unsigned int +f2 (unsigned int diff) +{ + return ((unsigned int) ((signed int) diff < 0 ? -diff : diff)); +} + +unsigned long long +f3 (long long diff) +{ + return ((unsigned long long) (diff < 0 ? -diff : diff)); +} + +unsigned long long +f4 (unsigned long long diff) +{ + return ((unsigned long long) ((signed long long) diff < 0 ? -diff : diff)); +} +#endif + +void +testTortureExecute (void) +{ +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) && !defined(__SDCC_gbz80) + int i; + for (i = 0; i <= 10; i++) + { + if (f1 (i) != i) + ASSERT (0); + if (f1 (-i) != i) + ASSERT (0); + if (f2 (i) != i) + ASSERT (0); + if (f2 (-i) != i) + ASSERT (0); + if (f3 ((long long) i) != i) + ASSERT (0); + if (f3 ((long long) -i) != i) + ASSERT (0); + if (f4 ((long long) i) != i) + ASSERT (0); + if (f4 ((long long) -i) != i) + ASSERT (0); + } + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950621-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950621-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950621-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950621-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,32 @@ +/* + 950621-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct s +{ + int a; + int b; + struct s *dummy; +}; + +f (struct s *sp) +{ + return sp && sp->a == -1 && sp->b == -1; +} + +void +testTortureExecute (void) +{ + struct s x; + x.a = x.b = -1; + if (f (&x) == 0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950628-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950628-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950628-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950628-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,48 @@ +/* + 950628-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports struct! +#if 0 +typedef struct +{ + char hours, day, month; + short year; +} T; + +T g (void) +{ + T now; + + now.hours = 1; + now.day = 2; + now.month = 3; + now.year = 4; + return now; +} + +T f (void) +{ + T virk; + + virk = g (); + return virk; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + if (f ().hours != 1 || f ().day != 2 || f ().month != 3 || f ().year != 4) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950704-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950704-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950704-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950704-1.c 2012-03-30 09:18:32.000000000 +0000 @@ -0,0 +1,77 @@ +/* + 950704-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports long long constants! +#if 0 +int errflag; + +long long +f (long long x, long long y) +{ + long long r; + + errflag = 0; + r = x + y; + if (x >= 0) + { + if ((y < 0) || (r >= 0)) + return r; + } + else + { + if ((y > 0) || (r < 0)) + return r; + } + errflag = 1; + return 0; +} +#endif + +void +testTortureExecute (void) +{ +// TODO: Enable when sdcc supports long long! +#if 0 + f (0, 0); + if (errflag) + ASSERT (0); + + f (1, -1); + if (errflag) + ASSERT (0); + + f (-1, 1); + if (errflag) + ASSERT (0); + + f (0x8000000000000000LL, 0x8000000000000000LL); + if (!errflag) + ASSERT (0); + + f (0x8000000000000000LL, -1LL); + if (!errflag) + ASSERT (0); + + f (0x7fffffffffffffffLL, 0x7fffffffffffffffLL); + if (!errflag) + ASSERT (0); + + f (0x7fffffffffffffffLL, 1LL); + if (!errflag) + ASSERT (0); + + f (0x7fffffffffffffffLL, 0x8000000000000000LL); + if (errflag) + ASSERT (0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950706-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950706-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950706-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950706-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 950706-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +f (int n) +{ + return (n > 0) - (n < 0); +} + +void +testTortureExecute (void) +{ + if (f (-1) != -1) + ASSERT (0); + if (f (1) != 1) + ASSERT (0); + if (f (0) != 0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950710-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950710-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950710-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950710-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,71 @@ +/* + 950710-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports struct! +#if 0 +struct twelve +{ + int a; + int b; + int c; +}; + +struct pair +{ + int first; + int second; +}; + +struct pair +g () +{ + struct pair p; + return p; +} + +static void +f () +{ + int i; + for (i = 0; i < 1; i++) + { + int j; + for (j = 0; j < 1; j++) + { + if (0) + { + int k; + for (k = 0; k < 1; k++) + { + struct pair e = g (); + } + } + else + { + struct twelve a, b; + if ((((char *) &b - (char *) &a) < 0 + ? (-((char *) &b - (char *) &a)) + : ((char *) &b - (char *) &a)) < sizeof (a)) + ASSERT (0); + } + } + } +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + f (); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950714-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950714-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950714-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950714-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,30 @@ +/* + 950714-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +int array[10] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + +void +testTortureExecute (void) +{ + int i, j; + int *p; + + for (i = 0; i < 10; i++) + for (p = &array[0]; p != &array[9]; p++) + if (*p == i) + goto label; + + label: + if (i != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950809-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950809-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950809-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950809-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,45 @@ +/* + 950809-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct S +{ + int *sp, fc, *sc, a[2]; +}; + +f (struct S *x) +{ + int *t = x->sc; + int t1 = t[0]; + int t2 = t[1]; + int t3 = t[2]; + int a0 = x->a[0]; + int a1 = x->a[1]; + t[2] = t1; + t[0] = a1; + x->a[1] = a0; + x->a[0] = t3; + x->fc = t2; + x->sp = t; +} + +void +testTortureExecute (void) +{ + struct S s; + static int sc[3] = {2, 3, 4}; + s.sc = sc; + s.a[0] = 10; + s.a[1] = 11; + f (&s); + if (s.sp[2] != 2) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950915-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950915-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950915-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950915-1.c 2012-05-18 17:15:09.000000000 +0000 @@ -0,0 +1,31 @@ +/* + 950915-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) +long int a = 100000; +long int b = 21475; + +long +f () +{ + return ((long long) a * (long long) b) >> 16; +} +#endif + +void +testTortureExecute (void) +{ +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + if (f () < 0) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950929-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950929-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-950929-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-950929-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,34 @@ +/* + 950929-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +int f (char *p) { } + +void +testTortureExecute (void) +{ + char c; + char c2; + int i = 0; + char *pc = &c; + char *pc2 = &c2; + int *pi = &i; + + *pc2 = 1; + *pi = 1; + *pc2 &= *pi; + f (pc2); + *pc2 = 1; + *pc2 &= *pi; + if (*pc2 != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-951003-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-951003-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-951003-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-951003-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,34 @@ +/* + 951003-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +int f (int i) { return 12; } +int g () { return 0; } + +void +testTortureExecute (void) +{ + int i, s; + + for (i = 0; i < 32; i++) + { + s = f (i); + + if (i == g ()) + s = 42; + if (i == 0 || s == 12) + ; + else + ASSERT (0); + } + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-951115-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-951115-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-951115-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-951115-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,36 @@ +/* + 951115-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int var = 0; + +void g () +{ + var = 1; +} + +void f () +{ + int f2 = 0; + + if (f2 == 0) + ; + + g (); +} + +void +testTortureExecute (void) +{ + f (); + if (var != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-951204-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-951204-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-951204-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-951204-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,30 @@ +/* + 951204-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void f (char *x) +{ + *x = 'x'; +} + +void +testTortureExecute (void) +{ + int i; + char x = '\0'; + + for (i = 0; i < 100; ++i) + { + f (&x); + if (*(const char *) &x != 'x') + ASSERT (0); + } + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960116-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960116-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960116-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960116-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,36 @@ +/* + 960116-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#if 0 +static inline int +p (int *p) +{ + return !((long) p & 1); +} + +int +f (int *q) +{ + if (p (q) && *q) + return 1; + return 0; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + if (f ((int*) 0xffffffff) != 0) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960215-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960215-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960215-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960215-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,43 @@ +/* + 960215-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports long double! +#if 0 +long double C = 2; +long double U = 1; +long double Y2 = 3; +long double Y1 = 1; +long double X, Y, Z, T, R, S; +#endif + +void +testTortureExecute (void) +{ +#if 0 + X = (C + U) * Y2; + Y = C - U - U; + Z = C + U + U; + T = (C - U) * Y1; + X = X - (Z + U); + R = Y * Y1; + S = Z * Y2; + T = T - Y; + Y = (U - Y) + R; + Z = S - (Z + U + U); + R = (Y2 + U) * Y1; + Y1 = Y2 * Y1; + R = R - Y2; + Y1 = Y1 - 0.5L; + if (Z != 6) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960218-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960218-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960218-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960218-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,34 @@ +/* + 960218-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int glob; + +int g (int x) +{ + glob = x; + return 0; +} + +void f (int x) +{ + int a = ~x; + while (a) + a = g (a); +} + +void +testTortureExecute (void) +{ + f (3); + if (glob != -4) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960219-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960219-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960219-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960219-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,23 @@ +/* + 960219-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +f (int i) +{ + if (((1 << i) & 1) == 0) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + f (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960301-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960301-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960301-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960301-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,34 @@ +/* + 960301-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct foo { + unsigned : 12; + unsigned field : 4; +} foo; +unsigned oldfoo; + +int +bar (unsigned k) +{ + oldfoo = foo.field; + foo.field = k; + if (k) + return 1; + return 2; +} + +void +testTortureExecute (void) +{ + if (bar (1U) != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960302-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960302-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960302-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960302-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,33 @@ +/* + 960302-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +long a = 1; + +foo () +{ + switch (a % 2 % 2 % 2 % 2 % 2 % 2 % 2 % 2) + { + case 0: + return 0; + case 1: + return 1; + default: + return -1; + } +} + +void +testTortureExecute (void) +{ + if (foo () != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960311-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960311-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960311-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960311-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,74 @@ +/* + 960311-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +int count; + +void a1() { ++count; } + +void +b (unsigned char data) +{ + if (data & 0x80) a1(); + data <<= 1; + + if (data & 0x80) a1(); + data <<= 1; + + if (data & 0x80) a1(); +} + +void +testTortureExecute (void) +{ + count = 0; + b (0); + if (count != 0) + ASSERT (0); + + count = 0; + b (0x80); + if (count != 1) + ASSERT (0); + + count = 0; + b (0x40); + if (count != 1) + ASSERT (0); + + count = 0; + b (0x20); + if (count != 1) + ASSERT (0); + + count = 0; + b (0xc0); + if (count != 2) + ASSERT (0); + + count = 0; + b (0xa0); + if (count != 2) + ASSERT (0); + + count = 0; + b (0x60); + if (count != 2) + ASSERT (0); + + count = 0; + b (0xe0); + if (count != 3) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960311-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960311-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960311-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960311-2.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,74 @@ +/* + 960311-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +int count; + +void a1() { ++count; } + +void +b (unsigned short data) +{ + if (data & 0x8000) a1(); + data <<= 1; + + if (data & 0x8000) a1(); + data <<= 1; + + if (data & 0x8000) a1(); +} + +void +testTortureExecute (void) +{ + count = 0; + b (0); + if (count != 0) + ASSERT (0); + + count = 0; + b (0x8000); + if (count != 1) + ASSERT (0); + + count = 0; + b (0x4000); + if (count != 1) + ASSERT (0); + + count = 0; + b (0x2000); + if (count != 1) + ASSERT (0); + + count = 0; + b (0xc000); + if (count != 2) + ASSERT (0); + + count = 0; + b (0xa000); + if (count != 2) + ASSERT (0); + + count = 0; + b (0x6000); + if (count != 2) + ASSERT (0); + + count = 0; + b (0xe000); + if (count != 3) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960311-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960311-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960311-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960311-3.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,74 @@ +/* + 960311-3.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +int count; + +void a1() { ++count; } + +void +b (unsigned long data) +{ + if (data & 0x80000000) a1(); + data <<= 1; + + if (data & 0x80000000) a1(); + data <<= 1; + + if (data & 0x80000000) a1(); +} + +void +testTortureExecute (void) +{ + count = 0; + b (0); + if (count != 0) + ASSERT (0); + + count = 0; + b (0x80000000); + if (count != 1) + ASSERT (0); + + count = 0; + b (0x40000000); + if (count != 1) + ASSERT (0); + + count = 0; + b (0x20000000); + if (count != 1) + ASSERT (0); + + count = 0; + b (0xc0000000); + if (count != 2) + ASSERT (0); + + count = 0; + b (0xa0000000); + if (count != 2) + ASSERT (0); + + count = 0; + b (0x60000000); + if (count != 2) + ASSERT (0); + + count = 0; + b (0xe0000000); + if (count != 3) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960317-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960317-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960317-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960317-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,34 @@ +/* + 960317-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +f (unsigned bitcount, int mant) +{ + int mask = -1 << bitcount; + { + if (! (mant & -mask)) + goto ab; + if (mant & ~mask) + goto auf; + } +ab: + return 0; +auf: + return 1; +} + +void +testTortureExecute (void) +{ + if (f (0, -1)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960321-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960321-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960321-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960321-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,26 @@ +/* + 960321-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +char a[10] = "deadbeef"; + +char +acc_a (long i) +{ + return a[i-2000000000L]; +} + +void +testTortureExecute (void) +{ + if (acc_a (2000000000L) != 'd') + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960326-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960326-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960326-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960326-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 960326-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct s +{ + int a; + int b; + short c; + int d[3]; +}; + +struct s s = { .b = 3, .d = {2,0,0} }; + +void +testTortureExecute (void) +{ + if (s.b != 3) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960327-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960327-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960327-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960327-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,42 @@ +/* + 960327-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include +g () +{ + return '\n'; +} + +void f () +{ + char s[] = "abcedfg012345"; + char *sp = s + 12; + + switch (g ()) + { + case '\n': + break; + } + + while (*--sp == '0') + ; + sprintf (sp + 1, "X"); + + if (s[12] != 'X') + ASSERT (0); +} + +void +testTortureExecute (void) +{ + f (); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960402-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960402-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960402-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960402-1.c 2012-03-30 11:52:34.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 960402-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports long long constants! +#if 0 +f (signed long long int x) +{ + return x > 0xFFFFFFFFLL || x < -0x80000000LL; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + if (f (0) != 0) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960416-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960416-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960416-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960416-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,80 @@ +/* + 960416-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc can pass struct! +#if 0 +typedef unsigned long int st; +typedef unsigned long long dt; +typedef union +{ + dt d; + struct + { + st h, l; + } + s; +} t_be; + +typedef union +{ + dt d; + struct + { + st l, h; + } + s; +} t_le; + +#define df(f, t) \ +int \ +f (t afh, t bfh) \ +{ \ + t hh; \ + t hp, lp, dp, m; \ + st ad, bd; \ + int s; \ + s = 0; \ + ad = afh.s.h - afh.s.l; \ + bd = bfh.s.l - bfh.s.h; \ + if (bd > bfh.s.l) \ + { \ + bd = -bd; \ + s = ~s; \ + } \ + lp.d = (dt) afh.s.l * bfh.s.l; \ + hp.d = (dt) afh.s.h * bfh.s.h; \ + dp.d = (dt) ad *bd; \ + dp.d ^= s; \ + hh.d = hp.d + hp.s.h + lp.s.h + dp.s.h; \ + m.d = (dt) lp.s.h + hp.s.l + lp.s.l + dp.s.l; \ + return hh.s.l + m.s.l; \ +} + +df(f_le, t_le) +df(f_be, t_be) +#endif + +void +testTortureExecute (void) +{ +#if 0 + t_be x; + x.s.h = 0x10000000U; + x.s.l = 0xe0000000U; + if (x.d == 0x10000000e0000000ULL + && f_be ((t_be) 0x100000000ULL, (t_be) 0x100000000ULL) != -1) + ASSERT (0); + if (x.d == 0xe000000010000000ULL + && f_le ((t_le) 0x100000000ULL, (t_le) 0x100000000ULL) != -1) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960419-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960419-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960419-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960419-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 960419-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +static int i; + +void +check(int x) +{ + if (!x) + ASSERT(0); +} + +void +testTortureExecute (void) +{ + int *p = &i; + + check(p != (void *)0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960419-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960419-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960419-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960419-2.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,25 @@ +/* + 960419-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#define SIZE 8 + +void +testTortureExecute (void) +{ + int a[SIZE] = {1}; + int i; + + for (i = 1; i < SIZE; i++) + if (a[i] != 0) + ASSERT(0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960513-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960513-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960513-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960513-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,42 @@ +/* + 960513-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports long double! +#if 0 +long double +f (d, i) + long double d; + int i; +{ + long double e; + + d = -d; + e = d; + if (i == 1) + d *= 2; + d -= e * d; + d -= e * d; + d -= e * d; + d -= e * d; + d -= e * d; + return d; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + if (! (int) (f (2.0L, 1))) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960608-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960608-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960608-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960608-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,45 @@ +/* + 960608-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +typedef struct +{ + unsigned char a : 2; + unsigned char b : 3; + unsigned char c : 1; + unsigned char d : 1; + unsigned char e : 1; +} a_struct; + +int foo (a_struct *flags) +{ + return (flags->c != 0 + || flags->d != 1 + || flags->e != 1 + || flags->a != 2 + || flags->b != 3); +} + +void +testTortureExecute (void) +{ + a_struct flags; + + flags.c = 0; + flags.d = 1; + flags.e = 1; + flags.a = 2; + flags.b = 3; + + if (foo (&flags) != 0) + ASSERT (0); + else + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960801-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960801-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960801-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960801-1.c 2012-04-02 09:59:13.000000000 +0000 @@ -0,0 +1,51 @@ +/* + 960801-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Some ports do not yet support long long. +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) && !defined(__SDCC_gbz80) +unsigned +f () +{ + long long l2; + unsigned short us; + unsigned long long ul; + short s2; + + ul = us = l2 = s2 = -1; + return ul; +} + +unsigned long long +g () +{ + long long l2; + unsigned short us; + unsigned long long ul; + short s2; + + ul = us = l2 = s2 = -1; + return ul; +} +#endif + +void +testTortureExecute (void) +{ +// Test fails on 32-bit systems +#if 0 +//#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) && !defined(__SDCC_gbz80) + if (f () != (unsigned short) -1) + ASSERT (0); + if (g () != (unsigned short) -1) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960909-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960909-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-960909-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-960909-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,39 @@ +/* + 960909-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +ffs (int x) +{ + int bit, mask; + + if (x == 0) + return 0; + + for (bit = 1, mask = 1; !(x & mask); bit++, mask <<= 1) + ; + + return bit; +} + +void f (int x) +{ + int y; + y = ffs (x) - 1; + if (y < 0) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + f (1); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961004-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961004-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961004-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961004-1.c 2012-05-05 14:39:36.000000000 +0000 @@ -0,0 +1,34 @@ +/* + 961004-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 84 +#endif + +int k = 0; + +void +testTortureExecute (void) +{ + int i; + int j; + + for (i = 0; i < 2; i++) + { + if (k) + { + if (j != 2) + ASSERT (0); + } + else + { + j = 2; + k++; + } + } + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961017-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961017-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961017-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961017-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,20 @@ +/* + 961017-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ + unsigned char z = 0; + + do ; + while (--z > 0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961017-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961017-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961017-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961017-2.c 2012-05-15 18:03:38.000000000 +0000 @@ -0,0 +1,43 @@ +/* + 961017-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ + int i = 0; + + + if (sizeof (unsigned long int) == 4) + { + unsigned long int z = 0; + + do { + z -= 0x000040000; + i++; + if (i > 0x0004000) + ASSERT (0); + } while (z > 0); + return; + } + else if (sizeof (unsigned int) == 4) + { + unsigned int z = 0; + + do { + z -= 0x000040000; + i++; + if (i > 0x0004000) + ASSERT (0); + } while (z > 0); + return; + } + else + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961026-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961026-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961026-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961026-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 961026-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +test (int arg) +{ + if (arg > 0 || arg == 0) + return 0; + return -1; +} + +void +testTortureExecute (void) +{ + if (test (0) != 0) + ASSERT (0); + if (test (-1) != -1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961112-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961112-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961112-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961112-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,25 @@ +/* + 961112-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int f (int x) +{ + if (x != 0 || x == 0) + return 0; + return 1; +} + +void +testTortureExecute (void) +{ + if (f (3)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961122-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961122-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961122-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961122-1.c 2012-03-30 11:52:34.000000000 +0000 @@ -0,0 +1,40 @@ +/* + 961122-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports long long constants! +#if 0 +long long acc; + +addhi (short a) +{ + acc += (long long) a << 32; +} + +subhi (short a) +{ + acc -= (long long) a << 32; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + acc = 0xffff00000000ll; + addhi (1); + if (acc != 0x1000000000000ll) + ASSERT (0); + subhi (1); + if (acc != 0xffff00000000ll) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961122-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961122-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961122-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961122-2.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,24 @@ +/* + 961122-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +f (int a) +{ + return ((a >= 0 && a <= 10) && ! (a >= 0)); +} + +void +testTortureExecute (void) +{ + if (f (0)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961125-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961125-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961125-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961125-1.c 2012-05-05 14:39:36.000000000 +0000 @@ -0,0 +1,45 @@ +/* + 961125-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 196 +#endif + +static char * +begfield (int tab, char *ptr, char *lim, int sword, int schar) +{ + if (tab) + { + while (ptr < lim && sword--) + { + while (ptr < lim && *ptr != tab) + ++ptr; + if (ptr < lim) + ++ptr; + } + } + else + { + while (1) + ; + } + + if (ptr + schar <= lim) + ptr += schar; + + return ptr; +} + +void +testTortureExecute (void) +{ + char *s = ":ab"; + char *lim = s + 3; + if (begfield (':', s, lim, 1, 1) != s + 2) + ASSERT (0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961206-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961206-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961206-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961206-1.c 2012-03-30 11:52:34.000000000 +0000 @@ -0,0 +1,69 @@ +/* + 961206-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports long long constants! +#if 0 +int +sub1 (unsigned long long i) +{ + if (i < 0x80000000) + return 1; + else + return 0; +} + +int +sub2 (unsigned long long i) +{ + if (i <= 0x7FFFFFFF) + return 1; + else + return 0; +} + +int +sub3 (unsigned long long i) +{ + if (i >= 0x80000000) + return 0; + else + return 1; +} + +int +sub4 (unsigned long long i) +{ + if (i > 0x7FFFFFFF) + return 0; + else + return 1; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + if (sub1 (0x80000000ULL)) + ASSERT (0); + + if (sub2 (0x80000000ULL)) + ASSERT (0); + + if (sub3 (0x80000000ULL)) + ASSERT (0); + + if (sub4 (0x80000000ULL)) + ASSERT (0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961213-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961213-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961213-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961213-1.c 2012-04-02 11:45:09.000000000 +0000 @@ -0,0 +1,39 @@ +/* + 961213-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when long long constants are supported! +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) +int +g (unsigned long long int *v, int n, unsigned int a[], int b) +{ + int cnt; + *v = 0; + for (cnt = 0; cnt < n; ++cnt) + *v = *v * b + a[cnt]; + return n; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + int res; + unsigned int ar[] = { 10, 11, 12, 13, 14 }; + unsigned long long int v; + + res = g (&v, sizeof(ar)/sizeof(ar[0]), ar, 16); + if (v != 0xabcdeUL) + ASSERT (0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961223-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961223-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-961223-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-961223-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,36 @@ +/* + 961223-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports struct! +#if 0 +struct s { + double d; +}; + +inline struct s +sub (struct s s) +{ + s.d += 1.0; + return s; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct s t = { 2.0 }; + t = sub (t); + if (t.d != 3.0) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980205.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980205.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980205.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980205.c 2012-06-09 08:45:58.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 980205.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +#include + +//#ifndef __SDCC_ds390 +void fdouble (double one, ...) +{ + double value; + va_list ap; + + va_start (ap, one); + value = va_arg (ap, double); + va_end (ap); + + if (one != 1.0 || value != 2.0) + ASSERT (0); +} +//#endif + +void +testTortureExecute (void) +{ + fdouble (1.0, 2.0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980223.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980223.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980223.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980223.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,48 @@ +/* + 980223.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports struct! +#if 0 +typedef struct { char *addr; long type; } object; + +object bar (object blah) +{ + ASSERT(0); +} + +object foo (object x, object y) +{ + object z = *(object*)(x.addr); + if (z.type & 64) + { + y = *(object*)(z.addr+sizeof(object)); + z = *(object*)(z.addr); + if (z.type & 64) + y = bar(y); + } + return y; +} + +int nil; +object cons1[2] = { {(char *) &nil, 0}, {(char *) &nil, 0} }; +object cons2[2] = { {(char *) &cons1, 64}, {(char *) &nil, 0} }; +#endif + +void +testTortureExecute (void) +{ +#if 0 + object x = {(char *) &cons2, 64}; + object y = {(char *) &nil, 0}; + object three = foo(x,y); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980424-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980424-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980424-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980424-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,37 @@ +/* + 980424-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#ifndef __SDCC_mcs51 +int i, a[99]; + +void f (int one) +{ + if (one != 1) + ASSERT (0); +} + +void +g () +{ + f (a[i & 0x3f]); +} +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + a[0] = 1; + i = 0x40; + g (); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980505-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980505-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980505-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980505-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,24 @@ +/* + 980505-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +static int f(int); + +void +testTortureExecute (void) +{ + int f1, f2, x; + x = 1; f1 = f(x); + x = 2; f2 = f(x); + if (f1 != 1 || f2 != 2) + ASSERT (0); + return; +} +static int f(int x) { return x; } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980505-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980505-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980505-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980505-2.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,33 @@ +/* + 980505-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +typedef unsigned short Uint16; +typedef unsigned int Uint; + +Uint f () +{ + Uint16 token; + Uint count; + static Uint16 values[1] = {0x9300}; + + token = values[0]; + count = token >> 8; + + return count; +} + +void +testTortureExecute (void) +{ + if (f () != 0x93) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980506-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980506-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980506-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980506-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,37 @@ +/* + 980506-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct decision +{ + char enforce_mode; + struct decision *next; +}; + + +static void +clear_modes (register struct decision *p) +{ + goto blah; + +foo: + p->enforce_mode = 0; +blah: + if (p) + goto foo; +} + +void +testTortureExecute (void) +{ + struct decision *p = 0; + clear_modes (p); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980506-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980506-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980506-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980506-2.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,34 @@ +/* + 980506-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +static void *self(void *p){ return p; } + +int +f() +{ + struct { int i; } s, *sp; + int *ip = &s.i; + + s.i = 1; + sp = self(&s); + + *ip = 0; + return sp->i+1; +} + +void +testTortureExecute (void) +{ + if (f () != 1) + ASSERT (0); + else + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980506-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980506-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980506-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980506-3.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,38 @@ +/* + 980506-3.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#ifndef __SDCC_mcs51 +#include + +unsigned char lookup_table [257]; + +static int +build_lookup (unsigned char * pattern) +{ + int m; + + m = strlen (pattern) - 1; + + memset (lookup_table, ++m, 257); + return m; +} +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + if (build_lookup ("bind") != 4) + ASSERT (0); + else + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980526-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980526-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980526-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980526-3.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,30 @@ +/* + 980526-3.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int compare(unsigned int x, unsigned int y) +{ + if (x==y) + return 0; + else + return 1; +} + +void +testTortureExecute (void) +{ + unsigned int i, j, k, l; + i = 5; j = 2; k=0; l=2; + if (compare(5%(~(unsigned) 2), i%~j) + || compare(0, k%~l)) + ASSERT(0); + else + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980602-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980602-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980602-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980602-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,21 @@ +/* + 980602-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ + int i; + for (i = 1; i < 100; i++) + ; + if (i == 100) + return; + ASSERT (0); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980604-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980604-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980604-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980604-1.c 2012-06-09 08:45:58.000000000 +0000 @@ -0,0 +1,32 @@ +/* + 980604-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +int a = 1; +int b = -1; + +int c = 1; +int d = 0; + +void +testTortureExecute (void) +{ + double e; + double f; + double g; + + f = c; + g = d; + e = (a < b) ? f : g; + if (e) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980612-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980612-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980612-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980612-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,29 @@ +/* + 980612-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct fd +{ + unsigned char a; + unsigned char b; +} f = { 5 }; + +struct fd *g() { return &f; } +int h() { return -1; } + +void +testTortureExecute (void) +{ + struct fd *f = g(); + f->b = h(); + if (((f->a & 0x7f) & ~0x10) <= 2) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980617-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980617-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980617-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980617-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,26 @@ +/* + 980617-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void foo (unsigned int * p) +{ + if ((signed char)(*p & 0xFF) == 17 || (signed char)(*p & 0xFF) == 18) + return; + else + ASSERT (0); +} + +void +testTortureExecute (void) +{ + int i = 0x30011; + foo(&i); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980618-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980618-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980618-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980618-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 980618-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void func(int, int); + +void +testTortureExecute (void) +{ + int x = 7; + func(!x, !7); + return; +} + +void func(int x, int y) +{ + if (x == y) + return; + else + ASSERT (0); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980701-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980701-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980701-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980701-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 980701-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +ns_name_skip (unsigned char **x, unsigned char *y) +{ + *x = 0; + return 0; +} + +unsigned char a[2]; + +int dn_skipname(unsigned char *ptr, unsigned char *eom) { + unsigned char *saveptr = ptr; + + if (ns_name_skip(&ptr, eom) == -1) + return (-1); + return (ptr - saveptr); +} + +void +testTortureExecute (void) +{ + if (dn_skipname (&a[0], &a[1]) == 0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980707-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980707-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980707-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980707-1.c 2012-06-15 12:17:22.000000000 +0000 @@ -0,0 +1,65 @@ +/* + 980707-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +#include +#include + +char ** +buildargv (char *input) +{ +#ifndef __SDCC_mcs51 + static char *arglist[256]; +#else + static char *arglist[8]; +#endif + int numargs = 0; + + while (1) + { + while (*input == ' ') + input++; + if (*input == 0) + break; + arglist [numargs++] = input; + while (*input != ' ' && *input != 0) + input++; + if (*input == 0) + break; + *(input++) = 0; + } + arglist [numargs] = NULL; + return arglist; +} + +void +testTortureExecute (void) +{ + char **args; +#ifndef __SDCC_mcs51 + char input[256]; +#else + char input[8]; +#endif + int i; + + strcpy(input, " a b"); + args = buildargv(input); + + if (strcmp (args[0], "a")) + ASSERT (0); + if (strcmp (args[1], "b")) + ASSERT (0); + if (args[2] != NULL) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980716-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980716-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980716-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980716-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,36 @@ +/* + 980716-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +void +stub(int num, ...) +{ + va_list ap; + char *end; + int i; + + for (i = 0; i < 2; i++) { + va_start(ap, num); + while ( 1 ) { + end = va_arg(ap, char *); + if (!end) break; + } + va_end(ap); + } +} + +void +testTortureExecute (void) +{ + stub(1, "ab", "bc", "cx", 0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980929-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980929-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-980929-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-980929-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,32 @@ +/* + 980929-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void f(int i) +{ + if (i != 1000) + ASSERT (0); +} + + +void +testTortureExecute (void) +{ + int n=1000; + int i; + + f(n); + for(i=0; i<1; ++i) { + f(n); + n=666; + &n; + } + + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-981001-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-981001-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-981001-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-981001-1.c 2012-03-28 10:10:23.000000000 +0000 @@ -0,0 +1,50 @@ +/* + 981001-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#define NG 0x100L + +unsigned long flg = 0; + +long sub (int n) __reentrant +{ + int a, b ; + + if (n >= 2) + { + if (n % 2 == 0) + { + a = sub (n / 2); + + return (a + 2 * sub (n / 2 - 1)) * a; + } + else + { + a = sub (n / 2 + 1); + b = sub (n / 2); + + return a * a + b * b; + } + } + else + return (long) n; +} + +void +testTortureExecute (void) +{ + if (sub (30) != 832040L) + flg |= NG; + + if (flg) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-981019-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-981019-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-981019-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-981019-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,56 @@ +/* + 981019-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +extern int f2(void); +extern int f3(void); +extern void f1(void); + +void +ff(int fname, int part, int nparts) +{ + if (fname) /* bb 0 */ + { + if (nparts) /* bb 1 */ + f1(); /* bb 2 */ + } + else + fname = 2; /* bb 3 */ + + /* bb 4 is the branch to bb 10 + (bb 10 is physically at the end of the loop) */ + while (f3() /* bb 10 */) + { + if (nparts /* bb 5 */ && f2() /* bb 6 */) + { + f1(); /* bb 7 ... */ + nparts = part; + if (f3()) /* ... bb 7 */ + f1(); /* bb 8 */ + f1(); /* bb 9 */ + break; + } + } + + if (nparts) /* bb 11 */ + f1(); /* bb 12 */ + return; /* bb 13 */ +} + +void +testTortureExecute (void) +{ + ff(0, 1, 0); + return; +} + +int f3(void) { static int x = 0; x = !x; return x; } +void f1(void) { ASSERT(0); } +int f2(void) { ASSERT(0); } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-981130-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-981130-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-981130-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-981130-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,42 @@ +/* + 981130-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports struct! +#if 0 +struct s { int a; int b;}; +struct s s1; +struct s s2 = { 1, 2, }; + +void +check (int a, int b) +{ + if (a == b) + return; + else + ASSERT (0); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + int * p; + int x; + + s1.a = 9; + p = & s1.a; + s1 = s2; + x = * p; + + check (x, 1); +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-981206-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-981206-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-981206-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-981206-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,29 @@ +/* + 981206-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Verify unaligned address aliasing on Alpha EV[45]. */ + +static unsigned short x, y; + +void foo() +{ + x = 0x345; + y = 0x567; +} + +void +testTortureExecute (void) +{ + foo (); + if (x != 0x345 || y != 0x567) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990106-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990106-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990106-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990106-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,27 @@ +/* + 990106-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +foo(char *bufp) +{ + int x = 80; + return (*bufp++ = x ? 'a' : 'b'); +} + +void +testTortureExecute (void) +{ + char x; + + if (foo (&x) != 'a') + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990106-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990106-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990106-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990106-2.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,32 @@ +/* + 990106-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +unsigned calc_mp(unsigned mod) +{ + unsigned a,b,c; + c=-1; + a=c/mod; + b=0-a*mod; + if (b > mod) { a += 1; b-=mod; } + return b; +} + +void +testTortureExecute (void) +{ + unsigned x = 1234; + unsigned y = calc_mp(x); + + if ((sizeof (y) == 4 && y != 680) + || (sizeof (y) == 2 && y != 134)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990117-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990117-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990117-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990117-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 990117-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +int +foo (int x, int y, int i, int j) +{ + double tmp1 = ((double) x / y); + double tmp2 = ((double) i / j); + + return tmp1 < tmp2; +} + +void +testTortureExecute (void) +{ + if (foo (2, 24, 3, 4) == 0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990127-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990127-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990127-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990127-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,44 @@ +/* + 990127-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +void +testTortureExecute (void) +{ + int a,b,c; + int *pa, *pb, *pc; + int **ppa, **ppb, **ppc; + int i,j,k,x,y,z; + + a = 10; + b = 20; + c = 30; + pa = &a; pb = &b; pc = &c; + ppa = &pa; ppb = &pb; ppc = &pc; + x = 0; y = 0; z = 0; + + for(i=0;i<10;i++){ + if( pa == &a ) pa = &b; + else pa = &a; + while( (*pa)-- ){ + x++; + if( (*pa) < 3 ) break; + else pa = &b; + } + x++; + pa = &b; + } + + if ((*pa) != -5 || (*pb) != -5 || x != 43) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990128-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990128-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990128-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990128-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,62 @@ +/* + 990128-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +extern int printf (const char *,...); + +struct s { struct s *n; } *p; +struct s ss; +#define MAX 10 +struct s sss[MAX]; +int count = 0; + +void sub( struct s *p, struct s **pp ); +int look( struct s *p, struct s **pp ); + +void +testTortureExecute (void) +{ + struct s *pp; + struct s *next; + int i; + + p = &ss; + next = p; + for ( i = 0; i < MAX; i++ ) { + next->n = &sss[i]; + next = next->n; + } + next->n = 0; + + sub( p, &pp ); + if (count != MAX+2) + ASSERT ( 0 ); + + return; +} + +void sub( struct s *p, struct s **pp ) +{ + for ( ; look( p, pp ); ) { + if ( p ) + p = p->n; + else + break; + } +} + +int look( struct s *p, struct s **pp ) +{ + for ( ; p; p = p->n ) + ; + *pp = p; + count++; + return( 1 ); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990211-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990211-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990211-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990211-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,71 @@ +/* + 990211-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Copyright (C) 1999 Free Software Foundation, Inc. + Contributed by Nathan Sidwell 20 Jan 1999 */ + +/* check range combining boolean operations work */ + +#define N 77 + +void func(int i) +{ + /* fold-const does some clever things with range tests. Make sure + we get (some of) them right */ + + /* these must fail, regardless of the value of i */ + if ((i < 0) && (i >= 0)) + ASSERT(0); + if ((i > 0) && (i <= 0)) + ASSERT(0); + if ((i >= 0) && (i < 0)) + ASSERT(0); + if ((i <= 0) && (i > 0)) + ASSERT(0); + + if ((i < N) && (i >= N)) + ASSERT(0); + if ((i > N) && (i <= N)) + ASSERT(0); + if ((i >= N) && (i < N)) + ASSERT(0); + if ((i <= N) && (i > N)) + ASSERT(0); + + /* these must pass, regardless of the value of i */ + if (! ((i < 0) || (i >= 0))) + ASSERT(0); + if (! ((i > 0) || (i <= 0))) + ASSERT(0); + if (! ((i >= 0) || (i < 0))) + ASSERT(0); + if (! ((i <= 0) || (i > 0))) + ASSERT(0); + + if (! ((i < N) || (i >= N))) + ASSERT(0); + if (! ((i > N) || (i <= N))) + ASSERT(0); + if (! ((i >= N) || (i < N))) + ASSERT(0); + if (! ((i <= N) || (i > N))) + ASSERT(0); + + return; +} + +void +testTortureExecute (void) +{ + func(0); + func(1); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990222-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990222-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990222-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990222-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,23 @@ +/* + 990222-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +char line[4] = { '1', '9', '9', '\0' }; + +void +testTortureExecute (void) +{ + char *ptr = line + 3; + + while ((*--ptr += 1) > '9') *ptr = '0'; + if (line[0] != '2' || line[1] != '0' || line[2] != '0') + ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990404-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990404-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990404-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990404-1.c 2012-05-05 14:39:36.000000000 +0000 @@ -0,0 +1,39 @@ +/* + 990404-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 84 +#pragma disable_warning 85 +#endif + + +int x[10] = { 0,1,2,3,4,5,6,7,8,9}; + +void +testTortureExecute (void) +{ + int niterations = 0, i; + + for (;;) { + int i, mi, max; + max = 0; + for (i = 0; i < 10 ; i++) { + if (x[i] > max) { + max = x[i]; + mi = i; + } + } + if (max == 0) + break; + x[mi] = 0; + niterations++; + if (niterations > 10) + ASSERT (0); + } + + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990513-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990513-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990513-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990513-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,42 @@ +/* + 990513-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#ifndef __SDCC_mcs51 +#include + +void foo (int *BM_tab, int j) +{ + int *BM_tab_base; + + BM_tab_base = BM_tab; + BM_tab += 0400; + while (BM_tab_base != BM_tab) + { + *--BM_tab = j; + *--BM_tab = j; + *--BM_tab = j; + *--BM_tab = j; + } +} +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + int BM_tab[0400]; + memset (BM_tab, 0, sizeof (BM_tab)); + foo (BM_tab, 6); + if (BM_tab[0] != 6) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990524-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990524-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990524-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990524-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,38 @@ +/* + 990524-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +char a[] = "12345"; +char b[] = "12345"; + +void loop (char * pz, char * pzDta) +{ + for (;;) { + switch (*(pz++) = *(pzDta++)) { + case 0: + goto loopDone2; + + case '"': + case '\\': + pz[-1] = '\\'; + *(pz++) = pzDta[-1]; + } + } loopDone2:; + + if (a - pz != b - pzDta) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + loop (a, b); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990525-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990525-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990525-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990525-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,40 @@ +/* + 990525-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc supports struct! +#if 0 +struct blah { + int m1, m2; +}; + +void die(struct blah arg) +{ + int i ; + struct blah buf[1]; + + for (i = 0; i < 1 ; buf[i++] = arg) + ; + if (buf[0].m1 != 1) { + ASSERT (0); + } +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct blah s = { 1, 2 }; + + die(s); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990525-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990525-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990525-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990525-2.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,53 @@ +/* + 990525-2.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// TODO: Enable when sdcc can return struct! +#if 0 +typedef struct { + int v[4]; +} Test1; + +Test1 func2(); + +int func1() +{ + Test1 test; + test = func2(); + + if (test.v[0] != 10) + ASSERT (0); + if (test.v[1] != 20) + ASSERT (0); + if (test.v[2] != 30) + ASSERT (0); + if (test.v[3] != 40) + ASSERT (0); +} + +Test1 func2() +{ + Test1 tmp; + tmp.v[0] = 10; + tmp.v[1] = 20; + tmp.v[2] = 30; + tmp.v[3] = 40; + return tmp; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + func1(); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990527-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990527-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990527-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990527-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,40 @@ +/* + 990527-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int sum; + +void +g (int i) +{ + sum += i; +} + +void +f(int j) +{ + int i; + + for (i = 0; i < 9; i++) + { + j++; + g (j); + j = 9; + } +} + +void +testTortureExecute (void) +{ + f (0); + if (sum != 81) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990531-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990531-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990531-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990531-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,35 @@ +/* + 990531-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + + unsigned long bad(int reg, unsigned long inWord) + { + union { + unsigned long word; + unsigned char byte[4]; + } data; + + data.word = inWord; + data.byte[reg] = 0; + + return data.word; + } + +void +testTortureExecute (void) +{ + /* XXX This test could be generalized. */ + if (sizeof (long) != 4) + return; + + if (bad (0, 0xdeadbeef) == 0xdeadbeef) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990604-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990604-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990604-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990604-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,30 @@ +/* + 990604-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int b; +void f () +{ + int i = 0; + if (b == 0) + do { + b = i; + i++; + } while (i < 10); +} + +void +testTortureExecute (void) +{ + f (); + if (b != 9) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990804-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990804-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990804-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990804-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,41 @@ +/* + 990804-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int gfbyte ( void ) +{ + return 0; +} + +void +testTortureExecute (void) +{ + int i,j,k ; + + i = gfbyte(); + + i = i + 1 ; + + if ( i == 0 ) + k = -0 ; + else + k = i + 0 ; + + if (i != 1) + ASSERT (0); + + k = 1 ; + if ( k <= i) + do + j = gfbyte () ; + while ( k++ < i ) ; + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990811-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990811-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990811-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990811-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,43 @@ +/* + 990811-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct s {long a; int b;}; + +int foo(int x, void *y) +{ + switch(x) { + case 0: return ((struct s*)y)->a; + case 1: return *(signed char*)y; + case 2: return *(short*)y; + } + ASSERT(0); +} + +void +testTortureExecute (void) +{ + struct s s; + short sh[10]; + signed char c[10]; + int i; + + s.a = 1; + s.b = 2; + for (i = 0; i < 10; i++) { + sh[i] = i; + c[i] = i; + } + + if (foo(0, &s) != 1) ASSERT(0); + if (foo(1, c+3) != 3) ASSERT(0); + if (foo(2, sh+3) != 3) ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990827-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990827-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990827-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990827-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,33 @@ +/* + 990827-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +unsigned test(unsigned one , unsigned bit) +{ + unsigned val= bit & 1; + unsigned zero= one >> 1; + + val++; + return zero + ( val>> 1 ); +} + +void +testTortureExecute (void) +{ + if (test (1,0) != 0) + ASSERT (0); + if (test (1,1) != 1) + ASSERT (0); + if (test (1,65535) != 1) + ASSERT (0); + return; + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990829-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990829-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-990829-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-990829-1.c 2012-03-26 17:32:32.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 990829-1.c from the execute part of the gcc torture suite. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +double test (const double le, const double ri) +{ + double val = ( ri - le ) / ( ri * ( le + 1.0 ) ); + return val; +} + +void +testTortureExecute (void) +{ + double retval; + + retval = test(1.0,2.0); + if (retval < 0.24 || retval > 0.26) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991016-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991016-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991016-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991016-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,71 @@ +/* + 991016-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Two of these types will, on current gcc targets, have the same + mode but have different alias sets. DOIT tries to get gcse to + invalidly hoist one of the values out of the loop. */ + +#if 0 +//long long is not supported for some targets, and on the targets that support long long, this test crashes sdcc. +typedef int T0; +typedef long T1; +typedef long long T2; + +int +doit(int sel, int n, void *p) +{ + T0 * const p0 = p; + T1 * const p1 = p; + T2 * const p2 = p; + + switch (sel) + { + case 0: + do + *p0 += *p0; + while (--n); + return *p0 == 0; + + case 1: + do + *p1 += *p1; + while (--n); + return *p1 == 0; + + case 2: + do + *p2 += *p2; + while (--n); + return *p2 == 0; + + default: + ASSERT (0); + } +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + T0 v0; T1 v1; T2 v2; + + v0 = 1; doit(0, 5, &v0); + v1 = 1; doit(1, 5, &v1); + v2 = 1; doit(2, 5, &v2); + + if (v0 != 32) ASSERT (0); + if (v1 != 32) ASSERT (0); + if (v2 != 32) ASSERT (0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991023-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991023-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991023-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991023-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,34 @@ +/* + 991023-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int blah; +foo() +{ + int i; + + for (i=0 ; i< 7 ; i++) + { + if (i == 7 - 1) + blah = 0xfcc; + else + blah = 0xfee; + } + return blah; +} + + +void +testTortureExecute (void) +{ + if (foo () != 0xfcc) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991112-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991112-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991112-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991112-1.c 2012-05-18 16:39:12.000000000 +0000 @@ -0,0 +1,36 @@ +/* + 991112-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +#include + +/* This code was miscompiled at -O3 on x86. + Reported by Jim Meyering; distilled from bash. */ + +int rl_show_char (int c) { return 0; } + +int rl_character_len (int c, int pos) +{ + return isprint (c) ? 1 : 2; +} + +void +testTortureExecute (void) +{ +#if !defined (__SDCC_hc08) && !defined (__SDCC_s08) && !defined (__SDCC_ds390) && !defined (__SDCC_mcs51) + int (*x)(int, int) = rl_character_len; + if (x('a', 1) != 1) + ASSERT (0); + if (x('\002', 1) != 2) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991202-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991202-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991202-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991202-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,26 @@ +/* + 991202-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int x, y; + +void +testTortureExecute (void) +{ + x = 2; + y = x; + do + { + x = y; + y = 2 * y; + } + while ( ! ((y - x) >= 20)); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991202-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991202-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991202-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991202-2.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,27 @@ +/* + 991202-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +f1 () +{ + unsigned long x, y = 1; + + x = ((y * 8192) - 216) % 16; + return x; +} + +void +testTortureExecute (void) +{ + if (f1 () != 8) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991216-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991216-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991216-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991216-1.c 2012-04-02 09:59:13.000000000 +0000 @@ -0,0 +1,134 @@ +/* + 991216-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 184 +#endif + +// Some ports do not support long long yet. +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + +#define VALUE 0x123456789abcdefLL +#define AFTER 0x55 + +void +test1 (int a, long long value, int after) +{ + if (a != 1 + || value != VALUE + || after != AFTER) + ASSERT (0); +} + +void +test2 (int a, int b, long long value, int after) +{ + if (a != 1 + || b != 2 + || value != VALUE + || after != AFTER) + ASSERT (0); +} + +void +test3 (int a, int b, int c, long long value, int after) +{ + if (a != 1 + || b != 2 + || c != 3 + || value != VALUE + || after != AFTER) + ASSERT (0); +} + +void +test4 (int a, int b, int c, int d, long long value, int after) +{ + if (a != 1 + || b != 2 + || c != 3 + || d != 4 + || value != VALUE + || after != AFTER) + ASSERT (0); +} + +void +test5 (int a, int b, int c, int d, int e, long long value, int after) +{ + if (a != 1 + || b != 2 + || c != 3 + || d != 4 + || e != 5 + || value != VALUE + || after != AFTER) + ASSERT (0); +} + +void +test6 (int a, int b, int c, int d, int e, int f, long long value, int after) +{ + if (a != 1 + || b != 2 + || c != 3 + || d != 4 + || e != 5 + || f != 6 + || value != VALUE + || after != AFTER) + ASSERT (0); +} + +void +test7 (int a, int b, int c, int d, int e, int f, int g, long long value, int after) +{ + if (a != 1 + || b != 2 + || c != 3 + || d != 4 + || e != 5 + || f != 6 + || g != 7 + || value != VALUE + || after != AFTER) + ASSERT (0); +} + +void +test8 (int a, int b, int c, int d, int e, int f, int g, int h, long long value, int after) +{ + if (a != 1 + || b != 2 + || c != 3 + || d != 4 + || e != 5 + || f != 6 + || g != 7 + || h != 8 + || value != VALUE + || after != AFTER) + ASSERT (0); +} +#endif + +void +testTortureExecute (void) +{ +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + test1 (1, VALUE, AFTER); + test2 (1, 2, VALUE, AFTER); + test3 (1, 2, 3, VALUE, AFTER); + test4 (1, 2, 3, 4, VALUE, AFTER); + test5 (1, 2, 3, 4, 5, VALUE, AFTER); + test6 (1, 2, 3, 4, 5, 6, VALUE, AFTER); + test7 (1, 2, 3, 4, 5, 6, 7, VALUE, AFTER); + test8 (1, 2, 3, 4, 5, 6, 7, 8, VALUE, AFTER); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991216-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991216-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991216-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991216-2.c 2012-04-02 09:59:13.000000000 +0000 @@ -0,0 +1,58 @@ +/* + 991216-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 184 +#endif + +// Some ports do not support long long yet. +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + +#include + +#define VALUE 0x123456789abcdefLL +#define AFTER 0x55 + +void +test (int n, ...) +{ + va_list ap; + int i; + + va_start (ap, n); + for (i = 2; i <= n; i++) + { + if (va_arg (ap, int) != i) + ASSERT (0); + } + + if (va_arg (ap, long long) != VALUE) + ASSERT (0); + + if (va_arg (ap, int) != AFTER) + ASSERT (0); + + va_end (ap); +} +#endif + +void +testTortureExecute (void) +{ +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + test (1, VALUE, AFTER); + test (2, 2, VALUE, AFTER); + test (3, 2, 3, VALUE, AFTER); + test (4, 2, 3, 4, VALUE, AFTER); + test (5, 2, 3, 4, 5, VALUE, AFTER); + test (6, 2, 3, 4, 5, 6, VALUE, AFTER); + test (7, 2, 3, 4, 5, 6, 7, VALUE, AFTER); + test (8, 2, 3, 4, 5, 6, 7, 8, VALUE, AFTER); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991216-4.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991216-4.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991216-4.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991216-4.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,28 @@ +/* + 991216-4.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Test against a problem with loop reversal. */ +static void bug(int size, int tries) +{ + int i; + int num = 0; + while (num < size) + { + for (i = 1; i < tries; i++) num++; + } +} + +void +testTortureExecute (void) +{ + bug(5, 10); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991227-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991227-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-991227-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-991227-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,24 @@ +/* + 991227-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +char* doit(int flag) +{ + return 1 + (flag ? "\0wrong\n" : "\0right\n"); +} + +void +testTortureExecute (void) +{ + char *result = doit(0); + if (*result == 'r' && result[1] == 'i') + return; + ASSERT (0); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-anon-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-anon-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-anon-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-anon-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,42 @@ +/* + anon-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c11 + +/* Copyright (C) 2001 Free Software Foundation, Inc. */ + +/* Source: Neil Booth, 4 Nov 2001, derived from PR 2820 - field lookup in + nested anonymous entities was broken. */ + +struct +{ + int x; + struct + { + int a; + union + { + int b; + }; + }; +} foo; +#endif + +void +testTortureExecute (void) +{ +#ifdef __SDCC + foo.b = 6; + foo.a = 5; + + if (foo.b != 6) + ASSERT (0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-arith-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-arith-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-arith-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-arith-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,26 @@ +/* + arith-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c89 +#endif + +unsigned +sat_add (unsigned i) +{ + unsigned ret = i + 1; + if (ret < i) + ret = i; + return ret; +} + +void +testTortureExecute (void) +{ + if (sat_add (~0U) != ~0U) + ASSERT (0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-bitfld-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-bitfld-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-bitfld-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-bitfld-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,64 @@ +/* + bitfld-1-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c89 +#endif + +/* Copyright 2002 Free Software Foundation, Inc. + + Tests correct signedness of operations on bitfields; in particular + that integer promotions are done correctly, including the case when + casts are present. + + The C front end was eliding the cast of an unsigned bitfield to + unsigned as a no-op, when in fact it forces a conversion to a + full-width unsigned int. (At the time of writing, the C++ front end + has a different bug; it erroneously promotes the uncast unsigned + bitfield to an unsigned int). + + Source: Neil Booth, 25 Jan 2002, based on PR 3325 (and 3326, which + is a different manifestation of the same bug). +*/ + +extern void abort (); + +void +testTortureExecute (void) +{ + struct x { signed int i : 7; unsigned int u : 7; } bit; + + unsigned int u; + int i; + unsigned int unsigned_result = -13U % 61; + int signed_result = -13 % 61; + + bit.u = 61, u = 61; + bit.i = -13, i = -13; + + if (i % u != unsigned_result) + ASSERT (0); + if (i % (unsigned int) u != unsigned_result) + ASSERT (0); + + /* Somewhat counter-intuitively, bit.u is promoted to an int, making + the operands and result an int. */ + if (i % bit.u != signed_result) + ASSERT (0);; + + if (bit.i % bit.u != signed_result) + ASSERT (0); + + /* But with a cast to unsigned int, the unsigned int is promoted to + itself as a no-op, and the operands and result are unsigned. */ + if (i % (unsigned int) bit.u != unsigned_result) + ASSERT (0); + + if (bit.i % (unsigned int) bit.u != unsigned_result) + ASSERT (0); + + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-cmpsf-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-cmpsf-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-cmpsf-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-cmpsf-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,178 @@ +/* + cmpsf-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include +#include + +#define F 140 +#define T 13 + +feq (float x, float y) +{ + if (x == y) + return T; + else + return F; +} + +fne (float x, float y) +{ + if (x != y) + return T; + else + return F; +} + +flt (float x, float y) +{ + if (x < y) + return T; + else + return F; +} + +fge (float x, float y) +{ + if (x >= y) + return T; + else + return F; +} + +fgt (float x, float y) +{ + if (x > y) + return T; + else + return F; +} + +fle (float x, float y) +{ + if (x <= y) + return T; + else + return F; +} + +float args[] = +{ + 0.0F, + 1.0F, + -1.0F, + FLT_MAX, + FLT_MIN, + 0.0000000000001F, + 123456789.0F, + -987654321.0F +}; + +#ifndef __SDCC_mcs51 + +int correct_results[] = +{ + T, F, F, T, F, T, + F, T, T, F, F, T, + F, T, F, T, T, F, + F, T, T, F, F, T, + F, T, T, F, F, T, + F, T, T, F, F, T, + F, T, T, F, F, T, + F, T, F, T, T, F, + F, T, F, T, T, F, + T, F, F, T, F, T, + F, T, F, T, T, F, + F, T, T, F, F, T, + F, T, F, T, T, F, + F, T, F, T, T, F, + F, T, T, F, F, T, + F, T, F, T, T, F, + F, T, T, F, F, T, + F, T, T, F, F, T, + T, F, F, T, F, T, + F, T, T, F, F, T, + F, T, T, F, F, T, + F, T, T, F, F, T, + F, T, T, F, F, T, + F, T, F, T, T, F, + F, T, F, T, T, F, + F, T, F, T, T, F, + F, T, F, T, T, F, + T, F, F, T, F, T, + F, T, F, T, T, F, + F, T, F, T, T, F, + F, T, F, T, T, F, + F, T, F, T, T, F, + F, T, F, T, T, F, + F, T, T, F, F, T, + F, T, F, T, T, F, + F, T, T, F, F, T, + T, F, F, T, F, T, + F, T, T, F, F, T, + F, T, T, F, F, T, + F, T, F, T, T, F, + F, T, F, T, T, F, + F, T, T, F, F, T, + F, T, F, T, T, F, + F, T, T, F, F, T, + F, T, F, T, T, F, + T, F, F, T, F, T, + F, T, T, F, F, T, + F, T, F, T, T, F, + F, T, F, T, T, F, + F, T, F, T, T, F, + F, T, F, T, T, F, + F, T, T, F, F, T, + F, T, F, T, T, F, + F, T, F, T, T, F, + T, F, F, T, F, T, + F, T, F, T, T, F, + F, T, T, F, F, T, + F, T, T, F, F, T, + F, T, T, F, F, T, + F, T, T, F, F, T, + F, T, T, F, F, T, + F, T, T, F, F, T, + F, T, T, F, F, T, + T, F, F, T, F, T, +}; +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + int i, j, *res = correct_results; + + for (i = 0; i < 8; i++) + { + float arg0 = args[i]; + for (j = 0; j < 8; j++) + { + float arg1 = args[j]; + + if (feq (arg0, arg1) != *res++) + ASSERT (0); + if (fne (arg0, arg1) != *res++) + ASSERT (0); + if (flt (arg0, arg1) != *res++) + ASSERT (0); + if (fge (arg0, arg1) != *res++) + ASSERT (0); + if (fgt (arg0, arg1) != *res++) + ASSERT (0); + if (fle (arg0, arg1) != *res++) + ASSERT (0); + } + } +#endif + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-compare-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-compare-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-compare-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-compare-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,127 @@ +/* + compare-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Copyright (C) 2002 Free Software Foundation. + + Test for correctness of composite comparisons. + + Written by Roger Sayle, 3rd June 2002. */ + +int ieq (int x, int y, int ok) +{ + if ((x<=y) && (x>=y)) + { + if (!ok) ASSERT (0); + } + else + if (ok) ASSERT (0); + + if ((x<=y) && (x==y)) + { + if (!ok) ASSERT (0); + } + else + if (ok) ASSERT (0); + + if ((x<=y) && (y<=x)) + { + if (!ok) ASSERT (0); + } + else + if (ok) ASSERT (0); + + if ((y==x) && (x<=y)) + { + if (!ok) ASSERT (0); + } + else + if (ok) ASSERT (0); +} + +int ine (int x, int y, int ok) +{ + if ((xy)) + { + if (!ok) ASSERT (0); + } + else + if (ok) ASSERT (0); +} + +int ilt (int x, int y, int ok) +{ + if ((xy) && (x!=y)) + { + if (!ok) ASSERT (0); + } + else + if (ok) ASSERT (0); +} + +int ige (int x, int y, int ok) +{ + if ((x>y) || (x==y)) + { + if (!ok) ASSERT (0); + } + else + if (ok) ASSERT (0); +} + +void +testTortureExecute (void) +{ + ieq (1, 4, 0); + ieq (3, 3, 1); + ieq (5, 2, 0); + + ine (1, 4, 1); + ine (3, 3, 0); + ine (5, 2, 1); + + ilt (1, 4, 1); + ilt (3, 3, 0); + ilt (5, 2, 0); + + ile (1, 4, 1); + ile (3, 3, 1); + ile (5, 2, 0); + + igt (1, 4, 0); + igt (3, 3, 0); + igt (5, 2, 1); + + ige (1, 4, 0); + ige (3, 3, 1); + ige (5, 2, 1); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-compare-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-compare-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-compare-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-compare-2.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,34 @@ +/* + compare-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Copyright (C) 2002 Free Software Foundation. + + Ensure that the composite comparison optimization doesn't misfire + and attempt to combine a signed comparison with an unsigned one. + + Written by Roger Sayle, 3rd June 2002. */ + +extern void abort (void); + +int +foo (int x, int y) +{ + /* If miscompiled the following may become "x == y". */ + return (x<=y) && ((unsigned int)x >= (unsigned int)y); +} + +void +testTortureExecute (void) +{ + if (! foo (-1,0)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-compare-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-compare-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-compare-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-compare-3.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,95 @@ +/* + compare-3.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Copyright (C) 2002 Free Software Foundation. + + Test for composite comparison always true/false optimization. + + Written by Roger Sayle, 7th June 2002. */ + +extern void link_error0 (); +extern void link_error1 (); + +void +test1 (int x, int y) +{ + if ((x==y) && (x!=y)) + link_error0(); +} + +void +test2 (int x, int y) +{ + if ((xy)) + link_error0(); +} + +void +test3 (int x, int y) +{ + if ((x=y) || (x + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include +#include + +#if 0 +typedef struct foo +{ + int uaattrid; + const char *name; +} FOO; + +FOO Upgrade_items[] = +{ + {1, "1"}, + {2, "2"}, + {0, NULL} +}; + +int *Upgd_minor_ID = + (int *) &((Upgrade_items + 1)->uaattrid); + +int *Upgd_minor_ID1 = + (int *) &((Upgrade_items)->uaattrid); +#endif + +void +testTortureExecute (void) +{ +#if 0 + if (*Upgd_minor_ID != 2) + ASSERT (0); + + if (*Upgd_minor_ID1 != 1) + ASSERT (0); + return; +#endif +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-divcmp-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-divcmp-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-divcmp-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-divcmp-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,367 @@ +/* + divcmp-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +extern void abort(void); + +int test1(int x) +{ + return x/10 == 2; +} + +int test1u(unsigned int x) +{ + return x/10U == 2; +} + +int test2(int x) +{ + return x/10 == 0; +} + +int test2u(unsigned int x) +{ + return x/10U == 0; +} + +int test3(int x) +{ + return x/10 != 2; +} + +int test3u(unsigned int x) +{ + return x/10U != 2; +} + +int test4(int x) +{ + return x/10 != 0; +} + +int test4u(unsigned int x) +{ + return x/10U != 0; +} + +int test5(int x) +{ + return x/10 < 2; +} + +int test5u(unsigned int x) +{ + return x/10U < 2; +} + +int test6(int x) +{ + return x/10 < 0; +} + +int test7(int x) +{ + return x/10 <= 2; +} + +int test7u(unsigned int x) +{ + return x/10U <= 2; +} + +int test8(int x) +{ + return x/10 <= 0; +} + +int test8u(unsigned int x) +{ + return x/10U <= 0; +} + +int test9(int x) +{ + return x/10 > 2; +} + +int test9u(unsigned int x) +{ + return x/10U > 2; +} + +int test10(int x) +{ + return x/10 > 0; +} + +int test10u(unsigned int x) +{ + return x/10U > 0; +} + +int test11(int x) +{ + return x/10 >= 2; +} + +int test11u(unsigned int x) +{ + return x/10U >= 2; +} + +int test12(int x) +{ + return x/10 >= 0; +} + + +void +testTortureExecute (void) +{ + if (test1(19) != 0) + ASSERT (0); + if (test1(20) != 1) + ASSERT (0); + if (test1(29) != 1) + ASSERT (0); + if (test1(30) != 0) + ASSERT (0); + + if (test1u(19) != 0) + ASSERT (0); + if (test1u(20) != 1) + ASSERT (0); + if (test1u(29) != 1) + ASSERT (0); + if (test1u(30) != 0) + ASSERT (0); + + if (test2(0) != 1) + ASSERT (0); + if (test2(9) != 1) + ASSERT (0); + if (test2(10) != 0) + ASSERT (0); + if (test2(-1) != 1) + ASSERT (0); + if (test2(-9) != 1) + ASSERT (0); + if (test2(-10) != 0) + ASSERT (0); + + if (test2u(0) != 1) + ASSERT (0); + if (test2u(9) != 1) + ASSERT (0); + if (test2u(10) != 0) + ASSERT (0); + if (test2u(-1) != 0) + ASSERT (0); + if (test2u(-9) != 0) + ASSERT (0); + if (test2u(-10) != 0) + ASSERT (0); + + if (test3(19) != 1) + ASSERT (0); + if (test3(20) != 0) + ASSERT (0); + if (test3(29) != 0) + ASSERT (0); + if (test3(30) != 1) + ASSERT (0); + + if (test3u(19) != 1) + ASSERT (0); + if (test3u(20) != 0) + ASSERT (0); + if (test3u(29) != 0) + ASSERT (0); + if (test3u(30) != 1) + ASSERT (0); + + if (test4(0) != 0) + ASSERT (0); + if (test4(9) != 0) + ASSERT (0); + if (test4(10) != 1) + ASSERT (0); + if (test4(-1) != 0) + ASSERT (0); + if (test4(-9) != 0) + ASSERT (0); + if (test4(-10) != 1) + ASSERT (0); + + if (test4u(0) != 0) + ASSERT (0); + if (test4u(9) != 0) + ASSERT (0); + if (test4u(10) != 1) + ASSERT (0); + if (test4u(-1) != 1) + ASSERT (0); + if (test4u(-9) != 1) + ASSERT (0); + if (test4u(-10) != 1) + ASSERT (0); + + if (test5(19) != 1) + ASSERT (0); + if (test5(20) != 0) + ASSERT (0); + if (test5(29) != 0) + ASSERT (0); + if (test5(30) != 0) + ASSERT (0); + + if (test5u(19) != 1) + ASSERT (0); + if (test5u(20) != 0) + ASSERT (0); + if (test5u(29) != 0) + ASSERT (0); + if (test5u(30) != 0) + ASSERT (0); + + if (test6(0) != 0) + ASSERT (0); + if (test6(9) != 0) + ASSERT (0); + if (test6(10) != 0) + ASSERT (0); + if (test6(-1) != 0) + ASSERT (0); + if (test6(-9) != 0) + ASSERT (0); + if (test6(-10) != 1) + ASSERT (0); + + if (test7(19) != 1) + ASSERT (0); + if (test7(20) != 1) + ASSERT (0); + if (test7(29) != 1) + ASSERT (0); + if (test7(30) != 0) + ASSERT (0); + + if (test7u(19) != 1) + ASSERT (0); + if (test7u(20) != 1) + ASSERT (0); + if (test7u(29) != 1) + ASSERT (0); + if (test7u(30) != 0) + ASSERT (0); + + if (test8(0) != 1) + ASSERT (0); + if (test8(9) != 1) + ASSERT (0); + if (test8(10) != 0) + ASSERT (0); + if (test8(-1) != 1) + ASSERT (0); + if (test8(-9) != 1) + ASSERT (0); + if (test8(-10) != 1) + ASSERT (0); + + if (test8u(0) != 1) + ASSERT (0); + if (test8u(9) != 1) + ASSERT (0); + if (test8u(10) != 0) + ASSERT (0); + if (test8u(-1) != 0) + ASSERT (0); + if (test8u(-9) != 0) + ASSERT (0); + if (test8u(-10) != 0) + ASSERT (0); + + if (test9(19) != 0) + ASSERT (0); + if (test9(20) != 0) + ASSERT (0); + if (test9(29) != 0) + ASSERT (0); + if (test9(30) != 1) + ASSERT (0); + + if (test9u(19) != 0) + ASSERT (0); + if (test9u(20) != 0) + ASSERT (0); + if (test9u(29) != 0) + ASSERT (0); + if (test9u(30) != 1) + ASSERT (0); + + if (test10(0) != 0) + ASSERT (0); + if (test10(9) != 0) + ASSERT (0); + if (test10(10) != 1) + ASSERT (0); + if (test10(-1) != 0) + ASSERT (0); + if (test10(-9) != 0) + ASSERT (0); + if (test10(-10) != 0) + ASSERT (0); + + if (test10u(0) != 0) + ASSERT (0); + if (test10u(9) != 0) + ASSERT (0); + if (test10u(10) != 1) + ASSERT (0); + if (test10u(-1) != 1) + ASSERT (0); + if (test10u(-9) != 1) + ASSERT (0); + if (test10u(-10) != 1) + ASSERT (0); + + if (test11(19) != 0) + ASSERT (0); + if (test11(20) != 1) + ASSERT (0); + if (test11(29) != 1) + ASSERT (0); + if (test11(30) != 1) + ASSERT (0); + + if (test11u(19) != 0) + ASSERT (0); + if (test11u(20) != 1) + ASSERT (0); + if (test11u(29) != 1) + ASSERT (0); + if (test11u(30) != 1) + ASSERT (0); + + if (test12(0) != 1) + ASSERT (0); + if (test12(9) != 1) + ASSERT (0); + if (test12(10) != 1) + ASSERT (0); + if (test12(-1) != 1) + ASSERT (0); + if (test12(-9) != 1) + ASSERT (0); + if (test12(-10) != 0) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-divcmp-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-divcmp-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-divcmp-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-divcmp-2.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,100 @@ +/* + divcmp-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int test1(int x) +{ + return x/10 == 2; +} + +int test2(int x) +{ + return x/10 == 0; +} + +int test3(int x) +{ + return x/10 == -2; +} + +int test4(int x) +{ + return x/-10 == 2; +} + +int test5(int x) +{ + return x/-10 == 0; +} + +int test6(int x) +{ + return x/-10 == -2; +} + +void +testTortureExecute (void) +{ + if (test1(19) != 0) + ASSERT (0); + if (test1(20) != 1) + ASSERT (0); + if (test1(29) != 1) + ASSERT (0); + if (test1(30) != 0) + ASSERT (0); + + if (test2(-10) != 0) + ASSERT (0); + if (test2(-9) != 1) + ASSERT (0); + if (test2(9) != 1) + ASSERT (0); + if (test2(10) != 0) + ASSERT (0); + + if (test3(-30) != 0) + ASSERT (0); + if (test3(-29) != 1) + ASSERT (0); + if (test3(-20) != 1) + ASSERT (0); + if (test3(-19) != 0) + ASSERT (0); + + if (test4(-30) != 0) + ASSERT (0); + if (test4(-29) != 1) + ASSERT (0); + if (test4(-20) != 1) + ASSERT (0); + if (test4(-19) != 0) + ASSERT (0); + + if (test5(-10) != 0) + ASSERT (0); + if (test5(-9) != 1) + ASSERT (0); + if (test5(9) != 1) + ASSERT (0); + if (test5(10) != 0) + ASSERT (0); + + if (test6(19) != 0) + ASSERT (0); + if (test6(20) != 1) + ASSERT (0); + if (test6(29) != 1) + ASSERT (0); + if (test6(30) != 0) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-divcmp-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-divcmp-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-divcmp-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-divcmp-3.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,105 @@ +/* + divcmp-3.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int test1(char x) +{ + return x/100 == 3; +} + +int test1u(unsigned char x) +{ + return x/100 == 3; +} + +int test2(char x) +{ + return x/100 != 3; +} + +int test2u(unsigned char x) +{ + return x/100 != 3; +} + +int test3(char x) +{ + return x/100 < 3; +} + +int test3u(unsigned char x) +{ + return x/100 < 3; +} + +int test4(char x) +{ + return x/100 <= 3; +} + +int test4u(unsigned char x) +{ + return x/100 <= 3; +} + +int test5(char x) +{ + return x/100 > 3; +} + +int test5u(unsigned char x) +{ + return x/100 > 3; +} + +int test6(char x) +{ + return x/100 >= 3; +} + +int test6u(unsigned char x) +{ + return x/100 >= 3; +} + +void +testTortureExecute (void) +{ + int c; + + for (c=-128; c<256; c++) + { + if (test1(c) != 0) + ASSERT (0); + if (test1u(c) != 0) + ASSERT (0); + if (test2(c) != 1) + ASSERT (0); + if (test2u(c) != 1) + ASSERT (0); + if (test3(c) != 1) + ASSERT (0); + if (test3u(c) != 1) + ASSERT (0); + if (test4(c) != 1) + ASSERT (0); + if (test4u(c) != 1) + ASSERT (0); + if (test5(c) != 0) + ASSERT (0); + if (test5u(c) != 0) + ASSERT (0); + if (test6(c) != 0) + ASSERT (0); + if (test6u(c) != 0) + ASSERT (0); + } + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-divcmp-4.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-divcmp-4.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-divcmp-4.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-divcmp-4.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,210 @@ +/* + divcmp-4.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR middle-end/17894 */ + +int test1(int x) +{ + return x/-10 == 2; +} + +int test2(int x) +{ + return x/-10 == 0; +} + +int test3(int x) +{ + return x/-10 != 2; +} + +int test4(int x) +{ + return x/-10 != 0; +} + +int test5(int x) +{ + return x/-10 < 2; +} + +int test6(int x) +{ + return x/-10 < 0; +} + +int test7(int x) +{ + return x/-10 <= 2; +} + +int test8(int x) +{ + return x/-10 <= 0; +} + +int test9(int x) +{ + return x/-10 > 2; +} + +int test10(int x) +{ + return x/-10 > 0; +} + +int test11(int x) +{ + return x/-10 >= 2; +} + +int test12(int x) +{ + return x/-10 >= 0; +} + +void +testTortureExecute (void) +{ + if (test1(-30) != 0) + ASSERT (0); + if (test1(-29) != 1) + ASSERT (0); + if (test1(-20) != 1) + ASSERT (0); + if (test1(-19) != 0) + ASSERT (0); + + if (test2(0) != 1) + ASSERT (0); + if (test2(9) != 1) + ASSERT (0); + if (test2(10) != 0) + ASSERT (0); + if (test2(-1) != 1) + ASSERT (0); + if (test2(-9) != 1) + ASSERT (0); + if (test2(-10) != 0) + ASSERT (0); + + if (test3(-30) != 1) + ASSERT (0); + if (test3(-29) != 0) + ASSERT (0); + if (test3(-20) != 0) + ASSERT (0); + if (test3(-19) != 1) + ASSERT (0); + + if (test4(0) != 0) + ASSERT (0); + if (test4(9) != 0) + ASSERT (0); + if (test4(10) != 1) + ASSERT (0); + if (test4(-1) != 0) + ASSERT (0); + if (test4(-9) != 0) + ASSERT (0); + if (test4(-10) != 1) + ASSERT (0); + + if (test5(-30) != 0) + ASSERT (0); + if (test5(-29) != 0) + ASSERT (0); + if (test5(-20) != 0) + ASSERT (0); + if (test5(-19) != 1) + ASSERT (0); + + if (test6(0) != 0) + ASSERT (0); + if (test6(9) != 0) + ASSERT (0); + if (test6(10) != 1) + ASSERT (0); + if (test6(-1) != 0) + ASSERT (0); + if (test6(-9) != 0) + ASSERT (0); + if (test6(-10) != 0) + ASSERT (0); + + if (test7(-30) != 0) + ASSERT (0); + if (test7(-29) != 1) + ASSERT (0); + if (test7(-20) != 1) + ASSERT (0); + if (test7(-19) != 1) + ASSERT (0); + + if (test8(0) != 1) + ASSERT (0); + if (test8(9) != 1) + ASSERT (0); + if (test8(10) != 1) + ASSERT (0); + if (test8(-1) != 1) + ASSERT (0); + if (test8(-9) != 1) + ASSERT (0); + if (test8(-10) != 0) + ASSERT (0); + + if (test9(-30) != 1) + ASSERT (0); + if (test9(-29) != 0) + ASSERT (0); + if (test9(-20) != 0) + ASSERT (0); + if (test9(-19) != 0) + ASSERT (0); + + if (test10(0) != 0) + ASSERT (0); + if (test10(9) != 0) + ASSERT (0); + if (test10(10) != 0) + ASSERT (0); + if (test10(-1) != 0) + ASSERT (0); + if (test10(-9) != 0) + ASSERT (0); + if (test10(-10) != 1) + ASSERT (0); + + if (test11(-30) != 1) + ASSERT (0); + if (test11(-29) != 1) + ASSERT (0); + if (test11(-20) != 1) + ASSERT (0); + if (test11(-19) != 0) + ASSERT (0); + + if (test12(0) != 1) + ASSERT (0); + if (test12(9) != 1) + ASSERT (0); + if (test12(10) != 0) + ASSERT (0); + if (test12(-1) != 1) + ASSERT (0); + if (test12(-9) != 1) + ASSERT (0); + if (test12(-10) != 1) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-divconst-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-divconst-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-divconst-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-divconst-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,32 @@ +/* + divconst-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +typedef struct +{ + unsigned a, b, c, d; +} t1; + +f (t1 *ps) +{ + ps->a = 10000; + ps->b = ps->a / 3; + ps->c = 10000; + ps->d = ps->c / 3; +} + +void +testTortureExecute (void) +{ + t1 s; + f (&s); + if (s.a != 10000 || s.b != 3333 || s.c != 10000 || s.d != 3333) + ASSERT (0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-divconst-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-divconst-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-divconst-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-divconst-2.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,52 @@ +/* + divconst-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#pragma disable_warning 85 + +long +f (long x) +{ + return x / (-0x7fffffffL - 1L); +} + +long +r (long x) +{ + return x % (-0x7fffffffL - 1L); +} + +/* Since we have a negative divisor, this equation must hold for the + results of / and %; no specific results are guaranteed. */ +long +std_eqn (long num, long denom, long quot, long rem) +{ + /* For completeness, a check for "ABS (rem) < ABS (denom)" belongs here, + but causes trouble on 32-bit machines and isn't worthwhile. */ + return quot * (-0x7fffffffL - 1L) + rem == num; +} + +long nums[] = +{ + -1L, 0x7fffffffL, -0x7fffffffL - 1L +}; + +void +testTortureExecute (void) +{ + int i; + + for (i = 0; + i < sizeof (nums) / sizeof (nums[0]); + i++) + if (std_eqn (nums[i], -0x7fffffffL - 1L, f (nums[i]), r (nums[i])) == 0) + ASSERT (0); + + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-divmod-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-divmod-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-divmod-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-divmod-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,88 @@ +/* + divmod-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +div1 (signed char x) +{ + return x / -1; +} + +div2 (signed short x) +{ + return x / -1; +} + +div3 (signed char x, signed char y) +{ + return x / y; +} + +div4 (signed short x, signed short y) +{ + return x / y; +} + +mod1 (signed char x) +{ + return x % -1; +} + +mod2 (signed short x) +{ + return x % -1; +} + +mod3 (signed char x, signed char y) +{ + return x % y; +} + +mod4 (signed short x, signed short y) +{ + return x % y; +} + +signed long +mod5 (signed long x, signed long y) +{ + return x % y; +} + +unsigned long +mod6 (unsigned long x, unsigned long y) +{ + return x % y; +} + +void +testTortureExecute (void) +{ + if (div1 (-(1 << 7)) != 1 << 7) + ASSERT (0); + if (div2 (-(1 << 15)) != 1 << 15) + ASSERT (0); + if (div3 (-(1 << 7), -1) != 1 << 7) + ASSERT (0); + if (div4 (-(1 << 15), -1) != 1 << 15) + ASSERT (0); + if (mod1 (-(1 << 7)) != 0) + ASSERT (0); + if (mod2 (-(1 << 15)) != 0) + ASSERT (0); + if (mod3 (-(1 << 7), -1) != 0) + ASSERT (0); + if (mod4 (-(1 << 15), -1) != 0) + ASSERT (0); + if (mod5 (0x50000000, 2) != 0) + ASSERT (0); + if (mod6 (0x50000000, 2) != 0) + ASSERT (0); + + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-doloop-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-doloop-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-doloop-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-doloop-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,25 @@ +/* + doloop-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +volatile unsigned int i; + +void +testTortureExecute (void) +{ + unsigned char z = 0; + + do ++i; + while (--z > 0); + if (i != UCHAR_MAX + 1U) + ASSERT (0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-doloop-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-doloop-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-doloop-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-doloop-2.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,26 @@ +/* + doloop-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +volatile unsigned int i; + +void +testTortureExecute (void) +{ + unsigned short z = 0; + + do ++i; + while (--z > 0); + if (i != USHRT_MAX + 1U) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-enum-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-enum-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-enum-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-enum-2.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,32 @@ +/* + enum-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Copyright (C) 2000 Free Software Foundation */ +/* by Alexandre Oliva */ + +enum foo { FOO, BAR }; + +/* Even though the underlying type of an enum is unspecified, the type + of enumeration constants is explicitly defined as int (6.4.4.3/2 in + the C99 Standard). Therefore, `i' must not be promoted to + `unsigned' in the comparison below; we must exit the loop when it + becomes negative. */ + +void +testTortureExecute (void) +{ + int i; + for (i = BAR; i >= FOO; --i) + if (i == -1) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-enum-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-enum-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-enum-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-enum-3.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,33 @@ +/* + enum-3.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* The composite type of int and an enum compatible with int might be + either of the two types, but it isn't an unsigned type. */ +/* Origin: Joseph Myers */ + +#include + +#include + +enum e { a = INT_MIN }; + +int *p; +enum e *q; + +void +testTortureExecute (void) +{ + enum e x = a; + q = &x; + if (*(1 ? q : p) > 0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-func-ptr-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-func-ptr-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-func-ptr-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-func-ptr-1.c 2012-05-18 16:39:12.000000000 +0000 @@ -0,0 +1,30 @@ +/* + func-ptr-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 // Using float for double. +#endif + +static double f (float a); +static double (*fp) (float a); + +void +testTortureExecute (void) +{ +#if !defined(__SDCC_hc08) && !defined(__SDCC_s08) + fp = f; + if (fp ((float) 1) != 1.0) + ASSERT (0); + return; +#endif +} + +static double +f (float a) +{ + return a; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-ifcvt-onecmpl-abs-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-ifcvt-onecmpl-abs-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-ifcvt-onecmpl-abs-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-ifcvt-onecmpl-abs-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,27 @@ +/* + ifcvt-onecmpl-abs-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int foo(int n) +{ + if (n < 0) + n = ~n; + + return n; +} + +void +testTortureExecute (void) +{ + if (foo (-1) != 0) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-int-compare.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-int-compare.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-int-compare.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-int-compare.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,120 @@ +/* + int-compare.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c89 +#endif + +#include + +int gt (int a, int b) +{ + return a > b; +} + +int ge (int a, int b) +{ + return a >= b; +} + +int lt (int a, int b) +{ + return a < b; +} + +int le (int a, int b) +{ + return a <= b; +} + +void +true (int c) +{ + if (!c) + ASSERT (0); +} + +void +false (int c) +{ + if (c) + ASSERT (0); +} + +void f (void) +{ + true (gt (2, 1)); + false (gt (1, 2)); + + true (gt (INT_MAX, 0)); + false (gt (0, INT_MAX)); + true (gt (INT_MAX, 1)); + false (gt (1, INT_MAX)); + + false (gt (INT_MIN, 0)); + true (gt (0, INT_MIN)); + false (gt (INT_MIN, 1)); + true (gt (1, INT_MIN)); + + true (gt (INT_MAX, INT_MIN)); + false (gt (INT_MIN, INT_MAX)); + + true (ge (2, 1)); + false (ge (1, 2)); + + true (ge (INT_MAX, 0)); + false (ge (0, INT_MAX)); + true (ge (INT_MAX, 1)); + false (ge (1, INT_MAX)); + + false (ge (INT_MIN, 0)); + true (ge (0, INT_MIN)); + false (ge (INT_MIN, 1)); + true (ge (1, INT_MIN)); + + true (ge (INT_MAX, INT_MIN)); + false (ge (INT_MIN, INT_MAX)); + + false (lt (2, 1)); + true (lt (1, 2)); + + false (lt (INT_MAX, 0)); + true (lt (0, INT_MAX)); + false (lt (INT_MAX, 1)); + true (lt (1, INT_MAX)); + + true (lt (INT_MIN, 0)); + false (lt (0, INT_MIN)); + true (lt (INT_MIN, 1)); + false (lt (1, INT_MIN)); + + false (lt (INT_MAX, INT_MIN)); + true (lt (INT_MIN, INT_MAX)); + + false (le (2, 1)); + true (le (1, 2)); + + false (le (INT_MAX, 0)); + true (le (0, INT_MAX)); + false (le (INT_MAX, 1)); + true (le (1, INT_MAX)); + + true (le (INT_MIN, 0)); + false (le (0, INT_MIN)); + true (le (INT_MIN, 1)); + false (le (1, INT_MIN)); + + false (le (INT_MAX, INT_MIN)); + true (le (INT_MIN, INT_MAX)); +} + +void +testTortureExecute (void) +{ + f (); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,29 @@ +/* + loop-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ + int i, j, k[3]; + + j = 0; + for (i=0; i < 3; i++) + { + k[i] = j++; + } + + for (i=2; i >= 0; i--) + { + if (k[i] != i) + ASSERT (0); + } + + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-10.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-10.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-10.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-10.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,41 @@ +/* + loop-10.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Reduced from PR optimization/5076, PR optimization/2847 */ + +static int count = 0; + +static void +inc (void) +{ + count++; +} + +void +testTortureExecute (void) +{ + int iNbr = 1; + int test = 0; + while (test == 0) + { + inc (); + if (iNbr == 0) + break; + else + { + inc (); + iNbr--; + } + test = 1; + } + if (count != 2) + ASSERT (0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-11.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-11.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-11.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-11.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,34 @@ +/* + loop-11.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#ifndef __SDCC_mcs51 +static int a[199]; + +static void +foo () +{ + int i; + for (i = 198; i >= 0; i--) + a[i] = i; +} +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + int i; + foo (); + for (i = 0; i < 199; i++) + if (a[i] != i) + ASSERT (0); +#endif + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-12.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-12.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-12.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-12.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,37 @@ +/* + loop-12.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + + +/* Checks that pure functions are not treated as const. */ + +const char *p; + +static int +is_end_of_statement (void) +{ + return *p == '\n' || *p == ';' || *p == '!'; +} + +void foo (void) +{ + /* The is_end_of_statement call was moved out of the loop at one stage, + resulting in an endless loop. */ + while (!is_end_of_statement ()) + p++; +} + +void +testTortureExecute (void) +{ + p = "abc\n"; + foo (); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-13.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-13.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-13.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-13.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,46 @@ +/* + loop-13.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR opt/7130 */ +#define TYPE long + +void +scale (TYPE *alpha, TYPE *x, int n) +{ + int i, ix; + + if (*alpha != 1) + for (i = 0, ix = 0; i < n; i++, ix += 2) + { + TYPE tmpr, tmpi; + tmpr = *alpha * x[ix]; + tmpi = *alpha * x[ix + 1]; + x[ix] = tmpr; + x[ix + 1] = tmpi; + } +} + +void +testTortureExecute (void) +{ + int i; + TYPE x[10]; + TYPE alpha = 2; + + for (i = 0; i < 10; i++) + x[i] = i; + + scale (&alpha, x, 5); + + if (x[9] != 18) + ASSERT (0); + + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-14.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-14.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-14.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-14.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,30 @@ +/* + loop-14.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int a3[3]; + +void f(int *a) +{ + int i; + + for (i=3; --i;) + a[i] = 42 / i; +} + +void +testTortureExecute (void) +{ + f(a3); + + if (a3[1] != 42 || a3[2] != 21) + ASSERT (0); + + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-15.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-15.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-15.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-15.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,50 @@ +/* + loop-15.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Bombed with a segfault on powerpc-linux. doloop.c generated wrong + loop count. */ +void +foo (unsigned long *start, unsigned long *end) +{ + unsigned long *temp = end - 1; + + while (end > start) + *end-- = *temp--; +} + +void +testTortureExecute (void) +{ + unsigned long a[5]; + int start, end, k; + + for (start = 0; start < 5; start++) + for (end = 0; end < 5; end++) + { + for (k = 0; k < 5; k++) + a[k] = k; + + foo (a + start, a + end); + + for (k = 0; k <= start; k++) + if (a[k] != k) + ASSERT (0); + + for (k = start + 1; k <= end; k++) + if (a[k] != k - 1) + ASSERT (0); + + for (k = end + 1; k < 5; k++) + if (a[k] != k) + ASSERT (0); + } + + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-2.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,28 @@ +/* + loop-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int a[2]; + +void f (int b) +{ + unsigned int i; + for (i = 0; i < b; i++) + a[i] = i - 2; +} + +void +testTortureExecute (void) +{ + a[0] = a[1] = 0; + f (2); + if (a[0] != -2 || a[1] != -1) + ASSERT (0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-2c.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-2c.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-2c.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-2c.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,34 @@ +/* + loop-2c.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int a[2]; + +inline void f (int b, int o) +{ + unsigned int i; + int *p; + for (p = &a[b], i = b; --i < ~0; ) + *--p = i * 3 + o; +} + +void g(int b) +{ + f (b, (int)a); +} + +void +testTortureExecute (void) +{ + a[0] = a[1] = 0; + g (2); + if (a[0] != (int)a || a[1] != (int)a + 3) + ASSERT (0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-2d.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-2d.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-2d.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-2d.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,29 @@ +/* + loop-2d.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int a[2]; + +void f (int b) +{ + unsigned int i; + int *p; + for (p = &a[b], i = b; --i < ~0; ) + *--p = i * 3 + (int)a; +} + +void +testTortureExecute (void) +{ + a[0] = a[1] = 0; + f (2); + if (a[0] != (int)a || a[1] != (int)a + 3) + ASSERT (0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-3.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,40 @@ +/* + loop-3.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +#include + +int n = 0; + +void g (int i) +{ + n++; +} + +void f (int m) +{ + int i; + i = m; + do + { + g (i * INT_MAX / 2); + } + while (--i > 0); +} + +void +testTortureExecute (void) +{ + f (4); + if (n != 4) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-3b.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-3b.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-3b.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-3b.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,40 @@ +/* + loop-3b.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +#include + +int n = 0; + +void g (int i) +{ + n++; +} + +void f (int m) +{ + int i; + i = m; + do + { + g (i * 4); + i -= INT_MAX / 8; + } + while (i > 0); +} + +void +testTortureExecute (void) +{ + f (INT_MAX/8*4); + if (n != 4) + ASSERT (0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-3c.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-3c.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-3c.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-3c.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,47 @@ +/* + loop-4c.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +#ifndef __SDCC_mcs51 +void * a[255]; + +void f (int m) +{ + int i; + int sh = 0x100; + i = m; + do + { + a[sh >>= 1] = ((unsigned)i << 3) + (char*)a; + i += 4; + } + while (i < INT_MAX/2 + 1 + 4 * 4); +} +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + a[0x10] = 0; + a[0x08] = 0; + f (INT_MAX/2 + INT_MAX/4 + 2); + if (a[0x10] || a[0x08]) + ASSERT (0); + a[0x10] = 0; + a[0x08] = 0; + f (INT_MAX/2 + 1); + if (! a[0x10] || a[0x08]) + ASSERT (0); +#endif + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-5.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-5.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-5.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-5.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,52 @@ +/* + loop-5.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#if !defined(__SDCC_ds390) +static int ap(int i); +static void testit(void){ + int ir[4] = {0,1,2,3}; + int ix,n,m; + n=1; m=3; + for (ix=1;ix<=4;ix++) { + if (n == 1) m = 4; + else m = n-1; + ap(ir[n-1]); + n = m; + } +} + +static int t = 0; +static int a[4]; + +static int ap(int i){ + if (t > 3) + ASSERT (0); + a[t++] = i; + return 1; +} +#endif + +void +testTortureExecute (void) +{ +#if !defined(__SDCC_ds390) + testit(); + if (a[0] != 0) + ASSERT (0); + if (a[1] != 3) + ASSERT (0); + if (a[2] != 2) + ASSERT (0); + if (a[3] != 1) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-6.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-6.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-6.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-6.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,26 @@ +/* + loop-6.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void +testTortureExecute (void) +{ + char c; + char d; + int nbits; + c = -1; + for (nbits = 1 ; nbits < 100; nbits++) { + d = (1 << nbits) - 1; + if (d == c) + break; + } + if (nbits == 100) + ASSERT (0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-7.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-7.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-7.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-7.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,30 @@ +/* + loop-7.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void foo (unsigned int n) +{ + int i, j = -1; + + for (i = 0; i < 10 && j < 0; i++) + { + if ((1UL << i) == n) + j = i; + } + + if (j < 0) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + foo (64); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-8.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-8.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-8.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-8.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,36 @@ +/* + loop-8.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#pragma disable_warning 93 // Using float for double. + +double a[3] = { 0.0, 1.0, 2.0 }; + +void bar (int x, double *y) +{ + if (x || *y != 1.0) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + double c; + int d; + for (d = 0; d < 3; d++) + { + c = a[d]; + if (c > 0.0) goto e; + } + bar(1, &c); + return; +e: + bar(0, &c); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-9.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-9.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-loop-9.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-loop-9.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,30 @@ +/* + loop-9.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c89 +#endif + +/* Source: Neil Booth, from PR # 115. */ + +int false() +{ + return 0; +} + +void +testTortureExecute (void) +{ + int count = 0; + + while (false() || count < -123) + ++count; + + if (count) + ASSERT (0); + + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-mod-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-mod-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-mod-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-mod-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,23 @@ +/* + mod-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c89 +#endif + +int f (int x, int y) +{ + if (x % y != 0) + ASSERT(0); +} + +void +testTortureExecute (void) +{ + f (-5, 5); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pending-4.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pending-4.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pending-4.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pending-4.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,40 @@ +/* + pending-4.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c89 +#endif + +#pragma disable_warning 85 + +void dummy (int *x, int y) +{} + +void +testTortureExecute (void) +{ + int number_columns=9; + int cnt0 = 0; + int cnt1 = 0; + int i,A1; + + for (i = number_columns-1; i != 0; i--) + { + if (i == 1) + { + dummy(&A1, i); + cnt0++; + } + else + { + dummy(&A1, i-1); + cnt1++; + } + } + if (cnt0 != 1 || cnt1 != 7) + ASSERT(0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-postmod-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-postmod-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-postmod-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-postmod-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,77 @@ +/* + postmod-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c89 +#endif + +#ifndef __SDCC_mcs51 + +#define DECLARE_ARRAY(A) array##A[0x10] +#define DECLARE_COUNTER(A) counter##A = 0 +#define DECLARE_POINTER(A) *pointer##A = array##A + x +/* Create a loop that allows post-modification of pointerA, followed by + a use of the post-modified address. */ +#define BEFORE(A) counter##A += *pointer##A, pointer##A += 3 +#define AFTER(A) counter##A += pointer##A[x] + +/* Set up the arrays so that one iteration of the loop sets the counter + to 3.0f. */ +#define INIT_ARRAY(A) array##A[1] = 1.0f, array##A[5] = 2.0f + +/* Check that the loop worked correctly for all values. */ +#define CHECK_ARRAY(A) exit_code |= (counter##A != 3.0f) + +/* Having 6 copies triggered the bug for ARM and Thumb. */ +#define MANY(A) A (0), A (1), A (2), A (3), A (4), A (5) + +/* Each addendA should be allocated a register. */ +#define INIT_VOLATILE(A) addend##A = vol +#define ADD_VOLATILE(A) vol += addend##A + +/* Having 5 copies triggered the bug for ARM and Thumb. */ +#define MANY2(A) A (0), A (1), A (2), A (3), A (4) + +float MANY (DECLARE_ARRAY); +float MANY (DECLARE_COUNTER); + +volatile int stop = 1; +volatile int vol; + +foo (int x) +{ + float MANY (DECLARE_POINTER); + int i; + + do + { + MANY (BEFORE); + MANY (AFTER); + /* Create an inner loop that should ensure the code above + has registers free for reload inheritance. */ + { + int MANY2 (INIT_VOLATILE); + for (i = 0; i < 10; i++) + MANY2 (ADD_VOLATILE); + } + } + while (!stop); +} +#endif + +void +testTortureExecute (void) +{ + int exit_code = 0; +#ifndef __SDCC_mcs51 + MANY (INIT_ARRAY); + foo (1); + MANY (CHECK_ARRAY); +#endif + ASSERT (!exit_code); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr15262-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr15262-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr15262-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr15262-2.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,53 @@ +/* + pr15262-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* TODO: Enable this once we can pass structures as function arguments! */ +#if 0 +/* PR 15262. Similar to pr15262-1.c but with no obvious addresses + being taken in function foo(). Without IPA, by only looking inside + foo() we cannot tell for certain whether 'q' and 'b' alias each + other. */ +struct A +{ + int t; + int i; +}; + +struct B +{ + int *p; + float b; +}; + +float X; + +foo (struct B b, struct A *q, float *h) +{ + X += *h; + *(b.p) = 3; + q->t = 2; + return *(b.p); +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + struct A a; + struct B b; + + b.p = &a.t; + if (foo (b, &a, &X) == 3) + ASSERT (0); + + return; +#endif +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr15262.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr15262.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr15262.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr15262.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,59 @@ +/* + pr15262.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* We used to mis-compile this testcase as we did not know that + &a+offsetof(b,a) was the same as &a.b */ +struct A +{ + int t; + int i; +}; + +void +bar (float *p) +{ + *p = 5.2; +} + +int +foo(struct A *locp, int i, int str) +{ + float f, g, *p; + int T355; + int *T356; + /* Currently, the alias analyzer has limited support for handling + aliases of structure fields when no other variables are aliased. + Introduce additional aliases to confuse it. */ + p = i ? &g : &f; + bar (p); + if (*p > 0.0) + str = 1; + + T355 = locp->i; + T356 = &locp->i; + *T356 = str; + T355 = locp->i; + + return T355; +} + +void +testTortureExecute (void) +{ + struct A loc; + int str; + + loc.i = 2; + str = foo (&loc, 10, 3); + if (str!=1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr15296.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr15296.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr15296.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr15296.c 2012-03-09 20:31:16.000000000 +0000 @@ -0,0 +1,90 @@ +/* + pr15296.c from the execute part of the gcc torture tests. + */ + +#include +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +/* PR optimization/15296. The delayed-branch scheduler caused code that + SEGV:d for CRIS; a register was set to -1 in a delay-slot for the + fall-through code, while that register held a pointer used in code at + the branch target. */ + +/* Assume that if stdint.h defined INTPTR_MAX, it has also defined intptr_t */ +/* oƒ otherwise, define it ourselves */ +#ifndef INTPTR_MAX +typedef int intptr_t; +#endif + +typedef intptr_t W; +union u0 +{ + union u0 *r; + W i; +}; +struct s1 +{ + union u0 **m0; + union u0 m1[4]; +}; + +void f (void *, struct s1 *, const union u0 *, W, W, W); +void g (void *, char *); + +void +f (void *a, struct s1 *b, const union u0 *h, W v0, W v1, W v4) +{ + union u0 *e = 0; + union u0 *k = 0; + union u0 **v5 = b->m0; + union u0 *c = b->m1; + union u0 **d = &v5[0]; +l0:; + if (v0 < v1) + goto l0; + if (v0 == 0) + goto l3; + v0 = v4; + if (v0 != 0) + goto l3; + c[0].r = *d; + v1 = -1; + e = c[0].r; + if (e != 0) + g (a, ""); + k = e + 3; + k->i = v1; + goto l4; +l3:; + c[0].i = v0; + e = c[1].r; + if (e != 0) + g (a, ""); + e = c[0].r; + if (e == 0) + g (a, ""); + k = e + 2; + k->r = c[1].r; +l4:; +} + +void g (void *a, char *b) { ASSERT(0); } + +void +testTortureExecute (void) +{ + union u0 uv[] = {{ .i = 111 }, { .i = 222 }, { .i = 333 }, { .i = 444 }}; + struct s1 s = { 0, {{ .i = 555 }, { .i = 0 }, { .i = 999 }, { .i = 777 }}}; + f (0, &s, 0, 20000, 10000, (W) uv); + if (s.m1[0].i != (W) uv || s.m1[1].i != 0 || s.m1[2].i != 999 + || s.m1[3].i != 777 || uv[0].i != 111 || uv[1].i != 222 + || uv[2].i != 0 || uv[3].i != 444) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr16790-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr16790-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr16790-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr16790-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,52 @@ +/* + pr16790-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR middle-end/16790. */ + +extern void abort (); + +static void test1(unsigned int u1) +{ + unsigned int y_final_1; + signed short y_middle; + unsigned int y_final_2; + + y_final_1 = (unsigned int)( (signed short)(u1 * 2) * 3 ); + y_middle = (signed short)(u1 * 2); + y_final_2 = (unsigned int)( y_middle * 3 ); + + if (y_final_1 != y_final_2) + ASSERT (0); +} + + +static void test2(unsigned int u1) +{ + unsigned int y_final_1; + signed short y_middle; + unsigned int y_final_2; + + y_final_1 = (unsigned int)( (signed short)(u1 << 1) * 3 ); + y_middle = (signed short)(u1 << 1); + y_final_2 = (unsigned int)( y_middle * 3 ); + + if (y_final_1 != y_final_2) + ASSERT (0); +} + + +void +testTortureExecute (void) +{ + test1(0x4000U); + test2(0x4000U); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr17078-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr17078-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr17078-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr17078-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,34 @@ +/* + pr17078-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void test(int *ptr) +{ + int i = 1; + goto useless; + if (0) + { + useless: + i = 0; + } + else + i = 1; + *ptr = i; +} + +void +testTortureExecute (void) +{ + int i = 1; + test(&i); + if (i) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr19005.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr19005.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr19005.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr19005.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,47 @@ +/* + pr19005.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR target/19005 */ + +int v, s; + +void +bar (int a, int b) +{ + unsigned char x = v; + + if (!s) + { + if (a != x || b != (unsigned char) (x + 1)) + ASSERT (0); + } + else if (a != (unsigned char) (x + 1) || b != x) + ASSERT (0); + s ^= 1; +} + +int +foo (int x) +{ + unsigned char a = x, b = x + 1; + + bar (a, b); + a ^= b; b ^= a; a ^= b; + bar (a, b); + return 0; +} + +void +testTortureExecute (void) +{ + for (v = -10; v < 266; v++) + foo (v); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr19606.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr19606.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr19606.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr19606.c 2012-04-01 11:33:10.000000000 +0000 @@ -0,0 +1,49 @@ +/* + pr19606.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Todo: Enable when sdcc supports long long modulo! +#if 0 + +/* PR c/19606 + The C front end used to shorten the type of a division to a type + that does not preserve the semantics of the original computation. + Make sure that won't happen. */ + +signed char a = -4; + +int +foo (void) +{ + return ((unsigned int) (signed int) a) / 2LL; +} + +int +bar (void) +{ + return ((unsigned int) (signed int) a) % 5LL; +} +#endif +void +testTortureExecute (void) +{ +#if 0 + int r; + + r = foo (); + if (r != ((unsigned int) (signed int) (signed char) -4) / 2LL) + ASSERT (0); + + r = bar (); + if (r != ((unsigned int) (signed int) (signed char) -4) % 5LL) + ASSERT (0); + + return; +#endif +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr20100-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr20100-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr20100-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr20100-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,86 @@ +/* + pr20100-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR tree-optimization/20100 + Pure function being treated as const. + Author: Hans-Peter Nilsson. */ + +static unsigned short g = 0; +static unsigned short p = 0; +unsigned char e; + +static unsigned short +next_g (void) +{ + return g == e - 1 ? 0 : g + 1; +} + +static unsigned short +curr_p (void) +{ + return p; +} + +static unsigned short +inc_g (void) +{ + return g = next_g (); +} + +static unsigned short +curr_g (void) +{ + return g; +} + +static char +ring_empty (void) +{ + if (curr_p () == curr_g ()) + return 1; + else + return 0; +} + +char +frob (unsigned short a, unsigned short b) +{ + g = a; + p = b; + inc_g (); + return ring_empty (); +} + +unsigned short +get_n (void) +{ + unsigned short n = 0; + unsigned short org_g; + org_g = curr_g (); + while (!ring_empty () && n < 5) + { + inc_g (); + n++; + } + + return n; +} + +void +testTortureExecute (void) +{ + e = 3; + if (frob (0, 2) != 0 || g != 1 || p != 2 || e != 3 + || get_n () != 1 + || g != 2 || p != 2) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr20187-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr20187-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr20187-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr20187-1.c 2012-04-02 09:59:13.000000000 +0000 @@ -0,0 +1,31 @@ +/* + pr207187-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// Some ports do not support long long yet. +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) +int a = 0x101; +int b = 0x100; + +int +foo (void) +{ + return (((unsigned char) (unsigned long long) ((a ? a : 1) & (a * b))) + ? 0 : 1); +} +#endif + +void +testTortureExecute (void) +{ +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + ASSERT (!(1 - foo ())); +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr20466-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr20466-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr20466-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr20466-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,36 @@ +/* + pr20466-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int f (int **, int *, int *, int **, int **); +int +f (int **ipp, int *i1p, int *i2p, int **i3, int **i4) +{ + **ipp = *i1p; + *ipp = i2p; + *i3 = *i4; + **ipp = 99; + return 3; +} + +void +testTortureExecute (void) +{ + int i = 42, i1 = 66, i2 = 1, i3 = -1, i4 = 55; + int *ip = &i; + int *i3p = &i3; + int *i4p = &i4; +#if 0 + f (&ip, &i1, &i2, &i3p, &i4p); + if (i != 66 || ip != &i2 || i2 != 99 || i3 != -1 || i3p != i4p || i4 != 55) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr20527-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr20527-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr20527-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr20527-1.c 2012-02-26 09:13:46.000000000 +0000 @@ -0,0 +1,93 @@ +/* + pr20527-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR rtl-optimization/20527 + Mishandled postincrement. This test-case is derived from the + function BZ2_hbCreateDecodeTables in the file huffman.c from + bzip2-1.0.2, hence requiring the following disclaimer copied here: */ + +/*-- + This file is a part of bzip2 and/or libbzip2, a program and + library for lossless, block-sorting data compression. + + Copyright (C) 1996-2002 Julian R Seward. 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. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + + 3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + + Julian Seward, Cambridge, UK. + jseward@acm.org + bzip2/libbzip2 version 1.0 of 21 March 2000 + + This program is based on (at least) the work of: + Mike Burrows + David Wheeler + Peter Fenwick + Alistair Moffat + Radford Neal + Ian H. Witten + Robert Sedgewick + Jon L. Bentley + + For more information on these sources, see the manual. +--*/ + +void f (long *limit, long *base, long minLen, long maxLen); +void f (long *limit, long *base, long minLen, long maxLen) +{ + long i; + long vec; + vec = 0; + for (i = minLen; i <= maxLen; i++) { + vec += (base[i+1] - base[i]); + limit[i] = vec-1; + } +} + +long b[] = {1, 5, 11, 23}; + +void +testTortureExecute (void) +{ + long l[3]; + f (l, b, 0, 2); + if (l[0] != 3 || l[1] != 9 || l[2] != 21) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr20601-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr20601-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr20601-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr20601-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,138 @@ +/* + pr15262.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c11 +#pragma disable_warning 85 +#endif + +/* PR tree-optimization/20601 */ +/*extern void abort (void); +extern void exit (int);*/ + +struct T +{ + const char *t1; + char t2[4096]; + char **t3; +}; + +#if defined (__SDCC) && !defined (__SDCC_mcs51) +int a[5]; +int b; +const char **c; +int d; +const char **e; +struct T t; +char *f[16]; +const char *g[] = { "a", "-u", "b", "c" }; + +_Noreturn void +foo (void) +{ + while (1); +} + +char * +bar (char *x, unsigned int y) +{ + return 0; +} + +static inline char * +baz (char *x, unsigned int y) +{ + if (sizeof (t.t2) != (unsigned int) -1 && y > sizeof (t.t2)) + foo (); + return bar (x, y); +} + +static inline int +setup1 (int x) +{ + char *p; + int rval; + + if (!baz (t.t2, sizeof (t.t2))) + baz (t.t2, sizeof (t.t2)); + + if (x & 0x200) + { + char **h, **i = e; + + ++d; + e = f; + if (t.t1 && *t.t1) + e[0] = t.t1; + else + ASSERT (0); + + for (h = e + 1; (*h = *i); ++i, ++h) + ; + } + return 1; +} + +static inline int +setup2 (void) +{ + int j = 1; + + e = c + 1; + d = b - 1; + while (d > 0 && e[0][0] == '-') + { + if (e[0][1] != '\0' && e[0][2] != '\0') + ASSERT (0); + + switch (e[0][1]) + { + case 'u': + if (!e[1]) + ASSERT (0); + + t.t3 = &e[1]; + d--; + e++; + break; + case 'P': + j |= 0x1000; + break; + case '-': + d--; + e++; + if (j == 1) + j |= 0x600; + return j; + } + d--; + e++; + } + + if (d > 0 && !(j & 1)) + ASSERT (0); + + return j; +} +#endif + +void +testTortureExecute (void) +{ +#if defined (__SDCC) && !defined (__SDCC_mcs51) + int x; + c = g; + b = 4; + x = setup2 (); + t.t1 = "/bin/sh"; + setup1 (x); + /* PRE shouldn't transform x into the constant 0x601 here, it's not legal. */ + if ((x & 0x400) && !a[4]) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr21331.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr21331.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr21331.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr21331.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,27 @@ +/* + pr21331.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int bar (void) { return -1; } + +unsigned long +foo () +{ unsigned long retval; + retval = bar (); + if (retval == -1) return 0; + return 3; } + +void +testTortureExecute (void) +{ + if (foo () != 0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr22348.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr22348.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr22348.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr22348.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,26 @@ +/* + pr15262.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +void f(int i) +{ + if (i>4 + 3 * 16) + ASSERT(0); +} + +void +testTortureExecute (void) +{ + unsigned int buflen, i; + buflen = 4 + 3 * 16; + for (i = 4; i < buflen; i+= 3) + f(i); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr22630.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr22630.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr22630.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr22630.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,33 @@ +/* + pr15262.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int j; + +void bla (int *r) +{ + int *p, *q; + + p = q = r; + if (!p) + p = &j; + + if (p != q) + j = 1; +} + +void +testTortureExecute (void) +{ + bla (0); + if (!j) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr23604.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr23604.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr23604.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr23604.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,32 @@ +/* + pr23604.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int g(int i, int j) +{ + if (i>-1) + if (i<2) + { + if (i != j) + { + if (j != 0) + return 0; + } + } + return 1; +} + +void +testTortureExecute (void) +{ + if (!g(1, 0)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr23941.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr23941.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr23941.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr23941.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,25 @@ +/* + pr15262.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +#include + +extern void abort (void); +double d = FLT_MIN / 2.0; + +void +testTortureExecute (void) +{ + double x = FLT_MIN / 2.0; + if (x != d) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr24141.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr24141.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr24141.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr24141.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,44 @@ +/* + pr24141.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +// reduced testcase, compile with -O2. Also, with --disable-checking +// gcc produces wrong code. + +int i; + +void g (void) +{ + i = 1; +} + +void f (int a, int b) +{ + int c = 0; + if (a == 0) + c = 1; + if (c) + return; + if (c == 1) + c = 0; + if (b == 0) + c = 1; + if (c) + g (); +} + +void +testTortureExecute (void) +{ + f (1, 0); + if (i != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr24142.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr24142.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr24142.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr24142.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,29 @@ +/* + pr24142.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int f (int a, int b) +{ + if (a == 1) + a = 0; + if (b == 0) + a = 1; + if (a != 0) + return 0; + return 1; +} + +void +testTortureExecute (void) +{ + if (f (1, 1) != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr24716.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr24716.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr24716.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr24716.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,68 @@ +/* + pr24716.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR24716, scalar evolution returning the wrong result + for pdest. */ + +int Link[] = { -1 }; +int W[] = { 2 }; + +int f (int k, int p) +{ + int pdest, j, D1361; + j = 0; + pdest = 0; + for (;;) { + if (pdest > 2) + do + j--, pdest++; + while (j > 2); + + if (j == 1) + break; + + while (pdest > p) + if (j == p) + pdest++; + + do + { + D1361 = W[k]; + do + if (D1361 != 0) + pdest = 1, W[k] = D1361 = 0; + while (p < 1); + } while (k > 0); + + do + { + p = 0; + k = Link[k]; + while (p < j) + if (k != -1) + pdest++, p++; + } + while (k != -1); + j = 1; + } + + /* The correct return value should be pdest (1 in the call from main). + DOM3 is mistaken and propagates a 0 here. */ + return pdest; +} + +void +testTortureExecute (void) +{ + if (!f (0, 2)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr25737.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr25737.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr25737.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr25737.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,32 @@ +/* + pr25737.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct delay_block { + struct delay_block *succ; +}; + +static struct delay_block Timer_Queue; + +struct delay_block* time_enqueue (struct delay_block *d) +{ + struct delay_block *q = Timer_Queue.succ; + d->succ = (void *)0; + return Timer_Queue.succ; +} + +void +testTortureExecute (void) +{ + Timer_Queue.succ = &Timer_Queue; + if (time_enqueue (&Timer_Queue) != (void*)0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr27073.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr27073.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr27073.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr27073.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,38 @@ +/* + pr27073.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +void +foo (int *p, int d1, int d2, int d3, + short count, int s1, int s2, int s3, int s4, int s5) +{ + int n = count; + while (n--) + { + *p++ = s1; + *p++ = s2; + *p++ = s3; + *p++ = s4; + *p++ = s5; + } +} + +void +testTortureExecute (void) +{ + int x[10], i; + + foo (x, 0, 0, 0, 2, 100, 200, 300, 400, 500); + for (i = 0; i < 10; i++) + if (x[i] != (i % 5 + 1) * 100) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr27260.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr27260.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr27260.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr27260.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,43 @@ +/* + pr15262.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR middle-end/27260 */ + +#include + +char buf[65]; + +void +foo (int x) +{ + memset (buf, x != 2 ? 1 : 0, 64); +} + +void +testTortureExecute (void) +{ + int i; + buf[64] = 2; + for (i = 0; i < 64; i++) + if (buf[i] != 0) + ASSERT (0); + foo (0); + for (i = 0; i < 64; i++) + if (buf[i] != 1) + ASSERT (0); + foo (2); + for (i = 0; i < 64; i++) + if (buf[i] != 0) + ASSERT (0); + if (buf[64] != 2) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr27285.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr27285.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr27285.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr27285.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,57 @@ +/* + pr27285.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR tree-optimization/27285 */ + +extern void abort (void); + +struct S { unsigned char a, b, c, d[16]; }; + +void +foo (struct S *x, struct S *y) +{ + int a, b; + unsigned char c, *d, *e; + + b = x->b; + d = x->d; + e = y->d; + a = 0; + while (b) + { + if (b >= 8) + { + c = 0xff; + b -= 8; + } + else + { + c = 0xff << (8 - b); + b = 0; + } + + e[a] = d[a] & c; + a++; + } +} + +void +testTortureExecute (void) +{ + struct S x = { 0, 25, 0, { 0xaa, 0xbb, 0xcc, 0xdd }}; + struct S y = { 0, 0, 0, { 0 }}; + + foo (&x, &y); + if (x.d[0] != y.d[0] || x.d[1] != y.d[1] + || x.d[2] != y.d[2] || (x.d[3] & 0x80) != y.d[3]) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr27671-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr27671-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr27671-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr27671-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,32 @@ +/* + pr27671.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR rtl-optimization/27671. + The combiner used to simplify "a ^ b == a" to "a" via + simplify_relational_operation_1 in simplify-rtx.c. */ + +/*extern void abort (void) __attribute__ ((noreturn)); +extern void exit (int) __attribute__ ((noreturn));*/ + +static int +foo (int a, int b) +{ + int c = a ^ b; + if (c == a) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + foo (0, 1); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr28651.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr28651.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr28651.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr28651.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,30 @@ +/* + pr28651.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +int +foo (unsigned int u) +{ + return (int)(u + 4) < (int)u; +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5 && __GNUC_MINOR__ < 1)) + unsigned int u = INT_MAX; + + if (foo (u) == 0) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr28982a.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr28982a.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr28982a.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr28982a.c 2012-05-21 12:05:21.000000000 +0000 @@ -0,0 +1,80 @@ +/* + pr28982.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR rtl-optimization/28982. Function foo() does the equivalent of: + + float tmp_results[NVARS]; + for (int i = 0; i < NVARS; i++) + { + int inc = incs[i]; + float *ptr = ptrs[i], result = 0; + for (int j = 0; j < n; j++) + result += *ptr, ptr += inc; + tmp_results[i] = result; + } + memcpy (results, tmp_results, sizeof (results)); + + but without the outermost loop. The idea is to create high register + pressure and ensure that some INC and PTR variables are spilled. + + On ARM targets, sequences like "result += *ptr, ptr += inc" can + usually be implemented using (mem (post_modify ...)), and we do + indeed create such MEMs before reload for this testcase. However, + (post_modify ...) is not a valid address for coprocessor loads, so + for -mfloat-abi=softfp, reload reloads the POST_MODIFY into a base + register. GCC did not deal correctly with cases where the base and + index of the POST_MODIFY are themselves reloaded. */ +#define NITER 4 +#define NVARS 20 +#define MULTI(X) \ + X( 0), X( 1), X( 2), X( 3), X( 4), X( 5), X( 6), X( 7), X( 8), X( 9), \ + X(10), X(11), X(12), X(13), X(14), X(15), X(16), X(17), X(18), X(19) + +#define DECLAREI(INDEX) inc##INDEX = incs[INDEX] +#define DECLAREF(INDEX) *ptr##INDEX = ptrs[INDEX], result##INDEX = 0 +#define LOOP(INDEX) result##INDEX += *ptr##INDEX, ptr##INDEX += inc##INDEX +#define COPYOUT(INDEX) results[INDEX] = result##INDEX + +#ifndef __SDCC_mcs51 +float *ptrs[NVARS]; +float results[NVARS]; +int incs[NVARS]; + +void +foo (int n) +{ + int MULTI (DECLAREI); + float MULTI (DECLAREF); + while (n--) + MULTI (LOOP); + MULTI (COPYOUT); +} + +float input[NITER * NVARS]; +#endif + +void +testTortureExecute (void) +{ +#if !defined(__SDCC_mcs51) && !defined(__SDCC_r2k) && !defined(__SDCC_r3ka) + int i; + + for (i = 0; i < NVARS; i++) + ptrs[i] = input + i, incs[i] = i; + for (i = 0; i < NITER * NVARS; i++) + input[i] = i; + foo (NITER); + for (i = 0; i < NVARS; i++) + if (results[i] != i * NITER * (NITER + 1) / 2) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr29156.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr29156.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr29156.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr29156.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,42 @@ +/* + pr29156.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct test1 +{ + int a; + int b; +}; +struct test2 +{ + float d; + struct test1 sub; +}; + +int global; + +int bla(struct test1 *xa, struct test2 *xb) +{ + global = 1; + xb->sub.a = 1; + xa->a = 8; + return xb->sub.a; +} + +void +testTortureExecute (void) +{ + struct test2 pom; + + if (bla (&pom.sub, &pom) != 8) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr31136.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr31136.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr31136.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr31136.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,26 @@ +/* + pr15262.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct S { + unsigned b4:4; + unsigned b6:6; +} s; + +void +testTortureExecute (void) +{ + s.b6 = 31; + s.b4 = s.b6; + s.b6 = s.b4; + if (s.b6 != 15) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr31169.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr31169.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr31169.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr31169.c 2012-06-15 15:43:51.000000000 +0000 @@ -0,0 +1,65 @@ +/* + pr31169.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#define HOST_WIDE_INT long +#define HOST_BITS_PER_WIDE_INT (sizeof(long)*8) + +#ifndef __SDCC_pic16 // TODO: enable when the pic16 ports supports bitfields of size greater than 8 bits! +struct tree_type +{ + unsigned int precision : 9; +}; + +int +sign_bit_p (struct tree_type *t, HOST_WIDE_INT val_hi, unsigned HOST_WIDE_INT val_lo) +{ + unsigned HOST_WIDE_INT mask_lo, lo; + HOST_WIDE_INT mask_hi, hi; + int width = t->precision; + + if (width > HOST_BITS_PER_WIDE_INT) + { + hi = (unsigned HOST_WIDE_INT) 1 << (width - HOST_BITS_PER_WIDE_INT - 1); + lo = 0; + + mask_hi = ((unsigned HOST_WIDE_INT) -1 + >> (2 * HOST_BITS_PER_WIDE_INT - width)); + mask_lo = -1; + } + else + { + hi = 0; + lo = (unsigned HOST_WIDE_INT) 1 << (width - 1); + + mask_hi = 0; + mask_lo = ((unsigned HOST_WIDE_INT) -1 + >> (HOST_BITS_PER_WIDE_INT - width)); + } + + if ((val_hi & mask_hi) == hi + && (val_lo & mask_lo) == lo) + return 1; + + return 0; +} +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_pic16 // TODO: enable when the pic16 ports supports bitfields of size greater than 8 bits! + struct tree_type t; + t.precision = 1; + if (!sign_bit_p (&t, 0, -1)) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr33142.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr33142.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr33142.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr33142.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,28 @@ +/* + pr33142.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +int lisp_atan2(long dy, long dx) { + if (dx <= 0) + if (dy > 0) + return abs(dx) <= abs(dy); + return 0; +} + +void +testTortureExecute (void) +{ + volatile long dy = 63, dx = -77; + if (lisp_atan2(dy, dx)) + ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr33382.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr33382.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr33382.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr33382.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,31 @@ +/* + pr33382.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct Foo { + int i; + int j[]; +}; + +struct Foo x = { 1, { 2, 0, 2, 3 } }; + +int foo(void) +{ + x.j[0] = 1; + return x.j[1]; +} + +void +testTortureExecute (void) +{ + if (foo() != 0) + ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr33779-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr33779-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr33779-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr33779-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,27 @@ +/* + pr33779-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +int foo(int32_t i) +{ + if (((uint32_t)(i + 1)) * 4 == 0) + return 1; + return 0; +} + +void +testTortureExecute (void) +{ + if (foo(0x3fffffff) == 0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr33779-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr33779-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr33779-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr33779-2.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,25 @@ +/* + pr33779-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int foo(long int i) +{ + return ((int)((unsigned long)(i + 1) * 4)) / 4; +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5 && __GNUC_MINOR__ < 4)) + if (foo(0x3fffffff) != 0) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr33870-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr33870-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr33870-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr33870-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,110 @@ +/* + pr33870-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +#ifndef __SDCC_mcs51 +typedef struct PgHdr PgHdr; +typedef unsigned char u8; +struct PgHdr { +int y; +struct { + unsigned int pgno; + PgHdr *pNextHash, *pPrevHash; + PgHdr *pNextFree, *pPrevFree; + PgHdr *pNextAll; + u8 inJournal; + short int nRef; + PgHdr *pDirty, *pPrevDirty; + unsigned int notUsed; +} x; +}; +PgHdr **xx; +volatile int vx; +static inline PgHdr *merge_pagelist(PgHdr *pA, PgHdr *pB) +{ + PgHdr result; + PgHdr *pTail; + xx = &result.x.pDirty; + pTail = &result; + while( pA && pB ){ + if( pA->x.pgnox.pgno ){ + pTail->x.pDirty = pA; + pTail = pA; + pA = pA->x.pDirty; + }else{ + pTail->x.pDirty = pB; + pTail = pB; + pB = pB->x.pDirty; + } + vx = (*xx)->y; + } + if( pA ){ + pTail->x.pDirty = pA; + }else if( pB ){ + pTail->x.pDirty = pB; + }else{ + pTail->x.pDirty = 0; + } + return result.x.pDirty; +} + +PgHdr *sort_pagelist(PgHdr *pIn) +{ + PgHdr *a[25], *p; + int i; + memset (a, 0, sizeof (a)); + while( pIn ){ + p = pIn; + pIn = p->x.pDirty; + p->x.pDirty = 0; + for(i=0; i<25 -1; i++){ + if( a[i]==0 ){ + a[i] = p; + break; + }else{ + p = merge_pagelist(a[i], p); + a[i] = 0; + a[i] = 0; + } + } + if( i==25 -1 ){ + a[i] = merge_pagelist(a[i], p); + } + } + p = a[0]; + for(i=1; i<25; i++){ + p = merge_pagelist (p, a[i]); + } + return p; +} +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + PgHdr a[5]; + PgHdr *p; + a[0].x.pgno = 5; + a[0].x.pDirty = &a[1]; + a[1].x.pgno = 4; + a[1].x.pDirty = &a[2]; + a[2].x.pgno = 1; + a[2].x.pDirty = &a[3]; + a[3].x.pgno = 3; + a[3].x.pDirty = 0; + p = sort_pagelist (&a[0]); + if (p->x.pDirty == p) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr33870.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr33870.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr33870.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr33870.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,104 @@ +/* + pr33870.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#ifndef __SDCC_mcs51 + +#include + +typedef struct PgHdr PgHdr; +typedef unsigned char u8; +struct PgHdr { + unsigned int pgno; + PgHdr *pNextHash, *pPrevHash; + PgHdr *pNextFree, *pPrevFree; + PgHdr *pNextAll; + u8 inJournal; + short int nRef; + PgHdr *pDirty, *pPrevDirty; + unsigned int notUsed; +}; + +static inline PgHdr *merge_pagelist(PgHdr *pA, PgHdr *pB) +{ + PgHdr result; + PgHdr *pTail; + pTail = &result; + while( pA && pB ){ + if( pA->pgnopgno ){ + pTail->pDirty = pA; + pTail = pA; + pA = pA->pDirty; + }else{ + pTail->pDirty = pB; + pTail = pB; + pB = pB->pDirty; + } + } + if( pA ){ + pTail->pDirty = pA; + }else if( pB ){ + pTail->pDirty = pB; + }else{ + pTail->pDirty = 0; + } + return result.pDirty; +} + +PgHdr *sort_pagelist(PgHdr *pIn) +{ + PgHdr *a[25], *p; + int i; + memset (a, 0, sizeof (a)); + while( pIn ){ + p = pIn; + pIn = p->pDirty; + p->pDirty = 0; + for(i=0; i<25 -1; i++){ + if( a[i]==0 ){ + a[i] = p; + break; + }else{ + p = merge_pagelist(a[i], p); + a[i] = 0; + } + } + if( i==25 -1 ){ + a[i] = merge_pagelist(a[i], p); + } + } + p = a[0]; + for(i=1; i<25; i++){ + p = merge_pagelist (p, a[i]); + } + return p; +} +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + PgHdr a[5]; + PgHdr *p; + a[0].pgno = 5; + a[0].pDirty = &a[1]; + a[1].pgno = 4; + a[1].pDirty = &a[2]; + a[2].pgno = 1; + a[2].pDirty = &a[3]; + a[3].pgno = 3; + a[3].pDirty = 0; + p = sort_pagelist (&a[0]); + if (p->pDirty == p) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr34070-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr34070-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr34070-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr34070-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,25 @@ +/* + pr34070-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int f(unsigned int x) +{ + return ((int)x) % 4; +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5 && __GNUC_MINOR__ < 3)) + if (f(-1) != -1) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr34070-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr34070-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr34070-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr34070-2.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,25 @@ +/* + pr34070-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int f(unsigned int x, int n) +{ + return ((int)x) / (1 << n); +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5 && __GNUC_MINOR__ < 3)) + if (f(-1, 1) != 0) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr34176.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr34176.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr34176.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr34176.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,80 @@ +/* + pr34176.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +#include + +typedef unsigned int index_ty; +typedef index_ty *index_list_ty; + +struct mult_index +{ + index_ty index; + unsigned int count; +}; + +struct mult_index_list +{ + struct mult_index *item; + size_t nitems; + size_t nitems_max; + + struct mult_index *item2; + size_t nitems2_max; +}; + +int +hash_find_entry (size_t *result) +{ + *result = 2; + return 0; +} + +extern void abort (void); +struct mult_index * +foo (size_t n) +{ + static count = 0; + if (count++ > 0) + ASSERT (0); + return 0; +} + +void +testTortureExecute (void) +{ + size_t nitems = 0; + + for (;;) + { + size_t list; + + hash_find_entry (&list); + { + size_t len2 = list; + struct mult_index *destptr; + struct mult_index *dest; + size_t new_max = nitems + len2; + + if (new_max != len2) + break; + dest = foo (new_max); + + destptr = dest; + while (len2--) + destptr++; + + nitems = destptr - dest; + } + } + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr34415.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr34415.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr34415.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr34415.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,45 @@ +/* + pr34415.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 84 +#endif + +const char * +foo (const char *p) +{ + const char *end; + int len = 1; + for (;;) + { + int c = *p; + c = (c >= 'a' && c <= 'z' ? c - 'a' + 'A' : c); + if (c == 'B') + end = p; + else if (c == 'A') + { + end = p; + do + p++; + while (*p == '+'); + } + else + break; + p++; + len++; + } + if (len > 2 && *p == ':') + p = end; + return p; +} + +void +testTortureExecute (void) +{ + const char *input = "Bbb:"; + ASSERT (!(foo (input) != input + 2)); +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr34456.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr34456.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr34456.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr34456.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,44 @@ +/* + pr34456.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +int debug (void) { return 1; } +int errors; + +struct s { int elt; int (*compare) (int); }; + +static int +compare (const void *x, const void *y) +{ + const struct s *s1 = x, *s2 = y; + int (*compare1) (int); + int elt2; + + compare1 = s1->compare; + elt2 = s2->elt; + if (elt2 != 0 && debug () && compare1 (s1->elt) != 0) + errors++; + return compare1 (elt2); +} + +int bad_compare (int x) { return -x; } +struct s array[2] = { { 1, bad_compare }, { -1, bad_compare } }; + +void +testTortureExecute (void) +{ +#if 0 +TODO: Enable when sdcc supports qsort. + qsort (array, 2, sizeof (struct s), compare); + ASSERT (!(errors == 0)); +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr35231.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr35231.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr35231.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr35231.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,25 @@ +/* + pr35231.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +foo(int bits_per_pixel, int depth) +{ + if ((bits_per_pixel | depth) == 1) + ASSERT (0); + return bits_per_pixel; +} + +void +testTortureExecute (void) +{ + if (foo(2, 0) != 2) + ASSERT (0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr35390.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr35390.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr35390.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr35390.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,22 @@ +/* + pr35390.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +unsigned int foo (int n) +{ + return ~((unsigned int)~n); +} + +void +testTortureExecute (void) +{ + if (foo(0) != 0) + ASSERT (0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr35800.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr35800.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr35800.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr35800.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,113 @@ +/* + pr35800.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 84 +#endif + +int stab_xcoff_builtin_type (int typenum) +{ + const char *name; + if (typenum >= 0 || typenum < -34) + { + return 0; + } + switch (-typenum) + { + case 1: + name = "int"; + break; + case 2: + name = "char"; + case 3: + name = "short"; + break; + case 4: + name = "long"; + case 5: + name = "unsigned char"; + case 6: + name = "signed char"; + case 7: + name = "unsigned short"; + case 8: + name = "unsigned int"; + case 9: + name = "unsigned"; + case 10: + name = "unsigned long"; + case 11: + name = "void"; + case 12: + name = "float"; + case 13: + name = "double"; + case 14: + name = "long double"; + case 15: + name = "integer"; + case 16: + name = "boolean"; + case 17: + name = "short real"; + case 18: + name = "real"; + case 19: + name = "stringptr"; + case 20: + name = "character"; + case 21: + name = "logical*1"; + case 22: + name = "logical*2"; + case 23: + name = "logical*4"; + case 24: + name = "logical"; + case 25: + name = "complex"; + case 26: + name = "double complex"; + case 27: + name = "integer*1"; + case 28: + name = "integer*2"; + case 29: + name = "integer*4"; + case 30: + name = "wchar"; + case 31: + name = "long long"; + case 32: + name = "unsigned long long"; + case 33: + name = "logical*8"; + case 34: + name = "integer*8"; + } + return name[0]; +} + +void +testTortureExecute (void) +{ + int i; + if (stab_xcoff_builtin_type(0) != 0) + ASSERT (0); + if (stab_xcoff_builtin_type(-1) != 'i') + ASSERT (0); + if (stab_xcoff_builtin_type(-2) != 's') + ASSERT (0); + if (stab_xcoff_builtin_type(-3) != 's') + ASSERT (0); + for (i = -4; i >= -34; --i) + if (stab_xcoff_builtin_type(i) != 'i') + ASSERT (0); + if (stab_xcoff_builtin_type(-35) != 0) + ASSERT (0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr36691.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr36691.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr36691.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr36691.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,29 @@ +/* + pr36691.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +unsigned char g_5; + +void func_1 (void) +{ + for (g_5 = 9; g_5 >= 4; g_5 -= 5) + ; +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5 && __GNUC_MINOR__ < 4)) + func_1 (); + if (g_5 != 0) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr37102.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr37102.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr37102.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr37102.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,34 @@ +/* + pr37102.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +unsigned int a, b = 1, c; + +void +foo (int x) +{ + if (x != 5) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + unsigned int d, e; + for (d = 1; d < 5; d++) + if (c) + a = b; + a = b; + e = a << 1; + if (e) + e = (e << 1) ^ 1; + foo (e); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr37125.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr37125.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr37125.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr37125.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,32 @@ +/* + pr37125.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +static inline unsigned int +mod_rhs(int rhs) +{ + if (rhs == 0) return 1; + return rhs; +} + +void func_44 (unsigned int p_45); +void func_44 (unsigned int p_45) +{ + if (!((p_45 * -9) % mod_rhs (-9))) { + ASSERT (0); + } +} + +void +testTortureExecute (void) +{ + func_44 (2); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr37882.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr37882.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr37882.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr37882.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,26 @@ +/* + pr37882.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR middle-end/37882 */ + +struct S +{ + unsigned char b : 3; +} s; + +void +testTortureExecute (void) +{ + s.b = 4; + if (s.b > 0 && s.b < 4) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr37924.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr37924.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr37924.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr37924.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,64 @@ +/* + pr37924.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR c/37924 */ + + +signed char a; +unsigned char b; + +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5 && __GNUC_MINOR__ < 4)) +int +ftest1 (void) +{ + int c = -1; + return ((unsigned int) (a ^ c)) >> 9; +} + +int +ftest2 (void) +{ + int c = -1; + return ((unsigned int) (b ^ c)) >> 9; +} +#endif + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5 && __GNUC_MINOR__ < 4)) + a = 0; + if (ftest1 () != (-1U >> 9)) + ASSERT (0); + a = 0x40; + if (ftest1 () != (-1U >> 9)) + ASSERT (0); + a = 0x80; + if (ftest1 () != (a < 0) ? 0 : (-1U >> 9)) + ASSERT (0); + a = 0xff; + if (ftest1 () != (a < 0) ? 0 : (-1U >> 9)) + ASSERT (0); + b = 0; + if (ftest2 () != (-1U >> 9)) + ASSERT (0); + b = 0x40; + if (ftest2 () != (-1U >> 9)) + ASSERT (0); + b = 0x80; + if (ftest2 () != (-1U >> 9)) + ASSERT (0); + b = 0xff; + if (ftest2 () != (-1U >> 9)) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr37931.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr37931.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr37931.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr37931.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,32 @@ +/* + pr37931.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR middle-end/37931 */ + + +int +foo (int a, unsigned int b) +{ + return (a | 1) & (b | 1); +} + +void +testTortureExecute (void) +{ + if (foo (6, 0xc6) != 7) + ASSERT (0); + if (foo (0x80, 0xc1) != 0x81) + ASSERT (0); + if (foo (4, 4) != 5) + ASSERT (0); + if (foo (5, 4) != 5) + ASSERT (0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr38048-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr38048-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr38048-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr38048-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,31 @@ +/* + pr38048-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int foo () +{ + int mat[2][1]; + int (*a)[1] = mat; + int det = 0; + int i; + mat[0][0] = 1; + mat[1][0] = 2; + for (i = 0; i < 2; ++i) + det += a[i][0]; + return det; +} + +void +testTortureExecute (void) +{ + if (foo () != 3) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr38212.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr38212.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr38212.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr38212.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,35 @@ +/* + pr38212.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +foo (int *restrict p, int i) +{ + int *restrict q; + int *restrict r; + int v, w; + q = p + 1; + r = q - i; + v = *r; + *p = 1; + w = *r; + return v + w; +} + +void +testTortureExecute (void) +{ +#if 0 + int i = 0; + if (foo (&i, 1) != 1) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr38236.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr38236.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr38236.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr38236.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,34 @@ +/* + pr15262.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct X { int i; }; + +int +foo (struct X *p, int *q, int a, int b) +{ + struct X x, y; + if (a) + p = &x; + if (b) + q = &x.i; + else + q = &y.i; + *q = 1; + return p->i; +} + +void +testTortureExecute (void) +{ + if (foo((void *)0, (void *)0, 1, 1) != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr38422.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr38422.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr38422.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr38422.c 2012-06-15 15:43:51.000000000 +0000 @@ -0,0 +1,38 @@ +/* + pr38411.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#ifndef __SDCC_pic16 // TODO: enable when the pic16 ports supports bitfields of size greater than 8 bits! +#include + +/* PR middle-end/38422 */ + +struct S +{ + int s : (sizeof (int) * CHAR_BIT - 2); +} s; + +void +foo (void) +{ + s.s *= 2; +} +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_pic16 + s.s = 24; + foo (); + if (s.s != 48) + ASSERT (0); + return; +#endif +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr39100.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr39100.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr39100.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr39100.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,76 @@ +/* + pr39100.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +/* Bad PTA results (incorrect store handling) was causing us to delete + *na = 0 store. */ + +typedef struct E +{ + int p; + struct E *n; +} *EP; + +typedef struct C +{ + EP x; + short cn, cp; +} *CP; + +CP +foo (CP h, EP x) +{ + EP pl = 0, *pa = &pl; + EP nl = 0, *na = &nl; + EP n; + + while (x) + { + n = x->n; + if ((x->p & 1) == 1) + { + h->cp++; + *pa = x; + pa = &((*pa)->n); + } + else + { + h->cn++; + *na = x; + na = &((*na)->n); + } + x = n; + } + *pa = nl; + *na = 0; + h->x = pl; + return h; +} + +void +testTortureExecute (void) +{ + struct C c = { 0, 0, 0 }; + struct E e[2] = { { 0, &e[1] }, { 1, 0 } }; + EP p; + + foo (&c, &e[0]); + if (c.cn != 1 || c.cp != 1) + ASSERT (0); + if (c.x != &e[1]) + ASSERT (0); + if (e[1].n != &e[0]) + ASSERT (0); + if (e[0].n) + ASSERT (0); + return; +} + + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr39120.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr39120.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr39120.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr39120.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,33 @@ +/* + pr39120.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#if 0 +SDCC urrently cannot return aggregates TODO: Enable later. +struct X { int *p; } x; + +struct X +foo(int *p) { struct X x; x.p = p; return x; } + +void +bar() { *x.p = 1; } +#endif + +void +testTortureExecute (void) +{ +#if 0 + int i = 0; + x = foo(&i); + bar(); + if (i != 1) + ASSERT (0); + return; +#endif +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr39233.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr39233.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr39233.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr39233.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,28 @@ +/* + pr39233.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 127 +#endif + +void +foo (void *p) +{ + long l = (long) p; + if (l < 0 || l > 6) + ASSERT (0); +} + +void +testTortureExecute (void) +{ + short i; + for (i = 6; i >= 0; i--) + foo ((void *) (long) i); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr39240.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr39240.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr39240.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr39240.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,102 @@ +/* + pr39240.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR target/39240 */ + +static int foo1 (int x) +{ + return x; +} + +unsigned int bar1 (int x) +{ + return foo1 (x + 6); +} + +volatile unsigned long l1 = (unsigned int) -4; + +static short int foo2 (int x) +{ + return x; +} + +unsigned short int bar2 (int x) +{ + return foo2 (x + 6); +} + +volatile unsigned long l2 = (unsigned short int) -4; + +static signed char foo3 (int x) +{ + return x; +} + +unsigned char bar3 (int x) +{ + return foo3 (x + 6); +} + +volatile unsigned long l3 = (unsigned char) -4; + +static unsigned int foo4 (int x) +{ + return x; +} + +int bar4 (int x) +{ + return foo4 (x + 6); +} + +volatile unsigned long l4 = (int) -4; + +static unsigned short int foo5 (int x) +{ + return x; +} + +short int bar5 (int x) +{ + return foo5 (x + 6); +} + +volatile unsigned long l5 = (short int) -4; + +static unsigned char foo6 (int x) +{ + return x; +} + +signed char bar6 (int x) +{ + return foo6 (x + 6); +} + +volatile unsigned long l6 = (signed char) -4; + +void +testTortureExecute (void) +{ + if (bar1 (-10) != l1) + ASSERT (0); + if (bar2 (-10) != l2) + ASSERT (0); + if (bar3 (-10) != l3) + ASSERT (0); + if (bar4 (-10) != l4) + ASSERT (0); + if (bar5 (-10) != l5) + ASSERT (0); + if (bar6 (-10) != l6) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr39339.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr39339.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr39339.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr39339.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,97 @@ +/* + pr39339.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +struct C +{ + unsigned int c; + struct D + { + unsigned int columns : 4; + unsigned int fore : 12; + unsigned int back : 6; + unsigned int fragment : 1; + unsigned int standout : 1; + unsigned int underline : 1; + unsigned int strikethrough : 1; + unsigned int reverse : 1; + unsigned int blink : 1; + unsigned int half : 1; + unsigned int bold : 1; + unsigned int invisible : 1; + unsigned int pad : 1; + } attr; +}; + +struct A +{ + struct C *data; + unsigned int len; +}; + +struct B +{ + struct A *cells; + unsigned char soft_wrapped : 1; +}; + +struct E +{ + long row, col; + struct C defaults; +}; + +void foo (struct E *screen, unsigned int c, int columns, struct B *row) +{ + struct D attr; + long col; + int i; + col = screen->col; + /*attr = screen->defaults.attr; struct assignment not yet supported by sdcc */ + memcpy (&attr, &(screen->defaults.attr), sizeof (struct D)); + attr.columns = columns; + row->cells->data[col].c = c; + /*row->cells->data[col].attr = attr; struct assignment not yet supported by sdcc */ + memcpy (&(row->cells->data[col].attr), &attr, sizeof (struct D)); + col++; + attr.fragment = 1; + for (i = 1; i < columns; i++) + { + row->cells->data[col].c = c; + /*row->cells->data[col].attr = attr; struct assignment not yet supported by sdcc */ + memcpy (&(row->cells->data[col].attr), &attr, sizeof (struct D)); + col++; + } +} + +void +testTortureExecute (void) +{ + struct E e = {.row = 5,.col = 0,.defaults = + {6, {-1, -1, -1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0}} }; + struct C c[4]; + struct A a = { c, 4 }; + struct B b = { &a, 1 }; + struct D d; + memset (&c, 0, sizeof c); + foo (&e, 65, 2, &b); + /*d = e.defaults.attr; struct assignment not yet supported by sdcc */ + memcpy (&d, &(e.defaults.attr), sizeof (struct D)); + d.columns = 2; + if (memcmp (&d, &c[0].attr, sizeof d)) + ASSERT (0); + d.fragment = 1; + if (memcmp (&d, &c[1].attr, sizeof d)) + ASSERT (0); + return; +} + + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr39501.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr39501.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr39501.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr39501.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,96 @@ +/* + pr39501.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +/* { dg-options "-ffast-math" } */ +#define min1(a,b) ((a) < (b) ? (a) : (b)) +#define max1(a,b) ((a) > (b) ? (a) : (b)) + +#define min2(a,b) ((a) <= (b) ? (a) : (b)) +#define max2(a,b) ((a) >= (b) ? (a) : (b)) + +#define F(type,n) \ + type type##_##n(type a, type b) \ + { \ + return n(a, b); \ + } + +F(float,min1) +F(float,min2) +F(float,max1) +F(float,max2) + +F(double,min1) +F(double,min2) +F(double,max1) +F(double,max2) + +void +testTortureExecute (void) +{ + if (float_min1(0.f, -1.f) != -1.f) ASSERT (0); + if (float_min1(-1.f, 0.f) != -1.f) ASSERT (0); + if (float_min1(0.f, 1.f) != 0.f) ASSERT (0); + if (float_min1(1.f, 0.f) != 0.f) ASSERT (0); + if (float_min1(-1.f, 1.f) != -1.f) ASSERT (0); + if (float_min1(1.f, -1.f) != -1.f) ASSERT (0); + + if (float_max1(0.f, -1.f) != 0.f) ASSERT (0); + if (float_max1(-1.f, 0.f) != 0.f) ASSERT (0); + if (float_max1(0.f, 1.f) != 1.f) ASSERT (0); + if (float_max1(1.f, 0.f) != 1.f) ASSERT (0); + if (float_max1(-1.f, 1.f) != 1.f) ASSERT (0); + if (float_max1(1.f, -1.f) != 1.f) ASSERT (0); + + if (float_min2(0.f, -1.f) != -1.f) ASSERT (0); + if (float_min2(-1.f, 0.f) != -1.f) ASSERT (0); + if (float_min2(0.f, 1.f) != 0.f) ASSERT (0); + if (float_min2(1.f, 0.f) != 0.f) ASSERT (0); + if (float_min2(-1.f, 1.f) != -1.f) ASSERT (0); + if (float_min2(1.f, -1.f) != -1.f) ASSERT (0); + + if (float_max2(0.f, -1.f) != 0.f) ASSERT (0); + if (float_max2(-1.f, 0.f) != 0.f) ASSERT (0); + if (float_max2(0.f, 1.f) != 1.f) ASSERT (0); + if (float_max2(1.f, 0.f) != 1.f) ASSERT (0); + if (float_max2(-1.f, 1.f) != 1.f) ASSERT (0); + if (float_max2(1.f, -1.f) != 1.f) ASSERT (0); + + if (double_min1(0., -1.) != -1.) ASSERT (0); + if (double_min1(-1., 0.) != -1.) ASSERT (0); + if (double_min1(0., 1.) != 0.) ASSERT (0); + if (double_min1(1., 0.) != 0.) ASSERT (0); + if (double_min1(-1., 1.) != -1.) ASSERT (0); + if (double_min1(1., -1.) != -1.) ASSERT (0); + + if (double_max1(0., -1.) != 0.) ASSERT (0); + if (double_max1(-1., 0.) != 0.) ASSERT (0); + if (double_max1(0., 1.) != 1.) ASSERT (0); + if (double_max1(1., 0.) != 1.) ASSERT (0); + if (double_max1(-1., 1.) != 1.) ASSERT (0); + if (double_max1(1., -1.) != 1.) ASSERT (0); + + if (double_min2(0., -1.) != -1.) ASSERT (0); + if (double_min2(-1., 0.) != -1.) ASSERT (0); + if (double_min2(0., 1.) != 0.) ASSERT (0); + if (double_min2(1., 0.) != 0.) ASSERT (0); + if (double_min2(-1., 1.) != -1.) ASSERT (0); + if (double_min2(1., -1.) != -1.) ASSERT (0); + + if (double_max2(0., -1.) != 0.) ASSERT (0); + if (double_max2(-1., 0.) != 0.) ASSERT (0); + if (double_max2(0., 1.) != 1.) ASSERT (0); + if (double_max2(1., 0.) != 1.) ASSERT (0); + if (double_max2(-1., 1.) != 1.) ASSERT (0); + if (double_max2(1., -1.) != 1.) ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr40057.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr40057.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr40057.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr40057.c 2012-03-30 11:52:34.000000000 +0000 @@ -0,0 +1,51 @@ +/* + pr40057.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#if 0 +TODO: Enable when long long support for constants is there! +/* PR middle-end/40057 */ + +int +foo (unsigned long long x) +{ + unsigned long long y = (x >> 31ULL) & 1ULL; + if (y == 0ULL) + return 0; + return -1; +} + +int +bar (long long x) +{ + long long y = (x >> 31LL) & 1LL; + if (y == 0LL) + return 0; + return -1; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + if (sizeof (long long) != 8) + return 0; + if (foo (0x1682a9aaaULL)) + ASSERT (0); + if (!foo (0x1882a9aaaULL)) + ASSERT (0); + if (bar (0x1682a9aaaLL)) + ASSERT (0); + if (!bar (0x1882a9aaaLL)) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr40747.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr40747.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr40747.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr40747.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,31 @@ +/* + pr40747.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR middle-end/40747 */ + +int +foo (int i) +{ + return (i < 4 && i >= 0) ? i : 4; +} + +void +testTortureExecute (void) +{ + if (foo (-1) != 4) ASSERT (0); + if (foo (0) != 0) ASSERT (0); + if (foo (1) != 1) ASSERT (0); + if (foo (2) != 2) ASSERT (0); + if (foo (3) != 3) ASSERT (0); + if (foo (4) != 4) ASSERT (0); + if (foo (5) != 4) ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr41317.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr41317.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr41317.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr41317.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,37 @@ +/* + pr41317.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct A +{ + int i; +}; +struct B +{ + struct A a; + int j; +}; + +static void +foo (struct B *p) +{ + ((struct A *)p)->i = 1; +} + +void +testTortureExecute (void) +{ + struct A a; + a.i = 0; + foo ((struct B *)&a); + if (a.i != 1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr41750.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr41750.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr41750.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr41750.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,78 @@ +/* + pr41750.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR 41750 - IPA-SRA used to pass hash->sgot by value rather than by + reference. */ + +struct bfd_link_hash_table +{ + int hash; +}; + +struct foo_link_hash_table +{ + struct bfd_link_hash_table root; + int *dynobj; + int *sgot; +}; + +struct foo_link_info +{ + struct foo_link_hash_table *hash; +}; + +extern void abort (void); + +int +foo_create_got_section (int *abfd, struct foo_link_info *info) +{ + info->hash->sgot = abfd; + return 1; +} + +static int * +get_got (int *abfd, struct foo_link_info *info, + struct foo_link_hash_table *hash) +{ + int *got; + int *dynobj; + + got = hash->sgot; + if (!got) + { + dynobj = hash->dynobj; + if (!dynobj) + hash->dynobj = dynobj = abfd; + if (!foo_create_got_section (dynobj, info)) + return 0; + got = hash->sgot; + } + return got; +} + +int * +elf64_ia64_check_relocs (int *abfd, struct foo_link_info *info) +{ + return get_got (abfd, info, info->hash); +} + +struct foo_link_info link_info; +struct foo_link_hash_table hash; +int abfd; + +void +testTortureExecute (void) +{ + link_info.hash = &hash; + if (elf64_ia64_check_relocs (&abfd, &link_info) != &abfd) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr42006.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr42006.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr42006.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr42006.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,43 @@ +/* + pr42006.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +static unsigned int +my_add(unsigned int si1, unsigned int si2) +{ + return (si1 > (50-si2)) ? si1 : (si1 + si2); +} + +static unsigned int +my_shift(unsigned int left, unsigned int right) +{ + return (right > 100) ? left : (left >> right); +} + +static int func_4(unsigned int p_6) +{ + int count = 0; + for (p_6 = 1; p_6 < 3; p_6 = my_add(p_6, 1)) + { + if (count++ > 1) + ASSERT (0); + + if (my_shift(p_6, p_6)) + return 0; + } + return 0; +} + +void +testTortureExecute (void) +{ + func_4(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr42142.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr42142.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr42142.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr42142.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,37 @@ +/* + pr42142.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +sort(int L) +{ + int end[2] = { 10, 10, }, i=0, R; + while (i<2) + { + R = end[i]; + if (L + +#ifdef __SDCC +#pragma std_c99 +#endif + +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) +/* Make sure that language + abi extensions in passing S interoperate. */ + +static long long +foo (unsigned short s) +{ + return (short) s; +} +#endif +unsigned short s = 0xFFFF; + +void +testTortureExecute (void) +{ +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + ASSERT (!(foo (s) + 1 != 0)); +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr42512.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr42512.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr42512.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr42512.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,23 @@ +/* + pr42512.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +short g_3; + +void +testTortureExecute (void) +{ + int l_2; + for (l_2 = -1; l_2 != 0; l_2 = (unsigned char)(l_2 - 1)) + g_3 |= l_2; + if (g_3 != -1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr42544.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr42544.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr42544.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr42544.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,28 @@ +/* + pr42544.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR c/42544 */ + +extern void abort (void); + +void +testTortureExecute (void) +{ +#if 0 +TODO: Enable once sdcc really support long long literals. + signed short s = -1; + if (sizeof (long long) == sizeof (unsigned int)) + return; + if ((unsigned int) s >= 0x100000000ULL) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr42833.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr42833.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr42833.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr42833.c 2012-02-24 12:57:34.000000000 +0000 @@ -0,0 +1,198 @@ +/* + pr42833.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include +#include +#include + +/* If SSIZE_MAX is defined in limits.h, then we are running in a POSIX */ +/* environment that already has a ssize_t definition (which may have been */ +/* included indirectly via string.h). In this case, use the guaranteed */ +/* definition in sys/types.h, otherwise assume int compatible and hope */ +/* for the best. */ +#ifdef SSIZE_MAX +#include +#else +typedef int ssize_t; +#endif + +typedef struct { int8_t v1; int8_t v2; int8_t v3; int8_t v4; } neon_s8; + +uint32_t helper_neon_rshl_s8 (uint32_t arg1, uint32_t arg2); + +uint32_t +helper_neon_rshl_s8 (uint32_t arg1, uint32_t arg2) +{ + uint32_t res; + neon_s8 vsrc1; + neon_s8 vsrc2; + neon_s8 vdest; + do + { + union + { + neon_s8 v; + uint32_t i; + } conv_u; + conv_u.i = (arg1); + /*vsrc1 = conv_u.v; not in sdcc */ + memcpy (&vsrc1, &(conv_u.v), sizeof (neon_s8)); + } + while (0); + do + { + union + { + neon_s8 v; + uint32_t i; + } conv_u; + conv_u.i = (arg2); + /*vsrc2 = conv_u.v; not in sdcc*/ + memcpy (&vsrc2, &(conv_u.v), sizeof (neon_s8)); + } + while (0); + do + { + int8_t tmp; + tmp = (int8_t) vsrc2.v1; + if (tmp >= (ssize_t) sizeof (vsrc1.v1) * 8) + { + vdest.v1 = 0; + } + else if (tmp < -(ssize_t) sizeof (vsrc1.v1) * 8) + { + vdest.v1 = vsrc1.v1 >> (sizeof (vsrc1.v1) * 8 - 1); + } + else if (tmp == -(ssize_t) sizeof (vsrc1.v1) * 8) + { + vdest.v1 = vsrc1.v1 >> (tmp - 1); + vdest.v1++; + vdest.v1 >>= 1; + } + else if (tmp < 0) + { + vdest.v1 = (vsrc1.v1 + (1 << (-1 - tmp))) >> -tmp; + } + else + { + vdest.v1 = vsrc1.v1 << tmp; + } + } + while (0); + do + { + int8_t tmp; + tmp = (int8_t) vsrc2.v2; + if (tmp >= (ssize_t) sizeof (vsrc1.v2) * 8) + { + vdest.v2 = 0; + } + else if (tmp < -(ssize_t) sizeof (vsrc1.v2) * 8) + { + vdest.v2 = vsrc1.v2 >> (sizeof (vsrc1.v2) * 8 - 1); + } + else if (tmp == -(ssize_t) sizeof (vsrc1.v2) * 8) + { + vdest.v2 = vsrc1.v2 >> (tmp - 1); + vdest.v2++; + vdest.v2 >>= 1; + } + else if (tmp < 0) + { + vdest.v2 = (vsrc1.v2 + (1 << (-1 - tmp))) >> -tmp; + } + else + { + vdest.v2 = vsrc1.v2 << tmp; + } + } + while (0); + do + { + int8_t tmp; + tmp = (int8_t) vsrc2.v3; + if (tmp >= (ssize_t) sizeof (vsrc1.v3) * 8) + { + vdest.v3 = 0; + } + else if (tmp < -(ssize_t) sizeof (vsrc1.v3) * 8) + { + vdest.v3 = vsrc1.v3 >> (sizeof (vsrc1.v3) * 8 - 1); + } + else if (tmp == -(ssize_t) sizeof (vsrc1.v3) * 8) + { + vdest.v3 = vsrc1.v3 >> (tmp - 1); + vdest.v3++; + vdest.v3 >>= 1; + } + else if (tmp < 0) + { + vdest.v3 = (vsrc1.v3 + (1 << (-1 - tmp))) >> -tmp; + } + else + { + vdest.v3 = vsrc1.v3 << tmp; + } + } + while (0); + do + { + int8_t tmp; + tmp = (int8_t) vsrc2.v4; + if (tmp >= (ssize_t) sizeof (vsrc1.v4) * 8) + { + vdest.v4 = 0; + } + else if (tmp < -(ssize_t) sizeof (vsrc1.v4) * 8) + { + vdest.v4 = vsrc1.v4 >> (sizeof (vsrc1.v4) * 8 - 1); + } + else if (tmp == -(ssize_t) sizeof (vsrc1.v4) * 8) + { + vdest.v4 = vsrc1.v4 >> (tmp - 1); + vdest.v4++; + vdest.v4 >>= 1; + } + else if (tmp < 0) + { + vdest.v4 = (vsrc1.v4 + (1 << (-1 - tmp))) >> -tmp; + } + else + { + vdest.v4 = vsrc1.v4 << tmp; + } + } + while (0);; + do + { + union + { + neon_s8 v; + uint32_t i; + } conv_u; + /*conv_u.v = (vdest) not in sdcc */; + memcpy (&conv_u.v, &(vdest), sizeof (neon_s8)); + res = conv_u.i; + } + while (0); + return res; +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && __GNUC__ < 5) + uint32_t r = helper_neon_rshl_s8 (0x05050505, 0x01010101); + if (r != 0x0a0a0a0a) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr43236.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr43236.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr43236.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr43236.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,41 @@ +/* + pr43236.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +void +testTortureExecute (void) +{ + char A[30], B[30], C[30]; + int i; + + /* prepare arrays */ + memset(A, 1, 30); + memset(B, 1, 30); + + for (i = 20; i-- > 10;) { + A[i] = 0; + B[i] = 0; + } + + /* expected result */ + memset(C, 1, 30); + memset(C + 10, 0, 10); + + /* show result */ +/* for (i = 0; i < 30; i++) + printf("%d %d %d\n", A[i], B[i], C[i]); */ + + /* compare results */ + if (memcmp(A, C, 30) || memcmp(B, C, 30)) ASSERT(0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr43269.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr43269.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr43269.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr43269.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,40 @@ +/* + pr43269.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int g_21; +int g_211; +int g_261; + +static void +func_32 (int b) +{ + if (b) { +lbl_370: + g_21 = 1; + } + + for (g_261 = -1; g_261 > -2; g_261--) { + if (g_211 + 1) { + return; + } else { + g_21 = 1; + goto lbl_370; + } + } +} + +void +testTortureExecute (void) +{ + func_32(0); + if (g_261 != -1) + ASSERT (0); + return; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr43438.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr43438.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr43438.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr43438.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,34 @@ +/* + pr43438.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +static unsigned char g_2 = 1; +static int g_9; +static int *l_8 = &g_9; + +static void func_12(int p_13) +{ + int * l_17 = &g_9; + *l_17 &= 0 < p_13; +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5 && __GNUC_MINOR__ < 4)) + unsigned char l_11 = 254; + *l_8 |= g_2; + l_11 |= *l_8; + func_12(l_11); + if (g_9 != 1) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr44202-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr44202-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr44202-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr44202-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,38 @@ +/* + pr44202-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int +add512(int a, int *b) +{ + int c = a + 512; + if (c != 0) + *b = a; + return c; +} + +int +add513(int a, int *b) +{ + int c = a + 513; + if (c == 0) + *b = a; + return c; +} + +void +testTortureExecute (void) +{ + int b0 = -1; + int b1 = -1; + if (add512(-512, &b0) != 0 || b0 != -1 || add513(-513, &b1) != 0 || b1 != -513) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr44468.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr44468.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr44468.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr44468.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,73 @@ +/* + pr44468.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +struct S { + int i; + int j; +}; +struct R { + int k; + struct S a; +}; +struct Q { + float k; + struct S a; +}; +struct Q s; +int +test1 (void *q) +{ + struct S *b = (struct S *)((char *)q + sizeof (int)); + s.a.i = 0; + b->i = 3; + return s.a.i; +} +int +test2 (void *q) +{ + struct S *b = &((struct R *)q)->a; + s.a.i = 0; + b->i = 3; + return s.a.i; +} +int +test3 (void *q) +{ + s.a.i = 0; + ((struct S *)((char *)q + sizeof (int)))->i = 3; + return s.a.i; +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5 && __GNUC_MINOR__ < 5)) + if (sizeof (float) != sizeof (int) + || offsetof (struct R, a) != sizeof (int) + || offsetof (struct Q, a) != sizeof (int)) + return; + s.a.i = 1; + s.a.j = 2; + if (test1 ((void *)&s) != 3) + ASSERT (0); + s.a.i = 1; + s.a.j = 2; + if (test2 ((void *)&s) != 3) + ASSERT (0); + s.a.i = 1; + s.a.j = 2; + if (test3 ((void *)&s) != 3) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr44555.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr44555.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr44555.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr44555.c 2012-05-05 21:01:21.000000000 +0000 @@ -0,0 +1,30 @@ +/* + pr44555.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct a { + char b[100]; +}; +int foo(struct a *a) +{ + if (&a->b) + return 1; + return 0; +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ == 4 && __GNUC_MINOR__ < 6)) + if (foo((struct a *)0) != 0) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr44575.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr44575.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr44575.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr44575.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,63 @@ +/* + pr44575.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR target/44575 */ + +#include + +int fails = 0; +struct S { float a[3]; }; +struct S a[5]; +#if 0 +TODO: Enable once structures can be passed as parameters! +void +check (int z, ...) +{ + struct S arg, *p; + va_list ap; + int j = 0, k = 0; + int i; + va_start (ap, z); + for (i = 2; i < 4; ++i) + { + p = 0; + j++; + k += 2; + switch ((z << 4) | i) + { + case 0x12: + case 0x13: + p = &a[2]; + arg = va_arg (ap, struct S); + break; + default: + ++fails; + break; + } + if (p && p->a[2] != arg.a[2]) + ++fails; + if (fails) + break; + } + va_end (ap); +} +#endif +void +testTortureExecute (void) +{ +#if 0 + a[2].a[2] = -49026; + check (1, a[2], a[2]); + if (fails) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr45034.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr45034.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr45034.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr45034.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,58 @@ +/* + pr45034.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +static void fixnum_neg(signed char x, signed char *py, int *pv) +{ + unsigned char ux, uy; + + ux = (unsigned char)x; + uy = -ux; + *py = (uy <= 127) ? (signed char)uy : (-(signed char)(255 - uy) - 1); + *pv = (x == -128) ? 1 : 0; +} + +void foo(int x, int y, int v) +{ + if (y < -128 || y > 127) + ASSERT(0); +} + +int ftest_neg(void) +{ + signed char x, y; + int v, err; + + err = 0; + x = -128; + for (;;) { + fixnum_neg(x, &y, &v); + foo((int)x, (int)y, v); + if ((v && x != -128) || (!v && x == -128)) + ++err; + if (x == 127) + break; + ++x; + } + return err; +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5 && __GNUC_MINOR__ < 6)) + if (sizeof (char) != 1) + return; + if (ftest_neg() != 0) + ASSERT(0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr46909-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr46909-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr46909-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr46909-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,30 @@ +/* + pr46909.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR tree-optimization/46909 */ + +int +foo (unsigned int x) +{ + if (! (x == 4 || x == 6) || (x == 2 || x == 6)) + return 1; + return -1; +} + +void +testTortureExecute (void) +{ + int i; + for (i = -10; i < 10; i++) + if (foo (i) != 1 - 2 * (i == 4)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr46909-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr46909-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr46909-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr46909-2.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,30 @@ +/* + pr46909-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR tree-optimization/46909 */ + +int +foo (int x) +{ + if ((x != 0 && x != 13) || x == 5 || x == 20) + return 1; + return -1; +} + +void +testTortureExecute (void) +{ + int i; + for (i = -10; i < 30; i++) + if (foo (i) != 1 - 2 * (i == 0) - 2 * (i == 13)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr47148.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr47148.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr47148.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr47148.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,48 @@ +/* + pr47148.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#if 0 +//TODO: Enable once sdcc supports C99's mixture of declarations and statements. +/* PR tree-optimization/47148 */ + +static inline unsigned +bar (unsigned x, unsigned y) +{ + if (y >= 32) + return x; + else + return x >> y; +} + +static unsigned a = 1, b = 1; + +static inline void +foo (unsigned char x, unsigned y) +{ + if (!y) + return; + unsigned c = (0x7000U / (x - 2)) ^ a; + unsigned d = bar (a, a); + b &= ((a - d) && (a - 1)) + c; +} +#endif + +void +testTortureExecute (void) +{ +#if 0 + foo (1, 1); + foo (-1, 1); + if (b && ((unsigned char) -1) == 255) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr47155.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr47155.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr47155.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr47155.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,25 @@ +/* + pr47155.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR tree-optimization/47155 */ + +unsigned int a; +static signed char b = -127; +int c = 1; + +void +testTortureExecute (void) +{ + a = b <= (unsigned char) (-6 * c); + if (!a) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr47299.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr47299.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr47299.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr47299.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,26 @@ +/* + pr47299.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR rtl-optimization/47299 */ + +unsigned short +foo (unsigned char x) +{ + return x * 255; +} + +void +testTortureExecute (void) +{ + if (foo (0x40) != 0x3fc0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr47337.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr47337.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr47337.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr47337.c 2012-04-02 11:26:01.000000000 +0000 @@ -0,0 +1,105 @@ +/* + pr47337.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#include + +// Some ports do not yet support long long +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + +/* PR rtl-optimization/47337 */ + +static unsigned int a[256], b = 0; +static char c = 0; +static int d = 0, *f = &d; +static long long e = 0; + +static short +foo (long long x, long long y) +{ + return x / y; +} + +static char +bar (char x, char y) +{ + return x - y; +} + +static int +baz (int x, int y) +{ + *f = (y != (short) (y * 3)); + for (c = 0; c < 2; c++) + { + lab: + if (d) + { + if (e) + e = 1; + else + return x; + } + else + { + d = 1; + goto lab; + } + f = &d; + } + return x; +} + +static void +fnx (unsigned long long x, int y) +{ + if (!y) + { + b = a[b & 1]; + b = a[b & 1]; + b = a[(b ^ (x & 1)) & 1]; + b = a[(b ^ (x & 1)) & 1]; + } +} + +const char *volatile w = "2"; +#endif + +void +testTortureExecute (void) +{ +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) + int h = 0; + unsigned int k = 0; + int l[8]; + int i, j; + + if (strcmp (w, "1") == 0) + h = 1; + + for (i = 0; i < 256; i++) + { + for (j = 8; j > 0; j--) + k = 1; + a[i] = k; + } + for (i = 0; i < 8; i++) + l[i] = 0; + + d = bar (c, c); + d = baz (c, 1 | foo (l[0], 10)); + fnx (d, h); + fnx (e, h); + + if (d != 0) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr47538.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr47538.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr47538.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr47538.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,91 @@ +/* + pr47538.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 93 +#endif + +#ifndef SDCC_mcs51 +#include + +/* PR tree-optimization/47538 */ + +struct S +{ + double a, b, *c; + unsigned long d; +}; + +void +foo (struct S *x, const struct S *y) +{ + const unsigned long n = y->d + 1; + const double m = 0.25 * (y->b - y->a); + x->a = y->a; + x->b = y->b; + if (n == 1) + { + x->c[0] = 0.; + } + else if (n == 2) + { + x->c[1] = m * y->c[0]; + x->c[0] = 2.0 * x->c[1]; + } + else + { + double o = 0.0, p = 1.0; + unsigned long i; + + for (i = 1; i <= n - 2; i++) + { + x->c[i] = m * (y->c[i - 1] - y->c[i + 1]) / (double) i; + o += p * x->c[i]; + p = -p; + } + x->c[n - 1] = m * y->c[n - 2] / (n - 1.0); + o += p * x->c[n - 1]; + x->c[0] = 2.0 * o; + } +} +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + struct S x, y; + double c[4] = { 10, 20, 30, 40 }, d[4], e[4] = { 118, 118, 118, 118 }; + + y.a = 10; + y.b = 6; + y.c = c; + x.c = d; + y.d = 3; + memcpy (d, e, sizeof d); + foo (&x, &y); + if (d[0] != 0 || d[1] != 20 || d[2] != 10 || d[3] != -10) + ASSERT (0); + y.d = 2; + memcpy (d, e, sizeof d); + foo (&x, &y); + if (d[0] != 60 || d[1] != 20 || d[2] != -10 || d[3] != 118) + ASSERT (0); + y.d = 1; + memcpy (d, e, sizeof d); + foo (&x, &y); + if (d[0] != -20 || d[1] != -10 || d[2] != 118 || d[3] != 118) + ASSERT (0); + y.d = 0; + memcpy (d, e, sizeof d); + foo (&x, &y); + if (d[0] != 0 || d[1] != 118 || d[2] != 118 || d[3] != 118) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr48717.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr48717.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr48717.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr48717.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,35 @@ +/* + pr48717.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR tree-optimization/48717 */ + +int v = 1, w; + +unsigned short +foo (unsigned short x, unsigned short y) +{ + return x + y; +} + +void +bar (void) +{ + v = foo (~w, w); +} + +void +testTortureExecute (void) +{ + bar (); + if (v != (unsigned short) -1) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr48809.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr48809.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr48809.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr48809.c 2012-02-26 15:16:21.000000000 +0000 @@ -0,0 +1,71 @@ +/* + pr48809.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR tree-optimization/48809 */ + +int +foo (signed char x) +{ + int y = 0; + switch (x) + { + case 0: y = 1; break; + case 1: y = 7; break; + case 2: y = 2; break; + case 3: y = 19; break; + case 4: y = 5; break; + case 5: y = 17; break; + case 6: y = 31; break; + case 7: y = 8; break; + case 8: y = 28; break; + case 9: y = 16; break; + case 10: y = 31; break; + case 11: y = 12; break; + case 12: y = 15; break; + case 13: y = 111; break; + case 14: y = 17; break; + case 15: y = 10; break; + case 16: y = 31; break; + case 17: y = 7; break; + case 18: y = 2; break; + case 19: y = 19; break; + case 20: y = 5; break; + case 21: y = 107; break; + case 22: y = 31; break; + case 23: y = 8; break; + case 24: y = 28; break; + case 25: y = 106; break; + case 26: y = 31; break; + case 27: y = 102; break; + case 28: y = 105; break; + case 29: y = 111; break; + case 30: y = 17; break; + case 31: y = 10; break; + case 32: y = 31; break; + case 98: y = 18; break; + case -62: y = 19; break; + } + return y; +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5)) + if (foo (98) != 18 || foo (97) != 0 || foo (99) != 0) + ASSERT (0); + if (foo (-62) != 19 || foo (-63) != 0 || foo (-61) != 0) + ASSERT (0); + if (foo (28) != 105 || foo (27) != 102 || foo (29) != 111) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr48973-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr48973-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr48973-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr48973-1.c 2012-02-26 15:16:21.000000000 +0000 @@ -0,0 +1,32 @@ +/* + pr48973-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR middle-end/48973 */ + +struct S { signed int f : 1; } s; +int v = -1; + +void +foo (unsigned int x) +{ + if (x != -1U) + ASSERT (0); +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5)) + s.f = (v & 1) > 0; + foo (s.f); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr48973-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr48973-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr48973-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr48973-2.c 2012-02-26 15:16:21.000000000 +0000 @@ -0,0 +1,26 @@ +/* + pr48973-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR middle-end/48973 */ + +struct S { signed int f : 1; } s; +int v = -1; + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5)) + s.f = v < 0; + if ((unsigned int) s.f != -1U) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr49039.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr49039.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr49039.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr49039.c 2012-02-26 15:16:21.000000000 +0000 @@ -0,0 +1,38 @@ +/* + pr49039.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR tree-optimization/49039 */ +int cnt; + +void +foo (unsigned int x, unsigned int y) +{ + unsigned int minv, maxv; + if (x == 1 || y == -2U) + return; + minv = x < y ? x : y; + maxv = x > y ? x : y; + if (minv == 1) + ++cnt; + if (maxv == -2U) + ++cnt; +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5)) + foo (-2U, 1); + if (cnt != 2) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr49073.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr49073.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr49073.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr49073.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,38 @@ +/* + pr49073.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR tree-optimization/49073 */ + +int a[] = { 1, 2, 3, 4, 5, 6, 7 }, c; + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5 && __GNUC_MINOR__ < 7)) + int d = 1, i = 1; + _Bool f = 0; + do + { + d = a[i]; + if (f && d == 4) + { + ++c; + break; + } + i++; + f = (d == 3); + } + while (d < 7); + if (c != 1) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr49123.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr49123.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr49123.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr49123.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,26 @@ +/* + pr49123.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR lto/49123 */ + +static struct S { signed int f : 1; } s; +static int v = -1; + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5 && __GNUC_MINOR__ < 7)) + s.f = v < 0; + if ((unsigned int) s.f != -1U) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr49161.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr49161.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr49161.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr49161.c 2012-02-26 15:16:21.000000000 +0000 @@ -0,0 +1,57 @@ +/* + pr49161.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR tree-optimization/49161 */ + +int c; + +void +bar (int x) +{ + if (x != c++) + ASSERT (0); +} + +void +foo (int x) +{ + switch (x) + { + case 3: goto l1; + case 4: goto l2; + case 6: goto l3; + default: return; + } +l1: + goto l4; +l2: + goto l4; +l3: + bar (-1); +l4: + bar (0); + if (x != 4) + bar (1); + if (x != 3) + bar (-1); + bar (2); +} + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5)) + foo (3); + if (c != 3) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr49281.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr49281.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr49281.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr49281.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,36 @@ +/* + pr49281.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR target/49281 */ + +extern void abort (void); + +int +foo (int x) +{ + return (x << 2) | 4; +} + +int +bar (int x) +{ + return (x << 2) | 3; +} + +void +testTortureExecute (void) +{ + if (foo (43) != 172 || foo (1) != 4 || foo (2) != 12) + ASSERT (0); + if (bar (43) != 175 || bar (1) != 7 || bar (2) != 11) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr49419.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr49419.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr49419.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr49419.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,48 @@ +/* + pr49419.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#pragma disable_warning 85 +#endif + +/* PR tree-optimization/49419 */ + +struct S { int w, x, y; } *t; + +int +foo (int n, int f, int *s, int m) +{ + int x, i, a; + if (n == -1) + return 0; + for (x = n, i = 0; t[x].w == f && i < m; i++) + x = t[x].x; + if (i == m) + ASSERT (0); + a = i + 1; + for (x = n; i > 0; i--) + { + s[i] = t[x].y; + x = t[x].x; + } + s[0] = x; + return a; +} + +void +testTortureExecute (void) +{ + int s[3], i; + struct S buf[3] = { { 1, 1, 2 }, { 0, 0, 0 }, { 0, 0, 0 } }; + t = buf; + if (foo (0, 1, s, 3) != 2) + ASSERT (0); + if (s[0] != 1 || s[1] != 2) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr49768.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr49768.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr49768.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr49768.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,23 @@ +/* + pr49768.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR tree-optimization/49768 */ + +void +testTortureExecute (void) +{ +#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5 && __GNUC_MINOR__ < 7)) + static struct { unsigned int : 1; unsigned int s : 1; } s = { .s = 1 }; + if (s.s != 1) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr51466.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr51466.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pr51466.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pr51466.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,52 @@ +/* + pr51466.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* PR tree-optimization/51466 */ + +int +foo (int i) +{ + volatile int v[4]; + int *p; + v[i] = 6; + p = (int *) &v[i]; + return *p; +} + +int +bar (int i) +{ + volatile int v[4]; + int *p; + v[i] = 6; + p = (int *) &v[i]; + *p = 8; + return v[i]; +} + +int +baz (int i) +{ + volatile int v[4]; + int *p; + v[i] = 6; + p = (int *) &v[0]; + *p = 8; + return v[i]; +} + +void +testTortureExecute (void) +{ + if (foo (3) != 6 || bar (2) != 8 || baz (0) != 8 || baz (1) != 6) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pta-field-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pta-field-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pta-field-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pta-field-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,40 @@ +/* + pta-field-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct Foo { + int *p; + int *q; +}; + +void +bar (int **x) +{ + struct Foo *f = (struct Foo *)x; + *(f->q) = 0; +} + +int foo(void) +{ + struct Foo f; + int i = 1, j = 2; + f.p = &i; + f.q = &j; + bar(&f.p); + return j; +} + +void +testTortureExecute (void) +{ + if (foo () != 0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pta-field-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pta-field-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pta-field-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pta-field-2.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,40 @@ +/* + pta-field-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct Foo { + int *p; + int *q; +}; + +void +bar (int **x) +{ + struct Foo *f = (struct Foo *)(x - 1); + *(f->p) = 0; +} + +int foo(void) +{ + struct Foo f; + int i = 1, j = 2; + f.p = &i; + f.q = &j; + bar(&f.q); + return i; +} + +void +testTortureExecute (void) +{ + if (foo () != 0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-ptr-arith-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-ptr-arith-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-ptr-arith-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-ptr-arith-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,26 @@ +/* + ptr-arith-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +const char * +f (const char *s, unsigned int i) +{ + return &s[i + 3 - 1]; +} + +void +testTortureExecute (void) +{ + const char *str = "abcdefghijkl"; + const char *x2 = f (str, 12); + if (str + 14 != x2) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pure-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pure-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-pure-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-pure-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,79 @@ +/* + restrict-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Origin: Kaveh Ghazi 2002-05-27. */ + +extern int i; + +extern int func0 (int); +extern int func1 (int); + +/* GCC should automatically detect attributes for these functions. + At -O3 They'll be inlined, but that's ok. */ +static int func2 (int a) { return i + a; } /* pure */ +static int func3 (int a) { return a * 3; } /* const */ +static int func4 (int a) { return func0(a) + a; } /* pure */ +static int func5 (int a) { return a + func1(a); } /* const */ +static int func6 (int a) { return func2(a) + a; } /* pure */ +static int func7 (int a) { return a + func3(a); } /* const */ + +void +testTortureExecute (void) +{ + int i[10], r; + + i[0] = 0; + r = func0(0); + if (i[0]) + ASSERT (0); + + i[1] = 0; + r = func1(0); + if (i[1]) + ASSERT (0); + + i[2] = 0; + r = func2(0); + if (i[2]) + ASSERT (0); + + i[3] = 0; + r = func3(0); + if (i[3]) + ASSERT (0); + + i[4] = 0; + r = func4(0); + if (i[4]) + ASSERT (0); + + i[5] = 0; + r = func5(0); + if (i[5]) + ASSERT (0); + + i[6] = 0; + r = func6(0); + if (i[6]) + ASSERT (0); + + i[7] = 0; + r = func7(0); + if (i[7]) + ASSERT (0); + + return; +} + +int func0 (int a) { return a - i; } /* pure */ +int func1 (int a) { return a - a; } /* const */ + +int i = 2; + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-scope-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-scope-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-scope-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-scope-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,29 @@ +/* + scope-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +int v = 3; + +void f (void) +{ + int v = 4; + { + extern int v; + if (v != 3) + ASSERT (0); + } +} + +void +testTortureExecute (void) +{ + f (); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-shiftopt-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-shiftopt-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-shiftopt-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-shiftopt-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,74 @@ +/* + shiftopt-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Copyright (C) 2002 Free Software Foundation + + Check that constant folding of shift operations is working. + + Roger Sayle, 10th October 2002. */ + +extern void link_error (void); + +void +utest (unsigned int x) +{ + if (x >> 0 != x) + link_error (); + + if (x << 0 != x) + link_error (); + + if (0 << x != 0) + link_error (); + + if (0 >> x != 0) + link_error (); + + if (-1 >> x != -1) + link_error (); + + if (~0 >> x != ~0) + link_error (); +} + +void +stest (int x) +{ + if (x >> 0 != x) + link_error (); + + if (x << 0 != x) + link_error (); + + if (0 << x != 0) + link_error (); + + if (0 >> x != 0) + link_error (); +} + +void +testTortureExecute (void) +{ + utest(9); + utest(0); + + stest(9); + stest(0); + + return; +} + +void +link_error () +{ + ASSERT (0); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-stdarg-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-stdarg-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-stdarg-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-stdarg-3.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,183 @@ +/* + stdarg-3.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#pragma disable_warning 93 // Using float for double. + +#include + +int foo_arg, bar_arg; +long x; +double d; +va_list gap; +struct S1 { int i; double d; int j; double e; } s1; +struct S2 { double d; long i; } s2; +int y; + +void +bar (int v) +{ + bar_arg = v; +} + +void +f1 (int i, ...) +{ + va_list ap; + va_start (ap, i); + while (i-- > 0) + x = va_arg (ap, long); + va_end (ap); +} + +void +f2 (int i, ...) +{ + va_list ap; + va_start (ap, i); + while (i-- > 0) + d = va_arg (ap, double); + va_end (ap); +} + +void +f3 (int i, ...) +{ + va_list ap; + int j = i; + while (j-- > 0) + { + va_start (ap, i); + x = va_arg (ap, long); + va_end (ap); + bar (x); + } +} + +void +f4 (int i, ...) +{ + va_list ap; + int j = i; + while (j-- > 0) + { + va_start (ap, i); + d = va_arg (ap, double); + va_end (ap); + bar (d + 4.0); + } +} + +#if 0 +SDCC cannot assign aggregates yet. +void +f5 (int i, ...) +{ + va_list ap; + va_start (ap, i); + while (i-- > 0) + s1 = va_arg (ap, struct S1); + va_end (ap); +} + +void +f6 (int i, ...) +{ + va_list ap; + va_start (ap, i); + while (i-- > 0) + s2 = va_arg (ap, struct S2); + va_end (ap); +} + +void +f7 (int i, ...) +{ + va_list ap; + int j = i; + while (j-- > 0) + { + va_start (ap, i); + s1 = va_arg (ap, struct S1); + va_end (ap); + bar (s1.i); + } +} + +void +f8 (int i, ...) +{ + va_list ap; + int j = i; + while (j-- > 0) + { + va_start (ap, i); + s2 = va_arg (ap, struct S2); + y = va_arg (ap, int); + va_end (ap); + bar (s2.i); + } +} +#endif + +void +testTortureExecute (void) +{ +// struct S1 a1, a3; +// struct S2 a2, a4; + + f1 (7, 1L, 2L, 3L, 5L, 7L, 9L, 11L, 13L); + if (x != 11L) + ASSERT (0); + f2 (6, 1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0); + if (d != 32.0) + ASSERT (0); + f3 (2, 1L, 3L); + if (bar_arg != 1L || x != 1L) + ASSERT (0); + f4 (2, 17.0, 19.0); + if (bar_arg != 21 || d != 17.0) + ASSERT (0); +#if 0 +// SDCC cannot pass structures or assign aggregates yet. + a1.i = 131; + a1.j = 251; + a1.d = 15.0; + a1.e = 191.0; + a3 = a1; + a3.j = 254; + a3.e = 178.0; + f5 (2, a1, a3, a1); + if (s1.i != 131 || s1.j != 254 || s1.d != 15.0 || s1.e != 178.0) + ASSERT (0); + f5 (3, a1, a3, a1); + if (s1.i != 131 || s1.j != 251 || s1.d != 15.0 || s1.e != 191.0) + ASSERT (0); + a2.i = 138; + a2.d = 16.0; + a4.i = 257; + a4.d = 176.0; + f6 (2, a2, a4, a2); + if (s2.i != 257 || s2.d != 176.0) + ASSERT (0); + f6 (3, a2, a4, a2); + if (s2.i != 138 || s2.d != 16.0) + ASSERT (0); + f7 (2, a3, a1, a1); + if (s1.i != 131 || s1.j != 254 || s1.d != 15.0 || s1.e != 178.0) + ASSERT (0); + if (bar_arg != 131) + ASSERT (0); + f8 (3, a4, a2, a2); + if (s2.i != 257 || s2.d != 176.0) + ASSERT (0); +#endif + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-stdarg-4.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-stdarg-4.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-stdarg-4.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-stdarg-4.c 2012-02-26 02:01:20.000000000 +0000 @@ -0,0 +1,154 @@ +/* + stdarg-4.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#pragma disable_warning 93 // Using float for double. + +#include + +long x, y; + +inline void +f1i (va_list ap) +{ + x = va_arg (ap, double); + x += va_arg (ap, long); + x += va_arg (ap, double); +} + +void +f1 (int i, ...) +{ + va_list ap; + va_start (ap, i); + f1i (ap); + va_end (ap); +} + +inline void +f2i (va_list ap) +{ + y = va_arg (ap, int); + y += va_arg (ap, long); + y += va_arg (ap, double); + f1i (ap); +} + +void +f2 (int i, ...) +{ + va_list ap; + va_start (ap, i); + f2i (ap); + va_end (ap); +} + +long +f3h (int i, long arg0, long arg1, long arg2, long arg3) +{ + return i + arg0 + arg1 + arg2 + arg3; +} + +long +f3 (int i, ...) +{ + long t, arg0, arg1, arg2, arg3; + va_list ap; + + va_start (ap, i); + switch (i) + { + case 0: + t = f3h (i, 0, 0, 0, 0); + break; + case 1: + arg0 = va_arg (ap, long); + t = f3h (i, arg0, 0, 0, 0); + break; + case 2: + arg0 = va_arg (ap, long); + arg1 = va_arg (ap, long); + t = f3h (i, arg0, arg1, 0, 0); + break; + case 3: + arg0 = va_arg (ap, long); + arg1 = va_arg (ap, long); + arg2 = va_arg (ap, long); + t = f3h (i, arg0, arg1, arg2, 0); + break; + case 4: + arg0 = va_arg (ap, long); + arg1 = va_arg (ap, long); + arg2 = va_arg (ap, long); + arg3 = va_arg (ap, long); + t = f3h (i, arg0, arg1, arg2, arg3); + break; + default: + t = 0; + ASSERT (0); + } + va_end (ap); + + return t; +} + +void +f4 (int i, ...) +{ + va_list ap; + + va_start (ap, i); + switch (i) + { + case 4: + y = va_arg (ap, double); + break; + case 5: + y = va_arg (ap, double); + y += va_arg (ap, double); + break; + default: + ASSERT (0); + } + f1i (ap); + va_end (ap); +} + + +void +testTortureExecute (void) +{ + f1 (3, 16.0, 128L, 32.0); + if (x != 176L) + ASSERT (0); + f2 (6, 5, 7L, 18.0, 19.0, 17L, 64.0); + if (x != 100L || y != 30L) + ASSERT (0); + if (f3 (0) != 0) + ASSERT (0); + if (f3 (1, 18L) != 19L) + ASSERT (0); + if (f3 (2, 18L, 100L) != 120L) + ASSERT (0); + if (f3 (3, 18L, 100L, 300L) != 421L) + ASSERT (0); + if (f3 (4, 18L, 71L, 64L, 86L) != 243L) + ASSERT (0); + f4 (4, 6.0, 9.0, 16L, 18.0); + if (x != 43L || y != 6L) + ASSERT (0); + f4 (5, 7.0, 21.0, 1.0, 17L, 126.0); + +// Fails on z80 and related + if (x != 144L || y != 28L) + ASSERT (0); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-string-opt-17.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-string-opt-17.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-string-opt-17.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-string-opt-17.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,52 @@ +/* + string-opt-17.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Copyright (C) 2003 Free Software Foundation. + + Test strcpy optimizations don't evaluate side-effects twice. + + Written by Jakub Jelinek, June 23, 2003. */ + +#include + +size_t +test1 (char *s, size_t i) +{ + strcpy (s, "foobarbaz" + i++); + return i; +} + +size_t +check2 (void) +{ + static size_t r = 5; + if (r != 5) + ASSERT (0); + return ++r; +} + +void +test2 (char *s) +{ + strcpy (s, "foobarbaz" + check2 ()); +} + +void +testTortureExecute (void) +{ + char buf[10]; + if (test1 (buf, 7) != 8 || memcmp (buf, "az", 3)) + ASSERT (0); + test2 (buf); + if (memcmp (buf, "baz", 4)) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-string-opt-18.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-string-opt-18.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-string-opt-18.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-string-opt-18.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,83 @@ +/* + string-opt-18.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Copyright (C) 2003 Free Software Foundation. + + Test equal pointer optimizations don't break anything. + + Written by Roger Sayle, July 14, 2003. */ + +#include + + +void test1 (void *ptr) +{ + if (memcpy(ptr,ptr,8) != ptr) + ASSERT (0); +} + +#if 0 +// GNU-specific function +void test2 (char *ptr) +{ + if (mempcpy(ptr,ptr,8) != ptr+8) + ASSERT (0); +} +#endif + +void test3 (void *ptr) +{ + if (memmove(ptr,ptr,8) != ptr) + ASSERT (0); +} + +void test4 (char *ptr) +{ + if (strcpy(ptr,ptr) != ptr) + ASSERT (0); +} + +void test5 (void *ptr) +{ + if (memcmp(ptr,ptr,8) != 0) + ASSERT (0); +} + +void test6 (const char *ptr) +{ + if (strcmp(ptr,ptr) != 0) + ASSERT (0); +} + +void test7 (const char *ptr) +{ + if (strncmp(ptr,ptr,8) != 0) + ASSERT (0); +} + + +void +testTortureExecute (void) +{ + char buf[10]; + + test1 (buf); +#if 0 + test2 (buf); +#endif + test3 (buf); + test4 (buf); + test5 (buf); + test6 (buf); + test7 (buf); + + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-string-opt-5.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-string-opt-5.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-string-opt-5.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-string-opt-5.c 2012-02-26 06:14:30.000000000 +0000 @@ -0,0 +1,118 @@ +/* + string-opt-5.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Copyright (C) 2000 Free Software Foundation. + + Ensure builtin strlen, strcmp, strchr, strrchr and strncpy + perform correctly. + + Written by Jakub Jelinek, 11/7/2000. */ + +#include + +#ifndef __SDCC_mcs51 +// mcs51 small model does not have enough RAM to hold buf. +int x = 6; +int y = 1; +const char *bar = "hi world"; +char buf [64]; +#endif + +void +testTortureExecute (void) +{ +#ifndef __SDCC_mcs51 + const char *const foo = "hello world"; + char dst [64]; + + if (strlen (bar) != 8) + ASSERT (0); + if (strlen (bar + (++x & 2)) != 6) + ASSERT (0); + if (x != 7) + ASSERT (0);; + if (strlen (foo + (x++, 6)) != 5) + ASSERT (0); + if (x != 8) + ASSERT (0); + if (strlen (foo + (++x & 1)) != 10) + ASSERT (0); + if (x != 9) + ASSERT (0); + if (strcmp (foo + (x -= 6), "lo world")) + ASSERT (0); + if (x != 3) + ASSERT (0); + if (strcmp (foo, bar) >= 0) + ASSERT (0); + if (strcmp (foo, bar + (x++ & 1)) >= 0) + ASSERT (0); + if (x != 4) + ASSERT (0); + if (strchr (foo + (x++ & 7), 'l') != foo + 9) + ASSERT (0); + if (x != 5) + ASSERT (0); + if (strchr (bar, 'o') != bar + 4) + ASSERT (0); + if (strchr (bar, '\0') != bar + 8) + ASSERT (0); + if (strrchr (bar, 'x')) + ASSERT (0); + if (strrchr (bar, 'o') != bar + 4) + ASSERT (0); + if (strcmp (foo + (x++ & 1), "ello world" + (--y & 1))) + ASSERT (0); + if (x != 6 || y != 0) + ASSERT (0); + dst[5] = ' '; + dst[6] = '\0'; + x = 5; + y = 1; + if (strncpy (dst + 1, foo + (x++ & 3), 4) != dst + 1 + || x != 6 + || strcmp (dst + 1, "ello ")) + ASSERT (0); + memset (dst, ' ', sizeof dst); + if (strncpy (dst + (++x & 1), (y++ & 3) + "foo", 10) != dst + 1 + || x != 7 + || y != 2 + || memcmp (dst, " oo\0\0\0\0\0\0\0\0 ", 12)) + ASSERT (0); + memset (dst, ' ', sizeof dst); + if (strncpy (dst, "hello", 8) != dst || memcmp (dst, "hello\0\0\0 ", 9)) + ASSERT (0); + x = '!'; + memset (buf, ' ', sizeof buf); + if (memset (buf, x++, ++y) != buf + || x != '!' + 1 + || y != 3 + || memcmp (buf, "!!!", 3)) + ASSERT (0); + if (memset (buf + y++, '-', 8) != buf + 3 + || y != 4 + || memcmp (buf, "!!!--------", 11)) + ASSERT (0); + x = 10; + if (memset (buf + ++x, 0, y++) != buf + 11 + || x != 11 + || y != 5 + || memcmp (buf + 8, "---\0\0\0", 7)) + ASSERT (0); + + if (memset (buf + (x += 4), 0, 6) != buf + 15 + || x != 15 + || memcmp (buf + 10, "-\0\0\0\0\0\0\0\0\0", 11)) + ASSERT (0); + + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-struct-ini-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-struct-ini-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-struct-ini-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-struct-ini-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,30 @@ +/* + struct-ini-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +#if 0 +struct S +{ + char f1; + int f2[2]; +}; + +struct S object = {'X', 8, 9}; +#endif + +void +testTortureExecute (void) +{ +#if 0 + if (object.f1 != 'X' || object.f2[0] != 8 || object.f2[1] != 9) + ASSERT (0); + return; +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-struct-ini-2.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-struct-ini-2.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-struct-ini-2.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-struct-ini-2.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,29 @@ +/* + struct-ini-2.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct { + int a:4; + int :4; + int b:4; + int c:4; +} x = { 2,3,4 }; + +void +testTortureExecute (void) +{ + if (x.a != 2) + ASSERT(0); + if (x.b != 3) + ASSERT(0); + if (x.c != 4) + ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-struct-ini-3.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-struct-ini-3.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-struct-ini-3.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-struct-ini-3.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,23 @@ +/* + struct-ini-3.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct +{ + unsigned int f1:1, f2:1, f3:3, f4:3, f5:2, f6:1, f7:1; +} result = {1, 1, 7, 7, 3, 1, 1}; + +void +testTortureExecute (void) +{ + if ((result.f3 & ~7) != 0 || (result.f4 & ~7) != 0) + ASSERT (0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-struct-ini-4.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-struct-ini-4.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-struct-ini-4.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-struct-ini-4.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,27 @@ +/* + struct-ini-4.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +struct s { + int a[3]; + int c[3]; +}; + +struct s s = { + .c = {1, 2, 3} +}; + +void +testTortureExecute (void) +{ + if (s.c[0] != 1) + ASSERT(0); + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-switch-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-switch-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-switch-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-switch-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,65 @@ +/* + switch-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +/* Copyright (C) 2003 Free Software Foundation. + + Test that switch statements suitable using case bit tests are + implemented correctly. + + Written by Roger Sayle, 01/25/2001. */ + +int +foo (int x) +{ + switch (x) + { + case 4: + case 6: + case 9: + case 11: + return 30; + } + return 31; +} + +void +testTortureExecute (void) +{ + int i, r; + + for (i=-1; i<66; i++) + { + r = foo (i); + if (i == 4) + { + if (r != 30) + ASSERT (0); + } + else if (i == 6) + { + if (r != 30) + ASSERT (0); + } + else if (i == 9) + { + if (r != 30) + ASSERT (0); + } + else if (i == 11) + { + if (r != 30) + ASSERT (0); + } + else if (r != 31) + ASSERT (0); + } + return; +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-unroll-1.c sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-unroll-1.c --- sdcc-3.1.0+dfsg/support/regression/tests/gcc-torture-execute-unroll-1.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/gcc-torture-execute-unroll-1.c 2012-02-22 14:45:17.000000000 +0000 @@ -0,0 +1,30 @@ +/* + unroll-1.c from the execute part of the gcc torture tests. + */ + +#include + +#ifdef __SDCC +#pragma std_c99 +#endif + +inline int +f (int x) +{ + return (x + 1); +} + +void +testTortureExecute (void) +{ + int a = 0 ; + + while ( (f(f(f(f(f(f(f(f(f(f(1))))))))))) + a < 12 ) + { + a++; + return; + } + if (a != 1) + ASSERT (0); +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/genptrs.c sdcc-3.2.0+dfsg/support/regression/tests/genptrs.c --- sdcc-3.1.0+dfsg/support/regression/tests/genptrs.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/genptrs.c 2012-02-22 14:45:17.000000000 +0000 @@ -34,7 +34,7 @@ char __code * cp1 = (char __code *)0x0001; void (* fp0)(void) = NULL; void (* fp1)(void) = (void (*)(void))0x0001; -#if defined (SDCC_MODEL_HUGE) +#if defined (__SDCC_MODEL_HUGE) void (* fpE)(void) = (void (*)(void))0x7E8000; //SDCC assumes banked pointers have physical address != 0 void (* fpF)(void) = (void (*)(void))0x7F8000; //choose the banks to be mapped to 0x8000 for the test #endif @@ -43,7 +43,7 @@ void testPtrs(void) { -#if defined (SDCC_MODEL_HUGE) +#if defined (__SDCC_MODEL_HUGE) char __code * cp2 = (char __code *)0x0002; void (* fp2)(void) = (void (*)(void))0x0002; @@ -71,7 +71,7 @@ ASSERT (eq(xp0, fp0)); ASSERT (eq(xp0, gp0)); -#if defined(SDCC_mcs51) || defined(SDCC_ds390) +#if defined(__SDCC_mcs51) || defined(__SDCC_ds390) ASSERT (neq(xp1, ip1)); ASSERT (neq(xp1, pp1)); ASSERT (neq(xp1, cp1)); diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/getbyte.c sdcc-3.2.0+dfsg/support/regression/tests/getbyte.c --- sdcc-3.1.0+dfsg/support/regression/tests/getbyte.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/getbyte.c 2012-06-10 14:41:08.000000000 +0000 @@ -0,0 +1,29 @@ +/* getbyte/getword + sign: unsigned, signed +*/ + +#include +#include + +{sign} long global = ({sign} long)0x12345678; + +void testGet(void) +{ + ASSERT (((global >> 0) & 0xFF) == 0x78); // getByte 0 + ASSERT (((global >> 8) & 0xFF) == 0x56); // getByte 1 + ASSERT (((global >> 16) & 0xFF) == 0x34); // getByte 2 + ASSERT (((global >> 24) & 0xFF) == 0x12); // getByte 3 + + ASSERT (((global >> 0) & 0xFFFF) == 0x5678); // getWord 0 + ASSERT (((global >> 8) & 0xFFFF) == 0x3456); // getWord 1 + ASSERT (((global >> 16) & 0xFFFF) == 0x1234); // getWord 2 + + ASSERT ((uint8_t)(global >> 0) == (uint8_t)0x78); // getByte 0 + ASSERT ((uint8_t)(global >> 8) == (uint8_t)0x56); // getByte 1 + ASSERT ((uint8_t)(global >> 16) == (uint8_t)0x34); // getByte 2 + ASSERT ((uint8_t)(global >> 24) == (uint8_t)0x12); // getByte 3 + + ASSERT ((uint16_t)(global >> 0) == (uint16_t)0x5678); // getWord 0 + ASSERT ((uint16_t)(global >> 8) == (uint16_t)0x3456); // getWord 1 + ASSERT ((uint16_t)(global >> 16) == (uint16_t)0x1234); // getWord 2 +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/inline.c sdcc-3.2.0+dfsg/support/regression/tests/inline.c --- sdcc-3.1.0+dfsg/support/regression/tests/inline.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/inline.c 2012-02-22 14:45:17.000000000 +0000 @@ -3,7 +3,7 @@ #include -#ifdef SDCC +#ifdef __SDCC #pragma std_sdcc99 #endif diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/interrupt.c sdcc-3.2.0+dfsg/support/regression/tests/interrupt.c --- sdcc-3.1.0+dfsg/support/regression/tests/interrupt.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/interrupt.c 2012-02-22 14:45:17.000000000 +0000 @@ -3,7 +3,7 @@ */ #include -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) #include <8052.h> @@ -16,7 +16,7 @@ void testInterrupt (void) { -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) register long x = lC; //enable the interrupt and set it @@ -32,7 +32,7 @@ #endif } -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) // Timer2 interrupt service routine // with register and (stack)spil usage void diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/key.c sdcc-3.2.0+dfsg/support/regression/tests/key.c --- sdcc-3.1.0+dfsg/support/regression/tests/key.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/key.c 2012-01-29 10:53:55.000000000 +0000 @@ -0,0 +1,15 @@ +/* key.c - a ward to alert us in case obsolete sdcc-specific keywords rise from the dead. + */ + +#include + +int _asm; +int _endasm, at, bit, code, critical, data, far, +eeprom, fixed16x16, flash, idata, interrupt, nonbanked, banked, near, +pdata, reentrant, shadowregs, wparam, sfr, sfr16, sfr32, sbit, sram, +using, _naked, xdata, _overlay; + +void testBug(void) +{ +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/literalop.c sdcc-3.2.0+dfsg/support/regression/tests/literalop.c --- sdcc-3.1.0+dfsg/support/regression/tests/literalop.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/literalop.c 2012-02-22 14:45:17.000000000 +0000 @@ -61,7 +61,7 @@ ASSERT (ss == 0x7e02); ss = vuc * vuc; ASSERT (ss == (short) 0xfc04); -#ifdef SDCC +#ifdef __SDCC /* after promotion the result of the multiplication is 'signed int', which overflows! */ ASSERT(vuc * vuc < 1); #endif @@ -221,3 +221,4 @@ ASSERT (150 + 150 == 300); ASSERT (160u + 160u == 320); } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/longlong.c sdcc-3.2.0+dfsg/support/regression/tests/longlong.c --- sdcc-3.1.0+dfsg/support/regression/tests/longlong.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/longlong.c 2012-04-21 13:19:52.000000000 +0000 @@ -0,0 +1,93 @@ +/** Simple long long tests. + + */ +#include + +#ifdef __SDCC +#pragma std_sdcc99 +#pragma disable_warning 85 +#endif + +#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) +long long x; +unsigned long long y; +int i; + +long long g(void) +{ + int y = i + 1; + return (y); +} + +long long h(void) +{ + return (x); +} + +long long c(void) +{ + return (12ll); +} + +long long d(int i) +{ + return (i); +} + +long long (*gp)(void) = &g; +#endif + +void +testLongLong (void) +{ + volatile unsigned long tmp; +// Test fils on 32-bit systems. +//#if !defined(__SDCC_mcs51) && !defined(__SDCC_hc08) && !defined(__SDCC_ds390) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) +#if 0 + i = 42; + ASSERT (g() == 43); + i = 23; + ASSERT ((*gp)() == 24); + ASSERT (c() == 12); + x = 42; + ASSERT (h() == x); + ASSERT (d(12) == 12ll); + ASSERT ((x >> 1) == 21); + ASSERT ((x << 1) == 84); + ASSERT (!(x >> 17)); +// ASSERT ((x << 17) == (42l << 17)); sdcc has broken long long constants! + y = x; + ASSERT (y == 42ull); + ASSERT ((y >> 1) == 21); + ASSERT ((y << 1) == 84); + ASSERT ((y >> 17) == 0); +// ASSERT ((y << 17) == (42ul << 17)); +// ASSERT ((y << 16) == (42ul << 16)); + + tmp = 0xaaffaafful; + y = tmp; + ASSERT (c() == 12); + ASSERT ((unsigned char)y == (unsigned char)tmp); + ASSERT ((unsigned int)y == (unsigned int)tmp); + ASSERT ((unsigned long)y == (unsigned long)tmp); + ASSERT (y == tmp); + ASSERT ((y >> 8) == (tmp >>= 8)); + ASSERT ((y >> 12) == (tmp >>= 4)); + ASSERT ((y >> 16) == (tmp >>= 4)); + ASSERT ((y >> 24) == (tmp >>= 8)); + ASSERT ((y >> 32) == 0x0ul); + + tmp = 1; + y = tmp; + ASSERT (c() == 12); + ASSERT ((y << 1) == 2); + ASSERT ((y << 16) == (tmp << 16)); + ASSERT ((y << 23) == (tmp << 23)); + y += 2; + y <<= 31; + ASSERT (c() == 12); + y >>= 31; + ASSERT (y == 3); +#endif +} + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/malloc.c sdcc-3.2.0+dfsg/support/regression/tests/malloc.c --- sdcc-3.1.0+dfsg/support/regression/tests/malloc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/malloc.c 2012-02-22 14:45:17.000000000 +0000 @@ -1,12 +1,12 @@ /* Simple malloc tests. */ #include -#if defined(SDCC_pic16) +#if defined(__SDCC_pic16) #include #endif #include -#if defined(SDCC_pic16) +#if defined(__SDCC_pic16) __xdata char heap[100]; #endif @@ -17,8 +17,8 @@ char *p; unsigned char i; -#if !defined(PORT_HOST) && !defined(SDCC_gbz80) && !defined(SDCC_z80) -#if defined(SDCC_pic16) +#if !defined(PORT_HOST) && !defined(__SDCC_gbz80) && !defined(__SDCC_z80) +#if defined(__SDCC_pic16) _initHeap (heap, sizeof heap); #endif @@ -86,3 +86,4 @@ LOG (("p3, after freeing p2: %u\n", (unsigned) p3)); #endif } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/memory.c sdcc-3.2.0+dfsg/support/regression/tests/memory.c --- sdcc-3.1.0+dfsg/support/regression/tests/memory.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/memory.c 2012-05-21 21:40:35.000000000 +0000 @@ -6,13 +6,21 @@ unsigned char destination[4]; const unsigned char source[4] = {0, 1, 2, 3}; +int c; void testmemory(void) { volatile size_t zero = 0; volatile size_t one = 1; + ASSERT(source[0] == 0); + /* Test memset() */ + c = 8; + memset(destination, c, one); + ASSERT(destination[0] == 8); + memset(destination, c, 3); + ASSERT(destination[2] == 8); destination[3] = 23; memset(destination, 42, 3); ASSERT(destination[0] == 42); @@ -52,9 +60,8 @@ ASSERT(destination[3] == source[2]); /* Test memchr() */ - /* memchr() is not yet supported by sdcc. ASSERT(NULL == memchr(destination, 5, 4)); - ASSERT(destination == memchr(destination, 0, 4)); + /*ASSERT(destination == memchr(destination, 0, 4)); ASSERT(destination + 3 == memchr(destination, 3, 4));*/ ASSERT(strlen("test") == 4); diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/preproc.c sdcc-3.2.0+dfsg/support/regression/tests/preproc.c --- sdcc-3.1.0+dfsg/support/regression/tests/preproc.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/preproc.c 2012-02-22 14:45:17.000000000 +0000 @@ -10,7 +10,7 @@ * the following tests are applicable only for SDCC, * since they are using SDCC specific pragmas */ -#ifdef SDCC +#ifdef __SDCC /* * test for bug 135170 */ diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/setjmp.c sdcc-3.2.0+dfsg/support/regression/tests/setjmp.c --- sdcc-3.1.0+dfsg/support/regression/tests/setjmp.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/setjmp.c 2012-05-21 12:05:21.000000000 +0000 @@ -6,7 +6,7 @@ unsigned int global_int = 0; unsigned int *gpInt; -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) #include <8052.h> void @@ -17,7 +17,7 @@ } #endif -#if defined(SDCC_mcs51) || defined(SDCC_z80) || defined(PORT_HOST) +#if defined(__SDCC_mcs51) || defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_r2k) || defined(__SDCC_r3ka) || defined(PORT_HOST) void try_fun (jmp_buf catch, int except) @@ -50,11 +50,11 @@ void testJmp (void) { -#if defined(SDCC_mcs51) || defined(SDCC_z80) || defined(PORT_HOST) +#if defined(__SDCC_mcs51) || defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_r2k) || defined(__SDCC_r3ka) || defined(PORT_HOST) jmp_buf catch; int exception; -#if defined(SDCC_mcs51) +#if defined(__SDCC_mcs51) gpInt = &global_int; //enable the interrupt and set it's flag to generate some heavy stack usage ET2 = 1; @@ -77,7 +77,7 @@ // ASSERT(0); //#endif -#if defined(SDCC_mcs51) || defined(SDCC_z80) || defined(PORT_HOST) +#if defined(__SDCC_mcs51) || defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_r2k) || defined(__SDCC_r3ka) || defined(PORT_HOST) f1(); #endif } diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/sfr16.c sdcc-3.2.0+dfsg/support/regression/tests/sfr16.c --- sdcc-3.1.0+dfsg/support/regression/tests/sfr16.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/sfr16.c 2012-03-18 10:34:03.000000000 +0000 @@ -4,22 +4,22 @@ #include -#if defined (SDCC_mcs51) +#if defined (__SDCC_mcs51) __sfr __at 0x8A SFR_LSB; //timer 0 low byte __sfr __at 0x8C SFR_MSB; //timer 0 high byte __sfr16 __at 0x8C8A SFR_16; //timer 0 __sfr32 __at 0x8C8ACDCC SFR_32; //timer 0 & 2 -#elif defined (SDCC_ds390) +#elif defined (__SDCC_ds390) __sfr __at 0x8B SFR_LSB; //timer 1 low byte __sfr __at 0x8D SFR_MSB; //timer 1 high byte __sfr16 __at 0x8D8B SFR_16; //timer 1 - __sfr32 __at 0x8D8BCDCC SFR_32; //timer 1 & 2 + __sfr32 __at 0x8D8B8090 SFR_32; //timer 1 & P4 & P1 #endif void test_sfr (void) { -#if defined (SFR_16) +#if defined (__SDCC_mcs51) || defined (__SDCC_ds390) SFR_16 = 0x00FE; ASSERT (SFR_MSB == 0x00); ASSERT (SFR_LSB == 0xFE); @@ -40,3 +40,4 @@ ASSERT (SFR_32 == 0x10305070); #endif } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/shifts.c sdcc-3.2.0+dfsg/support/regression/tests/shifts.c --- sdcc-3.1.0+dfsg/support/regression/tests/shifts.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/shifts.c 2012-03-29 14:41:25.000000000 +0000 @@ -110,3 +110,4 @@ ASSERT(ShiftLeftByParam(2) == ({type})({vals} << 2)); ASSERT(ShiftRightByParam(2) == ({type})({vals} >> 2)); } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/simplefloat.c sdcc-3.2.0+dfsg/support/regression/tests/simplefloat.c --- sdcc-3.1.0+dfsg/support/regression/tests/simplefloat.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/simplefloat.c 2012-02-22 14:45:17.000000000 +0000 @@ -30,7 +30,7 @@ void testDiv (void) { -#if defined (__mcs51) && !defined (SDCC_STACK_AUTO) +#if defined (__SDCC_mcs51) && !defined (__SDCC_STACK_AUTO) __idata __at 0xd0 #endif volatile float left; diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/snprintf.c sdcc-3.2.0+dfsg/support/regression/tests/snprintf.c --- sdcc-3.1.0+dfsg/support/regression/tests/snprintf.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/snprintf.c 2012-02-22 14:45:17.000000000 +0000 @@ -37,10 +37,10 @@ {01234, "%o(oct)", "1234(oct)"}, // do we want to check these: -#if defined(SDCC) && !defined(SDCC_z80) && CHECK_B +#if defined(__SDCC) && !defined(__SDCC_z80) && CHECK_B {0x4142, "%bc %bx", "\x41 42"}, /* non-std: print as bytes! */ {0xfffe, "0x%02bX%02bx", "0xFFfe"}, /* non-std: print as bytes! */ -#elif defined(SDCC) && defined(SDCC_z80) && CHECK_B +#elif defined(__SDCC) && defined(__SDCC_z80) && CHECK_B {0x4142, "%bc %bx", "\x42 41"}, /* non-std: print as bytes! */ {0xfffe, "0x%02bX%02bx", "0xFEff"}, /* non-std: print as bytes! */ #endif @@ -102,7 +102,7 @@ } static const cases[] = { // arg, fmt, result // ... there should be more ... -#if defined(SDCC) && !defined(SDCC_ds390) && !(defined(SDCC_mcs51) && (defined(SDCC_USE_XSTACK) || defined(SDCC_MODEL_HUGE))) +#if defined(__SDCC) && !defined(__SDCC_ds390) && !(defined(__SDCC_mcs51) && (defined(__SDCC_USE_XSTACK) || defined(__SDCC_MODEL_HUGE))) {1.0, "%f", ""}, #else {1.0, "%f", "1.000000"}, @@ -135,3 +135,4 @@ ASSERT (buf[sizeof buf - 10] == 0xfe); /* check for cookie */ } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/stacks.c sdcc-3.2.0+dfsg/support/regression/tests/stacks.c --- sdcc-3.1.0+dfsg/support/regression/tests/stacks.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/stacks.c 2012-02-22 14:45:17.000000000 +0000 @@ -20,7 +20,7 @@ { volatile char above; volatile char above2; -#ifndef __mcs51 +#ifndef __SDCC_mcs51 volatile char ac[{size}]; #else volatile char ac[{size} - 100]; diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/staticinit.c sdcc-3.2.0+dfsg/support/regression/tests/staticinit.c --- sdcc-3.1.0+dfsg/support/regression/tests/staticinit.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/staticinit.c 2012-02-22 14:45:17.000000000 +0000 @@ -28,7 +28,7 @@ ASSERT (smallDense[5] == 6); } -#ifdef SDCC_mcs51 +#ifdef __SDCC_mcs51 __idata __at 0xa0 /* leave space for the stack */ #endif static {type} smallSparse[] = { @@ -49,7 +49,7 @@ ASSERT (smallSparse[8] == 1); } -#ifdef SDCC_mcs51 +#ifdef __SDCC_mcs51 __idata __at 0xd0 #endif static {type} smallSparseZero[] = { @@ -76,9 +76,9 @@ ASSERT (smallSparseZeroTail[0] == 1); } -#ifdef SDCC_mcs51 +#ifdef __SDCC_mcs51 __xdata -#elif SDCC_pic16 +#elif __SDCC_pic16 __code #endif static {type} largeMixed[] = { @@ -133,3 +133,4 @@ ASSERT (largeMixed[143+8+1] == 4); ASSERT (largeMixed[143+16+1] == 4); } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/strcmp.c sdcc-3.2.0+dfsg/support/regression/tests/strcmp.c --- sdcc-3.1.0+dfsg/support/regression/tests/strcmp.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/strcmp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -/** tests for strcmp -*/ -#include -#include - -static void -teststrcmp(void) -{ - int result = strcmp("", ""); - ASSERT( result == 0); - - result = strcmp("", "a"); - ASSERT( result < 0); - - result = strcmp("a", ""); - ASSERT( result > 0); - - result = strcmp("ab", "ab"); - ASSERT( result == 0); - - result = strcmp("aa", "ab"); - ASSERT( result < 0); -} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/strcpy.c sdcc-3.2.0+dfsg/support/regression/tests/strcpy.c --- sdcc-3.1.0+dfsg/support/regression/tests/strcpy.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/strcpy.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -/** tests for strcpy -*/ -#include -#include - -static void -teststrcpy(void) -{ - static char empty[] = ""; - static char string[] = "\1\2\0\3"; - char buf[40] = "abcdefghijklmnopqrstuvwxyz"; - - char * result = strcpy(buf, empty); - ASSERT( strlen(buf) == 0); - ASSERT( result == buf); - - result = strcpy(buf, string); - ASSERT( result == buf); - ASSERT( strlen(buf) == 2); - ASSERT( buf[0] == '\1'); - ASSERT( buf[1] == '\2'); - ASSERT( buf[3] == 'd'); -} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/string.c sdcc-3.2.0+dfsg/support/regression/tests/string.c --- sdcc-3.1.0+dfsg/support/regression/tests/string.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/string.c 2012-04-11 08:16:36.000000000 +0000 @@ -0,0 +1,172 @@ +/** tests for strXXX +*/ +#include +#include + +/** tests for strcmp +*/ +static void +do_teststrcmp (void) +{ + int result = strcmp ("", ""); + ASSERT (result == 0); + + result = strcmp ("", "a"); + ASSERT (result < 0); + + result = strcmp ("a", ""); + ASSERT (result > 0); + + result = strcmp ("ab", "ab"); + ASSERT (result == 0); + + result = strcmp ("aa", "ab"); + ASSERT (result < 0); +} + +/** tests for strcpy +*/ +static void +do_teststrcpy (void) +{ + static char empty[] = ""; + static char string[] = "\1\2\0\3"; + char buf[40] = "abcdefghijklmnopqrstuvwxyz"; + + char * result = strcpy (buf, empty); + ASSERT (strlen (buf) == 0); + ASSERT (result == buf); + + result = strcpy (buf, string); + ASSERT (result == buf); + ASSERT (strlen (buf) == 2); + ASSERT (buf[0] == '\1'); + ASSERT (buf[1] == '\2'); + ASSERT (buf[3] == 'd'); +} + +/** tests for strncmp +*/ +static void +do_teststrncmp (void) +{ + ASSERT (strncmp ("", "", 0) == 0); + ASSERT (strncmp ("ab", "ab", 0) == 0); + ASSERT (strncmp ("a", "a", 2) == 0); + ASSERT (strncmp ("aa", "ab", 1) == 0); + ASSERT (strncmp ("aa", "ab", 2) < 0); + ASSERT (strncmp ("abc", "abd", 2) == 0); + ASSERT (strncmp ("abc", "abc", 3) == 0); +} + +/** tests for strpbrk + * related to bug #2908537 +*/ +static void +do_teststrpbrk (void) +{ + const char *a = "test"; + + ASSERT (strpbrk (a, "e") == &a[1] ); + ASSERT (strpbrk (a, "z") == NULL ); + ASSERT (strpbrk (a, "et") == &a[0] ); + ASSERT (strpbrk (a, "ze") == &a[1] ); + ASSERT (strpbrk (a, "") == NULL ); + ASSERT (strpbrk ("", "e") == NULL ); + ASSERT (*strpbrk ("test2", "s") == 's' ); +} + +/** tests for strrchr +*/ +static void +do_teststrrchr (void) +{ + const char *test = "test"; + + ASSERT (strrchr (test, 0) == test + 4); + ASSERT (strrchr (test, 't') == test + 3); + ASSERT (strrchr (test, 'e') == test + 1); +} + +/** tests for strstr +*/ +static void +do_teststrstr (void) +{ + const char *a = "aabbcd"; + ASSERT (strstr (a, "\0\1") == a); + ASSERT (strstr (a, "") == a); + ASSERT (strstr (a, "ab") == &a[1]); + ASSERT (strstr (a, "abc") == NULL); + ASSERT (strstr (a, "abbc") == &a[1]); + ASSERT (strstr ("", "abbc") == NULL); +/* ASSERT (strstr ("", "") == a); should work, but it doesn't */ + ASSERT (strstr (a, "cd") == &a[4]); +} + +/** tests for strspn +*/ +static void +do_teststrspn (void) +{ + ASSERT (strspn("aabbcd", "ab") == 4); + ASSERT (strspn("abbacd", "") == 0); + ASSERT (strspn("abbacd", "ac") == 1); + ASSERT (strspn("abbacd", "x") == 0); + ASSERT (strspn("abbacd", "c") == 0); + ASSERT (strspn("abbacd", "cba") == 5); + ASSERT (strspn("abbacd", "cdba") == 6); +} + +/** tests for strtok +*/ +static void +do_teststrtok (void) +{ + static char str[] = "?a???b,,,#c"; + char str2[] = "axaaba"; + char *token = strtok (str, "?"); // 'token' points to the token "a" + ASSERT (token == &str[1] && 0 == strcmp (token,"a")); + token = strtok (NULL, ","); // 'token' points to the token "??b" + ASSERT (token == &str[3] && 0 == strcmp (token,"??b")); + token = strtok (NULL, "#,"); // 'token' points to the token "c" + ASSERT (token == &str[10] && 0 == strcmp (token,"c")); + token = strtok (NULL, "?"); // 'token' is a null pointer + ASSERT (token == NULL); + + token = strtok (str2, "ab"); + ASSERT (token && 0 == strcmp (token, "x")); + token = strtok (NULL, "ab"); + ASSERT (token == NULL); +#if !defined (__SUNPRO_C) && !defined (__sun__) + /* SunPro C compiler and GCC on Solaris have problem with strtok-ing after NULL */ + token = strtok (NULL, "a"); + ASSERT (token == NULL); +#endif +} + +/** tests for multibyte character sets + * related to bug #3506236 +*/ +static void +do_multibyte (void) +{ + const char *str = ""; + + ASSERT (str[0] == '\xd4'); + ASSERT (str[1] == '\xc2'); +} + +static void +teststr (void) +{ + do_teststrcmp (); + do_teststrcpy (); + do_teststrncmp (); + do_teststrpbrk (); + do_teststrrchr (); + do_teststrstr (); + do_teststrspn (); + do_teststrtok (); + do_multibyte (); +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/strncmp.c sdcc-3.2.0+dfsg/support/regression/tests/strncmp.c --- sdcc-3.1.0+dfsg/support/regression/tests/strncmp.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/strncmp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -/** tests for strncmp -*/ -#include -#include - -static void -teststrncmp(void) -{ - ASSERT( strncmp("", "", 0) == 0); - ASSERT( strncmp("ab", "ab", 0) == 0); - ASSERT( strncmp("a", "a", 2) == 0); - ASSERT( strncmp("aa", "ab", 1) == 0); - ASSERT( strncmp("aa", "ab", 2) < 0); - ASSERT( strncmp("abc", "abd", 2) == 0); - ASSERT( strncmp("abc", "abc", 3) == 0); -} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/strpbrk.c sdcc-3.2.0+dfsg/support/regression/tests/strpbrk.c --- sdcc-3.1.0+dfsg/support/regression/tests/strpbrk.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/strpbrk.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -/** tests for strpbrk - * related to bug #2908537 -*/ -#include -#include - -static void -teststrpbrk(void) -{ - const char *a = "test"; - - ASSERT( strpbrk(a, "e") == &a[1] ); - ASSERT( strpbrk(a, "z") == NULL ); - ASSERT( strpbrk(a, "et") == &a[0] ); - ASSERT( strpbrk(a, "ze") == &a[1] ); - ASSERT( strpbrk(a, "") == NULL ); - ASSERT( strpbrk("", "e") == NULL ); - ASSERT( *strpbrk("test2", "s") == 's' ); -} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/strspn.c sdcc-3.2.0+dfsg/support/regression/tests/strspn.c --- sdcc-3.1.0+dfsg/support/regression/tests/strspn.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/strspn.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -/** tests for strspn -*/ -#include -#include - -static void -teststrspn(void) -{ - ASSERT( strspn("aabbcd", "ab") == 4); - ASSERT( strspn("abbacd", "") == 0); - ASSERT( strspn("abbacd", "ac") == 1); - ASSERT( strspn("abbacd", "x") == 0); - ASSERT( strspn("abbacd", "c") == 0); - ASSERT( strspn("abbacd", "cba") == 5); - ASSERT( strspn("abbacd", "cdba") == 6); -} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/strstr.c sdcc-3.2.0+dfsg/support/regression/tests/strstr.c --- sdcc-3.1.0+dfsg/support/regression/tests/strstr.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/strstr.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -/** tests for strstr -*/ -#include -#include - -static void -teststrstr(void) -{ - const char *a = "aabbcd"; - ASSERT( strstr(a, "\0\1") == a); - ASSERT( strstr(a, "") == a); - ASSERT( strstr(a, "ab") == &a[1]); - ASSERT( strstr(a, "abc") == NULL); - ASSERT( strstr(a, "abbc") == &a[1]); - ASSERT( strstr("", "abbc") == NULL); -/* ASSERT( strstr("", "") == a); should work, but it doesn't */ - ASSERT( strstr(a, "cd") == &a[4]); -} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/strtok.c sdcc-3.2.0+dfsg/support/regression/tests/strtok.c --- sdcc-3.1.0+dfsg/support/regression/tests/strtok.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/strtok.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/** tests for strtok -*/ -#include -#include - -static void -teststrtok(void) -{ - static char str[] = "?a???b,,,#c"; - char str2[] = "axaaba"; - char *token = strtok(str, "?"); // 'token' points to the token "a" - ASSERT( token == &str[1] && 0 == strcmp(token,"a")); - token = strtok(NULL, ","); // 'token' points to the token "??b" - ASSERT( token == &str[3]&& 0 == strcmp(token,"??b")); - token = strtok(NULL, "#,"); // 'token' points to the token "c" - ASSERT( token == &str[10] && 0 == strcmp(token,"c")); - token = strtok(NULL, "?"); // 'token' is a null pointer - ASSERT( token == NULL); - - token = strtok (str2, "ab"); - ASSERT( token && 0 == strcmp (token, "x")); - token = strtok(NULL, "ab"); - ASSERT( token == NULL); -#if !defined (__SUNPRO_C) && !defined (__sun__) - /* SunPro C compiler and GCC on Solaris have problem with strtok-ing after NULL */ - token = strtok(NULL, "a"); - ASSERT( token == NULL); -#endif -} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/structscope.c sdcc-3.2.0+dfsg/support/regression/tests/structscope.c --- sdcc-3.1.0+dfsg/support/regression/tests/structscope.c 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/structscope.c 2012-03-04 10:14:57.000000000 +0000 @@ -0,0 +1,72 @@ +/* Test struct scoping rules + + */ + +#include + +/* declare an incomplete struct type */ +struct tag2; + +struct tag1 { + struct tag1 *mykind; + unsigned char x; + unsigned char y; + struct tag2 *other; +} s1; + +/* complete the previously incomplete type */ +struct tag2 { + unsigned char z; + struct tag1 *other; +} s2; + +void +test_global(void) +{ + s1.mykind = &s1; + s1.other = &s2; + s2.other = &s1; + s1.x = 1; + s1.y = 2; + s2.z = 3; + ASSERT(s2.other->x == 1); + ASSERT(s1.other->z == 3); + ASSERT(s1.other->other->y == 2); + ASSERT(s1.mykind->y == 2); +} + +void +test_nested(void) +{ + { + struct tag1 { + unsigned char a; + } ls1; + ls1.a=1; + } + { + struct tag1 ls2; /* should bind to global level tag1 */ + ls2.x=2; + } + { + struct tag1 { + unsigned char b; + struct tag2 *globals2; /* should bind to global level tag2 */ + } ls3; + ls3.b = 3; + ls3.globals2 = &s2; + } + { + struct tag2; /* incomplete local tag */ + struct tag1 { + struct tag2 *locals2; /* should bind to local level s2 tag */ + } ls4; + struct tag2 { + unsigned char c; + } ls5; + + ls4.locals2 = &ls5; + ls4.locals2->c = 9; + } + s1.x = 0; +} diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/swap.c sdcc-3.2.0+dfsg/support/regression/tests/swap.c --- sdcc-3.1.0+dfsg/support/regression/tests/swap.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/swap.c 2012-02-22 14:45:17.000000000 +0000 @@ -8,7 +8,7 @@ #define SWAP_4(x) ((unsigned char)((x)<<4)|(unsigned char)((x)>>4)) -#ifdef SDCC +#ifdef __SDCC typedef unsigned int uint16; typedef unsigned long uint32; #else @@ -47,7 +47,7 @@ x.i = SWAP_8(x.i); ASSERT( x.i == SWAP_8(TEST_VECT_16)); -#if defined (SDCC_mcs51) +#if defined (__SDCC_mcs51) /* this was filed as bug #1638622 (rejected) */ x.i = t; x.i = x.c[1] + 256*x.c[0]; @@ -104,9 +104,9 @@ /* now for something ugly */ static void testSwap_16_ptr(void) { -#if defined (SDCC) +#if defined (__SDCC) #include /* just to get _AUTOMEM or _STATMEM */ -#if defined (SDCC_STACK_AUTO) +#if defined (__SDCC_STACK_AUTO) #define MY_STATIC static #else #define MY_STATIC @@ -139,3 +139,4 @@ testSwap_16(); testSwap_16_ptr(); } + diff -Nru sdcc-3.1.0+dfsg/support/regression/tests/using.c sdcc-3.2.0+dfsg/support/regression/tests/using.c --- sdcc-3.1.0+dfsg/support/regression/tests/using.c 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/regression/tests/using.c 2012-02-22 14:45:17.000000000 +0000 @@ -5,7 +5,7 @@ #define _{using} -#if defined (SDCC_mcs51) && defined (SDCC_MODEL_SMALL) +#if defined (__SDCC_mcs51) && defined (__SDCC_MODEL_SMALL) #ifndef _no_proto #if defined (_both) @@ -28,7 +28,7 @@ void testUsing (void) { -#if defined (SDCC_mcs51) && defined (SDCC_MODEL_SMALL) +#if defined (__SDCC_mcs51) && defined (__SDCC_MODEL_SMALL) ASSERT ((unsigned char)(&array[0]) >= 0x10); ASSERT ((unsigned char)&__numTests >= 0x10); #endif diff -Nru sdcc-3.1.0+dfsg/support/scripts/gen_known_bugs.pl sdcc-3.2.0+dfsg/support/scripts/gen_known_bugs.pl --- sdcc-3.1.0+dfsg/support/scripts/gen_known_bugs.pl 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/scripts/gen_known_bugs.pl 2011-11-28 18:34:35.000000000 +0000 @@ -1,6 +1,6 @@ # gen_known_bugs.pl - generate knownbugs.html # -# Copyright (c) 2007 - 2008 Borut Razem +# Copyright (c) 2007-2011 Borut Razem # # This file is part of sdcc. # @@ -30,26 +30,41 @@ use HTML::TreeBuilder; -my @headerList = ('Request ID', 'Summary', 'Open Date', 'Priority', 'Status', 'Assigned To', 'Submitted By'); +# trim function to remove whitespace from the start and end of the string +sub trim($) +{ + my $string = shift; + $string =~ s/^\s+//; + $string =~ s/\s+$//; + return $string; +} +my @headerList = ('ID', 'Summary', 'Status', 'Opened', 'Assignee', 'Submitter', 'Resolution', 'Priority'); + # check if the line is a correct header sub is_header($) { my ($line) = @_; if (ref($line)) { - my $i = 0; - foreach ($line->look_down('_tag', 'td')) { - if ($_->as_text() ne $headerList[$i++]) { + my @headers = $line->look_down('_tag', 'th'); + foreach my $header (@headerList) { + my $found = 0; + foreach (@headers) { + my $content = trim($_->as_text()); + if ($content eq $header) { + $found = 1; + last; + } + } + if (!$found) { return 0; } } return 1; } - else { - return 0; - } + return 0; } @@ -70,31 +85,31 @@ my $i = 0; foreach ($line->look_down('_tag', 'td')) { - if ($i == 0) { - # remove nowrap attribute from 'Request ID' field - $_->attr('nowrap', undef); - } - elsif ($i == 1) { + #if ($headerList[$i] == 'ID') { + # # remove nowrap attribute from 'Request ID' field + # $_->attr('nowrap', undef); + #} + if ($headerList[$i] eq 'Summary') { # convert relative to absolute href in the 'Summary' field foreach ($_->look_down('_tag', 'a')) { my $attr = $_->attr('href'); - if (defined($attr) && $attr =~ m!^/tracker/index.php?!) { + if (defined($attr) && $attr =~ m!^/tracker/?!) { $_->attr('href', 'http://sourceforge.net' . $attr); } } } - elsif ($i == 2) { - # remove text formatting from 'Open Date' field - my $text = $_->as_text(); - $text =~ s/^\W*\**\W//; - $_->delete_content(); - $_->push_content($text); - } - elsif ($i == 4) { - # remove the 'Status' field + #elsif ($headerList[$i] == 'Opened') { + # # remove text formatting from 'Open Date' field + # my $text = $_->as_text(); + # $text =~ s/^\W*\**\W//; + # $_->delete_content(); + # $_->push_content($text); + #} + elsif ($headerList[$i] eq 'Status' || $headerList[$i] eq 'Resolution') { + # don't print Status and Resolution columns $_->delete(); } - elsif ($i == 5 || $i == 6) { + elsif ($headerList[$i] eq 'Assignee' || $headerList[$i] eq 'Submitter') { # remove hrefs in 'Assigned To' and 'Submitted By' fields foreach ($_->look_down('_tag', 'a')) { $_->replace_with($_->as_text()); @@ -118,11 +133,12 @@ # find table with the required header my $lines = 0; foreach my $table ($tree->look_down('_tag', 'table')) { - my @lines = $table->content_list(); - if (is_header($lines[0])) { - shift(@lines); #remove the header + my $thead = $table->look_down('_tag', 'thead'); + if (is_header($thead)) { + my $tbody = $table->look_down('_tag', 'tbody'); + my @lines = $tbody->content_list(); - # process the following lines in table + # process the lines in table # if they have required number of fields foreach my $line (@lines) { if (ref($line) && has_all_fields($line)) { @@ -157,6 +173,17 @@ SourceForge.net: Known Bugs +

Small Device C Compiler - Release $version Known Bug List

@@ -166,14 +193,15 @@ - - - - - - - EOF + + foreach my $header (@headerList) { + # don't print Status and Resolution columns + if ($header ne 'Status' && $header ne 'Resolution') { + print(' \n"); + } + } + print(" \n"); } @@ -187,15 +215,15 @@

Priority Colors:

Request IDSummaryOpen DatePriorityAssigned ToSubmitted By
' . $header . "
- - - - - - - - - + + + + + + + + +
123456789123456789
@@ -207,26 +235,27 @@ # main procedure { - my $url = "http://sourceforge.net/tracker/index.php?func=browse&group_id=599&atid=100599&set=custom&_assigned_to=0&_status=1&_category=100&_group=100&order=artifact_id&sort=DESC&offset="; + my $firstUrl = "http://sourceforge.net/tracker/?func=&group_id=599&atid=100599&assignee=&status=Open&category=&artgroup=&keyword=&submitter=&artifact_id=&assignee=&status=1&category=&artgroup=&submitter=&keyword=&artifact_id=&submit=Filter&limit=%d"; + my $nextUrl = "http://sourceforge.net/tracker/?words=tracker_browse&group_id=599&atid=100599&assignee=&status=1&category=&artgroup=&keyword=&submitter=&artifact_id=&offset=%d"; if ($#ARGV != 0) { printf("Usage: gen_known_bugs.pl \n"); exit(1); } + my $limit = 100; + # get the SDCC version number from command line my $version = $ARGV[0]; - my $lines = 0; # number of lines - # print HTML header print_header($version); # get pages from SF bug tracker - for (my $i = 0; my $html = get($url . $i); $i += 50) { - # and process them - last if (!(my $myLines = process_page($html))); - $lines += $myLines; + # and process them + my $lines = 0; + while (my $linesRead = process_page(get(($lines == 0) ? sprintf($firstUrl, $limit) : sprintf($nextUrl, $lines)))) { + $lines += $linesRead; } # print HTML footer diff -Nru sdcc-3.1.0+dfsg/support/scripts/inc2h-pic16.pl sdcc-3.2.0+dfsg/support/scripts/inc2h-pic16.pl --- sdcc-3.1.0+dfsg/support/scripts/inc2h-pic16.pl 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/scripts/inc2h-pic16.pl 2012-03-10 16:04:30.000000000 +0000 @@ -85,6 +85,21 @@ * * It has been automatically generated by $SCRIPT, * (c) 2007 by Raphael Neider + * + * SDCC is licensed under the GNU Public license (GPL) v2. Note that + * this license covers the code to the compiler and other executables, + * tbut explicitly does not cover any code or objects generated by sdcc. + * + * For pic device libraries and header files which are derived from + * Microchip header (.inc) and linker script (.lkr) files Microchip + * requires that "The header files should state that they are only to be + * used with authentic Microchip devices" which makes them incompatible + * with the GPL. Pic device libraries and header files are located at + * non-free/lib and non-free/include directories respectively. + * Sdcc should be run with the --use-non-free command line option in + * order to include non-free header files and libraries. + * + * See http://sdcc.sourceforge.net/ for the latest information on sdcc. */ #ifndef __PIC${proc}_H__ @@ -102,6 +117,21 @@ * * It has been automatically generated by $SCRIPT, * (c) 2007 by Raphael Neider + * + * SDCC is licensed under the GNU Public license (GPL) v2. Note that + * this license covers the code to the compiler and other executables, + * tbut explicitly does not cover any code or objects generated by sdcc. + * + * For pic device libraries and header files which are derived from + * Microchip header (.inc) and linker script (.lkr) files Microchip + * requires that "The header files should state that they are only to be + * used with authentic Microchip devices" which makes them incompatible + * with the GPL. Pic device libraries and header files are located at + * non-free/lib and non-free/include directories respectively. + * Sdcc should be run with the --use-non-free command line option in + * order to include non-free header files and libraries. + * + * See http://sdcc.sourceforge.net/ for the latest information on sdcc. */ #include <$header> diff -Nru sdcc-3.1.0+dfsg/support/scripts/inc2h.pl sdcc-3.2.0+dfsg/support/scripts/inc2h.pl --- sdcc-3.1.0+dfsg/support/scripts/inc2h.pl 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/scripts/inc2h.pl 2012-06-23 11:41:55.000000000 +0000 @@ -7,13 +7,18 @@ # License: # -# SDCC is licensed under the GNU Public license (GPL) v2. Note that +# SDCC is licensed under the GNU Public license (GPL) v2. Note that # this license covers the code to the compiler and other executables, # but explicitly does not cover any code or objects generated by sdcc. -# We have not yet decided on a license for the run time libraries, but -# it will not put any requirements on code linked against it. See: # -# http://www.gnu.org/copyleft/gpl.html +# For pic device libraries and header files which are derived from +# Microchip header (.inc) and linker script (.lkr) files Microchip +# requires that "The header files should state that they are only to be +# used with authentic Microchip devices" which makes them incompatible +# with the GPL. Pic device libraries and header files are located at +# non-free/lib and non-free/include directories respectively. +# Sdcc should be run with the --use-non-free command line option in +# order to include non-free header files and libraries. # # See http://sdcc.sourceforge.net/ for the latest information on sdcc. @@ -56,16 +61,17 @@ # Some testing beforehand would be appreciated, though. ##################################################################### -my $rcsid = q~$Id: inc2h.pl 7033 2011-11-11 22:34:21Z tecodev $~; +my $rcsid = q~$Id: inc2h.pl 7959 2012-06-23 11:41:55Z borutr $~; my ($junk, $file, $version, $date, $time, $programmer, $status) = split(/\s+/, $rcsid); my ($programName) = ($file =~ /(\S+)/); -if ($#ARGV < 0 || $#ARGV > 1 ) { +if ($#ARGV < 0 || $#ARGV > 2) { Usage(); } my $processor = uc(shift); my $path = shift; +my $emit_legacy_names = shift; my %sfrs = (); my %alias = (); my %bits = (); @@ -85,8 +91,8 @@ $name =~ s/OPTION(_REG)?/OPTION_REG/ig; # often declared as LCDDATn, but bits defined for LCDDATAn, 0 <= n <= 10 $name =~ s/LCDDAT([^A])/LCDDATA$1/ig; - # LCDSE2 is missing in some headers, but LCDSE3 is declared... - $name =~ s/LCDSE3/LCDSE2/ig; +# # LCDSE2 is missing in some headers, but LCDSE3 is declared... +# $name =~ s/LCDSE3/LCDSE2/ig; # XXX: should this be named LININTF or LINPRT? $name =~ s/LININTF/LINPRT/ig; # FIXME: duplicate declarations for n in {0,1,2} @@ -98,19 +104,19 @@ sub checkname { my $name = shift; if (not exists $sfrs{$name}) { - print "SFR $name not defined (yet).\n"; - # Find similar ones. - if (exists $sfrs{$name."0"}) { - print " but ".$name."0 exists---using that instead.\n"; - return $name."0"; - } - my $try = $name; - $try =~ s/[0-9]$//; - if (exists $sfrs{$try}) { - print " but $try exists---using that instead.\n"; - return $try; - } - die "Not found a similar SFR---aborting.\n"; + print "SFR $name not defined (yet).\n"; + # Find similar ones. + if (exists $sfrs{$name."0"}) { + print " but ".$name."0 exists---using that instead.\n"; + return $name."0"; + } + my $try = $name; + $try =~ s/[0-9]$//; + if (exists $sfrs{$try}) { + print " but $try exists---using that instead.\n"; + return $try; + } + die "Not found a similar SFR---aborting.\n"; } return $name; } @@ -121,40 +127,56 @@ my $arr = shift; foreach my $item (@$arr) { - return 1 if ($name eq $item); + return 1 if ($name eq $item); } return 0; } +# trim right and expand tabs +sub trim_and_expand ($) +{ + my $line = shift; + + # remove trailing spaces + $line =~ s/[ \t]+$//; + # expand tabs to spaces + while ($line =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) { + # spin in empty loop until substitution finally fails + } + return $line; +} + $path = "" if (!defined $path); if ($^O eq 'MSWin32') { if ($path eq '') { - if (defined($path = $ENV{'GPUTILS_HEADER_PATH'}) || defined($path = $ENV{'GPUTILS_LKR_PATH'})) { - $path .= '\\..'; - } - else { - die "Could not find gpasm includes.\n"; - } + if (defined($path = $ENV{'GPUTILS_HEADER_PATH'}) || defined($path = $ENV{'GPUTILS_LKR_PATH'})) { + $path .= '\\..'; + } + else { + die "Could not find gpasm includes.\n"; + } } $path_delim = '\\'; } else { # Nathan Hurst : find gputils on Debian if ($path eq '') { - if ( -x "/usr/share/gputils") { - $path = "/usr/share/gputils"; - } elsif ( -x "/usr/share/gpasm") { - $path = "/usr/share/gpasm"; - } elsif ( -x "/usr/local/share/gputils") { - $path = "/usr/local/share/gputils"; - } else { - die "Could not find gpasm includes.\n"; - } + if ( -x "/usr/share/gputils") { + $path = "/usr/share/gputils"; + } elsif ( -x "/usr/share/gpasm") { + $path = "/usr/share/gpasm"; + } elsif ( -x "/usr/local/share/gputils") { + $path = "/usr/local/share/gputils"; + } else { + die "Could not find gpasm includes.\n"; + } } $path_delim = '/'; } +$emit_legacy_names = 0 if (!defined $emit_legacy_names); + # # Read the symbols at the end of this file. # @@ -162,51 +184,51 @@ next if /^\s*#/; if (/^\s*alias\s+(\S+)\s+(\S+)/) { - # - # Set an alias for a special function register. - # Some MPASM include files are not entirely consistent - # with sfr names. - # - $alias{fixname($2)} = fixname($1); + # + # Set an alias for a special function register. + # Some MPASM include files are not entirely consistent + # with sfr names. + # + $alias{fixname($2)} = fixname($1); } elsif (/^\s*address\s+(\S+)\s+(\S+)/) { - # - # Set a default address for a special function register. - # Some MPASM include files don't specify the address - # of all registers. - # - # $addr{"$1"} = $2; - foreach my $device (split(/[,\s]+/, $devices)) { - $addr{"p$device", "$1"} = $2; - } + # + # Set a default address for a special function register. + # Some MPASM include files don't specify the address + # of all registers. + # + # $addr{"$1"} = $2; + foreach my $device (split(/[,\s]+/, $devices)) { + $addr{"p$device", "$1"} = $2; + } } elsif (/^\s*bitmask\s+(\S+)\s+/) { - # - # Set the bitmask that will be used in the 'memmap' pragma. - # - my $bitmask = "$1"; - foreach my $register (split(/\s+/, $')) { - $bitmasks{"$register"} = $bitmask; - } + # + # Set the bitmask that will be used in the 'memmap' pragma. + # + my $bitmask = "$1"; + foreach my $register (split(/\s+/, $')) { + $bitmasks{"$register"} = $bitmask; + } } elsif (/^\s*ram\s+(\S+)\s+(\S+)\s+(\S+)/) { - # This info is now provided in "include/pic/pic14devices.txt". - #$lo = $1; - #$hi = $2; - #my $bitmask = $3; - #foreach $device (split(/[,\s]+/, $devices)) { - # $ram{"p$device"} .= "#pragma memmap $lo $hi RAM $bitmask$'"; - #} + # This info is now provided in "include/pic/pic14devices.txt". + #$lo = $1; + #$hi = $2; + #my $bitmask = $3; + #foreach $device (split(/[,\s]+/, $devices)) { + # $ram{"p$device"} .= "#pragma memmap $lo $hi RAM $bitmask$'"; + #} } elsif (/^\s*processor\s+/) { - $devices = $'; - $type = ''; + $devices = $'; + $type = ''; } elsif (/^\s*(\S+)/) { - $type = $1; - $_ = $'; - foreach my $key (split) { - eval "\$types{'$key'} = $type;"; - } + $type = $1; + $_ = $'; + foreach my $key (split) { + eval "\$types{'$key'} = $type;"; + } } else { - foreach my $key (split) { - eval "\$types{'$key'} = $type;"; - } + foreach my $key (split) { + eval "\$types{'$key'} = $type;"; + } } } @@ -218,17 +240,17 @@ # || die "$programName: Error: Cannot open linker file $linkFile ($!)\n"; # while () { # if (/^(\S+)\s+NAME=(\S+)\s+START=(\S+)\s+END=(\S+)\s+(PROTECTED)?/) { -# $type = $1; -# $name = $2; -# $start = $3; -# $end = $4; -# $protected = 1 if ($5 =~ /protected/i); - -# if ($type =~ /(SHAREBANK)|(DATABANK)/i) { -# $ram{"p$processor"} .= -# sprintf("#pragma memmap %7s %7s RAM 0x000\t// $name\n", -# $start, $end); -# } +# $type = $1; +# $name = $2; +# $start = $3; +# $end = $4; +# $protected = 1 if ($5 =~ /protected/i); + +# if ($type =~ /(SHAREBANK)|(DATABANK)/i) { +# $ram{"p$processor"} .= +# trim_and_expand(sprintf("#pragma memmap %7s %7s RAM 0x000\t// $name\n", +# $start, $end)); +# } # } elsif (/^SECTION\s+NAME=(\S+)\s+ROM=(\S+)\s+/) { # } # } @@ -238,8 +260,24 @@ my $c_head = < @@ -262,167 +300,169 @@ || die "$programName: Error: Cannot open include file $includeFile ($!)\n"; while (
) { - + my $line = ''; + if (/^;-+ Register Files/i) { - $defaultType = 'sfr'; - s/;/\/\//; - $body .= "$_"; + $defaultType = 'sfr'; + s/;/\/\//; + $line .= "$_"; } elsif (/^;-+\s*(\S+)\s+Bits/i || /^;-+\s*(\S+)\s+-+/i) { - # The second case is usually bits, but the word Bits is missing + # The second case is usually bits, but the word Bits is missing # also accept "UIE/UIR Bits" - foreach my $name (split(/\//, $1)) { - $name = fixname($name); - $name = checkname($name); - - if (defined($alias{$name})) { - $defaultType = "bits $alias{$name}"; - } else { - $defaultType = "bits $name"; - } - } - s/;/\/\//; - $body .= "$_"; + foreach my $name (split(/\//, $1)) { + $name = fixname($name); + $name = checkname($name); + + if (defined($alias{$name})) { + $defaultType = "bits $alias{$name}"; + } else { + $defaultType = "bits $name"; + } + } + s/;/\/\//; + $line .= "$_"; } elsif (/^;=+/i) { - $defaultType = ''; - s/;/\/\//; - $body .= "$_"; + $defaultType = ''; + s/;/\/\//; + $line .= "$_"; } elsif (/^\s*;/) { - # - # Convert ASM comments to C style. - # - $body .= "//$'"; + # + # Convert ASM comments to C style. + # + $line .= "//$'"; } elsif (/^\s*IFNDEF\s+__(\S+)/) { - # - # Processor type. - # - $processor = $1; - $body .= "//$_"; + # + # Processor type. + # + $processor = $1; + $line .= "//$_"; } elsif (/^\s*(\S+)\s+EQU\s+H'(.+)'/) { - # - # Useful bit of information. - # - my $name = $1; - my $value = $2; - my $rest = $'; - my $bitmask = "0x0000"; - - $rest =~ s/;/\/\//; - chomp($rest); - - if (defined($types{"p$processor", "$name"})) { - $type = $types{"p$processor", "$name"}; - } elsif (defined($types{"$name"})) { - $type = $types{"$name"}; - } else { - $type = $defaultType; - } - #print "$name --> $type\n"; ## DEBUG - - if (defined($bitmasks{"p$processor", "$name"})) { - $bitmask = $bitmasks{"p$processor", "$name"}; -# } elsif (defined($bitmasks{"$name"})) { -# $bitmask = $bitmasks{"$name"}; - } - - if ($type eq 'sfr') { - # - # A special function register. - # -# $pragmas .= sprintf("#pragma memmap %s_ADDR %s_ADDR " -# . "SFR %s\t// %s\n", -# $name, $name, $bitmask, $name); - $name = fixname($name); - if (defined $addr{"p$processor", "$name"}) { - $addresses .= sprintf("#define %s_ADDR\t0x%s\n", $name, $addr{"p$processor", "$name"}); - } else { - $addresses .= sprintf("#define %s_ADDR\t0x%s\n", $name, $value); - } - $body .= sprintf("extern __sfr __at %-30s $name;$rest\n", "(${name}_ADDR)" ); - $c_head .= sprintf("__sfr __at %-30s $name;\n", "(${name}_ADDR)"); - $addr{"p$processor", "$name"} = "0x$value"; - $sfrs{$name}=1; - } elsif ($type eq 'volatile') { - # - # A location that can change without - # direct program manipulation. - # - $name = fixname($name); -# $pragmas .= sprintf("#pragma memmap %s_ADDR %s_ADDR " -# . "SFR %s\t// %s\n", -# $name, $name, $bitmask, $name); - $body .= sprintf("extern __data __at %-30s $name;$rest\n", "(${name}_ADDR) volatile char"); - $c_head .= sprintf("__data __at %-30s $name;\n", "(${name}_ADDR) volatile char"); - if (defined $addr{"p$processor", "$name"}) { - $addresses .= sprintf("#define %s_ADDR\t0x%s\n", $name, $addr{"p$processor", "$name"}); - } else { - $addresses .= sprintf("#define %s_ADDR\t0x%s\n", $name, $value); - } - } elsif ($type =~ /^bits/) { - my ($junk, $register) = split(/\s/, $type); - my $bit = hex($value); - my $addr = $addr{"$register"}; - - # prepare struct declaration - if (0) { # DEBUG - foreach my $key (keys %bits) { - print " $key\n"; - } - print "$register // $bit // ".$bits{"$register"}."\n"; - } - if (!defined $bits{"$register"}) { - $bits{"$register"} = {}; # reference to empty hash - } - if (!defined $bits{"$register"}->{oct($bit)}) { - $bits{"$register"}->{oct($bit)} = []; # reference to empty array - } - for (my $k=0; $k < scalar @{$bits{"$register"}->{oct($bit)}}; $k++) { - $name = "" if ($bits{"$register"}->{oct($bit)} eq $name) - } - if (($name ne "") - and (1 != contained($name, \@{$bits{"$register"}->{oct($bit)}})) - ) { - push @{$bits{"$register"}->{oct($bit)}}, $name; - } - } else { - # - # Other registers, bits and/or configurations. - # - $name = fixname($name); - if ($type eq 'other') { - # - # A known symbol. - # - $body .= sprintf("#define %-20s 0x%s$rest\n", $name, $value); - } else { - # - # A symbol that isn't defined in the data - # section at the end of the file. Let's - # add a comment so that we can add it later. - # - $body .= sprintf("#define %-20s 0x%s$rest\n", - $name, $value); - } - } + # + # Useful bit of information. + # + my $name = $1; + my $value = $2; + my $rest = $'; + my $bitmask = "0x0000"; + + $rest =~ s/;/\/\//; + chomp($rest); + + if (defined($types{"p$processor", "$name"})) { + $type = $types{"p$processor", "$name"}; + } elsif (defined($types{"$name"})) { + $type = $types{"$name"}; + } else { + $type = $defaultType; + } + #print "$name --> $type\n"; ## DEBUG + + if (defined($bitmasks{"p$processor", "$name"})) { + $bitmask = $bitmasks{"p$processor", "$name"}; +# } elsif (defined($bitmasks{"$name"})) { +# $bitmask = $bitmasks{"$name"}; + } + + if ($type eq 'sfr') { + # + # A special function register. + # +# $pragmas .= trim_and_expand(sprintf("#pragma memmap %s_ADDR %s_ADDR " +# . "SFR %s\t// %s\n", +# $name, $name, $bitmask, $name)); + $name = fixname($name); + if (defined $addr{"p$processor", "$name"}) { + $addresses .= trim_and_expand(sprintf("#define %s_ADDR\t0x%s\n", $name, $addr{"p$processor", "$name"})); + } else { + $addresses .= trim_and_expand(sprintf("#define %s_ADDR\t0x%s\n", $name, $value)); + } + $line .= sprintf("extern __sfr __at %-30s $name;$rest\n", "(${name}_ADDR)" ); + $c_head .= sprintf("__sfr __at %-30s $name;\n", "(${name}_ADDR)"); + $addr{"p$processor", "$name"} = $value; + $sfrs{$name}=1; + } elsif ($type eq 'volatile') { + # + # A location that can change without + # direct program manipulation. + # + $name = fixname($name); +# $pragmas .= trim_and_expand(sprintf("#pragma memmap %s_ADDR %s_ADDR " +# . "SFR %s\t// %s\n", +# $name, $name, $bitmask, $name)); + $line .= sprintf("extern __data __at %-30s $name;$rest\n", "(${name}_ADDR) volatile char"); + $c_head .= sprintf("__data __at %-30s $name;\n", "(${name}_ADDR) volatile char"); + if (defined $addr{"p$processor", "$name"}) { + $addresses .= trim_and_expand(sprintf("#define %s_ADDR\t0x%s\n", $name, $addr{"p$processor", "$name"})); + } else { + $addresses .= trim_and_expand(sprintf("#define %s_ADDR\t0x%s\n", $name, $value)); + } + } elsif ($type =~ /^bits/) { + my ($junk, $register) = split(/\s/, $type); + my $bit = hex($value); + my $addr = $addr{"$register"}; + + # prepare struct declaration + if (0) { # DEBUG + foreach my $key (keys %bits) { + print " $key\n"; + } + print "$register // $bit // ".$bits{"$register"}."\n"; + } + if (!defined $bits{"$register"}) { + $bits{"$register"} = {}; # reference to empty hash + } + if (!defined $bits{"$register"}->{oct($bit)}) { + $bits{"$register"}->{oct($bit)} = []; # reference to empty array + } + for (my $k=0; $k < scalar @{$bits{"$register"}->{oct($bit)}}; $k++) { + $name = "" if ($bits{"$register"}->{oct($bit)} eq $name) + } + if (($name ne "") + and (1 != contained($name, \@{$bits{"$register"}->{oct($bit)}})) + ) { + push @{$bits{"$register"}->{oct($bit)}}, $name; + } + } else { + # + # Other registers, bits and/or configurations. + # + $name = fixname($name); + if ($type eq 'other') { + # + # A known symbol. + # + $line .= sprintf("#define %-20s 0x%s$rest\n", $name, $value); + } else { + # + # A symbol that isn't defined in the data + # section at the end of the file. Let's + # add a comment so that we can add it later. + # + $line .= sprintf("#define %-20s 0x%s$rest\n", + $name, $value); + } + } } elsif (/^\s*$/) { - # - # Blank line. - # - $body .= "\n"; + # + # Blank line. + # + $line .= "\n"; } elsif (/__MAXRAM\s+H'([0-9a-fA-F]+)'/) { - my $maxram .= "//\n// Memory organization.\n//\n"; - if (!defined $ram{"p$processor"}) { - $ram{"p$processor"} = ""; - } - $pragmas = $maxram - . $ram{"p$processor"} . "\n" - . $pragmas; - $body .= "// $_"; + my $maxram .= "//\n// Memory organization.\n//\n"; + if (!defined $ram{"p$processor"}) { + $ram{"p$processor"} = ""; + } + $pragmas = $maxram + . $ram{"p$processor"} . "\n" + . $pragmas; + $line .= "// $_"; } else { - # - # Anything else we'll just comment out. - # - $body .= "// $_"; + # + # Anything else we'll just comment out. + # + $line .= "// $_"; } + $body .= trim_and_expand($line); } $header .= <) { - s/\r//g; chomp; - if(/^\s*(\*|\w*)\s*([ABCDE0-7,-]+)\s*$/) { - if(lc($1) eq lc($processor)) { - die if defined $pinfo; - $pinfo = $2; - } elsif($1 eq "*") { - die if defined $defpinfo; - $defpinfo = $2; - } - } elsif(/^\s*#/ || /^\s*$/) { - # ignore blanks, comments - } else { - die "bad line in pic14ports '$_'"; - } + s/\r//g; chomp; + if(/^\s*(\*|\w*)\s*([ABCDE0-7,-]+)\s*$/) { + if(lc($1) eq lc($processor)) { + die if defined $pinfo; + $pinfo = $2; + } elsif($1 eq "*") { + die if defined $defpinfo; + $defpinfo = $2; + } + } elsif(/^\s*#/ || /^\s*$/) { + # ignore blanks, comments + } else { + die "bad line in pic14ports '$_'"; + } } close P14PORTS; }; @@ -492,18 +537,18 @@ if(defined $pinfo) { foreach (split /,/, $pinfo) { - if(/^([ABCDE])([0-7])-([0-7])$/) { - my($prt, $low, $high) = ($1, $2, $3); - next unless defined $sfrs{"PORT$prt"} && defined $sfrs{"TRIS$prt"}; - next if defined $bits{"PORT$prt"}; - for(my $i = $low; $i <= $high; $i++) { - push @{$bits{"PORT$prt"}->{oct($i)}}, "R$prt".$i; - } - next if defined $bits{"TRIS$prt"}; - for(my $i = $low; $i <= $high; $i++) { - push @{$bits{"TRIS$prt"}->{oct($i)}}, "TRIS$prt".$i; - } - } else { die } + if(/^([ABCDE])([0-7])-([0-7])$/) { + my($prt, $low, $high) = ($1, $2, $3); + next unless defined $sfrs{"PORT$prt"} && defined $sfrs{"TRIS$prt"}; + next if defined $bits{"PORT$prt"}; + for(my $i = $low; $i <= $high; $i++) { + push @{$bits{"PORT$prt"}->{oct($i)}}, "R$prt".$i; + } + next if defined $bits{"TRIS$prt"}; + for(my $i = $low; $i <= $high; $i++) { + push @{$bits{"TRIS$prt"}->{oct($i)}}, "TRIS$prt".$i; + } + } else { die } } } } @@ -523,24 +568,24 @@ for (my $i=0; $i < 8; $i++) { if (!defined $bits{$reg}) { - #print "bits{$reg} undefined\n"; + #print "bits{$reg} undefined\n"; } if (!defined $bits{$reg}->{oct($i)}) { - #print "bits{$reg}->{".oct($i)."} undefined\n"; - $bits{$reg}->{oct($i)} = []; # empty array reference + #print "bits{$reg}->{".oct($i)."} undefined\n"; + $bits{$reg}->{oct($i)} = []; # empty array reference } my @names = @{$bits{$reg}->{oct($i)}}; if ($max < scalar @names) { $max = scalar @names; } if ($idx >= scalar @names) { - $structs .= " unsigned char :1;\n"; + $structs .= " unsigned char :1;\n"; } else { # (1 == scalar @names) { - $structs .= " unsigned char " . $names[$idx] . ":1;\n"; + $structs .= " unsigned char " . $names[$idx] . ":1;\n"; # } else { -# $structs .= " union {\n"; -# foreach $name (@names) { -# $structs .= " unsigned char " . $name . ":1;\n"; -# } # foreach -# $structs .= " };\n"; +# $structs .= " union {\n"; +# foreach $name (@names) { +# $structs .= " unsigned char " . $name . ":1;\n"; +# } # foreach +# $structs .= " };\n"; } } # for $structs .= " };\n"; @@ -603,7 +648,7 @@ . $body . "\n" . $structs . "\n" . $defs - . $legacy + . ($emit_legacy_names ? $legacy : "") . "#endif\n"; close(HEAD); @@ -612,31 +657,34 @@ close DEFS; sub Usage { - print STDERR < +# Modified to the pic14 series: Molnár Károly, 2012 +# +# This file is part of SDCC. +# +# SDCC 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. +# +# SDCC 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 SDCC. If not, see . +# + +# +# Usage: perl pic16fam-h-gen.pl +# +# This will create pic16fam.h.gen in your current directory. +# Check sanity of the file and move it to .../include/pic14/pic16fam.h. +# If you assigned new I/O styles, implement them in +# .../include/pic14/{adc,i2c,usart}.h and +# .../lib/pic14/libio/*/*.c +# + +use strict; + +my $head = '__SDCC_PIC'; + +my %families = (); +my @enhanced = (); +my %adc = (); +my %usart = (); +my %ssp = (); +my $update = 'Please update your pic14/pic16fam.h manually and/or inform the maintainer.'; + +my $ref; + +#------------------------------------------------------------------------------- + +sub find_list($$) + { + my ($list, $name) = @_; + + foreach my $n (@{$list}) + { + return 1 if ($n eq $name); + } + + return 0; + } + +#------------------------------------------------------------------------------- + +sub find_pic($$) + { + my ($hash, $name) = @_; + + for my $k (sort keys %{$hash}) + { + if ($k != 0) + { + return 1 if (find_list(\@{${$hash}{$k}}, $name)); + } + } + + return 0; + } + +#------------------------------------------------------------------------------- + +sub array_filter($) + { + my $hash = $_[0]; + my $null = \@{${$hash}{0}}; + my @array = (); + + foreach my $n (@{$null}) + { + if (! find_pic($hash, $n) && ! find_list(\@array, $n)) + { + push(@array, $n); + } + } + + @{${$hash}{0}} = @array; + } + +#------------------------------------------------------------------------------- + +while () { + chomp; + s/\s*#.*$//; # remove comments + s/\s*//g; # strip whitespace + next if (/^\s*$/); # ignore empty lines + + my $line = $_; + + my @fields = split(/:/, $line); + + die "Invalid record >$line<" if (scalar @fields != 6); + + my ($id, $memberlist, $enh, $adcstyle, $usartstyle, $sspstyle) = @fields; + + # extract numeric family id + $id = 0+$id; + + # extract family members + my @arr = split(/,/, $memberlist); + @arr = sort(map { uc($_); } @arr); + $families{$id} = \@arr; + + # enhanced class + $enh = 0+$enh; + if ($enh) { + push @enhanced, @arr; + } + + # ADC style per device family + $adcstyle = 0+$adcstyle; + push @{$adc{$adcstyle}}, @arr; + + # (E)USART style per device family + $usartstyle = 0+$usartstyle; + push @{$usart{$usartstyle}}, @arr; + + # SSP style per device family + $sspstyle = 0+$sspstyle; + push @{$ssp{$sspstyle}}, @arr; +} + +array_filter(\%adc); +array_filter(\%usart); +array_filter(\%ssp); + +my $fname = 'pic16fam.h.gen'; +open(FH, '>', $fname) or die "Could not open >$fname<"; + +print FH <:{,}:::: +# +# Each line provides a colon separated list of +# * a numeric family name, derived from the first family member as follows: +# enhanced MCU: 1(F|LF)? -> printf("1%u%04u0", , ) +# ADC : 1(C|F|HV|LF)? -> printf("1%u%04u1", , ) +# USART : 1(C|F|HV|LF)? -> printf("1%u%04u2", , ) +# SSP : 1(C|F|HV|LF)? -> printf("1%u%04u3", , ) +# * a comma-separated list of members of a device family, +# where a family comprises all devices that share a single data sheet, +# * the enhanced MCU (numeric family name or 0, if not applicable) +# * the ADC style (numeric family name or 0, if not applicable) +# * the USART style (numeric family name or 0, if not applicable) +# * the SSP style (numeric family name or 0, if not applicable) +# +# This data has been gathered manually from data sheets published by +# Microchip Technology Inc. +# + +# enhanced MCU +1218220:12f1822,12f1840:1218220:0:0:0 +1615030:16f1503,16f1507,16f1508,16f1509,16f1516,16f1517,16f1518,16f1519,16f1526,16f1527:1615030:0:0:0 +1617820:16f1782,16f1783:1617820:0:0:0 +1618230:16f1823,16f1824,16f1825,16f1826,16f1827,16f1828,16f1829,16f1847:1618230:0:0:0 +1619330:16f1933,16f1934,16f1936,16f1937,16f1938,16f1939,16f1946,16f1947:1619330:0:0:0 +1619020:16lf1902,16lf1903,16lf1904,16lf1906,16lf1907:1619020:0:0:0 + +# ADC +1206751:12f675,12f683:0:1206751:0:0 +1218221:12f1822,12f1840:0:1218221:0:0 +1600711:16c71,16c710,16c711:0:1600711:0:0 +1600721:16c72,16f72,16c73b,16f73,16f76:0:1600721:0:0 +1600741:16c74b,16f74,16f77:0:1600741:0:0 +1604331:16c433:0:1604331:0:0 +1607151:16c715:0:1607151:0:0 +1607171:16c717,16c770,16c771:0:1607171:0:0 +1607451:16c745:0:1607451:0:0 +1607651:16c765:0:1607651:0:0 +1607731:16c773:0:1607731:0:0 +1607741:16c774:0:1607741:0:0 +1607811:16c781,16c782:0:1607811:0:0 +1609251:16c925,16c926,16f870,16f872,16f873,16f873a,16f876,16f876a:0:1609251:0:0 +1600881:16f88:0:1600881:0:0 +1606161:16f616,16hv616:0:1606161:0:0 +1606761:16f676,16f684,16f688:0:1606761:0:0 +1606851:16f685,16f687,16f689,16f690:0:1606851:0:0 +1607161:16f716:0:1607161:0:0 +1607201:16f720,16f721:0:1607201:0:0 +1607371:16f737,16f767:0:1607371:0:0 +1607471:16f747,16f777:0:1607471:0:0 +1607851:16f785:0:1607851:0:0 +1608181:16f818,16f819:0:1608181:0:0 +1608711:16f871,16f874,16f874a,16f877,16f877a:0:1608711:0:0 +1608821:16f882,16f883,16f886:0:1608821:0:0 +1608841:16f884,16f887:0:1608841:0:0 +1609131:16f913,16f916:0:1609131:0:0 +1609141:16f914,16f917,16f946:0:1609141:0:0 +1615031:16f1503:0:1615031:0:0 +1615071:16f1507,16f1508,16f1509:0:1615071:0:0 +1615161:16f1516,16f1518:0:1615161:0:0 +1615171:16f1517,16f1519:0:1615171:0:0 +1615261:16f1526,16f1527:0:1615261:0:0 +1617821:16f1782,16f1783:0:1617821:0:0 +1618231:16f1823:0:1618231:0:0 +1618241:16f1824,16f1825:0:1618241:0:0 +1618261:16f1826,16f1827,16f1847:0:1618261:0:0 +1618281:16f1828,16f1829:0:1618281:0:0 +1619331:16f1933,16f1936,16f1938:0:1619331:0:0 +1619341:16f1934,16f1937,16f1939:0:1619341:0:0 +1619461:16f1946,16f1947:0:1619461:0:0 +1619021:16lf1902,16lf1903,16lf1906:0:1619021:0:0 +1619041:16lf1904,16lf1907:0:1619041:0:0 + +# (E)USART +1218222:12f1822,12f1840:0:0:1218222:0 +1600632:16c63a,16c65b,16c73b,16c74b,16c745,16c765,16f73,16f74,16f76,16f77:0:0:1600632:0 +1600872:16f87,16f88:0:0:1600872:0 +1606272:16f627,16f627a,16f628,16f628a,16f648a:0:0:1606272:0 +1606872:16f687,16f689,16f690:0:0:1606872:0 +1606882:16f688:0:0:1606882:0 +1607202:16f720,16f721:0:0:1607202:0 +1607732:16c773,16c774,16f737,16f747,16f767,16f777,16f870,16f871,16f873,16f873a,16f874,16f874a,16f876,16f876a,16f877,16f877a,16f913,16f914,16f916,16f917,16f946:0:0:1607732:0 +1608822:16f882,16f883,16f884,16f886,16f887:0:0:1608822:0 +1615082:16f1508,16f1509:0:0:1615082:0 +1615162:16f1516,16f1517,16f1518,16f1519,16f1933,16f1934,16f1936,16f1937,16f1938,16f1939,16lf1904,16lf1906,16lf1907:0:0:1615162:0 +1615262:16f1526,16f1527:0:0:1615262:0 +1617822:16f1782,16f1783:0:0:1617822:0 +1618232:16f1823,16f1824,16f1825:0:0:1618232:0 +1618262:16f1826,16f1827,16f1847:0:0:1618262:0 +1618282:16f1828,16f1829:0:0:1618282:0 +1619462:16f1946,16f1947:0:0:1619462:0 + +# SSP +1218223:12f1822,12f1840:0:0:0:1218223 +1600623:16c62,16c72:0:0:0:1600623 +1600633:16c63a,16c65b,16c73b,16c74b:0:0:0:1600633 +1607173:16c717,16c770,16c771:0:0:0:1607173 +1607733:16c773,16c774:0:0:0:1607733 +1609253:16c925,16c926:0:0:0:1609253 +1600723:16f72,16f73,16f74,16f76,16f77:0:0:0:1600723 +1600873:16f87,16f88,16f818,16f819:0:0:0:1600873 +1606873:16f687,16f689,16f690,16f720,16f721:0:0:0:1606873 +1607373:16f737,16f747,16f767,16f777,16f872,16f873,16f873a,16f874,16f874a,16f876,16f876a,16f877,16f877a,16f882,16f883,16f884,16f886,16f887:0:0:0:1607373 +1609133:16f913,16f914,16f916,16f917,16f946:0:0:0:1609133 +1615033:16f1503:0:0:0:1615033 +1615083:16f1508,16f1509:0:0:0:1615083 +1615173:16f1516,16f1517,16f1518,16f1519:0:0:0:1615173 +1615263:16f1526,16f1527:0:0:0:1615263 +1617823:16f1782,16f1783:0:0:0:1617823 +1618233:16f1823,16f1824,16f1825:0:0:0:1618233 +1618263:16f1826:0:0:0:1618263 +1618273:16f1827,16f1847:0:0:0:1618273 +1618283:16f1828:0:0:0:1618283 +1618293:16f1829:0:0:0:1618293 +1619333:16f1933,16f1934,16f1936,16f1937,16f1938,16f1939:0:0:0:1619333 +1619463:16f1946,16f1947:0:0:0:1619463 diff -Nru sdcc-3.1.0+dfsg/support/scripts/pic18fam-h-gen.pl sdcc-3.2.0+dfsg/support/scripts/pic18fam-h-gen.pl --- sdcc-3.1.0+dfsg/support/scripts/pic18fam-h-gen.pl 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/scripts/pic18fam-h-gen.pl 2012-06-02 13:19:46.000000000 +0000 @@ -36,6 +36,8 @@ use strict; +my $head = '__SDCC_PIC'; + my %families = (); my %adc = (); my %usart = (); @@ -45,7 +47,7 @@ chomp; s/\s*#.*$//; # remove comments s/\s*//g; # strip whitespace - next if (/^\s*$/); # ignore empty lines + next if (/^\s*$/); # ignore empty lines my $line = $_; @@ -60,8 +62,7 @@ # extract family members my @arr = split(/,/, $memberlist); - @arr = map { lc($_); } @arr; - @arr = sort @arr; + @arr = sort(map { uc($_); } @arr); $families{$id} = \@arr; # ADC style per device family @@ -101,7 +102,7 @@ my $pp = "#if "; for my $id (sort keys %families) { my $list = $families{$id}; - my $memb = "defined(pic" . join(") \\\n || defined(pic", @$list) . ")"; + my $memb = "defined($head" . join(") \\\n || defined($head", @$list) . ")"; print FH < " 1>&2 + echo "Usage: repack_release.sh " 1>&2 exit 1; } +function download() { - if [ $# != 3 ] + local date=$1 revision=$2 + + mkdir -p dl + + if ! pushd dl then - usage + fatal_error "Can't cd to dl!" + else + wget http://sourceforge.net/projects/sdcc/files/snapshot_builds/sdcc-src/sdcc-src-${date}-${revision}.tar.bz2 + + wget http://sourceforge.net/projects/sdcc/files/snapshot_builds/docs/sdcc-doc-${date}-${revision}.tar.bz2 + + wget http://sourceforge.net/projects/sdcc/files/snapshot_builds/docs/sdcc-doc-${date}-${revision}.zip + + wget http://sourceforge.net/projects/sdcc/files/snapshot_builds/i386-unknown-linux2.5/sdcc-snapshot-i386-unknown-linux2.5-${date}-${revision}.tar.bz2 + + wget http://sourceforge.net/projects/sdcc/files/snapshot_builds/i586-mingw32msvc/sdcc-snapshot-i586-mingw32msvc-${date}-${revision}.zip + + wget http://sourceforge.net/projects/sdcc/files/snapshot_builds/i586-mingw32msvc-setup/sdcc-${date}-${revision}-setup.exe + + wget http://sourceforge.net/projects/sdcc/files/snapshot_builds/i386_universal-apple-macosx/sdcc-snapshot-i386_universal-apple-macosx-${date}-${revision}.tar.bz2 + + mv sdcc-snapshot-i386_universal-apple-macosx-${date}-${revision}.tar.bz2 sdcc-snapshot-universal-apple-macosx-${date}-${revision}.tar.bz2 + + popd fi +} - bin_pkg=$1 - doc_pkg=$2 - ver=$3 - arch=$(expr $(basename $bin_pkg) : 'sdcc-snapshot-\([^-]*-[^-]*-[^-]*\)-.*\.tar\.bz2') - if [ -z "$arch" ] +function unpack() +{ + local bin_pkg=$1 doc_pkg=$2 + + if [ -z "$(expr $(basename $bin_pkg) : 'sdcc-snapshot-\([^-]*-[^-]*-[^-]*\)-.*\.tar\.bz2')" ] then fatal_error "$bin_pkg is not a sdcc binary package!" fi @@ -49,13 +72,137 @@ tar -xjvf $bin_pkg || fatal_error "Can't unpack $bin_pkg!" + # remove unneeded directories produced by sdbinutils + rm -rf ./sdcc/include + rm -rf ./sdcc/lib + rm -rf ./sdcc/share/doc rm -rf ./sdcc/share/sdcc/doc + tar -xjvf $doc_pkg -C ./sdcc/share/sdcc || fatal_error "Can't unpack $doc_pkg!" +} + + +function pack() +{ + local arch=$1 ver=$2 + cp ./sdcc/share/sdcc/doc/INSTALL.txt ./sdcc cp ./sdcc/share/sdcc/doc/README.txt ./sdcc - tar -cjvf sdcc-$ver-$arch.tar.bz2 sdcc || fatal_error "Can't pack sdcc-$ver-$arch.tar.bz2!" - mv sdcc $arch + + mkdir -p ul + + tar -cjvf ul/sdcc-${ver}-${arch}.tar.bz2 sdcc || fatal_error "Can't pack ul/sdcc-${ver}-${arch}.tar.bz2!" + mv sdcc ${arch} +} + + +function repack_win() +{ + local date=$1 revision=$2 ver=$3 + + snapshot=~/svn_snapshots/sdcc/sdcc + ver_maj=$(expr $ver : '\([0-9]*\)\.') + ver_min=$(expr $ver : '[0-9]*\.\([0-9]*\)\.') + ver_rev=$(expr $ver : '[0-9]*\.[0-9]*\.\([0-9]*\)') + + # - unpack WIN32 mingw daily snapshot sdcc-snapshot-i586-mingw32msvc-yyyymmdd-rrrr.zip + # to a clean directory (the option to create directories should be enabled). + # A sub directory sdcc is created (referenced as PKGDIR in continuation). + unzip dl/sdcc-snapshot-i586-mingw32msvc-${date}-${revision}.zip + + if ! pushd sdcc + then + fatal_error "Can't cd to sdcc!" + else + # - remove the PKGDIR/doc/ directory + rm -rf doc/ + + # - unpack sdcc-doc-yyyymmdd-rrrr.zip to the PKGDIR/doc directory + unzip ../dl/sdcc-doc-${date}-${revision}.zip + + # - copy files sdcc/support/scripts/sdcc.ico and sdcc/support/scripts/sdcc.nsi + # (this file) from the sdcc Subversion snapshot to the PKGDIR directory + cp ${snapshot}/support/scripts/sdcc.nsi ${snapshot}/support/scripts/sdcc.ico . + + # - copy file COPYING and COPYING3 from the sdcc Subversion snapshot to the PKGDIR directory, + # rename it to COPYING.txt and COPYING3.txt and convert it to DOS format: + cp ${snapshot}/COPYING COPYING.txt + todos COPYING.txt + cp ${snapshot}/sdas/COPYING3 COPYING3.txt + todos COPYING3.txt + cp ${snapshot}/ChangeLog doc/ChangeLog.txt + todos doc/ChangeLog.txt + cp ${snapshot}/README doc/README.txt + todos doc/README.txt + + # - run NSIS installer from PKGDIR directory: + # Define -DWIN64 if createing a 64bit package. + makensis -DFULL_DOC -DVER_MAJOR=${ver_maj} -DVER_MINOR=${ver_min} -DVER_REVISION=${ver_rev} -DVER_BUILD=${revision} sdcc.nsi + + # - A setup file setup.exe is created in PKGDIR directory. + # Rename it to sdcc-x.x.x-setup.exe and upload it + # to sdcc download repository at sourceforge.net + cp setup.exe ../ul/sdcc-${ver}-setup.exe + + popd + fi +} + + +function upload() +{ + local ver=$1 + + raw_ver=$(expr $ver : '\([0-9]*\.[0-9]*\.[0-9]*\)') + + echo uploading ul/sdcc-src-${ver}.tar.bz2 sdcc-builder@web.sourceforge.net:/home/pfs/project/sdcc/sdcc/${raw_ver} + rsync -e ssh ul/sdcc-src-${ver}.tar.bz2 sdcc-builder@web.sourceforge.net:/home/pfs/project/sdcc/sdcc/${raw_ver} + + echo uploading ul/sdcc-doc-${ver}.tar.bz2 sdcc-builder@web.sourceforge.net:/home/pfs/project/sdcc/sdcc-doc/${raw_ver} + rsync -e ssh ul/sdcc-doc-${ver}.tar.bz2 sdcc-builder@web.sourceforge.net:/home/pfs/project/sdcc/sdcc-doc/${raw_ver} + + echo uploading ul/sdcc-doc-${ver}.zip sdcc-builder@web.sourceforge.net:/home/pfs/project/sdcc/sdcc-doc/${raw_ver} + rsync -e ssh ul/sdcc-doc-${ver}.zip sdcc-builder@web.sourceforge.net:/home/pfs/project/sdcc/sdcc-doc/${raw_ver} + + echo uploading ul/sdcc-${ver}-setup.exe sdcc-builder@web.sourceforge.net:/home/pfs/project/sdcc/sdcc-win32/${raw_ver} + rsync -e ssh ul/sdcc-${ver}-setup.exe sdcc-builder@web.sourceforge.net:/home/pfs/project/sdcc/sdcc-win32/${raw_ver} + + echo uploading ul/sdcc-${ver}-i386-unknown-linux2.5.tar.bz2 sdcc-builder@web.sourceforge.net:/home/pfs/project/sdcc/sdcc-linux-x86/${raw_ver} + rsync -e ssh ul/sdcc-${ver}-i386-unknown-linux2.5.tar.bz2 sdcc-builder@web.sourceforge.net:/home/pfs/project/sdcc/sdcc-linux-x86/${raw_ver} + + echo uploading ul/sdcc-${ver}-universal-apple-macosx.tar.bz2 sdcc-builder@web.sourceforge.net:/home/pfs/project/sdcc/sdcc-macosx/${raw_ver} + rsync -e ssh ul/sdcc-${ver}-universal-apple-macosx.tar.bz2 sdcc-builder@web.sourceforge.net:/home/pfs/project/sdcc/sdcc-macosx/${raw_ver} +} + + +{ + if [ $# != 3 ] + then + usage + fi + + date=$1 + revision=$2 + ver=$3 + + mkdir -p ul + + download $date $revision + + cp dl/sdcc-src-${date}-${revision}.tar.bz2 ul/sdcc-src-${ver}.tar.bz2 + cp dl/sdcc-doc-${date}-${revision}.tar.bz2 ul/sdcc-doc-${ver}.tar.bz2 + cp dl/sdcc-doc-${date}-${revision}.zip ul/sdcc-doc-${ver}.zip + + for arch in i386-unknown-linux2.5 universal-apple-macosx + do + unpack dl/sdcc-snapshot-${arch}-${date}-${revision}.tar.bz2 dl/sdcc-doc-${date}-${revision}.tar.bz2 + pack $arch $ver + done + + repack_win $date $revision $ver + + upload $ver exit 0 } diff -Nru sdcc-3.1.0+dfsg/support/scripts/sdcc.nsi sdcc-3.2.0+dfsg/support/scripts/sdcc.nsi --- sdcc-3.1.0+dfsg/support/scripts/sdcc.nsi 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/scripts/sdcc.nsi 2012-06-30 20:48:20.000000000 +0000 @@ -291,8 +291,13 @@ ${DebugMsg} "Pre INSTDIR = $INSTDIR" ${If} ${RunningX64} + !ifdef WIN64 StrCpy $INSTDIR "$PROGRAMFILES64\${PRODUCT_NAME}" SetRegView 64 + !else + StrCpy $INSTDIR "$PROGRAMFILES\${PRODUCT_NAME}" + SetRegView 32 + !endif ${Else} !ifdef WIN64 MessageBox MB_OK|MB_ICONSTOP \ @@ -341,7 +346,11 @@ ${DebugMsg} "Pre INSTDIR = $INSTDIR" ${If} ${RunningX64} + !ifdef WIN64 SetRegView 64 + !else + SetRegView 32 + !endif ${Endif} Push $R0 @@ -374,7 +383,9 @@ File "${SDCC_ROOT}\bin\sdldgb.exe" File "${SDCC_ROOT}\bin\sdld6808.exe" File "${SDCC_ROOT}\bin\sdldz80.exe" + File "${SDCC_ROOT}\bin\sdar.exe" File "${SDCC_ROOT}\bin\sdranlib.exe" + File "${SDCC_ROOT}\bin\sdnm.exe" File "${SDCC_ROOT}\bin\makebin.exe" File "${SDCC_ROOT}\bin\packihx.exe" File "${SDCC_ROOT}\bin\sdcc.exe" @@ -435,6 +446,8 @@ File "${DEV_ROOT}\include\asm\z180\features.h" SetOutPath "$INSTDIR\include\asm\r2k" File "${DEV_ROOT}\include\asm\r2k\features.h" + SetOutPath "$INSTDIR\include\asm\r3ka" + File "${DEV_ROOT}\include\asm\r3ka\features.h" SetOutPath "$INSTDIR\include\ds390" File "${DEV_ROOT}\include\ds390\*.h" @@ -493,43 +506,55 @@ File "${DEV_ROOT}\lib\r2k\*.*" ${SectionEnd} -${Section} "SDCC Z80 library" SEC11 +${Section} "SDCC Rabbit 3000A library" SEC11 + SectionIn 1 2 + SetOutPath "$INSTDIR\lib\r3ka" + File "${DEV_ROOT}\lib\r3ka\*.*" +${SectionEnd} + +${Section} "SDCC Z80 library" SEC12 SectionIn 1 2 SetOutPath "$INSTDIR\lib\z80" File "${DEV_ROOT}\lib\z80\*.*" ${SectionEnd} -${Section} "SDCC small model library" SEC12 +${Section} "SDCC small model library" SEC13 SectionIn 1 2 SetOutPath "$INSTDIR\lib\small" File "${DEV_ROOT}\lib\small\*.*" ${SectionEnd} -${Section} "SDCC medium model library" SEC13 +${Section} "SDCC medium model library" SEC14 SectionIn 1 2 SetOutPath "$INSTDIR\lib\medium" File "${DEV_ROOT}\lib\medium\*.*" ${SectionEnd} -${Section} "SDCC large model library" SEC14 +${Section} "SDCC large model library" SEC15 SectionIn 1 2 SetOutPath "$INSTDIR\lib\large" File "${DEV_ROOT}\lib\large\*.*" ${SectionEnd} -${Section} "SDCC small-stack-auto model library" SEC15 +${Section} "SDCC small-stack-auto model library" SEC16 SectionIn 1 2 SetOutPath "$INSTDIR\lib\small-stack-auto" File "${DEV_ROOT}\lib\small-stack-auto\*.*" ${SectionEnd} -${Section} "SDCC HC08 library" SEC16 +${Section} "SDCC HC08 library" SEC17 SectionIn 1 2 SetOutPath "$INSTDIR\lib\hc08" File "${DEV_ROOT}\lib\hc08\*.*" ${SectionEnd} -${Section} "SDCC PIC16 library" SEC17 +${Section} "SDCC S08 library" SEC18 + SectionIn 1 2 + SetOutPath "$INSTDIR\lib\s08" + File "${DEV_ROOT}\lib\s08\*.*" +${SectionEnd} + +${Section} "SDCC PIC16 library" SEC19 SectionIn 1 2 SetOutPath "$INSTDIR\lib\pic16" File "${DEV_ROOT}\lib\pic16\*.o" @@ -539,7 +564,7 @@ File "${DEV_ROOT}\non-free\lib\pic16\*.lib" ${SectionEnd} -${Section} "SDCC PIC14 library" SEC18 +${Section} "SDCC PIC14 library" SEC20 SectionIn 1 2 SetOutPath "$INSTDIR\lib\pic14" File "${DEV_ROOT}\lib\pic14\*.lib" @@ -548,7 +573,7 @@ File "${DEV_ROOT}\non-free\lib\pic14\*.lib" ${SectionEnd} -${Section} "SDCC library sources" SEC19 +${Section} "SDCC library sources" SEC21 SectionIn 1 SetOutPath "$INSTDIR\lib\src\ds390\examples" File "${DEV_ROOT}\lib\src\ds390\examples\MOVED" @@ -577,10 +602,18 @@ File "${DEV_ROOT}\lib\src\r2k\*.s" # File "${DEV_ROOT}\lib\src\z180\Makefile" + SetOutPath "$INSTDIR\lib\src\r3ka" + File "${DEV_ROOT}\lib\src\r3ka\*.s" +# File "${DEV_ROOT}\lib\src\r3ka\Makefile" + SetOutPath "$INSTDIR\lib\src\hc08" File "${DEV_ROOT}\lib\src\hc08\*.c" # File "${DEV_ROOT}\lib\src\hc08\Makefile" + SetOutPath "$INSTDIR\lib\src\s08" + File "${DEV_ROOT}\lib\src\s08\*.c" +# File "${DEV_ROOT}\lib\src\s08\Makefile" + SetOutPath "$INSTDIR\lib\src\mcs51" File "${DEV_ROOT}\lib\src\mcs51\*.asm" # File "${DEV_ROOT}\lib\src\mcs51\Makefile" @@ -757,15 +790,17 @@ LangString DESC_SEC08 ${LANG_ENGLISH} "SDCC GBZ80 library" LangString DESC_SEC09 ${LANG_ENGLISH} "SDCC Z180 library" LangString DESC_SEC10 ${LANG_ENGLISH} "SDCC Rabbit 2000 library" -LangString DESC_SEC11 ${LANG_ENGLISH} "SDCC Z80 library" -LangString DESC_SEC12 ${LANG_ENGLISH} "SDCC small model library" -LangString DESC_SEC13 ${LANG_ENGLISH} "SDCC medium model library" -LangString DESC_SEC14 ${LANG_ENGLISH} "SDCC large model library" -LangString DESC_SEC15 ${LANG_ENGLISH} "SDCC small-stack-auto model library" -LangString DESC_SEC16 ${LANG_ENGLISH} "SDCC HC08 library" -LangString DESC_SEC17 ${LANG_ENGLISH} "SDCC PIC16 library" -LangString DESC_SEC18 ${LANG_ENGLISH} "SDCC PIC14 library" -LangString DESC_SEC19 ${LANG_ENGLISH} "SDCC library sources" +LangString DESC_SEC11 ${LANG_ENGLISH} "SDCC Rabbit 3000A library" +LangString DESC_SEC12 ${LANG_ENGLISH} "SDCC Z80 library" +LangString DESC_SEC13 ${LANG_ENGLISH} "SDCC small model library" +LangString DESC_SEC14 ${LANG_ENGLISH} "SDCC medium model library" +LangString DESC_SEC15 ${LANG_ENGLISH} "SDCC large model library" +LangString DESC_SEC16 ${LANG_ENGLISH} "SDCC small-stack-auto model library" +LangString DESC_SEC17 ${LANG_ENGLISH} "SDCC HC08 library" +LangString DESC_SEC18 ${LANG_ENGLISH} "SDCC S08 library" +LangString DESC_SEC19 ${LANG_ENGLISH} "SDCC PIC16 library" +LangString DESC_SEC20 ${LANG_ENGLISH} "SDCC PIC14 library" +LangString DESC_SEC21 ${LANG_ENGLISH} "SDCC library sources" ;Assign language strings to sections !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN @@ -787,7 +822,9 @@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC16} $(DESC_SEC16) !insertmacro MUI_DESCRIPTION_TEXT ${SEC17} $(DESC_SEC17) !insertmacro MUI_DESCRIPTION_TEXT ${SEC18} $(DESC_SEC18) - !insertmacro MUI_DESCRIPTION_TEXT ${SEC18} $(DESC_SEC19) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC19} $(DESC_SEC19) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC20} $(DESC_SEC20) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC21} $(DESC_SEC21) !insertmacro MUI_FUNCTION_DESCRIPTION_END ;-------------------------------- @@ -879,6 +916,10 @@ Delete "$INSTDIR\lib\src\hc08\hc08.lib" Delete "$INSTDIR\lib\src\hc08\Makefile" + Delete "$INSTDIR\lib\src\s08\*.c" + Delete "$INSTDIR\lib\src\s08\s08.lib" + Delete "$INSTDIR\lib\src\s08\Makefile" + Delete "$INSTDIR\lib\src\z80\*.s" Delete "$INSTDIR\lib\src\z80\z80.lib" Delete "$INSTDIR\lib\src\z80\README" @@ -896,6 +937,8 @@ Delete "$INSTDIR\lib\src\r2k\*.s" + Delete "$INSTDIR\lib\src\r3ka\*.s" + Delete "$INSTDIR\lib\src\ds390\*.c" Delete "$INSTDIR\lib\src\ds390\libds390.lib" Delete "$INSTDIR\lib\src\ds390\Makefile.dep" @@ -920,6 +963,8 @@ Delete "$INSTDIR\lib\hc08\*.lib" + Delete "$INSTDIR\lib\s08\*.lib" + Delete "$INSTDIR\lib\z80\*.rel" Delete "$INSTDIR\lib\z80\*.lib" @@ -929,6 +974,9 @@ Delete "$INSTDIR\lib\r2k\*.rel" Delete "$INSTDIR\lib\r2k\*.lib" + Delete "$INSTDIR\lib\r3ka\*.rel" + Delete "$INSTDIR\lib\r3ka\*.lib" + Delete "$INSTDIR\lib\small\*.lib" Delete "$INSTDIR\lib\medium\*.lib" @@ -947,6 +995,7 @@ Delete "$INSTDIR\include\asm\z80\*.h" Delete "$INSTDIR\include\asm\z180\*.h" Delete "$INSTDIR\include\asm\r2k\*.h" + Delete "$INSTDIR\include\asm\r3ka\*.h" Delete "$INSTDIR\include\asm\pic16\*.h" Delete "$INSTDIR\include\asm\pic14\*.h" Delete "$INSTDIR\include\asm\mcs51\*.h" @@ -981,7 +1030,9 @@ Delete "$INSTDIR\bin\sdldgb.exe" Delete "$INSTDIR\bin\sdld6808.exe" Delete "$INSTDIR\bin\sdldz80.exe" + Delete "$INSTDIR\bin\sdar.exe" Delete "$INSTDIR\bin\sdranlib.exe" + Delete "$INSTDIR\bin\sdnm.exe" Delete "$INSTDIR\bin\makebin.exe" Delete "$INSTDIR\bin\packihx.exe" Delete "$INSTDIR\bin\sdcc.exe" @@ -1021,10 +1072,12 @@ RMDir "$INSTDIR\lib\src\z180" RMDir "$INSTDIR\lib\src\gbz80" RMDir "$INSTDIR\lib\src\r2k" + RMDir "$INSTDIR\lib\src\r3ka" RMDir "$INSTDIR\lib\src\ds390\examples" RMDir "$INSTDIR\lib\src\ds390" RMDir "$INSTDIR\lib\src\ds400" RMDir "$INSTDIR\lib\src\hc08" + RMDir "$INSTDIR\lib\src\s08" RMDir "$INSTDIR\lib\src" RMDir "$INSTDIR\non-free\lib\src" @@ -1035,6 +1088,7 @@ RMDir "$INSTDIR\lib\z80" RMDir "$INSTDIR\lib\z180" RMDir "$INSTDIR\lib\r2k" + RMDir "$INSTDIR\lib\r3ka" RMDir "$INSTDIR\lib\small" RMDir "$INSTDIR\lib\medium" RMDir "$INSTDIR\lib\large" @@ -1043,12 +1097,14 @@ RMDir "$INSTDIR\lib\ds390" RMDir "$INSTDIR\lib\ds400" RMDir "$INSTDIR\lib\hc08" + RMDir "$INSTDIR\lib\s08" RMDir "$INSTDIR\lib" RMDir "$INSTDIR\non-free\lib" RMDir "$INSTDIR\include\asm\z80" RMDir "$INSTDIR\include\asm\z180" RMDir "$INSTDIR\include\asm\r2k" + RMDir "$INSTDIR\include\asm\r3ka" RMDir "$INSTDIR\include\asm\pic16" RMDir "$INSTDIR\non-free\include\asm\pic16" RMDir "$INSTDIR\include\asm\pic14" diff -Nru sdcc-3.1.0+dfsg/support/scripts/sdcc_mingw32 sdcc-3.2.0+dfsg/support/scripts/sdcc_mingw32 --- sdcc-3.1.0+dfsg/support/scripts/sdcc_mingw32 2012-04-09 07:49:31.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/scripts/sdcc_mingw32 2012-03-05 10:49:19.000000000 +0000 @@ -1,9 +1,16 @@ #!/bin/sh # Script to crosscompile with mingw32 -TOOLSPREFIX=/usr/local/cross-tools/bin/i586-mingw32msvc- +if [ $(expr $(hostname) : '.*\.') != '0' ] +then + HOSTNAME=$(expr $(hostname) : '\([^.]*\).') +else + HOSTNAME=$(hostname) +fi +TOOLSPREFIX=${HOME}/local-${HOSTNAME}/cross-tools/bin/i586-mingw32msvc- export CC=${TOOLSPREFIX}gcc export CXX=${TOOLSPREFIX}g++ +export AR=${TOOLSPREFIX}ar export RANLIB=${TOOLSPREFIX}ranlib export STRIP=${TOOLSPREFIX}strip diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/COPYING sdcc-3.2.0+dfsg/support/sdbinutils/COPYING --- sdcc-3.1.0+dfsg/support/sdbinutils/COPYING 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/COPYING 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + 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. + + 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. + + 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. + + 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. + + 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. + + 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. + + 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. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 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". + +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. + + 1. 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. + +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. + + 2. 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: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + 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. + + 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.) + +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. + +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. + +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. + + 3. 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: + + 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, + + 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, + + 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.) + +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. + +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. + + 4. 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. + + 5. 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. + + 6. 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. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. 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. + +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. + +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. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. 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. + + 9. 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. + +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. + + 10. 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. + + NO WARRANTY + + 11. 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. + + 12. 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. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + 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. + + 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. + + + Copyright (C) + + 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year 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. + +The hypothetical commands `show w' and `show c' 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 could even be +mouse-clicks or menu items--whatever suits your program. + +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. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +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. diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/COPYING.LIB sdcc-3.2.0+dfsg/support/sdbinutils/COPYING.LIB --- sdcc-3.1.0+dfsg/support/sdbinutils/COPYING.LIB 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/COPYING.LIB 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,482 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + 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. + + 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 library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, 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 library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete 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 distribute a copy of this License along with the +Library. + + 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. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +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 Library, 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. + +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 Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you 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. + + If distribution of 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 satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. 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. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library 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. + + 9. 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 Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. 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 Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library 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 Library. + +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. + +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. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library 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. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library 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. + +Each version is given a distinguishing version number. If the Library +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 Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +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. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "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 +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. 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 LIBRARY 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 +LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. 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. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/COPYING3 sdcc-3.2.0+dfsg/support/sdbinutils/COPYING3 --- sdcc-3.1.0+dfsg/support/sdbinutils/COPYING3 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/COPYING3 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + 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 +them 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. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. 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. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey 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; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If 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 convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU 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. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + 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. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +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. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + 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. + + 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 +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program 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. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU 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 Lesser General +Public License instead of this License. But first, please read +. diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/COPYING3.LIB sdcc-3.2.0+dfsg/support/sdbinutils/COPYING3.LIB --- sdcc-3.1.0+dfsg/support/sdbinutils/COPYING3.LIB 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/COPYING3.LIB 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser 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. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/ChangeLog sdcc-3.2.0+dfsg/support/sdbinutils/ChangeLog --- sdcc-3.1.0+dfsg/support/sdbinutils/ChangeLog 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/ChangeLog 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,14459 @@ +2011-08-19 Joel Brobecker + + * src-release (GDB_SUPPORT_DIRS): Add 'cpu'. + +2011-08-14 Yao Qi + + Merge from gcc: + + 2011-08-14 Yao Qi + * configure.ac (tic6x-*-*): Remove gdb from noconfigdirs. + * configure: Regenerate. + +2011-07-26 Ian Lance Taylor + + Merge from gcc: + + 2011-07-26 Ian Lance Taylor + * configure.ac: Set have_compiler based on whether gcc directory + exists, rather than on whether gcc is in configdirs. + * configure: Rebuild. + + 2011-07-20 David Edelsohn + * Makefile.tpl (POSTSTAGE1_CONFIGURE_FLAGS): Add libsupc++ to + link directories. + * Makefile.in: Rebuild. + + 2011-07-20 Ian Lance Taylor + PR bootstrap/49787 + * configure.ac: Move --enable-bootstrap handling earlier in file. + If --enable-bootstrap and either --enable-build-with-cxx or + --enable-build-poststage1-with-cxx, enable C++ automatically. + * configure: Rebuild. + + 2011-07-19 Ian Lance Taylor + * configure.ac: Add --enable-build-poststage1-with-cxx. If set, + make C++ a boot_language. Set and substitute + POSTSTAGE1_CONFIGURE_FLAGS. + * Makefile.tpl (POSTSTAGE1_CONFIGURE_FLAGS): New variable. + (STAGE[+id+]_CONFIGURE_FLAGS): Add $(POSTSTAGE1_CONFIGURE_FLAGS). + * configure, Makefile.in: Rebuild. + + 2011-07-16 Jason Merrill + * Makefile.def (language=c++): Add check-c++0x and + check-target-libmudflap-c++. + * Makefile.tpl (check-target-libmudflap-c++): New. + * Makefile.in: Regenerate. + + 2011-07-16 Matthias Klose + * Makefile.tpl (EXTRA_CONFIGARGS_LIBJAVA): Define. + * Makefile.def (target_modules/libjava): Pass + $(EXTRA_CONFIGARGS_LIBJAVA). + * configure.ac: Pass --disable-static in EXTRA_CONFIGARGS_LIBJAVA, + if not configured with --enable-static-libjava. + * Makefile.in: Regenerate. + * configure: Likewise. + + 2011-06-22 Hans-Peter Nilsson + PR regression/47836 + PR bootstrap/23656 + PR other/47733 + PR bootstrap/49247 + PR c/48825 + * configure.ac (target_libraries): Remove target-libiberty. + Remove case-statement setting skipdirs=target-libiberty for + multiple targets. Remove checking target_configdirs and + removing target-libiberty but keeping target-libgcc if + otherwise empty. + * Makefile.def (target_modules): Don't add libiberty. + (dependencies): Remove all traces of target-libiberty. + * configure, Makefile.in: Regenerate. + +2011-07-22 Jason Merrill + + * Makefile.def (language=c++): Add check-c++0x and + check-target-libmudflap-c++. + * Makefile.tpl (check-target-libmudflap-c++): New. + * Makefile.in: Regenerate. + +2011-07-18 Rainer Orth + + * configure: Regenerate. + +2011-07-07 Rainer Orth + + PR target/39150 + * configure.ac (i[3456789]86-*-solaris2*): Also accept + x86_64-*-solaris2.1[0-9]*. + * configure: Regenerate. + +2011-06-13 Walter Lee + + * configure.ac (tilepro-*-*) New case. + (tilegx-*-*): Likewise. + * configure: Regenerate. + +2011-06-06 Nick Clifton + + * config.sub: Sync from upstream. + +2011-05-08 Doug Kwan + + Merge from gcc: + + 2011-05-08 Doug Kwan + + * configure.ac: Propagate LDFLAGS_FOR_TARGET. + * configure: Regenerated. + * Makefile.tpl (LDFLAGS_FOR_TARGET): Use LDFLAGS_FOR_TARGET + value from configure. + * Makefile.in: Regenerated. + +2011-05-05 Joseph Myers + + * configure.ac (alpha*-dec-osf*, i[[3456789]]86-*-rdos*, + sh*-*-pe|mips*-*-pe|arm-wince-pe, sparc-*-sunos4*, *-*-aix*, + *-*-beos*, *-*-chorusos, *-*-dragonfly*, *-*-freebsd*, *-*-linux* + | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu, *-*-lynxos*, + *-*-mingw*, *-*-netbsd*, *-*-netware*, *-*-tpf*, *-*-uclinux*, + *-*-vxworks*): Disable newlib and libgloss in separate case + statement. + (i[[3456789]]86-*-linux*): Move logic allowing newlib to be built + to separate case statement. + (*-*-chorusos, *-*-dragonfly*, *-*-freebsd*, *-*-netbsd*, + *-*-netware*, *-*-tpf*, *-*-uclinux*, *-*-vxworks*, + alpha*-dec-osf*, alpha*-*-linux*, am33_2.0-*-linux*, sh-*-linux*, + sh*-*-pe|mips*-*-pe|*arm-wince-pe, arm-*-coff, arm-*-elf* | + arm*-*-eabi*, arm*-*-linux-gnueabi, arm*-*-symbianelf*, avr-*-*, + bfin-*-*, cris-*-* | crisv32-*-*, frv-*-*, i[[3456789]]86-*-coff | + i[[3456789]]86-*-elf, i[[3456789]]86-w64-mingw*, + i[[3456789]]86-*-mingw*, x86_64-*-mingw*, + i[[3456789]]86-*-interix*, i[[3456789]]86-*-beos*, + i[[3456789]]86-*-rdos*, m32r-*-*, + m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*, m68k-*-elf*, m68*-*-* + | fido-*-*, powerpc-*-aix*, powerpc-*-beos*, powerpc-*-eabi, + powerpc-*-eabi* | powerpcle-*-eabi* | powerpc-*-rtems*, + rs6000-*-lynxos*, rs6000-*-aix*, mips*-*-linux*, sparclet-*-aout* + | sparc86x-*-*, sparc-*-elf*, sparc64-*-elf*, sparclite-*-*, + sparc-*-sunos4*, sparc-*-solaris* | sparc64-*-solaris* | + sparcv9-*-solaris*, *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | + *-*-kopensolaris*-gnu, *-*-lynxos*, *-*-*): Don't disable newlib + and libgloss in main case over targets. Remove most empty cases + in main case over targets. + * configure: Regenerate. + +2011-05-04 Joseph Myers + + * configure.ac: Remove code setting special library locations for + hppa*64*-*-hpux11*. Remove code setting compiler for + sparc-sun-solaris2*. + * configure: Regenerate. + +2011-05-04 Joseph Myers + + * configure.ac: Separate libgloss_dir settings from general case + over targets. + * configure: Regenerate. + +2011-04-28 Joseph Myers + + * configure.ac (*-*-dragonfly*, *-*-freebsd*, *-*-netbsd*, + alpha*-dec-osf*, alpha*-*-linux*, alpha*-*-*, sh-*-linux*, + arm-*-elf* | arm*-*-eabi*, arm*-*-linux-gnueabi, frv-*-*): Remove + cases in libgcj-disabling case statement. + (hppa*64*-*-linux*): Set unsupported_languages instead of + disabling target-zlib. + (hppa*64*-*-*): Restrict case in libgcj-disabling case statement + to hppa*64*-*-hpux*. + (hppa*-*-*): Restrict case in libgcj-disabling case statement to + hppa*-*-hpux*. + (ia64*-*-elf*, ia64*-**-hpux*, i[[3456789]]86-*-elf, + i[[3456789]]86-*-linux*, *-*-cygwin*, i[[3456789]]86-*-interix*, + i[[3456789]]86-*-solaris2*, m32r-*-*, m68k-*-elf*, m68*-*-* | + fido-*-*, powerpc-*-eabi, powerpc-*-eabi* | powerpcle-*-eabi* | + powerpc-*-rtems*, mips*-*-linux*, mips*-*-*, sh-*-* | sh64-*-*, + sparc-*-elf*, sparc64-*-elf*, sparc-*-solaris* | + sparc64-*-solaris* | sparcv9-*-solaris*, *-*-linux* | *-*-gnu* | + *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu, *-*-*): Remove cases in + libgcj-disabling case statement. + * configure: Regenerate. + +2011-04-28 Joseph Myers + + * configure.ac: Disable Java for targets not supporting libffi. + (*-*-chorusos, *-*-kaos*, am33_2.0-*-linux*, sh*-*-pe|mips*-*-pe): + Remove cases in Java-disabling statement. + (*arm-wince-pe): Change to arm-wince-pe. + (arc-*-*, arm-*-coff, arm-*-pe*, arm-*-riscix*, avr-*-*): Remove + cases in Java-disabling statement. + (bfin-*-*): Don't disable Java again. + (c4x-*-* | tic4x-*-*, tic54x-*-*, cr16-*-*, d10v-*-*, d30v-*-*, + fr30-*-elf*, moxie-*-*, h8300*-*-*, h8500-*-*, hppa1.1-*-osf* | + hppa1.1-*-bsd*, hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-openbsd*, + hppa*-*-pro*, i960-*-*, i[[3456789]]86-*-coff, + i[[3456789]]86-*-pe, i[[3456789]]86-*-sco3.2v5*, + i[[3456789]]86-*-sco*, i[[3456789]]86-*-sysv4*, + i[[3456789]]86-*-beos*, i[[3456789]]86-*-rdos*, + m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*): Remove cases in + Java-disabling statement. + (mmix-*-*): Don't disable Java again. + (mt-*-*, powerpc*-*-winnt* | powerpc*-*-pe*, powerpcle-*-solaris*, + powerpc-*-beos*, rs6000-*-lynxos*, rs6000-*-*, m68k-apollo-*, + microblaze*, mips*-sde-elf*, mips*-*-irix5*, mips*-*-bsd*, + sparclet-*-aout* | sparc86x-*-*, sparclite-*-*, sparc-*-sunos4*, + tic6x-*-*, v810-*-*, vax-*-*): Remove cases in Java-disabling + statement. + * configure: Regenerate. + +2011-04-28 Joseph Myers + + Merge from GCC: + + 2011-04-18 Jack Howarth + + PR lto/48086 + * configure.ac: Re-enable LTO on *-apple-darwin9*. + * configure: Regenerate. + +2011-04-28 Joseph Myers + + * configure.ac: Separate cases disabling Java and Java libraries + from general case over targets. + * configure: Regenerate. + +2011-04-06 Joseph Myers + + * configure.ac (build_tools): Remove build-byacc. + (host_libs): Remove mmalloc. + (host_tools): Remove byacc make patch prms send-pr ash bash bzip2 + autoconf automake libtool diff rcs fileutils shellutils time + textutils wdiff find uudecode hello tar gzip indent recode release + sed perl gawk findutils gettext zip. + (libgcj): Remove target-qthreads. + (target_tools): Remove target-examples target-gperf. + (YACC): Don't handle building byacc. + * configure: Regenerate. + * Makefile.def (ash, autoconf, automake, bash, byacc, bzip2, diff, + dosutils, examples, fileutils, find, findutils, gawk, gettext, + gnuserv, gperf, gzip, hello, indent, libtool, make, mmalloc, + patch, perl, prms, qthreads, rcs, recode, release, sed, send-pr, + shellutils, tar, textutils, time, uudecode, wdiff, zip): Don't + handle building components. + * Makefile.in: Regenerate. + +2011-04-05 Ralf Wildenhues + + * config.sub: Sync from upstream. + +2011-04-01 Joseph Myers + + * configure.ac (avr-*-*): Add comment about why libssp is disabled. + (microblaze*): Don't disable libssp. + * configure: Regenerate. + +2011-04-01 Joseph Myers + + * configure.ac: Remove code setting CONFIG_SHELL, config_shell and + moveifchange. + * configure: Regenerate. + * Makefile.tpl: Use @SHELL@ not @config_shell@. + * Makefile.in: Regenerate. + +2011-04-01 Joseph Myers + + * configure.ac (*-*-sysv4*): Don't enable libgomp. + (alpha*-*-*vms*, i[[34567]]86-*-sco3.2v5*, mn10300-*-*, + powerpc-*-chorusos*, powerpc*-*-eabi*, powerpc*-*-sysv*, + powerpc*-*-kaos*, s390x-ibm-tpf*, sparc64-*-elf*, v850*-*-*, + xtensa*-*-elf*, *-*-beos*, *-*-elf*, *-*-netware*, *-*-rtems*, + *-*-sysv[[45]]*, *-*-vxworks*, *-wrs-windiss): Remove + md_exec_prefix cases. + * configure: Regenerate. + +2011-04-01 Joseph Myers + + * configure.ac: Separate cases disabling target-libssp, + target-libiberty, target-libstdc++-v3 and Fortran from general + case over targets. + * configure: Regenerate. + +2011-04-01 Joseph Myers + + * configure.ac (*-*-chorusos): Don't disable libgcj. + (*-*-freebsd[[12]] | *-*-freebsd[[12]].* | *-*-freebsd*aout*): + Remove case. + (*-*-kaos*): Don't disable GCC libraries, zlib or fastjar. + (arm-*-coff): Don't disable libgcj. + (arm*-*-linux-gnueabi): Remove useless assignment. + (arm-*-riscix*): Don't disable libgcj. + (bfin-*-*): Don't enable target-bsp and target-cygmon depending on + configuration. + (c4x-*-* | tic4x-*-*): Don't disable GCC libraries. + (c54x*-*-*): Remove case. + (tic54x-*-*): Don't disable GCC or GCC libraries. + (cris-*-* | crisv32-*-*): Don't handle *-*-aout. Change *-*-elf + to *. + (d10v-*-*): Don't disable GCC libraries. + (d30v-*-*): Don't disable libgcj. + (h8500-*-*): Don't disable GCC libraries. + (i960-*-*): Don't disable libgcj. + (i[[3456789]]86-*-linux*): Don't handle *-*-*libc1*. + (i[[3456789]]86-*-sco3.2v5*, i[[3456789]]86-*-sco*, + i[[3456789]]86-*-sysv4*, i[[3456789]]86-*-beos*): Don't disable + libgcj. + (m68k-*-coff*): Remove case. + (mmix-*-*): Don't disable libgloss on host. + (mn10200-*-*, mn10300-*-*): Remove cases. + (powerpc*-*-winnt* | powerpc*-*-pe*, powerpcle-*-solaris*, + powerpc-*-beos*, m68k-apollo-*, mips*-*-irix5*, mips*-*-bsd*): + Don't disable libgcj. + (romp-*-*): Remove case. + (sparclite-*-*, sparc-*-sunos4*): Don't disable libgcj. + (sparc-*-solaris2.[[0-6]] | sparc-*-solaris2.[[0-6]].*): Remove + case. + (v810-*-*): Don't disable GCC libraries. + (v850*-*-*, vax-*-vms, xtensa*-*-*): Remove cases. + (ip2k-*-*): Don't disable GCC libraries. + * configure: Regenerate. + +2011-03-28 Joseph Myers + + * configure.ac (i[[3456789]]86-*-msdosdjgpp*): Don't disable + libffi on host. + (x86_64-*-mingw*, i[[3456789]]86-*-mingw32*): Don't disable newlib + on host. + (c54x*-*-* | tic54x-*-*): Don't disable newlib on host. + * configure: Regenerate. + +2011-03-26 John Marino + + * configure.ac: Add support for *-*-dragonfly* + * configure: Regenerate. + +2011-03-25 Joseph Myers + + * configure.ac (native_only): Remove. + (i[[3456789]]86-*-msdosdjgpp*): Don't disable expect dejagnu + send-pr uudecode guile gnuserv on host. + (x86_64-*-mingw*): Don't disable expect dejagnu autoconf automake + send-pr rcs guile perl texinfo libtool on host. + (i[[3456789]]86-*-mingw32*): Don't disable expect dejagnu autoconf + automake send-pr rcs guile perl texinfo libtool on host. + (*-*-cygwin*, *-*-netbsd*): Remove host cases. + (*-*-kaos*): Don't disable target-examples target-gperf on target. + (alpha*-dec-osf*): Don't disable fileutils on target. + (sh*-*-pe|mips*-*-pe|*arm-wince-pe): Don't disable target-examples + texinfo send-pr expect dejagnu on target. + (arm-*-elf* | arm*-*-eabi*, arm*-*-linux-gnueabi): Don't disable + target-qthreads on target. + (hppa*-hp-hpux11*, hppa*-*-*): Don't disable shellutils on target. + (ia64*-*-elf*, ia64*-*-*vms*): Don't disable mmalloc on target. + (i[[3456789]]86-w64-mingw*, i[[3456789]]86-*-mingw*, + x86_64-*-mingw*): Don't disable expect on target. + (*-*-cygwin*): Don't disable target-gperf on target. + (powerpc*-*-winnt* | powerpc*-*-pe*): Don't disable make expect + gnuserv on target. + (powerpcle-*-solaris*): Don't disable make expect gnuserv on + target. + * configure: Regenerate. + +2011-03-25 Joseph Myers + + * configure.ac (target_tools): Remove target-groff. + (native_only): Remove target-groff. + (hppa*64*-*-*): Don't disable byacc. + (i[[3456789]]86-*-mingw32*): Remove commented-out noconfigdirs + setting. + (*-*-kaos*): Don't skip target-librx and target-groff. + (*-*-netware*): Don't skip target-libmudflap. + (*-*-tpf*): Don't skip target-libmudflap. + (sh*-*-pe|mips*-*-pe|*arm-wince-pe): Don't condition configured + directories on the host. + (ia64*-*-*vms*): Don't skip tix. + (sh-*-* | sh64-*-*): Don't condition skipped directories on the + host. + * configure: Regenerate. + +2011-03-24 Paolo Bonzini + + * configure.ac: Remove references to mt-mep, mt-netware, + mt-wince. + * Makefile.def: Add all-utils soft dependencies. + * Makefile.tpl: Remove GDB_NLM_DEPS. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2011-03-24 Paolo Bonzini + + Sync from GCC: + + 2011-03-24 Paolo Bonzini + + * configure.ac: Do not include mh-x86omitfp. + * configure: Regenerate. + + 2011-03-24 Paolo Bonzini + + * configure.ac: Remove empty cases. + * configure: Regenerate. + + 2011-03-24 Paolo Bonzini + + * Makefile.def: Add dependency from termcap to gdb. + * Makefile.in: Regenerate. + + 2011-03-24 Paolo Bonzini + + * configure.ac: Remove all mentions of mh-sysv4 and mh-solaris. + * configure: Regenerate. + * Makefile.def: Remove all mentions of X11_FLAGS_TO_PASS. + * Makefile.tpl: Likewise. + * Makefile.in: Regenerate. + + 2011-03-24 Paolo Bonzini + + * configure.ac: Remove all mentions of tentative_cc. + * configure: Regenerate. + + 2011-03-16 Jack Howarth + + PR lto/48086 + * configure.ac: Re-enable LTO on *-apple-darwin9. + * configure: Regenerate. + +2011-03-24 Joseph Myers + + * configure.ac (i[[3456789]]86-*-vsta, i[[3456789]]86-*-go32*, + i[[3456789]]86-*-beos*, powerpc-*-beos*, m68k-hp-hpux*, + m68k-apollo-sysv*, m68k-apollo-bsd*, m88k-dg-dgux*, + m88k-harris-cxux*, m88k-motorola-sysv*, mips*-dec-ultrix*, + mips*-nec-sysv4*, mips*-sgi-irix4*, mips*-*-sysv4*, mips*-*-sysv*, + i370-ibm-opened*, i[[3456789]]86-*-sysv5*, i[[3456789]]86-*-dgux*, + i[[3456789]]86-ncr-sysv4.3*, i[[3456789]]86-ncr-sysv4*, + i[[3456789]]86-*-sco3.2v5*, i[[3456789]]86-*-sco*, + i[[3456789]]86-*-udk*, vax-*-ultrix2*, m68k-sun-sunos*, + hppa*-*-hiux*, *-*-hiux*, rs6000-*-lynxos*, *-*-sysv4*, + *-*-rhapsody*): Remove host cases. + * configure: Regenerate. + +2011-03-24 Joseph Myers + + * configure.ac (ppc*-*-pe): Remove host case. + (strongarm-*-coff | xscale-*-coff, strongarm-*-elf* | + xscale-*-elf*, thumb-*-coff, thumb-*-elf, thumb-*-pe, ep9312-*-elf + | ep9312-*-coff, parisc*64*-*-linux*, ppc*-*-pe): Remove target + cases. + * configure: Regenerate. + +2011-03-24 Joseph Myers + + * config.sub: Update to version 2011-03-23. + +2011-03-22 Joseph Myers + + * configure.ac (arm-semi-aof, crx-*-*, parisc*-*-linux*, + i370-*-opened*, i[[3456789]]86-moss-msdos | i[[3456789]]86-*-moss* + | i[[3456789]]86-*-uwin*, mcore-*-pe*): Remove empty cases. + * configure: Regenerate. + +2011-03-22 Joseph Myers + + * config-ml.in: Don't handle arc-*-elf*. + * configure.ac (arc-*-*, crx-*-*, i[[3456789]]86-*-pe, + m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*, mcore-*-pe*): Don't + handle GCC libraries. + * configure: Regenerate. + +2011-03-21 Rainer Orth + + PR bootstrap/48120: + * configure.ac (pwllib): Use LIBS instead of LDFLAGS. + Add -lstdc++ -lm to LIBS. + * configure: Regenerate. + +2011-03-18 David Edelsohn + + * config.guess: Update to version 2011-02-02 + * config.sub: Update to version 2011-02-24 + +2011-03-03 Sebastian Pop + + * configure.ac: Adjust test of with_ppl. + * configure: Regenerated. + +2011-03-02 Sebastian Pop + + * configure.ac: Add -lpwl to ppllibs. + * config/cloog.m4: Add -lisl to clooglibs. + * configure: Regenerated. + +2011-02-13 Ralf Wildenhues + + Import from Libtool and gnulib: + + 2011-01-27 Gerald Pfeifer + + Prepare for supporting FreeBSD 10. + * config.rpath: Remove handling of freebsd1* which soon would + match FreeBSD 10.0. + + 2011-01-20 Gerald Pfeifer (tiny change) + + Remove support for FreeBSD 1.x. + * libtool.m4 (_LT_LINKER_SHLIBS) + (_LT_SYS_DYNAMIC_LINKER): Remove handling of freebsd1* which + soon would incorrectly match FreeBSD 10.0. + +2011-02-12 Ralf Wildenhues + + PR binutils/12283 + * MAINTAINERS (mkinstalldirs): Comes from Automake. + (move-if-change): Comes from gnulib. + * move-if-change: Import version from gnulib. + +2011-02-12 Ralf Wildenhues + + Sync from GCC: + + 2011-02-12 Alexandre Oliva + + PR lto/47225 + * Makefile.def (lto-plugin): Double dash for enable-shared. + (configure-gcc): Depend on all-lto-plugin. + * Makefile.in: Rebuilt. + + 2011-02-11 Ralf Wildenhues + + * configure.ac: Remove extra bracket. + * configure: Regenerate. + + 2011-02-06 Kai Tietz + + PR lto/47225 + * Makefile.def: Add dependency for install-gcc + on install-lto-plugin. + * Makfile.in: Regenerated + + 2011-01-25 Jakub Jelinek + + * configure.ac: If with_ppl is no, move setting with_cloog=no + after CLOOG_REQUESTED check. + * configure: Regenerated. + + 2011-01-25 Sebastian Pop + + * configure.ac: Call AC_MSG_ERROR when PPL 0.11 is not present and + CLooG has been requested. + * configure: Regenerated. + + 2011-01-25 Sebastian Pop + + * configure: Regenerated. + * configure.ac: Check for version 0.11 (or later revision) of PPL. + + 2011-01-25 Tobias Grosser + + * configure: Regenerated. + * configure.ac: Use CLOOG_CHECK_VERSION(0,16,1). + + 2011-01-07 Jan Hubicka + + PR lto/47225 + * Makefile.in: Regenerate. + * Makefile.def (lto-plugin): Always pass enable-shared to the plugin + configure. + +2011-01-31 Alexandre Oliva + + PR libgcj/44341 + * configure.ac: Discard --with-* flags for host when configuring + target libraries for cross build. + * configure: Rebuilt. + +2011-01-21 Andreas Schwab + + Sync from GCC: + + 2011-01-21 Andreas Schwab + + * configure.ac: Use AS_HELP_STRING throughout. + * configure: Regenerate. + + 2011-01-18 Jie Zhang + + * configure.ac (bfin-*-*): Remove gdb from noconfigdirs. + * configure: Regenerate. + +2010-12-10 John David Anglin + + * ltmain.sh (relink): Use absolute path when hardcoding with -L. + +2011-01-13 Joel Brobecker + + * configure.ac: Remove readline, mmalloc, and gdb from noconfigdirs + for ia64-hpux. + * configure: Regenerate. + +2011-01-02 Ralf Wildenhues + + Sync from GCC: + 2010-12-22 Hariharan Sandanagobalane + + * configure.ac: (picochip): Disable libiberty. + * configure: Regenerate. + +2010-12-18 Jeff Johnston + + * COPYING.LIBGLOSS: Remove the GPL for fr30 target. + +2010-12-10 Ian Lance Taylor + + PR bootstrap/46819 + * configure.ac: For --disable-libgcj clear libgcj_saved. + * configure: Rebuild. + +2010-12-10 Tobias Burnus + + PR fortran/46540 + * configure.ac: Add --disable-libquadmath and + --disable-libquadmath-support. + * configure: Regenerate. + +2010-12-10 Tristan Gingold + + * src-release (ETC_SUPPORT): add gnu-oids.texi + +2010-12-03 Hans-Peter Nilsson + + PR libffi/46792 + * configure.ac (cris-*-elf, crisv32-*-elf): Disable target-libffi. + * configure: Regenerate. + +2010-12-02 Ian Lance Taylor + + * configure.ac: Always set default for poststage1_ldflags to + -static-libstdc++ -static-libgcc. + +2010-12-02 Jeff Johnston + + * COPYING.NEWLIB: Add National Semiconductor notice. + +2010-11-29 Andreas Schwab + + * configure.ac: Move comment to remove extra space in last argument + of GCC_TARGET_TOOL. + +2010-11-26 Alexandre Oliva + + PR other/46026 + * configure.ac (CXX_FOR_TARGET): Add -funconfigured-libstdc++-v3. + * Makefile.def (CXX_FOR_TARGET): Removed from flags_to_pass. + * Makefile.tpl (CXX_FOR_TARGET_FLAG_TO_PASS): New. + (BASE_FLAGS_TO_PASS): Use it. + * configure: Rebuilt. + * Makefile.in: Rebuilt. + +2010-11-23 H.J. Lu + + PR binutils/12258 + * configure.ac: Correct comments for --enable-gold/--enable-ld. + Properly check default linker. + * configure: Regnerated. + +2010-11-23 Matthias Klose + + * configure.ac: For --enable-gold, handle value `default' instead of + `both*'. New configure option --{en,dis}able-ld. + * configure: Regenerate. + +2010-11-20 Ian Lance Taylor + + * configure.ac: Only disable a language library if no language needs + it. Don't let --disable-libgcj uncondtionally disable libffi. + * configure: Rebuild. + +2010-11-20 Paolo Bonzini + + * configure: Regenerate. + +2010-11-20 Ralf Wildenhues + + PR other/46202 + * configure.ac: Fix just-built in-tree STRIP name to be + binutils/strip-new. + * configure: Regenerate. + * Makefile.def (install-strip-gcc, install-strip-binutils) + (install-strip-opcodes, install-strip-ld, install-strip-itcl) + (install-strip-sid): Mirror dependencies on non-strip variants + of these targets on the respective -strip prerequisites. + * Makefile.tpl (install-strip, install-strip-host) + (install-strip-target): New targets. + (install-strip-[+module+], install-strip-target-[+module+]): + New targets. + * Makefile.in: Regenerate. + +2010-11-19 Ian Lance Taylor + Ralf Wildenhues + + * configure.ac: Add target-libgo to target_libraries. Set + and substitute GOC_FOR_BUILD and GOC_FOR_TARGET. + * Makefile.tpl (BUILD_EXPORTS): Add GOC and GOCFLAGS. + (HOST_EXPORTS): Add GOC. + (BASE_TARGET_EXPORTS): Add GOC. + (GOC_FOR_BUILD, GOCFLAGS, GOC_FOR_TARGET): New variables. + (GOCFLAGS_FOR_TARGET): New variable. + (EXTRA_HOST_FLAGS): Add GOC. + (EXTRA_TARGET_FLAGS): Add GOC and GOCFLAGS. + * Makefile.def (target_modules): Add libgo. + (flags_to_pass): Add GOC_FOR_TARGET and GOCFLAGS_FOR_TARGET. + (dependencies): Add dependency from configure-target-libgo to + configure-target-libffi and all-target-libstdc++-v3. Add + dependencies from all-target-libgo to all-target-libffi. + (languages): Add go. + * configure: Rebuild. + * Makefile.in: Rebuild. + +2010-11-19 Ian Lance Taylor + + * config-ml.in: Add Go support: treat GOC and GOCFLAGS like other + compiler/flag environment variables. + +2010-11-18 Ian Lance Taylor + + * configure.ac: Check for lang_requires_boot_languages in + config-lang.in files. + * configure: Rebuild. + +2010-11-17 Mike Frysinger + + * .gitignore: New file. + +2010-11-16 Francois-Xavier Coudert + Tobias Burnus + + PR fortran/32049 + * Makefile.def: Add libquadmath; build it with language=fortran. + * configure.ac: Add libquadmath. + * Makefile.tpl: Handle multiple libs in check-[+language+]. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2010-11-15 Andreas Schwab + + * configure.ac: Fix spelling in option names. + * configure: Regenerated. + +2010-11-13 Georg-Johann Lay + + PR bootstrap/39622 + * configure.ac (FLAGS_FOR_TARGET): Add include-fixed path. + * configure: Regenerated. + +2010-11-12 Tobias Grosser + + * config/cloog.m4: Add -enable-cloog-backend=(isl|ppl|ppl-legacy) to + define the cloog backend to use. Furthermore, only pass the ppllibs to + the configure checks, if necessary. + * configure: Regenerate. + +2010-11-12 Tobias Grosser + + * config/cloog.m4: Use CLooG predefined macro to check for CLooG PPL. + * configure: regenerate + +2010-11-12 Tobias Grosser + + * config/cloog.m4: Fix typo. verison -> version. + * configure: Regenerate. + +2010-11-12 Tobias Grosser + + * config/cloog.m4: Pass ppl libraries to the CLooG version check. + * configure: Regenerate. + +2010-11-11 Andreas Simbuerger + + * configure.ac: Support official CLooG.org versions. + * configure: Regenerate. + * config/cloog.m4: New. + +2010-11-05 Michael Eager + + * COPYING.LIBGLOSS: Correct typo in microblaze. + * COPYING.NEWLIB: Same. + +2010-11-04 Iain Sandoe + + * configure.ac (*-*-darwin*): Use mh-darwin for all Darwin variants. + * configure: Regenerate. + +2010-11-03 Ian Lance Taylor + Dave Korn + + PR lto/46273 + * configure.ac: Remove libelf tests. Build lto-plugin on ELF always + and on other supported platforms whenever LTO is enabled. + * configure: Rebuild. + +2010-11-02 Alan Modra + + PR binutils/12110 + * configure.ac: Error when source path contains spaces. + * configure: Regenerate. + +2010-10-20 Ian Lance Taylor + + * Makefile.def (target_modules): Set lib_path to src/.libs for + libstdc++-v3 module. + * Makefile.tpl: Fix typo in TARGET_LIB_PATH comment. + * Makefile.in: Rebuild. + +2010-10-08 Bernd Schmidt + Joseph Myers + + * COPYING.LIBGLOSS: Add National Semiconductor and CodeSourcery + notices. + * COPYING.NEWLIB: Add Texas Instruments notice. + +2010-10-07 Dave Korn + + * configure.ac (build_lto_plugin): New shell variable. + (--enable-lto): Turn on by default for all non-ELF platforms that + have had LTO support added so far. Set build_lto_plugin appropriately + for both ELF and non-ELF. + (configdirs): Add lto-plugin or not based on build_lto_plugin. + * configure: Regenerate. + +2010-10-02 Ralf Wildenhues + + PR bootstrap/45326 + PR bootstrap/45174 + * configure.ac: Honor initial values of $build_configargs, + $host_configargs, $target_configargs. Mark the precious, so + environment settings get recorded. + * configure: Regenerate. + +2010-10-02 Ralf Wildenhues + + Sync from GCC: + + 2010-09-30 Michael Eager + + * configure.ac (microblaze): Add target-libssp to noconfigdirs. + * configure: Regenerate. + + 2010-09-21 Iain Sandoe + + * configure.ac (enable-lto): Add Darwin to the list of supported lto + targets and amend comment. + * configure: Regenerate. + + 2010-09-03 Jack Howarth + + * configure.ac: Enable LTO by default on Darwin. + * configure: Regenerate. + + 2010-07-23 Marc Glisse + + PR bootstrap/44455 + * configure.ac (extra_mpfr_configure_flags): Copy from + extra_mpc_gmp_configure_flags. + * configure: Re-generated. + +2010-09-30 Ralf Wildenhues + + Sync from GCC: + + PR bootstrap/45796 + * Makefile.def (info-gcc, dvi-gcc, pdf-gcc, html-gcc): + Depend on all-build-libiberty. + * Makefile.in: Regenerate. + +2010-09-27 Ralf Wildenhues + + Sync from GCC: + + PR bootstrap/44621 + * configure.ac: Fix unportable shell quoting. + * configure: Regenerate. + +2010-07-26 Naveen.H.S + + * configure.ac: Support all v850 targets. + * configure: Regenerate. + +2010-07-17 Jack Howarth + + PR target/44862 + * Makefile.tpl (POSTSTAGE1_CXX_EXPORT): + Provide -B option to allow for link spec %s substitutions for + libstdc++.a on darwin. + * Makefile.in: Regenerate. + +2010-06-10 Alexandre Oliva + + * Makefile.def (configure-gcc): Depend on all-libelf. + * Makefile.in: Rebuild. + +2010-06-01 Ralf Wildenhues + + * config.sub, config.guess: Update from upstream sources. + +2010-06-01 Ralf Wildenhues + + Sync from GCC: + + 2010-05-05 Sebastian Pop + * configure.ac: Allow all the versions greater than 0.10 of PPL. + * configure: Regenerated. + + 2010-04-20 Eric Botcazou + * configure.ac (BUILD_CONFIG): Redirect output to /dev/null. + * configure: Regenerate. + + 2010-04-17 Ralf Corspius + * configure.ac (*-*-rtems*): Add target-libiberty to $skipdirs. + * configure: Regenerate. + + 2010-04-16 Rainer Orth + * configure.ac: Check for elf_getshdrstrndx or elf_getshstrndx + separately. + * configure: Regenerate. + + 2010-04-13 Steve Ellcey + * configure: Regenerate after change to elf.m4. + + 2010-04-02 Sebastian Pop + * configure.ac: Add brackets around AC_TRY_COMPILE alternative. + * configure: Regenerated. + + 2010-04-02 Sebastian Pop + * configure.ac: Print "buggy but acceptable" when CLooG + revision is less than 9. + * configure: Regenerated. + +2010-05-26 Dave Korn + + Merge from gcc: + + 2010-05-18 Steven Bosscher + * configure.ac (--enable-lto): All *-apple-darwin* now support LTO. + * configure: Regenerate. + + 2010-05-07 Steven Bosscher + * configure.ac (--enable-lto): Add x86_64-apple-darwin* as + a platform that supports LTO. + * configure: Regenerate. + + 2010-04-27 Dave Korn + PR lto/42776 + * configure.ac (--enable-lto): Refactor handling so libelf tests + are only performed inside then-clause of ACX_ELF_TARGET_IFELSE, + and allow LTO to be explicitly enabled on non-ELF platforms that + are known to support it inside else-clause. + * configure: Regenerate. + +2010-04-27 Roland McGrath + H.J. Lu + + * configure.ac (--enable-gold): Support both, both/gold and + both/bfd to add gold to configdirs without removing ld. + * configure: Regenerated. + + * Makefile.def: Add install-gold dependency to install-ld. + * Makefile.in: Regenerated. + +2010-04-14 Tristan Gingold + + * configure.ac (alpha*-*-*vms*): Remove ld from noconfigdirs. + * configure: Regenerate. + +2010-04-08 Ralf Wildenhues + + Merge from gcc: + PR bootstrap/43615 + PR bootstrap/43328 + Revert: + 2010-03-31 Ralf Wildenhues + * configure.ac: Do not pass --enable-multilib nor + --disable-multilib in baseargs. Accept explicitly passed + --enable_multilib. + * configure: Regenerate. + +2010-03-31 Ralf Wildenhues + + PR bootstrap/43328 + * configure.ac: Do not pass --enable-multilib nor + --disable-multilib in baseargs. Accept explicitly passed + --enable_multilib. + * configure: Regenerate. + +2010-03-23 Joseph Myers + + * configure.ac (tic6x-*-*): New case. + * configure: Regenerate. + +2010-03-23 Joseph Myers + + Merge from gcc: + 2010-03-19 Jack Howarth + PR ada/42554 + * configure.ac: Only pass -c to ranlib for darwin9 and earlier. + * configure: Regenerate. + +2010-03-23 Joseph Myers + + * config.sub: Update to version 2010-03-22. + * config.guess: Update to version 2009-12-30. + +2010-03-14 Joseph Myers + + Merge from gcc: + 2010-01-11 Richard Guenther + PR lto/41569 + * Makefile.def (all-lto-plugin): Depend on all-gcc. + * Makefile.in: Regenerated. + +2010-03-01 Rainer Orth + + PR libstdc++/32499 + * configure.ac (RANLIB): Default to true. + (STRIP): Likewise. + (RANLIB_FOR_TARGET): Remove superfluous : argument. + * configure: Regenerate. + +2010-02-17 Nick Clifton + + PR 11238 + * Makefile.tpl (local-distclean): Also remove config.cache files in + sub-directories as there may not be Makefiles present in the + sub-directories. + * Makefile.tpl: Use "-exec rm {}" rather than "-delete" to delete + the config.cache files found by the find command. + + * Makefile.in: Regenerate. + * configure.ac: Revert previous delta. + * configure: Regenerate. + +2010-02-15 Nick Clifton + + PR 11238 + * configure.ac: Delete config.cache files in sub-directories when + deleting Makefiles. + * configure: Regenerate. + +2010-02-15 Nick Clifton + + * configure.ac: Sync from gcc. + * configure: Regenerate. + +2010-01-31 Kaveh R. Ghazi + + Sync from gcc: + * configure.ac: Add "recommended" version checks for GMP/MPC. + Update recommended GMP/MPFR/MPC versions. + * configure: Regenerate. + +2010-01-25 Joern Rennecke + + gcc PR libstdc++/36101, gcc PR libstdc++/42813 + * configure.ac (bootstrap_target_libs): Make inclusion of + target-libgomp conditional on libgomb being in target_configdirs. + * configure: Regenerate. + +2010-01-23 Joern Rennecke + + gcc PR libstdc++/36101, gcc PR libstdc++/42813 + * configure.ac (bootstrap_target_libs): Include target-libgomp. + * configure: Regenerate. + +2010-01-22 Joern Rennecke + + gcc PR libstdc++/36101, gcc PR libstdc++/42813 + * configure.ac (target_configdirs): Substitute. + * Makefile.def: Bootstrap target module libgomp. + Add dependency of all-target-libstdc++-v3 on configure-target-libgomp. + * Makefile.tpl (TARGET_CONFIGDIRS): New makefile variable. + (BASE_TARGET_EXPORTS): Export TARGET_CONFIGDIRS. + * configure, Makefile.in: Regenerate. + +2009-12-09 Ralf Wildenhues + + * libtool.m4: Sync from git Libtool. + * ltmain.sh: Likewise. + * ltoptions.m4: Likewise. + * ltversion.m4: Likewise. + * lt~obsolete.m4: Likewise. + +2010-01-07 Kaveh R. Ghazi + Francois-Xavier Coudert + + PR bootstrap/42424 + * configure.ac: Include libtool m4 files. + (_LT_CHECK_OBJDIR): Call it. + (extra_mpc_mpfr_configure_flags, extra_mpc_gmp_configure_flags, + gmplibs, ppllibs, clooglibs): Use $lt_cv_objdir. + + * configure: Regenerate. + +2010-01-07 Ralf Wildenhues + + PR bootstrap/41818 + * Makefile.tpl (BASE_TARGET_EXPORTS): Only add TARGET_LIB_PATH + to $(RPATH_ENVVAR) if bootstrapping. Fix typo in comment. + * Makefile.in: Regenerate. + +2009-12-18 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2009-12-17 Jeff Johnston + + * COPYING.NEWLIB: Update copyright date. + * COPYING.LIBGLOSS: Ditto. + +2009-12-07 Kaveh R. Ghazi + + PR middle-end/30447 + PR middle-end/30789 + PR other/40302 + + * configure.ac: Require MPC. + * configure: Regenerate. + + * configure.ac: Update minimum MPC version to 0.8. + * configure: Regenerate. + +2009-11-20 Paolo Bonzini + + * config.guess: Sync with upstream and gcc. + * config.sub: Sync with upstream and gcc. + +2009-11-16 Alexandre Oliva + + * Makefile.def: Restore host and target settings for gmp. + * Makefile.in: Rebuild. + +2009-11-16 Alexandre Oliva + + * configure.ac: Add libelf to host_libs. Enable in-tree configury + of ppl and cloog. Fix in-tree configury of libelf, skip tests. + Fix portability of test of C++ as bootstrap language. Add + ppl/src/ppl-config.o to the bootstrap compare exclusion list. + * configure: Rebuild. + * Makefile.def: Drop host and target settings from gmp, mpfr, ppl, + and cloog. Fix in-tree ppl configuration. Introduce libelf + in-tree building. + * Makefile.tpl (POSTSTAGE1_CXX_EXPORT): New. + (POSTSTAGE1_HOST_EXPORTS): Use it. + (STAGE[+id+]_CXXFLAGS): New. + (BASE_FLAGS_TO_PASS): Pass it down. + (configure-stage[+id+]-[+prefix+][+module+]): Use it. Add + extra_exports. + (all-stage[+id+]-[+prefix+][+module+]): Likewise. + (configure-[+prefix+][+module+], all-[+prefix+][+module+]): Add + extra_exports. + * Makefile.in: Rebuild. + +2009-11-06 Ozkan Sezer + + * configure.ac (FLAGS_FOR_TARGET): Add -L and -isystem + paths for *-w64-mingw* and x86_64-*mingw*. + * configure: Regenerated. + +2009-10-30 Kai Tietz + + * configure.ac: Disable target-winsup & co for + x86_64-*-mingw* and *-w64-mingw* targets. + * configure: Regenerated. + +2009-10-23 Rainer Orth + + * configure.ac (CLooG test): Use = with test. + * configure: Regenerate. + +2009-10-22 Richard Guenther + + * configure.ac: Do not set LIBS for ppl/cloog checks. Disable + cloog if the ppl version check failed. Move flags saving + before setting in libelf check. + * configure: Regenerate. + +2009-10-21 Richard Guenther + + * configure.ac: Adjust the ppl and cloog configure to work as + documented. Disable cloog if ppl was disabled. Omit the version + checks if they were disabled. + * configure: Re-generate. + +2009-10-13 Ralf Wildenhues + + * configure.ac: Add 'lto' to enable_languages, not + new_enable_languages, and only if not already present. + * configure: Regenerate. + +2009-10-06 Ian Lance Taylor + + * Makefile.def: check-gold depends upon all-gas. + * Makefile.in: Rebuild. + +2009-10-03 2009-02-05 Rafael Avila de Espindola + + * Makefile.def: all-lto-plugin depends on all-libiberty. + set bootstrap=true for lto-plugin. + Add lto-plugin. + * Makefile.in: Regenerate. + * configure.ac (host_libs): Add lto-plugin. + * configure: Regenerate. + +2009-10-03 Diego Novillo + + * Makefile.tpl (HOST_EXPORTS): Add LIBELFLIBS and LIBELFINC. + (HOST_LIBELFLIBS): Define. + (HOST_LIBELFINC): Define. + * Makefile.in: Regenerate. + * configure.ac: Add --enable-lto. + Add --with-libelf, --with-libelf-include and --with-libelf-lib. + If --enable-lto is used, add 'lto' to new_enable_languages. + If --enable-lto is used and gold is enabled, add + lto-plugin to configdirs. + * configure: Regenerate. + +2009-10-03 Simon Baldwin + + * configure.ac: If --with-system-zlib, suppress local zlib and + pass --with-system-zlib to subdir configure scripts. + * configure: Regenerate. + +2009-10-01 Loren J. Rittle + Paolo Bonzini + + * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Use $$s rather than + $(srcdir). + * Makefile.in: Rebuilt. + +2009-09-29 Paolo Bonzini + + Sync from gcc: + 2009-09-26 Kaveh R. Ghazi + + * configure.ac: Update minimum MPC version to 0.7. + * configure: Regenerate. + +2009-09-25 Nick Clifton + + * configure.ac: Pass any --cache-file=/dev/null option on to + subconfigures. + * configure: Regenerate. + +2009-09-23 Nick Clifton + + * config.sub, config.guess: Update from upstream sources. + +2009-09-22 Loren J. Rittle + + * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Remove stray $$r/. + * Makefile.in: Rebuilt. + +2009-09-22 Ralf Wildenhues + + PR bootstrap/32272 + * configure.ac: Error out if $srcdir isn't '.' but contains + host-${host_noncanonical}. + * configure: Regenerate. + +2009-09-21 Ralf Wildenhues + + * configure.ac: If bootstrapping a combined tree with + --enable-gold, require c++ in stage1_languages. + * configure: Regenerate. + + * configure.ac: Also add target_libs of stage1_languages to + bootstrap_target_libs. + * configure: Regenerate. + + * configure.ac: Diagnose --enable-build-with-cxx bootstrap + with --enable-languages not containing c++. + * configure: Regenerate. + +2009-09-16 Jie Zhang + + * configure.ac: Disable java and boehm-gc for bfin-*-*. + * configure: Regenerate. + +2009-09-08 Ralf Wildenhues + + * configure.ac: Do not use $extrasub for replacing @if/@endif + parts in Makefile; instead, use additional arguments to + AC_CONFIG_COMMANDS to do the replacement manually, with several + sed invocations, to avoid HP-UX sed command limits. + * configure: Regenerate. + +2009-09-04 Alexandre Oliva + + * configure.ac (with-build-config): Document. Handle without. + Handle missing argument. + * configure: Rebuilt. + +2009-09-03 Alexandre Oliva + + * configure.ac (--with-build-config): New. Set BUILD_CONFIG. + Default to bootstrap-debug only if compare-debug works. + * configure: Rebuilt. + * Makefile.tpl: Make BUILD_CONFIG configure-configurable. + * Makefile.in: Rebuilt. + +2009-09-01 Alexandre Oliva + + * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. + * Makefile.in: Rebuilt. + +2009-09-02 Paolo Bonzini + + * Makefile.tpl (AWK): Fix typo. + * Makefile.in: Regenerate. + +2009-09-02 Paolo Bonzini + + * configure.ac: Detect awk and sed. + * Makefile.def (flags_to_pass): Add AWK and SED. + * Makefile.tpl (AWK, SED): New. + (BASE_FLAGS_TO_PASS): Add AWK and SED. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2009-09-01 Tristan Gingold + + * setup.com: Ported to Itanium VMS. Can also build using DCL scripts. + Remove logical names. + +2009-08-31 Dave Korn + + * ltmain.sh (func_normal_abspath): New function. + (func_relative_path): Likewise. + (func_mode_help): Document new -bindir option for link mode. + (func_mode_link): Add new -bindir option, and use it to place + output DLL if specified. + +2009-08-24 Ralf Wildenhues + + * configure.ac (AC_PREREQ): Bump to 2.64. + +2009-08-22 Ralf Wildenhues + + * README-maintainer-mode: Point directly to upstream locations + for autoconf, automake, libtool, gettext, instead of copies on + sources.redhat.com. Document required versions. + * configure.ac: Do not substitute datarootdir, htmldir, + pdfdir, docdir. Do not process --with-datarootdir, + --with-htmldir, --with-pdfdir, --with-docdir. + * configure: Regenerate. + + * configure: Regenerate. + + * compile: Sync from Automake 1.11. + * depcomp: Likewise. + * install-sh: Likewise. + * missing: Likewise. + * mkinstalldirs: Likewise. + * ylwrap: Likewise. + +2009-08-19 Ralf Wildenhues + + * configure.ac: Call AC_DISABLE_OPTION_CHECKING. + (baseargs): Add --disable-option-checking. + * configure: Regenerate. + + * Makefile.def (configure-target-libiberty): Depend on + all-binutils and all-ld. + (configure-target-newlib): Likewise. + * Makefile.in: Regenerate. + +2009-08-19 Ralf Wildenhues + + Sync with GCC, merge: + + 2009-07-31 Christian Bruel + + * configure.ac (sh*-*-elf): Don't add target-libgloss to noconfigdirs. + * configure: Regenerate. + + 2009-07-06 Ian Lance Taylor + + * configure.ac: Add missing comma in AC_ARG_WITH(boot-libs). + * configure: Rebuild. + + 2009-06-26 Steve Ellcey + + PR bootstrap/40338 + * configure.ac (comparestring): Create new variable. + * Makefile.tpl (comparestring): Use to skip some comparisions. + * configure: Regenerate. + * Makefile.in: Regenerate. + + 2009-06-23 Ian Lance Taylor + + * configure.ac: Add --enable-build-with-cxx. When set, add c++ to + boot_languages. Only bootstrap target libraries listed in + target_libs for some boot language. Add --with-stage1-ldflags, + --with-stage1-libs, --with-boot-ldflags, --with-boot-libs. Remove + with_host_libstdcxx from ppllibs. Only add -fkeep-inline-functions + if not building with C++. + * Makefile.def: For target_module libstdc++-v3, set bootstrap=true. + * Makefile.tpl (STAGE1_LDFLAGS, STAGE1_LIBS): New variables. + (POSTSTAGE1_LDFLAGS, POSTSTAGE1_LIBS): New variables. + (HOST_EXPORTS): Add STAGE1_LDFLAGS to LDFLAGS. Export HOST_LIBS. + (POSTSTAGE1_HOST_EXPORTS): Set CXX and CXX_FOR_BUILD. Add + POSTSTAGE1_LDFLAGS to LDFLAGS. Export HOST_LIBS. + (POSTSTAGE1_FLAGS_TO_PASS): Likewise. + * configure, Makefile.in: Rebuild. + + 2009-06-08 Kaveh R. Ghazi + + * configure.ac: Detect MPC in default directory. + * configure: Regenerate. + + 2009-06-02 Richard Sandiford + + * configure.ac (powerpc-*-aix*, rs6000-*-aix*): Add target-newlib + to noconfdirs. + * configure: Regenerate. + + 2009-05-29 Kaveh R. Ghazi + + * Makefile.def: Add MPC support and dependencies. + * configure.ac: Likewise. Reorganize GMP/MPFR checks. + + * Makefile.in, configure: Regenerate. + + 2009-05-24 Nicolas Roche + + * Makefile.tpl (compare-target): Skip ./ada/*tools directories. + * Makefile.in: Regenerate. + + 2009-05-21 Dave Korn + + * configure.ac (cygwin noconfigdirs): Remove libgcj. + * configure: Regenerate. + + 2009-05-07 Dave Korn + + * configure.ac ($with_ppl): Default to no if not supplied. + ($with_cloog): Likewise. + configure: Regenerate. + + 2009-04-24 Kaveh R. Ghazi + + PR bootstrap/39739 + * configure.ac (extra_mpfr_configure_flags): Set and AC_SUBST. + * Makefile.def (module=mpfr): Use extra_mpfr_configure_flags. + + * configure, Makefile.in: Regenerate. + + 2009-04-14 Jakub Jelinek + + * configure.ac: Change copyright header to refer to version + 3 of the GNU General Public License and to point readers at the + COPYING3 file and the FSF's license web page. + * Makefile.def: Likewise. + * Makefile.tpl: Likewise. + * Makefile.in: Regenerate. + + 2009-04-09 Jack Howarth + + * configure.ac: Restore match for darwin9 or later. Use double + brackets since regeneration eats one pair. + * configure: Regenerate. + +2009-08-18 Christopher Faylor + + * MAINTAINERS: Perform some obvious fixups. + +2009-08-17 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2009-08-06 Michael Eager + + * configure.ac: Add Microblaze target. + * configure: Regenerate. + +2009-07-02 Tristan Gingold + + * configure.ac: Do not exclude gas for i386-*-darwin. + Add a case for x86_64-*-darwin. + * configure: Regenerate. + +2009-06-26 Doug Evans + + * Makefile.def (host_modules): Add cgen. + * Makefile.in: Regenerate. + * configure.ac (host_tools): Add cgen. + * configure: Regenerate. + +2009-06-17 Michael Eager + + * COPYING.LIBGLOSS: Add Xilinx license. + +2009-06-15 Ryan Mansfield + + * configure.ac: Define is_elf for QNX Neutrino targets. + * configure: Regenerate. + +2009-06-03 Jerome Guitton + Ralf Wildenhues + + * Makefile.tpl (all): Avoid a trailing backslash. + * Makefile.in: Regenerate. + +2009-06-03 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2009-06-02 Alexandre Oliva + + * Makefile.tpl ([+compare-target+]): Compare all stage + directories, rather than just gcc. + * Makefile.in: Rebuilt. + +2009-05-28 Doug Kwan + + * configure.ac: Support gold for target arm*-*-*. + * configure: Regenerate. + +2009-05-27 Alexandre Oliva + + * Makefile.tpl (all): Avoid harmless warning in make all when + gcc-bootstrap is enabled but stage_last does not exist. + * Makefile.in: Rebuilt. + +2009-05-25 Tristan Gingold + + * setup.com: Complete the file with configuration and build. + +2009-05-18 Alexandre Oliva + + PR other/40159 + * Makefile.tpl (all): Don't assume gcc-bootstrap and + gcc-no-bootstrap are mutually exclusive. + * Makefile.in: Rebuilt. + +2009-05-18 Alexandre Oliva + + PR other/40159 + * Makefile.tpl (all): Don't end with unconditional success. + * Makefile.in: Rebuilt. + +2009-05-12 Alexandre Oliva + + PR target/37137 + * Makefile.def (flags_to_pass): Remove redundant and incomplete + STAGE1_CFLAGS, STAGE2_CFLAGS, STAGE3_CFLAGS, and STAGE4_CFLAGS. + Add FLAGS_FOR_TARGET and BUILD_CONFIG. + (bootstrap_stage): Remove bootstrap-debug custom stages. Turn + stage_configureflags, stage_cflags and stage_libcflags into + explicit Makefile macros. + * Makefile.tpl (HOST_EXPORTS, EXTRA_HOST_FLAGS): Pass GCJ and + GFORTRAN. + (POSTSTAGE1_HOST_EXPORTS): Add XGCC_FLAGS_FOR_TARGET and TFLAGS to + CC. Set CC_FOR_BUILD from CC. + (BASE_TARGET_EXPORTS, RAW_CXX_TARGET_EXPORTS, + NORMAL_TARGET_EXPORTS): Move SYSROOT_CFLAGS_FOR_TARGET and + DEBUG_PREFIX_CFLAGS_FOR_TARGET from CFLAGS and CXXFLAGS to + XGCC_FLAGS_FOR_TARGET. Add it along with TFLAGS to CC, CXX, GCJ, + and GFORTRAN. + (TFLAGS, STAGE_CFLAGS, STAGE_TFLAGS, STAGE_CONFIGURE_FLAGS): New. + (_LIBCFLAGS): Renamed to _TFLAGS. + (do-compare-debug, do-compare3-debug): Drop. + (CC, GCC_FOR_TARGET, CXX_FOR_TARGET, RAW_CXX_FOR_TARGET, + GCJ_FOR_TARGET, GFORTRAN_FOR_TARGET): Remove FLAGS_FOR_TARGET. + (FLAGS_FOR_TARGET, SYSROOT_CFLAGS_FOR_TARGET, + DEBUG_PREFIX_CFLAGS_FOR_TARGET): Move down. + (XGCC_FLAGS_FOR_TARGET): New. + (BASE_FLAGS_TO_PASS): Pass STAGEid_CFLAGS, STAGEid_TFLAGS and TFLAGS. + (EXTRA_HOST_FLAGS): Pass GCJ and GFORTRAN. + (POSTSTAGE1_FLAGS_TO_PASS): Move SYSROOT_CFLAGS_FOR_TARGET and + DEBUG_PREFIX_CFLAGS_FOR_TARGET from CFLAGS, CXXFLAGS, LIBCFLAGS, + LIBCXXFLAGS to XGCC_FLAGS_FOR_TARGET. Add it along with TFLAGS + to CC, CXX, GCJ, and GFORTRAN. Pass XGCC_FLAGS_FOR_TARGET and + TFLAGS. + (BUILD_CONFIG): Include if requested. + (all): Set TFLAGS on bootstrap. + (configure-stageid-prefixmodule): Pass TFLAGS, adjust FLAGS. + (all-stageid-prefixmodule): Likewise. + (do-clean, distclean-stageid): Set TFLAGS. + (restrap): Fix whitespace. + * Makefile.in: Rebuilt. + +2009-04-25 Eric Botcazou + + * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Add GNATBIND. + (POSTSTAGE1_FLAGS_TO_PASS): Pick up exported value for GNATBIND. + * Makefile.in: Regenerate. + +2009-04-24 Eli Zaretskii + + * config.guess (pc:*:*:*): Return i586-pc-msdosdjgpp, for + consistency with config.sub. (Update from upstream sources.) + +2009-04-21 Joseph Myers + + * texinfo/texinfo.tex: Update to version 2009-03-28.05. + +2009-04-17 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2009-04-15 Anthony Green + + * configure.ac: Add moxie support. + * configure: Rebuilt. + +2009-04-09 Kaveh R. Ghazi + + * configure.ac: Bump minimum GMP/MPFR versions to 4.2 and 2.3.1. + * configure: Regenerate. + +2009-04-09 H.J. Lu + + PR gas/10039 + * configure.ac: Require texinfo 4.7. + * configure: Regenerated. + +2009-04-09 Steve Ellcey + + * Makefil.def (languages): New entries. + * Makefile.tpl (check-gcc-*): New generic target. + * Makefile.in: Regenerate. + +2009-03-27 Eli Zaretskii + + * djunpack.bat: Use ".." quoting in Sed command, for the sake of + Windows builds of Sed. + +2009-03-18 Tom Tromey + + * configure: Rebuild. + * configure.ac (host_libs): Add libiconv. + * Makefile.in: Rebuild. + * Makefile.def (host_modules): Add libiconv. + (configure-gdb, all-gdb): Depend on libiconv. + +2009-03-16 Tristan Gingold + + * configure.ac: Treat gdb as supported on x86_64-darwin. + * configure: Regenerate. + +2009-03-16 Joseph Myers + + Merge from GCC: + + 2009-03-16 Joseph Myers + + * configure.ac (--with-host-libstdcxx): New option. + * configure: Regenerate. + + 2009-01-29 Robert Millan + + * configure.ac: Recognize GNU/kOpenSolaris (*-*-kopensolaris*-gnu). + * configure: Regenerate. + + 2009-01-12 Sebastian Pop + + PR tree-optimization/38515 + * configure.ac (cloog-polylib): Removed. + (with_ppl, with_cloog): Test for "no". + * configure: Regenerated. + +2009-03-01 Ralf Wildenhues + + Backport from git Libtool: + + 2009-01-19 Robert Millan + Support GNU/kOpenSolaris. + * libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER) + (_LT_CHECK_MAGIC_METHOD, _LT_COMPILER_PIC, _LT_LINKER_SHLIBS) + (_LT_LANG_CXX_CONFIG) [kopensolaris*-gnu]: Recognize + GNU/kOpenSolaris. + +2009-02-05 Andreas Schwab + + * Makefile.tpl (stage_last): Define $r and $s before using + $(RECURSE_FLAGS_TO_PASS). + * Makefile.in: Regenerate + +2009-01-21 Jeff Johnston + + * COPYING.NEWLIB: Add ARM license. + +2009-01-16 Alan Modra + + * Makefile.def (configure-opcodes): Depend on configure-libiberty. + (all-opcodes): Depend on all-libiberty. + * Makefile.in: Regenerate. + +2009-01-15 Douglas B Rupp + + * configure.ac (ia64*-*-*vms*): Add case with no gdb or ld support. + * configure: Regenerate. + +2008-12-18 Ralf Wildenhues + + Backport link test fix from upstream Libtool: + + * libltdl.m4 (_LT_SYS_DYNAMIC_LINKER, _LT_LINKER_SHLIBS): + Add cache variables to tests that require the linker to work. + For shlibpath_overrides_runpath, this also changes the semantics + to let the result from the C compiler take precedence. + compiler take precedence. + +2008-12-02 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2008-12-17 Jeff Johnston + + * COPYING.NEWLIB: Updated. + * COPYING.LIBGLOSS: Ditto. + +2008-12-16 Paolo Bonzini + + Sync with GCC: + + 2008-12-12 Sebastian Pop + + * configure.ac (ppllibs): Add by default the lib flags. + * configure: Regenerate. + + 2008-12-04 Jack Howarth + + * configure.ac: Add double brackets on darwin[912]. + * configure: Regenerate. + + 2008-12-02 Jack Howarth + + * configure.ac: Expand to darwin10 and later. + * configure: Regenerate. + +2008-12-02 Andreas Schwab + + * Makefile.def: configure-target-boehm-gc depends on + all-target-libstdc++-v3. + * Makefile.in: Regenerate. + +2008-12-02 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2008-11-27 Joseph Myers + + Merge from GCC: + + 2007-12-02 Matthias Klose + + * config-ml.in: Remove 64bit configure tests. + + 2008-05-14 Rafael Espindola + + * config-ml.in: don't handle --enable-shared and --enable-static. + + 2008-09-02 Sebastian Pop + Tobias Grosser + Jan Sjodin + Harsha Jagasia + Dwarakanath Rajagopal + Konrad Trifunovic + Adrien Eliche + + Merge from graphite branch. + * configure: Regenerate. + * Makefile.in: Regenerate. + * configure.ac (host_libs): Add ppl and cloog. + Add checks for PPL and CLooG. + * Makefile.def (ppl, cloog): Added modules and dependences. + * Makefile.tpl (PPLLIBS, PPLINC, CLOOGLIBS, CLOOGINC): New. + (HOST_PPLLIBS, HOST_PPLINC, HOST_CLOOGLIBS, HOST_CLOOGINC): New. + + 2008-09-03 Richard Guenther + + * configure.ac: Always pass -DCLOOG_PPL_BACKEND to the + cloog test. + * configure: Re-generate. + + 2008-09-03 Sebastian Pop + + * configure.ac (--with-cloog-polylib): New. + (--disable-cloog-version-check): New. + (--disable-ppl-version-check): New. + * configure: Re-generate. + + 2008-09-05 Richard Guenther + + * configure.ac: Initialize clooglibs to -lcloog. + * configure: Re-generate. + + 2008-10-13 Kaveh R. Ghazi + + * configure.ac (MPFR check): Bump minimum version to 2.3.0 and + recommended version to 2.3.2. + + * configure: Regenerate. + + 2008-10-31 Ben Elliston + + * configure.ac (spu-*-*): Remove special case. + * configure: Regenerate. + + Complete comment text from GCC version of: + + 2008-08-31 Aaron W. LaFramboise + + * configure.ac (RPATH_ENVVAR): Use PATH on Windows. + (GCC_SHLIB_SUBDIR): New. + * Makefile.tpl (HOST_LIB_PATH_gcc): Use GCC_SHLIB_SUBDIR. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2008-11-27 Tristan Gingold + + * configure.ac: Build gdb for i?86-*-darwin* + * configure: Regenerated. + +2008-11-14 Daniel Jacobowitz + + PR bootstrap/38014 + PR bootstrap/37923 + + Revert: + + 2008-10-24 Daniel Jacobowitz + + * Makefile.tpl (HOST_EXPORTS): Correct CPPFLAGS typo. + * Makefile.in: Regenerated. + + 2008-10-22 Daniel Jacobowitz + + PR gdb/921 + PR gdb/1646 + PR gdb/2175 + PR gdb/2176 + + * Makefile.def (flags_to_pass): Add CPPFLAGS_FOR_BUILD and CPPFLAGS. + * Makefile.tpl (BUILD_EXPORTS): Set CPPFLAGS. + (EXTRA_BUILD_FLAGS): Correct typo. Pass CPPFLAGS. + (HOST_EXPORTS): Pass CPPFLAGS. + (CPPFLAGS_FOR_BUILD, CPPFLAGS, CPPFLAGS_FOR_TARGET): Define. + (LDFLAGS_FOR_TARGET): Initialize from configure script. + (EXTRA_TARGET_FLAGS): Set CPPFLAGS. + * Makefile.in, configure: Regenerated. + * configure.ac: Set CPPFLAGS_FOR_TARGET, LDFLAGS_FOR_TARGET, + and CPPFLAGS_FOR_BUILD. + +2008-10-29 Stefan Schulze Frielinghaus + + * configure.ac [spu-*-*]: Do not set skipdirs. + * configure: Re-generate. + +2008-10-24 Daniel Jacobowitz + + * Makefile.tpl (HOST_EXPORTS): Correct CPPFLAGS typo. + * Makefile.in: Regenerated. + +2008-10-22 Daniel Jacobowitz + + PR gdb/921 + PR gdb/1646 + PR gdb/2175 + PR gdb/2176 + + * Makefile.def (flags_to_pass): Add CPPFLAGS_FOR_BUILD and CPPFLAGS. + * Makefile.tpl (BUILD_EXPORTS): Set CPPFLAGS. + (EXTRA_BUILD_FLAGS): Correct typo. Pass CPPFLAGS. + (HOST_EXPORTS): Pass CPPFLAGS. + (CPPFLAGS_FOR_BUILD, CPPFLAGS, CPPFLAGS_FOR_TARGET): Define. + (LDFLAGS_FOR_TARGET): Initialize from configure script. + (EXTRA_TARGET_FLAGS): Set CPPFLAGS. + * Makefile.in, configure: Regenerated. + * configure.ac: Set CPPFLAGS_FOR_TARGET, LDFLAGS_FOR_TARGET, + and CPPFLAGS_FOR_BUILD. + +2008-09-29 Peter O'Gorman + + * libtool.m4: Update to libtool 2.2.6. + * lt~obsolete.m4: Update to libtool 2.2.6. + * ltmain.sh: Update to libtool 2.2.6. + * ltsugar.m4: Update to libtool 2.2.6. + * ltversion.m4: Update to libtool 2.2.6. + * ltoptions.m4: Update to libtool 2.2.6. + * ltgcc.m4: Update to match changes from libtool 2.2.6. + +2008-08-31 Aaron W. LaFramboise + + * configure.ac (RPATH_ENVVAR): Use PATH on Windows. + (GCC_SHLIB_SUBDIR): New. + * Makefile.tpl (HOST_LIB_PATH_gcc): Use GCC_SHLIB_SUBDIR. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2008-08-28 Tristan Gingold + + * configure.ac (powerpc-*-darwin*, i?86-*-darwin*,x86_64-*-darwin9): + Enable bfd, binutils and opcodes. + * configure: Regenerate. + +2008-08-16 Nicolas Roche + + * Makefile.tpl: Add BOOT_ADAFLAGS. + * Makefile.in: Regenerate. + +2008-08-16 Richard Sandiford + + * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu. + * configure: Regenerate. + +2008-07-30 Paolo Bonzini + + Sync with gcc: + 2008-07-30 Paolo Bonzini + + * configure.ac: Add makefile fragments for hpux. + * Makefile.def (flags_to_pass): Add ADA_CFLAGS. + * Makefile.tpl (HOST_EXPORTS): Pass ADA_CFLAGS. + * configure: Regenerate. + * Makefile.in: Regenerate. + + 2008-06-17 Ralf Wildenhues + + * Makefile.tpl ($(srcdir)/configure): Update dependencies. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2008-06-18 Ian Lance Taylor + + * src-release (BINUTILS_SUPPORT_DIRS): Remove mkdep and depcomp. + + * src-release (BINUTILS_SUPPORT_DIRS): Add depcomp. + +2008-06-17 Ralf Wildenhues + + * configure: Regenerate. + +2008-06-16 Ralf Wildenhues + + * configure.ac: Set TOPLEVEL_CONFIGURE_ARGUMENTS early, when + "$@" is still intact with both Autoconf 2.59 and 2.62. + * configure: Regenerate. + +2008-06-16 Ralf Wildenhues + + * Makefile.tpl: Fix comment errors. + * Makefile.in: Regenerate. + +2008-06-13 Julian Brown + + * configure.ac (arm*-*-linux-gnueabi): Don't disable building + of libobjc for ARM EABI Linux. + * configure: Regenerate. + +2008-06-12 David S. Miller + David Edelsohn + + * configure.ac: Add powerpc*-*-* to gold supported targets. + * configure: Regenerate. + +2008-06-08 Joseph Myers + + PR tree-optimization/36218 + * Makefile.def (flags_to_pass): Add LDFLAGS_FOR_BUILD. + * Makefile.tpl (EXTRA_BUILD_FLAGS): Define. + (all prefix="build-"): Pass them to build-system sub-makes. + * Makefile.in: Regenerate. + +2008-05-16 Daniel Jacobowitz + + * src-release (DEVO_SUPPORT): Add ChangeLog, MAINTAINERS, + README-maintainer-mode, lt~obsolete.m4, ltgcc.m4, depcomp, + mkdep, and compile. Update comments. + (ETC_SUPPORT): Add ChangeLog and update comments. + +2008-05-11 Ian Lance Taylor + + * src-release (BINUTILS_SUPPORT_DIRS): Add elfcpp and gold. + +2008-04-18 Paolo Bonzini + + Sync with gcc: + 2008-04-18 Paolo Bonzini + + PR bootstrap/35457 + * configure.ac: Include override.m4. + * configure: Regenerate. + + 2008-04-18 Paolo Bonzini + + * Makefile.tpl (restrap): Call `make all' using double-colon rules. + * Makefile.in: Regenerate. + + 2008-04-11 Eric B. Weddington + + * configure.ac: Do not build libssp for the AVR. + * configure: Regenerate. + +2008-04-18 Nick Clifton + + * MAINTAINERS: Replace reference to configure.in with reference to + configure.ac. + +2008-04-18 M R Swami Reddy + + * configure.ac (cr16-*-*): Add case for cr16 target and include gdb + as nonconfigurable directories list. + * configure: Regenerate. + +2008-04-14 David S. Miller + + * configure.ac: Add sparc*-*-* to gold supported targets. + * configure: Regenerate. + +2008-04-14 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2008-04-12 Hans-Peter Nilsson + + * Makefile.tpl : Error early unless at least GNU make 3.80. + * Makefile.in: Regenerate. + +2008-04-07 Ian Lance Taylor + + * Makefile.def: check-gold depends upon all-binutils. + * Makefile.in: Regenerate. + +2008-04-04 Nick Clifton + + PR binutils/4334 + * configure.ac: Run ACX_CHECK_CYGWIN_CAT_WORKS for cygwin hosted + builds. + * configure: Regenerate. + +2008-04-04 NightStrike + + PR other/35151 + * configure.ac: Combine rules for mingw32 and mingw64. + * configure: Regenerate. + +2008-03-27 Paolo Bonzini + + * Makefile.tpl (PICFLAG, PICFLAG_FOR_TARGET): Remove. + * Makefile.in: Regenerate. + +2008-03-20 Ian Lance Taylor + + * configure.ac: Add support for --enable-gold. + * Makefile.def: Add gold as a directory like ld. + * configure, Makefile.in: Regenerate. + +2008-03-19 Andreas Krebbel + + * opcodes/s390-mkopc.c (s390_opcode_cpu_val): S390_OPCODE_Z10 added. + (s390_cond_extensions): Reduced extensions to the compare related. + (main): z10 cpu type option added. + (expandConditionalJump): Renamed to ... + (insertExpandedMnemonic): ... this. + + * opcodes/s390-opc.c: Re-group the operand format makros. + (INSTR_RIE_RRPU, INSTR_RIE_RRP0, INSTR_RIE_RUPI, + INSTR_RIE_R0PI, INSTR_RIE_RUPU, INSTR_RIE_R0PU, INSTR_RIE_R0IU, + INSTR_RIE_R0I0, INSTR_RIE_R0UU, INSTR_RIE_R0U0, + INSTR_RIE_RRUUU, INSTR_RIS_RURDI, INSTR_RIS_R0RDI, INSTR_RIS_RURDU, + INSTR_RIS_R0RDU, INSTR_RRF_U0RR, INSTR_RRF_00RR, INSTR_RRS_RRRDU, + INSTR_RRS_RRRD0, INSTR_RXY_URRD, INSTR_SIY_IRD, INSTR_SIL_RDI, + INSTR_SIL_RDU): New instruction formats added. + (MASK_RIE_RRPU, MASK_RIE_RRP0, MASK_RIE_RUPI, MASK_RIE_R0PI, + MASK_RIE_RUPU, MASK_RIE_R0PU, MASK_RIE_R0IU, MASK_RIE_R0I0, + MASK_RIE_R0UU, MASK_RIE_R0U0, MASK_RIE_RRUUU, MASK_RIS_RURDI, + MASK_RIS_R0RDI, MASK_RIS_RURDU, MASK_RIS_R0RDU, MASK_RRF_U0RR, + MASK_RRF_00RR, MASK_RRS_RRRDU, MASK_RRS_RRRD0, MASK_RXY_URRD, + MASK_SIY_IRD, MASK_SIL_RDI, MASK_SIL_RDU): New instruction format + masks added. + (s390_opformats): New formats added "ris", "rrs", "sil". + * opcodes/s390-opc.txt: Add the conditional jumps with the + extensions removed from automatic expansion in s390-mkopc.c manually. + (asi - trtre): Add new System z10 EC instructions. + * include/opcode/s390.h (s390_opcode_cpu_val): S390_OPCODE_Z10 added. + +2008-03-17 Ralf Wildenhues + + * configure.ac: m4_include config/proginstall.m4. + * configure: Regenerate. + +2008-03-16 Ralf Wildenhues + + Backport from upstream Libtool: + + 2007-10-12 Eric Blake + + Deal with Autoconf 2.62's semantic change in m4_append. + * ltsugar.m4 (lt_append): Replace broken versions of + m4_append. + (lt_if_append_uniq): Don't require separator to be overquoted, + and avoid broken m4_append. + (lt_dict_add): Fix typo. + * libtool.m4 (_LT_DECL): Don't overquote separator. + +2008-03-13 David Edelsohn + + * config.rpath: Add AIX 6 support. + +2008-03-13 Paolo Bonzini + + * Makefile.def (stageprofile). Remove -fprofile-generate + from stage_libcflags. + * Makefile.in: Regenerate. + +2008-03-13 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2008-03-06 Florian Krohm + + * s390-opc.c (INSTR_RSL_R0RD): Fix operands. + * s390-opc.txt (cmpsc): Duplicate entry removed. + (dxr, sqdr, sqer, cxfbr, cdfbr, cefbr, lzer, lzdr, lzxr, + cegbr, cdgbr, cxgbr, cegr, cdgr, cxgr, cxfr, cdfr, cefr, fixr, fidr, + fier, cu42, cu41): Fix operand format. + +2008-02-20 Paolo Bonzini + + PR bootstrap/32009 + PR bootstrap/32161 + + * configure.ac (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Compute here. + * configure: Regenerate. + + * Makefile.def: Define stage_libcflags for all bootstrap stages. + * Makefile.tpl (BOOT_LIBCFLAGS, STAGE2_LIBCFLAGS, STAGE3_LIBCFLAGS, + STAGE4_LIBCFLAGS): New. + (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Subst from autoconf, without + $(SYSROOT_CFLAGS_FOR_TARGET) and $(DEBUG_PREFIX_CFLAGS_FOR_TARGET). + (BASE_TARGET_EXPORTS): Append them here to C{,XX}FLAGS. + (EXTRA_TARGET_FLAGS): Append them here to {LIB,}C{,XX}FLAGS. + (configure-stage[+id+]-[+prefix+][+module+]): Pass stage_libcflags + for target modules. Don't export LIBCFLAGS. + (all-stage[+id+]-[+prefix+][+module+]): Pass stage_libcflags; pass + $(BASE_FLAGS_TO_PASS) where [+args+] was passed, and [+args+] after + the overridden CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. + (invocations of `all'): Replace $(TARGET_FLAGS_TO_PASS) with + $(EXTRA_TARGET_FLAGS), $(FLAGS_TO_PASS) with $(EXTRA_HOST_FLAGS). + * Makefile.in: Regenerate. + +2008-02-16 Ralf Wildenhues + + PR libgcj/33085 + * libtool.m4 (_LT_COMPILER_PIC) [ mingw, cygwin ] : + Do not use -DDLL_EXPORT. Backport from upstream. + +2008-02-14 Nick Clifton + + Import this patch from gcc: + 2008-01-24 David Edelsohn + + * libtool.m4: Backport AIX 6 support from ToT Libtool. + +2008-02-02 Hans-Peter Nilsson + + * configure.ac: Enable fortran for cris-*-elf and crisv32-*-elf. + * configure: Regenerate. + +2008-01-31 Marc Gauthier + + * configure.ac (xtensa*-*-*): Recognize processor variants. + * configure: Regenerate. + +2008-01-30 Ralf Wildenhues + + PR bootstrap/34922 + * configure.ac (PARSE_ARGS): Push suitable setting of + ac_subdirs_all, for `./configure --help=recursive'. + Handle `+' in generic toplevel directory disabling. + * configure: Regenerate. + +2008-01-23 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2008-01-08 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2007-12-19 Jeff Johnston + + * COPYING.LIBGLOSS: Update default copyright. + +2007-12-19 Jeff Johnston + + * COPYING.NEWLIB: Update default copyright. + +2007-12-17 Kaveh R. Ghazi + + * configure.ac: Change required MPFR from 2.2.0 -> 2.2.1. + Change recommended MPFR from 2.2.1 > 2.3.0. + * configure: Regenerate. + +2007-12-13 Richard Sandiford + + * Makefile.tpl (CFLAGS_FOR_TARGET): Add -g. + (CXXFLAGS_FOR_TARGET): Add -O2 -g. + * Makefile.in: Regenerate. + +2007-12-10 Andreas Tobler + + * configure.ac: Enable libjava for x86_64-*-darwin9. + * configure: Regenerate. + +2007-12-05 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2007-11-28 Ralf Wildenhues + + * config-ml.in: Robustify against white space in absolute file + names. + + * config-ml.in (multi-clean): Substitute ${Makefile}. + Remove superfluous ${Makefile} in list. + +2007-10-23 Daniel Jacobowitz + + * Makefile.def (dependencies): Make configure-gdb depend on + all-intl. + * Makefile.in: Regenerated. + +2007-10-15 Patrick Mansfield + + * Makefile.def: To avoid problems running with parallel makes, + build newlib before libgloss so that target specific header + files are availble. + * Makefile.in: Regenerate. + +2007-10-11 Daniel Jacobowitz + + * Makefile.def (dependencies): Add all-gdb -> all-libdecnumber. + * Makefile.in: Regenerate. + +2007-10-11 Daniel Jacobowitz + + * src-release (GDB_SUPPORT_DIRS): Add libdecnumber. + * libdecnumber: New directory, imported from GCC. + +2007-10-08 Mike Frysinger + + * configure.ac (CFLAGS_FOR_BUILD, CXXFLAGS_FOR_BUILD, + LDFLAGS_FOR_BUILD): Default them to host flags only for $host = $build. + Set default CXXFLAGS_FOR_BUILD to CXXFLAGS, not CFLAGS. Set default + LDFLAGS_FOR_BUILD to LDFLAGS, not CFLAGS. + * configure: Regenerate. + +2007-10-01 Paolo Bonzini + + * Makefile.tpl (AR_FOR_BUILD, AS_FOR_BUILD, CXX_FOR_BUILD, + DLLTOOL_FOR_BUILD, GCJ_FOR_BUILD, GFORTRAN_FOR_BUILD, + LDFLAGS_FOR_BUILD, LD_FOR_BUILD, NM_FOR_BUILD, RANLIB_FOR_BUILD, + WINDMC_FOR_BUILD, WINDRES_FOR_BUILD): Use autoconf substitutions. + * configure.ac: Default them to host tools for $host = $build. + Subst them. + + * configure: Regenerate. + * Makefile.in: Regenerate. + +2007-09-20 Richard Sandiford + + * configure.ac (mipsisa*-*-elfoabi*): New stanza. + * configure: Regenerate. + +2007-09-19 Benjamin Kosnik + + * configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Move libgomp before + libstdc++. + * Makefile.def: Add libgomp config as a maybe dependency for libstdc++. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2007-09-17 Andreas Schwab + + * configure.ac: Raise minimum makeinfo version to 4.6. + * configure: Regenerate. + +2007-09-15 Alan Modra + + * configure.ac: Correct makeinfo version check. + * configure: Regenerate. + +2007-09-14 Richard Sandiford + + * configure.ac (mips*-sde-elf*): New stanza. Add target-libiberty + to $skipdirs and only disable gprof for newlib. Use the normal + mips*-elf* handling in other respects. + * configure: Regnerate. + +2007-09-12 David Daney + + * configure.ac: Remove mips64*-*-linux* noconfigdirs section, thus + enabling libgcj. + * configure: Regenerate. + +2007-09-12 Richard Guenther + + * configure.ac (--enable-stage1-checking): If neither --enable-checking + nor --disable-checking is provided also turn on yes and types + checking for stage1. + * configure: Re-generate. + +2007-09-11 Francois-Xavier Coudert + + PR target/33281 + * configure.ac: Use config/mh-mingw on mingw. + * configure: Regenerate. + +2007-09-10 Rask Ingemann Lambertsen + + PR other/32154 + * configure.ac: For libgloss targets, point the linker to the linker + script, startup code and simulator library. + * configure: Regenerate. + +2007-09-09 Andrew Haley + + * configure.ac (noconfigdirs): Remove target-libffi and + target-libjava. + +2007-08-29 Nick Clifton + + * config.sub, config.guess: Update from upstream sources. + +2007-08-21 Richard Guenther + + * configure.ac: Add types checking to stage1 checking flags. + * configure: Regenerate. + +2007-08-18 Paul Brook + Joseph Myers + + * Makefile.tpl (DEBUG_PREFIX_CFLAGS_FOR_TARGET): New. + (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Include it. + * Makefile.in: Regenerate. + * configure.ac (--with-debug-prefix-map): New. + * configure: Regenerate. + +2007-08-17 Richard Sandiford + Nigel Stephens + + * configure.ac (mips*-sde-elf*): New stanza. Use config/mt-sde + as target_makefile_frag. + * configure: Regenerate. + +2007-08-16 Alexandre Oliva + + * Makefile.def (STAGE2_CFLAGS, STAGE3_CFLAGS, STAGE4_CFLAGS): + Add to flags_to_pass. Adjust uses of BOOT_CFLAGS. + (bootstrap2-debug, bootstrap-debug): New bootstrap stages. + * Makefile.tpl (STAGE2_CFLAGS, STAGE3_CFLAGS, STAGE4_CFLAGS): New. + (do-compare, do-compare3, do-compare-debug): New. + ([+compare-target+]): Use them. + +2007-08-16 Alexandre Oliva + + * Makefile.def (STAGE2_CFLAGS, STAGE3_CFLAGS, STAGE4_CFLAGS): + Add to flags_to_pass. Adjust uses of BOOT_CFLAGS. + (bootstrap2-debug, bootstrap-debug): New bootstrap stages. + * Makefile.tpl (STAGE2_CFLAGS, STAGE3_CFLAGS, STAGE4_CFLAGS): New. + (do-compare, do-compare3, do-compare-debug): New. + ([+compare-target+]): Use them. + +2007-08-13 Ralf Wildenhues + Ben Elliston + + * configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS, baseargs): Pass + --silent if $silent. + * configure: Regenerate. + +2007-08-12 Daniel Jacobowitz + + * src-release (DEVO_SUPPORT): Add COPYING3 and COPYING3.LIB. + +2007-07-17 Nick Clifton + + * COPYING3: New file. Contains version 3 of the GNU General + Public License. + * COPYING3.LIB: New file. Contains version 3 of the GNU + Lesser General Public License. + +2007-07-11 Bernd Schmidt + + * configure.ac: Fix my previous change to really match GCC. + * configure: Regenerate. + +2007-07-11 Ralf Wildenhues + + * configure.ac: Rewrite 'configure --help' strings to look nicer. + * configure: Regenerate. + +2007-07-11 Ralf Wildenhues + + * configure.ac: Add some missing m4 quotation. + * configure: Regenerate. + +2007-07-09 Kai Tietz + + * Makefile.def: Add windmc tool to build. + * Makefile.tpl: Likewise. + * configure.ac: Likewise. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2007-07-05 H.J. Lu + + * lt~obsolete.m4: New. Import from 20070318 libtool. + +2007-06-29 Bernd Schmidt + + * configure.ac: Don't add target-libmudflap to noconfigdirs for + uclinux and linux-uclibc targets. + * configure: Regenerate. + +2007-06-28 DJ Delorie + + * configure.ac (arm*-*-linux-gnueabi): Don't build libgloss if we're + not building newlib. + * configure: Regenerated. + +2007-06-22 Daniel Jacobowitz + + * src-release (DEVO_SUPPORT): Correct typos. + +2007-06-18 Daniel Jacobowitz + + * Makefile.def: Add dependency from configure-gdb to all-bfd. + * Makefile.in: Regenerated. + +2007-06-14 Paolo Bonzini + + * Makefile.tpl (cleanstrap): Don't delete the toplevel Makefile. + (distclean-stage[+id+]): Possibly delete stage_last. + * Makefile.in: Regenerate. + +2007-06-07 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2007-06-07 Ben Elliston + + * Makefile.tpl: Fix spelling error. + * Makefile.in: Regenerate. + +2007-06-04 Paolo Bonzini + + Sync with gcc: + 2007-05-30 Jakub Jelinek + + PR bootstrap/29382 + * configure.ac: Don't use -fkeep-inline-functions for GCC < 3.3.1. + * configure: Rebuilt. + +2007-06-01 Steve Ellcey + + * libtool.m4 (LT_CMD_MAX_LEN): Try using getconf to set + lt_cv_sys_max_cmd_len. + +2007-05-31 Paolo Bonzini + + * ltgcc.m4: Update from GCC. + +2007-05-25 Andreas Tobler + + * ltmain.sh: Fix Darwin verstring, remove ${wl}. + +2007-05-24 Steve Ellcey + + * ltmain.sh: Update from GCC. + * libtool.m4: Update from GCC. + * ltsugar.m4: New. Update from GCC. + * ltversion.m4: New. Update from GCC. + * ltoptions.m4: New. Update from GCC. + * ltconfig: Remove. + * ltcf-c.sh: Remove. + * ltcf-cxx.sh: Remove. + * ltcf-gcj.sh: Remove. + * src-release: Update with new libtool file list. + +2007-05-16 Paolo Bonzini + + * Makefile.def (bootstrap_stage): Replace stage_make_flags with + stage_cflags. + * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS, POSTSTAGE1_FLAGS_TO_PASS): + Remove CFLAGS/LIBCFLAGS. + (configure-stage[+id+]-[+prefix+][+module+], + all-stage[+id+]-[+prefix+][+module+]): Pass it from [+stage_cflags+]. + * Makefile.in: Regenerate. + +2007-04-14 Steve Ellcey + + * config-ml.in: Update from GCC. + +2007-04-09 Daniel Jacobowitz + + * src-release (do-proto-toplev): Process the support directories before + the tool directory. + +2007-03-21 Richard Sandiford + + * configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Fix m4 quoting + of glob. Quote arguments with single quotes too. + * configure: Regenerate. + +2007-03-12 Brooks Moses + + * Makefile.def (fixincludes): Remove unneeded "missing" lines. + * Makefile.in: Regenerate + +2007-03-07 Andreas Schwab + + * configure: Regenerate. + +2007-03-01 Brooks Moses + + * configure.ac: Add "--with-pdfdir" configure option, + which defines pdfdir variable. + * Makefile.def (target=fixincludes): Add install-pdf to + missing targets. + (recursive_targets): Add install-pdf target. + (flags_to_pass): Add pdfdir. + * Makefile.tpl: Add pdfdir handling, add do-install-pdf + target. + * configure: Regenerate + * Makefile.in: Regenerate + +2007-02-28 Eric Christopher + + Revert: + 2006-12-07 Mike Stump + + * Makefile.def (dependencies): Add dependency for + install-target-libssp and install-target-libgomp on + install-gcc. + * Makefile.in: Regenerate. + +2007-02-27 Matt Kraai + + * configure: Regenerate. + * configure.ac: Move statements after variable declarations. + +2007-02-19 Joseph Myers + + * configure.ac: Adjust for loop syntax. + * configure: Regenerate. + +2007-02-18 Alexandre Oliva + + * configure: Rebuilt. + +2007-02-18 Alexandre Oliva + + * configure.ac: Drop multiple occurrences of --enable-languages, + and fix its quoting. + * configure: Rebuilt. + +2007-02-17 Mark Mitchell + Nathan Sidwell + Vladimir Prus + + * configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Fix quoting. + * configure: Regenerate. + +2007-02-13 Daniel Jacobowitz + + * configure.ac (target_libraries): Move libgcc before libiberty. + * configure: Regenerated. + +2007-02-13 Paolo Bonzini + + * configure: Regenerate again? + +2007-02-13 Paolo Bonzini + + * configure: Reapply PR30748 fix which was lost in the previous commit. + +2007-02-13 Daniel Jacobowitz + Paolo Bonzini + + PR bootstrap/30753 + * configure.ac: Remove obsolete build / host tests. Use AC_PROG_CC + unconditionally. Use AC_PROG_CXX. Use ACX_TOOL_DIRS to find $prefix. + * configure: Regenerated. + +2007-02-10 Paolo Bonzini + + * configure: Regenerate. + +2007-02-09 Daniel Jacobowitz + + PR bootstrap/30748 + * configure.ac: Correct syntax for Solaris ksh. + * configure: Regenerated. + +2007-02-09 Paolo Bonzini + + * Makefile.def: Sync with GCC. + * Makefile.tpl: Sync with GCC. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2007-02-09 Daniel Jacobowitz + + * Makefile.tpl (build_alias, host_alias, target_alias): Use + noncanonical equivalents. + * configure.in: Rename to... + * configure.ac: ...this. Update AC_PREREQ. Prevent error for + AS_FOR_TARGET. Set build_noncanonical, host_noncanonical, and + target_noncanonical. Use them. Rewrite removal of configure + arguments for autoconf 2.59. Discard variable settings. Force + program_transform_name for native tools. + + * Makefile.in: Regenerated. + * configure: Regenerated with autoconf 2.59. + + * src-release (DEVO_SUPPORT, do-proto-toplev): Expect configure.ac. + +2007-02-08 Jeff Johnston + + * COPYING.LIBGLOSS: Reformat default Red Hat + license to fit within 80 columns. + * COPYING.NEWLIB: Ditto. + +2007-02-05 Dave Brolley + + * Contribute the following changes: + 2006-11-28 DJ Delorie + + * configure.in: Fix typo for mep's target_makefile_frag. + * configure: Regenerated. + + 2005-04-22 Richard Sandiford + + * configure.in (mep*): Add -mlibrary to FLAGS_FOR_TARGET. + * configure: Regenerate. + + 2001-09-19 DJ Delorie + + * configure.in (target_makefile_frag): use mt-mep + + 2001-06-12 Don Howard + + * configure.in: Remove gdb from MeP skip list. + + 2001-04-05 DJ Delorie + + * configure.in (noconfigdirs): Remove gcc from MeP skip list. + + 2001-03-20 Ben Elliston + + * configure.in (noconfigdirs): Add gcc and gdb for MeP. + + 2001-03-19 Ben Elliston + + * config.sub (mep, mep-*): Add. + +2007-01-31 Andreas Schwab + + * Makefile.tpl (LDFLAGS): Substitute it. + * Makefile.in: Regenerate. + +2007-01-11 Paolo Bonzini + + * configure.in: Change == to = in test command. + * configure: Regenerate. + +2007-01-11 Paolo Bonzini + Nick Clifton + Kaveh R. Ghazi + + * configure.in (build_configargs, host_configargs, target_configargs): + Remove build/host/target parameters. + (host_libs): Add gmp and mpfr. + (GMP tests): Reorganize to allow in-tree GMP/MPFR. + * Makefile.def (gmp, mpfr): New. + (gcc): Remove target. + * Makefile.tpl (build_os, build_vendor, host_os, host_vendor, + target_os, target_vendor): New. + (configure): Add host_alias/target_alias arguments. Adjust invocations. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2007-01-11 Matt Fago + + * configure.in: Try to link to functions only in mpfr 2.2.x + to improve robustness of configure tests. + * configure: Regenerate. + +2007-01-08 Kai Tietz + + * configure.in: Add support for an x86_64-mingw* target. + * configure: Regenerate. + +2007-01-05 Daniel Jacobowitz + + * Makefile.tpl (all-target): Correct @if conditional for target + modules. + * configure.in: Omit libiberty if building only target libgcc. + * configure, Makefile.in: Regenerated. + +2007-01-04 Paolo Bonzini + + * configure.in: Use DEV-PHASE to detect the default for --enable-werror. + * configure: Regenerate. + +2007-01-03 Daniel Jacobowitz + + * Makefile.def (target_modules): Add libgcc. + (lang_env_dependencies): Remove default items. Use no_c and no_gcc. + * Makefile.tpl (clean-target-libgcc): Delete. + (configure-target-[+module+]): Emit --disable-bootstrap dependencies + on gcc even for bootstrapped modules. Rewrite handling of + lang_env_dependencies to loop over target_modules. + * configure.in (target_libraries): Add target-libgcc. + * Makefile.in, configure: Regenerated. + +2006-12-29 Paolo Bonzini + + Sync with gcc: + 2006-12-29 Paolo Bonzini + + * configure.in: Reorganize recognition of languages. Add + --enable-stage1-languages. Show supported languages for the chosen + target rather than all recognized languages. + * configure: Regenerate. + + 2006-12-29 Paolo Bonzini + + * Makefile.tpl (GCC_STRAP_TARGETS, all-prebootstrap): Remove. + * Makefile.in: Regenerate. + + 2006-12-29 Kaveh R. Ghazi + + * configure.in: Warn that MPFR 2.2.0 is buggy. + * configure: Regenerate. + +2006-12-27 Ian Lance Taylor + + * configure.in: When removing Makefiles to force a reconfigure, also + remove prev-DIR*/Makefile. + * configure: Regenerate. + +2006-12-23 Kazu Hirata + + * config.bfd: Recognize fido. + +2006-12-19 Paolo Bonzini + + Sync with gcc: + + 2006-12-19 Paolo Bonzini + + * configure.in: Remove "$build" case for powerpc-*-darwin* since + it only affects bootstrap and could be tested on "$host" as well. + * configure: Regenerate. + * config/mh-ppc-darwin: Add to the stage1 cflags here. + + 2006-12-19 Paolo Bonzini + + PR bootstrap/29544 + * Makefile.def (flags_to_pass): Add STAGE1_CHECKING. + (bootstrap_stage): Add STAGE1_CHECKING to stage1 configure flags, + move here comment from Makefile.tpl. + * Makefile.tpl: Move some definitions higher in the file. + (STAGE1_CHECKING): New. + * configure.in: Add --enable-stage1-checking. + * configure: Regenerate. + * Makefile.in: Regenerate. + + 2006-12-03 Kaveh R. Ghazi + + * configure.in: Update error message for missing GMP/MPFR. + + * configure: Regenerate. + + 2006-12-02 Kaveh R. Ghazi + + * configure.in: Update MPFR version in error message. + + * configure: Regenerate. + + 2006-11-26 Kaveh R. Ghazi + + * configure.in (--with-mpfr-dir, --with-gmp-dir): Remove flags. + (--with-mpfr-include, --with-mpfr-lib, --with-gmp-include, + --with-gmp-lib): New flags. + + * configure: Regenerate. + +2006-12-12 Andreas Tobler + + PR bootstrap/30134 + * configure.in: Correct x86 darwin support for libjava to powerpc + and i?86 only. + * configure: Regenerate. + +2006-12-11 Alan Modra + + * configure.in: Handle spu makefile frag. + * Makefile.tpl (MAINT): Define + (MAINTAINER_MODE_FALSE, MAINTAINER_MODE_TRUE): Define. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2006-12-11 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2006-12-11 Ben Elliston + + * configure.in: Sync with GCC (spu-*-*). + * configure: Sync with GCC. + +2006-12-07 Mike Stump + + * Makefile.def (dependencies): Add dependency for + install-target-libssp and install-target-libgomp on + install-gcc. + * Makefile.in: Regenerate. + +2006-11-16 Paolo Bonzini + + * Makefile.tpl (clean-target-libgcc): Test for gcc Makefile presence. + (unstage): Test for stage_last presence. + + PR bootstrap/29802 + * Makefile.tpl (POSTSTAGE1_FLAGS_TO_PASS): Add HOST_SUBDIR in STAGE_PREFIX. + * Makefile.in: Regenerate. + +2006-11-14 DJ Delorie + + * Makefile.tpl (clean-stage*): Sync with GCC (clean). + * Makefile.in: Sync with GCC. + * configure.in: Sync with GCC (mpfr, gmp). + * configure: Sync with GCC. + +2006-11-08 Jie Zhang + + * configure.in: Remove target-libgloss from noconfigdirs for + bfin-*-*. + * configure: Regenerated. + +2006-10-27 Jeff Johnston + + * COPYING.NEWLIB: Add spu license. + * COPYING.LIBGLOSS: Ditto. + +2006-10-17 Brooks Moses + + * Makefile.def: Added pdf target handling. + * Makefile.tpl: Added pdf target handling. + * Makefile.in: Regenerated. + +2006-10-11 Jeff Johnston + + * COPYING.NEWLIB: Updated. + * COPYING.LIBGLOSS: Ditto. + +2006-09-27 Dave Brolley + + * configure.in (RUNTEST): Look for 'runtest' in the source tree by using + $s instead of $r. + * configure: Regenerated. + +2006-09-26 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2006-09-20 Thiemo Seufer + + * configure.in: Remove redundant handling of mips*-dec-bsd*. Likewise + for mipstx39-*-*. Disable libgloss for mips64*-*-linux*. + * configure: Regenerate. + +2006-08-30 Corinna Vinschen + + * configure.in: Never build newlib for a Mingw host. + Never build newlib as Mingw target library. + Test the existence of winsup/cygwin for building a Cygwin newlib, + rather than just winsup. + Add winsup/mingw and winsup/w32api paths to FLAGS_FOR_TARGET if + building a Mingw target. + * configure: Regenerate. + +2006-08-15 Thiemo Seufer + Nigel Stephens + David Ung + + * config.sub: Add support for sde as alias of mipsisa32-sde-elf. + +2006-07-25 Paolo Bonzini + + Sync from GCC: + 2006-07-04 Eric Botcazou + + PR bootstrap/18058 + * configure.in: Add -fkeep-inline-functions to CFLAGS for stage 1 + if the bootstrap compiler is a GCC version that supports it. + * configure: Regenerate. + +2006-07-22 Daniel Jacobowitz + + * configure.in: Allow mingw32 and cygwin targets to build cross-gdb. + * configure: Regenerated. + +2006-07-18 Paolo Bonzini + + * Makefile.tpl (configure-stageN-MODULE): Pass --with-build-libsubdir + for stages after the first. + +2006-07-17 Jakub Jelinek + + * Makefile.def: Add dependencies for configure-opcodes + on configure-intl and all-opcodes on all-intl. + * Makefile.in: Regenerated. + +2006-07-04 Peter O'Gorman + + * ltconfig: chmod 644 before ranlib during install. + +2006-07-03 Paolo Bonzini + + * configure.in: Fix thinkos in previous check-in. + * configure: Regenerate. + +2006-07-03 Paolo Bonzini + + Sync from gcc: + + 2007-07-03 Paolo Bonzini + + PR other/27063 + * configure.in: Test subdir_requires and give an appropriate + error message. + * configure: Regenerate. + + 2006-06-16 Rainer Orth + + PR target/27540 + * configure.in: Only enable libgomp on IRIX 6. + * configure: Regenerate. + +2006-06-20 David Ayers + + PR bootstrap/28072 + * configure.in: Add target-boehm-gc to noconfigdirs depending on + whether target-libjava is being configured instead of whether the + java front end is enabled. + * configure: Regenerate. + +2006-06-15 Mark Shinwell + + * include/elf/arm.h: Correct names of R_ARM_LDC_G{0,1,2} + to R_ARM_LDC_SB_G{0,1,2} respectively. + +2006-06-15 Paolo Bonzini + + * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Export CFLAGS and LDFLAGS + too. + * Makefile.in: Regenerate. + +2006-06-13 John David Anglin + + Sync from gcc: + + 2006-06-12 John David Anglin + * configure.in: Don't enable libgomp on hpux10. + * configure: Rebuilt. + +2006-06-13 David Ayers + + Sync from gcc: + + 2006-06-12 David Ayers + + PR bootstrap/27963 + PR target/19970 + * configure.in: Remove target-boehm-gc from noconfigdirs where + ${libgcj} is specified. + * configure: Regenerate. + +2006-06-08 Jeff Johnston + + Sync from gcc: + + 2005-01-12 David Edelsohn + Andreas Schwab + + PR bootstrap/18033 + * config-ml.in: Eval option if surrounded by single quotes. + +2006-06-07 Carlos O'Donell + + Sync from gcc: + + 2006-06-06 David Ayers + + PR libobjc/13946 + * Makefile.def: Add dependencies for libobjc which boehm-gc. + * Makefile.in: Regenerate. + * configure.in: Add --enable-objc-gc at toplevel and have it + enable boehm-gc for Objective-C. + Remove target-boehm-gc from libgcj. + Add target-boehm-gc to target_libraries. + Add target-boehm-gc to noconfigdirs where ${libgcj} + is specified. + Assert that boehm-gc is supported when requested for Objective-C. + Only build boehm-gc if needed either for Java or Objective-C. + * configure: Regenerate. + + 2006-06-05 Paolo Bonzini + + PR 27674 + * Makefile.tpl (configure-[+prefix+][+module+], + all-[+prefix+][+module+]): Depend on stage_current if bootstrapping. + Remove rule to unstage bootstrapped modules. + (stage_current): New. + * Makefile.in: Regenerate. + + 2006-05-20 John David Anglin + Andreas Tobler + + * configure.in: Enable libgcj for hppa*-hp-hpux11*. + * configure: Rebuilt. + + Revert + 2006-01-31 Richard Guenther + Paolo Bonzini + + * Makefile.def (target_modules): Add libgcc-math target module. + * configure.in (target_libraries): Add libgcc-math target library. + (--enable-libgcc-math): New configure switch. + * Makefile.in: Re-generate. + * configure: Re-generate. + +2006-06-05 Jeff Johnston + + * config-ml.in: Alter CCASFLAGS to include special + multilib options the same as is done for CFLAGS. + +2006-05-31 Daniel Jacobowitz + + * Makefile.def: Added dependencies from sim and gdb on intl, and + added configure dependencies to everything with an all dependency + on intl. + * gettext.m4: Removed. + * src-release (DEVO_SUPPORT): Don't mention gettext.m4. + (GDB_SUPPORT_DIRS): Add intl. + * Makefile.in: Regenerated. + +2006-05-25 Daniel Jacobowitz + + * src-release (DEVO_SUPPORT): Add config.rpath. + +2006-05-25 Paolo Bonzini + + * Makefile.def (bfd, opcodes): Fix lib_path. + * Makefile.tpl (POSTSTAGE1_FLAGS_TO_PASS): Replace ADAC with ADAFLAGS. + (restrap): Move under "@if gcc-bootstrap". Fix typo. + * Makefile.in: Regenerate. + +2006-05-24 Mark Shinwell + + * configure.in: Enable gprof for cross builds. + * configure: Regenerate. + +2006-05-17 Daniel Jacobowitz + + * src-release (MAKEINFOFLAGS): Define. + (do-proto-toplev): Pass MAKEINFOFLAGS to submakes. + +2006-05-14 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2006-05-12 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2006-05-04 Steve Ellcey + + * blt, iwidgets, mmalloc: Remove directories. + +2006-05-01 DJ Delorie + + * configure.in: Restore CFLAGS if GMP isn't present. + * configure: Regenerate. + +2006-04-18 DJ Delorie + + * configure.in (m32c): Build libstdc++-v3. Pass flags to + reference libgloss so that libssp can be built in a combined + tree. + * configure: Regenerate. + +2006-04-10 Ben Elliston + + * contrib: Remove directory. + +2006-04-06 Carlos O'Donell + + * Makefile.tpl: Add install-html target. + * Makefile.def: Add install-html target. + * Makefile.in: Regenerate. + * configure.in: Add --with-datarootdir, --with-docdir, + and --with-htmldir options. + * configure: Regenerate. + +2006-03-31 Ben Elliston + + PR binutils/1860 + * configure.in: Require makeinfo 4.4 or higher. + * configure: Regenerate. + +2006-03-14 Paolo Bonzini + + * Makefile.in: Regenerate. + +2006-03-14 Paolo Bonzini + + Sync with gcc: + 2006-03-10 Aldy Hernandez + + * configure.in: Handle --disable- generically. + * configure: Regenerate. + + 2006-02-21 Rafael Avila de Espindola + + * Makefile.tpl (BUILD_CONFIGDIRS): Remove. + (TARGET_CONFIGDIRS): Remove. + * configure.in: Remove AC_SUBST(target_configdirs). + * Makefile.in, configure: Regenerated. + + +2006-03-01 H.J. Lu + + PR libgcj/17311 + * ltmain.sh: Don't use "$finalize_rpath" for compile. + +2006-02-20 Paolo Bonzini + + PR bootstrap/25670 + + * Makefile.tpl ([+compare-target+]): Print explanation messages. + + * Makefile.def (ADAFLAGS, BOOT_ADAFLAGS, LANGUAGES): New flags_to_pass. + * Makefile.tpl (BASE_FLAGS_TO_PASS): Support optional flags_to_pass. + (EXTRA_GCC_FLAGS): Remove ADAFLAGS, BOOT_ADAFLAGS, LANGUAGES, + BUILD_PREFIX, BUILD_PREFIX_1. + * configure.in: (BUILD_PREFIX, BUILD_PREFIX_1): Don't substitute. + + * Makefile.def (bootstrap stage 1): Pass LIBCFLAGS too. + * Makefile.tpl (POSTSTAGE1_FLAGS_TO_PASS): Override LIBCFLAGS too. + + * Makefile.tpl (configure-stage[+id+]-[+prefix+][+module+], + all-stage[+id+]-[+prefix+][+module+], : Use $(current_stage) instead + of `cat stage_current`. Always provide the `r' and `s' variables. + (clean-stage[+id+]-[+prefix+][+module+]): Likewise, and make it into + a single shell execution. + (configure-[+prefix+][+module+], all-[+prefix+][+module+]): For + bootstrapped modules, make the stage1 module if the build was not + started yet, else build the current stage. + (all-host, all-target): Omit bootstrapped modules (if bootstrapping). + (all-build, all-host, all-target, [+make_target+]-host, + [+make_target+]-target): Do not use \-continued lines. + (target modules): Depend on stage_last, not all-gcc, if bootstrapping. + (current_stage, restrap, stage_last): New. + + * Makefile.in: Regenerate. + * configure: Regenerate. + +2006-02-14 Paolo Bonzini + + Sync from gcc: + + 2006-01-31 Richard Guenther + Paolo Bonzini + + * Makefile.def (target_modules): Add libgcc-math target module. + * configure.in (target_libraries): Add libgcc-math target library. + (--enable-libgcc-math): New configure switch. + * Makefile.in: Re-generate. + * configure: Re-generate. + * libgcc-math: New toplevel directory. + + 2006-01-18 Richard Henderson + Jakub Jelinek + Diego Novillo + + * libgomp: New directory. + * Makefile.def: Add target_module libgomp. + * Makefile.in: Regenerate. + * configure.in (target_libraries): Add target-libgomp. + * configure: Regenerate. + +2006-02-14 Paolo Bonzini + Andreas Schwab + + * configure: Regenerate. + +2006-01-16 Paolo Bonzini + + * configure.in: Set with_gnu_as, with_gnu_ld, with_newlib earlier. + Set md_exec_prefix. Use ACX_CHECK_INSTALLED_TARGET_TOOL to find + the assembler, linker and binutils. + * configure: Regenerate. + +2006-01-16 Nick Clifton + + * config.sub, config.guess: Sync from config repository. + +2006-01-05 Alexandre Oliva + + * Makefile.tpl (clean-stage[+id+]-[+prefix+][+module+]): Remove + @ from continuation. + * Makefile.in: Rebuilt. + +2006-01-04 Paolo Bonzini + + Sync from gcc: + + 2006-01-04 Paolo Bonzini + + PR bootstrap/24252 + + * Makefile.def (flags_to_pass): Add STAGE1_CFLAGS and STAGE1_LANGUAGES. + * Makefile.tpl (OBJDUMP): New. + (EXTRA_HOST_FLAGS): Add it. + (EXTRA_GCC_FLAGS): Remove flags already specified in flags_to_pass. + + * Makefile.tpl (stage[+id+]-start, stage[+id+]-end): Do not try + to use symbolic links between directories. Avoid race conditions + or make them harmless. + * configure.in: Do not try to use symbolic links between directories. + + * Makefile.def (LEAN): Pass. + * Makefile.tpl (LEAN): Define. + (stage[+id+]-start): Accept that the previous directory does not + exist, if the bootstrap is lean. + (stage[+id+]-bubble): Invoke lean bootstrap commands after + stage[+id+]-start. Use a makefile variable and an `if' instead of a + configure substitution. + ([+compare-target+]): Likewise. + ([+bootstrap-target+]-lean): New. + * configure.in: Remove lean bootstrap support from here. + + * Makefile.in: Regenerate. + * configure: Regenerate. + + 2006-01-02 Andreas Schwab + + * configure.in: When reconfiguring remove Makefile in + all stage directories. + * configure: Regenerate. + +2005-12-27 Leif Ekblad + + * configure.in: Add support for RDOS target. + * configure: Regenerate. + +2005-12-27 Nick Clifton + + PR binutils/1990 + * libtool.m4: Synchronize with version in GCC sources. + +2005-12-20 Paolo Bonzini + + Revert Ada-related part of the previous change. + + * Makefile.def (ADAFLAGS, BOOT_ADAFLAGS, ADAFLAGS_FOR_TARGET): + Do not pass. + * Makefile.tpl (BOOT_ADAFLAGS): Do not define. + * Makefile.in: Regenerate. + * configure.in: Do not include mt-ppc-aix target fragment. + * configure: Regenerate. + +2005-12-19 Paolo Bonzini + + * configure.in: Select appropriate fragments for PowerPC/AIX. + * configure: Regenerate. + + * Makefile.def (flags_to_pass): Add ADAFLAGS, BOOT_ADAFLAGS, + BOOT_CFLAGS, BOOT_LDFLAGS. + * Makefile.tpl (POSTSTAGE1_FLAGS_TO_PASS): Handle BOOT_ADAFLAGS, + BOOT_CFLAGS, BOOT_LDFLAGS. + (TARGET_FLAGS_TO_PASS): Handle ADAFLAGS_FOR_TARGET. + (stage[+id+]-bubble): Pass flags recursively to the comparison target. + (stage): Fail if we cannot complete the work. + * Makefile.in: Regenerate. + +2005-12-16 Jeff Johnston + + * COPYING.NEWLIB: Update copyright year for default + copyright. + +2005-12-15 Paolo Bonzini + + * Makefile.tpl (all, do-[+make_target+], do-check, install, + install-host-nogcc): Don't invoke $(stage) at the end. + * Makefile.in: Regenerate. + +2005-12-14 Paolo Bonzini + + * configure.in: Flip the top-level bootstrap switch. + * configure: Regenerate. + + Merge from gcc: + + 2005-12-14 Daniel Jacobowitz + + * Makefile.tpl: Throughout the file, use : $(MAKE) along with + $(stage) and $(unstage). + (EXTRA_TARGET_FLAGS): Correct double-quoting. + (all): Remove stray semicolon. + (local-distclean): Don't handle multilib.tmp and multilib.out. + (install.all): Set $s for consistency. + (configure-[+prefix+][+module+]): Instead of [+deps+], handle + check_multilibs setting. Always make the install directory. + (configure-stage[+id+]-[+prefix+][+module+]): Likewise. + Correct @if/@endif. + (all-stage[+id+]-[+prefix+][+module+]): Correct @if/@endif. + ($(TARGET_SUBDIR)/[+module+]/multilib.out): Remove. + (stage[+id+]-start, stage[+id+]-end): Stage $(TARGET_SUBDIR). + (multilib.out): Remove. + * Makefile.in: Regenerated. + +2005-12-12 Nathan Sidwell + + * config.sub: Replace ms1 arch with mt. Allow ms1 as alias. + * configure.in: Replace ms1 arch with mt. + * configure: Rebuilt. + +2005-12-05 Paolo Bonzini + + Sync with gcc: + +2005-12-12 Nathan Sidwell + + * config.sub: Replace ms1 arch with mt. Allow ms1 as alias. + * configure.in: Replace ms1 arch with mt. + * configure: Rebuilt. + +2005-12-05 Paolo Bonzini + + Sync with gcc: + + 2005-12-05 Paolo Bonzini + + * configure.in (CONFIGURED_BISON, CONFIGURED_YACC, CONFIGURED_M4, + CONFIGURED_FLEX, CONFIGURED_LEX, CONFIGURED_MAKEINFO): Remove + "CONFIGURED_" from the AC_CHECK_PROGS invocation. Move below. + Find in-tree tools if available. + (EXPECT, RUNTEST, LIPO, STRIP): Find them and substitute them. + (CONFIGURED_*_FOR_TARGET): Don't set nor substitute. + (*_FOR_TARGET): Set them with GCC_TARGET_TOOL. + (COMPILER_*_FOR_TARGET): New. + * Makefile.tpl (HOST_EXPORTS): Add *_FOR_TARGET symbols that gcc needs. + (BASE_TARGET_EXPORTS): Use COMPILER_*_FOR_TARGET symbols. + (CONFIGURED_*, USUAL_*): Remove. + (BISON, YACC, FLEX, LEX, M4, MAKEINFO, EXPECT, RUNTEST, LIPO, + STRIP): Use autoconf substitutions. + (COMPILER_AS_FOR_TARGET, COMPILER_LD_FOR_TARGET, + COMPILER_NM_FOR_TARGET): New. + (EXTRA_HOST_FLAGS): Pass LIPO and STRIP. + + (all): Make all-host and all-target in parallel. + (do-[+make_target+], do-check, install, [+compare-target+]): Ensure + that $$r and $$s are set before invoking a recursive make. + (stage[+id+]-bubble): Likewise, and invoke the comparison at the end. + ([+bootstrap-target+]): Inline most of the `all' target. + + 2005-11-29 Ben Elliston + + * Makefile.tpl (clean-target-libgcc): Invoke clean-target-libgcc + from the gcc build directory. + * Makefile.in: Regenerate. + + 2005-11-29 Ben Elliston + + * Makefile.def: Add new libdecnumber host_module. Make all-gcc + depend on all-libdecnumber. + * configure.in (host_libs): Include libdecnumber. + * Makefile.in: Regenerate. + * configure: Likewise. + + 2005-11-21 Kean Johnston + + * config.sub, config.guess: Sync from upstream sources. + +2005-11-11 Daniel Jacobowitz + + * Makefile.def: Remove gdb dependencies for gdbtk. + * Makefile.tpl (CONFIGURE_GDB_TK, INSTALL_GDB_TK): New variables. + (configure-gdb, install-gdb): New rules. + * configure.in: Set CONFIGURE_GDB_TK and INSTALL_GDB_TK. + * Makefile.in, configure: Regenerated. + +2005-10-22 Paolo Bonzini + + PR bootstrap/24297 + * Makefile.tpl (do-[+make-target+], do-check, install, + stage[+id+]-bubble, [+compare-target+]): Ensure $$r and $$s + are set before recursing. + * Makefile.in: Regenerate. + +2005-10-20 Eric Botcazou + + PR bootstrap/18939 + * Makefile.def (gcc) : Fix thinko. + * Makefile.in: Regenerate. + +2005-10-17 Bernd Schmidt + + * configure.in (bfin-*-*): Use test, not brackets, in if statement. + * configure: Regenerate. + +2005-10-09 Kazu Hirata + + * configure.in (arm-*-linux-gnueabi): Add to noconfigdirs + target-libffi, target-qthreads, target-libjava, and + targetlibobjc. + * configure: Regenerate. + +2005-10-06 Daniel Jacobowitz + + * Makefile.def (flags_to_pass): Add OBJDUMP_FOR_TARGET. + * Makefile.tpl (BASE_TARGET_EXPORTS): Add OBJDUMP. + (OBJDUMP_FOR_TARGET, CONFIGURED_OBJDUMP_FOR_TARGET) + (USUAL_OBJDUMP_FOR_TARGET): New. + (EXTRA_TARGET_FLAGS): Add OBJDUMP. + * configure.in: Check for $OBJDUMP_FOR_TARGET. + * configure, Makefile.in: Regenerated. + +2005-10-05 Paolo Bonzini + + * Makefile.tpl (all) [gcc-no-bootstrap]: Make prebootstrap packages + before other host packages. + +2005-10-05 Paolo Bonzini + + PR bootstrap/22340 + + * configure.in (default_target): Remove. + * Makefile.tpl (all): Do not use prerequisites as subroutines + (all) [gcc-bootstrap]: Bootstrap gcc first if it was not done yet. + (do-[+make_target+], check, install, [+bootstrap_target+]): Do not + use prerequisites as subroutines. + (check-host, check-target): New. + (bootstrap configure & all targets): Do not use stage*-start + if the directory layout is already ok. + (non-bootstrap configure & all targets): Prepend a $(unstage). + (stage[+id+]-bubble): Do that here. Do not use NOTPARALLEL. + (NOTPARALLEL): Remove. + (unstage, stage variables): New variables. + (unstage, stage targets): Simply expand to those variables. + + * configure: Regenerate. + * Makefile.in: Regenerate. + +2005-10-04 James E Wilson + + * Makefile.def (lang_env_dependencies): Add libmudflap. + * Makefile.in: Regenerate. + +2005-10-03 Catherine Moore + + * configure.in (bfin-*-*): Support bfin. + * configure: Regenerated. + +2005-09-30 H.J. Lu + + * configure.in (*-*-darwin*): Build bfd, binutils and opcodes. + * configure: Regenerated. + +2005-09-28 Geoffrey Keating + + * Makefile.tpl (BASE_TARGET_EXPORTS): Add LIPO, STRIP. + (LIPO_FOR_TARGET): New. + (CONFIGURED_LIPO_FOR_TARGET): New. + (USUAL_LIPO_FOR_TARGET): New. + (STRIP_FOR_TARGET): New. + (CONFIGURED_STRIP_FOR_TARGET): New. + (USUAL_STRIP_FOR_TARGET): New. + * Makefile.def (flags_to_pass): Add LIPO_FOR_TARGET and + STRIP_FOR_TARGET. + * configure.in: Set LIPO_FOR_TARGET, STRIP_FOR_TARGET, + CONFIGURED_LIPO_FOR_TARGET, CONFIGURED_STRIP_FOR_TARGET. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2005-09-19 David Edelsohn + + * configure.in (powerpc-*-aix*): Add target-libssp to noconfigdirs. + (rs6000-*-aix*): Same. + * configure: Regenerate. + +2005-09-14 Francois-Xavier Coudert + + * configure.in: Recognize f95 in the --enable-languages option, + and substitute it for fortran, issuing a warning. + * configure: Regenerate. + +2005-09-07 Ben Elliston + + Import from Autoconf sources: + + 2005-09-06 Paul Eggert + * move-if-change: Don't output "$2 is unchanged"; suggested by Ben + Elliston. Handle weird characters correctly. + +2005-08-30 Phil Edwards + + * configure.in (*-*-vxworks*): Add target-libstdc++-v3 to noconfigdirs. + * configure: Regenerated. + +2005-08-20 Richard Earnshaw + + * Makefile.def (libssp): Add to lang_env_dependencies. + * Makefile.in: Regenerate. + +2005-08-17 Christian Groessler + + * Makefile.tpl: (USUAL_CC_FOR_TARGET): Add missing trailing slash. + * Makefile.in: Regenerate. + +2005-08-12 Paolo Bonzini + + * configure.in: Replace NCN_STRICT_CHECK_TOOL with + NCN_STRICT_CHECK_TOOLS, and likewise for NCN_STRICT_CHECK_TARGET_TOOLS. + Look for alternate names of the target cc and c++ + * configure: Regenerate. + +2005-08-08 Paolo Bonzini + + * configure.in (CC_FOR_TARGET, CXX_FOR_TARGET, GCJ_FOR_TARGET, + GCC_FOR_TARGET, RAW_CXX_FOR_TARGET, GFORTRAN_FOR_TARGET): Find + them with NCN_STRICT_CHECK_TARGET_TOOL, like the other target + tools; remove code to manually set them. + (Target tools): Look in the environment for them. + * Makefile.tpl (CC_FOR_TARGET, CXX_FOR_TARGET, GCJ_FOR_TARGET, + GCC_FOR_TARGET, RAW_CXX_FOR_TARGET, GFORTRAN_FOR_TARGET): Redefine. + (AS_FOR_TARGET, LD_FOR_TARGET, NM_FOR_TARGET): Look into gcc + build directory. + (CONFIGURED_CC_FOR_TARGET, CONFIGURED_CXX_FOR_TARGET, + CONFIGURED_GCJ_FOR_TARGET, CONFIGURED_GCC_FOR_TARGET, + CONFIGURED_GFORTRAN_FOR_TARGET, USUAL_CC_FOR_TARGET, + USUAL_CXX_FOR_TARGET, USUAL_GCJ_FOR_TARGET, USUAL_GCC_FOR_TARGET, + USUAL_RAW_CXX_FOR_TARGET, USUAL_GFORTRAN_FOR_TARGET): New. + (CXX_FOR_TARGET_FOR_RECURSIVE_MAKE, + RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE, RECURSE_FLAGS): Delete. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2005-07-27 Mark Mitchell + + * Makefile.tpl (EXTRA_TARGET_FLAGS): Set LDFLAGS=LDFLAGS_FOR_TARGET. + * Makefile.def (flags_to_pass): Add LDFLAGS_FOR_TARGET. + * Makefile.in: Regenerated. + +2005-07-26 Mark Mitchell + + * Makefile.tpl (SYSROOT_CFLAGS_FOR_TARGET): New variable. + (CFLAGS_FOR_TARGET): Use it. + (CXXFLAGS_FOR_TARGET): Likewise. + * Makefile.in: Regenerated. + * configure.in (--with-build-sysroot): New option. + * configure: Regenerated. + +2005-07-24 Paolo Bonzini + + * Makefile.tpl: Wrap install between unstage and stage + * Makefile.in: Regenerate. + +2005-07-16 Kelley Cook + + * all files: Update FSF address. + +2005-07-14 Jim Blandy + + * configure.in: Add cases for Renesas m32c. + * configure: Regenerated. + +2005-07-14 Kelley Cook + + * COPYING, compile, config-ml.in, config.guess, + config.sub, install-sh, missing, mkinstalldirs, + symlink-tree, ylwrap: Sync from upstream sources. + +2005-07-13 Eric Christopher + + * configure.in: Add toplevel noconfigdir support for tpf. + * configure: Regenerate. + +2005-07-11 Jakub Jelinek + + * Makefile.def (target_modules): Add libssp. + * configure.in (target_libraries): Add target-libssp. + * configure: Rebuilt. + * Makefile.in: Rebuilt. + +2005-07-11 Paolo Bonzini + + PR ada/22340 + + * Makefile.def: Sync with gcc. + * Makefile.tpl (POSTSTAGE1_FLAGS_TO_PASS): Fix pasto. + * Makefile.in: Regenerate. + +2005-07-07 Andreas Schwab + + * Makefile.def (flags_to_pass): Add CFLAGS_FOR_BUILD. + * Makefile.tpl (EXTRA_GCC_FLAGS): Don't pass CFLAGS_FOR_BUILD here. + * Makefile.in: Regenerated. + +2005-07-07 Kazu Hirata + + * configure.in: Add --enable-libssp and --disable-libssp. + * configure: Regenerate with autoconf-2.13. + +2005-07-06 Geoffrey Keating + + * configure.in: Don't build sim or rda when targetting darwin. + * configure: Regenerate. + +2005-07-04 Ben Elliston + + * src-release (do-proto-toplev): Remove dejagnu bits. + (DEJAGNU_SUPPORT_DIRS): Remove. + (dejagnu.tar.bz2, dejagnu.tar): Likewise. + (GDBD_SUPPORT_DIRS): Likewise. + (gdb+dejagnu.tar.bz2, gdb+dejagnu.tar): Likewise. + (INSIGHTD_SUPPORT_DIRS): Likewise. + (insight+dejagnu.tar.bz2, insight+dejagnu.tar): Likewise. + +2005-06-30 Ben Elliston + + * setup.com (mpw): Remove unused directive. + +2005-06-22 Paolo Bonzini + + * Makefile.def (stagefeedback): Come after profile. + Define profiledbootstrap target. + * Makefile.tpl (profiledbootstrap): Remove. + (stageprofile-end): Zap stagefeedback. + (stagefeedback-start): Copy all .gcda files, not only GCC's. + * Makefile.in: Regenerate. + +2005-06-13 Zack Weinberg + + * depcomp: Update from automake CVS. Add 'ia64hp' stanza. + In 'cpp' stanza, support '#line' as well as '# '. + +2005-06-07 Hans-Peter Nilsson + + * configure.in (unsupported_languages): New macro. + : Set unsupported_languages. Name explicit + non-ported target libraries in noconfigdirs. + Ditto, except for non-aout, non-elf, + non-linux-gnu. Remove libgcj_ex_libffi. + : Set add_this_lang=no if the language is in + unsupported_languages. + * configure: Regenerate. + +2005-06-04 Tobias Schl"uter + + * configure.in: Fix typo in handling of --with-mpfr-dir. + * configure: Regenerate. + +2005-06-02 Jim Blandy + + * config.sub: Add cases for the Renesas m32c. (This patch has been + accepted into the master sources.) + +2005-06-02 Aldy Hernandez + Michael Snyder + Stan Cox + + * configure.in: Set noconfigdirs for ms1. + + * configure: Regenerate. + +2005-05-25 Paolo Bonzini + + * Makefile.tpl (stage[+id+]-start): Iterate over target module as well. + (Dependencies): Consider target modules for bootstrap dependencies. + Make target bootstrap modules depend on each stage's gcc. + * Makefile.in: Regenerate. + +2005-05-20 Paolo Bonzini + + * Makefile.def (configure-gcc): Depend on binutils having been built. + (all-gcc): No need to do it here. + * Makefile.in: Regenerate. + +2005-05-19 Paul Brook + + * configure.in: Rewrite misleading error message when requested + language cannot be built. + * configure: Regenerate. + +2005-05-15 Daniel Jacobowitz + + * ylwrap: Import from Automake 1.9.5. + +2005-05-04 Mike Stump + + * configure.in: Always pass --target to target configures as + otherwise rebuilds that do --recheck will fail. + * configure: Rebuilt. + +2005-05-04 Paolo Bonzini + + * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Rename from + STAGE_HOST_EXPORTS. + (configure, all): Add bootstrap support. + (Host modules, target modules): Pass post-stage1 flags and exports. + (Top-level bootstrap): Remove bootstrap rules, expanded elsewhere. + * Makefile.in: Regenerate. + +2005-04-29 Paolo Bonzini + + Sync from gcc: + + 2005-04-22 Bernd Schmidt + + * config.sub: Update from master copy. + + 2005-04-19 Hans-Peter Nilsson + + * configure.in : New local variable + libgcj_ex_libffi. Have specific match for *-*-linux*. Separate + matches for "*-*-aout" and "*-*-elf". Don't disable libffi for + "*-*-elf" and "*-*-linux*". + * configure: Regenerate. + +2005-04-06 Paolo Bonzini + + * Makefile.tpl (BUILD_CONFIGARGS): Include --with-build-subdir. + (TARGET_CONFIGARGS): Include --with-target-subdir. + (configure, all): New macros. Use them throughout. + +2005-04-05 Paolo Bonzini + + * Makefile.tpl: Sync with gcc. + * Makefile.in: Regenerate. + +2005-03-30 J"orn Rennecke + + * config/mh-mingw32: Delete. + * configure.in: Don't use it. + * configure: Regenerate. + +2005-03-31 Paolo Bonzini + + * Makefile.def (bfd, opcodes, libstdc++-v3, libmudflap): Set lib_path. + * Makefile.tpl (SET_LIB_PATH, REALLY_SET_LIB_PATH): Remove. + (HOST_EXPORTS, STAGE_HOST_EXPORTS, TARGET_EXPORTS): Set $(RPATH_ENVVAR). + (HOST_LIB_PATH): Generate from Makefile.def. + (TARGET_LIB_PATH): Likewise. + (Old bootstrap targets): Include TARGET_LIB_PATH into RPATH_ENVVAR. + * Makefile.in: Regenerate. + * configure.in (set_lib_path, SET_LIB_PATH, SET_GCC_LIB_PATH): Remove. + (RPATH_ENVVAR): Include Darwin case. + * configure: Regenerate. + +2005-03-25 Paolo Bonzini + + * configure.in (RPATH_ENVVAR): Set to DYLD_LIBRARY_PATH on Darwin. + * configure: Regenerate. + +2005-03-21 Zack Weinberg + + * Makefile.def: Remove libstdcxx_incdir, libsubdir, gxx_include_dir, + gcc_version, and gcc_version_trigger from set of flags to pass. + * Makefile.tpl: Remove definitions of above variables. + (config.status): Remove dependency on $(gcc_version_trigger). + * Makefile.in: Regenerate. + * configure.in: Do not reference config/gcc-version.m4 nor + config/gxx-include-dir.m4. Do not invoke TL_AC_GCC_VERSION nor + TL_AC_GXX_INCLUDE_DIR. Do not set gcc_version_trigger. + * configure: Regenerate. + +2005-03-16 Manfred Hollstein + Andrew Pinski + + * Makefile.tpl (check-[+module+]): Fix shell statement inside if ... fi. + * Makefile.in: Regenerate. + +2005-03-01 Alexandre Oliva + + PR libgcj/20160 + * ltmain.sh: Avoid creating archives with components that have + duplicate basenames. + +2005-02-28 Andrew Pinski + + PR bootstrap/20250 + * Makefile.tpl (HOST target installs): Fix copy and pasto, use install + instead of check. + * Makefile.in: Regenerate. + +2005-02-28 Paolo Bonzini + + Sync from gcc. + + 2005-02-28 Paolo Bonzini + + PR bootstrap/17383 + * Makefile.def (target_modules): Remove "stage", now unnecessary. + * Makefile.tpl (HOST_SUBDIR): New substitution. + (STAGE_HOST_EXPORTS, EXPECT, HOST_LIB_PATH, USUAL_AR_FOR_TARGET, + USUAL_AS_FOR_TARGET, USUAL_DLLTOOL_FOR_TARGET, USUAL_GCC_FOR_TARGET, + USUAL_LD_FOR_TARGET, USUAL_NM_FOR_TARGET, USUAL_OBJDUMP_FOR_TARGET, + USUAL_RANLIB_FOR_TARGET, USUAL_WINDRES_FOR_TARGET): Use it. + (Host modules, Bootstrapped modules): Use it. + (Build modules, Target modules): Do not create symlink trees, + always configure out-of-srcdir. + (distclean): Try removing $(host_subdir) with rm before using rm -rf. + * configure.in (FLAGS_FOR_TARGET, CC_FOR_TARGET, GCJ_FOR_TARGET, + GFORTRAN_FOR_TARGET, CXX_FOR_TARGET, RAW_CXX_FOR_TARGET): Use + $(HOST_SUBDIR). Create a symlink for host_subdir. + + * Makefile.in: Regenerate. + * configure: Regenerate. + + Merged from libada-gnattools-branch: + 2004-11-28 Nathanael Nerode + + * Makefile.def: Add gnattools as a module, depending on target-libada. + * Makefile.in: Regenerate. + * configure.in: Include gnattools in host_tools; disable it if ada + is disabled. + * configure: Regenerate. + +2005-02-23 Nick Clifton + + * configure: Regenerate. + +2005-02-22 Paul Schlie + + * configure.in: Allow darwin targeted ports to build tk, itcl and + libgui. + +2005-02-21 Eric Botcazou + + PR libgcj/10353 + * configure.in (noconfigdirs) : Add libgcj. + * configure: Regenerate. + +2005-02-08 Andrew Cagney + + * MAINTAINERS: Delete reference to dejagnu/ and mmalloc/ from the + gdb/ section. Update GDB's URL. + +2005-01-31 Andrew Cagney + + * gettext.m4: Only set ENABLE_NLS when gettext is present. + +2005-01-29 Hans-Peter Nilsson + + * configure.in (noconfigdirs) : Match like cris-*-*. + : Only disable target-newlib and + target-libgloss when not *-*-elf and *-*-aout. + * configure: Regenerate. + +2005-01-27 Andrew Cagney + + * gettext.m4: Don't use NONE as a default for CATOBJEXT. + +2005-01-24 Andrew Cagney + + * gettext.m4: Only fall back to ../intl/ when it's present. + +2005-01-17 Kelley Cook + + * install-sh, config.sub: Import from upstream. + +2005-01-17 Kelley Cook + + PR bootstrap/18222 + * Makefile.def: Pass CPPFLAGS_FOR_TARGET. + * Makefile.tpl: Define target CPPFLAGS on CPPFLAGS_FOR_TARGET. + * Makefile.in: Regenerate. + +2005-01-03 Paolo Bonzini + + Revert 2004-12-28 Makefile changes, a better fix will be + applied to mainline and src after GCC 4.0 branches. + +2004-12-28 Paolo Bonzini + + PR bootstrap/17383 + + * Makefile.def (target_modules): Remove stage parameter, + it is always true now. + * Makefile.tpl (configure-build-[+module+], + configure-target-[+module+]): Always build symlink tree + for the directory and for include. BUILD_SUBDIR and + TARGET_SUBDIR cannot be . anymore. + * Makefile.in: Regenerate. + +2004-12-25 David Edelsohn + + Revert 2004-12-08 Makefile changes. + +2004-12-16 Andrew Stubbs + + * configure.in (sh64-*-*): Reenable gprof. + * configure: Regenerate. + +2004-12-09 Jim Blandy + + * MAINTAINERS: List 'depcomp' as part of automake. + +2004-12-08 David Edelsohn + + * Makefile.def (flags_to_pass): Add PICFLAG_FOR_TARGET. + * Makefile.tpl (EXTRA_HOST_FLAGS): Add PICFLAG. + (EXTRA_TARGET_FLAGS): Add PICFLAG. + * Makefile.in: Regenerate. + +2004-12-07 Matt Kraai + + * Makefile.tpl: Generate normal dependencies if the LHS module is + not bootstrapped. + * Makefile.in: Regenerate. + +2004-12-03 Richard Sandiford + + * configure.in: Include config/gxx-include-dir.m4. Use + TL_AC_GXX_INCLUDE_DIR. Remove some now-redundant AC_SUBSTs. + * configure: Regenerate. + +2004-12-03 Richard Sandiford + + * config.if: Delete. + * configure.in: Set libstdcxx_incdir directly. + * configure: Regenerate. + * MAINTAINERS: Remove mention of config.if. + * src-release (DEVO_SUPPORT): Remove config.if. + +2004-12-02 Eric Christopher + + * Makefile.tpl (clean-target-libgcc): Add stmp-dirs to list + of things to remove. + * Makefile.in: Regenerate. + +2004-12-02 Richard Sandiford + + * configure.in: Clear gcc_version_trigger if the file doesn't exist. + * configure: Regenerate. + +2004-12-02 Richard Sandiford + + * configure.in: Include config/gcc-version.m4. Use TL_AC_GCC_VERSION + to set gcc_version_trigger. Remove some now-redundant AC_SUBSTs. + * configure: Regenerate. + +2004-11-26 John David Anglin + + * configure.in (hppa*-*-linux*): Don't add libgcj to noconfigdirs. + (hppa*64*-*-*): Delete incorrect comment. + * configure: Rebuilt. + +2004-11-15 Kelley Cook + + * install-sh, compile: Import from automake. + +2004-11-15 Kelley Cook + + * config.guess, config.sub: Import from savannnah. + +2004-11-12 Mike Stump + + * Makefile.def: Add html support. + * Makefile.tpl: Likewise. + * Makefile.in: Regenerate. + +2004-11-11 Geoffrey Keating + + PR 18423 + * configure.in: Remove all instances of build-fixincludes from + noconfigdirs. + (build_configargs): Supply --target to subdirectories. + * configure: Regenerate. + + * Makefile.def: Make gcc install depend on fixincludes install. + * Makefile.in: Regenerate. + +2004-11-08 Hans-Peter Nilsson + + * configure.in (noconfigdirs) [mmix-*-*]: Disable + target-libgfortran. + * configure: Regenerate. + +2004-11-07 David Edelsohn + + * config-ml.in: Pass FCFLAGS for multilibs, handle GFORTRAN + like CC. + +2004-11-05 Paolo Bonzini + + * Makefile.def (host fixincludes): Specify missing targets. + * Makefile.in: Regenerate. + +2004-11-04 H.J. Lu + + PR other/17783 + * configure.in: Set up LD_LIBRARY_PATH by default for gcc. + * configure: Regenerated. + +2004-11-04 Daniel Jacobowitz + + * configure.in (arm-*-oabi*, thumb-*-oabi*): Remove. + * configure: Regenerated. + +2004-10-28 Eric B. Weddington + + PR target/18151 + * configure.in (case ${target}): Do not build fixincludes for avr. + * configure: Regenerated. + +2004-10-26 Paolo Bonzini + + * configure.in (case ${target}): Do not build fixincludes + on platforms where it is not used. + * configure: Regenerated. + +2004-10-23 Daniel Jacobowitz + + * configure.in: Use an absolute path to install-sh. + * configure: Regenerated. + +2004-10-19 Andrew Cagney + + * src-release (do-djunpack, do-md5sum): Install the generated file + directly into the proto-toplev/ directory. + +2004-10-19 Andrew Cagney + + * src-release (GDB_SUPPORT_DIRS): Remove utils and intl. + +2004-10-12 Kelley Cook + + * configure.in (*-*-cygwin*): Supress warning if newlib not present. + * configure: Regenerate. + +2004-10-06 Paolo Bonzini + + Fix wrong conflict resolution in: + + 2004-08-16 Paolo Bonzini + + * Makefile.in: Regenerate. + * Makefile.tpl (Autogenerated `all-*' targets): Invoke $(TARGET-*) + in the recursive `make', instead of hardwiring `all'. + (Autogenerated TARGET-* variables): New. + +2004-10-05 Ulrich Weigand + + Merged from GCC / libtool upstream: + 2004-10-02 P.J. Darcy + * ltcf-c.sh (tpf*): Add ld_shlibs=yes. + * ltcf-cxx.sh (tpf*): Likewise. + * ltconfig (tpf*): Add TPF OS configuration support. + +2004-09-30 Tomer Levi + + * configure.in: Enable target-libgloss for crx-*-*. + * configure: Regenerate. + +2004-09-24 Michael Roth + + * configure.in (--without-headers): Add missing double quotes. + * configure: Regenerate. + +2004-09-24 Kelley Cook + + * ylwrap: Revert to previous version. + +2004-09-23 H.J. Lu + + PR bootstrap/17369 + * Makefile.tpl (REALLY_SET_LIB_PATH): Add @SET_GCC_LIB_PATH@. + (HOST_EXPORTS]): Add @SET_GCC_LIB_PATH@. Set and export + SET_GCC_LIB_PATH_CMD. + (BASE_TARGET_EXPORTS): Likewise. + * Makefile.in: Regenerated. + + * configure.in (SET_GCC_LIB_PATH): Set and substitute. + * configure: Regenerated. + +2004-09-23 Kelley Cook + + * config.guess: New upstream version + * compile, depcomp, install-sh, ylwrap: Likewise. + +2004-09-19 Roger Sayle + + * config/mh-x86omitfp: New host makefile fragment. Add + -fomit-frame-pointer to the default BOOT_CFLAGS. + * configure.in: Use it to speed up bootstrap on some IA-32 hosts. + * configure: Regenerate. + +2004-09-15 Andrew Pinski + + PR target/11572 + * configure.in (*-*-darwin*): Renable libobjc. + * configure: Regenerate. + +2004-09-09 Daniel Berlin + + * Makefile.def: Remove libbanshee. + * Makefile.tpl: Ditto. + * configure.in: Ditto. + * Makefile.in: Regen. + * configure: Ditto. + +2004-09-07 Paolo Bonzini + + * missing: Import latest version from master repository. + +2004-09-04 Nick Clifton + + * config.sub: Import latest version from master repository. + * config.guess: Likewise. + This includes these changes: + + 2004-08-27 Hans-Peter Nilsson + + * config.sub: Handle crisv32, alias etraxfs. + * config.guess (crisv32:Linux:*:*): Handle. + + 2004-08-13 Brad Smith + + * config.guess (*:OpenBSD:*:*): Remove defunct MIPS machines. + (sgi:OpenBSD:*:*): Emit mips64, not mipseb. + + 2004-08-11 Paul Eggert + + * config.guess (*:Darwin:*:*): If uname -p reports "unknown", + assume the processor is a powerpc. This is because coreutils + uname (at least versions 4.5.7 through 5.2.1) outputs "unknown" + in this case, due to a MacOS X bug that causes + sysctl ((int[]) {CTL_HW, HW_MACHINE_ARCH}, 2, buffer, &bufsize, 0, 0) + to return a negative number. + Problem reported by Petter Reinholdtsen in: + http://lists.gnu.org/archive/html/bug-gnu-utils/2003-02/msg00201.html + + 2004-07-19 Ben Elliston + + * config.guess (S7501:*:4.0:3.0): Handle NCR System V UNIX machine. + + 2004-06-24 Ben Elliston + + * config.guess: Update copyright years. + * config.sub: Likewise. + + 2004-06-22 Robert Millan + + * config.guess (*:FreeBSD:*:*): Remove check for glibc (unneeded + since GNU/kFreeBSD systems match *:GNU/*:*:* instead). + + 2004-06-22 Stanley F. Quayle + + * config.guess (*:*VMS:*:*): New entry. Replaces + Alpha:OpenVMS:*. Recognize and advertise all VMS flavors as dec + manufacturer. + + 2004-06-22 Ben Elliston + + * config.guess: Cray fixes from Wendy Palm . + * config.sub: Likewise. + + 2004-06-22 Ben Elliston + + Reported by Hans-Peter Nilsson : + * config.sub: Correctly handle mmix-knuth and mmix-knuth-mmixware. + + 2004-06-11 Ben Elliston + + * config.guess (pegasos:OpenBSD:*:*): Remove. + + 2004-06-11 Ben Elliston + + From Wouter Verhelst : + * config.guess (M68*:*:R3V[5678]:*): Detect R3V8. + + 2004-06-11 Ben Elliston + + * config.guess (luna88k:OpenBSD:*:*): New. + + 2004-03-12 Kazuhiro Inaoka + + * config.guess (m32r*:Linux:*:*): New case. + * config.sub: Handle m32rle. + + 2004-03-12 Ben Elliston + + From Jens Petersen : + * config.sub: Handle sparcv8. + + 2004-03-03 Ben Elliston + + From Tom Smith : + * config.guess: Version suffixes are equally significant on Tru64 + V4.* and V5.*, so do not ignore them on V5.*. Handle a version + prefix of "P" (patched kernel). + + 2004-02-23 Tal Agmon + + * config.sub: Add support for National Semiconductor CRX target. + +2004-09-03 Jan Beulich + + * configure.in: Remove target-libstdc++-v3 from noconfigdirs for + *-*-netware, but add target-libmudflap. + Consolidate *-*-netware targets (of which really only i?86 exists) + into a single entry. + * configure: Likewise. + +2004-09-01 Paolo Bonzini + + * Makefile.tpl (sorry): Remove. + (clean-stage[+id+], clean-stage[+id+]-module): New targets. + (cleanstrap targets): Depend on distclean, not distclean-stage1. + (do-clean): Clean per-stage directories too. + (do-distclean): Run distclean-stage1 too. + (.NOTPARALLEL): Enable during toplevel bootstrap. + (stage[+id+]-bubble): Enable parallel execution during + the recursive invocation. + * Makefile.in: Regenerate. + + Sync from gcc (moving the Makefile.in change to Makefile.tpl): + + 2004-08-31 Robert Bowdidge + + * Makefile.in: Move BOOT_CFLAGS above host makefile fragment include. + * configure.in: add test for powerpc-*-darwin* to specify makefile frag + * configure: regenerate + * config/mh-ppc-darwin: create file, override BOOT_CFLAGS for + -mdynamic-no-pic + +2004-08-31 Paolo Bonzini + + * Makefile.tpl: Move BOOT_CFLAGS above host makefile fragment + include. + * configure.in: Fix indentation. + * configure: Regenerate. + +2004-08-31 Paolo Bonzini + + * Makefile.def (build_modules): Add fixincludes. + (dependencies): Make gcc depend on fixincludes. + * configure.in (build_tools): Add fixincludes. + (build_configdirs): Always include build_libs. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2004-08-30 Paolo Bonzini + + * Makefile.def (bootstrap stages): Add 'lean' parameter. + * Makefile.tpl (configure-stageN-*, all-stageN-*): Turned into + phony targets; do not generate timestamp files. + (distclean-stageN): Remove references to their timestamp files. + (restageN, touch-stageN): Remove. + (stageN-bubble): Rewritten. + (compare): Support lean bootstraps. + * Makefile.in: Regenerate. + + * configure.in: Only warn when bootstrapping but + build != host or build != target. Support lean bootstraps. + * configure: Regenerate. + + Sync from gcc: + 2004-08-26 Phil Edwards + + * configure.in: Give a better error message if GMP/MPFR are missing + and a language needing them has been requested. + * configure: Regenerated. + + 2004-08-25 Phil Edwards + + * configure.in: Print a list of available language front-ends if + a requested one is missing. Tidy stray tab characters. + * configure: Regenerated. + +2004-08-17 Paolo Bonzini + + * Makefile.in: Regenerate. + * configure: Regenerate. + + * Makefile.def (bootstrap-stage): Rename extra_*_flags to + stage_*_flags. + * Makefile.tpl (configure-[+module+], all-[+module+]): Exit + for bootstrapped modules if toplevel bootstrap is going. + (GCC bootstrap): Generate per-stage targets for all bootstrapped + modules. Adjust for changes in Makefile.def. Enable several + rules even in non-bootstrap mode, just to avoid peppering the + template with unnecessary "@if/@endif gcc-bootstrap" pairs. + (stage-[+prev+]-bubble): Remove. + + * Makefile.def (Dependencies): Depend on all-build-bison, + all-build-flex, all-build-byacc, all-build-texinfo, rather + than the host variations. + * Makefile.tpl (BUILD_DIR_PREFIX): Remove. Replace throughout + with BUILD_SUBDIR. + (BISON): Update for recent Bisons. + (YACC): Fix typo. + (cross): Depend on all-build. + (all): Do not depend on all-build. + (prebootstrap): Remove. + (dep-kind): Accept separate prefixes for MODULE and ON variables. + (Prebootstrap dependencies): Add them to the per-stage targets + and to all-prebootstrap. + * configure.in (build_configdirs): Always enable build_tools. + (BUILD_DIR_PREFIX): Remove. + + * Makefile.def (gcc): Add target variable. + (gdb, expect, guile, tk, tix): Replace with_x with extra_make_flags. + * Makefile.tpl (Autogenerated `all-*' targets): Invoke $(TARGET-*) + in the recursive `make', instead of hardwiring `all'. + (Autogenerated TARGET-* variables): New. + +2004-08-17 Robert Millan + + * configure.in: In noconfigdirs check, match GNU/k*BSD with GNU/Linux + (instead of FreeBSD). + * configure: Regenerate. + +2004-08-12 Nathanael Nerode + + * Makefile.def, configure.in, src-release: Remove useless, bogus + references to tix. + * Makefile.in, configure: Regenerate. + + * src-release: Stop distributing mmalloc with gdb (which doesn't + use it). + * Makefile.def: GDB doesn't depend on mmalloc anymore. + * Makefile.in: Regenerate. + +2004-08-09 Mark Mitchell + + * configure.in (arm*-*-eabi*): New target. + * configure: Regenerate. + +2004-08-01 Robert Millan + + * configure.in: Turn mt-linux into mt-gnu. Use mt-gnu and enable + libmudflap for all GNU-based systems (with Glibc). + * configure: Regenerate. + +2004-08-06 Paolo Bonzini + + * Makefile.def (bfd, opcodes, gcc, zlib): Mark as bootstrap module. + (bison, byacc, flex, texinfo): Do not mark as bootstrap module. + (Dependencies): New section. + * Makefile.tpl (Dependencies): Generate from Makefile.def. + (configure-target-[+module+]): Depend on maybe-all-gcc + (all-prebootstrap): New name of all-bootstrap. Changed throughout. + (toplevel profiledbootstrap): Fix dependencies. + * Makefile.in: Regenerate. + +2004-08-03 Mark Mitchell + + * configure.in (arm*-*-symbianelf*): Add ${libgcj} and + target-libiberty to noconfigdirs. + +2004-08-03 Paul Brook + + * configure.in: Check for MPFR as well as GMP. + * configure: Regenerate. + +2004-08-03 Paolo Bonzini + + * Makefile.def (host-modules): Add gcc. + * Makefile.in: Regenerate. + * Makefile.tpl (sorry): New rule. + (configure-host, all-host, [+make_target+]-host, do-check, + install-host): Do not add gcc as a special case. + (host modules): Add a small special-casing for gcc. Export + extra_make_flags through the environment. + (maybe-configure-gcc, configure-gcc, maybe-all-gcc, all-gcc, + maybe-check-gcc, check-gcc, maybe-install-gcc, install-gcc, + other recursive targets for gcc): Remove. + + (all, do-[+make_target+], do-check): Wrap between unstage and stage. + (stage, unstage): New rules. + (stage[+id+]-start, stage[+id+]-end, [+compare-target+], + distclean-stage[+id+]): Use stage_current. + ([+bootstrap-target+], profiledbootstrap): Do not invoke manually + the stage*-start rules. + +2004-07-19 Robert Millan + + Synced from gcc: + + 2004-04-26 Robert Millan + + Add patches from libtool CVS. + * libtool.m4: Add kfreebsd*-gnu and knetbsd*-gnu. + * ltconfig: Likewise. + * ltcf-c.sh: Likewise. + * ltcf-cxx.sh: Likewise. + * ltcf-gcj.sh: Likewise. + +2004-07-12 Paolo Bonzini + + * configure.in: Add noconfigdirs for crx-*-*. + * configure: Regenerate. + +2004-07-12 Paolo Bonzini + + Synced from gcc: + + 2004-07-09 Loren J. Rittle + + * configure.in: Build libmudflap by default on FreeBSD. + * configure: Regenerated. + + 2004-07-09 Mark Mitchell + + * configure.in: Do not build libmudflap by default on non-GNU/Linux + systems. + * configure: Regenerated. + + 2004-07-08 John David Anglin + + PR target/16344 + * Makefile.tpl (profiledbootstrap): Build runtime libraries with + feedback based compiler. + * Makefile.in: Rebuilt. + + 2004-07-05 Phil Edwards + + * configure.in: Do not prepend $srcdir to /dev/null in + makefile fragments. + * configure: Regenerate. + +2004-07-08 Alexandre Oliva + + * Makefile.def (host_modules): Set bootstrap=true for flex. + * Makefile.tpl (all-gcc): Depend on texinfo and flex. + * Makefile.in: Rebuilt. + +2004-07-01 Paolo Bonzini + + * Makefile.def (build_modules): Add bison, byacc, flex, + m4, texinfo. + (flags_to_pass): Add FLEX. + * Makefile.tpl (BUILD_DIR_PREFIX, BASE_EXPORTS): New. + (BUILD_EXPORTS, HOST_EXPORTS, BASE_TARGET_EXPORTS): Include it. + (DEFAULT_YACC, USUAL_YACC, DEFAULT_LEX, USUAL_LEX, DEFAULT_M4, + DEFAULT_MAKEINFO): Remove. + (CONFIGURED_YACC, CONFIGURED_FLEX, CONFIGURED_BISON, + CONFIGURED_LEX, CONFIGURED_M4, CONFIGURED_MAKEINFO): Substitute. + (YACC, FLEX, BISON, LEX, M4, MAKEINFO): Define to look into + objdir or else use configured tool. + (all-build): New. + (all): Depend on it. + (Build module dependencies): Add. + * Makefile.in: Regenerate. + * configure.in: Better support for multiple build modules, + matching what is done for host/target modules. Do not look + for "plausible" locations of build tools if Canadian cross. + Use autoconf's AC_PROG_CC to find a C compiler. Define + BUILD_DIR_PREFIX. Look for flex, makeinfo and m4. + * configure: Regenerate. + +2004-06-22 Paolo Bonzini + + * Makefile.tpl (HOST_EXPORTS): Fix pasto. + * Makefile.in: Regenerate. + +2004-06-22 Paolo Bonzini + + * Makefile.tpl (configure-build-[+module+], + configure-[+module+], configure-target-[+module+]): Pass + [+extra_configure_args+]. + (all-build-[+module+], all-[+module+], check-[+module+], + install-[+module+], [+make_target+]-[+module+], + all-target-[+module+], check-target-[+module+], + install-target-[+module+], [+make_target+]-target-[+module+]): + Pass [+extra_make_args+]. + (HOST_EXPORTS): Include the former GCC_HOST_EXPORTS. + (GCC_HOST_EXPORTS): Remove. + (configure-gcc, all-gcc, GCC_STRAP_TARGETS, profiledbootstrap, + cross, check-gcc, check-gcc-c++, install-gcc, + gcc-no-fixedincludes, [+make_target+]-gcc, stage[+id+]-bubble): + Replace GCC_HOST_EXPORTS with HOST_EXPORTS. + * Makefile.in: Regenerate. + +2004-06-21 Christopher Faylor + + * configure.in: Check for srcdir/winsup rather than build directory + winsup. + * configure: Regenerate. + +2004-06-17 Corinna Vinschen + + * configure.in: Don't build Cygwin native newlib if winsup + directory is missing. Emit warning instead. + * configure: Regenerate. + +2004-06-09 Paolo Bonzini + + * Makefile.tpl (touch-stage[+id+]): New. + (restage[+prev+]): Depend on touch-stage[+id+]. + + * Makefile.tpl (RECURSE_FLAGS_TO_PASS): New. + Use it throughout. + + * Makefile.def: Add profile and feedback bootstrap stages. + Remove next field from bootstrap stages. + * Makefile.tpl (LN, LN_S): Substitute. + (stageN-start, stageN-end): Use double-colon rules, to + provide a hook for additional setup commands. + (distclean-stageN-gcc, restageN): Create dependencies from + [+prev+], not from [+next+]. + (stageN-bubble): Add commands for successive stages from + [+prev+], using double-colon rules. + (all-stageN-gcc): Fix typo. + (stagefeedback-start, profiledbootstrap): New. + * Makefile.in: Regenerate. + * configure.in: Call ACX_PROG_LN. + * configure: Regenerate. + +2004-06-03 Paolo Bonzini + + * configure.in: Fix --enable-bootstrap breakage introduced in trees + without gcc. + * configure: Regenerate. + +2004-06-01 Paolo Bonzini + + * Makefile.tpl: Fix typo. + * Makefile.in: Regenerate. + +2004-06-01 Paolo Bonzini + + * configure.in: Remove new- prefix from toplevel + bootstrap targets. + * configure: Regenerate. + +2004-06-01 Paolo Bonzini + + Merge this patch from the gcc tree: + + 2004-05-30 Andreas Jaeger + Jim Wilson + + * config-ml.in: Pass FFLAGS and ADAFLAGS for multilibs, handle F77 + like CC. + +2004-06-01 Paolo Bonzini + + * Makefile.tpl (all.normal): Rename to all. + (all): Replace with a rule to pick the default + target from configure. + (all-gcc, configure-gcc): Use conditionals to + do nothing when toplevel bootstrap is going on. + (GCC directory bootstrap) [gcc-bootstrap]: Disable. + (Toplevel bootstrap) [gcc-no-bootstrap]: Disable. + * configure.in: Support --enable-bootstrap. + + * Makefile.def: Remove new- prefix from toplevel + bootstrap targets. + * Makefile.tpl: Likewise. + + * Makefile.def: Add bootstrap_stage 4. Add bootstrap2 + target. + + * Makefile.tpl (Toplevel bootstrap): Pass $(BASE_FLAGS_TO_PASS) + $(RECURSE_FLAGS) to recursive invocation of make. + + * Makefile.in: Regenerate. + * configure: Regenerate. + +2004-05-27 Daniel Jacobowitz + + * configure.in: Fix sed invocation for GFORTRAN_FOR_TARGET. + * configure: Regenerate. + +2004-05-25 Daniel Jacobowitz + + * Makefile.tpl (BUILD_EXPORTS, HOST_EXPORTS, GCC_HOST_EXPORTS) + (STAGE_HOST_EXPORTS, BASE_TARGET_EXPORTS, RAW_CXX_TARGET_EXPORTS) + (NORMAL_TARGET_EXPORTS): New macros. Use them in all the recursive + targets. + * Makefile.in: Regenerate. + +2005-05-24 Paolo Bonzini + + * configure.in: Test the ability to symlink directories. + * configure: Regenerate. + + * Makefile.def (bootstrap-stage): New definitions. + * Makefile.tpl (configure-stage1-gcc, + configure-stage2-gcc, configure-stage3-gcc, + all-stage1-gcc, all-stage2-gcc, all-stage3-gcc, + new-bootstrap, new-cleanstrap, new-restage1, new-restage2, + new-restage3, compare): Autogenerate, see Makefile.in + entry for behavioral changes. + (distclean-stage1, new-stage1-start, new-stage1-end, + new-stage1-bubble, distclean-stage2, new-stage2-start, + new-stage2-end, new-stage2-bubble, distclean-stage3, + new-stage3-start, new-stage3-end): New autogenerated targets. + (objext, prebootstrap, BOOT_CFLAGS, + POSTSTAGE1_FLAGS_TO_PASS): Move above the autogenerated + targets. + + * Makefile.in: Regenerate. + (distclean-stage1, new-stage1-start, new-stage1-end, + new-stage1-bubble, distclean-stage2, new-stage2-start, + new-stage2-end, new-stage2-bubble, distclean-stage3, + new-stage3-start, new-stage3-end): New targets. + (all-stage1-gcc): Move prebootstrap dependency from here... + (configure-stage1-gcc): ...to here. + (new-bootstrap): Use bubble targets. + (new-cleanstrap, new-restage1, new-restage2, new-restage3): + Use per-stage distclean targets. + (configure-stage1-gcc, configure-stage2-gcc, + configure-stage3-gcc, all-stage1-gcc, + all-stage2-gcc, all-stage3-gcc, new-bootstrap): + Use new-stageN-start to prepare the tree. + +2004-05-23 Paolo Bonzini + + * Makefile.def (host_modules): add libcpp. + * Makefile.tpl: Add dependencies on and for libcpp. + * Makefile.in: Regenerate. + * configure.in: Add libcpp host module. + * configure: Regenerate. + +2004-05-17 Zack Weinberg + + * Makefile.def, Makefile.tpl, configure.in: Remove all mention + of libf2c. + * configure, Makefile.in: Regenerate. + +2004-05-13 Diego Novillo + + Merge from tree-ssa-20020619-branch. + + * Makefile.def: Add libbanshee, libmudflap and libgfortran. + * Makefile.tpl (BUILD_CONFIGDIRS): Add libbanshee. + (HOST_GMPLIBS): Define. + (HOST_GMPINC): Define. + (TARGET_LIB_PATH): Add libmudflap. + (GFORTRAN_FOR_TARGET): Define. + (configure-build*): Export GFORTRAN. + (configure-gcc): Export GMPLIBS and GMPINC. + (all-gcc): Add maybe-all-libbanshee. + (configure-target-libgfortran): Define. + * Makefile.in: Regenerate. + * configure.in (host_libs): Add libbanshee. + (target_libraries): Add target-libmudflap and target-libgfortran. + Add --with-libbanshee. + Handle --disable-libmudflap. + (*-*-freebsd*): Use with_gmp. + Add $(libgcj) to noconfigdirs. + * configure: Regenerate. + * depcomp: New file. + * MAINTAINERS: Add tree-ssa maintainers. + +2004-04-28 Paolo Bonzini + + * config/acx.m4: Fix fastcompare support for new-bootstrap. + * configure: Regenerate. + +2004-04-27 Paolo Bonzini + + Revert: + 2004-04-26 Paolo Bonzini + + * Makefile.def (flags_to_pass): Remove *dir variables that + are passed to the modules via TOPLEVEL_CONFIGURE_ARGUMENTS, + as well as prefix and exec_prefix. + * Makefile.in: Regenerate. + +2004-04-26 Paolo Bonzini + + * Makefile.def (host_modules): Mark with the bootstrap + flag packages on which gcc depends. + * Makefile.tpl (all-bootstrap): Use it. + * Makefile.in: Regenerate. + +2004-04-26 Paolo Bonzini + + * Makefile.def (flags_to_pass): Remove *dir variables that + are passed to the modules via TOPLEVEL_CONFIGURE_ARGUMENTS, + as well as prefix and exec_prefix. + * Makefile.in: Regenerate. + +2004-04-26 Paolo Bonzini + + * configure.in: Invoke ACX_PROG_CMP_IGNORE_INITIAL. + * configure: Regenerate. + * config/acx.m4: Mutuate ACX_PROG_CMP_IGNORE_INITIAL from gcc. + * gcc/Makefile.tpl (compare): Use the result of the test. + * gcc/Makefile.in: Regenerate. + +2004-04-23 Paolo Bonzini + + * Makefile.tpl (all-stage1-gcc, all-stage2-gcc, all-stage3-gcc): + Always relocate gcc and prev-gcc to the original names, even + if the build fails. + (new-cleanstrap, new-restage1, new-restage2, new-restage3): + New targets. + +2004-04-19 Rainer Orth + + * configure.in (mips*-*-irix5*): Enable ld. + * configure: Regenerate. + +2004-04-15 James E Wilson + + * Makefile.tpl (configure-[+module+], configure-gcc, + configure-stage1-gcc, configure-stage2-gcc, configure-stage3-gcc): + Set and export LDFLAGS. + * Makefile.in: Regenerate. + +2004-04-09 Nathanael Nerode + + PR bootstrap/14871 + * Makefile.tpl: If we don't have built-in-tree target tools, + use the ones found by configure rather than hacking around with + program_transform_name. + * configure.in: Give Makefile.tpl the information necessary + to do that. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2004-04-06 Nathanael Nerode + + PR bootstrap/14760 + * configure.in: When computing baseargs, strip *all* copies of + offending options. Also, don't match/substitute the trailing space, + so that this actually works when two similar options are separated by + only one space. + * configure: Regenerate. + +2004-04-06 David Edelsohn + + * configure.in (powerpc-*-aix*): Remove target-libada from noconfigdirs. + (rs6000-*-aix*): Same. + * configure: Regenerate. + +2004-03-25 Stan Shebs + + Remove MPW support, no longer used. + * mpw-README, mpw-build.in, mpw-config.in, mpw-configure, + mpw-install: Remove files. + * src-release (DEVO_SUPPORT): Remove names of removed files. + * MAINTAINERS: Likewise. + +2004-03-24 Nathanael Nerode + + * Makefile.tpl (top level bootstrap support): Remove now-unneeded + STRICT_WARN, WARN_CFLAGS flags passed down to make. + * Makefile.in: Regenerate. + + * configure.in (top level bootstrap support): Rework --enable-werror + to set @stage2_werror_flag@. + * configure: Regenerate. + * Makefile.tpl (top level bootstrap support): Pass + @stage2_werror_flag@ down to configure in stages 2 and 3. + * Makefile.in: Regenerate. + +2004-03-23 Nathanael Nerode + + * Makefile.tpl (new-bootstrap): Set CC and CC_FOR_BUILD in configure + for stages 2 and 3 as well as in make. As a consequence, remove + OUTPUT_OPTION (now detected by configure) from the flags passed down + to make. + * Makefile.in: Regenerate. + + * Makefile.tpl (new-bootstrap): Fix typo. + * Makefile.in: Regenerate. + +2004-03-22 Nathanael Nerode + + * Makefile.tpl: Rearrange by moving recursive_targets rules + into their proper sections. + * Makefile.tpl (top level bootstrap support): Move disabling + of coverage flags from 'make' to 'configure'; improve comments. + * Makefile.in: Regenerate. + + * Makefile.tpl (experimental top level bootstrap) Move stage1 + language setting from all- target to configure- target; disable + intermodule optimization in stage 1; prevent gratuitous rebuilds + of stage 1. + * Makefile.in: Regenerate. + * configure.in: Comma-separate stage 1 language list for top + level bootstrap. + * configure: Regenerate. + + * Makefile.tpl: Clean up experimental top level bootstrap support: + note known problems; set CONFIG_SHELL; don't set BUILD_CC; relocate + prev-gcc in configure- targets as well as all- targets. + * Makefile.in: Regenerate. + +2004-03-17 Paolo Bonzini + + * configure.in: Remove symbolic link section. + * configure: Regenerate. + * Makefile.tpl (links): Remove. + * Makefile.in: Regenerate. + +2004-03-15 Paolo Bonzini + Nathanael Nerode + + * configure.in (DEFAULT_YACC, DEFAULT_M4, DEFAULT_LEX): + Set with AC_CHECK_PROGS. + * configure.in: Fix comment typo from last patch. + * configure: Regenerate. + +2004-03-15 Nathanael Nerode + + * Makefile.tpl: Introduce experimental top level bootstrap support. + * Makefile.in: Regenerate. + * configure.in: Introduce support for top level bootstrap. + * configure: Regenerate. + +2004-03-12 Eric Botcazou + Paolo Bonzini + + PR bootstrap/14522 + * configure.in: Cope with shells that do not support unquoted ^ + * configure: Regenerate. + +2004-03-11 Eric Botcazou + Paolo Bonzini + + PR bootstrap/14522 + * configure.in: Cope with shell that do not support nesting + quotes inside quoted backquote substitutions. + * configure: Regenerate. + +2004-03-10 Andrew Pinski + + PR bootstrap/14522 + * configure.in: Fix escaping of $. + * configure: Regenerate. + +2004-03-11 Nathanael Nerode + + * configure: Regenerate. + +2004-03-08 Paolo Bonzini + + PR ada/14131 + Move language detection to the top level. + * configure.in: Find default values for the tools as + soon as possible. Disable ada if GNAT is not found. + Emit error message about missing languages. Expand + --enable-languages=all for the gcc subdirectory. + +2004-03-01 Richard Sandiford + + * configure.in (mips64*-*-linux*): Override mips*-*-linux* case + and disable libgcj. + * configure: Regenerated. + +2004-02-28 Nathanael Nerode + + PR bootstrap/7087 + * Makefile.tpl: Guard XFOO sed statements better. + * Makefile.tpl: Add dependency for configure-target-libada. + * Makefile.in: Regenerate (incidentally fixes broken + commit when libada-branch was merged). + +2004-02-28 Andrew Cagney + + * src-release (CVS_NAMES): Define. + (do-tar, do-tar): Prune $(CVS_NAMES). + +2004-02-23 Andrew Cagney + + * texinfo/texinfo.tex: Update from version 2003-02-03.16 to + 2004-02-19.09. + +2004-02-19 Nathanael Nerode + + PR bootstrap/11932 + * mkinstalldirs, install-sh: Import from automake CVS HEAD. + +2004-02-19 Andrew Cagney + + * config.guess: Update from version 2003-06-12 to 2004-02-16. + * config.sub: Update from version 2003-06-13 to 2004-02-16. + +2004-02-11 David Edelsohn + + * configure.in (powerpc-*-aix*): Add target-libada to noconfigdirs. + (rs6000-*-aix*): Same. + * configure: Regenerate. + +2004-02-11 Kelley Cook + + * configure.in (host): Add in missing $noconfigdirs to defines. + * configure: Regenerate. + +2004-02-10 Arnaud Charlet , + Nathanael Nerode + + PR ada/6637, PR ada/5911 + Merge with libada-branch: + * configure.in, Makefile.tpl, Makefile.def: Add target-libada, + with appropriate dependencies. Add --enable-libada configure switch. + * configure, Makefile.in: Regenerate. + +2004-02-05 Rainer Orth + + * configure.in: Don't pass --with-stabs on IRIX 5 either. + * configure: Regenerate. + +2004-02-02 Jeff Johnston + + * COPYING.NEWLIB: Update Red Hat license to 2004. + +2004-01-23 DJ Delorie + + * Makefile.def (target_modules) [libiberty]: Don't stage. + * Makefile.in: Rebuilt. + +2004-01-23 Jeff Johnston + + * COPYING.NEWLIB: Update to include copyrights for new + iconv code. + +2004-01-15 Andrew Cagney + + * src-release: Update copyright year. + (do-proto-toplev): Configure using i686-pc-linux-gnu. + (NEWLIB_SUPPORT_DIRS): Delete macro. + (newlib.tar.bz2): Delete rule. + +2004-01-14 Loren J. Rittle + + * Makefile.def (target_modules) [libtermcap, libiberty, zlib]: Stage. + * Makefile.tpl (configure-target-[+module+]): Support stage. + * Makefile.in: Rebuilt. + +2003-01-14 Maciej W. Rozycki + + * gettext.m4: Quote names of macros to be defined by AC_DEFUN + throughout. + +2004-01-04 Nathanael Nerode + + * configure.in: Use ./config.cache, not config.cache. + * configure: Regenerate. + * Makefile.tpl: Special-casing not needed for GCC any more. + * Makefile.in: Regenerate. + + * configure.in: Don't share a cache file for host dirs. + * configure: Regenerate. + + * config-ml.in: Don't mess with the cache file. + +2004-01-03 Nathanael Nerode + + * Makefile.tpl: Make GCC use a separate config.cache. + * Makefile.in: Regenerate. + + PR bootstrap/11932, PR bootstrap/11933 + (I don't know if it will fix either of them, but it relates + to them.) + * configure.in: Don't use shared config.cache for target + directories. + * configure: Regenerate. + +2003-12-31 Roger Sayle + + * configure.in (ia64*-*-hpux*): Disable building java libraries. + * configure: Regenerated. + +2003-12-21 Bernardo Innocenti + + * configure.in (*-*-uclinux): Exclude newlib, libgloss and rda. + * configure: Regenerated. + +2003-12-19 Nathanael Nerode + + Port change over from GCC: + 2003-11-20 Kelley Cook + * Makefile.tpl (BASE_FLAGS_TO_PASS): Pass along CONFIG_SHELL. + (configure-build-[+module+], configure-[+module+]): Likewise. + (configure-target-[+module+], configure-gcc, config.status): Likewise. + * Makefile.in: Regenerate. + +2003-12-08 Thomas Fitzsimmons + + * configure.in (raw_libstdcxx_flags): Remove the leading space. + * configure: Regenerate. + +2003-11-27 Jeff Johnston + + * COPYING.NEWLIB: Add license info for long long routines added to + stdlib. + +2003-11-14 Arnaud Charlet + + * Makefile.tpl (EXTRA_GCC_FLAGS): Pass BOOT_ADAFLAGS. + * Makefile.in: Regenerate. + +2003-10-20 Phil Edwards + + * configure.in (*-*-vxworks): Add target-libiberty to noconfdirs. + * configure: Regenerate. + +2003-10-13 Nathanael Nerode + + * Makefile.tpl: Make GCC_FLAGS_TO_PASS a superset of + HOST_FLAGS_TO_PASS. + * Makefile.in: Regenerate. + +2003-10-05 Mohan Embar + + * configure.in: Allow explicit specification of CFLAGS_FOR_BUILD. + * configure: Rebuilt + * Makefile.tpl: Use CFLAGS_FOR_BUILD computed by configure + * Makefile.in: Rebuilt + +2003-10-03 H.J. Lu + + * ltconfig (sys_lib_search_path_spec): Fix a typo for HPUX. + +2003-10-01 Phil Edwards + + * config-ml.in: Use ac_configure_args directly instead of + ml_arguments. Only set ml_norecursion if --no[-]recursion is + actually seen. + +2003-10-01 Eric Botcazou + + * config-ml.in: Propagate INSTALL variables. + +2003-09-21 Daniel Jacobowitz + + * configure.in: Pass a computed --program-transform-name + to subconfigures. + * configure: Regenerated. + +2003-09-20 Nathanael Nerode + + * Makefile.tpl: Don't pass down obsolete ENQUIRE variable. + * Makefile.in: Regenerate. + + * Makefile.tpl: Don't pass (unused) DLLTOOL or WINDRES to gcc. + * Makefile.in: Regenerate. + +2003-09-17 Daniel Jacobowitz + + * configure.in (TOPLEVEL_CONFIGURE_ARGUMENTS, baseargs): Fix + quoting. + * configure: Regenerated. + +2003-09-12 Michael Chastain + + Fix PR gdb/857. + * src-release (do-proto-topleve): Remove junk files + intl/config.cache, intl/config.status, + intl/config.h, intl/stamp-h. + +2003-09-14 Andrew Cagney + + * src-release (dejagnu.tar): New target. + (dejagnu.tar.bz2): Recursively call "gdb-taz" rule. + (do-djunpack): Use $(PACKAGE) for the package name. + +2003-09-04 DJ Delorie + + * configure: Regenerate. + +2003-09-04 Robert Millan + + * configure.in: Match GNU/KFreeBSD with new kfreebsd*-gnu triplet. + +2003-09-02 Kaveh R. Ghazi + + * configure.in: Ensure arguments to sed are properly spaced. + * configure: Regenerate. + +2003-08-28 Daniel Jacobowitz + + Merge from gcc: + 2003-07-20 Phil Edwards + * install-sh: Update to newer upstream versions (associated with + aclocal 1.7). + * missing: Likewise, plus $1Help2man -> $1 typo fix. + +2003-08-27 Daniel Jacobowitz + + * configure.in: Set RAW_CXX_FOR_TARGET if unset. + * configure: Regenerated. + +2003-08-23 Phil Edwards + + * configure.in: Use newline instead of semicolon when assuming + shell arguments in a for loop. + * configure: Regenerated. + +2003-08-20 Geoffrey Keating + + PR 8180 + * configure.in: When testing with_libs and with_headers, treat + 'no' as unset. Based on a patch by Dan Kegel . + * configure: Regenerate. + + * configure.in (TOPLEVEL_CONFIGURE_ARGUMENTS): Quote properly for + make, shell, etc. + (baseargs): Likewise. + * configure: Regenerate. + +2003-08-19 Geoffrey Keating + + * configure.in: Disable libgcj for darwin not on powerpc. + * configure: Rebuild. + +2003-08-15 Michael Chastain + + * src-release (do-proto-toplev): Remove junk files + dejagnu/example/calc/config.status, + dejagnu/example/calc/config.log. + +2003-08-14 Alexandre Duret-Lutz + + * config-ml.in, symlink-tree: Add license. + +2003-08-01 Nathanael Nerode + + Merge from gcc: + + 2003-08-01 Matt Kraai + * Makefile.tpl (check, check-c++): Express dependencies using + dependencies rather than commands. + * Makefile.in: Regenerate. + + 2003-07-31 Geoffrey Keating + * Makefile.tpl (libsubdir): Use gcc instead of gcc-lib. + * Makefile.in: Update. + +2003-08-01 Andrew Cagney + + * configure.in (noconfigdirs): Do not add GDB when m32r-*-*. + * configure: Ditto. + +2003-07-30 Andreas Tobler + + * configure.in: Enable libgcj for darwin. + * configure: Rebuild. + +2003-07-29 Nathanael Nerode + + * mkinstalldirs: Import autoconf 2.57 / automake 1.7 version. + +2003-07-27 Nathanael Nerode + + * Makefile.tpl: Use 'mkinstalldirs' rather than 'mkdir' when + creating target and build subdirs to build all parent dirs as needed. + * Makefile.in: Rebuild. + * configure.in: Don't build dirs explicitly here. + * configure: Rebuild. + +2003-07-22 Alexandre Oliva + + * Makefile.tpl (all-make): Depend on intl. + * Makefile.in: Rebuilt. + +2003-07-16 Nathanael Nerode + + * config.if: Remove unused libc_interface determination. + +2003-07-14 Nathanael Nerode + + * Makefile.in: Regenerate, correctly this time. + +2003-07-13 Nathanael Nerode + + * Makefile.tpl: Set INSTALL and friends using autoconf. Remove + unused INSTALL_PROGRAM_ARGS. + * configure.in: Use AC_PROG_INSTALL. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2003-07-10 Alexandre Oliva + + * configure: Rebuilt. + 2001-09-26 Alexandre Oliva + * configure.in (noconfigdirs) [am33_2.0-*-linux*]: Don't build + newlib nor libgloss. + Wed May 9 10:07:19 2001 Alexandre Oliva + * configure.in (am33_2.0-*-linux*): Added. + +2003-07-09 Bob Wilson + + * configure.in: Add ${libgcj} to noconfigdirs for xtensa-*-* targets. + * configure: Regenerate. + +2003-07-06 H.J. Lu + + * config-ml.in: Replace PWD with PWD_COMMAND. + * Makefile.tpl: Likewise. + * Makefile.in: Regenerated. + +2003-06-27 Nathanael Nerode + + * configure.in: Clean up config-lang.in handling. Delete + useless assignment to "subdirs". + * configure: Regenerate. + +2003-06-26 Nathanael Nerode + + * configure.in: Rename 'target_libs' to 'target_libraries'. + Remove useless reference to 'target_libs'. + * configure: Regenerate. + +2003-06-23 Keith Seitz + + * Makefile.tpl: Add maybe-configure-itcl to configure-gdb. + * Makefile.in: Regenerate. + +2003-06-23 Nathanael Nerode + + * Makefile.def: Introduce flags_to_pass. + * Makefile.tpl: Generate BASE_FLAGS_TO_PASS using it. + * Makefile.in: Regenerate. + +2003-06-23 Hans-Peter Nilsson + + * configure.in (noconfigdirs) : Disable target-newlib + and target-libgloss. + : Disable gdb. + : Disable libf2c and ${libgcj}. + * configure: Regenerate. + +2003-06-17 Benjamin Kosnik + + * configure.in: Update testsuite_flags to new location. + * configure. Regenerate. + +2003-06-18 Nathanael Nerode + + * Makefile.tpl: Remove BUILD_CC stuff. + * Makefile.in: Regenerate. + +2003-06-14 H.J. Lu + + * config.guess: Update to 2003-06-12 version. + * config.sub: Update to 2003-06-13 version. + +2003-06-12 Thiemo Seufer + + * MAINTAINERS: Add myself as MIPS co-maintainer. + +2003-06-12 H.J. Lu + + * config.guess: Update to 2003-06-06 version. + * config.sub: Update to 2003-06-06 version. + +2003-06-11 Rainer Orth + + * configure.in: Don't pass --with-stabs for mips*-sgi-irix6*o32. + * configure. Regenerate. + +2003-06-10 Nathanael Nerode + + * configure.in: Disable serial configure by default. + * configure: Regenerate. + * Makefile.tpl: Abolish .NOTPARALLEL. + * Makefile.in: Regenerate. + + * Makefile.tpl: Replace {build,host,target}_canonical by + {build,host,target}. + * Makefile.in: Regenerate. + + * Makefile.tpl: Fix stupid pasto. + * Makefile.in: Regenerate. + +2003-06-09 Nathanael Nerode + + * Makefile.tpl: Remove bogus conditional. + * Makefile.in: Regenerate. + +2003-06-03 Nathanael Nerode + + * Makefile.tpl: Make 'recursive targets' using autogen rather + than shell loop. Remove duplicate 'clean' targets and false + comments. + * Makefile.def: Add systematic dependencies to 'recursive' targets. + Add systematic method of specifying missing targets in subdirs. + Add copyright boilerplate. + * Makefile.in: Regenerate. + * configure.in: Add 'recursive targets' to maybe list. + * configure: Regenerate. + + * Makefile.tpl: Rename [+target+] to [+make_target+]. + * Makefile.def: Rename 'target' to 'make_target'. + +2003-05-30 Nick Clifton + + * README-maintainer-mode: Update URL for locating blessed config + tools. + +2003-05-29 Robert Millan + + * ltconfig: Import this patch and modify for use with current + version of ltconfig: + + 2003-05-21 Bruno Haible + + * libtool.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER): Add support for + GNU/FreeBSD. + +2003-05-28 DJ Delorie + + * Makefile.tpl: Make maybe-check-gcc .PHONY. + * Makefile.in: Regenerate. + +2003-05-28 Jeff Johnston + + * COPYING.NEWLIB: Add license info for newlib/libc/sys/linux/stdlib. + +2003-05-21 DJ Delorie + + * Makefile.tpl (configure-target-libiberty): Depend only on gcc, not + newlib or libgloss. + * Makefile.in: Regenerate. + +2003-05-21 DJ Delorie + + * Makefile.tpl: Add missing empty maybe-check-gcc target. + * Makefile.in: Regenerate. + +2003-05-20 Maciej W. Rozycki + + * configure.in: Use curly braces in the definition of tooldir. + * configure: Regenerate. + +2003-05-19 Nathanael Nerode + + * configure.in: Switch more things to use maybe dependencies. + * Makefile.tpl: Switch more things to use maybe dependencies. + Factor out common code from autogen IF statements. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2003-05-14 Kelley Cook + + * configure.in: Accept i[3456789]86 for machine type. + * configure: Regenerate. + +2003-05-18 Nathanael Nerode + + * configure.in: Switch more things to use maybe dependencies. + Rearrange a little. Use GCC_TOPLEV_SUBDIRS. + * configure: Regenerate. + * Makefile.tpl: Switch more things to use maybe dependencies. + * Makefile.in: Regenerate. + +2003-05-16 Andreas Schwab + + * Makefile.tpl (install-opcodes): Define. + * Makefile.in: Rebuild. + +2003-05-13 Andreas Jaeger + + * config.guess: Update to 2003-05-09 version. + * config.sub: Update to 2003-05-09 version. + +2003-05-13 Michael Eager + + * configure.in: Correct sed script so that options in quotes are not + deleted. + * configure: Rebuild. + +2003-05-12 Corinna Vinschen + + * configure.in (FLAGS_FOR_TARGET): Remove $$s/newlib/libc/sys/cygwin + and $$s/newlib/libc/sys/cygwin32 include paths. + * configure: Ditto. + +2003-05-05 H.J. Lu + + * config-ml.in: Restored from gcc repository. + +2003-05-02 Chris Demetriou + + * Makefile.tpl: Require "makeinfo" from texinfo 4.2 or later. + * Makefile.in: Regenerate. + +2003-04-27 Daniel Jacobowitz + + * src-release (DEVO_SUPPORT): Add src-release, Makefile.tpl, + and Makefile.def. + +2003-04-27 Daniel Jacobowitz + + * Makefile.tpl: Clean $(BUILD_SUBDIR). + * Makefile.in: Regenerated. + +2003-04-18 Gerald Pfeifer + + * Makefile.tpl (MAKEINFOFLAGS): Default to --split-size=5000000. + * Makefile.in: Regenerate. + +2003-04-18 Jakub Jelinek + + * configure.in (powerpc64*-*-linux*): Remove. + * configure: Rebuilt. + +2003-04-17 Phil Edwards + + * Makefile.tpl (GCC_STRAP_TARGETS): New variable containing all the + previous bootstrap targets, plus bubblestrap, quickstrap, cleanstrap, + and restrap. + * Makefile.in: Regenerate. + +2003-04-16 Richard Earnshaw + + * configure.in (arm-*-netbsdelf*): Enable building java libraries. + * configure: Regenerated. + +2003-04-11 Alexandre Oliva + + * libtool.m4 (lt_cv_deplibs_check_method): Use pass_all on mips*. + * */configure: Rebuilt. + +2003-03-14 Nathanael Nerode + + * Makefile.tpl: Move .NOEXPORT, MAKEOVERRIDES back down. + * Makefile.in: Regenerate. + +2003-03-14 Michael Chastain + + * Makefile.in: Regenerate with correct Makefile.def. + +2003-03-12 Nathanael Nerode + + * Makefile.tpl: Move .NOEXPORT, MAKEOVERRIDES up. Delete unused + Make macro. + * Makefile.in: Regenerate. + * configure.in: Clean up gxx_include_dir logic. + * configure: Regenerate. + +2003-03-09 Franz Sirl + + * configure.in (gxx_include_dir): Fix typo. + * configure: Regenerated. + +2003-03-06 Andrew Cagney + + * texinfo/texinfo.tex: Import version 2003-02-03.16. + +2003-03-04 Daniel Jacobowitz + + * configure.in: Include $(build_tooldir)/sys-include in + FLAGS_FOR_TARGET. + * configure: Regenerated. + +2003-03-04 Nathanael Nerode + + * Makefile.tpl: Reindent. + * Makefile.in: Regenerate. + * configure.in: Reindent. Don't set unused variables. + * configure: Regenerate. + + * Makefile.tpl: Always pass down RANLIB. + * Makefile.in: Regenerate. + + * Makefile.tpl: Don't set unused enable_shared, enable_threads macros. + * Makefile.in: Regenerate. + * configure.in: Remove unused logic relating to --enable-shared + and --enable-threads. Remove bogus comments. Remove redundant + noconfigdirs. + * configure: Regenerate. + + * configure.in: Replace ${libstdcxx_version} by its value. + Remove reference to mh-dgux. + * configure: Regenerate. + +2003-02-28 Nathanael Nerode + + * Makefile.tpl: Rearrange. + * Makefile.in: Regenerate. + +2003-02-25 Nick Clifton + + * configure: Remove site-file supprot - it is obsolete. + +2003-02-24 Uwe Stieber + + * configure.in: Add support for kaOS as cross build target system. + * configure: Regenerated. + +2003-02-20 Sean McNeil + + * Makefile.tpl: Add definition of CPPFLAGS to pass into + configure-target-* as some target builds may require additional + flags for preprocessor tests. + * Makefile.in: Regenerated. + +2003-02-19 Alexandre Oliva + + * libtool.m4 (LD): Append -melf* option to LD on IRIX with GNU ld. + * ltconfig: Handle it. + * ltcf-cxx.sh: Use with_gnu_ld passed as a shell variable instead of + auto-detecting it. + +2003-02-19 Alexandre Oliva + + * ltcf-cxx.sh: Replace $linker_flags with $compiler_flags wherever + it is used as argument to $CC. + * ltcf-gcj.sh: Likewise. + +2003-02-19 Alexandre Oliva + + * configure.in: Introduce --enable-maintainer-mode. + * configure: Rebuilt. + * Makefile.tpl (Makefile.in, configure): Enable dependencies only + for maintainer mode. + * Makefile.in: Rebuilt. + +2003-02-19 Andrew Cagney + + * configure: Regenerate using autoconf 2.13. + +2003-02-19 Alan Modra + + * config.guess: Import latest version. + * config.sub: Import latest version. + +2003-02-18 Jason Merrill + + * Makefile.tpl (check-c++): Allow parallelism. + +2003-02-17 Andrew Cagney + + * configure: Regenerate using autoconf 000227. + +2003-02-15 Geoffrey Keating + + * configure.in (*-*-darwin*): Rename from powerpc*-*-darwin*, + don't configure target-libobjc. + * configure: Regenerate. + +2003-02-14 Rainer Orth + + * Makefile.tpl (RANLIB): Define. + * Makefile.in: Regenerate. + +2003-02-06 Keith R Seitz + + * Makefile.def: Remove "snavigator", "grep", and "db" modules. + * Makefile.tpl: Remove "all-snavigator" and "all-grep". + * Makefile.in: Regenerated. + * configure.in: Remove all traces of snavigator, db, and grep. + * configure: Regenerated. + +2003-01-31 Frank Ch. Eigler + + * Makefile.tpl (all-sid): Add libiberty/bfd/opcodes dependencies. + * Makefile.in: Regenerated. + +2003-01-30 Alexandre Oliva + + * config.if: Copy from GCC. + +2003-01-27 Phil Edwards + + * configure.in: Revert 24Jan change. + * configure: Regenerate. + +2003-01-23 Nathanael Nerode + + * configure.in: Revert previous change. + * configure: Regenerate. + +2003-01-23 Nathanael Nerode + + * configure.in: Make rda native-only. + * configure: Regenerate. + +2003-01-19 Nathanael Nerode + + * configure.in: Add missing \. + * configure: Rebuilt. + +2003-01-17 Jakub Jelinek + + * configure.in (baseargs): Avoid using \| in sed regular + expressions. + * configure: Rebuilt. + +2003-01-16 Jakub Jelinek + + * configure.in (baseargs): Remove all supported forms of + --cache-file, --srcdir, --host, --build and --target options + from argument lists. + * configure: Rebuilt. + +2003-01-15 Alexandre Oliva + + * configure.in (noconfigdirs): Don't skip gas on IRIX 6. + * configure: Rebuilt. + +2003-01-09 Nathanael Nerode + + * configure.in: Substitute TOPLEVEL_CONFIGURE_ARGUMENTS. + * Makefile.tpl: Pass TOPLEVEL_CONFIGURE_ARGUMENTS to gcc. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2003-01-09 Christian Cornelssen + + * Makefile.tpl (BASE_FLAGS_TO_PASS): Also pass DESTDIR. + (install-info, dir.info): Prepend $(DESTDIR) to $(infodir). + * Makefile.in: Regenerate. + +2003-01-09 Alexandre Oliva + + * configure.in: Remove Makefile in build, host and target modules + unless configure was run with --no-recursion. + * configure: Rebuilt. + +2003-01-08 Chris Demetriou + + * config.guess: Update to 2003-01-03 version. + * config.sub: Update to 2003-01-03 version. + +2003-01-07 Christopher Faylor + + * configure: Regenerate with proper autoconf 2.13. + +2003-01-07 Christopher Faylor + + * configure.in: Add AC_PREREQ for consistency. + * configure: Regenerate. + +2003-01-06 Andrew Cagney + + * configure.in (GDB_TK): Add tcl directories conditional on + gdb/gdbtk directory being present. + * configure: Regenerate. + +2003-01-04 John David Anglin + + * configure.in (LD): Improve test for gcc. Try to set LD to the ld used + by gcc if LD is not defined and we are not doing a Canadian Cross. + * configure: Rebuilt. + +2003-01-01 Daniel Jacobowitz + + * src-release (ETC_SUPPORT): Add fdl.texi and texi2pod.pl. + +2002-12-31 Tom Tromey + + * Makefile.in: Rebuilt. + * Makefile.def (target_modules) [libffi]: Allow installation. + +2002-12-31 Andreas Schwab + + * configure.in: Fix use of $program_transform_name. + * configure: Regenerated. + +2002-12-30 Daniel Jacobowitz + + * configure.in (baseargs): Don't remove first configure argument. + * configure: Regenerated. + +2002-12-29 Alexandre Oliva + + * Makefile.tpl (local-distclean): Don't remove... + (multilib.ts): ... this. Moved into... + (multilib.out): ... this. Don't use sub-make. + ($(BUILD_SUBDIR)/[+module+]/Makefile, [+module+]/Makefile, + $(TARGET_SUBDIR)/[+module+]/Makefile, gcc/Makefile): Moved into... + (configure-build-[+module+], configure-[+module+], + configure-target-[+module+], configure-gcc): ... these. Test + for Makefile existence. Drop config.status from dependencies. + * Makefile.in: Rebuilt. + * configure.in: Move gcc-version-trigger to the end of + ac_configure_args. Add comments to maybedep.tmp and + serdep.tmp. Introduce --disable-serial-configure. Remove + nonopt from baseargs, matching and removing corresponding + whitespace while at it. + * configure: Rebuilt. + +2002-12-28 Alexandre Oliva + + * configure.in (host_configargs): Replace reference to + no-longer-defined buildopts with --build=${build_alias}. + * configure: Rebuilt. + +2002-12-28 Alexandre Oliva + + * Makefile.tpl ($(NOTPARALLEL)): Move to the end. Bring uses of + program_transform_name to standard idiom. + (AUTOGEN, AUTOCONF): Define. + (Makefile.in): Use $(AUTOGEN). + (Makefile): Depend on config.status, and use autoconf-style rule to + build it. Move original commands to... + (config.status): ... this new target. + (configure): Add $(srcdir). Depend on config/acx.m4. Use + $(AUTOCONF). + * Makefile.in: Rebuilt. + +2002-12-28 Nathanael Nerode + + * Makefile.tpl: Fix dramatic bustage due to change in + program_transform_name. + * Makefile.in: Regenerate. + + * configure.in: Remove unnecessary PATH setting. + * configure: Regnerate. + + * configure.in: Don't default to unprefixed tools unless + the native tools will work. + * configure: Regenerate. + + * configure.in: Convert to autoconf script. Blow away lots + of now-redundant Makefile fragments. + * configure: Generate using Autoconf. + * Makefile.tpl: Rewrite to reflect autoconfiscation. + * Makefile.in: Regenerate. + +2002-12-27 Nathanael Nerode + + * configure: Remove unneeded 'export's. Make CC_FOR_TARGET, + CXX_FOR_TARGET, GCJ_FOR_TARGET substituted in configure.in only. + + * ChangeLog: Move a couple of entries from here to winsup/cygwin, + where they belong. + +2002-12-24 Andreas Schwab + + * Makefile.tpl (multilib.out): Fix missing space. + * Makefile.in: Regenerate. + +2002-12-23 Nathanael Nerode + + * Makefile.tpl: Use shared multilib.out. Use move-if-change for it. + Convert (cd foo; make) to (cd foo && make). Clean up multilib.out. + * Makefile.in: Regenerate. + * configure.in: Remove unnecessary leftovers. + +2002-12-21 Geoffrey Keating + + * configure.in (extra_ranlibflags_for_target): New variable. + (*-*-darwin): Add -c to ranlib commands. + * configure (tooldir): Handle extra_ranlibflags_for_target. + +2002-12-20 Jeff Johnston + + * COPYING.NEWLIB: Updated. + * COPYING.LIBGLOSS: Ditto. + +2002-12-19 Nathanael Nerode + + * Makefile.tpl: Revert HJL's change. + * Makefile.in: Regenerated. + * configure.in: Put build_prefix before $(BUILD_SUBDIR) here, and + always. + +2002-12-19 Andreas Schwab + + * Makefile.tpl, configure.in: Substitute libstdcxx_incdir. + * Makefile.in: Regenerate. + +2002-12-18 H.J. Lu + + * Makefile.tpl: Add @build_prefix@ before $(BUILD_SUBDIR). + * Makefile.in: Regenerated. + + * configure.in (build_prefix): New. Substitute. + +2002-12-18 Nathanael Nerode + + * Makefile.tpl: Don't let real targets depend on phony targets. + * Makefile.in: Regenerate. + + * Makefile.tpl (do-info): Depend on maybe-all-texinfo, not all-texinfo. + * Makefile.in: Regenerate. + +2002-12-16 Jason Merrill + + * Makefile.tpl (all-gcc): Use 'make quickstrap' if there was a + previous 'make bootstrap'. + * Makefile.in: Regenerate. + +2002-12-17 Hans-Peter Nilsson + + * configure.in (noconfigdirs) [mmix-*-*]: Disable libgloss and gdb. + +2002-12-13 Jason Merrill + + * Makefile.tpl (check-gcc-c++): Renamed from check-c++. Don't run + library tests. + (check-c++): Just depend on it and check-target-libstdc++-v3. + * Makefile.in: Regenerate. + +2002-12-13 Nathanael Nerode + + * configure.in, Makefile.tpl, Makefile.def: Remove tclX. + * Makefile.in: Regenerate. + +2002-12-12 Jeff Johnston + + * COPYING.NEWLIB: Update list of alternate Regent of California + licenses and discuss official revoking of advertising clause. + * COPYING.LIBGLOSS: Ditto. + +2002-12-12 Alexandre Oliva + + * Makefile.tpl (configure-target-rda): Depend on $(ALL_GCC_C). + * Makefile.in: Rebuilt. + +2002-12-10 Nathanael Nerode + + * configure: Fix bug put in by gremlins. + + * Makefile.tpl: Substitute more autoconfily. + * configure: Substitute more autoconfily. + * Makefile.in: Regenerate. + +2002-12-08 Andrew Cagney + + * Makefile.tpl (all-sim): Depend on maybe-configure-gdb. + * Makefile.in (all-sim): Ditto. + +2002-12-06 DJ Delorie + + * Makefile.tpl: Change configure dependencies to not have real + targets depend on phony targets. + +2002-12-05 Nathanael Nerode + + * configure.in: Revert unintentional change. + + * src-release: Configure host subdirs. + + * Makefile.tpl: Change dependency for */multilib.out so that + it works when gcc isn't in the tree. + + * configure.in: Substitute more. + * configure: Run subconfigures from the Makefile. + * Makefile.tpl: Run subconfigures from the Makefile; add a few + convenience targets. Make sure gcc isn't rebuilt after bootstrap. + +2002-12-03 Nathanael Nerode + + * Makefile.tpl: Add targets for configuring host subdirs in Makefile, + and corresponding dependencies. + * Makefile.in: Regenerate. + + * configure.in (host_tools): Order binutils, gas and ld for + convenience in running the testsuites. + + * Makefile.tpl: Introduce rules to serialize subconfigure runs. + * Makefile.in: Regenerate. + * configure.in: Introduce rules to serialize subconfigure runs. + + * configure.in: Introduce BASE_CC_FOR_TARGET. + * Makefile.tpl: Reorganize and comment. Introduce HOST_CONFIGARGS. + Realize configure-build-* targets. Realize configure-target-* targets. + * Makefile.in: Regenerate. + +2002-12-02 Nathanael Nerode + + * configure: Move gcc_version_trigger stuff from here... + * configure.in: ...to here. + + * configure.in: Separate subconfigure options added by this file from + options given by the user. Add machinery to put args for host + subconfigures into the Makefile. + + * Makefile.tpl: Remove 'vault' targets. + * Makefile.tpl: Reorder and comment dependencies. + * Makefile.in: Regenerate. + +2002-11-28 Geoffrey Keating + + * configure.in: Move host-specific darwin noconfigdirs into + the host-specific section. + +2002-12-02 Nathanael Nerode + + * Makefile.tpl: Restore bkorb's style patch, accidentally lost + during replay. + * Makefile.in: Regenerate. + + (finishing slow-motion replay) + * configure: Remove skip-this-dir support. + * Makefile.tpl: Remove skip-this-dir support. + + * Makefile.tpl: Remove leftover support for non-autoconfiscated + subdirectories. + * Makefile.in: Regenerate. + + * Makefile.tpl: Strip out useless setting of 'dir'. + * Makefile.in: Regenerate. + +2002-12-02 Nathanael Nerode + + (finishing slow-motion replay) + * configure.in: Fix deeply stupid bug. + + * configure.in: Introduce RAW_CXX_FOR_TARGET and simplify embedded + shell code in CXX_FOR_TARGET + * Makefile.def: Introduce raw_cxx. + * Makefile.tpl: Use raw_cxx to select between CXX_FOR_TARGET and + RAW_CXX_FOR_TARGET. + * Makefile.in: Regenerate. + +2002-12-02 Nathanael Nerode + + (finishing slow-motion replay) + * Makefile.tpl: Remove unnecessary ifs. + * Makefile.in: Regenerate. + + * Makefile.tpl: Implement soft dependency machinery. Maybe-ize + dependencies. Maybe-ize build-libiberty. Create dummy install + targets for 'no_install' modules. + * configure: Move GDB_TK substitution to configure.in. Move + build_modules stuff to configure.in. + * configure.in: Implement soft dependency machinery. Maybe-ize + GDB_TK, rearrange slightly. Move build_modules stuff from configure. + * Makefile.in: Regenerate. + +2002-12-01 Nathanael Nerode + + (continuing slow-motion replay) + * Makefile.tpl: Make all-target, install-target behave similarly + to all, install (only hitting configured targets). Eliminate + unused macro defintions. + + * Makefile.tpl: Add all-gcc: all-build-libiberty dependency when + build != host. + + * Makefile.tpl: Add all-gcc: all-libiberty dependency. + + * ltcf-c.sh, ltcf-gcj.sh, Makefile.tpl: Correct BUILD/HOST confusion. + + * configure.in: Produce lists of subdir targets we're actually + configuring. Remove references to "dosrel". + * Makefile.tpl: Let configure set which subdir targets are hit. + Remove install-cross; clean up install; remove ALL. Remove + references to "dosrel". Remove "EXTRA_TARGET_HOST" hackery. + Autogenerate host module targets. Remove empty dependency lines + and redundant dependency; rearrange slightly. + * Makefile.def: Add host-side libtermcap, utils. + + * Makefile.in: Regenerate. + +2002-12-01 Nathanael Nerode + + (Continuing slow-motion replay) + * Makefile.def: Add list of recursive targets to autogenerate. + Add build_modules. + * Makefile.tpl: Autogenerate do-* targets. Autogenerate *-target-* + targets. Autogenerate *-build-* targets. + * Makefile.in: Regenerate. + +2002-11-30 Nathanael Nerode + + (Continuing slow-motion replay) + * configure: More autoconf-style substitutions. + * Makefile.tpl: More autoconf-style substitutions. + * Makefile.in: Regenerate. + +2002-11-30 Nathanael Nerode + + (Continuing slow-motion replay) + * configure: Substitute more variables in a more autoconf-friendly + way. Simplify slightly. + * Makefile.tpl: Make more variables substitutable in an + autoconf-friendly way. + * Makefile.in: Regenerate. + +2002-11-29 Nathanael Nerode + + (Continuing slow-motion replay) + * configure.in (v810*): Remove special setting of tools. + + * configure: Add support for extra required flags for ar or nm. + * configure.in (aix4.3+): Use above support for target-specific + issues, rather than using config/mt-aix43. + +2002-11-29 Nathanael Nerode + + (Starting slow-motion replay merge from gcc 3.4 b-i-b branch) + * configure: Remove 'removing', which doesn't work. Replace $subdir + with . everywhere. Replace $subdirs with ''. Replace $makesrcdir + with $srcdir. Reformat indentation. Substitute some variables + formerly hard-coded in the Makefile for build=host. + * Makefile.tpl: Autogenerate more; make more autoconf-friendly. + * Makefile.def: Autogenerate more. + * Makefile.in: Regenerate. + +2002-11-13 Bruce Korb + + * Makefile.tpl: syntactic cleanup + +2002-11-04 Kevin Buettner + + * Makefile.def (host_modules): Add rda. + * Makefile.in: Regenerate. + * configure.in (target_tool): Add target-rda to list. + +2002-10-25 Phil Edwards + + * Makefile.tpl (bootstrap): Add bubblestrap, quickstrap, cleanstrap, + and restrap targets to this rule. + * Makefile.in: Regenerate. + +2002-10-24 Hans-Peter Nilsson + + * configure.in (i[3456]86-*-linux*): Add check to disable + ${libgcj} for glibc1. + +2002-10-07 Svein E. Seldal + + * configure.in: Add tic4x target. + +2002-10-03 Nathanael Nerode + + * Makefile.tpl: Make SET_LIB_PATH substitution more autoconfy. + * Makefile.tpl: Make RPATH_ENVVAR substitution more autoconfy. + * configure.in: Make SET_LIB_PATH substitution more autoconfy. + * configure.in: Make RPATH_ENVVAR substitution more autoconfy. + * Makefile.in: Regenerate. + +2002-10-02 Nathanael Nerode + + * Makefile.tpl: Eliminate reference to all-gui, all-libproc. + * Makefile.in: Regenerate. + + * Makefile.def: Remove order dependency comments. + * Makefile.tpl: Add explicit install-install dependencies. + * Makefile.in: Regenerate. + + * Makefile.tpl: Remove material now in src-release. (Finally!) + * Makefile.in: Regenerate. + + * configure: Restore my original patch by syncing with gcc version. + + * Bring following over from gcc: + +2002-09-30 Ulrich Weigand + + * configure.in (s390*-*-linux*): Enable libgcj. + +2002-10-02 Nathanael Nerode + + * Makefile.in: Regenerate. This really ought to fix things. :sigh: + +2002-10-02 Alan Modra + + * configure: Move stray lines back to where they belong. + +2002-10-01 Nathanael Nerode + + * Makefile.tpl: Insert configure-target target, for src-release. + + * configure: Finish reverting change which Andrew Cagney started + reverting. Should fix bustage. + + * src-release (BINUTILS_SUPPORT_DIRS): Add cpu directory. + * src-release: New file. Contains material for making net + releases for gdb, binutils, et al., formerly in Makefile.in. + +2002-09-30 Nick Clifton + + * cpu: New top level directory. Intended to hold input files for + CGEN which have FSF copyright assignment. + * Makefile.in (BINUTILS_SUPPORT_DIRS): Add cpu directory. + +2002-09-29 Andrew Cagney + + Revert below (note that src does not contain Makefile.tpl): + * Makefile.tpl: Make subsituted variables more autoconfy. + * Makefile.in: Regenerate. + +2002-09-29 Nathanael Nerode + + * configure: Revert accidentally applied changes. + + * Makefile.tpl: Make more autoconf-friendly. + * Makefile.in: Regenerate. + * configure: Make substitution more autoconf-like. + +2002-09-28 Richard Earnshaw + + * configure.in (arm-*-coff, strongarm-*-coff, xscale-*-coff): Use a + single entry to handle all these. + (arm-*-elf, strongarm-*-elf, xscale-*-elf): Likewise. Also enable + libjava on arm-*-elf. + +2002-09-27 Geoffrey Keating + + * configure.in (powerpc-*-darwin*): Don't configure BFD, TK, or the + things that depend on them. + +2002-09-25 Nathanael Nerode + + * Makefile.tpl: Make subsituted variables more autoconfy. + * Makefile.in: Regenerate. + * configure: Make seds more autoconfy. + +2002-09-25 Nathanael Nerode + + * Makefile.tpl: Rewrite substituted lines to look autoconfy. + * Makefile.in: Regenerate. + * configure.in: Rewrite sed statements to look autoconfy. + + * Makefile.tpl: Autogenerate *-target-* lists, dependencies of + all-target-foo on configure-target-foo. + * Makefile.def: Ditto. + * Makefile.in: Rebuild. + +2002-09-22 Nathanael Nerode + + * Makefile.def: New file. + * Makefile.tpl: New file. + * Makefile.in: Generate from Makefile.tpl with 'autogen Makefile.def'. + + * configure.in: Minor rearrangement. Simplify tests. + +2002-09-23 Jason Thorpe + + * configure.in (with_headers): Skip copy if value is "yes". + (with_libs): Likewise. + +2002-09-20 Nathanael Nerode + + * configure.in (*-*-netbsd*): Use noconfigdirs, not skipdirs. + * configure.in (sh*-*-pe*): Ditto. + * configure.in (mips*-*-pe*): Ditto. + * configure.in (*arm-wince-pe): Ditto. + + * configure.in: Rearrange. + +2002-09-12 Nick Clifton + + * Import these changes from the config master repository: + + 2002-09-05 Svein E. Seldal + + * config.sub: Add tic4x target. + + 2002-09-03 Ben Elliston + + * config.guess: Detect NSR-D machines for nsr-tandem-nsk. + Reported by . + +2002-09-10 Jeff Johnston + + * COPYING.NEWLIB: More updates. + +2002-09-09 Jeff Johnston + + * COPYING.NEWLIB: Update. + +2002-08-23 Andrew Cagney + + * texinfo/texinfo.tex: Import version 2002-06-04.06. + + * config.guess: Import version 2002-08-23. + * config.sub: Import version 2002-08-22. + +2002-08-20 Alexandre Oliva + + * Makefile.in (GCC_FOR_TARGET): Prepend STAGE_CC_WRAPPER. + * configure.in (CC_FOR_TARGET, GCJ_FOR_TARGET, CXX_FOR_TARGET, + CXX_FOR_TARGET_FOR_RECURSIVE_MAKE): Likewise. + +2002-08-06 Federico G. Schwindt + + * configure.in (hppa*-*-openbsd*): Treat like hppa*-*-*elf*. + +2002-08-04 H.J. Lu (hjl@gnu.org) + + * configure.in (mips*-*-linux*): Don't skip target-libffi. + +2002-07-31 Alan Modra + + * configure.in: Move generic linux case to end. Copy generic + linux noconfigdirs to mips*-*-linux* entry and new + powerpc64*-*-linux* entry. Add target-libffi for the latter. + +2002-07-19 Chris Demetriou + + * MAINTAINERS: Clarify on config.guess and config.sub, and add + one instance of them which was missed to the list to update. + +2002-07-16 Chris Demetriou + + * config.guess: Update to 2002-07-09 version. + * config.sub: Update to 2002-07-03 version. + +2002-07-11 Nathanael Nerode + + * configure.in: Remove two redundant tests. + +2002-07-11 Rainer Orth + + * configure.in (mips*-*-irix6*o32): Enable stabs. + +2002-07-08 Nathanael Nerode + + * configure.in: Don't build grez. + * Makefile.in: Ditto. + + * Makefile.in: Remove references to bsp, cygmon, libstub. + * configure.in: Ditto. + + * configure.in: Remove leftover reference to gdbtest. + +2002-07-08 Phil Edwards + + * configure.in (gxx_include_dir): Change to match versioned + C++ headers if --enable-version-specific-runtime-libs is used. + +2002-07-04 Steve Ellcey + + * ltcf-cxx.sh (hpux*): Modify to support ia64-*-hpux*. + +2002-07-03 Nathanael Nerode + + * configure.in: Make --without-x work. + +2002-07-03 Nick Clifton + + * contrib: New directory. Created to contain a copy of the + texi2pod.pl script so that it is in the same place as the version in + the FSF GCC sources. + +2002-07-02 Nathanael Nerode + + * configure.in: Rearrange target Makefile fragment collection. + + * Makefile.in: Don't try to build gdbtest, tgas, ispell, inet, or + cvs[src]. + * configure.in: Ditto. + +2002-07-01 Nathanael Nerode + + * Makefile.in: Eliminate 'apache' targets. + * configure.in: Eliminate 'apache' targets. + + * configure.in: Eliminate redundant tests. Reorganize. + + * Makefile.in: Eliminate last reference to LIBGCC1_TEST. + + * config-ml.in: Eliminate references to Cygnus configure. + + * Makefile.in: Eliminate references to building emacs. + +2002-07-01 Denis Chertykov + + * configure.in: Add support for ip2k. + +2002-06-24 Ben Elliston + + * configure.in (host_tools): Remove cgen. + + * Makefile.in (all-cgen): Remove; runs from its source directory. + (check-cgen, install-cgen, clean-cgen): Likewise. + (all-opcodes): No not depend on all-cgen. + (all-sim): Likewise. + +2002-06-22 Nathanael Nerode + + * configure.in: Fix AIX configury bug. + +2002-06-19 Nathanael Nerode + + * configure.in: Replace ${topsrcdir} with ${srcdir}. + + * configure.in: Move definition of libstdcxx_flags right above + usage, rather than way earlier. + + * configure.in: Pull definition of is_cross_compiler earlier. + + * configure.in: Rearrange a little. + + * configure.in: Remove references to librx. + * Makefile.in: Remove references to librx. + +2002-06-19 Nathanael Nerode + + * configure.in: Eliminate ${gasdir} variable. + +2002-06-18 Dave Brolley + + * configure.in: Add support for frv. + * config.sub: Add support for frv. + +2002-06-12 Kaveh R. Ghazi + + * Makefile.in (CFLAGS_FOR_TARGET): Add -O2. + +2002-06-08 Jason Thorpe + + * configure.in (vax-*-netbsd*): Re-enable gas. + +2002-05-31 Nathanael Nerode + + * Makefile.in: Replace HOST_PREFIX, HOST_PREFIX_1 with BUILD_PREFIX, + BUILD_PREFIX_1, to correct nomenclature. + * configure: Likewise. + + * Makefile.in: Eliminate version-specific references to tcl8.1, tk8.1. + * configure.in: Eliminate version-specific references to tcl8.1, tk8.1. + +2002-05-31 Olaf Hering + + * config-ml.in: Propogate DESTDIR also. + +2002-05-29 Jason Thorpe + + * configure.in (vax-*-netbsd*): Don't build gas for this + platform. + +2002-05-28 Marek Michalkiewicz + + * configure.in (noconfigdirs): Don't compile libiberty, libstdcxx + and libgcj for AVR. + +2002-05-28 Nick Clifton + + * config.sub: Add DLX target. + +2002-05-22 Jason Thorpe + + * config.guess: Update to 2002-05-22 version. + * config.sub: Likewise. + +2002-05-16 Rainer Orth + + * Makefile.in: Allow for PWDCMD to override hardcoded pwd. + * config-ml.in: Likewise. + * configure: Likewise. + * configure.in: Likewise. + +2002-05-13 Nathanael Nerode + + * configure.in: Simplify makefile fragment collection. + + * configure.in: Remove code to build emacs. + + * configure.in : Remove --srcdir argument from targargs and buildargs + (it's always overridden in the Makefile anyway). Rearrange a bit. + + * configure: Move some logic to configure.in. + * configure.in: Move some logic from configure. + +2002-05-07 Jeff Johnston + + * COPYING.LIBGLOSS: New file. + +2002-05-07 Federico G. Schwindt + + * Makefile.in: Honour DESTDIR. + +2002-05-05 Alexandre Oliva + + * configure.in (noconfigdirs): Don't disable libgcj on + sparc64-*-solaris* and sparcv9-*-solaris*. + +2002-05-03 Alexandre Oliva + + * configure.in: Revert 2002-04-18's patch; fixed in libjava. + +2002-05-03 Thomas Fitzsimmons + + * configure.in (FLAGS_FOR_TARGET): Do not add + -B$$r/$(TARGET_SUBDIR)/newlib/ when compiling newlib natively + on i[3456]86-*-linux*. + +2002-05-01 Thomas Fitzsimmons + + * configure.in (noconfigdirs): Replace [ ] with test. + + * configure.in (noconfigdirs): Do not add target-newlib if + target == i[3456]86-*-linux*, and host == target. + +2002-04-29 Mark Mitchell + + * config.guess: Updated to 2002-04-26's version. + * config.sub: Updated to 2002-04-26's version. + +2002-04-29 Nathanael Nerode + + * configure.in: delete reference to absent file + + * configure.in: replace '[' with 'test' + + * configure.in: Eliminate references to gash. + * Makefile.in: Eliminate references to gash. + + * configure.in: remove useless references to 'pic' makefile fragments. + + * configure.in: (*-*-windows*) Finish removing. + + * configure.in: Eliminate redundant test for libgui. + +2002-04-26 Joel Sherrill + + * configure.in (h8300*-*-rtems*): Disable libf2c and libgcj. + (sparc-*-elf*, sparc64-*-elf*): Disable libgcj. + +2002-04-19 Nathanael Nerode + + * configure.in: remove references to dead files + +2002-04-18 Tom Tromey + + * configure.in: Disallow configuring libgcj when it is already + installed and we're using Solaris 2.8 linker. Do enable libgcj on + Solaris 2.8 by default. For PR libgcj/6158. + +2002-04-17 Nathanael Nerode + + * configure.in: Move default CC setting out of config/mh-* fragments + directly into here. + +2002-04-17 Nathanael Nerode + + * configure.in: don't even try to configure or make a subdirectory + if there's no configure script for it. + +2002-04-15 Mark Mitchell + + * MAINTAINERS: Remove chill maintainers. + * Makefile.in (CHILLFLAGS): Remove. + (CHILL_LIB): Remove. + (TARGET_CONFIGDIRS): Remove libchill. + (CHILL_FOR_TARGET): Remove. + (BASE_FLAGS_TO_PASS): Don't pass CHILLFLAGS, CHILL_FOR_TARGET, or + CHILL_LIB. + (CONFIGURE_TARGET_MODULES): Remove configure-target-libchill. + (CHECK_TARGET_MODULES): Likewise. + (INSTALL_TARGET_MODULES): Likewise. + (CLEAN_TARGET_MODULES): Likewise. + (configure-target-libchill): Remove. + (all-target-libchill): Remove. + * configure.in (target_libs): Remove target-libchill. + Do not compute CHILL_FOR_TARGET. + * libchill: Remove directory. + +2002-04-15 DJ Delorie + + * Makefile.in, configure.in, configure: Sync with gcc, entries + follow... + +2002-04-08 Tom Tromey + + * configure.in: Add FLAGS_FOR_TARGET to GCJ_FOR_TARGET. + Fixes PR libgcj/6068. + +2002-03-30 Krister Walfridsson + + * configure.in (i*86-*-netbsdelf*): Don't disable libgcj. + +2002-03-27 Rainer Orth + + * configure.in (alpha*-dec-osf*): Enable libgcj. + +2002-03-24 Nick Clifton + + Fix for: PR bootstrap/3591, target/5676 + * configure.in (mcore-pe): Disable the configuration of + libstdc++-v3 since exceptions are not supported. + +2002-03-20 Anthony Green + + * configure.in: Enable libgcj for xscale-elf target. + +2002-02-28 Alexandre Oliva + + * configure.in (libstdcxx_flags): Don't add libstdc++-v3 flags for + libjava. + (CXX_FOR_TARGET): Explain why -shared-libgcc here. + +2002-02-22 Alexandre Oliva + + * configure.in (CXX_FOR_TARGET): Add -shared-libgcc for + libstdc++-v3 and libjava. + +2002-02-11 Adam Megacz + + * gcc/Makefile.in: Removed libstdc++-v3 dependancy for libjava and + boehm-gc + +2002-02-09 Alexandre Oliva + + * config.guess: Updated to 2002-01-30's version. + * config.sub: Updated to 2002-02-01's version. + Contribute sh64-elf. + 2000-12-01 Alexandre Oliva + * configure.in: Added sh64-*-*. + +2002-01-17 H.J. Lu + + * Makefile.in (all-fastjar): Also depend on all-libiberty. + (all-target-fastjar): Also depend on all-target-libiberty. + +Wed Dec 5 07:33:45 2001 Douglas B. Rupp + + * configure, configure.in: Use temp file for long sed commands. + +2001-11-14 Hans-Peter Nilsson + + * configure.in (noconfigdirs) [h8300*-*-*, h8500-*-*]: Disable + libf2c. + +2001-11-03 Hans-Peter Nilsson + + * configure.in (noconfigdirs) [mmix-*-*]: Disable libgcj. + +2001-10-11 Hans-Peter Nilsson + + * configure.in (noconfigdirs) [cris-*-*]: Disable libgcj. + +2001-10-02 Joseph S. Myers + + * configure: Handle temporary files securely using mkdir. + +2001-09-26 Will Cohen + + * configure.in (*-*-linux*): Disable configuration of target-newlib + and target-libgloss. + +2001-09-26 Alexandre Oliva + + * Makefile.in (EXTRA_TARGET_FLAGS): Pass RANLIB_FOR_TARGET for + RANLIB. + +2001-08-11 Graham Stott + + * Makefile.in (check-c++): Add missing semicolon. + +2001-07-25 Andrew Haley + + * configure.in (sh-*-linux*): New. + +2001-07-12 Stephane Carrez + + * configure.in (noconfigdirs): Don't compile libiberty, libstdcxx + and libgcj on m68hc11/m68hc12. + +2001-06-27 H.J. Lu (hjl@gnu.org) + + * Makefile (CFLAGS_FOR_BUILD): New. + (EXTRA_GCC_FLAGS): Add CFLAGS_FOR_BUILD. + +2001-06-01 Hans-Peter Nilsson + + * configure.in (libstdcxx_flags): Do not try to execute + libstdc++-v3/testsuite_flags until it exists. + +2001-05-18 Benjamin Kosnik + + * configure.in (libstdcxx_flags): Remove reference to libstdc++.INC. + +2001-05-09 Jeffrey Oldham + + * ltcf-cxx.sh: Add -nostdlib to IRIX 6 archive_cmds. + +Mon Apr 23 09:15:03 2001 Anthony Green + + * configure.in: Move *-chorusos target case to the proper switch. + Disable libgcj. + +2001-04-13 Franz Sirl + + * Makefile.in (STAGE1_CFLAGS): Pass down. + +2001-04-13 Alan Modra + + * config.guess: Add hppa64-linux support. Note for next import that + this is already in the master file. + * configure.in: Likewise. Accept `parisc' alias for `hppa'. + +2001-03-22 Colin Howell + + * Makefile.in (DO_X): Do not backslash single-quotes in + backquotes (two places). + +2001-03-18 Laurynas Biveinis + + * Makefile.in (DO_X): Quote nested quotes. + +2001-03-15 Laurynas Biveinis + + * Makefile.in (DO_X): Use double quotes for quoting + "RANLIB=$${RANLIB}". + +2001-03-09 Nicola Pero + + * configure.in: Only use `lang_requires' for languages athat are + actually enabled. + +2001-03-07 Tom Tromey + + * configure.in: Allow config-lang.in to set `lang_requires' to list + of other required languages. + +2001-03-06 Laurynas Biveinis + + * Makefile.in: Remove RANLIB definition. Use RANLIB + in RANLIB_FOR_TARGET, EXTRA_HOST_FLAGS, EXTRA_TARGET_FLAGS, + EXTRA_GCC_FLAGS, $(DO_X) targets only when the RANLIB is set. + +2001-02-28 Benjamin Kosnik + Alexandre Oliva + + * Makefile.in (check-c++): Use tabs, not spaces. + +2001-02-19 Benjamin Kosnik + + * Makefile.in (check-c++): New rule. + + * configure.in (target_libs): Remove libg++. + (noconfigdirs): Remove libg++. + (noconfigdirs): Same. + (noconfigdirs): Same. + (noconfigdirs): Same. + + * config-ml.in: Remove libg++ references. + + * Makefile.in (TARGET_CONFIGDIRS): Remove libio, libstdc++, libg++. + (ALL_TARGET_MODULES): Same. + (configure-target-libg++): Remove. + (all-target-libg++): Remove. + (configure-target-libio): Remove. + (all-target-libio): Remove. + (check-target-libio): Remove. + (.PHONY): Remove. + (libg++.tar.bz2): Remove. + (all-target-cygmon): Remove libio. + (all-target-libstdc++): Remove. + (configure-target-libstdc++): Remove. + (TARGET_LIB_PATH): Remove libstdc++. + (ALL_GCC_CXX): Remove libstdc++. + (all-target-gperf): Correct. + +2001-02-15 Anthony Green + + * configure: Introduce GCJ_FOR_TARGET. + * configure.in: Ditto. + * Makefile.in: Ditto. + +2001-02-08 Chandrakala Chavva + + * configure.in: for *-chorusos, don't config target-newlib and + target-libgloss. + +2001-02-04 Mark Mitchell + + Remove V2 C++ library. + * configure.in: Remove --enable-libstdcxx_v3 support. + +2001-01-27 Richard Henderson + + * configure.in (target_makefile_frag) [alpha*-*]: Use mt-alphaieee. + +2001-01-26 Tom Tromey + + * configure.in: Allow libgcj to be built on Sparc Solaris. + +2001-01-23 Bryce McKinlay + + * configure.in: Enable libgcj on several additional platforms. + +2001-01-22 Bryce McKinlay + + * configure.in: Enable libgcj for linux targets. + +2001-01-09 Mike Stump + + * Makefile.in (CONFIGURE_TARGET_MODULES): Pass back configuration + failures of subdirectories. + +2001-01-02 Laurynas Biveinis + + * configure: handle DOS-style absolute paths. + +2001-01-02 Laurynas Biveinis + + * configure.in: remove supported directories from $noconfigdirs for DJGPP. + +2000-12-18 Benjamin Kosnik + + * Makefile.in (BASE_FLAGS_TO_PASS): Alphabetize. + (libstdcxx_incdir): Pass down. + * config.if: Remove expired bits for cxx_interface, add stub. + (libstdcxx_incdir): Add variable for g++ include directory. + * configure.in (gxx_include_dir): Use it. + +2000-12-15 Andreas Jaeger + + * configure.in: Handle lang_dirs. + +2000-12-13 Anthony Green + + * configure.in: Disable libgcj for any target not specifically + listed. Disable libgcj for x86 and Alpha Linux until compatible + with g++ abi. + +2000-12-13 Mike Stump + + * Makefile.in (local-distclean): Also remove fastjar. + +2000-12-10 Anthony Green + + * configure.in: Define libgcj. Disable libgcj target libraries for + most targets. + +2000-12-09 Alexandre Petit-Bianco + + * configure.in (target_libs): Revert 2000-12-08 patch. + (noconfigdirs): Added target-libjava. + +2000-12-09 Laurynas Biveinis + + * Makefile.in: handle DOS-style absolute paths. + +2000-12-08 Alexandre Petit-Bianco + + * Makefile.in (TARGET_CONFIGDIRS): Wrong place. Removed note about + libjava. + * configure.in (target_libs): Removed `target-libjava'. + +2000-12-08 Alexandre Petit-Bianco + + * Makefile.in (TARGET_CONFIGDIRS): Added note about libjava. + (ALL_MODULES): Added fastjar. + (NATIVE_CHECK_MODULES, INSTALL_MODULES, CLEAN_MODULES): Likewise. + (all-target-libjava): all-fastjar replaces all-zip. + (all-fastjar): Added. + (configure-target-fastjar, all-target-fastjar): Likewise. + * configure.in (host_tools): Added fastjar. + +2000-12-07 Mike Stump + + * Makefile.in (local-distclean): Remove leftover built files. + +2000-11-16 Fred Fish + + * configure.in (enable_libstdcxx_v3): Fix typo, + libstd++ -> libstdc++. + +2000-11-13 Joseph S. Myers + + * configure: Provide the original toplevel configure arguments + (including $0) to subprocesses in the environment rather than + through gcc/configargs.h. + +2000-11-12 Mark Mitchell + + * configure: Turn on libstdc++ V3 by default. + +2000-10-16 Michael Meissner + + * configure (gcc/configargs.h): Only create if there is a build GCC + directory created. + +2000-10-05 Phil Edwards + + * configure: Save configure arguments to gcc/configargs.h. + +2000-10-04 Andris Pavenis + + * Makefile.in (bootstrap): avoid recursion if subdir missing + (cross): ditto + (do-proto-toplev): ditto + +Wed Sep 13 11:11:29 2000 Jeffrey A Law (law@cygnus.com) + + * configure.in: Do not build byacc for hppa64. Provide paths to the + X11 libraries for hppa64. + +2000-09-02 Anthony Green + + * Makefile.in (all-gcc): Depend on all-zlib. + (CLEAN_MODULES): Add clean-zlib. + (ALL_MODULES): Add all-zlib. + * configure.in (host_libs): Add zlib. + +2000-08-25 Alexandre Oliva + + * configure.in (FLAGS_FOR_TARGET): Use $target_configdirs and + $targargs to tell whether newlib is going to be built. + + * configure.in [disable-libstdcxx-v3] (libstdcxx_flags): Search + $$r/TARGET_SUBDIR/libio for _G_config.h. + +2000-08-14 Zack Weinberg + + * configure.in (libstdcxx_flags): Remove -isystem $$s/libio/stdio. + + * configure: Make enable_threads and enable_shared defaults + explicit. Substitute enable_threads into generated Makefiles. + * configure.in: Accept *-*-linux* not just *-*-linux-gnu*. + * libtool.m4: Accept *-*-linux* not just *-*-linux-gnu*. + +2000-08-02 Manfred Hollstein + + * configure.in: Re-enable all references to libg++ and librx. + +2002-04-09 Loren James Rittle + + * configure.in: Add *-*-freebsd* configurations. + +2002-04-07 Andrew Cagney + + * Makefile.in (do-tar-bz2): Delete rule. Replace with ... + (do-tar, do-bz2): New rules. + (taz): Update. Replace do-tar-bz2 with do-tar and do-bz2. + (gdb-tar): New rule. + (gdb-taz): Rewrite. Use gdb-tar and do-bz2. + (insight_dejagnu.tar): New rule. + (insight.tar): New rule. + (gdb+dejagnu.tar): New rule. + (gdb.tar): New rule. + +2002-04-07 Andrew Cagney + + * MAINTAINERS: Update dejagnu/ + +2002-03-16 Alexandre Oliva + + * ltmain.sh (relink_command): Fix typo in previous change. + +2002-03-15 Alexandre Oliva + + * ltmain.sh (taglist): Initialized. Don't let `CC' tag out of it. + (relink_command): Added --tag flags. + (mode=install): If relinking fails; error out. + +2002-03-12 Richard Henderson + + * Makefile.in (NOTPARALLEL): New. Use it instead of explicit + .NOTPARALLEL tag. + (do-check): Rename from check. + (check): Allow parallel check. + +2002-03-11 Richard Henderson + + * Makefile.in (.NOTPARALLEL): Add fake tag. + +2002-03-07 H.J. Lu (hjl@gnu.org) + + * configure.in: Enable gprof for mips*-*-linux*. + +2002-02-28 Alexandre Oliva + + * configure.in (libstdcxx_flags): Don't add libstdc++-v3 flags for + libjava. + (CXX_FOR_TARGET): Add -shared-libgcc for libstdc++-v3 and libjava. + +2002-02-24 Andrew Cagney + + * texinfo/texinfo.tex: Update to version 2002-02-14.08. + +2002-02-23 Daniel Jacobowitz + + * config.guess: Import from master sources, rev 1.232. + * config.sub: Import from master sources, rev 1.246. + +2002-02-23 Alexandre Oliva + + * Makefile.in (MAKEINFO): Don't assume makeinfo will be built just + because its Makefile is there; test for the executable instead. + +2002-02-09 Alexandre Oliva + + Contribute sh64-elf. + 2000-12-01 Alexandre Oliva + * configure.in: Added sh64-*-*. + +2002-02-04 Jeff Johnston + + * COPYING.NEWLIB: Remove advertising clause from + Berkeley and Red Hat licenses. + +2002-02-01 Mo DeJong + + * Makefile.in: Add all-tix to deps for all-snavigator + so that tix is built when building snavigator. + +2002-02-01 Ben Elliston + + * config.guess: Import from master sources, rev 1.229. + * config.sub: Import from master sources, rev 1.240. + +2002-01-27 Daniel Jacobowitz + + From Steve Ellcey : + * libtool.m4 (HPUX_IA64_MODE): Set to 32 or 64 based on ABI. + (lt_cv_deplibs_check_method, lt_cv_file_magic_cmd, + lt_cv_file_magic_test_file): Set to appropriate values for HP-UX + IA64. + * ltcf-c.sh (archive_cmds, hardcode_*): Ditto. + * ltconfig (shlibpath_*, dynamic_linker, library_names_spec, + soname_spec, sys_lib_search_path_spec): Ditto. + +2002-01-26 Jason Thorpe + + * configure.in (*-*-netbsd*): New. Skip target-newlib, + target-libiberty, and target-libgloss. Skip Java-related + libraries if not supported for NetBSD on target CPU. + +2002-01-23 Nick Clifton + + * configure.in: Import StrongARM and XScale target_configdirs from + FSF GCC version. + +2002-01-16 H.J. Lu (hjl@gnu.org) + + * config.guess: Import from master sources, rev 1.225. + * config.sub: Import from master sources, rev 1.238. + + * MAINTAINERS: Updated notes on config.guess and config.sub. + +2002-01-11 Steve Ellcey + + * configure.in (ia64*-*-hpux*): New target for IA64 HP-UX, + ld and gdb are not supported. + +2002-01-07 Jeff Johnston + + * Change reference to Cygnus Solutions to be Red Hat. + +2002-01-07 Jeff Johnston + + * COPYING.NEWLIB: Update generic copyright date. + +2002-01-07 Mark Salter + + * configure.in: Remove target-bsp and target-cygmon from arm builds. + Allow target-libgloss to be built for arm, strongarm, and xscale. + +2002-01-03 Ben Elliston + + * MAINTAINERS: Update URL for config.* scripts. + +2001-12-18 Alan Modra + + * config.sub: Import latest version. + * config.guess: Likewise. + +2001-12-13 Thomas Fitzsimmons + + * configure.in (FLAGS_FOR_TARGET): Remove -nostdinc and -isystem + options for i[3456]86-pc-linux* native builds. + +2001-12-05 Laurent Guerby + + * MAINTAINERS: gcc adopts symlink-tree, refer more to + libiberty. + + Import this patch from gcc: + + 2000-12-09 Laurynas Biveinis + + * symlink-tree: handle DOS-style absolute paths. + +2001-11-28 DJ Delorie + Zack Weinberg + + When build != host, create libiberty for the build machine. + + * Makefile.in (TARGET_CONFIGARGS, BUILD_CONFIGARGS): Replace + CONFIG_ARGUMENTS. + (ALL_BUILD_MODULES_LIST, BUILD_CONFIGDIRS, BUILD_SUBDIR): + New variables. + (ALL_BUILD_MODULES, CONFIGURE_BUILD_MODULES): New variables + and rules. + (all.normal): Depend on ALL_BUILD_MODULES. + (CONFIGURE_TARGET_MODULES rule): Use TARGET_CONFIGARGS. + (all-build-libiberty): Depend on configure-build-libiberty. + + * configure: Calculate and substitute proper value for + ALL_BUILD_MODULES. + * configure.in: Create the build subdirectory. + Calculate and substitute TARGET_CONFIGARGS (formerly + CONFIG_ARGUMENTS); also BUILD_SUBDIR and BUILD_CONFIGARGS (new). + +2001-11-26 Geoffrey Keating + + * config.sub: Update to version 1.232 on subversion. + +2001-11-20 Nick Clifton + + * Makefile.in (do-proto-toplev): Use msgfmt to generate .gmo + files from .po files for a distribution. + +2001-11-19 Hans-Peter Nilsson + + * COPYING.NEWLIB: Mention preserved notice in specific parts. + +2001-11-13 Jeff Holcomb + + Merged from net gcc: + 2001-07-30 Jeff Sturm + * ltcf-c.sh: Use $objext, not $ac_objext. + 2001-07-27 Mark Kettenis + * ltcf-cxx.sh: Add support for GNU. + 2001-07-22 Timothy Wall + * ltcf-c.sh: Don't disable shared libraries for AIX5/IA64. Preserve + default settings if using GNU tools with that configuration. + * ltcf-cxx.sh: Ditto. + * ltcf-gcj.sh: Ditto. + 2001-07-21 Michael Chastain + * ltconfig: Set max_cmd_len to a maximum of 512Kb, as it seems some + HPUX 11.0 systems have trouble with 1MB. Mark as gcc-local. + * ltmain.sh: Mark as gcc-local. + +2001-11-13 Jeff Holcomb + + * Makefile.in (all-bison): Revert 2001-10-24. + Don't depend on texinfo. + +2001-11-12 Hans-Peter Nilsson + + * COPYING.NEWLIB: Add BSD-style license/copyright blurb for my work. + +2001-11-08 Phil Edwards + + * configure.in (--enable-languages): Be more permissive about + syntax. Check for empty lists better. Warn about $LANGUAGES. + +2001-11-06 Hans-Peter Nilsson + + * Makefile.in (MAKEINFO): Use "missing" for makeinfo older than 4.0. + +2001-10-24 Jeff Holcomb + + Makefile.in (all-bison): Don't depend on texinfo. + +2001-10-03 Alan Modra + + * gettext.m4: Test po/POTFILES.in exists before trying to read. + +2001-09-29 Alexandre Oliva + + * Makefile.in (configure-target-gperf): Depend on $(ALL_GCC_CXX). + +2001-09-28 Hans-Peter Nilsson + + * config.sub, config.guess: Import latest from subversions. + +2001-09-21 Alexandre Oliva + + * Makefile.in (AS_FOR_TARGET, LD_FOR_TARGET, + DLLTOOL_FOR_TARGET, WINDRES_FOR_TARGET, AR_FOR_TARGET, + RANLIB_FOR_TARGET, NM_FOR_TARGET): Don't use double quotes to + avoid quotes nesting problems. + (NATIVE_CHECK_MODULES): Ditto, just for consistency. + (DO_X): Export only variables that are set. + +2001-09-19 Ben Elliston + + * configure.in (sparc-sun-solaris2*): Don't use /usr/bin/which on + Solaris when testing for the /usr/ucb/cc compiler; it has incorrect + semantics. Use the shell built-in "type" command instead. + +2001-09-15 Thiemo Seufer + + * config.sub: Reverted the earlier change, this version is not the + master file. + +2001-09-14 Thiemo Seufer + + * config.sub: Change machine triplets from mipsel*-* to mips*el-*. + Add support for mips64. + +2001-09-03 Jeff Holcomb + + * configure.in: Enable libstdc++-v3 for h8300 targets. + +2001-08-30 Eric Christopher + Jason Eckhardt + + * config.sub: Add support for mipsisa32. + +2001-08-30 Eric Christopher + + * config.sub, config.guess: Import latest from subversions. + +2001-08-20 Alan Modra + + * config.sub, config.guess: Import latest from subversions. + +2001-07-26 DJ Delorie + + * MAINTAINERS: Clarify libiberty merge rules and procedures. + +2001-06-19 Alan Modra + + * Makefile.in: Revert 2001-06-17. + (VER): If AM_INIT_AUTOMAKE uses BFD_VERSION, get version from bfd/. + +2001-06-17 H.J. Lu + + * Makefile.in (gas.tar.bz2): Pass TOOL=bfd PACKAGE=gas to make. + (gas+binutils.tar.bz2): Likewise. + (binutils.tar.bz2): Pass TOOL=bfd PACKAGE=binutils to make. + +Fri Jun 8 11:14:02 2001 Andrew Cagney + + * Makefile.in (VER): When present, extract the version number from + the file version.in. + +2001-06-08 Alexandre Oliva , Jeff Sturm + + * Makefile.in (AS_FOR_TARGET, LD_FOR_TARGET, NM_FOR_TARGET): If + gcc/xgcc is built, use -print-prog-name to find out the program + name to use. + +2001-06-04 Mark Mitchell + + * ltcf-c.sh (archive_cmds, archive_expsym_cmds) [solaris, + with_gcc]: Use `gcc -shared' to build a shared library. + +2001-06-04 John David Anglin + + * ltcf-c.sh (archive_cmd) [hpux, with_gcc]: Use gcc to link shared + archives. + +2001-05-28 Simon Patarin + + * ltcf-cxx.sh (osf3/osf4/osf5): Support creation of C++ shared + libraries when using g++ with native linker. + +2001-05-28 Alexandre Oliva + + * ltconfig, ltmain.sh: Upgrade to libtool 1.4a 1.641.2.256. + +2001-05-24 Tom Rix + + * configure.in : enable ld for aix + +2001-05-22 Alexandre Oliva + + * ltcf-cxx.sh (allow_undefined_flag, no_undefined_flag) + [aix4*|aix5*]: Prepend blank. + +2001-05-20 Alexandre Oliva + + * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh, + ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.254. Rebuilt a number + of subdir/configure scripts to use the new libtool.m4. + +2001-05-14 H.J. Lu + + * config.if (libc_interface): Set to -libc6.2- for cross + compiling to Linux/glibc 2.2. + +2001-05-03 Alexandre Oliva + + * configure.in (noconfigdirs) [*-cygwin*, *-mingw*, *-beos]: Disable + libgcj. + +2001-04-26 Alexandre Oliva + + * configure.in (noconfigdirs): Don't reset it from scratch in the + target case; only append to it. + +2001-04-26 Alexandre Oliva + + * configure.in (noconfigdirs) [hppa*-*-*, mips*-*-irix6*, + sparc-*-solaris2.8]: Disable ${libgcj}. + +2001-04-25 Alexandre Oliva + + * configure.in (libgcj_saved): Copy from $libgcj. + (libgcj): Zero out if --enable-libgcj; add to noconfigdirs is + --disable-libgcj. + +2001-04-20 Alexandre Oliva + + * ltconfig, ltmain.sh, ltcf-cxx.sh: Upgraded to libtool 1.4a + 1.641.2.228. + +2001-04-12 Alexandre Oliva + + * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh, + ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.226. + +2001-04-01 Alexandre Oliva + + * Makefile.in (CXX_FOR_TARGET_FOR_RECURSIVE_MAKE, RECURSE_FLAGS): + New macros. + (bootstrap, cross): Use RECURSE_FLAGS. + * configure.in: Subst CXX_FOR_TARGET_FOR_RECURSIVE_MAKE. + +2001-03-27 Alexandre Oliva + + * configure.in (CXX_FOR_TARGET): Use xgcc for libstdc++-v3. + +2001-03-23 Nick Clifton + + * README-maintainer-mode: Add note about inability to use "make + distclean" in maintainer mode. + +2001-03-22 Alexandre Oliva + + Re-installed: + 2001-01-02 Laurynas Biveinis + * ltcf-c.sh: Clear ac_cv_prog_cc_pic for DJGPP. Do not add + '-DPIC' to ac_cv_prog_cc_pic for DJGPP. + * ltcf-cxx.sh: Likewise. + * ltcf-gcj.sh: Likewise. + +2001-03-22 Philip Blundell + + * config.sub, config.guess: Import latest from subversions. + +2001-03-22 Alexandre Oliva + + * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh, + ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.198. + +2001-03-20 Michael Chastain + + * Makefile.in: all-m4 depends on all-texinfo. + +2001-03-08 Alexandre Oliva + + * Makefile.in (ALL_GCC, ALL_GCC_C, ALL_GCC_CXX): Set before use. + +2001-02-22 Jeff Johnston + + * COPYING.NEWLIB: Remove DJ Delorie's address because it is no + longer valid. + +2001-02-16 Nick Clifton + + * configure.in (noconfigdirs): Allow configuration of texinfo + for Cygwin hosts. + +2001-02-09 Martin Schwidefsky + + * config.guess: Add linux target for S/390. + * config.sub: Likewise. + * configure.in: Likewise. + +2001-02-06 Ben Elliston + + * configure: Output host type to stdout, not stderr. + +2001-02-04 Michael Sokolov + + * config.guess: Import from subversions.gnu.org (revision 1.181). + * config.sub: Import from subversions.gnu.org (revision 1.199). + +2001-01-30 Alan Modra + + * config.guess: Handle hppa64-linux systems. + +2001-01-27 Michael Sokolov + + * ltcf-cxx.sh (ac_cv_prog_cc_pic_works, ac_cv_prog_cc_static_works): + Don't unset, it's non-portable and no longer necessary, set to empty + instead. + +2001-01-27 Michael Sokolov , Alexandre Oliva + + * ltconfig: Shell portability fix for the tagname validity check. + +2001-01-27 Michael Sokolov + + * ltcf-cxx.sh: Use parentheses around eval $ac_compile. + +2001-01-27 Alexandre Oliva + + * ltcf-c.sh (ld_shlibs) [aix5*]: Disable on unknown CPU types. + * ltcf-cxx.sh, ltcf-gcj.sh: Likewise. + +2001-01-24 Alexandre Oliva + + * ltmain.sh (TAG disable-shared, TAG disable-static): Make sure we + keep at least one of build_libtool_libs or build_old_libs set to + yes. + +2001-01-24 Alexandre Oliva + + * ltcf-gcj.sh (lt_simple_link_test_code): Remove stray `(0)'. + * libtool.m4 (_AC_LIBTOOL_GCJ): Pass $CPPFLAGS on. + +2000-11-07 Philip Blundell + + * Makefile.in (ETC_SUPPORT): Also add configbuild.* and configdev.*. + +2000-11-03 Philip Blundell + + * Makefile.in (ETC_SUPPORT): Add configure.texi and associated info + files. + +2001-01-15 Jeff Johnston + + * COPYING.NEWLIB: Put into source repository. + +2001-01-15 Ben Elliston + + * configure.in (host_tools): Add sid. + Always configure cgen. + * Makefile.in (all-sid): New target. + (check-sid, clean-sid, install-sid): Likewise. + +2001-01-07 Andreas Jaeger + + * config.sub, config.guess: Update from subversions. + +2000-12-12 Alexandre Oliva + + * configure.in: Disable language-specific target libraries for + languages that aren't enabled. + +2000-11-24 Nick Clifton + + * configure.in (xscale-elf): Add target. + (xscale-coff): Add target. + (c4x, c5x, tic54x): Move after ARM targets. + +2000-11-23 Alexandre Oliva + + * ltcf-gcj.sh: Added file, required by 2000-11-18 merge. + +2000-11-20 Ian Lance Taylor + + * ltcf-cxx.sh: Added file, required by 2000-11-18 merge. + +2000-11-18 Alexandre Oliva + + * Makefile.in: Merge with GCC and libgcj. + (ALL_GCC_C, ALL_GCC_CXX): New macros. Use them as dependencies of + configure-target- when their configure scripts need the C + or C++ library to have already been built to work properly. + (do_proto_toplev): Set them to an empty string. + +2000-11-18 Alexandre Oliva + + * Makefile.in (HOST_LIB_PATH, TARGET_LIB_PATH): New macros. + (REALLY_SET_LIB_PATH): Use them. + +2000-11-06 Christopher Faylor + + * config.sub: Add support for Sun Chorus + +2000-11-02 Per Lundberg + + * config.sub: Add support for the *-storm-chaos OS. + +2000-10-30 Stephane Carrez + + * configure.in (noconfigdirs): Don't compile some + of the libraries for 68HC11 & 68hc12 targets. + +2000-09-30 Alexandre Oliva + + * ltconfig, ltmain.sh, libtool.m4: Updated from libtool + multi-language branch, to work around Solaris' /bin/sh bug. Rebuilt + all affected `configure' scripts. + +2000-09-25 Alexandre Oliva + + * Makefile.in (DEVO_SUPPORT): Added gettext.m4, libtool.m4 and + ltcf-c.sh. + +2000-09-12 Philip Blundell + + * config.sub, config.guess: Update from subversions. + +2000-09-06 Alexandre Oliva + + * Makefile.in (all-zlib): Added dummy target. + + * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh: Updated from libtool + multi-language branch. + +2000-09-05 Alexandre Oliva + + * Makefile.in (all-bootstrap): Added all-texinfo and all-zlib. + (bootstrap*): Depend on all-bootstrap. + +2000-09-02 Alexandre Oliva , DJ Delorie + + * configure.in (FLAGS_FOR_TARGET): Use -nostdinc even for Canadian + crosses, but add gcc/include to the header search path for them. + +2000-08-31 Alexandre Oliva + + * ltconfig, ltmain.sh: Updated from libtool multi-language branch. + * libtool.m4, ltcf-c.sh: Copied from libtool multi-language branch. + * gettext.m4: New file, extracted from aclocal.m4. + +2000-08-22 Alexandre Oliva + + * config-ml.in (CC, CXX): Avoid trailing whitespace. + (LD_LIBRARY_PATH, SHLIB_PATH): Adjust for multilibs and export to + sub-configures. + +2000-08-20 Doug Evans + + * Makefile.in (ALL_MODULES): Add all-cgen. + (CROSS_CHECK_MODULES,INSTALL_MODULES,CLEAN_MODULES): Similarily. + (all-cgen): New target. + (all-opcodes,all-sim): Depend on all-cgen. + * configure.in (host_tools): Add cgen. + Only configure cgen if --enable-cgen-maint. + +2000-08-17 Alexandre Oliva + + * config-ml.in (CC, CXX): Don't introduce a leading space. + +2000-08-16 Alexandre Oliva + + * configure.in (libstdcxx_flags): Use + libstdc++-v3/src/libstdc++.INC. + +2000-08-15 Alexandre Oliva + + * configure.in (libstdcxx_flags): Use libstdc++-v3/src/INCLUDES. + +2000-08-11 Jason Merrill + + * configure.in (CC_FOR_TARGET, CHILL_FOR_TARGET, + CXX_FOR_TARGET): Add -B$$r/gcc/ here. + (FLAGS_FOR_TARGET): Not here. + (CHILL_FOR_TARGET, CXX_FOR_TARGET): Don't check the list of languages. + +2000-08-07 DJ Delorie + + * configure.in (FLAGS_FOR_TARGET): invert test for xgcc, should mean + "if we're also building gcc, and it's a gcc that will run on the + build machine, we want to use its includes instead of the system's + default includes". + +2000-08-03 Alexandre Oliva + + * configure.in (libstdcxx_flags): Don't use `"'. + + * config-ml.in: Adjust multilib search paths to the + appropriate multilib tree. + +2000-08-02 Alexandre Oliva + + * configure.in (CHILL_FOR_TARGET, CXX_FOR_TARGET): Convert blanks to + commas in $LANGUAGES. + +2000-08-01 Alexandre Oliva + + * configure.in (qCXX_FOR_TARGET): Use echo instead of expr. + +2000-07-31 Alexandre Oliva + + * configure.in (qCXX_FOR_TARGET): Quote `&' characters in + CXX_FOR_TARGET for sed. + +2000-07-30 Alexandre Oliva + + * configure.in (CC_FOR_TARGET, CHILL_FOR_TARGET, CXX_FOR_TARGET): + Do not override if already set in the environment or in configure. + Don't duplicate $(FLAGS_FOR_TARGET) if it already appears in them. + (FLAGS_FOR_TARGET): Don't use host directories on Canadian crosses. + +2000-07-27 Alexandre Oliva + + * Makefile.in (FLAGS_FOR_TARGET): New macro. + (GCC_FOR_TARGET): Use it. + (CC_FOR_TARGET, CXX_FOR_TARGET, CHILL_FOR_TARGET): Now defined... + * configure.in: ... here. + (FLAGS_FOR_TARGET): Define. Add ld build dir to -L path. + (libstdcxx_flags): Define and append to CXX_FOR_TARGET. + +2000-07-24 Alexandre Oliva + + * Makefile.in (configure-target-libf2c): Depend on $(ALL_GCC). + (configure-target-libchill, configure-target-libobjc): Likewise. + + * configure.in: Use the same cache file for all target libs. + * config-ml.in: But different cache files per multilib variant. + +2000-07-23 Michael Sokolov + + * configure (topsrcdir): Don't use dirname. + +2000-07-20 Jason Merrill + + * configure.in: Remove all references to libg++ and librx. + + * configure, configure.in, Makefile.in: Unify gcc and binutils. + +2000-07-20 Hans-Peter Nilsson + + * config.sub: Update to subversions version 2000-07-06. + +2000-07-12 Andrew Haley + + * configure.in (host_makefile_frag): Use mh-ia64pic on IA-64 hosts. + (target_makefile_frag): Use mt-ia64pic on IA-64 targets. + +2000-07-07 Phil Edwards + + * symlink-tree: Check number of arguments. + +2000-06-06 Andrew Cagney + + * texinfo/texinfo.tex: Update to version 2000-05-28.15. + +2000-07-05 Jim Wilson + + * Makefile.in (CXX_FOR_TARGET): Add libstdc++ to the library + search path for a g++ extracted from the build tree. This + will allow link tests run by configure scripts in + subdirectories to succeed. + +2000-07-01 Koundinya K + + * ltconfig: Add support for mips-dde-sysv4.2MP + +2000-06-28 Corinna Vinschen + + * ltconfig: Check for host_os beeing one of `cygwin', `mingw' or + `os2'. Force ac_cv_exeext to be ".exe" in that case. + +2000-06-19 Timothy Wall + + * configure.in (noconfigdirs): Set noconfigdirs for tic54x target. + * config.sub: Add tic54x target. + +2000-06-07 Phillip Thomas + + * README-maintainer-mode: New file: Contains notes on using + --enable-maintainer-mode with binutils. + +2000-05-29 Andrew Cagney + + * texinfo/texinfo.tex: Update. Version from makeinfo 4.0. + +2000-05-30 Andrew Cagney + + * config.sub: Import CVS version 1.167 Tue May 30 09:00:07 2000. + * config.guess: Import CVS version 1.148 Tue May 30 09:00:06 2000 + +20000-05-21 H.J. Lu (hjl@gnu.org) + + * Makefile.in (CC_FOR_TARGET): Make sure as/ld in the gcc + directory are used if they exist. Make sure + $(build_tooldir)/include is searched for header files, + $(build_tooldir)/lib/ for library files. + (GCC_FOR_TARGET): Likewise. + (CXX_FOR_TARGET): Likewise. + +2000-05-18 Jeffrey A Law (law@cygnus.com) + + * configure.in (hppa*64*-*-*): Do build ld for this configuration. + +2000-05-17 Alexandre Oliva + + * Makefile.in (configure-target-libiberty): Depend on + configure-target-newlib. + +2000-05-16 Alexandre Oliva + + * configure.in, Makefile.in: Merge all libffi-related + configury stuff from the libgcj tree. + +2000-05-16 Andrew Cagney + + Thu Apr 27 11:01:48 2000 Andrew Cagney : + * Makefile.in (do-tar-bz2, do-md5sum): Skip CVS directories. + +2000-05-16 Andrew Cagney + + Wed Apr 26 17:03:53 2000 Andrew Cagney : + * Makefile.in (do-djunpack): New target. Update djunpack.bat with + current version information. Add to proto-toplev directory. + (gdb-taz): Build do-djunpack. + +2000-05-15 David Edelsohn + + * configure.in: Special case powerpc*-*-aix* target_makefile_frag. + +2000-05-13 Alexandre Oliva + + * ltmain.sh: Preserve in relink_command any environment + variables that may affect the linker behavior. + +2000-05-12 Jeffrey A Law (law@cygnus.com) + + * config.sub (basic_machine): Recognize hppa64 as a valid cpu type. + +2000-05-10 Jim Wilson + + * configure.in (ia64*-*-elf*): Add gdb and friends to noconfigdirs. + +2000-05-08 Eli Zaretskii + + * djunpack.bat: Change the Sed script to replace @V@ in fnchange.lst + with the version name. + +2000-05-01 Benjamin Kosnik + + * config.if: Tweak. + +2000-04-23 Eli Zaretskii + + * djunpack.bat: New file. + +2000-04-19 Andrew Cagney + + * Makefile.in (taz, gdb-taz, gas.tar.bz2, binutils.tar.bz2, + gas+binutils.tar.bz2, libg++.tar.bz2, gnats.tar.bz2, gdb.tar.bz2, + dejagnu.tar.bz2, gdb+dejagnu.tar.bz2, insight.tar.bz2, + insight+dejagnu.tar.bz2, newlib.tar.bz2): Pass MD5PROG to sub-make. + +2000-04-16 Dave Pitts + + * config.sub (case $basic_machine): Change default for "ibm-*" + to "openedition". + +2000-04-12 Andrew Cagney + + * Makefile.in (gdb-taz): New target. GDB specific archive. + (do-md5sum): New target. + (MD5PROG): Define. + (PACKAGE): Default to TOOL. + (VER): Default to a shell script. + (taz): Rewrite target. Move real work to do-proto-toplev. Include + md5 checksum generation. + (do-proto-toplev): New target. Create $(PACKAGE)-$(VER) link. + (do-tar-bz2): Delete creation of $(PACKAGE)-$(VER) link. + (gdb.tar.bz2, dejagnu.tar.bz2, gdb+dejagnu.tar.bz2, + insight.tar.bz2): Use gdb-taz to create archive. + +2000-04-07 Andrew Cagney + + * configure (warn_cflags): Delete. + +2000-04-05 Benjamin Kosnik + Martin v. Loewis + + * configure.in (enable_libstdcxx_v3): Add. + (target_libs): Add bits here to switch between libstdc++-v2 and + libstdc++-v3. + * config.if: And this file too. + * Makefile.in: Add libstdc++-v3 targets. + +2000-04-05 Michael Meissner + + * config.sub (d30v): Add d30v as a basic machine type. + +2000-03-29 Jason Merrill + + * configure.in: -linux-gnu*, not -linux-gnu. + +2000-03-03 Andrew Cagney + + * Makefile.in (taz): Set PACKAGE to TOOL when not defined. + (do-tar-bz2): Replace TOOL with PACKAGE. + (gdb.tar.bz2): Remove GDBTK from GDB package. + (gdb+dejagnu.tar.bz2, insight.tar.bz2, insight+dejagnu.tar.bz2, + dejagnu.tar.bz2): New packages. + +2000-02-27 Andreas Jaeger + + * configure.in: Add entry for mips*-*-linux*, move catch all + *-*-*linux* entry below this one. + +2000-02-27 Ian Lance Taylor + + * ltconfig, ltmain.sh: Update to libtool 1.3.4. + +2000-02-24 Nick Clifton + + * config.sub: Support an OS of "wince". + +2000-02-24 Andrew Cagney + + * config.guess, config.sub: Updated to match config's 2000-02-15 + version. + +2000-02-23 Linas Vepstas + + * config.sub: Add support for Linux/IBM 370. + * configure.in: Likewise. + +2000-02-22 Nick Clifton + + * configure.in: Add mips-pe, sh-pe and arm-wince-pe targets. + +2000-02-20 Christopher Faylor + + * config.guess: Guess "cygwin" rather than "cygwin32". + +2000-02-16 Kaveh R. Ghazi + + * configure (gcc_version): When setting, narrow search to + lines containing `version_string'. + +2000-02-15 Denis Chertykov + + * config.sub: Add support for avr target. + +2000-02-01 Hans-Peter Nilsson + + * config.sub: Add mmix-knuth-mmixware. + +2000-01-27 Christopher Faylor + + * Makefile.in (CC_FOR_TARGET): Add new winsup directory + structure stuff to -L library search. + (CXX_FOR_TARGET): Ditto. + (CROSS_CHECK_MODULES): Fix spelling mistake. + +2000-01-24 Mark Mitchell + + * Makefile.in (CXX_FOR_TARGET): Use g++, not xgcc, to invoke + the C++ compiler. + +2000-01-12 Richard Henderson + + * configure.in: Don't build some bits for beos. + +2000-01-12 Joel Sherrill (joel@OARcorp.com) + + * Makefile.in (CC_FOR_TARGET): Use newlib libraries as well + as include files. + +2000-01-06 Geoff Keating + + * configure.in: Use mt-aix43 to handle *_TARGET defs, + not mh-aix43. + +1999-12-14 Richard Henderson + + * config.guess (alpha-osf, alpha-linux): Detect ev67. + * config.sub: Accept alphaev[78], alphaev8. + +1999-12-03 Alexandre Oliva + + * config.guess, config.sub: Update from autoconf. + +Tue Nov 23 00:57:41 1999 Rainer Orth + + * config-ml.in (sparc*-*-*): Disable sparcv9 support if the + necessary libraries are missing. + +1999-10-25 Andreas Schwab + + * configure: Fix quoting inside arguments of eval. + +1999-10-21 Nick Clifton + + * config-ml.in: Allow suppression of some ARM multilibs. + +Tue Sep 7 23:33:57 1999 Linas Vepstas + + * config.guess: Add OS/390 match pattern. + * config.sub: Add mvs, openedition targets. + * configure.in (i370-ibm-opened*): New. + +1999-09-04 Steve Chamberlain + + * config.sub: Add support for configuring for pj. + +1999-08-31 Nick Clifton + + * config.sub (maybe_os): Add support for configuring for fr30. + +1999-08-25 Nick Clifton + + * configure.in: Do not configure or build ld for AIX + platforms. ld is known to be broken on these platforms. + +Wed Aug 25 01:12:25 1999 Rainer Orth + + * config-ml.in: Pass compiler flag corresponding to multidirs to + subdir configures. + +1999-08-09 Ian Lance Taylor + + * Makefile.in (LDFLAGS): Define. + +1999-08-08 Mumit Khan + + * configure.in (i[3456]-*-mingw32*): Don't put gprof in + noconfigdirs. + (*-*-cygwin*): Likewise. + +1999-08-08 Ian Lance Taylor + + * mkdep: New file. + * Makefile.in (GAS_SUPPORT_DIRS): Add mkdep. + (BINUTILS_SUPPORT_DIRS): Add mkdep. + + From Eli Zaretskii : + * configure (tmpfile): Change cONf$$ to cNf$$ to avoid an overly + long file name when using DJGPP on MS-DOS. + +Wed Aug 4 02:07:14 1999 Jeffrey A Law (law@cygnus.com) + + * config.sub (vxworks case): Use os=-vxworks, not os=vxworks. + +1999-07-30 Alan Modra + + * Makefile.in (check-target-libio): Remove all-target-libstdc++ + dependency as this causes "make check" to globally "make all" + +Tue Jun 22 23:45:18 1999 Tom Tromey + + * configure.in (target_libs): Added target-zlib. + * Makefile.in (ALL_TARGET_MODULES): Added zlib. + (CONFIGURE_TARGET_MODULES): Likewise. + (CHECK_TARGET_MODULES): Likewise. + (INSTALL_TARGET_MODULES): Likewise. + (CLEAN_TARGET_MODULES): Likewise. + (configure-target-zlib): New target. + (all-target-zlib): Likewise. + (all-target-libjava): Depend on all-target-zlib. + (configure-target-libjava): Depend on configure-target-zlib. + + * Makefile.in (configure-target-libjava): Depend on + configure-target-newlib. + (configure-target-boehm-gc): New target. + (configure-target-qthreads): New target. + + * configure.in (target_libs): Added target-qthreads. + * Makefile.in (ALL_TARGET_MODULES): Added qthreads. + (CONFIGURE_TARGET_MODULES): Likewise. + (CHECK_TARGET_MODULES): Likewise. + (INSTALL_TARGET_MODULES): Likewise. + (CLEAN_TARGET_MODULES): Likewise. + (all-target-qthreads): New target. + (configure-target-libjava): Depend on configure-target-qthreads. + (all-target-libjava): Depend on all-target-qthreads. + + * Makefile.in (ALL_TARGET_MODULES): Added libjava, boehm-gc. + (CONFIGURE_TARGET_MODULES): Likewise. + (CHECK_TARGET_MODULES): Likewise. + (INSTALL_TARGET_MODULES): Likewise. + (CLEAN_TARGET_MODULES): Likewise. + (all-target-libjava): New target. + (all-target-boehm-gc): Likewise. + * configure.in (target_libs): Added libjava, boehm-gc. + +1999-07-22 Ian Lance Taylor + + * Makefile.in (binutils.tar.bz2): Don't pass makeall.bat and + configure.bat in SUPPORT_FILES. + (gas+binutils.tar.bz2): Likewise. + + * makeall.bat: Remove; obsolete. + +1999-07-21 Ian Lance Taylor + + From Mark Elbrecht: + * configure.bat: Remove; obsolete. + +1999-07-11 Ian Lance Taylor + + * configure: Add -W -Wall to the default CFLAGS when compiling with + gcc. + +Thu Jul 8 12:32:23 1999 John David Anglin + + * configure.in: Build ld, binutils & gas for hppa*-*-linux-gnu*. + +1999-06-30 Mark Mitchell + + * configure.in: Build ld on IRIX6. + +1999-06-12 Ian Lance Taylor + + * Makefile.in: Change distribution targets to use bzip2 instead of + gzip. + (TEXINFO_SUPPORT): Set to just texinfo/texinfo.tex. + (taz): Don't use texinfo/gpl.texinfo or texinfo/lgpl.texinfo. + +1999-06-04 Nick Clifton + + * config.sub: Add mcore target. + +1999-05-30 Cort Dougan + + * config.guess (ppc-*-linux-gnu): Also use ld emul elf32ppclinux. + +1999-05-25 H.J. Lu (hjl@gnu.org) + + * config.guess (dummy): Changed to $dummy. + +1999-05-24 Nick Clifton + + * config.sub: Tidied up case statements. + +1999-05-22 Ben Elliston + + * config.guess: Handle NEC UX/4800. Contributed by Jiro Takabatake + . + + * config.guess: Merge with FSF version. Future changes will be + more accurately recorded in this ChangeLog. + * config.sub: Likewise. + +1999-05-20 Stephen L Moshier + + * Makefile.in (GCC_FOR_TARGET): Add -I$(build_tooldir)/include. + +1999-04-30 Tom Tromey + + * ltmain.sh: [mode link] Always use CC given by ltconfig. + +1999-04-23 Tom Tromey + + * ltconfig, ltmain.sh: Update to libtool 1.2f. + +1999-04-20 Drew Moseley + + * configure.in (noconfigdirs): Don't build libstub for arm-elf targets. + (noconfigdirs): Don't build any bsp stuff for for arm-oabi targets. + Bad merge removed these two changes. + +Tue Apr 13 22:50:54 1999 Donn Terry (donn@interix.com) + Martin Heller (Ing.-Buero_Heller@t-online.de) + + * config.guess (interix Alpha): Add. + +1999-04-11 Richard Henderson + + * configure.in (i?86-*-beos*): Do config gperf; don't config + gdb, newlib, or libgloss. + +1999-04-11 Alexandre Oliva + + * config-ml.in: On mips*-*-*, if multidirs contains mabi=64, try to + link a trivial program with -mabi=64. If it fails, remove mabi=64 + from multidirs. + +1999-04-10 Philipp Thomas (kthomas@gwdg.de) + + * config.sub: Set basic_machine to i586 when target_alias = k6-*. + +1999-04-08 Nick Clifton + + * config.sub: Add support for mcore targets. + +1999-04-07 Michael Meissner + + * configure.in (d30v-*): Use config/mt-d30v as makefile fragment, + not mt-ospace, in order to shut up assembler warning about using + symbols that are named the same as registers. + +1999-04-07 Drew Moseley + + * Makefile.in (all-target-cygmon): Added all-target-bsp to the + dependency list for all-target-cygmon. + +1999-04-05 Doug Evans + + * config-ml.in: Check $host, not $target, for selective multilibs. + (arm-*-*): Allow disabling of biendian, h/w fp, 26 bit apcs, + thumb interworking, and underscore prefix multilibs. + +1999-04-04 Ian Lance Taylor + + * missing: Update to version from current automake. + +Fri Apr 2 15:11:32 1999 H.J. Lu (hjl@gnu.org) + + * configure (gxx_include_dir): Removed. + + * configure.in (gxx_include_dir): Handle it. + * Makefile.in: Likewise. + +1999-03-29 Gavin Romig-Koch + + * config.sub (mips64vr4111,mips64vr4111el) Add. + +1999-03-21 Ben Elliston + + * config.guess: Correct typo for detecting ELF on FreeBSD. + +Thu Mar 18 00:17:50 1999 Mark Elbrecht + + * configure.in (pc-msdosdjgpp): Set host_makefile_frag to + config/mh-djgpp. + +Thu Mar 11 18:37:23 1999 Drew Moseley + + * Makefile.in (all-target-bsp): Added all-gcc all-binutils and + all-target-newlib to dependency list for all-target-bsp. + +Thu Mar 11 01:19:31 1999 Mumit Khan + + * config.sub: Add i386-uwin support. + * config.guess: Likewise. + +Thu Mar 11 01:07:55 1999 Franz Sirl + + * configure.in: cleanup, add mh-*pic handling for arm, special + case powerpc*-*-aix* + +Wed Mar 10 18:35:07 1999 Jeff Johnston + + * configure.in (noconfigdirs): Removed target-libgloss so libnosys.a + can be built. + +Wed Mar 10 17:39:09 1999 Drew Moseley + + * configure.in: Added bsp support to arm-*-coff and arm-*-elf + targets. + +1999-03-02 Nick Clifton + + * config.sub: Rename CYGNUS LOCAL to EGCS LOCAL + +1999-02-28 Geoffrey Noer + + * config.sub: Check for "cygwin*" rather than "cygwin32*" + +1999-02-24 Nick Clifton + + * config.sub: Fix typo in arm recognition. + +1999-02-24 Drew Moseley + + * configure.in (noconfigdirs): Changed target_configdirs to + include target-bsp only for m68k-*-elf* and m68k-*-coff* + rather than m68k-*-* since it is not known to work on + m68k-aout. Ditto for arm-*-*oabi. + +1999-02-24 Stan Shebs + + * configure.in (*-*-windows*): Remove, no longer used. + +1999-02-19 Ben Elliston + + * config.guess: Automatically recognise ELF on FreeBSD. From Niall + Smart and improved by Andrew Cagney. + +1999-02-18 Marc Espie + + * config.guess: Recognize openbsd-*-hppa. + +1999-02-17 H.J. Lu (hjl@gnu.org) + + * Makefile.in (REALLY_SET_LIB_PATH): Append $$$(RPATH_ENVVAR) + only if it is not empty. + +1999-02-17 Nick Clifton + + Patch from: Scott Bambrough + + * config.guess: Modified to recognize uname's armv* syntax. + + * config.sub: Modified to recognize uname's armv* syntax. + +1999-02-17 Mark Salter + + * configure.in: Added target-bsp for sparclite. + +1999-02-08 Richard Henderson + + * config.sub: Recognize alphapca5[67] and up to alphaev8. + +1999-02-08 Nick Clifton + + * configure.in: Add support for strongarm port. + * config.sub: Add support for strongarm target. + +1999-02-07 Mumit Khan + + * configure.in (*-*-cygwin32*): Use config/mh-cygwin instead of + the old name config/mh-cygwin32. + Enable texinfo. + +1999-02-04 Ian Lance Taylor + + * configure.in: Do build ld for ix86 Solaris. + +1999-02-02 Jim Wilson + + * Makefile.in (EXTRA_GCC_FLAGS): Set AR to $AR instead of + $AR_FOR_TARGET. Likewise for RANLIB. + +1999-02-02 Catherine Moore + + * config.sub (oabi): Recognize. + * configure.in (arm-*-oabi): Handle. + +1999-01-30 Robert Lipe (robertlipe@usa.net) + + * config.guess: Improve detection of i686 on UnixWare 7. + +1999-01-30 Mumit Khan + + * config.guess: Add support for i386-pc-interix. + * config.sub: Likewise. + * configure.in: Likewise. + +1999-01-18 Christopher Faylor + + * Makefile.in: Remove unneeded all-target-libio from + from all-target-winsup target since it is now unneeded. + Add all-target-libtermcap in its place since it is now + needed. + +1998-12-30 Christopher Faylor + + * configure.in: makefile stub for cygwin target is probably + unnecessary. Remove it for now. + +1998-12-30 Christopher Faylor + + * configure.in: libtermcap.a should be built when cygwin is the + target as well as the host. + * config.guess: Allow mixed case in cygwin uname output. + * Makefile.in: Add libtermcap target. + +1998-12-23 Jeffrey A Law (law@cygnus.com) + + * config.sub: Clean up handling of hppa2.0. + +1998-12-22 Rodney Brown (rodneybrown@pmsc.com) + + * config.guess: Use C code to identify more HP machines. + +Thu Dec 17 01:22:30 1998 Jeffrey A Law (law@cygnus.com) + + * config.sub: Handle hppa2.0. + +Tue Dec 15 17:02:58 1998 Bob Manson + + * configure.in: Add cygmon for x86-coff and x86-elf. Configure + cygmon for all sparclite targets, regardless of object format. + +1998-12-15 Mark Salter + + * configure.in: Added target-bsp for several target architectures. + + * Makefile.in: Added rules for bsp. + +Fri Dec 4 01:34:02 1998 Jeffrey A Law (law@cygnus.com) + + * config.guess: Improve detection of hppa2.0 processors. + +Fri Dec 4 01:33:05 1998 Niall Smart + + * config.guess: Recognize FreeBSD using ELF automatically. + +1998-11-26 Manfred Hollstein + + * configure (skip-this-dir): Add handling for new shell script, which + might be created by a sub-directory's configure to indicate, this particular + directory is "unwanted". + * Makefile.in ($(CONFIGURE_TARGET_MODULES)): Likewise. + +Wed Nov 18 18:28:45 1998 Geoffrey Noer + + * ltconfig: import from libtool, after changing libtool to + account for the cygwin name change. + +Wed Nov 18 18:09:14 1998 Geoffrey Noer + + * Makefile.in: CC_FOR_TARGET and CXX_FOR_TARGET should also + include newlib/libc/sys/cygwin and newlib/libc/sys/cygwin32. + +Wed Nov 18 20:13:29 1998 Christopher Faylor + + * configure.in: Add libtermcap to list of cygwin dependencies. + +1998-11-17 Geoffrey Noer + + * Makefile.in: modify CC_FOR_TARGET and CXX_FOR_TARGET so that + they include winsup/include when it's a cygwin target. + +1998-11-12 Tom Tromey + + * configure.in (host_tools): Added zip. + * Makefile.in (all-target-libjava): Depend on all-zip. + (all-zip): New target. + (ALL_MODULES): Added all-zip. + (NATIVE_CHECK_MODULES): Added check-zip. + (INSTALL_MODULES): Added install-zip. + (CLEAN_MODULES): Added clean-zip. + +1998-11-12 Geoffrey Noer + + * Makefile.in: lose "32" from comment about cygwin. + +1998-11-05 Nick Clifton + + * configure.in: Use -Os to build target libraries for the fr30. + +1998-11-04 Dave Brolley + + * config.sub: Add fr30. + +1998-11-02 Geoffrey Noer + + * configure.in: drop "32" from config/mh-cygwin32. Check + cygwin* instead of cygwin32*. + * config.sub: Check cygwin* instead of cygwin32*. + +1998-10-22 Robert Lipe + + * config.guess: Match any version of Unixware7. + +1998-10-20 Syd Polk + + * Makefile.in configure.in: Add the ability to use tcl8.1 and tk8.1 + if desired. + +1998-10-18 Jeffrey A Law (law@cygnus.com) + + * config.if (cxx_interface, libstdcxx_interface): Do not try to set + these if the appropriate directories and files to not exist. + +1998-10-14 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (DEVO_SUPPORT): Add config.if. + +1998-10-13 Manfred Hollstein + + * configure: Add pattern to replace "build_tooldir"'s + definition in the generated Makefile with "tooldir"'s + actual value. + +Tue Oct 13 09:17:06 1998 Jeffrey A Law (law@cygnus.com) + + * config.sub: Bring back lost sparcv9. + + * Makefile.in (all-snvavigator): Remove all-flexlm dependency. + +Mon Oct 12 12:09:44 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (CHILL_FOR_TARGET): Mirror recent changes to + CC_FOR_TARGET and friends. + +Mon Oct 12 12:09:30 1998 Alexandre Oliva + + * Makefile.in (build_tooldir): New variable, same as tooldir. + (CC_FOR_TARGET, GCC_FOR_TARGET, CXX_FOR_TARGET): Add + -B$(build_tooldir)/bin/. + (BASE_FLAGS_TO_PASS): Pass build_tooldir down. + +Wed Sep 30 22:20:50 1998 Robert Lipe + + * config.sub: Add support for i[34567]86-pc-udk. + * configure.in: Likewise. + +Wed Sep 30 19:23:48 1998 Geoffrey Noer + + * Makefile.in: add bzip2 package building bits for user + tools module + * configure.in: ditto + +Wed Sep 30 03:00:05 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (TARGET_CONFIGDIRS): Add libobjc. + (ALL_TARGET_MODULES): Add all-target-libobjc. + (CONFIGURE_TARGET_MODULES, CHECK_TARGET_MODULES): Similarly. + (INSTALL_TARGET_MODULES, CLEAN_TARGET_MODULES): Similarly. + (all-target-libchill): Add dependencies. + * configure.in (target_libs): Add libchill. + +1998-09-30 Manfred Hollstein + + * configure.in (target_subdir): Remove duplicate line. + +Tue Sep 29 22:45:41 1998 Felix Lee + + * Makefile.in (all-automake): fix dependencies. + +Mon Sep 28 04:04:27 1998 Jeffrey A Law (law@cygnus.com) + + * configure.in: Minor cleanups for building in the $(target_alias) + subdir. + +1998-09-22 Jim Wilson + + * Makefile.in (bootstrap): Set r and s before make all. Use + BASE_FLAGS_TO_PASS in make all. + (cross): Likewise. + +1998-09-20 Mark Mitchell + + * Makefile.in (bootstrap): Pass TARGET_FLAGS_TO_PASS to `make all'. + +Sun Sep 20 00:13:02 1998 Richard Henderson + + * config.sub: Fix typo in last change. + +1998-09-19 Michael Hayes + + * config.sub: Add support for C4x target. + * configure.in: Likewise. + +1998-09-13 David S. Miller + + * config.sub: Recognize sparcv9 just like sparc64. + +Wed Sep 9 15:44:52 1998 Robert Lipe + + * config.guess: Match "Pent II" or "PentII" for OpenServer. + +Tue Sep 8 01:18:39 1998 Jeffrey A Law (law@cygnus.com) + + * config.guess: Correctly identify Pentium II sco boxes. + + * config.guess: Fix "tr" code. From Weiwen Liu. + +Sat Sep 5 13:56:52 1998 John Hughes + + * configure.in: Do not assume x86-svr4 or x86-unixware can handle + stabs. + +Sat Sep 5 02:12:02 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (TARGET_CONFIGDIRS): Add libchill. + (ALL_TARGET_MODULES): Add all-target-libchill. + (CONFIGURE_TARGET_MODULES, CHECK_TARGET_MODULES): Similarly. + (INSTALL_TARGET_MODULES, CLEAN_TARGET_MODULES): Similarly. + (all-target-libchill): Add dependencies. + * configure.in (target_libs): Add libchill. + +Sun Aug 30 22:27:02 1998 Lutz Wohlrab + + * config.guess: Avoid assumptions about "tr" behaves when + LANG is set to something other than English. + +Sun Aug 30 22:14:44 1998 H.J. Lu (hjl@gnu.org) + + * configure (gxx_include_dir): Changed to + '${prefix}/include/g++'-${libstdcxx_interface}. + + * config.if: New to determine the interfaces. + +Sun Aug 30 21:15:19 1998 Mark Klein (mklein@dis.com) + + * config.guess: Detect and handle MPE/IX. + * config.sub: Deal with MPE/IX. + +Sat Aug 29 14:32:55 1998 David Edelsohn + + * configure.in: Use mh-aix43. + +1998-07-29 Manfred Hollstein + + * configure: Fix --without/--disable cases for gxx-include-dir. + +Fri Aug 28 12:28:26 1998 Per Bothner + + * mdata-sh: Imported. Needed for automake support. + +Thu Aug 13 12:49:29 1998 H.J. Lu + + * Makefile.in (taz): Try "chmod -R og=u ." before + "chmod og=u `find . -print`". + +Fri Jul 31 09:38:33 1998 Catherine Moore + + * configure.in: Add arm-elf and thumb-elf support. + +Mon Jul 27 16:23:58 1998 Doug Evans + + * Makefile.in: Undo previous patch. + +Fri Jul 24 19:55:24 1998 Doug Evans + + * Makefile.in (INSTALL_TARGET): Move EXTRA_TARGET_HOST_INSTALL_MODULES + to here ... + (install-no-fixedincludes): and here + (INSTALL_MODULES): ... from here. + +Fri Jul 24 17:01:42 1998 Ian Lance Taylor + + * config.sub: Merge with FSF. + + * config.guess: Merge with FSF. + +Fri Jul 24 08:43:36 1998 Doug Evans + + * configure (extraconfigdirs): New variable. + (SUBDIRS): Add extraconfigdirs and recurse on them too. + * Makefile.in (all): Move higher in file. + (EXTRA_TARGET_HOST_ALL_MODULES): New variable. + (EXTRA_TARGET_HOST_{INSTALL,CHECK}_MODULES): New variables. + (ALL_MODULES): Add EXTRA_TARGET_HOST_ALL_MODULES. + (CROSS_CHECK_MODULES): Add EXTRA_TARGET_HOST_CHECK_MODULES. + (INSTALL_MODULES): Add EXTRA_TARGET_HOST_INSTALL_MODULES. + +1998-07-23 Brendan Kehoe + + * Makefile.in (all-target-libjava): Depend on all-gcc and + all-target-newlib. + (configure-target-libjava): Depend on $(ALL_GCC). + +Sat Jul 18 14:32:43 CDT 1998 Robert Lipe + + * config.guess: (*-pc-sco3.2v5) Add detection for Pentium II. + (*-pc-unixware7) Add detection for Pentium II, Pentium Pro. + +Fri Jul 17 13:30:18 1998 Ian Lance Taylor + + * ylwrap: Change absolute path checks to check for DOS style path + names. + + * ylwrap: Don't use a full path name if the source file is in the + same directory. From hjl@lucon.org (H.J. Lu). + + * config-ml.in: Default to being verbose, to match Feb 18 change to + configure. + +Thu Jul 16 12:29:51 1998 Ian Lance Taylor + + Brought over from egcs: + + Sat Jun 27 22:46:32 1998 Jeffrey A Law (law@cygnus.com) + + * configure.in (target_subdir): Set to ${target_alias} instead + of "libraries". + + Mon Sep 1 16:45:44 1997 Jim Wilson + + * configure.in (target_subdir): Set to libraries if enable_multilib. + +Wed Jul 15 01:00:54 1998 Ian Lance Taylor + + * Makefile.in ($(CONFIGURE_TARGET_MODULES)): If there are any + multilibs, force reconfiguration the first time we create + multilib.out in a subdirectory, in case TARGET_SUBDIR is `.'. + +Tue Jul 14 23:41:03 1998 Ian Lance Taylor + + * configure.in: Strip any --no option from CONFIG_ARGUMENTS, to + avoid confusion with --no-recursion. + +Tue Jul 14 15:37:41 1998 Geoffrey Noer + + * configure.in: Win32 hosts shouldn't use install -x + * install-sh: remove -x option, and special .exe-handling + hack. + +Tue Jul 14 15:28:41 1998 Richard Henderson + + * config.guess: Recognize i586-pc-beos. + * configure.in: Don't build some bits for beos. + +Tue Jul 14 13:22:18 1998 Ian Lance Taylor + + * configure: If CC is set but CFLAGS is not, and CC is gcc, make + CFLAGS default to -O2. + + * ltmain.sh: Add some hacks to make SunOS --enable-shared work + when using GNU ld. + +Fri Jul 10 13:18:23 1998 Ian Lance Taylor + + * ltmain.sh: Correct install when using a different shell. + +Tue Jul 7 15:24:38 1998 Ian Lance Taylor + + * ltconfig, ltmain.sh: Update to libtool 1.2b. + +Thu Jul 2 13:57:36 1998 Klaus Kaempf + + * makefile.vms: Update to build binutils/makefile.vms. Add install + target. + +Wed Jul 1 16:45:21 1998 Ian Lance Taylor + + * ltconfig: Update to correct AIX handling. + +Sat Jun 27 22:46:32 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (BASE_FLAGS_TO_PASS): Add TARGET_SUBDIR. + + * configure.in (target_subdir): Set to ${target_alias} instead + of "libraries". + +1998-06-26 Manfred Hollstein + + * Makefile.in (BASE_FLAGS_TO_PASS): Add gcc_version_trigger. + (Makefile): Depend on $(gcc_version_trigger). + + * configure (gcc_version): Change default initializer to empty + string. + (gcc_version_trigger): New variable; pass this variable down + to subdir configures to enable them checking gcc's version + themselves. Emit make macros for both gcc_version vars. + (topsrcdir): Initialize reliably. + (recursion line): Remove --with-gcc-version=${gcc_version}. + +1998-06-24 Manfred Hollstein + + * configure (enable_version_specific_runtime_libs): Implement new flag + --enable-version-specific-runtime-libs which installs C++ runtime stuff + in $(libsubdir); emit definition in each generated Makefile. + (gxx_include_dir): Initialize depending on + $enable_version_specific_runtime_libs. + +1998-06-24 Manfred Hollstein + + * configure (gcc_version): Initialize properly depending on + how and where configure is started. + (recursion line): Pass a --with-gcc-version=${gcc_version} + to configures in subdirs. + +Wed Jun 24 16:01:59 1998 John Metzler + + * configure.in (noconfigdirs): Add configure pattern for mips tx39 + cygmon + +Tue Jun 23 22:42:32 1998 Mark Alexander + + * configure.in: Add cygmon and libstub support for mn10200. + +1998-06-19 Manfred Hollstein + + * configure (gcc_version): Add new variable describing the + particular gcc version we're building. + * Makefile.in (libsubdir): Add new macro for the directory + in which the compiler finds executables, libraries, etc. + (BASE_FLAGS_TO_PASS): Pass down gcc_version, target_alias + and libsubdir. + +Fri Jun 19 02:36:59 1998 Alexandre Oliva + + * Makefile.in (local-clean): Remove *.log. + (warning.log): Built with warn_summary from build.log. + (mail-report.log): Run test_summary. + (mail-report-with-warnings.log): Run test_summary including + warning.log in the report. + +Thu Jun 18 11:26:03 1998 Robert Lipe + + * config.guess: Detection of Pentium II for *-sco-3.2v5*. + +Mon Jun 15 14:53:54 1998 Andrew Cagney + + * Makefile.in (grep): Grep no longer depends on libiberty. + +Fri Jun 12 14:03:34 1998 Syd Polk + + * Makefile.in: all-snavigator needs all-libgui. + +Thu Jun 11 19:43:47 1998 Mark Alexander + + * configure.in: Add cygmon and libstub support for mn10300. + +Wed Jun 10 11:19:47 1998 Ian Lance Taylor + + * missing: Update to version from automake 1.3. + + * ltmain.sh: On installation, don't get confused if the same name + appears more than once in the list of library names. + +Wed Jun 3 14:51:42 1998 Ian Lance Taylor + + * config.sub: Accept m68060 and m5200 as CPU names. + +Mon Jun 1 17:25:16 1998 Ian Lance Taylor + + * configure: Use && rather than using -a in test, because odd + strings can confuse test. + * configure.in: Likewise. + +Thu May 28 19:31:13 1998 Ian Lance Taylor + + * ltconfig, ltmain.sh: Bring in Visual C++ support. + +Sat May 23 23:44:13 1998 Alexandre Oliva + + * Makefile.in (boostrap2-lean, bootstrap3-lean, + bootstrap4-lean): New targets. + +Mon May 11 23:55:56 1998 Jeffrey A Law (law@cygnus.com) + + * mpw-* Delete. Not used. + +Mon May 11 23:11:34 1998 Jeffrey A Law (law@cygnus.com) + + * COPYING.LIB: Update FSF address. + +Fri May 8 01:30:20 1998 Ian Lance Taylor + + * ltconfig, ltmain.sh: Update to libtool 1.2a. + + * Makefile.in (GASB_SUPPORT_DIRS): Remove intl; already included via + GAS_SUPPORT_DIRS. + +Thu May 7 17:27:35 1998 Ian Lance Taylor + + * ltconfig, ltmain.sh: Avoid producing a version number if + -version-info was not used. + +Tue May 5 18:02:24 1998 Ian Lance Taylor + + * configure.in: Add --with-newlib to CONFIG_ARGUMENTS if we are + building with newlib. + +1998-04-30 Paul Eggert + + * Makefile.in (EXTRA_GCC_FLAGS): Remove backslash at end; + Solaris `make' causes it to continue to next definition. + +Tue Apr 28 16:24:24 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * Makefile.in (install-gdbtk): Call this 'install-gdb' so that + the right GUI libraries and files are installed along with GDB. + +Tue Apr 28 18:11:24 1998 Ian Lance Taylor + + * configure.in: Change alpha to alpha* in several places. + +Tue Apr 28 07:42:00 1998 Mark Alexander + + * config.sub: Recognize sparc86x. + +Tue Apr 28 07:35:02 1998 Michael Meissner + + * configure.in (--enable-target-optspace): Remove debug echo. + +Thu Apr 23 21:31:16 1998 Jim Wilson + + * configure: Set CXXFLAGS from CXXFLAGS, not CFLAGS. + +Thu Apr 23 12:26:38 1998 Ian Lance Taylor + + * ltconfig: Update cygwin32 support. + + * Makefile.in (GAS_SUPPORT_DIRS): Add intl. + (BINUTILS_SUPPORT_DIRS, GASB_SUPPORT_DIRS): Likewise. + (GDB_SUPPORT_DIRS): Likewise. + +Wed Apr 22 12:30:10 1998 Michael Meissner + + * configure.in (target_makefile_frag): If --enable-target-optspace, + use -Os to compile target libraries rather than -O2. Default to + using -Os for d10v and m32r if --{enable,disable}-target-optspace is + not used. + * configure.in (target_cflags): Ditto for d30v. + +Tue Apr 21 23:06:54 1998 Tom Tromey + + * Makefile.in (all-bfd): Depend on all-intl. + (all-binutils): Likewise. + (all-gas): Likewise. + (all-gprof): Likewise. + (all-ld): Likewise. + +1998-04-19 Brendan Kehoe + + * configure.in (host_tools): Fix typo, lbtool -> libtool. + +Fri Apr 17 16:20:42 1998 Ian Lance Taylor + + * Makefile.in (all-bfd): Depend upon all-libiberty. + + * ltconfig, ltmain.sh: Bring in newer cygwin32 support. + +Fri Apr 17 12:22:22 1998 Bob Manson + + * Makefile.in: Add libstub. + + * configure.in: Ditto. Build libstub for targets that have cygmon + support. + +Tue Apr 14 18:01:55 1998 Ian Lance Taylor + + * configure.in: Don't set PICFLAG on ix86-cygwin32. + +Tue Apr 14 12:24:45 1998 J. Kean Johnston + + * configure.in: Recognise i[3456]96-*-sysv5* as a valid host, and + use mh-sysv5 if specified. Support gprof on SCO Open Server. + +Tue Apr 14 11:33:51 1998 Krister Walfridsson + + * configure: Define DEFAULT_M4 by searching PATH. + * Makfile.in: Use DEFAULT_M4. + +Mon Apr 13 15:37:24 1998 Ian Lance Taylor + + * ltconfig: Add cygwin32 support. + + * Makefile.in, configure.in: Add libtool as a native only directory + to configure and build. + +Sun Apr 12 20:58:46 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (INSTALL_MODULES): Remove texinfo. + +Wed Apr 8 13:18:56 1998 Philippe De Muyter + + * Makefile.in (EXTRA_GCC_FLAGS): XFOO lines shortened. + +Thu Apr 2 14:48:44 1998 Geoffrey Noer + + * Makefile.in: add ash make rules + * configure.in: add ash to native_only and host_tools lists + +Thu Mar 26 12:53:20 1998 Tom Tromey + + * Makefile.in (all-gettext, all-intl): New targets. + (ALL_MODULES): Added all-gettext, all-intl. + (CROSS_CHECK_MODULES): Added check-gettext, check-intl. + (INSTALL_MODULES): Added install-gettext, install-intl. + (CLEAN_MODULES): Added clean-gettext, clean-intl. + + * configure.in (host_tools): Added gettext. + (native_only): Likewise. + (noconfigdirs) [various cases]: Likewise. + (host_libs): Added intl. + +Thu Mar 26 15:00:11 1998 Keith Seitz + + * configure: Do not disable building gdbtk for cygwin32 hosts. + +Wed Mar 25 10:04:18 1998 Nick Clifton + + * configure.in: Add thumb-coff target. + * config.sub: Add thumb-coff target. + +Wed Mar 25 11:49:12 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * Makefile.in: Revert yesterday's change. + (all-target-winsup): all-target-librx stays out of here. + +Tue Mar 24 16:58:29 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * Makefile.in (TARGET_CONFIGDIRS, ALL_TARGET_MODULES, + CONFIGURE_TARGET_MODULES, CHECK_TARGET_MODULES, + INSTALL_TARGET_MODULES, CLEAN_TARGET_MODULES, all-target-winsup): + Remove references to librx and libg++. + +Tue Mar 24 18:28:12 1998 Eric Mumpower + + * Makefile.in (BASE_FLAGS_TO_PASS): Pass $(lispdir) down to + recursive makes + +Tue Mar 24 11:37:45 1998 Ian Lance Taylor + + * Makefile.in (CC_FOR_TARGET): Use $(TARGET_SUBDIR) when passing -B + for newlib directory. + (CXX_FOR_TARGET): Likewise. + +Mon Mar 23 11:30:21 1998 Jeffrey A Law (law@cygnus.com) + + * ltconfig: Update after libtool/ltconfig.in change for + hpux11. + +Fri Mar 20 18:51:43 1998 Ian Lance Taylor + + * ltconfig, ltmain.sh: Update to libtool 1.2. + +Fri Mar 20 09:32:14 1998 Manfred Hollstein + + * Makefile.in (install-gcc): Don't specify LANGUAGES here. + (install-gcc-cross): Instead, override LANGUAGES here. + +1998-03-18 Dave Love + + * Makefile.in ($(CONFIGURE_TARGET_MODULES)): Set CONFIG_SITE to a + non-existent file since /dev/null loses with bash 2.0/autoconf 2.12. + +Wed Mar 18 09:24:59 1998 Nick Clifton + + * configure.in: Add Thumb-pe target. + +Tue Mar 17 16:59:00 1998 Syd Polk + + * Makefile.in - changed sn targets to snavigator + * configure.in - changed sn targets to snavigator + +Tue Mar 17 10:33:28 1998 Manfred Hollstein + + * config-ml.in: After building symlink tree call make distclean + if a Makefile got linked into ${ml_dir}/${ml_libdir}; this happens + to be the case for libiberty. + +Tue Mar 17 10:22:37 1998 H.J. Lu (hjl@gnu.ai.mit.edu) + + * configure: When making link, also check the current + directory. The configure scripts may create one. + +Fri Mar 6 01:02:03 1998 Richard Henderson + + * config.sub: Accept alphapca56 and alphaev6 properly. + +Fri Mar 6 00:14:55 1998 Franz Sirl + + * configure.in: Revert 3 Jan change for powerpc-linux-gnulibc1. + +Mon Feb 23 15:09:18 1998 Bruno Haible + + * Makefile.in (INSTALL_MODULES): Move install-tcl before + install-itcl. + (install-itcl): Remove dependency on install-tcl. + +Mon Feb 23 09:53:28 1998 Mark Alexander + + * configure.in: Remove libgloss from noconfigdirs for MN10300. + +Thu Feb 19 13:40:41 1998 Ian Lance Taylor + + * configure.in: Don't build libgui for a cygwin32 target when not on + a cygwin32 host. + +Wed Feb 18 12:29:00 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * configure (redirect): Set to null, so default behavior of + configure is now --verbose. + +1998-02-16 Dave Love + + * Makefile.in ($(CONFIGURE_TARGET_MODULES)): Run configure with + CONFIG_SITE=/dev/null to forestall lossage with site configuration. + +Mon Feb 16 12:23:53 1998 Manfred Hollstein + + * Makefile.in (BASE_FLAGS_TO_PASS, EXTRA_TARGET_FLAGS): Really add + this change to sync Makefile.in with its ChangeLog entries. + +Thu Feb 12 15:03:08 1998 H.J. Lu + + * ltmain.sh (mkdir): Check that the directory doesn't exist + before we exit with error, so that we don't get races during + parallel builds. + +Sat Feb 7 15:19:18 1998 Ian Lance Taylor + + * ltconfig, ltmain.sh: Update from libtool 1.0i. + +Fri Feb 6 01:33:52 1998 Manfred Hollstein + + * Makefile.in (BASE_FLAGS_TO_PASS): Don't pass PICFLAG and + PICFLAG_FOR_TARGET. + (EXTRA_TARGET_FLAGS): Don't pass PICFLAG_FOR_TARGET. + + * configure: Emit a definition for the new macro enable_shared + into each Makefile. + +Thu Feb 5 17:01:12 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * configure.in (host_tools, native_only): Add libtool. + +Wed Feb 4 16:53:58 1998 Geoffrey Noer + + * configure.in: add target-gperf to noconfigdirs for Cygwin32. + Fix typo in ming config comment. + +Wed Feb 4 18:56:13 1998 Ian Lance Taylor + + * ltconfig, ltmain.sh: Update from libtool 1.0h. + +Mon Feb 2 19:38:19 1998 Ian Lance Taylor + + * config.sub: Add tic30 cases, and map c30 to tic30. + +Sun Feb 1 02:40:41 1998 Richard Henderson + + * Makefile.in (TARGET_CONFIGDIRS): Add libf2c. + (ALL_TARGET_MODULES, CONFIGURE_TARGET_MODULES): Similarly + (CHECK_TARGET_MODULES, INSTALL_TARGET_MODULES): Similarly + (CLEAN_TARGET_MODULES): Similarly + (all-target-libf2c): Add dependences. + * configure.in (target_libs): Add libf2c. + +Fri Jan 30 17:18:32 1998 Geoffrey Noer + + * configure.in: Remove expect from noconfigdirs when target + is cygwin32. OK to build expect and dejagnu with Canadian + Cross. + +Wed Jan 28 12:58:49 1998 Ian Lance Taylor + + * configure.in: Do build expect, dejagnu, and cvssrc for a cygwin32 + host. + + * config.guess: Use ${UNAME_MACHINE} rather than i386 for cygwin32 + and mingw32. + +Wed Jan 28 10:26:37 1998 Manfred Hollstein + + * Makefile.in (BASE_FLAGS_TO_PASS): Remove passing $(local_prefix) + here as it is not defined in the toplevel Makefile. + +Tue Jan 27 23:25:06 1998 Manfred Hollstein + + * configure (package_makefile_rules_frag): New variable, which names + a file with generic rules, ... + Change comment to mention we now have FIVE parts. + * configure: Undo last change. + +Tue Jan 27 23:15:55 1998 Lassi A. Tuura + + * config.guess: More accurate determination of HP processor types. + * config.sub: More accurate determination of HP processor types. + +Sat Jan 24 01:59:45 1998 Manfred Hollstein + + * configure (package_makefile_frag): Move inserting the + ${package_makefile_frag} to where it should be according + to the comment. + +Fri Jan 23 00:29:28 1998 Philip Blundell + + * config.guess: Add support for Linux/ARM. + +Thu Jan 22 15:14:01 1998 Fred Fish + + * .cvsignore: Remove *-info and *-install since they match + release-info and mpw-install, which we don't want to just ignore. + +Thu Jan 22 01:38:33 1998 Richard Henderson + + * configure.in: Revert 3 Jan change for alpha-linux-gnulibc1. + +Sat Jan 17 21:28:08 1998 Pieter Nagel + + * Makefile.in (FLAGS_TO_PASS): Pass down gcc_include_dir and + local_prefix to sub-make invocations. + +Sat Jan 17 21:04:59 1998 H.J. Lu (hjl@gnu.org) + + * configure.in: Check makefile fragments in the source + directory. + +Fri Jan 16 00:41:37 1998 Alexandre Oliva + + * configure.in: Check whether host and target makefile + fragments exist before adding them to *_makefile_frag. + +Wed Jan 14 23:39:10 1998 Bob Manson + + * configure.in (target_configdirs): Add cygmon for sparc64-elf. + +Wed Jan 14 12:48:07 1998 Keith Seitz + + * configure.in: Make sure we only replace RPATH_ENVVAR on + lines which begin with RPATH_ENVVAR, i.e. add "^" to the + regexp to sed. + + * Makefile.in (BASE_FLAGS_TO_PASS): Pass RRPATH_ENVVAR down + to sub-makes. + +1998-01-13 Lee Iverson (leei@ai.sri.com) + + * config-ml.in (multi-do): LDFLAGS must include multilib + designator. + +Tue Jan 13 01:13:24 1998 Robert Lipe (robertl@dgii.com) + + * config.guess: Recognize i[3456]-i586-UnixWare7-sysv5. + +Sun Jan 4 01:06:55 1998 Mumit Khan + + * config.sub: Add mingw32 support. + * configure.in: Likewise. + +Sat Jan 3 12:11:05 1998 Franz Sirl + + * configure.in: Finalize support for {alpha|powerpc}*-*-linux-gnulibc1 + +Sun Dec 28 11:28:58 1997 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (INSTALL_TARGET): Do install-gcc first. + * configure (gxx_include_dir): Provide a definition for subdirs + which do not use autoconf. + +Wed Dec 24 22:46:55 1997 Jeffrey A Law (law@cygnus.com) + + * config.guess: Sync with egcs. Picks up new alpha support, + BeOS & some additional linux support. + +Tue Dec 23 12:44:24 1997 Jeffrey A Law (law@cygnus.com) + + * config.guess: HP 9000/803 is a PA1.1 machine. + +Mon Dec 22 02:39:24 1997 Richard Henderson + + * configure.in: It's alpha*-... + +Sun Dec 21 16:53:12 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * configure.in (host_makefile_frag, target_makefile_frag): + Handle multiple config files. + (alpha-*-linux*): Treat alpha-*-linux* as alpha-*-linux* and + alpha-*-*. + +Thu Dec 18 13:13:03 1997 Doug Evans + + * mkdep: New file. + +Wed Dec 17 09:53:02 1997 Michael Meissner + + * configure.in (d30v-*-*): Allow configuring of libide, vmake, etc. + +Tue Dec 16 17:36:05 1997 Ian Lance Taylor + + * Makefile.in: Add libgui directory. + (GDB_TK): Add all-libgui. + * configure.in: Add libgui directory. + * configure: Add all-libgui to GDB_TK. + +Mon Dec 15 16:12:28 1997 Nick Clifton + + * config-ml.in (multidirs): Add m32r to multilib list. + +Fri Dec 12 10:43:31 1997 Brendan Kehoe + + * Makefile.in (all-target-gperf): Change dependency to + all-target-libstdc++. + +Thu Dec 11 23:30:51 1997 Fred Fish + + * config.guess: Add BeOS support. + +Wed Dec 10 15:10:38 1997 Ian Lance Taylor + + Source directory cvs renamed to cvssrc: + * configure.in (host_tools): Change cvs to cvssrc. + (native_only): Likewise. + (noconfigdirs) [various cases]: Likewise. + * Makefile.in (ALL_MODULES): Change all-cvs to all-cvssrc. + (CROSS_CHECK_MODULES): Change check-cvs to check-cvssrc. + (INSTALL_MODULES): Change install-cvs to install-cvssrc. + (CLEAN_MODULES): Change clean-cvs to clean-cvssrc. + (all-cvssrc): Rename target from all-cvs. + +Wed Dec 3 07:55:59 1997 Jeffrey A Law (law@cygnus.com) + + * configure (gxx_include_dir): Fix thinko. + +Tue Dec 2 10:55:34 1997 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (INSTALL_TARGET_CROSS): Define. + (install-cross, install-gcc-cross): New targets. + +Tue Dec 2 10:08:31 1997 Nick Clifton + + * configure.in (noconfigdirs): Add support for Thumb target. + + * config.sub (maybe_os): Add support for Thumb target. + +Sun Nov 30 16:12:27 1997 Bob Manson + + * Makefile.in: Add rules for cygmon. + + * configure.in: Build cygmon for sparc-elf and sparclite-aout. + +Thu Nov 27 01:31:30 1997 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (INSTALL_TARGET): Do install-gcc first. + * configure (gxx_include_dir): Provide a definition for subdirs + which do not use autoconf. + +Wed Nov 26 11:53:33 1997 Keith Seitz + + * Makefile.in, configure, configure.in, ChangeLog: merge with foundry's + 11/18/97 build + +Wed Nov 26 16:08:50 1997 Jeffrey A Law (law@cygnus.com) + + * From Franz Sirl. + * config.guess (powerpc*-*-linux): Handle glibc2 beta release + found on RedHat Linux systems. + +Fri Nov 21 09:51:01 1997 Jeffrey A Law (law@cygnus.com) + + * config.guess (alpha stuff): Merge with FSF to avoid incorrect + guesses. + +Thu Nov 13 11:38:37 1997 Jeffrey A Law (law@cygnus.com) + + * configure.in (i[3456]86-ncr-sysv4.3*): Tweak. + +Mon Nov 10 15:23:21 1997 H.J. Lu + + * ltmain.sh: If mkdir fails, check whether the directory was created + anyhow by some other process. + +Mon Nov 10 14:38:03 1997 Michael Meissner + + * configure.in (d30v-*-*): Configure all directories. + +Sun Nov 9 17:36:20 1997 Michael Meissner + + * configure.in (d30v-*-*): Configure newlib, libiberty directories + for the D30V. + +Sat Nov 8 14:42:59 1997 Michael Meissner + + * configure.in (d30v-*-*): Configure target-libgloss on the D30V. + +Fri Nov 7 10:34:09 1997 Rob Savoye + + * include/libiberty.h: Add extern "C" { so it can be used with C++ + progrms. + * include/remote-sim.h: Add extern "C" { so it can be used with C++ + programs. + +Thu Oct 30 11:09:29 1997 Michael Meissner + + * configure.in (d30v-*-*): Configure GCC now. + +Mon Oct 27 13:17:24 1997 Stan Shebs + + * configure.in: Remove a "second pass" of tweaking noconfigdirs, + is no longer needed. + +Mon Oct 27 12:03:53 1997 Jason Merrill + + * Makefile.in: check-target-libio depends on all-target-libstdc++. + +Sun Oct 26 11:48:27 1997 Manfred Hollstein (manfred@s-direktnet.de) + + * Makefile.in (bootstrap-lean): Combined with `normal' bootstrap + targets using "$@" to provide support for similar but not identical + targets without having to duplicate code. + +Mon Oct 20 15:28:49 1997 Klaus K"ampf + + * makefile.vms: Fix to work with DEC C. + +Tue Oct 7 23:58:57 1997 Gavin Koch + + * config.sub: Add mips-tx39-elf to marketing names. + +Tue Oct 7 14:24:41 1997 Ian Lance Taylor + + * ltmain.sh: Handle symlinks in generated script. + +Wed Oct 1 13:11:27 1997 Ian Lance Taylor + + * configure: Handle autoconf style directory options: --bindir, + --datadir, --includedir, --infodir, --libdir, --libexecdir, + --mandir, --oldincludedir, --sbindir, --sharedstatedir, + --sysconfdir. + * Makefile.in (sbindir, libexecdir, sysconfdir): New variables. + (sharedstatedir, localstatedir, oldincludedir): New variables. + (BASE_FLAGS_TO_PASS): Pass down bindir, datadir, includedir, + infodir, libdir, libexecdir, localstatedir, mandir, oldincludedir, + sbindir, sharedstatedir, and sysconfdir. + +Mon Sep 29 00:38:08 1997 Aaron Jackson + + * Makefile.in (bootstrap-lean): New target. + +Wed Sep 24 18:06:27 1997 Stu Grossman + + * configure.in (d30v): Remove tcl, tk, expect, gdb, itcl, tix, db, + sn, and gnuserv from noconfigdirs. + +Wed Sep 24 15:18:32 1997 Ian Lance Taylor + + * ltmain.sh: Tweak shell pattern to avoid bug in NetBSD /bin/sh. + +Thu Sep 18 23:58:27 1997 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (cross): New target. + +Thu Sep 18 21:43:23 1997 Alexandre Oliva + Jeff Law + + * Makefile.in (bootstrap2, bootstrap3): New targets. + (all-bootstrap): Remove outdated and confusing target. + (bootstrap, bootstrap2, bootstrap3): Don't pass BOOT_CFLAGS down. + +Thu Sep 18 15:37:42 1997 Andrew Cagney + + * configure (tooldir): enable_gdbtk=YES for cygwin32, NO for + windows. Consistent with gdb/configure. + +1997-09-15 02:37 Ulrich Drepper + + * configure.in: Name Linux target fragment. + + * configure: Rewrite so that project Makefile fragment is inserted + first and appears last in the resulting Makefile. + +Tue Sep 16 09:55:07 1997 Andrew Cagney + + * Makefile.in (install-itcl): Install tcl first. + +Fri Sep 12 16:19:20 1997 Geoffrey Noer + + * configure.in: remove bison from noconfigdirs for Cygwin32 host + +Thu Sep 11 16:40:46 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * Makefile.in (local-distclean): Also remove mh-frag mt-frag. + + * configure.in (skipdirs): Add target-librx for Linux. + (alpha-*-linux*): Use config/mh-elfalphapic and config/mt-elfalphapic. + +Wed Sep 10 21:29:54 1997 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (bootstrap): New target. + +Wed Sep 10 15:19:22 1997 Jeffrey A Law (law@cygnus.com) + + * config.sub: Accept 'amigados' for backward compatability. + +Mon Sep 8 20:46:20 1997 Ian Lance Taylor + + * config.guess: Merge with FSF. + +Sun Sep 7 23:18:32 1997 Fred Fish + + * config.sub: Change 'amigados' to 'amigaos' to match current usage. + +Sun Sep 7 15:55:28 1997 Gavin Koch + + * config.sub: Add "marketing-names" patch. + +Fri Sep 5 16:11:28 1997 Joel Sherrill (joel@OARcorp.com) + + * configure.in (*-*-rtems*): Do not build libgloss for rtems. + +Fri Sep 5 12:27:17 1997 Jeffrey A Law (law@cygnus.com) + + * config.sub: Handle v850-elf. + +Wed Sep 3 22:01:58 1997 Fred Fish + + * .cvsignore (*-install): Remove. + +Wed Sep 3 12:15:24 1997 Chris Provenzano + + * ltconfig: Set CONFIG_SHELL in libtool. + * ltmain.sh: Use CONFIG_SHELL instead of /bin/sh + +Mon Sep 1 16:45:44 1997 Jim Wilson + + * configure.in (target_subdir): Set to libraries if enable_multilib. + +Wed Aug 27 16:15:11 1997 Jim Wilson + + * config.guess: Update from gcc directory. + +Tue Aug 26 16:46:46 1997 Andrew Cagney + + * Makefile.in (all-sim): Depends on all-readline. + +Wed Aug 20 19:57:37 1997 Jason Merrill + + * Makefile.in (BISON, YACC): Use $$s. + (all-bison): Depend on all-texinfo. + +Tue Aug 19 01:41:32 1997 Jason Merrill + + * Makefile.in (BISON): Add -L flag. + (YACC): Likewise. + +Mon Aug 18 11:30:50 1997 Nick Clifton + + * configure.in (noconfigdirs): Add support for v850e target. + + * config.sub (maybe_os): Add support for v850e target. + +Mon Aug 18 11:30:50 1997 Nick Clifton + + * configure.in (noconfigdirs): Add support for v850ea target. + + * config.sub (maybe_os): Add support for v850ea target. + +Mon Aug 18 09:24:06 1997 Gavin Koch + + * config.sub: Add mipstx39. Delete r3900. + +Mon Aug 18 17:20:10 1997 Jason Molenda (crash@godzilla.cygnus.co.jp) + + * Makefile.in (all-autoconf): Depends on all-texinfo. + +Fri Aug 15 23:09:26 1997 Michael Meissner + + * config-ml.in ({powerpc,rs6000}*-*-*): Update to current AIX and + eabi targets. + +Thu Aug 14 14:42:17 1997 Ian Lance Taylor + + * configure: Get CFLAGS and CXXFLAGS from Makefile, if possible. + + * configure: When handling a Canadian Cross, handle YACC as well as + BISON. Just set BISON to bison. When setting YACC, prefer bison. + * Makefile.in (all-bison): Depend upon all-texinfo. + +Tue Aug 12 20:09:48 1997 Jason Merrill + + * Makefile.in (BISON): bison, not byacc or bison -y. + (YACC): bison -y or byacc or yacc. + (various): Add *-bison as appropriate. + (taz): No need to mess with BISON anymore. + +Tue Aug 12 22:33:08 1997 Ian Lance Taylor + + * configure: If OSTYPE matches *win32*, try to find a good value for + CONFIG_SHELL. + +Sun Aug 10 14:41:11 1997 Ian Lance Taylor + + * Makefile.in (taz): Get the version number from AM_INIT_AUTOMAKE in + configure.in if it is present. + +Sat Aug 9 00:58:01 1997 Ian Lance Taylor + + * Makefile.in (LD_FOR_TARGET): Change ld.new to ld-new. + +Fri Aug 8 16:30:13 1997 Doug Evans + + * config.sub: Recognize `arc' cpu. + * configure.in: Likewise. + * config-ml.in: Likewise. + +Thu Aug 7 11:02:34 1997 Ian Lance Taylor + + * Makefile.in ($(INSTALL_X11_MODULES)): Depend upon installdirs. + +Wed Aug 6 16:27:29 1997 Chris Provenzano + + * configure: Changed sed delimiter from ':' to '|' when + attempting to substitute ${config_shell} for SHELL. On + NT ${config_shell} may contain a ':' in it. + +Wed Aug 6 12:29:05 1997 Jason Merrill + + * Makefile.in (EXTRA_GCC_FLAGS): Fix for non-bash shells. + +Wed Aug 6 00:42:35 1997 Ian Lance Taylor + + * Makefile.in (AS_FOR_TARGET): Change as.new to as-new. + +Tue Aug 5 14:08:51 1997 Ian Lance Taylor + + * Makefile.in (NM_FOR_TARGET): Change nm.new to nm-new. + + * ylwrap: If the program is a relative path, force it to be + absolute. + +Tue Aug 5 12:12:44 1997 Andrew Cagney + + * configure (tooldir): Set BISON to `bison -y' and not just bison. + +Mon Aug 4 22:59:02 1997 Andrew Cagney + + * Makefile.in (CC_FOR_TARGET): When winsup/Makefile present, + correctly specify the target build directory $(TARGET_SUBDIR)/winsup + for libraries. + +Mon Aug 4 12:40:24 1997 Jason Merrill + + * Makefile.in (EXTRA_GCC_FLAGS): Fix handling of macros with values + separated by spaces. + +Thu Jul 31 19:49:49 1997 Ian Lance Taylor + + * ylwrap: New file. + * Makefile.in (DEVO_SUPPORT): Add ylwrap. + + * ltmain.sh: Handle /bin/sh at start of install program. + + * Makefile.in (DEVO_SUPPORT): Add ltconfig, ltmain.sh, and missing. + + * ltconfig, ltmain.sh: New files, from libtool 1.0. + * missing: New file, from automake 1.2. + +Thu Jul 24 12:57:56 1997 Ian Lance Taylor + + * Makefile.in: Treat tix like tk, putting it in X11_MODULES. Add + check-tk to CHECK_X11_MODULES. + +Wed Jul 23 17:03:29 1997 Ian Lance Taylor + + * config.sub: Merge with FSF. + +Tue Jul 22 19:08:29 1997 Ian Lance Taylor + + * config.guess: Merge with FSF. + +Tue Jul 22 14:50:42 1997 Robert Hoehne + + * configure: Treat msdosdjgpp like go32. + * configure.in: Likewise. Don't remove gprof for go32. + + * configure: Change Makefile.tem2 to Makefile.tm2. + +Mon Jul 21 10:31:26 1997 Stephen Peters + + * configure.in (noconfigdirs): For alpha-dec-osf*, don't ignore grep. + +Tue Jul 15 14:33:03 1997 Brendan Kehoe + + * install-sh (chmodcmd): Set to null if the DST directory already + exists. Same as Nov 11th change. + +Mon Jul 14 11:01:15 1997 Martin M. Hunt + + * configure (GDB_TK): Needs itcl and tix. + +Mon Jul 14 00:32:10 1997 Jason Merrill + + * config.guess: Update from FSF. + +Fri Jul 11 11:57:11 1997 Martin M. Hunt + + * Makefile.in (GDB_TK): Depend on itcl and tix. + +Fri Jul 4 13:25:31 1997 Ian Lance Taylor + + * Makefile.in (INSTALL_PROGRAM_ARGS): New variable. + (INSTALL_PROGRAM): Use $(INSTALL_PROGRAM_ARGS). + (INSTALL_SCRIPT): New variable. + (BASE_FLAGS_TO_PASS): Pass down INSTALL_SCRIPT. + * configure.in: If host is *-*-cygwin32*, set INSTALL_PROGRAM_ARGS + to -x. + * install-sh: Add support for -x option. + +Mon Jun 30 15:51:30 1997 Ian Lance Taylor + + * configure.in, Makefile.in: Treat tix like itcl. + +Thu Jun 26 13:59:19 1997 Ian Lance Taylor + + * Makefile.in (WINDRES): New variable. + (WINDRES_FOR_TARGET): New variable. + (BASE_FLAGS_TO_PASS): Add WINDRES_FOR_TARGET. + (EXTRA_HOST_FLAGS): Add WINDRES. + (EXTRA_TARGET_FLAGS): Add WINDRES. + (EXTRA_GCC_FLAGS): Add WINDRES. + ($(DO_X)): Pass down WINDRES. + ($(CONFIGURE_TARGET_MODULES)): Set WINDRES when configuring. + * configure: Treat WINDRES like DLLTOOL, and WINDRES_FOR_TARGET like + DLLTOOL_FOR_TARGET. + +Wed Jun 25 15:01:26 1997 Felix Lee + + * configure.in: configure sim before gdb for win32-x-ppc + +Wed Jun 25 12:18:54 1997 Brendan Kehoe + + Move gperf into the toplevel, from libg++. + * configure.in (target_tools): Add target-gperf. + (native_only): Add target-gperf. + * Makefile.in (all-target-gperf): New target, depend on + all-target-libg++. + (configure-target-gperf): Empty rule. + (ALL_TARGET_MODULES): Add all-target-gperf. + (CONFIGURE_TARGET_MODULES): Add configure-target-gperf. + (CHECK_TARGET_MODULES): Add check-target-gperf. + (INSTALL_TARGET_MODULES): Add install-target-gperf. + (CLEAN_TARGET_MODULES): Add clean-target-gperf. + +Mon Jun 23 10:51:53 1997 Jeffrey A Law (law@cygnus.com) + + * config.sub (mn10200): Recognize new basic machine. + +Thu Jun 19 14:16:42 1997 Brendan Kehoe + + * configure.in: Don't set ENABLE_MULTILIB, so we'll be passing + --enable-multilib down to subdirs; setting TARGET_SUBDIR was enough. + +Tue Jun 17 15:31:20 1997 Brendan Kehoe + + * configure.in: If we're building mips-sgi-irix6* native, turn on + ENABLE_MULTILIB and set TARGET_SUBDIR. + +Tue Jun 17 12:20:59 1997 Tom Tromey + + * Makefile.in (all-sn): Depend on all-grep. + +Mon Jun 16 11:11:10 1997 Ian Lance Taylor + + * configure.in: Use mh-ppcpic and mt-ppcpic for powerpc*-* targets. + + * configure: Set CFLAGS and CXXFLAGS, and substitute them into + Makefile. From Jeff Makey . + * Makefile.in: Add comment for CFLAGS and CXXFLAGS. + + * Makefile.in (DISTBISONFILES): Remove. + (taz): Don't futz with DISTBISONFILES. Change BISON to use + $(DEFAULT_YACC). + + * configure.in: Build itl, db, sn, etc., when building for native + cygwin32. + + * Makefile.in (LD): New variable. + (EXTRA_HOST_FLAGS): Pass down LD. + ($(DO_X)): Likewise. + +Mon Jun 16 11:10:35 1997 Philip Blundell + + * Makefile.in (INSTALL): Use $(SHELL) when executing install-sh. + +Fri Jun 13 10:22:56 1997 Bob Manson + + * configure.in (targargs): Strip out any supplied --build argument + before adding our own. Always add --build. + +Thu Jun 12 21:12:28 1997 Bob Manson + + * configure.in (targargs): Pass --build if we're doing + a cross-compile. + +Fri Jun 6 21:38:40 1997 Rob Savoye + + * configure: Use '|' instead of ":" as the separator in + sed. Otherwise sed chokes on NT path names with drive + designators. Also look for "?:*" as the leading characters in an + absolute pathname. + +Mon Jun 2 13:05:20 1997 Gavin Koch + + * config.sub: Support for r3900. + +Wed May 21 17:33:31 1997 Ian Lance Taylor + + * configure.in: Use install-sh, not install.sh. + +Wed May 14 16:06:51 1997 Ian Lance Taylor + + * Makefile.in (taz): Improve check for BISON so it doesn't try to + apply it twice. + +Fri May 9 17:22:05 1997 Ian Lance Taylor + + * Makefile.in (INSTALL_MODULES): Put install-opcodes before + install-binutils. + +Thu May 8 17:29:50 1997 Ian Lance Taylor + + * Makefile.in: Add automake targets. + * configure.in (host_tools): Add automake. + +Tue May 6 15:49:52 1997 Ian Lance Taylor + + * configure: Default CXX to c++, not gcc. + * Makefile.in (CXX): Set to c++, not gcc. + (CXX_FOR_TARGET): When cross, transform c++, not gcc. + +Thu May 1 10:11:43 1997 Geoffrey Noer + + * install-sh: try appending a .exe if source file doesn't + exist + +Wed Apr 30 12:05:36 1997 Jason Merrill + + * configure.in: Turn on multilib by default. + (cross_only): Remove target-libiberty. + + * Makefile.in (all-gcc): Don't depend on libiberty. + +Mon Apr 28 18:39:45 1997 Michael Snyder + + * config.guess: improve algorithm for recognizing Gnu Hurd x86. + +Thu Apr 24 19:30:07 1997 Ian Lance Taylor + + * Makefile.in (DEVO_SUPPORT): Add mpw-install. + (DISTBISONFILES): Add ld/Makefile.in + +Tue Apr 22 17:17:28 1997 Geoffrey Noer + + * configure.in: if target is cygwin32 but host isn't cygwin32, + don't configure gdb tcl tk expect, not just gdb. + +Mon Apr 21 13:33:39 1997 Tom Tromey + + * configure.in: Added gnuserv everywhere sn appears. + + * Makefile.in (ALL_MODULES): Added all-gnuserv. + (CROSS_CHECK_MODULES): Added check-gnuserv. + (INSTALL_MODULES): Added install-gnuserv. + (CLEAN_MODULES): Added clean-gnuserv. + (all-gnuserv): New target. + +Thu Apr 17 13:57:06 1997 Per Fogelstrom + + * config.guess: Fixes for MIPS OpenBSD systems. + +Tue Apr 15 12:21:07 1997 Ian Lance Taylor + + * Makefile.in (INSTALL_XFORM): Remove. + (BASE_FLAGS_TO_PASS): Remove INSTALL_XFORM. + + * mkinstalldirs: New file, copied from automake. + * Makefile.in (installdirs): Rename from install-dirs. Use + mkinstalldirs. Change all users. + (DEVO_SUPPORT): Add mkinstalldirs. + +Mon Apr 14 11:21:38 1997 Ian Lance Taylor + + * install-sh: Rename from install.sh. + * Makefile.in (INSTALL): Change install.sh to install-sh. + (DEVO_SUPPORT): Likewise. + + * configure: Use ${config_shell} with ${moveifchange}. From Thomas + Graichen . + +Fri Apr 11 16:37:10 1997 Niklas Hallqvist + + * config.guess: Recognize OpenBSD systems correctly. + +Fri Apr 11 17:07:04 1997 Jason Molenda (crash@godzilla.cygnus.co.jp) + + * README, Makefile.in (ETC_SUPPORT): Remove references to + cfg-paper*, configure.{texi,man,info*}._ + +Sun Apr 6 18:47:57 1997 Andrew Cagney + + * Makefile.in (all.normal): Ensure that gcc is built after all + the x11 - ie gdb - targets. + +Tue Apr 1 16:28:50 1997 Klaus Kaempf + + * makefile.vms: Don't run conf-a-gas. + +Mon Mar 31 16:26:55 1997 Joel Sherrill + + * configure.in (hppa1.1-*-rtems*): New target, like hppa-*-*elf*. + +Sun Mar 30 12:38:27 1997 Fred Fish + + * configure.in: Remove noconfigdirs case since gdb also + configures and builds for tic80-coff. + +Fri Mar 28 18:28:52 1997 Ian Lance Taylor + + * configure: Set cache_file to config.cache. + * Makefile.in (local-distclean): Remove config.cache. + +Wed Mar 26 18:49:39 1997 Ian Lance Taylor + + * COPYING: Update FSF address. + +Wed Mar 26 10:38:25 1997 Michael Meissner + + * configure.in (tic80-*-*): Remove G++ libraries and libgloss from + noconfigdirs. + +Mon Mar 24 15:02:39 1997 Ian Lance Taylor + + * Makefile.in (install-dirs): Don't crash if prefix, and hence + MAKEDIRS, is empty. + +Mon Mar 24 12:40:55 1997 Doug Evans + + * config.sub: Tweak mn10300 entry. + +Fri Mar 21 15:35:27 1997 Michael Meissner + + * configure.in (host_tools): Put sim before gdb, so gdb's + configure.tgt can determine if the simulator was configured. + +Sun Mar 16 16:07:08 1997 Fred Fish + + * config.sub: Move BeOS $os case to be with other Cygnus + local cases. + +Sun Mar 16 01:34:55 1997 Martin Hunt + + * config.sub: Remove misplaced comment that broke Linux. + +Sat Mar 15 22:50:15 1997 Fred Fish + + * config.sub: Add BeOS support. + +Mon Mar 10 13:30:11 1997 Tom Tromey + + * Makefile.in (CHECK_X11_MODULES): Don't run check-tk. + +Wed Mar 5 12:09:29 1997 Martin + + * configure.in (noconfigdirs): Remove tcl and tk from + noconfigdirs for cygwin32 builds. + +Fri Feb 28 18:20:15 1997 Fred Fish + + * configure.in (tic80-*-*): Remove ld from noconfigdirs. + +Thu Feb 27 14:57:26 1997 Ken Raeburn + + * Makefile.in (GAS_SUPPORT_DIRS, BINUTILS_SUPPORT_DIRS): Remove + make-all.com, use makefile.vms instead. + +Tue Feb 25 18:46:14 1997 Stan Shebs + + * config.sub: Accept -lnews*. + +Tue Feb 25 13:19:14 1997 Andrew Cagney + + * configure.in (noconfigdirs): Disable target-newlib, + target-examples and target-libiberty for d30v. + +Fri Feb 21 17:56:25 1997 Martin M. Hunt + + * configure.in (noconfigdirs): Enable ld for d30v. + +Fri Feb 21 20:58:51 1997 Michael Meissner + + * configure.in (tic80-*-*): Build compiler. + +Sun Feb 16 15:41:09 1997 Andrew Cagney + + * configure.in (d30v-*): Remove sim directory from list of + unsupported d30v directories + +Tue Feb 18 17:32:42 1997 Martin M. Hunt + + * config.sub, configure.in: Add d30v target cpu. + +Thu Feb 13 22:04:44 1997 Klaus Kaempf + + * makefile.vms: New file. + * make-all.com: Remove. + +Wed Feb 12 12:54:18 1997 Jim Wilson + + * Makefile.in (EXTRA_GCC_FLAGS): Add LIBGCC2_DEBUG_CFLAGS. + +Sat Feb 8 20:36:49 1997 Michael Meissner + + * Makefile.in (all-itcl): The rule is all-itcl, not all-tcl. + +Tue Feb 4 11:39:29 1997 Tom Tromey + + * Makefile.in (ALL_MODULES): Added all-db. + (CROSS_CHECK_MODULES): Addec check-db. + (INSTALL_MODULES): Added install-db. + (CLEAN_MODULES): Added clean-db. + +Mon Feb 3 13:29:36 1997 Ian Lance Taylor + + * config.guess: Merge with latest FSF sources. + +Tue Jan 28 09:20:37 1997 Tom Tromey + + * Makefile.in (ALL_MODULES): Added all-itcl. + (CROSS_CHECK_MODULES): Added check-itcl. + (INSTALL_MODULES): Added install-itcl. + (CLEAN_MODULES): Added clean-itcl. + +Thu Jan 23 01:44:27 1997 Geoffrey Noer + + * configure.in: build gdb for mn10200 + +Fri Jan 17 15:32:15 1997 Doug Evans + + * Makefile.in (all-target-winsup): Depend on all-target-libio. + +Mon Jan 13 22:46:54 1997 Michael Meissner + + * configure.in (tic80-*-*): Turn off most targets right now. + +Fri Jan 3 16:04:03 1997 Ian Lance Taylor + + * Makefile.in (MAKEINFO): Check for the existence of the Makefile, + rather than the makeinfo program. + (do-info): Depend upon all-texinfo. + +Tue Dec 31 16:00:31 1996 Ian Lance Taylor + + * configure.in: Remove uses of config/mh-linux. + + * config.sub, config.guess: Merge with latest FSF sources. + +Fri Dec 27 23:04:33 1996 Fred Fish + + * config.sub (case $basic_machine): Add tic80 entries. + +Fri Dec 27 12:07:59 1996 Ian Lance Taylor + + * config.sub, config.guess: Merge with latest FSF sources. + +Wed Dec 18 22:46:39 1996 Stan Shebs + + * mpw-build.in: Build ld before gcc, use NewFolderRecursive. + * mpw-config.in: Test for NewFolderRecursive. + * mpw-install: Use symbolic name for startup filename. + * mpw-README: Add various additional details. + +Wed Dec 18 13:11:46 1996 Jim Wilson + + * configure.in (mips*-sgi-irix6*): Remove binutils from noconfigdirs. + +Wed Dec 18 10:29:31 1996 Jeffrey A Law (law@cygnus.com) + + * configure.in: Do build gcc and the target libraries for + the mn10200. + +Wed Dec 4 16:53:05 1996 Geoffrey Noer + + * configure.in: don't avoid building gdb for mn10300 any more + * Makefile.in: double-quote GCC_FOR_TARGET line in EXTRA_GCC_FLAGS + instead of single-quoting it. + +Tue Dec 3 23:26:50 1996 Jason Merrill + + * configure.in: Don't use --with-stabs on IRIX 6. + +Tue Dec 3 09:05:25 1996 Doug Evans + + * configure.in (m32r): Build gdb, libg++ now. + +Sun Dec 1 00:18:59 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * configure.in (mips*-sgi-irix6*): Remove gdb and related + directories from noconfigdirs. + +Tue Nov 26 11:45:33 1996 Kim Knuttila + + * config.sub (basic_machine): added mips16 configuration + +Sat Nov 23 19:26:22 1996 Michael Meissner + + * config.sub: Handle d10v-unknown. + +Sat Nov 23 10:23:01 1996 Gavin Koch + + * config.sub: Handle v850-unknown. + +Thu Nov 21 16:19:44 1996 Geoffrey Noer + + * Makefile.in: add findutils + * configure.in: add findutils to list of host_tools + +Wed Nov 20 10:09:01 1996 Jeffrey A Law (law@cygnus.com) + + * config.sub: Handle mn10200 and mn10300. + +Tue Nov 19 16:35:14 1996 Michael Meissner + + * configure.in (d10v-*): Do not build librx. + +Mon Nov 18 13:28:41 1996 Jeffrey A Law (law@cygnus.com) + + * configure.in (mn10300): Build everything except gdb & libgloss. + +Wed Nov 13 14:59:46 1996 Per Bothner + + * config.guess: Patch for Dansk Data Elektronik servers, + from Niels Skou Olsen . + + For ncr, use /bin/uname rather than uname, since GNU uname does not + support -p. Suggested by Mark Mitchell . + + Patch for MIPS R4000 running System V, + from Eric S. Raymond . + + Fix thinko for nextstep. + + Patch for OSF1 in i?86, from Dan Murphy via Harlan Stenn. + + Sat Jun 24 18:58:17 1995 Morten Welinder + * config.guess: Guess mips-dec-mach_bsd4.3. + + Thu Oct 10 04:07:04 1996 Harlan Stenn + * config.guess (i?86-ncr-sysv*): Emit just enough of the minor + release numbers. + * config.guess (mips-mips-riscos*): Emit just enough of the + release number. + + Tue Oct 8 10:37:22 1996 Frank Vance + * config.guess (sparc-auspex-sunos*): Added. + (f300-fujitsu-*): Added. + + Wed Sep 25 22:00:35 1996 Jeff Woolsey + * config.guess: Recognize a Tadpole as a sparc. + +Wed Nov 13 00:53:09 1996 David J. MacKenzie + + * config.guess: Don't assume that NextStep version is either 2 or + 3. NextStep 4 (aka OpenStep 4) has come out now. + +Mon Nov 11 23:52:03 1996 David J. MacKenzie + + * config.guess: Support Cray T90 that reports itself as "CRAY TS". + From Rik Faith . + +Fri Nov 8 11:34:58 1996 David J. MacKenzie + + * config.sub: Contributions from bug-gnu-utils to: + Support plain "hppa" (no version given) architecture, reported by + OpenStep. + OpenBSD like NetBSD. + LynxOs is not a hardware supplier. + + * config.guess: Contributions from bug-gnu-utils to add support for: + OpenBSD like NetBSD. + Stratus systems. + More Pyramid systems. + i[n>4]86 Intel chips. + M680[n>4]0 Motorola chips. + Use unknown instead of lynx for hardware manufacturer. + +Mon Nov 11 10:09:08 1996 Brendan Kehoe + + * install.sh (chmodcmd): Set to null if the DST directory already + exists. + +Mon Nov 11 10:43:41 1996 Michael Meissner + + * configure.in (powerpc*-{eabi,elf,linux,rtem,sysv,solaris}*): Do + not use mt-ppc target Makefile fragment any more. + +Sun Nov 3 19:17:07 1996 Stu Grossman (grossman@critters.cygnus.com) + + * configure.in (*-*-windows): Exclude everything but those dirs + needed to build windows. + +Tue Oct 29 16:41:31 1996 Doug Evans + + * Makefile.in (all-target-winsup): Depend on all-target-librx. + +Mon Oct 28 17:32:46 1996 Stu Grossman (grossman@critters.cygnus.com) + + * configure.in: Exclude mmalloc from i386-windows. + +Thu Oct 24 09:22:46 1996 Stu Grossman (grossman@critters.cygnus.com) + + * Undo my previous change. + +Thu Oct 24 12:12:04 1996 Ian Lance Taylor + + * Makefile.in (EXTRA_GCC_FLAGS): Pass down GCC_FOR_TARGET + unconditionally. + (MAKEOVERRIDES): Define (revert this part of October 18 change). + +Thu Oct 24 09:02:07 1996 Stu Grossman (grossman@critters.cygnus.com) + + * Makefile.in (FLAGS_TO_PASS): Add $(HOST_FLAGS) to allow the + host to add it's own flags. + +Tue Oct 22 15:20:26 1996 Ian Lance Taylor + + * configure: Handle GCC_FOR_TARGET like CC_FOR_TARGET. + +Fri Oct 18 13:37:13 1996 Ian Lance Taylor + + * Makefile.in (CC_FOR_TARGET): Check for xgcc, not Makefile. + (CXX_FOR_TARGET): Likewise. + (GCC_FOR_TARGET): Define. + (BASE_FLAGS_TO_PASS): Remove GCC_FOR_TARGET. + (EXTRA_GCC_FLAGS): Define GCC_FOR_TARGET based on whether + CC_FOR_TARGET was specified on the command line. + (MAKEOVERRIDES): Don't define. + +Thu Oct 17 10:27:56 1996 Doug Evans + + * configure.in (m32r): Fix spelling of libg++ libs. + +Thu Oct 10 10:37:17 1996 Stan Shebs + + * config.sub (-apple*): Remove, now redundant. + +Thu Oct 10 12:30:54 1996 Ian Lance Taylor + + * configure: Don't get confused by CPU-VENDOR-linux-gnu. + + * configure: Rework yesterday's sed script patch. + + * config.sub: Merge with FSF. + +Wed Oct 9 17:24:59 1996 Per Bothner + + * config.guess: Merge from FSF. + + 1996-09-12 Richard Stallman + * config.guess: Use pc instead of unknown, for pc clone systems. + Change linux to linux-gnu. + + Mon Jul 15 23:51:11 1996 Karl Heuer + * config.guess: Avoid non-portable tr syntax. + +Wed Oct 9 06:06:46 1996 Jeffrey A Law (law@cygnus.com) + + * test-build.mk (HOLES): Add "xargs" for gdb. + + * configure: Avoid hpux10.20 sed bug. + +Tue Oct 8 08:32:48 1996 Stu Grossman (grossman@critters.cygnus.com) + + * configure.in: Add support for windows host + (that is a build done under the Microsoft build environment). + +Tue Oct 8 10:39:08 1996 Ian Lance Taylor + + * Makefile.in: Replace all uses of srcroot with s, to shrink + command line lengths. + + Patches from Geoffrey Noer : + * configure.in: If configuring for newlib, pass --with-newlib to + subdirectories. + * Makefile.in (CC_FOR_TARGET): If winsup/Makefile exists, pass a + -Bnewlib/ and -Lwinsup to gcc. + (CXX_FOR_TARGET): Likewise. + +Mon Oct 7 10:59:35 1996 Ian Lance Taylor + + * Makefile.in (ETC_SUPPORT): Add configure. + +Fri Oct 4 12:22:58 1996 Angela Marie Thomas (angela@cygnus.com) + + * configure.in: Use config/mh-dgux386 for i[345]86-dg-dgux + host configuration file. + +Thu Oct 3 09:28:25 1996 Jeffrey A Law (law@cygnus.com) + + * configure.in: Break mn10x00 support into separate + mn10200 and mn10300 configurations. + * config.sub: Likewise. + +Wed Oct 2 22:27:52 1996 Jeffrey A Law (law@cygnus.com) + + * configure.in: Add lots of stuff to noconfigdirs for + the mn10x00 targets. + + * config.sub, configure.in: Add mn10x00 support. + +Wed Oct 2 15:52:36 1996 Klaus Kaempf + + * make-all.com: Call conf-a-gas, not config-a-gas. + +Tue Oct 1 01:28:41 1996 James G. Smith + + * configure.in (noconfigdirs): Don't build libgloss for arm-coff + targets. + +Mon Sep 30 14:24:01 1996 Stan Shebs + + * mpw-README: Add much more detail for native PowerMac. + * mpw-install: New file. + * mpw-configure: Add --norecursion and --help options. + * mpw-config.in: Translate readme and install files when + copying to objdir. + * mpw-build.in: Don't always depend on byacc and flex. + (install-only-top): New action. + +Fri Sep 27 17:39:44 1996 Stu Grossman (grossman@critters.cygnus.com) + + * configure.in: You can now configure GDB for the v850. + +Tue Sep 24 19:05:12 1996 Stan Shebs + + * configure.in (noconfigdirs): Don't configure any C++ dirs + if targeting D10V. + +Tue Sep 17 12:15:31 1996 Ian Lance Taylor + + * config.sub: Recognize mips64vr5000. + +Mon Sep 16 17:00:52 1996 Ian Lance Taylor + + * configure.in: Use a single line for host_tools and native_only. + +Mon Sep 9 12:21:30 1996 Doug Evans + + * config.sub, configure.in: Add entries for m32r. + +Thu Sep 5 13:52:47 1996 Tom Tromey + + * Makefile.in (inet-install): Don't run install-gzip. + +Wed Sep 4 17:26:13 1996 Stu Grossman (grossman@critters.cygnus.com) + + * configure.in: Don't config lots of things for *-*-windows*. + +Sat Aug 31 11:45:57 1996 Stan Shebs + + * mpw-config.in: Test for mpw-true, true, and null-command scripts. + (host_libs, host_tools): Copy from configure.in. + * mpw-configure: Don't complain about directories not found. + +Thu Aug 29 16:44:58 1996 Michael Meissner + + * configure.in (i[345]86): Recognize i686 for pentium pro. + (i[3456]86-*-dgux*): Use config/mh-sysv for the host configuration + file. + + * config.guess (i[345]86): Ditto. + +Mon Aug 26 18:34:42 1996 Martin M. Hunt + + * configure.in (noconfigdirs): Removed gdb for D10V. + +Thu Aug 22 17:13:52 1996 Jeffrey A Law (law@cygnus.com) + + * configure.in: Remove ld, target-libio, target-libg++, and + target-libstdc++ from noconfigdirs. + +Wed Aug 21 18:56:38 1996 Fred Fish + + * configure: Fix three locations where shell scripts were + being run directly rather than with config_shell. + +Tue Aug 20 13:08:47 1996 J.T. Conklin + + * configure.in (v850-*-*): Set up initial $noconfigdirs. + * config.sub (basic_machine): Recognize v850. + +Thu Aug 15 12:19:33 1996 Stan Shebs + + * mpw-configure: Handle multiple enable/disable options and + pass them down recursively, handle -c and -s flags appropriately + depending on choice of compiler, add escape mechanism for + quoted arguments to gC. + +Mon Aug 12 13:15:13 1996 Michael Meissner + + * configure.in (powerpc*-*-*): For eabi, system V.4, Linux, and + solaris targets, use config/mt-ppc to set C{,XX}FLAGS_FOR_TARGETS + so that -mrelocatable-lib and -mno-eabi are used. + + * Makefile.in (CONFIGURE_TARGET_MODULES): If target compiler does + not support --print-multi-lib, don't abort. + +Thu Aug 8 12:18:59 1996 Klaus Kaempf + + * make-all.com: Run config-a-gas. + * setup.com: Don't copy subdirectory files around. + +Tue Jul 30 17:49:31 1996 Brendan Kehoe + + * configure.in (*-*-ose): Remove exclusion of libgloss for this + target, it now compiles correctly. + +Sat Jul 27 15:10:43 1996 Stan Shebs + + * mpw-config.in: Generate Mac include for elf/dwarf2.h. + +Tue Jul 23 10:47:04 1996 Martin M. Hunt + + * configure.in (d10v-*-*): Remove ld from $noconfigdirs. + +Mon Jul 22 13:28:51 1996 Brendan Kehoe + + * configure.in (native_only): Add prms. + +Mon Jul 22 12:27:58 1996 Ian Lance Taylor + + * Makefile.in (GAS_SUPPORT_DIRS): Add make-all.com and setup.com. + (BINUTILS_SUPPORT_DIRS): Likewise. + +Thu Jul 18 12:55:40 1996 Michael Meissner + + * configure.in (d10v-*-*): Don't configure ld or gdb until the + d10v support is added. + +Wed Jul 17 14:33:09 1996 Martin M. Hunt + + * configure.in (d10v-*-*): New target. + +Mon Jul 15 11:53:00 1996 Jeffrey A Law (law@cygnus.com) + + * config.guess (HP 9000/811): Recognize this as a PA1.1 + machine. + +Fri Jul 12 23:21:17 1996 Ken Raeburn + + * Makefile.in (do-tar-gz): New target, split out from tail end of + taz target. Run each command separately, don't use pipes. + (taz): Use it. + +Fri Jul 12 12:08:04 1996 Stan Shebs + + * mpw-configure: Look for g-mpw-make.sed in config/mpw. + * mpw-build.in: No builds should depend on building byacc or flex, + they are assumed to be installed already. + +Fri Jul 12 09:52:52 1996 Michael Meissner + + * Makefile.in (CONFIGURE_TARGET_MODULES): Set r environment + variable that CC_FOR_TARGET needs. + +Thu Jul 11 10:09:45 1996 Michael Meissner + + * Makefile.in (CONFIGURE_TARGET_MODULES): Determine if the multlib + options have changed since the last time the subdirectory was + configured, and if it has, reconfigure. + (CLEAN_TARGET_MODULES): Delete multilib.out and tmpmulti.out, which + CONFIGURE_TARGET_MODULES uses to remember the old multilib options. + +Wed Jul 10 18:56:59 1996 Doug Evans + + * Makefile.in (ALL_MODULES,CROSS_CHECK_MODULES,INSTALL_MODULES, + CLEAN_MODULES): Add bash. + (all-bash): New target. + +Mon Jul 8 17:33:14 1996 Jim Wilson + + * configure.in (mips-sgi-irix6*): Use mh-irix6 instead of mh-irix5. + +Mon Jul 1 13:31:35 1996 Michael Meissner + + * config.sub (basic_machine): Recognize d10v as a valid processor. + +Fri Jun 28 12:14:35 1996 Stan Shebs + + * mpw-configure: Add support for --bindir. + * mpw-build.in: Use a GCC-specific build script for GCC actions. + +Wed Jun 26 17:20:12 1996 Geoffrey Noer + + * configure.in: add bash, time, gawk to list of hosttools and things + to only build for native toolchains + +Tue Jun 25 23:09:03 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) + + * Makefile.in (docdir): Remove. + +Tue Jun 25 19:00:08 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) + + * Makefile.in (datadir): Set to $(prefix)/share. + +Mon Jun 24 23:26:07 1996 Geoffrey Noer + + * configure.in: build diff and patch for cygwin32-hosted + toolchains. + +Mon Jun 24 15:01:12 1996 Joel Sherrill + + * config.sub: Accept -rtems*. + +Sun Jun 23 22:41:54 1996 Geoffrey Noer + + * configure.in: enable dosrel for cygwin32-hosted builds, + remove diff from the list of things not buildable + via Canadian Cross + +Sat Jun 22 11:39:01 1996 Jason Merrill + + * Makefile.in (TARGET_SUBDIR): Move comment to previous line so we + don't get ". ". + +Fri Jun 21 17:24:48 1996 Jim Wilson + + * configure.in (mips*-sgi-irix6*): Set noconfigdirs appropriately. + +Thu Jun 20 16:57:40 1996 Ken Raeburn + + * Makefile.in (taz): Handle case where tex3patch didn't even get + checked out. Also, if it was found, put the symlink in a new util + subdirectory. + +Thu Jun 20 12:20:33 1996 Michael Meissner + + * config.guess (*:Linux:*:*): Add support for PowerPC Linux. + +Tue Jun 18 14:24:12 1996 Klaus Kaempf (kkaempf@progis.de) + + * config.sub: Recognize -openvms. + * configure.in (alpha*-*-*vms*): Set noconfigdirs. + * make-all.com, setup.com: New files. + +Mon Jun 17 16:34:46 1996 Jason Merrill + + * Makefile.in (taz): tex3patch moved to texinfo/util. + +Sat Jun 15 17:13:25 1996 Geoffrey Noer + + * configure: enable_gdbtk=no for cygwin32-hosted toolchains + * configure.in: remove make from disable-if-Can-Cross list + enable gdb if ${host} and ${target} are cygwin32 + +Fri Jun 7 18:16:52 1996 Harlan Stenn + + * config.guess (i?86-ncr-sysv*): Emit minor release numbers. + Recognize the NCR 4850 machine and NCR Pentium-based platforms. + +Wed Jun 5 00:09:17 1996 Per Bothner + + * config.guess: Combine mips-mips-riscos cases, and use cpp to + distinguish sysv/svr4/bsd variants. + Based on a patch from Harlan Stenn . + +Fri Jun 7 14:24:49 1996 Tom Tromey + + * configure.in: Added copyright notice. + * move-if-change: Added copyright notice. + +Thu Jun 6 16:27:05 1996 Michael Meissner + + * configure.in (powerpcle-*-solaris*): Until we get shared + libraries working, don't build gdb, sim, make, tcl, tk, or + expect. + +Tue Jun 4 20:41:45 1996 Per Bothner + + * config.guess: Merge with FSF: + + Mon Jun 3 08:49:14 1996 Karl Heuer + * config.guess (*:Linux:*:*): Add guess for sparc-unknown-linux. + + Fri May 24 18:34:53 1996 Roland McGrath + * config.guess (AViiON:dgux:*:*): Fix typo in recognizing mc88110. + + Fri Apr 12 20:03:59 1996 Per Bothner + * config.guess: Combine two OSF1 rules. + Also recognize field test versions. From mjr@zk3.dec.com. + * config.guess (dgux): Use /usr/bin/uname rather than uname, + because GNU uname does not support -p. From pmr@pajato.com. + +Tue Jun 4 11:07:25 1996 Tom Tromey + + * Makefile.in (MAKEDIRS): Removed $(tooldir). + +Tue May 28 12:30:50 1996 Stan Shebs + + * mpw-README: Document GCCIncludes. + +Sun May 26 15:16:27 1996 Fred Fish + + * configure.in (alpha-*-linux*): Set enable_shared to yes. + +Tue May 21 15:41:39 1996 Stan Shebs + + * mpw-configure: Handle --enable-FOO and --disable-FOO. + +Mon May 20 10:12:29 1996 Geoffrey Noer + + * configure.in (*-*-cygwin32): Configure make. + +Tue May 7 14:19:42 1996 Tom Tromey + + * Makefile.in (inet-install): Quote value of INSTALL_MODULES. + +Fri May 3 08:57:17 1996 Tom Tromey + + * Makefile.in (all-inet): Depend on all-perl. + + * Makefile.in (inet-install): New target. + + * Makefile.in (all-inet): Depend on all-tcl. + (all-inet): Depend on all-send-pr. + +Tue Apr 30 13:55:51 1996 Michael Meissner + + * configure.in (powerpcle-*-solaris*): Turn off tk and tcl + temporarily. + +Thu Apr 25 11:48:20 1996 Ian Lance Taylor + + * configure.in: Don't configure --with-gnu-ld on AIX. + +Thu Apr 25 06:33:36 1996 Michael Meissner + + * configure.in (powerpcle-*-solaris*): Turn off gdb temporarily. + +Tue Apr 23 09:07:39 1996 Tom Tromey + + * Makefile.in (ALL_MODULES): Added all-inet. + (CROSS_CHECK_MODULES): Added check-inet. + (INSTALL_MODULES): Added install-inet. + (CLEAN_MODULES): Added clean-inet. + (all-indent): New target. + + * configure.in (host_tools): Added inet. + (native_only): Added inet. + (noconfigdirs): Added inet. + +Fri Apr 19 15:35:29 1996 Ian Lance Taylor + + * configure.in: Don't configure libgloss if we are not configuring + newlib. + +Wed Apr 17 19:30:01 1996 Rob Savoye + + * configure.in: Don't configure libgloss for unsupported + architectures. + +Tue Apr 16 11:17:05 1996 Michael Meissner + + * Makefile.in (CLEAN_MODULES): Add clean-apache. + +Mon Apr 15 15:09:05 1996 Tom Tromey + + * Makefile.in (ALL_MODULES): Include all-apache. + (CROSS_CHECK_MODULES): Include check-apache. + (INSTALL_MODULES): Include install-apache. + (all-apache): New target. + + * configure.in: Added apache everywhere perl is seen. + +Mon Apr 15 14:59:13 1996 Michael Meissner + + * Makefile.in: Add support for clean-{module} and + clean-target-{module} rules. + +Wed Apr 10 21:37:41 PDT 1996 Marilyn E. Sander + + * configure.in (*-*-ose) do not build libgloss. + +Mon Apr 8 16:16:20 1996 Michael Meissner + + * config.guess (prep*:SunOS:5.*:*): Turn into + powerpele-unknown-solaris2. + +Mon Apr 8 14:45:41 1996 Ian Lance Taylor + + * configure.in: Permit --enable-shared to specify a list of + directories. + +Fri Apr 5 08:17:57 1996 Jason Molenda (crash@phydeaux.cygnus.com) + + * configure.in (host==solaris): Pass only the first word of $CC + to /usr/bin/which when checking if we're using /usr/ccs/bin/cc. + +Fri Apr 5 03:16:13 1996 Jason Molenda (crash@phydeaux.cygnus.com) + + * Makefile.in (BASE_FLAGS_TO_PASS): pass down $(MAKE). + +Thu Mar 28 14:11:11 1996 Tom Tromey + + * Makefile.in (ALL_MODULES): Include all-perl. + (CROSS_CHECK_MODULES): Include check-perl. + (INSTALL_MODULES): Include install-perl. + (ALL_X11_MODULES): Include all-guile. + (CHECK_X11_MODULES): Include check-guile. + (INSTALL_X11_MODULES): Include install-guile. + (all-perl): New target. + (all-guile): New target. + + * configure.in (host_tools): Include perl and guile. + (native_only): Include perl and guile. + (noconfigdirs): Don't build guile and perl; no ports have been + done. + +Tue Mar 26 21:18:50 1996 Andrew Cagney + + * configure (--enable-*): Handle quoted option lists such as + --enable-sim-cflags='-g0 -O' better. + +Thu Mar 21 11:53:08 1996 Michael Meissner + + * Makefile.in ({,inst}all-target): New rule so we can make and + install all of the target directories easily. + +Wed Mar 20 18:10:57 1996 Andreas Schwab + + * configure.in: Add missing global flag in sed substitution when + deleting `target-' from ${configdirs}. + +Thu Mar 14 19:15:06 1996 Ian Lance Taylor + + * Makefile.in (DO_X): Don't get confused if CC contains `=' in an + option. + + * configure.in (mips*-nec-sysvr4*): Use a host_makefile_frag of + config/mh-necv4. + + * install.sh: Correct misspelling of transformbasename. + + * config.guess: Recognize mips-*-sysv*. + +Mon Mar 11 15:36:42 1996 Dawn Perchik + + * config.sub: Recognize mon960. + +Sun Mar 10 13:18:38 1996 Ian Lance Taylor + + * configure: Restore Canadian Cross handling of BISON and LEX, + removed in Feb 20 change. + +Fri Mar 8 20:07:09 1996 Per Bothner + + * README: Suggestions from Torbjorn Granlund : + Mention make install. Remove the old copyright date as well the + clumsy and rather pointless copyright on the README file. + +Fri Mar 8 17:51:35 1996 Ian Lance Taylor + + * Makefile.in ($(CONFIGURE_TARGET_MODULES)): If there is a + Makefile after running symlink-tree, then run `make distclean' to + avoid clobbering any generated files in srcdir. + +Tue Mar 5 08:21:44 1996 J.T. Conklin + + * configure.in (m68k-*-netbsd*): Build everything now. + +Wed Feb 28 12:25:46 1996 Jason Merrill + + * Makefile.in (taz): Fix quoting. + +Tue Feb 27 11:33:57 1996 Doug Evans + + * configure.in (sparclet-*-*): Build everything now. + +Tue Feb 27 14:31:51 1996 Andreas Schwab + + * configure.in (m68k-*-linux*): New host. + +Mon Feb 26 14:32:44 1996 Ian Lance Taylor + + * configure: Check for bison before byacc. + +Tue Feb 20 23:12:35 1996 Stu Grossman (grossman@critters.cygnus.com) + + * Makefile.in configure: Change the way LEX and BISON/YACC are + set. configure now defines DEFAULT_LEX and DEFAULT_YACC by + searching PATH. These are used as fallbacks by Makefile.in if + flex/bison/byacc aren't in objdir. + +Mon Feb 19 11:45:30 1996 Ian Lance Taylor + + * Makefile.in: Make everything which depends upon all-bfd also + depend upon all-opcodes, in case --with-commonbfdlib is used. + +Thu Feb 15 19:50:50 1996 Michael Meissner + + * configure.in (host *-*-cygwin32): Don't build gdb if we are + building NT native compilers on Unix. + +Thu Feb 15 17:42:25 1996 Ian Lance Taylor + + * configure.in: Don't get CC from the host Makefile fragment if we + can find gcc in PATH, or if this is a Canadian Cross. Move the + Solaris test for /usr/ucb/cc to the post target script, just after + the compiler sanity test. + +Wed Feb 14 16:57:40 1996 Ian Lance Taylor + + * config.sub: Merge with FSF. + +Tue Feb 13 14:27:48 1996 Ian Lance Taylor + + * Makefile.in (RPATH_ENVVAR): New variable. + (REALLY_SET_LIB_PATH): Use it. + * configure.in: On HP/UX, set RPATH_ENVVAR to SHLIB_PATH. + +Mon Feb 12 15:28:49 1996 Doug Evans + + * config.sub, configure.in: Recognize sparclet cpu. + +Mon Feb 12 15:33:59 1996 Christian Bauernfeind + + * config.guess: Support m68k-cbm-sysv4. + +Sat Feb 10 12:06:42 1996 Andreas Schwab + + * config.guess (*:Linux:*:*): Guess m68k-unknown-linux and + m68k-unknown-linuxaout from linker help string. Put quotes around + $ld_help_string. + +Thu Dec 7 09:03:24 1995 Tom Horsley + + * config.guess (powerpc-harris-powerunix): Add guess for port + to new target. + +Thu Feb 8 15:37:52 1996 Brendan Kehoe + + * config.guess (UNAME_VERSION): Recognize X4.x as an OSF version. + +Mon Feb 5 16:36:51 1996 Ian Lance Taylor + + * configure.in: If --enable-shared was used, set SET_LIB_PATH to + $(REALLY_SET_LIB_PATH) in Makefile. + * Makefile.in (SET_LIB_PATH): New variable. + (REALLY_SET_LIB_PATH): New variable. + ($(DO_X)): Use $(SET_LIB_PATH). + (install.all, gcc-no-fixedincludes, $(ALL_MODULES)): Likewise. + ($(NATIVE_CHECK_MODULES), $(CROSS_CHECK_MODULES)): Likewise. + ($(INSTALL_MODULES), $(CONFIGURE_TARGET_MODULES)): Likewise. + ($(ALL_TARGET_MODULES), $(CHECK_TARGET_MODULES)): Likewise. + ($(INSTALL_TARGET_MODULES), $(ALL_X11_MODULES)): Likewise. + ($(CHECK_X11_MODULES), $(INSTALL_X11_MODULES)): Likewise. + (all-gcc, all-bootstrap, check-gcc, install-gcc): Likewise. + (install-dosrel): Likewise. + (all-opcodes): Depend upon all-libiberty. + +Sun Feb 4 16:51:11 1996 Steve Chamberlain + + * config.guess (*:CYGWIN*): New + +Sat Feb 3 10:42:35 1996 Michael Meissner + + * Makefile.in (all-target-winsup): All all-target-libiberty. + +Fri Feb 2 17:58:56 1996 Michael Meissner + + * configure.in (noconfigdirs): Add missing # in front of comment. + +Thu Feb 1 14:38:13 1996 Geoffrey Noer + + * configure.in: add second pass to things added to noconfigdirs + so *-gm-magic can exclude libgloss properly. + +Thu Feb 1 11:10:16 1996 Stan Shebs + + * mpw-configure (extralibs_name, rez_name): Set correctly + for MWC68K compiler. + + * mpw-README: Add more info on the necessary build tools. + +Thu Feb 1 10:22:38 1996 Steve Chamberlain + + * configure.in, config.sub: Recognize cygwin32. + +Wed Jan 31 14:17:10 1996 Richard Henderson + + * config.guess, config.sub: Recognize A/UX. + +Wed Jan 31 13:52:14 1996 Ian Lance Taylor + + * config.sub: Merge with gcc/config.sub. + +Thu Jan 25 11:01:10 1996 Raymond Jou + + * mpw-build.in (do-binutils): Add build of stamps. + +Thu Jan 25 17:05:26 1996 James G. Smith + + * config.sub: Add recognition for mips64vr4100*-* targets. + +Wed Jan 24 12:47:55 1996 Brendan Kehoe + + * test-build.mk: Add checking of `hpux9' rather than just `hpux'. + Add creation of gconfigargs with `--enable-shared' turned on. + ($(host)-stamp-stage2-configured): Pass $(gconfigargs). + ($(host)-stamp-stage3-configured): Likewise. + (HOLES): Add chatr and ldd. + (i386-ncr-sysv4.3*): Add use of /usr/ccs/bin in the PATH and HOLE_DIRS. + +Wed Jan 24 20:32:30 1996 Torbjorn Granlund + + * configure: Pass --nfp to recursive configures. + +Mon Jan 22 10:41:56 1996 Steve Chamberlain + + * Makefile.in (DLLTOOL): New. + (DLLTOOL_FOR_TARGET): New. + (EXTRA_HOST_FLAGS): Pass down DLLTOOL. + (EXTRA_TARGET_FLAGS): Ditto. + (EXTRA_GCC_FLAGS): Ditto. + (CONFIGURE_TARGET_MODULES): Ditto. + (DO_X): Ditto. + * configure: Add DLLTOOL. + +Fri Jan 19 13:30:15 1996 Stan Shebs + + SCO OpenServer 5 changes from Robert Lipe : + * configure.in (i[345]86-*-sco3.2v5*): Use mh-sysv instead of + mh-sco, since old workarounds no longer needed, and don't + build ld, since libraries have weak symbols in COFF. + +Sun Jan 14 23:01:31 1996 Fred Fish + + * Makefile.in (CONFIGURE_TARGET_MODULES): Add missing ';'. + +Fri Jan 12 15:25:35 1996 Ian Lance Taylor + + * configure.in: Make sure that ${CC} can be used to compile an + executable. + +Sat Jan 6 07:23:33 1996 Michael Meissner + + * Makefile.in (all-gdb): Depend on $(GDB_TK). + * configure (GDB_TK): Set GDB_TK to either "all-tcl all-tk" or + nothing depending on whether gdbtk is being built. + +Wed Jan 3 17:54:41 1996 Doug Evans + + * Makefile.in (newlib.tar.gz): Delete building of newlib's info files. + +Mon Jan 1 19:09:14 1996 Brendan Kehoe + + * configure.in (noconfigdirs): Put ld or gas in this early, if the + user specifically used --with-gnu-ld=no or --with-gnu-as=no. + +Sat Dec 30 16:08:57 1995 Doug Evans + + * config-ml.in: Add support for + --disable-{softfloat,m68881,m68000,m68020} on m68*-*-*. + Simplify setting of multidirs from --disable-foo. + +Fri Dec 29 07:56:11 1995 Michael Meissner + + * Makefile.in (EXTRA_GCC_FLAGS): If any of the make variables + LANGUAGES, BOOT_CFLAGS, STMP_FIXPROTO, LIMITS_H_TEST, + LIBGCC1_TEST, LIBGCC2_CFLAGS, LIBGCC2_INCLUDES, and ENQUIRE are + non-empty, pass them on to the GCC make. + (all-bootstrap): New rule that is like all-gcc, except it executes + the GCC bootstrap rule instead of the GCC all rule. + +Wed Dec 27 15:51:48 1995 Doug Evans + + * config-ml.in (ml_realsrcdir): New, to account for ${subdir}. + +Tue Dec 26 11:45:31 1995 Michael Meissner + + * config.guess (AViiON:dgux:*:*): Update from FSF to add pentium + DG/UX support. + +Fri Dec 15 10:01:27 1995 Stan Cox + + * config.sub (i*86*) Change [345] to [3456] + +Wed Dec 20 17:41:40 1995 Brendan Kehoe + + * configure.in (noconfigdirs): Add gas or ld if --with-gnu-as=no or + --with-gnu-ld=no. + +Wed Dec 20 15:15:35 1995 Michael Meissner + + * config-ml.in (rs6000*, powerpc*): Add switches to control which + AIX multilibs get built. + +Mon Dec 18 17:55:46 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * configure.in (i386-win32): Don't build expect if we're not + building the tcl subdir. + +Mon Dec 18 11:47:19 1995 Stan Shebs + + * Makefile.in: (configure-target-examples, all-target-examples): + New targets, configure and build example programs. + +Fri Dec 15 16:13:03 1995 Stan Shebs + + * mpw-configure: If an mpw-config.in generated a file mk.sed, + use it as input to sedit the generated MPW makefile. + * mpw-README: Add a suggestion about Gestalt.h. + +Wed Dec 13 16:43:51 1995 Ian Lance Taylor + + * config.sub: Accept *-*-ieee*. + +Tue Dec 12 11:52:57 1995 Ian Lance Taylor + + * Makefile.in (local-distclean): Remove $(TARGET_SUBDIR). From + Ronald F. Guilmette . + +Mon Dec 11 15:31:58 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * configure.in (host==powerpc-pe): Add many directories to noconfigdirs + for powerpc-pe native. + (target==i386-win32): add tcl, make to noconfigdirs if canadian cross. + (target==powerpc-pe): duplicate i386-win32 entry. + +Sat Dec 9 14:58:28 1995 Jim Wilson + + * configure.in (noconfigdirs): Exclude target-newlib for all versions + of vxworks, not just vxworks5.1. + +Mon Dec 4 12:05:40 1995 Stan Shebs + + * mpw-configure: Add support for exec-prefix. + +Mon Dec 4 10:22:50 1995 Jeffrey A. Law + + * config.guess: Recognize HP model 816 machines as having + a PA1.1 processor. + +Mon Dec 4 12:38:15 1995 Ian Lance Taylor + + * configure: Ignore new autoconf configure options. + +Thu Nov 30 16:57:33 1995 Per Bothner + + * config.guess: Recognize Pentium under SCO. + From Robert Lipe . + +Wed Nov 29 13:49:08 1995 J.T. Conklin + + * configure.in (noconfigdirs): Disable target-libio on v810-*-*. + +Wed Nov 29 12:12:01 1995 Ian Lance Taylor + + * configure.in: Don't configure gas for alpha-dec-osf*. + +Tue Nov 28 17:16:48 1995 Ian Lance Taylor + + * configure.in: Default to --with-stabs for some targets for which + it makes sense: mips*-*-*, alpha*-*-osf*, i[345]86*-*-sysv4* and + i[345]86*-*-unixware*. + +Mon Nov 27 13:44:15 1995 Ian Lance Taylor + + * config-ml.in: Get list of multidirs using gcc --print-multi-lib + rather than basing it on the target. Simplify handling of options + controlling which directories to configure. Remove extraneous + slash in multi-clean target. + +Fri Nov 24 17:29:29 1995 Doug Evans + + * config-ml.in: Prefix more variables with ml_ so they don't collide + with configure's. + +Wed Nov 22 11:27:02 1995 Ian Lance Taylor + + * configure: Don't turn -v into --v. + +Tue Nov 21 16:48:02 1995 Doug Evans + + * configure.in (targargs): Fix typo. + + * Makefile.in (DEVO_SUPPORT): Add symlink-tree. + +Tue Nov 21 14:08:28 1995 Ian Lance Taylor + + * configure.in: Strip --host and --target options from + CONFIG_ARGUMENTS, and always configure for --host only. Add + --with-cross-host option when building with a cross-compiler. + * configure: Canonicalize the arguments put into config.status by + always using `=' for an option with an argument. Pass a presumed + --host or --target explicitly. + +Fri Nov 17 17:50:30 1995 Stan Shebs + + * config.sub: Merge -macos*, -magic*, -pe*, and -win32 cases + into general OS recognition case. + +Fri Nov 17 17:42:25 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * configure.in (target_configdirs): add target-winsup only + for win32 target systems. + +Thu Nov 16 14:04:47 1995 Ian Lance Taylor + + * Makefile.in (all-target-libgloss): Depend upon + configure-target-newlib, since when libgloss is built it looks to + see if the newlib directory exists. + +Wed Nov 15 14:47:52 1995 Ken Raeburn + + * Makefile.in (DEVO_SUPPORT): Use config-ml.in instead of + cfg-ml-*.in. + +Wed Nov 15 11:45:23 1995 Ian Lance Taylor + + * configure: Handle LD and LD_FOR_TARGET when configuring a + Canadian Cross. + +Tue Nov 14 14:56:11 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * configure.in (target_libs): add target-winsup. + (target==i386-win32): add patch diff flex make to $noconfigdirs. + (target==ppcle-pe): remove ld from $noconfigdirs. + +Tue Nov 14 01:25:50 1995 Doug Evans + + * Makefile.in (CONFIGURE_TARGET_MODULES): Pass --with-target-subdir. + Preserve relative path names in $srcdir. Build symlink tree if + configuring cross target dir and srcdir=. (= no VPATH support). + (configure-target-libg++): Depend on configure-target-librx. + * cfg-ml-com.in, cfg-ml-pos.in: Deleted. + * config-ml.in: New file. + * symlink-tree: New file. + * configure: Ensure srcdir="." if that's what it is. + +Mon Nov 13 12:34:20 1995 Stan Shebs + + * mpw-README: Clarify some phrasing, add notes about CodeWarrior + includes and FLEX_SKELETON setting. + * mpw-configure (--with-gnu-ld): New option, controls whether + to use PPCLink or ld with PowerMac GCC. + * mpw-build.in (all-grez, do-grez, install-grez): New targets. + * mpw-config.in: Configure grez if targeting Mac. + + * config.sub: Accept pmac and pmac-mpw as names for PowerMacs, + accept mpw and mac-mpw as names for m68k Macs, change macos7 to + just macos. + * configure.in: Configure grez resource compiler if targeting Mac. + * Makefile.in (all-grez, install-grez): New targets. + +Wed Nov 8 17:33:51 1995 Jason Merrill + + * configure: CXX defaults to gcc, not g++. If we find + gcc in the path, set CC to gcc -O2. + +Tue Nov 7 15:45:17 1995 Ian Lance Taylor + + * configure: Default ${build} correctly. Avoid picking up extra + spaces when reading CC and CXX from Makefile. When doing a + Canadian Cross, use plausible default values for numerous + variables. + * configure.in: When doing a Canadian Cross, don't try to + configure tools whose configure script can't handle it. + +Mon Nov 6 19:32:17 1995 Jim Wilson + + * cfg-ml-com.in (sh-*-*): Add m2 and ml/m2 to multidirs. + +Sun Nov 5 00:15:41 1995 Per Bothner + + * configure: Remove dubious bug reporting address. + +Fri Nov 3 08:17:54 1995 Per Bothner + + * Makefile.in ($(CONFIGURE_TARGET_MODULES)): If subdir has + configure script, run that instead of this directory's configure. + In either case, print a message that we're configuring the sub-dir. + +Thu Nov 2 23:23:36 1995 Per Bothner + + * configure.in: Before checking for the existence of various files, + use sed to filter out "target-". + +Thu Nov 2 13:24:56 1995 Ian Lance Taylor + + * Makefile.in (DO_X): Split rule to decrease command line length + for systems with small ARG_MAX values. From phdm@info.ucl.ac.be + (Philippe De Muyter). + +Wed Nov 1 15:18:35 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * Makefile.in (all-patch): depend on all-libiberty. + +Wed Nov 1 12:23:20 1995 Ian Lance Taylor + + * configure.in: If the only directory in target_configdirs which + actually exists is libiberty, then set target_configdirs to empty, + to avoid trying to build a target libiberty in a gas or gdb + distribution. + +Tue Oct 31 17:52:39 1995 J.T. Conklin + + * configure.in (host_makefile_frag): Use m68k-sun-sunos* instead + of m68k-sun-* when selecting mh-sun3 to avoid matching NetBSD/sun3 + systems. + +Tue Oct 31 16:57:32 1995 Jim Wilson + + * configure.in (copy_dirs): Use sys-include instead of include + for --with-headers option. + +Tue Oct 31 10:29:36 1995 steve chamberlain + + * Makefile.in, configure.in: Make winsup builds work with + new scheme. + +Mon Oct 30 18:57:09 1995 Ian Lance Taylor + + * configure.in: Build the linker on AIX. + +Mon Oct 30 12:27:16 1995 Per Bothner + + * Makefile.in (CC_FOR_TARGET, CXX_FOR_TARGET): Add $(TARGET_SUBDIR) + where needed. + +Mon Oct 30 12:45:25 1995 Doug Evans + + * Makefile.in (all-gcc): Fix typo. + +Sat Oct 28 10:27:59 1995 Per Bothner + + * Makefile.in ($(CHECK_TARGET_MODULES)): Fix typo. + +Fri Oct 27 23:14:12 1995 Per Bothner + + * configure.in: Rename libFOO to target-libFOO, and xiberty + to target-xiberty, to provide more flexibility. + (target_subdir): Define. Create if cross. + Set TARGET_SUBDIR in Makefile to ${target_subdir}. + * Makefile.in: Rename all-libFOO -> all-target-libFOO, all-xiberty + -> all-target-libiberty, configure-libFOO -> configure-target-libFOO, + check-libFOO -> check-target-libFOO, etc. + ($(DO_X)): Iterate over TARGET_CONFIGDIRS after SUBDIRS. + ($(CONFIGURE_TARGET_MODULES), $(CHECK_TARGET_MODULES), + $(ALL_TARGET_MODULES), $(INSTALL_TARGET_MODULES)): Update accordingly. + (configure-target-XXX): Depend on $(ALL_GCC), not all-gcc, to + allow ALL_GCC="" to only configure. + (DEVO_SUPPORT): Add cfg-ml-com.in and cfg-ml-pos.in. + (ETC_SUPPORT, ETC_SUPPORT_PFX): Merge; update 'taz' accordingly. + (LIBGXX_SUPPORT_DIRS): Remove xiberty. + +Sat Oct 28 01:53:49 1995 Ken Raeburn + + * Makefile.in (taz): Build "info" in etc explicitly. + +Fri Oct 27 09:32:30 1995 Stu Grossman (grossman@cygnus.com) + + * configure.in: Make sure that CC is undefined (as opposed to + null) if toplevel/config/mh-{host} doesn't define it. Fixes a + problem with autoconf trying to configure on a host without GCC. + +Thu Oct 26 22:35:01 1995 Stan Shebs + + * mpw-configure: Set host alias from choice of host compiler, + only use generic MPW Makefile sed if present, edit a file + named "hacked_Makefile.in" instead of "Makefile.in" if present. + * mpw-README: Add problem notes about CW6 and CW7. + +Thu Oct 26 05:45:10 1995 Ken Raeburn + + * Makefile.in (taz): Use ";" instead of ";;". + +Wed Oct 25 15:18:24 1995 Per Bothner + + * Makefile.in (taz): Grep for '^diststuff:' or '^info:' in + sub-directory Makefiles, instead of using DISTSTUFFDIRS and + DISTDOCDIRS. + (DISTSTUFFDIRS, DISTDOCDIRS): Removed - no longer used. + (newlib.tar.gz): Don't pass DISTDOCDIRS to recursive make. + +Wed Oct 25 14:43:55 1995 Per Bothner + + * Makefile.in (DISTDOCDIRS): Remove ld gprof bnutils gas libg++ gdb + and gnats, because they are now subsumed by DISTSTUFFDIRS. + Move bfd to DISTSTUFFDIRS. + +Tue Oct 24 18:19:09 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * Makefile.in (X11_LIB): Removed. + (X11_FLAGS_TO_PASS): pass only X11_EXTRA_CFLAGS and X11_EXTRA_LIBS. + + * configure.in (host_makefile_frag): mh-aix & mh-sun removed. + +Sun Oct 22 13:04:42 1995 Michael Meissner + + * cfg-ml-com.in (powerpc*): Shorten some of the multilib directory + names. + +Fri Oct 20 18:02:10 1995 Michael Meissner + + * cfg-ml-com.in (powerpc*-eabi*): Add mcall-aixdesc varients. + +Thu Oct 19 10:40:57 1995 steve chamberlain + + * configure.in (i[345]86-*-win32): Always build newlib. + Don't configure cvs, autoconf or texinfo. + * Makefile.in (LD_FOR_TARGET): New. + (BASE_FLAGS_TO_PASS, EXTRA_TARGET_FLAGS, CONFIGURE_TARGET_MODULES): + Pass down LD_FOR_TARGET. + +Wed Oct 18 15:53:56 1995 steve chamberlain + + * winsup: New directory. + * Makefile.in: Build winsup. + * configure.in: Winsup is configured when target is win32. + Can only build win32 target GDB when native. + +Mon Oct 16 09:42:31 1995 Jeffrey A Law (law@cygnus.com) + + * config.guess: Recognize HP model 819 machines as having + a PA 1.1 processor. + +Mon Oct 16 10:49:43 1995 Ian Lance Taylor + + * configure: Fix sed loop which substitutes for CC and CXX to + avoid bug found in various sed implementations. + +Wed Oct 11 16:16:20 1995 Michael Meissner + + * cfg-ml-com.in (powerpc-*-eabisim): Delete separate rule for + simulator. Use standard powerpc-*-eabi*. + +Mon Oct 9 17:21:56 1995 Ian Lance Taylor + + * configure.in: Stop putting gas and binutils in noconfigdirs for + powerpc-*-aix* and rs6000-*-*. + +Mon Oct 9 12:38:40 1995 Michael Meissner + + * cfg-ml-com.in (powerpc*-*-eabisim*): Add support for building + -mcall-aixdesc libraries. + +Fri Oct 6 16:17:57 1995 Ken Raeburn + + Mon Sep 25 22:49:32 1995 Andreas Schwab + + * config.sub (arm | armel | armeb): Fix shell syntax. + +Fri Oct 6 14:40:28 1995 Michael Meissner + + * cfg-ml-com.in ({powerpc,rs6000}-ibm-aix*): Add multilibs for + -msoft-float and -mcpu=common support. + (powerpc*-*-eabisim*): Add support for building -mcall-aix + libraries. + +Thu Oct 5 13:26:37 1995 Brendan Kehoe + + * configure.in: Allow configuration and build of emacs19 for the alpha. + +Wed Oct 4 22:05:36 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * configure.in (CC): Get ^CC, not just any old CC, from + ${host_makefile_frag}. + +Wed Oct 4 21:55:00 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * configure.in (CC): Try to get CC from + ${srcdir}/${host_makefile_frag}, not ${host_makefile_frag}. + +Wed Oct 4 21:44:12 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * Makefile.in (TARGET_CONFIGDIRS): configure targetdirs + only if it exists in $(srcdir). + +Wed Oct 4 11:52:31 1995 Ian Lance Taylor + + * configure: If CC and CXX are not set in the environment, set + them, based on either an existing Makefile or on searching for gcc + in PATH. Substitute for CC and CXX in Makefile. + * configure.in: Remove libm from target_libs. Separate + target_configdirs from configdirs. If CC is not set in + environment, try to get it from a host Makefile fragment. Rewrite + changes of configdirs to use skipdirs instead. A few minor + tweaks. Take directories out of target_configdirs as they are + taken out of configdirs. Remove existing Makefile files from + subdirectories. Substitute for TARGET_CONFIGDIRS and + CONFIG_ARGUMENTS in Makefile. + * Makefile.in (TARGET_CONFIGDIRS): New variable, automatically set + by configure.in. + (CONFIG_ARGUMENTS): Likewise. + (CONFIGURE_TARGET_MODULES): New variable. + ($(DO_X)): Loop over TARGET_CONFIGDIRS as well as SUBDIRS. + ($(CONFIGURE_TARGET_MODULES)): New target. + (configure-libg++, configure-libio): New targets. + (all-libg++): Depend upon configure-libg++. + (all-libio): Depend upon configure-libio. + (configure-libgloss, all-libgloss): New targets. + (configure-libstdc++): New target. + (all-libstdc++): Depend upon configure-libstdc++. + (configure-librx, all-librx): New targets. + (configure-newlib): New target. + (all-newlib): Depend upon configure-newlib + (configure-xiberty): New target. + (all-xiberty): Depend upon configure-xiberty. + +Sat Sep 30 04:32:59 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * configure.in (host i[345]86-*-win32): Expand the + noconfigdirs again. + +Thu Sep 28 21:18:49 1995 Stan Shebs + + * mpw-configure: Fix sed command file name. + +Thu Sep 28 17:39:56 1995 steve chamberlain + + * configure.in (host i[345]86-*-win32): Reduce the + noconfigdirs again. + +Wed Sep 27 12:24:00 1995 Ian Lance Taylor + + * configure.in: Don't configure ld and gdb for powerpc*-*-winnt* + or powerpc*-*-pe*, since they are not yet supported. + +Tue Sep 26 14:30:01 1995 Stan Shebs + + Add PowerMac support and many other enhancements. + * mpw-configure: New option --cc to select compiler to use, + paste options set according to --cc into the generated + Makefile, generate the Makefile by sed'ing the Unix Makefile.in + if mpw-make.sed is present. + * mpw-config.in: Don't test for gC1, test for mpw-touch, + add forward includes for PowerPC include files. + * mpw-build.in: Build using Makefile.PPC if present. + (do-byacc, etc): Remove separate version resource builds. + (do-gas): Build "stamps" before "all". + (do-gcc): Build "stamps-h" and "stamps-c" before "all". + * mpw-README: Update to reflect --cc option, PowerMac support, + and recently-reported compatibility problems. + +Fri Sep 22 12:15:42 1995 Doug Evans + + * cfg-ml-com.in (m68*-*-*): Only build multilibs for + embedded m68k systems (-aout, -coff, -elf, -vxworks). + (--with-multilib-top): Pass to recursive invocations. + +Tue Sep 19 13:51:05 1995 J.T. Conklin + + * configure.in (noconfigdirs): Disable libg++ and libstdc++ on + v810-*-*. + +Mon Sep 18 23:08:26 1995 J.T. Conklin + + * configure.in (noconfigdirs): Disable bfd, binutils, gas, gcc, + gdb, ld and opcodes on v810-*-*. + +Tue Sep 12 18:03:31 1995 Ian Lance Taylor + + * Makefile.in (DO_X): Change do-realclean to do-maintainer-clean. + (local-maintainer-clean): New target. + (maintainer-clean): New target. + (realclean): Just depend upon maintainer-clean. + +Fri Sep 8 17:11:14 1995 J.T. Conklin + + * configure.in (noconfigdirs): Disable gdb on m68k-*-netbsd*. + +Fri Sep 8 16:46:29 1995 Ian Lance Taylor + + * configure.in: Build ld in mips*-*-bsd* case. + +Thu Sep 7 20:03:41 1995 Ken Raeburn + + * config.sub: Accept -lites* OS. From Ian Dall. + +Fri Sep 1 08:06:58 1995 James G. Smith + + * config.sub: recognise mips64vr4300 and mips64vr4300el as valid + targets. + +Wed Aug 30 21:06:50 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * configure.in: treat i386-win32 canadian cross the same as + i386-go32 canadian cross. + +Thu Aug 24 14:53:20 1995 Michael Meissner + + * cfg-ml-com.in (powerpc*-*-eabisim): Add support for PowerPC + running under the simulator to build a reduced set of libraries. + (powerpc-*-eabiaix): Add fine grained multilib support added to + other powerpc targets yesterday. + +Wed Aug 23 09:41:56 1995 Michael Meissner + + * cfg-ml-com.in (powerpc*): Add support for -disable-biendian, + -disable-softfloat, -disable-relocatable, -disable-aix, and + -disable-sysv to control which multilib libraries get built. + +Thu Aug 17 16:03:41 1995 Ken Raeburn + + * configure: Add Makefile.tem to list of files to remove in trap + handler. + +Mon Aug 14 19:27:56 1995 Per Bothner + + * config.guess (*Linux*): Add missing "exit"s. + Also, need specific check for alpha-unknown-linux (uses COFF). + +Fri Aug 11 15:38:20 1995 Per Bothner + + * config.guess: Merge with FSF: + + Wed Jun 28 17:57:27 1995 David Edelsohn + * config.guess (AIX4): More robust release numbering discovery. + + Thu Jun 22 19:01:24 1995 Kenneth Stailey (kstailey@eagle.dol-esa.gov) + * config.guess (i386-sequent-ptx): Properly get version number. + + Thu Jun 22 18:36:42 1995 Uwe Seimet (seimet@iris1.chemie.uni-kl.de) + * config.guess (mips:*:4*:UMIPS): New case. + +Mon Aug 7 09:21:35 1995 Doug Evans + + * configure.in (i386-go32 host): Fix typo (deja-gnu -> dejagnu). + (i386-win32 host): Likewise. Don't build readline. + +Sat Aug 5 09:51:49 1995 Fred Fish + + * Makefile.in (GDBTK_SUPPORT_DIRS): Define and pass as part of + SUPPORT_FILES to submakes. + +Fri Aug 4 13:04:36 1995 Fred Fish + + * Makefile.in (GDB_SUPPORT_DIRS): Add utils. + (DEVO_SUPPORT): Add mpw-README, mpw-build.in, mpw-config.h and + mpw-configure. + +Wed Aug 2 16:32:40 1995 Ken Raeburn + + * configure.in (appdirs): Use =, not ==, in test expression when + trying to build the text to print in the warning message for + Solaris users. + +Mon Jul 31 09:56:18 1995 steve chamberlain + + * cfg-ml-com.in (z8k-*-coff): Add 'std' multilib build. + +Fri Jul 28 00:16:31 1995 Jeffrey A. Law + + * config.guess: Recognize lynx-2.3. + +Thu Jul 27 15:47:59 1995 steve chamberlain + + * config.sub (z8ksim): Deleted + (z8k-*-coff): New, this is the one true name of the target. + +Thu Jul 27 14:33:33 1995 Doug Evans + + * cfg-ml-pos.in (dotdot): Work around SunOS sed bug. + +Thu Jul 27 13:31:05 1995 Fred Fish (fnf@cygnus.com) + + * config.guess (*:Linux:*:*): First try asking the linker what the + default object file format is (elf, aout, or coff). Then if this + fails, try previous methods. + +Thu Jul 27 11:28:17 1995 J.T. Conklin + + * configure.in: Don't build newlib for *-*-vxworks5.1. + +Thu Jul 27 11:18:47 1995 Brendan Kehoe + + * configure.in: Don't build newlib for a29k-*-vxworks5.1. + * test-build.mk: Add setting of --with-headers for a29k-vxworks5.1. + +Tue Jul 25 21:25:39 1995 Doug Evans + + * cfg-ml-pos.in (MULTITOP): Trim excess trailing "/.". + +Fri Jul 21 10:41:12 1995 Doug Evans + + * cfg-ml-com.in: New file. + * cfg-ml-pos.in: New file. + +Wed Jul 19 00:37:27 1995 Jeffrey A. Law + + * COPYING.NEWLIB: Add HP free copyright to list. + +Tue Jul 18 10:58:51 1995 Michael Meissner + + * config.sub: Recognize -eabi* for the system, not just -eabi. + +Mon Jul 3 13:44:51 1995 Steve Chamberlain + + * Makfile.in (DLLTOOL_FOR_TARGET): New name, pass it down. + * config.sub, configure.in (win32): New target and host. + +Wed Jun 28 23:57:08 1995 Steve Chamberlain + + * configure.in: Add i386-pe configuration. + +Fri Jun 23 14:28:44 1995 Stan Shebs + + * mpw-build.in (install): Install GDB after LD. + +Thu Jun 22 17:10:53 1995 Stan Shebs + + * mpw-config.in (elf/mips.h): Always forward-include, needed + for GDB to build. + +Wed Jun 21 15:17:30 1995 Rob Savoye + + * testsuite: New directory for customer acceptance and whole tool + chain tests. + +Wed Jun 21 16:50:29 1995 Ken Raeburn + + * configure: If per-host line isn't found, but AC_OUTPUT is found + and a configure script exists, run it instead. + +Thu Jun 15 21:09:24 1995 Per Bothner + + * config.guess: Update from FSF, for alpha-dec-winnt3.5 and Crays. + +Tue Jun 13 21:43:27 1995 Rob Savoye + + * configure: Set build_{cpu,vendor,os,alias} to host values when + --build isn't specified. + +Mon Jun 5 18:26:36 1995 Jason Merrill + + * Makefile.in (PICFLAG, PICFLAG_FOR_TARGET): New macros. + (FLAGS_TO_PASS): Pass them. + (EXTRA_TARGET_FLAGS): Ditto. + +Wed May 31 22:27:42 1995 Jim Wilson + + * Makefile.in (all-libg++): Depend on all-libstdc++. + +Thu May 25 22:40:59 1995 J.T. Conklin + + * configure.in (noconfigdirs): Enable all packages for + i386-unknown-netbsd. + +Sat May 20 13:22:31 1995 Angela Marie Thomas + + * configure.in (noconfigdirs): Don't configure tk for i386-go32 + hosted builds (DOS builds) + +Thu May 18 18:08:49 1995 Ken Raeburn + + Changes for ARM based on patches from Richard Earnshaw: + * config.sub: Handle armeb and armel. + * configure.in: Omit arm linker only for riscix. + +Thu May 11 17:23:26 1995 Per Bothner + + * config.guess: Update from FSF. + +Tue May 9 15:52:05 1995 Michael Meissner + + * config.sub: Recognize powerpcle as the little endian varient of + the PowerPC. Recgonize ppc as a PowerPC variant, and ppcle as a + powerpcle variant. Convert pentium into i586, not i486. Add p5 + alias for i586. Map new x86 variants p6, k5, nexgen into i586 + temporarily. + +Tue May 2 16:29:41 1995 Jeff Law (law@snake.cs.utah.edu) + + * configure.in (hppa*-*-lites*): Treat like hppa*-*-*elf*. + +Sun Apr 30 21:38:09 1995 Jeff Law (law@snake.cs.utah.edu) + + * config.sub: Accept -lites* as a basic system type. + +Thu Apr 27 11:33:29 1995 Michael Meissner (meissner@cygnus.com) + + * config.guess (*:Linux:*:*): Check for whether the pre-BFD linker is + installed, and if so return linuxoldld as the system name. + +Wed Apr 26 10:59:02 1995 Jeff Law (law@snake.cs.utah.edu) + + * config.guess: Add hppa1.1-hp-lites support. + +Tue Apr 25 11:08:11 1995 Rob Savoye + + * configure.in: Don't build newlib for m68k-vxworks5.1. + +Wed Apr 19 17:02:43 1995 Jim Wilson + + * configure.in (mips-sgi-irix6): Use mh-irix5. + +Fri Apr 14 15:21:17 1995 Doug Evans + + * Makefile.in (all-gcc): Depend on all-ld (for libgcc1-test). + +Wed Apr 12 16:06:01 1995 Jason Merrill + + * test-build.mk: Enable building of shared libraries on IRIX 5 and + OSF/1. Fix compiler flags. + * build-all.mk: Support Linux and OSF/1 3.0. Fix compiler flags. + +Tue Apr 11 18:55:40 1995 Doug Evans + + * configure.in: Recognize --with-newlib. + (sparc-*-sunos4*): Build sim, dejagnu, expect, tcl if cross target. + +Mon Apr 10 14:38:20 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * Makefile.in: move {all,check,install}-gdb from *_MODULES + to *_X11_MODULES due to gdbtk needing X include files et al. + +Mon Apr 10 11:42:22 1995 Stan Shebs + + Merge in support for Mac MPW as a host. + (Old change descriptions retained for informational value.) + + * mpw-config.in: Add generic include forwards for cpu-specific + include files in aout and elf directories. + + * mpw-configure: Added copyright. + * mpw-config.in: Check for presence of required build tools. + (target_libs): Add newlib. + (target_tools): Add examples. + (Read Me): Generate as "Read Me for MPW" instead. + * mpw-build.in: Base sub-builds on all-foo instead of do-foo. + (all-byacc, do-byacc, all-flex, do-flex, do-newlib): New actions. + (do-gas, do-gcc, do-gdb, do-ld): Build Version.r first. + + * mpw-configure: Remove subdir-specific makefile hackery, + delete mk.tmp after using it. + + * mpw-build.in (all): Display start and end times. + + * mpw-configure (host_canonical): Set. + (target_cpu): Always add to makefiles. + (ARCHDEFS, EMUL): Add to makefile only if nonempty. + (TM_FILE, XM_FILE, NM_FILE): No longer add to makefile. + (mpw-mh-mpw): Look for in srcdir and srcroot. + Use sed instead of mpw-edit-prefix to edit prefix definitions. + + * mpw-build.in: (install-only): New target. + + * mpw-configure (host_alias, target_alias): Rename from hostalias + and targetalias, add into generated Makefile. + (mk.tmp): If present, add into generated Makefile. + * mpw-build.in (all-gas): Build config.h first before gas proper. + + * mpw-configure (config.status): Write only if changed. + * mpw-config.in (readline): Configure it (not built, just used for + definitions). + + * mpw-config.in (elf/mips.h): Add a forward include. + + * mpw-config.in: Forward-include most .h files in include into + extra-include. + (readline): Don't build. + mpw-build.in (install): Install GDB. + + * mpw-configure (prefix, mpw_prefix): Handle it. + * mpw-config.in (mmalloc, readline): Don't configure. + * mpw-build.in (thisscript): Rename to ThisScript. + Use mpw-build instead of BuildProgram everywhere. + (mmalloc, readline): Don't build. + * mpw-README: New file, basic documentation about the MPW port. + + * mpw-config.in: Use forward-include to create include files. + + * mpw-configure: Add more things to the top of each configured + Makefile, including contents of config/mpw-mh-mpw. + * mpw-config.in (extra-include): Create this directory and fill it + with Posix-like include files when configuring. + + * config.sub (apple, mac, mpw): Add various aliases. + + * mpw-build.in: New file, top-level build script fragment for MPW. + * mpw-configure: New file, configure script for MPW. + * mpw-config.in: New file, config fragment for MPW. + +Fri Apr 7 19:33:16 1995 Jim Kingdon (kingdon@lioth.cygnus.com) + + * configure.in (host_libs): Remove glob, since it is gone from the + sources. + +Fri Mar 31 11:36:17 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * Makefile.in: define empty GDB_NLM_DEPS var. + + * configure.in(target_makefile_frag): use config/mt-netware + for netware targets. + +Thu Mar 30 13:51:43 1995 Ian Lance Taylor + + * config.sub: Merge in recent FSF changes. Remove linux special + cases. + +Tue Mar 28 14:47:34 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + Revert this change: + + Tue Mar 30 10:03:09 1993 Ian Lance Taylor (ian@cygnus.com) + + * build-all.mk: Use CC=cc -Xs on Solaris. + +Tue Mar 21 10:43:32 1995 Jim Kingdon (kingdon@lioth.cygnus.com) + + * glob/*: Removed. Schauer's 24 Feb 1994 readline change made us + stop using it. + * Makefile.in: Nuke all references to glob subdirectory. + +Thu Mar 16 13:35:30 1995 Jason Merrill + + * configure.in: Fix --enable-shared logic in per-host. + +Mon Mar 13 12:33:15 1995 Ian Lance Taylor + + * configure.in (*-hp-hpux[78]*): Use mh-hpux8. + +Mon Mar 6 10:21:58 1995 Jim Kingdon (kingdon@lioth.cygnus.com) + + * configure.in (noconfigdirs): Don't build gas on AIX, for + powerpc*-*-aix* as well as for rs6000*-*-aix*. + +Wed Mar 1 12:51:53 1995 Ian Lance Taylor + + * configure: Fix --cache-file to work if the file argument is a + relative path. + +Tue Feb 28 17:36:07 1995 Ian Lance Taylor + + * configure: If the --cache-file is used, pass it down to + configure in subdirectories. + +Mon Feb 27 12:52:46 1995 Kung Hsu + + * config.sub: add vxworks29k configuration. + +Fri Feb 10 16:12:26 1995 Ken Raeburn + + * Makefile.in (taz): Do "diststuff" part quietly. + +Sun Feb 5 14:16:35 1995 Doug Evans + + * config.sub: Mini-merge with gcc/config.sub. + +Sat Feb 4 12:11:35 1995 Jim Wilson + + * config.guess (IRIX): Sed - to _. + +Fri Feb 3 11:54:42 1995 J.T. Conklin + + * Makefile.in (source-vault, binary-vault): New targets. + +Thu Jan 26 13:00:11 1995 Michael Meissner + + * config.sub: Recognize -eabi as a basic system type. + +Thu Jan 12 13:13:23 1995 Jason Merrill + + * configure.in (enable_shared stuff): Fix typo. + +Thu Jan 12 01:36:51 1995 deanm@medulla.LABS.TEK.COM (Dean Messing) + + * Makefile.in (BASE_FLAGS_TO_PASS): Fix typo in passing LIBCXXFLAGS*. + +Wed Jan 11 16:29:53 1995 Jason Merrill + + * Makefile.in (LIBCXXFLAGS_FOR_TARGET): Add -fno-implicit-templates. + +Mon Jan 9 12:48:01 1995 Jim Kingdon + + * configure.in (rs6000-*-*): Don't build gas. + +Wed Jan 4 23:53:49 1995 Ian Lance Taylor + + * Makefile.in: Use /x/x/ instead of /brokensed/brokensed/, to + reduce command line length. + (AS_FOR_TARGET): Check for as.new, not Makefile. + (NM_FOR_TARGET): Check for nm.new, not Makefile. + +Wed Jan 4 13:02:39 1995 Per Bothner + + * config.guess: Merge from FSF. + +Thu Dec 15 17:11:37 1994 Ian Lance Taylor + + * configure: Don't use $ when handling program_suffix. + +Mon Dec 12 12:09:37 1994 Stu Grossman (grossman@cygnus.com) + + * configure.in: Configure tk for hppa/hpux. + +Fri Dec 2 15:55:38 1994 Per Bothner + + * Makefile.in (LIBGXX_SUPPORT_DIRS): Add libstdc++. + +Tue Nov 29 19:37:56 1994 Per Bothner + + * Makefile.in: Move -fno-implicit-template from CXXFLAGS + to LIBCXXFLAGS. Tests are better run without it. + +Wed Nov 23 10:29:25 1994 Brendan Kehoe (brendan@lisa.cygnus.com) + + * Makefile.in (all-ispell): Depend on all-emacs19 instead of all-emacs. + +Mon Nov 21 11:14:01 1994 J.T. Conklin + + * configure.in (*-*-netware*): Don't configure xiberty. + +Mon Nov 14 08:49:15 1994 Stu Grossman (grossman@cygnus.com) + + * configure.in: Remove tk from native_only list. + +Fri Nov 11 15:31:26 1994 Bill Cox (bill@rtl.cygnus.com) + + * build-all.mk: Add mips-ncd-elf target to sun4 targets + for special NCD build. + +Mon Nov 7 20:58:17 1994 Ken Raeburn + + * Makefile.in (DEVO_SUPPORT): Remove configure.bat and + makeall.bat, they're only useful for binutils snapshots. + (binutils.tar.gz, gas+binutils.tar.gz): Add configure.bat and + makeall.bat to specified SUPPORT_FILES. + +Mon Nov 7 17:25:18 1994 Bill Cox (bill@cirdan.cygnus.com) + + * build-all.mk: Add Ericsson targets to sun4 and solaris + hosts. Add BNR's sun4 target to solaris host, so their + build-from-source will be tested in-house first. + +Sat Nov 5 18:43:30 1994 Jason Merrill (jason@phydeaux.cygnus.com) + + * Makefile.in (LIBCFLAGS): New variable. + (CFLAGS_FOR_TARGET): Ditto. + (LIBCFLAGS_FOR_TARGET): Ditto. + (LIBCXXFLAGS): Ditto. + (CXXFLAGS_FOR_TARGET): Ditto. + (LIBCXXFLAGS_FOR_TARGET): Ditto. + (BASE_FLAGS_TO_PASS): Pass them. + (EXTRA_TARGET_FLAGS): Ditto. + + * configure.in: Support --enable-shared. + +Sat Nov 5 15:44:00 1994 Per Bothner + + * configure.in (target_libs): Include libstdc++ again. + * config.guess: Update from FSF (for FreeBSD). + +Thu Nov 3 16:32:30 1994 Ken Raeburn + + * Makefile.in (DEVO_SUPPORT): Include configure.bat and + makeall.bat. + (DISTDOCDIRS): Add `etc'. + (ETC_SUPPORT_PFX): New variable. + (taz): Include anything from etc starting with a word in + ETC_SUPPORT_PFX. + +Wed Oct 26 16:19:35 1994 Ian Lance Taylor + + * config.sub: Update for recent FSF changes. Remove obsolete + h8300hds entry. Add -windows* and -osx as basic os. Minor + spacing changes. + +Thu Oct 20 18:41:56 1994 Per Bothner + + * configure.in (target_libs): Remove libstdc++ for libg++-2.6.1. + + * config.guess: Merge with FSF. + * configure.in: Match on i?86-ncr-sysv4.3, not i?86-ncr-sysv43. + +Thu Oct 20 19:26:56 1994 Ken Raeburn + + * configure: Since the "trap 0" handler will override the exit + status on many systems, only use it for "exit 1", and make it set + a non-zero exit status; reset it before "exit 0". Also, check + exit status of config.sub, and error out if it failed. + +Wed Oct 19 18:49:55 1994 Rob Savoye (rob@cygnus.com) + + * Makefile.in: (ALL_TARGET_MODULES,INSTALL_TARGET_MODULES) Build + and install libgloss. + +Tue Oct 18 15:25:24 1994 Ian Lance Taylor + + * Makefile.in (all-binutils): Depend upon all-byacc. + + * configure.in: Don't build emacs on Irix 5. + +Mon Oct 17 16:22:12 1994 J.T. Conklin (jtc@phishhead.cygnus.com) + + * configure.in (*-*-netware*): Add libio. + +Thu Oct 13 15:51:20 1994 Jason Merrill (jason@phydeaux.cygnus.com) + + * Makefile.in (ALL_TARGET_MODULES): Add libstdc++. + (CHECK_TARGET_MODULES): Ditto. + (INSTALL_TARGET_MODULES): Ditto. + (TARGET_LIBS): Ditto. + (all-libstdc++): Note dependencies. + +Thu Oct 13 01:43:08 1994 Ken Raeburn + + * Makefile.in (BINUTILS_SUPPORT_DIRS): Add gas. + +Tue Oct 11 12:12:29 1994 Jason Merrill (jason@phydeaux.cygnus.com) + + * Makefile.in (CXXFLAGS): Use -fno-implicit-templates instead of + -fexternal-templates. + + * configure.in (target_libs): Add libstdc++. + (noconfigdirs): Add libstdc++ as appropriate. + +Thu Oct 6 18:00:54 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * config.guess: Update from FSF. + +Tue Oct 4 12:05:42 1994 Ian Lance Taylor + + * configure: Use ${config_shell} when running ${configsub}. + +Mon Oct 3 14:28:34 1994 Doug Evans + + * config.sub: No longer recognize h8300h. + +Mon Oct 3 12:40:54 1994 Ian Lance Taylor + + * config.sub: Remove extraneous differences between config.sub and + gcc/config.sub. + +Sat Oct 1 00:23:12 1994 Ken Raeburn + + * Makefile.in (DISTSTUFFDIRS): Add gas. + +Thu Sep 22 19:04:55 1994 Doug Evans (dje@canuck.cygnus.com) + + * COPYING.NEWLIB: New file. + +Mon Sep 19 18:25:40 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * config.guess (HP-UX): Patch from Harlan Stenn + to also emit release level. + +Wed Sep 7 13:15:25 1994 Jim Wilson (wilson@sphagnum.cygnus.com) + + * config.guess (sun4*:SunOS:*:*): Change '-JL' to '_JL'. + +Tue Sep 6 23:23:18 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * config.sub: Merge nextstep cleanup from FSF. + +Mon Sep 5 05:01:30 1994 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * configure.in (arm-*-*): Don't configure ld for this target. + +Thu Sep 1 09:35:00 1994 J.T. Conklin (jtc@phishhead.cygnus.com) + + * configure.in (*-*-netware): don't configure libg++, libio, + librx, or newlib. + +Wed Aug 31 13:52:08 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * configure.in (alpha-dec-osf*): Use osf*, not osf1*. Don't + configure ld--it works, but it doesn't support shared libraries. + +Sun Aug 28 18:13:45 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * config.guess (*-unknown-freebsd*): Get rid of possible + trailing "(Release)" in version string. + Patch from Paul Richards . + +Sat Aug 27 15:00:49 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * config.guess: Fix i486-ncr-sysv43 -> i486-ncr-sysv4.3. + Fix type: *-next-neststep -> *-next-nextstep. + + * config.guess: Merge from FSF: + + Fri Aug 26 18:45:25 1994 Philippe De Muyter (phdm@info.ucl.ac.be) + + * config.guess: Recognize powerpc-ibm-aix3.2.5. + + Wed Apr 20 06:36:32 1994 Philippe De Muyter (phdm@info.ucl.ac.be) + + * config.guess: Recognize UnixWare 1.1 (UNAME_SYSTEM is SYSTEM_V + instead of UNIX_SV for UnixWare 1.0). + +Sat Aug 27 01:56:30 1994 Stu Grossman (grossman@cygnus.com) + + * Makefile.in (all-gdb): Add dependencies on all-gcc and all-ld + to make gdb/nlm/* build after the compiler and linker. + +Fri Aug 26 14:30:05 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * config.guess (netbsd, freebsd, linux): Accept any machine, + not just i[34]86. + (m68k-atari-sysv4): Relocate to match FSF version. + + * config.guess: More merges from the FSF: + + Add a space before function call or macro invocation. + + Tue May 10 16:53:55 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * config.guess: Add trap cmd to remove dummy.c and dummy when + interrupted. + + Wed Apr 20 18:07:13 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * config.guess (dummy.c): Redirect stderr for `hostinfo' command. + (dummy): Redirect stderr from compilation of dummy.c. + + Sat Apr 9 14:59:28 1994 Christian Kranz (kranz@sent5.uni-duisburg.de) + + * config.guess: Distinguish between NeXTStep 2.1 and 3.x. + +Fri Aug 26 13:42:20 1994 Ken Raeburn (raeburn@kr-laptop.cygnus.com) + + * configure: Accept and ignore --cache*, for compatibility with + new autoconf. + +Fri Aug 26 13:05:27 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * config.guess: Merge from FSF: + + Thu Aug 25 20:28:51 1994 Richard Stallman + + * config.guess (Pyramid*:OSx*:*:*): New case. + (PATH): Add /.attbin at end for finding uname. + (dummy.c): Handle i860-alliant-bsd. Follow whitespace conventions. + + Wed Aug 17 18:21:02 1994 Tor Egge (tegge@pvv.unit.no) + + * config.guess (M88*:DolphinOS:*:*): New case. + + Thu Aug 11 17:00:13 1994 Stan Cox (coxs@dg-rtp.dg.com) + + * config.guess (AViiON:dgux:*:*): Use TARGET_BINARY_INTERFACE + to select whether to use ELF or COFF. + + Sun Jul 24 16:20:53 1994 Richard Stallman + + * config.guess: Recognize i860-stardent-sysv and i860-unknown-sysv. + + Sun May 1 10:23:10 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * config.guess: Guess the OS version for HPUX. + + Tue Mar 1 21:53:03 1994 Karl Heuer (kwzh@hal.gnu.ai.mit.edu) + + * config.guess (UNAME_VERSION): Recognize aix3.2.4 and aix3.2.5. + +Fri Aug 26 11:19:08 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * configure.in: Recognize --with-headers, --with-libs, and + --without-newlib. + * Makefile.in (all-xiberty): Depend upon all-ld. + +Wed Aug 24 12:36:50 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * configure.in: Change i[34]86 to i[345]86. + +Mon Aug 22 10:58:33 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * configure (version): A few more tweaks to help message. + +Fri Aug 19 12:40:25 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * Makefile.in: Remove (for now) librx as a host library, + now that we're building it for target. + +Fri Aug 19 10:49:17 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * configure: Fix up help message; from karl@owl.hq.ileaf.com + (Karl Berry). + +Tue Aug 16 16:11:08 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * configure.in: Also configure librx. + +Mon Aug 15 16:51:45 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * Makefile.in: Update various rules to reflect that librx + is now needed for libg++. + +Fri Aug 12 18:07:21 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * config.sub: Accept mips64orion and mips64orionel as a CPU name. + +Mon Aug 8 11:36:17 1994 Stan Shebs (shebs@andros.cygnus.com) + + * configure.in: Configure the examples directory. + +Thu Aug 4 16:12:36 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * configure: Simplify Jun 2 1994 change. + +Wed Aug 3 04:58:16 1994 D. V. Henkel-Wallace (gumby@cygnus.com) + + * change CC to /usr/latest/bin/gcc for lynx host builds, since + /bin/gcc isn't good enough to build gcc. + +Wed Jul 27 09:07:14 1994 Fred Fish (fnf@cygnus.com) + + * Makefile.in (GDB_SUPPORT_FILES): Remove + (setup-dirs-gdb, gdb.tar.gz, make-gdb.tar.gz): Remove old rules. + (gdb.tar.gz): Add new rule to use standard distribution building + mechanism. + +Mon Jul 25 11:10:06 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure.in: Warn about use of /usr/ucb/cc on Solaris. From + Bill Cox . + +Sat Jul 23 12:19:46 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * config.guess: Recognize ISC. Patch from kwzh@gnu.ai.mit.edu. + +Fri Jul 22 17:53:59 1994 Stu Grossman (grossman@cygnus.com) + + * configure: Search current dir first in .gdbinit. + +Fri Jul 22 11:28:30 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * config.sub: Recognize freebsd (merged from gcc config.sub). + +Thu Jul 21 14:10:52 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * config.sub: Refer to NeXT's operating system as nextstep. + + * config.sub (case $basic_machine): Re-order the cases, to match + the order in the FSF version (which is mostly alphabethical). + Merge in some additions and changes from the FSF. + +Sat Jul 16 12:03:08 1994 Stan Shebs (shebs@andros.cygnus.com) + + * config.guess: Recognize m68k-atari-sysv4 and m88k-harris-csux7. + * config.sub: Recognize cxux7. + * configure.in: Use mh-cxux for m88k-harris-cxux*. + +Mon Jul 11 14:37:39 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * config.sub: Fix typo powerpc -> powerpc-*. + +Sat Jul 9 13:03:43 1994 Michael Tiemann (tiemann@blues.cygnus.com) + + * Makefile.in: `all-emacs19' depends on `all-byacc'. + + * Makefile.in: Add all-emacs19 and install-emacs19 rules (in + parallel with all-emacs and install-emacs). Top-level command + `make all-emacs19 CC=gcc' now behaves as `make all-emacs CC=gcc'. + +Thu Jun 30 16:53:42 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * test-build.mk ($(host)-stamp-stage2-installed): Remove + $(relbindir)/make before doing ``make install'', and use + $(GNU_MAKE) while doing it. Avoids problem on SunOS with + installing over running make binary. + ($(host)-stamp-stage3-installed): Likewise. + +Tue Jun 28 13:43:25 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.guess: Recognize Mach. + +Mon Jun 27 16:41:14 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * configure: Check ${exec_prefixoption}, not ${exec_prefix}, to + see whether --exec-prefix was used. + +Sun Jun 26 21:15:54 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * README: Explicitly mention libg++/README. (Zoo's idea.) + +Tue Jun 21 12:45:55 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in: Add all-librx target similar to all-libproc. + +Wed Jun 8 23:11:55 1994 Stu Grossman (grossman@cygnus.com) + + * config.guess: Rearrange tests for Alpha-OSF1 to properly deal + with post 1.2 uname bogosity. + +Thu Jun 9 00:27:59 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure: Remove temporary files on receipt of a signal. + +Tue Jun 7 12:06:24 1994 Ian Lance Taylor (ian@cygnus.com) + + * configure: If there is a package_makefile_frag, remove + ${subdir}/Makefile.tem after copying it in. + +Mon Jun 6 21:35:02 1994 D. V. Henkel-Wallace (gumby@cygnus.com) + + * build_all.mk: support rs6000 lynx identifies itself as + rs6000-lynx-lynxos2.2.2. Also, use /usr/cygnus/progressive/bin/gcc + since /bin/gcc is too feeble to compile a modern gcc. + +Mon Jun 6 16:06:34 1994 Karen Christiansen (karen@cirdan.cygnus.com) + + * brought devo/test-build.mk update-to-date with progressive/ + test-build.mk. Add lynx targets and hppa flag info. + +Sat Jun 4 17:23:54 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * configure.in: Use mh-ncrsvr43. Patch from + Tom McConnell . + +Fri Jun 3 17:47:24 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * config.guess (i386-unknown-bsdi): No longer need to + check #if defined(__bsdi__) && defined(__i386__). + +Thu Jun 2 18:56:46 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure: Set program_transform_nameoption correctly. + +Thu Jun 2 10:57:06 1994 Karen Christiansen (karen@cirdan.cygnus.com) + + * brought build-all.mk update-to-date with progressive build-all.mk, + added new targets and hppa info. + +Thu Jun 2 00:12:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure: If config.guess result is a prefix of the user + specified target, assume a native build and use the user specified + target as the host alias. Remove SunOS patch suffix removal hack. + * configure.in: Remove SunOS patch suffix removal hack. + + * Makefile.in (CROSS_CHECK_MODULES): Remove check-flex, since it's + in NATIVE_CHECK_MODULES. + +Wed Jun 1 10:49:41 1994 Bill Cox (bill@rtl.cygnus.com) + + * Makefile.in: Rename HOST_ONLY to NATIVE. + * configure: Delete SunOs patch suffix from host_canonical + and build_canonical variables that are prepended to Makefiles. + * configure.in: Add comments for easier maintenance. + +Tue May 31 19:39:47 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in: Add all-libproc target similar to all-gui. + +Tue May 31 17:16:33 1994 Tom Lord (lord@cygnus.com) + + * Makefile.in (CHECK_MODULES): split into + HOST_ONLY_CHECK_MODULES and CROSS_CHECK_MODULES. + +Tue May 31 16:36:36 1994 Paul Eggert (eggert@twinsun.com) + + * config.guess (i386-unknown-bsdi): New system to guess. + +Wed May 25 16:47:10 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in: Add all-gui target (but not yet build by "all"). + +Thu May 26 08:53:19 1994 Bill Cox (bill@rtl.cygnus.com) + + * config.sub: Move deletion of patch suffix from here... + * configure.in: To here, at Ian's suggestion. The top- + level scripts might need to know of a patch level. + +Wed May 25 09:15:54 1994 Bill Cox (bill@rtl.cygnus.com) + + * config.sub: Strip off patch suffix so rtl is recognized + as a sunos4.1.3 machine, even though it's been patched. + +Fri May 20 08:25:49 1994 Steve Chamberlain (sac@deneb.cygnus.com) + + * Makefile.in (INSTALL_LAST): Delete. + (INSTALL_DOSREL): New. + +Thu May 19 17:12:12 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure.in: Use ld for i[34]86-*-sysv4* and sparc-*-solaris2*. + Don't set use_gnu_ld to no for *-*-sysv4; that only controls + whether we pass down --with-gnu-ld anyhow. + +Thu May 19 09:29:12 1994 Steve Chamberlain (sac@cygnus.com) + + * Makefile.in (INSTALL_LAST): Change operation so it works + on more flavors of make. + * configure.in (go32): Don't build libg++ or libio. + +Fri May 13 13:28:34 1994 Steve Chamberlain (sac@cygnus.com) + + * Makefile.in (Move HOST_PREFIX_1 and friends up so + they can be overriden by templates. + +Sat May 7 16:46:44 1994 Steve Chamberlain (sac@cygnus.com) + + * configure.in (target==go32): Don't build gdb. + * dosrel: New directory. + +Fri May 6 14:19:25 1994 Steve Chamberlain (sac@cygnus.com) + + * configure.in (host==go32): Configure dosrel too. + * Makefile.in (INTALL_TARGET): Call INSTALL_LAST last. + (HOST_CC, HOST_PREFIX, HOST_PREFIX_1): Undefine, they should + be set by incoming names or templates. + (INSTALL_LAST): New rule. + +Thu May 5 17:35:05 1994 Stan Shebs (shebs@andros.cygnus.com) + + * config.sub (sparclitefrw, sparclitefrwcompat): Don't set the os. + +Thu May 5 20:06:45 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * configure.in (appdirs): New variable. Currently empty, but will + be used in gas distribution. If nonempty, lists a set of + directories at least one of which must get configured, or top + level configuration is considered to have failed. + (rs6000-*-lynxos*): Use new file name. + +Thu May 5 13:38:36 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Eliminate XTRAFLAGS. + * Makefile.in (CC_FOR_TARGET): If newlib exists, refer to the + newlib include files using -idirafter, and also use -nostdinc. + (CXX_FOR_TARGET): Likewise. + (XTRAFLAGS): Removed. + (BASE_FLAGS_TO_PASS): Remove XTRAFLAGS_FOR_TARGET. + (EXTRA_HOST_FLAGS): Remove XTRAFLAGS. + (EXTRA_TARGET_FLAGS, EXTRA_GCC_FLAGS): Likewise. + ($(DO_X)): Don't pass down XTRAFLAGS. + +Thu May 5 00:16:36 1994 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * configure.in (mips*-dec-bsd*): New target; do build linker. + (mips*-*-bsd*): New target; don't build linker. + +Wed May 4 20:10:10 1994 D. V. Henkel-Wallace (gumby@cygnus.com) + + * configure.in: support rs6000-*-lynxos* configuration. + support sunos4 as a cross target. + + * config.sub: look for lynx*, not lynx since the OS version may + legitimately be part of the name. + +Tue May 3 21:48:11 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * configure.in (i[34]86-*-sco*): Move to be with other i386 + targets. + (romp-*-*): New target. Skip various binary utilities. + (vax-*-*): New target. Don't build newlib. + (vax-*-vms): Renamed from *-*-vms. Don't build opcodes or newlib. + +Thu Apr 28 15:03:05 1994 David J. Mackenzie (djm@rtl.cygnus.com) + + * configure.in: Only set host_makefile_frag if config + directory exists. + +Wed Apr 27 12:14:30 1994 David J. Mackenzie (djm@rtl.cygnus.com) + + * install.sh: If $dstdir exists, don't check whether each + component does. + +Tue Apr 26 18:11:33 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * test-build.mk (HOLES): Add sleep; used by rcs/src/conf.sh. + +Mon Apr 25 15:06:34 1994 Stan Shebs (shebs@andros.cygnus.com) + + * configure.in (*-*-lynxos*): Don't configure newlib for either + native or cross Lynx. + +Sat Apr 16 11:58:16 1994 Doug Evans (dje@canuck.cygnus.com) + + * config.sub (sparc64-elf): Fix os. + (z8k): Remove duplicate. + +Thu Apr 14 23:33:17 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * Makefile.in (gcc-no-fixedincludes): Touch gcc/include/fixed, not + gcc/stmp-fixproto, to try to prevent fixproto from being run. + +Wed Apr 13 15:14:52 1994 Bill Cox (bill@cygnus.com) + + * configure: Make file links cleanly even if Lynx fails on + an NFS symlink (at least fail cleanly). + +Mon Apr 11 10:58:56 1994 Jim Wilson (wilson@sphagnum.cygnus.com) + + * test-build.mk (CC): For mips-sgi-irix4, change -XNh1500 to + -XNh2000. + +Sat Apr 9 15:10:45 1994 David J. Mackenzie (djm@rtl.cygnus.com) + + * configure: Unknown options are fatal again. + +Fri Apr 8 12:01:41 1994 David J. Mackenzie (djm@cygnus.com) + + * configure: Ignore --x-includes and --x-libraries, for Autoconf + compatibility. + +Thu Apr 7 17:31:43 1994 Doug Evans (dje@canuck.cygnus.com) + + * build-all.mk: Add `clean' target. + +Wed Apr 6 20:44:56 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * config.guess: Add SINIX support. + * configure.in: Add mips-*-sysv4* support. + +Mon Apr 4 17:41:44 1994 Doug Evans (dje@canuck.cygnus.com) + + * build-all.mk: Document all useful targets. + If canonhost is sparc-sun-solaris2.3, change it to sparc-sun-solaris2. + If canonhost is mips-sgi-irix4.0.5H, change it to mips-sgi-irix4. + +Thu Mar 31 04:55:57 1994 David J. Mackenzie (djm@rtl.cygnus.com) + + * configure: Support --silent, --quiet. + +Wed Mar 30 21:37:38 1994 David J. Mackenzie (djm@rtl.cygnus.com) + + * configure: Support --disable-FEATURE. + +Tue Mar 29 19:15:05 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.guess: Recognize NCR running SVR4.3. + +Mon Mar 28 14:55:15 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * config.guess: Make BSDI generate i386-unknown-bsd386. + Patch from Paul Eggert . + +Mon Mar 28 12:54:52 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure.in (powerpc-*-aix*): Treat like rs6000-*-*. + +Sat Mar 26 11:25:48 1994 David J. Mackenzie (djm@rtl.cygnus.com) + + * configure: Make unrecognized options give nonfatal warnings + instead of fatal errors, and pass them to any subdirectory + configures in case they recognize them. + Make --x equivalent to --with-x. + +Fri Mar 25 21:52:10 1994 David J. Mackenzie (djm@rtl.cygnus.com) + + * configure: Add --enable-* options. Clean up usage message and + some comments. + +Thu Mar 24 09:12:53 1994 Doug Evans (dje@canuck.cygnus.com) + + * Makefile.in (NM_FOR_TARGET): Build tree version is now nm.new. + +Sun Mar 20 11:28:22 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * configure.in (hppa*-*-*): Enable binutils. + +Sat Mar 19 11:50:16 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.sub: Recognize cisco. + +Fri Mar 18 16:42:32 1994 Jason Merrill (jason@deneb.cygnus.com) + + * Makefile.in (CXXFLAGS): Add -fexternal-templates. + +Tue Mar 15 11:25:55 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.guess: about target *-hitachi-hiuxwe2, don't print more + than one configuration name. Add comment. + +Sun Mar 6 23:13:38 1994 Hisashi MINAMINO (minamino@sra.co.jp) + + * config.guess: about target *-hitachi-hiuxwe2, fixed + machine guessing order. [Hitachi's CPU_IS_HP_MC68K + macro is incorrect.] + +Sun Mar 13 09:10:08 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in (TAGS): Just build TAGS in each subdirectory, rather + than the "make ls" stuff which used to be here. + +Fri Mar 11 12:52:39 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * config.guess: Recognize i[34]86-unknown-freebsd. + From Shawn M Carey . + +Thu Mar 3 14:24:21 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * configure.in (noconfigdirs for alpha): Remove libg++ and libio. + +Wed Mar 2 13:28:48 1994 Jim Kingdon (kingdon@deneb.cygnus.com) + + * config.guess: Check for ptx. + +Mon Feb 28 16:46:50 1994 Kung Hsu (kung@mexican.cygnus.com) + + * config.sub: Add os9k checking. + +Thu Feb 24 07:09:04 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * config.guess: Handle OSF1 running on HPPA processors + +Fri Feb 18 14:14:00 1994 Ken Raeburn (raeburn@rtl.cygnus.com) + + * configure: If subdir configure fails, print out a message with + subdirectory name, in case subdir's configure code didn't identify + itself. + +Fri Feb 18 12:50:15 1994 Doug Evans (dje@cygnus.com) + + * configure.in: Remove embedded newlines from configdirs. + Avoid mismatches of substrings. Fix matching strings at end + of configdirs. + +Fri Feb 11 15:33:33 1994 Stu Grossman (grossman at cygnus.com) + + * config.guess: Add Lynx/rs6000 config support. + +Tue Feb 8 13:41:09 1994 Ken Raeburn (raeburn@rtl.cygnus.com) + + * configure.in (alpha-dec-osf1*, alpha*-*-*): Build gas. + +Mon Feb 7 15:42:36 1994 Jeffrey A. Law (law@cygnus.com) + + * configure.in (hppa*-*-osf*): Treat this just like most other + PA configurations (eg no binutils or ld). + (hppa*-*-*elf*): These configurations have binutils and ld. + +Sun Feb 6 16:35:07 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * config.sub (hiux): Fix typo. From m-kasahr@sramhc.sra.co.JP. + +Sat Feb 5 01:00:33 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure.in (rs6000-*-*): Build gas. + +Wed Feb 2 13:57:57 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * Makefile.in: Avoid bug in losing hpux sed. + +Wed Feb 2 14:53:05 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in, test-build.mk: Remove MUNCH_NM; it was only needed + for GDB and GDB has been fixed to not need it. + +Sun Jan 30 17:58:06 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * config.guess: Recognize vax hosts. + +Fri Jan 28 15:29:38 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * configure (while loop): Don't use "break 2" inside case + statement -- the case statement isn't an enclosing loop. + +Mon Jan 24 18:40:06 1994 Per Bothner (bothner@kalessin.cygnus.com) + + * config.guess: Clean up NeXT support, to allow nextstep + on Intel machines. Make OS be nextstep. + +Sun Jan 23 18:47:22 1994 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * config.guess: Add alternate forms for Convex. + +Thu Jan 20 16:13:41 1994 Stu Grossman (grossman at cygnus.com) + + * configure: Completely rewrite option processing. Take + advantage of pattern-matching to avoid invoking test frequently. + Also clean up host and target defaulting logic. + +Mon Jan 17 15:06:56 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * Makefile.in: Replace all occurrances of "rootme" with "r" and + "$${rootme}" with "$$r", to increase the likelihood that the do-* + commands (plus user environment) will fit SCO limits. + +Thu Jan 6 11:20:57 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure.in: Don't issue warnings about directories which are + not being configured if -norecursion is set. Correct test for + --with-gnu-as and --with-gnu-ld to not get confused by substring + matches. + + * configure.in: Don't build gas for alpha-dec-osf1*. + +Tue Jan 4 17:10:19 1994 Stu Grossman (grossman at cygnus.com) + + * configure: Back out Per's change of 12/19/1993. It changes the + behavior of configure in unexpected and confusing ways. + + Also, use different delim char when calculating + program_transform_name so that the name can contain slashes. + +Sat Jan 1 13:45:31 1994 Rob Savoye (rob@darkstar.cygnus.com) + + * configure.in, config.sub: Add support for VSTa micro-kernel. + +Sat Dec 25 20:00:47 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * configure.in: Nuke hacks which were used to get a special + version of GAS for HPPA configurations. + +Sun Dec 19 20:40:44 1993 Per Bothner (bothner@kalessin.cygnus.com) + + * configure: If only ${target_alias} is given, use that + as the default for ${host_alias}. + * configure: Add missing back-slashes before nested quotes. + +Wed Dec 15 18:07:18 1993 david d `zoo' zuhn (zoo@andros.cygnus.com) + + * Makefile.in (BASE_FLAGS_TO_PASS): add YACC=$(BISON) + +Tue Dec 14 21:25:33 1993 Per Bothner (bothner@cygnus.com) + + * config.guess: Recognize some Tektronix configurations. + From Kaveh R. Ghazi . + +Sat Dec 11 11:18:00 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * config.sub: Match any flavor of SH. + +Thu Dec 2 17:16:58 1993 Ken Raeburn (raeburn@cujo.cygnus.com) + + * configure.in: Don't try to configure newlib for Alpha. + +Thu Dec 2 14:35:54 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure.in: Don't build ld for Irix 5. Don't build gas, + libg++ or libio for any Alpha target. + + * configure.in (mips*-sgi-irix5*): New target; use mh-irix5. + +Wed Dec 1 17:00:33 1993 Jason Merrill (jason@deneb.cygnus.com) + + * Makefile.in (GZIPPROG): Renamed from GZIP, which gzip uses for + default arguments -- so it tried to compress itself. + +Tue Nov 30 13:45:15 1993 david d `zoo' zuhn (zoo@andros.cygnus.com) + + * configure.in (notsupp): ensure that a space is always at the end + of the configdirs list, since the grep checks for an explicit space + +Tue Nov 16 15:04:27 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * configure.in (target i386-sysv4.2): don't build ld, since static + versions of many libraries are not available. + +Tue Nov 16 14:28:12 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.guess: Recognize Apollos (using environment variables). + * configure.in: Don't configure ld, binutils, or gprof for Apollo. + +Thu Nov 11 12:03:50 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.guess: Recognize Sony news mips running newsos. + +Wed Nov 10 16:57:00 1993 Mark Eichin (eichin@cygnus.com) + + * Makefile.in (all-cygnus, build-cygnus): "fi else" needs to be + "fi ; else" for bash. + +Tue Nov 9 15:54:01 1993 Mark Eichin (eichin@cygnus.com) + + * Makefile.in (BASE_FLAGS_TO_PASS): pass SHELL. + +Fri Nov 5 08:07:27 1993 D. V. Henkel-Wallace (gumby@blues.cygnus.com) + + * config.sub: accept unixware as an alias for svr4.2. + Fix some inconsistancies with the gcc version. + +Fri Nov 5 15:14:12 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in (DISTDOCDIRS): Add gdb. + +Fri Nov 5 11:59:42 1993 Per Bothner (bothner@kalessin.cygnus.com) + + * Makefile.in (DISTDOCDIRS): Add libg++ and libio. + +Fri Nov 5 10:35:05 1993 Ken Raeburn (raeburn@rover.cygnus.com) + + * Makefile.in (taz): Only build "info" in DISTDOCDIRS. + (DISTDOCDIRS): Don't assume libg++ and gdb folks necessarily want + this now. + +Thu Nov 4 18:58:23 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.sub: Accept hiux* as an OS name. + + * Makefile.in: Change RUNTEST_FLAGS back to RUNTESTFLAGS per + etc/make-stds.texi. The underscore came from gcc, and dje now + agrees that RUNTESTFLAGS is the correct name. + +Thu Nov 4 10:49:01 1993 Per Bothner (bothner@kalessin.cygnus.com) + + * install.sh: Remove 'set -e'. It makes any conditionals + in the script useless. + + * config.guess: Automatically recognize arm-acorn-riscix + Patch from Richard Earnshaw (rwe11@cl.cam.ac.uk). + +Thu Nov 04 08:08:04 1993 Jeffrey Wheat (cassidy@cygnus.com) + + * Makefile.in: Change RUNTESTFLAGS to RUNTEST_FLAGS + +Wed Nov 3 22:09:46 1993 Ken Raeburn (raeburn@rtl.cygnus.com) + + * Makefile.in (DISTDOCDIRS): New variable. + (taz): Edit local Makefile.in sooner, instead of proto-toplev + Makefile.in later. Build "info" and "dvi" in DISTDOCDIRS. + +Wed Nov 3 21:31:52 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * configure.in (hppa target): check the source directory for the + pagas sub-directory + +Wed Nov 3 11:12:22 1993 Doug Evans (dje@canuck.cygnus.com) + + * config.sub: Allow -aout* and -elf*. + +Wed Nov 3 11:08:33 1993 Ken Raeburn (raeburn@rtl.cygnus.com) + + * configure.in: Don't build ld on i386-solaris2, same as for + sparc-solaris2. + +Tue Nov 2 14:21:25 1993 Per Bothner (bothner@kalessin.cygnus.com) + + * Makefile.in (taz): Add texinfo/lgpl.texinfo (for libg++). + +Tue Nov 2 13:38:30 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * configure.in: Configure gdb for alpha. + +Mon Nov 1 10:42:54 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in (CXXFLAGS): Add -O. + +Wed Oct 27 10:45:06 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * config.guess: added support for DG Aviion + +Tue Oct 26 14:37:37 1993 Ken Raeburn (raeburn@rover.cygnus.com) + + * configure.in: Produce warning message for subdirectories not + configurable for this host/target combination. Don't try to + configure gdb for vms. + +Mon Oct 25 11:22:15 1993 Ken Raeburn (raeburn@rover.cygnus.com) + + * Makefile.in (taz): Replace "byacc" with "bison -y" in the + appropriate files before making "diststuff". + (DISTBISONFILES): New var: list of files to be edited. + (DISTSTUFFDIRS): Add binutils. + +Fri Oct 22 20:32:15 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * config.sub: also handle mipsel and mips64el (for little endian mips) + +Fri Oct 22 07:59:20 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * configure.in: Add * to end of all OS names. + +Thu Oct 21 11:38:28 1993 Stan Shebs (shebs@rtl.cygnus.com) + + * configure.in: Build newlib for LynxOS native. + +Wed Oct 20 09:56:12 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.guess: Add support for delta 88k running SVR3. + + * configure.in: Add comment about HP compiler vs. emacs. + +Tue Oct 19 16:02:22 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * configure.in: don't build ld on solaris2 (not a viable option + due to bugs in getpwnam & getpwuid) + +Tue Oct 19 15:13:56 1993 Ken Raeburn (raeburn@rtl.cygnus.com) + + * configure.in: Accept alpha-dec-osf1*, not just -osf1, since + config.guess will produce a full version number. + +Tue Oct 19 15:58:01 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure.in: Build linker and binutils for alpha-dec-osf1. + +Tue Oct 19 11:41:55 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in: Remove -O from CXXFLAGS for consistency with CFLAGS, + and gdb/testsuite/Makefile.in. + +Sat Oct 9 18:39:07 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * configure.in: recognize mips*- instead of mips- + +Fri Oct 8 14:15:39 1993 Ken Raeburn (raeburn@cygnus.com) + + * config.sub: Accept linux*coff and linux*elf as operating + systems. + +Thu Oct 7 12:57:19 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * config.sub: Recognize mips64, and mips3 as an alias for it. + +Wed Oct 6 13:54:21 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * configure.in: Remove alpha-dec-osf*, no longer necessary now that + gdb knows how to handle OSF/1 shared libraries. + +Tue Oct 5 11:55:04 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * configure.in: Recognize hppa*-*-hiux* (currently synonym for hpux). + * config.guess: Recognize Hitachi's HIUX. + * config.sub: Recognize h3050r* and hppahitachi. + Remove redundant cases for hp9k[23]*. + +Mon Oct 4 16:15:09 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * configure.in: default to '--with-gnu-as' and '--with-gnu-ld' + if gas and ld are in the source tree and are in ${configdirs}. + If ${use_gnu_as} or ${use_gnu_ld} are 'no', then don't set the + --with options (but still pass them down on the command line, + if they were explicitly specified). + +Fri Sep 24 19:11:13 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * configure: substitute SHELL value in Makefile.in with + ${CONFIG_SHELL} + +Thu Sep 23 18:05:13 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure.in: Build gas, ld, and binutils for *-*-sysv4* and + *-*-solaris2* targets. + +Sun Sep 19 17:01:41 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * Makefile.in: define M4, and pass it down to sub-makes; + all-autoconf now depends on all-m4 + +Sat Sep 18 00:38:23 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * Makefile.in ({AR,RANLIB}_FOR_TARGET): make contingent on + presence of {ar,ranlib} instead of a configured directory + +Wed Sep 15 08:41:44 1993 Jim Kingdon (kingdon@cirdan.cygnus.com) + + * config.guess: Accept 34?? as well as 33?? for NCR. + +Mon Sep 13 12:28:43 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * configure.in: grab mt-hppa for HPPA targets; use 'gas ' instead + of 'gas' in sed commands, since 'gash' is now in the tree as well. + +Fri Sep 10 11:23:52 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * configure: grab values for $(CC) and $(CXX) from the + environment, so that someone can do "CC=gcc configure; make" and + have it work right (matching the way that autoconf works now) + + * configure.in, Makefile.in: add support for gash, the tcl + interface to Galaxy + + * config.guess: add NetBSD variants (hp300, x86) + +Thu Sep 9 16:48:52 1993 Jason Merrill (jason@deneb.cygnus.com) + + * install.sh: Support -d option (in the manner of SunOS 4 install, + as it is more deterministic than that of GNU install) + (chmodcmd): Set file to mode 755 by default (should also do default + chgrp and chown, but I don't feel like dealing with that now) + +Tue Sep 7 11:59:39 1993 Doug Evans (dje@canuck.cygnus.com) + + * config.sub: Remove h8300hhms alias. + +Tue Aug 31 11:00:09 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * configure.in: Match *-*-solaris2* not *-sun-solaris2*. + +Mon Aug 30 18:29:10 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * Makefile.in (gcc-no-fixedincludes): touch stmp-fixproto as well + as stmp-fixinc + +Wed Aug 25 16:35:59 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + * config.sub: recognize m88110-bug-coff. + +Tue Aug 24 10:23:24 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * Makefile.in (all-libio): all dependencies on the toolchain used + to build this (gcc, gas, ld, etc) + +Fri Aug 20 17:24:24 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.guess: Deal with OSF/1 1.3 on alpha. + +Thu Aug 19 11:43:04 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * install.sh: add some 'else true' clauses for portability + + * configure.in: don't build libio for h8[35]00-*-* targets + +Tue Aug 17 19:02:31 1993 Per Bothner (bothner@kalessin.cygnus.com) + + * Makefile.in: Add support for new libio. + +Sun Aug 15 20:48:55 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * install.sh: If one command fails, don't try the rest. Don't try + to remove $dsttmp (via trap) unless we have already created it. + If $src doesn't exist, detect it and exit with an error. + + * config.guess: Recognize BSD on hp300. + +Wed Aug 11 18:35:13 1993 Per Bothner (bothner@kalessin.cygnus.com) + + * config.guess: Map (9000/[34]??:HP-UX:*:*) to m68k-hp-hpux. + Bug report from "Hamish (H.I.) Macdonald" . + +Wed Aug 11 15:37:51 1993 Jason Merrill (jason@deneb.cygnus.com) + + * Makefile.in (all-send-pr): depends on all-prms + +Wed Aug 11 16:56:03 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.guess: Fix typo (9000/8??:4.3bsd -> 9000/7??:4.3bsd). + +Fri Aug 6 14:45:02 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * config.guess: From michael@mercury.cs.mun.ca (Michael Rendell): + Added test for mips-mips-riscos5. + +Thu Aug 5 15:45:08 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * configure.in: use mh-hp300 for 68k HP hosts + +Mon Aug 2 11:56:53 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * configure: add support for CONFIG_SHELL, so that you can use + some alternate shell for evaluating configure scripts + +Sun Aug 1 11:36:27 1993 Fred Fish (fnf@deneb.cygnus.com) + + * Makefile.in (make-gdb.tar.gz): Sed bug reporting address + in configure script to bug-gdb@prep.ai.mit.edu when building + distribution archive. + * Makefile.in (COMPRESS): Remove def. + * Makefile.in (gdb.tar.gz, make-gdb.tar.gz): Renamed from + gdb.tar.Z and make-gdb.tar.Z respectively. + * Makefile.in (make-gdb.tar.gz): Now only build gzip'd archive. + * Makefile.in (make-gdb.tar.gz): Minor changes to move closer + to convergence with 'taz' target in Makefile.in. + +Fri Jul 30 12:34:57 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * install.sh (dsttmp): use trap to ensure that tmp files go + away on error conditions + +Wed Jul 28 11:57:36 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * Makefile.in (BASE_FLAGS_TO_PASS): remove LOADLIBES + +Tue Jul 27 12:43:40 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in (install-dirs): Deal with a prefix like /gnu; + its parent is '/' not ''. + + * Makefile.in (DEVO_SUPPORT): Add comments about ChangeLog. + +Fri Jul 23 09:53:37 1993 Jason Merrill (jason@wahini.cygnus.com) + + * configure: if ${newsrcdir}/configure doesn't exist, don't assume + that ${newsrcdir}/configure.in does. + +Tue Jul 20 11:28:50 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * test-build.mk: support for CONFIG_SHELL + +Mon Jul 19 21:54:46 1993 Fred Fish (fnf@deneb.cygnus.com) + + * config.sub (netware): Add as a basic system type. + +Wed Jul 14 12:03:11 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + * Makefile.in (Makefile): depend on configure.in. Also drop the + $(srcdir)/ from the dependency on Makefile.in. + +Tue Jul 13 20:10:58 1993 Doug Evans (dje@canuck.cygnus.com) + + * config.sub: Recognize h8300hhms as h8300h-hitachi-hms. + (h8300hhms is temporary until multi-libraries are implemented). + * configure.in: Handle h8300h too. + +Sun Jul 11 17:35:27 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.guess: Recognize dpx/2 as m68k-bull-sysv3. + +Thu Jul 8 18:26:12 1993 John Gilmore (gnu@cygnus.com) + + * configure: Remove extraneous output when guessing host type. + * config.guess: Remove extraneous output when guessing using C + compiler rather than uname, or when guessing fails. + +Wed Jul 7 17:58:14 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com) + + * Makefile.in: remove all.cross and install.cross targets + + * configure: remove CROSS=-DCROSS_COMPILE and ALL=all.cross + definitions + +Tue Jul 6 10:39:44 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * configure.in (target sh): Build gprof. + +Thu Jul 1 16:52:56 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * config.sub: change -solaris to -solaris2 + +Thu Jul 1 15:46:16 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * configure.in: Use config/mh-riscos for mips-*-sysv*. + +Wed Jun 30 09:31:58 1993 Ian Lance Taylor (ian@cygnus.com) + + * configure: Correct error message for missing Makefile.in to + print correct directory. + +Tue Jun 29 13:52:16 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * install.sh: kludge around 386BSD shell bug + +Tue Jun 29 13:06:49 1993 Per Bothner (bothner@rtl.cygnus.com) + + * config.guess: Recognize NeXT. + * config.guess: Recognize i486-ncr-sysv4. + * Makefile.in (taz): rm $(TOOL)-$$VER before linking. + +Tue Jun 29 12:50:57 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (MAKEINFOFLAGS): New variable. + (FLAGS_TO_PASS): Pass MAKEINFO as MAKEINFO MAKEINFOFLAGS. + * build-all.mk, test-build.mk: Pass down --no-split as + MAKEINFOFLAGS when hosted on DOS. Compile DOS hosted without -g. + +Thu Jun 24 13:39:11 1993 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in (DEVO_SUPPORT): Add COPYING COPYING.LIB install.sh. + +Wed Jun 23 12:59:21 1993 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in (libg++.tar.z): New rule. + * Makefile.in (taz): Replace 'configure -rm' by 'make distclean'. + * Makefile.in (taz): Only do a single chmod. + +Fri Jun 18 12:03:10 1993 david d `zoo' zuhn (zoo at majipoor.cygnus.com) + + * install.sh: don't use dirname anymore (replaced with sed usage) + +Thu Jun 17 18:43:42 1993 Fred Fish (fnf@cygnus.com) + + * Makefile.in: Change extension for gzip'd files from '.z' to + '.gz' per new FSF standard usage. + +Thu Jun 17 16:58:50 1993 david d `zoo' zuhn (zoo at majipoor.cygnus.com) + + * configure: put quotes around the final value of program_transform_name + +Tue Jun 15 16:48:51 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: new install.sh support; update install-info rules + +Wed Jun 9 12:31:34 1993 Ian Lance Taylor (ian@cygnus.com) + + * configure.in: Build diff for crosses, but not for go32 host. + + * configure.in: Build gprof only for native, and don't build it + for mips-*-*, rs6000-*-*, or i[34]86-*-sco*. + +Mon Jun 7 13:12:11 1993 david d `zoo' zuhn (zoo at deneb.cygnus.com) + + * configure.in: don't build gas,ld,binutils on for *-*-sysv4 + +Mon Jun 7 11:40:11 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + * configure.in (host_tools): Add prms. + +Fri Jun 4 13:30:42 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: install gcc, do installation of $(INSTALL_MODULES) + with $(FLAGS_TO_PASS) on the command line + + * config.sub: Recognize lynx and lynxos + +Fri Jun 4 10:59:56 1993 Ian Lance Taylor (ian@cygnus.com) + + * config.sub: Accept -ecoff*, not just -ecoff. + +Thu Jun 3 17:38:54 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * Makefile.in (taz): Use .gz suffix instead of .z. + (binutils.tar.gz, gas+binutils.tar.gz, gas.tar.gz): Fixed target + names. + +Thu Jun 3 00:27:06 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in (vault-install): add an 'else true' (for Ultrix) + +Wed Jun 2 18:19:16 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in (install-no-fixedincludes): install gcc last, so + that rebuilds that might happen during 'make install' don't get + bogus gcc include files + +Wed Jun 2 16:14:10 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + Change from Utah for HPPA support: + * config.guess: Recognize hppa1.x-hp-bsd. + +Wed Jun 2 11:53:33 1993 Per Bothner (bothner@rtl.cygnus.com) + + * config.guess: Add support for Motorola Delta 68k, up to r3v7. + Patch from pot@fly.cnuce.cnr.it (Francesco Potorti`). + +Tue Jun 1 17:48:42 1993 Rob Savoye (rob at darkstar.cygnus.com) + + * config.sub: Add support for rom68k and bug boot monitors. + +Mon May 31 09:36:37 1993 Jim Kingdon (kingdon@cygnus.com) + + * Makefile.in: Make all-opcodes depend on all-bfd. + +Thu May 27 08:05:31 1993 Ian Lance Taylor (ian@cygnus.com) + + * config.guess: Added special check for i[34]86-univel-sysv4*. + +Wed May 26 16:33:40 1993 Ian Lance Taylor (ian@cygnus.com) + + * config.guess: For i[34]86-unknown-sysv4 use UNAME_MACHINE for + the processor rather than assuming i486. + +Wed May 26 09:40:18 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.guess: Recognize SunOS6 as Solaris3. + +Tue May 25 23:03:11 1993 Per Bothner (bothner@cygnus.com) + + * config.guess: Fix typo. Avoid #elif (not in K&R 1). + Recognize SunOS 5.* only (and not [6-9].*) as being Solaris2. + +Tue May 25 12:44:18 1993 Ian Lance Taylor (ian@cygnus.com) + + * build-all.mk (all-cross): New target for Canadian Cross. + Added Q2 go32 targets. + * test-build.mk: Configure go32 cross sparclite-aout and + mips-idt-ecoff -with-gnu-ld. Moved build binary directory from + PARTIAL_HOLE_DIRS to BUILD_HOLES_DIRS. + +Mon May 24 15:30:06 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: fix Alpha GDB typo; also, don't build DejaGnu for + GO32 hosted toolchains + +Mon May 24 14:18:41 1993 Rob Savoye (rob at darkstar.cygnus.com) + + * configure: change so "-exec-prefix" gets passed down rather + than "-exec_prefix" so autoconf generated Makefiles get the + exec_prefix set right. + +Fri May 21 10:42:25 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * config.guess: get the Solaris2 minor version number + + * Makefile.in: add standards.texi and make-stds.texi to ETC_SUPPORT + +Fri May 21 06:20:52 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + * config.guess: Recognize some Sequent platforms. + +Thu May 20 14:33:48 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: added the vault-install target + + * configure.in: actually use the Sun3 makefile fragment that's in + config, also added the release dir to configdirs + +Thu May 20 14:19:18 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * Makefile.in (taz): Fix modes on stuff in $(TOOL) dir also. + +Tue May 18 20:26:41 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: remove some program from Alpha targetted toolchains + +Tue May 18 15:23:19 1993 Ken Raeburn (raeburn@cygnus.com) + + * Makefile.in (DISTSTUFFDIRS): Renamed from PROTODIRS. Add ld and + gprof. + (taz): Run "make diststuff" in those directories instead of "make + proto-dir". Look for "VERSION=" only at start of line in subdir + Makefile. Use "gzip -9" for compression. + (TEXINFO_SUPPORT, DIST_SUPPORT, BINUTILS_SUPPORT_DIRS): New vars. + (binutils.tar.z): New target. + +Mon May 17 17:01:15 1993 Ken Raeburn (raeburn@deneb.cygnus.com) + + * Makefile.in (taz): Include gpl.texinfo. + +Fri May 14 06:48:38 1993 Ken Raeburn (raeburn@deneb.cygnus.com) + + * Makefile.in (setup-dirs): Merged into "taz" target. + (taz): Only do `proto-dir' stuff if a directory is actually needed + for this target. + +Wed May 12 13:09:44 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (MUNCH_NM): New variable, defined to be $(NM). + (FLAGS_TO_PASS): Pass down MUNCH_NM. + (HOST_CC, HOST_PREFIX, HOST_PREFIX_1): New variables. + (EXTRA_GCC_FLAGS): Pass down HOST_* variables. + (gcc-no-fixedincludes): Correct for current gcc Makefile. + +Tue May 11 10:14:25 1993 Fred Fish (fnf@cygnus.com) + + * Makefile.in (make-gdb.tar.Z): Add configure, config.guess, + config.sub, and move-if-change to gdb testsuite distribution + archive, so the testsuite can be extracted, configured, and + run separately from the gdb distribution. Blow away the Chill + tests that require a Chill compiled executable, since GNU Chill + is not yet publically available. + +Mon May 10 17:22:26 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * test-build.mk: set environment variables in a single command, + instead of a list of assignments and exports + + * config.guess: recognize Alpha/OSF1 systems + +Mon May 10 14:55:51 1993 K. Richard Pixley (rich@rtl.cygnus.com) + + * configure: Change help message to prefer --options rather than + -options. + +Mon May 10 05:58:35 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * config.sub: Convergent Tech. "miniframe" uses m68010, sez + zippy@ecst.csuchico.edu. + * config.guess: Recognize miniframe. + +Sun May 9 17:47:57 1993 Rob Savoye (rob at darkstar.cygnus.com) + + * Makefile.in: Use srcroot to find runtest rather than rootme. + Pass RUNTESTFLAGS and EXPECT down in BASE_FLAGS_TO_PASS. + +Fri May 7 14:55:59 1993 Ian Lance Taylor (ian@cygnus.com) + + * test-build.mk: Extensive additions to support building on a + machine other than the host. + +Wed May 5 08:35:04 1993 Ken Raeburn (raeburn@deneb.cygnus.com) + + * configure (tooldir): Fix for i386-aix again. + +Mon May 3 19:00:27 1993 Per Bothner (bothner@cygnus.com) + + * configure, Makefile.in: Change definition of $(tooldir) + to match the FSF. + +Fri Apr 30 15:55:21 1993 Fred Fish (fnf@cygnus.com) + + * config.guess: Recognize i[34]86/SVR4. + +Fri Apr 30 15:52:46 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * Makefile.in (all-gdb): gdb depends on sim. + +Thu Apr 29 23:30:48 1993 Fred Fish (fnf@cygnus.com) + + * Makefile.in (gdb.tar.Z): Make prototype gdb testsuite directory + at the same time we make the prototype gdb directory. + * Makefile.in (make-gdb.tar.Z): Make the testsuite distribution + files at the same time as the gdb base release distribution. + +Thu Apr 29 12:50:37 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (check): Use individual check targets rather than + DO_X rule. + (check-gcc): Added. + +Thu Apr 29 09:50:07 1993 Jim Kingdon (kingdon@cygnus.com) + + * config.sub: Use sysv3.2 not sysv32 for canonical OS + for System V release 3.2. + +Thu Apr 29 10:33:22 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * config.sub: Recognize hppaosf. + * configure.in: Do configure ld/binutils/gas for it. + +Tue Apr 27 06:25:34 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * configure (tooldir): Alter syntax used to set this, for systems + where "\$" isn't handled right, like i386-aix. + +Thu Apr 22 08:17:35 1993 Ian Lance Taylor (ian@cygnus.com) + + * configure: Pass program-transform-name, not + program_transform_name, to recursive configures. + +Thu Apr 22 02:58:21 1993 Ken Raeburn (raeburn@cygnus.com) + + * Makefile.in (gas+binutils.tar.z): New rule for building snapshots + of gas+ld+binutils. + +Mon Apr 19 17:41:30 1993 Per Bothner (bothner@cygnus.com) + + * config.guess: Recognize AIX3.2 as distinct from 3.1. + +Sat Apr 17 17:19:50 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: rename m88k-motorola-m88kbcs to m88k-motorola-sysv + +Tue Apr 13 16:52:16 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + * Makefile.in (PRMS): Set back to all-prms. + +Sat Apr 10 12:04:07 1993 Ian Lance Taylor (ian@cygnus.com) + + * test-build.mk: Pass -with-gnu-as for known MIPS native and MIPS + targets, rather than for MIPS hosts. + +Fri Apr 9 13:51:06 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: add comment for --with-x default values + + * config.guess: handle Motorola Delta88 box for SVR3 and SVR4. + + * Makefile.in: add check-* targets for each of the directories in + the tree. Add a definition of RUNTEST that will use the one we + just built, if it exists. Pass this down via FLAGS_TO_PASS. + +Thu Apr 8 09:21:30 1993 Ian Lance Taylor (ian@cygnus.com) + + * configure.in: Removed obsolete references to bfd_target and + target_makefile_frag. + + * build-all.mk: Set assorted targets for Q2. + * config.sub: Recognize z8k-sim and h8300-hms. + * test-build.mk: Really don't pass host to configure. + (HOLES): Added uname. + +Wed Apr 7 15:48:19 1993 Ian Lance Taylor (ian@cygnus.com) + + * configure: Handle an empty program-prefix, program-suffix or + program-transform-name correctly. + +Tue Apr 6 13:48:41 1993 Ian Lance Taylor (ian@cygnus.com) + + * build-all.mk: -G 8 no longer required for MIPS targets. + * test-build.mk: Don't pass host argument to configure; make it + guess. + +Tue Apr 6 10:36:53 1993 Fred Fish (fnf@cygnus.com) + + * Makefile.in (gdb.tar.Z): Fix for building gzip'd distribution. + * Makefile.in (COMPRESS): New macro, like GZIP. + +Fri Apr 2 09:02:31 1993 Ian Lance Taylor (ian@cygnus.com) + + * test-build.mk: Use -with-gnu-as for mips-sgi-irix4 as well. + + * build-all.mk: Set GCC to gcc -O -G 8 for MIPS targets, since gcc + with gas currently defaults to -G 0. + +Thu Apr 1 08:25:42 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (all-flex): flex depends on byacc. + + * build-all.mk: If host not specified, use config.guess. Pass TAG + to test-build.mk as RELEASE_TAG. + * test-build.mk (configargs): New variable containing arguments to + pass to configure. Set to -with-gnu-as on mips-dec-ultrix. + (FLAGS_TO_PASS): Pass down RELEASE_TAG. + + * config.guess: Use /bin/uname when checking -X argument on SCO, + to avoid invoking GNU uname which doesn't understand -X. + + * test-build.mk: Don't use /usr/unsupported/bin/as on AIX. + + * configure.in: Build gas for mips-*-*. + +Wed Mar 31 21:20:58 1993 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in (all.normal): insert missing backslash. + +Wed Mar 31 12:31:56 1993 Ian Lance Taylor (ian@cygnus.com) + + * build-all.mk: Bump -XNh value to 1500 to match gcc requirements. + + * Makefile.in: Complete overhaul to merge many almost identical + targets. + +Tue Mar 30 20:17:01 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * Makefile.in (setup-dirs-gdb): Renamed from setup-dirs. + (gdb.tar.Z): Adjusted. + + * Makefile.in (setup-dirs, taz): New targets; should be general + enough to adapt for gdb sometime. Build only .z file. + (gas.tar.z): New target. + +Tue Mar 30 10:03:09 1993 Ian Lance Taylor (ian@cygnus.com) + + * build-all.mk: Use CC=cc -Xs on Solaris. + +Thu Mar 25 15:14:30 1993 Fred Fish (fnf@cygnus.com) + + * Makefile.in: Incorporate changes suggested by wilson@cygnus.com + for handling BISON for FSF releases. + +Thu Mar 25 06:19:48 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * configure: Actually implement the change zoo just documented. + +Wed Mar 24 13:02:44 1993 david d `zoo' zuhn (zoo at poseidon.cygnus.com) + + * configure: when using config.guess, only set target_alias when + it's not already been set (ie, on the command line) + +Mon Mar 22 23:07:39 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: add installcheck target, set PRMS to install-prms + +Sun Mar 21 16:46:12 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure: add support for package_makefile_fragment, handle the + case where a directory has a configure.in file but no Makefile.in + more gracefully (with an actual understandable error message, even); + add support for --without (and add this to the usage message); also + explicitly add a --host=${host_alias} to the command line when + config.guess is used + +Sun Mar 21 12:11:58 1993 Jim Wilson (wilson@sphagnum.cygnus.com) + + * configure: Must use both --host and --target in recursive calls. + +Thu Mar 18 12:31:35 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: Change deja-gnu to dejagnu. + +Mon Mar 15 15:44:35 1993 Ian Lance Taylor (ian@cygnus.com) + + * configure.in (h8300-*-*, h8500-*-*): Don't build libg++. + +Fri Mar 12 18:30:14 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: canonicalize all instances to *-*-solaris2*, + also strip out a number of tools to not build for go32 host + +Wed Mar 10 12:08:27 1993 K. Richard Pixley (rich@rtl.cygnus.com) + + * config.guess: add GPL. + + * Makefile.in, config.guess, config.sub, configure: bump + copyrights to 93. + +Wed Mar 10 07:12:48 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (do-info): Removed obsolete check for existence of + localenv file. + + * Makefile.in (MAKEOVERRIDES): Define to be empty. + +Wed Mar 10 03:11:56 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: a couple of 'else true' for decstation, + support for TclX + + * configure.in: configure tclX too; don't remove Tk on RS/6000 anymore + +Tue Mar 9 16:06:12 1993 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in (setup-dirs): change invocation of make to $(MAKE). + +Mon Mar 8 14:52:11 1993 Ken Raeburn (raeburn@cambridge) + + * config.guess: Recognize i386-ibm-aix (PS/2). + * configure.in: Use config/mh-aix386 file for it. + +Mon Mar 8 11:12:43 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (GCC_FOR_TARGET): Eliminated definition; use + CC_FOR_TARGET instead. + (BASE_FLAGS_TO_PASS): Pass GCC_FOR_TARGET=$(CC_FOR_TARGET). + +Wed Mar 3 16:00:28 1993 Steve Chamberlain (sac@ok.cygnus.com) + + * Makefile.in: Add sim to list of directories sent with gdb + +Wed Mar 3 11:42:39 1993 Ken Raeburn (raeburn@cygnus.com) + + * configure.in: Put back mips-dec-bsd* case. + +Tue Mar 2 21:15:58 1993 Fred Fish (fnf@cygnus.com) + + (Ultrix 2.2 support from Michael Rendell ) + * configure.in (vax-*-ultrix2*): Add Ultrix 2.2 triplet. + * config.guess: Change 'VAX*:ULTRIX:*:*' to 'VAX*:ULTRIX*:*:*'. + +Tue Mar 2 18:11:03 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: remove no-op mips-dec-bsd* in "case $target" + + * Makefile.in (dir.info): only run gen-info-dir if it exists, + (install-info): install dir.info only if it exists, + (all-expect, install-expect): pass along X11_FLAGS_TO_PASS + +Tue Mar 2 09:01:30 1993 Ken Raeburn (raeburn@cygnus.com) + + * configure.in: For vms target, skip bfd, ld, binutils. Do build + gas for mips-dec-bsd. + +Tue Mar 2 08:35:24 1993 Ian Lance Taylor (ian@cygnus.com) + + * configure (makesrcdir): If ${srcdir} is relative and not ".", + and ${subdir} is not ".", set makesrcdir based on ${invsubdir}. + +Tue Feb 23 14:18:28 1993 Mike Werner (mtw@poseidon.cygnus.com) + + * configure.in: Added "dejagnu" to hosttools list. + +Mon Feb 22 23:28:38 1993 Per Bothner (bothner@rtl.cygnus.com) + + * config.sub, configure.in, config.guess: Add support + for Bosx, an AIX variant from Bull. + Patches from F.Pierresteguy@frcl.bull.fr. + +Sun Feb 21 11:15:22 1993 Mike Werner (mtw@poseidon.cygnus.com) + + * devo/dejagnu: Initial creation of devo/dejagnu. + Migrated dejagnu testcases and support files for testing software + tools to reside as subdirectories, currently called "testsuite", + within the directory of the software tool. Migrated all programs, + support libraries, etc. beloging to dejagnu proper from + devo/deja-gnu to devo/dejagnu. These files were moved "as is" + with no modifications. The changes to these files which will + allow them to configure, build, and execute properly will be made + in a future update. + +Fri Feb 19 20:19:39 1993 Brendan Kehoe (brendan@lisa.cygnus.com) + + * Makefile.in: Change send_pr to send-pr. + * configure.in: Likewise. + * send_pr: Renamed directory to send-pr. + +Fri Feb 19 19:00:13 1993 Per Bothner (bothner@cygnus.com) + + * Makefile.in: Add some extra semi-colons (needed if SHELL=bash). + +Fri Feb 19 00:59:33 1993 John Gilmore (gnu@cygnus.com) + + * README: Update for gdb-4.8 release. + * Makefile.in (gdb.tar.Z): Add texinfo/tex3patch. Build + gdb-xxx.tar.z (gzip'd) file also. + +Thu Feb 18 09:16:17 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: make all-diff depend on all-libiberty + +Tue Feb 16 16:06:31 1993 K. Richard Pixley (rich@cygnus.com) + + * config.guess: add vax-ultrix in the spirit of mips-ultrix. + +Tue Feb 16 05:57:15 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in, Makefile.in: add hello, tar, gzip, recode, indent + +Tue Feb 16 00:58:20 1993 John Gilmore (gnu@cygnus.com) + + * Makefile.in (DEVO_SUPPORT): Remove etc directory + (ETC_SUPPORT): Only add the files GDB wants from etc/. + (gdb.tar.Z): Use ETC_SUPPORT. Use byacc when building the file. + +Thu Feb 11 20:14:28 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: makeinfo binary is in a new location + +Tue Feb 9 12:42:27 1993 Ian Lance Taylor (ian@cygnus.com) + + * config.sub: Accept -ecoff as an OS. + + * Makefile.in: Various changes to eliminate a level of make + recursion and reduce the required command line length. + (BASE_FLAGS_TO_PASS): New variable holding flags passed to all + sub-makes. + (EXTRA_HOST_FLAGS, EXTRA_TARGET_FLAGS, EXTRA_GCC_FLAGS): New + variables holding settings for specific sub-makes. + (FLAGS_TO_PASS, TARGET_FLAGS_TO_PASS, GCC_FLAGS_TO_PASS): Rewrote + in terms of BASE_FLAGS_TO_PASS. + (TARGET_LIBS): New variable listing directories which use + TARGET_FLAGS_TO_PASS. + (subdir_do): Eliminated. + (do-*): New set of targets to replace subdir_do. + (various): All targets which used subdir_do now depend on do-*. + (local-clean): Renamed from do_clean. + (local-distclean): New target, dependency of distclean and + realclean. + (install-info): Don't create directories. Depend on dir.info + rather than calling make recursively. + (install-dir.info): Eliminated. + (install-info-dirs): Create all info directories here. + (dir.info): Depend upon do-install-info. + + * test-build.mk (HOLES): Added false. + +Sat Feb 6 14:05:09 1993 Per Bothner (bothner@rtl.cygnus.com) + + * config.guess: Recognize BSDI and BSDJ (Jolitz 386bsd). + +Thu Feb 4 20:49:18 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in (info): remove dependency on all-texinfo. The + problem was really in texinfo/C, not at this level. + +Thu Feb 4 13:38:41 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (info): Added dependency on all-texinfo (PR 2112). + +Thu Feb 4 01:50:53 1993 John Gilmore (gnu@cygnus.com) + + * Makefile.in (make-gdb.tar.Z): Change BISON to 'bison -y' for + GDB releases. + +Wed Feb 3 17:22:16 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * configure: Include srcdir in message about target of link not + being found. Don't convert `-' to `_' in `with' options being + passed to subdirs. + +Tue Feb 2 18:57:59 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: add uudecode to host_tools + + * Makefile.in: added {all,install}-uudecode targets, added them to + the appropriate lists + +Tue Feb 2 11:45:53 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (all-gcc): Added dependency on all-gas. + + * configure.in (mips-*-*): Build ld and binutils. + +Mon Feb 1 12:35:41 1993 K. Richard Pixley (rich@rtl.cygnus.com) + + * configure: check return code from mkdir, print error message and + exit on failure. + +Sat Jan 30 16:40:28 1993 John Gilmore (gnu@cygnus.com) + + * Makefile.in (make-gdb.tar.Z): New location for texinfo.tex. + +Thu Jan 28 15:09:59 1993 Ian Lance Taylor (ian@cygnus.com) + + * test-build.mk (HOLES): Added tar, cpio and uudecode. + +Wed Jan 27 16:50:32 1993 Jim Wilson (wilson@sphagnum.cygnus.com) + + * config.sub (h8500): Recognize this as a cpu type. + +Sat Jan 23 20:32:01 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure: source directory missing is no longer a warning + + * configure.in: recognize irix[34]* instead of irix[34] + + * Makefile.in: define and pass down X11_LIB + +Sat Jan 23 13:49:40 1993 Per Bothner (bothner@cygnus.com) + + * guess-systype: Renamed to ... + * config.guess: ... by popular request. + * configure.in, Makefile.in: Update accordingly. + +Thu Jan 21 12:20:55 1993 Per Bothner (bothner@cygnus.com) + + * guess-systype: Patches from John Eaton : + + Add Convex, Cray/Unicos, and Encore/Multimax support. + + Execute ./dummy instead of assuming . is in PATH. + +Tue Jan 19 17:18:06 1993 Per Bothner (bothner@cygnus.com) + + * guess-systype: New shell script. Attempts to guess the + canonical host name of the executing host. + Only a few hosts are supported so far. + * configure: Call guess-systype if no host is specified. + +Tue Jan 19 08:26:07 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (gcc-no-fixedincludes): Made to work with current + gcc Makefile. + + +Fri Jan 15 10:27:02 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (GCC_FLAGS_TO_PASS): New variable. + (all-gcc, install-gcc, subdir_do): Use it. + +Wed Jan 13 17:06:45 1993 Jim Wilson (wilson@sphagnum.cygnus.com) + + * Makefile.in: Rename uninstalled gcc driver from gcc to xgcc. + +Wed Jan 6 20:29:16 1993 Mike Werner (mtw@rtl.cygnus.com) + + * Makefile.in: Removed explicit setting of SUBDIRS. SUBDIRS is now + set exclusively by configure, using configure.in . + +Wed Jan 6 13:44:11 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * test-build.mk: set $PATH for all builds + + * Makefile.in: pass TARGET_FLAGS_TO_PASS for xiberty and libm + +Wed Jan 6 11:02:10 1993 Fred Fish (fnf@cygnus.com) + + * Makefile.in (GCC_FOR_TARGET): Supply a default that matches + the one used in gcc/Makefile.in, so that a null expansion doesn't + override the one needed to build gcc with a native cc. + + +Tue Jan 5 07:55:12 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * configure: Accept -with arguments. + +Sun Jan 3 15:15:09 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * Makefile.in: added h8300sim + +Tue Dec 29 15:06:00 1992 Ian Lance Taylor (ian@cygnus.com) + + * build-all.mk: If canonhost is i386-unknown-sco3.2v4, change it + to i386-sco3.2v4. Set TARGETS and CFLAGS for i386-sco3.2v4. + (all-cygnus, native, build-cygnus): Make + $(canonhost)-stamp-3stage-done, not $(host).... + * test-build.mk (stamp-3stage-compared): Use tail +10c for + i386-sco3.2v4. Added else true to if command. + +Mon Dec 28 12:08:56 1992 Ken Raeburn (raeburn@cygnus.com) + + * config.sub: (from FSF) Sequent uses a BSD-like OS. + +Mon Dec 28 08:32:06 1992 Minh Tran-Le (mtranle@paris.intellicorp.com) + + * configure.in (i[34]86-*-isc*): added; uses mh-sysv. + +Thu Dec 24 17:26:24 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: don't remove binutils from Solaris builds + +Thu Dec 24 14:08:38 1992 david d`zoo' zuhn (zoo@cygnus.com) + + * Makefile.in: get rid of earlier definitions for *clean, + also handle the recursive info rule better + +Thu Dec 24 12:40:21 1992 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in (mostlyclean, distclean, realclean): Fix to + do more-or-less the right thing. + +Wed Dec 16 10:25:31 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: Add lines defining CC and CXX, and use CXX rather + than gcc in definitions of CXX_FOR_BUILD and CXX_FOR_TARGET. + +Tue Dec 15 00:34:32 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: change all $(host_cpu)-$(host_vendor)-$(host_os) to + $(host_canonical). + + * configure.in: split the configdirs list into 4 categories (native + v. cross, library v. tool) and handle the cross-only and native- + only in more reasonable (and correct!) way. + +Mon Dec 14 17:04:22 1992 Stu Grossman (grossman at cygnus.com) + + * configure.in (hppa*-*-*): Don't remove bfd and gdb from + configdirs anymore. + +Sun Dec 13 00:37:26 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: extensive cleanup:: removed all of the explicit + clean-* targets, collapsed many wrappers around subdir_do into + one, added additional targets to satisfy standards.texi, deleted + some old targets, some changes for consistency + +Fri Dec 11 20:18:02 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: handle some programs as cross-only, and others as + native only + + * test-build.mk: handle partial holes in a more generic manner + + * Makefile.in: m4 depends on libiberty + +Thu Dec 3 21:52:11 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: add m4, textutils, fileutils, sed, shellutils, + time, wdiff, and find to configdirs + + * Makefile.in: all, clean, and install rules for the new programs + added to configure.in + +Mon Nov 30 14:54:34 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: use mh-sun for all *-sun-* hosts + +Fri Nov 27 18:35:54 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: define flags for X11 include files and library file + locations, pass them down to the programs that need this info + + * build-all.mk: added a 'native' target, to 3stage the native toolchain + +Sun Nov 22 18:59:13 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: start building libg++ for HP-UX targets + +Wed Nov 18 19:33:11 1992 John Gilmore (gnu@cygnus.com) + + * README: Update references to files moved into etc/. + +Sun Nov 15 09:36:08 1992 Fred Fish (fnf@cygnus.com) + + * config.sub (i386sol2, i486sol2): i[34]86-unknown-solaris2. + * configure.in (i[34]86-*-solaris2*): Use config/mh-sysv4. + +Thu Nov 12 08:50:42 1992 Ian Lance Taylor (ian@cygnus.com) + + * configure: accept dash as well as underscore in long option + names for FSF compatibility. + +Wed Nov 11 08:04:37 1992 Ian Lance Taylor (ian@cygnus.com) + + * config.sub: added -sco3.2v4 support from FSF. + +Sun Nov 8 21:14:30 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: expand the section that adds or removes + directories from the list of programs to build, to handle native + vs. cross in addition to host v. native + +Sat Nov 7 18:52:27 1992 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in: Replace C++ in macro names with CXX. + This is less likely to break ... + +Sat Nov 7 15:16:58 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * test-build.mk: add -w to GNU_MAKE + +Fri Nov 6 23:10:37 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * config.sub: remove 'sparc'-->'sparc-sun' default transformation, + add 'sparc' to list of recognized cpus. This needed to make + 'sparc-aout' expand to 'sparc-unknown-aout' instead of 'sparc-sun-aout'. + Delete some redundant ose68 variants. Recognize -wrs as an os, + then changes that into $CPU-wrs-vxworks. + + * configure.in: remove most references to gdbtest, regularize + target based program removal + + * test-build.mk: import from p3 tree (many fixes and changes) + +Fri Nov 6 20:59:00 1992 david d `zoo' zuhn (zoo@cygnus.com) + + * Makefile.in: added rules to handle tcl, tk, and expect + + * configure.in: handle those directories if they exist + +Thu Nov 5 14:35:41 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * config.sub: removed bogus hppabsd and hppahpux names, since + "hppa" is not a valid cpu (hppa1.1 or hppa1.0 are, though) + +Thu Oct 29 00:12:41 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: all-gcc now depends on all-binutils. all-libg++ + depends upon all-xiberty + + * Makefile.in: changes from p3, including: + + Thu Oct 8 15:00:17 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (XTRAFLAGS): include newlib directories if + newlib/Makefile exists, rather than if host != target. + + Fri Sep 25 13:41:52 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: added -nostdinc to XTRAFLAGS if we are using gcc + from the same source tree and not building a cross-compiler. This + matters for the libg++ configuration if reconfiguring a tree that + has already been installed. + + Thu Sep 10 10:35:51 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: added -I for newlib/targ-include to XTRAFLAGS, to + pick up the machine and system specific header files. + + * Makefile.in: added AS_FOR_TARGET, passed down in + TARGET_FLAGS_TO_PASS. Added CC_FOR_BUILD, which is intended to be + the C compiler to use to create programs which are run in the + build environment, set it to default to $(CC), and passed it down + in FLAGS_TO_PASS and TARGET_FLAGS_TO_PASS. + + Mon Sep 7 22:34:42 1992 Ian Lance Taylor (ian@cirdan.cygnus.com) + + * Makefile.in: add $(host) = $(target) tests back to *_FOR_TARGET. + We need them for unusual native builds, like systems without + ranlib. + + * configure: also define $(host_canonical) and + $(target_canonical), which are the full, canonical names for the + given host and target + +Sun Nov 1 16:38:17 1992 Per Bothner (bothner@cygnus.com) + + * Makefile.in: Added separate definitions for C++. + +Fri Oct 30 11:37:52 1992 Fred Fish (fnf@cygnus.com) + + * configure.in (configdirs): Add deja-gnu. + +Fri Oct 23 00:39:18 1992 John Gilmore (gnu@cygnus.com) + + * README: Update for configure.texi and gdb-4.7 release. + +Wed Oct 21 21:54:27 1992 John Gilmore (gnu@cygnus.com) + + * Makefile.in: Move "all" target to top of file. + Previously, first target was ".PHONY" which caused BSD4.4 make + to build .PHONY when make was run without arguments. + +Mon Oct 19 01:17:54 1992 John Gilmore (gnu@cygnus.com) + + * Makefile.in: Add COPYING.LIB to GDB releases, now that there's + Library-copylefted code in libiberty. + +Tue Oct 13 01:22:32 1992 John Gilmore (gnu@cygnus.com) + + * config.sub: Replace m68kmote with plain old m68k. + +Fri Oct 9 03:14:24 1992 John Gilmore (gnu@cygnus.com) + + * Makefile.in: Remove space from blank line, avoid Make complaints. + +Thu Oct 8 18:41:45 1992 Ken Raeburn (raeburn@cygnus.com) + + * config.sub: Complain if no argument is given. Added support for + 386bsd as OS and target alias. + +Thu Oct 8 15:07:22 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (XTRAFLAGS): include newlib directories if + newlib/Makefile exists, rather than if host != target. + +Mon Oct 5 03:00:09 1992 Mark Eichin (eichin at tweedledumber.cygnus.com) + + * config.sub: recognize sparclite-wrs-vxworks. + + * Makefile.in (install-xiberty): added *-xiberty make rules (from + p3.) Added clean-xiberty to clean. + +Thu Oct 1 17:59:19 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: use *-*-* instead of nested cases for host and target + +Tue Sep 29 14:11:18 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: added -nostdinc to XTRAFLAGS if we are using gcc + from the same source tree and not building a cross-compiler. This + matters for the libg++ configuration if reconfiguring a tree that + has already been installed. + +Sep 20 08:53:10 1992 Fred Fish (fnf@cygnus.com) + + * config.sub (i486v/i486v4): Merge in from FSF version. + +Fri Sep 18 00:32:00 1992 Mark Eichin (eichin@cygnus.com) + + * configure: only set PWD if it is already set. + +Thu Sep 17 23:05:53 1992 Mark Eichin (eichin@cygnus.com) + + * configure: just set PWD=`pwd` at the top, since Ultrix sh + doesn't have unset and all success paths (and most error paths) + out set it anyway. (Note: should change all uses of ${PWD=`pwd`} + to just ${PWD} to avoid confusion.) + +Tue Sep 15 16:00:54 1992 Ian Lance Taylor (ian@cygnus.com) + + * configure: always set $(tooldir) to $(libdir)/$(target_alias), + even for a native compilation. + +Tue Sep 15 02:22:56 1992 John Gilmore (gnu@cygnus.com) + + Changes to make the gdb.tar.Z rule work better. + + * Makefile.in (GDB_SUPPORT_DIRS): Add opcodes. + (DEVO_SUPPORT): Add configure.texi. + (bfd-ilrt.tar.Z): Remove ancient rule. + +Thu Sep 10 10:43:19 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: added -I for newlib/targ-include to XTRAFLAGS, to + pick up the machine and system specific header files. + + * configure.in, config.sub: added new target m68010-adobe-scout, + with alias of adobe68k. Changed configure.in to check for + -scout before -sco* to avoid a false match. + + * Makefile.in: added AS_FOR_TARGET, passed down in + TARGET_FLAGS_TO_PASS. Added CC_FOR_BUILD, which is intended to be + the C compiler to use to create programs which are run in the + build environment, set it to default to $(CC), and passed it down + in FLAGS_TO_PASS and TARGET_FLAGS_TO_PASS. + +Wed Sep 9 12:21:42 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: added TARGET_FLAGS_TO_PASS, CC_FOR_TARGET, + AR_FOR_TARGET, RANLIB_FOR_TARGET, NM_FOR_TARGET. Pass + TARGET_FLAGS_TO_PASS, which defines CC, AR, RANLIB and NM as the + FOR_TARGET variants, to newlib and libg++. + +Tue Sep 8 17:28:30 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * Makefile.in (all-gas, all-gdb): Require all-opcodes to be built + first. + +Wed Sep 2 02:50:05 1992 John Gilmore (gnu@cygnus.com) + + * config.sub: Accept `elf' as an environment. + +Tue Sep 1 15:48:30 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * Makefile.in (all-opcodes): cd into the right directory + +Sun Aug 30 21:12:11 1992 Ian Lance Taylor (ian@cygnus.com) + + * configure: added -program_transform_name option, used as + argument to sed when installing programs. + configure.texi: added documentation for -program_prefix, + -program_suffix and -program_transform_name. + +Thu Aug 27 21:59:44 1992 John Gilmore (gnu@cygnus.com) + + * config.sub: Accept i486 where i386 ok. + +Thu Aug 27 13:04:42 1992 Brendan Kehoe (brendan@rtl.cygnus.com) + + * config.sub: accept we32k + +Mon Aug 24 14:05:14 1992 Ian Lance Taylor (ian@cygnus.com) + + * config.sub, configure.in: accept OSE68000 and OSE68k. + + * Makefile.in: don't create all directories for ``make install''; + let the subdirectories create the ones they need. + +Tue Aug 11 23:13:17 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * COPYING: new file, GPL v2 + +Tue Aug 4 01:12:43 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: use the new gen-info-dir, which needs a template + argument (which also lives in texinfo) + + * configure.texi, standards.texi: fix INFO-DIR-ENTRY + +Mon Aug 3 00:34:17 1992 Fred Fish (fnf@cygnus.com) + + * config.sub (ncr3000): Change i386 to i486. + +Thu Jul 23 00:12:17 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: add install-rcs, install-grep to + install-no-fixedincludes, removed install-bison and install-libgcc + +Tue Jul 21 01:01:50 1992 david d `zoo' zuhn (zoo@cygnus.com) + + * configure.in: grab the HPUX makefile fragment if on HPUX + +Mon Jul 20 11:02:09 1992 D. V. Henkel-Wallace (gumby@cygnus.com) + + * Makefile.in: eradicate bison spoor (ditto libgcc). + configure.in: recognise m68{k,000}-ericsson-OSE. + es1800 is alias for m68k-ericsson-OSE + +Sun Jul 19 17:49:02 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: rearrange the parts that remove programs from + configdirs, based now on HOST==TARGET or by canonical triple. + +Fri Jul 17 22:52:49 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * test-build.mk: recurse explicitly with -f test-build.mk when + appropriate. predicate stage3 and comparison on the existence + of gcc. That is, if gcc isn't around, we aren't three-staging. + On very clean, also remove ...stamp-co. Build in-place before + doing other builds. + +Thu Jul 16 18:33:09 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * Makefile.in, configure.in: add tgas + +Thu Jul 16 16:05:28 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in: a number of changes merged in from progressive. + + * configure.in: add libm. + + * .cvsignore: ignore some stuff that comes from test-build.mk. + +Tue Jul 7 00:24:52 1992 Fred Fish (fnf@cygnus.com) + + * config.sub: Add es1800 (m68k-ericsson-es1800). + +Tue Jun 30 20:24:41 1992 D. V. Henkel-Wallace (gumby@cygnus.com) + + * configure: Add program_suffix (parallel to program_prefix) + * Makefile.in: adjust directory-creating script for losing decstation + +Mon Jun 22 23:43:48 1992 Per Bothner (bothner@cygnus.com) + + * configure: Minor $subdir-related fixes. + +Mon Jun 22 18:30:26 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * configure: fix various problems with propogating + makefile_target_frag in subdirs. + * configure.in: config libgcc if its there + +Fri Jun 19 15:19:40 1992 Stu Grossman (grossman at cygnus.com) + + * config.sub: HPPA merge. + +Sun Jun 14 10:29:19 1992 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Replace all-bison with all-byacc in all + dependency lines for other tools (which now use byacc). + +Fri Jun 12 22:21:57 1992 John Gilmore (gnu at cygnus.com) + + * config.sub: Add sun4sol2 => sparc-sun-solaris2. + +Thu Jun 4 12:07:32 1992 Mark Eichin (eichin@cygnus.com) + + * Makefile.in: make gprof rules similar to byacc rules (instead of + vestigal $(unsubdir) that didn't work...) + +Thu Jun 4 00:37:05 1992 Per Bothner (bothner@rtl.cygnus.com) + + * config.sub: Add support for Linux. + * Makefile.in: Use $(FLAGS_TO_PASS) more consistently + (at least for libg++). + +Tue Jun 02 20:03:00 1992 david d `zoo' zuhn (zoo@cygnus.com) + + * configure.texi: fix doc for the -nfp option to configure + +Tue Jun 2 17:20:52 1992 Michael Tiemann (tiemann@cygnus.com) + + * Makefile.in (all-binutils): ar needs flex, so depend on all-flex. + +Sun May 31 15:04:08 1992 Mark Eichin (eichin at cygnus.com) + + * config.sub: changed [^-]+ to [^-][^-]* so that it works under + Sun sed. (BSD 4.3 sed doesn't handle [^-]+ either.) + * configure.in: added solaris* host_makefile_frag hook. + +Sun May 31 01:10:34 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * config.sub: changed recognition of m68000 so that various + m68k types can be specified via m680[01234]0 + +Sat May 30 21:01:06 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * config.sub (basic_machine): fix sed so that '-foo' isn't + completely substituted out while .+'-foo' loses the '-foo' + +Wed May 27 23:18:52 1992 Michael Tiemann (tiemann@rtl.cygnus.com) + + * config.sub ($os): Add -aout. + +Fri May 22 14:00:02 1992 Per Bothner (bothner@cygnus.com) + + * configure: If host_makefile_frag is absolute, don't + prefix ${invsubdir} (relevant to libg++ auto-configure). + +Thu May 21 18:00:09 1992 Michael Tiemann (tiemann@rtl.cygnus.com) + + * Makefile.in (tooldir): Define it. + (all-ld): Depend on all-flex. + +Sun May 10 21:45:59 1992 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in (check): Fix libg++ special case. + +Fri May 8 08:31:41 1992 K. Richard Pixley (rich@cygnus.com) + + * configure: do not bury `pwd` into config.status, thus do fewer + pwd's. + + * configure: print the "Building in" message only when building in + other than "." AND verbose. + + * configure: remove -s, rework -v to better accomodate guested + configures. + + * standards.texi: updated to 3 may, fixed librid <-> libdir typo. + +Fri May 1 18:00:50 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: macroize flags passed on recursion. remove + fileutils. + +Thu Apr 30 08:56:20 1992 K. Richard Pixley (rich@cygnus.com) + + * configure: get makesrcdir right for subdirs deeper than 1. + + * Makefile.in: pass INSTALL, INSTALL_DATA, INSTALL_PROGRAM on + install. + +Fri Apr 24 15:51:51 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: don't print subdir_do or recursion lines. + +Fri Apr 24 15:22:04 1992 K. Richard Pixley (rich@cygnus.com) + + * standards.texi: added menu item. + + * Makefile.in: build and install standards.info. + + * standards.texi: new file. + +Wed Apr 22 18:06:55 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * configure: test for and move config.status pieces from + ${subdir}/. + +Wed Apr 22 14:38:34 1992 Fred Fish (fnf@cygnus.com) + + * configure: Test for existance of files before trying to mv + them, to avoid numerous non-existance messages. + +Tue Apr 21 12:31:33 1992 K. Richard Pixley (rich@cygnus.com) + + * configure: correct final line of config.status. + + * configure: patch from eggert. Avoids a protection problem if + the original Makefile.in is read only. + + * configure: use move-if-change from gcc to create config.status. + Some makefiles depend on config.status to tell if a directory + has been reconfigured for a different host. This change + prevents those directories from remaking everything in the case + where the reconfig was only intended to rebuild a Makefile. + + * configure: test for config.sub with "config.sub sun4" rather + than "config.sub ${host_alias}". Otherwise we can't tell a bad + host alias from a missing config.sub. + +Mon Apr 20 18:16:36 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in: explicitly pass CFLAGS on recursion. no longer pass + MINUS_G (this can be done with CFLAGS). Default CFLAGS to -g. + +Fri Apr 17 18:27:51 1992 Per Bothner (bothner@cygnus.com) + + * configure: mkdir ${subdir} as needed. + +Wed Apr 15 17:37:22 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in,configure.in: added autoconf. + +Wed Apr 15 17:27:34 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in: no longer pass against on recursion. + + * Makefile.in: added .NOEXPORT: so that stray makefile_frag + definitions are not inherited. + + * configure: correct makesrcdir when subdir is . + +Tue Apr 14 11:56:09 1992 Per Bothner (bothner@cygnus.com) + + * configure: Add support for 'subdirs' variable, which is + like 'configdirs', except that configure doesn't re-invoke + itself for subdirs, it just creates a Makefile for each subdir. + * configure.texi: Document subdirs. + +Mon Apr 13 18:50:16 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: added flex to configdirs + +Mon Apr 13 18:43:55 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: remove clean-stamps from clean. + +Sat Apr 11 03:52:03 1992 John Gilmore (gnu at cygnus.com) + + * configure.in: Add gdbtest to configdirs. + +Fri Apr 10 23:11:49 1992 Fred Fish (fnf@cygnus.com) + + * Makefile.in (MINUS_G): Add macro, default to -g, pass on + to recursive makes. + * configure.in: Recognize new ncr3000 config. + +Wed Apr 8 23:08:12 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in, configure.in: removed references to gdbm. + +Tue Apr 7 16:48:20 1992 Per Bothner (bothner@cygnus.com) + + * config.sub: Don't canonicalize os value + newsos* to bsd (readline needs to check for newsos). + (This fix was earlier made Jan 31, but got re-broken.) + +Mon Apr 6 14:34:08 1992 Stu Grossman (grossman at cygnus.com) + + * configure.in: sco is an os, not a vendor! + + * configure: Quote $( better. Keep various shells happy. + +Tue Mar 31 16:32:57 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: eliminate stamp-files. + +Mon Mar 30 22:20:23 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: add send_pr. remove "force" from .stmp-gprof rule. + Supress echoing of all the "if [ -d ... $(MAKE)" lines. + +Wed Mar 25 15:20:04 1992 Stu Grossman (grossman@cygnus.com) + + * config.sub: fix iris/iris3. + +Wed Mar 25 10:34:19 1992 K. Richard Pixley (rich@cygnus.com) + + * configure: re-add -rm. + +Tue Mar 24 23:50:16 1992 K. Richard Pixley (rich@cygnus.com) + + * Maskefile.in: add .stmp-rcs to all. + + * configure.in: remove gas from rs6000 build, use aix host fragment. + +Mon Mar 23 19:43:35 1992 K. Richard Pixley (rich@cygnus.com) + + * configure: pass down site_option during recursion. + +Thu Mar 19 16:49:36 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (all.cross): Add .stmp-bfd .stmp-readline. + +Wed Mar 18 15:29:33 1992 Mike Stump (mrs@cygnus.com) + + * configure: Change exec_prefix so that it really defaults to prefix. + +Sat Mar 14 17:20:38 1992 Fred Fish (fnf@cygnus.com) + + * Makefile.in, configure.in: Add support for mmalloc library. + +Fri Mar 13 18:44:18 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: add stmp dependencies for a few more things. + +Thu Mar 12 04:56:24 1992 K. Richard Pixley (rich@cygnus.com) + + * configure: adjusted error message on objdir/srcdir configure + collision, per john's suggestion. + + * Makefile.in: add libiberty stmp to all and all.cross. + +Wed Mar 11 02:07:52 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: remove force dependencies, add grep to all. + +Tue Mar 10 21:49:18 1992 K. Richard Pixley (rich@mars.cygnus.com) + + * Makefile.in: drop flex. make stamp files work. + + * configure: added test for conflicting configuration in srcdir, + remove trailing slashes from srcdir. Otherwise emacs gdb mode + gets cranky. use relative paths for configure and srcdir + whenever possible. Send some error messages to stderr that were + going to stdout. + +Tue Mar 10 18:01:55 1992 Per Bothner (bothner@cygnus.com) + + * Makefile.in: Fix libg++ rule to check for gcc directory + before using gcc/gcc. Also pass XTRAFLAGS. + +Thu Mar 5 21:45:07 1992 K. Richard Pixley (rich@sendai) + + * Makefile.in: added stmp-files so that directories aren't polled + when they are already built. + + * configure.texi: fixed a node pointer problem. + +Thu Mar 5 12:05:58 1992 Stu Grossman (grossman at cygnus.com) + + * config.sub configure.in gdb/configure.in + gdb/mips-tdep.c gdb/mipsread.c gdb/procfs.c gdb/signame.h + gdb/tm-irix3.h gdb/tm-mips.h gdb/xm-irix4.h gdb/config/mt-irix3 + gdb/config/mh-irix4 texinfo/configure.in: Port to SGI Irix-4.x. + +Wed Mar 4 02:57:46 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * configure: -recurring becomes -silent. corrected help message + for -site= option. + + * Makefile.in: mkdir $(exec_prefix) and $(tooldir). + +Tue Mar 3 14:51:21 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * configure: when building Makefile for crosses, replace + tooldir and program_prefix. default srcdir from location of + config.sub. remove "for host in hosts" and "for target in + targets" loops. + +Wed Feb 26 19:48:25 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in: Do not pass bindir or mandir to cvs. + +Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in, configure.in: removed traces of namesubdir, + -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced + copyrights to '92, changed some from Cygnus to FSF. + + * configure.texi: remove most references to multiple hosts, + multiple targets, subdirs, etc. + + * configure.man: removed rcsid. reference config.sub not + config.subr. + + * Makefile.in: mkdir $(infodir) on install-info. + +Wed Feb 19 15:41:13 1992 John Gilmore (gnu at cygnus.com) + + * configure.texi: Explain better about .gdbinit and about + the environment that configure.in sections run in. + +Fri Feb 7 07:55:00 1992 John Gilmore (gnu at cygnus.com) + + * configure.in: Ultrix is only a decstation if it's a MIPS. + +Fri Jan 31 21:54:51 1992 John Gilmore (gnu at cygnus.com) + + * README: DOC.configure => cfg-paper.texi. + +Fri Jan 31 21:48:18 1992 Stu Grossman (grossman at cygnus.com) + + * config.sub (near case $os): Don't convert newsos* to bsd! + +Fri Jan 31 02:27:32 1992 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Reinstall change from gdb-4.3 that reduces + the number of copies of COPYING that go into the GDB tar file. + +Thu Jan 30 16:17:30 1992 Stu Grossman (grossman at cygnus.com) + + * bfd/configure.in, gdb/config/mh-i386sco, + gdb/config/mt-i386v32, gdb/configure.in, readline/configure.in: + Fix SCO configuration stuff. + +Tue Jan 28 23:51:07 1992 Per Bothner (bothner at cygnus.com) + + * Makefile.in: For libg++, make sure the -I pointing + to the gcc directory goes *after* all the libg++-local -I flags. + Also, move just-gcc dependency from just-libg++ to all-libg++. + +Tue Jan 28 12:56:24 1992 Stu Grossman (grossman at cygnus.com) + + * configure: Change -x to -f to keep Ultrix /bin/test happy. + +Sat Jan 18 17:45:11 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (make-gdb.tar.Z): Remove texinfo targets. + +Sat Jan 18 17:03:21 1992 Fred Fish (fnf at cygnus.com) + + * config.sub: Add stratus configuration frags. Also + submitted to FSF. + +Sat Jan 18 15:35:29 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (DEV_SUPPORT): add configure.man. + + * config.sub(Decode manufacturer-specific): add -none*. + +Fri Jan 17 17:58:05 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in: remove form feeds to make Sun's make happy. + (DEVO_SUPPORT): DOC.configure => cfg-paper.texi. + +Sat Jan 4 16:11:44 1992 John Gilmore (gnu at cygnus.com) + + * Makefile.in (AR_FLAGS): Make quieter. + +Thu Jan 2 22:57:12 1992 John Gilmore (gnu at cygnus.com) + + * configure.in: Add libg++. + * configure: When verbose, don't output the command line at each + level; it will be unremarkably the same as the previous version, + which will be the same as what the user typed. + +Fri Dec 27 16:26:47 1991 K. Richard Pixley (rich at cygnus.com) + + * configure.in, Makefile.in: fix clean-info, add flex. add + fileutils. + + * configure: be less sensitive to spaces in Makefile.in. Do not + look for sources in "..". Doing so breaks subdirectories that + might have their own configure. If a subdir has it's own + configure script, use it. + +Thu Dec 26 16:30:26 1991 K. Richard Pixley (rich at cygnus.com) + + * cfg-paper.texi: some changes suggested by rms. + +Thu Dec 26 10:13:36 1991 Fred Fish (fnf at cygnus.com) + + * config.sub: Merge in some small additions from the FSF version, + taken from the gcc distribution, to bring the Cygnus and FSF + versions into closer sync. + +Fri Dec 20 11:34:18 1991 Fred Fish (fnf at cygnus.com) + + * configure.in: Changed svr4 references to sysv4. + +Thu Dec 19 15:54:29 1991 K. Richard Pixley (rich at cygnus.com) + + * configure: added -V for version number option. + +Wed Dec 18 15:39:34 1991 K. Richard Pixley (rich at cygnus.com) + + * DOC.configure, cfg-paper.texi: revised, updated, and texinfo'd. + renamed from DOC.configure to cfg-paper.texi. + +Mon Dec 16 23:05:19 1991 K. Richard Pixley (rich at rtl.cygnus.com) + + * configure, config.subr, config.sub: config.subr is now + config.sub again. + +Fri Dec 13 01:17:06 1991 K. Richard Pixley (rich at cygnus.com) + + * configure.texi: new file, in progress. + + * Makefile.in: build info file and install the man page for + configure. + + * configure.man: new file, first cut. + + * configure: find config.subr again now that configuration "none" + has gone. removed all traces of the -ansi option. removed all + traces of the -languages option. + + * config.subr: resync from rms. + +1991-12-11 K. Richard Pixley (rich at rtl.cygnus.com) + + * configure, config.sub, config.subr: merge config.sub into + config.subr, call the result config.subr, remove config.sub, use + config.subr. + + * Makefile.in: revised install for dir.info. + +1991-12-10 K. Richard Pixley (rich at rtl.cygnus.com) + + * configure.in: add decstation host makefile frag. + + * Makefile.in: BISON now bison -y again. also install-gcc on + install. clean-gdbm on clean. infodir belongs in datadir. + Make directories for info install. Build dir.info here then + install it. + +1991-12-09 K. Richard Pixley (rich at rtl.cygnus.com) + + * Makefile.in: fix for bad directory tests. + +1991-12-07 K. Richard Pixley (rich at rtl.cygnus.com) + + * configure: \{1,2\} appears to be a sysv'ism. Use a different + regexp. -srcdir relative was being handled incorrectly. + + * Makefile.in: unwrapped some for loops so that parallel makes + work again and so one can focus one's attention on a particular + package. + +1991-12-06 K. Richard Pixley (rich at rtl.cygnus.com) + + * configure: added PWD as a stand in for `pwd` (for speed). use + elif wherever possible. make -srcdir work without -objdir. + -objdir= commented out. + +1991-12-05 K. Richard Pixley (rich at rtl.cygnus.com) + + * configure: +options become --options. -subdirs commented out. + added -host, -datadir. Renamed -destdir to -prefix. Comment in + Makefile now at top of generated Makefile. Removed cvs log + entries. added -srcdir. create .gdbinit only if there is one + in ${srcdir}. + + * Makefile.in: idestdir and ddestdir go away. Added copyrights + and shift gpl to v2. Added ChangeLog if it didn't exist. docdir + and mandir now keyed off datadir by default. + +1991-11-22 K. Richard Pixley (rich at rtl.cygnus.com) + + * Freshly created ChangeLog. + + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 76 +version-control: never +End: diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/MAINTAINERS sdcc-3.2.0+dfsg/support/sdbinutils/MAINTAINERS --- sdcc-3.1.0+dfsg/support/sdbinutils/MAINTAINERS 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/MAINTAINERS 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,121 @@ +Please feel free to add, edit, delete this file. +Please do not make ChangeLog entries. + +COPYING, COPYING.LIB, README + http://gnu.org. + +Makefile.*; configure; configure.ac; src-release + Any global maintainer can approve changes to these + files, but they should be aware that they need to + be kept in sync with their counterparts in the GCC + repository. Also please notify the following of + any committed patches: + binutils@sourceware.org + gdb-patches@sourceware.org + +bfd/; binutils/; elfcpp/; gas/; gold/; gprof/; ld/; opcodes/; cpu/; +BFD's part of include/ + + binutils: http://sourceware.org/binutils/ + Patches to binutils@sourceware.org. + Please notify the following of any interface changes: + gdb-patches@sourceware.org + +cgen/; cgen parts of opcodes/, sim/ & include/ + cgen: http://sourceware.org/cgen/ + Patches to cgen@sourceware.org + May need separate opcodes/ or sim/ approval for + commits of regenerated files there. + +config.guess; config.sub; readline/support/config.{sub,guess} + config: http://savannah.gnu.org/projects/config + Patches to config-patches@gnu.org. + Changes need to be done in tandem with the official CONFIG + sources or submitted to the master file maintainer and brought + in via a merge. When updating any of these files, please be + sure to update all of them. + Please notify the following of any committed patches: + binutils@sourceware.org + gdb-patches@sourceware.org + +depcomp; mkinstalldirs + Send bug reports and patches to bug-automake@gnu.org. + +gdb/; readline/; sim/; GDB's part of include/ + GDB: http://www.gnu.org/software/gdb/ + Patches to gdb-patches@sourceware.org. + See also gdb/MAINTAINERS and sim/MAINTAINERS. + +include/ + See binutils/, gdb/, sid/, gcc/, libiberty/ etc. + +intl/; config.rhost; libiberty/; libiberty's part of include/ + gcc: http://gcc.gnu.org + Changes need to be done in tandem with the official GCC + sources or submitted to the master file maintainer and brought + in via a merge. Note: approved patches in gcc's libiberty or + intl are automatically approved in this libiberty and intl also; + feel free to merge them yourself if needed sooner than the next + merge. Otherwise, changes are automatically merged, usually + within a day. + +libdecnumber/ + See libiberty. The master copy of this directory is in the GCC + repository. + +ltconfig; ltmain.sh; ltcf-*.sh + libtool: http://www.gnu.org/software/libtool/ + Changes need to be done in tandem with the official LIBTOOL + sources or submitted to the master file maintainer and brought + in via a merge. + +move-if-change + Send bug reports and patches to bug-gnulib@gnu.org. + +symlink-tree + gcc: http://gcc.gnu.org + See libiberty. + +newlib/; libgloss/ + http://sourceware.org/newlib/ + Patches to newlib@sourceware.org. + +sid/; SID's part of cgen/ + sid: http://sourceware.org/sid/ + Patches to sid@sourceware.org + +texinfo/texinfo.tex + texinfo: http://ftp.gnu.org. + Latest version can be found on ftp://ftp.gnu.org and can be + imported at any (reasonable) time. + Please not use GCC's texinfo. Please do not import texinfo. + +tcl/; tix/; itcl/; tk/; libgui/ + insight: http://sourceware.org/insight/ + Contact insight@sourceware.org. + +winsup/ + cygwin: http://sourceware.org/cygwin + Patches to cygwin-patches@cygwin.com. + General discussion cygwin@cygwin.com. + +config-ml.in; makefile.vms; mkdep; setup.com; +etc/; utils/; + Any global maintainer can approve changes to these + files and directories. + +compile; depcomp; install-sh; missing; ylwrap; +config/ + Any global maintainer can approve changes to these + files and directories, but they should be aware + that they need to be kept in sync with their + counterparts in the GCC repository. + +modules file + If you understand the file format (or can cut-and-paste existing + entries), modify it. If it scares you, get someone who does + understand it to help you. Be prepared to fix it if you do break it. + +/* Local variables: */ +/* change-log-default-name: "/dev/null" */ +/* End: */ diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/Makefile.def sdcc-3.2.0+dfsg/support/sdbinutils/Makefile.def --- sdcc-3.1.0+dfsg/support/sdbinutils/Makefile.def 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/Makefile.def 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,548 @@ +#! /usr/bin/autogen +AutoGen definitions Makefile.tpl; + +// Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'. +// This file was originally written by Nathanael Nerode. +// +// Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 +// Free Software Foundation +// +// This file 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; see the file COPYING3. If not see +// . + + +// "missing" indicates that that module doesn't supply +// that recursive target in its Makefile. + +build_modules= { module= libiberty; }; +build_modules= { module= bison; }; +build_modules= { module= flex; }; +build_modules= { module= m4; }; +build_modules= { module= texinfo; }; +build_modules= { module= fixincludes; }; + +host_modules= { module= bfd; lib_path=.libs; bootstrap=true; }; +host_modules= { module= opcodes; lib_path=.libs; bootstrap=true; }; +host_modules= { module= binutils; bootstrap=true; }; +host_modules= { module= bison; no_check_cross= true; }; +host_modules= { module= cgen; }; +host_modules= { module= dejagnu; }; +host_modules= { module= etc; }; +host_modules= { module= fastjar; no_check_cross= true; }; +host_modules= { module= fixincludes; + missing= TAGS; }; +host_modules= { module= flex; no_check_cross= true; }; +host_modules= { module= gas; bootstrap=true; }; +host_modules= { module= gcc; bootstrap=true; + extra_make_flags="$(EXTRA_GCC_FLAGS)"; }; +host_modules= { module= gmp; lib_path=.libs; bootstrap=true; + extra_configure_flags='--disable-shared'; + no_install= true; + // none-*-* disables asm optimizations, bootstrap-testing + // the compiler more thoroughly. + host="none-${host_vendor}-${host_os}"; + // gmp's configure will complain if given anything + // different from host for target. + target="none-${host_vendor}-${host_os}"; }; +host_modules= { module= mpfr; lib_path=.libs; bootstrap=true; + extra_configure_flags='--disable-shared @extra_mpfr_configure_flags@'; + no_install= true; }; +host_modules= { module= mpc; lib_path=.libs; bootstrap=true; + extra_configure_flags='--disable-shared @extra_mpc_gmp_configure_flags@ @extra_mpc_mpfr_configure_flags@'; + no_install= true; }; +host_modules= { module= ppl; lib_path=src/.libs; bootstrap=true; + extra_configure_flags='--disable-shared --with-libgmp-prefix=$$r/$(HOST_SUBDIR)/gmp/ --with-libgmpxx-prefix=$$r/$(HOST_SUBDIR)/gmp/'; + no_install= true; }; +host_modules= { module= cloog; lib_path=.libs; bootstrap=true; + extra_configure_flags='--disable-shared --with-gmp-library=$$r/$(HOST_SUBDIR)/gmp/.libs --with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-bits=gmp --with-ppl'; + extra_exports='CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS ${HOST_PPLLIBS}"; export LDFLAGS; '; + extra_make_flags='CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS"'; + no_install= true; }; +host_modules= { module= libelf; lib_path=.libs; bootstrap=true; + extra_configure_flags='--disable-shared'; + no_install= true; }; +host_modules= { module= gold; bootstrap=true; }; +host_modules= { module= gprof; }; +host_modules= { module= intl; bootstrap=true; }; +host_modules= { module= tcl; + missing=mostlyclean; }; +host_modules= { module= itcl; }; +host_modules= { module= ld; bootstrap=true; }; +host_modules= { module= libcpp; bootstrap=true; }; +host_modules= { module= libdecnumber; bootstrap=true; }; +host_modules= { module= libgui; }; +host_modules= { module= libiberty; bootstrap=true; + extra_configure_flags='@extra_host_libiberty_configure_flags@';}; +// We abuse missing to avoid installing anything for libiconv. +host_modules= { module= libiconv; + extra_configure_flags='--disable-shared'; + no_install= true; + missing= install-info; + missing= install-pdf; + missing= install-html; + missing= install-info; }; +host_modules= { module= m4; }; +host_modules= { module= readline; }; +host_modules= { module= sid; }; +host_modules= { module= sim; }; +host_modules= { module= texinfo; no_install= true; }; +host_modules= { module= zlib; no_install=true; no_check=true; bootstrap=true; }; +host_modules= { module= gdb; }; +host_modules= { module= expect; }; +host_modules= { module= guile; }; +host_modules= { module= tk; }; +host_modules= { module= libtermcap; no_check=true; + missing=mostlyclean; + missing=clean; + missing=distclean; + missing=maintainer-clean; }; +host_modules= { module= utils; no_check=true; }; +host_modules= { module= gnattools; }; +host_modules= { module= lto-plugin; bootstrap=true; + extra_configure_flags=--enable-shared; }; + +target_modules = { module= libstdc++-v3; + bootstrap=true; + lib_path=src/.libs; + raw_cxx=true; }; +target_modules = { module= libmudflap; lib_path=.libs; }; +target_modules = { module= libssp; lib_path=.libs; }; +target_modules = { module= newlib; }; +target_modules = { module= libgcc; bootstrap=true; no_check=true; }; +target_modules = { module= libquadmath; }; +target_modules = { module= libgfortran; }; +target_modules = { module= libobjc; }; +target_modules = { module= libgo; }; +target_modules = { module= libtermcap; no_check=true; + missing=mostlyclean; + missing=clean; + missing=distclean; + missing=maintainer-clean; }; +target_modules = { module= winsup; }; +target_modules = { module= libgloss; no_check=true; }; +target_modules = { module= libffi; }; +target_modules = { module= libjava; raw_cxx=true; + extra_configure_flags="$(EXTRA_CONFIGARGS_LIBJAVA)"; }; +target_modules = { module= zlib; }; +target_modules = { module= boehm-gc; }; +target_modules = { module= rda; }; +target_modules = { module= libada; }; +target_modules = { module= libgomp; bootstrap= true; lib_path=.libs; }; + +// These are (some of) the make targets to be done in each subdirectory. +// Not all; these are the ones which don't have special options. +// "depend" indicates that a target depends on another target uniformly +// for each subdirectory. There can be several such lines per target. +recursive_targets = { make_target= info; + depend=configure; }; +recursive_targets = { make_target= dvi; + depend=configure; }; +recursive_targets = { make_target= pdf; + depend=configure; }; +recursive_targets = { make_target= html; + depend=configure; }; +recursive_targets = { make_target= TAGS; + depend=configure; }; +recursive_targets = { make_target= install-info; + depend=configure; + depend=info; }; +recursive_targets = { make_target= install-pdf; + depend=configure; + depend=pdf; }; +recursive_targets = { make_target= install-html; + depend=configure; + depend=html; }; +recursive_targets = { make_target= installcheck; + depend=configure; }; +recursive_targets = { make_target= mostlyclean; }; +recursive_targets = { make_target= clean; }; +recursive_targets = { make_target= distclean; }; +recursive_targets = { make_target= maintainer-clean; }; + +// Flags which need to be passed down. + +// Directories etc. +flags_to_pass = { flag= DESTDIR ; }; +flags_to_pass = { flag= RPATH_ENVVAR ; }; +flags_to_pass = { flag= TARGET_SUBDIR ; }; +flags_to_pass = { flag= bindir ; }; +flags_to_pass = { flag= datadir ; }; +flags_to_pass = { flag= exec_prefix ; }; +flags_to_pass = { flag= includedir ; }; +flags_to_pass = { flag= datarootdir ; }; +flags_to_pass = { flag= docdir ; }; +flags_to_pass = { flag= infodir ; }; +flags_to_pass = { flag= pdfdir ; }; +flags_to_pass = { flag= htmldir ; }; +flags_to_pass = { flag= libdir ; }; +flags_to_pass = { flag= libexecdir ; }; +flags_to_pass = { flag= lispdir ; }; +flags_to_pass = { flag= localstatedir ; }; +flags_to_pass = { flag= mandir ; }; +flags_to_pass = { flag= oldincludedir ; }; +flags_to_pass = { flag= prefix ; }; +flags_to_pass = { flag= sbindir ; }; +flags_to_pass = { flag= sharedstatedir ; }; +flags_to_pass = { flag= sysconfdir ; }; +flags_to_pass = { flag= tooldir ; }; +flags_to_pass = { flag= build_tooldir ; }; +flags_to_pass = { flag= target_alias ; }; + +// Build tools +flags_to_pass = { flag= AWK ; }; +flags_to_pass = { flag= BISON ; }; +flags_to_pass = { flag= CC_FOR_BUILD ; }; +flags_to_pass = { flag= CFLAGS_FOR_BUILD ; }; +flags_to_pass = { flag= CXX_FOR_BUILD ; }; +flags_to_pass = { flag= EXPECT ; }; +flags_to_pass = { flag= FLEX ; }; +flags_to_pass = { flag= INSTALL ; }; +flags_to_pass = { flag= INSTALL_DATA ; }; +flags_to_pass = { flag= INSTALL_PROGRAM ; }; +flags_to_pass = { flag= INSTALL_SCRIPT ; }; +flags_to_pass = { flag= LDFLAGS_FOR_BUILD ; }; +flags_to_pass = { flag= LEX ; }; +flags_to_pass = { flag= M4 ; }; +flags_to_pass = { flag= MAKE ; }; +flags_to_pass = { flag= RUNTEST ; }; +flags_to_pass = { flag= RUNTESTFLAGS ; }; +flags_to_pass = { flag= SED ; }; +flags_to_pass = { flag= SHELL ; }; +flags_to_pass = { flag= YACC ; }; + +// Host tools +flags_to_pass = { flag= ADAFLAGS ; optional=true ; }; +flags_to_pass = { flag= ADA_CFLAGS ; }; +flags_to_pass = { flag= AR_FLAGS ; }; +flags_to_pass = { flag= BOOT_ADAFLAGS ; optional=true ; }; +flags_to_pass = { flag= BOOT_CFLAGS ; }; +flags_to_pass = { flag= BOOT_LDFLAGS ; }; +flags_to_pass = { flag= CFLAGS ; }; +flags_to_pass = { flag= CXXFLAGS ; }; +flags_to_pass = { flag= LDFLAGS ; }; +flags_to_pass = { flag= LIBCFLAGS ; }; +flags_to_pass = { flag= LIBCXXFLAGS ; }; +flags_to_pass = { flag= STAGE1_CHECKING ; }; +flags_to_pass = { flag= STAGE1_LANGUAGES ; }; +flags_to_pass = { flag= GNATBIND ; }; +flags_to_pass = { flag= GNATMAKE ; }; + +// Target tools +flags_to_pass = { flag= AR_FOR_TARGET ; }; +flags_to_pass = { flag= AS_FOR_TARGET ; }; +flags_to_pass = { flag= CC_FOR_TARGET ; }; +flags_to_pass = { flag= CFLAGS_FOR_TARGET ; }; +flags_to_pass = { flag= CPPFLAGS_FOR_TARGET ; }; +flags_to_pass = { flag= CXXFLAGS_FOR_TARGET ; }; +flags_to_pass = { flag= DLLTOOL_FOR_TARGET ; }; +flags_to_pass = { flag= FLAGS_FOR_TARGET ; }; +flags_to_pass = { flag= GCJ_FOR_TARGET ; }; +flags_to_pass = { flag= GFORTRAN_FOR_TARGET ; }; +flags_to_pass = { flag= GOC_FOR_TARGET ; }; +flags_to_pass = { flag= GOCFLAGS_FOR_TARGET ; }; +flags_to_pass = { flag= LD_FOR_TARGET ; }; +flags_to_pass = { flag= LIPO_FOR_TARGET ; }; +flags_to_pass = { flag= LDFLAGS_FOR_TARGET ; }; +flags_to_pass = { flag= LIBCFLAGS_FOR_TARGET ; }; +flags_to_pass = { flag= LIBCXXFLAGS_FOR_TARGET ; }; +flags_to_pass = { flag= NM_FOR_TARGET ; }; +flags_to_pass = { flag= OBJDUMP_FOR_TARGET ; }; +flags_to_pass = { flag= RANLIB_FOR_TARGET ; }; +flags_to_pass = { flag= STRIP_FOR_TARGET ; }; +flags_to_pass = { flag= WINDRES_FOR_TARGET ; }; +flags_to_pass = { flag= WINDMC_FOR_TARGET ; }; + +// Miscellaneous +flags_to_pass = { flag= BUILD_CONFIG ; }; +flags_to_pass = { flag= LANGUAGES ; optional=true ; }; +flags_to_pass = { flag= LEAN ; }; + +// Inter-module dependencies + +// Build modules +dependencies = { module=all-build-bison; on=all-build-texinfo; }; +dependencies = { module=all-build-flex; on=all-build-texinfo; }; +dependencies = { module=all-build-flex; on=all-build-bison; }; +dependencies = { module=all-build-flex; on=all-build-m4; }; +dependencies = { module=all-build-libiberty; on=all-build-texinfo; }; +dependencies = { module=all-build-m4; on=all-build-texinfo; }; +dependencies = { module=all-build-fixincludes; on=all-build-libiberty; }; + +// Host modules specific to gcc. +dependencies = { module=configure-gcc; on=configure-intl; }; +dependencies = { module=configure-gcc; on=all-lto-plugin; }; +dependencies = { module=configure-gcc; on=all-binutils; }; +dependencies = { module=configure-gcc; on=all-gas; }; +dependencies = { module=configure-gcc; on=all-ld; }; +dependencies = { module=configure-gcc; on=all-gold; }; +dependencies = { module=configure-gcc; on=all-libelf; }; +dependencies = { module=all-gcc; on=all-libiberty; hard=true; }; +dependencies = { module=all-gcc; on=all-gmp; }; +dependencies = { module=all-gcc; on=all-intl; }; +dependencies = { module=all-gcc; on=all-mpfr; }; +dependencies = { module=all-gcc; on=all-mpc; }; +dependencies = { module=all-gcc; on=all-ppl; }; +dependencies = { module=all-gcc; on=all-cloog; }; +dependencies = { module=all-gcc; on=all-build-texinfo; }; +dependencies = { module=all-gcc; on=all-build-bison; }; +dependencies = { module=all-gcc; on=all-build-flex; }; +dependencies = { module=all-gcc; on=all-build-libiberty; }; +dependencies = { module=all-gcc; on=all-build-fixincludes; }; +dependencies = { module=all-gcc; on=all-zlib; }; +dependencies = { module=all-gcc; on=all-libcpp; hard=true; }; +dependencies = { module=all-gcc; on=all-libdecnumber; hard=true; }; +dependencies = { module=all-gcc; on=all-libiberty; }; +dependencies = { module=all-gcc; on=all-fixincludes; }; +dependencies = { module=all-gcc; on=all-lto-plugin; }; +dependencies = { module=info-gcc; on=all-build-libiberty; }; +dependencies = { module=dvi-gcc; on=all-build-libiberty; }; +dependencies = { module=pdf-gcc; on=all-build-libiberty; }; +dependencies = { module=html-gcc; on=all-build-libiberty; }; +dependencies = { module=install-gcc ; on=install-fixincludes; }; +dependencies = { module=install-gcc ; on=install-lto-plugin; }; +dependencies = { module=install-strip-gcc ; on=install-strip-fixincludes; }; + +dependencies = { module=configure-libcpp; on=configure-libiberty; hard=true; }; +dependencies = { module=configure-libcpp; on=configure-intl; }; +dependencies = { module=all-libcpp; on=all-libiberty; hard=true; }; +dependencies = { module=all-libcpp; on=all-intl; }; + +dependencies = { module=all-fixincludes; on=all-libiberty; }; + +dependencies = { module=all-gnattools; on=all-target-libada; }; + +dependencies = { module=all-lto-plugin; on=all-libiberty; }; + +dependencies = { module=all-utils; on=all-libiberty; }; + +dependencies = { module=configure-mpfr; on=all-gmp; }; +dependencies = { module=configure-mpc; on=all-mpfr; }; +dependencies = { module=configure-ppl; on=all-gmp; }; +dependencies = { module=configure-ppl; on=all-mpfr; }; +dependencies = { module=configure-cloog; on=all-ppl; }; + +// Host modules specific to gdb. +dependencies = { module=configure-gdb; on=all-intl; }; +dependencies = { module=configure-gdb; on=configure-sim; }; +dependencies = { module=configure-gdb; on=all-bfd; }; +// Depend on all-libiconv so that configure checks for iconv +// functions will work. +dependencies = { module=configure-gdb; on=all-libiconv; }; +dependencies = { module=all-gdb; on=all-libiberty; }; +dependencies = { module=all-gdb; on=all-libiconv; }; +dependencies = { module=all-gdb; on=all-opcodes; }; +dependencies = { module=all-gdb; on=all-readline; }; +dependencies = { module=all-gdb; on=all-build-bison; }; +dependencies = { module=all-gdb; on=all-sim; }; +dependencies = { module=all-gdb; on=all-libdecnumber; }; +dependencies = { module=all-gdb; on=all-libtermcap; }; + +dependencies = { module=configure-libgui; on=configure-tcl; }; +dependencies = { module=configure-libgui; on=configure-tk; }; +dependencies = { module=all-libgui; on=all-tcl; }; +dependencies = { module=all-libgui; on=all-tk; }; +dependencies = { module=all-libgui; on=all-itcl; }; + +// Host modules specific to binutils. +dependencies = { module=configure-bfd; on=configure-libiberty; hard=true; }; +dependencies = { module=configure-bfd; on=configure-intl; }; +dependencies = { module=all-bfd; on=all-libiberty; }; +dependencies = { module=all-bfd; on=all-intl; }; +dependencies = { module=configure-opcodes; on=configure-libiberty; hard=true; }; +dependencies = { module=all-opcodes; on=all-libiberty; }; + +dependencies = { module=configure-binutils; on=configure-intl; }; +dependencies = { module=all-binutils; on=all-libiberty; }; +dependencies = { module=all-binutils; on=all-opcodes; }; +dependencies = { module=all-binutils; on=all-bfd; }; +dependencies = { module=all-binutils; on=all-build-flex; }; +dependencies = { module=all-binutils; on=all-build-bison; }; +dependencies = { module=all-binutils; on=all-intl; }; + +// We put install-opcodes before install-binutils because the installed +// binutils might be on PATH, and they might need the shared opcodes +// library. +dependencies = { module=install-binutils; on=install-opcodes; }; +dependencies = { module=install-strip-binutils; on=install-strip-opcodes; }; + +// libopcodes depends on libbfd +dependencies = { module=install-opcodes; on=install-bfd; }; +dependencies = { module=install-strip-opcodes; on=install-strip-bfd; }; + +dependencies = { module=configure-gas; on=configure-intl; }; +dependencies = { module=all-gas; on=all-libiberty; }; +dependencies = { module=all-gas; on=all-opcodes; }; +dependencies = { module=all-gas; on=all-bfd; }; +dependencies = { module=all-gas; on=all-intl; }; +dependencies = { module=configure-gprof; on=configure-intl; }; +dependencies = { module=all-gprof; on=all-libiberty; }; +dependencies = { module=all-gprof; on=all-bfd; }; +dependencies = { module=all-gprof; on=all-opcodes; }; +dependencies = { module=all-gprof; on=all-intl; }; +dependencies = { module=configure-ld; on=configure-intl; }; +dependencies = { module=all-ld; on=all-libiberty; }; +dependencies = { module=all-ld; on=all-bfd; }; +dependencies = { module=all-ld; on=all-opcodes; }; +dependencies = { module=all-ld; on=all-build-bison; }; +dependencies = { module=all-ld; on=all-build-flex; }; +dependencies = { module=all-ld; on=all-intl; }; +dependencies = { module=install-ld; on=install-gold; }; +dependencies = { module=install-strip-ld; on=install-strip-gold; }; +dependencies = { module=configure-gold; on=configure-intl; }; +dependencies = { module=all-gold; on=all-libiberty; }; +dependencies = { module=all-gold; on=all-intl; }; +dependencies = { module=all-gold; on=all-bfd; }; +dependencies = { module=all-gold; on=all-build-bison; }; +dependencies = { module=check-gold; on=all-binutils; }; +dependencies = { module=check-gold; on=all-gas; }; + +dependencies = { module=configure-opcodes; on=configure-intl; }; +dependencies = { module=all-opcodes; on=all-bfd; }; +dependencies = { module=all-opcodes; on=all-libiberty; }; +dependencies = { module=all-opcodes; on=all-intl; }; + +// Other host modules in the 'src' repository. +dependencies = { module=all-dejagnu; on=all-tcl; }; +dependencies = { module=all-dejagnu; on=all-expect; }; +dependencies = { module=all-dejagnu; on=all-tk; }; +dependencies = { module=configure-expect; on=configure-tcl; }; +dependencies = { module=configure-expect; on=configure-tk; }; +dependencies = { module=all-expect; on=all-tcl; }; +dependencies = { module=all-expect; on=all-tk; }; + +// We put install-tcl before install-itcl because itcl wants to run a +// program on installation which uses the Tcl libraries. +dependencies = { module=configure-itcl; on=configure-tcl; }; +dependencies = { module=configure-itcl; on=configure-tk; }; +dependencies = { module=all-itcl; on=all-tcl; }; +dependencies = { module=all-itcl; on=all-tk; }; +dependencies = { module=install-itcl; on=install-tcl; }; +dependencies = { module=install-strip-itcl; on=install-strip-tcl; }; + +dependencies = { module=configure-tk; on=configure-tcl; }; +dependencies = { module=all-tk; on=all-tcl; }; + +dependencies = { module=all-sid; on=all-libiberty; }; +dependencies = { module=all-sid; on=all-bfd; }; +dependencies = { module=all-sid; on=all-opcodes; }; +dependencies = { module=all-sid; on=all-tcl; }; +dependencies = { module=all-sid; on=all-tk; }; +dependencies = { module=install-sid; on=install-tcl; }; +dependencies = { module=install-strip-sid; on=install-strip-tcl; }; +dependencies = { module=install-sid; on=install-tk; }; +dependencies = { module=install-strip-sid; on=install-strip-tk; }; + +dependencies = { module=configure-sim; on=configure-intl; }; +dependencies = { module=all-sim; on=all-intl; }; +dependencies = { module=all-sim; on=all-libiberty; }; +dependencies = { module=all-sim; on=all-bfd; }; +dependencies = { module=all-sim; on=all-opcodes; }; +dependencies = { module=all-sim; on=all-readline; }; +dependencies = { module=all-sim; on=configure-gdb; }; + +// Other host modules. +dependencies = { module=all-fastjar; on=all-zlib; }; +dependencies = { module=all-fastjar; on=all-build-texinfo; }; +dependencies = { module=all-fastjar; on=all-libiberty; }; + +// Warning, these are not well tested. +dependencies = { module=all-bison; on=all-intl; }; +dependencies = { module=all-bison; on=all-build-texinfo; }; +dependencies = { module=all-flex; on=all-build-bison; }; +dependencies = { module=all-flex; on=all-intl; }; +dependencies = { module=all-flex; on=all-m4; }; +dependencies = { module=all-flex; on=all-build-texinfo; }; +dependencies = { module=all-m4; on=all-intl; }; +dependencies = { module=all-m4; on=all-build-texinfo; }; + +// Target modules. These can also have dependencies on the language +// environment (e.g. on libstdc++). By default target modules depend +// on libgcc and newlib/libgloss. +lang_env_dependencies = { module=libjava; cxx=true; }; +lang_env_dependencies = { module=newlib; no_c=true; }; +lang_env_dependencies = { module=libgloss; no_c=true; }; +lang_env_dependencies = { module=libgcc; no_gcc=true; no_c=true; }; +// libiberty does not depend on newlib or libgloss because it must be +// built newlib on some targets (e.g. Cygwin). It still needs +// a dependency on libgcc for native targets to configure. +lang_env_dependencies = { module=libiberty; no_c=true; }; + +dependencies = { module=configure-target-boehm-gc; on=all-target-libstdc++-v3; }; +dependencies = { module=configure-target-fastjar; on=configure-target-zlib; }; +dependencies = { module=all-target-fastjar; on=all-target-zlib; }; +dependencies = { module=configure-target-libgo; on=configure-target-libffi; }; +dependencies = { module=configure-target-libgo; on=all-target-libstdc++-v3; }; +dependencies = { module=all-target-libgo; on=all-target-libffi; }; +dependencies = { module=configure-target-libjava; on=configure-target-zlib; }; +dependencies = { module=configure-target-libjava; on=configure-target-boehm-gc; }; +dependencies = { module=configure-target-libjava; on=configure-target-libffi; }; +dependencies = { module=all-target-libjava; on=all-fastjar; }; +dependencies = { module=all-target-libjava; on=all-target-zlib; }; +dependencies = { module=all-target-libjava; on=all-target-boehm-gc; }; +dependencies = { module=all-target-libjava; on=all-target-libffi; }; +dependencies = { module=configure-target-libobjc; on=configure-target-boehm-gc; }; +dependencies = { module=all-target-libobjc; on=all-target-boehm-gc; }; +dependencies = { module=configure-target-libstdc++-v3; on=configure-target-libgomp; }; +// parallel_list.o and parallel_settings.o depend on omp.h, which is +// generated by the libgomp configure. Unfortunately, due to the use of +// recursive make, we can't be that specific. +dependencies = { module=all-target-libstdc++-v3; on=configure-target-libgomp; }; + +// Target modules in the 'src' repository. +lang_env_dependencies = { module=libtermcap; }; +lang_env_dependencies = { module=rda; }; +lang_env_dependencies = { module=winsup; }; + +dependencies = { module=all-target-libgloss; on=all-target-newlib; }; +dependencies = { module=all-target-winsup; on=all-target-libtermcap; }; +dependencies = { module=configure-target-newlib; on=all-binutils; }; +dependencies = { module=configure-target-newlib; on=all-ld; }; +dependencies = { module=configure-target-libgfortran; on=all-target-libquadmath; }; + +languages = { language=c; gcc-check-target=check-gcc; }; +languages = { language=c++; gcc-check-target="check-c++ check-c++0x"; + lib-check-target=check-target-libstdc++-v3; + lib-check-target=check-target-libmudflap-c++; }; +languages = { language=fortran; gcc-check-target=check-fortran; + lib-check-target=check-target-libquadmath; + lib-check-target=check-target-libgfortran; }; +languages = { language=java; gcc-check-target=check-java; + lib-check-target=check-target-libjava; }; +languages = { language=ada; gcc-check-target=check-ada; + lib-check-target=check-target-libada; }; +languages = { language=objc; gcc-check-target=check-objc; + lib-check-target=check-target-libobjc; }; +languages = { language=obj-c++; gcc-check-target=check-obj-c++; }; +languages = { language=go; gcc-check-target=check-go; + lib-check-target=check-target-libgo; }; + +// Toplevel bootstrap +bootstrap_stage = { id=1 ; }; +bootstrap_stage = { + id=2 ; prev=1 ; + bootstrap_target=bootstrap2 ; }; +bootstrap_stage = { + id=3 ; prev=2 ; lean=1 ; + compare_target=compare ; + bootstrap_target=bootstrap ; + cleanstrap_target=cleanstrap ; }; +bootstrap_stage = { + id=4 ; prev=3 ; lean=2 ; + compare_target=compare3 ; + bootstrap_target=bootstrap4 ; }; +bootstrap_stage = { + id=profile ; prev=1 ; }; +bootstrap_stage = { + id=feedback ; prev=profile ; + bootstrap_target=profiledbootstrap ; }; diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/Makefile.in sdcc-3.2.0+dfsg/support/sdbinutils/Makefile.in --- sdcc-3.1.0+dfsg/support/sdbinutils/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/Makefile.in 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,43116 @@ + +# Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'. +# +# Makefile for directory with subdirs to build. +# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, +# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +# Free Software Foundation +# +# This file 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; see the file COPYING3. If not see +# . +# + +# First, test for a proper version of make, but only where one is required. + +@if gcc +ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never empty. +$(error GNU make version 3.80 or newer is required.) +endif +@endif gcc + +# ------------------------------- +# Standard Autoconf-set variables +# ------------------------------- +VPATH=@srcdir@ + +build_alias=@build_noncanonical@ +build_vendor=@build_vendor@ +build_os=@build_os@ +build=@build@ +host_alias=@host_noncanonical@ +host_vendor=@host_vendor@ +host_os=@host_os@ +host=@host@ +target_alias=@target_noncanonical@ +target_vendor=@target_vendor@ +target_os=@target_os@ +target=@target@ + +program_transform_name = @program_transform_name@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +srcdir = @srcdir@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +includedir = @includedir@ +oldincludedir = @oldincludedir@ +infodir = @infodir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +pdfdir = @pdfdir@ +htmldir = @htmldir@ +mandir = @mandir@ +man1dir = $(mandir)/man1 +man2dir = $(mandir)/man2 +man3dir = $(mandir)/man3 +man4dir = $(mandir)/man4 +man5dir = $(mandir)/man5 +man6dir = $(mandir)/man6 +man7dir = $(mandir)/man7 +man8dir = $(mandir)/man8 +man9dir = $(mandir)/man9 + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_DATA = @INSTALL_DATA@ +LN = @LN@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ + +# ------------------------------------------------- +# Miscellaneous non-standard autoconf-set variables +# ------------------------------------------------- + +# The gcc driver likes to know the arguments it was configured with. +TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@ + +tooldir = @tooldir@ +build_tooldir = @build_tooldir@ + +# This is the name of the environment variable used for the path to +# the libraries. +RPATH_ENVVAR = @RPATH_ENVVAR@ + +# On targets where RPATH_ENVVAR is PATH, a subdirectory of the GCC build path +# is used instead of the directory itself to avoid including built +# executables in PATH. +GCC_SHLIB_SUBDIR = @GCC_SHLIB_SUBDIR@ + +# Build programs are put under this directory. +BUILD_SUBDIR = @build_subdir@ +# This is set by the configure script to the arguments to use when configuring +# directories built for the build system. +BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)" + +# Linker flags to use on the host, for stage1 or when not +# bootstrapping. +STAGE1_LDFLAGS = @stage1_ldflags@ + +# Libraries to use on the host, for stage1 or when not bootstrapping. +STAGE1_LIBS = @stage1_libs@ + +# Linker flags to use for stage2 and later. +POSTSTAGE1_LDFLAGS = @poststage1_ldflags@ + +# Libraries to use for stage2 and later. +POSTSTAGE1_LIBS = @poststage1_libs@ + +# This is the list of variables to export in the environment when +# configuring any subdirectory. It must also be exported whenever +# recursing into a build directory in case that directory's Makefile +# re-runs configure. +BASE_EXPORTS = \ + FLEX="$(FLEX)"; export FLEX; \ + LEX="$(LEX)"; export LEX; \ + BISON="$(BISON)"; export BISON; \ + YACC="$(YACC)"; export YACC; \ + M4="$(M4)"; export M4; \ + SED="$(SED)"; export SED; \ + AWK="$(AWK)"; export AWK; \ + MAKEINFO="$(MAKEINFO)"; export MAKEINFO; + +# This is the list of variables to export in the environment when +# configuring subdirectories for the build system. +BUILD_EXPORTS = \ + $(BASE_EXPORTS) \ + AR="$(AR_FOR_BUILD)"; export AR; \ + AS="$(AS_FOR_BUILD)"; export AS; \ + CC="$(CC_FOR_BUILD)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX_FOR_BUILD)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ + GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \ + GOC="$(GOC_FOR_BUILD)"; export GOC; \ + GOCFLAGS="$(GOCFLAGS_FOR_BUILD)"; export GOCFLAGS; \ + DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \ + LD="$(LD_FOR_BUILD)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \ + NM="$(NM_FOR_BUILD)"; export NM; \ + RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \ + WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC; + +# These variables must be set on the make command line for directories +# built for the build system to override those in BASE_FLAGS_TO_PASSS. +EXTRA_BUILD_FLAGS = \ + CFLAGS="$(CFLAGS_FOR_BUILD)" \ + LDFLAGS="$(LDFLAGS_FOR_BUILD)" + +# This is the list of directories to built for the host system. +SUBDIRS = @configdirs@ +TARGET_CONFIGDIRS = @target_configdirs@ +# This is set by the configure script to the arguments to use when configuring +# directories built for the host system. +HOST_CONFIGARGS = @host_configargs@ +# Host programs are put under this directory, which is . except if building +# with srcdir=.. +HOST_SUBDIR = @host_subdir@ +# This is the list of variables to export in the environment when +# configuring subdirectories for the host system. We need to pass +# some to the GCC configure because of its hybrid host/target nature. +HOST_EXPORTS = \ + $(BASE_EXPORTS) \ + CC="$(CC)"; export CC; \ + ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + GCJ="$(GCJ)"; export GCJ; \ + GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \ + GOC="$(GOC)"; export GOC; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(STAGE1_LDFLAGS) $(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + WINDMC="$(WINDMC)"; export WINDMC; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \ + AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \ + GCC_FOR_TARGET="$(GCC_FOR_TARGET)"; export GCC_FOR_TARGET; \ + LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \ + NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \ + OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \ + RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \ + TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ + HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \ + GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \ + GMPINC="$(HOST_GMPINC)"; export GMPINC; \ + PPLLIBS="$(HOST_PPLLIBS)"; export PPLLIBS; \ + PPLINC="$(HOST_PPLINC)"; export PPLINC; \ + CLOOGLIBS="$(HOST_CLOOGLIBS)"; export CLOOGLIBS; \ + CLOOGINC="$(HOST_CLOOGINC)"; export CLOOGINC; \ + LIBELFLIBS="$(HOST_LIBELFLIBS)" ; export LIBELFLIBS; \ + LIBELFINC="$(HOST_LIBELFINC)" ; export LIBELFINC; \ +@if gcc-bootstrap + $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ +@endif gcc-bootstrap + $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); + +POSTSTAGE1_CXX_EXPORT = \ + CXX='$(CXX)'; export CXX; \ + CXX_FOR_BUILD='$(CXX_FOR_BUILD)'; export CXX_FOR_BUILD; +@if target-libstdc++-v3-bootstrap +# Override the above if we're bootstrapping C++. +POSTSTAGE1_CXX_EXPORT = \ + CXX="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/g++$(exeext) \ + -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \ + -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \ + -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \ + -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \ + -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \ + -I$$s/libstdc++-v3/libsupc++ \ + -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \ + -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs"; \ + export CXX; \ + CXX_FOR_BUILD="$$CXX"; export CXX_FOR_BUILD; +@endif target-libstdc++-v3-bootstrap + +# Similar, for later GCC stages. +POSTSTAGE1_HOST_EXPORTS = \ + $(HOST_EXPORTS) \ + CC="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \ + -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ \ + $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \ + CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \ + $(POSTSTAGE1_CXX_EXPORT) \ + GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \ + LDFLAGS="$(POSTSTAGE1_LDFLAGS) $(BOOT_LDFLAGS)"; export LDFLAGS; \ + HOST_LIBS="$(POSTSTAGE1_LIBS)"; export HOST_LIBS; + +# Target libraries are put under this directory: +TARGET_SUBDIR = @target_subdir@ +# This is set by the configure script to the arguments to use when configuring +# directories built for the target. +TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)" +# This is the list of variables to export in the environment when +# configuring subdirectories for the target system. +BASE_TARGET_EXPORTS = \ + $(BASE_EXPORTS) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GCJ; \ + GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \ + GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GOC; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \ + NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \ + OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \ +@if gcc-bootstrap + $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ +@endif gcc-bootstrap + $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ + TARGET_CONFIGDIRS="$(TARGET_CONFIGDIRS)"; export TARGET_CONFIGDIRS; + +RAW_CXX_TARGET_EXPORTS = \ + $(BASE_TARGET_EXPORTS) \ + CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ + CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; + +NORMAL_TARGET_EXPORTS = \ + $(BASE_TARGET_EXPORTS) \ + CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; + +# Where to find GMP +HOST_GMPLIBS = @gmplibs@ +HOST_GMPINC = @gmpinc@ + +# Where to find PPL +HOST_PPLLIBS = @ppllibs@ +HOST_PPLINC = @pplinc@ + +# Where to find CLOOG +HOST_CLOOGLIBS = @clooglibs@ +HOST_CLOOGINC = @clooginc@ + +# Where to find libelf +HOST_LIBELFLIBS = @libelflibs@ +HOST_LIBELFINC = @libelfinc@ + +EXTRA_CONFIGARGS_LIBJAVA = @EXTRA_CONFIGARGS_LIBJAVA@ + +# ---------------------------------------------- +# Programs producing files for the BUILD machine +# ---------------------------------------------- + +SHELL = @SHELL@ + +# pwd command to use. Allow user to override default by setting PWDCMD in +# the environment to account for automounters. The make variable must not +# be called PWDCMD, otherwise the value set here is passed to make +# subprocesses and overrides the setting from the user's environment. +# Don't use PWD since it is a common shell environment variable and we +# don't want to corrupt it. +PWD_COMMAND = $${PWDCMD-pwd} + +# compilers to use to create programs which must be run in the build +# environment. +AR_FOR_BUILD = @AR_FOR_BUILD@ +AS_FOR_BUILD = @AS_FOR_BUILD@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@ +CXX_FOR_BUILD = @CXX_FOR_BUILD@ +DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@ +GCJ_FOR_BUILD = @GCJ_FOR_BUILD@ +GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@ +GOC_FOR_BUILD = @GOC_FOR_BUILD@ +LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ +LD_FOR_BUILD = @LD_FOR_BUILD@ +NM_FOR_BUILD = @NM_FOR_BUILD@ +RANLIB_FOR_BUILD = @RANLIB_FOR_BUILD@ +WINDMC_FOR_BUILD = @WINDMC_FOR_BUILD@ +WINDRES_FOR_BUILD = @WINDRES_FOR_BUILD@ + +# Special variables passed down in EXTRA_GCC_FLAGS. They are defined +# here so that they can be overridden by Makefile fragments. +BUILD_PREFIX = @BUILD_PREFIX@ +BUILD_PREFIX_1 = @BUILD_PREFIX_1@ + +# Flags to pass to stage2 and later makes. They are defined +# here so that they can be overridden by Makefile fragments. +BOOT_CFLAGS= -g -O2 +BOOT_LDFLAGS= +BOOT_ADAFLAGS=-gnatpg -gnata + +AWK = @AWK@ +SED = @SED@ +BISON = @BISON@ +YACC = @YACC@ +FLEX = @FLEX@ +LEX = @LEX@ +M4 = @M4@ +MAKEINFO = @MAKEINFO@ +EXPECT = @EXPECT@ +RUNTEST = @RUNTEST@ + +# This just becomes part of the MAKEINFO definition passed down to +# sub-makes. It lets flags be given on the command line while still +# using the makeinfo from the object tree. +# (Default to avoid splitting info files by setting the threshold high.) +MAKEINFOFLAGS = --split-size=5000000 + +# --------------------------------------------- +# Programs producing files for the HOST machine +# --------------------------------------------- + +AS = @AS@ +AR = @AR@ +AR_FLAGS = rc +CC = @CC@ +CXX = @CXX@ +DLLTOOL = @DLLTOOL@ +LD = @LD@ +LIPO = @LIPO@ +NM = @NM@ +OBJDUMP = @OBJDUMP@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +WINDRES = @WINDRES@ +WINDMC = @WINDMC@ + +GNATBIND = @GNATBIND@ +GNATMAKE = @GNATMAKE@ + +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBCFLAGS = $(CFLAGS) +CXXFLAGS = @CXXFLAGS@ +LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates +GOCFLAGS = $(CFLAGS) + +TFLAGS = + +# Defaults for all stages; some are overridden below. + +STAGE_CFLAGS = $(BOOT_CFLAGS) +STAGE_TFLAGS = $(TFLAGS) +STAGE_CONFIGURE_FLAGS=@stage2_werror_flag@ +POSTSTAGE1_CONFIGURE_FLAGS = @POSTSTAGE1_CONFIGURE_FLAGS@ + + +# Defaults for stage 1; some are overridden below. +STAGE1_CFLAGS = $(STAGE_CFLAGS) +STAGE1_CXXFLAGS = $(CXXFLAGS) +@if target-libstdc++-v3-bootstrap +# Override the above if we're bootstrapping C++. +STAGE1_CXXFLAGS = $(STAGE1_CFLAGS) +@endif target-libstdc++-v3-bootstrap +STAGE1_TFLAGS = $(STAGE_TFLAGS) +# STAGE1_CONFIGURE_FLAGS overridden below, so we can use +# POSTSTAGE1_CONFIGURE_FLAGS here. +STAGE1_CONFIGURE_FLAGS = \ + $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS) + +# Defaults for stage 2; some are overridden below. +STAGE2_CFLAGS = $(STAGE_CFLAGS) +STAGE2_CXXFLAGS = $(CXXFLAGS) +@if target-libstdc++-v3-bootstrap +# Override the above if we're bootstrapping C++. +STAGE2_CXXFLAGS = $(STAGE2_CFLAGS) +@endif target-libstdc++-v3-bootstrap +STAGE2_TFLAGS = $(STAGE_TFLAGS) +# STAGE1_CONFIGURE_FLAGS overridden below, so we can use +# POSTSTAGE1_CONFIGURE_FLAGS here. +STAGE2_CONFIGURE_FLAGS = \ + $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS) + +# Defaults for stage 3; some are overridden below. +STAGE3_CFLAGS = $(STAGE_CFLAGS) +STAGE3_CXXFLAGS = $(CXXFLAGS) +@if target-libstdc++-v3-bootstrap +# Override the above if we're bootstrapping C++. +STAGE3_CXXFLAGS = $(STAGE3_CFLAGS) +@endif target-libstdc++-v3-bootstrap +STAGE3_TFLAGS = $(STAGE_TFLAGS) +# STAGE1_CONFIGURE_FLAGS overridden below, so we can use +# POSTSTAGE1_CONFIGURE_FLAGS here. +STAGE3_CONFIGURE_FLAGS = \ + $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS) + +# Defaults for stage 4; some are overridden below. +STAGE4_CFLAGS = $(STAGE_CFLAGS) +STAGE4_CXXFLAGS = $(CXXFLAGS) +@if target-libstdc++-v3-bootstrap +# Override the above if we're bootstrapping C++. +STAGE4_CXXFLAGS = $(STAGE4_CFLAGS) +@endif target-libstdc++-v3-bootstrap +STAGE4_TFLAGS = $(STAGE_TFLAGS) +# STAGE1_CONFIGURE_FLAGS overridden below, so we can use +# POSTSTAGE1_CONFIGURE_FLAGS here. +STAGE4_CONFIGURE_FLAGS = \ + $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS) + +# Defaults for stage profile; some are overridden below. +STAGEprofile_CFLAGS = $(STAGE_CFLAGS) +STAGEprofile_CXXFLAGS = $(CXXFLAGS) +@if target-libstdc++-v3-bootstrap +# Override the above if we're bootstrapping C++. +STAGEprofile_CXXFLAGS = $(STAGEprofile_CFLAGS) +@endif target-libstdc++-v3-bootstrap +STAGEprofile_TFLAGS = $(STAGE_TFLAGS) +# STAGE1_CONFIGURE_FLAGS overridden below, so we can use +# POSTSTAGE1_CONFIGURE_FLAGS here. +STAGEprofile_CONFIGURE_FLAGS = \ + $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS) + +# Defaults for stage feedback; some are overridden below. +STAGEfeedback_CFLAGS = $(STAGE_CFLAGS) +STAGEfeedback_CXXFLAGS = $(CXXFLAGS) +@if target-libstdc++-v3-bootstrap +# Override the above if we're bootstrapping C++. +STAGEfeedback_CXXFLAGS = $(STAGEfeedback_CFLAGS) +@endif target-libstdc++-v3-bootstrap +STAGEfeedback_TFLAGS = $(STAGE_TFLAGS) +# STAGE1_CONFIGURE_FLAGS overridden below, so we can use +# POSTSTAGE1_CONFIGURE_FLAGS here. +STAGEfeedback_CONFIGURE_FLAGS = \ + $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS) + + +# Only build the C compiler for stage1, because that is the only one that +# we can guarantee will build with the native compiler, and also it is the +# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS), +# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them +# overrideable (for a bootstrap build stage1 also builds gcc.info). + +STAGE1_CFLAGS = @stage1_cflags@ +STAGE1_CHECKING = @stage1_checking@ +STAGE1_LANGUAGES = @stage1_languages@ +# * We force-disable intermodule optimizations, even if +# --enable-intermodule was passed, since the installed compiler +# probably can't handle them. Luckily, autoconf always respects +# the last argument when conflicting --enable arguments are passed. +# * Likewise, we force-disable coverage flags, since the installed +# compiler probably has never heard of them. +# * Don't remove this, because above we added +# POSTSTAGE1_CONFIGURE_FLAGS to STAGE_CONFIGURE_FLAGS, which +# we don't want for STAGE1_CONFIGURE_FLAGS. +STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \ + --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + +STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate +STAGEprofile_TFLAGS = $(STAGE2_TFLAGS) + +STAGEfeedback_CFLAGS = $(STAGE3_CFLAGS) -fprofile-use +STAGEfeedback_TFLAGS = $(STAGE3_TFLAGS) + +do-compare = @do_compare@ +do-compare3 = $(do-compare) + +# ----------------------------------------------- +# Programs producing files for the TARGET machine +# ----------------------------------------------- + +AR_FOR_TARGET=@AR_FOR_TARGET@ +AS_FOR_TARGET=@AS_FOR_TARGET@ +CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@ + +# If GCC_FOR_TARGET is not overriden on the command line, then this +# variable is passed down to the gcc Makefile, where it is used to +# build libgcc2.a. We define it here so that it can itself be +# overridden on the command line. +GCC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCC_FOR_TARGET@ +CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@ +RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@ +GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ +GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@ +GOC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GOC_FOR_TARGET@ +DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@ +LD_FOR_TARGET=@LD_FOR_TARGET@ + +LIPO_FOR_TARGET=@LIPO_FOR_TARGET@ +NM_FOR_TARGET=@NM_FOR_TARGET@ +OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@ +RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ +STRIP_FOR_TARGET=@STRIP_FOR_TARGET@ +WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@ +WINDMC_FOR_TARGET=@WINDMC_FOR_TARGET@ + +COMPILER_AS_FOR_TARGET=@COMPILER_AS_FOR_TARGET@ +COMPILER_LD_FOR_TARGET=@COMPILER_LD_FOR_TARGET@ +COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_TARGET@ + +CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@ +CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@ + +LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) +LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates +LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@ +GOCFLAGS_FOR_TARGET = -O2 -g + +FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ +SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ +DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@ + +XGCC_FLAGS_FOR_TARGET = $(FLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET) + +# ------------------------------------ +# Miscellaneous targets and flag lists +# ------------------------------------ + +# The first rule in the file had better be this one. Don't put any above it. +# This lives here to allow makefile fragments to contain dependencies. +all: + +#### host and target specific makefile fragments come in here. +@target_makefile_frag@ +@alphaieee_frag@ +@ospace_frag@ +@host_makefile_frag@ +### + +# This is the list of directories that may be needed in RPATH_ENVVAR +# so that programs built for the target machine work. +TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libgomp)$(HOST_LIB_PATH_gcc) + +@if target-libstdc++-v3 +TARGET_LIB_PATH_libstdc++-v3 = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs: +@endif target-libstdc++-v3 + +@if target-libmudflap +TARGET_LIB_PATH_libmudflap = $$r/$(TARGET_SUBDIR)/libmudflap/.libs: +@endif target-libmudflap + +@if target-libssp +TARGET_LIB_PATH_libssp = $$r/$(TARGET_SUBDIR)/libssp/.libs: +@endif target-libssp + +@if target-libgomp +TARGET_LIB_PATH_libgomp = $$r/$(TARGET_SUBDIR)/libgomp/.libs: +@endif target-libgomp + + + +# This is the list of directories that may be needed in RPATH_ENVVAR +# so that programs built for the host machine work. +HOST_LIB_PATH = $(HOST_LIB_PATH_bfd)$(HOST_LIB_PATH_opcodes)$(HOST_LIB_PATH_gmp)$(HOST_LIB_PATH_mpfr)$(HOST_LIB_PATH_mpc)$(HOST_LIB_PATH_ppl)$(HOST_LIB_PATH_cloog)$(HOST_LIB_PATH_libelf) + +# Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch +@if gcc +HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc$(GCC_SHLIB_SUBDIR):$$r/$(HOST_SUBDIR)/prev-gcc$(GCC_SHLIB_SUBDIR): +@endif gcc + + +@if bfd +HOST_LIB_PATH_bfd = \ + $$r/$(HOST_SUBDIR)/bfd/.libs:$$r/$(HOST_SUBDIR)/prev-bfd/.libs: +@endif bfd + +@if opcodes +HOST_LIB_PATH_opcodes = \ + $$r/$(HOST_SUBDIR)/opcodes/.libs:$$r/$(HOST_SUBDIR)/prev-opcodes/.libs: +@endif opcodes + +@if gmp +HOST_LIB_PATH_gmp = \ + $$r/$(HOST_SUBDIR)/gmp/.libs:$$r/$(HOST_SUBDIR)/prev-gmp/.libs: +@endif gmp + +@if mpfr +HOST_LIB_PATH_mpfr = \ + $$r/$(HOST_SUBDIR)/mpfr/.libs:$$r/$(HOST_SUBDIR)/prev-mpfr/.libs: +@endif mpfr + +@if mpc +HOST_LIB_PATH_mpc = \ + $$r/$(HOST_SUBDIR)/mpc/.libs:$$r/$(HOST_SUBDIR)/prev-mpc/.libs: +@endif mpc + +@if ppl +HOST_LIB_PATH_ppl = \ + $$r/$(HOST_SUBDIR)/ppl/src/.libs:$$r/$(HOST_SUBDIR)/prev-ppl/src/.libs: +@endif ppl + +@if cloog +HOST_LIB_PATH_cloog = \ + $$r/$(HOST_SUBDIR)/cloog/.libs:$$r/$(HOST_SUBDIR)/prev-cloog/.libs: +@endif cloog + +@if libelf +HOST_LIB_PATH_libelf = \ + $$r/$(HOST_SUBDIR)/libelf/.libs:$$r/$(HOST_SUBDIR)/prev-libelf/.libs: +@endif libelf + + +CXX_FOR_TARGET_FLAG_TO_PASS = \ + "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" +@if target-libstdc++-v3 +# CXX_FOR_TARGET is tricky to get right for target libs that require a +# functional C++ compiler. When we recurse, if we expand +# CXX_FOR_TARGET before configuring libstdc++-v3, we won't get +# libstdc++ include flags from the script. Instead, we get an +# -funconfigured-* word, so that we'll get errors if this invalid C++ +# command line is used for anything, but also so that we can use the +# word to decide whether or not to pass on this CXX_FOR_TARGET. If we +# don't pass it on, sub-make will use the default definition, that +# re-expands it at the time of use, so we'll get it right when we need +# it. One potential exception is the expansion of CXX_FOR_TARGET +# passed down as part of CXX within TARGET_FLAGS, but this wouldn't +# really work, for C++ host programs can't depend on the current-stage +# C++ target library. +CXX_FOR_TARGET_FLAG_TO_PASS = \ + $(shell if echo "$(CXX_FOR_TARGET)" | grep " -funconfigured-" > /dev/null; then :; else echo '"CXX_FOR_TARGET=$(CXX_FOR_TARGET)"'; fi) +@endif target-libstdc++-v3 + +# Flags to pass down to all sub-makes. +BASE_FLAGS_TO_PASS = \ + "DESTDIR=$(DESTDIR)" \ + "RPATH_ENVVAR=$(RPATH_ENVVAR)" \ + "TARGET_SUBDIR=$(TARGET_SUBDIR)" \ + "bindir=$(bindir)" \ + "datadir=$(datadir)" \ + "exec_prefix=$(exec_prefix)" \ + "includedir=$(includedir)" \ + "datarootdir=$(datarootdir)" \ + "docdir=$(docdir)" \ + "infodir=$(infodir)" \ + "pdfdir=$(pdfdir)" \ + "htmldir=$(htmldir)" \ + "libdir=$(libdir)" \ + "libexecdir=$(libexecdir)" \ + "lispdir=$(lispdir)" \ + "localstatedir=$(localstatedir)" \ + "mandir=$(mandir)" \ + "oldincludedir=$(oldincludedir)" \ + "prefix=$(prefix)" \ + "sbindir=$(sbindir)" \ + "sharedstatedir=$(sharedstatedir)" \ + "sysconfdir=$(sysconfdir)" \ + "tooldir=$(tooldir)" \ + "build_tooldir=$(build_tooldir)" \ + "target_alias=$(target_alias)" \ + "AWK=$(AWK)" \ + "BISON=$(BISON)" \ + "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ + "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ + "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ + "EXPECT=$(EXPECT)" \ + "FLEX=$(FLEX)" \ + "INSTALL=$(INSTALL)" \ + "INSTALL_DATA=$(INSTALL_DATA)" \ + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ + "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ + "LDFLAGS_FOR_BUILD=$(LDFLAGS_FOR_BUILD)" \ + "LEX=$(LEX)" \ + "M4=$(M4)" \ + "MAKE=$(MAKE)" \ + "RUNTEST=$(RUNTEST)" \ + "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ + "SED=$(SED)" \ + "SHELL=$(SHELL)" \ + "YACC=$(YACC)" \ + "`echo 'ADAFLAGS=$(ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ + "ADA_CFLAGS=$(ADA_CFLAGS)" \ + "AR_FLAGS=$(AR_FLAGS)" \ + "`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ + "BOOT_CFLAGS=$(BOOT_CFLAGS)" \ + "BOOT_LDFLAGS=$(BOOT_LDFLAGS)" \ + "CFLAGS=$(CFLAGS)" \ + "CXXFLAGS=$(CXXFLAGS)" \ + "LDFLAGS=$(LDFLAGS)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "LIBCXXFLAGS=$(LIBCXXFLAGS)" \ + "STAGE1_CHECKING=$(STAGE1_CHECKING)" \ + "STAGE1_LANGUAGES=$(STAGE1_LANGUAGES)" \ + "GNATBIND=$(GNATBIND)" \ + "GNATMAKE=$(GNATMAKE)" \ + "AR_FOR_TARGET=$(AR_FOR_TARGET)" \ + "AS_FOR_TARGET=$(AS_FOR_TARGET)" \ + "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ + "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ + "CPPFLAGS_FOR_TARGET=$(CPPFLAGS_FOR_TARGET)" \ + "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \ + "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \ + "FLAGS_FOR_TARGET=$(FLAGS_FOR_TARGET)" \ + "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \ + "GFORTRAN_FOR_TARGET=$(GFORTRAN_FOR_TARGET)" \ + "GOC_FOR_TARGET=$(GOC_FOR_TARGET)" \ + "GOCFLAGS_FOR_TARGET=$(GOCFLAGS_FOR_TARGET)" \ + "LD_FOR_TARGET=$(LD_FOR_TARGET)" \ + "LIPO_FOR_TARGET=$(LIPO_FOR_TARGET)" \ + "LDFLAGS_FOR_TARGET=$(LDFLAGS_FOR_TARGET)" \ + "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ + "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \ + "NM_FOR_TARGET=$(NM_FOR_TARGET)" \ + "OBJDUMP_FOR_TARGET=$(OBJDUMP_FOR_TARGET)" \ + "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \ + "STRIP_FOR_TARGET=$(STRIP_FOR_TARGET)" \ + "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \ + "WINDMC_FOR_TARGET=$(WINDMC_FOR_TARGET)" \ + "BUILD_CONFIG=$(BUILD_CONFIG)" \ + "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ + "LEAN=$(LEAN)" \ + "STAGE1_CFLAGS=$(STAGE1_CFLAGS)" \ + "STAGE1_CXXFLAGS=$(STAGE1_CXXFLAGS)" \ + "STAGE1_TFLAGS=$(STAGE1_TFLAGS)" \ + "STAGE2_CFLAGS=$(STAGE2_CFLAGS)" \ + "STAGE2_CXXFLAGS=$(STAGE2_CXXFLAGS)" \ + "STAGE2_TFLAGS=$(STAGE2_TFLAGS)" \ + "STAGE3_CFLAGS=$(STAGE3_CFLAGS)" \ + "STAGE3_CXXFLAGS=$(STAGE3_CXXFLAGS)" \ + "STAGE3_TFLAGS=$(STAGE3_TFLAGS)" \ + "STAGE4_CFLAGS=$(STAGE4_CFLAGS)" \ + "STAGE4_CXXFLAGS=$(STAGE4_CXXFLAGS)" \ + "STAGE4_TFLAGS=$(STAGE4_TFLAGS)" \ + "STAGEprofile_CFLAGS=$(STAGEprofile_CFLAGS)" \ + "STAGEprofile_CXXFLAGS=$(STAGEprofile_CXXFLAGS)" \ + "STAGEprofile_TFLAGS=$(STAGEprofile_TFLAGS)" \ + "STAGEfeedback_CFLAGS=$(STAGEfeedback_CFLAGS)" \ + "STAGEfeedback_CXXFLAGS=$(STAGEfeedback_CXXFLAGS)" \ + "STAGEfeedback_TFLAGS=$(STAGEfeedback_TFLAGS)" \ + $(CXX_FOR_TARGET_FLAG_TO_PASS) \ + "TFLAGS=$(TFLAGS)" \ + "CONFIG_SHELL=$(SHELL)" \ + "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" + +# We leave this in just in case, but it is not needed anymore. +RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) + +# Flags to pass down to most sub-makes, in which we're building with +# the host environment. +EXTRA_HOST_FLAGS = \ + 'AR=$(AR)' \ + 'AS=$(AS)' \ + 'CC=$(CC)' \ + 'CXX=$(CXX)' \ + 'DLLTOOL=$(DLLTOOL)' \ + 'GCJ=$(GCJ)' \ + 'GFORTRAN=$(GFORTRAN)' \ + 'GOC=$(GOC)' \ + 'LD=$(LD)' \ + 'LIPO=$(LIPO)' \ + 'NM=$(NM)' \ + 'OBJDUMP=$(OBJDUMP)' \ + 'RANLIB=$(RANLIB)' \ + 'STRIP=$(STRIP)' \ + 'WINDRES=$(WINDRES)' \ + 'WINDMC=$(WINDMC)' + +FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) + +# Flags to pass to stage2 and later makes. + +POSTSTAGE1_FLAGS_TO_PASS = \ + CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \ + CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \ + GNATBIND="$${GNATBIND}" \ + LDFLAGS="$${LDFLAGS}" \ + HOST_LIBS="$${HOST_LIBS}" \ + "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" + +# Flags to pass down to makes which are built with the target environment. +# The double $ decreases the length of the command line; those variables +# are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The +# *_CFLAGS_FOR_TARGET variables are not passed down and most often empty, +# so we expand them here. +EXTRA_TARGET_FLAGS = \ + 'AR=$$(AR_FOR_TARGET)' \ + 'AS=$(COMPILER_AS_FOR_TARGET)' \ + 'CC=$$(CC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ + 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \ + 'CXX=$$(CXX_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ + 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \ + 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ + 'GCJ=$$(GCJ_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ + 'GFORTRAN=$$(GFORTRAN_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ + 'GOC=$$(GOC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ + 'GOCFLAGS=$$(GOCFLAGS_FOR_TARGET)' \ + 'LD=$(COMPILER_LD_FOR_TARGET)' \ + 'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \ + 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \ + 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \ + 'NM=$(COMPILER_NM_FOR_TARGET)' \ + 'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \ + 'RANLIB=$$(RANLIB_FOR_TARGET)' \ + 'WINDRES=$$(WINDRES_FOR_TARGET)' \ + 'WINDMC=$$(WINDMC_FOR_TARGET)' \ + 'XGCC_FLAGS_FOR_TARGET=$(XGCC_FLAGS_FOR_TARGET)' \ + "TFLAGS=$$TFLAGS" + +TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) + +# Flags to pass down to gcc. gcc builds a library, libgcc.a, so it +# unfortunately needs the native compiler and the target ar and +# ranlib. +# If any variables are added here, they must be added to do-*, below. +# The BUILD_* variables are a special case, which are used for the gcc +# cross-building scheme. +EXTRA_GCC_FLAGS = \ + "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \ + "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ + "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ + "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ + "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ + "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" + +GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS) + +@if gcc +BUILD_CONFIG = @BUILD_CONFIG@ +ifneq ($(BUILD_CONFIG),) +include $(foreach CONFIG, $(BUILD_CONFIG), $(srcdir)/config/$(CONFIG).mk) +endif +@endif gcc + +.PHONY: configure-host +configure-host: \ + maybe-configure-bfd \ + maybe-configure-opcodes \ + maybe-configure-binutils \ + maybe-configure-bison \ + maybe-configure-cgen \ + maybe-configure-dejagnu \ + maybe-configure-etc \ + maybe-configure-fastjar \ + maybe-configure-fixincludes \ + maybe-configure-flex \ + maybe-configure-gas \ + maybe-configure-gcc \ + maybe-configure-gmp \ + maybe-configure-mpfr \ + maybe-configure-mpc \ + maybe-configure-ppl \ + maybe-configure-cloog \ + maybe-configure-libelf \ + maybe-configure-gold \ + maybe-configure-gprof \ + maybe-configure-intl \ + maybe-configure-tcl \ + maybe-configure-itcl \ + maybe-configure-ld \ + maybe-configure-libcpp \ + maybe-configure-libdecnumber \ + maybe-configure-libgui \ + maybe-configure-libiberty \ + maybe-configure-libiconv \ + maybe-configure-m4 \ + maybe-configure-readline \ + maybe-configure-sid \ + maybe-configure-sim \ + maybe-configure-texinfo \ + maybe-configure-zlib \ + maybe-configure-gdb \ + maybe-configure-expect \ + maybe-configure-guile \ + maybe-configure-tk \ + maybe-configure-libtermcap \ + maybe-configure-utils \ + maybe-configure-gnattools \ + maybe-configure-lto-plugin +.PHONY: configure-target +configure-target: \ + maybe-configure-target-libstdc++-v3 \ + maybe-configure-target-libmudflap \ + maybe-configure-target-libssp \ + maybe-configure-target-newlib \ + maybe-configure-target-libgcc \ + maybe-configure-target-libquadmath \ + maybe-configure-target-libgfortran \ + maybe-configure-target-libobjc \ + maybe-configure-target-libgo \ + maybe-configure-target-libtermcap \ + maybe-configure-target-winsup \ + maybe-configure-target-libgloss \ + maybe-configure-target-libffi \ + maybe-configure-target-libjava \ + maybe-configure-target-zlib \ + maybe-configure-target-boehm-gc \ + maybe-configure-target-rda \ + maybe-configure-target-libada \ + maybe-configure-target-libgomp + +# The target built for a native non-bootstrap build. +.PHONY: all +all: +@if gcc-bootstrap + [ -f stage_final ] || echo stage3 > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) `cat stage_final`-bubble +@endif gcc-bootstrap + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ +@if gcc-bootstrap + if [ -f stage_last ]; then \ + TFLAGS="$(STAGE$(shell test ! -f stage_last || sed s,^stage,, stage_last)_TFLAGS)"; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \ + else \ +@endif gcc-bootstrap + $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target \ +@if gcc-bootstrap + ; \ + fi \ +@endif gcc-bootstrap + && : + +.PHONY: all-build + +all-build: maybe-all-build-libiberty +all-build: maybe-all-build-bison +all-build: maybe-all-build-flex +all-build: maybe-all-build-m4 +all-build: maybe-all-build-texinfo +all-build: maybe-all-build-fixincludes + +.PHONY: all-host + +@if bfd-no-bootstrap +all-host: maybe-all-bfd +@endif bfd-no-bootstrap +@if opcodes-no-bootstrap +all-host: maybe-all-opcodes +@endif opcodes-no-bootstrap +@if binutils-no-bootstrap +all-host: maybe-all-binutils +@endif binutils-no-bootstrap +all-host: maybe-all-bison +all-host: maybe-all-cgen +all-host: maybe-all-dejagnu +all-host: maybe-all-etc +all-host: maybe-all-fastjar +all-host: maybe-all-fixincludes +all-host: maybe-all-flex +@if gas-no-bootstrap +all-host: maybe-all-gas +@endif gas-no-bootstrap +@if gcc-no-bootstrap +all-host: maybe-all-gcc +@endif gcc-no-bootstrap +@if gmp-no-bootstrap +all-host: maybe-all-gmp +@endif gmp-no-bootstrap +@if mpfr-no-bootstrap +all-host: maybe-all-mpfr +@endif mpfr-no-bootstrap +@if mpc-no-bootstrap +all-host: maybe-all-mpc +@endif mpc-no-bootstrap +@if ppl-no-bootstrap +all-host: maybe-all-ppl +@endif ppl-no-bootstrap +@if cloog-no-bootstrap +all-host: maybe-all-cloog +@endif cloog-no-bootstrap +@if libelf-no-bootstrap +all-host: maybe-all-libelf +@endif libelf-no-bootstrap +@if gold-no-bootstrap +all-host: maybe-all-gold +@endif gold-no-bootstrap +all-host: maybe-all-gprof +@if intl-no-bootstrap +all-host: maybe-all-intl +@endif intl-no-bootstrap +all-host: maybe-all-tcl +all-host: maybe-all-itcl +@if ld-no-bootstrap +all-host: maybe-all-ld +@endif ld-no-bootstrap +@if libcpp-no-bootstrap +all-host: maybe-all-libcpp +@endif libcpp-no-bootstrap +@if libdecnumber-no-bootstrap +all-host: maybe-all-libdecnumber +@endif libdecnumber-no-bootstrap +all-host: maybe-all-libgui +@if libiberty-no-bootstrap +all-host: maybe-all-libiberty +@endif libiberty-no-bootstrap +all-host: maybe-all-libiconv +all-host: maybe-all-m4 +all-host: maybe-all-readline +all-host: maybe-all-sid +all-host: maybe-all-sim +all-host: maybe-all-texinfo +@if zlib-no-bootstrap +all-host: maybe-all-zlib +@endif zlib-no-bootstrap +all-host: maybe-all-gdb +all-host: maybe-all-expect +all-host: maybe-all-guile +all-host: maybe-all-tk +all-host: maybe-all-libtermcap +all-host: maybe-all-utils +all-host: maybe-all-gnattools +@if lto-plugin-no-bootstrap +all-host: maybe-all-lto-plugin +@endif lto-plugin-no-bootstrap + +.PHONY: all-target + +@if target-libstdc++-v3-no-bootstrap +all-target: maybe-all-target-libstdc++-v3 +@endif target-libstdc++-v3-no-bootstrap +all-target: maybe-all-target-libmudflap +all-target: maybe-all-target-libssp +all-target: maybe-all-target-newlib +@if target-libgcc-no-bootstrap +all-target: maybe-all-target-libgcc +@endif target-libgcc-no-bootstrap +all-target: maybe-all-target-libquadmath +all-target: maybe-all-target-libgfortran +all-target: maybe-all-target-libobjc +all-target: maybe-all-target-libgo +all-target: maybe-all-target-libtermcap +all-target: maybe-all-target-winsup +all-target: maybe-all-target-libgloss +all-target: maybe-all-target-libffi +all-target: maybe-all-target-libjava +all-target: maybe-all-target-zlib +all-target: maybe-all-target-boehm-gc +all-target: maybe-all-target-rda +all-target: maybe-all-target-libada +@if target-libgomp-no-bootstrap +all-target: maybe-all-target-libgomp +@endif target-libgomp-no-bootstrap + +# Do a target for all the subdirectories. A ``make do-X'' will do a +# ``make X'' in all subdirectories (because, in general, there is a +# dependency (below) of X upon do-X, a ``make X'' will also do this, +# but it may do additional work as well). + +.PHONY: do-info +do-info: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) info-host \ + info-target + + +.PHONY: info-host + +info-host: maybe-info-bfd +info-host: maybe-info-opcodes +info-host: maybe-info-binutils +info-host: maybe-info-bison +info-host: maybe-info-cgen +info-host: maybe-info-dejagnu +info-host: maybe-info-etc +info-host: maybe-info-fastjar +info-host: maybe-info-fixincludes +info-host: maybe-info-flex +info-host: maybe-info-gas +info-host: maybe-info-gcc +info-host: maybe-info-gmp +info-host: maybe-info-mpfr +info-host: maybe-info-mpc +info-host: maybe-info-ppl +info-host: maybe-info-cloog +info-host: maybe-info-libelf +info-host: maybe-info-gold +info-host: maybe-info-gprof +info-host: maybe-info-intl +info-host: maybe-info-tcl +info-host: maybe-info-itcl +info-host: maybe-info-ld +info-host: maybe-info-libcpp +info-host: maybe-info-libdecnumber +info-host: maybe-info-libgui +info-host: maybe-info-libiberty +info-host: maybe-info-libiconv +info-host: maybe-info-m4 +info-host: maybe-info-readline +info-host: maybe-info-sid +info-host: maybe-info-sim +info-host: maybe-info-texinfo +info-host: maybe-info-zlib +info-host: maybe-info-gdb +info-host: maybe-info-expect +info-host: maybe-info-guile +info-host: maybe-info-tk +info-host: maybe-info-libtermcap +info-host: maybe-info-utils +info-host: maybe-info-gnattools +info-host: maybe-info-lto-plugin + +.PHONY: info-target + +info-target: maybe-info-target-libstdc++-v3 +info-target: maybe-info-target-libmudflap +info-target: maybe-info-target-libssp +info-target: maybe-info-target-newlib +info-target: maybe-info-target-libgcc +info-target: maybe-info-target-libquadmath +info-target: maybe-info-target-libgfortran +info-target: maybe-info-target-libobjc +info-target: maybe-info-target-libgo +info-target: maybe-info-target-libtermcap +info-target: maybe-info-target-winsup +info-target: maybe-info-target-libgloss +info-target: maybe-info-target-libffi +info-target: maybe-info-target-libjava +info-target: maybe-info-target-zlib +info-target: maybe-info-target-boehm-gc +info-target: maybe-info-target-rda +info-target: maybe-info-target-libada +info-target: maybe-info-target-libgomp + +.PHONY: do-dvi +do-dvi: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) dvi-host \ + dvi-target + + +.PHONY: dvi-host + +dvi-host: maybe-dvi-bfd +dvi-host: maybe-dvi-opcodes +dvi-host: maybe-dvi-binutils +dvi-host: maybe-dvi-bison +dvi-host: maybe-dvi-cgen +dvi-host: maybe-dvi-dejagnu +dvi-host: maybe-dvi-etc +dvi-host: maybe-dvi-fastjar +dvi-host: maybe-dvi-fixincludes +dvi-host: maybe-dvi-flex +dvi-host: maybe-dvi-gas +dvi-host: maybe-dvi-gcc +dvi-host: maybe-dvi-gmp +dvi-host: maybe-dvi-mpfr +dvi-host: maybe-dvi-mpc +dvi-host: maybe-dvi-ppl +dvi-host: maybe-dvi-cloog +dvi-host: maybe-dvi-libelf +dvi-host: maybe-dvi-gold +dvi-host: maybe-dvi-gprof +dvi-host: maybe-dvi-intl +dvi-host: maybe-dvi-tcl +dvi-host: maybe-dvi-itcl +dvi-host: maybe-dvi-ld +dvi-host: maybe-dvi-libcpp +dvi-host: maybe-dvi-libdecnumber +dvi-host: maybe-dvi-libgui +dvi-host: maybe-dvi-libiberty +dvi-host: maybe-dvi-libiconv +dvi-host: maybe-dvi-m4 +dvi-host: maybe-dvi-readline +dvi-host: maybe-dvi-sid +dvi-host: maybe-dvi-sim +dvi-host: maybe-dvi-texinfo +dvi-host: maybe-dvi-zlib +dvi-host: maybe-dvi-gdb +dvi-host: maybe-dvi-expect +dvi-host: maybe-dvi-guile +dvi-host: maybe-dvi-tk +dvi-host: maybe-dvi-libtermcap +dvi-host: maybe-dvi-utils +dvi-host: maybe-dvi-gnattools +dvi-host: maybe-dvi-lto-plugin + +.PHONY: dvi-target + +dvi-target: maybe-dvi-target-libstdc++-v3 +dvi-target: maybe-dvi-target-libmudflap +dvi-target: maybe-dvi-target-libssp +dvi-target: maybe-dvi-target-newlib +dvi-target: maybe-dvi-target-libgcc +dvi-target: maybe-dvi-target-libquadmath +dvi-target: maybe-dvi-target-libgfortran +dvi-target: maybe-dvi-target-libobjc +dvi-target: maybe-dvi-target-libgo +dvi-target: maybe-dvi-target-libtermcap +dvi-target: maybe-dvi-target-winsup +dvi-target: maybe-dvi-target-libgloss +dvi-target: maybe-dvi-target-libffi +dvi-target: maybe-dvi-target-libjava +dvi-target: maybe-dvi-target-zlib +dvi-target: maybe-dvi-target-boehm-gc +dvi-target: maybe-dvi-target-rda +dvi-target: maybe-dvi-target-libada +dvi-target: maybe-dvi-target-libgomp + +.PHONY: do-pdf +do-pdf: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) pdf-host \ + pdf-target + + +.PHONY: pdf-host + +pdf-host: maybe-pdf-bfd +pdf-host: maybe-pdf-opcodes +pdf-host: maybe-pdf-binutils +pdf-host: maybe-pdf-bison +pdf-host: maybe-pdf-cgen +pdf-host: maybe-pdf-dejagnu +pdf-host: maybe-pdf-etc +pdf-host: maybe-pdf-fastjar +pdf-host: maybe-pdf-fixincludes +pdf-host: maybe-pdf-flex +pdf-host: maybe-pdf-gas +pdf-host: maybe-pdf-gcc +pdf-host: maybe-pdf-gmp +pdf-host: maybe-pdf-mpfr +pdf-host: maybe-pdf-mpc +pdf-host: maybe-pdf-ppl +pdf-host: maybe-pdf-cloog +pdf-host: maybe-pdf-libelf +pdf-host: maybe-pdf-gold +pdf-host: maybe-pdf-gprof +pdf-host: maybe-pdf-intl +pdf-host: maybe-pdf-tcl +pdf-host: maybe-pdf-itcl +pdf-host: maybe-pdf-ld +pdf-host: maybe-pdf-libcpp +pdf-host: maybe-pdf-libdecnumber +pdf-host: maybe-pdf-libgui +pdf-host: maybe-pdf-libiberty +pdf-host: maybe-pdf-libiconv +pdf-host: maybe-pdf-m4 +pdf-host: maybe-pdf-readline +pdf-host: maybe-pdf-sid +pdf-host: maybe-pdf-sim +pdf-host: maybe-pdf-texinfo +pdf-host: maybe-pdf-zlib +pdf-host: maybe-pdf-gdb +pdf-host: maybe-pdf-expect +pdf-host: maybe-pdf-guile +pdf-host: maybe-pdf-tk +pdf-host: maybe-pdf-libtermcap +pdf-host: maybe-pdf-utils +pdf-host: maybe-pdf-gnattools +pdf-host: maybe-pdf-lto-plugin + +.PHONY: pdf-target + +pdf-target: maybe-pdf-target-libstdc++-v3 +pdf-target: maybe-pdf-target-libmudflap +pdf-target: maybe-pdf-target-libssp +pdf-target: maybe-pdf-target-newlib +pdf-target: maybe-pdf-target-libgcc +pdf-target: maybe-pdf-target-libquadmath +pdf-target: maybe-pdf-target-libgfortran +pdf-target: maybe-pdf-target-libobjc +pdf-target: maybe-pdf-target-libgo +pdf-target: maybe-pdf-target-libtermcap +pdf-target: maybe-pdf-target-winsup +pdf-target: maybe-pdf-target-libgloss +pdf-target: maybe-pdf-target-libffi +pdf-target: maybe-pdf-target-libjava +pdf-target: maybe-pdf-target-zlib +pdf-target: maybe-pdf-target-boehm-gc +pdf-target: maybe-pdf-target-rda +pdf-target: maybe-pdf-target-libada +pdf-target: maybe-pdf-target-libgomp + +.PHONY: do-html +do-html: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) html-host \ + html-target + + +.PHONY: html-host + +html-host: maybe-html-bfd +html-host: maybe-html-opcodes +html-host: maybe-html-binutils +html-host: maybe-html-bison +html-host: maybe-html-cgen +html-host: maybe-html-dejagnu +html-host: maybe-html-etc +html-host: maybe-html-fastjar +html-host: maybe-html-fixincludes +html-host: maybe-html-flex +html-host: maybe-html-gas +html-host: maybe-html-gcc +html-host: maybe-html-gmp +html-host: maybe-html-mpfr +html-host: maybe-html-mpc +html-host: maybe-html-ppl +html-host: maybe-html-cloog +html-host: maybe-html-libelf +html-host: maybe-html-gold +html-host: maybe-html-gprof +html-host: maybe-html-intl +html-host: maybe-html-tcl +html-host: maybe-html-itcl +html-host: maybe-html-ld +html-host: maybe-html-libcpp +html-host: maybe-html-libdecnumber +html-host: maybe-html-libgui +html-host: maybe-html-libiberty +html-host: maybe-html-libiconv +html-host: maybe-html-m4 +html-host: maybe-html-readline +html-host: maybe-html-sid +html-host: maybe-html-sim +html-host: maybe-html-texinfo +html-host: maybe-html-zlib +html-host: maybe-html-gdb +html-host: maybe-html-expect +html-host: maybe-html-guile +html-host: maybe-html-tk +html-host: maybe-html-libtermcap +html-host: maybe-html-utils +html-host: maybe-html-gnattools +html-host: maybe-html-lto-plugin + +.PHONY: html-target + +html-target: maybe-html-target-libstdc++-v3 +html-target: maybe-html-target-libmudflap +html-target: maybe-html-target-libssp +html-target: maybe-html-target-newlib +html-target: maybe-html-target-libgcc +html-target: maybe-html-target-libquadmath +html-target: maybe-html-target-libgfortran +html-target: maybe-html-target-libobjc +html-target: maybe-html-target-libgo +html-target: maybe-html-target-libtermcap +html-target: maybe-html-target-winsup +html-target: maybe-html-target-libgloss +html-target: maybe-html-target-libffi +html-target: maybe-html-target-libjava +html-target: maybe-html-target-zlib +html-target: maybe-html-target-boehm-gc +html-target: maybe-html-target-rda +html-target: maybe-html-target-libada +html-target: maybe-html-target-libgomp + +.PHONY: do-TAGS +do-TAGS: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) TAGS-host \ + TAGS-target + + +.PHONY: TAGS-host + +TAGS-host: maybe-TAGS-bfd +TAGS-host: maybe-TAGS-opcodes +TAGS-host: maybe-TAGS-binutils +TAGS-host: maybe-TAGS-bison +TAGS-host: maybe-TAGS-cgen +TAGS-host: maybe-TAGS-dejagnu +TAGS-host: maybe-TAGS-etc +TAGS-host: maybe-TAGS-fastjar +TAGS-host: maybe-TAGS-fixincludes +TAGS-host: maybe-TAGS-flex +TAGS-host: maybe-TAGS-gas +TAGS-host: maybe-TAGS-gcc +TAGS-host: maybe-TAGS-gmp +TAGS-host: maybe-TAGS-mpfr +TAGS-host: maybe-TAGS-mpc +TAGS-host: maybe-TAGS-ppl +TAGS-host: maybe-TAGS-cloog +TAGS-host: maybe-TAGS-libelf +TAGS-host: maybe-TAGS-gold +TAGS-host: maybe-TAGS-gprof +TAGS-host: maybe-TAGS-intl +TAGS-host: maybe-TAGS-tcl +TAGS-host: maybe-TAGS-itcl +TAGS-host: maybe-TAGS-ld +TAGS-host: maybe-TAGS-libcpp +TAGS-host: maybe-TAGS-libdecnumber +TAGS-host: maybe-TAGS-libgui +TAGS-host: maybe-TAGS-libiberty +TAGS-host: maybe-TAGS-libiconv +TAGS-host: maybe-TAGS-m4 +TAGS-host: maybe-TAGS-readline +TAGS-host: maybe-TAGS-sid +TAGS-host: maybe-TAGS-sim +TAGS-host: maybe-TAGS-texinfo +TAGS-host: maybe-TAGS-zlib +TAGS-host: maybe-TAGS-gdb +TAGS-host: maybe-TAGS-expect +TAGS-host: maybe-TAGS-guile +TAGS-host: maybe-TAGS-tk +TAGS-host: maybe-TAGS-libtermcap +TAGS-host: maybe-TAGS-utils +TAGS-host: maybe-TAGS-gnattools +TAGS-host: maybe-TAGS-lto-plugin + +.PHONY: TAGS-target + +TAGS-target: maybe-TAGS-target-libstdc++-v3 +TAGS-target: maybe-TAGS-target-libmudflap +TAGS-target: maybe-TAGS-target-libssp +TAGS-target: maybe-TAGS-target-newlib +TAGS-target: maybe-TAGS-target-libgcc +TAGS-target: maybe-TAGS-target-libquadmath +TAGS-target: maybe-TAGS-target-libgfortran +TAGS-target: maybe-TAGS-target-libobjc +TAGS-target: maybe-TAGS-target-libgo +TAGS-target: maybe-TAGS-target-libtermcap +TAGS-target: maybe-TAGS-target-winsup +TAGS-target: maybe-TAGS-target-libgloss +TAGS-target: maybe-TAGS-target-libffi +TAGS-target: maybe-TAGS-target-libjava +TAGS-target: maybe-TAGS-target-zlib +TAGS-target: maybe-TAGS-target-boehm-gc +TAGS-target: maybe-TAGS-target-rda +TAGS-target: maybe-TAGS-target-libada +TAGS-target: maybe-TAGS-target-libgomp + +.PHONY: do-install-info +do-install-info: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) install-info-host \ + install-info-target + + +.PHONY: install-info-host + +install-info-host: maybe-install-info-bfd +install-info-host: maybe-install-info-opcodes +install-info-host: maybe-install-info-binutils +install-info-host: maybe-install-info-bison +install-info-host: maybe-install-info-cgen +install-info-host: maybe-install-info-dejagnu +install-info-host: maybe-install-info-etc +install-info-host: maybe-install-info-fastjar +install-info-host: maybe-install-info-fixincludes +install-info-host: maybe-install-info-flex +install-info-host: maybe-install-info-gas +install-info-host: maybe-install-info-gcc +install-info-host: maybe-install-info-gmp +install-info-host: maybe-install-info-mpfr +install-info-host: maybe-install-info-mpc +install-info-host: maybe-install-info-ppl +install-info-host: maybe-install-info-cloog +install-info-host: maybe-install-info-libelf +install-info-host: maybe-install-info-gold +install-info-host: maybe-install-info-gprof +install-info-host: maybe-install-info-intl +install-info-host: maybe-install-info-tcl +install-info-host: maybe-install-info-itcl +install-info-host: maybe-install-info-ld +install-info-host: maybe-install-info-libcpp +install-info-host: maybe-install-info-libdecnumber +install-info-host: maybe-install-info-libgui +install-info-host: maybe-install-info-libiberty +install-info-host: maybe-install-info-libiconv +install-info-host: maybe-install-info-m4 +install-info-host: maybe-install-info-readline +install-info-host: maybe-install-info-sid +install-info-host: maybe-install-info-sim +install-info-host: maybe-install-info-texinfo +install-info-host: maybe-install-info-zlib +install-info-host: maybe-install-info-gdb +install-info-host: maybe-install-info-expect +install-info-host: maybe-install-info-guile +install-info-host: maybe-install-info-tk +install-info-host: maybe-install-info-libtermcap +install-info-host: maybe-install-info-utils +install-info-host: maybe-install-info-gnattools +install-info-host: maybe-install-info-lto-plugin + +.PHONY: install-info-target + +install-info-target: maybe-install-info-target-libstdc++-v3 +install-info-target: maybe-install-info-target-libmudflap +install-info-target: maybe-install-info-target-libssp +install-info-target: maybe-install-info-target-newlib +install-info-target: maybe-install-info-target-libgcc +install-info-target: maybe-install-info-target-libquadmath +install-info-target: maybe-install-info-target-libgfortran +install-info-target: maybe-install-info-target-libobjc +install-info-target: maybe-install-info-target-libgo +install-info-target: maybe-install-info-target-libtermcap +install-info-target: maybe-install-info-target-winsup +install-info-target: maybe-install-info-target-libgloss +install-info-target: maybe-install-info-target-libffi +install-info-target: maybe-install-info-target-libjava +install-info-target: maybe-install-info-target-zlib +install-info-target: maybe-install-info-target-boehm-gc +install-info-target: maybe-install-info-target-rda +install-info-target: maybe-install-info-target-libada +install-info-target: maybe-install-info-target-libgomp + +.PHONY: do-install-pdf +do-install-pdf: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) install-pdf-host \ + install-pdf-target + + +.PHONY: install-pdf-host + +install-pdf-host: maybe-install-pdf-bfd +install-pdf-host: maybe-install-pdf-opcodes +install-pdf-host: maybe-install-pdf-binutils +install-pdf-host: maybe-install-pdf-bison +install-pdf-host: maybe-install-pdf-cgen +install-pdf-host: maybe-install-pdf-dejagnu +install-pdf-host: maybe-install-pdf-etc +install-pdf-host: maybe-install-pdf-fastjar +install-pdf-host: maybe-install-pdf-fixincludes +install-pdf-host: maybe-install-pdf-flex +install-pdf-host: maybe-install-pdf-gas +install-pdf-host: maybe-install-pdf-gcc +install-pdf-host: maybe-install-pdf-gmp +install-pdf-host: maybe-install-pdf-mpfr +install-pdf-host: maybe-install-pdf-mpc +install-pdf-host: maybe-install-pdf-ppl +install-pdf-host: maybe-install-pdf-cloog +install-pdf-host: maybe-install-pdf-libelf +install-pdf-host: maybe-install-pdf-gold +install-pdf-host: maybe-install-pdf-gprof +install-pdf-host: maybe-install-pdf-intl +install-pdf-host: maybe-install-pdf-tcl +install-pdf-host: maybe-install-pdf-itcl +install-pdf-host: maybe-install-pdf-ld +install-pdf-host: maybe-install-pdf-libcpp +install-pdf-host: maybe-install-pdf-libdecnumber +install-pdf-host: maybe-install-pdf-libgui +install-pdf-host: maybe-install-pdf-libiberty +install-pdf-host: maybe-install-pdf-libiconv +install-pdf-host: maybe-install-pdf-m4 +install-pdf-host: maybe-install-pdf-readline +install-pdf-host: maybe-install-pdf-sid +install-pdf-host: maybe-install-pdf-sim +install-pdf-host: maybe-install-pdf-texinfo +install-pdf-host: maybe-install-pdf-zlib +install-pdf-host: maybe-install-pdf-gdb +install-pdf-host: maybe-install-pdf-expect +install-pdf-host: maybe-install-pdf-guile +install-pdf-host: maybe-install-pdf-tk +install-pdf-host: maybe-install-pdf-libtermcap +install-pdf-host: maybe-install-pdf-utils +install-pdf-host: maybe-install-pdf-gnattools +install-pdf-host: maybe-install-pdf-lto-plugin + +.PHONY: install-pdf-target + +install-pdf-target: maybe-install-pdf-target-libstdc++-v3 +install-pdf-target: maybe-install-pdf-target-libmudflap +install-pdf-target: maybe-install-pdf-target-libssp +install-pdf-target: maybe-install-pdf-target-newlib +install-pdf-target: maybe-install-pdf-target-libgcc +install-pdf-target: maybe-install-pdf-target-libquadmath +install-pdf-target: maybe-install-pdf-target-libgfortran +install-pdf-target: maybe-install-pdf-target-libobjc +install-pdf-target: maybe-install-pdf-target-libgo +install-pdf-target: maybe-install-pdf-target-libtermcap +install-pdf-target: maybe-install-pdf-target-winsup +install-pdf-target: maybe-install-pdf-target-libgloss +install-pdf-target: maybe-install-pdf-target-libffi +install-pdf-target: maybe-install-pdf-target-libjava +install-pdf-target: maybe-install-pdf-target-zlib +install-pdf-target: maybe-install-pdf-target-boehm-gc +install-pdf-target: maybe-install-pdf-target-rda +install-pdf-target: maybe-install-pdf-target-libada +install-pdf-target: maybe-install-pdf-target-libgomp + +.PHONY: do-install-html +do-install-html: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) install-html-host \ + install-html-target + + +.PHONY: install-html-host + +install-html-host: maybe-install-html-bfd +install-html-host: maybe-install-html-opcodes +install-html-host: maybe-install-html-binutils +install-html-host: maybe-install-html-bison +install-html-host: maybe-install-html-cgen +install-html-host: maybe-install-html-dejagnu +install-html-host: maybe-install-html-etc +install-html-host: maybe-install-html-fastjar +install-html-host: maybe-install-html-fixincludes +install-html-host: maybe-install-html-flex +install-html-host: maybe-install-html-gas +install-html-host: maybe-install-html-gcc +install-html-host: maybe-install-html-gmp +install-html-host: maybe-install-html-mpfr +install-html-host: maybe-install-html-mpc +install-html-host: maybe-install-html-ppl +install-html-host: maybe-install-html-cloog +install-html-host: maybe-install-html-libelf +install-html-host: maybe-install-html-gold +install-html-host: maybe-install-html-gprof +install-html-host: maybe-install-html-intl +install-html-host: maybe-install-html-tcl +install-html-host: maybe-install-html-itcl +install-html-host: maybe-install-html-ld +install-html-host: maybe-install-html-libcpp +install-html-host: maybe-install-html-libdecnumber +install-html-host: maybe-install-html-libgui +install-html-host: maybe-install-html-libiberty +install-html-host: maybe-install-html-libiconv +install-html-host: maybe-install-html-m4 +install-html-host: maybe-install-html-readline +install-html-host: maybe-install-html-sid +install-html-host: maybe-install-html-sim +install-html-host: maybe-install-html-texinfo +install-html-host: maybe-install-html-zlib +install-html-host: maybe-install-html-gdb +install-html-host: maybe-install-html-expect +install-html-host: maybe-install-html-guile +install-html-host: maybe-install-html-tk +install-html-host: maybe-install-html-libtermcap +install-html-host: maybe-install-html-utils +install-html-host: maybe-install-html-gnattools +install-html-host: maybe-install-html-lto-plugin + +.PHONY: install-html-target + +install-html-target: maybe-install-html-target-libstdc++-v3 +install-html-target: maybe-install-html-target-libmudflap +install-html-target: maybe-install-html-target-libssp +install-html-target: maybe-install-html-target-newlib +install-html-target: maybe-install-html-target-libgcc +install-html-target: maybe-install-html-target-libquadmath +install-html-target: maybe-install-html-target-libgfortran +install-html-target: maybe-install-html-target-libobjc +install-html-target: maybe-install-html-target-libgo +install-html-target: maybe-install-html-target-libtermcap +install-html-target: maybe-install-html-target-winsup +install-html-target: maybe-install-html-target-libgloss +install-html-target: maybe-install-html-target-libffi +install-html-target: maybe-install-html-target-libjava +install-html-target: maybe-install-html-target-zlib +install-html-target: maybe-install-html-target-boehm-gc +install-html-target: maybe-install-html-target-rda +install-html-target: maybe-install-html-target-libada +install-html-target: maybe-install-html-target-libgomp + +.PHONY: do-installcheck +do-installcheck: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) installcheck-host \ + installcheck-target + + +.PHONY: installcheck-host + +installcheck-host: maybe-installcheck-bfd +installcheck-host: maybe-installcheck-opcodes +installcheck-host: maybe-installcheck-binutils +installcheck-host: maybe-installcheck-bison +installcheck-host: maybe-installcheck-cgen +installcheck-host: maybe-installcheck-dejagnu +installcheck-host: maybe-installcheck-etc +installcheck-host: maybe-installcheck-fastjar +installcheck-host: maybe-installcheck-fixincludes +installcheck-host: maybe-installcheck-flex +installcheck-host: maybe-installcheck-gas +installcheck-host: maybe-installcheck-gcc +installcheck-host: maybe-installcheck-gmp +installcheck-host: maybe-installcheck-mpfr +installcheck-host: maybe-installcheck-mpc +installcheck-host: maybe-installcheck-ppl +installcheck-host: maybe-installcheck-cloog +installcheck-host: maybe-installcheck-libelf +installcheck-host: maybe-installcheck-gold +installcheck-host: maybe-installcheck-gprof +installcheck-host: maybe-installcheck-intl +installcheck-host: maybe-installcheck-tcl +installcheck-host: maybe-installcheck-itcl +installcheck-host: maybe-installcheck-ld +installcheck-host: maybe-installcheck-libcpp +installcheck-host: maybe-installcheck-libdecnumber +installcheck-host: maybe-installcheck-libgui +installcheck-host: maybe-installcheck-libiberty +installcheck-host: maybe-installcheck-libiconv +installcheck-host: maybe-installcheck-m4 +installcheck-host: maybe-installcheck-readline +installcheck-host: maybe-installcheck-sid +installcheck-host: maybe-installcheck-sim +installcheck-host: maybe-installcheck-texinfo +installcheck-host: maybe-installcheck-zlib +installcheck-host: maybe-installcheck-gdb +installcheck-host: maybe-installcheck-expect +installcheck-host: maybe-installcheck-guile +installcheck-host: maybe-installcheck-tk +installcheck-host: maybe-installcheck-libtermcap +installcheck-host: maybe-installcheck-utils +installcheck-host: maybe-installcheck-gnattools +installcheck-host: maybe-installcheck-lto-plugin + +.PHONY: installcheck-target + +installcheck-target: maybe-installcheck-target-libstdc++-v3 +installcheck-target: maybe-installcheck-target-libmudflap +installcheck-target: maybe-installcheck-target-libssp +installcheck-target: maybe-installcheck-target-newlib +installcheck-target: maybe-installcheck-target-libgcc +installcheck-target: maybe-installcheck-target-libquadmath +installcheck-target: maybe-installcheck-target-libgfortran +installcheck-target: maybe-installcheck-target-libobjc +installcheck-target: maybe-installcheck-target-libgo +installcheck-target: maybe-installcheck-target-libtermcap +installcheck-target: maybe-installcheck-target-winsup +installcheck-target: maybe-installcheck-target-libgloss +installcheck-target: maybe-installcheck-target-libffi +installcheck-target: maybe-installcheck-target-libjava +installcheck-target: maybe-installcheck-target-zlib +installcheck-target: maybe-installcheck-target-boehm-gc +installcheck-target: maybe-installcheck-target-rda +installcheck-target: maybe-installcheck-target-libada +installcheck-target: maybe-installcheck-target-libgomp + +.PHONY: do-mostlyclean +do-mostlyclean: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) mostlyclean-host \ + mostlyclean-target + + +.PHONY: mostlyclean-host + +mostlyclean-host: maybe-mostlyclean-bfd +mostlyclean-host: maybe-mostlyclean-opcodes +mostlyclean-host: maybe-mostlyclean-binutils +mostlyclean-host: maybe-mostlyclean-bison +mostlyclean-host: maybe-mostlyclean-cgen +mostlyclean-host: maybe-mostlyclean-dejagnu +mostlyclean-host: maybe-mostlyclean-etc +mostlyclean-host: maybe-mostlyclean-fastjar +mostlyclean-host: maybe-mostlyclean-fixincludes +mostlyclean-host: maybe-mostlyclean-flex +mostlyclean-host: maybe-mostlyclean-gas +mostlyclean-host: maybe-mostlyclean-gcc +mostlyclean-host: maybe-mostlyclean-gmp +mostlyclean-host: maybe-mostlyclean-mpfr +mostlyclean-host: maybe-mostlyclean-mpc +mostlyclean-host: maybe-mostlyclean-ppl +mostlyclean-host: maybe-mostlyclean-cloog +mostlyclean-host: maybe-mostlyclean-libelf +mostlyclean-host: maybe-mostlyclean-gold +mostlyclean-host: maybe-mostlyclean-gprof +mostlyclean-host: maybe-mostlyclean-intl +mostlyclean-host: maybe-mostlyclean-tcl +mostlyclean-host: maybe-mostlyclean-itcl +mostlyclean-host: maybe-mostlyclean-ld +mostlyclean-host: maybe-mostlyclean-libcpp +mostlyclean-host: maybe-mostlyclean-libdecnumber +mostlyclean-host: maybe-mostlyclean-libgui +mostlyclean-host: maybe-mostlyclean-libiberty +mostlyclean-host: maybe-mostlyclean-libiconv +mostlyclean-host: maybe-mostlyclean-m4 +mostlyclean-host: maybe-mostlyclean-readline +mostlyclean-host: maybe-mostlyclean-sid +mostlyclean-host: maybe-mostlyclean-sim +mostlyclean-host: maybe-mostlyclean-texinfo +mostlyclean-host: maybe-mostlyclean-zlib +mostlyclean-host: maybe-mostlyclean-gdb +mostlyclean-host: maybe-mostlyclean-expect +mostlyclean-host: maybe-mostlyclean-guile +mostlyclean-host: maybe-mostlyclean-tk +mostlyclean-host: maybe-mostlyclean-libtermcap +mostlyclean-host: maybe-mostlyclean-utils +mostlyclean-host: maybe-mostlyclean-gnattools +mostlyclean-host: maybe-mostlyclean-lto-plugin + +.PHONY: mostlyclean-target + +mostlyclean-target: maybe-mostlyclean-target-libstdc++-v3 +mostlyclean-target: maybe-mostlyclean-target-libmudflap +mostlyclean-target: maybe-mostlyclean-target-libssp +mostlyclean-target: maybe-mostlyclean-target-newlib +mostlyclean-target: maybe-mostlyclean-target-libgcc +mostlyclean-target: maybe-mostlyclean-target-libquadmath +mostlyclean-target: maybe-mostlyclean-target-libgfortran +mostlyclean-target: maybe-mostlyclean-target-libobjc +mostlyclean-target: maybe-mostlyclean-target-libgo +mostlyclean-target: maybe-mostlyclean-target-libtermcap +mostlyclean-target: maybe-mostlyclean-target-winsup +mostlyclean-target: maybe-mostlyclean-target-libgloss +mostlyclean-target: maybe-mostlyclean-target-libffi +mostlyclean-target: maybe-mostlyclean-target-libjava +mostlyclean-target: maybe-mostlyclean-target-zlib +mostlyclean-target: maybe-mostlyclean-target-boehm-gc +mostlyclean-target: maybe-mostlyclean-target-rda +mostlyclean-target: maybe-mostlyclean-target-libada +mostlyclean-target: maybe-mostlyclean-target-libgomp + +.PHONY: do-clean +do-clean: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) clean-host \ + clean-target + + +.PHONY: clean-host + +clean-host: maybe-clean-bfd +clean-host: maybe-clean-opcodes +clean-host: maybe-clean-binutils +clean-host: maybe-clean-bison +clean-host: maybe-clean-cgen +clean-host: maybe-clean-dejagnu +clean-host: maybe-clean-etc +clean-host: maybe-clean-fastjar +clean-host: maybe-clean-fixincludes +clean-host: maybe-clean-flex +clean-host: maybe-clean-gas +clean-host: maybe-clean-gcc +clean-host: maybe-clean-gmp +clean-host: maybe-clean-mpfr +clean-host: maybe-clean-mpc +clean-host: maybe-clean-ppl +clean-host: maybe-clean-cloog +clean-host: maybe-clean-libelf +clean-host: maybe-clean-gold +clean-host: maybe-clean-gprof +clean-host: maybe-clean-intl +clean-host: maybe-clean-tcl +clean-host: maybe-clean-itcl +clean-host: maybe-clean-ld +clean-host: maybe-clean-libcpp +clean-host: maybe-clean-libdecnumber +clean-host: maybe-clean-libgui +clean-host: maybe-clean-libiberty +clean-host: maybe-clean-libiconv +clean-host: maybe-clean-m4 +clean-host: maybe-clean-readline +clean-host: maybe-clean-sid +clean-host: maybe-clean-sim +clean-host: maybe-clean-texinfo +clean-host: maybe-clean-zlib +clean-host: maybe-clean-gdb +clean-host: maybe-clean-expect +clean-host: maybe-clean-guile +clean-host: maybe-clean-tk +clean-host: maybe-clean-libtermcap +clean-host: maybe-clean-utils +clean-host: maybe-clean-gnattools +clean-host: maybe-clean-lto-plugin + +.PHONY: clean-target + +clean-target: maybe-clean-target-libstdc++-v3 +clean-target: maybe-clean-target-libmudflap +clean-target: maybe-clean-target-libssp +clean-target: maybe-clean-target-newlib +clean-target: maybe-clean-target-libgcc +clean-target: maybe-clean-target-libquadmath +clean-target: maybe-clean-target-libgfortran +clean-target: maybe-clean-target-libobjc +clean-target: maybe-clean-target-libgo +clean-target: maybe-clean-target-libtermcap +clean-target: maybe-clean-target-winsup +clean-target: maybe-clean-target-libgloss +clean-target: maybe-clean-target-libffi +clean-target: maybe-clean-target-libjava +clean-target: maybe-clean-target-zlib +clean-target: maybe-clean-target-boehm-gc +clean-target: maybe-clean-target-rda +clean-target: maybe-clean-target-libada +clean-target: maybe-clean-target-libgomp + +.PHONY: do-distclean +do-distclean: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) distclean-host \ + distclean-target + + +.PHONY: distclean-host + +distclean-host: maybe-distclean-bfd +distclean-host: maybe-distclean-opcodes +distclean-host: maybe-distclean-binutils +distclean-host: maybe-distclean-bison +distclean-host: maybe-distclean-cgen +distclean-host: maybe-distclean-dejagnu +distclean-host: maybe-distclean-etc +distclean-host: maybe-distclean-fastjar +distclean-host: maybe-distclean-fixincludes +distclean-host: maybe-distclean-flex +distclean-host: maybe-distclean-gas +distclean-host: maybe-distclean-gcc +distclean-host: maybe-distclean-gmp +distclean-host: maybe-distclean-mpfr +distclean-host: maybe-distclean-mpc +distclean-host: maybe-distclean-ppl +distclean-host: maybe-distclean-cloog +distclean-host: maybe-distclean-libelf +distclean-host: maybe-distclean-gold +distclean-host: maybe-distclean-gprof +distclean-host: maybe-distclean-intl +distclean-host: maybe-distclean-tcl +distclean-host: maybe-distclean-itcl +distclean-host: maybe-distclean-ld +distclean-host: maybe-distclean-libcpp +distclean-host: maybe-distclean-libdecnumber +distclean-host: maybe-distclean-libgui +distclean-host: maybe-distclean-libiberty +distclean-host: maybe-distclean-libiconv +distclean-host: maybe-distclean-m4 +distclean-host: maybe-distclean-readline +distclean-host: maybe-distclean-sid +distclean-host: maybe-distclean-sim +distclean-host: maybe-distclean-texinfo +distclean-host: maybe-distclean-zlib +distclean-host: maybe-distclean-gdb +distclean-host: maybe-distclean-expect +distclean-host: maybe-distclean-guile +distclean-host: maybe-distclean-tk +distclean-host: maybe-distclean-libtermcap +distclean-host: maybe-distclean-utils +distclean-host: maybe-distclean-gnattools +distclean-host: maybe-distclean-lto-plugin + +.PHONY: distclean-target + +distclean-target: maybe-distclean-target-libstdc++-v3 +distclean-target: maybe-distclean-target-libmudflap +distclean-target: maybe-distclean-target-libssp +distclean-target: maybe-distclean-target-newlib +distclean-target: maybe-distclean-target-libgcc +distclean-target: maybe-distclean-target-libquadmath +distclean-target: maybe-distclean-target-libgfortran +distclean-target: maybe-distclean-target-libobjc +distclean-target: maybe-distclean-target-libgo +distclean-target: maybe-distclean-target-libtermcap +distclean-target: maybe-distclean-target-winsup +distclean-target: maybe-distclean-target-libgloss +distclean-target: maybe-distclean-target-libffi +distclean-target: maybe-distclean-target-libjava +distclean-target: maybe-distclean-target-zlib +distclean-target: maybe-distclean-target-boehm-gc +distclean-target: maybe-distclean-target-rda +distclean-target: maybe-distclean-target-libada +distclean-target: maybe-distclean-target-libgomp + +.PHONY: do-maintainer-clean +do-maintainer-clean: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) maintainer-clean-host \ + maintainer-clean-target + + +.PHONY: maintainer-clean-host + +maintainer-clean-host: maybe-maintainer-clean-bfd +maintainer-clean-host: maybe-maintainer-clean-opcodes +maintainer-clean-host: maybe-maintainer-clean-binutils +maintainer-clean-host: maybe-maintainer-clean-bison +maintainer-clean-host: maybe-maintainer-clean-cgen +maintainer-clean-host: maybe-maintainer-clean-dejagnu +maintainer-clean-host: maybe-maintainer-clean-etc +maintainer-clean-host: maybe-maintainer-clean-fastjar +maintainer-clean-host: maybe-maintainer-clean-fixincludes +maintainer-clean-host: maybe-maintainer-clean-flex +maintainer-clean-host: maybe-maintainer-clean-gas +maintainer-clean-host: maybe-maintainer-clean-gcc +maintainer-clean-host: maybe-maintainer-clean-gmp +maintainer-clean-host: maybe-maintainer-clean-mpfr +maintainer-clean-host: maybe-maintainer-clean-mpc +maintainer-clean-host: maybe-maintainer-clean-ppl +maintainer-clean-host: maybe-maintainer-clean-cloog +maintainer-clean-host: maybe-maintainer-clean-libelf +maintainer-clean-host: maybe-maintainer-clean-gold +maintainer-clean-host: maybe-maintainer-clean-gprof +maintainer-clean-host: maybe-maintainer-clean-intl +maintainer-clean-host: maybe-maintainer-clean-tcl +maintainer-clean-host: maybe-maintainer-clean-itcl +maintainer-clean-host: maybe-maintainer-clean-ld +maintainer-clean-host: maybe-maintainer-clean-libcpp +maintainer-clean-host: maybe-maintainer-clean-libdecnumber +maintainer-clean-host: maybe-maintainer-clean-libgui +maintainer-clean-host: maybe-maintainer-clean-libiberty +maintainer-clean-host: maybe-maintainer-clean-libiconv +maintainer-clean-host: maybe-maintainer-clean-m4 +maintainer-clean-host: maybe-maintainer-clean-readline +maintainer-clean-host: maybe-maintainer-clean-sid +maintainer-clean-host: maybe-maintainer-clean-sim +maintainer-clean-host: maybe-maintainer-clean-texinfo +maintainer-clean-host: maybe-maintainer-clean-zlib +maintainer-clean-host: maybe-maintainer-clean-gdb +maintainer-clean-host: maybe-maintainer-clean-expect +maintainer-clean-host: maybe-maintainer-clean-guile +maintainer-clean-host: maybe-maintainer-clean-tk +maintainer-clean-host: maybe-maintainer-clean-libtermcap +maintainer-clean-host: maybe-maintainer-clean-utils +maintainer-clean-host: maybe-maintainer-clean-gnattools +maintainer-clean-host: maybe-maintainer-clean-lto-plugin + +.PHONY: maintainer-clean-target + +maintainer-clean-target: maybe-maintainer-clean-target-libstdc++-v3 +maintainer-clean-target: maybe-maintainer-clean-target-libmudflap +maintainer-clean-target: maybe-maintainer-clean-target-libssp +maintainer-clean-target: maybe-maintainer-clean-target-newlib +maintainer-clean-target: maybe-maintainer-clean-target-libgcc +maintainer-clean-target: maybe-maintainer-clean-target-libquadmath +maintainer-clean-target: maybe-maintainer-clean-target-libgfortran +maintainer-clean-target: maybe-maintainer-clean-target-libobjc +maintainer-clean-target: maybe-maintainer-clean-target-libgo +maintainer-clean-target: maybe-maintainer-clean-target-libtermcap +maintainer-clean-target: maybe-maintainer-clean-target-winsup +maintainer-clean-target: maybe-maintainer-clean-target-libgloss +maintainer-clean-target: maybe-maintainer-clean-target-libffi +maintainer-clean-target: maybe-maintainer-clean-target-libjava +maintainer-clean-target: maybe-maintainer-clean-target-zlib +maintainer-clean-target: maybe-maintainer-clean-target-boehm-gc +maintainer-clean-target: maybe-maintainer-clean-target-rda +maintainer-clean-target: maybe-maintainer-clean-target-libada +maintainer-clean-target: maybe-maintainer-clean-target-libgomp + + +# Here are the targets which correspond to the do-X targets. + +.PHONY: info installcheck dvi pdf html +.PHONY: install-info install-pdf install-html +.PHONY: clean distclean mostlyclean maintainer-clean realclean +.PHONY: local-clean local-distclean local-maintainer-clean +info: do-info +installcheck: do-installcheck +dvi: do-dvi +pdf: do-pdf +html: do-html + +# Make sure makeinfo is built before we do a `make info', if we're +# in fact building texinfo. +do-info: maybe-all-texinfo + +install-info: do-install-info dir.info + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + if [ -f dir.info ] ; then \ + $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \ + else true ; fi + +install-pdf: do-install-pdf + +install-html: do-install-html + +local-clean: + -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log + +local-distclean: + -rm -f Makefile config.status config.cache mh-frag mt-frag + -rm -f maybedep.tmp serdep.tmp + -if [ "$(TARGET_SUBDIR)" != "." ]; then \ + rm -rf $(TARGET_SUBDIR); \ + else true; fi + -rm -rf $(BUILD_SUBDIR) + -if [ "$(HOST_SUBDIR)" != "." ]; then \ + rm -rf $(HOST_SUBDIR); \ + else true; fi + -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile + -rm -f texinfo/doc/Makefile texinfo/po/POTFILES + -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null + -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null + -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null + -find . -name config.cache -exec rm -f {} \; \; 2>/dev/null + +local-maintainer-clean: + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +clean: do-clean local-clean +mostlyclean: do-mostlyclean local-clean +distclean: do-distclean local-clean local-distclean +maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean +maintainer-clean: local-distclean +realclean: maintainer-clean + +# Check target. + +.PHONY: check do-check +check: do-check + +# Only include modules actually being configured and built. +.PHONY: check-host +check-host: \ + maybe-check-bfd \ + maybe-check-opcodes \ + maybe-check-binutils \ + maybe-check-bison \ + maybe-check-cgen \ + maybe-check-dejagnu \ + maybe-check-etc \ + maybe-check-fastjar \ + maybe-check-fixincludes \ + maybe-check-flex \ + maybe-check-gas \ + maybe-check-gcc \ + maybe-check-gmp \ + maybe-check-mpfr \ + maybe-check-mpc \ + maybe-check-ppl \ + maybe-check-cloog \ + maybe-check-libelf \ + maybe-check-gold \ + maybe-check-gprof \ + maybe-check-intl \ + maybe-check-tcl \ + maybe-check-itcl \ + maybe-check-ld \ + maybe-check-libcpp \ + maybe-check-libdecnumber \ + maybe-check-libgui \ + maybe-check-libiberty \ + maybe-check-libiconv \ + maybe-check-m4 \ + maybe-check-readline \ + maybe-check-sid \ + maybe-check-sim \ + maybe-check-texinfo \ + maybe-check-zlib \ + maybe-check-gdb \ + maybe-check-expect \ + maybe-check-guile \ + maybe-check-tk \ + maybe-check-libtermcap \ + maybe-check-utils \ + maybe-check-gnattools \ + maybe-check-lto-plugin + +.PHONY: check-target +check-target: \ + maybe-check-target-libstdc++-v3 \ + maybe-check-target-libmudflap \ + maybe-check-target-libssp \ + maybe-check-target-newlib \ + maybe-check-target-libgcc \ + maybe-check-target-libquadmath \ + maybe-check-target-libgfortran \ + maybe-check-target-libobjc \ + maybe-check-target-libgo \ + maybe-check-target-libtermcap \ + maybe-check-target-winsup \ + maybe-check-target-libgloss \ + maybe-check-target-libffi \ + maybe-check-target-libjava \ + maybe-check-target-zlib \ + maybe-check-target-boehm-gc \ + maybe-check-target-rda \ + maybe-check-target-libada \ + maybe-check-target-libgomp + +do-check: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) check-host check-target + +# Automated reporting of test results. + +warning.log: build.log + $(srcdir)/contrib/warn_summary build.log > $@ + +mail-report.log: + if test x'$(BOOT_CFLAGS)' != x''; then \ + BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ + fi; \ + $(srcdir)/contrib/test_summary -t >$@ + chmod +x $@ + echo If you really want to send e-mail, run ./$@ now + +mail-report-with-warnings.log: warning.log + if test x'$(BOOT_CFLAGS)' != x''; then \ + BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ + fi; \ + $(srcdir)/contrib/test_summary -t -i warning.log >$@ + chmod +x $@ + echo If you really want to send e-mail, run ./$@ now + +# Installation targets. + +.PHONY: install uninstall +install: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-host install-target + +.PHONY: install-host-nogcc +install-host-nogcc: \ + maybe-install-bfd \ + maybe-install-opcodes \ + maybe-install-binutils \ + maybe-install-bison \ + maybe-install-cgen \ + maybe-install-dejagnu \ + maybe-install-etc \ + maybe-install-fastjar \ + maybe-install-fixincludes \ + maybe-install-flex \ + maybe-install-gas \ + maybe-install-gmp \ + maybe-install-mpfr \ + maybe-install-mpc \ + maybe-install-ppl \ + maybe-install-cloog \ + maybe-install-libelf \ + maybe-install-gold \ + maybe-install-gprof \ + maybe-install-intl \ + maybe-install-tcl \ + maybe-install-itcl \ + maybe-install-ld \ + maybe-install-libcpp \ + maybe-install-libdecnumber \ + maybe-install-libgui \ + maybe-install-libiberty \ + maybe-install-libiconv \ + maybe-install-m4 \ + maybe-install-readline \ + maybe-install-sid \ + maybe-install-sim \ + maybe-install-texinfo \ + maybe-install-zlib \ + maybe-install-gdb \ + maybe-install-expect \ + maybe-install-guile \ + maybe-install-tk \ + maybe-install-libtermcap \ + maybe-install-utils \ + maybe-install-gnattools \ + maybe-install-lto-plugin + +.PHONY: install-host +install-host: \ + maybe-install-bfd \ + maybe-install-opcodes \ + maybe-install-binutils \ + maybe-install-bison \ + maybe-install-cgen \ + maybe-install-dejagnu \ + maybe-install-etc \ + maybe-install-fastjar \ + maybe-install-fixincludes \ + maybe-install-flex \ + maybe-install-gas \ + maybe-install-gcc \ + maybe-install-gmp \ + maybe-install-mpfr \ + maybe-install-mpc \ + maybe-install-ppl \ + maybe-install-cloog \ + maybe-install-libelf \ + maybe-install-gold \ + maybe-install-gprof \ + maybe-install-intl \ + maybe-install-tcl \ + maybe-install-itcl \ + maybe-install-ld \ + maybe-install-libcpp \ + maybe-install-libdecnumber \ + maybe-install-libgui \ + maybe-install-libiberty \ + maybe-install-libiconv \ + maybe-install-m4 \ + maybe-install-readline \ + maybe-install-sid \ + maybe-install-sim \ + maybe-install-texinfo \ + maybe-install-zlib \ + maybe-install-gdb \ + maybe-install-expect \ + maybe-install-guile \ + maybe-install-tk \ + maybe-install-libtermcap \ + maybe-install-utils \ + maybe-install-gnattools \ + maybe-install-lto-plugin + +.PHONY: install-target +install-target: \ + maybe-install-target-libstdc++-v3 \ + maybe-install-target-libmudflap \ + maybe-install-target-libssp \ + maybe-install-target-newlib \ + maybe-install-target-libgcc \ + maybe-install-target-libquadmath \ + maybe-install-target-libgfortran \ + maybe-install-target-libobjc \ + maybe-install-target-libgo \ + maybe-install-target-libtermcap \ + maybe-install-target-winsup \ + maybe-install-target-libgloss \ + maybe-install-target-libffi \ + maybe-install-target-libjava \ + maybe-install-target-zlib \ + maybe-install-target-boehm-gc \ + maybe-install-target-rda \ + maybe-install-target-libada \ + maybe-install-target-libgomp + +uninstall: + @echo "the uninstall target is not supported in this tree" + +.PHONY: install.all +install.all: install-no-fixedincludes + @if [ -f ./gcc/Makefile ] ; then \ + r=`${PWD_COMMAND}` ; export r ; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd ./gcc && \ + $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \ + else \ + true ; \ + fi + +# install-no-fixedincludes is used because Cygnus can not distribute +# the fixed header files. +.PHONY: install-no-fixedincludes +install-no-fixedincludes: installdirs install-host-nogcc \ + install-target gcc-no-fixedincludes + +.PHONY: install-strip +install-strip: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-strip-host install-strip-target + +.PHONY: install-strip-host +install-strip-host: \ + maybe-install-strip-bfd \ + maybe-install-strip-opcodes \ + maybe-install-strip-binutils \ + maybe-install-strip-bison \ + maybe-install-strip-cgen \ + maybe-install-strip-dejagnu \ + maybe-install-strip-etc \ + maybe-install-strip-fastjar \ + maybe-install-strip-fixincludes \ + maybe-install-strip-flex \ + maybe-install-strip-gas \ + maybe-install-strip-gcc \ + maybe-install-strip-gmp \ + maybe-install-strip-mpfr \ + maybe-install-strip-mpc \ + maybe-install-strip-ppl \ + maybe-install-strip-cloog \ + maybe-install-strip-libelf \ + maybe-install-strip-gold \ + maybe-install-strip-gprof \ + maybe-install-strip-intl \ + maybe-install-strip-tcl \ + maybe-install-strip-itcl \ + maybe-install-strip-ld \ + maybe-install-strip-libcpp \ + maybe-install-strip-libdecnumber \ + maybe-install-strip-libgui \ + maybe-install-strip-libiberty \ + maybe-install-strip-libiconv \ + maybe-install-strip-m4 \ + maybe-install-strip-readline \ + maybe-install-strip-sid \ + maybe-install-strip-sim \ + maybe-install-strip-texinfo \ + maybe-install-strip-zlib \ + maybe-install-strip-gdb \ + maybe-install-strip-expect \ + maybe-install-strip-guile \ + maybe-install-strip-tk \ + maybe-install-strip-libtermcap \ + maybe-install-strip-utils \ + maybe-install-strip-gnattools \ + maybe-install-strip-lto-plugin + +.PHONY: install-strip-target +install-strip-target: \ + maybe-install-strip-target-libstdc++-v3 \ + maybe-install-strip-target-libmudflap \ + maybe-install-strip-target-libssp \ + maybe-install-strip-target-newlib \ + maybe-install-strip-target-libgcc \ + maybe-install-strip-target-libquadmath \ + maybe-install-strip-target-libgfortran \ + maybe-install-strip-target-libobjc \ + maybe-install-strip-target-libgo \ + maybe-install-strip-target-libtermcap \ + maybe-install-strip-target-winsup \ + maybe-install-strip-target-libgloss \ + maybe-install-strip-target-libffi \ + maybe-install-strip-target-libjava \ + maybe-install-strip-target-zlib \ + maybe-install-strip-target-boehm-gc \ + maybe-install-strip-target-rda \ + maybe-install-strip-target-libada \ + maybe-install-strip-target-libgomp + + +### other supporting targets + +MAKEDIRS= \ + $(DESTDIR)$(prefix) \ + $(DESTDIR)$(exec_prefix) +.PHONY: installdirs +installdirs: mkinstalldirs + $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS) + +dir.info: do-install-info + if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \ + $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \ + mv -f dir.info.new dir.info ; \ + else true ; \ + fi + +dist: + @echo "Building a full distribution of this tree isn't done" + @echo "via 'make dist'. Check out the etc/ subdirectory" + +etags tags: TAGS + +# Right now this just builds TAGS in each subdirectory. emacs19 has the +# ability to use several tags files at once, so there is probably no need +# to combine them into one big TAGS file (like CVS 1.3 does). We could +# (if we felt like it) have this Makefile write a piece of elisp which +# the user could load to tell emacs19 where all the TAGS files we just +# built are. +TAGS: do-TAGS + +# ------------------------------------ +# Macros for configure and all targets +# ------------------------------------ + + + + + +# -------------------------------------- +# Modules which run on the build machine +# -------------------------------------- + + +.PHONY: configure-build-libiberty maybe-configure-build-libiberty +maybe-configure-build-libiberty: +@if gcc-bootstrap +configure-build-libiberty: stage_current +@endif gcc-bootstrap +@if build-libiberty +maybe-configure-build-libiberty: configure-build-libiberty +configure-build-libiberty: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(BUILD_SUBDIR)/libiberty/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/libiberty ; \ + $(BUILD_EXPORTS) \ + echo Configuring in $(BUILD_SUBDIR)/libiberty; \ + cd "$(BUILD_SUBDIR)/libiberty" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(BUILD_SUBDIR)/libiberty/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif build-libiberty + + + + + +.PHONY: all-build-libiberty maybe-all-build-libiberty +maybe-all-build-libiberty: +@if gcc-bootstrap +all-build-libiberty: stage_current +@endif gcc-bootstrap +@if build-libiberty +TARGET-build-libiberty=all +maybe-all-build-libiberty: all-build-libiberty +all-build-libiberty: configure-build-libiberty + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \ + $(TARGET-build-libiberty)) +@endif build-libiberty + + + + + +.PHONY: configure-build-bison maybe-configure-build-bison +maybe-configure-build-bison: +@if gcc-bootstrap +configure-build-bison: stage_current +@endif gcc-bootstrap +@if build-bison +maybe-configure-build-bison: configure-build-bison +configure-build-bison: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(BUILD_SUBDIR)/bison/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/bison ; \ + $(BUILD_EXPORTS) \ + echo Configuring in $(BUILD_SUBDIR)/bison; \ + cd "$(BUILD_SUBDIR)/bison" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(BUILD_SUBDIR)/bison/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/bison"; \ + libsrcdir="$$s/bison"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif build-bison + + + + + +.PHONY: all-build-bison maybe-all-build-bison +maybe-all-build-bison: +@if gcc-bootstrap +all-build-bison: stage_current +@endif gcc-bootstrap +@if build-bison +TARGET-build-bison=all +maybe-all-build-bison: all-build-bison +all-build-bison: configure-build-bison + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \ + $(TARGET-build-bison)) +@endif build-bison + + + + + +.PHONY: configure-build-flex maybe-configure-build-flex +maybe-configure-build-flex: +@if gcc-bootstrap +configure-build-flex: stage_current +@endif gcc-bootstrap +@if build-flex +maybe-configure-build-flex: configure-build-flex +configure-build-flex: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(BUILD_SUBDIR)/flex/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/flex ; \ + $(BUILD_EXPORTS) \ + echo Configuring in $(BUILD_SUBDIR)/flex; \ + cd "$(BUILD_SUBDIR)/flex" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(BUILD_SUBDIR)/flex/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/flex"; \ + libsrcdir="$$s/flex"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif build-flex + + + + + +.PHONY: all-build-flex maybe-all-build-flex +maybe-all-build-flex: +@if gcc-bootstrap +all-build-flex: stage_current +@endif gcc-bootstrap +@if build-flex +TARGET-build-flex=all +maybe-all-build-flex: all-build-flex +all-build-flex: configure-build-flex + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \ + $(TARGET-build-flex)) +@endif build-flex + + + + + +.PHONY: configure-build-m4 maybe-configure-build-m4 +maybe-configure-build-m4: +@if gcc-bootstrap +configure-build-m4: stage_current +@endif gcc-bootstrap +@if build-m4 +maybe-configure-build-m4: configure-build-m4 +configure-build-m4: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(BUILD_SUBDIR)/m4/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/m4 ; \ + $(BUILD_EXPORTS) \ + echo Configuring in $(BUILD_SUBDIR)/m4; \ + cd "$(BUILD_SUBDIR)/m4" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(BUILD_SUBDIR)/m4/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/m4"; \ + libsrcdir="$$s/m4"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif build-m4 + + + + + +.PHONY: all-build-m4 maybe-all-build-m4 +maybe-all-build-m4: +@if gcc-bootstrap +all-build-m4: stage_current +@endif gcc-bootstrap +@if build-m4 +TARGET-build-m4=all +maybe-all-build-m4: all-build-m4 +all-build-m4: configure-build-m4 + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \ + $(TARGET-build-m4)) +@endif build-m4 + + + + + +.PHONY: configure-build-texinfo maybe-configure-build-texinfo +maybe-configure-build-texinfo: +@if gcc-bootstrap +configure-build-texinfo: stage_current +@endif gcc-bootstrap +@if build-texinfo +maybe-configure-build-texinfo: configure-build-texinfo +configure-build-texinfo: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(BUILD_SUBDIR)/texinfo/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/texinfo ; \ + $(BUILD_EXPORTS) \ + echo Configuring in $(BUILD_SUBDIR)/texinfo; \ + cd "$(BUILD_SUBDIR)/texinfo" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(BUILD_SUBDIR)/texinfo/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/texinfo"; \ + libsrcdir="$$s/texinfo"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif build-texinfo + + + + + +.PHONY: all-build-texinfo maybe-all-build-texinfo +maybe-all-build-texinfo: +@if gcc-bootstrap +all-build-texinfo: stage_current +@endif gcc-bootstrap +@if build-texinfo +TARGET-build-texinfo=all +maybe-all-build-texinfo: all-build-texinfo +all-build-texinfo: configure-build-texinfo + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \ + $(TARGET-build-texinfo)) +@endif build-texinfo + + + + + +.PHONY: configure-build-fixincludes maybe-configure-build-fixincludes +maybe-configure-build-fixincludes: +@if gcc-bootstrap +configure-build-fixincludes: stage_current +@endif gcc-bootstrap +@if build-fixincludes +maybe-configure-build-fixincludes: configure-build-fixincludes +configure-build-fixincludes: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(BUILD_SUBDIR)/fixincludes/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/fixincludes ; \ + $(BUILD_EXPORTS) \ + echo Configuring in $(BUILD_SUBDIR)/fixincludes; \ + cd "$(BUILD_SUBDIR)/fixincludes" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(BUILD_SUBDIR)/fixincludes/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/fixincludes"; \ + libsrcdir="$$s/fixincludes"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif build-fixincludes + + + + + +.PHONY: all-build-fixincludes maybe-all-build-fixincludes +maybe-all-build-fixincludes: +@if gcc-bootstrap +all-build-fixincludes: stage_current +@endif gcc-bootstrap +@if build-fixincludes +TARGET-build-fixincludes=all +maybe-all-build-fixincludes: all-build-fixincludes +all-build-fixincludes: configure-build-fixincludes + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \ + $(TARGET-build-fixincludes)) +@endif build-fixincludes + + + + + +# -------------------------------------- +# Modules which run on the host machine +# -------------------------------------- + + +.PHONY: configure-bfd maybe-configure-bfd +maybe-configure-bfd: +@if gcc-bootstrap +configure-bfd: stage_current +@endif gcc-bootstrap +@if bfd +maybe-configure-bfd: configure-bfd +configure-bfd: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/bfd; \ + cd "$(HOST_SUBDIR)/bfd" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/bfd"; \ + libsrcdir="$$s/bfd"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif bfd + + + +.PHONY: configure-stage1-bfd maybe-configure-stage1-bfd +maybe-configure-stage1-bfd: +@if bfd-bootstrap +maybe-configure-stage1-bfd: configure-stage1-bfd +configure-stage1-bfd: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/bfd ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/bfd"; \ + libsrcdir="$$s/bfd"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) +@endif bfd-bootstrap + +.PHONY: configure-stage2-bfd maybe-configure-stage2-bfd +maybe-configure-stage2-bfd: +@if bfd-bootstrap +maybe-configure-stage2-bfd: configure-stage2-bfd +configure-stage2-bfd: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/bfd ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/bfd"; \ + libsrcdir="$$s/bfd"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) +@endif bfd-bootstrap + +.PHONY: configure-stage3-bfd maybe-configure-stage3-bfd +maybe-configure-stage3-bfd: +@if bfd-bootstrap +maybe-configure-stage3-bfd: configure-stage3-bfd +configure-stage3-bfd: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/bfd ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/bfd"; \ + libsrcdir="$$s/bfd"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) +@endif bfd-bootstrap + +.PHONY: configure-stage4-bfd maybe-configure-stage4-bfd +maybe-configure-stage4-bfd: +@if bfd-bootstrap +maybe-configure-stage4-bfd: configure-stage4-bfd +configure-stage4-bfd: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/bfd ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/bfd"; \ + libsrcdir="$$s/bfd"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) +@endif bfd-bootstrap + +.PHONY: configure-stageprofile-bfd maybe-configure-stageprofile-bfd +maybe-configure-stageprofile-bfd: +@if bfd-bootstrap +maybe-configure-stageprofile-bfd: configure-stageprofile-bfd +configure-stageprofile-bfd: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/bfd ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/bfd"; \ + libsrcdir="$$s/bfd"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) +@endif bfd-bootstrap + +.PHONY: configure-stagefeedback-bfd maybe-configure-stagefeedback-bfd +maybe-configure-stagefeedback-bfd: +@if bfd-bootstrap +maybe-configure-stagefeedback-bfd: configure-stagefeedback-bfd +configure-stagefeedback-bfd: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/bfd ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/bfd"; \ + libsrcdir="$$s/bfd"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) +@endif bfd-bootstrap + + + + + +.PHONY: all-bfd maybe-all-bfd +maybe-all-bfd: +@if gcc-bootstrap +all-bfd: stage_current +@endif gcc-bootstrap +@if bfd +TARGET-bfd=all +maybe-all-bfd: all-bfd +all-bfd: configure-bfd + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-bfd)) +@endif bfd + + + +.PHONY: all-stage1-bfd maybe-all-stage1-bfd +.PHONY: clean-stage1-bfd maybe-clean-stage1-bfd +maybe-all-stage1-bfd: +maybe-clean-stage1-bfd: +@if bfd-bootstrap +maybe-all-stage1-bfd: all-stage1-bfd +all-stage1: all-stage1-bfd +TARGET-stage1-bfd = $(TARGET-bfd) +all-stage1-bfd: configure-stage1-bfd + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-bfd) + +maybe-clean-stage1-bfd: clean-stage1-bfd +clean-stage1: clean-stage1-bfd +clean-stage1-bfd: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-bfd/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif bfd-bootstrap + + +.PHONY: all-stage2-bfd maybe-all-stage2-bfd +.PHONY: clean-stage2-bfd maybe-clean-stage2-bfd +maybe-all-stage2-bfd: +maybe-clean-stage2-bfd: +@if bfd-bootstrap +maybe-all-stage2-bfd: all-stage2-bfd +all-stage2: all-stage2-bfd +TARGET-stage2-bfd = $(TARGET-bfd) +all-stage2-bfd: configure-stage2-bfd + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-bfd) + +maybe-clean-stage2-bfd: clean-stage2-bfd +clean-stage2: clean-stage2-bfd +clean-stage2-bfd: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-bfd/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif bfd-bootstrap + + +.PHONY: all-stage3-bfd maybe-all-stage3-bfd +.PHONY: clean-stage3-bfd maybe-clean-stage3-bfd +maybe-all-stage3-bfd: +maybe-clean-stage3-bfd: +@if bfd-bootstrap +maybe-all-stage3-bfd: all-stage3-bfd +all-stage3: all-stage3-bfd +TARGET-stage3-bfd = $(TARGET-bfd) +all-stage3-bfd: configure-stage3-bfd + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-bfd) + +maybe-clean-stage3-bfd: clean-stage3-bfd +clean-stage3: clean-stage3-bfd +clean-stage3-bfd: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-bfd/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif bfd-bootstrap + + +.PHONY: all-stage4-bfd maybe-all-stage4-bfd +.PHONY: clean-stage4-bfd maybe-clean-stage4-bfd +maybe-all-stage4-bfd: +maybe-clean-stage4-bfd: +@if bfd-bootstrap +maybe-all-stage4-bfd: all-stage4-bfd +all-stage4: all-stage4-bfd +TARGET-stage4-bfd = $(TARGET-bfd) +all-stage4-bfd: configure-stage4-bfd + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-bfd) + +maybe-clean-stage4-bfd: clean-stage4-bfd +clean-stage4: clean-stage4-bfd +clean-stage4-bfd: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-bfd/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif bfd-bootstrap + + +.PHONY: all-stageprofile-bfd maybe-all-stageprofile-bfd +.PHONY: clean-stageprofile-bfd maybe-clean-stageprofile-bfd +maybe-all-stageprofile-bfd: +maybe-clean-stageprofile-bfd: +@if bfd-bootstrap +maybe-all-stageprofile-bfd: all-stageprofile-bfd +all-stageprofile: all-stageprofile-bfd +TARGET-stageprofile-bfd = $(TARGET-bfd) +all-stageprofile-bfd: configure-stageprofile-bfd + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-bfd) + +maybe-clean-stageprofile-bfd: clean-stageprofile-bfd +clean-stageprofile: clean-stageprofile-bfd +clean-stageprofile-bfd: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-bfd/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif bfd-bootstrap + + +.PHONY: all-stagefeedback-bfd maybe-all-stagefeedback-bfd +.PHONY: clean-stagefeedback-bfd maybe-clean-stagefeedback-bfd +maybe-all-stagefeedback-bfd: +maybe-clean-stagefeedback-bfd: +@if bfd-bootstrap +maybe-all-stagefeedback-bfd: all-stagefeedback-bfd +all-stagefeedback: all-stagefeedback-bfd +TARGET-stagefeedback-bfd = $(TARGET-bfd) +all-stagefeedback-bfd: configure-stagefeedback-bfd + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-bfd) + +maybe-clean-stagefeedback-bfd: clean-stagefeedback-bfd +clean-stagefeedback: clean-stagefeedback-bfd +clean-stagefeedback-bfd: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-bfd/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif bfd-bootstrap + + + + + +.PHONY: check-bfd maybe-check-bfd +maybe-check-bfd: +@if bfd +maybe-check-bfd: check-bfd + +check-bfd: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif bfd + +.PHONY: install-bfd maybe-install-bfd +maybe-install-bfd: +@if bfd +maybe-install-bfd: install-bfd + +install-bfd: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif bfd + +.PHONY: install-strip-bfd maybe-install-strip-bfd +maybe-install-strip-bfd: +@if bfd +maybe-install-strip-bfd: install-strip-bfd + +install-strip-bfd: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif bfd + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-bfd info-bfd +maybe-info-bfd: +@if bfd +maybe-info-bfd: info-bfd + +info-bfd: \ + configure-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif bfd + +.PHONY: maybe-dvi-bfd dvi-bfd +maybe-dvi-bfd: +@if bfd +maybe-dvi-bfd: dvi-bfd + +dvi-bfd: \ + configure-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif bfd + +.PHONY: maybe-pdf-bfd pdf-bfd +maybe-pdf-bfd: +@if bfd +maybe-pdf-bfd: pdf-bfd + +pdf-bfd: \ + configure-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif bfd + +.PHONY: maybe-html-bfd html-bfd +maybe-html-bfd: +@if bfd +maybe-html-bfd: html-bfd + +html-bfd: \ + configure-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif bfd + +.PHONY: maybe-TAGS-bfd TAGS-bfd +maybe-TAGS-bfd: +@if bfd +maybe-TAGS-bfd: TAGS-bfd + +TAGS-bfd: \ + configure-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif bfd + +.PHONY: maybe-install-info-bfd install-info-bfd +maybe-install-info-bfd: +@if bfd +maybe-install-info-bfd: install-info-bfd + +install-info-bfd: \ + configure-bfd \ + info-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif bfd + +.PHONY: maybe-install-pdf-bfd install-pdf-bfd +maybe-install-pdf-bfd: +@if bfd +maybe-install-pdf-bfd: install-pdf-bfd + +install-pdf-bfd: \ + configure-bfd \ + pdf-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif bfd + +.PHONY: maybe-install-html-bfd install-html-bfd +maybe-install-html-bfd: +@if bfd +maybe-install-html-bfd: install-html-bfd + +install-html-bfd: \ + configure-bfd \ + html-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif bfd + +.PHONY: maybe-installcheck-bfd installcheck-bfd +maybe-installcheck-bfd: +@if bfd +maybe-installcheck-bfd: installcheck-bfd + +installcheck-bfd: \ + configure-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif bfd + +.PHONY: maybe-mostlyclean-bfd mostlyclean-bfd +maybe-mostlyclean-bfd: +@if bfd +maybe-mostlyclean-bfd: mostlyclean-bfd + +mostlyclean-bfd: + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif bfd + +.PHONY: maybe-clean-bfd clean-bfd +maybe-clean-bfd: +@if bfd +maybe-clean-bfd: clean-bfd + +clean-bfd: + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif bfd + +.PHONY: maybe-distclean-bfd distclean-bfd +maybe-distclean-bfd: +@if bfd +maybe-distclean-bfd: distclean-bfd + +distclean-bfd: + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif bfd + +.PHONY: maybe-maintainer-clean-bfd maintainer-clean-bfd +maybe-maintainer-clean-bfd: +@if bfd +maybe-maintainer-clean-bfd: maintainer-clean-bfd + +maintainer-clean-bfd: + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif bfd + + + +.PHONY: configure-opcodes maybe-configure-opcodes +maybe-configure-opcodes: +@if gcc-bootstrap +configure-opcodes: stage_current +@endif gcc-bootstrap +@if opcodes +maybe-configure-opcodes: configure-opcodes +configure-opcodes: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/opcodes; \ + cd "$(HOST_SUBDIR)/opcodes" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/opcodes"; \ + libsrcdir="$$s/opcodes"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif opcodes + + + +.PHONY: configure-stage1-opcodes maybe-configure-stage1-opcodes +maybe-configure-stage1-opcodes: +@if opcodes-bootstrap +maybe-configure-stage1-opcodes: configure-stage1-opcodes +configure-stage1-opcodes: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/opcodes ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/opcodes"; \ + libsrcdir="$$s/opcodes"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) +@endif opcodes-bootstrap + +.PHONY: configure-stage2-opcodes maybe-configure-stage2-opcodes +maybe-configure-stage2-opcodes: +@if opcodes-bootstrap +maybe-configure-stage2-opcodes: configure-stage2-opcodes +configure-stage2-opcodes: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/opcodes ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/opcodes"; \ + libsrcdir="$$s/opcodes"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) +@endif opcodes-bootstrap + +.PHONY: configure-stage3-opcodes maybe-configure-stage3-opcodes +maybe-configure-stage3-opcodes: +@if opcodes-bootstrap +maybe-configure-stage3-opcodes: configure-stage3-opcodes +configure-stage3-opcodes: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/opcodes ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/opcodes"; \ + libsrcdir="$$s/opcodes"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) +@endif opcodes-bootstrap + +.PHONY: configure-stage4-opcodes maybe-configure-stage4-opcodes +maybe-configure-stage4-opcodes: +@if opcodes-bootstrap +maybe-configure-stage4-opcodes: configure-stage4-opcodes +configure-stage4-opcodes: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/opcodes ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/opcodes"; \ + libsrcdir="$$s/opcodes"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) +@endif opcodes-bootstrap + +.PHONY: configure-stageprofile-opcodes maybe-configure-stageprofile-opcodes +maybe-configure-stageprofile-opcodes: +@if opcodes-bootstrap +maybe-configure-stageprofile-opcodes: configure-stageprofile-opcodes +configure-stageprofile-opcodes: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/opcodes ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/opcodes"; \ + libsrcdir="$$s/opcodes"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) +@endif opcodes-bootstrap + +.PHONY: configure-stagefeedback-opcodes maybe-configure-stagefeedback-opcodes +maybe-configure-stagefeedback-opcodes: +@if opcodes-bootstrap +maybe-configure-stagefeedback-opcodes: configure-stagefeedback-opcodes +configure-stagefeedback-opcodes: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/opcodes ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/opcodes"; \ + libsrcdir="$$s/opcodes"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) +@endif opcodes-bootstrap + + + + + +.PHONY: all-opcodes maybe-all-opcodes +maybe-all-opcodes: +@if gcc-bootstrap +all-opcodes: stage_current +@endif gcc-bootstrap +@if opcodes +TARGET-opcodes=all +maybe-all-opcodes: all-opcodes +all-opcodes: configure-opcodes + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-opcodes)) +@endif opcodes + + + +.PHONY: all-stage1-opcodes maybe-all-stage1-opcodes +.PHONY: clean-stage1-opcodes maybe-clean-stage1-opcodes +maybe-all-stage1-opcodes: +maybe-clean-stage1-opcodes: +@if opcodes-bootstrap +maybe-all-stage1-opcodes: all-stage1-opcodes +all-stage1: all-stage1-opcodes +TARGET-stage1-opcodes = $(TARGET-opcodes) +all-stage1-opcodes: configure-stage1-opcodes + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-opcodes) + +maybe-clean-stage1-opcodes: clean-stage1-opcodes +clean-stage1: clean-stage1-opcodes +clean-stage1-opcodes: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-opcodes/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif opcodes-bootstrap + + +.PHONY: all-stage2-opcodes maybe-all-stage2-opcodes +.PHONY: clean-stage2-opcodes maybe-clean-stage2-opcodes +maybe-all-stage2-opcodes: +maybe-clean-stage2-opcodes: +@if opcodes-bootstrap +maybe-all-stage2-opcodes: all-stage2-opcodes +all-stage2: all-stage2-opcodes +TARGET-stage2-opcodes = $(TARGET-opcodes) +all-stage2-opcodes: configure-stage2-opcodes + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-opcodes) + +maybe-clean-stage2-opcodes: clean-stage2-opcodes +clean-stage2: clean-stage2-opcodes +clean-stage2-opcodes: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-opcodes/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif opcodes-bootstrap + + +.PHONY: all-stage3-opcodes maybe-all-stage3-opcodes +.PHONY: clean-stage3-opcodes maybe-clean-stage3-opcodes +maybe-all-stage3-opcodes: +maybe-clean-stage3-opcodes: +@if opcodes-bootstrap +maybe-all-stage3-opcodes: all-stage3-opcodes +all-stage3: all-stage3-opcodes +TARGET-stage3-opcodes = $(TARGET-opcodes) +all-stage3-opcodes: configure-stage3-opcodes + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-opcodes) + +maybe-clean-stage3-opcodes: clean-stage3-opcodes +clean-stage3: clean-stage3-opcodes +clean-stage3-opcodes: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-opcodes/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif opcodes-bootstrap + + +.PHONY: all-stage4-opcodes maybe-all-stage4-opcodes +.PHONY: clean-stage4-opcodes maybe-clean-stage4-opcodes +maybe-all-stage4-opcodes: +maybe-clean-stage4-opcodes: +@if opcodes-bootstrap +maybe-all-stage4-opcodes: all-stage4-opcodes +all-stage4: all-stage4-opcodes +TARGET-stage4-opcodes = $(TARGET-opcodes) +all-stage4-opcodes: configure-stage4-opcodes + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-opcodes) + +maybe-clean-stage4-opcodes: clean-stage4-opcodes +clean-stage4: clean-stage4-opcodes +clean-stage4-opcodes: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-opcodes/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif opcodes-bootstrap + + +.PHONY: all-stageprofile-opcodes maybe-all-stageprofile-opcodes +.PHONY: clean-stageprofile-opcodes maybe-clean-stageprofile-opcodes +maybe-all-stageprofile-opcodes: +maybe-clean-stageprofile-opcodes: +@if opcodes-bootstrap +maybe-all-stageprofile-opcodes: all-stageprofile-opcodes +all-stageprofile: all-stageprofile-opcodes +TARGET-stageprofile-opcodes = $(TARGET-opcodes) +all-stageprofile-opcodes: configure-stageprofile-opcodes + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-opcodes) + +maybe-clean-stageprofile-opcodes: clean-stageprofile-opcodes +clean-stageprofile: clean-stageprofile-opcodes +clean-stageprofile-opcodes: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-opcodes/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif opcodes-bootstrap + + +.PHONY: all-stagefeedback-opcodes maybe-all-stagefeedback-opcodes +.PHONY: clean-stagefeedback-opcodes maybe-clean-stagefeedback-opcodes +maybe-all-stagefeedback-opcodes: +maybe-clean-stagefeedback-opcodes: +@if opcodes-bootstrap +maybe-all-stagefeedback-opcodes: all-stagefeedback-opcodes +all-stagefeedback: all-stagefeedback-opcodes +TARGET-stagefeedback-opcodes = $(TARGET-opcodes) +all-stagefeedback-opcodes: configure-stagefeedback-opcodes + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-opcodes) + +maybe-clean-stagefeedback-opcodes: clean-stagefeedback-opcodes +clean-stagefeedback: clean-stagefeedback-opcodes +clean-stagefeedback-opcodes: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-opcodes/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif opcodes-bootstrap + + + + + +.PHONY: check-opcodes maybe-check-opcodes +maybe-check-opcodes: +@if opcodes +maybe-check-opcodes: check-opcodes + +check-opcodes: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif opcodes + +.PHONY: install-opcodes maybe-install-opcodes +maybe-install-opcodes: +@if opcodes +maybe-install-opcodes: install-opcodes + +install-opcodes: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif opcodes + +.PHONY: install-strip-opcodes maybe-install-strip-opcodes +maybe-install-strip-opcodes: +@if opcodes +maybe-install-strip-opcodes: install-strip-opcodes + +install-strip-opcodes: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif opcodes + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-opcodes info-opcodes +maybe-info-opcodes: +@if opcodes +maybe-info-opcodes: info-opcodes + +info-opcodes: \ + configure-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif opcodes + +.PHONY: maybe-dvi-opcodes dvi-opcodes +maybe-dvi-opcodes: +@if opcodes +maybe-dvi-opcodes: dvi-opcodes + +dvi-opcodes: \ + configure-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif opcodes + +.PHONY: maybe-pdf-opcodes pdf-opcodes +maybe-pdf-opcodes: +@if opcodes +maybe-pdf-opcodes: pdf-opcodes + +pdf-opcodes: \ + configure-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif opcodes + +.PHONY: maybe-html-opcodes html-opcodes +maybe-html-opcodes: +@if opcodes +maybe-html-opcodes: html-opcodes + +html-opcodes: \ + configure-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif opcodes + +.PHONY: maybe-TAGS-opcodes TAGS-opcodes +maybe-TAGS-opcodes: +@if opcodes +maybe-TAGS-opcodes: TAGS-opcodes + +TAGS-opcodes: \ + configure-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif opcodes + +.PHONY: maybe-install-info-opcodes install-info-opcodes +maybe-install-info-opcodes: +@if opcodes +maybe-install-info-opcodes: install-info-opcodes + +install-info-opcodes: \ + configure-opcodes \ + info-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif opcodes + +.PHONY: maybe-install-pdf-opcodes install-pdf-opcodes +maybe-install-pdf-opcodes: +@if opcodes +maybe-install-pdf-opcodes: install-pdf-opcodes + +install-pdf-opcodes: \ + configure-opcodes \ + pdf-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif opcodes + +.PHONY: maybe-install-html-opcodes install-html-opcodes +maybe-install-html-opcodes: +@if opcodes +maybe-install-html-opcodes: install-html-opcodes + +install-html-opcodes: \ + configure-opcodes \ + html-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif opcodes + +.PHONY: maybe-installcheck-opcodes installcheck-opcodes +maybe-installcheck-opcodes: +@if opcodes +maybe-installcheck-opcodes: installcheck-opcodes + +installcheck-opcodes: \ + configure-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif opcodes + +.PHONY: maybe-mostlyclean-opcodes mostlyclean-opcodes +maybe-mostlyclean-opcodes: +@if opcodes +maybe-mostlyclean-opcodes: mostlyclean-opcodes + +mostlyclean-opcodes: + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif opcodes + +.PHONY: maybe-clean-opcodes clean-opcodes +maybe-clean-opcodes: +@if opcodes +maybe-clean-opcodes: clean-opcodes + +clean-opcodes: + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif opcodes + +.PHONY: maybe-distclean-opcodes distclean-opcodes +maybe-distclean-opcodes: +@if opcodes +maybe-distclean-opcodes: distclean-opcodes + +distclean-opcodes: + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif opcodes + +.PHONY: maybe-maintainer-clean-opcodes maintainer-clean-opcodes +maybe-maintainer-clean-opcodes: +@if opcodes +maybe-maintainer-clean-opcodes: maintainer-clean-opcodes + +maintainer-clean-opcodes: + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif opcodes + + + +.PHONY: configure-binutils maybe-configure-binutils +maybe-configure-binutils: +@if gcc-bootstrap +configure-binutils: stage_current +@endif gcc-bootstrap +@if binutils +maybe-configure-binutils: configure-binutils +configure-binutils: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/binutils; \ + cd "$(HOST_SUBDIR)/binutils" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/binutils"; \ + libsrcdir="$$s/binutils"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif binutils + + + +.PHONY: configure-stage1-binutils maybe-configure-stage1-binutils +maybe-configure-stage1-binutils: +@if binutils-bootstrap +maybe-configure-stage1-binutils: configure-stage1-binutils +configure-stage1-binutils: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/binutils ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/binutils"; \ + libsrcdir="$$s/binutils"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) +@endif binutils-bootstrap + +.PHONY: configure-stage2-binutils maybe-configure-stage2-binutils +maybe-configure-stage2-binutils: +@if binutils-bootstrap +maybe-configure-stage2-binutils: configure-stage2-binutils +configure-stage2-binutils: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/binutils ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/binutils"; \ + libsrcdir="$$s/binutils"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) +@endif binutils-bootstrap + +.PHONY: configure-stage3-binutils maybe-configure-stage3-binutils +maybe-configure-stage3-binutils: +@if binutils-bootstrap +maybe-configure-stage3-binutils: configure-stage3-binutils +configure-stage3-binutils: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/binutils ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/binutils"; \ + libsrcdir="$$s/binutils"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) +@endif binutils-bootstrap + +.PHONY: configure-stage4-binutils maybe-configure-stage4-binutils +maybe-configure-stage4-binutils: +@if binutils-bootstrap +maybe-configure-stage4-binutils: configure-stage4-binutils +configure-stage4-binutils: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/binutils ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/binutils"; \ + libsrcdir="$$s/binutils"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) +@endif binutils-bootstrap + +.PHONY: configure-stageprofile-binutils maybe-configure-stageprofile-binutils +maybe-configure-stageprofile-binutils: +@if binutils-bootstrap +maybe-configure-stageprofile-binutils: configure-stageprofile-binutils +configure-stageprofile-binutils: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/binutils ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/binutils"; \ + libsrcdir="$$s/binutils"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) +@endif binutils-bootstrap + +.PHONY: configure-stagefeedback-binutils maybe-configure-stagefeedback-binutils +maybe-configure-stagefeedback-binutils: +@if binutils-bootstrap +maybe-configure-stagefeedback-binutils: configure-stagefeedback-binutils +configure-stagefeedback-binutils: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/binutils ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/binutils"; \ + libsrcdir="$$s/binutils"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) +@endif binutils-bootstrap + + + + + +.PHONY: all-binutils maybe-all-binutils +maybe-all-binutils: +@if gcc-bootstrap +all-binutils: stage_current +@endif gcc-bootstrap +@if binutils +TARGET-binutils=all +maybe-all-binutils: all-binutils +all-binutils: configure-binutils + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-binutils)) +@endif binutils + + + +.PHONY: all-stage1-binutils maybe-all-stage1-binutils +.PHONY: clean-stage1-binutils maybe-clean-stage1-binutils +maybe-all-stage1-binutils: +maybe-clean-stage1-binutils: +@if binutils-bootstrap +maybe-all-stage1-binutils: all-stage1-binutils +all-stage1: all-stage1-binutils +TARGET-stage1-binutils = $(TARGET-binutils) +all-stage1-binutils: configure-stage1-binutils + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-binutils) + +maybe-clean-stage1-binutils: clean-stage1-binutils +clean-stage1: clean-stage1-binutils +clean-stage1-binutils: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-binutils/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif binutils-bootstrap + + +.PHONY: all-stage2-binutils maybe-all-stage2-binutils +.PHONY: clean-stage2-binutils maybe-clean-stage2-binutils +maybe-all-stage2-binutils: +maybe-clean-stage2-binutils: +@if binutils-bootstrap +maybe-all-stage2-binutils: all-stage2-binutils +all-stage2: all-stage2-binutils +TARGET-stage2-binutils = $(TARGET-binutils) +all-stage2-binutils: configure-stage2-binutils + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-binutils) + +maybe-clean-stage2-binutils: clean-stage2-binutils +clean-stage2: clean-stage2-binutils +clean-stage2-binutils: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-binutils/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif binutils-bootstrap + + +.PHONY: all-stage3-binutils maybe-all-stage3-binutils +.PHONY: clean-stage3-binutils maybe-clean-stage3-binutils +maybe-all-stage3-binutils: +maybe-clean-stage3-binutils: +@if binutils-bootstrap +maybe-all-stage3-binutils: all-stage3-binutils +all-stage3: all-stage3-binutils +TARGET-stage3-binutils = $(TARGET-binutils) +all-stage3-binutils: configure-stage3-binutils + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-binutils) + +maybe-clean-stage3-binutils: clean-stage3-binutils +clean-stage3: clean-stage3-binutils +clean-stage3-binutils: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-binutils/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif binutils-bootstrap + + +.PHONY: all-stage4-binutils maybe-all-stage4-binutils +.PHONY: clean-stage4-binutils maybe-clean-stage4-binutils +maybe-all-stage4-binutils: +maybe-clean-stage4-binutils: +@if binutils-bootstrap +maybe-all-stage4-binutils: all-stage4-binutils +all-stage4: all-stage4-binutils +TARGET-stage4-binutils = $(TARGET-binutils) +all-stage4-binutils: configure-stage4-binutils + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-binutils) + +maybe-clean-stage4-binutils: clean-stage4-binutils +clean-stage4: clean-stage4-binutils +clean-stage4-binutils: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-binutils/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif binutils-bootstrap + + +.PHONY: all-stageprofile-binutils maybe-all-stageprofile-binutils +.PHONY: clean-stageprofile-binutils maybe-clean-stageprofile-binutils +maybe-all-stageprofile-binutils: +maybe-clean-stageprofile-binutils: +@if binutils-bootstrap +maybe-all-stageprofile-binutils: all-stageprofile-binutils +all-stageprofile: all-stageprofile-binutils +TARGET-stageprofile-binutils = $(TARGET-binutils) +all-stageprofile-binutils: configure-stageprofile-binutils + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-binutils) + +maybe-clean-stageprofile-binutils: clean-stageprofile-binutils +clean-stageprofile: clean-stageprofile-binutils +clean-stageprofile-binutils: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-binutils/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif binutils-bootstrap + + +.PHONY: all-stagefeedback-binutils maybe-all-stagefeedback-binutils +.PHONY: clean-stagefeedback-binutils maybe-clean-stagefeedback-binutils +maybe-all-stagefeedback-binutils: +maybe-clean-stagefeedback-binutils: +@if binutils-bootstrap +maybe-all-stagefeedback-binutils: all-stagefeedback-binutils +all-stagefeedback: all-stagefeedback-binutils +TARGET-stagefeedback-binutils = $(TARGET-binutils) +all-stagefeedback-binutils: configure-stagefeedback-binutils + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-binutils) + +maybe-clean-stagefeedback-binutils: clean-stagefeedback-binutils +clean-stagefeedback: clean-stagefeedback-binutils +clean-stagefeedback-binutils: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-binutils/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif binutils-bootstrap + + + + + +.PHONY: check-binutils maybe-check-binutils +maybe-check-binutils: +@if binutils +maybe-check-binutils: check-binutils + +check-binutils: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif binutils + +.PHONY: install-binutils maybe-install-binutils +maybe-install-binutils: +@if binutils +maybe-install-binutils: install-binutils + +install-binutils: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif binutils + +.PHONY: install-strip-binutils maybe-install-strip-binutils +maybe-install-strip-binutils: +@if binutils +maybe-install-strip-binutils: install-strip-binutils + +install-strip-binutils: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif binutils + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-binutils info-binutils +maybe-info-binutils: +@if binutils +maybe-info-binutils: info-binutils + +info-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif binutils + +.PHONY: maybe-dvi-binutils dvi-binutils +maybe-dvi-binutils: +@if binutils +maybe-dvi-binutils: dvi-binutils + +dvi-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif binutils + +.PHONY: maybe-pdf-binutils pdf-binutils +maybe-pdf-binutils: +@if binutils +maybe-pdf-binutils: pdf-binutils + +pdf-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif binutils + +.PHONY: maybe-html-binutils html-binutils +maybe-html-binutils: +@if binutils +maybe-html-binutils: html-binutils + +html-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif binutils + +.PHONY: maybe-TAGS-binutils TAGS-binutils +maybe-TAGS-binutils: +@if binutils +maybe-TAGS-binutils: TAGS-binutils + +TAGS-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif binutils + +.PHONY: maybe-install-info-binutils install-info-binutils +maybe-install-info-binutils: +@if binutils +maybe-install-info-binutils: install-info-binutils + +install-info-binutils: \ + configure-binutils \ + info-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif binutils + +.PHONY: maybe-install-pdf-binutils install-pdf-binutils +maybe-install-pdf-binutils: +@if binutils +maybe-install-pdf-binutils: install-pdf-binutils + +install-pdf-binutils: \ + configure-binutils \ + pdf-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif binutils + +.PHONY: maybe-install-html-binutils install-html-binutils +maybe-install-html-binutils: +@if binutils +maybe-install-html-binutils: install-html-binutils + +install-html-binutils: \ + configure-binutils \ + html-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif binutils + +.PHONY: maybe-installcheck-binutils installcheck-binutils +maybe-installcheck-binutils: +@if binutils +maybe-installcheck-binutils: installcheck-binutils + +installcheck-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif binutils + +.PHONY: maybe-mostlyclean-binutils mostlyclean-binutils +maybe-mostlyclean-binutils: +@if binutils +maybe-mostlyclean-binutils: mostlyclean-binutils + +mostlyclean-binutils: + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif binutils + +.PHONY: maybe-clean-binutils clean-binutils +maybe-clean-binutils: +@if binutils +maybe-clean-binutils: clean-binutils + +clean-binutils: + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif binutils + +.PHONY: maybe-distclean-binutils distclean-binutils +maybe-distclean-binutils: +@if binutils +maybe-distclean-binutils: distclean-binutils + +distclean-binutils: + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif binutils + +.PHONY: maybe-maintainer-clean-binutils maintainer-clean-binutils +maybe-maintainer-clean-binutils: +@if binutils +maybe-maintainer-clean-binutils: maintainer-clean-binutils + +maintainer-clean-binutils: + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif binutils + + + +.PHONY: configure-bison maybe-configure-bison +maybe-configure-bison: +@if gcc-bootstrap +configure-bison: stage_current +@endif gcc-bootstrap +@if bison +maybe-configure-bison: configure-bison +configure-bison: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/bison/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bison ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/bison; \ + cd "$(HOST_SUBDIR)/bison" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/bison/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/bison"; \ + libsrcdir="$$s/bison"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif bison + + + + + +.PHONY: all-bison maybe-all-bison +maybe-all-bison: +@if gcc-bootstrap +all-bison: stage_current +@endif gcc-bootstrap +@if bison +TARGET-bison=all +maybe-all-bison: all-bison +all-bison: configure-bison + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-bison)) +@endif bison + + + + +.PHONY: check-bison maybe-check-bison +maybe-check-bison: +@if bison +maybe-check-bison: check-bison + +# This module is only tested in a native toolchain. +check-bison: + @: $(MAKE); $(unstage) + @if [ '$(host)' = '$(target)' ] ; then \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(FLAGS_TO_PASS) check); \ + fi + +@endif bison + +.PHONY: install-bison maybe-install-bison +maybe-install-bison: +@if bison +maybe-install-bison: install-bison + +install-bison: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif bison + +.PHONY: install-strip-bison maybe-install-strip-bison +maybe-install-strip-bison: +@if bison +maybe-install-strip-bison: install-strip-bison + +install-strip-bison: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif bison + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-bison info-bison +maybe-info-bison: +@if bison +maybe-info-bison: info-bison + +info-bison: \ + configure-bison + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif bison + +.PHONY: maybe-dvi-bison dvi-bison +maybe-dvi-bison: +@if bison +maybe-dvi-bison: dvi-bison + +dvi-bison: \ + configure-bison + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif bison + +.PHONY: maybe-pdf-bison pdf-bison +maybe-pdf-bison: +@if bison +maybe-pdf-bison: pdf-bison + +pdf-bison: \ + configure-bison + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif bison + +.PHONY: maybe-html-bison html-bison +maybe-html-bison: +@if bison +maybe-html-bison: html-bison + +html-bison: \ + configure-bison + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif bison + +.PHONY: maybe-TAGS-bison TAGS-bison +maybe-TAGS-bison: +@if bison +maybe-TAGS-bison: TAGS-bison + +TAGS-bison: \ + configure-bison + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif bison + +.PHONY: maybe-install-info-bison install-info-bison +maybe-install-info-bison: +@if bison +maybe-install-info-bison: install-info-bison + +install-info-bison: \ + configure-bison \ + info-bison + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif bison + +.PHONY: maybe-install-pdf-bison install-pdf-bison +maybe-install-pdf-bison: +@if bison +maybe-install-pdf-bison: install-pdf-bison + +install-pdf-bison: \ + configure-bison \ + pdf-bison + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif bison + +.PHONY: maybe-install-html-bison install-html-bison +maybe-install-html-bison: +@if bison +maybe-install-html-bison: install-html-bison + +install-html-bison: \ + configure-bison \ + html-bison + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif bison + +.PHONY: maybe-installcheck-bison installcheck-bison +maybe-installcheck-bison: +@if bison +maybe-installcheck-bison: installcheck-bison + +installcheck-bison: \ + configure-bison + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif bison + +.PHONY: maybe-mostlyclean-bison mostlyclean-bison +maybe-mostlyclean-bison: +@if bison +maybe-mostlyclean-bison: mostlyclean-bison + +mostlyclean-bison: + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif bison + +.PHONY: maybe-clean-bison clean-bison +maybe-clean-bison: +@if bison +maybe-clean-bison: clean-bison + +clean-bison: + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif bison + +.PHONY: maybe-distclean-bison distclean-bison +maybe-distclean-bison: +@if bison +maybe-distclean-bison: distclean-bison + +distclean-bison: + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif bison + +.PHONY: maybe-maintainer-clean-bison maintainer-clean-bison +maybe-maintainer-clean-bison: +@if bison +maybe-maintainer-clean-bison: maintainer-clean-bison + +maintainer-clean-bison: + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif bison + + + +.PHONY: configure-cgen maybe-configure-cgen +maybe-configure-cgen: +@if gcc-bootstrap +configure-cgen: stage_current +@endif gcc-bootstrap +@if cgen +maybe-configure-cgen: configure-cgen +configure-cgen: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/cgen/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/cgen ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/cgen; \ + cd "$(HOST_SUBDIR)/cgen" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/cgen/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/cgen"; \ + libsrcdir="$$s/cgen"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif cgen + + + + + +.PHONY: all-cgen maybe-all-cgen +maybe-all-cgen: +@if gcc-bootstrap +all-cgen: stage_current +@endif gcc-bootstrap +@if cgen +TARGET-cgen=all +maybe-all-cgen: all-cgen +all-cgen: configure-cgen + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-cgen)) +@endif cgen + + + + +.PHONY: check-cgen maybe-check-cgen +maybe-check-cgen: +@if cgen +maybe-check-cgen: check-cgen + +check-cgen: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif cgen + +.PHONY: install-cgen maybe-install-cgen +maybe-install-cgen: +@if cgen +maybe-install-cgen: install-cgen + +install-cgen: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif cgen + +.PHONY: install-strip-cgen maybe-install-strip-cgen +maybe-install-strip-cgen: +@if cgen +maybe-install-strip-cgen: install-strip-cgen + +install-strip-cgen: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif cgen + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-cgen info-cgen +maybe-info-cgen: +@if cgen +maybe-info-cgen: info-cgen + +info-cgen: \ + configure-cgen + @: $(MAKE); $(unstage) + @[ -f ./cgen/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in cgen" ; \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif cgen + +.PHONY: maybe-dvi-cgen dvi-cgen +maybe-dvi-cgen: +@if cgen +maybe-dvi-cgen: dvi-cgen + +dvi-cgen: \ + configure-cgen + @: $(MAKE); $(unstage) + @[ -f ./cgen/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in cgen" ; \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif cgen + +.PHONY: maybe-pdf-cgen pdf-cgen +maybe-pdf-cgen: +@if cgen +maybe-pdf-cgen: pdf-cgen + +pdf-cgen: \ + configure-cgen + @: $(MAKE); $(unstage) + @[ -f ./cgen/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in cgen" ; \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif cgen + +.PHONY: maybe-html-cgen html-cgen +maybe-html-cgen: +@if cgen +maybe-html-cgen: html-cgen + +html-cgen: \ + configure-cgen + @: $(MAKE); $(unstage) + @[ -f ./cgen/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in cgen" ; \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif cgen + +.PHONY: maybe-TAGS-cgen TAGS-cgen +maybe-TAGS-cgen: +@if cgen +maybe-TAGS-cgen: TAGS-cgen + +TAGS-cgen: \ + configure-cgen + @: $(MAKE); $(unstage) + @[ -f ./cgen/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in cgen" ; \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif cgen + +.PHONY: maybe-install-info-cgen install-info-cgen +maybe-install-info-cgen: +@if cgen +maybe-install-info-cgen: install-info-cgen + +install-info-cgen: \ + configure-cgen \ + info-cgen + @: $(MAKE); $(unstage) + @[ -f ./cgen/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in cgen" ; \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif cgen + +.PHONY: maybe-install-pdf-cgen install-pdf-cgen +maybe-install-pdf-cgen: +@if cgen +maybe-install-pdf-cgen: install-pdf-cgen + +install-pdf-cgen: \ + configure-cgen \ + pdf-cgen + @: $(MAKE); $(unstage) + @[ -f ./cgen/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in cgen" ; \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif cgen + +.PHONY: maybe-install-html-cgen install-html-cgen +maybe-install-html-cgen: +@if cgen +maybe-install-html-cgen: install-html-cgen + +install-html-cgen: \ + configure-cgen \ + html-cgen + @: $(MAKE); $(unstage) + @[ -f ./cgen/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in cgen" ; \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif cgen + +.PHONY: maybe-installcheck-cgen installcheck-cgen +maybe-installcheck-cgen: +@if cgen +maybe-installcheck-cgen: installcheck-cgen + +installcheck-cgen: \ + configure-cgen + @: $(MAKE); $(unstage) + @[ -f ./cgen/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in cgen" ; \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif cgen + +.PHONY: maybe-mostlyclean-cgen mostlyclean-cgen +maybe-mostlyclean-cgen: +@if cgen +maybe-mostlyclean-cgen: mostlyclean-cgen + +mostlyclean-cgen: + @: $(MAKE); $(unstage) + @[ -f ./cgen/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in cgen" ; \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif cgen + +.PHONY: maybe-clean-cgen clean-cgen +maybe-clean-cgen: +@if cgen +maybe-clean-cgen: clean-cgen + +clean-cgen: + @: $(MAKE); $(unstage) + @[ -f ./cgen/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in cgen" ; \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif cgen + +.PHONY: maybe-distclean-cgen distclean-cgen +maybe-distclean-cgen: +@if cgen +maybe-distclean-cgen: distclean-cgen + +distclean-cgen: + @: $(MAKE); $(unstage) + @[ -f ./cgen/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in cgen" ; \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif cgen + +.PHONY: maybe-maintainer-clean-cgen maintainer-clean-cgen +maybe-maintainer-clean-cgen: +@if cgen +maybe-maintainer-clean-cgen: maintainer-clean-cgen + +maintainer-clean-cgen: + @: $(MAKE); $(unstage) + @[ -f ./cgen/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in cgen" ; \ + (cd $(HOST_SUBDIR)/cgen && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif cgen + + + +.PHONY: configure-dejagnu maybe-configure-dejagnu +maybe-configure-dejagnu: +@if gcc-bootstrap +configure-dejagnu: stage_current +@endif gcc-bootstrap +@if dejagnu +maybe-configure-dejagnu: configure-dejagnu +configure-dejagnu: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/dejagnu/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/dejagnu ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/dejagnu; \ + cd "$(HOST_SUBDIR)/dejagnu" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/dejagnu/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/dejagnu"; \ + libsrcdir="$$s/dejagnu"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif dejagnu + + + + + +.PHONY: all-dejagnu maybe-all-dejagnu +maybe-all-dejagnu: +@if gcc-bootstrap +all-dejagnu: stage_current +@endif gcc-bootstrap +@if dejagnu +TARGET-dejagnu=all +maybe-all-dejagnu: all-dejagnu +all-dejagnu: configure-dejagnu + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-dejagnu)) +@endif dejagnu + + + + +.PHONY: check-dejagnu maybe-check-dejagnu +maybe-check-dejagnu: +@if dejagnu +maybe-check-dejagnu: check-dejagnu + +check-dejagnu: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif dejagnu + +.PHONY: install-dejagnu maybe-install-dejagnu +maybe-install-dejagnu: +@if dejagnu +maybe-install-dejagnu: install-dejagnu + +install-dejagnu: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif dejagnu + +.PHONY: install-strip-dejagnu maybe-install-strip-dejagnu +maybe-install-strip-dejagnu: +@if dejagnu +maybe-install-strip-dejagnu: install-strip-dejagnu + +install-strip-dejagnu: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif dejagnu + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-dejagnu info-dejagnu +maybe-info-dejagnu: +@if dejagnu +maybe-info-dejagnu: info-dejagnu + +info-dejagnu: \ + configure-dejagnu + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif dejagnu + +.PHONY: maybe-dvi-dejagnu dvi-dejagnu +maybe-dvi-dejagnu: +@if dejagnu +maybe-dvi-dejagnu: dvi-dejagnu + +dvi-dejagnu: \ + configure-dejagnu + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif dejagnu + +.PHONY: maybe-pdf-dejagnu pdf-dejagnu +maybe-pdf-dejagnu: +@if dejagnu +maybe-pdf-dejagnu: pdf-dejagnu + +pdf-dejagnu: \ + configure-dejagnu + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif dejagnu + +.PHONY: maybe-html-dejagnu html-dejagnu +maybe-html-dejagnu: +@if dejagnu +maybe-html-dejagnu: html-dejagnu + +html-dejagnu: \ + configure-dejagnu + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif dejagnu + +.PHONY: maybe-TAGS-dejagnu TAGS-dejagnu +maybe-TAGS-dejagnu: +@if dejagnu +maybe-TAGS-dejagnu: TAGS-dejagnu + +TAGS-dejagnu: \ + configure-dejagnu + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif dejagnu + +.PHONY: maybe-install-info-dejagnu install-info-dejagnu +maybe-install-info-dejagnu: +@if dejagnu +maybe-install-info-dejagnu: install-info-dejagnu + +install-info-dejagnu: \ + configure-dejagnu \ + info-dejagnu + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif dejagnu + +.PHONY: maybe-install-pdf-dejagnu install-pdf-dejagnu +maybe-install-pdf-dejagnu: +@if dejagnu +maybe-install-pdf-dejagnu: install-pdf-dejagnu + +install-pdf-dejagnu: \ + configure-dejagnu \ + pdf-dejagnu + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif dejagnu + +.PHONY: maybe-install-html-dejagnu install-html-dejagnu +maybe-install-html-dejagnu: +@if dejagnu +maybe-install-html-dejagnu: install-html-dejagnu + +install-html-dejagnu: \ + configure-dejagnu \ + html-dejagnu + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif dejagnu + +.PHONY: maybe-installcheck-dejagnu installcheck-dejagnu +maybe-installcheck-dejagnu: +@if dejagnu +maybe-installcheck-dejagnu: installcheck-dejagnu + +installcheck-dejagnu: \ + configure-dejagnu + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif dejagnu + +.PHONY: maybe-mostlyclean-dejagnu mostlyclean-dejagnu +maybe-mostlyclean-dejagnu: +@if dejagnu +maybe-mostlyclean-dejagnu: mostlyclean-dejagnu + +mostlyclean-dejagnu: + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif dejagnu + +.PHONY: maybe-clean-dejagnu clean-dejagnu +maybe-clean-dejagnu: +@if dejagnu +maybe-clean-dejagnu: clean-dejagnu + +clean-dejagnu: + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif dejagnu + +.PHONY: maybe-distclean-dejagnu distclean-dejagnu +maybe-distclean-dejagnu: +@if dejagnu +maybe-distclean-dejagnu: distclean-dejagnu + +distclean-dejagnu: + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif dejagnu + +.PHONY: maybe-maintainer-clean-dejagnu maintainer-clean-dejagnu +maybe-maintainer-clean-dejagnu: +@if dejagnu +maybe-maintainer-clean-dejagnu: maintainer-clean-dejagnu + +maintainer-clean-dejagnu: + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif dejagnu + + + +.PHONY: configure-etc maybe-configure-etc +maybe-configure-etc: +@if gcc-bootstrap +configure-etc: stage_current +@endif gcc-bootstrap +@if etc +maybe-configure-etc: configure-etc +configure-etc: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/etc/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/etc ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/etc; \ + cd "$(HOST_SUBDIR)/etc" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/etc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/etc"; \ + libsrcdir="$$s/etc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif etc + + + + + +.PHONY: all-etc maybe-all-etc +maybe-all-etc: +@if gcc-bootstrap +all-etc: stage_current +@endif gcc-bootstrap +@if etc +TARGET-etc=all +maybe-all-etc: all-etc +all-etc: configure-etc + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-etc)) +@endif etc + + + + +.PHONY: check-etc maybe-check-etc +maybe-check-etc: +@if etc +maybe-check-etc: check-etc + +check-etc: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif etc + +.PHONY: install-etc maybe-install-etc +maybe-install-etc: +@if etc +maybe-install-etc: install-etc + +install-etc: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif etc + +.PHONY: install-strip-etc maybe-install-strip-etc +maybe-install-strip-etc: +@if etc +maybe-install-strip-etc: install-strip-etc + +install-strip-etc: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif etc + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-etc info-etc +maybe-info-etc: +@if etc +maybe-info-etc: info-etc + +info-etc: \ + configure-etc + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif etc + +.PHONY: maybe-dvi-etc dvi-etc +maybe-dvi-etc: +@if etc +maybe-dvi-etc: dvi-etc + +dvi-etc: \ + configure-etc + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif etc + +.PHONY: maybe-pdf-etc pdf-etc +maybe-pdf-etc: +@if etc +maybe-pdf-etc: pdf-etc + +pdf-etc: \ + configure-etc + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif etc + +.PHONY: maybe-html-etc html-etc +maybe-html-etc: +@if etc +maybe-html-etc: html-etc + +html-etc: \ + configure-etc + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif etc + +.PHONY: maybe-TAGS-etc TAGS-etc +maybe-TAGS-etc: +@if etc +maybe-TAGS-etc: TAGS-etc + +TAGS-etc: \ + configure-etc + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif etc + +.PHONY: maybe-install-info-etc install-info-etc +maybe-install-info-etc: +@if etc +maybe-install-info-etc: install-info-etc + +install-info-etc: \ + configure-etc \ + info-etc + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif etc + +.PHONY: maybe-install-pdf-etc install-pdf-etc +maybe-install-pdf-etc: +@if etc +maybe-install-pdf-etc: install-pdf-etc + +install-pdf-etc: \ + configure-etc \ + pdf-etc + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif etc + +.PHONY: maybe-install-html-etc install-html-etc +maybe-install-html-etc: +@if etc +maybe-install-html-etc: install-html-etc + +install-html-etc: \ + configure-etc \ + html-etc + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif etc + +.PHONY: maybe-installcheck-etc installcheck-etc +maybe-installcheck-etc: +@if etc +maybe-installcheck-etc: installcheck-etc + +installcheck-etc: \ + configure-etc + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif etc + +.PHONY: maybe-mostlyclean-etc mostlyclean-etc +maybe-mostlyclean-etc: +@if etc +maybe-mostlyclean-etc: mostlyclean-etc + +mostlyclean-etc: + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif etc + +.PHONY: maybe-clean-etc clean-etc +maybe-clean-etc: +@if etc +maybe-clean-etc: clean-etc + +clean-etc: + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif etc + +.PHONY: maybe-distclean-etc distclean-etc +maybe-distclean-etc: +@if etc +maybe-distclean-etc: distclean-etc + +distclean-etc: + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif etc + +.PHONY: maybe-maintainer-clean-etc maintainer-clean-etc +maybe-maintainer-clean-etc: +@if etc +maybe-maintainer-clean-etc: maintainer-clean-etc + +maintainer-clean-etc: + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif etc + + + +.PHONY: configure-fastjar maybe-configure-fastjar +maybe-configure-fastjar: +@if gcc-bootstrap +configure-fastjar: stage_current +@endif gcc-bootstrap +@if fastjar +maybe-configure-fastjar: configure-fastjar +configure-fastjar: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/fastjar/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/fastjar ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/fastjar; \ + cd "$(HOST_SUBDIR)/fastjar" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/fastjar/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/fastjar"; \ + libsrcdir="$$s/fastjar"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif fastjar + + + + + +.PHONY: all-fastjar maybe-all-fastjar +maybe-all-fastjar: +@if gcc-bootstrap +all-fastjar: stage_current +@endif gcc-bootstrap +@if fastjar +TARGET-fastjar=all +maybe-all-fastjar: all-fastjar +all-fastjar: configure-fastjar + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-fastjar)) +@endif fastjar + + + + +.PHONY: check-fastjar maybe-check-fastjar +maybe-check-fastjar: +@if fastjar +maybe-check-fastjar: check-fastjar + +# This module is only tested in a native toolchain. +check-fastjar: + @: $(MAKE); $(unstage) + @if [ '$(host)' = '$(target)' ] ; then \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(FLAGS_TO_PASS) check); \ + fi + +@endif fastjar + +.PHONY: install-fastjar maybe-install-fastjar +maybe-install-fastjar: +@if fastjar +maybe-install-fastjar: install-fastjar + +install-fastjar: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif fastjar + +.PHONY: install-strip-fastjar maybe-install-strip-fastjar +maybe-install-strip-fastjar: +@if fastjar +maybe-install-strip-fastjar: install-strip-fastjar + +install-strip-fastjar: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif fastjar + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-fastjar info-fastjar +maybe-info-fastjar: +@if fastjar +maybe-info-fastjar: info-fastjar + +info-fastjar: \ + configure-fastjar + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif fastjar + +.PHONY: maybe-dvi-fastjar dvi-fastjar +maybe-dvi-fastjar: +@if fastjar +maybe-dvi-fastjar: dvi-fastjar + +dvi-fastjar: \ + configure-fastjar + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif fastjar + +.PHONY: maybe-pdf-fastjar pdf-fastjar +maybe-pdf-fastjar: +@if fastjar +maybe-pdf-fastjar: pdf-fastjar + +pdf-fastjar: \ + configure-fastjar + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif fastjar + +.PHONY: maybe-html-fastjar html-fastjar +maybe-html-fastjar: +@if fastjar +maybe-html-fastjar: html-fastjar + +html-fastjar: \ + configure-fastjar + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif fastjar + +.PHONY: maybe-TAGS-fastjar TAGS-fastjar +maybe-TAGS-fastjar: +@if fastjar +maybe-TAGS-fastjar: TAGS-fastjar + +TAGS-fastjar: \ + configure-fastjar + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif fastjar + +.PHONY: maybe-install-info-fastjar install-info-fastjar +maybe-install-info-fastjar: +@if fastjar +maybe-install-info-fastjar: install-info-fastjar + +install-info-fastjar: \ + configure-fastjar \ + info-fastjar + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif fastjar + +.PHONY: maybe-install-pdf-fastjar install-pdf-fastjar +maybe-install-pdf-fastjar: +@if fastjar +maybe-install-pdf-fastjar: install-pdf-fastjar + +install-pdf-fastjar: \ + configure-fastjar \ + pdf-fastjar + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif fastjar + +.PHONY: maybe-install-html-fastjar install-html-fastjar +maybe-install-html-fastjar: +@if fastjar +maybe-install-html-fastjar: install-html-fastjar + +install-html-fastjar: \ + configure-fastjar \ + html-fastjar + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif fastjar + +.PHONY: maybe-installcheck-fastjar installcheck-fastjar +maybe-installcheck-fastjar: +@if fastjar +maybe-installcheck-fastjar: installcheck-fastjar + +installcheck-fastjar: \ + configure-fastjar + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif fastjar + +.PHONY: maybe-mostlyclean-fastjar mostlyclean-fastjar +maybe-mostlyclean-fastjar: +@if fastjar +maybe-mostlyclean-fastjar: mostlyclean-fastjar + +mostlyclean-fastjar: + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif fastjar + +.PHONY: maybe-clean-fastjar clean-fastjar +maybe-clean-fastjar: +@if fastjar +maybe-clean-fastjar: clean-fastjar + +clean-fastjar: + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif fastjar + +.PHONY: maybe-distclean-fastjar distclean-fastjar +maybe-distclean-fastjar: +@if fastjar +maybe-distclean-fastjar: distclean-fastjar + +distclean-fastjar: + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif fastjar + +.PHONY: maybe-maintainer-clean-fastjar maintainer-clean-fastjar +maybe-maintainer-clean-fastjar: +@if fastjar +maybe-maintainer-clean-fastjar: maintainer-clean-fastjar + +maintainer-clean-fastjar: + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif fastjar + + + +.PHONY: configure-fixincludes maybe-configure-fixincludes +maybe-configure-fixincludes: +@if gcc-bootstrap +configure-fixincludes: stage_current +@endif gcc-bootstrap +@if fixincludes +maybe-configure-fixincludes: configure-fixincludes +configure-fixincludes: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/fixincludes/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/fixincludes ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/fixincludes; \ + cd "$(HOST_SUBDIR)/fixincludes" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/fixincludes/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/fixincludes"; \ + libsrcdir="$$s/fixincludes"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif fixincludes + + + + + +.PHONY: all-fixincludes maybe-all-fixincludes +maybe-all-fixincludes: +@if gcc-bootstrap +all-fixincludes: stage_current +@endif gcc-bootstrap +@if fixincludes +TARGET-fixincludes=all +maybe-all-fixincludes: all-fixincludes +all-fixincludes: configure-fixincludes + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-fixincludes)) +@endif fixincludes + + + + +.PHONY: check-fixincludes maybe-check-fixincludes +maybe-check-fixincludes: +@if fixincludes +maybe-check-fixincludes: check-fixincludes + +check-fixincludes: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif fixincludes + +.PHONY: install-fixincludes maybe-install-fixincludes +maybe-install-fixincludes: +@if fixincludes +maybe-install-fixincludes: install-fixincludes + +install-fixincludes: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif fixincludes + +.PHONY: install-strip-fixincludes maybe-install-strip-fixincludes +maybe-install-strip-fixincludes: +@if fixincludes +maybe-install-strip-fixincludes: install-strip-fixincludes + +install-strip-fixincludes: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif fixincludes + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-fixincludes info-fixincludes +maybe-info-fixincludes: +@if fixincludes +maybe-info-fixincludes: info-fixincludes + +info-fixincludes: \ + configure-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif fixincludes + +.PHONY: maybe-dvi-fixincludes dvi-fixincludes +maybe-dvi-fixincludes: +@if fixincludes +maybe-dvi-fixincludes: dvi-fixincludes + +dvi-fixincludes: \ + configure-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif fixincludes + +.PHONY: maybe-pdf-fixincludes pdf-fixincludes +maybe-pdf-fixincludes: +@if fixincludes +maybe-pdf-fixincludes: pdf-fixincludes + +pdf-fixincludes: \ + configure-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif fixincludes + +.PHONY: maybe-html-fixincludes html-fixincludes +maybe-html-fixincludes: +@if fixincludes +maybe-html-fixincludes: html-fixincludes + +html-fixincludes: \ + configure-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif fixincludes + +.PHONY: maybe-TAGS-fixincludes TAGS-fixincludes +maybe-TAGS-fixincludes: +@if fixincludes +maybe-TAGS-fixincludes: TAGS-fixincludes + +# fixincludes doesn't support TAGS. +TAGS-fixincludes: + +@endif fixincludes + +.PHONY: maybe-install-info-fixincludes install-info-fixincludes +maybe-install-info-fixincludes: +@if fixincludes +maybe-install-info-fixincludes: install-info-fixincludes + +install-info-fixincludes: \ + configure-fixincludes \ + info-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif fixincludes + +.PHONY: maybe-install-pdf-fixincludes install-pdf-fixincludes +maybe-install-pdf-fixincludes: +@if fixincludes +maybe-install-pdf-fixincludes: install-pdf-fixincludes + +install-pdf-fixincludes: \ + configure-fixincludes \ + pdf-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif fixincludes + +.PHONY: maybe-install-html-fixincludes install-html-fixincludes +maybe-install-html-fixincludes: +@if fixincludes +maybe-install-html-fixincludes: install-html-fixincludes + +install-html-fixincludes: \ + configure-fixincludes \ + html-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif fixincludes + +.PHONY: maybe-installcheck-fixincludes installcheck-fixincludes +maybe-installcheck-fixincludes: +@if fixincludes +maybe-installcheck-fixincludes: installcheck-fixincludes + +installcheck-fixincludes: \ + configure-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif fixincludes + +.PHONY: maybe-mostlyclean-fixincludes mostlyclean-fixincludes +maybe-mostlyclean-fixincludes: +@if fixincludes +maybe-mostlyclean-fixincludes: mostlyclean-fixincludes + +mostlyclean-fixincludes: + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif fixincludes + +.PHONY: maybe-clean-fixincludes clean-fixincludes +maybe-clean-fixincludes: +@if fixincludes +maybe-clean-fixincludes: clean-fixincludes + +clean-fixincludes: + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif fixincludes + +.PHONY: maybe-distclean-fixincludes distclean-fixincludes +maybe-distclean-fixincludes: +@if fixincludes +maybe-distclean-fixincludes: distclean-fixincludes + +distclean-fixincludes: + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif fixincludes + +.PHONY: maybe-maintainer-clean-fixincludes maintainer-clean-fixincludes +maybe-maintainer-clean-fixincludes: +@if fixincludes +maybe-maintainer-clean-fixincludes: maintainer-clean-fixincludes + +maintainer-clean-fixincludes: + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif fixincludes + + + +.PHONY: configure-flex maybe-configure-flex +maybe-configure-flex: +@if gcc-bootstrap +configure-flex: stage_current +@endif gcc-bootstrap +@if flex +maybe-configure-flex: configure-flex +configure-flex: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/flex/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/flex ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/flex; \ + cd "$(HOST_SUBDIR)/flex" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/flex/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/flex"; \ + libsrcdir="$$s/flex"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif flex + + + + + +.PHONY: all-flex maybe-all-flex +maybe-all-flex: +@if gcc-bootstrap +all-flex: stage_current +@endif gcc-bootstrap +@if flex +TARGET-flex=all +maybe-all-flex: all-flex +all-flex: configure-flex + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-flex)) +@endif flex + + + + +.PHONY: check-flex maybe-check-flex +maybe-check-flex: +@if flex +maybe-check-flex: check-flex + +# This module is only tested in a native toolchain. +check-flex: + @: $(MAKE); $(unstage) + @if [ '$(host)' = '$(target)' ] ; then \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(FLAGS_TO_PASS) check); \ + fi + +@endif flex + +.PHONY: install-flex maybe-install-flex +maybe-install-flex: +@if flex +maybe-install-flex: install-flex + +install-flex: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif flex + +.PHONY: install-strip-flex maybe-install-strip-flex +maybe-install-strip-flex: +@if flex +maybe-install-strip-flex: install-strip-flex + +install-strip-flex: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif flex + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-flex info-flex +maybe-info-flex: +@if flex +maybe-info-flex: info-flex + +info-flex: \ + configure-flex + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif flex + +.PHONY: maybe-dvi-flex dvi-flex +maybe-dvi-flex: +@if flex +maybe-dvi-flex: dvi-flex + +dvi-flex: \ + configure-flex + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif flex + +.PHONY: maybe-pdf-flex pdf-flex +maybe-pdf-flex: +@if flex +maybe-pdf-flex: pdf-flex + +pdf-flex: \ + configure-flex + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif flex + +.PHONY: maybe-html-flex html-flex +maybe-html-flex: +@if flex +maybe-html-flex: html-flex + +html-flex: \ + configure-flex + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif flex + +.PHONY: maybe-TAGS-flex TAGS-flex +maybe-TAGS-flex: +@if flex +maybe-TAGS-flex: TAGS-flex + +TAGS-flex: \ + configure-flex + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif flex + +.PHONY: maybe-install-info-flex install-info-flex +maybe-install-info-flex: +@if flex +maybe-install-info-flex: install-info-flex + +install-info-flex: \ + configure-flex \ + info-flex + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif flex + +.PHONY: maybe-install-pdf-flex install-pdf-flex +maybe-install-pdf-flex: +@if flex +maybe-install-pdf-flex: install-pdf-flex + +install-pdf-flex: \ + configure-flex \ + pdf-flex + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif flex + +.PHONY: maybe-install-html-flex install-html-flex +maybe-install-html-flex: +@if flex +maybe-install-html-flex: install-html-flex + +install-html-flex: \ + configure-flex \ + html-flex + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif flex + +.PHONY: maybe-installcheck-flex installcheck-flex +maybe-installcheck-flex: +@if flex +maybe-installcheck-flex: installcheck-flex + +installcheck-flex: \ + configure-flex + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif flex + +.PHONY: maybe-mostlyclean-flex mostlyclean-flex +maybe-mostlyclean-flex: +@if flex +maybe-mostlyclean-flex: mostlyclean-flex + +mostlyclean-flex: + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif flex + +.PHONY: maybe-clean-flex clean-flex +maybe-clean-flex: +@if flex +maybe-clean-flex: clean-flex + +clean-flex: + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif flex + +.PHONY: maybe-distclean-flex distclean-flex +maybe-distclean-flex: +@if flex +maybe-distclean-flex: distclean-flex + +distclean-flex: + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif flex + +.PHONY: maybe-maintainer-clean-flex maintainer-clean-flex +maybe-maintainer-clean-flex: +@if flex +maybe-maintainer-clean-flex: maintainer-clean-flex + +maintainer-clean-flex: + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif flex + + + +.PHONY: configure-gas maybe-configure-gas +maybe-configure-gas: +@if gcc-bootstrap +configure-gas: stage_current +@endif gcc-bootstrap +@if gas +maybe-configure-gas: configure-gas +configure-gas: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/gas; \ + cd "$(HOST_SUBDIR)/gas" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gas"; \ + libsrcdir="$$s/gas"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif gas + + + +.PHONY: configure-stage1-gas maybe-configure-stage1-gas +maybe-configure-stage1-gas: +@if gas-bootstrap +maybe-configure-stage1-gas: configure-stage1-gas +configure-stage1-gas: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/gas ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gas"; \ + libsrcdir="$$s/gas"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) +@endif gas-bootstrap + +.PHONY: configure-stage2-gas maybe-configure-stage2-gas +maybe-configure-stage2-gas: +@if gas-bootstrap +maybe-configure-stage2-gas: configure-stage2-gas +configure-stage2-gas: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/gas ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gas"; \ + libsrcdir="$$s/gas"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) +@endif gas-bootstrap + +.PHONY: configure-stage3-gas maybe-configure-stage3-gas +maybe-configure-stage3-gas: +@if gas-bootstrap +maybe-configure-stage3-gas: configure-stage3-gas +configure-stage3-gas: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/gas ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gas"; \ + libsrcdir="$$s/gas"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) +@endif gas-bootstrap + +.PHONY: configure-stage4-gas maybe-configure-stage4-gas +maybe-configure-stage4-gas: +@if gas-bootstrap +maybe-configure-stage4-gas: configure-stage4-gas +configure-stage4-gas: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/gas ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gas"; \ + libsrcdir="$$s/gas"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) +@endif gas-bootstrap + +.PHONY: configure-stageprofile-gas maybe-configure-stageprofile-gas +maybe-configure-stageprofile-gas: +@if gas-bootstrap +maybe-configure-stageprofile-gas: configure-stageprofile-gas +configure-stageprofile-gas: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/gas ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gas"; \ + libsrcdir="$$s/gas"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) +@endif gas-bootstrap + +.PHONY: configure-stagefeedback-gas maybe-configure-stagefeedback-gas +maybe-configure-stagefeedback-gas: +@if gas-bootstrap +maybe-configure-stagefeedback-gas: configure-stagefeedback-gas +configure-stagefeedback-gas: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/gas ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gas"; \ + libsrcdir="$$s/gas"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) +@endif gas-bootstrap + + + + + +.PHONY: all-gas maybe-all-gas +maybe-all-gas: +@if gcc-bootstrap +all-gas: stage_current +@endif gcc-bootstrap +@if gas +TARGET-gas=all +maybe-all-gas: all-gas +all-gas: configure-gas + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-gas)) +@endif gas + + + +.PHONY: all-stage1-gas maybe-all-stage1-gas +.PHONY: clean-stage1-gas maybe-clean-stage1-gas +maybe-all-stage1-gas: +maybe-clean-stage1-gas: +@if gas-bootstrap +maybe-all-stage1-gas: all-stage1-gas +all-stage1: all-stage1-gas +TARGET-stage1-gas = $(TARGET-gas) +all-stage1-gas: configure-stage1-gas + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-gas) + +maybe-clean-stage1-gas: clean-stage1-gas +clean-stage1: clean-stage1-gas +clean-stage1-gas: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-gas/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif gas-bootstrap + + +.PHONY: all-stage2-gas maybe-all-stage2-gas +.PHONY: clean-stage2-gas maybe-clean-stage2-gas +maybe-all-stage2-gas: +maybe-clean-stage2-gas: +@if gas-bootstrap +maybe-all-stage2-gas: all-stage2-gas +all-stage2: all-stage2-gas +TARGET-stage2-gas = $(TARGET-gas) +all-stage2-gas: configure-stage2-gas + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-gas) + +maybe-clean-stage2-gas: clean-stage2-gas +clean-stage2: clean-stage2-gas +clean-stage2-gas: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-gas/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gas-bootstrap + + +.PHONY: all-stage3-gas maybe-all-stage3-gas +.PHONY: clean-stage3-gas maybe-clean-stage3-gas +maybe-all-stage3-gas: +maybe-clean-stage3-gas: +@if gas-bootstrap +maybe-all-stage3-gas: all-stage3-gas +all-stage3: all-stage3-gas +TARGET-stage3-gas = $(TARGET-gas) +all-stage3-gas: configure-stage3-gas + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-gas) + +maybe-clean-stage3-gas: clean-stage3-gas +clean-stage3: clean-stage3-gas +clean-stage3-gas: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-gas/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gas-bootstrap + + +.PHONY: all-stage4-gas maybe-all-stage4-gas +.PHONY: clean-stage4-gas maybe-clean-stage4-gas +maybe-all-stage4-gas: +maybe-clean-stage4-gas: +@if gas-bootstrap +maybe-all-stage4-gas: all-stage4-gas +all-stage4: all-stage4-gas +TARGET-stage4-gas = $(TARGET-gas) +all-stage4-gas: configure-stage4-gas + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-gas) + +maybe-clean-stage4-gas: clean-stage4-gas +clean-stage4: clean-stage4-gas +clean-stage4-gas: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-gas/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gas-bootstrap + + +.PHONY: all-stageprofile-gas maybe-all-stageprofile-gas +.PHONY: clean-stageprofile-gas maybe-clean-stageprofile-gas +maybe-all-stageprofile-gas: +maybe-clean-stageprofile-gas: +@if gas-bootstrap +maybe-all-stageprofile-gas: all-stageprofile-gas +all-stageprofile: all-stageprofile-gas +TARGET-stageprofile-gas = $(TARGET-gas) +all-stageprofile-gas: configure-stageprofile-gas + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-gas) + +maybe-clean-stageprofile-gas: clean-stageprofile-gas +clean-stageprofile: clean-stageprofile-gas +clean-stageprofile-gas: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-gas/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gas-bootstrap + + +.PHONY: all-stagefeedback-gas maybe-all-stagefeedback-gas +.PHONY: clean-stagefeedback-gas maybe-clean-stagefeedback-gas +maybe-all-stagefeedback-gas: +maybe-clean-stagefeedback-gas: +@if gas-bootstrap +maybe-all-stagefeedback-gas: all-stagefeedback-gas +all-stagefeedback: all-stagefeedback-gas +TARGET-stagefeedback-gas = $(TARGET-gas) +all-stagefeedback-gas: configure-stagefeedback-gas + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-gas) + +maybe-clean-stagefeedback-gas: clean-stagefeedback-gas +clean-stagefeedback: clean-stagefeedback-gas +clean-stagefeedback-gas: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-gas/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gas-bootstrap + + + + + +.PHONY: check-gas maybe-check-gas +maybe-check-gas: +@if gas +maybe-check-gas: check-gas + +check-gas: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif gas + +.PHONY: install-gas maybe-install-gas +maybe-install-gas: +@if gas +maybe-install-gas: install-gas + +install-gas: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif gas + +.PHONY: install-strip-gas maybe-install-strip-gas +maybe-install-strip-gas: +@if gas +maybe-install-strip-gas: install-strip-gas + +install-strip-gas: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif gas + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-gas info-gas +maybe-info-gas: +@if gas +maybe-info-gas: info-gas + +info-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif gas + +.PHONY: maybe-dvi-gas dvi-gas +maybe-dvi-gas: +@if gas +maybe-dvi-gas: dvi-gas + +dvi-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif gas + +.PHONY: maybe-pdf-gas pdf-gas +maybe-pdf-gas: +@if gas +maybe-pdf-gas: pdf-gas + +pdf-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif gas + +.PHONY: maybe-html-gas html-gas +maybe-html-gas: +@if gas +maybe-html-gas: html-gas + +html-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif gas + +.PHONY: maybe-TAGS-gas TAGS-gas +maybe-TAGS-gas: +@if gas +maybe-TAGS-gas: TAGS-gas + +TAGS-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif gas + +.PHONY: maybe-install-info-gas install-info-gas +maybe-install-info-gas: +@if gas +maybe-install-info-gas: install-info-gas + +install-info-gas: \ + configure-gas \ + info-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif gas + +.PHONY: maybe-install-pdf-gas install-pdf-gas +maybe-install-pdf-gas: +@if gas +maybe-install-pdf-gas: install-pdf-gas + +install-pdf-gas: \ + configure-gas \ + pdf-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif gas + +.PHONY: maybe-install-html-gas install-html-gas +maybe-install-html-gas: +@if gas +maybe-install-html-gas: install-html-gas + +install-html-gas: \ + configure-gas \ + html-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif gas + +.PHONY: maybe-installcheck-gas installcheck-gas +maybe-installcheck-gas: +@if gas +maybe-installcheck-gas: installcheck-gas + +installcheck-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif gas + +.PHONY: maybe-mostlyclean-gas mostlyclean-gas +maybe-mostlyclean-gas: +@if gas +maybe-mostlyclean-gas: mostlyclean-gas + +mostlyclean-gas: + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif gas + +.PHONY: maybe-clean-gas clean-gas +maybe-clean-gas: +@if gas +maybe-clean-gas: clean-gas + +clean-gas: + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif gas + +.PHONY: maybe-distclean-gas distclean-gas +maybe-distclean-gas: +@if gas +maybe-distclean-gas: distclean-gas + +distclean-gas: + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif gas + +.PHONY: maybe-maintainer-clean-gas maintainer-clean-gas +maybe-maintainer-clean-gas: +@if gas +maybe-maintainer-clean-gas: maintainer-clean-gas + +maintainer-clean-gas: + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif gas + + + +.PHONY: configure-gcc maybe-configure-gcc +maybe-configure-gcc: +@if gcc-bootstrap +configure-gcc: stage_current +@endif gcc-bootstrap +@if gcc +maybe-configure-gcc: configure-gcc +configure-gcc: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/gcc; \ + cd "$(HOST_SUBDIR)/gcc" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gcc"; \ + libsrcdir="$$s/gcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif gcc + + + +.PHONY: configure-stage1-gcc maybe-configure-stage1-gcc +maybe-configure-stage1-gcc: +@if gcc-bootstrap +maybe-configure-stage1-gcc: configure-stage1-gcc +configure-stage1-gcc: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/gcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gcc"; \ + libsrcdir="$$s/gcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) +@endif gcc-bootstrap + +.PHONY: configure-stage2-gcc maybe-configure-stage2-gcc +maybe-configure-stage2-gcc: +@if gcc-bootstrap +maybe-configure-stage2-gcc: configure-stage2-gcc +configure-stage2-gcc: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/gcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gcc"; \ + libsrcdir="$$s/gcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) +@endif gcc-bootstrap + +.PHONY: configure-stage3-gcc maybe-configure-stage3-gcc +maybe-configure-stage3-gcc: +@if gcc-bootstrap +maybe-configure-stage3-gcc: configure-stage3-gcc +configure-stage3-gcc: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/gcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gcc"; \ + libsrcdir="$$s/gcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) +@endif gcc-bootstrap + +.PHONY: configure-stage4-gcc maybe-configure-stage4-gcc +maybe-configure-stage4-gcc: +@if gcc-bootstrap +maybe-configure-stage4-gcc: configure-stage4-gcc +configure-stage4-gcc: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/gcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gcc"; \ + libsrcdir="$$s/gcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) +@endif gcc-bootstrap + +.PHONY: configure-stageprofile-gcc maybe-configure-stageprofile-gcc +maybe-configure-stageprofile-gcc: +@if gcc-bootstrap +maybe-configure-stageprofile-gcc: configure-stageprofile-gcc +configure-stageprofile-gcc: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/gcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gcc"; \ + libsrcdir="$$s/gcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) +@endif gcc-bootstrap + +.PHONY: configure-stagefeedback-gcc maybe-configure-stagefeedback-gcc +maybe-configure-stagefeedback-gcc: +@if gcc-bootstrap +maybe-configure-stagefeedback-gcc: configure-stagefeedback-gcc +configure-stagefeedback-gcc: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/gcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gcc"; \ + libsrcdir="$$s/gcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) +@endif gcc-bootstrap + + + + + +.PHONY: all-gcc maybe-all-gcc +maybe-all-gcc: +@if gcc-bootstrap +all-gcc: stage_current +@endif gcc-bootstrap +@if gcc +TARGET-gcc=all +maybe-all-gcc: all-gcc +all-gcc: configure-gcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS) \ + $(TARGET-gcc)) +@endif gcc + + + +.PHONY: all-stage1-gcc maybe-all-stage1-gcc +.PHONY: clean-stage1-gcc maybe-clean-stage1-gcc +maybe-all-stage1-gcc: +maybe-clean-stage1-gcc: +@if gcc-bootstrap +maybe-all-stage1-gcc: all-stage1-gcc +all-stage1: all-stage1-gcc +TARGET-stage1-gcc = $(TARGET-gcc) +all-stage1-gcc: configure-stage1-gcc + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-gcc) + +maybe-clean-stage1-gcc: clean-stage1-gcc +clean-stage1: clean-stage1-gcc +clean-stage1-gcc: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-gcc/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(EXTRA_GCC_FLAGS) clean +@endif gcc-bootstrap + + +.PHONY: all-stage2-gcc maybe-all-stage2-gcc +.PHONY: clean-stage2-gcc maybe-clean-stage2-gcc +maybe-all-stage2-gcc: +maybe-clean-stage2-gcc: +@if gcc-bootstrap +maybe-all-stage2-gcc: all-stage2-gcc +all-stage2: all-stage2-gcc +TARGET-stage2-gcc = $(TARGET-gcc) +all-stage2-gcc: configure-stage2-gcc + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-gcc) + +maybe-clean-stage2-gcc: clean-stage2-gcc +clean-stage2: clean-stage2-gcc +clean-stage2-gcc: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-gcc/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(EXTRA_GCC_FLAGS) clean +@endif gcc-bootstrap + + +.PHONY: all-stage3-gcc maybe-all-stage3-gcc +.PHONY: clean-stage3-gcc maybe-clean-stage3-gcc +maybe-all-stage3-gcc: +maybe-clean-stage3-gcc: +@if gcc-bootstrap +maybe-all-stage3-gcc: all-stage3-gcc +all-stage3: all-stage3-gcc +TARGET-stage3-gcc = $(TARGET-gcc) +all-stage3-gcc: configure-stage3-gcc + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-gcc) + +maybe-clean-stage3-gcc: clean-stage3-gcc +clean-stage3: clean-stage3-gcc +clean-stage3-gcc: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-gcc/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(EXTRA_GCC_FLAGS) clean +@endif gcc-bootstrap + + +.PHONY: all-stage4-gcc maybe-all-stage4-gcc +.PHONY: clean-stage4-gcc maybe-clean-stage4-gcc +maybe-all-stage4-gcc: +maybe-clean-stage4-gcc: +@if gcc-bootstrap +maybe-all-stage4-gcc: all-stage4-gcc +all-stage4: all-stage4-gcc +TARGET-stage4-gcc = $(TARGET-gcc) +all-stage4-gcc: configure-stage4-gcc + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-gcc) + +maybe-clean-stage4-gcc: clean-stage4-gcc +clean-stage4: clean-stage4-gcc +clean-stage4-gcc: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-gcc/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(EXTRA_GCC_FLAGS) clean +@endif gcc-bootstrap + + +.PHONY: all-stageprofile-gcc maybe-all-stageprofile-gcc +.PHONY: clean-stageprofile-gcc maybe-clean-stageprofile-gcc +maybe-all-stageprofile-gcc: +maybe-clean-stageprofile-gcc: +@if gcc-bootstrap +maybe-all-stageprofile-gcc: all-stageprofile-gcc +all-stageprofile: all-stageprofile-gcc +TARGET-stageprofile-gcc = $(TARGET-gcc) +all-stageprofile-gcc: configure-stageprofile-gcc + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-gcc) + +maybe-clean-stageprofile-gcc: clean-stageprofile-gcc +clean-stageprofile: clean-stageprofile-gcc +clean-stageprofile-gcc: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-gcc/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(EXTRA_GCC_FLAGS) clean +@endif gcc-bootstrap + + +.PHONY: all-stagefeedback-gcc maybe-all-stagefeedback-gcc +.PHONY: clean-stagefeedback-gcc maybe-clean-stagefeedback-gcc +maybe-all-stagefeedback-gcc: +maybe-clean-stagefeedback-gcc: +@if gcc-bootstrap +maybe-all-stagefeedback-gcc: all-stagefeedback-gcc +all-stagefeedback: all-stagefeedback-gcc +TARGET-stagefeedback-gcc = $(TARGET-gcc) +all-stagefeedback-gcc: configure-stagefeedback-gcc + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-gcc) + +maybe-clean-stagefeedback-gcc: clean-stagefeedback-gcc +clean-stagefeedback: clean-stagefeedback-gcc +clean-stagefeedback-gcc: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-gcc/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(EXTRA_GCC_FLAGS) clean +@endif gcc-bootstrap + + + + + +.PHONY: check-gcc maybe-check-gcc +maybe-check-gcc: +@if gcc +maybe-check-gcc: check-gcc + +check-gcc: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) check) + +@endif gcc + +.PHONY: install-gcc maybe-install-gcc +maybe-install-gcc: +@if gcc +maybe-install-gcc: install-gcc + +install-gcc: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) install) + +@endif gcc + +.PHONY: install-strip-gcc maybe-install-strip-gcc +maybe-install-strip-gcc: +@if gcc +maybe-install-strip-gcc: install-strip-gcc + +install-strip-gcc: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) install-strip) + +@endif gcc + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-gcc info-gcc +maybe-info-gcc: +@if gcc +maybe-info-gcc: info-gcc + +info-gcc: \ + configure-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif gcc + +.PHONY: maybe-dvi-gcc dvi-gcc +maybe-dvi-gcc: +@if gcc +maybe-dvi-gcc: dvi-gcc + +dvi-gcc: \ + configure-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif gcc + +.PHONY: maybe-pdf-gcc pdf-gcc +maybe-pdf-gcc: +@if gcc +maybe-pdf-gcc: pdf-gcc + +pdf-gcc: \ + configure-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif gcc + +.PHONY: maybe-html-gcc html-gcc +maybe-html-gcc: +@if gcc +maybe-html-gcc: html-gcc + +html-gcc: \ + configure-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif gcc + +.PHONY: maybe-TAGS-gcc TAGS-gcc +maybe-TAGS-gcc: +@if gcc +maybe-TAGS-gcc: TAGS-gcc + +TAGS-gcc: \ + configure-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif gcc + +.PHONY: maybe-install-info-gcc install-info-gcc +maybe-install-info-gcc: +@if gcc +maybe-install-info-gcc: install-info-gcc + +install-info-gcc: \ + configure-gcc \ + info-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif gcc + +.PHONY: maybe-install-pdf-gcc install-pdf-gcc +maybe-install-pdf-gcc: +@if gcc +maybe-install-pdf-gcc: install-pdf-gcc + +install-pdf-gcc: \ + configure-gcc \ + pdf-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif gcc + +.PHONY: maybe-install-html-gcc install-html-gcc +maybe-install-html-gcc: +@if gcc +maybe-install-html-gcc: install-html-gcc + +install-html-gcc: \ + configure-gcc \ + html-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif gcc + +.PHONY: maybe-installcheck-gcc installcheck-gcc +maybe-installcheck-gcc: +@if gcc +maybe-installcheck-gcc: installcheck-gcc + +installcheck-gcc: \ + configure-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif gcc + +.PHONY: maybe-mostlyclean-gcc mostlyclean-gcc +maybe-mostlyclean-gcc: +@if gcc +maybe-mostlyclean-gcc: mostlyclean-gcc + +mostlyclean-gcc: + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif gcc + +.PHONY: maybe-clean-gcc clean-gcc +maybe-clean-gcc: +@if gcc +maybe-clean-gcc: clean-gcc + +clean-gcc: + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif gcc + +.PHONY: maybe-distclean-gcc distclean-gcc +maybe-distclean-gcc: +@if gcc +maybe-distclean-gcc: distclean-gcc + +distclean-gcc: + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif gcc + +.PHONY: maybe-maintainer-clean-gcc maintainer-clean-gcc +maybe-maintainer-clean-gcc: +@if gcc +maybe-maintainer-clean-gcc: maintainer-clean-gcc + +maintainer-clean-gcc: + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif gcc + + + +.PHONY: configure-gmp maybe-configure-gmp +maybe-configure-gmp: +@if gcc-bootstrap +configure-gmp: stage_current +@endif gcc-bootstrap +@if gmp +maybe-configure-gmp: configure-gmp +configure-gmp: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/gmp; \ + cd "$(HOST_SUBDIR)/gmp" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} --disable-shared \ + || exit 1 +@endif gmp + + + +.PHONY: configure-stage1-gmp maybe-configure-stage1-gmp +maybe-configure-stage1-gmp: +@if gmp-bootstrap +maybe-configure-stage1-gmp: configure-stage1-gmp +configure-stage1-gmp: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) \ + --disable-shared +@endif gmp-bootstrap + +.PHONY: configure-stage2-gmp maybe-configure-stage2-gmp +maybe-configure-stage2-gmp: +@if gmp-bootstrap +maybe-configure-stage2-gmp: configure-stage2-gmp +configure-stage2-gmp: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) \ + --disable-shared +@endif gmp-bootstrap + +.PHONY: configure-stage3-gmp maybe-configure-stage3-gmp +maybe-configure-stage3-gmp: +@if gmp-bootstrap +maybe-configure-stage3-gmp: configure-stage3-gmp +configure-stage3-gmp: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) \ + --disable-shared +@endif gmp-bootstrap + +.PHONY: configure-stage4-gmp maybe-configure-stage4-gmp +maybe-configure-stage4-gmp: +@if gmp-bootstrap +maybe-configure-stage4-gmp: configure-stage4-gmp +configure-stage4-gmp: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) \ + --disable-shared +@endif gmp-bootstrap + +.PHONY: configure-stageprofile-gmp maybe-configure-stageprofile-gmp +maybe-configure-stageprofile-gmp: +@if gmp-bootstrap +maybe-configure-stageprofile-gmp: configure-stageprofile-gmp +configure-stageprofile-gmp: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) \ + --disable-shared +@endif gmp-bootstrap + +.PHONY: configure-stagefeedback-gmp maybe-configure-stagefeedback-gmp +maybe-configure-stagefeedback-gmp: +@if gmp-bootstrap +maybe-configure-stagefeedback-gmp: configure-stagefeedback-gmp +configure-stagefeedback-gmp: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) \ + --disable-shared +@endif gmp-bootstrap + + + + + +.PHONY: all-gmp maybe-all-gmp +maybe-all-gmp: +@if gcc-bootstrap +all-gmp: stage_current +@endif gcc-bootstrap +@if gmp +TARGET-gmp=all +maybe-all-gmp: all-gmp +all-gmp: configure-gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-gmp)) +@endif gmp + + + +.PHONY: all-stage1-gmp maybe-all-stage1-gmp +.PHONY: clean-stage1-gmp maybe-clean-stage1-gmp +maybe-all-stage1-gmp: +maybe-clean-stage1-gmp: +@if gmp-bootstrap +maybe-all-stage1-gmp: all-stage1-gmp +all-stage1: all-stage1-gmp +TARGET-stage1-gmp = $(TARGET-gmp) +all-stage1-gmp: configure-stage1-gmp + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-gmp) + +maybe-clean-stage1-gmp: clean-stage1-gmp +clean-stage1: clean-stage1-gmp +clean-stage1-gmp: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-gmp/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif gmp-bootstrap + + +.PHONY: all-stage2-gmp maybe-all-stage2-gmp +.PHONY: clean-stage2-gmp maybe-clean-stage2-gmp +maybe-all-stage2-gmp: +maybe-clean-stage2-gmp: +@if gmp-bootstrap +maybe-all-stage2-gmp: all-stage2-gmp +all-stage2: all-stage2-gmp +TARGET-stage2-gmp = $(TARGET-gmp) +all-stage2-gmp: configure-stage2-gmp + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-gmp) + +maybe-clean-stage2-gmp: clean-stage2-gmp +clean-stage2: clean-stage2-gmp +clean-stage2-gmp: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-gmp/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + +.PHONY: all-stage3-gmp maybe-all-stage3-gmp +.PHONY: clean-stage3-gmp maybe-clean-stage3-gmp +maybe-all-stage3-gmp: +maybe-clean-stage3-gmp: +@if gmp-bootstrap +maybe-all-stage3-gmp: all-stage3-gmp +all-stage3: all-stage3-gmp +TARGET-stage3-gmp = $(TARGET-gmp) +all-stage3-gmp: configure-stage3-gmp + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-gmp) + +maybe-clean-stage3-gmp: clean-stage3-gmp +clean-stage3: clean-stage3-gmp +clean-stage3-gmp: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-gmp/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + +.PHONY: all-stage4-gmp maybe-all-stage4-gmp +.PHONY: clean-stage4-gmp maybe-clean-stage4-gmp +maybe-all-stage4-gmp: +maybe-clean-stage4-gmp: +@if gmp-bootstrap +maybe-all-stage4-gmp: all-stage4-gmp +all-stage4: all-stage4-gmp +TARGET-stage4-gmp = $(TARGET-gmp) +all-stage4-gmp: configure-stage4-gmp + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-gmp) + +maybe-clean-stage4-gmp: clean-stage4-gmp +clean-stage4: clean-stage4-gmp +clean-stage4-gmp: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-gmp/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + +.PHONY: all-stageprofile-gmp maybe-all-stageprofile-gmp +.PHONY: clean-stageprofile-gmp maybe-clean-stageprofile-gmp +maybe-all-stageprofile-gmp: +maybe-clean-stageprofile-gmp: +@if gmp-bootstrap +maybe-all-stageprofile-gmp: all-stageprofile-gmp +all-stageprofile: all-stageprofile-gmp +TARGET-stageprofile-gmp = $(TARGET-gmp) +all-stageprofile-gmp: configure-stageprofile-gmp + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-gmp) + +maybe-clean-stageprofile-gmp: clean-stageprofile-gmp +clean-stageprofile: clean-stageprofile-gmp +clean-stageprofile-gmp: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-gmp/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + +.PHONY: all-stagefeedback-gmp maybe-all-stagefeedback-gmp +.PHONY: clean-stagefeedback-gmp maybe-clean-stagefeedback-gmp +maybe-all-stagefeedback-gmp: +maybe-clean-stagefeedback-gmp: +@if gmp-bootstrap +maybe-all-stagefeedback-gmp: all-stagefeedback-gmp +all-stagefeedback: all-stagefeedback-gmp +TARGET-stagefeedback-gmp = $(TARGET-gmp) +all-stagefeedback-gmp: configure-stagefeedback-gmp + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-gmp) + +maybe-clean-stagefeedback-gmp: clean-stagefeedback-gmp +clean-stagefeedback: clean-stagefeedback-gmp +clean-stagefeedback-gmp: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-gmp/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + + + + +.PHONY: check-gmp maybe-check-gmp +maybe-check-gmp: +@if gmp +maybe-check-gmp: check-gmp + +check-gmp: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif gmp + +.PHONY: install-gmp maybe-install-gmp +maybe-install-gmp: +@if gmp +maybe-install-gmp: install-gmp + +install-gmp: + +@endif gmp + +.PHONY: install-strip-gmp maybe-install-strip-gmp +maybe-install-strip-gmp: +@if gmp +maybe-install-strip-gmp: install-strip-gmp + +install-strip-gmp: + +@endif gmp + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-gmp info-gmp +maybe-info-gmp: +@if gmp +maybe-info-gmp: info-gmp + +info-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-dvi-gmp dvi-gmp +maybe-dvi-gmp: +@if gmp +maybe-dvi-gmp: dvi-gmp + +dvi-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-pdf-gmp pdf-gmp +maybe-pdf-gmp: +@if gmp +maybe-pdf-gmp: pdf-gmp + +pdf-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-html-gmp html-gmp +maybe-html-gmp: +@if gmp +maybe-html-gmp: html-gmp + +html-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-TAGS-gmp TAGS-gmp +maybe-TAGS-gmp: +@if gmp +maybe-TAGS-gmp: TAGS-gmp + +TAGS-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-install-info-gmp install-info-gmp +maybe-install-info-gmp: +@if gmp +maybe-install-info-gmp: install-info-gmp + +install-info-gmp: \ + configure-gmp \ + info-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-install-pdf-gmp install-pdf-gmp +maybe-install-pdf-gmp: +@if gmp +maybe-install-pdf-gmp: install-pdf-gmp + +install-pdf-gmp: \ + configure-gmp \ + pdf-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-install-html-gmp install-html-gmp +maybe-install-html-gmp: +@if gmp +maybe-install-html-gmp: install-html-gmp + +install-html-gmp: \ + configure-gmp \ + html-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-installcheck-gmp installcheck-gmp +maybe-installcheck-gmp: +@if gmp +maybe-installcheck-gmp: installcheck-gmp + +installcheck-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-mostlyclean-gmp mostlyclean-gmp +maybe-mostlyclean-gmp: +@if gmp +maybe-mostlyclean-gmp: mostlyclean-gmp + +mostlyclean-gmp: + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-clean-gmp clean-gmp +maybe-clean-gmp: +@if gmp +maybe-clean-gmp: clean-gmp + +clean-gmp: + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-distclean-gmp distclean-gmp +maybe-distclean-gmp: +@if gmp +maybe-distclean-gmp: distclean-gmp + +distclean-gmp: + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-maintainer-clean-gmp maintainer-clean-gmp +maybe-maintainer-clean-gmp: +@if gmp +maybe-maintainer-clean-gmp: maintainer-clean-gmp + +maintainer-clean-gmp: + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif gmp + + + +.PHONY: configure-mpfr maybe-configure-mpfr +maybe-configure-mpfr: +@if gcc-bootstrap +configure-mpfr: stage_current +@endif gcc-bootstrap +@if mpfr +maybe-configure-mpfr: configure-mpfr +configure-mpfr: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/mpfr; \ + cd "$(HOST_SUBDIR)/mpfr" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} --disable-shared @extra_mpfr_configure_flags@ \ + || exit 1 +@endif mpfr + + + +.PHONY: configure-stage1-mpfr maybe-configure-stage1-mpfr +maybe-configure-stage1-mpfr: +@if mpfr-bootstrap +maybe-configure-stage1-mpfr: configure-stage1-mpfr +configure-stage1-mpfr: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) \ + --disable-shared @extra_mpfr_configure_flags@ +@endif mpfr-bootstrap + +.PHONY: configure-stage2-mpfr maybe-configure-stage2-mpfr +maybe-configure-stage2-mpfr: +@if mpfr-bootstrap +maybe-configure-stage2-mpfr: configure-stage2-mpfr +configure-stage2-mpfr: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) \ + --disable-shared @extra_mpfr_configure_flags@ +@endif mpfr-bootstrap + +.PHONY: configure-stage3-mpfr maybe-configure-stage3-mpfr +maybe-configure-stage3-mpfr: +@if mpfr-bootstrap +maybe-configure-stage3-mpfr: configure-stage3-mpfr +configure-stage3-mpfr: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) \ + --disable-shared @extra_mpfr_configure_flags@ +@endif mpfr-bootstrap + +.PHONY: configure-stage4-mpfr maybe-configure-stage4-mpfr +maybe-configure-stage4-mpfr: +@if mpfr-bootstrap +maybe-configure-stage4-mpfr: configure-stage4-mpfr +configure-stage4-mpfr: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) \ + --disable-shared @extra_mpfr_configure_flags@ +@endif mpfr-bootstrap + +.PHONY: configure-stageprofile-mpfr maybe-configure-stageprofile-mpfr +maybe-configure-stageprofile-mpfr: +@if mpfr-bootstrap +maybe-configure-stageprofile-mpfr: configure-stageprofile-mpfr +configure-stageprofile-mpfr: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) \ + --disable-shared @extra_mpfr_configure_flags@ +@endif mpfr-bootstrap + +.PHONY: configure-stagefeedback-mpfr maybe-configure-stagefeedback-mpfr +maybe-configure-stagefeedback-mpfr: +@if mpfr-bootstrap +maybe-configure-stagefeedback-mpfr: configure-stagefeedback-mpfr +configure-stagefeedback-mpfr: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) \ + --disable-shared @extra_mpfr_configure_flags@ +@endif mpfr-bootstrap + + + + + +.PHONY: all-mpfr maybe-all-mpfr +maybe-all-mpfr: +@if gcc-bootstrap +all-mpfr: stage_current +@endif gcc-bootstrap +@if mpfr +TARGET-mpfr=all +maybe-all-mpfr: all-mpfr +all-mpfr: configure-mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-mpfr)) +@endif mpfr + + + +.PHONY: all-stage1-mpfr maybe-all-stage1-mpfr +.PHONY: clean-stage1-mpfr maybe-clean-stage1-mpfr +maybe-all-stage1-mpfr: +maybe-clean-stage1-mpfr: +@if mpfr-bootstrap +maybe-all-stage1-mpfr: all-stage1-mpfr +all-stage1: all-stage1-mpfr +TARGET-stage1-mpfr = $(TARGET-mpfr) +all-stage1-mpfr: configure-stage1-mpfr + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-mpfr) + +maybe-clean-stage1-mpfr: clean-stage1-mpfr +clean-stage1: clean-stage1-mpfr +clean-stage1-mpfr: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-mpfr/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif mpfr-bootstrap + + +.PHONY: all-stage2-mpfr maybe-all-stage2-mpfr +.PHONY: clean-stage2-mpfr maybe-clean-stage2-mpfr +maybe-all-stage2-mpfr: +maybe-clean-stage2-mpfr: +@if mpfr-bootstrap +maybe-all-stage2-mpfr: all-stage2-mpfr +all-stage2: all-stage2-mpfr +TARGET-stage2-mpfr = $(TARGET-mpfr) +all-stage2-mpfr: configure-stage2-mpfr + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-mpfr) + +maybe-clean-stage2-mpfr: clean-stage2-mpfr +clean-stage2: clean-stage2-mpfr +clean-stage2-mpfr: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-mpfr/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + +.PHONY: all-stage3-mpfr maybe-all-stage3-mpfr +.PHONY: clean-stage3-mpfr maybe-clean-stage3-mpfr +maybe-all-stage3-mpfr: +maybe-clean-stage3-mpfr: +@if mpfr-bootstrap +maybe-all-stage3-mpfr: all-stage3-mpfr +all-stage3: all-stage3-mpfr +TARGET-stage3-mpfr = $(TARGET-mpfr) +all-stage3-mpfr: configure-stage3-mpfr + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-mpfr) + +maybe-clean-stage3-mpfr: clean-stage3-mpfr +clean-stage3: clean-stage3-mpfr +clean-stage3-mpfr: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-mpfr/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + +.PHONY: all-stage4-mpfr maybe-all-stage4-mpfr +.PHONY: clean-stage4-mpfr maybe-clean-stage4-mpfr +maybe-all-stage4-mpfr: +maybe-clean-stage4-mpfr: +@if mpfr-bootstrap +maybe-all-stage4-mpfr: all-stage4-mpfr +all-stage4: all-stage4-mpfr +TARGET-stage4-mpfr = $(TARGET-mpfr) +all-stage4-mpfr: configure-stage4-mpfr + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-mpfr) + +maybe-clean-stage4-mpfr: clean-stage4-mpfr +clean-stage4: clean-stage4-mpfr +clean-stage4-mpfr: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-mpfr/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + +.PHONY: all-stageprofile-mpfr maybe-all-stageprofile-mpfr +.PHONY: clean-stageprofile-mpfr maybe-clean-stageprofile-mpfr +maybe-all-stageprofile-mpfr: +maybe-clean-stageprofile-mpfr: +@if mpfr-bootstrap +maybe-all-stageprofile-mpfr: all-stageprofile-mpfr +all-stageprofile: all-stageprofile-mpfr +TARGET-stageprofile-mpfr = $(TARGET-mpfr) +all-stageprofile-mpfr: configure-stageprofile-mpfr + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-mpfr) + +maybe-clean-stageprofile-mpfr: clean-stageprofile-mpfr +clean-stageprofile: clean-stageprofile-mpfr +clean-stageprofile-mpfr: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-mpfr/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + +.PHONY: all-stagefeedback-mpfr maybe-all-stagefeedback-mpfr +.PHONY: clean-stagefeedback-mpfr maybe-clean-stagefeedback-mpfr +maybe-all-stagefeedback-mpfr: +maybe-clean-stagefeedback-mpfr: +@if mpfr-bootstrap +maybe-all-stagefeedback-mpfr: all-stagefeedback-mpfr +all-stagefeedback: all-stagefeedback-mpfr +TARGET-stagefeedback-mpfr = $(TARGET-mpfr) +all-stagefeedback-mpfr: configure-stagefeedback-mpfr + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-mpfr) + +maybe-clean-stagefeedback-mpfr: clean-stagefeedback-mpfr +clean-stagefeedback: clean-stagefeedback-mpfr +clean-stagefeedback-mpfr: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-mpfr/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + + + + +.PHONY: check-mpfr maybe-check-mpfr +maybe-check-mpfr: +@if mpfr +maybe-check-mpfr: check-mpfr + +check-mpfr: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif mpfr + +.PHONY: install-mpfr maybe-install-mpfr +maybe-install-mpfr: +@if mpfr +maybe-install-mpfr: install-mpfr + +install-mpfr: + +@endif mpfr + +.PHONY: install-strip-mpfr maybe-install-strip-mpfr +maybe-install-strip-mpfr: +@if mpfr +maybe-install-strip-mpfr: install-strip-mpfr + +install-strip-mpfr: + +@endif mpfr + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-mpfr info-mpfr +maybe-info-mpfr: +@if mpfr +maybe-info-mpfr: info-mpfr + +info-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-dvi-mpfr dvi-mpfr +maybe-dvi-mpfr: +@if mpfr +maybe-dvi-mpfr: dvi-mpfr + +dvi-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-pdf-mpfr pdf-mpfr +maybe-pdf-mpfr: +@if mpfr +maybe-pdf-mpfr: pdf-mpfr + +pdf-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-html-mpfr html-mpfr +maybe-html-mpfr: +@if mpfr +maybe-html-mpfr: html-mpfr + +html-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-TAGS-mpfr TAGS-mpfr +maybe-TAGS-mpfr: +@if mpfr +maybe-TAGS-mpfr: TAGS-mpfr + +TAGS-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-install-info-mpfr install-info-mpfr +maybe-install-info-mpfr: +@if mpfr +maybe-install-info-mpfr: install-info-mpfr + +install-info-mpfr: \ + configure-mpfr \ + info-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-install-pdf-mpfr install-pdf-mpfr +maybe-install-pdf-mpfr: +@if mpfr +maybe-install-pdf-mpfr: install-pdf-mpfr + +install-pdf-mpfr: \ + configure-mpfr \ + pdf-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-install-html-mpfr install-html-mpfr +maybe-install-html-mpfr: +@if mpfr +maybe-install-html-mpfr: install-html-mpfr + +install-html-mpfr: \ + configure-mpfr \ + html-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-installcheck-mpfr installcheck-mpfr +maybe-installcheck-mpfr: +@if mpfr +maybe-installcheck-mpfr: installcheck-mpfr + +installcheck-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-mostlyclean-mpfr mostlyclean-mpfr +maybe-mostlyclean-mpfr: +@if mpfr +maybe-mostlyclean-mpfr: mostlyclean-mpfr + +mostlyclean-mpfr: + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-clean-mpfr clean-mpfr +maybe-clean-mpfr: +@if mpfr +maybe-clean-mpfr: clean-mpfr + +clean-mpfr: + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-distclean-mpfr distclean-mpfr +maybe-distclean-mpfr: +@if mpfr +maybe-distclean-mpfr: distclean-mpfr + +distclean-mpfr: + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-maintainer-clean-mpfr maintainer-clean-mpfr +maybe-maintainer-clean-mpfr: +@if mpfr +maybe-maintainer-clean-mpfr: maintainer-clean-mpfr + +maintainer-clean-mpfr: + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif mpfr + + + +.PHONY: configure-mpc maybe-configure-mpc +maybe-configure-mpc: +@if gcc-bootstrap +configure-mpc: stage_current +@endif gcc-bootstrap +@if mpc +maybe-configure-mpc: configure-mpc +configure-mpc: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpc/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpc ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/mpc; \ + cd "$(HOST_SUBDIR)/mpc" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpc"; \ + libsrcdir="$$s/mpc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} --disable-shared @extra_mpc_gmp_configure_flags@ @extra_mpc_mpfr_configure_flags@ \ + || exit 1 +@endif mpc + + + +.PHONY: configure-stage1-mpc maybe-configure-stage1-mpc +maybe-configure-stage1-mpc: +@if mpc-bootstrap +maybe-configure-stage1-mpc: configure-stage1-mpc +configure-stage1-mpc: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/mpc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/mpc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpc ; \ + cd $(HOST_SUBDIR)/mpc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpc"; \ + libsrcdir="$$s/mpc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) \ + --disable-shared @extra_mpc_gmp_configure_flags@ @extra_mpc_mpfr_configure_flags@ +@endif mpc-bootstrap + +.PHONY: configure-stage2-mpc maybe-configure-stage2-mpc +maybe-configure-stage2-mpc: +@if mpc-bootstrap +maybe-configure-stage2-mpc: configure-stage2-mpc +configure-stage2-mpc: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/mpc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/mpc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpc ; \ + cd $(HOST_SUBDIR)/mpc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpc"; \ + libsrcdir="$$s/mpc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) \ + --disable-shared @extra_mpc_gmp_configure_flags@ @extra_mpc_mpfr_configure_flags@ +@endif mpc-bootstrap + +.PHONY: configure-stage3-mpc maybe-configure-stage3-mpc +maybe-configure-stage3-mpc: +@if mpc-bootstrap +maybe-configure-stage3-mpc: configure-stage3-mpc +configure-stage3-mpc: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/mpc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/mpc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpc ; \ + cd $(HOST_SUBDIR)/mpc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpc"; \ + libsrcdir="$$s/mpc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) \ + --disable-shared @extra_mpc_gmp_configure_flags@ @extra_mpc_mpfr_configure_flags@ +@endif mpc-bootstrap + +.PHONY: configure-stage4-mpc maybe-configure-stage4-mpc +maybe-configure-stage4-mpc: +@if mpc-bootstrap +maybe-configure-stage4-mpc: configure-stage4-mpc +configure-stage4-mpc: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/mpc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/mpc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpc ; \ + cd $(HOST_SUBDIR)/mpc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpc"; \ + libsrcdir="$$s/mpc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) \ + --disable-shared @extra_mpc_gmp_configure_flags@ @extra_mpc_mpfr_configure_flags@ +@endif mpc-bootstrap + +.PHONY: configure-stageprofile-mpc maybe-configure-stageprofile-mpc +maybe-configure-stageprofile-mpc: +@if mpc-bootstrap +maybe-configure-stageprofile-mpc: configure-stageprofile-mpc +configure-stageprofile-mpc: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/mpc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/mpc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpc ; \ + cd $(HOST_SUBDIR)/mpc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpc"; \ + libsrcdir="$$s/mpc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) \ + --disable-shared @extra_mpc_gmp_configure_flags@ @extra_mpc_mpfr_configure_flags@ +@endif mpc-bootstrap + +.PHONY: configure-stagefeedback-mpc maybe-configure-stagefeedback-mpc +maybe-configure-stagefeedback-mpc: +@if mpc-bootstrap +maybe-configure-stagefeedback-mpc: configure-stagefeedback-mpc +configure-stagefeedback-mpc: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/mpc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/mpc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpc ; \ + cd $(HOST_SUBDIR)/mpc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpc"; \ + libsrcdir="$$s/mpc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) \ + --disable-shared @extra_mpc_gmp_configure_flags@ @extra_mpc_mpfr_configure_flags@ +@endif mpc-bootstrap + + + + + +.PHONY: all-mpc maybe-all-mpc +maybe-all-mpc: +@if gcc-bootstrap +all-mpc: stage_current +@endif gcc-bootstrap +@if mpc +TARGET-mpc=all +maybe-all-mpc: all-mpc +all-mpc: configure-mpc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-mpc)) +@endif mpc + + + +.PHONY: all-stage1-mpc maybe-all-stage1-mpc +.PHONY: clean-stage1-mpc maybe-clean-stage1-mpc +maybe-all-stage1-mpc: +maybe-clean-stage1-mpc: +@if mpc-bootstrap +maybe-all-stage1-mpc: all-stage1-mpc +all-stage1: all-stage1-mpc +TARGET-stage1-mpc = $(TARGET-mpc) +all-stage1-mpc: configure-stage1-mpc + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-mpc) + +maybe-clean-stage1-mpc: clean-stage1-mpc +clean-stage1: clean-stage1-mpc +clean-stage1-mpc: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/mpc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-mpc/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif mpc-bootstrap + + +.PHONY: all-stage2-mpc maybe-all-stage2-mpc +.PHONY: clean-stage2-mpc maybe-clean-stage2-mpc +maybe-all-stage2-mpc: +maybe-clean-stage2-mpc: +@if mpc-bootstrap +maybe-all-stage2-mpc: all-stage2-mpc +all-stage2: all-stage2-mpc +TARGET-stage2-mpc = $(TARGET-mpc) +all-stage2-mpc: configure-stage2-mpc + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-mpc) + +maybe-clean-stage2-mpc: clean-stage2-mpc +clean-stage2: clean-stage2-mpc +clean-stage2-mpc: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/mpc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-mpc/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpc-bootstrap + + +.PHONY: all-stage3-mpc maybe-all-stage3-mpc +.PHONY: clean-stage3-mpc maybe-clean-stage3-mpc +maybe-all-stage3-mpc: +maybe-clean-stage3-mpc: +@if mpc-bootstrap +maybe-all-stage3-mpc: all-stage3-mpc +all-stage3: all-stage3-mpc +TARGET-stage3-mpc = $(TARGET-mpc) +all-stage3-mpc: configure-stage3-mpc + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-mpc) + +maybe-clean-stage3-mpc: clean-stage3-mpc +clean-stage3: clean-stage3-mpc +clean-stage3-mpc: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/mpc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-mpc/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpc-bootstrap + + +.PHONY: all-stage4-mpc maybe-all-stage4-mpc +.PHONY: clean-stage4-mpc maybe-clean-stage4-mpc +maybe-all-stage4-mpc: +maybe-clean-stage4-mpc: +@if mpc-bootstrap +maybe-all-stage4-mpc: all-stage4-mpc +all-stage4: all-stage4-mpc +TARGET-stage4-mpc = $(TARGET-mpc) +all-stage4-mpc: configure-stage4-mpc + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-mpc) + +maybe-clean-stage4-mpc: clean-stage4-mpc +clean-stage4: clean-stage4-mpc +clean-stage4-mpc: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/mpc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-mpc/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpc-bootstrap + + +.PHONY: all-stageprofile-mpc maybe-all-stageprofile-mpc +.PHONY: clean-stageprofile-mpc maybe-clean-stageprofile-mpc +maybe-all-stageprofile-mpc: +maybe-clean-stageprofile-mpc: +@if mpc-bootstrap +maybe-all-stageprofile-mpc: all-stageprofile-mpc +all-stageprofile: all-stageprofile-mpc +TARGET-stageprofile-mpc = $(TARGET-mpc) +all-stageprofile-mpc: configure-stageprofile-mpc + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-mpc) + +maybe-clean-stageprofile-mpc: clean-stageprofile-mpc +clean-stageprofile: clean-stageprofile-mpc +clean-stageprofile-mpc: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/mpc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-mpc/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpc-bootstrap + + +.PHONY: all-stagefeedback-mpc maybe-all-stagefeedback-mpc +.PHONY: clean-stagefeedback-mpc maybe-clean-stagefeedback-mpc +maybe-all-stagefeedback-mpc: +maybe-clean-stagefeedback-mpc: +@if mpc-bootstrap +maybe-all-stagefeedback-mpc: all-stagefeedback-mpc +all-stagefeedback: all-stagefeedback-mpc +TARGET-stagefeedback-mpc = $(TARGET-mpc) +all-stagefeedback-mpc: configure-stagefeedback-mpc + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-mpc) + +maybe-clean-stagefeedback-mpc: clean-stagefeedback-mpc +clean-stagefeedback: clean-stagefeedback-mpc +clean-stagefeedback-mpc: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/mpc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-mpc/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpc-bootstrap + + + + + +.PHONY: check-mpc maybe-check-mpc +maybe-check-mpc: +@if mpc +maybe-check-mpc: check-mpc + +check-mpc: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif mpc + +.PHONY: install-mpc maybe-install-mpc +maybe-install-mpc: +@if mpc +maybe-install-mpc: install-mpc + +install-mpc: + +@endif mpc + +.PHONY: install-strip-mpc maybe-install-strip-mpc +maybe-install-strip-mpc: +@if mpc +maybe-install-strip-mpc: install-strip-mpc + +install-strip-mpc: + +@endif mpc + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-mpc info-mpc +maybe-info-mpc: +@if mpc +maybe-info-mpc: info-mpc + +info-mpc: \ + configure-mpc + @[ -f ./mpc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in mpc" ; \ + (cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif mpc + +.PHONY: maybe-dvi-mpc dvi-mpc +maybe-dvi-mpc: +@if mpc +maybe-dvi-mpc: dvi-mpc + +dvi-mpc: \ + configure-mpc + @[ -f ./mpc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in mpc" ; \ + (cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif mpc + +.PHONY: maybe-pdf-mpc pdf-mpc +maybe-pdf-mpc: +@if mpc +maybe-pdf-mpc: pdf-mpc + +pdf-mpc: \ + configure-mpc + @[ -f ./mpc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in mpc" ; \ + (cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif mpc + +.PHONY: maybe-html-mpc html-mpc +maybe-html-mpc: +@if mpc +maybe-html-mpc: html-mpc + +html-mpc: \ + configure-mpc + @[ -f ./mpc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in mpc" ; \ + (cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif mpc + +.PHONY: maybe-TAGS-mpc TAGS-mpc +maybe-TAGS-mpc: +@if mpc +maybe-TAGS-mpc: TAGS-mpc + +TAGS-mpc: \ + configure-mpc + @[ -f ./mpc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in mpc" ; \ + (cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif mpc + +.PHONY: maybe-install-info-mpc install-info-mpc +maybe-install-info-mpc: +@if mpc +maybe-install-info-mpc: install-info-mpc + +install-info-mpc: \ + configure-mpc \ + info-mpc + @[ -f ./mpc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in mpc" ; \ + (cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif mpc + +.PHONY: maybe-install-pdf-mpc install-pdf-mpc +maybe-install-pdf-mpc: +@if mpc +maybe-install-pdf-mpc: install-pdf-mpc + +install-pdf-mpc: \ + configure-mpc \ + pdf-mpc + @[ -f ./mpc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in mpc" ; \ + (cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif mpc + +.PHONY: maybe-install-html-mpc install-html-mpc +maybe-install-html-mpc: +@if mpc +maybe-install-html-mpc: install-html-mpc + +install-html-mpc: \ + configure-mpc \ + html-mpc + @[ -f ./mpc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in mpc" ; \ + (cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif mpc + +.PHONY: maybe-installcheck-mpc installcheck-mpc +maybe-installcheck-mpc: +@if mpc +maybe-installcheck-mpc: installcheck-mpc + +installcheck-mpc: \ + configure-mpc + @[ -f ./mpc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in mpc" ; \ + (cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif mpc + +.PHONY: maybe-mostlyclean-mpc mostlyclean-mpc +maybe-mostlyclean-mpc: +@if mpc +maybe-mostlyclean-mpc: mostlyclean-mpc + +mostlyclean-mpc: + @[ -f ./mpc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in mpc" ; \ + (cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif mpc + +.PHONY: maybe-clean-mpc clean-mpc +maybe-clean-mpc: +@if mpc +maybe-clean-mpc: clean-mpc + +clean-mpc: + @[ -f ./mpc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in mpc" ; \ + (cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif mpc + +.PHONY: maybe-distclean-mpc distclean-mpc +maybe-distclean-mpc: +@if mpc +maybe-distclean-mpc: distclean-mpc + +distclean-mpc: + @[ -f ./mpc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in mpc" ; \ + (cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif mpc + +.PHONY: maybe-maintainer-clean-mpc maintainer-clean-mpc +maybe-maintainer-clean-mpc: +@if mpc +maybe-maintainer-clean-mpc: maintainer-clean-mpc + +maintainer-clean-mpc: + @[ -f ./mpc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in mpc" ; \ + (cd $(HOST_SUBDIR)/mpc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif mpc + + + +.PHONY: configure-ppl maybe-configure-ppl +maybe-configure-ppl: +@if gcc-bootstrap +configure-ppl: stage_current +@endif gcc-bootstrap +@if ppl +maybe-configure-ppl: configure-ppl +configure-ppl: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/ppl/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ppl ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/ppl; \ + cd "$(HOST_SUBDIR)/ppl" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ppl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ppl"; \ + libsrcdir="$$s/ppl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} --disable-shared --with-libgmp-prefix=$$r/$(HOST_SUBDIR)/gmp/ --with-libgmpxx-prefix=$$r/$(HOST_SUBDIR)/gmp/ \ + || exit 1 +@endif ppl + + + +.PHONY: configure-stage1-ppl maybe-configure-stage1-ppl +maybe-configure-stage1-ppl: +@if ppl-bootstrap +maybe-configure-stage1-ppl: configure-stage1-ppl +configure-stage1-ppl: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ppl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/ppl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/ppl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ppl ; \ + cd $(HOST_SUBDIR)/ppl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ppl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ppl"; \ + libsrcdir="$$s/ppl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) \ + --disable-shared --with-libgmp-prefix=$$r/$(HOST_SUBDIR)/gmp/ --with-libgmpxx-prefix=$$r/$(HOST_SUBDIR)/gmp/ +@endif ppl-bootstrap + +.PHONY: configure-stage2-ppl maybe-configure-stage2-ppl +maybe-configure-stage2-ppl: +@if ppl-bootstrap +maybe-configure-stage2-ppl: configure-stage2-ppl +configure-stage2-ppl: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ppl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/ppl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/ppl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ppl ; \ + cd $(HOST_SUBDIR)/ppl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ppl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ppl"; \ + libsrcdir="$$s/ppl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) \ + --disable-shared --with-libgmp-prefix=$$r/$(HOST_SUBDIR)/gmp/ --with-libgmpxx-prefix=$$r/$(HOST_SUBDIR)/gmp/ +@endif ppl-bootstrap + +.PHONY: configure-stage3-ppl maybe-configure-stage3-ppl +maybe-configure-stage3-ppl: +@if ppl-bootstrap +maybe-configure-stage3-ppl: configure-stage3-ppl +configure-stage3-ppl: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ppl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/ppl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/ppl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ppl ; \ + cd $(HOST_SUBDIR)/ppl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ppl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ppl"; \ + libsrcdir="$$s/ppl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) \ + --disable-shared --with-libgmp-prefix=$$r/$(HOST_SUBDIR)/gmp/ --with-libgmpxx-prefix=$$r/$(HOST_SUBDIR)/gmp/ +@endif ppl-bootstrap + +.PHONY: configure-stage4-ppl maybe-configure-stage4-ppl +maybe-configure-stage4-ppl: +@if ppl-bootstrap +maybe-configure-stage4-ppl: configure-stage4-ppl +configure-stage4-ppl: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ppl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/ppl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/ppl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ppl ; \ + cd $(HOST_SUBDIR)/ppl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ppl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ppl"; \ + libsrcdir="$$s/ppl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) \ + --disable-shared --with-libgmp-prefix=$$r/$(HOST_SUBDIR)/gmp/ --with-libgmpxx-prefix=$$r/$(HOST_SUBDIR)/gmp/ +@endif ppl-bootstrap + +.PHONY: configure-stageprofile-ppl maybe-configure-stageprofile-ppl +maybe-configure-stageprofile-ppl: +@if ppl-bootstrap +maybe-configure-stageprofile-ppl: configure-stageprofile-ppl +configure-stageprofile-ppl: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ppl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/ppl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/ppl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ppl ; \ + cd $(HOST_SUBDIR)/ppl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ppl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ppl"; \ + libsrcdir="$$s/ppl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) \ + --disable-shared --with-libgmp-prefix=$$r/$(HOST_SUBDIR)/gmp/ --with-libgmpxx-prefix=$$r/$(HOST_SUBDIR)/gmp/ +@endif ppl-bootstrap + +.PHONY: configure-stagefeedback-ppl maybe-configure-stagefeedback-ppl +maybe-configure-stagefeedback-ppl: +@if ppl-bootstrap +maybe-configure-stagefeedback-ppl: configure-stagefeedback-ppl +configure-stagefeedback-ppl: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ppl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/ppl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/ppl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ppl ; \ + cd $(HOST_SUBDIR)/ppl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ppl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ppl"; \ + libsrcdir="$$s/ppl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) \ + --disable-shared --with-libgmp-prefix=$$r/$(HOST_SUBDIR)/gmp/ --with-libgmpxx-prefix=$$r/$(HOST_SUBDIR)/gmp/ +@endif ppl-bootstrap + + + + + +.PHONY: all-ppl maybe-all-ppl +maybe-all-ppl: +@if gcc-bootstrap +all-ppl: stage_current +@endif gcc-bootstrap +@if ppl +TARGET-ppl=all +maybe-all-ppl: all-ppl +all-ppl: configure-ppl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-ppl)) +@endif ppl + + + +.PHONY: all-stage1-ppl maybe-all-stage1-ppl +.PHONY: clean-stage1-ppl maybe-clean-stage1-ppl +maybe-all-stage1-ppl: +maybe-clean-stage1-ppl: +@if ppl-bootstrap +maybe-all-stage1-ppl: all-stage1-ppl +all-stage1: all-stage1-ppl +TARGET-stage1-ppl = $(TARGET-ppl) +all-stage1-ppl: configure-stage1-ppl + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-ppl) + +maybe-clean-stage1-ppl: clean-stage1-ppl +clean-stage1: clean-stage1-ppl +clean-stage1-ppl: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/ppl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-ppl/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif ppl-bootstrap + + +.PHONY: all-stage2-ppl maybe-all-stage2-ppl +.PHONY: clean-stage2-ppl maybe-clean-stage2-ppl +maybe-all-stage2-ppl: +maybe-clean-stage2-ppl: +@if ppl-bootstrap +maybe-all-stage2-ppl: all-stage2-ppl +all-stage2: all-stage2-ppl +TARGET-stage2-ppl = $(TARGET-ppl) +all-stage2-ppl: configure-stage2-ppl + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-ppl) + +maybe-clean-stage2-ppl: clean-stage2-ppl +clean-stage2: clean-stage2-ppl +clean-stage2-ppl: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/ppl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-ppl/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif ppl-bootstrap + + +.PHONY: all-stage3-ppl maybe-all-stage3-ppl +.PHONY: clean-stage3-ppl maybe-clean-stage3-ppl +maybe-all-stage3-ppl: +maybe-clean-stage3-ppl: +@if ppl-bootstrap +maybe-all-stage3-ppl: all-stage3-ppl +all-stage3: all-stage3-ppl +TARGET-stage3-ppl = $(TARGET-ppl) +all-stage3-ppl: configure-stage3-ppl + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-ppl) + +maybe-clean-stage3-ppl: clean-stage3-ppl +clean-stage3: clean-stage3-ppl +clean-stage3-ppl: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/ppl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-ppl/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif ppl-bootstrap + + +.PHONY: all-stage4-ppl maybe-all-stage4-ppl +.PHONY: clean-stage4-ppl maybe-clean-stage4-ppl +maybe-all-stage4-ppl: +maybe-clean-stage4-ppl: +@if ppl-bootstrap +maybe-all-stage4-ppl: all-stage4-ppl +all-stage4: all-stage4-ppl +TARGET-stage4-ppl = $(TARGET-ppl) +all-stage4-ppl: configure-stage4-ppl + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-ppl) + +maybe-clean-stage4-ppl: clean-stage4-ppl +clean-stage4: clean-stage4-ppl +clean-stage4-ppl: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/ppl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-ppl/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif ppl-bootstrap + + +.PHONY: all-stageprofile-ppl maybe-all-stageprofile-ppl +.PHONY: clean-stageprofile-ppl maybe-clean-stageprofile-ppl +maybe-all-stageprofile-ppl: +maybe-clean-stageprofile-ppl: +@if ppl-bootstrap +maybe-all-stageprofile-ppl: all-stageprofile-ppl +all-stageprofile: all-stageprofile-ppl +TARGET-stageprofile-ppl = $(TARGET-ppl) +all-stageprofile-ppl: configure-stageprofile-ppl + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-ppl) + +maybe-clean-stageprofile-ppl: clean-stageprofile-ppl +clean-stageprofile: clean-stageprofile-ppl +clean-stageprofile-ppl: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/ppl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-ppl/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif ppl-bootstrap + + +.PHONY: all-stagefeedback-ppl maybe-all-stagefeedback-ppl +.PHONY: clean-stagefeedback-ppl maybe-clean-stagefeedback-ppl +maybe-all-stagefeedback-ppl: +maybe-clean-stagefeedback-ppl: +@if ppl-bootstrap +maybe-all-stagefeedback-ppl: all-stagefeedback-ppl +all-stagefeedback: all-stagefeedback-ppl +TARGET-stagefeedback-ppl = $(TARGET-ppl) +all-stagefeedback-ppl: configure-stagefeedback-ppl + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-ppl) + +maybe-clean-stagefeedback-ppl: clean-stagefeedback-ppl +clean-stagefeedback: clean-stagefeedback-ppl +clean-stagefeedback-ppl: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/ppl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-ppl/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif ppl-bootstrap + + + + + +.PHONY: check-ppl maybe-check-ppl +maybe-check-ppl: +@if ppl +maybe-check-ppl: check-ppl + +check-ppl: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif ppl + +.PHONY: install-ppl maybe-install-ppl +maybe-install-ppl: +@if ppl +maybe-install-ppl: install-ppl + +install-ppl: + +@endif ppl + +.PHONY: install-strip-ppl maybe-install-strip-ppl +maybe-install-strip-ppl: +@if ppl +maybe-install-strip-ppl: install-strip-ppl + +install-strip-ppl: + +@endif ppl + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-ppl info-ppl +maybe-info-ppl: +@if ppl +maybe-info-ppl: info-ppl + +info-ppl: \ + configure-ppl + @[ -f ./ppl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in ppl" ; \ + (cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif ppl + +.PHONY: maybe-dvi-ppl dvi-ppl +maybe-dvi-ppl: +@if ppl +maybe-dvi-ppl: dvi-ppl + +dvi-ppl: \ + configure-ppl + @[ -f ./ppl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in ppl" ; \ + (cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif ppl + +.PHONY: maybe-pdf-ppl pdf-ppl +maybe-pdf-ppl: +@if ppl +maybe-pdf-ppl: pdf-ppl + +pdf-ppl: \ + configure-ppl + @[ -f ./ppl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in ppl" ; \ + (cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif ppl + +.PHONY: maybe-html-ppl html-ppl +maybe-html-ppl: +@if ppl +maybe-html-ppl: html-ppl + +html-ppl: \ + configure-ppl + @[ -f ./ppl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in ppl" ; \ + (cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif ppl + +.PHONY: maybe-TAGS-ppl TAGS-ppl +maybe-TAGS-ppl: +@if ppl +maybe-TAGS-ppl: TAGS-ppl + +TAGS-ppl: \ + configure-ppl + @[ -f ./ppl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in ppl" ; \ + (cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif ppl + +.PHONY: maybe-install-info-ppl install-info-ppl +maybe-install-info-ppl: +@if ppl +maybe-install-info-ppl: install-info-ppl + +install-info-ppl: \ + configure-ppl \ + info-ppl + @[ -f ./ppl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in ppl" ; \ + (cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif ppl + +.PHONY: maybe-install-pdf-ppl install-pdf-ppl +maybe-install-pdf-ppl: +@if ppl +maybe-install-pdf-ppl: install-pdf-ppl + +install-pdf-ppl: \ + configure-ppl \ + pdf-ppl + @[ -f ./ppl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in ppl" ; \ + (cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif ppl + +.PHONY: maybe-install-html-ppl install-html-ppl +maybe-install-html-ppl: +@if ppl +maybe-install-html-ppl: install-html-ppl + +install-html-ppl: \ + configure-ppl \ + html-ppl + @[ -f ./ppl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in ppl" ; \ + (cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif ppl + +.PHONY: maybe-installcheck-ppl installcheck-ppl +maybe-installcheck-ppl: +@if ppl +maybe-installcheck-ppl: installcheck-ppl + +installcheck-ppl: \ + configure-ppl + @[ -f ./ppl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in ppl" ; \ + (cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif ppl + +.PHONY: maybe-mostlyclean-ppl mostlyclean-ppl +maybe-mostlyclean-ppl: +@if ppl +maybe-mostlyclean-ppl: mostlyclean-ppl + +mostlyclean-ppl: + @[ -f ./ppl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in ppl" ; \ + (cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif ppl + +.PHONY: maybe-clean-ppl clean-ppl +maybe-clean-ppl: +@if ppl +maybe-clean-ppl: clean-ppl + +clean-ppl: + @[ -f ./ppl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in ppl" ; \ + (cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif ppl + +.PHONY: maybe-distclean-ppl distclean-ppl +maybe-distclean-ppl: +@if ppl +maybe-distclean-ppl: distclean-ppl + +distclean-ppl: + @[ -f ./ppl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in ppl" ; \ + (cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif ppl + +.PHONY: maybe-maintainer-clean-ppl maintainer-clean-ppl +maybe-maintainer-clean-ppl: +@if ppl +maybe-maintainer-clean-ppl: maintainer-clean-ppl + +maintainer-clean-ppl: + @[ -f ./ppl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in ppl" ; \ + (cd $(HOST_SUBDIR)/ppl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif ppl + + + +.PHONY: configure-cloog maybe-configure-cloog +maybe-configure-cloog: +@if gcc-bootstrap +configure-cloog: stage_current +@endif gcc-bootstrap +@if cloog +maybe-configure-cloog: configure-cloog +configure-cloog: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/cloog/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/cloog ; \ + $(HOST_EXPORTS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS ${HOST_PPLLIBS}"; export LDFLAGS; \ + echo Configuring in $(HOST_SUBDIR)/cloog; \ + cd "$(HOST_SUBDIR)/cloog" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/cloog/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/cloog"; \ + libsrcdir="$$s/cloog"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} --disable-shared --with-gmp-library=$$r/$(HOST_SUBDIR)/gmp/.libs --with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-bits=gmp --with-ppl \ + || exit 1 +@endif cloog + + + +.PHONY: configure-stage1-cloog maybe-configure-stage1-cloog +maybe-configure-stage1-cloog: +@if cloog-bootstrap +maybe-configure-stage1-cloog: configure-stage1-cloog +configure-stage1-cloog: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/cloog + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/cloog/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS ${HOST_PPLLIBS}"; export LDFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/cloog ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/cloog ; \ + cd $(HOST_SUBDIR)/cloog || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/cloog/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/cloog"; \ + libsrcdir="$$s/cloog"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) \ + --disable-shared --with-gmp-library=$$r/$(HOST_SUBDIR)/gmp/.libs --with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-bits=gmp --with-ppl +@endif cloog-bootstrap + +.PHONY: configure-stage2-cloog maybe-configure-stage2-cloog +maybe-configure-stage2-cloog: +@if cloog-bootstrap +maybe-configure-stage2-cloog: configure-stage2-cloog +configure-stage2-cloog: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/cloog + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/cloog/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS ${HOST_PPLLIBS}"; export LDFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/cloog ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/cloog ; \ + cd $(HOST_SUBDIR)/cloog || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/cloog/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/cloog"; \ + libsrcdir="$$s/cloog"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) \ + --disable-shared --with-gmp-library=$$r/$(HOST_SUBDIR)/gmp/.libs --with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-bits=gmp --with-ppl +@endif cloog-bootstrap + +.PHONY: configure-stage3-cloog maybe-configure-stage3-cloog +maybe-configure-stage3-cloog: +@if cloog-bootstrap +maybe-configure-stage3-cloog: configure-stage3-cloog +configure-stage3-cloog: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/cloog + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/cloog/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS ${HOST_PPLLIBS}"; export LDFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/cloog ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/cloog ; \ + cd $(HOST_SUBDIR)/cloog || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/cloog/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/cloog"; \ + libsrcdir="$$s/cloog"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) \ + --disable-shared --with-gmp-library=$$r/$(HOST_SUBDIR)/gmp/.libs --with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-bits=gmp --with-ppl +@endif cloog-bootstrap + +.PHONY: configure-stage4-cloog maybe-configure-stage4-cloog +maybe-configure-stage4-cloog: +@if cloog-bootstrap +maybe-configure-stage4-cloog: configure-stage4-cloog +configure-stage4-cloog: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/cloog + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/cloog/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS ${HOST_PPLLIBS}"; export LDFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/cloog ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/cloog ; \ + cd $(HOST_SUBDIR)/cloog || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/cloog/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/cloog"; \ + libsrcdir="$$s/cloog"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) \ + --disable-shared --with-gmp-library=$$r/$(HOST_SUBDIR)/gmp/.libs --with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-bits=gmp --with-ppl +@endif cloog-bootstrap + +.PHONY: configure-stageprofile-cloog maybe-configure-stageprofile-cloog +maybe-configure-stageprofile-cloog: +@if cloog-bootstrap +maybe-configure-stageprofile-cloog: configure-stageprofile-cloog +configure-stageprofile-cloog: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/cloog + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/cloog/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS ${HOST_PPLLIBS}"; export LDFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/cloog ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/cloog ; \ + cd $(HOST_SUBDIR)/cloog || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/cloog/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/cloog"; \ + libsrcdir="$$s/cloog"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) \ + --disable-shared --with-gmp-library=$$r/$(HOST_SUBDIR)/gmp/.libs --with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-bits=gmp --with-ppl +@endif cloog-bootstrap + +.PHONY: configure-stagefeedback-cloog maybe-configure-stagefeedback-cloog +maybe-configure-stagefeedback-cloog: +@if cloog-bootstrap +maybe-configure-stagefeedback-cloog: configure-stagefeedback-cloog +configure-stagefeedback-cloog: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/cloog + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/cloog/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS ${HOST_PPLLIBS}"; export LDFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/cloog ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/cloog ; \ + cd $(HOST_SUBDIR)/cloog || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/cloog/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/cloog"; \ + libsrcdir="$$s/cloog"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) \ + --disable-shared --with-gmp-library=$$r/$(HOST_SUBDIR)/gmp/.libs --with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-bits=gmp --with-ppl +@endif cloog-bootstrap + + + + + +.PHONY: all-cloog maybe-all-cloog +maybe-all-cloog: +@if gcc-bootstrap +all-cloog: stage_current +@endif gcc-bootstrap +@if cloog +TARGET-cloog=all +maybe-all-cloog: all-cloog +all-cloog: configure-cloog + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS ${HOST_PPLLIBS}"; export LDFLAGS; \ + (cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS" \ + $(TARGET-cloog)) +@endif cloog + + + +.PHONY: all-stage1-cloog maybe-all-stage1-cloog +.PHONY: clean-stage1-cloog maybe-clean-stage1-cloog +maybe-all-stage1-cloog: +maybe-clean-stage1-cloog: +@if cloog-bootstrap +maybe-all-stage1-cloog: all-stage1-cloog +all-stage1: all-stage1-cloog +TARGET-stage1-cloog = $(TARGET-cloog) +all-stage1-cloog: configure-stage1-cloog + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS ${HOST_PPLLIBS}"; export LDFLAGS; \ + cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS" \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-cloog) + +maybe-clean-stage1-cloog: clean-stage1-cloog +clean-stage1: clean-stage1-cloog +clean-stage1-cloog: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/cloog/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-cloog/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS" clean +@endif cloog-bootstrap + + +.PHONY: all-stage2-cloog maybe-all-stage2-cloog +.PHONY: clean-stage2-cloog maybe-clean-stage2-cloog +maybe-all-stage2-cloog: +maybe-clean-stage2-cloog: +@if cloog-bootstrap +maybe-all-stage2-cloog: all-stage2-cloog +all-stage2: all-stage2-cloog +TARGET-stage2-cloog = $(TARGET-cloog) +all-stage2-cloog: configure-stage2-cloog + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS ${HOST_PPLLIBS}"; export LDFLAGS; \ + cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS" \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-cloog) + +maybe-clean-stage2-cloog: clean-stage2-cloog +clean-stage2: clean-stage2-cloog +clean-stage2-cloog: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/cloog/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-cloog/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS" clean +@endif cloog-bootstrap + + +.PHONY: all-stage3-cloog maybe-all-stage3-cloog +.PHONY: clean-stage3-cloog maybe-clean-stage3-cloog +maybe-all-stage3-cloog: +maybe-clean-stage3-cloog: +@if cloog-bootstrap +maybe-all-stage3-cloog: all-stage3-cloog +all-stage3: all-stage3-cloog +TARGET-stage3-cloog = $(TARGET-cloog) +all-stage3-cloog: configure-stage3-cloog + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS ${HOST_PPLLIBS}"; export LDFLAGS; \ + cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS" \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-cloog) + +maybe-clean-stage3-cloog: clean-stage3-cloog +clean-stage3: clean-stage3-cloog +clean-stage3-cloog: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/cloog/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-cloog/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS" clean +@endif cloog-bootstrap + + +.PHONY: all-stage4-cloog maybe-all-stage4-cloog +.PHONY: clean-stage4-cloog maybe-clean-stage4-cloog +maybe-all-stage4-cloog: +maybe-clean-stage4-cloog: +@if cloog-bootstrap +maybe-all-stage4-cloog: all-stage4-cloog +all-stage4: all-stage4-cloog +TARGET-stage4-cloog = $(TARGET-cloog) +all-stage4-cloog: configure-stage4-cloog + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS ${HOST_PPLLIBS}"; export LDFLAGS; \ + cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS" \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-cloog) + +maybe-clean-stage4-cloog: clean-stage4-cloog +clean-stage4: clean-stage4-cloog +clean-stage4-cloog: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/cloog/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-cloog/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS" clean +@endif cloog-bootstrap + + +.PHONY: all-stageprofile-cloog maybe-all-stageprofile-cloog +.PHONY: clean-stageprofile-cloog maybe-clean-stageprofile-cloog +maybe-all-stageprofile-cloog: +maybe-clean-stageprofile-cloog: +@if cloog-bootstrap +maybe-all-stageprofile-cloog: all-stageprofile-cloog +all-stageprofile: all-stageprofile-cloog +TARGET-stageprofile-cloog = $(TARGET-cloog) +all-stageprofile-cloog: configure-stageprofile-cloog + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS ${HOST_PPLLIBS}"; export LDFLAGS; \ + cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS" \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-cloog) + +maybe-clean-stageprofile-cloog: clean-stageprofile-cloog +clean-stageprofile: clean-stageprofile-cloog +clean-stageprofile-cloog: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/cloog/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-cloog/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS" clean +@endif cloog-bootstrap + + +.PHONY: all-stagefeedback-cloog maybe-all-stagefeedback-cloog +.PHONY: clean-stagefeedback-cloog maybe-clean-stagefeedback-cloog +maybe-all-stagefeedback-cloog: +maybe-clean-stagefeedback-cloog: +@if cloog-bootstrap +maybe-all-stagefeedback-cloog: all-stagefeedback-cloog +all-stagefeedback: all-stagefeedback-cloog +TARGET-stagefeedback-cloog = $(TARGET-cloog) +all-stagefeedback-cloog: configure-stagefeedback-cloog + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS ${HOST_PPLLIBS}"; export LDFLAGS; \ + cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS" \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-cloog) + +maybe-clean-stagefeedback-cloog: clean-stagefeedback-cloog +clean-stagefeedback: clean-stagefeedback-cloog +clean-stagefeedback-cloog: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/cloog/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-cloog/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS" clean +@endif cloog-bootstrap + + + + + +.PHONY: check-cloog maybe-check-cloog +maybe-check-cloog: +@if cloog +maybe-check-cloog: check-cloog + +check-cloog: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(FLAGS_TO_PASS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS" check) + +@endif cloog + +.PHONY: install-cloog maybe-install-cloog +maybe-install-cloog: +@if cloog +maybe-install-cloog: install-cloog + +install-cloog: + +@endif cloog + +.PHONY: install-strip-cloog maybe-install-strip-cloog +maybe-install-strip-cloog: +@if cloog +maybe-install-strip-cloog: install-strip-cloog + +install-strip-cloog: + +@endif cloog + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-cloog info-cloog +maybe-info-cloog: +@if cloog +maybe-info-cloog: info-cloog + +info-cloog: \ + configure-cloog + @[ -f ./cloog/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS"; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in cloog" ; \ + (cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif cloog + +.PHONY: maybe-dvi-cloog dvi-cloog +maybe-dvi-cloog: +@if cloog +maybe-dvi-cloog: dvi-cloog + +dvi-cloog: \ + configure-cloog + @[ -f ./cloog/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS"; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in cloog" ; \ + (cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif cloog + +.PHONY: maybe-pdf-cloog pdf-cloog +maybe-pdf-cloog: +@if cloog +maybe-pdf-cloog: pdf-cloog + +pdf-cloog: \ + configure-cloog + @[ -f ./cloog/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS"; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in cloog" ; \ + (cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif cloog + +.PHONY: maybe-html-cloog html-cloog +maybe-html-cloog: +@if cloog +maybe-html-cloog: html-cloog + +html-cloog: \ + configure-cloog + @[ -f ./cloog/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS"; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in cloog" ; \ + (cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif cloog + +.PHONY: maybe-TAGS-cloog TAGS-cloog +maybe-TAGS-cloog: +@if cloog +maybe-TAGS-cloog: TAGS-cloog + +TAGS-cloog: \ + configure-cloog + @[ -f ./cloog/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS"; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in cloog" ; \ + (cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif cloog + +.PHONY: maybe-install-info-cloog install-info-cloog +maybe-install-info-cloog: +@if cloog +maybe-install-info-cloog: install-info-cloog + +install-info-cloog: \ + configure-cloog \ + info-cloog + @[ -f ./cloog/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS"; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in cloog" ; \ + (cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif cloog + +.PHONY: maybe-install-pdf-cloog install-pdf-cloog +maybe-install-pdf-cloog: +@if cloog +maybe-install-pdf-cloog: install-pdf-cloog + +install-pdf-cloog: \ + configure-cloog \ + pdf-cloog + @[ -f ./cloog/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS"; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in cloog" ; \ + (cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif cloog + +.PHONY: maybe-install-html-cloog install-html-cloog +maybe-install-html-cloog: +@if cloog +maybe-install-html-cloog: install-html-cloog + +install-html-cloog: \ + configure-cloog \ + html-cloog + @[ -f ./cloog/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS"; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in cloog" ; \ + (cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif cloog + +.PHONY: maybe-installcheck-cloog installcheck-cloog +maybe-installcheck-cloog: +@if cloog +maybe-installcheck-cloog: installcheck-cloog + +installcheck-cloog: \ + configure-cloog + @[ -f ./cloog/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS"; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in cloog" ; \ + (cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif cloog + +.PHONY: maybe-mostlyclean-cloog mostlyclean-cloog +maybe-mostlyclean-cloog: +@if cloog +maybe-mostlyclean-cloog: mostlyclean-cloog + +mostlyclean-cloog: + @[ -f ./cloog/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS"; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in cloog" ; \ + (cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif cloog + +.PHONY: maybe-clean-cloog clean-cloog +maybe-clean-cloog: +@if cloog +maybe-clean-cloog: clean-cloog + +clean-cloog: + @[ -f ./cloog/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS"; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in cloog" ; \ + (cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif cloog + +.PHONY: maybe-distclean-cloog distclean-cloog +maybe-distclean-cloog: +@if cloog +maybe-distclean-cloog: distclean-cloog + +distclean-cloog: + @[ -f ./cloog/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS"; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in cloog" ; \ + (cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif cloog + +.PHONY: maybe-maintainer-clean-cloog maintainer-clean-cloog +maybe-maintainer-clean-cloog: +@if cloog +maybe-maintainer-clean-cloog: maintainer-clean-cloog + +maintainer-clean-cloog: + @[ -f ./cloog/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS"; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in cloog" ; \ + (cd $(HOST_SUBDIR)/cloog && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif cloog + + + +.PHONY: configure-libelf maybe-configure-libelf +maybe-configure-libelf: +@if gcc-bootstrap +configure-libelf: stage_current +@endif gcc-bootstrap +@if libelf +maybe-configure-libelf: configure-libelf +configure-libelf: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/libelf; \ + cd "$(HOST_SUBDIR)/libelf" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libelf"; \ + libsrcdir="$$s/libelf"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} --disable-shared \ + || exit 1 +@endif libelf + + + +.PHONY: configure-stage1-libelf maybe-configure-stage1-libelf +maybe-configure-stage1-libelf: +@if libelf-bootstrap +maybe-configure-stage1-libelf: configure-stage1-libelf +configure-stage1-libelf: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/libelf ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf ; \ + cd $(HOST_SUBDIR)/libelf || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libelf"; \ + libsrcdir="$$s/libelf"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) \ + --disable-shared +@endif libelf-bootstrap + +.PHONY: configure-stage2-libelf maybe-configure-stage2-libelf +maybe-configure-stage2-libelf: +@if libelf-bootstrap +maybe-configure-stage2-libelf: configure-stage2-libelf +configure-stage2-libelf: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/libelf ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf ; \ + cd $(HOST_SUBDIR)/libelf || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libelf"; \ + libsrcdir="$$s/libelf"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) \ + --disable-shared +@endif libelf-bootstrap + +.PHONY: configure-stage3-libelf maybe-configure-stage3-libelf +maybe-configure-stage3-libelf: +@if libelf-bootstrap +maybe-configure-stage3-libelf: configure-stage3-libelf +configure-stage3-libelf: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/libelf ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf ; \ + cd $(HOST_SUBDIR)/libelf || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libelf"; \ + libsrcdir="$$s/libelf"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) \ + --disable-shared +@endif libelf-bootstrap + +.PHONY: configure-stage4-libelf maybe-configure-stage4-libelf +maybe-configure-stage4-libelf: +@if libelf-bootstrap +maybe-configure-stage4-libelf: configure-stage4-libelf +configure-stage4-libelf: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/libelf ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf ; \ + cd $(HOST_SUBDIR)/libelf || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libelf"; \ + libsrcdir="$$s/libelf"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) \ + --disable-shared +@endif libelf-bootstrap + +.PHONY: configure-stageprofile-libelf maybe-configure-stageprofile-libelf +maybe-configure-stageprofile-libelf: +@if libelf-bootstrap +maybe-configure-stageprofile-libelf: configure-stageprofile-libelf +configure-stageprofile-libelf: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/libelf ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf ; \ + cd $(HOST_SUBDIR)/libelf || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libelf"; \ + libsrcdir="$$s/libelf"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) \ + --disable-shared +@endif libelf-bootstrap + +.PHONY: configure-stagefeedback-libelf maybe-configure-stagefeedback-libelf +maybe-configure-stagefeedback-libelf: +@if libelf-bootstrap +maybe-configure-stagefeedback-libelf: configure-stagefeedback-libelf +configure-stagefeedback-libelf: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/libelf ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf ; \ + cd $(HOST_SUBDIR)/libelf || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libelf"; \ + libsrcdir="$$s/libelf"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) \ + --disable-shared +@endif libelf-bootstrap + + + + + +.PHONY: all-libelf maybe-all-libelf +maybe-all-libelf: +@if gcc-bootstrap +all-libelf: stage_current +@endif gcc-bootstrap +@if libelf +TARGET-libelf=all +maybe-all-libelf: all-libelf +all-libelf: configure-libelf + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-libelf)) +@endif libelf + + + +.PHONY: all-stage1-libelf maybe-all-stage1-libelf +.PHONY: clean-stage1-libelf maybe-clean-stage1-libelf +maybe-all-stage1-libelf: +maybe-clean-stage1-libelf: +@if libelf-bootstrap +maybe-all-stage1-libelf: all-stage1-libelf +all-stage1: all-stage1-libelf +TARGET-stage1-libelf = $(TARGET-libelf) +all-stage1-libelf: configure-stage1-libelf + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-libelf) + +maybe-clean-stage1-libelf: clean-stage1-libelf +clean-stage1: clean-stage1-libelf +clean-stage1-libelf: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/libelf/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-libelf/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif libelf-bootstrap + + +.PHONY: all-stage2-libelf maybe-all-stage2-libelf +.PHONY: clean-stage2-libelf maybe-clean-stage2-libelf +maybe-all-stage2-libelf: +maybe-clean-stage2-libelf: +@if libelf-bootstrap +maybe-all-stage2-libelf: all-stage2-libelf +all-stage2: all-stage2-libelf +TARGET-stage2-libelf = $(TARGET-libelf) +all-stage2-libelf: configure-stage2-libelf + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-libelf) + +maybe-clean-stage2-libelf: clean-stage2-libelf +clean-stage2: clean-stage2-libelf +clean-stage2-libelf: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/libelf/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-libelf/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libelf-bootstrap + + +.PHONY: all-stage3-libelf maybe-all-stage3-libelf +.PHONY: clean-stage3-libelf maybe-clean-stage3-libelf +maybe-all-stage3-libelf: +maybe-clean-stage3-libelf: +@if libelf-bootstrap +maybe-all-stage3-libelf: all-stage3-libelf +all-stage3: all-stage3-libelf +TARGET-stage3-libelf = $(TARGET-libelf) +all-stage3-libelf: configure-stage3-libelf + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-libelf) + +maybe-clean-stage3-libelf: clean-stage3-libelf +clean-stage3: clean-stage3-libelf +clean-stage3-libelf: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/libelf/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-libelf/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libelf-bootstrap + + +.PHONY: all-stage4-libelf maybe-all-stage4-libelf +.PHONY: clean-stage4-libelf maybe-clean-stage4-libelf +maybe-all-stage4-libelf: +maybe-clean-stage4-libelf: +@if libelf-bootstrap +maybe-all-stage4-libelf: all-stage4-libelf +all-stage4: all-stage4-libelf +TARGET-stage4-libelf = $(TARGET-libelf) +all-stage4-libelf: configure-stage4-libelf + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-libelf) + +maybe-clean-stage4-libelf: clean-stage4-libelf +clean-stage4: clean-stage4-libelf +clean-stage4-libelf: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/libelf/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-libelf/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libelf-bootstrap + + +.PHONY: all-stageprofile-libelf maybe-all-stageprofile-libelf +.PHONY: clean-stageprofile-libelf maybe-clean-stageprofile-libelf +maybe-all-stageprofile-libelf: +maybe-clean-stageprofile-libelf: +@if libelf-bootstrap +maybe-all-stageprofile-libelf: all-stageprofile-libelf +all-stageprofile: all-stageprofile-libelf +TARGET-stageprofile-libelf = $(TARGET-libelf) +all-stageprofile-libelf: configure-stageprofile-libelf + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-libelf) + +maybe-clean-stageprofile-libelf: clean-stageprofile-libelf +clean-stageprofile: clean-stageprofile-libelf +clean-stageprofile-libelf: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/libelf/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-libelf/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libelf-bootstrap + + +.PHONY: all-stagefeedback-libelf maybe-all-stagefeedback-libelf +.PHONY: clean-stagefeedback-libelf maybe-clean-stagefeedback-libelf +maybe-all-stagefeedback-libelf: +maybe-clean-stagefeedback-libelf: +@if libelf-bootstrap +maybe-all-stagefeedback-libelf: all-stagefeedback-libelf +all-stagefeedback: all-stagefeedback-libelf +TARGET-stagefeedback-libelf = $(TARGET-libelf) +all-stagefeedback-libelf: configure-stagefeedback-libelf + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-libelf) + +maybe-clean-stagefeedback-libelf: clean-stagefeedback-libelf +clean-stagefeedback: clean-stagefeedback-libelf +clean-stagefeedback-libelf: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/libelf/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-libelf/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libelf-bootstrap + + + + + +.PHONY: check-libelf maybe-check-libelf +maybe-check-libelf: +@if libelf +maybe-check-libelf: check-libelf + +check-libelf: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif libelf + +.PHONY: install-libelf maybe-install-libelf +maybe-install-libelf: +@if libelf +maybe-install-libelf: install-libelf + +install-libelf: + +@endif libelf + +.PHONY: install-strip-libelf maybe-install-strip-libelf +maybe-install-strip-libelf: +@if libelf +maybe-install-strip-libelf: install-strip-libelf + +install-strip-libelf: + +@endif libelf + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-libelf info-libelf +maybe-info-libelf: +@if libelf +maybe-info-libelf: info-libelf + +info-libelf: \ + configure-libelf + @[ -f ./libelf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in libelf" ; \ + (cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif libelf + +.PHONY: maybe-dvi-libelf dvi-libelf +maybe-dvi-libelf: +@if libelf +maybe-dvi-libelf: dvi-libelf + +dvi-libelf: \ + configure-libelf + @[ -f ./libelf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in libelf" ; \ + (cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif libelf + +.PHONY: maybe-pdf-libelf pdf-libelf +maybe-pdf-libelf: +@if libelf +maybe-pdf-libelf: pdf-libelf + +pdf-libelf: \ + configure-libelf + @[ -f ./libelf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libelf" ; \ + (cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif libelf + +.PHONY: maybe-html-libelf html-libelf +maybe-html-libelf: +@if libelf +maybe-html-libelf: html-libelf + +html-libelf: \ + configure-libelf + @[ -f ./libelf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in libelf" ; \ + (cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif libelf + +.PHONY: maybe-TAGS-libelf TAGS-libelf +maybe-TAGS-libelf: +@if libelf +maybe-TAGS-libelf: TAGS-libelf + +TAGS-libelf: \ + configure-libelf + @[ -f ./libelf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in libelf" ; \ + (cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif libelf + +.PHONY: maybe-install-info-libelf install-info-libelf +maybe-install-info-libelf: +@if libelf +maybe-install-info-libelf: install-info-libelf + +install-info-libelf: \ + configure-libelf \ + info-libelf + @[ -f ./libelf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in libelf" ; \ + (cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif libelf + +.PHONY: maybe-install-pdf-libelf install-pdf-libelf +maybe-install-pdf-libelf: +@if libelf +maybe-install-pdf-libelf: install-pdf-libelf + +install-pdf-libelf: \ + configure-libelf \ + pdf-libelf + @[ -f ./libelf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libelf" ; \ + (cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif libelf + +.PHONY: maybe-install-html-libelf install-html-libelf +maybe-install-html-libelf: +@if libelf +maybe-install-html-libelf: install-html-libelf + +install-html-libelf: \ + configure-libelf \ + html-libelf + @[ -f ./libelf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in libelf" ; \ + (cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif libelf + +.PHONY: maybe-installcheck-libelf installcheck-libelf +maybe-installcheck-libelf: +@if libelf +maybe-installcheck-libelf: installcheck-libelf + +installcheck-libelf: \ + configure-libelf + @[ -f ./libelf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in libelf" ; \ + (cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif libelf + +.PHONY: maybe-mostlyclean-libelf mostlyclean-libelf +maybe-mostlyclean-libelf: +@if libelf +maybe-mostlyclean-libelf: mostlyclean-libelf + +mostlyclean-libelf: + @[ -f ./libelf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in libelf" ; \ + (cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif libelf + +.PHONY: maybe-clean-libelf clean-libelf +maybe-clean-libelf: +@if libelf +maybe-clean-libelf: clean-libelf + +clean-libelf: + @[ -f ./libelf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in libelf" ; \ + (cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif libelf + +.PHONY: maybe-distclean-libelf distclean-libelf +maybe-distclean-libelf: +@if libelf +maybe-distclean-libelf: distclean-libelf + +distclean-libelf: + @[ -f ./libelf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in libelf" ; \ + (cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif libelf + +.PHONY: maybe-maintainer-clean-libelf maintainer-clean-libelf +maybe-maintainer-clean-libelf: +@if libelf +maybe-maintainer-clean-libelf: maintainer-clean-libelf + +maintainer-clean-libelf: + @[ -f ./libelf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in libelf" ; \ + (cd $(HOST_SUBDIR)/libelf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif libelf + + + +.PHONY: configure-gold maybe-configure-gold +maybe-configure-gold: +@if gcc-bootstrap +configure-gold: stage_current +@endif gcc-bootstrap +@if gold +maybe-configure-gold: configure-gold +configure-gold: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gold/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gold ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/gold; \ + cd "$(HOST_SUBDIR)/gold" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gold/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gold"; \ + libsrcdir="$$s/gold"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif gold + + + +.PHONY: configure-stage1-gold maybe-configure-stage1-gold +maybe-configure-stage1-gold: +@if gold-bootstrap +maybe-configure-stage1-gold: configure-stage1-gold +configure-stage1-gold: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gold + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gold/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/gold ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gold ; \ + cd $(HOST_SUBDIR)/gold || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gold/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gold"; \ + libsrcdir="$$s/gold"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) +@endif gold-bootstrap + +.PHONY: configure-stage2-gold maybe-configure-stage2-gold +maybe-configure-stage2-gold: +@if gold-bootstrap +maybe-configure-stage2-gold: configure-stage2-gold +configure-stage2-gold: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gold + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gold/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/gold ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gold ; \ + cd $(HOST_SUBDIR)/gold || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gold/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gold"; \ + libsrcdir="$$s/gold"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) +@endif gold-bootstrap + +.PHONY: configure-stage3-gold maybe-configure-stage3-gold +maybe-configure-stage3-gold: +@if gold-bootstrap +maybe-configure-stage3-gold: configure-stage3-gold +configure-stage3-gold: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gold + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gold/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/gold ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gold ; \ + cd $(HOST_SUBDIR)/gold || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gold/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gold"; \ + libsrcdir="$$s/gold"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) +@endif gold-bootstrap + +.PHONY: configure-stage4-gold maybe-configure-stage4-gold +maybe-configure-stage4-gold: +@if gold-bootstrap +maybe-configure-stage4-gold: configure-stage4-gold +configure-stage4-gold: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gold + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gold/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/gold ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gold ; \ + cd $(HOST_SUBDIR)/gold || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gold/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gold"; \ + libsrcdir="$$s/gold"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) +@endif gold-bootstrap + +.PHONY: configure-stageprofile-gold maybe-configure-stageprofile-gold +maybe-configure-stageprofile-gold: +@if gold-bootstrap +maybe-configure-stageprofile-gold: configure-stageprofile-gold +configure-stageprofile-gold: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gold + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gold/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/gold ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gold ; \ + cd $(HOST_SUBDIR)/gold || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gold/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gold"; \ + libsrcdir="$$s/gold"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) +@endif gold-bootstrap + +.PHONY: configure-stagefeedback-gold maybe-configure-stagefeedback-gold +maybe-configure-stagefeedback-gold: +@if gold-bootstrap +maybe-configure-stagefeedback-gold: configure-stagefeedback-gold +configure-stagefeedback-gold: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gold + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/gold/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/gold ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gold ; \ + cd $(HOST_SUBDIR)/gold || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gold/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gold"; \ + libsrcdir="$$s/gold"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) +@endif gold-bootstrap + + + + + +.PHONY: all-gold maybe-all-gold +maybe-all-gold: +@if gcc-bootstrap +all-gold: stage_current +@endif gcc-bootstrap +@if gold +TARGET-gold=all +maybe-all-gold: all-gold +all-gold: configure-gold + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-gold)) +@endif gold + + + +.PHONY: all-stage1-gold maybe-all-stage1-gold +.PHONY: clean-stage1-gold maybe-clean-stage1-gold +maybe-all-stage1-gold: +maybe-clean-stage1-gold: +@if gold-bootstrap +maybe-all-stage1-gold: all-stage1-gold +all-stage1: all-stage1-gold +TARGET-stage1-gold = $(TARGET-gold) +all-stage1-gold: configure-stage1-gold + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-gold) + +maybe-clean-stage1-gold: clean-stage1-gold +clean-stage1: clean-stage1-gold +clean-stage1-gold: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/gold/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-gold/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif gold-bootstrap + + +.PHONY: all-stage2-gold maybe-all-stage2-gold +.PHONY: clean-stage2-gold maybe-clean-stage2-gold +maybe-all-stage2-gold: +maybe-clean-stage2-gold: +@if gold-bootstrap +maybe-all-stage2-gold: all-stage2-gold +all-stage2: all-stage2-gold +TARGET-stage2-gold = $(TARGET-gold) +all-stage2-gold: configure-stage2-gold + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-gold) + +maybe-clean-stage2-gold: clean-stage2-gold +clean-stage2: clean-stage2-gold +clean-stage2-gold: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/gold/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-gold/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gold-bootstrap + + +.PHONY: all-stage3-gold maybe-all-stage3-gold +.PHONY: clean-stage3-gold maybe-clean-stage3-gold +maybe-all-stage3-gold: +maybe-clean-stage3-gold: +@if gold-bootstrap +maybe-all-stage3-gold: all-stage3-gold +all-stage3: all-stage3-gold +TARGET-stage3-gold = $(TARGET-gold) +all-stage3-gold: configure-stage3-gold + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-gold) + +maybe-clean-stage3-gold: clean-stage3-gold +clean-stage3: clean-stage3-gold +clean-stage3-gold: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/gold/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-gold/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gold-bootstrap + + +.PHONY: all-stage4-gold maybe-all-stage4-gold +.PHONY: clean-stage4-gold maybe-clean-stage4-gold +maybe-all-stage4-gold: +maybe-clean-stage4-gold: +@if gold-bootstrap +maybe-all-stage4-gold: all-stage4-gold +all-stage4: all-stage4-gold +TARGET-stage4-gold = $(TARGET-gold) +all-stage4-gold: configure-stage4-gold + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-gold) + +maybe-clean-stage4-gold: clean-stage4-gold +clean-stage4: clean-stage4-gold +clean-stage4-gold: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/gold/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-gold/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gold-bootstrap + + +.PHONY: all-stageprofile-gold maybe-all-stageprofile-gold +.PHONY: clean-stageprofile-gold maybe-clean-stageprofile-gold +maybe-all-stageprofile-gold: +maybe-clean-stageprofile-gold: +@if gold-bootstrap +maybe-all-stageprofile-gold: all-stageprofile-gold +all-stageprofile: all-stageprofile-gold +TARGET-stageprofile-gold = $(TARGET-gold) +all-stageprofile-gold: configure-stageprofile-gold + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-gold) + +maybe-clean-stageprofile-gold: clean-stageprofile-gold +clean-stageprofile: clean-stageprofile-gold +clean-stageprofile-gold: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/gold/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-gold/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gold-bootstrap + + +.PHONY: all-stagefeedback-gold maybe-all-stagefeedback-gold +.PHONY: clean-stagefeedback-gold maybe-clean-stagefeedback-gold +maybe-all-stagefeedback-gold: +maybe-clean-stagefeedback-gold: +@if gold-bootstrap +maybe-all-stagefeedback-gold: all-stagefeedback-gold +all-stagefeedback: all-stagefeedback-gold +TARGET-stagefeedback-gold = $(TARGET-gold) +all-stagefeedback-gold: configure-stagefeedback-gold + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-gold) + +maybe-clean-stagefeedback-gold: clean-stagefeedback-gold +clean-stagefeedback: clean-stagefeedback-gold +clean-stagefeedback-gold: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/gold/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-gold/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gold-bootstrap + + + + + +.PHONY: check-gold maybe-check-gold +maybe-check-gold: +@if gold +maybe-check-gold: check-gold + +check-gold: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif gold + +.PHONY: install-gold maybe-install-gold +maybe-install-gold: +@if gold +maybe-install-gold: install-gold + +install-gold: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif gold + +.PHONY: install-strip-gold maybe-install-strip-gold +maybe-install-strip-gold: +@if gold +maybe-install-strip-gold: install-strip-gold + +install-strip-gold: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif gold + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-gold info-gold +maybe-info-gold: +@if gold +maybe-info-gold: info-gold + +info-gold: \ + configure-gold + @[ -f ./gold/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gold" ; \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif gold + +.PHONY: maybe-dvi-gold dvi-gold +maybe-dvi-gold: +@if gold +maybe-dvi-gold: dvi-gold + +dvi-gold: \ + configure-gold + @[ -f ./gold/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gold" ; \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif gold + +.PHONY: maybe-pdf-gold pdf-gold +maybe-pdf-gold: +@if gold +maybe-pdf-gold: pdf-gold + +pdf-gold: \ + configure-gold + @[ -f ./gold/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gold" ; \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif gold + +.PHONY: maybe-html-gold html-gold +maybe-html-gold: +@if gold +maybe-html-gold: html-gold + +html-gold: \ + configure-gold + @[ -f ./gold/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in gold" ; \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif gold + +.PHONY: maybe-TAGS-gold TAGS-gold +maybe-TAGS-gold: +@if gold +maybe-TAGS-gold: TAGS-gold + +TAGS-gold: \ + configure-gold + @[ -f ./gold/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gold" ; \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif gold + +.PHONY: maybe-install-info-gold install-info-gold +maybe-install-info-gold: +@if gold +maybe-install-info-gold: install-info-gold + +install-info-gold: \ + configure-gold \ + info-gold + @[ -f ./gold/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gold" ; \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif gold + +.PHONY: maybe-install-pdf-gold install-pdf-gold +maybe-install-pdf-gold: +@if gold +maybe-install-pdf-gold: install-pdf-gold + +install-pdf-gold: \ + configure-gold \ + pdf-gold + @[ -f ./gold/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gold" ; \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif gold + +.PHONY: maybe-install-html-gold install-html-gold +maybe-install-html-gold: +@if gold +maybe-install-html-gold: install-html-gold + +install-html-gold: \ + configure-gold \ + html-gold + @[ -f ./gold/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in gold" ; \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif gold + +.PHONY: maybe-installcheck-gold installcheck-gold +maybe-installcheck-gold: +@if gold +maybe-installcheck-gold: installcheck-gold + +installcheck-gold: \ + configure-gold + @[ -f ./gold/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gold" ; \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif gold + +.PHONY: maybe-mostlyclean-gold mostlyclean-gold +maybe-mostlyclean-gold: +@if gold +maybe-mostlyclean-gold: mostlyclean-gold + +mostlyclean-gold: + @[ -f ./gold/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gold" ; \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif gold + +.PHONY: maybe-clean-gold clean-gold +maybe-clean-gold: +@if gold +maybe-clean-gold: clean-gold + +clean-gold: + @[ -f ./gold/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gold" ; \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif gold + +.PHONY: maybe-distclean-gold distclean-gold +maybe-distclean-gold: +@if gold +maybe-distclean-gold: distclean-gold + +distclean-gold: + @[ -f ./gold/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gold" ; \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif gold + +.PHONY: maybe-maintainer-clean-gold maintainer-clean-gold +maybe-maintainer-clean-gold: +@if gold +maybe-maintainer-clean-gold: maintainer-clean-gold + +maintainer-clean-gold: + @[ -f ./gold/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gold" ; \ + (cd $(HOST_SUBDIR)/gold && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif gold + + + +.PHONY: configure-gprof maybe-configure-gprof +maybe-configure-gprof: +@if gcc-bootstrap +configure-gprof: stage_current +@endif gcc-bootstrap +@if gprof +maybe-configure-gprof: configure-gprof +configure-gprof: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gprof/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gprof ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/gprof; \ + cd "$(HOST_SUBDIR)/gprof" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gprof/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gprof"; \ + libsrcdir="$$s/gprof"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif gprof + + + + + +.PHONY: all-gprof maybe-all-gprof +maybe-all-gprof: +@if gcc-bootstrap +all-gprof: stage_current +@endif gcc-bootstrap +@if gprof +TARGET-gprof=all +maybe-all-gprof: all-gprof +all-gprof: configure-gprof + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-gprof)) +@endif gprof + + + + +.PHONY: check-gprof maybe-check-gprof +maybe-check-gprof: +@if gprof +maybe-check-gprof: check-gprof + +check-gprof: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif gprof + +.PHONY: install-gprof maybe-install-gprof +maybe-install-gprof: +@if gprof +maybe-install-gprof: install-gprof + +install-gprof: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif gprof + +.PHONY: install-strip-gprof maybe-install-strip-gprof +maybe-install-strip-gprof: +@if gprof +maybe-install-strip-gprof: install-strip-gprof + +install-strip-gprof: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif gprof + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-gprof info-gprof +maybe-info-gprof: +@if gprof +maybe-info-gprof: info-gprof + +info-gprof: \ + configure-gprof + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif gprof + +.PHONY: maybe-dvi-gprof dvi-gprof +maybe-dvi-gprof: +@if gprof +maybe-dvi-gprof: dvi-gprof + +dvi-gprof: \ + configure-gprof + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif gprof + +.PHONY: maybe-pdf-gprof pdf-gprof +maybe-pdf-gprof: +@if gprof +maybe-pdf-gprof: pdf-gprof + +pdf-gprof: \ + configure-gprof + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif gprof + +.PHONY: maybe-html-gprof html-gprof +maybe-html-gprof: +@if gprof +maybe-html-gprof: html-gprof + +html-gprof: \ + configure-gprof + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif gprof + +.PHONY: maybe-TAGS-gprof TAGS-gprof +maybe-TAGS-gprof: +@if gprof +maybe-TAGS-gprof: TAGS-gprof + +TAGS-gprof: \ + configure-gprof + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif gprof + +.PHONY: maybe-install-info-gprof install-info-gprof +maybe-install-info-gprof: +@if gprof +maybe-install-info-gprof: install-info-gprof + +install-info-gprof: \ + configure-gprof \ + info-gprof + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif gprof + +.PHONY: maybe-install-pdf-gprof install-pdf-gprof +maybe-install-pdf-gprof: +@if gprof +maybe-install-pdf-gprof: install-pdf-gprof + +install-pdf-gprof: \ + configure-gprof \ + pdf-gprof + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif gprof + +.PHONY: maybe-install-html-gprof install-html-gprof +maybe-install-html-gprof: +@if gprof +maybe-install-html-gprof: install-html-gprof + +install-html-gprof: \ + configure-gprof \ + html-gprof + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif gprof + +.PHONY: maybe-installcheck-gprof installcheck-gprof +maybe-installcheck-gprof: +@if gprof +maybe-installcheck-gprof: installcheck-gprof + +installcheck-gprof: \ + configure-gprof + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif gprof + +.PHONY: maybe-mostlyclean-gprof mostlyclean-gprof +maybe-mostlyclean-gprof: +@if gprof +maybe-mostlyclean-gprof: mostlyclean-gprof + +mostlyclean-gprof: + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif gprof + +.PHONY: maybe-clean-gprof clean-gprof +maybe-clean-gprof: +@if gprof +maybe-clean-gprof: clean-gprof + +clean-gprof: + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif gprof + +.PHONY: maybe-distclean-gprof distclean-gprof +maybe-distclean-gprof: +@if gprof +maybe-distclean-gprof: distclean-gprof + +distclean-gprof: + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif gprof + +.PHONY: maybe-maintainer-clean-gprof maintainer-clean-gprof +maybe-maintainer-clean-gprof: +@if gprof +maybe-maintainer-clean-gprof: maintainer-clean-gprof + +maintainer-clean-gprof: + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif gprof + + + +.PHONY: configure-intl maybe-configure-intl +maybe-configure-intl: +@if gcc-bootstrap +configure-intl: stage_current +@endif gcc-bootstrap +@if intl +maybe-configure-intl: configure-intl +configure-intl: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/intl; \ + cd "$(HOST_SUBDIR)/intl" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/intl"; \ + libsrcdir="$$s/intl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif intl + + + +.PHONY: configure-stage1-intl maybe-configure-stage1-intl +maybe-configure-stage1-intl: +@if intl-bootstrap +maybe-configure-stage1-intl: configure-stage1-intl +configure-stage1-intl: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/intl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/intl"; \ + libsrcdir="$$s/intl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) +@endif intl-bootstrap + +.PHONY: configure-stage2-intl maybe-configure-stage2-intl +maybe-configure-stage2-intl: +@if intl-bootstrap +maybe-configure-stage2-intl: configure-stage2-intl +configure-stage2-intl: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/intl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/intl"; \ + libsrcdir="$$s/intl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) +@endif intl-bootstrap + +.PHONY: configure-stage3-intl maybe-configure-stage3-intl +maybe-configure-stage3-intl: +@if intl-bootstrap +maybe-configure-stage3-intl: configure-stage3-intl +configure-stage3-intl: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/intl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/intl"; \ + libsrcdir="$$s/intl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) +@endif intl-bootstrap + +.PHONY: configure-stage4-intl maybe-configure-stage4-intl +maybe-configure-stage4-intl: +@if intl-bootstrap +maybe-configure-stage4-intl: configure-stage4-intl +configure-stage4-intl: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/intl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/intl"; \ + libsrcdir="$$s/intl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) +@endif intl-bootstrap + +.PHONY: configure-stageprofile-intl maybe-configure-stageprofile-intl +maybe-configure-stageprofile-intl: +@if intl-bootstrap +maybe-configure-stageprofile-intl: configure-stageprofile-intl +configure-stageprofile-intl: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/intl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/intl"; \ + libsrcdir="$$s/intl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) +@endif intl-bootstrap + +.PHONY: configure-stagefeedback-intl maybe-configure-stagefeedback-intl +maybe-configure-stagefeedback-intl: +@if intl-bootstrap +maybe-configure-stagefeedback-intl: configure-stagefeedback-intl +configure-stagefeedback-intl: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/intl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/intl"; \ + libsrcdir="$$s/intl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) +@endif intl-bootstrap + + + + + +.PHONY: all-intl maybe-all-intl +maybe-all-intl: +@if gcc-bootstrap +all-intl: stage_current +@endif gcc-bootstrap +@if intl +TARGET-intl=all +maybe-all-intl: all-intl +all-intl: configure-intl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-intl)) +@endif intl + + + +.PHONY: all-stage1-intl maybe-all-stage1-intl +.PHONY: clean-stage1-intl maybe-clean-stage1-intl +maybe-all-stage1-intl: +maybe-clean-stage1-intl: +@if intl-bootstrap +maybe-all-stage1-intl: all-stage1-intl +all-stage1: all-stage1-intl +TARGET-stage1-intl = $(TARGET-intl) +all-stage1-intl: configure-stage1-intl + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-intl) + +maybe-clean-stage1-intl: clean-stage1-intl +clean-stage1: clean-stage1-intl +clean-stage1-intl: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-intl/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif intl-bootstrap + + +.PHONY: all-stage2-intl maybe-all-stage2-intl +.PHONY: clean-stage2-intl maybe-clean-stage2-intl +maybe-all-stage2-intl: +maybe-clean-stage2-intl: +@if intl-bootstrap +maybe-all-stage2-intl: all-stage2-intl +all-stage2: all-stage2-intl +TARGET-stage2-intl = $(TARGET-intl) +all-stage2-intl: configure-stage2-intl + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-intl) + +maybe-clean-stage2-intl: clean-stage2-intl +clean-stage2: clean-stage2-intl +clean-stage2-intl: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-intl/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif intl-bootstrap + + +.PHONY: all-stage3-intl maybe-all-stage3-intl +.PHONY: clean-stage3-intl maybe-clean-stage3-intl +maybe-all-stage3-intl: +maybe-clean-stage3-intl: +@if intl-bootstrap +maybe-all-stage3-intl: all-stage3-intl +all-stage3: all-stage3-intl +TARGET-stage3-intl = $(TARGET-intl) +all-stage3-intl: configure-stage3-intl + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-intl) + +maybe-clean-stage3-intl: clean-stage3-intl +clean-stage3: clean-stage3-intl +clean-stage3-intl: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-intl/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif intl-bootstrap + + +.PHONY: all-stage4-intl maybe-all-stage4-intl +.PHONY: clean-stage4-intl maybe-clean-stage4-intl +maybe-all-stage4-intl: +maybe-clean-stage4-intl: +@if intl-bootstrap +maybe-all-stage4-intl: all-stage4-intl +all-stage4: all-stage4-intl +TARGET-stage4-intl = $(TARGET-intl) +all-stage4-intl: configure-stage4-intl + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-intl) + +maybe-clean-stage4-intl: clean-stage4-intl +clean-stage4: clean-stage4-intl +clean-stage4-intl: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-intl/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif intl-bootstrap + + +.PHONY: all-stageprofile-intl maybe-all-stageprofile-intl +.PHONY: clean-stageprofile-intl maybe-clean-stageprofile-intl +maybe-all-stageprofile-intl: +maybe-clean-stageprofile-intl: +@if intl-bootstrap +maybe-all-stageprofile-intl: all-stageprofile-intl +all-stageprofile: all-stageprofile-intl +TARGET-stageprofile-intl = $(TARGET-intl) +all-stageprofile-intl: configure-stageprofile-intl + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-intl) + +maybe-clean-stageprofile-intl: clean-stageprofile-intl +clean-stageprofile: clean-stageprofile-intl +clean-stageprofile-intl: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-intl/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif intl-bootstrap + + +.PHONY: all-stagefeedback-intl maybe-all-stagefeedback-intl +.PHONY: clean-stagefeedback-intl maybe-clean-stagefeedback-intl +maybe-all-stagefeedback-intl: +maybe-clean-stagefeedback-intl: +@if intl-bootstrap +maybe-all-stagefeedback-intl: all-stagefeedback-intl +all-stagefeedback: all-stagefeedback-intl +TARGET-stagefeedback-intl = $(TARGET-intl) +all-stagefeedback-intl: configure-stagefeedback-intl + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-intl) + +maybe-clean-stagefeedback-intl: clean-stagefeedback-intl +clean-stagefeedback: clean-stagefeedback-intl +clean-stagefeedback-intl: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-intl/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif intl-bootstrap + + + + + +.PHONY: check-intl maybe-check-intl +maybe-check-intl: +@if intl +maybe-check-intl: check-intl + +check-intl: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif intl + +.PHONY: install-intl maybe-install-intl +maybe-install-intl: +@if intl +maybe-install-intl: install-intl + +install-intl: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif intl + +.PHONY: install-strip-intl maybe-install-strip-intl +maybe-install-strip-intl: +@if intl +maybe-install-strip-intl: install-strip-intl + +install-strip-intl: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif intl + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-intl info-intl +maybe-info-intl: +@if intl +maybe-info-intl: info-intl + +info-intl: \ + configure-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif intl + +.PHONY: maybe-dvi-intl dvi-intl +maybe-dvi-intl: +@if intl +maybe-dvi-intl: dvi-intl + +dvi-intl: \ + configure-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif intl + +.PHONY: maybe-pdf-intl pdf-intl +maybe-pdf-intl: +@if intl +maybe-pdf-intl: pdf-intl + +pdf-intl: \ + configure-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif intl + +.PHONY: maybe-html-intl html-intl +maybe-html-intl: +@if intl +maybe-html-intl: html-intl + +html-intl: \ + configure-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif intl + +.PHONY: maybe-TAGS-intl TAGS-intl +maybe-TAGS-intl: +@if intl +maybe-TAGS-intl: TAGS-intl + +TAGS-intl: \ + configure-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif intl + +.PHONY: maybe-install-info-intl install-info-intl +maybe-install-info-intl: +@if intl +maybe-install-info-intl: install-info-intl + +install-info-intl: \ + configure-intl \ + info-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif intl + +.PHONY: maybe-install-pdf-intl install-pdf-intl +maybe-install-pdf-intl: +@if intl +maybe-install-pdf-intl: install-pdf-intl + +install-pdf-intl: \ + configure-intl \ + pdf-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif intl + +.PHONY: maybe-install-html-intl install-html-intl +maybe-install-html-intl: +@if intl +maybe-install-html-intl: install-html-intl + +install-html-intl: \ + configure-intl \ + html-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif intl + +.PHONY: maybe-installcheck-intl installcheck-intl +maybe-installcheck-intl: +@if intl +maybe-installcheck-intl: installcheck-intl + +installcheck-intl: \ + configure-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif intl + +.PHONY: maybe-mostlyclean-intl mostlyclean-intl +maybe-mostlyclean-intl: +@if intl +maybe-mostlyclean-intl: mostlyclean-intl + +mostlyclean-intl: + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif intl + +.PHONY: maybe-clean-intl clean-intl +maybe-clean-intl: +@if intl +maybe-clean-intl: clean-intl + +clean-intl: + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif intl + +.PHONY: maybe-distclean-intl distclean-intl +maybe-distclean-intl: +@if intl +maybe-distclean-intl: distclean-intl + +distclean-intl: + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif intl + +.PHONY: maybe-maintainer-clean-intl maintainer-clean-intl +maybe-maintainer-clean-intl: +@if intl +maybe-maintainer-clean-intl: maintainer-clean-intl + +maintainer-clean-intl: + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif intl + + + +.PHONY: configure-tcl maybe-configure-tcl +maybe-configure-tcl: +@if gcc-bootstrap +configure-tcl: stage_current +@endif gcc-bootstrap +@if tcl +maybe-configure-tcl: configure-tcl +configure-tcl: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/tcl/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/tcl ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/tcl; \ + cd "$(HOST_SUBDIR)/tcl" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/tcl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/tcl"; \ + libsrcdir="$$s/tcl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif tcl + + + + + +.PHONY: all-tcl maybe-all-tcl +maybe-all-tcl: +@if gcc-bootstrap +all-tcl: stage_current +@endif gcc-bootstrap +@if tcl +TARGET-tcl=all +maybe-all-tcl: all-tcl +all-tcl: configure-tcl + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-tcl)) +@endif tcl + + + + +.PHONY: check-tcl maybe-check-tcl +maybe-check-tcl: +@if tcl +maybe-check-tcl: check-tcl + +check-tcl: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif tcl + +.PHONY: install-tcl maybe-install-tcl +maybe-install-tcl: +@if tcl +maybe-install-tcl: install-tcl + +install-tcl: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif tcl + +.PHONY: install-strip-tcl maybe-install-strip-tcl +maybe-install-strip-tcl: +@if tcl +maybe-install-strip-tcl: install-strip-tcl + +install-strip-tcl: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif tcl + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-tcl info-tcl +maybe-info-tcl: +@if tcl +maybe-info-tcl: info-tcl + +info-tcl: \ + configure-tcl + @: $(MAKE); $(unstage) + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in tcl" ; \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif tcl + +.PHONY: maybe-dvi-tcl dvi-tcl +maybe-dvi-tcl: +@if tcl +maybe-dvi-tcl: dvi-tcl + +dvi-tcl: \ + configure-tcl + @: $(MAKE); $(unstage) + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in tcl" ; \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif tcl + +.PHONY: maybe-pdf-tcl pdf-tcl +maybe-pdf-tcl: +@if tcl +maybe-pdf-tcl: pdf-tcl + +pdf-tcl: \ + configure-tcl + @: $(MAKE); $(unstage) + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in tcl" ; \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif tcl + +.PHONY: maybe-html-tcl html-tcl +maybe-html-tcl: +@if tcl +maybe-html-tcl: html-tcl + +html-tcl: \ + configure-tcl + @: $(MAKE); $(unstage) + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in tcl" ; \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif tcl + +.PHONY: maybe-TAGS-tcl TAGS-tcl +maybe-TAGS-tcl: +@if tcl +maybe-TAGS-tcl: TAGS-tcl + +TAGS-tcl: \ + configure-tcl + @: $(MAKE); $(unstage) + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in tcl" ; \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif tcl + +.PHONY: maybe-install-info-tcl install-info-tcl +maybe-install-info-tcl: +@if tcl +maybe-install-info-tcl: install-info-tcl + +install-info-tcl: \ + configure-tcl \ + info-tcl + @: $(MAKE); $(unstage) + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in tcl" ; \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif tcl + +.PHONY: maybe-install-pdf-tcl install-pdf-tcl +maybe-install-pdf-tcl: +@if tcl +maybe-install-pdf-tcl: install-pdf-tcl + +install-pdf-tcl: \ + configure-tcl \ + pdf-tcl + @: $(MAKE); $(unstage) + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in tcl" ; \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif tcl + +.PHONY: maybe-install-html-tcl install-html-tcl +maybe-install-html-tcl: +@if tcl +maybe-install-html-tcl: install-html-tcl + +install-html-tcl: \ + configure-tcl \ + html-tcl + @: $(MAKE); $(unstage) + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in tcl" ; \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif tcl + +.PHONY: maybe-installcheck-tcl installcheck-tcl +maybe-installcheck-tcl: +@if tcl +maybe-installcheck-tcl: installcheck-tcl + +installcheck-tcl: \ + configure-tcl + @: $(MAKE); $(unstage) + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in tcl" ; \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif tcl + +.PHONY: maybe-mostlyclean-tcl mostlyclean-tcl +maybe-mostlyclean-tcl: +@if tcl +maybe-mostlyclean-tcl: mostlyclean-tcl + +# tcl doesn't support mostlyclean. +mostlyclean-tcl: + +@endif tcl + +.PHONY: maybe-clean-tcl clean-tcl +maybe-clean-tcl: +@if tcl +maybe-clean-tcl: clean-tcl + +clean-tcl: + @: $(MAKE); $(unstage) + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in tcl" ; \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif tcl + +.PHONY: maybe-distclean-tcl distclean-tcl +maybe-distclean-tcl: +@if tcl +maybe-distclean-tcl: distclean-tcl + +distclean-tcl: + @: $(MAKE); $(unstage) + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in tcl" ; \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif tcl + +.PHONY: maybe-maintainer-clean-tcl maintainer-clean-tcl +maybe-maintainer-clean-tcl: +@if tcl +maybe-maintainer-clean-tcl: maintainer-clean-tcl + +maintainer-clean-tcl: + @: $(MAKE); $(unstage) + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in tcl" ; \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif tcl + + + +.PHONY: configure-itcl maybe-configure-itcl +maybe-configure-itcl: +@if gcc-bootstrap +configure-itcl: stage_current +@endif gcc-bootstrap +@if itcl +maybe-configure-itcl: configure-itcl +configure-itcl: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/itcl/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/itcl ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/itcl; \ + cd "$(HOST_SUBDIR)/itcl" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/itcl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/itcl"; \ + libsrcdir="$$s/itcl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif itcl + + + + + +.PHONY: all-itcl maybe-all-itcl +maybe-all-itcl: +@if gcc-bootstrap +all-itcl: stage_current +@endif gcc-bootstrap +@if itcl +TARGET-itcl=all +maybe-all-itcl: all-itcl +all-itcl: configure-itcl + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-itcl)) +@endif itcl + + + + +.PHONY: check-itcl maybe-check-itcl +maybe-check-itcl: +@if itcl +maybe-check-itcl: check-itcl + +check-itcl: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif itcl + +.PHONY: install-itcl maybe-install-itcl +maybe-install-itcl: +@if itcl +maybe-install-itcl: install-itcl + +install-itcl: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif itcl + +.PHONY: install-strip-itcl maybe-install-strip-itcl +maybe-install-strip-itcl: +@if itcl +maybe-install-strip-itcl: install-strip-itcl + +install-strip-itcl: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif itcl + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-itcl info-itcl +maybe-info-itcl: +@if itcl +maybe-info-itcl: info-itcl + +info-itcl: \ + configure-itcl + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif itcl + +.PHONY: maybe-dvi-itcl dvi-itcl +maybe-dvi-itcl: +@if itcl +maybe-dvi-itcl: dvi-itcl + +dvi-itcl: \ + configure-itcl + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif itcl + +.PHONY: maybe-pdf-itcl pdf-itcl +maybe-pdf-itcl: +@if itcl +maybe-pdf-itcl: pdf-itcl + +pdf-itcl: \ + configure-itcl + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif itcl + +.PHONY: maybe-html-itcl html-itcl +maybe-html-itcl: +@if itcl +maybe-html-itcl: html-itcl + +html-itcl: \ + configure-itcl + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif itcl + +.PHONY: maybe-TAGS-itcl TAGS-itcl +maybe-TAGS-itcl: +@if itcl +maybe-TAGS-itcl: TAGS-itcl + +TAGS-itcl: \ + configure-itcl + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif itcl + +.PHONY: maybe-install-info-itcl install-info-itcl +maybe-install-info-itcl: +@if itcl +maybe-install-info-itcl: install-info-itcl + +install-info-itcl: \ + configure-itcl \ + info-itcl + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif itcl + +.PHONY: maybe-install-pdf-itcl install-pdf-itcl +maybe-install-pdf-itcl: +@if itcl +maybe-install-pdf-itcl: install-pdf-itcl + +install-pdf-itcl: \ + configure-itcl \ + pdf-itcl + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif itcl + +.PHONY: maybe-install-html-itcl install-html-itcl +maybe-install-html-itcl: +@if itcl +maybe-install-html-itcl: install-html-itcl + +install-html-itcl: \ + configure-itcl \ + html-itcl + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif itcl + +.PHONY: maybe-installcheck-itcl installcheck-itcl +maybe-installcheck-itcl: +@if itcl +maybe-installcheck-itcl: installcheck-itcl + +installcheck-itcl: \ + configure-itcl + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif itcl + +.PHONY: maybe-mostlyclean-itcl mostlyclean-itcl +maybe-mostlyclean-itcl: +@if itcl +maybe-mostlyclean-itcl: mostlyclean-itcl + +mostlyclean-itcl: + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif itcl + +.PHONY: maybe-clean-itcl clean-itcl +maybe-clean-itcl: +@if itcl +maybe-clean-itcl: clean-itcl + +clean-itcl: + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif itcl + +.PHONY: maybe-distclean-itcl distclean-itcl +maybe-distclean-itcl: +@if itcl +maybe-distclean-itcl: distclean-itcl + +distclean-itcl: + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif itcl + +.PHONY: maybe-maintainer-clean-itcl maintainer-clean-itcl +maybe-maintainer-clean-itcl: +@if itcl +maybe-maintainer-clean-itcl: maintainer-clean-itcl + +maintainer-clean-itcl: + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif itcl + + + +.PHONY: configure-ld maybe-configure-ld +maybe-configure-ld: +@if gcc-bootstrap +configure-ld: stage_current +@endif gcc-bootstrap +@if ld +maybe-configure-ld: configure-ld +configure-ld: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/ld; \ + cd "$(HOST_SUBDIR)/ld" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ld"; \ + libsrcdir="$$s/ld"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif ld + + + +.PHONY: configure-stage1-ld maybe-configure-stage1-ld +maybe-configure-stage1-ld: +@if ld-bootstrap +maybe-configure-stage1-ld: configure-stage1-ld +configure-stage1-ld: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/ld ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ld"; \ + libsrcdir="$$s/ld"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) +@endif ld-bootstrap + +.PHONY: configure-stage2-ld maybe-configure-stage2-ld +maybe-configure-stage2-ld: +@if ld-bootstrap +maybe-configure-stage2-ld: configure-stage2-ld +configure-stage2-ld: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/ld ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ld"; \ + libsrcdir="$$s/ld"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) +@endif ld-bootstrap + +.PHONY: configure-stage3-ld maybe-configure-stage3-ld +maybe-configure-stage3-ld: +@if ld-bootstrap +maybe-configure-stage3-ld: configure-stage3-ld +configure-stage3-ld: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/ld ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ld"; \ + libsrcdir="$$s/ld"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) +@endif ld-bootstrap + +.PHONY: configure-stage4-ld maybe-configure-stage4-ld +maybe-configure-stage4-ld: +@if ld-bootstrap +maybe-configure-stage4-ld: configure-stage4-ld +configure-stage4-ld: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/ld ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ld"; \ + libsrcdir="$$s/ld"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) +@endif ld-bootstrap + +.PHONY: configure-stageprofile-ld maybe-configure-stageprofile-ld +maybe-configure-stageprofile-ld: +@if ld-bootstrap +maybe-configure-stageprofile-ld: configure-stageprofile-ld +configure-stageprofile-ld: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/ld ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ld"; \ + libsrcdir="$$s/ld"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) +@endif ld-bootstrap + +.PHONY: configure-stagefeedback-ld maybe-configure-stagefeedback-ld +maybe-configure-stagefeedback-ld: +@if ld-bootstrap +maybe-configure-stagefeedback-ld: configure-stagefeedback-ld +configure-stagefeedback-ld: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/ld ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ld"; \ + libsrcdir="$$s/ld"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) +@endif ld-bootstrap + + + + + +.PHONY: all-ld maybe-all-ld +maybe-all-ld: +@if gcc-bootstrap +all-ld: stage_current +@endif gcc-bootstrap +@if ld +TARGET-ld=all +maybe-all-ld: all-ld +all-ld: configure-ld + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-ld)) +@endif ld + + + +.PHONY: all-stage1-ld maybe-all-stage1-ld +.PHONY: clean-stage1-ld maybe-clean-stage1-ld +maybe-all-stage1-ld: +maybe-clean-stage1-ld: +@if ld-bootstrap +maybe-all-stage1-ld: all-stage1-ld +all-stage1: all-stage1-ld +TARGET-stage1-ld = $(TARGET-ld) +all-stage1-ld: configure-stage1-ld + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-ld) + +maybe-clean-stage1-ld: clean-stage1-ld +clean-stage1: clean-stage1-ld +clean-stage1-ld: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-ld/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif ld-bootstrap + + +.PHONY: all-stage2-ld maybe-all-stage2-ld +.PHONY: clean-stage2-ld maybe-clean-stage2-ld +maybe-all-stage2-ld: +maybe-clean-stage2-ld: +@if ld-bootstrap +maybe-all-stage2-ld: all-stage2-ld +all-stage2: all-stage2-ld +TARGET-stage2-ld = $(TARGET-ld) +all-stage2-ld: configure-stage2-ld + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-ld) + +maybe-clean-stage2-ld: clean-stage2-ld +clean-stage2: clean-stage2-ld +clean-stage2-ld: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-ld/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif ld-bootstrap + + +.PHONY: all-stage3-ld maybe-all-stage3-ld +.PHONY: clean-stage3-ld maybe-clean-stage3-ld +maybe-all-stage3-ld: +maybe-clean-stage3-ld: +@if ld-bootstrap +maybe-all-stage3-ld: all-stage3-ld +all-stage3: all-stage3-ld +TARGET-stage3-ld = $(TARGET-ld) +all-stage3-ld: configure-stage3-ld + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-ld) + +maybe-clean-stage3-ld: clean-stage3-ld +clean-stage3: clean-stage3-ld +clean-stage3-ld: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-ld/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif ld-bootstrap + + +.PHONY: all-stage4-ld maybe-all-stage4-ld +.PHONY: clean-stage4-ld maybe-clean-stage4-ld +maybe-all-stage4-ld: +maybe-clean-stage4-ld: +@if ld-bootstrap +maybe-all-stage4-ld: all-stage4-ld +all-stage4: all-stage4-ld +TARGET-stage4-ld = $(TARGET-ld) +all-stage4-ld: configure-stage4-ld + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-ld) + +maybe-clean-stage4-ld: clean-stage4-ld +clean-stage4: clean-stage4-ld +clean-stage4-ld: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-ld/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif ld-bootstrap + + +.PHONY: all-stageprofile-ld maybe-all-stageprofile-ld +.PHONY: clean-stageprofile-ld maybe-clean-stageprofile-ld +maybe-all-stageprofile-ld: +maybe-clean-stageprofile-ld: +@if ld-bootstrap +maybe-all-stageprofile-ld: all-stageprofile-ld +all-stageprofile: all-stageprofile-ld +TARGET-stageprofile-ld = $(TARGET-ld) +all-stageprofile-ld: configure-stageprofile-ld + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-ld) + +maybe-clean-stageprofile-ld: clean-stageprofile-ld +clean-stageprofile: clean-stageprofile-ld +clean-stageprofile-ld: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-ld/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif ld-bootstrap + + +.PHONY: all-stagefeedback-ld maybe-all-stagefeedback-ld +.PHONY: clean-stagefeedback-ld maybe-clean-stagefeedback-ld +maybe-all-stagefeedback-ld: +maybe-clean-stagefeedback-ld: +@if ld-bootstrap +maybe-all-stagefeedback-ld: all-stagefeedback-ld +all-stagefeedback: all-stagefeedback-ld +TARGET-stagefeedback-ld = $(TARGET-ld) +all-stagefeedback-ld: configure-stagefeedback-ld + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-ld) + +maybe-clean-stagefeedback-ld: clean-stagefeedback-ld +clean-stagefeedback: clean-stagefeedback-ld +clean-stagefeedback-ld: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-ld/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif ld-bootstrap + + + + + +.PHONY: check-ld maybe-check-ld +maybe-check-ld: +@if ld +maybe-check-ld: check-ld + +check-ld: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif ld + +.PHONY: install-ld maybe-install-ld +maybe-install-ld: +@if ld +maybe-install-ld: install-ld + +install-ld: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif ld + +.PHONY: install-strip-ld maybe-install-strip-ld +maybe-install-strip-ld: +@if ld +maybe-install-strip-ld: install-strip-ld + +install-strip-ld: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif ld + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-ld info-ld +maybe-info-ld: +@if ld +maybe-info-ld: info-ld + +info-ld: \ + configure-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif ld + +.PHONY: maybe-dvi-ld dvi-ld +maybe-dvi-ld: +@if ld +maybe-dvi-ld: dvi-ld + +dvi-ld: \ + configure-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif ld + +.PHONY: maybe-pdf-ld pdf-ld +maybe-pdf-ld: +@if ld +maybe-pdf-ld: pdf-ld + +pdf-ld: \ + configure-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif ld + +.PHONY: maybe-html-ld html-ld +maybe-html-ld: +@if ld +maybe-html-ld: html-ld + +html-ld: \ + configure-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif ld + +.PHONY: maybe-TAGS-ld TAGS-ld +maybe-TAGS-ld: +@if ld +maybe-TAGS-ld: TAGS-ld + +TAGS-ld: \ + configure-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif ld + +.PHONY: maybe-install-info-ld install-info-ld +maybe-install-info-ld: +@if ld +maybe-install-info-ld: install-info-ld + +install-info-ld: \ + configure-ld \ + info-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif ld + +.PHONY: maybe-install-pdf-ld install-pdf-ld +maybe-install-pdf-ld: +@if ld +maybe-install-pdf-ld: install-pdf-ld + +install-pdf-ld: \ + configure-ld \ + pdf-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif ld + +.PHONY: maybe-install-html-ld install-html-ld +maybe-install-html-ld: +@if ld +maybe-install-html-ld: install-html-ld + +install-html-ld: \ + configure-ld \ + html-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif ld + +.PHONY: maybe-installcheck-ld installcheck-ld +maybe-installcheck-ld: +@if ld +maybe-installcheck-ld: installcheck-ld + +installcheck-ld: \ + configure-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif ld + +.PHONY: maybe-mostlyclean-ld mostlyclean-ld +maybe-mostlyclean-ld: +@if ld +maybe-mostlyclean-ld: mostlyclean-ld + +mostlyclean-ld: + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif ld + +.PHONY: maybe-clean-ld clean-ld +maybe-clean-ld: +@if ld +maybe-clean-ld: clean-ld + +clean-ld: + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif ld + +.PHONY: maybe-distclean-ld distclean-ld +maybe-distclean-ld: +@if ld +maybe-distclean-ld: distclean-ld + +distclean-ld: + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif ld + +.PHONY: maybe-maintainer-clean-ld maintainer-clean-ld +maybe-maintainer-clean-ld: +@if ld +maybe-maintainer-clean-ld: maintainer-clean-ld + +maintainer-clean-ld: + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif ld + + + +.PHONY: configure-libcpp maybe-configure-libcpp +maybe-configure-libcpp: +@if gcc-bootstrap +configure-libcpp: stage_current +@endif gcc-bootstrap +@if libcpp +maybe-configure-libcpp: configure-libcpp +configure-libcpp: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/libcpp; \ + cd "$(HOST_SUBDIR)/libcpp" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libcpp"; \ + libsrcdir="$$s/libcpp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif libcpp + + + +.PHONY: configure-stage1-libcpp maybe-configure-stage1-libcpp +maybe-configure-stage1-libcpp: +@if libcpp-bootstrap +maybe-configure-stage1-libcpp: configure-stage1-libcpp +configure-stage1-libcpp: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/libcpp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libcpp"; \ + libsrcdir="$$s/libcpp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) +@endif libcpp-bootstrap + +.PHONY: configure-stage2-libcpp maybe-configure-stage2-libcpp +maybe-configure-stage2-libcpp: +@if libcpp-bootstrap +maybe-configure-stage2-libcpp: configure-stage2-libcpp +configure-stage2-libcpp: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/libcpp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libcpp"; \ + libsrcdir="$$s/libcpp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) +@endif libcpp-bootstrap + +.PHONY: configure-stage3-libcpp maybe-configure-stage3-libcpp +maybe-configure-stage3-libcpp: +@if libcpp-bootstrap +maybe-configure-stage3-libcpp: configure-stage3-libcpp +configure-stage3-libcpp: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/libcpp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libcpp"; \ + libsrcdir="$$s/libcpp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) +@endif libcpp-bootstrap + +.PHONY: configure-stage4-libcpp maybe-configure-stage4-libcpp +maybe-configure-stage4-libcpp: +@if libcpp-bootstrap +maybe-configure-stage4-libcpp: configure-stage4-libcpp +configure-stage4-libcpp: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/libcpp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libcpp"; \ + libsrcdir="$$s/libcpp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) +@endif libcpp-bootstrap + +.PHONY: configure-stageprofile-libcpp maybe-configure-stageprofile-libcpp +maybe-configure-stageprofile-libcpp: +@if libcpp-bootstrap +maybe-configure-stageprofile-libcpp: configure-stageprofile-libcpp +configure-stageprofile-libcpp: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/libcpp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libcpp"; \ + libsrcdir="$$s/libcpp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) +@endif libcpp-bootstrap + +.PHONY: configure-stagefeedback-libcpp maybe-configure-stagefeedback-libcpp +maybe-configure-stagefeedback-libcpp: +@if libcpp-bootstrap +maybe-configure-stagefeedback-libcpp: configure-stagefeedback-libcpp +configure-stagefeedback-libcpp: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/libcpp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libcpp"; \ + libsrcdir="$$s/libcpp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) +@endif libcpp-bootstrap + + + + + +.PHONY: all-libcpp maybe-all-libcpp +maybe-all-libcpp: +@if gcc-bootstrap +all-libcpp: stage_current +@endif gcc-bootstrap +@if libcpp +TARGET-libcpp=all +maybe-all-libcpp: all-libcpp +all-libcpp: configure-libcpp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-libcpp)) +@endif libcpp + + + +.PHONY: all-stage1-libcpp maybe-all-stage1-libcpp +.PHONY: clean-stage1-libcpp maybe-clean-stage1-libcpp +maybe-all-stage1-libcpp: +maybe-clean-stage1-libcpp: +@if libcpp-bootstrap +maybe-all-stage1-libcpp: all-stage1-libcpp +all-stage1: all-stage1-libcpp +TARGET-stage1-libcpp = $(TARGET-libcpp) +all-stage1-libcpp: configure-stage1-libcpp + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-libcpp) + +maybe-clean-stage1-libcpp: clean-stage1-libcpp +clean-stage1: clean-stage1-libcpp +clean-stage1-libcpp: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-libcpp/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif libcpp-bootstrap + + +.PHONY: all-stage2-libcpp maybe-all-stage2-libcpp +.PHONY: clean-stage2-libcpp maybe-clean-stage2-libcpp +maybe-all-stage2-libcpp: +maybe-clean-stage2-libcpp: +@if libcpp-bootstrap +maybe-all-stage2-libcpp: all-stage2-libcpp +all-stage2: all-stage2-libcpp +TARGET-stage2-libcpp = $(TARGET-libcpp) +all-stage2-libcpp: configure-stage2-libcpp + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-libcpp) + +maybe-clean-stage2-libcpp: clean-stage2-libcpp +clean-stage2: clean-stage2-libcpp +clean-stage2-libcpp: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-libcpp/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libcpp-bootstrap + + +.PHONY: all-stage3-libcpp maybe-all-stage3-libcpp +.PHONY: clean-stage3-libcpp maybe-clean-stage3-libcpp +maybe-all-stage3-libcpp: +maybe-clean-stage3-libcpp: +@if libcpp-bootstrap +maybe-all-stage3-libcpp: all-stage3-libcpp +all-stage3: all-stage3-libcpp +TARGET-stage3-libcpp = $(TARGET-libcpp) +all-stage3-libcpp: configure-stage3-libcpp + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-libcpp) + +maybe-clean-stage3-libcpp: clean-stage3-libcpp +clean-stage3: clean-stage3-libcpp +clean-stage3-libcpp: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-libcpp/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libcpp-bootstrap + + +.PHONY: all-stage4-libcpp maybe-all-stage4-libcpp +.PHONY: clean-stage4-libcpp maybe-clean-stage4-libcpp +maybe-all-stage4-libcpp: +maybe-clean-stage4-libcpp: +@if libcpp-bootstrap +maybe-all-stage4-libcpp: all-stage4-libcpp +all-stage4: all-stage4-libcpp +TARGET-stage4-libcpp = $(TARGET-libcpp) +all-stage4-libcpp: configure-stage4-libcpp + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-libcpp) + +maybe-clean-stage4-libcpp: clean-stage4-libcpp +clean-stage4: clean-stage4-libcpp +clean-stage4-libcpp: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-libcpp/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libcpp-bootstrap + + +.PHONY: all-stageprofile-libcpp maybe-all-stageprofile-libcpp +.PHONY: clean-stageprofile-libcpp maybe-clean-stageprofile-libcpp +maybe-all-stageprofile-libcpp: +maybe-clean-stageprofile-libcpp: +@if libcpp-bootstrap +maybe-all-stageprofile-libcpp: all-stageprofile-libcpp +all-stageprofile: all-stageprofile-libcpp +TARGET-stageprofile-libcpp = $(TARGET-libcpp) +all-stageprofile-libcpp: configure-stageprofile-libcpp + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-libcpp) + +maybe-clean-stageprofile-libcpp: clean-stageprofile-libcpp +clean-stageprofile: clean-stageprofile-libcpp +clean-stageprofile-libcpp: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-libcpp/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libcpp-bootstrap + + +.PHONY: all-stagefeedback-libcpp maybe-all-stagefeedback-libcpp +.PHONY: clean-stagefeedback-libcpp maybe-clean-stagefeedback-libcpp +maybe-all-stagefeedback-libcpp: +maybe-clean-stagefeedback-libcpp: +@if libcpp-bootstrap +maybe-all-stagefeedback-libcpp: all-stagefeedback-libcpp +all-stagefeedback: all-stagefeedback-libcpp +TARGET-stagefeedback-libcpp = $(TARGET-libcpp) +all-stagefeedback-libcpp: configure-stagefeedback-libcpp + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-libcpp) + +maybe-clean-stagefeedback-libcpp: clean-stagefeedback-libcpp +clean-stagefeedback: clean-stagefeedback-libcpp +clean-stagefeedback-libcpp: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-libcpp/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libcpp-bootstrap + + + + + +.PHONY: check-libcpp maybe-check-libcpp +maybe-check-libcpp: +@if libcpp +maybe-check-libcpp: check-libcpp + +check-libcpp: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif libcpp + +.PHONY: install-libcpp maybe-install-libcpp +maybe-install-libcpp: +@if libcpp +maybe-install-libcpp: install-libcpp + +install-libcpp: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif libcpp + +.PHONY: install-strip-libcpp maybe-install-strip-libcpp +maybe-install-strip-libcpp: +@if libcpp +maybe-install-strip-libcpp: install-strip-libcpp + +install-strip-libcpp: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif libcpp + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-libcpp info-libcpp +maybe-info-libcpp: +@if libcpp +maybe-info-libcpp: info-libcpp + +info-libcpp: \ + configure-libcpp + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif libcpp + +.PHONY: maybe-dvi-libcpp dvi-libcpp +maybe-dvi-libcpp: +@if libcpp +maybe-dvi-libcpp: dvi-libcpp + +dvi-libcpp: \ + configure-libcpp + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif libcpp + +.PHONY: maybe-pdf-libcpp pdf-libcpp +maybe-pdf-libcpp: +@if libcpp +maybe-pdf-libcpp: pdf-libcpp + +pdf-libcpp: \ + configure-libcpp + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif libcpp + +.PHONY: maybe-html-libcpp html-libcpp +maybe-html-libcpp: +@if libcpp +maybe-html-libcpp: html-libcpp + +html-libcpp: \ + configure-libcpp + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif libcpp + +.PHONY: maybe-TAGS-libcpp TAGS-libcpp +maybe-TAGS-libcpp: +@if libcpp +maybe-TAGS-libcpp: TAGS-libcpp + +TAGS-libcpp: \ + configure-libcpp + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif libcpp + +.PHONY: maybe-install-info-libcpp install-info-libcpp +maybe-install-info-libcpp: +@if libcpp +maybe-install-info-libcpp: install-info-libcpp + +install-info-libcpp: \ + configure-libcpp \ + info-libcpp + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif libcpp + +.PHONY: maybe-install-pdf-libcpp install-pdf-libcpp +maybe-install-pdf-libcpp: +@if libcpp +maybe-install-pdf-libcpp: install-pdf-libcpp + +install-pdf-libcpp: \ + configure-libcpp \ + pdf-libcpp + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif libcpp + +.PHONY: maybe-install-html-libcpp install-html-libcpp +maybe-install-html-libcpp: +@if libcpp +maybe-install-html-libcpp: install-html-libcpp + +install-html-libcpp: \ + configure-libcpp \ + html-libcpp + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif libcpp + +.PHONY: maybe-installcheck-libcpp installcheck-libcpp +maybe-installcheck-libcpp: +@if libcpp +maybe-installcheck-libcpp: installcheck-libcpp + +installcheck-libcpp: \ + configure-libcpp + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif libcpp + +.PHONY: maybe-mostlyclean-libcpp mostlyclean-libcpp +maybe-mostlyclean-libcpp: +@if libcpp +maybe-mostlyclean-libcpp: mostlyclean-libcpp + +mostlyclean-libcpp: + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif libcpp + +.PHONY: maybe-clean-libcpp clean-libcpp +maybe-clean-libcpp: +@if libcpp +maybe-clean-libcpp: clean-libcpp + +clean-libcpp: + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif libcpp + +.PHONY: maybe-distclean-libcpp distclean-libcpp +maybe-distclean-libcpp: +@if libcpp +maybe-distclean-libcpp: distclean-libcpp + +distclean-libcpp: + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif libcpp + +.PHONY: maybe-maintainer-clean-libcpp maintainer-clean-libcpp +maybe-maintainer-clean-libcpp: +@if libcpp +maybe-maintainer-clean-libcpp: maintainer-clean-libcpp + +maintainer-clean-libcpp: + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif libcpp + + + +.PHONY: configure-libdecnumber maybe-configure-libdecnumber +maybe-configure-libdecnumber: +@if gcc-bootstrap +configure-libdecnumber: stage_current +@endif gcc-bootstrap +@if libdecnumber +maybe-configure-libdecnumber: configure-libdecnumber +configure-libdecnumber: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/libdecnumber; \ + cd "$(HOST_SUBDIR)/libdecnumber" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libdecnumber/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ + libsrcdir="$$s/libdecnumber"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif libdecnumber + + + +.PHONY: configure-stage1-libdecnumber maybe-configure-stage1-libdecnumber +maybe-configure-stage1-libdecnumber: +@if libdecnumber-bootstrap +maybe-configure-stage1-libdecnumber: configure-stage1-libdecnumber +configure-stage1-libdecnumber: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/libdecnumber ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ + cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libdecnumber/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ + libsrcdir="$$s/libdecnumber"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) +@endif libdecnumber-bootstrap + +.PHONY: configure-stage2-libdecnumber maybe-configure-stage2-libdecnumber +maybe-configure-stage2-libdecnumber: +@if libdecnumber-bootstrap +maybe-configure-stage2-libdecnumber: configure-stage2-libdecnumber +configure-stage2-libdecnumber: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/libdecnumber ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ + cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libdecnumber/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ + libsrcdir="$$s/libdecnumber"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) +@endif libdecnumber-bootstrap + +.PHONY: configure-stage3-libdecnumber maybe-configure-stage3-libdecnumber +maybe-configure-stage3-libdecnumber: +@if libdecnumber-bootstrap +maybe-configure-stage3-libdecnumber: configure-stage3-libdecnumber +configure-stage3-libdecnumber: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/libdecnumber ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ + cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libdecnumber/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ + libsrcdir="$$s/libdecnumber"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) +@endif libdecnumber-bootstrap + +.PHONY: configure-stage4-libdecnumber maybe-configure-stage4-libdecnumber +maybe-configure-stage4-libdecnumber: +@if libdecnumber-bootstrap +maybe-configure-stage4-libdecnumber: configure-stage4-libdecnumber +configure-stage4-libdecnumber: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/libdecnumber ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ + cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libdecnumber/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ + libsrcdir="$$s/libdecnumber"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) +@endif libdecnumber-bootstrap + +.PHONY: configure-stageprofile-libdecnumber maybe-configure-stageprofile-libdecnumber +maybe-configure-stageprofile-libdecnumber: +@if libdecnumber-bootstrap +maybe-configure-stageprofile-libdecnumber: configure-stageprofile-libdecnumber +configure-stageprofile-libdecnumber: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/libdecnumber ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ + cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libdecnumber/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ + libsrcdir="$$s/libdecnumber"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) +@endif libdecnumber-bootstrap + +.PHONY: configure-stagefeedback-libdecnumber maybe-configure-stagefeedback-libdecnumber +maybe-configure-stagefeedback-libdecnumber: +@if libdecnumber-bootstrap +maybe-configure-stagefeedback-libdecnumber: configure-stagefeedback-libdecnumber +configure-stagefeedback-libdecnumber: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/libdecnumber ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ + cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libdecnumber/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ + libsrcdir="$$s/libdecnumber"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) +@endif libdecnumber-bootstrap + + + + + +.PHONY: all-libdecnumber maybe-all-libdecnumber +maybe-all-libdecnumber: +@if gcc-bootstrap +all-libdecnumber: stage_current +@endif gcc-bootstrap +@if libdecnumber +TARGET-libdecnumber=all +maybe-all-libdecnumber: all-libdecnumber +all-libdecnumber: configure-libdecnumber + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-libdecnumber)) +@endif libdecnumber + + + +.PHONY: all-stage1-libdecnumber maybe-all-stage1-libdecnumber +.PHONY: clean-stage1-libdecnumber maybe-clean-stage1-libdecnumber +maybe-all-stage1-libdecnumber: +maybe-clean-stage1-libdecnumber: +@if libdecnumber-bootstrap +maybe-all-stage1-libdecnumber: all-stage1-libdecnumber +all-stage1: all-stage1-libdecnumber +TARGET-stage1-libdecnumber = $(TARGET-libdecnumber) +all-stage1-libdecnumber: configure-stage1-libdecnumber + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-libdecnumber) + +maybe-clean-stage1-libdecnumber: clean-stage1-libdecnumber +clean-stage1: clean-stage1-libdecnumber +clean-stage1-libdecnumber: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif libdecnumber-bootstrap + + +.PHONY: all-stage2-libdecnumber maybe-all-stage2-libdecnumber +.PHONY: clean-stage2-libdecnumber maybe-clean-stage2-libdecnumber +maybe-all-stage2-libdecnumber: +maybe-clean-stage2-libdecnumber: +@if libdecnumber-bootstrap +maybe-all-stage2-libdecnumber: all-stage2-libdecnumber +all-stage2: all-stage2-libdecnumber +TARGET-stage2-libdecnumber = $(TARGET-libdecnumber) +all-stage2-libdecnumber: configure-stage2-libdecnumber + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-libdecnumber) + +maybe-clean-stage2-libdecnumber: clean-stage2-libdecnumber +clean-stage2: clean-stage2-libdecnumber +clean-stage2-libdecnumber: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libdecnumber-bootstrap + + +.PHONY: all-stage3-libdecnumber maybe-all-stage3-libdecnumber +.PHONY: clean-stage3-libdecnumber maybe-clean-stage3-libdecnumber +maybe-all-stage3-libdecnumber: +maybe-clean-stage3-libdecnumber: +@if libdecnumber-bootstrap +maybe-all-stage3-libdecnumber: all-stage3-libdecnumber +all-stage3: all-stage3-libdecnumber +TARGET-stage3-libdecnumber = $(TARGET-libdecnumber) +all-stage3-libdecnumber: configure-stage3-libdecnumber + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-libdecnumber) + +maybe-clean-stage3-libdecnumber: clean-stage3-libdecnumber +clean-stage3: clean-stage3-libdecnumber +clean-stage3-libdecnumber: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libdecnumber-bootstrap + + +.PHONY: all-stage4-libdecnumber maybe-all-stage4-libdecnumber +.PHONY: clean-stage4-libdecnumber maybe-clean-stage4-libdecnumber +maybe-all-stage4-libdecnumber: +maybe-clean-stage4-libdecnumber: +@if libdecnumber-bootstrap +maybe-all-stage4-libdecnumber: all-stage4-libdecnumber +all-stage4: all-stage4-libdecnumber +TARGET-stage4-libdecnumber = $(TARGET-libdecnumber) +all-stage4-libdecnumber: configure-stage4-libdecnumber + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-libdecnumber) + +maybe-clean-stage4-libdecnumber: clean-stage4-libdecnumber +clean-stage4: clean-stage4-libdecnumber +clean-stage4-libdecnumber: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libdecnumber-bootstrap + + +.PHONY: all-stageprofile-libdecnumber maybe-all-stageprofile-libdecnumber +.PHONY: clean-stageprofile-libdecnumber maybe-clean-stageprofile-libdecnumber +maybe-all-stageprofile-libdecnumber: +maybe-clean-stageprofile-libdecnumber: +@if libdecnumber-bootstrap +maybe-all-stageprofile-libdecnumber: all-stageprofile-libdecnumber +all-stageprofile: all-stageprofile-libdecnumber +TARGET-stageprofile-libdecnumber = $(TARGET-libdecnumber) +all-stageprofile-libdecnumber: configure-stageprofile-libdecnumber + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-libdecnumber) + +maybe-clean-stageprofile-libdecnumber: clean-stageprofile-libdecnumber +clean-stageprofile: clean-stageprofile-libdecnumber +clean-stageprofile-libdecnumber: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libdecnumber-bootstrap + + +.PHONY: all-stagefeedback-libdecnumber maybe-all-stagefeedback-libdecnumber +.PHONY: clean-stagefeedback-libdecnumber maybe-clean-stagefeedback-libdecnumber +maybe-all-stagefeedback-libdecnumber: +maybe-clean-stagefeedback-libdecnumber: +@if libdecnumber-bootstrap +maybe-all-stagefeedback-libdecnumber: all-stagefeedback-libdecnumber +all-stagefeedback: all-stagefeedback-libdecnumber +TARGET-stagefeedback-libdecnumber = $(TARGET-libdecnumber) +all-stagefeedback-libdecnumber: configure-stagefeedback-libdecnumber + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-libdecnumber) + +maybe-clean-stagefeedback-libdecnumber: clean-stagefeedback-libdecnumber +clean-stagefeedback: clean-stagefeedback-libdecnumber +clean-stagefeedback-libdecnumber: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libdecnumber-bootstrap + + + + + +.PHONY: check-libdecnumber maybe-check-libdecnumber +maybe-check-libdecnumber: +@if libdecnumber +maybe-check-libdecnumber: check-libdecnumber + +check-libdecnumber: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif libdecnumber + +.PHONY: install-libdecnumber maybe-install-libdecnumber +maybe-install-libdecnumber: +@if libdecnumber +maybe-install-libdecnumber: install-libdecnumber + +install-libdecnumber: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif libdecnumber + +.PHONY: install-strip-libdecnumber maybe-install-strip-libdecnumber +maybe-install-strip-libdecnumber: +@if libdecnumber +maybe-install-strip-libdecnumber: install-strip-libdecnumber + +install-strip-libdecnumber: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif libdecnumber + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-libdecnumber info-libdecnumber +maybe-info-libdecnumber: +@if libdecnumber +maybe-info-libdecnumber: info-libdecnumber + +info-libdecnumber: \ + configure-libdecnumber + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif libdecnumber + +.PHONY: maybe-dvi-libdecnumber dvi-libdecnumber +maybe-dvi-libdecnumber: +@if libdecnumber +maybe-dvi-libdecnumber: dvi-libdecnumber + +dvi-libdecnumber: \ + configure-libdecnumber + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif libdecnumber + +.PHONY: maybe-pdf-libdecnumber pdf-libdecnumber +maybe-pdf-libdecnumber: +@if libdecnumber +maybe-pdf-libdecnumber: pdf-libdecnumber + +pdf-libdecnumber: \ + configure-libdecnumber + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif libdecnumber + +.PHONY: maybe-html-libdecnumber html-libdecnumber +maybe-html-libdecnumber: +@if libdecnumber +maybe-html-libdecnumber: html-libdecnumber + +html-libdecnumber: \ + configure-libdecnumber + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif libdecnumber + +.PHONY: maybe-TAGS-libdecnumber TAGS-libdecnumber +maybe-TAGS-libdecnumber: +@if libdecnumber +maybe-TAGS-libdecnumber: TAGS-libdecnumber + +TAGS-libdecnumber: \ + configure-libdecnumber + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif libdecnumber + +.PHONY: maybe-install-info-libdecnumber install-info-libdecnumber +maybe-install-info-libdecnumber: +@if libdecnumber +maybe-install-info-libdecnumber: install-info-libdecnumber + +install-info-libdecnumber: \ + configure-libdecnumber \ + info-libdecnumber + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif libdecnumber + +.PHONY: maybe-install-pdf-libdecnumber install-pdf-libdecnumber +maybe-install-pdf-libdecnumber: +@if libdecnumber +maybe-install-pdf-libdecnumber: install-pdf-libdecnumber + +install-pdf-libdecnumber: \ + configure-libdecnumber \ + pdf-libdecnumber + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif libdecnumber + +.PHONY: maybe-install-html-libdecnumber install-html-libdecnumber +maybe-install-html-libdecnumber: +@if libdecnumber +maybe-install-html-libdecnumber: install-html-libdecnumber + +install-html-libdecnumber: \ + configure-libdecnumber \ + html-libdecnumber + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif libdecnumber + +.PHONY: maybe-installcheck-libdecnumber installcheck-libdecnumber +maybe-installcheck-libdecnumber: +@if libdecnumber +maybe-installcheck-libdecnumber: installcheck-libdecnumber + +installcheck-libdecnumber: \ + configure-libdecnumber + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif libdecnumber + +.PHONY: maybe-mostlyclean-libdecnumber mostlyclean-libdecnumber +maybe-mostlyclean-libdecnumber: +@if libdecnumber +maybe-mostlyclean-libdecnumber: mostlyclean-libdecnumber + +mostlyclean-libdecnumber: + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif libdecnumber + +.PHONY: maybe-clean-libdecnumber clean-libdecnumber +maybe-clean-libdecnumber: +@if libdecnumber +maybe-clean-libdecnumber: clean-libdecnumber + +clean-libdecnumber: + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif libdecnumber + +.PHONY: maybe-distclean-libdecnumber distclean-libdecnumber +maybe-distclean-libdecnumber: +@if libdecnumber +maybe-distclean-libdecnumber: distclean-libdecnumber + +distclean-libdecnumber: + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif libdecnumber + +.PHONY: maybe-maintainer-clean-libdecnumber maintainer-clean-libdecnumber +maybe-maintainer-clean-libdecnumber: +@if libdecnumber +maybe-maintainer-clean-libdecnumber: maintainer-clean-libdecnumber + +maintainer-clean-libdecnumber: + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif libdecnumber + + + +.PHONY: configure-libgui maybe-configure-libgui +maybe-configure-libgui: +@if gcc-bootstrap +configure-libgui: stage_current +@endif gcc-bootstrap +@if libgui +maybe-configure-libgui: configure-libgui +configure-libgui: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libgui/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libgui ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/libgui; \ + cd "$(HOST_SUBDIR)/libgui" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libgui/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgui"; \ + libsrcdir="$$s/libgui"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif libgui + + + + + +.PHONY: all-libgui maybe-all-libgui +maybe-all-libgui: +@if gcc-bootstrap +all-libgui: stage_current +@endif gcc-bootstrap +@if libgui +TARGET-libgui=all +maybe-all-libgui: all-libgui +all-libgui: configure-libgui + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-libgui)) +@endif libgui + + + + +.PHONY: check-libgui maybe-check-libgui +maybe-check-libgui: +@if libgui +maybe-check-libgui: check-libgui + +check-libgui: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif libgui + +.PHONY: install-libgui maybe-install-libgui +maybe-install-libgui: +@if libgui +maybe-install-libgui: install-libgui + +install-libgui: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif libgui + +.PHONY: install-strip-libgui maybe-install-strip-libgui +maybe-install-strip-libgui: +@if libgui +maybe-install-strip-libgui: install-strip-libgui + +install-strip-libgui: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif libgui + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-libgui info-libgui +maybe-info-libgui: +@if libgui +maybe-info-libgui: info-libgui + +info-libgui: \ + configure-libgui + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif libgui + +.PHONY: maybe-dvi-libgui dvi-libgui +maybe-dvi-libgui: +@if libgui +maybe-dvi-libgui: dvi-libgui + +dvi-libgui: \ + configure-libgui + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif libgui + +.PHONY: maybe-pdf-libgui pdf-libgui +maybe-pdf-libgui: +@if libgui +maybe-pdf-libgui: pdf-libgui + +pdf-libgui: \ + configure-libgui + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif libgui + +.PHONY: maybe-html-libgui html-libgui +maybe-html-libgui: +@if libgui +maybe-html-libgui: html-libgui + +html-libgui: \ + configure-libgui + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif libgui + +.PHONY: maybe-TAGS-libgui TAGS-libgui +maybe-TAGS-libgui: +@if libgui +maybe-TAGS-libgui: TAGS-libgui + +TAGS-libgui: \ + configure-libgui + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif libgui + +.PHONY: maybe-install-info-libgui install-info-libgui +maybe-install-info-libgui: +@if libgui +maybe-install-info-libgui: install-info-libgui + +install-info-libgui: \ + configure-libgui \ + info-libgui + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif libgui + +.PHONY: maybe-install-pdf-libgui install-pdf-libgui +maybe-install-pdf-libgui: +@if libgui +maybe-install-pdf-libgui: install-pdf-libgui + +install-pdf-libgui: \ + configure-libgui \ + pdf-libgui + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif libgui + +.PHONY: maybe-install-html-libgui install-html-libgui +maybe-install-html-libgui: +@if libgui +maybe-install-html-libgui: install-html-libgui + +install-html-libgui: \ + configure-libgui \ + html-libgui + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif libgui + +.PHONY: maybe-installcheck-libgui installcheck-libgui +maybe-installcheck-libgui: +@if libgui +maybe-installcheck-libgui: installcheck-libgui + +installcheck-libgui: \ + configure-libgui + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif libgui + +.PHONY: maybe-mostlyclean-libgui mostlyclean-libgui +maybe-mostlyclean-libgui: +@if libgui +maybe-mostlyclean-libgui: mostlyclean-libgui + +mostlyclean-libgui: + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif libgui + +.PHONY: maybe-clean-libgui clean-libgui +maybe-clean-libgui: +@if libgui +maybe-clean-libgui: clean-libgui + +clean-libgui: + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif libgui + +.PHONY: maybe-distclean-libgui distclean-libgui +maybe-distclean-libgui: +@if libgui +maybe-distclean-libgui: distclean-libgui + +distclean-libgui: + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif libgui + +.PHONY: maybe-maintainer-clean-libgui maintainer-clean-libgui +maybe-maintainer-clean-libgui: +@if libgui +maybe-maintainer-clean-libgui: maintainer-clean-libgui + +maintainer-clean-libgui: + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif libgui + + + +.PHONY: configure-libiberty maybe-configure-libiberty +maybe-configure-libiberty: +@if gcc-bootstrap +configure-libiberty: stage_current +@endif gcc-bootstrap +@if libiberty +maybe-configure-libiberty: configure-libiberty +configure-libiberty: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/libiberty; \ + cd "$(HOST_SUBDIR)/libiberty" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} @extra_host_libiberty_configure_flags@ \ + || exit 1 +@endif libiberty + + + +.PHONY: configure-stage1-libiberty maybe-configure-stage1-libiberty +maybe-configure-stage1-libiberty: +@if libiberty-bootstrap +maybe-configure-stage1-libiberty: configure-stage1-libiberty +configure-stage1-libiberty: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/libiberty ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) \ + @extra_host_libiberty_configure_flags@ +@endif libiberty-bootstrap + +.PHONY: configure-stage2-libiberty maybe-configure-stage2-libiberty +maybe-configure-stage2-libiberty: +@if libiberty-bootstrap +maybe-configure-stage2-libiberty: configure-stage2-libiberty +configure-stage2-libiberty: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/libiberty ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) \ + @extra_host_libiberty_configure_flags@ +@endif libiberty-bootstrap + +.PHONY: configure-stage3-libiberty maybe-configure-stage3-libiberty +maybe-configure-stage3-libiberty: +@if libiberty-bootstrap +maybe-configure-stage3-libiberty: configure-stage3-libiberty +configure-stage3-libiberty: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/libiberty ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) \ + @extra_host_libiberty_configure_flags@ +@endif libiberty-bootstrap + +.PHONY: configure-stage4-libiberty maybe-configure-stage4-libiberty +maybe-configure-stage4-libiberty: +@if libiberty-bootstrap +maybe-configure-stage4-libiberty: configure-stage4-libiberty +configure-stage4-libiberty: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/libiberty ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) \ + @extra_host_libiberty_configure_flags@ +@endif libiberty-bootstrap + +.PHONY: configure-stageprofile-libiberty maybe-configure-stageprofile-libiberty +maybe-configure-stageprofile-libiberty: +@if libiberty-bootstrap +maybe-configure-stageprofile-libiberty: configure-stageprofile-libiberty +configure-stageprofile-libiberty: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/libiberty ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) \ + @extra_host_libiberty_configure_flags@ +@endif libiberty-bootstrap + +.PHONY: configure-stagefeedback-libiberty maybe-configure-stagefeedback-libiberty +maybe-configure-stagefeedback-libiberty: +@if libiberty-bootstrap +maybe-configure-stagefeedback-libiberty: configure-stagefeedback-libiberty +configure-stagefeedback-libiberty: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/libiberty ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) \ + @extra_host_libiberty_configure_flags@ +@endif libiberty-bootstrap + + + + + +.PHONY: all-libiberty maybe-all-libiberty +maybe-all-libiberty: +@if gcc-bootstrap +all-libiberty: stage_current +@endif gcc-bootstrap +@if libiberty +TARGET-libiberty=all +maybe-all-libiberty: all-libiberty +all-libiberty: configure-libiberty + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-libiberty)) +@endif libiberty + + + +.PHONY: all-stage1-libiberty maybe-all-stage1-libiberty +.PHONY: clean-stage1-libiberty maybe-clean-stage1-libiberty +maybe-all-stage1-libiberty: +maybe-clean-stage1-libiberty: +@if libiberty-bootstrap +maybe-all-stage1-libiberty: all-stage1-libiberty +all-stage1: all-stage1-libiberty +TARGET-stage1-libiberty = $(TARGET-libiberty) +all-stage1-libiberty: configure-stage1-libiberty + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-libiberty) + +maybe-clean-stage1-libiberty: clean-stage1-libiberty +clean-stage1: clean-stage1-libiberty +clean-stage1-libiberty: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-libiberty/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif libiberty-bootstrap + + +.PHONY: all-stage2-libiberty maybe-all-stage2-libiberty +.PHONY: clean-stage2-libiberty maybe-clean-stage2-libiberty +maybe-all-stage2-libiberty: +maybe-clean-stage2-libiberty: +@if libiberty-bootstrap +maybe-all-stage2-libiberty: all-stage2-libiberty +all-stage2: all-stage2-libiberty +TARGET-stage2-libiberty = $(TARGET-libiberty) +all-stage2-libiberty: configure-stage2-libiberty + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-libiberty) + +maybe-clean-stage2-libiberty: clean-stage2-libiberty +clean-stage2: clean-stage2-libiberty +clean-stage2-libiberty: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-libiberty/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libiberty-bootstrap + + +.PHONY: all-stage3-libiberty maybe-all-stage3-libiberty +.PHONY: clean-stage3-libiberty maybe-clean-stage3-libiberty +maybe-all-stage3-libiberty: +maybe-clean-stage3-libiberty: +@if libiberty-bootstrap +maybe-all-stage3-libiberty: all-stage3-libiberty +all-stage3: all-stage3-libiberty +TARGET-stage3-libiberty = $(TARGET-libiberty) +all-stage3-libiberty: configure-stage3-libiberty + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-libiberty) + +maybe-clean-stage3-libiberty: clean-stage3-libiberty +clean-stage3: clean-stage3-libiberty +clean-stage3-libiberty: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-libiberty/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libiberty-bootstrap + + +.PHONY: all-stage4-libiberty maybe-all-stage4-libiberty +.PHONY: clean-stage4-libiberty maybe-clean-stage4-libiberty +maybe-all-stage4-libiberty: +maybe-clean-stage4-libiberty: +@if libiberty-bootstrap +maybe-all-stage4-libiberty: all-stage4-libiberty +all-stage4: all-stage4-libiberty +TARGET-stage4-libiberty = $(TARGET-libiberty) +all-stage4-libiberty: configure-stage4-libiberty + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-libiberty) + +maybe-clean-stage4-libiberty: clean-stage4-libiberty +clean-stage4: clean-stage4-libiberty +clean-stage4-libiberty: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-libiberty/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libiberty-bootstrap + + +.PHONY: all-stageprofile-libiberty maybe-all-stageprofile-libiberty +.PHONY: clean-stageprofile-libiberty maybe-clean-stageprofile-libiberty +maybe-all-stageprofile-libiberty: +maybe-clean-stageprofile-libiberty: +@if libiberty-bootstrap +maybe-all-stageprofile-libiberty: all-stageprofile-libiberty +all-stageprofile: all-stageprofile-libiberty +TARGET-stageprofile-libiberty = $(TARGET-libiberty) +all-stageprofile-libiberty: configure-stageprofile-libiberty + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-libiberty) + +maybe-clean-stageprofile-libiberty: clean-stageprofile-libiberty +clean-stageprofile: clean-stageprofile-libiberty +clean-stageprofile-libiberty: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-libiberty/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libiberty-bootstrap + + +.PHONY: all-stagefeedback-libiberty maybe-all-stagefeedback-libiberty +.PHONY: clean-stagefeedback-libiberty maybe-clean-stagefeedback-libiberty +maybe-all-stagefeedback-libiberty: +maybe-clean-stagefeedback-libiberty: +@if libiberty-bootstrap +maybe-all-stagefeedback-libiberty: all-stagefeedback-libiberty +all-stagefeedback: all-stagefeedback-libiberty +TARGET-stagefeedback-libiberty = $(TARGET-libiberty) +all-stagefeedback-libiberty: configure-stagefeedback-libiberty + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-libiberty) + +maybe-clean-stagefeedback-libiberty: clean-stagefeedback-libiberty +clean-stagefeedback: clean-stagefeedback-libiberty +clean-stagefeedback-libiberty: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-libiberty/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libiberty-bootstrap + + + + + +.PHONY: check-libiberty maybe-check-libiberty +maybe-check-libiberty: +@if libiberty +maybe-check-libiberty: check-libiberty + +check-libiberty: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif libiberty + +.PHONY: install-libiberty maybe-install-libiberty +maybe-install-libiberty: +@if libiberty +maybe-install-libiberty: install-libiberty + +install-libiberty: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif libiberty + +.PHONY: install-strip-libiberty maybe-install-strip-libiberty +maybe-install-strip-libiberty: +@if libiberty +maybe-install-strip-libiberty: install-strip-libiberty + +install-strip-libiberty: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif libiberty + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-libiberty info-libiberty +maybe-info-libiberty: +@if libiberty +maybe-info-libiberty: info-libiberty + +info-libiberty: \ + configure-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif libiberty + +.PHONY: maybe-dvi-libiberty dvi-libiberty +maybe-dvi-libiberty: +@if libiberty +maybe-dvi-libiberty: dvi-libiberty + +dvi-libiberty: \ + configure-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif libiberty + +.PHONY: maybe-pdf-libiberty pdf-libiberty +maybe-pdf-libiberty: +@if libiberty +maybe-pdf-libiberty: pdf-libiberty + +pdf-libiberty: \ + configure-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif libiberty + +.PHONY: maybe-html-libiberty html-libiberty +maybe-html-libiberty: +@if libiberty +maybe-html-libiberty: html-libiberty + +html-libiberty: \ + configure-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif libiberty + +.PHONY: maybe-TAGS-libiberty TAGS-libiberty +maybe-TAGS-libiberty: +@if libiberty +maybe-TAGS-libiberty: TAGS-libiberty + +TAGS-libiberty: \ + configure-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif libiberty + +.PHONY: maybe-install-info-libiberty install-info-libiberty +maybe-install-info-libiberty: +@if libiberty +maybe-install-info-libiberty: install-info-libiberty + +install-info-libiberty: \ + configure-libiberty \ + info-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif libiberty + +.PHONY: maybe-install-pdf-libiberty install-pdf-libiberty +maybe-install-pdf-libiberty: +@if libiberty +maybe-install-pdf-libiberty: install-pdf-libiberty + +install-pdf-libiberty: \ + configure-libiberty \ + pdf-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif libiberty + +.PHONY: maybe-install-html-libiberty install-html-libiberty +maybe-install-html-libiberty: +@if libiberty +maybe-install-html-libiberty: install-html-libiberty + +install-html-libiberty: \ + configure-libiberty \ + html-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif libiberty + +.PHONY: maybe-installcheck-libiberty installcheck-libiberty +maybe-installcheck-libiberty: +@if libiberty +maybe-installcheck-libiberty: installcheck-libiberty + +installcheck-libiberty: \ + configure-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif libiberty + +.PHONY: maybe-mostlyclean-libiberty mostlyclean-libiberty +maybe-mostlyclean-libiberty: +@if libiberty +maybe-mostlyclean-libiberty: mostlyclean-libiberty + +mostlyclean-libiberty: + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif libiberty + +.PHONY: maybe-clean-libiberty clean-libiberty +maybe-clean-libiberty: +@if libiberty +maybe-clean-libiberty: clean-libiberty + +clean-libiberty: + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif libiberty + +.PHONY: maybe-distclean-libiberty distclean-libiberty +maybe-distclean-libiberty: +@if libiberty +maybe-distclean-libiberty: distclean-libiberty + +distclean-libiberty: + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif libiberty + +.PHONY: maybe-maintainer-clean-libiberty maintainer-clean-libiberty +maybe-maintainer-clean-libiberty: +@if libiberty +maybe-maintainer-clean-libiberty: maintainer-clean-libiberty + +maintainer-clean-libiberty: + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif libiberty + + + +.PHONY: configure-libiconv maybe-configure-libiconv +maybe-configure-libiconv: +@if gcc-bootstrap +configure-libiconv: stage_current +@endif gcc-bootstrap +@if libiconv +maybe-configure-libiconv: configure-libiconv +configure-libiconv: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libiconv/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiconv ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/libiconv; \ + cd "$(HOST_SUBDIR)/libiconv" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libiconv/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libiconv"; \ + libsrcdir="$$s/libiconv"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} --disable-shared \ + || exit 1 +@endif libiconv + + + + + +.PHONY: all-libiconv maybe-all-libiconv +maybe-all-libiconv: +@if gcc-bootstrap +all-libiconv: stage_current +@endif gcc-bootstrap +@if libiconv +TARGET-libiconv=all +maybe-all-libiconv: all-libiconv +all-libiconv: configure-libiconv + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libiconv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-libiconv)) +@endif libiconv + + + + +.PHONY: check-libiconv maybe-check-libiconv +maybe-check-libiconv: +@if libiconv +maybe-check-libiconv: check-libiconv + +check-libiconv: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libiconv && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif libiconv + +.PHONY: install-libiconv maybe-install-libiconv +maybe-install-libiconv: +@if libiconv +maybe-install-libiconv: install-libiconv + +install-libiconv: + +@endif libiconv + +.PHONY: install-strip-libiconv maybe-install-strip-libiconv +maybe-install-strip-libiconv: +@if libiconv +maybe-install-strip-libiconv: install-strip-libiconv + +install-strip-libiconv: + +@endif libiconv + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-libiconv info-libiconv +maybe-info-libiconv: +@if libiconv +maybe-info-libiconv: info-libiconv + +info-libiconv: \ + configure-libiconv + @: $(MAKE); $(unstage) + @[ -f ./libiconv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in libiconv" ; \ + (cd $(HOST_SUBDIR)/libiconv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif libiconv + +.PHONY: maybe-dvi-libiconv dvi-libiconv +maybe-dvi-libiconv: +@if libiconv +maybe-dvi-libiconv: dvi-libiconv + +dvi-libiconv: \ + configure-libiconv + @: $(MAKE); $(unstage) + @[ -f ./libiconv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in libiconv" ; \ + (cd $(HOST_SUBDIR)/libiconv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif libiconv + +.PHONY: maybe-pdf-libiconv pdf-libiconv +maybe-pdf-libiconv: +@if libiconv +maybe-pdf-libiconv: pdf-libiconv + +pdf-libiconv: \ + configure-libiconv + @: $(MAKE); $(unstage) + @[ -f ./libiconv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libiconv" ; \ + (cd $(HOST_SUBDIR)/libiconv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif libiconv + +.PHONY: maybe-html-libiconv html-libiconv +maybe-html-libiconv: +@if libiconv +maybe-html-libiconv: html-libiconv + +html-libiconv: \ + configure-libiconv + @: $(MAKE); $(unstage) + @[ -f ./libiconv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in libiconv" ; \ + (cd $(HOST_SUBDIR)/libiconv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif libiconv + +.PHONY: maybe-TAGS-libiconv TAGS-libiconv +maybe-TAGS-libiconv: +@if libiconv +maybe-TAGS-libiconv: TAGS-libiconv + +TAGS-libiconv: \ + configure-libiconv + @: $(MAKE); $(unstage) + @[ -f ./libiconv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in libiconv" ; \ + (cd $(HOST_SUBDIR)/libiconv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif libiconv + +.PHONY: maybe-install-info-libiconv install-info-libiconv +maybe-install-info-libiconv: +@if libiconv +maybe-install-info-libiconv: install-info-libiconv + +# libiconv doesn't support install-info. +install-info-libiconv: + +@endif libiconv + +.PHONY: maybe-install-pdf-libiconv install-pdf-libiconv +maybe-install-pdf-libiconv: +@if libiconv +maybe-install-pdf-libiconv: install-pdf-libiconv + +# libiconv doesn't support install-pdf. +install-pdf-libiconv: + +@endif libiconv + +.PHONY: maybe-install-html-libiconv install-html-libiconv +maybe-install-html-libiconv: +@if libiconv +maybe-install-html-libiconv: install-html-libiconv + +# libiconv doesn't support install-html. +install-html-libiconv: + +@endif libiconv + +.PHONY: maybe-installcheck-libiconv installcheck-libiconv +maybe-installcheck-libiconv: +@if libiconv +maybe-installcheck-libiconv: installcheck-libiconv + +installcheck-libiconv: \ + configure-libiconv + @: $(MAKE); $(unstage) + @[ -f ./libiconv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in libiconv" ; \ + (cd $(HOST_SUBDIR)/libiconv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif libiconv + +.PHONY: maybe-mostlyclean-libiconv mostlyclean-libiconv +maybe-mostlyclean-libiconv: +@if libiconv +maybe-mostlyclean-libiconv: mostlyclean-libiconv + +mostlyclean-libiconv: + @: $(MAKE); $(unstage) + @[ -f ./libiconv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in libiconv" ; \ + (cd $(HOST_SUBDIR)/libiconv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif libiconv + +.PHONY: maybe-clean-libiconv clean-libiconv +maybe-clean-libiconv: +@if libiconv +maybe-clean-libiconv: clean-libiconv + +clean-libiconv: + @: $(MAKE); $(unstage) + @[ -f ./libiconv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in libiconv" ; \ + (cd $(HOST_SUBDIR)/libiconv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif libiconv + +.PHONY: maybe-distclean-libiconv distclean-libiconv +maybe-distclean-libiconv: +@if libiconv +maybe-distclean-libiconv: distclean-libiconv + +distclean-libiconv: + @: $(MAKE); $(unstage) + @[ -f ./libiconv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in libiconv" ; \ + (cd $(HOST_SUBDIR)/libiconv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif libiconv + +.PHONY: maybe-maintainer-clean-libiconv maintainer-clean-libiconv +maybe-maintainer-clean-libiconv: +@if libiconv +maybe-maintainer-clean-libiconv: maintainer-clean-libiconv + +maintainer-clean-libiconv: + @: $(MAKE); $(unstage) + @[ -f ./libiconv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in libiconv" ; \ + (cd $(HOST_SUBDIR)/libiconv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif libiconv + + + +.PHONY: configure-m4 maybe-configure-m4 +maybe-configure-m4: +@if gcc-bootstrap +configure-m4: stage_current +@endif gcc-bootstrap +@if m4 +maybe-configure-m4: configure-m4 +configure-m4: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/m4/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/m4 ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/m4; \ + cd "$(HOST_SUBDIR)/m4" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/m4/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/m4"; \ + libsrcdir="$$s/m4"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif m4 + + + + + +.PHONY: all-m4 maybe-all-m4 +maybe-all-m4: +@if gcc-bootstrap +all-m4: stage_current +@endif gcc-bootstrap +@if m4 +TARGET-m4=all +maybe-all-m4: all-m4 +all-m4: configure-m4 + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-m4)) +@endif m4 + + + + +.PHONY: check-m4 maybe-check-m4 +maybe-check-m4: +@if m4 +maybe-check-m4: check-m4 + +check-m4: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif m4 + +.PHONY: install-m4 maybe-install-m4 +maybe-install-m4: +@if m4 +maybe-install-m4: install-m4 + +install-m4: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif m4 + +.PHONY: install-strip-m4 maybe-install-strip-m4 +maybe-install-strip-m4: +@if m4 +maybe-install-strip-m4: install-strip-m4 + +install-strip-m4: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif m4 + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-m4 info-m4 +maybe-info-m4: +@if m4 +maybe-info-m4: info-m4 + +info-m4: \ + configure-m4 + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif m4 + +.PHONY: maybe-dvi-m4 dvi-m4 +maybe-dvi-m4: +@if m4 +maybe-dvi-m4: dvi-m4 + +dvi-m4: \ + configure-m4 + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif m4 + +.PHONY: maybe-pdf-m4 pdf-m4 +maybe-pdf-m4: +@if m4 +maybe-pdf-m4: pdf-m4 + +pdf-m4: \ + configure-m4 + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif m4 + +.PHONY: maybe-html-m4 html-m4 +maybe-html-m4: +@if m4 +maybe-html-m4: html-m4 + +html-m4: \ + configure-m4 + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif m4 + +.PHONY: maybe-TAGS-m4 TAGS-m4 +maybe-TAGS-m4: +@if m4 +maybe-TAGS-m4: TAGS-m4 + +TAGS-m4: \ + configure-m4 + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif m4 + +.PHONY: maybe-install-info-m4 install-info-m4 +maybe-install-info-m4: +@if m4 +maybe-install-info-m4: install-info-m4 + +install-info-m4: \ + configure-m4 \ + info-m4 + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif m4 + +.PHONY: maybe-install-pdf-m4 install-pdf-m4 +maybe-install-pdf-m4: +@if m4 +maybe-install-pdf-m4: install-pdf-m4 + +install-pdf-m4: \ + configure-m4 \ + pdf-m4 + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif m4 + +.PHONY: maybe-install-html-m4 install-html-m4 +maybe-install-html-m4: +@if m4 +maybe-install-html-m4: install-html-m4 + +install-html-m4: \ + configure-m4 \ + html-m4 + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif m4 + +.PHONY: maybe-installcheck-m4 installcheck-m4 +maybe-installcheck-m4: +@if m4 +maybe-installcheck-m4: installcheck-m4 + +installcheck-m4: \ + configure-m4 + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif m4 + +.PHONY: maybe-mostlyclean-m4 mostlyclean-m4 +maybe-mostlyclean-m4: +@if m4 +maybe-mostlyclean-m4: mostlyclean-m4 + +mostlyclean-m4: + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif m4 + +.PHONY: maybe-clean-m4 clean-m4 +maybe-clean-m4: +@if m4 +maybe-clean-m4: clean-m4 + +clean-m4: + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif m4 + +.PHONY: maybe-distclean-m4 distclean-m4 +maybe-distclean-m4: +@if m4 +maybe-distclean-m4: distclean-m4 + +distclean-m4: + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif m4 + +.PHONY: maybe-maintainer-clean-m4 maintainer-clean-m4 +maybe-maintainer-clean-m4: +@if m4 +maybe-maintainer-clean-m4: maintainer-clean-m4 + +maintainer-clean-m4: + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif m4 + + + +.PHONY: configure-readline maybe-configure-readline +maybe-configure-readline: +@if gcc-bootstrap +configure-readline: stage_current +@endif gcc-bootstrap +@if readline +maybe-configure-readline: configure-readline +configure-readline: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/readline/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/readline ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/readline; \ + cd "$(HOST_SUBDIR)/readline" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/readline/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/readline"; \ + libsrcdir="$$s/readline"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif readline + + + + + +.PHONY: all-readline maybe-all-readline +maybe-all-readline: +@if gcc-bootstrap +all-readline: stage_current +@endif gcc-bootstrap +@if readline +TARGET-readline=all +maybe-all-readline: all-readline +all-readline: configure-readline + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-readline)) +@endif readline + + + + +.PHONY: check-readline maybe-check-readline +maybe-check-readline: +@if readline +maybe-check-readline: check-readline + +check-readline: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif readline + +.PHONY: install-readline maybe-install-readline +maybe-install-readline: +@if readline +maybe-install-readline: install-readline + +install-readline: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif readline + +.PHONY: install-strip-readline maybe-install-strip-readline +maybe-install-strip-readline: +@if readline +maybe-install-strip-readline: install-strip-readline + +install-strip-readline: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif readline + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-readline info-readline +maybe-info-readline: +@if readline +maybe-info-readline: info-readline + +info-readline: \ + configure-readline + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif readline + +.PHONY: maybe-dvi-readline dvi-readline +maybe-dvi-readline: +@if readline +maybe-dvi-readline: dvi-readline + +dvi-readline: \ + configure-readline + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif readline + +.PHONY: maybe-pdf-readline pdf-readline +maybe-pdf-readline: +@if readline +maybe-pdf-readline: pdf-readline + +pdf-readline: \ + configure-readline + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif readline + +.PHONY: maybe-html-readline html-readline +maybe-html-readline: +@if readline +maybe-html-readline: html-readline + +html-readline: \ + configure-readline + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif readline + +.PHONY: maybe-TAGS-readline TAGS-readline +maybe-TAGS-readline: +@if readline +maybe-TAGS-readline: TAGS-readline + +TAGS-readline: \ + configure-readline + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif readline + +.PHONY: maybe-install-info-readline install-info-readline +maybe-install-info-readline: +@if readline +maybe-install-info-readline: install-info-readline + +install-info-readline: \ + configure-readline \ + info-readline + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif readline + +.PHONY: maybe-install-pdf-readline install-pdf-readline +maybe-install-pdf-readline: +@if readline +maybe-install-pdf-readline: install-pdf-readline + +install-pdf-readline: \ + configure-readline \ + pdf-readline + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif readline + +.PHONY: maybe-install-html-readline install-html-readline +maybe-install-html-readline: +@if readline +maybe-install-html-readline: install-html-readline + +install-html-readline: \ + configure-readline \ + html-readline + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif readline + +.PHONY: maybe-installcheck-readline installcheck-readline +maybe-installcheck-readline: +@if readline +maybe-installcheck-readline: installcheck-readline + +installcheck-readline: \ + configure-readline + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif readline + +.PHONY: maybe-mostlyclean-readline mostlyclean-readline +maybe-mostlyclean-readline: +@if readline +maybe-mostlyclean-readline: mostlyclean-readline + +mostlyclean-readline: + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif readline + +.PHONY: maybe-clean-readline clean-readline +maybe-clean-readline: +@if readline +maybe-clean-readline: clean-readline + +clean-readline: + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif readline + +.PHONY: maybe-distclean-readline distclean-readline +maybe-distclean-readline: +@if readline +maybe-distclean-readline: distclean-readline + +distclean-readline: + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif readline + +.PHONY: maybe-maintainer-clean-readline maintainer-clean-readline +maybe-maintainer-clean-readline: +@if readline +maybe-maintainer-clean-readline: maintainer-clean-readline + +maintainer-clean-readline: + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif readline + + + +.PHONY: configure-sid maybe-configure-sid +maybe-configure-sid: +@if gcc-bootstrap +configure-sid: stage_current +@endif gcc-bootstrap +@if sid +maybe-configure-sid: configure-sid +configure-sid: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/sid/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/sid ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/sid; \ + cd "$(HOST_SUBDIR)/sid" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/sid/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/sid"; \ + libsrcdir="$$s/sid"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif sid + + + + + +.PHONY: all-sid maybe-all-sid +maybe-all-sid: +@if gcc-bootstrap +all-sid: stage_current +@endif gcc-bootstrap +@if sid +TARGET-sid=all +maybe-all-sid: all-sid +all-sid: configure-sid + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-sid)) +@endif sid + + + + +.PHONY: check-sid maybe-check-sid +maybe-check-sid: +@if sid +maybe-check-sid: check-sid + +check-sid: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif sid + +.PHONY: install-sid maybe-install-sid +maybe-install-sid: +@if sid +maybe-install-sid: install-sid + +install-sid: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif sid + +.PHONY: install-strip-sid maybe-install-strip-sid +maybe-install-strip-sid: +@if sid +maybe-install-strip-sid: install-strip-sid + +install-strip-sid: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif sid + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-sid info-sid +maybe-info-sid: +@if sid +maybe-info-sid: info-sid + +info-sid: \ + configure-sid + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif sid + +.PHONY: maybe-dvi-sid dvi-sid +maybe-dvi-sid: +@if sid +maybe-dvi-sid: dvi-sid + +dvi-sid: \ + configure-sid + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif sid + +.PHONY: maybe-pdf-sid pdf-sid +maybe-pdf-sid: +@if sid +maybe-pdf-sid: pdf-sid + +pdf-sid: \ + configure-sid + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif sid + +.PHONY: maybe-html-sid html-sid +maybe-html-sid: +@if sid +maybe-html-sid: html-sid + +html-sid: \ + configure-sid + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif sid + +.PHONY: maybe-TAGS-sid TAGS-sid +maybe-TAGS-sid: +@if sid +maybe-TAGS-sid: TAGS-sid + +TAGS-sid: \ + configure-sid + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif sid + +.PHONY: maybe-install-info-sid install-info-sid +maybe-install-info-sid: +@if sid +maybe-install-info-sid: install-info-sid + +install-info-sid: \ + configure-sid \ + info-sid + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif sid + +.PHONY: maybe-install-pdf-sid install-pdf-sid +maybe-install-pdf-sid: +@if sid +maybe-install-pdf-sid: install-pdf-sid + +install-pdf-sid: \ + configure-sid \ + pdf-sid + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif sid + +.PHONY: maybe-install-html-sid install-html-sid +maybe-install-html-sid: +@if sid +maybe-install-html-sid: install-html-sid + +install-html-sid: \ + configure-sid \ + html-sid + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif sid + +.PHONY: maybe-installcheck-sid installcheck-sid +maybe-installcheck-sid: +@if sid +maybe-installcheck-sid: installcheck-sid + +installcheck-sid: \ + configure-sid + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif sid + +.PHONY: maybe-mostlyclean-sid mostlyclean-sid +maybe-mostlyclean-sid: +@if sid +maybe-mostlyclean-sid: mostlyclean-sid + +mostlyclean-sid: + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif sid + +.PHONY: maybe-clean-sid clean-sid +maybe-clean-sid: +@if sid +maybe-clean-sid: clean-sid + +clean-sid: + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif sid + +.PHONY: maybe-distclean-sid distclean-sid +maybe-distclean-sid: +@if sid +maybe-distclean-sid: distclean-sid + +distclean-sid: + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif sid + +.PHONY: maybe-maintainer-clean-sid maintainer-clean-sid +maybe-maintainer-clean-sid: +@if sid +maybe-maintainer-clean-sid: maintainer-clean-sid + +maintainer-clean-sid: + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif sid + + + +.PHONY: configure-sim maybe-configure-sim +maybe-configure-sim: +@if gcc-bootstrap +configure-sim: stage_current +@endif gcc-bootstrap +@if sim +maybe-configure-sim: configure-sim +configure-sim: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/sim/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/sim ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/sim; \ + cd "$(HOST_SUBDIR)/sim" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/sim/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/sim"; \ + libsrcdir="$$s/sim"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif sim + + + + + +.PHONY: all-sim maybe-all-sim +maybe-all-sim: +@if gcc-bootstrap +all-sim: stage_current +@endif gcc-bootstrap +@if sim +TARGET-sim=all +maybe-all-sim: all-sim +all-sim: configure-sim + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-sim)) +@endif sim + + + + +.PHONY: check-sim maybe-check-sim +maybe-check-sim: +@if sim +maybe-check-sim: check-sim + +check-sim: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif sim + +.PHONY: install-sim maybe-install-sim +maybe-install-sim: +@if sim +maybe-install-sim: install-sim + +install-sim: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif sim + +.PHONY: install-strip-sim maybe-install-strip-sim +maybe-install-strip-sim: +@if sim +maybe-install-strip-sim: install-strip-sim + +install-strip-sim: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif sim + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-sim info-sim +maybe-info-sim: +@if sim +maybe-info-sim: info-sim + +info-sim: \ + configure-sim + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif sim + +.PHONY: maybe-dvi-sim dvi-sim +maybe-dvi-sim: +@if sim +maybe-dvi-sim: dvi-sim + +dvi-sim: \ + configure-sim + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif sim + +.PHONY: maybe-pdf-sim pdf-sim +maybe-pdf-sim: +@if sim +maybe-pdf-sim: pdf-sim + +pdf-sim: \ + configure-sim + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif sim + +.PHONY: maybe-html-sim html-sim +maybe-html-sim: +@if sim +maybe-html-sim: html-sim + +html-sim: \ + configure-sim + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif sim + +.PHONY: maybe-TAGS-sim TAGS-sim +maybe-TAGS-sim: +@if sim +maybe-TAGS-sim: TAGS-sim + +TAGS-sim: \ + configure-sim + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif sim + +.PHONY: maybe-install-info-sim install-info-sim +maybe-install-info-sim: +@if sim +maybe-install-info-sim: install-info-sim + +install-info-sim: \ + configure-sim \ + info-sim + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif sim + +.PHONY: maybe-install-pdf-sim install-pdf-sim +maybe-install-pdf-sim: +@if sim +maybe-install-pdf-sim: install-pdf-sim + +install-pdf-sim: \ + configure-sim \ + pdf-sim + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif sim + +.PHONY: maybe-install-html-sim install-html-sim +maybe-install-html-sim: +@if sim +maybe-install-html-sim: install-html-sim + +install-html-sim: \ + configure-sim \ + html-sim + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif sim + +.PHONY: maybe-installcheck-sim installcheck-sim +maybe-installcheck-sim: +@if sim +maybe-installcheck-sim: installcheck-sim + +installcheck-sim: \ + configure-sim + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif sim + +.PHONY: maybe-mostlyclean-sim mostlyclean-sim +maybe-mostlyclean-sim: +@if sim +maybe-mostlyclean-sim: mostlyclean-sim + +mostlyclean-sim: + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif sim + +.PHONY: maybe-clean-sim clean-sim +maybe-clean-sim: +@if sim +maybe-clean-sim: clean-sim + +clean-sim: + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif sim + +.PHONY: maybe-distclean-sim distclean-sim +maybe-distclean-sim: +@if sim +maybe-distclean-sim: distclean-sim + +distclean-sim: + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif sim + +.PHONY: maybe-maintainer-clean-sim maintainer-clean-sim +maybe-maintainer-clean-sim: +@if sim +maybe-maintainer-clean-sim: maintainer-clean-sim + +maintainer-clean-sim: + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif sim + + + +.PHONY: configure-texinfo maybe-configure-texinfo +maybe-configure-texinfo: +@if gcc-bootstrap +configure-texinfo: stage_current +@endif gcc-bootstrap +@if texinfo +maybe-configure-texinfo: configure-texinfo +configure-texinfo: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/texinfo/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/texinfo ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/texinfo; \ + cd "$(HOST_SUBDIR)/texinfo" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/texinfo/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/texinfo"; \ + libsrcdir="$$s/texinfo"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif texinfo + + + + + +.PHONY: all-texinfo maybe-all-texinfo +maybe-all-texinfo: +@if gcc-bootstrap +all-texinfo: stage_current +@endif gcc-bootstrap +@if texinfo +TARGET-texinfo=all +maybe-all-texinfo: all-texinfo +all-texinfo: configure-texinfo + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-texinfo)) +@endif texinfo + + + + +.PHONY: check-texinfo maybe-check-texinfo +maybe-check-texinfo: +@if texinfo +maybe-check-texinfo: check-texinfo + +check-texinfo: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif texinfo + +.PHONY: install-texinfo maybe-install-texinfo +maybe-install-texinfo: +@if texinfo +maybe-install-texinfo: install-texinfo + +install-texinfo: + +@endif texinfo + +.PHONY: install-strip-texinfo maybe-install-strip-texinfo +maybe-install-strip-texinfo: +@if texinfo +maybe-install-strip-texinfo: install-strip-texinfo + +install-strip-texinfo: + +@endif texinfo + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-texinfo info-texinfo +maybe-info-texinfo: +@if texinfo +maybe-info-texinfo: info-texinfo + +info-texinfo: \ + configure-texinfo + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif texinfo + +.PHONY: maybe-dvi-texinfo dvi-texinfo +maybe-dvi-texinfo: +@if texinfo +maybe-dvi-texinfo: dvi-texinfo + +dvi-texinfo: \ + configure-texinfo + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif texinfo + +.PHONY: maybe-pdf-texinfo pdf-texinfo +maybe-pdf-texinfo: +@if texinfo +maybe-pdf-texinfo: pdf-texinfo + +pdf-texinfo: \ + configure-texinfo + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif texinfo + +.PHONY: maybe-html-texinfo html-texinfo +maybe-html-texinfo: +@if texinfo +maybe-html-texinfo: html-texinfo + +html-texinfo: \ + configure-texinfo + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif texinfo + +.PHONY: maybe-TAGS-texinfo TAGS-texinfo +maybe-TAGS-texinfo: +@if texinfo +maybe-TAGS-texinfo: TAGS-texinfo + +TAGS-texinfo: \ + configure-texinfo + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif texinfo + +.PHONY: maybe-install-info-texinfo install-info-texinfo +maybe-install-info-texinfo: +@if texinfo +maybe-install-info-texinfo: install-info-texinfo + +install-info-texinfo: \ + configure-texinfo \ + info-texinfo + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif texinfo + +.PHONY: maybe-install-pdf-texinfo install-pdf-texinfo +maybe-install-pdf-texinfo: +@if texinfo +maybe-install-pdf-texinfo: install-pdf-texinfo + +install-pdf-texinfo: \ + configure-texinfo \ + pdf-texinfo + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif texinfo + +.PHONY: maybe-install-html-texinfo install-html-texinfo +maybe-install-html-texinfo: +@if texinfo +maybe-install-html-texinfo: install-html-texinfo + +install-html-texinfo: \ + configure-texinfo \ + html-texinfo + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif texinfo + +.PHONY: maybe-installcheck-texinfo installcheck-texinfo +maybe-installcheck-texinfo: +@if texinfo +maybe-installcheck-texinfo: installcheck-texinfo + +installcheck-texinfo: \ + configure-texinfo + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif texinfo + +.PHONY: maybe-mostlyclean-texinfo mostlyclean-texinfo +maybe-mostlyclean-texinfo: +@if texinfo +maybe-mostlyclean-texinfo: mostlyclean-texinfo + +mostlyclean-texinfo: + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif texinfo + +.PHONY: maybe-clean-texinfo clean-texinfo +maybe-clean-texinfo: +@if texinfo +maybe-clean-texinfo: clean-texinfo + +clean-texinfo: + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif texinfo + +.PHONY: maybe-distclean-texinfo distclean-texinfo +maybe-distclean-texinfo: +@if texinfo +maybe-distclean-texinfo: distclean-texinfo + +distclean-texinfo: + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif texinfo + +.PHONY: maybe-maintainer-clean-texinfo maintainer-clean-texinfo +maybe-maintainer-clean-texinfo: +@if texinfo +maybe-maintainer-clean-texinfo: maintainer-clean-texinfo + +maintainer-clean-texinfo: + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif texinfo + + + +.PHONY: configure-zlib maybe-configure-zlib +maybe-configure-zlib: +@if gcc-bootstrap +configure-zlib: stage_current +@endif gcc-bootstrap +@if zlib +maybe-configure-zlib: configure-zlib +configure-zlib: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/zlib; \ + cd "$(HOST_SUBDIR)/zlib" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/zlib"; \ + libsrcdir="$$s/zlib"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif zlib + + + +.PHONY: configure-stage1-zlib maybe-configure-stage1-zlib +maybe-configure-stage1-zlib: +@if zlib-bootstrap +maybe-configure-stage1-zlib: configure-stage1-zlib +configure-stage1-zlib: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/zlib ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/zlib"; \ + libsrcdir="$$s/zlib"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) +@endif zlib-bootstrap + +.PHONY: configure-stage2-zlib maybe-configure-stage2-zlib +maybe-configure-stage2-zlib: +@if zlib-bootstrap +maybe-configure-stage2-zlib: configure-stage2-zlib +configure-stage2-zlib: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/zlib ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/zlib"; \ + libsrcdir="$$s/zlib"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) +@endif zlib-bootstrap + +.PHONY: configure-stage3-zlib maybe-configure-stage3-zlib +maybe-configure-stage3-zlib: +@if zlib-bootstrap +maybe-configure-stage3-zlib: configure-stage3-zlib +configure-stage3-zlib: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/zlib ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/zlib"; \ + libsrcdir="$$s/zlib"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) +@endif zlib-bootstrap + +.PHONY: configure-stage4-zlib maybe-configure-stage4-zlib +maybe-configure-stage4-zlib: +@if zlib-bootstrap +maybe-configure-stage4-zlib: configure-stage4-zlib +configure-stage4-zlib: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/zlib ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/zlib"; \ + libsrcdir="$$s/zlib"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) +@endif zlib-bootstrap + +.PHONY: configure-stageprofile-zlib maybe-configure-stageprofile-zlib +maybe-configure-stageprofile-zlib: +@if zlib-bootstrap +maybe-configure-stageprofile-zlib: configure-stageprofile-zlib +configure-stageprofile-zlib: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/zlib ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/zlib"; \ + libsrcdir="$$s/zlib"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) +@endif zlib-bootstrap + +.PHONY: configure-stagefeedback-zlib maybe-configure-stagefeedback-zlib +maybe-configure-stagefeedback-zlib: +@if zlib-bootstrap +maybe-configure-stagefeedback-zlib: configure-stagefeedback-zlib +configure-stagefeedback-zlib: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/zlib ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/zlib"; \ + libsrcdir="$$s/zlib"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) +@endif zlib-bootstrap + + + + + +.PHONY: all-zlib maybe-all-zlib +maybe-all-zlib: +@if gcc-bootstrap +all-zlib: stage_current +@endif gcc-bootstrap +@if zlib +TARGET-zlib=all +maybe-all-zlib: all-zlib +all-zlib: configure-zlib + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-zlib)) +@endif zlib + + + +.PHONY: all-stage1-zlib maybe-all-stage1-zlib +.PHONY: clean-stage1-zlib maybe-clean-stage1-zlib +maybe-all-stage1-zlib: +maybe-clean-stage1-zlib: +@if zlib-bootstrap +maybe-all-stage1-zlib: all-stage1-zlib +all-stage1: all-stage1-zlib +TARGET-stage1-zlib = $(TARGET-zlib) +all-stage1-zlib: configure-stage1-zlib + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-zlib) + +maybe-clean-stage1-zlib: clean-stage1-zlib +clean-stage1: clean-stage1-zlib +clean-stage1-zlib: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-zlib/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif zlib-bootstrap + + +.PHONY: all-stage2-zlib maybe-all-stage2-zlib +.PHONY: clean-stage2-zlib maybe-clean-stage2-zlib +maybe-all-stage2-zlib: +maybe-clean-stage2-zlib: +@if zlib-bootstrap +maybe-all-stage2-zlib: all-stage2-zlib +all-stage2: all-stage2-zlib +TARGET-stage2-zlib = $(TARGET-zlib) +all-stage2-zlib: configure-stage2-zlib + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-zlib) + +maybe-clean-stage2-zlib: clean-stage2-zlib +clean-stage2: clean-stage2-zlib +clean-stage2-zlib: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-zlib/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif zlib-bootstrap + + +.PHONY: all-stage3-zlib maybe-all-stage3-zlib +.PHONY: clean-stage3-zlib maybe-clean-stage3-zlib +maybe-all-stage3-zlib: +maybe-clean-stage3-zlib: +@if zlib-bootstrap +maybe-all-stage3-zlib: all-stage3-zlib +all-stage3: all-stage3-zlib +TARGET-stage3-zlib = $(TARGET-zlib) +all-stage3-zlib: configure-stage3-zlib + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-zlib) + +maybe-clean-stage3-zlib: clean-stage3-zlib +clean-stage3: clean-stage3-zlib +clean-stage3-zlib: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-zlib/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif zlib-bootstrap + + +.PHONY: all-stage4-zlib maybe-all-stage4-zlib +.PHONY: clean-stage4-zlib maybe-clean-stage4-zlib +maybe-all-stage4-zlib: +maybe-clean-stage4-zlib: +@if zlib-bootstrap +maybe-all-stage4-zlib: all-stage4-zlib +all-stage4: all-stage4-zlib +TARGET-stage4-zlib = $(TARGET-zlib) +all-stage4-zlib: configure-stage4-zlib + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-zlib) + +maybe-clean-stage4-zlib: clean-stage4-zlib +clean-stage4: clean-stage4-zlib +clean-stage4-zlib: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-zlib/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif zlib-bootstrap + + +.PHONY: all-stageprofile-zlib maybe-all-stageprofile-zlib +.PHONY: clean-stageprofile-zlib maybe-clean-stageprofile-zlib +maybe-all-stageprofile-zlib: +maybe-clean-stageprofile-zlib: +@if zlib-bootstrap +maybe-all-stageprofile-zlib: all-stageprofile-zlib +all-stageprofile: all-stageprofile-zlib +TARGET-stageprofile-zlib = $(TARGET-zlib) +all-stageprofile-zlib: configure-stageprofile-zlib + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-zlib) + +maybe-clean-stageprofile-zlib: clean-stageprofile-zlib +clean-stageprofile: clean-stageprofile-zlib +clean-stageprofile-zlib: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-zlib/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif zlib-bootstrap + + +.PHONY: all-stagefeedback-zlib maybe-all-stagefeedback-zlib +.PHONY: clean-stagefeedback-zlib maybe-clean-stagefeedback-zlib +maybe-all-stagefeedback-zlib: +maybe-clean-stagefeedback-zlib: +@if zlib-bootstrap +maybe-all-stagefeedback-zlib: all-stagefeedback-zlib +all-stagefeedback: all-stagefeedback-zlib +TARGET-stagefeedback-zlib = $(TARGET-zlib) +all-stagefeedback-zlib: configure-stagefeedback-zlib + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-zlib) + +maybe-clean-stagefeedback-zlib: clean-stagefeedback-zlib +clean-stagefeedback: clean-stagefeedback-zlib +clean-stagefeedback-zlib: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-zlib/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif zlib-bootstrap + + + + + +.PHONY: check-zlib maybe-check-zlib +maybe-check-zlib: +@if zlib +maybe-check-zlib: check-zlib + +check-zlib: + +@endif zlib + +.PHONY: install-zlib maybe-install-zlib +maybe-install-zlib: +@if zlib +maybe-install-zlib: install-zlib + +install-zlib: + +@endif zlib + +.PHONY: install-strip-zlib maybe-install-strip-zlib +maybe-install-strip-zlib: +@if zlib +maybe-install-strip-zlib: install-strip-zlib + +install-strip-zlib: + +@endif zlib + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-zlib info-zlib +maybe-info-zlib: +@if zlib +maybe-info-zlib: info-zlib + +info-zlib: \ + configure-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif zlib + +.PHONY: maybe-dvi-zlib dvi-zlib +maybe-dvi-zlib: +@if zlib +maybe-dvi-zlib: dvi-zlib + +dvi-zlib: \ + configure-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif zlib + +.PHONY: maybe-pdf-zlib pdf-zlib +maybe-pdf-zlib: +@if zlib +maybe-pdf-zlib: pdf-zlib + +pdf-zlib: \ + configure-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif zlib + +.PHONY: maybe-html-zlib html-zlib +maybe-html-zlib: +@if zlib +maybe-html-zlib: html-zlib + +html-zlib: \ + configure-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif zlib + +.PHONY: maybe-TAGS-zlib TAGS-zlib +maybe-TAGS-zlib: +@if zlib +maybe-TAGS-zlib: TAGS-zlib + +TAGS-zlib: \ + configure-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif zlib + +.PHONY: maybe-install-info-zlib install-info-zlib +maybe-install-info-zlib: +@if zlib +maybe-install-info-zlib: install-info-zlib + +install-info-zlib: \ + configure-zlib \ + info-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif zlib + +.PHONY: maybe-install-pdf-zlib install-pdf-zlib +maybe-install-pdf-zlib: +@if zlib +maybe-install-pdf-zlib: install-pdf-zlib + +install-pdf-zlib: \ + configure-zlib \ + pdf-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif zlib + +.PHONY: maybe-install-html-zlib install-html-zlib +maybe-install-html-zlib: +@if zlib +maybe-install-html-zlib: install-html-zlib + +install-html-zlib: \ + configure-zlib \ + html-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif zlib + +.PHONY: maybe-installcheck-zlib installcheck-zlib +maybe-installcheck-zlib: +@if zlib +maybe-installcheck-zlib: installcheck-zlib + +installcheck-zlib: \ + configure-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif zlib + +.PHONY: maybe-mostlyclean-zlib mostlyclean-zlib +maybe-mostlyclean-zlib: +@if zlib +maybe-mostlyclean-zlib: mostlyclean-zlib + +mostlyclean-zlib: + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif zlib + +.PHONY: maybe-clean-zlib clean-zlib +maybe-clean-zlib: +@if zlib +maybe-clean-zlib: clean-zlib + +clean-zlib: + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif zlib + +.PHONY: maybe-distclean-zlib distclean-zlib +maybe-distclean-zlib: +@if zlib +maybe-distclean-zlib: distclean-zlib + +distclean-zlib: + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif zlib + +.PHONY: maybe-maintainer-clean-zlib maintainer-clean-zlib +maybe-maintainer-clean-zlib: +@if zlib +maybe-maintainer-clean-zlib: maintainer-clean-zlib + +maintainer-clean-zlib: + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif zlib + + + +.PHONY: configure-gdb maybe-configure-gdb +maybe-configure-gdb: +@if gcc-bootstrap +configure-gdb: stage_current +@endif gcc-bootstrap +@if gdb +maybe-configure-gdb: configure-gdb +configure-gdb: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gdb/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gdb ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/gdb; \ + cd "$(HOST_SUBDIR)/gdb" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gdb/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gdb"; \ + libsrcdir="$$s/gdb"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif gdb + + + + + +.PHONY: all-gdb maybe-all-gdb +maybe-all-gdb: +@if gcc-bootstrap +all-gdb: stage_current +@endif gcc-bootstrap +@if gdb +TARGET-gdb=all +maybe-all-gdb: all-gdb +all-gdb: configure-gdb + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-gdb)) +@endif gdb + + + + +.PHONY: check-gdb maybe-check-gdb +maybe-check-gdb: +@if gdb +maybe-check-gdb: check-gdb + +check-gdb: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif gdb + +.PHONY: install-gdb maybe-install-gdb +maybe-install-gdb: +@if gdb +maybe-install-gdb: install-gdb + +install-gdb: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif gdb + +.PHONY: install-strip-gdb maybe-install-strip-gdb +maybe-install-strip-gdb: +@if gdb +maybe-install-strip-gdb: install-strip-gdb + +install-strip-gdb: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif gdb + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-gdb info-gdb +maybe-info-gdb: +@if gdb +maybe-info-gdb: info-gdb + +info-gdb: \ + configure-gdb + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif gdb + +.PHONY: maybe-dvi-gdb dvi-gdb +maybe-dvi-gdb: +@if gdb +maybe-dvi-gdb: dvi-gdb + +dvi-gdb: \ + configure-gdb + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif gdb + +.PHONY: maybe-pdf-gdb pdf-gdb +maybe-pdf-gdb: +@if gdb +maybe-pdf-gdb: pdf-gdb + +pdf-gdb: \ + configure-gdb + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif gdb + +.PHONY: maybe-html-gdb html-gdb +maybe-html-gdb: +@if gdb +maybe-html-gdb: html-gdb + +html-gdb: \ + configure-gdb + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif gdb + +.PHONY: maybe-TAGS-gdb TAGS-gdb +maybe-TAGS-gdb: +@if gdb +maybe-TAGS-gdb: TAGS-gdb + +TAGS-gdb: \ + configure-gdb + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif gdb + +.PHONY: maybe-install-info-gdb install-info-gdb +maybe-install-info-gdb: +@if gdb +maybe-install-info-gdb: install-info-gdb + +install-info-gdb: \ + configure-gdb \ + info-gdb + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif gdb + +.PHONY: maybe-install-pdf-gdb install-pdf-gdb +maybe-install-pdf-gdb: +@if gdb +maybe-install-pdf-gdb: install-pdf-gdb + +install-pdf-gdb: \ + configure-gdb \ + pdf-gdb + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif gdb + +.PHONY: maybe-install-html-gdb install-html-gdb +maybe-install-html-gdb: +@if gdb +maybe-install-html-gdb: install-html-gdb + +install-html-gdb: \ + configure-gdb \ + html-gdb + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif gdb + +.PHONY: maybe-installcheck-gdb installcheck-gdb +maybe-installcheck-gdb: +@if gdb +maybe-installcheck-gdb: installcheck-gdb + +installcheck-gdb: \ + configure-gdb + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif gdb + +.PHONY: maybe-mostlyclean-gdb mostlyclean-gdb +maybe-mostlyclean-gdb: +@if gdb +maybe-mostlyclean-gdb: mostlyclean-gdb + +mostlyclean-gdb: + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif gdb + +.PHONY: maybe-clean-gdb clean-gdb +maybe-clean-gdb: +@if gdb +maybe-clean-gdb: clean-gdb + +clean-gdb: + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif gdb + +.PHONY: maybe-distclean-gdb distclean-gdb +maybe-distclean-gdb: +@if gdb +maybe-distclean-gdb: distclean-gdb + +distclean-gdb: + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif gdb + +.PHONY: maybe-maintainer-clean-gdb maintainer-clean-gdb +maybe-maintainer-clean-gdb: +@if gdb +maybe-maintainer-clean-gdb: maintainer-clean-gdb + +maintainer-clean-gdb: + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif gdb + + + +.PHONY: configure-expect maybe-configure-expect +maybe-configure-expect: +@if gcc-bootstrap +configure-expect: stage_current +@endif gcc-bootstrap +@if expect +maybe-configure-expect: configure-expect +configure-expect: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/expect/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/expect ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/expect; \ + cd "$(HOST_SUBDIR)/expect" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/expect/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/expect"; \ + libsrcdir="$$s/expect"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif expect + + + + + +.PHONY: all-expect maybe-all-expect +maybe-all-expect: +@if gcc-bootstrap +all-expect: stage_current +@endif gcc-bootstrap +@if expect +TARGET-expect=all +maybe-all-expect: all-expect +all-expect: configure-expect + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-expect)) +@endif expect + + + + +.PHONY: check-expect maybe-check-expect +maybe-check-expect: +@if expect +maybe-check-expect: check-expect + +check-expect: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif expect + +.PHONY: install-expect maybe-install-expect +maybe-install-expect: +@if expect +maybe-install-expect: install-expect + +install-expect: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif expect + +.PHONY: install-strip-expect maybe-install-strip-expect +maybe-install-strip-expect: +@if expect +maybe-install-strip-expect: install-strip-expect + +install-strip-expect: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif expect + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-expect info-expect +maybe-info-expect: +@if expect +maybe-info-expect: info-expect + +info-expect: \ + configure-expect + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif expect + +.PHONY: maybe-dvi-expect dvi-expect +maybe-dvi-expect: +@if expect +maybe-dvi-expect: dvi-expect + +dvi-expect: \ + configure-expect + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif expect + +.PHONY: maybe-pdf-expect pdf-expect +maybe-pdf-expect: +@if expect +maybe-pdf-expect: pdf-expect + +pdf-expect: \ + configure-expect + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif expect + +.PHONY: maybe-html-expect html-expect +maybe-html-expect: +@if expect +maybe-html-expect: html-expect + +html-expect: \ + configure-expect + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif expect + +.PHONY: maybe-TAGS-expect TAGS-expect +maybe-TAGS-expect: +@if expect +maybe-TAGS-expect: TAGS-expect + +TAGS-expect: \ + configure-expect + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif expect + +.PHONY: maybe-install-info-expect install-info-expect +maybe-install-info-expect: +@if expect +maybe-install-info-expect: install-info-expect + +install-info-expect: \ + configure-expect \ + info-expect + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif expect + +.PHONY: maybe-install-pdf-expect install-pdf-expect +maybe-install-pdf-expect: +@if expect +maybe-install-pdf-expect: install-pdf-expect + +install-pdf-expect: \ + configure-expect \ + pdf-expect + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif expect + +.PHONY: maybe-install-html-expect install-html-expect +maybe-install-html-expect: +@if expect +maybe-install-html-expect: install-html-expect + +install-html-expect: \ + configure-expect \ + html-expect + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif expect + +.PHONY: maybe-installcheck-expect installcheck-expect +maybe-installcheck-expect: +@if expect +maybe-installcheck-expect: installcheck-expect + +installcheck-expect: \ + configure-expect + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif expect + +.PHONY: maybe-mostlyclean-expect mostlyclean-expect +maybe-mostlyclean-expect: +@if expect +maybe-mostlyclean-expect: mostlyclean-expect + +mostlyclean-expect: + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif expect + +.PHONY: maybe-clean-expect clean-expect +maybe-clean-expect: +@if expect +maybe-clean-expect: clean-expect + +clean-expect: + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif expect + +.PHONY: maybe-distclean-expect distclean-expect +maybe-distclean-expect: +@if expect +maybe-distclean-expect: distclean-expect + +distclean-expect: + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif expect + +.PHONY: maybe-maintainer-clean-expect maintainer-clean-expect +maybe-maintainer-clean-expect: +@if expect +maybe-maintainer-clean-expect: maintainer-clean-expect + +maintainer-clean-expect: + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif expect + + + +.PHONY: configure-guile maybe-configure-guile +maybe-configure-guile: +@if gcc-bootstrap +configure-guile: stage_current +@endif gcc-bootstrap +@if guile +maybe-configure-guile: configure-guile +configure-guile: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/guile/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/guile ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/guile; \ + cd "$(HOST_SUBDIR)/guile" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/guile/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/guile"; \ + libsrcdir="$$s/guile"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif guile + + + + + +.PHONY: all-guile maybe-all-guile +maybe-all-guile: +@if gcc-bootstrap +all-guile: stage_current +@endif gcc-bootstrap +@if guile +TARGET-guile=all +maybe-all-guile: all-guile +all-guile: configure-guile + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-guile)) +@endif guile + + + + +.PHONY: check-guile maybe-check-guile +maybe-check-guile: +@if guile +maybe-check-guile: check-guile + +check-guile: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif guile + +.PHONY: install-guile maybe-install-guile +maybe-install-guile: +@if guile +maybe-install-guile: install-guile + +install-guile: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif guile + +.PHONY: install-strip-guile maybe-install-strip-guile +maybe-install-strip-guile: +@if guile +maybe-install-strip-guile: install-strip-guile + +install-strip-guile: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif guile + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-guile info-guile +maybe-info-guile: +@if guile +maybe-info-guile: info-guile + +info-guile: \ + configure-guile + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif guile + +.PHONY: maybe-dvi-guile dvi-guile +maybe-dvi-guile: +@if guile +maybe-dvi-guile: dvi-guile + +dvi-guile: \ + configure-guile + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif guile + +.PHONY: maybe-pdf-guile pdf-guile +maybe-pdf-guile: +@if guile +maybe-pdf-guile: pdf-guile + +pdf-guile: \ + configure-guile + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif guile + +.PHONY: maybe-html-guile html-guile +maybe-html-guile: +@if guile +maybe-html-guile: html-guile + +html-guile: \ + configure-guile + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif guile + +.PHONY: maybe-TAGS-guile TAGS-guile +maybe-TAGS-guile: +@if guile +maybe-TAGS-guile: TAGS-guile + +TAGS-guile: \ + configure-guile + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif guile + +.PHONY: maybe-install-info-guile install-info-guile +maybe-install-info-guile: +@if guile +maybe-install-info-guile: install-info-guile + +install-info-guile: \ + configure-guile \ + info-guile + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif guile + +.PHONY: maybe-install-pdf-guile install-pdf-guile +maybe-install-pdf-guile: +@if guile +maybe-install-pdf-guile: install-pdf-guile + +install-pdf-guile: \ + configure-guile \ + pdf-guile + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif guile + +.PHONY: maybe-install-html-guile install-html-guile +maybe-install-html-guile: +@if guile +maybe-install-html-guile: install-html-guile + +install-html-guile: \ + configure-guile \ + html-guile + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif guile + +.PHONY: maybe-installcheck-guile installcheck-guile +maybe-installcheck-guile: +@if guile +maybe-installcheck-guile: installcheck-guile + +installcheck-guile: \ + configure-guile + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif guile + +.PHONY: maybe-mostlyclean-guile mostlyclean-guile +maybe-mostlyclean-guile: +@if guile +maybe-mostlyclean-guile: mostlyclean-guile + +mostlyclean-guile: + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif guile + +.PHONY: maybe-clean-guile clean-guile +maybe-clean-guile: +@if guile +maybe-clean-guile: clean-guile + +clean-guile: + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif guile + +.PHONY: maybe-distclean-guile distclean-guile +maybe-distclean-guile: +@if guile +maybe-distclean-guile: distclean-guile + +distclean-guile: + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif guile + +.PHONY: maybe-maintainer-clean-guile maintainer-clean-guile +maybe-maintainer-clean-guile: +@if guile +maybe-maintainer-clean-guile: maintainer-clean-guile + +maintainer-clean-guile: + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif guile + + + +.PHONY: configure-tk maybe-configure-tk +maybe-configure-tk: +@if gcc-bootstrap +configure-tk: stage_current +@endif gcc-bootstrap +@if tk +maybe-configure-tk: configure-tk +configure-tk: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/tk/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/tk ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/tk; \ + cd "$(HOST_SUBDIR)/tk" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/tk/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/tk"; \ + libsrcdir="$$s/tk"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif tk + + + + + +.PHONY: all-tk maybe-all-tk +maybe-all-tk: +@if gcc-bootstrap +all-tk: stage_current +@endif gcc-bootstrap +@if tk +TARGET-tk=all +maybe-all-tk: all-tk +all-tk: configure-tk + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-tk)) +@endif tk + + + + +.PHONY: check-tk maybe-check-tk +maybe-check-tk: +@if tk +maybe-check-tk: check-tk + +check-tk: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif tk + +.PHONY: install-tk maybe-install-tk +maybe-install-tk: +@if tk +maybe-install-tk: install-tk + +install-tk: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif tk + +.PHONY: install-strip-tk maybe-install-strip-tk +maybe-install-strip-tk: +@if tk +maybe-install-strip-tk: install-strip-tk + +install-strip-tk: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif tk + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-tk info-tk +maybe-info-tk: +@if tk +maybe-info-tk: info-tk + +info-tk: \ + configure-tk + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif tk + +.PHONY: maybe-dvi-tk dvi-tk +maybe-dvi-tk: +@if tk +maybe-dvi-tk: dvi-tk + +dvi-tk: \ + configure-tk + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif tk + +.PHONY: maybe-pdf-tk pdf-tk +maybe-pdf-tk: +@if tk +maybe-pdf-tk: pdf-tk + +pdf-tk: \ + configure-tk + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif tk + +.PHONY: maybe-html-tk html-tk +maybe-html-tk: +@if tk +maybe-html-tk: html-tk + +html-tk: \ + configure-tk + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif tk + +.PHONY: maybe-TAGS-tk TAGS-tk +maybe-TAGS-tk: +@if tk +maybe-TAGS-tk: TAGS-tk + +TAGS-tk: \ + configure-tk + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif tk + +.PHONY: maybe-install-info-tk install-info-tk +maybe-install-info-tk: +@if tk +maybe-install-info-tk: install-info-tk + +install-info-tk: \ + configure-tk \ + info-tk + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif tk + +.PHONY: maybe-install-pdf-tk install-pdf-tk +maybe-install-pdf-tk: +@if tk +maybe-install-pdf-tk: install-pdf-tk + +install-pdf-tk: \ + configure-tk \ + pdf-tk + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif tk + +.PHONY: maybe-install-html-tk install-html-tk +maybe-install-html-tk: +@if tk +maybe-install-html-tk: install-html-tk + +install-html-tk: \ + configure-tk \ + html-tk + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif tk + +.PHONY: maybe-installcheck-tk installcheck-tk +maybe-installcheck-tk: +@if tk +maybe-installcheck-tk: installcheck-tk + +installcheck-tk: \ + configure-tk + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif tk + +.PHONY: maybe-mostlyclean-tk mostlyclean-tk +maybe-mostlyclean-tk: +@if tk +maybe-mostlyclean-tk: mostlyclean-tk + +mostlyclean-tk: + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif tk + +.PHONY: maybe-clean-tk clean-tk +maybe-clean-tk: +@if tk +maybe-clean-tk: clean-tk + +clean-tk: + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif tk + +.PHONY: maybe-distclean-tk distclean-tk +maybe-distclean-tk: +@if tk +maybe-distclean-tk: distclean-tk + +distclean-tk: + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif tk + +.PHONY: maybe-maintainer-clean-tk maintainer-clean-tk +maybe-maintainer-clean-tk: +@if tk +maybe-maintainer-clean-tk: maintainer-clean-tk + +maintainer-clean-tk: + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif tk + + + +.PHONY: configure-libtermcap maybe-configure-libtermcap +maybe-configure-libtermcap: +@if gcc-bootstrap +configure-libtermcap: stage_current +@endif gcc-bootstrap +@if libtermcap +maybe-configure-libtermcap: configure-libtermcap +configure-libtermcap: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libtermcap/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libtermcap ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/libtermcap; \ + cd "$(HOST_SUBDIR)/libtermcap" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libtermcap/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libtermcap"; \ + libsrcdir="$$s/libtermcap"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif libtermcap + + + + + +.PHONY: all-libtermcap maybe-all-libtermcap +maybe-all-libtermcap: +@if gcc-bootstrap +all-libtermcap: stage_current +@endif gcc-bootstrap +@if libtermcap +TARGET-libtermcap=all +maybe-all-libtermcap: all-libtermcap +all-libtermcap: configure-libtermcap + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-libtermcap)) +@endif libtermcap + + + + +.PHONY: check-libtermcap maybe-check-libtermcap +maybe-check-libtermcap: +@if libtermcap +maybe-check-libtermcap: check-libtermcap + +check-libtermcap: + +@endif libtermcap + +.PHONY: install-libtermcap maybe-install-libtermcap +maybe-install-libtermcap: +@if libtermcap +maybe-install-libtermcap: install-libtermcap + +install-libtermcap: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libtermcap && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif libtermcap + +.PHONY: install-strip-libtermcap maybe-install-strip-libtermcap +maybe-install-strip-libtermcap: +@if libtermcap +maybe-install-strip-libtermcap: install-strip-libtermcap + +install-strip-libtermcap: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libtermcap && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif libtermcap + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-libtermcap info-libtermcap +maybe-info-libtermcap: +@if libtermcap +maybe-info-libtermcap: info-libtermcap + +info-libtermcap: \ + configure-libtermcap + @: $(MAKE); $(unstage) + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in libtermcap" ; \ + (cd $(HOST_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif libtermcap + +.PHONY: maybe-dvi-libtermcap dvi-libtermcap +maybe-dvi-libtermcap: +@if libtermcap +maybe-dvi-libtermcap: dvi-libtermcap + +dvi-libtermcap: \ + configure-libtermcap + @: $(MAKE); $(unstage) + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in libtermcap" ; \ + (cd $(HOST_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif libtermcap + +.PHONY: maybe-pdf-libtermcap pdf-libtermcap +maybe-pdf-libtermcap: +@if libtermcap +maybe-pdf-libtermcap: pdf-libtermcap + +pdf-libtermcap: \ + configure-libtermcap + @: $(MAKE); $(unstage) + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libtermcap" ; \ + (cd $(HOST_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif libtermcap + +.PHONY: maybe-html-libtermcap html-libtermcap +maybe-html-libtermcap: +@if libtermcap +maybe-html-libtermcap: html-libtermcap + +html-libtermcap: \ + configure-libtermcap + @: $(MAKE); $(unstage) + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in libtermcap" ; \ + (cd $(HOST_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif libtermcap + +.PHONY: maybe-TAGS-libtermcap TAGS-libtermcap +maybe-TAGS-libtermcap: +@if libtermcap +maybe-TAGS-libtermcap: TAGS-libtermcap + +TAGS-libtermcap: \ + configure-libtermcap + @: $(MAKE); $(unstage) + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in libtermcap" ; \ + (cd $(HOST_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif libtermcap + +.PHONY: maybe-install-info-libtermcap install-info-libtermcap +maybe-install-info-libtermcap: +@if libtermcap +maybe-install-info-libtermcap: install-info-libtermcap + +install-info-libtermcap: \ + configure-libtermcap \ + info-libtermcap + @: $(MAKE); $(unstage) + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in libtermcap" ; \ + (cd $(HOST_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif libtermcap + +.PHONY: maybe-install-pdf-libtermcap install-pdf-libtermcap +maybe-install-pdf-libtermcap: +@if libtermcap +maybe-install-pdf-libtermcap: install-pdf-libtermcap + +install-pdf-libtermcap: \ + configure-libtermcap \ + pdf-libtermcap + @: $(MAKE); $(unstage) + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libtermcap" ; \ + (cd $(HOST_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif libtermcap + +.PHONY: maybe-install-html-libtermcap install-html-libtermcap +maybe-install-html-libtermcap: +@if libtermcap +maybe-install-html-libtermcap: install-html-libtermcap + +install-html-libtermcap: \ + configure-libtermcap \ + html-libtermcap + @: $(MAKE); $(unstage) + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in libtermcap" ; \ + (cd $(HOST_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif libtermcap + +.PHONY: maybe-installcheck-libtermcap installcheck-libtermcap +maybe-installcheck-libtermcap: +@if libtermcap +maybe-installcheck-libtermcap: installcheck-libtermcap + +installcheck-libtermcap: \ + configure-libtermcap + @: $(MAKE); $(unstage) + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in libtermcap" ; \ + (cd $(HOST_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif libtermcap + +.PHONY: maybe-mostlyclean-libtermcap mostlyclean-libtermcap +maybe-mostlyclean-libtermcap: +@if libtermcap +maybe-mostlyclean-libtermcap: mostlyclean-libtermcap + +# libtermcap doesn't support mostlyclean. +mostlyclean-libtermcap: + +@endif libtermcap + +.PHONY: maybe-clean-libtermcap clean-libtermcap +maybe-clean-libtermcap: +@if libtermcap +maybe-clean-libtermcap: clean-libtermcap + +# libtermcap doesn't support clean. +clean-libtermcap: + +@endif libtermcap + +.PHONY: maybe-distclean-libtermcap distclean-libtermcap +maybe-distclean-libtermcap: +@if libtermcap +maybe-distclean-libtermcap: distclean-libtermcap + +# libtermcap doesn't support distclean. +distclean-libtermcap: + +@endif libtermcap + +.PHONY: maybe-maintainer-clean-libtermcap maintainer-clean-libtermcap +maybe-maintainer-clean-libtermcap: +@if libtermcap +maybe-maintainer-clean-libtermcap: maintainer-clean-libtermcap + +# libtermcap doesn't support maintainer-clean. +maintainer-clean-libtermcap: + +@endif libtermcap + + + +.PHONY: configure-utils maybe-configure-utils +maybe-configure-utils: +@if gcc-bootstrap +configure-utils: stage_current +@endif gcc-bootstrap +@if utils +maybe-configure-utils: configure-utils +configure-utils: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/utils/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/utils ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/utils; \ + cd "$(HOST_SUBDIR)/utils" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/utils/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/utils"; \ + libsrcdir="$$s/utils"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif utils + + + + + +.PHONY: all-utils maybe-all-utils +maybe-all-utils: +@if gcc-bootstrap +all-utils: stage_current +@endif gcc-bootstrap +@if utils +TARGET-utils=all +maybe-all-utils: all-utils +all-utils: configure-utils + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-utils)) +@endif utils + + + + +.PHONY: check-utils maybe-check-utils +maybe-check-utils: +@if utils +maybe-check-utils: check-utils + +check-utils: + +@endif utils + +.PHONY: install-utils maybe-install-utils +maybe-install-utils: +@if utils +maybe-install-utils: install-utils + +install-utils: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif utils + +.PHONY: install-strip-utils maybe-install-strip-utils +maybe-install-strip-utils: +@if utils +maybe-install-strip-utils: install-strip-utils + +install-strip-utils: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif utils + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-utils info-utils +maybe-info-utils: +@if utils +maybe-info-utils: info-utils + +info-utils: \ + configure-utils + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif utils + +.PHONY: maybe-dvi-utils dvi-utils +maybe-dvi-utils: +@if utils +maybe-dvi-utils: dvi-utils + +dvi-utils: \ + configure-utils + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif utils + +.PHONY: maybe-pdf-utils pdf-utils +maybe-pdf-utils: +@if utils +maybe-pdf-utils: pdf-utils + +pdf-utils: \ + configure-utils + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif utils + +.PHONY: maybe-html-utils html-utils +maybe-html-utils: +@if utils +maybe-html-utils: html-utils + +html-utils: \ + configure-utils + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif utils + +.PHONY: maybe-TAGS-utils TAGS-utils +maybe-TAGS-utils: +@if utils +maybe-TAGS-utils: TAGS-utils + +TAGS-utils: \ + configure-utils + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif utils + +.PHONY: maybe-install-info-utils install-info-utils +maybe-install-info-utils: +@if utils +maybe-install-info-utils: install-info-utils + +install-info-utils: \ + configure-utils \ + info-utils + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif utils + +.PHONY: maybe-install-pdf-utils install-pdf-utils +maybe-install-pdf-utils: +@if utils +maybe-install-pdf-utils: install-pdf-utils + +install-pdf-utils: \ + configure-utils \ + pdf-utils + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif utils + +.PHONY: maybe-install-html-utils install-html-utils +maybe-install-html-utils: +@if utils +maybe-install-html-utils: install-html-utils + +install-html-utils: \ + configure-utils \ + html-utils + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif utils + +.PHONY: maybe-installcheck-utils installcheck-utils +maybe-installcheck-utils: +@if utils +maybe-installcheck-utils: installcheck-utils + +installcheck-utils: \ + configure-utils + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif utils + +.PHONY: maybe-mostlyclean-utils mostlyclean-utils +maybe-mostlyclean-utils: +@if utils +maybe-mostlyclean-utils: mostlyclean-utils + +mostlyclean-utils: + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif utils + +.PHONY: maybe-clean-utils clean-utils +maybe-clean-utils: +@if utils +maybe-clean-utils: clean-utils + +clean-utils: + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif utils + +.PHONY: maybe-distclean-utils distclean-utils +maybe-distclean-utils: +@if utils +maybe-distclean-utils: distclean-utils + +distclean-utils: + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif utils + +.PHONY: maybe-maintainer-clean-utils maintainer-clean-utils +maybe-maintainer-clean-utils: +@if utils +maybe-maintainer-clean-utils: maintainer-clean-utils + +maintainer-clean-utils: + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif utils + + + +.PHONY: configure-gnattools maybe-configure-gnattools +maybe-configure-gnattools: +@if gcc-bootstrap +configure-gnattools: stage_current +@endif gcc-bootstrap +@if gnattools +maybe-configure-gnattools: configure-gnattools +configure-gnattools: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gnattools/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gnattools ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/gnattools; \ + cd "$(HOST_SUBDIR)/gnattools" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gnattools/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gnattools"; \ + libsrcdir="$$s/gnattools"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif gnattools + + + + + +.PHONY: all-gnattools maybe-all-gnattools +maybe-all-gnattools: +@if gcc-bootstrap +all-gnattools: stage_current +@endif gcc-bootstrap +@if gnattools +TARGET-gnattools=all +maybe-all-gnattools: all-gnattools +all-gnattools: configure-gnattools + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-gnattools)) +@endif gnattools + + + + +.PHONY: check-gnattools maybe-check-gnattools +maybe-check-gnattools: +@if gnattools +maybe-check-gnattools: check-gnattools + +check-gnattools: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif gnattools + +.PHONY: install-gnattools maybe-install-gnattools +maybe-install-gnattools: +@if gnattools +maybe-install-gnattools: install-gnattools + +install-gnattools: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif gnattools + +.PHONY: install-strip-gnattools maybe-install-strip-gnattools +maybe-install-strip-gnattools: +@if gnattools +maybe-install-strip-gnattools: install-strip-gnattools + +install-strip-gnattools: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif gnattools + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-gnattools info-gnattools +maybe-info-gnattools: +@if gnattools +maybe-info-gnattools: info-gnattools + +info-gnattools: \ + configure-gnattools + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif gnattools + +.PHONY: maybe-dvi-gnattools dvi-gnattools +maybe-dvi-gnattools: +@if gnattools +maybe-dvi-gnattools: dvi-gnattools + +dvi-gnattools: \ + configure-gnattools + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif gnattools + +.PHONY: maybe-pdf-gnattools pdf-gnattools +maybe-pdf-gnattools: +@if gnattools +maybe-pdf-gnattools: pdf-gnattools + +pdf-gnattools: \ + configure-gnattools + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif gnattools + +.PHONY: maybe-html-gnattools html-gnattools +maybe-html-gnattools: +@if gnattools +maybe-html-gnattools: html-gnattools + +html-gnattools: \ + configure-gnattools + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif gnattools + +.PHONY: maybe-TAGS-gnattools TAGS-gnattools +maybe-TAGS-gnattools: +@if gnattools +maybe-TAGS-gnattools: TAGS-gnattools + +TAGS-gnattools: \ + configure-gnattools + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif gnattools + +.PHONY: maybe-install-info-gnattools install-info-gnattools +maybe-install-info-gnattools: +@if gnattools +maybe-install-info-gnattools: install-info-gnattools + +install-info-gnattools: \ + configure-gnattools \ + info-gnattools + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif gnattools + +.PHONY: maybe-install-pdf-gnattools install-pdf-gnattools +maybe-install-pdf-gnattools: +@if gnattools +maybe-install-pdf-gnattools: install-pdf-gnattools + +install-pdf-gnattools: \ + configure-gnattools \ + pdf-gnattools + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif gnattools + +.PHONY: maybe-install-html-gnattools install-html-gnattools +maybe-install-html-gnattools: +@if gnattools +maybe-install-html-gnattools: install-html-gnattools + +install-html-gnattools: \ + configure-gnattools \ + html-gnattools + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif gnattools + +.PHONY: maybe-installcheck-gnattools installcheck-gnattools +maybe-installcheck-gnattools: +@if gnattools +maybe-installcheck-gnattools: installcheck-gnattools + +installcheck-gnattools: \ + configure-gnattools + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif gnattools + +.PHONY: maybe-mostlyclean-gnattools mostlyclean-gnattools +maybe-mostlyclean-gnattools: +@if gnattools +maybe-mostlyclean-gnattools: mostlyclean-gnattools + +mostlyclean-gnattools: + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif gnattools + +.PHONY: maybe-clean-gnattools clean-gnattools +maybe-clean-gnattools: +@if gnattools +maybe-clean-gnattools: clean-gnattools + +clean-gnattools: + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif gnattools + +.PHONY: maybe-distclean-gnattools distclean-gnattools +maybe-distclean-gnattools: +@if gnattools +maybe-distclean-gnattools: distclean-gnattools + +distclean-gnattools: + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif gnattools + +.PHONY: maybe-maintainer-clean-gnattools maintainer-clean-gnattools +maybe-maintainer-clean-gnattools: +@if gnattools +maybe-maintainer-clean-gnattools: maintainer-clean-gnattools + +maintainer-clean-gnattools: + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif gnattools + + + +.PHONY: configure-lto-plugin maybe-configure-lto-plugin +maybe-configure-lto-plugin: +@if gcc-bootstrap +configure-lto-plugin: stage_current +@endif gcc-bootstrap +@if lto-plugin +maybe-configure-lto-plugin: configure-lto-plugin +configure-lto-plugin: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/lto-plugin/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/lto-plugin; \ + cd "$(HOST_SUBDIR)/lto-plugin" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/lto-plugin/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/lto-plugin"; \ + libsrcdir="$$s/lto-plugin"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} --enable-shared \ + || exit 1 +@endif lto-plugin + + + +.PHONY: configure-stage1-lto-plugin maybe-configure-stage1-lto-plugin +maybe-configure-stage1-lto-plugin: +@if lto-plugin-bootstrap +maybe-configure-stage1-lto-plugin: configure-stage1-lto-plugin +configure-stage1-lto-plugin: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/lto-plugin/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/lto-plugin ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin ; \ + cd $(HOST_SUBDIR)/lto-plugin || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/lto-plugin/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/lto-plugin"; \ + libsrcdir="$$s/lto-plugin"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) \ + --enable-shared +@endif lto-plugin-bootstrap + +.PHONY: configure-stage2-lto-plugin maybe-configure-stage2-lto-plugin +maybe-configure-stage2-lto-plugin: +@if lto-plugin-bootstrap +maybe-configure-stage2-lto-plugin: configure-stage2-lto-plugin +configure-stage2-lto-plugin: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/lto-plugin/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/lto-plugin ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin ; \ + cd $(HOST_SUBDIR)/lto-plugin || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/lto-plugin/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/lto-plugin"; \ + libsrcdir="$$s/lto-plugin"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) \ + --enable-shared +@endif lto-plugin-bootstrap + +.PHONY: configure-stage3-lto-plugin maybe-configure-stage3-lto-plugin +maybe-configure-stage3-lto-plugin: +@if lto-plugin-bootstrap +maybe-configure-stage3-lto-plugin: configure-stage3-lto-plugin +configure-stage3-lto-plugin: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/lto-plugin/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/lto-plugin ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin ; \ + cd $(HOST_SUBDIR)/lto-plugin || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/lto-plugin/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/lto-plugin"; \ + libsrcdir="$$s/lto-plugin"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) \ + --enable-shared +@endif lto-plugin-bootstrap + +.PHONY: configure-stage4-lto-plugin maybe-configure-stage4-lto-plugin +maybe-configure-stage4-lto-plugin: +@if lto-plugin-bootstrap +maybe-configure-stage4-lto-plugin: configure-stage4-lto-plugin +configure-stage4-lto-plugin: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/lto-plugin/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/lto-plugin ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin ; \ + cd $(HOST_SUBDIR)/lto-plugin || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/lto-plugin/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/lto-plugin"; \ + libsrcdir="$$s/lto-plugin"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) \ + --enable-shared +@endif lto-plugin-bootstrap + +.PHONY: configure-stageprofile-lto-plugin maybe-configure-stageprofile-lto-plugin +maybe-configure-stageprofile-lto-plugin: +@if lto-plugin-bootstrap +maybe-configure-stageprofile-lto-plugin: configure-stageprofile-lto-plugin +configure-stageprofile-lto-plugin: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/lto-plugin/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/lto-plugin ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin ; \ + cd $(HOST_SUBDIR)/lto-plugin || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/lto-plugin/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/lto-plugin"; \ + libsrcdir="$$s/lto-plugin"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) \ + --enable-shared +@endif lto-plugin-bootstrap + +.PHONY: configure-stagefeedback-lto-plugin maybe-configure-stagefeedback-lto-plugin +maybe-configure-stagefeedback-lto-plugin: +@if lto-plugin-bootstrap +maybe-configure-stagefeedback-lto-plugin: configure-stagefeedback-lto-plugin +configure-stagefeedback-lto-plugin: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + test ! -f $(HOST_SUBDIR)/lto-plugin/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/lto-plugin ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin ; \ + cd $(HOST_SUBDIR)/lto-plugin || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/lto-plugin/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/lto-plugin"; \ + libsrcdir="$$s/lto-plugin"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) \ + --enable-shared +@endif lto-plugin-bootstrap + + + + + +.PHONY: all-lto-plugin maybe-all-lto-plugin +maybe-all-lto-plugin: +@if gcc-bootstrap +all-lto-plugin: stage_current +@endif gcc-bootstrap +@if lto-plugin +TARGET-lto-plugin=all +maybe-all-lto-plugin: all-lto-plugin +all-lto-plugin: configure-lto-plugin + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ + $(TARGET-lto-plugin)) +@endif lto-plugin + + + +.PHONY: all-stage1-lto-plugin maybe-all-stage1-lto-plugin +.PHONY: clean-stage1-lto-plugin maybe-clean-stage1-lto-plugin +maybe-all-stage1-lto-plugin: +maybe-clean-stage1-lto-plugin: +@if lto-plugin-bootstrap +maybe-all-stage1-lto-plugin: all-stage1-lto-plugin +all-stage1: all-stage1-lto-plugin +TARGET-stage1-lto-plugin = $(TARGET-lto-plugin) +all-stage1-lto-plugin: configure-stage1-lto-plugin + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" \ + CXXFLAGS="$(STAGE1_CXXFLAGS)" \ + LIBCFLAGS="$(LIBCFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-lto-plugin) + +maybe-clean-stage1-lto-plugin: clean-stage1-lto-plugin +clean-stage1: clean-stage1-lto-plugin +clean-stage1-lto-plugin: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/lto-plugin/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-lto-plugin/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean +@endif lto-plugin-bootstrap + + +.PHONY: all-stage2-lto-plugin maybe-all-stage2-lto-plugin +.PHONY: clean-stage2-lto-plugin maybe-clean-stage2-lto-plugin +maybe-all-stage2-lto-plugin: +maybe-clean-stage2-lto-plugin: +@if lto-plugin-bootstrap +maybe-all-stage2-lto-plugin: all-stage2-lto-plugin +all-stage2: all-stage2-lto-plugin +TARGET-stage2-lto-plugin = $(TARGET-lto-plugin) +all-stage2-lto-plugin: configure-stage2-lto-plugin + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE2_CFLAGS)" \ + CXXFLAGS="$(STAGE2_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE2_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-lto-plugin) + +maybe-clean-stage2-lto-plugin: clean-stage2-lto-plugin +clean-stage2: clean-stage2-lto-plugin +clean-stage2-lto-plugin: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/lto-plugin/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-lto-plugin/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif lto-plugin-bootstrap + + +.PHONY: all-stage3-lto-plugin maybe-all-stage3-lto-plugin +.PHONY: clean-stage3-lto-plugin maybe-clean-stage3-lto-plugin +maybe-all-stage3-lto-plugin: +maybe-clean-stage3-lto-plugin: +@if lto-plugin-bootstrap +maybe-all-stage3-lto-plugin: all-stage3-lto-plugin +all-stage3: all-stage3-lto-plugin +TARGET-stage3-lto-plugin = $(TARGET-lto-plugin) +all-stage3-lto-plugin: configure-stage3-lto-plugin + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE3_CFLAGS)" \ + CXXFLAGS="$(STAGE3_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE3_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-lto-plugin) + +maybe-clean-stage3-lto-plugin: clean-stage3-lto-plugin +clean-stage3: clean-stage3-lto-plugin +clean-stage3-lto-plugin: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/lto-plugin/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-lto-plugin/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif lto-plugin-bootstrap + + +.PHONY: all-stage4-lto-plugin maybe-all-stage4-lto-plugin +.PHONY: clean-stage4-lto-plugin maybe-clean-stage4-lto-plugin +maybe-all-stage4-lto-plugin: +maybe-clean-stage4-lto-plugin: +@if lto-plugin-bootstrap +maybe-all-stage4-lto-plugin: all-stage4-lto-plugin +all-stage4: all-stage4-lto-plugin +TARGET-stage4-lto-plugin = $(TARGET-lto-plugin) +all-stage4-lto-plugin: configure-stage4-lto-plugin + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE4_CFLAGS)" \ + CXXFLAGS="$(STAGE4_CXXFLAGS)" \ + LIBCFLAGS="$(STAGE4_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-lto-plugin) + +maybe-clean-stage4-lto-plugin: clean-stage4-lto-plugin +clean-stage4: clean-stage4-lto-plugin +clean-stage4-lto-plugin: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/lto-plugin/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-lto-plugin/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif lto-plugin-bootstrap + + +.PHONY: all-stageprofile-lto-plugin maybe-all-stageprofile-lto-plugin +.PHONY: clean-stageprofile-lto-plugin maybe-clean-stageprofile-lto-plugin +maybe-all-stageprofile-lto-plugin: +maybe-clean-stageprofile-lto-plugin: +@if lto-plugin-bootstrap +maybe-all-stageprofile-lto-plugin: all-stageprofile-lto-plugin +all-stageprofile: all-stageprofile-lto-plugin +TARGET-stageprofile-lto-plugin = $(TARGET-lto-plugin) +all-stageprofile-lto-plugin: configure-stageprofile-lto-plugin + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEprofile_CFLAGS)" \ + CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-lto-plugin) + +maybe-clean-stageprofile-lto-plugin: clean-stageprofile-lto-plugin +clean-stageprofile: clean-stageprofile-lto-plugin +clean-stageprofile-lto-plugin: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/lto-plugin/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-lto-plugin/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif lto-plugin-bootstrap + + +.PHONY: all-stagefeedback-lto-plugin maybe-all-stagefeedback-lto-plugin +.PHONY: clean-stagefeedback-lto-plugin maybe-clean-stagefeedback-lto-plugin +maybe-all-stagefeedback-lto-plugin: +maybe-clean-stagefeedback-lto-plugin: +@if lto-plugin-bootstrap +maybe-all-stagefeedback-lto-plugin: all-stagefeedback-lto-plugin +all-stagefeedback: all-stagefeedback-lto-plugin +TARGET-stagefeedback-lto-plugin = $(TARGET-lto-plugin) +all-stagefeedback-lto-plugin: configure-stagefeedback-lto-plugin + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(STAGEfeedback_CFLAGS)" \ + CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ + LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-lto-plugin) + +maybe-clean-stagefeedback-lto-plugin: clean-stagefeedback-lto-plugin +clean-stagefeedback: clean-stagefeedback-lto-plugin +clean-stagefeedback-lto-plugin: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/lto-plugin/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-lto-plugin/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif lto-plugin-bootstrap + + + + + +.PHONY: check-lto-plugin maybe-check-lto-plugin +maybe-check-lto-plugin: +@if lto-plugin +maybe-check-lto-plugin: check-lto-plugin + +check-lto-plugin: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif lto-plugin + +.PHONY: install-lto-plugin maybe-install-lto-plugin +maybe-install-lto-plugin: +@if lto-plugin +maybe-install-lto-plugin: install-lto-plugin + +install-lto-plugin: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif lto-plugin + +.PHONY: install-strip-lto-plugin maybe-install-strip-lto-plugin +maybe-install-strip-lto-plugin: +@if lto-plugin +maybe-install-strip-lto-plugin: install-strip-lto-plugin + +install-strip-lto-plugin: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(FLAGS_TO_PASS) install-strip) + +@endif lto-plugin + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-lto-plugin info-lto-plugin +maybe-info-lto-plugin: +@if lto-plugin +maybe-info-lto-plugin: info-lto-plugin + +info-lto-plugin: \ + configure-lto-plugin + @[ -f ./lto-plugin/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in lto-plugin" ; \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif lto-plugin + +.PHONY: maybe-dvi-lto-plugin dvi-lto-plugin +maybe-dvi-lto-plugin: +@if lto-plugin +maybe-dvi-lto-plugin: dvi-lto-plugin + +dvi-lto-plugin: \ + configure-lto-plugin + @[ -f ./lto-plugin/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in lto-plugin" ; \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif lto-plugin + +.PHONY: maybe-pdf-lto-plugin pdf-lto-plugin +maybe-pdf-lto-plugin: +@if lto-plugin +maybe-pdf-lto-plugin: pdf-lto-plugin + +pdf-lto-plugin: \ + configure-lto-plugin + @[ -f ./lto-plugin/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in lto-plugin" ; \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif lto-plugin + +.PHONY: maybe-html-lto-plugin html-lto-plugin +maybe-html-lto-plugin: +@if lto-plugin +maybe-html-lto-plugin: html-lto-plugin + +html-lto-plugin: \ + configure-lto-plugin + @[ -f ./lto-plugin/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in lto-plugin" ; \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif lto-plugin + +.PHONY: maybe-TAGS-lto-plugin TAGS-lto-plugin +maybe-TAGS-lto-plugin: +@if lto-plugin +maybe-TAGS-lto-plugin: TAGS-lto-plugin + +TAGS-lto-plugin: \ + configure-lto-plugin + @[ -f ./lto-plugin/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in lto-plugin" ; \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif lto-plugin + +.PHONY: maybe-install-info-lto-plugin install-info-lto-plugin +maybe-install-info-lto-plugin: +@if lto-plugin +maybe-install-info-lto-plugin: install-info-lto-plugin + +install-info-lto-plugin: \ + configure-lto-plugin \ + info-lto-plugin + @[ -f ./lto-plugin/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in lto-plugin" ; \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif lto-plugin + +.PHONY: maybe-install-pdf-lto-plugin install-pdf-lto-plugin +maybe-install-pdf-lto-plugin: +@if lto-plugin +maybe-install-pdf-lto-plugin: install-pdf-lto-plugin + +install-pdf-lto-plugin: \ + configure-lto-plugin \ + pdf-lto-plugin + @[ -f ./lto-plugin/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in lto-plugin" ; \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif lto-plugin + +.PHONY: maybe-install-html-lto-plugin install-html-lto-plugin +maybe-install-html-lto-plugin: +@if lto-plugin +maybe-install-html-lto-plugin: install-html-lto-plugin + +install-html-lto-plugin: \ + configure-lto-plugin \ + html-lto-plugin + @[ -f ./lto-plugin/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in lto-plugin" ; \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif lto-plugin + +.PHONY: maybe-installcheck-lto-plugin installcheck-lto-plugin +maybe-installcheck-lto-plugin: +@if lto-plugin +maybe-installcheck-lto-plugin: installcheck-lto-plugin + +installcheck-lto-plugin: \ + configure-lto-plugin + @[ -f ./lto-plugin/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in lto-plugin" ; \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif lto-plugin + +.PHONY: maybe-mostlyclean-lto-plugin mostlyclean-lto-plugin +maybe-mostlyclean-lto-plugin: +@if lto-plugin +maybe-mostlyclean-lto-plugin: mostlyclean-lto-plugin + +mostlyclean-lto-plugin: + @[ -f ./lto-plugin/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in lto-plugin" ; \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif lto-plugin + +.PHONY: maybe-clean-lto-plugin clean-lto-plugin +maybe-clean-lto-plugin: +@if lto-plugin +maybe-clean-lto-plugin: clean-lto-plugin + +clean-lto-plugin: + @[ -f ./lto-plugin/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in lto-plugin" ; \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif lto-plugin + +.PHONY: maybe-distclean-lto-plugin distclean-lto-plugin +maybe-distclean-lto-plugin: +@if lto-plugin +maybe-distclean-lto-plugin: distclean-lto-plugin + +distclean-lto-plugin: + @[ -f ./lto-plugin/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in lto-plugin" ; \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif lto-plugin + +.PHONY: maybe-maintainer-clean-lto-plugin maintainer-clean-lto-plugin +maybe-maintainer-clean-lto-plugin: +@if lto-plugin +maybe-maintainer-clean-lto-plugin: maintainer-clean-lto-plugin + +maintainer-clean-lto-plugin: + @[ -f ./lto-plugin/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in lto-plugin" ; \ + (cd $(HOST_SUBDIR)/lto-plugin && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif lto-plugin + + + +# --------------------------------------- +# Modules which run on the target machine +# --------------------------------------- + + + + +.PHONY: configure-target-libstdc++-v3 maybe-configure-target-libstdc++-v3 +maybe-configure-target-libstdc++-v3: +@if gcc-bootstrap +configure-target-libstdc++-v3: stage_current +@endif gcc-bootstrap +@if target-libstdc++-v3 +maybe-configure-target-libstdc++-v3: configure-target-libstdc++-v3 +configure-target-libstdc++-v3: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libstdc++-v3..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile; \ + mv $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 ; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/libstdc++-v3; \ + cd "$(TARGET_SUBDIR)/libstdc++-v3" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libstdc++-v3/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \ + libsrcdir="$$s/libstdc++-v3"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-libstdc++-v3 + + + +.PHONY: configure-stage1-target-libstdc++-v3 maybe-configure-stage1-target-libstdc++-v3 +maybe-configure-stage1-target-libstdc++-v3: +@if target-libstdc++-v3-bootstrap +maybe-configure-stage1-target-libstdc++-v3: configure-stage1-target-libstdc++-v3 +configure-stage1-target-libstdc++-v3: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + echo "Checking multilib configuration for libstdc++-v3..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile; \ + mv $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || exit 0; \ + $(RAW_CXX_TARGET_EXPORTS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(TARGET_SUBDIR)/libstdc++-v3 ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 ; \ + cd $(TARGET_SUBDIR)/libstdc++-v3 || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libstdc++-v3/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \ + libsrcdir="$$s/libstdc++-v3"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) +@endif target-libstdc++-v3-bootstrap + +.PHONY: configure-stage2-target-libstdc++-v3 maybe-configure-stage2-target-libstdc++-v3 +maybe-configure-stage2-target-libstdc++-v3: +@if target-libstdc++-v3-bootstrap +maybe-configure-stage2-target-libstdc++-v3: configure-stage2-target-libstdc++-v3 +configure-stage2-target-libstdc++-v3: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + echo "Checking multilib configuration for libstdc++-v3..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile; \ + mv $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || exit 0; \ + $(RAW_CXX_TARGET_EXPORTS) \ + \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(TARGET_SUBDIR)/libstdc++-v3 ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 ; \ + cd $(TARGET_SUBDIR)/libstdc++-v3 || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libstdc++-v3/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \ + libsrcdir="$$s/libstdc++-v3"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) +@endif target-libstdc++-v3-bootstrap + +.PHONY: configure-stage3-target-libstdc++-v3 maybe-configure-stage3-target-libstdc++-v3 +maybe-configure-stage3-target-libstdc++-v3: +@if target-libstdc++-v3-bootstrap +maybe-configure-stage3-target-libstdc++-v3: configure-stage3-target-libstdc++-v3 +configure-stage3-target-libstdc++-v3: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + echo "Checking multilib configuration for libstdc++-v3..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile; \ + mv $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || exit 0; \ + $(RAW_CXX_TARGET_EXPORTS) \ + \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(TARGET_SUBDIR)/libstdc++-v3 ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 ; \ + cd $(TARGET_SUBDIR)/libstdc++-v3 || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libstdc++-v3/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \ + libsrcdir="$$s/libstdc++-v3"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) +@endif target-libstdc++-v3-bootstrap + +.PHONY: configure-stage4-target-libstdc++-v3 maybe-configure-stage4-target-libstdc++-v3 +maybe-configure-stage4-target-libstdc++-v3: +@if target-libstdc++-v3-bootstrap +maybe-configure-stage4-target-libstdc++-v3: configure-stage4-target-libstdc++-v3 +configure-stage4-target-libstdc++-v3: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + echo "Checking multilib configuration for libstdc++-v3..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile; \ + mv $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || exit 0; \ + $(RAW_CXX_TARGET_EXPORTS) \ + \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(TARGET_SUBDIR)/libstdc++-v3 ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 ; \ + cd $(TARGET_SUBDIR)/libstdc++-v3 || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libstdc++-v3/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \ + libsrcdir="$$s/libstdc++-v3"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) +@endif target-libstdc++-v3-bootstrap + +.PHONY: configure-stageprofile-target-libstdc++-v3 maybe-configure-stageprofile-target-libstdc++-v3 +maybe-configure-stageprofile-target-libstdc++-v3: +@if target-libstdc++-v3-bootstrap +maybe-configure-stageprofile-target-libstdc++-v3: configure-stageprofile-target-libstdc++-v3 +configure-stageprofile-target-libstdc++-v3: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + echo "Checking multilib configuration for libstdc++-v3..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile; \ + mv $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || exit 0; \ + $(RAW_CXX_TARGET_EXPORTS) \ + \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(TARGET_SUBDIR)/libstdc++-v3 ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 ; \ + cd $(TARGET_SUBDIR)/libstdc++-v3 || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libstdc++-v3/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \ + libsrcdir="$$s/libstdc++-v3"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) +@endif target-libstdc++-v3-bootstrap + +.PHONY: configure-stagefeedback-target-libstdc++-v3 maybe-configure-stagefeedback-target-libstdc++-v3 +maybe-configure-stagefeedback-target-libstdc++-v3: +@if target-libstdc++-v3-bootstrap +maybe-configure-stagefeedback-target-libstdc++-v3: configure-stagefeedback-target-libstdc++-v3 +configure-stagefeedback-target-libstdc++-v3: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + echo "Checking multilib configuration for libstdc++-v3..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile; \ + mv $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || exit 0; \ + $(RAW_CXX_TARGET_EXPORTS) \ + \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(TARGET_SUBDIR)/libstdc++-v3 ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 ; \ + cd $(TARGET_SUBDIR)/libstdc++-v3 || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libstdc++-v3/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \ + libsrcdir="$$s/libstdc++-v3"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) +@endif target-libstdc++-v3-bootstrap + + + + + +.PHONY: all-target-libstdc++-v3 maybe-all-target-libstdc++-v3 +maybe-all-target-libstdc++-v3: +@if gcc-bootstrap +all-target-libstdc++-v3: stage_current +@endif gcc-bootstrap +@if target-libstdc++-v3 +TARGET-target-libstdc++-v3=all +maybe-all-target-libstdc++-v3: all-target-libstdc++-v3 +all-target-libstdc++-v3: configure-target-libstdc++-v3 + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ + $(TARGET-target-libstdc++-v3)) +@endif target-libstdc++-v3 + + + +.PHONY: all-stage1-target-libstdc++-v3 maybe-all-stage1-target-libstdc++-v3 +.PHONY: clean-stage1-target-libstdc++-v3 maybe-clean-stage1-target-libstdc++-v3 +maybe-all-stage1-target-libstdc++-v3: +maybe-clean-stage1-target-libstdc++-v3: +@if target-libstdc++-v3-bootstrap +maybe-all-stage1-target-libstdc++-v3: all-stage1-target-libstdc++-v3 +all-stage1: all-stage1-target-libstdc++-v3 +TARGET-stage1-target-libstdc++-v3 = $(TARGET-target-libstdc++-v3) +all-stage1-target-libstdc++-v3: configure-stage1-target-libstdc++-v3 + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(RAW_CXX_TARGET_EXPORTS) \ + cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-target-libstdc++-v3) + +maybe-clean-stage1-target-libstdc++-v3: clean-stage1-target-libstdc++-v3 +clean-stage1: clean-stage1-target-libstdc++-v3 +clean-stage1-target-libstdc++-v3: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage1-libstdc++-v3/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ + clean +@endif target-libstdc++-v3-bootstrap + + +.PHONY: all-stage2-target-libstdc++-v3 maybe-all-stage2-target-libstdc++-v3 +.PHONY: clean-stage2-target-libstdc++-v3 maybe-clean-stage2-target-libstdc++-v3 +maybe-all-stage2-target-libstdc++-v3: +maybe-clean-stage2-target-libstdc++-v3: +@if target-libstdc++-v3-bootstrap +maybe-all-stage2-target-libstdc++-v3: all-stage2-target-libstdc++-v3 +all-stage2: all-stage2-target-libstdc++-v3 +TARGET-stage2-target-libstdc++-v3 = $(TARGET-target-libstdc++-v3) +all-stage2-target-libstdc++-v3: configure-stage2-target-libstdc++-v3 + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(RAW_CXX_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-target-libstdc++-v3) + +maybe-clean-stage2-target-libstdc++-v3: clean-stage2-target-libstdc++-v3 +clean-stage2: clean-stage2-target-libstdc++-v3 +clean-stage2-target-libstdc++-v3: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage2-libstdc++-v3/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ + \ + clean +@endif target-libstdc++-v3-bootstrap + + +.PHONY: all-stage3-target-libstdc++-v3 maybe-all-stage3-target-libstdc++-v3 +.PHONY: clean-stage3-target-libstdc++-v3 maybe-clean-stage3-target-libstdc++-v3 +maybe-all-stage3-target-libstdc++-v3: +maybe-clean-stage3-target-libstdc++-v3: +@if target-libstdc++-v3-bootstrap +maybe-all-stage3-target-libstdc++-v3: all-stage3-target-libstdc++-v3 +all-stage3: all-stage3-target-libstdc++-v3 +TARGET-stage3-target-libstdc++-v3 = $(TARGET-target-libstdc++-v3) +all-stage3-target-libstdc++-v3: configure-stage3-target-libstdc++-v3 + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(RAW_CXX_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-target-libstdc++-v3) + +maybe-clean-stage3-target-libstdc++-v3: clean-stage3-target-libstdc++-v3 +clean-stage3: clean-stage3-target-libstdc++-v3 +clean-stage3-target-libstdc++-v3: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage3-libstdc++-v3/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ + \ + clean +@endif target-libstdc++-v3-bootstrap + + +.PHONY: all-stage4-target-libstdc++-v3 maybe-all-stage4-target-libstdc++-v3 +.PHONY: clean-stage4-target-libstdc++-v3 maybe-clean-stage4-target-libstdc++-v3 +maybe-all-stage4-target-libstdc++-v3: +maybe-clean-stage4-target-libstdc++-v3: +@if target-libstdc++-v3-bootstrap +maybe-all-stage4-target-libstdc++-v3: all-stage4-target-libstdc++-v3 +all-stage4: all-stage4-target-libstdc++-v3 +TARGET-stage4-target-libstdc++-v3 = $(TARGET-target-libstdc++-v3) +all-stage4-target-libstdc++-v3: configure-stage4-target-libstdc++-v3 + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(RAW_CXX_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-target-libstdc++-v3) + +maybe-clean-stage4-target-libstdc++-v3: clean-stage4-target-libstdc++-v3 +clean-stage4: clean-stage4-target-libstdc++-v3 +clean-stage4-target-libstdc++-v3: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage4-libstdc++-v3/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ + \ + clean +@endif target-libstdc++-v3-bootstrap + + +.PHONY: all-stageprofile-target-libstdc++-v3 maybe-all-stageprofile-target-libstdc++-v3 +.PHONY: clean-stageprofile-target-libstdc++-v3 maybe-clean-stageprofile-target-libstdc++-v3 +maybe-all-stageprofile-target-libstdc++-v3: +maybe-clean-stageprofile-target-libstdc++-v3: +@if target-libstdc++-v3-bootstrap +maybe-all-stageprofile-target-libstdc++-v3: all-stageprofile-target-libstdc++-v3 +all-stageprofile: all-stageprofile-target-libstdc++-v3 +TARGET-stageprofile-target-libstdc++-v3 = $(TARGET-target-libstdc++-v3) +all-stageprofile-target-libstdc++-v3: configure-stageprofile-target-libstdc++-v3 + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(RAW_CXX_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-target-libstdc++-v3) + +maybe-clean-stageprofile-target-libstdc++-v3: clean-stageprofile-target-libstdc++-v3 +clean-stageprofile: clean-stageprofile-target-libstdc++-v3 +clean-stageprofile-target-libstdc++-v3: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stageprofile-libstdc++-v3/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ + \ + clean +@endif target-libstdc++-v3-bootstrap + + +.PHONY: all-stagefeedback-target-libstdc++-v3 maybe-all-stagefeedback-target-libstdc++-v3 +.PHONY: clean-stagefeedback-target-libstdc++-v3 maybe-clean-stagefeedback-target-libstdc++-v3 +maybe-all-stagefeedback-target-libstdc++-v3: +maybe-clean-stagefeedback-target-libstdc++-v3: +@if target-libstdc++-v3-bootstrap +maybe-all-stagefeedback-target-libstdc++-v3: all-stagefeedback-target-libstdc++-v3 +all-stagefeedback: all-stagefeedback-target-libstdc++-v3 +TARGET-stagefeedback-target-libstdc++-v3 = $(TARGET-target-libstdc++-v3) +all-stagefeedback-target-libstdc++-v3: configure-stagefeedback-target-libstdc++-v3 + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(RAW_CXX_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-target-libstdc++-v3) + +maybe-clean-stagefeedback-target-libstdc++-v3: clean-stagefeedback-target-libstdc++-v3 +clean-stagefeedback: clean-stagefeedback-target-libstdc++-v3 +clean-stagefeedback-target-libstdc++-v3: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stagefeedback-libstdc++-v3/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ + \ + clean +@endif target-libstdc++-v3-bootstrap + + + + + + +.PHONY: check-target-libstdc++-v3 maybe-check-target-libstdc++-v3 +maybe-check-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-check-target-libstdc++-v3: check-target-libstdc++-v3 + +check-target-libstdc++-v3: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' check) + +@endif target-libstdc++-v3 + +.PHONY: install-target-libstdc++-v3 maybe-install-target-libstdc++-v3 +maybe-install-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-install-target-libstdc++-v3: install-target-libstdc++-v3 + +install-target-libstdc++-v3: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-libstdc++-v3 + +.PHONY: install-strip-target-libstdc++-v3 maybe-install-strip-target-libstdc++-v3 +maybe-install-strip-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-install-strip-target-libstdc++-v3: install-strip-target-libstdc++-v3 + +install-strip-target-libstdc++-v3: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-libstdc++-v3 + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-libstdc++-v3 info-target-libstdc++-v3 +maybe-info-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-info-target-libstdc++-v3: info-target-libstdc++-v3 + +info-target-libstdc++-v3: \ + configure-target-libstdc++-v3 + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-libstdc++-v3 + +.PHONY: maybe-dvi-target-libstdc++-v3 dvi-target-libstdc++-v3 +maybe-dvi-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-dvi-target-libstdc++-v3: dvi-target-libstdc++-v3 + +dvi-target-libstdc++-v3: \ + configure-target-libstdc++-v3 + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-libstdc++-v3 + +.PHONY: maybe-pdf-target-libstdc++-v3 pdf-target-libstdc++-v3 +maybe-pdf-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-pdf-target-libstdc++-v3: pdf-target-libstdc++-v3 + +pdf-target-libstdc++-v3: \ + configure-target-libstdc++-v3 + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-libstdc++-v3 + +.PHONY: maybe-html-target-libstdc++-v3 html-target-libstdc++-v3 +maybe-html-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-html-target-libstdc++-v3: html-target-libstdc++-v3 + +html-target-libstdc++-v3: \ + configure-target-libstdc++-v3 + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-libstdc++-v3 + +.PHONY: maybe-TAGS-target-libstdc++-v3 TAGS-target-libstdc++-v3 +maybe-TAGS-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-TAGS-target-libstdc++-v3: TAGS-target-libstdc++-v3 + +TAGS-target-libstdc++-v3: \ + configure-target-libstdc++-v3 + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-libstdc++-v3 + +.PHONY: maybe-install-info-target-libstdc++-v3 install-info-target-libstdc++-v3 +maybe-install-info-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-install-info-target-libstdc++-v3: install-info-target-libstdc++-v3 + +install-info-target-libstdc++-v3: \ + configure-target-libstdc++-v3 \ + info-target-libstdc++-v3 + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-libstdc++-v3 + +.PHONY: maybe-install-pdf-target-libstdc++-v3 install-pdf-target-libstdc++-v3 +maybe-install-pdf-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-install-pdf-target-libstdc++-v3: install-pdf-target-libstdc++-v3 + +install-pdf-target-libstdc++-v3: \ + configure-target-libstdc++-v3 \ + pdf-target-libstdc++-v3 + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-libstdc++-v3 + +.PHONY: maybe-install-html-target-libstdc++-v3 install-html-target-libstdc++-v3 +maybe-install-html-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-install-html-target-libstdc++-v3: install-html-target-libstdc++-v3 + +install-html-target-libstdc++-v3: \ + configure-target-libstdc++-v3 \ + html-target-libstdc++-v3 + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-libstdc++-v3 + +.PHONY: maybe-installcheck-target-libstdc++-v3 installcheck-target-libstdc++-v3 +maybe-installcheck-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-installcheck-target-libstdc++-v3: installcheck-target-libstdc++-v3 + +installcheck-target-libstdc++-v3: \ + configure-target-libstdc++-v3 + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-libstdc++-v3 + +.PHONY: maybe-mostlyclean-target-libstdc++-v3 mostlyclean-target-libstdc++-v3 +maybe-mostlyclean-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-mostlyclean-target-libstdc++-v3: mostlyclean-target-libstdc++-v3 + +mostlyclean-target-libstdc++-v3: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-libstdc++-v3 + +.PHONY: maybe-clean-target-libstdc++-v3 clean-target-libstdc++-v3 +maybe-clean-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-clean-target-libstdc++-v3: clean-target-libstdc++-v3 + +clean-target-libstdc++-v3: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-libstdc++-v3 + +.PHONY: maybe-distclean-target-libstdc++-v3 distclean-target-libstdc++-v3 +maybe-distclean-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-distclean-target-libstdc++-v3: distclean-target-libstdc++-v3 + +distclean-target-libstdc++-v3: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-libstdc++-v3 + +.PHONY: maybe-maintainer-clean-target-libstdc++-v3 maintainer-clean-target-libstdc++-v3 +maybe-maintainer-clean-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-maintainer-clean-target-libstdc++-v3: maintainer-clean-target-libstdc++-v3 + +maintainer-clean-target-libstdc++-v3: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-libstdc++-v3 + + + + + +.PHONY: configure-target-libmudflap maybe-configure-target-libmudflap +maybe-configure-target-libmudflap: +@if gcc-bootstrap +configure-target-libmudflap: stage_current +@endif gcc-bootstrap +@if target-libmudflap +maybe-configure-target-libmudflap: configure-target-libmudflap +configure-target-libmudflap: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libmudflap..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libmudflap ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libmudflap/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libmudflap/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libmudflap/multilib.tmp $(TARGET_SUBDIR)/libmudflap/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libmudflap/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libmudflap/Makefile; \ + mv $(TARGET_SUBDIR)/libmudflap/multilib.tmp $(TARGET_SUBDIR)/libmudflap/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libmudflap/multilib.tmp $(TARGET_SUBDIR)/libmudflap/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libmudflap/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libmudflap ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/libmudflap; \ + cd "$(TARGET_SUBDIR)/libmudflap" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libmudflap/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libmudflap"; \ + libsrcdir="$$s/libmudflap"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-libmudflap + + + + + +.PHONY: all-target-libmudflap maybe-all-target-libmudflap +maybe-all-target-libmudflap: +@if gcc-bootstrap +all-target-libmudflap: stage_current +@endif gcc-bootstrap +@if target-libmudflap +TARGET-target-libmudflap=all +maybe-all-target-libmudflap: all-target-libmudflap +all-target-libmudflap: configure-target-libmudflap + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-libmudflap)) +@endif target-libmudflap + + + + + +.PHONY: check-target-libmudflap maybe-check-target-libmudflap +maybe-check-target-libmudflap: +@if target-libmudflap +maybe-check-target-libmudflap: check-target-libmudflap + +check-target-libmudflap: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + +@endif target-libmudflap + +.PHONY: install-target-libmudflap maybe-install-target-libmudflap +maybe-install-target-libmudflap: +@if target-libmudflap +maybe-install-target-libmudflap: install-target-libmudflap + +install-target-libmudflap: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-libmudflap + +.PHONY: install-strip-target-libmudflap maybe-install-strip-target-libmudflap +maybe-install-strip-target-libmudflap: +@if target-libmudflap +maybe-install-strip-target-libmudflap: install-strip-target-libmudflap + +install-strip-target-libmudflap: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-libmudflap + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-libmudflap info-target-libmudflap +maybe-info-target-libmudflap: +@if target-libmudflap +maybe-info-target-libmudflap: info-target-libmudflap + +info-target-libmudflap: \ + configure-target-libmudflap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-libmudflap + +.PHONY: maybe-dvi-target-libmudflap dvi-target-libmudflap +maybe-dvi-target-libmudflap: +@if target-libmudflap +maybe-dvi-target-libmudflap: dvi-target-libmudflap + +dvi-target-libmudflap: \ + configure-target-libmudflap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-libmudflap + +.PHONY: maybe-pdf-target-libmudflap pdf-target-libmudflap +maybe-pdf-target-libmudflap: +@if target-libmudflap +maybe-pdf-target-libmudflap: pdf-target-libmudflap + +pdf-target-libmudflap: \ + configure-target-libmudflap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-libmudflap + +.PHONY: maybe-html-target-libmudflap html-target-libmudflap +maybe-html-target-libmudflap: +@if target-libmudflap +maybe-html-target-libmudflap: html-target-libmudflap + +html-target-libmudflap: \ + configure-target-libmudflap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-libmudflap + +.PHONY: maybe-TAGS-target-libmudflap TAGS-target-libmudflap +maybe-TAGS-target-libmudflap: +@if target-libmudflap +maybe-TAGS-target-libmudflap: TAGS-target-libmudflap + +TAGS-target-libmudflap: \ + configure-target-libmudflap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-libmudflap + +.PHONY: maybe-install-info-target-libmudflap install-info-target-libmudflap +maybe-install-info-target-libmudflap: +@if target-libmudflap +maybe-install-info-target-libmudflap: install-info-target-libmudflap + +install-info-target-libmudflap: \ + configure-target-libmudflap \ + info-target-libmudflap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-libmudflap + +.PHONY: maybe-install-pdf-target-libmudflap install-pdf-target-libmudflap +maybe-install-pdf-target-libmudflap: +@if target-libmudflap +maybe-install-pdf-target-libmudflap: install-pdf-target-libmudflap + +install-pdf-target-libmudflap: \ + configure-target-libmudflap \ + pdf-target-libmudflap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-libmudflap + +.PHONY: maybe-install-html-target-libmudflap install-html-target-libmudflap +maybe-install-html-target-libmudflap: +@if target-libmudflap +maybe-install-html-target-libmudflap: install-html-target-libmudflap + +install-html-target-libmudflap: \ + configure-target-libmudflap \ + html-target-libmudflap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-libmudflap + +.PHONY: maybe-installcheck-target-libmudflap installcheck-target-libmudflap +maybe-installcheck-target-libmudflap: +@if target-libmudflap +maybe-installcheck-target-libmudflap: installcheck-target-libmudflap + +installcheck-target-libmudflap: \ + configure-target-libmudflap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-libmudflap + +.PHONY: maybe-mostlyclean-target-libmudflap mostlyclean-target-libmudflap +maybe-mostlyclean-target-libmudflap: +@if target-libmudflap +maybe-mostlyclean-target-libmudflap: mostlyclean-target-libmudflap + +mostlyclean-target-libmudflap: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-libmudflap + +.PHONY: maybe-clean-target-libmudflap clean-target-libmudflap +maybe-clean-target-libmudflap: +@if target-libmudflap +maybe-clean-target-libmudflap: clean-target-libmudflap + +clean-target-libmudflap: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-libmudflap + +.PHONY: maybe-distclean-target-libmudflap distclean-target-libmudflap +maybe-distclean-target-libmudflap: +@if target-libmudflap +maybe-distclean-target-libmudflap: distclean-target-libmudflap + +distclean-target-libmudflap: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-libmudflap + +.PHONY: maybe-maintainer-clean-target-libmudflap maintainer-clean-target-libmudflap +maybe-maintainer-clean-target-libmudflap: +@if target-libmudflap +maybe-maintainer-clean-target-libmudflap: maintainer-clean-target-libmudflap + +maintainer-clean-target-libmudflap: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-libmudflap + + + + + +.PHONY: configure-target-libssp maybe-configure-target-libssp +maybe-configure-target-libssp: +@if gcc-bootstrap +configure-target-libssp: stage_current +@endif gcc-bootstrap +@if target-libssp +maybe-configure-target-libssp: configure-target-libssp +configure-target-libssp: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libssp..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libssp ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libssp/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libssp/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libssp/multilib.tmp $(TARGET_SUBDIR)/libssp/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libssp/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libssp/Makefile; \ + mv $(TARGET_SUBDIR)/libssp/multilib.tmp $(TARGET_SUBDIR)/libssp/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libssp/multilib.tmp $(TARGET_SUBDIR)/libssp/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libssp/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libssp ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/libssp; \ + cd "$(TARGET_SUBDIR)/libssp" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libssp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libssp"; \ + libsrcdir="$$s/libssp"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-libssp + + + + + +.PHONY: all-target-libssp maybe-all-target-libssp +maybe-all-target-libssp: +@if gcc-bootstrap +all-target-libssp: stage_current +@endif gcc-bootstrap +@if target-libssp +TARGET-target-libssp=all +maybe-all-target-libssp: all-target-libssp +all-target-libssp: configure-target-libssp + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-libssp)) +@endif target-libssp + + + + + +.PHONY: check-target-libssp maybe-check-target-libssp +maybe-check-target-libssp: +@if target-libssp +maybe-check-target-libssp: check-target-libssp + +check-target-libssp: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + +@endif target-libssp + +.PHONY: install-target-libssp maybe-install-target-libssp +maybe-install-target-libssp: +@if target-libssp +maybe-install-target-libssp: install-target-libssp + +install-target-libssp: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-libssp + +.PHONY: install-strip-target-libssp maybe-install-strip-target-libssp +maybe-install-strip-target-libssp: +@if target-libssp +maybe-install-strip-target-libssp: install-strip-target-libssp + +install-strip-target-libssp: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-libssp + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-libssp info-target-libssp +maybe-info-target-libssp: +@if target-libssp +maybe-info-target-libssp: info-target-libssp + +info-target-libssp: \ + configure-target-libssp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-libssp + +.PHONY: maybe-dvi-target-libssp dvi-target-libssp +maybe-dvi-target-libssp: +@if target-libssp +maybe-dvi-target-libssp: dvi-target-libssp + +dvi-target-libssp: \ + configure-target-libssp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-libssp + +.PHONY: maybe-pdf-target-libssp pdf-target-libssp +maybe-pdf-target-libssp: +@if target-libssp +maybe-pdf-target-libssp: pdf-target-libssp + +pdf-target-libssp: \ + configure-target-libssp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-libssp + +.PHONY: maybe-html-target-libssp html-target-libssp +maybe-html-target-libssp: +@if target-libssp +maybe-html-target-libssp: html-target-libssp + +html-target-libssp: \ + configure-target-libssp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-libssp + +.PHONY: maybe-TAGS-target-libssp TAGS-target-libssp +maybe-TAGS-target-libssp: +@if target-libssp +maybe-TAGS-target-libssp: TAGS-target-libssp + +TAGS-target-libssp: \ + configure-target-libssp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-libssp + +.PHONY: maybe-install-info-target-libssp install-info-target-libssp +maybe-install-info-target-libssp: +@if target-libssp +maybe-install-info-target-libssp: install-info-target-libssp + +install-info-target-libssp: \ + configure-target-libssp \ + info-target-libssp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-libssp + +.PHONY: maybe-install-pdf-target-libssp install-pdf-target-libssp +maybe-install-pdf-target-libssp: +@if target-libssp +maybe-install-pdf-target-libssp: install-pdf-target-libssp + +install-pdf-target-libssp: \ + configure-target-libssp \ + pdf-target-libssp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-libssp + +.PHONY: maybe-install-html-target-libssp install-html-target-libssp +maybe-install-html-target-libssp: +@if target-libssp +maybe-install-html-target-libssp: install-html-target-libssp + +install-html-target-libssp: \ + configure-target-libssp \ + html-target-libssp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-libssp + +.PHONY: maybe-installcheck-target-libssp installcheck-target-libssp +maybe-installcheck-target-libssp: +@if target-libssp +maybe-installcheck-target-libssp: installcheck-target-libssp + +installcheck-target-libssp: \ + configure-target-libssp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-libssp + +.PHONY: maybe-mostlyclean-target-libssp mostlyclean-target-libssp +maybe-mostlyclean-target-libssp: +@if target-libssp +maybe-mostlyclean-target-libssp: mostlyclean-target-libssp + +mostlyclean-target-libssp: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-libssp + +.PHONY: maybe-clean-target-libssp clean-target-libssp +maybe-clean-target-libssp: +@if target-libssp +maybe-clean-target-libssp: clean-target-libssp + +clean-target-libssp: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-libssp + +.PHONY: maybe-distclean-target-libssp distclean-target-libssp +maybe-distclean-target-libssp: +@if target-libssp +maybe-distclean-target-libssp: distclean-target-libssp + +distclean-target-libssp: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-libssp + +.PHONY: maybe-maintainer-clean-target-libssp maintainer-clean-target-libssp +maybe-maintainer-clean-target-libssp: +@if target-libssp +maybe-maintainer-clean-target-libssp: maintainer-clean-target-libssp + +maintainer-clean-target-libssp: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-libssp + + + + + +.PHONY: configure-target-newlib maybe-configure-target-newlib +maybe-configure-target-newlib: +@if gcc-bootstrap +configure-target-newlib: stage_current +@endif gcc-bootstrap +@if target-newlib +maybe-configure-target-newlib: configure-target-newlib +configure-target-newlib: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for newlib..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/newlib ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/newlib/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/newlib/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/newlib/multilib.tmp $(TARGET_SUBDIR)/newlib/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/newlib/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/newlib/Makefile; \ + mv $(TARGET_SUBDIR)/newlib/multilib.tmp $(TARGET_SUBDIR)/newlib/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/newlib/multilib.tmp $(TARGET_SUBDIR)/newlib/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/newlib/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/newlib ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/newlib; \ + cd "$(TARGET_SUBDIR)/newlib" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/newlib/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/newlib"; \ + libsrcdir="$$s/newlib"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-newlib + + + + + +.PHONY: all-target-newlib maybe-all-target-newlib +maybe-all-target-newlib: +@if gcc-bootstrap +all-target-newlib: stage_current +@endif gcc-bootstrap +@if target-newlib +TARGET-target-newlib=all +maybe-all-target-newlib: all-target-newlib +all-target-newlib: configure-target-newlib + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-newlib)) +@endif target-newlib + + + + + +.PHONY: check-target-newlib maybe-check-target-newlib +maybe-check-target-newlib: +@if target-newlib +maybe-check-target-newlib: check-target-newlib + +check-target-newlib: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + +@endif target-newlib + +.PHONY: install-target-newlib maybe-install-target-newlib +maybe-install-target-newlib: +@if target-newlib +maybe-install-target-newlib: install-target-newlib + +install-target-newlib: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-newlib + +.PHONY: install-strip-target-newlib maybe-install-strip-target-newlib +maybe-install-strip-target-newlib: +@if target-newlib +maybe-install-strip-target-newlib: install-strip-target-newlib + +install-strip-target-newlib: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-newlib + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-newlib info-target-newlib +maybe-info-target-newlib: +@if target-newlib +maybe-info-target-newlib: info-target-newlib + +info-target-newlib: \ + configure-target-newlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-newlib + +.PHONY: maybe-dvi-target-newlib dvi-target-newlib +maybe-dvi-target-newlib: +@if target-newlib +maybe-dvi-target-newlib: dvi-target-newlib + +dvi-target-newlib: \ + configure-target-newlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-newlib + +.PHONY: maybe-pdf-target-newlib pdf-target-newlib +maybe-pdf-target-newlib: +@if target-newlib +maybe-pdf-target-newlib: pdf-target-newlib + +pdf-target-newlib: \ + configure-target-newlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-newlib + +.PHONY: maybe-html-target-newlib html-target-newlib +maybe-html-target-newlib: +@if target-newlib +maybe-html-target-newlib: html-target-newlib + +html-target-newlib: \ + configure-target-newlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-newlib + +.PHONY: maybe-TAGS-target-newlib TAGS-target-newlib +maybe-TAGS-target-newlib: +@if target-newlib +maybe-TAGS-target-newlib: TAGS-target-newlib + +TAGS-target-newlib: \ + configure-target-newlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-newlib + +.PHONY: maybe-install-info-target-newlib install-info-target-newlib +maybe-install-info-target-newlib: +@if target-newlib +maybe-install-info-target-newlib: install-info-target-newlib + +install-info-target-newlib: \ + configure-target-newlib \ + info-target-newlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-newlib + +.PHONY: maybe-install-pdf-target-newlib install-pdf-target-newlib +maybe-install-pdf-target-newlib: +@if target-newlib +maybe-install-pdf-target-newlib: install-pdf-target-newlib + +install-pdf-target-newlib: \ + configure-target-newlib \ + pdf-target-newlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-newlib + +.PHONY: maybe-install-html-target-newlib install-html-target-newlib +maybe-install-html-target-newlib: +@if target-newlib +maybe-install-html-target-newlib: install-html-target-newlib + +install-html-target-newlib: \ + configure-target-newlib \ + html-target-newlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-newlib + +.PHONY: maybe-installcheck-target-newlib installcheck-target-newlib +maybe-installcheck-target-newlib: +@if target-newlib +maybe-installcheck-target-newlib: installcheck-target-newlib + +installcheck-target-newlib: \ + configure-target-newlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-newlib + +.PHONY: maybe-mostlyclean-target-newlib mostlyclean-target-newlib +maybe-mostlyclean-target-newlib: +@if target-newlib +maybe-mostlyclean-target-newlib: mostlyclean-target-newlib + +mostlyclean-target-newlib: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-newlib + +.PHONY: maybe-clean-target-newlib clean-target-newlib +maybe-clean-target-newlib: +@if target-newlib +maybe-clean-target-newlib: clean-target-newlib + +clean-target-newlib: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-newlib + +.PHONY: maybe-distclean-target-newlib distclean-target-newlib +maybe-distclean-target-newlib: +@if target-newlib +maybe-distclean-target-newlib: distclean-target-newlib + +distclean-target-newlib: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-newlib + +.PHONY: maybe-maintainer-clean-target-newlib maintainer-clean-target-newlib +maybe-maintainer-clean-target-newlib: +@if target-newlib +maybe-maintainer-clean-target-newlib: maintainer-clean-target-newlib + +maintainer-clean-target-newlib: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-newlib + + + + + +.PHONY: configure-target-libgcc maybe-configure-target-libgcc +maybe-configure-target-libgcc: +@if gcc-bootstrap +configure-target-libgcc: stage_current +@endif gcc-bootstrap +@if target-libgcc +maybe-configure-target-libgcc: configure-target-libgcc +configure-target-libgcc: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgcc..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/libgcc; \ + cd "$(TARGET_SUBDIR)/libgcc" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-libgcc + + + +.PHONY: configure-stage1-target-libgcc maybe-configure-stage1-target-libgcc +maybe-configure-stage1-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stage1-target-libgcc: configure-stage1-target-libgcc +configure-stage1-target-libgcc: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) +@endif target-libgcc-bootstrap + +.PHONY: configure-stage2-target-libgcc maybe-configure-stage2-target-libgcc +maybe-configure-stage2-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stage2-target-libgcc: configure-stage2-target-libgcc +configure-stage2-target-libgcc: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) +@endif target-libgcc-bootstrap + +.PHONY: configure-stage3-target-libgcc maybe-configure-stage3-target-libgcc +maybe-configure-stage3-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stage3-target-libgcc: configure-stage3-target-libgcc +configure-stage3-target-libgcc: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) +@endif target-libgcc-bootstrap + +.PHONY: configure-stage4-target-libgcc maybe-configure-stage4-target-libgcc +maybe-configure-stage4-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stage4-target-libgcc: configure-stage4-target-libgcc +configure-stage4-target-libgcc: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) +@endif target-libgcc-bootstrap + +.PHONY: configure-stageprofile-target-libgcc maybe-configure-stageprofile-target-libgcc +maybe-configure-stageprofile-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stageprofile-target-libgcc: configure-stageprofile-target-libgcc +configure-stageprofile-target-libgcc: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) +@endif target-libgcc-bootstrap + +.PHONY: configure-stagefeedback-target-libgcc maybe-configure-stagefeedback-target-libgcc +maybe-configure-stagefeedback-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stagefeedback-target-libgcc: configure-stagefeedback-target-libgcc +configure-stagefeedback-target-libgcc: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) +@endif target-libgcc-bootstrap + + + + + +.PHONY: all-target-libgcc maybe-all-target-libgcc +maybe-all-target-libgcc: +@if gcc-bootstrap +all-target-libgcc: stage_current +@endif gcc-bootstrap +@if target-libgcc +TARGET-target-libgcc=all +maybe-all-target-libgcc: all-target-libgcc +all-target-libgcc: configure-target-libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-libgcc)) +@endif target-libgcc + + + +.PHONY: all-stage1-target-libgcc maybe-all-stage1-target-libgcc +.PHONY: clean-stage1-target-libgcc maybe-clean-stage1-target-libgcc +maybe-all-stage1-target-libgcc: +maybe-clean-stage1-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stage1-target-libgcc: all-stage1-target-libgcc +all-stage1: all-stage1-target-libgcc +TARGET-stage1-target-libgcc = $(TARGET-target-libgcc) +all-stage1-target-libgcc: configure-stage1-target-libgcc + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(NORMAL_TARGET_EXPORTS) \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-target-libgcc) + +maybe-clean-stage1-target-libgcc: clean-stage1-target-libgcc +clean-stage1: clean-stage1-target-libgcc +clean-stage1-target-libgcc: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage1-libgcc/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) \ + clean +@endif target-libgcc-bootstrap + + +.PHONY: all-stage2-target-libgcc maybe-all-stage2-target-libgcc +.PHONY: clean-stage2-target-libgcc maybe-clean-stage2-target-libgcc +maybe-all-stage2-target-libgcc: +maybe-clean-stage2-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stage2-target-libgcc: all-stage2-target-libgcc +all-stage2: all-stage2-target-libgcc +TARGET-stage2-target-libgcc = $(TARGET-target-libgcc) +all-stage2-target-libgcc: configure-stage2-target-libgcc + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-target-libgcc) + +maybe-clean-stage2-target-libgcc: clean-stage2-target-libgcc +clean-stage2: clean-stage2-target-libgcc +clean-stage2-target-libgcc: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage2-libgcc/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean +@endif target-libgcc-bootstrap + + +.PHONY: all-stage3-target-libgcc maybe-all-stage3-target-libgcc +.PHONY: clean-stage3-target-libgcc maybe-clean-stage3-target-libgcc +maybe-all-stage3-target-libgcc: +maybe-clean-stage3-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stage3-target-libgcc: all-stage3-target-libgcc +all-stage3: all-stage3-target-libgcc +TARGET-stage3-target-libgcc = $(TARGET-target-libgcc) +all-stage3-target-libgcc: configure-stage3-target-libgcc + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-target-libgcc) + +maybe-clean-stage3-target-libgcc: clean-stage3-target-libgcc +clean-stage3: clean-stage3-target-libgcc +clean-stage3-target-libgcc: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage3-libgcc/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean +@endif target-libgcc-bootstrap + + +.PHONY: all-stage4-target-libgcc maybe-all-stage4-target-libgcc +.PHONY: clean-stage4-target-libgcc maybe-clean-stage4-target-libgcc +maybe-all-stage4-target-libgcc: +maybe-clean-stage4-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stage4-target-libgcc: all-stage4-target-libgcc +all-stage4: all-stage4-target-libgcc +TARGET-stage4-target-libgcc = $(TARGET-target-libgcc) +all-stage4-target-libgcc: configure-stage4-target-libgcc + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-target-libgcc) + +maybe-clean-stage4-target-libgcc: clean-stage4-target-libgcc +clean-stage4: clean-stage4-target-libgcc +clean-stage4-target-libgcc: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage4-libgcc/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean +@endif target-libgcc-bootstrap + + +.PHONY: all-stageprofile-target-libgcc maybe-all-stageprofile-target-libgcc +.PHONY: clean-stageprofile-target-libgcc maybe-clean-stageprofile-target-libgcc +maybe-all-stageprofile-target-libgcc: +maybe-clean-stageprofile-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stageprofile-target-libgcc: all-stageprofile-target-libgcc +all-stageprofile: all-stageprofile-target-libgcc +TARGET-stageprofile-target-libgcc = $(TARGET-target-libgcc) +all-stageprofile-target-libgcc: configure-stageprofile-target-libgcc + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-target-libgcc) + +maybe-clean-stageprofile-target-libgcc: clean-stageprofile-target-libgcc +clean-stageprofile: clean-stageprofile-target-libgcc +clean-stageprofile-target-libgcc: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stageprofile-libgcc/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean +@endif target-libgcc-bootstrap + + +.PHONY: all-stagefeedback-target-libgcc maybe-all-stagefeedback-target-libgcc +.PHONY: clean-stagefeedback-target-libgcc maybe-clean-stagefeedback-target-libgcc +maybe-all-stagefeedback-target-libgcc: +maybe-clean-stagefeedback-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stagefeedback-target-libgcc: all-stagefeedback-target-libgcc +all-stagefeedback: all-stagefeedback-target-libgcc +TARGET-stagefeedback-target-libgcc = $(TARGET-target-libgcc) +all-stagefeedback-target-libgcc: configure-stagefeedback-target-libgcc + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-target-libgcc) + +maybe-clean-stagefeedback-target-libgcc: clean-stagefeedback-target-libgcc +clean-stagefeedback: clean-stagefeedback-target-libgcc +clean-stagefeedback-target-libgcc: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stagefeedback-libgcc/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean +@endif target-libgcc-bootstrap + + + + + + +.PHONY: check-target-libgcc maybe-check-target-libgcc +maybe-check-target-libgcc: +@if target-libgcc +maybe-check-target-libgcc: check-target-libgcc + +# Dummy target for uncheckable module. +check-target-libgcc: + +@endif target-libgcc + +.PHONY: install-target-libgcc maybe-install-target-libgcc +maybe-install-target-libgcc: +@if target-libgcc +maybe-install-target-libgcc: install-target-libgcc + +install-target-libgcc: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-libgcc + +.PHONY: install-strip-target-libgcc maybe-install-strip-target-libgcc +maybe-install-strip-target-libgcc: +@if target-libgcc +maybe-install-strip-target-libgcc: install-strip-target-libgcc + +install-strip-target-libgcc: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-libgcc + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-libgcc info-target-libgcc +maybe-info-target-libgcc: +@if target-libgcc +maybe-info-target-libgcc: info-target-libgcc + +info-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-dvi-target-libgcc dvi-target-libgcc +maybe-dvi-target-libgcc: +@if target-libgcc +maybe-dvi-target-libgcc: dvi-target-libgcc + +dvi-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-pdf-target-libgcc pdf-target-libgcc +maybe-pdf-target-libgcc: +@if target-libgcc +maybe-pdf-target-libgcc: pdf-target-libgcc + +pdf-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-html-target-libgcc html-target-libgcc +maybe-html-target-libgcc: +@if target-libgcc +maybe-html-target-libgcc: html-target-libgcc + +html-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-TAGS-target-libgcc TAGS-target-libgcc +maybe-TAGS-target-libgcc: +@if target-libgcc +maybe-TAGS-target-libgcc: TAGS-target-libgcc + +TAGS-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-install-info-target-libgcc install-info-target-libgcc +maybe-install-info-target-libgcc: +@if target-libgcc +maybe-install-info-target-libgcc: install-info-target-libgcc + +install-info-target-libgcc: \ + configure-target-libgcc \ + info-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-install-pdf-target-libgcc install-pdf-target-libgcc +maybe-install-pdf-target-libgcc: +@if target-libgcc +maybe-install-pdf-target-libgcc: install-pdf-target-libgcc + +install-pdf-target-libgcc: \ + configure-target-libgcc \ + pdf-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-install-html-target-libgcc install-html-target-libgcc +maybe-install-html-target-libgcc: +@if target-libgcc +maybe-install-html-target-libgcc: install-html-target-libgcc + +install-html-target-libgcc: \ + configure-target-libgcc \ + html-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-installcheck-target-libgcc installcheck-target-libgcc +maybe-installcheck-target-libgcc: +@if target-libgcc +maybe-installcheck-target-libgcc: installcheck-target-libgcc + +installcheck-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-mostlyclean-target-libgcc mostlyclean-target-libgcc +maybe-mostlyclean-target-libgcc: +@if target-libgcc +maybe-mostlyclean-target-libgcc: mostlyclean-target-libgcc + +mostlyclean-target-libgcc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-clean-target-libgcc clean-target-libgcc +maybe-clean-target-libgcc: +@if target-libgcc +maybe-clean-target-libgcc: clean-target-libgcc + +clean-target-libgcc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-distclean-target-libgcc distclean-target-libgcc +maybe-distclean-target-libgcc: +@if target-libgcc +maybe-distclean-target-libgcc: distclean-target-libgcc + +distclean-target-libgcc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-maintainer-clean-target-libgcc maintainer-clean-target-libgcc +maybe-maintainer-clean-target-libgcc: +@if target-libgcc +maybe-maintainer-clean-target-libgcc: maintainer-clean-target-libgcc + +maintainer-clean-target-libgcc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-libgcc + + + + + +.PHONY: configure-target-libquadmath maybe-configure-target-libquadmath +maybe-configure-target-libquadmath: +@if gcc-bootstrap +configure-target-libquadmath: stage_current +@endif gcc-bootstrap +@if target-libquadmath +maybe-configure-target-libquadmath: configure-target-libquadmath +configure-target-libquadmath: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libquadmath..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libquadmath ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libquadmath/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libquadmath/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libquadmath/multilib.tmp $(TARGET_SUBDIR)/libquadmath/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libquadmath/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libquadmath/Makefile; \ + mv $(TARGET_SUBDIR)/libquadmath/multilib.tmp $(TARGET_SUBDIR)/libquadmath/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libquadmath/multilib.tmp $(TARGET_SUBDIR)/libquadmath/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libquadmath/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libquadmath ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/libquadmath; \ + cd "$(TARGET_SUBDIR)/libquadmath" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libquadmath/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libquadmath"; \ + libsrcdir="$$s/libquadmath"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-libquadmath + + + + + +.PHONY: all-target-libquadmath maybe-all-target-libquadmath +maybe-all-target-libquadmath: +@if gcc-bootstrap +all-target-libquadmath: stage_current +@endif gcc-bootstrap +@if target-libquadmath +TARGET-target-libquadmath=all +maybe-all-target-libquadmath: all-target-libquadmath +all-target-libquadmath: configure-target-libquadmath + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-libquadmath)) +@endif target-libquadmath + + + + + +.PHONY: check-target-libquadmath maybe-check-target-libquadmath +maybe-check-target-libquadmath: +@if target-libquadmath +maybe-check-target-libquadmath: check-target-libquadmath + +check-target-libquadmath: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + +@endif target-libquadmath + +.PHONY: install-target-libquadmath maybe-install-target-libquadmath +maybe-install-target-libquadmath: +@if target-libquadmath +maybe-install-target-libquadmath: install-target-libquadmath + +install-target-libquadmath: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-libquadmath + +.PHONY: install-strip-target-libquadmath maybe-install-strip-target-libquadmath +maybe-install-strip-target-libquadmath: +@if target-libquadmath +maybe-install-strip-target-libquadmath: install-strip-target-libquadmath + +install-strip-target-libquadmath: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-libquadmath + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-libquadmath info-target-libquadmath +maybe-info-target-libquadmath: +@if target-libquadmath +maybe-info-target-libquadmath: info-target-libquadmath + +info-target-libquadmath: \ + configure-target-libquadmath + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libquadmath/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/libquadmath" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-libquadmath + +.PHONY: maybe-dvi-target-libquadmath dvi-target-libquadmath +maybe-dvi-target-libquadmath: +@if target-libquadmath +maybe-dvi-target-libquadmath: dvi-target-libquadmath + +dvi-target-libquadmath: \ + configure-target-libquadmath + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libquadmath/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libquadmath" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-libquadmath + +.PHONY: maybe-pdf-target-libquadmath pdf-target-libquadmath +maybe-pdf-target-libquadmath: +@if target-libquadmath +maybe-pdf-target-libquadmath: pdf-target-libquadmath + +pdf-target-libquadmath: \ + configure-target-libquadmath + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libquadmath/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libquadmath" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-libquadmath + +.PHONY: maybe-html-target-libquadmath html-target-libquadmath +maybe-html-target-libquadmath: +@if target-libquadmath +maybe-html-target-libquadmath: html-target-libquadmath + +html-target-libquadmath: \ + configure-target-libquadmath + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libquadmath/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/libquadmath" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-libquadmath + +.PHONY: maybe-TAGS-target-libquadmath TAGS-target-libquadmath +maybe-TAGS-target-libquadmath: +@if target-libquadmath +maybe-TAGS-target-libquadmath: TAGS-target-libquadmath + +TAGS-target-libquadmath: \ + configure-target-libquadmath + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libquadmath/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libquadmath" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-libquadmath + +.PHONY: maybe-install-info-target-libquadmath install-info-target-libquadmath +maybe-install-info-target-libquadmath: +@if target-libquadmath +maybe-install-info-target-libquadmath: install-info-target-libquadmath + +install-info-target-libquadmath: \ + configure-target-libquadmath \ + info-target-libquadmath + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libquadmath/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libquadmath" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-libquadmath + +.PHONY: maybe-install-pdf-target-libquadmath install-pdf-target-libquadmath +maybe-install-pdf-target-libquadmath: +@if target-libquadmath +maybe-install-pdf-target-libquadmath: install-pdf-target-libquadmath + +install-pdf-target-libquadmath: \ + configure-target-libquadmath \ + pdf-target-libquadmath + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libquadmath/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libquadmath" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-libquadmath + +.PHONY: maybe-install-html-target-libquadmath install-html-target-libquadmath +maybe-install-html-target-libquadmath: +@if target-libquadmath +maybe-install-html-target-libquadmath: install-html-target-libquadmath + +install-html-target-libquadmath: \ + configure-target-libquadmath \ + html-target-libquadmath + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libquadmath/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/libquadmath" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-libquadmath + +.PHONY: maybe-installcheck-target-libquadmath installcheck-target-libquadmath +maybe-installcheck-target-libquadmath: +@if target-libquadmath +maybe-installcheck-target-libquadmath: installcheck-target-libquadmath + +installcheck-target-libquadmath: \ + configure-target-libquadmath + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libquadmath/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libquadmath" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-libquadmath + +.PHONY: maybe-mostlyclean-target-libquadmath mostlyclean-target-libquadmath +maybe-mostlyclean-target-libquadmath: +@if target-libquadmath +maybe-mostlyclean-target-libquadmath: mostlyclean-target-libquadmath + +mostlyclean-target-libquadmath: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libquadmath/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libquadmath" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-libquadmath + +.PHONY: maybe-clean-target-libquadmath clean-target-libquadmath +maybe-clean-target-libquadmath: +@if target-libquadmath +maybe-clean-target-libquadmath: clean-target-libquadmath + +clean-target-libquadmath: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libquadmath/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/libquadmath" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-libquadmath + +.PHONY: maybe-distclean-target-libquadmath distclean-target-libquadmath +maybe-distclean-target-libquadmath: +@if target-libquadmath +maybe-distclean-target-libquadmath: distclean-target-libquadmath + +distclean-target-libquadmath: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libquadmath/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libquadmath" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-libquadmath + +.PHONY: maybe-maintainer-clean-target-libquadmath maintainer-clean-target-libquadmath +maybe-maintainer-clean-target-libquadmath: +@if target-libquadmath +maybe-maintainer-clean-target-libquadmath: maintainer-clean-target-libquadmath + +maintainer-clean-target-libquadmath: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libquadmath/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libquadmath" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libquadmath && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-libquadmath + + + + + +.PHONY: configure-target-libgfortran maybe-configure-target-libgfortran +maybe-configure-target-libgfortran: +@if gcc-bootstrap +configure-target-libgfortran: stage_current +@endif gcc-bootstrap +@if target-libgfortran +maybe-configure-target-libgfortran: configure-target-libgfortran +configure-target-libgfortran: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgfortran..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgfortran ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgfortran/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgfortran/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgfortran/multilib.tmp $(TARGET_SUBDIR)/libgfortran/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgfortran/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgfortran/Makefile; \ + mv $(TARGET_SUBDIR)/libgfortran/multilib.tmp $(TARGET_SUBDIR)/libgfortran/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgfortran/multilib.tmp $(TARGET_SUBDIR)/libgfortran/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgfortran/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgfortran ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/libgfortran; \ + cd "$(TARGET_SUBDIR)/libgfortran" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgfortran/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgfortran"; \ + libsrcdir="$$s/libgfortran"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-libgfortran + + + + + +.PHONY: all-target-libgfortran maybe-all-target-libgfortran +maybe-all-target-libgfortran: +@if gcc-bootstrap +all-target-libgfortran: stage_current +@endif gcc-bootstrap +@if target-libgfortran +TARGET-target-libgfortran=all +maybe-all-target-libgfortran: all-target-libgfortran +all-target-libgfortran: configure-target-libgfortran + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-libgfortran)) +@endif target-libgfortran + + + + + +.PHONY: check-target-libgfortran maybe-check-target-libgfortran +maybe-check-target-libgfortran: +@if target-libgfortran +maybe-check-target-libgfortran: check-target-libgfortran + +check-target-libgfortran: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + +@endif target-libgfortran + +.PHONY: install-target-libgfortran maybe-install-target-libgfortran +maybe-install-target-libgfortran: +@if target-libgfortran +maybe-install-target-libgfortran: install-target-libgfortran + +install-target-libgfortran: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-libgfortran + +.PHONY: install-strip-target-libgfortran maybe-install-strip-target-libgfortran +maybe-install-strip-target-libgfortran: +@if target-libgfortran +maybe-install-strip-target-libgfortran: install-strip-target-libgfortran + +install-strip-target-libgfortran: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-libgfortran + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-libgfortran info-target-libgfortran +maybe-info-target-libgfortran: +@if target-libgfortran +maybe-info-target-libgfortran: info-target-libgfortran + +info-target-libgfortran: \ + configure-target-libgfortran + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-libgfortran + +.PHONY: maybe-dvi-target-libgfortran dvi-target-libgfortran +maybe-dvi-target-libgfortran: +@if target-libgfortran +maybe-dvi-target-libgfortran: dvi-target-libgfortran + +dvi-target-libgfortran: \ + configure-target-libgfortran + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-libgfortran + +.PHONY: maybe-pdf-target-libgfortran pdf-target-libgfortran +maybe-pdf-target-libgfortran: +@if target-libgfortran +maybe-pdf-target-libgfortran: pdf-target-libgfortran + +pdf-target-libgfortran: \ + configure-target-libgfortran + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-libgfortran + +.PHONY: maybe-html-target-libgfortran html-target-libgfortran +maybe-html-target-libgfortran: +@if target-libgfortran +maybe-html-target-libgfortran: html-target-libgfortran + +html-target-libgfortran: \ + configure-target-libgfortran + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-libgfortran + +.PHONY: maybe-TAGS-target-libgfortran TAGS-target-libgfortran +maybe-TAGS-target-libgfortran: +@if target-libgfortran +maybe-TAGS-target-libgfortran: TAGS-target-libgfortran + +TAGS-target-libgfortran: \ + configure-target-libgfortran + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-libgfortran + +.PHONY: maybe-install-info-target-libgfortran install-info-target-libgfortran +maybe-install-info-target-libgfortran: +@if target-libgfortran +maybe-install-info-target-libgfortran: install-info-target-libgfortran + +install-info-target-libgfortran: \ + configure-target-libgfortran \ + info-target-libgfortran + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-libgfortran + +.PHONY: maybe-install-pdf-target-libgfortran install-pdf-target-libgfortran +maybe-install-pdf-target-libgfortran: +@if target-libgfortran +maybe-install-pdf-target-libgfortran: install-pdf-target-libgfortran + +install-pdf-target-libgfortran: \ + configure-target-libgfortran \ + pdf-target-libgfortran + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-libgfortran + +.PHONY: maybe-install-html-target-libgfortran install-html-target-libgfortran +maybe-install-html-target-libgfortran: +@if target-libgfortran +maybe-install-html-target-libgfortran: install-html-target-libgfortran + +install-html-target-libgfortran: \ + configure-target-libgfortran \ + html-target-libgfortran + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-libgfortran + +.PHONY: maybe-installcheck-target-libgfortran installcheck-target-libgfortran +maybe-installcheck-target-libgfortran: +@if target-libgfortran +maybe-installcheck-target-libgfortran: installcheck-target-libgfortran + +installcheck-target-libgfortran: \ + configure-target-libgfortran + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-libgfortran + +.PHONY: maybe-mostlyclean-target-libgfortran mostlyclean-target-libgfortran +maybe-mostlyclean-target-libgfortran: +@if target-libgfortran +maybe-mostlyclean-target-libgfortran: mostlyclean-target-libgfortran + +mostlyclean-target-libgfortran: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-libgfortran + +.PHONY: maybe-clean-target-libgfortran clean-target-libgfortran +maybe-clean-target-libgfortran: +@if target-libgfortran +maybe-clean-target-libgfortran: clean-target-libgfortran + +clean-target-libgfortran: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-libgfortran + +.PHONY: maybe-distclean-target-libgfortran distclean-target-libgfortran +maybe-distclean-target-libgfortran: +@if target-libgfortran +maybe-distclean-target-libgfortran: distclean-target-libgfortran + +distclean-target-libgfortran: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-libgfortran + +.PHONY: maybe-maintainer-clean-target-libgfortran maintainer-clean-target-libgfortran +maybe-maintainer-clean-target-libgfortran: +@if target-libgfortran +maybe-maintainer-clean-target-libgfortran: maintainer-clean-target-libgfortran + +maintainer-clean-target-libgfortran: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-libgfortran + + + + + +.PHONY: configure-target-libobjc maybe-configure-target-libobjc +maybe-configure-target-libobjc: +@if gcc-bootstrap +configure-target-libobjc: stage_current +@endif gcc-bootstrap +@if target-libobjc +maybe-configure-target-libobjc: configure-target-libobjc +configure-target-libobjc: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libobjc..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libobjc ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libobjc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libobjc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libobjc/multilib.tmp $(TARGET_SUBDIR)/libobjc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libobjc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libobjc/Makefile; \ + mv $(TARGET_SUBDIR)/libobjc/multilib.tmp $(TARGET_SUBDIR)/libobjc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libobjc/multilib.tmp $(TARGET_SUBDIR)/libobjc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libobjc/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libobjc ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/libobjc; \ + cd "$(TARGET_SUBDIR)/libobjc" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libobjc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libobjc"; \ + libsrcdir="$$s/libobjc"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-libobjc + + + + + +.PHONY: all-target-libobjc maybe-all-target-libobjc +maybe-all-target-libobjc: +@if gcc-bootstrap +all-target-libobjc: stage_current +@endif gcc-bootstrap +@if target-libobjc +TARGET-target-libobjc=all +maybe-all-target-libobjc: all-target-libobjc +all-target-libobjc: configure-target-libobjc + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-libobjc)) +@endif target-libobjc + + + + + +.PHONY: check-target-libobjc maybe-check-target-libobjc +maybe-check-target-libobjc: +@if target-libobjc +maybe-check-target-libobjc: check-target-libobjc + +check-target-libobjc: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + +@endif target-libobjc + +.PHONY: install-target-libobjc maybe-install-target-libobjc +maybe-install-target-libobjc: +@if target-libobjc +maybe-install-target-libobjc: install-target-libobjc + +install-target-libobjc: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-libobjc + +.PHONY: install-strip-target-libobjc maybe-install-strip-target-libobjc +maybe-install-strip-target-libobjc: +@if target-libobjc +maybe-install-strip-target-libobjc: install-strip-target-libobjc + +install-strip-target-libobjc: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-libobjc + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-libobjc info-target-libobjc +maybe-info-target-libobjc: +@if target-libobjc +maybe-info-target-libobjc: info-target-libobjc + +info-target-libobjc: \ + configure-target-libobjc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-libobjc + +.PHONY: maybe-dvi-target-libobjc dvi-target-libobjc +maybe-dvi-target-libobjc: +@if target-libobjc +maybe-dvi-target-libobjc: dvi-target-libobjc + +dvi-target-libobjc: \ + configure-target-libobjc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-libobjc + +.PHONY: maybe-pdf-target-libobjc pdf-target-libobjc +maybe-pdf-target-libobjc: +@if target-libobjc +maybe-pdf-target-libobjc: pdf-target-libobjc + +pdf-target-libobjc: \ + configure-target-libobjc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-libobjc + +.PHONY: maybe-html-target-libobjc html-target-libobjc +maybe-html-target-libobjc: +@if target-libobjc +maybe-html-target-libobjc: html-target-libobjc + +html-target-libobjc: \ + configure-target-libobjc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-libobjc + +.PHONY: maybe-TAGS-target-libobjc TAGS-target-libobjc +maybe-TAGS-target-libobjc: +@if target-libobjc +maybe-TAGS-target-libobjc: TAGS-target-libobjc + +TAGS-target-libobjc: \ + configure-target-libobjc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-libobjc + +.PHONY: maybe-install-info-target-libobjc install-info-target-libobjc +maybe-install-info-target-libobjc: +@if target-libobjc +maybe-install-info-target-libobjc: install-info-target-libobjc + +install-info-target-libobjc: \ + configure-target-libobjc \ + info-target-libobjc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-libobjc + +.PHONY: maybe-install-pdf-target-libobjc install-pdf-target-libobjc +maybe-install-pdf-target-libobjc: +@if target-libobjc +maybe-install-pdf-target-libobjc: install-pdf-target-libobjc + +install-pdf-target-libobjc: \ + configure-target-libobjc \ + pdf-target-libobjc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-libobjc + +.PHONY: maybe-install-html-target-libobjc install-html-target-libobjc +maybe-install-html-target-libobjc: +@if target-libobjc +maybe-install-html-target-libobjc: install-html-target-libobjc + +install-html-target-libobjc: \ + configure-target-libobjc \ + html-target-libobjc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-libobjc + +.PHONY: maybe-installcheck-target-libobjc installcheck-target-libobjc +maybe-installcheck-target-libobjc: +@if target-libobjc +maybe-installcheck-target-libobjc: installcheck-target-libobjc + +installcheck-target-libobjc: \ + configure-target-libobjc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-libobjc + +.PHONY: maybe-mostlyclean-target-libobjc mostlyclean-target-libobjc +maybe-mostlyclean-target-libobjc: +@if target-libobjc +maybe-mostlyclean-target-libobjc: mostlyclean-target-libobjc + +mostlyclean-target-libobjc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-libobjc + +.PHONY: maybe-clean-target-libobjc clean-target-libobjc +maybe-clean-target-libobjc: +@if target-libobjc +maybe-clean-target-libobjc: clean-target-libobjc + +clean-target-libobjc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-libobjc + +.PHONY: maybe-distclean-target-libobjc distclean-target-libobjc +maybe-distclean-target-libobjc: +@if target-libobjc +maybe-distclean-target-libobjc: distclean-target-libobjc + +distclean-target-libobjc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-libobjc + +.PHONY: maybe-maintainer-clean-target-libobjc maintainer-clean-target-libobjc +maybe-maintainer-clean-target-libobjc: +@if target-libobjc +maybe-maintainer-clean-target-libobjc: maintainer-clean-target-libobjc + +maintainer-clean-target-libobjc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-libobjc + + + + + +.PHONY: configure-target-libgo maybe-configure-target-libgo +maybe-configure-target-libgo: +@if gcc-bootstrap +configure-target-libgo: stage_current +@endif gcc-bootstrap +@if target-libgo +maybe-configure-target-libgo: configure-target-libgo +configure-target-libgo: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgo..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgo ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgo/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgo/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgo/multilib.tmp $(TARGET_SUBDIR)/libgo/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgo/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgo/Makefile; \ + mv $(TARGET_SUBDIR)/libgo/multilib.tmp $(TARGET_SUBDIR)/libgo/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgo/multilib.tmp $(TARGET_SUBDIR)/libgo/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgo/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgo ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/libgo; \ + cd "$(TARGET_SUBDIR)/libgo" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgo/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgo"; \ + libsrcdir="$$s/libgo"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-libgo + + + + + +.PHONY: all-target-libgo maybe-all-target-libgo +maybe-all-target-libgo: +@if gcc-bootstrap +all-target-libgo: stage_current +@endif gcc-bootstrap +@if target-libgo +TARGET-target-libgo=all +maybe-all-target-libgo: all-target-libgo +all-target-libgo: configure-target-libgo + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-libgo)) +@endif target-libgo + + + + + +.PHONY: check-target-libgo maybe-check-target-libgo +maybe-check-target-libgo: +@if target-libgo +maybe-check-target-libgo: check-target-libgo + +check-target-libgo: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + +@endif target-libgo + +.PHONY: install-target-libgo maybe-install-target-libgo +maybe-install-target-libgo: +@if target-libgo +maybe-install-target-libgo: install-target-libgo + +install-target-libgo: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-libgo + +.PHONY: install-strip-target-libgo maybe-install-strip-target-libgo +maybe-install-strip-target-libgo: +@if target-libgo +maybe-install-strip-target-libgo: install-strip-target-libgo + +install-strip-target-libgo: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-libgo + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-libgo info-target-libgo +maybe-info-target-libgo: +@if target-libgo +maybe-info-target-libgo: info-target-libgo + +info-target-libgo: \ + configure-target-libgo + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgo/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/libgo" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-libgo + +.PHONY: maybe-dvi-target-libgo dvi-target-libgo +maybe-dvi-target-libgo: +@if target-libgo +maybe-dvi-target-libgo: dvi-target-libgo + +dvi-target-libgo: \ + configure-target-libgo + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgo/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libgo" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-libgo + +.PHONY: maybe-pdf-target-libgo pdf-target-libgo +maybe-pdf-target-libgo: +@if target-libgo +maybe-pdf-target-libgo: pdf-target-libgo + +pdf-target-libgo: \ + configure-target-libgo + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgo/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libgo" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-libgo + +.PHONY: maybe-html-target-libgo html-target-libgo +maybe-html-target-libgo: +@if target-libgo +maybe-html-target-libgo: html-target-libgo + +html-target-libgo: \ + configure-target-libgo + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgo/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/libgo" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-libgo + +.PHONY: maybe-TAGS-target-libgo TAGS-target-libgo +maybe-TAGS-target-libgo: +@if target-libgo +maybe-TAGS-target-libgo: TAGS-target-libgo + +TAGS-target-libgo: \ + configure-target-libgo + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgo/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libgo" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-libgo + +.PHONY: maybe-install-info-target-libgo install-info-target-libgo +maybe-install-info-target-libgo: +@if target-libgo +maybe-install-info-target-libgo: install-info-target-libgo + +install-info-target-libgo: \ + configure-target-libgo \ + info-target-libgo + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgo/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libgo" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-libgo + +.PHONY: maybe-install-pdf-target-libgo install-pdf-target-libgo +maybe-install-pdf-target-libgo: +@if target-libgo +maybe-install-pdf-target-libgo: install-pdf-target-libgo + +install-pdf-target-libgo: \ + configure-target-libgo \ + pdf-target-libgo + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgo/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libgo" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-libgo + +.PHONY: maybe-install-html-target-libgo install-html-target-libgo +maybe-install-html-target-libgo: +@if target-libgo +maybe-install-html-target-libgo: install-html-target-libgo + +install-html-target-libgo: \ + configure-target-libgo \ + html-target-libgo + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgo/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/libgo" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-libgo + +.PHONY: maybe-installcheck-target-libgo installcheck-target-libgo +maybe-installcheck-target-libgo: +@if target-libgo +maybe-installcheck-target-libgo: installcheck-target-libgo + +installcheck-target-libgo: \ + configure-target-libgo + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgo/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libgo" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-libgo + +.PHONY: maybe-mostlyclean-target-libgo mostlyclean-target-libgo +maybe-mostlyclean-target-libgo: +@if target-libgo +maybe-mostlyclean-target-libgo: mostlyclean-target-libgo + +mostlyclean-target-libgo: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgo/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgo" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-libgo + +.PHONY: maybe-clean-target-libgo clean-target-libgo +maybe-clean-target-libgo: +@if target-libgo +maybe-clean-target-libgo: clean-target-libgo + +clean-target-libgo: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgo/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/libgo" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-libgo + +.PHONY: maybe-distclean-target-libgo distclean-target-libgo +maybe-distclean-target-libgo: +@if target-libgo +maybe-distclean-target-libgo: distclean-target-libgo + +distclean-target-libgo: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgo/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libgo" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-libgo + +.PHONY: maybe-maintainer-clean-target-libgo maintainer-clean-target-libgo +maybe-maintainer-clean-target-libgo: +@if target-libgo +maybe-maintainer-clean-target-libgo: maintainer-clean-target-libgo + +maintainer-clean-target-libgo: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgo/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgo" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-libgo + + + + + +.PHONY: configure-target-libtermcap maybe-configure-target-libtermcap +maybe-configure-target-libtermcap: +@if gcc-bootstrap +configure-target-libtermcap: stage_current +@endif gcc-bootstrap +@if target-libtermcap +maybe-configure-target-libtermcap: configure-target-libtermcap +configure-target-libtermcap: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libtermcap..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libtermcap ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libtermcap/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libtermcap/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libtermcap/multilib.tmp $(TARGET_SUBDIR)/libtermcap/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libtermcap/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libtermcap/Makefile; \ + mv $(TARGET_SUBDIR)/libtermcap/multilib.tmp $(TARGET_SUBDIR)/libtermcap/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libtermcap/multilib.tmp $(TARGET_SUBDIR)/libtermcap/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libtermcap/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libtermcap ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/libtermcap; \ + cd "$(TARGET_SUBDIR)/libtermcap" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libtermcap/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libtermcap"; \ + libsrcdir="$$s/libtermcap"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-libtermcap + + + + + +.PHONY: all-target-libtermcap maybe-all-target-libtermcap +maybe-all-target-libtermcap: +@if gcc-bootstrap +all-target-libtermcap: stage_current +@endif gcc-bootstrap +@if target-libtermcap +TARGET-target-libtermcap=all +maybe-all-target-libtermcap: all-target-libtermcap +all-target-libtermcap: configure-target-libtermcap + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-libtermcap)) +@endif target-libtermcap + + + + + +.PHONY: check-target-libtermcap maybe-check-target-libtermcap +maybe-check-target-libtermcap: +@if target-libtermcap +maybe-check-target-libtermcap: check-target-libtermcap + +# Dummy target for uncheckable module. +check-target-libtermcap: + +@endif target-libtermcap + +.PHONY: install-target-libtermcap maybe-install-target-libtermcap +maybe-install-target-libtermcap: +@if target-libtermcap +maybe-install-target-libtermcap: install-target-libtermcap + +install-target-libtermcap: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-libtermcap + +.PHONY: install-strip-target-libtermcap maybe-install-strip-target-libtermcap +maybe-install-strip-target-libtermcap: +@if target-libtermcap +maybe-install-strip-target-libtermcap: install-strip-target-libtermcap + +install-strip-target-libtermcap: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-libtermcap + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-libtermcap info-target-libtermcap +maybe-info-target-libtermcap: +@if target-libtermcap +maybe-info-target-libtermcap: info-target-libtermcap + +info-target-libtermcap: \ + configure-target-libtermcap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-libtermcap + +.PHONY: maybe-dvi-target-libtermcap dvi-target-libtermcap +maybe-dvi-target-libtermcap: +@if target-libtermcap +maybe-dvi-target-libtermcap: dvi-target-libtermcap + +dvi-target-libtermcap: \ + configure-target-libtermcap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-libtermcap + +.PHONY: maybe-pdf-target-libtermcap pdf-target-libtermcap +maybe-pdf-target-libtermcap: +@if target-libtermcap +maybe-pdf-target-libtermcap: pdf-target-libtermcap + +pdf-target-libtermcap: \ + configure-target-libtermcap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-libtermcap + +.PHONY: maybe-html-target-libtermcap html-target-libtermcap +maybe-html-target-libtermcap: +@if target-libtermcap +maybe-html-target-libtermcap: html-target-libtermcap + +html-target-libtermcap: \ + configure-target-libtermcap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-libtermcap + +.PHONY: maybe-TAGS-target-libtermcap TAGS-target-libtermcap +maybe-TAGS-target-libtermcap: +@if target-libtermcap +maybe-TAGS-target-libtermcap: TAGS-target-libtermcap + +TAGS-target-libtermcap: \ + configure-target-libtermcap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-libtermcap + +.PHONY: maybe-install-info-target-libtermcap install-info-target-libtermcap +maybe-install-info-target-libtermcap: +@if target-libtermcap +maybe-install-info-target-libtermcap: install-info-target-libtermcap + +install-info-target-libtermcap: \ + configure-target-libtermcap \ + info-target-libtermcap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-libtermcap + +.PHONY: maybe-install-pdf-target-libtermcap install-pdf-target-libtermcap +maybe-install-pdf-target-libtermcap: +@if target-libtermcap +maybe-install-pdf-target-libtermcap: install-pdf-target-libtermcap + +install-pdf-target-libtermcap: \ + configure-target-libtermcap \ + pdf-target-libtermcap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-libtermcap + +.PHONY: maybe-install-html-target-libtermcap install-html-target-libtermcap +maybe-install-html-target-libtermcap: +@if target-libtermcap +maybe-install-html-target-libtermcap: install-html-target-libtermcap + +install-html-target-libtermcap: \ + configure-target-libtermcap \ + html-target-libtermcap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-libtermcap + +.PHONY: maybe-installcheck-target-libtermcap installcheck-target-libtermcap +maybe-installcheck-target-libtermcap: +@if target-libtermcap +maybe-installcheck-target-libtermcap: installcheck-target-libtermcap + +installcheck-target-libtermcap: \ + configure-target-libtermcap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-libtermcap + +.PHONY: maybe-mostlyclean-target-libtermcap mostlyclean-target-libtermcap +maybe-mostlyclean-target-libtermcap: +@if target-libtermcap +maybe-mostlyclean-target-libtermcap: mostlyclean-target-libtermcap + +# libtermcap doesn't support mostlyclean. +mostlyclean-target-libtermcap: + +@endif target-libtermcap + +.PHONY: maybe-clean-target-libtermcap clean-target-libtermcap +maybe-clean-target-libtermcap: +@if target-libtermcap +maybe-clean-target-libtermcap: clean-target-libtermcap + +# libtermcap doesn't support clean. +clean-target-libtermcap: + +@endif target-libtermcap + +.PHONY: maybe-distclean-target-libtermcap distclean-target-libtermcap +maybe-distclean-target-libtermcap: +@if target-libtermcap +maybe-distclean-target-libtermcap: distclean-target-libtermcap + +# libtermcap doesn't support distclean. +distclean-target-libtermcap: + +@endif target-libtermcap + +.PHONY: maybe-maintainer-clean-target-libtermcap maintainer-clean-target-libtermcap +maybe-maintainer-clean-target-libtermcap: +@if target-libtermcap +maybe-maintainer-clean-target-libtermcap: maintainer-clean-target-libtermcap + +# libtermcap doesn't support maintainer-clean. +maintainer-clean-target-libtermcap: + +@endif target-libtermcap + + + + + +.PHONY: configure-target-winsup maybe-configure-target-winsup +maybe-configure-target-winsup: +@if gcc-bootstrap +configure-target-winsup: stage_current +@endif gcc-bootstrap +@if target-winsup +maybe-configure-target-winsup: configure-target-winsup +configure-target-winsup: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for winsup..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/winsup ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/winsup/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/winsup/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/winsup/multilib.tmp $(TARGET_SUBDIR)/winsup/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/winsup/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/winsup/Makefile; \ + mv $(TARGET_SUBDIR)/winsup/multilib.tmp $(TARGET_SUBDIR)/winsup/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/winsup/multilib.tmp $(TARGET_SUBDIR)/winsup/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/winsup/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/winsup ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/winsup; \ + cd "$(TARGET_SUBDIR)/winsup" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/winsup/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/winsup"; \ + libsrcdir="$$s/winsup"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-winsup + + + + + +.PHONY: all-target-winsup maybe-all-target-winsup +maybe-all-target-winsup: +@if gcc-bootstrap +all-target-winsup: stage_current +@endif gcc-bootstrap +@if target-winsup +TARGET-target-winsup=all +maybe-all-target-winsup: all-target-winsup +all-target-winsup: configure-target-winsup + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-winsup)) +@endif target-winsup + + + + + +.PHONY: check-target-winsup maybe-check-target-winsup +maybe-check-target-winsup: +@if target-winsup +maybe-check-target-winsup: check-target-winsup + +check-target-winsup: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + +@endif target-winsup + +.PHONY: install-target-winsup maybe-install-target-winsup +maybe-install-target-winsup: +@if target-winsup +maybe-install-target-winsup: install-target-winsup + +install-target-winsup: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-winsup + +.PHONY: install-strip-target-winsup maybe-install-strip-target-winsup +maybe-install-strip-target-winsup: +@if target-winsup +maybe-install-strip-target-winsup: install-strip-target-winsup + +install-strip-target-winsup: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-winsup + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-winsup info-target-winsup +maybe-info-target-winsup: +@if target-winsup +maybe-info-target-winsup: info-target-winsup + +info-target-winsup: \ + configure-target-winsup + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-winsup + +.PHONY: maybe-dvi-target-winsup dvi-target-winsup +maybe-dvi-target-winsup: +@if target-winsup +maybe-dvi-target-winsup: dvi-target-winsup + +dvi-target-winsup: \ + configure-target-winsup + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-winsup + +.PHONY: maybe-pdf-target-winsup pdf-target-winsup +maybe-pdf-target-winsup: +@if target-winsup +maybe-pdf-target-winsup: pdf-target-winsup + +pdf-target-winsup: \ + configure-target-winsup + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-winsup + +.PHONY: maybe-html-target-winsup html-target-winsup +maybe-html-target-winsup: +@if target-winsup +maybe-html-target-winsup: html-target-winsup + +html-target-winsup: \ + configure-target-winsup + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-winsup + +.PHONY: maybe-TAGS-target-winsup TAGS-target-winsup +maybe-TAGS-target-winsup: +@if target-winsup +maybe-TAGS-target-winsup: TAGS-target-winsup + +TAGS-target-winsup: \ + configure-target-winsup + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-winsup + +.PHONY: maybe-install-info-target-winsup install-info-target-winsup +maybe-install-info-target-winsup: +@if target-winsup +maybe-install-info-target-winsup: install-info-target-winsup + +install-info-target-winsup: \ + configure-target-winsup \ + info-target-winsup + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-winsup + +.PHONY: maybe-install-pdf-target-winsup install-pdf-target-winsup +maybe-install-pdf-target-winsup: +@if target-winsup +maybe-install-pdf-target-winsup: install-pdf-target-winsup + +install-pdf-target-winsup: \ + configure-target-winsup \ + pdf-target-winsup + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-winsup + +.PHONY: maybe-install-html-target-winsup install-html-target-winsup +maybe-install-html-target-winsup: +@if target-winsup +maybe-install-html-target-winsup: install-html-target-winsup + +install-html-target-winsup: \ + configure-target-winsup \ + html-target-winsup + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-winsup + +.PHONY: maybe-installcheck-target-winsup installcheck-target-winsup +maybe-installcheck-target-winsup: +@if target-winsup +maybe-installcheck-target-winsup: installcheck-target-winsup + +installcheck-target-winsup: \ + configure-target-winsup + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-winsup + +.PHONY: maybe-mostlyclean-target-winsup mostlyclean-target-winsup +maybe-mostlyclean-target-winsup: +@if target-winsup +maybe-mostlyclean-target-winsup: mostlyclean-target-winsup + +mostlyclean-target-winsup: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-winsup + +.PHONY: maybe-clean-target-winsup clean-target-winsup +maybe-clean-target-winsup: +@if target-winsup +maybe-clean-target-winsup: clean-target-winsup + +clean-target-winsup: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-winsup + +.PHONY: maybe-distclean-target-winsup distclean-target-winsup +maybe-distclean-target-winsup: +@if target-winsup +maybe-distclean-target-winsup: distclean-target-winsup + +distclean-target-winsup: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-winsup + +.PHONY: maybe-maintainer-clean-target-winsup maintainer-clean-target-winsup +maybe-maintainer-clean-target-winsup: +@if target-winsup +maybe-maintainer-clean-target-winsup: maintainer-clean-target-winsup + +maintainer-clean-target-winsup: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-winsup + + + + + +.PHONY: configure-target-libgloss maybe-configure-target-libgloss +maybe-configure-target-libgloss: +@if gcc-bootstrap +configure-target-libgloss: stage_current +@endif gcc-bootstrap +@if target-libgloss +maybe-configure-target-libgloss: configure-target-libgloss +configure-target-libgloss: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgloss..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgloss ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgloss/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgloss/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgloss/multilib.tmp $(TARGET_SUBDIR)/libgloss/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgloss/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgloss/Makefile; \ + mv $(TARGET_SUBDIR)/libgloss/multilib.tmp $(TARGET_SUBDIR)/libgloss/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgloss/multilib.tmp $(TARGET_SUBDIR)/libgloss/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgloss/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgloss ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/libgloss; \ + cd "$(TARGET_SUBDIR)/libgloss" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgloss/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgloss"; \ + libsrcdir="$$s/libgloss"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-libgloss + + + + + +.PHONY: all-target-libgloss maybe-all-target-libgloss +maybe-all-target-libgloss: +@if gcc-bootstrap +all-target-libgloss: stage_current +@endif gcc-bootstrap +@if target-libgloss +TARGET-target-libgloss=all +maybe-all-target-libgloss: all-target-libgloss +all-target-libgloss: configure-target-libgloss + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-libgloss)) +@endif target-libgloss + + + + + +.PHONY: check-target-libgloss maybe-check-target-libgloss +maybe-check-target-libgloss: +@if target-libgloss +maybe-check-target-libgloss: check-target-libgloss + +# Dummy target for uncheckable module. +check-target-libgloss: + +@endif target-libgloss + +.PHONY: install-target-libgloss maybe-install-target-libgloss +maybe-install-target-libgloss: +@if target-libgloss +maybe-install-target-libgloss: install-target-libgloss + +install-target-libgloss: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-libgloss + +.PHONY: install-strip-target-libgloss maybe-install-strip-target-libgloss +maybe-install-strip-target-libgloss: +@if target-libgloss +maybe-install-strip-target-libgloss: install-strip-target-libgloss + +install-strip-target-libgloss: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-libgloss + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-libgloss info-target-libgloss +maybe-info-target-libgloss: +@if target-libgloss +maybe-info-target-libgloss: info-target-libgloss + +info-target-libgloss: \ + configure-target-libgloss + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-libgloss + +.PHONY: maybe-dvi-target-libgloss dvi-target-libgloss +maybe-dvi-target-libgloss: +@if target-libgloss +maybe-dvi-target-libgloss: dvi-target-libgloss + +dvi-target-libgloss: \ + configure-target-libgloss + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-libgloss + +.PHONY: maybe-pdf-target-libgloss pdf-target-libgloss +maybe-pdf-target-libgloss: +@if target-libgloss +maybe-pdf-target-libgloss: pdf-target-libgloss + +pdf-target-libgloss: \ + configure-target-libgloss + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-libgloss + +.PHONY: maybe-html-target-libgloss html-target-libgloss +maybe-html-target-libgloss: +@if target-libgloss +maybe-html-target-libgloss: html-target-libgloss + +html-target-libgloss: \ + configure-target-libgloss + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-libgloss + +.PHONY: maybe-TAGS-target-libgloss TAGS-target-libgloss +maybe-TAGS-target-libgloss: +@if target-libgloss +maybe-TAGS-target-libgloss: TAGS-target-libgloss + +TAGS-target-libgloss: \ + configure-target-libgloss + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-libgloss + +.PHONY: maybe-install-info-target-libgloss install-info-target-libgloss +maybe-install-info-target-libgloss: +@if target-libgloss +maybe-install-info-target-libgloss: install-info-target-libgloss + +install-info-target-libgloss: \ + configure-target-libgloss \ + info-target-libgloss + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-libgloss + +.PHONY: maybe-install-pdf-target-libgloss install-pdf-target-libgloss +maybe-install-pdf-target-libgloss: +@if target-libgloss +maybe-install-pdf-target-libgloss: install-pdf-target-libgloss + +install-pdf-target-libgloss: \ + configure-target-libgloss \ + pdf-target-libgloss + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-libgloss + +.PHONY: maybe-install-html-target-libgloss install-html-target-libgloss +maybe-install-html-target-libgloss: +@if target-libgloss +maybe-install-html-target-libgloss: install-html-target-libgloss + +install-html-target-libgloss: \ + configure-target-libgloss \ + html-target-libgloss + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-libgloss + +.PHONY: maybe-installcheck-target-libgloss installcheck-target-libgloss +maybe-installcheck-target-libgloss: +@if target-libgloss +maybe-installcheck-target-libgloss: installcheck-target-libgloss + +installcheck-target-libgloss: \ + configure-target-libgloss + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-libgloss + +.PHONY: maybe-mostlyclean-target-libgloss mostlyclean-target-libgloss +maybe-mostlyclean-target-libgloss: +@if target-libgloss +maybe-mostlyclean-target-libgloss: mostlyclean-target-libgloss + +mostlyclean-target-libgloss: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-libgloss + +.PHONY: maybe-clean-target-libgloss clean-target-libgloss +maybe-clean-target-libgloss: +@if target-libgloss +maybe-clean-target-libgloss: clean-target-libgloss + +clean-target-libgloss: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-libgloss + +.PHONY: maybe-distclean-target-libgloss distclean-target-libgloss +maybe-distclean-target-libgloss: +@if target-libgloss +maybe-distclean-target-libgloss: distclean-target-libgloss + +distclean-target-libgloss: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-libgloss + +.PHONY: maybe-maintainer-clean-target-libgloss maintainer-clean-target-libgloss +maybe-maintainer-clean-target-libgloss: +@if target-libgloss +maybe-maintainer-clean-target-libgloss: maintainer-clean-target-libgloss + +maintainer-clean-target-libgloss: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-libgloss + + + + + +.PHONY: configure-target-libffi maybe-configure-target-libffi +maybe-configure-target-libffi: +@if gcc-bootstrap +configure-target-libffi: stage_current +@endif gcc-bootstrap +@if target-libffi +maybe-configure-target-libffi: configure-target-libffi +configure-target-libffi: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libffi..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libffi ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libffi/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libffi/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libffi/multilib.tmp $(TARGET_SUBDIR)/libffi/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libffi/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libffi/Makefile; \ + mv $(TARGET_SUBDIR)/libffi/multilib.tmp $(TARGET_SUBDIR)/libffi/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libffi/multilib.tmp $(TARGET_SUBDIR)/libffi/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libffi/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libffi ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/libffi; \ + cd "$(TARGET_SUBDIR)/libffi" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libffi/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libffi"; \ + libsrcdir="$$s/libffi"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-libffi + + + + + +.PHONY: all-target-libffi maybe-all-target-libffi +maybe-all-target-libffi: +@if gcc-bootstrap +all-target-libffi: stage_current +@endif gcc-bootstrap +@if target-libffi +TARGET-target-libffi=all +maybe-all-target-libffi: all-target-libffi +all-target-libffi: configure-target-libffi + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-libffi)) +@endif target-libffi + + + + + +.PHONY: check-target-libffi maybe-check-target-libffi +maybe-check-target-libffi: +@if target-libffi +maybe-check-target-libffi: check-target-libffi + +check-target-libffi: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + +@endif target-libffi + +.PHONY: install-target-libffi maybe-install-target-libffi +maybe-install-target-libffi: +@if target-libffi +maybe-install-target-libffi: install-target-libffi + +install-target-libffi: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-libffi + +.PHONY: install-strip-target-libffi maybe-install-strip-target-libffi +maybe-install-strip-target-libffi: +@if target-libffi +maybe-install-strip-target-libffi: install-strip-target-libffi + +install-strip-target-libffi: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-libffi + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-libffi info-target-libffi +maybe-info-target-libffi: +@if target-libffi +maybe-info-target-libffi: info-target-libffi + +info-target-libffi: \ + configure-target-libffi + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-libffi + +.PHONY: maybe-dvi-target-libffi dvi-target-libffi +maybe-dvi-target-libffi: +@if target-libffi +maybe-dvi-target-libffi: dvi-target-libffi + +dvi-target-libffi: \ + configure-target-libffi + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-libffi + +.PHONY: maybe-pdf-target-libffi pdf-target-libffi +maybe-pdf-target-libffi: +@if target-libffi +maybe-pdf-target-libffi: pdf-target-libffi + +pdf-target-libffi: \ + configure-target-libffi + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-libffi + +.PHONY: maybe-html-target-libffi html-target-libffi +maybe-html-target-libffi: +@if target-libffi +maybe-html-target-libffi: html-target-libffi + +html-target-libffi: \ + configure-target-libffi + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-libffi + +.PHONY: maybe-TAGS-target-libffi TAGS-target-libffi +maybe-TAGS-target-libffi: +@if target-libffi +maybe-TAGS-target-libffi: TAGS-target-libffi + +TAGS-target-libffi: \ + configure-target-libffi + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-libffi + +.PHONY: maybe-install-info-target-libffi install-info-target-libffi +maybe-install-info-target-libffi: +@if target-libffi +maybe-install-info-target-libffi: install-info-target-libffi + +install-info-target-libffi: \ + configure-target-libffi \ + info-target-libffi + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-libffi + +.PHONY: maybe-install-pdf-target-libffi install-pdf-target-libffi +maybe-install-pdf-target-libffi: +@if target-libffi +maybe-install-pdf-target-libffi: install-pdf-target-libffi + +install-pdf-target-libffi: \ + configure-target-libffi \ + pdf-target-libffi + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-libffi + +.PHONY: maybe-install-html-target-libffi install-html-target-libffi +maybe-install-html-target-libffi: +@if target-libffi +maybe-install-html-target-libffi: install-html-target-libffi + +install-html-target-libffi: \ + configure-target-libffi \ + html-target-libffi + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-libffi + +.PHONY: maybe-installcheck-target-libffi installcheck-target-libffi +maybe-installcheck-target-libffi: +@if target-libffi +maybe-installcheck-target-libffi: installcheck-target-libffi + +installcheck-target-libffi: \ + configure-target-libffi + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-libffi + +.PHONY: maybe-mostlyclean-target-libffi mostlyclean-target-libffi +maybe-mostlyclean-target-libffi: +@if target-libffi +maybe-mostlyclean-target-libffi: mostlyclean-target-libffi + +mostlyclean-target-libffi: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-libffi + +.PHONY: maybe-clean-target-libffi clean-target-libffi +maybe-clean-target-libffi: +@if target-libffi +maybe-clean-target-libffi: clean-target-libffi + +clean-target-libffi: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-libffi + +.PHONY: maybe-distclean-target-libffi distclean-target-libffi +maybe-distclean-target-libffi: +@if target-libffi +maybe-distclean-target-libffi: distclean-target-libffi + +distclean-target-libffi: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-libffi + +.PHONY: maybe-maintainer-clean-target-libffi maintainer-clean-target-libffi +maybe-maintainer-clean-target-libffi: +@if target-libffi +maybe-maintainer-clean-target-libffi: maintainer-clean-target-libffi + +maintainer-clean-target-libffi: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-libffi + + + + + +.PHONY: configure-target-libjava maybe-configure-target-libjava +maybe-configure-target-libjava: +@if gcc-bootstrap +configure-target-libjava: stage_current +@endif gcc-bootstrap +@if target-libjava +maybe-configure-target-libjava: configure-target-libjava +configure-target-libjava: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libjava..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libjava ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libjava/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libjava/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libjava/multilib.tmp $(TARGET_SUBDIR)/libjava/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libjava/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libjava/Makefile; \ + mv $(TARGET_SUBDIR)/libjava/multilib.tmp $(TARGET_SUBDIR)/libjava/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libjava/multilib.tmp $(TARGET_SUBDIR)/libjava/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libjava/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libjava ; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/libjava; \ + cd "$(TARGET_SUBDIR)/libjava" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libjava/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libjava"; \ + libsrcdir="$$s/libjava"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} $(EXTRA_CONFIGARGS_LIBJAVA) \ + || exit 1 +@endif target-libjava + + + + + +.PHONY: all-target-libjava maybe-all-target-libjava +maybe-all-target-libjava: +@if gcc-bootstrap +all-target-libjava: stage_current +@endif gcc-bootstrap +@if target-libjava +TARGET-target-libjava=all +maybe-all-target-libjava: all-target-libjava +all-target-libjava: configure-target-libjava + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ + $(TARGET-target-libjava)) +@endif target-libjava + + + + + +.PHONY: check-target-libjava maybe-check-target-libjava +maybe-check-target-libjava: +@if target-libjava +maybe-check-target-libjava: check-target-libjava + +check-target-libjava: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' check) + +@endif target-libjava + +.PHONY: install-target-libjava maybe-install-target-libjava +maybe-install-target-libjava: +@if target-libjava +maybe-install-target-libjava: install-target-libjava + +install-target-libjava: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-libjava + +.PHONY: install-strip-target-libjava maybe-install-strip-target-libjava +maybe-install-strip-target-libjava: +@if target-libjava +maybe-install-strip-target-libjava: install-strip-target-libjava + +install-strip-target-libjava: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-libjava + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-libjava info-target-libjava +maybe-info-target-libjava: +@if target-libjava +maybe-info-target-libjava: info-target-libjava + +info-target-libjava: \ + configure-target-libjava + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-libjava + +.PHONY: maybe-dvi-target-libjava dvi-target-libjava +maybe-dvi-target-libjava: +@if target-libjava +maybe-dvi-target-libjava: dvi-target-libjava + +dvi-target-libjava: \ + configure-target-libjava + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-libjava + +.PHONY: maybe-pdf-target-libjava pdf-target-libjava +maybe-pdf-target-libjava: +@if target-libjava +maybe-pdf-target-libjava: pdf-target-libjava + +pdf-target-libjava: \ + configure-target-libjava + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-libjava + +.PHONY: maybe-html-target-libjava html-target-libjava +maybe-html-target-libjava: +@if target-libjava +maybe-html-target-libjava: html-target-libjava + +html-target-libjava: \ + configure-target-libjava + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-libjava + +.PHONY: maybe-TAGS-target-libjava TAGS-target-libjava +maybe-TAGS-target-libjava: +@if target-libjava +maybe-TAGS-target-libjava: TAGS-target-libjava + +TAGS-target-libjava: \ + configure-target-libjava + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-libjava + +.PHONY: maybe-install-info-target-libjava install-info-target-libjava +maybe-install-info-target-libjava: +@if target-libjava +maybe-install-info-target-libjava: install-info-target-libjava + +install-info-target-libjava: \ + configure-target-libjava \ + info-target-libjava + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-libjava + +.PHONY: maybe-install-pdf-target-libjava install-pdf-target-libjava +maybe-install-pdf-target-libjava: +@if target-libjava +maybe-install-pdf-target-libjava: install-pdf-target-libjava + +install-pdf-target-libjava: \ + configure-target-libjava \ + pdf-target-libjava + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-libjava + +.PHONY: maybe-install-html-target-libjava install-html-target-libjava +maybe-install-html-target-libjava: +@if target-libjava +maybe-install-html-target-libjava: install-html-target-libjava + +install-html-target-libjava: \ + configure-target-libjava \ + html-target-libjava + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-libjava + +.PHONY: maybe-installcheck-target-libjava installcheck-target-libjava +maybe-installcheck-target-libjava: +@if target-libjava +maybe-installcheck-target-libjava: installcheck-target-libjava + +installcheck-target-libjava: \ + configure-target-libjava + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-libjava + +.PHONY: maybe-mostlyclean-target-libjava mostlyclean-target-libjava +maybe-mostlyclean-target-libjava: +@if target-libjava +maybe-mostlyclean-target-libjava: mostlyclean-target-libjava + +mostlyclean-target-libjava: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-libjava + +.PHONY: maybe-clean-target-libjava clean-target-libjava +maybe-clean-target-libjava: +@if target-libjava +maybe-clean-target-libjava: clean-target-libjava + +clean-target-libjava: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-libjava + +.PHONY: maybe-distclean-target-libjava distclean-target-libjava +maybe-distclean-target-libjava: +@if target-libjava +maybe-distclean-target-libjava: distclean-target-libjava + +distclean-target-libjava: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-libjava + +.PHONY: maybe-maintainer-clean-target-libjava maintainer-clean-target-libjava +maybe-maintainer-clean-target-libjava: +@if target-libjava +maybe-maintainer-clean-target-libjava: maintainer-clean-target-libjava + +maintainer-clean-target-libjava: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-libjava + + + + + +.PHONY: configure-target-zlib maybe-configure-target-zlib +maybe-configure-target-zlib: +@if gcc-bootstrap +configure-target-zlib: stage_current +@endif gcc-bootstrap +@if target-zlib +maybe-configure-target-zlib: configure-target-zlib +configure-target-zlib: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for zlib..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/zlib ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/zlib/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/zlib/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/zlib/multilib.tmp $(TARGET_SUBDIR)/zlib/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/zlib/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/zlib/Makefile; \ + mv $(TARGET_SUBDIR)/zlib/multilib.tmp $(TARGET_SUBDIR)/zlib/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/zlib/multilib.tmp $(TARGET_SUBDIR)/zlib/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/zlib/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/zlib ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/zlib; \ + cd "$(TARGET_SUBDIR)/zlib" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/zlib/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/zlib"; \ + libsrcdir="$$s/zlib"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-zlib + + + + + +.PHONY: all-target-zlib maybe-all-target-zlib +maybe-all-target-zlib: +@if gcc-bootstrap +all-target-zlib: stage_current +@endif gcc-bootstrap +@if target-zlib +TARGET-target-zlib=all +maybe-all-target-zlib: all-target-zlib +all-target-zlib: configure-target-zlib + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-zlib)) +@endif target-zlib + + + + + +.PHONY: check-target-zlib maybe-check-target-zlib +maybe-check-target-zlib: +@if target-zlib +maybe-check-target-zlib: check-target-zlib + +check-target-zlib: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + +@endif target-zlib + +.PHONY: install-target-zlib maybe-install-target-zlib +maybe-install-target-zlib: +@if target-zlib +maybe-install-target-zlib: install-target-zlib + +install-target-zlib: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-zlib + +.PHONY: install-strip-target-zlib maybe-install-strip-target-zlib +maybe-install-strip-target-zlib: +@if target-zlib +maybe-install-strip-target-zlib: install-strip-target-zlib + +install-strip-target-zlib: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-zlib + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-zlib info-target-zlib +maybe-info-target-zlib: +@if target-zlib +maybe-info-target-zlib: info-target-zlib + +info-target-zlib: \ + configure-target-zlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-zlib + +.PHONY: maybe-dvi-target-zlib dvi-target-zlib +maybe-dvi-target-zlib: +@if target-zlib +maybe-dvi-target-zlib: dvi-target-zlib + +dvi-target-zlib: \ + configure-target-zlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-zlib + +.PHONY: maybe-pdf-target-zlib pdf-target-zlib +maybe-pdf-target-zlib: +@if target-zlib +maybe-pdf-target-zlib: pdf-target-zlib + +pdf-target-zlib: \ + configure-target-zlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-zlib + +.PHONY: maybe-html-target-zlib html-target-zlib +maybe-html-target-zlib: +@if target-zlib +maybe-html-target-zlib: html-target-zlib + +html-target-zlib: \ + configure-target-zlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-zlib + +.PHONY: maybe-TAGS-target-zlib TAGS-target-zlib +maybe-TAGS-target-zlib: +@if target-zlib +maybe-TAGS-target-zlib: TAGS-target-zlib + +TAGS-target-zlib: \ + configure-target-zlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-zlib + +.PHONY: maybe-install-info-target-zlib install-info-target-zlib +maybe-install-info-target-zlib: +@if target-zlib +maybe-install-info-target-zlib: install-info-target-zlib + +install-info-target-zlib: \ + configure-target-zlib \ + info-target-zlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-zlib + +.PHONY: maybe-install-pdf-target-zlib install-pdf-target-zlib +maybe-install-pdf-target-zlib: +@if target-zlib +maybe-install-pdf-target-zlib: install-pdf-target-zlib + +install-pdf-target-zlib: \ + configure-target-zlib \ + pdf-target-zlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-zlib + +.PHONY: maybe-install-html-target-zlib install-html-target-zlib +maybe-install-html-target-zlib: +@if target-zlib +maybe-install-html-target-zlib: install-html-target-zlib + +install-html-target-zlib: \ + configure-target-zlib \ + html-target-zlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-zlib + +.PHONY: maybe-installcheck-target-zlib installcheck-target-zlib +maybe-installcheck-target-zlib: +@if target-zlib +maybe-installcheck-target-zlib: installcheck-target-zlib + +installcheck-target-zlib: \ + configure-target-zlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-zlib + +.PHONY: maybe-mostlyclean-target-zlib mostlyclean-target-zlib +maybe-mostlyclean-target-zlib: +@if target-zlib +maybe-mostlyclean-target-zlib: mostlyclean-target-zlib + +mostlyclean-target-zlib: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-zlib + +.PHONY: maybe-clean-target-zlib clean-target-zlib +maybe-clean-target-zlib: +@if target-zlib +maybe-clean-target-zlib: clean-target-zlib + +clean-target-zlib: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-zlib + +.PHONY: maybe-distclean-target-zlib distclean-target-zlib +maybe-distclean-target-zlib: +@if target-zlib +maybe-distclean-target-zlib: distclean-target-zlib + +distclean-target-zlib: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-zlib + +.PHONY: maybe-maintainer-clean-target-zlib maintainer-clean-target-zlib +maybe-maintainer-clean-target-zlib: +@if target-zlib +maybe-maintainer-clean-target-zlib: maintainer-clean-target-zlib + +maintainer-clean-target-zlib: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-zlib + + + + + +.PHONY: configure-target-boehm-gc maybe-configure-target-boehm-gc +maybe-configure-target-boehm-gc: +@if gcc-bootstrap +configure-target-boehm-gc: stage_current +@endif gcc-bootstrap +@if target-boehm-gc +maybe-configure-target-boehm-gc: configure-target-boehm-gc +configure-target-boehm-gc: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for boehm-gc..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/boehm-gc ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/boehm-gc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/boehm-gc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/boehm-gc/multilib.tmp $(TARGET_SUBDIR)/boehm-gc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/boehm-gc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/boehm-gc/Makefile; \ + mv $(TARGET_SUBDIR)/boehm-gc/multilib.tmp $(TARGET_SUBDIR)/boehm-gc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/boehm-gc/multilib.tmp $(TARGET_SUBDIR)/boehm-gc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/boehm-gc/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/boehm-gc ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/boehm-gc; \ + cd "$(TARGET_SUBDIR)/boehm-gc" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/boehm-gc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/boehm-gc"; \ + libsrcdir="$$s/boehm-gc"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-boehm-gc + + + + + +.PHONY: all-target-boehm-gc maybe-all-target-boehm-gc +maybe-all-target-boehm-gc: +@if gcc-bootstrap +all-target-boehm-gc: stage_current +@endif gcc-bootstrap +@if target-boehm-gc +TARGET-target-boehm-gc=all +maybe-all-target-boehm-gc: all-target-boehm-gc +all-target-boehm-gc: configure-target-boehm-gc + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-boehm-gc)) +@endif target-boehm-gc + + + + + +.PHONY: check-target-boehm-gc maybe-check-target-boehm-gc +maybe-check-target-boehm-gc: +@if target-boehm-gc +maybe-check-target-boehm-gc: check-target-boehm-gc + +check-target-boehm-gc: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + +@endif target-boehm-gc + +.PHONY: install-target-boehm-gc maybe-install-target-boehm-gc +maybe-install-target-boehm-gc: +@if target-boehm-gc +maybe-install-target-boehm-gc: install-target-boehm-gc + +install-target-boehm-gc: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-boehm-gc + +.PHONY: install-strip-target-boehm-gc maybe-install-strip-target-boehm-gc +maybe-install-strip-target-boehm-gc: +@if target-boehm-gc +maybe-install-strip-target-boehm-gc: install-strip-target-boehm-gc + +install-strip-target-boehm-gc: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-boehm-gc + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-boehm-gc info-target-boehm-gc +maybe-info-target-boehm-gc: +@if target-boehm-gc +maybe-info-target-boehm-gc: info-target-boehm-gc + +info-target-boehm-gc: \ + configure-target-boehm-gc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-boehm-gc + +.PHONY: maybe-dvi-target-boehm-gc dvi-target-boehm-gc +maybe-dvi-target-boehm-gc: +@if target-boehm-gc +maybe-dvi-target-boehm-gc: dvi-target-boehm-gc + +dvi-target-boehm-gc: \ + configure-target-boehm-gc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-boehm-gc + +.PHONY: maybe-pdf-target-boehm-gc pdf-target-boehm-gc +maybe-pdf-target-boehm-gc: +@if target-boehm-gc +maybe-pdf-target-boehm-gc: pdf-target-boehm-gc + +pdf-target-boehm-gc: \ + configure-target-boehm-gc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-boehm-gc + +.PHONY: maybe-html-target-boehm-gc html-target-boehm-gc +maybe-html-target-boehm-gc: +@if target-boehm-gc +maybe-html-target-boehm-gc: html-target-boehm-gc + +html-target-boehm-gc: \ + configure-target-boehm-gc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-boehm-gc + +.PHONY: maybe-TAGS-target-boehm-gc TAGS-target-boehm-gc +maybe-TAGS-target-boehm-gc: +@if target-boehm-gc +maybe-TAGS-target-boehm-gc: TAGS-target-boehm-gc + +TAGS-target-boehm-gc: \ + configure-target-boehm-gc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-boehm-gc + +.PHONY: maybe-install-info-target-boehm-gc install-info-target-boehm-gc +maybe-install-info-target-boehm-gc: +@if target-boehm-gc +maybe-install-info-target-boehm-gc: install-info-target-boehm-gc + +install-info-target-boehm-gc: \ + configure-target-boehm-gc \ + info-target-boehm-gc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-boehm-gc + +.PHONY: maybe-install-pdf-target-boehm-gc install-pdf-target-boehm-gc +maybe-install-pdf-target-boehm-gc: +@if target-boehm-gc +maybe-install-pdf-target-boehm-gc: install-pdf-target-boehm-gc + +install-pdf-target-boehm-gc: \ + configure-target-boehm-gc \ + pdf-target-boehm-gc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-boehm-gc + +.PHONY: maybe-install-html-target-boehm-gc install-html-target-boehm-gc +maybe-install-html-target-boehm-gc: +@if target-boehm-gc +maybe-install-html-target-boehm-gc: install-html-target-boehm-gc + +install-html-target-boehm-gc: \ + configure-target-boehm-gc \ + html-target-boehm-gc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-boehm-gc + +.PHONY: maybe-installcheck-target-boehm-gc installcheck-target-boehm-gc +maybe-installcheck-target-boehm-gc: +@if target-boehm-gc +maybe-installcheck-target-boehm-gc: installcheck-target-boehm-gc + +installcheck-target-boehm-gc: \ + configure-target-boehm-gc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-boehm-gc + +.PHONY: maybe-mostlyclean-target-boehm-gc mostlyclean-target-boehm-gc +maybe-mostlyclean-target-boehm-gc: +@if target-boehm-gc +maybe-mostlyclean-target-boehm-gc: mostlyclean-target-boehm-gc + +mostlyclean-target-boehm-gc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-boehm-gc + +.PHONY: maybe-clean-target-boehm-gc clean-target-boehm-gc +maybe-clean-target-boehm-gc: +@if target-boehm-gc +maybe-clean-target-boehm-gc: clean-target-boehm-gc + +clean-target-boehm-gc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-boehm-gc + +.PHONY: maybe-distclean-target-boehm-gc distclean-target-boehm-gc +maybe-distclean-target-boehm-gc: +@if target-boehm-gc +maybe-distclean-target-boehm-gc: distclean-target-boehm-gc + +distclean-target-boehm-gc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-boehm-gc + +.PHONY: maybe-maintainer-clean-target-boehm-gc maintainer-clean-target-boehm-gc +maybe-maintainer-clean-target-boehm-gc: +@if target-boehm-gc +maybe-maintainer-clean-target-boehm-gc: maintainer-clean-target-boehm-gc + +maintainer-clean-target-boehm-gc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-boehm-gc + + + + + +.PHONY: configure-target-rda maybe-configure-target-rda +maybe-configure-target-rda: +@if gcc-bootstrap +configure-target-rda: stage_current +@endif gcc-bootstrap +@if target-rda +maybe-configure-target-rda: configure-target-rda +configure-target-rda: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for rda..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/rda ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/rda/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/rda/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/rda/multilib.tmp $(TARGET_SUBDIR)/rda/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/rda/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/rda/Makefile; \ + mv $(TARGET_SUBDIR)/rda/multilib.tmp $(TARGET_SUBDIR)/rda/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/rda/multilib.tmp $(TARGET_SUBDIR)/rda/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/rda/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/rda ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/rda; \ + cd "$(TARGET_SUBDIR)/rda" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/rda/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/rda"; \ + libsrcdir="$$s/rda"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-rda + + + + + +.PHONY: all-target-rda maybe-all-target-rda +maybe-all-target-rda: +@if gcc-bootstrap +all-target-rda: stage_current +@endif gcc-bootstrap +@if target-rda +TARGET-target-rda=all +maybe-all-target-rda: all-target-rda +all-target-rda: configure-target-rda + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-rda)) +@endif target-rda + + + + + +.PHONY: check-target-rda maybe-check-target-rda +maybe-check-target-rda: +@if target-rda +maybe-check-target-rda: check-target-rda + +check-target-rda: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + +@endif target-rda + +.PHONY: install-target-rda maybe-install-target-rda +maybe-install-target-rda: +@if target-rda +maybe-install-target-rda: install-target-rda + +install-target-rda: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-rda + +.PHONY: install-strip-target-rda maybe-install-strip-target-rda +maybe-install-strip-target-rda: +@if target-rda +maybe-install-strip-target-rda: install-strip-target-rda + +install-strip-target-rda: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-rda + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-rda info-target-rda +maybe-info-target-rda: +@if target-rda +maybe-info-target-rda: info-target-rda + +info-target-rda: \ + configure-target-rda + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-rda + +.PHONY: maybe-dvi-target-rda dvi-target-rda +maybe-dvi-target-rda: +@if target-rda +maybe-dvi-target-rda: dvi-target-rda + +dvi-target-rda: \ + configure-target-rda + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-rda + +.PHONY: maybe-pdf-target-rda pdf-target-rda +maybe-pdf-target-rda: +@if target-rda +maybe-pdf-target-rda: pdf-target-rda + +pdf-target-rda: \ + configure-target-rda + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-rda + +.PHONY: maybe-html-target-rda html-target-rda +maybe-html-target-rda: +@if target-rda +maybe-html-target-rda: html-target-rda + +html-target-rda: \ + configure-target-rda + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-rda + +.PHONY: maybe-TAGS-target-rda TAGS-target-rda +maybe-TAGS-target-rda: +@if target-rda +maybe-TAGS-target-rda: TAGS-target-rda + +TAGS-target-rda: \ + configure-target-rda + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-rda + +.PHONY: maybe-install-info-target-rda install-info-target-rda +maybe-install-info-target-rda: +@if target-rda +maybe-install-info-target-rda: install-info-target-rda + +install-info-target-rda: \ + configure-target-rda \ + info-target-rda + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-rda + +.PHONY: maybe-install-pdf-target-rda install-pdf-target-rda +maybe-install-pdf-target-rda: +@if target-rda +maybe-install-pdf-target-rda: install-pdf-target-rda + +install-pdf-target-rda: \ + configure-target-rda \ + pdf-target-rda + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-rda + +.PHONY: maybe-install-html-target-rda install-html-target-rda +maybe-install-html-target-rda: +@if target-rda +maybe-install-html-target-rda: install-html-target-rda + +install-html-target-rda: \ + configure-target-rda \ + html-target-rda + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-rda + +.PHONY: maybe-installcheck-target-rda installcheck-target-rda +maybe-installcheck-target-rda: +@if target-rda +maybe-installcheck-target-rda: installcheck-target-rda + +installcheck-target-rda: \ + configure-target-rda + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-rda + +.PHONY: maybe-mostlyclean-target-rda mostlyclean-target-rda +maybe-mostlyclean-target-rda: +@if target-rda +maybe-mostlyclean-target-rda: mostlyclean-target-rda + +mostlyclean-target-rda: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-rda + +.PHONY: maybe-clean-target-rda clean-target-rda +maybe-clean-target-rda: +@if target-rda +maybe-clean-target-rda: clean-target-rda + +clean-target-rda: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-rda + +.PHONY: maybe-distclean-target-rda distclean-target-rda +maybe-distclean-target-rda: +@if target-rda +maybe-distclean-target-rda: distclean-target-rda + +distclean-target-rda: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-rda + +.PHONY: maybe-maintainer-clean-target-rda maintainer-clean-target-rda +maybe-maintainer-clean-target-rda: +@if target-rda +maybe-maintainer-clean-target-rda: maintainer-clean-target-rda + +maintainer-clean-target-rda: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-rda + + + + + +.PHONY: configure-target-libada maybe-configure-target-libada +maybe-configure-target-libada: +@if gcc-bootstrap +configure-target-libada: stage_current +@endif gcc-bootstrap +@if target-libada +maybe-configure-target-libada: configure-target-libada +configure-target-libada: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libada..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libada ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libada/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libada/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libada/multilib.tmp $(TARGET_SUBDIR)/libada/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libada/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libada/Makefile; \ + mv $(TARGET_SUBDIR)/libada/multilib.tmp $(TARGET_SUBDIR)/libada/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libada/multilib.tmp $(TARGET_SUBDIR)/libada/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libada/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libada ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/libada; \ + cd "$(TARGET_SUBDIR)/libada" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libada/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libada"; \ + libsrcdir="$$s/libada"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-libada + + + + + +.PHONY: all-target-libada maybe-all-target-libada +maybe-all-target-libada: +@if gcc-bootstrap +all-target-libada: stage_current +@endif gcc-bootstrap +@if target-libada +TARGET-target-libada=all +maybe-all-target-libada: all-target-libada +all-target-libada: configure-target-libada + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-libada)) +@endif target-libada + + + + + +.PHONY: check-target-libada maybe-check-target-libada +maybe-check-target-libada: +@if target-libada +maybe-check-target-libada: check-target-libada + +check-target-libada: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + +@endif target-libada + +.PHONY: install-target-libada maybe-install-target-libada +maybe-install-target-libada: +@if target-libada +maybe-install-target-libada: install-target-libada + +install-target-libada: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-libada + +.PHONY: install-strip-target-libada maybe-install-strip-target-libada +maybe-install-strip-target-libada: +@if target-libada +maybe-install-strip-target-libada: install-strip-target-libada + +install-strip-target-libada: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-libada + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-libada info-target-libada +maybe-info-target-libada: +@if target-libada +maybe-info-target-libada: info-target-libada + +info-target-libada: \ + configure-target-libada + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-libada + +.PHONY: maybe-dvi-target-libada dvi-target-libada +maybe-dvi-target-libada: +@if target-libada +maybe-dvi-target-libada: dvi-target-libada + +dvi-target-libada: \ + configure-target-libada + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-libada + +.PHONY: maybe-pdf-target-libada pdf-target-libada +maybe-pdf-target-libada: +@if target-libada +maybe-pdf-target-libada: pdf-target-libada + +pdf-target-libada: \ + configure-target-libada + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-libada + +.PHONY: maybe-html-target-libada html-target-libada +maybe-html-target-libada: +@if target-libada +maybe-html-target-libada: html-target-libada + +html-target-libada: \ + configure-target-libada + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-libada + +.PHONY: maybe-TAGS-target-libada TAGS-target-libada +maybe-TAGS-target-libada: +@if target-libada +maybe-TAGS-target-libada: TAGS-target-libada + +TAGS-target-libada: \ + configure-target-libada + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-libada + +.PHONY: maybe-install-info-target-libada install-info-target-libada +maybe-install-info-target-libada: +@if target-libada +maybe-install-info-target-libada: install-info-target-libada + +install-info-target-libada: \ + configure-target-libada \ + info-target-libada + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-libada + +.PHONY: maybe-install-pdf-target-libada install-pdf-target-libada +maybe-install-pdf-target-libada: +@if target-libada +maybe-install-pdf-target-libada: install-pdf-target-libada + +install-pdf-target-libada: \ + configure-target-libada \ + pdf-target-libada + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-libada + +.PHONY: maybe-install-html-target-libada install-html-target-libada +maybe-install-html-target-libada: +@if target-libada +maybe-install-html-target-libada: install-html-target-libada + +install-html-target-libada: \ + configure-target-libada \ + html-target-libada + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-libada + +.PHONY: maybe-installcheck-target-libada installcheck-target-libada +maybe-installcheck-target-libada: +@if target-libada +maybe-installcheck-target-libada: installcheck-target-libada + +installcheck-target-libada: \ + configure-target-libada + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-libada + +.PHONY: maybe-mostlyclean-target-libada mostlyclean-target-libada +maybe-mostlyclean-target-libada: +@if target-libada +maybe-mostlyclean-target-libada: mostlyclean-target-libada + +mostlyclean-target-libada: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-libada + +.PHONY: maybe-clean-target-libada clean-target-libada +maybe-clean-target-libada: +@if target-libada +maybe-clean-target-libada: clean-target-libada + +clean-target-libada: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-libada + +.PHONY: maybe-distclean-target-libada distclean-target-libada +maybe-distclean-target-libada: +@if target-libada +maybe-distclean-target-libada: distclean-target-libada + +distclean-target-libada: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-libada + +.PHONY: maybe-maintainer-clean-target-libada maintainer-clean-target-libada +maybe-maintainer-clean-target-libada: +@if target-libada +maybe-maintainer-clean-target-libada: maintainer-clean-target-libada + +maintainer-clean-target-libada: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-libada + + + + + +.PHONY: configure-target-libgomp maybe-configure-target-libgomp +maybe-configure-target-libgomp: +@if gcc-bootstrap +configure-target-libgomp: stage_current +@endif gcc-bootstrap +@if target-libgomp +maybe-configure-target-libgomp: configure-target-libgomp +configure-target-libgomp: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgomp..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgomp ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgomp/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgomp/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgomp/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgomp/Makefile; \ + mv $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgomp/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgomp ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/libgomp; \ + cd "$(TARGET_SUBDIR)/libgomp" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgomp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgomp"; \ + libsrcdir="$$s/libgomp"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-libgomp + + + +.PHONY: configure-stage1-target-libgomp maybe-configure-stage1-target-libgomp +maybe-configure-stage1-target-libgomp: +@if target-libgomp-bootstrap +maybe-configure-stage1-target-libgomp: configure-stage1-target-libgomp +configure-stage1-target-libgomp: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgomp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + echo "Checking multilib configuration for libgomp..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgomp/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgomp/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgomp/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgomp/Makefile; \ + mv $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgomp/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(TARGET_SUBDIR)/libgomp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgomp ; \ + cd $(TARGET_SUBDIR)/libgomp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgomp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgomp"; \ + libsrcdir="$$s/libgomp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + $(STAGE1_CONFIGURE_FLAGS) +@endif target-libgomp-bootstrap + +.PHONY: configure-stage2-target-libgomp maybe-configure-stage2-target-libgomp +maybe-configure-stage2-target-libgomp: +@if target-libgomp-bootstrap +maybe-configure-stage2-target-libgomp: configure-stage2-target-libgomp +configure-stage2-target-libgomp: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgomp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + echo "Checking multilib configuration for libgomp..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgomp/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgomp/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgomp/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgomp/Makefile; \ + mv $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgomp/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(TARGET_SUBDIR)/libgomp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgomp ; \ + cd $(TARGET_SUBDIR)/libgomp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgomp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgomp"; \ + libsrcdir="$$s/libgomp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE2_CONFIGURE_FLAGS) +@endif target-libgomp-bootstrap + +.PHONY: configure-stage3-target-libgomp maybe-configure-stage3-target-libgomp +maybe-configure-stage3-target-libgomp: +@if target-libgomp-bootstrap +maybe-configure-stage3-target-libgomp: configure-stage3-target-libgomp +configure-stage3-target-libgomp: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgomp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + echo "Checking multilib configuration for libgomp..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgomp/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgomp/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgomp/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgomp/Makefile; \ + mv $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgomp/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(TARGET_SUBDIR)/libgomp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgomp ; \ + cd $(TARGET_SUBDIR)/libgomp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgomp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgomp"; \ + libsrcdir="$$s/libgomp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE3_CONFIGURE_FLAGS) +@endif target-libgomp-bootstrap + +.PHONY: configure-stage4-target-libgomp maybe-configure-stage4-target-libgomp +maybe-configure-stage4-target-libgomp: +@if target-libgomp-bootstrap +maybe-configure-stage4-target-libgomp: configure-stage4-target-libgomp +configure-stage4-target-libgomp: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgomp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + echo "Checking multilib configuration for libgomp..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgomp/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgomp/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgomp/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgomp/Makefile; \ + mv $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgomp/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(TARGET_SUBDIR)/libgomp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgomp ; \ + cd $(TARGET_SUBDIR)/libgomp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgomp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgomp"; \ + libsrcdir="$$s/libgomp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGE4_CONFIGURE_FLAGS) +@endif target-libgomp-bootstrap + +.PHONY: configure-stageprofile-target-libgomp maybe-configure-stageprofile-target-libgomp +maybe-configure-stageprofile-target-libgomp: +@if target-libgomp-bootstrap +maybe-configure-stageprofile-target-libgomp: configure-stageprofile-target-libgomp +configure-stageprofile-target-libgomp: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgomp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + echo "Checking multilib configuration for libgomp..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgomp/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgomp/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgomp/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgomp/Makefile; \ + mv $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgomp/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage profile in $(TARGET_SUBDIR)/libgomp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgomp ; \ + cd $(TARGET_SUBDIR)/libgomp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgomp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgomp"; \ + libsrcdir="$$s/libgomp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEprofile_CONFIGURE_FLAGS) +@endif target-libgomp-bootstrap + +.PHONY: configure-stagefeedback-target-libgomp maybe-configure-stagefeedback-target-libgomp +maybe-configure-stagefeedback-target-libgomp: +@if target-libgomp-bootstrap +maybe-configure-stagefeedback-target-libgomp: configure-stagefeedback-target-libgomp +configure-stagefeedback-target-libgomp: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgomp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + echo "Checking multilib configuration for libgomp..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgomp/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgomp/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgomp/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgomp/Makefile; \ + mv $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgomp/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(TARGET_SUBDIR)/libgomp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgomp ; \ + cd $(TARGET_SUBDIR)/libgomp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgomp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgomp"; \ + libsrcdir="$$s/libgomp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + $(STAGEfeedback_CONFIGURE_FLAGS) +@endif target-libgomp-bootstrap + + + + + +.PHONY: all-target-libgomp maybe-all-target-libgomp +maybe-all-target-libgomp: +@if gcc-bootstrap +all-target-libgomp: stage_current +@endif gcc-bootstrap +@if target-libgomp +TARGET-target-libgomp=all +maybe-all-target-libgomp: all-target-libgomp +all-target-libgomp: configure-target-libgomp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ + $(TARGET-target-libgomp)) +@endif target-libgomp + + + +.PHONY: all-stage1-target-libgomp maybe-all-stage1-target-libgomp +.PHONY: clean-stage1-target-libgomp maybe-clean-stage1-target-libgomp +maybe-all-stage1-target-libgomp: +maybe-clean-stage1-target-libgomp: +@if target-libgomp-bootstrap +maybe-all-stage1-target-libgomp: all-stage1-target-libgomp +all-stage1: all-stage1-target-libgomp +TARGET-stage1-target-libgomp = $(TARGET-target-libgomp) +all-stage1-target-libgomp: configure-stage1-target-libgomp + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE1_TFLAGS)"; \ + $(NORMAL_TARGET_EXPORTS) \ + cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) \ + TFLAGS="$(STAGE1_TFLAGS)" \ + $(TARGET-stage1-target-libgomp) + +maybe-clean-stage1-target-libgomp: clean-stage1-target-libgomp +clean-stage1: clean-stage1-target-libgomp +clean-stage1-target-libgomp: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage1-libgomp/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) \ + clean +@endif target-libgomp-bootstrap + + +.PHONY: all-stage2-target-libgomp maybe-all-stage2-target-libgomp +.PHONY: clean-stage2-target-libgomp maybe-clean-stage2-target-libgomp +maybe-all-stage2-target-libgomp: +maybe-clean-stage2-target-libgomp: +@if target-libgomp-bootstrap +maybe-all-stage2-target-libgomp: all-stage2-target-libgomp +all-stage2: all-stage2-target-libgomp +TARGET-stage2-target-libgomp = $(TARGET-target-libgomp) +all-stage2-target-libgomp: configure-stage2-target-libgomp + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) \ + TFLAGS="$(STAGE2_TFLAGS)" \ + $(TARGET-stage2-target-libgomp) + +maybe-clean-stage2-target-libgomp: clean-stage2-target-libgomp +clean-stage2: clean-stage2-target-libgomp +clean-stage2-target-libgomp: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage2-libgomp/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean +@endif target-libgomp-bootstrap + + +.PHONY: all-stage3-target-libgomp maybe-all-stage3-target-libgomp +.PHONY: clean-stage3-target-libgomp maybe-clean-stage3-target-libgomp +maybe-all-stage3-target-libgomp: +maybe-clean-stage3-target-libgomp: +@if target-libgomp-bootstrap +maybe-all-stage3-target-libgomp: all-stage3-target-libgomp +all-stage3: all-stage3-target-libgomp +TARGET-stage3-target-libgomp = $(TARGET-target-libgomp) +all-stage3-target-libgomp: configure-stage3-target-libgomp + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) \ + TFLAGS="$(STAGE3_TFLAGS)" \ + $(TARGET-stage3-target-libgomp) + +maybe-clean-stage3-target-libgomp: clean-stage3-target-libgomp +clean-stage3: clean-stage3-target-libgomp +clean-stage3-target-libgomp: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage3-libgomp/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean +@endif target-libgomp-bootstrap + + +.PHONY: all-stage4-target-libgomp maybe-all-stage4-target-libgomp +.PHONY: clean-stage4-target-libgomp maybe-clean-stage4-target-libgomp +maybe-all-stage4-target-libgomp: +maybe-clean-stage4-target-libgomp: +@if target-libgomp-bootstrap +maybe-all-stage4-target-libgomp: all-stage4-target-libgomp +all-stage4: all-stage4-target-libgomp +TARGET-stage4-target-libgomp = $(TARGET-target-libgomp) +all-stage4-target-libgomp: configure-stage4-target-libgomp + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) \ + TFLAGS="$(STAGE4_TFLAGS)" \ + $(TARGET-stage4-target-libgomp) + +maybe-clean-stage4-target-libgomp: clean-stage4-target-libgomp +clean-stage4: clean-stage4-target-libgomp +clean-stage4-target-libgomp: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage4-libgomp/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean +@endif target-libgomp-bootstrap + + +.PHONY: all-stageprofile-target-libgomp maybe-all-stageprofile-target-libgomp +.PHONY: clean-stageprofile-target-libgomp maybe-clean-stageprofile-target-libgomp +maybe-all-stageprofile-target-libgomp: +maybe-clean-stageprofile-target-libgomp: +@if target-libgomp-bootstrap +maybe-all-stageprofile-target-libgomp: all-stageprofile-target-libgomp +all-stageprofile: all-stageprofile-target-libgomp +TARGET-stageprofile-target-libgomp = $(TARGET-target-libgomp) +all-stageprofile-target-libgomp: configure-stageprofile-target-libgomp + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEprofile_TFLAGS)"; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) \ + TFLAGS="$(STAGEprofile_TFLAGS)" \ + $(TARGET-stageprofile-target-libgomp) + +maybe-clean-stageprofile-target-libgomp: clean-stageprofile-target-libgomp +clean-stageprofile: clean-stageprofile-target-libgomp +clean-stageprofile-target-libgomp: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stageprofile-libgomp/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean +@endif target-libgomp-bootstrap + + +.PHONY: all-stagefeedback-target-libgomp maybe-all-stagefeedback-target-libgomp +.PHONY: clean-stagefeedback-target-libgomp maybe-clean-stagefeedback-target-libgomp +maybe-all-stagefeedback-target-libgomp: +maybe-clean-stagefeedback-target-libgomp: +@if target-libgomp-bootstrap +maybe-all-stagefeedback-target-libgomp: all-stagefeedback-target-libgomp +all-stagefeedback: all-stagefeedback-target-libgomp +TARGET-stagefeedback-target-libgomp = $(TARGET-target-libgomp) +all-stagefeedback-target-libgomp: configure-stagefeedback-target-libgomp + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + $(EXTRA_TARGET_FLAGS) \ + TFLAGS="$(STAGEfeedback_TFLAGS)" \ + $(TARGET-stagefeedback-target-libgomp) + +maybe-clean-stagefeedback-target-libgomp: clean-stagefeedback-target-libgomp +clean-stagefeedback: clean-stagefeedback-target-libgomp +clean-stagefeedback-target-libgomp: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stagefeedback-libgomp/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean +@endif target-libgomp-bootstrap + + + + + + +.PHONY: check-target-libgomp maybe-check-target-libgomp +maybe-check-target-libgomp: +@if target-libgomp +maybe-check-target-libgomp: check-target-libgomp + +check-target-libgomp: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + +@endif target-libgomp + +.PHONY: install-target-libgomp maybe-install-target-libgomp +maybe-install-target-libgomp: +@if target-libgomp +maybe-install-target-libgomp: install-target-libgomp + +install-target-libgomp: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-libgomp + +.PHONY: install-strip-target-libgomp maybe-install-strip-target-libgomp +maybe-install-strip-target-libgomp: +@if target-libgomp +maybe-install-strip-target-libgomp: install-strip-target-libgomp + +install-strip-target-libgomp: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip) + +@endif target-libgomp + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-libgomp info-target-libgomp +maybe-info-target-libgomp: +@if target-libgomp +maybe-info-target-libgomp: info-target-libgomp + +info-target-libgomp: \ + configure-target-libgomp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + info) \ + || exit 1 + +@endif target-libgomp + +.PHONY: maybe-dvi-target-libgomp dvi-target-libgomp +maybe-dvi-target-libgomp: +@if target-libgomp +maybe-dvi-target-libgomp: dvi-target-libgomp + +dvi-target-libgomp: \ + configure-target-libgomp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + dvi) \ + || exit 1 + +@endif target-libgomp + +.PHONY: maybe-pdf-target-libgomp pdf-target-libgomp +maybe-pdf-target-libgomp: +@if target-libgomp +maybe-pdf-target-libgomp: pdf-target-libgomp + +pdf-target-libgomp: \ + configure-target-libgomp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + pdf) \ + || exit 1 + +@endif target-libgomp + +.PHONY: maybe-html-target-libgomp html-target-libgomp +maybe-html-target-libgomp: +@if target-libgomp +maybe-html-target-libgomp: html-target-libgomp + +html-target-libgomp: \ + configure-target-libgomp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + html) \ + || exit 1 + +@endif target-libgomp + +.PHONY: maybe-TAGS-target-libgomp TAGS-target-libgomp +maybe-TAGS-target-libgomp: +@if target-libgomp +maybe-TAGS-target-libgomp: TAGS-target-libgomp + +TAGS-target-libgomp: \ + configure-target-libgomp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + TAGS) \ + || exit 1 + +@endif target-libgomp + +.PHONY: maybe-install-info-target-libgomp install-info-target-libgomp +maybe-install-info-target-libgomp: +@if target-libgomp +maybe-install-info-target-libgomp: install-info-target-libgomp + +install-info-target-libgomp: \ + configure-target-libgomp \ + info-target-libgomp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-info) \ + || exit 1 + +@endif target-libgomp + +.PHONY: maybe-install-pdf-target-libgomp install-pdf-target-libgomp +maybe-install-pdf-target-libgomp: +@if target-libgomp +maybe-install-pdf-target-libgomp: install-pdf-target-libgomp + +install-pdf-target-libgomp: \ + configure-target-libgomp \ + pdf-target-libgomp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-pdf) \ + || exit 1 + +@endif target-libgomp + +.PHONY: maybe-install-html-target-libgomp install-html-target-libgomp +maybe-install-html-target-libgomp: +@if target-libgomp +maybe-install-html-target-libgomp: install-html-target-libgomp + +install-html-target-libgomp: \ + configure-target-libgomp \ + html-target-libgomp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + install-html) \ + || exit 1 + +@endif target-libgomp + +.PHONY: maybe-installcheck-target-libgomp installcheck-target-libgomp +maybe-installcheck-target-libgomp: +@if target-libgomp +maybe-installcheck-target-libgomp: installcheck-target-libgomp + +installcheck-target-libgomp: \ + configure-target-libgomp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + installcheck) \ + || exit 1 + +@endif target-libgomp + +.PHONY: maybe-mostlyclean-target-libgomp mostlyclean-target-libgomp +maybe-mostlyclean-target-libgomp: +@if target-libgomp +maybe-mostlyclean-target-libgomp: mostlyclean-target-libgomp + +mostlyclean-target-libgomp: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + mostlyclean) \ + || exit 1 + +@endif target-libgomp + +.PHONY: maybe-clean-target-libgomp clean-target-libgomp +maybe-clean-target-libgomp: +@if target-libgomp +maybe-clean-target-libgomp: clean-target-libgomp + +clean-target-libgomp: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + clean) \ + || exit 1 + +@endif target-libgomp + +.PHONY: maybe-distclean-target-libgomp distclean-target-libgomp +maybe-distclean-target-libgomp: +@if target-libgomp +maybe-distclean-target-libgomp: distclean-target-libgomp + +distclean-target-libgomp: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + distclean) \ + || exit 1 + +@endif target-libgomp + +.PHONY: maybe-maintainer-clean-target-libgomp maintainer-clean-target-libgomp +maybe-maintainer-clean-target-libgomp: +@if target-libgomp +maybe-maintainer-clean-target-libgomp: maintainer-clean-target-libgomp + +maintainer-clean-target-libgomp: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + maintainer-clean) \ + || exit 1 + +@endif target-libgomp + + + +@if target-libmudflap +.PHONY: check-target-libmudflap-c++ +check-target-libmudflap-c++: + $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) c++frags.exp" check-target-libmudflap + +@endif target-libmudflap + +# ---------- +# GCC module +# ---------- + +@if gcc-no-bootstrap +.PHONY: cross +cross: all-build all-gas all-ld + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + echo "Building the C and C++ compiler"; \ + cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ + echo "Building runtime libraries"; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all +@endif gcc-no-bootstrap + +@if gcc + +.PHONY: check-gcc-c check-c +check-gcc-c: + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-gcc); +check-c: check-gcc-c + +.PHONY: check-gcc-c++ check-c++ +check-gcc-c++: + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++ check-c++0x); +check-c++: check-gcc-c++ check-target-libstdc++-v3 check-target-libmudflap-c++ + +.PHONY: check-gcc-fortran check-fortran +check-gcc-fortran: + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-fortran); +check-fortran: check-gcc-fortran check-target-libquadmath check-target-libgfortran + +.PHONY: check-gcc-java check-java +check-gcc-java: + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-java); +check-java: check-gcc-java check-target-libjava + +.PHONY: check-gcc-ada check-ada +check-gcc-ada: + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-ada); +check-ada: check-gcc-ada check-target-libada + +.PHONY: check-gcc-objc check-objc +check-gcc-objc: + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-objc); +check-objc: check-gcc-objc check-target-libobjc + +.PHONY: check-gcc-obj-c++ check-obj-c++ +check-gcc-obj-c++: + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-obj-c++); +check-obj-c++: check-gcc-obj-c++ + +.PHONY: check-gcc-go check-go +check-gcc-go: + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-go); +check-go: check-gcc-go check-target-libgo + + +# Install the gcc headers files, but not the fixed include files, +# which Cygnus is not allowed to distribute. This rule is very +# dependent on the workings of the gcc Makefile.in. +.PHONY: gcc-no-fixedincludes +gcc-no-fixedincludes: + @if [ -f ./gcc/Makefile ]; then \ + rm -rf gcc/tmp-include; \ + mv gcc/include gcc/tmp-include 2>/dev/null; \ + mkdir gcc/include; \ + cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \ + touch gcc/stmp-fixinc gcc/include/fixed; \ + rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ + $(HOST_EXPORTS) \ + (cd ./gcc && \ + $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ + rm -rf gcc/include; \ + mv gcc/tmp-include gcc/include 2>/dev/null; \ + else true; fi +@endif gcc + +# --------------------- +# GCC bootstrap support +# --------------------- + +# We track the current stage (the one in 'gcc') in the stage_current file. +# stage_last instead tracks the stage that was built last. These targets +# are dummy when toplevel bootstrap is not active. + +# While making host and target tools, symlinks to the final stage must be +# there, so $(unstage) should be run at various points. To avoid excessive +# recursive invocations of make, we "inline" them using a variable. These +# must be referenced as ": $(MAKE) ; $(unstage)" rather than "$(unstage)" +# to avoid warnings from the GNU Make job server. + +unstage = : +stage = : +current_stage = "" + +@if gcc-bootstrap +unstage = if [ -f stage_last ]; then [ -f stage_current ] || $(MAKE) `cat stage_last`-start || exit 1; else :; fi +stage = if [ -f stage_current ]; then $(MAKE) `cat stage_current`-end || exit 1; else :; fi +current_stage = "`cat stage_current 2> /dev/null`" +@endif gcc-bootstrap + +.PHONY: unstage stage +unstage: + @: $(MAKE); $(unstage) +stage: + @: $(MAKE); $(stage) + +# Disable commands for lean bootstrap. +LEAN = false + +# We name the build directories for the various stages "stage1-gcc", +# "stage2-gcc","stage3-gcc", etc. + +# Since the 'compare' process will fail (on debugging information) if any +# directory names are different, we need to link the gcc directory for +# the previous stage to a constant name ('prev-gcc'), and to make the name of +# the build directories constant as well. For the latter, we use naked names +# like 'gcc', because the scripts in that directory assume it. We use +# mv on platforms where symlinks to directories do not work or are not +# reliable. + +# 'touch' doesn't work right on some platforms. +STAMP = echo timestamp > + +# We only want to compare .o files, so set this! +objext = .o + + +.PHONY: stage1-start stage1-end + +stage1-start:: + @: $(MAKE); $(stage); \ + echo stage1 > stage_current ; \ + echo stage1 > stage_last; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) +@if bfd + @cd $(HOST_SUBDIR); [ -d stage1-bfd ] || \ + mkdir stage1-bfd; \ + mv stage1-bfd bfd +@endif bfd +@if opcodes + @cd $(HOST_SUBDIR); [ -d stage1-opcodes ] || \ + mkdir stage1-opcodes; \ + mv stage1-opcodes opcodes +@endif opcodes +@if binutils + @cd $(HOST_SUBDIR); [ -d stage1-binutils ] || \ + mkdir stage1-binutils; \ + mv stage1-binutils binutils +@endif binutils +@if gas + @cd $(HOST_SUBDIR); [ -d stage1-gas ] || \ + mkdir stage1-gas; \ + mv stage1-gas gas +@endif gas +@if gcc + @cd $(HOST_SUBDIR); [ -d stage1-gcc ] || \ + mkdir stage1-gcc; \ + mv stage1-gcc gcc +@endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stage1-gmp ] || \ + mkdir stage1-gmp; \ + mv stage1-gmp gmp +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stage1-mpfr ] || \ + mkdir stage1-mpfr; \ + mv stage1-mpfr mpfr +@endif mpfr +@if mpc + @cd $(HOST_SUBDIR); [ -d stage1-mpc ] || \ + mkdir stage1-mpc; \ + mv stage1-mpc mpc +@endif mpc +@if ppl + @cd $(HOST_SUBDIR); [ -d stage1-ppl ] || \ + mkdir stage1-ppl; \ + mv stage1-ppl ppl +@endif ppl +@if cloog + @cd $(HOST_SUBDIR); [ -d stage1-cloog ] || \ + mkdir stage1-cloog; \ + mv stage1-cloog cloog +@endif cloog +@if libelf + @cd $(HOST_SUBDIR); [ -d stage1-libelf ] || \ + mkdir stage1-libelf; \ + mv stage1-libelf libelf +@endif libelf +@if gold + @cd $(HOST_SUBDIR); [ -d stage1-gold ] || \ + mkdir stage1-gold; \ + mv stage1-gold gold +@endif gold +@if intl + @cd $(HOST_SUBDIR); [ -d stage1-intl ] || \ + mkdir stage1-intl; \ + mv stage1-intl intl +@endif intl +@if ld + @cd $(HOST_SUBDIR); [ -d stage1-ld ] || \ + mkdir stage1-ld; \ + mv stage1-ld ld +@endif ld +@if libcpp + @cd $(HOST_SUBDIR); [ -d stage1-libcpp ] || \ + mkdir stage1-libcpp; \ + mv stage1-libcpp libcpp +@endif libcpp +@if libdecnumber + @cd $(HOST_SUBDIR); [ -d stage1-libdecnumber ] || \ + mkdir stage1-libdecnumber; \ + mv stage1-libdecnumber libdecnumber +@endif libdecnumber +@if libiberty + @cd $(HOST_SUBDIR); [ -d stage1-libiberty ] || \ + mkdir stage1-libiberty; \ + mv stage1-libiberty libiberty +@endif libiberty +@if zlib + @cd $(HOST_SUBDIR); [ -d stage1-zlib ] || \ + mkdir stage1-zlib; \ + mv stage1-zlib zlib +@endif zlib +@if lto-plugin + @cd $(HOST_SUBDIR); [ -d stage1-lto-plugin ] || \ + mkdir stage1-lto-plugin; \ + mv stage1-lto-plugin lto-plugin +@endif lto-plugin + @[ -d stage1-$(TARGET_SUBDIR) ] || \ + mkdir stage1-$(TARGET_SUBDIR); \ + mv stage1-$(TARGET_SUBDIR) $(TARGET_SUBDIR) + +stage1-end:: +@if bfd + @if test -d $(HOST_SUBDIR)/bfd ; then \ + cd $(HOST_SUBDIR); mv bfd stage1-bfd ; \ + fi +@endif bfd +@if opcodes + @if test -d $(HOST_SUBDIR)/opcodes ; then \ + cd $(HOST_SUBDIR); mv opcodes stage1-opcodes ; \ + fi +@endif opcodes +@if binutils + @if test -d $(HOST_SUBDIR)/binutils ; then \ + cd $(HOST_SUBDIR); mv binutils stage1-binutils ; \ + fi +@endif binutils +@if gas + @if test -d $(HOST_SUBDIR)/gas ; then \ + cd $(HOST_SUBDIR); mv gas stage1-gas ; \ + fi +@endif gas +@if gcc + @if test -d $(HOST_SUBDIR)/gcc ; then \ + cd $(HOST_SUBDIR); mv gcc stage1-gcc ; \ + fi +@endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stage1-gmp ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stage1-mpfr ; \ + fi +@endif mpfr +@if mpc + @if test -d $(HOST_SUBDIR)/mpc ; then \ + cd $(HOST_SUBDIR); mv mpc stage1-mpc ; \ + fi +@endif mpc +@if ppl + @if test -d $(HOST_SUBDIR)/ppl ; then \ + cd $(HOST_SUBDIR); mv ppl stage1-ppl ; \ + fi +@endif ppl +@if cloog + @if test -d $(HOST_SUBDIR)/cloog ; then \ + cd $(HOST_SUBDIR); mv cloog stage1-cloog ; \ + fi +@endif cloog +@if libelf + @if test -d $(HOST_SUBDIR)/libelf ; then \ + cd $(HOST_SUBDIR); mv libelf stage1-libelf ; \ + fi +@endif libelf +@if gold + @if test -d $(HOST_SUBDIR)/gold ; then \ + cd $(HOST_SUBDIR); mv gold stage1-gold ; \ + fi +@endif gold +@if intl + @if test -d $(HOST_SUBDIR)/intl ; then \ + cd $(HOST_SUBDIR); mv intl stage1-intl ; \ + fi +@endif intl +@if ld + @if test -d $(HOST_SUBDIR)/ld ; then \ + cd $(HOST_SUBDIR); mv ld stage1-ld ; \ + fi +@endif ld +@if libcpp + @if test -d $(HOST_SUBDIR)/libcpp ; then \ + cd $(HOST_SUBDIR); mv libcpp stage1-libcpp ; \ + fi +@endif libcpp +@if libdecnumber + @if test -d $(HOST_SUBDIR)/libdecnumber ; then \ + cd $(HOST_SUBDIR); mv libdecnumber stage1-libdecnumber ; \ + fi +@endif libdecnumber +@if libiberty + @if test -d $(HOST_SUBDIR)/libiberty ; then \ + cd $(HOST_SUBDIR); mv libiberty stage1-libiberty ; \ + fi +@endif libiberty +@if zlib + @if test -d $(HOST_SUBDIR)/zlib ; then \ + cd $(HOST_SUBDIR); mv zlib stage1-zlib ; \ + fi +@endif zlib +@if lto-plugin + @if test -d $(HOST_SUBDIR)/lto-plugin ; then \ + cd $(HOST_SUBDIR); mv lto-plugin stage1-lto-plugin ; \ + fi +@endif lto-plugin + @if test -d $(TARGET_SUBDIR) ; then \ + mv $(TARGET_SUBDIR) stage1-$(TARGET_SUBDIR) ; \ + fi + rm -f stage_current + +# Bubble a bug fix through all the stages up to stage 1. They are +# remade, but not reconfigured. The next stage (if any) will not be +# reconfigured either. +.PHONY: stage1-bubble +stage1-bubble:: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + if test -f stage1-lean ; then \ + echo Skipping rebuild of stage1 ; \ + else \ + $(MAKE) stage1-start; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage1; \ + fi + +.PHONY: all-stage1 clean-stage1 +do-clean: clean-stage1 + +# FIXME: Will not need to be conditional when toplevel bootstrap is the +# only possibility, but now it conflicts with no-bootstrap rules +@if gcc-bootstrap + + + + +# Rules to wipe a stage and all the following ones, also used for cleanstrap + +.PHONY: distclean-stage1 +distclean-stage1:: + @: $(MAKE); $(stage) + @test "`cat stage_last`" != stage1 || rm -f stage_last + rm -rf stage1-* + + +@endif gcc-bootstrap + + +.PHONY: stage2-start stage2-end + +stage2-start:: + @: $(MAKE); $(stage); \ + echo stage2 > stage_current ; \ + echo stage2 > stage_last; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) +@if bfd + @cd $(HOST_SUBDIR); [ -d stage2-bfd ] || \ + mkdir stage2-bfd; \ + mv stage2-bfd bfd ; \ + mv stage1-bfd prev-bfd || test -f stage1-lean +@endif bfd +@if opcodes + @cd $(HOST_SUBDIR); [ -d stage2-opcodes ] || \ + mkdir stage2-opcodes; \ + mv stage2-opcodes opcodes ; \ + mv stage1-opcodes prev-opcodes || test -f stage1-lean +@endif opcodes +@if binutils + @cd $(HOST_SUBDIR); [ -d stage2-binutils ] || \ + mkdir stage2-binutils; \ + mv stage2-binutils binutils ; \ + mv stage1-binutils prev-binutils || test -f stage1-lean +@endif binutils +@if gas + @cd $(HOST_SUBDIR); [ -d stage2-gas ] || \ + mkdir stage2-gas; \ + mv stage2-gas gas ; \ + mv stage1-gas prev-gas || test -f stage1-lean +@endif gas +@if gcc + @cd $(HOST_SUBDIR); [ -d stage2-gcc ] || \ + mkdir stage2-gcc; \ + mv stage2-gcc gcc ; \ + mv stage1-gcc prev-gcc || test -f stage1-lean +@endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stage2-gmp ] || \ + mkdir stage2-gmp; \ + mv stage2-gmp gmp ; \ + mv stage1-gmp prev-gmp || test -f stage1-lean +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stage2-mpfr ] || \ + mkdir stage2-mpfr; \ + mv stage2-mpfr mpfr ; \ + mv stage1-mpfr prev-mpfr || test -f stage1-lean +@endif mpfr +@if mpc + @cd $(HOST_SUBDIR); [ -d stage2-mpc ] || \ + mkdir stage2-mpc; \ + mv stage2-mpc mpc ; \ + mv stage1-mpc prev-mpc || test -f stage1-lean +@endif mpc +@if ppl + @cd $(HOST_SUBDIR); [ -d stage2-ppl ] || \ + mkdir stage2-ppl; \ + mv stage2-ppl ppl ; \ + mv stage1-ppl prev-ppl || test -f stage1-lean +@endif ppl +@if cloog + @cd $(HOST_SUBDIR); [ -d stage2-cloog ] || \ + mkdir stage2-cloog; \ + mv stage2-cloog cloog ; \ + mv stage1-cloog prev-cloog || test -f stage1-lean +@endif cloog +@if libelf + @cd $(HOST_SUBDIR); [ -d stage2-libelf ] || \ + mkdir stage2-libelf; \ + mv stage2-libelf libelf ; \ + mv stage1-libelf prev-libelf || test -f stage1-lean +@endif libelf +@if gold + @cd $(HOST_SUBDIR); [ -d stage2-gold ] || \ + mkdir stage2-gold; \ + mv stage2-gold gold ; \ + mv stage1-gold prev-gold || test -f stage1-lean +@endif gold +@if intl + @cd $(HOST_SUBDIR); [ -d stage2-intl ] || \ + mkdir stage2-intl; \ + mv stage2-intl intl ; \ + mv stage1-intl prev-intl || test -f stage1-lean +@endif intl +@if ld + @cd $(HOST_SUBDIR); [ -d stage2-ld ] || \ + mkdir stage2-ld; \ + mv stage2-ld ld ; \ + mv stage1-ld prev-ld || test -f stage1-lean +@endif ld +@if libcpp + @cd $(HOST_SUBDIR); [ -d stage2-libcpp ] || \ + mkdir stage2-libcpp; \ + mv stage2-libcpp libcpp ; \ + mv stage1-libcpp prev-libcpp || test -f stage1-lean +@endif libcpp +@if libdecnumber + @cd $(HOST_SUBDIR); [ -d stage2-libdecnumber ] || \ + mkdir stage2-libdecnumber; \ + mv stage2-libdecnumber libdecnumber ; \ + mv stage1-libdecnumber prev-libdecnumber || test -f stage1-lean +@endif libdecnumber +@if libiberty + @cd $(HOST_SUBDIR); [ -d stage2-libiberty ] || \ + mkdir stage2-libiberty; \ + mv stage2-libiberty libiberty ; \ + mv stage1-libiberty prev-libiberty || test -f stage1-lean +@endif libiberty +@if zlib + @cd $(HOST_SUBDIR); [ -d stage2-zlib ] || \ + mkdir stage2-zlib; \ + mv stage2-zlib zlib ; \ + mv stage1-zlib prev-zlib || test -f stage1-lean +@endif zlib +@if lto-plugin + @cd $(HOST_SUBDIR); [ -d stage2-lto-plugin ] || \ + mkdir stage2-lto-plugin; \ + mv stage2-lto-plugin lto-plugin ; \ + mv stage1-lto-plugin prev-lto-plugin || test -f stage1-lean +@endif lto-plugin + @[ -d stage2-$(TARGET_SUBDIR) ] || \ + mkdir stage2-$(TARGET_SUBDIR); \ + mv stage2-$(TARGET_SUBDIR) $(TARGET_SUBDIR) ; \ + mv stage1-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stage1-lean + +stage2-end:: +@if bfd + @if test -d $(HOST_SUBDIR)/bfd ; then \ + cd $(HOST_SUBDIR); mv bfd stage2-bfd ; \ + mv prev-bfd stage1-bfd ; : ; \ + fi +@endif bfd +@if opcodes + @if test -d $(HOST_SUBDIR)/opcodes ; then \ + cd $(HOST_SUBDIR); mv opcodes stage2-opcodes ; \ + mv prev-opcodes stage1-opcodes ; : ; \ + fi +@endif opcodes +@if binutils + @if test -d $(HOST_SUBDIR)/binutils ; then \ + cd $(HOST_SUBDIR); mv binutils stage2-binutils ; \ + mv prev-binutils stage1-binutils ; : ; \ + fi +@endif binutils +@if gas + @if test -d $(HOST_SUBDIR)/gas ; then \ + cd $(HOST_SUBDIR); mv gas stage2-gas ; \ + mv prev-gas stage1-gas ; : ; \ + fi +@endif gas +@if gcc + @if test -d $(HOST_SUBDIR)/gcc ; then \ + cd $(HOST_SUBDIR); mv gcc stage2-gcc ; \ + mv prev-gcc stage1-gcc ; : ; \ + fi +@endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stage2-gmp ; \ + mv prev-gmp stage1-gmp ; : ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stage2-mpfr ; \ + mv prev-mpfr stage1-mpfr ; : ; \ + fi +@endif mpfr +@if mpc + @if test -d $(HOST_SUBDIR)/mpc ; then \ + cd $(HOST_SUBDIR); mv mpc stage2-mpc ; \ + mv prev-mpc stage1-mpc ; : ; \ + fi +@endif mpc +@if ppl + @if test -d $(HOST_SUBDIR)/ppl ; then \ + cd $(HOST_SUBDIR); mv ppl stage2-ppl ; \ + mv prev-ppl stage1-ppl ; : ; \ + fi +@endif ppl +@if cloog + @if test -d $(HOST_SUBDIR)/cloog ; then \ + cd $(HOST_SUBDIR); mv cloog stage2-cloog ; \ + mv prev-cloog stage1-cloog ; : ; \ + fi +@endif cloog +@if libelf + @if test -d $(HOST_SUBDIR)/libelf ; then \ + cd $(HOST_SUBDIR); mv libelf stage2-libelf ; \ + mv prev-libelf stage1-libelf ; : ; \ + fi +@endif libelf +@if gold + @if test -d $(HOST_SUBDIR)/gold ; then \ + cd $(HOST_SUBDIR); mv gold stage2-gold ; \ + mv prev-gold stage1-gold ; : ; \ + fi +@endif gold +@if intl + @if test -d $(HOST_SUBDIR)/intl ; then \ + cd $(HOST_SUBDIR); mv intl stage2-intl ; \ + mv prev-intl stage1-intl ; : ; \ + fi +@endif intl +@if ld + @if test -d $(HOST_SUBDIR)/ld ; then \ + cd $(HOST_SUBDIR); mv ld stage2-ld ; \ + mv prev-ld stage1-ld ; : ; \ + fi +@endif ld +@if libcpp + @if test -d $(HOST_SUBDIR)/libcpp ; then \ + cd $(HOST_SUBDIR); mv libcpp stage2-libcpp ; \ + mv prev-libcpp stage1-libcpp ; : ; \ + fi +@endif libcpp +@if libdecnumber + @if test -d $(HOST_SUBDIR)/libdecnumber ; then \ + cd $(HOST_SUBDIR); mv libdecnumber stage2-libdecnumber ; \ + mv prev-libdecnumber stage1-libdecnumber ; : ; \ + fi +@endif libdecnumber +@if libiberty + @if test -d $(HOST_SUBDIR)/libiberty ; then \ + cd $(HOST_SUBDIR); mv libiberty stage2-libiberty ; \ + mv prev-libiberty stage1-libiberty ; : ; \ + fi +@endif libiberty +@if zlib + @if test -d $(HOST_SUBDIR)/zlib ; then \ + cd $(HOST_SUBDIR); mv zlib stage2-zlib ; \ + mv prev-zlib stage1-zlib ; : ; \ + fi +@endif zlib +@if lto-plugin + @if test -d $(HOST_SUBDIR)/lto-plugin ; then \ + cd $(HOST_SUBDIR); mv lto-plugin stage2-lto-plugin ; \ + mv prev-lto-plugin stage1-lto-plugin ; : ; \ + fi +@endif lto-plugin + @if test -d $(TARGET_SUBDIR) ; then \ + mv $(TARGET_SUBDIR) stage2-$(TARGET_SUBDIR) ; \ + mv prev-$(TARGET_SUBDIR) stage1-$(TARGET_SUBDIR) ; : ; \ + fi + rm -f stage_current + +# Bubble a bug fix through all the stages up to stage 2. They are +# remade, but not reconfigured. The next stage (if any) will not be +# reconfigured either. +.PHONY: stage2-bubble +stage2-bubble:: stage1-bubble + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + if test -f stage2-lean || test -f stage1-lean ; then \ + echo Skipping rebuild of stage2 ; \ + else \ + $(MAKE) stage2-start; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage2; \ + fi + +.PHONY: all-stage2 clean-stage2 +do-clean: clean-stage2 + +# FIXME: Will not need to be conditional when toplevel bootstrap is the +# only possibility, but now it conflicts with no-bootstrap rules +@if gcc-bootstrap + + + +.PHONY: bootstrap2 bootstrap2-lean +bootstrap2: + echo stage2 > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage2-bubble + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target + +bootstrap2-lean: + echo stage2 > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) LEAN=: stage2-bubble + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE2_TFLAGS)"; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target + + +# Rules to wipe a stage and all the following ones, also used for cleanstrap +distclean-stage1:: distclean-stage2 +.PHONY: distclean-stage2 +distclean-stage2:: + @: $(MAKE); $(stage) + @test "`cat stage_last`" != stage2 || rm -f stage_last + rm -rf stage2-* + + +@endif gcc-bootstrap + + +.PHONY: stage3-start stage3-end + +stage3-start:: + @: $(MAKE); $(stage); \ + echo stage3 > stage_current ; \ + echo stage3 > stage_last; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) +@if bfd + @cd $(HOST_SUBDIR); [ -d stage3-bfd ] || \ + mkdir stage3-bfd; \ + mv stage3-bfd bfd ; \ + mv stage2-bfd prev-bfd || test -f stage2-lean +@endif bfd +@if opcodes + @cd $(HOST_SUBDIR); [ -d stage3-opcodes ] || \ + mkdir stage3-opcodes; \ + mv stage3-opcodes opcodes ; \ + mv stage2-opcodes prev-opcodes || test -f stage2-lean +@endif opcodes +@if binutils + @cd $(HOST_SUBDIR); [ -d stage3-binutils ] || \ + mkdir stage3-binutils; \ + mv stage3-binutils binutils ; \ + mv stage2-binutils prev-binutils || test -f stage2-lean +@endif binutils +@if gas + @cd $(HOST_SUBDIR); [ -d stage3-gas ] || \ + mkdir stage3-gas; \ + mv stage3-gas gas ; \ + mv stage2-gas prev-gas || test -f stage2-lean +@endif gas +@if gcc + @cd $(HOST_SUBDIR); [ -d stage3-gcc ] || \ + mkdir stage3-gcc; \ + mv stage3-gcc gcc ; \ + mv stage2-gcc prev-gcc || test -f stage2-lean +@endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stage3-gmp ] || \ + mkdir stage3-gmp; \ + mv stage3-gmp gmp ; \ + mv stage2-gmp prev-gmp || test -f stage2-lean +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stage3-mpfr ] || \ + mkdir stage3-mpfr; \ + mv stage3-mpfr mpfr ; \ + mv stage2-mpfr prev-mpfr || test -f stage2-lean +@endif mpfr +@if mpc + @cd $(HOST_SUBDIR); [ -d stage3-mpc ] || \ + mkdir stage3-mpc; \ + mv stage3-mpc mpc ; \ + mv stage2-mpc prev-mpc || test -f stage2-lean +@endif mpc +@if ppl + @cd $(HOST_SUBDIR); [ -d stage3-ppl ] || \ + mkdir stage3-ppl; \ + mv stage3-ppl ppl ; \ + mv stage2-ppl prev-ppl || test -f stage2-lean +@endif ppl +@if cloog + @cd $(HOST_SUBDIR); [ -d stage3-cloog ] || \ + mkdir stage3-cloog; \ + mv stage3-cloog cloog ; \ + mv stage2-cloog prev-cloog || test -f stage2-lean +@endif cloog +@if libelf + @cd $(HOST_SUBDIR); [ -d stage3-libelf ] || \ + mkdir stage3-libelf; \ + mv stage3-libelf libelf ; \ + mv stage2-libelf prev-libelf || test -f stage2-lean +@endif libelf +@if gold + @cd $(HOST_SUBDIR); [ -d stage3-gold ] || \ + mkdir stage3-gold; \ + mv stage3-gold gold ; \ + mv stage2-gold prev-gold || test -f stage2-lean +@endif gold +@if intl + @cd $(HOST_SUBDIR); [ -d stage3-intl ] || \ + mkdir stage3-intl; \ + mv stage3-intl intl ; \ + mv stage2-intl prev-intl || test -f stage2-lean +@endif intl +@if ld + @cd $(HOST_SUBDIR); [ -d stage3-ld ] || \ + mkdir stage3-ld; \ + mv stage3-ld ld ; \ + mv stage2-ld prev-ld || test -f stage2-lean +@endif ld +@if libcpp + @cd $(HOST_SUBDIR); [ -d stage3-libcpp ] || \ + mkdir stage3-libcpp; \ + mv stage3-libcpp libcpp ; \ + mv stage2-libcpp prev-libcpp || test -f stage2-lean +@endif libcpp +@if libdecnumber + @cd $(HOST_SUBDIR); [ -d stage3-libdecnumber ] || \ + mkdir stage3-libdecnumber; \ + mv stage3-libdecnumber libdecnumber ; \ + mv stage2-libdecnumber prev-libdecnumber || test -f stage2-lean +@endif libdecnumber +@if libiberty + @cd $(HOST_SUBDIR); [ -d stage3-libiberty ] || \ + mkdir stage3-libiberty; \ + mv stage3-libiberty libiberty ; \ + mv stage2-libiberty prev-libiberty || test -f stage2-lean +@endif libiberty +@if zlib + @cd $(HOST_SUBDIR); [ -d stage3-zlib ] || \ + mkdir stage3-zlib; \ + mv stage3-zlib zlib ; \ + mv stage2-zlib prev-zlib || test -f stage2-lean +@endif zlib +@if lto-plugin + @cd $(HOST_SUBDIR); [ -d stage3-lto-plugin ] || \ + mkdir stage3-lto-plugin; \ + mv stage3-lto-plugin lto-plugin ; \ + mv stage2-lto-plugin prev-lto-plugin || test -f stage2-lean +@endif lto-plugin + @[ -d stage3-$(TARGET_SUBDIR) ] || \ + mkdir stage3-$(TARGET_SUBDIR); \ + mv stage3-$(TARGET_SUBDIR) $(TARGET_SUBDIR) ; \ + mv stage2-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stage2-lean + +stage3-end:: +@if bfd + @if test -d $(HOST_SUBDIR)/bfd ; then \ + cd $(HOST_SUBDIR); mv bfd stage3-bfd ; \ + mv prev-bfd stage2-bfd ; : ; \ + fi +@endif bfd +@if opcodes + @if test -d $(HOST_SUBDIR)/opcodes ; then \ + cd $(HOST_SUBDIR); mv opcodes stage3-opcodes ; \ + mv prev-opcodes stage2-opcodes ; : ; \ + fi +@endif opcodes +@if binutils + @if test -d $(HOST_SUBDIR)/binutils ; then \ + cd $(HOST_SUBDIR); mv binutils stage3-binutils ; \ + mv prev-binutils stage2-binutils ; : ; \ + fi +@endif binutils +@if gas + @if test -d $(HOST_SUBDIR)/gas ; then \ + cd $(HOST_SUBDIR); mv gas stage3-gas ; \ + mv prev-gas stage2-gas ; : ; \ + fi +@endif gas +@if gcc + @if test -d $(HOST_SUBDIR)/gcc ; then \ + cd $(HOST_SUBDIR); mv gcc stage3-gcc ; \ + mv prev-gcc stage2-gcc ; : ; \ + fi +@endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stage3-gmp ; \ + mv prev-gmp stage2-gmp ; : ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stage3-mpfr ; \ + mv prev-mpfr stage2-mpfr ; : ; \ + fi +@endif mpfr +@if mpc + @if test -d $(HOST_SUBDIR)/mpc ; then \ + cd $(HOST_SUBDIR); mv mpc stage3-mpc ; \ + mv prev-mpc stage2-mpc ; : ; \ + fi +@endif mpc +@if ppl + @if test -d $(HOST_SUBDIR)/ppl ; then \ + cd $(HOST_SUBDIR); mv ppl stage3-ppl ; \ + mv prev-ppl stage2-ppl ; : ; \ + fi +@endif ppl +@if cloog + @if test -d $(HOST_SUBDIR)/cloog ; then \ + cd $(HOST_SUBDIR); mv cloog stage3-cloog ; \ + mv prev-cloog stage2-cloog ; : ; \ + fi +@endif cloog +@if libelf + @if test -d $(HOST_SUBDIR)/libelf ; then \ + cd $(HOST_SUBDIR); mv libelf stage3-libelf ; \ + mv prev-libelf stage2-libelf ; : ; \ + fi +@endif libelf +@if gold + @if test -d $(HOST_SUBDIR)/gold ; then \ + cd $(HOST_SUBDIR); mv gold stage3-gold ; \ + mv prev-gold stage2-gold ; : ; \ + fi +@endif gold +@if intl + @if test -d $(HOST_SUBDIR)/intl ; then \ + cd $(HOST_SUBDIR); mv intl stage3-intl ; \ + mv prev-intl stage2-intl ; : ; \ + fi +@endif intl +@if ld + @if test -d $(HOST_SUBDIR)/ld ; then \ + cd $(HOST_SUBDIR); mv ld stage3-ld ; \ + mv prev-ld stage2-ld ; : ; \ + fi +@endif ld +@if libcpp + @if test -d $(HOST_SUBDIR)/libcpp ; then \ + cd $(HOST_SUBDIR); mv libcpp stage3-libcpp ; \ + mv prev-libcpp stage2-libcpp ; : ; \ + fi +@endif libcpp +@if libdecnumber + @if test -d $(HOST_SUBDIR)/libdecnumber ; then \ + cd $(HOST_SUBDIR); mv libdecnumber stage3-libdecnumber ; \ + mv prev-libdecnumber stage2-libdecnumber ; : ; \ + fi +@endif libdecnumber +@if libiberty + @if test -d $(HOST_SUBDIR)/libiberty ; then \ + cd $(HOST_SUBDIR); mv libiberty stage3-libiberty ; \ + mv prev-libiberty stage2-libiberty ; : ; \ + fi +@endif libiberty +@if zlib + @if test -d $(HOST_SUBDIR)/zlib ; then \ + cd $(HOST_SUBDIR); mv zlib stage3-zlib ; \ + mv prev-zlib stage2-zlib ; : ; \ + fi +@endif zlib +@if lto-plugin + @if test -d $(HOST_SUBDIR)/lto-plugin ; then \ + cd $(HOST_SUBDIR); mv lto-plugin stage3-lto-plugin ; \ + mv prev-lto-plugin stage2-lto-plugin ; : ; \ + fi +@endif lto-plugin + @if test -d $(TARGET_SUBDIR) ; then \ + mv $(TARGET_SUBDIR) stage3-$(TARGET_SUBDIR) ; \ + mv prev-$(TARGET_SUBDIR) stage2-$(TARGET_SUBDIR) ; : ; \ + fi + rm -f stage_current + +# Bubble a bug fix through all the stages up to stage 3. They are +# remade, but not reconfigured. The next stage (if any) will not be +# reconfigured either. +.PHONY: stage3-bubble +stage3-bubble:: stage2-bubble + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + if test -f stage3-lean || test -f stage2-lean ; then \ + echo Skipping rebuild of stage3 ; \ + else \ + $(MAKE) stage3-start; \ + if $(LEAN); then \ + rm -rf stage1-* ; \ + $(STAMP) stage1-lean ; \ + fi; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage3; \ + fi + $(MAKE) $(RECURSE_FLAGS_TO_PASS) compare + +.PHONY: all-stage3 clean-stage3 +do-clean: clean-stage3 + +# FIXME: Will not need to be conditional when toplevel bootstrap is the +# only possibility, but now it conflicts with no-bootstrap rules +@if gcc-bootstrap + +compare: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + if test -f stage2-lean; then \ + echo Cannot compare object files as stage 2 was deleted. ; \ + exit 0 ; \ + fi; \ + : $(MAKE); $(stage); \ + rm -f .bad_compare ; \ + echo Comparing stages 2 and 3 ; \ + sed=`echo stage3 | sed 's,^stage,,;s,.,.,g'`; \ + files=`find stage3-* -name "*$(objext)" -print | \ + sed -n s,^stage$$sed-,,p` ; \ + for file in $${files} ; do \ + f1=$$r/stage2-$$file; f2=$$r/stage3-$$file; \ + if test ! -f $$f1; then continue; fi; \ + $(do-compare) > /dev/null 2>&1; \ + if test $$? -eq 1; then \ + case $$file in \ + @compare_exclusions@) \ + echo warning: $$file differs ;; \ + *) \ + echo $$file differs >> .bad_compare ;; \ + esac ; \ + fi ; \ + done ; \ + if [ -f .bad_compare ]; then \ + echo "Bootstrap comparison failure!"; \ + cat .bad_compare; \ + exit 1; \ + else \ + echo Comparison successful.; \ + fi ; \ + $(STAMP) compare + if $(LEAN); then \ + rm -rf stage2-*; \ + $(STAMP) stage2-lean; \ + fi + + + +.PHONY: bootstrap bootstrap-lean +bootstrap: + echo stage3 > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage3-bubble + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target + +bootstrap-lean: + echo stage3 > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) LEAN=: stage3-bubble + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target + + +# Rules to wipe a stage and all the following ones, also used for cleanstrap +distclean-stage2:: distclean-stage3 +.PHONY: distclean-stage3 +distclean-stage3:: + @: $(MAKE); $(stage) + @test "`cat stage_last`" != stage3 || rm -f stage_last + rm -rf stage3-* compare + + +.PHONY: cleanstrap +cleanstrap: do-distclean local-clean + echo stage3 > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage3-bubble + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE3_TFLAGS)"; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target + +@endif gcc-bootstrap + + +.PHONY: stage4-start stage4-end + +stage4-start:: + @: $(MAKE); $(stage); \ + echo stage4 > stage_current ; \ + echo stage4 > stage_last; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) +@if bfd + @cd $(HOST_SUBDIR); [ -d stage4-bfd ] || \ + mkdir stage4-bfd; \ + mv stage4-bfd bfd ; \ + mv stage3-bfd prev-bfd || test -f stage3-lean +@endif bfd +@if opcodes + @cd $(HOST_SUBDIR); [ -d stage4-opcodes ] || \ + mkdir stage4-opcodes; \ + mv stage4-opcodes opcodes ; \ + mv stage3-opcodes prev-opcodes || test -f stage3-lean +@endif opcodes +@if binutils + @cd $(HOST_SUBDIR); [ -d stage4-binutils ] || \ + mkdir stage4-binutils; \ + mv stage4-binutils binutils ; \ + mv stage3-binutils prev-binutils || test -f stage3-lean +@endif binutils +@if gas + @cd $(HOST_SUBDIR); [ -d stage4-gas ] || \ + mkdir stage4-gas; \ + mv stage4-gas gas ; \ + mv stage3-gas prev-gas || test -f stage3-lean +@endif gas +@if gcc + @cd $(HOST_SUBDIR); [ -d stage4-gcc ] || \ + mkdir stage4-gcc; \ + mv stage4-gcc gcc ; \ + mv stage3-gcc prev-gcc || test -f stage3-lean +@endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stage4-gmp ] || \ + mkdir stage4-gmp; \ + mv stage4-gmp gmp ; \ + mv stage3-gmp prev-gmp || test -f stage3-lean +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stage4-mpfr ] || \ + mkdir stage4-mpfr; \ + mv stage4-mpfr mpfr ; \ + mv stage3-mpfr prev-mpfr || test -f stage3-lean +@endif mpfr +@if mpc + @cd $(HOST_SUBDIR); [ -d stage4-mpc ] || \ + mkdir stage4-mpc; \ + mv stage4-mpc mpc ; \ + mv stage3-mpc prev-mpc || test -f stage3-lean +@endif mpc +@if ppl + @cd $(HOST_SUBDIR); [ -d stage4-ppl ] || \ + mkdir stage4-ppl; \ + mv stage4-ppl ppl ; \ + mv stage3-ppl prev-ppl || test -f stage3-lean +@endif ppl +@if cloog + @cd $(HOST_SUBDIR); [ -d stage4-cloog ] || \ + mkdir stage4-cloog; \ + mv stage4-cloog cloog ; \ + mv stage3-cloog prev-cloog || test -f stage3-lean +@endif cloog +@if libelf + @cd $(HOST_SUBDIR); [ -d stage4-libelf ] || \ + mkdir stage4-libelf; \ + mv stage4-libelf libelf ; \ + mv stage3-libelf prev-libelf || test -f stage3-lean +@endif libelf +@if gold + @cd $(HOST_SUBDIR); [ -d stage4-gold ] || \ + mkdir stage4-gold; \ + mv stage4-gold gold ; \ + mv stage3-gold prev-gold || test -f stage3-lean +@endif gold +@if intl + @cd $(HOST_SUBDIR); [ -d stage4-intl ] || \ + mkdir stage4-intl; \ + mv stage4-intl intl ; \ + mv stage3-intl prev-intl || test -f stage3-lean +@endif intl +@if ld + @cd $(HOST_SUBDIR); [ -d stage4-ld ] || \ + mkdir stage4-ld; \ + mv stage4-ld ld ; \ + mv stage3-ld prev-ld || test -f stage3-lean +@endif ld +@if libcpp + @cd $(HOST_SUBDIR); [ -d stage4-libcpp ] || \ + mkdir stage4-libcpp; \ + mv stage4-libcpp libcpp ; \ + mv stage3-libcpp prev-libcpp || test -f stage3-lean +@endif libcpp +@if libdecnumber + @cd $(HOST_SUBDIR); [ -d stage4-libdecnumber ] || \ + mkdir stage4-libdecnumber; \ + mv stage4-libdecnumber libdecnumber ; \ + mv stage3-libdecnumber prev-libdecnumber || test -f stage3-lean +@endif libdecnumber +@if libiberty + @cd $(HOST_SUBDIR); [ -d stage4-libiberty ] || \ + mkdir stage4-libiberty; \ + mv stage4-libiberty libiberty ; \ + mv stage3-libiberty prev-libiberty || test -f stage3-lean +@endif libiberty +@if zlib + @cd $(HOST_SUBDIR); [ -d stage4-zlib ] || \ + mkdir stage4-zlib; \ + mv stage4-zlib zlib ; \ + mv stage3-zlib prev-zlib || test -f stage3-lean +@endif zlib +@if lto-plugin + @cd $(HOST_SUBDIR); [ -d stage4-lto-plugin ] || \ + mkdir stage4-lto-plugin; \ + mv stage4-lto-plugin lto-plugin ; \ + mv stage3-lto-plugin prev-lto-plugin || test -f stage3-lean +@endif lto-plugin + @[ -d stage4-$(TARGET_SUBDIR) ] || \ + mkdir stage4-$(TARGET_SUBDIR); \ + mv stage4-$(TARGET_SUBDIR) $(TARGET_SUBDIR) ; \ + mv stage3-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stage3-lean + +stage4-end:: +@if bfd + @if test -d $(HOST_SUBDIR)/bfd ; then \ + cd $(HOST_SUBDIR); mv bfd stage4-bfd ; \ + mv prev-bfd stage3-bfd ; : ; \ + fi +@endif bfd +@if opcodes + @if test -d $(HOST_SUBDIR)/opcodes ; then \ + cd $(HOST_SUBDIR); mv opcodes stage4-opcodes ; \ + mv prev-opcodes stage3-opcodes ; : ; \ + fi +@endif opcodes +@if binutils + @if test -d $(HOST_SUBDIR)/binutils ; then \ + cd $(HOST_SUBDIR); mv binutils stage4-binutils ; \ + mv prev-binutils stage3-binutils ; : ; \ + fi +@endif binutils +@if gas + @if test -d $(HOST_SUBDIR)/gas ; then \ + cd $(HOST_SUBDIR); mv gas stage4-gas ; \ + mv prev-gas stage3-gas ; : ; \ + fi +@endif gas +@if gcc + @if test -d $(HOST_SUBDIR)/gcc ; then \ + cd $(HOST_SUBDIR); mv gcc stage4-gcc ; \ + mv prev-gcc stage3-gcc ; : ; \ + fi +@endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stage4-gmp ; \ + mv prev-gmp stage3-gmp ; : ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stage4-mpfr ; \ + mv prev-mpfr stage3-mpfr ; : ; \ + fi +@endif mpfr +@if mpc + @if test -d $(HOST_SUBDIR)/mpc ; then \ + cd $(HOST_SUBDIR); mv mpc stage4-mpc ; \ + mv prev-mpc stage3-mpc ; : ; \ + fi +@endif mpc +@if ppl + @if test -d $(HOST_SUBDIR)/ppl ; then \ + cd $(HOST_SUBDIR); mv ppl stage4-ppl ; \ + mv prev-ppl stage3-ppl ; : ; \ + fi +@endif ppl +@if cloog + @if test -d $(HOST_SUBDIR)/cloog ; then \ + cd $(HOST_SUBDIR); mv cloog stage4-cloog ; \ + mv prev-cloog stage3-cloog ; : ; \ + fi +@endif cloog +@if libelf + @if test -d $(HOST_SUBDIR)/libelf ; then \ + cd $(HOST_SUBDIR); mv libelf stage4-libelf ; \ + mv prev-libelf stage3-libelf ; : ; \ + fi +@endif libelf +@if gold + @if test -d $(HOST_SUBDIR)/gold ; then \ + cd $(HOST_SUBDIR); mv gold stage4-gold ; \ + mv prev-gold stage3-gold ; : ; \ + fi +@endif gold +@if intl + @if test -d $(HOST_SUBDIR)/intl ; then \ + cd $(HOST_SUBDIR); mv intl stage4-intl ; \ + mv prev-intl stage3-intl ; : ; \ + fi +@endif intl +@if ld + @if test -d $(HOST_SUBDIR)/ld ; then \ + cd $(HOST_SUBDIR); mv ld stage4-ld ; \ + mv prev-ld stage3-ld ; : ; \ + fi +@endif ld +@if libcpp + @if test -d $(HOST_SUBDIR)/libcpp ; then \ + cd $(HOST_SUBDIR); mv libcpp stage4-libcpp ; \ + mv prev-libcpp stage3-libcpp ; : ; \ + fi +@endif libcpp +@if libdecnumber + @if test -d $(HOST_SUBDIR)/libdecnumber ; then \ + cd $(HOST_SUBDIR); mv libdecnumber stage4-libdecnumber ; \ + mv prev-libdecnumber stage3-libdecnumber ; : ; \ + fi +@endif libdecnumber +@if libiberty + @if test -d $(HOST_SUBDIR)/libiberty ; then \ + cd $(HOST_SUBDIR); mv libiberty stage4-libiberty ; \ + mv prev-libiberty stage3-libiberty ; : ; \ + fi +@endif libiberty +@if zlib + @if test -d $(HOST_SUBDIR)/zlib ; then \ + cd $(HOST_SUBDIR); mv zlib stage4-zlib ; \ + mv prev-zlib stage3-zlib ; : ; \ + fi +@endif zlib +@if lto-plugin + @if test -d $(HOST_SUBDIR)/lto-plugin ; then \ + cd $(HOST_SUBDIR); mv lto-plugin stage4-lto-plugin ; \ + mv prev-lto-plugin stage3-lto-plugin ; : ; \ + fi +@endif lto-plugin + @if test -d $(TARGET_SUBDIR) ; then \ + mv $(TARGET_SUBDIR) stage4-$(TARGET_SUBDIR) ; \ + mv prev-$(TARGET_SUBDIR) stage3-$(TARGET_SUBDIR) ; : ; \ + fi + rm -f stage_current + +# Bubble a bug fix through all the stages up to stage 4. They are +# remade, but not reconfigured. The next stage (if any) will not be +# reconfigured either. +.PHONY: stage4-bubble +stage4-bubble:: stage3-bubble + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + if test -f stage4-lean || test -f stage3-lean ; then \ + echo Skipping rebuild of stage4 ; \ + else \ + $(MAKE) stage4-start; \ + if $(LEAN); then \ + rm -rf stage2-* ; \ + $(STAMP) stage2-lean ; \ + fi; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage4; \ + fi + $(MAKE) $(RECURSE_FLAGS_TO_PASS) compare3 + +.PHONY: all-stage4 clean-stage4 +do-clean: clean-stage4 + +# FIXME: Will not need to be conditional when toplevel bootstrap is the +# only possibility, but now it conflicts with no-bootstrap rules +@if gcc-bootstrap + +compare3: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + if test -f stage3-lean; then \ + echo Cannot compare object files as stage 3 was deleted. ; \ + exit 0 ; \ + fi; \ + : $(MAKE); $(stage); \ + rm -f .bad_compare ; \ + echo Comparing stages 3 and 4 ; \ + sed=`echo stage4 | sed 's,^stage,,;s,.,.,g'`; \ + files=`find stage4-* -name "*$(objext)" -print | \ + sed -n s,^stage$$sed-,,p` ; \ + for file in $${files} ; do \ + f1=$$r/stage3-$$file; f2=$$r/stage4-$$file; \ + if test ! -f $$f1; then continue; fi; \ + $(do-compare3) > /dev/null 2>&1; \ + if test $$? -eq 1; then \ + case $$file in \ + @compare_exclusions@) \ + echo warning: $$file differs ;; \ + *) \ + echo $$file differs >> .bad_compare ;; \ + esac ; \ + fi ; \ + done ; \ + if [ -f .bad_compare ]; then \ + echo "Bootstrap comparison failure!"; \ + cat .bad_compare; \ + exit 1; \ + else \ + echo Comparison successful.; \ + fi ; \ + $(STAMP) compare3 + if $(LEAN); then \ + rm -rf stage3-*; \ + $(STAMP) stage3-lean; \ + fi + + + +.PHONY: bootstrap4 bootstrap4-lean +bootstrap4: + echo stage4 > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage4-bubble + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target + +bootstrap4-lean: + echo stage4 > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) LEAN=: stage4-bubble + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE4_TFLAGS)"; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target + + +# Rules to wipe a stage and all the following ones, also used for cleanstrap +distclean-stage3:: distclean-stage4 +.PHONY: distclean-stage4 +distclean-stage4:: + @: $(MAKE); $(stage) + @test "`cat stage_last`" != stage4 || rm -f stage_last + rm -rf stage4-* compare3 + + +@endif gcc-bootstrap + + +.PHONY: stageprofile-start stageprofile-end + +stageprofile-start:: + @: $(MAKE); $(stage); \ + echo stageprofile > stage_current ; \ + echo stageprofile > stage_last; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) +@if bfd + @cd $(HOST_SUBDIR); [ -d stageprofile-bfd ] || \ + mkdir stageprofile-bfd; \ + mv stageprofile-bfd bfd ; \ + mv stage1-bfd prev-bfd || test -f stage1-lean +@endif bfd +@if opcodes + @cd $(HOST_SUBDIR); [ -d stageprofile-opcodes ] || \ + mkdir stageprofile-opcodes; \ + mv stageprofile-opcodes opcodes ; \ + mv stage1-opcodes prev-opcodes || test -f stage1-lean +@endif opcodes +@if binutils + @cd $(HOST_SUBDIR); [ -d stageprofile-binutils ] || \ + mkdir stageprofile-binutils; \ + mv stageprofile-binutils binutils ; \ + mv stage1-binutils prev-binutils || test -f stage1-lean +@endif binutils +@if gas + @cd $(HOST_SUBDIR); [ -d stageprofile-gas ] || \ + mkdir stageprofile-gas; \ + mv stageprofile-gas gas ; \ + mv stage1-gas prev-gas || test -f stage1-lean +@endif gas +@if gcc + @cd $(HOST_SUBDIR); [ -d stageprofile-gcc ] || \ + mkdir stageprofile-gcc; \ + mv stageprofile-gcc gcc ; \ + mv stage1-gcc prev-gcc || test -f stage1-lean +@endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stageprofile-gmp ] || \ + mkdir stageprofile-gmp; \ + mv stageprofile-gmp gmp ; \ + mv stage1-gmp prev-gmp || test -f stage1-lean +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stageprofile-mpfr ] || \ + mkdir stageprofile-mpfr; \ + mv stageprofile-mpfr mpfr ; \ + mv stage1-mpfr prev-mpfr || test -f stage1-lean +@endif mpfr +@if mpc + @cd $(HOST_SUBDIR); [ -d stageprofile-mpc ] || \ + mkdir stageprofile-mpc; \ + mv stageprofile-mpc mpc ; \ + mv stage1-mpc prev-mpc || test -f stage1-lean +@endif mpc +@if ppl + @cd $(HOST_SUBDIR); [ -d stageprofile-ppl ] || \ + mkdir stageprofile-ppl; \ + mv stageprofile-ppl ppl ; \ + mv stage1-ppl prev-ppl || test -f stage1-lean +@endif ppl +@if cloog + @cd $(HOST_SUBDIR); [ -d stageprofile-cloog ] || \ + mkdir stageprofile-cloog; \ + mv stageprofile-cloog cloog ; \ + mv stage1-cloog prev-cloog || test -f stage1-lean +@endif cloog +@if libelf + @cd $(HOST_SUBDIR); [ -d stageprofile-libelf ] || \ + mkdir stageprofile-libelf; \ + mv stageprofile-libelf libelf ; \ + mv stage1-libelf prev-libelf || test -f stage1-lean +@endif libelf +@if gold + @cd $(HOST_SUBDIR); [ -d stageprofile-gold ] || \ + mkdir stageprofile-gold; \ + mv stageprofile-gold gold ; \ + mv stage1-gold prev-gold || test -f stage1-lean +@endif gold +@if intl + @cd $(HOST_SUBDIR); [ -d stageprofile-intl ] || \ + mkdir stageprofile-intl; \ + mv stageprofile-intl intl ; \ + mv stage1-intl prev-intl || test -f stage1-lean +@endif intl +@if ld + @cd $(HOST_SUBDIR); [ -d stageprofile-ld ] || \ + mkdir stageprofile-ld; \ + mv stageprofile-ld ld ; \ + mv stage1-ld prev-ld || test -f stage1-lean +@endif ld +@if libcpp + @cd $(HOST_SUBDIR); [ -d stageprofile-libcpp ] || \ + mkdir stageprofile-libcpp; \ + mv stageprofile-libcpp libcpp ; \ + mv stage1-libcpp prev-libcpp || test -f stage1-lean +@endif libcpp +@if libdecnumber + @cd $(HOST_SUBDIR); [ -d stageprofile-libdecnumber ] || \ + mkdir stageprofile-libdecnumber; \ + mv stageprofile-libdecnumber libdecnumber ; \ + mv stage1-libdecnumber prev-libdecnumber || test -f stage1-lean +@endif libdecnumber +@if libiberty + @cd $(HOST_SUBDIR); [ -d stageprofile-libiberty ] || \ + mkdir stageprofile-libiberty; \ + mv stageprofile-libiberty libiberty ; \ + mv stage1-libiberty prev-libiberty || test -f stage1-lean +@endif libiberty +@if zlib + @cd $(HOST_SUBDIR); [ -d stageprofile-zlib ] || \ + mkdir stageprofile-zlib; \ + mv stageprofile-zlib zlib ; \ + mv stage1-zlib prev-zlib || test -f stage1-lean +@endif zlib +@if lto-plugin + @cd $(HOST_SUBDIR); [ -d stageprofile-lto-plugin ] || \ + mkdir stageprofile-lto-plugin; \ + mv stageprofile-lto-plugin lto-plugin ; \ + mv stage1-lto-plugin prev-lto-plugin || test -f stage1-lean +@endif lto-plugin + @[ -d stageprofile-$(TARGET_SUBDIR) ] || \ + mkdir stageprofile-$(TARGET_SUBDIR); \ + mv stageprofile-$(TARGET_SUBDIR) $(TARGET_SUBDIR) ; \ + mv stage1-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stage1-lean + +stageprofile-end:: +@if bfd + @if test -d $(HOST_SUBDIR)/bfd ; then \ + cd $(HOST_SUBDIR); mv bfd stageprofile-bfd ; \ + mv prev-bfd stage1-bfd ; : ; \ + fi +@endif bfd +@if opcodes + @if test -d $(HOST_SUBDIR)/opcodes ; then \ + cd $(HOST_SUBDIR); mv opcodes stageprofile-opcodes ; \ + mv prev-opcodes stage1-opcodes ; : ; \ + fi +@endif opcodes +@if binutils + @if test -d $(HOST_SUBDIR)/binutils ; then \ + cd $(HOST_SUBDIR); mv binutils stageprofile-binutils ; \ + mv prev-binutils stage1-binutils ; : ; \ + fi +@endif binutils +@if gas + @if test -d $(HOST_SUBDIR)/gas ; then \ + cd $(HOST_SUBDIR); mv gas stageprofile-gas ; \ + mv prev-gas stage1-gas ; : ; \ + fi +@endif gas +@if gcc + @if test -d $(HOST_SUBDIR)/gcc ; then \ + cd $(HOST_SUBDIR); mv gcc stageprofile-gcc ; \ + mv prev-gcc stage1-gcc ; : ; \ + fi +@endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stageprofile-gmp ; \ + mv prev-gmp stage1-gmp ; : ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stageprofile-mpfr ; \ + mv prev-mpfr stage1-mpfr ; : ; \ + fi +@endif mpfr +@if mpc + @if test -d $(HOST_SUBDIR)/mpc ; then \ + cd $(HOST_SUBDIR); mv mpc stageprofile-mpc ; \ + mv prev-mpc stage1-mpc ; : ; \ + fi +@endif mpc +@if ppl + @if test -d $(HOST_SUBDIR)/ppl ; then \ + cd $(HOST_SUBDIR); mv ppl stageprofile-ppl ; \ + mv prev-ppl stage1-ppl ; : ; \ + fi +@endif ppl +@if cloog + @if test -d $(HOST_SUBDIR)/cloog ; then \ + cd $(HOST_SUBDIR); mv cloog stageprofile-cloog ; \ + mv prev-cloog stage1-cloog ; : ; \ + fi +@endif cloog +@if libelf + @if test -d $(HOST_SUBDIR)/libelf ; then \ + cd $(HOST_SUBDIR); mv libelf stageprofile-libelf ; \ + mv prev-libelf stage1-libelf ; : ; \ + fi +@endif libelf +@if gold + @if test -d $(HOST_SUBDIR)/gold ; then \ + cd $(HOST_SUBDIR); mv gold stageprofile-gold ; \ + mv prev-gold stage1-gold ; : ; \ + fi +@endif gold +@if intl + @if test -d $(HOST_SUBDIR)/intl ; then \ + cd $(HOST_SUBDIR); mv intl stageprofile-intl ; \ + mv prev-intl stage1-intl ; : ; \ + fi +@endif intl +@if ld + @if test -d $(HOST_SUBDIR)/ld ; then \ + cd $(HOST_SUBDIR); mv ld stageprofile-ld ; \ + mv prev-ld stage1-ld ; : ; \ + fi +@endif ld +@if libcpp + @if test -d $(HOST_SUBDIR)/libcpp ; then \ + cd $(HOST_SUBDIR); mv libcpp stageprofile-libcpp ; \ + mv prev-libcpp stage1-libcpp ; : ; \ + fi +@endif libcpp +@if libdecnumber + @if test -d $(HOST_SUBDIR)/libdecnumber ; then \ + cd $(HOST_SUBDIR); mv libdecnumber stageprofile-libdecnumber ; \ + mv prev-libdecnumber stage1-libdecnumber ; : ; \ + fi +@endif libdecnumber +@if libiberty + @if test -d $(HOST_SUBDIR)/libiberty ; then \ + cd $(HOST_SUBDIR); mv libiberty stageprofile-libiberty ; \ + mv prev-libiberty stage1-libiberty ; : ; \ + fi +@endif libiberty +@if zlib + @if test -d $(HOST_SUBDIR)/zlib ; then \ + cd $(HOST_SUBDIR); mv zlib stageprofile-zlib ; \ + mv prev-zlib stage1-zlib ; : ; \ + fi +@endif zlib +@if lto-plugin + @if test -d $(HOST_SUBDIR)/lto-plugin ; then \ + cd $(HOST_SUBDIR); mv lto-plugin stageprofile-lto-plugin ; \ + mv prev-lto-plugin stage1-lto-plugin ; : ; \ + fi +@endif lto-plugin + @if test -d $(TARGET_SUBDIR) ; then \ + mv $(TARGET_SUBDIR) stageprofile-$(TARGET_SUBDIR) ; \ + mv prev-$(TARGET_SUBDIR) stage1-$(TARGET_SUBDIR) ; : ; \ + fi + rm -f stage_current + +# Bubble a bug fix through all the stages up to stage profile. They are +# remade, but not reconfigured. The next stage (if any) will not be +# reconfigured either. +.PHONY: stageprofile-bubble +stageprofile-bubble:: stage1-bubble + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + if test -f stageprofile-lean || test -f stage1-lean ; then \ + echo Skipping rebuild of stageprofile ; \ + else \ + $(MAKE) stageprofile-start; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stageprofile; \ + fi + +.PHONY: all-stageprofile clean-stageprofile +do-clean: clean-stageprofile + +# FIXME: Will not need to be conditional when toplevel bootstrap is the +# only possibility, but now it conflicts with no-bootstrap rules +@if gcc-bootstrap + + + + +# Rules to wipe a stage and all the following ones, also used for cleanstrap +distclean-stage1:: distclean-stageprofile +.PHONY: distclean-stageprofile +distclean-stageprofile:: + @: $(MAKE); $(stage) + @test "`cat stage_last`" != stageprofile || rm -f stage_last + rm -rf stageprofile-* + + +@endif gcc-bootstrap + + +.PHONY: stagefeedback-start stagefeedback-end + +stagefeedback-start:: + @: $(MAKE); $(stage); \ + echo stagefeedback > stage_current ; \ + echo stagefeedback > stage_last; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) +@if bfd + @cd $(HOST_SUBDIR); [ -d stagefeedback-bfd ] || \ + mkdir stagefeedback-bfd; \ + mv stagefeedback-bfd bfd ; \ + mv stageprofile-bfd prev-bfd || test -f stageprofile-lean +@endif bfd +@if opcodes + @cd $(HOST_SUBDIR); [ -d stagefeedback-opcodes ] || \ + mkdir stagefeedback-opcodes; \ + mv stagefeedback-opcodes opcodes ; \ + mv stageprofile-opcodes prev-opcodes || test -f stageprofile-lean +@endif opcodes +@if binutils + @cd $(HOST_SUBDIR); [ -d stagefeedback-binutils ] || \ + mkdir stagefeedback-binutils; \ + mv stagefeedback-binutils binutils ; \ + mv stageprofile-binutils prev-binutils || test -f stageprofile-lean +@endif binutils +@if gas + @cd $(HOST_SUBDIR); [ -d stagefeedback-gas ] || \ + mkdir stagefeedback-gas; \ + mv stagefeedback-gas gas ; \ + mv stageprofile-gas prev-gas || test -f stageprofile-lean +@endif gas +@if gcc + @cd $(HOST_SUBDIR); [ -d stagefeedback-gcc ] || \ + mkdir stagefeedback-gcc; \ + mv stagefeedback-gcc gcc ; \ + mv stageprofile-gcc prev-gcc || test -f stageprofile-lean +@endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stagefeedback-gmp ] || \ + mkdir stagefeedback-gmp; \ + mv stagefeedback-gmp gmp ; \ + mv stageprofile-gmp prev-gmp || test -f stageprofile-lean +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stagefeedback-mpfr ] || \ + mkdir stagefeedback-mpfr; \ + mv stagefeedback-mpfr mpfr ; \ + mv stageprofile-mpfr prev-mpfr || test -f stageprofile-lean +@endif mpfr +@if mpc + @cd $(HOST_SUBDIR); [ -d stagefeedback-mpc ] || \ + mkdir stagefeedback-mpc; \ + mv stagefeedback-mpc mpc ; \ + mv stageprofile-mpc prev-mpc || test -f stageprofile-lean +@endif mpc +@if ppl + @cd $(HOST_SUBDIR); [ -d stagefeedback-ppl ] || \ + mkdir stagefeedback-ppl; \ + mv stagefeedback-ppl ppl ; \ + mv stageprofile-ppl prev-ppl || test -f stageprofile-lean +@endif ppl +@if cloog + @cd $(HOST_SUBDIR); [ -d stagefeedback-cloog ] || \ + mkdir stagefeedback-cloog; \ + mv stagefeedback-cloog cloog ; \ + mv stageprofile-cloog prev-cloog || test -f stageprofile-lean +@endif cloog +@if libelf + @cd $(HOST_SUBDIR); [ -d stagefeedback-libelf ] || \ + mkdir stagefeedback-libelf; \ + mv stagefeedback-libelf libelf ; \ + mv stageprofile-libelf prev-libelf || test -f stageprofile-lean +@endif libelf +@if gold + @cd $(HOST_SUBDIR); [ -d stagefeedback-gold ] || \ + mkdir stagefeedback-gold; \ + mv stagefeedback-gold gold ; \ + mv stageprofile-gold prev-gold || test -f stageprofile-lean +@endif gold +@if intl + @cd $(HOST_SUBDIR); [ -d stagefeedback-intl ] || \ + mkdir stagefeedback-intl; \ + mv stagefeedback-intl intl ; \ + mv stageprofile-intl prev-intl || test -f stageprofile-lean +@endif intl +@if ld + @cd $(HOST_SUBDIR); [ -d stagefeedback-ld ] || \ + mkdir stagefeedback-ld; \ + mv stagefeedback-ld ld ; \ + mv stageprofile-ld prev-ld || test -f stageprofile-lean +@endif ld +@if libcpp + @cd $(HOST_SUBDIR); [ -d stagefeedback-libcpp ] || \ + mkdir stagefeedback-libcpp; \ + mv stagefeedback-libcpp libcpp ; \ + mv stageprofile-libcpp prev-libcpp || test -f stageprofile-lean +@endif libcpp +@if libdecnumber + @cd $(HOST_SUBDIR); [ -d stagefeedback-libdecnumber ] || \ + mkdir stagefeedback-libdecnumber; \ + mv stagefeedback-libdecnumber libdecnumber ; \ + mv stageprofile-libdecnumber prev-libdecnumber || test -f stageprofile-lean +@endif libdecnumber +@if libiberty + @cd $(HOST_SUBDIR); [ -d stagefeedback-libiberty ] || \ + mkdir stagefeedback-libiberty; \ + mv stagefeedback-libiberty libiberty ; \ + mv stageprofile-libiberty prev-libiberty || test -f stageprofile-lean +@endif libiberty +@if zlib + @cd $(HOST_SUBDIR); [ -d stagefeedback-zlib ] || \ + mkdir stagefeedback-zlib; \ + mv stagefeedback-zlib zlib ; \ + mv stageprofile-zlib prev-zlib || test -f stageprofile-lean +@endif zlib +@if lto-plugin + @cd $(HOST_SUBDIR); [ -d stagefeedback-lto-plugin ] || \ + mkdir stagefeedback-lto-plugin; \ + mv stagefeedback-lto-plugin lto-plugin ; \ + mv stageprofile-lto-plugin prev-lto-plugin || test -f stageprofile-lean +@endif lto-plugin + @[ -d stagefeedback-$(TARGET_SUBDIR) ] || \ + mkdir stagefeedback-$(TARGET_SUBDIR); \ + mv stagefeedback-$(TARGET_SUBDIR) $(TARGET_SUBDIR) ; \ + mv stageprofile-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stageprofile-lean + +stagefeedback-end:: +@if bfd + @if test -d $(HOST_SUBDIR)/bfd ; then \ + cd $(HOST_SUBDIR); mv bfd stagefeedback-bfd ; \ + mv prev-bfd stageprofile-bfd ; : ; \ + fi +@endif bfd +@if opcodes + @if test -d $(HOST_SUBDIR)/opcodes ; then \ + cd $(HOST_SUBDIR); mv opcodes stagefeedback-opcodes ; \ + mv prev-opcodes stageprofile-opcodes ; : ; \ + fi +@endif opcodes +@if binutils + @if test -d $(HOST_SUBDIR)/binutils ; then \ + cd $(HOST_SUBDIR); mv binutils stagefeedback-binutils ; \ + mv prev-binutils stageprofile-binutils ; : ; \ + fi +@endif binutils +@if gas + @if test -d $(HOST_SUBDIR)/gas ; then \ + cd $(HOST_SUBDIR); mv gas stagefeedback-gas ; \ + mv prev-gas stageprofile-gas ; : ; \ + fi +@endif gas +@if gcc + @if test -d $(HOST_SUBDIR)/gcc ; then \ + cd $(HOST_SUBDIR); mv gcc stagefeedback-gcc ; \ + mv prev-gcc stageprofile-gcc ; : ; \ + fi +@endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stagefeedback-gmp ; \ + mv prev-gmp stageprofile-gmp ; : ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stagefeedback-mpfr ; \ + mv prev-mpfr stageprofile-mpfr ; : ; \ + fi +@endif mpfr +@if mpc + @if test -d $(HOST_SUBDIR)/mpc ; then \ + cd $(HOST_SUBDIR); mv mpc stagefeedback-mpc ; \ + mv prev-mpc stageprofile-mpc ; : ; \ + fi +@endif mpc +@if ppl + @if test -d $(HOST_SUBDIR)/ppl ; then \ + cd $(HOST_SUBDIR); mv ppl stagefeedback-ppl ; \ + mv prev-ppl stageprofile-ppl ; : ; \ + fi +@endif ppl +@if cloog + @if test -d $(HOST_SUBDIR)/cloog ; then \ + cd $(HOST_SUBDIR); mv cloog stagefeedback-cloog ; \ + mv prev-cloog stageprofile-cloog ; : ; \ + fi +@endif cloog +@if libelf + @if test -d $(HOST_SUBDIR)/libelf ; then \ + cd $(HOST_SUBDIR); mv libelf stagefeedback-libelf ; \ + mv prev-libelf stageprofile-libelf ; : ; \ + fi +@endif libelf +@if gold + @if test -d $(HOST_SUBDIR)/gold ; then \ + cd $(HOST_SUBDIR); mv gold stagefeedback-gold ; \ + mv prev-gold stageprofile-gold ; : ; \ + fi +@endif gold +@if intl + @if test -d $(HOST_SUBDIR)/intl ; then \ + cd $(HOST_SUBDIR); mv intl stagefeedback-intl ; \ + mv prev-intl stageprofile-intl ; : ; \ + fi +@endif intl +@if ld + @if test -d $(HOST_SUBDIR)/ld ; then \ + cd $(HOST_SUBDIR); mv ld stagefeedback-ld ; \ + mv prev-ld stageprofile-ld ; : ; \ + fi +@endif ld +@if libcpp + @if test -d $(HOST_SUBDIR)/libcpp ; then \ + cd $(HOST_SUBDIR); mv libcpp stagefeedback-libcpp ; \ + mv prev-libcpp stageprofile-libcpp ; : ; \ + fi +@endif libcpp +@if libdecnumber + @if test -d $(HOST_SUBDIR)/libdecnumber ; then \ + cd $(HOST_SUBDIR); mv libdecnumber stagefeedback-libdecnumber ; \ + mv prev-libdecnumber stageprofile-libdecnumber ; : ; \ + fi +@endif libdecnumber +@if libiberty + @if test -d $(HOST_SUBDIR)/libiberty ; then \ + cd $(HOST_SUBDIR); mv libiberty stagefeedback-libiberty ; \ + mv prev-libiberty stageprofile-libiberty ; : ; \ + fi +@endif libiberty +@if zlib + @if test -d $(HOST_SUBDIR)/zlib ; then \ + cd $(HOST_SUBDIR); mv zlib stagefeedback-zlib ; \ + mv prev-zlib stageprofile-zlib ; : ; \ + fi +@endif zlib +@if lto-plugin + @if test -d $(HOST_SUBDIR)/lto-plugin ; then \ + cd $(HOST_SUBDIR); mv lto-plugin stagefeedback-lto-plugin ; \ + mv prev-lto-plugin stageprofile-lto-plugin ; : ; \ + fi +@endif lto-plugin + @if test -d $(TARGET_SUBDIR) ; then \ + mv $(TARGET_SUBDIR) stagefeedback-$(TARGET_SUBDIR) ; \ + mv prev-$(TARGET_SUBDIR) stageprofile-$(TARGET_SUBDIR) ; : ; \ + fi + rm -f stage_current + +# Bubble a bug fix through all the stages up to stage feedback. They are +# remade, but not reconfigured. The next stage (if any) will not be +# reconfigured either. +.PHONY: stagefeedback-bubble +stagefeedback-bubble:: stageprofile-bubble + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + if test -f stagefeedback-lean || test -f stageprofile-lean ; then \ + echo Skipping rebuild of stagefeedback ; \ + else \ + $(MAKE) stagefeedback-start; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stagefeedback; \ + fi + +.PHONY: all-stagefeedback clean-stagefeedback +do-clean: clean-stagefeedback + +# FIXME: Will not need to be conditional when toplevel bootstrap is the +# only possibility, but now it conflicts with no-bootstrap rules +@if gcc-bootstrap + + + +.PHONY: profiledbootstrap profiledbootstrap-lean +profiledbootstrap: + echo stagefeedback > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) stagefeedback-bubble + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target + +profiledbootstrap-lean: + echo stagefeedback > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) LEAN=: stagefeedback-bubble + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGEfeedback_TFLAGS)"; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target + + +# Rules to wipe a stage and all the following ones, also used for cleanstrap +distclean-stageprofile:: distclean-stagefeedback +.PHONY: distclean-stagefeedback +distclean-stagefeedback:: + @: $(MAKE); $(stage) + @test "`cat stage_last`" != stagefeedback || rm -f stage_last + rm -rf stagefeedback-* + + +@endif gcc-bootstrap + + + +stageprofile-end:: + $(MAKE) distclean-stagefeedback + +stagefeedback-start:: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + for i in prev-*; do \ + j=`echo $$i | sed s/^prev-//` ; \ + cd $$r/$$i && \ + { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../'$$j'/&",' | $(SHELL) ; } && \ + { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../'$$j'/&",' | $(SHELL) ; } ; \ + done + +@if gcc-bootstrap +do-distclean: distclean-stage1 + +# Provide a GCC build when we're building target libraries. This does +# not work as a dependency, just as the minimum necessary to avoid errors. +stage_last: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage1-bubble + +# Same as unstage, but not phony and defaulting to stage1-start. We place +# it in the dependency so that for example `make -j3 all-gcc' works. +stage_current: + @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi + +.PHONY: restrap +restrap:: + @: $(MAKE); $(stage) + rm -rf stage1-$(TARGET_SUBDIR) stage2-* stage3-* stage4-* stageprofile-* stagefeedback-* +restrap:: all +@endif gcc-bootstrap + +# -------------------------------------- +# Dependencies between different modules +# -------------------------------------- + +# Generic dependencies for target modules on host stuff, especially gcc +@if gcc-bootstrap +configure-stage1-target-libstdc++-v3: maybe-all-stage1-gcc +configure-stage2-target-libstdc++-v3: maybe-all-stage2-gcc +configure-stage3-target-libstdc++-v3: maybe-all-stage3-gcc +configure-stage4-target-libstdc++-v3: maybe-all-stage4-gcc +configure-stageprofile-target-libstdc++-v3: maybe-all-stageprofile-gcc +configure-stagefeedback-target-libstdc++-v3: maybe-all-stagefeedback-gcc +configure-target-libmudflap: stage_last +configure-target-libssp: stage_last +configure-target-newlib: stage_last +configure-stage1-target-libgcc: maybe-all-stage1-gcc +configure-stage2-target-libgcc: maybe-all-stage2-gcc +configure-stage3-target-libgcc: maybe-all-stage3-gcc +configure-stage4-target-libgcc: maybe-all-stage4-gcc +configure-stageprofile-target-libgcc: maybe-all-stageprofile-gcc +configure-stagefeedback-target-libgcc: maybe-all-stagefeedback-gcc +configure-target-libquadmath: stage_last +configure-target-libgfortran: stage_last +configure-target-libobjc: stage_last +configure-target-libgo: stage_last +configure-target-libtermcap: stage_last +configure-target-winsup: stage_last +configure-target-libgloss: stage_last +configure-target-libffi: stage_last +configure-target-libjava: stage_last +configure-target-zlib: stage_last +configure-target-boehm-gc: stage_last +configure-target-rda: stage_last +configure-target-libada: stage_last +configure-stage1-target-libgomp: maybe-all-stage1-gcc +configure-stage2-target-libgomp: maybe-all-stage2-gcc +configure-stage3-target-libgomp: maybe-all-stage3-gcc +configure-stage4-target-libgomp: maybe-all-stage4-gcc +configure-stageprofile-target-libgomp: maybe-all-stageprofile-gcc +configure-stagefeedback-target-libgomp: maybe-all-stagefeedback-gcc +@endif gcc-bootstrap + +@if gcc-no-bootstrap +configure-target-libstdc++-v3: maybe-all-gcc +configure-target-libmudflap: maybe-all-gcc +configure-target-libssp: maybe-all-gcc +configure-target-newlib: maybe-all-gcc +configure-target-libgcc: maybe-all-gcc +configure-target-libquadmath: maybe-all-gcc +configure-target-libgfortran: maybe-all-gcc +configure-target-libobjc: maybe-all-gcc +configure-target-libgo: maybe-all-gcc +configure-target-libtermcap: maybe-all-gcc +configure-target-winsup: maybe-all-gcc +configure-target-libgloss: maybe-all-gcc +configure-target-libffi: maybe-all-gcc +configure-target-libjava: maybe-all-gcc +configure-target-zlib: maybe-all-gcc +configure-target-boehm-gc: maybe-all-gcc +configure-target-rda: maybe-all-gcc +configure-target-libada: maybe-all-gcc +configure-target-libgomp: maybe-all-gcc +@endif gcc-no-bootstrap + + +# There are two types of dependencies here: 'hard' dependencies, where one +# module simply won't build without the other; and 'soft' dependencies, where +# if the depended-on module is missing, the depending module will do without +# or find a substitute somewhere (perhaps installed). Soft dependencies +# are made here to depend on a 'maybe-' target. If you're not sure, +# it's safer to use a soft dependency. + + + + + + +# With all the machinery above in place, it is pretty easy to generate +# dependencies. Host dependencies are a bit more complex because we have +# to check for bootstrap/prebootstrap dependencies. To resolve +# prebootstrap dependencies, prebootstrap modules are gathered in +# a hash table. +all-build-bison: maybe-all-build-texinfo +all-build-flex: maybe-all-build-texinfo +all-build-flex: maybe-all-build-bison +all-build-flex: maybe-all-build-m4 +all-build-libiberty: maybe-all-build-texinfo +all-build-m4: maybe-all-build-texinfo +all-build-fixincludes: maybe-all-build-libiberty +configure-gcc: maybe-configure-intl + +configure-stage1-gcc: maybe-configure-stage1-intl +configure-stage2-gcc: maybe-configure-stage2-intl +configure-stage3-gcc: maybe-configure-stage3-intl +configure-stage4-gcc: maybe-configure-stage4-intl +configure-stageprofile-gcc: maybe-configure-stageprofile-intl +configure-stagefeedback-gcc: maybe-configure-stagefeedback-intl +configure-gcc: maybe-all-lto-plugin + +configure-stage1-gcc: maybe-all-stage1-lto-plugin +configure-stage2-gcc: maybe-all-stage2-lto-plugin +configure-stage3-gcc: maybe-all-stage3-lto-plugin +configure-stage4-gcc: maybe-all-stage4-lto-plugin +configure-stageprofile-gcc: maybe-all-stageprofile-lto-plugin +configure-stagefeedback-gcc: maybe-all-stagefeedback-lto-plugin +configure-gcc: maybe-all-binutils + +configure-stage1-gcc: maybe-all-stage1-binutils +configure-stage2-gcc: maybe-all-stage2-binutils +configure-stage3-gcc: maybe-all-stage3-binutils +configure-stage4-gcc: maybe-all-stage4-binutils +configure-stageprofile-gcc: maybe-all-stageprofile-binutils +configure-stagefeedback-gcc: maybe-all-stagefeedback-binutils +configure-gcc: maybe-all-gas + +configure-stage1-gcc: maybe-all-stage1-gas +configure-stage2-gcc: maybe-all-stage2-gas +configure-stage3-gcc: maybe-all-stage3-gas +configure-stage4-gcc: maybe-all-stage4-gas +configure-stageprofile-gcc: maybe-all-stageprofile-gas +configure-stagefeedback-gcc: maybe-all-stagefeedback-gas +configure-gcc: maybe-all-ld + +configure-stage1-gcc: maybe-all-stage1-ld +configure-stage2-gcc: maybe-all-stage2-ld +configure-stage3-gcc: maybe-all-stage3-ld +configure-stage4-gcc: maybe-all-stage4-ld +configure-stageprofile-gcc: maybe-all-stageprofile-ld +configure-stagefeedback-gcc: maybe-all-stagefeedback-ld +configure-gcc: maybe-all-gold + +configure-stage1-gcc: maybe-all-stage1-gold +configure-stage2-gcc: maybe-all-stage2-gold +configure-stage3-gcc: maybe-all-stage3-gold +configure-stage4-gcc: maybe-all-stage4-gold +configure-stageprofile-gcc: maybe-all-stageprofile-gold +configure-stagefeedback-gcc: maybe-all-stagefeedback-gold +configure-gcc: maybe-all-libelf + +configure-stage1-gcc: maybe-all-stage1-libelf +configure-stage2-gcc: maybe-all-stage2-libelf +configure-stage3-gcc: maybe-all-stage3-libelf +configure-stage4-gcc: maybe-all-stage4-libelf +configure-stageprofile-gcc: maybe-all-stageprofile-libelf +configure-stagefeedback-gcc: maybe-all-stagefeedback-libelf +all-gcc: all-libiberty + +all-stage1-gcc: all-stage1-libiberty +all-stage2-gcc: all-stage2-libiberty +all-stage3-gcc: all-stage3-libiberty +all-stage4-gcc: all-stage4-libiberty +all-stageprofile-gcc: all-stageprofile-libiberty +all-stagefeedback-gcc: all-stagefeedback-libiberty +all-gcc: maybe-all-gmp + +all-stage1-gcc: maybe-all-stage1-gmp +all-stage2-gcc: maybe-all-stage2-gmp +all-stage3-gcc: maybe-all-stage3-gmp +all-stage4-gcc: maybe-all-stage4-gmp +all-stageprofile-gcc: maybe-all-stageprofile-gmp +all-stagefeedback-gcc: maybe-all-stagefeedback-gmp +all-gcc: maybe-all-intl + +all-stage1-gcc: maybe-all-stage1-intl +all-stage2-gcc: maybe-all-stage2-intl +all-stage3-gcc: maybe-all-stage3-intl +all-stage4-gcc: maybe-all-stage4-intl +all-stageprofile-gcc: maybe-all-stageprofile-intl +all-stagefeedback-gcc: maybe-all-stagefeedback-intl +all-gcc: maybe-all-mpfr + +all-stage1-gcc: maybe-all-stage1-mpfr +all-stage2-gcc: maybe-all-stage2-mpfr +all-stage3-gcc: maybe-all-stage3-mpfr +all-stage4-gcc: maybe-all-stage4-mpfr +all-stageprofile-gcc: maybe-all-stageprofile-mpfr +all-stagefeedback-gcc: maybe-all-stagefeedback-mpfr +all-gcc: maybe-all-mpc + +all-stage1-gcc: maybe-all-stage1-mpc +all-stage2-gcc: maybe-all-stage2-mpc +all-stage3-gcc: maybe-all-stage3-mpc +all-stage4-gcc: maybe-all-stage4-mpc +all-stageprofile-gcc: maybe-all-stageprofile-mpc +all-stagefeedback-gcc: maybe-all-stagefeedback-mpc +all-gcc: maybe-all-ppl + +all-stage1-gcc: maybe-all-stage1-ppl +all-stage2-gcc: maybe-all-stage2-ppl +all-stage3-gcc: maybe-all-stage3-ppl +all-stage4-gcc: maybe-all-stage4-ppl +all-stageprofile-gcc: maybe-all-stageprofile-ppl +all-stagefeedback-gcc: maybe-all-stagefeedback-ppl +all-gcc: maybe-all-cloog + +all-stage1-gcc: maybe-all-stage1-cloog +all-stage2-gcc: maybe-all-stage2-cloog +all-stage3-gcc: maybe-all-stage3-cloog +all-stage4-gcc: maybe-all-stage4-cloog +all-stageprofile-gcc: maybe-all-stageprofile-cloog +all-stagefeedback-gcc: maybe-all-stagefeedback-cloog +all-gcc: maybe-all-build-texinfo + +all-stage1-gcc: maybe-all-build-texinfo +all-stage2-gcc: maybe-all-build-texinfo +all-stage3-gcc: maybe-all-build-texinfo +all-stage4-gcc: maybe-all-build-texinfo +all-stageprofile-gcc: maybe-all-build-texinfo +all-stagefeedback-gcc: maybe-all-build-texinfo +all-gcc: maybe-all-build-bison + +all-stage1-gcc: maybe-all-build-bison +all-stage2-gcc: maybe-all-build-bison +all-stage3-gcc: maybe-all-build-bison +all-stage4-gcc: maybe-all-build-bison +all-stageprofile-gcc: maybe-all-build-bison +all-stagefeedback-gcc: maybe-all-build-bison +all-gcc: maybe-all-build-flex + +all-stage1-gcc: maybe-all-build-flex +all-stage2-gcc: maybe-all-build-flex +all-stage3-gcc: maybe-all-build-flex +all-stage4-gcc: maybe-all-build-flex +all-stageprofile-gcc: maybe-all-build-flex +all-stagefeedback-gcc: maybe-all-build-flex +all-gcc: maybe-all-build-libiberty + +all-stage1-gcc: maybe-all-build-libiberty +all-stage2-gcc: maybe-all-build-libiberty +all-stage3-gcc: maybe-all-build-libiberty +all-stage4-gcc: maybe-all-build-libiberty +all-stageprofile-gcc: maybe-all-build-libiberty +all-stagefeedback-gcc: maybe-all-build-libiberty +all-gcc: maybe-all-build-fixincludes + +all-stage1-gcc: maybe-all-build-fixincludes +all-stage2-gcc: maybe-all-build-fixincludes +all-stage3-gcc: maybe-all-build-fixincludes +all-stage4-gcc: maybe-all-build-fixincludes +all-stageprofile-gcc: maybe-all-build-fixincludes +all-stagefeedback-gcc: maybe-all-build-fixincludes +all-gcc: maybe-all-zlib + +all-stage1-gcc: maybe-all-stage1-zlib +all-stage2-gcc: maybe-all-stage2-zlib +all-stage3-gcc: maybe-all-stage3-zlib +all-stage4-gcc: maybe-all-stage4-zlib +all-stageprofile-gcc: maybe-all-stageprofile-zlib +all-stagefeedback-gcc: maybe-all-stagefeedback-zlib +all-gcc: all-libcpp + +all-stage1-gcc: all-stage1-libcpp +all-stage2-gcc: all-stage2-libcpp +all-stage3-gcc: all-stage3-libcpp +all-stage4-gcc: all-stage4-libcpp +all-stageprofile-gcc: all-stageprofile-libcpp +all-stagefeedback-gcc: all-stagefeedback-libcpp +all-gcc: all-libdecnumber + +all-stage1-gcc: all-stage1-libdecnumber +all-stage2-gcc: all-stage2-libdecnumber +all-stage3-gcc: all-stage3-libdecnumber +all-stage4-gcc: all-stage4-libdecnumber +all-stageprofile-gcc: all-stageprofile-libdecnumber +all-stagefeedback-gcc: all-stagefeedback-libdecnumber +all-gcc: maybe-all-libiberty + +all-stage1-gcc: maybe-all-stage1-libiberty +all-stage2-gcc: maybe-all-stage2-libiberty +all-stage3-gcc: maybe-all-stage3-libiberty +all-stage4-gcc: maybe-all-stage4-libiberty +all-stageprofile-gcc: maybe-all-stageprofile-libiberty +all-stagefeedback-gcc: maybe-all-stagefeedback-libiberty +all-gcc: maybe-all-fixincludes +all-gcc: maybe-all-lto-plugin + +all-stage1-gcc: maybe-all-stage1-lto-plugin +all-stage2-gcc: maybe-all-stage2-lto-plugin +all-stage3-gcc: maybe-all-stage3-lto-plugin +all-stage4-gcc: maybe-all-stage4-lto-plugin +all-stageprofile-gcc: maybe-all-stageprofile-lto-plugin +all-stagefeedback-gcc: maybe-all-stagefeedback-lto-plugin +info-gcc: maybe-all-build-libiberty + +info-stage1-gcc: maybe-all-build-libiberty +info-stage2-gcc: maybe-all-build-libiberty +info-stage3-gcc: maybe-all-build-libiberty +info-stage4-gcc: maybe-all-build-libiberty +info-stageprofile-gcc: maybe-all-build-libiberty +info-stagefeedback-gcc: maybe-all-build-libiberty +dvi-gcc: maybe-all-build-libiberty + +dvi-stage1-gcc: maybe-all-build-libiberty +dvi-stage2-gcc: maybe-all-build-libiberty +dvi-stage3-gcc: maybe-all-build-libiberty +dvi-stage4-gcc: maybe-all-build-libiberty +dvi-stageprofile-gcc: maybe-all-build-libiberty +dvi-stagefeedback-gcc: maybe-all-build-libiberty +pdf-gcc: maybe-all-build-libiberty + +pdf-stage1-gcc: maybe-all-build-libiberty +pdf-stage2-gcc: maybe-all-build-libiberty +pdf-stage3-gcc: maybe-all-build-libiberty +pdf-stage4-gcc: maybe-all-build-libiberty +pdf-stageprofile-gcc: maybe-all-build-libiberty +pdf-stagefeedback-gcc: maybe-all-build-libiberty +html-gcc: maybe-all-build-libiberty + +html-stage1-gcc: maybe-all-build-libiberty +html-stage2-gcc: maybe-all-build-libiberty +html-stage3-gcc: maybe-all-build-libiberty +html-stage4-gcc: maybe-all-build-libiberty +html-stageprofile-gcc: maybe-all-build-libiberty +html-stagefeedback-gcc: maybe-all-build-libiberty +install-gcc: maybe-install-fixincludes +install-gcc: maybe-install-lto-plugin +install-strip-gcc: maybe-install-strip-fixincludes +configure-libcpp: configure-libiberty + +configure-stage1-libcpp: configure-stage1-libiberty +configure-stage2-libcpp: configure-stage2-libiberty +configure-stage3-libcpp: configure-stage3-libiberty +configure-stage4-libcpp: configure-stage4-libiberty +configure-stageprofile-libcpp: configure-stageprofile-libiberty +configure-stagefeedback-libcpp: configure-stagefeedback-libiberty +configure-libcpp: maybe-configure-intl + +configure-stage1-libcpp: maybe-configure-stage1-intl +configure-stage2-libcpp: maybe-configure-stage2-intl +configure-stage3-libcpp: maybe-configure-stage3-intl +configure-stage4-libcpp: maybe-configure-stage4-intl +configure-stageprofile-libcpp: maybe-configure-stageprofile-intl +configure-stagefeedback-libcpp: maybe-configure-stagefeedback-intl +all-libcpp: all-libiberty + +all-stage1-libcpp: all-stage1-libiberty +all-stage2-libcpp: all-stage2-libiberty +all-stage3-libcpp: all-stage3-libiberty +all-stage4-libcpp: all-stage4-libiberty +all-stageprofile-libcpp: all-stageprofile-libiberty +all-stagefeedback-libcpp: all-stagefeedback-libiberty +all-libcpp: maybe-all-intl + +all-stage1-libcpp: maybe-all-stage1-intl +all-stage2-libcpp: maybe-all-stage2-intl +all-stage3-libcpp: maybe-all-stage3-intl +all-stage4-libcpp: maybe-all-stage4-intl +all-stageprofile-libcpp: maybe-all-stageprofile-intl +all-stagefeedback-libcpp: maybe-all-stagefeedback-intl +all-fixincludes: maybe-all-libiberty +all-gnattools: maybe-all-target-libada +all-lto-plugin: maybe-all-libiberty + +all-stage1-lto-plugin: maybe-all-stage1-libiberty +all-stage2-lto-plugin: maybe-all-stage2-libiberty +all-stage3-lto-plugin: maybe-all-stage3-libiberty +all-stage4-lto-plugin: maybe-all-stage4-libiberty +all-stageprofile-lto-plugin: maybe-all-stageprofile-libiberty +all-stagefeedback-lto-plugin: maybe-all-stagefeedback-libiberty +all-utils: maybe-all-libiberty +configure-mpfr: maybe-all-gmp + +configure-stage1-mpfr: maybe-all-stage1-gmp +configure-stage2-mpfr: maybe-all-stage2-gmp +configure-stage3-mpfr: maybe-all-stage3-gmp +configure-stage4-mpfr: maybe-all-stage4-gmp +configure-stageprofile-mpfr: maybe-all-stageprofile-gmp +configure-stagefeedback-mpfr: maybe-all-stagefeedback-gmp +configure-mpc: maybe-all-mpfr + +configure-stage1-mpc: maybe-all-stage1-mpfr +configure-stage2-mpc: maybe-all-stage2-mpfr +configure-stage3-mpc: maybe-all-stage3-mpfr +configure-stage4-mpc: maybe-all-stage4-mpfr +configure-stageprofile-mpc: maybe-all-stageprofile-mpfr +configure-stagefeedback-mpc: maybe-all-stagefeedback-mpfr +configure-ppl: maybe-all-gmp + +configure-stage1-ppl: maybe-all-stage1-gmp +configure-stage2-ppl: maybe-all-stage2-gmp +configure-stage3-ppl: maybe-all-stage3-gmp +configure-stage4-ppl: maybe-all-stage4-gmp +configure-stageprofile-ppl: maybe-all-stageprofile-gmp +configure-stagefeedback-ppl: maybe-all-stagefeedback-gmp +configure-ppl: maybe-all-mpfr + +configure-stage1-ppl: maybe-all-stage1-mpfr +configure-stage2-ppl: maybe-all-stage2-mpfr +configure-stage3-ppl: maybe-all-stage3-mpfr +configure-stage4-ppl: maybe-all-stage4-mpfr +configure-stageprofile-ppl: maybe-all-stageprofile-mpfr +configure-stagefeedback-ppl: maybe-all-stagefeedback-mpfr +configure-cloog: maybe-all-ppl + +configure-stage1-cloog: maybe-all-stage1-ppl +configure-stage2-cloog: maybe-all-stage2-ppl +configure-stage3-cloog: maybe-all-stage3-ppl +configure-stage4-cloog: maybe-all-stage4-ppl +configure-stageprofile-cloog: maybe-all-stageprofile-ppl +configure-stagefeedback-cloog: maybe-all-stagefeedback-ppl +configure-gdb: maybe-all-intl +configure-gdb: maybe-configure-sim +configure-gdb: maybe-all-bfd +configure-gdb: maybe-all-libiconv +all-gdb: maybe-all-libiberty +all-gdb: maybe-all-libiconv +all-gdb: maybe-all-opcodes +all-gdb: maybe-all-readline +all-gdb: maybe-all-build-bison +all-gdb: maybe-all-sim +all-gdb: maybe-all-libdecnumber +all-gdb: maybe-all-libtermcap +configure-libgui: maybe-configure-tcl +configure-libgui: maybe-configure-tk +all-libgui: maybe-all-tcl +all-libgui: maybe-all-tk +all-libgui: maybe-all-itcl +configure-bfd: configure-libiberty + +configure-stage1-bfd: configure-stage1-libiberty +configure-stage2-bfd: configure-stage2-libiberty +configure-stage3-bfd: configure-stage3-libiberty +configure-stage4-bfd: configure-stage4-libiberty +configure-stageprofile-bfd: configure-stageprofile-libiberty +configure-stagefeedback-bfd: configure-stagefeedback-libiberty +configure-bfd: maybe-configure-intl + +configure-stage1-bfd: maybe-configure-stage1-intl +configure-stage2-bfd: maybe-configure-stage2-intl +configure-stage3-bfd: maybe-configure-stage3-intl +configure-stage4-bfd: maybe-configure-stage4-intl +configure-stageprofile-bfd: maybe-configure-stageprofile-intl +configure-stagefeedback-bfd: maybe-configure-stagefeedback-intl +all-bfd: maybe-all-libiberty + +all-stage1-bfd: maybe-all-stage1-libiberty +all-stage2-bfd: maybe-all-stage2-libiberty +all-stage3-bfd: maybe-all-stage3-libiberty +all-stage4-bfd: maybe-all-stage4-libiberty +all-stageprofile-bfd: maybe-all-stageprofile-libiberty +all-stagefeedback-bfd: maybe-all-stagefeedback-libiberty +all-bfd: maybe-all-intl + +all-stage1-bfd: maybe-all-stage1-intl +all-stage2-bfd: maybe-all-stage2-intl +all-stage3-bfd: maybe-all-stage3-intl +all-stage4-bfd: maybe-all-stage4-intl +all-stageprofile-bfd: maybe-all-stageprofile-intl +all-stagefeedback-bfd: maybe-all-stagefeedback-intl +configure-opcodes: configure-libiberty + +configure-stage1-opcodes: configure-stage1-libiberty +configure-stage2-opcodes: configure-stage2-libiberty +configure-stage3-opcodes: configure-stage3-libiberty +configure-stage4-opcodes: configure-stage4-libiberty +configure-stageprofile-opcodes: configure-stageprofile-libiberty +configure-stagefeedback-opcodes: configure-stagefeedback-libiberty +all-opcodes: maybe-all-libiberty + +all-stage1-opcodes: maybe-all-stage1-libiberty +all-stage2-opcodes: maybe-all-stage2-libiberty +all-stage3-opcodes: maybe-all-stage3-libiberty +all-stage4-opcodes: maybe-all-stage4-libiberty +all-stageprofile-opcodes: maybe-all-stageprofile-libiberty +all-stagefeedback-opcodes: maybe-all-stagefeedback-libiberty +configure-binutils: maybe-configure-intl + +configure-stage1-binutils: maybe-configure-stage1-intl +configure-stage2-binutils: maybe-configure-stage2-intl +configure-stage3-binutils: maybe-configure-stage3-intl +configure-stage4-binutils: maybe-configure-stage4-intl +configure-stageprofile-binutils: maybe-configure-stageprofile-intl +configure-stagefeedback-binutils: maybe-configure-stagefeedback-intl +all-binutils: maybe-all-libiberty + +all-stage1-binutils: maybe-all-stage1-libiberty +all-stage2-binutils: maybe-all-stage2-libiberty +all-stage3-binutils: maybe-all-stage3-libiberty +all-stage4-binutils: maybe-all-stage4-libiberty +all-stageprofile-binutils: maybe-all-stageprofile-libiberty +all-stagefeedback-binutils: maybe-all-stagefeedback-libiberty +all-binutils: maybe-all-opcodes + +all-stage1-binutils: maybe-all-stage1-opcodes +all-stage2-binutils: maybe-all-stage2-opcodes +all-stage3-binutils: maybe-all-stage3-opcodes +all-stage4-binutils: maybe-all-stage4-opcodes +all-stageprofile-binutils: maybe-all-stageprofile-opcodes +all-stagefeedback-binutils: maybe-all-stagefeedback-opcodes +all-binutils: maybe-all-bfd + +all-stage1-binutils: maybe-all-stage1-bfd +all-stage2-binutils: maybe-all-stage2-bfd +all-stage3-binutils: maybe-all-stage3-bfd +all-stage4-binutils: maybe-all-stage4-bfd +all-stageprofile-binutils: maybe-all-stageprofile-bfd +all-stagefeedback-binutils: maybe-all-stagefeedback-bfd +all-binutils: maybe-all-build-flex + +all-stage1-binutils: maybe-all-build-flex +all-stage2-binutils: maybe-all-build-flex +all-stage3-binutils: maybe-all-build-flex +all-stage4-binutils: maybe-all-build-flex +all-stageprofile-binutils: maybe-all-build-flex +all-stagefeedback-binutils: maybe-all-build-flex +all-binutils: maybe-all-build-bison + +all-stage1-binutils: maybe-all-build-bison +all-stage2-binutils: maybe-all-build-bison +all-stage3-binutils: maybe-all-build-bison +all-stage4-binutils: maybe-all-build-bison +all-stageprofile-binutils: maybe-all-build-bison +all-stagefeedback-binutils: maybe-all-build-bison +all-binutils: maybe-all-intl + +all-stage1-binutils: maybe-all-stage1-intl +all-stage2-binutils: maybe-all-stage2-intl +all-stage3-binutils: maybe-all-stage3-intl +all-stage4-binutils: maybe-all-stage4-intl +all-stageprofile-binutils: maybe-all-stageprofile-intl +all-stagefeedback-binutils: maybe-all-stagefeedback-intl +install-binutils: maybe-install-opcodes +install-strip-binutils: maybe-install-strip-opcodes +install-opcodes: maybe-install-bfd +install-strip-opcodes: maybe-install-strip-bfd +configure-gas: maybe-configure-intl + +configure-stage1-gas: maybe-configure-stage1-intl +configure-stage2-gas: maybe-configure-stage2-intl +configure-stage3-gas: maybe-configure-stage3-intl +configure-stage4-gas: maybe-configure-stage4-intl +configure-stageprofile-gas: maybe-configure-stageprofile-intl +configure-stagefeedback-gas: maybe-configure-stagefeedback-intl +all-gas: maybe-all-libiberty + +all-stage1-gas: maybe-all-stage1-libiberty +all-stage2-gas: maybe-all-stage2-libiberty +all-stage3-gas: maybe-all-stage3-libiberty +all-stage4-gas: maybe-all-stage4-libiberty +all-stageprofile-gas: maybe-all-stageprofile-libiberty +all-stagefeedback-gas: maybe-all-stagefeedback-libiberty +all-gas: maybe-all-opcodes + +all-stage1-gas: maybe-all-stage1-opcodes +all-stage2-gas: maybe-all-stage2-opcodes +all-stage3-gas: maybe-all-stage3-opcodes +all-stage4-gas: maybe-all-stage4-opcodes +all-stageprofile-gas: maybe-all-stageprofile-opcodes +all-stagefeedback-gas: maybe-all-stagefeedback-opcodes +all-gas: maybe-all-bfd + +all-stage1-gas: maybe-all-stage1-bfd +all-stage2-gas: maybe-all-stage2-bfd +all-stage3-gas: maybe-all-stage3-bfd +all-stage4-gas: maybe-all-stage4-bfd +all-stageprofile-gas: maybe-all-stageprofile-bfd +all-stagefeedback-gas: maybe-all-stagefeedback-bfd +all-gas: maybe-all-intl + +all-stage1-gas: maybe-all-stage1-intl +all-stage2-gas: maybe-all-stage2-intl +all-stage3-gas: maybe-all-stage3-intl +all-stage4-gas: maybe-all-stage4-intl +all-stageprofile-gas: maybe-all-stageprofile-intl +all-stagefeedback-gas: maybe-all-stagefeedback-intl +configure-gprof: maybe-configure-intl +all-gprof: maybe-all-libiberty +all-gprof: maybe-all-bfd +all-gprof: maybe-all-opcodes +all-gprof: maybe-all-intl +configure-ld: maybe-configure-intl + +configure-stage1-ld: maybe-configure-stage1-intl +configure-stage2-ld: maybe-configure-stage2-intl +configure-stage3-ld: maybe-configure-stage3-intl +configure-stage4-ld: maybe-configure-stage4-intl +configure-stageprofile-ld: maybe-configure-stageprofile-intl +configure-stagefeedback-ld: maybe-configure-stagefeedback-intl +all-ld: maybe-all-libiberty + +all-stage1-ld: maybe-all-stage1-libiberty +all-stage2-ld: maybe-all-stage2-libiberty +all-stage3-ld: maybe-all-stage3-libiberty +all-stage4-ld: maybe-all-stage4-libiberty +all-stageprofile-ld: maybe-all-stageprofile-libiberty +all-stagefeedback-ld: maybe-all-stagefeedback-libiberty +all-ld: maybe-all-bfd + +all-stage1-ld: maybe-all-stage1-bfd +all-stage2-ld: maybe-all-stage2-bfd +all-stage3-ld: maybe-all-stage3-bfd +all-stage4-ld: maybe-all-stage4-bfd +all-stageprofile-ld: maybe-all-stageprofile-bfd +all-stagefeedback-ld: maybe-all-stagefeedback-bfd +all-ld: maybe-all-opcodes + +all-stage1-ld: maybe-all-stage1-opcodes +all-stage2-ld: maybe-all-stage2-opcodes +all-stage3-ld: maybe-all-stage3-opcodes +all-stage4-ld: maybe-all-stage4-opcodes +all-stageprofile-ld: maybe-all-stageprofile-opcodes +all-stagefeedback-ld: maybe-all-stagefeedback-opcodes +all-ld: maybe-all-build-bison + +all-stage1-ld: maybe-all-build-bison +all-stage2-ld: maybe-all-build-bison +all-stage3-ld: maybe-all-build-bison +all-stage4-ld: maybe-all-build-bison +all-stageprofile-ld: maybe-all-build-bison +all-stagefeedback-ld: maybe-all-build-bison +all-ld: maybe-all-build-flex + +all-stage1-ld: maybe-all-build-flex +all-stage2-ld: maybe-all-build-flex +all-stage3-ld: maybe-all-build-flex +all-stage4-ld: maybe-all-build-flex +all-stageprofile-ld: maybe-all-build-flex +all-stagefeedback-ld: maybe-all-build-flex +all-ld: maybe-all-intl + +all-stage1-ld: maybe-all-stage1-intl +all-stage2-ld: maybe-all-stage2-intl +all-stage3-ld: maybe-all-stage3-intl +all-stage4-ld: maybe-all-stage4-intl +all-stageprofile-ld: maybe-all-stageprofile-intl +all-stagefeedback-ld: maybe-all-stagefeedback-intl +install-ld: maybe-install-gold +install-strip-ld: maybe-install-strip-gold +configure-gold: maybe-configure-intl + +configure-stage1-gold: maybe-configure-stage1-intl +configure-stage2-gold: maybe-configure-stage2-intl +configure-stage3-gold: maybe-configure-stage3-intl +configure-stage4-gold: maybe-configure-stage4-intl +configure-stageprofile-gold: maybe-configure-stageprofile-intl +configure-stagefeedback-gold: maybe-configure-stagefeedback-intl +all-gold: maybe-all-libiberty + +all-stage1-gold: maybe-all-stage1-libiberty +all-stage2-gold: maybe-all-stage2-libiberty +all-stage3-gold: maybe-all-stage3-libiberty +all-stage4-gold: maybe-all-stage4-libiberty +all-stageprofile-gold: maybe-all-stageprofile-libiberty +all-stagefeedback-gold: maybe-all-stagefeedback-libiberty +all-gold: maybe-all-intl + +all-stage1-gold: maybe-all-stage1-intl +all-stage2-gold: maybe-all-stage2-intl +all-stage3-gold: maybe-all-stage3-intl +all-stage4-gold: maybe-all-stage4-intl +all-stageprofile-gold: maybe-all-stageprofile-intl +all-stagefeedback-gold: maybe-all-stagefeedback-intl +all-gold: maybe-all-bfd + +all-stage1-gold: maybe-all-stage1-bfd +all-stage2-gold: maybe-all-stage2-bfd +all-stage3-gold: maybe-all-stage3-bfd +all-stage4-gold: maybe-all-stage4-bfd +all-stageprofile-gold: maybe-all-stageprofile-bfd +all-stagefeedback-gold: maybe-all-stagefeedback-bfd +all-gold: maybe-all-build-bison + +all-stage1-gold: maybe-all-build-bison +all-stage2-gold: maybe-all-build-bison +all-stage3-gold: maybe-all-build-bison +all-stage4-gold: maybe-all-build-bison +all-stageprofile-gold: maybe-all-build-bison +all-stagefeedback-gold: maybe-all-build-bison +check-gold: maybe-all-binutils + +check-stage1-gold: maybe-all-stage1-binutils +check-stage2-gold: maybe-all-stage2-binutils +check-stage3-gold: maybe-all-stage3-binutils +check-stage4-gold: maybe-all-stage4-binutils +check-stageprofile-gold: maybe-all-stageprofile-binutils +check-stagefeedback-gold: maybe-all-stagefeedback-binutils +check-gold: maybe-all-gas + +check-stage1-gold: maybe-all-stage1-gas +check-stage2-gold: maybe-all-stage2-gas +check-stage3-gold: maybe-all-stage3-gas +check-stage4-gold: maybe-all-stage4-gas +check-stageprofile-gold: maybe-all-stageprofile-gas +check-stagefeedback-gold: maybe-all-stagefeedback-gas +configure-opcodes: maybe-configure-intl + +configure-stage1-opcodes: maybe-configure-stage1-intl +configure-stage2-opcodes: maybe-configure-stage2-intl +configure-stage3-opcodes: maybe-configure-stage3-intl +configure-stage4-opcodes: maybe-configure-stage4-intl +configure-stageprofile-opcodes: maybe-configure-stageprofile-intl +configure-stagefeedback-opcodes: maybe-configure-stagefeedback-intl +all-opcodes: maybe-all-bfd + +all-stage1-opcodes: maybe-all-stage1-bfd +all-stage2-opcodes: maybe-all-stage2-bfd +all-stage3-opcodes: maybe-all-stage3-bfd +all-stage4-opcodes: maybe-all-stage4-bfd +all-stageprofile-opcodes: maybe-all-stageprofile-bfd +all-stagefeedback-opcodes: maybe-all-stagefeedback-bfd +all-opcodes: maybe-all-libiberty + +all-stage1-opcodes: maybe-all-stage1-libiberty +all-stage2-opcodes: maybe-all-stage2-libiberty +all-stage3-opcodes: maybe-all-stage3-libiberty +all-stage4-opcodes: maybe-all-stage4-libiberty +all-stageprofile-opcodes: maybe-all-stageprofile-libiberty +all-stagefeedback-opcodes: maybe-all-stagefeedback-libiberty +all-opcodes: maybe-all-intl + +all-stage1-opcodes: maybe-all-stage1-intl +all-stage2-opcodes: maybe-all-stage2-intl +all-stage3-opcodes: maybe-all-stage3-intl +all-stage4-opcodes: maybe-all-stage4-intl +all-stageprofile-opcodes: maybe-all-stageprofile-intl +all-stagefeedback-opcodes: maybe-all-stagefeedback-intl +all-dejagnu: maybe-all-tcl +all-dejagnu: maybe-all-expect +all-dejagnu: maybe-all-tk +configure-expect: maybe-configure-tcl +configure-expect: maybe-configure-tk +all-expect: maybe-all-tcl +all-expect: maybe-all-tk +configure-itcl: maybe-configure-tcl +configure-itcl: maybe-configure-tk +all-itcl: maybe-all-tcl +all-itcl: maybe-all-tk +install-itcl: maybe-install-tcl +install-strip-itcl: maybe-install-strip-tcl +configure-tk: maybe-configure-tcl +all-tk: maybe-all-tcl +all-sid: maybe-all-libiberty +all-sid: maybe-all-bfd +all-sid: maybe-all-opcodes +all-sid: maybe-all-tcl +all-sid: maybe-all-tk +install-sid: maybe-install-tcl +install-strip-sid: maybe-install-strip-tcl +install-sid: maybe-install-tk +install-strip-sid: maybe-install-strip-tk +configure-sim: maybe-configure-intl +all-sim: maybe-all-intl +all-sim: maybe-all-libiberty +all-sim: maybe-all-bfd +all-sim: maybe-all-opcodes +all-sim: maybe-all-readline +all-sim: maybe-configure-gdb +all-fastjar: maybe-all-zlib +all-fastjar: maybe-all-build-texinfo +all-fastjar: maybe-all-libiberty +all-bison: maybe-all-intl +all-bison: maybe-all-build-texinfo +all-flex: maybe-all-build-bison +all-flex: maybe-all-intl +all-flex: maybe-all-m4 +all-flex: maybe-all-build-texinfo +all-m4: maybe-all-intl +all-m4: maybe-all-build-texinfo +configure-target-boehm-gc: maybe-all-target-libstdc++-v3 +configure-target-fastjar: maybe-configure-target-zlib +all-target-fastjar: maybe-all-target-zlib +configure-target-libgo: maybe-configure-target-libffi +configure-target-libgo: maybe-all-target-libstdc++-v3 +all-target-libgo: maybe-all-target-libffi +configure-target-libjava: maybe-configure-target-zlib +configure-target-libjava: maybe-configure-target-boehm-gc +configure-target-libjava: maybe-configure-target-libffi +all-target-libjava: maybe-all-fastjar +all-target-libjava: maybe-all-target-zlib +all-target-libjava: maybe-all-target-boehm-gc +all-target-libjava: maybe-all-target-libffi +configure-target-libobjc: maybe-configure-target-boehm-gc +all-target-libobjc: maybe-all-target-boehm-gc +configure-target-libstdc++-v3: maybe-configure-target-libgomp + +configure-stage1-target-libstdc++-v3: maybe-configure-stage1-target-libgomp +configure-stage2-target-libstdc++-v3: maybe-configure-stage2-target-libgomp +configure-stage3-target-libstdc++-v3: maybe-configure-stage3-target-libgomp +configure-stage4-target-libstdc++-v3: maybe-configure-stage4-target-libgomp +configure-stageprofile-target-libstdc++-v3: maybe-configure-stageprofile-target-libgomp +configure-stagefeedback-target-libstdc++-v3: maybe-configure-stagefeedback-target-libgomp +all-target-libstdc++-v3: maybe-configure-target-libgomp + +all-stage1-target-libstdc++-v3: maybe-configure-stage1-target-libgomp +all-stage2-target-libstdc++-v3: maybe-configure-stage2-target-libgomp +all-stage3-target-libstdc++-v3: maybe-configure-stage3-target-libgomp +all-stage4-target-libstdc++-v3: maybe-configure-stage4-target-libgomp +all-stageprofile-target-libstdc++-v3: maybe-configure-stageprofile-target-libgomp +all-stagefeedback-target-libstdc++-v3: maybe-configure-stagefeedback-target-libgomp +all-target-libgloss: maybe-all-target-newlib +all-target-winsup: maybe-all-target-libtermcap +configure-target-newlib: maybe-all-binutils +configure-target-newlib: maybe-all-ld +configure-target-libgfortran: maybe-all-target-libquadmath + + +# Dependencies for target modules on other target modules are +# described by lang_env_dependencies; the defaults apply to anything +# not mentioned there. + + +@if gcc-bootstrap +configure-stage1-target-libstdc++-v3: maybe-all-stage1-target-libgcc +configure-stage2-target-libstdc++-v3: maybe-all-stage2-target-libgcc +configure-stage3-target-libstdc++-v3: maybe-all-stage3-target-libgcc +configure-stage4-target-libstdc++-v3: maybe-all-stage4-target-libgcc +configure-stageprofile-target-libstdc++-v3: maybe-all-stageprofile-target-libgcc +configure-stagefeedback-target-libstdc++-v3: maybe-all-stagefeedback-target-libgcc +configure-stage1-target-libgomp: maybe-all-stage1-target-libgcc +configure-stage2-target-libgomp: maybe-all-stage2-target-libgcc +configure-stage3-target-libgomp: maybe-all-stage3-target-libgcc +configure-stage4-target-libgomp: maybe-all-stage4-target-libgcc +configure-stageprofile-target-libgomp: maybe-all-stageprofile-target-libgcc +configure-stagefeedback-target-libgomp: maybe-all-stagefeedback-target-libgcc +@endif gcc-bootstrap + +@if gcc-no-bootstrap +configure-target-libstdc++-v3: maybe-all-target-libgcc +configure-target-libmudflap: maybe-all-target-libgcc +configure-target-libssp: maybe-all-target-libgcc +configure-target-newlib: maybe-all-target-libgcc +configure-target-libquadmath: maybe-all-target-libgcc +configure-target-libgfortran: maybe-all-target-libgcc +configure-target-libobjc: maybe-all-target-libgcc +configure-target-libgo: maybe-all-target-libgcc +configure-target-libtermcap: maybe-all-target-libgcc +configure-target-winsup: maybe-all-target-libgcc +configure-target-libgloss: maybe-all-target-libgcc +configure-target-libffi: maybe-all-target-libgcc +configure-target-libjava: maybe-all-target-libgcc +configure-target-zlib: maybe-all-target-libgcc +configure-target-boehm-gc: maybe-all-target-libgcc +configure-target-rda: maybe-all-target-libgcc +configure-target-libada: maybe-all-target-libgcc +configure-target-libgomp: maybe-all-target-libgcc +@endif gcc-no-bootstrap + + +configure-target-libstdc++-v3: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libmudflap: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libssp: maybe-all-target-newlib maybe-all-target-libgloss + + + +configure-target-libquadmath: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libgfortran: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libobjc: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libgo: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libtermcap: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-winsup: maybe-all-target-newlib maybe-all-target-libgloss + + +configure-target-libffi: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libjava: maybe-all-target-newlib maybe-all-target-libgloss +configure-target-libjava: maybe-all-target-libstdc++-v3 + +configure-target-zlib: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-boehm-gc: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-rda: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libada: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libgomp: maybe-all-target-newlib maybe-all-target-libgloss + + +CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@ +GDB_TK = @GDB_TK@ +INSTALL_GDB_TK = @INSTALL_GDB_TK@ +configure-gdb: $(CONFIGURE_GDB_TK) +all-gdb: $(gdbnlmrequirements) $(GDB_TK) +install-gdb: $(INSTALL_GDB_TK) + +# Serialization dependencies. Host configures don't work well in parallel to +# each other, due to contention over config.cache. Target configures and +# build configures are similar. +@serialization_dependencies@ + +# -------------------------------- +# Regenerating top level configury +# -------------------------------- + +# Rebuilding Makefile.in, using autogen. +AUTOGEN = autogen +$(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def + cd $(srcdir) && $(AUTOGEN) Makefile.def + +# Rebuilding Makefile. +Makefile: $(srcdir)/Makefile.in config.status + CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +config.status: configure + CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck + +# Rebuilding configure. +AUTOCONF = autoconf +$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 \ + $(srcdir)/config/override.m4 $(srcdir)/config/proginstall.m4 + cd $(srcdir) && $(AUTOCONF) + +# ------------------------------ +# Special directives to GNU Make +# ------------------------------ + +# Don't pass command-line variables to submakes. +.NOEXPORT: +MAKEOVERRIDES= + +# end of Makefile.in diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/Makefile.tpl sdcc-3.2.0+dfsg/support/sdbinutils/Makefile.tpl --- sdcc-3.1.0+dfsg/support/sdbinutils/Makefile.tpl 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/Makefile.tpl 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,1899 @@ +[+ AutoGen5 template -*- Mode: Makefile -*- +in ++] + +# Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'. +# +# Makefile for directory with subdirs to build. +# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, +# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +# Free Software Foundation +# +# This file 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; see the file COPYING3. If not see +# . +# + +# First, test for a proper version of make, but only where one is required. + +@if gcc +ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never empty. +$(error GNU make version 3.80 or newer is required.) +endif +@endif gcc + +# ------------------------------- +# Standard Autoconf-set variables +# ------------------------------- +VPATH=@srcdir@ + +build_alias=@build_noncanonical@ +build_vendor=@build_vendor@ +build_os=@build_os@ +build=@build@ +host_alias=@host_noncanonical@ +host_vendor=@host_vendor@ +host_os=@host_os@ +host=@host@ +target_alias=@target_noncanonical@ +target_vendor=@target_vendor@ +target_os=@target_os@ +target=@target@ + +program_transform_name = @program_transform_name@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +srcdir = @srcdir@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +includedir = @includedir@ +oldincludedir = @oldincludedir@ +infodir = @infodir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +pdfdir = @pdfdir@ +htmldir = @htmldir@ +mandir = @mandir@ +man1dir = $(mandir)/man1 +man2dir = $(mandir)/man2 +man3dir = $(mandir)/man3 +man4dir = $(mandir)/man4 +man5dir = $(mandir)/man5 +man6dir = $(mandir)/man6 +man7dir = $(mandir)/man7 +man8dir = $(mandir)/man8 +man9dir = $(mandir)/man9 + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_DATA = @INSTALL_DATA@ +LN = @LN@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ + +# ------------------------------------------------- +# Miscellaneous non-standard autoconf-set variables +# ------------------------------------------------- + +# The gcc driver likes to know the arguments it was configured with. +TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@ + +tooldir = @tooldir@ +build_tooldir = @build_tooldir@ + +# This is the name of the environment variable used for the path to +# the libraries. +RPATH_ENVVAR = @RPATH_ENVVAR@ + +# On targets where RPATH_ENVVAR is PATH, a subdirectory of the GCC build path +# is used instead of the directory itself to avoid including built +# executables in PATH. +GCC_SHLIB_SUBDIR = @GCC_SHLIB_SUBDIR@ + +# Build programs are put under this directory. +BUILD_SUBDIR = @build_subdir@ +# This is set by the configure script to the arguments to use when configuring +# directories built for the build system. +BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)" + +# Linker flags to use on the host, for stage1 or when not +# bootstrapping. +STAGE1_LDFLAGS = @stage1_ldflags@ + +# Libraries to use on the host, for stage1 or when not bootstrapping. +STAGE1_LIBS = @stage1_libs@ + +# Linker flags to use for stage2 and later. +POSTSTAGE1_LDFLAGS = @poststage1_ldflags@ + +# Libraries to use for stage2 and later. +POSTSTAGE1_LIBS = @poststage1_libs@ + +# This is the list of variables to export in the environment when +# configuring any subdirectory. It must also be exported whenever +# recursing into a build directory in case that directory's Makefile +# re-runs configure. +BASE_EXPORTS = \ + FLEX="$(FLEX)"; export FLEX; \ + LEX="$(LEX)"; export LEX; \ + BISON="$(BISON)"; export BISON; \ + YACC="$(YACC)"; export YACC; \ + M4="$(M4)"; export M4; \ + SED="$(SED)"; export SED; \ + AWK="$(AWK)"; export AWK; \ + MAKEINFO="$(MAKEINFO)"; export MAKEINFO; + +# This is the list of variables to export in the environment when +# configuring subdirectories for the build system. +BUILD_EXPORTS = \ + $(BASE_EXPORTS) \ + AR="$(AR_FOR_BUILD)"; export AR; \ + AS="$(AS_FOR_BUILD)"; export AS; \ + CC="$(CC_FOR_BUILD)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX_FOR_BUILD)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ + GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \ + GOC="$(GOC_FOR_BUILD)"; export GOC; \ + GOCFLAGS="$(GOCFLAGS_FOR_BUILD)"; export GOCFLAGS; \ + DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \ + LD="$(LD_FOR_BUILD)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \ + NM="$(NM_FOR_BUILD)"; export NM; \ + RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \ + WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC; + +# These variables must be set on the make command line for directories +# built for the build system to override those in BASE_FLAGS_TO_PASSS. +EXTRA_BUILD_FLAGS = \ + CFLAGS="$(CFLAGS_FOR_BUILD)" \ + LDFLAGS="$(LDFLAGS_FOR_BUILD)" + +# This is the list of directories to built for the host system. +SUBDIRS = @configdirs@ +TARGET_CONFIGDIRS = @target_configdirs@ +# This is set by the configure script to the arguments to use when configuring +# directories built for the host system. +HOST_CONFIGARGS = @host_configargs@ +# Host programs are put under this directory, which is . except if building +# with srcdir=.. +HOST_SUBDIR = @host_subdir@ +# This is the list of variables to export in the environment when +# configuring subdirectories for the host system. We need to pass +# some to the GCC configure because of its hybrid host/target nature. +HOST_EXPORTS = \ + $(BASE_EXPORTS) \ + CC="$(CC)"; export CC; \ + ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + GCJ="$(GCJ)"; export GCJ; \ + GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \ + GOC="$(GOC)"; export GOC; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(STAGE1_LDFLAGS) $(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + WINDMC="$(WINDMC)"; export WINDMC; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \ + AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \ + GCC_FOR_TARGET="$(GCC_FOR_TARGET)"; export GCC_FOR_TARGET; \ + LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \ + NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \ + OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \ + RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \ + TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ + HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \ + GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \ + GMPINC="$(HOST_GMPINC)"; export GMPINC; \ + PPLLIBS="$(HOST_PPLLIBS)"; export PPLLIBS; \ + PPLINC="$(HOST_PPLINC)"; export PPLINC; \ + CLOOGLIBS="$(HOST_CLOOGLIBS)"; export CLOOGLIBS; \ + CLOOGINC="$(HOST_CLOOGINC)"; export CLOOGINC; \ + LIBELFLIBS="$(HOST_LIBELFLIBS)" ; export LIBELFLIBS; \ + LIBELFINC="$(HOST_LIBELFINC)" ; export LIBELFINC; \ +@if gcc-bootstrap + $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ +@endif gcc-bootstrap + $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); + +POSTSTAGE1_CXX_EXPORT = \ + CXX='$(CXX)'; export CXX; \ + CXX_FOR_BUILD='$(CXX_FOR_BUILD)'; export CXX_FOR_BUILD; +@if target-libstdc++-v3-bootstrap +# Override the above if we're bootstrapping C++. +POSTSTAGE1_CXX_EXPORT = \ + CXX="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/g++$(exeext) \ + -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \ + -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \ + -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \ + -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \ + -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \ + -I$$s/libstdc++-v3/libsupc++ \ + -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \ + -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs"; \ + export CXX; \ + CXX_FOR_BUILD="$$CXX"; export CXX_FOR_BUILD; +@endif target-libstdc++-v3-bootstrap + +# Similar, for later GCC stages. +POSTSTAGE1_HOST_EXPORTS = \ + $(HOST_EXPORTS) \ + CC="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \ + -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ \ + $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \ + CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \ + $(POSTSTAGE1_CXX_EXPORT) \ + GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \ + LDFLAGS="$(POSTSTAGE1_LDFLAGS) $(BOOT_LDFLAGS)"; export LDFLAGS; \ + HOST_LIBS="$(POSTSTAGE1_LIBS)"; export HOST_LIBS; + +# Target libraries are put under this directory: +TARGET_SUBDIR = @target_subdir@ +# This is set by the configure script to the arguments to use when configuring +# directories built for the target. +TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)" +# This is the list of variables to export in the environment when +# configuring subdirectories for the target system. +BASE_TARGET_EXPORTS = \ + $(BASE_EXPORTS) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GCJ; \ + GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \ + GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GOC; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \ + NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \ + OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \ +@if gcc-bootstrap + $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ +@endif gcc-bootstrap + $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ + TARGET_CONFIGDIRS="$(TARGET_CONFIGDIRS)"; export TARGET_CONFIGDIRS; + +RAW_CXX_TARGET_EXPORTS = \ + $(BASE_TARGET_EXPORTS) \ + CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ + CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; + +NORMAL_TARGET_EXPORTS = \ + $(BASE_TARGET_EXPORTS) \ + CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; + +# Where to find GMP +HOST_GMPLIBS = @gmplibs@ +HOST_GMPINC = @gmpinc@ + +# Where to find PPL +HOST_PPLLIBS = @ppllibs@ +HOST_PPLINC = @pplinc@ + +# Where to find CLOOG +HOST_CLOOGLIBS = @clooglibs@ +HOST_CLOOGINC = @clooginc@ + +# Where to find libelf +HOST_LIBELFLIBS = @libelflibs@ +HOST_LIBELFINC = @libelfinc@ + +EXTRA_CONFIGARGS_LIBJAVA = @EXTRA_CONFIGARGS_LIBJAVA@ + +# ---------------------------------------------- +# Programs producing files for the BUILD machine +# ---------------------------------------------- + +SHELL = @SHELL@ + +# pwd command to use. Allow user to override default by setting PWDCMD in +# the environment to account for automounters. The make variable must not +# be called PWDCMD, otherwise the value set here is passed to make +# subprocesses and overrides the setting from the user's environment. +# Don't use PWD since it is a common shell environment variable and we +# don't want to corrupt it. +PWD_COMMAND = $${PWDCMD-pwd} + +# compilers to use to create programs which must be run in the build +# environment. +AR_FOR_BUILD = @AR_FOR_BUILD@ +AS_FOR_BUILD = @AS_FOR_BUILD@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@ +CXX_FOR_BUILD = @CXX_FOR_BUILD@ +DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@ +GCJ_FOR_BUILD = @GCJ_FOR_BUILD@ +GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@ +GOC_FOR_BUILD = @GOC_FOR_BUILD@ +LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ +LD_FOR_BUILD = @LD_FOR_BUILD@ +NM_FOR_BUILD = @NM_FOR_BUILD@ +RANLIB_FOR_BUILD = @RANLIB_FOR_BUILD@ +WINDMC_FOR_BUILD = @WINDMC_FOR_BUILD@ +WINDRES_FOR_BUILD = @WINDRES_FOR_BUILD@ + +# Special variables passed down in EXTRA_GCC_FLAGS. They are defined +# here so that they can be overridden by Makefile fragments. +BUILD_PREFIX = @BUILD_PREFIX@ +BUILD_PREFIX_1 = @BUILD_PREFIX_1@ + +# Flags to pass to stage2 and later makes. They are defined +# here so that they can be overridden by Makefile fragments. +BOOT_CFLAGS= -g -O2 +BOOT_LDFLAGS= +BOOT_ADAFLAGS=-gnatpg -gnata + +AWK = @AWK@ +SED = @SED@ +BISON = @BISON@ +YACC = @YACC@ +FLEX = @FLEX@ +LEX = @LEX@ +M4 = @M4@ +MAKEINFO = @MAKEINFO@ +EXPECT = @EXPECT@ +RUNTEST = @RUNTEST@ + +# This just becomes part of the MAKEINFO definition passed down to +# sub-makes. It lets flags be given on the command line while still +# using the makeinfo from the object tree. +# (Default to avoid splitting info files by setting the threshold high.) +MAKEINFOFLAGS = --split-size=5000000 + +# --------------------------------------------- +# Programs producing files for the HOST machine +# --------------------------------------------- + +AS = @AS@ +AR = @AR@ +AR_FLAGS = rc +CC = @CC@ +CXX = @CXX@ +DLLTOOL = @DLLTOOL@ +LD = @LD@ +LIPO = @LIPO@ +NM = @NM@ +OBJDUMP = @OBJDUMP@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +WINDRES = @WINDRES@ +WINDMC = @WINDMC@ + +GNATBIND = @GNATBIND@ +GNATMAKE = @GNATMAKE@ + +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBCFLAGS = $(CFLAGS) +CXXFLAGS = @CXXFLAGS@ +LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates +GOCFLAGS = $(CFLAGS) + +TFLAGS = + +# Defaults for all stages; some are overridden below. + +STAGE_CFLAGS = $(BOOT_CFLAGS) +STAGE_TFLAGS = $(TFLAGS) +STAGE_CONFIGURE_FLAGS=@stage2_werror_flag@ +POSTSTAGE1_CONFIGURE_FLAGS = @POSTSTAGE1_CONFIGURE_FLAGS@ + +[+ FOR bootstrap-stage +] +# Defaults for stage [+id+]; some are overridden below. +STAGE[+id+]_CFLAGS = $(STAGE_CFLAGS) +STAGE[+id+]_CXXFLAGS = $(CXXFLAGS) +@if target-libstdc++-v3-bootstrap +# Override the above if we're bootstrapping C++. +STAGE[+id+]_CXXFLAGS = $(STAGE[+id+]_CFLAGS) +@endif target-libstdc++-v3-bootstrap +STAGE[+id+]_TFLAGS = $(STAGE_TFLAGS) +# STAGE1_CONFIGURE_FLAGS overridden below, so we can use +# POSTSTAGE1_CONFIGURE_FLAGS here. +STAGE[+id+]_CONFIGURE_FLAGS = \ + $(STAGE_CONFIGURE_FLAGS) $(POSTSTAGE1_CONFIGURE_FLAGS) +[+ ENDFOR bootstrap-stage +] + +# Only build the C compiler for stage1, because that is the only one that +# we can guarantee will build with the native compiler, and also it is the +# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS), +# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them +# overrideable (for a bootstrap build stage1 also builds gcc.info). + +STAGE1_CFLAGS = @stage1_cflags@ +STAGE1_CHECKING = @stage1_checking@ +STAGE1_LANGUAGES = @stage1_languages@ +# * We force-disable intermodule optimizations, even if +# --enable-intermodule was passed, since the installed compiler +# probably can't handle them. Luckily, autoconf always respects +# the last argument when conflicting --enable arguments are passed. +# * Likewise, we force-disable coverage flags, since the installed +# compiler probably has never heard of them. +# * Don't remove this, because above we added +# POSTSTAGE1_CONFIGURE_FLAGS to STAGE[+id+]_CONFIGURE_FLAGS, which +# we don't want for STAGE1_CONFIGURE_FLAGS. +STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \ + --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + +STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate +STAGEprofile_TFLAGS = $(STAGE2_TFLAGS) + +STAGEfeedback_CFLAGS = $(STAGE3_CFLAGS) -fprofile-use +STAGEfeedback_TFLAGS = $(STAGE3_TFLAGS) + +do-compare = @do_compare@ +do-compare3 = $(do-compare) + +# ----------------------------------------------- +# Programs producing files for the TARGET machine +# ----------------------------------------------- + +AR_FOR_TARGET=@AR_FOR_TARGET@ +AS_FOR_TARGET=@AS_FOR_TARGET@ +CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@ + +# If GCC_FOR_TARGET is not overriden on the command line, then this +# variable is passed down to the gcc Makefile, where it is used to +# build libgcc2.a. We define it here so that it can itself be +# overridden on the command line. +GCC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCC_FOR_TARGET@ +CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@ +RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@ +GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ +GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@ +GOC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GOC_FOR_TARGET@ +DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@ +LD_FOR_TARGET=@LD_FOR_TARGET@ + +LIPO_FOR_TARGET=@LIPO_FOR_TARGET@ +NM_FOR_TARGET=@NM_FOR_TARGET@ +OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@ +RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ +STRIP_FOR_TARGET=@STRIP_FOR_TARGET@ +WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@ +WINDMC_FOR_TARGET=@WINDMC_FOR_TARGET@ + +COMPILER_AS_FOR_TARGET=@COMPILER_AS_FOR_TARGET@ +COMPILER_LD_FOR_TARGET=@COMPILER_LD_FOR_TARGET@ +COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_TARGET@ + +CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@ +CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@ + +LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) +LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates +LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@ +GOCFLAGS_FOR_TARGET = -O2 -g + +FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ +SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ +DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@ + +XGCC_FLAGS_FOR_TARGET = $(FLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET) + +# ------------------------------------ +# Miscellaneous targets and flag lists +# ------------------------------------ + +# The first rule in the file had better be this one. Don't put any above it. +# This lives here to allow makefile fragments to contain dependencies. +all: + +#### host and target specific makefile fragments come in here. +@target_makefile_frag@ +@alphaieee_frag@ +@ospace_frag@ +@host_makefile_frag@ +### + +# This is the list of directories that may be needed in RPATH_ENVVAR +# so that programs built for the target machine work. +TARGET_LIB_PATH = [+ FOR target_modules +][+ + IF lib_path +]$(TARGET_LIB_PATH_[+module+])[+ ENDIF lib_path +][+ + ENDFOR target_modules +]$(HOST_LIB_PATH_gcc) +[+ FOR target_modules +][+ IF lib_path +] +@if target-[+module+] +TARGET_LIB_PATH_[+module+] = $$r/$(TARGET_SUBDIR)/[+module+]/[+lib_path+]: +@endif target-[+module+] +[+ ENDIF lib_path +][+ ENDFOR target_modules +] + + +# This is the list of directories that may be needed in RPATH_ENVVAR +# so that programs built for the host machine work. +HOST_LIB_PATH = [+ FOR host_modules +][+ + IF lib_path +]$(HOST_LIB_PATH_[+module+])[+ ENDIF lib_path +][+ + ENDFOR host_modules +] + +# Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch +@if gcc +HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc$(GCC_SHLIB_SUBDIR):$$r/$(HOST_SUBDIR)/prev-gcc$(GCC_SHLIB_SUBDIR): +@endif gcc + +[+ FOR host_modules +][+ IF lib_path +] +@if [+module+] +HOST_LIB_PATH_[+module+] = \ + $$r/$(HOST_SUBDIR)/[+module+]/[+lib_path+]:[+ IF bootstrap + +]$$r/$(HOST_SUBDIR)/prev-[+module+]/[+lib_path+]:[+ ENDIF bootstrap +] +@endif [+module+] +[+ ENDIF lib_path +][+ ENDFOR host_modules +] + +CXX_FOR_TARGET_FLAG_TO_PASS = \ + "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" +@if target-libstdc++-v3 +# CXX_FOR_TARGET is tricky to get right for target libs that require a +# functional C++ compiler. When we recurse, if we expand +# CXX_FOR_TARGET before configuring libstdc++-v3, we won't get +# libstdc++ include flags from the script. Instead, we get an +# -funconfigured-* word, so that we'll get errors if this invalid C++ +# command line is used for anything, but also so that we can use the +# word to decide whether or not to pass on this CXX_FOR_TARGET. If we +# don't pass it on, sub-make will use the default definition, that +# re-expands it at the time of use, so we'll get it right when we need +# it. One potential exception is the expansion of CXX_FOR_TARGET +# passed down as part of CXX within TARGET_FLAGS, but this wouldn't +# really work, for C++ host programs can't depend on the current-stage +# C++ target library. +CXX_FOR_TARGET_FLAG_TO_PASS = \ + $(shell if echo "$(CXX_FOR_TARGET)" | grep " -funconfigured-" > /dev/null; then :; else echo '"CXX_FOR_TARGET=$(CXX_FOR_TARGET)"'; fi) +@endif target-libstdc++-v3 + +# Flags to pass down to all sub-makes. +BASE_FLAGS_TO_PASS =[+ FOR flags_to_pass +][+ IF optional +] \ + "`echo '[+flag+]=$([+flag+])' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"[+ ELSE optional +] \ + "[+flag+]=$([+flag+])"[+ ENDIF optional+][+ ENDFOR flags_to_pass +][+ FOR bootstrap-stage +] \ + "STAGE[+id+]_CFLAGS=$(STAGE[+id+]_CFLAGS)" \ + "STAGE[+id+]_CXXFLAGS=$(STAGE[+id+]_CXXFLAGS)" \ + "STAGE[+id+]_TFLAGS=$(STAGE[+id+]_TFLAGS)"[+ ENDFOR bootstrap-stage +] \ + $(CXX_FOR_TARGET_FLAG_TO_PASS) \ + "TFLAGS=$(TFLAGS)" \ + "CONFIG_SHELL=$(SHELL)" \ + "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" + +# We leave this in just in case, but it is not needed anymore. +RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) + +# Flags to pass down to most sub-makes, in which we're building with +# the host environment. +EXTRA_HOST_FLAGS = \ + 'AR=$(AR)' \ + 'AS=$(AS)' \ + 'CC=$(CC)' \ + 'CXX=$(CXX)' \ + 'DLLTOOL=$(DLLTOOL)' \ + 'GCJ=$(GCJ)' \ + 'GFORTRAN=$(GFORTRAN)' \ + 'GOC=$(GOC)' \ + 'LD=$(LD)' \ + 'LIPO=$(LIPO)' \ + 'NM=$(NM)' \ + 'OBJDUMP=$(OBJDUMP)' \ + 'RANLIB=$(RANLIB)' \ + 'STRIP=$(STRIP)' \ + 'WINDRES=$(WINDRES)' \ + 'WINDMC=$(WINDMC)' + +FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) + +# Flags to pass to stage2 and later makes. + +POSTSTAGE1_FLAGS_TO_PASS = \ + CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \ + CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \ + GNATBIND="$${GNATBIND}" \ + LDFLAGS="$${LDFLAGS}" \ + HOST_LIBS="$${HOST_LIBS}" \ + "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" + +# Flags to pass down to makes which are built with the target environment. +# The double $ decreases the length of the command line; those variables +# are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The +# *_CFLAGS_FOR_TARGET variables are not passed down and most often empty, +# so we expand them here. +EXTRA_TARGET_FLAGS = \ + 'AR=$$(AR_FOR_TARGET)' \ + 'AS=$(COMPILER_AS_FOR_TARGET)' \ + 'CC=$$(CC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ + 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \ + 'CXX=$$(CXX_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ + 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \ + 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ + 'GCJ=$$(GCJ_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ + 'GFORTRAN=$$(GFORTRAN_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ + 'GOC=$$(GOC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ + 'GOCFLAGS=$$(GOCFLAGS_FOR_TARGET)' \ + 'LD=$(COMPILER_LD_FOR_TARGET)' \ + 'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \ + 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \ + 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \ + 'NM=$(COMPILER_NM_FOR_TARGET)' \ + 'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \ + 'RANLIB=$$(RANLIB_FOR_TARGET)' \ + 'WINDRES=$$(WINDRES_FOR_TARGET)' \ + 'WINDMC=$$(WINDMC_FOR_TARGET)' \ + 'XGCC_FLAGS_FOR_TARGET=$(XGCC_FLAGS_FOR_TARGET)' \ + "TFLAGS=$$TFLAGS" + +TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) + +# Flags to pass down to gcc. gcc builds a library, libgcc.a, so it +# unfortunately needs the native compiler and the target ar and +# ranlib. +# If any variables are added here, they must be added to do-*, below. +# The BUILD_* variables are a special case, which are used for the gcc +# cross-building scheme. +EXTRA_GCC_FLAGS = \ + "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \ + "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ + "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ + "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ + "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ + "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" + +GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS) + +@if gcc +BUILD_CONFIG = @BUILD_CONFIG@ +ifneq ($(BUILD_CONFIG),) +include $(foreach CONFIG, $(BUILD_CONFIG), $(srcdir)/config/$(CONFIG).mk) +endif +@endif gcc + +.PHONY: configure-host +configure-host: [+ + FOR host_modules +] \ + maybe-configure-[+module+][+ + ENDFOR host_modules +] +.PHONY: configure-target +configure-target: [+ + FOR target_modules +] \ + maybe-configure-target-[+module+][+ + ENDFOR target_modules +] + +# The target built for a native non-bootstrap build. +.PHONY: all +all: +@if gcc-bootstrap + [ -f stage_final ] || echo stage3 > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) `cat stage_final`-bubble +@endif gcc-bootstrap + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ +@if gcc-bootstrap + if [ -f stage_last ]; then \ + TFLAGS="$(STAGE$(shell test ! -f stage_last || sed s,^stage,, stage_last)_TFLAGS)"; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \ + else \ +@endif gcc-bootstrap + $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target \ +@if gcc-bootstrap + ; \ + fi \ +@endif gcc-bootstrap + && : + +.PHONY: all-build +[+ FOR build_modules +] +all-build: maybe-all-build-[+module+][+ ENDFOR build_modules +] + +.PHONY: all-host +[+ FOR host_modules +][+ IF bootstrap +] +@if [+module+]-no-bootstrap[+ ENDIF bootstrap +] +all-host: maybe-all-[+module+][+ IF bootstrap +] +@endif [+module+]-no-bootstrap[+ ENDIF bootstrap +][+ ENDFOR host_modules +] + +.PHONY: all-target +[+ FOR target_modules +][+ IF bootstrap +] +@if target-[+module+]-no-bootstrap[+ ENDIF bootstrap +] +all-target: maybe-all-target-[+module+][+ IF bootstrap +] +@endif target-[+module+]-no-bootstrap[+ + ENDIF bootstrap +][+ ENDFOR target_modules +] + +# Do a target for all the subdirectories. A ``make do-X'' will do a +# ``make X'' in all subdirectories (because, in general, there is a +# dependency (below) of X upon do-X, a ``make X'' will also do this, +# but it may do additional work as well). +[+ FOR recursive_targets +] +.PHONY: do-[+make_target+] +do-[+make_target+]: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+make_target+]-host \ + [+make_target+]-target + + +.PHONY: [+make_target+]-host +[+ FOR host_modules +] +[+make_target+]-host: maybe-[+make_target+]-[+module+][+ ENDFOR host_modules +] + +.PHONY: [+make_target+]-target +[+ FOR target_modules +] +[+make_target+]-target: maybe-[+make_target+]-target-[+module+][+ ENDFOR target_modules +] +[+ ENDFOR recursive_targets +] + +# Here are the targets which correspond to the do-X targets. + +.PHONY: info installcheck dvi pdf html +.PHONY: install-info install-pdf install-html +.PHONY: clean distclean mostlyclean maintainer-clean realclean +.PHONY: local-clean local-distclean local-maintainer-clean +info: do-info +installcheck: do-installcheck +dvi: do-dvi +pdf: do-pdf +html: do-html + +# Make sure makeinfo is built before we do a `make info', if we're +# in fact building texinfo. +do-info: maybe-all-texinfo + +install-info: do-install-info dir.info + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + if [ -f dir.info ] ; then \ + $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \ + else true ; fi + +install-pdf: do-install-pdf + +install-html: do-install-html + +local-clean: + -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log + +local-distclean: + -rm -f Makefile config.status config.cache mh-frag mt-frag + -rm -f maybedep.tmp serdep.tmp + -if [ "$(TARGET_SUBDIR)" != "." ]; then \ + rm -rf $(TARGET_SUBDIR); \ + else true; fi + -rm -rf $(BUILD_SUBDIR) + -if [ "$(HOST_SUBDIR)" != "." ]; then \ + rm -rf $(HOST_SUBDIR); \ + else true; fi + -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile + -rm -f texinfo/doc/Makefile texinfo/po/POTFILES + -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null + -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null + -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null + -find . -name config.cache -exec rm -f {} \; \; 2>/dev/null + +local-maintainer-clean: + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +clean: do-clean local-clean +mostlyclean: do-mostlyclean local-clean +distclean: do-distclean local-clean local-distclean +maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean +maintainer-clean: local-distclean +realclean: maintainer-clean + +# Check target. + +.PHONY: check do-check +check: do-check + +# Only include modules actually being configured and built. +.PHONY: check-host +check-host: [+ + FOR host_modules +] \ + maybe-check-[+module+][+ + ENDFOR host_modules +] + +.PHONY: check-target +check-target: [+ + FOR target_modules +] \ + maybe-check-target-[+module+][+ + ENDFOR target_modules +] + +do-check: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) check-host check-target + +# Automated reporting of test results. + +warning.log: build.log + $(srcdir)/contrib/warn_summary build.log > $@ + +mail-report.log: + if test x'$(BOOT_CFLAGS)' != x''; then \ + BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ + fi; \ + $(srcdir)/contrib/test_summary -t >$@ + chmod +x $@ + echo If you really want to send e-mail, run ./$@ now + +mail-report-with-warnings.log: warning.log + if test x'$(BOOT_CFLAGS)' != x''; then \ + BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ + fi; \ + $(srcdir)/contrib/test_summary -t -i warning.log >$@ + chmod +x $@ + echo If you really want to send e-mail, run ./$@ now + +# Installation targets. + +.PHONY: install uninstall +install: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-host install-target + +.PHONY: install-host-nogcc +install-host-nogcc: [+ + FOR host_modules +][+ IF (not (= (get "module") "gcc")) +] \ + maybe-install-[+module+][+ ENDIF +][+ + ENDFOR host_modules +] + +.PHONY: install-host +install-host: [+ + FOR host_modules +] \ + maybe-install-[+module+][+ + ENDFOR host_modules +] + +.PHONY: install-target +install-target: [+ + FOR target_modules +] \ + maybe-install-target-[+module+][+ + ENDFOR target_modules +] + +uninstall: + @echo "the uninstall target is not supported in this tree" + +.PHONY: install.all +install.all: install-no-fixedincludes + @if [ -f ./gcc/Makefile ] ; then \ + r=`${PWD_COMMAND}` ; export r ; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd ./gcc && \ + $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \ + else \ + true ; \ + fi + +# install-no-fixedincludes is used because Cygnus can not distribute +# the fixed header files. +.PHONY: install-no-fixedincludes +install-no-fixedincludes: installdirs install-host-nogcc \ + install-target gcc-no-fixedincludes + +.PHONY: install-strip +install-strip: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-strip-host install-strip-target + +.PHONY: install-strip-host +install-strip-host: [+ + FOR host_modules +] \ + maybe-install-strip-[+module+][+ + ENDFOR host_modules +] + +.PHONY: install-strip-target +install-strip-target: [+ + FOR target_modules +] \ + maybe-install-strip-target-[+module+][+ + ENDFOR target_modules +] + + +### other supporting targets + +MAKEDIRS= \ + $(DESTDIR)$(prefix) \ + $(DESTDIR)$(exec_prefix) +.PHONY: installdirs +installdirs: mkinstalldirs + $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS) + +dir.info: do-install-info + if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \ + $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \ + mv -f dir.info.new dir.info ; \ + else true ; \ + fi + +dist: + @echo "Building a full distribution of this tree isn't done" + @echo "via 'make dist'. Check out the etc/ subdirectory" + +etags tags: TAGS + +# Right now this just builds TAGS in each subdirectory. emacs19 has the +# ability to use several tags files at once, so there is probably no need +# to combine them into one big TAGS file (like CVS 1.3 does). We could +# (if we felt like it) have this Makefile write a piece of elisp which +# the user could load to tell emacs19 where all the TAGS files we just +# built are. +TAGS: do-TAGS + +# ------------------------------------ +# Macros for configure and all targets +# ------------------------------------ + +[+ DEFINE configure +] +.PHONY: configure-[+prefix+][+module+] maybe-configure-[+prefix+][+module+] +maybe-configure-[+prefix+][+module+]: +@if gcc-bootstrap +configure-[+prefix+][+module+]: stage_current +@endif gcc-bootstrap +@if [+prefix+][+module+] +maybe-configure-[+prefix+][+module+]: configure-[+prefix+][+module+] +configure-[+prefix+][+module+]: [+ IF bootstrap +][+ ELSE +] + @: $(MAKE); $(unstage)[+ ENDIF bootstrap +] + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + [+ IF check_multilibs + +]echo "Checking multilib configuration for [+module+]..."; \ + $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \ + $(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null ; \ + if test -r [+subdir+]/[+module+]/multilib.out; then \ + if cmp -s [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; then \ + rm -f [+subdir+]/[+module+]/multilib.tmp; \ + else \ + rm -f [+subdir+]/[+module+]/Makefile; \ + mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \ + fi; \ + else \ + mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \ + fi; \ + [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \ + [+exports+] [+extra_exports+] \ + echo Configuring in [+subdir+]/[+module+]; \ + cd "[+subdir+]/[+module+]" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo [+subdir+]/[+module+]/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/[+module+]"; \ + libsrcdir="$$s/[+module+]"; \ + [+ IF no-config-site +]rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file [+ ENDIF +]$(SHELL) $${libsrcdir}/configure \ + [+args+] --build=${build_alias} --host=[+host_alias+] \ + --target=[+target_alias+] $${srcdiroption} [+extra_configure_flags+] \ + || exit 1 +@endif [+prefix+][+module+] + +[+ IF bootstrap +] +[+ FOR bootstrap_stage +] +.PHONY: configure-stage[+id+]-[+prefix+][+module+] maybe-configure-stage[+id+]-[+prefix+][+module+] +maybe-configure-stage[+id+]-[+prefix+][+module+]: +@if [+prefix+][+module+]-bootstrap +maybe-configure-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+] +configure-stage[+id+]-[+prefix+][+module+]: + @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start + @$(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE[+id+]_TFLAGS)"; \ + [+ IF check_multilibs + +]echo "Checking multilib configuration for [+module+]..."; \ + $(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null ; \ + if test -r [+subdir+]/[+module+]/multilib.out; then \ + if cmp -s [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; then \ + rm -f [+subdir+]/[+module+]/multilib.tmp; \ + else \ + rm -f [+subdir+]/[+module+]/Makefile; \ + mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \ + fi; \ + else \ + mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \ + fi; \ + [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \ + [+exports+][+ IF prev +] \ + [+poststage1_exports+][+ ENDIF prev +][+ IF prefix +] \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS;[+ ELSE prefix +] \ + CFLAGS="$(STAGE[+id+]_CFLAGS)"; export CFLAGS; \ + CXXFLAGS="$(STAGE[+id+]_CXXFLAGS)"; export CXXFLAGS;[+ IF prev +] \ + LIBCFLAGS="$(STAGE[+id+]_CFLAGS)"[+ ELSE prev +] \ + LIBCFLAGS="$(LIBCFLAGS)"[+ ENDIF prev +]; export LIBCFLAGS;[+ + ENDIF prefix +] [+extra_exports+] \ + echo Configuring stage [+id+] in [+subdir+]/[+module+] ; \ + $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \ + cd [+subdir+]/[+module+] || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo [+subdir+]/[+module+]/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/[+module+]"; \ + libsrcdir="$$s/[+module+]"; \ + $(SHELL) $${libsrcdir}/configure \ + [+args+] --build=${build_alias} --host=[+host_alias+] \ + --target=[+target_alias+] $${srcdiroption} [+ IF prev +]\ + --with-build-libsubdir=$(HOST_SUBDIR) [+ ENDIF prev +]\ + $(STAGE[+id+]_CONFIGURE_FLAGS)[+ IF extra_configure_flags +] \ + [+extra_configure_flags+][+ ENDIF extra_configure_flags +] +@endif [+prefix+][+module+]-bootstrap +[+ ENDFOR bootstrap_stage +] +[+ ENDIF bootstrap +] +[+ ENDDEF +] + +[+ DEFINE all +] +.PHONY: all-[+prefix+][+module+] maybe-all-[+prefix+][+module+] +maybe-all-[+prefix+][+module+]: +@if gcc-bootstrap +all-[+prefix+][+module+]: stage_current +@endif gcc-bootstrap +@if [+prefix+][+module+] +TARGET-[+prefix+][+module+]=[+ + IF all_target +][+all_target+][+ ELSE +]all[+ ENDIF all_target +] +maybe-all-[+prefix+][+module+]: all-[+prefix+][+module+] +all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELSE +] + @: $(MAKE); $(unstage)[+ ENDIF bootstrap +] + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + [+exports+] [+extra_exports+] \ + (cd [+subdir+]/[+module+] && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+extra_make_flags+] \ + $(TARGET-[+prefix+][+module+])) +@endif [+prefix+][+module+] + +[+ IF bootstrap +] +[+ FOR bootstrap_stage +] +.PHONY: all-stage[+id+]-[+prefix+][+module+] maybe-all-stage[+id+]-[+prefix+][+module+] +.PHONY: clean-stage[+id+]-[+prefix+][+module+] maybe-clean-stage[+id+]-[+prefix+][+module+] +maybe-all-stage[+id+]-[+prefix+][+module+]: +maybe-clean-stage[+id+]-[+prefix+][+module+]: +@if [+prefix+][+module+]-bootstrap +maybe-all-stage[+id+]-[+prefix+][+module+]: all-stage[+id+]-[+prefix+][+module+] +all-stage[+id+]: all-stage[+id+]-[+prefix+][+module+] +TARGET-stage[+id+]-[+prefix+][+module+] = $(TARGET-[+prefix+][+module+]) +all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+] + @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE[+id+]_TFLAGS)"; \ + [+exports+][+ IF prev +] \ + [+poststage1_exports+][+ ENDIF prev +] [+extra_exports+] \ + cd [+subdir+]/[+module+] && \ + $(MAKE) $(BASE_FLAGS_TO_PASS)[+ IF prefix +] \ + CFLAGS="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"[+ ELSE prefix +] \ + CFLAGS="$(STAGE[+id+]_CFLAGS)" \ + CXXFLAGS="$(STAGE[+id+]_CXXFLAGS)"[+ IF prev +] \ + LIBCFLAGS="$(STAGE[+id+]_CFLAGS)"[+ ELSE prev +] \ + LIBCFLAGS="$(LIBCFLAGS)"[+ ENDIF prev +][+ ENDIF prefix +] \ + CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ + CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ + LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ + [+args+] [+ + IF prev +][+poststage1_args+][+ ENDIF prev + +] [+extra_make_flags+] \ + TFLAGS="$(STAGE[+id+]_TFLAGS)" \ + $(TARGET-stage[+id+]-[+prefix+][+module+]) + +maybe-clean-stage[+id+]-[+prefix+][+module+]: clean-stage[+id+]-[+prefix+][+module+] +clean-stage[+id+]: clean-stage[+id+]-[+prefix+][+module+] +clean-stage[+id+]-[+prefix+][+module+]: + @if [ $(current_stage) = stage[+id+] ]; then \ + [ -f [+subdir+]/[+module+]/Makefile ] || exit 0; \ + else \ + [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] || exit 0; \ + $(MAKE) stage[+id+]-start; \ + fi; \ + cd [+subdir+]/[+module+] && \ + $(MAKE) [+args+] [+ IF prev +] \ + [+poststage1_args+] [+ ENDIF prev +] \ + [+extra_make_flags+] clean +@endif [+prefix+][+module+]-bootstrap + +[+ ENDFOR bootstrap_stage +] +[+ ENDIF bootstrap +] +[+ ENDDEF +] + +# -------------------------------------- +# Modules which run on the build machine +# -------------------------------------- +[+ FOR build_modules +] +[+ configure prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)" + host_alias=(get "host" "${build_alias}") + target_alias=(get "target" "${target_alias}") + args="$(BUILD_CONFIGARGS)" no-config-site=true +] + +[+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)" + args="$(EXTRA_BUILD_FLAGS)" +] +[+ ENDFOR build_module +] + +# -------------------------------------- +# Modules which run on the host machine +# -------------------------------------- +[+ FOR host_modules +] +[+ configure prefix="" subdir="$(HOST_SUBDIR)" + exports="$(HOST_EXPORTS)" + poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)" + host_alias=(get "host" "${host_alias}") + target_alias=(get "target" "${target_alias}") + args="$(HOST_CONFIGARGS)" +] + +[+ all prefix="" subdir="$(HOST_SUBDIR)" + exports="$(HOST_EXPORTS)" + poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)" + args="$(EXTRA_HOST_FLAGS)" + poststage1_args="$(POSTSTAGE1_FLAGS_TO_PASS)" +] + +.PHONY: check-[+module+] maybe-check-[+module+] +maybe-check-[+module+]: +@if [+module+] +maybe-check-[+module+]: check-[+module+] +[+ IF no_check +] +check-[+module+]: +[+ ELIF no_check_cross +] +# This module is only tested in a native toolchain. +check-[+module+]: + @: $(MAKE); $(unstage) + @if [ '$(host)' = '$(target)' ] ; then \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/[+module+] && \ + $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] check); \ + fi +[+ ELSE check +] +check-[+module+]: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/[+module+] && \ + $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] check) +[+ ENDIF no_check +] +@endif [+module+] + +.PHONY: install-[+module+] maybe-install-[+module+] +maybe-install-[+module+]: +@if [+module+] +maybe-install-[+module+]: install-[+module+] +[+ IF no_install +] +install-[+module+]: +[+ ELSE install +] +install-[+module+]: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/[+module+] && \ + $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install) +[+ ENDIF no_install +] +@endif [+module+] + +.PHONY: install-strip-[+module+] maybe-install-strip-[+module+] +maybe-install-strip-[+module+]: +@if [+module+] +maybe-install-strip-[+module+]: install-strip-[+module+] +[+ IF no_install +] +install-strip-[+module+]: +[+ ELSE install +] +install-strip-[+module+]: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/[+module+] && \ + $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install-strip) +[+ ENDIF no_install +] +@endif [+module+] + +# Other targets (info, dvi, pdf, etc.) +[+ FOR recursive_targets +] +.PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+] +maybe-[+make_target+]-[+module+]: +@if [+module+] +maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+] +[+ IF (match-value? = "missing" (get "make_target") ) +] +# [+module+] doesn't support [+make_target+]. +[+make_target+]-[+module+]: +[+ ELSE +] +[+make_target+]-[+module+]: [+ + FOR depend +]\ + [+depend+]-[+module+] [+ + ENDFOR depend +] + @[+ IF bootstrap +][+ ELSE +]: $(MAKE); $(unstage) + @[+ ENDIF bootstrap +][ -f ./[+module+]/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) [+extra_make_flags+]; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing [+make_target+] in [+module+]" ; \ + (cd $(HOST_SUBDIR)/[+module+] && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + [+make_target+]) \ + || exit 1 +[+ ENDIF +] +@endif [+module+] +[+ ENDFOR recursive_targets +] +[+ ENDFOR host_modules +] + +# --------------------------------------- +# Modules which run on the target machine +# --------------------------------------- +[+ FOR target_modules +] + +[+ IF raw_cxx +] +[+ configure prefix="target-" subdir="$(TARGET_SUBDIR)" + check_multilibs=true + exports="$(RAW_CXX_TARGET_EXPORTS)" + host_alias=(get "host" "${target_alias}") + target_alias=(get "target" "${target_alias}") + args="$(TARGET_CONFIGARGS)" no-config-site=true +] + +[+ all prefix="target-" subdir="$(TARGET_SUBDIR)" + exports="$(RAW_CXX_TARGET_EXPORTS)" + args="$(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'" +] +[+ ELSE +] +[+ configure prefix="target-" subdir="$(TARGET_SUBDIR)" + check_multilibs=true + exports="$(NORMAL_TARGET_EXPORTS)" + host_alias=(get "host" "${target_alias}") + target_alias=(get "target" "${target_alias}") + args="$(TARGET_CONFIGARGS)" no-config-site=true +] + +[+ all prefix="target-" subdir="$(TARGET_SUBDIR)" + exports="$(NORMAL_TARGET_EXPORTS)" + args="$(EXTRA_TARGET_FLAGS)" +] +[+ ENDIF +] + +.PHONY: check-target-[+module+] maybe-check-target-[+module+] +maybe-check-target-[+module+]: +@if target-[+module+] +maybe-check-target-[+module+]: check-target-[+module+] +[+ IF no_check +] +# Dummy target for uncheckable module. +check-target-[+module+]: +[+ ELSE check +] +check-target-[+module+]: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+ +IF raw_cxx +] + $(RAW_CXX_TARGET_EXPORTS) \[+ +ELSE normal_cxx +] + $(NORMAL_TARGET_EXPORTS) \[+ +ENDIF raw_cxx +] + (cd $(TARGET_SUBDIR)/[+module+] && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) [+ + IF raw_cxx + +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ + ENDIF raw_cxx + +] [+extra_make_flags+] check) +[+ ENDIF no_check +] +@endif target-[+module+] + +.PHONY: install-target-[+module+] maybe-install-target-[+module+] +maybe-install-target-[+module+]: +@if target-[+module+] +maybe-install-target-[+module+]: install-target-[+module+] +[+ IF no_install +] +# Dummy target for uninstallable. +install-target-[+module+]: +[+ ELSE install +] +install-target-[+module+]: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+ +IF raw_cxx +] + $(RAW_CXX_TARGET_EXPORTS) \[+ +ELSE normal_cxx +] + $(NORMAL_TARGET_EXPORTS) \[+ +ENDIF raw_cxx +] + (cd $(TARGET_SUBDIR)/[+module+] && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install) +[+ ENDIF no_install +] +@endif target-[+module+] + +.PHONY: install-strip-target-[+module+] maybe-install-strip-target-[+module+] +maybe-install-strip-target-[+module+]: +@if target-[+module+] +maybe-install-strip-target-[+module+]: install-strip-target-[+module+] +[+ IF no_install +] +# Dummy target for uninstallable. +install-strip-target-[+module+]: +[+ ELSE install +] +install-strip-target-[+module+]: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+ +IF raw_cxx +] + $(RAW_CXX_TARGET_EXPORTS) \[+ +ELSE normal_cxx +] + $(NORMAL_TARGET_EXPORTS) \[+ +ENDIF raw_cxx +] + (cd $(TARGET_SUBDIR)/[+module+] && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install-strip) +[+ ENDIF no_install +] +@endif target-[+module+] + +# Other targets (info, dvi, pdf, etc.) +[+ FOR recursive_targets +] +.PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+] +maybe-[+make_target+]-target-[+module+]: +@if target-[+module+] +maybe-[+make_target+]-target-[+module+]: [+make_target+]-target-[+module+] +[+ IF (match-value? = "missing" (get "make_target") ) +] +# [+module+] doesn't support [+make_target+]. +[+make_target+]-target-[+module+]: +[+ ELSE +] +[+make_target+]-target-[+module+]: [+ + FOR depend +]\ + [+depend+]-target-[+module+] [+ + ENDFOR depend +] + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+ +IF raw_cxx +] + $(RAW_CXX_TARGET_EXPORTS) \[+ +ELSE normal_cxx +] + $(NORMAL_TARGET_EXPORTS) \[+ +ENDIF raw_cxx +] + echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/[+module+] && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ + [+extra_make_flags+] [+make_target+]) \ + || exit 1 +[+ ENDIF +] +@endif target-[+module+] +[+ ENDFOR recursive_targets +] +[+ ENDFOR target_modules +] + +@if target-libmudflap +.PHONY: check-target-libmudflap-c++ +check-target-libmudflap-c++: + $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) c++frags.exp" check-target-libmudflap + +@endif target-libmudflap + +# ---------- +# GCC module +# ---------- + +@if gcc-no-bootstrap +.PHONY: cross +cross: all-build all-gas all-ld + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + echo "Building the C and C++ compiler"; \ + cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ + echo "Building runtime libraries"; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all +@endif gcc-no-bootstrap + +@if gcc +[+ FOR languages +] +.PHONY: check-gcc-[+language+] check-[+language+] +check-gcc-[+language+]: + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) [+gcc-check-target+]); +check-[+language+]: check-gcc-[+language+][+ FOR lib-check-target +] [+ lib-check-target +][+ ENDFOR lib-check-target +] +[+ ENDFOR languages +] + +# Install the gcc headers files, but not the fixed include files, +# which Cygnus is not allowed to distribute. This rule is very +# dependent on the workings of the gcc Makefile.in. +.PHONY: gcc-no-fixedincludes +gcc-no-fixedincludes: + @if [ -f ./gcc/Makefile ]; then \ + rm -rf gcc/tmp-include; \ + mv gcc/include gcc/tmp-include 2>/dev/null; \ + mkdir gcc/include; \ + cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \ + touch gcc/stmp-fixinc gcc/include/fixed; \ + rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ + $(HOST_EXPORTS) \ + (cd ./gcc && \ + $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ + rm -rf gcc/include; \ + mv gcc/tmp-include gcc/include 2>/dev/null; \ + else true; fi +@endif gcc + +# --------------------- +# GCC bootstrap support +# --------------------- + +# We track the current stage (the one in 'gcc') in the stage_current file. +# stage_last instead tracks the stage that was built last. These targets +# are dummy when toplevel bootstrap is not active. + +# While making host and target tools, symlinks to the final stage must be +# there, so $(unstage) should be run at various points. To avoid excessive +# recursive invocations of make, we "inline" them using a variable. These +# must be referenced as ": $(MAKE) ; $(unstage)" rather than "$(unstage)" +# to avoid warnings from the GNU Make job server. + +unstage = : +stage = : +current_stage = "" + +@if gcc-bootstrap +unstage = if [ -f stage_last ]; then [ -f stage_current ] || $(MAKE) `cat stage_last`-start || exit 1; else :; fi +stage = if [ -f stage_current ]; then $(MAKE) `cat stage_current`-end || exit 1; else :; fi +current_stage = "`cat stage_current 2> /dev/null`" +@endif gcc-bootstrap + +.PHONY: unstage stage +unstage: + @: $(MAKE); $(unstage) +stage: + @: $(MAKE); $(stage) + +# Disable commands for lean bootstrap. +LEAN = false + +# We name the build directories for the various stages "stage1-gcc", +# "stage2-gcc","stage3-gcc", etc. + +# Since the 'compare' process will fail (on debugging information) if any +# directory names are different, we need to link the gcc directory for +# the previous stage to a constant name ('prev-gcc'), and to make the name of +# the build directories constant as well. For the latter, we use naked names +# like 'gcc', because the scripts in that directory assume it. We use +# mv on platforms where symlinks to directories do not work or are not +# reliable. + +# 'touch' doesn't work right on some platforms. +STAMP = echo timestamp > + +# We only want to compare .o files, so set this! +objext = .o + +[+ FOR bootstrap-stage +] +.PHONY: stage[+id+]-start stage[+id+]-end + +stage[+id+]-start:: + @: $(MAKE); $(stage); \ + echo stage[+id+] > stage_current ; \ + echo stage[+id+] > stage_last; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)[+ + FOR host_modules +][+ IF bootstrap +] +@if [+ module +] + @cd $(HOST_SUBDIR); [ -d stage[+id+]-[+module+] ] || \ + mkdir stage[+id+]-[+module+]; \ + mv stage[+id+]-[+module+] [+module+] [+ IF prev +] ; \ + mv stage[+prev+]-[+module+] prev-[+module+] || test -f stage[+prev+]-lean [+ ENDIF prev +] +@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +] + @[ -d stage[+id+]-$(TARGET_SUBDIR) ] || \ + mkdir stage[+id+]-$(TARGET_SUBDIR); \ + mv stage[+id+]-$(TARGET_SUBDIR) $(TARGET_SUBDIR) [+ IF prev +] ; \ + mv stage[+prev+]-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stage[+prev+]-lean [+ ENDIF prev +] + +stage[+id+]-end:: [+ FOR host_modules +][+ IF bootstrap +] +@if [+ module +] + @if test -d $(HOST_SUBDIR)/[+module+] ; then \ + cd $(HOST_SUBDIR); mv [+module+] stage[+id+]-[+module+] [+ IF prev +]; \ + mv prev-[+module+] stage[+prev+]-[+module+] ; : [+ ENDIF prev +] ; \ + fi +@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +] + @if test -d $(TARGET_SUBDIR) ; then \ + mv $(TARGET_SUBDIR) stage[+id+]-$(TARGET_SUBDIR) [+ IF prev +] ; \ + mv prev-$(TARGET_SUBDIR) stage[+prev+]-$(TARGET_SUBDIR) ; : [+ ENDIF prev +] ; \ + fi + rm -f stage_current + +# Bubble a bug fix through all the stages up to stage [+id+]. They are +# remade, but not reconfigured. The next stage (if any) will not be +# reconfigured either. +.PHONY: stage[+id+]-bubble +stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +] + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + if test -f stage[+id+]-lean [+ + IF prev +]|| test -f stage[+prev+]-lean [+ ENDIF prev +] ; then \ + echo Skipping rebuild of stage[+id+] ; \ + else \ + $(MAKE) stage[+id+]-start; \[+IF lean +] + if $(LEAN); then \ + rm -rf stage[+lean+]-* ; \ + $(STAMP) stage[+lean+]-lean ; \ + fi; \[+ ENDIF lean +] + $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+]; \ + fi[+ IF compare-target +] + $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+compare-target+][+ ENDIF compare-target +] + +.PHONY: all-stage[+id+] clean-stage[+id+] +do-clean: clean-stage[+id+] + +# FIXME: Will not need to be conditional when toplevel bootstrap is the +# only possibility, but now it conflicts with no-bootstrap rules +@if gcc-bootstrap +[+ IF compare-target +] +[+compare-target+]: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + if test -f stage[+prev+]-lean; then \ + echo Cannot compare object files as stage [+prev+] was deleted. ; \ + exit 0 ; \ + fi; \ + : $(MAKE); $(stage); \ + rm -f .bad_compare ; \ + echo Comparing stages [+prev+] and [+id+] ; \ + sed=`echo stage[+id+] | sed 's,^stage,,;s,.,.,g'`; \ + files=`find stage[+id+]-* -name "*$(objext)" -print | \ + sed -n s,^stage$$sed-,,p` ; \ + for file in $${files} ; do \ + f1=$$r/stage[+prev+]-$$file; f2=$$r/stage[+id+]-$$file; \ + if test ! -f $$f1; then continue; fi; \ + $(do-[+compare-target+]) > /dev/null 2>&1; \ + if test $$? -eq 1; then \ + case $$file in \ + @compare_exclusions@) \ + echo warning: $$file differs ;; \ + *) \ + echo $$file differs >> .bad_compare ;; \ + esac ; \ + fi ; \ + done ; \ + if [ -f .bad_compare ]; then \ + echo "Bootstrap comparison failure!"; \ + cat .bad_compare; \ + exit 1; \ + else \ + echo Comparison successful.; \ + fi ; \ + $(STAMP) [+compare-target+][+ IF prev +] + if $(LEAN); then \ + rm -rf stage[+prev+]-*; \ + $(STAMP) stage[+prev+]-lean; \ + fi[+ ENDIF prev +] +[+ ENDIF compare-target +] + +[+ IF bootstrap-target +] +.PHONY: [+bootstrap-target+] [+bootstrap-target+]-lean +[+bootstrap-target+]: + echo stage[+id+] > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE[+id+]_TFLAGS)"; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target + +[+bootstrap-target+]-lean: + echo stage[+id+] > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) LEAN=: stage[+id+]-bubble + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE[+id+]_TFLAGS)"; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target +[+ ENDIF bootstrap-target +] + +# Rules to wipe a stage and all the following ones, also used for cleanstrap +[+ IF prev +]distclean-stage[+prev+]:: distclean-stage[+id+] [+ ENDIF prev +] +.PHONY: distclean-stage[+id+] +distclean-stage[+id+]:: + @: $(MAKE); $(stage) + @test "`cat stage_last`" != stage[+id+] || rm -f stage_last + rm -rf stage[+id+]-* [+ + IF compare-target +][+compare-target+] [+ ENDIF compare-target +] + +[+ IF cleanstrap-target +] +.PHONY: [+cleanstrap-target+] +[+cleanstrap-target+]: do-distclean local-clean + echo stage[+id+] > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + TFLAGS="$(STAGE[+id+]_TFLAGS)"; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target +[+ ENDIF cleanstrap-target +] +@endif gcc-bootstrap + +[+ ENDFOR bootstrap-stage +] + +stageprofile-end:: + $(MAKE) distclean-stagefeedback + +stagefeedback-start:: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + for i in prev-*; do \ + j=`echo $$i | sed s/^prev-//` ; \ + cd $$r/$$i && \ + { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../'$$j'/&",' | $(SHELL) ; } && \ + { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../'$$j'/&",' | $(SHELL) ; } ; \ + done + +@if gcc-bootstrap +do-distclean: distclean-stage1 + +# Provide a GCC build when we're building target libraries. This does +# not work as a dependency, just as the minimum necessary to avoid errors. +stage_last: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage1-bubble + +# Same as unstage, but not phony and defaulting to stage1-start. We place +# it in the dependency so that for example `make -j3 all-gcc' works. +stage_current: + @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi + +.PHONY: restrap +restrap:: + @: $(MAKE); $(stage) + rm -rf stage1-$(TARGET_SUBDIR)[+ FOR bootstrap-stage +][+ IF prev + +] stage[+id+]-*[+ ENDIF prev +][+ ENDFOR bootstrap-stage +] +restrap:: all +@endif gcc-bootstrap + +# -------------------------------------- +# Dependencies between different modules +# -------------------------------------- + +# Generic dependencies for target modules on host stuff, especially gcc +@if gcc-bootstrap[+ FOR target_modules +][+ IF bootstrap + +][+ FOR bootstrap_stage +] +configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-gcc[+ + ENDFOR +][+ ELSE bootstrap +] +configure-target-[+module+]: stage_last[+ + ENDIF bootstrap +][+ ENDFOR target_modules +] +@endif gcc-bootstrap + +@if gcc-no-bootstrap[+ FOR target_modules +] +configure-target-[+module+]: maybe-all-gcc[+ + ENDFOR target_modules +] +@endif gcc-no-bootstrap + + +# There are two types of dependencies here: 'hard' dependencies, where one +# module simply won't build without the other; and 'soft' dependencies, where +# if the depended-on module is missing, the depending module will do without +# or find a substitute somewhere (perhaps installed). Soft dependencies +# are made here to depend on a 'maybe-' target. If you're not sure, +# it's safer to use a soft dependency. + +[+ ;; These Scheme functions build the bulk of the dependencies. + ;; dep-target builds a string like "maybe-all-MODULE_KIND-gcc", + ;; where "maybe-" is only included if HARD is not true, and all-gcc + ;; is taken from VAR-NAME. + (define dep-target (lambda (module-kind var-name hard) + (string-append + (if hard "" "maybe-") + (dep-subtarget var-name) + module-kind + (dep-module var-name) + ))) + + ;; make-dep builds a dependency from the MODULE and ON AutoGen vars. + (define make-dep (lambda (module-kind on-kind) + (string-append + (dep-target module-kind "module" #t) ": " + (dep-target on-kind "on" (exist? "hard"))))) + + ;; dep-subtarget extracts everything up to the first dash in the given + ;; AutoGen variable, for example it extracts "all-" out of "all-gcc". + (define dep-subtarget (lambda (var-name) + (substring (get var-name) 0 (+ 1 (string-index (get var-name) #\-))))) + + ;; dep-module extracts everything up to the first dash in the given + ;; AutoGen variable, for example it extracts "gcc" out of "all-gcc". + (define dep-module (lambda (var-name) + (substring (get var-name) (+ 1 (string-index (get var-name) #\-))))) + + ;; dep-stage builds a string for the prefix of a bootstrap stage. + (define dep-stage (lambda () + (string-append + "stage" + (get "id") + "-"))) + + ;; dep-maybe is the same as the AutoGen expression "- hard 'maybe-'" + ;; but is written in Scheme. + (define dep-maybe (lambda () + (if (exist? "hard") "" "maybe-"))) + + ;; dep-kind returns "normal" if the dependency is on an "install" target, + ;; or if either module is not bootstrapped. It returns "bootstrap" for + ;; configure or build dependencies between bootstrapped modules; it returns + ;; "prebootstrap" for configure or build dependencies of bootstrapped + ;; modules on a build module (e.g. all-gcc on all-build-bison). All this + ;; is only necessary for host modules. + (define dep-kind (lambda () + (if (and (hash-ref boot-modules (dep-module "module")) + (=* (dep-module "on") "build-")) + "prebootstrap" + + (if (or (= (dep-subtarget "on") "install-") + (not (hash-ref boot-modules (dep-module "module"))) + (not (hash-ref boot-modules (dep-module "on")))) + "normal" + "bootstrap")))) + + ;; We now build the hash table that is used by dep-kind. + (define boot-modules (make-hash-table 113)) ++] + +[+ FOR host_modules +][+ + (if (exist? "bootstrap") + (hash-create-handle! boot-modules (get "module") #t)) + "" +][+ ENDFOR host_modules +] +[+ FOR target_modules +][+ + (if (exist? "bootstrap") + (hash-create-handle! boot-modules (string-append "target-" (get "module")) #t)) + "" +][+ ENDFOR target_modules +] + +# With all the machinery above in place, it is pretty easy to generate +# dependencies. Host dependencies are a bit more complex because we have +# to check for bootstrap/prebootstrap dependencies. To resolve +# prebootstrap dependencies, prebootstrap modules are gathered in +# a hash table. +[+ FOR dependencies +][+ (make-dep "" "") +] +[+ CASE (dep-kind) +] +[+ == "prebootstrap" + +][+ FOR bootstrap_stage +] +[+ (make-dep (dep-stage) "") +][+ + ENDFOR bootstrap_stage +] +[+ == "bootstrap" + +][+ FOR bootstrap_stage +] +[+ (make-dep (dep-stage) (dep-stage)) +][+ + ENDFOR bootstrap_stage +] +[+ ESAC +][+ +ENDFOR dependencies +] + +# Dependencies for target modules on other target modules are +# described by lang_env_dependencies; the defaults apply to anything +# not mentioned there. +[+ + ;; Predicate for whether LANG was specified in lang_env_dependencies. + (define lang-dep (lambda (lang) + (hash-ref lang-env-deps (string-append (get "module") "-" lang)))) + + ;; Build the hash table we will need. + (define lang-env-deps (make-hash-table 7)) ++][+ FOR lang_env_dependencies +][+ + (if (exist? "cxx") + (hash-create-handle! lang-env-deps + (string-append (get "module") "-" "cxx") #t)) + + (if (exist? "no_c") + (hash-create-handle! lang-env-deps + (string-append (get "module") "-" "no_c") #t)) + + (if (exist? "no_gcc") + (hash-create-handle! lang-env-deps + (string-append (get "module") "-" "no_gcc") #t)) + "" +][+ ENDFOR lang_env_dependencies +] + +@if gcc-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc")) + +][+ IF bootstrap +][+ FOR bootstrap_stage +] +configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-target-libgcc[+ + ENDFOR +][+ ENDIF bootstrap +][+ ENDIF +][+ ENDFOR target_modules +] +@endif gcc-bootstrap + +@if gcc-no-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc")) +] +configure-target-[+module+]: maybe-all-target-libgcc[+ + ENDIF +][+ ENDFOR target_modules +] +@endif gcc-no-bootstrap + +[+ FOR target_modules +][+ IF (not (lang-dep "no_c")) +] +configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss[+ + ENDIF +][+ IF (lang-dep "cxx") +] +configure-target-[+module+]: maybe-all-target-libstdc++-v3[+ + ENDIF +] +[+ ENDFOR target_modules +] + +CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@ +GDB_TK = @GDB_TK@ +INSTALL_GDB_TK = @INSTALL_GDB_TK@ +configure-gdb: $(CONFIGURE_GDB_TK) +all-gdb: $(gdbnlmrequirements) $(GDB_TK) +install-gdb: $(INSTALL_GDB_TK) + +# Serialization dependencies. Host configures don't work well in parallel to +# each other, due to contention over config.cache. Target configures and +# build configures are similar. +@serialization_dependencies@ + +# -------------------------------- +# Regenerating top level configury +# -------------------------------- + +# Rebuilding Makefile.in, using autogen. +AUTOGEN = autogen +$(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def + cd $(srcdir) && $(AUTOGEN) Makefile.def + +# Rebuilding Makefile. +Makefile: $(srcdir)/Makefile.in config.status + CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +config.status: configure + CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck + +# Rebuilding configure. +AUTOCONF = autoconf +$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 \ + $(srcdir)/config/override.m4 $(srcdir)/config/proginstall.m4 + cd $(srcdir) && $(AUTOCONF) + +# ------------------------------ +# Special directives to GNU Make +# ------------------------------ + +# Don't pass command-line variables to submakes. +.NOEXPORT: +MAKEOVERRIDES= + +# end of Makefile.in diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/README sdcc-3.2.0+dfsg/support/sdbinutils/README --- sdcc-3.1.0+dfsg/support/sdbinutils/README 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/README 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,47 @@ + README for GNU development tools + +This directory contains various GNU compilers, assemblers, linkers, +debuggers, etc., plus their support routines, definitions, and documentation. + +If you are receiving this as part of a GDB release, see the file gdb/README. +If with a binutils release, see binutils/README; if with a libg++ release, +see libg++/README, etc. That'll give you info about this +package -- supported targets, how to use it, how to report bugs, etc. + +It is now possible to automatically configure and build a variety of +tools with one command. To build all of the tools contained herein, +run the ``configure'' script here, e.g.: + + ./configure + make + +To install them (by default in /usr/local/bin, /usr/local/lib, etc), +then do: + make install + +(If the configure script can't determine your type of computer, give it +the name as an argument, for instance ``./configure sun4''. You can +use the script ``config.sub'' to test whether a name is recognized; if +it is, config.sub translates it to a triplet specifying CPU, vendor, +and OS.) + +If you have more than one compiler on your system, it is often best to +explicitly set CC in the environment before running configure, and to +also set CC when running make. For example (assuming sh/bash/ksh): + + CC=gcc ./configure + make + +A similar example using csh: + + setenv CC gcc + ./configure + make + +Much of the code and documentation enclosed is copyright by +the Free Software Foundation, Inc. See the file COPYING or +COPYING.LIB in the various directories, for a description of the +GNU General Public License terms under which you can copy the files. + +REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info +on where and how to report problems. diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/README-maintainer-mode sdcc-3.2.0+dfsg/support/sdbinutils/README-maintainer-mode --- sdcc-3.1.0+dfsg/support/sdbinutils/README-maintainer-mode 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/README-maintainer-mode 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,25 @@ + + Notes on enabling maintainer mode + +Note that if you configure with --enable-maintainer-mode, you will need +special versions of automake, autoconf, libtool and gettext. You will +find the sources for these in the respective upstream directories: + + ftp://ftp.gnu.org/gnu/autoconf + ftp://ftp.gnu.org/gnu/automake + ftp://ftp.gnu.org/gnu/libtool + ftp://ftp.gnu.org/gnu/gettext + +The required versions of the tools for this tree are + autoconf 2.64 + automake 1.11 + libtool 2.2.6 + gettext 0.14.5 + +Note - "make distclean" does not work with maintainer mode enabled. +The Makefiles in the some of the po/ subdirectories depend upon the +Makefiles in their parent directories, and distclean will delete the +Makefiles in the parent directories before running the Makefiles in +the child directories. There is no easy way around this (short of +changing the automake macros) as these dependencies need to exist in +order to correctly build the NLS files. diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/bfd/COPYING sdcc-3.2.0+dfsg/support/sdbinutils/bfd/COPYING --- sdcc-3.1.0+dfsg/support/sdbinutils/bfd/COPYING 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/bfd/COPYING 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + 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 +them 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. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. 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. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey 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; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If 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 convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU 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. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + 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. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +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. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + 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. + + 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 +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program 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. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU 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 Lesser General +Public License instead of this License. But first, please read +. diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog --- sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,2702 @@ +2011-11-21 Tristan Gingold + + * configure.in: Bump version to 2.22 + * Makefile.am (RELEASE): Set. + * configure, Makefile.in: Regenerate. + +2011-11-15 Maxim Kuvyrkov + + Backport from mainline: + + 2011-11-14 Maxim Kuvyrkov + * elfxx-mips.c (mips_n64_exe_plt0_entry): Use 64-bit move. + +2011-11-15 Alan Modra + Andreas Tobler + + * elflink.c (_bfd_elf_create_got_section): Replace + bfd_make_section_with_flags with bfd_make_section_anyway_with_flags. + (_bfd_elf_link_create_dynamic_sections): Likewise. + * elf32-ppc.c (ppc_elf_create_glink): Likewise. + (ppc_elf_create_dynamic_sections): Likewise. + +2011-11-09 Alan Modra + + * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Mark syms in + executables when export_dynamic. + +2011-11-08 Alan Modra + + * elf64-ppc.c (struct ppc64_elf_obj_tdata): Rename + ha_relocs_not_using_r2 to unexpected_toc_insn. + (ok_lo_toc_insn): New function. + (ppc64_elf_edit_toc): Check insn on lo toc reloc. Emit warning. + (ppc64_elf_relocate_section): Don't check insn on lo toc reloc here. + Handle addic on lo toc reloc. + +2011-10-25 Alan Modra + + Apply mainline patches + 2011-10-20 Alan Modra + * elf32-i386.c (i386_opcode16): Delete. + (elf_i386_check_tls_transition): Use memcmp to compare contents. + * elf64-x86-64.c (x86_64_opcode16, x86_64_opcode32): Delete. + (elf_x86_64_check_tls_transition): Use memcmp to compare contents. + + 2011-10-19 Alan Modra + PR ld/13311 + * elflink.c (elf_link_output_extsym): Correct test for warning when + forced local executable syms are referenced from shared libraries. + + 2011-10-19 Alan Modra + PR ld/13254 + * elflink.c (bfd_elf_final_link): Emit error_textrel error. + + 2011-10-17 Alan Modra + PR ld/12975 + PR ld/13195 + * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Apply 2011-09-15 + and 2011-09-29 bfd_elf_gc_mark_dynamic_ref_symbol changes here too. + + 2011-10-11 Alan Modra + PR binutils/13278 + * archive.c (bfd_generic_archive_p): Only check first element + when target_defaulted. + (_bfd_construct_extended_name_table): Use ar_maxnamelen. + (_bfd_archive_bsd44_construct_extended_name_table): Likewise. + + 2011-10-11 Alan Modra + PR binutils/13257 + * archive.c (_bfd_find_nested_archive, _bfd_get_elt_at_filepos): Open + thin archive element using container target if not defaulted. + + 2011-10-10 Alan Modra + * elf64-ppc.c (ppc64_elf_howto_table): Add R_PPC64_TOCSAVE entry. + (struct ppc_link_hash_table): Add tocsave_htab. + (struct tocsave_entry): New. + (tocsave_htab_hash, tocsave_htab_eq, tocsave_find): New functions. + (ppc64_elf_link_hash_table_create): Create tocsave_htab.. + (ppc64_elf_link_hash_table_free): ..and delete it. + (build_plt_stub): Always put STD_R2_40R1 first. + (ppc64_elf_size_stubs): Check for R_PPC64_TOCSAVE following reloc + on plt call. If present add prologue nop location to tocsave_htab. + (ppc64_elf_relocate_section): Convert prologue nop to std. Skip + first insn of plt call stub when R_PPC64_TOCSAVE present. + + 2011-10-08 H.J. Lu + PR ld/13250 + * elflink.c (elf_link_add_object_symbols): Preserve the maximum + alignment and size for common symbols. + + 2011-10-08 Alan Modra + PR ld/13229 + PR ld/13244 + * elflink.c (elf_link_add_object_symbols): Don't make IR symbols + dynamic. + + 2011-10-08 Alan Modra + * elflink.c (elf_link_output_extsym): Strip defined plugin symbols + even when strip_discarded is false. + + 2011-09-30 Alan Modra + PR ld/13235 + * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add ha_relocs_not_using_r2. + (ppc64_elf_edit_toc): Check HA relocs. + (ha_reloc_match): Delete function. + (ppc64_elf_relocate_section): Remove delayed HA nop optimization. + Instead do it and low part optimization based on + ha_relocs_not_using_r2. + +2011-10-18 David S. Miller + + PR binutils/13301 + * elfxx-sparc.c (sparc_elf_find_reloc_at_ofs): New function. + (_bfd_sparc_elf_relocate_section): Always move the __tls_get_addr + call delay slot instruction forward 4 bytes when performing + relaxation. + +2011-10-18 H.J. Lu + + PR ld/13177 + * elflink.c (elf_gc_sweep_symbol): Don't hide symbols without PLT + nor GOT references. + +2011-10-14 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_gc_sweep_hook) + : Fix missing update of gotplt refcount for + global symbols. + : New cases for similar missing + updates of the plt refcount. + (elf_cris_adjust_gotplt_to_got): Assert integrity of the gotplt + refcount in relation to the plt refcount. + +2011-10-13 Richard Sandiford + + * elf32-arm.c (elf32_arm_final_link_relocate): Mark PLT calls via + stubs as resolved. + +2011-09-29 H.J. Lu + + PR ld/13195 + * elflink.c (_bfd_elf_merge_symbol): Don't set dynamic_def when + clearing def_dynamic. + (elf_link_add_object_symbols): Likewise. Set dynamic_def when + setting def_dynamic. + (bfd_elf_gc_mark_dynamic_ref_symbol): Check if a symbol is + versioned. + +2011-09-29 Alan Modra + + PR ld/13233 + * elflink.c (_bfd_elf_gc_mark_extra_sections): Mark single member + debug and special section groups. + +2011-09-26 Tristan Gingold + + * configure.in: Bump version to 2.21.90 + * configure: Regenerate. + +2011-09-21 David S. Miller + + * elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): New. + * elfxx-sparc.h: Declare it. + * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Call it. + * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise. + +2011-09-21 Tristan Gingold + + * mach-o.c (bfd_mach_o_convert_section_name_to_bfd): Add comment. + Deals with size limited strings. + (bfd_mach_o_build_commands): Initialize more fields. + +2011-09-15 H.J. Lu + + PR ld/13177 + * elflink.c (elf_gc_sweep_symbol): Also hide symbols without PLT + nor GOT references. + +2011-09-15 H.J. Lu + + PR ld/12975 + * bfd-in.h (bfd_elf_size_dynamic_sections): Remove pointer + to struct bfd_elf_version_tree. + + * elflink.c (elf_info_failed): Remove verdefs. + (_bfd_elf_export_symbol): Updated. + _bfd_elf_link_assign_sym_version): Likewise. + (bfd_elf_size_dynamic_sections): Remove pointer to struct + bfd_elf_version_tree. Updated. + (bfd_elf_gc_mark_dynamic_ref_symbol): Check if a symbol is hidden + by linker script. + + * linker.c (bfd_hide_sym_by_version): New. + + * bfd-in2.h: Regenerated. + +2011-09-12 H.J. Lu + + PR ld/13178 + * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Use .got.plt + if there are no GOT relocations. + +2011-09-09 Kai Tietz + + * peicode.h (pe_ILF_build_a_bfd): Don't remove leading underscore + for targets without symbol_leading_char. + +2011-09-08 Bernd Jendrissek + + * bfdwin.c (bfd_get_file_window): Fix memory leak. + +2011-09-07 Alan Modra + + PR ld/13131 + * bfd/elf64-ppc.c (adjust_toc_syms): Ensure ppc64_elf_howto_table + is initialized. + +2011-09-06 Alan Modra + + PR ld/13131 + * elf64-ppc.c (adjust_toc_syms): Delete redundant code. + (ppc64_elf_edit_toc): Fix style nit. Report some details + on linker failure due to reference in debug or non-alloc + sections to optimized away toc entry, and don't abort. + +2011-09-01 Christophe Lyon + + * elf32-arm.c (elf32_arm_output_arch_local_syms): Skip excluded + sections. + +2011-08-26 Nick Clifton + + * po/es.po: Updated Spanish translation. + +2011-08-19 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_toc): Ignore can_optimize bit if + we haven't seen expected -mcmodel=medium/large code relocs. + +2011-08-18 Tristan Gingold + + * mach-o.c (bfd_mach_o_read_segment): Initialize list. + +2011-08-17 Tristan Gingold + + * mach-o.c (bfd_mach_o_write_section_32): Fix typo. + +2011-08-17 Alan Modra + + PR ld/12762 + * bfd-in.h (struct bfd_section_already_linked): Forward declare. + (_bfd_handle_already_linked): Declare. + * coff-alpha.c (_bfd_ecoff_section_already_linked): Define as + _bfd_coff_section_already_linked. + * coff-mips.c (_bfd_ecoff_section_already_linked): Likewise. + * coffcode.h (coff_section_already_linked): Likewise. + * cofflink.c (coff_link_add_symbols): Revert 2011-07-09 changes. + * elf-bfd.h: Likewise. + * libbfd-in.h: Likewise. + * targets.c: Likewise. + * linker.c (bfd_section_already_linked): Likewise. + (bfd_section_already_linked_table_lookup): Likewise. + (bfd_section_already_linked_table_insert): Likewise. + (_bfd_generic_section_already_linked): Likewise. Call + _bfd_handle_already_linked. + (_bfd_handle_already_linked): New function, split out from.. + * elflink.c (_bfd_elf_section_already_linked): ..here. Revert + 2011-07-09 changes. Avoid unnecessary strcmp when matching + already_linked_list entries. Match plugin linkonce section. + (section_signature): Delete. + * coffgen.c (_bfd_coff_section_already_linked): New function. + * libcoff-in.h (_bfd_coff_section_already_linked): Declare. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + * bfd-in2.h: Regenerate. + +2011-08-14 Alan Modra + + * elf32-ppc.c (ppc_elf_select_plt_layout): Force bss-plt when + shared and call to _mcount will go via plt. + +2011-08-14 Alan Modra + + * elf64-ppc.c: Prefix all einfo error strings with "%P: ". + * elf32-ppc.c: Likewise. + (ppc_elf_select_plt_layout): Use einfo rather than info to report + forced bss-plt. + +2011-08-12 H.J. Lu + + PR ld/13082 + * elf64-x86-64.c (x86_64_elf_howto_table): Add R_X86_64_RELATIVE64. + (elf_x86_64_relocate_section): Treat R_X86_64_64 like R_X86_64_32 + and zero-extend it to 64bit if addend is zero for x32. Generate + R_X86_64_RELATIVE64 for x32. + +2011-08-09 Matthew Gretton-Dann + + * bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype. + * bfd-in2.h (bfd_elf32_arm_set_target_relocs): Likewise. + * elf32-arm.c (elf32_arm_link_hash_table): New field. + (elf232_arm_link_hash_table_create): Initialise new field. + (check_use_blx): Change test depending on fix_arm1176. + (bfd_elf32_arm_set_target_relocs): Set fix_arm1176 from + command line options. + +2011-08-08 Tristan Gingold + + * mach-o.c (struct mach_o_segment_name_xlat): Add comments. + (segsec_names_xlat): Reorder elements. + (bfd_mach_o_read_section_32): Fix typo. + (bfd_mach_o_read_section_64): Fix typo. + +2011-08-08 Tristan Gingold + + * mach-o.h (BFD_MACH_O_SEGNAME_SIZE): New macro. + (BFD_MACH_O_SECTNAME_SIZE): Ditto. + (bfd_mach_o_section): Use them. Add next field. + (bfd_mach_o_segment_command): Replace sections array by + sect_head and sect_tail. + (bfd_mach_o_get_mach_o_section): New macro. + (bfd_mach_o_lookup_section): Remove. + (bfd_mach_o_new_section_hook): New function. + * mach-o.c (bfd_mach_o_normalize_section_name): Use strncmp + instead of strcmp. + (bfd_mach_o_convert_section_name_to_bfd): Replaces section + parameter with segname and sectname parameters. Adjust. + (bfd_mach_o_append_section_to_segment): New function. Use a + linked list for Mach-O sections. + (bfd_mach_o_write_segment_32): Adjust. + (bfd_mach_o_write_segment_64): Ditto. + (bfd_mach_o_build_commands): Fix comment. Adjust. + (bfd_mach_o_flatten_sections): Adjust. + (bfd_mach_o_print_section_map): Adjust. + (bfd_mach_o_set_section_flags_from_bfd): Ditto. + (bfd_mach_o_new_section_hook): New function. + (bfd_mach_o_init_section_from_mach_o): Ditto. + (bfd_mach_o_read_section_32): Remove section parameter. + Return a section instead. + (bfd_mach_o_read_section_64): Ditto. + (bfd_mach_o_read_section): Ditto. + (bfd_mach_o_make_bfd_section): Adjust. + (bfd_mach_o_read_segment): Adjust for new profile of + bfd_mach_o_read_section. + (bfd_mach_o_lookup_section): Remove. + * mach-o-target.c (bfd_mach_o_new_section_hook): Remove. + +2011-08-08 Tristan Gingold + + * mach-o.h (bfd_mach_o_version_min_command): New structure. + (bfd_mach_o_load_command): Add version_min. + (mach_o_data_struct): Fix comment. + * mach-o.c (bfd_mach_o_read_version_min): New function. + (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_FUNCTION_STARTS, + BFD_MACH_O_LC_VERSION_MIN_MACOSX and + BFD_MACH_O_LC_VERSION_MIN_IPHONEOS. + (bfd_mach_o_get_name_or_null): New function. + (bfd_mach_o_get_name): Use the above new one. + (bfd_mach_o_load_command_name): Add the above new commands. + (bfd_mach_o_bfd_print_private_bfd_data): Display numerically + unknown commands. Handle BFD_MACH_O_LC_FUNCTION_STARTS, + BFD_MACH_O_LC_VERSION_MIN_MACOSX and + BFD_MACH_O_LC_VERSION_MIN_IPHONEOS. + +2011-08-08 Tristan Gingold + + * mach-o.h: Move size macros to external.h + Move reloc macros to reloc.h and x86-64.h. + * mach-o-i386.c: Includes mach-o/reloc.h + * mach-o-x86-64.c: Ditto and includes mach-o/x86-64.h + * mach-o.c: Add includes. + (bfd_mach_o_write_header): Use structure from external.h to convert. + (bfd_mach_o_write_thread): Ditto. + (bfd_mach_o_write_relocs): Ditto. + (bfd_mach_o_write_section_32): Ditto. + (bfd_mach_o_write_section_64): Ditto. + (bfd_mach_o_write_segment_32): Ditto. + (bfd_mach_o_write_segment_64): Ditto. + (bfd_mach_o_write_symtab): Ditto. + (bfd_mach_o_write_contents): Ditto. + (bfd_mach_o_read_header): Ditto. + (bfd_mach_o_read_section_32): Ditto. + (bfd_mach_o_read_section_64): Ditto. + (bfd_mach_o_read_symtab_symbol): Ditto. + (bfd_mach_o_read_dylinker): Ditto. + (bfd_mach_o_read_dylib): Ditto. + (bfd_mach_o_read_dysymtab): Ditto. + (bfd_mach_o_read_symtab): Ditto. + (bfd_mach_o_read_linkedit): Ditto. + (bfd_mach_o_read_str): Ditto. + (bfd_mach_o_read_dyld_info): Ditto. + (bfd_mach_o_read_segment): Ditto. + (bfd_mach_o_read_command): Ditto. + (bfd_mach_o_archive_p): Ditto. + (bfd_mach_o_canonicalize_one_reloc): Ditto. Change the BUF parameter. + (bfd_mach_o_canonicalize_relocs): Adjust to call the above function. + (bfd_mach_o_read_dysymtab_symbol): Rename BUF variable. + (bfd_mach_o_read_uuid): Remove useless cast. Use a macro instead + of an hard-coded value. + +2011-08-08 Tristan Gingold + + * mach-o-x86-64.c (bfd_mach_o_x86_64_mkobject): Fix cut-and-past typos. + (bfd_mach_o_x86_64_swap_reloc_out): Handle BFD_RELOC_32_PCREL, + BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64 and + BFD_RELOC_MACH_O_X86_64_GOT_LOAD. Share common code. + +2011-08-08 Tristan Gingold + + * mach-o.c (bfd_mach_o_normalize_section_name): New function. + (bfd_mach_o_convert_section_name_to_bfd): Use it. + (bfd_mach_o_get_section_type_from_name): New function. + (bfd_mach_o_get_section_attribute_from_name): Ditto. + * mach-o.h (bfd_mach_o_section): Move bfdsection field at the end. + Add comments. Add prototypes for the above new functions. + +2011-08-05 Mark Kettenis + + * netbsd-core.c (netbsd_core_vec): Init match_priority field. + +2011-08-05 Alan Modra + + * elf64-ppc.c (maybe_strip_output): New function. + (ppc64_elf_size_stubs): Use it to strip .branch_lt and .eh_frame. + +2011-08-05 Alan Modra + + PR ld/12762 + * elflink.c (_bfd_elf_section_already_linked): Return matched + status. Remove COFF comdat section handling. + * linker.c (_bfd_generic_section_already_linked): Return matched + status. Don't set SEC_GROUP in l_flags for plugin entries. + (bfd_section_already_linked): Update prototype. + * targets.c (_section_already_linked): Likewise. + * elf-bfd.h (_bfd_elf_section_already_linked): Likewise. + * libbfd-in.h (_bfd_generic_section_already_linked): Likewise. + (_bfd_nolink_section_already_linked): Update. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2011-08-05 Alan Modra + + * elf32-ppc.c: Include dwarf2.h. + (struct ppc_elf_link_hash_table): Add glink_eh_frame. + (ppc_elf_create_glink): Create .eh_frame section. + (glink_eh_frame_cie): New array. + (ppc_elf_size_dynamic_sections): Size glink_eh_frame. + (ppc_elf_finish_dynamic_sections): Write glink_eh_frame. + +2011-08-04 Tristan Gingold + + * vms-alpha.c (_bfd_vms_write_eeom): Round vms_linkage_index. + (_bfd_vms_write_etir): Initialize vms_linkage_index to 0. + +2011-08-03 Tristan Gingold + + * mach-o.c (bfd_mach_o_canonicalize_symtab): Handle no symbols case. + (bfd_mach_o_read_symtab_symbols): Return if no symbols. + +2011-08-02 Maciej W. Rozycki + + * elfxx-mips.c (check_4byte_branch): Remove function. + (check_relocated_bzc): New function. + (_bfd_mips_elf_relax_section): Permit the relaxation of LUI + instructions that immediately follow a compact branch + instruction. + +2011-08-02 Alan Modra + + * elf64-ppc.c (build_plt_stub): Correct emitted relocs when no + plt_static_chain. + (ppc_build_one_stub): Adjust get_relocs call to suit.. + (ppc_size_one_stub): ..and reloc sizing. Correct plt size corner case. + +2011-08-01 H.J. Lu + + PR ld/13048 + * archures.c (bfd_mach_i386_intel_syntax): New. + (bfd_mach_i386_i8086): Updated. + (bfd_mach_i386_i386): Likewise. + (bfd_mach_x86_64): Likewise. + (bfd_mach_x64_32): Likewise. + (bfd_mach_i386_i386_intel_syntax): Likewise. + (bfd_mach_x86_64_intel_syntax): Likewise. + (bfd_mach_x64_32_intel_syntax): Likewise. + (bfd_mach_l1om): Likewise. + (bfd_mach_l1om_intel_syntax): Likewise. + (bfd_mach_k1om): Likewise. + (bfd_mach_k1om_intel_syntax): Likewise. + + * bfd-in2.h: Regenerated. + + * cpu-i386.c (bfd_i386_compatible): Check mach instead of + bits_per_address. + (bfd_x64_32_arch_intel_syntax): Set bits_per_address to 64. + (bfd_x64_32_arch): Likewise. + + * elf64-x86-64.c: Include "libiberty.h". + (x86_64_elf_howto_table): Append x32 R_X86_64_32. + (elf_x86_64_rtype_to_howto): Support x32 R_X86_64_32. + (elf_x86_64_reloc_type_lookup): Likewise. + (elf_x86_64_reloc_name_lookup): Likewise. + (elf_x86_64_relocate_section): Likewise. + (elf_x86_64_check_relocs): Allow R_X86_64_64 relocations for x32. + +2011-07-29 Maciej W. Rozycki + + * elfxx-mips.c (check_br32): Fix return type. + +2011-07-29 Maciej W. Rozycki + + * elfxx-mips.c (bz_insn_16): Correct opcode mask. + +2011-07-29 Maciej W. Rozycki + + * elfxx-mips.c: Adjust comments throughout. + (mips_elf_relax_delete_bytes): Reshape code. + (_bfd_mips_elf_relax_section): Remove check for + R_MICROMIPS_GPREL16 relocations. Reshape code. + +2011-07-28 Roland McGrath + + * elf32-i386.c (NACL_PLT_ENTRY_SIZE, NACLMASK): New macros. + (elf_i386_nacl_plt0_entry): New variable. + (elf_i386_plt_entry): New variable. + (elf_i386_nacl_pic_plt0_entry): New variable. + (elf_i386_nacl_pic_plt_entry): New variable. + (elf_i386_nacl_plt, elf_i386_nacl_arch_bed): New variables. + (elf_backend_arch_data): New macro setting for elf_i386_nacl_vec stanza. + (elf_backend_plt_alignment): Likewise. + + * config.bfd: Handle i[3-7]86-*-nacl*. + * elf32-i386.c (bfd_elf32_i386_nacl_vec): New backend vector stanza. + * targets.c: Support bfd_elf32_i386_nacl_vec. + * configure.in: Likewise. + * configure: Regenerated. + + * elf32-i386.c (struct elf_i386_plt_layout): New type. + (GET_PLT_ENTRY_SIZE): New macro. + (elf_i386_plt): New variable. + (struct elf_i386_backend_data): New member `plt'. + (elf_i386_arch_bed): Add initializer for it. + (elf_i386_vxworks_arch_bed): Likewise. + (elf_i386_allocate_dynrelocs): Use GET_PLT_ENTRY_SIZE. + (elf_i386_plt_sym_val): Likewise. + (elf_i386_relocate_section): Likewise. + (elf_i386_finish_dynamic_symbol): Likewise. + Also use other elf_i386_plt_layout members for PLT details. + (elf_i386_finish_dynamic_sections): Likewise. + + * elf32-i386.c (struct elf_i386_backend_data): New type. + (get_elf_i386_backend_data): New macro. + (elf_i386_arch_bed): New variable. + (elf_backend_arch_data): New macro. + (struct elf_i386_link_hash_table): Remove plt0_pad_byte and is_vxworks. + (elf_i386_link_hash_table_create): Don't initialize them. + (elf_i386_create_dynamic_sections): Find is_vxworks flags in + elf_i386_backend_data, not elf_i386_link_hash_table. + (elf_i386_adjust_dynamic_symbol): Likewise. + (elf_i386_allocate_dynrelocs): Likewise. + (elf_i386_readonly_dynrelocs): Likewise. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. + (elf_i386_finish_dynamic_symbol): Likewise. + (elf_i386_finish_dynamic_sections): Likewise. Same for plt0_pad_byte. + (elf_i386_vxworks_link_hash_table_create): Function removed. + (elf_i386_vxworks_arch_bed): New variable. + (elf_backend_arch_data): New macro in elf32-i386-vxworks stanza. + + * elf-bfd.h (elf_backend_data): New member arch_backend_data. + * elfxx-target.h (elf_backend_arch_data): New macro. + (elfNN_bed): Use it as initializer for the new member. + +2011-07-28 Mikulas Patocka + + * elf64-hppa.c (elf_hppa_final_link_relocate): Fix handling of out + of range branches. + +2011-07-26 Jakub Jelinek + + * dwarf2.c (dwarf_debug_sections): Add .debug_macro + and .zdebug_macro entry. + (dwarf_debug_section_enum): Add debug_macro. + +2011-07-26 Alan Modra + + * elf64-ppc.c: Include dwarf2.h. + (struct ppc_link_hash_table): Add glink_eh_frame. + (create_linkage_sections): Create .eh_frame section. + (ppc64_elf_size_dynamic_sections): Arrange to drop unneeded + glink_eh_frame. + (glink_eh_frame_cie): New array. + (ppc64_elf_size_stubs): Size glink_eh_frame. + (ppc64_elf_build_stubs): Init glink_eh_frame contents. + (ppc64_elf_finish_dynamic_sections): Write glink_eh_frame. + +2011-07-25 Hans-Peter Nilsson + + PR ld/12815 + * elf64-mmix.c (struct _mmix_elf_section_data): New members + has_warned_bpo and has_warned_pushj. + (mmix_final_link_relocate): Remove PARAMS and PTR macros, + converting to ISO C. Add new parameter error_message. All + callers changed. + (mmix_elf_perform_relocation): Ditto. + : + Handle the case where mmix_elf_check_common_relocs has not been + called, missing preparations for relocs of the respective type. + +2011-07-24 Chao-ying Fu + Ilie Garbacea + Maciej W. Rozycki + Joseph Myers + Catherine Moore + Richard Sandiford + + * archures.c (bfd_mach_mips_micromips): New macro. + * cpu-mips.c (I_micromips): New enum value. + (arch_info_struct): Add bfd_mach_mips_micromips. + * elfxx-mips.h (_bfd_mips_elf_is_target_special_symbol): New + prototype. + (_bfd_mips_elf_relax_section): Likewise. + (_bfd_mips16_elf_reloc_unshuffle): Rename to... + (_bfd_mips_elf_reloc_unshuffle): ... this. Handle microMIPS + ASE. + (_bfd_mips16_elf_reloc_shuffle): Rename to... + (_bfd_mips_elf_reloc_shuffle): ... this. Handle microMIPS ASE. + (gprel16_reloc_p): Handle microMIPS ASE. + (literal_reloc_p): New function. + * elf32-mips.c (elf_micromips_howto_table_rel): New variable. + (_bfd_mips_elf32_gprel16_reloc): Handle microMIPS ASE. + (mips16_gprel_reloc): Update for _bfd_mips_elf_reloc_unshuffle + and _bfd_mips_elf_reloc_shuffle changes. + (mips_elf_gprel32_reloc): Update comment. + (micromips_reloc_map): New variable. + (bfd_elf32_bfd_reloc_type_lookup): Handle microMIPS ASE. + (mips_elf32_rtype_to_howto): Likewise. + (mips_info_to_howto_rel): Likewise. + (bfd_elf32_bfd_is_target_special_symbol): Define. + (bfd_elf32_bfd_relax_section): Likewise. + * elf64-mips.c (micromips_elf64_howto_table_rel): New variable. + (micromips_elf64_howto_table_rela): Likewise. + (mips16_gprel_reloc): Update for _bfd_mips_elf_reloc_unshuffle + and _bfd_mips_elf_reloc_shuffle changes. + (micromips_reloc_map): Likewise. + (bfd_elf64_bfd_reloc_type_lookup): Handle microMIPS ASE. + (bfd_elf64_bfd_reloc_name_lookup): Likewise. + (mips_elf64_rtype_to_howto): Likewise. + (bfd_elf64_bfd_is_target_special_symbol): Define. + * elfn32-mips.c (elf_micromips_howto_table_rel): New variable. + (elf_micromips_howto_table_rela): Likewise. + (mips16_gprel_reloc): Update for _bfd_mips_elf_reloc_unshuffle + and _bfd_mips_elf_reloc_shuffle changes. + (micromips_reloc_map): Likewise. + (bfd_elf32_bfd_reloc_type_lookup): Handle microMIPS ASE. + (bfd_elf32_bfd_reloc_name_lookup): Likewise. + (mips_elf_n32_rtype_to_howto): Likewise. + (bfd_elf32_bfd_is_target_special_symbol): Define. + * elfxx-mips.c (LA25_LUI_MICROMIPS_1): New macro. + (LA25_LUI_MICROMIPS_2): Likewise. + (LA25_J_MICROMIPS_1, LA25_J_MICROMIPS_2): Likewise. + (LA25_ADDIU_MICROMIPS_1, LA25_ADDIU_MICROMIPS_2): Likewise. + (TLS_RELOC_P): Handle microMIPS ASE. + (mips_elf_create_stub_symbol): Adjust value of stub symbol if + target is a microMIPS function. + (micromips_reloc_p): New function. + (micromips_reloc_shuffle_p): Likewise. + (got16_reloc_p, call16_reloc_p): Handle microMIPS ASE. + (got_disp_reloc_p, got_page_reloc_p): New functions. + (got_ofst_reloc_p): Likewise. + (got_hi16_reloc_p, got_lo16_reloc_p): Likewise. + (call_hi16_reloc_p, call_lo16_reloc_p): Likewise. + (hi16_reloc_p, lo16_reloc_p, jal_reloc_p): Handle microMIPS ASE. + (micromips_branch_reloc_p): New function. + (tls_gd_reloc_p, tls_ldm_reloc_p): Likewise. + (tls_gottprel_reloc_p): Likewise. + (_bfd_mips16_elf_reloc_unshuffle): Rename to... + (_bfd_mips_elf_reloc_unshuffle): ... this. Handle microMIPS + ASE. + (_bfd_mips16_elf_reloc_shuffle): Rename to... + (_bfd_mips_elf_reloc_shuffle): ... this. Handle microMIPS ASE. + (_bfd_mips_elf_lo16_reloc): Handle microMIPS ASE. + (mips_tls_got_index, mips_elf_got_page): Likewise. + (mips_elf_create_local_got_entry): Likewise. + (mips_elf_relocation_needs_la25_stub): Likewise. + (mips_elf_calculate_relocation): Likewise. + (mips_elf_perform_relocation): Likewise. + (_bfd_mips_elf_symbol_processing): Likewise. + (_bfd_mips_elf_add_symbol_hook): Likewise. + (_bfd_mips_elf_link_output_symbol_hook): Likewise. + (mips_elf_add_lo16_rel_addend): Likewise. + (_bfd_mips_elf_check_relocs): Likewise. + (mips_elf_adjust_addend): Likewise. + (_bfd_mips_elf_relocate_section): Likewise. + (mips_elf_create_la25_stub): Likewise. + (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. + (_bfd_mips_elf_gc_sweep_hook): Likewise. + (_bfd_mips_elf_is_target_special_symbol): New function. + (mips_elf_relax_delete_bytes): Likewise. + (opcode_descriptor): New structure. + (RA): New macro. + (OP32_SREG, OP32_TREG, OP16_VALID_REG): Likewise. + (b_insns_32, bc_insn_32, bz_insn_32, bzal_insn_32): New variables. + (beq_insn_32): Likewise. + (b_insn_16, bz_insn_16): New variables. + (BZC32_REG_FIELD): New macro. + (bz_rs_insns_32, bz_rt_insns_32): New variables. + (bzc_insns_32, bz_insns_16):Likewise. + (BZ16_REG, BZ16_REG_FIELD): New macros. + (jal_insn_32_bd16, jal_insn_32_bd32): New variables. + (jal_x_insn_32_bd32): Likewise. + (j_insn_32, jalr_insn_32): Likewise. + (ds_insns_32_bd16, ds_insns_32_bd32): Likewise. + (jalr_insn_16_bd16, jalr_insn_16_bd32, jr_insn_16): Likewise. + (JR16_REG): New macro. + (ds_insns_16_bd16): New variable. + (lui_insn): Likewise. + (addiu_insn, addiupc_insn): Likewise. + (ADDIUPC_REG_FIELD): New macro. + (MOVE32_RD, MOVE32_RS): Likewise. + (MOVE16_RD_FIELD, MOVE16_RS_FIELD): Likewise. + (move_insns_32, move_insns_16): New variables. + (nop_insn_32, nop_insn_16): Likewise. + (MATCH): New macro. + (find_match): New function. + (check_br16_dslot, check_br32_dslot): Likewise. + (check_br16, check_br32): Likewise. + (IS_BITSIZE): New macro. + (check_4byte_branch): New function. + (_bfd_mips_elf_relax_section): Likewise. + (_bfd_mips_elf_merge_private_bfd_data): Disallow linking MIPS16 + and microMIPS modules together. + (_bfd_mips_elf_print_private_bfd_data): Handle microMIPS ASE. + * reloc.c (BFD_RELOC_MICROMIPS_7_PCREL_S1): New relocation. + (BFD_RELOC_MICROMIPS_10_PCREL_S1): Likewise. + (BFD_RELOC_MICROMIPS_16_PCREL_S1): Likewise. + (BFD_RELOC_MICROMIPS_GPREL16): Likewise. + (BFD_RELOC_MICROMIPS_JMP, BFD_RELOC_MICROMIPS_HI16): Likewise. + (BFD_RELOC_MICROMIPS_HI16_S): Likewise. + (BFD_RELOC_MICROMIPS_LO16): Likewise. + (BFD_RELOC_MICROMIPS_LITERAL): Likewise. + (BFD_RELOC_MICROMIPS_GOT16): Likewise. + (BFD_RELOC_MICROMIPS_CALL16): Likewise. + (BFD_RELOC_MICROMIPS_GOT_HI16): Likewise. + (BFD_RELOC_MICROMIPS_GOT_LO16): Likewise. + (BFD_RELOC_MICROMIPS_CALL_HI16): Likewise. + (BFD_RELOC_MICROMIPS_CALL_LO16): Likewise. + (BFD_RELOC_MICROMIPS_SUB): Likewise. + (BFD_RELOC_MICROMIPS_GOT_PAGE): Likewise. + (BFD_RELOC_MICROMIPS_GOT_OFST): Likewise. + (BFD_RELOC_MICROMIPS_GOT_DISP): Likewise. + (BFD_RELOC_MICROMIPS_HIGHEST): Likewise. + (BFD_RELOC_MICROMIPS_HIGHER): Likewise. + (BFD_RELOC_MICROMIPS_SCN_DISP): Likewise. + (BFD_RELOC_MICROMIPS_JALR): Likewise. + (BFD_RELOC_MICROMIPS_TLS_GD): Likewise. + (BFD_RELOC_MICROMIPS_TLS_LDM): Likewise. + (BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16): Likewise. + (BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16): Likewise. + (BFD_RELOC_MICROMIPS_TLS_GOTTPREL): Likewise. + (BFD_RELOC_MICROMIPS_TLS_TPREL_HI16): Likewise. + (BFD_RELOC_MICROMIPS_TLS_TPREL_LO16): Likewise. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2011-07-22 H.J. Lu + + * Makefile.am (ALL_MACHINES): Add cpu-k1om.lo. + (ALL_MACHINES_CFILES): Add cpu-k1om.c. + * Makefile.in: Regenerated. + + * archures.c (bfd_architecture): Add bfd_arch_k1om. + (bfd_k1om_arch): New. + (bfd_archures_list): Add &bfd_k1om_arch. + * bfd-in2.h: Regenerated. + + * config.bfd (targ64_selvecs): Add bfd_elf64_k1om_vec if + bfd_elf64_x86_64_vec is supported. Add bfd_elf64_k1om_freebsd_vec + if bfd_elf64_x86_64_freebsd_vec is supported. + (targ_selvecs): Likewise. + + * configure.in: Support bfd_elf64_k1om_vec and + bfd_elf64_k1om_freebsd_vec. + * configure: Regenerated. + + * cpu-k1om.c: New. + + * elf64-x86-64.c (elf64_k1om_elf_object_p): New. + (bfd_elf64_k1om_vec): Likewise. + (bfd_elf64_k1om_freebsd_vec): Likewise. + + * targets.c (bfd_elf64_k1om_vec): New. + (bfd_elf64_k1om_freebsd_vec): Likewise. + (_bfd_target_vector): Add bfd_elf64_k1om_vec and + bfd_elf64_k1om_freebsd_vec. + +2011-07-20 Jan Kratochvil + + Fix false coff-go32-exe matches. + * coff-i386.c (TARGET_SYM) <_bfd_check_format>: Conditionally use + COFF_CHECK_FORMAT. + * coff-stgo32.c (go32_check_format): New forward declaration. + (COFF_CHECK_FORMAT): New defintion. + (go32_check_format): New function. + +2011-07-15 Alan Modra + + * configure.in: Bump version. + * configure: Regenerate. + +2011-07-14 Alan Modra + + * linker.c (_bfd_generic_section_already_linked): Set l_flags. + * elf-bfd.h (struct already_linked): Forward declare. + +2011-07-14 Alan Modra + + * elflink.c (_bfd_elf_fix_symbol_flags): Loop on indirect syms. + (_bfd_elf_adjust_dynamic_symbol): Remove FIXME. + +2011-07-14 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_table): Add plt_static_chain. + (build_plt_stub): Add plt_static_chain param, don't load r11 if false. + (build_tls_get_addr_stub): Likewise. + (ppc_build_one_stub): Update calls to above. + (ppc_size_one_stub): Adjust stub size. + (ppc64_elf_size_stubs): Add plt_static_chain param, save to htab. + * elf64-ppc.h (ppc64_elf_size_stubs): Update prototype. + +2011-07-12 Nick Clifton + + * elf32-arm.c (elf32_arm_section_flags): Delete. + (elf_backend_section_flags): Remove. + +2011-07-11 H.J. Lu + + PR ld/12982 + * elflink.c (bfd_elf_size_dynamic_sections): Also skip BFD_PLUGIN + when setting stack_flags. + +2011-07-11 Catherine Moore + + * aout-adobe.c (aout_32_bfd_lookup_section_flags): New definition. + * aout-target.h (MY_bfd_lookup_section_flags): New definition. + * aout-tic30.c (MY_bfd_lookup_section_flags): New definition. + * bfd-in2.h: Regenerated. + * bfd.c (bfd_lookup_section_flags): New definition. + * binary.c (binary_bfd_lookup_section_flags): New definition. + * bout.c (b_out_bfd_lookup_section_flags): New definition. + * coff-alpha.c (_bfd_ecoff_bfd_lookup_section_flags): New definition. + * coff-mips.c (_bfd_ecoff_bfd_lookup_section_flags): New definition. + * coff-rs6000.c (rs6000coff_vec): Include + bfd_generic_lookup_section_flags. + (pmac_xcoff_vec): Likewise. + * coffcode.h (coff_bfd_lookup_section_flags): New definition. + * coff64-rs6000.c (rs6000coff64_vec): Include + bfd_generic_lookup_section_flags. + (aix5coff64_vec): Likewise. + * ecoff.c (bfd_debug_section): Initialize flag_info field. + * elf-bfd.h (elf_backend_lookup_section_flags_hook): Declare. + (bfd_elf_lookup_section_flags): Declare. + * elflink.c (bfd_elf_lookup_section_flags): New function. + * elfxx-target.h (bfd_elfNN_bfd_lookup_section_flags): Define. + (elf_backend_lookup_section_flags_hook): Define. + (elf_backend_data): Add elf_backend_lookup_section_flags_hook. + * i386msdos.c (msdos_bfd_lookup_section_flags): New define. + * i386os9k.c (os9k_bfd_lookup_section_flags): New define. + * ieee.c (ieee_bfd_lookup_section_flags): New define. + * ihex.c (ihex_bfd_lookup_section_flags): New define. + * libbfd-in.h (_bfd_nolink_bfd_lookup_section_flags): Declare. + (bfd_generic_lookup_section_flags): Declare. + * libbfd.h: Regenerated. + * mach-o-target.c (bfd_mach_o_bfd_lookup_section_flags): New. + * mmo.c (mmo_bfd_lookup_section_flags): New definition. + * nlm-target.h (nlm_bfd_lookup_section_flags): New definition. + * oasys.c (oasys_bfd_lookup_section_flags): New definition. + * pef.c (bfd_pef_bfd_lookup_section_flags): New definition. + * plugin.c (bfd_plugin_bfd_lookup_section_flags): New definition. + * ppcboot.c (ppcboot_bfd_lookup_section_flags): New definition. + * reloc.c (bfd_generic_lookup_section_flags): New function. + * som.c (som_bfd_lookup_section_flags): New definition. + * srec.c (srec_bfd_lookup_section_flags): New definition. + * targets.c (flag_info): Declare. + (NAME##_bfd_lookup_section_flags): Add to LINK jump table. + (_bfd_lookup_section_flags): New. + * tekhex.c (tekhex_bfd_lookup_section_flags): New definition. + * versados.c (versados_bfd_lookup_section_flags): New definition. + * vms-alpha.c (alpha_vms_bfd_lookup_section_flag): New definition. + * xsym.c (bfd_sym_bfd_lookup_section_flags): New definition. + +2011-07-11 H.J. Lu + + PR ld/12978 + * elfnn-ia64.c (count_dyn_reloc): Fix a typo. + +2011-07-09 Alan Modra + + PR ld/12942 + * elflink.c (elf_link_add_object_symbols): Use elf_discarded_section + rather than kept_section to determine whether a symbol is from + a discarded section. + * cofflink.c (coff_link_add_symbols): Make symbols from discarded + sections appear undefined. + +2011-07-09 H.J. Lu + + PR ld/12942 + * elf-bfd.h (_bfd_elf_section_already_linked): Replace + "asection *" with "struct already_linked *". + * libbfd-in.h (_bfd_nolink_section_already_linked): Likewise. + (_bfd_generic_section_already_linked): Likewise. + (bfd_section_already_linked_table_insert): Likewise. + (struct already_linked): New. + (struct bfd_section_already_linked): Use it. + * elflink.c (_bfd_elf_section_already_linked): Replace. + "asection *" with "struct already_linked *". Replace the plugin + dummy with the LTO output. + * linker.c (_bfd_generic_section_already_linked): Likewise. + * targets.c (struct already_linked): Add forward declaration. + (bfd_target): Replace "struct bfd_section *" with + "struct already_linked *" in _section_already_linked. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2011-07-06 Tristan Gingold + + * mach-o.h: Move loader related definitions to + include/mach-o/loader.h. Include it. + +2011-07-05 H.J. Lu + + * elf64-x86-64.c (elf_backend_post_process_headers): Always + define to _bfd_elf_set_osabi. + +2011-07-03 Samuel Thibault + Thomas Schwinge + + PR binutils/12913 + * elf.c (_bfd_elf_set_osabi): Use ELFOSABI_GNU name instead of + ELFOSABI_LINUX alias. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf64-hppa.c: Likewise. + +2011-07-01 Ian Lance Taylor + + * elf32-i386.c (elf_i386_eh_frame_plt): Correct expression: change + DW_OP_lit3 to DW_OP_lit2. + +2011-07-01 Alan Modra + + * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Don't look at + dyn relocs when called to copy flags for a weak sym. + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. + (ppc64_elf_merge_private_bfd_data): Delete. + (bfd_elf64_bfd_merge_private_bfd_data): Define as + _bfd_generic_verify_endian_match. + +2011-06-30 Bernd Schmidt + + * bfd/elf32-tic6x.c (elf32_tic6x_set_osabi): Also set it if + link_info is NULL. + +2011-06-28 Tristan Gingold + + * vms-alpha.c (vms_private_data_struct): Make vms_linkage_index + unsigned int. + (_bfd_vms_write_etir): Write linkage index from reloc. + +2011-06-28 Fawzi Mohamed + + * mach-o.c (bfd_mach_o_read_command): Also ignore + BFD_MACH_O_LC_ROUTINES_64. + +2011-06-27 Tristan Gingold + + * vms-alpha.c (_bfd_vms_write_etir): Use 'section' to get current + section target index. + +2011-06-27 Nick Clifton + + * cisco-core.c (cisco_core_little_vec): Add initialization of + match_priority field. + +2011-06-27 Tristan Gingold + + * cache.c: Include bfd_stdint.h. + (cache_bmmap): Change profile. Return region start and size. + * bfdio.c (struct bfd_iovec): Change bmmap profile. + (bfd_mmap): Change profile and adjust. Update comment. + (memory_bmmap): Change profile. + * opncls.c (opncls_bmmap): Change profile. + * vms-lib.c (vms_lib_bmmap): Likewise. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2011-06-27 Tristan Gingold + + * vms-misc.c (vms_time_to_time_t): Adjust overflow detection. + Add comment. + +2011-06-25 H.J. Lu + + * elf64-x86-64.c (elf_backend_post_process_headers): Don't + define for FreeBSD/x86-64 nor FreeBSD/L1OM. Define for L1OM. + +2011-06-25 Jan Kratochvil + + * elf64-x86-64.c (elf_x86_64_link_hash_table_create): Initialize + PLT_EH_FRAME. + * elf32-i386.c (elf_i386_link_hash_table): Likewise. + +2011-06-24 Richard Henderson + + PR ld/12928 + * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Recover the + tlsgd insn before swapping adjacent insns. + +2011-06-24 Tristan Gingold + + * vms-alpha.c (alpha_vms_slurp_relocs): Add a guard for relocs in the + absolute section. + +2011-06-24 Alan Modra + + PR ld/12921 + * elf.c (assign_file_positions_for_load_sections): Don't align + sh_offset for all SHT_NOBITS sections here, just .tbss sections + that don't get a PT_LOAD. + +2011-06-22 Kaz Kojima + + * elf32-sh.c (sh_elf_relocate_section): Allow R_SH_TLS_LE_32 for PIE. + (sh_elf_check_relocs): Likewise. + +2011-06-22 Richard Henderson + + * elf64-alpha.c (elf64_alpha_check_relocs): No dynamic reloc for + TPREL in a PIE image. + (alpha_dynamic_entries_for_reloc): Likewise. + (elf64_alpha_relocate_section): Allow TPREL in PIE images. + (elf64_alpha_relax_got_load): Likewise. + +2011-06-22 Ramana Radhakrishnan + + * elf32-arm.c (elf32_arm_final_link_relocate): Allow R_ARM_TLS_LE32 + for PIE. + +2011-06-22 Alan Modra + + * elflink.c (_bfd_elf_merge_symbol): Allow type changes for + plugin symbols. Fix segfault on linker scrip defined syms. + +2011-06-20 Jakub Jelinek + + PR ld/12570 + * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Allow no relocations + at all for linker created .eh_frame sections. + (_bfd_elf_discard_section_eh_frame): Handle linker created + .eh_frame sections with no relocations. + * elf64-x86-64.c: Include dwarf2.h. + (elf_x86_64_eh_frame_plt): New variable. + (PLT_CIE_LENGTH, PLT_FDE_LENGTH, PLT_FDE_START_OFFSET, + PLT_FDE_LEN_OFFSET): Define. + (struct elf_x86_64_link_hash_table): Add plt_eh_frame field. + (elf_x86_64_create_dynamic_sections): Create and fill in + .eh_frame section for .plt section. + (elf_x86_64_size_dynamic_sections): Write .plt section size + into .eh_frame FDE covering .plt section. + (elf_x86_64_finish_dynamic_sections): Write .plt section + start into .eh_frame FDE covering .plt section. Call + _bfd_elf_write_section_eh_frame on htab->plt_eh_frame section. + (elf_backend_plt_alignment): Define to 4. + * elf32-i386.c: Include dwarf2.h. + (elf_i386_eh_frame_plt): New variable. + (PLT_CIE_LENGTH, PLT_FDE_LENGTH, PLT_FDE_START_OFFSET, + PLT_FDE_LEN_OFFSET): Define. + (struct elf_i386_link_hash_table): Add plt_eh_frame field. + (elf_i386_create_dynamic_sections): Create and fill in + .eh_frame section for .plt section. + (elf_i386_size_dynamic_sections): Write .plt section size + into .eh_frame FDE covering .plt section. + (elf_i386_finish_dynamic_sections): Write .plt section + start into .eh_frame FDE covering .plt section. Call + _bfd_elf_write_section_eh_frame on htab->plt_eh_frame section. + (elf_backend_plt_alignment): Define to 4. + +2011-06-19 H.J. Lu + + * elf64-x86-64.c (elf_backend_post_process_headers): Defined + for x32. + +2011-06-16 H.J. Lu + + * elf64-x86-64.c: Include and CORE_HEADER if + CORE_HEADER is defined. + (elf_x86_64_write_core_note): New. + (elf_backend_write_core_note): Likewise. + + * hosts/x86-64linux.h (uint64_t): New. + (user_regsx32_struct): Likewise. + (elf_gregx32_t): Likewise. + (ELF_NGREGX32): Likewise. + (elf_gregsetx32_t): Likewise. + (elf_prstatusx32): Likewise. + (prstatusx32_t): Likewise. + (user_fpregs32_struct): Removed. + (user_fpxregs32_struct): Likewise. + (user32): Likewise. + (elf_fpregset32_t): Likewise. + (elf_fpxregset32_t): Likewise. + (prgregset32_t): Likewise. + (prfpregset32_t): Likewise. + +2011-06-16 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_grok_prstatus): Support x32. + (elf_x86_64_grok_psinfo): Likewise. + +2011-06-16 Nick Clifton + + * elf.c (elf_find_function): Fail if not provided with a symbol + table. + +2011-06-15 Ulrich Weigand + + * elf-bfd.h (elfcore_write_arm_vfp): Add prototype. + * elf.c (elfcore_grok_arm_vfp): New function. + (elfcore_grok_note): Call it to handle NT_ARM_VFP notes. + (elfcore_write_arm_vfp): New function. + (elfcore_write_register_note): Call it to handle .reg-arm-vfp. + +2011-06-14 Richard Henderson + + * elf64-alpha.c (elf64_alpha_copy_indirect_symbol): Rename from + elf64_alpha_merge_ind_symbols; adjust for the generic interface. + (elf64_alpha_always_size_sections): Don't call + elf64_alpha_merge_ind_symbols. + (elf_backend_copy_indirect_symbol): New. + +2011-06-14 Alan Modra + + PR ld/12887 + * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Check sec_info_type + before doing anything. + (_bfd_elf_discard_section_eh_frame): Likewise. + +2011-06-14 Alan Modra + + * Makefile.am: Formatting. + * Makefile.in: Regenerate. + * configure.in (bfd_elf64_tilegx_vec): Add elfxx-tilegx.lo. + * po/SRC-POTFILES.in: Regnerate. + +2011-06-14 Alan Modra + + * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Don't use PTR. + (allocate_dynrelocs, readonly_dynrelocs): Replace PTR with void *. + Don't handle warning symbols here. + * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): As above. + (allocate_dynrelocs, readonly_dynrelocs): As above. + +2011-06-14 Alan Modra + + PR ld/12851 + * elflink.c (_bfd_elf_gc_mark_extra_sections): New function. + (elf_gc_sweep): Don't treat debug and sections like .comment + specially here. + (bfd_elf_gc_sections): Treat note sections as gc roots only when + not part of a group. Always call gc_mark_extra_sections. + * elf-bfd.h (_bfd_elf_gc_mark_extra_sections): Declare. + * elfxx-target.h (elf_backend_gc_mark_extra_sections): Default to + _bfd_elf_gc_mark_extra_sections. + * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Call + _bfd_elf_gc_mark_extra_sections. + * elf32-tic6x.c (elf32_tic6x_gc_mark_extra_sections): Likewise. + +2011-06-13 Nick Clifton + + * elf32-tilepro.c (tilepro_elf_check_relocs): Delete unused local + variable 'local_got_offsets'. + * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise. + (tilegx_finish_dyn): Delete unused local variable 'abi_64_p'. + +2011-06-13 Walter Lee + + * Makefile.am (ALL_MACHINES): Add cpu-tilegx.lo and cpu-tilepro.lo. + (ALL_MACHINE_CFILES): Add cpu-tilegx.c and cpu-tilepro.c. + (BFD32_BACKENDS): Add elf32-tilegx.lo, elf32-tilepro.lo, + and elfxx-tilegx.lo. + (BFD32_BACKENDS_CFILES): Add elf32-tilegx.c elf32-tilepro.c, and + elfxx-tilegx.c. + (BFD64_BACKENDS): Add elf64-tilegx.lo. + (BFD64_BACKENDS_CFILES): Add elf64-tilegx.c. + * Makefile.in: Regenerate. + * arctures.c (bfd_architecture): Define bfd_arch_tilepro, + bfd_arch_tilegx, bfd_mach_tilepro, bfd_mach_tilegx. + (bfd_arch_info): Add bfd_tilegx_arch, bfd_tilepro_arch. + (bfd_archures_list): Add bfd_tilegx_arch, bfd_tilepro_arch. + bfd-in2.h: Regenerate. + * config.bfd: Handle tilegx-*-* and tilepro-*-*. + * configure.in: Handle bfd_elf32_tilegx_vec, bfd_elf32_tilepro_vec, + and bfd_elf64_tilegx_vec. + * configure: Regenerate. + * elf-bfd.h (enum elf_target_id): Define TILEGX_ELF_DATA and + TILEPRO_ELF_DATA. + * libbfd.h: Regenerate. + * reloc.c: Add BFD_RELOC_TILEPRO_{COPY, GLOB_DAT, JMP_SLOT, + RELATIVE, BROFF_X1, JOFFLONG_X1, JOFFLONG_X1_PLT, IMM8_X0, + IMM8_Y0, IMM8_X1, IMM8_Y1, DEST_IMM8_X1, MT_IMM15_X1, MF_IMM15_X1, + IMM16_X0, IMM16_X1, IMM16_X0_LO, IMM16_X1_LO, IMM16_X0_HI, + IMM16_X1_HI, IMM16_X0_HA, IMM16_X1_HA, IMM16_X0_PCREL, + IMM16_X1_PCREL, IMM16_X0_LO_PCREL, IMM16_X1_LO_PCREL, + IMM16_X0_HI_PCREL, IMM16_X1_HI_PCREL, IMM16_X0_HA_PCREL, + IMM16_X1_HA_PCREL, IMM16_X0_GOT, IMM16_X1_GOT, IMM16_X0_GOT_LO, + IMM16_X1_GOT_LO, IMM16_X0_GOT_HI, IMM16_X1_GOT_HI, + IMM16_X0_GOT_HA, IMM16_X1_GOT_HA, MMSTART_X0, MMEND_X0, + MMSTART_X1, MMEND_X1, SHAMT_X0, SHAMT_X1, SHAMT_Y0, SHAMT_Y1, + IMM16_X0_TLS_GD, IMM16_X1_TLS_GD, IMM16_X0_TLS_GD_LO, + IMM16_X1_TLS_GD_LO, IMM16_X0_TLS_GD_HI, IMM16_X1_TLS_GD_HI, + IMM16_X0_TLS_GD_HA, IMM16_X1_TLS_GD_HA, IMM16_X0_TLS_IE, + IMM16_X1_TLS_IE, IMM16_X0_TLS_IE_LO, IMM16_X1_TLS_IE_LO, + IMM16_X0_TLS_IE_HI, IMM16_X1_TLS_IE_HI, IMM16_X0_TLS_IE_HA, + IMM16_X1_TLS_IE_HA, TLS_DTPMOD32, TLS_DTPOFF32, TLS_TPOFF32} + Add BFD_RELOC_TILEGX_{HW0, HW1, HW2, HW3, HW0_LAST, HW1_LAST, + HW2_LAST, COPY, GLOB_DAT, JMP_SLOT, RELATIVE, BROFF_X1, + JUMPOFF_X1, JUMPOFF_X1_PLT, IMM8_X0, IMM8_Y0, IMM8_X1, IMM8_Y1, + DEST_IMM8_X1, MT_IMM14_X1, MF_IMM14_X1, MMSTART_X0, MMEND_X0, + SHAMT_X0, SHAMT_X1, SHAMT_Y0, SHAMT_Y1, IMM16_X0_HW0, + IMM16_X1_HW0, IMM16_X0_HW1, IMM16_X1_HW1, IMM16_X0_HW2, + IMM16_X1_HW2, IMM16_X0_HW3, IMM16_X1_HW3, IMM16_X0_HW0_LAST, + IMM16_X1_HW0_LAST, IMM16_X0_HW1_LAST, IMM16_X1_HW1_LAST, + IMM16_X0_HW2_LAST, IMM16_X1_HW2_LAST, IMM16_X0_HW0_PCREL, + IMM16_X1_HW0_PCREL, IMM16_X0_HW1_PCREL, IMM16_X1_HW1_PCREL, + IMM16_X0_HW2_PCREL, IMM16_X1_HW2_PCREL, IMM16_X0_HW3_PCREL, + IMM16_X1_HW3_PCREL, IMM16_X0_HW0_LAST_PCREL, + IMM16_X1_HW0_LAST_PCREL, IMM16_X0_HW1_LAST_PCREL, + IMM16_X1_HW1_LAST_PCREL, IMM16_X0_HW2_LAST_PCREL, + IMM16_X1_HW2_LAST_PCREL, IMM16_X0_HW0_GOT, IMM16_X1_HW0_GOT, + IMM16_X0_HW1_GOT, IMM16_X1_HW1_GOT, IMM16_X0_HW2_GOT, + IMM16_X1_HW2_GOT, IMM16_X0_HW3_GOT, IMM16_X1_HW3_GOT, + IMM16_X0_HW0_LAST_GOT, IMM16_X1_HW0_LAST_GOT, + IMM16_X0_HW1_LAST_GOT, IMM16_X1_HW1_LAST_GOT, + IMM16_X0_HW2_LAST_GOT, IMM16_X1_HW2_LAST_GOT, IMM16_X0_HW0_TLS_GD, + IMM16_X1_HW0_TLS_GD, IMM16_X0_HW1_TLS_GD, IMM16_X1_HW1_TLS_GD, + IMM16_X0_HW2_TLS_GD, IMM16_X1_HW2_TLS_GD, IMM16_X0_HW3_TLS_GD, + IMM16_X1_HW3_TLS_GD, IMM16_X0_HW0_LAST_TLS_GD, + IMM16_X1_HW0_LAST_TLS_GD, IMM16_X0_HW1_LAST_TLS_GD, + IMM16_X1_HW1_LAST_TLS_GD, IMM16_X0_HW2_LAST_TLS_GD, + IMM16_X1_HW2_LAST_TLS_GD, IMM16_X0_HW0_TLS_IE, + IMM16_X1_HW0_TLS_IE, IMM16_X0_HW1_TLS_IE, IMM16_X1_HW1_TLS_IE, + IMM16_X0_HW2_TLS_IE, IMM16_X1_HW2_TLS_IE, IMM16_X0_HW3_TLS_IE, + IMM16_X1_HW3_TLS_IE, IMM16_X0_HW0_LAST_TLS_IE, + IMM16_X1_HW0_LAST_TLS_IE, IMM16_X0_HW1_LAST_TLS_IE, + IMM16_X1_HW1_LAST_TLS_IE, IMM16_X0_HW2_LAST_TLS_IE, + IMM16_X1_HW2_LAST_TLS_IE, TLS_DTPMOD64, TLS_DTPOFF64, TLS_TPOFF64, + TLS_DTPMOD32, TLS_DTPOFF32, TLS_TPOFF32} + * targets.c (bfd_elf32_tilegx_vec): Declare. + (bfd_elf32_tilepro_vec): Declare. + (bfd_elf64_tilegx_vec): Declare. + (bfd_target_vector): Add bfd_elf32_tilegx_vec, bfd_elf32_tilepro_vec, + and bfd_elf64_tilegx_vec. + * cpu-tilegx.c: New file. + * cpu-tilepro.c: New file. + * elf32-tilepro.h: New file. + * elf32-tilepro.c: New file. + * elf32-tilegx.c: New file. + * elf32-tilegx.h: New file. + * elf64-tilegx.c: New file. + * elf64-tilegx.h: New file. + * elfxx-tilegx.c: New file. + * elfxx-tilegx.h: New file. + +2011-06-13 Alan Modra + + * linker.c (bfd_link_hash_traverse): Follow warning symbol link. + (_bfd_generic_link_write_global_symbol, fix_syms): Don't handle + warning symbols here. + * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise. + * elf32-arm.c (allocate_dynrelocs_for_symbol, + elf32_arm_readonly_dynrelocs): Likewise. + * elf32-bfin.c (bfin_discard_copies): Likewise. + * elf32-cris.c (elf_cris_adjust_gotplt_to_got, + elf_cris_discard_excess_dso_dynamics, + elf_cris_discard_excess_program_dynamics): Likewise. + * elf32-hppa.c (allocate_plt_static, allocate_dynrelocs, + clobber_millicode_symbols, readonly_dynrelocs): Likewise. + * elf32-i370.c (i370_elf_adjust_dynindx): Likewise. + * elf32-i386.c (elf_i386_allocate_dynrelocs, + elf_i386_readonly_dynrelocs): Likewise. + * elf32-lm32.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. + * elf32-m32c.c (m32c_relax_plt_check, m32c_relax_plt_realloc): Likewise. + * elf32-m32r.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. + * elf32-m68k.c (elf_m68k_discard_copies): Likewise. + * elf32-microblaze.c (allocate_dynrelocs): Likewise. + * elf32-ppc.c (allocate_dynrelocs, maybe_set_textrel): Likewise. + * elf32-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. + * elf32-score.c (score_elf_sort_hash_table_f): Likewise. + * elf32-score7.c (score_elf_sort_hash_table_f): Likewise. + * elf32-sh.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. + * elf32-tic6x.c (elf32_tic6x_allocate_dynrelocs, + elf32_tic6x_readonly_dynrelocs): Likewise. + * elf32-vax.c (elf_vax_discard_copies): Likewise. + * elf32-xstormy16.c (xstormy16_relax_plt_check, + xstormy16_relax_plt_realloc): Likewise. + * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Likewise. + * elf64-alpha.c (elf64_alpha_output_extsym, + elf64_alpha_calc_got_offsets_for_symbol, + elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_1): Likewise. + * elf64-hppa.c (elf64_hppa_mark_exported_functions, + allocate_global_data_opd, elf64_hppa_mark_milli_and_exported_functions, + elf_hppa_unmark_useless_dynamic_symbols, + elf_hppa_remark_useless_dynamic_symbols): Likewise. + * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref, func_desc_adjust, + adjust_opd_syms, adjust_toc_syms, allocate_dynrelocs, + readonly_dynrelocs, merge_global_got, reallocate_got, + undo_symbol_twiddle): Likewise. + * elf64-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. + * elf64-sh64.c (sh64_elf64_discard_copies): Likewise. + * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs, + elf_x86_64_readonly_dynrelocs): Likewise. + * elflink.c (elf_link_renumber_hash_table_dynsyms, + elf_link_renumber_local_hash_table_dynsyms, _bfd_elf_export_symbol, + _bfd_elf_link_find_version_dependencies, + _bfd_elf_link_assign_sym_version, _bfd_elf_adjust_dynamic_symbol, + _bfd_elf_link_sec_merge_syms, elf_adjust_dynstr_offsets, + elf_collect_hash_codes, elf_collect_gnu_hash_codes, + elf_renumber_gnu_hash_syms, elf_gc_sweep_symbol, + elf_gc_propagate_vtable_entries_used, + elf_gc_smash_unused_vtentry_relocs, bfd_elf_gc_mark_dynamic_ref_symbol, + elf_gc_allocate_got_offsets): Likewise. + * elfnn-ia64.c (elfNN_ia64_global_dyn_info_free, + elfNN_ia64_global_dyn_sym_thunk): Likewise. + * elfxx-mips.c (mips_elf_check_symbols, mips_elf_output_extsym, + mips_elf_sort_hash_table_f, allocate_dynrelocs): Likewise. + * elfxx-sparc.c (allocate_dynrelocs, readonly_dynrelocs): Likewise. + * i386linux.c (linux_tally_symbols): Likewise. + * m68klinux.c (linux_tally_symbols): Likewise. + * sparclinux.c (linux_tally_symbols): Likewise. + * sunos.c (sunos_scan_dynamic_symbol): Likewise. + * xcofflink.c (xcoff_post_gc_symbol): Likewise. + + * elflink.c (elf_link_output_extsym): Make it a bfd_hash_traverse + function. Update all callers. + * aoutx.h (aout_link_write_other_symbol): Likewise. + * pdp11.c (aout_link_write_other_symbol): Likewise. + * cofflink.c (_bfd_coff_write_global_sym): Likewise. + * ecoff.c (ecoff_link_write_external): Likewise. + * xcofflink.c (xcoff_write_global_symbol): Likewise. + * vms-alpha.c (alpha_vms_link_output_symbol): Likewise. Handle + warning symbols. + * ecoff.c (ecoff_link_hash_traverse): Delete. + * coff-ppc.c (ppc_bfd_coff_final_link): Use bfd_hash_traverse for + _bfd_coff_write_global_sym. + * libcoff-in.h (_bfd_coff_write_global_sym): Update prototype. + * libcoff.h: Regenerate. + +2011-06-10 Nick Clifton + + * elflink.c (_bfd_elf_link_create_dynamic_sections): If the + backend does not provide a function for creating dynamic sections + then fail. + (bfd_elf_final_link): Issue a warning message if a dynamic section + has the SHT_NOTE type. + (bfd_elf_final_link): Do not look for dynamic strings in a section + that does not have the SHT_STRTAB type or the name .dynstr. + * elf32-arm.c (elf32_arm_finish_dynamic_sections): Fail if the got + section is not in the output binary. + * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Likewise. + +2011-06-09 Tristan Gingold + + * elfnn-ia64.c (elfNN_ia64_relax_section, elfNN_ia64_choose_gp) + (elfNN_ia64_relocate_section, elfNN_vms_object_p): Remove trailing + spaces. + +2011-06-09 Tristan Gingold + + * bfd.c (bfd_get_sign_extend_vma): Handle aixcoff. + +2011-06-09 Nick Clifton + + PR ld/12845 + * elf.c (_bfd_elf_init_private_section_data): Add an assertion + that the output section has an allocated bfd_elf_section_data + structure. + * elfxx-mips.c (mips_elf_check_symbols): Do not create a stub for + symbols in sections that have been removed by garbage collection. + +2011-06-08 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_check_relocs): Allow R_X86_64_64 + relocations in SEC_DEBUGGING sections when building shared + libraries. + +2011-06-08 H.J. Lu + + PR ld/12851 + * elflink.c (elf_gc_sweep): Don't check SHT_NOTE sections here. + (bfd_elf_gc_sections): Also check SHT_NOTE sections. + +2011-06-08 Tristan Gingold + + * makefile.vms (OBJS): Add elfxx-ia64.obj + Remove vax case. + +2011-06-08 Alan Modra + + * aix386-core.c, * cisco-core.c, * hpux-core.c, * osf-core.c, + * sco5-core.c: Init match_priority field. + +2011-06-08 Alan Modra + + * elflink.c (_bfd_elf_archive_symbol_lookup): Follow warning and + indirect links here. + +2011-06-07 Joel Brobecker + + * irix-core.c (irix_core_vec): Add match_priority field. + +2011-06-06 Alan Modra + + * targets.c (bfd_target): Make ar_max_namelen an unsigned char. + Add match_priority. + * configure.in: Bump bfd version. + * elfcode.h (elf_object_p): Delete hacks preventing match of + EM_NONE and ELFOSABI_NONE targets when a better match exists. + * elfxx-target.h (elf_match_priority): Define and use. + * format.c (bfd_check_format_matches): Use target match_priority + to choose best of multiple matching targets. In cases with multiple + matches rerun _bfd_check_format if we don't choose the last match. + * aout-adobe.c, * aout-arm.c, * aout-target.h, * aout-tic30.c, + * binary.c, * bout.c, * coff-alpha.c, * coff-i386.c, * coff-i860.c, + * coff-i960.c, * coff-ia64.c, * coff-mips.c, * coff-or32.c, + * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-tic30.c, + * coff-tic54x.c, * coff-x86_64.c, * coff64-rs6000.c, * coffcode.h, + * i386msdos.c, * i386os9k.c, * ieee.c, * ihex.c, * mach-o-target.c, + * mipsbsd.c, * mmo.c, * nlm-target.h, * oasys.c, * pdp11.c, + * pe-mips.c, * pef.c, * plugin.c, * ppcboot.c, * som.c, * srec.c, + * tekhex.c, * trad-core.c, * verilog.c, * versados.c, * vms-alpha.c, + * vms-lib.c, * xsym.c: Init match_priority field. + * configure: Regenerate. + * bfd-in2.h: Regenerate. + +2011-06-04 H.J. Lu + + PR ld/12842 + * elfcode.h (elf_object_p): Revert the last change. + +2011-06-04 Alan Modra + + * archures.c (bfd_arch_get_compatible): If one arch is unknown, + return the other arch. + * elfcode.h (elf_object_p): Allow explicit match to generic ELF + target. + +2011-06-03 Bertram Felgenhauer + + PR ld/12682 + * hash.c (higher_primer_number): Add more, small, prime numbers. + (bfd_hash_set_default_size): Likewise. + +2011-06-02 Nick Clifton + + * coff-mcore.c: Fix spelling typo. + * coff-stgo32.c: Likewise. + * elf32-arm.c: Likewise. + * elf32-avr.c: Likewise. + * elf-m68hc1x.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-mep.c: Likewise. + * elf32-mt.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-ppc.c: Likewise. + * elfxx-mips.c: Likewise. + * netbsd.h: Likewise. + * nlmcode.h: Likewise. + * vms-alpha.c: Likewise. + * po/bfd.pot: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2011-06-01 DJ Delorie + + * config.bfd: Add bfd_elf32_rx_be_ns_vec. + * target.c: Likewise. + * configure.in: Likewise. + * configure.in: Regenerate. + * elf32-rx.c: Add elf32-rx-be-ns target. + (rx_elf_object_p): Never allow the be-ns target by default, + only allow it if the user requests it. + +2011-06-01 H.J. Lu + + * elf32-i386.c (elf_i386_size_dynamic_sections): Properly warn + relocation in readonly section in a shared object. + * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise. + +2011-05-31 Nick Clifton + + * archive.c (adjust_relative_path): Fix comment to prevent it + corrupting the auto-generated bfd.h. + +2011-05-31 Paul Brook + + * elf32-arm.c (elf32_arm_final_link_relocate): Only do bl conversion + for known functions. + (elf32_arm_swap_symbol_in): Only set ST_BRANCH_TO_ARM for function + symbols. + +2011-05-31 Paul Brook + + * elf32-arm.c (arm_stub_is_thumb): Add + arm_stub_long_branch_v4t_thumb_tls_pic. + (elf32_arm_final_link_relocate): TLS stubs are always ARM. + Handle Thumb stubs. + +2011-05-27 Nick Clifton + + PR binutils/12710 + * archive.c (_bfd_get_elt_at_filepos): Set correct error value if + unable to read a file pointed to by an entry in a thin archive. + (adjust_relative_path): Use lrealpath to canonicalize paths. + Handle the case where the reference path is above the current + path in the directory tree. + +2011-05-26 H.J. Lu + + PR ld/12809 + * elf64-x86-64.c (elf_x86_64_relocate_section): Handle + R_X86_64_TPOFF64 in executable. + +2011-05-26 Alan Modra + + * elf-bfd.h (SYMBOL_REFERENCES_LOCAL): Remove most of comment. + * elflink.c (_bfd_elf_symbol_refs_local_p): Expand + local_protected comment. + +2011-05-25 Tristan Gingold + + * configure.in (bfd_elf32_ia64_big_vec, bfd_elf32_ia64_hpux_big_vec) + (bfd_elf64_ia64_big_vec, bfd_elf64_ia64_hpux_big_vec) + (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_vms_vec): Add elfxx-ia64.lo + * Makefile.am (BFD64_BACKENDS): Add elfxx-ia64.lo + (BFD64_BACKENDS_CFILES): Add elfxx-ia64.c + (elf32-ia64.c): Created from elfnn-ia64.c + (elf64-ia64.c): Likewise. + * elfxx-ia64.h: New file. + * elfxx-ia64.c: Split with elfnn-ia64.c. Keep only the following + functions.Includes elfxx-ia64.h. + (elfNN_ia64_reloc): Renames to ia64_elf_reloc. Adjust error message. + (IA64_HOWTO): Adjust. + (lookup_howto): Renames to ia64_elf_lookup_howto. Make it public. + (elfNN_ia64_reloc_type_lookup): Renames to + ia64_elf_reloc_type_lookup. Make it public. Adjust calls. + (elfNN_ia64_reloc_name_lookup): Renames to + ia64_elf_reloc_name_lookup. Make it public. + (elfNN_ia64_relax_br): Renames to ia64_elf_relax_br. Make it public. + (elfNN_ia64_relax_brl): Renames to ia64_elf_relax_brl. Make it + public. + (elfNN_ia64_relax_ldxmov): Renames to ia64_elf_relax_ldxmov. + Move it and make it public. Move prototype to elfxx-ia64.h + (elfNN_ia64_install_value): Renames to ia64_elf_install_value. + Move prototype to elfxx-ia64.h + * elfnn-ia64.c: New file, split from elfxx-ia64.c. + (elfNN_ia64_info_to_howto): Adjust calls. + (elfNN_ia64_relax_section): Adjust calls. + (count_dyn_reloc): Fix typo. + (elfNN_ia64_relocate_section): Adjust calls. + (elfNN_ia64_finish_dynamic_symbol): Likewise. + (bfd_elfNN_bfd_reloc_type_lookup) + (bfd_elfNN_bfd_reloc_name_lookup): Adjust macros. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2011-05-23 DJ Delorie + + * elf32-rx.c (rx_elf_object_p): When reading an RX object in, undo + the vma/lma swapping done in elf32_rx_modify_program_headers. + +2011-05-23 Nick Clifton + + * elf-m10300.c (mn10300_elf_mkobject): New function. + (bfd_elf32_mkobject): Define. + +2011-05-23 Alan Modra + + * elf-bfd.h: Comment typo fix. + * elf32-ppc.c (struct ppc_elf_dyn_relocs): Delete. Replace with + struct elf_dyn_relocs throughout. + * elf64-ppc.c (struct ppc_dyn_relocs): Likewise. + +2011-05-23 Alan Modra + + * elf32-frv.c: Use info->callbacks->einfo throughout file in linker + functions rather than warning callback or _bfd_error_handler. + * elf32-ppc.c: Likewise. + * elf64-ppc.c: Likewise. + * elf32-ppc.c (ppc_elf_tls_optimize): Use %H in __tls_get_addr lost + arg error. + * elf64-ppc.c (ppc64_elf_tls_optimize): Likewise. + +2011-05-23 Alan Modra + + PR 12763 + * elf.c (assign_file_positions_for_load_sections): Set sh_offset for + .tbss, and page align same for all SHT_NOBITS sections. + +2011-05-21 Alan Modra + + PR 12763 + * elf.c (_bfd_elf_make_section_from_shdr): Set up TLS section LMAs + from PT_TLS header. + (_bfd_elf_map_sections_to_segments): Don't create a final PT_LOAD + segment if just for .tbss. + (assign_file_positions_for_load_sections): Don't report "can't + allocate in segment" errors for .tbss. + (assign_file_positions_for_non_load_sections): Don't set p_filesz + from SHT_NOBITS section filepos. + +2011-05-20 Bernd Schmidt + + * elf32-tic6x.c (elf32_tic6x_howto_table): Add entries for + R_C6000_PCR_H16 and R_C6000_PCR_L16. + (elf32_tic6x_relocate_section): Handle them. + +2011-05-18 Nick Clifton + + PR ld/12761 + * elflink.c (elf_link_add_object_symbols): Process .gnu.warning + sections when building shared libraries. + +2011-05-18 Rafał Krypa + + PR ld/12778 + * elf32-arm.c (elf32_arm_gc_sweep_hook): Use the computed dynamic + reloc pointer. + +2011-05-18 Tristan Gingold + + * xcofflink.c (xcoff_link_add_symbols): Handle C_DWARF symbols. + (xcoff_sweep): Always keep dwarf sections. + (xcoff_link_input_bfd): Handle dwarf symbols and sections. + +2011-05-18 Tristan Gingold + + * libxcoff.h (struct xcoff_dwsect_name): New type. + (XCOFF_DWSECT_NBR_NAMES): New macro. + (xcoff_dwsect_names): Declare. + * coffcode.h (sec_to_styp_flags): Handle xcoff dwarf sections. + (styp_to_sec_flags): Ditto. + (coff_new_section_hook): Ditto. + (coff_slurp_symbol_table): Handle C_DWARF and C_INFO. + * coff-rs6000.c (xcoff_dwsect_name): New variable. + +2011-05-17 Tomohiro Kashiwada + + PR ld/12759 + * elf32-rx.c (ignore_lma): New variable. + (bfd_elf32_rx_set_target_flags): Add ignore_lma parameter. + (rx_modify_program_headers): Only copy the LMA into the VMA if + ignore_lma is true. + +2011-05-17 Alan Modra + + PR ld/12760 + * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Adjust "notice" call. + * elflink.c (elf_link_add_object_symbols): Likewise. + * linker.c (_bfd_generic_link_add_one_symbol): Likewise. + +2011-05-16 Alan Modra + + * linker.c (_bfd_generic_link_add_one_symbol): Don't init u.undef.weak. + +2011-05-15 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_check_relocs): Record both local and + global GOT entries for GOT_PAGE relocations against global symbols. + +2011-05-13 Bernd Schmidt + + * config.bfd (tic6x-*-elf, tic6x-*-uclinux): New. + (tic6x-*-*): Replaced by these. + * elf32-tic6x.c (elf32_tic6x_set_osabi): New static function. + (elf32_tic6x_check_relocs): Create dynamic sections if -shared. + (elf_backend_relocs_compatible, elf_backend_post_process_headers): + Define. + (elf32_bed, TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, TARGET_BIG_SYM, + TARGET_BIG_NAME, ELF_OSABI): Redefine twice, and include + "elf32-target.h" two more times. + * configure.in: Handle bfd_elf32_tic6x_linux_be_vec, + bfd_elf32_tic6x_linux_le_vec, bfd_elf32_tic6x_elf_be_vec and + bfd_elf32_tic6x_elf_le_vec. + * configure: Regenerate. + +2011-05-13 Jan Beulich + + * config.bfd: Add targets x86_64-*-pe and x86_64-*-pep. + +2011-05-12 Jan Kratochvil + + * config.in: Regenerated. + * configure: Regenerated. + * configure.in: New tests for HAVE_PRPSINFO_T_PR_PID, + HAVE_PRPSINFO32_T_PR_PID, HAVE_PSINFO_T_PR_PID and + HAVE_PSINFO32_T_PR_PID. + * elf.c (elfcore_grok_psinfo): Protect reading psinfo.pr_pid by + HAVE_PRPSINFO_T_PR_PID, HAVE_PRPSINFO32_T_PR_PID, HAVE_PSINFO_T_PR_PID + and HAVE_PSINFO32_T_PR_PID. + * hosts/x86-64linux.h (HAVE_PRPSINFO32_T_PR_PID): New redefinition. + +2011-05-10 Jan Kratochvil + + * elf.c (elfcore_grok_psinfo): Initialize CORE_PID for both native and + 32bit psinfo. + * elf32-ppc.c (ppc_elf_grok_psinfo): Initialize core_pid. + * elf64-ppc.c (ppc64_elf_grok_psinfo): Likewise. + +2011-05-09 Paul Brook + + * bfd-in.h (elf32_tic6x_fix_exidx_coverage): Add prototype. + * bfd-in2.h: Regenerate. + * elf32-tic6x.c: Include limits.h. + (tic6x_unwind_edit_type, tic6x_unwind_table_edit, + _tic6x_elf_section_data): New. + (elf32_tic6x_section_data): Define. + (elf32_tic6x_new_section_hook): Allocate target specific data. + (elf32_tic6x_add_unwind_table_edit): New function. + (get_tic6x_elf_section_data, elf32_tic6x_adjust_exidx_size, + elf32_tic6x_insert_cantunwind_after, elf32_tic6x_add_low31, + elf32_tic6x_copy_exidx_entry): New functions. + (elf_backend_write_section): Define. + +2011-05-09 Paul Brook + + * elf32-tic6x.c (is_tic6x_elf_unwind_section_name, + elf32_tic6x_fake_sections): New functions. + (elf_backend_fake_sections): Define. + +2011-05-09 Paul Brook + + * elf32-tic6x.c (elf32_tic6x_gc_mark_extra_sections): New function. + (elf_backend_gc_mark_extra_sections): Define. + +2011-05-07 Dave Korn + + PR ld/12365 + * cofflink.c (bfd_coff_link_input_bfd): Check for and warn about + references to symbols defined in discarded sections. + +2011-05-07 Dave Korn + + PR ld/12365 + * coffgen.c (coff_write_symbol): Assume input section is its own + output section if output_section member not set. + (coff_write_alien_symbol): Likewise. + +2011-05-07 H.J. Lu + + PR ld/12730 + * elf.c (_bfd_elf_section_offset): Check SEC_ELF_REVERSE_COPY. + + * elflink.c (elf_link_input_bfd): Reverse copy .ctors/.dtors + sections if needed. + + * section.c (SEC_ELF_REVERSE_COPY): New. + * bfd-in2.h: Regenerated. + +2011-05-07 Anders Kaseorg + + PR 12739 + * libbfd.c (bfd_get_8, bfd_get_signed_8): Use const cast. + * bfd-in2.h: Regenerate. + +2011-05-06 Tristan Gingold + + * vms-alpha.c (evax_section_flags): Remove SEC_IN_MEMORY. + (_bfd_vms_slurp_egsd): Rename old_flags to vms_flags. Handle + any code section. Add comments. + (alpha_vms_object_p): Use void * instead of PTR. + (alpha_vms_create_eisd_for_section): Fix test for setting DZRO. + (build_module_list): Guard against no DST section. Add comments. + (alpha_vms_link_output_symbol): Discard undefined symbols. + (alpha_vms_get_section_contents): Simply memcpy if the section was + already loaded. Fix typo. + (vms_new_section_hook): Use void * instead of PTR. + (vms_alpha_vec): Ditto. + +2011-05-06 Richard Sandiford + + * elf32-arm.c (cortex_a8_erratum_scan): If the stub is a Thumb + branch to a PLT entry, redirect it to the PLT's Thumb entry point. + +2011-05-05 Bernd Schmidt + + * elf32-tic6x.c (elf32_tic6x_final_link): New function. + (elf32_tic6x_merge_attributes): Do not warn for PID or PIC + mismatch. Choose the lower of the two values. + (bfd_elf32_bfd_final_link): New macro. + +2011-04-28 Tristan Gingold + + * coff-rs6000.c (_bfd_xcoff_swap_aux_in): Adjust for x_file. + (bfd_xcoff_swap_aux_out): Ditto. + * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Ditto. + (bfd_xcoff64_swap_aux_out): Ditto. + +2011-05-04 Alan Modra + + PR ld/12727 + * elf64-ppc.c (ppc_build_one_stub ): Clear + was_undefined on dot-symbols. + +2011-05-03 Paul Brook + + + * elf32-tic6x.c (elf32_tic6x_howto_table, + elf32_tic6x_howto_table_rel, (elf32_tic6x_gc_sweep_hook, + elf32_tic6x_relocate_section, elf32_tic6x_check_relocs): + Add R_C6000_EHTYPE. + +2011-05-01 Alan Modra + + PR ld/12718 + * elf32-i386.c (elf_i386_check_relocs): Ensure dynobj set before + creating ifunc sections. + * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise. + +2011-04-30 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_merge_symbol): Correct parameter + names. + +2011-04-28 Tom Tromey + + * bfdio.c (memory_bstat): Pass correct size to memset. + +2011-04-28 Mike Frysinger + + * dwarf2.c (dwarf_debug_sections): Mark const. + * elf.c (special_sections): Likewise. + * libbfd-in.h (dwarf_debug_sections): Likewise. + * libbfd.h: Regenerate. + +2011-04-26 Kai Tietz + + * coffcode.h (sec_to_styp_flags): Allow linkonce for + debugging sections. + +2011-04-26 Tristan Gingold + + * coff64-rs6000.c: Convert to ISO-C. Remove PARAMS and PTR macros. + +2011-04-24 Alan Modra + + PR ld/12365 + PR ld/12696 + * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Update "notice" call. + * linker.c (_bfd_link_hash_newfunc): Clear bitfields. + (_bfd_generic_link_add_one_symbol): Update "notice" call. + * elflink.c (_bfd_elf_merge_symbol): Don't skip weak redefs when + it is a redef of an IR symbol in a real BFD. + +2011-04-22 H.J. Lu + + * elf32-i386.c (elf_i386_readonly_dynrelocs): Warn relocation + in readonly section in a shared object. + (elf_i386_size_dynamic_sections): Likewise. + * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise. + (elf_x86_64_size_dynamic_sections): Likewise. + +2011-04-21 H.J. Lu + + PR ld/12694 + * elf32-i386.c (elf_i386_readonly_dynrelocs): Skip local IFUNC + symbols. + * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise. + +2011-04-21 H.J. Lu + + * elf32-i386.c (elf_i386_finish_dynamic_symbol): Return false + on dynamic symbol error. + * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise. + +2011-04-20 Tristan Gingold + + * config.bfd (alpha*-*-*vms*, ia64*-*-*vms*): Define targ_selvecs. + +2011-04-20 Alan Modra + + * hash.c (bfd_default_hash_table_size): Make it an unsigned long. + (bfd_hash_table_init_n): Overflow checking. + (bfd_hash_set_default_size): Return current size. Take unsigned long + arg. Add 65537 to hash_size primes. + * bfd-in.h (bfd_hash_set_default_size): Update prototype. + * bfd-in2.h: Regenerate. + +2011-04-20 Jan Kratochvil + + * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Fix +1 overrun of + memmove elements. + +2011-04-20 Alan Modra + + * libbfd.c (bfd_log2): Do return rounded up value. + * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Replace bfd_log2 + call with expanded old round down version of the function. + + * archive.c (_bfd_get_elt_at_filepos): Don't release n_nfd. + * elflink.c (elf_link_add_object_symbols): Delete redundant code. + +2011-04-20 Alan Modra + + PR ld/12365 + * elfcode.h (elf_slurp_symbol_table): Put common plugin IR symbols + in their own common section. + * elflink.c (elf_link_add_object_symbols): Likewise. + * linker.c (generic_link_check_archive_element): Don't lose flags + if common section is pre-existing. + (_bfd_generic_link_add_one_symbol): Likewise. + +2011-04-20 Alan Modra + + PR ld/12365 + * elflink.c (_bfd_elf_merge_symbol): Update multiple_common calls. + * linker.c (_bfd_generic_link_add_one_symbol): Likewise. Call + multiple_definition regardless of allow_multiple_definition. + * simple.c (simple_dummy_multiple_definition): Update. + * xcofflink.c (xcoff_link_add_symbols): Update multiple_definition + calls. + +2011-04-18 Tristan Gingold + + * coff-rs6000.c: Convert to ISO-C. Remove PARAMS macro. + +2011-04-18 Alan Modra + + PR ld/12365 + PR ld/12672 + * bfd.c (BFD_PLUGIN): Define. + (BFD_FLAGS_SAVED, BFD_FLAGS_FOR_BFD_USE_MASK): Add BFD_PLUGIN. + * bfd-in2.h: Regenerate. + * elflink.c (elf_link_output_extsym): Strip undefined plugin syms. + * opncls.c (bfd_make_readable): Don't lose original bfd flags. + +2011-04-17 Jan Kratochvil + + * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Do not check for + SEC_LOAD. + +2011-04-15 Sergio Durigan Junior + + * elf-bfd.h (struct sdt_note): New struct. + (struct elf_obj_tdata) : New field. + * elf.c (elfobj_grok_stapsdt_note_1): New function. + (elfobj_grok_stapsdt_note): Likewise. + (elf_parse_notes): Added code to treat SystemTap note + sections. + +2011-04-12 Richard Henderson + + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Do not + exclude empty .got sections. + +2011-04-11 H.J. Lu + + * elf32-i386.c (elf_i386_reloc_type_lookup): Fix the out of bound + array access for BFD_RELOC_386_IRELATIVE. + +2011-04-11 Bernd Schmidt + + * elf32-tic6x.c (elf32_tic6x_check_relocs): Initialize pc_count field. + +2011-04-11 Mark Wielaard + + PR 10549 + * elf-bfd.h (has_ifunc_symbols): Renamed to has_gnu_symbols. + (has_gnu_symbols): Renamed from has_ifunc_symbols. + * elf.c (_bfd_elf_set_osabi): Use new has_gnu_symbols name. + * elf32-arm.c (elf32_arm_add_symbol_hook): Set has_gnu_symbols + also if STB_GNU_UNIQUE symbol binding was seen. + * elf32-i386.c (elf_i386_add_symbol_hook): Likewise. + * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise. + * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise. + * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise. + * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise. + * elf64-x86-64.c (elf_x86_64_add_symbol_hook): Likewise. + +2011-04-11 Alan Modra + + * bfd-in.h (bfd_get_section_limit): Don't use rawsize with output + sections. + * libbfd.c (_bfd_generic_get_section_contents): Likewise. + (_bfd_generic_get_section_contents_in_window): Likewise. + * section.c (bfd_get_section_contents): Likewise. + * compress.c (bfd_get_full_section_contents): Likewise. + * elf32-rx.c (rx_final_link): Ignore rawsize. + * elf32-microblaze.c (microblaze_elf_relocate_section): Use correct + bfd with bfd_get_section_limit. + * elfxx-ia64.c (elfNN_ia64_choose_gp): Add "final" parameter. Use + os->size during final link. Update callers. + * bfd-in2.h: Regenerate. + +2011-04-10 Richard Sandiford + + PR ld/12637 + * elfxx-mips.c (mips_elf_merge_got_with): Use arg->global_count + as the number of global entries when merging with the primary GOT. + +2011-04-09 H.J. Lu + + * elf32-i386.c: Update copyright year. + * elf64-x86-64.c: Likewise. + +2011-04-09 Kai Tietz + + * peXXigen.c (_bfd_XXi_final_link_postscripte): Sort pdata in temporary + buffer and use rawsize for sorting. + * coffcode.h (coff_compute_section_file_positions): Set rawsize + before doing alignment. + +2011-04-09 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Return relocation + error on unsupported relocation. + * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise. + +2011-04-09 H.J. Lu + + PR binutils/12657 + * hosts/x86-64linux.h (elf_prstatus32): Replace __pid_t with + pid_t. + +2011-04-08 H.J. Lu + + PR ld/12654 + * elf32-i386.c (elf_i386_relocate_section): Check !executable + instead of shared for R_386_TLS_LDO_32. + +2011-04-08 Tristan Gingold + + * Makefile.am (SOURCE_HFILES): Remove xcoff-target.h + * coff-pmac: Remove + * xcoff-target.h: Remove + * Makefile.in: Regenerate. + +2011-04-07 Cary Coutant + + * dwarf2.c (scan_unit_for_symbols): Check for DW_AT_specification. + +2011-04-07 Paul Brook + + * elf32-tic6x.c (elf32_tic6x_howto_table): R_C6000_PREL31 is + pc-relative. + (elf32_tic6x_howto_table_rel): Ditto. + (elf32_tic6x_relocate_section): Implement R_C6000_PREL31. + (elf32_tic6x_check_relocs): Ditto. + +2011-04-06 Joseph Myers + + * config.bfd (thumb-*-oabi): Don't handle in list of obsolete + targets. + (strongarm*, thumb*, xscale*): Remove architectures. + (strongarm-*-kaos*, thumb-*-coff, thumb-*-elf, thumb-epoc-pe*, + thumb-*-pe*, strongarm-*-elf, strongarm-*-coff, xscale-*-elf, + xscale-*-coff): Remove targets. + +2011-04-01 Tristan Gingold + + * elfxx-ia64.c: include bfd_stdint.h + +2011-03-31 Jan Kratochvil + + * elf32-tic6x.c (elf32_tic6x_relocate_section): Remove unused variable + dynobj and its initialization. + +2011-03-31 Tristan Gingold + + * makefile.vms (DEFS): Add HAVE_bfd_elf64_ia64_vms_vec. + * configure.com: Set BFD_HOST_64BIT_LONG_LONG and + BFD_HOST_LONG_LONG to 1. + +2011-03-31 Tristan Gingold + + * vms-alpha.c (vms_get_remaining_object_record): Fix dec-c warning. + (_bfd_vms_write_etir): Ditto. + (_bfd_vms_slurp_etir): Avoid to use intptr_t + * configure.com: Generate bfd_stdint.h + +2011-03-31 Bernd Schmidt + + * elf32-tic6x.h (struct elf32_tic6x_params): New. + (elf32_tic6x_setup): Declare. + * elf32-tic6x.c: Include . + (ELF_DYNAMIC_LINKER, DEFAULT_STACK_SIZE, PLT_ENTRY_SIZE): Define. + (struct elf32_tic6x_link_hash_table, struct elf32_link_hash_entry): + New structures. + (elf32_tic6x_link_hash_table, is_tic6x_elf): New macros. + (tic6x_elf_scom_section, tic6x_elf_scom_symbol, + tic6x_elf_scom_symbol_ptr): New static variables. + (elf32_tic6x_howto_table, elf32_tic6x_howto_table_rel, + elf32_tic6x_reloc_map): Add R_C6000_JUMP_SLOT, R_C6000_EHTYPE, + R_C6000_PCR_H16 and R_C6000_PCR_L16. + (elf32_tic6x_link_hash_newfunc, elf32_tic6x_link_hash_table_create, + elf32_tic6x_link_hash_table_free, elf32_tic6x_setup, + elf32_tic6x_using_dsbt, elf32_tic6x_install_rela, + elf32_tic6x_create_dynamic_sections, elf32_tic6x_make_got_dynreloc, + elf32_tic6x_finish_dynamic_symbol, elf32_tic6x_gc_sweep_hook, + elf32_tic6x_adjust_dynamic_symbol): New static functions. + (elf32_tic6x_relocate_section): For R_C6000_PCR_S21, convert branches + to weak symbols as required by the ABI. + Handle GOT and DSBT_INDEX relocs, and copy relocs to the output file + as needed when generating DSBT output. + (elf32_tic6x_check_relocs, elf32_tic6x_add_symbol_hook, + elf32_tic6x_symbol_processing, elf32_tic6x_section_from_bfd_section, + elf32_tic6x_allocate_dynrelocs, elf32_tic6x_size_dynamic_sections, + elf32_tic6x_always_size_sections, elf32_tic6x_modify_program_headers, + elf32_tic6x_finish_dynamic_sections, elf32_tic6x_plt_sym_val, + elf32_tic6x_copy_private_data, elf32_tic6x_link_omit_section_dynsym): + New static functions. + (ELF_MAXPAGESIZE): Define to 0x1000. + (bfd_elf32_bfd_copy_private_bfd_data, + bfd_elf32_bfd_link_hash_table_create, + bfd_elf32_bfd_link_hash_table_free, elf_backend_can_refcount, + elf_backend_want_got_plt, elf_backend_want_dynbss, + elf_backend_plt_readonly, elf_backend_got_header_size, + elf_backend_gc_sweep_hook, elf_backend_modify_program_headers, + elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol, + elf_backend_check_relocs, elf_backend_add_symbol_hook, + elf_backend_symbol_processing, elf_backend_link_output_symbol_hook, + elf_backend_section_from_bfd_section, + elf_backend_finish_dynamic_symbol, elf_backend_always_size_sections, + elf32_tic6x_size_dynamic_sections, elf_backend_finish_dynamic_sections, + elf_backend_omit_section_dynsym, elf_backend_plt_sym_val): Define. + + * bfd/reloc.c (BFD_RELOC_C6000_JUMP_SLOT, BFD_RELOC_C6000_EHTYPE, + BFD_RELOC_C6000_PCR_H16, BFD_RELOC_C6000_PCR_S16): Add. + * bfd/bfd-in2.h: Regenerate. + * bfd/libbfd.h: Regenerate. + * config.bfd: Accept tic6x-*-* instead of tic6x-*-elf. + +2011-03-31 Tristan Gingold + + * coffcode.h (coff_slurp_symbol_table): Silently discard C_NULL + entry on xcoff when value is C_NULL_VALUE. + +2011-03-31 Tristan Gingold + + * libcoff-in.h (exec_hdr): Remove. + * libcoff.h: Regenerate. + +2011-03-30 Nick Clifton + + * po/da.po: Updated Danish translation. + +2011-03-29 Richard Henderson + + * elf64-alpha.c (elf64_alpha_gc_mark_hook): New. + (elf64_alpha_gc_sweep_hook): New. + (elf_backend_gc_mark_hook, elf_backend_gc_sweep_hook): New. + (elf_backend_can_gc_sections): New. + +2011-03-26 John Marino + + * config.bfd: Add x86_64-*-dragonfly*, fix i386-*-dragonfly*. + * configure.in: Delete unused bfd_elf32_i386_dragonfly_vec. + * configure: Regenerate. + +2011-03-25 Michael Snyder + + * coffcode.h (coff_set_alignment_hook): Check return of bfd_seek. + +2011-03-25 Tristan Gingold + + * vms-alpha.c (_bfd_vms_find_nearest_dst_line): Allow the use + of find_nearest_line on object files. + +2011-03-25 Tristan Gingold + + * vms-alpha.c (evax_section_flags): Make $CODE$ section read-only. + Minor reordering. + (alpha_vms_create_eisd_for_section): Make code sections read-only. + +2011-03-24 Alan Modra + + * elf32-ppc.c (ppc_elf_tls_optimize): Catch more cases where + old-style __tls_get_addr calls without marker relocs don't match + their arg setup insn one for one. If such mismatches are found + report the reloc and don't do any tls optimization. + * elf64-ppc.c (ppc64_elf_tls_optimize): Likewise. + +2011-03-22 Eric B. Weddington + + * bfd-in2.h: Regenerate. + +2011-03-22 Eric B. Weddington + + * archures.c: Add AVR XMEGA architecture information. + * cpu-avr.c (arch_info_struct): Likewise. + * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise. + (elf32_avr_object_p): Likewise. + +2011-03-14 Richard Sandiford + + * reloc.c (BFD_RELOC_ARM_IRELATIVE): New relocation. + * bfd-in2.h: Regenerate. + * elf32-arm.c (elf32_arm_howto_table_2): Rename existing definition + to elf32_arm_howto_table_3 and replace with a single R_ARM_IRELATIVE + entry. + (elf32_arm_howto_from_type): Update accordingly. + (elf32_arm_reloc_map): Map BFD_RELOC_ARM_IRELATIVE to R_ARM_IRELATIVE. + (elf32_arm_reloc_name_lookup): Handle elf32_arm_howto_table_3. + (arm_plt_info): New structure, split out from elf32_arm_link_hash_entry + with an extra noncall_refcount field. + (arm_local_iplt_info): New structure. + (elf_arm_obj_tdata): Add local_iplt. + (elf32_arm_local_iplt): New accessor macro. + (elf32_arm_link_hash_entry): Replace plt_thumb_refcount, + plt_maybe_thumb_refcount and plt_got_offset with an arm_plt_info. + Change tls_type to a bitfield and add is_iplt. + (elf32_arm_link_hash_newfunc): Update accordingly. + (elf32_arm_allocate_local_sym_info): New function. + (elf32_arm_create_local_iplt): Likewise. + (elf32_arm_get_plt_info): Likewise. + (elf32_arm_plt_needs_thumb_stub_p): Likewise. + (elf32_arm_get_local_dynreloc_list): Likewise. + (create_ifunc_sections): Likewise. + (elf32_arm_copy_indirect_symbol): Update after the changes to + elf32_arm_link_hash_entry. Assert the is_iplt has not yet been set. + (arm_type_of_stub): Add an st_type argument. Use elf32_arm_get_plt_info + to get PLT information. Assert that all STT_GNU_IFUNC references + are turned into PLT references. + (arm_build_one_stub): Pass the symbol type to + elf32_arm_final_link_relocate. + (elf32_arm_size_stubs): Pass the symbol type to arm_type_of_stub. + (elf32_arm_allocate_irelocs): New function. + (elf32_arm_add_dynreloc): In static objects, use .rel.iplt for + all R_ARM_IRELATIVE. + (elf32_arm_allocate_plt_entry): New function. + (elf32_arm_populate_plt_entry): Likewise. + (elf32_arm_final_link_relocate): Add an st_type parameter. + Set srelgot to null for static objects. Use separate variables + to record which st_value and st_type should be used when generating + a dynamic relocation. Use elf32_arm_get_plt_info to find the + symbol's PLT information, setting has_iplt_entry, splt, + plt_offset and gotplt_offset accordingly. Check whether + STT_GNU_IFUNC symbols should resolve to an .iplt entry, and change + the relocation target accordingly. Broaden assert to include + .iplts. Don't set sreloc for static relocations. Assert that + we only generate dynamic R_ARM_RELATIVE relocations for R_ARM_ABS32 + and R_ARM_ABS32_NOI. Generate R_ARM_IRELATIVE relocations instead + of R_ARM_RELATIVE relocations if the target is an STT_GNU_IFUNC + symbol. Pass the symbol type to arm_type_of_stub. Conditionally + resolve GOT references to the .igot.plt entry. + (elf32_arm_relocate_section): Update the call to + elf32_arm_final_link_relocate. + (elf32_arm_gc_sweep_hook): Use elf32_arm_get_plt_info to get PLT + information. Treat R_ARM_REL32 and R_ARM_REL32_NOI as call + relocations in shared libraries and relocatable executables. + Count non-call PLT references. Use elf32_arm_get_local_dynreloc_list + to get the list of dynamic relocations for a local symbol. + (elf32_arm_check_relocs): Always create ifunc sections. Set isym + at the same time as setting h. Use elf32_arm_allocate_local_sym_info + to allocate local symbol information. Treat R_ARM_REL32 and + R_ARM_REL32_NOI as call relocations in shared libraries and + relocatable executables. Record PLT information for local + STT_GNU_IFUNC functions as well as global functions. Count + non-call PLT references. Use elf32_arm_get_local_dynreloc_list + to get the list of dynamic relocations for a local symbol. + (elf32_arm_adjust_dynamic_symbol): Handle STT_GNU_IFUNC symbols. + Don't remove STT_GNU_IFUNC PLTs unless all references have been + removed. Update after the changes to elf32_arm_link_hash_entry. + (allocate_dynrelocs_for_symbol): Decide whether STT_GNU_IFUNC PLT + entries should live in .plt or .iplt. Check whether the .igot.plt + and .got entries can be combined. Use elf32_arm_allocate_plt_entry + to allocate .plt and .(i)got.plt entries. Detect which .got + entries will need R_ARM_IRELATIVE relocations and use + elf32_arm_allocate_irelocs to allocate them. Likewise other + non-.got dynamic relocations. + (elf32_arm_size_dynamic_sections): Allocate .iplt, .igot.plt + and dynamic relocations for local STT_GNU_IFUNC symbols. + Check whether the .igot.plt and .got entries can be combined. + Detect which .got entries will need R_ARM_IRELATIVE relocations + and use elf32_arm_allocate_irelocs to allocate them. Use stashed + section pointers intead of strcmp checks. Handle iplt and igotplt. + (elf32_arm_finish_dynamic_symbol): Use elf32_arm_populate_plt_entry + to fill in .plt, .got.plt and .rel(a).plt entries. Point + STT_GNU_IFUNC symbols at an .iplt entry if non-call relocations + resolve to it. + (elf32_arm_output_plt_map_1): New function, split out from + elf32_arm_output_plt_map. Handle .iplt entries. Use + elf32_arm_plt_needs_thumb_stub_p. + (elf32_arm_output_plt_map): Call it. + (elf32_arm_output_arch_local_syms): Add mapping symbols for + local .iplt entries. + (elf32_arm_swap_symbol_in): Handle Thumb STT_GNU_IFUNC symbols. + (elf32_arm_swap_symbol_out): Likewise. + (elf32_arm_add_symbol_hook): New function. + (elf_backend_add_symbol_hook): Define for all targets. + +2011-03-14 Richard Sandiford + + * elf-bfd.h (elf_link_hash_entry): Add target_internal. + * elf.c (swap_out_syms): Set st_target_internal for each + Elf_Internal_Sym. + * elfcode.h (elf_swap_symbol_in): Likewise. + * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise. + * elf32-sh-symbian.c (sh_symbian_relocate_section): Likewise. + * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise. + * elflink.c (elf_link_output_extsym): Likewise. + (bfd_elf_final_link): Likewise. + (elf_link_add_object_symbols): Copy st_target_internal + to the hash table if we see a definition. + (_bfd_elf_copy_link_hash_symbol_type): Copy target_internal. + * elf32-arm.c (elf32_arm_stub_hash_entry): Replace st_type with + a branch_type field. + (a8_erratum_fix, a8_erratum_reloc): Likewise. + (arm_type_of_stub): Replace actual_st_type with an + actual_branch_type parameter. + (arm_build_one_stub): Use branch types rather than st_types to + determine the type of branch. + (cortex_a8_erratum_scan): Likewise. + (elf32_arm_size_stubs): Likewise. + (bfd_elf32_arm_process_before_allocation): Likewise. + (allocate_dynrelocs_for_symbol): Likewise. + (elf32_arm_finish_dynamic_sections): Likewise. + (elf32_arm_final_link_relocate): Replace sym_flags parameter with + a branch_type parameter. + (elf32_arm_relocate_section): Update call accordingly. + (elf32_arm_adjust_dynamic_symbol): Don't check STT_ARM_TFUNC. + (elf32_arm_output_map_sym): Initialize st_target_internal. + (elf32_arm_output_stub_sym): Likewise. + (elf32_arm_symbol_processing): Delete. + (elf32_arm_swap_symbol_in): Convert STT_ARM_TFUNCs into STT_FUNCs. + Use st_target_internal to record the branch type. + (elf32_arm_swap_symbol_out): Use st_target_internal to test for + Thumb functions. + (elf32_arm_is_function_type): Delete. + (elf_backend_symbol_processing): Likewise. + (elf_backend_is_function_type): Likewise. + +2011-03-14 Richard Sandiford + + * elf32-arm.c (elf32_arm_check_relocs): Always assign a dynobj. + (elf32_arm_finish_dynamic_sections): Move sgot != NULL assertion + into the PLT block. + +2011-03-14 Richard Sandiford + + * elf32-arm.c (elf32_arm_check_relocs): Use call_reloc_p, + may_need_local_target_p and may_become_dynamic_p to classify + the relocation type. Don't check info->symbolic or h->def_regular + when deciding whether to record a potential dynamic reloc. + Don't treat potential dynamic relocs as PLT references. + (elf32_arm_gc_sweep_hook): Update to match. Assert that we don't + try to make the PLT reference count go negative. + +2011-03-14 Richard Sandiford + + * elf32-arm.c (elf32_arm_final_link_relocate): Always fill in the + GOT entry here, rather than leaving it to finish_dynamic_symbol. + Only create a dynamic relocation for local references if + info->shared. + (allocate_dynrelocs_for_symbol): Update dynamic relocation + allocation accordingly. + (elf32_arm_finish_dynamic_symbol): Don't initialise the GOT entry here. + +2011-03-14 Richard Sandiford + + * elf32-arm.c (elf32_arm_allocate_dynrelocs): New function. + (elf32_arm_add_dynreloc): Likewise. + (elf32_arm_adjust_dynamic_symbol): Use elf32_arm_allocate_dynrelocs + to allocate dynamic relocations. + (elf32_arm_size_dynamic_sections): Likewise. + (allocate_dynrelocs): Likewise. Rename to + allocate_dynrelocs_for_symbol. + (elf32_arm_final_link_relocate): Use elf32_arm_add_dynreloc to + create dynamic relocations. + (elf32_arm_finish_dynamic_symbol): Likewise. + +2011-03-12 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_check_tls_transition): Supprt TLS + x32 GD->IE and GD->LE transitions. + (elf_x86_64_relocate_section): Supprt TLS x32 GD->IE, GD->LE + and LD->LE transitions. + +2011-03-10 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Provide section/offset + for LO_DS error message and correct multiple. + +2011-03-10 Alan Modra + + * elf64-ppc.c (bfd_elf64_bfd_link_just_syms): Define. + (ppc64_elf_link_just_syms): New function. + (opd_entry_value): Don't assume big-endian host. + (get_r2off): New function. + (ppc_build_one_stub, ppc_size_one_stub): Use it here. + +2011-03-06 Michael Snyder + + * compress.c (bfd_compress_section_contents): Check for out of mem. + + * elf64-x86-64.c (elf_x86_64_relocate_section): Document + that case statement falls through intentionally. + + * elf32-i386.c (elf_i386_relocate_section): Document fall through. + +2011-03-04 Alan Modra + + * archive.c (bsd_write_armap): Don't call stat in deterministic + mode, and don't use st_mtime if stat returns error. + +2011-03-03 Michael Snyder + + * elf64-x86-64.c (elf_x86_64_relocate_section): Remove dead code. + + * coff-x86_64.c (coff_amd64_rtype_to_howto): Fencepost error. + + * aoutx.h (aout_final_link): Use sizeof int not sizeof int*. + (aout_link_write_other_symbol): Missing break statement. + + * dwarf2.c (scan_unit_for_symbols): Stop memory leak. + + * archive.c (_bfd_slurp_extended_name_table): Fail if bfd_seek fails. + +2011-03-03 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_check_tls_transition): Supprt TLS + x32 IE->LE transition. + (elf_x86_64_relocate_section): Likewise. + +2011-03-02 Bernd Schmidt + + * elflink.c (is_reloc_section): Remove function. + (get_dynamic_reloc_section_name): Construct string manually. + +2011-02-28 Kai Tietz + + * archive.c (_bfd_find_nested_archive): Use filename_(n)cmp. + (adjust_relative_path): Likewise. + (_bfd_construct_extended_name_table): Likewise. + * corefile.c (generic_core_file_matches_executable_p): Likewise. + * elf32-bfin.c (bfinfdpic_relocate_section): Likewise. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-spu.c (sort_bfds): Likewise. + (spu_elf_auto_overlay): Likewise. + * syms.c (_bfd_stab_section_find_nearest_line): Likewise. + * xcofflink.c (xcoff_set_import_path): Likewise. + * xtensa-isa.c (xtensa_regfile_lookup): Likewise. + (xtensa_regfile_lookup_shortname): Likewise. + +2011-02-28 Alan Modra + + PR 12513 + * archive.c (bfd_slurp_bsd_armap_f2): Sanity check parsed_size and + stringsize. Properly sanity check symdef_count. Remove redundant + bfd_release. + +2011-02-25 Rafael Ávila de Espíndola + + * plugin.c (bfd_plugin_object_p): Correctly set the filesize + and handle claim_file seeking. Only try to load the plugin once. + +2011-02-22 Andreas Schwab + + * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): For a TLS_GD + relocation read the value from the second GOT slot. + +2011-02-15 Tristan Gingold + + * vms-alpha.c (alpha_vms_link_add_archive_symbols): Add a comment. + +2011-02-15 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_toc): Reinstate second read of + toc relocs. Fuss over free(NULL). + +2011-02-14 Mike Frysinger + + * elflink.c (bfd_elf_size_dynamic_sections): Add + bfd_get_symbol_leading_char to the start of newname. + +2011-02-13 Ralf Wildenhues + + * configure: Regenerate. + +2011-02-09 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_toc): Don't free toc relocs until + we are done. When optimising large toc, check that a global + symbol on a toc reloc is defined in a kept section. + +2011-02-08 Nick Clifton + + PR binutils/12467 + * elf.c (assign_file_positions_for_load_sections): Set the program + header offset and entry size to zero if there are no program + headers. + +2011-02-08 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_toc): Don't segfault on NULL + local_syms when looking for local symbols in .toc. + +2011-02-01 Alan Modra + + * elf64-ppc.c (ppc64_elf_next_input_section): Use elf_gp value + for toc pointer on any section having makes_toc_func_call set. + (check_pasted_section): Ensure pasted .init/.fini fragments use + the same toc if any has makes_toc_func_call set. + +2011-01-28 Joseph Myers + + * elf32-ppc.c (ppc_elf_link_hash_newfunc): Initialize has_sda_refs + field. + +2011-01-22 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Ignore + common sections too. + +2011-01-18 H.J. Lu + + * elf64-x86-64.c (elf_backend_want_plt_sym): Redefine to 0 after + Solaris target. + +2011-01-18 Pierre Muller + + Fix compilation for mingw64. + * coffcode.h (coff_slurp_symbol_table): Add intptr_t intermediate + typecast to avoid warning. + * elf32-rx.c: Add "bfd_stdint.h" include required for int32_t type + usage. + * elfxx-ia64.c (elfNN_ia64_relax_br): Use intptr_t typeacast instead + of long for pointer to avoid warning. + (elfNN_ia64_relax_brl): Idem. + (elfNN_ia64_install_value): Idem. + * vms-alpha.c (_bfd_vms_slurp_etir): Idem. + +2011-01-17 Richard Sandiford + + * elf32-arm.c (elf32_arm_check_relocs): Check needs_plt rather than + h->needs_plt when deciding whether to record a possible dynamic reloc. + +2011-01-17 Richard Sandiford + + * elf32-arm.c (elf32_arm_gc_sweep_hook): Remove all registered + dynamic relocs for the removed section. + +2011-01-15 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_check_relocs): Check invalid x32 + relocations. + +2011-01-14 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_link_hash_table): Add pointer_r_type. + (elf_x86_64_link_hash_table_create): Set pointer_r_type. + (elf_x86_64_check_relocs): Handle R_X86_64_32 like R_X86_64_64 + for ILP32. Remove ABI_64_P PIC check for R_X86_64_8, + R_X86_64_16, R_X86_64_32 and R_X86_64_32S. + (elf_x86_64_relocate_section): Handle R_X86_64_32 like R_X86_64_64 + for ILP32. + +2011-01-14 Alan Modra + + * bfd.c (bfd_perror): Flush stdout before and stderr after printing + error. + (_bfd_default_error_handler): Likewise. + * elf.c (print_segment_map): Likewise. + * libbfd.c (warn_deprecated): Likewise. + * som.c (som_sizeof_headers): No need to do so here. + * coff-i860.c: Replace use of printf for error messages with + _bfd_error_handler. + * coff-ppc.c: Likewise. + * coff-sh.c: Likewise. + * elf32-bfin.c: Likewise. + * elf32-dlx.c: Likewise. + * elf32-mep.c: Likewise. + * elf32-v850.c: Likewise. + * mach-o.c: Likewise. + * pef.c: Likewise. + +2011-01-13 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_link_hash_table): Remove + swap_reloca_out. + (elf_x86_64_link_hash_table_create): Don't set swap_reloca_out. + (elf_x86_64_check_relocs): Align relocation section to 4 byte + for 32bit. + (elf_x86_64_gc_sweep_hook): Replace ELF64_ST_TYPE with + ELF_ST_TYPE. + (elf_x86_64_finish_dynamic_symbol): Updated. + (elf_x86_64_finish_dynamic_sections): Don't use + Elf64_External_Dyn, bfd_elf64_swap_dyn_in, nor + bfd_elf64_swap_dyn_out. + +2011-01-14 J. Park + + PR ld/12339 + * elf32-arm.c (allocate_dynrelocs): Don't set up eh before + following bfd_link_hash_warning symbol link. + +2011-01-10 Nathan Sidwell + Glauber de Oliveira Costa + + * reloc.c (BFD_RELOC_ARM_TLS_GOTDESC, BFD_RELOC_ARM_TLS_CALL, + BFD_RELOC_ARM_THM_TLS_CALL, BFD_RELOC_ARM_TLS_DESCSEQ, + BFD_RELOC_ARM_THM_TLS_DESCSEQ, BFD_RELOC_ARM_TLS_DESC): New + relocations. + * libbfd.h: Rebuilt. + * bfd-in2.h: Rebuilt. + * elf32-arm.c (elf32_arm_howto_table_1): Add new relocations. + (elf32_arm_reloc_map): Likewise. + (tls_trampoline, dl_tlsdesc_lazy_trampoline): New PLT templates. + (elf32_arm_stub_long_branch_any_tls_pic, + elf32_arm_stub_long_branch_v4t_thumb_tls_pic): New stub templates. + (DEF_STUBS): Add new stubs. + (struct_elf_arm_obj_data): Add local_tlsdesc_gotent field. + (elf32_arm_local_tlsdesc_gotent): New. + (GOT_TLS_GDESC): New mask. + (GOT_TLS_GD_ANY): Define. + (struct elf32_arm_link_hash_entry): Add tlsdesc_got field. + (elf32_arm_compute_jump_table_size): New. + (struct elf32_arm_link_hash_table): Add next_tls_desc_index, + num_tls_desc, dt_tlsdesc_plt, dt_tlsdesc_got, tls_trampoline, + sgotplt_jump_table_size fields. + (elf32_arm_link_hash_newfunc): Initialize tlsdesc_got field. + (elf32_arm_link_hash_table_create): Initialize new fields. + (arm_type_of_stub): Check TLS desc relocs too. + (elf32_arm_stub_name): TLS desc relocs can be shared. + (elf32_arm_tls_transition): Determine relaxation. + (arm_stub_required_alignment): Add tls stubs. + (elf32_arm_size_stubs): Likewise. + (elf32_arm_tls_relax): Perform TLS relaxing. + (elf32_arm_final_link_relocate): Process TLS DESC relocations. + (IS_ARM_TLS_GNU_RELOC): New. + (IS_ARM_TLS_RELOC): Use it. + (elf32_arm_relocate_section): Perform TLS relaxing. + (elf32_arm_check_relocs): Anticipate TLS relaxing, process tls + desc relocations. + (allocate_dynrelocs): Allocate tls desc relcoations. + (elf32_arm_output_arch_local_syms): Emit tls trampoline mapping + symbols. + (elf32_arm_size_dynamic_sections): Allocate tls trampolines and + got slots. + (elf32_arm_always_size_sections): New. Create _TLS_MODULE_BASE + symbol. + (elf32_arm_finish_dynamic_symbol): Adjust. + (arm_put_trampoline): New. + (elf32_arm_finish_dynamic_sections): Emit new dynamic tags and tls + trampolines. + (elf_backend_always_size_sections): Define. + +2011-01-06 H.J. Lu + + * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Optimized. + +2011-01-06 H.J. Lu + + PR ld/12366 + PR ld/12371 + * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Properly + handle symbols marked with regular reference, but not non-GOT + reference when building shared library. + + * elf32-i386.c (elf_i386_gc_sweep_hook): Properly handle + local and global STT_GNU_IFUNC symols when building shared + library. + * elf64-x86-64.c (elf_x86_64_gc_sweep_hook): Likewise. + +2011-01-05 DJ Delorie + + * reloc.c: Add BFD_RELOC_RX_OP_NEG. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * elf32-rx.c: Add it to the list, corresponding to R_RX_OPneg. + +2011-01-03 H.J. Lu + + * cpu-i386.c (bfd_i386_compatible): New. + (bfd_x64_32_arch_intel_syntax): Replace bfd_default_compatible + with bfd_i386_compatible. + (bfd_x86_64_arch_intel_syntax): Likewise. + (bfd_i386_arch_intel_syntax): Likewise. + (i8086_arch): Likewise. + (bfd_x64_32_arch): Likewise. + (bfd_x86_64_arch): Likewise. + (bfd_i386_arch): Likewise. + +For older changes see ChangeLog-2010 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-0001 sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-0001 --- sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-0001 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-0001 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,9592 @@ +2001-12-31 Jakub Jelinek + + * elflink.h (elf_bfd_final_link): Check if dynobj is not NULL + before looking for .eh_frame_hdr section. + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame_hdr): If + .eh_frame_hdr section is being stripped from output, don't do + anything. + +2001-12-27 Tom Rix + + * coff-rs6000.c (xcoff_generate_rtinit): Clean data_buffer alloc/free. + * coff64-rs6000.c (xcoff64_generate_rtinit): Same. + (xcoff_write_archive_contents_big): Rewrite. + (xcoff_write_armap_big): Rewrite. + (xcoff_write_one_armap_big): Delete. + * libxcoff.h : Clean up. + +2001-12-21 Tom Rix + + * xcofflink.c (bfd_xcoff_link_generate_rtinit): New function. + Interface to linker for generation of __rtinit. + * libxcoff.h (struct xcoff_backend_data_rec): Add new ops to xcoff + backend to generate special linker symbol __rtinit. + * coff-rs6000.c (bfd_xcoff_backend_data, bfd_pmac_xcoff_backend_data) + : Add new rtinit ops + * coff64-rs6000.c (bfd_xcoff_aix5_backend_data, + bfd_xcoff_backend_data): Same. + * bfd-in.h: Add bfd_xcoff_link_generate_rtinit. + * bfd-in2.h : Regenerate. + +2001-12-21 Jakub Jelinek + + * elf32-sparc.c (_bfd_sparc_elf_howto_table): Fix dst_mask for + R_SPARC_DISP32. Support R_SPARC_PLT32. + (sparc_reloc_map): Add BFD_RELOC_16_PCREL and BFD_RELOC_SPARC_PLT32. + (elf32_sparc_check_relocs): Handle R_SPARC_PLT32. + (elf32_sparc_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_howto_table): Fix dst_mask for + R_SPARC_DISP32. Support R_SPARC_PLT32 and R_SPARC_PLT64. + (sparc_reloc_map): Add BFD_RELOC_16_PCREL, BFD_RELOC_64_PCREL + and BFD_RELOC_SPARC_PLT32. + (sparc64_elf_check_relocs): Handle R_SPARC_PLT32 and R_SPARC_PLT64. + (sparc64_elf_relocate_section): Likewise. + * reloc.c (bfd_reloc_code_type): Add BFD_RELOC_SPARC_PLT32. + * bfd-in2.h, libbfd.h: Rebuilt. + +2001-12-20 Tom Rix + + * coffcode.h (coff_compute_section_file_positions): Add special AIX + loader alignment of text section. + +2001-12-20 Jason Thorpe + + * config.bfd (mips-dec-netbsd*): Delete alias for mips*el-*-netbsd*. + + * config.bfd (arm-*-netbsdelf*): Add target. + * configure.in: Include netbsd-core.lo for native arm-*-netbsd*. + * configure: Regenerate. + +2001-12-20 Alan Modra + + * elfcode.h (elf_slurp_symbol_table): Test elf_elfsections for NULL, + as can happen with a core file, before dereferencing. + +2001-12-19 Michael Snyder + + * elf32-i386.c (elf_i386_grok_psinfo): Fix copy-and-paste error: + target is i386 (not mips), and size of descdata is 124 (not 128). + +2001-12-19 Jakub Jelinek + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): If new_size + is 0, temporarily grow it to minimal CIE size. + (_bfd_elf_write_section_eh_frame): If input .eh_frame section would + end up empty, build a fake minimal CIE. + +2001-12-19 Steve Ellcey + + * config.bfd (bfd_elf32_ia64_hpux_big_vec): New vector for + ia64*-*-hpux* target. + (bfd_elf64_ia64_hpux_big_vec): Likewise. + * targets.c: Ditto. + * configure.in: Ditto. + * configure: Regenerate + * elfxx-ia64.c (elfNN_ia64_final_write_processing): Replace use of + alloca with bfd_malloc. + (get_local_sym_hash): Likewise. + (elfNN_hpux_post_process_headers): New function. + #include elfNN-target.h again with values for IA64 HP-UX vector. + +2001-12-18 Michael Snyder + + * elf.c (assign_file_positions_for_segments): Don't sort PT_NOTE + sections of corefiles. Also it makes no sense to sort if count == 1. + +2001-12-18 H.J. Lu + + * elf.c (_bfd_elf_copy_private_bfd_data): Also copy GP. + +2001-12-18 H.J. Lu + + * elf.c (_bfd_elf_copy_private_bfd_data): Update comments. + +2001-12-18 H.J. Lu + + * elf-bfd.h (_bfd_elf_copy_private_bfd_data): New. Prototype. + (_bfd_mips_elf_copy_private_bfd_data): Removed. + + * elf.c (_bfd_elf_copy_private_bfd_data): New. Copy e_flags in + the ELF header. + + * elf32-i370.c (??_elf_copy_private_bfd_data): Removed. + (bfd_elf??_bfd_copy_private_bfd_data): Removed. + * elf32-m32r.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-mips.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-v850.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-sparc.c: Likewise. + * elfxx-ia64.c: Likewise. + + * elf64-mips.c (bfd_elf64_bfd_copy_private_bfd_data): Removed. + + * elfxx-target.h (bfd_elfNN_bfd_copy_private_bfd_data): Defined + to _bfd_elf_copy_private_bfd_data. + +2001-12-18 Martin Schwidefsky + + * elf32-s390 (elf_s390_check_relocs): Pass addend to + gc_record_vtentry. + * elf64-s390 (elf_s390_check_relocs): Likewise. + Fix by Andreas Jaeger . + +2001-12-18 Jason Thorpe + + * configure.host: Correctly match all NetBSD/mips + hosts. + +2001-12-18 matthew green + + * config.bfd (m68*-*-netbsdelf*): New target. + (m68*-*-netbsd): Also include bfd_elf32_m68k_vec. + (m68*-*-netbsdaout*): New alias for m68*-*-netbsd. + +2001-12-18 Jakub Jelinek + + * elflink.h (size_dynamic_sections): Skip anonymous version tag. + (elf_link_assign_sym_version): Don't count anonymous version tag. + +2001-12-18 Jakub Jelinek + + * elf-eh-frame.c (struct cie): Add make_lsda_relative. + (struct eh_cie_fde): Add lsda_encoding, lsda_offset, + make_lsda_relative. + (read_value, write_value): New. + (_bfd_elf_discard_section_eh_frame): Inicialize + lsda_encoding, lsda_offset and make_lsda_relative. + (_bfd_elf_eh_frame_section_offset): If make_lsda_relative, + request no dynamic reloc for LSDA field of FDE. + (_bfd_elf_write_section_eh_frame): Handle make_lsda_relative. + If a non-DW_EH_PE_absptr value is 0, don't adjust it by base + or pcrel. Fix address computation for DW_EH_PE_pcrel relocs. + Update LSDA field if LSDA encoding is DW_EH_PE_pcrel, because + . might have changed due to deleted FDE or CIEs. + +2001-12-18 Jakub Jelinek + + * elf-strtab.c (struct elf_strtab_hash_entry): Add u.next. + (last_eq): Remove. + (_bfd_elf_strtab_finalize): Don't use a hash table for last + character chains, instead use an array. + +2001-12-18 Jason Thorpe + + * elf.c (elfcore_netbsd_get_lwpid): New function. + (elfcore_grok_netbsd_procinfo): New function. + (elfcore_grok_netbsd_note): New function. + (elfcore_read_notes): Call elfcore_grok_netbsd_note to process + NetBSD ELF core file notes. + +2001-12-18 Alan Modra + + * elfcode.h (struct bfd_preserve): New. + (elf_object_p): Replace preserved_* vars with instance of above. + Save and restore arch_info pointer rather than arch, mach so that + more cases can be restored. Save and restore new section_tail, + section_htab structure, and init appropriately. Move "rest of + section header" code so that i_shdrp needs no NULL initialisation. + Free old section_htab on success. + * elfcore.h (elf_core_file_p): Likewise. + +2001-12-17 Tom Rix + + * coffcode.h (sec_to_styp_flags): Add STYP_EXCEPT and STYP_TYPCHK for + xcoff. + +2001-12-17 Jakub Jelinek + + * elf-bfd.h (elf_discarded_section): Define. + * elflink.h (elf_link_input_bfd): Use it. + (elf_reloc_symbol_deleted_p): Likewise. + + * elf64-alpha.c (elf64_alpha_relocate_section): Don't warn about + overflows for pc relative relocs against discarded sections. + +2001-12-17 Thiemo Seufer + + * elf32-mips.c (_bfd_mips_elf_relocate_section): Formatting. + * elf64-mips.c: Add most of the fixes and tweaks done in elf32-mips.c + over the last months. Add some code for mips16 handling. + (mips_elf64_check_mips16_stubs): New function. + (mips_elf64_stub_section_p): Likewise. + (mips_elf64_calculate_relocation): Change interface to support mips16. + (mips_elf64_perform_relocation): Likewise. + +2001-12-17 Alan Modra + + Support for more than 64k ELF sections. + * elf-bfd.h (elf_size_info ): Add shndx param. + (bfd_elf32_swap_symbol_in): Likewise. + (bfd_elf32_swap_symbol_out): Likewise. + (bfd_elf64_swap_symbol_in): Likewise. + (bfd_elf64_swap_symbol_out): Likewise. + (elf_reloc_cookie): Add locsym_shndx field. Make locsyms a PTR. + (elf_obj_tdata): Add num_elf_sections, symtab_shndx_hdr and + symtab_shndx_section. + (elf_numsections): Define. + (elf_symtab_shndx): Define. + * elf.c (setup_group): Use elf_numsections rather than header e_shnum. + (bfd_elf_find_section): Likewise. + (bfd_section_from_elf_index): Likewise. + (bfd_section_from_shdr): Likewise. Handle SHT_SYMTAB_SHNDX. + (bfd_section_from_r_symndx): Read symbol shndx extension, and + translate st_shndx for > SHN_HIRESERVE. + (assign_section_numbers): Skip reserved sections. Assign + symtab_shndx_section and elf_numsections. Exclude reserved + sections from e_shnum. Set up symtab_shndx_hdr. + (_bfd_elf_compute_section_file_positions): Handle symtab_shndx_hdr. + (map_sections_to_segments): Don't map eh_frame_hdr unless required. + (assign_file_positions_except_relocs): Use elf_numsections rather + than header e_shnum. Skip reserved sections and symtab_shndx_section. + (prep_headers): Set name for symtab_shndx_hdr. + (_bfd_elf_assign_file_positions_for_relocs): Use elf_numsections. + (_bfd_elf_write_object_contents): Likewise. Skip reserved sections. + (_bfd_elf_section_from_bfd_section): Check bfd_{abs,com,und}_section + first. Use elf_section_data if available. Use elf_numsections. + Start scan at index 1. + (copy_private_bfd_data ): Comment fixes. + (MAP_ONESYMTAB): Define above SHN_HIOS. + (MAP_DYNSYMTAB): Likewise. + (MAP_STRTAB): Likewise. + (MAP_SHSTRTAB): Likewise. + (MAP_SYM_SHNDX): New define. + (_bfd_elf_copy_private_symbol_data): Handle symtab_shndx_section. + (swap_out_syms): Swap out SHT_SYMTAB_SHNDX section too. + * elfcode.h (elf_swap_symbol_in): Add shndx param, and handle shndx + extension. + (elf_swap_symbol_out): Likewise. + (elf_object_p): Set elf_numsections, and use instead of e_shnum. + Initialialise reserved elf_elfsections to point at shdr[0]. Remove + redundant bfd_release calls. + (elf_slurp_symbol_table): Read symbol shndx extension, and use with + elf_swap_symbol_in. Translate st_shndx for > SHN_HIRESERVE too. + * elflink.h (elf_link_is_defined_archive_symbol): Read symbol shndx + extension, and use with elf_swap_symbol_in. + (elf_link_record_local_dynamic_symbol): Likewise. + (elf_link_add_object_symbols): Likewise. Also translate st_shndx + for elf sections > SHN_HIRESERVE. + (NAME(bfd_elf,size_dynamic_sections)): Adjust elf_swap_symbol_out + call. + (struct elf_final_link_info): Add locsym_shndx and symshndxbuf. + (elf_bfd_final_link): Allocate the above, and tidy code allocating + other buffers. Use elf_numsections instead of e_shnum. Adjust + elf_swap_symbol_out calls. + (elf_link_output_sym): Swap out symbol shndx extension too. + (elf_link_flush_output_syms): And flush them to disk. + (elf_link_output_extsym): Use SHN_BAD. Adjust elf_swap_symbol_out + calls. + (elf_gc_mark): Read symbol shndx extension, and use with + elf_swap_symbol_in. + (elf_link_input_bfd): Likewise, Translate st_shndx for elf sections + > SHN_HIRESERVE too. Use SHN_BAD. + (elf_reloc_symbol_deleted_p): Use symbol shndx extensions with + elf_swap_symbol_in. Translate st_shndx > SHN_HIRESERVE too. + (elf_bfd_discard_info): Read symbol shndx extension. Don't attempt + to continue after a bfd error. + * elf-m10200.c (mn10200_elf_relax_section): Only read local syms. + Stash them immediately to symtab_hdr->contents rather than later + in multiple places. Clean up afterwards. Read symbol shndx + extension, and use with swap_symbol_in. Translate SHN_UNDEF, + SHN_ABS, SHN_COMMON and elf sections > SHN_HIRESERVE to bfd + sections too. Remove dead code. + (mn10200_elf_relax_delete_bytes): Use symbol shndx extension + when swapping in symbols. Tidy code adjusting global syms. + Don't swap in global syms. + (mn10200_elf_symbol_address_p): Likewise. Remove extsyms param. + (mn10200_elf_get_relocated_section_contents): Read symbol shndx + extension, and use with swap_symbol_in. Rename "size" -> "amt" + to maximize code in common with other files. Translate st_shndx + for > SHN_HIRESERVE too. Remove dead code. + * elf-m10300.c (mn10300_elf_relax_section): Only read local syms. + Stash them immediately to symtab_hdr->contents rather than later + in multiple places. Clean up afterwards. Read symbol shndx + extension, and use with swap_symbol_in. Remove dead code. + (mn10300_elf_relax_delete_bytes): As for elf-m10200.c. + (mn10300_elf_symbol_address_p): Likewise. + (mn10300_elf_get_relocated_section_contents): Likewise. + * elf32-h8300.c (elf32_h8_relax_section): As for elf-m10300.c. + (elf32_h8_relax_delete_bytes): Likewise. + (elf32_h8_symbol_address_p): Likewise. + (elf32_h8_get_relocated_section_contents): Likewise. + * elf32-hppa.c (elf32_hppa_size_stubs): Read symbol shndx + extension, and use with swap_symbol_in. + * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. + * elf32-i370.c (i370_elf_finish_dynamic_sections): Adjust call to + bfd_elf32_swap_symbol_out. + * elf32-m32r.c (m32r_elf_get_relocated_section_contents): Translate + elf sections > SHN_HIRESERVE too. + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Only read + local syms. Read symbol shndx extension, and use with swap_symbol_in. + * elf32-mips.c (_bfd_mips_elf_final_write_processing): Use + elf_numsections rather than header e_shnum. + * elf32-sh.c (sh_elf_relax_section): As for elf-m10300.c. + (sh_elf_relax_delete_bytes): Likewise. + (sh_elf_get_relocated_section_contents): Likewise. Only read local + symbols. + * elf32-v850.c (v850_elf_symbol_processing): Use an unsigned int to + hold section index. Use elf_numsections rather than e_shnum. + Rename "index" -> "indx" to avoid shadowing warning. + (v850_elf_add_symbol_hook): Likewise. + * elf64-alpha.c (elf64_alpha_relax_section): Only read local syms. + Read symbol shndx extension, and use with swap_symbol_in. + * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise. + Translate SHN_COMMON and elf sections > SHN_HIRESERVE too. + * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. + (elfNN_ia64_aix_add_symbol_hook): Use elf_numsections. + + * elf-m10300.c (mn10300_elf_gc_mark_hook): Remove unnecessary checks + before calling bfd_section_from_elf_index on local syms. + * elf32-arm.h (elf32_arm_gc_mark_hook): Likewise. + * elf32-avr.c (elf32_avr_gc_mark_hook): Likewise. + * elf32-cris.c (cris_elf_gc_mark_hook): Likewise. + * elf32-d10v.c (elf32_d10v_gc_mark_hook): Likewise. + * elf32-fr30.c (fr30_elf_gc_mark_hook): Likewise. + * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise. + * elf32-i386.c (elf_i386_gc_mark_hook): Likewise. + * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise. + * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise. + * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise. + * elf32-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise. + * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Likewise. + * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise. + * elf32-s390.c (elf_s390_gc_mark_hook): Likewise. + * elf32-sh.c (sh_elf_gc_mark_hook): Likewise. + * elf32-sparc.c (elf32_sparc_gc_mark_hook): Likewise. + * elf32-v850.c (v850_elf_gc_mark_hook): Likewise. + * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Likewise. + * elf64-mips.c (mips_elf64_gc_mark_hook): Likewise. + * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise. + * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise. + * elf64-s390.c (elf_s390_gc_mark_hook): Likewise. + * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise. + +2001-12-17 Alan Modra + + Hash bfd sections for fast lookup and create. + * bfd.c (struct _bfd): Add section_htab, section_tail. + * libbfd-in.h (_bfd_delete_bfd): Declare. + (bfd_section_hash_newfunc): Declare. + * opncls.c (_bfd_new_bfd): Free memory on failure. Init + section_htab and section_tail. + (_bfd_delete_bfd): New function. + (bfd_openr): Use it. + (bfd_fdopenr): Likewise. + (bfd_openstreamr): Likewise. + (bfd_openw): Likewise. + (bfd_close): Likewise. + (bfd_close_all_done): Likewise. + (bfd_release): Comment. + * section.c (struct section_hash_entry): New. + (bfd_section_hash_newfunc): New function. + (section_hash_lookup): Define. + (bfd_section_init): New function, split out from + bfd_make_section_anyway. + (bfd_get_section_by_name): Lookup via hash table. + (bfd_get_unique_section_name): Likewise. + (bfd_make_section_old_way): Rewrite to use hash table. + (bfd_make_section_anyway): Likewise. + (bfd_make_section): Likewise. Return NULL for attempts to make + BFD_{ABS,COM,UND,IND}_SECTION_NAME. + (_bfd_strip_section_from_output): Adjust section_tail if needed. + * configure.in: Bump bfd version. + * configure: Regenerate. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2001-12-15 Thiemo Seufer + + * elf64-mips.c (mips_elf64_link_hash_entry): New link hash. + (mips_elf64_high): New Function. + (mips_elf64_higher): Likewise. + (mips_elf64_highest): Likewise. + (mips_elf64_info_to_howto_rel): Likewise. + (mips_elf64_info_to_howto_rela): Likewise. + (mips_elf64_write_rel): Likewise. + (mips_elf64_write_rela): Likewise. + (mips_elf64_link_hash_newfunc): Likewise. + (mips_elf64_hi16_reloc): Likewise. + (mips_elf64_higher_reloc): Likewise. + (mips_elf64_highest_reloc): Likewise. + (mips_elf64_gprel16_reloc): Likewise. + (mips_elf64_gprel16_reloca): Likewise. + (mips_elf64_literal_reloc): Likewise. + (mips_elf64_gprel32_reloc): Likewise. + (mips_elf64_shift6_reloc): Likewise. + (mips_elf64_got16_reloc): Likewise. + (mips_elf64_assign_gp): Likewise. + (mips_elf64_final_gp): Likewise. + (gprel16_with_gp): Likewise. + (mips_elf64_additional_program_headers): Likewise. + (mips_elf64_link_hash_table_create): Likewise. + (mips_elf64_got_offset_from_index): Likewise. + (_mips_elf64_got_info): Likewise. + (mips_elf64_sign_extend): Likewise. + (mips_elf64_overflow_p): Likewise. + (mips_elf64_global_got_index): Likewise. + (mips_elf64_sort_hash_table_f): Likewise. + (mips_elf64_sort_hash_table): Likewise. + (mips_elf64_swap_msym_out): Likewise. + (mips_elf64_create_local_got_entry): Likewise. + (mips_elf64_local_got_index): Likewise. + (mips_elf64_got_page): Likewise. + (mips_elf64_got16_entry): Likewise. + (mips_elf64_local_relocation_p): Likewise. + (mips_elf64_next_relocation): Likewise. + (mips_elf64_create_dynamic_relocation): Likewise. + (mips_elf64_calculate_relocation): Likewise. + (mips_elf64_obtain_contents): Likewise. + (mips_elf64_perform_relocation): Likewise. + (mips_elf64_relocate_section): Likewise. + (mips_elf64_create_dynamic_sections): Likewise. + (mips_elf64_adjust_dynamic_symbol): Likewise. + (mips_elf64_always_size_sections): Likewise. + (mips_elf64_size_dynamic_sections): Likewise. + (mips_elf64_finish_dynamic_symbol): Likewise. + (mips_elf64_finish_dynamic_sections): Likewise. + (mips_elf64_gc_mark_hook): Likewise. + (mips_elf64_gc_sweep_hook): Likewise. + (mips_elf64_create_got_section): Likewise. + (mips_elf64_record_global_got_symbol): Likewise. + (mips_elf64_create_msym_section): Likewise. + (mips_elf64_allocate_dynamic_relocations): Likewise. + (mips_elf64_check_relocs): Likewise. + (mips_elf64_output_extsym): Likewise. + (mips_elf64_swap_gptab_in): Likewise. + (mips_elf64_swap_gptab_out): Likewise. + (gptab_compare): Likewise. + (mips_elf64_final_link): Likewise. + (prev_reloc_addend): Remenber addend of previous parts of a combined + reloc. + (ELF_MIPS_GP_OFFSET): New define. + (STUB_LW,STUB_MOVE,STUB_JALR,STUB_LI16): Likewise. + (MIPS_FUNCTION_STUB_SIZE): Likewise. + (mips_elf64_howto_rel): Fix HOWTO defines. + (mips_elf64_howto_rela): Likewise. + (mips_elf64_swap_reloca_out): Fix signedness. + (mips_elf64_be_swap_reloc_in): Use ELF64* instead of ELF32*. + (mips_elf64_be_swap_reloca_in): Likewise. + (mips_elf64_be_swap_reloc_out): Likewise. Preserve extended type info. + (mips_elf64_be_swap_reloca_out): Likewise. + +2001-12-15 Jakub Jelinek + + * elf-bfd.h (_bfd_elf_maybe_strip_eh_frame_hdr): New prototype. + * elf-eh-frame.c (struct eh_frame_hdr_info): Add strip. + (_bfd_elf_discard_section_eh_frame): Don't create .eh_frame_hdr + sec_info here. Free ehbuf. + (_bfd_elf_discard_section_eh_frame_hdr): Don't size the section + if hdr_info->strip. + (_bfd_elf_maybe_strip_eh_frame_hdr): New. + * elflink.h (size_dynamic_sections): Call it. + +2001-12-14 Alan Modra + + * elflink.h (elf_bfd_discard_info): Fix segfault when dynobj NULL. + +2001-12-13 Jakub Jelinek + + * elf-bfd.h (enum elf_link_info_type): New. + (struct bfd_elf_section_data): Remove stab_info and merge_info + fields, add sec_info and sec_info_type. + (struct elf_obj_tdata): Add eh_frame_hdr field. + (_bfd_elf_discard_section_eh_frame): New prototype. + (_bfd_elf_discard_section_eh_frame_hdr): Likewise. + (_bfd_elf_eh_frame_section_offset): Likewise. + (_bfd_elf_write_section_eh_frame): Likewise. + (_bfd_elf_write_section_eh_frame_hdr): Likewise. + * Makefile.am (BFD32_BACKENDS): Add elf-eh-frame.lo. + (BFD32_BACKENDS_CFILES): Add elf-eh-frame.c. + (elf-eh-frame.lo): New. + * Makefile.in: Rebuilt. + * configure.in (elf): Add elf-eh-frame.lo. + * configure: Rebuilt. + * elf.c (_bfd_elf_print_private_bfd_data): Support PT_GNU_EH_FRAME. + (map_sections_to_segments): Create PT_GNU_EH_FRAME if requested. + (get_program_header_size): Take into account PT_GNU_EH_FRAME + segment. + (_bfd_elf_rela_local_sym): Use sec_info_type and sec_info. + (_bfd_elf_rel_local_sym): Likewise. + (_bfd_elf_section_offset): Likewise. Call + _bfd_elf_eh_frame_section_offset too. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Use sec_info_type and + sec_info. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf-eh-frame.c: New file. + * elflink.h (elf_link_add_object_symbols): Don't optimize SHF_MERGE + .stab sections. Set sec_info_type, use sec_info instead + of merge_info and stab_info. + (elf_link_create_dynamic_sections): Create .eh_frame_hdr section + if --eh-frame-hdr. + (elf_bfd_final_link): Write .eh_frame_hdr section. + (elf_link_sec_merge_syms): Use sec_info_type and sec_info. + (elf_link_input_bfd): Likewise. + Call _bfd_elf_write_section_eh_frame to write .eh_frame sections. + (elf_bfd_discard_info): Add output_bfd argument. + Call _bfd_elf_discard_section_eh_frame and + _bfd_elf_discard_section_eh_frame_hdr. + (elf_section_ignore_discarded_relocs): Use sec_info_type, not section + names. + * bfd-in.h (bfd_elf32_discard_info, bfd_elf64_discard_info): Adjust + prototypes. + * bfd-in2.h (bfd_elf32_discard_info, bfd_elf64_discard_info): Likewise. + +2001-12-12 Richard Henderson + + * syms.c (_bfd_generic_read_minisymbols): Early return for + no symbols. Patch from FreeBSD folk; exact origin unknown. + +2001-12-11 Alan Modra + + * elfcode.h (elf_swap_ehdr_out): Adjust value written for e_shnum + and e_shstrndx if out of range. + (elf_object_p): Read extended values for e_shnum and e_shstrndx + from the first section header. Allocate space in elf_elfsections + for reserved sections and set to NULLs. + (elf_write_shdrs_and_ehdr): Set overflow fields in first section + header. Skip reserved sections in elf_elfsections. Remove + duplicate size calculation. + +2001-12-07 Geoffrey Keating + Richard Henderson + Corinna Vinschen + + * Makefile.am: Add support for xstormy16. + * archures.c: Add support for xstormy16. + * config.bfd: Add support for xstormy16. + * configure.in: Add support for xstormy16. + * reloc.c: Add support for xstormy16. + * targets.c: Add support for xstormy16. + * cpu-xstormy16.c: New file. + * elf32-xstormy16.c: New file. + * Makefile.in: Regenerated. + * bfd-in2.h: Regenerated. + * configure: Regenerated. + * libbfd.h: Regenerated. + +2001-12-07 Nick Clifton + + * elf.c (assign_file_positions_for_segments): Combine sentance + fragments into a single sentance in order to permit better + translation into foreign languages. + +2001-12-07 Jim Blandy + + * elf32-s390.c (elf32_s390_grok_prstatus): New function. + (elf_backend_grok_prstatus): Define. + +2001-12-07 Jakub Jelinek + + * elf32-sparc.c (elf32_sparc_relocate_section): Revert + 2001-09-14 change. + +2001-12-07 Jakub Jelinek + + * elf.c (_bfd_elf_rela_local_sym): Only call + _bfd_merged_section_offset if merge_info is non-NULL. + (_bfd_elf_rel_local_sym, _bfd_elf_section_offset): New. + * elf-bfd.h (_bfd_elf_rel_local_sym, _bfd_elf_section_offset): New + prototypes. + * elf32-arm.h (elf32_arm_final_link_relocate): Use + _bfd_elf_section_offset. + (elf32_arm_relocate_section): Use _bfd_elf_rel_local_sym. + * elf32-i386.c (elf_i386_relocate_section): Use + _bfd_elf_section_offset and _bfd_elf_rel_local_sym. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Use + _bfd_elf_section_offset. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mips.c (mips_elf_create_dynamic_relocation): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Likewise. + +2001-12-07 Alan Modra + + * elf32-hppa.c (clobber_millicode_symbols): Don't do anything if + already forced local. + +2001-12-05 Nick Clifton + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Combine + fragmented sentence parts into a whole sentence to permit + better translation into foreign languages. + +2001-12-06 Hans-Peter Nilsson + + * configure: Regenerate. + * Makefile.in: Regenerate. + +2001-12-05 Thiemo Seufer + + * Makefile.am: split up BFD_LIBS like statements in BFD32_LIBS and + BFD64_LIBS, make the latter depending on the availability of BFD64. + Add archive64.c source file. + * archive64.c: New file implementing bfd_elf64_archive_slurp_armap + and bfd_elf64_archive_write_armap, code from elf64-mips.c + * archive.c (bfd_slurp_armap): Add ELF64 archive support. + * config.bfd (mips*-*-irix6*): Allow with BFD64 only. + (mips64*el-*-linux*): Likewise. + (mips*el-*-linux*): Likewise. Reorder entries. + * configure.in (bfd_libs): Define in dependency of BFD64 and + AC_SUBST it. + * elf64-mips.c (mips_elf64_slurp_armap): Remove, use + bfd_elf64_archive_slurp_armap instead. + (mips_elf64_write_armap): Remove, use bfd_elf64_archive_write_armap + instead. + +2001-12-04 Thiemo Seufer + + * config.bfd: Remove trailing blanks. + * elf32-mips.c (gprel16_with_gp): Remove superfluous casts. + +2001-12-04 Alexandre Oliva + + * elf32-d10v.c (elf_d10v_howto_table): Adjust bit-size of + R_D10V_10_PCREL_L, R_D10V_10_PCREL_R, R_D10V_18, + R_D10V_18_PCREL. Check 10_PCREL relocations as signed. + Disable pointless overflow checking of NONE and 32. + +2001-12-04 Alan Modra + + * reloc.c (bfd_install_relocation): Correct reloc address test. + (bfd_perform_relocation): Formatting fix. + * bfd-in2.h: Regenerate for 2001-12-02 reloc.c change. + +2001-12-03 Nick Clifton + + * configure.in (LINGUAS): Add tr. + * configure: Regenerate. + * po/tr.po: Import from translation project's web site. + +2001-12-03 Alan Modra + + * elf32-hppa.c (hppa_get_stub_entry): Remove debug message that + happens to trigger on undefined symbols. + (final_link_relocate): Return bfd_reloc_undefined for undefined + stubs. + (elf32_hppa_relocate_section): Don't say we can't handle a reloc + if we have already warned about an undefined symbol. + +2001-12-02 Thiemo Seufer + + * elf32-mips.c (NEWABI_P): New define. + (USE_REL): Remove, replaced by + (elf_backend_may_use_rel_p): New define. + (elf_backend_may_use_rela_p): Likewise. + (elf_backend_default_use_rela_p): Likewise. + (elf_mips_howto_table): Rename to elf_mips_howto_table_rel. + Fix some relocation definitions. + (elf_mips_howto_table_rela): New RELA relocation definitions for + NewABI support. + (mips32_64bit_reloc): Use the renamed elf_mips_howto_table_rel. + (bfd_elf32_bfd_reloc_type_lookup): Likewise. + (mips_rtype_to_howto): Likewise. + (_bfd_mips_elf_relocate_section): Likewise. + (_bfd_mips_elf_object_p): Typo. + (elf_backend_sign_extend_vma): Reordered together with many other + defines nearby to resemble the order of declaration in the header + file. + +2001-12-02 Thiemo Seufer + + * coff-mips.c (mips_bfd_reloc_type_lookup): Replace + BFD_RELOC_MIPS_GPREL by BFD_RELOC_GPREL16. + * pe-mips.c (mips_bfd_reloc_type_lookup): Likewise. + * elf32-mips.c (mips_reloc_map): Likewise. Replace + BFD_RELOC_MIPS_GPREL32 by BFD_RELOC_GPREL32. + * elf64-mips.c (mips_reloc_map): Likewise. + * reloc.c (BFD_RELOC_MIPS_GPREL): Remove. + (BFD_RELOC_MIPS_GPREL32): Remove. + +2001-11-30 H.J. Lu + + * elflink.h (elf_add_default_symbol): New. + (elf_link_add_object_symbols): Call elf_add_default_symbol () + to create an indirect symbol from the default for the symbol + with the default version if needed. + +2001-11-29 "Peter.Schauer" + + * elf.c (elfcore_grok_prstatus): Do not overwite the core signal + if it has already been set by another thread. + +2001-11-28 Jakub Jelinek + + * elf64-alpha.c (ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED): Defined. + (elf64_alpha_relocate_section): Translate local_got_entries + for STT_SECTION symbol to SHF_MERGE section the first time + we see it. + * elfxx-ia64.c (struct elfNN_ia64_local_hash_entry): Add + sec_merge_done. + (get_local_sym_hash): New, extracted from get_dyn_sym_info. + (get_dyn_sym_info): Use it. + (elfNN_ia64_relocate_section): Translate local dyn entries + for STT_SECTION symbol to SHF_MERGE section the first time + we see it. + +2001-11-27 H.J. Lu + + * elflink.h (elf_bfd_discard_info): Skip if the input bfd isn't + ELF. + +2001-11-26 Jeffrey A Law (law@cygnus.com) + + * stabs.c (_bfd_discard_section_stabs): Use PARAMS in function + prototypes. + +2001-11-24 Alan Modra + + * elf32-hppa.c (elf32_hppa_size_stubs): Decrease default stub + group sizes to accommodate c++. + +2001-11-23 Jakub Jelinek + + * elf32-sparc.c (elf32_sparc_relocate_section): Don't clear + relocations in non-alloced sections against global symbols + defined in shared library being built. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + +2001-11-23 Jakub Jelinek + + * elf.c (_bfd_elf_rela_local_sym): New. + * elflink.h (elf_link_input_bfd): Don't consider empty + merged sections as removed in relocation tests. + * elf-bfd.h (_bfd_elf_rela_local_sym): Add prototype. + * elf32-i386.c (elf_i386_relocate_section): Handle relocs + against STT_SECTION symbol of SHF_MERGE section. + * elf32-arm.h (elf32_arm_relocate_section): Likewise. + * elf32-avr.c (elf32_avr_relocate_section): Call + _bfd_elf_rela_local_sym. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. + * elf32-fr30.c (fr30_final_link_relocate): Likewise. + * elf32-h8300.c (elf32_h8_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-i860.c (elf32_i860_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-mmix.c (mmix_elf_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elf-hppa.h (elf_hppa_relocate_section): Likewise. + * elf-m10200.c (mn10200_elf_relocate_section): Likewise. + * elf-m10300.c (mn10300_elf_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise for + !partial_inplace relocs. Handle relocs against STT_SECTION + symbol of SHF_MERGE for partial_inplace relocs. + +2001-11-21 Nick Clifton + + * po/Make-in (distclean): Move SRC-POTFILES.in and + BLD-POTFILES.in to maintainer-clean target. + +2001-11-21 Alan Modra + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Test r_symndx rather + than sym_sec->output_section to detect relocs against discarded + sections. + +2001-11-19 H.J. Lu + + * elflink.h (elf_link_input_bfd): Assert r_symndx != 0 when + discarding relocations. + +2001-11-19 Nick Clifton + + * section.c (bfd_is_const_section): New macro. Return true if the + given seciton is one of the special, constant, sections. + * bfd-in2.h: Regenerate. + * coffgen.c (coff_count_linenumbers): Use bfd_is_const_section. + (coff_write_native_symbol): Use bfd_is_const_section. + +2001-11-19 Alan Modra + + * elf32-hppa.c (clobber_millicode_symbols): Dec dynstr refcount. + + * elf32-hppa.c (elf32_hppa_size_stubs): Don't consider undefined + millicode syms as candidates for import stubs. + + * elf32-hppa.c (PLABEL_PLT_ENTRY_SIZE): Delete. + (allocate_PIC_calls): Rename to allocate_plt_static. + (allocate_dynrelocs): Move most of code handling .plt entries to.. + (allocate_plt_static): ..here. Don't drop plabel entries. + +2001-11-19 Hans-Peter Nilsson + + * mmo.c: Adjust documentation tags to use texinfo 4 features. + +2001-11-16 Nick Clifton + + * section.c (bfd_is_const_section): New macro. Return true if the + section pointer refers to one of the special, constant sections. + * bfd-in2.h: Regenerate. + + * coffgen.c (coff_count_linenumbers): Only update the line number + count in non-special sections. + (coff_write_native_symbol): Only update the line number file + position in non-special sections. + +2001-11-15 Daniel Jacobowitz + + * elflink.h (elf_reloc_symbol_deleted_p): Catch all relocs against + local syms from discarded sections. Update comment. + +2001-11-15 Alan Modra + + * po/SRC-POTFILES.in: Regenerate. + + * elflink.h (elf_link_input_bfd): Complain about all relocs + against local syms from discarded sections. K&R fixes. + (elf_reloc_symbol_deleted_p): Don't try to swap in external syms. + K&R fixes. + +2001-11-15 Alexandre Oliva + + * elf64-sparc.c (sparc64_elf_relocate_section): Disregard + overflows in the .stab section. + +2001-11-14 Daniel Jacobowitz + + * bfd-in.h (bfd_elf32_discard_info): Add prototype. + (bfd_elf64_discard_info): Likewise. + * bfd-in2.h: Regenerate. + * elf-bfd.h (struct elf_reloc_cookie): New. + (struct elf_backend_data): Add elf_backend_discard_info, + elf_backend_ignore_discarded_relocs, and elf_backend_write_section. + (_bfd_elf32_reloc_symbol_deleted_p): Add prototype. + (_bfd_elf64_reloc_symbol_deleted_p): Likewise. + * elf32-mips.c (_bfd_elf32_mips_discard_info): New. + (_bfd_elf32_mips_ignore_discarded_relocs): New. + (_bfd_elf32_mips_write_section): New. + (elf_backend_discard_info): Define. + (elf_backend_ignore_discarded_relocs): Define. + (elf_backend_write_section): Define. + * elfcode.h (elf_bfd_discard_info): Define. + (elf_reloc_symbol_deleted_p): Define. + * elflink.h (elf_link_input_bfd): Check + elf_section_ignore_discarded_relocs. Call + bed->elf_backend_write_section if available. + (elf_reloc_symbol_deleted_p): New. + (elf_bfd_discard_info): New. + (elf_section_ignore_discarded_relocs): New. + * elfxx-target.h (elf_backend_discard_info): Define. + (elf_backend_ignore_discarded_relocs): Define. + (elf_backend_write_section): Define. + (elfNN_bed): Add elf_backend_discard_info, + elf_backend_ignore_discarded_relocs, and + elf_backend_write_section. + * libbfd-in.h (_bfd_discard_section_stabs): Add prototype. + * libbfd.h: Regenerate. + * stabs.c (_bfd_discard_section_stabs): New. + +2001-11-14 Martin Schwidefsky + + * elf32-s390.c (elf_s390_relocate_section): Use the "unresolved_reloc" + scheme to get rid of an ugly complicated test. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + +2001-11-14 Andreas Jaeger + + * cpu-i386.c (bfd_x86_64_arch_intel_syntax,bfd_x86_64_arch): Use + x86-64 for display. + +2001-11-14 Jakub Jelinek + + * dwarf2.c (struct line_head) [total_length]: Change type to + bfd_vma. + (struct dwarf2_debug): Add dwarf_str_buffer and dwarf_str_size. + (struct comp_unit): Add stash and offset_size. + (read_8_bytes): Return bfd_vma. + (read_indirect_string): New. + (read_attribute): Handle DW_FORM_strp. + (decode_line_info): Support 64-bit DWARF format. + (_bfd_dwarf2_find_nearest_line): Likewise. + (parse_comp_unit): Set offset_size and stash. + +2001-11-13 Keith Walker + + * dwarf2.c (read_attribute_value): New function to handle + DW_FORM_indirect. + (read_attribute): Use it. + +2001-11-13 Geoffrey Keating + + * dwarf2.c (decode_line_info): Properly deal with unknown standard + opcodes. + +2001-11-13 John Marshall + Alan Modra + + * section.c (bfd_make_section_anyway): Don't increment section_id + and the BFD's section_count if adding the section failed. + * vms.c (vms_new_section_hook): Adjust for bfd_make_section_anyway + change. + +2001-11-12 Orjan Friberg + + * elf32-cris.c (cris_elf_grok_prstatus): Adjust values to match new + core dump format. + +2001-11-11 H.J. Lu + + * elf32-mips.c (_bfd_mips_elf_finish_dynamic_sections): Call + _bfd_elf_strtab_size instead of _bfd_stringtab_size. + + * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Change + dynstr type to `struct elf_strtab_hash *'. + +2001-11-11 Hans-Peter Nilsson + + * elf-strtab.c (_bfd_elf_strtab_finalize): Make first variable i + size_t. Rename second i to j. + +2001-11-10 Jeffrey A Law (law@cygnus.com) + + * binary.c: Include safe-ctype.h after bfd.h and sysdep.h. + +2001-11-10 Alan Modra + + * elf32-arm.h (elf32_arm_final_link_relocate): Don't copy STN_UNDEF + relocs into shared libs. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mips.c (mips_elf_calculate_relocation): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + + * elf.c (bfd_section_from_r_symndx): New function. + * elf-bfd.h (LOCAL_SYM_CACHE_SIZE): Define. + (struct sym_sec_cache): New. + (bfd_section_from_r_symndx): Declare. + (struct bfd_elf_section_data): Change local_dynrel type to PTR. + * elflink.h (elf_link_input_bfd): Don't test for removed linkonce + relocs when relocatable. Don't zero entire reloc, just zero the + addend and sym. + * elf32-hppa.c (struct elf32_hppa_link_hash_table): Add sym_sec. + (elf32_hppa_link_hash_table_create): Init it. + (elf32_hppa_check_relocs): Track dynamic relocs needed for local + syms on a per-section basis as we do for globals. + (elf32_hppa_gc_sweep_hook): Update for local_dynrel change. + (allocate_dynrelocs): Warning fix. + (elf32_hppa_size_dynamic_sections): Don't allocate relocs when + section has been discarded. + (elf32_hppa_relocate_section): Don't copy STN_UNDEF relocs + into shared libs. + * elf32-i386.c (struct elf_i386_link_hash_table): Add sym_sec. + (elf_i386_link_hash_table_create): Init it. + (elf_i386_check_relocs): Track dynamic relocs needed for local + syms on a per-section basis as we do for globals. + (elf_i386_gc_sweep_hook): Update for local_dynrel change. + Remove dead code. + (allocate_dynrelocs): Warning fix. + (elf_i386_size_dynamic_sections): Don't allocate relocs when + section has been discarded. + (elf_i386_relocate_section): Don't copy STN_UNDEF relocs + into shared libs. + * elf32-s390.c (struct elf_s390_link_hash_table): Add sym_sec. + (elf_s390_link_hash_table_create): Init it. + (elf_s390_check_relocs): Track dynamic relocs needed for local + syms on a per-section basis as we do for globals. + (elf_s390_gc_sweep_hook): Update for local_dynrel change. + Remove dead code. + (allocate_dynrelocs): Warning fix. + (elf_s390_size_dynamic_sections): Don't allocate relocs when + section has been discarded. + (elf_s390_relocate_section): Don't copy STN_UNDEF relocs + into shared libs. + * elf64-ppc.c (struct ppc_link_hash_table): Add sym_sec. + (ppc64_link_hash_table_create): Init it. + (ppc64_elf_check_relocs): Track dynamic relocs needed for local + syms on a per-section basis as we do for globals. + (ppc64_elf_gc_sweep_hook): Update for local_dynrel change. + (allocate_dynrelocs): Call the correct record_dynamic_dymbol + function. Warning fix. + (ppc64_elf_size_dynamic_sections): Don't allocate relocs when + section has been discarded. + (ppc64_elf_relocate_section): Don't copy STN_UNDEF relocs + into shared libs. + * elf64-s390.c (struct elf_s390_link_hash_table): Add sym_sec. + (elf_s390_link_hash_table_create): Init it. + (elf_s390_check_relocs): Track dynamic relocs needed for local + syms on a per-section basis as we do for globals. + (elf_s390_gc_sweep_hook): Update for local_dynrel change. + Remove dead code. + (allocate_dynrelocs): Warning fix. + (elf_s390_size_dynamic_sections): Don't allocate relocs when + section has been discarded. + (elf_s390_relocate_section): Don't copy STN_UNDEF relocs + into shared libs. + +2001-11-08 Martin Schwidefsky + + * elf32-s390: Major rework that introduces all recent changes to + the s390 backends. Get a closer match to elf32-i386. + (elf_s390_relocate_section): Make use of dynamic section short-cuts. + Localise vars, and delay setting. Better error reporting, replace + BFD_ASSERT with abort. Check ELF_LINK_HASH_DEF_DYNAMIC to see if a + symbol is not defined in the regular object file and tread the weak + definition as the normal one. Don't discard relocs for undefweak or + undefined symbols and check !DEF_REGULAR as well as DEF_DYNAMIC in + test for avoided copy relocs. Reinstate fudge for unresolved relocs + in debugging sections. + (elf32_s390_adjust_dynamic_symbol): Handle nocopyreloc. Don't do copy + reloc processing for weakdefs. Remove redundant casts and aborts. + Delay setting of vars until needed. Move creation of dynamic symbols + and allocation of .plt and .rela.plt to allocate_dynrelocs. Replace + BFD_ASSERT with abort. Discard .plt entries for everything with + plt.refcount <= 0. + (elf_s390_check_relocs): Don't allocate space for dynamic relocs, + .got or .relgot here but do it in allocate_dynrelocs. Reference count + possible .plt and .got entries. Don't test input section SEC_READONLY + here to try to avoid copy relocs, and keep dyn_relocs regardless of + ELF_LINK_NON_GOT_REF. Don't set DF_TEXTREL here. Delay setting of + variables until needed. Remove separate switch stmt for creating .got + section. Initialise local_got_refcounts to 0. Cache pointer to + "sreloc" section in elf_section_data. Tweak condition under which .got + created. Report files with bad relocation section names. + (elf_s390_finish_dynamic_symbol): Don't copy relocs for symbols that + have been forced local. Use same test to decide if we can use a + relative reloc for got as elf_s390_relocate_section. Expand SHN_UNDEF + comment. Move expressions out of function calls. Replace BFD_ASSERT + with abort. + (elf_s390_finish_dynamic_sections): Migrate common code out of switch + statement. Replace BFD_ASSERT with abort. + (elf_s390_size_dynamic_sections): Call readonly_dynrelocs. Rename "i" + to "ibfd". Allocate space for local dyn relocs. Use DF_TEXTREL flag + instead of looking up section names for DT_TEXTREL. Replace + BFD_ASSERT with abort. Zero out the dynamic allocated content space. + Add a comment to remind us that one day this ought to be fixed. + (struct elf_s390_link_hash_entry): Rename "root" to "elf". + (struct elf_s390_link_hash_table): Likewise. + (elf_s390_link_hash_newfunc): Rename to link_hash_newfunc and get + rid of unnecessary casts. + (struct elf_s390_dyn_relocs): Add "sec", and "pc_count" fields. + Remove "section" field. + (elf_s390_gc_sweep_hook): Sweep dyn_relocs and local_dynrel. + Reference count possible .plt entries. Don't deallocate .got and + .relgot space here. + (struct elf_s390_pcrel_relocs_copied): Rename to elf_s390_dyn_relocs. + Update comment. + (struct elf_s390_link_hash_entry): Rename pcrel_relocs_copied to + dyn_relocs. + (elf_s390_discard_copies): Delete. + (elf_s390_link_hash_traverse): Delete. + (bfd_elf32_bfd_final_link): Delete. (ie. use regular final link + rather than gc variety). + (struct elf_s390_link_hash_table): Add sgot, sgotplt, srelgot, splt, + srelplt, sdynbss, srelbss fields. + (elf_s390_link_hash_table_create): Init them. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (allocate_dynrelocs): New function. + (create_got_section): New function. + (elf_backend_can_refcount): Define. + (elf_backend_copy_indirect_symbol): Define. + (elf_s390_copy_indirect_symbol): New function. + (elf_s390_create_dynamic_sections): New function. + (readonly_dynrelocs): New function. + * elf64-s390.c: Likewise. + +2001-11-07 Jakub Jelinek + + * Makefile.am (BFD32_BACKENDS): Add elf-strtab.lo. + (BFD32_BACKENDS_CFILES): Add elf-strtab.c. + (elf-strtab.lo): Add rule. + * Makefile.in: Rebuilt. + * configure.in (elf): Add elf-strtab.lo. + * configure: Rebuilt. + * elf-bfd.h (elf_strtab_hash): Forward declare. + (struct elf_link_hash_table): Change dynstr type to + struct elf_strtab_hash *. + (struct elf_obj_tdata): Change strtab_ptr type to + struct elf_strtab_hash *. + (_bfd_elf_strtab_init, _bfd_elf_strtab_free, _bfd_elf_strtab_add, + _bfd_elf_strtab_addref, _bfd_elf_strtab_delref, + _bfd_elf_strtab_clear_all_refs, _bfd_elf_strtab_size, + _bfd_elf_strtab_offset, _bfd_elf_strtab_emit, + _bfd_elf_strtab_finalize): New prototypes. + * elf-strtab.c: New file. + * elflink.h (elf_link_add_object_symbols): Use _bfd_elf_strtab_add + and _bfd_elf_strtab_size instead of _bfd_stringtab calls. + Call _bfd_elf_strtab_delref if DT_NEEDED entry is not needed or + when forcing dynamic symbol to local. + (elf_link_create_dynamic_sections): Call + _bfd_elf_strtab_init instead of elf_stringtab_init. + (elf_link_record_local_dynamic_symbol): Likewise, change + dynstr type. Use _bfd_elf_strtab functions instead of + _bfd_stringtab calls. + (size_dynamic_sections): Use _bfd_elf_strtab functions instead of + _bfd_stringtab calls. For DT_RUNPATH and Verdaux vda_name fields, + call _bfd_elf_strtab_addref. Call elf_finalize_dynstr. + (elf_adjust_dynstr_offsets, elf_finalize_dynstr): New functions. + (elf_fix_symbol_flags): Call _bfd_elf_strtab_delref when forcing + dynamic symbol to local. + (elf_link_assign_sym_version): Likewise. + (elf_bfd_final_link): Call _bfd_elf_strtab_emit instead of + _bfd_stringtab_emit. + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Change dynstr + type. Call _bfd_elf_strtab functions instead of + _bfd_stringtab functions. + * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise. + * elf.c (_bfd_elf_init_reloc_shdr): Likewise. + (elf_fake_sections): Likewise. + (assign_section_numbers): Call _bfd_elf_strtab_clear_all_refs + on shstrtab hash table, call _bfd_elf_strtab_addref on each section + name in the output. Call _bfd_elf_strtab_finalize and + use _bfd_elf_strtab_offset to finalize sh_name section header fields. + (_bfd_elf_compute_section_file_positions): Use _bfd_elf_strtab_size + instead of _bfd_stringtab_size. + (prep_headers): Change shstrtab type. + Use _bfd_elf_strtab calls instead of _bfd_stringtab calls. + +2001-11-07 Alan Modra + + * elflink.h (elf_link_input_bfd ): Fix + bad symtab segfault. Formatting and warning fixes. Improve + error message for internationalisation. + +2001-11-06 H.J. Lu (hjl@gnu.org) + + * elflink.h (elf_link_input_bfd): Complain about relocs against + discarded sections. + +2001-11-03 Alan Modra + + * elfxx-target.h (elfNN_bed): Correct want_got_sym, want_dynbss order. + +2001-11-02 H.J. Lu + + * elf32-mips.c (mips_elf_calculate_relocation): Don't create + dynamic relocation for symbols defined in regular objects when + creating executables. + +2001-11-02 Nick Clifton + + * configure.in (ALL_LINGUAS): Add "fr". + * configure: Regenerate. + * po/fr.po: New file. + + * coffgen.c (coff_object_p): Add comment to H.J.'s recent patch. + +2001-11-02 John David Anglin + + * som.c (setup_sections): Initialize subspace_sections. + +2001-11-02 H.J. Lu (hjl@gnu.org) + + * coffgen.c (coff_object_p): Return 0 if the header is too big. + +2001-11-02 Hans-Peter Nilsson + + * elfcore.h (elf_core_file_p): Preserve and clear abfd section + information. Save bfd arch and mach values. Restore on error. + +2001-11-02 Alan Modra + + * elf32-hppa.c (hppa_handle_PIC_calls): Rename to mark_PIC_calls. + (allocate_PIC_calls): New function. + (allocate_dynrelocs): Don't allocate pic_call plt entries here. + (elf32_hppa_size_dynamic_sections): Call allocate_PIC_calls. + (elf32_hppa_finish_dynamic_symbol): Remove dead code. + +2001-11-02 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_grok_prstatus): New function. + (cris_elf_grok_psinfo): New function. + (elf_backend_grok_prstatus): Define. + (elf_backend_grok_psinfo): Define. + +2001-11-01 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Correct branch + prediction bits. + +2001-10-31 Chris Demetriou + + * elf32-mips.c (_bfd_mips_elf_hi16_reloc): Handle PC-relative + relocations properly. + +2001-10-31 H.J. Lu + + * elflink.h (elf_link_output_extsym): Don't clear the visibility + field for relocateable. + +2001-11-01 Alan Modra + + * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Don't count + .plt relocs in DT_RELASZ. + +2001-10-29 NIIBE Yutaka + + * config.bfd: Supports sh3/sh4/sh3eb/sh4eb-unknown-linux-gnu + targets. + +2001-10-31 Nick Clifton + + * targets.c: Fix typo: bfd_mmo_mmix_vec => bfd_mmo_vec. + +2001-10-30 Hans-Peter Nilsson + + * Makefile.am (ALL_MACHINES): Add cpu-mmix.lo. + (BFD64_BACKENDS): Add elf64-mmix.lo and mmo.lo. + (BFD64_BACKENDS_CFILES): Add elf64-mmix.c and mmo.c. + Regenerate dependencies. + * configure.in (bfd_elf64_mmix_vec, bfd_mmo_vec): New vectors. + * config.bfd: [BFD64] (mmix-*-*): New case. + * cpu-mmix.c, mmo.c, elf64-mmix.c: New files. + * archures.c (enum bfd_architecture): Add bfd_arch_mmix. + (bfd_mmix_arch): Declare. + (bfd_archures_list): Add bfd_mmix_arch. + * targets.c (enum bfd_flavour): Add bfd_target_mmo_flavour. + (bfd_elf64_mmix_vec, bfd_mmo_vec): Declare. + (bfd_target_vect) [BFD64]: Add bfd_elf64_mmix_vec and + bfd_mmo_mmix_vec. + * reloc.c: Add MMIX relocations. + * bfd.c (struct _bfd, tdata): Add mmo_data. + * Makefile.in: Regenerate. + * configure: Regenerate. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * configure: Rebuild. + +2001-10-30 Richard Earnshaw (rearnsha@arm.com) + + * elf.c (_bfd_elf_make_section_from_shdr): Set the LMA based on the + p_paddr of the segment that contains it. + (copy_private_bfd_data): If the LMA for a segment is known, use it + for matching sections to segments. + (assign_file_positions_for_segments): Use the LMA when adjusting + for inter-section alignment padding. + +2001-10-29 Kazu Hirata + + * README: Fix a typo. + +2001-10-24 Richard Henderson + + * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Copy + timestamp to time_t for ctime. + +2001-10-24 Hans-Peter Nilsson + + * elf32-cris.c (cris_reloc_type_lookup): Change loop to use + unsigned, increasing index. + +2001-10-23 H.J. Lu + + * elf32-mips.c (_bfd_mips_elf_modify_segment_map): Check + m != NULL before accessing it. + +2001-10-23 Alan Modra + + * elflink.h (elf_link_input_bfd): Zero the reloc instead of doing + bfd_reloc_type_lookup (bfd, BFD_RELOC_NONE) as bfd_reloc_type_lookup + doesn't accept BFD_RELOC_* on some targets, eg. hppa. + + * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove plt_abs. + (hppa_link_hash_newfunc): Likewise. + (elf32_hppa_finish_dynamic_symbol): Likewise. + (allocate_dynrelocs): Always allocate .got relocs if shared. + (elf32_hppa_relocate_section): Output them too. Similarly + consolidate .plt reloc code, and no longer initialise .plt + when a reloc is output. + (elf32_hppa_finish_dynamic_symbol): Only initialise .plt entries + when no reloc is output. + + From Herbert Xu + * elf32-hppa.c (final_link_relocate): Call bfd_set_error for + unreachable branches. + +2001-10-22 H.J. Lu + + * configure.in (WIN32LIBADD): Use -L../libiberty for + mips*-*-linux*. + * configure: Rebuild. + +2001-10-21 H.J. Lu + + * configure.in (WIN32LIBADD): Include -L../libiberty/pic -liberty + if shared library is enabled only for Linux hosts. + * configure: Rebuild. + +2001-10-21 H.J. Lu + + * configure.in (WIN32LIBADD): Check if PICFLAG is defined in + ../libiberty/Makefile instead of $enable_shared. + * configure: Rebuild. + +2001-10-21 H.J. Lu + + * elf32-cris.c (cris_reloc_type_lookup): Use int for index. Cover + index 0. + +2001-10-20 H.J. Lu + + * configure.in (WIN32LIBADD): Include -L../libiberty/pic -liberty + if shared library is enabled. + * configure: Rebuild. + +2001-10-20 H.J. Lu + + * elf32-cris.c (cris_reloc_type_lookup): Allow index 0. + +2001-10-19 H.J. Lu + + * elfcode.h (elf_object_p): Don't clear D_PAGED if the section + size is empty. + +2001-10-18 H.J. Lu + + * elf32-i370.c (i370_elf_relocate_section): Ignore R_XXX_NONE. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + +2001-10-18 Jakub Jelinek + + * section.c (_bfd_strip_section_from_output): Don't count + SEC_EXCLUDE sections as references. Set SEC_EXCLUDE. + +2001-10-17 Alan Modra + + * elf-m10200.c (mn10200_elf_relax_section): Cast assignment to + Elf_Internal_Shdr.contents now that it's no longer a PTR. + * elf-m10300.c (mn10300_elf_relax_section): Likewise. + * elf32-h8300.c (elf32_h8_relax_section): Likewise. + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise. + * elf32-sh.c (sh_elf_relax_section): Likewise. + * elf64-alpha.c (elf64_alpha_relax_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. + * elf.c (setup_group): Warning fixes. + * elflink.h (elf_link_sort_relocs): Likewise. + * pdp11.c (slurp_reloc_table): Likewise. + +2001-10-16 Jeff Holcomb + + * elflink.h (elf_link_sort_relocs): Remove unnecessary pointer + casts. + +2001-10-15 H.J. Lu + + * elflink.h (elf_link_input_bfd): Set type to BFD_RELOC_NONE + for relocations against discarded link-once section. + +2001-10-15 Alan Modra + + * elf32-i386.c (elf_i386_relocate_section): Report some detail on + bfd_reloc_outofrange and similar errors. + + * elf.c (_bfd_elf_link_hash_copy_indirect): Test ind->root.type + rather than ind->weakdef. + * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise. + * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. + * elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. + * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise. + +2001-10-15 Alan Modra + H.J. Lu + + * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Merge dyn_reloc + counts for aliases instead of aborting. + * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. + + * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set plt.offset + to -1 for non-function symbols. + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise. + * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise. + * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. + * elf64-x86-64.c (elf64_x86_64_adjust_dynamic_symbol): Likewise. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Refer to + plt.offset instead of plt.refcount when setting to -1. + +2001-10-12 Nick Clifton + + * elf32-arm.h (elf32_arm_relocate_section): Treat R_ARM_THM_PC22 + like R_ARM_PC24. Include reloc number in error message about + unresolvable relocs. + +2001-10-10 Jakub Jelinek + + * elflink.h (elf_link_sort_cmp2): Don't mix PLT and non-PLT + relocations against the same symbol in .rel{,a}.dyn section. + +2001-10-10 Kazu Hirata + + * aout-encap.c: Fix comment typos. + * aoutx.h: Likewise. + * archive.c: Likewise. + * bout.c: Likewise. + * coff64-rs6000.c: Likewise. + * coffcode.h: Likewise. + * coffgen.c: Likewise. + * cofflink.c: Likewise. + * coff-mips.c: Likewise. + * ecoff.c: Likewise. + * elf32-m32r.c: Likewise. + * libcoff-in.h: Likewise. + * libecoff.h: Likewise. + * libxcoff.h: Likewise. + * nlm32-i386.c: Likewise. + * pdp11.c: Likewise. + * section.c: Likewise. + * som.c: Likewise. + * som.h: Likewise. + * bfd-in2.h: Regenerate. + * libcoff.h: Likewise. + +2001-10-10 Alan Modra + + * elf.c (elf_map_symbols): Don't create new section symbols; Use + existing section syms. Update comments. + (copy_private_bfd_data): Formatting fixes. + (elfcore_grok_win32pstatus): Likewise. + (swap_out_syms): Likewise. Remove unnecessary level of braces. + +2001-10-09 Alan Modra + + * elf-bfd.h (struct bfd_elf_section_data): Rename "group" to + "group_name". + (elf_group_name): Define. + (elf_next_in_group): Define. + * elf.c: Make use of elf_group_name and elf_next_in_group throughout. + (setup_group): Don't use sec->lineno for SHT_GROUP section to store + first member section; Instead use elf_next_in_group. + (bfd_section_from_shdr): Likewise. + (set_group_contents): Likewise. Use elf_section_syms, not sec->symbol. + +2001-10-09 Alan Modra + + * elf-bfd.h (struct bfd_elf_section_data): Add "group" and + "next_in_group". Fix gp and gp_size comments. + * elf.c (union elf_internal_group): New. + (setup_group): New function. + (_bfd_elf_make_section_from_shdr): Set BFD flags for SHT_GROUP. + Call setup_group for SHF_GROUP sections. + (bfd_section_from_shdr): Build a BFD section for SHT_GROUP. + (elf_fake_sections): Set header type for SEC_GROUP, and header + flags for sections in a group. + (set_group_contents): New function. + (_bfd_elf_compute_section_file_positions): Call it. + (assign_section_numbers): Set sh_link for SHT_GROUP. + + * elflink.h (gc_mark_hook): Handle section groups. + * elfxx-target.h: Add SEC_GROUP to applicable_flags. + * section.c (SEC_GROUP): Define. + (struct sec): Comment fixes. + * bfd-in2.h: Regenerate. + + * elf.c (bfd_elf_print_symbol): Formatting fix; migrate expression + out of function args. + (_bfd_elf_canonicalize_reloc): Similarly. + (_bfd_elf_get_symtab): Here too. + (_bfd_elf_canonicalize_dynamic_symtab): And here. + * elfcode.h (elf_slurp_symbol_table): Don't recalculate size for + bfd_bread, and remove unnecessary cast. + +2001-10-08 Aldy Hernandez + + * config.bfd (targ_cpu): Add arm9e-*-elf. + +2001-10-06 Stephane Carrez + + * dwarf2.c (comp_unit_find_nearest_line): Check for end of + compilation unit. + +2001-10-06 Alan Modra + + * bfd.c (bfd_assert): Report bfd version. + (_bfd_abort): Likewise. + + * elflink.h (elf_link_input_bfd): Don't zero discarded link-once + section sym values. Instead replace any relocs against them with + relocs against STN_UNDEF, which has a zero value. + + * elf32-arc.c (elf_arc_howto_table): Set partial_inplace for all + relocs. + +2001-10-05 Jeff Law + + * som.h (som_exec_data): New field "version_id". + * som.c (som_object_setup): Record the version_id if it + exists. + (som_prep_headers): Do not initialize version_id here. + (som_finish_writing): Initialize version_id here. + +2000-10-05 Thiemo Seufer + + * elf32-mips.c (elf_mips_howto_table): Fix some relocation howtos + according to the MIPS/SGI ELF64 ABI Draft. + (mips_elf_sort_hash_table): Typo. + +2001-10-04 Alan Modra + + * elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): Comment typo. + + * elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): Bail out after + copying flags if this is a weakdef. + +2001-10-04 Alan Modra + + * elf-bfd.h (struct elf_link_hash_entry): Reorganise for better + packing. + + * elf32-mips.c (mips_elf_record_global_got_symbol): Set got.offset + to 1 rather than 0 to avoid confusing copy_indirect_symbol. + (mips_elf_sort_hash_table_f): Compare got.offset against 1. + + * Makefile.am (BFD_H_DEPS): Add symcat.h. Ensure everything + depends on $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS), not just those + backends we configure. Run "make dep-am". + (install-data-local): Install symcat.h. + * dep-in.sed: Remove symcat.h from dependencies. + * Makefile.in: Regenerate. + +2001-10-03 Vassili Karpov + + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Handle nocopyreloc. + +2001-10-03 Thiemo Seufer + + * elf64-mips.c (elf_backend_may_use_rela_p): New define. + (elf_backend_default_use_rela_p): New define. + +2001-10-03 Alan Modra + + * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Fix typos in last + change. + + * configure.in (AC_OUTPUT ): Remove version.h. + * configure: Regenerate. + * Makefile.am (BFD_H_FILES): Add version.h. + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + + * elflink.h (elf_fix_symbol_flags): Copy flags to weakdef using + elf_backend_copy_indirect_symbol so that backend has a chance to + copy other necessary fields. + * elf-bfd.h (struct elf_backend_data): Update description of + elf_backend_copy_indirect_symbol. + * elf.c (_bfd_elf_link_hash_copy_indirect): Bail out after + copying flags if this is a weakdef. + * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise. + (elfNN_ia64_aix_add_symbol_hook): Use elf_link_hash_lookup rather + than bfd_link_hash_lookup. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't do copy + reloc processing for weakdefs. + * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise. + +2001-10-02 Alan Modra + + * elf64-ppc.c (ppc64_elf_check_relocs): Use a local var and cast + result of ELF64_R_TYPE to enum before using in a switch. + (ppc64_elf_gc_mark_hook): Likewise. + (ppc64_elf_gc_sweep_hook): Likewise. + (ppc64_elf_reloc_type_class): Likewise. + +2001-10-02 Alan Modra + + * version.h: New file. + * bfd-in.h: (BFD_VERSION): Substitute bfd_version. + (BFD_VERSION_DATE): Define. + (BFD_VERSION_STRING): Define. + * configure.in: AC_SUBST bfd_version, bfd_version_date and + bfd_version_string. + (AC_OUTPUT ): Depend on version.h. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + + * bfd-in.h: Include "symcat.h". + (CONCAT4): Redefine as for old CAT4. + * aout-arm.c: Use equivalent CONCAT* macro in place of CAT* macros. + Add warning regarding whitespace. + * aout-cris.c: Likewise. + * aout-ns32k.c: Likewise. + * aout-sparcle.c: Likewise. + * aout-tic30.c: Likewise. + * aout0.c: Likewise. + * armnetbsd.c: Likewise. + * demo64.c: Likewise. + * elf-bfd.h: Likewise. + * gen-aout.c: Likewise. + * host-aout.c: Likewise. + * hp300bsd.c: Likewise. + * hp300hpux.c: Likewise. + * i386aout.c: Likewise. + * i386bsd.c: Likewise. + * i386dynix.c: Likewise. + * i386freebsd.c: Likewise. + * i386linux.c: Likewise. + * i386lynx.c: Likewise. + * i386mach3.c: Likewise. + * i386netbsd.c: Likewise. + * libaout.h: Likewise. + * m68k4knetbsd.c: Likewise. + * m68klinux.c: Likewise. + * m68klynx.c: Likewise. + * m68knetbsd.c: Likewise. + * m88kmach3.c: Likewise. + * mipsbsd.c: Likewise. + * newsos3.c: Likewise. + * ns32knetbsd.c: Likewise. + * pc532-mach.c: Likewise. + * pdp11.c: Likewise. + * riscix.c: Likewise. + * sparclinux.c: Likewise. + * sparclynx.c: Likewise. + * sparcnetbsd.c: Likewise. + * sunos.c: Likewise. + * targets.c: Likewise. + * vaxnetbsd.c: Likewise. + * vms-hdr.c: Likewise. + +2001-10-01 Alan Modra + + * bfd-in.h: Remove comments regarding generated files. + * libbfd-in.h: Likewise. + * libcoff-in.h: Likewise. + * bfd-in2.h: Regenerate. + * libbfd.h: Likewise. + * libcoff.h: Likewise. + +2001-09-30 kaz Kojima + Hans-Peter Nilsson + + * elf32-sh.c (sh_elf_howto_table, R_SH_REL32): Make + partial_inplace, matching assembler output. Set src_mask to + all ones. + (sh_elf_relocate_section): Delete misplaced comment. + For relocatable linking against section symbol, call + _bfd_relocate_contents for partial_inplace relocs and adjust + rel->r_addend for others. + : Fetch partial_inplace addend with + bfd_get_32, not at rel->r_addend. + +2001-09-30 Alan Modra + + * elf.c (_bfd_elf_link_hash_copy_indirect): Set ind refcounts to + the old dir refcount, so we indirectly set them to init_refcount. + Short-circuit asserts when we've just verified they are true. + +2001-09-29 Alan Modra + + * section.c (struct sec): Remove kept_section. + (STD_SECTION): Remove kept_section initialisation. + (bfd_make_section_anyway): Here too. + * ecoff.c (bfd_debug_section): Remove kept_section initialisation. + * cofflink.c (_bfd_coff_link_input_bfd): Don't test kept_section. + * elflink.h (elf_link_input_bfd): Set discarded link-once section + symbols to zero, and remove all code involved with kept_section + and tracking section symbol values. + * bfd-in2.h: Regenerate. + * configure.in: Bump version number. + * configure: Regenerate. + +2001-09-29 Alan Modra + + * elf64-ppc.c (struct ppc_dyn_relocs): New. + (IS_ABSOLUTE_RELOC): Define. + (struct ppc_link_hash_entry): New. + (struct ppc_link_hash_table): New. + (ppc_hash_table): Define. + (link_hash_newfunc): New function. + (ppc64_elf_link_hash_table_create): New function. + (create_got_section): New function. + (ppc64_elf_create_dynamic_sections): Call create_got_section. Stash + pointers to our dynamic sections in hash table. + (ppc64_elf_copy_indirect_symbol): New function. + (ppc64_elf_check_relocs): Remove DEBUG code. Use short-cuts to + dynamic sections. Localise vars. Modify code for refcounts + starting from zero. Don't allocate here, or force symbols dynamic. + Don't copy all relocs if shared, select ones we need. Add code + to track possible copy relocs for non-shared link. + (ppc64_elf_gc_mark_hook): Update comment. + (ppc64_elf_gc_sweep_hook): Sweep dynrelocs too. + (ppc64_elf_adjust_dynamic_symbol): Remove DEBUG code. Rewrite .plt + code for reference counting garbage collection. Don't create .plt + entries for functions that don't comply with ABI naming convention, + and don't allocate .plt space here. Use short-cuts to dynamic + sections. If possible, keep dynamic relocations instead of using + copy relocs. Remove confused comments. + (ppc_adjust_dynindx): Delete. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (allocate_dynrelocs): New function. + (readonly_dynrelocs): New function. + (ppc64_elf_size_dynamic_sections): Rewrite. Allocate local .got + space here, and call allocate_dynrelocs to allocate space for + global .plt, .got and reloc sections. Use short-cuts to dynamic + sections. Call readonly_dynrelocs to determine whether we need + DT_TEXTREL. Don't generate section symbols here, the generic + ELF linker code does it for us. + (ppc64_elf_final_link): Call regular ELF backend linker rather than + gc variety, since we do our own .got handling. + (ppc64_elf_relocate_section): Remove DEBUG code. Make use of + dynamic section short-cuts. Localise vars, and delay setting. + Handle unknown relocs in main switch statement. Replace ugly + complicated tests for unresolvable relocs with a simple direct + scheme using "unresolved_reloc" var. Test ELF_ST_VISIBILITY + before allowing an undefined sym in a shared lib. Do R_*_DS tests + after main switch, when we've set addend. Do non-addend insn + tweaks before main swithc. Ignore input_section->vma when + calculating reloc offsets as it's always zero. Rewrite dynamic + reloc handling. Consolidate R_*_HA handling. Handle more relocs. + (ppc64_elf_finish_dynamic_symbol): Remove DEBUG code. Make use + of dynamic section short-cuts. Reorganise .plt handling code. + Remove confused comments. Take note of ELF_LINK_FORCED_LOCAL. + Move expressions out of swap_reloca_out function calls. + (ppc64_elf_reloc_type_class): New function. + (ppc64_elf_info_to_howto): Move common expression to local var. + (ppc64_elf_finish_dynamic_sections): Remove DEBUG code. Make use + of dynamic section short-cuts. Don't fiddle with section syms + here as the ELF linker does it for us. + (elf_backend_can_refcount): Define. + (bfd_elf64_bfd_link_hash_table_create): Define. + (elf_backend_copy_indirect_symbol): Define. + (elf_backend_reloc_type_class): Define. + (elf_backend_*, bfd_elf64_bfd_* defines): Sort. + +2001-09-29 Alan Modra + + * elf-bfd.h (struct elf_link_local_dynamic_entry): Add init_refcount. + (struct elf_backend_data): Add can_refcount. + * elf.c (_bfd_elf_link_hash_newfunc): Get rid of a few casts. Set + got.refcount and plt.refcount from init_refcount. + (_bfd_elf_link_hash_table_init): Set up init_refcount. + (_bfd_elf_link_hash_copy_indirect): Reference got/plt.refcount + rather than got/plt.offset, and test for <= 0 rather than -1. + * elflink.h (size_dynamic_sections): Set init_refcount to -1. + * elfxx-target.h (elf_backend_can_refcount): Define. + (elfNN_bed): Init can_refcount. + * linker.c (_bfd_link_hash_newfunc): Get rid of a few casts. + (_bfd_generic_link_hash_newfunc): Likewise. + * elf32-cris.c (cris_elf_check_relocs): Modify for refcounts + starting from zero. + (elf_backend_can_refcount): Define. + * elf32-hppa.c (elf32_hppa_check_relocs): Modify for refcounts + starting from zero. + (elf32_hppa_copy_indirect_symbol): Make static to agree with + prototype. + (elf_backend_can_refcount): Define. + * elf32-i386.c (elf_i386_check_relocs): Modify for refcounts + starting from zero. + (allocate_dynrelocs): Set plt/got.offset rather than *.refcount. + (elf_i386_finish_dynamic_symbol): Expand SHN_UNDEF comment. + (elf_i386_finish_dynamic_sections): Use local var so line < 80 chars. + (elf_backend_can_refcount): Define. + (elf_i386_copy_indirect_symbol): Make static to agree with + prototype. Formatting fix. + * elf32-m68k.c (elf_m68k_check_relocs): Modify for refcounts + starting from zero. + (elf_backend_can_refcount): Define. + * elf32-ppc.c (ppc_elf_check_relocs): Modify for refcounts + starting from zero. + (elf_backend_can_refcount): Define. + * elf32-s390.c (elf_s390_check_relocs): Modify for refcounts + starting from zero. + (elf_backend_can_refcount): Define. + * elf64-s390.c (elf_s390_check_relocs): Modify for refcounts + starting from zero. + (elf_backend_can_refcount): Define. + * elf64-x86-64.c (elf64_x86_64_check_relocs): Modify for refcounts + starting from zero. + (elf_backend_can_refcount): Define. + + * som.c (som_write_symbol_strings): Cast current_offset in + bfd_seek call to match param type. + +2001-09-28 J. Brobecker + + * som.c (som_write_symbol_strings): Fix incorrect type of + current_offset to match the function definition. Fixes a build + failure on HPUX-11.00. + +2001-09-28 Richard Henderson + + * elfxx-target.h [section_flags]: Add SEC_ARCH_BIT_0, SEC_SMALL_DATA, + SEC_MERGE, SEC_STRINGS. + + * section.c (SEC_ARCH_BIT_0): New; replace unused SEC_BALIGN. + * bfd-in2.h: Rebuild. + +2001-09-28 Alan Modra + + * elf64-x86-64.c (elf64_x86_64_reloc_type_lookup): Don't map bfd + reloc code using x86_64_reloc_map. + + * elf32-hppa.c (elf32_hppa_check_relocs): Update comment since we + no longer allocate here. Localise some vars to blocks where they + are used. + (elf32_hppa_adjust_dynamic_symbol): Correct a comment. Delay + setting of vars until needed. + (allocate_dynrelocs): Don't create a .plt entry without a reloc + when symbol visibilty makes a function local. + (elf32_hppa_finish_dynamic_symbol): Move expressions out of + swap_reloca_out function calls. + (elf32_hppa_relocate_section): Likewies. Comment typo fix. + (elf32_hppa_finish_dynamic_sections): Migrate common code out of + switch statement. + + * elf32-i386.c (elf_i386_check_relocs): Update comment since we + no longer allocate here. Localise some vars to blocks where they + are used. Remove separate switch stmt for creating .got sec. + (elf_i386_adjust_dynamic_symbol): Correct a comment. Remove + redundant casts and aborts. Delay setting of vars until needed. + (allocate_dynrelocs): Remove redundant casts and aborts. + (elf_i386_size_dynamic_sections): Move comment. + (elf_i386_finish_dynamic_symbol): Move expressions out of function + calls. + (elf_i386_relocate_section): Likewise. Comment typo fix. + (elf_i386_finish_dynamic_sections): Migrate common code out of + switch statement. + (elf_backend_* defines): Sort. + + * elf32-i386.c (allocate_dynrelocs): Don't create a .plt entry + without a reloc when symbol visibilty makes a function local. + +2001-09-27 Nick Clifton + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix detection of + conflicting float flags. + +2001-09-26 Alan Modra + + * elf32-i386 (elf_i386_copy_indirect_symbol): New function. + (elf_backend_copy_indirect_symbol): Define. + (struct elf_i386_link_hash_entry): Rename "root" to "elf". + (struct elf_i386_link_hash_table): Likewise. + (link_hash_newfunc): Get rid of unnecessary casts. + (elf_i386_link_hash_table_create): Likewise. + (elf_i386_check_relocs): Initialise local_got_refcounts to 0. + Don't test input section SEC_READONLY here to try to avoid copy + relocs, and keep dyn_relocs regardleas of ELF_LINK_NON_GOT_REF. + (elf_i386_adjust_dynamic_symbol): Check output section SEC_READONLY + here to properly test whether we need copy relocs. Do so for weak + syms too. + + * elf32-hppa (elf32_hppa_copy_indirect_symbol): New function. + (elf_backend_copy_indirect_symbol): Define. + (struct elf32_hppa_link_hash_table): Rename "root" to "elf". + (stub_hash_newfunc): Get rid of unnecessary casts. + (hppa_link_hash_newfunc): Likewise. + (elf32_hppa_check_relocs): Initialise local_got_refcounts to 0. + Don't test input section SEC_READONLY here to try to avoid copy + relocs, and keep dyn_relocs regardleas of ELF_LINK_NON_GOT_REF. + (elf32_hppa_adjust_dynamic_symbol): Check output section SEC_READONLY + here to properly test whether we need copy relocs. Do so for weak + syms too. + +2001-09-26 Alan Modra + + * bfd.c (_bfd_default_error_handlerl): Define using VPARAMS, + VA_OPEN, VA_FIXEDARG, VA_CLOSE. + (bfd_archive_filename): Cast bfd_malloc arg to the correct size. + +2001-09-25 Jakub Jelinek + + * elf64-sparc.c (sparc64_elf_build_plt): Fix .plt[32768+] slot + computation. + +2001-09-25 H.J. Lu + + * bfd-in2.h: Regenerated. + +2001-09-25 Alan Modra + + * elf32-i386.c: Add comment re linker function names and ordering. + (elf_i386_link_hash_newfunc): Rename to link_hash_newfunc. + (elf_i386_grok_prstatus): Move before linker functions. + (elf_i386_grok_psinfo): Likewise. + (elf_i386_fake_sections): Move so that functions are ordered. + (elf_i386_reloc_type_class): Likewise. Comment function purpose. + +2001-09-25 Alan Modra + + * elf32-hppa.c: Rename occurrences of "hplink" to "htab" + throughout file. + + * elf32-hppa.c: (LONG_BRANCH_PIC_IN_SHLIB): Delete. Remove all + code handling this option. + (LONG_BRANCH_VIA_PLT): Likewise. + (RELATIVE_DYNRELOCS): Define as zero. + (struct elf32_hppa_dyn_reloc_entry): Add "sec", and + "pc_count" fields. Remove "section" field. + (elf32_hppa_link_hash_entry): Rename reloc_entries to dyn_relocs. + (elf32_hppa_check_relocs): Don't allocate space for dynamic + relocs here. Instead, record all needed dynamic relocs via + dyn_relocs and local_dynrel. Cache pointer to "sreloc" section + in elf_section_data. + (elf32_hppa_gc_sweep_hook): Sweep dyn_relocs and local_dynrel. + (allocate_plt_and_got_and_discard_relocs): Rename to + allocate_dynrelocs. Allocate rather than discarding dyn relocs. + (readonly_dynrelocs): New function. + (elf32_hppa_size_dynamic_sections): Mark output_bfd unused. + Call readonly_dynrelocs to determine need for DT_TEXTREL. + Rename "i" to "ibfd". Allocate space for local dyn relocs. + (elf32_hppa_relocate_section): Make use of cached sreloc. + (elf32_hppa_reloc_type_class): New function. + (elf_backend_reloc_type_class): Define. + +2001-09-25 Alan Modra + + * elf-bfd.h (struct bfd_elf_section_data): Add "local_dynrel" + and "sreloc" fields. + * elf32-i386.c (struct elf_i386_dyn_relocs): Add "sec", and + "pc_count" fields. Remove "section" field. + (elf_i386_check_relocs): Don't set DF_TEXTREL here. Don't + allocate space for dynamic relocs here. Instead, record all + needed dynamic relocs via dyn_relocs and local_dynrel. Cache + pointer to "sreloc" section in elf_section_data. + (elf_i386_gc_sweep_hook): Sweep dyn_relocs and local_dynrel. + (allocate_plt_and_got_and_discard_relocs): Rename to + allocate_dynrelocs. Allocate rather than discarding dyn relocs. + (readonly_dynrelocs): New function. + (elf_i386_size_dynamic_sections): Call readonly_dynrelocs. + Rename "i" to "ibfd". Allocate space for local dyn relocs. + (elf_i386_relocate_section): Make use of cached sreloc. + +2001-09-24 Alan Modra + + * elf-bfd.h (elf_backend_reloc_type_class): Pass in the entire + reloc rather than just the type. + (_bfd_elf_reloc_type_class): Likewise. + * elf.c (_bfd_elf_reloc_type_class): Likewise. + * elf32-arm.h (elf32_arm_reloc_type_class): Likewise. + * elf32-cris.c (elf_cris_reloc_type_class): Likewise. + * elf32-i386.c (elf_i386_reloc_type_class): Likewise. + * elf32-m68k.c (elf32_m68k_reloc_type_class): Likewise. + * elf32-ppc.c (ppc_elf_reloc_type_class): Likewise. + * elf32-s390.c (elf_s390_reloc_type_class): Likewise. + * elf32-sh.c (sh_elf_reloc_type_class): Likewise. + * elf32-sparc.c (elf32_sparc_reloc_type_class): Likewise. + * elf64-alpha.c (elf64_alpha_reloc_type_class): Likewise. + * elf64-s390.c (elf_s390_reloc_type_class): Likewise. + * elf64-sparc.c (sparc64_elf_reloc_type_class): Likewise. + * elf64-x86-64.c (elf64_x86_64_reloc_type_class): Likewise. + * elfxx-ia64.c (elfNN_ia64_reloc_type_class): Likewise. + * elflink.h: Formatting fixes. + (elf_link_sort_relocs): Make "count" and "size" bfd_size_type. + Call bfd_zmalloc rather than calloc. Remove unnecessary cast of + o->contents to PTR. Update call to elf_backend_reloc_type_class. + +2001-09-22 John Reiser + + * elfcode.h (elf_object_p): Allow for no section header at all in + non-ET_REL files. Honor 0 for e_shnum, e_shstrndx, e_shoff. + +2001-09-21 Nick Clifton + + * elfxx-ia64.c: Fix compile time warning messages. + * coff-mcore.c: Fix compile time warning messages. + * coff-ppc.c: Fix compile time warning messages. + * coffcode.h: Fix compile time warning messages. + * elf32-mips.c: Fix compile time warning messages. + * elf64-alpha.c: Fix compile time warning messages. + * libbfd.c: Fix compile time warning messages. + * bfd-in2.h: Regenerate. + +2001-09-21 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + + * aoutx.h: Formatting fixes. + * merge.c (_bfd_merged_section_offset): Break line at 80 chars. + + * linker.c: Replace bfd_get_filename with bfd_archive_filename + in error message. + +2001-09-21 Alan Modra + + * bfd.c (bfd_archive_filename): New function. + * bfd-in2.h: Regenerate. + * aout-adobe.c: Replace bfd_get_filename with bfd_archive_filename + in error messages where the bfd is an input bfd. + * aout-cris.c: Likewise. + * coff-arm.c: Likewise. + * coff-mcore.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-sh.c: Likewise. + * coff-tic54x.c: Likewise. + * coff-tic80.c: Likewise. + * coff64-rs6000.c: Likewise. + * coffcode.h: Likewise. + * coffgen.c: Likewise. + * cofflink.c: Likewise. + * ecofflink.c: Likewise. + * elf-hppa.h: Likewise. + * elf.c: Likewise. + * elf32-arm.h: Likewise. + * elf32-cris.c: Likewise. + * elf32-gen.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-mips.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-v850.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-gen.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sparc.c: Likewise. + * elf64-x86-64.c: Likewise. + * elflink.h: Likewise. + * elfxx-ia64.c: Likewise. + * ieee.c: Likewise. + * ihex.c: Likewise. + * libbfd.c: Likewise. + * pdp11.c: Likewise. + * pe-mips.c: Likewise. + * peicode.h: Likewise. + * srec.c: Likewise. + * xcofflink.c: Likewise. + + * elf32-arm.h: Make _bfd_error_handler calls K&R compatible. + + * elflink.c (_bfd_elf_create_linker_section): Better grammar for + error message. + + * coff-mcore.c (coff_mcore_relocate_section): Internalionalise + error message. + + * elf64-sparc.c (sparc64_elf_add_symbol_hook): Constify stt_types. + Consolidate error messages, and split long messages to two lines. + +2001-09-20 John Reiser + + * elf32-i386.c (elf_i386_relocate_section): Coordinate info->symbolic + and info->allow_shlib_undefined. + * elf32-cris.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mips.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sparc.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sparc.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfxx-ia64.c: Likewise. + +2001-09-18 Bruno Haible + + * aoutx.h: Include "safe-ctype.h" instead of . + (aout_link_write_symbols): Use ISDIGIT instead of isdigit. + * archive.c: Include "safe-ctype.h" instead of . + (_bfd_generic_read_ar_hdr_mag): Use ISDIGIT instead of isdigit. + * archures.c: Include "safe-ctype.h" instead of . + (bfd_default_scan): Use ISDIGIT instead of isdigit. + * bfd.c: Include "safe-ctype.h" instead of . + (bfd_scan_vma): Use ISXDIGIT/ISDIGIT/ISLOWER instead of + isxdigit/isdigit/islower. + * binary.c: Include "safe-ctype.h" instead of . + (mangle_name): Use ISALNUM instead of isalnum. + * cpu-v850.c: Include "safe-ctype.h" instead of . + (scan): Use ISDIGIT instead of isdigit. + * hosts/alphavms.h: Don't include . + * ieee.c: Include "safe-ctype.h" instead of . + (ieee_object_p): Use TOUPPER instead of toupper. + * ihex.c: Include "safe-ctype.h" instead of . + (ihex_bad_byte): Use ISPRINT instead of isprint. + * merge.c: Don't include . + * oasys.c: Include "safe-ctype.h" instead of . + (oasys_write_sections): Use ISDIGIT instead of isdigit. + * pdp11.c: Include "safe-ctype.h" instead of . + (aout_link_write_symbols): Use ISDIGIT instead of isdigit. + * ppcboot.c: Include "safe-ctype.h" instead of . + (mangle_name): Use ISALNUM instead of isalnum. + * som.c: Include "safe-ctype.h" instead of . + (som_set_reloc_info): Use ISUPPER/ISLOWER/ISDIGIT instead of + isupper/islower/isdigit. + (som_decode_symclass): Use TOUPPER instead of toupper. + * srec.c: Include "safe-ctype.h" instead of . + (srec_bad_byte): Use ISPRINT instead of isprint. + (srec_scan): Use ISSPACE instead of isspace. + * stabs.c: Include "safe-ctype.h" instead of . + (_bfd_link_section_stabs): Use ISDIGIT instead of isdigit. + * syms.c: Include "safe-ctype.h" + (islower, toupper): Remove macro definitions. + (bfd_decode_symclass): Use TOUPPER instead of toupper. + * vms-gsd.c: Don't include . + * vms-hdr.c: Include "safe-ctype.h" instead of . + (_bfd_vms_write_hdr): Use ISLOWER/TOUPPER instead of + islower/toupper. + * vms-tir.c: Don't include . + +2001-09-18 Alan Modra + + * libbfd.c (bfd_bread): New function replacing bfd_read without + redundant params. Allow reads up to (size_t) -2 in length. + (bfd_bwrite): Similarly for bfd_write. + (real_read): Return a size_t. + (bfd_read): Call bfd_bread. + (bfd_write): Call bfd_bwrite. + (warn_deprecated): New function to annoy everybody. + (bfd_get_file_window): Don't call bfd_set_error unnecessarily. + * bfd-in.h (bfd_bread, bfd_bwrite, warn_deprecated): Declare. + (bfd_read, bfd_write): Define as macro. + * aix386-core.c: Replace calls to bfd_read with bfd_bread, and + likewise for bfd_write. Ensure function args are correct size by + using casts or local vars. In some cases, remove unnecessary + casts. Formatting fixes, in some cases removing a large expression + from function args by using a local var. Replace CONST with const. + Modify variable types to avoid warings. Use casts to avoid + warnings when using negative numbers in unsigned expressions. + * aout-adobe.c: Likewise. + * aout-arm.c: Likewise. + * aout-cris.c: Likewise. + * aout-encap.c: Likewise. + * aout-ns32k.c: Likewise. + * aout-target.h: Likewise. + * aout-tic30.c: Likewise. + * aoutf1.h: Likewise. + * aoutx.h: Likewise. + * archive.c: Likewise. + * archures.c: Likewise. + * bfd-in.h: Likewise. + * bfd.c: Likewise. + * binary.c: Likewise. + * bout.c: Likewise. + * cache.c: Likewise. + * cisco-core.c: Likewise. + * coff-a29k.c: Likewise. + * coff-alpha.c: Likewise. + * coff-arm.c: Likewise. + * coff-h8300.c: Likewise. + * coff-h8500.c: Likewise. + * coff-i386.c: Likewise. + * coff-i860.c: Likewise. + * coff-i960.c: Likewise. + * coff-ia64.c: Likewise. + * coff-m68k.c: Likewise. + * coff-m88k.c: Likewise. + * coff-mcore.c: Likewise. + * coff-mips.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-sh.c: Likewise. + * coff-sparc.c: Likewise. + * coff-stgo32.c: Likewise. + * coff-tic30.c: Likewise. + * coff-tic54x.c: Likewise. + * coff-tic80.c: Likewise. + * coff-w65.c: Likewise. + * coff-z8k.c: Likewise. + * coff64-rs6000.c: Likewise. + * coffcode.h: Likewise. + * coffgen.c: Likewise. + * cofflink.c: Likewise. + * coffswap.h: Likewise. + * corefile.c: Likewise. + * cpu-arc.c: Likewise. + * cpu-h8300.c: Likewise. + * cpu-h8500.c: Likewise. + * cpu-i960.c: Likewise. + * cpu-ia64-opc.c: Likewise. + * cpu-ns32k.c: Likewise. + * cpu-pdp11.c: Likewise. + * cpu-pj.c: Likewise. + * cpu-sh.c: Likewise. + * cpu-w65.c: Likewise. + * cpu-z8k.c: Likewise. + * dwarf1.c: Likewise. + * dwarf2.c: Likewise. + * ecoff.c: Likewise. + * ecofflink.c: Likewise. + * ecoffswap.h: Likewise. + * elf-bfd.h: Likewise. + * elf-hppa.h: Likewise. + * elf-m10200.c: Likewise. + * elf-m10300.c: Likewise. + * elf.c: Likewise. + * elf32-arc.c: Likewise. + * elf32-arm.h: Likewise. + * elf32-avr.c: Likewise. + * elf32-cris.c: Likewise. + * elf32-fr30.c: Likewise. + * elf32-gen.c: Likewise. + * elf32-h8300.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-i860.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-mips.c: Likewise. + * elf32-openrisc.c: Likewise. + * elf32-pj.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh-lin.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-v850.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mips.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sparc.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfarm-nabi.c: Likewise. + * elfcode.h: Likewise. + * elfcore.h: Likewise. + * elflink.c: Likewise. + * elflink.h: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-target.h: Likewise. + * format.c: Likewise. + * hash.c: Likewise. + * hp300hpux.c: Likewise. + * hppabsd-core.c: Likewise. + * hpux-core.c: Likewise. + * i386aout.c: Likewise. + * i386dynix.c: Likewise. + * i386linux.c: Likewise. + * i386lynx.c: Likewise. + * i386mach3.c: Likewise. + * i386msdos.c: Likewise. + * i386os9k.c: Likewise. + * ieee.c: Likewise. + * ihex.c: Likewise. + * irix-core.c: Likewise. + * libaout.h: Likewise. + * libbfd-in.h: Likewise. + * libbfd.c: Likewise. + * libcoff-in.h: Likewise. + * libecoff.h: Likewise. + * libieee.h: Likewise. + * libnlm.h: Likewise. + * libpei.h: Likewise. + * libxcoff.h: Likewise. + * linker.c: Likewise. + * lynx-core.c: Likewise. + * m68klinux.c: Likewise. + * merge.c: Likewise. + * mipsbsd.c: Likewise. + * netbsd-core.c: Likewise. + * nlm.c: Likewise. + * nlm32-alpha.c: Likewise. + * nlm32-i386.c: Likewise. + * nlm32-ppc.c: Likewise. + * nlm32-sparc.c: Likewise. + * nlmcode.h: Likewise. + * nlmswap.h: Likewise. + * ns32k.h: Likewise. + * oasys.c: Likewise. + * opncls.c: Likewise. + * osf-core.c: Likewise. + * pc532-mach.c: Likewise. + * pdp11.c: Likewise. + * pe-mips.c: Likewise. + * peXXigen.c: Likewise. + * peicode.h: Likewise. + * ppcboot.c: Likewise. + * ptrace-core.c: Likewise. + * reloc.c: Likewise. + * reloc16.c: Likewise. + * riscix.c: Likewise. + * rs6000-core.c: Likewise. + * sco5-core.c: Likewise. + * section.c: Likewise. + * som.c: Likewise. + * sparclinux.c: Likewise. + * sparclynx.c: Likewise. + * srec.c: Likewise. + * stabs.c: Likewise. + * sunos.c: Likewise. + * syms.c: Likewise. + * targets.c: Likewise. + * tekhex.c: Likewise. + * trad-core.c: Likewise. + * versados.c: Likewise. + * vms-gsd.c: Likewise. + * vms-hdr.c: Likewise. + * vms-misc.c: Likewise. + * vms-tir.c: Likewise. + * vms.c: Likewise. + * vms.h: Likewise. + * xcofflink.c: Likewise. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + + * bfd.c (struct _bfd): Make "where" and "origin" unsigned. + * bfd-in.h (file_ptr): Change from a long int to a bfd_signed_vma. + (ufile_ptr): Define. + (bfd_tell): Return a ufile_ptr. + * libbfd.c (bfd_tell): Likewise. + (bfd_seek): Use bfd_size_type locals. Don't call bfd_set_error + unnecessarily. + * aix386-core.c: Test != 0 for bfd_seek errors rather than < 0. + * aoutf1.h: Likewise. + * som.c: Likewise. + * cache.c (bfd_cache_lookup_worker): Guard against abfd->where + larger than unsigned long can represent. + + * libbfd.c (bfd_malloc): Take a bfd_size_type arg. Error if + size overflows size_t. + (bfd_realloc): Likewise. + (bfd_zmalloc): Likewise. + * opncls.c (bfd_alloc): Likewise. + (bfd_zalloc): Likewise. + * libbfd-in.h (bfd_malloc, bfd_realloc, bfd_zmalloc): Update. + (bfd_alloc, bfd_zalloc): Update. + + * libbfd.c (bfd_get_8): Mask with 0xff in case char is more than + 8 bits. + (bfd_get_signed_8): Likewise. + (H_PUT_64, H_PUT_32, H_PUT_16, H_PUT_8, + H_PUT_S64, H_PUT_S32, H_PUT_S16, H_PUT_S8, + H_GET_64, H_GET_32, H_GET_16, H_GET_8, + H_GET_S64, H_GET_S32, H_GET_S16, H_GET_S8): Define and use. + * libaout.h: Likewise define and use here. + * aout-adobe.c: Use H_GET_* and H_PUT_* macros. + * aout-arm.c: Likewise. + * aout-encap.c: Likewise. + * aout-ns32k.c: Likewise. + * aout-tic30.c: Likewise. + * aoutf1.h: Likewise. + * aoutx.h: Likewise. + * bout.c: Likewise. + * coff-alpha.c: Likewise. + * coff-h8300.c: Likewise. + * coff-h8500.c: Likewise. + * coff-i960.c: Likewise. + * coff-ia64.c: Likewise. + * coff-m88k.c: Likewise. + * coff-mips.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-sh.c: Likewise. + * coff-sparc.c: Likewise. + * coff-stgo32.c: Likewise. + * coff-tic30.c: Likewise. + * coff-tic80.c: Likewise. + * coff-w65.c: Likewise. + * coff-z8k.c: Likewise. + * coff64-rs6000.c: Likewise. + * coffgen.c: Likewise. + * cofflink.c: Likewise. + * coffswap.h: Likewise. + * ecoff.c: Likewise. + * ecoffswap.h: Likewise. + * elf.c: Likewise. + * elf32-mips.c: Likewise. + * elf64-mips.c: Likewise. + * hp300hpux.c: Likewise. + * i386dynix.c: Likewise. + * i386lynx.c: Likewise. + * i386msdos.c: Likewise. + * i386os9k.c: Likewise. + * libpei.h: Likewise. + * nlm32-alpha.c: Likewise. + * nlm32-i386.c: Likewise. + * nlm32-ppc.c: Likewise. + * nlmcode.h: Likewise. + * nlmswap.h: Likewise. + * oasys.c: Likewise. + * pdp11.c: Likewise. + * pe-mips.c: Likewise. + * peXXigen.c: Likewise. + * peicode.h: Likewise. + * riscix.c: Likewise. + * sunos.c: Likewise. + * xcofflink.c: Likewise. + * elfcode.h: (put_word, get_word, put_signed_word, get_signed_word): + Rename to H_PUT_WORD, H_GET_WORD, H_PUT_SIGNED_WORD, H_GET_SIGNED_WORD. + * coff-rs6000.c (PUTWORD, PUTHALF, PUTBYTE): Don't define. Use + equivalent H_PUT_* macro instead. + (GETWORD, GETHALF, GETBYTE): Similarly. + * coff64-rs6000.c (PUTWORD, PUTHALF, PUTBYTE): Likewise. + (GETWORD, GETHALF, GETBYTE): Likewise. + * coffswap.h (PUTWORD, PUTHALF, PUTBYTE): Likewise. + + * bfd-in.h (struct orl): Change "pos" to a union. + * archive.c (_bfd_compute_and_write_armap): Use it instead of casts. + (bsd_write_armap): Here too. + (coff_write_armap): And here. + * coff-rs6000.c (xcoff_write_armap_old): And here. + (xcoff_write_one_armap_big): And here. + (xcoff_write_armap_big): And here. + * ecoff.c (_bfd_ecoff_write_armap): And here. + * elf64-mips.c (mips_elf64_write_armap): And here. + + * aoutf1.h (sunos_set_arch_mach): Make "mach" param an enum. + * elf-m10300.c (elf_mn10300_mach): Return an unsigned long. + * elf32-h8300.c (elf32_h8_mach): Likewise. + * elf32-mips.c (elf_mips_mach): Likewise. + * sparclynx.c (NAME(lynx,set_arch_mach)): Likewise. + + * aix386-core.c (aix386_core_file_p): Remove redundant bfd_release + calls. + (aix386_core_vec): Typo fix. + + * aout-arm.c: Include libaout.h and aout/aout64.h after N_TXTADDR + etc. to avoid redefined macro warning. + (MY(put_reloc)): Use bfd_vma for "value" rather than long. + (MY(fix_pcrel_26)): Likewise. + * aout-ns32k.c (MY(put_reloc)): Likewise. + * aout-cris.c (MY(swap_ext_reloc_out)): Likewise for r_addend. + * aoutx.h (NAME(aout,swap_ext_reloc_out)): Likewise. + * coff-arm.c (coff_arm_relocate_section): Likewise for my_offset. + + * aout-encap.c: Include "file", not for binutils headers. + (encap_object_p): Half baked attempt to fix compile errors in + code dealing with "magic". + + * aout-ns32k.c: Include "file", not for binutils headers. + (_bfd_ns32k_relocate_contents): get_data and put_data manipulate + bfd_vma's rather than longs. + * cpu-ns32k.c (ns32k_sign_extend): Delete. + (_bfd_ns32k_get_displacement): Return a bfd_vma, don't pass in offset. + (_bfd_ns32k_get_immediate): Likewise. Add code for 8 byte values, + remove case 3. + (_bfd_ns32k_put_displacement): Accept a bfd_vma, don't pass in offset. + Use unsigned comparisons. + (bfd_ns32k_put_immediate): Likewise, and add code for 8 byte values. + (do_ns32k_reloc): get_data and put_data operate on bfd_vma's. + (_bfd_do_ns32k_reloc_contents): Likewise. + * ns32k.h (_bfd_ns32k_get_displacement): Update prototype. + (_bfd_ns32k_get_immediate): Likewise. + (_bfd_ns32k_put_displacement): Likewise. + (_bfd_ns32k_put_immediate): Likewise. + (bfd_reloc_status_type): Likewise. + + * aoutx.h (NAME(aout,find_nearest_line)): Rename 'p' to 'colon' + to avoid shadowing. + * pdp11.c (NAME(aout,find_nearest_line)): Likewise. + * coff-h8300.c (h8300_reloc16_extra_cases): Remove shadowing "value". + * coff-ppc.c (enum ref_category): Rename "data" to "tocdata" to + avoid shadowing. + (record_toc): Use a bfd_signed_vma for our_toc_offset. + * coffcode.h (coff_write_relocs): Rename "i" to avoid shadowing. + * elf.c (bfd_elf_get_bfd_needed_list): Rename "link" var to avoid + shadow warning. + (_bfd_elfcore_strndup): Likewise for "dup". + * elf32-cris.c (cris_elf_relocate_section): "symname" instead of + "name" to avoid shadowing. + * elf32-hppa.c (elf32_hppa_relocate_section): Remove duplicate + definition of "off". + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-mips.c (_bfd_mips_elf_modify_segment_map): Remove duplicate + definition of "s". + (_bfd_mips_elf_final_link): Rename "i" to "j". Remove duplicate + "secpp". + * elf64-x86-64.c (elf64_x86_64_relocate_section): Rename inner "indx" + to avoid shadowing. + * elflink.h (elf_link_add_object_symbols): Rename "link" to "shlink" + to avoid shadowing. + (elf_link_input_bfd): Likewise. + (elf_bfd_final_link): Remove duplicate innermost "off" var. + * oasys.c (oasys_write_data): Rename innermost "p" to "sym". + * reloc16.c (bfd_coff_reloc16_relax_section): Rename "i" param to + "input_section". + * som.c (som_prep_for_fixups): Rename inner "i" to "j". + * sunos.c (sunos_add_dynamic_symbols): Localise "s" var. + (sunos_write_dynamic_symbol): Remove unused vars. + * syms.c (_bfd_stab_section_find_nearest_line): Remove duplicate + innermost "directory_name" and "file_name" vars. + * tekhex.c (first_phase): Rename local var "type" to "stype". + (tekhex_write_object_contents): Rename innermost "s" to "sym". + * vms-gsd.c (vms_secflag_by_name): Change "size" param to "hassize", + doing comparison at caller. + (vms_esecflag_by_name): Likewise. + * vms-tir.c (etir_sto): Rename innermost "psect" to "psect1". + * xcofflink.c (xcoff_link_input_bfd): Delete duplicate innermost "o". + (xcoff_write_global_symbol): Rename "p" param to "inf". + + * cisco-core.c: Add missing prototypes. + (cisco_core_file_failing_command): Add ATTRIBUTE_UNUSED. + (cisco_core_file_failing_signal): Likewise. + (cisco_core_file_matches_executable_p): Likewise. + * hpux-core.c (hpux_core_core_file_failing_signal): Likewise. + * netbsd-core.c (netbsd_core_file_matches_executable_p): Likewise. + * osf-core.c (osf_core_core_file_matches_executable_p): Likewise. + * sco5-core.c (sco5_core_file_matches_executable_p): Likewise. + + * coff-arm.c (coff_arm_link_hash_table): Use bfd_size_type for + thumb_glue_size and arm_glue_size. + * elf32-arm.h (elf32_arm_link_hash_table): Likewise here. + + * coff64-rs6000.c: Group prototypes together. + + * coffcode.h (coff_set_arch_mach): Add ATTRIBUTE_UNUSED. + (buy_and_read): Remove "seek" param. Change "size" to bfd_size_type. + + * cpu-arc.c: Add missing prototypes. + * cpu-h8500.c: Likewise. + * cpu-i960.c: Likewise. + * cpu-pj.c: Likewise. + * cpu-sh.c: Likewise. + * cpu-w65.c: Likewise. + * cpu-z8k.c: Likewise. + * elf32-fr30.c: Likewise. + * elf32-h8300.c: Likewise. + * elf32-i370.c: Likewise. + * hpux-core.c: Likewise. + * versados.c: Likewise. + + * cpu-h8300.c (bfd_default_scan_num_mach): Don't declare. + * cpu-h8500.c: Likewise. + * cpu-i960.c: Likewise. + * cpu-z8k.c: Likewise. + + * cpu-ia64-opc.c: Correct comment. + + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Remove unused var. + + * elf-bfd.h (elf_size_info): Change count param of write_out_phdrs + to unsigned. + (bfd_elf32_write_out_phdrs): Likewise. + (bfd_elf64_write_out_phdrs): Likewise. + (elf_linker_section_pointers): Change addend to bfd_vma. + (_bfd_elf_find_pointer_linker_section): Likewise. + (_bfd_elfcore_make_pseudosection): Change size param to size_t and + filepos to unsigned file_ptr. + (_bfd_elfcore_strndup): Change max param to size_t. + * elf.c (_bfd_elfcore_make_pseudosection): As above. + (_bfd_elfcore_strndup): Likewise. + (_bfd_elf_find_pointer_linker_section): Likewise. + + * elf-hppa.h (elf_hppa_relocate_insn): Return an int, and change + insn and sym_value to ints. + + * elf.c (elf_read): Make "offset" param a file_ptr, "size" a + bfd_size_type. + (elfcore_read_notes): Likewise. + + * elf32-arm.h (elf32_arm_final_link_relocate): Change sym_flags + param from unsigned char to int. + (elf32_arm_relocate_section): If USE_REL, cast "rel" appropriately + for info_to_howto call. + (add_dynamic_entry): Define macro. + (elf32_arm_size_dynamic_sections): Use add_dynamic_entry. + + * elf32-cris.c (add_dynamic_entry): Define macro. + (elf_cris_size_dynamic_sections): Use add_dynamic_entry. + + * elf32-h8300.c (elf32_h8_final_write_processing): Make static. + (elf32_h8_object_p): Likewise. + (elf32_h8_merge_private_bfd_data): Likewise. + (elf32_h8_relax_section): Cast gap to int so signed comparisons work. + + * elf32-hppa.c (add_dynamic_entry): Define macro. + (elf32_hppa_size_dynamic_sections): Use it. + * elf32-i370.c (add_dynamic_entry): Define macro. + (i370_elf_size_dynamic_sections): Use it. + (i370_noop): Make static. + * elf32-i386.c (add_dynamic_entry): Define macro. + (elf_i386_size_dynamic_sections): Use it. + * elf32-m68k.c (add_dynamic_entry): Define macro. + (elf_m68k_size_dynamic_sections): Use it. + * elf32-ppc.c (add_dynamic_entry): Define macro. + (ppc_elf_size_dynamic_sections): Use it. + * elf32-s390.c (add_dynamic_entry): Define macro. + (elf_s390_size_dynamic_sections): Use it. + * elf64-alpha.c (add_dynamic_entry): Define macro. + (elf64_alpha_size_dynamic_sections): Use it. + * elf64-hppa.c (add_dynamic_entry): Define macro. + (elf64_hppa_size_dynamic_sections): Use it. + * elf64-ppc.c (add_dynamic_entry): Define macro. + (ppc64_elf_size_dynamic_sections): Use it. + * elf64-s390.c (add_dynamic_entry): Define macro. + (elf_s390_size_dynamic_sections): Use it. + * elf64-sparc.c (add_dynamic_entry): Define macro. + (sparc64_elf_size_dynamic_sections): Use it. + * elf64-x86-64.c (add_dynamic_entry): Define macro. + (elf64_x86_64_size_dynamic_sections): Use it. + * elfxx-ia64.c (add_dynamic_entry): Define macro. + (elfNN_ia64_size_dynamic_sections): Use it. + + * elf32-v850.c (SEXT24): Modify to avoid signed/unsigned warning. + (v850_elf_perform_relocation): Make "r_type" param unsigned. + + * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Just return + false if the first malloc fails rather than going via error_return. + + * elf64-sparc.c (sparc64_elf_plt_entry_offset): Use a bfd_vma for + "index" param. + (sparc64_elf_plt_ptr_offset): Likewise, and for "max" param too. + + * elflink.h (elf_link_input_bfd): s/ingored/ignored/ in error message. + + * elfxx-ia64.c (global_sym_index): Return a long. + + * ieee.c (get_symbol): Use int rather than char param. + (ieee_slurp_sections): Move "section" var to inner blocks. + (copy_expression): Don't init "value" to zero or worry about + clearing to zero after using. + (ieee_write_debug_part): Rename "output_buffer" to "obuff" to avoid + shadowing. + + * ihex.c (ihex_write_record): Make "count" var a size_t, "addr" an + unsigned int. + + * libbfd-in.h (BFD_ALIGN): Add cast to avoid signed/unsigned warning. + (bfd_write_bigendian_4byte_int): Pass an unsigned int value param. + + * mipsbsd.c (mips_fix_jmp_addr): Add "error_message" param. + + * pc532-mach.c (MYNSX): Delete. + (ns32kaout_bfd_reloc_type_lookup): Define prototype without MYNSX. + (write_object_contents): Correct prototype. + + * peicode.h (pe_ILF_build_a_bfd): Use an unsigned int param rather + than unsigned short. + + * section.c (bfd_set_section_contents): Remove redundant + "offset < 0" test. Check that "count" doesn't overflow size_t. + (bfd_get_section_contents): Likewise. + + * som.c (som_fixup_formats): Add missing braces. + (som_reloc_addend): Pass a bfd_vma for "addend". + + * srec.c (srec_write_record): Pass "type" as an unsigned int. + (srec_write_symbols): Remove an unnecessary var. + + * targets.c (_bfd_target_vector): Sort entries. Sort externs + to match. + * configure.in: Sort to match. Bump version number. + * configure: Regenerate. + + * tekhex.c (move_section_contents): Assert offset == 0. + + * versados.c (new_symbol_string): Constify arg. + (process_esd): Use bfd_und_section_ptr rather than &bfd_und_section. + (versados_get_symbol_info): Make static. + (versados_print_symbol): Likewise. + (versados_get_reloc_upper_bound): Likewise. + (versados_canonicalize_reloc): Likewise. + +2001-09-18 Nick Clifton + + * elflink.h (elf_link_input_bfd): Fix typo in error message. + +2001-09-17 H.J. Lu + + * dwarf1.c (parse_die): Take a new arg for the end of the + section. Return false if die is beyond the section. + (parse_functions_in_unit): Pass the end of the section to + parse_die (). + (_bfd_dwarf1_find_nearest_line): Likewise. + +2001-09-14 Michael Rauch + + * elf32-sparc.c (elf32_sparc_relocate_section): Treat R_SPARC_UA32 + just like R_SPARC_32. + +2001-09-14 Kevin Lo + + * configure.bfd: Add arm-openbsd target. + +2001-09-14 Thiemo Seufer + + * config.bfd: Change machine triplets from mips*el*-* to mips*el-*. + Add support for mips64. + +2001-09-13 Alexandre Oliva + + * elf32-openrisc.c (ELF_MACHINE_ALT1): Define as EM_OPENRISC_OLD. + +2001-09-12 Alexandre Oliva + + * elf.c (prep_headers): Get the machine code from the elf + backend data. + * elf-m10200.c (ELF_MACHINE_CODE): Redefine to EM_MN10200. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10200. + * elf-m10300.c (ELF_MACHINE_CODE): Redefine to EM_MN10300. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10300. + * elf-arc.c (arc_elf_final_write_processing): Don't override + e_machine, it's now properly set in prep_headers. + * elf32-avr.c (elf32_avr_object_p): Accept both EM_AVR and + EM_AVR_OLD. + (ELF_MACHINE_ALT1): Define to EM_AVR_OLD. + * elf-d10v.c (ELF_MACHINE_CODE): Redefine to EM_D10V. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_D10V. + * elf-d30v.c (ELF_MACHINE_CODE): Redefine to EM_D30V. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_D30V. + * elf-fr30.c (ELF_MACHINE_CODE): Redefine to EM_FR30. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_FR30. + * elf-m32r.c (ELF_MACHINE_CODE): Redefine to EM_M32R. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_M32R. + * elf32-pj.c (ELF_MACHINE_ALT1): DEfine to EM_PJ_OLD. + * elf-v850.c (ELF_MACHINE_CODE): Redefine to EM_V850. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_V850. + +2001-09-11 Richard Henderson + + * elf64-alpha.c (elf64_alpha_section_flags): New. + (elf64_alpha_fake_sections): Map SEC_SMALL_DATA to SHF_ALPHA_GPREL. + +2001-09-11 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section): Do not + apply HINT relocations against dynamic symbols. + +2001-09-11 H.J. Lu + + * linker.c (link_action): Change COMMON_ROW\defw from CREF to COM. + +2001-09-09 Richard Henderson + + * elf64-alpha.c: Delete all unused ERIC_neverdef and rth_notdef code. + + * elf64-alpha.c (elf64_alpha_relax_with_lituse): Nop out gpdisp + following a call to a near function. + +2001-09-08 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section): Soft fail + relocation errors. Fail gp-relative relocations against + dynamic symbols. + +2001-09-08 Alan Modra + + * elf32-i386.c (elf_i386_relocate_section): Check !DEF_REGULAR + as well as DEF_DYNAMIC in test for avoided copy relocs. + (allocate_plt_and_got_and_discard_relocs): Likewise. + * elf32-hppa.c (elf_i386_relocate_section): Likewise. + (allocate_plt_and_got_and_discard_relocs): Likewise. + +2001-09-07 Thiemo Seufer + + * elf32-mips.c (mips_elf_calculate_relocation): Fix overflow handling + of R_MIPS_PC16. + +2001-09-06 Thiemo Seufer + + * elf64-mips.c (mips_elf64_howto_table_rel): Fix relocation HOWTO + definitions. + (mips_elf64_howto_table_rel): Likewise. + +2001-09-05 Tom Rix + + * xcofflink.c (bfd_xcoff_import_symbol): Handle import file XMC_XO + and syscall symbols. + (write_global_symbol) : Same. + (bfd_xcoff_export_symbol): Remove unused syscall param. + * libxcoff.h: Change prototype of bfd_xcoff_export symbol and + bfd_xcoff_import_symbol. + * bfd-in.h: Same. + * bfd-in2.h : Regenerate. + +2001-09-04 Richard Henderson + + * elf64-alpha.c (SKIP_HOWTO): New. + (elf64_alpha_howto_table): Use it to remove dead ECOFF relocs. + Fix sizes of 16-bit mem format relocs. + (elf64_alpha_reloc_map): Update to match. + (elf64_alpha_relax_with_lituse): Use GPREL16 as appropriate. + (elf64_alpha_relax_without_lituse): Likewise. + (elf64_alpha_check_relocs): Handle GPREL16. + (elf64_alpha_relocate_section): Likewise. + * reloc.c (BFD_RELOC_ALPHA_USER_*): Remove. + (BFD_RELOC_ALPHA_GPREL_HI16, BFD_RELOC_ALPHA_GPREL_LO16): New. + * bfd-in2.h, libbfd.h: Rebuild. + +2001-09-04 Jeff Law + + * elf32-h8300.c (elf32_h8_relax_section): New function. + (elf32_h8_relax_delete_bytes): Likewise. + (elf32_h8_symbol_address_p): Likewise. + (elf32_h8_get_relocated_section_contents): Likewise. + (bfd_elf32_bfd_relax_section): Define. + (bfd_elf32_bfd_get_relocated_section_contents): Likewise. + + * elf32-h8300.c (special): New function. + (h8_elf_howto_table): Use it for SPECIAL_FUNCTION field in + all relocations. + (elf32_h8_final_link_relocate): Treat R_H8_DIR24A8 like 32bit + relocations. Fix problems with the true 24bit reloc R_H8_DIR24R8. + Fix minor problems with 8bit and 16bit PC relative relocations. + +2001-09-01 Andreas Jaeger + + * vms-tir.c: Add missing prototypes. + * vms-hdr.c: Likewise. + * vms-gsd.c: Likewise. + * vms-misc.c: Likewise. + +2001-08-31 H.J. Lu + + * elf32-mips.c (_bfd_mips_elf_check_relocs): Report filename + with bad relocation. + +2001-08-31 Eric Christopher + Jason Eckhardt + + * archures.c: Add mipsisa32 and mipsisa64. Remove mips32, + mips32_4k and mips64. + * aoutx.h: Remove bfd_mach_mips32, bfd_mach_mips32_4k, + bfd_mach_mips64. Add bfd_mach_mipsisa32, bfd_mach_mipsisa64. + * cpu-mips.c: Ditto. + * elf32-mips.c (_bfd_mips_elf_final_write_processing): Ditto. + * bfd-in2.h: Regenerate. + +2001-08-31 Jakub Jelinek + + * elf64-alpha.c (elf64_alpha_relocate_section): Duplicate memory + value into R_ALPHA_RELATIVE's addend. + (elf64_alpha_finish_dynamic_symbol): Likewise. + +2001-08-31 Nick Clifton + + * elf32-arm.h (elf32_arm_relocate_section): Do not rightshift + recomputed addend during relocatable link if not USE_REL. + + * elflink.h (elf_gc_propagate_vtable_entries_used): Fix off-by-one + error. + +2001-08-30 H.J. Lu + + * elf32-mips.c (mips_elf_calculate_relocation): Revert the last + 2 changes. + (_bfd_mips_elf_adjust_dynamic_symbol): Allocate dynamic + relocations for weak definitions. + +2001-08-30 H.J. Lu + + * Makefile.am (BFD32_BACKENDS): Add elf32-h8300.lo. + (BFD32_BACKENDS_CFILES): Add elf32-h8300.c. + * Makefile.in: Rebuild. + +2001-08-30 H.J. Lu + + * elf32-mips.c (mips_elf_calculate_relocation): Don't create + dynamic relocation for undefined weak symbols when creating + executables. Check h->root.root.type, instead of h->root.type. + +2001-08-29 Joel Sherrill + + * config.bfd (i[3456]86-*-rtems*, m68*-*-rtems*): Change + default from coff to elf. + +2001-08-29 Jeff Law + + * elf32-h8300.c (h8_elf_howto_table): Add new PC relative + relocations. + (h8_reloc_map): Similarly. + (elf32_h8_final_link_relocate): Remove incorrect overflow tests. + Add support for PC relative relocations. + + * elf32-h8300.c: Put all prototypes together. + (elf32_h8_info_to_howto): Parameter elf_reloc is used. + (elf32_h8_final_link_relocate): New function for linker. + (elf32_h8_relocate_section): Similarly. + (elf_backend_relocate_section): Define. + + * cpu-h8300.c (h8300_scan, compatible): Prototype. + (h8300_scan): Handle architecture:machine encodings typically + found in linker scripts. + * elf.c (prep_headers): Do not try to do H8 machine recognition + here. + * elf32-h8300.c: Add some missing prototypes. + (elf32_h8_mach, elf32_h8_final_write_processing): New functions. + (elf32_h8_object_p): Similarly. + +2001-08-29 Tom Rix + + * xcofflink.c (xcoff_link_add_symbols): Fix XTY_LD symbol that + does not follow a XTY_SD. + +2001-08-29 Alan Modra + + * targmatch.sed: Delete case statements. + * config.bfd : Select 64 bit xcoff for + aix4.3 and above. + +2001-08-29 J"orn Rennecke + + * Makefile.am (elf32-h8300.lo): New target. + * config.bfd (h8300*-*-elf): New case. + * configure.in (bfd_elf32_h8300_vec): New case. + * elf.c (prep_headers): Add case for bfd_arch_h8300. + * reloc.c (BFD_RELOC_H8_DIR16A8): New relocation. + (BFD_RELOC_H8_DIR16R8, BFD_RELOC_H8_DIR24A8): Likewise. + (BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16): Likewise. + * targets.c (bfd_target bfd_elf32_h8300_vec): New extern declaration. + * elf32-h8300.c: New file. + * Makefile.in, bfd-in2.h, libbfd.h, configure: Regenerated. + +2001-08-28 Nick Clifton + + * sparclynx.c: Add missing prototypes. + * coff-mcore.c: Add missing prototypes. + * elf32-pj.c: Add missing prototypes. + * nlm32-sparc.c: Add missing prototypes. + * oasys.c: Add missing prototypes. + * pdp11.c: Add missing prototypes. + * pe-mips.c: Add missing prototypes. + * riscix.c: Add missing prototypes. + +2001-08-27 Daniel Jacobowitz + + * elf32-i386.c: Add missing prototypes. + * elf32-ppc.c: Likewise. + * elf32-sh-lin.c: Likewise. + * elfarm-nabi.c: Likewise. + +2001-08-27 Daniel Jacobowitz + + * elf32-i386.c (elf_i386_grok_prstatus): New function. + (elf_i386_grok_psinfo): New function. + (elf_backend_grok_prstatus): Define. + (elf_backend_grok_psinfo): Likewise. + * elf32-ppc.c (ppc_elf_grok_prstatus): New function. + (ppc_elf_grok_psinfo): New function. + (elf_backend_grok_prstatus): Define. + (elf_backend_grok_psinfo): Likewise. + * elf32-sh-lin.c (elf32_shlin_grok_prstatus): New function. + (elf32_shlin_grok_psinfo): New function. + (elf_backend_grok_prstatus): Define. + (elf_backend_grok_psinfo): Likewise. + * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): New function. + (elf32_arm_nabi_grok_psinfo): New function. + (elf_backend_grok_prstatus): Define. + (elf_backend_grok_psinfo): Likewise. + +2001-08-27 H.J. Lu + + * elf32-mips.c (mips_elf_create_dynamic_relocation): Add more + sanity check. + (mips_elf_calculate_relocation): Create dynamic relocation for + symbols with weak definition or the ELF_LINK_HASH_DEF_REGULAR + bit is not set. + +2001-08-27 H.J. Lu + + * elf32-mips.c (_bfd_mips_elf_hide_symbol): Add prototype. + (_bfd_mips_elf_copy_indirect_symbol): Likewise. + (_bfd_elf32_mips_grok_prstatus): Likewise. + (_bfd_elf32_mips_grok_psinfo): Likewise. + (_bfd_mips_elf_hide_symbol): Make it static and cast to + `struct mips_elf_link_hash_entry *'. + (_bfd_mips_elf_copy_indirect_symbol): Make it static. + +2001-08-27 Nick Clifton + + * mipsbsd.c: Add missing prototypes. + * hp300hpux.c: Add missing prototypes. + * i386aout.c: Add missing prototypes. + * i386lynx.c: Add missing prototypes. + * i386mach3.c: Add missing prototypes. + * i386msdos.c: Add missing prototypes. + * i386os9k.c: Add missing prototypes. + +2001-08-27 Linus Nordberg + Torbjorn Granlund + Staffan Ulfberg + Alan Modra + + * config.bfd: Add powerpc64 target. Add powerpc64 vectors to + targ64_selvecs for 32 bit powerpc targets. + * Makefile.am (BFD64_BACKENDS): Add elf64-ppc.lo. + (BFD64_BACKENDS_CFILES): Add elf64-ppc.c. + Run "make dep-am". + * Makefile.in: Regenerate. + * configure.in: Add elf64_powerpc vecs. + * configure: Regenerate. + * cpu-powerpc.c: Default to bfd_mach_ppc_620 entry for 64 bit. + * elf.c (prep_headers): EM_PPC64 for 64 bit ppc elf target. + * targets.c: Add bfd_elf64_powerpc_vec and bfd_elf64_powerpcle_vec. + * elf64-ppc.c: New file. + * reloc.c: Add powerpc64 relocs. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2001-08-27 Andreas Schwab + + * elf32-m68k.c (elf32_m68k_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf32_m68k_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf32_m68k_reloc_type_class): New function. + (elf_backend_reloc_type_class): Define. + +2001-08-27 Andreas Jaeger + + * elf64-s390.c (elf_s390_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf_s390_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf_s390_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + + * elf32-s390.c (elf_s390_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf_s390_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf_s390_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + + * elf32-ppc.c (ppc_elf_check_relocs): Set DF_TEXTREL if the reloc + is against read-only section. + (ppc_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (ppc_elf_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + +2001-08-26 Andreas Jaeger + + * elf32-cris.c (cris_elf_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf_cris_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf_cris_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + + * elf32-sh.c (sh_elf_check_relocs): Set DF_TEXTREL if the reloc is + against read-only section. + (elf_backend_reloc_type_class): Define. + (sh_elf_reloc_type_class): New. + (sh_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + + * elf32-arm.h (elf32_arm_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf32_arm_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf32_arm_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + +2001-08-25 Andreas Jaeger + + * oasys.c: Add missing prototypes. + + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Add unused + attribute for parameter. + * elf.c (_bfd_elf_reloc_type_class): Likewise. + + * versados.c (get_4): Make static. + (get_10): Make static. + Add missing prototypes. + (process_esd): Fix call to versados_new_symbol. + +2001-08-25 Nick Clifton + + * coff-a29k.c: Add missing prototypes. + * coff-apollo.c: Add missing prototypes. + * coff-arm.c: Add missing prototypes. + * coff-i860.c: Add missing prototypes. + * coff-rs6000.c: Add missing prototypes. + * coff-tic80.c: Add missing prototypes. + * elf-m10200.c: Add missing prototypes. + * elf-m10300.c: Add missing prototypes. + * elf32-arm.h: Add missing prototypes. + * elf32-d10v.c: Add missing prototypes. + * elf32-m32r.c: Add missing prototypes. + * elf32-mcore.c: Add missing prototypes. + * elf32-openrisc.c: Add missing prototypes. + * elf32-sh.c: Add missing prototypes. + * elf32-sparc.c: Add missing prototypes. + * elf32-v850.c: Add missing prototypes. + * elfarm-nabi.c: Add missing prototypes. + * elfarm-oabi.c: Add missing prototypes. + +2001-08-25 Thiemo Seufer + + * elf32-mips.c (elf_mips_abi_name): Return the right ABI string for + E_MIPS_ABI_O64 and E_MIPS_ABI_EABI64 + +2001-08-24 H.J. Lu + + * elf.c (_bfd_elf_merge_sections): Fail if not using an ELF + hash structure. + +2001-08-24 Nick Clifton + + * elf-bfd.h (elf_hash_table): Revert definition. + (is_elf_hash_table): New macro. + * elflink.h (elf_link_add_object_symbols): Test + is_elf_hash_table before accessing ELF only fields in hash + structure. + (elf_link_create_dynamic_sections): Fail if not using an ELF + hash structure. + (elf_add_dynamic_entry): Fail if not using an ELF hash + structure. + (elf_link_record_local_dynamic_symbol): Fail if not using an + ELF hash structure. + (size_dynamic_sections): Fail if not using an ELF hash + structure. + (elf_adjust_dynamic_symbol): Fail if not using an ELF + hash structure. + (elf_bfd_final_link): Fail if not using an ELF hash + structure. + +2001-08-24 H.J. Lu + + * elf-bfd.h (elf_hash_table): Return NULL if the linker hash + table is not an ELF linker hash table. + + * elf.c (_bfd_elf_link_hash_table_init): Set the linker hash + table type to bfd_link_elf_hash_table. + + * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_create): Revert + the last change. + + * linker.c (_bfd_link_hash_table_init): Set the linker hash + table type to bfd_link_generic_hash_table. + +2001-08-24 Alexandre Oliva + + * bfd.c (bfd_alt_mach_code): New function. + * bfd-in2.h: Rebuilt. + +2001-08-24 Alexandre Oliva + + * elf-m10300.c (mn10300_elf_relocate_section): Test the right + `type' field in the hash entry when deciding whether to follow a + link. + +2001-08-24 Jakub Jelinek + + * elflink.h (elf_link_sort_cmp1): Sort RELATIVE relocs first, not + last. + (elf_link_sort_relocs): Adjust accordingly. + + * elf64-alpha.c (struct alpha_elf_link_hash_entry): Add reltext flag. + (elf64_alpha_check_relocs): Set it if section this reloc is against + is read-only. Set DF_TEXTREL if a RELATIVE reloc is needed against + read-only section. + (elf64_alpha_calc_dynrel_sizes): Set DF_TEXTREL flag if relocation + is is against read-only section. + (elf64_alpha_size_dynamic_sections): Use DF_TEXTREL flag, don't + check section names. + (elf64_alpha_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + +2001-08-24 Thiemo Seufer + + * linker.c (_bfd_generic_link_add_archive_symbols): Replace alloca() + by bfd_malloc(). + +2001-08-23 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_check_relocs): Set DF_TEXTREL if + the reloc is against read-only section. + (elf64_x86_64_size_dynamic_sections): Use DF_TEXTREL flag instead + of looking up section names for DT_TEXTREL. + (elf64_x86_64_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + +2001-08-23 H.J. Lu + + * syms.c (bfd_print_symbol_vandf): Add abfd to arg. + * bfd-in2.h (bfd_print_symbol_vandf): Regenerated. + + * aoutx.h (NAME(aout,print_symbol)): Pass abfd to + bfd_print_symbol_vandf. + * coffgen.c (coff_print_symbol): Likewise. + * elf.c (bfd_elf_print_symbol): Likewise. + * ieee.c (ieee_print_symbol): Likewise. + * nlmcode.h (nlm_print_symbol): Likewise. + * oasys.c (oasys_print_symbol): Likewise. + * pdp11.c (NAME(aout,print_symbol)): Likewise. + * som.c (som_print_symbol): Likewise. + * srec.c (srec_print_symbol): Likewise. + * tekhex.c (tekhex_print_symbol): Likewise. + * versados.c (versados_print_symbol): Likewise. + * vms.c (vms_print_symbol): Likewise. + + * elf.c (_bfd_elf_print_private_bfd_data): Replace fprintf_vma + with bfd_fprintf_vma. + (bfd_elf_print_symbol): Likewise. + * syms.c (bfd_print_symbol_vandf): Likewise. + +2001-08-23 Nick Clifton + + * aoutf1.h (sunos_write_object_contents): Silence compile time + warning. + * libaout.h (N_SET_DYNAMIC): Silence compile time warning. + + * bout.c: Add missing function prototypes. Fix formatting. + * coff-z8k.c: Add missing function prototypes. Fix formatting. + * coff-w65.c: Add missing function prototypes. Fix formatting. + * coff-h8500.c: Add missing function prototypes. Fix formatting. + * coff-h8300.c: Add missing function prototypes. Fix formatting. + * coff-tic54x.c: Add missing function prototypes. Fix formatting. + * coff-tic30.c: Add missing function prototypes. Fix formatting. + * coff-m68k.c: Add missing function prototypes. Fix formatting. + * coff-rs6000.c: Add missing function prototypes. Fix formatting. + * coff-sh.c: Add missing function prototypes. Fix formatting. + +2001-08-23 Jakub Jelinek + + * elf-bfd.h (enum elf_reloc_type_class): New. + (struct elf_backend_data): Add elf_backend_reloc_type_class. + (_bfd_elf_reloc_type_class): New. + * elfxx-target.h (elf_backend_reloc_type_class): Define. + (elfNN_bed): Add elf_backend_reloc_type_class. + * elf.c (_bfd_elf_reloc_type_class): New. + * elf32-i386.c (elf_i386_check_relocs): Set DF_TEXTREL if the reloc + is against read-only section. + (elf_i386_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf_i386_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + * elf32-sparc.c (elf32_sparc_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (elf32_sparc_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (elf32_sparc_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + * elf64-sparc.c (sparc64_elf_check_relocs): Set DF_TEXTREL if the + reloc is against read-only section. + (sparc64_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of + looking up section names for DT_TEXTREL. + (sparc64_elf_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add reltext field. + (elfNN_ia64_hash_table_create): Clear ia64_info. + (get_reloc_section): Set DF_TEXTREL if the reloc is against read-only + section. + (elfNN_ia64_size_dynamic_sections): Use ia64_info->reltext flag + instead of looking up section names for DT_TEXTREL. + (elfNN_ia64_reloc_type_class): New. + (elf_backend_reloc_type_class): Define. + * elflink.h (size_dynamic_sections): Add spare DT_NULL tags. + (struct elf_link_sort_rela): New. + (elf_link_sort_cmp1, elf_link_sort_cmp2, elf_link_sort_relocs): New. + (elf_bfd_final_link): Call elf_link_sort_relocs. + Convert one spare DT_NULL into DT_RELCOUNT resp. DT_RELACOUNT if + necessary. + +2001-08-23 Nick Clifton + + * configure.in (x86-bsdi): No corefile support. + * configure: Regenerate. + +2001-08-22 Nick Clifton + + * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Add missing + comma. + +2001-08-21 Mark Elbrecht + + * coff-go32.c: Make DWARF2 sections use an alignment of 0. Set + the alignment of dwarf2 linkonce sections to 0. + * coff-sto32.c: Likewise. + +2001-08-20 Andreas Jaeger + + * coff-sparc.c: Add missing prototypes. + * elf32-s390.c: Likewise. + * elf32-i960.c: Likewise. + * aout-target.h: Likewise. + +2001-08-20 H.J. Lu + + * elf-bfd.h (elf_obj_tdata): Add num_section_syms. + (elf_num_section_syms): New for num_section_syms. + + * elf.c (elf_map_symbols): Set num_section_syms. + (_bfd_elf_symbol_from_bfd_symbol): Check num_section_syms for + the section symbol index. + +2001-08-20 Nick Clifton + + * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_create): Never + select the generic has table creator. All elf backends need elf + specific fields in the hash table. + +2001-08-20 Alan Modra + + * archive.c (offsetof): Remove define. + * elf.c: Likewise. + * oasys.c: Likewise + * sysdep.h (offsetof): Define. + +2001-08-17 Alan Modra + + * bfd.c (bfd_get_gp_size): Return an unsigned int. + (bfd_set_gp_size): Make param unsigned. + * bfd-in2.h: Regenerate. + * elf32-ppc.c (ppc_elf_add_symbol_hook): Use elf_gp_size rather + than calling bfd_get_gp_size. + * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise. + * elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Likewise. + +2001-08-17 Alan Modra + + * linker.c (default_fill_link_order): Handle four byte fill value. + +2001-08-17 Alan Modra + + * elf64-sparc.c (sparc64_elf_output_arch_syms): Add missing + prototype. + * nlm32-alpha.c (nlm_alpha_write_external): Fix warning. + + * elf64-mips.c (UNUSED_RELOC): Define. + (mips_elf64_howto_table_rel): Use it. + (mips_elf64_howto_table_rela): Here too. + (mips_elf64_write_relocs): Fix signed/unsigned warning. + + * coffcode.h (coff_write_object_contents): Add ATTRIBUTE_UNUSED to + silence warning. + * coffgen.c (coff_print_symbol): Fix warnings. + (coff_find_nearest_line): Likewise. + * cofflink.c (_bfd_coff_link_input_bfd): Likewise. + * coff-alpha.c (alpha_convert_external_reloc): Likewise. + * format.c (bfd_check_format_matches): Likewise. + (bfd_set_format): Likewise. + * coff-ia64.c: Add missing prototypes. + * elf64-alpha.c (struct alpha_elf_link_hash_entry): Make addend + signed to silence warnings. + (elf64_alpha_relocate_section): Likewise. + (elf64_alpha_find_reloc_at_ofs): Fix warnings. + (elf64_alpha_add_symbol_hook): Likewise. + (elf64_alpha_final_link): Likewise. + (elf64_alpha_relax_section): Remove redundant assign to info.gotent. + (elf64_alpha_merge_gots): Add ATTRIBUTE_UNUSED to unused args. + (elf64_alpha_size_got_sections): Likewise. + * elfxx-ia64.c: Add missing prototypes. + (elfNN_ia64_relocate_section): Fix warning. + (elfNN_ia64_unwind_entry_compare): Make params const. + +2001-08-17 Alan Modra + + * config.bfd (targ64_selvecs): New. + : Use it here instead of ineffectual #ifdef. + + * bfd-in.h (BFD_VERSION): Remove wrong comment. + (BFD_DEFAULT_TARGET_SIZE): New. + (BFD_ARCH_SIZE): Comment. + * configure.in (target_size): New. Set instead of target64 in + selvecs case statement. Set target64 from it. + (bfd_default_target_size): New. Set from taget_size. AC_SUBST. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + +2001-08-17 Alan Modra + + * bfd.c (enum bfd_error): Add bfd_error_wrong_object_format. + (bfd_errmsgs): Add corresponding message. + * archive.c (bfd_generic_archive_p): Don't release bfd_ardata when + finding an archive that contains different format object files. + Return bfd_error_wrong_object_format for this case. + * format.c: Formatting fixes. s/CONST/const/. + (bfd_check_format_matches): Accept archives that give + bfd_error_wrong_object_format if no full match is found. Tidy + code handling matching_vector. Don't return a pointer to freed + memory in `matching'. Handle ambiguous matches as for partial + archive matches. + * bfd-in2.h: Regenerate. + +2001-08-15 Alan Modra + + * libieee.h (common_header_type): Add last_byte field. + + * ieee.c: Add missing prototypes. Some format fixes. + (struct output_buffer_struct): Move for availability to prototypes. + (ieee_part_after): New function. + (ieee_slurp_debug): Use it here. + (ieee_seek): Pass in ieee_data_struct rather than bfd. Use + ieee_part_after to set last_byte to one past end of current part. + Update callers. + (ieee_pos): Pass in ieee_data_struct rather than bfd. + Update callers. + (parse_expression): Don't go beyond the end of the current part. + (ieee_slurp_external_symbols): Correct type passed to read_2bytes. + (ieee_get_symtab_upper_bound, ieee_get_symtab, + ieee_get_symbol_info, ieee_print_symbol, ieee_new_section_hook, + ieee_get_reloc_upper_bound, ieee_canonicalize_reloc, block, + ieee_set_section_contents, ieee_write_object_contents, + ieee_make_empty_symbol): Make static. + (ieee_archive_p): Correct comments regarding bfd_read. + (ieee_object_p): Similarly. + (ieee_mkobject): Move it. Clear output_ptr_start, output_ptr, + output_ptr_end, input_ptr_start, input_ptr, input_ptr_end, + input_bfd, output_bfd, output_buffer. + (do_as_repeat): Write out ieee_set_current_pc_enum value as for + do_with_relocs, ie. as a symbol for relocatable files. + (ieee_vec): Add comments showing functions referenced by macros. + +2001-08-14 Nick Clifton + + * aout-tic30.c: Add missing prototypes. Fix formatting. + * aout-ns32k.c: Add missing prototypes. Fix formatting. + * peXXigen.c: Add missining prototypes. Fix formatting. + * aout-adobe.c: Add missining prototypes. Fix formatting. + +2001-08-13 Nick Clifton + + * elf32-v850.c: Add missing function prototypes. + Fix some formatting. + + * cpu-v850.c: Add missing function prototype. + Fix some formatting. + +2001-08-11 Nick Clifton + + * elf-bfd.h (struct elf_backend_data): Add new fields + 'elf_backend_sprintf_vma' and 'elf_backend_fprintf_vma'. + (bfd_elf_sprintf_vma): Rename function prototype to + '_bfd_elf_sprintf_vma'. + (bfd_elf_fprintf_vma): Rename function prototype to + '_bfd_elf_fprintf_vma'. + * bfd.c (bfd_sprintf_vma): Do not invoke bfd_elf_sprintf_vma + directly, instead indirect via the elf_backend_data structure. + (bfd_fprintf_vma): Do not invoke bfd_elf_fprintf_vma directly, + instead indirect via the elf_backend_data structure. + * elf.c (bfd_elf_sprintf_vma): Rename to _bfd_elf_sprintf_vma. + (bfd_elf_fprintf_vma): Rename to _bfd_elf_fprintf_vma. + * elfxx-target.h (elf_backend_sprintf_vma): Initialise if not + already defined. + (elf_backend_fprintf_vma): Initialise if not already defined. + (struct elf_backend_data): Initialise the + elf_backend_sprintf_vma and elf_backend_fprintf_vma fields. + +2001-08-10 Andreas Jaeger + + * elf64-sparc.c: Add missing prototypes. + * elf32-cris.c: Likewise. + * elf32-i370.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-s390.c: Likewise. + +2001-08-10 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_elf_object_p): Make static. + Add prototypes where needed. + +2001-08-10 H.J. Lu + + * bfd.c (bfd_sprintf_vma): Fix a typo in the last change. + (bfd_fprintf_vma): Likewise. + +2001-08-10 H.J. Lu + + * bfd.c (bfd_sprintf_vma): Don't return void. + (bfd_fprintf_vma): Likewise. + +2001-08-10 Andreas Jaeger + + * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes + to build warnings. + * configure: Regenerate. + +2001-08-10 Alan Modra + + * elf.c (bfd_elf_sprintf_vma): Add ATTRIBUTE_UNUSED to quiet + warning if not BFD64. Add braces so emacs auto format works. + (bfd_elf_fprintf_vma): Likewise. + + * libxcoff.h (struct xcoff_backend_data_rec): Constify src param + of _xcoff_swap_ld*. + * coff-rs6000.c (xcoff_swap_ldhdr_in): Modify type of external + param to agree with libxcoff.h. + (xcoff_swap_ldhdr_out): Likewise. + (xcoff_swap_ldsym_in): Likewise. + (xcoff_swap_ldsym_out): Likewise. + (xcoff_swap_ldrel_in): Likewise. + (xcoff_swap_ldrel_out): Likewise. + (xcoff_create_csect_from_smclas): Likewise. + * coff64-rs6000.c: Add missing prototypes. + (xcoff64_swap_ldhdr_in): Modify type of external param to agree + with libxcoff.h. + (xcoff64_swap_ldhdr_out): Likewise. + (xcoff64_swap_ldsym_in): Likewise. + (xcoff64_swap_ldsym_out): Likewise. + (xcoff64_swap_ldrel_in): Likewise. + (xcoff64_swap_ldrel_out): Likewise. + (xcoff64_ppc_relocate_section): Make static. + (xcoff64_slurp_armap): Likewise. + (xcoff64_archive_p): Likewise. + (xcoff64_openr_next_archived_file): Likewise. + (xcoff64_sizeof_headers): Likewise. + (xcoff64_is_lineno_count_overflow): Likewise. + (xcoff64_is_reloc_count_overflow): Likewise. + (xcoff64_loader_symbol_offset): Likewise. + (xcoff64_loader_reloc_offset): Likewise. + * elf64-gen.c: Add missing prototypes. + +2001-08-09 H.J. Lu + + * elf.c (bfd_elf_sprintf_vma): Check ELFCLASS64 only in BFD64. + (bfd_elf_fprintf_vma): Likewise. + +2001-08-09 H.J. Lu + + * bfd-in.h (bfd_elf_sprintf_vma, bfd_elf_fprintf_vma): Moved + to ... + * elf-bfd.h: Here. + * bfd-in2.h: Regenerated. + +2001-08-09 H.J. Lu + + * bfd-in.h (bfd_sprintf_vma): New prototype. + (bfd_fprintf_vma): Likewise. + (bfd_elf_sprintf_vma): Likewise. + (bfd_elf_fprintf_vma): Likewise. + (bfd_printf_vma): New. Defined with bfd_fprintf_vma. + * bfd-in2.h: Regenerated. + + * bfd.c (bfd_sprintf_vma): New. Defined. + (bfd_fprintf_vma): Likewise. + + * elf.c (bfd_elf_sprintf_vma): New. Defined. + (bfd_elf_fprintf_vma): Likewise. + +2001-08-09 Alan Modra + + * coff-rs6000.c: Add missing prototypes. + (xcoff_ppc_relocate_section, xcoff_is_lineno_count_overflow, + xcoff_is_reloc_count_overflow, xcoff_loader_symbol_offset, + xcoff_loader_reloc_offset): Make static. + * dwarf1.c: Add missing prototypes. + * dwarf2.c: Add missing prototypes. + (struct abbrev_info): Move definition. + (struct attr_abbrev, ABBREV_HASH_SIZE, ATTR_ALLOC_CHUNK): Likewise. + * elf.c: Add missing prototypes. + * elf32-gen.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-ppc.c: Likewise. + (ppc_elf_sort_rela): Use PTR instead of "void *". + * elflink.h: Add missing prototypes. Formatting fixes. + * merge.c: Add missing prototypes. + (last4_eq): Use PTR instead of "void *". + (last_eq): Likewise. + * syms.c: Add missing prototypes. + +2001-08-09 Nick Clifton + + * bfd.c: Fix formatting. + * bfd-in2.h: Regenerate. + +2001-08-09 Nick Clifton + + * elf32-arc.c (R_ARC_B22_PCREL): Change 'partial_inplace' to + true (this target uses REL relocations) and 'pcrel_offset' to + false (the PC is implied, not stored in the offset). + +2001-08-08 Alan Modra + + 1999-10-19 Linus Nordberg + * elf-bfd.h (struct elf_backend_data): Add want_got_sym. + * elfxx-target.h (elf_backend_want_got_sym): Define. + (elfNN_bed): Add elf_backend_want_got_sym. + * elflink.c (_bfd_elf_create_got_section): Define + _GLOBAL_OFFSET_TABLE_ only if bed->want_got_sym. + +2001-08-08 Alexandre Oliva + + * dwarf2.c (struct dwarf2_debug): Add sec, sec_info_ptr and syms. + (find_rela_addend): New function. + (parse_comp_unit): Call it to find the abbrev offset addend. + (_bfd_dwarf2_find_nearest_line): Initialize and maintain the new + members of dwarf2_debug as debugging information is read. + +2001-08-07 Nick Clifton + + * coff-sh.c (sh_coff_reloc_type_lookup): Provide for sh-coff + targets as well as sh-pe. + +2001-08-03 Ben Harris + + * elf32-arm.h (elf32_arm_final_link_relocate): Include offset of + reloc from start of section when computing value for R_ARM_REL32 + reloc. + +2001-08-03 Alan Modra + + From H.J. Lu + * elf32-i386.c (allocate_plt_and_got_and_discard_relocs): Don't + keep relocs for undefined syms if there are no dynamic sections in + executable. + * elf32-hppa.c (allocate_plt_and_got_and_discard_relocs): Likewise. + +2001-08-02 Paul Sokolovsky + + * cofflink.c (coff_link_check_ar_symbols): also search for + __imp__symbol as well as _symbol. + * linker.c (_bfd_generic_link_add_archive_symbols): also + search for __imp__symbol as well as _symbol. + +2001-08-01 Adam Nemet + + * elf.c (elf_sort_sections): Return zero only as the last step. + +2001-08-01 Nick Clifton + + * config.bfd (arm-vxworks): Change name of define from VXWORKS to + ARM_COFF_BUGFIX. + (arm-epoc-pe): Define ARM_COFF_BUGFIX. + coff-arm.c (coff_arm_relocate_section): Replace VXWORKS with + ARM_COFF_BUGFIX. + +2001-07-30 Rainer Orth + + * libecoff.h (_bfd_ecoff_styp_to_sec_flags): Changed return type + to match corresponding bfd_coff_backend data member. + +2001-07-24 Alan Modra + + * Makefile.am: Update dependencies with "make dep-am". + * Makefile.in: Regenerate + +2001-07-15 H.J. Lu + + * Makefile.am (po/SRC-POTFILES.in): Use tmp.src instead of tmp. + (po/BLD-POTFILES.in): Use tmp.bld instead of tmp. + * Makefile.in: Regenerate. + +2001-07-11 H.J. Lu + + * elf64-alpha.c (elf64_alpha_check_relocs): Set the ALLOC|LOAD + flags when creating the reloc section if the ALLOC flag in the + source section is set. + +2001-07-11 Steve Ellcey + + * reloc.c (bfd_reloc_code_type): Add IA64 relocs + BFD_RELOC_IA64_LTOFF_FPTR32MSB and BFD_RELOC_IA64_LTOFF_FPTR32LSB + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * elfxx-ia64.c (ia64_howto_table): Define how to handle + new relocations. + (elfNN_ia64_reloc_type_lookup): Handle new relocations. + (elfNN_ia64_check_relocs): Likewise. + (elfNN_ia64_install_value): Likewise. + (elfNN_ia64_relocate_section): Likewise. + +2001-07-11 Jakub Jelinek + + * elf32-sparc.c (_bfd_sparc_elf_howto_table): Remove support for + R_SPARC_UA64. + (elf32_sparc_check_relocs): Likewise. + Only create .rela section for alloced sections in shared libraries. + (elf32_sparc_relocate_section): Likewise. + Remove redundant check. + Optimize unaligned reloc usage. + * elf64-sparc.c (sparc64_elf_relocate_section): Remove redundant + check. + +2001-07-11 H.J. Lu + + * elf64-alpha.c (elf64_alpha_check_relocs): Only use the same + ALLOC|LOAD flags as the source section for debugging sections + when creating the reloc section. + +2001-07-05 Jim Wilson + + * linker.c (_bfd_generic_link_add_one_symbol, case BIG): Use + the section of the bigger symbol. + + * syms.c (bfd_is_local_label): Return false if BSF_SECTION_SYM. + +2001-07-05 Nick Clifton + + * peicode.h (coff_swap_scnhdr_in): For sections containing + uninitialised data, only set their size to s_paddr if this does + not reset their size to zero. MS's latest compilers will set + s_paddr to zero. + +2001-07-04 H.J. Lu + + * elf32-mips.c (_bfd_mips_elf_final_write_processing): + Handle bfd_mach_mips4400, bfd_mach_mips4600 and + bfd_mach_mips5000. + +2001-07-03 Mark Elbrecht + + * bfd.c (bfd_get_sign_extend_vma): Support DJGPP COFF targets. + + * cofflink.c (_bfd_coff_link_input_bfd): Skip section symbols from + sections being discarded. + +2001-06-30 Alan Modra + + * elfcore.h (elf_core_file_p): Call bfd_section_from_phdr directly + instead of _bfd_elfcore_section_from_phdr. + * elf-bfd.h (_bfd_elfcore_section_from_phdr): Remove. + * elf.c (_bfd_elfcore_section_from_phdr): Remove. + (_bfd_elfcore_make_pseudosection): Expedite tail-call. + (elfcore_grok_prstatus): Likewise. + (elfcore_grok_lwpstatus): Likewise. + (bfd_get_elf_phdr_upper_bound): Likewise. + (elfcore_make_note_pseudosection): Formatting. + (_bfd_elfcore_strndup): Formatting. + * elf32-mips.c (mips_elf_sym_is_global): Formatting. + (_bfd_elf32_mips_grok_prstatus): Expedite tail-call. + +2001-06-29 Daniel Jacobowitz + + * elf-bfd.h: Add prototypes for _bfd_elfcore_make_pseudosection + and _bfd_elfcore_strndup. + (struct elf_backend_data): Add elf_backend_grok_prstatus + and elf_backend_grok_psinfo. + * elf.c (_bfd_elfcore_make_pseudosection): New function. + (elfcore_grok_prstatus): Use it. + (elfcore_make_note_pseudosection): Likewise. + (elfcore_strndup): Rename to... + (_bfd_elfcore_strndup): Here, and make global. + (elfcore_grok_psinfo): Use _bfd_elfcore_strndup. + (elfcore_grok_note): Call elf_backend_grok_prstatus + and elf_backend_grok_psinfo if available. + * elf32-mips.c (_bfd_elf32_mips_grok_prstatus): New function. + (_bfd_elf32_mips_grok_psinfo): New function. + (elf_backend_grok_prstatus): Define. + (elf_backend_grok_psinfo): Define. + * elfxx-target.h (elf_backend_grok_prstatus): Default to NULL. + (elf_backend_grok_psinfo): Likewise. + (elfNN_bed): Include elf_backend_grok_prstatus and + elf_backend_grok_psinfo. + +2001-06-29 H.J. Lu + + * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Check if + hplink->sgot is NULL before filling GOT. Check if hplink->splt + is NULL before filling PLT. + +2001-06-29 Alan Modra + + * elflink.h (elf_link_output_extsym): Revert 1999-04-10. + +2001-06-27 Alan Modra + + * elf32-hppa.c (elf32_hppa_check_relocs): Don't make syms dynamic + here.. + (elf32_hppa_adjust_dynamic_symbol): ..nor here.. + (allocate_plt_and_got_and_discard_relocs): .. instead do so here + after gc has run. + + * elf32-hppa.c (RELATIVE_DYNAMIC_RELOCS): Delete. + (IS_ABSOLUTE_RELOC): Define. + (elf32_hppa_link_hash_entry): Always include reloc_entries field. + (hppa_link_hash_newfunc): Always init it. + (elf32_hppa_check_relocs): Mark symbols as ELF_LINK_NON_GOT_REF to + create COPY relocs only when the reloc is in a read-only section. + Instead, allocate space for a dynamic reloc to reference the + library symbol directly. Keep track of space we allocate using + relocs_entries. + (hppa_discard_copies): Delete, and move code to.. + (allocate_plt_and_got): ..here. Rename to + allocate_plt_and_got_and_discard_relocs. Remove unneeded dynamic + relocs for non-shared link. + (elf32_hppa_size_dynamic_sections): Update calls to above. + (elf32_hppa_relocate_section): Write out the dynamic relocs used + in lieu of COPY relocs. + + * elf32-i386.c (elf_i386_check_relocs): Don't make syms dynamic + here.. + (elf_i386_adjust_dynamic_symbol): ..nor here.. + (allocate_plt_and_got_and_discard_relocs): .. instead do so here + after gc has run. + (elf_i386_size_dynamic_sections): Fix a comment. + (elf_i386_relocate_section ): Rearrange code + involved in writing reloc out. + +2001-06-25 Alan Modra + + * elf32-i386.c (elf_i386_check_relocs ): + Ensure syms are dynamic if we might be emitting a reloc. + (allocate_plt_and_got_and_discard_relocs): Don't discard relocs + for undefweak or undefined syms.. + (elf_i386_relocate_section ): .. and emit. + + * elf32-i386.c (allocate_plt_and_got_and_discard_relocs): Discard + relocs without ELF_LINK_HASH_DEF_DYNAMIC set. + (elf_i386_relocate_section ): Remove + redundant bfd_link_hash_defined, bfd_link_hash_defweak test. + +2001-06-24 H.J. Lu + + * cpu-i960.c (scan_960_mach): Don't modify const char *. Use + strncasecmp/strcasecmp instead of strncmp/strcmp. + +2001-06-23 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section ): + Check ELF_LINK_HASH_DEF_DYNAMIC to see if a symbol is not defined + in the regular object file and treat the weak definition as + the normal one. + +2001-06-23 Alan Modra + + * elf32-i386.c (elf_i386_relocate_section ): Tighten + unresolved_reloc test to exclude cases where we use "relocation" + before setting it to point into the .got. Reinstate fudge for + unresolved relocs in debugging sections. + + * elf32-i386.c (elf_i386_relocate_section): Replace ugly + complicated tests for unresolvable relocs with a simple direct + scheme using "unresolved_reloc" var. + + * elf32-i386.c (struct elf_i386_pcrel_relocs_copied): Rename to + elf_i386_dyn_relocs. Update comment. + (struct elf_i386_link_hash_entry): Rename pcrel_relocs_copied to + dyn_relocs. + (elf_i386_adjust_dynamic_symbol): Remove a BFD_ASSERT, change + others to aborts. + (allocate_plt_and_got_and_discard_relocs): Replace BFD_ASSERT with + abort. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_finish_dynamic_symbol): Likewise. + (elf_i386_finish_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. Tidy R_386_GOT32 and error + handling code. + + Avoid creating COPY relocs if possible. + * elf32-i386.c (elf_i386_check_relocs): Tweak condition under + which .got created. Mark symbols used by R_386_32 and R_386_PC32 + relocs as ELF_LINK_NON_GOT_REF to create COPY relocs only when the + reloc is in a read-only section. Instead, allocate space for a + dynamic reloc to reference the library symbol directly. Keep + track of space we allocate using pcrel_relocs_copied. + (discard_copies): Delete, and move code to .. + (allocate_plt_and_got): ..here. Rename to + allocate_plt_and_got_and_discard_relocs. Remove unneeded dynamic + relocs for non-shared link. + (elf_i386_size_dynamic_sections): Update calls to above functions. + (elf_i386_relocate_section): Write out the dynamic relocs. Add + more ugly logic to avoid "unresolvable relocation" error. Use + htab shortcut in place of elf_hash_table macro. + (elf_i386_finish_dynamic_sections): Allow that dynamic .got may + not always be created now. + +2001-06-20 Bo Thorsen + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix linking of + shared libraries. + +2001-06-18 Thiemo Seufer + + * configure.host (mips64-*-linux): Reformat. + +2001-06-21 Alan Modra + + * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Always + allocate local .got space. Use shortcuts from hash table for .got + and .plt rather than comparing section names. + (elf32_hppa_check_relocs): Use local_plt_refcounts var rather than + adjusting index into local_got_refcounts to document what we are + really doing. + (elf32_hppa_relocate_section): Similarly for local_plt_offsets. + Tidy .got and .plt error checking. + +2001-06-20 Catherine Moore + + * elf-bfd.h (struct elf_backend_data): + elf_backend_emit_relocs: New field: Function for emitting + relocs. + elf_backend_count_relocs: New field: Function for determining + the number of relocs to be emitted. + * elfxx-target.h: Provide default (NULL) values for + elf_backend_emit_relocs and elf_backend_count_relocs. + * elflink.h (elf_link_size_reloc_section): Make the hash table + big enough to hold the relocs counted by either reloc_count or + o->reloc_count. + (elf_bfd_final_link) emit_relocs: New boolean, set if relocs + should be emitted, either because of a command line option + stored in the info structure or because the target provides a + special reloc emitting function. + If the target provides a reloc counting function use it, + unless performing a relocatable link or emitting all relocs. + Also set the SEC_RELOC flag on any output section which will + contain relocs. + (elf_link_input_bfd): emit_relocs: New boolean, set if relocs + should be emitted, either because of a command line option + stored in the info structure or because the target provides a + special reloc emitting function. + If the target provides a reloc emitting function, use it, + unless performing a relocatable link or emitting all relocs. + +2001-06-20 H.J. Lu + + * elf32-i386.c (elf_i386_size_dynamic_sections): Always + allocate local .got space. + +2001-06-19 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix creation of + dynamic symbols. + +2001-06-18 Hans-Peter Nilsson + + * elflink.h (struct elf_assign_sym_version_info): Remove member + export_dynamic. All users changed to use info member. + NAME(bfd_elf,size_dynamic_sections)): Remove parameter + export_dynamic, instead use member in parameter info. + * bfd-in.h (bfd_elf32_size_dynamic_sections, + bfd_elf64_size_dynamic_sections): Update prototype. + * bfd-in2.h: Regenerate. + +2001-06-18 H.J. Lu + + * elflink.h (elf_info_failed): Add a new field, verdefs. + (NAME(bfd_elf,size_dynamic_sections): Pass verdefs to + elf_export_symbol. + (elf_export_symbol): Check eif->verdefs to decide if a symbol + should be exported. + +2001-06-17 H.J. Lu + + * elf32-mips.c (mips_elf_link_hash_entry): Add a new field, + readonly_reloc, to record if a relocation in the .rel.dyn + section is against a read-only section. + (mips_elf_link_hash_newfunc): Initialize the readonly_reloc + field to false. + (_bfd_mips_elf_check_relocs): Record if there is a relocation + in the .rel.dyn section against a read-only section by setting + DF_TEXTREL or readonly_reloc. + (_bfd_mips_elf_copy_indirect_symbol): Copy readonly_reloc if + it is true. + (_bfd_mips_elf_adjust_dynamic_symbol): Record DF_TEXTREL if + there is a relocation in the .rel.dyn section against a + read-only section. + (_bfd_mips_elf_size_dynamic_sections): Set DT_TEXTREL if + DF_TEXTREL is set. + +2001-06-12 Nick Clifton + + * coffcode.h (styp_flags_to_sec_flags): Change to a boolean + function. Move flagword result into parameter list. Remove + comment about setting bfd_error_handler to intercept failure + results. + * coffgen.c (make_a_section_from_file): Examine result of + calling bfd_coff_styp_to_sec_flags and pass a failure back to + caller. + * ecoff.h (styp_flags_to_sec_flags): Change to a boolean + function. Move flagword result into parameter list. + * libcoff.h: Regenerate. + * libecoff.h: Regenerate. + +2001-06-13 Nick Clifton + + * aoutx.h (adjust_z_magic): Only pad the tesxt section if the data + section is going to follow it. + +2001-06-12 Catherine Moore + + * elflink.h (elf_gc_propagate_vtable_entries): Replace FILE_ALIGN + with the file_align entry from elf_backend_data. + (elf_gc_smash_unused_vtentry_relocs): Likewise. + (elf_gc_record_vtentry): Likewise. + +2001-06-10 Alan Modra + + * elflink.h: Whitespace changes. + (elf_link_read_relocs_from_section): Use "unsigned int" iterator + rather than "unsigned char". + (elf_link_output_relocs): Likewise. + (elf_link_input_bfd): Likewise. + (elf_reloc_link_order): LIkewise. + * elf.c: s/CONST/const/. Whitespace changes. + * elf32-mips.c: Formatting fix. + + * Makefile.am (SOURCE_HFILES): Include xcoff-target.h, remove xcoff.h. + * Makefile.in: Regenerate. + * po/Make-in: Remove trailing tab. + +2001-06-09 Philip Blundell + + * elf32-arm.h (elf32_arm_plt0_entry): Correct error in last + change. + (elf32_arm_plt_entry): Likewise. + +2001-06-08 H.J. Lu + + * elf.c (swap_out_syms): Keep names for global section symbols. + +2001-06-07 H.J. Lu + + * config.bfd: Put back ecoff for Linux/mips. Firmwares on some + MIPS-based machines need it. + +2001-06-07 H.J. Lu + + * elf32-mips.c (_bfd_mips_elf_object_p): Set the bad symtab + for SGI only. + + * config.bfd: Remove ecoff from Linux/mips. + +2001-06-07 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Add an + assertion. + (elf64_x86_64_check_relocs): Fix VTENTRY relocation; set an + alignment of 8 for .rela sections; handle further relocations. + +2001-06-06 Christian Groessler + + * coff-z8k.c: Fix formatting. + Fix howtos: howto->size was always 1. + +2001-06-05 Thiemo Seufer + + * configure.host (mips64*-*-linux*): Define. + +2001-06-05 Alan Modra + + * elf32-i386.c (elf_i386_discard_copies): Rename to + discard_copies, and use elf_link_hash_entry arg rather than + elf_i386_link_hash_entry. + (elf_i386_link_hash_traverse): Delete. + (elf_i386_size_dynamic_sections): Adjust call to discard_copies. + Tidy sizing of dynamic sections. + (elf_i386_check_relocs ): Reference count + possible .plt entries. + (elf_i386_gc_sweep_hook): Likewise. + (elf_i386_adjust_dynamic_symbol): Discard .plt entries for + everything with plt.refcount <= 0. + + * elf32-i386.c (elf_i386_check_relocs): Don't allocate .got and + .relgot space here. + (elf_i386_gc_sweep_hook): ..and no need to deallocate here.. + (elf_i386_adjust_dynamic_symbol): ..and don't allocate .plt and + .rel.plt here.. + (allocate_plt_and_got): ..instead do it all here. New function. + (elf_i386_size_dynamic_sections): Allocate local .got space and + call allocate_plt_and_got. No need to zap .relgot if not dynamic. + (bfd_elf32_bfd_final_link): Delete. (ie. use regular final link + rather than gc variety). + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (elf_i386_relocate_section): Use it here and correct handling of + R_386_GOT32. Provide section and offset for "unresolvable + relocation" error message. + (elf_i386_finish_dynamic_symbol): Correct handling of R_386_GOT32. + + * elf32-i386.c (struct elf_i386_link_hash_table): Add sgot, + sgotplt, srelgot, splt, srelplt, sdynbss, srelbss fields. + (elf_i386_link_hash_table_create): Init them. + (create_got_section): New function. + (elf_i386_create_dynamic_sections): New function. + (elf_backend_create_dynamic_sections): Set to above. + (elf_i386_check_relocs): Use shortcuts from hash table rather than + calling bfd_get_section_by_name. + (elf_i386_gc_sweep_hook): Likewise. + (elf_i386_adjust_dynamic_symbol): Likewise. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. + (elf_i386_finish_dynamic_sections): Likewise. + + * elf32-hppa.c (allocate_plt_and_got): Skip indirect and warning syms. + +2001-06-02 H.J. Lu + + * elf32-hppa.c (elf32_hppa_object_p): Check ELFOSABI_LINUX + and ELFOSABI_HPUX. + * elf64-hppa.c (elf64_hppa_object_p): Likewise. + +2001-06-02 H.J. Lu + + * aout-cris.c (MACHTYPE_OK): New. Defined. + +2001-06-02 Hans-Peter Nilsson + + * section.c (_bfd_strip_section_from_output): Handle NULL + output_section. + +2001-06-02 H.J. Lu + + * config.bfd (powerpc-*-aix*, powerpc-*-beos*, rs6000-*-*): Add + rs6000coff64_vec only if BFD64 is defined. + (powerpc64-*-aix*): Enable only if BFD64 is defined. + +2001-06-02 H.J. Lu + + * coff-ia64.c (ia64coff_object_p): Rewrite with + external_PEI_DOS_hdr and external_PEI_IMAGE_hdr. + +2001-06-01 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Add PC8 + relocation, small reformatting. + +2001-05-29 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_check_relocs): Handle R_X86_64_64. + (elf64_x86_64_relocate_section): Likewise. + +2001-05-30 Alan Modra + + * elf32-hppa.c (elf32_hppa_check_relocs): Don't NEED_PLT for + millicode. Don't allocate .got and .rela.got space here.. + (elf32_hppa_gc_sweep_hook): ..and no need to deallocate here.. + (elf32_hppa_adjust_dynamic_symbol): ..and don't allocate .plt and + .rela.plt here.. + (hppa_handle_PIC_calls): ..nor here.. + (allocate_plt_and_got): ..instead do it all here. New function. + (elf32_hppa_size_dynamic_sections): Allocate local .got space and + call allocate_plt_and_got. No need to zap .got if not dynamic. + (elf32_hppa_final_link): Call regular bfd_final_link instead of + gc_common_final_link. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (elf32_hppa_relocate_section): Use it here. + (elf32_hppa_finish_dynamic_symbol): Remove superfluous test of + dynamic_sections_created. + (hppa_type_of_stub): Don't LONG_BRANCH_VIA_PLT if millicode sym. + +2001-05-28 Andreas Jaeger + + * elf64-x86-64.c (elf64_86_64_size_info): Remove, we can use the + generic version since we want a hashsize of 4. + (elf_backend_size_info): Likewise. + +2001-05-28 Thiemo Seufer + + * elflink.h (elf_link_size_reloc_section): Use bfd_zmalloc instead of + a zeroing loop. + (elf_link_output_relocs): Handle MIPS ELF64 relocations correctly. + (elf_link_input_bfd): Likewise. + (elf_reloc_link_order): Likewise. + (elf_finish_pointer_linker_section): Typo. Handle MIPS ELF64 + relocations correctly. + +2001-05-28 Nicolas Pitre + + * elf32-arm.h: fix PLT generation for big endian ARM + +2001-05-28 Alan Modra + + * elf32-hppa.c (elf32_hppa_relocate_section): Set up .plt entries + for symbols forced local that need plabels. + (elf32_hppa_adjust_dynamic_symbol): Don't allocate space in + .plt.rela for local syms if non-shared. + (hppa_build_one_stub): Mask lsb of plt.offset. + (elf32_hppa_finish_dynamic_symbol): Abort if lsb of plt.offset set. + (clobber_millicode_symbols): Correct comment. + (elf32_hppa_relocate_section): Likewise. + (elf32_hppa_finish_dynamic_symbol): Likewise. + +2001-05-28 Jeff Sturm + + * reloc.c: Add BFD_RELOC_SPARC_UA16 and BFD_RELOC_SPARC_UA64. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * elf32-sparc.c: Enable BFD_RELOC_SPARC_UA16, BFD_RELOC_SPARC_UA32 + and BFD_RELOC_SPARC_UA64 mapping + * elf64-sparc.c: Likewise. + +2001-05-25 H.J. Lu + + * Makefile.am (BFD32_BACKENDS): Remove coff-pmac.lo. + (BFD32_BACKENDS_CFILES): Remove coff-pmac.c. + (coff-rs6000.lo): Remove the old dependency. + * Makefile.in: Rebuild. + + * configure.in (pmac_xcoff_vec): Replace coff-pmac.lo with + coff-rs6000.lo. + +2001-05-25 H.J. Lu + + * coff-rs6000.c (rs6000coff_vec): Use rs6000coff_core_p, + rs6000coff_core_file_matches_executable_p, + rs6000coff_core_file_failing_command and + rs6000coff_core_file_failing_signal only if AIX_CORE is + defined. + (pmac_xcoff_vec): Likewise. + * coff64-rs6000.c (rs6000coff64_vec): Likewise. + +2001-05-25 Timothy Wall + + * elfxx-ia64.c (allocate_dynrel_entries): Don't allocate an entry + for __GLOB_DATA_PTR on AIX5. Clean up some relocation bugs. + +2001-05-25 H.J. Lu + + * bfd-in2.h: Regenerated. + * libcoff.h: Likewise. + +2001-05-25 Alan Modra + + * elf32-hppa.c (elf32_hppa_relocate_section): Don't allow + undefined millicode syms in shared libs. + (hppa_build_one_stub): Turn BFD_ASSERTs into aborts. + (elf32_hppa_check_relocs): Likewise. + (elf32_hppa_adjust_dynamic_symbol): Likewise. + (elf32_hppa_size_dynamic_sections): Likewise. + (elf32_hppa_relocate_section): Likewise. + (elf32_hppa_finish_dynamic_symbol): Likewise. + (elf32_hppa_finish_dynamic_sections): Likewise. + +2001-05-24 Tom Rix + + * Makefile.am coff-pmac bfd now defined in coff-rs6000.c + xcoff-target.h not used to define rs6000 or ppc bfd. + * Makefile.in same + + * bfd-in.h : (struct lineno_cache_entry) promote element "offset" + to 64 bit. + + * coff-rs6000.c : Many changes for 64 bit support. Move common + 32/64 code to xcofflink.c. Explictly define the rs6000coff_vec + and pmac_xcoff_vec + + * coff64-rs6000.c : Many changes for 64 bit support. 64 bit + linker now supported. Explictly define the rs6000coff64_vec. + + * coffcode.h : (coff_set_arch_mach_hook) xcoff 64 bit support + (coff_print_aux) same + (coff_write_object_contents) same + (coff_slurp_line_table) same + + * coffgen.c : (coff_fix_symbol_name) formatting + (coff_mangle_symbols) xcoff 64 bit support + (coff_write_symbol) same + (coff_write_alien_symbol) same + (coff_write_native_symbol) same + (coff_write_symbols) same + (coff_get_symbol_info) same + (bfd_coff_get_syment) same + (coff_print_symbol) same + + * config.bfd : add powerpc64-*-aix* target + + * libcoff-in.h : formatting + + * libcoff.h : move xcoff extern declarations to libxcoff.h + + * libxcoff.h : New file + + * xcofflink.c : Many changes for xcoff64 support. Move common + structures to include/coff/xcoff.h. Move specific structure to + backends coff-rs6000.c and coff64-rs6000.c. Use new backend + functions, defined in libxcoff.h, to isolate 32/64 dependencies. + + (bfd_xcoff_size_dynamic_sections) : special __rtinit symbol for + aix4.2+ -binitfini. + + (xcoff_build_ldsyms) : handle special __rtinit symbol. + +2001-05-23 Alexandre Oliva + + * elf64-sparc.c (sparc64_elf_slurp_reloc_table): Fix typo + s/ENTIRES/ENTRIES/. + +2001-05-23 Thiemo Seufer + + * reloc.c (bfd_reloc_code_real): Add MIPS ELF64 relocations. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + + * aoutx.h (aout_@var{size}_machine_type): Add MIPS r12k support. + * archures.c (bfd_mach_mips12000): Define. + * cpu-mips.c (arch_info_struct): Add MIPS r12k support. + * elf32-mips.c (_bfd_mips_elf_final_write_processing): Add MIPS r12k + support. + (_bfd_mips_elf_size_dynamic_sections): Use official bfd typedef. + * bfd-in2.h: Regenerate. + * elfxx-target.h: Do not redefine bfd_elfNN_bfd_make_debug_symbol. + +2001-05-23 kaz Kojima + + * elf32-sh.c (elf_sh_plt0_entry_be, elf_sh_plt0_entry, + elf_sh_plt_entry_be, elf_sh_plt_entry, elf_sh_pic_plt_entry_be, + elf_sh_pic_plt_entry): New PLT code, that does not use r2, since + that is used by GCC. + +2001-05-23 Nick Clifton + + * elf-bfd.h (NUM_SHDR_ENTRIES): New macro: compute the number + of entries in a structured section. + * elf.c: Use new macro. + * elf32-i386.c: Use new macro. + * elf32-mips.c: Use new macro. + * elf64-alpha.c: Use new macro. + * elf64-sparc.c: Use new macro. + * elfcode.h: Use new macro. + * elflink.h: Use new macro. + +2001-05-23 Nick Clifton + + * bfdint.texi: Replace -oformat with --oformat. + +2001-05-21 Andreas Jaeger + + * dwarf2.c (decode_line_info): Fix error message. + (read_abbrevs): Fix test for offset as suggested by Alan Modra and + adjust error message. + +2001-05-18 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): Revert the last + change. + +2001-05-17 Alan Modra + + * elf32-hppa.c (clobber_millicode_symbols): Temporarily set + ELF_LINK_FORCED_LOCAL to suit 2001-04-30 change. + (hppa_build_one_stub): Add an assert to check plt.offset. + +2001-05-17 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the + version definition to basename of the output filename. + +2001-05-17 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): Set DT_NEEDED to + basename of the bfd filename. + +2001-05-16 Alan Modra + + * section.c (asection): Add linker_has_input field. + (STD_SECTION): Adjust initialization to suit. + * ecoff.c (bfd_debug_section): Likewise. + * bfd-in2.h: Regenerate. + +2001-05-15 Alexandre Oliva + + * elf-m10300.c (mn10300_elf_relax_section): Don't relax + negative 32-bit operands to 16 operands when the operand is + going to be zero-extended by the modified opcode. + +2001-05-12 Peter Targett + + * cpu-arc.c (arch_info_struct): Add entry 'base' representing old + name for 'arc5' core versions. + (bfd_arc_arch): Make bfd_mach_arc_6 default. + + * elf32-arc.c (arc_elf_object_p): Make E_ARC_MACH_ARC6 default + architecture. + (arc_elf_final_write_processing): Make bfd_mach_arc_6 default. + +2001-05-11 Jakub Jelinek + + * elfxx-ia64.c (is_unwind_section_name): Consider linkonce unwind + sections as well. + (elfNN_ia64_final_write_processing): Map .gnu.linkonce.ia64unw.FOO + to .gnu.linkonce.t.FOO text section. + +2001-05-11 Jakub Jelinek + + * merge.c (struct sec_merge_hash_entry): Add u.entsize and u.suffix + fields, change sec into secinfo. + (struct sec_merge_info): Add chain, remove last fields. + (struct sec_merge_sec_info): Add next, sec, psecinfo fields. + (sec_merge_hash_lookup): If lookup could not use a string only + because it has bad alignment, mark the old string for deletion. + (sec_merge_add): Add secinfo argument. Don't compute entry's + position, instead record the section. + (sec_merge_emit): Update for the sec into secinfo change in + struct sec_merge_hash_entry. + (_bfd_merge_section): Only record the section for merging, defer + putting strings into the hash table. + (cmplengthentry, last4_eq, last_eq, record_section, merge_strings, + _bfd_merge_sections): New functions. + (_bfd_merged_section_offset): Update for the sec_merge_hash_entry + changes. + * libbfd-in.h (_bfd_merge_sections): Add prototype. + (_bfd_nolink_bfd_merge_sections): Define. + * libbfd.h: Likewise. + (bfd_generic_merge_sections): Add prototype. + * targets.c (BFD_JUMP_TABLE_LINK): Add _bfd_merge_sections. + (struct bfd_target): Likewise. + * bfd.c (bfd_merge_sections): Define. + * bfd-in2.h: Rebuilt. + * elf.c (_bfd_elf_merge_sections): New function. + * elf-bfd.h (_bfd_elf_merge_sections): Add prototype. + * elfxx-target.h (bfd_elfNN_bfd_merge_sections): Define. + * reloc.c (bfd_generic_merge_sections): New function. + * vms.c (vms_bfd_merge_sections): New function. + * aout-adobe.c (aout_32_bfd_merge_sections): Define. + * aout-target.h (MY_bfd_merge_sections): Define. + * aout-tic30.c (MY_bfd_merge_sections): Define. + * binary.c (binary_bfd_merge_sections): Define. + * bout.c (b_out_bfd_merge_sections): Define. + * coff-alpha.c (_bfd_ecoff_bfd_merge_sections): Define. + * coffcode.c (coff_bfd_merge_sections): Define. + * coff-mips.c (_bfd_ecoff_bfd_merge_sections): Define. + * i386msdos.c (msdos_bfd_merge_sections): Define. + * i386os9k.c (os9k_bfd_merge_sections): Define. + * ieee.c (ieee_bfd_merge_sections): Define. + * ihex.c (ihex_bfd_merge_sections): Define. + * nlm-target.h (nlm_bfd_merge_sections): Define. + * oasys.c (oasys_bfd_merge_sections): Define. + * ppcboot.c (ppcboot_bfd_merge_sections): Define. + * som.c (som_bfd_merge_sections): Define. + * srec.c (srec_bfd_merge_sections): Define. + * tekhex.c (tekhex_bfd_merge_sections): Define. + * versados.c (versados_bfd_merge_sections): Define. + * xcoff-target.h (_bfd_xcoff_bfd_merge_sections): Define. + +2001-05-11 Nick Clifton + + * dwarf1.c (_bfd_dwarf1_find_nearest_line): Change type of 'addr' + to be unsigned long, in order to match its use. + +2001-05-10 H.J. Lu + + * linker.c (_bfd_generic_link_add_one_symbol): Check loop on + indirect symbols. + +2001-05-09 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): Fix a typo. Allocate + versymhdr->sh_size bytes for extversym instead of hdr->sh_size. + Remove the unused veriable `dynver'. + +2001-05-08 Ian Lance Taylor + + * coff-i386.c (coff_i386_reloc): Don't dump core if output_bfd is + NULL or is not COFF. + (coff_i386_rtype_to_howto): Don't dump core if output section + owner is not COFF. + +2001-05-07 Thiemo Seufer + + * ecoff.c (bfd_debug_section): Fix initialization. + * elf.c (_bfd_elf_slurp_version_tables): Change maxidx to unsigned, it + is always a positive integer. Cast away sign mismatch. + * elf32-mips.c: Fix misleading comment and typo. + (_bfd_mips_elf_section_from_bfd_section): Remove unused attribute, use + correct data type. + * elflink.c: Fix typo. + (_bfd_elf_create_dynamic_sections): Remove superfluous initialization. + * ecoffswap.h (ecoff_swap_fdr_in): Cast away sign mismatch. + +2001-05-04 Richard Henderson + + * elf64-alpha.c (SREL16, SREL32, SREL64): Set pcrel_offset true. + +2001-05-04 Nick Clifton + + * elf32-arm.h (elf32_arm_final_link_relocate): Set + EF_ARM_HASENTRY if the start address is set. + +2001-05-03 Nick Clifton + + * targets.c (_bfd_target_vector_entries): Compute value based on + the size of the _bfd_target_vector and not bfd_target_vector. + +2001-05-03 H.J. Lu + + * elfcode.h: Include "libiberty.h". + + * elflink.h (elf_link_add_object_symbols): Set + elf_dt_name (abfd) to basename of the bfd filename. + (NAME(bfd_elf,size_dynamic_sections)): Set vn_file to basename + of the bfd filename. + +2001-05-03 Andreas Jaeger + + * elf64-gen.c (elf_generic_info_to_howto): Add unused attribute. + (elf_generic_info_to_howto_rel): Likewise. + * coff-alpha.c (reloc_nil): Likewise. + (alpha_ecoff_bad_format_hook): Likewise. + (alpha_adjust_reloc_out): Likewise. + (alpha_bfd_reloc_type_lookup): Likewise. + (alpha_convert_external_reloc): Likewise. + * elf64-alpha.c (elf64_alpha_reloc_nil): Likewise. + (elf64_alpha_reloc_bad): Likewise. + (elf64_alpha_reloc_gpdisp): Likewise. + (elf64_alpha_bfd_reloc_type_lookup): Likewise. + (elf64_alpha_info_to_howto): Likewise. + (elf64_alpha_add_symbol_hook): Likewise. + (elf64_alpha_create_got_section): Likewise. + (elf64_alpha_is_local_label_name): Likewise. + (elf64_alpha_merge_ind_symbols): Likewise. + * elf64-mips.c (mips_elf64_reloc_type_lookup): Likewise. + (mips_elf64_get_reloc_upper_bound): Likewise. + * nlm32-alpha.c (nlm_alpha_mangle_relocs): Likewise. + (nlm_alpha_get_public_offset): Likewise. + +2001-05-02 Johan Rydberg + + * elf32-openrisc.c (openrisc_elf_howto_table): Do not complain + about overflow in R_OPENRISC_LO_16_IN_INSN and + R_OPENRISC_HI_16_IN_INSN. + +2001-04-30 H.J. Lu + + * elf.c (_bfd_elf_link_hash_hide_symbol): Set dynindx to -1 + only for ELF_LINK_FORCED_LOCAL. + * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise. + * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise. + * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise. + + * elflink.h (elf_fix_symbol_flags): Set ELF_LINK_FORCED_LOCAL + if the symbol has hidden or internal visibility. + +2001-04-30 Alan Modra + + * elf32-hppa.c (final_link_relocate): Branch to .+8 for + calls to undefined weak symbols. + +2001-04-30 Andreas Jaeger , Andreas Schwab + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Correct test for + R_X86_64_GOTPCREL, don't use assignments instead of comparisons. + +2001-04-27 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Only swap + out handled entries. + (elf64_x86_64_finish_dynamic_symbol): Set up GOT entries. + (elf64_x86_64_relocate_section): Fix GOTPCREL calculation. + (elf64_x86_64_relocate_section): Merge entries for GOTPCREL and + GOT32. + +2001-04-27 Sean McNeil + + * config.bfd: Add arm-vxworks target. + * coff-arm (coff_arm_relocate_section): Add in symbol value to + addend (fro VXworks targets). + +2001-04-26 H.J. Lu + + * elf32-i386.c (elf_i386_check_relocs): Verify if r_symndx is + valid. + +2001-04-25 Frank Ch. Eigler + + * bfd-in.h (bfd_cache_close): Declare newly exported function. + * bfd-in2.h: Regenerated. + +2001-04-24 Jakub Jelinek + + * merge.c (struct sec_merge_hash_entry): Add alignment field. + (struct sec_merge_hash): Remove alignment_power. + (sec_merge_hash_newfunc): Clear alignment. + (sec_merge_hash_lookup): Pass alignment as argument. + Use hashp->root.next, not hashp->next to walk the hash chain. + If a string already in the hashtable does not have required + alignment, create a new hashtable entry. + (sec_merge_init): Remove alignment_power argument. + (sec_merge_add): Add alignment argument. + (sec_merge_emit): Alignment is now a per-entity thing, not per + section. + (_bfd_merge_section): Sanity check even non-SEC_STRINGS sections + for proper alignment. + Pass alignment information to sec_merge_add. + +2001-04-24 Christian Groessler + + * coff-z8k.c (extra_case): added handler for R_DISP7, R_CALLR + and R_REL16 reloc types; accept odd values for R_REL16 type + +2001-04-24 Johan Rydberg + + * cpu-openrisc.c: New file. + * elf32-openrisc.c: Likewise. + + * Makefile.am (ALL_MACHINES): Add cpu-openrisc.lo. + (ALL_MACHINES_CFILES): Add cpu-openrisc.c. + (BFD32_BACKENDS): Add elf32-openrisc.lo. + (BFD32_BACKENDS_CFILES): Add elf32-openrisc.c. + (cpu-openrisc.lo, elf32-openrisc.lo): New rules. + * Makefile.in: Regenerated. + * config.bfd: (openrisc-*-elf): New target. + * configure.in (bfd_elf32_openrisc_vec): New vector. + * configure: Regenerated. + * libbfd.h: Regenerated. + * bfd-in2.h: Regenerated. + * reloc.c: Add OpenRISC relocations. + * targets.c (bfd_elf32_openrisc_vec): Declare. + (bfd_target_vect): Add bfd_elf32_openrisc_vec. + * archures.c (enum bfd_architecture): Add bfd_arch_openrisc. + (bfd_openrisc_arch): Declare. + (bfd_archures_list): Add bfd_openrisc_arch. + * elf.c (prep_headers): Add bfd_arch_openrisc. + +2001-04-23 Bo Thorsen + + * elf64-x86-64.c: Add c++ vtable hack. + Small whitespace and comment changes. + +2001-04-19 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_plt0_entry): Fix instructions. + (elf64_x86_64_plt_entry): Likewise. + (elf64_x86_64_finish_dynamic_sections): Fix PLT0 generation. + (elf64_x86_64_finish_dynamic_symbol): Fix PLT generation. + +2001-04-17 Hans-Peter Nilsson + + * elf32-cris.c: Tweak comments related to dynamic linking. + (cris_elf_relocate_section): When not creating shared object, fill + in the .got table for any symbol not in the dynamic symbol table. + (elf_cris_finish_dynamic_symbol): When not creating shared object, + only emit a .got.rela reloc if the symbol is in the dynamic symbol + table. + (cris_elf_check_relocs): Use variable r_type in all places rather + than the original expression. Add default case in switch for + reloc types. + (elf_cris_size_dynamic_sections): Iterate over + elf_cris_discard_excess_program_dynamics when not creating shared + library. + (elf_cris_discard_excess_dso_dynamics): Renamed from + elf_cris_discard_copies. Correct typo, s/Rel/Rela/. + (elf_cris_discard_excess_program_dynamics): New. + +2001-04-14 Mark Elbrecht + + * coffcode.h (coff_write_object_contents): Use + bfd_coff_swap_filehdr_out instead of coff_swap_filehdr_out. + +2001-04-14 H.J. Lu + + * bfd-in2.h: Regenerate. + +2001-04-14 Jakub Jelinek + + * section.c (STD_SECTION): Add entsize. + +2001-04-13 H.J. Lu + + * section.c (SEC_MERGE): Define new flag for merging. + (SEC_STRINGS): Likewise. + (entsize): New field. + +2001-04-13 Roger Sayle + + * coff-i386.c (TARGET_SYM): SEC_READONLY is an applicable section + flag on pe-i386 targets. + +2001-04-13 Jakub Jelinek + + * libbfd-in.h (_bfd_merge_section): New. + (_bfd_write_merged_section): New. + (_bfd_merged_section_offset): New. + * libbfd.h: Rebuilt. + * linker.c (_bfd_generic_link_output_symbols): Handle + discard_sec_merge. + * aoutx.h (aout_link_write_symbols): Likewise. + * pdp11.c (aout_link_write_symbols): Likewise. + * elflink.h (elf_link_add_object_symbols): Call _bfd_merge_section. + (elf_bfd_final_link): Adjust global symbols pointing into SEC_MERGE + sections. + (elf_link_sec_merge_syms): New. + (elf_link_input_bfd): Call _bfd_merged_section_offset + and _bfd_write_merged_section. + Handle discard_sec_merge. + * elf-bfd.h (struct elf_link_hash_table): Add merge_info + field. + (struct bfd_elf_section_data): Likewise. + * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_MERGE and + SEC_STRINGS section flags and entsize from their ELF counterparts. + (_bfd_elf_link_hash_table_init): Initialize merge_info. + (elf_fake_sections): Set SHF_MERGE, SHF_STRINGS and sh_entsize + from their BFD counterparts. + * merge.c: New file. + * Makefile.am: Add strtab.lo. + * Makefile.in: Rebuilt. + +2001-04-09 Hans-Peter Nilsson + + * elflink.h (elf_fix_symbol_flags): For non-default visibilities, + only hide symbols marked STV_INTERNAL or STV_HIDDEN. + +2001-04-05 Steven J. Hill + + * config.bfd (mips*el*-*-linux-gnu*): Use traditional little + endian MIPS ELF target. + * config.bfd (mips*-*-linux-gnu*): Use traditional big endian + MIPS ELF target. + + * configure.in (bfd_elf64_tradbigmips_vec): New. Traditional + 64bit big endian MIPS ELF target. + (bfd_elf64_tradlittlemips_vec): New. Traditional 64bit little + endian MIPS ELF target. + * configure: Regenerated. + + * elf32-mips.c (IRIX_COMPAT): Handle traditional 64bit and + little endian targets. + (mips_elf_sym_is_global): Handle traditional targets. + + * elf64-mips.c (bfd_elf64_tradbigmips_vec): New. Traditional + 64bit big endian MIPS ELF target. + (bfd_elf64_tradlittlemips_vec): New. Traditional 64bit little + endian MIPS ELF target. + + * targets.c: (_bfd_target_vector): Add bfd_elf64_tradbigmips_vec + and bfd_elf64_tradlittlemips_vec. + +2001-04-05 David Mosberger + + * elf32-i386.c (elf_i386_fake_sections): Treat ".reloc" as an + ordinary "progbits" section. + +2001-04-04 Alan Modra + + * elflink.h (elf_fix_symbol_flags): Call elf_backend_hide_symbol + when -Bsymbolic causes a symbol to no longer need a .plt entry. + +2001-04-03 David Mosberger + + * efi-app-ia32.c (ALIGN_SECTIONS_IN_FILE): Deleted. + +2001-03-30 H.J. Lu + + * efi-app-ia32.c (PEI_TARGET_SUBSYSTEM): Rename from ... + (PEI_DEFAULT_TARGET_SUBSYSTEM): This. + +2001-03-26 H.J. Lu + + * elf32-gen.c (elf32_generic_link_add_symbols): New. Check + if there are any relocations for generic ELF. + (bfd_elf32_bfd_link_add_symbols): Defined to + elf32_generic_link_add_symbols. + * elf64-gen.c (elf64_generic_link_add_symbols): New. Check + if there are any relocations for generic ELF. + (bfd_elf64_bfd_link_add_symbols): Defined to + elf64_generic_link_add_symbols. + +2001-03-23 Nick Clifton + + * Makefile.am (BUILD_CFILES): New variable: List of C source + files created in build directory. + (BUILD_HFILES): New variable: List of header files created in + build directory. + (POTFILES): Delete. + (po/POTFILES.in): Replace rule with empty entry. + (po/SRC-POTFILES.in): New rule: Create a list of source files + in the source directory. + (po/BLD-POTFILES.in): New rule: Create a list of source files + in the build directory. + (MOSTLYCLEAN): Do not delete source files created in build + directory. + * Makefile.in: Regenerate. + * configure.in: Insert SRC-POTFILES.in and BLD-POTFILES.in + into po/Makefile. + * configure: Regenerate. + + * po/Make-in: Replace occurrences of POTFILES with SRC-POTFILES + and BLD_POTFILES. + Add .. to the search path when building bfd.pot. + Delete POTFILES when performing distclean. + Add comment describing why distclean is broken in maintainer mode. + * po/POTFILES.in: Delete. + * po/SRC-POTFILES.in: New file. + * po/BLD-POTFILES.in: New file. + * po/bfd.pot: Regenerate. + +2001-03-22 Hans-Peter Nilsson + + * elf32-cris.c: Shlib and PIC support. PCREL tweaks. + (elf_cris_discard_copies, elf_cris_adjust_gotplt_to_got, + elf_cris_try_fold_plt_to_got, elf_cris_link_hash_newfunc, + elf_cris_link_hash_table_create, elf_cris_adjust_dynamic_symbol, + elf_cris_size_dynamic_sections, elf_cris_finish_dynamic_symbol, + elf_cris_finish_dynamic_sections,elf_cris_hide_symbol): New + functions. + (cris_elf_howto_table) : Correct comments. Set pcrel_offset to false. + : + New HOWTO members for new relocs. + (cris_reloc_map): Map new relocs. + (ELF_DYNAMIC_INTERPRETER): Define. + (PLT_ENTRY_SIZE): Define. + (elf_cris_plt0_entry, elf_cris_plt_entry, elf_cris_pic_plt0_entry, + elf_cris_pic_plt_entry): New, PLT templates. + (struct elf_cris_pcrel_relocs_copied, struct + elf_cris_link_hash_entry, struct elf_cris_link_hash_table): New. + (elf_cris_link_hash_traverse, elf_cris_hash_table): Define. + (cris_final_link_relocate): Check that 16-bit GOT relocs have + positive values. Adjust PCREL relocs to be relative to location + after relocation. + (cris_elf_relocate_section): Handle relocations to dynamic + objects. Handle new relocations. Call error handler when seeing + non-PIC relocation for read-only sections while generating shared + object. + (cris_elf_check_relocs): Set reference counts for GOT and PLT + entries. + (bfd_elf32_bfd_link_hash_table_create, + elf_backend_adjust_dynamic_symbol, + elf_backend_size_dynamic_sections, + elf_backend_finish_dynamic_symbol, + elf_backend_finish_dynamic_sections, + elf_backend_create_dynamic_sections, bfd_elf32_bfd_final_link, + elf_backend_hide_symbol, elf_backend_want_got_plt, + elf_backend_plt_readonly, elf_backend_want_plt_sym, + elf_backend_got_header_size, elf_backend_plt_header_size): + Define. + + * reloc.c: (BFD_RELOC_CRIS_COPY, BFD_RELOC_CRIS_GLOB_DAT, + BFD_RELOC_CRIS_JUMP_SLOT, BFD_RELOC_CRIS_RELATIVE, + BFD_RELOC_CRIS_32_GOT, BFD_RELOC_CRIS_16_GOT, + BFD_RELOC_CRIS_32_GOTPLT, BFD_RELOC_CRIS_16_GOTPLT, + BFD_RELOC_CRIS_32_GOTREL, BFD_RELOC_CRIS_32_PLT_GOTREL, + BFD_RELOC_CRIS_32_PLT_PCREL): New relocs. + * bfd-in2.h, libbfd.h: Regenerate. + +2001-03-21 Diego Novillo + + (_bfd_mips_elf_relocate_section): Give a better error message when + a relocation is not recognized. + +2001-03-21 Alan Modra + + * elf32-hppa.c (elf32_hppa_set_gp): Check sec->output_section + non-NULL before attempting to dereference. + +2001-03-20 H.J. Lu + + * configure.in: Remove the redundent AC_ARG_PROGRAM. + * configure: Rebuild. + +2001-03-20 Andreas Schwab + + * elf32-m68k.c (elf_m68k_relocate_section): Don't need the + relocation value when resolving a reference from a debugging + section. + +2001-03-16 Scott Thomason + + * coff64-rs6000.c (xcoff64_swap_sym_out): Fix syntax errors. + (xcoff64_swap_sym_out): Fix syntax errors. + +2001-03-16 Richard Sandiford + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix warning. + +2001-03-15 Alan Modra + + * elf32-hppa.c (elf32_hppa_link_hash_entry): Add maybe_pic_call. + (hppa_link_hash_newfunc): Init it. + (hppa_type_of_stub): Only use non-PIC to PIC call stub if caller + section appears to be non-PIC. + (final_link_relocate): Likewise. + (elf32_hppa_adjust_dynamic_symbol): Set maybe_pic_call for any + possible candidate function, and set pic_call for those that will + only have a .plt entry for the PIC call stub. + (hppa_handle_PIC_calls): Set maybe_pic_call. + +2001-03-12 DJ Delorie + + * elf32-sh.c (sh_elf_relocate_section): Only relocation + R_SH_DIR8WP* relocs if they're against external symbols, else + they're just for relaxing. Validate the reloc values. + +2001-03-12 Stefan Geuken + + * binary.c (bfd_external_binary_architecture): Declare. + (binary_object_p): If bfd_external_binary_architecture is defined, + set the architecture to this string. + +2001-03-11 Philip Blundell + + * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Don't make PLT + entries that could serve as a definition for a weak symbol. + +2001-03-08 Nick Clifton + + * Most files: Update copyright notices using Perl script created + by Kevin Buettner . + +2001-03-07 Nick Clifton + + * elf32-arm.h (elf32_arm_final_link_relocate): Conditionalise + prior patch on ! defined OLD_ARM_ABI. + +2001-03-07 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix handling of + some relocation values. + +2001-03-06 Nick Clifton + + * elf32-arm.h (elf32_arm_final_link_relocate): Clear bit zero + of offset in BLX(1) instruction. + * coff-arm.c (coff_arm_relocate_section): Clear bit zero of + offset in BLX(1) instruction. + Fix formatting. + +2001-03-06 Nick Clifton + + * coff-arm.c (coff_arm_reloc_type_lookup): Add + BFD_RELOC_THUMB_PCREL_BLX. + +2001-03-06 Igor Shevlyakov + + * archures.c (bfd_default_scan): Add Coldfire CPUs. + * bfd-in2.h: Regenerate. + * cpu-m68k.c: Add Coldfire CPUs for arch table. + * ieee.c (ieee_write_processor): Set proper id for + Coldfire CPUs. + +2001-03-01 D.J. Barrow + + * configure.in: Add s390 target. + * configure: Regenerate. + +2001-02-28 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Add relocation + to addend. + +2001-02-28 Philip Blundell + + * elf32-arm.h: Update mentions of renamed EF_xx constants. + (elf32_arm_print_private_bfd_data): Handle ARM EABI version 2. + +2001-02-27 H.J. Lu + + * aoutx.h (NAME(aout,bfd_free_cached_info)): Return true if + abfd->tdata.aout_data == NULL. + +2001-02-27 Alan Modra + + * elf32-hppa.c: Correct field selector in stub comments. + (clobber_millicode_symbols): Formatting fix. + + * configure.in: Bump version to 2.11.90. + * configure: Regenerate. + * Makefile.am (CFILES): Rename to SOURCE_CFILES. + (CFILES): $SOURCE_CFILES + generated C files. + (POTFILES): Include $HFILES not $SOURCE_HFILES. + Run "make dep-am" + * Makefile.in: Regenerate. + * doc/Makefile.in: This too. + +2001-02-26 Timothy Wall + + * elfxx-ia64.c (elfNN_ia64_aix_add_symbol_hook): Remove obsolete + comments. + +2001-02-26 Nick Clifton + + * coffcode.h (styp_to_sec_flags) [COFF_WITH_PE version]: Tidy + up, replacing multiple if statements with a switch. + (handle_COMDAT): New function. + +2001-02-26 H.J. Lu + + * coffcode.h (styp_to_sec_flags) [COFF_WITH_PE version]: Issue + a warning for section flags we do not handle instead of + aborting. + +2001-02-26 Andreas Jaeger + + * elf64-x86-64.c (x86_64_elf_howto_table): Fix order of entries. + +2001-02-22 Timothy Wall + + * config.bfd (targ_cpu): Add vectors for ia64-*-aix* (aka Monterey). + * configure.in: Add objects for elf64_ia64_aix vectors. + * configure: Regenerated. + * configure.host: Recognize ia64-*-aix*. + * elfxx-ia64.c: Add hooks for ELF64 on AIX5. Define new vectors + for AIX. AIX5 requires most relocations to be dynamic (*all* + binaries are somewhat similar to shared libraries). + * targets.c: Add elf64_ia64_aix vectors. + +2001-02-21 David Mosberger + + * cpu-ia64-opc.c (elf64_ia64_operands}: Fix typo: error string for + C8 said "1" instead of "8". Clarify error string for IMM22: + "signed integer" instead of just "integer". + +2001-02-20 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Don't make + PLT entries that could serve as a definition for a weak symbol. + +2001-02-19 Jakub Jelinek + + * elf32-sparc.c (elf32_sparc_finish_dynamic_symbol): Don't make PLT + entries that could serve as a definition for a weak symbol. + * elf64-sparc.c (sparc64_elf_finish_dynamic_symbol): Likewise. + +2001-02-18 David O'Brien + + * configure.in: Recognize FreeBSD/arm, FreeBSD/PowerPC, and treat + FreeBSD/i386-CURRENT differently until I can figure out the needed + corefile changes. + * configure: Regenerate. + * config.bfd: Recognize FreeBSD/x86-64, FreeBSD/ia64, FreeBSD/arm, + FreeBSD/PowerPC, and FreeBSD/sparc64. + +2001-02-18 lars brinkhoff + + * Makefile.am: Add PDP-11 a.out target. + * config.bfd: Likewise. + * configure.in: Likewise. + * targets.c: Likewise. + * archures.c: Likewise. + * bfd-in2.h: Likewise. Add PDP-11 relocations. + * libbfd.h: Add PDP-11 relocations. + * reloc.c: Likewise. + * cpu-pdp11.c: New file. + * pdp11.c: New file. + + * libaout.h (GET_WORD) [ARCH_SIZE==16]: Define. + (GET_SWORD) [ARCH_SIZE==16]: Likewise. + (GET_SWORD) [ARCH_SIZE==16]: Likewise. + (PUT_WORD) [ARCH_SIZE==16]: Likewise. + (GET_MAGIC): New macro. + (PUT_MAGIC): Likewise. + * aout-target.h (MY(object_p)): Use GET_MAGIC to read magic word. + +2001-02-18 Jim Kingdon + + * irix-core.c (irix_core_core_file_p): Set the architecture (GDB + multiarch needs it). + +2001-02-18 H.J. Lu + + * elflink.h (elf_link_input_bfd): Ignore invalid section symbol + index. + +2001-02-18 Kazu Hirata + + * vms-misc.c: Fix formatting. + +2001-02-16 Kazu Hirata + + * vms.c: Fix formatting. + +2001-02-14 H.J. Lu + + * elf.c (elf_find_function): New function. + (_bfd_elf_find_nearest_line): Call elf_find_function () to find + the file name and function name. + +2001-02-14 Nick Clifton + + * ecoff.c (bfd_debug_section): Update to initialise new fields in + asection structure. + + * Makefile.am (BFD32_BACKENDS_CFILES): Remove peigen.c + (BFD64_BACKENDS): Add pepigen.c + Add rules to create peigen.c and pepigen.c from peXXigen.c. + + * Makefile.in: Regenerate. + * configure: Regenerate. + * po/POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. + +2001-02-14 H.J. Lu + + * libcoff-in.h (pe_tdata): Add members target_subsystem and + force_minimum_alignment. + +2001-02-14 Bo Thorsen + + * elf64-x86-64.c: Small formatting fixes and rearrangements of code. + (elf64_86_64_size_info): Struct added to fix a problem + with the hashtable string entries. + (elf64_x86_64_adjust_dynamic_symbol): Add generation of .got.plt. + (elf64_x86_64_size_dynamic_sections): A FIXME removed. + (elf64_x86_64_size_dynamic_sections): Fix a dynamic entry and + remove the FIXME for this. + (elf64_x86_64_adjust_dynamic_symbol): Fix check for unneeded .plt + section. Also removed the FIXME for it. + (x86_64_elf_howto_table): Use bfd_elf_generic_reloc. + (ELF_DYNAMIC_INTERPRETER): Fix the name of the dynamic linker. + (elf64_x86_64_finish_dynamic_sections): Enable .got.plt writing. + +2001-02-13 Richard Henderson + + * elfxx-ia64.c (elfNN_ia64_final_link): Set __gp if required + and not user provided. + +2001-02-13 Kazu Hirata + + * vms.c (vms_print_symbol): Remove unreachable code. + + * rs6000-core.c: Fix formatting. + +2001-02-13 David Mosberger + + * peicode.h (coff_swap_filehdr_out) [COFF_IMAGE_WITH_PE]: Define + as _bfd_XXi_only_swap_filehdr_out. + (pe_mkobject) [PEI_FORCE_MINIMUM_ALIGNMENT]: Set + pe->force_minimum_alignment to TRUE. + (pe_mkobject) [PEI_TARGET_SUBSYSTEM]: Set pe->target_subsystem to + PEI_TARGET_SUBSYSTEM. + (pe_print_private_bfd_data): Call + _bfd_XX_print_private_bfd_data_common() instead of + _bfd_pe_print_private_bfd_data_common(). + (pe_bfd_copy_private_bfd_data): Call + _bfd_XX_bfd_copy_private_bfd_data_common() instead of + _bfd_pe_bfd_copy_private_bfd_data_common(). + (coff_bfd_copy_private_section_data): Define as + _bfd_XX_bfd_copy_private_section_data instead of + _bfd_pe_bfd_copy_private_section_data. + (coff_get_symbol_info): Define as _bfd_XX_get_symbol_info instead + of a _bfd_pe_get_symbol_info. + + * peigen.c: Delete. + + * peXXigen.c: Renamed from peigen.c. + (COFF_WITH_XX): Define this macro (will get expanded into + COFF_WITH_pep or COFF_WITH_pe, depending on whether this is being + compiled as peigen.c or pepigen.c. + [COFF_WITH_pep]: Include "coff/ia64.h" instead of "coff/i386.h" to + define the canonical PEP structures and definitions. + (_bfd_XXi_swap_aouthdr_out): If pe->force_minimum_alignment is in + effect, enforce minimum file and section alignments. If + extra->Subsystem is IMAGE_SUBSYSTEM_UNKNOWN, set it to + pe->target_subsystem (this defaults to IMAGE_SUBSYSTEM_UNKNOWN, + so, by default, this is a no-op). + + * libpei.h: Rename COFF_WITH_PEP to COFF_WITH_pep. + (_bfd_XX_bfd_copy_private_bfd_data_common): Add macros to map + _bfd_XXfoo to _bfd_pepfoo if COFF_WIT_PEP is defined and to + _bfd_pefoo if it's not defined. Use these macros to define + coff swap macros. + + * libcoff.h (pe_tdata): Add members target_subsystem and + force_minimum_alignment. + + * efi-app-ia64.c (COFF_WITH_pep): Rename COFF_WITH_PEP to + COFF_WITH_pep. + (PEI_TARGET_SUBSYSTEM): Rename from PEI_DEFAULT_TARGET_SUBSYSTEM. + + * configure.in (bfd_efi_app_ia64_vec): Use pepigen.lo instead of + peigen.lo. + + * coff-ia64.c: Rename COFF_WITH_PEP to COFF_WITH_pep. + (AOUTSZ): Rename PEP64AOUTSZ and PEP64AOUTHDR to PEPAOUTSZ and + PEPAOUTHDR. + + * Makefile.in (BFD64_BACKENDS): Mention pepigen.lo. + (BFD64_BACKENDS_CFILES): Mention pepigen.c + (peigen.c): Add rule to generate from peXXigen.c. + (pepigen.c): Ditto. + (pepigen.lo): List dependencies for pepigen.lo. + +2001-02-13 Alan Modra + + * elf32-hppa.c (elf32_hppa_set_gp): Handle weak $global$. If + $global$ referenced but not defined, set its value here. + +2001-02-09 Bo Thorsen + + * elf64-x86-64.c (elf64_x86_64_check_relocs): Set .rela.got section + alignment to 3. + (elf64_x86_64_check_relocs): Write R_X86_64_GOTPCREL GOT entry + and relocation. + (elf64_x86_64_relocate_section): Fix formatting. + (elf64_x86_64_relocate_section): Fix addend for relocation of + R_X86_64_(8|16|32|PC8|PC16|PC32). + +2001-02-12 Jan Hubicka + + * elf64-x86-64.c (x86_64_elf_howto): Fix name of R_X86_64_GOTPCREL. + +2001-02-11 H.J. Lu + + * elflink.h (elf_bfd_final_link): Use file_align for SYMTAB + alignment. + +2001-02-11 Maciej W. Rozycki + + * elf32-mips.c (mips_elf_create_dynamic_relocation): Undo patch + from 2000-10-13. Do not add the symbol's value for R_MIPS_REL32 + relocations against dynsym symbols. + + * elf32-mips.c (elf_mips_howto_table): Fix the comment on + the R_MIPS_26 relocation. + (mips_elf_calculate_relocation): Use (p + 4) instead of p for + the R_MIPS_26 relocation. + (mips_elf_perform_relocation): Fix the comment on the R_MIPS16_26 + relocation. + * elf64-mips.c (mips_elf64_howto_table_rel): Fix the comment on + the R_MIPS_26 relocation. + (mips_elf64_howto_table_rela): Likewise. + + * elf32-mips.c (struct mips_elf_link_hash_entry): Added no_fn_stub + member to mark symbols that have non-CALL relocations against + them. + (mips_elf_link_hash_newfunc): Initialize no_fn_stub. + (mips_elf_calculate_relocation): Handle R_MIPS_CALL16 like + R_MIPS_GOT16. + (_bfd_mips_elf_check_relocs): Set no_fn_stub for a symbol if a + non-CALL relocation against it is encountered. + (_bfd_mips_elf_copy_indirect_symbol): Merge no_fn_stub as well. + (_bfd_mips_elf_adjust_dynamic_symbol): Only create a stub if + no_fn_stub is not set. + + * elf32-mips.c (mips_elf_output_extsym): Get the output section + information from the real symbol for indirect ones. + Check no_fn_stub to find out if a symbol has a function stub + indeed. + +2001-02-11 Michael Sokolov + + * Makefile.am (stamp-lib): ranlib the libbfd.a in the build directory. + * Makefile.in: Regenerate. + +2001-02-09 David Mosberger + + * elfxx-ia64.c (is_unwind_section_name): New function. Returns + true if section name is an unwind table section name. + (elfNN_ia64_additional_program_headers): Count each unwind section + separately. + (elfNN_ia64_modify_segment_map): Install one unwind program header + for each unwind separate section. Note: normally the linker + script merges the unwind sections that go into a single segment, + so this still generates at most one unwind program header per + segment. + + * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Accept any section + name for SHT_IA_64_UNWIND, not just .IA_64.unwind. + (elfNN_ia64_fake_sections): Mark sections with names that start + with .IA_64.unwind but not with .IA_64.unwind_info as an IA-64 + unwind section. + + * elfxx-ia64.c (elfNN_ia64_final_write_processing): New function. + Use it to make sh_info in unwind section point to the text section + it applies to. + +2001-02-09 Martin Schwidefsky + + * Makefile.am: Add linux target for S/390. + * archures.c: Likewise. + * bfd-in2.h: Likewise. + * config.bfd: Likewise. + * configure.in: Likewise. + * elf.c: Likewise. + * libbfd.h: Likewise. + * targets.c: Likewise. + * cpu-s390.c: New file. + * elf32-s390.c: New file. + * elf64-s390.c: New file. + +2001-02-09 Nick Clifton + + * peigen.c (_bfd_pe_get_symbol_info): Suppress addition of + ImageBase. This has already been done by coff_swap_hdr_in. + +2001-02-09 Jakub Jelinek + + * elf64-sparc.c (sparc64_elf_copy_private_bfd_data): New function. + +2001-02-09 Jakub Jelinek + + * elf64-sparc.c (sparc64_elf_check_relocs): Don't trust reloc_count. + (sparc64_elf_relocate_section): Likewise. + +2001-02-09 Mark Kettenis + + * elf32-sparc.c (_bfd_sparc_elf_howto_table): Treat R_SPARC_UA32 + similar to R_SPARC_32. + * elf64-sparc.c (sparc64_elf_howto_table): Likewise. + +2001-02-08 H.J. Lu + + * elf32-i386.c (elf_i386_check_relocs): Reserve R_386_PC32 + relocation entries for weak definitions when building DSO with + -Bsymbolic. + +2001-02-08 Richard Henderson + + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Respect weakness + before visibility. Locally defined protected symbols are not + dynamic. + +2001-02-08 Geoffrey Keating + + * config.bfd: Enable coff64 for rs6000-*. Patch from + . + +2001-02-07 Mark Elbrecht + + * coffgen.c (coff_find_nearest_line): If stabs info is successfully + found, do not attempt to find dwarf2 info before returning. + +2001-02-07 Jakub Jelinek + + * elflink.h (is_global_symbol_definition): Rename to + is_global_data_symbol_definition and have it reject function + symbols. + (elf_link_is_defined_archive_symbol): Use renamed function. + +2001-02-07 Todd Vierling + + * libbfd-in.h (bfd_target_vector): Change extern array to pointer. + * libbfd.h (bfd_target_vector): Likewise. + * targets.c (bfd_target_vector): Rename to _bfd_target_vector and + make static; create pointer reference named bfd_target_vector. + (_bfd_target_vector_entries): Calculate this based on the array + typed _bfd_target_vector. + +2001-02-06 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Only hidden and + internal symbols are not dynamic. + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise. + +2001-02-06 Nick Clifton + + * Makefile.am (BFD64_BACKENDS_CFILES): Remove elf64-ia64.c, so + that it will not be pulled into the list of files that make up + po/POTFILES.in. + * Makefile.in: Regenerate. + * po/bfd.pot: Regenerate. + +2001-02-06 H.J. Lu + + * peicode.h (coff_swap_filehdr_in): Remove the e_magic + checking. + (pe_bfd_object_p): Rewrite with external_PEI_DOS_hdr and + external_PEI_IMAGE_hdr. + +2001-02-06 Kazu Hirata + + * elf-m10200.c: Fix formatting. + +2001-02-04 Nick Clifton + + * elf32-v850.c (v850_elf_reloc): Do not convert reloc addend to PC + rel, it will be handled later on. + +2001-02-02 Fred Fish + + * Makefile.in: Fix typo. + +2001-02-01 Kazu Hirata + + * elf-m10300.c: Fix formatting. + +2001-01-30 Alan Modra + + * elf64-hppa.c (elf64_hppa_elf_get_symbol_type): New function. + (elf_backend_get_symbol_type): Define. + (elf64_hppa_object_p): Set architecture and machine from elf + header flags. + +2001-01-30 Curtis L. Janssen + + * elf64-alpha.c (elf64_alpha_find_nearest_line): Query dwarf2 + before mdebug. + +2001-01-26 Richard Henderson + + * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Return false + for non-default visibility. + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise, but + delete ugly macro and replace with pretty function. + +2001-01-25 Mark Elbrecht + + * coff-go32.c: Update copyright. + * coff-stgo32.c: Likewise. + * coff-go32.c (COFF_LONG_FILENAMES): Define. + * coff-stgo32.c (COFF_LONG_FILENAMES): Likewise. + * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Remove .bss entry. + * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. + +2001-01-25 Kazu Hirata + + * bfd-in2.h: Rebuild. + * libbfd.h: Likewise. + +2001-01-23 H.J. Lu + + * bfd-in2.h: Rebuild. + +2001-01-23 H.J. Lu + + * vms-misc.c (_bfd_vms_next_record): Return -1 if PRIV(vms_buf) + is NULL or PRIV(vms_rec) is outside of the buffer. + +2001-01-23 Kazu Hirata + + * coff64-rs6000.c: Fix formatting. + * coff-arm.c: Likewise. + * coffgen.c: Likewise. + * cofflink.c: Likewise. + * coff-mcore.c: Likewise. + * coff-mips.c: Likewise. + * coff-pmac.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * elf32.c: Likewise. + * elf32-fr30.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i860.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-v850.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-sparc.c: Likewise. + * elflink.c: Likewise. + * elflink.h: Likewise. + * elf-m10200.c: Likewise. + * elf-m10300.c: Likewise. + * elfxx-ia64.c: Likewise. + + * aoutx.h: Fix formatting. + * bfd.c: Likewise. + * bfd-in2.h: Likewise. + * bfd-in.h: Likewise. + * cpu-i386.c: Likewise. + * cpu-m68hc11.c: Likewise. + * dwarf2.c: Likewise. + * elf64-x86-64.c: Likewise. + * format.c: Likewise. + * freebsd.h: Likewise. + * hash.c: Likewise. + * hp300hpux.c: Likewise. + * hppabsd-core.c: Likewise. + * hpux-core.c: Likewise. + +2001-01-22 Bo Thorsen + + * elf64-x86-64.c: Added PIC support for X86-64. + (elf64_x86_64_link_hash_newfunc): Function added. + (elf64_x86_64_link_hash_table_create): Likewise. + (elf64_x86_64_check_relocs): Likewise. + (elf64_x86_64_gc_mark_hook): Likewise. + (elf64_x86_64_gc_sweep_hook): Likewise. + (elf64_x86_64_adjust_dynamic_symbol): Likewise. + (elf64_x86_64_size_dynamic_sections): Likewise. + (elf64_x86_64_discard_copies): Likewise. + (elf64_x86_64_finish_dynamic_symbol): Likewise. + (elf64_x86_64_finish_dynamic_sections): Likewise. + (elf64_x86_64_relocate_section): Add relocation of PIC sections. + +2001-01-21 Maciej W. Rozycki + + * Makefile.am (install-data-local): Make use of $(DESTDIR). + * Makefile.in: Regenerate. + +2001-01-21 Kazu Hirata + + * coff-a29k.c: Fix formatting. + +2001-01-19 H.J. Lu + + * elf32-i386.c (elf_i386_check_relocs): Report files with bad + relocation section names. + (elf_i386_relocate_section): Report files with bad relocation + section names and return false. + +2001-01-17 Bo Thorsen + + * targets.c: Alphabetize list of xvecs. + +2001-01-14 Alan Modra + + * config.bfd: Add linux target variant for elfxx-hppa. + * configure.in: Recognize bfd_elf32_hppa_linux_vec and + bfd_elf64_hppa_linux_vec. + * configure: Regenerate. + * elf64-hppa.c: Include elf64-target.h again to support linux + target variant. + (elf64_hppa_post_process_headers): Set ELFOSABI_LINUX for linux. + * elf32-hppa.c: Include elf32-target.h again to support linux + target variant. + (elf32_hppa_post_process_headers): New function. + (elf_backend_post_process_headers): Define. + * targets.c (bfd_target_vector): Add bfd_elf64_hppa_linux_vec and + bfd_elf32_hppa_linux_vec. + + * elf32-hppa.c (elf32_hppa_link_hash_table): Add text_segment_base, + and data_segment_base fields. + (elf32_hppa_link_hash_table_create ): Init them. + (elf32_hppa_check_relocs): Update comments. + (hppa_record_segment_addr): New function. + (elf32_hppa_relocate_section): Call it. + (final_link_relocate): Handle R_PARISC_SEGREL32. + (elf32_hppa_final_link): New function. + (bfd_elf32_bfd_final_link): Define to call it. + (hppa_unwind_entry_compare): New function. + * cache.c (bfd_open_file): Create files in write+read mode. + + * elf-hppa.h (elf_hppa_howto_table): Set bitsize value for + SEGREL32 and numerous other relocs. Change duplicate + R_PARISC_NONE relocs to R_PARISC_UNIMPLEMENTED. + + * opncls.c (bfd_fdopenr): Add parens like the comment says around + O_ACCMODE. + + * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Don't create + .plt entries for DT_INIT and DT_FINI. + (elf32_hppa_finish_dynamic_sections): Remove special handling of + DT_INIT and DT_FINI. + + * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Use 16-bit + offsets for stub .plt access if wide mode. Check offset in range. + +2001-01-13 Nick Clifton + + * elf32-fr30.c (fr30_elf_howto_table): Remove spurious blank + line. + + * coffcode.h (coff_canonicalize_reloc): Remove spurious blank + line. + +2001-01-12 Alan Modra + + * configure.in ([bfd_elf64_x86_64_vec]): Set target64. + * configure: Regenerate. + +2001-01-11 Peter Targett + + * bfd-in2.h (bfd_architecture): Add bfd_mach_arc_5, + bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8 for ARC variants. + * cpu-arc.c (arch_info_struct): Add entries for variants. + (bfd_arc_arch) Set default to bfd_mach_arc_5. + (arc_get_mach) Don't assume machine names prefixed arc- before + testing. + * elf32-arc.c (arc_elf_object_p): Set machine number based on new + selections. + (arc_elf_final_write_processing) Likewise. + (ELF_MACHINE_CODE) Use EM_ARC. + +2001-01-10 Nick Clifton + + * coff-arm.c (LOCAL_LABEL_PREFIX): Change definition to "". + +2001-01-07 Philip Blundell + + * README: Replace `bug-gnu-utils@gnu.org' with + `bug-binutils@gnu.org'. + +2001-01-04 Kazu Hirata + + * som.c: Fix formatting. + +2001-01-03 Kazu Hirata + + * ecoffswap.h: Fix formatting. + * elf-bfd.h: Likewise. + * elfarm-nabi.c: Likewise. + * elfarm-oabi.c: Likewise. + * elfcode.h: Likewise. + * elfcore.h: Likewise. + * elflink.c: Likewise. + * elflink.h: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-target.h: Likewise. + * libbfd.c: Likewise + * linker.c: Likewise. + * lynx-core.c: Likewise. + +2001-01-02 Kazu Hirata + + * pc532-mach.c: Fix formatting. + * pe-arm.c: Likewise. + * pe-i386.c: Likewise. + * pe-mips.c: Likewise. + * pe-ppc.c: Likewise. + * pe-sh.c: Likewise. + * pei-mips.c: Likewise. + * pei-sh.c: Likewise. + * peicode.h: Likewise. + * ppcboot.c: Likewise. + * ptrace-core.c: Likewise. + +2001-01-01 Kazu Hirata + + * reloc.c: Fix formatting. + * riscix.c: Likewise. + * rs6000-core.c: Likewise. + * xcoff-target.h: Likewise. + +2000-12-29 Hans-Peter Nilsson + + * elfcode.h (elf_object_p): Also restore the bfd mach field on + error, by calling bfd_default_set_arch_mach with incoming + values. + +2000-12-26 Kazu Hirata + + * vaxnetbsd.c: Fix formatting. + * versados.c: Likewise. + * vms-gsd.c: Likewise. + * vms-hdr.c: Likewise. + * vms-misc.c: Likewise. + +2000-12-25 Alexandre Oliva + + * archive.c (coff_write_armap): Don't write more than symbol_count + `archive_member_file_ptr's. + +2000-12-25 Kazu Hirata + + * vms-tir.c: Fix formatting. + +2000-12-23 Kazu Hirata + + * vms.c: Fix formatting. + * vms.h: Likewise. + +2000-12-21 Santeri Paavolainen + + * vms-hdr.c: Include alloca.h if HAVE_ALLOCA_H is defined. + + * peicode.h (pe_ILF_object_p): Add const to import of TARGET_LITTLE_SYM. + + * elf32-m32r.c (m32r_elf_generic_reloc): Add cast to avoid (void *) + arithmetic. + + * elf32-fr30.c: Add casts to avoid (void *) arithmetic. + + * coffcode.h (styp_to_sec_flags): Add empty statement after label. + +2000-12-21 Richard Sandiford + + * libbfd.c (bfd_get_bits): Added + (bfd_put_bits): Likewise + * bfd-in.h: Declared the above. + * bfd-in2.h: Regenerated. + +2000-12-20 Kazu Hirata + + * targets.c: Fix formatting. + * tekhex.c: Likewise. + * trad-core.c: Likewise. + +2000-12-19 Kazu Hirata + + * sco5-core.c: Fix formatting. + * section.c: Likewise. + * sparclinux.c: Likewise. + * sparclynx.c: Likewise. + * sparcnetbsd.c: Likewise. + * srec.c: Likewise. + * stabs.c: Likewise. + * stab-syms.c: Likewise. + * sunos.c: Likewise. + * syms.c: Likewise. + * sysdep.h: Likewise. + +2000-12-18 Nick Clifton + + * coff-arm.c (EXTRA_S_FLAGS): Only define if not already + defined. + * epoc-pe-arm.c (EXTRA_S_FLAGS): Define. + * epoc-pei-arm.c (EXTRA_S_FLAGS): Define. + +2000-12-18 Nick Clifton + + * vms-misc.c (_bfd_vms_get_record): Add default case to + file_format switch. + +2000-12-15 Miloslav Trmac + + * elfcore.h (elf_core_file_p): Move to the start of the program + headers before attempting to read them. + +2000-12-14 Kazu Hirata + + * peigen.c: Fix formatting. + * som.c: Likewise. + * som.h: Likewise. + +2000-12-13 Kazu Hirata + + * peigen.c: Fix formatting. + +2000-12-12 Jim Wilson + + * elfxx-ia64.c (get_dyn_sym_info): Cast %p argument to void *. + +2000-12-08 Mark Salter + + * binary.c (binary_set_section_contents): Ignore sections + with zero size. + +2000-12-12 Kazu Hirata + + * m68klinux.c: Fix formatting. + * m68knetbsd.c: Likewise. + * mipsbsd.c: Likewise. + * netbsd-core.c: Likewise. + * netbsd.h: Likewise. + * newsos3.c: Likewise. + * nlm32-alpha.c: Likewise. + * nlm32-i386.c: Likewise. + * nlm32-ppc.c: Likewise. + * nlm32-sparc.c: Likewise. + * nlmcode.h: Likewise. + * nlmswap.h: Likewise. + * nlm-target.h: Likewise. + * ns32knetbsd.c: Likewise. + +2000-12-10 Fred Fish + + * elflink.h (elf_link_output_extsym): Don't complain about undefined + symbols in shared objects if allow_shlib_undefined is true. + +2000-12-12 Nick Clifton + + * cpu-sh.c: Fix formattng. + * elf.c: Fix formattng. + * elf32-mips.c: Fix formattng. + * elf32-sh.c: Fix formattng. + * elf64-alpha.c: Fix formattng. + +2000-12-09 Nick Clifton + + * elf32-mips.c (_bfd_mips_elf_find_nearest_line): Pass + dwarf2_find_line_info as last parameter to invocation of + _bfd_dwarf2_find_nearest_line. + * elf32-arm.h (elf32_arm_find_nearest_line): Pass + dwarf2_find_line_info as last parameter to invocation of + _bfd_dwarf2_find_nearest_line. + +2000-12-08 Mark Elbrecht + + * Makefile.am (BFD32_BACKENDS): Move dwarf2.lo from here... + (BFD_LIBS): ...to here. + (BFD32_BACKENDS_CFILES): Move dwarf2.c from here... + (BFD_LIBS_CFILES): ...to here. + * Makefile.in: Regenerate. + * configure.in: Remove dwarf.lo from the elf shell variable. + * configure: Regenerate. + * libcoff-in.h (coff_tdata): Add pointer dwarf2_find_line_info. + * libcoff.h: Regenerate. + * coffgen.c (coff_find_nearest_line): Call + _bfd_dwarf2_find_nearest_line. + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Add parameter. Update + accordingly. + (read_abbrevs): Likewise + (decode_line_info): Likewise. + (parse_comp_unit): Likewise. + (comp_unit_find_nearest_line): Likewise. + * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype. + * libbfd.h: Regenerate. + * elf.c (_bfd_elf_find_nearest_line): Update call. + * elf-bfd.h (elf_obj_tdata): Change dwarf2_find_line_info to type PTR. + * dwarf2.c (concat_filename): Use IS_ABSOLUTE_PATH. + * coffcode.h (STYP_XCOFF_DEBUG, STYP_DEBUG_INFO): New macros. + (sec_to_styp_flags): Use them. Handle DWARF2 sections. + (styp_to_sec_flags): Handle DWARF2 sections. + * elf32-arm.h (elf32_arm_find_nearest_line): Add parameter to call + to _bfd_find_nearest_line. + * elf32-mips.c (_bfd_mips_elf_find_nearest_line): Add parameter to + call to _bfd_find_nearest_line. + +2000-12-08 Kazu Hirata + + * coffgen.c: Fix formatting. + * elf-m10300.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-i960.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-v850.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mips.c: Likewise. + * elf64-sparc.c: Likewise. + +2000-12-07 Kazu Hirata + + * elf32-ppc.c: Fix formatting. + * elf64-x86-64.c: Likewise. + +2000-12-06 Ulf Carlsson + + From Ralf Baechle + + * elf32-mips.c (elf32_mips_merge_private_bfd_data): Always permit + BFDs containing no sections or empty .text, .data or .bss sections + to be merged, regardless of their flags. + +2000-12-06 Kazu Hirata + + * elf32-m32r.c: Fix formatting. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc12.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-pj.c: Likewise. + * elf32-ppc.c: Likewise. + +2000-12-05 Kazu Hirata + + * elf32-fr30.c: Fix formatting. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-i860.c: Likewise. + * elf32-i960.c: Likewise. + +2000-12-03 Kazu Hirata + + * elf32-arm.h: Fix formatting. + * elf32-avr.c: Likewise. + * elf32-cris.c: Likewise. + * elf32-d10v.c: Likewise. + * elf32-d30v.c: Likewise. + * elf-hppa.h: Likewise. + * elf-m10200.c: Likewise. + * elf-m10300.c: Likewise. + +2000-12-01 Chris Demetriou + + * aoutx.h (NAME(aout,machine_type)): Add bfd_mach_mips32 and + bfd_mach_mips32_4k. Update FIXME comment. + * archures.c (bfd_mach_mips32): New constant. + (bfd_mach_mips4K, bfd_mach_mips32_4k) Rename the former to + the latter, renumber it. + * bfd-in2.h (bfd_mach_mips32): New constant. + (bfd_mach_mips4K, bfd_mach_mips32_4k) Rename the former to + the latter, renumber it. + * cpu-mips.c (I_mips32): New constant. + (I_mips4K, I_mips32_4k): Rename the former to the latter. + (arch_info_struct): Add bfd_mach_mips32 entry, replace + bfd_mach_mips4K entry with bfd_mach_mips32_4k entry. + * elf32-mips.c (elf_mips_isa): Add E_MIPS_ARCH_32 case. + (elf_mips_mach): Likewise. Also, replace E_MIPS_MACH_MIPS32 + with E_MIPS_MACH_MIPS32_4K. + (_bfd_mips_elf_final_write_processing): Replace + bfd_mach_mips4K with bfd_mach_mips32_4k case, add + bfd_mach_mips32 case. + (_bfd_mips_elf_merge_private_bfd_data): Generalize ISA mixing + comparison with support for MIPS32. + (_bfd_mips_elf_print_private_bfd_data): Print ISA name for + MIPS32. + + * aoutx.h (NAME(aout,machine_type)): Add cases for + bfd_mach_mips5 and bfd_mach_mips64. + * archures.c (bfd_mach_mips5, bfd_mach_mips64): New constants. + * bfd-in2.h (bfd_mach_mips5, bfd_mach_mips64): Likewise. + * cpu_mips.c (I_mips5, I_mips64): New definitions. + (arch_info_struct): Add entries for bfd_mach_mips5 and + bfd_mach_mips64. + * elf32-mips.c (elf_mips_isa, elf_mips_mach, + _bfd_mips_elf_print_private_bfd_data): Add cases for + E_MIPS_ARCH_5 and E_MIPS_ARCH_64. + (_bfd_mips_elf_final_write_processing): Add cases for + bfd_mach_mips5 and bfd_mach_mips64. + + * aoutx.h (NAME(aout,machine_type)): Add a + bfd_mach_mips_sb1 case. + * archures.c (bfd_mach_mips_sb1): New constant. + * bfd-in2.h (bfd_mach_mips_sb1): New constant. + * cpu-mips.c (I_sb1): New constant. + (arch_info_struct): Add entry for bfd_mach_mips_sb1. + * elf32-mips.c (elf_mips_mach): Add case for + E_MIPS_MACH_SB1. + (_bfd_mips_elf_final_write_processing): Add case for + bfd_mach_mips_sb1. + +2000-12-01 Joel Sherrill + + * config.bfd (arm-*-rtems*, a29k-*rtems*): New targets. + (sparc*-*-rtemself*, sparc*-*-rtemsaout*): New targets. + (sparc*-*-rtems*): Switched from a.out to ELF. + +2000-11-30 Jan Hubicka + + * Makefile.am (BFD64_BACKENDS): Add elf64-x86-64.lo + BFD64_BACKENDS_CFILES): Add elf64-x86-64.c + (elf64-x86-64.lo): Add dependencies. + * archures.c (DESCRIPTION): Add bfd_mach_x86_64, + bfd_mach_x86_64_intel_syntax. + * elf.c (prep_headers): Use EM_x86_64 for 64bit output. + * config.bfd (x86_64): Add. + * configure.in: Add support for bfd_elf64_x86_64_vec. + * cpu-i386.c (bfd_x86_64_arch_intel_syntax, bfd_x86_64_arch): Add. + (bfd_i386_arch, i8086_ar): Link in. + * elf64-x86-64.c: New file. + * reloc.c (ENUMDOC): Add BFD_RELOC_X86_64*. + * targets.c (bfd_elf64_x86_64_vec): Add. + (bfd_target_vect): Add bfd_elf64_x86_64_vec. + +2000-11-30 Kazu Hirata + + * xcofflink.c: Fix formatting. + +2000-11-28 Kazu Hirata + + * aoutx.h: Fix formatting. + * bfd-in.h: Likewise. + * bfd-in2.h: Likewise. + * cache.c: Likewise. + * cisco-core.c: Likewise. + * coff64-rs6000.c: Likewise. + * coffcode.h: Likewise. + * coffswap.h: Likewise. + * corefile.c: Likewise. + * elf32-mips.c: Likewise. + +2000-11-27 Kazu Hirata + + * aout-adobe.c: Fix formatting. + * coff64-rs6000.c: Likewise. + * coffgen.c: Likewise. + * cofflink.c: Likewise. + +2000-11-27 Philip Blundell + + * libcoff-in.h (coff_tdata): Add `strings_written' flag. + (obj_coff_strings_written): New accessor macro for above. + * libcoff.h: Regenerate. + * cofflink.c (_bfd_coff_final_link): Say that we wrote the + strings. + * coffcode.h (coff_write_object_contents): No need to write out + the string table if it's already been done. + +2000-11-22 Philip Blundell + + * cofflink.c (_bfd_coff_generic_relocate_section): Don't object to + weak undefined symbols. + +2000-11-24 Nick Clifton + + * archures.c (bfd_mach_arm_5TE): Define. + (bfd_mach_arm+XScale): Define. + * bfd-in2.h: Regenerate. + + * coff-arm.c (coff_arm_reloc_type_lookup): Accept + BFD_RELOC_ARM_PCREL_BLX. + + * coffcode.h (coff_set_flags): Set flags for 5t, 5te and + XScale machine numbers. + + * config.bfd (xscale-elf): Add target. + (xscale-coff): Add target. + + * cpu-arm.c: Add xscale machine name. + Add v5t, v5te and XScale machine numbers. + +2000-11-23 Kazu Hirata + + * aix386-core.c: Fix formatting. + +2000-11-22 Jim Wilson + + * coff-ia64.c (howto_table): Use EMPTY_HOWTO. + (in_reloc_p): Add ATTRIBUTE_UNUSED to unused parameters. + * cpu-ia64-opc.c (ins_rsvd, ext_rsvd, ins_const, ext_const): Likewise. + (ins_imms_scaled): Initialize sign_bit at function entry. + (elf64_ia64_operands): Add missing initializers. + * elfxx-ia64.c (elfNN_ia64_reloc, elfNN_ia64_reloc_type_lookup, + elfNN_ia64_info_to_howto, elfNN_ia64_fake_sections, + elfNN_ia64_add_symbol_hook, elfNN_ia64_is_local_label_name, + elfNN_ia64_local_hash_table_init, get_fptr, get_pltoff, + elfNN_ia64_adjust_dynamic_symbol): Add ATTRIBUTE_UNUSED for unused + parameters. + (elfNN_ia64_info_to_howto): Initialize free_relocs, free_contents, + and free_extsyms at function entry. + (elfNN_add_symbol_hook): Add unsigned cast to bfd_get_gp_size result. + (elfNN_ia64_create_dynamic_sections): Delete unused local h. + (get_got): Delete unused local srel. + (elfNN_ia64_check_relocs): Initialize dynrel_type when declared. + (elfNN_ia64_relocate_section): Delete unused local dynindx. + +2000-11-21 Kazu Hirata + + * coff-a29k.c: Fix formatting. + * coff-h8500.c: Likewise. + * coff-i960.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-stgo32.c: Likewise. + * coff-tic54x.c: Likewise. + * coff-w65.c: Likewise. + * cpu-h8500.c: Likewise. + * cpu-hppa.c: Likewise. + * cpu-ns32k.c: Likewise. + * ecoff.c: Likewise. + * ecofflink.c: Likewise. + +2000-11-21 Nick Clifton + + * elf32-sh.c (sh_elf_reloc_loop): Fix compile time warning, and + remove possibility of infinite loop. + +2000-11-20 Kazu Hirata + + * aix386-core.c: Fix formatting. + * aout-adobe.c: Likewise. + * aout-arm.c: Likewise. + * aout-encap.c: Likewise. + * aout-ns32k.c: Likewise. + * aout-target.h: Likewise. + * aout-tic30.c: Likewise. + * aoutf1.h: Likewise. + * aoutx.h: Likewise. + * archive.c: Likewise. + * bfd-in.h: Likewise. + * bfd-in2.h: Likewise. + * bfd.c: Likewise. + * bout.c: Likewise. + +2000-11-17 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Don't create + pltoff entries for DT_INIT and DT_FINI. + (elfNN_ia64_final_link): Don't set DT_INIT/FINI entries. + (elfNN_ia64_finish_dynamic_sections): Don't fill in DT_INIT/FINI + entries. + +2000-11-16 Richard Henderson + + * elfxx-ia64.c (elfNN_ia64_check_relocs): Handle IPLT relocs. + (allocate_dynrel_entries): Likewise. + (elfNN_ia64_relocate_section): Likewise. Set REL addends correctly. + (set_pltoff_entry): Likewise. + (ia64_howto_table): Remove R_IA64_SEGBASE, and R_IA64_EPLT[ML]SB + (elfNN_ia64_reloc_type_lookup): Likewise. + (elfNN_ia64_install_value): Likewise. + (elfNN_ia64_relocate_section): Likewise. + * reloc.c (BFD_RELOC_IA64_SEGBASE): Remove. + (BFD_RELOC_IA64_EPLTMSB, BFD_RELOC_IA64_EPLTLSB): Remove. + +2000-11-16 Kazu Hirata + + * cpu-a29k.c: Fix formatting. + * cpu-alpha.c: Likewise. + * cpu-arm.c: Likewise. + * cpu-avr.c: Likewise. + * cpu-d10v.c: Likewise. + * cpu-h8500.c: Likewise. + * cpu-hppa.c: Likewise. + * cpu-i370.c: Likewise. + * cpu-i386.c: Likewise. + * cpu-i960.c: Likewise. + * cpu-ia64-opc.c: Likewise. + * cpu-ia64.c: Likewise. + * cpu-m32r.c: Likewise. + * cpu-m68hc11.c: Likewise. + * cpu-m68hc12.c: Likewise. + * cpu-m68k.c: Likewise. + * cpu-m88k.c: Likewise. + * cpu-mips.c: Likewise. + * cpu-ns32k.c: Likewise. + * cpu-pj.c: Likewise. + * cpu-powerpc.c: Likewise. + * cpu-sh.c: Likewise. + * cpu-sparc.c: Likewise. + * cpu-tic54x.c: Likewise. + * cpu-v850.c: Likewise. + * cpu-vax.c: Likewise. + * cpu-w65.c: Likewise. + * cpu-we32k.c: Likewise. + * cpu-z8k.c: Likewise. + * dwarf1.c: Likewise. + * dwarf2.c: Likewise. + +2000-11-15 Kazu Hirata + + * coff-arm.c: Fix formatting. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-sh.c: Likewise. + * coff-sparc.c: Likewise. + * coff-tic30.c: Likewise. + * coff-tic54x.c: Likewise. + * coff-tic80.c: Likewise. + * coff-w65.c: Likewise. + * coff-we32k.c: Likewise. + * coff-z8k.c: Likewise. + +2000-11-15 Richard Henderson + + * elf64-alpha.c (elf64_alpha_check_relocs): Create the reloc + section with the same ALLOC|LOAD flags as the source section. + +2000-11-14 Jakub Jelinek + + * elf64-alpha.c (elf64_alpha_relax_opt_call): Only check bits used + by STO_ALPHA constants. + +2000-11-14 Kazu Hirata + + * coff-pmac.c: Fix formatting. + * coff-ppc.c: Likewise. + +2000-11-13 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): Also add indirect + symbols for common symbols with the default version. + +2000-11-09 Philip Blundell + + * section.c (STD_SECTION): Set gc_mark flag. + +2000-11-11 Kazu Hirata + + * coff-i960.c: Likewise. + * coff-m68k.c: Likewise. + * coff-m88k.c: Likewise. + * coff-mcore.c: Likewise. + * coff-mips.c: Likewise. + +2000-11-11 Bernd Schmidt + + * elf32-sh.c (sh_elf_relocate_section): Ignore R_SH_NONE relocs. + +2000-11-10 Kazu Hirata + + * coff-h8300.c: Fix formatting. + * coff-h8500.c: Likewise. + * coff-i386.c: Likewise. + * coff-i860.c: Likewise. + * coff-i960.c: Likewise. + * coff-ia64.c: Likewise. + +2000-11-09 Kazu Hirata + + * archive.c: Fix formatting. + * archures.c: Likewise. + +2000-11-07 Richard Henderson + + * elfxx-ia64.c (elf64_ia64_final_link): New local unwind_output_sec. + Set it before bfd_elf64_bfd_final_link call. Use it after the call. + * section.c (bfd_set_section_contents): Call memcpy if + section->contents set and location not equal to contents plus offset. + +2000-11-08 Kazu Hirata + + * bfd-in.h: Fix formatting. + * bfd-in2.h: Likewise. + * bfd.c: Likewise. + * binary.c: Likewise. + * bout.c: Likewise. + * coff-a29k.c: Likewise. + * coff-alpha.c: Likewise. + * coff-apollo.c: Likewise. + * coff-aux.c: Likewise. + +2000-11-07 Kazu Hirata + + * aix386-core.c: Fix formatting. + * aoutf1.h: Likewise. + * aoutx.h: Likewise. + * archures.c: Likewise. + * armnetbsd.c: Likewise. + +2000-11-07 Alan Modra + + * coff-h8300.c (special): Adjust reloc address. + +2000-11-06 Steve Ellcey + + * archures.c (bfd_mach_ia64_elf64, bfd_mach_ia64_elf32): Add defines + to differentiate elf32 and elf64 on ia64. + * bfd-in2.h: Regenerate. + * config.bfd: Add target for "ia64*-*-hpux*". + * configure.in: Add bfd_elf32_ia64_big_vec to selvecs switch. + * configure: Regenerate. + * cpu-ia64.c (bfd_ia64_elf32_arch): Add elf32 arch info structure. + * targets.c: Add bfd_target bfd_elf32_ia64_big_vec. + + * Makefile.am: Make elf32-ia64.c and elf64-ia64.c derived objects + from elfxx-ia64.c. Add depenency rules for making elf32-ia64.lo. + * Makefile.in: Regnerate. + * elf64-ia64.c: Deleted. + * elfxx-ia64.c: New file, paramaterized version of elf64-ia64.c. + +2000-11-06 Kazu Hirata + + * aout-adobe.c: Fix formatting. + * aout-arm.c: Likewise. + * aout-cris.c: Likewise. + * aout-encap.c: Likewise. + * aout-ns32k.c: Likewise. + * aout-target.h: Likewise. + * aout-tic30.c: Likewise. + +2000-11-05 Philip Blundell + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Always permit + BFDs containing no sections to be merged, regardless of their flags. + +2000-11-04 Philip Blundell + + * elf32-arm.h (elf32_arm_relocate_section): Suppress error message + if a relocation for an undefined symbol also results in an + overflow. + +2000-11-06 Christopher Faylor + + * config.bfd: Add support for Sun Chorus. + +2000-11-05 David O'Brien + + * configure.in: Recognize alpha-*-freebsd*. + * configure: Regenerate. + +2000-11-02 Luciano Gemme + + * srec.c (CHUNK): Rename to DEFAULT_CHUNK. + (Chunk): New global variable set by a parameter in objcopy.c. + (S3Forced): New global variable set by a parameter in + objcopy.c. + (srec_set_section_contents): If S3Forced is true, always generate + S3 records. + (srec_write_section): Use 'Chunk' to limit maximum length of S + records. + +2000-11-02 Per Lundberg + + * config.bfd: Add support for i[3456]86-chaosdev-storm-chaos. + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * po/bfd.pot: Regenerate. + +2000-10-31 Philip Blundell + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Only handle + EF_SOFT_FLOAT if it is defined. + +2000-10-27 Philip Blundell + + * elf32-arm.h (elf32_arm_copy_private_bfd_data): Don't refuse + attempts to mix PIC code with non-PIC, just mark the output as + being position dependent. + (elf32_arm_merge_private_bfd_data): Likewise. Print an error + message for EF_SOFT_FLOAT mismatches. Display diagnostics for + all mismatches, not just the first one. + +2000-10-25 Chris Demetriou + + * ieee.c (ieee_archive_p): Plug one of many possible + memory leaks in error handling. + +2000-10-20 Jakub Jelinek + + * elf32-sparc.c (elf32_sparc_merge_private_bfd_data, + elf32_sparc_object_p, elf32_sparc_final_write_processing): + Support v8plusb. + * elf64-sparc.c (sparc64_elf_merge_private_bfd_data, + sparc64_elf_object_p): Support v9b. + * archures.c: Declare v8plusb and v9b machines. + * bfd-in2.h: Ditto. + * cpu-sparc.c: Ditto. + +2000-10-16 Geoffrey Keating + + * elf64-sparc.c (sparc64_elf_relocate_section): Clear the location + of a GOT reloc. + + * elf32-ppc.c (SYMBOL_REFERENCES_LOCAL): New macro. + (SYMBOL_CALLS_LOCAL): New macro. + (ppc_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL. + (ppc_elf_check_relocs): Use SYMBOL_REFERENCES_LOCAL. + (ppc_elf_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL. + (ppc_elf_relocate_section): Use flag variable to determine + whether the relocation refers to a local symbol. + Test whether a PLTREL24 reloc will produce a reloc by looking + to see whether a PLT entry was made. + +2000-10-14 Geoffrey Keating + + * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Don't make PLT + entries that could serve as a definition for a weak symbol. + +2000-10-13 Ulf Carlsson + + From Ralf Baechle + + * elf32-mips.c (mips_elf_create_dynamic_relocation): New argument + local_p. Add symbol value only for non-R_MIPS_REL32 relocations + against local symbols. + (_bfd_mips_elf_finish_dynamic_sections): Undo patch from 2000-10-01. + +2000-10-12 Alan Modra + + * section.c (struct sec): Add kept_section. + (struct bfd_comdat_info): Remove sec, we can use above. + (STD_SECTION): Add initializer. + (bfd_make_section_anyway): Init here too. + + * bfd-in2.h: Regenerate. + + * elflink.h (elf_link_add_object_symbols): Remove unnecessary + zeroing of `flags'. + (elf_link_input_bfd): Set all asection->symbol->value's here, and + fudge values for discarded link-once section symbols. + + * elf64-hppa.c: Include alloca-conf.h + +2000-10-11 Alan Modra + + * elf.c (swap_out_syms): Revert 2000-10-07 changes. + + * ieee.c (ieee_make_empty_symbol): Oops, bfd_zalloc needs another arg. + +2000-10-10 Alan Modra + + * ieee.c (ieee_make_empty_symbol): Use bfd_zalloc, not bfd_zmalloc. + +2000-10-10 Tom Rix + + * section.c (bfd_make_section_anyway): Release newsect ptr when + newsect->symbol fails to alloc. Use bfd_release instead of free. + +2000-10-09 Richard Henderson + + * elflink.h (size_dynamic_sections): Don't create various tags if + .dynstr is excluded from the link. Don't set first dynsym entry + if dynsymcount is zero. + (elf_bfd_final_link): Don't try to swap out dynamic syms if + .dynsym excluded from the link. Don't try to write any dynamic + sections excluded from the link. + + * elf.c (swap_out_syms): Handle global section symbols. + +2000-10-05 DJ Delorie + + * peigen.c (_bfd_pei_swap_scnhdr_out): note extended relocs + * coffcode.h (coff_set_alignment_hook): read extended reloc count + (coff_write_relocs): write extended reloc count + (coff_write_object_contents): account for extended relocs + +2000-10-05 Jim Wilson + + * elf-bfd.h (struct elf_backend_data): Add elf_backend_section_flags + field. + * elf.c (_bfd_elf_make_section_from_shdr): Call the + elf_backend_section_flags function. + * elf64-ia64.c (elf64_ia64_section_from_shdr): Delete flag conversion + code. + (elf64_ia64_section_flags): New function containing flag conversion + code. + (elf_backend_section_flags): Define to elf64_ia64_section_flags. + * elfxx-target.h (elf_backend_section_flags): Define. + (elfNN_bed): Initialize elf_backend_section_flags field. + +2000-10-02 Alan Modra + + * elf32-hppa.c (elf32_hppa_check_relocs): Correct call to + _bfd_elf32_gc_record_vtable. Correct a comment. + +2000-10-01 Ulf Carlsson + + From Ralf Baechle + + * elf32-mips.c (_bfd_mips_elf_finish_dynamic_sections): Mark gld + produces binaries with got[1] = 0x80000001 to differenciate them + for the dynamic linker from the broken binaries produced by old + versions. + +2000-09-30 Petr Sorfa + + * elf.c (elfcore_grok_pstatus): Check for size of pxstatus_t. + (elfcore_grok_lwpstatus): Check for size of lwpxstatus_t. + * configure.in: Add check for pxstatus_t and lwpxstatus_t. + * configure: Regenerate. + +2000-09-27 Hans-Peter Nilsson + + Define two bfd_targets for absence and presence of leading + underscore on symbols. Make sure to only link same kind. + * elf32-cris.c (cris_elf_object_p, + cris_elf_final_write_processing, cris_elf_print_private_bfd_data, + cris_elf_merge_private_bfd_data): New. + (elf_backend_object_p, elf_backend_final_write_processing, + bfd_elf32_bfd_print_private_bfd_data, + bfd_elf32_bfd_merge_private_bfd_data): Define. + : Include elf32-target.h twice with + different macro settings: + (TARGET_LITTLE_SYM): First as bfd_elf32_cris_vec, then as + bfd_elf32_us_cris_vec. + (TARGET_LITTLE_NAME): First as "elf32-cris", then "elf32-us-cris". + (elf_symbol_leading_char): First as 0, then '_'. + (INCLUDED_TARGET_FILE): Define for second include of elf32-target.h. + * config.bfd (cris-*-*): Add bfd_elf32_us_cris_vec to targ_selvecs. + * configure.in (bfd_elf32_cris_vec, cris_aout_vec): New vector. + * configure: Regenerate. + * targets.c: Declare bfd_elf32_us_cris_vec. + * po/bfd.pot: Regenerate. + +2000-09-29 Momchil Velikov + + * elf32-arm.h (arm_add_to_rel): Correctly adjust the addend for + R_ARM_THM_PC22 relocations. + +2000-09-29 NIIBE Yutaka + + * elflink.h (elf_link_add_object_symbols): Don't bfd_release runpath. + +2000-09-29 Momchil Velikov + + * elf.c (elf_fake_sections): Do not mark the section SHT_NOBITS if + is has the SEC_HAS_CONTENTS flag set. + +2000-09-28 rjan Friberg + Hans-Peter Nilsson + + * aout-cris.c (N_TXTADDR): Define. + +2000-09-28 John David Anglin + + * som.c: Include alloca-conf.h. + * Makefile.am: "make dep-am" + * Makefile.in: Regenerate. + +2000-09-27 Alan Modra + + * elf32-hppa.c (plt_stub): New. + (PLT_STUB_ENTRY): Define. + (elf32_hppa_link_hash_table): Change multi_subspace to packed + boolean. Add need_plt_stub, has_12bit_branch and has_17bit_branch. + (elf32_hppa_link_hash_table_create): Init to suit. + (elf32_hppa_check_relocs): Set has_12bit_branch and + has_17bit_branch as appropriate. + (elf32_hppa_adjust_dynamic_symbol): Set need_plt_stub for + non-local functions. + (elf32_hppa_size_dynamic_sections): Correct setting of reltext. + Add space for plt_stub as needed. + (elf32_hppa_finish_dynamic_symbol): Point .plt entries for global + functions at plt_stub. + (elf32_hppa_finish_dynamic_sections): Write plt_stub. + (elf32_hppa_create_dynamic_sections): Leave .plt executable. + + * elf32-hppa.h (elf32_hppa_size_stubs): Add group_size param. + * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. Use it instead + of fixed size, and if negative, disable handling of input sections + before stub section. Set up default stub group size depending + on detected branch relocs. + (hppa_build_one_stub): Use lrsel and rrsel for import stubs to + ensure different offsets from sym_value aren't rounded to + different 2k blocks. Use lrsel and rrsel for other stubs too for + consistency rather than necessity. + (elf32_hppa_check_relocs): Handle R_PARISC_DIR14F. + (final_link_relocate): Likewise. + (elf32_hppa_relocate_section): Likewise. + + * elf-hppa.h (elf_hppa_howto_table): Add R_PARISC_DIR14F reloc. + (_bfd_elf_hppa_gen_reloc_type): Generate them. + (elf_hppa_final_link_relocate): Handle them. + (elf_hppa_relocate_insn): Likewise. + (_bfd_elf_hppa_gen_reloc_type): Add missing e_ldsel and e_rdsel cases. + +2000-09-26 Hans-Peter Nilsson + + * elfcode.h (elf_object_p): Preserve and clear abfd section + information. Restore at error. + +2000-09-26 Paul Sokolovsky + + * peigen.c (_bfd_pei_swap_aouthdr_in): If some DataDirectory + is empty, make sure that its rva also 0. NT loader dislikes + having otherwise. + +2000-09-26 Steve Ellcey + + * som.c (som_bfd_derive_misc_symbol_info): Make weak symbols + global by default. + +2000-09-21 Alan Modra + + * elf32-hppa.c (elf32_hppa_check_relocs): Fix weak sym handling in + currently unused RELATIVE_DYNAMIC_RELOCS code. + (hppa_discard_copies): Likewise. + (elf32_hppa_size_stubs): Size `input_list' array correctly. Correct + comments. Don't check non-code output sections for stub grouping. + +2000-09-20 Alan Modra + + * section.c (bfd_get_unique_section_name): Return NULL if + bfd_malloc fails. + +2000-09-19 Michael Sokolov + + * elf32-m68k.c (elf_cpu32_plt0_entry): Change the PLT entry 0 + instruction sequence to actually work. + (elf_m68k_finish_dynamic_sections): Change the patch-in offset + accordingly. + +2000-09-18 Alexandre Oliva + + * elf32-sh.c (sh_elf_relocate_section): Use + _bfd_final_link_relocate to apply the relocation against a section + symbol, when doing relocatable links. + +2000-09-18 Alan Modra + + * elf32-hppa.c (elf32_hppa_stub_hash_entry): Rename input_section + to id_sec. + (stub_hash_newfunc): Here too. + (hppa_add_stub): And here. + (elf32_hppa_link_hash_table): Remove stub_section_created, + reloc_section_created, first_init_sec and first_fini_sec. Add + stub_group. + (elf32_hppa_link_hash_table_create): Init to suit. + (hppa_get_stub_entry): Add support for grouping stub sections. + (hppa_add_stub): Likewise. Remove sec_count param and init/fini + section code. Index stub vars by section->id. + (elf32_hppa_size_stubs): Likewise. Remove duplicated function + exit paths. Zap allocation of above removed vars. Refine + link-once test. + + * elf32-hppa.h (elf32_hppa_size_stubs): Add output_bfd param. + * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. + (hppa_get_stub_entry): Pass in pointer to elf32_hppa_link_hash_table + rather than pointer to bfd_link_info. + (hppa_add_stub): Likewise. + (final_link_relocate): Likewise. + +2000-09-17 David Huggins-Daines + + (elf32_hppa_size_stubs): Don't try to build stubs for discarded + link-once sections. + +2000-09-16 Alexandre Oliva + + * elf32-sh.c (ELF_MAXPAGESIZE): Define to 128, to match + ld/emulparams/shelf.sh. + +2000-09-10 Michael Sokolov + + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): New function. + * bfd-in.h (bfd_m68k_elf32_create_embedded_relocs): Add declaration. + * bfd-in2.h: Regenerate. + +2000-09-15 Kenneth Block + + * elf64-alpha.c (elf64_alpha_relax_with_lituse): ld performs + LITUSE relocations incorrectly if -relax is specified on the ld + command line and the displacement field of the load or store + instruction is non-zero. (Patch by paul.winalski@compaq.com) + +2000-09-15 Alan Modra + + * elf32-hppa.c (hppa_add_stub): Dont set first_init_sec and + first_fini_sec here. + (elf32_hppa_size_stubs): Instead correctly find the first .init + and .fini section here. + +2000-09-15 David Huggins-Daines + + * elf32-hppa.c (clobber_millicode_symbols): New function. + (elf32_hppa_size_dynamic_sections): Call it. + +2000-09-14 Alan Modra + + * elf32-hppa.c (elf32_hppa_link_hash_entry): Make pic_call + packed. Add plabel, plt_abs packed booleans. + (hppa_link_hash_newfunc): Init new fields. + (PLABEL_PLT_ENTRY_SIZE): Define. + (hppa_stub_name): Use size_t len vars. + (hppa_add_stub): Likewise. + (elf32_hppa_build_stubs): Likewise. + (hppa_build_one_stub): Kill some compiler warnings. + (elf32_hppa_check_relocs): Always generate a plt entry for PLABELs + if dynamic linking. Munge the local plt offsets into + local_got_refcounts. Set h->plabel for all global PLABELs. Use + size_t len vars. Add assert for plabel addend. + (elf32_hppa_gc_sweep_hook): Sweep local plt entries too. + (elf32_hppa_hide_symbol): New function. + (elf_backend_hide_symbol): Define. + (elf32_hppa_adjust_dynamic_symbol): Don't throw away plt entries + with h->plabel set. Don't make plt entries to have dynamic syms + when they have been forced local. If plt entry is used by a + plabel, make it PLABEL_PLT_ENTRY_SIZE. + (elf32_hppa_size_dynamic_sections): Set plt_abs for init fns. + Set up .plt offsets for local syms. + (elf32_hppa_relocate_section): Initialise plt entries for local + syms. Leave weak undefined plabels zero. Make global plabel + relocs against function symbol, and leave the addend zero. + Use *ABS* DIR32 relocs instead of SEGREL32 for dynamic got relocs. + (elf32_hppa_finish_dynamic_symbol): Set up IPLT relocs for + non-dynamic syms. Init extra plt for plabels. Use *ABS* DIR32 + relocs instead of SEGREL32 for dynamic got relocs. + (elf32_hppa_finish_dynamic_sections): Reserve one more .got entry. + (elf_backend_got_header_size): Adjust. + (elf32_hppa_set_gp): Calculate an "ideal" LTP. + + * elf32-hppa.c (LONG_BRANCH_VIA_PLT): Define. + (hppa_type_of_stub): Use it instead of #if 0 + (hppa_discard_copies): Use it here too. + (elf32_hppa_size_dynamic_sections): And here. + + * elf32-hppa.c (elf32_hppa_link_hash_table): Remove `offset' field. + (elf32_hppa_link_hash_table_create): And here. + (hppa_build_one_stub): And here. Instead keep track of stub + offset using _raw_size. + (elf32_hppa_size_stubs): Likewise. + (elf32_hppa_build_stubs): Likewise. + (hppa_size_one_stub): Likewise. Resize reloc section too. + + * elf32-hppa.c (hppa_add_stub): Correct first_init_sec and + first_fini_sec handling. Don't search for reloc section or set + hplink->reloc_section_created here. + (elf32_hppa_size_stubs): Instead search for reloc sections, and + set reloc_section_created here. + (hppa_handle_PIC_calls): Set ELF_LINK_HASH_NEEDS_PLT. + (elf32_hppa_size_dynamic_sections): Make a .plt entry for DT_INIT + and DT_FINI. + (elf32_hppa_finish_dynamic_sections): Set DT_INIT and DT_FINI. + + * elf32-hppa.c (hppa_build_one_stub): Replace `elf_hash_table (info)' + with `hplink->root.'. + (elf32_hppa_check_relocs): Likewise. + (elf32_hppa_gc_sweep_hook): Likewise. + (elf32_hppa_adjust_dynamic_symbol): Likewise. + (hppa_handle_PIC_calls): Likewise. + (elf32_hppa_size_dynamic_sections): Likewise. + (elf32_hppa_set_gp): Likewise. + (elf32_hppa_relocate_section): Likewise. + (elf32_hppa_finish_dynamic_symbol): Likewise. + (elf32_hppa_finish_dynamic_sections): Likewise. + + From David Huggins-Daines + * elf32-hppa.c (hppa_type_of_stub): Generate import stubs for + defined weak symbols in shared links. + (final_link_relocate): Calls to defined weak symbols in shared + objects must go via import stubs, as the target might not be known + at link time. + +2000-09-14 Alexandre Oliva + + * elf32-sh.c (sh_elf_howto_table): Moved R_SH_GOT32, R_SH_PLT32, + R_SH_COPY, R_SH_GLOB_DAT, R_SH_JMP_SLOT, R_SH_RELATIVE, + R_SH_GOTOFF, R_SH_GOTPC) to the range from 160 to 167. Replaced + the original entries with EMPTY_HOWTOs, and added new ones to fill + in the gap. + (sh_elf_info_to_howto): Make sure the new gap isn't used. + (sh_elf_relocate_section): Likewise. + +2000-09-13 Anders Norlander + + * cpu-mips.c (arch_info_struct): Add mips:4K + * bfd-in2.h (bfd_mach_mips4K): New define. + * archures.c: Add bfd_mach_mips4K to comment. + * elf32-mips.c (_bfd_mips_elf_final_write_processing): Return + E_MIPS_ARCH_2 for bfd_mach_mips4K. + +2000-09-13 Marco Franzen + + * som.c (som_write_symbol_strings): Do not used fixed buffers, + use size_t as a counter. + (som_write_space_strings): Similarly. + +2000-09-12 Jason Eckhardt + + * elf32-i860.c (elf32_i860_relocate_pc26): New function + and prototype. + (elf32_i860_relocate_section): Invoke new function from here. + +2000-09-11 Michael Sokolov + + * elf.c (_bfd_elf_make_section_from_shdr): Make debug_sec_names + static. + +2000-09-10 Michael Sokolov + + * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): Emit 8 NULs for + target section name instead of dumping core when the target symbol is + undefined. + +2000-09-09 Kazu Hirata + + * riscix.c: Remove DEFUN. + +2000-09-08 Nick Clifton + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Do not + initialise flags in output bfd if the input bfd is the default + architecture with the default flags. + +2000-09-08 Kazu Hirata + + * archive.c: Fix formatting. + * coff-arm.c: Likewise. + * doc/chew.c: Likewise. + +2000-09-08 Alan Modra + + * section.c (bfd_get_unique_section_name): Put a dot before the + numeric suffix. + +2000-09-07 Kazu Hirata + + * doc/chew.c: Remove all uses of DEFUN and DEFUN_VOID. + * elf.c: Fix formatting. + +2000-09-07 Alexandre Oliva + + * config.bfd (sh-*-linux*): Added. + * configure.in (bfd_elf32_shlin_vec, bfd_elf32_shblin_vec): New. + * targets.c: Declare them. + * elf32-sh-lin.c: New file. + * Makefile.am: Compile it. + * elf32-sh.c: Don't override defines from elf32-sh-lin.c. + * configure, Makefile.in: Rebuilt. + +2000-09-06 Geoffrey Keating + + * xcofflink.c (xcoff_link_input_bfd): Include the .tocbss + pseduo-section when determining where the TOC ends. + + * coff-rs6000.c (_bfd_xcoff_swap_aux_out): Use bfd_h_put_16 to + output x_tvndx as it is only two bytes wide. + + * coff-rs6000.c (xcoff_howto_table): A modifiable branch-absolute + reloc is 26 or 32 bits wide. + + * coff-rs6000.c (_bfd_xcoff_rtype2howto): The bitsize is irrelevant + for relocs that don't change anything. Also look at the full + 6 bits of bitsize. + +2000-09-06 Philip Blundell + + * config.bfd (arm*-*-uclinux*): New target. + +2000-09-06 Alexandre Oliva + + * configure: Rebuilt with new libtool.m4. + +2000-09-06 Alan Modra + + * section.c (bfd_get_unique_section_name): Avoid c++ reserved + word for variable name. + * bfd-in2.h: Regenerate. + +2000-09-05 Nick Clifton + + * config.in: Regenerate. + * libbfd.h: Regenerate. + * po/bfd.pot: Regenerate. + * doc/bfdint.texi: Remove CVS date string - it foils compares with + local versions. + +2000-09-05 Steven Johnson + + * cpu-powerpc.c (arch_info_struct): Added MPC860 Family entry. + +2000-09-05 Alan Modra + + Shared library and PIC support. + * elf32-hppa.c (PLT_ENTRY_SIZE): New. + (GOT_ENTRY_SIZE): New. + (ELF_DYNAMIC_INTERPRETER): New. + (STUB_SUFFIX): Define. + (LONG_BRANCH_PIC_IN_SHLIB): Define. + (RELATIVE_DYNAMIC_RELOCS): Define. + (enum elf32_hppa_stub_type): New. + (struct elf32_hppa_stub_hash_entry): Rename offset to + stub_offset. Add a number of new fields. + (struct elf32_hppa_link_hash_entry): New. + (struct elf32_hppa_link_hash_table): Add numerous fields. Remove + global_value. + (elf32_hppa_hash_table): Rename to hppa_link_hash_table. + (elf32_hppa_stub_hash_lookup): Rename to hppa_stub_hash_lookup. + (elf32_hppa_stub_hash_newfunc): Rename to stub_hash_newfunc. Init + new fields. + (hppa_link_hash_newfunc): New function. + (elf32_hppa_link_hash_table_create): Use above function. Init new + fields. + (elf32_hppa_stub_name): Rename to hppa_stub_name. Pass in reloc + instead of addend, and remove sym_name from args. Don't use + symbol name for local syms, instead use sym index. + (elf32_hppa_size_of_stub): Rename to hppa_type_of_stub, and return + stub type rather than size. Pass in hash and handle import stub + case. Also pass in reloc instead of offset so we can calculate + PCREL22F and PCREL12F branches properly. + (elf32_hppa_build_one_stub): Rename to hppa_build_one_stub. Build + import and export stubs too. + (elf32_hppa_size_one_stub): Rename to hppa_size_one_stub. Handle + import and export stub sizing. + (elf32_hppa_check_relocs): New function. + (elf32_hppa_adjust_dynamic_symbol): New function. + (hppa_discard_copies): New function. + (elf32_hppa_size_dynamic_sections): New function. + (elf_backend_size_dynamic_sections): Define. + (elf32_hppa_finish_dynamic_symbol): New function. + (elf_backend_finish_dynamic_symbol): Define. + (elf32_hppa_size_stubs): Stash params in link hash table, and move + some local vars into the link hash table too. For shared links, + trundle over function syms, generating export stubs. Handle + PCREL22F branches. Break out stub creation code from here.. + (hppa_add_stub): .. to here. New function. + (elf32_hppa_final_link): Rename to elf32_hppa_set_gp, and don't + call the bfd linker. Use elf_gp to record global pointer. + Calculate a value from sections if $global$ is missing. + (bfd_elf32_bfd_final_link): Define as _bfd_elf32_gc_common_final_link. + (elf32_hppa_gc_mark_hook): New function. + (elf_backend_gc_mark_hook): Define. + (elf32_hppa_gc_sweep_hook): New function. + (elf_backend_gc_sweep_hook): Define. + (elf32_hppa_bfd_final_link_relocate): Rename to final_link_relocate. + Add rel to args, and remove howto, input_bfd, offset, addend, + sym_name as we can recalculate these locally. Handle calls to + dynamic objects, extra PIC relocs, PCREL22F branches. Change + handling of undefined weak syms. Check that stubs are in range. + Only look for import stubs on PCREL17F and PCREL22F relocs. Add + message on hitting a DPREL21L reloc that needs fixing. Subtract + off PC for PCREL14F. Break out code that does a stub lookup from + here.. + (hppa_get_stub_entry): ..to here. New function. + (elf32_hppa_relocate_insn): Merge into final_link_relocate. + (elf32_hppa_relocate_section): Handle got and plt relocs, dynamic + relocs, etc. etc. + (elf32_hppa_finish_dynamic_sections): New function. + (elf_backend_finish_dynamic_sections): Define. + (elf_backend_final_write_processing) Define. + (hppa_handle_PIC_calls): New function. + (elf32_hppa_build_stubs): Call it. Pass link_info to + hppa_build_one_stub. + (elf32_hppa_create_dynamic_sections): New function + to create .plt and .got then set .plt flags correctly. + (elf_backend_create_dynamic_sections): Define. + (elf32_hppa_object_p): New function. + (elf_backend_object_p): Define. + (elf32_hppa_elf_get_symbol_type): New function. + (elf_backend_get_symbol_type): Define. + (elf_backend_can_gc_sections): Define. + (elf_backend_want_got_plt): Define. + (elf_backend_plt_alignment): Set to 2. + (elf_backend_plt_readonly): Define. + (elf_backend_want_plt_sym): Define. + (elf_backend_got_header_size): Reserve one entry. + + * elf32-hppa.h (elf32_hppa_build_stubs): Don't pass stub bfd. + (elf32_hppa_size_stubs): Pass in multi_subspace. + (elf32_hppa_set_gp): Declare. + + * section.c (SEC_HAS_GOT_REF): Define new flag for asection. + (bfd_get_unique_section_name): New function. + * bfd-in2.h: Regenerate. + + * elf64-hppa.c (elf64_hppa_check_relocs): Handle R_PARISC_PCREL12F. + (elf64_hppa_size_dynamic_sections): Remove the FIXME at bfd_zalloc + comment. + + From David Huggins-Daines + * elf64-hppa.c (elf64_hppa_check_relocs): Fix a warning. + (elf64_hppa_mark_exported_functions): Set dyn_h->st_shndx. + (elf64_hppa_link_output_symbol_hook): Test dyn_h->st_shndx has + been updated in finish_dynamic_symbol before modifying function + symbol. + + * elf-hppa.h (elf_hppa_howto_table): Restructure into groups of + eight entries. Replace NULL with bfd_elf_generic_reloc. Add + R_PARISC_GNU_VTENTRY, R_PARISC_GNU_VTINHERIT and R_PARISC_PCREL12F. + (_bfd_elf_hppa_gen_reloc_type): Handle R_PARISC_GNU_VT*. Add some + comments. Handle format == 12 for R_HPPA_PCREL_CALL. + (elf_hppa_final_link_relocate): Handle R_PARISC_PCREL12F. + (elf_hppa_relocate_insn): Likewise. Reformat some comments. + (elf_hppa_final_write_processing): Expose it for ARCH_SIZE == 32. + + From David Huggins-Daines + * elf-hppa.h (elf_hppa_is_local_label_name): Accept the SysV/ELF + style of local labels as well. + +2000-09-03 Philip Blundell + + * elf32-arm.h (elf32_arm_relocate_section): Don't try to relocate + references to undefined symbols in debugging sections. + +2000-09-02 H.J. Lu + + * reloc.c (BFD_RELOC_SH_COPY, BFD_RELOC_SH_GLOB_DAT, + BFD_RELOC_SH_JMP_SLOT, BFD_RELOC_SH_RELATIVE, + BFD_RELOC_SH_GOTPC): Move them from the MIPS section to the SH + section. + +2000-09-02 Jason Eckhardt + + * elf32-i860.c (bfd_elf32_bfd_is_local_label_name): Define macro. + (elf32_i860_is_local_label_name): New function and prototype. + +2000-09-02 Nick Clifton + + * configure.in: Increase version number to 2.10.91. + * configure: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * po/bfd.pot: Regenerate. + +2000-09-02 Daniel Berlin + + * elf.c (_bfd_elf_make_section_from_shdr): Add + .gnu.linkobce.wi. to the list of debug section names. + +2000-09-02 Nick Clifton + + * dwarf2.c (find_debug_info): New function: Locate a section + containing dwarf2 debug information. + (bfd_dwarf2_find_nearest_line): Find all sections containing + debug information and include them in the stash. + +2000-09-01 Niibe Yutaka , Kaz Kojima , Alexandre Oliva + + * elf32-sh.c (R_SH_GOT32, R_SH_PLT32, R_SH_COPY, R_SH_GLOB_DAT, + R_SH_JMP_SLOT, R_SH_RELATIVE, R_SH_GOTOFF, R_SH_GOTPC): New. + (sh_reloc_map): Add new relocs. + (sh_elf_check_relocs, sh_elf_link_hash_newfunc, + sh_elf_link_hash_table_create, sh_elf_adjust_dynamic_symbol, + sh_elf_size_dynamic_sections, sh_elf_finish_dynamic_symbol, + sh_elf_finishe_dynamic_sections, sh_elf_discard_copies): New + functions. + (ELF_DYNAMIC_INTERPRETER, PLT_ENTRY_SIZE): Define. + (elf_sh_plt0_entry_be, elf_sh_plt0_entry_le, + elf_sh_plt_entry_be, elf_sh_plt_entry_le, + elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le): + New array constants. + (elf_sh_plt0_entry, elf_sh_plt_entry, elf_sh_pic_plt_entry): + New variables. + (elf_sh_sizeof_plt, elf_sh_plt_plt0_offset, + elf_sh_plt0_linker_offset, elf_sh_plt0_gotid_offset, + elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset, + elf_sh_plt_reloc_offset): Define. + (elf_sh_pcrel_relocs_copied, elf_sh_link_hash_entry, + elf_sh_link_hash_table): New structs. + (sh_elf_link_hash_traverse, sh_elf_hash_table): New macros. + (sh_elf_relocate_section, sh_elf_check_relocs): Handle new + relocation types. + (elf_backend_create_dynamic_sections, + bfd_elf32_bfd_link_hash_table_create, + elf_backend_adjust_dynamic_symbol, + elf_backend_size_dynamic_sections, + elf_backend_finish_dynamic_symbol, + elf_backend_finish_dynamic_sections, elf_backend_want_got_plt, + elf_backend_plt_readonly, elf_backend_want_plt_sym, + elf_backend_got_header_size, elf_backend_plt_header_size): + Define. + * reloc.c (BFD_RELOC_SH_COPY, BFD_RELOC_SH_GLOB_DAT, + BFD_RELOC_SH_JMP_SLOT, BFD_RELOC_SH_RELATIVE, BFD_RELOC_SH_GOTPC): + New relocs. + * bfd-in2.h, libbfd.h: Rebuilt. + +2000-09-01 Alan Modra + + * elf32-i386.c (elf_i386_finish_dynamic_symbol): Revert 2000-08-27 + change. + +2000-08-31 J"orn Rennecke + + * elf32-sh.c (sh_elf_merge_private_data): If ibfd's elf header flags + not initialized, set them to indicate the SH1 instruction set. + +2000-08-31 Alexandre Oliva + + * acinclude.m4: Include libtool and gettext macros from the + top level. + * aclocal.m4, configure: Rebuilt. + +2000-08-29 Michael Snyder + + * elf.c: Eliminate references to __sparcv9 macro; replace with + autoconf variables HAVE_PSINFO32_T etc. + * configure.in: Auto-configure HAVE_PSINFO_32_T, HAVE_PRPSINFO32_T, + HAVE_PSTATUS32_T, HAVE_PRSTATUS32_T, HAVE_PRSTATUS32_T_PR_WHO. + * config.in: Ditto. + * acinclude.m4 (BFD_HAVE_SYS_PROCFS_TYPE) define _SYSCALL32 so it can + detect the above typedefs. (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Ditto. + * aclocal.m4: Ditto. + * configure: Regenerate. + +2000-08-27 Alan Modra + + * elf32-i386.c (elf_i386_check_relocs): Keep info on relocs copied + for any shared link, not just shared -Bsymbolic. + (elf_i386_size_dynamic_sections): Call elf_i386_discard_copies on + any shared link, and pass link info to it. + (elf_i386_size_dynamic_sections): Update comment. + (elf_i386_discard_copies): Modify to discard relocs for symbols + that have been forced local. + (elf_i386_finish_dynamic_symbol): Don't copy relocs for symbols + that have been forced local. + +2000-08-24 Denis Chertykov & Nick Clifton + + * elflink.h (elf_link_add_object_symbols): Allow common + symbols to have an alignment of 1 if explicitly requested, and + not overridden by other definitions. + +2000-08-22 Doug Kwan + + * coff-w65.c (CREATE_LITTLE_COFF_TARGET): Fix typo. + * coffcode.h (coff_set_flags): Add detection of w65 architecture. + +2000-08-22 H.J. Lu + + * elf-bfd.h (elf_link_hash_table): Add runpath. + + * bfd-in.h (bfd_elf_get_runpath_list): New prototype. + * bfd-in2.h: Rebuilt. + + * elf.c (_bfd_elf_link_hash_table_init): Initialize the + "runpath" field to NULL. + (bfd_elf_get_runpath_list): New function. + + * elflink.h (elf_link_add_object_symbols): Record DT_RPATH and + DT_RUNPATH entries. + +2000-08-22 Alexandre Oliva + + * elf32-sh.c (sh_elf_relocate_section) [R_SH_IND12W, + R_SH_DIR8WPN, R_SH_DIR8WPZ, R_SH_DIR8WPL]: Handle them + explicitly. Improve validation of r_type. + +2000-08-21 H.J. Lu + + * elf32-i386.c (elf_i386_size_dynamic_sections): Zero out the + dynamic allocated content space. Add a comment to remind us that + one day this ought to be fixed. + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. + * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. + +2000-08-21 Jason Eckhardt + + * elf32-i860.c (elf32_i860_relocate_pc16): Just write the immediate + field with the newly relocated value instead of adding it to the + existing immediate field. + (elf32_i860_relocate_splitn): Likewise. + (elf32_i860_relocate_highadj): Likewise. + +2000-08-16 Jason Eckhardt + + * elf32-i860.c (elf32_i860_relocate_pc16): Implemented function (it + was previously just a stub). + +2000-08-16 Alexandre Oliva + + * elflink.c (_bfd_elf_create_got_section): Don't abort(). + Formatting fixes. + (_bfd_elf_create_dynamic_sections): Likewise. + +2000-08-16 Andrew Macleod + + * elf64-sparc.c (sparc64_elf_relocate_section): Set relocation address + for undefined symbols to be the beginning of the section. + + * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Don't allocate + four extra entries at the beginning of the .rela.plt section. + (sparc64_elf_finish_dynamic_symbol): Adjust the offset in the .rela.plt + section to account for the four reserved entries in the .plt section. + +2000-08-15 Geoffrey Keating + + * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Add ori r0,r0,0 + to the list of NOPs we recognize after a branch-and-link. + Use the ori NOP when one is needed. + + * coff-rs6000.c (_bfd_xcoff_slurp_armap): Finish implementation + for large archives. + +2000-08-14 Jim Wilson + + * elf64-ia64.c (elf64_ia64_merge_private_bfd_data): Handle + EF_IA_64_REDUCEDFP, EF_IA_64_CONS_GP, and EF_IA_64_NOFUNCDESC_CONS_GP. + (elf64_ia64_print_private_bfd_data): Likewise. Also handle + EF_IA_64_ABSOLUTE. + +2000-08-11 Alexandre Oliva + + * elf32-sh.c (sh_elf_set_mach_from_flags): Make it static. + +2000-08-10 Jason Eckhardt + + * elf32-i860.c (elf32_i860_relocate_section): New function. + (i860_final_link_relocate): New function. + (elf32_i860_relocate_splitn): New function. + (elf32_i860_relocate_pc16): New function. + (elf32_i860_relocate_highadj): New function. + (elf32_i860_howto): Minor adjustments to some relocations. + (elf_info_to_howto_rel): Define. + (elf_backend_relocate_section): Define. + +2000-08-10 Nick Clifton + + * elf32-arm.h: Fix formatting. + +2000-08-10 Bernd Schmidt + + * elf32-sh.c (sh_elf_reloc_loop): Make LAST_SYMBOL_SECTION static. + +2000-08-08 Jason Eckhardt + + * elf32-i860.c (elf32_i860_howto_table): Updated some fields. + +2000-08-07 Kazu Hirata + + * ieee.c (ieee_write_debug_part): Rewrite a comment. + * elf64-ia64.c: Fix a typo. + +2000-08-05 Jason Eckhardt + + * elf32-i860.c (elf32_i860_howto_table): New structure. + (lookup_howto): New function. + (elf32_i860_reloc_type_lookup): New function. + (elf32_i860_info_to_howto_rela): New function. + (elf_code_to_howto_index): New structure. + (elf_info_to_howto): Re-define as elf32_i860_info_to_howto_rela. + (bfd_elf32_bfd_reloc_type_lookup): Re-define as + elf32_i860_reloc_type_lookup. + +2000-08-04 Rodney Brown + + * som.c (struct fixup_format): Constify `format'. + (som_hppa_howto_table): Use SOM_HOWTO macro. + (try_prev_fixup, hppa_som_reloc): Decorate unused parameter. + (som_bfd_reloc_type_lookup): Likewise. + (compare_subspaces): Remove unused `count1', `count2'. + (som_begin_writing): Remove unused `total_reloc_size'. + (som_bfd_derive_misc_symbol_info): Decorate unused parameter. + (som_print_symbol, som_bfd_is_local_label_name): Likewise. + (som_set_reloc_info): Constify `cp'. Remove unused `addend'. + (som_find_nearest_line): Decorate unused parameter(s). + (som_sizeof_headers, som_get_symbol_info, som_write_armap): Likewise. + (som_bfd_link_split_section): Likewise. + +2000-08-03 Nick Clifton + + * section.c: Restore backed out code. + * elf.c: Restore backed out code. + (copy_private_bfd_data): Fix bug preventing stipped dynamic + binaries from working. + * bfd-in2.h: Regenerate. + +2000-08-03 H.J. Lu + + * section.c: Back out the change made by Nick Clifton + on 2000-07-31. It breaks stripping dynamic + binaries. + * bfd-in2.h: Likewise. + * elf.c: Likewise. + +2000-08-03 Alexandre Oliva + + * elf32-sh.c (sh_elf_reloc_loop): Warning removal. + +2000-07-31 Jason Eckhardt + + * reloc.c (BFD_RELOC_860_*): New bfd relocs for i860. + * bfd-in2.h, libbfd.h: Regenerate. + +2000-07-31 Nick Clifton + + * section.c (struct sec): Add new boolean field 'segment_mark'. + (STD_SECTION): Initialise new field to zero. + + * bfd-in2.h: Regenerate. + + * elf.c (copy_private_bfd_data): Reorganise section to segment + mapping to cope with moved sections requiring new segments, + and overlapping segments. + (SEGMENT_END): New macro: Return the end address of a segment. + (IS_CONTAINED_BY_VMA): New macro: Determine if a segment + contains a section by comparing their VMA addresses. + (IS_CONTAINED_BY_LMA): New macro: Determine if a segment + contains a section by comparing their LMA addresses. + (INCLUDE_SECTION_IN_SEGMENT): New macro: Determine if a + section should be included in a segment. + (SEGMENT_AFTER_SEGMENT): New macro: Determine if one segment + follows another in memory. + (SEGMENT_OVERLAPS_SEGMENT): New macro: Determine if two + segments overlap. + +2000-07-22 Jason Eckhardt + + * cpu-i860.c: Added comments. + + * elf32-i860.c (TARGET_LITTLE_SYM): Defined to + bfd_elf32_i860_little_vec. + (TARGET_LITTLE_NAME): Defined to "elf32-i860-little". + (ELF_MAXPAGESIZE): Changed to 4096. + + * targets.c (bfd_elf32_i860_little_vec): Declaration of + new target. + (bfd_target_vector): Added bfd_elf32_i860_little_vec. + + * config.bfd (i860-stardent-sysv4*, i860-stardent-elf*): Added + config for little endian elf32 i860. + (targ_defvec): Define for the new config above + as "bfd_elf32_i860_little_vec". + (targ_selvecs): Define for the new config above + as "bfd_elf32_i860_vec bfd_elf32_i860_little_vec" + + * configure.in (bfd_elf32_i860_little_vec): Added recognition + of new target vec. + + * configure: Regenerated. + +2000-07-27 H.J. Lu + + * elflink.h (elf_merge_symbol): Take one more argument, + dt_needed, to indicate if the symbol comes from a DT_NEEDED + entry. Don't overide the existing weak definition if dt_needed + is true. + (elf_link_add_object_symbols): Pass dt_needed to + elf_merge_symbol (). + +2000-07-27 Nick Clifton + + * elflink.h (elf_link_size_reloc_section): Zeroes the section's + allocated contents. + +2000-07-25 Geoffrey Keating + + * configure.host (*-*-aix*): AIX has 'long long' always. + + * coff-rs6000.c (xcoff_write_one_armap_big): New procedure. + (xcoff_write_armap_big): Write both 32-bit and 64-bit armaps. + (xcoff_write_archive_contents_big): Don't update the offset + of the symbol table, xcoff_write_armap will do it. + +2000-07-23 Ulf Carlsson + + * elf32-mips.c (_bfd_mips_elf_check_relocs): Use abfd instead + of dynobj for SGI_COMPAT checks. + +2000-07-21 Michael Sokolov + + * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): New function. + * bfd-in.h (bfd_m68k_coff_create_embedded_relocs): Add declaration. + * bfd-in2.h: Regenerate. + +2000-07-21 Nick Clifton + + * elf32-mips.c (_bfd_mips_elf_check_relocs): Detect out of + range symbol indices in relocs and issue an error message. + +2000-07-20 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Don't check + info->new_dtags when setting DT_FLAGS_1. It will only be set + by the new linker options. It shouldn't break anything. + +2000-07-20 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set DT_FLAGS_1 + only if info->new_dtags is true. + +2000-07-20 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set + DT_RUNPATH and DT_FLAGS only if info->new_dtags is true. + +2000-07-20 Hans-Peter Nilsson + + * Makefile.am (ALL_MACHINES): Add cpu-cris.lo. + (ALL_MACHINES_CFILES): Add cpu-cris.c. + (BFD32_BACKENDS): Add aout-cris.lo and elf32-cris.lo. + (BFD32_BACKENDS_CFILES): Add aout-cris.c and elf32-cris.c. + (cpu-cris.lo, aout-cris.lo, elf32-cris.lo): New rules. + * Makefile.in: Rebuild. + * aclocal.m4: Rebuild. + * aoutx.h (NAME(aout,machine_type)): Add case for bfd_arch_cris. + * archures.c (enum bfd_architecture): Add bfd_arch_cris. + (bfd_cris_arch): Declare. + (bfd_archures_list): Add bfd_cris_arch. + * bfd-in2.h: Rebuild. + * config.bfd: (cris-*-*): New target. + * configure.in (bfd_elf32_cris_vec, cris_aout_vec): New vectors. + * configure: Rebuild. + * elf.c (prep_headers): Add bfd_arch_cris. + * libbfd.h: Rebuild. + * libaout.h (enum machine_type): Add M_CRIS. + * reloc.c: Add CRIS relocations. + * targets.c (bfd_elf32_cris_vec, cris_aout_vec): Declare. + (bfd_target_vect): Add bfd_elf32_cris_vec and cris_aout_vec. + * cpu-cris.c, aout-cris.c, elf32-cris.c: New files. + * po/POTFILES.in, po/bfd.pot: Regenerate. + +2000-07-19 H.J. Lu + + * elf32-arm.h (elf32_arm_size_dynamic_sections): Also set + DF_TEXTREL if DT_TEXTREL is set. + * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise. + * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise. + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. + * elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): Likewise. + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise. + * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. + * elf64-ia64.c (elf64_ia64_size_dynamic_sections): Likewise. + * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise. + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Also + set DF_SYMBOLIC for symbolic link. Also set DT_RUNPATH if + DT_RPATH is set. + Set the DT_FLAGS and DT_FLAGS_1 entries if necessary. + +2000-07-19 H.J. Lu + + * bfd-in.h (bfd_elf_set_dt_needed_soname): New. + * bfd-in2.h: Rebuild. + + * elf-bfd.h (elf_obj_tdata): Add dt_soname. + (elf_dt_soname): New. + + * elf.c (bfd_elf_set_dt_needed_soname): New. + + * elflink.h (elf_link_add_object_symbols): Add the DT_NEEDED + entry if the shared object loaded by DT_NEEDED is used to + resolve the reference in a regular object. + +2000-07-19 H.J. Lu + + * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_CONFIG, + DT_DEPAUDIT and DT_AUDIT as strings. + +2000-07-19 Nick Clifton + + * format.c: Fix formatting. + +2000-07-19 H.J. Lu + + * elf.c (_bfd_elf_print_private_bfd_data): Fix DT_CHECKSUM. + +2000-07-19 H.J. Lu + + * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_BIND_NOW, + DT_INIT_ARRAY, DT_FINI_ARRAY, DT_INIT_ARRAYSZ, DT_FINI_ARRAYSZ, + DT_RUNPATH, DT_FLAGS, DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ, + DT_PLTPADSZ, DT_MOVEENT, DT_MOVESZ, DT_FEATURE, DT_POSFLAG_1, + DT_SYMINSZ, DT_SYMINENT, DT_CONFIG, DT_DEPAUDIT, DT_AUDIT, + DT_PLTPAD, DT_MOVETAB, DT_SYMINFO, DT_RELACOUNT, DT_RELCOUNT, + DT_FLAGS_1, DT_USED and DT_CHECKSUM. + +2000-07-18 Andrew Cagney + + * elf.c (bfd_elf_get_sign_extend_vma, bfd_elf_get_arch_size): Move + renamed functions from here... + (assign_section_numbers): Use renamed functions. + (prep_headers): Use renamed functions. + + * bfd.c (bfd_get_sign_extend_vma, bfd_get_arch_size): ...To here. + * bfd-in.h (bfd_get_sign_extend_vma, bfd_get_arch_size): Update. + * bfd-in2.h: Regenerate. + +2000-07-18 Ulf Carlsson + + * elf32-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Add + parenthesis in if statement. + +2000-07-17 Koundinya K + + Enable the support for Traditional MIPS. + * elf32-mips.c (IRIX_COMPAT): Recognize bfd_elf32_tradbigmips_vecand + return ict_none appropriately for traditional mips targets. + (STUB_LW): Change 0x8f998000 to 0x8f998010 for traditional mips. + (STUB_MOVE): Conditionalize for traditonal mips. + (STUB_LI16): Likewise. + (_bfd_mips_elf_modify_segment_map): Conditionalize to avoid making + room for RTPROC header. + (_bfd_mips_elf_modify_segment_map): For a normal mips executable set + the permission for the PT_DYNAMIC as read, write and execute. + (mips_elf_calculate_relocation): Check for the symbol _DYNAMIC_LINKING + for traditonal mips. + (_bfd_mips_elf_create_dynamic_sections): Add the symbol + _DYNAMIC_LINKING for traditonal mips. + (_bfd_mips_elf_create_dynamic_sections): Add the symbol __RLD_MAP + in case of traditonal mips. + (_bfd_mips_elf_adjust_dynamic_symbol): Create a stub only if a PLT + entry is required. For a function if PLT is not required then set the + corresponding hash table entry to 0. + (_bfd_mips_elf_size_dynamic_sections): Add DT_DEBUG entry for + traditonal mips. + (_bfd_mips_elf_finish_dynamic_symbol): for a undefined symbol in a + shared object set the value to 0. + (_bfd_mips_elf_finish_dynamic_symbol): Check for the symbol + _DYNAMIC_LINKING for traditonal mips. + (_bfd_mips_elf_finish_dynamic_symbol): Check for the symbol __RLD_MAP + for traditonal mips. + +2000-07-15 H.J. Lu + + * aoutx.h (translate_to_native_sym_flags): Handle BSF_LOCAL. + +2000-07-12 Charles Wilson + + * libbfd.c (bfd_seek): fix 'seek beyond EOF' error when writing + out a structure that is BFD_IN_MEMORY. + +2000-07-11 Alan Modra + + * elf64-hppa.c (get_dyn_name): Pass in section pointer instead of + bfd pointer. Print section id instead of bfd pointer for local + syms. Prefix addend with `+' for global syms as well as local. + Correct calculation of name component lengths. + (elf64_hppa_check_relocs): Update call to get_dyn_name. + + From David Huggins-Daines + * elf-hppa.h (elf_hppa_relocate_section): Update calls here too. + * elf64-hppa.c (elf64_hppa_check_relocs): Fix some warnings. + (elf64_hppa_modify_segment_map): Likewise. + +2000-07-11 Andrew Cagney + + * elf.c (bfd_elf_get_sign_extend_vma): Return tendency of VMA + addresses to be "naturally" sign extended. Return -1 if unknown. + * bfd-in.h (bfd_elf_get_sign_extend_vma): Add declaration. + * bfd-in2.h: Regenerate. + +2000-07-11 Andrew Cagney + + * ecoffswap.h (ecoff_get_off, ecoff_put_off): Add ECOFF_SIGNED_32 + and ECOF_SIGNED_64 to list ways to extract an offset. + (ecoff_swap_fdr_in, ecoff_swap_fdr_out, ecoff_swap_pdr_in, + ecoff_swap_pdr_out, ecoff_swap_ext_in, ecoff_swap_ext_out): + Update. + * elf64-mips.c (ECOFF_SIGNED_64): Define instead of ECOFF_64. + * elf32-mips.c (ECOFF_SIGNED_32): Define instead of ECOFF_32. + +2000-07-11 Andrew Cagney + + * elfcode.h (elf_object_p): Use bfd_set_start_address and not + bfd_get_start_address. + (elf_swap_ehdr_in): Sign extend e_entry when applicable. + (elf_swap_ehdr_out): Ditto. + +2000-07-10 Alexander Aganichev + + * archures.c (bfd_default_scan): Add set of bfd_mach_ cases for + compatibility with older binutils. + +2000-07-10 Alan Modra + + * section.c (bfd_make_section_anyway): Start section_id at 0x10. + (STD_SECTION): Avoid negative ids, instead use 0 to 3. + + From Ryan Bradetich + * dwarf1.c (parse_die): Cure signed/unsigned char warnings. + (parse_line_table): Ditto. + (_bfd_dwarf1_find_nearest_line): Ditto. + * syms.c (cmpindexentry): Remove extra `*' from params. + +2000-07-09 Koundinya K + + * elf32-mips.c (sort_dynamic_relocs): New Function. + (_bfd_mips_elf_finish_dynamic_sections): Call sort_dynamic_relocs + via qsort to sort the dynamic relocations in increasing r_symndx + value. + +2000-07-09 Alan Modra + + * elf64-hppa.c (elf64_hppa_dyn_hash_table_init): Add + ATTRIBUTE_UNUSED to unused args. + (get_opd): Likewise. + (get_plt): Likewise. + (get_dlt): Likewise. + (get_stub): Likewise. + (elf64_hppa_adjust_dynamic_symbol): Likewise. + (elf64_hppa_link_output_symbol_hook): Likewise. + (elf64_hppa_check_relocs): Delete unused var. + (elf64_hppa_size_dynamic_sections): Likewise. + (elf64_hppa_finalize_opd): Likewise. + (elf64_hppa_finalize_dynreloc): Likewise. + (elf64_hppa_modify_segment_map): Likewise. + (elf64_hppa_finish_dynamic_sections): Likewise. + + * elf-hppa.h (elf_hppa_final_write_processing): Add + ATTRIBUTE_UNUSED to unused args. + (elf_hppa_final_link_relocate): Likewise. + (elf_hppa_record_segment_addrs): Add paretheses. + (elf_hppa_relocate_section): Constify dyn_name. + + From David Huggins-Daines + * config.bfd: Add hppa*64*-*-linux-gnu 64-bit target, and + rearrange case statement so that it gets preferred to 32-bit ones. + + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Use + asection->id instead of address of asection structure. + (elf32_hppa_size_stubs): Likewise. + + * elf32-hppa.c (elf32_hppa_size_stubs): Use just one stub section + for .init* and .fini*. + + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Mask pointers + and addends used in stub names to 32 bits. + (elf32_hppa_size_stubs): Likewise. + + * elf-hppa.h (elf_hppa_final_link_relocate): Don't sum addend + twice for R_PARISC_GPREL64. Use bfd_put_32 for R_PARISC_PCREL32, + not bfd_put_64. Fix minor comment typo and formatting. + + Changes to create multiple linker stubs, positioned immediately + before the section where they are required. + * elf32-hppa.c: Don't include hppa_stubs.h. + (elf32_hppa_stub_hash_entry): Add a pointer to the stub section. + (elf32_hppa_stub_hash_table): Delete. + (elf32_hppa_link_hash_entry): Delete. + (elf32_hppa_link_hash_table): Use plain bfd_hash_table for + stub_hash_table, and store the struct here rather than a pointer. + Delete output_symbol_count. Add offset array. Change + global_value to a bfd_vma. + (elf32_hppa_stub_hash_lookup): Use table instead of table->root. + (elf32_hppa_stub_hash_traverse): Delete. + (elf32_hppa_name_of_stub): Delete. + (elf32_hppa_link_hash_lookup): Delete. + (elf32_hppa_link_hash_traverse): Delete. + (elf32_hppa_stub_hash_table_init): Delete. + (elf32_hppa_size_of_stub): Pass input section and offset rather + than location and calculate location here. Don't pass name as all + stubs are now the same size. + (elf32_hppa_stub_hash_newfunc): Init new fields. + (elf32_hppa_link_hash_table_create): Likewise, and stub_hash_table + too. + (elf32_hppa_bfd_final_link_relocate): Cast enums to int before + comparing against ints. Rewrite stub handling code. + (elf32_hppa_relocate_section): Make r_type and r_symndx unsigned. + Case enums to int before comparing against ints. Remove + bfd_reloc_dangerous case. + (elf32_hppa_build_one_stub): Rewrite. + (elf32_hppa_size_one_stub): New function. + (elf32_hppa_build_stubs): Rewrite. + (elf32_hppa_size_stubs): Pass in linker call-back functions. + Rewrite stub-handling specific code. + + * elf32-hppa.h (elf32_hppa_size_stubs): Update prototype. + + * elf64-hppa.c (elf64_hppa_dyn_hash_entry): Fix a comment typo. + + * hppa_stubs.h: Delete. + * Makefile.am (SOURCE_HFILES): Remove hppa_stubs.h + (elf32-hppa.lo): Remove hppa_stubs.h from dependencies. + * Makefile.in: Regenerate. + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle e_nlsel and + e_nlrsel. + + * libhppa.h (hppa_field_adjust): Correct e_nsel case. + + * elf32-hppa.c (elf32_hppa_relocate_section): Mention the offset + and section name for bfd_reloc_notsupported error message. + (elf32_hppa_bfd_final_link_relocate): Print reasons for returning + bfd_reloc_notsupported. + (elf32_hppa_relocate_section): Add ATTRIBUTE_UNUSED to output_bfd. + + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Handle + undefined weak symbols for all relocs. + (elf32_hppa_size_of_stub): Adjust calculation by 8 since branch + offsets are relative to one past the delay slot. + (elf32_hppa_size_stubs): Account for reloc addend when calculating + branch destination. Put addend into stub name too. + (elf32_hppa_bfd_final_link_relocate): Account for reloc addend and + adjust by 8 when deciding whether a linker stub is needed. Put + addend into stub name as for above. + + * elf32-hppa.c (hppa_elf_relocate_insn): Change signed/unsigned on + various args and vars. + (elf32_hppa_bfd_final_link_relocate): Here too. + (elf32_hppa_size_stubs): Rename index -> indx. Use e_indx for + inner block var to avoid shadowing. + + * elf32-hppa.h (_bfd_elf32_hppa_gen_reloc_type): Make `field' arg + unsigned. + * elf64-hppa.h (_bfd_elf64_hppa_gen_reloc_type): Ditto. + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Ditto. + (elf_hppa_fake_sections): Rename local var to avoid shadowing. + + * libhppa.h: Change practically all unsigned ints to plain ints. + Remove tests on gcc version. Instead use ATTRIBUTE_UNUSED for + prototypes. + + From Ryan Bradetich + * libhppa.h (hppa_opcode_type): New enum to replace #define's. + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Modify to + suit above. + From David Huggins-Daines + * elf-hppa.h (elf_hppa_relocate_insn): Update the opcode constants + to the new OP_* ones. + + * elf32-hppa.c (elf32_hppa_size_stubs): Consolidate freeing on + error exit. Bail out earlier on plabel relocs that we aren't + interested in. Don't tell elf32_hppa_stub_hash_lookup to copy + string, and then don't free our copy. + (elf32_hppa_build_one_stub): Make insn unsigned int. + + * libhppa.h (bfd_hppa_insn2fmt): 22 bit branches are only + available with BL, not BE and BLE. + + * elf32-hppa.c (hppa_elf_relocate_insn): Add some more example + code for elf arg relocs. + (elf32_hppa_bfd_final_link_relocate): Replace boolean is_local + argument with elf_link_hash_entry h. Handle undefined weak + symbols. Move $global$ lookup from here... + (elf32_hppa_relocate_section): ...to here. Return correct error + message for non-handled relocs. + (elf32_hppa_size_of_stub): Correctly test branch range. Previous + wrong test was -0x3ffff to +0x40000. + + * elf-hppa.h (elf_hppa_final_link_relocate): R_PARISC_DIR17R, + R_PARISC_DIR17F, and R_PARISC_DIR21L are for absolute branches; + Handle them as such. + (elf_hppa_relocate_insn): Fix a typo. + + * libhppa.h (GET_FIELD, GET_BIT, MASK, CATENATE, ELEVEN): Delete. + (assemble_3, assemble_6, assemble_12, assemble_16, assemble_16a, + assemble_17, assemble_21): Delete. + Supply defines for all 64 possible opcodes. + (bfd_hppa_insn2fmt): Add bfd argument, and use to select wide mode + formats. Handle COMICLR. + (hppa_rebuild_insn): Delete bfd argument. Handle formats 10, -11, + -10, -16, 16, 22. + + * elf32-hppa.c (hppa_elf_relocate_insn): Complete rewrite. + (elf32_hppa_bfd_final_link_relocate): Major rewrite. + (elf32_hppa_build_one_stub): Modify hppa_elf_relocate_insn calls + to suit. + (elf32_hppa_size_stubs): Don't free stub_name twice. Read in all + the local syms - did this code get deleted accidentally? Ignore + undefined and undefweak syms. + + * elf-hppa.h (elf_hppa_final_link): Move hppa_info to outermost + block. Use it instead of elf64_hppa_hash_table (info). + (elf_hppa_final_link_relocate): Use hppa_info instead of + elf64_hppa_hash_table (info). + + * libhppa.h (re_assemble_3, re_assemble_12, re_assemble_16, + re_assemble_17, re_assemble_21, re_assemble_22): Don't mask insn. + (hppa_rebuild_insn): Mask immediate bits here instead. + * elf-hppa.h (elf_hppa_relocate_insn): Mask here too. + +2000-07-08 Alan Modra + + * section.c (struct sec): Add id field. Tidy comment formatting. + (bfd_make_section_anyway): Set id. + (STD_SECTION): Init id too. + Change CONST to const throughout. + * archures.c (bfd_arch_info): Tidy comment. + (bfd_arch_list): Change a CONST to const. + * libbfd-in.h: Tidy comments and replace CONST with const. + * elf-bfd.h: Likewise. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * libcoff.h: Regenerate. + +2000-07-07 DJ Delorie + + * archive.c (_bfd_write_archive_contents): Add an informative + comment. + +2000-07-06 Kazu Hirata + + * srec.c: Fix formatting. + +2000-06-05 DJ Delorie + + * MAINTAINERS: new + +2000-07-04 Alexandre Oliva + + * coff-arm.c (coff_arm_relocate_section): Do not ignore the symbol + value of PC-relative offsets. + +2000-07-03 Jim Wilson + + * elf64-alpha.c (alpha_elf_size_info): New. + (elf_backend_size_info): Define to alpha_elf_size_info. + * elfcode.h (elf_size_info): Change hash bucket size to 4. + +2000-07-03 Ulf Carlsson + + * elf32-mips.c: Include elf32-target.h again for the traditional + MIPS targets. + +2000-07-03 Marek Michalkiewicz + + * elf32-avr.c (bfd_elf32_bfd_reloc_type_lookup): + Add ATTRIBUTE_UNUSED to unused arguments to avoid warnings. + (avr_info_to_howto_rela): Likewise. + (elf32_avr_gc_mark_hook): Likewise. + (elf32_avr_gc_sweep_hook): Likewise. + (elf32_avr_relocate_section): Likewise. + +2000-07-03 Mark Elbrecht + + * cofflink.c (_bfd_coff_write_global_sym): Turn a weak symbol into + an external symbol for a non-shared, non-relocatable link. + +2000-07-03 Nick Clifton + + * cofflink.c (IS_EXTERNAL): New macro: Return true if the symbol + is an external symbol. + (IS_WEAK_EXTERNAL): New macro: Return true if the symbol is a weak + external symbol. + +2000-07-03 Kazu Hirata + + * reloc16.c: Fix formatting. + +2000-07-01 Koundinya K + + * config.bfd: Change targ_defvec and targ_selvecs for mips*-*-sysv4* + to add a new target for traditional mips i.e + bfd_elf32_tradbigmips_vec and bfd_elf32_tradlittlemips_vec. + * configure.in: Likewise. + * configure: Rebuild. + * targets.c (bfd_elf32_tradbigmips_vec): Declare and put in + bfd_target_vector. + (bfd_elf32_tradlittlemips_vec): Likewise. + * elfxx-target.h: Add macro INCLUDED_TARGET_FILE which is more a test + to see that elfNN_bed does not get redefined even if the target file + is included twice for a chip. See elf32-mips.c. + +2000-07-01 Alan Modra + + * Makefile.am (DEP): Fix 2000-06-22. grep after running dep.sed + (CLEANFILES): Add DEPA. + * Makefile.in: Regenerate. + +2000-06-30 DJ Delorie + + * peicode.h (coff_swap_filehdr_in): can't use e_magic because we + can't assume the PE header is at 0x80. + +2000-06-29 Mark Elbrecht + + * syms.c (_bfd_stab_section_find_nearest_line): Use IS_ABSOLUTE_PATH. + +2000-06-28 Mark Elbrecht + + * go32stub.h: Update stub. + +2000-06-26 Marek Michalkiewicz + + * archures.c (bfd_mach_avr5): Define. + * bfd-in2.h (bfd_mach_avr5): Define. + * cpu-avr.c (arch_info_struct): Rename bfd_mach_avr4 to + bfd_mach_avr5, add bfd_mach_avr4. Update comments. + (compatible): Update comment. Add missing test. + * elf32-avr.c (avr_final_link_relocate): Support 8K wrap + for avr2 and avr4. Simplify 8K wrap code. + (bfd_elf_avr_final_write_processing): Recognize bfd_mach_avr5. + (elf32_avr_object_p): Recognize E_AVR_MACH_AVR5. + +2000-06-26 Kazu Hirata + + * coff-h8300.c: Fix formatting. + * cpu-h8300.c: Likewise. + +2000-06-24 Alexandre Oliva + + * elf32-arm.h (elf32_arm_final_link_relocate): Print `(local)' + for local symbols whose names are unknown. + +2000-06-22 Alan Modra + + * Makefile.am (DEP): grep for leading `/' in DEP1, and fail if we + find one. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + +2000-06-20 H.J. Lu + + * Makefile.am: Rebuild dependency. + * Makefile.in: Rebuild. + +2000-06-20 Maciej W. Rozycki + + * elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): New function. + (elf_backend_copy_indirect_symbol): Map to the new function. + +2000-06-20 Alan Modra + + * archive.c (normalize): Correct pointer comparison when checking + for backslashes. + (bfd_bsd_truncate_arname): Likewise. + (bfd_gnu_truncate_arname): Likewise. + +2000-06-20 Ulf Carlsson + + * elf-bfd.h (struct elf_obj_tdata): Define per BFD Irix 5 virtual + sections elf_{text,data}_{section,symbol}. + * elf32-mips.c: mips_elf_{text,data}_{section,symbol}{,_ptr}: Remove. + (_bfd_mips_elf_hide_symbol): New function. + (elf_backend_hide_symbol): Map to the new function. + (_bfd_mips_elf_add_symbol_hook): Change to use new per BFD + definitions of mips_elf_{text,data}_{section,symbol}. + (mips_elf_local_relocation_p): Try to find the direct symbol + based on new check_forced argument. + (mips_elf_calculate_relocation): Use new version of + mips_elf_local_relocation_p. + (mips_elf_relocate_section): Likewise. + (_bfd_mips_elf_relocate_section): Likewise. + (mips_elf_sort_hash_table): Only assert that have enough GOT + space. + (mips_elf_got16_entry): Match all 32 bits to the existing GOT + entry if the relocation based on the new external argument. + (mips_elf_create_dynamic_relocation): Assert that we have a + section contents allocated where we can swap out the dynamic + relocations. + (mips_elf_calculate_relocation): Find the real hash-table entry + correctly by using h->root.root.type. Only create a dynamic + relocation entry if the symbol is defined in a shared library. + Create an external GOT entry for the GOT16 relocation if the + symbol was forced local. + (_bfd_mips_elf_finish_dynamic_symbol): Don't assert there is a + dynamic index if the symbol was forced local. + +2000-06-20 Maciej W. Rozycki + + * elf32-mips.c: Fix typos in comments. + +2000-06-19 Mark Kettenis + + * rs6000-core.c: Wrap definition of `union VmInfo' within #ifdef + CORE_VERSION_1. + +2000-06-18 Stephane Carrez + + * Makefile.in, bfd-in2.h, libbfd.h, configure: Rebuild. + * Makefile.am (ALL_MACHINES, ALL_MACHINES_CFILES, BFD32_BACKENDS, + BFD32_BACKENDS_CFILES): Add 68hc12, 68hc11 files. + * configure.in (bfd_elf32_m68hc12_vec): Recognize. + (bfd_elf32_m68hc11_vec): Likewise. + * config.bfd (targ_cpu): Recognize 68hc12 and 68hc11. + Supports 68hc11 & 68hc12 at the same time. + * targets.c (bfd_elf32_m68hc12_vec): Declare and put in + bfd_target_vector. + (bfd_elf32_m68hc11_vec): Likewise. + * elf.c (prep_headers): Recognize bfd_arch_m68hc12 and 68hc11. + * archures.c (bfd_m68hc12_arch): Define and register in global list + (bfd_m68hc11_arch): Likewise. + * reloc.c (BFD_RELOC_M68HC11_HI8, BFD_RELOC_M68HC11_LO8, + BFD_RELOC_M68HC11_3B): Define. + * cpu-m68hc12.c, elf32-m68hc12.c: New files for 68hc12 support. + * cpu-m68hc11.c, elf32-m68hc11.c: New files for 68hc11 support. + +2000-06-18 Ulf Carlsson + + * elf_bfd.h (struct elf_backend_data): Add info argument to + elf_backend_hide_symbol. + (_bfd_elf_link_hash_hide_symbol): Likewise. + * elf.c (_bfd_elf_link_hash_hide_symbol): Likewise. + * elf64-ia64.c (elf64_ia64_hash_hide_symbol): Likewise. + * elflink.h (elf_link_add_object_symbols): Likewise. + (elf_link_assign_sym_version): Likewise. + +2000-06-18 H.J. Lu + + * coff-i386.c (coff_i386_reloc): Don't return in case of + output_bfd == (bfd *) NULL if COFF_WITH_PE is defined. + Compensate PE relocations when linking with non-PE object + files to generate a non-PE executable. + +2000-06-17 Ulf Carlsson + + * elf32-mips.c (mips_elf_calculate_relocation): Explicitly write + GOT entries if we're doing a static link or -Bsymbolic link. + +2000-06-15 Ulf Carlsson + + * elflink.h (elf_link_adjust_relocs): Check for and call backend + specifific swap_reloc_{in,out} and swap_reloca_{in,out} if + available. + (elf_link_output_relocs): Likewise. + (elf_reloc_link_order): Likewise. + +2000-06-16 Nicholas Duffek + + * archures.c (enum bfd_architecture): #define constants for + PowerPc and RS6000 machine numbers. + * bfd-in2.h: Regenerate. + * coffcode.h (coff_set_arch_mach_hook): #ifdef XCOFF64, set arch + to bfd_arch_powerpc instead of bfd_arch_rs6000. Refer to PowerPc + and RS6000 machine numbers using #defined constants from + archures.c. + * cpu-powerpc.c (arch_info_struct): Refer to PowerPc and RS6000 + machine numbers using #defined constants from archures.c. Add + entries for EC603e, 630, A35, RS64II, RS64III, 7400. Specify + 64-bit words in 620 entry. + * cpu-rs6000.c (arch_info_struct): Create with entries for RS1, + RSC, and RS2. + (bfd_rs6000_arch): Change default machine to 0 (bfd_mach_rs6k). + +2000-06-16 Nicholas Duffek + + * coffcode.h (coff_mkobject_hook): Set xcoff_tdata.xcoff64. + * libcoff-in.h (struct xcoff_tdata): Define xcoff64 field. + * libcoff.h (struct xcoff_tdata): Define xcoff64 field. + +2000-06-16 Nicholas Duffek + + * bfd-in.h (bfd_family_coff): Define. + * bfd-in2.h: Regenerate. + * coffgen.c (coff_count_linenumbers, coff_symbol_from, + coff_find_nearest_line): Check COFFness using bfd_family_coff() + instead of bfd_target_coff_flavour. + * cofflink.c (_bfd_coff_final_link): Likewise. + * cpu-ns32k.c (do_ns32k_reloc): Don't strcmp() target name to + exclude XCOFF files. + * reloc.c (bfd_perform_relocation, bfd_install_relocation): + Likewise. + * targets.c (enum bfd_flavour): Add bfd_target_xcoff_flavour. + * xcoff-target.h (TARGET_SYM): Use bfd_target_xcoff_flavour. + * xcofflink.c (XCOFF_XVECP): Delete. + (bfd_xcoff_link_record_set, bfd_xcoff_import_symbol, + bfd_xcoff_export_symbol, bfd_xcoff_link_count_reloc, + bfd_xcoff_record_link_assignment, + bfd_xcoff_size_dynamic_sections): Replace XCOFF_XVECP() with + check for bfd_target_xcoff_flavour. + +2000-06-16 Nicholas Duffek + + * rs6000-core.c: Support 64-bit core files, support pre-4.3 core + files on AIX 4.3. + (read_hdr): New function. + (rs6000coff_core_p): Store mstsave or __context64 struct instead + of trying to extract individual registers. Set abfd->arch_info + to match the architecture that created the core file. + (rs6000coff_get_section_contents): Delete. + * xcoff-target.h (rs6000coff_get_section_contents): Delete. + +2000-06-14 H.J. Lu + + * vms-misc.c (_bfd_vms_next_record): Return -1 if PRIV(vms_rec) + is NULL. + +2000-06-13 H.J. Lu + + * configure: Regenerate. + +2000-06-13 J"orn Rennecke + + * peicode.h (pe_ILF_object_p): Use TARGET_LITTLE_SYM instead of + armpei_little_vec. + +2000-06-08 David O'Brien + + * configure.in (VERSION): Update to show this is the CVS mainline. + +2000-06-07 Alan Modra + + * elf32-d10v.c: Include elf/d10v.h + (enum reloc_type): Delete. + * elf32-d30v.c: Include elf/d30v.h + (enum reloc_type): Delete. + + * Makefile.am: Run "make dep-am" to regenerate dependencies. + * Makefile.in: Regenerate. + + * elf32-i386.c (elf_howto_table): Remove EMPTY_HOWTOs. + (elf32_i386_vtinherit_howto, elf32_i386_vtentry_howto): Delete and + move HOWTOs into elf_howto_table. + (R_386_standard, R_386_ext_offset): Define. + (R_386_ext, R_386_vt_offset, R_386_vt): Define. + (elf_i386_reloc_type_lookup): Modify calculation of index into + elf_howto_table since we've removed the padding. + (elf_i386_info_to_howto_rel): Likewise. + (elf_i386_relocate_section): Likewise. + +2000-06-06 Michael Snyder + + * elf.c (elf_grok_pr_status): Eliminate reference to prgregset_t. + +2000-06-05 H.J. Lu + + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Don't flag + an error when seeing an undefined symbol with hidden/internal + attribute. It is handled in *_relocate_section (). + +2000-06-05 H.J. Lu + + * elflink.h (elf_fix_symbol_flags): Follow the link for the + indirect symbol for the ELF_LINK_NON_ELF bit. + (elf_link_output_extsym): Don't output the indirect symbol even + if the ELF_LINK_NON_ELF bit is set. + +2000-06-01 J.T. Conklin + + * config.bfd (i[3456]86-*-netbsdelf*): New target. + (i[3456]86-*-netbsdaout*): New target. + (i[3456]86-*-netbsd*): Add bfd_elf32_i386_vec to targ_selvecs. + (i[3456]86-*-openbsd*): Likewise. + +2000-05-30 Andrew Cagney + + * trad-core.c: From hpux-core.c, include or + when possible. + +2000-05-31 Ulrich Drepper + + * elf.c (_bfd_elf_slurp_version_tables): Correct reading of version + definitions. We must not assume they are sorted in the file + according to their index numbers. + +2000-05-31 Alan Modra + + * elf-hppa.h: (elf_hppa_final_link_relocate): Use e_rsel field + selector for R_PARISC_PCREL17R. R_PARISC_DIR17R and + R_PARISC_DIR17F are for absolute branches; Handle them as such. + +2000-05-30 Nick Clifton + + * cpu-i960.c (scan_960_mach): Accept 80960KA, 80960KB, + 80960CA, 80960MC as valid machine names. + +2000-05-30 H.J. Lu + + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Clear the + visibility bits if the symbol is undefined. Correctly handle + weak undefined symbols with hidden and internal attributes. + + * elflink.h (elf_link_add_object_symbols): Always turn the + symbol into local if it has the hidden or internal attribute. + +2000-05-29 Philip Blundell + + * ppcboot.c: Add packed attribute if compiling with GCC. + +2000-05-29 Anatoly Vorobey + + * elf.c (_bfd_elf_link_hash_table_init): Initialize dynlocal. + +2000-05-26 Michael Snyder + + * elf.c (elfcore_grok_prstatus, elfcore_grok_pstatus, + elfcore_grok_psinfo): Add code to allow debugging a 32-bit + corefile on a 64-bit (Sparc Solaris) host. Also clean up + a few old comments. + +2000-05-26 Alan Modra + + * Makefile.am: Update dependencies with "make dep-am" + * Makefile.in: Regenerate. + + * sysdep.h (gettext, dgettext, dcgettext, textdomain, + bindtextdomain): Replace defines with those from intl/libgettext.h + to quieten gcc warnings. + +2000-05-26 Eli Zaretskii + + * aoutx.h (find_nearest_line): Use IS_ABSOLUTE_PATH. + + * archive.c (normalize, bfd_bsd_truncate_arname, + bfd_gnu_truncate_arname) [HAVE_DOS_BASED_FILE_SYSTEM]: Support + file names with backslashes. + + * cache.c (bfd_open_file) [__MSDOS__]: Don't unlink the file + before opening it. + + * sysdep.h: Include filenames.h. + +2000-05-26 Alan Modra + + * opncls.c (bfd_close_all_done): Mask file perms with 0777 not 0x777. + +2000-05-26 Jakub Jelinek + + * elf64-sparc.c (sparc64_elf_relax_section): New. + (sparc64_elf_relocate_section): Optimize tail call into branch always + if possible. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + (elf32_sparc_relax_section): New. + +2000-05-26 Jakub Jelinek + + * elf64-sparc.c: Add ATTRIBUTE_UNUSED to unused function parameters. + Remove unusued variables. + (sparc64_elf_relocate_section): Change r_symndx type to unsigned long. + (sparc64_elf_merge_private_bfd_data): Fix shared library case from + previous fix, so that shared libs really don't influence targets + extension mask and memory model. + +2000-05-23 H.J. Lu + + * elf64-alpha.c (elf64_alpha_relocate_section): Check + h->root.other not h->other. + * elf32-mips.c (mips_elf_calculate_relocation): Likewise. + + * elf32-ppc.c (ppc_elf_relocate_section): Fix a typo. + +2000-05-23 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Don't allow the + undefined symbol with the non-default visibility attributes. + * elf-hppa.h (elf_hppa_relocate_section): Likewise. + * elf32-arm.h (elf32_arm_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-mips.c (mips_elf_calculate_relocation): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-ia64.c (elf64_ia64_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + +2000-05-22 Richard Henderson + + * elf64-ia64.c (ia64_howto_table): Add PCREL60B, PCREL21BI, + PCREL22, PCREL64I. Zero size of special relocs. + (elf64_ia64_reloc_type_lookup): Likewise. + (USE_BRL, oor_brl, oor_ip): New. + (elf64_ia64_relax_section): New. + (elf64_ia64_check_relocs): Handle PCREL60B, PCREL22, PCREL64I. + (elf64_ia64_install_value): Likewise, plus PCREL21BI. + (elf64_ia64_relocate_section): Likewise. + (bfd_elf64_bfd_relax_section): New. + * reloc.c (BFD_RELOC_IA64_PCREL21BI): New. + (BFD_RELOC_IA64_{PCREL22,PCREL60B,PCREL64I}): New. + * bfd-in2.h, libbfd.h: Regenerate. + +2000-05-22 Nick Clifton + + * configure.in : Add peigen.lo to MIPS PE targets. + * configure: Regenerate. + +2000-05-22 Momchil Velikov + + * libbfd.c (_bfd_generic_verify_endian_match): Compare endianess + only if it is known for both input and output bfds. Separate + error message strings as in some languages, it may be necessary + to change more than one place in the string to change between + 'big' and 'little'. + + * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Remove inline + endianess checks, call _bfd_generic_verify_endian_match() instead. + + * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise. + + * elf32-mcore.c (mcore_elf_merge_private_bfd_data): Likewise. + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Likewise. Verify + endianess before checking bfd flavours. + +2000-05-22 H.J. Lu + + * elflink.h (elf_link_output_extsym): Clear the visibility + field for symbols not defined locally. + +2000-05-18 Alan Modra + + * libhppa.h (re_assemble_3, re_assemble_12, re_assemble_16, + re_assemble_17, re_assemble_21, re_assemble_22): Don't mask insn. + (hppa_rebuild_insn): Mask immediate bits here instead. + * elf-hppa.h (elf_hppa_relocate_insn): Mask here too. + +2000-05-18 Momchil Velikov + + * elflink.h (elf_bfd_final_link, elf_link_input_bfd): When emiting + relocs for an executable, ensure that they are virtual addresses. + +2000-05-18 Jeffrey A Law (law@cygnus.com) + + * config.bfd (hppa*64*-*-hpux11*): New target triplet. + +2000-05-17 S. Bharadwaj Yadavalli + Rick Gorton + + * elflink.h: Add emitrelocations support: when enabled, relocation + information and relocation sections are put into final output + executables. If the emitrelocations flag is set, do the following: + (elf_bfd_final_link): Emit relocation sections. + (elf_link_input_bfd): Compute relocation section contents. + (elf_gc_sections): Don't clean relocation sections. + +2000-05-16 Catherine Moore + + * som.c (som_decode_symclass): Recognize weak symbols. + +2000-05-16 Szabolcs Szakacsits + + * peigen.c (pe_print_idata): Undo part of 2000-05-12 change that + read idata section only from dataoff. + (pe_print_edata): Correctly check for valid eat_member. + +2000-05-16 J"orn Rennecke + + * elf32-sh.c (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH8. + +2000-05-14 Philip Blundell + + * config.bfd (armeb-*-elf, arm*b-*-linux-gnu*): New targets. + +2000-05-12 Alan Modra + + * targets.c (bfd_target_vector): #ifdef BFD64 rs6000coff64_vec + + * peigen.c (pe_print_idata): Look for .idata section and print + info even if data directory has zero entries. Read idata section + starting from dataoff, and adjust all data offsets to suit. Cast + all bfd_vma vars to unsigned long before passing to fprintf. + * peigen.c (pe_print_edata): Similarly, look for .edata section + and print info even if data directory has zero entries. Cast + all bfd_vma vars to unsigned long before passing to fprintf. + + From Szabolcs Szakacsits + * peigen.c (pe_print_idata): Use bfd_section_size rather than data + directory size which may be bogus. + * peigen.c (pe_print_edata): Similarly. + +2000-05-09 Alan Modra + + * elf.c (bfd_section_from_shdr): Don't set use_rela_p if rela + section is empty. + (copy_private_bfd_data): Allow for space possibly taken up by elf + headers when calculating segment physical address from lma. + +2000-05-08 Alan Modra + + * versados.c (versados_scan): Init stringlen and pass_2_done. + + * trad-core.c (trad_unix_core_file_p): Return + bfd_error_wrong_format rather than bfd_error_file_truncated. + + * peigen.c (_bfd_pei_swap_aouthdr_out): Pass ImageBase to + add_data_entry. DataDirectory virtual address is relative. + (pe_print_idata): Account for relative DataDirectory virtual + addresses. Don't trash datasize inside POWERPC_LE_PE code. + (pe_print_edata): Similarly. + + From Szabolcs Szakacsits + * peigen.c (dir_names): Add Delay Import Directory. + (pe_print_idata): Always search for bfd section containing + idata address rather than looking up section name. Print this + section name rather than .idata. + (pe_print_edata): Similarly. Also print some fields as %08lx. + (_bfd_pe_print_private_bfd_data_common): Print Reserved1 field as + Win32Version. + +2000-05-05 Clinton Popetz + + * xcoff.h: Rename to xcoff-target.h + * Makefile.am: Change all instances of xcoff.h to xcoff-target.h + * coff-rs6000.c: Ditto. + * coff64-rs6000.c: Ditto. + * coff-pmac.c: Ditto. + * Makefile.in: Regenerate. + +2000-05-05 Clinton Popetz + + * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): + Change U802TOC64MAGIC to U803XTOCMAGIC. + +2000-05-04 Michael Snyder + + * elf.c (bfd_elf_get_arch_size): New function, return 32 | 64 | -1. + * bfd-in.h: Prototype bfd_elf_get_arch_size. + * bfd-in2.h: Prototype bfd_elf_get_arch_size. + +2000-05-04 Alan Modra + + * libhppa.h (HPPA_R_CONSTANT): Cast argument to bfd_signed_vma. + +2000-05-03 Martin v. Lwis + + * elflink.h (elf_link_add_object_symbols): Reset dynindx for + hidden and internal symbols. + (elf_fix_symbol_flags): Clear NEEDS_PLT for symbols with + visibility. + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Do not + assign a PLT or GOT entry to symbols with hidden and + internal visibility. + +2000-05-03 Mark Elbrecht + + * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Add entry for + the .bss section. + * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. + +2000-05-02 H.J. Lu + + * elf.c (prep_headers): Use ELFOSABI_NONE instead of + ELFOSABI_SYSV. + +2000-05-02 Alan Modra + + * targets.c (bfd_target_vector): Restore bfd_elf32_hppa_vec. + * Makefile.am (BFD32_BACKENDS): Restore elf32-hppa.lo. Regenerate + dependencies. + * Makefile.in: Regenerate. + +2000-05-01 Jim Wilson + + * Makefile.am (BFD32_BACKENDS): Add efi-app-ia32.lo. + (BFD32_BACKENDS_CFILES): Add efi-app-ia32.c. + (BFD64_BACKENDS): Delete coff-ia64.lo. Add efi-app-ia64.lo. + (BFD64_BACKENDS_CFILES): Delete coff-ia64.c. Add efi-app-ia64.c. + * Makefile.in: Rebuild. + +2000-05-02 Alan Modra + + * config.bfd: Re-enable elf32-hppa. It now compiles, even if it + doesn't work very well. + + * elf-hppa.h (elf_hppa_internal_shdr): Define. + (elf_hppa_fake_sections): hdr is elf_hppa_internal_shdr. + Set hdr->s_type to 1 if ARCH_SIZE == 32. + (_bfd_elf_hppa_gen_reloc_type): Add prototype. + (elf_hppa_info_to_howto): Likewise. + (elf_hppa_info_to_howto_rel): Likewise. + (elf_hppa_reloc_type_lookup): Likewise. + (elf_hppa_is_local_label_name): Likewise. + (elf_hppa_fake_sections): Likewise. + (elf_hppa_final_write_processing): Likewise. + (elf_hppa_howto_table): Fully initialise all entries. + (_bfd_elf_hppa_gen_reloc_type): Add ATTRIBUTE_UNUSED to args. + (elf_hppa_info_to_howto): Likewise. + (elf_hppa_info_to_howto_rel): Likewise. + (elf_hppa_reloc_type_lookup): Likewise. + (elf_hppa_final_write_processing, elf_hppa_add_symbol_hook, + elf_hppa_unmark_useless_dynamic_symbols, + elf_hppa_remark_useless_dynamic_symbols, + elf_hppa_record_segment_addrs, elf_hppa_final_link, + elf_hppa_relocate_section, elf_hppa_final_link_relocate, + elf_hppa_relocate_insn): Compile only if ARCH_SIZE == 64 until + elf32-hppa.c mess is cleaned up. + (elf_hppa_final_link_relocate): Make insn and r_type unsigned + int. Delete r_field. In case R_PARISC_PCREL21L, don't set + r_field then call hppa_field_adjust inline func with variable + r_field arg, instead call hppa_field_adjust with fixed arg. + In case R_PARISC_PCREL22F, don't set r_field. + (elf_hppa_relocate_insn): Change args and return type to unsigned + int. Call re_assemble_* funcs to do the work. + + * elf32-hppa.c (hppa_elf_relocate_insn): Don't assume 32 bit when + sign extending. + + * libhppa.h (HPPA_R_CONSTANT): Don't assume 32 bit when sign + extending. + (sign_extend): Mask first before sign extending. + (low_sign_extend): Rewrite without condition expression. + (ones, dis_assemble_3, dis_assemble_12, dis_assemble_16, + dis_assemble_17, dis_assemble_21, dis_assemble_22): Delete. + (assemble_3, assemble_6, assemble_12, assemble_16, assemble_16a, + assemble_17, assemble_21, sign_unext, low_sign_unext): Return + result as function return value rather than through pointer arg. + Accept unsigned int args, and return unsigned int. + (re_assemble_3): New. Combines function of dis_assemble_3 with + re-assembly of opcode and immediate. + (re_assemble_12): Likewise. + (re_assemble_16): Likewise. + (re_assemble_17): Likewise. + (re_assemble_21): Likewise. + (re_assemble_22): Likewise. + (hppa_field_adjust): Rewrite and document, paying attention to + size of types and signed/unsigned issues. + (get_opcode): Shift before masking. + (FDLW): Rename to FLDW. + (bfd_hppa_insn2fmt): Change arg to unsigned int. Delete fmt. + (hppa_rebuild_insn): Change args and return value to unsigned + int. Make use of re_assemble_*. Correct case 11. + + * dep-in.sed: Handle ../opcodes/. + * Makefile.am (SOURCE_HFILES): Add elf-hppa.h, elf32-hppa.h, + elf64-hppa.h, hppa_stubs.h, xcoff.h. + (BFD32_BACKENDS_CFILES): Restore elf32-hppa.c. + Remove elf64-hppa.lo, cpu-ia64.lo, elf64-ia64.lo, elfarm-oabi.lo, + elfarm-nabi.lo dependencies outside of auto-dependency area. + Regenerate dependencies. + * Makefile.in: Regenerate. + + * configure.in (TRAD_HEADER): Test non-null before + AC_DEFINE_UNQUOTED. + * configure: Regenerate. + + * reloc.c: Fix mis-spelling in comment. + +2000-05-01 Alan Modra + + * coff-sh.c (bfd_coff_small_swap_table): Fix Fri Apr 28 change. + * vms.c (vms_openr_next_archived_file): Return NULL. + +2000-04-28 Clinton Popetz + + * coffcode.h Copy changes mistakenly done to libcoff.h in + 4/24/2000 patch. + +2000-04-29 Andreas Jaeger + + * libbfd-in.h: Correctly check GCC version. + * bfd-in.h: Likewise. + * libhppa.h: Likewise. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2000-04-28 Clinton Popetz + + * Makefile.am (BFD64_BACKENDS, BFD64_BACKENDS_CFILES): Add + coffdu-rs6000.{lo,c}. + (coff-pmac.lo, coff-rs6000.lo, coff64-rs6000.lo): Add dependency + on xcoff.h + * Makefile.in: Regenerate. + * xcoff.h: New file. + * coff-pmac.c: Use xcoff.h instead of coff-rs6000.c. + * coff-rs6000.c: Move all declarations and defines that are + common to the xcoff backends into xcoff.h + * coff64-rs6000.c: Ditto, + +2000-04-28 Clinton Popetz + + * coff-mips.c (mips_ecoff_backend_data): Add initialization of + _bfd_coff_force_symnames in strings and + _bfd_coff_debug_string_prefix_length to their default values. + * coff-sh.c: (bfd_coff_small_swap_table): Ditto. + +2000-04-28 Clinton Popetz + + * coff-alpha.c (alpha_ecoff_backend_data): Add initialization of + _bfd_coff_force_symnames in strings and + _bfd_coff_debug_string_prefix_length to their default values. + +2000-04-27 Alan Modra + + * elf32-m68k.c (elf_m68k_gc_sweep_hook): Return if dynobj NULL. + Check local_got_refcounts before dereferencing. + + * elf32-ppc.c (ppc_elf_relocate_section): Check splt != NULL + before deciding we don't need R_PPC_PLT32 relocation. + (ppc_elf_gc_sweep_hook): Check local_got_refcounts before + dereferencing. + + * elflink.h (elf_gc_common_finalize_got_offsets): Fix comment. + + * elf32-i386.c (elf_i386_check_relocs): Reference count .got and + .plt entries. + (elf_i386_gc_sweep_hook): Garbage collect .got and .plt entries. + (elf_i386_adjust_dynamic_symbol): Recognize unused .plt entries. + (elf_i386_relocate_section): Allow for .plt to go missing. + (elf_i386_finish_dynamic_symbol): Use same test to decide if we + can use a relative reloc for got as elf_i386_relocate_section. + (bfd_elf32_bfd_final_link): Define to use gc form of final link. + +2000-04-26 Clinton Popetz + + * config.bfd: Remove extraneous bfd_powerpc_64_arch. + +2000-04-24 Clinton Popetz + + * Makefile.am (coff64-rs6000.lo): New rule. + * Makefile.in: Regenerate. + * coff-rs6000.c (xcoff_mkobject, xcoff_copy_private_bfd_data, + xcoff_is_local_label_name, xcoff_rtype2howto, + xcoff_reloc_type_lookup, xcoff_slurp_armap, xcoff_archive_p, + xcoff_read_ar_hdr, xcoff_openr_next_archived_file, xcoff_write_armap, + xcoff_write_archive_contents): No longer static, and prefix with _bfd_. + (NO_COFF_SYMBOLS): Define. + (xcoff64_swap_sym_in, xcoff64_swap_sym_out, xcoff64_swap_aux_in, + xcoff64_swap_aux_out): New functions; handle xcoff symbol tables + internally. + (MINUS_ONE): New macro. + (xcoff_howto_tabl, xcoff_reloc_type_lookup): Add 64 bit POS + relocation. + (coff_SWAP_sym_in, coff_SWAP_sym_out, coff_SWAP_aux_in, + coff_SWAP_aux_out): Map to the new functions. + * coff64-rs6000.c: New file. + * libcoff.h (bfd_coff_backend_data): Add new fields + _bfd_coff_force_symnames_in_strings and + _bfd_coff_debug_string_prefix_length. + (bfd_coff_force_symnames_in_strings, + bfd_coff_debug_string_prefix_length): New macros for above fields. + * coffcode.h (coff_set_arch_mach_hook): Handle XCOFF64 magic. + Set machine to 620 for XCOFF64. Use bfd_coff_swap_sym_in instead + of using coff_swap_sym_in directly. + (FORCE_SYMNAMES_IN_STRINGS): New macro, defined for XCOFF64. + (coff_set_flags) Set magic for XCOFF64. + (coff_compute_section_file_positions): Add symbol name length to + string section length if bfd_coff_debug_string_prefix_length is + true. + (coff_write_object_contents): Don't do reloc overflow for XCOFF64. + (coff_slurp_line_table): Use bfd_coff_swap_lineno_in instead of + using coff_swap_lineno_in directly. + (bfd_coff_backend_data): Add _bfd_coff_force_symnames_in_strings + and _bfd_coff_debug_string_prefix_length fields. + * coffgen.c (coff_fix_symbol_name, coff_write_symbols): Force + symbol names into strings table when + bfd_coff_force_symnames_in_strings is true. + * coffswap.h (MAX_SCNHDR_NRELOC, MAX_SCNHDR_NLNNO, GET_RELOC_VADDR, + SET_RELOC_VADDR): New macros. + (coff_swap_reloc_in, coff_swap_reloc_out): Use above macros. + (coff_swap_aux_in, coff_swap_aux_out): Remove RS6000COFF_C + code. + (coff_swap_aouthdr_in, coff_swap_aouthdr_out): Handle XCOFF64 + changes within RS6000COFF_C specific code. + (coff_swap_scnhdr_out): Use PUT_SCNHDR_NLNNO, PUT_SCNHDR_NRELOC, + MAX_SCNHDR_NRELOC, and MAX_SCNHDR_NLNNO. + * reloc.c (bfd_perform_relocation, bfd_install_relocation): + Extend existing hack on target name. + * xcofflink.c (XCOFF_XVECP): Extend existing hack on + target name. + * coff-tic54x.c (ticof): Keep up to date with new fields + in bfd_coff_backend_data. + * config.bfd: Add bfd_powerpc_64_arch to targ_arch and define + targ_selvecs to include rs6000coff64_vec for rs6000. + * configure.in: Add rs6000coff64_vec case. + * cpu-powerpc.c: New bfd_arch_info_type. + +2000-04-24 Jeffrey A Law (law@cygnus.com) + + * config.bfd: Only disable elf32-hppa vectors, not all of the + BSD and OSF configuration support. Provide (disabled) clauses + for PA64 support. + * configure.in: Add clause for PA64 support. + * configure: Rebuilt. + + * targets.c (bfd_target_vector): Add bfd_elf64_hppa_vec. + (bfd_elf64_hppa_vec): Declare. + + * Makefile.am (BFD64_BACKENDS): Add elf64-hppa.lo + (BFD64_BACKENDS_CFILES): Add elf64-hppa.c + (elf64-hppa.lo): Add dependencies. + * Makefile.in: Rebuilt. + + * elf64-hppa.c, elf64-hppa.h: New files with PA64 support. + +2000-04-24 Jason Eckhardt + + * libhppa.h (dis_assemble_16): New function. + (pa_arch): Added pa20w element. + +2000-04-24 Ulrich Drepper + + * elf-bfd.h: Add prototypes for bfd_elf32_write_relocs, + bfd_elf32_slurp_reloc_table, bfd_elf64_write_relocs, and + bfd_elf64_slurp_reloc_table. + + * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): New + definitions to get external names. + (elf_write_relocs): Renamed from write_relocs and make global. + (elf_slurp_reloc_table): Make global. + (_bfd_elf,size_info): Use elf_write_relocs instead of write_relocs. + + * archive.c (hpux_uid_gid_encode): New function. + (bfd_ar_hdr_from_filesystem): Use it if HPUX_LARGE_AR_IDS is + defined and the ID is greater than 99999. + (bfd_generic_stat_arch_elt): If HPUX_LARGE_AR_IDS is defined decode + special uid/gid fields into 32 bit values. + +2000-04-21 Matthew Green + + * config.bfd: Add NetBSD/sparc64 support. + +2000-04-21 Richard Henderson + David Mosberger + Timothy Wall + Jim Wilson + + * Makefile.am (ALL_MACHINES): Add cpu-ia64.lo. + (ALL_MACHINES_CFILES): Add cpu-ia64.c. + (BFD64_BACKENDS): Add elf64-ia64.lo. + (BFD64_BACKENDS_CFILES): Add elf64-ia64.c. + (cpu-ia64.lo, elf64-ia64.lo): New rules. + * Makefile.in: Rebuild. + * archures.c (enum bfd_architecture): Add bfd_arch_ia64. + (bfd_ia64_arch): Declare. + (bfd_archures_list): Add bfd_ia64_arch. + * bfd-in2.h: Rebuild. + * config.bfd: (ia64*-*-linux-gnu*, ia64*-*-elf*): New targets. + * configure: Rebuild. + * configure.host: (ia64-*-linux*): New host. + * configure.in (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_big_vec, + bfd_efi_app_ia64_vec, bfd_efi_app_ia64_vec): New vectors. + * elf.c (prep_headers): Add bfd_arch_ia64. + * libbfd.h: Rebuild. + * reloc.c: Add IA-64 relocations. + * targets.c (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_big_vec): + Declare. + (bfd_target_vect): Add bfd_elf64_ia64_little_vec. + * cpu-ia64-opc.c, cpu-ia64.c, elf64-ia64.c: New files. + +2000-04-21 Richard Henderson + + * elf32-d30v.c (bfd_elf_d30v_reloc): Don't modify section + contents when performing a partial link. + (bfd_elf_d30v_reloc_21): Likewise. + +2000-04-20 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Restrict 1998-12-10 + patch to symbols defined by a shared object. + * elf32-ppc.c (ppc_elf_relocate_section): Similarly. + +2000-04-19 Michael Sokolov + + K&R compiler fixes. + * dwarf2.c (concat_filename): Avoid string literal concatenation. + * ieee.c (ieee_get_symtab): Don't initialise union in struct. + +2000-04-11 David Mosberger + + * Makefile.am (BFD64_BACKENDS): Mention coff-ia64.lo. + (BFD64_BACKENDS_CFILES): Mention coff-ia64.c + (coff-ia64.lo): Add dependency. + * Makefile.in: Regenerate. + * coff-ia64.c: New file. + * efi-app-ia32.c: Ditto. + * efi-app-ia64.c: Ditto. + * coffcode.h (coff_set_arch_mach_hook): Handle IA64MAGIC. + (coff_set_flags): Ditto. + (coff_write_object_contents) [IA64]: Set magic number to ZMAGIC. + * config.bfd (i[3456]86-*-linux-gnu*): Mention bfd_efi_app_ia32_vec. + * configure.in (elf): Handle bfd_efi_app_ia32 and bfd_efi_app_ia64_vec. + * configure: Regenerate. + * libpei.h (GET_OPTHDR_IMAGE_BASE): New macro. + (PUT_OPTHDR_IMAGE_BASE): Ditto. + (GET_OPTHDR_SIZE_OF_STACK_RESERVE): Ditto. + (PUT_OPTHDR_SIZE_OF_STACK_RESERVE): Ditto. + (GET_OPTHDR_SIZE_OF_STACK_COMMIT): Ditto. + (PUT_OPTHDR_SIZE_OF_STACK_COMMIT): Ditto. + (GET_OPTHDR_SIZE_OF_HEAP_RESERVE): Ditto. + (PUT_OPTHDR_SIZE_OF_HEAP_RESERVE): Ditto. + (GET_OPTHDR_SIZE_OF_HEAP_COMMIT): Ditto. + (PUT_OPTHDR_SIZE_OF_HEAP_COMMIT): Ditto. + (GET_PDATA_ENTRY): Ditto. + * peigen.c (_bfd_pei_swap_aouthdr_in) [COFF_WITH_PEP64]: Don't read + data_start. Use above macros to read fields that are 64 bit wide for + COFF_WITH_PEP64. Don't truncate entry and text_start to 32 bits. + (_bfd_pei_swap_aouthdr_out) [PEI_FORCE_MINIMUM_ALIGNMENT]: Force + FileAlignment and SectionAlignment to minimum alignment if they + are zero. + (_bfd_pei_swap_aouthdr_out) [PEI_DEFAULT_TARGET_SUBSYSTEM]: Set + Subsystem to default PEI_DEFAULT_TARGET_SUBSYSTEM. + (_bfd_pei_swap_aouthdr_out) [COFF_WITH_PEP64]: Don't set data_start. + Use above macros to write fields that are 64 bit wide for + COFF_WITH_PEP64. + (pe_print_pdata): Set PDATA_ROW_SIZE to 3*8 for COFF_WITH_PEP64, + 5*4 otherwise. This should be right for IA-32 and IA-64, but may + be wrong for platforms. Use PDATA_ROW_SIZE instead of hardcoded + value of 20 bytes. Modify printing for COFF_WITH_PEP64 to print + begin address, end address, and unwind info address only. Use + GET_PDATA_ENTRY() to read .pdata entries. Use fprintf_vma() to + print addresses. + (tbl): Add SECTION, REL32, RESERVED1, MIPS_JMPADDR16, DIR64, and + HIGH3ADJ relocation names. + (_bfd_pe_print_private_bfd_data): Print Subsystem name in legible form. + * targets.c: Declare bfd_efi_app_ia32_vec and + bfd_efi_app_ia64_vec. + (bfd_target_vector): Mention bfd_efi_app_ia32_vec and + bfd_efi_app_ia64_vec. + +2000-04-17 Timothy Wall + + * bfd-in2.h: Add prototypes for tic54x load page access. + * bfd-in.h: Regenerate. + * coff-tic54x.c: Add load page functions; allow bfd_arch_unknown + in customized _set_arch_mach function. + * coffcode.h (coff_set_alignment_hook): Set section load page if + the appropriate macro is defined. + (write_object_contents): Read section load page. + +2000-04-13 Alan Modra + + * elf32-hppa.h: Update copyright date. + + * elf32-fr30.c (fr30_elf_i20_reloc): Don't use U suffix. + * elf32-mips.c (_bfd_mips_elf_relocate_section): And here. + + * elf32-d30v.c (MAX32): Don't use LL suffix. + (MIN32): Define in terms of MAX32. + (bfd_elf_d30v_reloc): Make relocation a bfd_signed_vma. + + * coff-a29k.c (SIGN_EXTEND_HWORD): Replace with more concise + expression. + + * peicode.h (pe_ILF_build_a_bfd): Remove UL from hex constants. + +2000-04-12 Alan Modra + + * dep-in.sed: Match space before file name, not after. + * Makefile.am: Regenerate dependencies. + * Makefile.in: Regenerate. + + * reloc.c (_bfd_relocate_contents): In complain_overflow_bitfield + case, allow address wrap-around stupidly removed 2000-03-17. Sign + extend without an if statement. + +2000-04-11 Alan Modra + + * coff-mips.c (mips_gprel_reloc): Test for 16 bit range using + signed quantites. + * elf32-mips.c (gprel16_with_gp): Likewise. + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Test range + here using -0x40000, not (int)0xfffc0000. + (elf32_hppa_size_of_stub): Likewise. + +2000-04-11 Timothy Wall + + * coff-tic54x.c: Now builds with all targets. + * Makefile.am: Add coff/tic54x.h to coff-tic54x.o dependencies. + * Makefile.in: Regenerate. + * coffcode.h (coff_set_arch_mach_hook): Eliminate warning on + unitialized variable. + +2000-04-07 Andrew Cagney + + * configure.in (WARN_CFLAGS): Set to -W -Wall by default. Add + --enable-build-warnings option. + * Makefile.am (AM_CFLAGS, WARN_CFLAGS): Add definitions. + * Makefile.in, configure: Re-generate. + +2000-04-07 Nick Clifton + + * reloc.c: Add BFD_RELOC_ARM_PCREL_BLX and + BFD_RELOC_THUMB_PCREL_BLX. + + * elf32-arm.h (elf32_arm_final_link_relocate): Handle + R_ARM_XPC25 and R_ARM_THM_PC22. + + * elfarm-nabi.c (elf32_arm_howto_): Fix definitions of + R_ARM_XPC25 and R_ARM_THM_XPC22. + (elf32_arm_reloc_map): Make BFD_RELOC_{ARM|THUMB}_PCREL_BLX to + R_ARM_[XPC25|THM_XPC22]. + + * elfarm-oabi.c: Define OLD_ARM_ABI and change include from + elf/arm-oabi.h to elf/arm.h + + * Makefile.am: Fix dependency for elfarm-oabi.c + * Makefile.in: Regenerate. + + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2000-04-06 Michael Snyder + + * elfcore.h (elf_core_file_p): preserve value of tdata at entry, + and restore it on failure. Release newly allocated tdata on + failure. + +2000-04-07 Jim Wilson + + * dwarf2.c (struct dwarf2_debug): New field dwarf_line_size. + (decode_line_info): Set it. Report error if unit->line_offset is + equal to or larger than it. + +2000-04-07 Timothy Wall + + * targets.c: Added vecs for tic54x. + * reloc.c: Added relocs for tic54x. + * libbfd.h: Regenerated. + * configure: Add TI COFF vecs for tic54x. + * configure.in: Ditto. + * config.bfd (targ_cpu): Recognize new tic54x target. + * coffcode.h (coff_slurp_symbol_table): Additions for TI COFF handling. + * bfd-in2.h: Add tic54x target and relocations. + * Makefile.am, Makefile.in: Add tic54x target. + * archures.c (bfd_archures_list): Add tic54x target. + * coff-tic54x.c: New. + * cpu-tic54x.c: New. + +2000-04-06 Michael Snyder + + * elfcore.h (elf_core_file_p): call backend_object_p which + thereby gets an opportunity to update the arch/machine type. + +2000-04-06 Timothy Wall + + * coffcode.h (coff_slurp_symbol_table): Handle C_STATLAB storage + class. Handle SEC_CLINK and SEC_BLOCK flags. + * section.c: Add SEC_CLINK and SEC_BLOCK flags. + * bfd-in2.h: Add SEC_CLINK and SEC_BLOCK flags. + +2000-04-06 Nick Clifton + + * elf32-arm.h (elf32_arm_set_private_flags): Only check for + EF_INTERWORK if this is an unknown EABI. + (elf32_arm_merge_private_bfd_data): Check EABI version + numbers. Only check EF_xxx flags if the EABI version number + is unknown. + (elf32_arm_check_private_bfd_data): Only check EF_xxx flags + if the EABI version number is unknown. + (elf32_arm_print_private_bfd_data): Only decode EF_xxx flags + if the EABI version number is unknown. + +2000-04-05 J"orn Rennecke + + * reloc.c (_bfd_relocate_contents): Add BFD_RELOC_SH_LOOP_START and + BFD_RELOC_SH_LOOP_END. + * elf32-sh.c (sh_elf_howto_tab): Change special_func to + sh_elf_ignore_reloc for all entries that sh_elf_reloc used to ignore. + Add entries for R_SH_LOOP_START and R_SH_LOOP_END. + (sh_elf_reloc_loop): New function. + (sh_elf_reloc): No need to test for always-to-be-ignored relocs + any more. + (sh_rel): Add entries for BFD_RELOC_SH_LOOP_{START,END}. + (sh_elf_relocate_section): Handle BFD_RELOC_SH_LOOP_{START,END}. + * bfd-in2.h, libbfd.h: Regenerate. + +2000-04-04 Alan Modra + + * po/bfd.pot: Regenerate. + + * Makefile.am: Remove extraneous mkdep comment. + (MKDEP): Use gcc -MM rather than mkdep. + (DEP): Quote when passing vars to sub-make. Add warning + message to end. + (DEP1): Rewrite for "gcc -MM". + (CLEANFILES): Add DEP2. + Update dependencies. + * Makefile.in: Regenerate. + +2000-04-03 Kevin Buettner + + * configure.in: Added corefile support for AIX 4.3. In particular, + AIX_CORE_DUMPX_CORE will be defined in addition to AIX_CORE when + compiling rs6000-core.c. + * configure: Regenerated. + +2000-04-03 H.J. Lu + + * cache.c (bfd_open_file): Unlink the output file only if + it has non-zero size. + +2000-04-01 Ken Block USG + + * elf64-alpha.c (elf64_alpha_relocate_section): Don't emit + relative relocations for non-loaded sections in shared objects. + (elf64_alpha_check_relocs): Similarly. + +2000-04-03 Hans-Peter Nilsson + + * aoutx.h (NAME(aout,reloc_type_lookup)): Add BFD_RELOC_8 and + BFD_RELOC_16 to switch for extended relocs. + (MY_swap_ext_reloc_in): New. + (MY_swap_ext_reloc_out): New. + (NAME(aout,slurp_reloc_table)): Use MY_swap_ext_reloc_in rather + than NAME(aout,swap_ext_reloc_in) for extended relocs. + (NAME(aout,squirt_out_relocs)): Similarly use + MY_swap_ext_reloc_out. + (aout_link_reloc_link_order): Use MY_put_ext_reloc if defined. + +2000-04-03 Kazu Hirata + + * coff-h8300.c (h8300_reloc16_extra_cases): Add bsr:16 -> bsr:8 to + the R_PCRWORD_B case. + +2000-03-31 Thomas de Lellis + + * srec.c : Set CHUNK size to 16 bytes to prevent download failures + on some targets. + * ihex.c : Ditto. + +2000-03-30 Donald Lindsay + + * elf32-m32r.c (m32r_elf_generic_reloc): new function. All + HOWTO references to bfd_elf_generic_reloc, that have + partial_inplace == true, now use the new function. The function + is based on the recent rewrite of m32r_elf_lo16_reloc(), and + extends its fixes to the R_M32R_{16,24,32} relocs. + The new logic in m32r_elf_lo16_reloc() has been removed, and + it instead calls the new routine to obtain that functionality. + +2000-03-27 Alan Modra + + * elf32-avr.c (elf32_avr_gc_mark_hook, elf32_avr_gc_sweep_hook, + elf32_avr_check_relocs, avr_final_link_relocate, + elf32_avr_relocate_section, bfd_elf_avr_final_write_processing, + elf32_avr_object_p): Add prototypes. + (elf32_avr_gc_mark_hook): Add default for h->root.type. + (bfd_elf_avr_final_write_processing): Make static. + +2000-03-27 Denis Chertykov + + * cpu-avr.c: New file. BFD support routines for AVR architecture. + * archures.c (bfd_architecture): Add AVR architecture. + (bfd_archures_list): Add reference to AVR architecture info. + * elf.c (prep_headers): Handle bfd_arch_avr. + * reloc.c: Add various AVR relocation enums. + * targets.c (bfd_elf32_avr_vec): Declare and add to target vector + list. + * Makefile.am: Add support for AVR elf. + * configure.in: Likewise. + * config.bfd: Likewise. + * Makefile.in: Regenerate. + * configure: This too. + * bfd-in2.h: And this. + * libbfd.h: And this. + +2000-03-24 H.J. Lu + + * elf64-alpha.c (elf64_alpha_merge_ind_symbols): Add prototype. + (elf64_alpha_find_reloc_at_ofs): Likewise. + +2000-03-17 Alan Modra + + * reloc.c (bfd_check_overflow): In case complain_overflow_bitfield, + flag an overflow if the bitfield is outside -2**n to 2**n-1. The + allowable range used to be -2**(n-1) to 2**n-1. + * reloc.c (_bfd_relocate_contents): Same here. Also replace + "boolean overflow" with "bfd_reloc_status_type flag". + +2000-03-14 Doug Evans + + * elf32-m32r.c (m32r_elf_lo16_reloc): Rewrite. + +2000-03-14 Kazu Hirata + + * reloc16.c (bfd_coff_reloc16_relax_section): Count the total number + of shrinks properly, including the last reloc. + +2000-03-13 Kazu Hirata + + * coff-h8300.c (h8300_reloc16_extra_cases): Fix the sanity + check for R_MOVL2. + +2000-03-11 Alan Modra + + * ieee.c (ieee_archive_p): Return bfd_error_wrong_format on + a format mismatch rather than an "error" from bfd_read such as + bfd_error_file_truncated. + +2000-03-10 Geoff Keating + + * elf32-mips.c (_bfd_mips_elf_relocate_section): Do proper + sign-extension and big-endian compensation for + R_MIPS_64 even in ld -r. + +2000-03-10 Geoffrey Keating + + * elf32-mips.c (mips_elf_next_relocation): Rename from + mips_elf_next_lo16_relocation, and generalize to look + for any relocation type. + (elf_mips_howto_table): Make R_MIPS_PC16 pcrel_offset. + (elf_mips_gnu_rel_hi16): Howto for R_MIPS_GNU_REL_HI16. + (elf_mips_gnu_rel_lo16): Howto for R_MIPS_GNU_REL_LO16. + (elf_mips_gnu_rel16_s2): Howto for R_MIPS_GNU_REL16_S2. + (elf_mips_gnu_pcrel64): Howto for R_MIPS_PC64. + (elf_mips_gnu_pcrel32): Howto for R_MIPS_PC32. + (bfd_elf32_bfd_reloc_type_lookup): Add new relocs. + (mips_rtype_to_howto): Likewise. + (mips_elf_calculate_relocation): Handle new relocs. + (_bfd_mips_elf_relocate_section): REL_HI16/REL_LO16 relocs + are paired. The addend for R_MIPS_GNU_REL16_S2 + is shifted right two bits. + +2000-03-10 Alan Modra + + * reloc.c (bfd_perform_relocation): Undo emacs formatting of + comment, and ensure it doesn't happen again. + (bfd_install_relocation): Same here. + (_bfd_relocate_contents): Don't bother assigning unused signmask + shift result. Fix typos in comments. + Remove trailing whitespace throughout file. + +2000-03-07 Doug Evans + + * reloc.c (reloc_howto_struct): Fix partial_inplace comment. + * bfd-in2.h: Rebuild. + +2000-03-06 Nick Clifton + + * peicode.h (struct pe_ILF_vars): Add sym_ptr_table and + sym_ptr_ptr fields. + (SIZEOF_ILF_SYM_PTR_TABLE): Define. + (SIZEOF_ILF_STRINGS): Redefine. + (pe_ILF_make_a_symbol-reloc): New function. Creates a symbol + relative reloc, as opposed to a section relative reloc. + (pe_ILF_make_a_symbol): Set the class of local symbols to C_STAT + not C_LABEL. + Add length of symbol's prefix to string pointer. + Store a pointer to the symbol in the symbol pointer table. + (pe_ILF_build_a_bfd): Do not build .idata$2 or .idata$7. + Initialise the symbol pointer table. + Store the hint in the Hint/Name table. + Make the jump reloc be symbol realtive, not section relative. + Create an import symbol for imported code. + +2000-03-06 Catherine Moore + + * elf.c (swap_out_syms): Check for null type_ptr. + +2000-03-01 Hans-Peter Nilsson + + * aout-target.h (MY(write_object_contents)): Remove unused + and unusable "#if CHOOSE_RELOC_SIZE". + * pc532-mach.c (MY(write_object_contents)): Ditto. + * netbsd.h (MY(write_object_contents)): Ditto. + * hp300hpux.c (MY(write_object_contents)): Ditto. + * freebsd.h (MY(write_object_contents)): Ditto. + * aout-tic30.c (tic30_aout_write_object_contents): Ditto. + +2000-02-29 H.J. Lu + + * peicode.h (jtab): Make it static. + + * coff-sh.c (sh_align_load_span): Declared if COFF_WITH_PE is + defined and COFF_IMAGE_WITH_PE is not defined. + (_bfd_sh_align_load_span): Defined as sh_align_load_span if + COFF_WITH_PE is defined and COFF_IMAGE_WITH_PE is not defined. + +2000-03-01 Nick Clifton + + * coff-arm.c (bfd_arm_process_before_allocation): Make + 'symndx' signed to prevent compile time warning. + + * coff-mcore.c: Remove unused prototype for pe_object_p. + + * coff-sh.c: Add "#ifndef COFF_IMAGE_WITH_PE" around static + functions that are not used when COFF_IMAGE_WITH_PE is + defined. + (struct sh_opcode): Change type of 'flags' field to unsigned + long so that it can hold the USESAS flag. + + * coffcode.h (styp_to_sec_flags): Initialise 'target_name'. + + * elf-m10300.c (mn10300_elf_relax_section): Initialise + 'sym_sec'. + + * elf32-i370.c: Add ATTRIBUTE_UNUSED to unused function + parameters. + Remove unusued variables and code. + (elf_backend_add_symbol_hook): Fix prototype. + + * elf32-m68k.c (elf_m68k_gc_sweep_hook): Initialise 'sgot' and + 'srelgot'. + + * elf32-mcore.c (mcore_elf_relocate_section): Initialise + 'oldinst'. + + * elf32-mips.c: Add ATTRIBUTE_UNUSED to unused function + parameters. + Remove unusued variables and code. + (elf_backend_add_symbol_hook): Fix prototype. + + * elf32-sh.c (sh_elf_set_mach_from_flags): Use 'flags'. + + * elflink.h (elf_bfd_link_add_symbols): Add ATTRIBUTE_UNUSED + to unused function parameter. + + * pe-mips.c: Add ATTRIBUTE_UNUSED to unused function + parameters. + Use EMPTY_HOWTO to initialise empty howto slots. + Remove unused variables. + + * peicode.h (pe_ILF_build_a_bfd): Initialise id6. + +2000-03-01 H.J. Lu + + * aoutx.h (aout_link_input_section_std): Pass "true" to + the undefined_symbol callback. + (aout_link_input_section_ext): Likewise. + * bout.c (get_value): Likewise. + * coff-a29k.c (coff_a29k_relocate_section): Likewise. + * coff-alpha.c (alpha_ecoff_get_relocated_section_conten): + Likewise. + (alpha_relocate_section): Likewise. + * coff-arm.c (coff_arm_relocate_section): Likewise. + * coff-i960.c (coff_i960_relocate_section): Likewise. + * coff-mcore.c (coff_mcore_relocate_section): Likewise. + * coff-mips.c (mips_relocate_section): Likewise. + * coff-ppc.c (coff_ppc_relocate_section): Likewise. + * coff-sh.c (sh_relocate_section): Likewise. + * coff-tic80.c (coff_tic80_relocate_section): Likewise. + * cofflink.c (_bfd_coff_generic_relocate_section): Likewise. + * elf-m10200.c (mn10200_elf_relocate_section): Likewise. + * elf-m10300.c (mn10300_elf_relocate_section): Likewise. + * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. + * elf32-fr30.c (fr30_elf_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section): Likewise. + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise. + * elflink.h (elf_link_output_extsym): Likewise. + * pe-mips.c (coff_pe_mips_relocate_section): Likewise. + * reloc.c (bfd_generic_get_relocated_section_conten): Likewise. + * reloc16.c (_bfd_ppc_xcoff_relocate_section): Likewise. + + * elf-hppa.h (elf_hppa_relocate_section): Pass "false" to the + undefined_symbol callback when building shared library with + -Bsymbolic and undefined symbols are allowed. Otherwise, pass + "true". + * elf32-arm.h (elf32_arm_relocate_section): Likewise. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mips.c (mips_elf_calculate_relocation): Likewise. + (elf32_mips_get_relocated_section_content): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + +2000-02-28 Nick Clifton + + * Makefile.am: Add rules to build pe[i]-{sh|mips}.lo objects. + * Makefile.in: Regenerate. + + * configure.in: Add support for mips and sh pe vectors. + * configure: regenerate. + + * config.bfd: Add support for arm-wince, mips-pe and sh-pe + targets. + + * targets.c: Add mips and sh pe vectors. + + * libpei.h (coff_final_link_postscript): Only define if not + already defined. + + * coffcode.h: Add support for WinCE magic numbers. + + * peigen.c (pe_print_reloc): Update comment and rearrange + appending of newline character. + + * peicode.h: Add support for Image Library Format. + (pe_ILF_vars): Structure containing data used by ILF code. + (pe_ILF_make_a_section): New function. Create a section based + on ILF data. + (pe_ILF_make_a_reloc): New function. Create a reloc based on + ILF data. + (pe_ILF_make_a_symbol): New function. Create a symbol based + on ILF data. + (pe_ILF_save_relocs): New function. Store the relocs created + by pe_ILF_make_a_reloc in a section. + (pe_ILF_build_a_bfd): New function. Create a BFD describing + an ILF object. + (pe_ILF_object_p): New function. Return a bfd_target pointer + for an ILF object. + (pe_bfd_object_p): If an ILF object is detected call + pe_ILF_object_p on it. + + * coff-arm.c: Add support for WinCE relocs which are different + from normal ARM COFF relocs. + * pe-arm.c: Unset TARGET_UNDERSCORE for a WinCE target. + + * coff-sh.c: Add support for sh-pe target. + * pe-sh.c: New file. Support code for sh-pe target. + * pei-sh.c: New file. Support code for sh-pe target. + + * pe-mips.c: New file. Support code for mips-pe target. + * pei-mips.c: New file. Support code for mips-pe target. + +2000-02-27 Jakub Jelinek + + * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Don't bump + architecture if the object causing the bump is dynamic. + * elf64-sparc.c (sparc64_elf_merge_private_bfd_data): Likewise, + and also don't it for memory ordering. + (sparc64_elf_write_relocs): Take src_rela out of the loop. + +2000-02-27 Ian Lance Taylor + + * dwarf2.c (read_abbrevs): Use _raw_size directly rather than + calling bfd_get_section_size_before_reloc. + (decode_line_info): Likewise. + (_bfd_dwarf2_find_nearest_line): Likewise. + +2000-02-27 Eli Zaretskii + + * Makefile.am (stamp-lib): Use $(LIBTOOL) --config to get the + name of the libtool directory. + * Makefile.in: Rebuild. + +2000-02-25 Rodney Brown (RodneyBrown@pmsc.com) + + * som.c (SOM_HOWTO): Define. + (som_hppa_howto_table): Use it. + +2000-02-25 Alexandre Oliva + + * config.bfd: Enable 64 bit support for GNU/Linux/sparc. + + * config.bfd: Enable 64 bit support for Solaris7+/sparc. + +2000-02-24 Catherine Moore + + * som.c (som_misc_symbol_info): Add field + secondary_def. + (som_bfd_derive_misc_symbol_info): Initialize + secondary_def. + (som_build_and_write_symbol_table): Keep track + of secondary_def field. + (som_slurp_symbol_table): Set BSF_WEAK symbol flag + if secondary_def field is set. + (som_bfd_ar_write_symbol_stuff): Initialize + secondary_def. + +2000-02-23 Stephane Carrez + + * dwarf2.c (read_address): Read 16-bits addresses. + (parse_comp_unit): Accept addr_size == 2. + +2000-02-23 Alan Modra + + * bfd-in.h: Update copyright date. + +2000-02-23 Linas Vepstas + + * cpu-i370.c: New file. + * elf32-i370.c: New file. + * archures.c (enum bfd_architecture): Add bfd_arch_i370. + (bfd_i370_arch): New. + (bfd_archures_list): Add bfd_i370_arch. + * elf.c (prep_headers): Add bfd_arch_i370. + * Makefile.am: Add support for IBM 370 elf. + * config.bfd: Likewise. + * configure.in: Likewise. + * libbfd.h (bfd_reloc_code_real_names): Likewise. + * reloc.c (bfd_reloc_code_type): Likewise. + * targets.c: Likewise. + + * Makefile.in: Regenerate. + * configure: Regenerate. + * bfd-in2.h: Regenerate. + +2000-02-22 Ian Lance Taylor + + * elf32-i386.c (elf_i386_info_to_howto_rel): Give a warning for + invalid relocation types, and change them to R_386_NONE. + +2000-02-22 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): If a version symbol is + not defined, don't add a second ELF_VER_CHR. + + * elflink.h (elf_bfd_final_link): Call output_extsym for global + symbols converted to local symbols even when stripping all + symbols. + (elf_link_output_extsym): Process global symbols converted to + local symbols even if they are being stripped. + +2000-02-21 Alan Modra + + * archures.c (bfd_octets_per_byte): Return unsigned int. + (bfd_arch_mach_octets_per_byte): Ditto. + * libbfd.c (bfd_read, bfd_seek): Quell signed vs. unsigned + comparison warning. + * section.c (bfd_get_section_size_before_reloc): Quell signed + vs. unsigned comparison warning. + (bfd_get_section_size_after_reloc): Same here. Fix parentheses too. + * trad-core.c (trad_unix_core_file_p): Correct 2000-01-27 + change. What was I thinking? + * bfd-in2.h: Regenerate. + + * elflink.h (elf_gc_sweep): Skip non-elf input bfds. + (elf_gc_sections): Same here. + (elf_gc_common_finalize_got_offsets): And here. + +2000-02-21 Ian Lance Taylor + + ELF HPPA doesn't work at present; remove it until it does. + * config.bfd: Comment out setting targ_defvec to + bfd_elf32_hppa_vec. + * Makefile.am: Rebuild dependencies. + (BFD32_BACKENDS): Remove elf32-hppa.lo. + (BFD32_BACKENDS_CFILES): Remove elf32-hppa.c. + (SOURCE_HFILES): Remove elf32-hppa.h and hppa_stubs.h. + * Makefile.in: Rebuild. + * targets.c (bfd_target_vector): Comment out bfd_elf32_hppa_vec. + +2000-02-18 Geoff Keating + + * coffcode.h (coff_set_arch_mach_hook): Use free(), because there + is no bfd_free(). Revert bfd_free part of previous change. + +2000-02-18 Geoff Keating + + * coffcode.h (coff_set_arch_mach_hook): Don't use variable-size + arrays. + (coff_compute_section_file_positions): Use bfd_free to pair + bfd_malloc. + (coff_write_object_contents): Likewise. + + * coff-rs6000.c (xcoff_howto_table_16): New variable. + (xcoff_rtype2howto): Handle 16-bit variants of 32-bit relocs. + +2000-02-18 Ulrich Drepper + + * coff-rs6000.c (XCOFFARMAGBIG): New macro. + (xcoff_ar_file_hdr_big): New structure. + (SIZEOF_AR_FILE_HDR_BIG): New macro. + (xcoff_ar_hdr_big): New structure. + (SIZEOF_AR_HDR_BIG): New macro. + (xcoff_big_format_p): New macro. + (xcoff_ardata_big): New macro. + (arch_xhdr_big): New macro. + (xcoff_slurp_armap): Handle large archives. + (xcoff_archive_p): Detect large archives. + (xcoff_read_ar_hdr): Handle large archives. + (xcoff_openr_next_archived_file): Handle large archives. + (xcoff_generic_stat_arch_elt): Handle large archives. + (xcoff_write_armap_old): Rename from xcoff_write_armap. + (xcoff_write_armap_big): New function. + (xcoff_write_armap): New function, dispatch to _old or _big. + (xcoff_write_archive_contents_old): Rename from + xcoff_write_archive_contents. + (xcoff_write_archive_contents_big): New function. + (xcoff_write_archive_contents): New function, dispatch to _old or + _big. + +2000-02-18 Richard Henderson + + * elf-bfd.h (struct elf_link_hash_table): Remove copy_indirect + and hide_symbol members. + (elf_link_hash_copy_indirect): Remove. + (elf_link_hash_hide_symbol): Remove. + (struct elf_backend_data): Add elf_backend_copy_indirect_symbol + and elf_backend_hide_symbol. + (_bfd_elf_link_hash_copy_indirect): Declare. + (_bfd_elf_link_hash_hide_symbol): Declare. + * elf.c (_bfd_elf_link_hash_copy_indirect): Remove table argument. + (_bfd_elf_link_hash_hide_symbol): Likewise. + (_bfd_elf_link_hash_table_init): Don't init killed members. + * elflink.h (elf_link_add_object_symbols): Use the bed function + pointers not elf_link_hash_{copy_indirect,hide_symbol}. + (elf_link_assign_sym_version): Likewise. + * elfxx-target.h (elf_backend_copy_indirect_symbol): Default. + (elf_backend_hide_symbol): Likewise. + (elfNN_bed): Update for new members. + +2000-02-17 Kevin Buettner + + * rs6000-core.c (CORE_DATA_SIZE_FIELD, CORE_COMM_FIELD, SAVE_FIELD, + STACK_END_ADDR): Define for new core file format. + (LOADER_OFFSET_FIELD, LOADER_REGION_SIZE, CORE_DUMP): New defines + for handling the vagaries of the various core file structures used + by AIX over the years. + (rs6000coff_core_p, rs6000coff_core_file_matches_executable, + Rs6kCorData): Use above defines to adapt code to use AIX 4.3's + core_dumpx structure. + +2000-02-17 J"orn Rennecke + + * archures.c (bfd_mach_sh2, bfd_mach_sh_dsp): New macros. + (bfd_mach_sh3_dsp): Likewise. + (bfd_mach_sh4): Reinstate. + (bfd_default_scan): Recognize 7410, 7708, 7729 and 7750. + * bfd-in2.h: Regenerate. + * coff-sh.c (struct sh_opcode): flags is no longer short. + (USESAS, USESAS_REG, USESR8, SETSAS, SETSAS_REG): New macros. + (sh_opcode41, sh_opcode42): Integrate as sh_opcode41. + (sh_opcode01, sh_opcode02, sh_opcode40): Add sh-dsp opcodes. + (sh_opcode41, sh_opcode4, sh_opcode80): Likewise. + (sh_opcodes): No longer const. + (sh_dsp_opcodef0, sh_dsp_opcodef): New arrays. + (sh_insn_uses_reg): Check for USESAS and USESR8. + (sh_insn_sets_reg, sh_insns_conflict): Check for SETSAS. + (_bfd_sh_align_load_span): Return early for SH4. + Modify sh_opcodes lookup table for sh-dsp / sh3-dsp. + Take into account that field b of a parallel processing insn + could be mistaken for a separate insn. + * cpu-sh.c (arch_info_struct): New array elements for + sh2, sh-dsp and sh3-dsp. + Reinstate element for sh4. + (SH2_NEXT, SH_DSP_NEXT, SH3_DSP_NEXT): New macros. + (SH4_NEXT): Reinstate. + (SH3_NEXT, SH3E_NEXT): Adjust. + * elf-bfd.h (_sh_elf_set_mach_from_flags): Declare. + * elf32-sh.c (sh_elf_set_private_flags): New function. + (sh_elf_copy_private_data, sh_elf_set_mach_from_flags): Likewise. + (sh_elf_merge_private_data): New function. + (elf_backend_object_p, bfd_elf32_bfd_set_private_bfd_flags): Define. + (bfd_elf32_bfd_copy_private_bfd_data): Define. + (bfd_elf32_bfd_merge_private_bfd_data): Change to + sh_elf_merge_private_data. + +2000-02-13 Richard Henderson + + * elf-bfd.h (struct elf_link_hash_table): Add copy_indirect and + hide_symbol members. + (elf_link_hash_copy_indirect): New. + (elf_link_hash_hide_symbol): New. + * elflink.h (elf_link_add_object_symbols): Break out copy from + indirect new new symbol to elf.c. + (elf_link_assign_sym_version): Break out privatization of + non-exported symbol to elf.c. + * elf.c (_bfd_elf_link_hash_copy_indirect): New. + (_bfd_elf_link_hash_hide_symbol): New. + (_bfd_elf_link_hash_table_init): Init copy_indirect and hide_symbol. + +2000-02-13 Ian Lance Taylor + + * section.c (_bfd_strip_section_from_output): Add info parameter. + If it passed as non-NULL, use it to check whether any input BFD + has an input section which uses this output section. Change all + callers. + * bfd-in2.h: Rebuild. + + * bfd-in.h: Move declarations of bfd_get_elf_phdr_upper_bound and + bfd_get_elf_phdrs in from bfd-in2.h, correcting patch of + 1999-11-29. + * bfd-in2.h: Rebuild. + +2000-02-10 Timothy Wall + + * coffswap.h (coff_swap_sym_in): Add hook SWAP_SYM_IN_POST to + allow final modifications of swapped-in symbol. + (coff_swap_sym_out): Ditto with SWAP_SYM_OUT_POST. + * coffcode.h (coff_write_relocs): Use macro + SECTION_RELATIVE_ABSOLUTE_SYMBOL_P if defined to determine whether + symbol index should be set to -1. + +2000-02-10 Toshiyasu Morita (toshi.morita@sega.com) + + * coff-sh.c (USES1_REG, USES2_REG, SETS1_REG, SETS2_REG, + USESF1_REG, USESF2_REG, SETSF1_REG, SETSF2_REG): New macros. + * (sh_insn_sets_reg, sh_insn_sets_freg): New prototypes. + * (sh_insn_sets_reg, sh_insn_uses_or_sets_reg, sh_insns_sets_freg, + sh_insns_uses_or_sets_freg): New functions. + * (sh_insn_uses_reg, sh_insn_uses_freg): Use new macros. + * (sh_insns_conflict): Use new functions and new macros to + detect conflicts when two instructions both set same integer registers, + both set same fp register, and both set special register. + +2000-02-09 Timothy Wall + + * coffgen.c (coff_real_object_p): Set arch/mach info prior to + swapping in sections, so that the swapping routines have access to + the arch/mach info. + +2000-02-08 Mark Elbrecht + + * coff-go32.c: Update comment. Update copyright. + +2000-01-27 Thomas de Lellis + + * syms.c (bfd_decode_symclass) + Two new class characters were added - 'V' and 'v'. The + meaning of 'W' is now restricted to just weak non-object + symbols. This allows differentiation between, for example, + weak functions vs weak objects. nm for example now dumps: + 'W' = weak global + 'w' = weak unresolved + 'V' = weak global object + 'v' = weak unresolved object + + (bfd_is_undefined_symclass): New function. Return true if the + given symbol class represents and undefined/unresolved symbol. + + (bfd_symbol_info): Use bfd_is_undefined_symclass to check for + unresolved symbols. + + * bfd-in2.h: Add prototype for bfd_is_undefined_symbol(). + + * elf32-arm.h (elf32_arm_get_symbol_type): If a symbol has the + STT_ARM_16BIT flag set, but it is not attached to a data object + return STT_ARM_16BIT so that it will be treated as code by the + disassembler. + +2000-01-27 Alan Modra + + * coff-i386.c (i3coff_object_p): Remove prototype. + Update copyright. + + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Add const + to name. Update copyright. + + * trad-core.c (trad_unix_core_file_p): Cast core_regsec + assignment to avoid warning. Update copyright. + +2000-01-24 Robert Lipe (robertl@sco.com) + + * coffcode.h (coff_write_object_contents): Get buff via bfd_malloc + instead of using GNU C extension. + +2000-01-21 Nick Clifton + + * libbfd.c (bfd_read): Do not attempt to get a negativly sized + amount from a bfd_in_memory structure. + (bfd_seek): Do not allow seeks past the end of a bfd_in_memory + structure. + +2000-01-14 Nick Clifton + + * linker.c (default_indirect_link_order): oops - fix incorrectly + applied patch from Tim Wall. + +2000-01-13 Timothy Wall (twall@tiac.net> + + * coffcode.h: Use bfd_coff_xxx instead of the macro XXX (where xxx + = scnhsz, filhsz, relsz, aoutsz, etc) + + * coffswap.h: Ditto. + +2000-01-13 Nick Clifton + + * elf32-arm.h (elf32_thumb_to_arm_stub): Fix offset in branch to + interwork thumb to arm stub. + +2000-01-13 Timothy Wall (twall@tiac.net> + + * archures.c (bfd_octets_per_byte): New function: Return + target byte size. + (bfd_arch_mach_octets_per_byte): New function: Return target + byte size. + + * section.c: Distinguish between octets and bytes for usage of + _cooked_size, _raw_size, and output_offset. Clarify + description of bfd_set_section_contents. + + * bfd-in2.h: Regenerate. + + * coffgen.c: Indicate that the offset parameter is in bytes, not + octets. + + * cofflink.c (bfd_coff_link_input_bfd): Use bfd_octets_per_byte + where appropriate to get the octet offset when calling + bfd_set_section_contents. + (bfd_coff_reloc_link_order): Ditto. + + * linker.c (bfd_generic_reloc_link_order): Ditto. + (_bfd_default_link_order): Ditto. + + * reloc.c (bfd_perform_relocation): Distinguish between octets + and bytes. Use octets when indexing into octet data; use bytes + when calculating target addresses. + (bfd_install_relocation): Ditto. + + * srec.c (srec_write_section): Ditto. + +2000-01-13 Nick Clifton + + * coff-mcore.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): Change from + 3 to 2. This allows 4 byte sized sections, which is necessary for + dlltool to build functioning DLLs. + +2000-01-10 Philip Blundell + + * config.bfd (arm*-*-linux-gnu*): Match instead of arm*-*-linux-gnu. + (arm*-*-conix*): New target. + +2000-01-10 Egor Duda + + * config.bfd: Include elf32_i386 vector to target list for cygwin + and mingw. + + * config.in: Undefine HAVE_WIN32_PSTATUS_T. + * configure.in: Test for structure win32_pstatus_t in + + * configure: Regenerate. + + * elf.c (elfcore_grok_win32pstatus): New function: process + win32_pstatus_t notes in elf core file. + (elfcore_grok_note): Detect win32_pstatus notes. + +2000-01-03 Martin v. Loewis + + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Process symbol + visibility. + * elflink.h (elf_link_add_object_symbols): Combine visibilities. + * elf.c (bfd_elf_print_symbol): Interpret st_other as visibility. + +For older changes see ChangeLog-9899 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-0203 sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-0203 --- sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-0203 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-0203 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,11405 @@ +2003-12-19 Kazuhiro Inaoka + + Adfd m32r-linux and PIC support. Add new ABI that uses RELA. + * config.bfd (m32r*-*-linux*, m32r*le-*-linux*, m32r*le-*-*): Added. + * configure.in (bfd_elf32_m32rlin_vec, bfd_elf32_m32rlelin_vec, + bfd_elf32_m32rle_vec): Added + * configure: Regenerated. + * elf32-m32r.c (m32r_info_to_howto, m32r_elf_adjust_dynamic_symbol, + m32r_elf_size_dynamic_sections, m32r_elf_create_dynamic_sections, + m32r_elf_finish_dynamic_sections, m32r_elf_finish_dynamic_symbol, + allocate_dynrelocs, readonly_dynrelocs, m32r_elf_reloc_type_class, + m32r_elf_fake_sections): Added. + (m32r_elf_howto_table): Added + R_M32R_16_RELA, R_M32R_32_RELA, R_M32R_24_RELA, + R_M32R_10_PCREL_RELA, R_M32R_18_PCREL_RELA, + R_M32R_26_PCREL_RELA, R_M32R_HI16_ULO_RELA, + R_M32R_HI16_SLO_RELA, R_M32R_LO16_RELA, + R_M32R_SDA16_RELA, R_M32R_RELA_GNU_VTINHERIT, + R_M32R_RELA_GNU_VTENTRY, R_M32R_GOT24, + R_M32R_26_PLTREL, R_M32R_COPY, R_M32R_GLOB_DAT, + R_M32R_JMP_SLOT, R_M32R_RELATIVE, R_M32R_GOTOFF, + R_M32R_GOTPC24, R_M32R_GOT16_HI_ULO, + R_M32R_GOT16_HI_SLO, R_M32R_GOT16_LO, + R_M32R_GOTPC_HI_ULO, R_M32R_GOTPC_HI_SLO, + R_M32R_GOTPC_LO. + (m32r_elf_relocate_section, m32r_elf_check_relocs): Changed for + New ABI. + * reloc.c: Add BFD_RELOC_M32R_GOT24, BFD_RELOC_M32R_26_PLTREL, + BFD_RELOC_M32R_COPY, BFD_RELOC_M32R_GLOB_DAT, + BFD_RELOC_M32R_JMP_SLOT, BFD_RELOC_M32R_RELATIVE, + BFD_RELOC_M32R_GOTOFF, BFD_RELOC_M32R_GOTPC24, + BFD_RELOC_M32R_GOT16_HI_ULO, BFD_RELOC_M32R_GOT16_HI_SLO, + BFD_RELOC_M32R_GOT16_LO, BFD_RELOC_M32R_GOTPC_HI_ULO, + BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO. + * targets.c (bfd_elf32_m32rlin_vec, bfd_elf32_m32rlelin_vec, + bfd_elf32_m32rle_vec): Added. + * bfd-in2.h: Regenerated. + * libbfd.h: Regenerated. + +2003-12-19 Danny Smith + + * coffcode.h (styp_to_sec_flags): Don't treat .reloc section + as SEC_DEBUGGING. + +2003-12-18 Richard Sandiford + + * elf32-mips.c (elf_mips_howto_table_rel): Replace all uses of + mips_elf_generic_reloc with _bfd_mips_elf_generic_reloc. Use + _bfd_mips_elf_hi16_reloc for R_MIPS_HI16 and R_MIPS_GNU_REL_HI16, + _bfd_mips_elf_lo16_reloc for R_MIPS_LO16 and R_MIPS_GNU_REL_LO16, + and _bfd_mips_elf_got16_reloc for R_MIPS_GOT16. Change rightshift + to 16 for R_MIPS_HI16 and R_MIPS_GNU_REL_HI16. + (mips_elf_generic_reloc, struct mips_hi16, mips_elf_hi16_reloc) + (mips_elf_lo16_reloc, mips_elf_got16_reloc): Delete. + (_bfd_mips_elf32_gprel16_reloc): Remove special case. + (mips_elf_gprel32_reloc, mips32_64bit_reloc): Likewise. + + * elf64-mips.c (mips_elf64_howto_table_rel): Replace all uses of + mips_elf_generic_reloc with _bfd_mips_elf_generic_reloc. Use + _bfd_mips_elf_hi16_reloc for R_MIPS_HI16, _bfd_mips_elf_lo16_reloc + for R_MIPS_LO16 and _bfd_mips_elf_got16_reloc for R_MIPS_GOT16. + Change R_MIPS_HI16's rightshift to 16. + (mips_elf64_howto_table_rela): Replace all uses of + mips_elf_generic_reloc with _bfd_mips_elf_generic_reloc. + Use _bfd_mips_elf_generic_reloc for R_MIPS_GOT16 as well. + (mips_elf64_hi16_reloc, mips_elf64_got16_reloc): Delete. + (mips_elf64_shift6_reloc): Remove special case. Use + _bfd_mips_elf_generic_reloc instead of returning bfd_reloc_continue. + + * elfn32-mips.c (prev_reloc_section): Delete. + (prev_reloc_address, prev_reloc_addend): Delete. + (elf_mips_howto_table_rel, elf_mips_howto_table_rela): As for + elf64-mips.c + (GET_RELOC_ADDEND, SET_RELOC_ADDEND): Delete. + (mips_elf_generic_reloc, struct mips_hi16, mips_elf_hi16_reloc) + (mips_elf_lo16_reloc, mips_elf_got16_reloc): Delete. + (mips_elf_gprel16_reloc): Delete use of GET_RELOC_ADDEND. + (mips_elf_literal_reloc, mips_elf_gprel32_reloc): Likewise. + (mips16_jump_reloc, mips16_gprel_reloc): Likewise. + (mips_elf_shift6_reloc): Likewise. Delete use of SET_RELOC_ADDEND. + + * elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp): Use + _bfd_relocate_contents to install an in-place addend. + (mips_hi16): New structure. + (mips_hi16_list): Moved from elf32-mips.c. + (_bfd_mips_elf_hi16_reloc, _bfd_mips_elf_got16_reloc): New functions. + (_bfd_mips_elf_lo16_reloc, _bfd_mips_elf_generic_reloc): New functions. + (mips_elf_calculate_relocation): Assume addend is unshifted. + (_bfd_mips_elf_relocate_section): Don't apply the howto rightshift + on top of the usual high-part shift. Don't shift the addend right + before calling mips_elf_calculate_relocation. + + * elfxx-mips.h (_bfd_mips_elf_hi16_reloc): Declare. + (_bfd_mips_elf_got16_reloc, _bfd_mips_elf_lo16_reloc): Declare. + (_bfd_mips_elf_generic_reloc): Declare. + +2003-12-16 Eric Youngdale + Nick Clifton + + * peicode.h (pe_ILF_build_a_bfd): Only skip one instance of each + prefix character, if they are present. + +2003-12-15 Dmitry Semyonov + Nick Clifton + + * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Ensure that correct flags + are set on known section types. + +2003-12-12 Nick Clifton + + * po/ro.po: Updated translation. + +2003-12-12 Alan Modra + + * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Check for + NULL dyn_h. + +2003-12-11 Nick Clifton + + * elf.c (INCLUDE_SECTION_IN_SEGMENT): Skip PT_GNU_STACK segments. + +2003-12-08 Richard Sandiford + + * elfxx-mips.h, elfxx-mips.c, cpu-mips.c: Convert prototypes. + Remove casts that were only needed for K&R compatibility. + +2003-12-08 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Remove "bfd *" and add + "elflink_hash_entry *" param to elf_backend_link_output_symbol_hook. + Add "elflink_hash_entry *" param to elf_backend_output_arch_syms. + * elflink.h (elf_link_output_sym): Add "elflink_hash_entry *" param, + and pass to output_symbol_hook. + (elf_bfd_final_link): Adjust elf_link_output_sym calls. + (elf_link_output_extsym): Likewise. + (elf_link_input_bfd): Likewise. + * elf32-sh64.c (sh64_elf_link_output_symbol_hook): Adjust. + * elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise. + * elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise. + * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise. + * elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise. + * elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise. + * elf64-sparc.c (sparc64_elf_output_arch_syms): Likewise. + * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise. + Validate dynh->h against h. + * elf64-ppc.c (struct ppc_link_hash_entry): Add adjust_done bitfield. + (link_hash_newfunc): Init it. + (adjust_opd_syms): New function. + (ppc64_elf_edit_opd): Set adjust_done when global .opd sym adjusted. + Set opd.adjust for all .opd relocs. Call adjust_opd_syms. + (ppc64_elf_tls_optimize): Adjust possible .opd sym values here. + (ppc64_elf_relocate_section): Also adjust syms not a multiple of 24. + (ppc64_elf_output_symbol_hook): New function. + (elf_backend_link_output_symbol_hook): Define. + +2003-12-07 Richard Sandiford + + * elf32-mips.c, elfn32-mips.c, elf64-mips.c: Convert prototypes. + Remove casts that were only needed for K&R compatibility. + +2003-12-05 Dmitry Semyonov + + * coff-arm.c (aoutarm_std_reloc_howto [ARM_WINCE]): Set + partial_inplace for these relocs to FALSE for comptability with + the MS linker. + Remap ARM_26D relocation from 5 to 0. This fixes "bad fixup" error + generated by MS linker, and brings the relocation in line the MS + PE documentation. + +2003-12-04 H.J. Lu + + * elf32-ppc.c (ppc_elf_relax_section): Don't check relax_finalizing. + +2003-12-04 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_section): Use the + need_relax_finalize field in link_info instead of + relax_finalizing to check if the relax finalize pass is being + done. + +2003-12-04 Dmitry Semyonov + + * coff-arm.c (coff_arm_relocate_section, bfd_arm_process_before_allocation): + Change ARM26* to ARM_26* in comments to match definitions. + (coff_arm_adjust_symndx): Replace hard-coded constants with + appropriate definitions (ARM_26*). + +2003-12-04 Alan Modra + + * coff-i860.c (coff_i860_reloc_nyi): Return bfd_reloc_not_supported. + * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Warning fixes. + (mn10300_elf_relax_section): Likewise. + * nlm32-alpha.c (ONES): Define. + (nlm32_alpha_howto_table): Use it to avoid warnings. + +2003-12-04 Alan Modra + + * elf32-i386.c (elf_i386_object_p): Delete. + (elf_backend_object_p): Don't define. + * elf32-s390.c (elf_s390_object_p): No need to alloc tdata here. + * elf32-sh.c (sh_elf_object_p): Likewise. + * elf32-sparc.c (elf32_sparc_object_p): Likewise. + * elf64-alpha.c (elf64_alpha_object_p): Likewise. + * elf64-s390.c (elf_s390_object_p): Likewise. + * elf64-x86-64.c (elf64_x86_64_elf_object_p): Likewise. + +2003-12-03 Kazuhiro Inaoka + + * archures.c (bfd_mach_m32r2): Add new machine type. + * bfd-in2.h: Regenerate. + * cpu-m32r.c : Add new machine type. + * elf32-m32r.c (m32r_elf_object_p, m32r_elf_final_write_processing, + m32r_elf_merge_private_bfd_data): Add support for new machine + type. + +2003-12-03 Dave Airlie + + * config.bfd: Add vax-linux-gnu target. + * configure.in: Likewise. + * configure: Regenerate. + +2003-12-03 Alan Modra + + * ecoff.c (ecoff_link_add_archive_symbols): Update for renamed + bfd_link_hash_entry field "next" -> "und_next". + * linker.c (_bfd_link_hash_newfunc): Likewise. + (bfd_link_add_undef): Likewise. + (_bfd_generic_link_add_archive_symbols): Likewise. + (_bfd_generic_link_add_one_symbol): Likewise. + * xcofflink.c (xcoff_link_add_symbols): Likewise. + +2003-12-02 Nick Clifton + + * configure.in (ALL_LINGUAS): Add ro. + * po/ro.po: New Romanian translation. + +2003-12-02 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2003-12-01 Dmitry Semyonov + + * coffcode.h (coff_compute_section_file_positions): Set page_size + to 1 instead of 0 in the case file alignment value is zero. + +2003-12-01 Kazu Hirata + + * coff-rs6000.c: Remove ARGSUSED and VARARGS. + * coff64-rs6000.c: Likewise. + * coffcode.h: Likewise. + * elf32-vax.c: Likewise. + * hash.c: Likewise. + * hppabsd-core.c: Likewise. + * hpux-core.c: Likewise. + * ihex.c: Likewise. + * netbsd-core.c: Likewise. + * osf-core.c: Likewise. + * pdp11.c: Likewise. + * ptrace-core.c: Likewise. + * sco5-core.c: Likewise. + * section.c: Likewise. + * sunos.c: Likewise. + * trad-core.c: Likewise. + +2003-12-01 Alan Modra + + * elf-bfd.h (is_elf_hash_table): Take hash tab rather than info arg. + * elf.c (_bfd_elf_merge_sections): Adjust to suit. + (_bfd_elf_link_just_syms): Likewise. + (bfd_elf_get_needed_list): Likewise. + (bfd_elf_get_runpath_list): Likewise. + (_bfd_elf_link_hash_copy_indirect): Remove unneeded parens. + * elf32-hppa.c (elf32_hppa_setup_section_lists): Don't check hash tab + creator flavour. + (elf32_hppa_set_gp): Look up output sections rather than using htab. + * elf32-i960.c: Comment fix. Formatting. + * elf32-m32r.c (m32r_elf_add_symbol_hook): Use is_elf_hash_table + rather than testing creator flavour. + * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise. + * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise. + * elflink.c (_bfd_elf_link_create_dynamic_sections): Adjust for + is_elf_hash_table change. Remove redundant test. + (bfd_elf_record_link_assignment): Use is_elf_hash_table rather than + testing creator flavour. + (elf_link_record_local_dynamic_symbol): Adjust for is_elf_hash_table. + (_bfd_elf_fix_symbol_flags): Likewise. + (_bfd_elf_adjust_dynamic_symbol): Likewise. + * elflink.h (elf_link_add_object_symbols): Likewise. Remove redundant + checks. Use is_elf_hash_table rather than testing creator flavour. + Use hash_table throughout in place of info->hash. + (elf_add_dynamic_entry): Adjust for is_elf_hash_table change. + (NAME(bfd_elf,size_dynamic_sections)): Likewise. Remove redundant + check. + (elf_bfd_final_link): Adjust for is_elf_hash_table change. + (elf_link_check_versioned_symbol): Use is_elf_hash_table rather than + testing creator flavour. + (elf_gc_sections): Add is_elf_hash_table check. + (elf_gc_common_finalize_got_offsets): Likewise. + (elf_bfd_discard_info): Adjust for is_elf_hash_table change. Remove + redundant check. + * elfxx-ia64.c (elfNN_ia64_relax_section): Use is_elf_hash_table + rather than testing creator flavour. + +2003-11-28 Christian Groessler + + * cpu-z8k.c: Convert to ISO C90. + * coff-z8k.c: Likewise. + +2003-11-27 Alexandre Oliva + + * elf-bfd.h (elf_backend_data::elf_backend_modify_segment_map): + Add link info argument. + * elf32-i370.c (elf_backend_modify_segment_map): Likewise. + * elf32-ppc.c (ppc_elf_modify_segment_map): Likewise. + * elf32-xtensa.c (elf_xtensa_modify_segment_map): Likewise. + * elf64-hppa.c (elf64_hppa_modify_segment_map): Likewise. + * elfxx-ia64.c (elfNN_ia64_modify_segment_map): Likewise. + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Likewise. + * elfxx-mips.h (_bfd_mips_elf_modify_segment_map): Likewise. + * elf.c (assign_file_positions_except_relocs, + assign_file_positions_for_segments): Likewise. Adjust calls. + +2003-11-27 Mark Kettenis + + * elf.c (elfcore_grok_netbsd_procinfo): Make a pseudosection out + of the note. + +2003-11-26 Daniel Jacobowitz + Richard Sandiford + + * elfxx-mips.c (mips_elf_set_global_got_offset): Don't set no_fn_stub. + (mips_elf_set_no_stub): New function. + (mips_elf_multi_got): Call it. + (_bfd_mips_elf_finish_dynamic_symbol): If a relocation is needed for + a secondary GOT entry, create an R_MIPS_32 or R_MIPS_64 relocation and + use mips_elf_create_dynamic_relocation to deal with any compatibility + issues. Store the adjusted addend in the GOT slot. + +2003-11-25 Mattias Engdegrd + + * stabs.c (_bfd_link_section_stabs): Skip N_EXCL stabs when + procesing N_BINCL stabs. + +2003-11-25 Alan Modra + + * elf64-ppc.c (ppc_type_of_stub): Disallow stubs other than + ppc_stub_plt_call to symbols defined in shared libs. + +2003-11-22 Jakub Jelinek + + * elf-bfd.h (ELF_LINK_POINTER_EQUALITY_NEEDED): Define new flag. + * elf.c (_bfd_elf_link_hash_copy_indirect): Copy it. + * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. + (elf_i386_check_relocs): Set it. + (elf_i386_finish_dynamic_symbol): If it is not set, + clear st_value of SHN_UNDEF symbol. + +2003-11-20 Jim Blandy + + * cpu-powerpc.c (powerpc_compatible): Any ISA in the PowerPC + family is a superset of . + +2003-11-20 Martin Schwidefsky + + * elf32-s390.c (elf_s390_relocate_section): Don't recalculate symbol + section for reloc output and subtract the output section's address + from the addend when converting a relocation into one against a + section symbol. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + +2003-11-18 James E Wilson + + * elfxx-ia64.c (get_fptr): For fptr_rel, use dynobj not abfd. + (elfNN_ia64_size_dynamic_sections): When stripping sections, check + for ia64_info->rel_fptr_sec. + +2003-11-18 Alan Modra + + * elf64-ppc.c (toc_adjusting_stub_needed): Exit early if section + size is zero. + +2003-11-17 Daniel Jacobowitz + + * elf.c (_bfd_elf_link_hash_copy_indirect): Copy + ELF_LINK_HASH_NEEDS_PLT. Fix formatting. + * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise. + * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. + * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Likewise. + * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise. + * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. + * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise. + * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise. + * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise. + * elf32-xtensa.c (elf_xtensa_copy_indirect_symbol): Remove. + (elf_backend_copy_indirect_symbol): Don't define. + +2003-11-14 Daniel Jacobowitz + + * elfxx-mips.c (mips_elf_merge_gots): Weaken assert for local + GOT entries. + +2003-11-13 Martin Schwidefsky + + * elf32-s390.c (elf_s390_relocate_section): Only convert R_390_32 + to R_390_RELATIVE. Convert the other relocations against local + symbols to relocations against the start of the section. + * elf64-s390.c (elf_s390_relocate_section): Only convert R_390_64 + to R_390_RELATIVE. Convert the other relocations against local + symbols to relocations against the start of the section. + +2003-11-11 Nick Clifton + + * elf-m10300.c (bfd_mn10300_elf_size_dynamic_sections): Use + info->executable not info->shared to decide if a .interp section + should be present. + * elf32-arm.h (elf32_arm_size_dynamic_sections): Likewise. + * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise. + * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. + * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise. + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. + * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. + * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Likewise. + * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. + * elfxx-mips.c (_bfd_mips_size_dynamic_sections): Likewise. + * elflink.h (size_dynamic_sections): Likewise. + +2003-11-10 Jonathan Wilson + + * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Swap out tls pointer. + (_bfd_XXi_final_link_postscript): Look for __tks_used symbol. If + found initialise the tls data directory entry. + +2003-11-07 Alan Modra + + * elf32-ppc.c (ppc_elf_install_value): Delete. + (shared_stub_entry, stub_entry): Make them arrays of ints. + Remove initial branch. + (ppc_elf_relax_section): Write one branch around all trampolines + instead. Correct bogus R_PPC_PLTREL24 handling. Correct + branch range check. Only use shared_stub_entry when shared. + Test that branches can reach stubs. Write trampolines out at + end so that just one realloc is used. Handle little-endian + mode. Move relevant code from ppc_elf_install_value to here. + (ppc_elf_relocate_section): Move code handling RELAX32 from + ppc_elf_install_value to here. + +2003-11-06 Alan Modra + + * elf32-ppc.c (ppc_elf_howto_raw); Add entry for R_PPC_RELAX32PC. + (ppc_elf_install_value): Handle R_PPC_RELAX32PC. Merge duplicate + cases. + (shared_stub_entry): Correct opcode. + (ppc_elf_relax_section): Generate R_PPC_RELAX32PC relocs. + (ppc_elf_relocate_section): Handle them. + +2003-11-05 Alan Modra + + * elf.c (_bfd_elf_rela_local_sym): Accept asection **, and return + updated section in case of merged section. + * elf-bfd.h (_bfd_elf_rela_local_sym): Update declaration. + * elf-hppa.h (elf_hppa_relocate_section): Adjust call. + * elf-m10200.c (mn10200_elf_relocate_section): Likewise. + * elf-m10300.c (mn10300_elf_relocate_section): Likewise. + * elf32-arm.h (elf32_arm_relocate_section): Likewise. + * elf32-avr.c (elf32_avr_relocate_section): Likewise. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-fr30.c (fr30_elf_relocate_section): Likewise. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-h8300.c (elf32_h8_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-i860.c (elf32_i860_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. + * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section) Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. + * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-mmix.c (mmix_elf_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + + * elf32-cris.c (cris_elf_relocate_section): Don't recalculate symbol + section for reloc output. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + + * elf32-ppc.c (ppc_elf_relocate_section): Don't recalculate everything + for R_PPC_RELAX32 reloc. Don't bother checking ppc_elf_install_value + return value. + * elf64-ppc.c (ppc64_elf_relocate_section ): Sanity check + sec->id. + +2003-11-05 Alan Modra + + * elf32-d10v.c (extract_rel_addend, insert_rel_addend): New functions. + (elf32_d10v_relocate_section): Use them to handle -r reloc + adjustments, and in place of _bfd_elf_rela_local_sym. + + * cpu-iq2000.c (arch_info_struct): Warning fix. + +2003-11-05 Alan Modra + + * elf32-hppa.c (ELIMINATE_COPY_RELOCS): Define. + (elf32_hppa_copy_indirect_symbol): Don't copy NON_GOT_REF on + weakdefs. + (elf32_hppa_check_relocs): Use ELIMINATE_COPY_RELOCS. + (elf32_hppa_adjust_dynamic_symbol): Likewise. Copy weakdef + NON_GOT_REF. + (allocate_dynrelocs): Use ELIMINATE_COPY_RELOCS and + SYMBOL_CALLS_LOCAL. Discard relocs for undef weak syms with + non-default visibility. + (elf32_hppa_relocate_section): Use ELIMINATE_COPY_RELOCS and + SYMBOL_CALLS_LOCAL. + +2003-11-04 Alan Modra + + * aout-target.h, aoutf1.h, bfdio.c, bfdwin.c: Update copyright date. + * coff-apollo.c, coff-sparc.c, coff-w65.c, coff-we32k.c: Ditto. + * coff-z8k.c, coffgen.c, cpu-frv.c, cpu-h8500.c, cpu-hppa.c: Ditto. + * cpu-ia64-opc.c, cpu-m10300.c, cpu-mips.c, cpu-msp430.c: Ditto. + * cpu-rs6000.c, cpu-z8k.c, efi-app-ia32.c, elf32-am33lin.c: Ditto. + * gen-aout.c, hash.c, hp300hpux.c, init.c, mach-o.c: Ditto. + * nlm-target.h, nlm.c, som.h, stabs.c, sysdep.h, xsym.h: Ditto. + + * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Fix + "dereferencing type-punned pointer" warnings. + + * aout-adobe.c (aout_adobe_set_section_contents): Constify location. + * aoutx.h (NAME(aout,set_section_contents)): Ditto. + * bfd-in2.h: Regenerate. + * binary.c (binary_set_section_contents): Ditto. + * bout.c (b_out_set_section_contents): Ditto. + * coff-tic54x.c (tic54x_set_section_contents): Ditto. + * coffcode.h (coff_set_section_contents): Ditto. + * ecoff.c (_bfd_ecoff_set_section_contents): Ditto. + * elf-bfd.h (_bfd_elf_set_section_contents): Ditto. + * elf.c (_bfd_elf_set_section_contents): Ditto. + * elfxx-mips.c (_bfd_mips_elf_set_section_contents): Ditto. + * elfxx-mips.h (_bfd_mips_elf_set_section_contents): Ditto. + * i386msdos.c (msdos_set_section_contents): Ditto. + * ieee.c (ieee_set_section_contents): Ditto. + * ihex.c (ihex_set_section_contents): Ditto. + * libaout.h (NAME(aout,set_section_contents)): Ditto. + * libbfd-in.h (_bfd_nowrite_set_section_contents): Ditto. + (_bfd_generic_set_section_contents): Ditto. + * libbfd.h: Regenerate. + * libbfd.c (_bfd_generic_set_section_contents): Ditto. + * libecoff.h (_bfd_ecoff_set_section_contents): Ditto. + * libnlm.h (nlmNAME(set_section_contents)): Ditto. + (struct nlm_backend_data ): Ditto. + * mmo.c (mmo_set_section_contents): Ditto. + * nlm32-alpha.c (nlm_alpha_mangle_relocs): Ditto. + * nlm32-i386.c (nlm_i386_mangle_relocs): Ditto. + * nlm32-ppc.c (nlm_powerpc_mangle_relocs): Ditto. + * nlm32-sparc.c (nlm_sparc_mangle_relocs): Ditto. + * nlmcode.h (nlm_set_section_contents): Ditto. + * oasys.c (oasys_set_section_contents): Ditto. + * pdp11.c (NAME(aout,set_section_contents)): Ditto. + * ppcboot.c (ppcboot_set_section_contents): Ditto. + * srec.c (srec_set_section_contents): Ditto. + * targets.c (BFD_JUMP_TABLE_WRITE <_bfd_set_section_contents>): Ditto. + * tekhex.c (tekhex_set_section_contents): Ditto. + (move_section_contents): Ditto. + * versados.c (versados_set_section_contents): Ditto. + * vms-misc.c (_bfd_save_vms_section): Ditto. + * vms.c (vms_set_section_contents): Ditto. + * vms.h (_bfd_save_vms_section): Ditto. + +2003-11-04 Alan Modra + + * elf64-ppc.c (ppc_size_one_stub): Size relbrlt. Accept info arg + rather than htab. + (ppc64_elf_size_stubs): Adjust ppc_size_one_stub traversal. Zero + relbrlt size. + (ppc64_elf_build_stubs): Allocate space for relbrlt. + +2003-11-04 Alan Modra + + * bfd-in.h (_bfd_elf_tls_setup): Declare. + * bfd-in2.h: Regenerate. + * elf-bfd.h (struct elf_link_tls_segment): Delete. + (struct elf_link_hash_table): Add tls_sec and tls_size. + * elf.c (_bfd_elf_link_hash_table_init): Init tls_sec and tls_size. + * elflink.c (_bfd_elf_tls_setup): New function. + * elflink.h (struct elf_final_link_info): Remove first_tls_sec. + (elf_bfd_final_link): Don't set first_tls_sec here. Update code + saving tls segment info, round segment size up. + (elf_link_output_extsym): Adjust code using tls segment info. + (elf_link_input_bfd): Likewise. + * elf32-i386.c (dtpoff_base, tpoff): Likewise. + * elf32-s390.c (dtpoff_base, tpoff): Likewise. + * elf32-sh.c (dtpoff_base, tpoff): Likewise. + * elf32-sparc.c (dtpoff_base, tpoff): Likewise. + * elf64-s390.c (dtpoff_base, tpoff): Likewise. + * elf64-x86-64.c (dtpoff_base, tpoff): Likewise. + * elfxx-ia64.c (elfNN_ia64_tprel_base): Likewise. + (elfNN_ia64_dtprel_base): Likewise. + * elf64-alpha.c (alpha_get_dtprel_base): Likewise. + (alpha_get_tprel_base): Likewise. + (struct alpha_relax_info): Remove tls_segment. + (elf64_alpha_relax_got_load): Adjust invocation of + alpha_get_dtprel_base and alpha_get_tprel_base. + (elf64_alpha_relax_tls_get_addr): Likewise. + (elf64_alpha_relax_section): Likewise. + (elf64_alpha_relocate_section): Likewise. + (elf64_alpha_relax_find_tls_segment): Delete. + * elf32-ppc.c (struct ppc_elf_link_hash_table): Remove tls_sec. + (ppc_elf_tls_setup): Call _bfd_elf_tls_setup. Return section. + (ppc_elf_relocate_section): Adjust to use elf.tls_sec. + * elf32-ppc.h (ppc_elf_tls_setup): Update. + * elf64-ppc.c (struct ppc_link_hash_table): Remove tls_sec. + (ppc64_elf_tls_setup): Call _bfd_elf_tls_setup. Return section. + (ppc64_elf_tls_optimize): Adjust to use elf.tls_sec. + (ppc64_elf_relocate_section): Likewise. + * elf64-ppc.h (ppc64_elf_tls_setup): Update. + +2003-11-03 Daniel Jacobowitz + + * elf-bfd.h (struct elf_backend_data): Remove plt_header_size. + * elf-m10300.c (elf_backend_plt_header_size): Don't define. + * elf32-arm.h (elf_backend_plt_header_size): Don't define. + * elf32-cris.c (elf_backend_plt_header_size): Don't define. + * elf32-i386.c (elf_backend_plt_header_size): Don't define. + * elf32-mips.c (elf_backend_plt_header_size): Don't define. + * elf32-ppc.c (elf_backend_plt_header_size): Don't define. + * elf32-s390.c (elf_backend_plt_header_size): Don't define. + * elf32-sh.c (elf_backend_plt_header_size): Don't define. + * elf32-sparc.c (elf_backend_plt_header_size): Don't define. + * elf64-alpha.c (elf_backend_plt_header_size): Don't define. + * elf64-hppa.c (elf_backend_plt_header_size): Don't define. + * elf64-mips.c (elf_backend_plt_header_size): Don't define. + * elf64-ppc.c (elf_backend_plt_header_size): Don't define. + * elf64-s390.c (elf_backend_plt_header_size): Don't define. + * elf64-sh64.c (elf_backend_plt_header_size): Don't define. + * elf64-sparc.c (elf_backend_plt_header_size): Don't define. + * elf64-x86-64.c (elf_backend_plt_header_size): Don't define. + * elfn32-mips.c (elf_backend_plt_header_size): Don't define. + * elfxx-ia64.c (elf_backend_plt_header_size): Don't define. + * elfxx-target.h (elf_backend_plt_header_size): Don't define + or include in target initializer. + +2003-11-03 Andrew Cagney + + * section.c (bfd_set_section_contents): Make the "location" buffer + constant. + * bfd-in2.h: Re-generate. + +2003-10-30 Andrew Cagney + + * syms.c: Replace "struct symbol_cache_entry" with "struct + bfd_symbol". + * vms.h, targets.c, section.c, reloc.c, peicode.h: Ditto. + * mipsbsd.c, elf.c, linker.c, elf-bfd.h, ecoff.c: Ditto. + * cpu-z8k.c, cpu-ns32k.c, cpu-h8500.c, bfd.c, bfd-in.h: Ditto. + * bfd-in2.h: Re-generate. + +2003-10-30 Jakub Jelinek + + * elfxx-ia64.c: Include objalloc.h, hashtab.h. + (struct elfNN_ia64_local_hash_entry): Remove root. Add id and r_sym + fields. + (struct elfNN_ia64_local_hash_table): Remove. + (struct elfNN_ia64_link_hash_table): Change loc_hash_table's type + to htab_t. Add loc_hash_memory field. + (elfNN_ia64_local_hash_table_init, elfNN_ia64_new_loc_hash_entry): + Removed. + (elfNN_ia64_local_htab_hash, elfNN_ia64_local_htab_eq): New + functions. + (elfNN_ia64_hash_table_create): Use hashtab.h hashtable for + loc_hash_table. Initialize loc_hash_memory. + (elfNN_ia64_hash_table_free): New function. + (elfNN_ia64_local_hash_lookup): Remove. + (elfNN_ia64_local_dyn_sym_thunk): Change into htab_traverse + callback. + (elfNN_ia64_dyn_sym_traverse): Use htab_traverse. + (get_local_sym_hash): Use hashtab.h hashtable for loc_hash_table. + (bfd_elfNN_bfd_link_hash_table_free): Define. + +2003-10-30 Alan Modra + + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Modify versioned + symbol string in place. + +2003-10-30 Jim Blandy + + * cpu-rs6000.c (rs6000_compatible): Check the correct arch_info + object's mach field: all PowerPC machines are supersets of the + original rs6000, but not later rs6000 machines. + +2003-10-30 Alan Modra + + * dwarf2.c (struct attribute): Delete "unsnd", "snd" and "addr". + Add "val" and "sval" fields. + (DW_STRING, DW_UNSND, DW_BLOCK, DW_SND, DW_ADDR): Delete. + (read_attribute_value): Expand and adjust DW_* occurrences. + (scan_unit_for_functions, parse_comp_unit): Likewise. + +2003-10-30 Phil Edwards + + * config.bfd (arm-*-vxworks): Remove separate stanza; merge with + other common ELF triples. + (i[3-7]86-*-vxworks): Change to ELF format. + (mips*-*-windiss): New triple, add to common MIPS/ELF stanza. + (sh-*-vxworks): New stanza. + +2003-10-30 Lars Knoll + Michael Matz + Jakub Jelinek + Alan Modra + + * merge.c (struct sec_merge_sec_info): Update comment. + (struct sec_merge_hash_entry): Remove entsize. + (sec_merge_hash_lookup): Only adjust alignment when creating. + (sec_merge_emit): Remove register keyword. + (cmplengthentry, last4_eq, last_eq): Delete. + (strrevcmp, strrevcmp_align, is_suffix): New. + (merge_strings): Use them to implement fast suffix merging. + * elf-strtab.c (struct elf_strtab_hash_entry): Update comments. + Make "len" signed. + (_bfd_elf_strtab_add): Lose on >2G strings. + (_bfd_elf_strtab_emit): Don't emit strings with len < 0. + (cmplengthentry, last4_eq): Delete. + (strrevcmp, is_suffix): New. + (_bfd_elf_strtab_finalize): Rework to implement fast suffix merging. + +2003-10-29 Daniel Jacobowitz + + * elf32-arm.h (elf32_arm_final_link_relocate): Move check for + SEC_ALLOC. + +2003-10-29 Philip Blundell + + * elf32-arm.h (elf32_arm_plt0_entry, elf32_arm_plt_entry): New + code sequence. + (PLT_HEADER_SIZE): New. + (struct elf32_arm_pcrel_relocs_copied): Rename to ... + (struct elf32_arm_relocs_copied): ... this. Count both + pcrel and non-pcrel relocs. All uses updated. + (struct elf32_arm_link_hash_table): Add pointers to dynamic linker + sections and symbol/section mapping cache. + (create_got_section): New. + (elf32_arm_create_dynamic_sections): New. + (elf_backend_create_dynamic_sections): Use it. + (elf32_arm_final_link_relocate): Support garbage collection of relocs. + (elf32_arm_check_relocs): Likewise. + (elf32_arm_adjust_dynamic_symbol): Likewise. + (elf32_arm_copy_indirect_symbol): New. + (elf32_arm_link_hash_table_create): Initialise new fields. + (elf32_arm_gc_sweep_hook): Implement. + (elf32_arm_discard_copies): Delete. + (elf32_arm_finish_dynamic_symbol): Use new PLT code. + (elf32_arm_finish_dynamic_sections): Likewise. + (elf_backend_can_refcount): Define. + (elf_backend_copy_indirect_symbol): Likewise. + (elf_backend_plt_header_size): Set to PLT_HEADER_SIZE. + +2003-10-29 Alan Modra + + * elf64-ppc.c (elf_backend_grok_prstatus): Define. + (elf_backend_grok_psinfo): Define. + (ppc64_elf_grok_prstatus, ppc64_elf_grok_psinfo): New functions. + + * elf.c (_bfd_elfcore_make_pseudosection): Allow multiple + sections with the same name. + (elfcore_grok_lwpstatus): Likewise. + (elfcore_grok_win32pstatus): Likewise. + (elfcore_grok_note): Likewise. + (elfcore_grok_nto_status): Likewise. + (elfcore_grok_nto_gregs): Likewise. + +2003-10-27 Daniel Jacobowitz + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Never skip dynamic + objects. + +2003-10-14 Richard Sandiford + + * elfxx-mips.c (mips_elf_create_got_section): Initialize global_gotno. + +2003-10-24 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Look up + hash table for real symbols. + +2003-10-23 Michael Snyder + + * section.c (asection): Fix typo in comment. + +2003-10-23 Alan Modra + + * elf64-ppc.c (get_tls_mask): Add toc_symndx param, save toc + reloc symbol index to it. Don't allow gd syms in shared libs + to be optimized. + (ppc64_elf_tls_optimize): Adjust get_tls_mask call. + (ppc64_elf_size_stubs): Likewise. + (ppc64_elf_relocate_section): Check that tls relocs are only used + with tls syms, and similarly for non-tls. Correct symbol used + when optimizing toc tls code. + +2003-10-22 Nick Clifton + + * peicode.h (coff_swap_scnhdr_in): Only remove padding when + processing an executable. + +2003-10-22 Jakub Jelinek + + * elflink.c (_bfd_elf_export_symbol): Adjust for globals and locals + field changes. + (_bfd_elf_link_assign_sym_version): Likewise. + * elflink.h (size_dynamic_sections): Likewise. + +2003-10-21 Alexandre Oliva , + Michael Snyder + + * archures.c (bfd_mach_sh4a, bfd_mach_sh4al_dsp, bfd_mach_sh4_nofpu, + bfd_mach_sh4a_nofpu): New machine types. + * bfd-in2.h: Rebuilt. + * cpu-sh.c (compatible): Remove unused function. + (SH4A_NEXT, SH4AL_DSP_NEXT, SH4_NOFPU_NEXT, SH4A_NOFPU_NEXT): New. + (arch_info_struct): Add sh4a, sh4al_dsp, sh4-nofpu and sh4a-nofpu. + * elf32-sh.c (sh_elf_set_mach_from_flags): Handle them. + +2003-10-21 Wouter van Heyst + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Correct text + describing mismatched formats involving the Maverick FP type. + +2003-10-21 Anil Paranjpe + + * binary.c (binary_object_p): Pass machine flag along with + architecture. + +2003-10-21 Thorsten Brehm + + * archures.c (bfd_default_scan): Add support for mcf528x. + * ieee.c (ieee_write_processor): Likewise. + +2003-10-21 Peter Barada + Bernardo Innocenti + + * archures.c: Add MCF528x (MCFv4) support. + * cpu-m68k.c (arch_info_struct): Likewise. + * bfd-in2.h: Regenerate. + +2003-10-20 Andrew Cagney + + * targets.c: Replace "struct sec" with "struct bfd_section" + * syms.c, sparclynx.c, section.c, opncls.c: Ditto. + * libcoff-in.h, libbfd-in.h, elfxx-target.h: Ditto. + * elf.c, coffgen.c, bfd.c, bfd-in.h, aoutf1.h: Ditto. + * aout-tic30.c, aout-target.h: + * bfd-in2.h, libcoff.h, libbfd.h: Regenerate. + +2003-10-18 Hans-Peter Nilsson + + Support linker relaxation of new R_MMIX_PUSHJ_STUBBABLE relocs. + * elf64-mmix.c (MAX_PUSHJ_STUB_SIZE): New macro. + (struct _mmix_elf_section_data): New member pjs. + (mmix_set_relaxable_size, mmix_elf_get_section_contents): New + functions. + (elf_mmix_howto_table): New entry for R_MMIX_PUSHJ_STUBBABLE. + (mmix_reloc_map): Ditto. + (mmix_elf_relocate_section): Handle R_MMIX_PUSHJ_STUBBABLE. + (mmix_final_link_relocate, mmix_elf_check_common_relocs): Ditto. + (mmix_elf_perform_relocation): Ditto. Don't mark parameter addr + unused. + (mmix_elf_check_relocs): Move early return to after + mmix_elf_check_common_relocs call. + (mmix_elf_symbol_processing): Fix cut-and-pasto in head comment. + (_bfd_mmix_before_linker_allocation): Rename from + _bfd_mmix_prepare_linker_allocated_gregs. All referers changed. + Arrange to set the initial relaxable size of sections. + (_bfd_mmix_after_linker_allocation): Rename from + _bfd_mmix_finalize_linker_allocated_gregs. + (mmix_elf_relax_section): Relax a R_MMIX_PUSHJ_STUBBABLE reloc. + (bfd_elf64_get_section_contents): Define. + * reloc.c: Add ENUMX for BFD_RELOC_MMIX_PUSHJ_STUBBABLE. + * libbfd.h, bfd-in2.h: Regenerate. + + * reloc.c (bfd_generic_relax_section): Default-set + section->_cooked_size here. + (bfd_generic_get_relocated_section_contents): Don't set it here. + Explain why. + +2003-10-17 John David Anglin + + * elf32-hppa.c (elf32_hppa_relocate_section): Skip relocation if + output section has been discarded. + +2003-10-17 Shrinivas Atre + + * coff-h8300.c (funcvec_hash_newfunc): Handle normal mode. + (h8300_reloc16_extra_cases): Likewise. + (h8300_bfd_link_add_symbols): Likewise. + +2003-10-17 Dhananjay Deshpande + + * cpu-h8300.c (h8300sxn_info_struct): Correct address size. + (h8300sn_info_struct): Likewise. + (h8300hn_info_struct): Likewise. + +2003-10-16 Pavel Roskin + + * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't calculate image size + for sections which lack size info. + +2003-10-17 Danny Smith + + * configure.host: Add __USE_MINGW_FSEEK to HDEFINES for + mingw32. + +2003-10-16 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Also warn + undefined patterns with '*'. + +2003-10-16 H.J. Lu + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't + use the last CIE from a different section. + (_bfd_elf_write_section_eh_frame): Don't pad beyond the raw + size of the output section. + +2003-10-07 Roland McGrath + + * elf.c (_bfd_elf_make_section_from_phdr): Set alignment_power of + new section from p_align header field. + +2003-10-16 H.J. Lu + + * elf32-xtensa.c (xtensa_read_table_entries): The external size + of entry is 8 bytes. + +2003-10-15 Andrew Cagney + + * targets.c (BFD_JUMP_TABLE_SYMBOLS): Replace NAME##_get_symtab + with NAME##_canonicalize_symtab. + * libcoff-in.h (coff_canonicalize_symtab): Update. + * xsym.h (bfd_sym_canonicalize_symtab): Update. + * elf-bfd.h (_bfd_elf_canonicalize_symtab): Update. + * coffgen.c (coff_canonicalize_symtab): Update. + * libbfd-in.h (_bfd_nosymbols_canonicalize_symtab): Update. + * libnlm.h (nlmNAME(canonicalize_symtab)): Update. + * ieee.c (ieee_vec): Update comment. + * libecoff.h (_bfd_ecoff_canonicalize_symtab): Update. + * mmo.c (mmo_canonicalize_symtab): Update. + * nlm-target.h (nlm_canonicalize_symtab): Update. + * nlmcode.h (nlm_canonicalize_symtab): Update. + * i386msdos.c (msdos_canonicalize_symtab): Update. + * hp300hpux.c (MY (canonicalize_symtab)): Update. + * oasys.c (oasys_canonicalize_symtab): Update. + * som.c (som_canonicalize_symtab): Update. + * pef.c (bfd_pef_canonicalize_symtab): Update. + * nlmcode.h (nlm_canonicalize_symtab): Update. + * xsym.c (bfd_sym_canonicalize_symtab): Update. + * vms.c (vms_canonicalize_symtab): Update. + * versados.c (versados_canonicalize_symtab): Update. + * mach-o.c (bfd_mach_o_canonicalize_symtab): Update. + * ieee.c (ieee_canonicalize_symtab): Update. + * pdp11.c (NAME(aout,canonicalize_symtab)): Update. + * reloc.c: Update comment. + * libaout.h (NAME(aout,canonicalize_symtab)): Update. + * coff64-rs6000.c (aix5coff64_vec): Update. + * coff64-rs6000.c (bfd_xcoff_aix5_backend_data): Update. + * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update. + * aoutx.h (NAME(aout,canonicalize_symtab)): Update. + * elfxx-target.h (bfd_elfNN_canonicalize_symtab): Update. + * hp300hpux.c (MY_canonicalize_symtab): Update. + * ecoff.c (_bfd_ecoff_canonicalize_symtab): Update. + * aout-tic30.c (MY_canonicalize_symtab): Update. + * aout-target.h (MY_canonicalize_symtab): Update. + * ppcboot.c (ppcboot_canonicalize_symtab): Update. + * elf.c (_bfd_elf_canonicalize_symtab): Update. + * elfcode.h (elf_canonicalize_symtab): Update. + * ihex.c (ihex_canonicalize_symtab): Update. + * tekhex.c (tekhex_canonicalize_symtab): Update. + * binary.c (binary_canonicalize_symtab): Update. + * srec.c (srec_canonicalize_symtab): Update. + +2003-10-15 Kazu Hirata + + * elf32-h8300.c (elf_reloc_map): Fix a comment typo. + +2003-10-15 Kaz Kojima + + * elf32-sh.c (sh_elf_relocate_section): Handle R_SH_IMM_*_PCREL + relocations. + (sh_elf_check_relocs): Likewise. + + * elf32-sh64.c (elf_backend_merge_symbol_attribute): Define. + (sh64_elf_merge_symbol_attribute): New. + * elf64-sh64.c (elf_backend_merge_symbol_attribute): Define. + (sh64_elf64_merge_symbol_attribute): New. + +2003-10-14 Kaz Kojima + + * elf-bfd.h (struct elf_backend_data): New function pointer member + elf_backend_merge_symbol_attribute. + * elflink.h (elf_link_add_object_symbols): Adjust call to + elf_backend_merge_symbol_attribute if the backend defined it. + * elfxx-target.h (elf_backend_merge_symbol_attribute): New macro. + (elfNN_bed): Add that to the initializer. + +2003-10-14 Bob Wilson + + * elf32-xtensa.c (get_is_linkonce_section): Delete. + (xtensa_is_property_section, xtensa_is_littable_section): Use + XTENSA_INSN_SEC_NAME and XTENSA_LIT_SEC_NAME macros. Do not recognize + linkonce sections containing ".xt.insn" and ".xt.lit" substrings. + (xtensa_get_property_section_name): Check section name instead of + calling get_is_linkonce_section. Remove unused bfd parameter. Use + XTENSA_INSN_SEC_NAME and XTENSA_LIT_SEC_NAME macros. Never generate + linkonce section names by appending ".xt.insn" or ".xt.lit". + (xtensa_read_table_entries): Remove bfd argument in call to + xtensa_get_property_section_name. Free section name when done. + (elf_xtensa_combine_prop_entries): Free leaking table. + +2003-10-13 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Don't add + DT_MIPS_LIBLIST or DT_MIPS_CONFLICT entries. + (_bfd_mips_elf_finish_dynamic_symbol): Don't handle them. Don't + handle DT_MIPS_MSYM. Set DT_RELSZ based on the number of relocations + that were needed. + (_bfd_mips_elf_modify_segment_map): Fix placement of PT_MIPS_OPTIONS. + (_bfd_mips_elf_merge_private_bfd_data): Ignore EF_MIPS_UCODE. + +2003-10-13 H.J. Lu + + * bfd-in.h (bfd_elf32_ia64_after_parse): New prototype. + (bfd_elf64_ia64_after_parse): Likewise. + * bfd-in2.h: Regenerated. + + * elfxx-ia64.c (oor_ip): New. + (oor_branch_size): Likewise. + (bfd_elfNN_ia64_after_parse): Likewise. + (elfNN_ia64_relax_section): Use oor_ip if oor_branch_size + equals sizeof (oor_ip). + +2003-10-12 Kaz Kojima + + * elf64-sh64.c (sh_elf64_relocate_section): Tidy up for the + renumbering of some relocation numbers. + +2003-10-11 Alan Modra + + * coff-sh.c: Move definition of MAP and guard more code with + COFF_IMAGE_WITH_PE. + + * section.c (bfd_get_section_size_before_reloc): Ignore reloc_done. + * bfd-in2.h: Regenerate. + +2003-10-10 H.J. Lu + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * doc/Makefile.in: Likewise. + +2003-10-09 H.J. Lu + + * cofflink.c: Include "safe-ctype.h". + (coff_link_add_symbols): Use ISDIGIT instead of isdigit. + +2003-10-08 Dave Brolley + On behalf of Michael Snyder + + * archures.c: Add FRV fr550 machine. + * cpu-frv.c: Ditto. + * elf32-frv.c: Ditto. + * bfd-in2.h: Regenerate. + +2003-10-08 Thiemo Seufer + + * elfxx-mips.c (STUB_MOVE,STUB_LI16): Fix stub code + for non-SGI N64 ABI. Improve code consitency. + +2003-10-07 Alexandre Oliva + + * elf32-frv.c (elf32_frv_howto_table): Set R_FRV_LABEL16's + rightshift to 2. + +2003-10-07 Nathan Sidwell + + * libbfd-in.h (_bfd_link_section_stabs): Add string offset + parameter. + * cofflink.c (coff_link_add_symbols): Deal with split stab + sections. + * elflink.h (elf_link_add_object_symbols): Deal with split stab + sections. + * stabs.c (_bfd_link_section_stabs): Add string offset parameter. + * libbfd.h: Regenerated. + + * coffcode.h (coff_set_alignment_hook): With PE_COFF reloc + overflow, set reloc start position to after the count + reloc. Subtract one from num relocs. Give error on 0xffff relocs + and no overflow. + * cofflink.c (_bfd_coff_final_link): Deal with PE_COFF reloc + overflow. + * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Do overflow if >= + 0xffff. + +2003-10-06 H.J. Lu + + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Pad the + last CIE/FDE if needed. + +2003-10-06 Nick Clifton + + * targets.c (_bfd_target_vector): Include bfd_elf64_sparc_vec if + BFD64 is enabled. + +2003-10-06 Matt Thomas + + * config.bfd: Move the hppa*-*-netbsd* case to the hppa*-*-linux* case. + +2003-10-06 Robert Millan + + * configure.in: Match GNU/KNetBSD with new knetbsd*-gnu triplet. + * config.bfd: Likewise. + * configure: Regenerate. + +2003-10-04 Christian Groessler + + * coff-z8k.c (extra_case): Fix displacement length check for R_JR + and R_CALLR. + +2003-10-04 Stephane Carrez + + * elf32-m68hc1x.c: Update to ISO C90; replace PTR with void*. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc12.c: Likewise. + * elf32-m68hc1x.h: Likewise. + +2003-10-04 Stephane Carrez + + * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Fix merge + of flags between HC12 and HCS12. + +2003-10-04 Bryce McKinlay + + * merge.c (_bfd_merge_sections): Set SEC_EXCLUDE flag on sections + which become empty after merging. + +2003-09-30 Jakub Jelinek + + * elfxx-ia64.c (ia64_howto_table): Fix size of R_IA64_TPREL64[LM]SB, + R_IA64_DTPREL{32,64}[LM]SB and R_IA64_DTPMOD64[LM]SB. + +2003-09-30 Chris Demetriou + + * archures.c (bfd_mach_mipsisa64r2): New define. + * bfd-in2.h: Regenerate. + * aoutx.h (NAME(aout,machine_type)): Handle bfd_mach_mipsisa64r2. + * cpu-mips.c (I_mipsisa64r2): New enum value. + (arch_info_struct): Add entry for I_mipsisa64r2. + * elfxx-mips.c (_bfd_elf_mips_mach) + (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_64R2. + (mips_set_isa_flags): Add bfd_mach_mipsisa64r2 case. + (mips_mach_extensions): Add entry for bfd_mach_mipsisa64r2. + +2003-09-29 H.J. Lu + + * elfxx-ia64.c (elfNN_hpux_backend_symbol_processing): New. + Handle SHN_IA_64_ANSI_COMMON. + (elf_backend_section_from_bfd_section): Defined. + +2003-09-26 H.J. Lu + + * elflink.c (elf_link_read_relocs_from_section): Add an argument + of a pointer to section. Check bad symbol index. + (_bfd_elf_link_read_relocs): Modify calls to + elf_link_read_relocs_from_section. + +2003-09-23 DJ Delorie + + * elf32-sh.c (sh_elf_howto_table): R_SH_SWITCH8, + R_SH_GNU_VTINHERIT, R_SH_GNU_VTENTRY, + R_SH_LOOP_START,R_SH_LOOP_END moved to "reserved" spaces, + R_SH_DIR16, R_SH_DIR8, R_SH_DIR8UL, R_SH_DIR8UW, R_SH_DIR8U, + R_SH_DIR8SW, R_SH_DIR8S, R_SH_DIR4UL, R_SH_DIR4UW, R_SH_DIR4U, + R_SH_PSHA, R_SH_PSHL added. + (sh_reloc_map): Add R_SH_DIR16 and R_SH_DIR8. + (sh_elf_relocate_section): Support new relocs. + +2003-09-23 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_relocate_section): Fix typo that clobbered + dynamic relocation offsets. + +2003-09-23 Alan Modra + + * simple.c (bfd_simple_get_relocated_section_contents): Free the + hash table using _bfd_generic_link_hash_table_free. + +2003-09-23 Alan Modra + + * elf-bfd.h (struct bfd_elf_special_section): Remove "suffix". Change + type of prefix_length and suffix_length to int. Rename "attributes" + to "attr". Comment. + (_bfd_elf_get_sec_type_attr): Update prototype. + * elf.c (get_special_section): Rewrite. + (_bfd_elf_get_sec_type_attr): Return struct rather than passing in + attr and type pointers. + (_bfd_elf_new_section_hook): Adjust for above. + (special_sections): Merge suffix with prefix. Set + prefix_length for all entries. Set suffix_length appropriately. + * elf32-m32r.c (m32r_elf_special_sections): Likewise. + * elf32-m68hc11.c (elf32_m68hc11_special_sections): Likewise. + * elf32-m68hc12.c (elf32_m68hc12_special_sections): Likewise. + * elf32-mcore.c (mcore_elf_special_sections): Likewise. + * elf32-sh64.c (sh64_elf_special_sections): Likewise. + * elf32-v850.c (v850_elf_special_sections): Likewise. + * elf32-xtensa.c (elf_xtensa_special_sections): Likewise. + * elf64-alpha.c (elf64_alpha_special_sections): Likewise. + * elf64-hppa.c (elf64_hppa_special_sections): Likewise. + * elf64-ppc.c (ppc64_elf_special_sections): Likewise. + * elf64-sh64.c (sh64_elf64_special_sections): Likewise. + * elfxx-ia64.c (elfNN_ia64_special_sections): Likewise. + * elfxx-mips.c (_bfd_mips_elf_special_sections): Likewise. + * elf32-ppc.c (ppc_elf_special_sections): Likewise. Fix .plt flags. + +2003-09-21 Daniel Jacobowitz + + * elf64-alpha.c (elf64_alpha_create_got_section): Initialize + ->got if the section already exists. + +2003-09-19 Nathan Sidwell + + * dwarf2.c (decode_line_info): Cope with an initially empty + filename table. + +2003-09-18 H.J. Lu + + * acinclude.m4: Include ../config/accross.m4. + * aclocal.m4: Regenerated. + + * configure.host (HOST_64BIT_TYPE): Remove if it is set to long + or long long. + (HOST_U_64BIT_TYPE): Remove if it is set to unsigned long long. + (host64): Remove if HOST_64BIT_TYPE is set to long. + + * configure.in (HOST_64BIT_TYPE): Set according to the size of + long and long long. + (HOST_U_64BIT_TYPE): Likewise. + (host64): Likewise. + * configure: Regenerated. + +2003-09-19 Alan Modra + + * elf.c (elfcore_write_note): Don't use sizeof(Elf_External_note) + since some ABIs round up the size of the struct. + +2003-09-18 H.J. Lu + + * elflink.c (_bfd_elf_merge_symbol): Allow type change if + the old symbol is undefined and the new symbol is defined. + +2003-09-18 Andreas Schwab + + * simple.c (bfd_simple_get_relocated_section_contents): Use + _bfd_generic_link_hash_table_create instead of + bfd_link_hash_table_create. + +2003-09-10 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_special_sections): Mark all sections + started with ".sbss" or "".sdata" as SHF_IA_64_SHORT. + +2003-09-10 John David Anglin + Randolph Chung + + * elf32-hppa.c (struct elf32_hppa_link_hash_entry, + hppa_link_hash_newfunc, hppa_build_one_stub, + elf32_hppa_adjust_dynamic_symbol, mark_PIC_calls, allocate_plt_static, + allocate_dynrelocs, elf32_hppa_size_dynamic_sections, + elf32_hppa_finish_dynamic_symbol): Remove pic_call field and all code + for generating import stubs for calls to statically linked PIC + functions. + (hppa_type_of_stub): Don't generate an import stub for calls to + statically linked pic functions. Generate import stubs for calls + in a shared object, to functions not in a regular file, and to + defined weak functions. Add new argument INFO. + (hppa_build_one_stub): Don't undef ADDIL_DP. + (elf32_hppa_check_relocs): Don't set SEC_HAS_GOT_REF flag. + (elf32_hppa_size_stubs): Pass info to hppa_type_of_stub. + (final_link_relocate): Change all DLTIND relocs to DPREL relocs in a + non-shared link. Convert instructions that use the the linkage table + pointer, or a facsimile thereof, to use the global data pointer when + the reloc has been changed. + +2003-09-08 Joel Brobecker + + * archures.c: Add new machine names for hppa. + * bfd-in2.h: Regenerate. + * cpu-hppa.c: Use the new machine names. + +2003-09-06 Stephane Carrez + + * elf32-m68hc1x.h (struct m68hc11_elf_link_hash_table): Remove + all_local_syms member. + * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Use bfd_elf_get_elf_syms + to get the local symbols. + +2003-09-06 Stephane Carrez + + * elf32-m68hc12.c (elf32_m68hc12_special_sections): New for hc11. + (elf_backend_special_sections): Define.a + + PR savannah/4950: + * elf32-m68hc11.c (elf32_m68hc11_special_sections): The .vectors + section is read-only. + +2003-09-04 Nick Clifton + + * archures.c (bfd_mach_v850e1): Define. + * bfd-in2.h: Regenerate. + * cpu-v850.h (scan): Accept bfd_mach_v850e1. + (arch_info_struct): Include an entry for bfd_mach_v850e1. + * elf32-v850.c (v850_elf_object_p): Accept E_V850E1_ARCH flag. + (v850_elf_final_write_processing): Accept bfd_mach_v850e1. + (v850_elf_print_private_bfd_data): Interpret E_V850E1_ARCH flag. + (v850_elf_merge_private_bfd_data): Allow v850e1 binaries to be + linked with v850e binaries. Mark the output as v850e. + +2003-09-03 Nick Clifton + + * cofflink.c (_bfd_coff_link_input_bfd): Do not skip section + symbols that are used in relocs. + +2003-08-30 Robert Millan + + * configure.in: Match GNU/KFreeBSD with new kfreebsd*-gnu triplet. + * config.bfd: Likewise. + * configure: Regenerate. + +2003-08-31 Christian Groessler + + * elf32-i860.c (i860_howto_pc26_reloc): Finish relocation here + instead of returning bfd_reloc_continue. + +2003-08-31 Andreas Jaeger + + * merge.c: Update to ISO C90. + +2003-08-27 Ian Lance Taylor + + * configure.in: Check for strtoull. + * bfd.c (bfd_scan_vma): Use strtoull when available. + * configure, config.in: Regenerate. + + * configure.in: Define and substitute BFD_HOST_LONG_LONG. + * bfd-in.h: Define BFD_HOST_LONG_LONG. Test it rather than + __GNUC__ when deciding whether to use long long for + BFD_HOST_64_BIT. + * configure, Makefile.in, doc/Makefile.in, bfd-in2.h: Regenerate. + +2003-08-27 Christian Groessler + + * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, + i860_howto_splitn_reloc, i860_howto_highadj_reloc): New + functions. + (elf32_i860_howto_table): Insert the new functions as + 'special_function's in the proper reloc type entries. + +2003-08-27 Richard Sandiford + + * elf32-frv.c (elf32_frv_relocate_section): Use + _bfd_elf_rela_local_sym. + +2003-08-26 Michael Snyder + + * cpu-frv.c: Remove unused enum. + +2003-08-25 Maciej W. Rozycki + + * reloc.c: Fix documentation for MIPS ELF relocations. + libbfd.h: Regenerate. + bfd-in2.h: Regenerate. + +2003-08-24 Jason Eckhardt + + * coff-i860.c (CALC_ADDEND): Define to be a no-op. + +2003-08-24 Jason Eckhardt + + * elf32-i860.c (elf32_i860_relocate_pc16): Subtract 4 and + shift by 2 before storing the relocated value. + +2003-08-23 Jason Eckhardt + + * coff-i860.c (coff_i860_reloc_nyi): New function. + (howto_table): Add entries for relocations PAIR, HIGHADJ, HIGH, + LOWn, SPLITn, and BRADDR. + (RTYPE2HOWTO): Check that the r_type is within the howto_table + before trying to access the entry. + (coff_i860_rtype_to_howto): Likewise. + (coff_i860_reloc_type_lookup): New function. + (i860_reloc_processing): New function. + (coff_bfd_reloc_type_lookup): Define macro. + (RELOC_PROCESSING): Define macro. + Minor formatting adjustments. + +2003-08-23 Alan Modra + + * elflink.h (elf_link_add_object_symbols): Don't crash on NULL owner. + +2003-08-22 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_create_dynamic_sections): Align the + .got section at 8 bytes. + +2003-08-21 Nick Clifton + + * cofflink.c: Update to ISO C90 and tidy up formatting. + +2003-08-21 Randolph Chung + + * elf32-hppa.c (elf32_hppa_object_p): For elf32-hppa-linux, objects + can have OSABI=Linux or OSABI=SysV. Check for both. + * elf64-hppa.c (elf64_hppa_object_p): Likewise. + +2003-08-21 Nick Clifton + + * po/sv.po: Updated Swedish translation. + +2003-08-20 Richard Sandiford + + * elf64-mips.c (elf_backend_copy_indirect_symbol): Define. + +2003-08-20 Nick Clifton + + * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): New macro used to + replace some duplicated code in most elfxx-xxxx.c files. This + version uses the new fields in bfd_link_info. + + * elf-m10300.c (mn10300_elf_relocate_section): Use new macro. + * elf32-arm.h (elf32_arm_relocate_section): Likewise. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. + * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + + * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols, + elf_hppa_remark_useless_dynamic_symbols, + elf_hppa_relocate_section): Use the new fields in + bfd_link_info structure. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_check_relocs): Likewise. + * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_check_relocs): Likewise. + * elfxx-mips.c (mips_elf_calculate_relocation): Likewise. + + * elflink.h (elf_link_output_extsym): Fix test for reporting + undefined symbols in shared libraries. Remove redundant test + of shlib_undefined when reporting references to forced local + symbols. + +2003-08-18 Andreas Schwab + + * libpei.h (bfd_pe_executable_p): Also recognize efi-app + executables. + +2003-08-17 Hans-Peter Nilsson + + * simple.c (bfd_simple_get_relocated_section_contents): Move + reloc_done hack to before first bfd_section_size call. Change all + returns to use new wrapper macro RETURN, restoring sec->reloc_done. + +2003-08-16 Alan Modra + + * elf64-ppc.c: Don't include elf/ppc.h. + +2003-08-14 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Fix PT_DYNAMIC + code to work with 64-bit bfds. + +2003-08-14 Alan Modra + + * dep-in.sed: Remove libintl.h. + * Makefile.am (SRC-POTFILES.in, BLD-POTFILES.in): Unset LC_COLLATE. + (POTFILES.in): Remove target. + * Makefile.in: Regenerate. + +2003-08-12 Alan Modra + + * elf64-ppc.c (ppc64_elf_next_input_section): Update comment. + (ppc64_elf_relocate_section): For zero sym R_PPC64_TOC relocs, + use the function sym from the previous reloc. + +2003-08-11 Jakub Jelinek + + * elf32-i386.c (elf_i386_relocate_section): Make undefined symbols + fatal if -pie. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + (ppc_elf_relocate_section) : Issue fatal error + on undefined symbols if -pie. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + +2003-08-11 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Add special case for crt1.o + branch to __libc_start_main. + +2003-08-08 Dmitry Diky + + * archures.c: Add xW42 and xE42 parts. Sort MPU list according to + gcc order. + * cpu-msp430.c: Likewise. + * elf32-msp430.c: Likewise. + * bfd-in2.h: Regenerate. + +2003-08-07 Alan Modra + + * elfxx-target.h: Remove PTR cast. + * targets.c (bfd_target): Make backend_data const void *. + * elf-bfd.h: Constify all occurrences of struct elf_backend_data. + * elf-m10300.c: Likewise. + * elf.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-m68hc1x.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-mips.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-sparc.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfcode.h: Likewise. + * elfcore.h: Likewise. + * elflink.c: Likewise. + * elflink.h: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * elfxx-mips.h: Likewise. + * elf.c (prep_headers): Remove useless check for null backend_data. + * bfd-in2.h: Regenerate. + + * elf-bfd.h: Remove PARAMS macro. Replace PTR with void *. + (NAME): Use ## rather than CONCAT4 macro. + * elfcode.h: Remove one remaining PARAMS macro. + * elf-eh-frame.c: Convert to C90, remove unneeded casts and prototypes. + * elf-strtab.c: Likewise. + * elf-hppa.h: Likewise. + * elf32-hppa.h: Likewise. + * elf32-hppa.c: Likewise. + (elf32_hppa_add_symbol_hook): Delete. + (elf_backend_add_symbol_hook): Don't define. + * libhppa.h: Convert to C90. Replace INLINE with inline. + +2003-08-06 Alan Modra + + * elf64-ppc.c (ppc_stub_name): Tweak names for better readability. + (ppc64_elf_adjust_dynamic_symbol): Allow copy relocs against + function descriptors, but warn. + (ppc_build_one_stub): Remove a couple of vars. Move code creating + stub syms so that we can avoid a stub sym if we already have a + plt sym. Do not redefine an existing symbol. + (ppc64_elf_build_stubs): When --emit-stub-syms, print a symbol for + glink. + +2003-08-06 Nick Clifton + + * po/fr.po: Updated French translation. + +2003-08-06 Alan Modra + + * elflink.c (_bfd_elf_create_dynamic_sections): Mark .dynbss with + SEC_LINKER_CREATED. + +2003-08-05 Daniel Jacobowitz + + * elf32-arm.h (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Use it. + +2003-08-03 Jeff Muizelaar + + * coffcode.h (coff_slurp_line_table): Return with a warning + message if the line number table could not be read. + +2003-08-04 Nick Clifton + + * elflink.h (elf_link_add_object_symbols): Prepend "warning: " + to messages produced for .gnu.warning.SYMBOL sections. + +2003-08-04 Alan Modra + + * elfcode.h: Convert to C90, remove unneeded casts and prototypes. + * elfcore.h: Likewise. + * elflink.c: Likewise. + * elflink.h: Likewise. + * elf.c (sym_is_global): Remove INLINE. + (align_file_position): Replace INLINE with inline. + * elfcode.h (elf_swap_dyn_in, elf_swap_dyn_out): Remove INLINE. + (elf_file_p): Replace INLINE with inline. + +2003-08-02 Kaz Kojima + + * elf32-sh.c (sh_elf_check_relocs): Don't set DF_TEXTREL here. + +2003-08-01 H.J. Lu + + * elfxx-ia64.c (get_got): Align the .got section at 8 bytes. + +2003-08-01 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Use + ElfNN_External_Rela instead of Elf64_External_Rela. + +2003-08-01 Nick Clifton + + * config.bfd: Add code to catch obsolete configurations and warn + about them unless --enable-obsolete is used. Use this to mark + vax-vms port as obsolete. + +2003-07-30 Alan Modra + + * elf32-ppc.c (ppc_elf_install_value): Tidy. + (ppc_elf_relax_section): Remove dead code. Remove unnecessary casts. + Formatting. + * elfxx-target.h: Remove PARAMS macro. Formatting. + +2003-07-30 Alan Modra + + * elf.c (bfd_section_from_r_symndx): Test for SHN_UNDEF. + * elf64-ppc.c (get_fdh): New function, split out from + ppc64_elf_edit_opd. + (ppc64_elf_check_relocs): Use get_fdh. + (func_desc_adjust): Likewise. Tidy. + (ppc64_elf_edit_opd): Tighten reloc checks. Free local_syms on error + exit. Use get_fdh. Account for superfluous dynamic relocs. + (ppc64_elf_relocate_section): Warning fix. + +2003-07-30 Jason Eckhardt + + * coff-i860.c: Convert to ISO C90. Remove superflous prototypes. + +2003-07-30 Jason Eckhardt + + * elf32-i860.c: Convert to ISO C90. Remove superflous prototypes. + +2003-07-30 Randolph Chung + + * elf-hppa.h (elf_hppa_relocate_section): Look up dyn_h for undefweak. + * elf64-hppa.c (elf64_hppa_finalize_dlt): Check h->root.type. + +2003-07-30 Alan Modra + + * elf.c: Convert to C90, remove unnecessary prototypes and casts. + Replace PTR with void *. Formatting. + (_bfd_elf_assign_file_position_for_section): Remove INLINE. + (make_mapping): Likewise. + +2003-07-29 Alan Modra + + * elf64-ppc.c (func_desc_adjust): Give linker created function + descriptor symbols a size and type. + (ppc64_elf_relocate_section): Correct lq insn test. + +2003-07-28 Eric Christopher + + * elf32-ppc.c (R_PPC_RELAX32): New relocation. + (ppc_elf_install_value): New function. + (ppc_elf_sort_rela): Remove. + (ppc_elf_relax_section): Rewrite. Remove old relaxation + and replace with out of range branch stubs. + (ppc_elf_relocate_section): Handle R_PPC_RELAX32. + +2003-07-29 Alexandre Oliva + + * elf-m10300.c (mn10300_elf_relax_section): Take symbol hash table + from input_bfd. + +2003-07-28 Alan Modra + + * elf.c (special_sections): Set attributes for .got and .plt. + +2003-07-27 Alan Modra + + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Ensure no copy relocs + on function descriptors. + (ELIMINATE_COPY_RELOCS): Expand comment. + (ppc64_elf_special_sections): Move. Don't include non-ppc64 sections. + Do include ".toc1". + +2003-07-25 H.J. Lu + + * elf.c (_bfd_elf_new_section_hook): Set the default section + type to SHT_NULL. + (elf_fake_sections): Set the section type based on asect->flags + if it is SHT_NULL. Don't abort on processor specific section + types. + +2003-07-25 H.J. Lu + + * bfd-in2.h: Regenerated. + +2003-07-25 H.J. Lu + + * elf-bfd.h (bfd_elf_special_section): New. + (elf_backend_data): Add special_sections, a pointer to + bfd_elf_special_section. + (elf_section_type). New. + (elf_section_flags): New. + (_bfd_elf_get_sec_type_attr): New. + + * elf.c (_bfd_elf_make_section_from_shdr): Always use the + real section type/flags. + (special_sections): New. + (get_special_section): New. + (_bfd_elf_get_sec_type_attr): New. + (_bfd_elf_new_section_hook): Check special_section to set + elf_section_type and elf_section_flags. + (elf_fake_sections): Don't use section name to set ELF section + data. + + * elf32-m32r.c (m32r_elf_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf32-m68hc11.c (elf32_m68hc11_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf32-mcore.c (mcore_elf_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf32-ppc.c (ppc_elf_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf32-sh64.c (sh64_elf_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf32-v850.c (v850_elf_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf32-xtensa.c (elf_xtensa_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf64-alpha.c (elf64_alpha_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf64-hppa.c (elf64_hppa_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf64-ppc.c (ppc64_elf_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf64-sh64.c (sh64_elf64_special_sections): New. + (elf_backend_special_sections): Defined. + + * elfxx-ia64.c (elfNN_ia64_special_sections): New. + (elf_backend_special_sections): Defined. + + * elfxx-mips.c (_bfd_mips_elf_special_sections): New. + + * elfxx-mips.h (_bfd_mips_elf_special_sections): New. + (elf_backend_special_sections): Defined. + + * elfxx-target.h (elf_backend_special_sections): New. Default + to NULL. + (elfNN_bed): Initialize special_sections. + + * section.c (bfd_abs_section): Remove const. + (bfd_und_section): Likewise. + (bfd_com_section): Likewise. + (bfd_ind_section): Likewise. + +2003-07-24 Nick Clifton + + * coff-arm.c (EXTRA_S_FLAGS): Include SEC_CODE so that code + sections are assigned the LOAD attribute. + +2003-07-25 Kaz Kojima + + * elf32-sh.c: Convert to C90. Replace PTR with void *. + * elf32-sh64-com.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-sh64.h: Likewise. + * elf64-sh64.c: Likewise. + +2003-07-24 Kaz Kojima + + * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL. + (allocate_dynrelocs): Likewise. + (sh_elf_relocate_section): Likewise. Use SYMBOL_REFERENCES_LOCAL. + (sh_elf_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL. + +2003-07-24 Nick Clifton + + * po/fr.po: Updated French translation. + +2003-07-23 Bob Wilson + + * elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Make inline and move + near the beginning of the file. Swap order of arguments. Call + _bfd_elf_dynamic_symbol_p with "ignore_protected" set to 0. + (elf_xtensa_fix_refcounts): Adjust xtensa_elf_dynamic_symbol_p call. + (elf_xtensa_relocate_section): Likewise. + (shrink_dynamic_reloc_sections): Likewise. + +2003-07-23 Bob Wilson + + * elf32-xtensa.c (plt_reloc_count): Fix typo in comment. + (elf_xtensa_size_dynamic_sections): Use elf_discarded_section. + (elf_xtensa_combine_prop_entries): Avoid returning non-zero without + first printing an error message. + (elf_xtensa_finish_dynamic_sections): Likewise. + (elf_xtensa_discard_info_for_section): Adjust size of .got.loc when + discarding literal table entries. + (elf_xtensa_merge_private_bfd_data): Remove newline from error message. + (elf_xtensa_do_asm_simplify): Likewise. + +2003-07-23 Stephane Carrez + + * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Avoid crash when + we have a local symbol in common section. + +2003-07-22 H.J. Lu + + * elflink.c (_bfd_elf_dynamic_symbol_p): Don't return TRUE for + weak symbols. + +2003-07-22 Nick Clifton + + * coffcode.h (coff_slurp_symbol_table): Add C_TCSYM and C_ECOML to + expected RS6000 storage classes. + +2003-07-21 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Mark + output_bfd unused to silence gcc. + +2003-07-21 Nick Clifton + + * po/sv.po: Updated Swedish translation. + +2003-07-21 Alan Modra + + * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Use.. + (_bfd_elf_symbol_refs_local_p): ..this. Declare. + * elflink.c (_bfd_elf_symbol_refs_local_p): New function. + * elf32-i386.c (elf_i386_relocate_section): Remove h NULL test + now done in _bfd_elf_symbol_refs_local_p. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + +2003-07-18 H.J. Lu + + * elflink.c (_bfd_elf_dynamic_symbol_p): Undo the last change. + +2003-07-18 H.J. Lu + + * elf-bfd.h (SYMBOL_REFERENCES_LOCAL): Fix a typo. + (SYMBOL_CALLS_LOCAL): Likewise. + + * elflink.c (_bfd_elf_dynamic_symbol_p): Return TRUE + immediately if symbol isn't defined locally. + +2003-07-18 Richard Henderson + + * elflink.c (_bfd_elf_dynamic_symbol_p): New. + * elf-bfd.h (_bfd_elf_dynamic_symbol_p): Declare it. + (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Use it. + * elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Likewise. + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise. + * elf64-hppa.c (elf64_hppa_dynamic_symbol_p): Likewise. + * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Likewise. + Update all callers to provide the relocation being resolved. + +2003-07-17 Shaun Jackman + + * config.bfd (arm-wince-pe): Add -DARM_COFF_BUGFIX to + targ_cflags. + +2003-07-17 Nick Clifton + + * po/es.po: New Spanish translation. + * po/sv.po: New Swedish translation. + * po/opcodes.pot: Regenerate. + +2003-07-16 Richard Henderson + + * config.bfd, configure.host, configure.in: Remove ia64-aix support. + * elfxx-ia64.c, targets.c: Likewise. + +2003-07-16 Richard Henderson + + * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Properly return false + for symbols defined locally plus -Bsymbolic. Tidy logic. + +2003-07-15 Richard Sandiford + + * archures.c (bfd_mach_mips7000): New. + * bfd-in2.h: Regenerated. + * cpu-mips.c (arch_info_struct): Add an entry for mips:7000. + * elfxx-mips.c (mips_set_isa_flags): Handle bfd_mach_mips7000. + (mips_mach_extensions): Add an entry for it. + +2003-07-14 Nick Clifton + + * po/tr.po: Update with latest version. + * po/SRC-POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. + * Makfile.in: Regenerate. + * configure: Regenerate. + +2003-07-12 Jeff Baker + + * config.bfd (__QNXTARGET__): Define for Neutrino architectures. + * elf32-arm.h (ELF_MAXPAGESIZE): Set to 4k for Neutrino. + * elf32-sh.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino. + * elf32-ppc.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino. + +2003-07-12 Jeff Muizelaar + + * coffcode.h (coff_set_section_contents): Set the + IMAGE_FILE_32BIT_MACHINE flag for PE targets. + +2003-07-11 Richard Sandiford + + * bfd-in.h (bfd_h8300_pad_address): Declare. + * bfd-in2.h: Regenerate. + * cpu-h8300.c (bfd_h8300_pad_address): New function. + * coff-h8300.c (h8300_reloc16_estimate): Use it to canonicalize + addresses before checking whether they can be relaxed. + (h8300_reloc16_extra_cases): Likewise for the R_MOVL2 sanity check. + Don't complain about overflows in general 8-bit relocations. + * elf32-h8300.c (elf32_h8_relax_section): Use bfd_h8300_pad_address. + Fix handling of R_H8_DIR24A8. + +2003-07-11 Richard Sandiford + + * elf32-h8300.c: Convert function prototypes and definitions + to C90 syntax. + * coff-h8300.c: Likewise. + * cpu-h8300.c: Likewise. + +2003-07-11 Alan Modra + + * po/SRC-POTFILES.in: Regenerate. + * po/bfd.pot: Likewise. + +2003-07-10 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Create new + .got.loc section. Do not set SEC_ALLOC or SEC_LOAD flags for the + .xt.lit.plt section. + (elf_xtensa_size_dynamic_sections): Set size of the .got.loc section + and allocate memory for it. + (elf_xtensa_combine_prop_entries): Copy contents of .xt.lit output + section to the .got.loc section. + (elf_xtensa_finish_dynamic_sections): Fix up call to + elf_xtensa_combine_prop_entries and set DT_XTENSA_GOT_LOC_OFF to + the address of .got.loc. + (relax_property_section): Shrink .got.loc to match changes in any + literal table section. + (xtensa_is_property_section): Change to match + xtensa_get_property_section_name. + (xtensa_is_littable_section): New. + +2003-07-10 H.J. Lu + + * elfxx-ia64.c (IA64_HOWTO): Set dst_mask to -1 instead of + -1LL. + +2003-07-10 Alan Modra + + * Makefile.am (BFD32_BACKENDS): Add elf32-am33lin.lo. + (BFD32_BACKENDS_CFILES): elf32-am33lin.c not elf32-am33lin.lo. + Run "make dep-am". + * Makefile.in: Regenerate. + +2003-07-10 Alexandre Oliva + + 2001-09-12 Alexandre Oliva + * elf32-am33lin.c (ELF_MACHINE_CODE): Redefine to EM_MN10300. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10300. + 2001-06-02 Nick Clifton + * elf32-am33lin.c: Rename global functions. + 2001-05-09 Alexandre Oliva + * config.bfd (am33_2.0, am33_2.0-*-linux*): Added. + * configure.in (bfd_elf32_am33lin_vec): Added. + * Makefile.am (BFD32_BACKENDS): Added elf32-am33lin.lo. + (elf32-am33lin.lo): List dependencies. + * aclocal.m4, configure, Makefile.in: Rebuilt. + * elf-m10300.c (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, + ELF_ARCH, ELF_MACHINE_CODE, ELF_MAXPAGESIZE): Define only if + ELF_ARCH was not defined before. + (elf_symbol_leading_char): Define if not defined. + * elf32-am33lin.c: Override the definitions above. + * targets.c (bfd_elf32_am33lin_vec): New. + +2003-07-09 Alexandre Oliva + + 2002-12-12 Alexandre Oliva + * elf-m10300.c (elf32_mn10300_link_hash_newfunc): Initialize + pcrel_relocs_copied. + 2001-12-13 Alexandre Oliva + * elf-m10300.c (ELF_DYNAMIC_INTERPRETER): Renamed from + ld-linux.so.2 to ld.so.1. + 2001-10-10 Alexandre Oliva + * elf-m10300.c (elf_mn10300_sizeof_plt0): New macro. + (_bfd_mn10300_elf_adjust_dynamic_symbol): Use it. + (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise. + * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Allocate + .rela.* section contents with bfd_zalloc. + 2001-09-25 Alexandre Oliva + * elf-m10300.c: Added declarations for functions missing them. + Merge some shared-library changes from the i386 back-end. Use + R_MN10300_RELATIVE instead of R_MN10300_PCREL32 and + R_MN10300_GLOB_DAT instead of R_MN10300_32 where appropriate. + (struct elf32_mn10300_link_hash_entry): Remove duplicates of + members of elf_link_hash_entry. Adjusted references. + (mn10300_elf_final_link_relocate): dynobj was already loaded + into a local variable, use it. + 2001-09-21 Nick Clifton + * elf-m10300.c: Add missing function prototypes. + 2001-08-24 Alexandre Oliva + * elf-m10300.c (mn10300_elf_relocate_section): Don't compute + relocation for dynamic relocations. + 2001-05-16 Alexandre Oliva + * reloc.c (BFD_RELOC_MN10300_GOTOFF24): New. + * elf-m10300.c: Introduce GOTPC16, GOTOFF24, GOTOFF16 and + PLT16, and rename GOTPC to GOTPC32 and GOTOFF to GOTOFF32. + (_bfd_mn10300_elf_create_dynamic_sections): Move creation ot PLT... + (_bfd_mn10300_elf_create_got_section): ... here, so that its + adress is already known at the time we compute relaxations. + (mn10300_elf_relax_section): Relax GOTPC32, GOTOFF32, GOT32 + and PLT32 to narrower relocations. + * libbfd.h, bfd-in2.h: Rebuilt. + 2001-04-12 Alexandre Oliva + * reloc.c (BFD_RELOC_MN10300_GOT32, BFD_RELOC_MN10300_GOT24, + BFD_RELOC_MN10300_GOT16, BFD_RELOC_MN10300_COPY, + BFD_RELOC_MN10300_GLOB_DAT, BFD_RELOC_MN10300_JMP_SLOT, + BFD_RELOC_MN10300_RELATIVE): New relocs. + * libbfd.h, bfd-in2.h: Rebuilt. + * elf-m10300.c (struct elf_mn10300_pcrel_relocs_copied): New. + (struct elf32_mn10300_link_hash_entry): Added DSO-related + fields. + (elf_mn10300_howto): Defined new relocation types. + (mn10300_reloc_map): Map them. + (_bfd_mn10300_elf_create_got_section): New fn. + (mn10300_elf_check_relocs): Handle PIC relocs. + (mn10300_elf_final_link_relocate): Likewise. + (mn10300_elf_relocate_section): Handle DSOs. + (PLT0_ENTRY_SIZE, PLT_ENTRY_SIZE, PIC_PLT_ENTRY_SIZE): New macros. + (elf_mn10300_plt0_entry, elf_mn10300_plt_entry, + elf_mn10300_pic_plt_entry): New. + (elf_mn10300_sizeof_plt, elf_mn10300_plt_plt0_offset, + elf_mn10300_plt0_linker_offset, elf_mn10300_plt0_gotid_offset, + elf_mn10300_plt_temp_offset, elf_mn10300_plt_symbol_offset, + elf_mn10300_plt_reloc_offset: New macros. + (ELF_DYNAMIC_INTERPRETER): Likewise. + (_bfd_mn10300_elf_create_dynamic_sections): New function. + (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise. + (_bfd_mn10300_elf_discard_copies): Likewise. + (_bfd_mn10300_elf_size_dynamic_sections): Likewise. + (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise. + (_bfd_mn10300_elf_finish_dynamic_sections): Likewise. + (elf_backend_can_gc_sections, + elf_backend_create_dynamic_sections, + elf_backend_adjust_dynamic_sections, + elf_backend_size_dynamic_sections, + elf_backend_finish_dynamic_symbol, + elf_backend_finish_dynamic_sections, elf_backend_want_got_plt, + elf_backend_plt_readonly, elf_backend_want_plt_sym, + elf_backend_got_header_size, elf_backend_plt_header_size): New + macros. + +2003-07-09 Alexandre Oliva + + 2001-05-06 Alexandre Oliva + * elf-m10300.c (compute_function_info): Account for AM33 + registers in `movm' when computing stack space for `call' when + linking for AM33/2.0 link. + 2000-04-01 Alexandre Oliva + * archures.c (bfd_mach_am33_2): Renamed from bfd_mach_am332. + * bfd-in2.h: Rebuilt. + * cpu-m10300.c (bfd_am33_2_arch): Renamed from bfd_am332_arch. + * elf-m10300.c: Updated. + 2000-03-31 Alexandre Oliva + * archures.c (bfd_mach_am332): Defined. + * bfd-in2.h: Rebuilt. + * cpu-m10300.c (bfd_am332_arch): Defined. + (bfd_am33_arch): Chained with am33-2. + * elf-m10300.c (elf_mn10300_mach): Handle am332. + (_bfd_mn10300_elf_final_write_processing): Likewise. + +2003-07-09 H.J. Lu + + * elfxx-ia64.c (IA64_HOWTO): Set dst_mask to -1LL. + +2003-07-10 Alan Modra + + * elf64-ppc.c (bfd_elf64_mkobject): Define. + (struct ppc64_elf_obj_tdata): New. + (ppc64_elf_tdata, ppc64_tlsld_got): Define. + (ppc64_elf_mkobject): New function. + (struct got_entry): Add "owner". Move "tls_type". + (struct ppc_link_hash_table): Delete "relgot", "tlsld_got". + (ppc64_elf_init_stub_bfd): New function. + (create_got_section): Create header .got in dynobj. Create .got + and .rela.got in each bfd. Stash pointers in ppc64_elf_obj_tdata. + (ppc64_elf_create_dynamic_sections): Don't call create_got_section. + Look for dynobj .got, and test it. + (ppc64_elf_copy_indirect_symbol): Adjust for changed got. + (update_local_sym_info): Likewise. + (ppc64_elf_check_relocs): Likewise. + (ppc64_elf_gc_sweep_hook): Likewise. + (ppc64_elf_tls_optimize): Likewise. + (allocate_dynrelocs): Likewise. + (ppc64_elf_size_dynamic_sections): Likewise. + (ppc64_elf_relocate_section): Likewise. + (ppc64_elf_next_toc_section): Update comment. + (toc_adjusting_stub_needed): Remove unneeded cast. + (ppc64_elf_build_stubs): Check for stub sections in stub bfd by + testing section flags. + (ppc64_elf_build_stubs): Likewise. + (ppc64_elf_size_stubs): Likewise. Remove stub_bfd param. + (ppc64_elf_finish_dynamic_sections): Write out got sections. + (func_desc_adjust): Copy over dynamic info for undef weaks. + * elf64-ppc.h (ppc64_elf_init_stub_bfd): Declare. + (ppc64_elf_size_stubs): Update prototype. + * elflink.h (elf_link_sort_relocs): Use link_orders to find reldyn + input sections rather than scanning dynobj. + +2003-07-09 Richard Sandiford + + * elfxx-mips.c (mips_elf_link_hash_entry): Remove min_dyn_reloc_index. + (bfd_mips_elf_swap_msym_in, bfd_mips_elf_swap_msym_out): Delete. + (mips_elf_create_msym_section): Delete. + (mips_elf_create_dynamic_relocation): Don't set min_dyn_reloc_index. + (_bfd_mips_elf_copy_indirect_symbol): Likewise. + (_bfd_mips_elf_create_dynamic_sections): Don't create .msym. + (_bfd_mips_elf_size_dynamic_sections): Don't calculate its size. + (_bfd_mips_elf_size_dynamic_sections): Don't add DT_MIPS_MSYM. + (_bfd_mips_elf_finish_dynamic_symbol): Don't add symbols to .msym. + (_bfd_mips_elf_finish_dynamic_sections): Likewise. + +2003-07-09 Richard Sandiford + + * elfxx-mips.c (mips_elf_irix6_finish_dynamic_symbol): Make the + symbols protected. + +2003-07-09 Richard Sandiford + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Fix handling + of relocations whose offset is -2. + +2003-07-09 Richard Sandiford + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Treat + forced-local symbols like other locals. Don't create relocations + against STN_UNDEF in irix objects. + +2003-07-09 Richard Sandiford + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): In SGI- + compatible objects, add the values of defined external symbols + to the addend. + +2003-07-09 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Always + initialize a GOT entry to the symbol's st_value. + +2003-07-08 Alan Modra + + * elf-bfd.h (struct elf_obj_tdata): Move linker_section_pointers.. + * elf32-ppc.c (struct ppc_elf_obj_tdata): ..to here. New. + (ppc_elf_tdata): Define. + (elf_local_ptr_offsets): Adjust. + (ppc_elf_mkobject): New function. + (bfd_elf32_mkobject): Define. + + * elfcode.h (elf_object_p): Allocate tdata via _bfd_set_format. + * elfcore.h (elf_core_file_p): Likewise. + * section.c (bfd_section_init): Remove prototype. + +2003-07-08 Alan Modra + + * elf-bfd.h (struct elf_link_hash_entry): Remove linker_section_pointer + field. + (enum elf_linker_section_enum): Delete. + (struct elf_linker_section): Delete. + (struct elf_linker_section_pointers): Delete. + (struct elf_obj_tdata): Remove #if 0 chunk. Remove linker_section. + Make linker_section_pointers a void**. + (elf_local_ptr_offsets, elf_linker_section): Don't define. + * elf32-ppc.c (enum elf_linker_section_enum): New, cut-down version + of old item in elf-bfd.h. + (struct elf_linker_section): Likewise. + (struct elf_linker_section_pointers): Likewise. + (elf_local_ptr_offsets): Define. + (struct ppc_elf_link_hash_entry): Add linker_section_pointer. + (ppc_elf_link_hash_newfunc): Init it. + (struct ppc_elf_link_hash_table): Add sbss. + (ppc_elf_link_hash_table_create): zmalloc rather than clearing + individual fields. + (elf_create_linker_section): Fold into.. + (ppc_elf_create_linker_section): ..here. Remove hole_size code. + Make rela section here if shared. + (elf_find_pointer_linker_section): Pass lsect rather than enum. + (elf_create_pointer_linker_section): Adjust. zalloc rather than + clearing in a loop. + (elf_finish_pointer_linker_section): Adjust. Don't make rela + section here. + (ppc_elf_check_relocs): Adjust. + (ppc_elf_add_symbol_hook): Tighten hash creator test. Remove code + creating .sbss by hand. + * elf.c (_bfd_elf_link_hash_newfunc): Adjust. + +2003-07-04 Jakub Jelinek + + * elf32-s390.c (elf_howto_table): Change R_390_GOT12 to + complain_overflow_bitfield. + * elf64-s390.c (elf_howto_table): Change R_390_GOT12 to + complain_overflow_bitfield. + +2003-07-04 Jakub Jelinek + + * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Return + true even if -pie. + +2003-07-04 Jakub Jelinek + + * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add rel_fptr_sec. + (elfNN_ia64_dynamic_symbol_p): Change info->shared into + !info->executable. + (get_fptr): For -pie create .opd as writable section and create + .rela.opd as well. + (elfNN_ia64_check_relocs): Change info->shared into + !info->executable. + (allocate_fptr): Likewise. + (allocate_dynrel_entries): Account for a relative reloc for -pie + @fptr(). Don't account for a relative reloc if -pie want_ltoff_fptr + for undefweak symbol. Account for an IPLT reloc in .rela.opd + section if -pie. + (set_got_entry): Don't create a relative reloc if -pie + want_ltoff_fptr for undefweak symbol. + (set_fptr_entry): Emit an IPLT reloc in .rela.opd for -pie. + (elfNN_ia64_relocate_section): Emit a relative reloc for -pie + @fptr(). + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Issue undefined_symbol + even if -pie. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + +2003-07-04 Paul Clarke + + * elf32-h8300.c (R_H8_DIR32A16): Fix name field. + (elf32_h8_relax_section) : Adjust position of relocation. + : Fix type of relocation. + +2003-07-04 Kaz Kojima + + * elf32-sh.c (sh_elf_create_dynamic_sections): Return if dynamic + sections were created already. Remove unnecessary tests of + the previous change. + +2003-07-04 Kaz Kojima + + * elf32-sh.c (sh_elf_create_dynamic_sections): Don't call + bfd_make_section for existing sections. + +2003-07-04 Alan Modra + + * elf32-sparc.c (elf32_sparc_check_relocs): Don't call + create_got_section if we already have done so. + * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise. + (sh_elf_check_relocs): Likewise. + (sh_elf_adjust_dynamic_symbol): Delete "dynobj" var. Use + htab->root.dynobj instead. + (sh_elf_check_relocs): Likewise. + (sh_elf_finish_dynamic_sections): Likewise. + + * section.c (bfd_make_section): Return NULL for existing section. + +2003-07-04 Alan Modra + + * elf32-ppc.c (ppc_elf_create_dynamic_sections): Don't call + ppc_elf_create_got if we've already done so. + + * elf-bfd.h (_bfd_elf_create_linker_section) Don't declare. + (_bfd_elf_find_pointer_linker_section): Likewise. + (bfd_elf32_create_pointer_linker_section): Likewise. + (bfd_elf32_finish_pointer_linker_section): Likewise. + (bfd_elf64_create_pointer_linker_section): Likewise. + (bfd_elf64_finish_pointer_linker_section): Likewise. + (_bfd_elf_make_linker_section_rela): Likewise. + * elfcode.h (elf_create_pointer_linker_section): Don't define. + (elf_finish_pointer_linker_section): Likewise. + * elflink.c (_bfd_elf_make_linker_section_rela): Delete. + (_bfd_elf_create_linker_section): Move this function.. + (_bfd_elf_find_pointer_linker_section): ..and this.. + * elflink.h (elf_create_pointer_linker_section): ..and this.. + (elf_finish_pointer_linker_section): ..and this.. + * elf32-ppc.c: ..to here, renaming to the following, and adjusting + calls. + (elf_create_linker_section): Convert to C90, tidy. + (elf_find_pointer_linker_section): Likewise. + (elf_create_pointer_linker_section): Likewise. + (elf_finish_pointer_linker_section): Likewise. + * elf32-i370.c: Delete #if 0 code. + +2003-07-02 Alan Modra + + * elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't allow _savef* and + _restf* to be satisfied by shared libs, and always force them local. + (toc_adjusting_stub_needed): Avoid scanning linker created sections. + Correct test for "bl". + (ppc64_elf_relocate_section ): Correct test for + primary opcode 31. + +2003-07-01 Martin Schwidefsky + + * elf32-s390.c (s390_elf_ldisp_reloc): New prototype. + (s390_tls_reloc): New function. + (elf_howto_table): Add long displacement relocations R_390_20, + R_390_GOT20, R_390_GOTPLT20 and R_390_TLS_GOTIE20. + (elf_s390_reloc_type_lookup): Likewise. + (elf_s390_check_relocs): Likewise. + (elf_s390_gc_sweep_hook): Likewise. + (elf_s390_relocate_section): Likewise. + * elf64-s390.c: Same changes as for elf32-s390.c. + * reloc.c: Add long displacement relocations BFD_RELOC_390_20, + BFD_RELOC_390_GOT20, BFD_RELOC_390_GOTPLT20 and + BFD_RELOC_390_TLS_GOTIE20. + * bfd-in2.h: Regenerate. + * libbfd.h: Likewise. + +2003-06-30 Alan Modra + + * cpu-ia64-opc.c (ext_imms_scaled): Don't sign extend using shifts. + (ins_imms, ins_immsm1u4): Likewise. Warning fix. + +2003-06-29 Alan Modra + + * archive.c: Convert to C90, remove unnecessary prototypes and casts. + Replace PTR with void *. Formatting. + * archive64.c: Likewise. + * archures.c: Likewise. + * bfd-in.h: Likewise. + * bfd.c: Likewise. + * bfdio.c: Likewise. + * bfdwin.c: Likewise. + * cache.c: Likewise. + * corefile.c: Likewise. + * format.c: Likewise. + * init.c: Likewise. + * libbfd-in.h: Likewise. + * libbfd.c: Likewise. + * linker.c: Likewise. + * opncls.c: Likewise. + * reloc.c: Likewise. + * section.c: Likewise. + * simple.c: Likewise. + * syms.c: Likewise. + * targets.c: Likewise. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + + * ecoff.c (bfd_debug_section): Add missing kept_section initialization. + * libbfd-in.h (_bfd_sh_align_load_span): Don't declare if defined. + * libbfd.c (COERCE32, EIGHT_GAZILLION): Simplify. + (bfd_getb64): Rewrite without parens. + (bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise. + * cache.c (insert, snip): Remove INLINE. + * linker.c (bfd_link_add_undef): Likewise. + +2003-06-29 Andreas Jaeger + + * elf64-x86-64.c: Convert to ISO C90 prototypes, remove + unnecessary prototypes. Replace PTR with void *. + (elf64_x86_64_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL to + trim plt entries. Move undefweak non-default visibility test ... + (allocate_dynrelocs): ... from here. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO. + Change all callers. + (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL. Use + SYMBOL_REFERENCES_LOCAL for dynreloc check. + (elf64_x86_64_relocate_section): Use SYMBOL_CALLS_LOCAL for + dynreloc and .got relocs. + (elf64_x86_64_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL + for .got relocs. + +2003-06-29 Thiemo Seufer + + * elfxx-mips.c: Allow lazy binding for R_MIPS_JALR. + +2003-06-27 Nick Clifton + + * opncls.c (bfd_add_gnu_debuglink_section): Rename to + bfd_add_gnu_debuglink_section and only create the section, do not + fill in its contents. + (bfd_fill_in_gnu_debuglink_section): New function. Fill in the + contents of a .gnu-debuglink section. + * bfd-in2.h: Regenerate. + +2003-06-27 Thiemo Seufer + + * elfxx-mips.c: Revert .got alignment to 2**4. + +2003-06-27 Thiemo Seufer + + * elf32-mips.c: Fix addend for _gp_disp special symbol. + +2003-06-27 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_fake_sections): Remove non-default + relocation header setup. + +2003-06-25 Alan Modra + + * elf32-ppc.c (ppc_elf_howto_table): Remove unnecessary cast. + (ppc_elf_reloc_type_lookup): Modify comment. + (ppc_elf_info_to_howto): Ditto. + (ppc_elf_relocate_section): Ditto. + (ppc_elf_check_relocs): Call ppc_elf_howto_init. + +2003-06-25 Alan Modra + + * aout-ns32k.c: Correct spelling of "relocatable". + * aoutx.h: Likewise. + * bfd-in.h: Likewise. + * bfd.c: Likewise. + * bout.c: Likewise. + * coff-a29k.c: Likewise. + * coff-alpha.c: Likewise. + * coff-arm.c: Likewise. + * coff-i386.c: Likewise. + * coff-i860.c: Likewise. + * coff-i960.c: Likewise. + * coff-m68k.c: Likewise. + * coff-m88k.c: Likewise. + * coff-mcore.c: Likewise. + * coff-mips.c: Likewise. + * coff-or32.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-sh.c: Likewise. + * coff-tic80.c: Likewise. + * coff64-rs6000.c: Likewise. + * cofflink.c: Likewise. + * cpu-ns32k.c: Likewise. + * ecoff.c: Likewise. + * ecofflink.c: Likewise. + * elf-bfd.h: Likewise. + * elf-eh-frame.c: Likewise. + * elf-hppa.h: Likewise. + * elf-m10200.c: Likewise. + * elf-m10300.c: Likewise. + * elf.c: Likewise. + * elf32-arm.h: Likewise. + * elf32-avr.c: Likewise. + * elf32-cris.c: Likewise. + * elf32-d10v.c: Likewise. + * elf32-dlx.c: Likewise. + * elf32-fr30.c: Likewise. + * elf32-frv.c: Likewise. + * elf32-h8300.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-i860.c: Likewise. + * elf32-i960.c: Likewise. + * elf32-ip2k.c: Likewise. + * elf32-iq2000.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc1x.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-mips.c: Likewise. + * elf32-msp430.c: Likewise. + * elf32-openrisc.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-v850.c: Likewise. + * elf32-vax.c: Likewise. + * elf32-xstormy16.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mips.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-sparc.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfcode.h: Likewise. + * elflink.h: Likewise. + * elfn32-mips.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * i386linux.c: Likewise. + * ieee.c: Likewise. + * libcoff-in.h: Likewise. + * linker.c: Likewise. + * m68klinux.c: Likewise. + * pdp11.c: Likewise. + * pe-mips.c: Likewise. + * peXXigen.c: Likewise. + * reloc.c: Likewise. + * reloc16.c: Likewise. + * sparclinux.c: Likewise. + * sunos.c: Likewise. + * syms.c: Likewise. + * versados.c: Likewise. + * vms.c: Likewise. + * xcofflink.c: Likewise. + * bfd-in2.h: Regenerate. + * libcoff.h: Regenerate. + * libbfd.h: Regenerate. + +2003-06-24 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Report plt reloc against + local sym errors. + + * elf32-i386.c: Convert to C90 function definitions, remove unnecessary + prototypes and casts. Replace PTR with void *. Formatting. + * elf32-ppc.c: Likewise. Break long strings too. + (ppc_elf_relax_section): Use enum elf_ppc_reloc_type for r_type. + (ppc_elf_unhandled_reloc): Internationalize error message. + * elf32-ppc.h: Remove PARAMS. + +2003-06-23 Mark Mitchell + + * elf32-ppc.c (ppc_elf_begin_write_processing): Use bytes to count + APUinfo slots. + (ppc_elf_final_write_processing): Likewise. + +2003-06-23 H.J. Lu + + * elflink.h (elf_link_input_bfd): Check raw size when using + kept_section to preserve debug information discarded by + linkonce. + +2003-06-20 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_table): Add top_id. + (ppc64_elf_setup_section_lists): Set it. + (ppc64_elf_relocate_section): Check sym section id against top_id. + (ppc_build_one_stub): Comment on top_id. + +2003-06-20 Ralf Corsepius + + * config.bfd: Add tic4x-*-rtems*. + +2003-06-20 Alan Modra + + * elf64-ppc.c: Convert to C90 function definitions, remove unnecessary + prototypes and casts. Replace PTR with void *. Format copyright. + Mention ABI links. + (struct ppc_link_hash_table): Rename sgot, srelgot, splt, srelplt, + sdynbss, srelbss, sglink, sbrlt and srelbrlt to got, relgot .. relbrlt. + (ppc_type_of_stub): Make r_type an enum. + (ppc64_elf_size_stubs): Likewise. + * elf64-ppc.h: Remove PARAMS macro. + +2003-06-19 Alan Modra + + * elf64-ppc.c (ppc64_elf_link_hash_table_create): Reinstate init of + elf hash tab fields. + + * elf64-ppc.c (ppc64_elf_reloc_type_lookup): Tidy prototype. + (ppc64_elf_info_to_howto): Likewise. + (ppc64_elf_build_stubs): Add "stats" param, and print statistics. + * elf64-ppc.h (ppc64_elf_build_stubs): Adjust prototype. + +2003-06-19 Alan Modra + + * elf64-sparc.c (sparc64_elf_relocate_section): Ignore R_SPARC_DISP32 + reloc overflow on discarded eh_frame entries. + +2003-06-19 Alan Modra + + * elf64-ppc.c (toc_adjusting_stub_needed): New function. + (ppc64_elf_next_input_section): Use it here to set has_gp_reloc. + Return error condition. + (ppc64_elf_size_stubs): Restrict toc adjusting stubs to sections + that have has_gp_reloc set. + (struct ppc_link_hash_table): Add stub_count. + (ppc_build_one_stub): Increment it. + (ppc64_elf_link_hash_table_create): zmalloc rather than clearing + individual fields. + * elf64-ppc.h (ppc64_elf_next_input_section): Update prototype. + +2003-06-18 Alan Modra + + * elflink.h (elf_gc_record_vtentry): Revert last change. Correct + size calculation from addend. Round size up. + +2003-06-18 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) : When linking a program, don't complain about a + symbol from a normal object or an undefined weak symbol. + +2003-06-18 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Accept a symbol on + R_PPC64_TOC relocs. + +2003-06-17 H.J. Lu + + * section.c (struct sec): Put back kept_section. + (STD_SECTION): Put back kept_section initialization. + * bfd-in2.h: Regenerate. + + * elflink.h (elf_link_input_bfd): Also check discarded linkonce + sections for relocateable output. Use kept_section to preserve + debug information discarded by linkonce. + +2003-06-17 Roland McGrath + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Support + segment-relative relocation between different segments. + +2003-06-17 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Do unaligned reloc + optimizations earlier. + + * elf64-ppc.c (struct ppc_link_hash_table): Reinstate top_index. + Restore previous input_list type. + (ppc64_elf_link_hash_table_create): Undo last change. + (ppc64_elf_setup_section_lists): Reinstate code setting up input lists + per output section, but don't bother with bfd_abs_section marker. + (ppc64_elf_next_input_section): Adjust for multiple input section + lists. + (group_sections): Likewise. + +2003-06-17 Jakub Jelinek + + * elf64-ppc.c (ppc64_elf_relocation_section): Ensure + *r_offset == r_addend for RELATIVE relocs against .got. + +2003-06-17 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Optimize unaligned relocs. + +2003-06-17 Nick Clifton + + * elflink.h (elf_gc_record_vtentry): Allocate an extra element + in the vtable_entries_used array to allow for the accessing + the largest element. + +2003-06-17 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_table): Remove top_index. Modify + input_list. + (ppc64_elf_link_hash_table_create): Init input_list here. + (ppc64_elf_setup_section_lists): Remove code setting up input lists + per output section. Set toc_off for abs and other standard sections. + (ppc64_elf_reinit_toc): Don't set elf_gp on input bfds lacking a toc. + (ppc64_elf_next_input_section): Adjust for single input section list. + Don't set toc_curr from input bfds that haven't set elf_gp. + (group_sections): Adjust for single input section list. + + * elf64-ppc.c (ppc64_elf_relocate_section): Correct pcrel section zero. + +2003-06-16 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing toctprel + tls, check that a TOC16_DS or TOC16_LO_DS reloc isn't pointing to a + dtprel entry. Ensure TLS_LD DTPMOD reloc has a zero addend. Write + got section for RELATIVE relocs. Fix wrong comment. Change condition + under which dynamic relocs update the section contents. + +2003-06-13 Robert Millan + + * config.bfd: Add i386-netbsd-gnu target. + +2003-06-12 Nick Clifton + + * opncls.c (calc_crc32): Rename to + bfd_calc_gnu_debuglink_crc32 and export. + (GNU_DEBUGLINK): Define and use to replace occurrences of + hard-coded ".gnu_debuglink" in the code. + (get_debug_link_info): Prevent aborts by replacing call to + xmalloc with a call to malloc. + (find_separate_debug_file): Prevent aborts by replacing calls + to xmalloc and xstrdup with calls to malloc and strdup. + (bfd_add_gnu_debuglink): New function. Add a .gnu_debuglink + section to a bfd. + * bfd-in2.h: Regenerate. + +2003-06-12 Federico G. Schwindt + + * config.bfd (i[3-7]86-*-openbsd[0-2].* | i[3-7]86-*-openbsd3.[0-3]): + New target (was i[3-7]86-*-openbsd* before). + (i[3-7]86-*-openbsd*): Change to use bfd_elf32_i386_vec. + (vax-*-openbsd*): New target. + +2003-06-11 Thiemo Seufer + + * elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME): Use .MIPS.options + for n32, too. + (MIPS_ELF_STUB_SECTION_NAME): Use .MIPS.stubs for n32, too. + (mips_elf_rel_dyn_section): Use appropriate section alignment. + (mips_elf_create_got_section): Likewise. + (_bfd_mips_elf_create_dynamic_sections): Likewise. + +2003-06-11 Thiemo Seufer + + * elf32-mips.c (mips_elf_generic_reloc): New Function. + (elf_mips_howto_table_rel): Use it. + (gprel32_with_gp): Move prototype. + (mips_elf_hi16_reloc): Check for ! BSF_LOCAL instead of zero addend. + Use mips_elf_generic_reloc. + (mips_elf_got16_reloc): Check for ! BSF_LOCAL instead of zero addend. + Code cleanup. + (_bfd_mips_elf32_gprel16_reloc): Check for ! BSF_LOCAL instead of + zero addend. + (mips_elf_gprel32_reloc): Likewise. Use the same GP assignment logic + as in the other *_gprel*_reloc functions. + (gprel32_with_gp): Handle partial_inplace properly. + (mips32_64bit_reloc): Use mips_elf_generic_reloc. + (mips16_gprel_reloc): Check for ! BSF_LOCAL instead of zero addend. + Do addend handling directly instead of calling + _bfd_mips_elf_gprel16_with_gp. Handle partial_inplace properly. + * elf64-mips.c (mips_elf64_hi16_reloc): Check for ! BSF_LOCAL instead + of zero addend. Handle partial_inplace properly. + (mips_elf64_got16_reloc): Check for ! BSF_LOCAL instead of zero + addend. + (mips_elf64_gprel16_reloc): Likewise. + (mips_elf64_literal_reloc): Likewise. + (mips_elf64_gprel32_reloc): Likewise. Use the same GP assignment + logic as in the other *_gprel*_reloc functions. Handle + partial_inplace properly. + (mips_elf64_shift6_reloc): Check for ! BSF_LOCAL instead of zero + addend. Handle partial_inplace properly. + (mips16_gprel_reloc): Likewise. Do addend handling directly instead + of calling _bfd_mips_elf_gprel16_with_gp. + * elfn32-mips.c (mips_elf_got16_reloc): Check for BSF_LOCAL. + (mips_elf_gprel32_reloc): Check for ! BSF_LOCAL instead + of zero addend. + (mips_elf_shift6_reloc): Handle partial_inplace properly. + (mips16_gprel_reloc): Likewise. Do addend handling directly instead + of calling _bfd_mips_elf_gprel16_with_gp. + * elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp): Handle + partial_inplace properly. Fix wrong addend handling. Fix overflow + check. + (_bfd_mips_elf_sign_extend): Renamed from mips_elf_sign_extend and + exported. + (mips_elf_calculate_relocation): Use _bfd_mips_elf_sign_extend. + (_bfd_mips_elf_relocate_section): Likewise. + (mips_elf_create_dynamic_relocation): Update sec_info_type access. + * elfxx-mips.h (_bfd_mips_relax_section): Fix prototype declaration. + (_bfd_mips_elf_sign_extend): New prototype. + +2003-06-11 Federico G. Schwindt + + * config.bfd (sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1]): + New target (was sparc-*-openbsd* before). + (sparc-*-openbsd*): Change to use bfd_elf32_sparc_vec. + + * configure.in (vax-*-openbsd*): Set COREFILE to netbsd-core.lo. + * configure: Regenerate. + +2003-06-11 H.J. Lu + + * po/Make-in (DESTDIR): New. + (install-data-yes): Support $(DESTDIR). + (uninstall): Likewise. + +2003-06-11 Alan Modra + + * Makefile.am (config.status): Depend on version.h. + Run "make dep-am". + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2003-06-10 Alan Modra + Gary Hade + + * elf64-ppc.c (ppc64_elf_relocate_section <*_DS>): Special case lq. + +2003-06-10 Richard Sandiford + + * archures.c (bfd_mach_h8300sxn): New architecture. + * bfd-in2.h: Regenerate. + * cpu-h8300.c (h8300_scan): Check for 'sxn'. + (h8300sxn_info_struct): New. + (h8300sx_info_struct): Link to it. + * elf32-h8300.c (elf32_h8_mach): Add h8300sxn case. + (elf32_h8_final_write_processing): Likewise. + +2003-06-08 Alan Modra + + * elf64-ppc.c: Move TARGET_LITTLE_SYM and other macros used by + elfxx-target.h so that we can use elf_backend_got_header_size. + (ELF_MACHINE_ALT1, ELF_MACHINE_ALT2): Delete. + (GLINK_CALL_STUB_SIZE): Modify. Define new glink call stub and + associated macros. + (ppc64_elf_howto_raw ): Correct + dst_mask. + (enum ppc_stub_type): Add ppc_stub_long_branch_r2off and + ppc_stub_plt_branch_r2off. + (struct ppc_stub_hash_entry): Reorganize. + (struct ppc_link_hash_table): Add no_multi_toc, multi_toc_needed, + toc_curr, toc_off and emit_stub_syms. + (ppc64_elf_link_hash_table_create): Init them. + (ppc_stub_name): Correct string size. + (ppc64_elf_check_relocs): Set has_gp_reloc on GOT and TOC relocs. + (ppc64_elf_size_dynamic_sections): Set no_multi_toc if GOT entries + used. + (ppc_type_of_stub): Tweak root.type test. + (build_plt_stub): Remove glink code. Adjust for insn macro changes. + (ppc_size_one_stub): Handle ppc_stub_long_branch_r2off and + ppc_stub_plt_branch_r2off. + (ppc_build_one_stub): Likewise. Fix var shadowing. Correct addis,addi + range test. Use toc_off to calculte r2 values. Handle emit_stub_syms. + (ppc64_elf_setup_section_lists): Remove htab creator flavour test. + Initialize elf_gp and toc_curr. + (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): New functions. + (ppc64_elf_next_input_section): Set toc_off. + (group_sections): Ensure groups have the same TOC. + (ppc64_elf_size_stubs): Check whether we need a TOC adjusting stub. + (ppc64_elf_build_stubs): Add emit_stub_syms param, and stash in htab. + Build new glink stub. + (ppc64_elf_relocate_section): Handle multiple TOCs. Fix comments. + (ppc64_elf_finish_dynamic_sections): Adjust DT_PPC64_GLINK. + * elf64-ppc.h (ppc64_elf_build_stubs): Update prototype. + (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): Declare. + * section.c (struct sec): Rename flag12 to has_gp_reloc. + (STD_SECTION): Update. + * ecoff.c (bfd_debug_section): Update comment. + * bfd-in2.h: Regenerate. + +2003-06-05 Daniel Jacobowitz + + * elfcode.h (elf_slurp_reloc_table_from_section): Don't dereference + NULL function pointers. + +2003-06-05 Daniel Jacobowitz + + * simple.c (bfd_simple_get_relocated_section_contents): Call + _bfd_generic_link_add_symbols instead of bfd_link_add_symbols. + +2003-06-04 Svein E. Seldal + + * coff-tic54x.c: Removed the ticoff0_bad_format_hook() and + ticoff1_bad_format_hook() functions. Removed the coff0 and coff1 + swaptables. + * coff-tic4x.c: Ditto + * coffcode.h: Added extra arguments to CREATE_BIG_COFF_TARGET_VEC + and CREATE_LITTLE_COFF_TARGET_VEC. Created the macro + CREATE_BIGHDR_COFF_TARGET_VEC. Created the ticoff0_bad_format_hook(), + ticoff1_bad_format_hook() functions. Created the coff0 and coff1 + swap tables. + * coff-tic4x.c: Adopted new CREATE_xxx_COFF_TARGET_VEC macros. + * coff-a29k.c: Append COFF_SWAP_TABLE argument + * coff-apollo.c: Ditto + * coff-arm.c: Ditto + * coff-h8300.c: Ditto + * coff-h8500.c: Ditto + * coff-i960.c: Ditto + * coff-m68k.c: Ditto + * coff-m88k.c: Ditto + * coff-mcore.c: Ditto + * coff-sh.c: Ditto + * coff-sparc.c: Ditto + * coff-tic80.c: Ditto + * coff-we32k.c: Ditto + * coff-z8k.c: Ditto + * coff-w65.c: Ditto + +2003-06-04 Svein E. Seldal + + * coff-tic4x.c (ticoff0_swap_table, ticoff1_swap_table): Fixed + initialization bug + +2003-06-03 Jakub Jelinek + + * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_STACK. + (bfd_section_from_phdr): Likewise. + (map_sections_to_segments): Create PT_GNU_STACK segment header. + (get_program_header_size): Count with PT_GNU_STACK. + * elf-bfd.h (struct elf_obj_tdata): Add stack_flags. + * elflink.h (bfd_elfNN_size_dynamic_sections): Set stack_flags. + +2003-06-03 H.J. Lu + + * elflink.h (elf_link_input_bfd): Call linker error_handler + for discarded definitions. + +2003-06-03 Elias Athanasopoulos + + * syms.c (decode_section_type): Return 'n' if section flags are + SEC_HAS_CONTENTS && SEC_READONLY. + +2003-06-03 Nick Clifton + + * elf32-v850.c (v850_elf_howto_t): Rename R_V850_32to + R_V850_ABS32. Add entry for R_V850_REL32. + (v850_elf_reloc_map): Likewise. + (v850_elf_check_relocs): Likewise. + (v850_elf_perform_relocation): Likewise. + (v850_elf_final_link_relocate): Likewise. Include computation + to make R_V850_REl32 pc-relative. + +2003-06-03 Kaz Kojima + + * elf32-sh.c (sh_elf_size_dynamic_sections): Create .interp section + and DT_DEBUG dynamic tag even for position independent executables. + * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewize. + +2003-06-02 Daniel Jacobowitz + + * config.bfd: Move obsolete entries out of the range of the + targmatch sed script. + +2003-06-02 Daniel Jacobowitz + + * config.bfd (mips*-dec-bsd*, mips*-*-pe*): Mark as obsolete. + +2003-05-31 Jakub Jelinek + + * elf32-ppc.c (allocate_dynrelocs): Use single slot for first 8192 + plt entries, not just 8191. + +2003-05-30 Daniel Jacobowitz + + * elfxx-mips.c (_bfd_mips_elf_discard_info): Correct loop index. + Reported by Ken Faiczak . + +2003-05-30 Ulrich Drepper + Jakub Jelinek + + * elflink.h (elf_link_add_object_symbols): Use !info->executable + instead of info->shared where appropriate. + (bfd_elfNN_size_dynamic_sections, elf_link_output_extsym): Likewise. + * elflink.c (_bfd_elf_create_got_section): Likewise. + (_bfd_elf_link_create_dynamic_sections): Likewise. + (_bfd_elf_link_assign_sym_version): Likewise. + * elf32-i386.c (elf_i386_size_dynamic_sections): Create .interp section + and DT_DEBUG dynamic tag even for position independent executables. + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. + * elf32-s390.c (elf_s390_size_dynamic_sections: Likewise. + * elf64-ppc.c (ppc64_elf_size_dynamic_sections: Likewise. + * elf64-s390.c (elf_s390_size_dynamic_sections: Likewise. + * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections: Likewise. + * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections: Likewise. + * elf32-sparc.c (elf32_sparc_size_dynamic_sections: Likewise. + * elf64-alpha.c (elf64_alpha_size_dynamic_sections: Likewise. + * elf64-sparc.c (sparc64_elf_size_dynamic_sections: Likewise. + +2003-05-30 Kris Warkentin + + * elf.c (elfcore_grok_nto_status): Only set lwpid for the active or + signalled thread. + (elfcore_grok_nto_gregs): Only make .reg section for the active thread. + +2003-05-29 Nick Clifton + + * pef.c: Include "safe-ctype.h" instead of . + Tidy up formatting. + * Makefile.am: Add dependency on safe-ctype.h. + * Makefile.in: Regenerate. + +2003-05-29 Thiemo Seufer + + * elfxx-mips.c: Don't force symbols local unconditionally. + +2003-05-28 Alan Modra + + * elf32-hppa.c (elf32_hppa_relocate_section): Delete bogus + undefined_symbol call. + +2003-05-27 Richard Sandiford + + * elfxx-mips.c (mips_elf_hash_sort_data): Fix formattting. + (mips_elf_link_hash_table): Likewise. + +2003-05-22 Thiemo Seufer + + * elf64-mips.c (elf_mips_gnu_rel16_s2): Add internally used + R_MIPS_GNU_REL16_S2 support. + (bfd_elf64_bfd_reloc_type_lookup): Use it. + (mips_elf64_rtype_to_howto): Use it. + * elfn32-mips.c (elf_mips_gnu_rel16_s2): Add internally used + R_MIPS_GNU_REL16_S2 support. + (bfd_elf32_bfd_reloc_type_lookup): Use it. + (mips_elf_n32_rtype_to_howto): Use it. + +2003-05-21 Stuart F. Downing + + * som.h: Define PA_2_0 before including a.out.h + +2003-05-07 Eric Christopher + Alexandre Oliva + + * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Adjust + pic tests, change to warning. + (_bfd_mips_elf_final_link): Remove EF_MIPS_CPIC flag setting. + +2003-05-21 Marcus Comstedt + + * config.bfd: Check for a target triplet of shl-...-netbsdelf as + well as shle-...-netbsdelf. Remove duplicate entry. + +2003-05-21 Nick Clifton + + * elf32-xstormy16.c (xstormy16_elf_howto_table): Fix dst_mask + for X_STORMY16_REL_12 reloc. + + * elf.c (bfd_elf_get_needed_list): Use is_elf_hash_table to check + the type of the hash table in the bfd_link_info structure. + (bfd_elf_get_runpath_list): Likewise. + +2003-05-19 Roland McGrath + + * elf.c (bfd_elf_bfd_from_remote_memory): New function. + * bfd-in.h: Declare it. + * bfd-in2.h: Regenerated. + * elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): New function. + * elf-bfd.h (struct elf_backend_data): New function pointer member + elf_backend_bfd_from_remote_memory. + (_bfd_elf32_bfd_from_remote_memory, _bfd_elf64_bfd_from_remote_memory): + Declare them. + * elfxx-target.h (elf_backend_bfd_from_remote_memory): New macro. + (elfNN_bed): Add that to the initializer. + +2003-05-15 Roland McGrath + + * elf.c (elfcore_grok_note): Grok NT_AUXV note, make ".auxv" section. + +2003-05-20 Jakub Jelinek + + * elflink.h (elf_link_output_extsym): Only issue error about != + STV_DEFAULT symbols if they are bfd_link_hash_undefined. + +2003-05-20 H.J. Lu + + * elflink.c (_bfd_elf_merge_symbol): Check ELF_LINK_DYNAMIC_DEF + when removing the old definition for symbols with non-default + visibility. + +2003-05-18 Jason Eckhardt + + * elf32-i860.c (elf32_i860_relocate_highadj): Simplify calculation. + +2003-05-17 Andreas Schwab + + * elf32-m68k.c (elf_m68k_check_relocs): Cache reloc section in + elf_section_data during processing of pc-relative and absolute + relocations. + (elf_m68k_relocate_section): Use the cached reloc section instead + of computing it again. Fix handling of visibility. Don't modify + addend when copying over a relocation into the output. + +2003-05-17 Alan Modra + + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL + to trim plt entries. Move undefweak non-default visibility test.. + (allocate_dynrelocs): ..from here. + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't test + dynamic_sections_created here. Update comment. Move undefweak + non-default visibility test.. + (allocate_dynrelocs): ..from here. Fix comment. + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL + to trim plt entries. Move undefweak non-default visibility test.. + (allocate_dynrelocs): ..from here. Fix comment. + * elflink.h (elf_link_output_extsym): Compare ELF_ST_VISIBILITY with + STV_DEFAULT rather than comparing with zero. + * elflink.c (_bfd_elf_merge_symbol): Likewise. + (_bfd_elf_fix_symbol_flags): Likewise. Format comment. + +2003-05-17 Thiemo Seufer + + * bfd.c (_bfd_get_gp_value): Prevent illegal access for abfd null + pointers. + (_bfd_set_gp_value): Likewise. + +2003-05-16 Michael Snyder + From Bernd Schmidt + * archures.c (bfd_mach_h8300sx): New. + * bfd-in2.h: Regenerate. + * cpu-h8300.c (h8300_scan)): Add support for h8300sx. + (h8300sx_info_struct): New. + (h8300s_info_struct): Link to it. + * elf32-h8300.c (elf32_h8_mach): Add support for h8300sx. + (elf32_h8_final_write_processing): Likewise. + (elf32_h8_relax_section): Likewise. + +2003-05-16 Kelley Cook + + * config.bfd: Accept i[3-7]86 variants. + * configure.host: Likewise. + * configure.in: Likewise. + * configure: Regenerate. + +2003-05-15 H.J. Lu + + * elflink.c (_bfd_elf_fix_symbol_flags): Also hide protected + symbol. + +2003-05-15 H.J. Lu + + * elflink.h (elf_link_check_versioned_symbol): Also allow + the base version. + +2003-05-15 Alan Modra + H.J. Lu + + * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL. + (elf_i386_relocate_section): Likewise. + * elf32-ppc.c (allocate_dynrelocs): Likewise. + (ppc_elf_relocate_section): Likewise. + * elf64-ppc.c (allocate_dynrelocs): Likewise. + (ppc64_elf_relocate_section): Likewise. + +2003-05-15 Thiemo Seufer + + * elf32-mips.c (gprel32_with_gp): Remove useless N64 ABI case. + +2003-05-13 Stephane Carrez + + * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Check for + processor capability, allow merge of HC12 and HCS12 in some cases. + (m68hc11_elf_hash_table_create): Use bfd_malloc instead of bfd_zalloc. + * cpu-m68hc12.c (bfd_m68hc12s_arch): New struct. + (bfd_m68hc12_arch): Link it. + (scan_mach): New function. + +2003-05-13 Andrew Haley + + * elf.c (bfd_elf_hash): Mask lower 32 bits of hash. + +2003-05-13 Alan Modra + H.J. Lu + + * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Move from + elf32-ppc.c. Add ELF_LINK_FORCED_LOCAL check. + * elf32-ppc.c: (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Delete. + (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for dynreloc check. + (ppc_elf_relocate_section): Likewise. + * elf64-ppc.c (allocate_dynrelocs): Likewise. + (ppc64_elf_relocate_section): Likewise. Use for .got relocs too. + (ppc64_elf_adjust_dynamic_symbol): Don't assume symbols with .plt + relocs need no other types. + * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for + dynreloc check. + (elf_i386_relocate_section): Likewise. Use for .got relocs too. + (elf_i386_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL for + .got relocs. + +2003-05-13 Kaz Kojima + + * elf32-sh.c (sh_elf_adjust_dynamic_symbol): For weak symbols, + copy ELF_LINK_NON_GOT_REF from weakdef. + (allocate_dynrelocs): For undef weak syms with non-default + visibility, a) don't allocate plt entries, b) don't allocate + .got relocs, c) discard dyn rel space + (sh_elf_relocate_section): d) don't generate .got relocs, e) + don't generate dynamic relocs. + (sh_elf_copy_indirect_symbol): Don't copy ELF_LINK_NON_GOT_REF + for weakdefs when symbol already adjusted. + +2003-05-12 Nick Clifton + + * elf32-xstormy16.c (xstormy16_elf_howto_table): use 'bitfield' + overflow detection for R_XSTORMY16_16 reloc. + +2003-05-12 Paul Clarke + + * elf32-h8300.c: Fix typo in name of R_H8_DIR8 reloc. + +2003-05-11 Jason Eckhardt + + * elf32-i860.c (elf32_i860_relocate_highadj): Properly + adjust upper bits. + (elf32_i860_relocate_splitn): Obtain upper 5 bits from the + proper place. + (elf32_i860_relocate_pc16): Obtain upper 5 bits from the + proper place. + +2003-05-11 Andreas Schwab + + * elf32-m68k.c (elf_m68k_relocate_section): Replace ugly + complicated tests for unresolvable relocs with a simple direct + scheme using "unresolved_reloc" var. Report some detail on + bfd_reloc_outofrange and similar errors. + +2003-05-09 Martin Schwidefsky + + * elf32-s390.c (allocate_dynrelocs, elf_s390_relocate_section): + Fix WILL_CALL_FINISH_DYNAMIC_SYMBOL call. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO. + * elf64-s390.c: Likewise. + +2003-05-09 Martin Schwidefsky + + * elf32-s390.c (ELIMINATE_COPY_RELOCS): Define as one. + (elf_s390_adjust_dynamic_symbol): For weak symbols, copy + ELF_LINK_NON_GOT_REF from weakdef. + (elf_s390_copy_indirect_symbol): Test whether the weakdef sym has + already been adjusted before treating it specially. + * el64-s390.c: Likwise. + +2003-05-09 Martin Schwidefsky + + * elf32-s390.c (allocate_dynrelocs): For undef weak syms with + non-default visibility, a) don't make them dynamic, b) discard + space for dynamic relocs. + (elf_s390_relocate_section): Initialize the GOT entries and skip + R_390_{8,16,32}/R_390_PC{16,16DBL,32DBL,32} for weak undefined + symbols with non-default visibility. + * elf64-s390.c: Likewise. + +2003-05-09 Alan Modra + + * cpu-arm.c (arm_check_note): Warning fix. + * elf32-iq2000.c (iq2000_elf_check_relocs): Warning fixes. Arrange + to keep relocs if edited. + (iq2000_elf_print_private_bfd_data): Return TRUE. + * elfxx-ia64.c (elfNN_ia64_relax_section): Use ELFNN_R_SYM, not + ELF64_R_SYM. + (elfNN_ia64_relax_ldxmov): Warning fix. + * xtensa-isa.c (xtensa_add_isa): Warning fix. + * xtensa-modules.c (get_num_opcodes): Warning fix. + +2003-05-09 Andrey Petrov + + * elf.c (elf_fake_sections): Use correct cast for sh_name. + +2003-05-09 Alan Modra + + * elflink.c (_bfd_elf_link_create_dynamic_sections): Move from + elflink.h. Replace LOG_FILE_ALIGN with bed->s->log_file_align. + (_bfd_elf_create_dynamic_sections): Use bed->s->log_file_align. + (bfd_elf_record_link_assignment): Move from elflink.h. + (_bfd_elf_merge_symbol): Likewise. + (_bfd_elf_add_default_symbol): Likewise. + (_bfd_elf_export_symbol): Likewise. + (_bfd_elf_link_find_version_dependencies): Likewise. + (_bfd_elf_link_assign_sym_version): Likewise. + (_bfd_elf_link_read_relocs): Likewise. + (_bfd_elf_link_size_reloc_section): Likewise. + (_bfd_elf_fix_symbol_flags): Likewise. + (_bfd_elf_adjust_dynamic_symbol): Likewise. + (_bfd_elf_link_sec_merge_syms): Likewise. + (elf_link_read_relocs_from_section): Likewise. Use bed->s->sizeof_rel + and bed->s->sizeof_rela. + (_bfd_elf_link_output_relocs): Likewise. + * elf-bfd.h (struct elf_size_info): Rename file_align to + log_file_align. + (struct elf_info_failed): Move from elflink.h. + (struct elf_assign_sym_version_info): Likewise. + (struct elf_find_verdep_info): Likewise. + (_bfd_elf_create_dynamic_sections): Delete duplicate declaration. + (_bfd_elf_merge_symbol, _bfd_elf_add_default_symbol, + _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies, + _bfd_elf_link_assign_sym_version, + _bfd_elf_link_create_dynamic_sections, _bfd_elf_link_read_relocs, + _bfd_elf_link_size_reloc_section, _bfd_elf_link_output_relocs, + _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol, + _bfd_elf_link_sec_merge_syms): Declare. + (bfd_elf32_link_create_dynamic_sections): Don't declare. + (_bfd_elf32_link_read_relocs): Likewise. + (bfd_elf64_link_create_dynamic_sections): Likewise. + (_bfd_elf64_link_read_relocs): Likewise. + * elflink.h: Move lots o' stuff elsewhere. + * bfd-in.h (bfd_elf32_record_link_assignment): Don't declare. + (bfd_elf64_record_link_assignment): Likewise. + (bfd_elf_record_link_assignment): Declare. + * bfd-in2.h: Regenerate. + * elfcode.h (elf_link_create_dynamic_sections): Don't declare. + (NAME(_bfd_elf,size_info)): Adjust for log_file_align. + * elf.c (_bfd_elf_init_reloc_shdr): Adjust for bed->s->log_file_align. + (assign_file_positions_for_segments): Likewise. + (assign_file_positions_except_relocs): Likewise. + (swap_out_syms, elfcore_write_note): Likewise. + * elf-m10200.c: Adjust for changed function names. + * elf-m10300.c: Likewise. + * elf32-arm.h: Likewise. + * elf32-h8300.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-ip2k.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc1x.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mips.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-v850.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-sh64.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + (MIPS_ELF_LOG_FILE_ALIGN): Use log_file_align. + * elf64-alpha.c (alpha_elf_size_info): Adjust for log_file_align. + * elf64-hppa.c (hppa64_elf_size_info): Likewise. + * elf64-mips.c (mips_elf64_size_info): Likewise. + * elf64-s390.c (s390_elf64_size_info): Likewise. + * elf64-sparc.c (sparc64_elf_size_info): Likewise. + +2003-05-08 H.J. Lu + + * elflink.h (elf_add_default_symbol): After skipping the + unversioned symbol, go to non-default one. + +2003-05-07 H.J. Lu + + * elfxx-ia64.c (_bfd_elf_link_hash_hide_symbol): Also clear the + want_plt field. + (elfNN_ia64_relocate_section): Don't do dynamic symbol lookup + for symbols with non-default visibility. + +2003-05-07 H.J. Lu + + * elflink.h (elf_link_check_versioned_symbol): Also handle the + case that a DSO references a hidden symbol which may be + satisfied by a versioned symbol in another DSO. + (elf_link_output_extsym): Check versioned definition for hidden + symbol referenced by a DSO. + +2003-05-07 Nick Clifton + + * elf32-xstormy16.c (xstormy16_elf_howto_table): Reset + R_XSTORMY16_16 reloc to ignore overflows. + +2003-05-06 Alexandre Oliva + + * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Improve + error message for mixing different-endian files. Check for ABI + compatibility of input files with the selected emulation. + +2003-05-05 Alan Modra + + * elf32-i386.c (allocate_dynrelocs): For undef weak syms with + non-default visibility, a) don't make them dynamic, b) discard + space for dynamic relocs. + * elf64-x86-64.c (allocate_dynrelocs): Likewise. + + * elf32-ppc.c (allocate_dynrelocs): For undef weak syms with + non-default visibility, a) don't allocate plt entries, b) don't + allocate .got relocs, c) discard dyn rel space, + (ppc_elf_relocate_section): d) don't generate .got relocs, e) + don't generate dynamic relocs. + * elf64-ppc.c (allocate_dynrelocs): As above. + (ppc64_elf_relocate_section): As above. + +2003-05-05 Andreas Jaeger + + * elf64-x86-64.c (allocate_dynrelocs): Don't allocate dynamic + relocation entries for weak undefined symbols with non-default + visibility. + (elf64_x86_64_relocate_section): Initialize the GOT entries and + skip R_386_32/R_386_PC32 for weak undefined symbols with + non-default visibility. + +2003-05-04 H.J. Lu + + * elf32-i386.c (allocate_dynrelocs): Don't allocate dynamic + relocation entries for weak undefined symbols with non-default + visibility. + (elf_i386_relocate_section): Initialize the GOT entries and + skip R_386_32/R_386_PC32 for weak undefined symbols with + non-default visibility. + + * elfxx-ia64.c (allocate_fptr): Don't allocate function + descriptors for weak undefined symbols with non-default + visibility. + (allocate_dynrel_entries): Don't allocate relocation entries + for symbols resolved to 0. + (set_got_entry): Don't install dynamic relocation for weak + undefined symbols with non-default visibility. + (set_pltoff_entry): Likewise. + + * elflink.h (elf_fix_symbol_flags): Hide weak undefined symbols + with non-default visibility. + (elf_link_output_extsym): Don't make weak undefined symbols + with non-default visibility dynamic. + +2003-05-04 H.J. Lu + + * elflink.h (elf_merge_symbol): Correctly handle weak definition. + +2003-05-04 H.J. Lu + + * elflink.h (elf_merge_symbol): Don't record a hidden/internal + symbol dynamic. Check indirection when removing the old + definition for symbols with non-default visibility. + (elf_add_default_symbol): Skip when told by elf_merge_symbol. + +2003-05-02 Nick Clifton + + * elf32-xstormy16.c (xstormy16_elf_howto_table): Make the + R_XSTORMY16_8 and R_XSTORMY16_16 relocs detect and complain about + unsigned overflow. + +2003-05-02 Andreas Jaeger + + * elf64-x86-64.c (elf_x86_64_copy_indirect_symbol): Don't copy + ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted. + (ELIMINATE_COPY_RELOCS): Define as one. Use throughout. + (elf_x86_64_adjust_dynamic_symbol): For weak symbols, copy + ELF_LINK_NON_GOT_REF from weakdef. + +2003-05-02 Charles Lepple + Nick Clifton + + * acinclude.m4: Fix name of --enable-install-libbfd switch. + * aclocal.m4: Regenerate. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2003-05-01 Alan Modra + + * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Test whether the + weakdef sym has already been adjusted before treating it specially. + * elf32-i386.c (elf_i386_copy_indirect_symbol): Don't copy + ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted. + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. + (ppc64_elf_check_relocs): Set ELF_LINK_NON_GOT_REF. + +2003-04-28 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_section): Relax ldxmov during + the relax finalize pass. + + * section.c (struct sec): Add need_finalize_relax and remove + flag11. + (STD_SECTION): Update struct sec initializer. + * bfd-in2.h: Regenerated. + +2003-04-28 H.J. Lu + + * elflink.h (elf_merge_symbol): Call elf_backend_copy_indirect_symbol + to copy any information related to dynamic linking when we flip + the indirection. + +2003-04-27 H.J. Lu + + * elf-bfd.h (ELF_LINK_DYNAMIC_DEF): New. + (ELF_LINK_DYNAMIC_WEAK): New. + + * elflink.h (elf_merge_symbol): Add one argument to indicate if + a symbol should be skipped. Ignore definitions in dynamic + objects for symbols with non-default visibility. + (elf_add_default_symbol): Adjusted. + (elf_link_add_object_symbols): Check if a symbol should be + skipped. Don't merge the visibility field with the one from + a dynamic object. + (elf_link_check_versioned_symbol): Use undef_bfd. + (elf_link_output_extsym): Warn if a forced local symbol is + referenced from dynamic objects. Make non-weak undefined symbol + with non-default visibility a fatal error. + +2003-04-27 Daniel Jacobowitz + + * configure.in: Bump version on HEAD to 2.14.90. + * configure: Regenerated. + +2003-04-26 Stephane Carrez + + PR savannah/3331: + * elf32-m68hc11.c (m68hc11_elf_relax_section): Clear prev_insn_group + when we couldn't relax something. + +2003-04-25 Alan Modra + + * elflink.h (elf_merge_symbol): When we find a regular definition + for an indirect symbol, flip the indirection so that the old + direct symbol now points to the new definition. + +2003-04-24 Roland McGrath + + * elf.c (bfd_section_from_phdr): Map PT_GNU_EH_FRAME to "eh_frame_hdr". + +2003-04-24 Alan Modra + + * elf32-ppc.c: Formatting and comment fixes. + (ELIMINATE_COPY_RELOCS): Move before ppc_elf_copy_indirect_symbol. + (ppc_elf_copy_indirect_symbol): Copy flags here for weakdefs. + +2003-04-24 Dhananjay Deshpande + + * archures.c (bfd_mach_h8300hn, bfd_mach_h8300sn): Added. + * bfd-in2.h: Rebuilt. + * coff-h8300.c (BADMAG): Add check for H8300HNBADMAG & H8300SNBADMAG. + * coffcode.h (coff_set_arch_mach_hook): Add case for H8300HNMAGIC + & H8300SNMAGIC. + (coff_set_flags): Add case for bfd_mach_h8300hn & bfd_mach_h8300sn. + * cpu-h8300.c (h8300_scan): Handle h8300hn, h8300sn. + (h8300sn_info_struct, h8300hn_info_struct): New. + * elf32-h8300.c (elf32_h8_mach): Handle case for h8300hn & h8300sn + (elf32_h8_final_write_processing): Likewise. + +2003-04-23 Kaz Kojima + + * elf32-sh.c (tpoff): New. + (struct elf_sh_dyn_relocs): Remove tls_tpoff32. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO. + (allocate_dynrelocs): Don't make unnecessary dynamic TLS + relocations. Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses. + (sh_elf_relocate_section): Likewise. Remove unnecessary tests. + (dtpoff_base): Fix wrong indentation. + (sh_elf_check_relocs): Don't set DF_STATIC_TLS flag with non-TLS + relocations. Don't set tls_tpoff32 flag. Don't make unnecessary + R_SH_TLS_TPOFF32 relocations. + +2003-04-23 J"orn Rennecke + + * archures.c (enum bfd_architecture): Amend comment to refer to SuperH. + * cpu-sh.c: Likewise. + * elf32-sh.c: Likewise. + * reloc.c (bfd_reloc_code_real): Likewise. + * elf32-sh64-com.c: Change comment to refer to SuperH. + * elf32-sh64.c: Likewise. + * elf64-sh64.c: Likewise. + * bfd-in2.h (enum bfd_architecture): Regenerate. + +2003-04-23 Alan Modra + + From Julien LEMOINE + * elf32-i386.c (elf_i386_info_to_howto): Delete. + (elf_info_to_howto): Define as elf_i386_info_to_howto_rel. + +2003-04-22 Kazuhiro Inaoka + + * archures.c: Replace references to Mitsubishi M32R with references + to Renesas M32R. + * relocs.c: Likewise. + * bfd-in2.h: Regenerate. + +2003-04-21 Richard Henderson + + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Return false for an + executable when a symbol is defined both regular and dynamic. + +2003-04-21 Stephane Carrez + + * Makefile.am (BFD32_BACKENDS): Add elf32-m68hc1x.lo. + (elf32-m68hc1x.lo): Update dependencies + * configure.in: Add elf32-m68hc1x.lo. + * configure: Rebuild. + * Makefile.in: Rebuild. + +2003-04-21 Stephane Carrez + + * elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) + (m68hc11_elf_hash_table_create): New function. + (elf32_m68hc11_link_hash_table_free): New function. + (stub_hash_newfunc): New function. + (m68hc11_add_stub): New function. + (elf32_m68hc11_add_symbol_hook): New function. + (elf32_m68hc11_setup_section_lists): New function. + (elf32_m68hc11_next_input_section): New function. + (elf32_m68hc11_size_stubs): New function. + (elf32_m68hc11_build_stubs): New function. + (m68hc11_get_relocation_value): New function. + (elf32_m68hc11_relocate_section): Call the above to redirect + some relocations to the trampoline code. + (m68hc11_elf_export_one_stub): New function. + (m68hc11_elf_set_symbol): New function. + (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. + (m68hc11_elf_get_bank_parameters): Get parameters only when the info + is not yet initialized. + + * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) + (elf32_m68hc11_stub_hash_entry): New struct. + (m68hc11_page_info): Add trampoline handler address. + (m68hc11_elf_link_hash_table): Add stubs generation members. + (elf32_m68hc11_add_symbol_hook): Declare. + (elf32_m68hc11_setup_section_lists): Declare. + (elf32_m68hc11_size_stubs): Declare. + (elf32_m68hc11_build_stubs): Declare. + + * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. + (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. + (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. + (_bfd_m68hc11_elf_set_private_flags): Ditto. + (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. + (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. + (bfd_elf32_bfd_link_hash_table_create): Define. + (elf_backend_add_symbol_hook): Define. + (m68hc11_elf_bfd_link_hash_table_create): New function. + (m68hc11_elf_build_one_stub): New function. + (m68hc11_elf_size_one_stub): New function. + (m68hc11_elf_bfd_link_hash_table_create): Install the above. + (bfd_elf32_bfd_link_hash_table_create): Define. + + * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. + (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. + (m68hc12_phys_addr): Ditto. + (m68hc12_phys_page): Ditto. + (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. + (elf32_m68hc11_gc_mark_hook): Likewise. + (elf32_m68hc11_gc_sweep_hook): Likewise. + (elf32_m68hc11_check_relocs): Likewise. + (elf32_m68hc11_relocate_section): Likewise. + (_bfd_m68hc12_elf_set_private_flags): Likewise. + (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. + (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. + (m68hc12_elf_build_one_stub): New function. + (m68hc12_elf_size_one_stub): New function. + (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. + (elf_backend_add_symbol_hook): Define. + (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks. + +2003-04-18 Nick Clifton + + * format.c (bfd_check_format_matches): Only check associated + vector if the matching_vector has been created. + +2003-04-15 Alexandre Oliva + + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Fix typo in + 2003-04-09's change. + +2003-04-15 Brian Ford + + * peicode.h (coff_swap_scnhdr_in): If a section holds + uninitialized data and is from an object file or from an + executable image that has not initialized the s_size field, or if + the physical size is padded, use the virtual size (stored in + s_paddr) instead. + +2003-04-15 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): Properly report + filename for alignment reduction. + +2003-04-15 Rohit Kumar Srivastava + + * archures.c: Replace occurrances of 'Hitachi' with 'Renesas'. + * reloc.c: Likewise. + * coff-h8300.c: Likewise. + * coff-h8500.c: Likewise. + * coff-sh.c: Likewise. + * cpu-h8300.c: Likewise. + * cpu-sh.c: Likewise. + * elf32-h8300.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sh64-com.c: Likewise. + * elf32-sh64.c: Likewise. + * elf64-sh64.c: Likewise. + * bfd-in2.h: Regenerate. + +2003-04-14 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): Maintain maximum + alignment for common symbols. Warn reducing alignment for + common symbols. Report old filename when symbol size changes. + +2003-04-12 Alexandre Oliva + + * elfxx-mips.c (mips_elf_calculate_relocation): Adjust two other + occurrences of the same test changed in the previous patch. + Optimize. + +2003-04-11 Alexandre Oliva + + * elfxx-mips.c (mips_elf_get_global_gotsym_index): New. + (mips_elf_calculate_relocation): Decay GOT_PAGE/GOT_OFST to + GOT_DISP/addend only if the symbol got a global GOT entry. + +2003-04-10 Alexandre Oliva + + * elfxx-mips.c (mips_elf_calculate_relocation): Decay + GOT_PAGE/GOT_OFST referencing overridable symbol to + GOT_DISP/addend. + (_bfd_mips_elf_check_relocs): Handle GOT_PAGE referencing + global symbol as GOT_DISP. + +2003-04-10 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_relocate_section): Don't continue to the + next relocation on an undefined symbol. + +2003-04-09 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section) : + Ignore relocations against r_symndx == 0. + +2003-04-09 H.J. Lu + + * elf64-alpha.c (elf64_alpha_relocate_section): Don't return + FALSE for undefined symbols. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + +2003-04-09 Alexandre Oliva + + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Try DWARF3-standard + and IRIX-specific shift-to-64-bit 4-byte lengths before following + addr_size. + +2003-04-08 Alexandre Oliva + + * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): Detect (ctor) + pointer size from ABI, not arch_bits_per_address. + +2003-04-07 Kevin Buettner + + * elfn32-mips.c (elf32_mips_grok_prstatus): Adjust core file related + constants for n32 ABI. + +2003-04-06 Andrew Cagney + + * simple.c (bfd_simple_get_relocated_section_contents): Disable + free that leads to GDB vs BFD memory corruption. + +2003-04-04 Stephane Carrez + + * elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Also adjust + symbols that mark the end of the section. + (m68hc11_elf_relax_section): Use R_M68HC11_PCREL_8 relocs when + converting to a relative branch so that the offset is computed after + the relaxation; also relocate a jsr into a bsr if possible but don't + relax them if they are to a far symbol as we need to call the + trampoline code. + (elf_m68hc11_howto_table): Set pcrel_offset to true. + +2003-04-04 Svein E. Seldal + + * archures.c: Namespace cleanup. Rename bfd_mach_c3x to + bfd_mach_tic3x and bfd_mach_c4x to bfd_mach_tic4x + * bfd-in2.h: Regenerate + * coff-tic4x.c: Namespace cleanup. Replace s/c4x/tic4x/ + * cpu-tic4x.c: Ditto + +2003-04-03 Nick Clifton + + * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Compute ps and ss + differently for object files and executables. + * peicode.h (coff_swap_scnhdr_in): Only set the s_size field + for object files or for executables who have not already + initialised the field. + * libpei.h (bfd_pe_executable_p): New macro. Return true if + the PE format bfd is an executable. + +2003-04-03 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Don't use SYMBOL_REFERENCES_LOCAL + here as it's too early to reliably determine locality. + (ppc_elf_gc_sweep_hook): Likewise. + (SYMBOL_REFERENCES_LOCAL): Expand comment. + +2003-04-02 Bob Wilson + + * xtensa-modules.c: Remove comment indicating that this is a + generated file. + +2003-04-02 Alan Modra + + * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Test for NULL dynobj. + +2003-04-01 Bob Wilson + + * Makefile.am (ALL_MACHINES): Add cpu-xtensa.lo. + (ALL_MACHINES_CFILES): Add cpu-xtensa.c. + (BFD32_BACKENDS): Add elf32-xtensa.lo, xtensa-isa.lo, and + xtensa-modules.lo. + (BFD32_BACKENDS_CFILES): Add elf32-xtensa.c, xtensa-isa.c, and + xtensa-modules.c. + (cpu-xtensa.lo): New target. + (elf32-xtensa.lo): Likewise. + (xtensa-isa.lo): Likewise. + (xtensa-modules.lo): Likewise. + * Makefile.in: Regenerate. + * archures.c (bfd_architecture): Add bfd_{arch,mach}_xtensa. + (bfd_archures_list): Add bfd_xtensa_arch. + * config.bfd: Handle xtensa-*-*. + * configure.in: Handle bfd_elf32_xtensa_{le,be}_vec. + * configure: Regenerate. + * reloc.c: Add BFD_RELOC_XTENSA_{RTLD,GLOB_DAT,JMP_SLOT,RELATIVE, + PLT,OP0,OP1,OP2,ASM_EXPAND,ASM_SIMPLIFY}. + * targets.c (bfd_elf32_xtensa_be_vec): Declare. + (bfd_elf32_xtensa_le_vec): Likewise. + (bfd_target_vector): Add bfd_elf32_xtensa_{be,le}_vec. + * cpu-xtensa.c: New file. + * elf32-xtensa.c: Likewise. + * xtensa-isa.c: Likewise. + * xtensa-modules.c: Likewise. + * libbfd.h: Regenerate. + * bfd-in2.h: Likewise. + +2003-04-01 Nick Clifton + + * archures.c (bfd_mach_arm_unknown): Define. + * bfd-in.h (bfd_arm_merge_machines, bfd_arm+update_notes, + bfd_arm_get_mach_from_notes): Prototype. + * bfd-in2.h: Regenerate. + * coff-arm.c (coff_arm_merge_private_bfd_data): Call + bfd_arm_merge_machines. + (coff_arm_final_link_postscript): Call bfd_arm_update_notes. + * coffcode.h (coff_set_arch_mach_hook): Call + bfd_arm_get_mach_from_notes. + * coffgen.c (coff_real_object_p): Revert previous delta. + * cpu_arm.c (arm_check_note): New function. Examine a note in a + .note section. + (bfd_arm_merge_machines): New function: Handle the merging of ARM + binaries compiled for different architectures.. + (bfd_arm_update_notes): New function: Update an ARM note section. + (bfd_arm_get_mach_from_notes): New function: Extract a bfd machine + number from an ARM note section. + * elf32-arm.h (elf32_arm_object_p): Use + bfd_arm_get_mach_from_notes. + (elf32_arm_merge_private_bfd_data): Use bfd_arm_merge_machines. + (elf32_arm_final_write_processing): Use bfd_arm_update_notes. + +2003-04-01 Ben Elliston + + * dwarf2.c (read_attribute_value): Correct typo in comment. + +2003-04-01 Nick Clifton + + * dwarf2.c (concat_filename): Use bfd_malloc() and strdup() + instead of concat(). + (decode_line_info): Only free filename if it is not NULL. + (add_line_info): Make a copy of the filename when storing it into + the info structure. + +2003-03-31 Andreas Schwab + Daniel Jacobowitz + + * simple.c (bfd_simple_get_relocated_section_contents): Add + parameter symbol_table. Optionally use it instead of the symbol + table from the bfd. Save and restore output offsets and output + sections around bfd_get_relocated_section_contents. Fix a memory + leak. + (simple_save_output_info, simple_restore_output_info): New + functions. + * bfd-in2.h: Regenerate. + * dwarf2.c (read_abbrevs): Use + bfd_simple_get_relocated_section_contents instead of + bfd_get_section_contents. + (decode_line_info): Likewise. + (_bfd_dwarf2_find_nearest_line): Likewise. Don't call + find_rela_addend. + (find_rela_addend): Remove. + * elfxx-ia64.c (elfNN_ia64_reloc): Weaken sanity check for + debugging sections. + (elfNN_ia64_hash_table_create): Create the hash table with malloc, + not bfd_zalloc. + +2003-03-31 David Heine + + * aoutx.h (aout_link_hash_table_create): Use bfd_malloc instead of + bfd_alloc. + * dwarf2.c (concat_filename): Always allocate space for the + returned filename. + (decode_line_info): Free the allocated filename returned by + concat_filename. + * elf-eh-frame.c (bfd_elf_write_section_eh_frame): Fix memory leaks. + * elf.c (copy_private_bfd_data): Likewise. + (_bfd_elf_slurp_version_tables): Fix bug freeing contents pointer. + * elflink.h (elf_link_sort_relocs): Fix memory leak. + * format.c (bfd_check_format_matches): Likewise. + * linker.c (bfd_generic_final_link): Likewise. + * opncls.c (find_separate_debug_info): Likewise. + * simple.c (bfd_simple_get_relocated_section_contents): Likewise. + +2003-03-28 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): Correctly combine + visibilities. + +2003-03-27 Jakub Jelinek + + * elfxx-ia64.c (elfNN_ia64_relax_section): Reset self_dtpmod_offset + to -1 before recomputing got offsets. + +2003-03-26 Andreas Schwab + + * elf32-m68k.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (elf_m68k_relocate_section): Use it to correctly handle symbols + forced to be local. + (elf_m68k_finish_dynamic_symbol): Emit RELATIVE reloc for got + entries for symbols that are forced to be local. + +2003-03-25 Alexandre Oliva + + * elfxx-mips.c (_bfd_mips_relax_section): New function. + * elfxx-mips.h (_bfd_mips_relax_section): Declare. + * elfn32-mips.c, elf64-mips.c: Use it. + +2003-03-25 Stan Cox + Nick Clifton + + Contribute support for Intel's iWMMXt chip - an ARM variant: + + * archures.c: Add bfd_mach_arm_iWMMXt. + * reloc.c: Add BFD_RELOC_ARM_CP_OFF_IMM_S2. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * coff-arm.c (coff_arm_merge_private_bfd_data): Allow iWMMXt + object files to be linked with XScale ones. + (coff_arm_final_link_postscript): Update note section. + * coffcode.h (coff_set_arch_mach_hook): Handle note section. + * coffgen.c (coff_real_object_p): Call bfd_coff_set_arch_mach_hook + after identifying a coff binary. + * cpu-arm.c (processors): Add iWMMXt. + (arch_inf): Likewise. + * elf32-arm.h (arm_object_p): Handle note section. + (elf32_arm_merge_private_bfd_data): Allow iWMMXt object files to + be linked with XScale ones. + (elf32_arm_section_flags): New function: Set flags on note section. + (elf32_arm_final_write_processing): Handle note section. + +2003-03-21 DJ Delorie + + * elf32-xstormy16.c (elf32_xstormy16_relocate_section): Call + _bfd_elf_rela_local_sym. + +2003-03-20 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_section): Don't try relax for + non-ELF outputs. + +2003-03-20 Nick Clifton + + * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Initialise $idata2 and + $idata5 in case bfd_coff_final_link is not called. + +2003-03-19 Jakub Jelinek + + * elf64-sparc.c (struct sparc64_elf_section_data): Add reloc_count + field. + (canon_reloc_count): Define. + (sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table, + sparc64_elf_canonicalize_dynamic_reloc): Use it instead of + reloc_count. + (sparc64_elf_canonicalize_reloc): New routine. + (bfd_elf64_canonicalize_reloc): Define. + +2003-03-18 Jakub Jelinek + + * elfxx-ia64.c (elfNN_ia64_relax_section): Handle relaxation + againt mergeable sections. Take r_addend into account when caching + trampolines. + +2003-03-18 Richard Henderson + + * elfxx-ia64.c (get_dyn_sym_info): Return NULL gracefully for + local symbols that have no dyninfo. + +2003-03-14 Gene Smith + + * ieee.c (ieee_write_expression): Handle the case where symbol is + NULL. + General formatting improvements. + +2003-03-13 Nick Clifton + + * configure.in (LINGUAS): Add zh_CN. + * configure: Regenerate. + * po/zh_CN.po: New file. + +2003-03-13 Elias Athanasopoulos + + * aout-cris.c (BYTES_IN_WORD): Don't define. + aout-encap.c: Likewise. + aout-ns32k.c: Likewise. + aout-tic30.c: Likewise. + hp300bsd.c: Likewise. + i386aout.c: Likewise. + i386dynix.c: Likewise. + i386linux.c: Likewise. + i386lynx.c: Likewise. + i386mach3.c: Likewise. + m68k4knetbsd.c: Likewise. + m68klinux.c: Likewise. + m68klynx.c: Likewise. + m68knetbsd.c: Likewise. + m88kmach3.c: Likewise. + mipsbsd.c: Likewise. + newsos3.c: Likewise. + sparclinux.c: Likewise. + sparclynx.c: Likewise. + sparcnetbsd.c: Likewise. + vaxbsd.c: Likewise. Fix comment formatting. + +2003-03-12 Alexandre Oliva + + * Reverted 2003-03-02's patch. + + * elfxx-target.h (bfd_elfNN_canonicalize_reloc): Make it + overridable. + * elf64-mips.c (mips_elf64_canonicalize_reloc, + mips_elf64_get_dynamic_reloc_upper_bound, + mips_elf64_canonicalize_dynamic_reloc): New, adapted from elf.c. + (bfd_elf64_get_canonicalize_reloc, + bfd_elf64_get_dynamic_reloc_upper_bound, + bfd_elf64_canonicalize_dynamic_reloc): Define. + (mips_elf64_slurp_reloc_table): Support dynamic. + (mips_elf64_slurp_one_reloc_table): Adjust. + +2003-03-12 Nick Clifton + + * xsym.c (bfd_sym_fetch_type_information_table_entry): Change + 'index' to 'offset' in test for zero value. + +2003-03-11 Alexandre Oliva + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Do not create + dynamic relocations pointing to local or section symbols, use the + NULL symbol instead. Document the choice to not emit an + additional R_MIPS_64 relocation. + +2003-03-11 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Subtract tls seg vma from + zero index dynamic tls relocs generated for the GOT. Tidy code. + Set "relocation" to 1 on DTPMOD32 relocs. Optimize HA adjustment. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + +2003-03-07 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Don't look for a nop after + a tls_get_addr call. + + * elf32-ppc.c (ELIMINATE_COPY_RELOCS): Define as one. + (ppc_elf_adjust_dynamic_symbol): For weak symbols, copy + ELF_LINK_NON_GOT_REF from weakdef. + * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define as one. + (ppc64_elf_adjust_dynamic_symbol): For weak symbols, copy + ELF_LINK_NON_GOT_REF from weakdef. + * elf32-i386.c (ELIMINATE_COPY_RELOCS): Define as one. Use throughout. + (elf_i386_adjust_dynamic_symbol): For weak symbols, copy + ELF_LINK_NON_GOT_REF from weakdef. + +2003-03-06 Jakub Jelinek + Andrew Haley + + * elflink.h (elf_bfd_discard_info): Don't process eh frames if + output is relocateable. + +2003-03-06 Steven Konopa + + * som.c (som_fixup_formats): Correct formats for R_AUX_UNWIND and + R_COMMENT. + +2003-03-06 Alan Modra + + * elf32-ppc.c (ppc_elf_create_linker_section): Don't capitalize + error messages. + (ELIMINATE_COPY_RELOCS): Define to zero. + (ppc_elf_relocate_section): Don't deref htab->tls_sec when calculating + TLSLD relocs. Report reloc types on a number of errors. Optimize + LOCAL24PC check for non-local syms. Don't capitalize error messages. + * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define to zero. + (ppc64_elf_relocate_section): Don't deref htab->tls_sec when + calculating TLSLD relocs. Report reloc types on a number of errors. + Don't capitalize error messages. + +2003-03-03 H.J. Lu + + * elfxx-ia64.c (USE_BRL): Removed. + (oor_ip): Removed. + +2003-03-03 J"orn Rennecke + + * elf32-sh.c (sh_elf_howto_tab): Make R_SH_IND12W into an ordinary + relocation (no special function), and make it non-partial_inplace. + (sh_elf_relax_section): When creating a bsr, use a consistent value + no matter if the symbol is extern or not; set addend to -4. + Don't swap load / non-load instructions for SH4. + (sh_elf_relax_delete_bytes): In R_SH_IND12W case, check the offset + rather than if the symbol is external to determine if adjusting the + offset makes sense. Adjust the addend too if appropriate. + (sh_elf_relocate_section): In R_SH_IND12W, don't fiddle with the + relocation. + +2003-03-03 Nick Clifton + + * po/da.po: Installed latest translation. + +2003-03-02 Thiemo Seufer + + * elf32-mips.c (elf_mips_howto_table_rel): Change definition of + R_MIPS_PC16 to rightshift 2. + (elf_reloc_map mips_reloc_map): Map to rightshifted BFD reloc. + (bfd_elf32_bfd_reloc_type_lookup): Support + BFD_RELOC_MIPSEMB_16_PCREL_S2. + * elf64-mips.c (mips_elf64_howto_table_rel): Change definition of + R_MIPS_PC16 to rightshift 2. + (mips_elf64_howto_table_rela): Likewise. + (mips_reloc_map): Map to rightshifted BFD reloc. + * elfn32-mips.c: The same as in elf64-mips.c. + * elfxx-mips.c (mips_elf_got_for_ibfd): Typo in comment. + (mips_elf_calculate_relocation): Handle rightshifted addends for + R_MIPS_PC16. + * reloc.c (BFD_RELOC_MIPSEMB_16_PCREL_S2): New BFD relocation for + MIPS Embedded PIC. Remove superfluous empty COMMENT. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2003-02-28 Richard Henderson + + * elfxx-ia64.c (elfNN_ia64_relax_section): Correct bounds + for ltoff22x relaxation. + +2003-03-01 Alan Modra + + * bfd-in.h (_bfd): Don't define. + * bfd.c: Rename occurrences of "struct _bfd" to "struct bfd". + * syms.c: Likewise. + * bfd-in2.h: Regenerate. + +2003-02-27 Richard Henderson + + * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add want_gotx; + (elfNN_ia64_check_relocs): Set it. + (allocate_global_data_got): Check it. + (allocate_local_got): Likewise. + (allocate_dynrel_entries): Likewise. + (elfNN_ia64_relax_ldxmov): New. + (elfNN_ia64_relax_section): Handle LTOFF22X, LDXMOV. + (elfNN_ia64_choose_gp): Split out from ... + (elfNN_ia64_final_link): ... here. + +2003-02-27 Andrew Cagney + + * bfd.c (struct bfd): Rename "struct _bfd". + * bfd-in.h: Update copyright. + (struct bfd): Rename "struct _bfd". + (_bfd): Define for backward compatibility. + * bfd-in2.h: Regenerate. + +2003-02-25 Alan Modra + + * elflink.h (elf_bfd_final_link): Apportion reloc counts to rel_hdr + and rel_hdr2 when initially counting input relocs rather than after + creating output reloc sections. + (elf_link_read_relocs_from_section): Don't abort with wrong reloc + sizes. + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2003-02-24 Kris Warkentin + + * elf.c (elfcore_read_notes): Add check for QNX style core file. + (elfcore_grog_nto_note): New function. + (elfcore_grog_nto_gregs): New function. + (elfcore_grog_nto_status): New function. + +2003-02-24 Alan Modra + + * elflink.c (_bfd_elf_create_got_section): Check existing .got + section flags before concluding that we've already been called. + Don't use register keyword. + (_bfd_elf_create_dynamic_sections): Don't use register keyword. + (_bfd_elf_create_linker_section): Formatting. + +2003-02-20 jmc + + * coff-h8300.c: Fix typo: intial -> initial. + * coff-ppc.c: Likewise. + +2003-02-20 Alan Modra + + * elf32-ppc.c: Formatting. + (allocate_dynrelocs): LD and GD relocs against the same sym need + separate GOT entries. + (ppc_elf_relocate_section): Correct GOT handling for multiple GOT + entries per symbol. + +2003-02-19 Alan Modra + + * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Simplify dynamic reloc + removal. Localize vars. Remove unnecessary dynobj test. + * elf32-i386 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead + of INFO. + (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses, + and optimize. + (elf_i386_relocate_section): Likewise. + (elf_i386_gc_sweep_hook): Simplify dyn reloc removal. Localize vars. + * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise. + * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise. + * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise. + * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise. + * elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise. Remove + local_dynrel for section too. Don't touch HIPLT22, LOPLT10, PCPLT32 + or PCPLT10 relocs. Don't subtract twice on PLT32 relocs. + Formatting. + + * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define. + (ppc64_elf_check_relocs): Use it. Correct comment. Move SEC_ALLOC + test. + (ppc64_elf_adjust_dynamic_symbol): Use ELIMINATE_COPY_RELOCS. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO. + (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses, + and optimize. Use ELIMINATE_COPY_RELOCS. + (ppc64_elf_relocate_section): Likewise. + + * elf32-ppc.c (struct ppc_elf_dyn_relocs): Add pc_count field. + (ppc_elf_copy_indirect_symbol): Copy pc_count field. + (ELIMINATE_COPY_RELOCS): Define. + (ppc_elf_adjust_dynamic_symbol): Convert copy relocs to dynamic. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO. + (MUST_BE_DYN_RELOC): Define. + (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses, + and optimize. Trim dyn_relocs. + (ppc_elf_check_relocs): Don't generate dyn_relocs when we know they'll + not be used. Do generate dyn_relocs for copy reloc avoidance. Keep + track of pc_rel dyn relocs. + (ppc_elf_relocate_section): Remove "will_become_local". Adjust + WILL_CALL_FINISH_DYNAMIC_SYMBOL use. Trim dyn relocs as per + allocate_dynrelocs. Don't recalculate "sec". + +2003-02-18 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Remove unnecessary test. + * elf64-ppc.c (ppc64_elf_tls_optimize): Decrement tlsld_got.refcount + on invalid LD relocs. + (allocate_dynrelocs): Invalid LD relocs don't use tlsld_got entry. + (ppc64_elf_relocate_section): Unify new handling of LD relocs and + tlsld_got entry. Use IS_PPC64_TLS_RELOC. + + * elf32-ppc.h: New file. + * elf32-ppc.c: Include elf32-ppc.h. + (NOP, CROR_151515, CROR_313131, TP_OFFSET, DTP_OFFSET): Define. + (struct ppc_elf_link_hash_entry): Rename "root" to "elf". Adjust uses. + Add "tls_mask" field. + (TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL, TLS_TLS, TLS_TPRELGD): Define. + (struct ppc_elf_link_hash_table): Rename "root" to "elf". Adjust uses. + Add got, relgot, plt, relplt, dynbss, relbss, dynsbss, relsbss, + sdata, sdata2, tls_sec, tls_get_addr, tlsld_got fields. + Make use of htab shortcuts throughout file. + (ppc_elf_link_hash_newfunc): Init tls_mask field. + (ppc_elf_link_hash_table_create): Init new fields. + (ppc_elf_copy_indirect_symbol): Copy tls_mask. + (ppc_elf_howto_raw): Add tls relocs. + (ppc_elf_reloc_type_lookup): Handle them. + (ppc_elf_unhandled_reloc): New function. + (ppc_elf_create_got): Stash got section pointer in hash table, + return status. Make .rela.got too. + (ppc_elf_create_dynamic_sections): Stash section pointers in htab. + (ppc_elf_adjust_dynamic_symbol): Only set up copy relocs when + NON_GOT_REF set. Don't allocate space in .plt here.. + (allocate_dynrelocs): ..do so here instead, properly ref-counting and + not allocating plt entries unnecessarily. Allocate got entries here. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (ppc_elf_size_dynamic_sections): Allocate local got entries. Pass + "info" during allocate_dynrelocs hash traversal. Use htab section + shortcuts rather than searching for named sections. Get rid of + "plt" and "strip" booleans. + (update_local_sym_info, bad_shared_reloc): New functions. + (ppc_elf_check_relocs): Handle TLS relocs. Move .rela.got creation to + ppc_elf_create_got. Don't mark got or plt reloc syms dynamic, do so + in allocate_dynreloc. Use update_local_sym_info and bad_shared_reloc. + Disallow R_PPC_EMB_RELSDA, R_PPC_EMB_NADDR32, R_PPC_EMB_NADDR16, + R_PPC_EMB_NADDR16_LO, R_PPC_EMB_NADDR16_HI and R_PPC_EMB_NADDR16_HA + in shared libs. R_PPC_PLTREL32 is a plt reloc too. Refcount all + relocs that might use a plt entry. Set NON_GOT_REF too. + Enumerate all do-nothing relocs. + (ppc_elf_gc_sweep_hook): Simplify removal of dynrelocs. Handle + tls relocs and all plt relocs. + (ppc_elf_tls_setup, ppc_elf_tls_optimize): New functions. + (ppc_elf_finish_dynamic_symbol): Don't build got entries here. + (ppc_elf_finish_dynamic_sections): Rewrite tag code using htab + shortcuts. + (ppc_elf_relocate_section): Tidy. Handle TLS relocs. Use + bfd_elf_local_sym_name. Simplify unresolved reloc code. Build got + entries and got relocs here. Warn on non-zero got reloc addend. + Split out branch taken/not taken reloc code into a separate switch + and correct offset calculation. Allow BRTAKEN/BRNTAKEN dynamic relocs. + Split out HA reloc adjustments to separate switch statement. Don't + warn on reloc overflow if we've already warned about undefined. + Don't rebuild sym name when reporting errors. Report all possible + errors from _bfd_final_link_relocate. + (bfd_elf32_bfd_final_link): Don't define. + +2003-02-18 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Don't init "r". Don't + rebuild sym name when reporting errors. + +2003-02-17 Nick Clifton + + * elflink.h (elf_link_output_extsym): Only check + allow_shlib_undefined for shared libraries. + * elf32-i386.c (elf_i386_relocate_section): Remove bogus check + of allow_shlib_undefined. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-hppa.c (elf64_hppa_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise. + +2003-02-17 Nick Clifton + + * elf.c (SEGMENT_AFTER_SEGMENT): Add third parameter - the + address field to use in the comparison. + (SEGMENT_OVERLAPS): Check that LMAs overlap as well. + +2003-02-14 Bob Wilson + + * elfcore.h (elf_core_file_p): Compare alternate machine codes for ELF + backends when checking if the generic ELF target should be used. + + * syms.c (_bfd_stab_section_find_nearest_line): For line number stabs + outside of functions, treat values as absolute addresses. + + * bfd.c: Change embedded documentation to use consistent indentation + and to split up long lines. Change informal style of description + for functions lacking real documentation. + * coffcode.h: Break up long lines in embedded documentation. + * format.c: Likewise. + * targets.c: Likewise. + * libcoff.h: Regenerate. + * bfd-in2.h: Regenerate. + +2003-02-14 Alan Modra + + * elf64-ppc.c (ppc64_elf_link_hash_table_create): Init tls_get_addr. + (ppc64_elf_copy_indirect_symbol): Merge tls_mask too. + (ppc64_elf_gc_sweep_hook): Simplify removal of dyn_relocs. + (allocate_dynrelocs): Don't treat undefined and undefweak specially. + (ppc_size_one_stub): Fix warning, and tighten plt entry check. + (group_sections): Don't share a stub section if stubs are for a large + section. Adjust comment. + (ppc64_elf_size_stubs): Roughly double the size left for stubs if + !stubs_always_before_branch. + (ppc64_elf_relocate_section): Initialize tlsld GOT entry once. Don't + treat undefined and undefweak specially when processing dyn relocs. + +2003-02-13 Jakub Jelinek + + * elflink.h (elf_link_add_object_symbols): Handle .symver x, x@FOO. + +2003-02-13 Nick Clifton + + * elf32-arm.h (elf32_thumb_to_arm_stub): Include section VMAs + in computation of offset to insert into BL instruction. + +2003-02-11 Uwe Stieber + + * config.bfd: Add support for kaOS as cross build target system. + +2003-02-11 Alan Modra + + * elf64-ppc.c (ppc64_elf_check_relocs): Match versioned + .__tls_get_addr too. + (ppc64_elf_tls_setup): Ensure cached tls_get_addr is not indirect. + +2003-02-10 Kaz kojima + + * elf32-sh.c (elf_sh_dyn_relocs): Add tls_tpoff32 field. + (elf_sh_link_hash_entry): Remove tls_tpoff32 field. + (sh_elf_link_hash_newfunc): Remove the initialization of + tls_tpoff32 field. + (allocate_dynrelocs): Keep dyn_relocs if it includes the entry + for which tls_tpoff32 flag is set. + (sh_elf_relocate_section): Covert to LE only if the dyn_relocs + of the symbol includes the entry matched with the input_section + and having tls_tpoff32 flag on. When linking statically, set + symbol index of R_SH_TLS_TPOFF32 relocation to zero if the symbol + is defined in this executable. + (sh_elf_check_relocs): Set tls_tpoff32 flag appropriately. + +2003-02-10 Jakub Jelinek + + * elf32-s390.c (elf_s390_size_dynamic_sections): Set relocs to TRUE + even if there is just non-empty .rela.plt. + +2003-02-10 Nick Clifton + + * archures.c (bfd_mach_arm_ep9312): Define. + * bfd-in2.h: Regenerate. + * cpu-arm.c (processors[]): Add ep9312. + (bfd_arm_arch): Add ep9312. + * elf32-arm.h (elf32_arm_merge_private_data): Update error + messages and add test for Maverick floating point support. + (elf32_arm_print_private_bfd_data): Handle + EF_ARM_MAVERICK_FLOAT flag. + (elf32_arm_object_p): New function. + (elf_backend_object_p): Define. + +2003-02-10 Alan Modra + + * elf64-ppc.c: Rename assorted occurrences of tls_type and similar + variables, structure fields or function params to tls_mask or + similar to better reflect usage. + (struct got_entry): Comment. + (struct ppc_link_hash_entry): Expand comment, and renumber TLS_*. + (get_tls_mask): Rename from get_tls_type. + +2003-02-09 Alan Modra + + * elf64-ppc.c (TLS_GD_LD): Don't define.. + (TLS_GD): ..define this instead and update all uses. + (TLS_TPRELGD): Define. + (ppc64_elf_link_hash_table_create): Tweak initialization of + init_refcount and init_offset. + (ppc64_elf_check_relocs): Add one extra element to t_symndx array. + Mark second slot of GD or LD toc entries. + (get_tls_type): Return an int. Distinguish toc GD and LD entries + from other tls types. + (ppc64_elf_tls_setup): New function, split out from.. + (ppc64_elf_tls_optimize): ..here. Don't optimize when symbols are + defined in a dynamic object. Fix LD optimization. Don't set TLS_TPREL + on GD->IE optimization, use TLS_TPRELGD instead. Use get_tls_type + return value to properly decide whether toc GD and LD entries can + optimize away __tls_get_addr call. Check next reloc after DTPMOD64 + to determine GD or LD rather than looking at TLS_LD flag. Don't + attempt to adjust got entry tls_type here.. + (allocate_dynrelocs): ..instead, adjust got entry tls_type here, and + look for possible merges. + (ppc64_elf_size_dynamic_sections): Adjust local got entries for + optimization. + (ppc64_elf_size_stubs): Tweak __tls_get_addr fudge. + (ppc64_elf_relocate_section): Rename some vars to better reflect usage. + Make use of return value from get_tls_type to properly detect GD and + LD optimizations. Split tlsld/gd hi/ha from lo/ds case. Don't + handle tls_get_addr removal when looking at REL24 relocs, do it when + looking at the previous reloc. Check reloc after DTPMOD64 to determine + GD or LD. + * elf64-ppc.h (ppc64_elf_tls_setup): Declare. + +2003-02-08 Alan Modra + + * elf32-hppa.c (group_sections): Don't share a stub section if + stubs are for a large section. + + * elf32-hppa.c (elf32_hppa_size_stubs): Double the size left for + stubs if !stubs_always_before_branch. + +2003-02-07 Nick Clifton + + * elf.c (swap_out_syms): Generate an error message if an + equivalent output section cannot be found for a symbol. + +2003-02-07 Jakub Jelinek + + * elf64-alpha.c (elf64_alpha_relax_section): Don't crash if + local_got_entries is NULL. + +2003-02-06 Andreas Schwab + + * elf-eh-frame.c (get_DW_EH_PE_signed): Define. + (read_value): Add parameter is_signed, use signed extraction if + the value is signed. + (_bfd_elf_write_section_eh_frame): Pass signed flag of the + encoding to read_value. + +2003-02-06 Alan Modra + + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy got and + plt info when called to transfer weak sym info. + +2003-02-05 Alan Modra + + * reloc.c: Add PPC and PPC64 TLS relocs. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * elf64-ppc.c (TP_OFFSET, DTP_OFFSET): Declare. + (ppc64_elf_howto_raw): Add TLS howto's. Adjust R_PPC64_NONE to be + against a 32 bit field. + (ppc64_elf_reloc_type_lookup): Handle TLS relocs. + (_ppc64_elf_section_data): Add t_symndx and comments. + (ppc64_elf_section_data): Use elf_section_data macro. + (ppc64_elf_new_section_hook): American spelling. + (struct got_entry, struct plt_entry): New. + (MUST_BE_DYN_RELOC): Rename from IS_ABSOLUTE_RELOC. + (struct ppc_stub_hash_entry): Add "addend" field. + (struct ppc_link_hash_entry): Add "tls_type". + (TLS_TLS, TLS_GD_LD, TLS_LD, TLS_TPREL, TLS_DTPREL, + TLS_EXPLICIT): Define. + (struct ppc_link_hash_table): Add tls_sec, tls_get_addr, tlsld_got. + (link_hash_newfunc): Init new fields. + (ppc64_elf_link_hash_table_create): Likewise. Set init_refcount and + init_offset to NULL. + (ppc64_elf_copy_indirect_symbol): Copy got and plt info. Don't call + _bfd_elf_link_hash_copy_indirect, rather insert relevant code from + there. + (update_local_sym_info, update_plt_info): New functions. + (ppc64_elf_check_relocs): Use them. Handle TLS relocs. Adjust GOT + handling to use got.glist rather than got.refcount. Likewise for PLT. + (ppc64_elf_gc_sweep_hook): Handle TLS relocs, new GOT and PLT lists. + (func_desc_adjust): Adjust for new PLT list. + (ppc64_elf_adjust_dynamic_symbol): Likewise. + (get_sym_h, get_tls_type): New functions. + (ppc64_elf_edit_opd): Remove unused variable. Use get_sym_h. + (ppc64_elf_tls_optimize): New function. + (allocate_dynrelocs): Adjust for new PLT and GOT lists. Allocate + TLS relocs. + (ppc64_elf_size_dynamic_sections): Likewise. + (ppc_type_of_stub): Adjust for new PLT list. + (ppc_build_one_stub): Likewise. + (ppc64_elf_size_stubs): Likewise. Use get_sym_h. Treat __tls_get_addr + calls specially. + (ppc64_elf_relocate_section): Adjust for new GOT and PLT lists. Handle + TLS relocs. Report local syms using bfd_elf_local_sym_name. Don't + init GOT entries that have a reloc. Generate GOT relocs here.. + (ppc64_elf_finish_dynamic_symbol): ..not here. Adjust for PLT list. + * elf64-ppc.h (ppc64_elf_tls_optimize): Declare. + +2003-02-04 Andreas Schwab + + * elf32-m68k.c (elf_m68k_hash_entry): Define. + (elf_m68k_link_hash_traverse): Remove. + (elf_m68k_link_hash_newfunc): Use struct bfd_hash_entry and + elf_m68k_hash_entry instead of struct elf_m68k_link_hash_entry to + reduce casting. + (elf_m68k_check_relocs): Use elf_m68k_hash_entry instead of + casting. + (elf_m68k_size_dynamic_sections): Use elf_link_hash_traverse + instead of elf_m68k_link_hash_traverse. + (elf_m68k_discard_copies): Change first parameter to pointer to + struct elf_link_hash_entry and use elf_m68k_hash_entry when struct + elf_m68k_link_hash_entry is needed. + +2003-02-04 Alan Modra + + * elf-bfd.h (struct got_entry, struct plt_entry): Forward declare. + (struct elf_link_hash_entry): Add "glist" and "plist" fields to + "got" union, and declare as gotplt_union. Use gotplt_uinion for + "plt" field. + (struct elf_link_hash_table): Make "init_refcount" a gotplt_union. + Add "init_offset" field. + (struct elf_obj_tdata ): Add "struct got_entry **" to union. + (elf_local_got_ents): Declare. + * elf.c (_bfd_elf_link_hash_newfunc): Adjust initialization of "got" + and "plt". + (_bfd_elf_link_hash_hide_symbol): Use "init_offset". + (_bfd_elf_link_hash_table_init): Set "init_offset". + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set init_refcount + from init_offset. + (elf_adjust_dynamic_symbol): Set plt and got offsets using init_offset. + + * elf.c (bfd_elf_local_sym_name): Split out from.. + (group_signature): ..here. + * elf-bfd.h (bfd_elf_local_sym_name): Declare. + +2003-02-04 Alan Modra + + * elf-bfd.h (enum elf_link_info_type): Remove. + (struct bfd_elf_section_data): Move sec_info_type, use_rela_p fields + to struct sec. Remove linkonce_p field. + (elf_linkonce_p): Delete. + (elf_discarded_section): Update for sec_info_type change. + * section.c (struct sec): Add sec_info_type, use_rela_p, has_tls_reloc, + flag11, flag12, flag13, flag14, flag15, flag16, flag20, flag24. + (ELF_INFO_TYPE_NONE): Define. + (ELF_INFO_TYPE_STABS): Define. + (ELF_INFO_TYPE_MERGE): Define. + (ELF_INFO_TYPE_EH_FRAME): Define. + (ELF_INFO_TYPE_JUST_SYMS): Define. + (STD_SECTION): Update struct sec initializer. + * ecoff.c (bfd_debug_section): Likewise. + * elf.c: Likewise. Update occurrences of sec_info_type and use_rela_p. + * elflink.h: Likewise. + * elf-eh-frame.c: Likewise. + * elf64-alpha.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * bfd-in2.h: Regenerate. + + * elf32-sparc.c (sec_do_relax): Use elf_section_data macro rather than + referring to used_by_bfd. + * elf64-sparc.c (sec_do_relax): Likewise. + * elf64-mmix.c (mmix_elf_section_data): Likewise. + * elfxx-mips.c (mips_elf_section_data): Likewise. + * ieee.c (ieee_slurp_section_data): Use ieee_per_section macro. + (ieee_get_section_contents): Likewise. + (ieee_new_section_hook): Formatting. + (ieee_canonicalize_reloc): Remove commented out code. + * mmo.c (mmo_section_data): Define. Use throughout file. + * oasys.c (oasys_get_section_contents): Use oasys_per_section macro. + +2003-01-31 Graydon Hoare + + * Makefile.am (opncls.lo): Add dependency upon libiberty.h. + * Makefile.in: Regenerate. + * opncls.c (calc_crc32, get_debug_link_info, + seperate_debug_file_exists, find_seperate_debug_file): New + internal functions. + (bfd_follow_gnu_debuglink): New function. Follow the pointer + contained inside a .gnu_debuglink section. + * bfd-in2.h: Regenerate. + +2003-01-29 Alexandre Oliva + + * elfxx-mips.c (mips_elf_got_entry_hash): Don't dereference + entry->abfd when it's NULL. + +2003-01-27 Alexandre Oliva + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Handle + _bfd_elf_section_offset returning -2 the same way as -1. + + * elfxx-mips.c (mips_elf_multi_got): New function. + (struct mips_got_entry): Make symndx and gotidx signed. Moved + addend into union along with address and link hash entry. + (struct mips_got_info): Added bfd2got and next. + (struct mips_elf_hash_sort_data): Added max_unref_got_dynindx. + (mips_elf_got_section, mips_elf_create_got_section): Use + SEC_EXCLUDE bit to tell whether we really need the got + section. Take boolean arguments to disregard an excluded + section, or to create it as excluded. Adjust all callers. + Use mips_elf_got_section all over. + (mips_elf_local_got_index, mips_elf_got_page, + mips_elf_got16_entry): Take input bfd as argument, and pass it + on to mips_elf_create_local_got_entry. + (mips_elf_global_got_index, mips_elf_create_local_got_entry): + Take input bfd as argument, and manage entries in the + appropriate GOT. + (mips_elf_got_offset_from_index): Take input bfd as argument, + and use it to adjust the GP offset of the bfd. + (mips_elf_sort_hash_table, mips_elf_sort_hash_table_f): Move + unreferenced GOT entries of global symbols to the end. + (mips_elf_record_global_got_symbol): Take input bfd as + argument. Add entries to the master GOT hash table. + (struct mips_elf_bfd2got_hash): New. + (struct mips_elf_got_per_bfd_arg): New. + (struct mips_elf_set_global_got_offset_arg): New. + (mips_elf_hash_bfd_vma, mips_elf_multi_got_entry_hash, + mips_elf_multi_got_entry_eq, mips_elf_bfd2got_entry_hash, + mips_elf_bfd2got_entry_eq, mips_elf_make_got_per_bfd, + mips_elf_merge_gots, mips_elf_set_global_got_offset, + mips_elf_resolve_final_got_entry, + mips_elf_resolve_final_got_entries, mips_elf_adjust_gp, + mips_elf_got_for_ibfd): New functions. + (ELF_MIPS_GP_OFFSET): Don't depend on SGI_COMPAT. + (MIPS_ELF_GOT_MAX_SIZE): New macro. + (STUB_LW): Generate 64-bit stub regardless of SGI_COMPAT. + (mips_elf_got_entry_hash): Take new fields into account. Use + mips_elf_hash_bfd_vma. + (mips_elf_got_entry_eq): Take new fields into account. + (mips_elf_create_got_section): Initialize new fields. + (mips_elf_calculate_relocation): Pass input_bfd to functions + that now take it. Adjust gp for the input_bfd. + (mips_elf_allocate_dynamic_relocation, + mips_elf_create_dynamic_relocation, + _bfd_mips_elf_create_dynamic_sections): Use... + (mips_elf_rel_dyn_section): New function. Borrow code from... + (_bfd_mips_elf_check_relocs): Pass input_bfd to functions that + now take it. Create the got section if needed, even if + excluded, before recording a global got symbol. Move some + code to... + (mips_elf_record_local_got_symbol): New fn. + (_bfd_mips_elf_size_dynamic_sections): Disable combreloc. + Compute multi-got global entries offsets. Move GOT code to... + (_bfd_mips_elf_always_size_sections): Call mips_elf_multi_got + if the GOT is too big. + (_bfd_mips_elf_finish_dynamic_symbol): Set got entry of + undefweak symbol to zero. Generate dynamic relocations for + non-primary GOT entries for global symbols. + (_bfd_mips_elf_finish_dynamic_sections): Handle multi-got + case. Generate dynamic relocations for local got entries. + Sort dynamic relocations on N64 too, using... + (sort_dynamic_relocs_64): New fns. + (_bfd_mips_elf_hide_symbol): Adjust multi-got counters. + (_bfd_mips_elf_merge_private_bfd_data): Ignore EF_MIPS_XGOT. + +2003-01-27 Alexandre Oliva + + * bfd.c (struct _bfd): Added id field. + * opncls.c (_bfd_id_counter): New static variable. + (_bfd_new_bfd): Use it. + * bfd-in2.h: Rebuilt. + +2003-01-25 Alan Modra + + * elf32-sparc.c (bfd_elf32_new_section_hook): Define. + +2003-01-25 Jakub Jelinek + + * elf32-sparc.c (_bfd_sparc_elf_howto_table): Add TLS relocs. + (elf32_sparc_rev32_howto): New variable. + (sparc_reloc_map): Add TLS relocs. + (elf32_sparc_reloc_type_lookup, elf32_sparc_info_to_howto): + Handle REV32. + (sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_mkobject): + New functions. + (struct elf32_sparc_dyn_relocs, struct elf32_sparc_link_hash_entry, + struct elf32_sparc_link_hash_table): + New structures. + (elf32_sparc_tdata, elf32_sparc_local_got_tls_type, + elf32_sparc_hash_table): Define. + (link_hash_newfunc, elf32_sparc_link_hash_table_create, + create_got_section, elf32_sparc_create_dynamic_sections, + elf32_sparc_copy_indirect_symbol, elf32_sparc_tls_transition): New + functions. + (elf32_sparc_check_relocs): Handle TLS relocs. Add dynamic reloc + reference counting. + (elf32_sparc_gc_sweep_hook): Likewise. + (elf32_sparc_adjust_dynamic_symbol): Likewise. + (elf32_sparc_size_dynamic_sections): Likewise. + (elf32_sparc_relocate_section): Likewise. + (allocate_dynrelocs, readonly_dynrelocs, dtpoff_base, tpoff): + New functions. + (elf32_sparc_object_p): Allocate backend private object data. + (bfd_elf32_bfd_link_hash_table_create, + elf_backend_copy_indirect_symbol, bfd_elf32_mkobject, + elf_backend_can_refcount): Define. + (elf_backend_create_dynamic_sections): Define to + elf32_sparc_create_dynamic_sections. + * reloc.c: Add SPARC TLS relocs. + * bfd-in2.h, libbfd.h: Rebuilt. + * elf64-sparc.c (sparc64_elf_howto_table): Add TLS relocs. + (sparc_reloc_map): Likewise. + +2003-01-24 Martin Schwidefsky + + * bfd-in2.h: Regenerate. + * elf32-s390.c (elf_s390_mkobject, elf_s390_tls_transition, + s390_tls_reloc, dtpoff_base, tpoff, invalid_tls_insn): New functions. + (elf_howto_table): Add TLS relocs. + (elf_s390_reloc_type_lookup): Likewise. + (elf_s390_link_hash_entry): Add tls_type. + (elf_s390_hash_entry, elf_s390_obj_tdata, elf_s390_local_got_tls_type): + New macros. + (elf_s390_link_hash_table): Add tls_ldm_got. + (link_hash_newfunc): Initialize tls_type. + (elf_s390_link_hash_table_create): Initialize refcount of tls_ldm_got. + (elf_s390_copy_indirect_symbol): Copy tls_type information. + (elf_s390_check_relocs): Support TLS relocs. + (elf_s390_gc_sweep_hook): Likewise. + (allocate_dynrelocs): Likewise. + (elf_s390_size_dynamic_sections): Likewise. + (elf_s390_relocate_section): Likewise. + (elf_s390_finish_dynamic_symbol): Likewise. + (bfd_elf32_mkobject): Define for TLS. + * elf64-s390.c: Same changes as for elf32-s390.c. + * libbfd.h: Regenerate. + * reloc.c: Add s390 TLS relocations. + +2003-01-24 Charles Lepple + + * aclocal.m4: Fix name of --enable-install-libbfd switch. + +2003-01-23 Nick Clifton + + * Add sh2e support: + 2002-04-02 Elena Zannoni + * archures.c (bfd_mach_sh2e): Added. + * bfd-in2.h: Rebuilt. + * cpu-sh.c (arch_info_struct): Added SH2e. + * elf32-sh.c (sh_elf_set_mach_from_flags): Handle EF_SH2E. + +2003-01-23 Alan Modra + + * elf-bfd.h (struct bfd_elf_section_data): Remove tdata. Change + dynindx to an int. Rearrange for better packing. + * elf.c (_bfd_elf_new_section_hook): Don't alloc if already done. + * elf32-mips.c (bfd_elf32_new_section_hook): Define. + * elf32-sh64.h: New. Split out from include/elf/sh.h. + (struct _sh64_elf_section_data): New struct. + (sh64_elf_section_data): Don't dereference sh64_info (was tdata). + * elf32-sh64-com.c: Include elf32-sh64.h. + * elf32-sh64.c: Likewise. + (sh64_elf_new_section_hook): New function. + (bfd_elf32_new_section_hook): Define. + (sh64_elf_fake_sections): Adjust for sh64_elf_section_data change. + (sh64_bfd_elf_copy_private_section_data): Likewise. + (sh64_elf_final_write_processing): Likewise. + * elf32-sparc.c (struct elf32_sparc_section_data): New. + (elf32_sparc_new_section_hook): New function. + (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete. + (sec_do_relax): Define. + (elf32_sparc_relax_section): Adjust to use sec_do_relax. + (elf32_sparc_relocate_section): Likewise. + * elf64-mips.c (bfd_elf64_new_section_hook): Define. + * elf64-mmix.c (struct _mmix_elf_section_data): New. + (mmix_elf_section_data): Define. Use throughout file. + (mmix_elf_new_section_hook): New function. + (bfd_elf64_new_section_hook): Define. + * elf64-ppc.c (struct _ppc64_elf_section_data): New. + (ppc64_elf_section_data): Define. Use throughout. + (ppc64_elf_new_section_hook): New function. + (bfd_elf64_new_section_hook): Define. + * elf64-sparc.c (struct sparc64_elf_section_data): New. + (sparc64_elf_new_section_hook): New function. + (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete. + (sec_do_relax): Define. + (sparc64_elf_relax_section): Adjust to use sec_do_relax. + (sparc64_elf_relocate_section): Likewise. + (bfd_elf64_new_section_hook): Define. + * elfn32-mips.c (bfd_elf32_new_section_hook): Define. + * elfxx-mips.c (struct _mips_elf_section_data): New. + (mips_elf_section_data): Define. Use throughout. + (_bfd_mips_elf_new_section_hook): New function. + (mips_elf_create_got_section): Don't alloc used_by_bfd. + * elfxx-mips.h (_bfd_mips_elf_new_section_hook): Declare. + * elfxx-target.h (bfd_elfNN_new_section_hook): Add #ifndef. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2003-01-21 Richard Henderson + + * elf64-alpha.c (ALPHA_ELF_LINK_HASH_PLT_LOC): New. + (struct alpha_elf_link_hash_entry): Add plt_old_section, plt_old_value. + (elf64_alpha_adjust_dynamic_symbol): Set them. + (elf64_alpha_size_plt_section_1): Reset them when plt entry removed. + (elf64_alpha_relax_tls_get_addr): Handle LDM relocs. Frob the + symbol index when relaxing LDM to TPREL. + (elf64_alpha_relax_section): Likewise. Allow relaxation of GD + relocs, even if the target isn't locally defined. + (elf64_alpha_check_relocs): Frob LDM reloc symndx to zero. + (elf64_alpha_relocate_section): Likewise. Force TP-relative + relocs vs symndx 0 to the tp base. + +2003-01-21 Fabio Alemagna + + * config.bfd: Handle i[3456]86-*-aros*. + +2003-01-21 Andreas Schwab + + * elf32-ppc.c (struct ppc_elf_dyn_relocs): Define. + (struct ppc_elf_link_hash_entry): Define. + (ppc_elf_hash_entry): New function. + (struct ppc_elf_link_hash_table): Define. + (ppc_elf_hash_table): New function. + (ppc_elf_link_hash_newfunc): New function. + (ppc_elf_link_hash_table_create): New function. + (ppc_elf_copy_indirect_symbol): New function. + (allocate_dynrelocs): New function. + (readonly_dynrelocs): New function. + (ppc_elf_size_dynamic_sections): Allocate space for dynamic + relocs and determine DT_TEXTREL. + (ppc_elf_check_relocs): Don't do that here, just count the + dynamic relocs. + (ppc_elf_gc_sweep_hook): Discard any dynamic relocs against the + removed section. + (bfd_elf32_bfd_link_hash_table_create): Define. + (elf_backend_copy_indirect_symbol): Define. + +2003-01-21 Richard Henderson + + * elf64-alpha.c (alpha_dynamic_entries_for_reloc): GOTTPREL and + TPREL also get a reloc if shared. Remove SREL support. + (elf64_alpha_emit_dynrel): New. + (elf64_alpha_relocate_section): Use it. Resolve dynamic TPREL + and GOTTPREL relocs to local symbols against the tp base. + (elf64_alpha_finish_dynamic_symbol): Use elf64_alpha_emit_dynrel. + + * elf64-alpha.c (elf64_alpha_relax_got_load): Decrement got + use count before clobbering r_type. + (elf64_alpha_relax_tls_get_addr): Don't use pos[1] if insn + ordering would mean dataflow inspection is necessary. + +2003-01-20 Svein E. Seldal + + * coffcode.h (coff_set_flags): Added get/set arch hooks. + +2003-01-20 Fabio Alemagna + + * elf32-sh.c: Treat elfNN_bed like other macros defined in + elfxx-target.h and #undef it before #define'ing it. + * elf32-i386.c: Likewise. + * elf32-sh64.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-sh64.c: Likewise. + +2003-01-20 Martin Schwidefsky + + * bfd-in2.h: Regenerate. + * elf32-s390.c (elf_s390_adjust_gotplt): New prototype. + (elf_howto_table): Rename R_390_GOTOFF to R_390_GOTOFF32. Add + R_390_GOTOFF16, R_390_GOTOFF64, R_390_GOTPLT12, R_390_GOTPLT16, + R_390_GOTPLT32, R_390_GOTPLT64, R_390_GOTPLTENT, R_390_PLTOFF16, + R_390_PLTOFF32 and R_390_PLTOFF64. + (elf_s390_reloc_type_lookup): Likewise. + (struct elf_s390_link_hash_entry): Add gotplt_refcount to keep track + of GOTPLT references to a function. + (link_hash_newfunc): Initialize gotplt_refcount. + (elf_s390_check_relocs): Move allocation of local_got_refcounts array + and creation of the got section out of the main switch. Add support + for the gotoff, gotplt and pltoff relocations. + (elf_s390_gc_sweep_hook): Add reference counting for gotoff, gotplt + and pltoff. + (elf_s390_adjust_gotplt): New function. + (elf_s390_adjust_dynamic_symbol): Adjust gotplt refcount for removed + plt entries. + (allocate_dynrelocs): Add comment. + (elf_s390_relocate_section): Change r_type to unsigned. Add support + for gotoff, gotplt and pltoff relocations. + * elf64-s390.c: Same changes as for elf32-s390.c. + * libbfd.h: Regenerate. + * reloc.c: Add BFD_RELOC_390_GOTOFF64, BFD_RELOC_390_GOTPLT12, + BFD_RELOC_390_GOTPLT16, BFD_RELOC_390_GOTPLT32, BFD_RELOC_390_GOTPLT64, + BFD_RELOC_390_GOTPLTENT, BFD_RELOC_390_PLTOFF16, BFD_RELOC_390_PLTOFF32 + and BFD_RELOC_390_PLTOFF64. + +2003-01-18 Jakub Jelinek + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Handle + R_IA64_TPREL64[LM]SB against non-global symbol properly. + +2003-01-16 Jakub Jelinek + + * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add + self_dtpmod_done and self_dtpmod_offset. + (allocate_global_data_got): Only use one got entry for all + dtpmod relocs against local symbols. + (allocate_dynrel_entries): Only need .rela.got entry for + dtpmod against global symbol. + (elfNN_ia64_size_dynamic_sections): Initialize self_dtpmod_offset. + Reserve space in .rela.got for the local dtpmod entry. + (set_got_entry): Initialize the common local dtpmod .got entry. + (elfNN_ia64_relocate_section): Handle R_IA_64_DTPREL64LSB + and R_IA_64_DTPREL64MSB. + +2003-01-16 Alan Modra + + * elf64-ppc.c: Include elf/ppc64.h rather than elf/ppc.h. + (R_PPC_*): Rename all occurrences to R_PPC64_*. + (R_PPC64_ADDR30): Rename all occurrences to R_PPC64_REL30. + (enum elf_ppc_reloc_type): Ditto to enum elf_ppc64_reloc_type. + (ppc64_elf_gc_sweep_hook): Handle R_PPC64_REL30 along with other + relative relocs, not with absolute ones. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2003-01-15 Andreas Schwab + + * elf32-ppc.c (ppc_elf_check_relocs): Don't set DF_TEXTREL for a + relocation against a non-allocated readonly section. + +2003-01-10 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Adjust addend for GOT16_HA. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. PLTGOT16_HA too. + +2002-01-08 Klee Dienes + + * Makefile.am (ALL_MACHINES): Use cpu-msp430.lo, not cpu-msp430.c. + (BFD32_BACKENDS): Use elf32-msp430.lo, not elf32-msp430.c. + * Makefile.in: Regenerate. + +2003-01-08 Alexandre Oliva + + * elfn32-mips.c (prev_reloc_section): New. + (GET_RELOC_ADDEND): Use it. Parenthesize macro arguments. + (SET_RELOC_ADDEND): Parenthesize macro argument. + +2003-01-07 John David Anglin + + * elf32-hppa.c (final_link_relocate): For all DP relative relocations, + adjust addil instructions if the symbol has no section. + +2003-01-07 DJ Delorie + + * elf32-xstormy16.c (xstormy16_elf_howto_table): Make REL_12 not + partial_inplace. + +2003-01-07 Andreas Schwab + + * elf32-m68k.c (elf_m68k_check_relocs): Don't set DF_TEXTREL for + PC relative relocations. + (elf_m68k_discard_copies): Set it here instead. + +2002-01-02 Ben Elliston + Jeff Johnston + + * Makefile.am (ALL_MACHINES): Add cpu-iq2000.lo. + (ALL_MACHINES_CFILES): Add cpu-iq2000.c. + (BFD32_BACKENDS): Add elf32-iq2000.lo. + (BFD32_BACKENDS_CFILES): Add elf32-iq2000.c. + (cpu-iq2000.lo): New target. + * Makefile.in: Regenerate. + * config.bfd: Handle iq2000-*-elf. + * archures.c (bfd_architecture): Add bfd_{arch,mach}_iq2000. + (bfd_archures_list): Add bfd_iq2000_arch. + * configure.in: Handle bfd_elf32_iq2000_vec. + * configure: Regenerate. + * reloc.c: Add BFD_RELOC_IQ2000_OFFSET_16, BFD_RELOC_IQ2000_OFFSET_21, + and BFD_RELOC_IQ2000_UHI16. + * targets.c (bfd_elf32_iq2000_vec): Declare. + (bfd_target_vector): Add bfd_elf32_iq2000_vec. + * elf.c (prep_headers): Set e_machine to EM_IQ2000. + * cpu-iq2000.c: New file. + * elf32-iq2000.c: Likewise. + * libbfd.h: Regenerate. + * bfd-in2.h: Likewise. + +2003-01-02 Richard Sandiford + + * elfxx-mips.c: Include libiberty.h. + (elf_mips_isa, _bfd_mips_elf_mach_extends_p): Remove. + (mips_set_isa_flags): New function, split out from... + (_bfd_mips_elf_final_write_processing): ...here. Only call + mips_set_isa_flags if the EF_MIPS_MACH bits are clear. + (mips_mach_extensions): New array. + (mips_32bit_flags_p): New function. + (_bfd_mips_elf_merge_private_bfd_data): Rework architecture checks. + Use mips_32bit_flags_p to check if one binary is 32-bit and the + other is 64-bit. When adopting IBFD's architecture, adopt the + bfd_mach as well as the flags. + +2003-01-02 Nick Kelsey + + * elf32-ip2k.c: Re-work of linker relaxation code for the ip2k to + fix internal errors, fix bad code generation, fix incorrect stabs + information, and improve ability to eliminate redundant page + instructions. Added code to ip2k_final_link_relocate to self-verify + the linker relaxation. Fix formatting problems. + +2002-12-30 Chris Demetriou + + * aoutx.h (NAME(aout,machine_type)): Add bfd_mach_mipsisa32r2 case. + * archures.c (bfd_mach_mipsisa32r2): New define. + * bfd-in2.h: Regenerate. + * cpu-mips.c (I_mipsisa32r2): New enum value. + (arch_info_struct): Add entry for I_mipsisa32r2. + * elfxx-mips.c (elf_mips_isa, _bfd_elf_mips_mach) + (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_32R2. + (_bfd_mips_elf_final_write_processing): Add + bfd_mach_mipsisa32r2 case. + (_bfd_mips_elf_merge_private_bfd_data): Handle merging of + binaries marked as using MIPS32 Release 2. + +2002-12-30 Dmitry Diky + + * Makefile.am: Add msp430 target. + * configure.in: Likewise. + * Makefile.in: Regenerate. + * configure: Regenerate. + * archures.c: Add msp430 architecture vector. + * config.bfd: Likewise. + * reloc.c: Add msp430 relocs. + * targets.c: Add msp320 target. + * cpu-msp430.c: New file: msp430 cpu detection. + * elf32-msp430.c: New file: msp430 reloc processing. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2002-12-28 Jakub Jelinek + + * elf.c (elf_sort_sections): Don't reorder .tbss. + (assign_file_positions_for_segments): Only adjust off/voff + for increased alignment in PT_LOAD or PT_NOTE segment, + but adjust p_filesz for .tbss too. in PT_LOAD consider + .tbss to have zero memory size. + (copy_private_bfd_data) [SECTION_SIZE]: Define. + [IS_CONTAINED_BY_VMA, IS_CONTAINED_BY_LMA]: Use it. + [INCLUDE_SECTION_IN_SEGMENT]: Only put SHF_TLS sections + into PT_TLS segment. Never put SHF_TLS sections in + segments other than PT_TLS or PT_LOAD. + + * elf64-alpha.c (elf64_alpha_finish_dynamic_sections): Clear .plt + sh_entsize. + +2002-12-23 DJ Delorie + + * coff64-rs6000.c (xcoff64_ppc_relocate_section): Fix logic reversal. + +2002-12-23 Alan Modra + + * elflink.h (elf_link_output_extsym): Heed strip_discarded. + +2002-12-23 Nick Clifton + + * archures.c (bfd_arch_get_compatible): Add third parameter + 'accept_unknowns'. Only accept unknown format BFDs if + accept_unknowns is true, or if the format is "binary". + * bfd-in2.h: Regenerate. + +2002-12-21 Nick Clifton + + * coff-arm.c (coff_arm_relocate_section): Disable WINCE workaround + that subtracted 8 from pc relative relocations. + +2002-12-20 Kazu Hirata + + * coff-h8300.c: Fix comment typos. + * coffcode.h: Likewise. + * cpu-cris.c: Likewise. + * elf32-vax.c: Likewise. + * genlink.h: Likewise. + * linker.c: Likewise. + * som.c: Likewise. + * tekhex.c: Likewise. + * vms-misc.c: Likewise. + +2002-12-20 DJ Delorie + + * reloc.c: Add BFD_RELOC_XSTORMY16_12. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * elf32-xstormy16.c (xstormy16_elf_howto): Add R_XSTORMY16_12. + (xstormy16_reloc_map): Add R_XSTORMY16_12. + +2002-12-19 Kazu Hirata + + * doc/bfdint.texi: Fix typos. + +2002-12-20 Paul Eggert + + Port to POSIX 1003.1-2001. + * acinclude.m4 (AM_INSTALL_LIBBFD): Do not rely on "test -o". + * configure.in (build-warnings): Likewise. + (Horrible hacks to build DLLs on Windows): Do not rely on "tail -1". + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * configure: Regenerate. + +2002-12-19 Alan Modra + + * coff-h8300.c: Include libiberty.h. + (h8300_reloc16_extra_cases): Check the hash table creator before + referencing h8300 specific fields. Stash the hash table pointer + in a local var. Comment typo fixes. + (h8300_bfd_link_add_symbols): Likewise. + + * reloc.c (struct reloc_howto_struct): Revise src_mask and + dst_mask comments. + * bfd-in2.h: Regenerate. + +2002-12-18 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Reorganize dynamic reloc + code a little. Comment on dynamic relocs against section symbols. + +2002-12-17 Roger Sayle + + * configure.host (ia64-*-hpux*): Support 64 bit targets using + the HP compiler's "long long". + +2002-12-16 Andrew MacLeod + + * elf32-xstormy16.c (xstormy16_elf_howto): Add R_XSTORMY16_LO16 + and R_XSTORMY16_HI16) howto entries. + (xstormy16_reloc_map): Map R_XSTORMY16_{LO,HI}16 to BFD_RELOC_{LO,HI}16. + (xstormy16_info_to_howto_rela): Use R_XSTORMY16_GNU_VTINHERIT to + determine the start of the second reloc table. + +2002-12-16 Nathan Tallent + + * ecofflink.c: Fix the reading of the debugging information + of Tru64/Alpha binaries that are produced by recent Compaq + compilers. + (mk_fdrtab): Fix error in creating the FDR (file descriptor) + table. + (lookup_line): Because of the strange information sometimes + generated by Compaq's recent compilers, change how the FDR + table is searched so that PDRs (procedure descriptors) are + correctly found. Note that this change is really more of a hack; + however, I have included extensive documentation as to why + this is the best solution short of an extensive rewrite or + another hack. + (fdrtab_lookup): Add comments to explain the algorithm. + +2002-12-12 Alexandre Oliva + + * elf-m10300.c (elf32_mn10300_link_hash_newfunc): Reorder + initializers to match struct declaration. + +2002-12-12 Alan Modra + + * dwarf2.c (comp_unit_contains_address): Comment typo fix. + * elf.c (get_program_header_size): Likewise. + * elf32-m32r.c (m32r_elf_lo16_reloc): Likewise. + (m32r_elf_generic_reloc): Likewise. + * elf32-ppc.c (ppc_elf_howto_init): Likewise. + * elflink.h (elf_bfd_discard_info): Likewise. + +2002-12-12 Alan Modra + + * elf32-i386.c (elf_i386_finish_dynamic_sections): Add output_offset + to DT_JMPREL. Use srelplt input section size for DT_PLTRELSZ and + DT_RELSZ adjustment, not output section. Avoid writing tags when + unchanged. Don't assume linker script is sane, adjust DT_REL too. + * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Just use raw + size of srelplt for DT_PLTRELSZ. Use srelplt input section size for + DT_RELASZ adjustment, not output section. Avoid writing tags when + unchanged. Adjust DT_RELA. + * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Tweaks for better + formatting. Avoid writing tags when unchanged. Adjust DT_RELA. + +2002-12-12 Alexandre Oliva + + * elfxx-mips.c (mips_elf_calculate_relocation): Don't divide + addend by 4. + +2002-12-12 Alexandre Oliva + + * elfxx-mips.c (struct mips_got_entry): New. + (struct mips_got_info): Added got_entries field. + (mips_elf_got_entry_hash, mips_elf_got_entry_eq): New functions. + (mips_elf_local_got_index, mips_elf_got_page, + mips_elf_got16_entry): Re-implement in terms of new... + (mips_elf_create_local_got_entry): Rewrite to use got_entries. + Change return type. + (mips_elf_highest): Warning clean-up. + (mips_elf_create_got_section): Initialize got_entries. + (_bfd_mips_elf_check_relocs): Use got_entries to estimate + local got size. + (_bfd_mips_elf_size_dynamic_sections): Do not account for + GOT_PAGE entries, since we now reuse GOT16 entries. + +2002-12-10 Jason Thorpe + + * aoutx.h (set_section_contents): Allow an otherwise unrepresentable + read-only section that lies after .text and before .data to be + written into the output file and included in a_text. + (translate_to_native_sym_flags): If an otherwise unrepresentable + section was merged with .text, convert its symbols to N_TEXT + symbols. + * libaout.h (aout_section_merge_with_text_p): New macro. + +2002-12-08 Alan Modra + + * bfd-in.h: Comment typo fix. Formatting. + * bfd-in2.h: Regenerate. + * coff64-rs6000.c (xcoff64_openr_next_archived_file): Warning fix. + * elf32-m68hc12.c (m68hc12_elf_set_mach_from_flags): Prototype. + * elf64-mmix.c (mmix_dump_bpo_gregs): Warning fix. + +2002-12-05 Richard Henderson + + * elfxx-ia64.c (elfNN_ia64_relax_section): Handle PCREL21BI. + Only send PCREL21B though the plt. Fix installed reloc type. + (elfNN_ia64_relocate_section): Give error for dynamic reloc + against PCREL22 or PCREL64I; clean up error messages for + branch relocs. + +2002-12-04 Kevin Buettner + + * elf64-mips.c (elf64_mips_grok_prstatus, elf64_mips_grok_psinfo): + New functions. + (elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define. + +2002-12-04 David Mosberger + + * cpu-ia64-opc.c: Add operand constant "ar.csd". + +2002-12-04 H.J. Lu + + * elfxx-ia64.c (get_local_sym_hash): Use section ID instead of + BFD address when constructing local name. + +2002-12-04 Andreas Schwab + + * elf32-m68k.c (struct elf_m68k_link_hash_table): Add sym_sec + member. + (elf_m68k_link_hash_table_create): Initialize it. + (elf_m68k_check_relocs): Handle symbols that are forced to be + local due to visibility changes. + (elf_m68k_adjust_dynamic_symbol): Likewise. + (elf_m68k_size_dynamic_sections): Likewise. + (elf_m68k_discard_copies): Likewise. + (elf_m68k_relocate_section): Likewise. + +2002-12-04 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_opd): Correct typo. + +2002-12-04 Alan Modra + + * srec.c (srec_write_symbols): Restore '$' prefix to address + accidentally removed in 2002-04-04 change. + (srec_get_symtab): Use 0 instead of `(long) FALSE'. + +2002-12-03 Nick Clifton + + * elf32-ppc.c (apuinfo_list_init): New function. + (apuinfo_list_add): New function: Add a value to the list. + (apuinfo_list_length): New function: Return the number of + values on the list. + (apuinfo_list_element): New function: Return a value on the + list. + (apuinfo_list_finish): New function: Free the resources used + by the list. + (ppc_elf_begin_write_processing): New function. Scan the + input bfds for apuinfo sections. + (ppc_elf_write_section): New function: Delay the creation of + the contents of an apuinfo section in an output bfd. + (ppc_elf_final_write_processing): New function. Create the + contents of an apuinfo section in an output bfd. + (elf_backend_begin_write_processing): Define. + (elf_backend_final_write_processing): Define. + (elf_backend_write_section): Define. + +2002-12-03 Richard Henderson + + * cpu-ia64-opc.c (elf64_ia64_operands): Add ldxmov entry. + +2002-12-01 Stephane Carrez + + Fix PR savannah/1417: + * elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Don't adjust + branch if it goes to the start of the deleted region. + +2002-12-01 Stephane Carrez + + * bfd-in2.h (bfd_mach_m6812): Rebuild. + * archures.c (bfd_mach_m6812_default, bfd_mach_m6812, + bfd_mach_m6812s): Declare. + + * elf32-m68hc12.c (m68hc12_elf_set_mach_from_flags): New function. + (_bfd_m68hc12_elf_set_private_flags): Call it. + (_bfd_m68hc12_elf_print_private_bfd_data): Report processor version. + (_bfd_m68hc12_elf_merge_private_bfd_data): Merge the flags and + report microcontroller incompatibilities (HC12 vs HCS12). + (elf_backend_object_p): Update. + +2002-11-30 Alan Modra + + * bfd-in.h (TRUE_FALSE_ALREADY_DEFINED, BFD_TRUE_FALSE): Delete. + (enum bfd_boolean, boolean): Delete. + (bfd_boolean): Typedef to an int. + (FALSE, TRUE): Define. + * aix386-core.c, aix5ppc-core.c, aout-adobe.c, aout-arm.c, aout-cris.c, + aout-encap.c, aout-ns32k.c, aout-target.h, aout-tic30.c, aoutf1.h, + aoutx.h, archive.c, archive64.c, archures.c, bfd-in.h, bfd.c, bfdwin.c, + binary.c, bout.c, cache.c, cisco-core.c, coff-a29k.c, coff-alpha.c, + coff-apollo.c, coff-arm.c, coff-aux.c, coff-h8300.c, coff-h8500.c, + coff-i386.c, coff-i860.c, coff-i960.c, coff-ia64.c, coff-m68k.c, + coff-m88k.c, coff-mcore.c, coff-mips.c, coff-or32.c, coff-ppc.c, + coff-rs6000.c, coff-sh.c, coff-sparc.c, coff-stgo32.c, coff-tic30.c, + coff-tic4x.c, coff-tic54x.c, coff-tic80.c, coff-w65.c, coff-we32k.c, + coff-z8k.c, coff64-rs6000.c, coffcode.h, coffgen.c, cofflink.c, + corefile.c, cpu-a29k.c, cpu-alpha.c, cpu-arc.c, cpu-arm.c, cpu-avr.c, + cpu-cris.c, cpu-d10v.c, cpu-d30v.c, cpu-dlx.c, cpu-fr30.c, cpu-frv.c, + cpu-h8300.c, cpu-h8500.c, cpu-hppa.c, cpu-i370.c, cpu-i386.c, + cpu-i860.c, cpu-i960.c, cpu-ia64.c, cpu-ip2k.c, cpu-m10200.c, + cpu-m10300.c, cpu-m32r.c, cpu-m68hc11.c, cpu-m68hc12.c, cpu-m68k.c, + cpu-m88k.c, cpu-mcore.c, cpu-mips.c, cpu-mmix.c, cpu-ns32k.c, + cpu-openrisc.c, cpu-or32.c, cpu-pdp11.c, cpu-pj.c, cpu-powerpc.c, + cpu-rs6000.c, cpu-s390.c, cpu-sh.c, cpu-sparc.c, cpu-tic30.c, + cpu-tic4x.c, cpu-tic54x.c, cpu-tic80.c, cpu-v850.c, cpu-vax.c, + cpu-w65.c, cpu-we32k.c, cpu-xstormy16.c, cpu-z8k.c, dwarf1.c, + dwarf2.c, ecoff.c, ecofflink.c, efi-app-ia32.c, efi-app-ia64.c, + elf-bfd.h, elf-eh-frame.c, elf-hppa.h, elf-m10200.c, elf-m10300.c, + elf-strtab.c, elf.c, elf32-arc.c, elf32-arm.h, elf32-avr.c, + elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c, + elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-hppa.h, + elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c, + elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c, + elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c, + elf32-pj.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-sh64-com.c, + elf32-sh64.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c, + elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c, + elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-ppc.h, elf64-s390.c, + elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, + elfarm-oabi.c, elfcode.h, elfcore.h, elflink.c, elflink.h, + elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c, elfxx-mips.h, + elfxx-target.h, format.c, freebsd.h, genlink.h, hash.c, hp300hpux.c, + hppabsd-core.c, hpux-core.c, i386aout.c, i386linux.c, i386lynx.c, + i386mach3.c, i386msdos.c, i386os9k.c, ieee.c, ihex.c, irix-core.c, + libaout.h, libbfd-in.h, libbfd.c, libcoff-in.h, libecoff.h, libieee.h, + libnlm.h, liboasys.h, libpei.h, libxcoff.h, linker.c, lynx-core.c, + m68klinux.c, m68klynx.c, mach-o.c, mach-o.h, merge.c, mipsbsd.c, + mmo.c, netbsd-core.c, netbsd.h, nlm.c, nlm32-alpha.c, nlm32-i386.c, + nlm32-ppc.c, nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c, + pc532-mach.c, pdp11.c, pe-arm.c, pe-i386.c, pe-mcore.c, pe-mips.c, + pe-sh.c, peXXigen.c, pef.c, pei-arm.c, pei-i386.c, pei-mcore.c, + pei-mips.c, pei-sh.c, peicode.h, ppcboot.c, ptrace-core.c, reloc.c, + reloc16.c, riscix.c, rs6000-core.c, sco5-core.c, section.c, simple.c, + som.c, som.h, sparclinux.c, sparclynx.c, srec.c, stabs.c, sunos.c, + syms.c, targets.c, tekhex.c, ticoff.h, trad-core.c, versados.c, + vms-gsd.c, vms-hdr.c, vms-misc.c, vms-tir.c, vms.c, vms.h, + xcoff-target.h, xcofflink.c, xsym.c, xsym.h: Replace boolean with + bfd_boolean, true with TRUE, false with FALSE. Simplify comparisons + of bfd_boolean vars with TRUE/FALSE. Formatting. + * bfd-in2.h, libbfd.h, libcoff.h: Regenerate + +2002-11-28 Alan Modra + + * elf-bfd.h: Replace occurrences of Elf32_Internal_* and + Elf64_Internal_* with Elf_Internal_*. Replace Elf_Internal_Rel + with Elf_Internal_Rela. + * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h, + elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, + elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, + elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c, + elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c, + elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c, + elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c, + elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c, + elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, + elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c, + elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto. + * elf-hppa.h (elf_hppa_internal_shdr): Delete. Use Elf_Internal_Shdr + throughout instead. + * elf.c (_bfd_elf_no_info_to_howto_rel): Delete. + * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *. + Remove INLINE keyword. + (elf_swap_reloc_in): Likewise. Also clear r_addend. + (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand + as a bfd_byte *. + (elf_write_relocs): Consolidate REL and RELA code. + (elf_slurp_reloc_table_from_section): Simplify REL code. + (NAME(_bfd_elf,size_info)): Populate reloc swap entries. + * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define. + * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and + RELA code. + (elf_link_adjust_relocs): Likewise. Don't malloc space for temp + reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL. + (elf_link_output_relocs): Likewise. + (elf_reloc_link_order): Likewise. + (elf_finish_pointer_linker_section): Likewise. + (struct elf_link_sort_rela): Remove union. + (elf_link_sort_cmp1): Update to suit. + (elf_link_sort_cmp2): Here too. + (elf_link_sort_relocs): Consolidate REL and RELA code. Fix memory + over-allocation for int_rels_per_ext_rel != 1 case. + * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls. + * elf32-i386.c: Likewise. + * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out. + * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c, + elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise. + * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out. + * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, + elf64-sparc.c, elf64-x86-64.c: Likewise. + * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out. + * elfxx-mips.c (sort_dynamic_relocs): Likewise for + bfd_elf32_swap_reloc_in. + + * elf32-arm.h: Update elf32_arm_info_to_howto calls. + * elf32-mips.c: Likewise for mips_info_to_howto_rel. + (mips_elf64_swap_reloc_in): Zero r_addend. + (mips_elf64_be_swap_reloc_in): Likewise. + (mips_elf64_slurp_one_reloc_table): Simplify. + + * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries. + * elf64-hppa.c (hppa64_elf_size_info): Likewise. + * elf64-sparc.c (sparc64_elf_size_info): Likewise. + +2002-11-28 Kaz Kojima + + * elf32-sh.c (sh_elf_relocate_section): Don't complain about + unresolved debugging relocs in dynamic applications. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + +2002-11-26 Alan Modra + + * elf-eh-frame.c (ENSURE_NO_RELOCS): Disregard R_*_NONE relocs. + (_bfd_elf_discard_section_eh_frame): Don't discard duplicate CIEs + on a relocatable link. Comment typos. + * elf.c (_bfd_elf_link_hash_newfunc): Assign elements of structure + in the order they are declared. Clear elf_hash_value too. + (_bfd_elf_link_hash_table_init): Likewise assign in order. Clear + eh_info and tls_segment. + * elflink.h (elf_link_input_bfd ): Keep reloc offsets + sorted when discarding relocs by turning them into R_*_NONE. + + * libbfd.c (warn_deprecated): Comment spelling. + * po/SRC-POTFILES.in: Regenerate. + +2002-11-21 Richard Henderson + + * elflink.h (elf_link_add_object_symbols): Don't overwrite the + arch's st_other bits when merging visibilities. + (elf_link_output_extsym): Tidy clearing of visibility field. + +2002-11-21 Alan Modra + + * coff-mcore.c (SWAP_IN_RELOC_OFFSET): Define. + (SWAP_OUT_RELOC_OFFSET): Define. + +2002-11-20 Alexandre Oliva + + * elf.c (_bfd_elf_link_hash_table_init): Make sure + can_refcount is properly extended to the type of + init_refcount. + +2002-11-19 Alexandre Oliva + + * elfxx-mips.c (MIPS_RELOC_RELA_P): New macro. + (_bfd_mips_elf_relocate_section): Use it. + + * elfxx-mips.c (MNAME): New macro. + (_bfd_mips_elf_check_relocs): Use it. + (_bfd_mips_elf_discard_info): Likewise. + (_bfd_mips_elf_final_link): Likewise. + +2002-11-19 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_opd): When deleting relocs, adjust + rel_hdr.sh_size too. + +2002-11-18 Klee Dienes + + * Makefile.am (BFD32_LIBS): Add bfdwin.lo, bfdio.lo. + (BFD32_LIBS_CFILES): Add bfdwin.c, bfdio.c. + (BFD_H_FILES): Add bfdwin.c, bfdio.c. + (LIBBFD_H_FILES): Add bfdwin.c, bfdio.c. + Add dependencies for bfdwin.c, bfdio.c. + * bfd.c: Remove bfd_get_mtime, bfd_get_size. + * libbfd.c: Remove real_read, bfd_bread, _bfd_window_internal, + bfd_init_window, bfd_free_window, bfd_get_file_window, bfd_bwrite, + bfd_tell, bfd_flush, bfd_stat, bfd_seek. + * bfdio.c: New file. Contains real_read, bfd_bread, bfd_write, + bfd_tell, bfd_flush, bfd_stat, bfd_seek, bfd_ge_mtime, + bfd_get_size (moved from libbfd.c and bfd.c). + * bfdwin.c New file. Contains _bfd_window_internal, + bfd_init_window, bfd_free_window, bfd_get_file_window (moved from + libbfd.c and bfd.c). + * po/SRC-POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * aclocal.m4: Regenerate. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2002-11-18 Klee Dienes + + * bfd.c (bfd_preserve_save): Don't zero BFD_IN_MEMORY. + +2002-11-15 Kazu Hirata + + * coff-h8300.c (h8300_reloc16_estimate): Do not optimize away + jsr after a short jump. + * elf32-h8300.c (elf32_h8_relax_section): Likewise. + +2002-11-15 Klee Dienes + + * pef.c (bfd_pef_convert_architecture): Move declaration of + ARCH_POWERPC and ARCH_M68K to the start of the function. + +2002-11-14 Svein E. Seldal + + * coff-tic4x.c (tic4x_howto_table): Formatting fixup + +2002-11-14 Hans-Peter Nilsson + + * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs): + For bpo_gregs_section->contents, allocate _raw_size, not + _cooked_size. + +2002-11-13 Klee Dienes + + * config.bfd: Add entries for powerpc-*-darwin and cousins. + +2002-11-13 H.J. Lu + + * elfcode.h (elf_object_p): Don't restore abfd->arch_info. + +2002-11-13 Klee Dienes + Alan Modra + + * bfd.c (struct bfd_preserve): New. + (bfd_preserve_save): New function. + (bfd_preserve_restore): Ditto. + (bfd_preserve_finish): Ditto. + * bfd-in2.h: Regenerate. + * mach-o.c: Formatting. + (bfd_mach_o_scan_read_symtab_symbol): Make "value" unsigned. + (bfd_mach_o_object_p): Use bfd_preserve_save/restore/finish. + (bfd_mach_o_core_p): Ditto. + (bfd_mach_o_scan): Pass in mdata. + * mach-o.h (bfd_mach_o_scan): Update prototype. + * pef.c: Formatting. + (bfd_pef_object_p): Use bfd_preserve_save/restore/finish. + (bfd_pef_xlib_object_p): Ditto. + (bfd_pef_scan): Pass in mdata. Move version check to bfd_pef_object_p. + * pef.h (bfd_pef_scan): Update prototype. + * xsym.c: Formatting, K&R fixes. + (bfd_sym_object_p): Use bfd_preserve_save/restore/finish. + (bfd_sym_scan): New function split out from bfd_sym_object_p. + * xsym.h (bfd_sym_scan): Declare. + * elfcode.h (elf_object_p): Use bfd_preserve_save/restore/finish. + * elfcore.h (elf_core_file_p): Likewise. + * targets.c (_bfd_target_vector): Revert 2002-11-08 change. + +2002-11-12 Nick Clifton + + * po/da.po: Updated Danish translation. + +2002-11-12 Alan Modra + + * elflink.h (elf_link_add_object_symbols): Optimize stabs for + relocatable link too. + (elf_link_input_bfd): When emitting relocs, adjust offsets for + eh_frame and stab sections. Zap deleted relocs. + (elf_reloc_symbol_deleted_p): Return true for zero r_symndx. + (elf_bfd_discard_info): Run for relocatable link too. + * elf64-ppc.c (ppc64_elf_edit_opd): Rename from edit_opd. Make global. + Handle ld -r case. + (ppc64_elf_size_dynamic_sections): Don't call edit_opd from here. + * elf64-ppc.h (ppc64_elf_edit_opd): Declare. + + * elf-bfd.h (struct cie_header): Move from elf_eh-frame.c. + (struct cie, struct eh_cie_fde, struct eh_frame_sec_info): Likewise. + (struct eh_frame_array_ent, struct eh_frame_hdr_info): Likewise. + (enum elf_link_info_type): Remove ELF_INFO_TYPE_EH_FRAME_HDR. + (struct eh_frame_hdr_info): Add "hdr_sec", remove "split". + (struct elf_link_hash_table): Add eh_info. + (struct elf_obj_tdata): Change eh_frame_hdr to an asection *. + (_bfd_elf_discard_section_eh_frame): Update prototype. + (_bfd_elf_discard_section_eh_frame_hdr): Likewise. + (_bfd_elf_write_section_eh_frame): Likewise. + (_bfd_elf_write_section_eh_frame_hdr): Likewise. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Remove "ehdrsec" + param. Get "hdr_info" from link hash table. + (_bfd_elf_discard_section_eh_frame_hdr): Remove "sec" param. Get + header section from link hash table. Save header section to elf_tdata. + (_bfd_elf_maybe_strip_eh_frame_hdr): Remove local "sec". Use + header section from link hash table. Don't alloc hdr_info. Clear + hdr_sec instead of setting "strip". + (_bfd_elf_eh_frame_section_offset): Formatting. + (_bfd_elf_write_section_eh_frame): Remove "ehdrsec", add "info" param. + Get header section from link hash table. + (_bfd_elf_write_section_eh_frame_hdr): Remove "sec", add "info" param. + Get header section from link hash table. + * elf.c (map_sections_to_segments): Use cached eh_frame_hdr. + (get_program_header_size): Likewise. + (_bfd_elf_section_offset): Formatting. + * elflink.h (elf_link_create_dynamic_sections): Stash eh frame header + section pointer in link hash table. + (elf_bfd_final_link): Adjust _bfd_elf_write_section_eh_frame_hdr + and _bfd_elf_write_section_eh_frame calls. Update comment about + eh_frame entries. + (elf_bfd_discard_info): Adjust _bfd_elf_discard_section_eh_frame and + _bfd_elf_discard_section_eh_frame_hdr calls. Remove "ehdr". + + * po/SRC-POTFILES.in: Regenerate. + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't zero + relocs for discarded FDEs. Remove dead code. + (_bfd_elf_write_section_eh_frame_hdr): Remove dead code. + * elflink.h (elf_bfd_discard_info): Don't save edited relocs. + Tidy conditions under which stabs are edited. Formatting. + * elf64-sparc.c (sparc64_elf_relocate_section): Ignore overflows + from discarded relocs. + * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Add reloc output + section adjustments after testing magic values. + +2002-11-12 Thomas Moestl + + * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Correct + references to large plt symbols. + +2002-11-12 Klee Dienes + + * mach-o.c (bfd_mach_o_scan_read_thread): Don't re-use 'i' when + looking for an unused section name. + +2002-11-11 Kazu Hirata + + * coff-h8300.c: Fix formatting. + * elf32-h8300.c: Likewise. + * reloc16.c: Likewise. + +2002-11-09 Jeroen Dobbelaere + + * elf32-arm.h (elf32_arm_size_dynamic_sections): Don't strip output + section when dynamic section unused; _bfd_strip_section_from_output + instead. + +2002-11-08 Alan Modra + + * targets.c (_bfd_target_vector): Disable pef_vec, pef_xlib_vec + and sym_vec. + + * dwarf2.c: Revert last change. + +2002-11-07 Michal Ludvig + + * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, + _bfd_dwarf2_find_nearest_line): Use + bfd_simple_get_relocated_section_contents() instead of + bfd_get_section_contents(). + * reloc.c (bfd_perform_relocation): Add sanity check. + * simple.c (simple_get_relocated_section_contents): If the section + does not have any relocs associated with it, just return the + unadjusted contents. + +2002-11-07 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) : Correct test for filling in constant .got + contents, enabling for a non-DSO, for symbols defined in the + program with --export-dynamic. + +2002-11-07 Alan Modra + + * elf64-ppc.c: Comment typo fixes. + (ppc64_elf_merge_private_bfd_data): Allow BFD_ENDIAN_UNKNOWN input. + +2002-11-07 Nick Clifton + + * po/da.po: Updated Danish translation. + +2002-11-06 Alexandre Oliva + + * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Generate + exactly three internal relocs per external reloc. Set reloc_count + to the external reloc count. + +2002-11-06 Klee Dienes + + * coff-stgo32.c (stub_bytes): Mark as const. + Fix comment formatting. + +2002-11-06 Klee Dienes + + * Makefile.am (BFD32_BACKENDS): Add mach-o.lo, pef.lo, and + xsym.lo. + (BFD32_BACKENDS_CFILES): Add mach-o.c, pef.c, and xsym.c. + (SOURCE_HFILES): Add mach-o.h, pef.h, pef-traceback.h, xsym.h + * archures.c (enum bfd_architecture): Add bfd_arch_m98k. + * bfd.c (struct bfd): Add private data for mach-o, pef, and sym. + * targets.c (enum bfd_flavour): Add flavours for mach-o, pef, and + sym. + (_bfd_target_vector): Add target vectors for mach-o, pef, and sym. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * xsym.c: New file. Contains support for the Apple/Metrowerks + xSYM debugging format. + * xsym.h: New file. + * pef.c: New file. Contains support for the Apple Code Fragment + Manager Preferred Executable Format + * pef.h: New file. + * pef-traceback.h: New file. Contains support for parsing PowerPC + traceback tables as used by PEF executables (and perhaps other + systems as well). + * mach-o.c: New file. Contains support for the Mach-O object file + format. + * mach-o.h: New file. + * mach-o-target.c: New file. Declares the mach-o targets + themselves. Included three times by mach-o.c; each time with a + different set of macros set. + +2002-11-06 Graeme Peterson + + * Makefile.am: Remove entries for elf32-qnx.[ch]. + * Makefile.in: Regenerate. + * config.bfd: Change arm-nto to use bfd_elf32_{big|little}arm_vec, + ppc-nto to use bfd_elf32_powerpc{le}_vec, sh-nto to use + bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec. + * configure.in: Remove support for bfd_elf32_sh{l}qnx_vec, + bfd_elf32_powerpc{le}qnx_vec, bfd_elf32_{big|little}armqnx_vec, + and bfd_elf32_i386qnx_vec, and removed elf32-qnx.lo from other targets. + bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec. + * configure: Regenerate. + * elf32-qnx.c: Remove. + * elf32-qnx.h: Remove. + * elf.c: Remove calls to QNX specific set_nonloadable_filepos, + is_contained_by_filepos, and copy_private_bfd_data_p. + * elf-bfd.h (struct elf_backend_data): Remove set_nonloadable_filepos, + is_contained_by_filepos, and copy_private_bfd_data_p. + * elf32-i386.c: Remove QNX extended bfd support. + * elf32-ppc.c: Remove QNX extended bfd support. + * elf32-sh.c: Remove QNX extended bfd support. + * elfarm-nabi.c: Remove QNX extended bfd support. + * targets.c: Remove qnx vectors. + * elfxx-target.h (elf_backend_set_nonloadable_filepos): Remove + (elf_backend_is_contained_by_filepos): Remove. + (elf_backend_copy_private_bfd_data_p): Remove. + * po/SRC-POTFILES.in: Regenerate. + +2002-11-06 David O'Brien + Alan Modra + + * elf64-sparc.c (sparc64_elf_relocate_section): Adjust addend of + dynamic relocs against section symbols for the output section vma. + +2002-11-05 Alan Modra + + * elf32-arm.h (t2a1_push_insn, t2a2_ldr_insn, t2a3_mov_insn, + t2a4_bx_insn, t2a5_pop_insn, t2a6_bx_insn): Remove. + +2002-11-05 Kaz Kojima + Alan Modra + + * config.bfd (sh-*-linux*): Use bfd_elf*_sh64*lin_vec as sh64 + vectors in target_selvecs. + (shle-*-netbsdelf*): Use bfd_elf*_sh64*nbsd_vec as sh64 vectors + in target_selvecs. + (sh-*-netbsdelf*): Likewise. + * configure.in (assocvecs): New variable. Handle assocvecs like + selvecs. + * configure: Regenerate. + * format.c (bfd_check_format_matches): Store bfd_target pointers + in matching_vector instead of target names. Select first target + from bfd_associated_vector that matches a list of ambiguous targets. + * targets.c (_bfd_associated_vector): New array. + (bfd_associated_vector): New variable. + (_bfd_target_vector): Add bfd_elf*_sh64*lin_vec. + * libbfd-in.h (bfd_associated_vector): Declare. + * libbfd.h: Regenerate. + +2002-11-05 Elias Athanasopoulos + + * vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is + non-NULL before dereferencing. + +2002-11-04 Kaz Kojima + + * vms.c (vms_object_p): Restore the start address when returning + NULL. + +2002-11-04 Alan Modra + Hans-Peter Nilsson + + * elflink.h (struct elf_final_link_info): Add shndxbuf_size. + (elf_bfd_final_link): Don't bother zeroing symtab_hdr fields. + Set up a larger symshndxbuf, and write it out. Free it on + exit rather than freeing symbuf twice. Correct section index + on output section symbol loop. + (elf_link_output_sym): Accumulate symbol extension section + indices, reallocating symshndxbuf rather than writing it out. + (elf_link_flush_output_syms): Don't flush symshndxbuf. + * elf.c (assign_section_numbers): Init i_shdrp to all zero. + Use bfd_zalloc to clear i_shdrp[0] too. + +2002-11-03 Stephen Clarke + + * elf32-sh64-com.c (sh64_address_in_cranges): Use + _raw_size of cranges section if _cooked_size not yet set. + +2002-11-03 Hans-Peter Nilsson + + * elf32-v850.c (v850_elf_relax_delete_bytes): Correct parameters + for bfd_elf32_swap_symbol_out. + +2002-10-31 David O'Brien + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't mix + signed and unsigned in comparison. + +2002-10-30 Daniel Jacobowitz + + * coffcode.h: Remove extraneous '\'. + +2002-10-28 H.J. Lu + + * Makefile.am (targets.lo): Depend on Makefile instead of + config.status. + (archures.lo): Likewise. + * Makefile.in: Regenerated. + +2002-10-25 Jason Thorpe + + * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Add + bfd_elf64_bigmips_vec and bfd_elf64_littlemips_vec to + targ_selvecs. + +2002-10-25 Jim Wilson + + * elf64-sh64.c (sh_elf64_relocate_section): Call + _bfd_elf_rela_local_sym. Handle relocs against STT_SECTION symbol + of SHF_MERGE section. + +2002-10-25 Hans-Peter Nilsson + + * simple.c: Correct placement of ATTRIBUTE_UNUSED. + +2002-10-24 John David Anglin + + * aoutx.h (NAME(aout,swap_ext_reloc_in)): Cast bytes->r_index to + unsigned int. Cast RELOC_BASE10, RELOC_BASE13 and RELOC_BASE22 to + unsigned int. + (NAME(aout,final_link)): Cast enum used in assignment. + (aout_link_write_symbols): Cast enums in comparisons, int values to + boolean, enums in assignments to int. + (aout_link_input_section_std): Cast rel->r_index to unsigned int. + (aout_link_input_section_ext): Likewise. Cast enums used in + comparisons with unsigned ints. + (aout_link_reloc_link_order): Cast enum to int in assignment. + * archive.c (_bfd_generic_read_ar_hdr_mag): Cast result of memchr + calls to char *. + * bfd-in.h (bfd_set_section_vma): Cast enum true to unsigned int in + assignment. + * bfd-in2.h (bfd_set_section_vma): Likewise. + * bfd.c (bfd_record_phdr): Cast enums in assignments. + * binary.c (bfd_alloc): Cast enum to long. + * coffgen.c (_bfd_coff_is_local_label_name): Cast return to boolean. + * dwarf2.c (read_abbrevs): Add casts to enum types. + (read_attribute_value): Likewise. + (arange_add): Cast result of bfd_zalloc call. + (comp_unit_contains_address): Return true and false. + (comp_unit_find_nearest_line): Cast return to boolean. + * format.c (bfd_check_format_matches, bfd_set_format): Likewise. + * gen-aout.c: define macro '_' if not defined. + * libbfd.c (bfd_realloc): Cast malloc and realloc to PTR. + (bfd_bwrite): Cast bfd_realloc to bfd_byte *. + (bfd_write_bigendian_4byte_int): Cast return to boolean. + (bfd_seek): Cast bfd_realloc to bfd_byte *. + (bfd_generic_is_local_label_name): Cast return to boolean. + * libcoff.h (_bfd_coff_adjust_symndx): Remove extraneous '\'. + * linker.c (_bfd_link_hash_newfunc): Cast bfd_hash_allocate result to + struct bfd_hash_entry *. + (_bfd_generic_link_hash_newfunc): likewise. + (_bfd_generic_final_link): Cast enum to unsigned int. + * merge.c (sec_merge_emit): Cast return to boolean. + (merge_strings): Add casts to const unsigned char *. + * reloc.c (bfd_get_reloc_code_name): Cast enums in comparison to int. + (bfd_generic_get_relocated_section_content): Cast enum to unsigned int. + * section.c (bfd_section_hash_newfunc): Cast bfd_hash_allocate result + to struct bfd_hash_entry *. + (bfd_set_section_content): Add cast to PTR in comparison. + * simple.c (simple_dummy_warning, simple_dummy_undefined_symbol, + simple_dummy_reloc_overflow, simple_dummy_reloc_dangerous, + simple_dummy_unattached_reloc, + bfd_simple_get_relocated_section_contents): Add K&R declarations and + function definitions. + * srec.c (S3Forced): Initialize to false. + (srec_get_symtab): Cast return value from bfd_alloc to asymbol *. + * stabs.c (_bfd_link_section_stabs): Cast enum to int in comparisons. + (_bfd_discard_section_stabs): Likewise. Also cast return to boolean. + * syms.c (bfd_is_undefined_symclass): Cast return to boolean. + (_bfd_stab_section_find_nearest_line): Cast enum to bfd_byte in + comparisons. + +2002-10-23 Jakub Jelinek + + * elf64-alpha.c (elf64_alpha_check_relocs): Only put maybe_dynamic + relocs into shared lib non-allocated reloc sections. + +2002-10-23 Nathan Tallent + + * dwarf2.c (add_line_info): Ensure that the line_info_table is + sorted even when given an out-of-order line sequence. + (lookup_address_in_line_info_table): When an exact VMA match is + not found, return line information with the closest VMA. + +2002-10-23 Ross Alexander + + * elf64-hppa.c: Force DT_FLAGS to always be set. Required by + HPUX 11.00 patch PHSS_26559. + +2002-10-22 Alexandre Oliva + + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Don't move + the options section into a separate section unless IRIX 6 + compatibility is enabled. + +2002-10-22 Alexandre Oliva + + * elflink.h (struct elf_link_sort_rela): Turn rel and rela + into arrays. + (elf_link_sort_cmp1, elf_link_sort_cmp2): Adjust. + (elf_link_sort_relocs): Likewise. Take int_rels_per_ext_rel + into account. + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Compose + R_MIPS_REL32 with R_MIPS64 if ABI_64_P. + +2002-10-21 Graeme Peterson + + * targets.c (_bfd_target_vector): Add missing qnx vectors. + +2002-10-21 Alan Modra + + * targets.c (bfd_target_list): Don't return the default target twice. + +2002-10-21 Elias Athanasopoulos + + * archive.c (_bfd_archive_bsd_update_armap_timestamp): Replace + perror with bfd_perror. + +2002-10-19 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): Correctly handle + DT_RPATH and DT_RUNPATH. + +2002-10-19 Mark Kettenis + + * elf.c (elfcore_grok_note): Fix recognition on NT_PRXFPREG notes. + +2002-10-17 Denis Chertykov + + * elf32-ip2k.c (ELF_MACHINE_ALT1): Define alternate machine code + for ip2k port. + +2002-10-17 Alan Modra + + * elfxx-target.h (USE_REL): Don't define as 1. + * elf32-arm.h (USE_REL): Provide a default define of 0. + Use #if rather than #ifdef when testing USE_REL. + * elf32-m32r.c: Likewise. + + * elf32-arc.c (USE_REL): Define as 1. + * elf32-d10v.c (USE_REL): Likewise. + * elf32-m32r.c (USE_REL): Likewise. + * elf32-m68hc11.c (USE_REL): Likewise. + * elf32-m68hc12.c (USE_REL): Likewise. + * elf32-or32.c (USE_REL): Likewise. + * elfarm-nabi.c (USE_REL): Likewise. + +2002-10-16 Jakub Jelinek + + * config.bfd (s390-*-linux*): Add targ64_selvecs. + (s390x-*-linux*): Add targ_selvecs. + +2002-10-16 Alan Modra + + * Makefile.am (BFD32_BACKENDS): Remove elfarmqnx-nabi.lo, + elf32-i386-fbsd.lo, elf32-i386qnx.lo, elf32-ppcqnx.lo, + elf32-sh-lin.lo, elf32-sh64-lin.lo, elf32-sh-nbsd.lo, + elf32-sh64-nbsd.lo, elf32-shqnx.lo. Add elf32-qnx.lo. + (BFD32_BACKENDS_CFILES): Likewise for corresponding C files. + (BFD64_BACKENDS): Remove elf64-sh64-lin.lo, elf64-sh64-nbsd.lo. + (BFD64_BACKENDS_CFILES): Likewise for corresponding C files. + (SOURCE_HFILES): Add elf32-qnx.h. + (BUILD_HFILES): Add bfdver.h. + Run "make dep-am". + * Makefile.in: Regenerate. + * configure.in Update bfd vector dependencies. + * configure: Regenerate. + * elf32-i386-fbsd.c: Delete. Move code to elf32-i386.c. + * elf32-i386qnx.c: Likewise. + * elf32-ppcqnx.c: Delete. Move code to elf32-ppc.c. + * elf32-sh-nbsd.c: Delete. Move code to elf32-sh.c. + * elf32-sh-lin.c: Likewise. + * elf32-shqnx.c: Likewise. + * elf32-sh64-lin.c: Delete. Move code to elf32-sh64.c. + * elf32-sh64-nbsd.c: Likewise. + * elf64-sh64-lin.c: Delete. Move code to elf64-sh64.c. + * elf64-sh64-nbsd.c: Likewise. + * elfarmqnx-nabi.c: Delete. Move code to elfarm-nabi.c. + * elf32-arm.h (ELF_MAXPAGESIZE): Always define. + * elf32-i386.c: Remove ELF_ARCH and ELF32_I386_C_INCLUDED tests. + * elf32-ppc.c: Remove ELF32_PPC_C_INCLUDED tests. + * elf32-qnx.h (elf_backend_set_nonloadable_filepos): Always define. + (elf_backend_is_contained_by_filepos): Likewise. + (elf_backend_copy_private_bfd_data_p): Likewise. + Globalize and move functions to.. + * elf32-qnx.c: ..here. New file. + * elf32-sh.c: Remove ELF_ARCH and ELF32_SH_C_INCLUDED tests. Don't + emit target vectors when INCLUDE_SHMEDIA. + * elf32-sh64.c: Remove ELF_ARCH test. Move TARGET_* etc. defines to + end of file. + * elf64-sh64.c: Remove ELF_ARCH test. + * elfarm-nabi.c: Remove ELFARM_NABI_C_INCLUDED test. + * po/BLD-POTFILES.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2002-10-16 Alan Modra + + * elflink.h (elf_link_add_object_symbols): Error out on dynamic objects + loaded with --just-symbols. + + * elf32-i386qnx.c (TARGET_LITTLE_NAME): Define. + * elf32-ppcqnx.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define. + * elf32-shqnx.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define. + * elfarmqnx-nabi.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define. + +2002-10-15 Richard Henderson + + * Makefile.am (BFD64_BACKENDS): Remove elf64-alpha-fbsd. + (BFD64_BACKENDS_CFILES): Likewise. + * configure.in (bfd_elf64_alpha_freebsd_vec): Use elf64-alpha. + * elf64-alpha-fbsd.c: Remove file, move code ... + * elf64-alpha.c: ... here. + * Makefile.in, configure: Rebuild. + +2002-10-14 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: Increment + VALUE, not ADDEND. + +2002-10-14 Stephen Clarke + + * elf32-sh.c (elf_sh_link_hash_entry): Replace + datalabel_got_offset with union of datalabel_got + offset and refcount. + (sh_elf_link_hash_newfunc): Initialize datalabel_got.refcount. + (allocate_dynrelocs): Delete unnecessary code for + STT_DATALABEL type. Create entry in got for + datalabel version of symbol if datalabel_got.refcount > 0. + (sh_elf_relocate_section): Use datalabel_got union. + (sh_elf_gc_sweep_hook): Pull common code to initialize + h and eh out of switch statement. Declare seen_stt_datalabel. + Initialize it. Decrement datalabel_got.refcount for + got relocs when seen_stt_datalabel is true. + Decrement local_got_refcounts entry for datalabel got relocs + of local symbols. + (sh_elf_copy_indirect_symbol): Copy datalabel_got field over. + (sh_elf_check_relocs): Declare seen_stt_datalabel. + Initialize it. When seen_stt_datalabel is true, increment + datalabel_got refcount rather than got.refcount. + (sh_elf_finish_dynamic_symbol): Create relocs to + initialize got entry for datalabel version of symbol. + +2002-10-14 Alan Modra + + * Makefile.am: Run "make dep-am". + (BFD_H_FILES): Remove version.h. + * bfd-in.h (BFD_VERSION, BFD_VERSION_DATE, BFD_VERSION_STRING): Move.. + * version.h: ..to here. + * configure.in (bfd_version_date): Remove. + (AC_OUTPUT): Make bfdver.h from version.h. + * bfd.c: #include "bfdver.h". + * vms-hdr.c: Likewise. + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2002-10-14 Alan Modra + + * archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086, + bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64, + bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64, + bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850, + bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8, + bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple, + bfd_mach_ia64_elf64, bfd_mach_ia64_elf32, + bfd_mach_ip2022, bfd_mach_ip2022ext, + bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber. + * bfd-in2.h: Regenerate. + +2002-10-14 Kaz Kojima + + * config.bfd (sh*eb-*-linux*, sh*-*-linux*): Add the alternative + endian vector to targ_selvecs. + +2002-10-13 Alexandre Oliva + + * elfxx-mips.c (mips_elf_calculate_relocation): Take + save_addend argument. Don't apply the 32-bit mask to a + GPREL32 value if it's to be used in another relocation. Don't + use forced-check computation of local_p to decide whether to + add gp0 to GPREL16 value. Don't use only the lowest 16 bits + of the addend of a non-in-place GPREL16 relocation. + (_bfd_mips_elf_relocate_section): Pass use_saved_addend_p to + mips_elf_calculate_relocation(). + +2002-10-12 Stephane Carrez + + * elf32-m68hc11.c (m68hc11_elf_relax_section): Don't treat relocs + with symbols in other sections if we relaxed something; the sections + output offsets must be re-computed before. + +2002-10-12 Stephane Carrez + + * elf32-m68hc11.c (m68hc11_elf_relax_section): Update symbols + handling to use Elf_Internal_Sym. + (m68hc11_elf_relax_delete_bytes): Likewise. + +2002-10-11 Kaz Kojima + + * elf32-sh.c (sh_elf_optimized_tls_reloc, sh_elf_mkobject, + sh_elf_object_p, dtpoff_base): New functions. + (sh_elf_howto_table): Add TLS relocs. + (sh_reloc_map): Likewise. + (sh_elf_info_to_howto): Support TLS relocs. + (elf_sh_link_hash_entry): Add tls_type and tls_tpoff32. + (sh_elf_hash_entry, sh_elf_tdata, sh_elf_local_got_tls_type): + New macros. + (sh_elf_obj_tdata): New. + (elf_sh_link_hash_table): Add tls_ldm_got. + (sh_elf_link_hash_table_create): Clear refcount of tls_ldm_got. + (allocate_dynrelocs): Support TLS relocs. + (sh_elf_size_dynamic_sections): Likewise. + (sh_elf_relocate_section): Support TLS relocs. Don't try to find + .rela.got section when found already. Return false after printing + error about unresolvable relocation. + (sh_elf_gc_sweep_hook): Support TLS relocs. + (sh_elf_check_relocs): Likewise. + (sh_elf_finish_dynamic_symbol): Likewise. + (bfd_elf32_mkobject, elf_backend_object_p): Define for TLS case. + * reloc.c: Add SH TLS relocs. + * bfd-in2.h, libbfd.h: Regenerate. + +2002-10-11 Daniel Jacobowitz + + * Makefile.in: Regenerated. + +2002-10-11 Daniel Jacobowitz + + * Makefile.am: Run dep-am. + (BFD_H_DEP): Add simple.c and linker.c. + (BFD32_LIBS): Add simple.lo. + (BFD32_LIBS_CFILES): Add simple.c. + * Makefile.in: Regenerated. + * bfd-in2.h: Regenerated. + * simple.c: New file. + +2002-10-11 Alan Modra + + * coff-arm.c (record_arm_to_thumb_glue): Avoid type-punned pointers. + (record_thumb_to_arm_glue): Likewise. + * ecoff.c (ecoff_link_add_externals): Likewise. + * elf32-arm.h (record_arm_to_thumb_glue): Likewise. + (record_thumb_to_arm_glue): Likewise. + * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise. + * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise. + * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise. + * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise. + * elf64-ppc.c (func_desc_adjust): Likewise. + * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise. + (sh64_elf64_create_dynamic_sections): Likewise. + * elflink.c (_bfd_elf_create_got_section): Likewise. + (_bfd_elf_create_dynamic_sections): Likewise. + (_bfd_elf_create_linker_section): Likewise. + * elflink.h (elf_add_default_symbol): Likewise. + (elf_link_create_dynamic_sections): Likewise. + (NAME(bfd_elf,size_dynamic_sections)): Likewise. + * elfxx-ia64.c (elfNN_ia64_aix_add_symbol_hook): Likewise. + * elfxx-mips.c (mips_elf_create_got_section): Likewise. + (_bfd_mips_elf_add_symbol_hook): Likewise. + (_bfd_mips_elf_create_dynamic_sections): Likewise. + * linker.c (generic_link_add_symbol_list): Likewise. + * xcofflink.c (xcoff_link_add_symbols): Likewise. + + * elfxx-ia64.c (oor_brl, oor_ip): Conditionally define. + + * elf64-ppc.c (edit_opd): Only zero opd syms when function is + completely removed. Correct local sym adjustment. + +2002-10-10 Stephen Clarke + + * elf32-sh.c (elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le): + Correct mistake in calculation of address of .got. + * elf64-sh64.c (elf_sh64_pic_plt_entry_be, + elf_sh64_pic_plt_entry_le): Likewise. + +2002-10-09 Richard Shann + Stephen Clarke + + * Makefile.am: Add entries for elf32-sh64-lin.c and + elf64-sh64-lin.c. Regenerate. + * Makefile.in: Regenerate. + * config.bfd: Change sh64eb-*-linux* and sh64-*-linux* + to use sh64 vectors rather than sh vectors. + * configure.in: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec, + bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec. + * configure: Regenerate. + * elf32-sh64-lin.c: New file. + * elf64-sh64-lin.c: New file. + * targets.c: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec, + bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec. + +2002-10-08 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Re-arrange the + IE->LE transition for R_386_TLS_IE. + +2002-10-08 Alan Modra + + * elf64-ppc.c (edit_opd): Correct test for discarded sections. + +2002-10-07 Mark Elbrecht + + * cofflink.c (mark_relocs): Don't mark relocations in excluded + sections. + +2002-10-07 Alan Modra + + * elflink.h (elf_link_input_bfd): Remove BFD_VERSION_DATE dependent + code. + + * elf64-ppc.c (ppc64_elf_build_stubs): Increment .glink indx. + +2002-10-06 Alan Modra + + * opncls.c: Formatting. + (_bfd_new_bfd): Use a smaller section hash table. + +2002-10-05 Alexandre Oliva + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Set the type + of the other two relocations packed with a REL32 to NONE. + +2002-10-02 Stephen Clarke + + * elf32-sh.c (elf_sh_link_hash_entry): Add gotplt_refcount. + (sh_elf_link_hash_newfunc): Initialize it. + (allocate_dynrelocs): Transfer gotplt refs from plt.refcount + to got.refcount for symbols that are forced local or when + we have direct got refs. + (sh_elf_gc_sweep_hook): Adjust gotplt_refcount. Use it + to correctly adjust got.refcount and plt.refcount. + (sh_elf_copy_indirect_symbol): Copy gotplt_refcount across. + (sh_elf_check_relocs): Increment gotplt_refcount. + +2002-10-01 Jakub Jelinek + + * elf32-i386.c (elf_i386_relocate_section): Fix + movl foo@indntpoff, %eax IE->LE transition. + +2002-10-01 Jakub Jelinek + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Change TLSGD + sequence and its transitions. + +2002-10-01 Jakub Jelinek + + * elf32-i386.c (elf_i386_relocate_section): Resolve R_386_TLS_LDO_32 + to st_value + addend in non-code sections. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Resolve + R_X86_64_DTPOFF32 to st_value + addend in non-code sections. + +2002-09-30 Gavin Romig-Koch + Ken Raeburn + Aldy Hernandez + Eric Christopher + Richard Sandiford + + * archures.c (bfd_mach_mips4120, bfd_mach_mips5400): New. + (bfd_mach_mips5500): New. + * cpu-mips.c (I_mips4120, I_mips5400, I_mips5500): New. + (arch_info_struct): Add corresponding entries here. + * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_4120, + E_MIPS_MACH_5400 and E_MIPS_MACH_5500. + (_bfd_mips_elf_final_write_processing): Handle bfd_mach_mips4120, + bfd_mach_mips5400 and bfd_mach_mips5500. + (_bfd_mips_elf_mach_extends_p): New function. + (_bfd_mips_elf_merge_private_bfd_data): Use it to help merge + the EF_MIPS_MACH flags. + * bfd-in2.h: Regenerate. + +2002-09-28 Jason Thorpe + + * elf32-vax.c (elf_vax_size_dynamic_section): Don't strip + .got sections. + +2002-09-28 Alan Modra + + * elf.c (map_sections_to_segments): Correct test for start of + writable section in the same page as end of read-only section. + +2002-09-27 Matt Thomas + + * elf32-vax.c (elf_vax_check_relocs): Remove unused + local_got_refcounts usage. Remove allocation of got slot. + (elf_vax_gc_sweep_hook): Remove unused local_got_refcounts usage. + Remove de-allocation of got slot. + (elf_vax_size_dynamic_section): Fix some indentation. Add hash + traversal for elf_vax_instantiate_got_entries. Allow empty .got + sections to be GC'ed. + (elf_vax_instantiate_got_entries): New function. + (elf_vax_relocate_section): Simplify R_VAX_GOT32 handling. Remove + tests that are now handled by elf_vax_instantiate_got_entries. + Assert GOT entry falls within .got section size. Remove redundant + comparisions. Fix comments. + +2002-09-27 Jakub Jelinek + + * reloc.c: Add x86-64 TLS relocs. + * bfd-in2.h, libbfd.h: Rebuilt. + * elf64-x86-64.c (x86_64_elf_howto): Fix size fields for 32-bit + relocs. Add TLS relocs. + (x86_64_reloc_map): Add TLS relocs. + (elf64_x86_64_info_to_howto): Adjust for added TLS relocs. + (struct elf64_x86_64_link_hash_entry): Add tls_type field. + (GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE): Define. + (elf64_x86_64_hash_entry): Define. + (struct elf64_x86_64_obj_tdata): New. + (elf64_x86_64_tdata, elf64_x86_64_local_got_tls_type): Define. + (struct elf64_x86_64_link_hash_table): Add tls_ld_got. + (link_hash_newfunc): Initialize tls_type. + (elf64_x86_64_link_hash_table_create): Initialize tls_ld_got. + (elf64_x86_64_copy_indirect_symbol): Swap tls_type if necessary. + (elf64_x86_64_mkobject): New. + (elf64_x86_64_elf_object_p): Allocate struct elf64_x86_64_obj_tdata. + (elf64_x86_64_tls_transition): New. + (elf64_x86_64_check_relocs): Add r_type variable and use it. + Handle TLS relocs. + (elf64_x86_64_gc_sweep_hook): Handle TLS relocs. + (allocate_dynrelocs): Allocate GOT space for TLS relocs. + (elf64_x86_64_size_dynamic_sections): Likewise. + (dtpoff_base, tpoff): New. + (elf64_x86_64_relocate_section): Handle TLS relocs. + (elf64_x86_64_finish_dynamic_symbol): Only handle non-TLS GOT + entries. + (bfd_elf64_mkobject): Define. + + * elf32-i386.c (elf_i386_check_relocs) [R_386_TLS_LE]: Set + DF_STATIC_TLS if shared. + +2002-09-26 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_fake_sections): Don't emit unneeded + empty relocation sections. + +2002-09-26 Alan Modra + + * elf64-ppc.c (ppc_build_one_stub): Don't build glink stubs here. + (ppc64_elf_build_stubs): Build them here instead. + +2002-09-24 Jakub Jelinek + + * elf32-sparc.c (elf32_sparc_relocate_section): Put R_SPARC_RELATIVE + addend into r_addend, not *r_offset. + (elf32_sparc_finish_dynamic_symbol): Likewise. + * elf64-sparc.c (sparc64_elf_finish_dynamic_symbol): Clear xword at + R_SPARC_RELATIVE's r_offset. + +2002-09-23 Nathan Tallent + + * dwarf2.c (decode_line_info): Update to correctly decode + the (non-standard DWARF2) out-of-order address sequences + generated by the Intel C++ 6.0 compiler for ia64-Linux. + +2002-09-23 Mark Elbrecht + + * config.bfd: For DJGPP targets, match with any cpu and any machine. + +2002-09-23 Alan Modra + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Zero relocs + for discarded FDEs. Remove redundant assignment. + * elflink.h (elf_bfd_discard_info): Save edited relocs. + +2002-09-22 H.J. Lu + + * elf64-alpha.c (elf64_alpha_merge_ind_symbols): Don't merge + the relocation count between different .reloc sections. + +2002-09-21 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Allow ".sbss.*" and + ".sdata.*" for R_PPC_SDAREL16, ".sbss2*" and ".sdata2*" for + R_PPC_EMB_SDA2REL. Similarly for R_PPC_EMB_SDA21 and + R_PPC_EMB_RELSDA. + + * elfcode.h (elf_slurp_reloc_table_from_section): Make "symcount" + unsigned. Move "symcount" assignment out of loop. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * configure: Regenerate. + * po/SRC-POTFILES.in: Regnerate. + +2002-09-19 Nathan Tallent + + * dwarf2.c (_bfd_dwarf2_find_nearest_line): If address length is + zero, set it to 8 for (non-standard) 64-bit DWARF2 formats + (e.g. IRIX64). + +2002-09-19 Jakub Jelinek + + * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Clear .got word + even if generating R_PPC_RELATIVE reloc. + (ppc_elf_relocate_section): Make sure relocation is performed + if skip == -2. Clear memory at r_offset when creating dynamic + relocation. + +2002-09-19 Jakub Jelinek + + * reloc.c (BFD_RELOC_386_TLS_TPOFF, BFD_RELOC_386_TLS_IE, + BFD_RELOC_386_TLS_GOTIE): Add. + * bfd-in2.h, libbfd.h: Rebuilt. + * elf32-i386.c (elf_howto_table): Add R_386_TLS_TPOFF, R_386_TLS_IE + and R_386_TLS_GOTIE. + (elf_i386_reloc_type_lookup): Handle it. + (struct elf_i386_link_hash_entry): Change tls_type type to unsigned + char instead of enum, change GOT_* into defines. + (GOT_TLS_IE_POS, GOT_TLS_IE_NEG, GOT_TLS_IE_BOTH): Define. + (elf_i386_tls_transition): Handle R_386_TLS_IE and R_386_TLS_GOTIE. + (elf_i386_check_relocs): Likewise. Avoid crash if local symbol is + accessed both as normal and TLS symbol. Move R_386_TLS_LDM and + R_386_PLT32 cases so that R_386_TLS_IE can fall through. + Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs. + (elf_i386_gc_sweep_hook): Handle R_386_TLS_IE and R_386_TLS_GOTIE. + Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs. + (allocate_dynrelocs): Allocate 2 .got and 2 .rel.got entries if + tls_type is GOT_TLS_IE_BOTH. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Handle R_386_TLS_IE and R_386_TLS_GOTIE. + Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs. + (elf_i386_finish_dynamic_symbol): Use tls_type & GOT_TLS_IE to catch + all 4 GOT_TLS_* TLS types. + +2002-09-19 Nick Clifton + + * elflink.h (elf_fix_symbol_flags): When examining weak symbols, + follow indirect links. + +2002-09-19 Nathan Tallent + + * ecoffswap.h (ecoff_swap_pdr_in) : Update to + correctly sign-extend 32-bit ECOFF null values (0xffffffff, -1) + on 64 bit machines. + (ecoff_swap_sym_in) : Likewise. + * ecoff.c (_bfd_ecoff_slurp_symbolic_info): Fix error reading + ECOFF information: 'ioptMax' refers to the actual *size* + of the optimization symtab, not the number of entries. + +2002-09-19 Daniel Jacobowitz + + * elf32-arm.h (elf32_arm_adjust_dynamic_symbol): Update + ELF_LINK_HASH_NEEDS_PLT logic. + +2002-09-18 Daniel Jacobowitz + + * elfcode.h (elf_slurp_reloc_table_from_section): Check + correct relocation count. + +2002-09-17 Daniel Jacobowitz + + * bfd-in.h (bfd_get_dynamic_symcount): Define. + * bfd.c (struct _bfd): Add dynsymcount. + * bfd-in2.h: Regenerated. + * elf.c (_bfd_elf_canonicalize_dynamic_symtab): Set + abfd->dynsymcount. + * elfcode.h (elf_slurp_reloc_table_from_section): Check + for overflow. + +2002-09-17 Stan Cox + + * elf64-mips.c (mips_elf64_be_swap_reloca_out): Handle type2 and type3. + (mips_elf64_final_gp): Don't make up gp value. + * elfn32-mips.c (mips_elf_final_gp): Likewise. + * elfxx-mips.c (_bfd_mips_elf_final_link): Always create + .MIPS.options/.options section. + +2002-09-17 David O'Brien + + * elf32-i386-fbsd.c: Always label using the EI_OSABI method. + It is benign for FreeBSD < 4.1. Minor reformatting. + * elf64-alpha-fbsd.c: Likewise. + +2002-09-17 Jakub Jelinek + + * elf32-i386.c (elf_i386_relocate_section) [R_386_TLS_TPOFF32]: Negate + addend. + +2002-09-17 Alan Modra + + * elf64-alpha.c (alpha_elf_size_info): Make static. + +2002-09-17 Svein E. Seldal + + * coff-tic4x.c: Add function declarations and ATTRIBUTE_UNUSED. + * cpu-tic4x.c: Ditto. + +2002-09-17 Thiemo Seufer + + * elf64-mips.c (define elf_backend_ignore_discarded_relocs): Remove + duplicate define. + +2002-09-16 Bruno Haible + + * elf32-i386.c: Don't defined ELF_ARCH etc. if this file is included + by a target variant implementation. + * elf64-alpha.c: Likewise. + * elf32-i386-fbsd.c: New file. + * elf64-alpha-fbsd.c: New file. + * targets.c: Support bfd_elf32_i386_freebsd_vec and + bfd_elf64_alpha_freebsd_vec. + * configure.in: Accept the vectors bfd_elf32_i386_freebsd_vec, + bfd_elf64_alpha_freebsd_vec. + * Makefile.am (BFD32_BACKENDS): Add elf32-i386-fbsd.lo. + (BFD32_BACKENDS_CFILES): Add elf32-i386-fbsd.c. + (BFD64_BACKENDS): Add elf64-alpha-fbsd.lo. + (BFD64_BACKENDS_CFILES): Add elf64-alpha-fbsd.c. + (elf32-i386-fbsd.lo, elf64-alpha-fbsd.lo): Add dependencies. + * config.bfd: For FreeBSD targets, set targ_defvec to a FreeBSD + specific targets. Define OLD_FREEBSD_ABI_LABEL if appropriate. + +2002-09-12 Jakub Jelinek + + * elf32-i386.c (dtpoff_base, tpoff): Don't crash if tls_segment is + NULL. + (elf_i386_relocate_section): Return false after printing error about + unresolvable relocation. + +2002-09-12 Nick Clifton + + * elf32-arm.h (elf32_arm_final_link_relocate): Fix handling of + R_ARM_THM_PC11. + +2002-09-11 Jeffrey Law + + * elf32-h8300.c (elf32_h8_relax_section): Fix typo. + +2002-09-11 Andrew Haley + + * elf.c (_bfd_elf_find_nearest_line): Check functionname_ptr and + line_ptr before deciding we've found a symbol. + +2002-09-11 Nick Clifton + + * po/da.po: New Danish translation file. + * configure.in (LINGUAS): Add 'da'. + * configure: Regenerate. + +2002-09-10 Michael Snyder + + * irix-core.c (do_sections, do_sections64): New functions. + (irix_core_core_file_p): Call new functions do_sections, + do_sections64, depending on corefile (32-bit or 64-bit). + +2002-09-09 Richard Henderson + + * elfxx-ia64.c (elfNN_ia64_relax_section): Handle PCREL21M + and PCREL21F like PCREL21B. + +2002-09-04 Kevin Buettner + + * config.bfd (mips*-*-irix6*): Add new ABI vectors. Make n32 default + vector. + +2002-09-02 Nick Clifton + + * elf32-v850.c (v850_elf_final_link_relocate): Use helpful + names instead of cryptically overloaded bfd_reloc error + codes. + (v850_elf_relocate_section): Likewise. + (v850_elf_relax_section): Replace caching of external symbols + with caching of internal symbols obtained from calling + bfd_elf_get_elf_syms(). + Fixup problems with freeing cached allocated memory blocks. + +2002-09-02 Alan Modra + + * cpu-pj.c (scan_mach, compatible, arch_info_struct): Remove. + (bfd_pj_arch): Use bfd_default_scan. + * cpu-v850.c (scan): Remove. + (N): Use bfd_default_scan. + * cpu-z8k.c (scan_mach): Remove. + (arch_info_struct, bfd_z8k_arch): Reorganize so that the default is + first. Use bfd_default_scan. + + * ecoff.c (_bfd_ecoff_set_arch_mach_hook): Don't use hard-coded + bfd_mach constants. + (ecoff_get_magic): Likewise. + * elf32-v850.c (v850_elf_object_p): Likewise. + (v850_elf_final_write_processing): Likewise. + * mipsbsd.c (MY(set_arch_mach)): Likewise. + (MY(write_object_contents)): Likewise. + * coff64-rs6000.c (xcoff64_write_object_contents): Likewise. + * coffcode.h (coff_write_object_contents): Likewise. + (coff_set_arch_mach_hook): Add comment describing machine == 0. + Remove unnecessary "machine" assignments. + (coff_write_relocs): Test for the absolute section sym by testing + section and flags. + + * aoutx.h (NAME(aout,machine_type)): Recognize bfd_mach_i386_i386 + and bfd_mach_i386_i386_intel_syntax. + * pdp11.c (NAME(aout,machine_type)): Likewise. + +2002-08-30 John David Anglin + + * bfd-in.h (align_power): Cast constants to bfd_vma type. + * bfd-in2.h (align_power): Likewise. + +2002-08-30 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + + * cpu-avr.c (compatible): Don't use hard-coded mach constants. + * cpu-powerpc.c (powerpc_compatible): Likewise. + * cpu-rs6000.c (rs6000_compatible): Likewise. + +2002-08-28 Catherine Moore + + * elf32-v850.c (v850_elf_reloc_map): Add new relocs. + (v850-elf-reloc): Don't resolve pc relative relocs. + (v850_elf_ignore_reloc): New routine. + (v850_elf_final_link_relocate): Handle new relocs. + (v850_elf_relax_delete_bytes ): New routine. + (v850_elf_relax_section): New routine. + (bfd_elf32_bfd_relax_section): Define. + (HOWTO): New entries for new relocs. + * reloc.c (BFD_RELOC_V850_LONGCALL): New reloc. + (BFD_RELOC_V850_LONGJUMP): New reloc. + (BFD_RELOC_V850_ALIGN): New reloc. + * archures.c: Remove redundant v850ea architecture. + * cpu-v850.c: Remove redundant v850ea support. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerated. + +2002-08-28 Svein E. Seldal + + * config.bfd: Add tic4x-*-*coff* and c4x-*-*coff* target. + * configure.in: Add tic4x_coff vector files. + * configure: Regenerate. + * Makefile.am: Add tic4x target. + * Makefile.in: Regenerate. + +2002-08-27 Michael Hayes + + * archures.c: Add the BFD arch type tic4x. + * bfd-in.h: Add BFD_IN_MEMORY flag. + * coff-tic4x.c: New file. + * coffswap.h (coff_swap_sym_out): Add preadjuster. + * cpu-tic4x.c: New file. + * targets.c: Added tic4x- in list of xvecs. + * ticoff.h: New file. + * bfd-in2.h: Regenerate. + +2002-08-27 Adam Nemet + + * elf32-arm.h (elf32_arm_finish_dynamic_sections): Set the last + bit of DT_INIT and DT_FINI for Thumb functions. + +2002-08-26 Alan Modra + + * coffcode.h (coff_set_arch_mach_hook): Handle W65MAGIC. + +2002-08-26 Alan Modra + + * aoutx.h (NAME(aout,reloc_type_lookup)): Handle BFD_RELOC_8. + +2002-08-24 Kaz Kojima + + * elf32-sh.c (sh_elf_copy_indirect_symbol): New. + (create_got_section, allocate_dynrelocs, readonly_dynrelocs): + Likewise. + (struct elf_sh_pcrel_relocs_copied): Removed. + (struct elf_sh_dyn_relocs): New. + (struct elf_sh_link_hash_entry): Replace pcrel_relocs_copied + field with dyn_relocs. + (struct elf_sh_link_hash_table): Add short-cuts to get dynamic + sections and sym_sec. + (sh_elf_link_hash_newfunc): Clear dyn_relocs. + (sh_elf_link_hash_table_create): Clear shorts-cuts and sym_sec. + (sh_elf_create_dynamic_sections): Use create_got_section instead + of _bfd_elf_create_got_section. + (sh_elf_check_relocs): Likewise. + (sh_elf_create_dynamic_sections): Use short-cuts to the dynamic + sections. + (sh_elf_adjust_dynamic_symbol, sh_elf_size_dynamic_sections, + sh_elf_relocate_section, sh_elf_check_relocs, + sh_elf_finish_dynamic_symbol, sh_elf_finish_dynamic_sections): + Likewise. + (sh_elf_adjust_dynamic_symbol): Handle nocopyreloc. Keep the + dynamic relocations and avoiding the copy relocation when we + didn't find any dynamic relocations in the section which has + contents or is read-only. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New. + (sh_elf_size_dynamic_sections): Don't reset the size of + .rela.got section even if dynamic_sections_created flag is off. + Don't use sh_elf_discard_copies. Scan all input bfd and use + allocate_dynrelocs. Call readonly_dynrelocs to determine + whether we need DT_TEXTREL. + (sh_elf_adjust_dynamic_symbol): Use plt.refcount to determine + whether the symbol was never referred to. + (sh_elf_relocate_section): Use WILL_CALL_FINISH_DYNAMIC_SYMBOL. + (sh_elf_gc_sweep_hook): Fill with the real sweep function. + (sh_elf_check_relocs): Call create_got_section if the short-cut + to .got is null. Increment reference counters only instead of + allocating space on dynamic sections here. Don't conditionalize + uninitialized got.offset value when marking the symbol as a + global offset table entry. Keep relocations for symbols satisfied + by a dynamic library to avoid copy relocations for the symbol. + Set dynobj field of an elf hash table if needed. + (sh_elf_finish_dynamic_sections): Handle null section pointer + correctly. + (elf_backend_copy_indirect_symbol): Defined. + (elf_backend_can_refcount): Defined. + +2002-08-23 Nick Clifton + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Undo + previous change. Add comment explaining why. + +2002-08-23 Stephen Clarke + + * elf32-sh.c (elf_sh_plt0_entry_be, elf_sh_plt0_entry_le): Copy + contents of .got.plt[2] to tr0, not address of .got.plt. + (sh_elf_finish_dynamic_symbol): Do not apply GOT_BIAS when + patching absolute plt entry. For shmedia plt entry, set bottom bit + of branch to plt0 as this is a branch to an shmedia instruction. + * elf64-sh64.c (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le): + Copy contents of .got.plt[2] to tr0, not address of .got.plt. + (elf_sh64_plt_entry_be, elf_sh64_plt_entry_le): Use ptrel to + branch to plt0. + (sh64_elf64_finish_dynamic_symbol): Do not apply GOT_BIAS when + patching absolute plt entry. For shmedia plt entry, branch to + plt0 is now ptrel, so use relative offset. Set bottom bit of + branch target as it is a branch to an shmedia instruction. + +2002-08-23 Stephen Clarke , + Richard Shann + + * elf32-sh.c (sh_elf_finish_dynamic_sections): Set LSB of DT_INIT + value if .init is an SHmedia function. Similarly for DT_FINI. + * elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise. + +2002-08-23 Stephen Clarke + + * elf32-sh.c (sh_elf_size_dynamic_sections): Zero initialize + dynamic section. + * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. + +2002-08-22 Kaz Kojima + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use a simple + byte read when reading the return address register column. + +2002-08-22 Nick Clifton + + * config.bfd: Add powepc64-*-*bsd* target. + +2002-08-22 Graeme Peterson + + * Makefile.am: Add entries for elf32-shqnx.c + * Makefile.in: Regenerate. + * config.bfd: Add support sh-*-nto* target. + * configure.in: Add support for bfd_elf32_sh{l}qnx_vec. + * configure: Regenerate. + * elf32-qnx.h: Changed typo "elf_i386qnx_*" to "elf_qnx_*" . + * elf32-sh.c: Do not include elf32-target.h if + ELF32_SH_C_INCLUDED is defined. + * elf32-shqnx.c: New file: Support for QNX. + * targets.c: Add bfd_elf32_sh{l}qnx_vec. + +2002-08-22 Nick Clifton + + * po/tr.po: Updated Turkish translation. + + * syms.c (_bfd_generic_read_minisymbols): Set bfd_error if the + symbols are not read. + +2002-08-22 Alan Modra + + * elf32-m68hc11.c: Formatting fixes. + (elf32_m68hc11_gc_mark_hook): Correct params. Remove unnecessary test. + * elf32-m68hc12.c: Formatting fixes. + (elf32_m68hc11_gc_mark_hook): Correct params. Remove unnecessary test. + +2002-08-22 Alan Modra + + * coff-rs6000.c (rs6000coff_vec ): Add SEC_CODE and + SEC_DATA. + (pmac_xcoff_vec): Likewise. + * coff64-rs6000.c (rs6000coff64_vec): Likewise. + (aix5coff64_vec): Likewise. + +2002-08-22 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add struct elf_backend_data + param to elf_backend_copy_indirect_symbol. + (_bfd_elf_link_hash_copy_indirect): Likewise. + * elflink.h (elf_add_default_symbol, elf_fix_symbol_flags): Adjust + calls to copy_indirect_symbol. + * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise. + * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. + * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. + * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise. + * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise. + * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise. + * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise. + * elfxx-mips.h (_bfd_mips_elf_copy_indirect_symbol): Likewise. + * elf.c (_bfd_elf_link_hash_copy_indirect): Likewise. Properly + test refcounts for "used" values. + +2002-08-21 John David Anglin + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Add PARAMS to + argument declaration. + +2002-08-19 Elena Zannoni + + * archures.c (bfd_mach_ppc_e500): Added. + * bfd-in2.h: Rebuilt. + * cpu-powerpc.c (bfd_powerpc_archs): Added e500. + +2002-08-19 Alan Modra + + * elf32-m68hc12.c (elf_backend_can_gc_sections): False. + +2002-08-17 Andrew Cagney + + * elf.c (bfd_elf_get_elf_syms): Change type of `esym' to + `bfd_byte'. + +2002-08-17 Stan Cox + + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Use the + IRIX 6 segment layout for NEWABI. + +2002-08-16 Stephen Clarke + + * elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect + symbols when looking for section referred to by a relocation. + * elf64-sh.c (sh_elf64_gc_mark_hook): Likewise. + +2002-08-15 Alan Modra + + * elf32-i370.c: Move reloc enum to include/elf/i370.h. + +2002-08-15 Hans-Peter Nilsson + + * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Add + missing check for whether the symbol is referenced by DSO before + unexporting it as an unneeded dynamic symbol. + +2002-08-14 H.J. Lu + + * libbfd.h: Regenerate. + +2002-08-14 H.J. Lu + + * config.bfd: Always add 64bit vectors to 32bit Linux/mips. + +2002-08-14 Stephane Carrez + + * elf32-m68hc11.c (m68hc11_relax_group): New to relax group of + instructions. + (m68hc11_direct_relax): New to define table of relaxable instructions. + (find_relaxable_insn): New, find a relaxable insn. + (compare_reloc): New to compare two relocs. + (m68hc11_elf_relax_section): New, relax text sections. + (m68hc11_elf_relax_delete_bytes): New, delete bytes and adjust branchs. + (elf32_m68hc11_check_relocs): New function for GC support. + (elf32_m68hc11_relocate_section): New function for GC support. + (bfd_elf32_bfd_relax_section): Define to support linker relaxation. + (elf_backend_check_relocs): Likewise. + (elf_backend_relocate_section): Likewise. + +2002-08-13 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections): Don't count + definitions in shared objects when checking symbol with + undefined version. + +2002-08-13 Stephane Carrez + + * elf32-m68hc11.c (elf32_m68hc11_gc_mark_hook): New for section GC. + (elf32_m68hc11_gc_sweep_hook): Likewise. + (elf_backend_gc_mark_hook): Define for GC section support. + (elf_backend_gc_sweep_hook): Likewise. + (elf_backend_can_gc_sections): Likewise. + + * elf32-m68hc12.c: Likewise. + +2002-08-13 Stephane Carrez + + * elf32-m68hc11.c (_bfd_m68hc11_elf_print_private_bfd_data): New. + (_bfd_m68hc11_elf_merge_private_bfd_data): New function. + (_bfd_m68hc11_elf_set_private_flags): New function. + Use them to set/check/print ELF flags specific to 68HC11. + + * elf32-m68hc12.c (_bfd_m68hc12_elf_print_private_bfd_data): New. + (_bfd_m68hc12_elf_merge_private_bfd_data): New function. + (_bfd_m68hc12_elf_set_private_flags): New function. + Use them to set/check/print ELF flags specific to 68HC12. + +2002-08-13 Stephane Carrez + + * elf32-m68hc11.c (elf_m68hc11_howto_table): Add the new relocs; + fix masks for PC-rel relocs. + (m68hc11_elf_ignore_reloc): New function. + + * elf32-m68hc12.c (m68hc12_elf_special_reloc): New to handle specific + 68HC12 banked addressing relocs. + (m68hc12_phys_addr): New to compute physical address of banked memory. + (m68hc12_phys_page): Likewise for page. + (m68hc12_addr_is_banked): New to see if address is in banked area. + (elf_m68hc12_howto_table): Add new relocs and rename to xx12. + +2002-08-13 Stephane Carrez + + * reloc.c (BFD_RELOC_M68HC11_RL_JUMP, BFD_RELOC_M68HC11_RL_GROUP, + BFD_RELOC_M68HC11_LO16, BFD_RELOC_M68HC11_PAGE, + BFD_RELOC_M68HC11_24): New relocs for 68HC11/68HC12. + * bfd-in2.h: Regenerate. + +2002-08-12 H.J. Lu + + * elflink.h (elf_add_default_symbol): Preserve section across + elf_merge_symbol. + +2002-08-09 Graeme Peterson + + * Makefile.am: Add entries for elf32-ppcqnx.c, and add + elf32-qnx.h dependency to elfarmqnx-nabi.c and elf32-i386qnx.c. + * Makefile.in: Regenerate. + * config.bfd: Add support for powerpc{le}-*-nto targets. + * configure.in: Add support for bfd_elf32_powerpc{le}qnx_vec. + * configure: Regenerate. + * elf32-i386qnx.c: Moved backend functions into a QNX specific + common file "elf32-qnx.h", and now include that file. + * elf32-qnx.h: New file: QNX specific common elf backend. + * elf32-ppc.c: Do not include elf32-target.h if + ELF32_PPC_C_INCLUDED is defined. + * elf32-ppcqnx.c: New file: Support for QNX. + * elfarmqnx-nabi.c: Include elf32-qnx.h for qnx elf backend. + * targets.c: Add bfd_elf32_powerpc{le}qnx_vec. + +2002-08-09 Nick Clifton + + * po/sv.po: Updated Swedish translation. + +2002-08-09 Thiemo Seufer + + * elfxx-mips.c (mips_elf_global_got_index): Avoid segfault if + g->global_gotsym is NULL. + +2002-08-08 H.J. Lu + + * elflink.h (elf_add_default_symbol): Don't warn if a definition + overrides an indirect versioned symbol. + +2002-08-08 Jakub Jelinek + + * elf32-i386.c (elf_i386_relocate_section): Fill in proper addend + for R_386_TLS_TPOFF32 relocs against symndx 0. + +2002-08-07 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Check symbol + with undefined version if needed. + (elf_link_assign_sym_version): Match a default symbol with a + version without definition. No need to hide the default + definition separately. + +2002-08-08 Alan Modra + + * elflink.h (elf_link_output_extsym): Don't output symbols from + SEC_EXCLUDE sections. + + * aoutx.h (aout_link_write_symbols): Correct handling of warning syms. + +2002-08-07 Alan Modra + + * elf64-ppc.c (edit_opd): Arrange to drop symbols for discarded .opd + entries. + +2002-08-07 Thiemo Seufer + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Cast signedness + mismatch. + +2002-08-07 Thiemo Seufer + + * elfxx-mips.c (ABI_64_P): Remove superfluous check. + +2002-08-07 Thiemo Seufer + + * elf32-mips.c (mips_reloc_map): Fix typo. + +2002-08-06 Alan Modra + + * xcofflink.c (xcoff_write_global_symbol): Set n_scnum for abs_section. + +2002-08-06 Alan Modra + + * elf64-ppc.c (ppc64_elf_howto_raw): Zero all src_mask entries. + +2002-08-06 Alan Modra + + * libxcoff.h: Use PARAMS on function declarations. + * coff-rs6000.c (xcoff_generate_rtinit): Simplify size calc. + * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise. + + * coff-rs6000.c: (xcoff_rtype2howto): Don't place reloc address in + addend. + * coff64-rs6000.c: (xcoff64_rtype2howto): Likewise. + +2002-08-06 Alan Modra + + * coff-rs6000.c: Formatting fixes. + (xcoff_calculate_relocation): Use PARAMS in declaration. + (xcoff_complain_overflow): Likewise. + (xcoff_ppc_relocate_section): Use old-style function pointer call. + (bfd_xcoff_backend_data): Remove useless comments. + (rs6000coff_vec): Likewise. + (bfd_pmac_xcoff_backend_data): Likewise. + (pmac_xcoff_vec): Likewise. + + * coff64-rs6000.c: Formatting fixes. + (xcoff64_calculate_relocation): Use PARAMS in declaration. + (xcoff64_ppc_relocate_section): Use old-style function pointer call. + (bfd_xcoff_backend_data): Remove useless comments. + (rs6000coff64_vec): Likewise. + (bfd_xcoff_aix5_backend_data): Likewise. + (aix5coff64_vec): Likewise. + +2002-08-06 Alan Modra + + * coff-rs6000.c (xcoff_howto_table): Revert some of last change to + mask entries. Use complain_overflow_dont for R_REF. + (xcoff_reloc_type_ba): Revert last change. + (xcoff_reloc_type_br): Likewise. + (xcoff_reloc_type_crel): Likewise. + (xcoff_ppc_relocate_section): Likewise. + * coff64-rs6000.c (xcoff64_reloc_type_br): Likewise. + (xcoff64_ppc_relocate_section): Likewise. + (xcoff64_howto_table): Revert some of last change to mask entries. + Use complain_overflow_dont for R_REF. + + * coff-rs6000.c (xcoff_howto_table): Fix src_mask entries. Make all + relocs with bitsize == 16 have size = 1. + (xcoff_reloc_type_ba): Correct src_mask and dst_mask adjustment. + (xcoff_reloc_type_br): Likewise. + (xcoff_reloc_type_crel): Likewise. + (xcoff_ppc_relocate_section): Set up src_mask and dst_mask correctly. + * coff64-rs6000.c (xcoff64_reloc_type_br): Correct src_mask and + dst_mask adjustment. + (xcoff64_ppc_relocate_section): Set up src_mask and dst_mask correctly. + (xcoff64_howto_table): Fix src_mask entries. Make all relocs with + bitsize == 16 have size = 1. + +2002-08-01 Denis Chertykov + + * elf32-ip2k.c: Processor manufacturer changed to Ubicom. + (struct misc): New field isymbuf. All free_* fields removed. + (symbol_value): Pass in internal syms. No need to swap syms in. + (ip2k_elf_relax_section): Use bfd_elf_get_elf_syms. Properly free + possibly cached info. + (tidyup_after_error): Removed. + (ip2k_elf_relax_section_pass1): Don't use removed fields of struct + misc. Use new field. + (adjust_all_relocations): Use internal syms. No need to swap syms + in and out. + (add_page_insn): Don't use removed fields of struct misc. + +2002-08-01 Nick Clifton + + * elf32-arm.h: Revert previous delta. + +2002-08-01 Nick Clifton + + * configure.in (AM_INIT_AUTOMAKE): Bump version number. + * configure: Regenerate. + +2002-07-31 H.J. Lu + + * config.bfd: Add x86-64 vector to Linux/i386 if 64bit BFD is + selected. + +2002-07-31 H.J. Lu + + * config.bfd: Add n32 vectors to 32bit Linux/mips if 64bit BFD + is selected. + +2002-07-31 Jakub Jelinek + + * elf32-i386.c (elf_i386_copy_indirect_symbol): Swap tls_type + if _bfd_elf_link_hash_copy_indirect will swap got.refcount. + +2002-07-31 Ian Dall + + * cpu-ns32k.c (_bfd_ns32k_put_immdeiate, _bfd_ns32k_get_immediate): + There is no 8 byte relocation type for this architecture. + (do_ns32k_reloc): Use bfd_vma instead of native types. + (bfd_ns32k_put_immediate, _bfd_ns32k_relocate_contents) put_data + returns void. + (_bfd_ns32k_put_displacement): Don't check for overflow. We can + rely on generic code to do that. + * aout-ns32k.c (howto_table): Add appropriate overflow detection + to all table entries. + (_bfd_ns32k_relocate_contents): put_data returns void. + * ns32k.h: (_bfd_ns32k_put_displacement, _bfd_ns32k_put_immediate) + (_bfd_do_ns32k_reloc_contents): Fix prototypes. put data functions + return void. + +2002-07-31 Ian Dall + + * aoutx.h (aout_link_check_ar_symbols): Whether to include an + archive object is target dependant. + +2002-07-31 Adam Nemet + + * elf32-arm.h (ARM_PLT_ENTRY_SIZE): Rename PLT_ENTRY_SIZE. + (THUMB_PLT_ENTRY_SIZE): New macro. + (PLT_ENTRY_SIZE): Return the appropriate *_PLT_ENTRY_SIZE. + (elf32_arm_plt0_entry): Rename PLT_ENTRY_SIZE to + ARM_PLT_ENTRY_SIZE. + (elf32_arm_plt_entry): Likewise. + (elf_backend_plt_header_size): Likewise. + (elf32_thumb_plt0_entry): New global. + (elf32_arm_finish_dynamic_sections): Use it. Put Thumb entries + into .plt.thumb. + (elf32_thumb_plt_entry): New global. + (elf32_arm_finish_dynamic_symbol): Use it. Use .thumb.plt for + Thumb entries. Set the bottom bit of the corresponding GOT entry + for a Thumb PLT entry. + (struct elf32_arm_plt_entry_info): New structure. + (struct elf32_arm_link_hash_entry, plt_info): New member of this + type. + (elf32_arm_link_hash_newfunc): Initialize new member. + (elf32_arm_final_link_relocate, R_ARM_THM_PC22 case): Handle + relocations against the PLT. + (elf32_arm_check_relocs, case R_ARM_PLT32 case): Set + first_rel_type if this is the first time we encounter the symbol. + (elf32_arm_check_relocs, case R_ARM_THM_PC22 case): New case. + Determine if relocation needs a PLT entry. Set first_rel_type if + this is the first time we encounter the symbol + (elf32_arm_adjust_dynamic_symbol): Create PLT entries for Thumb + functions as well. + (elf32_arm_size_dynamic_sections): Handle .plt.thumb like .plt. + (elf32_arm_create_dynamic_sections): New function. Create the + .plt.thumb section. + (elf_backend_create_dynamic_sections): Call it. + +2002-07-31 Nick Clifton + + * bfd.c (bfd_alt_mach_code): Rename parameter 'index' to + 'alternative' in order to avoid shadowing global symbol of the + same name. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2002-07-31 Thiemo Seufer + + * Makefile.am: Add n32 ABI support. + * Makefile.in: Regenerate. + * config.bfd: Add n32 vectors to mips64*-*-linux* targets. Treat 64 + bit vectors for mips*-*-linux targets as optional. + * configure.in: Add n32 ABI vectors. + * configure: Regenerate. + * elf32-mips.c (mips_elf32_object_p): Reject n32 ABI files. + * elfn32-mips.c: New file, n32 ABI support. + * targets.c: Add n32 ABI vectors. + +2002-07-30 Graeme Peterson + + * elfarmqnx-nabi.c: New file: Support for QNX. + * config.bfd: Add support for arm-*-nto target. + * configure.in: Add support for bfd_elf32_{big|little}armqnx_vec. + * configure: Regenerate. + * Makefile.am: Add entries for elfarmqnx-nabi.c. + * Makefile.in: Regenerate. + * elf32-arm.h (ELF_MAXPAGESIZE): Do not define if already defined. + Do not define global function if ELFARM_NABI_C_INCLUDED is defined. + * elfarm-nabi.c: Do not include elf32-arm.h if + ELFARM_NABI_C_INCLUDED is defined. + * targets.c: Add bfd_elf32_{big|little}armqnx_vec. + +2002-07-30 Nick Clifton + + * po/sv.po: Updated Swedish translation. + +2002-07-30 Jakub Jelinek + + * elf.c (elf_fake_sections): Fix up .tbss sh_size and sh_type. + +2002-07-30 Alan Modra + + * aoutx.h (some_aout_object_p): Clean up tdata properly on error. + * archive.c (bfd_generic_archive_p): Likewise. + * coff-rs6000.c (_bfd_xcoff_archive_p): Likewise. + (_bfd_xcoff_archive_p): Use bfd_scan_vma in place of strtol. + * coff64-rs6000.c (xcoff64_slurp_armap): Likewise. + (xcoff64_archive_p): Likewise. + (xcoff64_openr_next_archived_file): Likewise. + (xcoff64_archive_p): Clean up tdata properly on error. + * coffgen.c (coff_real_object_p): Likewise. + (coff_object_p): Release filehdr and opthdr. + * ecoff.c (_bfd_ecoff_archive_p): Clean up tdata properly on error. + * ieee.c (ieee_archive_p): Likewise. + * ihex.c (ihex_object_p): Likewise. + (ihex_mkobject): Always allocate tdata. + * peicode.h (pe_ILF_object_p): Release bfd_alloc'd buffer on error. + * srec.c (srec_mkobject): Always allocate tdata. + (srec_object_p): Clean up tdata properly on error. + (symbolsrec_object_p): Likewise. + * versados.c (versados_object_p): Likewise. + * vms-misc.c (_bfd_vms_get_record): Use bfd_malloc instead of malloc, + and bfd_realloc instead of realloc. + (add_new_contents): Use bfd_alloc instead of bfd_malloc for sections. + * vms.c (vms_initialize): Always allocate tdata. Use bfd_alloc in + place of bfd_malloc, simplifying error freeing. Free hash table too. + (vms_object_p): Clean up tdata on error. + (vms_mkobject): Don't complain on stderr if vms_initialize fails. + (vms_close_and_cleanup): Adjust for bfd_alloc use. + +2002-07-30 Alan Modra + + * elfxx-ia64.c (elfNN_ia64_final_write_processing): Set e_flags. + +2002-07-26 Chris Demetriou + + * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Merge ASE + flags into resulting BFD. + +2002-07-26 Alan Modra + + From John Reiser + * elf32-i386.c (elf_i386_link_hash_table_create): Clear + tls_ldm_got.refcount. + +2002-07-25 Thiemo Seufer + + * elf64-mips.c: Update TODO comment. + (mips_elf64_higher_reloc,mips_elf64_highest_reloc, + mips_elf64_gprel16_reloca): Remove prototypes. + (mips16_jump_reloc,mips16_gprel_reloc): Add functions. + (UNUSED_RELOC): Replace by EMPTY_RELOC. + (mips_elf64_howto_table_rel): Use special R_MIPS_HI16 handling. Remove + wrong comments. Remove disfunctional support of R_MIPS_HIGHER and + R_MIPS_HIGHEST. + (mips_elf64_howto_table_rela): Fix handling of R_MIPS_GPREL16 and + R_MIPS_GOT16. Remove wrong comments. + (elf_mips16_jump_howto,elf_mips16_gprel_howto, + elf_mips_gnu_vtinherit_howto,elf_mips_gnu_vtentry_howto): New, code + from elf32-mips.c. + (mips_elf64_hi16_reloc): Fix formatting. + (mips_elf64_higher_reloc,mips_elf64_highest_reloc): Remove. + (mips_elf64_got16_reloc): Fix formatting. Remove superfluous code. + Better comment. Fall back to R_MIPS_GOT_DISP instead of abort(). + (mips_elf64_gprel16_reloc): Make static. Add check for + partial_inplace. + (mips_elf64_gprel16_reloca): Remove. + (mips_elf64_literal_reloc): New function. + (mips_elf64_gprel32_reloc): Fix formatting. + (mips_elf64_shift6_reloc): Fix comment. Make static. + (mips16_jump_reloc,mips16_gprel_reloc): New functions, code from + elf32-mips.c. + (elf_reloc_map,mips_reloc_map): New mapping table, similiar as in + elf32-mips.c + (bfd_elf64_bfd_reloc_type_lookup): Use the mapping table. Enable GNU + specific relocations. + (mips_elf64_rtype_to_howto): Enable GNU specific relocations. + (mips_elf64_object_p): Invert logic to check for SGI-ish ABI. + (ELF_MAXPAGESIZE): Add comment. + +2002-07-25 Nick Clifton + + * po/sv.po: Updated Swedish translation. + * po/es.po: Updated Spanish translation. + * po/fr.po: Updated French translation. + +2002-07-25 Alan Modra + + * elf-bfd.h (_bfd_elf32_link_record_local_dynamic_symbol): Define + as elf_link_record_local_dynamic_symbol. + (_bfd_elf64_link_record_local_dynamic_symbol): Likewise. + (elf_link_record_local_dynamic_symbol): Declare. Now returns int. + * elflink.h (elf_link_record_local_dynamic_symbol): Move to.. + * elflink.c: .. here. Use bfd_elf_get_elf_syms. Check whether an + attempt is made to record a symbol in a discarded section, and + return `2' in that case. + +2002-07-24 Nick Clifton + + * po/sv.po: Updated Swedish translation. + * po/es.po: Updated Spanish translation. + +2002-07-23 Alan Modra + + * po/SRC-POTFILES.in: Regenerate. + + * elf-hppa.h (elf_hppa_relocate_section): If relocatable, return + immediately. Remove code handling relocatable linking. + * elf32-avr.c (elf32_avr_relocate_section): Likewise. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-fr30.c (elf32_frv_relocate_section): Likewise. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-h8300.c (elf32_h8_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section): Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf32-avr.c (elf_backend_rela_normal): Define. + * elf32-cris.c: Likewise. + * elf32-fr30.c: Likewise. + * elf32-frv.c: Likewise. + * elf32-h8300.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-ip2k.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-v850.c: Likewise. + * elf32-vax.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-sparc.c: Likewise. + * elf32-fr30.c (elf32_frv_relocate_section): Edit comment. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-i860.c (elf32_i860_relocate_section): Likewise. + * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. + * elf-m10200.c (USE_RELA): Don't define. + * elf-m10300.c: Likewise. + * elfarm-oabi.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-ip2k.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-vax.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfxx-ia64.c: Likewise. + * elf32-avr.c (USE_REL): Don't undef. + * elf32-ip2k.c: Likewise. + +2002-07-23 Nick Clifton + + * elf-bfd.h (struct elf_backend_data): Add new bitfield + 'want_p_paddr_set_to_zero'. + * elfxx-target.h: Set default value for want_p_paddr_set_to_zero + to false; + * elfxx-ia64.c: Set want_p_paddr_set_zero for HPUX target. + * elf.c (copy_private_bfd_data): Test want_p_paddr_set_zero. + +2002-07-23 Gabor Keresztfalvi + + * nlmcode.h (nlm_swap_auxiliary_headers_out): Swapped the order of + the MeSsAgEs and CoPyRiGhT tags to make >=NW4.x NLM loaders to + show the Copyright string. + Minor formatting tidy ups. + +2002-07-23 Nick Clifton + + * po/fr.po: Updated French translation. + * po/sv.po: Updated Swedish translation. + +2002-07-23 Alan Modra + + * elflink.h (elf_link_input_bfd): Don't change internal symbols + when outputting relocs. + +2002-07-20 Jason Thorpe + + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only insert + DT_PLTGOT into the dynamic section if there is a PLT. + +2002-07-19 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_discard_info): New function, code from + elf32-mips.c. + (_bfd_mips_elf_write_section): Likewise. + * elfxx-mips.h (_bfd_mips_elf_discard_info): New prototype. + (_bfd_mips_elf_write_section): Likewise. + * elf32-mips.c (elf32_mips_discard_info): Move to elfxx-mips.c. + (elf32_mips_write_section): Likewise. + * elf64-mips.c (_bfd_mips_elf_ignore_discarded_relocs): Use it. + (_bfd_mips_elf_write_section): Likewise. + +2002-07-19 Alan Modra + + * elfxx-ia64.c: (elfNN_ia64_modify_segment_map): Properly scan + PT_IA_64_UNWIND segments for a given section. + +2002-07-17 H.J. Lu + + * Makefile.am: Fix a typo. + * Makefile.in: Regenerate. + +2002-07-15 Denis Chertykov + Frank Ch. Eigler + Ben Elliston + Alan Lehotsky + John Healy + Graham Stott + Jeff Johnston + + * Makefile.am: Add support for ip2k. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + * archures.c: Add support for ip2k. + * config.bfd: Add support for ip2k. + * configure.in: Add support for ip2k. + * configure: Regenerate. + * reloc.c: Add support for ip2k. + * targets.c: Add support for ip2k. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * cpu-ip2k.c: New file. + * elf32-ip2k.c: New file. + +2002-07-17 Ian Rickards + + * dwarf2.c (concat_filename): If we can't establish the directory + just return the filename. + +2002-07-16 Moritz Jodeit + + * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Correct order of memset args. + +2002-07-16 Alan Modra + + * elflink.h: Formatting fixes, tidy prototypes. + (elf_link_assign_sym_version): Move common code out of loop. + +2002-07-16 Alan Modra + + * elflink.h (elf_link_input_bfd): Don't call reloc_emitter when + reloc section size is zero. Correct reloc output location. + +2002-07-16 John David Anglin + + * elf-hppa.h (elf_hppa_reloc_final_type): Use R_PARISC_PCREL16F as + the final type for the e_fsel selector when generating PA2.0W code. + (elf_hppa_relocate_insn): Provide support for PA2.0W 16-bit format 1 + relocations. + +2002-07-14 H.J. Lu + + * elflink.h (elf_link_assign_sym_version): Hide the default + definition if there is a hidden versioned definition. + +2002-07-12 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section): Drop nonsensical + dynamic reference test in assertion when initializing GOT with + static contents. Just assert that there are either no dynamic + sections, the symbol is defined in the regular objects or that the + symbol is undef weak. Tweak comment. + (elf_cris_finish_dynamic_symbol): Emit .got reloc for a program + only if the symbol isn't defined in the program and isn't undef + weak. + (elf_cris_adjust_dynamic_symbol): Simplify condition for getting + rid of PLT entry: only do it if the symbol isn't defined in a DSO. + When doing so, clear ELF_LINK_HASH_NEEDS_PLT. Tweak comments. + (elf_cris_discard_excess_program_dynamics): Don't consider + ELF_LINK_HASH_REF_DYNAMIC when omitting .got runtime relocs. + +2002-07-11 Alan Modra + + * elf32-i386.c (elf_i386_relocate_section): Don't complain about + unresolved debugging relocs in dynamic applications. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + +2002-07-10 Alan Modra + + * elf64-ppc.c (ONES): Define. + (ppc64_elf_howto_table): Use ONES here to avoid warnings. Fill in + missing src_mask fields. Tweak R_PPC64_NONE, R_PPC64_COPY. Fill + in missing dst_mask fields on R_PPC64_PLT32, R_PPC64_PLTREL32. + + * elf64-ppc.c (ppc64_elf_get_symbol_info): Delete. + (ppc64_elf_set_private_flags): Delete. + (ppc64_elf_section_from_shdr): Delete. + (ppc64_elf_merge_private_bfd_data): Remove flag checking/merging code. + (ppc64_elf_fake_sections): Delete. + (bfd_elf64_bfd_set_private_flags): Don't define. + (bfd_elf64_get_symbol_info): Likewise. + (elf_backend_section_from_shdr): Likewise. + (elf_backend_fake_sections): Likewise. + +2002-07-10 Marco Walther + + * elf.c: (assign_section_numbers) Set sh_entsize for .stab only + when not already set. + * elf64-sparc.c: (sparc64_elf_fake_sections): New function. + (elf_backend_fake_sections): Define. + +2002-07-10 Alan Modra + + * merge.c (_bfd_merge_section): Remove redundant output_section check. + Formatting. + (_bfd_merge_sections): Don't set SEC_EXCLUDE on unused sections. + +2002-07-09 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section): Move sanity-check for + NULL sym_hashes to just before use. + : In test for local symbol, accept also + symbol with non-default visibility. + : Ditto. + : + Ditto. + (cris_elf_gc_sweep_hook): Only decrease h->plt.refcount for + symbol with non-default visibility. + (cris_elf_check_relocs): At tests for local symbol before + increasing h->plt.refcount, also check for non-default + visibility. Ditto when checking for local symbol to eliminate + pc-relative runtime relocs. + +2002-07-08 Alan Modra + + * elf.c: Formatting. + (IS_SOLARIS_PT_INTERP): Add p_paddr and p_memsz checks. + (INCLUDE_SECTION_IN_SEGMENT): Remove IS_SOLARIS_PT_INTERP. + (copy_private_bfd_data): Set p_vaddr on broken Solaris PT_INTERP + segments. + +2002-07-07 Mark Mitchell + Alan Modra + + * cofflink.c (_bfd_coff_final_link): On PE COFF systems, take into + account the impact of relocation count overflow when computing + section offsets. + * coffcode.h (coff_write_relocs): Use obj_pe when deciding whether + or not to apply the PE COFF reloc overflow handling. Fix a + fencepost error in deciding whether or not to use that technique. + +2002-07-07 Alan Modra + + * elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx, + change type of locsyms. + (bfd_elf_get_elf_syms): Declare. + * elf.c (bfd_elf_get_elf_syms): New function. + (group_signature): Use bfd_elf_get_elf_syms. + (bfd_section_from_r_symndx): Likewise. + * elfcode.h (elf_slurp_symbol_table): Likewise. + * elflink.h (elf_link_is_defined_archive_symbol): Likewise. + (elf_link_add_object_symbols): Likewise. Reorganise to increase + locality of various data structures. Properly free internal relocs. + (elf_bfd_final_link): Properly free internal relocs. + (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms. + (elf_link_input_bfd): Likewise. + (elf_gc_mark): Likewise. Properly free internal relocs. + (elf_gc_sweep): Properly free internal relocs. + (elf_reloc_symbol_deleted_p): No need to swap syms in. + (elf_bfd_discard_info): Use bfd_elf_get_elf_syms. Properly free + internal relocs. + * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms. + Properly free possibly cached info. + (mn10200_elf_relax_delete_bytes): Remove symbol swapping code. + (mn10200_elf_symbol_address_p): Pass in internal syms. Remove + symbol swapping code. + (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms. + Properly free possibly cached info. + * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c. + (mn10300_elf_relax_delete_bytes): Likewise. + (mn10300_elf_symbol_address_p): Likewise. + (mn10300_elf_get_relocated_section_contents): Likewise. + * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c. + (elf32_h8_relax_delete_bytes): Likewise. + (elf32_h8_symbol_address_p): Likewise. + (elf32_h8_get_relocated_section_contents): Likewise. + * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c. + (m32r_elf_relax_delete_bytes): Likewise. + (m32r_elf_get_relocated_section_contents): Likewise. + * elf32-sh.c (sh_elf_reloc_loop): Free section contents using + elf_section_data to determine whether cached. + (sh_elf_relax_section): As above for elf-m10200.c. + (sh_elf_relax_delete_bytes): Likewise. + (sh_elf_get_relocated_section_contents): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relax_section): As above. + * elf64-alpha.c (elf64_alpha_relax_section): As above. Also delay + reading of local syms. + * elf64-mmix.c (mmix_elf_relax_section): Likewise. + * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above. + * elfxx-ia64.c (elfNN_ia64_relax_section): As above. + * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal + relocs. + * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly + free internal relocs and section contents. Don't read symbols. + * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms. + (elf32_hppa_size_stubs): Don't free local syms. + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay + reading of local syms. Use bfd_elf_get_elf_syms. Properly free + possibly cached info. + * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. + * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms. + * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and + all_local_syms. + (get_local_syms): Delete function. + (edit_opd): Use bfd_elf_get_elf_syms. Free on error exit. Cache + on exit. + (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms. Free/cache on exit. + +2002-07-05 Jim Wilson + + * syms.c (decode_section_type): New. + (bfd_decode_symclass): Call decode_section_type. + +2002-07-04 Jakub Jelinek + + * merge.c (_bfd_merged_section_offset): Avoid accessing byte before + section content start. + Reported by Michael Schumacher . + +2002-07-04 Alan Modra + + * section.c (_bfd_strip_section_from_output): Remove unnecessary + link order code. Don't actually remove the output section here; + Just set a flag for the linker to do so. + * elflink.c (_bfd_elf_link_renumber_dynsyms): Test for removed + sections when setting up output section dynsyms. + +2002-07-04 Alan Modra + + * elflink.h (elf_link_add_object_symbols): Revert 1999-09-02 hpux + fudge. + * elf.c (bfd_section_from_shdr): Work around broken hpux shared + libs here instead. + +2002-07-02 Martin Schwidefsky + + * elf64-s390.c (create_got_section): Set .got section alignment to + 8 bytes. + (elf_s390_check_relocs): Set .rela.dyn section alignment to 8 bytes. + +2002-07-02 Alan Modra + + * elf.c (_bfd_elf_reloc_type_class): Fix comment grammar. + +2002-07-01 Matt Thomas + + * elf32-vax.c (elf32_vax_print_private_bfd_data): Change EF_* + to EF_VAX_*. + +2002-07-01 Thiemo Seufer + + * elfxx-mips.c (ABI_64_P): Fix comment. + (MIPS_ELF_OPTIONS_SECTION_NAME,MIPS_ELF_STUB_SECTION_NAME): Use the + new section names for N64 ABI. + (mips_elf_output_extsym): No special _gp_disp handling for NewABI. + (mips_elf_calculate_relocation): Code formatting. + (mips_elf_create_dynamic_relocation): Likewise. + (_bfd_mips_elf_fake_sections): IRIX6 needs this hack, too. + (_bfd_mips_elf_size_dynamic_sections): Handle GOT_PAGE for any NewABI. + (_bfd_mips_elf_relocate_section): No special handling for R_MIPS_64 + in any NewABI. + (_bfd_mips_elf_finish_dynamic_symbol): No special _gp_disp handling + for NewABI. + (_bfd_mips_elf_modify_segment_map): Handle any N64 ABI. + (_bfd_mips_elf_gc_sweep_hook): NewABI GOT relocs should be handled + here, too. + +2002-07-01 Andreas Schwab + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Only convert + R_X86_64_64 to R_X86_64_RELATIVE. + +2002-07-01 John David Anglin + + * vaxbsd.c: New BFD backend for VAX BSD and Ultrix. + * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Add new backend. + Run "make dep-am". + * config.bfd (vax-*-bsd* | vax-*-ultrix*): Use vaxbsd_vec instead of + host_aout_vec. + * configure.in (vaxbsd_vec): Add. + * targets.c (vaxbsd_vec): Add. + * Makefile.in: Rebuild. + * configure: Rebuild. + * po/SRC-POTFILES.in: Rebuild. + +2002-07-01 Alan Modra + + * elflink.h (elf_gc_mark): Pass in the section whose relocs we are + examining to gc_mark_hook, rather than the bfd. + (elf_gc_sections): Adjust. + * elf-bfd.h (struct elf_backend_data ): Likewise. + * elf-m10300.c (mn10300_elf_gc_mark_hook): Likewise. + * elf32-arm.h (elf32_arm_gc_mark_hook): Likewise. + * elf32-avr.c (elf32_avr_gc_mark_hook): Likewise. + * elf32-cris.c (cris_elf_gc_mark_hook): Likewise. + * elf32-d10v.c (elf32_d10v_gc_mark_hook): Likewise. + * elf32-fr30.c (fr30_elf_gc_mark_hook): Likewise. + * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise. + * elf32-i386.c (elf_i386_gc_mark_hook): Likewise. + * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise. + * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise. + * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise. + * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Likewise. + * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise. + * elf32-s390.c (elf_s390_gc_mark_hook): Likewise. + * elf32-sh.c (sh_elf_gc_mark_hook): Likewise. + * elf32-sparc.c (elf32_sparc_gc_mark_hook): Likewise. + * elf32-v850.c (v850_elf_gc_mark_hook): Likewise. + * elf32-vax.c (elf_vax_gc_mark_hook): Likewise. + * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Likewise. + * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise. + * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise. + * elf64-s390.c (elf_s390_gc_mark_hook): Likewise. + * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise. + * elfxx-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise. + * elfxx-mips.h (_bfd_mips_elf_gc_mark_hook): Likewise. + * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise. + * elf32-frv.c (elf32_frv_gc_mark_hook): Likewise. Also remove + redundant local sym tests. + * elf64-ppc.c (struct ppc_link_hash_entry): Add is_entry. + (link_hash_newfunc): Init is_entry. + (ppc64_elf_copy_indirect_symbol): Copy is_entry. + (ppc64_elf_link_hash_table_create): Init all_local_syms. + (create_linkage_sections): Use bfd_make_section_anyway rather than + bfd_make_section. + (ppc64_elf_mark_entry_syms): New function. + (ppc64_elf_check_relocs): Don't bother testing elf_bad_symtab. Set + up opd entry to function section map. + (ppc64_elf_gc_mark_hook): Special case opd section relocs, and + relocs that reference the opd section. + (edit_opd): New function. + (ppc64_elf_size_dynamic_sections): Call get_local_syms and edit_opd. + (ppc64_elf_setup_section_lists): Don't calculate htab->bfd_count here. + (get_local_syms): Do so here. Exit if we already have local syms. + Remove bogus comment imported from elf32-hppa.c. Don't attempt to + read local syms on non-ELF input. + (ppc64_elf_size_stubs): Call _bfd_elf64_link_read_relocs rather + than duplicating it's function here. Adjust free of internal + relocs to suit. + (ppc64_elf_relocate_section): Adjust local syms in opd section. + * elf64-ppc.h (ppc64_elf_mark_entry_syms): Declare. + * elf32-hppa.c (elf32_hppa_size_stubs): Call + _bfd_elf32_link_read_relocs rather than duplicating it's function + here. Adjust free of internal relocs to suit. + +2002-07-01 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_check_relocs): Certain relocations + are not allowed in shared libs code, enforce -fPIC. + +2002-06-29 Hans-Peter Nilsson + + * mmo.c (mmo_write_loc_chunk): Don't eliminate leading and + trailing zero-sequences when there's previous left-over data. + +2002-06-27 John David Anglin + + * elf64-hppa.c (elf64_hppa_reloc_type_class): New function. + (elf64_hppa_finish_dynamic_sections): Check other_rel_sec, dlt_rel_sec + and opd_rel_sec in order for starting rela section. Check _raw_size. + (elf_backend_reloc_type_class): Define. + +2002-06-27 Kevin Buettner + + * dwarf2.c (decode_line_info): Handle older, non-standard, 64-bit + DWARF2 formats. + +2002-06-27 Alan Modra + + * cpu-powerpc.c: Comment on ordering of arch_info. + * elf32-ppc.c (ppc_elf_object_p): New function. + (elf_backend_object_p): Define. + * elf64-ppc.c (ppc64_elf_object_p): New function. + (elf_backend_object_p): Define. + +2002-06-26 Jason Thorpe + + * configure.in (vax-*-netbsd*): Set COREFILE to netbsd-core.lo. + * configure: Regenerate. + +2002-06-25 Jason Eckhardt + + * dwarf2.c (decode_line_info): Check unit->addr_size + to read in the proper number of prologue bytes. + +2002-06-25 Nick Clifton + + * config.bfd (powerpc-*-aix5*): Only create a selvecs for + aix5coff64_vec if 64-bit bfd support has been enabled. + (powerpc64-*-aix5*): Only define if 64-bit bfd support has + been enabled. + + * targets.c (_bfd_target_vector[]): Only include + aix5coff64_vec if 64-bit bfd support has been enabled. + +2002-06-25 Alan Modra + + * elf64-ppc.c (ppc_add_stub): Replace strcpy/strncpy with memcpy. + * elf32-hppa.c (hppa_add_stub): Likewise. + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise. + * elflink.h (elf_add_default_symbol): Fix comment typo. + (elf_add_default_symbol): Replace strcpy and strncpy with memcpy. + (elf_link_add_object_symbols): Likewise. + (elf_link_assign_sym_version): Likewise. + * hash.c (bfd_hash_lookup): Likewise. + * linker.c (_bfd_generic_link_add_one_symbol): Likewise. + * section.c (bfd_get_unique_section_name): Likewise. + * syms.c (_bfd_stab_section_find_nearest_line): Likewise. + * elf.c (_bfd_elf_make_section_from_phdr): Likewise. + (assign_section_numbers): Likewise. + (_bfd_elfcore_make_pseudosection): Likewise. + (elfcore_grok_lwpstatus): Likewise. + (elfcore_grok_win32pstatus): Likewise. + (elfcore_write_note): Constify input params. Use PTR instead of + void *. Include terminating NUL in namesz. Correct padding. + Support NULL "name" param. Use memcpy instead of strcpy. + (elfcore_write_prpsinfo): Constify input params. + (elfcore_write_prstatus): Likewise. Use PTR instead of void *. + (elfcore_write_lwpstatus): Likewise. + (elfcore_write_pstatus): Likewise. + (elfcore_write_prfpreg): Likewise. + (elfcore_write_prxfpreg): Likewise. + * elf-bfd.h (elfcore_write_note): Update declaration. + (elfcore_write_prpsinfo): Likewise. + (elfcore_write_prstatus): Likewise. + (elfcore_write_pstatus): Likewise. + (elfcore_write_prfpreg): Likewise. + (elfcore_write_prxfpreg): Likewise. + (elfcore_write_lwpstatus): Likewise. + +2002-06-25 Jason Eckhardt + + * ecoff.c (ecoff_set_symbol_info): Set BSF_FUNCTION for + symbols of type stProc and stStaticProc. + +2002-06-25 Nick Clifton + + * ecoff.c: VArious formatting fixes. + +2002-06-25 Alan Modra + + * coff-rs6000.c (xcoff_generate_rtinit): Fix typo. + +2002-06-25 Alan Modra + + * aout-adobe.c: Don't compare against "true" or "false. + * aout-target.h: Likewise. + * aoutx.h: Likewise. + * archive.c: Likewise. + * bout.c: Likewise. + * cache.c: Likewise. + * coff-a29k.c: Likewise. + * coff-alpha.c: Likewise. + * coff-i386.c: Likewise. + * coff-mips.c: Likewise. + * coff-or32.c: Likewise. + * coff64-rs6000.c: Likewise. + * coffcode.h: Likewise. + * coffgen.c: Likewise. + * cpu-ns32k.c: Likewise. + * ecoff.c: Likewise. + * ecofflink.c: Likewise. + * elf.c: Likewise. + * elf32-arm.h: Likewise. + * elf32-cris.c: Likewise. + * elf32-d30v.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-v850.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-sh64.c: Likewise. + * elfcode.h: Likewise. + * elfcore.h: Likewise. + * elflink.h: Likewise. + * elfxx-mips.c: Likewise. + * i386os9k.c: Likewise. + * ieee.c: Likewise. + * libbfd.c: Likewise. + * linker.c: Likewise. + * mmo.c: Likewise. + * nlm32-alpha.c: Likewise. + * nlm32-i386.c: Likewise. + * nlm32-ppc.c: Likewise. + * nlm32-sparc.c: Likewise. + * nlmcode.h: Likewise. + * oasys.c: Likewise. + * pdp11.c: Likewise. + * peicode.h: Likewise. + * reloc.c: Likewise. + * som.c: Likewise. + * srec.c: Likewise. + * tekhex.c: Likewise. + * vms.c: Likewise. + * xcofflink.c: Likewise. + * elf64-sparc.c: Edit comment to not use "== false". + + * aoutf1.h: Don't use "? true : false". + * ecoff.c: Likewise. + * format.c: Likewise. + * ieee.c: Likewise. + * linker.c: Likewise. + * mmo.c: Likewise. + * oasys.c: Likewise. + +2002-06-23 H.J. Lu + + * elflink.h (elf_link_add_archive_symbols): For the default + version, check references with only one `@' first. + +2002-06-23 John David Anglin + + * elf64-hppa.c (elf64_hppa_mark_milli_and_exported_functions): New + function. + (allocate_global_data_dlt): Don't add millicode symbols to dynamic + symbol table. + (allocate_global_data_opd, allocate_dynrel_entries): Likewise. + (elf64_hppa_size_dynamic_sections): Revise to use + elf64_hppa_mark_milli_and_exported_functions. + (elf64_hppa_finish_dynamic_symbol): Remove code to keep millicode + symbols out of dynamic symbol table. + +2002-06-23 Alan Modra + + * Makefile.in: Regenerate. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + + * elflink.h: Comment typo fixes. + +2002-06-23 H.J. Lu + + * elf-bfd.h (elf_link_loaded_list): New structure. + (elf_link_hash_table): Add "loaded". + * elf.c (_bfd_elf_link_hash_table_init): Initialize "loaded". + * elflink.h (elf_link_check_versioned_symbol): New function. + (elf_link_output_extsym): Call elf_link_check_versioned_symbol. + +2002-06-19 Nick Clifton + + * elflink.h (size_dynamic_sections): If the target does not + support an ELF style hash table, return true, indicating that + nothing needed to be done, rather than false, indicating that the + section's size could not be computed. + +2002-06-18 Dave Brolley + + From Catherine Moore, Michael Meissner, Dave Brolley: + * po/SRC-POTFILES.in: Add cpu-frv.c and elf32-frv.c + * targets.c: Support bfd_elf32_frv_vec. + * reloc.c: Add FRV relocs. + * configure.in: Add support for bfd-elf32-frv-vec. + * config.bfd (targ_cpu): Add support for frv-*-elf. + * archures.c: Add frv arch and machines. + * Makefile.am (ALL_MACHINES): Add cpu-frv.lo. + (ALL_MACHINES_CFILES): Add cpu-frv.c. + (BFD32_BACKENDS): Add elf32-frv.lo. + (BFD32_BACKENDS_CFILES): Add elf32-frv.c + (cpu-frv.lo): New target. + (elf32-frv.lo): New target. + * cpu-frv.c: New file. + * elf32-frv.c: New file. + +2002-06-18 Jakub Jelinek + + * elfcode.h (elf_object_p): Sanity check eh_shoff == 0 implies + e_shnum == 0. + Only read the first section header if e_shoff is non-zero. + Don't consider e_shstrndx if there are no sections. + +2002-06-17 Tom Rix + + * elf32-d10v.c (elf_d10v_howto_table): Change R_D10V_10_PCREL_R, + R_D10V_10_PCREL_L and R_D10V_18_PCREL to use + complain_overflow_bitfield. + +2002-06-17 Alan Modra + + * opncls.c (bfd_openr): Remove redundant bfd_set_error. + (bfd_fdopenr): Likewise. + (bfd_openstreamr): Likewise. + (bfd_openw): Likewise. + + * targets.c: Sort target vecs. + (_bfd_target_vector): Add aix5coff64_vec, bfd_elf32_sh64_vec, + bfd_elf32_sh64l_vec, bfd_elf32_sh64lnbsd_vec, + bfd_elf32_sh64nbsd_vec, bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec, + bfd_elf64_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec. + * configure.in: Sort target vecs. Add m88kmach3_vec. + * configure: Regenerate. + +2002-06-16 Hans-Peter Nilsson + + * elf64-mmix.c (bpo_reloc_request_sort_fn): Use member + bpo_reloc_no to break sort order ties, not address of items. + +2002-06-16 John David Anglin + + * elf-hppa.h (elf_hppa_final_link): Fix formatting in comment. + Skip excluded sections in determing __gp value. + (elf_hppa_final_link_relocate): Use the symbol's address in + R_PARISC_FPTR64 relocations that don't need an opd entry. + * elf64-hppa.c (allocate_dynrel_entries): Simplify code. + (elf64_hppa_finalize_dynreloc): Likewise. + (elf64_hppa_size_dynamic_sections): Move comments and fix typo. + (elf64_hppa_finish_dynamic_symbol): Break up assert. + +2002-06-14 Sergey Grigoriev + + * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte + alignment for .bss, .data and .text sections so that sse and sse2 + code will work. + * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. + +2002-06013 J"orn Rennecke + + config.bfd: Add support for sh[1234]l*-*-elf* | sh3el*-*-elf*, + sh[1234]*-elf*. + +2002-06-12 John David Anglin + + * elflink.h (elf_bfd_final_link): Improve error handling for missing + dynamic sections. + + * elf64-hppa.c (allocate_global_data_opd): We don't need an opd entry + for a symbol that has no output section. + (allocate_dynrel_entries): Correct comment. + (elf64_hppa_finalize_dynreloc): Likewise. Don't create an opd entry + unless we want one. + (elf64_hppa_finalize_opd): Prevent segfault if dyn_h is NULL. + (elf64_hppa_finalize_dlt): Likewise. Prevent segfault for symbols + with no section. Remove unnecessary parentheses. + +2002-06-11 Tom Rix + + * coffcode.h (coff_compute_section_file_positions): Add data + section to AIX loader alignment check. + + * coff-rs6000.c (_bfd_xcoff_mkobject): Set default text section + alignment to 4 bytes. + (_bfd_xcoff_copy_private_bfd_data): Use text and data alignment + power accessor macro. + (do_shared_object_padding): Remove invalid assertion. + +2002-06-10 Richard Sandiford + + * section.c (_bfd_strip_section_from_output): Set SEC_EXCLUDE + for removed output sections. + +2002-06-10 Geoffrey Keating + + * merge.c (merge_strings): Use htab_create_alloc with calloc, not + htab_alloc. + * elf-strtab.c (_bfd_elf_strtab_finalize): Likewise. + +2002-06-08 H.J. Lu + + * elf.c (copy_private_bfd_data): Don't cast to bfd_size_type to + work around a long long bug in gcc 2.96 on mips. + +2002-06-08 Jason Thorpe + + * Makefile.am (BFD32_BACKENDS): Add vax1knetbsd.lo. + (BFD32_BACKENDS_CFILES): Add vax1knetbsd.c. + Regenerate dependency lists. + * Makefile.in: Regenerate. + * config.bfd (vax-*-netbsdelf*, vax-*-netbsdaout*): Add + vax1knetbsd_vec to targ_selvecs. + * configure.in: Add vax1knetbsd_vec. + * configure: Regenerate. + * targets.c (_bfd_target_vector): Add vax1knetbsd_vec. + * vax1knetbsd.c: New file. + * vaxnetbsd.c: Update copyright years. + (TARGET_PAGE_SIZE): Set to 0x1000. + (DEFAULT_MID): Set to M_VAX4K_NETBSD. + +2002-06-08 Matt Thomas + + * libaout.h (enum machine_type): Add M_VAX4K_NETBSD. + +2002-06-08 Alan Modra + + * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Make static. + +2002-06-08 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + + * armnetbsd.c: Replace CONST with const. + * corefile.c: Likewise. + * elf32-dlx.c: Likewise. + * elf64-mips.c: Likewise. + * mmo.c: Likewise. + * ns32knetbsd.c: Likewise. + + * elf64-sparc.c (sparc64_elf_add_symbol_hook): Check the hash + table is elf64-sparc. + +2002-06-08 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_relocate_section): Simplify code. + Fix RELA addends to get not shifted in the result. Don't do special + handling of R_MIPS_64 for NewABI. + +2002-06-07 Alan Modra + + * aoutx.h (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc. + (NAME(aout,slurp_reloc_table)): Likewise. + * coff-mips.c (mips_relax_section): Use bfd_zalloc. + * coff-rs6000.c (xcoff_write_armap_big): Use bfd_zmalloc. + (xcoff_write_archive_contents_big): Likewise. + (xcoff_generate_rtinit): Likewise. + (xcoff_generate_rtinit): Likewise, and check error return. + * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise. + * coffgen.c (coff_section_symbol): Use bfd_zalloc. + (coff_get_normalized_symtab): Likewise. + (coff_make_empty_symbol): Likewise. + (bfd_coff_set_symbol_class): Likewise. + * cofflink.c (coff_link_add_symbols): Likewise. + * ecoff.c (_bfd_ecoff_make_empty_symbol): Likewise. + * ecofflink.c (ecoff_write_shuffle): Use bfd_zmalloc. + (bfd_ecoff_write_accumulated_debug): Likewise. + * elf64-alpha.c (get_got_entry): Use bfd_zalloc. + * i386linux.c (bfd_i386linux_size_dynamic_sections): Likewise. + * i386lynx.c (NAME(lynx,slurp_reloc_table)): Use bfd_zmalloc. + * ieee.c (do_with_relocs): Use bfd_zalloc. + * m68klinux.c (bfd_m68klinux_size_dynamic_sections): Likewise. + * pdp11.c (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc. + (NAME(aout,slurp_reloc_table)): Likewise. + (NAME(aout,squirt_out_relocs)): Don't memset when zalloc'd. + * reloc16.c (bfd_coff_reloc16_relax_section): Use bfd_zmalloc. + * som.c (som_build_and_write_symbol_table): Likewise. + (som_slurp_string_table): Likewise. + (som_slurp_symbol_table): Likewise. + (som_bfd_ar_write_symbol_stuff): Likewise. + * sparclinux.c (bfd_sparclinux_size_dynamic_sections): Use bfd_zalloc. + * sunos.c (bfd_sunos_size_dynamic_sections): Likewise. + * tekhex.c (find_chunk): Likewise. Get rid of unused "sname". + * vms-gsd.c (_bfd_vms_slurp_gsd): Use bfd_zmalloc. + * xcofflink.c (xcoff_link_add_symbols): Use bfd_zalloc/bfd_zmalloc. + +2002-06-07 Alan Modra + + * elf-bfd.h (struct bfd_elf_section_data ): Replace with + "group" union. + (elf_group_name): Update. + (elf_group_id): Define. + (bfd_elf_set_group_contents): Declare. + * elf.c (elf_fake_sections): Qualify use of elf_group_name. + (set_group_contents): Rename to bfd_elf_set_group_contents. Remove + ATTRIBUTE_UNUSED from failedptrarg. If elf_group_id is set, use + that sym for the signature. + (_bfd_elf_compute_section_file_positions): Don't call + set_group_contents for "ld -r" case. + (swap_out_syms): Use bfd_zalloc. + * elflink.h (elf_link_add_archive_symbols): Likewise. + (NAME(bfd_elf,size_dynamic_sections)): Likewise. + (elf_bfd_final_link): Call bfd_elf_set_group_contents. + +2002-06-07 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Allow unresolved + relocs in opd for non-shared too. + +2002-06-06 Jeffrey Law + + * elf32-h8300.c (elf32_h8_relax_section): Ignore uninteresting + relocations. + +2002-06-06 Nick Clifton + + * merge.c: Include libiberty.h. + * elf-strtab.c: Include libiberty.h. + +2002-06-06 Elias Athanasopoulos + + * peXXigen.c (pe_print_idata): Remove unused variable. + +2002-06-06 David Heine + + * elf.c (assign_file_positions_for_segments): Remove unallocated + sections from the section to segment mapping for PT_LOAD segments. + Update comment about empty loadable segments. + +2002-06-06 Richard Sandiford + + * stabs.c (_bfd_link_section_stabs): Check that the symbol offset + is within the .stabstr section. + +2002-06-06 Alan Modra + + * elf-bfd.h (struct elf_size_info ): Function args + are "const PTR", not "const PTR *". + (bfd_elf32_swap_symbol_in): Likewise. + (bfd_elf64_swap_symbol_in): Likewise. + * elfcode.h (elf_swap_symbol_in): Change input args to const PTR. + (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in. + * elflink.h (elf_link_is_defined_archive_symbol): Likewise. + (elf_link_add_object_symbols): Likewise. + (elf_link_record_local_dynamic_symbol): Likewise. + (elf_link_input_bfd): Likewise. + (elf_gc_mark): Likewise. + (elf_reloc_symbol_deleted_p): Likewise. + * elf-m10200.c (mn10200_elf_relax_section): Likewise. + (mn10200_elf_relax_delete_bytes): Likewise. + (mn10200_elf_symbol_address_p): Likewise. + (mn10200_elf_get_relocated_section_contents): Likewise. + * elf-m10300.c (mn10300_elf_relax_section): Likewise. + (mn10300_elf_relax_section): Likewise. + (mn10300_elf_relax_delete_bytes): Likewise. + (mn10300_elf_symbol_address_p): Likewise. + (mn10300_elf_get_relocated_section_contents): Likewise. + * elf32-h8300.c (elf32_h8_relax_section): Likewise. + (elf32_h8_relax_delete_bytes): Likewise. + (elf32_h8_symbol_address_p): Likewise. + (elf32_h8_get_relocated_section_contents): Likewise. + * elf32-hppa.c (get_local_syms): Likewise. + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise. + * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. + * elf32-sh.c (sh_elf_relax_section): Likewise. + (sh_elf_relax_delete_bytes): Likewise. + (sh_elf_get_relocated_section_contents): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise. + * elf64-alpha.c (elf64_alpha_relax_section): Likewise. + * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. + * elf64-mmix.c (mmix_elf_relax_section): Likewise. + * elf64-ppc.c (get_local_syms): Likewise. + * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise. + * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. + +2002-06-05 J"orn Rennecke + + * config.bfd (sh64l*-*-elf*, shl*-*-elf*): New configurations. + +2002-06-05 Alan Modra + + * elf.c (group_signature): Swap in the whole symbol, and handle + extracting section symbol names. + (setup_group): Add comment. + (set_group_contents): When called from objcopy or ld, arrange for + section contents to be written. Write group member output section + indices to allow objcopy to reorganize sections. + (_bfd_elf_copy_private_section_data): Copy group info. + + * elf-bfd.h (struct elf_size_info): Add swap_symbol_in field. + (bfd_elf32_swap_symbol_in): Update prototype. + (bfd_elf64_swap_symbol_in): Likewise. + * elfcode.h (elf_swap_symbol_in): Change input args to const PTR *. + (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in. + * elflink.h (elf_link_is_defined_archive_symbol): Likewise. + (elf_link_add_object_symbols): Likewise. + (elf_link_record_local_dynamic_symbol): Likewise. + (elf_link_input_bfd): Likewise. + (elf_gc_mark): Likewise. + (elf_reloc_symbol_deleted_p): Likewise. + * elf-m10200.c (mn10200_elf_relax_section): Likewise. + (mn10200_elf_relax_delete_bytes): Likewise. + (mn10200_elf_symbol_address_p): Likewise. + (mn10200_elf_get_relocated_section_contents): Likewise. + * elf-m10300.c (mn10300_elf_relax_section): Likewise. + (mn10300_elf_relax_section): Likewise. + (mn10300_elf_relax_delete_bytes): Likewise. + (mn10300_elf_symbol_address_p): Likewise. + (mn10300_elf_get_relocated_section_contents): Likewise. + * elf32-h8300.c (elf32_h8_relax_section): Likewise. + (elf32_h8_relax_delete_bytes): Likewise. + (elf32_h8_symbol_address_p): Likewise. + (elf32_h8_get_relocated_section_contents): Likewise. + * elf32-hppa.c (get_local_syms): Likewise. + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise. + * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. + * elf32-sh.c (sh_elf_relax_section): Likewise. + (sh_elf_relax_delete_bytes): Likewise. + (sh_elf_get_relocated_section_contents): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise. + * elf64-alpha.c (elf64_alpha_relax_section): Likewise. + * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. + * elf64-mmix.c (mmix_elf_relax_section): Likewise. + * elf64-ppc.c (get_local_syms): Likewise. + * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise. + * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. + * elfcode.h (NAME(_bfd_elf,size_info)): Update initialiser. + * elf64-alpha.c (alpha_elf_size_info): Likewise. + * elf64-hppa.c (hppa64_elf_size_info): Likewise. + * elf64-mips.c (mips_elf64_size_info): Likewise. + * elf64-s390.c (s390_elf64_size_info): Likewise. + * elf64-sparc.c (sparc64_elf_size_info): Likewise. + +2002-06-05 Maciej W. Rozycki + + * elf32-mips.c (elf32_mips_ignore_discarded_relocs): Move to... + elfxx-mips.c (_bfd_mips_elf_ignore_discarded_relocs): ... here. + elf64-mips.c (elf_backend_ignore_discarded_relocs): Use + _bfd_mips_elf_ignore_discarded_relocs. + elfxx-mips.h (_bfd_mips_elf_ignore_discarded_relocs): Declare. + +2002-06-05 H.J. Lu + + * elfxx-mips.c (mips_elf_calculate_relocation): Call + _bfd_elf_rel_local_sym for STT_SECTION relocations against + the SEC_MERGE section. + +2002-06-05 Alan Modra + + * coff-alpha.c: Update copyright date. + * coff-mips.c: Likewise. + * xcoff-target.h: Likewise. + + * bfd-in.h: Remove "taken from the source" comment. + * libbfd-in.h: Likewise. + * libcoff-in.h: Likewise. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + + * elf.c (bfd_elf_discard_group): Return true. + * elf-bfd.h (bfd_elf_discard_group): Declare. + * bfd-in.h (bfd_elf_discard_group): Don't declare here. + * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. + * bfd.c (bfd_discard_group): Define. + * targets.c (struct bfd_target): Add _bfd_discard_group. + (BFD_JUMP_TABLE_LINK): Here too. + * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. + * aout-adobe.c (aout_32_bfd_discard_group): Define. + * aout-target.h (MY_bfd_discard_group): Define. + * aout-tic30.c (MY_bfd_discard_group): Define. + * binary.c (binary_bfd_discard_group): Define. + * bout.c (b_out_bfd_discard_group): Define. + * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. + * coffcode.h (coff_bfd_discard_group): Define. + * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. + * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. + * i386msdos.c (msdos_bfd_discard_group): Define. + * i386os9k.c (os9k_bfd_discard_group): Define. + * ieee.c (ieee_bfd_discard_group): Define. + * ihex.c (ihex_bfd_discard_group): Define. + * mmo.c (mmo_bfd_discard_group): Define. + * nlm-target.h (nlm_bfd_discard_group): Define. + * oasys.c (oasys_bfd_discard_group): Define. + * ppcboot.c (ppcboot_bfd_discard_group): Define. + * som.c (som_bfd_discard_group): Define. + * srec.c (srec_bfd_discard_group): Define. + * tekhex.c (tekhex_bfd_discard_group): Define. + * versados.c (versados_bfd_discard_group): Define. + * vms.c (vms_bfd_discard_group): Define. + * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. + * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. + (aix5coff64_vec): Likewise. + * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise. + +2002-06-04 Jason Thorpe + + * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-com.lo. + (BFD32_BACKENDS_CFILES): Add elf32-sh64-com.c. + (elf32-sh64-com.lo): New dependency list. + * Makefile.in: Regenerate. + * configure.in (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec) + (bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec): Add + elf32-sh64-com.lo. + * configure: Regenerate. + * elf32-sh64.c (sh64_address_in_cranges) + (sh64_get_contents_type, sh64_address_is_shmedia): Move to... + (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb): + (crange_bsearch_cmpl): Prepend _bfd_sh64_ to name and move to... + * elf32-sh64-com.c: ...here. New file. + +2002-06-04 Alan Modra + + * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Remove + ATTRIBUTE_UNUSED on used params. + * elf32-vax.c (elf_vax_gc_mark_hook): Remove unnecessary checks + before calling bfd_section_from_elf_index on local syms. + * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise. + +2002-06-04 Jason Thorpe + + * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-nbsd.lo. + (BFD32_BACKENDS_CFILES): Add elf32-sh64-nbsd.c. + (BFD64_BACKENDS): Add elf64-sh64-nbsd.lo. + (BFD64_BACKENDS_CFILES): Add elf64-sh64-nbsd.c. + (elf32-sh64-nbsd.lo, elf64-sh64-nbsd.lo): New rules. + * Makefile.in: Regenerate. + * config.bfd (sh5le-*-netbsd*, sh5-*-netbsd*, sh64le-*-netbsd*) + (sh64-*-netbsd*): New targets. + * configure.in: Add bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec, + bfd_elf64_sh64nbsd_vec, and bfd_elf64_sh64lnbsd_vec. + * configure: Regenerate. + * elf32-sh64-nbsd.c: New file. + * elf64-sh64-nbsd.c: New file. + * targets.c: Add extern decls for bfd_elf32_sh64nbsd_vec, + bfd_elf32_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec, and + bfd_elf64_sh64lnbsd_vec. + +2002-06-04 Alan Modra + + * elf.c (setup_group): Set SEC_LINK_ONCE on GRP_COMDAT groups. + (bfd_section_from_shdr): Likewise. Set section name of group + sections from signature. + (group_signature): Split out from setup_group. Ensure symbol table + is available. + (bfd_elf_discard_group): New function. + (_bfd_elf_make_section_from_shdr): Don't set SEC_LINK_ONCE on + .gnu.linkonce* sections if they are members of a group. + (set_group_contents): Set GRP_COMDAT flag. + * section.c (bfd_discard_group): New function. + * bfd-in.h (bfd_elf_discard_group): Declare. + * bfd-in2.h: Regenerate. + * elf-bfd.h (struct bfd_elf_section_data): Add linkonce_p field. + (elf_linkonce_p): Define. + +2002-06-04 Alan Modra + + * elf.c (bfd_section_from_shdr): Make "name" const. + * elf-bfd.h (elf_backend_section_from_shdr): Likewise. + * elf32-i370.c (i370_elf_section_from_shdr): Likewise. + * elf32-ppc.c (ppc_elf_section_from_shdr): Likewise. + * elf32-sh64.c (sh64_backend_section_from_shdr): Likewise. + * elf32-v850.c (v850_elf_section_from_shdr): Likewise. + * elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise. + * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise. + * elf64-ppc.c (ppc64_elf_section_from_shdr): Likewise. + * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise. + * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise. + * elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise. + +2002-06-03 Maciej W. Rozycki + + * elfxx-mips.c (ABI_64_P): Use backend's data to determine the + ABI. + +2002-06-02 Kazu Hirata + + * elf32-arc.c: Fix formatting. + * elf32-arm.h: Likewise. + * elf32-cris.c: Likewise. + * elf32-dlx.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-i386qnx.c: Likewise. + * elf32-or32.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-vax.c: Likewise. + * elf32-xstormy16.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-x86-64.c: Likewise. + +2002-06-02 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section): Don't dereference + null when there are no got entries for a symbol. + (elf64_alpha_relax_find_tls_segment): Rearrange to avoid + uninitialized variable warning. + +2002-06-01 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relax_with_lituse): Don't test for + undefined symbols here. + (elf64_alpha_relax_section): Do it here. Also test for not + defined in the current module. + (elf64_alpha_relocate_section_r): Split out of ... + (elf64_alpha_relocate_section): ... here. Don't dereference + NULL when looking up local got entries. + +2002-06-01 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relax_with_lituse): Reject undefined + symbols from JSR relaxation. + (elf64_alpha_size_plt_section_1): New. + (elf64_alpha_calc_dynrel_sizes): Split out .rela.got bits ... + (elf64_alpha_size_rela_got_1): ... here. + (elf64_alpha_size_dynamic_sections): Split out .rela.got bits ... + (elf64_alpha_size_rela_got_section): ... here. + (elf64_alpha_size_plt_section): New. + (elf64_alpha_relax_section): Call them. + (elf64_alpha_size_got_sections): Remove output_bfd arg. + (elf64_alpha_finish_dynamic_symbol): Check gotent use_count. + +2002-06-01 Richard Henderson + + * elf64-alpha.c (alpha_get_dtprel_base, alpha_get_tprel_base): New. + (elf64_alpha_relocate_section): Use them. Reject LE TLS relocs + in shared libraries. Fix DTPRELHI and TPRELHI value. + (INSN_ADDQ, INSN_RDUNIQ): New. + (struct alpha_relax_info): Add symtab_hdr, tls_segment, first_gotent. + (elf64_alpha_relax_with_lituse): Return boolean. Remove irelend + argument. Reject dynamic symbols. Use LITUSE symbolic constants. + (elf64_alpha_relax_got_load): Rename from relax_without_lituse. + Handle GOTDTPREL and GOTTPREL relocations. + (elf64_alpha_relax_gprelhilo): New. + (elf64_alpha_relax_tls_get_addr): New. + (elf64_alpha_relax_find_tls_segment): New. + (elf64_alpha_relax_section): Handle TLS relocations. + (ALPHA_ELF_LINK_HASH_TLS_IE): New. + (elf64_alpha_check_relocs): Set it. + +2002-06-01 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relax_section): Don't store computed gp. + + * elf64-alpha.c (elf64_alpha_check_relocs): Fix typo on maybe_dynamic + check; don't suppress dynamic relocs for non-allocated sections. + + * elf64-alpha.c: Remove dead code. + +2002-05-31 Alan Modra + + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + + * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate + space for bss .plt. + +2002-05-31 Graeme Peterson + + * Makefile.am (BFD32_BACKENDS): Add elf32-i386qnx.lo. + (BFD32_BACKENDS_CFILES): Add elf32-i386qnx.c. + Run "make dep-am". + * Makefile.in: Regenerate. + * config.bfd: Add i[3456]86-*-nto-qnx* support. + * configure.in: Add bfd_elf32_i386qnx_vec support. + * configure: Regenerate. + * elf-bfd.h (struct elf_backend_data): Add set_nonloadable_filepos, + is_contained_by_filepos, and copy_private_bfd_data_p. + * elf.c (assign_file_positions_for_segments): Call backend + set_nonloadable_filepos. Fix non-K&R call to _bfd_error_handler. + (IS_CONTAINED_BY_FILEPOS): Define. + (INCLUDE_SECTION_IN_SEGMENT): Also test IS_CONTAINED_BY_FILEPOS. + (copy_private_bfd_data): Use IS_CONTAINED_BY_FILEPOS. Typo fix. + Fix non-K&R call to _bfd_error_handler. + (_bfd_elf_copy_private_section_data): Use backend + copy_private_bfd_data_p. + * elf32-i386.c: Don't include elfxx-target.h when + ELF32_I386_C_INCLUDED is defined. + * elf32-i386qnx.c: New QNX elf backend file. + * elfxx-target.h: Add elf_backend_set_nonloadable_filepos, + elf_backend_is_contained_by_filepos, and + elf_backend_do_copy_private_bfd_data. + * targets.c: Add bfd_target bfd_elf32_i386qnx_vec. + +2002-05-31 Alan Modra + + * elfarm-oabi.c (bfd_elf32_arm_add_glue_sections_to_bfd): Define. + Move other similar defines to start of file. + +2002-05-30 Tom Rix + + * coff-rs6000.c (xcoff_rtype2howto): Handle 16 bit R_RBA. + * coff64-rs6000.c (xcoff64_rtype2howto): Same. + +2002-05-30 Richard Henderson + + * elf64-alpha.c (ALPHA_ELF_LINK_HASH_LU_TLSGD, + ALPHA_ELF_LINK_HASH_LU_TLSLDM, ALPHA_ELF_LINK_HASH_LU_FUNC): New. + (ALPHA_ELF_GOT_ENTRY_RELOCS_DONE): Remove. + (ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED): Remove. + (struct alpha_elf_got_entry): Add reloc_type, reloc_done, reloc_xlated. + (struct alpha_elf_obj_tdata): Rename total_got_entries and + n_local_got_entries to total_got_size and local_got_size. + (elf64_alpha_howto, elf64_alpha_reloc_map): Update for TLS relocs. + (alpha_got_entry_size): New. + (elf64_alpha_relax_with_lituse): Use it. + (elf64_alpha_relax_without_lituse): Likewise. + (MAX_GOT_SIZE): Rename from MAX_GOT_ENTRIES. + (get_got_entry): New. + (elf64_alpha_check_relocs): Handle TLS relocs. Reorganize. + (elf64_alpha_adjust_dynamic_symbol): Test LU_FUNC as a mask. + (elf64_alpha_merge_ind_symbols): Check gotent->reloc_type. + (elf64_alpha_can_merge_gots, elf64_alpha_merge_gots): Likewise. + (elf64_alpha_calc_got_offsets_for_symbol): Use alpha_got_entry_size. + (elf64_alpha_calc_got_offsets): Likewise. + (alpha_dynamic_entries_for_reloc): New. + (elf64_alpha_calc_dynrel_sizes): Use it. + (elf64_alpha_size_dynamic_sections): Likewise. + (elf64_alpha_relocate_section): Handle TLS relocations. + * reloc.c: Add Alpha TLS relocations. + * bfd-in2.h, libbfd.h: Rebuild. + +2002-05-29 Ralf Habacker + + * peXXigen.c (pe_print_idata): Remove double printed + import table lines; add Bound-To comment. + +2002-05-29 Matt Thomas + + * Makefile.am (BFD32_BACKENDS): Add elf32-vax.lo. + (BFD32_BACKENDS_CFILES): Add elf32-vax.c. + (elf32-vax.lo): New rule. + * Makefile.in: Regenerate. + * configure.in (bfd_elf32_vax_vec) + (vaxnetbsd_vec): New vectors. + * configure: Regenerate. + * config.bfd (vax-*-netbsdelf*) + (vax-*-netbsdaout*) + (vax-*-netbsd*): New targets. + * elf32-vax.c: New file. + * reloc.c: Add VAX relocations. + * bfd-in2.h: Regenerate. + * targets.c (_bfd_target_vector): Add bfd_elf32_vax_vec. + +2002-05-29 Jason Thorpe + + * config.bfd (arm-*-netbsd*): Add bfd_elf32_littlearm_vec + and bfd_elf32_bigarm_vec to targ_selvecs. + +2002-05-29 Ralf Habacker + + * peXXigen.c (pe_print_idata): Fix seg faults on printing import tables + with auto-imported symbols. + +2002-05-29 Adam Nemet + + * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Don't add glue + sections only record bfd. + (bfd_elf32_arm_add_glue_sections_to_bfd): New function. + * bfd-in.h (bfd_elf32_arm_add_glue_sections_to_bfd): Declare it. + * bfd-in2.h: Regenerate. + +2002-05-28 Nick Clifton + + * syms.c (_bfd_stab_section_find_nearest_line): Move + declaration and initialisation of saw_line and saw_func out of + for loop. + +2002-05-29 Alan Modra + + * elf64-ppc.c (ppc64_elf_get_symbol_info): New function. + (bfd_elf64_get_symbol_info): Define. + * elfxx-target.h (bfd_elfNN_get_symbol_info): Only define if undef. + +2002-05-29 Andrey Volkov + + * cpu-h8300.c: Make default h8300 machine first in machine list. + +2002-05-28 Kuang Hwa Lin + + * config.bfd: Added DLX configuraton. + * Makefile.am: Added DLX configuraton. + * configure.in: Added DLX configuraton. + * archures.c: Add DLX architecture. + * reloc.c: Add DLX relocs. + * targets.c: Added DLX target vector. + * configure: Regenerate. + * Makefile.in: Regenreate. + * bfd-in2.h: Regenreate. + * elf32-dlx.c: New file: Support DLX target. + * cpu-dlx.c: New file: Support DLX target. + +2002-05-25 Alan Modra + + * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Formatting. + + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Revert last change. + (ppc64_elf_check_relocs): Don't set up function descriptor symbol + strings to point inside function code sym string. + (func_desc_adjust): Likewise. + (ppc64_elf_hide_symbol): Rewrite code to look up function code sym. + +2002-05-24 Michal Ludvig + + * elf64-x86-64.c (elf64_x86_64_grok_prstatus): Added. + (elf64_x86_64_grok_psinfo): Added. + +2002-05-24 TAMURA Kent + + * config.bfd: Add a target for i386-netbsdpe. + +2002-05-24 Alan Modra + + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy is_func + and is_func_descriptor. + (func_desc_adjust): Hide function code sym in shared libs unless + there is a matching exported function descriptor sym. + +2002-05-23 Jakub Jelinek + + * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL + for symbols from SHF_TLS section. + (_bfd_elf_print_private_bfd_data): Add PT_TLS. + (elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections. + (map_sections_to_segments): Build PT_TLS segment if necessary. + (assign_file_positions_for_segments): Likewise. + (get_program_header_size): Account for PT_TLS segment. + (swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from + SEC_THREAD_LOCAL sections to STT_TLS. + * reloc.c: Add 386 and IA-64 TLS relocs. + * section.c (SEC_THREAD_LOCAL): Define. + (SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS): + Remove. + * elflink.h (elf_link_add_object_symbols): Support .tcommon. + (size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS + unconditionally. + (struct elf_final_link_info): Add first_tls_sec. + (elf_bfd_final_link): Set first_tls_sec. + Compute elf_hash_table (info)->tls_segment. + (elf_link_output_extsym): Handle STT_TLS symbols. + (elf_link_input_bfd): Likewise. + * syms.c (BSF_THREAD_LOCAL): Define. + * bfd-in2.h: Rebuilt. + * libbfd.h: Rebuilt. + * elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff, + elf_i386_mkobject, elf_i386_object_p): New functions. + (elf_howto_table): Add TLS relocs. + (elf_i386_reloc_type_lookup): Support TLS relocs. + (elf_i386_info_to_howto_rel): Likewise. + (struct elf_i386_link_hash_entry): Add tls_type. + (struct elf_i386_obj_tdata): New. + (elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type): + New macros. + (struct elf_i386_link_hash_table): Add tls_ldm_got. + (link_hash_newfunc): Clear tls_type. + (elf_i386_check_relocs): Support TLS relocs. + (elf_i386_gc_sweep_hook): Likewise. + (allocate_dynrelocs): Likewise. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. + (elf_i386_finish_dynamic_symbol): Likewise. + (bfd_elf32_mkobject, elf_backend_object_p): Define. + * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset, + dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done, + want_tprel, want_dtpmod, want_dtprel. + (elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions. + (ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to + R_IA64_LTOFF_TPREL22. + (elf_code_to_howto_index): Add TLS relocs. + (elfNN_ia64_check_relocs): Support TLS relocs. + (allocate_global_data_got): Account for TLS .got data. + (allocate_dynrel_entries): Account for TLS dynamic relocations. + (elfNN_ia64_install_value): Supprt TLS relocs. + (set_got_entry): Support TLS relocs. + (elfNN_ia64_relocate_section): Likewise. + +2002-05-23 Nick Clifton + + * elf32-arm.h (elf32_arm_final_link_relocate): For the Thumb + BLX reloc round the relocation up rather than down. + * coff-arm.c (coff_arm_relocate_section): Likewise. + +2002-05-21 H.J. Lu (hjl@gnu.org) + + * linker.c (_bfd_generic_link_add_one_symbol): Allow multiple + definition. + +2002-05-22 Alan Modra + + * elf64-ppc.c (ppc64_elf_size_stubs): Don't strip .branch_lt. + (ppc64_elf_relocate_section): Handle unresolved relocs in opd. + +2002-05-22 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Return false for + unresolved relocs. + (ppc64_elf_size_dynamic_sections): Check for splt NULL. + +2002-05-21 Thiemo Seufer + + * bfd.c (bfd_get_arch_size): Remove bfd_set_error call for + non-ELF targets. + +2002-05-21 Thiemo Seufer + + * elf-bfd.h (elf_backend_emit_relocs): Change prototype to return + an error value. + * elflink.h (elf_link_output_relocs): Likewise. Improve error message. + return with false on error. + (elf_link_input_bfd): Check reloc_emitter return value. + +2002-05-21 Jason Thorpe + + * config.bfd (armeb-*-netbsdelf*): New target. + +2002-05-20 Alan Modra + + * elf64-ppc.c (ppc_build_one_stub): Point undefined function syms + at the plt call stub. + +2002-05-19 Thiemo Seufer + + * cpu-mips.c (mips_compatible): Don't try to check machine + compatibility. + +2002-05-18 Tom Rix + + * coff64-rs6000.c (_bfd_xcoff64_swap_aux_out): Fix C_FILE auxent. + +2002-05-17 Alan Modra + + * elf64-ppc.c (ppc64_elf_info_to_howto): Formatting. + (ppc64_elf_relocate_section): Don't warn about reloc overflow when + we've already warned about an undefined symbol. Report more + detail on reloc errors. + +2002-05-17 Alan Modra + + * acinclude.m4 (AM_INSTALL_LIBBFD): New. + * configure.in: Invoke AM_INSTALL_LIBBFD. + * Makefile.am (install-data-local): Revert 2002-05-13. Move to.. + (install_libbfd): .. New target. + (uninstall_libbfd): Likewise. + (install-bfdlibLTLIBRARIES): Likewise. + (uninstall-bfdlibLTLIBRARIES): Likewise. + (bfdlibdir): New. + (bfdincludedir): New. + (lib_LTLIBRARIES): Rename to bfdlib_LTLIBRARIES. + * aclocal.m4: Regenerate. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2002-05-17 Stuart Balfour + + * hash.c (bfd_hash_lookup): Remove computation of len from inside + hash loop. + +2002-05-16 Nick Clifton + + * config.bfd: Add targets for sh64-linux (little endian and + big endian). + +2002-05-15 Laurent Pinchart + + * peXXigen.c (pe_print_idata): Do not assume that the first thunk + is located in the same section as the import table. Instead + check, and if necessary load the section containing the thunk. + +2002-05-15 Nick Clifton + + * aix5ppc-core.c (xcoff64_core_p): Replace bfd_read with + bfd_bread. + (xcoff64_core_file_matches_executable_p): Replace bfd_read + with bfd_bread. + +2002-05-15 Alan Modra + + * aix5ppc-core.c: Warning fixes. + * aout-adobe.c (aout_32_bfd_link_just_syms): Define. + * aout-target.h (MY_bfd_link_just_syms): Define. + * aout-tic30.c (MY_bfd_link_just_syms): Define. + * bfd.c (bfd_link_just_syms): Define. + * binary.c (binary_bfd_link_just_syms): Define. + * bout.c (b_out_bfd_link_just_syms): Define. + * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update initializer. + * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise. + * coffcode.h (coff_bfd_link_just_syms): Define. + * elf-bfd.h (enum elf_link_info_type): Add ELF_INFO_TYPE_JUST_SYMS. + (elf_discarded_section): Check for ELF_INFO_TYPE_JUST_SYMS. + (_bfd_elf_link_just_syms): Declare. + * elf.c (_bfd_elf_link_just_syms): New function. + * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Check that + sections haven't already been discarded by the linker. + * elflink.h (elf_link_add_object_symbols): Likewise for stab + sections and SEC_MERGE sections. + (elf_bfd_discard_info): Similarly here. + * elfxx-target.h (bfd_elfNN_bfd_link_just_syms): Define. + * i386msdos.c (msdos_bfd_link_just_syms): Define. + * i386os9k.c (os9k_bfd_link_just_syms): Define. + * ieee.c (ieee_bfd_link_just_syms): Define. + * ihex.c (ihex_bfd_link_just_syms): Define. + * libbfd-in.h (_bfd_nolink_bfd_link_just_syms): Define. + (_bfd_generic_link_just_syms): Declare. + * libecoff.h (_bfd_ecoff_bfd_link_just_syms): Define. + * linker.c (_bfd_generic_link_just_syms): New function. + * mmo.c (mmo_bfd_link_just_syms): Define. + * nlm-target.h (nlm_bfd_link_just_syms): Define. + * oasys.c (oasys_bfd_link_just_syms): Define. + * ppcboot.c (ppcboot_bfd_link_just_syms): Define. + * som.c (som_bfd_link_just_syms): Define. + * srec.c (srec_bfd_link_just_syms): Define. + * targets.c (struct bfd_target): Add _bfd_link_just_syms. + (BFD_JUMP_TABLE_LINK): And here. + * tekhex.c (tekhex_bfd_link_just_syms): Define. + * versados.c (versados_bfd_link_just_syms): Define. + * vms.c (vms_bfd_link_just_syms): Define. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2002-05-15 Thiemo Seufer + + * elf32-mips.c: Remove superfluous definitions copied from + elfxx-mips.c. + (bfd_elf32_bigmips_vec,bfd_elf32_littlemips_vec): Use the + SGIish vectors to check the special case. + (mips_elf_hi16_reloc): Fix comment. + (mips_elf_got16_reloc): Likewise. + (_bfd_mips_elf32_gprel16_reloc): Likewise. + (elf_reloc_map): Code cleanup. + (mips_reloc_map): Add comment. + (bfd_elf23_bfd_reloc_type_lookup): Code cleanup. + (mips_elf32_rtype_to_howto): Likewise. + (mips_elf32_discard_info): Likewise. + (elf32_mips_irix_compat): Invert logic: Only SGIish vectors + lead to IRIX compatibility now. + +2002-05-15 Thiemo Seufer + + * elfxx-mips.c: Call it IRIX, not Irix in comments. + +2002-05-13 Jason Thorpe + + * config.bfd (shle-*-netbsdelf*): Add target which includes + sh64 support. + +2002-05-13 David Edelsohn + + * configure.in: Revert 2002-04-07. Instead, auto-configure + HAVE_ST_C_IMPL. + * configure: Regenerate. + * config.in: Regenerate. + * rs6000-core.c (CNEW_IMPL): Guard use of c_impl with HAVE_ST_C_IMPL + or AIX_5_CORE. + +2002-05-11 Federico G. Schwindt + + * configure.in (sparc*-*-openbsd*): Support sparc64-openbsd + corefiles as well.2 + * configure: Regenerate. + +2002-05-13 Alan Modra + + * Makefile.am (install-data-local): Install headers to + $(exec_prefix)/include. + * Makefile.in: Regenerate. + +2002-05-11 Ralf Corsepius + Daniel Jacobowitz + + * coff-sh.c (sh_reloc_map): Map to R_SH_IMM32 for non-PE. Don't + map BFD_RELOC_RVA. + +2002-05-11 Federico G. Schwindt + + * config.bfd (alpha*-*-openbsd*, sparc64*-*-openbsd*, + hppa*-*-openbsd*): New targets. + * configure.in (alpha*-*-openbsd*): Set COREFILE. + * configure: Regenerate. + +2002-05-10 Tom Rix + + * coff64-rs6000.c (xcoff64_reloc_type_br): New function for + xcoff64_ppc_relocate_section. + * coff-rs6000.c : Extern common xcoff_reloc_type functions. + * libxcoff.h: Common xcoff_reloc_type function declaration. + +2002-05-10 Alan Modra + + * elf32-i386.c (elf_i386_relocate_section): Remove overflow checks + added in 2002-05-09 commit. + + * elf32-hppa.c (elf32_hppa_size_stubs): Revert part of 2002-05-04, + don't look for stubs on all undefined syms. + +2002-05-09 Alan Modra + + * elf64-ppc.c (RA_REGISTER_MASK, RA_REGISTER_SHIFT): Delete. + (ppc64_elf_howto_raw ): Not pc_relative or + pcrel_offset. + + * elf32-i386.c (elf_howto_table): Comments. + (elf_i386_relocate_section): Handle more relocs for relocatable + linking and against SEC_MERGE sections. + +2002-05-08 Alan Modra + + * elf32-ppc.c (ppc_elf_create_got): New function. + (ppc_elf_create_dynamic_sections): Call ppc_elf_create_got before + _bfd_elf_create_dynamic_sections. Correct .plt flags. + (ppc_elf_check_relocs): Use ppc_elf_create_got in place of + _bfd_elf_create_got_section. + +2002-05-07 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add rela_normal. + * elfxx-target.h (elf_backend_rela_normal): Define. + (elfNN_bed): Init rela_normal. + * elflink.h (elf_link_input_bfd ): Handle adjustment + for section symbols here if rela_normal. Simplify abs section test. + * elf-m10200.c (mn10200_elf_relocate_section): If relocatable, + return immediately. Remove code handling relocatable linking. + * elf-m10300.c (mn10300_elf_relocate_section): Likewise. + * elf32-fr30.c (fr30_elf_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-i860.c (elf32_i860_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + * elf32-arm.h (elf32_arm_relocate_section): Likewise #ifndef USE_REL. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf-m10200.c (elf_backend_rela_normal): Define. + * elf-m10300.c (elf_backend_rela_normal): Define. + * elf32-fr30.c (elf_backend_rela_normal): Define. + * elf32-i370.c (elf_backend_rela_normal): Define. + * elf32-i860.c (elf_backend_rela_normal): Define. + * elf32-m68k.c (elf_backend_rela_normal): Define. + * elf32-mcore.c (elf_backend_rela_normal): Define. + * elf32-openrisc.c (elf_backend_rela_normal): Define. + * elf32-ppc.c (elf_backend_rela_normal): Define. + * elf32-s390.c (elf_backend_rela_normal): Define. + * elf32-xstormy16.c (elf_backend_rela_normal): Define. + * elf64-ppc.c (elf_backend_rela_normal): Define. + * elf64-s390.c (elf_backend_rela_normal): Define. + * elf64-x86-64.c (elf_backend_rela_normal): Define. + * elfxx-ia64.c (elf_backend_rela_normal): Define. + * elf32-arm.h (elf_backend_rela_normal): Define #ifndef USE_REL. + * elf32-m32r.c (elf_backend_rela_normal): Likewise. + +2002-05-06 Nick Clifton + + * elf32-arm.h (elf32_arm_final_link_relocate): Convert + 'reloc_signed_max' and 'reloc_signed_min' into half-word offsets. + +2002-05-06 Alan Modra + + * elflink.h (elf_link_input_bfd ): Adjust r_offset + when not relocatable. Fix reloc_emitter call for K&R. + +2002-05-04 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Reinstate code + reloading local sym addend mistakenly removed in 2002-05-01 change. + + * dwarf2.c (struct line_head): Make prologue_length a bfd_vma. + (read_abbrevs): Change "offset" param to bfd_vma. + (parse_comp_unit): Change "version" and addr_size to unsigned ints. + Change "abbrev_offset" to bfd_vma. + (read_indirect_string): Use correct conversion chars in error + message format string, cast bfd_vma's to unsigned long. + (read_abbrevs): Likewise. + (read_attribute_value): Likewise. + (decode_line_info): Likewise. + (scan_unit_for_functions): Likewise. + (parse_comp_unit): Likewise. + +2002-05-04 Tom Rix + + * coffswap.h (coff_swap_reloc_in): Remove XCOFF support. + (coff_swap_reloc_out): Same. + * coff-rs6000.c: (xcoff_swap_reloc_in): Moved from coffswap.h. + (xcoff_swap_reloc_out): Same. + (xcoff_rtype2howto): Renamed from _bfd_xcoff_rtype2howto. Special + case some 16 bit relocs. Add reloc value to output. + (xcoff_howto_table): Remove 64 bit R_POS, add 16 bit + R_RBR. Improve names. + (_bfd_xcoff_reloc_type_lookup): Adjust for removal of 64 bit R_POS. + (bfd_xcoff_backend_data): Update with new reloc swap names. + (bfd_pmac_xcoff_backend_data) : Same. + * coff64-rs6000.c: (xcoff64_swap_reloc_in): Moved from coffswap.h. + (xcoff64_swap_reloc_out): Same. + (xcoff64_rtype2howto): Special case some 16 bit relocs and 32 bit + R_POS. Add reloc value to output. + (xcoff64_howto_table): Move 64 bit R_POS to first entry. Add 16 + bit R_RBR. Improve names, masks. + (xcoff64_reloc_type_lookup): Adjust for move of 64 bit R_POS. + (bfd_xcoff_backend_data): Update with new reloc swap names. + (bfd_xcoff_aix5_backend_data) : Same. + +2002-05-04 Alan Modra + + * elf32-hppa.c (struct elf32_hppa_link_hash_table): Add + bfd_count top_index, input_list, all_local_syms. + (elf32_hppa_setup_section_lists): New function, split from + elf32_hppa_size_stubs. + (elf32_hppa_next_input_section): Likewise. + (group_sections): Likewise. + (get_local_syms): Likewise. + (elf32_hppa_size_stubs): Adjust for split out functions. Look for + stubs on undefined syms too. + (elf32_hppa_set_gp): Use bfd_link_hash* instead of elf_link_hash*. + Only access htab elf fields when we have an elf hash table. + * elf32-hppa.h (elf32_hppa_setup_section_lists): Declare. + (elf32_hppa_next_input_section): Declare. + +2002-05-04 Bob Byrnes + + * opncls.c (_bfd_new_bfd_contained_in): Check return value of + _bfd_new_bfd. + +2002-05-03 H.J. Lu (hjl@gnu.org) + + * elfxx-mips.c (mips_elf_link_hash_entry): Add forced_local. + (mips_elf_link_hash_newfunc): Initialize forced_local to false. + (mips_elf_record_global_got_symbol): Call _bfd_mips_elf_hide_symbol + to hide a global symbol. + (_bfd_mips_elf_hide_symbol): Return if forced_local is true. Set + forced_local to true. + +2002-05-02 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section): Force relative relocs + vs SHN_UNDEF to zero. + +2002-05-02 Alan Modra + + * elf64-ppc.c (ppc64_elf_howto_raw ): Change to a + 16 bit reloc. + : Likewise. + (ppc64_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to + SECTOFF reloc. + * elf32-ppc.c (ppc_elf_howto_raw ): Correct. + (ppc_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to + SECTOFF reloc. + + * elf64-ppc.c (ppc64_elf_addr16_ha_reloc): Delete. + (ppc64_elf_ha_reloc): New function. + (ppc64_elf_brtaken_reloc): New function. + (ppc64_elf_sectoff_reloc): New function. + (ppc64_elf_sectoff_ha_reloc): New function. + (ppc64_elf_toc_reloc): New function. + (ppc64_elf_toc_ha_reloc): New function. + (ppc64_elf_toc64_reloc): New function. + (ppc64_elf_unhandled_reloc): New function. + (ppc64_elf_howto_raw): Use the above. + : Mark pc_relative, pcrel_offset. + : Not pc_relative or pcrel_offset. Fix dst_mask. + : Likewise. + (IS_ABSOLUTE_RELOC): Update. + (struct ppc_link_hash_table): Add have_undefweak. + (ppc64_elf_link_hash_table_create): Init. + (func_desc_adjust): Set have_undefweak. + (ppc64_elf_func_desc_adjust): Call func_desc_adjust earlier. Only + add the .sfpr blr when have_undefweak. + (ppc64_elf_setup_section_lists): Check hash table flavour. + (ppc64_elf_next_input_section): Move output_section->owner test to + ppc64elf.em. + (ppc64_elf_set_toc): Rename to ppc64_elf_toc, remove info param + and relocatable test. Return TOCstart and don't set elf_gp. + (ppc64_elf_relocate_section): Correct BRTAKEN/BRNTAKEN branch + offset calculation. Add assert on weak sym branch tweaks. + * elf64-ppc.h (ppc64_elf_set_toc): Delete. + (ppc64_elf_toc): Declare. + (ppc64_elf_next_input_section): Update. + +2002-05-01 Alan Modra + + * syms.c (_bfd_stab_section_find_nearest_line): Don't bomb on NULL + file_name. + +2002-05-01 Alan Modra + + * elf64-ppc.c (CROR_151515, CROR_313131): Define. + (ppc64_elf_relocate_section): Use them. Don't look for plt calls + on R_PPC64_ADDR24 relocs. Require a nop or no link reg on plt + call branches. Correct undefined weak destination. + (ppc64_elf_func_desc_adjust): Always create at least one blr in + .sfpr, and correct case where either only savef* or restf* is + needed. + + Long branch stubs, multiple stub sections. + * elf64-ppc.h (ppc64_elf_setup_section_lists): Declare. + (ppc64_elf_next_input_section): Declare. + * elf64-ppc.c: Move linker-only prototypes. + (STUB_SUFFIX): Define. + (enum ppc_stub_type): New. + (struct ppc_stub_hash_entry): New. + (struct ppc_branch_hash_entry): New. + (struct ppc_link_hash_entry): Add stub_cache, oh. + (struct ppc_link_hash_table): Add stub_hash_table etc. Remove + sstub. Add sbrlt, srelbrlt, has_14bit_branch, stub_iteration. + Rename plt_overflow to stub_error. + (ppc_stub_hash_lookup): Define. + (ppc_branch_hash_lookup): Define. + (stub_hash_newfunc): New function. + (branch_hash_newfunc): New function. + (link_hash_newfunc): Init new fields. + (ppc64_elf_link_hash_table_create): Likewise. + (ppc64_elf_link_hash_table_free): New function. + (ppc_stub_name): New function. + (ppc_get_stub_entry): New function. + (ppc_add_stub): New function. + (create_linkage_sections): Use bfd_make_section_anyway. Create + .branch_lt and .rela.branch_lt sections. Don't create .stub. + (ppc64_elf_check_relocs): Set has_14bit_branch on R_PPC64_REL14*, + and set up for plt call stubs. Link func and func desc syms. + (ppc64_elf_gc_sweep_hook): Handle REL14* as per REL24. + (func_desc_adjust): Avoid hash lookup when func desc sym available + via shortcut, and set links when processing. + (ppc64_elf_hide_symbol): Likewise. + (allocate_dynrelocs): Don't allocate stub section here. + (ppc64_elf_size_dynamic_sections): Handle sbrlt and srelbrlt. + Remove sstub code. + (ppc_type_of_stub): New function. + (build_one_stub): Delete. + (ppc_build_one_stub): New function. + (ppc_size_one_stub): New function. + (ppc64_elf_setup_section_lists): New function. + (ppc64_elf_next_input_section): New function. + (group_sections): New function. + (get_local_syms): New function. + (ppc64_elf_size_stubs): Rewrite. + (ppc64_elf_build_stubs): Rewrite. + (ppc64_elf_relocate_section): Look up stub entry for REL24 + relocs. Don't propagate REL14* to dynamic objects. Look for long + branch stubs if REL14* or REL24 relocs won't reach. + (bfd_elf64_bfd_link_hash_table_free): Define. + +2002-04-30 Mark Mitchell + + * config.bfd: Add support for powerpc-*-windiss. + +2002-04-30 Tom Rix + + * xcofflink.c (xcoff_link_add_symbols): Always copy undef C_EXT + symbol names into the hash table. + +2002-04-28 Tom Rix + + * coff-rs6000.c (xcoff_calculate_relocation) : Function table for + calulating relocations. + (xcoff_complain_overflow) : Function table for relocation errors. + (xcoff_ppc_relocate_section): Use relocation and complain function + tables. + (xcoff_complain_overflow_unsigned_func): New complain function. + (xcoff_complain_overflow_signed_func): Same. + (xcoff_complain_overflow_bitfield_func): Same. + (xcoff_complain_overflow_dont_func): Same. + (xcoff_reloc_type_crel): New recot function. + (xcoff_reloc_type_br): Same. + (xcoff_reloc_type_ba): Same. + (xcoff_reloc_type_toc): Same. + (xcoff_reloc_type_rel): Same. + (xcoff_reloc_type_neg): Same. + (xcoff_reloc_type_pos): Same. + (xcoff_reloc_type_fail): Same. + (xcoff_reloc_type_noop): Same. + * libxcoff.h : Declare common parts for xcoff64. + * coff64-rs6000.c (xcoff64_ppc_relocate_section): Use relocation + and complain function tables. + +2002-04-28 Alan Modra + + * elf64-x86-64.c (struct elf64_x86_64_dyn_relocs): Comment typo. + * elf32-hppa.c (elf32_hppa_final_link): Formatting. + +2002-04-26 Alan Modra + + * opncls.c (bfd_make_readable): Call bfd_section_list_clear. + * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise. + + * elflink.h (elf_bfd_final_link): Ensure input bfd class is the + same as the output before calling elf_link_input_bfd. + + * coffcode.h (coff_compute_section_file_positions): Set + section_tail after shuffling section list. + +2002-04-24 Christian Groessler + + * coff-z8k.c (extra_case): Fix R_IMM32 relocations: The + addresses are 23bit with a special layout, not plain 32bit + values. Prevent relocation of immediate values. + +2002-04-24 Chris G. Demetriou + + * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): If MDMX or + MIPS-16 ASE flags are set, print something to indicate that. + +2002-04-23 Alan Modra + + * elf32-hppa.c (hppa_type_of_stub): Correct and simplify condition + under which a plt call stub is used. + (final_link_relocate): Similarly. + (allocate_plt_static): Clear h-plabel except when plt entry is + exclusively used for a plabel. + (allocate_dynrelocs): Use the above to simplify plt sizing. + (struct elf32_hppa_link_hash_table): Add has_22bit_branch. + (elf32_hppa_link_hash_table_create): Init. + (BL22_RP): Define. + (hppa_build_one_stub): Use BL22_RP if has_22bit_branch. + (elf32_hppa_check_relocs): Set has_22bit_branch. + + * elf32-hppa.c (elf32_hppa_check_relocs): Remove debug message. + (final_link_relocate): Likewise. + +2002-04-22 Jakub Jelinek + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't build + search table if some FDE is DW_EH_PE_aligned encoded either. + (_bfd_elf_write_section_eh_frame): Handle terminating FDE specially. + +2002-04-22 Richard Smith + Jakub Jelinek + + * elf-eh-frame.c (struct eh_cie_fde): Add per_encoding_relative. + (_bfd_elf_discard_section_eh_frame): Set it for CIEs with pcrel + encoded personality. + (_bfd_elf_write_section_eh_frame): Adjust pcrel encoded personality + for CIE/FDE removal. + +2002-04-20 Tom Rix + + * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Fix C_FILE auxent. + +2002-04-20 Alan Modra + + * archures.c (bfd_lookup_arch): Move the list order comment.. + (struct bfd_arch_info): ..to where it belongs. + * bfd-in2.h: Regenerate. + + * archures.c (bfd_lookup_arch): Add comment on list order. + (bfd_default_set_arch_mach): Use bfd_lookup_arch. + * cpu-powerpc.c (bfd_powerpc_archs): Re-order so that the default + is always at head of list. + +2002-04-18 Nick Clifton + + * coff-arm.c (coff_thumb_pcrel_12, coff_thumb_pcrel_9, + insert_thumb_branch, record_thumb_to_arm_glue): Suppress + definition of these functions for ARM_WINCE builds as they are + not used. + (SWAP_IN_RELOC_OFFSET, SWAP_OUT_RELOC_OFFSET): Do not define + for ARM_WINCE builds. + +2002-04-18 Nick Clifton + + * coff-arm.c (bfd_arm_process_before_allocation): + +2002-04-17 J"orn Rennecke + + * cpu-sh.c (scan_mach): Delete. + (arch_info_struct): Replace scan_mach with bfd_default_scan. + (bfd_sh_arch): Likewise. + +2002-04-16 Nick Clifton + + * ihex.c (ihex_write_object_contents): Fix check for records + crossing 64K boundaries. + +2002-04-16 Alan Modra + + * elf32-m32r.c (m32r_elf_add_symbol_hook): Check the hash table + type rather than just assuming entries are ELF. + * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise. + * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise. + * elf64-sparc.c (sparc64_elf_add_symbol_hook): Likewise. + * elf64-mmix.c (mmix_elf_add_symbol_hook): Use bfd_link_hash_entry + rather than elf_link_hash_entry. + +2002-04-15 Richard Henderson + + * elf32-mips.c (mips_elf32_object_p): Revert 0404 fragment: allow + n32 binaries. + +2002-04-15 Michael Snyder + + * opncls.c (bfd_close): Write contents if writeable. + Minor formatting tidy-ups. + +2002-04-15 Alan Modra + + * elf32-ppc.c (ppc_elf_add_symbol_hook): Check the hash table type. + +2002-04-12 Michael Snyder + + * bfd-in.h (bfd_get_section_lma): New access macro. + Minor white-space fix-up. + +2002-04-12 Alan Modra + + * elf.c (prep_headers): Don't zero EI_OSABI, EI_ABIVERSION or + header pad. + +2002-04-09 DJ Delorie + + * elfarm-nabi.c (elf32_arm_howto_table): Fix ABS16 masks. + +2002-04-09 Casper S. Hornstrup + + * coffcode.h (coff_read_word): New. + (coff_compute_checksum): New. + (coff_apply_checksum): New. + (coff_write_object_contents): Call coff_apply_checksum () to + apply checksum to PE image. + +2002-04-08 Randolph Chung + + * elf32-hppa.c (hppa_unwind_entry_compare): Move to elf-hppa.h. + (elf32_hppa_final_link): Split out sorting logic to.. + * elf-hppa.h (elf_hppa_sort_unwind): ..here. + (elf_hppa_final_link): Call elf_hppa_sort_unwind. + +2002-04-07 Andrew Cagney + + * configure.in: Add missing ``|'' to powerpc-*-aix4.[4-9]* + pattern. + * configure: Re-generate. + +2002-04-07 Andrew Cagney + + * configure.in: Only define AIX_CORE_DUMPX_CORE when AIX version + is greater or equal to 4.3.3. + * configure: Regenerate. + Fix PR gdb/344. + +2002-04-05 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_howto_table) : Fix typo in name. + (cris_elf_check_relocs): Always create .rela.got here when + R_CRIS_16_GOTPLT or R_CRIS_32_GOTPLT is seen. + (elf_cris_adjust_gotplt_to_got): Don't create .rela.got here; + assume it's created. + +2002-04-04 Daniel Jacobowitz + + * aout-adobe.c (aout_32_bfd_link_hash_table_free): Define. + * aout-target.h (MY_bfd_link_hash_table_free): Conditionally + define. + * aout-tic30.c (MY_bfd_link_hash_table_free): Likewise. + * bfd.c (bfd_link_hash_table_free): Define. + * binary.c (binary_bfd_link_hash_table_free): Define. + * bout.c (b_out_bfd_link_hash_table_free): Define. + * coff-rs6000.c (rs6000coff_vec): Include + _bfd_generic_link_hash_table_free. + (pmac_xcoff_vec): Likewise. + * coff64-rs6000.c (rs6000coff64_vec): Likewise. + (aix5coff64_vec): Likewise. + * coffcode.h (coff_bfd_link_hash_table_free): Conditionally define. + * elf-m10300.c (elf32_mn10300_link_hash_table_free): New function. + (bfd_elf32_bfd_link_hash_table_free): Define. + * elf32-hppa.c (elf32_hppa_link_hash_table_free): New function. + (bfd_elf32_bfd_link_hash_table_free): Define. + * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Conditionally + define. + * i386msdos.c (msdos_bfd_link_hash_table_free): Define. + * i386os9k.c (os9k_bfd_link_hash_table_free): Define. + * ieee.c (ieee_bfd_link_hash_table_free): Define. + * ihex.c (ihex_bfd_link_hash_table_free): Define. + * libbfd-in.h (_bfd_nolink_bfd_link_hash_table_free): Define. + (_bfd_generic_link_hash_table_free): Add prototype. + * libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Add prototype. + * libecoff.h (_bfd_ecoff_bfd_link_hash_table_free): Define. + * linker.c (_bfd_generic_link_hash_table_free): New function. + * mmo.c (mmo_bfd_link_hash_table_free): Define. + * nlm-target.h (nlm_bfd_link_hash_table_free): Define. + * oasys.c (oasys_bfd_link_hash_table_free): Define. + * ppcboot.c (ppcboot_bfd_link_hash_table_free): Define. + * som.c (som_bfd_link_hash_table_free): Define. + * srec.c (srec_bfd_link_hash_table_free): Define. + * tekhex.c (tekhex_bfd_link_hash_table_free): Define. + * versados.c (versados_bfd_link_hash_table_free): Define. + * vms.c (vms_bfd_link_hash_table_free): New function. + * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_free): New function. + + * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_malloc + instead of bfd_alloc. + * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise. + * coff-mcore.c (coff_mcore_link_hash_table_create): Likewise. + * coff-ppc.c (ppc_coff_link_hash_table_create): Likewise. + * cofflink.c (_bfd_coff_link_hash_table_create): Likewise. + * ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise. + * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise. + * elf.c (_bfd_elf_link_hash_table_create): Likewise. + * elf32-arm.h (elf32_arm_link_hash_table_create): Likewise. + * elf32-cris.c (elf_cris_link_hash_table_create): Likewise. + * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise. + * elf32-i386.c (elf_i386_link_hash_table_create): Likewise. + * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise. + * elf32-s390.c (elf_s390_link_hash_table_create): Likewise. + * elf32-sh.c (sh_elf_link_hash_table_create): Likewise. + * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create): Likewise. + * elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise. + * elf64-s390.c (elf_s390_link_hash_table_create): Likewise. + * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise. + * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create): Likewise. + * elf64-x86-64.c (elf64_x86_64_link_hash_table_create): Likewise. + * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise. + * linker.c (_bfd_generic_link_hash_table_create): Likewise. + * m68klinux.c (linux_link_hash_table_create): Likewise. + * sparclinux.c (linux_link_hash_table_create): Likewise. + * sunos.c (sunos_link_hash_table_create): Likewise. + * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise. + + * targets.c: Add _bfd_link_hash_table_free to xvec. + + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2002-04-04 Alan Modra + + * dep-in.sed: Cope with absolute paths. + * Makefile.am (dep.sed): Subst TOPDIR, and not INCDIR. + Run "make dep-am". + * Makefile.in: Regenerate. + * coff-arm.c: Fix copyright date. + * cpu-h8300.c: Likewise. + * cpu-i370.c: Likewise. + * cpu-s390.c: Likewise. + * cpu-mips.c: Likewise. + * po/SRC-POTFILES.in: Regenerate. + +2002-04-04 Thiemo Seufer + + * Makefile.am: Add elfxx-mips.c to the known backends. + (elf32-mips.lo): remove dependency to coff/external.h. + * Makefile.in: Regenerate. + * configure.in: Add elfxx-mips.lo to all vectors using elf32-mips.lo + Remove elf32-mips.lo from 64 bit vectors. Update dependencies + accordingly. + * configure: Regenerate. + * elf-bfd.h: Move all MIPS ELF specific prototypes to elfxx-mips.h. + (irix_compat_t): IRIX compatibility level, moved from elf32-mips.c. + (elf_backend_mips_irix_compat, elf_backend_mips_rtype_to_howto): New + MIPS specific backend functions. + * elf32-mips.c: Moved most code to elfxx-mips.c. + (mips_elf_hi16_reloc): Rename from _bfd_mips_elf_hi16_reloc and make + static. + (mips_elf_lo16_reloc): Likewise, was _bfd_mips_elf_lo16_reloc. + (mips_elf_got16_reloc): Likewise, was _bfd_mips_elf_got16_reloc. + (mips_elf_gprel32_reloc): Likewise, was _bfd_mips_elf_gprel32_reloc. + (mips_elf32_rtype_to_howto): Rename from mips_rtype_to_howto. Changed + interface to allow selection of the right REL or RELA howto table. + (mips_elf32_object_p): Rename from _bfd_mips_elf_object_p and made + static. Let it refuse n32 objects. + (elf32_mips_grok_prstatus): Rename from _bfd_elf32_mips_grok_prstatus. + (elf32_mips_grok_psinfo): Rename from _bfd_elf32_mips_grok_psinfo. + (elf32_mips_discard_info): Rename from _bfd_elf32_mips_discard_info. + (elf32_mips_ignore_discarded_relocs): Rename from + _bfd_elf32_mips_ignore_discarded_relocs. + (elf32_mips_write_section): Rename from _bfd_elf32_mips_write_section. + (elf32_mips_irix_compat): New function, replaces IRIX_COMPAT. + (elf_mips_howto_table_rela): Remove. + * elf64-mips.c: Moved most code to elfxx-mips.c. + (bfd_elf64_bfd_reloc_type_lookup): Make static. + (mips_elf64_rtype_to_howto): New function. + (mips_elf64_object_p): Likewise. + (elf64_mips_irix_compat): Likewise. + * elfxx-mips.c: New file containing common code merged together from + elf32-mips.c and elf64-mips.c. + * elfxx-mips.h: New file containing MIPS specific prototypes from + elf-bfd.h. + * elfxx-target.h: Add handling for elf_backend_mips_irix_compat and + elf_backend_mips_rtype_to_howto. + +2002-04-04 Alan Modra + + * srec.c (MAXCHUNK, Chunk): Revise comments. + (srec_write_record): Correct buffer size. + (srec_write_header): Do without intermediate buffer. + (srec_write_section): Validate Chunk. + (srec_write_terminator): Pass NULL instead of dummy buffer. + (srec_write_symbols): Pass file and symbol names directly to + bfd_bwrite so sprintf won't overflow buffer. + +2002-04-03 Jakub Jelinek + + * elf32-sparc.c (elf32_sparc_relocate_section): Don't emit dynamic + PC relative relocs against hidden symbols. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + +2002-04-03 Alan Modra + + * elf.c (_bfd_elf_make_section_from_shdr): When setting section + LMAs, loop over segments until p_vaddr and p_memsz specify an + extent enclosing the section. + +2002-04-02 Nick Clifton + + * ihex.c (ihex_write_object_contents): Do not allow records to + cross a 64K boundary - wrap if necessary. + +2002-04-01 Nathan Williams + + * elf.c (elfcore_netbsd_get_lwpid): Fix off-by-one error + which caused the returned LWP ID to always be 0. + +2002-04-01 Richard Henderson + + * elf32-sparc.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New. + (elf32_sparc_relocate_section): Use it to figure out when to + initialize .got entries. + * elf64-sparc.c: Similarly. + +2002-03-28 Alan Modra + + * linker.c (link_action): Ignore duplicate warning syms. + (_bfd_generic_link_write_global_symbol): Follow warning symbol link. + * elflink.h (elf_adjust_dynstr_offsets): Likewise. + (elf_adjust_dynamic_symbol): Likewise. + (elf_export_symbol): Likewise. + (elf_link_find_version_dependencies): Likewise. + (elf_link_assign_sym_version): Likewise. + (elf_link_sec_merge_syms): Likewise. + (elf_link_output_extsym): Likewise. + (elf_gc_sweep_symbol): Likewise. + (elf_gc_propagate_vtable_entries_used): Likewise. + (elf_gc_smash_unused_vtentry_relocs): Likewise. + (elf_gc_allocate_got_offsets): Likewise. + (elf_collect_hash_codes): Likewise. + * elflink.c (elf_link_renumber_hash_table_dynsyms): Likewise. + * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): Likewise. + (elf_hppa_remark_useless_dynamic_symbols): Likewise. + * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise. + * elf32-arm.h (elf32_arm_discard_copies): Likewise. + * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Likewise. + (elf_cris_discard_excess_dso_dynamics): Likewise. + * elf32-hppa.c (clobber_millicode_symbols): Likewise. + (mark_PIC_calls): Likewise. + (allocate_plt_static): Likewise. + (allocate_dynrelocs): Likewise. + (readonly_dynrelocs): Likewise. + * elf32-i386.c (allocate_dynrelocs): Likewise. + (readonly_dynrelocs): Likewise. + * elf32-i370.c (i370_elf_adjust_dynindx): Likewise. + * elf32-m68k.c (elf_m68k_discard_copies): Likewise. + * elf32-mips.c (mips_elf_output_extsym): Likewise. + (mips_elf_sort_hash_table_f): Likewise. + (mips_elf_check_mips16_stubs): Likewise. + * elf32-s390.c (allocate_dynrelocs): Likewise. + (readonly_dynrelocs): Likewise. + * elf32-sh.c (sh_elf_discard_copies): Likewise. + * elf32-xstormy16.c (xstormy16_relax_plt_check): Likewise. + (xstormy16_relax_plt_realloc): Likewise. + * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Likewise. + (elf64_alpha_output_extsym): Likewise. + * elf64-hppa.c (elf64_hppa_mark_exported_functions): Likewise. + * elf64-mips.c (mips_elf64_sort_hash_table_f): Likewise. + (mips_elf64_check_mips16_stubs): Likewise. + (mips_elf64_output_extsym): Likewise. + * elf64-ppc.c (func_desc_adjust): Likewise. + (allocate_dynrelocs): Likewise. + (readonly_dynrelocs): Likewise. + * elf64-s390.c (allocate_dynrelocs): Likewise. + (readonly_dynrelocs): Likewise. + * elf64-sh64.c (sh64_elf64_discard_copies): Likewise. + * elf64-x86-64.c (allocate_dynrelocs): Likewise. + (readonly_dynrelocs): Likewise. + * elfxx-ia64.c (elfNN_ia64_global_dyn_sym_thunk): Likewise. + * aoutx.h (aout_link_write_other_symbol): Likewise. + * cofflink.c (_bfd_coff_write_task_globals): Likewise. + (_bfd_coff_write_global_sym): Likewise. + * i386linux.c (linux_tally_symbols): Likewise. + * m68klinux.c (linux_tally_symbols): Likewise. + * sparclinux.c (linux_tally_symbols): Likewise. + * pdp11.c (aout_link_write_other_symbol): Likewise. + * sunos.c (sunos_scan_dynamic_symbol): Likewise. + * xcofflink.c (xcoff_build_ldsyms): Likewise. + (xcoff_write_global_symbol): Likewise. + + * cofflink.c (_bfd_coff_final_link): Formatting. + * cpu-mips.c (mips_compatible): Make static, prototype. + * elf32-i386.c (elf_i386_check_relocs): Formatting. + * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise. + * elf64-alpha.c (elf64_alpha_output_extsym): Likewise. + * elf64-mips.c (mips_elf64_sort_hash_table): Likewise. + (mips_elf64_final_link): Likewise. + * elflink.h (elf_link_find_version_dependencies): Remove duplicate + prototype. + +2002-03-27 Nick Clifton + + * coff-arm.c (SWAP_IN_RELOC_OFFSET): Define. + (SWAP_OUT_RELOC_OFFSET): Define. + +2002-03-27 Gregory Steuck + + * elf.c (_bfd_elf_get_symtab_upper_bound): Leave space for + terminating NULL if empty symbol table. + (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise. + +2002-03-26 H.J. Lu (hjl@gnu.org) + + * elflink.h (elf_link_input_bfd): Revert the last change since + the gcc exception handling isn't fixed yet. + +2002-03-26 H.J. Lu (hjl@gnu.org) + + * elflink.h (elf_link_input_bfd): Complain about relocations + against local symbols in discarded sections. + +2002-03-26 Alan Modra + + * elflink.h (elf_gc_mark): Don't recurse into non-ELF sections. + +2002-03-23 Alan Modra + + * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on + section file offset for !SEC_LOAD sections. + +2002-03-21 Richard Earnshaw + + * elf32-arm.h (elf32_arm_final_link_relocate , + ): Handle relocations to Thumb functions. + +2002-03-21 Alan Modra + + * coff64-rs6000.c (_bfd_xcoff64_put_symbol_name): Prototype. + Whitespace changes. + * archive.c: Update copyright date. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * Makefile.am: Run "make dep-am" + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2002-03-20 Daniel Jacobowitz + + * dwarf2.c (struct funcinfo): Move up. + (lookup_address_in_function_table): New argument function_ptr. + Set it. + (lookup_address_in_line_table): New argument function. If function + is non-NULL, use it to handle ``addr'' before the first line note of + the function. + (comp_unit_find_nearest_line): Update and swap calls to + lookup_address_in_function_table and lookup_address_in_line_table. + * syms.c (_bfd_stab_section_find_nearest_line): Use the first + N_SLINE encountered if we see an N_FUN before any N_SLINE. + +2002-03-20 Tom Rix + + * coff-rs6000.c (_bfd_xcoff_stat_arch_elt): Renamed from + _bfd_xcoff_generic_stat_arch_elt. Fix format check. + * coff64-rs6000.c : Use _bfd_xcoff_stat_arch_elt. + +2002-03-19 Tom Rix + + * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Look through all + dynamic objects in archives. + +2002-03-19 Hans-Peter Nilsson + + * elflink.h (NAME(bfd_elf,record_link_assignment)): Don't set + STT_NOTYPE symbols to STT_OBJECT. + +2002-03-18 Jan Hubicka + + * cpu-i386.c (bfd_x86_64_arch): Rename to "i386:x86-64" + +2002-03-18 Tom Rix + + * aix5ppc.core.c : New file for AIX 5 64 bit core support. + * bfd-in.h : Add bfd_xcoff_ar_archive_set_magic declaration. + * coff-rs6000 (do_pad) : New function for archive padding. + (do_copy) : New function for object file copying in archives. + (do_shared_object_padding) : New function for padding shared + objects to their text section alignment in archives. + (bfd_xcoff_ar_achive_set_magic) : Stub. + (xcoff_write_armap_big) : Use do_copy and do_pad. + (xcoff_write_archive_contents_big) : Use do_shared_object_padding, + do_copy and do_pad. + * coff64-rs6000.c (xcoff64_write_ojbect_contents) : Use + bfd_xcoff_magic_number. + (xcoff64_bad_format_hook) : New function for _bfd_bad_format_hook + fop. + (xcoff_backend_data_r) : Use xcoff64_bad_format_hook. + (bfd_xcoff_aix5_backend_data) : New Aix 5 backend data. + (aix5coff64_vec) : New Aix 5 target aix5coff64-rs6000. + * rs6000-core.c : Update copyright date. + * xcofflink.c (bfd_xcoff_size_dynamic_sections): Check for NULL + csectpp. + * coffcode.h (coff_new_section_hook) : Use new accessor macros. + (coff_set_arch_mach_hook) : Add Aix 5 U64_TOCMAGIC magic #. + (coff_set_flags) : Use bfd_xcoff_magic_number. + * libxcoff.h (bfd_xcoff_is_xcoff64): Add U64_TOCMAGIC. + * configure.in : Add powerpc-*-aix5 and rs6000-*-aix5 support. + * Makefile.am : Same. + * config.bfd : Same. + * targets.c : Same. + * configure : Regnerate. + * Makefile.in : Same. + * bfd-in2.h : Same. + +2002-03-18 Nick Clifton + + * po/fr.po: Updated version. + +2002-03-18 Alan Modra + + * libbfd.c (bfd_write_bigendian_4byte_int): Return true iff success. + * libbfd.h: Regenerate. + * archive.c (coff_write_armap): Pass on failures from + bfd_write_bigendian_4byte_int. + +2002-03-14 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the BFD + error to bfd_error_nonrepresentable_section for reinit_array + section in DSO. + +2002-03-14 Nick Clifton + + * coffcode.h (coff_slurp_symbol_table): When adding BSF_WEAK flag, + OR it in rather than replacing previously selected flags. + + * elfxx-target.h (TARGET_BIG_SYM): Set ar_max_namelen to 15. + (TARGET_LITTLE_SYM): Set ar_max_namelen to 15. + +2002-03-14 Alan Modra + + * cpu-mips.c (mips_compatible): New. Don't check bits_per_word. + (N): Use the above. + * elflink.h (elf_bfd_final_link): Revert last change. Instead, + ensure reloc size matches before calling elf_link_input_bfd. + Add an assert to check reloc size when counting output relocs. + +2002-03-14 Nick Clifton + + * mmo.c (mmo_get_loc): Return NULL rather than false. + +2002-03-13 Nick Clifton + + * po/fr.po: Updated version. + +2002-03-13 Alan Modra + + * archures.c (bfd_default_compatible): Test bits_per_word. + * cpu-i386.c (i386_compatible): Remove. Replace occurrences with + bfd_default_compatible. + * cpu-i370.c (i370_compatible): Likewise. + * cpu-sparc.c (sparc_compatible): Likewise. + * cpu-h8300.c (compatible): Test in->arch == out->arch. + + * elflink.h: Formatting fixes. + (elf_link_output_extsym): Merge undefined and undef weak cases. + + * elflink.h (elf_bfd_final_link): Only call elf_link_input_bfd + when word size of input matches output word size. + +2002-03-12 Andreas Jaeger + + * cpu-i386.c (i386_compatible): New. Use it instead of + bfd_default_compatible. + +2002-03-07 H.J. Lu (hjl@gnu.org) + + * coff-sh.c (shcoff_reloc_map): Use bfd_reloc_code_real_type + as the type for bfd_reloc_val. + +2002-03-05 John David Anglin + + * elf-hppa.h (elf_hppa_is_dynamic_loader_symbol): New function. + (elf_hppa_relocate_section): Ignore undefined dynamic loader symbols. + (elf_hppa_final_link_relocate): Correct relocations for indirect + references to local data through the DLT. Fix .opd creation for + local symbols using R_PARISC_LTOFF_FPTR32 and R_PARISC_FPTR64 + relocations. Use e_lsel selector for R_PARISC_DLTIND21L, + R_PARISC_LTOFF_FPTR21L and R_PARISC_LTOFF_TP21L as per + "Processor-Specific ELF for PA_RISC, Version 1.43" document. + Similarly, use e_rsel for DLT and LTOFF 'R' relocations. + * elf32-hppa.c (final_link_relocate): Revise relocation selectors + as per "Processor-Specific ELF for PA_RISC, Version 1.43" document. + +2002-03-05 Jakub Jelinek + + * merge.c (_bfd_merge_sections): Don't segfault if there + is nothing to merge due to GC. + +2002-03-05 Alan Modra + + * elf32-hppa.c (clobber_millicode_symbols): Remove hack to keep + symbols that have been forced local. + + * elflink.h (elf_bfd_final_link): Call elf_link_output_extsym + to output forced local syms for non-shared link. + (elf_link_output_extsym): Tweak condition for calling backend + adjust_dynamic_symbol so that previous behaviour is kept. + Whitespace changes throughout file. + +2002-03-04 H.J. Lu + + * elf.c (bfd_section_from_shdr): Handle special sections, + .init_array, .fini_array and .preinit_array. + (elf_fake_sections): Likewise. + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Create the + DT entry only if the section is in output for .init_array, + .fini_array and .preinit_array. Complain about .preinit_array + section in DSO. + (elf_bfd_final_link): Warn zero size for .init_array, + .fini_array and .preinit_array sections. + + * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Remove + SHT_INIT_ARRAY, SHT_FINI_ARRAY and SHT_PREINIT_ARRAY. + (elfNN_ia64_fake_sections): Remove .init_array, .fini_array and + .preinit_array. + +2002-03-04 Alan Modra + + * configure.in (WIN32LIBADD): Don't eval PICFLAG assignment. + * configure: Regenerate. + +2002-03-02 Tom Rix + + * coff64-rs6000.c (xcoff64_howto_table): Replace howto types with + symbolic equiv. + * coff-rs6000.c (xcoff_howto_table): Same. + +2002-03-01 David Mosberger + + * elflink.h (size_dynamic_sections): If section named + ".preinit_array" exists, create DT_PREINIT_ARRAY and + DT_PREINIT_ARRAYSZ entries in dynamic table. Analogously for + ".init_array" and ".fini_array". + (elf_bfd_final_link): Handle DT_PREINIT_ARRAYSZ, DT_INIT_ARRAYSZ, + DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY, DT_INIT_ARRAY, and + DT_FINI_ARRAY. + +2002-02-26 Andrew Macleod + + * elflink.h (elf_bfd_final_link): Don't crash on SHN_UNDEF local + dynsyms. + +2002-02-25 Alan Modra + + * elf64-hppa.h: Update copyright date. + + * elf64-ppc.c (ppc64_elf_check_relocs): Warning fix. + (ppc64_elf_relocate_section): Don't generate power4 style branch + hints for *_BRTAKEN and *_BRNTAKEN relocs. + +2002-02-22 Jakub Jelinek + + * elf64-sh64.c (sh_elf64_relocate_section): Fix a typo from my + last patch. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + +2002-02-21 Andreas Jaeger + + * elf64-x86-64.c: Major rework that introduces all recent changes + to the x86-64 backend. Get a closer match to elf32-i386. + (struct elf64_x86_64_dyn_relocs): Rename from + elf64_x86_64_pcrel_relocs_copied, add additional fields. Change + all users. + (struct elf64_x86_64_link_hash_table): Add short cuts to some + sections. + (link_hash_newfunc): Rename from elf64_x86_64_link_hash_newfunc, + remove casts, initialize new hash members. + (create_got_section): New. + (elf64_x86_64_create_dynamic_sections): New. + (elf64_x86_64_copy_indirect_symbol): New. + (elf64_x86_64_check_relocs): Don't allocate space for dynamic + relocs, .got or .relgot here but do it in allocate_dynrelocs. + Reference count possible .plt and .got entries. Don't test input + section SEC_READONLY here to try to avoid copy relocs, and keep + dyn_relocs regardless of ELF_LINK_NON_GOT_REF. Don't set + DF_TEXTREL here. Delay setting of variables until needed. Cache + pointer to "sreloc" section in elf_section_data. Tweak condition + under which .got created. Report files with bad relocation + section names. + (elf64_x86_64_gc_sweep_hook): Sweep dyn_relocs and local_dynrel. + Reference count possible .plt entries. Don't deallocate .got and + .relgot space here. + (elf64_x86_64_adjust_dynamic_symbol): Handle nocopyreloc. Don't + do copy reloc processing for weakdefs. Remove redundant casts and + aborts. Delay setting of vars until needed. Move creation of + dynamic symbols and allocation of .plt and .rela.plt to + allocate_dynrelocs. Replace BFD_ASSERT with abort. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New. + (allocate_dynrelocs): New. + (readonly_dynrelocs): New. + (elf64_x86_64_size_dynamic_sections): Call readonly_dynrelocs. + Allocate space for dyn relocs. Replace BFD_ASSERT with abort. + Zero out the dynamic allocated content space. + (elf64_x86_64_discard_copies): Removed. + (elf64_x86_64_relocate_section): Make use of dynamic section + short-cuts. Localise vars, and delay setting. Better error + reporting, replace BFD_ASSERT with abort. Check + ELF_LINK_HASH_DEF_DYNAMIC to see if a symbol is not defined in the + regular object file and tread the weak definition as the normal + one. Don't discard relocs for undefweak or undefined symbols and + check !DEF_REGULAR as well as DEF_DYNAMIC in test for avoided copy + relocs. + (elf64_x86_64_finish_dynamic_symbol): Don't copy relocs for + symbols that have been forced local. Use same test to decide if + we can use a relative reloc for got as relocate_section. Expand + SHN_UNDEF comment. Move expressions out of function calls. + Replace BFD_ASSERT with abort. + (bfd_elf64_bfd_final_link): Removed. + (elf_backend_copy_indirect_symbol): Define. + +2002-02-20 Tom Rix + + * coff-rs6000.c (xcoff_howto_table): Add 16 bit R_BA. + (_bfd_xcoff_reloc_type_lookup): Use it. + * coff64-rs6000.c (xcoff64_howto_table): Same. + (xcoff64_reloc_type_lookup): Same. + +2002-02-20 Peter Schauer + + * osf-core.c (osf_core_vec): OSF/1 (Digital Unix) core files are + little endian. + +2002-02-19 Martin Schwidefsky + + * archures.c (bfd_mach_s390_esa): Rename to bfd_mach_s390_31. + (bfd_mach_s390_esame): Rename to bfd_mach_s390_64. + * bfd-in2.h: Regenerate. + * cpu-s390.c (arch_info_struct): Use renamed architecture defines. + Replace architecture name "s390" with "s390:31-bit" and "s390:esame" + with "s390:64-bit". + * elf32-s390.c (elf_howto_table): Add 32 bit pc relative relocations. + (elf_s390_reloc_type_lookup): Likewise. + (elf_s390_check_relocs): Likewise. + (elf_s390_gc_sweep_hook): Likewise. + (elf_s390_relocate_section): Likewise. + (elf_s390_object_p): Use renamed architecture define. + * elf64-s390.c (elf_s390_object_p): Use renamed architecture define. + +2002-02-19 Frank Ch. Eigler + + * syms.c (stt[]): Sorted. Added .init/.fini -> "t" mapping. + +2002-02-19 Jakub Jelinek + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Enable + absptr -> pcrel optimization for shared libs. + Only create minimal .eh_frame_hdr if absptr FDE encoding in shared + library cannot be converted to pcrel. + (_bfd_elf_eh_frame_section_offset): Return -2 if making absptr + relative. + * elf32-i386.c (elf_i386_relocate_section): If + _bfd_elf_section_offset returned -2, skip, but make sure the + relocation is installed. + * elf32-arm.h (elf32_arm_final_link_relocate): Likewise. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Handle + _bfd_elf_section_offset returning -2 the same way as -1. + * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Likewise. + * elf32-mips.c (mips_elf_create_dynamic_relocation): Add FIXME + and BFD_ASSERT. + * elf64-mips.c (mips_elf64_create_dynamic_relocation): Likewise. + +2002-02-18 Tom Rix + + * xcofflink.c (bfd_xcoff_link_gernate_rtinit): Add -brtl support. + (bfd_xcoff_size_dynamic_sections): Same. + * bfd-in.h (bfd_xcoff_link_generate_rtinit): Same. + (bfd_xcoff_size_dynamic_sections): Same. + * coff-rs6000.c (xcoff_generate_rtinit): Same. + * coff-rs646000.c (xcoff64_generate_rtinit): Same. + * libxcoff.h (struct xcoff_backend_data_rec): Same. + * xcofflink.c (xcoff_build_ldsyms, xcoff_link_add_symbols): Clean. + * bfd-in2.h: Regenerate. + +2002-02-18 Alan Modra + + * elf64-ppc.c (STFD_FR0_0R1, LFD_FR0_0R1, BLR): Define. + (struct ppc_link_hash_table): Add sfpr. + (ppc64_elf_link_hash_table_create): Init it. + (ppc64_elf_create_dynamic_sections): Split creation of .stub and + .glink out to.. + (create_linkage_sections): ..here. Make .sfpr too. + (ppc64_elf_check_relocs): Call create_linkage_sections, and set + dynobj early. + (MIN_SAVE_FPR, MAX_SAVE_FPR): Define. + (ppc64_elf_func_desc_adjust): Look for missing ._savef* and + ._restf* functions, and create as needed. + (func_desc_adjust): Only force_local for shared libs. + +2002-02-18 David O'Brien + + * configure.in: Bump version number post 2.12 branching. + * configure: Regenerate. + +2002-02-17 Hans-Peter Nilsson + + * mmo.c: Correct and improve comments. + (mmo_write_chunk): Store trailing byte in bfd buffer; don't + zero-pad. Use input to fill up non-empty bfd buffer. + (mmo_flush_chunk): New function. + (mmo_write_loc_chunk): Add parameter last_vmap, all callers + changed. Don't emit location specifier if VMA is same as + *LAST_VMAP after omitting leading zero contents. Call + mmo_flush_chunk before emitting location specifier. + (mmo_write_loc_chunk_list): Call mmo_flush_chunk when finished + with mmo_write_loc_chunk calls. + (mmo_internal_write_section): Call mmo_flush_chunk after + mmo_write_chunk. + (mmo_write_symbols_and_terminator): Move :Main to first position + in symbol array. Add faked one if it does not exist if there are + other symbols. Don't add it if there are no symbols at all. Move + out test for value of :Main from symbol loop. Rename table + fakemain to maintable and variable mainsym to fakemain. + +2002-02-15 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: A target + section with no got matches any got. Simplify error generaion. + +2002-02-15 Alan Modra + + Support arbitrary length fill patterns. + * linker.c (bfd_new_link_order): Zero all fields with bfd_zalloc. + (_bfd_default_link_order): Remove bfd_fill_link_order code. + Call default_data_link_order. + (default_fill_link_order): Delete. + (default_data_link_order): New function. + * elf32-mips.c (_bfd_mips_elf_final_link): Replace occurrences + of bfd_fill_link_order with bfd_data_link_order. + * elf64-alpha.c (elf64_alpha_final_link): Likewise. + * elf64-mips.c (mips_elf64_final_link): Likewise. + + * bfd.c (bfd_scan_vma): Clamp overflows to max bfd_vma value. + Correct value returned in "end" for "0x". + +2002-02-14 Nick Clifton + + * cpu-arm.c (processors): Replace 'arch' field with 'mach'. + (scan): Test against 'mach' field in info structure. + +2002-02-14 Alan Modra + + * elf.c (elf_fake_sections): Use SHT_NOBITS when SEC_NEVER_LOAD. + +2002-02-14 Matt Fredette + + * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Recognize + EF_M68000. + +2002-02-13 Nick Clifton + + * elf.c (_bfd_elf_make_section_from_shdr): Do not insist on + non-zero physical addresses when adjusting the LMAs of new + sections. + +2002-02-12 John David Anglin + + * elf-hppa.h (elf_hppa_reloc_final_type): New function stripped + from _bfd_elf_hppa_gen_reloc_type. + (_bfd_elf_hppa_gen_reloc_type): Remove duplicate prototype. + * elf32-hppa.h (elf32_hppa_reloc_final_type): Add protptype. + * elf32-hppa.c: Include elf32-hppa.h before elf-hppa.h. + * elf64-hppa.h (elf64_hppa_reloc_final_type): Add protptype. + +2002-02-12 Alexandre Oliva + + * elf-m10300.c (mn10300_elf_relax_section): Skip section before + loading its contents if there's nothing to do in it. + +2002-02-12 Alan Modra + + * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for crossing + 64k boundary. + + * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Add dynamic + DT_PPC64_OPD and DT_PPC64_OPDSZ tags. + (ppc64_elf_finish_dynamic_sections): Set values for them. + +2002-02-11 Michael Snyder + + * elf-bfd.h (elfcore_write_lwpstatus): Add prototype. + * elf.c (elfcore_grok_pstatus): Add prototype. + (elfcore_grok_lwpstatus): Add prototype. + (elfcore_write_lwpstatus): New function. + (elfcore_write_pstatus): Fix typo, eliminate unnecessary memcpy. + +2002-02-11 Alexandre Oliva + + * elf32-sh.c: Added missing prototypes. + * elf32-sh64.c: Likewise. + (sh_elf_align_loads): Mark unused args as such. + * elf64-sh64.c: Added missing prototypes. + (struct elf_sh64_link_hash_entry): Fix typo. + (sh_elf64_relocate_section): Fix info argument passed to + _bfd_elf_section_offset. + +2002-02-11 Alan Modra + + * Makefile.am: "make dep-am". + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * configure: Regenerate. + +2002-02-10 Daniel Jacobowitz + + * coff-rs6000.c (xcoff_generate_rtinit): Silence uninitialized + variable warnings. + * elf32-sh.c (sh_elf_relax_section): Silence signed/unsigned + comparison warning. + * trad-core.c (trad_unix_core_file_p): Silence pointer/integer + cast warnings for the common case. + +2002-02-10 Hans-Peter Nilsson + + * config.bfd (sh-*-linux*, sh-*-elf* | sh-*-rtemself*): Add sh64 + vectors. + (sh-*-netbsdelf*): New, to trump sh*-*-netbsdelf* and add sh64 + vectors. + +2002-02-09 Richard Henderson + + * elf64-alpha.c (elf64_alpha_howto): Add R_ALPHA_BRSGP. + (elf64_alpha_reloc_map, elf64_alpha_check_relocs): Likewise. + (elf64_alpha_relocate_section): Likewise. + * reloc.c (BFD_RELOC_ALPHA_BRSGP): New. + * bfd-in2.h, libbfd.h: Rebuild. + +2002-02-09 Hans-Peter Nilsson + + * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs): Check + that base-plus-offset reloc accounting is consistent. + (mmix_elf_relax_section): Keep base-plus-offset reloc accounting + up to date for undefined symbols. + +2002-02-08 Eric Christopher + + From Rainer Orth + + * elf32-mips.c (_bfd_mips_elf_fake_sections): Don't create .rela + sections for the O32 ABI. + +2002-02-08 Chris Demetriou + + * elf32-arm.h: Fix formatting of _("..."). + * elf32-d10v.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mips.c: Likewise. + +2002-02-08 Ivan Guzvinec + + * coff-or32.c: Fix compile time warning messages. + +2002-02-08 Alexandre Oliva + + Contribute sh64-elf. + 2002-01-23 Alexandre Oliva + * reloc.c (R_SH_GOTPLT32, R_SH_GOT_LOW16, R_SH_GOT_MEDLOW16, + R_SH_GOT_MEDHI16, R_SH_GOT_HI16, R_SH_GOTPLT_LOW16, + R_SH_GOTPLT_MEDLOW16, R_SH_GOTPLT_MEDHI16, R_SH_GOTPLT_HI16, + R_SH_PLT_LOW16, R_SH_PLT_MEDLOW16, R_SH_PLT_MEDHI16, + R_SH_PLT_HI16, R_SH_GOTOFF_LOW16, R_SH_GOTOFF_MEDLOW16, + R_SH_GOTOFF_MEDHI16, R_SH_GOTOFF_HI16, R_SH_GOTPC_LOW16, + R_SH_GOTPC_MEDLOW16, R_SH_GOTPC_MEDHI16, R_SH_GOTPC_HI16, + R_SH_GOT10BY4, R_SH_GOTPLT10BY4, R_SH_GOT10BY8, R_SH_GOTPLT10BY8, + R_SH_COPY64, R_SH_GLOB_DAT64, R_SH_JMP_SLOT64, R_SH_RELATIVE64): + New relocs. + * libbfd.h, bfd-in2.h: Rebuilt. + * elf32-sh.c (sh_elf_howto_table): Define new relocs. + (sh_reloc_map): Map them. + (PLT_ENTRY_SIZE, elf_sh_plt0_entry_be, elf_sh_plt0_entry_le, + elf_sh_plt_entry_be, elf_sh_plt_entry_le, elf_sh_pic_plt_entry_be, + elf_sh_pic_plt_entry_le, elf_sh_plt0_entry, elf_sh_plt_entry, + elf_sh_pic_plt_entry, elf_sh_sizeof_plt, elf_sh_plt_plt0_offset, + elf_sh_plt0_gotplt_offset, elf_sh_plt_temp_offset, + elf_sh_plt_symbol_offset, elf_sh_plt_reloc_offset, + movi_shori_putval) [INCLUDE_SHMEDIA]: New. + (elf_sh_link_hash_entry) [INCLUDE_SHMEDIA]: Add + datalabel_got_offset. + (sh_elf_link_hash_newfunc): Initialize it. + (sh_elf_relocate_section): Augment the scope of + seen_stt_datalabel. Introduce GOTPLT support. Extend GOTPC, PLT, + GOT and GOTOFF handling to new SHmedia relocation types. Support + GOT_BIAS. + (sh_elf_check_relocs): Likewise. + (sh_elf_finish_dynamic_symbol) [TARGET_SHMEDIA]: Set up values in + PLT entries using movi_shori_putval. Support GOT_BIAS. + (sh_elf_finish_dynamic_sections): Likewise. + * elf32-sh64.c (shmedia_prepare_reloc): Do not add addend to + relocation, it's now done by the caller. + (GOT_BIAS): New. + * elf64-sh64.c (GOT_BIAS, PLT_ENTRY_SIZE, elf_sh64_sizeof_plt, + elf_sh64_plt_plt0_offset, elf_sh64_plt0_gotplt_offset, + elf_sh64_plt_temp_offset, elf_sh64_plt_symbol_offset, + elf_sh64_plt_reloc_offset, ELF_DYNAMIC_INTERPRETER, + elf_sh64_pcrel_relocs_copied, elf_sh64_link_hash_entry, + elf_sh64_link_hash_table, sh64_elf64_link_hash_traverse, + sh64_elf64_hash_table): New. + (sh_elf64_howto_table): Introduce new relocs. + (sh_elf64_info_to_howto): Accept new PIC relocs. + (sh_elf64_relocate_section): Augment the scope of + seen_stt_datalabel. Support new PIC relocs. + (sh_elf64_check_relocs): Support new PIC relocs. + (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le, + elf_sh64_plt_entry_be, elf_sh64_plt_entry_le, + elf_sh64_pic_plt_entry_be, elf_sh64_pic_plt_entry_le, + elf_sh64_plt0_entry, elf_sh64_plt_entry, elf_sh64_pic_plt_entry, + sh64_elf64_link_hash_newfunc, sh64_elf64_link_hash_table_create, + movi_shori_putval, movi_3shori_putval, + sh64_elf64_create_dynamic_sections, + sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, + sh64_elf64_size_dynamic_sections, + sh64_elf64_finish_dynamic_symbol, + sh64_elf64_finish_dynamic_sections): New. + (elf_backend_create_dynamic-sections, + bfd_elf64_bfd_link_hash_table_create, + elf_backend_adjust_dynamic_symbol, + elf_backend_size_dynamic_sections, + elf_backend_finish_dynamic_symbol, + elf_backend_finish_dynamic_sections, elf_backend_want_got_plt, + elf_backend_plt_readonly, elf_backend_want_plt_sym, + elf_backend_got_header_size, elf_backend_plt_header_size): + Define. + 2001-05-16 Alexandre Oliva + * elf32-sh.c: Renumbered and renamed some SH5 relocations to + match official numbers and names; moved unmaching ones to the + range 0xf2-0xff. + * elf32-sh64.c, elf64-sh64.c: Likewise. + 2001-03-12 DJ Delorie + * elf32-sh.c (sh_elf_relax_section): Don't relax SHmedia + sections. + 2001-03-12 DJ Delorie + * elf32-sh64.c (shmedia_prepare_reloc): Validate relocs that must + be aligned. + * elf64-sh64.c (sh_elf64_relocate_section): Ditto. + 2001-01-14 Hans-Peter Nilsson + * elf32-sh64.c (bfd_elf32_bfd_copy_private_section_data): Define. + (sh64_elf_fake_sections): Set type to SHT_SH5_CR_SORTED for a + .cranges section with SEC_SORT_ENTRIES set. + (sh64_backend_section_from_shdr): Set SEC_SORT_ENTRIES on an + incoming sorted .cranges section. + (sh64_bfd_elf_copy_private_section_data): New. + (sh64_elf_final_write_processing): Only sort .cranges and modify + start address if called by linker. + 2001-01-08 Ben Elliston + * elf32-sh64.c (sh64_elf_final_write_processing): Activate + Hans-Peter Nilsson's set bit 0 patch from 2001-01-06. + * elf64-sh64.c (sh64_elf64_final_write_processing): Ditto. + 2001-01-06 Hans-Peter Nilsson + * elf64-sh64.c (sh_elf64_howto_table): No open brace at start of + line. Add comments before all entries. + : Correct and clarify describing + comment. + (sh_elf64_reloc): Correct head comment. + (sh_elf64_relocate_section): Correct spacing. + : Do not honour STO_SH5_ISA32; + instead call reloc_dangerous callback. + : New case. + (sh_elf64_gc_mark_hook): Correct spacing. + (sh_elf64_check_relocs): Ditto. + * elf32-sh64.c (shmedia_prepare_reloc) : + New case. + * elf32-sh.c: Correct #endif comments for #ifndef-wrapped + functions. + (sh_elf_howto_table) : Correct, + clarify describing comment. Add comments before all entries. + (sh_elf_relocate_section) : Do not + honour STO_SH5_ISA32; instead call reloc_dangerous callback. + 2001-01-06 Hans-Peter Nilsson + Sort .cranges section in final link. Prepare to set bit 0 on + entry address. + * elf32-sh64.c (struct sh64_find_section_vma_data): New. + (sh64_elf_link_output_symbol_hook): Fix typo in prototype. + (sh64_elf_set_mach_from_flags): Set SEC_DEBUGGING on incoming + .cranges section. + (sh64_backend_section_from_shdr): New, to recognize + SHT_SH5_CR_SORTED on incoming .cranges section. + (elf_backend_section_from_shdr): Define. + (sh64_elf_final_write_processing): Sort outgoing .cranges + section. (New, temporarily disabled:) Set bit 0 on entry address + according to ISA type. + (sh64_find_section_for_address): New. + (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb, + crange_bsearch_cmpl): Move here from opcodes/sh64-dis.c. + (sh64_address_in_cranges): Move here from opcodes/sh64-dis.c. Use + bfd_malloc, not xmalloc. + (sh64_get_contents_type): Move here from opcodes/sh64-dis.c. Make + global. + * elf32-sh64.c (sh64_elf64_final_write_processing): New, (but + temporarily disabled) setting bit 0 on entry address. + (elf_backend_final_write_processing): Define. + 2001-01-05 Hans-Peter Nilsson + * elf32-sh.c (sh_elf_howto_table) : Adjust fields to + be a proper relocation for PTA and PTB rather than a marker. + : + Zero src_mask. + * elf64-sh64.c: Ditto. + (sh_elf64_relocate_section) : New case. + * elf32-sh64.c: Include opcodes/sh64-opc.h + (shmedia_prepare_reloc): Take a bfd_link_info pointer as first + argument. Drop const qualifiers from "bfd *" and "bfd_byte *" + parameters. No unused parameters. Caller changed. + : New case. + * Makefile.am (elf32-sh64.lo): Add dependency on sh64-opc.h. + * Makefile.in: Regenerate. + 2000-12-30 Hans-Peter Nilsson + * elf64-sh64.c (sh64_elf64_fake_sections): Set SHF_SH5_ISA32 for + all code sections. + (sh_elf64_set_mach_from_flags): Change from EF_SH64 to EF_SH5. + (sh64_elf_merge_private_data): Ditto. + * elf32-sh64.c (sh64_elf_fake_sections): Use sh64_elf_section_data + to access stored section flags. + (sh64_elf_final_write_processing): Return immediately unless + called by linker. Use sh64_elf_section_data (cranges) to get size + of linker-generated cranges entries. + (sh64_elf_copy_private_data): Add missing "return true". + (sh64_elf_set_mach_from_flags): Change from EF_SH64 to EF_SH5. + (sh_elf64_merge_private_data): Ditto. + 2000-12-19 Hans-Peter Nilsson + * elf64-sh64.c (sh64_elf64_fake_sections): New, copy of + elf64-sh64.c:sh64_elf_fake_sections. + (elf_backend_fake_sections): Define as sh64_elf64_fake_sections. + 2000-12-18 Hans-Peter Nilsson + * elf32-sh64.c (sh64_elf_copy_private_data_internal): Delete. + (sh64_elf_final_write_processing): New. + (elf_backend_final_write_processing): Define. + (sh64_elf_fake_sections): Get header flags from tdata field. + (sh64_elf_copy_private_data): Do not call + sh64_elf_copy_private_data_internal, just copy e_flags field. + (sh64_elf_merge_private_data): Do not call + sh64_elf_copy_private_data_internal. + 2000-12-12 Hans-Peter Nilsson + Remove EF_SH64_ABI64, let ELF size make difference. + Remove SH64-specific BFD section flag. + * elf32-sh64.c (sh64_elf_fake_sections): Recognize section as + containing SHmedia through elf_section_data (asect)->tdata + non-zero, not using a BFD section flag. + (sh64_elf_set_mach_from_flags): Don't recognize EF_SH64_ABI64. + (sh64_elf_merge_private_data): Similar. + (elf_backend_section_flags): Don't define. + (sh64_elf_backend_section_flags): Delete. + * elf64-sh64.c (sh_elf64_set_mach_from_flags): Recognize EF_SH64, + not EF_SH64_ABI64. + (sh_elf64_merge_private_data): Similar. + * section.c (Section flags definitions): Don't define + SEC_SH_ISA_SHMEDIA. + (bfd-in2.h): Regenerate. + 2000-12-09 Hans-Peter Nilsson + Make DataLabel references work with partial linking. + * elf32-sh64.c: Fix formatting. + (sh64_elf_link_output_symbol_hook): New. + (elf_backend_link_output_symbol_hook): Define to + sh64_elf_link_output_symbol_hook. + (sh64_elf_add_symbol_hook): Make DataLabel symbol just global + undefined if partial linking. Adjust sanity check. + * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): New. + (elf_backend_link_output_symbol_hook): Define to + sh64_elf64_link_output_symbol_hook. + (sh64_elf64_add_symbol_hook): Make DataLabel symbol just global + undefined if partial linking. Adjust sanity check. + 2000-12-07 Hans-Peter Nilsson + Implement semantics for inter-file DataLabel references. + * elf64-sh64.c (DATALABEL_SUFFIX): Define. + (sh64_elf64_add_symbol_hook): New. + (sh_elf64_relocate_section): If passing an indirect symbol with + st_type STT_DATALABEL on the way to a symbol with st_other + STO_SH5_ISA32, do not bitor 1 to the relocation. + (elf_backend_add_symbol_hook): Define to + sh64_elf64_add_symbol_hook. + * elf64-sh32.c: Tweak comments. + (DATALABEL_SUFFIX): Define. + (sh64_elf_add_symbol_hook): New. + (elf_backend_add_symbol_hook): Define to sh64_elf_add_symbol_hook. + * elf32-sh.c (sh_elf_relocate_section): If passing an indirect + symbol with st_type STT_DATALABEL on the way to a symbol with + st_other STO_SH5_ISA32, do not bitor 1 to the relocation. + 2000-12-05 Hans-Peter Nilsson + Pass through STT_DATALABEL. + * elf32-sh64.c (sh64_elf_get_symbol_type): New. + (elf_backend_get_symbol_type): Define. + * elf64-sh64.c (sh64_elf64_get_symbol_type): New. + (elf_backend_get_symbol_type): Define. + 2000-11-30 Hans-Peter Nilsson + * elf32-sh64.c: Tweak comments. + (sh64_elf_copy_private_data_internal): Add prototype. + (bfd_elf32_bfd_set_private_flags): Define. + (sh64_elf_copy_private_data_internal): Compare machine name, not + textual BFD target name, to check whether to copy section flag + SHF_SH5_ISA32. + (sh64_elf_merge_private_data): Validize bfd_get_arch_size. + Tweak section-contents-type-mismatch message. + (shmedia_prepare_reloc): Add ATTRIBUTE_UNUSED markers. + Validize reloc-types. + * elf64-sh64.c: New file. + * targets.c (bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec): Declare. + * Makefile.am (BFD64_BACKENDS): Add elf64-sh64.lo. + (BFD64_BACKENDS_CFILES): Add elf64-sh64.c. + Regenerate dependencies. + * Makefile.in: Regenerate. + * config.bfd (sh64-*-elf*): Add bfd_elf64_sh64_vec and + bfd_elf64_sh64l_vec. + * configure.in: Handle bfd_elf64_sh64_vec and + bfd_elf64_sh64l_vec. + * configure: Regenerate. + * po/POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. + 2000-11-29 Hans-Peter Nilsson + * elf32-sh64.c (sh64_elf_set_mach_from_flags): Do not recognize + anything else but EF_SH64 and EF_SH64_ABI64. + (sh64_elf_merge_private_data): Emit error for anything else but + EF_SH64 and EF_SH64_ABI64. + * config.bfd: Remove bfd_elf32_shblin_vec and bfd_elf32_shlin_vec + from targ_selvecs. + * configure.in: Add cofflink.lo to bfd_elf32_sh64_vec and + bfd_elf32_sh64l_vec as a temporary measure. + * configure: Regenerate. + 2000-11-27 Hans-Peter Nilsson + * cpu-sh.c (arch_info_struct): Include sh5 item + unconditionalized. + * config.bfd (sh64-*-elf*): Do not set targ_cflags. + Add targ_selvecs bfd_elf32_sh_vec, bfd_elf32_shl_vec, + bfd_elf32_shblin_vec and bfd_elf32_shlin_vec. + * elf32-sh64.c: Tweak comments. + (sh64_elf_set_mach_from_flags): Recognize all machine flags that + are proper subsets of SH64 as bfd_mach_sh5. Add EF_SH64_ABI64. + (sh64_elf_copy_private_data_internal): Wrap long line. + (sh64_elf_merge_private_data): Rewrite to allow objects from + SH64 subsets to be linked together. + (INCLUDE_SHMEDIA): Define. + * elf32-sh.c (sh_elf_relocate_section) : + Parenthesize plus-expression inside or-expression. + : Ditto. + (sh_elf_set_mach_from_flags): Remove code refusing + deleted EF_SH64_32BIT_ABI flag. + 2000-11-26 Hans-Peter Nilsson + * elf32-sh.c (sh_elf_howto_table) : Set pcrel_offset to true. + (sh_elf_relocate_section) : Or 1 in + calculation of relocation if sym->st_other & STO_SH5_ISA32. + : Ditto if h->other & STO_SH5_ISA32. + * elf32-sh64.c (shmedia_prepare_reloc): Add rel->r_addend to + relocation. + 2000-11-24 Hans-Peter Nilsson + * Makefile.am (BFD32_BACKENDS): Add elf32-sh64.lo. + (BFD32_BACKENDS_CFILES): Add elf32-sh64.c. + Regenerate dependencies. + * Makefile.in: Regenerate. + * archures.c: Add bfd_mach_sh5. + * config.bfd: Map targ_cpu sh* to bfd_sh_arch. + Handle sh64-*-elf*. Set targ_cflags to -DINCLUDE_SHMEDIA. + * configure.in: Handle bfd_elf32_sh64_vec and bfd_elf32_sh64l_vec. + * configure: Regenerate. + * reloc.c (BFD_RELOC_SH_SHMEDIA_CODE, BFD_RELOC_SH_IMMU5, + BFD_RELOC_SH_IMMS6, BFD_RELOC_SH_IMMS6BY32, BFD_RELOC_SH_IMMU6, + BFD_RELOC_SH_IMMS10, BFD_RELOC_SH_IMMS10BY2, + BFD_RELOC_SH_IMMS10BY4, BFD_RELOC_SH_IMMS10BY8, + BFD_RELOC_SH_IMMS16, BFD_RELOC_SH_IMMU16, BFD_RELOC_SH_IMM_LOW16, + BFD_RELOC_SH_IMM_LOW16_PCREL, BFD_RELOC_SH_IMM_MEDLOW16, + BFD_RELOC_SH_IMM_MEDLOW16_PCREL, BFD_RELOC_SH_IMM_MEDHI16, + BFD_RELOC_SH_IMM_MEDHI16_PCREL, BFD_RELOC_SH_IMM_HI16, + BFD_RELOC_SH_IMM_HI16_PCREL, BFD_RELOC_SH_PT_16): New relocations. + * cpu-sh.c [INCLUDE_SHMEDIA] (arch_info_struct): Define and link + in item for SH5. + * elf32-sh.c [INCLUDE_SHMEDIA] (sh_elf_howto_table): Add howto items + for SHmedia relocs. + [INCLUDE_SHMEDIA] (sh_rel): Add mappings for SHmedia relocs. + [INCLUDE_SHMEDIA] (sh_elf_relocate_section) [default]: Call + shmedia_prepare_reloc, goto final_link_relocate if it returns + non-zero, else fail as before. + (sh_elf_set_mach_from_flags): Provide function only if not defined + as macro. Do not recognize objects with EF_SH64_32BIT_ABI set. + (sh_elf_set_private_flags): Provide function only if not defined + as a macro. + (sh_elf_copy_private_data): Similar. + (sh_elf_merge_private_data): Similar. + * section.c (SEC_SH_ISA_SHMEDIA): New. + * targets.c (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec): Declare. + * elf32-sh64.c: New file. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * po/POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2002-02-07 Daniel Jacobowitz + + * bfd-in.h: Update check to only see if has + been included, not drag it in. + * bfd-in2.h: Regenerate. + +2002-02-06 H.J. Lu (hjl@gnu.org) + + * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Update + the mach and ISA fields if necessary. + +2002-02-06 Nick Clifton + + * coffcode.h (coff_set_arch_mach_hook): Select the highest known + ARM architecture when an F_ARM_5 flag is detected, since we cannot + be sure exactly which architecture this represents. + +2002-02-05 Nick Clifton + + * po/tr.po: Updated translation. + +2002-02-05 Alan Modra + + From Jimi X + * archures (bfd_mach_ppc64): Define. + (bfd_powerpc_arch): Rename to bfd_powerpc_archs. + (bfd_powerpc_arch): Define. + * bfd-in2.h: Regenerate. + * cpu-powerpc.c (arch_info_struct): Rename to bfd_powerpc_archs. + (bfd_powerpc_arch): Move to tail of bfd_powerpc_archs. + (bfd_powerpc_archs): Add default powerpc64 arch. + +2002-02-05 Alan Modra + + * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Check for relocs + against section syms in readonly sections. Don't do the global + sym check if we find one. + * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. + * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. + * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise. + * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. + (elf_s390_grok_prstatus): Add missing prototype. + +2002-02-04 Hans-Peter Nilsson + + * elf64-mmix.c (mmix_dump_bpo_gregs): New function. + (mmix_elf_check_common_relocs) : + Call bfd_get_section_by_name only once. Initialize + bpodata->n_bpo_relocs_this_section. + (_bfd_mmix_prepare_linker_allocated_gregs): Remove comment + referring to DSOs. + (bpo_reloc_request_sort_fn): Don't use difference of values as + return-value. + +2002-02-02 David O'Brien + + * configure.in: Tweak the FreeBSD 4.x recognition more. Only treat + version 4.5 and later the same as 5-CURRENT. + * configure: Re-generate. + +2002-02-02 Jason Thorpe + + * config.bfd (hppa*-*-netbsd*): New target. + +2002-01-31 Philipp Thomas + + * coff-arm.c (coff_arm_merge_private_bfd_data): Move ERROR + to front of message. Unify messages with elf32-arm.h. Use + commas where neccessary. + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Use all upcase + ERROR in messages. Unify messages with coff-arm.c. Correct + VFP/FPA error message. + (elf32_arm_print_private_bfd_data): Don't mark APCS-26 and + APCS-32 for translation. + +2002-02-01 Hans-Peter Nilsson + + Perform on-demand global register allocation from + R_MMIX_BASE_PLUS_OFFSET relocs. + * elf64-mmix.c (struct bpo_reloc_section_info, struct + bpo_reloc_request, struct bpo_greg_section_info): New. + (mmix_elf_check_common_relocs, mmix_elf_gc_sweep_hook, + bpo_reloc_request_sort_fn, mmix_elf_relax_section, + _bfd_mmix_check_all_relocs, + _bfd_mmix_prepare_linker_allocated_gregs, + _bfd_mmix_finalize_linker_allocated_gregs): New functions. + (elf_mmix_howto_table): Correct src_mask for most relocs. + (mmix_elf_perform_relocation) : New + case. + (mmix_final_link_relocate) : New + case. Fix typo in comment. New label do_mmix_reloc. + (mmix_elf_check_relocs): Abuse bfd_link_info member base_file to + store first object file with a base-plus-offset reloc. Call + mmix_elf_check_common_relocs for the part common with mmo. + (mmix_elf_final_link): Write out linker-allocated register + contents section. + (elf_backend_gc_sweep_hook): Define. + (bfd_elf64_bfd_relax_section): Define. + + * mmo.c: Don't include + (mmo_init): Correct init-once logic. + +2002-02-01 Tom Rix + + * config.bfd: Conditionally support for pre AIX 4.3. + +2002-02-01 Alan Modra + + * Makefile.am: Run "make dep-am" + * Makefile.in: Regenerate. + +2002-01-31 David O'Brien + + * configure.in: Recognize the differences in core files from FreeBSD + 4.{0,1} and later versions of 4.x. This treats 4.2+ the same as + 5-CURRENT. + * configure: Regenerate. + +2002-01-31 Ivan Guzvinec + + * coff-or32.c: New file. + * cpu-or32.c: New file. + * elf32-or32.c: New file. + * archures.c: Add support for or32. + * targets.c: Add support for or32. + * bfd-in2.h: Regenerate. + * coffcode.h (coff_set_arch_mach_hook, coff_set_flags, + coff_write_object_contents): Add support for or32. + * config.bfd: Add target. + * configure.in: Add support for or32. + * configure: Regenerate. + * Makefile.am: Add support for or32. + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Add or32 files. + * po/bfd.pot: Regenerate. + +2002-01-31 Nick Clifton + Don Lindsay + + * elf32-mips.c (mips_elf_calculate_relocation): Replace 'return + false' with a return of a bfd_reloc_ error code. + +2002-01-31 Hans-Peter Nilsson + + * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't + unexport unreferenced symbols when --export-dynamic. Call + _bfd_elf_strtab_delref when unexporting. + +2002-01-30 Daniel Jacobowitz + + * bfd-in.h: Include if it is available. + * bfd-in2.h: Regenerated. + +2002-01-31 Alan Modra + + * elf64-ppc.c (func_desc_adjust): STV_PROTECTED functions should + not go via the plt. + +2002-01-30 Nick Clifton + + * archures.c: Tidy up formatting of embedded comments. + * bfd.c: Tidy up formatting of embedded comments. + * bfd-in.h: Fix formatting of comments. + * reloc.c: Tidy up formatting of ordinary & embedded comments. + * section.c: Tidy up formatting of embedded comments. + * syms.c: Tidy up formatting of embedded comments. + * targets.c: Tidy up formatting of embedded comments. + + * bfd-in2.h: Regenerate. + +2002-01-30 Nick Clifton + + * vms-tir.c (cmd_name): New function. + (tir_cmd_name): New function. + (etir_sta, etir_sto, etir_opr, etir_stc): Use cmd_name(). + (tir_opr, tir_ctl, tir_cmd): use tir_cmd_name(). + Fix formatting. + + * peXXigen.c (pe_print_idata): Rearrange message to aid in + translation. + (pe_print_pdata): Rearrange message to aid in translation. + + * libbfd.c (warn_deprecated): Rearrange error message to aid in + translation. + + * ihex.c (ihex_write_object_contents): Fix spelling typo. + + * ieee.c (ieee_slurp_external_symbols): Remove spurious space. + + * elf64-sparc.c (sparc64_elf_add_symbol_hook): Rearrange error + message to aid in translation. + + * elf64-mmix.c (mmix_final_link_relocate): Rearrange error message + to aid in translation. + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix typo. + +2002-01-30 Philipp Thomas + + * coff-arm.c, elf32-elf.h: Unify messages. + +2002-01-30 Nick Clifton + + * po/sv.po: Updated translation. + +2002-01-30 Philipp Thomas + + * dwarf2.c (read_abbrev): Use full section name in error message. + (decode_line_info): Likewise. + + * elf.c (_bfd_elf_symbol_from_bfd_symbol): Don't translate debugging + message. + +2002-01-30 Alan Modra + + * elf64-ppc.c (func_desc_adjust): Only provide missing function + descriptor symbols for undefined function code syms. Clear + ELF_LINK_NON_ELF so that they can stay weak. + +2002-01-29 Chris Demetriou + Mitch Lichtenberg + + * bfd-in.h (bfd_mips_elf32_create_embedded_relocs): New prototype. + * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): New function + to handle 32-bit ELF embedded reloc (ld --embedded-relocs) + generation. + * bfd-in2.h: Regenerate. + +2002-01-29 Chris Demetriou + + * elf32-mips.c: Add additional comments about HI16 relocation + processing. + (_bfd_mips_elf_hi16_reloc): Don't subtract address here for + pc-relative relocations. (Reverts change made on 2001-10-31.) + (_bfd_mips_elf_lo16_reloc): Subtract address of LO16 part here + for pc-relative relocations. + (mips_elf_calculate_relocation): Add a comment about a kludge + in the R_MIPS_GNU_REL_HI16 handling. + (_bfd_mips_elf_relocate_section): Implement that kludge; + adjust pc-relative HI16 relocation for difference in HI16 and + LO16 addresses, since it can't easily be done in + mips_elf_calculate_relocation. + +2002-01-29 Martin Schwidefsky + + * elf32-i386 (elf_i386_adjust_dynamic_symbol): Do not replace PLT32 + relocations with PC32 relocations for undefined or weak symbols. + * elf32-s390 (elf_i386_adjust_dynamic_symbol): Likewise. + * elf64-s390x (elf_i386_adjust_dynamic_symbol): Likewise. + +2002-01-28 Jason Thorpe + + * elfcore.h (elf_core_file_p): Improve comment for last change. + +2002-01-27 Daniel Jacobowitz + + * configure: Regenerated. + +2002-01-27 Jason Thorpe + + * elfcore.h (elf_core_file_p): Set the machine architecture + before processing the program headers. + +2002-01-26 Hans-Peter Nilsson + + * configure.in <64-bit configuration>: If using gcc, check and + emit error for egcs-1.1.2. + * configure: Regenerate. + +2002-01-26 Egor Duda + + * elf.c (elfcore_grok_win32pstatus): Copy only as much information + as possible to avoid stack corruption. + +2002-01-26 Richard Henderson + + * elf64-alpha.c (elf64_alpha_check_relocs): Don't set reltext + for non-allocated sections. + +2002-01-25 Mark Kettenis + + * elf.c (elfcore_write_prstatus): Make sure we pass the address of + prstat.pr_reg even if it is a struct. + +2002-01-25 Steve Ellcey + + * elfxx-ia64.c: Reset AIX vector function overrides for HP-UX. + +2002-01-25 Philipp Thomas + + * coffgen.c (coff_print_symbol): Don't mark info message + for translation. + +2002-01-25 Nick Clifton + + * po/fr.po: Updated translation. + * po/es.po: Updated translation. + +2002-01-25 Philipp Thomas + + * coff-alpha.c (alpha_relocate_section): Unify warning message + for GP relative relocations without GP defined. + * coff-mips.c (mips_relocate_section): Likewise. + +2002-01-25 Alan Modra + + * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Avoid + unsigned overflow when new_offset < old_offset. + +2002-01-24 Philipp Thomas + + * bfd.c (_bfd_abort): Fix typo. + +2002-01-23 Richard Henderson + + * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't suppress + plt entries for undefweak symbols. + +2002-01-23 Steve Ellcey + + * targets.c (bfd_elf32_ia64_hpux_big_vec): Add to DEFAULT_VECTOR. + (bfd_elf64_ia64_hpux_big_vec): Ditto. + (bfd_elf32_h8300_vec): Ditto. + +2002-01-23 Alan Modra + + * elf64-ppc.c: Remove stale part of ABI comment. + (NO_OPD_RELOCS): Define. + (ppc64_elf_check_relocs): Use it. + (ppc64_elf_relocate_section): Here too. + (build_one_stub): Don't point function syms at the stub. Instead, + hijack plt.offset. + (ppc64_elf_relocate_section): Check whether REL24 relocs should + really go to the stub. Make all dynamic relocs in opd against + locals. + (ppc64_elf_finish_dynamic_symbol): Allow for non-standard use of + plt.offset. + +2002-01-22 Richard Henderson + + * elf64-alpha.c (INSN_UNOP): Encode with RB as $sp. + +2002-01-22 Alan Modra + + * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Correct sign of + TOC_BASE_OFF adjustment. + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2002-01-22 John David Anglin + + * configure.host (hppa*64*-*-hpux*, hppa*64*-*-linux*): Add new + host defines. + +2002-01-21 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) : + Check for and emit error if sgot is NULL at this point. + +2002-01-21 Jason Thorpe + + * config.bfd (ia64*-*-netbsd*): New target. + +2002-01-21 Thomas Klausner + + * som.c (som_write_space_strings): Comment typo fix. + +2002-01-21 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_entry): Add is_func and + is_func_descriptor fields. + (link_hash_newfunc): Init them. + (ppc64_elf_check_relocs): Only R_PPC24_REL24 syms starting with a + dot are candidates for plt entries. When processing .opd relocs, + set function descriptor strings to point inside function code + string, and set new ppc_link_hash_entry fields. + (ppc64_elf_gc_sweep_hook): Don't sweep R_PPC64_REL24 relocs. + (ppc64_elf_adjust_dynamic_symbol): Remove most code dealing with + function descriptors. It's now done in.. + (func_desc_adjust): New. + (ppc64_elf_func_desc_adjust): New. + (define elf_backend_always_size_sections): Define. + (ppc64_elf_hide_symbol): New. + (define elf_backend_hide_symbol): Define. + (allocate_dynrelocs): Remove code looking up function descriptors + as that has been done earlier. + (ppc64_elf_size_dynamic_sections): Use htab shortcut to elf hash + table. + (ppc64_elf_finish_dynamic_symbol): Likewise. Remove code looking + up function descriptor. + (build_one_stub): Look up the function code sym. Check for + invalid plt offsets. + (ppc64_elf_relocate_section): Tweak calls to undefined weak syms. + Convert R_PPC64_TOC relocs to R_PPC64_RELATIVE in shared libs. + + * elf-bfd.h (elf_backend_data ): Add + boolean param. + (_bfd_elf_link_hash_hide_symbol): Likewise. + * elflink.h (elf_link_add_object_symbols): Adjust call to + elf_backend_hide_symbol. + (elf_fix_symbol_flags): Likewise. + (elf_link_assign_sym_version): Likewise. Use bfd_malloc rather + than bfd_alloc. + * elf.c (_bfd_elf_link_hash_hide_symbol): Add "force_local" param. + Set ELF_LINK_FORCED_LOCAL and call _bfd_elf_strtab_delref. + * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise. + (clobber_millicode_symbols): Adjust to suit new hide_symbol. + * elf32-cris.c (elf_cris_hide_symbol): Add "force_local" param + and adjust to suit. + * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise, and call + _bfd_elf_link_hash_hide_symbol rather than duplicating code. + * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise. + +2002-01-18 Alan Modra + + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Test for a + dynamic function descriptor symbol, not the associated function + symbol. + +2002-01-17 Eric Christopher + + * elf32-mips.c (mips_elf_calculate_relocation): Fix typo. + +2002-01-17 Nick Clifton + + * po/bfd.pot: Regenerate. + * po/fr.po: Regenerate. + +2002-01-17 Alan Modra + + * elf-bfd.h (elf_backend_data ): + Remove "Elf_Internal_Shdr *" param. + (_bfd_mips_elf_section_from_bfd_section): Ditto. + * elf32-mips.c (_bfd_mips_elf_section_from_bfd_section): Ditto. + * elf32-m32r.c (_bfd_m32r_elf_section_from_bfd_section): Ditto. + * elf32-v850.c (v850_elf_section_from_bfd_section): Ditto. + * elf64-mmix.c (mmix_elf_section_from_bfd_section): Ditto. + * elfxx-ia64.c (elfNN_hpux_backend_section_from_bfd_section): Ditto. + * elf.c (_bfd_elf_section_from_bfd_section): Allow backend + function to override special sections. Remove hdr arg from + backend call, and don't loop. + +2002-01-16 Eric Christopher + + * elf32-mips.c (mips_elf_calculate_relocation): Set require_jalxp + on R_MIPS_26 and target is 16bit. Add R_MIPS16_GPREL to list of + relocations requiring gp0 and gp. + +2002-01-16 Richard Earnshaw + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Handle + EF_ARM_VFP_FLOAT. + (elf32_arm_print_private_bfd_data): Likewise. + +2002-01-16 Nick Clifton + + * po/tr.po: Import new version. + +2002-01-16 Alan Modra + + * elf64-ppc.c (ppc64_elf_howto_raw): Remove stale FIXMEs. + (ppc64_elf_reloc_type_lookup): Use proper CTOR reloc. + (ORI_R0_R0_0): Correct. + +2002-01-16 Alan Modra + + * elflink.c (_bfd_elf_create_dynamic_sections): Don't set SEC_CODE + when plt_not_loaded. + * elf64-ppc.c (ppc64_elf_create_dynamic_sections): No need to + clear .plt SEC_CODE here. Create .stub and correct .glink flags. + (PLT_INITIAL_ENTRY_SIZE): Set to 24. + (ppc64_elf_glink_code): Delete. + (PPC64_ELF_GLINK_SIZE): Delete. + (ADDIS_R12_R2, STD_R2_40R1, LD_R11_0R12, LD_R2_0R12, MTCTR_R11, + BCTR, ADDIS_R12_R12_1, LD_R2_40R1, NOP, LI_R0_0, B_DOT, LIS_R0_0, + ORI_R0_R0_0): Define. + (PLT_CALL_STUB_SIZE, GLINK_CALL_STUB_SIZE): Define. + (struct ppc_link_hash_table): Add sstub and plt_overflow. + (ppc64_elf_link_hash_table_create): Init them. + (ppc64_elf_check_relocs ): Refcount .plt entry. + Don't copy to shared lib. + (ppc64_elf_check_relocs): Call bfd_set_error on errors. + (ppc64_elf_gc_sweep_hook ): Sweep plt refcount. + (allocate_dynrelocs ): Don't change function sym here. Make + room for .stub and .glink code. + (ppc64_elf_size_dynamic_sections): Handle .stub. Make entry for + DT_PPC64_GLINK. + (ppc64_elf_final_link): Rename to ppc64_elf_set_toc. Don't call + bfd_elf64_bfd_final_link. + (bfd_elf64_bfd_final_link): Don't define. + (ppc64_elf_size_stubs): New. + (build_plt_stub): New. + (build_one_stub): New. + (ppc64_elf_build_stubs): New. + (ppc64_elf_relocate_section ): Remove assert. + (ppc64_elf_relocate_section): Don't copy R_PPC64_REL24 relocs. + (ppc64_elf_finish_dynamic_symbol): Don't build stubs here. Set + DT_PPC64_GLINK entry. Tweak DT_PLTGOT, DT_JMPREL, DT_PLTRELSZ in + case output sections not separate. Adjust DT_RELASZ to not + include plt relocs. Set reserved got entry. Set got and plt + entry size. + (elf_backend_got_header_size): Set to 8. + * elf64-ppc.h: New file. + +2002-01-16 Alan Modra + + * elf32-arm.h (elf32_arm_size_dynamic_sections): When removing + sections, use bfd_section_list_remove. + * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise. + * elflink.h (elf_link_add_object_symbols): When removing all + sections, use bfd_section_list_clear. + +2002-01-15 Nick Clifton + + * po/sv.po: New file: Swedish translation. + * configure.in (ALL_LINGUAS): Add sv. + * configure: Regenerate. + +2002-01-15 Jakub Jelinek + + * elflink.h (elf_link_input_bfd): Back out 2002-01-07 change. + * elf.c (merge_sections_remove_hook): New function. + (_bfd_elf_merge_sections): Pass it as 3rd argument to + _bfd_merge_sections. + * libbfd-in.h (_bfd_merge_sections): Add 3rd argument. + * libbfd.h: Rebuilt. + * merge.c (_bfd_merge_sections): Add remove_hook argument. + Call remove_hook if a SEC_EXCLUDE section is encountered. + +2002-01-15 Nick Clifton + + * elf32-xstormy16.c (xstormy16_reloc_map): Add new field 'table'. + (xstormy16_reloc_map): Initialise new field with correct howto + table. + (xstormy16_reloc_type_lookup): Use 'table' field to locate correct + howto entry. + +2002-01-10 Michael Snyder + + * elf.c (elfcore_write_prstatus): Use long instead of pid_t; + (elfcore_write_pstatus): Use long instead of pid_t; + * elf-bfd.h: Change prototypes to use long instead of pid_t; + +2002-01-09 Jason Thorpe + + * elf.c: Update copyright years. + (elfcore_grok_netbsd_note): Use NT_NETBSDCORE_PROCINFO + and NT_NETBSDCORE_FIRSTMACH. Improve a comment. + +2002-01-08 Michael Snyder + + Add capability to write corefile note sections, for gdb. + * elf.c (elfcore_write_note): New function. + (elfcore_write_prpsinfo): New function. + (elfcore_write_prstatus): New function. + (elfcore_write_pstatus): New function. + (elfcore_write_prfpreg): New function. + (elfcore_write_prxfpreg): New function. + * elf-bfd.h: Add prototypes for above functions. + +2002-01-08 Alexandre Oliva + + * elf.c (elf_fake_sections): Propagate errors from + elf_backend_fake_section. + +2002-01-07 Jason Thorpe + + * Makefile.am (BFD32_BACKENDS): Add elf32-sh-nbsd.lo. + (BFD32_BACKENDS_CFILES): Add elf32-sh-nbsd.c. + (elf32-sh-nbsd.lo): New rule. + * Makefile.in: Regenerate. + * config.bfd (sh*le-*-netbsdelf*): New target. + (sh*-*-netbsdelf*): New target. + * configure.in: Include netbsd-core.lo for native sh*-*-netbsd*. + (bfd_elf32_shnbsd_vec): New vector. + (bfd_elf32_shlnbsd_vec): New vector. + * configure: Regenerate. + * elf32-sh-nbsd.c: New file. + * targets.c: Update copyright years. + (_bfd_target_vector): Add bfd_elf32_shlnbsd_vec and + bfd_elf32_shnbsd_vec. + +2002-01-07 Aldy Hernandez + + * coff-rs6000.c (READ20): Use bfd_scan_vma. + +2002-01-07 Geoffrey Keating + + * elflink.h (elf_link_input_bfd): Don't ask for the merged offset + of a symbol in a section that will be deleted. + +2002-01-07 Nick Clifton + + * po/es.po: New file: Spanish translation. + * configure.in (ALL_LINGUAS): Add es. + * configure: Regenerate. + +2002-01-06 Steve Ellcey + + * elfxx-ia64.c (is_unwind_section_name): Add target vector as + argument so we can handle HP-UX specially. + (elfNN_ia64_hpux_vec): New for use in is_unwind_section_name. + (elfNN_hpux_backend_section_from_bfd_section): New for support + of SHN_IA_64_ANSI_COMMON. + (elfNN_ia64_relax_section): Add support for SHN_IA_64_ANSI_COMMON. + (is_unwind_section_name): Add special HP-UX support. + (elfNN_ia64_section_from_shdr): Add support for more sections. + (elfNN_ia64_fake_sections): Modify is_unwind_section_name call and + add support for more sections. + (elfNN_ia64_additional_program_headers): Modify + is_unwind_section_name call. + (elfNN_ia64_modify_segment_map): Remove assumption that there is + only one unwind section in segment. + +2002-01-06 Alan Modra + + * syms.c (_bfd_generic_make_empty_symbol): New function. + * libbfd-in.h (_bfd_nosymbols_make_empty_symbol): Define as + _bfd_generic_make_empty_symbol. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * hppabsd-core.c (hppabsd_core_make_empty_symbol): Delete function. + (hppabsd_core_get_symtab_upper_bound): Don't define. + (hppabsd_core_get_symtab): Likewise. + (hppabsd_core_print_symbol): Likewise. + (hppabsd_core_get_symbol_info): Likewise. + (hppabsd_core_bfd_is_local_label_name): Likewise. + (hppabsd_core_get_lineno): Likewise. + (hppabsd_core_find_nearest_line): Likewise. + (hppabsd_core_bfd_make_debug_symbol): Likewise. + (hppabsd_core_read_minisymbols): Likewise. + (hppabsd_core_minisymbol_to_symbol): Likewise. + (hppabsd_core_vec): Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols). + Formatting fixes. + * hpux-core.c: Similarly. + * irix-core.c: Similarly. + * osf-core.c: Similarly. + * sco5-core.c: Similarly. + * binary.c (binary_make_empty_symbol): Remove function, define as + _bfd_generic_make_empty_symbol. + * ihex.c (ihex_make_empty_symbol): Likewise. + * mmo.c (mmo_make_empty_symbol): Likewise. + * ppcboot.c (ppcboot_make_empty_symbol): Likewise. + * srec.c (srec_make_empty_symbol): Likewise. + * versados.c (versados_make_empty_symbol): Likewise. + * vms.c (_bfd_vms_make_empty_symbol): Remove. + (vms_make_empty_symbol): Define as _bfd_generic_make_empty_symbol. + * vms-gsd.c (_bfd_vms_slurp_gsd): Call bfd_make_empty_symbol + rather than _bfd_vms_make_empty_symbol. + * vms-misc.c (new_symbol): Likewise. + +2002-01-05 Alan Modra + + * section.c (bfd_section_init): Remove unnecessary initialisations. + (bfd_section_list_clear): New function. + (bfd_section_list_remove, bfd_section_list_insert): New macros. + (_bfd_strip_section_from_output): Use them. + * coffcode.h (coff_set_alignment_hook): Likewise. + * elf32-mips.c (_bfd_mips_elf_final_link): Likewise. + * elf64-mips.c (mips_elf64_final_link): Likewise. + * elf64-mmix.c (mmix_elf_final_link): Likewise. + * sunos.c (sunos_add_dynamic_symbols): Likewise. + * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise. + * bfd-in2.h: Regenerate. + + * netbsd-core.c (netbsd_core_file_p): Use bfd_make_section_anyway + rather than doing our own section handling. Clean up after errors + with bfd_release and bfd_section_list_clear. Handle unexpected + flags. + * aoutf1.h (sunos4_core_file_p): Likewise. + * aix386-core.c (aix386_core_file_p): Likewise. + * cisco-core.c (cisco_core_file_validate): Likewise. + * ptrace-core.c (ptrace_unix_core_file_p): Likewise. + * trad-core.c (trad_unix_core_file_p): Likewise. + + * hppabsd-core.c (hppabsd_core_core_file_p): Clean up after errors + with bfd_release and bfd_section_list_clear. + * hpux-core.c (hpux_core_core_file_p): Likewise. + * irix-core.c (irix_core_core_file_p): Likewise. + * lynx-core.c (lynx_core_file_p): Likewise. + * osf-core.c (osf_core_core_file_p): Likewise. + * rs6000-core.c (rs6000coff_core_p): Likewise. + * sco5-core.c (sco5_core_file_p): Likewise. + + * elf32-mips.c (_bfd_mips_elf_lo16_reloc): Simplify, and perform + sign extension adjustments without conditionals. + +2002-01-04 Jakub Jelinek + + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Don't crash if + CIE at .eh_frame start is removed due to no FDEs referencing it. + +2002-01-04 Jason Thorpe + + * config.bfd (x86_64-*-netbsd*): New target. + * configure.in (x86_64-*-netbsd*): Set COREFILE + to netbsd-core.lo. + * configure: Regenerated. + +2002-01-03 Tom Rix + + * xcofflink.c (_bfd_xcoff_bfd_final_link): Update .pad section ordering + for recent bfd_make_section_anyway change. + +2002-01-03 Nick Clifton + + * elf32-arm.h (elf32_arm_final_link_relocate): Handle + R_ARM_THM_PC11 reloc. + +2002-01-02 Nick Clifton + + * configure.in (LINGUAS): Add ja. + * configure: Regenerate. + * po/ja.po: Import from translation project's web site. + +2002-01-02 Nick Clifton + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Reformat error + messages to ease translation into other languages. + +For older changes see ChangeLog-0001 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-2004 sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-2004 --- sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-2004 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-2004 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,5063 @@ +2004-12-31 Paul Brook + + * elf32-arm.c (elf32_arm_symbian_plt_entry): Fix comment typo. + +2004-12-31 Alan Modra + + * reloc.c (BFD_RELOC_AVR_LDI, BFD_RELOC_AVR_6, BFD_RELOC_AVR_6_ADIW): + Commit missing changes from 2004-12-22. + * bfd-in2.h: Regenerate. + +2004-12-23 Tomer Levi + + * elf32-crx.c (elf32_crx_relax_section): Support 'bcop' relaxation. + +2004-12-21 Kris Warkentin + + * elf.c (elfcore_grok_nto_gregs): Change name to elfcore_grok_nto_regs. + Add 'base' argument for constructing register sections. Reformat. + (elfcore_grok_nto_note): Call elfcore_grok_nto_regs for both + gp and fp regs. Reformat. + +2004-12-22 Klaus Rudolph + + * reloc.c: Add new relocs R_AVR_LDI, R_AVR_6, R_AVR_6_ADIW. + * bfd-in2.h: Regenerate. + * elf32-avr.c (elf_avr_nowto_table): Add the new relocs. + (avr_reloc_map): Likewise. + (avr_final_link_relocate): Likewise. + +2004-12-22 Alan Modra + + * elflink.c (_bfd_elf_merge_symbol): Treat old definitions from + as-needed dynamic libs as undefined. + (elf_link_add_object_symbols): Remove DYN_AS_NEEDED from as-needed + libs when finding they are needed. + +2004-12-20 Alan Modra + + * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add opd_relocs. + (opd_entry_value): Use opd_relocs if available. + (ppc64_elf_relocate_section): Don't set reloc_done. Instead + copy .opd relocations to opd_relocs. + (ppc64_elf_edit_toc): Set rel_hdr.sh_size after editing relocs. + +2004-12-16 Richard Sandiford + + * reloc.c (BFD_RELOC_V850_LO16_SPLIT_OFFSET): New bfd_reloc_code_type. + * elf32-v850.c (v850_elf_howto_table): Add entry for + R_V850_LO16_SPLIT_OFFSET. + (v850_elf_reloc_map): Map it to BFD_RELOC_V850_LO16_SPLIT_OFFSET. + (v850_elf_perform_lo16_relocation): New function, extracted from... + (v850_elf_perform_relocation): ...here. Use it to handle + R_V850_LO16_SPLIT_OFFSET. + (v850_elf_check_relocs, v850_elf_final_link_relocate): Handle + R_V850_LO16_SPLIT_OFFSET. + * libbfd.h, bfd-in2.h: Regenerate. + +2004-12-14 P.J. Darcy + + * config.bfd: Add s390x-ibm-tpf support. + +2004-12-14 Tomer Levi + + * elf32-crx.c (elf32_crx_relax_delete_bytes): Add 'struct bfd_link_info *' + to prototype, to make hash info available. + Prevent wrapped symbols from being adjusted twice. + +2004-12-14 Richard Sandiford + + * elfxx-mips.c (mips_elf_calculate_relocation): Don't report an + overflow for calls to undefined weak symbols. + +2004-12-11 Alan Modra + + * elfcode.h (elf_slurp_symbol_table): Use bfd_elf_sym_name so that + canonical sections syms have a name. + +2004-12-11 Alan Modra + + * elf64-ppc.c (opd_entry_value): Don't use cached relocs if they + have been adjusted for output. + (ppc64_elf_relocate_section): Mark sections with reloc_done. + +2004-12-10 Alan Modra + + * elf.c (bfd_elf_sym_name): Rename from bfd_elf_local_sym_name and + add symtab_hdr param. + (group_signature): Update calls. + * elf-bfd.h (bfd_elf_sym_name): Update. + * elf32-ppc.c (ppc_elf_relocate_section): Update. + * elf64-ppc.c (ppc64_elf_edit_opd, ppc64_elf_edit_toc): Update. + (ppc64_elf_relocate_section): Update. + * elflink.c (elf_link_input_bfd): Update. + +2004-12-10 Jakub Jelinek + + * elf.c (bfd_elf_local_sym_name): Avoid crashes with invalid + st_shndx on STT_SECTION sections. + +2004-12-09 Daniel Jacobowitz + + * elfcode.h (elf_slurp_reloc_table_from_section): Don't canonicalize + ELF section symbols. + +2004-12-09 Ian Lance Taylor + + * elfxx-mips.c (mips_elf_calculate_relocation): For R_MIPS_JALR, + return a real value, unless it is a PLT symbol. + (mips_elf_perform_relocation): On the RM9000, turn a jal into a + bal if possible. + + * elfn32-mips.c (elf_mips_howto_table_rela): Change dst_mask of + R_MIPS_JALR entry to 0. + + * archures.c: Define bfd_mach_mips9000. + * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_9000. + (mips_set_isa_flags): Handle bfd_mach_mips9000. + * cpu-mips.c (I_mips9000): Define. + (arch_info_struct): Add case for bfd_mach_mips9000. + * aoutx.h (NAME(aout,machine_type)): Handle bfd_mach_mips9000. + * bfd-in2.h: Regenerate. + +2004-12-08 Ian Lance Taylor + + * elfxx-mips.c (mips_elf_calculate_relocation): Test for R_MIPS_26 + overflow. + +2004-12-07 Ben Elliston + + * netbsd-core.c (netbsd_core_file_p): Make `i' unsigned. + +2004-12-06 Daniel Jacobowitz + + Suggested by Fergal Daly : + * simple.c (simple_dummy_multiple_definition): New function. + (bfd_simple_get_relocated_section_contents): Use it. + +2004-12-03 Jan Beulich + + * elf.c (elf_find_function): Don't use the last file symbol ever, + seen, but the last one seen prior to the symbol being reported. + Don't report a filename at all for global symbols when that might + be ambiguous/wrong. + +2004-12-01 Paul Brook + + * elf32-arm.c (elf32_arm_copy_private_bfd_data): Set EI_OSABI. + (elf32_arm_post_process_headers): Set EI_OSABI depending on ABI + version. + +2004-12-01 Paul Brook + + * elflink.c (elf_link_add_object_symbols): Make symbols from discarded + sections undefined. + +2004-11-30 Paul Brook + + * elf32-arm.c (struct elf32_arm_link_hash_table): Remove + no_pipeline_knowledge + (elf32_arm_link_hash_table_create): Ditto. + (bfd_elf32_arm_process_before_allocation): Ditto. + (elf32_arm_final_link_relocate): Ditto. Remove oabi relocation + handling. + * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update + prototype. + * bfd-in2.h: Regenerate. + +2004-11-30 Randolph Chung + + * elf32-hppa.c (elf32_hppa_grok_prstatus): New function. + (elf32_hppa_grok_psinfo): New function. + (elf_backend_grok_prstatus): Define. + (elf_backend_grok_psinfo): Define. + +2004-11-24 H.J. Lu + + PR 574: + * elfcode.h (elf_slurp_symbol_table): Handle STT_TLS. + +2004-11-24 Paul Brook + + * elf.c (assign_section_numbers): Number SHT_GROUP sections first. + +2004-11-24 Paul Brook + + * elf32-arm.c (elf32_arm_swap_symbol_in): New function. + (elf32_arm_swap_symbol_out): New function. + (elf32_arm_size_info): Add. + (elf_backend_size_info): Define. + +2004-11-20 John David Anglin + + * hpux-core.c (hpux_core_core_file_p): Use offsetof macro in calls to + make_bfd_asection. + +2004-11-19 Alan Modra + + * elf32-arm.c (elf32_arm_finish_dynamic_sections): Warning fix. + * elf32-iq2000.c (iq2000_reloc_type_lookup): C90 function decl. + * nlmcode.h (nlm_write_object_contents): Warning fix. + +2004-11-18 Bob Wilson + + * elf32-xtensa.c (ebb_propose_action): Fix argument order. + +2004-11-17 Daniel Jacobowitz + + * elf32-arm.c (PLT_THUMB_STUB_SIZE): Define. + (elf32_arm_plt_thumb_stub): New. + (struct elf32_arm_link_hash_entry): Add plt_thumb_refcount + and plt_got_offset. + (elf32_arm_link_hash_traverse): Fix typo. + (elf32_arm_link_hash_table): Add obfd. + (elf32_arm_link_hash_newfunc): Initialize new fields. + (elf32_arm_copy_indirect_symbol): Copy plt_thumb_refcount. + (elf32_arm_link_hash_table_create): Initialize obfd. + (record_arm_to_thumb_glue): Mark the glue as a local ARM function. + (record_thumb_to_arm_glue): Mark the glue as a local Thumb function. + (bfd_elf32_arm_get_bfd_for_interworking): Verify that the + interworking BFD is not dynamic. + (bfd_elf32_arm_process_before_allocation): Handle R_ARM_PLT32. Do + not emit glue for PLT references. + (elf32_arm_final_link_relocate): Handle Thumb functions. Do not + emit glue for PLT references. Support the Thumb PLT prefix. + (elf32_arm_gc_sweep_hook): Handle R_ARM_THM_PC22 and + plt_thumb_refcount. + (elf32_arm_check_relocs): Likewise. + (elf32_arm_adjust_dynamic_symbol): Handle Thumb functions and + plt_thumb_refcount. + (allocate_dynrelocs): Handle Thumb PLT references. + (elf32_arm_finish_dynamic_symbol): Likewise. + (elf32_arm_symbol_processing): New function. + (elf_backend_symbol_processing): Define. + +2004-11-16 Richard Sandiford + + * elf-bfd.h (eh_cie_fde): Add new fields: add_augmentation_size and + add_fde_encoding. Remove need_relative. + * elf-eh-frame.c (extra_augmentation_string_bytes) + (extra_augmentation_data_bytes, size_of_output_cie_fde): New functions. + (_bfd_elf_discard_section_eh_frame): Consider changing the FDE encoding + in cases where the CIE has no existing 'R' augmentation. Use + size_of_output_cie_fde when assigning offsets. Use the final offset + as the new section size. + (_bfd_elf_eh_frame_section_offset): Remove need_relative handling. + Account for any extra augmentation bytes in the returned offset. + (_bfd_elf_write_section_eh_frame): Rework so that the entries are + moved before being modified. Pad growing entries with DW_CFA_nops. + Add 'z' and 'R' augmentations as directed by add_augmentation_size + and add_fde_encoding. + +2004-11-15 Mark Mitchell + + * elf32-arm.c (elf32_arm_relocate_section): Use + arm_real_reloc_type. + +2004-11-16 Richard Sandiford + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Return early + for discard relocations; don't add an R_MIPS_NONE to the main body + of .rel.dyn. + +2004-11-04 Paul Brook + + * elf-bfd.h (_bfd_elf_slurp_version_tables): Update prototype. + * elf.c (_bfd_elf_print_private_bfd_data): Pass extra argument. + (_bfd_elf_slurp_version_tables): Add extra argument. Create extra + default version definition for unversioned symbols. + * elfcode.h (elf_slurp_symbol_table): Pass extra argument. + * elflink.c (elf_link_add_object_symbols): Pass extra argument to + _bfd_elf_slurp_version_tables. Set default version for unversioned + imported symbols. + +2004-11-15 Paul Brook + + * elflink.c (elf_link_add_object_symbols): Don't assume version + indices are consecutive. + +2004-11-14 Richard Sandiford + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Deal with + composite relocations against the personality data. + +2004-11-13 Paul Brook + + * elf32-arm.c (elf32_arm_final_link_relocate): Resolve + R_ARM_PREL31 relocations to PLT entries. + (elf32_arm_relocate_section, elf32_arm_gc_sweep_hook): Ditto. + (elf32_arm_check_relocs): Ditto. + +2004-11-12 Bob Wilson + + * xtensa-isa.c (xtensa_interface_class_id): New. + +2004-11-11 Bob Wilson + + * elf32-xtensa.c (property_table_compare): Remove assertion about + entries with the same address and non-zero size. + (xtensa_read_table_entries): Report such entries as errors. + +2004-11-11 Mark Mitchell + + * elf32-arm.c (elf32_arm_final_link_relocate): Correct logic for + R_ARM_RELATIVE on Symbian OS. + +2004-11-09 Mark Mitchell + + * som.c (som_bfd_print_private_bfd_data): New function. + (som_object_setup): Save the auxiliary header. Don't assume that + zero is an invalid entry point for a shared library. + (som_object_p): Allocate the auxiliary header on the heap. + + * elf32-arm.c (elf32_arm_begin_write_processing): Do not use a K&R + declaration. + (elf32_arm_symbian_modify_segment_map): Likewise. + +2004-11-09 Daniel Jacobowitz + + From David Poole : + * elf32-arm.c (elf32_arm_readonly_dynrelocs): New function. + (elf32_arm_size_dynamic_sections): Call it. + +2004-11-09 Alan Modra + + * Makefile.am (SOURCE_HFILES): Remove elf32-arm.h. + (ALL_MACHINES_CFILES): Fix typo. + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2004-11-08 Mark Mitchell + + * elf32-arm.c (elf32_arm_final_link_relocate): When generating an + R_ARM_RELATIVE relocation for Symbian OS, mention the section + symbol in the relocation. + +2004-11-08 Inderpreet Singh + Vineet Sharma + + * coff-maxq.c: New File. + * cpu-maxq.c: New File. + * coffcode.h: Likewise. + * config.bfd: Likewise. + * configure.in (maxqcoff_vec): New target vector. + * Makefile.am: Add support for maxq target. + * configure.in: Likewise. + * archures.c:. Likewise. + * targets.c: Likewise. + * bfd_in2.h : Regenerated. + * Makefile.in: Regenerated. + * configure: Regenerated. + * doc/Makefile.in: Regenerated. + +2004-11-08 Aaron W. LaFramboise + + * coff-i386.c (coff_i386_reloc): Fix weak symbols. + * cofflink.c (_bfd_coff_link_input_bfd): Don't process + C_NT_WEAK aux entries. + (_bfd_coff_generic_relocate_section): Handle undefined + aliases. + +2004-11-07 Andreas Schwab + + * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Use + SYMBOL_CALLS_LOCAL and check for undefweak symbols with + non-default visibility. + +2004-11-01 Mark Mitchell + + * elf32-arm.c (elf32_arm_symbian_begin_write_processing): Clear + D_PAGED. + (elf32_arm_symbian_modify_segment_map): Don't + reset includes_filehdr and includes_phdrs here. + +2004-11-04 Daniel Jacobowitz + + * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Replace + elfarm-nabi with elf32-arm. Remove elfarm-oabi. + (elf32-arm.lo): Replace elfarm-nabi.lo rule. Remove elf32-arm.h + dependency. + * config.bfd: Move arm-*-oabi* and thumb-*-oabi* from obsolete list + to a new removed list. Remove normal configuration stanzas. + * configure.in: (bfd_elf32_bigarm_vec, bfd_elf32_bigarm_symbian_vec) + (bfd_elf32_littlearm_symbian_vec, bfd_elf32_littlearm_vec): Replace + elfarm-nabi.lo with elf32-arm.lo. + (bfd_elf32_bigarm_oabi_vec, bfd_elf32_littlearm_oabi_vec): Remove. + * elf32-arm.c: Renamed from elfarm-nabi.c. Inline elf32-arm.h. + * elf32-arm.h: Remove. + * elfarm-oabi.c: Remove. + * targets.c (_bfd_target_vector): Remove bfd_elf32_bigarm_oabi_vec + and bfd_elf32_littlearm_oabi_vec. + * aclocal.m4, Makefile.in, configure, doc/Makefile.in: Regenerated. + +2004-11-04 Hans-Peter Nilsson + + * config.bfd: Support crisv32-*-* like cris-*-*. + * archures.c (bfd_mach_cris_v0_v10, bfd_mach_cris_v32) + (bfd_mach_cris_v10_v32): New macros. + * cpu-cris.c: Tweak formatting. + (get_compatible): New function. + (N): New macro. + (bfd_cris_arch_compat_v10_v32, bfd_cris_arch_v32): New + bfd_arch_info_type:s. + (bfd_cris_arch): Use bfd_mach_cris_v0_v10 for member mach, + get_compatible for member compatible and link bfd_cris_arch_v32 as + next. + * elf32-cris.c (cris_elf_pcrel_reloc) + (cris_elf_set_mach_from_flags): New functions. + (cris_elf_howto_table) + : Use cris_elf_pcrel_reloc. + (cris_elf_grok_prstatus, cris_elf_grok_psinfo): Give correct + numbers for bfd_mach_cris_v32. + (PLT_ENTRY_SIZE_V32): New macro. + (elf_cris_plt0_entry): Drop last comma in initializer. + (elf_cris_plt0_entry_v32, elf_cris_plt_entry_v32) + (elf_cris_pic_plt0_entry_v32, elf_cris_pic_plt_entry_v32): New + PLT initializers. + (cris_elf_relocate_section): Change all "%B(%A)" messages to + "%B, section %A". + (elf_cris_finish_dynamic_symbol): Do V32-specific PLT entries. + (elf_cris_finish_dynamic_sections): Similar. + (elf_cris_adjust_dynamic_symbol): Similar. + (cris_elf_check_relocs): Change all "%B(%A)" messages to "%B, + section %A". + : Emit error and return FALSE for + bfd_mach_cris_v10_v32. + : + Emit warning when generating textrel reloc. + (cris_elf_object_p): Call cris_elf_set_mach_from_flags. + (cris_elf_final_write_processing): Set flags according to mach. + (cris_elf_print_private_bfd_data): Display + EF_CRIS_VARIANT_COMMON_V10_V32 and EF_CRIS_VARIANT_V32. + (cris_elf_merge_private_bfd_data): Drop variables old_flags, + new_flags. Don't call cris_elf_final_write_processing. Don't + look at the actual elf header flags at all; use + bfd_get_symbol_leading_char to check ibfd, obfd. Trap difference + in bfd_get_mach for ibfd and obfd and handle merging of compatible + objects. + (bfd_elf32_bfd_copy_private_bfd_data): Define. + * reloc.c (BFD_RELOC_CRIS_SIGNED_8, BFD_RELOC_CRIS_UNSIGNED_8) + (BFD_RELOC_CRIS_SIGNED_16, BFD_RELOC_CRIS_UNSIGNED_16) + (BFD_RELOC_CRIS_LAPCQ_OFFSET): New relocs. + * bfd-in2.h, libbfd.h: Regenerate. + +2004-11-04 Alan Modra + + * elf64-ppc.h (ppc64_elf_edit_toc): Declare. + * elf64-ppc.c (struct ppc_link_hash_entry ): Update + comment. + (struct adjust_toc_info): New. + (adjust_toc_syms, ppc64_elf_edit_toc): New functions. + +2004-11-03 Bob Wilson + + * elf.c (assign_file_positions_for_segments): Set next_file_pos even + if there are no segments. + +2004-11-02 Daniel Jacobowitz + + * config.bfd: Mark arm-*-oabi and thumb-*-oabi as obsolete. + +2004-11-02 Nick Clifton + + * elf32-iq2000.c: Convert to ISO C90 formatting. + +2004-11-02 Hans-Peter Nilsson + + * elflink.c (_bfd_elf_create_got_section): Hide _GLOBAL_OFFSET_TABLE_. + +2004-10-28 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Handle weak + undefined symbols for R_IA64_SECREL32MSB, R_IA64_SECREL32LSB, + R_IA64_SECREL64MSB and R_IA64_SECREL64LSB. + +2004-10-28 Kaz Kojima + + * elf32-sh.c (tpoff): Take alignment into account. + +2004-10-28 Nick Clifton + + * elf32-iq2000.c (iq2000_elf_relocate_section): Do nothing when + performing a relocatable link. + (iq2000_elf_object_p): Do not set elf_bad_symtab. This is only + for MIPS ports under Irix. + +2004-10-27 Richard Earnshaw + + * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Handle + R_ARM_CALL and R_ARM_JUMP24 as aliases of R_ARM_PC24. + (elf32_arm_final_link_relocate): Ditto. + (arm_add_to_rel, elf32_arm_relocate_section): Ditto. + (elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto + (elf32_arm_adjust_dynamic_symbol): Ditto. + * elfarm-nabi.c (elf32_arm_howto_table): Add R_ARM_CALL and + R_ARM_JUMP32. Move R_ARM_R{REL32,ABS32,PC24,BASE}... + (elf32_arm_r_howto): ... To here. + (elf32_arm_howto_from_type): Use elf32_arm_r_howto. + +2004-10-26 H.J. Lu + + PR 475 + * elfxx-ia64.c (elfNN_ia64_relocate_section): Correct + R_IA64_SECREL32MSB, R_IA64_SECREL32LSB, R_IA64_SECREL64MSB + and R_IA64_SECREL64LSB. + +2004-10-26 Paul Brook + + * elflink.c (elf_finalize_dynstr): Skip shared aux structure. + (bfd_elf_size_dynamic_sections): Create default version definition. + (elf_link_output_extsym): Adjust for default symbol version. + +2004-10-24 Hans-Peter Nilsson + + * mmo.c: Adjust to ISO C. + + * mmo.c (mmo_write_section_description): New function broken out + of mmo_internal_write_section. + (mmo_internal_write_section): For each of .text and .data, call + mmo_write_section_description before outputting contents if it has + nontrivially deducible vma or contents. + (mmo_has_leading_or_trailing_zero_tetra_p): New function. + (mmo_canonicalize_symtab): Adjust absolute symbols to .data + symbols if found within the .data address range. + +2004-10-24 Daniel Jacobowitz + + * opncls.c (bfd_close): Return TRUE for BFD_IN_MEMORY. + +2004-10-24 Hans-Peter Nilsson + + * mmo.c (File Layout): Correct place of misplaced blurb about + special data. + +2004-10-22 Mark Kettenis + + * config.bfd: Add mips64*-*-openbsd. + +2004-10-21 Bob Wilson + + * elf32-xtensa.c (ebb_propose_action): Put declarations before + statements. + +2004-10-21 H.J. Lu + + * configure.in: (AM_INIT_AUTOMAKE): Set version to 2.15.94. + * configure: Regenerate. + +2004-10-21 H.J. Lu + + PR 463 + * aoutx.h (aout_link_input_section_std): Pass proper hash entry + to linker reloc_overflow callback. + (aout_link_input_section_ext): Likewise. + (aout_link_reloc_link_order): Likewise. + * coff-a29k.c (coff_a29k_relocate_section): Likewise. + * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): + Likewise. + (alpha_relocate_section): Likewise. + * coff-arm.c (coff_arm_relocate_section): Likewise. + * coff-h8300.c (h8300_reloc16_extra_cases): Likewise. + * coff-h8500.c (extra_case): Likewise. + * coff-i960.c (coff_i960_relocate_section): Likewise. + * coff-mcore.c (coff_mcore_relocate_section): Likewise. + * coff-mips.c (mips_relocate_section): Likewise. + * coff-or32.c (coff_or32_relocate_section): Likewise. + * coff-ppc.c (coff_ppc_relocate_section): Likewise. + * coff-rs6000.c (xcoff_ppc_relocate_section): Likewise. + * coff-sh.c (sh_relocate_section): Likewise. + * coff-tic80.c (coff_tic80_relocate_section): Likewise. + * coff-w65.c (w65_reloc16_extra_cases): Likewise. + * coff-z8k.c (extra_case): Likewise. + * coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise. + * cofflink.c (_bfd_coff_reloc_link_order): Likewise. + (_bfd_coff_generic_relocate_section): Likewise. + * ecoff.c (ecoff_reloc_link_order): Likewise. + * elf-hppa.h (elf_hppa_relocate_section): Likewise. + * elf-m10200.c (mn10200_elf_relocate_section): Likewise. + * elf-m10300.c (mn10300_elf_relocate_section): Likewise. + * elf32-arm.h (elf32_arm_relocate_section): Likewise. + * elf32-avr.c (elf32_avr_relocate_section): Likewise. + * elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-crx.c (elf32_crx_relocate_section): Likewise. + * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. + * elf32-fr30.c (fr30_elf_relocate_section): Likewise. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-h8300.c (elf32_h8_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-i860.c (elf32_i860_relocate_section): Likewise. + * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. + * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. + * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section): Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-mmix.c (mmix_elf_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elflink.c (elf_reloc_link_order): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise. + (_bfd_elf_mips_get_relocated_section_contents): Likewise. + * linker.c (_bfd_generic_reloc_link_order): Likewise. + * pdp11.c (pdp11_aout_link_input_section): Likewise. + (aout_link_reloc_link_order): Likewise. + * reloc.c (bfd_generic_get_relocated_section_contents): + Likewise. + * xcofflink.c (xcoff_reloc_link_order): Likewise. + * simple.c (simple_dummy_reloc_overflow): Updated. + +2004-10-20 Andreas Schwab + + * elf32-m68k.c (elf_m68k_plt_sym_val): New function. + (elf_backend_plt_sym_val): Define. + +2004-10-19 Danny Smith + + * config.bfd: Set targ_underscore=yes for PE COFF targets + +2004-10-19 Alan Modra + + * elf64-ppc.c (opd_entry_value): Handle --just-symbols objects. + (ppc64_elf_edit_opd): Likewise. + +2004-10-18 Mark Mitchell + + * elfarm-nabi.c (ELF_DYNAMIC_SEC_FLAGS): Add comment. + * elflink.c (_bfd_elf_create_dynamic_sections): For a loaded PLT, + set SEC_ALLOC and SEC_LOAD. + +2004-10-18 Nick Clifton + + * elf32-xstormy16.c (xstormy16_elf_relocate_section): Compute + 'name' for relocs against both local and global symbols. + +2004-10-16 Daniel Jacobowitz + + * bfd-in2.h: Regenerate. + * bfd.c (struct bfd): Add no_export. + * elflink.c (elf_link_add_object_symbols): Handle no_export. + +2004-10-15 Alan Modra + + * config.bfd: Whitespace cleanup. + * Makefile.am: Run "make dep-am" + * Makefile.in: Regenerate. + +2004-10-15 Jakub Jelinek + + * elflink.c (struct already_linked_section): Removed. + (try_match_symbols_in_sections, already_linked): Removed. + (_bfd_elf_section_already_linked): Skip ^\.gnu\.linkonce\.[^.]*\. + prefix of section names when finding already_linked_table + chain. Compare section names. Instead of calling already_linked, + do it inline and only for sections in the same already_linked_list. + +2004-10-15 Alan Modra + + * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Add "info" + parameter. If called after _bfd_elf_write_section_eh_frame, + don't allow a -2 return unless need_* bit is already set, and + handle offsets adjusted for output_offset. + * elf-bfd.h (_bfd_elf_eh_frame_section_offset): Update prototype. + * elf.c (_bfd_elf_section_offset): Update call. + +2004-10-13 H.J. Lu + + PR 440 + * coffcode.h (coff_compute_section_file_positions): Cast to + bfd_vma when computing page alignment. + +2004-10-13 Mark Mitchell + + * elf32-arm.h (elf32_arm_finish_dynamic_sections): Use file + offsets, not VMAs, for DT_VERSYM, DT_VERDEF, DT_VERNEED. + +2004-10-12 Mark Mitchell + + * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Make .rel.plt + relocations use a virtual address, not a section offset. + +2004-10-12 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_get_private_bfd_flags): Delete. + (narrow_instruction, widen_instruction): Remove unnecessary calls to + xtensa_format_encode. + (ebb_propose_action): Inline call to ebb_add_proposed_action. + (ebb_add_proposed_action): Delete. + +2004-10-12 Bob Wilson + + * elf32-xtensa.c: Use ISO C90 formatting. + +2004-10-12 Paul Brook + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Rephrase error + message. + +2004-10-12 Paul Brook + + * elf32-arm.h: Support EABI version 4 objects. + +2004-10-12 Alan Modra + + PR 325 + * cpu-i386.c (bfd_x86_64_arch_intel_syntax): Place last in chain. + Don't mark as default. + (bfd_x86_64_arch): Don't mark as default. + +2004-10-12 Alan Modra + + * elflink.c (enum action_discarded): New. + (elf_section_complain_discarded): Delete. + (elf_action_discarded): New function subsuming the above and also + controlling reloc behaviour. + (elf_link_input_bfd): Use it. + +2004-10-11 Jakub Jelinek + + * elf.c (bfd_section_from_shdr): Handle SHT_GNU_LIBLIST. + (special_sections): Add .gnu.liblist and .gnu.conflict. + (assign_section_numbers): Handle SHT_GNU_LIBLIST. + +2004-10-11 Alan Modra + + PR 233 + * elflink.c (elf_link_input_bfd): Try harder to support + relocations against symbols in removed linkonce sections. + +2004-10-11 Alan Modra + + * elflink.c (elf_link_input_bfd): Revert PR 354 change. + + PR 354 + * elflink.c (elf_link_input_bfd): Check that relocs in SEC_ALLOC + sections do not reference symbols in non-SEC_ALLOC sections. + +2004-10-11 Alan Modra + + PR 437 + * elflink.c (elf_link_sort_relocs): Don't bomb on unusual sections. + (_bfd_elf_link_omit_section_dynsym): Formatting. + +2004-10-10 Alan Modra + + * libbfd-in.h (BFD_ASSERT, BFD_FAIL): Wrap macro body in do while. + * libbfd.h: Regnerate. + * elf32-cris.c: Add missing semicolon to BFD_ASSERTs. + * elf32-frv.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-ppc.c: Likewise. + * elf64-hppa.c: Likewise. + * elfxx-ia64.c: Likewise. + * opncls.c: Likewise. + +2004-10-10 Alan Modra + + * elf-bfd.h (struct eh_frame_hdr_info): Add offsets_adjusted. + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Adjust + offsets stored in struct eh_cie_fde entries before doing other + work. + + * elf-bfd.h (struct eh_cie_fde): Add cie_inf, remove sec. + (struct eh_frame_hdr_info): Add last_cie_inf, remove last_cie_offset. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete code + setting offsets for removed CIEs. Don't set "sec", instead set + cie_inf for FDEs. Keep a pointer to last struct eh_cie_fde for a + CIE in hdr_info. Only set make_relative and make_lsda_relative + for CIEs. Use pointers rather than array indices. + (_bfd_elf_eh_frame_section_offset): Test/set make_relative, + make_lsda_relative, need_* on cie_inf for FDEs. + (_bfd_elf_write_section_eh_frame): Adjust offset and new_offset for + section output_offset. Delete cie_offset, instead use cie_inf + pointer to CIE entry. Use need_relative and need_lsda_relative on + CIE entry for FDEs. Use pointers rather than array indices. + +2004-10-09 Alan Modra + + * coff-rs6000.c (rs6000coff_vec): Add initializer for + bfd_is_target_special_symbol. + * coff64-rs6000.c (rs6000coff64_vec): Likewise. + * som.c (som_bfd_is_target_special_symbol): Define. + +2004-10-08 Nick Clifton + + * configure.in: (AM_INIT_AUTOMAKE): Set version to 2.15.93. + * configure: Regenerate. + * bfd-in2.h: Regenerate. + * syms.c (bfd_is_target_special_symbol): New interface function. + Returns true when a symbol should be considered to be special. + * targets.c (bfd_target): Include bfd_is_target_special_symbol in + the symbol jump table. + * elf32-arm.h (elf32_arm_is_target_special_symbol): New function. + Return true iff the symbol is a mapping symbol. + (bfd_elf32_bfd_is_target_special_symbol): Define. + * elfxx-target.h: Provide a default definition for + bfd_is_target_special_symbol. + * aout-target.h: Likewise. + * aout-tic30.c: Likewise. + * binary.c: Likewise. + * coffcode.h: Likewise. + * i386msdos.c: Likewise. + * ieee.c: Likewise. + * ihex.c: Likewise. + * libaout.h: Likewise. + * libbfd-in.h: Likewise + * libecoff.h: Likewise. + * mach-o.c: Likewise. + * mmo.c: Likewise. + * nlm-target.h: Likewise. + * oasys.c: Likewise. + * pef.c: Likewise. + * ppcboot.c: Likewise. + * srec.c: Likewise. + * tekhex.c: Likewise. + * versados.c: Likewise. + * vms.c: Likewise. + * xcoff-target.h: Likewise. + * xsym.c: Likewise. + * libbfd.h: Regenerate. + +2004-10-08 Daniel Jacobowitz + + * config.bfd: Include 64-bit support for i[3-7]86-*-solaris2*. + * elf64-x86-64.c (elf64_x86_64_section_from_shdr): New function. + (elf_backend_section_from_shdr): Define. + +2004-10-08 Alan Modra + + * syms.c (bfd_is_local_label): Return false for file symbols. + +2004-10-07 Bob Wilson + David Heine + + * elf32-xtensa.c (elf32xtensa_size_opt): New global variable. + (xtensa_default_isa): Global variable moved here from xtensa-isa.c. + (elf32xtensa_no_literal_movement): New global variable. + (elf_howto_table): Add entries for new relocations. + (elf_xtensa_reloc_type_lookup): Handle new relocations. + (property_table_compare): When addresses are equal, compare sizes and + various property flags. + (property_table_matches): New. + (xtensa_read_table_entries): Extend to read new property tables. Add + output_addr parameter to indicate that output addresses should be used. + Use bfd_get_section_limit. + (elf_xtensa_find_property_entry): New. + (elf_xtensa_in_literal_pool): Use elf_xtensa_find_property_entry. + (elf_xtensa_check_relocs): Handle new relocations. + (elf_xtensa_do_reloc): Use bfd_get_section_limit. Handle new + relocations. Use new xtensa-isa.h functions. + (build_encoding_error_message): Remove encode_result parameter. Add + new target_address parameter used to detect alignment errors. + (elf_xtensa_relocate_section): Use bfd_get_section_limit. Clean up + error handling. Use new is_operand_relocation function. + (elf_xtensa_combine_prop_entries, elf_xtensa_merge_private_bfd_data): + Use underbar macro for error messages. Formatting. + (get_const16_opcode): New. + (get_l32r_opcode): Add a separate flag for initialization. + (get_relocation_opnd): Operand number is no longer explicit in the + relocation. Change to decode the opcode and analyze its operands. + (get_relocation_slot): New. + (get_relocation_opcode): Add bfd parameter. Use bfd_get_section_limit. + Use new xtensa-isa.h functions to handle multislot instructions. + (is_l32r_relocation): Add bfd parameter. Use is_operand_relocation. + (get_asm_simplify_size, is_alt_relocation, is_operand_relocation, + insn_decode_len, insn_decode_opcode, check_branch_target_aligned, + check_loop_aligned, check_branch_target_aligned_address, narrowable, + widenable, narrow_instruction, widen_instruction, op_single_fmt_table, + get_single_format, init_op_single_format_table): New. + (elf_xtensa_do_asm_simplify): Add error_message parameter and use it + instead of calling _bfd_error_handler. Use new xtensa-isa.h functions. + (contract_asm_expansion): Add error_message parameter and pass it to + elf_xtensa_do_asm_simplify. Replace use of R_XTENSA_OP0 relocation + with R_XTENSA_SLOT0_OP. + (get_expanded_call_opcode): Extend to handle either L32R or CONST16 + instructions. Use new xtensa-isa.h functions. + (r_reloc struct): Add new virtual_offset field. + (r_reloc_init): Add contents and content_length parameters. Set + virtual_offset field to zero. Add contents to target_offset field for + partial_inplace relocations. + (r_reloc_is_defined): Check for null. + (print_r_reloc): New debug function. + (source_reloc struct): Replace xtensa_operand field with pair of the + opcode and the operand position. Add is_abs_literal field. + (init_source_reloc): Specify operand by opcode/position pair. Set + is_abs_literal field. + (source_reloc_compare): When target_offsets are equal, compare other + fields to make sorting predictable. + (literal_value struct): Add is_abs_literal field. + (value_map_hash_table struct): Add has_last_loc and last_loc fields. + (init_literal_value): New. + (is_same_value): Replace with ... + (literal_value_equal): ... this function. Add comparisons of + virtual_offset and is_abs_literal fields. + (value_map_hash_table_init): Use bfd_zmalloc. Check for allocation + failure. Initialize has_last_loc field. + (value_map_hash_table_delete): New. + (hash_literal_value): Rename to ... + (literal_value_hash): ... this. Include is_abs_literal flag and + virtual_offset field in the hash value. + (get_cached_value): Rename to ... + (value_map_get_cached_value): ... this. Update calls to + literal_value_hash and literal_value_equal. + (add_value_map): Check for allocation failure. Update calls to + value_map_get_cached_value and literal_value_hash. + (text_action, text_action_list, text_action_t): New types. + (find_fill_action, compute_removed_action_diff, adjust_fill_action, + text_action_add, text_action_add_literal, offset_with_removed_text, + offset_with_removed_text_before_fill, find_insn_action, + print_action_list, print_removed_literals): New. + (offset_with_removed_literals): Delete. + (xtensa_relax_info struct): Add is_relaxable_asm_section, action_list, + fix_array, fix_array_count, allocated_relocs, relocs_count, and + allocated_relocs_count fields. + (init_xtensa_relax_info): Initialize new fields. + (reloc_bfd_fix struct): Add new translated field. + (reloc_bfd_fix_init): Add translated parameter and use it to set the + translated field. + (fix_compare, cache_fix_array): New. + (get_bfd_fix): Remove fix_list parameter and get all relax_info for the + section via get_xtensa_relax_info. Use cache_fix_array to set up + sorted fix_array and use bsearch instead of linear search. + (section_cache_t): New struct. + (init_section_cache, section_cache_section, clear_section_cache): New. + (ebb_t, ebb_target_enum, proposed_action, ebb_constraint): New types. + (init_ebb_constraint, free_ebb_constraint, init_ebb, extend_ebb_bounds, + extend_ebb_bounds_forward, extend_ebb_bounds_backward, + insn_block_decodable_len, ebb_propose_action, ebb_add_proposed_action): + New. + (retrieve_contents): Use bfd_get_section_limit. + (elf_xtensa_relax_section): Add relocations_analyzed flag. Update call + to compute_removed_literals. Free value_map_hash_table when no longer + needed. + (analyze_relocations): Check is_relaxable_asm_section flag. Call + compute_text_actions for all sections. + (find_relaxable_sections): Mark sections as relaxable if they contain + ASM_EXPAND relocations that can be optimized. Adjust r_reloc_init + call. Increment relax_info src_count field only for appropriate + relocation types. Remove is_literal_section check. + (collect_source_relocs): Use bfd_get_section_limit. Adjust calls to + r_reloc_init and find_associated_l32r_irel. Check + is_relaxable_asm_section flag. Handle L32R instructions with absolute + literals. Pass is_abs_literal flag to init_source_reloc. + (is_resolvable_asm_expansion): Use bfd_get_section_limit. Check for + CONST16 instructions. Adjust calls to r_reloc_init and + pcrel_reloc_fits. Handle weak symbols conservatively. + (find_associated_l32r_irel): Add bfd parameter and pass it to + is_l32r_relocation. + (compute_text_actions, compute_ebb_proposed_actions, + compute_ebb_actions, check_section_ebb_pcrels_fit, + check_section_ebb_reduces, text_action_add_proposed, + compute_fill_extra_space): New. + (remove_literals): Replace with ... + (compute_removed_literals): ... this function. Call + init_section_cache. Use bfd_get_section_limit. Sort internal_relocs. + Call xtensa_read_table_entries to get the property table. Skip + relocations other than R_XTENSA_32 and R_XTENSA_PLT. Use new + is_removable_literal, remove_dead_literal, and + identify_literal_placement functions. + (get_irel_at_offset): Rewrite to use bsearch on sorted relocations + instead of linear search. + (is_removable_literal, remove_dead_literal, + identify_literal_placement): New. + (relocations_reach): Update check for literal not referenced by any + PC-relative relocations. Adjust call to pcrel_reloc_fits. + (coalesce_shared_literal, move_shared_literal): New. + (relax_section): Use bfd_get_section_limit. Call + translate_section_fixes. Update calls to r_reloc_init and + offset_with_removed_text. Check new is_relaxable_asm_section flag. + Add call to pin_internal_relocs. Add special handling for + R_XTENSA_ASM_SIMPLIFY and R_XTENSA_DIFF* relocs. Use virtual_offset + info to calculate new addend_displacement variable. Replace code for + deleting literals with more general code to perform the actions + determined by the action_list for the section. + (translate_section_fixes, translate_reloc_bfd_fix): New. + (translate_reloc): Check new is_relaxable_asm_section flag. Call + find_removed_literal only if is_operand_relocation. Update call to + offset_with_removed_text. Use new target_offset and removed_bytes + variables. + (move_literal): New. + (relax_property_section): Use bfd_get_section_limit. Set new + is_full_prop_section flag and handle new property tables. Update calls + to r_reloc_init and offset_with_removed_text. Check + is_relaxable_asm_section flag. Handle expansion of zero-sized + unreachable entries, with use of offset_with_removed_text_before_fill. + For relocatable links, combine entries only for literal tables. + (relax_section_symbols): Check is_relaxable_asm_section flag. Update + calls to offset_with_removed_text. Translate st_size field for + function symbols. + (do_fix_for_relocatable_link): Change to return bfd_boolean to indicate + failure. Add contents parameter. Update call to get_bfd_fix. Update + call to r_reloc_init. Call _bfd_error_handler and return FALSE for + R_XTENSA_ASM_EXPAND relocs. + (do_fix_for_final_link): Add input_bfd and contents parameters. Update + call to get_bfd_fix. Include offset from contents for partial_inplace + relocations. + (is_reloc_sym_weak): New. + (pcrel_reloc_fits): Use new xtensa-isa.h functions. + (prop_sec_len): New. + (xtensa_is_property_section): Handle new property sections. + (is_literal_section): Delete. + (internal_reloc_compare): When r_offset matches, compare r_info and + r_addend to make sorting predictable. + (internal_reloc_matches): New. + (xtensa_get_property_section_name): Handle new property sections. + (xtensa_get_property_predef_flags): New. + (xtensa_callback_required_dependence): Use bfd_get_section_limit. + Update calls to xtensa_isa_init, is_l32r_relocation, and r_reloc_init. + * xtensa-isa.c (xtensa_default_isa): Moved to elf32-xtensa.c. + (xtisa_errno, xtisa_error_msg): New variables. + (xtensa_isa_errno, xtensa_isa_error_msg): New. + (xtensa_insnbuf_alloc): Add error handling. + (xtensa_insnbuf_to_chars): Add num_chars parameter. Update to + use xtensa_format_decode. Add error handling. + (xtensa_insnbuf_from_chars): Add num_chars parameter. Decode the + instruction length to find the number of bytes to copy. + (xtensa_isa_init): Add error handling. Replace calls to + xtensa_load_isa and xtensa_extend_isa with code to initialize lookup + tables in the xtensa_modules structure. + (xtensa_check_isa_config, xtensa_add_isa, xtensa_load_isa, + xtensa_extend_isa): Delete. + (xtensa_isa_free): Change to only free lookup tables. + (opname_lookup_compare): Replace with ... + (xtensa_isa_name_compare): ... this function. Use strcasecmp. + (xtensa_insn_maxlength): Rename to ... + (xtensa_isa_maxlength): ... this. + (xtensa_insn_length): Delete. + (xtensa_insn_length_from_first_byte): Replace with ... + (xtensa_isa_length_from_chars): ... this function. + (xtensa_num_opcodes): Rename to ... + (xtensa_isa_num_opcodes): ... this. + (xtensa_isa_num_pipe_stages, xtensa_isa_num_formats, + xtensa_isa_num_regfiles, xtensa_isa_num_stages, + xtensa_isa_num_sysregs, xtensa_isa_num_interfaces, + xtensa_isa_num_funcUnits, xtensa_format_name, xtensa_format_lookup, + xtensa_format_decode, xtensa_format_encode, xtensa_format_length, + xtensa_format_num_slots, xtensa_format_slot_nop_opcode, + xtensa_format_get_slot, xtensa_format_set_slot): New functions. + (xtensa_opcode_lookup): Add error handling. + (xtensa_decode_insn): Replace with ... + (xtensa_opcode_decode): ... this function, with new format and + slot parameters. Add error handling. + (xtensa_encode_insn): Replace with ... + (xtensa_opcode_encode): ... this function, which does the encoding via + one of the entries in the "encode_fns" array. Add error handling. + (xtensa_opcode_name): Add error handling. + (xtensa_opcode_is_branch, xtensa_opcode_is_jump, xtensa_opcode_is_loop, + xtensa_opcode_is_call): New. + (xtensa_num_operands): Replace with ... + (xtensa_opcode_num_operands): ... this function. Add error handling. + (xtensa_opcode_num_stateOperands, + xtensa_opcode_num_interfaceOperands, xtensa_opcode_num_funcUnit_uses, + xtensa_opcode_funcUnit_use, xtensa_operand_name, + xtensa_operand_is_visible): New. + (xtensa_get_operand, xtensa_operand_kind): Delete. + (xtensa_operand_inout): Add error handling and special-case for + "sout" operands. + (xtensa_operand_get_field, xtensa_operand_set_field): Rewritten to + operate on one slot of an instruction. Added error handling. + (xtensa_operand_encode): Handle default operands with no encoding + functions. Check for success by comparing against decoded value. + Add error handling. + (xtensa_operand_decode): Handle default operands. Return decoded value + through argument pointer. Add error handling. + (xtensa_operand_is_register, xtensa_operand_regfile, + xtensa_operand_num_regs, xtensa_operand_is_known_reg): New. + (xtensa_operand_isPCRelative): Rename to ... + (xtensa_operand_is_PCrelative): ... this. Add error handling. + (xtensa_operand_do_reloc, xtensa_operand_undo_reloc): Return value + through argument pointer. Add error handling. + (xtensa_stateOperand_state, xtensa_stateOperand_inout, + xtensa_interfaceOperand_interface, xtensa_regfile_lookup, + xtensa_regfile_lookup_shortname, xtensa_regfile_name, + xtensa_regfile_shortname, xtensa_regfile_view_parent, + xtensa_regfile_num_bits, xtensa_regfile_num_entries, + xtensa_state_lookup, xtensa_state_name, xtensa_state_num_bits, + xtensa_state_is_exported, xtensa_sysreg_lookup, + xtensa_sysreg_lookup_name, xtensa_sysreg_name, xtensa_sysreg_number, + xtensa_sysreg_is_user, xtensa_interface_lookup, xtensa_interface_name, + xtensa_interface_num_bits, xtensa_interface_inout, + xtensa_interface_has_side_effect, xtensa_funcUnit_lookup, + xtensa_funcUnit_name, xtensa_funcUnit_num_copies): New. + * xtensa-modules.c: Rewrite to use new data structures. + * reloc.c (BFD_RELOC_XTENSA_DIFF8, BFD_RELOC_XTENSA_DIFF16, + BFD_RELOC_XTENSA_DIFF32, BFD_RELOC_XTENSA_SLOT0_OP, + BFD_RELOC_XTENSA_SLOT1_OP, BFD_RELOC_XTENSA_SLOT2_OP, + BFD_RELOC_XTENSA_SLOT3_OP, BFD_RELOC_XTENSA_SLOT4_OP, + BFD_RELOC_XTENSA_SLOT5_OP, BFD_RELOC_XTENSA_SLOT6_OP, + BFD_RELOC_XTENSA_SLOT7_OP, BFD_RELOC_XTENSA_SLOT8_OP, + BFD_RELOC_XTENSA_SLOT9_OP, BFD_RELOC_XTENSA_SLOT10_OP, + BFD_RELOC_XTENSA_SLOT11_OP, BFD_RELOC_XTENSA_SLOT12_OP, + BFD_RELOC_XTENSA_SLOT13_OP, BFD_RELOC_XTENSA_SLOT14_OP, + BFD_RELOC_XTENSA_SLOT0_ALT, BFD_RELOC_XTENSA_SLOT1_ALT, + BFD_RELOC_XTENSA_SLOT2_ALT, BFD_RELOC_XTENSA_SLOT3_ALT, + BFD_RELOC_XTENSA_SLOT4_ALT, BFD_RELOC_XTENSA_SLOT5_ALT, + BFD_RELOC_XTENSA_SLOT6_ALT, BFD_RELOC_XTENSA_SLOT7_ALT, + BFD_RELOC_XTENSA_SLOT8_ALT, BFD_RELOC_XTENSA_SLOT9_ALT, + BFD_RELOC_XTENSA_SLOT10_ALT, BFD_RELOC_XTENSA_SLOT11_ALT, + BFD_RELOC_XTENSA_SLOT12_ALT, BFD_RELOC_XTENSA_SLOT13_ALT, + BFD_RELOC_XTENSA_SLOT14_ALT): Add new relocations. + * Makefile.am (xtensa-isa.lo, xtensa-modules.lo): Update dependencies. + * Makefile.in: Regenerate. + * bfd-in2.h: Likewise. + * libbfd.h: Likewise. + +2004-10-07 Richard Sandiford + + * elf64-mips.c (mips_elf64_write_rel): Use STN_UNDEF for relocs + against the absolute section. + (mips_elf64_write_rela): Likewise. + +2004-10-07 Jan Beulich + + * elf.c (elf_find_function): Don't generally check for matching + section, just for non-file symbols. Remove redunant comparison + for the latter. + * elf32-arm.h (arm_elf_find_function): Likewise. + +2004-10-07 Jeff Baker + + * elflink.c (_bfd_elf_add_dynamic_entry): Add code to warn if + adding a DT_TEXTREL to a shared object and --warn-shared-textrel + was specified. + +2004-10-04 Roland McGrath + + * hash.c (bfd_hash_set_default_size): Use const for table. + Use size_t instead of int for variable compared to sizeof results. + +2004-10-05 Alan Modra + + PR 425 + * syms.c (_bfd_stab_section_find_nearest_line): Ignore R_*_NONE relocs. + +2004-10-01 Paul Brook + + * elf32-arm.h (elf32_arm_fake_sections, + is_arm_elf_unwind_section_name, elf32_arm_section_from_shdr): New + functions. + (elf_backend_fake_sections, elf_backend_section_from_shdr): Define. + +2004-10-01 Alan Modra + + * elf-bfd.h (struct eh_cie_fde): Add need_relative and + need_lsda_relative. + * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Set + need_relative or need_lsda_relative if we are processing an + offset for a reloc on a FDE initial loc or LSDA field + respectively. + (_bfd_elf_write_section_eh_frame): Test need_relative and + need_lsda_relative in place of corresponding make_* field + when deciding to use pc-relative encodings. + +2004-09-30 Paul Brook + + * elf32-arm.h (bfd_elf32_arm_set_target_relocs): Handle "abs" + target2 relocation type. + +2004-09-30 H.J. Lu + + PR 414 + * elflink.c (_bfd_elf_merge_symbol): Check TLS symbol. + +2004-09-30 Paul Brook + + * reloc.c: Add BFD_RELOC_ARM_SMI. + * bfd-in2.h: Regenerate. + * libbfd.h: Ditto. + +2004-09-24 Alan Modra + + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Add output section + vma and output offset to address. + * simple.c (simple_save_output_info): Only set output section + and offset for debug sections, or those not already set up by + the linker. + (bfd_simple_get_relocated_section_contents): Update comment. + +2004-09-24 Alan Modra + + * elf.c (IS_LOADED): Delete. + (assign_file_positions_for_segments): Just test SEC_LOAD instead. + Restore SEC_HAS_CONTENTS test to the one place it was used prior + to 2004-09-22. + +2004-09-23 Alan Modra + + PR gas/396 + * elf32-sparc.c (elf32_sparc_final_write_processing): Handle + bfd_mach_sparc_sparclet and bfd_mach_sparc_sparclite. Remove + redundant assignment of EM_SPARC. + +2004-09-22 Brian Ford + + * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte + alignment for .rdata sections so sse[2] code works with gcc >= 3.3.3 + constants. + * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. + +2004-09-22 Alan Modra + + * elf32-ppc.c (ppc_elf_modify_segment_map): Delete. + (elf_backend_modify_segment_map): Don't define. + +2004-09-22 Alan Modra + + * elf.c (IS_LOADED): Define. + (assign_file_positions_for_segments): Don't round up file offset of + PT_LOAD segments containing no SEC_LOAD sections, instead round down. + Delete code handling link script adjustment of lma. Do the adjust + in later code handling similar ajustments. Remove dead code error + check. Warn if section lma would require a negative offset + adjustment. Tweak lma adjustment to use p_filesz rather than p_memsz. + Use p_vaddr + p_memsz inside section loop in place of voff. Don't + update voff in section loop. Change voff in segment loop to be an + adjustment on top of "off". Set sec->filepos and update "off" later. + Test for loadable sections consistently using IS_LOADED. Similarly, + test for alloc-only sections other than .tbss consistently. + Don't bother checking SEC_ALLOC in PT_LOAD segments. Remove FIXME. + Tidy PT_NOTE handling. Use %B and %A in error messages. + (assign_file_positions_except_relocs): Use %B in error message. + +2004-09-17 H.J. Lu + + * Makefile.am (AUTOMAKE_OPTIONS): Require 1.9. + (CONFIG_STATUS_DEPENDENCIES): New. + (Makefile): Removed. + (config.status): Likewise. + * Makefile.in: Regenerated. + +2004-09-17 Paul Brook + + * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add prototype. + (bfd_elf32_arm_process_before_allocation): Update prototype. + * bfd-in2.h: Regenerate. + * elf32-arm.h (elf32_arm_link_hash_table): Add target2_reloc. + (elf32_arm_link_hash_table_create): Set it. + (bfd_elf32_arm_process_before_allocation): Remove target1_is_rel. + (bfd_elf32_arm_set_target_relocs): New function. + (arm_real_reloc_type): New function. + (elf32_arm_final_link_relocate): Use it. Handle R_ARM_PREL31 and + R_ARM_GOT_PREL. Remove R_ARM_TARGET1. + (elf32_arm_gc_sweep_hook): Ditto. + (elf32_arm_check_relocs): Ditto. + (elf32_arm_relocate_section): Handle R_ARM_GOT_PREL. + * elfarm-nabi.c (elf32_arm_howto_table): Add R_ARM_PREL31 and + R_ARM_GOT_TARGET2. + (elf32_arm_got_prel): New variable. + (elf32_arm_howto_from_type): New function. + (elf32_arm_info_to_howto): Use it. + (elf32_arm_reloc_map): Add BFD_RELOC_ARM_PREL31 and + BFD_RELOC_ARM_TARGET2. + * libbfd.h: Regenerate. + * reloc.c: Add BFD_RELOC_ARM_TARGET2 and BFD_RELOC_ARM_PREL31. + +2004-09-17 Alan Modra + + * ecoff.c: Update u.undef.next refs. + * elf64-ppc.c: Likewise. + * elflink.c: Likewise. + * linker.c: Likewise. + * xcofflink.c: Likewise. + + * elf-bfd.h (struct elf_link_hash_entry): Rearrange. Add FIXME to + dynamic_def. Combine weakdef and elf_hash_value. Move vtable + fields to indirect struct. + * elf-m10300.c: Update u.weakdef refs. + * elf32-arm.h: Likewise. + * elf32-cris.c: Likewise. + * elf32-frv.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-vax.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-sparc.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * elflink.c: Likewise. Also u.elf_hash_value. + (elf_gc_propagate_vtable_entries_used): Update for h->vtable + indirection. + (elf_gc_smash_unused_vtentry_relocs): Likewise. + (bfd_elf_gc_record_vtinherit): Alloc vtable. + (bfd_elf_gc_record_vtentry): Likewise. + * elf.c (_bfd_elf_link_hash_newfunc): Use memset. + +2004-09-17 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. + +2004-09-16 Alan Modra + + * elf-bfd.h (struct elf_link_hash_entry): Replace elf_link_hash_flags + with bitfields. Make "type" and "other" bitfields too. + (ELF_LINK_HASH_REF_REGULAR, ELF_LINK_HASH_DEF_REGULAR, + ELF_LINK_HASH_REF_DYNAMIC, ELF_LINK_HASH_DEF_DYNAMIC, + ELF_LINK_HASH_REF_REGULAR_NONWEAK, ELF_LINK_HASH_DYNAMIC_ADJUSTED, + ELF_LINK_HASH_NEEDS_COPY, ELF_LINK_HASH_NEEDS_PLT, ELF_LINK_NON_ELF, + ELF_LINK_HIDDEN, ELF_LINK_FORCED_LOCAL, ELF_LINK_HASH_MARK, + ELF_LINK_NON_GOT_REF, ELF_LINK_DYNAMIC_DEF, ELF_LINK_DYNAMIC_WEAK, + ELF_LINK_POINTER_EQUALITY_NEEDED): Delete. + (ELF_COMMON_DEF_P, WILL_CALL_FINISH_DYNAMIC_SYMBOL): Update. + * elf-hppa.h: Update all uses of elf_link_hash_flags. + * elf-m10300.c: Likewise. + * elf.c: Likewise. + * elf32-arm.h: Likewise. + * elf32-cris.c: Likewise. + * elf32-frv.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh-symbian.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-vax.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-sparc.c: Likewise. + * elf64-x86-64.c: Likewise. + * elflink.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * configure.in (AM_INIT_AUTOMAKE): Set version to 2.15.92. + * configure: Regenerate. + * aclocal.m4: Regenerate. + +2004-09-16 Alan Modra + + * elf32-arm.h (elf32_arm_gc_sweep_hook): Add #ifndef OLD_ARM_ABI + around uses of R_ARM_TARGET1. + (elf32_arm_check_relocs): Likewise. + +2004-09-13 Paul Brook + + * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update + prototype. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * elf32-arm.h (elf32_arm_link_hash_table): Add target1_is_rel. + (elf32_arm_link_hash_table_create): Set target1_is_rel. + (bfd_elf32_arm_process_before_allocation): Ditto. + (elf32_arm_final_link_relocate): Handle R_ARM_TARGET1. + (elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto. + * elfarm-nabi.c (elf32_arm_howto_table): Rename RELABS to TARGET1. + * reloc.c: Ditto. + +2004-09-10 Joel Brobecker + + * hpux-core.c (thread_section_p): New function. + (hpux_core_core_file_p): Fix computation of offset in call + to bfd_seek. Create a ".reg" section from an arbitrary + ".reg/" section if none was created after having read + all sections. + +2004-09-11 Andreas Schwab + + * acinclude.m4: Fix spelling of ACX_NONCANONICAL_*. + * aclocal.m4: Rebuild. + * configure: Rebuild. + +2004-09-10 Joel Brobecker + + * section.c (bfd_sections_find_if): Fix parameter name in + comment to match code. + +2004-09-10 Alan Modra + + * elf.c (assign_file_positions_except_relocs): Assign relocs + stored in a bfd section. + +2004-09-08 Hans-Peter Nilsson + + * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Reset + h->gotplt_refcount to 0, not -1. + +2004-09-07 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) : For internal error message, handle NULL + symname. + (cris_elf_check_relocs) : Don't try to + handle symbol visibility here. + +2004-09-07 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_table): Add stub_globals. + (is_ppc64_elf_target): Rename from is_ppc64_target. Update all + callers. + (ppc_stub_name): Remove trailing "+0" on stub name. + (create_linkage_sections): Create relocations for + branch lookup table when --emit-relocs as well as when --shared. + (ppc_build_one_stub): Emit relocs for long branch stubs. Adjust + relbrlt test. For --emit-stub-syms, always output a sym even when + one already exists on a plt call stub. Put stub type in the stub + symbol name. + (ppc_size_one_stub): Size long branch stub relocs. Adjust relbrlt + test. + (ppc64_elf_size_stubs): Count global sym stubs added. Zero + reloc_count in stub sections. Adjust relbrlt test. + (ppc64_elf_build_stubs): Adjust relbrlt test. Tweak stats output. + * elflink.c (bfd_elf_size_dynamic_sections): Fix comment typo. + (elf_link_input_bfd): Ignore symbol index zero relocs when checking + for relocs against discarded symbols. Fix comments. + +2004-09-06 Mark Mitchell + + * elf-bfd.h (_bfd_elf_make_dynamic_segment): Declare it. + * elf.c (_bfd_elf_make_dynamic_segment): New function, split out + from ... + (map_sections_to_segments): ... here. Use it. Assign a file + position to the .dynamic section if it is not loadable, but part + of the PT_DYNAMIC segment. + * elf32-arm.h (elf32_arm_finish_dynamic_sections): Use file + offsets, not VMAs, for the BPABI. Do not fill in the header in + the .got.plt section for the BPABI. + * elfarm-nabi.c (elf32_arm_symbian_modify_segment_map): Add a + PT_DYNAMIC segment. + (elf_backend_want_got_plt): Define to zero for Symbian OS. + +2004-09-06 Nick Clifton + + * elflink.c (elf_link_add_object_symbols): Set the error code to + bfd_error_wrong_format when the input format does not match the + output format. + +2004-09-06 Alan Modra + + * elf64-ppc.c (is_ppc64_target): New function, extracted from.. + (ppc64_elf_check_directives): ..here. + (ppc64_elf_size_dynamic_sections): Use it here to check bfd type + before accessing ppc64_elf_tdata. + (ppc64_elf_finish_dynamic_sections): And here too. + +2004-09-04 Alan Modra + + * bfd.c (_bfd_default_error_handler): Correct loop exit. + +2004-09-03 Mark Mitchell + + * config.bfd (arm*-*-symbianelf*): Use OS-specific target vectors. + * configure.in (bfd_elf32_bigarm_symbian_vec): Add it. + (bfd_elf32_littlearm_symbian_vec): Likewise. + * configure: Regenerated. + * elf-bfd.h (elf_backend_data): Add dynamic_sec_flags. + * elf32-arm.h (PLT_HEADER_SIZE): Do not define. + (PLT_ENTRY_SIZE): Likewise. + (bfd_vma_elf32_arm_symbian_plt_entry): New + variable. + (elf32_arm_link_hash_table): Add plt_header_size, plt_entry_size, + and symbian_p. + (create_got_section): Don't create sections when generating BPABI + objects. + (elf32_arm_create_dynamic_sections): Tidy. + (elf32_arm_link_hash_table_create): Set plt_header_size, + plt_entry_size, and symbian_p. + (elf32_arm_check_relocs): Do not mark .rel.dyn as loadable when + generating BPABI objects. + (allocate_dynrelocs): Use htab->plt_header_size, not + PLT_HEADER_SIZE. Do not add to .got.plt when + generating BPABI objects. + (elf32_arm_finish_dynamic_symbol): Generate Symbian OS PLTs. + * elfarm-nabi.c: Add SymbianOS target vectors. + * elflink.c (_bfd_elf_create_got_section): Use dynamic_sec_flags. + (_bfd_elf_link_create_dynamic_sections): Likewise. + * elfxx-target.h (ELF_DYNAMIC_SEC_FLAGS): New macro. + (elfNN_bed): Use it. + * targets.c (bfd_elf32_bigarm_symbian_vec): New variable. + (bfd_elf32_littlearm_symbian_vec): Likewise. + (_bfd_target_vector): Add them. + +2004-09-03 Nick Clifton + + PR 360 + * coffcode.h (handle_COMDAT): Replace abort with an warning + message and allow the scan to continue. + +2004-09-02 Alan Modra + + * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Use static_syms passed + in when reading relocs, not our sorted syms. Remove unnecessary + var. + +2004-08-31 Eric Botcazou + + * elf.c (special_sections): Add .gnu.linkonce.b modelled on .bss. + +2004-08-30 Nathanael Nerode + + * acinclude.m4: Require AC_CANONICAL_TARGET, not AC_CANONICAL_SYSTEM. + Include ../config/acx.m4 and use ACX_NONCANONICAL_* where appropriate; + replace uses of *_alias with *_noncanonical. + * aclocal.m4: Rebuild with aclocal 1.4p6. + * Makefile.in: Rebuild with automake 1.4p6. + * doc/Makefile.in: Rebuild with automake 1.4p6. + * configure.in: Autoupdate with autoupdate 2.59. + * config.in: Regenerate with autoheader 2.59. + * configure: Regnerate with autoconf 2.59. + +2004-08-28 Alan Modra + + * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Copy input + symbol pointer arrays before modifying. + +2004-08-28 Alan Modra + + * bfd.c (bfd_get_synthetic_symtab): Pass counts and both symbol tables. + * elf-bfd.h (_bfd_elf_get_synthetic_symtab): Adjust. + * elf.c (_bfd_elf_get_synthetic_symtab): Adjust. + * libbfd-in.h (_bfd_nodynamic_get_synthetic_symtab): Adjust. + * targets.c (struct bfd_target <_bfd_get_synthetic_symtab>): Adjust. + * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't read symbols. + Use both symbol tables on non-relocatable objects. Use a common + error exit. Fix "mid" warning. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2004-08-28 Alan Modra + + * elf64-ppc.c (ppc64_elf_branch_reloc): Check .opd is in a regular + object file. + (struct sfpr_def_parms): Save some space. + (sfpr_define): Here too. + + * elf64-ppc.c (compare_symbols): Put section syms first. + (sym_exists_at): New function. + (ppc64_elf_get_synthetic_symtab): Use relocs to find code entry + points only for relocatable files. Use .opd section contents + otherwise. Generally clean up the code. + +2004-08-27 Alan Modra + + * elf64-ppc.c (STD_R0_0R1, STD_R0_0R12, LD_R0_0R1, LD_R0_0R12, + LI_R12_0, STVX_VR0_R12_R0, LVX_VR0_R12_R0, MTLR_R0, SFPR_MAX): Define. + (struct sfpr_def_parms): New. + (sfpr_define): New function. + (savegpr0, savegpr0_tail, restgpr0, restgpr0_tail): New functions. + (savegpr1, savegpr1_tail, restgpr1, restgpr1_tail): New functions. + (savefpr, savefpr0_tail, restfpr, restfpr0_tail): New functions. + (savefpr1_tail, restfpr1_tail): New functions. + (savevr, savevr_tail, restvr, restvr_tail): New functions. + (MIN_SAVE_FPR, MAX_SAVE_FPR): Don't define. + (ppc64_elf_func_desc_adjust): Use sfpr_define in place of existing + code. Define all ABI mandated _save and _rest functions. + +2004-08-26 Paul Brook + + * elf32-arm.h (INTERWORK_FLAG): Return true for EABIv3 objects. + +2004-08-26 Alan Modra + + * elf32-m32r.c (m32r_elf_relocate_section): Don't compare with + TRUE or FALSE. + +2004-08-26 Alan Modra + + * elf32-i386.c (elf_i386_relocate_section): Tweak last change so + that pcrel correction is applied for R_386_PC32. + +2004-08-25 Alan Modra + + * elf32-i386.c (elf_i386_relocate_section): Zero section contents + for R_386_32 and R_386_PC32 relocs against symbols defined in + discarded sections. + +2004-08-25 Dmitry Diky + + * reloc.c (BFD_RELOC_MSP430_2X_PCREL,BFD_RELOC_MSP430_RL_PCREL): + Add new relocations. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * elf32-msp430.c: Clean-up code. + (elf_msp430_howto_table): Add new relocation entries. + (bfd_elf32_bfd_reloc_type_lookup): New relocation handlers. + (msp430_elf_relax_section): New function. + (msp430_elf_relax_delete_bytes): New function. + (msp430_elf_symbol_address_p): New function. + +2004-08-24 Kazuhiro Inaoka + + * elf32-m32r.c (m32r_elf_relocate_section): Handle + R_M32R_SDA16_RELA in the same way as R_M32R_SDA16. + +2004-08-20 Daniel Jacobowitz + + * elflink.c (_bfd_elf_section_already_linked): Handle + SEC_LINK_DUPLICATES_SAME_CONTENTS. + +2004-08-19 Mark Mitchell + + * config.bfd (arm*-*-symbianelf*): New target. + (arm*-*-eabi*): Likewise. + +2004-08-19 Alan Modra + + * elf64-ppc.c (ppc_get_stub_entry): Change third param to a + "struct ppc_link_hash_entry *". + (ppc64_elf_relocate_section): Ditto for type of h. Introduce h_elf + to satisfy RELOC_FOR_GLOBAL_SYMBOL. + +2004-08-19 Jakub Jelinek + + * elf64-ppc.c (ppc64_elf_edit_opd): Support 16 byte long .opd + entries (where fd_aux overlaps next entry's fd_func). + Add non_overlapping argument, use it. + (ppc64_elf_check_relocs, ppc64_elf_gc_mark_hook, adjust_opd_syms, + ppc64_elf_size_stubs, ppc64_elf_relocate_section, + ppc64_elf_output_symbol_hook): Use address / 8 instead of address / 24 + as indexes into opd_sym_map/opd_adjust array. + * elf64-ppc.h (ppc64_elf_edit_opd): Adjust prototype. + +2004-08-18 Alan Modra + + * elf64-ppc.c (func_desc_adjust): Give undefined dot-symbols a value + if we can look up their function descriptor in a regular file. + +2004-08-18 Nick Clifton + + PR 324 + * cofflink.c (coff_link_add_symbols): Check that the comdat + pointer in the coff_section_data structure has been initialised + before using it. + +2004-08-18 Alan Modra + + PR 338 + * elflink.c (bfd_elf_record_link_assignment): Add comment about + changing bfd_link_hash_undefined to bfd_link_hash_new. + +2004-08-17 Jakub Jelinek + + * elfxx-target.h (bfd_elfNN_get_synthetic_symtab): Only define + if not yet defined. + * elf64-ppc.c (bfd_elf64_get_synthetic_symtab): Define. + (synthetic_opd, synthetic_relocatable): New variables. + (compare_symbols, compare_relocs): New helper routines. + (ppc64_elf_get_synthetic_symtab): New function. + * bfd.c (bfd_get_synthetic_symtab): Rename dynsyms argument + to relsyms. + * bfd-in2.h: Regenerated. + * elf.c (_bfd_elf_get_synthetic_symtab): Rename dynsyms argument + to relsyms. Return 0 if abfd is relocatable. + +2004-08-17 Alan Modra + + * elflink.h (elf_gc_sweep): Keep non-alloc, non-load sections. + +2004-08-17 Nick Clifton + + * (is_arm_mapping_symbol_name): New function - return true + when a symbol name matches the requirements for an ARM mapping + symbol name. + (arm_elf_find_function): New function based on + elf_find_function in elf.c but skipping ARM mapping symbols + and including thumb function symbols. + (elf32_arm_find_nearest_line): Use arm_elf_find_function. + (elf32_arm_output_symbol_hook): Use is_arm_mapping_symbol_name. + +2004-08-17 Alan Modra + + * elf64-ppc.c (ppc64_elf_branch_reloc): New function. + (ppc64_elf_howto_raw): Use ppc64_elf_branch_reloc. + (ppc64_elf_brtaken_reloc): Here too. + +2004-08-17 Alan Modra + + * elf64-ppc.c (add_symbol_adjust): Correct mismatched function + symbol visibility. + (ppc64_elf_check_directives): Check that we have the right hash + table before proceeding. + +2004-08-17 Alan Modra + + * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add "deleted_section". + (adjust_opd_syms): Attach opd syms for deleted entries to one of + the sections that will be discarded. + +2004-08-16 Alan Modra + + * elflink.c (elf_section_complain_discarded): Ignore .fixup. + +2004-08-16 Alan Modra + + * bfd.c (_bfd_default_error_handler): Account for doubled '%' in + free space available. + +2004-08-16 Alan Modra + + * pdp11.c (struct pdp11_aout_reloc_external): Delete. Replace + occurrences with bfd_byte * thoughout file. + + * coff-rs6000.c (do_shared_object_padding): Warning fix. + (xcoff_write_armap_big): Likewise. + (xcoff_write_archive_contents_old): Likewise. + (xcoff_write_archive_contents_big): Likewise. + + * elf64-mmix.c (mmix_elf_get_section_contents): Delete declaration. + +2004-08-13 Nick Clifton + + * elf32-arm.h: Convert to ISO C90. + +2004-08-13 Alan Modra + + PR 293 + * elf32-hppa.c (elf32_hppa_hide_symbol): Use init_refcount to + zero the plt field. + +2004-08-13 Alan Modra + + * bfd.c (_bfd_default_error_handler): Handle %A and %B. + (bfd_archive_filename, bfd_get_section_ident): Delete. + * ecofflink.c (bfd_ecoff_debug_accumulate_other): Don't call + bfd_archive_filename. + * elflink.c (elf_link_input_bfd): Don't use callbacks->error_handler + to warn about symbols in discarded sections. Use _bfd_error_handler. + * aout-adobe.c (aout_adobe_callback): See below. + * aout-cris.c (swap_ext_reloc_in): .. + * coff-arm.c (find_thumb_glue, find_arm_glue, + coff_arm_relocate_section, bfd_arm_process_before_allocation, + coff_arm_merge_private_bfd_data, _bfd_coff_arm_set_private_flags, + coff_arm_copy_private_bfd_data): .. + * coff-i860.c (i860_reloc_processing): .. + * coff-mcore.c (mcore_coff_unsupported_reloc, + coff_mcore_relocate_section): .. + * coff-ppc.c (coff_ppc_relocate_section): .. + * coff-rs6000.c (xcoff_create_csect_from_smclas + * coff-sh.c (sh_relax_section, sh_relax_delete_bytes, + sh_swap_insns, sh_relocate_section): .. + * coff-tic54x.c (tic54x_reloc_processing): .. + * coff-tic80.c (coff_tic80_relocate_section): .. + * coff64-rs6000.c (xcoff64_create_csect_from_smclas): .. + * coffcode.h (styp_to_sec_flags, coff_slurp_line_table, + coff_slurp_symbol_table, coff_classify_symbol, + coff_slurp_reloc_table): .. + * coffgen.c (_bfd_coff_read_string_table): .. + * cofflink.c (coff_link_add_symbols, _bfd_coff_link_input_bfd, + _bfd_coff_generic_relocate_section): .. + * cpu-arm.c (bfd_arm_merge_machines): .. + * cpu-sh.c (sh_merge_bfd_arch): .. + * elf-hppa.h (elf_hppa_relocate_section): .. + * elf.c (bfd_elf_string_from_elf_section, setup_group, + _bfd_elf_setup_group_pointers, bfd_section_from_shdr, + assign_section_numbers, _bfd_elf_symbol_from_bfd_symbol, + copy_private_bfd_data, _bfd_elf_validate_reloc): .. + * elf32-arm.h (find_thumb_glue, find_arm_glue, + bfd_elf32_arm_process_before_allocation, elf32_thumb_to_arm_stub, + elf32_arm_to_thumb_stub, elf32_arm_final_link_relocate, + elf32_arm_relocate_section, elf32_arm_set_private_flags, + elf32_arm_copy_private_bfd_data, elf32_arm_merge_private_bfd_data): .. + * elf32-cris.c (cris_elf_relocate_section, cris_elf_check_relocs, + cris_elf_merge_private_bfd_data + * elf32-frv.c (elf32_frv_relocate_section, elf32_frv_check_relocs): .. + * elf32-gen.c (elf32_generic_link_add_symbols): .. + * elf32-hppa.c (hppa_add_stub, hppa_build_one_stub, + elf32_hppa_check_relocs, get_local_syms, final_link_relocate, + elf32_hppa_relocate_section): .. + * elf32-i370.c (i370_elf_merge_private_bfd_data, + i370_elf_check_relocs, i370_elf_relocate_section): .. + * elf32-i386.c (elf_i386_info_to_howto_rel, elf_i386_check_relocs, + elf_i386_relocate_section): .. + * elf32-m32r.c (m32r_elf_relocate_section, + m32r_elf_merge_private_bfd_data): .. + * elf32-m68hc1x.c (m68hc12_add_stub, + _bfd_m68hc11_elf_merge_private_bfd_data): .. + * elf32-m68k.c (elf_m68k_relocate_section): .. + * elf32-mcore.c (mcore_elf_unsupported_reloc, + mcore_elf_relocate_section): .. + * elf32-ppc.c (ppc_elf_merge_private_bfd_data, bad_shared_reloc, + ppc_elf_check_relocs, ppc_elf_relocate_section, + ppc_elf_begin_write_processing): .. + * elf32-s390.c (elf_s390_check_relocs, invalid_tls_insn, + elf_s390_relocate_section): .. + * elf32-sh-symbian.c (sh_symbian_import_as, + sh_symbian_process_embedded_commands, + sh_symbian_relocate_section): .. + * elf32-sh.c (sh_elf_relax_section, sh_elf_relax_delete_bytes, + sh_elf_swap_insns, sh_elf_relocate_section, sh_elf_check_relocs, + sh_elf_merge_private_data): .. + * elf32-sparc.c (elf32_sparc_check_relocs, + elf32_sparc_relocate_section, + elf32_sparc_merge_private_bfd_data): .. + * elf32-v850.c (v850_elf_check_relocs, + v850_elf_merge_private_bfd_data): .. + * elf32-xtensa.c (elf_xtensa_check_relocs, + elf_xtensa_relocate_section, elf_xtensa_merge_private_bfd_data): .. + * elf64-alpha.c (elf64_alpha_relax_with_lituse, + elf64_alpha_relax_got_load, elf64_alpha_size_got_sections, + elf64_alpha_relocate_section_r, elf64_alpha_relocate_section): .. + * elf64-gen.c (elf64_generic_link_add_symbols): .. + * elf64-ppc.c (ppc64_elf_merge_private_bfd_data, ppc_add_stub, + ppc64_elf_check_relocs, ppc64_elf_edit_opd, + ppc64_elf_relocate_section): .. + * elf64-s390.c (elf_s390_check_relocs, invalid_tls_insn, + elf_s390_relocate_section): .. + * elf64-sh64.c (sh_elf64_relocate_section): .. + * elf64-sparc.c (sparc64_elf_check_relocs, + sparc64_elf_add_symbol_hook, sparc64_elf_relocate_section, + sparc64_elf_merge_private_bfd_data): .. + * elf64-x86-64.c (elf64_x86_64_check_relocs, + elf64_x86_64_relocate_section): .. + * elflink.c (_bfd_elf_add_default_symbol, + _bfd_elf_link_assign_sym_version, elf_link_read_relocs_from_section, + _bfd_elf_link_output_relocs, elf_link_add_object_symbols, + bfd_elf_size_dynamic_sections, elf_link_output_extsym, + elf_get_linked_section_vma, elf_fixup_link_order, + bfd_elf_final_link, bfd_elf_gc_record_vtinherit, + bfd_elf_gc_record_vtinherit, _bfd_elf_section_already_linked): .. + * elfxx-ia64.c (elfNN_ia64_relax_section, + elfNN_ia64_relocate_section, elfNN_ia64_merge_private_bfd_data): .. + * elfxx-mips.c (mips_elf_perform_relocation, + _bfd_mips_elf_check_relocs, + _bfd_mips_elf_merge_private_bfd_data): .. + * ieee.c (ieee_slurp_external_symbols): .. + * ihex.c (ihex_bad_byte, ihex_scan, ihex_read_section): .. + * libbfd.c (_bfd_generic_verify_endian_match): .. + * linker.c (_bfd_generic_link_add_one_symbol, + _bfd_generic_section_already_linked): .. + * pdp11.c (translate_to_native_sym_flags): .. + * pe-mips.c (coff_pe_mips_relocate_section): .. + * peicode.h (pe_ILF_build_a_bfd): .. + * srec.c (srec_bad_byte): .. + * stabs.c (_bfd_link_section_stabs): .. + * xcofflink.c (xcoff_link_add_symbols, xcoff_link_input_bfd): .. + Replace all uses of bfd_archive_filename and bfd_get_section_ident + with corresponding %B and %A in _bfd_error_handler format string. + Replace occurrences of "fprintf (stderr," with _bfd_error_handler + calls to use %A and %B. Fix "against symbol .. from section" and + similar error messages. Combine multiple _bfd_error_handler calls + where they were separated due to bfd_archive_filename deficiencies. + * bfd-in2.h: Regenerate. + +2004-08-12 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Report unrecognized + relocation. + +2004-08-10 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_entry): Add was_undefined. + (struct ppc_link_hash_table): Remove no_multi_toc, multi_toc_needed. + Make emit_stub_syms, stub_error and has_14bit_branch bit-fields. + Add twiddled_syms. + (link_hash_newfunc): Init was_undefined. + (add_symbol_adjust): Don't set undefined dot symbols to defweak; + Use undefweak instead. + (ppc64_elf_check_directives): Fix undefs chain. + (ppc64_elf_next_toc_section): Remove no_multi_toc and multi_toc_needed + references. + (ppc64_elf_size_stubs): Adjust for add_symbol_adjust change. + (undo_symbol_twiddle, ppc64_elf_restore_symbols): New functions. + * elf64-ppc.h (ppc64_elf_restore_symbols): Declare. + +2004-08-09 Jakub Jelinek + + * elf64-x86-64.c (elf64_x86_64_relocate_section): For -fno-pic + error, test input_section flags rather than sec. + +2004-08-09 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add + elf_backend_archive_symbol_lookup. + (_bfd_elf_archive_symbol_lookup): Declare. + * elflink.c (_bfd_elf_archive_symbol_lookup): New function.. + (elf_link_add_archive_symbols): ..extracted from here. Call the + backend version. + * elfxx-target.h (elf_backend_archive_symbol_lookup): Provide default. + (elfNN_bed): Init new field. + * elf64-ppc.c (elf_backend_check_directives): Define. + (elf_backend_archive_symbol_lookup): Define. + (struct ppc_link_hash_table): Add tls_get_add_fd. Make tls_get_add + a ppc_link_hash_entry pointer. + (get_fdh): Move. + (ppc64_elf_archive_symbol_lookup, opd_entry_value): New functions. + (add_symbol_adjust, ppc64_elf_check_directives): New functions. + (ppc64_elf_check_relocs, ppc64_elf_gc_mark_hook, func_desc_adjust, + ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup, + ppc64_elf_tls_optimize, allocate_dynrelocs, ppc_type_of_stub, + ppc_build_one_stub, ppc64_elf_size_stubs, ppc64_elf_relocate_section, + ppc64_elf_finish_dynamic_symbol): Handle branch relocs to function + descriptor symbols. + +2004-08-09 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_entry): Expand adjust_done comment. + (ppc64_elf_add_symbol_hook): Test for NULL section. + (get_sym_h): Formatting. + (ppc64_elf_size_stubs): Include reloc addend in value stored as + stub target_value. + + * elf64-ppc.c (ppc64_elf_relocate_section): Combine handling of + long branch stubs with code handling plt and r2off branch stubs. + +2004-08-09 Alan Modra + + * elf-bfd.h (_bfd_elf_gc_mark): Declare. + * elflink.c (elf_link_input_bfd): Formatting. + (_bfd_elf_gc_mark): Rename from elf_gc_mark and make global. Adjust + all callers. + * elf64-ppc.c (struct ppc_link_hash_entry): Remove is_entry. + (link_hash_newfunc): Don't set it. + (ppc64_elf_copy_indirect_symbol): Nor copy it. + (ppc64_elf_mark_entry_syms): Delete. + (ppc64_elf_gc_mark_hook): Mark entry syms here. Also mark opd + sections. Use get_opd_info. + * elf64-ppc.h (ppc64_elf_mark_entry_syms): Delete. + +2004-08-09 Alan Modra + + * elf64-ppc.c (adjust_opd_syms): Fix merge error. + + * elf64-ppc.c (struct ppc_link_hash_table): Remove have_undefweak. + (func_desc_adjust): Don't set have_undefweak. + (ppc64_elf_func_desc_adjust): Don't add an extr nop to sfpr. + (ppc64_elf_relocate_section): NOP out calls to undefweak functions. + + * elf64-ppc.c (struct ppc_link_hash_entry): Make "oh" a + "struct ppc_link_hash_entry *". Adjust all references. + (ppc64_elf_hide_symbol): Correct a comment. + + * elf64-ppc.c (get_opd_info): New function. + (adjust_opd_syms): Use get_opd_info. Define removed symbols as zero. + (ppc64_elf_edit_opd): Use get_opd_info. Check that sym has a dot + before calling get_fdh. Test fdh rather than h before dereferencing + fdh. Mark removed symbols in opd_adjust. + (ppc64_elf_tls_optimize): Don't bother with opd adjustment here. + (ppc64_elf_relocate_section): Use get_opd_info, and handle removed + opd symbols. + (ppc64_elf_output_symbol_hook): Likewise. + +2004-08-06 Paul Brook + + * elfarm-nabi.c (elf32_arm_howto_table): Add new EABI relocations. + (elf32_arm_reloc_map): Add BFD_RELOC_ARM_RELABS32, + BFD_RELOC_ARM_ROSEGREL32 and BFD_RELOC_ARM_SBREL32. + * reloc.c: Add BFD_RELOC_ARM_RELABS32, BFD_RELOC_ARM_ROSEGREL32 + and BFD_RELOC_ARM_SBREL32. + * bfd-in2.h, bbfd.h: Regenerate. + +2004-08-01 Thiemo Seufer + + * elfxx-mips.c (mips_elf_calculate_relocation): Test only for + the dynamic link symbol actually in use. + +2004-08-01 Stephane Carrez + + * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Handle bfd_link_hash_new + +2004-07-31 Joel Brobecker + Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Handle + SHN_MIPS_TEXT and SHN_MIPS_DATA. + +2004-07-30 H.J. Lu + Nick Clifton + + PR 290 + * bfd.c (_bfd_default_error_handler): Make it global. + + * elf-bfd.h (elf_backend_data): Add link_order_error_handler. + + * elf.c (assign_section_numbers): Cope gracefully with sections + which have SHF_LINK_ORDER set but no sh_link set up. + * elflink.c (elf_get_linked_section_vma): Likewise. + + * elfxx-ia64.c (elf_backend_link_order_error_handler): New. Set + it to NULL. + + * elfxx-target.h (elf_backend_link_order_error_handler): New. + Set it to _bfd_default_error_handler. + (elfNN_bed): Add elf_backend_link_order_error_handler. + + * libbfd-in.h (_bfd_default_error_handler): New. + + * libbfd.h: Regenerated. + +2004-07-30 Jakub Jelinek + + * archures.c (bfd_mach_sparc_64bit_p): Define. + * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Use it. + * bfd-in2.h: Rebuilt. + +2004-07-29 Alexandre Oliva + + Introduce SH2a support. + 2004-02-18 Corinna Vinschen + * archures.c (bfd_mach_sh2a_nofpu): New. + * bfd-in2.h: Rebuilt. + * cpu-sh.c (SH2A_NOFPU_NEXT): New. + (arch_info_struct): Add sh2a_nofpu. + * elf32-sh.c (sh_elf_set_mach_from_flags): Handle sh2a_nofpu. + 2003-12-29 DJ Delorie + * reloc.c: Add relocs for sh2a. + * bfd-in2.h: Regenerate. + * libbfd.hh: Regenerate. + 2003-12-01 Michael Snyder + * archures.c (bfd_mach_sh2a): New. + * bfd-in2.h: Rebuilt. + * cpu-sh.c (SH_NEXT, SH2_NEXT, etc.): Change defines to enums. + (SH2A_NEXT): New. + (arch_info_struct): Add sh2a. + * elf32-sh.c (sh_elf_set_mach_from_flags): Handle sh2a. + +2004-07-28 Nick Clifton + John David Anglin + + PR 273 + * som.c (setup_sections): Improve estimation of space sizes in + relocatable objects. + +2004-07-27 Jason Thorpe + * config.bfd (hppa*-*-netbsd*): Set targ_defvec to + bfd_elf32_hppa_nbsd_vec. Add bfd_elf32_hppa_linux_vec + to targ_selvecs. + * configure.in (bfd_elf32_hppa_nbsd_vec): Add case. + * configure: Regenerate. + * elf32-hppa.c (elf32_hppa_object_p): Add "elf32-hppa-netbsd" + case that accepts OSABI=NetBSD and OSABI=SysV. + (elf32_hppa_set_gp): For "elf32-hppa-netbsd", set the GP to + the base of .got or .data (if .got does not exist). + (elf32_hppa_post_process_headers): For elf32-hppa-netbsd, + set OSABI=NetBSD. + (TARGET_BIG_SYM): Add bfd_elf32_hppa_nbsd_vec case. + (TARGET_BIG_NAME): Add "elf32-hppa-netbsd" case. + * targets.c (bfd_elf32_hppa_nbsd_vec): Add extern declaration. + (_bfd_target_vector): Add bfd_elf32_hppa_nbsd_vec. + +2004-07-27 H.J. Lu + + PR 161/251 + * elf-bfd.h (bfd_elf_section_data): Add sec_group. + (elf_sec_group): Defined. + (bfd_elf_match_symbols_in_sections): New prototype. + (_bfd_elf_setup_group_pointers): Likewise. + + * elf.c (bfd_elf_discard_group): Abort. + (bfd_elf_set_group_contents): Also include relocation sections. + Remove zero-fill for ld -r. + (_bfd_elf_setup_group_pointers): New function. + (elf_sort_elf_symbol): Likewise. + (elf_sym_name_compare): Likewise. + (bfd_elf_match_symbols_in_sections): Likewise. + + * elfcode.h (elf_object_p): Call _bfd_elf_setup_group_pointers. + + * elflink.c (match_group_member): New. + (elf_link_input_bfd): Check group member for discarded section. + (try_match_symbols_in_sections): New function. + (already_linked): Likewise. + (_bfd_elf_section_already_linked): Support mixing comdat group + and linkonce section. + + * libbfd-in.h (bfd_section_already_linked_table_traverse): New. + * linker.c (bfd_section_already_linked_table_traverse): New. + + * libbfd.h: Regenerated. + +2004-07-27 Tomer Levi + + * reloc.c: Add BFD_RELOC_CRX_SWITCH8, BFD_RELOC_CRX_SWITCH16, + BFD_RELOC_CRX_SWITCH32. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * elf32-crx.c: Support relocation/relaxation of + BFD_RELOC_CRX_SWITCH* types. + +2004-07-27 Alan Modra + + * elf64-ppc.c: Correct "Linker stubs" comment. + +2004-07-26 H.J. Lu + + * elf-bfd.h (bfd_elf_section_data): Add a pointer for the + linked-to section. + (elf_linked_to_section): New. + + * elf.c (assign_section_numbers): Set up sh_link for + SHF_LINK_ORDER. + + * elfxx-ia64.c (elfNN_ia64_final_write_processing): Set sh_info + to sh_link for SHT_IA_64_UNWIND sections. + +2004-07-22 H.J. Lu + + * elflink.c (elf_fixup_link_order): Add _() to error message. + +2004-07-22 H.J. Lu + + * elflink.c (elf_fixup_link_order): Issue a warning and flag + an error if failed. + +2004-07-21 H.J. Lu + + * aout-adobe.c (aout_32_section_already_linked): Defined. + * aout-target.h (MY_section_already_linked): Likewise. + * aout-tic30.c (MY_section_already_linked): Likewise. + * binary.c (binary_section_already_linked): Likewise. + * bout.c (b_out_section_already_linked): Likewise. + * coff-alpha.c (_bfd_ecoff_section_already_linked): Likewise. + * coff-mips.c (_bfd_ecoff_section_already_linked): Likewise. + * coffcode.h (coff_section_already_linked): Likewise. + * i386msdos.c (msdos_section_already_linked): Likewise. + * i386os9k.c (os9k_section_already_linked): Likewise. + * ieee.c (ieee_section_already_linked): Likewise. + * ihex.c (ihex_section_already_linked): Likewise. + * mach-o.c (bfd_mach_o_section_already_linked): Likewise. + * mmo.c (mmo_section_already_linked): Likewise. + * nlm-target.h (nlm_section_already_linked): Likewise. + * oasys.c (oasys_section_already_linked): Likewise. + * pef.c (bfd_pef_section_already_linked): Likewise. + * ppcboot.c (ppcboot_section_already_linked): Likewise. + * som.c (som_bfd_discard_group): Likewise. + * srec.c (srec_section_already_linked): Likewise. + * tekhex.c (tekhex_section_already_linked): Likewise. + * versados.c (versados_section_already_linked): Likewise. + * vms.c (vms_section_already_linked): Likewise. + * coff-target.h (_bfd_xcoff_section_already_linked): Likewise. + * xsym.c (bfd_sym_section_already_linked): Likewise. + + * bfd-in.h (bfd_section_already_linked_table_init): New. + (bfd_section_already_linked_table_free): Likewise. + + * coff-rs6000.c (rs6000coff_vec): Add + _bfd_generic_section_already_linked. + (pmac_xcoff_vec): Likewise. + * coff64-rs6000.c (rs6000coff64_vec): Likewise. + (aix5coff64_vec): Likewise. + + * elf-bfd.h (_bfd_elf_section_already_linked): New prototype. + * elflink.c (_bfd_elf_section_already_linked): New function. + + * elfxx-target.h (bfd_elfNN_section_already_linked): Defined. + + * libbfd-in.h (_bfd_nolink_section_already_linked): Defined. + (_bfd_generic_section_already_linked): New. + (bfd_section_already_linked_hash_entry): Likewise. + (bfd_section_already_linked): Likewise. + (bfd_section_already_linked_table_lookup): Likewise. + (bfd_section_already_linked_table_insert): Likewise. + + * linker.c (bfd_section_already_linked): New. + (_bfd_section_already_linked_table): Likewise. + (bfd_section_already_linked_table_lookup): Likewise. + (bfd_section_already_linked_table_insert): Likewise. + (already_linked_newfunc): Likewise. + (bfd_section_already_linked_table_init): Likewise. + (bfd_section_already_linked_table_free): Likewise. + (_bfd_generic_section_already_linked): Likewise. + + * section.c (bfd_section): Remove comdat. + (bfd_comdat_info): Moved to ... + * bfd-in.h (coff_comdat_info): Here. + (bfd_coff_get_comdat_section): New. + * coffgen.c (bfd_coff_get_comdat_section): Likewise. + * libcoff-in.h (coff_section_tdata): Add comdat. + * coffcode.h (handle_COMDAT): Updated. + * cofflink.c (coff_link_add_symbols): Likewise. + * ecoff.c (bfd_debug_section): Likewise. + + * targets.c (bfd_target): Add _section_already_linked. + (BFD_JUMP_TABLE_LINK): Updated. + + * bfd-in2.h: Regenerated. + * libbfd.h: Likewise. + * libcoff.h: Likewise. + +2003-07-21 Paul Brook + + * elflink.c (elf_get_linked_section_vma, compare_link_order, + elf_fixup_link_order): New functions. + (bfd_elf_final_link): Call elf_fixup_link_order. + +2004-07-21 Alexandre Oliva + + * elf-bfd.h (ELF_COMMON_DEF_P): New. + * elflink.c (_bfd_elf_symbol_refs_local_p): Use it to handle + common definitions. + * elf-m10300.c: Use SYMBOL_REFERENCES_LOCAL instead of + _bfd_elf_symbol_refs_local_p. + * elf32-frv.c (FRVFDPIC_SYM_LOCAL): Remove hack for common + symbols. + +2004-07-19 H.J. Lu + + * bfd-in.h (dynamic_lib_link_class): Add DYN_NO_ADD_NEEDED and + DYN_NO_NEEDED. + (bfd_elf_get_dyn_lib_class): New prototype. + * elf.c (bfd_elf_get_dyn_lib_class): New function. + + * elflink.c (elf_link_add_object_symbols): Check DYN_AS_NEEDED, + DYN_DT_NEEDED and DYN_NO_NEEDED bits to see if a DT_NEEDED + entry is needed. Issue an error if a DT_NEEDED entry is needed + for a file marked DYN_NO_NEEDED. + (elf_link_check_versioned_symbol): Check the DYN_DT_NEEDED bit + for DT_NEEDED tags. + + * bfd-in2.h: Regenerated. + +2004-07-14 John David Anglin + + * elflink.c (elf_section_complain_discarded): Don't complain in + .PARISC.unwind. + +2004-07-10 James E Wilson + + * elfxx-ia64.c (elfNN_ia64_relax_ldxmov): Remove abfd parameter. + (elfNN_ia64_install_value, elfNN_ia64_relax_brl): Likewise. + (elfNN_ia64_relax_section, elfNN_ia64_relocate_section, + elfNN_ia64_finish_dynamic_symbol, elfNN_ia64_finish_dynamic_sections): + Fix callers. + (elfNN_ia64_relax_brl): Change bfd_get_64 to bfd_getl64. Change + bfd_put_64 to bfd_putl64. + (elfNN_ia64_relax_ldxmov, elfNN_ia64_install_value): Likewise. + +2004-07-09 H.J. Lu + + PR 240 + * elfxx-ia64.c (elfNN_ia64_relax_section): Only warn br in + .init/.fini sections when trying to relax it. + +2004-07-09 Jie Zhang + + * elf.c (assign_file_positions_for_segments): Make sure the + .dynamic section is the first section in the PT_DYNAMIC segment. + +2004-07-09 Nick Clifton + + * config.bfd: Change sh-sybmian-elf to sh-*-symbianelf. + * elf32-sh-symbian.c: Rename the sh_find_elf_flags and + sh_elf_get_flags_from_mach functions so that they do not conflict + when this target is built with other sh-elf targets. + * elf32-sh.c (sh_elf_get_flags_from_mach): Remove bogus + suppression of this function. + (sh_elf_find_flags): Likewise. + +2004-07-07 Tomer Levi + + * Makefile.am (ALL_MACHINES): Add cpu-crx.lo. + (ALL_MACHINES_CFILES): Add cpu-crx.c. + (BFD32_BACKENDS): Add elf32-crx.lo. + (BFD32_BACKENDS_CFILES): Add elf32-crx.c. + (cpu-crx.lo): New target. + (elf32-crx.lo): New target. + * Makefile.in: Regenerate. + * archures.c (bfd_architecture): Add bfd_{arch,mach}_crx. + (bfd_archures_list): Add bfd_crx_arch. + * bfd-in2.h: Regenerate. + * config.bfd: Handle crx-*-elf*, crx*. + * configure.in: Handle bfd_elf32_crx_vec. + * configure: Regenerate. + * cpu-crx.c: New file. + * elf32-crx.c: Likewise. + * libbfd.h: Regenerate. + * reloc.c: Add BFD_RELOC_CRX_REL4, BFD_RELOC_CRX_REL8, + BFD_RELOC_CRX_REL8_CMP, BFD_RELOC_CRX_REL16, BFD_RELOC_CRX_REL24, + BFD_RELOC_CRX_REL32, BFD_RELOC_CRX_REGREL12, BFD_RELOC_CRX_REGREL22, + BFD_RELOC_CRX_REGREL28, BFD_RELOC_CRX_REGREL32, BFD_RELOC_CRX_ABS16, + BFD_RELOC_CRX_ABS32, BFD_RELOC_CRX_NUM8, BFD_RELOC_CRX_NUM16, + BFD_RELOC_CRX_NUM32, BFD_RELOC_CRX_IMM16 and BFD_RELOC_CRX_IMM32 + * targets.c (bfd_elf32_crx_vec): Declare. + (bfd_target_vector): Add bfd_elf32_crx_vec. + +2004-07-06 Nick Clifton + + * config.bfd: Add sh-symbian-elf target. + * configure.in: Add bfd_elf32_shl_symbian_vec. + * configure: Regenerate. + * elf-bfd.h (struct elf_backend_data): Add new field + 'check_directives'. + * elflink.c (elf_link_add_object_symbols): Invoke the + check_directives function, if defined. + * elfxx-target.h: Provide a default, NULL definition for + check_directives. + * targets.c: Add bfd_elf32_shl_symbian_vec. + * elf32-sh.c (sh_elf_swap_insns): Protect against unnecessary + definition. + (elf32_shlin_grok_prstatus, elf32_shlib_grok_psinfo, + * sh_elf_get_flags_from_mach, sh_elf_find_flags): Likewise. + (TARGET_BIG_SYM, TARGET_LITTLE_SYM): Only define if they have + not already been defined. + * elf32-sh64.c: Use SH_TARGET_ALREADY_DEFINED. + * sh-symbian.c: New file. Provide functions to support the + * sh-symbian-elf target. + * Makefile.am: Add elf32-sh-symbian.c + * Makefile.in: Regenerate. + +2004-07-05 Andrew Stubbs + + * elf32-sh.c: Include ../opcodes/sh-opc.h. + * Makefile.am: Ran make dep-am. + * Makefile.in: Ran make dep-in. + +2004-07-03 Aaron W. LaFramboise + + * cofflink.c (_bfd_coff_generic_relocate_section): Resolve PE weak + externals properly. + +2004-07-02 Martin Schwidefsky + + * config.bfd: Add want64 to configuration target s390-*-linux*. + +2004-07-01 H.J. Lu + + * bfd.c (bfd_get_section_ident): New. + + * elflink.c (elf_link_read_relocs_from_section): Call + bfd_get_section_ident to identify the section when reporting + error. + (_bfd_elf_link_output_relocs): Likewise. + (elf_link_output_extsym): Likewise. + (elf_link_input_bfd): Likewise. + (bfd_elf_gc_record_vtinherit): Likewise. + + * bfd-in2.h: Regenerated. + +2004-07-01 Jie Zhang + Nick Clifton + + PR 204 + * elfxx-mips.c (_bfd_mips_elf_final_link): Pass the correct number + of section symbols to mips_elf_sort_hash_table (). + +2004-07-01 Alan Modra + + * elflink.c (elf_section_ignore_discarded_relocs): Revert last + change. Comment. + (elf_section_complain_discarded): New function. Handle + .gcc_except_table too. + (elf_link_input_bfd): Rewrite handling of relocs against symbols + in discarded sections. + * elf-bfd.h (elf_discarded_section): Protect macro arg. + +2004-06-30 James E Wilson + + * elfxx-ia64.c (elfNN_ia64_check_relocs): New local pltoff. Initialize + to NULL. Call get_pltoff if NULL and NEED_PLTOFF is true. + +2004-06-30 H.J. Lu + + PR 233 + * elflink.c (elf_link_input_bfd): Issue an error for non-debug + local references to discarded sections and report their + locations. + +2004-06-30 Alan Modra + + * elflink.c (elf_section_ignore_discarded_relocs): Don't test + sec_info_type, test section name instead. + +2004-06-29 H.J. Lu + + PR 240 + * elfxx-ia64.c (elfNN_ia64_relax_section): Don't relax branch + in .init/.fini sections. + +2004-06-29 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_relocate_section): Use + bfd_get_section_limit. + +2004-06-29 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_combine_prop_entries): Don't change the + output section size. + +2004-06-29 Alan Modra + + * elf64-mmix.c (mmix_set_relaxable_size): Save original size in + rawsize. + (mmix_elf_perform_relocation): Adjust for above change. + (mmix_elf_relocate_section): Likewise. + (mmix_elf_relax_section): Likewise. Use output_section->rawsize. + (mmix_elf_get_section_contents): Delete. + (bfd_elf64_get_section_contents): Delete. + (mmix_elf_relocate_section): Zero stub area. + * linker.c (default_indirect_link_order): Alloc max of section size + and rawsize. + * simple.c (bfd_simple_get_relocated_section_contents): Likewise. + * section.c (bfd_malloc_and_get_section): Likewise. + (struct bfd_section): Update rawsize comment. + * bfd-in2.h: Regenerate. + + * reloc16.c (bfd_coff_reloc16_relax_section): Set rawsize. + +2004-06-29 Alan Modra + + * bfd-in.h (bfd_get_section_limit): Define. + * reloc.c (bfd_perform_relocation, bfd_install_relocation) + (_bfd_final_link_relocate): Use bfd_get_section_limit. + * aout-tic30.c (tic30_aout_final_link_relocate): Likewise. + * coff-arm.c (coff_arm_relocate_section): Likewise. + * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): Likewise. + * cpu-ns32k.c (do_ns32k_reloc): Likewise. + (bfd_ns32k_final_link_relocate): Likewise. + * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): Likwise. + * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): Likewise. + * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc) + (i860_howto_highadj_reloc, i860_howto_splitn_reloc): Likewise. + * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc) + (m32r_elf_generic_reloc, m32r_elf_relocate_section): Likewise. + * elf32-m68hc1x.c (m68hc11_elf_special_reloc): Likewise. + * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc): Likewise. + * elf32-or32.c (or32_elf_consth_reloc): Likewise. + * elf32-ppc.c (ppc_elf_addr16_ha_reloc): Likewise. + * elf32-s390.c (s390_elf_ldisp_reloc): Likewise. + * elf32-sh.c (sh_elf_reloc_loop): Likewise. + * elf32-sparc.c (sparc_elf_wdisp16_reloc): Likewise. + (sparc_elf_hix22_reloc, sparc_elf_lox10_reloc): Likwise. + * elf32-v850.c (v850_elf_reloc): Likewise. + * elf32-xstormy16.c (xstormy16_elf_24_reloc): Likewise. + * elf32-xtensa.c (bfd_elf_xtensa_reloc): Likewise. + * elf64-alpha.c (elf64_alpha_reloc_gpdisp): Likewise. + * elf64-mips.c (mips_elf64_gprel32_reloc) + (mips16_gprel_reloc): Likewise. + * elf64-mmix.c (mmix_elf_reloc): Likewise. + * elf64-s390.c (s390_elf_ldisp_reloc): Likewise. + * elf64-sparc.c (init_insn_reloc): Likewise. + * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc): Likewise. + * elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp) + (_bfd_mips_elf_hi16_reloc, _bfd_mips_elf_lo16_reloc) + (_bfd_mips_elf_generic_reloc): Likewise. + * bfd-in2.h: Regenerate. + +2004-06-28 Alan Modra + + * bfd-in.h (struct stab_info): Move from stabs.c. + * stabs.c (struct stab_link_includes_table): Delete. + (stab_link_includes_lookup): Delete. + (_bfd_write_section_stabs, _bfd_write_stab_strings): Remove one + level of indirection from sinfo parm. + (_bfd_link_section_stabs): Likewise. Set SEC_LINKER_CREATED on + stabstr section. Adjust hash table accesses. + * coff-ppc.c (ppc_bfd_coff_final_link): Do include rawsize in contents + alloc. Adjust stab_info test. + * cofflink.c (_bfd_coff_link_hash_table_init): Clear stab_info. + (_bfd_coff_final_link): Adjust stab_info test. + (_bfd_coff_link_input_bfd): Ignore SEC_LINKER_CREATED sections. + * elf-bfd.h (struct elf_link_hash_table): Include struct stab_info + in place. + * libcoff-in.h (struct coff_link_hash_table): Likewise. + * elf.c (_bfd_elf_link_hash_table_init): Clear stab_info. + * elflink.c (bfd_elf_final_link): Don't attempt to link linker created + stabstr section. Adjust stab_info test. + * libbfd-in.h (_bfd_link_section_stabs, _bfd_write_section_stabs) + (_bfd_write_stab_strings): Adjust prototypes. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + * bfd-in2.h: Regenerate. + +2004-06-27 Mark Kettenis + + From Miod Vallat : + * aoutx.h (NAME(aout,machine_type)): Handle bfd_arch_m88k. + +2004-06-26 Alexandre Oliva + + * elf-m10300.c (struct elf_mn10300_pcrel_relocs_copied): Delete. + (struct elf32_mn10300_link_hash_entry): Remove + pcrel_relocs_copied. + (mn10300_elf_check_relocs): Only reserve dynamic relocations for + R_MN10300_32. Don't adjust pcrel_relocs_copied. + (mn10300_elf_final_link_relocate): Fail for direct, pc-relative + and gotoff relocations if the symbol doesn't bind locally. Use + _bfd_elf_symbol_refs_local_p to test. Don't create dynamic + relocation for PCREL32. + (mn10300_elf_relocate_section): Use _bfd_elf_symbol_refs_local_p + to test whether a symbol binds locally. + (elf32_mn10300_link_hash_newfunc): Don't initialize + pcrel_relocs_copied. + (_bfd_mn10300_elf_discard_copies): Delete. + (_bfd_mn10300_elf_size_dynamic_sections): Don't call it. + +2004-06-26 Mark Kettenis + + * config.bfd: Replace m88k-*-openbsd* with m88*-*-openbsd*. + +2004-06-25 Joel Brobecker + + * som.c (som_set_reloc_info): Correct small typo. + +2004-06-25 Kazuhiro Inaoka + + * elf32-m32r.c (m32r_elf_howto_table): Support R_M32R_GOTOFF. + (m32r_elf_relocate_section): Changed for R_M32R_GOTOFF. + (m32r_elf_gcsweep_hook): Likewise. + (m32r_elf_check_relocs): Likewise. + (m32r_elf_howto_table): Added R_M32R_GOTOFF_HI_ULO, + R_M32R_GOTOFF_HI_SLO and R_M32R_GOTOFF_LO. + * reloc.c: Added BFD_RELOC_M32R_GOTOFF_HI_ULO, + BFD_RELOC_M32R_GOTOFF_HI_SLO and BFD_RELOC_M32R_GOTOFF_LO. + * bfd-in2.h: Regenerated. + * libbfd.h: Regenerated. + +2004-06-24 H.J. Lu + + * elf64-x86-64.c (elf64_x86_64_check_relocs): Warn overflow + relocation symbol. + (elf64_x86_64_relocate_section): Issue an error for + R_X86_64_PC8, R_X86_64_PC16 and R_X86_64_PC32 relocations + against global symbols when building shared library. + +2004-06-24 Alan Modra + + * section.c (struct sec): Rename "_cooked_size" to "size". + Rename "_raw_size" to "rawsize". + (STD_SECTION): Adjust comments. + (bfd_set_section_size, bfd_get_section_contents): Use size. + (bfd_malloc_and_get_section): New function. + * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size. + * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early. + Correctly free reloc and contents memory. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME + and fake CIE now that we can shink section size to zero. + (_bfd_elf_write_section_eh_frame): Likewise.. + * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents. + * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use + _bfd_stab_section_offset. Use _bfd_elf_section_offset. + * stabs.c (_bfd_stab_section_offset_): Remove unused args and + unneeded indirection. + * elf.c (_bfd_elf_section_offset): .. and update call. + * libbfd-in.h (_bfd_stab_section_offset): Update prototype. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + + Replace occurrences of "_raw_size" and "_cooked_size" in most places + with "size". Set new "rawsize" for stabs, eh_frame, and SEC_MERGE + sections. Use "rawsize", if non-zero, for bfd_get_section_contents + calls if the section might be a stabs, eh_frame, or SEC_MERGE section. + Similarly use "rawsize", if non-zero, in reloc functions to validate + reloc addresses. Use new bfd_malloc_and_get_section in most places + where bfd_get_section_contents was called. Expand all occurrences of + bfd_section_size and bfd_get_section_size. Rename "raw_size" var in + grok_prstatus and similar functions to "size". + * aix386-core.c (aix386_core_file_p): .. + * aix5ppc-core.c (xcoff64_core_p): .. + * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents, + aout_adobe_set_section_contents): .. + * aout-target.h (callback): .. + * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate, + MY_bfd_final_link): .. + * aoutf1.h (sunos4_core_file_p): .. + * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic, + adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags, + final_link, aout_link_input_section): .. + * binary.c (binary_object_p, binary_canonicalize_symtab, + binary_set_section_contents): .. + * bout.c (b_out_callback, b_out_write_object_contents, + b_out_set_section_contents, b_out_bfd_relax_section, + b_out_bfd_get_relocated_section_contents): .. + * cisco-core.c (cisco_core_file_validate): .. + * coff-alpha.c (alpha_ecoff_object_p, + alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): .. + * coff-arm.c (coff_arm_relocate_section, + bfd_arm_allocate_interworking_sections): .. + * coff-h8300.c (h8300_reloc16_extra_cases, + h8300_bfd_link_add_symbols): .. + * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): .. + * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section, + ppc_bfd_coff_final_link): .. + * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): .. + * coff-sh.c (sh_relax_section, sh_relax_delete_bytes, + sh_align_loads, sh_coff_get_relocated_section_contents): .. + * coff64-rs6000.c (xcoff64_write_object_contents, + xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): .. + * coffcode.h (coff_compute_section_file_positions, + coff_write_object_contents): .. + * coffgen.c (make_a_section_from_file, coff_write_symbols, + coff_section_symbol, build_debug_section): .. + * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link, + process_embedded_commands, _bfd_coff_link_input_bfd, + _bfd_coff_write_global_sym): .. + * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): .. + * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): .. + * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): .. + * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, + _bfd_dwarf2_find_nearest_line): .. + * ecoff.c (bfd_debug_section, ecoff_set_symbol_info, + ecoff_compute_section_file_positions, + _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): .. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame, + _bfd_elf_discard_section_eh_frame_hdr, + _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset, + _bfd_elf_write_section_eh_frame, + _bfd_elf_write_section_eh_frame_hdr): .. + * elf-hppa.h (elf_hppa_sort_unwind): .. + * elf-m10200.c (mn10200_elf_relax_section, + mn10200_elf_relax_delete_bytes, + mn10200_elf_get_relocated_section_contents): .. + * elf-m10300.c (_bfd_mn10300_elf_create_got_section, + mn10300_elf_check_relocs, mn10300_elf_relax_section, + mn10300_elf_relax_delete_bytes, + mn10300_elf_get_relocated_section_contents, + _bfd_mn10300_elf_adjust_dynamic_symbol, + _bfd_mn10300_elf_discard_copies, + _bfd_mn10300_elf_size_dynamic_sections, + _bfd_mn10300_elf_finish_dynamic_sections): .. + * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list, + _bfd_elf_make_section_from_phdr, elf_fake_sections, + bfd_elf_set_group_contents, map_sections_to_segments, + elf_sort_sections, assign_file_positions_for_segments, + SECTION_SIZE, copy_private_bfd_data, + _bfd_elf_get_dynamic_reloc_upper_bound, + _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect, + _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus, + elfcore_grok_lwpstatus, elfcore_grok_win32pstatus, + elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs, + _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): .. + * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect, + bfd_elf32_arm_process_before_allocation, + elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs, + elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections, + elf32_arm_write_section): .. + * elf32-cris.c (cris_elf_grok_prstatus, + elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook, + elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol, + cris_elf_check_relocs, elf_cris_size_dynamic_sections, + elf_cris_discard_excess_dso_dynamics, + elf_cris_discard_excess_program_dynamics): .. + * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): .. + * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): .. + * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup, + _frv_create_got_section, _frvfdpic_assign_plt_entries, + elf32_frvfdpic_size_dynamic_sections, + elf32_frvfdpic_modify_segment_map, + elf32_frvfdpic_finish_dynamic_sections): .. + * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes, + elf32_h8_get_relocated_section_contents): .. + * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub, + elf32_hppa_adjust_dynamic_symbol, allocate_plt_static, + allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections, + elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs, + elf32_hppa_finish_dynamic_sections): .. + * elf32-i370.c (i370_elf_adjust_dynamic_symbol, + i370_elf_size_dynamic_sections, i370_elf_check_relocs, + i370_elf_finish_dynamic_sections): .. + * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol, + allocate_dynrelocs, elf_i386_size_dynamic_sections, + elf_i386_relocate_section, elf_i386_finish_dynamic_sections): .. + * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, + i860_howto_highadj_reloc, i860_howto_splitn_reloc): .. + * elf32-ip2k.c (ip2k_is_switch_table_128, + ip2k_relax_switch_table_128, ip2k_is_switch_table_256, + ip2k_relax_switch_table_256, ip2k_elf_relax_section, + adjust_all_relocations, ip2k_elf_relax_delete_bytes): .. + * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc, + m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol, + allocate_dynrelocs, m32r_elf_size_dynamic_sections, + m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections, + m32r_elf_relax_section, m32r_elf_relax_delete_bytes, + m32r_elf_get_relocated_section_contents): .. + * elf32-m68hc11.c (m68hc11_elf_build_one_stub, + m68hc11_elf_size_one_stub, m68hc11_elf_relax_section, + m68hc11_elf_relax_delete_bytes): .. + * elf32-m68hc12.c (m68hc12_elf_build_one_stub, + m68hc12_elf_size_one_stub): .. + * elf32-m68hc1x.c (elf32_m68hc11_size_stubs, + elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): .. + * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook, + elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections, + elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): .. + * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc, + elf32_mips_grok_prstatus): .. + * elf32-or32.c (or32_elf_consth_reloc): .. + * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc, + elf_create_pointer_linker_section, ppc_elf_create_linker_section, + ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol, + allocate_dynrelocs, ppc_elf_size_dynamic_sections, + ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus, + ppc_elf_final_write_processing): .. + * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, + allocate_dynrelocs, elf_s390_size_dynamic_sections, + elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): .. + * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section, + sh_elf_relax_delete_bytes, sh_elf_align_loads, + sh_elf_adjust_dynamic_symbol, allocate_dynrelocs, + sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents, + sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): .. + * elf32-sh64-com.c (sh64_address_in_cranges, + sh64_get_contents_type): .. + * elf32-sh64.c (sh64_find_section_for_address, + sh64_elf_final_write_processing): .. + * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc, + sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol, + allocate_dynrelocs, elf32_sparc_size_dynamic_sections, + elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): .. + * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): .. + * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol, + elf_vax_size_dynamic_sections, elf_vax_discard_copies, + elf_vax_instantiate_got_entries, elf_vax_relocate_section, + elf_vax_finish_dynamic_sections): .. + * elf32-xstormy16.c (xstormy16_elf_24_reloc, + xstormy16_elf_check_relocs, xstormy16_relax_plt_check, + xstormy16_elf_relax_section, xstormy16_elf_always_size_sections, + xstormy16_elf_finish_dynamic_sections): .. + * elf32-xtensa.c (xtensa_read_table_entries, + elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size, + elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc, + bfd_elf_xtensa_reloc, elf_xtensa_relocate_section, + elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections, + elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus, + get_relocation_opcode, retrieve_contents, find_relaxable_sections, + collect_source_relocs, is_resolvable_asm_expansion, remove_literals, + relax_section, shrink_dynamic_reloc_sections, relax_property_section, + xtensa_callback_required_dependence): .. + * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section, + elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol, + elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets, + elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1, + elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes, + elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1, + elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel, + elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): .. + * elf64-hppa.c (allocate_dynrel_entries, + elf64_hppa_size_dynamic_sections, + elf64_hppa_finish_dynamic_sections): .. + * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc, + mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table, + elf64_mips_grok_prstatus): .. + * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc, + mmix_elf_relocate_section, mmix_elf_final_link, + mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation, + mmix_elf_relax_section, mmix_elf_get_section_contents): .. + * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus, + ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust, + ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd, + allocate_dynrelocs, ppc64_elf_size_dynamic_sections, + ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section, + toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs, + ppc64_elf_build_stubs, ppc64_elf_relocate_section, + ppc64_elf_finish_dynamic_sections): .. + * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol, + allocate_dynrelocs, elf_s390_size_dynamic_sections, + elf_s390_finish_dynamic_sections): .. + * elf64-sh64.c (sh_elf64_get_relocated_section_contents, + sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol, + sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections, + sh64_elf64_finish_dynamic_sections): .. + * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc, + sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol, + sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section, + sparc64_elf_finish_dynamic_symbol, + sparc64_elf_finish_dynamic_sections): .. + * elf64-x86-64.c (elf64_x86_64_grok_prstatus, + elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs, + elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section, + elf64_x86_64_finish_dynamic_sections): .. + * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): .. + * elfcode.h (elf_slurp_reloc_table): .. + * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag, + elf_finalize_dynstr, elf_link_add_object_symbols, + bfd_elf_size_dynamic_sections, elf_link_sort_relocs, + elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): .. + * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc, + elf32_mips_grok_prstatus): .. + * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries, + elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc, + elfNN_ia64_choose_gp, elfNN_ia64_final_link, + elfNN_ia64_finish_dynamic_sections): .. + * elfxx-mips.c (mips_elf_create_procedure_table, + mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp, + _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc, + mips_elf_global_got_index, mips_elf_multi_got, + mips_elf_create_compact_rel_section, mips_elf_calculate_relocation, + mips_elf_allocate_dynamic_relocations, + mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections, + _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol, + _bfd_mips_elf_always_size_sections, + _bfd_mips_elf_size_dynamic_sections, + _bfd_mips_elf_finish_dynamic_symbol, + _bfd_mips_elf_finish_dynamic_sections, + _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info, + _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents, + _bfd_elf_mips_get_relocated_section_contents, + _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): .. + * hp300hpux.c (callback): .. + * hppabsd-core.c (make_bfd_asection): .. + * hpux-core.c (make_bfd_asection): .. + * i386linux.c (linux_link_create_dynamic_sections, + bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): .. + * i386msdos.c (msdos_write_object_contents): .. + * i386os9k.c (os9k_callback, os9k_write_object_contents, + os9k_set_section_contents): .. + * ieee.c (parse_expression, ieee_slurp_external_symbols, + ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data, + ieee_write_section_part, do_with_relocs, do_as_repeat, + do_without_relocs, ieee_write_debug_part, init_for_output, + ieee_set_section_contents): .. + * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): .. + * irix-core.c (do_sections, make_bfd_asection): .. + * libaout.h (aout_section_merge_with_text_p): .. + * libbfd.c (_bfd_generic_get_section_contents, + _bfd_generic_get_section_contents_in_window): .. + * linker.c (default_indirect_link_order): .. + * lynx-core.c (make_bfd_asection): .. + * m68klinux.c (linux_link_create_dynamic_sections, + bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): .. + * mach-o.c (bfd_mach_o_make_bfd_section, + bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib, + bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab, + bfd_mach_o_scan_read_segment): .. + * merge.c (_bfd_add_merge_section, record_section, merge_strings, + _bfd_merge_sections): .. + * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc, + mmo_map_set_sizes, mmo_canonicalize_symtab, + mmo_internal_write_section, mmo_write_object_contents): .. + * netbsd-core.c (netbsd_core_file_p): .. + * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import, + nlm_alpha_set_public_section): .. + * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): .. + * nlm32-sparc.c (nlm_sparc_write_import): .. + * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in, + nlm_compute_section_file_positions): .. + * oasys.c (oasys_object_p, oasys_slurp_section_data, + oasys_write_sections, oasys_write_data, oasys_set_section_contents): .. + * opncls.c (get_debug_link_info): .. + * osf-core.c (make_bfd_asection): .. + * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic, + adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs, + final_link, aout_link_input_section): .. + * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out, + pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): .. + * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section, + bfd_pef_scan_start_address, bfd_pef_parse_symbols): .. + * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): .. + * ptrace-core.c (ptrace_unix_core_file_p): .. + * reloc.c (bfd_perform_relocation, bfd_install_relocation, + _bfd_final_link_relocate, bfd_generic_relax_section, + bfd_generic_get_relocated_section_contents): .. + * reloc16.c (bfd_coff_reloc16_relax_section, + bfd_coff_reloc16_get_relocated_section_c): .. + * riscix.c (riscix_some_aout_object_p): .. + * rs6000-core.c (read_hdr, make_bfd_asection): .. + * sco5-core.c (make_bfd_asection): .. + * simple.c (bfd_simple_get_relocated_section_contents): .. + * som.c (som_object_setup, setup_sections, som_prep_headers, + som_write_fixups, som_begin_writing, bfd_section_from_som_symbol, + som_set_reloc_info, som_get_section_contents, + som_bfd_link_split_section): .. + * sparclinux.c (linux_link_create_dynamic_sections, + bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): .. + * srec.c (srec_scan, srec_read_section, srec_get_section_contents): .. + * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs, + _bfd_write_stab_strings, _bfd_stab_section_offset): .. + * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections, + bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs, + sunos_scan_ext_relocs, sunos_scan_dynamic_symbol, + sunos_write_dynamic_symbol, sunos_check_dynamic_reloc, + sunos_finish_dynamic_link): .. + * syms.c (_bfd_stab_section_find_nearest_line): .. + * tekhex.c (first_phase, tekhex_set_section_contents, + tekhex_write_object_contents): .. + * trad-core.c (trad_unix_core_file_p): .. + * versados.c (process_esd, process_otr, process_otr): .. + * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): .. + * vms-misc.c (add_new_contents): .. + * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): .. + * vms.c (vms_set_section_contents): .. + * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols, + xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms, + _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): .. + * xsym.c (bfd_sym_scan): .. See above. + +2004-06-21 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_section): Add addend when + calling _bfd_merged_section_offset only for section symbols. + +2004-06-22 Alan Modra + + * elf32-ppc.c (ppc_elf_relax_section): Implement reference code + for handling SEC_MERGE symbols in relax_section. + +2004-06-21 Alexandre Oliva + + 2003-05-15 Richard Sandiford + * cpu-h8300.c (compatible): Allow h8300s and h8300sx code to be + linked together. Mark the result as h8300sx code. + +2004-06-21 Alexandre Oliva + + * elf-bfd.h (struct elf_backend_data): Added + elf_backend_omit_section_dynsym. + (_bfd_elf_link_omit_section_dynsym): Declare. + * elf32-frv.c (_frvfdpic_link_omit_section_dynsym): New. + (elf_backend_omit_section_dynsym): Use it for frvfdpic. + * elflink.c (_bfd_elf_link_omit_section_dynsym): Split out of... + (_bfd_elf_link_renumber_dynsyms): ... this function. + * elfxx-target.h (elf_backend_omit_section_dynsym): Default to + _bfd_elf_link_omit_section_dynsym). + (elfNN_bed): Added elf_backend_omit_section_dynsym. + +2004-06-21 Nick Clifton + + * coffcode.h (styp_to_sec_flags): Ignore IMAGE_SCN_MEM_NOT_PAGED + flags. + +2004-06-17 Jerome Guitton + + * bfd-in.h (bfd_cache_close_all): New function declaration. + * bfd-in2.h: Regenerate. + * cache.c (bfd_cache_close_all): New function definition. + +2004-06-16 Mark Kettenis + + * configure.in: Don't set COREFILE to trad-core.lo for FreeBSD + 4.10 and beyond. + * configure: Regenerate. + +2004-06-16 Daniel Jacobowitz + + * elf32-ppc.c (ppc_elf_create_linker_section): Create symbols in + the pre-existing section. + +2004-06-15 Alan Modra + + * section.c (struct sec): Remove usused flags. Reorganize a little. + (bfd_get_section_size_before_reloc): Delete. + (bfd_get_section_size_after_reloc): Delete. + (STD_SECTION): Update. + (bfd_get_section_size_now): Delete. + (bfd_set_section_contents): Don't referece reloc_done. + (bfd_get_section_contents): Remove reloc_done comment. + * bout.c (b_out_bfd_get_relocated_section_contents): Don't set + reloc_done. + * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. + * ecoff.c (bfd_debug_section): Update initializer. + * elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents): Ditto. + * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. + * bfd-in.h (bfd_section_size): Expand. + (bfd_get_section_size): New macro. + * bfd-in2.h: Regenerate. + * coff64-rs6000.c (xcoff64_write_object_contents): Replace + bfd_get_section_size_before_reloc with bfd_get_section_size. + * coffcode.h (coff_write_object_contents): Likewise. + * coffgen.c (build_debug_section): Likewise. + * dwarf1.c (parse_line_table): Likewise. + (_bfd_dwarf1_find_nearest_line): Likewise. + * ecoff.c (_bfd_ecoff_write_object_contents): Likewise. + * i386msdos.c (msdos_write_object_contents): Likewise. + * pdp11.c (squirt_out_relocs): Likewise. + * elf32-sh64.c (sh64_find_section_for_address): Remove comment. + * elf64-mmix.c (mmix_elf_final_link): Update comment. + +2004-06-14 Chris Demetriou + + * elf32-mips.c (elf_mips_gnu_pcrel32): Add (undoing 2004-04-24 + removal) with updated comment. + (bfd_elf32_bfd_reloc_type_lookup): Add back case for + BFD_RELOC_32_PCREL. + (mips_elf32_rtype_to_howto): Add back case for R_MIPS_PC32. + * elfxx-mips.c (mips_elf_calculate_relocation): Likewise. + +2004-06-12 Alan Modra + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Ignore reloc + overflow on branches to undefweaks. + +2004-06-11 Maciej W. Rozycki + + * coff-alpha.c (alpha_relocate_section): Set used_by_bfd directly + as ecoff_section_data() does not return a valid lvalue. + +2004-06-09 Alexandre Oliva + + * elflink.c (elf_sort_symbol): Compare section id, not pointers. + (elf_link_add_object_symbols): Likewise. + + * elf-m10300.c (_bfd_mn10300_elf_reloc_type_class): New. + (elf_backend_reloc_type_class): New. + +2004-06-08 Mark Kettenis + + * configure.in (hppa*-*-netbsd*, hppa*-*-openbsd): Set COREFILE to + netbsd-core.lo. + * configure: Regenerate. + +2004-06-07 Daniel Jacobowitz + + From: Albert Chin-A-Young + * elf-bfd.h (struct eh_cie_fde): Convert unsigned char bitfields + to unsigned int. + +2004-05-29 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_section): Undo the last + change. + +2004-05-28 DJ Delorie + + * elf-m10300.c (mn10300_elf_relax_section): Preserve reloc addend + for linking, but otherwise adjust reloc for merged sections. + +2004-05-28 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_section): Properly call + _bfd_merged_section_offset for local symbols. + +2004-05-28 Andrew Stubbs + + * Makefile.am: Regenerate dependencies. + * Makefile.in: Regenerate. + * archures.c: Add bfd_mach_sh3_nommu . + * bfd-in2.h: Regenerate. + * cpu-sh.c: Add sh3-nommu architecture. + (bfd_to_arch_table): Create new table. + (sh_get_arch_from_bfd_mach): Create new function. + (sh_get_arch_up_from_bfd_mach): Create new function. + (sh_merge_bfd_arch): Create new function. + * elf32-sh.c (sh_ef_bfd_table): Add table. + (sh_elf_check_relocs): Replace switch statement with + use of sh_ef_bfd_table . + (sh_elf_get_flags_from_mach): Add new function. + (sh_find_elf_flags): Likewise. + (sh_elf_copy_private_data): Replace most of non-elf contents + with a call to sh_merge_bfd_arch() . + +2004-05-27 Michael Chastain + + * Makefile.am (bfdver.h): Use explicit filename, not $< . + * Makefile.in: Regenerate. + +2004-05-27 Alexandre Oliva + + * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Avoid + custom calling conventions for dynamic symbols. + (mn10300_elf_relax_section): Avoid relaxing a function as a local + symbol if it's an alias to a global one. + +2004-05-26 H.J. Lu + + * elf.c (_bfd_elf_make_section_from_shdr): Undo the last + change. + +2004-05-27 Alexandre Oliva + + * elf-m10300.c (mn10300_elf_relax_section): Don't test isym within + loop over hashes. + +2004-05-26 Alan Modra + + * elf.c (_bfd_elf_make_section_from_shdr): Don't set SEC_EXCLUDE + for SHT_GROUP sections. + +2004-05-25 Alan Modra + + * elflink.c (elf_link_add_object_symbols): Don't set up merge + section data here.. + * elf.c (_bfd_elf_merge_sections): .. Do it here instead. + * merge.c: Formatting. Remove unnecessary casts. Expand + bfd_get_section_alignment macro. + (struct sec_merge_sec_info): Rename "first" to "first_str". Update + use throughout file. + (_bfd_add_merge_section): Rename from _bfd_merge_section. Update + comment. Abort on dynamic or non-SEC_MERGE input. Don't test + section name to determine sinfo group, instead test output section + and alignment. + (_bfd_merge_sections): Add struct bfd_link_info param. Call + _bfd_strip_section_from_output rather than just twiddling flags. + * libbfd-in.h (_bfd_add_merge_section): Rename, update comment. + (_bfd_merge_sections): Update prototype. + * libbfd.h: Regenerate. + +2004-05-24 Mark Kettenis + + * netbsd-core.c: Correctly indent section that sets architecture + from machine ID. + + From Miod Vallat : + * m88kopenbsd.c: New file. + * targets.c (m88k_openbsd_vec): New. + * config.bfd: Add m88k-*-openbsd*. + * configure.in (m88k-*-openbsd*): Set COREFILE to netbsd-core.lo. + (m88kopenbsd_vec): New. + * configure: Regenerate. + * Makefile.am (BFD32_BACKENDS): Add m88kopenbsd.lo. + (BFD32_BACKENDS_CFILES): Add m88kopenbsd.c. + Run "make dep-am". + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2004-05-24 Nick Clifton + + * hash.c: Remove bogus node "Changing the default Hash Table Size" + introduced by hash table size patch. + +2004-05-22 Ben Elliston + + * configure.in (is_release): Remove. + (bfd_version_date, bfd_version, bfd_version_string): Likewise. + (AC_OUTPUT): Don't output bfdver.h from version.h. + * configure: Regenerate. + * Makefile.am (RELEASE): New variable. + (bfdver.h): New target. + * Makefile.in: Regenerate. + * doc/Makefile.in: Likewise. + +2004-05-22 Ben Elliston + + * Makefile.am (config.status): Don't depend on version.h. + * Makefile.in: Regenerate. + +2004-05-22 Alan Modra + + * merge.c (_bfd_merged_section_offset): Remove "addend" param. + * libbfd-in.h (_bfd_merged_section_offset): Adjust prototype. + * libbfd.h: Regenerate. + * elf.c (_bfd_elf_rela_local_sym): Adjust call. + (_bfd_elf_rel_local_sym): Likewise. + * elflink.c (_bfd_elf_link_sec_merge_syms): Likewise. + (elf_link_input_bfd): Likewise. + * elf32-ppc.c (ppc_elf_relax_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. + (elfNN_ia64_relocate_section): Likewise. + +2004-05-21 Andy Chittenden + + * hash.c (bfd_default_hash_table_size): New variable. + (bfd_hash_table_init): Use new variable instead of DEFAULT_SIZE. + (bfd_hash_set_default_size): New function. Set the default size + to a selected prime number close to the argument. Document new + function. + * bfd-in.h: Add prototype for bfd_hash_set_default_size. + * bfd-in2.h: Regenerate. + * Makefile.am (hash.lo): Add dependency upon libiberty.h. + * Makefile.in: Regenerate. + +2004-05-21 Mark Kettenis + + * libaout.h (machine_type): Add M_88K_OPENBSD and M_HPPA_OPENBSD. + * netbsd-core.c (netbsd_core_file_p): Set architecture for alpha, + arm, m68k, m88k and hppa core files. + +2004-05-21 Nick Clifton + + * bfdio.c (bfd_bread): Do not use iovec if it is NULL. + (bfd_bwrite): Likewise. + (bfd_tell): Likewise. + (bfd_flush): Likewise. + (bfd_stat): Likewise. + (bfd_seek): Likewise. + (bfd_get_mtime): Likewise. + (bfd_get_size): Likewise. + +2004-05-19 Ben Elliston + + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Comment correction. + +2004-05-19 Mikulas Patocka + + * archive.c (_bfd_get_elt_at_filepos): Cope with a nested archives. + (bfd_generic_openr_next_archived_file): Likewise. + +2004-05-17 Bob Wilson + + * elf32-xtensa.c (xtensa_get_property_section_name): Determine linkonce + section names by inserting a new substring after .gnu.linkonce, except + for .gnu.linkonce.t.* where the "t." is replaced. + +2004-05-17 Adam Nemet + + * config.bfd (sparc-*-lynxos* case): Add to obsolete list. + (m68-*-lynxos* case): Likewise. + (powerpc-*-lyxnos* case): New case. + (i[3-7]86-*-lynxos* case): Update to LynxOS 4.0 ELF. + +2004-05-17 David Heine + + * aout-target.h (MY_bfd_copy_private_header_data): Define. + * aout-tic30.c (MY_bfd_copy_private_header_data): Define. + * bfd.c (bfd_copy_private_header_data): Define. + * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Add entries for new + interface. + * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise. + * coffcode.h (coff_bfd_copy_private_header_data): Define. + * elf-bfd.h (_bfd_elf_copy_private_header_data): Declare. + * elf.c (_bfd_elf_copy_private_section_data): Remove code to set up + segments by calling copy_private_bfd_data. + (_bfd_elf_copy_private_header_data): Define. + * elfxx-target.h (bfd_elfNN_bfd_copy_private_header_data): Define. + * libbfd-in.h (_bfd_generic_bfd_copy_private_header_data): Define. + * libecoff.h (_bfd_ecoff_bfd_copy_private_header_data): Define. + * mach-o.c (bfd_mach_o_bfd_copy_private_header_data): Define. + * mmo.c (mmo_bfd_copy_private_header_data): Define. + * ppcboot.c (ppcboot_bfd_copy_private_header_data): Define. + * som.c (som_bfd_copy_private_header_data): Define. + * targets.c (BFD_JUMP_TABLE_COPY): Add _bfd_copy_private_header_data. + * vms.c (vms_bfd_copy_private_header_data): Define. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2004-05-15 Thiemo Seufer + + * elfxx-mips.c (MINUS_TWO): Define. + (mips_elf_higher, mips_elf_highest, + mips_elf_create_dynamic_relocation): Use MINUS_ONE and MINUS_TWO for + some bfd_vma values. + (_bfd_mips_elf_finish_dynamic_symbol): Likewise. Code cleanup. + +2004-05-14 John David Anglin + + * som.c (log2): Rename to exact_log2. Adjust all callers. + +2004-05-13 Paul Brook + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle + dwarf3 format CIE entries. Remove comment about the size of the + ra_column field. It is now correctly deduced. + +2004-05-13 Joel Sherrill + + * config.bfd (or32-*-rtems*): Switch to elf. + +2004-05-13 Nick Clifton + + * po/fr.po: Updated French translation. + +2004-05-11 Jakub Jelinek + + * elflink.c (bfd_elf_final_link): Don't output STT_SECTION symbol + into .dynsym if elf_section_data (sec)->dynindx <= 0. + Adjust counting of last_local. + (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections + other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt + created by the linker nor !SHF_ALLOC. + + * elf32-i386.c (elf_i386_finish_dynamic_sections): Point + DT_PLTGOT to the start of the .got.plt section instead of the + .got output section. Set sh_entsize for .got section in addition + to .got.plt. + (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ + is at sgot->output_section->vma. + * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point + DT_PLTGOT to the start of the .got.plt section instead of the + .got output section. + (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ + is at sgot->output_section->vma. Set sh_entsize for .got section + in addition to .got.plt. + * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. + (bfd_section_from_phdr): Likewise. + (map_sections_to_segments): Likewise. + (assign_file_positions_for_segments): Likewise. + (get_program_header_size): Likewise. + * elflink.c (bfd_elf_size_dynamic_sections): Set + elf_tdata (output_bfd)->relro from info->relro. + * elf-bfd.h (struct elf_obj_tdata): Add relro field. + +2004-05-08 Alexandre Oliva + + * elf32-frv.c (_frvfdpic_add_dyn_reloc): Don't warn when we get + a zero symndx for which we hadn't accounted a dynamic relocation. + (_frvfdpic_add_rofixup): Likewise. + +2004-05-07 Brian Ford + DJ Delorie + + * coffcode.h (coff_write_object_contents) [COFF_IMAGE_WITH_PE]: + Propagate IMAGE_FILE_LARGE_ADDRESS_AWARE. + * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Recognize + IMAGE_FILE_LARGE_ADDRESS_AWARE. Use PE defines. + +2004-05-07 Alexandre Oliva + + * elf32-frv.c (elf32_frvfdpic_modify_segment_map): Return + immediately if there's no link info. + (elf32_frvfdpic_copy_private_bfd_data): New. + (bfd_elf32_bfd_copy_private_bfd_data): Use it for frvfdpic. + +2004-05-06 Zack Weinberg + + * dwarf2.c (add_line_info): Also set info->filename to NULL if + filename argument is null; do not call strlen on a null pointer. + +2004-05-06 Daniel Jacobowitz + + * elf32-arm.h (elf32_arm_relocate_section): Remove R_ARM_PLT32 + special case. + +2004-05-05 Alexandre Oliva + + * configure.in (bfd_elf32_frvfdpic_vec): New. + * configure: Rebuilt. + * targets.c (bfd_elf32_frvfdpic_vec): New. + * config.bfd: Enable it on frv-*-elf and frv-*-*linux*, as default + on the latter. + * elf32-frv.c: Prefix all identifiers added for FDPIC support with + frvfdpic instead of frv. Rearrange elf-target macros such that + the FDPIC-specific ones are only defined for this new target + vector. + (bfd_elf32_frvfdpic_vec): Declare. + (IS_FDPIC): New. + (elf32_frv_relocate_section): Use it to enable segment checking + and to control rofixup emission. Add output section vma to + applied relocation in non-LOAD non-ALLOC sections. Use + _bfd_error_handler for errors. + (_frv_create_got_section): Create .rel.got and .rofixup only in + FDPIC. Create non-dynamic _gp at .got+2048 in non-FDPIC, like the + linker script. + (elf32_frvfdpic_size_dynamic_sections): Assume FDPIC. + (elf32_frvfdpic_modify_segment_map): Likewise. + (elf32_frv_finish_dynamic_sections): New, do-nothing. + (elf32_frvfdpic_finish_dynamic_sections): Assume FDPIC. Improve + error message if we miscompute the rofixup size. + (frvfdpic_elf_use_relative_eh_frame): Assume FDPIC. + (frvfdpic_elf_encode_eh_address): Likewise. + (elf32_frv_check_relocs): Reject FDPIC-only relocs in non-FDPIC. + Record relocs only in FDPIC. Make sure _gp is defined for GPREL + relocs. Reject unknown relocation types. + (elf32_frv_object_p): Make sure target vector matches FDPIC bits. + (frv_elf_merge_private_bfd_data): Likewise. + (ELF_MAXPAGESIZE): Revert to 0x1000 for elf32-frv; keep it as + 0x4000 for newly-added elf32-frvfdpic. + +2004-05-05 Nick Clifton + + PR/136 + * cache.c (bfd_cache_lookup_worker): Call abort() rather than + returning NULL as most users of this function do not check its + return value. + * hppabsd-core.c (hppabsd_core_core_file_p): Do not check result + of bfd_cache_lookup(). + * sco5-core.c (sco5_core_file_p): Likewise. + * trad-core.c (trad_unix_core_file_p): Likewise. + +2004-05-05 Nick Clifton + + * cache.c (bfd_cache_lookup): Improve formatting. + * archive.c: Fix formatting. + +2004-05-05 Peter Barada + + * bfd_archures.c(bfd_architecture): Add 521x,5249,547x,548x. + * cpu-m68k.c(bfd_m68k_arch): Likewise. + * bfd-in2.h(bfd_architecture): Regenerate. + +2004-05-03 Alan Modra + + * elf.c (_bfd_elf_rela_local_sym): Set kept_section for excluded + SEC_MERGE sections. + * elflink.c (elf_link_input_bfd): Adjust output reloc index for + those against discarded link-once and SEC_MERGE section symbols. + +2004-05-02 H.J. Lu + + * section.c (bfd_get_section_by_name_if): New. + * bfd-in2.h: Regenerated. + +2004-05-02 Alan Modra + + * som.c (som_bfd_is_group_section): Define. + +2004-05-01 Alan Modra + + * section.c (bfd_make_section_anyway): Copy the whole + bfd_hash_entry, not just "next" from existing entry. + +2004-04-30 H.J. Lu + + * elf.c (bfd_section_from_shdr): Maintain the section order in + a section group. + (special_sections): Add ".note.GNU-stack". + (elf_fake_sections): Handle section group for relocatable + link.. + +2004-04-30 H.J. Lu + + * section.c (bfd_sections_find_if): New. + * bfd-in2.h: Regenerated. + +2004-04-30 Alan Modra + + * section.c (bfd_make_section_anyway): Add all sections to hash tab. + + * elf-bfd.h (bfd_elf_is_group_section): Declare. + * elf.c (bfd_elf_is_group_section): New function. + * elfxx-target.h (bfd_elfNN_bfd_is_group_section + * section.c (bfd_generic_is_group_section): New function. + * targets.c (struct bfd_target): Add _bfd_is_group_section field. + (BFD_JUMP_TABLE_LINK): Adjust. + * aout-adobe.c (aout_32_bfd_is_group_section): Define. + * aout-target.h (MY_bfd_is_group_section): Define. + * aout-tic30.c (MY_bfd_is_group_section): Define. + * bfd.c (bfd_is_group_section): Define. + * binary.c (binary_bfd_is_group_section): Define. + * bout.c (b_out_bfd_is_group_section): Define. + * coff-alpha.c (_bfd_ecoff_bfd_is_group_section): Define. + * coff-mips.c (_bfd_ecoff_bfd_is_group_section): Define. + * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Adjust. + * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Adjust. + * coffcode.h (coff_bfd_is_group_section): Define. + * i386msdos.c (msdos_bfd_is_group_section): Define. + * i386os9k.c (os9k_bfd_is_group_section): Define. + * ieee.c (ieee_bfd_is_group_section): Define. + * ihex.c (ihex_bfd_is_group_section): Define. + * libbfd-in.h (_bfd_nolink_bfd_is_group_section): Define. + * mach-o.c (bfd_mach_o_bfd_is_group_section): Define. + * mmo.c (mmo_bfd_is_group_section): Define. + * nlm-target.h (nlm_bfd_is_group_section): Define. + * oasys.c (oasys_bfd_is_group_section): Define. + * pef.c (bfd_pef_bfd_is_group_section): Define. + * ppcboot.c (ppcboot_bfd_is_group_section): Define. + * srec.c (srec_bfd_is_group_section): Define. + * tekhex.c (tekhex_bfd_is_group_section): Define. + * versados.c (versados_bfd_is_group_section): Define. + * vms.c (vms_bfd_is_group_section): Define. + * xsym.c (bfd_sym_bfd_is_group_section): Define. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2004-04-30 Alan Modra + + * elflink.c (elf_gc_mark): Follow indirect and warning syms. + +2004-04-30 Hans-Peter Nilsson + + * configure.in: Update version to 2.15.91. + * configure: Regenerate. + +2004-04-29 Brian Ford + + * bfd.c (bfd_get_sign_extend_vma): Add pe[i]-i386 case to DJGPP hack. + * coffcode.h (DOT_DEBUG, GNU_LINKONCE_WI): Define. + [!COFF_WITH_PE] (sec_to_styp_flags, styp_to_sec_flags): Use them. + (coff_compute_section_file_positions) [RS6000COFF_C]: Likewise. + [COFF_WITH_PE] (sec_to_styp_flags): Handle DWARF 2/3 .debug* and + .gnu.linkonce.wi. sections. + * pe-i386.c (COFF_SUPPORT_GNU_LINKONCE): Define. + (COFF_SECTION_ALIGNMENT_ENTRIES): Add entries for .debug and + .gnu.linkonce.wi.. + * pei-i386.c (COFF_SUPPORT_GNU_LINKONCE): Likewise. + (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. + +2004-04-28 Chris Demetriou + + * reloc.c: Remove BFD_RELOC_PCREL_HI16_S and BFD_RELOC_PCREL_LO16. + * bfd-in2.h: Regenerate. + * libbfd.h: Likewise. + +2004-04-28 John David Anglin + + * som.c (struct som_misc_symbol_info): Add is_comdat, is_common and + dup_common fields. + (setup_sections): Use som_subspace_dictionary_record struct instead + subspace_dictionary_record. Set SEC_LINK_ONCE if subspace is + is_comdat, is_common or dup_common. + (som_prep_headers): Use som_subspace_dictionary_record struct. Set + is_comdat, is_common and dup_common in section subspace_dict from + copy_data. + (som_begin_writing): Use som_subspace_dictionary_record struct. + (som_finish_writing): Likewise. + (som_bfd_derive_misc_symbol_info): Add support to set is_comdat, + is_common and dup_common flags in info for symbol. Add comment + regarding linker support for these fields. Slightly reorganize + function. + (som_build_and_write_symbol_table): Set is_comdat, is_common and + dup_common fields in symbol table from symbol info. + (bfd_som_set_subsection_attributes): Add comdat, common and dup_common + arguments. Set corresponding fields in copy_data. Change all callers. + (som_bfd_ar_write_symbol_stuff): Set dup_common flag in library + symbol table. + (som_vec): Add SEC_LINK_ONCE to applicable section flags. + * som.h (som_subspace_dictionary_record): Define. + (som_copyable_section_data_struct): Add is_comdat, is_common and + dup_common fields. + (som_section_data_struct): Use som_subspace_dictionary_record struct + instead of subspace_dictionary_record. + (bfd_boolean bfd_som_set_subsection_attributes): Adjust prototype. + +2004-04-27 Bob Wilson + + * elf32-xtensa.c (xtensa_read_table_entries): Use section _cooked_size + if set. Check reloc_done flag before applying relocations. Use + output addresses, both when applying relocations and when comparing + against the specified section. + (elf_xtensa_relocate_section): Use output address to check if dynamic + reloc is in a literal pool. Set section's reloc_done flag. + +2004-04-27 H.J. Lu + + * elf32-sh64.c (elf_backend_section_flags): New. Defined. + (sh64_elf_set_mach_from_flags): Remove the kludge for .cranges + section. + (sh64_elf_section_flags): New. Set SEC_DEBUGGING for .cranges + section. + +2004-04-27 Alan Modra + + * elf64-alpha.c (elf64_alpha_read_ecoff_info): Don't assign + structure field removed in 2004-04-24 patch. + * elf64-sparc.c (sparc64_elf_plt_sym_val): Warning fix. + + * elf-bfd.h (struct elf_backend_data ): + Constify hdr arg. + * elf32-arm.h (elf32_arm_section_flags): Likewise. + * elf64-alpha.c (elf64_alpha_section_flags): Likewise. + * elfxx-ia64.c (elfNN_ia64_section_flags): Likewise. + * elf.c (_bfd_elf_make_section_from_shdr): Set the bfd_section + field before calling elf_backend_section_flags. + +2004-04-24 Chris Demetriou + + * elf32-mips.c (elf_mips_gnu_rel_hi16, elf_mips_gnu_rel_lo16) + (elf_mips_gnu_pcrel64, elf_mips_gnu_pcrel32): Remove. + (bfd_elf32_bfd_reloc_type_lookup): Remove cases for + BFD_RELOC_PCREL_HI16_S, BFD_RELOC_PCREL_LO16, BFD_RELOC_64_PCREL, + and BFD_RELOC_32_PCREL. + (mips_elf32_rtype_to_howto): Remove cases for R_MIPS_GNU_REL_HI16, + R_MIPS_GNU_REL_LO16, R_MIPS_PC64, R_MIPS_PC32. + * elfxx-mips.c (mips_elf_calculate_relocation): Likewise. + (_bfd_mips_elf_lo16_reloc): Remove handling for R_MIPS_GNU_REL_HI16. + (mips_elf_next_relocation): Move comment about matching HI/LO + relocations to... + (_bfd_mips_elf_relocate_section): Here. Remove handling for + R_MIPS_GNU_REL_HI16. + +2004-04-23 Chris Demetriou + + * coff-mips.c (mips_relhi_reloc, mips_rello_reloc) + (mips_switch_reloc, mips_read_relocs, mips_relax_section) + (mips_relax_pcrel16, PCREL16_EXPANSION_ADJUSTMENT): Remove. + (mips_relocate_hi): Remove now-unused 'adjust' and 'pcrel' arguments, + and update comments to reflect current usage. + (mips_howto_table): Remove entries for MIPS_R_RELHI, MIPS_R_RELLO, + and MIPS_R_SWITCH, as well as several empty entries. Update comment + for MIPS_R_PCREL16. + (mips_ecoff_swap_reloc_in, mips_ecoff_swap_reloc_out) + (mips_adjust_reloc_out, mips_bfd_reloc_type_lookup): Remove support + for MIPS_R_SWITCH, MIPS_R_RELLO, and MIPS_R_RELHI relocations. + (mips_adjust_reloc_in): Likewise, adjust maximum accepted relocation + type number to be MIPS_R_PCREL16. + (mips_relocate_section): Remove support for link-time relaxation + of branches used by embedded-PIC. Remove support for MIPS_R_SWITCH, + MIPS_R_RELLO, and MIPS_R_RELHI relocations. + (_bfd_ecoff_bfd_relax_section): Redefine to bfd_generic_relax_section. + * ecoff.c (ecoff_indirect_link_order): Remove support for link-time + relaxation of branches used by embedded-PIC. + * ecofflink.c (bfd_ecoff_debug_accumulate): Likewise. + * libecoff.h (struct ecoff_section_tdata): Remove embedded-PIC + related members, update comment. + * pe-mips.c: Remove disabled (commented-out and #if 0'd) + code related to embedded-PIC. + * elfxx-mips.c (_bfd_mips_elf_read_ecoff_info): Remove + initialization of now-removed 'adjust' member of + 'struct ecoff_debug_info'. + +2004-04-23 Chris Demetriou + + * elfxx-mips.c (mips_elf_get_global_gotsym_index): Remove. + +2004-04-21 Philip Blundell + + * elf32-arm.h (elf32_arm_check_relocs): Don't output REL32 + relocs for locally defined symbols during -shared final link. + (elf32_arm_final_link_relocate): Likewise. + +2004-04-22 Jakub Jelinek + + * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Copy also + ELF_LINK_POINTER_EQUALITY_NEEDED. + (elf64_x86_64_check_relocs): Set ELF_LINK_POINTER_EQUALITY_NEEDED + if r_type is not R_X86_64_PC32. + (elf64_x86_64_finish_dynamic_symbol): If + ELF_LINK_POINTER_EQUALITY_NEEDED is not set, clear st_value of + SHN_UNDEF symbols. + +2004-04-22 Kaz Kojima + + * elf32-sh.c (sh_elf_plt_sym_val): New function. + (elf_backend_plt_sym_val): Define. + +2004-04-22 Andrew Cagney + + * opncls.c (bfd_alloc): Fix type of "wanted" in doco. + +2004-04-22 John David Anglin + + * hpux-core.c (hpux_core_core_file_p): Add cast in call to + make_bfd_asection. + * som.c (som_set_section_contents): Constantify second argument. + (hppa_som_gen_reloc_type): Abort for unsupported selectors. + (som_object_setup): Rework to avoid warning. + (setup_sections, som_write_fixups, bfd_section_from_som_symbol): + Likewise. + +2004-04-22 Andrew Cagney + + * cache.c (bfd_cache_close): Check for a previously closed file. + +2004-04-22 Jakub Jelinek + + * bfd.c (bfd_get_synthetic_symtab): Define. + * targets.c (BFD_JUMP_TABLE_DYNAMIC): Add + NAME##_get_synthetic_symtab. + (struct bfd_target): Add _bfd_get_synthetic_symtab. + * libbfd-in.h (_bfd_nodynamic_get_synthetic_symtab): Define. + * elf-bfd.h (struct elf_backend_data): Add plt_sym_val and + relplt_name fields. + (_bfd_elf_get_synthetic_symtab): New prototype. + * elfcode.h (elf_get_synthetic_symtab): Define. + * elf.c (_bfd_elf_get_synthetic_symtab): New function. + * elfxx-target.h (bfd_elfNN_get_synthetic_symtab): Define. + (elf_backend_plt_sym_val, elf_backend_relplt_name): Define. + (elfNN_bed): Add elf_backend_plt_sym_val and elf_backend_relplt_name. + * bfd-in2.h: Rebuilt. + * libbfd.h: Rebuilt. + * elf32-i386.c (elf_i386_plt_sym_val): New function. + (elf_backend_plt_sym_val): Define. + * elf64-x86-64.c (elf64_x86_64_plt_sym_val): New function. + (elf_backend_plt_sym_val): Define. + * elf32-s390.c (elf_s390_plt_sym_val): New function. + (elf_backend_plt_sym_val): Define. + * elf64-s390.c (elf_s390_plt_sym_val): New function. + (elf_backend_plt_sym_val): Define. + * elf32-sparc (elf32_sparc_plt_sym_val): New function. + (elf_backend_plt_sym_val): Define. + * elf64-sparc.c (sparc64_elf_plt_sym_val): New function. + (elf_backend_plt_sym_val): Define. + * elf32-ppc.c (ppc_elf_plt_sym_val): New function. + (elf_backend_plt_sym_val): Define. + * aout-target.h (MY_get_synthetic_symtab): Define. + * aout-tic30.c (MY_get_synthetic_symtab): Define. + * coff-rs6000.c (rs6000coff_vec): Add + _bfd_nodynamic_get_synthetic_symtab. + (pmac_xcoff_vec): Likewise. + * coff64-rs6000.c (rs6000coff64_vec): Add + _bfd_nodynamic_get_synthetic_symtab. + (aix5coff64_vec): Likewise. + * sunos.c (MY_get_synthetic_symtab): Define. + * vms.c (vms_get_synthetic_symtab): Define. + +2004-04-22 Nick Clifton + + * bfd.c (bfd_archive_filename): Return NULL on NULL input. + +2004-04-22 Peter Barada + + * archures.c: Add bfd_mach_mcfv4e to bfd_architecture. + * bfd2-in.h: Regenerate. + * cpu-m68k.c: Add 'm68k:mcfv4e' to arch_info_struct[]. + +2004-04-21 Chris Demetriou + + * coff-mips.c (bfd_mips_ecoff_create_embedded_relocs): Remove. + * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Remove. + * bfd-in.h (bfd_mips_ecoff_create_embedded_relocs) + (bfd_mips_elf32_create_embedded_relocs): Remove prototypes + * bfd-in2.h: Regenerate. + +2004-04-21 Bob Wilson + + * elf32-xtensa.c (is_same_value): Add final_static_link argument and + require relocations against a weak symbol to reference the same + symbol hash entry if not a final, static link. + (get_cached_value, add_value_map): Add final_static_link argument. + (remove_literals): Pass final_static_link argument as needed. + +2004-04-21 Andrew Cagney + + * opncls.c (_bfd_new_bfd_contained_in): Copy "iovec". + (struct opncls, opncls_btell, opncls_bseek, opncls_bread) + (opncls_bwrite, opncls_bclose, opncls_bflush) + (opncls_bstat, opncls_iovec, bfd_openr_iovec): Implement a + bfd iovec that uses function callbacks. + (bfd_close): Use the iovec's bclose. + * cache.c (cache_btell, cache_bseek, cache_bread, cache_bwrite) + (cache_bclose, cache_bflush, cache_bstat) + (cache_iovec): New functions and global variable, implement a + cache "iovec", where applicable set bfd_error. + (bfd_cache_init, bfd_cache_close): Set/test the bfd's iovec. + * bfdio.c (struct bfd_iovec): Define. + (real_read): Delete function. + (bfd_bread, bfd_bread, bfd_bwrite, bfd_tell, bfd_flush, bfd_stat) + (bfd_seek, bfd_get_mtime, bfd_get_size): Use the bfd's "iovec", + assume that bread and bwrite set bfd_error. + * bfd.c (struct bfd): Add "iovec", update comments. + * bfd-in2.h, libbfd.h: Re-generate. + +2004-04-21 Andrew Cagney + + * libaout.h (enum machine_type): Add M_POWERPC_NETBSD. + +2004-04-21 Eric Botcazou + + * elflink.c (elf_gc_mark_dynamic_ref_symbol): New function. + (bfd_elf_gc_sections): Fail if a shared object is being created. + Do not fail if dynamic sections have been created. Instead call + elf_gc_mark_dynamic_ref_symbol to mark sections that contain + dynamically referenced symbols. Do not mark the whole graph + rooted at .eh_frame, only the section proper. + +2004-04-20 DJ Delorie + + * reloc.c: Add BFD_RELOC_32_SECREL. + * bfd-in2.h: Regenerate. + * libbfd.h: Likewise. + * coff-i386.c (howto_table) [COFF_WITH_PE]: Add R_SECREL32. + (coff_i386_rtype_to_howto) [COFF_WITH_PE]: Handle it. + (coff_i386_reloc_type_lookup) [COFF_WITH_PE]: Likewise. + +2004-04-19 Jakub Jelinek + + * elf32-sparc.c (elf32_sparc_relocate_section): Handle + relocs against hidden/protected undefweak symbols properly. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + +2004-04-18 Mark Kettenis + + * libaout.h (enum machine_type): Add M_POWERPC_NETBSD. + * netbsd-core.c (netbsd_core_file_p): Set architecture for PowerPC + core files. + +2004-04-17 Brian Ford + + * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Use the first non-zero + filepos for the SizeOfHeaders field. + (_bfd_XXi_swap_scnhdr_out): Correct section flags lossage on reloc + overflow. + (_bfd_XXi_swap_sym_in): Remove redundant section flags assignment. + +2004-04-16 Alan Modra + + * simple.c (bfd_simple_get_relocated_section_contents): Don't + change reloc_done. Set and restore _cooked_size. + (RETURN): Delete. + +2004-04-15 Mark Kettenis + + * netbsd-core.c (netbsd_core_file_p): Set architecture for VAX + core files. + +2004-04-15 Nick Clifton + + * bfd.c (bfd_archive_filename): Catch NULL bfd pointers. + +2004-04-15 Alan Modra + + * elf64-sparc.c (sparc64_elf_check_relocs): Fix thinko last change. + +2004-04-15 H.J. Lu + + * elflink.c (_bfd_elf_merge_symbol): Treat weak as strong only + when it is a definition. + +2004-04-14 Alan Modra + + * elf32-sparc.c (elf32_sparc_relocate_section): Don't abort + when statically linking PIC code. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + +2004-04-11 Thiemo Seufer + + * config.bfd: Remove mips*-*-mach3* and mips*-dec-mach3* targets. + * configure.in: Remove mips-dec-bsd*, mips-dec-mach3*, mips-*-mach3* + targets amd aout_mips_big_vec, aout_mips_little_vec target vectors. + * configure: Regenerate. + +2004-04-08 Richard Sandiford + + * elflink.c: Include libiberty.h. + * Makefile.am (elflink.lo): Depend on libiberty.h. + * Makefile.in: Regenerate. + +2004-04-06 Daniel Jacobowitz + + * elfxx-mips.c (MIPS_ELF_STUB_SECTION_NAME): Always use + ".MIPS.stubs". + +2004-04-05 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Always + reserve the memory for dynamic linker + +2004-04-05 Mark Kettenis + + * netbsd-core.c (CORE_WCOOKIE_OFFSET): New define. + (netbsd_core_file_p): Create a .wcookie section for OpenBSD/sparc. + +2004-04-02 H.J. Lu + + * elf32-cr16c.c (elf32_cr16c_relocate_section): Use + RELOC_FOR_GLOBAL_SYMBOL. + (elf32_cr16c_add_symbol_hook): Remove const from Elf_Internal_Sym. + +2004-04-02 H.J. Lu + + * elf32-arm.h (elf32_arm_final_link_relocate): Handle + R_ARM_ALU* only if OLD_ARM_ABI is not defined. + +2004-04-01 Paul Brook + + * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update. + * elf32-arm.h (struct elf32_elf_section_map): New. + (struct _arm_elf_section_data): New. + (elf32_arm_section_data): Define. + (struct elf32_arm_link_hash_table): Add byteswap_code. + (elf32_arm_link_hash_table_create): Initialize byteswap_code. + (bfd_elf32_arm_process_before_allocation): Add byteswap_code. + (elf32_arm_post_process_headers): Set EF_ARM_BE8. + (elf32_arm_output_symbol_hook, elf32_arm_new_section_hook, + elf32_arm_compare_mapping, elf32_arm_write_section): New functions. + (bfd_elf32_new_section_hook, elf_backend_write_section, + elf_backend_link_output_symbol_hook): Define. + +2004-04-01 Andy Chittenden + + * stabs.c (struct stab_link_includes_totals): Add field 'symb' + that keeps the characters in a B_INCL..B_EINCL range. + (_bfd_link_section_stabs): When computing the sum of the + characters in a B_INCL..B_EINCL range also keep a copy of those + characters. Use this information to distinguish between + include sections that have the same sum and the same length + but which are nevertheless unique. + +2004-03-31 Paul Brook + + * elf32-arm.h (elf32_arm_final_link_relocate): Add R_ARM_ALU*. + * elfarm-nabi.c (elf32_arm_howto_table): Ditto. + +2004-03-31 Andy Chittenden + + * stabs.c (struct stab_link_includes_totals): Rename field 'total' + to 'sum_chars' and add field 'num_chars'. + (_bfd_link_section_stabs): When computing the sum of the + characters in a B_INCL..B_EINCL range also keep a count of the + number of characters. Use this information to help distinguish + between include sections when have the same sum but which + nevertheless are still unique. + +2004-03-31 Mattias Engdegård + + * stabs.c (_bfd_link_section_stabs): Do not skip N_EXCL stabs. + +2004-03-30 Galit Heller + Tomer Levi + + * Makefile.am (ALL_MACHINES): Add cpu-cr16c.lo. + (ALL_MACHINES_CFILES): Add cpu-cr16c.c. + (BFD32_BACKENDS): Add elf32-cr16c.lo. + (BFD32_BACKENDS_CFILES): Add elf32-cr16c.c. + (cpu-cr16c.lo): New target. + (elf32-cr16c.lo): Likewise. + * Makefile.in: Regenerate. + * archures.c (bfd_architecture): Add bfd_{arch,mach}_cr16c. + (bfd_archures_list): Add bfd_cr16c_arch. + * config.bfd: Handle cr16c-*-elf*. + * configure.in: Handle bfd_elf32_cr16c_vec. + * configure: Regenerate. + * reloc.c: Add BFD_RELOC_16C_NUM08, BFD_RELOC_16C_NUM08_C, + BFD_RELOC_16C_NUM16, BFD_RELOC_16C_NUM16_C, + BFD_RELOC_16C_NUM32, BFD_RELOC_16C_NUM32_C, + BFD_RELOC_16C_DISP04, BFD_RELOC_16C_DISP04_C, + BFD_RELOC_16C_DISP08, BFD_RELOC_16C_DISP08_C, + BFD_RELOC_16C_DISP16, BFD_RELOC_16C_DISP16_C, + BFD_RELOC_16C_DISP24, BFD_RELOC_16C_DISP24_C, + BFD_RELOC_16C_DISP24a, BFD_RELOC_16C_DISP24a_C, + BFD_RELOC_16C_REG04, BFD_RELOC_16C_REG04_C, + BFD_RELOC_16C_REG04a, BFD_RELOC_16C_REG04a_C, + BFD_RELOC_16C_REG14, BFD_RELOC_16C_REG14_C, + BFD_RELOC_16C_REG16, BFD_RELOC_16C_REG16_C, + BFD_RELOC_16C_REG20, BFD_RELOC_16C_REG20_C, + BFD_RELOC_16C_ABS20, BFD_RELOC_16C_ABS20_C, + BFD_RELOC_16C_ABS24, BFD_RELOC_16C_ABS24_C, + BFD_RELOC_16C_IMM04, BFD_RELOC_16C_IMM04_C, + BFD_RELOC_16C_IMM16, BFD_RELOC_16C_IMM16_C, + BFD_RELOC_16C_IMM20, BFD_RELOC_16C_IMM20_C, + BFD_RELOC_16C_IMM24, BFD_RELOC_16C_IMM24_C, + BFD_RELOC_16C_IMM32, BFD_RELOC_16C_IMM32_C. + * targets.c (bfd_elf32_cr16c_vec): Declare. + (bfd_target_vector): Add bfd_elf32_cr16c_vec. + * cpu-cr16c.c: New file. + * elf32-cr16c.c: Likewise. + * libbfd.h: Regenerate. + * bfd-in2.h: Likewise. + +2004-03-30 Jakub Jelinek + + * elf.c (map_sections_to_segments): Fix handling of .tbss. + +2004-03-27 Alan Modra + + * Makefile.am: Remove all mention of elflink.h. + * Makefile.in: Regenerate. + * bfd-in.h (bfd_elf_discard_info): Declare. + (bfd_elf32_discard_info, bfd_elf64_discard_info): Delete. + * bfd-in2.h: Regenerate. + * elf-bfd.h (bfd_elf32_print_symbol, bfd_elf64_print_symbol, + bfd_elf32_link_record_dynamic_symbol, + bfd_elf64_link_record_dynamic_symbol, + _bfd_elf_link_record_dynamic_symbol, bfd_elf32_bfd_final_link, + bfd_elf64_bfd_final_link, elf_link_record_local_dynamic_symbol, + _bfd_elf32_link_record_local_dynamic_symbol, + _bfd_elf64_link_record_local_dynamic_symbol, + _bfd_elf32_gc_sections, _bfd_elf32_gc_common_finalize_got_offsets, + _bfd_elf32_gc_common_final_link, _bfd_elf64_gc_common_final_link, + _bfd_elf32_gc_record_vtinherit, _bfd_elf32_gc_record_vtentry, + _bfd_elf64_gc_sections, _bfd_elf64_gc_common_finalize_got_offsets, + _bfd_elf64_gc_record_vtinherit, _bfd_elf64_gc_record_vtentry, + _bfd_elf32_reloc_symbol_deleted_p, + _bfd_elf64_reloc_symbol_deleted_p): Delete. + (bfd_elf_link_record_dynamic_symbol, + bfd_elf_link_record_local_dynamic_symbol, + bfd_elf_final_link, bfd_elf_gc_sections, + bfd_elf_gc_record_vtinherit, bfd_elf_gc_record_vtentry, + bfd_elf_gc_common_finalize_got_offsets, bfd_elf_gc_common_final_link, + bfd_elf_reloc_symbol_deleted_p): Declare. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + * elf32-arm.h: Update for changed function names. Remove local + WILL_CALL_FINISH_DYNAMIC_SECTION define. + * elf-hppa.h, elf-m10300.c, elf32-cris.c, elf32-d10v.c, elf32-dlx.c, + * elf32-fr30.c, elf32-frv.c, elf32-h8300.c, elf32-hppa.c, elf32-i386.c, + * elf32-iq2000.c, elf32-m32r.c, elf32-m68hc1x.c, elf32-m68k.c, + * elf32-mcore.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c, + * elf32-sh.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c, + * elf32-xstormy16.c, elf32-xtensa.c, elf64-alpha.c, elf64-hppa.c, + * elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, + * elf64-x86-64.c, elfxx-ia64.c, elfxx-mips.c, elfxx-target.h: Likewise. + * elfxx-target.h (bfd_elfNN_bfd_final_link): Define. + (bfd_elfNN_print_symbol): Define. + * elfcode.h: Don't include elflink.h. + (elf_bfd_discard_info, elf_reloc_symbol_deleted_p, + elf_link_record_dynamic_symbol, elf_bfd_final_link, elf_gc_sections, + elf_gc_common_finalize_got_offsets, elf_gc_common_final_link, + elf_gc_record_vtinherit, elf_gc_record_vtentry, + elf_link_record_local_dynamic_symbol): Don't define. + * elflink.c: Update for changed function names. Move elflink.h + code here. + * elflink.h: Delete file. + * po/SRC-POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. + +2004-03-27 Alan Modra + + * elf64-mmix.c (mmix_elf_relocate_section): Restore code setting + "name" for global syms accidentally removed in 2004-03-20 change. + +2004-03-27 Alan Modra + + * elf-bfd.h (struct elf_reloc_cookie): Add r_sym_shift field. + * elflink.h: Replace all occurrences of sizeof (Elf_External_*) + where Elf_External_* is different for 64 and 32 bit, with + corresponding elf_size_info field. + (struct elf_final_link_info): Use "bfd_byte *" instead + of "Elf_External_Sym *" for external_syms and symbuf. + (elf_link_adjust_relocs): Set up r_type_mask and r_sym_shift local + vars and use instead of ELF_R_INFO and ELF_R_TYPE macros. + (struct elf_link_sort_rela): Add "sym_mask" alias for "offset". + (elf_link_sort_cmp1): Use sym_mask field instead of ELF_R_SYM. + (elf_link_sort_cmp2): Adjust. + (elf_link_sort_relocs): Set up r_sym_mask local var instead of + using ELF_R_SYM macro. Set u.sym_mask. + (elf_bfd_final_link): Call _bfd_elf_stringtab_init instead of macro + version, elf_stringtab_init. Ditto for bfd_section_from_elf_index + vs. section_from_elf_index. Adjust Elf_External_Sym pointer + arithmetic. Pass bed to elf_link_flush_output_syms. Adjust + Elf_External_Dyn pointer arithmentic. Use bed swap_dyn_in and + swap_syn_out functions. Rearrange dyn swap in/out switch. + (elf_link_output_sym): Adjust Elf_External_Sym pointer arithmentic. + Pass bed to elf_link_flush_output_syms. Use bed swap_symbol_out. + (elf_link_flush_output_syms): Add elf_backend_data arg. + (elf_link_check_versioned_symbol): Likewise. + (elf_link_output_extsym): Pass bed to elf_link_check_versioned_symbol. + Adjust Elf_External_Sym pointer arithmetic. Use bed swap_symbol_out. + (elf_link_input_bfd): Use bfd_section_from_elf_index. Set up + r_type_mask and r_sym_shift local vars and use instead of ELF_R_SYM, + ELF_R_TYPE and ELF_R_INFO macros. + (elf_reloc_link_order): Select ELF32_R_INFO or ELF64_R_INFO invocation + based on size rather than using ELF_R_INFO. + (elf_gc_mark): Set up r_sym_shift local var and use instead of + ELF_R_SYM macro. + (struct alloc_got_off_arg): New. + (elf_gc_common_finalize_got_offsets): Use elf_size_info instead of + ARCH_SIZE. Pass get entry size down to elf_gc_allocate_got_offsets. + (elf_gc_allocate_got_offsets): Adjust. + (elf_reloc_symbol_deleted_p): Usee cookie.r_sym_shift instead of + ELF_R_SYM. Use bfd_section_from_elf_index. + (elf_bfd_discard_info): Set cookie.r_sym_shift. + * elfcode.h (elf_stringtab_init, section_from_elf_index): Delete. + (elf_slurp_symbol_table): Use bfd_section_from_elf_index. + +2004-03-26 Stan Shebs + + Remove MPW support, no longer used. + * config.bfd (powerpc-*-mpw*): Remove configuration. + * mpw-config.in, mpw-make.sed: Remove files. + * ecoffswap.h [MPW_C]: Remove MPW-C-friendly version of code. + +2004-03-26 Alan Modra + + * elf64-ppc.c (elf_backend_add_symbol_hook): Define. + (ppc64_elf_add_symbol_hook): New function. + * elf-bfd.h (struct elf_backend_data ): Remove + const from Elf_Internal_Sym param. + * elflink.c (elf_link_add_object_symbols): Adjust. + * elf-hppa.h (elf_hppa_add_symbol_hook): Adjust. + * elf32-frv.c (elf32_frv_add_symbol_hook): Adjust. + * elf32-i370.c (elf_backend_add_symbol_hook): Adjust. + * elf32-m32r.c (m32r_elf_add_symbol_hook): Adjust. + * elf32-m68hc1x.c (elf32_m68hc11_add_symbol_hook): Adjust. + * elf32-m68hc1x.h (elf32_m68hc11_add_symbol_hook): Adjust. + * elf32-ppc.c (ppc_elf_add_symbol_hook): Adjust. + * elf32-sh64.c (sh64_elf_add_symbol_hook): Adjust. + * elf32-v850.c (v850_elf_add_symbol_hook): Adjust. + * elf64-alpha.c (elf64_alpha_add_symbol_hook): Adjust. + * elf64-mmix.c (mmix_elf_add_symbol_hook): Adjust. + * elf64-sh64.c (sh64_elf64_add_symbol_hook): Adjust. + * elf64-sparc.c (sparc64_elf_add_symbol_hook): Adjust. + * elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Adjust. + * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Adjust. + * elfxx-mips.h (_bfd_mips_elf_add_symbol_hook): Adjust. + +2004-03-26 Alan Modra + + * elfxx-target.h (bfd_elfNN_bfd_link_add_symbols): Define. + * elf-bfd.h (_bfd_elf_link_add_archive_symbols): Delete. + (_bfd_elf_sort_symbol, _bfd_elf_add_dt_needed_tag): Delete. + (_bfd_elf_finalize_dynstr, bfd_elf32_bfd_link_add_symbols): Delete. + (bfd_elf64_bfd_link_add_symbols): Delete. + (bfd_elf_link_add_symbols): Declare. + * elfcode.h (elf_bfd_link_add_symbols): Delete. + * elflink.c: Include safe-ctype.h. + (elf_add_dt_needed_tag): Rename from _bfd_elf_add_dt_needed_tag, + make static. + (elf_sort_symbol): Rename from _bfd_elf_sort_symbol, make static. + (elf_finalize_dynstr): Rename from _bfd_elf_finalize_dynstr, make + static. + (elf_link_add_archive_symbols): Rename from + _bfd_elf_link_add_archive_symbols, make static. + (elf_link_add_object_symbols): New function. Corresponding + elflink.h function converted to use elf_size_info. + (bfd_elf_link_add_symbols): Likewise. + (bfd_elf_size_dynamic_sections): Adjust. + * elflink.h (elf_bfd_link_add_symbols): Delete. + (elf_link_add_object_symbols): Delete. + * elf32-gen.c (elf32_generic_link_add_symbols): Call + bfd_elf_link_add_symbols. + * elf64-gen.c (elf64_generic_link_add_symbols): Likewise. + +2004-03-25 Alan Modra + + * elflink.h (elf_link_add_object_symbols): Add DT_NEEDED for as-needed + and chained shared libs only if dynsym. Clear dynsym on forced-local. + + * elf-bfd.h (_bfd_elf_add_dynamic_entry): Declare. + (bfd_elf32_add_dynamic_entry, bfd_elf64_add_dynamic_entry): Delete. + (_bfd_elf_add_dt_needed_tag): Declare. + (_bfd_elf_sort_symbol): Declare. + (_bfd_elf_finalize_dynstr): Declare. + (RELOC_FOR_GLOBAL_SYM): Formatting. + * elfcode.h (elf_add_dynamic_entry): Delete. + * elflink.c (_bfd_elf_add_dynamic_entry): New function. Corresponding + elflink.h function converted to use elf_size_info. + (_bfd_elf_add_dt_needed_tag): Likewise. + (_bfd_elf_sort_symbol): Likewise. + (_bfd_elf_finalize_dynstr): Likewise. + (compute_bucket_count): Likewise. + (bfd_elf_size_dynamic_sections): Likewise. Check result of + _bfd_elf_strtab_add before calling _bfd_elf_strtab_addref. + (elf_adjust_dynstr_offsets, elf_collect_hash_codes): Moved from.. + * elflink.h: ..here. + (sort_symbol, add_dt_needed_tag): Delete. + (elf_add_dynamic_entry, elf_finalize_dynstr): Delete. + (compute_bucket_count, NAME(bfd_elf,size_dynamic_sections)): Delete. + Update all users. + * elf32-arm.h (add_dynamic_entry): Update. Remove casts. + * elf32-cris.c (add_dynamic_entry): Likewise. + * elf32-hppa.c (add_dynamic_entry): Likewise. + * elf32-i370.c (add_dynamic_entry): Likewise. + * elf32-i386.c (add_dynamic_entry): Likewise. + * elf32-m32r.c (add_dynamic_entry): Likewise. + * elf32-m68k.c (add_dynamic_entry): Likewise. + * elf32-ppc.c (add_dynamic_entry): Likewise. + * elf32-s390.c (add_dynamic_entry): Likewise. + * elf32-sh.c (add_dynamic_entry): Likewise. + * elf32-sparc.c (add_dynamic_entry): Likewise. + * elf32-vax.c (add_dynamic_entry): Likewise. + * elf32-xtensa.c (add_dynamic_entry): Likewise. + * elf64-alpha.c (add_dynamic_entry): Likewise. + * elf64-hppa.c (add_dynamic_entry): Likewise. + * elf64-ppc.c (add_dynamic_entry): Likewise. + * elf64-s390.c (add_dynamic_entry): Likewise. + * elf64-sparc.c (add_dynamic_entry): Likewise. + * elf64-x86-64.c (add_dynamic_entry): Likewise. + * elfxx-ia64.c (add_dynamic_entry): Likewise. + * elfxx-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise. + * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Likewise. + * elf32-frv.c (elf32_frv_size_dynamic_sections): Likewise. + * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. + +2004-03-23 Paul Brook + + * elf32-arm.h (arm_print_private_bfd_data): Add EABI v3. + +2004-03-22 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_check_relocs): Remove code to read + literal tables and check for relocs outside of literal pools. + (elf_xtensa_make_sym_local): Don't clear ELF_LINK_NON_GOT_REF flag. + (elf_xtensa_fix_refcounts): Don't check ELF_LINK_NON_GOT_REF or + set DF_TEXTREL. + (elf_xtensa_size_dynamic_sections): Don't add DT_TEXTREL entry. + (elf_xtensa_relocate_section): Read literal tables and check for + dynamic relocations in read-only sections and not in literal pools. + +2004-03-23 Alan Modra + + PR 51. + * linker.c (bfd_wrapped_link_hash_lookup): Handle info->wrap_char. + +2004-03-22 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) : Also error if there's no PLT for a symbol + not defined by the executable, or defined in a DSO. + : Initialize GOT entry for a + function symbol or ELF_LINK_HASH_NEEDS_PLT statically in an + executable. + (cris_elf_gc_sweep_hook): Improve fallthrough marking. + (elf_cris_try_fold_plt_to_got): Improve head comment. Do not fold + a PLT reloc to GOT for an executable. + (elf_cris_adjust_dynamic_symbol): Only fold a .got.plt entry with + .got for a DSO and explain why. + (elf_cris_discard_excess_program_dynamics): Also lose GOT-relocs + and unreferenced symbols for which a PLT is defined. Adjust + dynamic-symbol pruning correspondingly, to make sure we don't lose + a dynamic symbol also defined by a DSO. + +2004-03-22 Alan Modra + + * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add input_bfd, input_section + and rel args. Group input and output args. Wrap to 80 columns. + * elf-m10200.c, elf-m10300.c, elf32-arm.h, elf32-avr.c, + elf32-cris.c, elf32-d10v.c, elf32-fr30.c, elf32-h8300.c, + elf32-hppa.c, elf32-i386.c, elf32-i860.c, elf32-ip2k.c, + elf32-iq2000.c, elf32-m68hc1x.c, elf32-m68k.c, elf32-mcore.c, + elf32-msp430.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c, + elf32-sparc.c, elf32-v850.c, elf32-vax.c, elf32-xstormy16.c, + elf32-xtensa.c, elf64-alpha.c, elf64-mmix.c, elf64-ppc.c, + elf64-s390.c, elf64-sparc.c, elf64-x86-64.c, elfxx-ia64.c: Update + RELOC_FOR_GLOBAL_SYMBOL invocation. + +2004-03-20 H.J. Lu + + * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Report error if + unresolved symbols in objects aren't allowed. + + * elf-hppa.h (elf_hppa_relocate_section): Properly handle + unresolved symbols. + (elf_hppa_remark_useless_dynamic_symbols): Likewise. + (elf_hppa_unmark_useless_dynamic_symbols): + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. + (elf32_hppa_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + * elfxx-mips.c (mips_elf_calculate_relocation): Likewise. + + * elf-m10200.c (mn10200_elf_relocate_section): Use + RELOC_FOR_GLOBAL_SYMBOL. + * elf32-avr.c (elf32_avr_relocate_section): Likewise. + * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. + * elf32-fr30.c (fr30_elf_relocate_section): Likewise. + * elf32-h8300.c (elf32_h8_relocate_section): Likewise. + * elf32-i860.c (elf32_i860_relocate_section): Likewise. + * elf32-m68hc1x.c (m68hc11_get_relocation_value): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. + * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. + * elf64-mmix.c (mmix_elf_relocate_section): Likewise. + +2004-03-19 John David Anglin + + * elf32-hppa.c (elf32_hppa_check_relocs): Handle R_PARISC_PCREL32. + (final_link_relocate): Likewise. + * elf-hppa.h (elf_hppa_reloc_final_type): Handle selectors for + R_PARISC_PCREL32 and R_PARISC_PCREL64 relocations. + +2004-03-19 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * po/bfd.pot: Regenerate. + +2004-03-19 Alan Modra + H.J. Lu + + * elflink.c (_bfd_elf_merge_symbol): Revert last change. Move + type and size change code to where it was previously. Remove + dt_needed param. Treat old weak syms as strong if new sym is + from a shared lib, even when old sym is from another shared + lib. Remove unnecessary tests of oldweak and newweak. Correct + comments. + (_bfd_elf_add_default_symbol): Remove dt_needed param. Update + _bfd_elf_merge_symbol calls. + * elflink.h (elf_link_add_object_symbols): Update calls. Remove + dt_needed local var. Update comments. + * elf-bfd.h (_bfd_elf_merge_symbol): Update prototype. + (_bfd_elf_add_default_symbol): Likewise. + + * elflink.c (_bfd_elf_merge_symbol): Reinstate code to handle + strong syms in one shared object overriding weak syms in another. + +2004-03-18 Alan Modra + + * elf-bfd.h (struct elf_obj_tdata): Delete dt_soname field. Add + dyn_lib_class field. Rearrange for better packing. + (elf_dt_soname): Delete. + (elf_dyn_lib_class): Define. + * elf.c (bfd_elf_set_dt_needed_name): Update comment. + (bfd_elf_set_dt_needed_soname): Delete. + (bfd_elf_set_dyn_lib_class): New function. + * elflink.h (add_dt_needed_tag): New function. Split out from.. + (elf_link_add_object_symbols): ..here. Rename "name" to "soname". + Use elf_dyn_lib_class to set dt_needed and add_needed. Move fallback + initialization of soname. + (elf_link_check_versioned_symbol): Test elf_dyn_lib_class instead of + elf_dt_soname. + * bfd-in.h (enum dynamic_lib_link_class): New. + (bfd_elf_set_dt_needed_soname): Delete. + (bfd_elf_set_dyn_lib_class): Declare. + * bfd-in2.h: Regenerate. + + * elflink.c (_bfd_elf_merge_symbol): Rewrite weak symbol handling. + (_bfd_elf_add_default_symbol): Remove indirect BFD_ASSERTs. + * elflink.h (elf_link_add_object_symbols): Don't clear dt_needed in + symbol loop. Instead use add_needed to flag tag as written. + +2004-03-17 Nathan Sidwell + + * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Correct + logic for null_input_bfd detection. + +2004-03-17 Ralf Corsepius + + * config.bfd: Switch sh-*-rtems* to ELF. Add sh-*-rtemscoff*. + +2004-03-16 Mark Kettenis + + * netbsd-core.c (netbsd_core_file_p) [CORE_FPU_OFFSET]: Remove + code. + +2004-03-16 Alan Modra + + * elflink.c (elf_link_read_relocs_from_section): Don't use + NUM_SHDR_ENTRIES in end of reloc calc. Move NULL shdr check.. + (_bfd_elf_link_read_relocs): ..to here. + * elf32-ppc.c (ppc_elf_relax_section): Formatting. + +2004-03-16 Alan Modra + + * configure.in (HOST_64BIT_TYPE, HOST_U_64BIT_TYPE): Don't override + values selected in configure.host. Require both to be defined + before setting BFD_HOST_64_BIT_DEFINED. Protect assignment to + corresponding BFD_HOST vars with quotes. + <${host64}-${target64}-${want64} in *true*>: Don't exempt gcc; + Always require BFD_HOST_64_BIT_DEFINED. + : Find off_t size before emitting message. Combine + off_t and ftello64 conditional. + * configure: Regenerate. + +2004-03-16 Alan Modra + + * elf32-m32r.c (m32r_elf_create_dynamic_sections): Fix pointer + aliasing warning. Remove trailing whitespace throughout file. + +2004-03-15 John David Anglin + + * elf-hppa.h (elf_hppa_relocate_section): Pass input_bfd instead of + input_section in calls to get_dyn_name. + * elf64-hppa.c (get_dyn_name): Change type of first argument to "bfd *". Use section id of first section in input BFD to build dynamic name for + local symbols. + (elf64_hppa_check_relocs): Pass abfd in call to get_dyn_name. + +2004-03-15 Alan Modra + + * bfd-in.h (bfd_int64_t, bfd_uint64_t): New types. + (BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Don't define here. + (bfd_getb64, bfd_getl64, bfd_get_bits): Return bfd_uint64_t. + (bfd_getb_signed_64, bfd_getl_signed_64): Return bfd_int64_t. + (bfd_putb64, bfd_putl64, bfd_put_bits): Accept bfd_uint64_t. + * configure.in (HOST_U_64BIT_TYPE): Set when sizeof long is 8. + (BFD_HOST_64_BIT_DEFINED, BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Set + when using long. + * libbfd.c (EIGHT_GAZILLION, COERCE64): Use bfd_int64_t. + (bfd_getb64): Return bfd_uint64_t. Enable when BFD_HOST_64_BIT. + (bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise. + (bfd_putb64): Accept bfd_uint64_t. Enable when BFD_HOST_64_BIT. + (bfd_putl64, bfd_put_bits, bfd_get_bits): Likewise. + * dwarf2.c (struct attribute): Use bfd_int64_t and bfd_uint64_t. + (read_8_bytes, read_indirect_string, read_address): Likewise. + (read_abbrevs, parse_comp_unit): Likewise. + * targets.c (struct bfd_target): Likewise. + * aix386-core.c (NO_GET64, NO_PUT64, NO_GETS64): Define and use. + * hppabsd-core.c: Likewise. Formatting. + * hpux-core.c: Likewise. + * irix-core.c: Likewise. + * netbsd-core.c: Likewise. + * osf-core.c: Likewise. + * ptrace-core.c: Likewise. + * sco5-core.c: Likewise. + * trad-core.c: Likewise. + * configure: Regenerate. + * bfd-in2.h: Regenerate. + +2004-03-15 Alan Modra + + * bfd-in.h (bfd_getb64, bfd_getl64): Replace bfd_byte* with void*. + (bfd_getb32, bfd_getl32, bfd_getb16, bfd_getl16): Likewise. + (bfd_getb_signed_64, bfd_getl_signed_64): Likewise. + (bfd_getb_signed_32, bfd_getl_signed_32): Likewise. + (bfd_getb_signed_16, bfd_getl_signed_16): Likewise. + (bfd_putb64, bfd_putl64, bfd_putb32, bfd_putl32): Likewise. + (bfd_putb16, bfd_putl16, bfd_get_bits, bfd_put_bits): Likewise. + * libbfd.c: Likewise in function definitions. + (bfd_put_8): Mask with 0xff rather than casting to char. + (bfd_putb16, bfd_putl16, bfd_putb32, bfd_putl32): Likewise. + (bfd_putb64, bfd_putl64, bfd_put_bits): Likewise. + (H_PUT_64, H_PUT_32, H_PUT_16, H_PUT_8): Remove casts, simplify. + (H_PUT_S64, H_PUT_S32, H_PUT_S16, H_PUT_S8): Likewise. + (H_GET_64, H_GET_32, H_GET_16, H_GET_8): Likewise. + (H_GET_S64, H_GET_S32, H_GET_S16, H_GET_S8): Likewise. + * libaout.h (H_PUT_64 H_PUT_32, H_PUT_16): Remove casts, simplify. + (H_PUT_S64, H_PUT_S32, H_PUT_S16): Likewise. + (H_GET_64, H_GET_32, H_GET_16): Likewise. + (H_GET_S64, H_GET_S32, H_GET_S16): Likewise. + * archive.c (do_slurp_coff_armap): Update swap prototype. + * coff-tic54x.c (tic54x_getl32): Replace bfd_byte* with void*. + (tic54x_getl_signed_32): Likewise. + (tic54x_putl32): Likewise. Mask with 0xff rather than casting to char. + * mach-o.c (bfd_mach_o_read_header): Update get32 prototype. + * pdp11.c (bfd_getp32): Make static, replace bfd_byte* with void*. + (bfd_getp_signed_32, bfd_putp32): Likewise. + * targets.c (struct bfd_target): Use void* in place of bfd_byte* for + bfd_getx64, bfd_getx_signed_64, bfd_putx64, bfd_getx32, + bfd_getx_signed_32, bfd_putx32, bfd_getx16, bfd_getx_signed_16, + bfd_putx16, bfd_h_getx64, bfd_h_getx_signed_64, bfd_h_putx64, + bfd_h_getx32, bfd_h_getx_signed_32, bfd_h_putx32, bfd_h_getx16, + bfd_h_getx_signed_16, bfd_h_putx16. + * aix386-core.c (NO_GET, NO_GETS, NO_PUT): Update prototypes. + * hppabsd-core.c: Similarly. Rename NO_SIGNED_GET to NO_GETS. + * hpux-core.c: Likewise. + * irix-core.c: Likewise. + * netbsd-core.c: Likewise. + * osf-core.c: Likewise. + * ptrace-core.c: Likewise. + * sco5-core.c: Likewise. + * trad-core.c: Likewise. + * bfd-in2.h: Regenerate. + +2004-03-15 Matt Thomas + + * config.bfd: Add x86-64 vector to NetBSD/i386 if 64bit BFD is + selected. + +2004-03-13 Mark Kettenis + + * config.bfd: Add x86_64-*-openbsd*. + * configure.in (x86_64-*-openbsd*): Set COREFILE to + netbsd-core.lo. + * configure: Regenerate. + +2004-03-12 Nick Clifton + Dave Murphy + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Skip most checks + if the input bfd does not contain any code. + +2004-03-09 Steve Ellcey + + * elfxx-ia64.c (plt_full_entry): Change ld8 to ld8.acq. + +2004-03-05 Fred Fish + + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Just force + mips16 symbols to be even rather than testing first for even/odd. + (_bfd_mips_elf_link_output_symbol_hook): Ditto. + +2004-03-05 Nathan Sidwell + + * elf.c (map_sections_to_segments): Ignore .tbss sections for + layout purposes. + +2004-03-03 Alexandre Oliva + + * elflink.c (bfd_elf_record_link_assignment): Mark undefweak and + undefined symbols as hash_new. + +2003-03-03 Andrew Stubbs + + * archures.c: Add bfd_mach_sh4_nommu_nofpu. + * cpu-sh.c: Ditto. + * elf32-sh.c: Ditto. + * bfd-in2.h: Regenerate. + +2004-03-02 Alexandre Oliva + + * elf32-frv.c (struct frv_pic_relocs_info): Added fixups and + dynrelocs. + (_frv_count_got_plt_entries): Initialize them. + (frv_pic_relocs_info_find): Add insert argument. Adjust all + callers. + (frv_pic_relocs_info_for_global): Likewise. + (frv_pic_relocs_info_for_local): Likewise. + (frv_pic_merge_early_relocs_info): New. + (_frv_resolve_final_relocs_info): Use it in case one entry maps to + another. + (_frv_add_dyn_reloc): Add entry argument. Adjust all callers. + Check that we don't exceed the allocated count for entry. + (_frv_add_rofixup): Likewise. + (_frv_emit_got_relocs_plt_entries): Adjust for coding standards. + (elf32_frv_finish_dynamic_sections): Improve error message in case + we emit too few rofixup entries. + +2004-03-01 Richard Sandiford + + * archures.c (bfd_mach_fr450): New. + * bfd-in2.h: Regenerate. + * cpu-frv.c (arch_info_450): New bfd_arch_info_type. + (arch_info_500): Link to it. + * elf32-frv.c (elf32_frv_machine, frv_elf_merge_private_bfd_data) + (frv_elf_print_private_bfd_data): Handle fr405 and fr450 header flags. + (frv_elf_arch_extension_p): New function. + (frv_elf_merge_private_bfd_data): Use it. + +2004-02-28 H.J. Lu + + * elf-bfd.h (_bfd_elf_link_add_archive_symbols): New prototype. + + * elflink.h (is_global_data_symbol_definition): Moved to + elflink.c. + (elf_link_is_defined_archive_symbol): Likewise. + (elf_link_add_archive_symbols): Likewise. Renamed to + _bfd_elf_link_add_archive_symbols. + + * elflink.c (elf_link_is_defined_archive_symbol): Get the size + of ELF symbol table entry from backend. + (_bfd_elf_link_add_archive_symbols): Call bfd_link_add_symbols + instead of elf_link_add_object_symbols. + +2004-02-27 Alexandre Oliva + + * elf-bfd.h (struct elf_backend_data): Added + elf_backend_can_make_relative_eh_frame, + elf_backend_can_make_lsda_relative_eh_frame and + elf_backend_encode_eh_address. + (_bfd_elf_encode_eh_address): Declare. + (_bfd_elf_can_make_relative): Declare. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use new + hooks to decide whether to attempt to make_relative and + make_lsda_relative. + (_bfd_elf_write_section_eh_frame_hdr): Call encode_eh_address. + (_bfd_elf_can_make_relative): New. + (_bfd_elf_encode_eh_address): New. + * elf32-frv.c (frv_elf_use_relative_eh_frame): New. + (frv_elf_encode_eh_address): New. + (elf_backend_can_make_relative_eh_frame): Define. + (elf_backend_can_make_lsda_relative_eh_frame): Define. + (elf_backend_encode_eh_address): Define. + * elfxx-target.h + (elf_backend_can_make_relative_eh_frame): Define. + (elf_backend_can_make_lsda_relative_eh_frame): Define. + (elf_backend_encode_eh_address): Define. + (elfNN_bed): Add them. + +2004-02-27 Alexandre Oliva + + * elf32-frv.c (elf32_frv_howto_table) : Set + complain_on_overflow to signed. + +2004-02-27 H.J. Lu + + * elflink.h (sort_symbol): New. + (elf_link_add_object_symbols): Use a sorted symbol array for + weakdef. + +2004-02-27 Jakub Jelinek + + * elf32-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL + for pc relative relocs. + (elf_s390_relocate_section): Likewise. + * elf64-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL + for pc relative relocs. + (elf_s390_relocate_section): Likewise. + +2004-02-26 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_check_relocs): Fix call to + count_dyn_reloc. + +2004-02-25 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_dyn_reloc_entry): Add the reltext. + field to track if a relocation is against readonly section. + (count_dyn_reloc): Take a new argument for rent->reltext. + (elfNN_ia64_check_relocs): Adjust call to count_dyn_reloc. + (get_reloc_section): Don't set ia64_info->reltext here. + (allocate_dynrel_entries): Set ia64_info->reltext here. + +2004-02-24 Alexandre Oliva + + * elf32-frv.c (FRV_SYM_LOCAL): Weak undefined doesn't imply local. + (_frv_emit_got_relocs_plt_entries): Decay relocation to protected + function's descriptor to symbol+offset, and map local undefweak + symbol to NULL function descriptor. + (elf32_frv_relocate_section): Likewise. + +2004-02-23 Mark Kettenis + + * libaout.h (enum machine_type): Add M_SPARC64_NETBSD and + M_X86_64_NETBSD. + * netbsd-core.c (M_SPARC64_OPENBSD): Define. + (netbsd_core_file_p): Set architecture from machine ID for + selected machines. + +2004-02-23 Jakub Jelinek + + * elflink.h (size_dynamic_sections): If not adding DT_FLAGS and + DF_BIND_NOW is set in info->flags, create DT_BIND_NOW dynamic entry. + +2004-02-21 H.J. Lu + + * elflink.c (_bfd_elf_merge_symbol): Properly handle undefined + symbols with non-default visibility. + +2004-02-21 Danny Smith + + * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Clear + IMAGE_SCN_MEM_WRITE on known sections only. + +2004-02-20 Jakub Jelinek + + * elf32-ppc.c (allocate_dynrelocs): Create dynsym for undef weak + symbols used in PIE relocs. + +2004-02-19 Jakub Jelinek + + * elf32-sparc.c (elf32_sparc_finish_dynamic_sections): Clear + .plt sh_entsize. + +2004-02-18 Daniel Jacobowitz + + * configure.in: Update version to 2.15.90. + * configure: Regenerate. + +2004-02-17 Daniel Jacobowitz + Richard Sandiford + + * elfxx-mips.c (mips_elf_calculate_relocation): Use + _bfd_elf_symbol_refs_local_p to decide whether to decay + a GOT_PAGE/GOT_OFST pair to GOT_DISP/addend. + (_bfd_mips_elf_check_relocs): Add a global GOT entry for GOT_PAGE + relocs if the symbol wasn't defined by a regular object file. + Don't check the symbol's dynindx. + +2004-02-16 Andrew Cagney + + * bfd-in.h (file_ptr, ufile_ptr): Configure type using + @bfd_file_ptr@. + * bfd-in2.h: Re-generate. + +2004-02-14 Andrew Cagney + + * configure.host (HDEFINES): When hppa*-*-hpux*, define + _LARGEFILE64_SOURCE. + +2004-02-13 Andrew Cagney + + * elf.c (vma_page_aligned_bias): New function. + (assign_file_positions_except_relocs) + (assign_file_positions_for_segments): Replace broken modulo + arithmetic with call to vma_page_aligned_bias. + +2004-02-11 Andrew Cagney + + * bfd-in.h: Update copyright. + (bfd_tell): Change return type to file_ptr. + * bfd-in2.h: Re-generate. + * cache.c: Update copyright. + (bfd_cache_lookup_worker): Use real_fseek, do not cast offset + parameter. + (close_one): Use real_ftell. + * bfdio.c: Update copyright. + (real_ftell, real_fseek): New functions. + (bfd_tell): Use real_fseek and real_ftell, change return type to + file_ptr. + (bfd_seek): Use real_ftell and real_fseek, change type of + file_position to a file_ptr. + * libbfd-in.h: Update copyright. + (real_ftell, real_fseek): Declare. + * libbfd.h: Re-generate. + + * configure.in (AC_CHECK_FUNCS): Check for ftello, ftello64, + fseeko and fseeko64. Determine bfd_file_ptr. + * configure: Re-generate. + * config.in: Re-generate. + +2004-02-09 Anil Paranjpe + + * coff-h8300.c: Added comments about relaxation for ldc.w and stc.w. + * elf32-h8300.c: Likewise. + +2004-02-09 Christian Vogel + Nick Clifton + + * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Catch + GOT entries with no associated GOT subsection. + +2004-02-09 Richard Sandiford + + * bfd-elf.h (elf_backend_name_local_section_symbols): New hook. + * elf.c (swap_out_syms): Use it to decide whether local section + symbols should be named. + * elfxx-target.h (elf_backend_name_local_section_symbols): New macro. + * elfxx-mips.h (_bfd_mips_elf_name_local_section_symbols): Declare. + (elf_backend_name_local_section_symbols): Define. + * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): New. + +2004-01-30 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_brl): New function. + (elfNN_ia64_relax_section): Optimize brl to br during the relax + finalize pass. + +2004-01-30 Alexandre Oliva + + * elf32-frv.c (elf32_frv_always_size_sections): Initialize pointer + to bfd_link_hash_entry passed by reference to + _bfd_generic_link_add_one_symbol. + +2004-01-25 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Disallow imm + relocations against dynamic symbols. + +2004-01-23 Daniel Jacobowitz + + * elf32-arm.h (elf32_arm_check_relocs): Revert part of 2004-01-13 + change. + +2004-01-21 Tom Rix + + * reloc.c: New 5 bit reloc, BFD_RELOC_M68HC12_5B, for m68hc12 movb/movw. + * bfd-in2.h, libbfd.h: Rebuilt. + +2004-01-20 Danny Smith + + * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Don't remove + IMAGE_SCN_MEM_WRITE flag from .text section if WP_TEXT + flag has been cleared. + +2004-01-19 Kazu Hirata + + * coff-h8300.c: Add and adjust comments about relaxation. + * elf32-h8300.c: Likewise. + +2004-01-16 Kazu Hirata + + * coff-h8300.c: Fix comment typos. + * elf32-h8300.c: Likewise. + +2004-01-16 Kazu Hirata + + * coff-h8300.c: Add comments about relaxation. + * elf32-h8300.c: Likewise. + +2004-01-14 Maciej W. Rozycki + + * acinclude.m4: Quote names of macros to be defined by AC_DEFUN + throughout. + * aclocal.m4: Regenerate. + * configure: Regenerate. + +2004-01-13 Ian Lance Taylor + + * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Call + mips_elf64_rtype_to_howto instead of using howto_table. + +2004-01-13 Daniel Jacobowitz + + * elf32-arm.h (elf32_arm_final_link_relocate): Check that we created + the .plt section. + (elf32_arm_check_relocs): Don't increment the PLT refcount for + relocs which would not use the PLT. + +2004-01-13 Alan Modra + + * elf64-ppc.c (ppc64_elf_check_relocs): Ignore !SEC_ALLOC relocs. + (ppc64_elf_gc_sweep_hook): Likewise. + (ppc64_elf_size_dynamic_sections): Test for .plt directly. + +2004-01-12 Anil Paranjpe + + Adds linker relaxation support for bit manipulation insns like + band, bclr, biand, bild, bior, bist, bixor, bld, bnot, bor, bset, + bst, btst, bxor. + * elf32-h8300.c: Opcode for bit manipulation insn is checked in + elf32_h8_relax_section function while relxation for aa:16 and aa:32. + * coff-h8300.c: Opcode for bit manipulation insn is checked in + h8300_reloc16_extra_cases function while relxation for aa:16 and aa:32. + +2004-01-12 Alan Modra + + * dwarf2.c: Convert to C90, remove unneeded casts and prototypes. + +2004-01-11 Kazu Hirata + + * elf32-h8300.c: Fix formatting. + +2004-01-11 Kazu Hirata + + * elf32-cris.c (cris_elf_gc_sweep_hook): Return early if no + dynamic object is present. Declare r_symndx and h in an inner + scope. + * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise. + +2004-01-09 Daniel Jacobowitz + + * elf32-arm.h (struct elf32_arm_relocs_copied): Remove pc_count. + (elf32_arm_copy_indirect_symbol): Don't copy pc_count. + (elf32_arm_final_link_relocate): Handle PLT32 and PC24 relocs + identically. Do not emit PC24 relocations for shared libraries. + (elf32_arm_gc_sweep_hook): Handle PLT32 and PC24 relocs + identically. Don't adjust pc_count. + (elf32_arm_check_relocs): Handle PLT32 and PC24 relocs identically. + Set ELF_LINK_HASH_NEEDS_PLT for both. Don't adjust pc_count; don't + adjust count for branch relocations. + (allocate_dynrelocs): Correct typo in call to + WILL_CALL_FINISH_DYNAMIC_SYMBOL. Never allocate space for + PC24 or PLT32 relocs when linking. + +2004-01-09 Dmitry Semyonov + + * coff-arm.c (aoutarm_std_reloc_howto): [ARM_WINCE] Synchronize ARM_26D + relocation howto with ARM_26 one for consistency. + (coff_arm_relocate_section): Set partial_inplace for ARM_26 relocations + that will be converted to ARM_26D ones, since we always want 'done' + relocations to be reflected in section's data. + (coff_arm_relocate_section): [ARM_WINCE] Quick fix for BL instruction + offset. + (_bfd_final_link_relocate): Do not modify "inplace" data, if not + requested. + +2004-01-08 Dmitry Semyonov + + * coff-arm.c (coff_arm_relocate_section): Do not alter relocs that + are not partial_inplace during a relocatable link. + +2004-01-08 Kazu Hirata + + * elf32-m68k.c (elf_m68k_gc_sweep_hook): Return early + if no dynamic object is present. Declare r_symndx and h in an + inner scope. + +2004-01-07 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_section): Don't install + trampoline if it is known out of range. + +2004-01-06 Alexandre Oliva + + 2003-12-17 Alexandre Oliva + * elf32-frv.c (_frv_osec_readonly_p): New. + (_frv_emit_got_relocs_plt_entries): Don't emit rofixup for + undefweak symbol. + (_frv_count_got_plt_entries): Adjust expected count accordingly. + (elf32_frv_relocate_section): Likewise. Error out if attempting + to emit rofixups or dynamic relocs in read-only segments. Use + _bfd_elf_section_offset to adjust r_offsets in rofixups and + dynamic relocations. + 2003-12-12 Alexandre Oliva + * elf32-frv.c (elf32_frv_relocate_section): Compute dynamic + relocations or fixups involving merged sections correctly. Avoid + crash when undefined symbol is referenced by R_FRV_32 or + R_FRV_FUNCDESC_VALUE. + 2003-12-02 Alexandre Oliva + * elf32-frv.c (elf32_frv_relocate_section): Add output_offset of + input section holding local symbol to addend of R_FRV_32 or + R_FRV_FUNCDESC_VALUE dynamic relocation. + 2003-11-27 Alexandre Oliva + * elf32-frv.c (elf32_frv_modify_segment_map): Add link info arg. + (elf32_frv_always_size_sections): Don't store pointer to + __stacksize symbol in sec_info. + (elf32_frv_modify_segment_map): Look it up here. + 2003-11-26 Alexandre Oliva + * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Emit the address + of the lazy PLT entry, not only its offset, as the low word of a + function descriptor. + 2003-11-10 Alexandre Oliva + * elf32-frv.c (elf32_frv_always_size_sections): Define __stacksize + if a hash table entry already exists but is not a definition. + 2003-11-05 Alexandre Oliva + * elf32-frv.c (frv_elf_link_hash_table_create): Use bfd_zalloc. + (_frv_add_rofixup): Don't inline. + (_frv_emit_got_relocs_plt_entries): Use NULL as funcdesc address + for undefweak symbols. + (elf32_frv_relocate_section): Avoid crash while computing + relocation when linking with shared library. Only emit rofixups + and dynamic relocations for alloc&load sections. Mark binaries + with inter-segment relocations for relocation as a unit. + (_frv_create_got_section): Rename .rofixup.got to .rofixup. + (DEFAULT_STACK_SIZE): New. + (_frv_count_got_plt_entries): Fix thinko in deciding whether to + emit rofixups or dynamic relocs when linking dynamic non-PIE + executables. + (elf32_frv_size_dynamic_sections): Generate rofixup on PIEs and + shared libs too. Reserve the last entry for the GOT pointer. + (elf32_frv_finish_dynamic_sections): Emit it. + (elf32_frv_always_size_sections): New. + (elf32_frv_modify_segment_map): New. + (elf32_frv_check_relocs): Reserve relocs32 space only in ALLOC + sections. + (frv_elf_merge_private_bfd_data): Clear PIC bit if FDPIC is set. + (frv_elf_print_private_bfd_data): Handle FDPIC and LIBPIC. + (elf_backend_always_size_sections): New. + (elf_backend_modify_segment_map): New. + 2003-10-31 Alexandre Oliva + * config.bfd: Added frv-*-*linux*. + * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Use idx 0 for + ABS section, instead of crashing. + (elf32_frv_relocate_section): Don't crash before warning about + different segments in non-PIC relocation. + 2003-10-17 Alexandre Oliva + * elf32-frv.c (elf32_frv_relocate_section): Don't warn on LABEL24 + relocs to undefweak symbols. + (elf32_frv_relocate_section): Ditto for undefined symbols. + 2003-10-06 Alexandre Oliva + * elf32-frv.c (elf32_frv_create_dynamic_sections): Make sure + gotfixup section was created. + 2003-09-30 Alexandre Oliva + * elf32-frv.c (elf32_frv_howto_table): Change GOT12, + FUNCDESC_GOT12, GOTOFF12 and FUNCDESC_GOTOFF12 to + complain_overflow_signed. + * elf32-frv.c (_frv_add_rofixup): Do not error out if contents + have not been allocated. + (_frv_emit_got_relocs_plt_entries): Return non-void. Assert + privfd only if dynamic sections were created. + (elf32_frv_relocate_section): Compute gprel_segment, and use it + for GPREL relocs. When linking relocatable FDPIC executables, + emit warnings for relocations that would be illegal on PIE or + shared libraries. Emit rofixup for R_FRV_32 only if input object + is not FDPIC. + (_frv_create_got_section): Define _gp symbol in the rofixup + section. + (elf32_frv_finish_dynamic_sections): If rofixups needed but + dynamic sections missing, error out requesting -melf32frvfd. + 2003-09-19 Alexandre Oliva + * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Rearrange + computation of addends from section and global or local symbol + value. Change return type to bfd_boolean, and return a failure if + a dynamic FUNCDESC or FUNCDESC_VALUE relocation that requires a + nonzero addend is required. + (elf32_frv_relocate_section): Likewise. Print error for + unsupported nonzero addends. + 2003-09-18 Alexandre Oliva + * elf32-frv.c (FRV_SYM_LOCAL): In the absence of dynamic sections, + force everything local. + (_frv_emit_got_relocs_plt_entries): Cope with NULL sec. + * elf32-frv.c (struct frv_elf_link_hash_table): Added sgotfixup. + (frv_gotfixup_section): New. + (FRV_SYM_LOCAL): Accept undefweak and local common symbols. + (struct frv_pic_relocs_info): Split relocs into relocs32, relocsfd + and relocsfdv. + (_frv_add_rofixup): New. + (_frv_emit_got_relocs_plt_entries): Generate fixups for non-PIE + fdpic executables. Use FRV_SYM_LOCAL more widely to simplify and + improve some ugly conditions. + (elf32_frv_relocate_section): Likewise. Reject inter-segment + relocations in fdpic. + (_frv_create_got_section): Create .rofixup.got section. + (struct _frv_dynamic_got_info): Added fixups. + (_frv_count_got_plt_entries): Account in-GOT relocations into + relocs32, relocsfd and relocsfdv. Account them into relocs or + fixups, as appropriate. + (elf32_frv_size_dynamic_sections): Size rofixup section. Simplify + sizing of gotrel. + (elf32_frv_finish_dynamic_sections): Verify that the right number + of relocations and fixups was generated. + (elf32_frv_check_relocs): Compute relocs32, relocsfd and + relocsfdv. + * elf32-frv.c (FRV_SYM_LOCAL): New macro, used instead of + SYMBOL_CALLS_LOCAL and SYMBOL_REFERENCES_LOCAL. + (FRV_FUNCDESC_LOCAL): New macro, used to decide whether a function + descriptor of a (formerly-)global symbol is local. + (struct frv_pic_relocs_info): Adjust comments. + (_frv_emit_got_relocs_plt_entries): Adjust. + (elf32_frv_relocate_section): Likewise. + (_frv_count_got_plt_entries): Likewise. + * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Don't add global + symbol's value to addend in the common preamble. Decay dynamic + symbols to section+offset if they bind or call locally, for GOT + and FUNCDESC_VALUE, respectively. + (elf32_frv_relocate_section): Likewise. + (elf32_frv_check_relocs): Don't register as dynamic symbols of + internal or hidden visibility. + 2003-09-17 Alexandre Oliva + * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Get addend as + argument, so as to not call _bfd_elf_rel_local_sym to compute it. + (elf32_frv_relocate_section): Pass relocation addend in. Use + original relocation addend to look up the got relocs/plt entries + table. Do not call _bfd_elf_rel_local_sym. Don't error out when + processing relocations that reference .scommon symbols. + 2003-09-15 Alexandre Oliva + Introduce support for dynamic linking. + * elf32-frv.c (R_FRV_FUNCDESC_VALUE): Mark it as 64 bits. + (elf32_frv_rel_32_howto, elf32_frv_rel_funcdesc_howto, + elf32_frv_rel_funcdesc_value_howto): New REL descriptors. + (frv_reloc_type_lookup): Return REL howtos for executables and + dynamic libraries. + (frv_info_to_howto_rel): New. + (struct frv_elf_link_hash_table): New. + (frv_hash_table, frv_got_section, frv_gotrel_section, + frv_plt_section, frv_pltrel_section, frv_relocs_info, + frv_got_initial_offset, frv_plt_initial_offset): New macros. + (frv_elf_link_hash_table_create): New. + (struct frv_pic_relocs_info): New. + (frv_pic_relocs_info_hash, frv_pic_relocs_info_eq): New. + (frv_pic_relocs_info_find): New. + (frv_pic_relocs_info_for_global, frv_pic_relocs_info_for_local): + New. + (FRV_LZPLT_BLOCK_SIZE, FRV_LZPLT_RESOLVE_LOC): New. + (_frv_add_dyn_reloc, _frv_osec_to_segment): New. + (_frv_emit_got_relocs_plt_entries): New. + (elf32_frv_relocate_section): Add support for dynamic linking. + Handle new relocations. + (_frv_create_got_section): New. + (elf32_frv_create_dynamic_sections): New. + (ELF_DYNAMIC_INTERPRETER): New. + (struct _frv_dynamic_got_info): New. + (_frv_count_got_plt_entries): New. + (struct _frv_dynamic_got_plt_info): New. + (_frv_compute_got_alloc_data): New. + (_frv_get_got_entry, _frv_get_fd_entry): New. + (_frv_assign_got_entries, _frv_assign_plt_entries): New. + (_frv_resolve_final_relocs_info): New. + (elf32_frv_size_dynamic_sections): New. + (elf32_frv_finish_dynamic_sections): New. + (elf32_frv_adjust_dynamic_symbol): New. + (elf32_frv_finish_dynamic_symbol): New. + (elf32_frv_check_relocs): Handle new relocs. Explain how the + whole thing works. + (elf_info_to_howto_rel): Define. + (bfd_elf32_bfd_link_hash_table_create): Define. + (elf_backend_create_dynamic_sections): Define. + (elf_backend_adjust_dynamic_symbol): Define. + (elf_backend_size_dynamic_sections): Define. + (elf_backend_finish_dynamic_symbol): Define. + (elf_backend_finish_dynamic_sections): Define. + (elf_backend_want_got_sym): Define. + (elf_backend_got_header_size): Define. + (elf_backend_want_got_plt): Define. + (elf_backend_plt_readonly): Define. + (elf_backend_want_plt_sym): Define. + (elf_backend_plt_header_size): Define. + (elf_backend_may_use_rel_p): Define. + (elf_backend_may_use_rela_p): Define. + (elf_backend_default_use_rela_p): Define. + 2003-08-08 Alexandre Oliva + * elf32-frv.c (R_FRV_FUNCDESC_VALUE, R_FRV_FUNCDESC_GOTOFF12, + R_FRV_FUNCDESC_GOTOFFHI, R_FRV_FUNCDESC_GOTOFFLO, R_FRV_GOTOFF12, + R_FRV_GOTOFFHI, R_FRV_GOTOFFLO): New. + (frv_reloc_map): Map the corresponding BFD relocs to them. + (frv_reloc_type_lookup): ... and back to BFD relocs. + * reloc.c: New relocs. + * bfd-in2.h, libbfd.h: Rebuilt. + 2003-08-04 Alexandre Oliva + * elf32-frv.c (R_FRV_GOT12, R_FRV_GOTHI, R_FRV_GOTLO, + R_FRV_FUNCDESC, R_FRV_FUNCDESC_GOT12, R_FRV_FUNCDESC_GOTHI, + R_FRV_FUNCDESC_GOTLO): New. + (frv_reloc_map): Map the corresponding BFD relocs to them. + (frv_reloc_type_lookup): ... and back to BFD relocs. + * reloc.c: New relocs. + * bfd-in2.h, libbfd.h: Rebuilt. + +2004-01-05 Maciej W. Rozycki + + * elf32-mips.c (ELF_MAXPAGESIZE): Redefine for traditional + targets to support pages of up to 64kB. + (elf32_bed): Redefine to get a separate backend data structure for + traditional targets. + * elf64-mips.c (ELF_MAXPAGESIZE): Redefine for traditional + targets to support pages of up to 64kB. + (elf64_bed): Redefine to get a separate backend data structure for + traditional targets. + * elfn32-mips.c (ELF_MAXPAGESIZE): Redefine for traditional + targets to support pages of up to 64kB. + (elf32_bed): Redefine to get a separate backend data structure for + traditional targets. + +2004-01-04 Mark Kettenis + + * elf32-sparc.c (elf32_sparc_grok_psinfo): New function. + +2004-01-02 Mark Kettenis + + * elf32-i386.c (elf_i386_grok_prstatus): Add support for FreeBSD. + (elf_i386_grok_psinfo): Likewise. + +2004-01-02 Bernardo Innocenti + + * config.bfd: Add m68k-uClinux target. + +2004-01-01 Grant Edwards + + * elflink.h (elf_gc_sections): Warn when gc-sections option is ignored. + * elf32-h8300.c (elf32_h8_gc_mark_hook): New function. + (elf32_h8_gc_sweep_hook): New function. + (elf_backend_gc_mark_hook): Define. + (elf_backend_gc_sweep_hook): Define. + (elf_backend_can_gc_sections): Define. + +For older changes see ChangeLog-0203 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-2005 sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-2005 --- sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-2005 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-2005 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,5269 @@ +2005-12-31 Valeriy E. Ushakov + Kaz Kojima + + * elf32-sh.c (sh_elf_relocate_section): Don't reset relocation + for R_SH_REL32 in shared objects if the symbol is locally called. + +2005-12-31 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Adjust relocs against + opd section sym when opd has been edited. Use correct addend + when determining branch 'y' bit and branch overflow. Adjust and + save opd relocs for ld -r too. + +2005-12-30 Eric Christopher + + * elfxx-mips.c (mips_elf_record_global_got_symbol): Add assert + to verify we have a got. + (_bfd_mips_elf_check_relocs): Add R_MIPS_TLS_GOTTPREL to relocs + needing a GOT. + +2005-12-30 John David Anglin + + * configure.host (hppa*64*-*-hpux*): Set host64 to true. + +2005-12-29 Nick Clifton + + * hash.c (bfd_hash_set_default_size): Add more entries to the + hash_size_primes table. + + * stabs.c (_bfd_link_section_stabs): Use bfd_hash_table_init + rather than bfd_hash_table_init_n(...,251) so that the size of the + hash table can be controlled by the user. + +2005-12-27 John David Anglin + + * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Use info->executable + instead of !info->shared. + +2005-12-27 Jan-Benedict Glaw + + * vaxlinux.h: New file. (TRAD_CORE_EXTRA_SIZE_ALLOWED): Define. + (HOST_MACHINE_ARCH): Define. This allows cross-building vax-linux + hosted binutils. + +2005-12-27 Nathan Sidwell + + * elf32-mt.c (mt_elf_merge_private_bfd_data): Do not allow mixing + object files from different mt variants. + +2005-12-27 Leif Ekblad + + * config.bfd: Add support for RDOS targets. + +2005-12-27 Marty Leisner + + * dwarf2.c (lookup_symbol_in_function_table): Check for a function + name before passing it to strcmp. + +2005-12-27 Alan Modra + + * elf.c (elf_find_function): Don't ignore section syms. + Simplify filename logic. + +2005-12-27 Alan Modra + + * elf32-ppc.c (add_stub_sym): Pass info rather than htab. + Use different names for pic vs non-pic, '.' instead of '_'. + (allocate_dynrelocs): Adjust add_stub_sym call. + +2005-12-27 Alan Modra + + * elf.c (bfd_section_from_shdr): Treat invalid reloc sections as + normal sections rather than returning false. + +2005-12-27 Alan Modra + + * coff-h8300.c (h8300_reloc16_extra_cases): Use input section + "output_offset" instead of link order "offset". + * coff-h8500.c (extra_case): Likewise. + * coff-w65.c (w65_reloc16_extra_cases): Likewise. + * coff-z80.c (extra_case): Likewise. + * coff-z8k.c (extra_case): Likewise. + * linker.c (default_indirect_link_order): Likewise, "size" too. + * ecoff.c (ecoff_indirect_link_order): Likewise. + +2005-12-27 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2005-12-24 Alan Modra + + * aix5ppc-core.c: Remove duplicate prototypes. + (xcoff64_core_file_matches_executable_p): Provide implementation + for !AIX_5_CORE. + * corefile.c (generic_core_file_matches_executable_p): Correct + syntax error in prototype. + * libbfd-in.h (generic_core_file_matches_executable_p): Delete. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2005-12-23 Michael Weiser + + PR 1150 + * elf-bfd.h (struct elf_backend_data): New field + 'elf_backend_ignore_undef_symbol'. + * elfxx-target.h (elf_backend_ignore_undef_symbol): Define to NULL + if not already defined. + (elfNN_bed): Initialise the elf_backend_ignore_undef_symbol field. + * elfxx-mips.c (_bfd_mips_elf_ignore_undef_symbol): New function. + * elfxx-mips.h (elf_backend_ignore_undef_symbol): Define and + prototype. + * elflink.c (elf_link_output_extsym): Check + elf_backend_ignore_undef_symbol before reporting an undefined + symbol in a shared library. + +2005-12-23 Joel Brobecker + + * corefile.c (generic_core_file_matches_executable_p): New function. + * libbfd-in.h (generic_core_file_matches_executable_p): Add + declaration. + * libbfd.h: Regenerate. + * hpux-core.c: ANSIfy function declarations and prototypes. + (thread_section_p): Manually expand bfd_section_name macro + to make it clear that parameter ABFD is not used. + (hpux_core_core_file_matches_executable_p): Delete, replaced + by macro pointing to generic_core_file_matches_executable_p. + + * aix386-core.c: Replace core_file_matches_executable_p null + implementation by generic_core_file_matches_executable_p by + using a macro. + * aix5ppc-core.c: Likewise. + * cisco-core.c: Likewise. + * hppabsd-core.c: Likewise. + * irix-core.c: Likewise. + * lynx-core.c: Likewise. + * mach-o.c: Likewise. + * netbsd-core.c: Likewise. + * osf-core.c: Likewise. + * ptrace-core.c: Likewise. + * sco5-core.c: Likewise. + * trad-core.c: Likewise. + +2005-12-19 David Heine + + * elf32-xtensa.c (action_list_count, xlate_map_entry, xlate_map, + xlate_offset_with_removed_text, build_xlate_map, free_xlate_map): New. + (check_section_ebb_pcrels_fit): Build new xlate_map, use it and free it + when finished. + +2005-12-16 Nathan Sidwell + + Second part of ms1 to mt renaming. + * archures.c (bfd_arch_mt): Renamed. + (bfd_mt_arch): Renamed. + (bfd_archures_list): Adjusted. + * bfd-in2.h: Rebuilt. + * config.bfd (mt): Remove special case targ_archs. + (mt-*-elf): Rename bfd_elf32_mt_vec. + * configure: Rebuilt. + * configure.in (bfd_elf32_mt_vec): Renamed. + (selarchs) Remove mt special case. + * cpu-mt.c (arch_info_struct): Adjust. + (bfd_mt_arch): Renamed, adjust. + * elf32-mt.c (mt_reloc_type_lookup, mt_info_to_howto_rela, + mt_elf_relocate_hi16, mt_final_link_relocate, mt_relocate_section, + mt_elf_howto_table): Renamed, adjusted. + (mt_elf_gc_mark_hook, mt_elf_gc_sweep_hook, mt_elf_check_relocs, + elf32_mt_machine, mt_elf_object_p, mt_elf_set_private_flags, + mt_elf_copy_private_bfd_data, mt_elf_merge_private_bfd_data, + mt_elf_print_private_bfd_data): Renamed, adjusted. + (TARGET_BIG_SYM, TARGET_BIG_NAME, ELF_ARCH, ELF_MACHINE_CODE, + ELF_MAXPAGESIZE, elf_info_to_howto, elf_backend_relocate_section, + bfd_elf32_bfd_reloc_type_lookup, elf_backend_gc_mark_hook, + elf_backend_gc_sweep_hook, elf_backend_check_relocs, + eld_backend_object_p, bfd_elf32_bfd_set_private_flags, + bfd_elf32_bfd_copy_private_bfd_data, + bfd_elf32_bfd_merge_private_bfd_data, + bfd_elf32_bfd_print_private_bfd_data): Adjusted. + * libbfd.h: Regenerated. + * reloc.c (BFD_RELOC_MT_PC16, BFD_RELOC_MT_HI16, + BFD_RELOC_MT_LO16, BFD_RELOC_MT_GNU_VTINHERIT, + BFD_RELOC_MT_GNU_VTENTRY, BFD_RELOC_MT_PCINSN8): Renamed. + * targets.c (bfd_elf32_mt_vec): Renamed. + (_bfd_target_vector): Adjusted. + +2005-12-13 H.J. Lu + + PR ld/2008 + * elf.c (_bfd_elf_setup_sections): Return FALSE if + elf_linked_to_section will be set to NULL. + + * format.c (bfd_check_format_matches): Don't check the default + target twice. + +2005-12-13 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Force tail calls in + shared libs to resolve locally. + +2005-12-12 Paul Brook + + * bfd-in2.h: Regenerate. + * elf32-arm.c (elf32_arm_reloc_map): Add BFD_RELOC_ARM_PCREL_CALL and + BFD_RELOC_ARM_PCREL_JUMP. + (check_use_blx): New function. + (bfd_elf32_arm_process_before_allocation): Don't allocate glue if + using BLX. + (elf32_arm_final_link_relocate): Perform bl<->blx conversion for + R_ARM_CALL and R_ARM_THM. + (elf32_arm_get_eabi_attr_int): New function. + (elf32_arm_size_dynamic_sections): Call check_use_blx. + * libbfd.h: Regenerate. + * reloc.c: Add BFD_RELOC_ARM_PCREL_CALL and BFD_RELOC_ARM_PCREL_JUMP. + +2005-12-12 Nathan Sidwell + + * Makefile.am (ALL_MACHINES, ALL_MACHINES_CFILES, + BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Replace ms1 with mt. + (cpu_mt.lo, elf32-mt.lo): Update target and dependency names. + * Makefile.in: Rebuilt. + * config.bfd: Replace ms1 arch with mt. + * configure.in: Replace ms1 files with mt files. + * configure: Rebuilt. + * elf32-mt.c: Renamed from elf32-ms1.c. Update include files. + * cpu-mt.c: Renamed from cpu-ms1.c. + +2005-12-12 Alan Modra + + * elf64-ppc.c (ppc64_elf_size_stubs): Don't consider non-ppc64 input. + +2005-12-10 Alan Modra + + * elflink.c (elf_gc_mark_dynamic_ref_symbol): Use !info-executable + to test for linking shared libs, not info->shared. + +2005-12-08 Alan Modra + + * elf32-ppc.c (struct ppc_elf_link_hash_table): Add emit_stub_syms. + (ppc_elf_select_plt_layout): Add emit_stub_syms param, save to htab. + (add_stub_sym): New function. + (allocate_dynrelocs): Call add_stub_sym. + (ppc_elf_size_dynamic_sections): Emit __glink and __glink_PLTresolve + when emit_stub_syms. + * elf32-ppc.h (ppc_elf_select_plt_layout): Update prototype. + +2005-12-08 Alan Modra + + * reloc.c (enum complain_overflow): Correct comments. + (bfd_check_overflow): Combine complain_overflow_bitfield and + complain_overflow_signed code. + (_bfd_relocate_contents): Likewise. + (bfd_howto_32): Use complain_overflow_dont. + * elf32-d10v.c (elf_d10v_howto_table): Revert 2002-06-17 change. + * bfd-in2.h: Regenerate. + +2005-12-07 H.J. Lu + + * elf.c (assign_section_numbers): Remove extra code in the last + change. + +2005-12-07 H.J. Lu + Andreas Schwab + + PR binutils/1991 + * elf.c (assign_section_numbers): Always use the output section + when setting up sh_link for SHF_LINK_ORDER. + +2005-12-07 Thiemo Seufer + H.J. Lu + + PR ld/1932 + * bfd-in.h (bfd_elf_record_link_assignment): Add output_bfd + and hidden arguments. + + * bfd.c (bfd_hide_symbol): Removed. + + * bfd-in2.h: Regenerated. + + * elflink.c (bfd_elf_record_link_assignment): Handle hidden + symbols which were provided by a linker script. + +2005-12-06 Paul Gilliam + + * cpu-powerpc.c (bfd_powerpc_archs): Add ppc 750. + +2005-11-18 Mark Kettenis + + * elf64-hppa.c (elf64_hppa_section_from_phdr): Create .kernel + pseudo-section. Make sure .reg section comes after the proc + section it's generated from. + +2005-12-01 Kazuhiro Inaoka + + * elf32-m32r.c (m32r_elf_sweep_hook): Fix an illegal duplicate check. + (m32r_elf_relocate_section): Fix R_M32R_10_PCREL_RELA linkage bug. + (m32r_elf_gc_sweep_hook): Likewise. + (m32r_elf_check_relocs): Likewise. + +2005-11-24 Alan Modra + + * elf-bfd.h (_bfd_generic_match_sections_by_type): Don't define. + * libbfd-in.h (_bfd_generic_match_sections_by_type): Delete. + * libbfd.c (_bfd_generic_match_sections_by_type): Delete. + * targets.c (bfd_match_sections_by_type): Don't define. + (BFD_JUMP_TABLE_LINK): Remove _bfd_generic_match_sections_by_type. + * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise. + * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2005-11-23 Daniel Jacobowitz + Thiemo Seufer + + * elf32-mips.c (elf_mips_howto_table_rel): Use rightshift 2 for + R_MIPS_PC16. + (mips_reloc_map): Map BFD_RELOC_16_PCREL_S2 to R_MIPS_PC16. + (bfd_elf32_bfd_reloc_type_lookup): Don't handle + BFD_RELOC_16_PCREL_S2. + * elf64-mips.c (mips_elf64_howto_table_rel): Use rightshift 2 for + R_MIPS_PC16. + (mips_elf64_howto_table_rela): Likewise. + (mips_reloc_map): Map BFD_RELOC_16_PCREL_S2 to R_MIPS_PC16. + (bfd_elf64_bfd_reloc_type_lookup): Don't handle + BFD_RELOC_16_PCREL_S2. + * elfn32-mips.c (elf_mips_howto_table_rel): Use rightshift 2 for + R_MIPS_PC16. + (elf_mips_howto_table_rela): Likewise. + (mips_reloc_map): Map BFD_RELOC_16_PCREL_S2 to R_MIPS_PC16. + (bfd_elf32_bfd_reloc_type_lookup): Don't handle + BFD_RELOC_16_PCREL_S2. + * elfxx-mips.c: Formatting fixes. + (mips_elf_calculate_relocation): Handle R_MIPS_GNU_REL16_S2 + and R_MIPS_PC16 identically. + +2005-11-23 Frederic Riss + + * elfcode.h (elf_object_p): Delay the setting of start_address + until we're sure the backend matches the binary. + +2005-11-20 John David Anglin + + * som.c (som_decode_symclass): Decode BSF_WEAK symbols in the same + manner as bfd_decode_symclass. + +2005-11-18 Alan Modra + + * elf64-ppc.c (ppc64_elf_check_relocs): Don't set has_14bit_branch + on branches to same section. + +2005-11-17 Randolph Chung + + * elf64-hppa.c (elf64_hppa_object_p): Recognize corefiles under + hppa64-hp-hpux11.11. + (elf64_hppa_section_from_phdr): New function. + (elf_backend_section_from_phdr): Define. + +2005-11-11 Nick Clifton + + PR 1150 + * elfxx-mips.c (mips_elf_calculate_relocation): Ignore an + undefined symbol if it is optional. + (_bfd_mips_elf_merge_symbol_attribute): Make sure that the + optional flag is merged as well as the visibility. + * elfxx-mips.h (_bfd_mips_elf_merge_symbol_attribute): Prototype. + (elf_backend_merge_symbol_attribute): Define. + +2005-11-08 Nathan Sidwell + + Add ms2 support + * archures.c (bfd_mach_ms2): Define. + * cpu-ms1.c (arch_info_struct): Add ms2 stanza. + * elf32-ms1.c (elf32_ms1_machine): Add ms2 case. + (ms1_elf_merge_private_bfd_data): Remove unused variables. Add + correct merging logic, with workaround. + (ms1_elf_print_private_bfd_data): Add ms2 case. + * reloc.c (BFD_RELOC_MS1_PCINSN8): Add ms2 specific reloc. + * libbfd.h: Regenerated. + * bfd-in2.h: Regenerated. + +2005-11-07 Steve Ellcey + + * warning.m4 (AM_BINUTILS_WARNINGS): Default to empty string + if compiler is not GCC. + * configure: Regenerate + +2005-11-07 Steve Ellcey + + * configure: Regenerate after modifying bfd/warning.m4. + +2005-11-07 Steve Ellcey + + * configure.host (ia64-*-hpux*): Set _LARGEFILE64_SOURCE. + +2005-11-03 Daniel Jacobowitz + + * configure.in: Check for fopen64. + * libbfd-in.h (real_fopen): New prototype. + * configure, config.in, libbfd.h: Regenerated. + * bfdio.c (real_fopen): New function. + * opncls.c (bfd_fopen, bfd_fill_in_gnu_debuglink_section): Use it. + * cache.c (bfd_open_file): Likewise. + +2005-11-03 Thiemo Seufer + + * elfxx-mips.c (mips_elf_calculate_relocation): Handle only + forced local symbols here. + (mips_elf_create_dynamic_relocation): Likewise. + (_bfd_mips_elf_finish_dynamic_symbol): Fix typo in comment. + +2005-11-03 Alan Modra + + * elf.c (elf_fake_sections): When calculating tbss size, just use + the last link_order. + (assign_file_positions_for_segments): Likewise. + * elflink.c (bfd_elf_final_link): Likewise. + (elf_reloc_link_order): Correct comment. + +2005-11-02 Alan Modra + + PR ld/1775 + * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Add required + parentheses. + +2005-10-29 H.J. Lu + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerated. + + * dep-in.sed: Replace " ./" with " ". + +2005-10-29 H.J. Lu + + * hpux-core.c: Include only if HPUX_CORE is + define. + * osf-core.c: Include only if OSF_CORE is defined. + * sco5-core.c: Include and only + if SCO5_CORE is defined. + +2005-10-29 Mark Kettenis + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2005-10-28 Joel Brobecker + + From Eric Botcazou + * coffcode.h (coff_compute_section_file_positions): Fix small + error in preprocessor directives. + +2005-10-28 Joel Brobecker + + Mostly from Eric Botcazou + * rs6000-core.c: ANSIfy all function definitions. + Add missing function prototypes. + (ptr_to_uint): New type. + (rs6000coff_core_p): Use it as intermediate step in casts. + (rs6000coff_core_file_matches_executable_p): Likewise. + * xcoff-target.h (rs6000coff_core_p): Fix prototype. + (rs6000coff_core_file_matches_executable_p): Likewise. + +2005-10-28 H.J. Lu + + PR binutils/1472 + * aoutx.h (NAME (aout, machine_type)): Handle + bfd_mach_sparc_v8plus, bfd_mach_sparc_v8plusa, + bfd_mach_sparc_v8plusb, bfd_mach_sparc_v9, bfd_mach_sparc_v9a + and bfd_mach_sparc_v9b. + +2005-10-28 Hans-Peter Nilsson + + PR ld/1567 + * elf32-cris.c (cris_elf_howto_table) : Set + complain_on_overflow field to complain_overflow_dont. + +2005-10-27 Alan Modra + + PR 973 + * cache.c (enum cache_flag): New. + (close_one): Save file mtime. + (bfd_cache_lookup): Add flag arg, adjust all users. + (bfd_cache_lookup_worker): Likewise. + (cache_btell): Use CACHE_NO_OPEN and return abfd->where if file + not open. + (cache_bflush): Similarly, and return success of file not open. + (cache_bseek): Use CACHE_NO_SEEK if SEEK_SET or SEEK_END. + (cache_bstat): Use CACHE_NO_SEEK_ERROR. + + * bfdwin.c (bfd_get_file_window): Seek into file in place of + using bfd_cache_lookup. + + * cache.c (BFD_CACHE_MAX_OPEN): Make private to this file. + (bfd_last_cache, bfd_cache_lookup, bfd_cache_lookup_worker): Likewise. + * libbfd-in.h (bfd_cache_lookup_worker, bfd_last_cache): Delete. + * libbfd.h: Regenerate. + + * hppabsd-core.c (hppabsd_core_core_file_p): Use bfd_stat, not fstat. + * sco5-core.c (sco5_core_file_p): Likewise. + * trad-core.c (trad_unix_core_file_p): Likewise. + + * cache.c: Reorganize file to avoid forward reference. + +2005-10-26 Alan Modra + + * cache.c (bfd_cache_lookup_worker): Don't abort on failing to + reopen file. + (cache_btell, cache_bseek, cache_bflush, cache_bstat): Return -1 on + bfd_cache_lookup failure. + (cache_bread, cache_bwrite): Return 0 on the same. + * bfdwin.c (bfd_get_file_window): Likewise. + * hppabsd-core.c (hppabsd_core_core_file_p): Likewise. + * sco5-core.c (sco5_core_file_p): Likewise. + * trad-core.c (trad_unix_core_file_p): Likewise. + +2005-10-26 Alan Modra + + * cache.c (bfd_cache_lookup_worker): Use bfd_error_handler + rather than bfd_perror. Print file name. Internationalise. + +2005-10-26 Alan Modra + + * cache.c (bfd_open_file): Set bfd_error_system_call on failure + to open file. + (bfd_cache_lookup_worker): Remove check that file pos is in + unsigned long range. Print system error before aborting. + +2005-10-25 Arnold Metselaar + + * Makefile.am: Add rules for coff-z80 and cpu-z80. + * Makefile.in: Regenerated. + * archures.c: Add bfd_arch_z80 and support for it. + * coffcode.h(coff_set_arch_mach_hook): Add case Z80MAGIC. + (coff_set_flags): Add case bfd_arch_z80. + * config.bfd: Add z80coff_vec. + * configure.in: Add z80coff_vec. + * reloc.c: Add BFD_RELOC_Z80_DISP8 + * targets.c: Add z80coff_vec. + * coff-z80.c: New file + * cpu-z80.c: New file + * configure: Regenerated. + * libbfd.h: Regenerated. + * bfd-in2.h: Regenerated. + +2005-10-26 Alan Modra + + PR ld/1540 + * elf-bfd.h (elf_backend_copy_indirect_symbol): Replace pointer to + elf_backend_data with pointer to bfd_link_info. + (_bfd_elf_link_hash_copy_indirect): Likewise. + * elf.c (_bfd_elf_link_hash_copy_indirect): Likewise. Handle + direct and indirect symbols both having dynamic link info. + * elf32-arm.c (elf32_arm_copy_indirect_symbol): Likewise. + * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise. + * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. + * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Likewise. + * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Likewise. + * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise. + * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. + * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise. + * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise. + * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise. + * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise. + * elflink.c: Adjust all calls to bed->elf_backend_copy_indirect_symbol. + * elfxx-mips.h (_bfd_mips_elf_copy_indirect_symbol): Update prototype. + * elfxx-sparc.h (_bfd_sparc_elf_copy_indirect_symbol): Likewise. + +2005-10-25 Alan Modra + + * po/SRC-POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. + +2005-10-24 Jie Zhang + + * elf32-bfin.c (bfd_bfin_elf32_create_embedded_relocs): Fix signedness + warning. + +2005-10-24 Bernd Schmidt + + * elf32-bfin.c (bfin_howto_table): Set src_mask to 0 for all relocs. + (bfin_imm16_reloc): Always add in the addend. Don't fetch existing + contents from section. + (bfin_relocate_section): Rework so as to not call special_functions. + Handle the relocation stack here. Treat pcrel24 relocs specially. + +2005-10-24 Alan Modra + + * elflink.c (elf_link_input_bfd): Don't use linker_mark and + SEC_EXCLUDE to test for sections dropped from output. Instead, + use bfd_section_removed_from_list on normal sections. Don't + attempt to handle symbols with unknown reserved section indices. + * linker.c (_bfd_generic_link_output_symbols): Don't use + linker_mark to test for symbols belonging to dropped sections. + Do allow absolute symbols. + +2005-10-24 Alan Modra + + * elf32-i370.c (i370_elf_fake_sections): Don't set SHF_EXCLUDE on + group sections. + +2005-10-24 Jan Beulich + + * cpu-ia64-opc.c (elf64_ia64_operands): Move memory operand out of + set of indirect operands. + +2005-10-24 Alan Modra + + * elf32-ppc.c (ppc_elf_fake_sections): Don't set SHF_EXCLUDE on + group sections. + +2005-10-23 H.J. Lu + + * coff-rs6000.c (rs6000coff_vec): Initialize + _bfd_init_private_section_data with + _bfd_generic_init_private_section_data. + (pmac_xcoff_vec): Likewise. + * coff64-rs6000.c (rs6000coff64_vec): Likewise. + (aix5coff64_vec): Likewise. + +2005-10-23 H.J. Lu + + PR ld/1487 + * elf-bfd.h (_bfd_generic_init_private_section_data): New. + (_bfd_elf_init_private_section_data): New. + + * elf.c (elf_fake_sections): Don't set SHF_GROUP for + relocatable link. + (bfd_elf_set_group_contents): Don't handle relocatable link + specially. + (assign_section_numbers): If it isn't called by assembler, + use the output section of elf_linked_to_section for + SHF_LINK_ORDER. + (_bfd_elf_init_private_section_data): New. + (_bfd_elf_copy_private_section_data): Call it. + + * libbfd-in.h (_bfd_generic_init_private_section_data): New. + + * libbfd.c (_bfd_generic_init_private_section_data): New. + + * targets.c (BFD_JUMP_TABLE_COPY): Add + _bfd_generic_init_private_section_data. + (bfd_init_private_section_data): Likewise. + + * bfd-in2.h: Regenerated. + * libbfd.h: Likewise. + +2005-10-23 Alan Modra + + * elf64-ppc.c (dec_dynrel_count): Don't report errors for local + syms in gc'd sections. + (ppc64_elf_edit_opd): Don't adjust reloc counts when NO_OPD_RELOCS. + (elf_backend_action_discarded): Define. + (ppc64_elf_action_discarded): New function. + +2005-10-19 Paul Brook + + * elf32-arm.c (find_arm_elf_section_entry): New function. + (get_arm_elf_section_data): Use it. + (unrecord_section_with_arm_elf_section_data): Use it. + +2005-10-15 H.J. Lu + + * coff-rs6000.c (rs6000coff_vec): Initialize + _bfd_match_sections_by_type with + _bfd_generic_match_sections_by_type. + (pmac_xcoff_vec): Likewise. + * coff64-rs6000.c (rs6000coff64_vec): Likewise. + (aix5coff64_vec): Likewise. + +2005-10-15 H.J. Lu + + PR ld/1467 + * elf-bfd.h (_bfd_elf_match_sections_by_type): New. + (_bfd_generic_match_sections_by_type): New. Defined. + + * elf.c (_bfd_elf_match_sections_by_type): New. + + * libbfd-in.h (_bfd_generic_match_sections_by_type): New. + + * bfd-in2.h: Regenerated. + * libbfd.h: Likewise. + + * libbfd.c (_bfd_generic_match_sections_by_type): New. + + * targets.c (BFD_JUMP_TABLE_LINK): Initialize + _bfd_match_sections_by_type with + _bfd_generic_match_sections_by_type. + (bfd_target): Add _bfd_match_sections_by_type. + +2005-10-08 Paul Brook + + * elf32-arm.c: Move #include "elf/arm.h" after libbfd.h. + (NUM_KNOWN_ATTRIBUTES): Define. + (aeabi_attribute, aeabi_attribute_list): Define. + (elf32_arm_obj_tdata): Add known_eabi_attributes and + other_eabi_attributes. + (uleb128_size, is_default_attr, eabi_attr_size, + elf32_arm_eabi_attr_size, write_uleb128, write_eabi_attribute, + elf32_arm_set_eabi_attr_contents, elf32_arm_bfd_final_link, + elf32_arm_new_eabi_attr, attr_strdup, elf32_arm_add_eabi_attr_int, + elf32_arm_add_eabi_attr_compat, copy_eabi_attributes, + elf32_arm_merge_eabi_attributes): New functions. + (elf32_arm_copy_private_bfd_data): Copy EABI object attributes. + (elf32_arm_fake_sections): Handle .ARM.attributes. + (elf32_arm_parse_attributes): New function. + (elf32_arm_section_from_shdr): Use it. + (bfd_elf32_bfd_final_link): Define. + +2005-10-06 Daniel Jacobowitz + + * elf32-arm.c (elf32_arm_check_relocs): Avoid aliasing warnings from + GCC. + (elf32_arm_size_dynamic_sections): Likewise. + * ecofflink.c (bfd_ecoff_debug_one_external): Likewise. + * elf32-hppa.c (elf32_hppa_check_relocs): Likewise. + * elf32-m32r.c (m32r_elf_check_relocs): Likewise. + * elf32-m68k.c (elf_m68k_check_relocs): Likewise. + * elf32-ppc.c (ppc_elf_check_relocs): Likewise. + * elf32-s390.c (elf_s390_check_relocs): Likewise. + (elf_s390_size_dynamic_sections): Likewise. + * elf32-sh.c (sh_elf_check_relocs): Likewise. + * elf64-ppc.c (ppc64_elf_check_relocs, dec_dynrel_count) + (ppc64_elf_size_dynamic_sections): Likewise. + * elf64-s390.c (elf_s390_check_relocs): Likewise. + (elf_s390_size_dynamic_sections): Likewise. + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise. + (_bfd_sparc_elf_size_dynamic_sections): Likewise. + * ieee.c (ieee_slurp_section_data): Likewise. + * oasys.c (oasys_slurp_section_data): Likewise. + +2005-10-04 Bob Wilson + + * archive.c: Add missing SUBSECTION for documentation. + * bfd.c: Likewise. + * cache.c: Likewise. + * corefile.c: Likewise. + * format.c: Likewise. + * init.c: Likewise. + * libbfd.c: Likewise. + * opncls.c: Likewise. + * elf.c: Remove blank line after SECTION heading. + * reloc.c: Change "howto manager" SECTION to a SUBSECTION. + +2005-10-04 Nick Clifton + + * elf32-arm.c (get_arm_elf_section_data): Cache the last pointer + matched so that the typical case of scanning for the previous + section to last one can be handled quickly. + +2005-10-03 David Heine + + * elf32-xtensa.c (relocations_reach): Skip range check for + absolute literals. + +2005-10-03 Alan Modra + + * elf.c (_bfd_elf_get_synthetic_symtab): Set BSF_GLOBAL on + synthetic syms. + +2005-09-30 H.J. Lu + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerated. + * aclocal.m4: Likewise. + +2005-09-30 Catherine Moore + + * Makefile.am: Bfin support. + * Makefile.in: Regenerated. + * aclocal.m4: Regenerated. + * archures.c (bfd_mach_bfin): New. + (bfd_arch_bfin): New. + bfd-in.h (bfd_bfin_elf32_create_embedded_relocs): New. + * bfd-in2.h: Regenerated. + * config.bfd: Bfin support. + * configure: Regenerated. + * configure.in: Bfin support. + * libbfd.h: Regenerated. + * reloc.c: Add BFD relocations for Bfin. + * targets.c (bfd_elf32_bfin_vec): New. + * cpu-bfin.c: New file. + * elf32-bfin.c: New file. + +2005-09-30 Alan Modra + + * elf64-ppc.c (ppc_type_of_stub): Check both func desc and func + entry sym before deciding no stub is needed. + (ppc64_elf_size_stubs): When calculating branch destination, + don't use func desc sym for old ABI objects unless func entry + is undefined. + +2005-09-28 H.J. Lu + + PR binutils/1321 + * elf-bfd.h (_bfd_elf_setup_group_pointers): Renamed to ... + (_bfd_elf_setup_sections): This. + * elf.c: Likewise. + * elfcode.h (elf_object_p): Likewise. + + * elf.c (_bfd_elf_setup_sections): Process SHF_LINK_ORDER. + (_bfd_elf_copy_private_section_data): Likewise. + +2005-09-28 H.J. Lu + + * elflink.c (elf_fixup_link_order): Report locations for mixed + ordered and unordered input sections. + +2005-09-22 James E. Wilson + + * dwarf2.c (struct funcinfo): Delete nesting_level field. + (lookup_address_in_function_table): Delete code to set funcinfo + caller_func field. Delete local curr_func. + (scan_unit_for_symbols): New locals nested_funcs, nested_funcs_size. + Delete code setting funcinfo nesting_level field. Add code to set + funcinfo caller_func field. + +2005-09-20 James E. Wilson + + * dwarf2.c (find_abstract_instance_name): Don't early exit when name + set. For DW_AT_name case, only set name if not already set. Handle + DW_AT_MIPS_linkage_name. + +2005-09-20 Alan Modra + + * elflink.c (_bfd_elf_merge_symbol): Simplify. + +2005-09-19 Alan Modra + + * elf64-ppc.c (ppc_build_one_stub): Replace assertion that long + branch offset is in range with an error. Print full stub name on + errors. + (ppc_size_one_stub): Print full stub name on errors. + (group_sections): Warn if section size exceeds group size. + (ppc64_elf_size_stubs): Continue relaxing when stub types change. + +2005-09-09 Kevin Buettner + + * elf32-am33lin.c (bfd.h, sysdep.h, elf-bfd.h, elf/mn10300.h): + Include. + (elf32_am33lin_grok_prstatus, elf32_am33lin_grok_psinfo): New + functions. + (elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define. + +2005-09-09 Richard Earnshaw + + * elf32-arm.c (elf32_arm_section_from_shdr): Accept SHT_ARM_PREEMPTMAP + and SHT_ARM_ATTRIBUTES. + +2005-09-08 H.J. Lu + + * elflink.c (elf_get_linked_section_vma): Fix a typo in comment. + * elfxx-ia64.c (elf_backend_link_order_error_handler): Likewise. + +2005-09-08 H.J. Lu + + PR ld/1263 + * elflink.c (elf_link_add_object_symbols): Abort for + --just-symbols on DSO. + +2005-09-08 Paul Brook + + * reloc.c: Rename BFD_RELOC_ARM_SMI to BFD_RELOC_ARM_SMC. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2005-09-06 H.J. Lu + + PR ld/1301 + * elflink.c (_bfd_elf_merge_symbol): Don't check undefined + symbol introduced by "ld -u" for TLS. + +2005-09-02 Paul Brook + + * libbdf.h: Regenerate. + * bfd-in2.h: Regenerate. + * reloc.c: Add BFD_RELOC_ARM_T32_CP_OFF_IMM and + BFD_RELOC_ARM_T32_CP_OFF_IMM_S2. + +2005-09-01 Dmitry Diky + + * elf32-msp430.c (msp430_elf_relax_delete_bytes): Do not adjust + local symbols and move it to + (msp430_elf_relax_adjust_locals): New function - walk over the + sections in the bfd and adjust relocations as necessary. + +2005-08-31 DJ Delorie + + * elf32-i386.c (elf_i386_check_relocs): Don't cast a unary & + address operator, as that breaks GCC's strict aliasing rules. + (elf_i386_size_dynamic_sections): Avoid the need for type + punning. + * elf64-x86-64.c (elf_x86_64_check_relocs): Don't cast a unary + & address operator, as that breaks GCC's strict aliasing + rules. + (elf_x86_64_size_dynamic_sections): Avoid the need for type + punning. + +2005-08-30 Phil Edwards + + * config.bfd (i[3-7]86-*-vxworks): Match vxworks* instead. + +2005-08-29 H.J. Lu + + PR ld/1247 + * elfxx-ia64.c (allocate_fptr): Check undefined symbol. + +2005-08-29 Steven J. Hill + + * elfxx-mips.c (_bfd_mips_elf_relocate_section): Initialise + 'value' to avoid compile time warning message. + +2005-08-26 Christian Groessler + + * coff-z8k.c: (r_jr, r_disp7, r_callr): Fix src_mask and dst_mask + of HOWTO. + (coff_z8k_select_reloc): Remove. + (SELECT_RELOC): Remove. + (coff_z8k_reloc_type_lookup): New function. + (coff_bfd_reloc_type_lookup): Define. + * configure.in: Add cofflink.lo to z8kcoff_vec. + * configure: Regenerate. + * reloc.c: (bfd_reloc_code_type): Add z8k relocations. + (bfd_install_relocation): Don't clear reloc_entry->addend for + coff-z8k target. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2005-08-25 Kaz Kojima + + * elf32-sh.c (sh_elf_get_flags_from_mach): Fix off-by-one error. + +2005-08-24 H.J. Lu + + PR ld/1208 + * elf-hppa.h (elf_hppa_relocate_section): Print out the name + of unresolvable relocation. + * elf-m10300.c (mn10300_elf_relocate_section): Likewise. + * elf32-arm.c (elf32_arm_relocate_section): Likewise. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise. + +2005-08-18 Kaz Kojima + + * config.bfd: Add bfd_elf32_shnbsd_vec and bfd_elf32_shlnbsd_vec + to targ_selvecs for sh5*-*-netbsd* and sh64*-*-netbsd*. + +2005-08-18 Alan Modra + + * coff-a29k.c: Delete. + * cpu-a29k.c: Delete. + * Makefile.am: Remove mention of a29k files. + * aoutf1.h: Remove a29k support. + * aoutx.h: Likewise. + * archures.c: Likewise. + * coffcode.h: Likewise. + * config.bfd: Likewise. + * configure.in: Likewise. + * ieee.c: Likewise. + * mipsbsd.c: Likewise. + * pdp11.c: Likewise. + * sparclynx.c: Likewise. + * targets.c: Likewise. + * Makefile.in: Regenerate. + * configure: Regenerate. + * bfd-in2.h: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2005-08-18 Alan Modra + + * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Warn on + zero size dynamic variables. + * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise. + * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise. + * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise. + * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise. + * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise. + * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise. + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise. + * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. + * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise. + * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise. + * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. + * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise. + * elf64-x86-64.c (elf64_x86_64_adjust_dynamic_symbol): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise. + +2005-08-17 H.J. Lu + + PR binutils/1179 + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Use section lma + instead of vma. + (_bfd_dwarf2_find_line): Likewise. + +2005-08-17 Alan Modra + + * elf64-mmix.c (mmix_elf_add_symbol_hook): Mark reg section + SEC_LINKER_CREATED. + (mmix_elf_final_link): Check that section hasn't already been + removed before removing. + * mmo.c (mmo_scan): Mark reg contents section SEC_LINKER_CREATED. + (mmo_canonicalize_symtab): Likewise for reg section. + +2005-08-17 Alan Modra + + * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Move assert later. + * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Cope with being called + without any got section. + +2005-08-17 Danny Smith + + * cofflink.c (_bfd_coff_generic_relocate_section): Correct + comment. + +2005-08-17 Alan Modra + + * elflink.c (_bfd_elf_define_linkage_sym): Don't call + bfd_elf_link_record_dynamic_symbol. Call elf_backend_hide_symbol. + (_bfd_elf_link_renumber_dynsyms): Formatting. + (struct elf_gc_sweep_symbol_info): New. + (elf_gc_sweep_symbol): Rewrite. + (elf_gc_sweep): Adjust params and elf_gc_sweep_symbol call. + Call _bfd_elf_link_renumber_dynsyms. + (bfd_elf_gc_sections): Adjust elf_gc_sweep call. + +2005-08-16 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_opd): Don't call dec_dynrel_count + when relocatable. + +2005-08-15 Bob Wilson + + * elf32-xtensa.c (ELF_MACHINE_CODE, ELF_MACHINE_ALT1): Swap values + of EM_XTENSA and EM_XTENSA_OLD. + +2005-08-16 Alan Modra + + * elf-bfd.h (_bfd_elf_define_linkage_sym): Declare. + * elflink.c (_bfd_elf_define_linkage_sym): New function, extracted + from.. + (_bfd_elf_create_got_section): ..here. + (_bfd_elf_link_create_dynamic_sections): Call it for _DYNAMIC. + (_bfd_elf_create_dynamic_sections): ..and _PROCEDURE_LINKAGE_TABLE_. + * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Use + _bfd_elf_define_linkage_sym. + * elf32-frv.c (_frv_create_got_section): Likewise. + * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise. + +2005-08-15 Paul Brook + + * elf32-arm.c (elf32_arm_howto_table_1): Make R_ARM_PLT32 the same as + R_ARM_PC24. + +2005-08-13 John David Anglin + + PR ld/1135 + * elf64-hppa.c (elf64_hppa_special_sections): Add flag definitions for + .plt, .dlt, .sdata, .sbss and .tbss. + +2005-08-12 Dmitry Diky + + * elf32-msp430.c (msp430_elf_relax_delete_bytes): Adjust relocations + referenced by .section + DISPLACEMENT. + +2005-08-10 James E. Wilson + + * dwarf2.c (scan_unit_for_symbols, case DT_AT_location): Verify that + DW_OP_addr is only opcode in location before using it. + +2005-08-09 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_final_link): Reset gp. + +2005-08-09 Rodney Brown + Nick Clifton + + * aix5ppc-core.c (xcoff64_core_p): Constify return_value + variable. Also, do not use core_hdr macro as it evaluates to a + cast of an lvalue which is no longer supported by GCC 4.0. + +2005-08-08 Eric Dönges + + * archures.c (bfd_mach_msp21): New MSP430 machine number. + * bfd-in2.h: Regenerate. + * cpu-msp430.c (arch_info_struct): Add support for msp430x21xx + variants. + +2005-08-07 Nick Clifton + Paul Brook + + PR 1147 + * elf32-arm.c (bfd_elf32_close_and_cleanup): Define. + (elf32_arm_close_and_cleanup): New function - walk over the + sections in the bfd that is being closed removing them from the + list of recorded sections. + (unrecord_section_via_map_over_sections): New helper function. + (record_section_with_arm_elf_section_data): Call bfd_malloc + instead of bfd_alloc. Remove unneeded abfd parameter. + (elf32_arm_new_section_hook): Do not pass bfd to + record_section_with_arm_elf_section_data. + + * elfxx-target.h (bfd_elfNN_close_and_cleanup): Only define if not + already defined by the target. + +2005-08-05 Fred Fish + + * dwarf2.c (read_rangelist): Use addr_size instead of offset_size + to determine how many bytes to read from each rangelist entry. + +2005-08-05 H.J. Lu + + * bfd.c (bfd_hide_symbol): New. + * bfd-in2.h: Regenerated. + +2005-08-04 H.J. Lu + + * elf64-x86-64.c (elf64_x86_64_merge_symbol): When mixing a + large common symbol and a normal common symbol, always turn + the large common symbol into a normal one. + +2005-08-04 Alan Modra + + * elf32-ppc.c (struct elf_linker_section): Replace sym_val field + with sym. + (ppc_elf_relocate_section): Adjust for above. + (create_sdata_sym): New function. + (ppc_elf_create_linker_section): Call it. + (ppc_elf_check_relocs): Correct has_sda_refs and non_got_refs. + Create sdata syms for all SDA relocs. + (ppc_elf_adjust_dynamic_symbol): Don't special case _SDA_BASE_ + and _SDA2_BASE_. + (ppc_elf_set_sdata_syms): Delete. + * elflink.c (bfd_elf_size_dynamic_sections): Don't create DT_INIT + and DT_FINI tags unless associated section has input. + (bfd_elf_set_symbol, _bfd_elf_provide_symbol): Delete. + (_bfd_elf_provide_section_bound_symbols): Delete. + * bfd-in.h (_bfd_elf_provide_symbol): Delete. + (_bfd_elf_provide_section_bound_symbols): Delete. + * bfd-in2.h: Regenerate. + +2005-08-04 Alan Modra + + * elflink.c (fix_syms, _bfd_elf_fix_excluded_sec_syms): Move to.. + * linker.c (fix_syms, _bfd_fix_excluded_sec_syms): ..here. + * bfd-in.h (_bfd_fix_excluded_sec_syms): Rename. + * bfd-in2.h: Regenerate. + +2005-08-03 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_section): Resize .rela.got + only if it isn't NULL. + +2005-08-03 H.J. Lu + + * elf32-i386.c (elf_howto_table): Undo the overflow change for + R_386_PC16 made on 2005-07-18. + + * elf64-x86-64.c (x86_64_elf_howto_table): Undo the overflow + change for R_X86_64_PC16 made on 2005-07-18. + +2005-08-03 Alan Modra + + * elf32-ppc.c (struct ppc_elf_link_hash_table): Remove hgot. Use + elf.hgot throughout file. + +2005-08-03 Alan Modra + + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Correct value of + _GLOBAL_OFFSET_TABLE_ for > 32k GOT. + +2005-08-02 Andreas Schwab + + * elfxx-ia64.c (struct elfNN_ia64_allocate_data): Add only_got. + (elfNN_ia64_relax_section): Reallocate .rela.got when .got has + changed. + (allocate_dynrel_entries): Look only at GOT relocations when + only_got is true. + (elfNN_ia64_size_dynamic_sections): Set only_got to false before + calling allocate_dynrel_entries. + +2005-08-02 Nick Clifton + + PR 1147 + * elf32-arm.c (struct _arm_elf_section_data): Turn into a typedef + and make the mapcount field unsigned. + (struct section_list): New: Used to keep track of which sections + have an _arm_elf_section_data structure. + (record_section_with_arm_elf_section_data): New function. + (get_arm_elf_section_data): New function. + (unrecord_section_with_arm_elf_section_data): New function. + (elf32_arm_output_symbol_hook): Use get_arm_elf_section_data. + (elf32_arm_new_section_hook): Call + record_section_with_arm_elf_section_data. + (elf32_arm_write_section): Use get_arm_elf_section_data and + unrecord_section_with_arm_elf_section_data. + +2005-08-01 Richard Sandiford + + * elfxx-mips.c (mips_mach_extends_p): Treat MIPS64 as an extension + of MIPS32 and MIPS64r2 as an extension of MIPS32r2. + +2005-07-30 David Daney + + * elflink.c (elf_gc_sweep): Set dynsymcount to correct value. + +2005-07-29 David Daney + + * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Ignore _gp_disp + if it is in the *ABS* section. + +2005-07-29 Paul Brook + + * reloc.c: Add BFD_RELOC_ARM_T32_ADD_PC12. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2005-07-29 Paul Brook + + * reloc.c (BFD_RELOC_ARM_T32_IMM12): Add. + * bfd-in2.h: Regeenrate. + * libbfd.h: Regenerate. + +2005-07-29 Pavel Kankovsky + + * peXXigen.c (pe_print_edata): Compute the size of the export + table from the size field in the DataDictionary and not the size + of the section. Some linkers embed the export table inside a + larger section. + +2005-07-29 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add action_discarded. + (enum action_discarded): Move from.. + * elflink.c (enum action_discarded): ..here. + (_bfd_elf_default_action_discarded): Rename from elf_action_discarded. + Remove target specific section checks. + (elf_link_input_bfd): Adjust. + * elfxx-target.h (elf_backend_action_discarded): Define. + (elfNN_bed): Init new field. + * bfd-in.h (_bfd_elf_default_action_discarded): Declare. + * bfd-in2.h: Regenerate. + * elf-hppa.h (elf_hppa_action_discarded): New function. + * elf32-hppa.c (elf_backend_action_discarded): Define. + * elf64-hppa.c (elf_backend_action_discarded): Define. + * elf32-ppc.c (ppc_elf_action_discarded): New function. + (elf_backend_action_discarded): Define. + +2005-07-27 Alan Modra + + * elflink.c (fix_syms): Handle symbols defined in input sections. + +2005-07-27 Jan Beulich + + * elf64-x86-64.c (R_X86_64_standard, R_X86_64_vt_offset): New. + (elf64_x86_64_info_to_howto): Use them. + +2005-07-27 Alan Modra + + * elflink.c (_bfd_elf_merge_symbol): Skip weak redefinition + regardless of strength of previous definition. + +2005-07-26 Alan Modra + + * elflink.c (elf_gc_mark_dynamic_ref_symbol): Handle -shared. + (bfd_elf_gc_sections): Allow -gc-sections when -shared. + * elf32-ppc.c (ppc_elf_gc_sweep_hook): Correct for -shared. + +2005-07-26 Alan Modra + + * elflink.c (elf_gc_sweep): Move gcc_except_table code.. + (bfd_elf_gc_sections): ..to here. + +2005-07-25 DJ Delorie + + * reloc.c: Remove unused M32C relocs, add BFD_RELOC_M32C_HI8. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + + * elf32-m32c.c (m32c_elf_howto_table): Add R_M32C_8, R_M32C_LO16, + R_M32C_HI8, R_M32C_HI16. + (m32c_reloc_map): Likewise. + (m32c_elf_relocate_section): Add R_M32C_HI8 and R_M32C_HI16. + +2005-07-25 Jan Hubicka + H.J. Lu + + * elf-bfd.h (_bfd_elf_large_com_section): New. + * elf.c (_bfd_elf_large_com_section): New. Defined. + + * elf64-x86-64.c (elf64_x86_64_add_symbol_hook): New. + (elf64_x86_64_elf_section_from_bfd_section): New. + (elf64_x86_64_symbol_processing): New. + (elf64_x86_64_common_definition): New. + (elf64_x86_64_common_section_index): New. + (elf64_x86_64_common_section): New. + (elf64_x86_64_merge_symbol): New. + (elf64_x86_64_additional_program_headers): New. + (elf64_x86_64_special_sections): New. + (elf_backend_section_from_bfd_section): New. Defined. + (elf_backend_add_symbol_hook): Likewise. + (elf_backend_common_section_index): Likewise. + (elf_backend_common_section): Likewise. + (elf_backend_common_definition): Likewise. + (elf_backend_merge_symbol): Likewise. + (elf_backend_special_sections): Likewise. + (elf_backend_additional_program_headers): Likewise. + +2005-07-25 H.J. Lu + + * elf-bfd.h (elf_backend_data): Add common_definition, + common_section_index, common_section, and merge_symbol. + (_bfd_elf_common_definition): New. + (_bfd_elf_common_section_index): New. + (_bfd_elf_common_section): New. + + * elf.c (elf_fake_sections): Don't clear sh_flags. + + * elflink.c (_bfd_elf_merge_symbol): Call backend merge_symbol + if it is available. + (is_global_data_symbol_definition): Call backend + common_definition instead of checking SHN_COMMON. + (elf_link_add_object_symbols): Likewise. + (elf_link_output_extsym): Call backend common_section_index + for common section index. + (_bfd_elf_common_definition): New. + (_bfd_elf_common_section_index): New. + (_bfd_elf_common_section): New. + + * elfxx-target.h (elf_backend_common_definition): New. + (elf_backend_common_section_index): New. + (elf_backend_common_section): New. + (elf_backend_merge_symbol): New. + (elfNN_bed): Initialize common_definition, common_section_index, + common_section, and merge_symbol. + + * section.c (BFD_FAKE_SECTION): New. + (STD_SECTION): Use it. + * bfd-in2.h: Regenerated. + +2005-07-23 Olaf Hering + + * elflink.c (elf_link_input_bfd): Add '\n' for linker einfo + callback. + +2005-07-21 Ralf Corsepius + + * config.bfd: Remove i[3-7]86-*-rtemself*. + Remove sparc-*-rtemself*. + +2005-07-22 Kazuhiro Inaoka + + * elf32-m32r.c (m32r_elf_check_relocs): Fix pc count for + R_M32R_REL32. + +2005-07-21 Ben Elliston + + * Makefile.am (BFD32_BACKENDS): Remove cf-m68klynx.lo. + (BFD32_BACKENDS): Likewise, remove m68klynx.lo. + (BFD32_BACKENDS_CFILES): Remove cf-m68klynx.c, m68klynx.c. + (cf-m68klynx.lo, m68klynx.lo): Remove targets. + * Makefile.in: Regenerate. + * cf-m68klynx.c: Remove. + * m68klynx.c: Likewise. + * configure.in (m68klynx_aout_vec): Remove vector. + (m68klynx_coff_vec): Likewise. + * configure: Regenerate. + * targets.c (m68klynx_aout_vec): Remove extern. + (m68klynx_coff_vec): Likewise. + (_bfd_target_vector): Remove m68klynx_{aout,coff}_vec. + * po/SRC-POTFILES.in: Remove cf-m68klynx.c, m68klynx.c. + +2005-07-20 Kazuhiro Inaoka + + * elf32-m32r.c (m32r_elf_howto_table): Support R_M32R_REL32. + (m32r_reloc_map): Likewise. + (m32r_elf_relocate_section): Likewise. + (m32r_elf_gc_sweep_hook): Likewise. + (m32r_elf_check_relocs): Likewise. + +2005-07-18 Nick Clifton + + * reloc.c: Add M32C and MS1 relocs. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2005-07-18 Nick Clifton + + * config.bfd: Move m32c entry to correct location. + * archures.c: Likewise. + * configure.in: Likewise. + * configure: Regenerate. + * targets.c: Move ms1 vector to correct location. + +2005-07-18 Jan Beulich + + * elf32-i386.c (elf_howto_table): Adjust overflow complaint handler + for R_386_PC16. + * elf64-x86-64.c (x86_64_elf_howto_table): Adjust overflow complaint + handler for R_X86_64_PC16, R_X86_64_8, and R_X86_64_DTPOFF. + +2005-07-16 Eric Botcazou + + PR ld/1021 + PR ld/1031 + * elflink.c (elf_link_add_object_symbols): Also append the version + name to non-hidden absolute symbols that are functions. + +2005-07-16 Alan Modra + + * elf32-ppc.c (ppc_elf_set_sdata_syms): Return void. Remove hack + for zero size sections. Don't set .sbss syms here. + * elf32-ppc.h (ppc_elf_set_sdata_syms): Adjust prototype. + +2005-07-16 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2005-07-15 Bob Wilson + + * elf32-xtensa.c (vsprint_msg): Add prototype. + (build_encoding_error_message): Delete. Code moved into.... + (elf_xtensa_do_reloc): ....here, and changed to give better + error messages for out of range literals. + +2005-07-15 Alan Modra + + * elflink.c (bfd_elf_record_link_assignment): Remove output_bfd param. + (_bfd_elf_provide_symbol): Allow redefinition of weak syms and those + defined in output sections. Call bfd_elf_record_link_assignment. + * bfd-in.h (bfd_elf_record_link_assignment): Update prototype. + * bfd-in2.h: Regenerate. + +2005-07-14 Jim Blandy + + Add support for m32c-*-elf (Renesas m32c and m16c). + * Makefile.am (ALL_MACHINES): Add cpu-m32c.lo. + (ALL_MACHINES_CFILES): Add cpu-m32c.c. + (BFD32_BACKENDS): Add elf32-m32c.lo. + (BFD32_BACKENDS_CFILES): Add elf32-m32c.c. + (cpu-m32c.lo, elf32-m32c.lo): New rules, generated by 'make dep-am'. + * Makefile.in: Regenerated. + * archures.c (bfd_arch_m32c, bfd_mach_m16c, bfd_mach_m32c): New + arch and mach codes. + (bfd_m32c_arch): New arch info object. + (bfd_archures_list): List bfd_m32c_arch. + * bfd-in2.h: Regenerated. + * config.bfd: Add case for the m32c. + * configure.in: Add case for the m32c. + * configure: Regenerated. + * cpu-m32c.c, elf32-m32c.c: New files. + * libbfd.h: Regenerated. + * targets.c (bfd_elf32_m32c_vec): Declare. + (_bfd_target_vector): List bfd_elf32_m32c_vec. + +2005-07-14 Alan Modra + + * bfd-in.h (_bfd_elf_fix_excluded_sec_syms): Declare. + (_bfd_elf_provide_section_bound_symbols): Remove param name. + Formatting. + * bfd-in2.h: Regenerate. + * elflink.c (bfd_elf_gc_sections): Don't call generic function. + (_bfd_elf_provide_symbol): Formatting. + (_bfd_elf_provide_section_bound_symbols): Remove all hacks, just + create section relative syms. + (fix_syms, _bfd_elf_fix_excluded_sec_syms): New functions. + * elf32-ppc.c (ppc_elf_set_sdata_syms): Use + _bfd_elf_provide_section_bound_symbols. + * reloc.c (bfd_mark_used_section): Delete. + (bfd_generic_gc_sections): Don't call the above. + +2005-07-14 Paul Woegerer + + PR 1063 + * cache.c (bfd_last_cache): Initialise to NULL. + +2005-07-14 Daniel Marques + Nick Clifton + + * coff-alpha.c (alpha_ecoff_bad_format_hook): Detect compressed + Alpha binaries and issue a helpful error message. + (alpha_ecoff_swap_reloc_out): Increase maximum allowed internal + symbol index to 15 to allow for binaries produced by DEC + compilers. + +2005-07-13 Steve Ellcey + + * bfd.m4 (BFD_NEED_DECLARATION): Remove. + +2005-07-12 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Don't use a plt stub + when !can_plt_call. + +2005-07-12 Alan Modra + + * elf32-xtensa.c (bfd_elf_xtensa_reloc): Warning fix. + +2005-07-12 Alan Modra + + * elf32-ppc.c (ppc_elf_set_sdata_syms): Correct __sbss_start value. + +2005-07-11 H.J. Lu + + * elflink.c (_bfd_elf_symbol_refs_local_p): Revert the last + change. + +2005-07-08 Paul Koning + + * dwarf2.c (read_address): Check sign_extend_vma to handle targets + where addresses are sign extended. + +2005-07-08 Ralf Corsepius + + * config.bfd: Mark i960-*-rtems*, or32-*-rtems* as obsolete. + Mark a29k-*rtems*, hppa*-*-rtems*, *-go32-rtems*, + i[3-7]86*-*-rtemscoff*, mips*el-*-rtems*, powerpcle-*-rtems*, + sparc*-*-rtemsaout* as removed + +2005-07-08 Alan Modra + + * elf-hppa.h (elf_hppa_final_link): Use gp val of zero when none + of the usual sections are found. + * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Tidy. + Strip .dynbss if it is zero size. + * elf32-arm.c (elf32_arm_size_dynamic_sections): Likewise. + * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise. + * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. + * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise, and + .dynsbss. + (i370_elf_finish_dynamic_sections): Don't attempt to write .got + when it is zero size. + * elf32-i386.c (elf_i386_size_dynamic_sections): Correct handling + of .dynbss and zero size sections. + * elf32-m32r.c (m32r_elf_size_dynamic_sections): Strip .dynbss if + it is zero size. + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Tidy. Strip + .dynbss if zero size. + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise, .dynsbss + too. + * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. + * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise. + * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. + * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Tidy. Strip + .plt.* and .got.plt.* if zero size. + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Tidy. Strip + .got* and .dynbss if zero size. + * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Tidy. Strip + * elf64-ppc.c (create_linkage_sections): Create branch lookup table + in .data.rel.ro.brlt or .rodata.brlt, and similarly for associated + reloc section. + (create_got_section): Always create new .got and .rela.got sections. + (ppc64_elf_size_dynamic_sections): Tidy. Strip .dynbss if zero size. + * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. + * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. + * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Handle + dynamic bss sections correctly. + * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Tidy. + * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Tidy. Strip + .dynbss if zero size. + +2005-07-08 Ben Elliston + + * elf32-xtensa.c: Include unconditionally, not only + when ANSI_PROTOTYPES is defined. Remove #ifdef logic. + +2005-07-07 H.J. Lu + + * elf-bfd.h (elf_backend_data): Add special_sections. + + * elf.c (_bfd_elf_get_sec_type_attr): Check special_sections + first. + + * elf32-arm.c (elf_backend_get_sec_type_attr): Removed. + (elf_backend_special_sections): New. Defined. + * elf32-m32r.c: Likewise. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc12.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-v850.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-sh64.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * elfxx-mips.h: Likewise. + + * elfxx-target.h (elf_backend_special_sections): New. + (elfNN_bed): Initialize special_sections. + +2005-07-07 Bob Wilson + + * xtensa-modules.c: Update tables with Xtensa MMU features. + +2005-07-07 Kaveh R. Ghazi + + * elf32-xtensa.c (vsprint_msg): Add format attribute. Fix + format bugs. + * vms.h (_bfd_vms_debug): Add format attribute. + (_bfd_vms_debug, _bfd_hexdump): Fix typos. + +2005-07-07 H.J. Lu + + PR 975 + * elflink.c (_bfd_elf_symbol_refs_local_p): Only undefined + symbol with default visibility is local. + +2005-07-07 Ben Elliston + + * config.bfd: Mark m68*-*-rtemscoff as obsolete. + +2005-07-06 H.J. Lu + + * dwarf2.c (varinfo): Add addr. + (lookup_symbol_in_variable_table): Also check addr. + (scan_unit_for_symbols): Set addr for variable. + (comp_unit_find_line): Updated. + +2005-07-06 Nick Clifton + + * coff-alpha.c (alpha_adjust_reloc_in): Issue an informative error + message if an unknown reloc is encountered. + (alpha_relocate_section): Likewise. + + * ecoff.c (_bfd_ecoff_write_object_contents): Cope with a reloc + with a missing howto field. + +2005-07-06 Alan Modra + + * po/SRC-POTFILES.in: Add cpu-ms1.c, elf32-ms1.c, elf-vxworks.c, + elfxx-sparc.c. + +2005-07-05 Paul Brook + + * elf32-ppc.c (ppc_elf_vxworks_special_sections): Remove. + (ppc_elf_vxworks_get_sec_type_attr): New function. + (elf_backend_special_sections): Remove vxwords definition. + (elf_backend_get_sec_type_attr): Define for vxworks. + +2005-07-05 Nick Clifton + + * elf64-ppc.c (ppc64_elf_info_to_howto): Fix typo. + +2005-07-05 Paul Brook + + * config.bfd: Add separate case for ppc-vxworks. + * configure: Regenerate. + * configure.in: Include elf-vxworks.lo on ppc targets. + * elf-vxworks.c (elf_vxworks_final_write_processing): Handle + .rela.plt.unloaded. + * elf32-ppc.c: Add VxWorks target vec. Include elf-vxworks.h. + (PLT_ENTRY_SIZE, PLT_INITIAL_ENTRY_SIZE, PLT_SLOT_SIZE): Remove. + (VXWORKS_PLT_ENTRY_SIZE, ppc_elf_vxworks_plt_entry, + ppc_elf_vxworks_pic_plt_entry, VXWORKS_PLT_INITIAL_ENTRY_SIZE, + ppc_elf_vxworks_plt0_entry, ppc_elf_vxworks_pic_plt0_entry, + VXWORKS_PLT_NON_JMP_SLOT_RELOCS, VXWORKS_PLTRESOLVE_RELOCS, + VXWORKS_PLTRESOLVE_RELOCS_SHLIB): New. + (ppc_elf_link_hash_table): Add srelplt2, sgotplt, hgot, hplt, + is_vxworks, plt_entry_size, plt_slot_size, plt_initial_entry_size. + (ppc_elf_link_hash_table_create): Initialize hadtab plt fields. + (ppc_elf_create_got): Create .got.plt for VxWorks. + (ppc_elf_create_dynamic_sections): Create unloaded plt relocation + section for VxWorks. + (ppc_elf_select_plt_layout): Handle VxWorks plt format. + (allocate_got): VxWorks does not need a got header. + (allocate_dynrelocs): Handle VxWorks plt format. + (ppc_elf_size_dynamic_sections): Save _G_O_T_ and _P_L_T_ symbols for + VxWorks. Handle VxWorks plt/got. + (ppc_elf_finish_dynamic_sections): Fill in VxWorks plt. + (ppc_elf_vxworks_special_sections): New. + (ppc_elf_vxworks_link_hash_table_create, + ppc_elf_vxworks_add_symbol_hook, + elf_i386_vxworks_link_output_symbol_hook, + ppc_elf_vxworks_final_write_processing): New functions. + * targets.c (bfd_elf32_powerpc_vxworks_vec): Declare. + (_bfd_target_vector): Use it. + +2005-07-05 Jakub Jelinek + + * libbfd-in.h (struct artdata): Add extended_names_size field. + * libbfd.h: Rebuilt. + * coff-rs600.c (_bfd_xcoff_archive_p): Don't clear fields in freshly + allocated object by bfd_zalloc. + * coff64-rs6000.c (xcoff64_archive_p): Likewise. + * ecoff.c (_bfd_ecoff_archive_p): Likewise. + * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p): Likewise. + (get_extended_arelt_filename): Fail if index is bigger or equal to + extended_names_size. + (_bfd_generic_read_ar_hdr_mag): Don't set bfd_error_malformed_archive, + get_extended_arelt_filename already did that. + (_bfd_slurp_extended_name_table): Initialize extended_names_size field. + Allocate one extra byte and clear it, in case extended names table + is not terminated. + + * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2, bfd_alloc2, + bfd_zalloc2): New prototypes. + * bfd-in.h (HALF_BFD_SIZE_TYPE): Define. + * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): New functions. + * opncls.c (bfd_alloc2, bfd_zalloc2): New functions. + * elf.c (bfd_elf_get_elf_syms, setup_group, assign_section_numbers, + elf_map_symbols, map_sections_to_segments, + assign_file_positions_for_segments, copy_private_bfd_data, + swap_out_syms, _bfd_elf_slurp_version_tables): Use bfd_*alloc2 + where appropriate. + * bfd-in2.h: Rebuilt. + * libbfd.h: Rebuilt. + + * elf.c (_bfd_elf_print_private_bfd_data): Don't crash on bogus + verdef or verneed section. + (_bfd_elf_slurp_version_tables): Handle corrupt verdef and/or + verneed sections gracefully. + * elfxx-sparc.c (_bfd_sparc_elf_info_to_howto_ptr): Don't crash on + bogus relocation values. + * elf64-ppc.c (ppc64_elf_info_to_howto): Likewise. + * elf64-s390.c (elf_s390_info_to_howto): Likewise. + * elf32-s390.c (elf_s390_info_to_howto): Likewise. + * elf64-x86-64.c (elf64_x86_64_info_to_howto): Likewise. + * elfxx-ia64.c (lookup_howto): Likewise. + + * elf.c (bfd_elf_get_str_section): Allocate an extra byte after + the end of strtab and clear it. + (elf_read): Remove. + +2005-07-05 Nick Clifton + + * po/vi.po: New Vietnamese translation. + * configure.in (ALL_LINGUAS): Add vi. + * configure: Regenerate. + +2005-07-05 Peter S. Mazinger + + * elf32-arm.c (elf32_arm_size_dynamic_sections): Fix a typo and + touchup logic like i386/ppc. + +2005-07-05 Alan Modra + + * elf.c (special_sections): Move const qualifier. + (special_sections_b..special_sections_t): Likewise. + * elf32-arm.c (elf32_arm_symbian_get_sec_type_attr): Remove duplicate + const. + (elf32_arm_symbian_special_sections): Move const qualifier. + * elf32-m32r.c: Similarly. + * elf32-m68hc11.c: Similarly. + * elf32-m68hc12.c: Similarly. + * elf32-mcore.c: Similarly. + * elf32-ppc.c: Similarly. + * elf32-sh64.c: Similarly. + * elf32-v850.c: Similarly. + * elf32-xtensa.c: Similarly. + * elf64-alpha.c: Similarly. + * elf64-hppa.c: Similarly. + * elf64-ppc.c: Similarly. + * elf64-sh64.c: Similarly. + * elfxx-ia64.c: Similarly. + * elfxx-mips.c: Similarly. + +2005-07-04 Kazuhiro Inaoka + + * elf32-m32r.c (m32r_elf_size_dynamic_sections): Use + info->executable instead of !info->shared where appropriate. + +2005-07-04 Alan Modra + + PR 1042 + * elf.c (assign_file_positions_for_segments): Remove excluded + sections from the segment map. + +2005-07-04 Alan Modra + + PR 1004 + * elf-bfd.h (struct elf_backend_data): Add get_sec_type_attr. Delete + special_sections. + (_bfd_elf_get_special_section): Declare. + (bfd_elf_special_section): Update prototype. + * elf.c (special_sections): Remove unused outer entries. + (get_special_section): Delete. + (_bfd_elf_get_special_section): New function. + (_bfd_elf_get_sec_type_attr): Replace "name" arg with "sec". Update + special_sections indexing. + (_bfd_elf_new_section_hook): Call backend get_sec_type_attr. + * elf32-arm.c (symbian_special_sections_d): Delete. + (symbian_special_sections_g, symbian_special_sections_h): Delete. + (symbian_special_sections_i, symbian_special_sections_f): Delete. + (symbian_special_sections_p): Delete. + (elf32_arm_symbian_special_sections): Merge above to here. + (elf32_arm_symbian_get_sec_type_attr): New function. + (elf_backend_special_sections): Don't define. + (elf_backend_get_sec_type_attr): Define. + * elf32-m32r.c: Similarly to elf32-arm.c. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc12.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-v850.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-sh64.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * elf32-ppc.c: Likewise. + (bfd_elf_special_section ppc_alt_plt): New. Use it if .plt loadable. + * elfxx-mips.h (_bfd_mips_elf_get_sec_type_attr): Declare. + (_bfd_mips_elf_special_sections, elf_backend_special_sections): Delete. + (elf_backend_get_sec_type_attr): Define. + * elfxx-target.h (elf_backend_get_sec_type_attr): Define. + (elf_backend_special_sections): Don't define. + (elfNN_bed): Update. + +2005-07-01 Nick Clifton + + * cpu-d10v.c: Update to ISO C90 style function declarations and + fix formatting. + * cpu-d30v.c: Likewsie. + * cpu-i370.c: Likewsie. + * cpu-xstormy16.c: Likewsie. + * elf32-arc.c: Likewsie. + * elf32-d10v.c: Likewsie. + * elf32-d30v.c: Likewsie. + * elf32-dlx.c: Likewsie. + * elf32-i370.c: Likewsie. + * elf32-i960.c: Likewsie. + * elf32-ip2k.c: Likewsie. + * elf32-m32r.c: Likewsie. + * elf32-mcore.c: Likewsie. + * elf32-openrisc.c: Likewsie. + * elf32-or32.c: Likewsie. + * elf32-pj.c: Likewsie. + * elf32-v850.c: Likewsie. + * elf32-xstormy16.c: Likewsie. + +2005-07-01 Alan Modra + + * elf64-alpha.c (elf64_alpha_create_got_section): Always create + a new .got section. + (elf64_alpha_create_dynamic_sections): Always make new sections + by using bfd_make_section_anyway_with_flags. Check that .got not + already created. + (elf64_alpha_check_relocs): Delete "got_created". Use tdata->gotobj + instead. + +2005-06-30 Alan Modra + + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Ignore dynamic + _SDA_BASE_ and _SDA2_BASE_ symbols. + * elflink.c (_bfd_elf_provide_symbol): Correct comment. Define + sym if not def_regular. + (_bfd_elf_provide_section_bound_symbols): Similarly. + +2005-06-30 Ben Elliston + + * config.bfd: Mark as obsolete: + m68*-apollo-* + m68*-apple-aux* + m68*-bull-sysv* + +2005-06-29 Alan Modra + + * elflink.c (_bfd_elf_gc_mark): Mark sections referenced by + .eh_frame specially.. + (bfd_elf_gc_sections): ..rather than totally ignoring .eh_frame. + Don't recheck sections we have already marked. + (elf_gc_sweep): Keep non-code sections referenced from .eh_frame. + * section.c (struct bfd_section): Add gc_mark_from_eh. + (STD_SECTION): Adjust. + * ecoff.c (bfd_debug_section): Adjust. + * bfd-in2.h: Regenerate. + +2005-06-29 Alan Modra + + * elflink.c (elf_gc_sweep): Do not refcount on sections that have + not been processed by check_relocs. + +2005-06-29 Paul Brook + + * bfd-in.h (_bfd_elf_provide_symbol): Update prototype. + * bfd-in2.h: Regenerate. + * elf32-ppc.c (ppc_elf_set_sdata_syms): Make sdata symbols section + relative. + * elflink.c (bfd_elf_set_symbol): Add section argument. + (_bfd_elf_provide_symbol): Ditto. + (_bfd_elf_provide_section_bound_symbols): Pass NULL section argument. + +2005-06-27 Carlos O'Donell + + * elf32-hppa.c (struct elf32_hppa_stub_hash_entry): + Use bh_root, and hh. + (struct elf32_hppa_link_hash_entry): Use eh, and hsh_cache. + (struct elf32_hppa_dyn_reloc_entry): Use hdh_next. + (struct elf32_hppa_link_hash_table): Use etab and bstab. + (stub_hash_newfunc): Use hh. + (hppa_link_hash_newfunc): Use hsh_cache. + (elf32_hppa_link_hash_table_create): Use etab, and bstab. + (elf32_hppa_link_hash_table_free): Use bstab. + (hppa_stub_name): Use eh. + (hppa_get_stub_entry): Use hh, hsh_entry, and hsh_cache. + (hppa_add_stub): Use bstab. + (hppa_type_of_stub): Use eh. + (hppa_build_one_stub): Use hh and bh_root. + (elf32_hppa_copy_indirect_symbol): Use hdh_next. + (elf32_hppa_check_relocs): Use eh, etab, and hdh_next. + (elf32_hppa_gc_sweep_hook): Use hdh_next. + (elf32_hppa_adjust_dynamic_symbol): Use hdh_next, and etab. + (allocate_plt_static): Use etab. + (allocate_dynrelocs): Use etab, and hdh_next. + (readonly_dynrelocs): Use hdh_next. + (elf32_hppa_size_dynamic_sections): Use etab, and hdh_next. + (get_local_syms): Use eh, bstab, and hh. + (elf32_hppa_size_stubs): Use eh, bstab, and hh. + (elf32_hppa_set_gp): Use etab. + (elf32_hppa_build_stubs): Use bstab. + (final_link_relocate): Use eh, bh_root. + (elf32_hppa_relocate_section): Use elf, etab. + (elf32_hppa_finish_dynamic_sections): Use etab. + +2005-06-27 H.J. Lu + + * elfxx-ia64.c (elfNN_hpux_backend_symbol_processing): Remove + the extra `;'. + +2005-06-21 Carlos O'Donell + + * elf32-hppa.c (hppa_elf_hash_entry): Define. + (hppa_stub_hash_entry): Define. + (stub_hash_newfunc): Rename variables. + (hppa_link_hash_newfunc): Likewise. + (elf32_hppa_link_hash_table_free): Likewise. + (hppa_stub_name): Likewise. + (hppa_get_stub_entry): Likewise. + (hppa_add_stub): Likewise. + (hppa_type_of_stub): Likewise. + (hppa_build_one_stub): Likewise. + (hppa_size_one_stub): Likewise. + (elf32_hppa_create_dynamic_sections): Likewise. + (elf32_hppa_copy_indirect_symbol): Likewise. + (elf32_hppa_check_relocs): Likewise. + (elf32_hppa_gc_mark_hook): Likewise. + (elf32_hppa_gc_sweep_hook): Likewise. + (elf32_hppa_grok_psinfo): Likewise. + (elf32_hppa_hide_symbol): Likewise. + (elf32_hppa_adjust_dynamic_symbol): Likewise. + (allocate_dynrelocs): Likewise. + (clobber_millicode_symbols): Likewise. + (readonly_dynrelocs): Likewise. + (elf32_hppa_size_dynamic_sections): Likewise. + (get_local_syms): Likewise. + (elf32_hppa_size_stubs): Likewise. + (hppa_record_segment_addr): Likewise. + (final_link_relocate): Likewise. + (elf32_hppa_relocate_section): Likewise. + (elf32_hppa_finish_dynamic_symbol): Likewise. + +2005-06-20 H.J. Lu + + PR 1025 + * elf-m10300.c (mn10300_elf_check_relocs): Handle indirect + symbol. + * elf32-arm.c (elf32_arm_check_relocs): Likewise. + * elf32-avr.c (elf32_avr_check_relocs): Likewise. + * elf32-cris.c (cris_elf_check_relocs): Likewise. + * elf32-d10v.c (elf32_d10v_check_relocs): Likewise. + * elf32-dlx.c (elf32_dlx_check_relocs): Likewise. + * elf32-fr30.c (fr30_elf_check_relocs): Likewise. + * elf32-frv.c (elf32_frv_check_relocs): Likewise. + * elf32-i370.c (i370_elf_check_relocs): Likewise. + * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise. + * elf32-m32r.c (m32r_elf_check_relocs): Likewise. + * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise. + * elf32-m68k.c (elf_m68k_check_relocs): Likewise. + * elf32-mcore.c (mcore_elf_check_relocs): Likewise. + * elf32-ms1.c (ms1_elf_check_relocs): Likewise. + * elf32-msp430.c (elf32_msp430_check_relocs): Likewise. + * elf32-openrisc.c (openrisc_elf_check_relocs): Likewise. + * elf32-ppc.c (ppc_elf_check_relocs): Likewise. + * elf32-s390.c (elf_s390_check_relocs): Likewise. + * elf32-sh.c (sh_elf_check_relocs): Likewise. + * elf32-v850.c (v850_elf_check_relocs): Likewise. + * elf32-vax.c (elf_vax_check_relocs): Likewise. + * elf64-mmix.c (mmix_elf_check_relocs): Likewise. + * elf64-ppc.c (ppc64_elf_check_relocs): Likewise. + * elf64-s390.c (elf_s390_check_relocs): Likewise. + * elf64-sh64.c (sh_elf64_check_relocs): Likewise. + * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise. + +2005-06-20 H.J. Lu + + PR 1022 + * elf32-hppa.c (elf32_hppa_check_relocs): Handle indirect + symbol. + +2005-06-20 H.J. Lu + + PR 1025 + * elf32-i386.c (elf_i386_check_relocs): Handle indirect symbol. + * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. + +2005-06-18 H.J. Lu + + * reloc.c: Add BFD_RELOC_X86_64_GOTOFF64 and + BFD_RELOC_X86_64_GOTPC32. + * bfd-in2.h: Regenerated. + +2005-06-17 Jakub Jelinek + + * elf.c (bfd_section_from_shdr): Kill bogus warning. + + * elf.c (bfd_section_from_shdr): Fail if sh_entsize is bogus for + symbol, relocation, group or versym sections. + + * coffcode.h (coff_slurp_reloc_table): Don't crash if native_relocs + is NULL. + * peXXigen.c (pe_print_idata): Don't crash if dll_name or start_address + doesn't point into the section. + +2005-06-17 Jan Beulich + + * bfd-in2.h (elf_x86_64_reloc_type): Add BFD_RELOC_X86_64_GOTOFF64 + and BFD_RELOC_X86_64_GOTPC32. + * libbfd.h (bfd_reloc_code_real_names): Likewise. + * elf64-x86-64.c (x86_64_elf_howto_table): Add entries for + R_X86_64_PC64, R_X86_64_GOTOFF64, and R_X86_64_GOTPC32. + (x86_64_reloc_map): Add entries for R_X86_64_PC64, R_X86_64_GOTOFF64, + and R_X86_64_GOTPC32. + (elf64_x86_64_info_to_howto): Adjust bounding relocation type. + (elf64_x86_64_check_relocs): Also handle R_X86_64_PC64, + R_X86_64_GOTOFF64, and R_X86_64_GOTPC32. + (elf64_x86_64_relocate_section): Likewise. + (elf64_x86_64_gc_sweep_hook): Also handle R_X86_64_PC64. + +2005-06-15 Mark Kettenis + + * archive.c: Include "libiberty.h". + +2005-06-15 Nick Clifton + + * elf32-v850.c (ELF_MACHINE_ALT2): Define so that binaries + produced by the GreenHills toolchain can be assimilated. + +2005-06-14 Steve Ellcey + + * som.c (som_find_inliner_info): New. + +2005-06-14 H.J. Lu + + * elflink.c (_bfd_elf_merge_symbol): Fix a typo in comment. + +2005-06-14 Jakub Jelinek + + * elf.c (bfd_section_from_shdr): Fail if name is NULL. + Prevent endless recursion on broken objects. + + * archive.c (do_slurp_coff_armap): Check for overflows. + +2005-06-10 Daniel Jacobowitz + + * elfcode.h (elf_write_relocs): Do nothing if there are no + relocations. + +2005-06-10 Alan Modra + + * dwarf2.c (decode_line_info): Revert last change. Instead set + initial low_pc to -1 to avoid need to test whether loc_pc has + been set. + +2005-06-09 Christopher Faylor + + * coffcode.h (sec_to_styp_flags): Set appropriate section flags when + either SEC_ALLOC OR SEC_LOAD. + +2005-06-09 Christopher Faylor + + * coffcode.h (sec_to_styp_flags): Remove read/write flags from noload + section header. Do not add STYP_NOLOAD since it does not appear to be + a valid PE flag. + +2005-06-09 H.J. Lu + + PR 1000 + * dwarf2.c (lookup_address_in_line_info_table): Restore code + handling NULL function info, removed with 2005-04-03 change. + +2005-06-08 Mark Mitchell + + * opncls.c (bfd_fopen): Mark returned BFD as cacheable if FD == -1. + +2005-06-09 Alan Modra + + * elflink.c (elf_mark_used_section): Delete. + (bfd_elf_gc_sections): Call bfd_generic_gc_sections. + * reloc.c (bfd_mark_used_section): New function. + (bfd_generic_gc_sections): Call bfd_mark_used_section. + +2005-06-08 Alan Modra + + * opncls.c (bfd_fopen): Don't set bfd_error unconditionally. + (bfd_fdopenr): Same. + +2005-06-07 Mark Mitchell + + * opncls.c (bfd_fdopenr): Add missing break statements. + +2005-06-07 Mark Mitchell + + * opncls.c (bfd_fopen): New API. + (bfd_openr): Use it. + (bfd_fdopenr): Likewise. + * bfd-in2.h: Regenerated. + +2005-06-07 Aldy Hernandez + Michael Snyder + Stan Cox + + * Makefile.am (ALL_MACHINES): Add ms1 support. + (ALL_MACHINES_CFILES): Same. + (BFD32_BACKENDS): Same. + (BFD32_BACKENDS_CFILES): Same. + + * Makefile.in: Regenerate. + + * archures.c (bfd_architecture): Add ms1 entries. + Externalize bfd_ms1_arch. + (bfd_archures_list): Add bfd_ms1_arch. + + * bfd-in2.h: Regenerate. + + * cpu-ms1.c: New file. + + * elf32-ms1.c: New file. + + * targets.c: Define extern of bfd_elf32_ms1_vec. + Add bfd_elf32_ms1_vec to _bfd_target_vector. + + * configure.in: Add bfd_elf32_ms1_vec case. + + * configure: Regenerate. + + * config.bfd: Add ms1-*-elf to table. + +2005-06-07 Zack Weinberg + + * coff-i386.c: Change md_apply_fix3 to md_apply_fix in comment. + +2005-06-07 Alan Modra + + * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Init _bfd_find_line. + * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise. + +2005-06-06 H.J. Lu + + PR 990 + * bfd.c (bfd_find_line): New. + + * dwarf2.c (comp_unit): Add variable_table. + (funcinfo): Add file, line, and sec. + (varinfo): New. + (lookup_symbol_in_function_table): New. + (lookup_symbol_in_variable_table): New. + (scan_unit_for_functions): Renamed to ... + (scan_unit_for_symbols): This. Handle DW_TAG_entry_point and + DW_TAG_variable. + (comp_unit_find_nearest_line): Updated. + (comp_unit_find_line): New. + (_bfd_dwarf2_find_line): New. + + * elf-bfd.h (_bfd_elf_find_line): New. + (_bfd_generic_find_line): New. Defined. + + * elf.c (_bfd_elf_find_line): New. + + * libbfd-in.h (_bfd_dwarf2_find_line): New. + (_bfd_generic_find_line): New. + + * bfd-in2.h: Regenerated. + * libbfd.h: Likewise. + + * libbfd.c (_bfd_generic_find_line): New. + + * targets.c (BFD_JUMP_TABLE_SYMBOLS): Initialize _bfd_find_line + with _bfd_generic_find_line. + (bfd_target): Add _bfd_find_line. + +2005-06-06 H.J. Lu + + * dwarf2.c (decode_line_info): Properly set low_pc. + +2005-06-06 Alan Modra + + * elf64-pcc.c (ppc64_elf_gc_mark_hook): For the local sym in .opd + case, include addend when indexing .opd section map. + (ppc64_elf_edit_opd): Add no_opd_opt param. Do nothing besides + clear opd_adjust array if no_opd_opt set. Tidy code. + Ignore zero size .opd. Check bfd_alloc return value. + (ppc_stub_name): Return immediately on bfd_malloc fail. + * elf64-ppc.h (ppc64_elf_edit_opd): Update prototype. + +2005-06-04 H.J. Lu + + * dwarf2.c (comp_unit): Fix a typo in comment. + +2005-06-03 Jan-Benedict Glaw + + * elf32-vax.c (rtype_to_howto): Remove PARAMS. + (reloc_type_lookup): Dito. + (elf_vax_discard_copies): Dito. + (elf_vax_instantiate_got_entries): Dito. + (elf_vax_link_hash_traverse): Dito. + (elf_vax_link_hash_newfunc): Dito. + (elf_vax_link_hash_table_create): Dito. + (elf32_vax_set_private_flags): Dito. + (elf32_vax_merge_private_bfd_data): Dito. + (elf32_vax_print_private_bfd_data): Dito. + (elf_vax_check_relocs): Dito. + (elf_vax_gc_mark_hook): Dito. + (elf_vax_gc_sweep_hook): Dito. + (elf_vax_size_dynamic_sections): Dito. + (elf_vax_discard_copies): Dito. + (elf_vax_instantiate_got_entries): Dito. + (elf_vax_relocate_section): Dito. + (elf_vax_finish_dynamic_symbol): Dito. + (elf_vax_finish_dynamic_sections): Dito. + (elf_vax_hash_table): Break-up of line isn't needed. + (elf_vax_check_relocs): Remove leading whitespace + (elf_vax_relocate_section): Remove redundant whitespace + (elf_vax_link_hash_newfunc): Don't cast NULL. + (elf_vax_link_hash_table_create): Dito. + * cpu-vax.c (bfd_vax_arch) Remove a trailing space. + +2005-06-03 Alan Modra + + PR 568 + * configure.in: Bump version + * configure: Regenerate. + * elflink.c (elf_link_input_bfd): Use einfo linker callback to print + discarded section sym refs and kill linker output. + * simple.c (simple_dummy_einfo): New function. + (bfd_simple_get_relocated_section_contents): Init callbacks.einfo. + + * elf32-i386.c (elf_i386_relocate_section): Handle zero symndx + for all reloc types. + +2005-06-02 Alan Modra + + * elf64-ppc.c (add_symbol_adjust): Set sym visibility to most + restrictive of func code and func descr for undefined syms as well + as defined. + +2005-05-31 Jim Blandy + + * Makefile.am: Regenerate dependencies with 'make dep-am'. + * Makefile.in: Regenerate. + +2005-05-31 Richard Henderson + + * elf64-alpha.c (ALPHA_ELF_LINK_HASH_LU_JSRDIRECT): New. + (ALPHA_ELF_LINK_HASH_TLS_IE): Renumber to 0x80. + (ALPHA_ELF_LINK_HASH_LU_PLT): Rename from ALPHA_ELF_LINK_HASH_LU_FUNC. + (elf64_alpha_want_plt): Update to match. + (elf64_alpha_check_relocs): Collect JSRDIRECT in gotent_flags. + (elf64_alpha_relax_with_lituse): Likewise. Handle JSRDIRECT. + +2005-05-31 Zack Weinberg + + * elf32-arm.c (elf32_arm_reloc_type_lookup) + (elf32_arm_nabi_grok_prstatus, elf32_arm_nabi_grok_psinfo): + Use ISO C90 function declaration style. + +2005-05-31 James E Wilson + + * elfcode.h (NAME(bfd_elf,bfd_from_remote_memory)): Check for program + header PF_R flag on PT_LOAD segments. + +2005-05-30 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section): Use dtp_base for + the zero index relocs produced by elf64_alpha_relax_tls_get_addr. + +2005-05-29 Richard Henderson + + * configure.in (--enable-secureplt): New. + * elf64-alpha.c (INSN_LDA, INSN_LDAH, INSN_LDQ, INSN_BR): New. + (INSN_SUBQ, INSN_S4SUBQ, INSN_JMP): New. + (INSN_A, INSN_AB, INSN_ABC, INSN_ABO, INSN_AD): New. + (elf64_alpha_use_secureplt): New. + (OLD_PLT_HEADER_SIZE, OLD_PLT_ENTRY_SIZE): New. + (NEW_PLT_HEADER_SIZE, NEW_PLT_ENTRY_SIZE): New. + (PLT_HEADER_SIZE, PLT_ENTRY_SIZE): Conditionalize on secureplt. + (ALPHA_ELF_LINK_HASH_PLT_LOC): Remove. + (struct alpha_elf_link_hash_entry): Add plt_offset. + (PLT_HEADER_WORD1, PLT_HEADER_WORD2, PLT_HEADER_WORD3): Remove. + (PLT_HEADER_WORD4, PLT_ENTRY_WORD1, PLT_ENTRY_WORD2): Remove. + (PLT_ENTRY_WORD3): Remove. + (elf64_alpha_create_dynamic_sections): If secureplt, set SEC_READONLY + on .plt and create .got.plt. + (elf64_alpha_output_extsym): Remove .plt frobbing for symbol values. + (get_got_entry): Initialize plt_offset. + (elf64_alpha_want_plt): New. + (elf64_alpha_check_relocs): Use it. + (elf64_alpha_adjust_dynamic_symbol): Likewise. Don't allocate + plt entries here. + (elf64_alpha_calc_got_offsets_for_symbol): Don't report internal + error as user error. + (elf64_alpha_size_plt_section_1): Allocate one plt entry per + got subsection. + (elf64_alpha_size_plt_section): Size .got.plt section. + (elf64_alpha_size_rela_got_1): Don't allocate relocations if + plt entries used. + (elf64_alpha_size_dynamic_sections): Call elf64_alpha_size_plt_section. + Add PLTRO DYNAMIC entry. + (elf64_alpha_finish_dynamic_symbol): Generate secureplt format. + (elf64_alpha_finish_dynamic_sections): Likewise. + +2005-05-28 David Daney + + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Move + calculation of DT_RELSZ to occur after all dynamic relocations + are created. + +2005-05-28 Eli Zaretskii + + * configure.in: Add snprintf and vsnprintf to AC_CHECK_DECLS. + * config.in, configure: Regenerate. + +2005-05-26 Mark Kettenis + Maciej W. Rozycki + + * elfxx-mips.c (_bfd_mips_elf_section_processing): Warn and + stop processing of options if one of invalid size is + encountered. + (_bfd_mips_elf_section_from_shdr): Likewise. + (_bfd_mips_elf_fake_sections): Reset the type of empty special + sections. + +2005-05-26 Richard Henderson + + * elf64-alpha.c (struct alpha_elf_link_hash_entry): Remove + plt_old_section, plt_old_value. + (elf64_alpha_adjust_dynamic_symbol): Don't set it. + (elf64_alpha_size_plt_section_1): Don't use it. + +2005-05-26 Jakub Jelinek + + * elfcode.h (elf_object_p): Fail if e_shoff != 0, e_shnum == 0 and + first shdr has sh_size == 0. Fail if e_shnum is large to cause + arithmetic overflow when allocating the i_shdr array. + Sanity check sh_link and sh_info fields. Fix e_shstrndx sanity check. + +2005-05-25 Richard Henderson + + * elf64-alpha.c: Update all function definitions to ISO C. Remove + all function prototypes; rearrange functions into def-use order. + +2005-05-25 Richard Henderson + + * elf64-alpha.c (elf64_alpha_merge_gots): Fix gotent iteration + in the presence of deleting elements. + (elf64_alpha_size_got_sections): Zero dead got section size. + +2005-05-23 Fred Fish + + * dwarf2.c (struct dwarf2_debug): Add inliner_chain member. + (struct funcinfo): Add caller_func, caller_file, caller_line. + tag, and nesting_level members. + (lookup_address_in_function_table): Change first passed parameter + from "struct funcinfo *" to "struct comp_unit *". + (lookup_address_in_function_table): Dereference unit to find function + table. + (lookup_address_in_function_table): Traverse the function list to + create a chain of inlined functions back to the first non inlined + function. + (scan_unit_for_functions): Remember tag and nesting level. Handle + DW_AT_call_file and DW_AT_call_line. + (comp_unit_find_nearest_line): Adjust lookup_address_in_function_table + call to pass unit pointer instead of function table pointer. For + inlined functions, save pointer to the inliner chain. + (_bfd_dwarf2_find_nearest_line): Initialize inliner_chain to NULL. + (_bfd_dwarf2_find_inliner_info): New function that returns information + from the inliner chain after a call to bfd_find_nearest_line. + + * bfd.c (bfd_find_inliner_info): Define using BFD_SEND. + * targets.c (BFD_JUMP_TABLE_SYMBOLS): Add entry for + NAME##_find_inliner_info. + (bfd_target): Add _bfd_find_inliner_info. + * bfd-in2.h: Regenerate. + + * libbfd-in.h (_bfd_nosymbols_find_inliner_info): Define as + macro that always returns bfd_false. + (_bfd_dwarf2_find_inliner_info): Declare. + * libbfd.h: Regenerate. + + * elf32-arm.c (elf32_arm_find_inliner_info): New function + that calls _bfd_dwarf2_find_inliner_info. + (bfd_elf32_find_inliner_info): Define to elf32_arm_find_inliner_info. + + * elfxx-mips.c (_bfd_mips_elf_find_inliner_info): New function + that calls _bfd_dwarf2_find_inliner_info. + * elfxx-mips.h (_bfd_mips_elf_find_inliner_info): Declare. + * elfn32-mips.c (bfd_elf32_find_inliner_info): Define to + _bfd_mips_elf_find_inliner_info. + * elf64-mips.c (bfd_elf64_find_inliner_info): Ditto. + * elf32-mips.c (bfd_elf32_find_inliner_info): Ditto. + + * elf.c (_bfd_elf_find_inliner_info): New function that calls + _bfd_dwarf2_find_inliner_info. + * elf-bfd.h (_bfd_elf_find_inliner_info): Declare. + * elfxx-target.h (bfd_elfNN_find_inliner_info): Define to + _bfd_elf_find_inliner_info. + + * coffgen.c (coff_find_inliner_info): New function that + calls _bfd_dwarf2_find_inliner_info. + * libcoff-in.h (coff_find_inliner_info): Declare. + * libcoff.h: Regenerate. + * coff-rs6000.c (rs6000coff_vec): Add coff_find_inliner_info. + (pmac_xcoff_vec) Ditto. + * coff64-rs6000.c (rs6000coff64_vec): Ditto. + (aix5coff64_vec): Ditto. + + * aout-target.h (MY_find_inliner_info): Define as + _bfd_nosymbols_find_inliner_info. + * aout-tic30.c (MY_find_inliner_info): Ditto. + * binary.c (binary_find_inliner_info): Ditto. + * i386msdos.c (msdos_find_inliner_info): Ditto. + * ihex.c (ihex_find_inliner_info): Ditto. + * libaout.h (aout_32_find_inliner_info): Ditto. + * libecoff.h (_bfd_ecoff_find_inliner_info): Ditto. + * mach-o.c (bfd_mach_o_find_inliner_info): Ditto. + * mmo.c (mmo_find_inliner_info): Ditto. + * nlm-target.h (nlm_find_inliner_info): Ditto. + * pef.c (bfd_pef_find_inliner_info): Ditto. + * ppcboot.c (ppcboot_find_inliner_info): Ditto. + * srec.c (srec_find_inliner_info): Ditto. + * tekhex.c (tekhex_find_inliner_info): Ditto. + * versados.c (versados_find_inliner_info): Ditto. + * xsym.c (bfd_sym_find_inliner_info): Ditto. + + * ieee.c (ieee_find_inliner_info): New function that always + returns FALSE. + * oasys.c (oasys_find_inliner_info): Ditto. + * vms.c (vms_find_inliner_info): Ditto. + +2005-05-24 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): For old gcc -fPIC code + force old plt layout. + +2005-05-22 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relax_section): Ignore non-allocated + sections. + (elf64_alpha_check_relocs): Likewise. + (elf64_alpha_relocate_section): Don't emit dynamic relocations to + non-allocated sections. + +2005-05-22 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relax_with_lituse): Relax jsr to + undefweak to use zero register. Call elf64_alpha_relax_got_load + if not all uses removed. + (elf64_alpha_relax_got_load): Relax undefweak to lda zero. + (elf64_alpha_relax_section): Handle undefweak symbols. + (elf64_alpha_calc_dynrel_sizes): Don't add relocs for undefweak. + (elf64_alpha_size_rela_got_1): Likewise. + (elf64_alpha_relocate_section): Likewise. + +2005-05-22 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relax_section): Only operate + on SEC_CODE sections. + +2005-05-22 John David Anglin + + * som.c (try_prev_fixup): Changed type of subspace_reloc_sizep to + unsigned int *. + (som_write_space_strings): Change type of tmp_space and p to char *. + (som_write_symbol_strings): Likewise. Also change type of comp to + char *comp[4]. + (som_begin_writing): Change type of strings_size to unsigned int. + (som_finish_writing): Likewise. + (som_slurp_reloc_table): Change type of external_relocs to unsigned + char *. + * som.h (struct som_section_data_struct): Change type of reloc_stream + field to unsigned char *. + +2005-05-20 Daniel Jacobowitz + + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't eliminate + copy relocations for VxWorks. + +2005-05-20 Daniel Jacobowitz + + * elf32-ppc.c (struct ppc_elf_link_hash_entry): Add new field + has_sda_refs. + (ppc_elf_copy_indirect_symbol): Copy has_sda_refs. + (ppc_elf_check_relocs): Set has_sda_refs. + (ppc_elf_adjust_dynamic_symbol): Check has_sda_refs before eliminating + copy relocations. Use has_sda_refs to place variables in .sbss. + (ppc_elf_finish_dynamic_symbol): Use has_sda_refs to place variables in + .sbss. + +2005-05-20 Bob Wilson + + * elf32-xtensa.c (bfd_elf_xtensa_reloc): Make sure that + xtensa_default_isa is initialized. + +2005-05-20 Alan Modra + + * elf32-ppc.c (allocate_dynrelocs): Correct plt offset assigned + for second and subsequent list entries. Only allocate multiple + glink stubs when shared or pie. + (ppc_elf_finish_dynamic_symbol): Break out early when only one + glink stub is needed. + +2005-05-19 Zack Weinberg + + * Makefile.am: Have 'all' depend on 'info'. + * Makefile.in: Regenerate. + +2005-05-19 Alan Modra + + * elf-bfd.h (struct elf_link_hash_table): Delete init_refcount and + init_offset. Add init_got_refcount, init_plt_refcount, + init_got_offset and init_plt_offset. + * elf.c (_bfd_elf_link_hash_newfunc): Adjust for above change. + (_bfd_elf_link_hash_hide_symbol): Likewise. + (_bfd_elf_link_hash_table_init): Likewise. + * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise. + * elflink.c (_bfd_elf_adjust_dynamic_symbol): Likewise. + (bfd_elf_size_dynamic_sections): Likewise. + * elf32-ppc.c (GLINK_PLTRESOLVE): Now 16 insns. + (LWZU_0_X_12, LWZ_0_4_30, LWZ_0_X_12, LWZ_11_X_11, LWZ_11_X_30, + LWZ_12_4_12, LWZ_12_8_30, LWZ_12_X_12, SUB_11_11_30): Delete. + (ADDIS_12_12, BCL_20_31, LWZU_0_12, LWZ_0_12, LWZ_11_11, LWZ_11_30, + LWZ_12_12, MFLR_0, MFLR_12, MTLR_0, SUB_11_11_12): Define. + (struct plt_entry): New. + (ppc_elf_link_hash_table_create): Set new init_plt fields. + (ppc_elf_copy_indirect_symbol): Handle merge of plt plist. Don't + use _bfd_elf_link_hash_copy_indirect. + (update_plt_info, find_plt_ent): New functions. + (ppc_elf_check_relocs): Handle R_PPC_PLTREL24 with non-zero addend + and adjust for use of plt list rather than refcount. + (ppc_elf_gc_sweep_hook): Likewise. + (ppc_elf_tls_optimize): Likewise. + (ppc_elf_adjust_dynamic_symbol): Likewise. + (allocate_dynrelocs): Likewise. + (ppc_elf_relax_section): Likewise. + (ppc_elf_relocate_section): Likewise. Adjust R_PPC_PLTREL24 addends + when performing a relocatable link. + (ppc_elf_finish_dynamic_symbol): Likewise. Write .glink stubs here.. + (ppc_elf_finish_dynamic_sections): ..rather than here. Use new + pic resolver stub. + +2005-05-19 Alan Modra + + * elf.c (assign_file_positions_for_segments): Use maximum of + maxpagesize and section alignment when adjusting initial + segment offset and section offsets. + +2005-05-18 Zack Weinberg + + * elf32-arm.c: Make all #ifndef OLD_ARM_ABI blocks + unconditional. + +2005-05-18 H.J. Lu + + * elf.c (group_signature): Undo the last change. Check if the + symbol table section is correct. + +2005-05-17 Zack Weinberg + + * elf32-arm.c: Wherever possible, use official reloc names + from AAELF. + (elf32_arm_howto_table, elf32_arm_tls_gd32_howto) + (elf32_arm_tls_ldo32_howto, elf32_arm_tls_ldm32_howto) + (elf32_arm_tls_le32_howto, elf32_arm_tls_ie32_howto) + (elf32_arm_vtinherit_howto, elf32_arm_vtentry_howto) + (elf32_arm_pc11_howto, elf32_arm_thm_pc9_howto, elf32_arm_got_prel) + (elf32_arm_r_howto): Replace with elf32_arm_howto_table_1, + elf32_arm_howto_table_2, and elf32_arm_howto_table_3. + Add many new relocations from AAELF. + (elf32_arm_howto_from_type): Update to match. + (elf32_arm_reloc_map): Add entries for R_ARM_THM_JUMP24, + R_ARM_THM_JUMP11, R_ARM_THM_JUMP19, R_ARM_THM_JUMP8, + R_ARM_THM_JUMP6, R_ARM_GNU_VTINHERIT, and R_ARM_GNU_VTENTRY. + (elf32_arm_reloc_type_lookup): Use elf32_arm_howto_from_type. + (elf32_arm_final_link_relocate): Add support for + R_ARM_THM_JUMP24, R_ARM_THM_JUMP19, R_ARM_THM_JUMP6. Remove + case entries redundant with default. + + * reloc.c: Reorganize ARM relocations. Add Thumb + assembler-internal relocations BFD_RELOC_ARM_T32_OFFSET_U8, + BFD_RELOC_ARM_T32_OFFSET_IMM, BFD_RELOC_ARM_T32_IMMEDIATE. + Add visible relocations BFD_RELOC_THUMB_PCREL_BRANCH7, + BFD_RELOC_THUMB_BRANCH20, BFD_RELOC_THUMB_BRANCH25. + Delete unused relocations BFD_RELOC_ARM_GOT12, BFD_RELOC_ARM_COPY. + * bfd-in2.h, libbfd.h: Regenerate. + +2005-05-17 Daniel Jacobowitz + + * elf.c (_bfd_elf_write_object_contents): Check for non-NULL + elf_shstrtab. + * format.c (bfd_check_format_matches): Set output_has_begun + for both_direction. + * section.c (bfd_set_section_contents): Use bfd_write_p. Remove + special case for both_direction. + +2005-05-17 Nick Clifton + + * elf.c (group_signature): Check for a group section which is + actually a (corrupt) symbol table section in disguise and prevent + an infinite loop from occurring. + +2005-05-17 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_brl): Undo the change made on + 2005-02-16. + +2005-05-17 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_br): Keep the original + predicate on slot 0 only if slot 0 isn't br. + +2005-05-17 H.J. Lu + + PR 797 + * elf32-i386.c (elf_i386_size_dynamic_sections): Also remove + empty sdynbss section. + * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Likewise. + +2005-05-17 Tavis Ormandy + + * elf.c (bfd_section_from_shdr): Add sanity check when parsing + dynamic sections. + +2005-05-17 Alan Modra + + * elf32-ppc.c (LIS_11. LIS_12): Define. + (LWZU_0_X_12, LWZ_0_X_12, LWZ_12_4_12, LWZ_12_X_12): Define. + (ppc_elf_finish_dynamic_sections): Provide non-pic plt call stub + for --data-plt when building non-pie executables. + +2005-05-17 Nick Clifton + + * elf32-arm.c (elf32_arm_final_link_relocate): Gracefully handle + the situation where a symbols's section is not known but a section + relative R_ARM_RELATIVE reloc has to be generated for the Symbian + OS. + + * elf32-v850.c (v850_elf_relocate_section): Move code to test for + the presence of a symbol table to just before the symbol table is + actually used. + +2005-05-16 H.J. Lu + + PR 834 + * elfxx-ia64.c (elfNN_ia64_relax_br): New. + (elfNN_ia64_relax_section): Use it. + +2005-05-14 Mark Kettenis + + * elflink.c (bfd_elf_size_dynamic_sections): Use lbasename instead + of basename. + +2005-05-14 Alan Modra + + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Set DT_PPC_GOT, + not DT_PPC_GLINK. + (ppc_elf_finish_dynamic_sections): Likewise. + +2005-05-13 Fred Fish + + * libbfd-in.h: Fix a comment typo, 'neaderst' -> 'nearest' + * libbfd.h: Rebuilt. + +2005-05-13 Bob Wilson + + * elf32-xtensa.c (xtensa_get_property_section_name): Add missing + periods in linkonce_kind values. + +2005-05-12 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Allow R_386_GOTOFF + against protected function when building executable. + +2005-05-12 Alan Modra + + * elf32-ppc.c (LWZU_0_X_11): Delete. + (B, LWZ_11_X_11, LWZ_11_X_30, MTCTR_11): Define. + (ppc_elf_select_plt_layout): Set .got flags too. Formatting. + (ppc_elf_size_dynamic_sections): Allocate space for .glink branch + table. + (ppc_elf_finish_dynamic_symbol): Point .plt entries into the branch + table. + (ppc_elf_finish_dynamic_sections): Adjust DT_PPC_GLINK value. + Generate .glink branch table and updated stubs. + +2005-05-11 Alan Modra + + * reloc.c (BFD_RELOC_HI16_PCREL): Define. + (BFD_RELOC_HI16_S_PCREL, BFD_RELOC_LO16_PCREL): Define. + * elf32-ppc.c (GLINK_PLTRESOLVE, GLINK_ENTRY_SIZE): Define. + (CROR_151515, CROR_313131): Delete. + (ADDIS_11_11, ADDI_11_11, SUB_11_11_30, ADD_0_11_11, ADD_11_0_11, + LWZ_0_4_30, MTCTR_0, LWZ_12_8_30, BCTR, ADDIS_11_30, + LWZU_0_X_11): Define. + (ppc_elf_howto_raw): Add R_PPC_REL16, R_PPC_REL16_LO, R_PPC_REL16_HI + and R_PPC_REL16_HA entries. + (ppc_elf_reloc_type_lookup): Convert new bfd reloc types. + (ppc_elf_addr16_ha_reloc): Also handle R_PPC_REL16_HA. + (struct ppc_elf_link_hash_table): Add glink, glink_pltresolve, + new_plt, and old_plt. + (ppc_elf_create_dynamic_sections): Create .glink section. + (ppc_elf_check_relocs): Set new_plt and old_plt. + (ppc_elf_select_plt_layout): New function. + (ppc_elf_tls_setup): Set plt output section elf type and flags. + (allocate_got): Handle differences between old and new got layout. + (allocate_dynrelocs): Likewise for plt. + (ppc_elf_size_dynamic_sections): Likewise. Allocate memory for + .glink. Don't allocate memory for old bss .plt. Emit DT_PPC_GLINK. + (ppc_elf_relax_section): Rename ppc_info to htab. Handle .glink + destination of R_PPC_PLTREL24 relocs. + (ppc_elf_relocate_section): Handle new relocs and changed destination + of R_PPC_PLTREL24. + (ppc_elf_finish_dynamic_symbol): Init new style plt and handle + differences in layout. + (ppc_elf_finish_dynamic_sections): Set DT_PPC_GLINK value. Don't + put a blrl in new got. Write glink contents. + * elf32-ppc.h (ppc_elf_select_plt_layout): Declare. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2005-05-11 Andreas Schwab + + * elf32-i386.c (elf_i386_finish_dynamic_sections): Fix signedness + warning. + +2005-05-10 H.J. Lu + + * elf.c (_bfd_elf_make_section_from_shdr): Only check debug + section if SEC_ALLOC isn't set. + +2005-05-09 Kelley Cook + + * configure.in: Replace AC_COMPILE_CHECK_SIZEOF with AC_CHECK_SIZEOF. + * acinclude.m4: Don't sinclude accross.m4. + * config.in, configure, Makefile.in, doc/Makefile.in: Regenerate. + +2005-05-09 Alan Modra + + * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add has_dotsym. + (ppc64_elf_add_symbol_hook): Set has_dotsym. + (ppc64_elf_check_directives): Only process syms when has_dotsym. + (func_desc_adjust): Hide fake function descriptors when function + code entry is defined. + (adjust_opd_syms): Adjust for deleted_section becoming union field. + +2005-05-09 Alan Modra + + * elfcode.h (elf_object_p): Add more sanity checks on elf header. + +2005-05-08 Dave Korn + + * coff-tic80.c: Undefine _CONST after system headers to prevent + clash with tic80-specific definition in include/coff/tic80.h + +2005-05-08 H.J. Lu + + PR 939 + * elflink.c (elf_link_output_extsym): Use output_bfd if + h->root.u.def.section is bfd_abs_section_ptr when reporting + error. + +2005-05-07 H.J. Lu + + * elf-bfd.h (elf_backend_data): Update special_sections to + array of pointer to bfd_elf_special_section. + * elf.c (special_sections): Likewise. + * elf32-arm.c (elf32_arm_symbian_special_sections): Likewise. + * elf32-m32r.c (m32r_elf_special_sections): Likewise. + * elf32-m68hc11.c (elf32_m68hc11_special_sections): Likewise. + * elf32-m68hc12.c (elf32_m68hc12_special_sections): Likewise. + * elf32-mcore.c (mcore_elf_special_sections): Likewise. + * elf32-ppc.c (ppc_elf_special_sections): Likewise. + * elf32-sh64.c (sh64_elf_special_sections): Likewise. + * elf32-v850.c (v850_elf_special_sections): Likewise. + * elf32-xtensa.c (elf_xtensa_special_sections): Likewise. + * elf64-alpha.c (elf64_alpha_special_sections): Likewise. + * elf64-hppa.c (elf64_hppa_special_sections): Likewise. + * elf64-ppc.c (ppc64_elf_special_sections): Likewise. + * elf64-sh64.c (sh64_elf64_special_sections): Likewise. + * elfxx-ia64.c (elfNN_ia64_special_sections): Likewise. + * elfxx-mips.c (_bfd_mips_elf_special_sections): Likewise. + * elfxx-mips.h (_bfd_mips_elf_special_sections): Likewise. + + * elf.c (get_special_section): Updated. + +2005-05-07 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Remove got_symbol_offset. + * elfxx-target.h (elf_backend_got_symbol_offset): Delete. + * elflink.c (_bfd_elf_create_got_section): Use zero in place of + got_symbol_offset. + * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Likewise. + * elf32-frv.c (_frv_create_got_section): Likewise. + * elf32-i370.c (i370_elf_finish_dynamic_sections): Delete ppc code. + (elf_backend_got_symbol_offset): Don't define. + * elf64-ppc.c (elf_backend_got_symbol_offset): Don't define. + * elf32-ppc.c (struct ppc_elf_link_hash_table): Add got_header_size + and got_gap. + (ppc_elf_create_got): Tidy. + (ppc_elf_create_dynamic_sections): Don't set SEC_IN_MEMORY for .plt. + (ppc_elf_check_relocs): Reduce string comparisons by using elf.hgot. + (ppc_elf_gc_sweep_hook): Likewise. + (ppc_elf_relocate_section): Likewise. + (ppc_elf_finish_dynamic_symbol): Likewise. + (allocate_got): New function. + (allocate_dynrelocs): Use allocate_got. + (ppc_elf_size_dynamic_sections): Likewise. Delay tlsld_got allocation + so that local got can refcount it. Set got_header_size. + (ppc_elf_relocate_section): Use value of elf.hgot rather than hard- + coded 4. + (ppc_elf_finish_dynamic_sections): Likewise. + (elf_backend_got_symbol_offset): Don't define. + (elf_backend_got_header_size): Ditto. + +2005-05-05 Steve Ellcey + + * configure.in (ACX_HEADER_STRING): New. + * configure: Regenerate. + * config.in: Regenerate. + * sysdep.h (STRING_WITH_STRINGS): Use. + +2005-05-05 H.J. Lu + + * elf.c (_bfd_elf_close_and_cleanup): Only call + _bfd_dwarf2_cleanup_debug_info on bfd_object. + +2005-05-05 H.J. Lu + + * elflink.c (_bfd_elf_provide_section_bound_symbols): Use + "__bss_start" instead of "_edata" as fallback. + +2005-05-05 H.J. Lu + + * bfd-in2.h: Regenerated. + +2005-05-05 Paul Brook + + * config.bfd: Use bfd_elf32_i386_vxworks_vec for i?86-*-vxworks. + * configure.in: Add bfd_elf32_i386_vxworks_vec. i386 targets need + elf-vxworks.lo. + * configure: Regenerate. + * Makefile.am (BFD32_BACKENDS): Add elf-vxworks.lo. + (BFD32_BACKENDS_CFILES): Add elf-vxworks.c. + (elf32-i386.lo): Depend on elf-vxworks.h. + (elf-vxworks.lo): New rule. + * Makefile.in: Regenerate. + * elf-bfd.h (elf_backend_data): Update type of + elf_backend_emit_relocs. + (_bfd_elf_link_output_relocs): Update prototype. + * elflink.c (_bfd_elf_link_output_relocs): Always use + bed->elf_backend_emit_relocs when outputting relocations. + * elfxx-target.h (elf_backend_emit_relocs): Default to + _bfd_elf_link_output_relocs. + * targets.c (bfd_elf32_i386_vxworks_vec): Declare. + (_bfd_target_vector): Add bfd_elf32_i386_vxworks_vec. + * elf32-i386.c: Add elf32-i386-vxworks target BFD. + (elf_i386_plt0_entry): Remove padding. + (elf_i386_pic_plt0_entry): Ditto. + (PLTRESOLVE_RELOCS_SHLIB, PLTRESOLVE_RELOCS): Define. + (PLT_NON_JUMP_SLOT_RELOCS): Define. + (elf_i386_link_hash_table): Add srelplt2, hgot, hplt, is_vxworks and + plt0_pad_byte fields. + (elf_i386_link_hash_table_create): Zero them. + (elf_i386_create_dynamic_sections): Create static relocation section. + (allocate_dynrelocs): Allocate space for static PLT relocations. + (elf_i386_size_dynamic_sections): Save shortcuts to PLT and GOT + symbols. Give PLT symbols function type. Don't strip PLT sections + if we have exported symbols from them. + (elf_i386_finish_dynamic_symbol): Fill in VxWorks PLT static + relocation section. Don't mark _GLOBAL_OFFSET_TABLE_ as absolute on + VxWorks. + (elf_i386_finish_dynamic_sections): Allow different pad bytes. + Add relocation for GOT location. Fill in PLT static relocations. + (elf_i386_vxworks_link_hash_table_create): New function. + (elf_i386_vxworks_link_output_symbol_hook): New function. + * elf-vxworks.h: New file. + +2005-05-05 H.J. Lu + + * section.c (bfd_make_section_anyway_with_flags): New. + (bfd_make_section_anyway): Call bfd_make_section_anyway_with_flags, + (bfd_make_section_with_flags): New. + (bfd_make_section): Call bfd_make_section_with_flags. + + * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Call + bfd_make_section_with_flags/bfd_make_section_anyway_with_flags + instead of bfd_make_section/bfd_make_section and don't call + bfd_set_section_flags. + (mn10300_elf_check_relocs): Likewise. + (_bfd_mn10300_elf_create_dynamic_sections): Likewise. + * elf32-arm.c (create_got_section): Likewise. + (bfd_elf32_arm_add_glue_sections_to_bfd): Likewise. + (elf32_arm_check_relocs): Likewise. + * elf32-cris.c (cris_elf_check_relocs): Likewise. + * elf32-frv.c (elf32_frv_add_symbol_hook): Likewise. + (_frv_create_got_section): Likewise. + (elf32_frvfdpic_create_dynamic_sections): Likewise. + * elf32-hppa.c (elf32_hppa_create_dynamic_sections): Likewise. + (elf32_hppa_check_relocs): Likewise. + * elf32-i370.c (i370_elf_create_dynamic_sections): Likewise. + (i370_elf_check_relocs): Likewise. + * elf32-i386.c (create_got_section): Likewise. + (elf_i386_check_relocs): Likewise. + * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise. + (create_got_section): Likewise. + (m32r_elf_create_dynamic_sections): Likewise. + (m32r_elf_check_relocs): Likewise. + * elf32-m68k.c (elf_m68k_check_relocs): Likewise. + * elf32-ppc.c (ppc_elf_create_got): Likewise. + (ppc_elf_create_dynamic_sections): Likewise. + (ppc_elf_add_symbol_hook): Likewise. + (ppc_elf_check_relocs): Likewise. + * elf32-s390.c (create_got_section): Likewise. + (elf_s390_check_relocs): Likewise. + * elf32-sh.c (create_got_section): Likewise. + (sh_elf_create_dynamic_sections): Likewise. + (sh_elf_check_relocs): Likewise. + * elf32-vax.c (elf_vax_check_relocs): Likewise. + * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise. + * elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Likewise. + (add_extra_plt_sections): Likewise. + * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise. + (elf64_alpha_create_got_section): Likewise. + (elf64_alpha_create_dynamic_sections): Likewise. + (elf64_alpha_check_relocs): Likewise. + * elf64-hppa.c (get_reloc_section): Likewise. + (get_opd): Likewise. + (get_plt): Likewise. + (get_dlt): Likewise. + (get_stub): Likewise. + (elf64_hppa_create_dynamic_sectionso): Likewise. + * elf64-mmix.c (mmix_elf_check_common_relocs): Likewise. + * elf64-ppc.c (create_linkage_sections): Likewise. + (ppc64_elf_check_relocs): Likewise. + * elf64-s390.c (create_got_section): Likewise. + (elf_s390_check_relocs): Likewise. + * elf64-sh64.c (sh_elf64_check_relocs): Likewise. + (sh64_elf64_create_dynamic_sections): Likewise. + * elf64-x86-64.c (create_got_section): Likewise. + (elf64_x86_64_check_relocs): Likewise. + * elflink.c (_bfd_elf_create_got_section): Likewise. + (_bfd_elf_link_create_dynamic_sections): Likewise. + (elf_link_add_object_symbols): Likewise. + * elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Likewise. + (elfNN_ia64_create_dynamic_sections): Likewise. + (get_fptr): Likewise. + (get_pltoff): Likewise. + (get_reloc_section): Likewise. + (elfNN_ia64_object_p): Likewise. + * elfxx-mips.c (mips_elf_rel_dyn_section): Likewise. + (mips_elf_create_compact_rel_section): Likewise. + (mips_elf_create_got_section): Likewise. + (_bfd_mips_elf_create_dynamic_sections): Likewise. + * elfxx-sparc.c (create_got_section): Likewise. + (_bfd_sparc_elf_check_relocs): Likewise. + + * elf.c (_bfd_elf_new_section_hook): Call _bfd_elf_get_sec_type_attr + on linker created sections. + +2005-05-05 H.J. Lu + + PR 882 + * elflink.c (_bfd_elf_link_assign_sym_version): Allow version + script on executable. + +2005-05-05 John Levon + + * dwarf2.c (read_abbrevs): If bfd_realloc fails, free currently + allocated memory before returning. + (decode_line_info): Likewise. + (_bfd_dwarf2_cleanup_debug_info): New function: Frees memory + allocated by functions in this file. + * elf-bfd.h (_bfd_dwarf2_cleanup_debug_info): Prototype. + * elf.c (_bfd_elf_close_and_cleanup): Call + _bfd_dwarf2_cleanup_debug_info. + +2005-05-05 Hans-Peter Nilsson + + * Makefile.am (INCLUDES): Don't -D_GNU_SOURCE here. + * configure.in: Call AC_GNU_SOURCE here, after AC_PROG_CC. + * configure, config.in, Makefile.in: Regenerate. + * sysdep.h (stpcpy): Revert last change. + +2005-05-05 Hans-Peter Nilsson + + * sysdep.h (stpcpy): Wrap declaration in parentheses. + +2005-05-04 H.J. Lu + + * elfxx-ia64.c (ARCH_SIZE): New. + (LOG_SECTION_ALIGN): Likewise. + (elfNN_ia64_create_dynamic_sections): Use LOG_SECTION_ALIGN to + align relocation sections. + (get_fptr): Likewise. + (get_reloc_section): Likewise. + (elfNN_ia64_tprel_base): Likewise. + (elfNN_ia64_check_relocs): Support 32bit relocations. + (allocate_global_fptr_got): Likewise. + (allocate_dynrel_entries): Likewise. + (set_got_entry): Likewise. + (set_pltoff_entry): Likewise. + (elfNN_ia64_relocate_section): Likewise. + +2005-05-04 H.J. Lu + + * configure.in: Add AC_CHECK_DECLS(stpcpy). + * configure: Regenerate. + * config.in: Likewise. + + * sysdep.h (stpcpy): New. + +2005-05-04 Nick Clifton + + * Update the address and phone number of the FSF organization in + the GPL notices in the following files: + aix386-core.c, aix5ppc-core.c, aout-adobe.c, aout-arm.c, + aout-cris.c, aout-ns32k.c, aout-sparcle.c, aout-target.h, + aout-tic30.c, aout0.c, aout32.c, aout64.c, aoutf1.h, aoutx.h, + archive.c, archive64.c, archures.c, armnetbsd.c, bfd-in.h, + bfd-in2.h, bfd.c, bfdio.c, bfdwin.c, binary.c, bout.c, cache.c, + cf-i386lynx.c, cf-m68klynx.c, cf-sparclynx.c, cisco-core.c, + coff-a29k.c, coff-alpha.c, coff-apollo.c, coff-arm.c, coff-aux.c, + coff-go32.c, coff-h8300.c, coff-h8500.c, coff-i386.c, coff-i860.c, + coff-i960.c, coff-ia64.c, coff-m68k.c, coff-m88k.c, coff-maxq.c, + coff-mcore.c, coff-mips.c, coff-or32.c, coff-pmac.c, coff-ppc.c, + coff-rs6000.c, coff-sh.c, coff-sparc.c, coff-stgo32.c, + coff-svm68k.c, coff-tic30.c, coff-tic4x.c, coff-tic54x.c, + coff-tic80.c, coff-u68k.c, coff-w65.c, coff-we32k.c, coff-z8k.c, + coff64-rs6000.c, coffcode.h, coffgen.c, cofflink.c, coffswap.h, + corefile.c, cpu-a29k.c, cpu-alpha.c, cpu-arc.c, cpu-arm.c, + cpu-avr.c, cpu-cr16c.c, cpu-cris.c, cpu-crx.c, cpu-d10v.c, + cpu-d30v.c, cpu-dlx.c, cpu-fr30.c, cpu-frv.c, cpu-h8300.c, + cpu-h8500.c, cpu-hppa.c, cpu-i370.c, cpu-i386.c, cpu-i860.c, + cpu-i960.c, cpu-ia64-opc.c, cpu-ia64.c, cpu-ip2k.c, cpu-iq2000.c, + cpu-m10200.c, cpu-m10300.c, cpu-m32r.c, cpu-m68hc11.c, + cpu-m68hc12.c, cpu-m68k.c, cpu-m88k.c, cpu-maxq.c, cpu-mcore.c, + cpu-mips.c, cpu-mmix.c, cpu-msp430.c, cpu-ns32k.c, cpu-openrisc.c, + cpu-or32.c, cpu-pdp11.c, cpu-pj.c, cpu-powerpc.c, cpu-rs6000.c, + cpu-s390.c, cpu-sh.c, cpu-sparc.c, cpu-tic30.c, cpu-tic4x.c, + cpu-tic54x.c, cpu-tic80.c, cpu-v850.c, cpu-vax.c, cpu-w65.c, + cpu-we32k.c, cpu-xstormy16.c, cpu-xtensa.c, cpu-z8k.c, demo64.c, + dwarf1.c, dwarf2.c, ecoff.c, ecofflink.c, ecoffswap.h, + efi-app-ia32.c, efi-app-ia64.c, elf-bfd.h, elf-eh-frame.c, + elf-hppa.h, elf-m10200.c, elf-m10300.c, elf-strtab.c, elf.c, + elf32-am33lin.c, elf32-arc.c, elf32-arm.c, elf32-avr.c, + elf32-cr16c.c, elf32-cris.c, elf32-crx.c, elf32-d10v.c, + elf32-d30v.c, elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-gen.c, + elf32-h8300.c, elf32-hppa.c, elf32-hppa.h, elf32-i370.c, + elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c, + elf32-iq2000.c, elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, + elf32-m68hc1x.c, elf32-m68hc1x.h, elf32-m68k.c, elf32-m88k.c, + elf32-mcore.c, elf32-mips.c, elf32-msp430.c, elf32-openrisc.c, + elf32-or32.c, elf32-pj.c, elf32-ppc.c, elf32-ppc.h, elf32-s390.c, + elf32-sh-symbian.c, elf32-sh.c, elf32-sh64-com.c, elf32-sh64.c, + elf32-sh64.h, elf32-sparc.c, elf32-v850.c, elf32-vax.c, + elf32-xstormy16.c, elf32-xtensa.c, elf32.c, elf64-alpha.c, + elf64-gen.c, elf64-hppa.c, elf64-hppa.h, elf64-mips.c, + elf64-mmix.c, elf64-ppc.c, elf64-ppc.h, elf64-s390.c, + elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elf64.c, elfcode.h, + elfcore.h, elflink.c, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c, + elfxx-mips.h, elfxx-sparc.c, elfxx-sparc.h, elfxx-target.h, + epoc-pe-arm.c, epoc-pei-arm.c, format.c, freebsd.h, gen-aout.c, + genlink.h, hash.c, host-aout.c, hp300bsd.c, hp300hpux.c, + hppabsd-core.c, hpux-core.c, i386aout.c, i386bsd.c, i386dynix.c, + i386freebsd.c, i386linux.c, i386lynx.c, i386mach3.c, i386msdos.c, + i386netbsd.c, i386os9k.c, ieee.c, ihex.c, init.c, irix-core.c, + libaout.h, libbfd-in.h, libbfd.c, libbfd.h, libcoff-in.h, + libcoff.h, libecoff.h, libhppa.h, libieee.h, libnlm.h, liboasys.h, + libpei.h, libxcoff.h, linker.c, lynx-core.c, m68k4knetbsd.c, + m68klinux.c, m68klynx.c, m68knetbsd.c, m88kmach3.c, m88kopenbsd.c, + mach-o-target.c, mach-o.c, mach-o.h, merge.c, mipsbsd.c, mmo.c, + netbsd-core.c, netbsd.h, newsos3.c, nlm-target.h, nlm.c, + nlm32-alpha.c, nlm32-i386.c, nlm32-ppc.c, nlm32-sparc.c, nlm32.c, + nlm64.c, nlmcode.h, nlmswap.h, ns32k.h, ns32knetbsd.c, oasys.c, + opncls.c, osf-core.c, pc532-mach.c, pdp11.c, pe-arm.c, pe-i386.c, + pe-mcore.c, pe-mips.c, pe-ppc.c, pe-sh.c, peXXigen.c, + pef-traceback.h, pef.c, pef.h, pei-arm.c, pei-i386.c, pei-mcore.c, + pei-mips.c, pei-ppc.c, pei-sh.c, peicode.h, ppcboot.c, + ptrace-core.c, reloc.c, reloc16.c, riscix.c, rs6000-core.c, + sco5-core.c, section.c, simple.c, som.c, som.h, sparclinux.c, + sparclynx.c, sparcnetbsd.c, srec.c, stab-syms.c, stabs.c, sunos.c, + syms.c, sysdep.h, targets.c, tekhex.c, ticoff.h, trad-core.c, + vax1knetbsd.c, vaxbsd.c, vaxnetbsd.c, versados.c, vms-gsd.c, + vms-hdr.c, vms-misc.c, vms-tir.c, vms.c, vms.h, xcoff-target.h, + xcofflink.c, xsym.c, xsym.h, xtensa-isa.c, xtensa-modules.c, + hosts/alphavms.h + +2005-05-04 H.J. Lu + + * bfd-in.h (_bfd_elf_provide_section_bound_symbols): New. + * bfd-in2.h: Regenerated. + + * elflink.c (bfd_elf_set_symbol): New. + (_bfd_elf_provide_symbol): Call it. + (_bfd_elf_provide_section_bound_symbols): New. + +2005-05-04 H.J. Lu + + * elflink.c (_bfd_elf_merge_symbol): Only skip weak definitions + at the end, if a strong definition has already been seen. + +2005-05-04 Alan Modra + + * section.c (struct bfd_section): Replace link_order_head and + link_order_tail with map_head and map_tail union. + (STD_SECTION): Update. + (_bfd_strip_section_from_output): Delete. + * aoutx.h: Update throughout for above changes. + * coff-ppc.c: Likewise. + * cofflink.c: Likewise. + * ecoff.c: Likewise. + * elf-eh-frame.c: Likewise. + * elf-m10300.c: Likewise. + * elf.c: Likewise. + * elf32-arm.c: Likewise. + * elf32-cris.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68hc1x.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-vax.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-x86-64.c: Likewise. + * elflink.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * elfxx-sparc.c: Likewise. + * linker.c: Likewise. + * merge.c: Likewise. + * pdp11.c: Likewise. + * xcofflink.c: Likewise. + * elflink.c (bfd_boolean bfd_elf_size_dynsym_hash_dynstr): Split + out from bfd_elf_size_dynamic_sections. + * bfd-in.h (bfd_boolean bfd_elf_size_dynsym_hash_dynstr): Declare. + * bfd-in2.h: Regenerate. + +2005-05-04 Alan Modra + + * section.c (bfd_section_list_remove): Don't clear s->next. + (bfd_section_list_append): Always init s->prev. + (bfd_section_list_prepend): Define. + (bfd_section_list_insert_after): Minor optimization. + (bfd_section_removed_from_list): Rewrite. + * elf.c (assign_section_numbers): Simplify list traversal now that + bfd_section_list_remove doesn't destroy removed section next ptr. + * sunos.c (sunos_add_dynamic_symbols): Likewise. + * elfxx-ia64.c (elfNN_ia64_object_p): Use bfd_section_list_prepend. + * xcofflink.c (_bfd_xcoff_bfd_final_link): Simplify list traversal. + * bfd-in2.h: Regenerate. + +2005-05-02 H.J. Lu + + * bfd.c (bfd): Remove section_tail and add section_last. + (bfd_preserve): Likewise. + (bfd_preserve_save): Likewise. + (bfd_preserve_restore): Likewise. + * opncls.c (_bfd_new_bfd): Likewise. + + * coffcode.h (coff_compute_section_file_positions): Updated. + (coff_compute_section_file_positions): Likewise. + * elf.c (assign_section_numbers): Likewise. + * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise. + * elf64-mmix.c (mmix_elf_final_link): Likewise. + * elfxx-ia64.c (elfNN_ia64_object_p): Likewise. + * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise. + * sunos.c (sunos_add_dynamic_symbols): Likewise. + * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise. + + * ecoff.c (bfd_debug_section): Initialize prev. + + * section.c (bfd_section): Add prev. + (bfd_section_list_remove): Updated. + (bfd_section_list_append): New. + (bfd_section_list_insert_after): New. + (bfd_section_list_insert_before): New. + (bfd_section_list_insert): Removed. + (bfd_section_removed_from_list): Updated. + (STD_SECTION): Initialize prev. + (bfd_section_init): Updated. + (bfd_section_list_clear): Updated. + + * bfd-in2.h: Regenerated. + +2005-05-02 H.J. Lu + + * elf.c (_bfd_elf_new_section_hook): Don't call + _bfd_elf_get_sec_type_attr on sections from input files. + +2005-05-02 H.J. Lu + + * merge.c (sec_merge_init): Call bfd_hash_table_init_n with + hash table size 16699 instead of bfd_hash_table_init. + +2005-05-01 Paul Brook + + * elflink.c (_bfd_elf_merge_symbol): Skip weak definitions if a strong + definition has already been seen. + +2005-05-01 Paul Brook + + * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Treat + R_ARM_PLT32 the same as R_ARM_PC24. + (arm_add_to_rel): Ditto. + +2005-04-29 Ralf Corsepius + + * config.bfd: Add h8300*-*-rtemscoff. + Switch h8300*-*-rtems* to elf. + +2005-04-29 Daniel Jacobowitz + + * aclocal.m4, Makefile.in: Regnerated. + +2005-04-28 Paul Brook + + Merge changes only applied to Makefile.in. + * Makefile.am (BFD32_BACKENDS): Add elfxx-sparc.lo + (BFD32_BACKENDS_CFILES): Add elfxx-sparc.c + (elfxx-sparc.lo): New rule. + (elf32-sparc.lo): Add elfxx-sparc.h dependency. + (elf64-sparc.lo): Likewise. + +2005-04-28 Julian Brown + + * elflink.c (_bfd_elf_provide_symbol): Provide symbol for weak + import. + +2005-04-27 H.J. Lu + + * elf-bfd.h (bfd_elf_sym_name): Also take "asection *". + + * elf.c (bfd_elf_sym_name): Updated. + (group_signature): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_edit_opd): Likewise. + (ppc64_elf_edit_toc): Likewise. + (ppc64_elf_relocate_section): Likewise. + * elfcode.h (elf_slurp_symbol_table): Likewise. + * elflink.c (elf_link_input_bfd): Likewise. + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Call + bfd_elf_sym_name to get local symbol name when reporting errors. + +2005-04-27 Nick Clifton + + * elflink.c (elf_link_input_bfd): Handle the case where a badly + formatted input file results in a reloc which has no associated + global symbol. + +2005-04-26 Jerome Guitton + + * bfd.m4 (BFD_NEED_DECLARATION): Restore. + +2005-04-25 David S. Miller + + * elfxx-sparc.c (sparc_elf_append_rela_64): Add BFD64 protection. + (sparc_elf_r_info_64, _bfd_sparc_elf_finish_dynamic_symbol, + sparc64_finish_dyn, _bfd_sparc_elf_finish_dynamic_sections): + Likewise. + +2005-04-25 H.J. Lu + + PR 858 + * elflink.c (elf_link_input_bfd): Make non-debugging reference + to discarded section an error. + +2005-04-21 Jerome Guitton + + * configure.in: Replace BFD_NEED_DECLARATION checks by the + corresponding AC_CHECK_DECLS. + * sysdep.h: Replace NEED_DECLARATION_* checks by the corresponding + HAVE_DECL_*. + * bfd.m4 (BFD_NEED_DECLARATION): Remove, obsolete. + * configure: Regenerate. + * config.in: Ditto. + +2005-04-21 Andreas Schwab + + * elfxx-sparc.h (struct _bfd_sparc_elf_link_hash_table): Remove + unsigned from type of dynamic_interpreter. + * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create): Remove + casts again. + + * elf.c (assign_section_numbers): Fix comment. + +2005-04-21 Jerome Guitton + + * som.c (som_bfd_print_private_bfd_data): Add explicit cast to long + for struct som_exec_auxhdr fields. + +2005-04-21 Nick Clifton + + * aout-adobe.c: Convert to ISO C and fix formatting. + * aout-arm.c: Convert to ISO C and fix formatting. + * aout-cris.c: Convert to ISO C and fix formatting. + * aout-ns32k.c: Convert to ISO C and fix formatting. + * aout-tic30.c: Convert to ISO C and fix formatting. + * coffcode.h: Convert to ISO C and fix formatting. + * coffswap.h: Convert to ISO C and fix formatting. + * i386aout.c: Convert to ISO C and fix formatting. + * libaout.h: Convert to ISO C and fix formatting. + * libcoff-in.h: Convert to ISO C and fix formatting. + * libcoff.h: Convert to ISO C and fix formatting. + * libecoff.h: Convert to ISO C and fix formatting. + * libnlm.h: Convert to ISO C and fix formatting. + * libpei.h: Convert to ISO C and fix formatting. + * libxcoff.h: Convert to ISO C and fix formatting. + * nlm-target.h: Convert to ISO C and fix formatting. + * nlm.c: Convert to ISO C and fix formatting. + * nlm32-alpha.c: Convert to ISO C and fix formatting. + * nlm32-i386.c: Convert to ISO C and fix formatting. + * nlm32-ppc.c: Convert to ISO C and fix formatting. + * nlm32-sparc.c: Convert to ISO C and fix formatting. + * nlmcode.h: Convert to ISO C and fix formatting. + * nlmswap.h: Convert to ISO C and fix formatting. + * pe-mips.c: Convert to ISO C and fix formatting. + * peXXigen.c: Convert to ISO C and fix formatting. + * peicode.h: Convert to ISO C and fix formatting. + * vms-gsd.c: Convert to ISO C and fix formatting. + * vms-hdr.c: Convert to ISO C and fix formatting. + * vms-misc.c: Convert to ISO C and fix formatting. + * vms-tir.c: Convert to ISO C and fix formatting. + * vms.c: Convert to ISO C and fix formatting. + * vms.h: Convert to ISO C and fix formatting. + + * coffgen.c (coff_print_symbol): Restore correct formatting of + output. + +2005-04-20 David S. Miller + + * elfxx-sparc.c (sparc_elf_r_symndx_64): Fix compiler warning. + (_bfd_sparc_elf_link_hash_table_create): Likewise. + (allocate_dynrelocs): Likewise. + +2005-04-20 Jerome Guitton + + * configure.in: Fix the check for basename declaration. Add check + for declarations of ftello, ftello64, fseeko, fseeko64. + * configure: Regenerate. + * config.in: Ditto. + * sysdep.h: If needed, declare ftello, ftello64, fseeko, fseeko64. + +2005-04-19 David S. Miller + + * elfxx-sparc.c: New file. + * elfxx-sparc.h: New file. + * Makefile.in (BFD32_BACKENDS): Add elfxx-sparc.lo + (BFD32_BACKENDS_CFILES): Add elfxx-sparc.c + (elfxx-sparc.lo): New rule. + (elf32-sparc.lo): Add elfxx-sparc.h dependency. + (elf64-sparc.lo): Likewise. + * configure.in (bfd_elf32_sparc_vec): Add elfxx-sparc.lo + (bfd_elf64_sparc_vec): Likewise. + * configure: Regenerate. + * elf32-sparc.c: Remove common code now in elfxx-sparc.c + * elf64-sparc.c: Likewise, also use elf64_sparc_*() naming + which is more consistent with elf32-sparc.c + +2005-04-19 Daniel Jacobowitz + + * elfxx-mips.c (struct mips_elf_link_hash_entry): Update comment. + (mips_elf_create_local_got_entry): Check h->root.forced_local. + +2005-04-19 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Don't bother with + dynamic relocs in non-SEC_ALLOC sections. + (ppc_elf_gc_sweep_hook): Likewise. + (ppc_elf_relax_section): Likewise. + (ppc_elf_relocate_section): Likewise. + +2005-04-18 Nick Clifton + + * aix5ppc-core.c (xcoff64_core_p): Fix compile time warning + assigning a value to return_value. + +2005-04-17 H.J. Lu + + PR 855 + * elf.c (_bfd_elf_copy_private_section_data): Don't copy linker + created group data. + +2005-04-17 H.J. Lu + + PR 855 + * elf.c (setup_group): Properly handle zero group count. + +2005-04-17 Mark Kettenis + + * som.c (hppa_som_reloc, som_mkobject, som_is_space) + (som_is_subspace, compare_subspaces, som_compute_checksum) + (som_build_and_write_symbol_table, som_slurp_symbol_table): New + protoypes. + (hppa_som_reloc, compare_syms, compare_subspaces) + (som_print_symbol, som_get_section_contents) + (som_set_section_contents): Remove space after 'void *'. + (som_bfd_print_private_bfd_data): Use %lx to print longs. + (som_bfd_merge_private_bfd_data) + (som_bfd_copy_private_header_data, som_bfd_set_private_flags): New + defines. + +2005-04-15 Julian Brown + + * bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype. + * bfd-in2.h: Regenerate. + * elf32-arm.c (elf32_arm_link_hash_table): New field, 'use_blx'. + (elf32_arm_link_hash_table_create): Initialise fix_v4bx, use_blx. + (bfd_elf32_arm_set_target_relocs): Handle use_blx. + (elf32_arm_final_link_relocate): Use Thumb BLX for R_ARM_THM_PC22 + relocations if requested to. + (allocate_dynrelocs): Don't count size of omitted Thumb stubs based on + use_blx rather than symbian_p. + (elf32_arm_finish_dynamic_symbol): Don't output Thumb PLT stubs if + use_blx is in effect. + (elf32_arm_symbian_link_hash_table_create): Enable use_blx by default + for SymbianOS. + +2005-04-15 Nick Clifton + + * coffgen.c (coff_print_symbol): Use fprintf_vma to print vma + values. + +2005-04-15 Alan Modra + + PR ld/815 + * elflink.c (elf_smash_syms): Clear undef.next if it's not being + used as a list pointer. + +2005-04-14 Alan Modra + + * Makefile.am (NO_WERROR): Define. + * warning.m4: New file + * acinclude.m4: Include warning.m4. + * configure.in: Invoke AM_BINUTILS_WARNINGS. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2005-04-14 Alan Modra + + * merge.c (sec_merge_emit): Tidy. Check for bfd_zmalloc errors. + Write trailing padding. + + * merge.c (merge_strings): Round up section size for alignment. + +2005-04-14 David S. Miller + + Add TLS support for 64-bit Sparc ELF. + * elf64-sparc.c (sparc64_elf_dyn_relocs, + sparc64_elf_link_hash_entry, sparc64_elf_obj_tdata): New structs. + (GOT_UNKNOWN, GOT_NORMAL, GOT_TLD_GD, GOT_TLD_IE, + sparc64_elf_hash_entry, sparc64_elf_tdata, + sparc64_elf_local_got_tls_type): New defines. + (sparc64_elf_mkobject): New function. + (sparc64_elf_link_hash_table): Add members for dynamic linker + sections PLT, RELPLT, DYNBSS, and RELBSS. Add tls_ldm_got + uion to track TLS GOT references. Add sym_sec to cache + mappings from local sym to section. + (link_hash_newfunc): New function. + (sparc64_elf_bfd_link_hash_table_create): Rename to + sparc64_elf_link_hash_table_create for consistency. + Pass link_hash_newfunc to _bfd_elf_link_hash_table_init. + (sparc64_elf_create_dynamic_sections): Initialize new section + members of sparc64_elf_link_hash_table. Only init srelbss + if not-shared. + (sparc64_elf_copy_indirect_symbol, sparc64_elf_tls_transition): + New functions. + (SPARC_NOP): Define. + (sparc64_elf_build_plt, sparc64_elf_plt_entry_offset, + sparc64_elf_plt_ptr_offset): Delete. + (sparc64_plt_entry_build): New function to build PLT entries + gradually instread of all at once at the end of linking. + (sparc64_elf_check_relocs): Delete dynobj, sgot, and srelgot + local vars. Get them from sparc64_elf_hash_table instead. + Check early on if r_symndx is in bounds. Handle TLS transitions. + Account for TLS GOT references and DF_STATIC_TLS, as needed. + For TLS relocs, record the tls_type in either + sparc64_elf_local_got_tls_type or sparc64_elf_hash_entry as + appropriate. For R_SPARC_TLS_{GD,LDM}_CALL, emit a reference + to the __tls_get_addr symbol. For PLT relocs, track references + via h->plt.refcount. When R_SPARC_{PC10,PC22,PC_HH22,PC_HM10, + PC_LM22} and h not-NULL, set h->non_got_ref. For global data + symbol references, count the number of relocations needed for + that symbol. For default switch case, don't error, this lets + the TLS relocs not explicitly handled by this function get + accepted. + (sparc64_elf_gc_mark_hook, sparc64_gc_sweep_hook): New functions. + (sparc64_elf_adjust_dynamic_symbol): Remove dynobj local var, get + it from sparc64_elf_hash_table. Store the real PLT offset + in h->plt.offset, and build PLT entries one at a time. Also + get .dynbss section pointer from htab. + (allocate_dynrelocs, readonly_dynrelocs, + sparc64_omit_section_dynsym): New functions. + (sparc64_elf_omit_section_dynsym): Use these new functions as + helpers. + (dtpoff_base, tpoff): New functions. + (sparc64_elf_relocate_section): Kill dynobj, sgot, and splt + locals, get them from sparc64_elf_hash_table. Handle TLS + relocations and refcounting in main relocation loop. + (sparc64_elf_finish_dynamic_symbol): Use + sparc64_elf_link_hash_table. Build PLT entries as we see + them. Handle TLS GOT relocations. + (sparc64_elf_finish_dynamic_sections): Get sgot and dynobj + from sparc64_elf_hash_table. Initialize only PLT header + not all entries since we not build PLT entries one by one. + (elf_backend_copy_indirect_symbol, bfd_elf64_mkobject, + elf_backend_gc_mark_hook, elf_backend_gc_sweep_hook, + elf_backend_can_gc_sections, elf_backend_can_refcount): Define. + +2005-04-13 Daniel Jacobowitz + + * elflink.c (elf_link_input_bfd): Update check for removed + sections. + +2005-04-12 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * libcoff.h: Regenerate. + +2005-04-11 H.J. Lu + + * linker.c (_bfd_generic_link_output_symbols): Also check if + the output section of an input section has been removed from + the output file. + + * section.c (bfd_section_list_remove): Clear the next field + of the removed section. + (bfd_section_removed_from_list): New. + * bfd-in2.h: Regenerated. + +2005-04-11 David S. Miller + + * elf32-sparc.c (elf32_sparc_relocate_section, + R_SPARC_TLS_LDO_{HIX22,LOX10}): When not shared, transition to + R_SPARC_TLS_LE_{HIX22,LOX10}. + (elf32_sparc_relocate_section, R_SPARC_TLS_{LDO,LE}_HIX22): Only + xor relocation with 0xffffffff if R_SPARC_TLS_LE_HIX22. + (elf32_sparc_relocate_section, R_SPARC_TLS_{LDO,LE}_LOX10): Only + or 0x1c00 into relocation if R_SPARC_TLS_LE_HIX22. + +2005-04-11 H.J. Lu + + * coffcode.h (STRING_SIZE_SIZE): Updated to match libcoff-in.h. + +2005-04-11 Nick Clifton + + * aout-target.h: Convert to ISO C. + * aoutf1.h: Convert to ISO C. + * aoutx.h: Convert to ISO C. + * bout.c: Convert to ISO C. + * dwarf1.c: Convert to ISO C. + * ecoffswap.h: Convert to ISO C. + * freebsd.h: Convert to ISO C. + * genlink.h: Convert to ISO C. + * ieee.c: Convert to ISO C. + * ihex.c: Convert to ISO C. + * libcoff-in.h: Convert to ISO C. + * mach-o.c: Convert to ISO C. + * mach-o.h: Convert to ISO C. + * netbsd.h: Convert to ISO C. + * ns32k.h: Convert to ISO C. + * ns32knetbsd.c: Convert to ISO C. + * oasys.c: Convert to ISO C. + * pdp11.c: Convert to ISO C. + * pef-traceback.h: Convert to ISO C. + * pef.c: Convert to ISO C. + * pef.h: Convert to ISO C. + * riscix.c: Convert to ISO C. + * som.c: Convert to ISO C. + * som.h: Convert to ISO C. + * srec.c: Convert to ISO C. + * stabs.c: Convert to ISO C. + * sunos.c: Convert to ISO C. + * tekhex.c: Convert to ISO C. + * versados.c: Convert to ISO C. + * version.h: Convert to ISO C. + * xcoff-target.h: Convert to ISO C. + * xcofflink.c: Convert to ISO C. + * xsym.c: Convert to ISO C. + * xsym.h: Convert to ISO C. + +2005-04-08 Paul Brook + + * elf32-arm.c (ARM2THUMB_GLUE_SIZE): Rename... + (ARM2THUMB_STATIC_GLUE_SIZE): ... to this. + (ARM2THUMB_PIC_GLUE_SIZE): Define. + (a2t1p_ldr_insn, a2t2p_add_pc_insn, a2t3p_bx_r12_insn): Add. + (elf32_arm_to_thumb_stub): Create PIC stubs. + (record_arm_to_thumb_glue): Use different stub size for relocatable + images. + +2005-04-05 Alan Modra + + * elf64-ppc.c (dec_dynrel_count): New function split out from + ppc64_elf_edit_toc, with additional code from ppc64_elf_edit_opd. + (ppc64_elf_edit_toc, ppc64_elf_edit_opd): Use it. + (ppc64_elf_tls_optimize): Likewise. + +2005-04-05 Mark Kettenis + + * netbsd-core.c (SPARC_WCOOKIE_OFFSET): Renamed from + CORE_WCOOKIE_OFFSET. + (SPARC64_WCOOKIE_OFFSET): New. + (netbsd_core_file_p): Provide .wcookie section for OpenBSD/sparc64. + +2005-04-05 Nick Clifton + + * po/rw.po: New translation: Kinyarwanda + * configure.in (ALL_LINGUAS): Add rw + * configure: Regenerate. + +2005-04-05 Richard Sandiford + + * elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME_P): New macro. + (_bfd_mips_elf_section_from_shdr): Use it to check for recognized + SHT_MIPS_OPTIONS names. Allow all sections with unrecognised + section flags. + (_bfd_mips_elf_fake_sections): Use MIPS_ELF_OPTIONS_SECTION_NAME_P + to check for SHT_MIPS_OPTIONS sections. + (_bfd_mips_elf_set_section_contents): Likewise. + +2005-04-04 Eric Christopher + + * elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents): + Clean up gp handling code. + +2005-04-04 H.J. Lu + + * elf.c (bfd_elf_set_group_contents): Ignore linker created + group section. + (assign_section_numbers): Accept link_info. Check SHT_GROUP + sections for relocatable files only. Remove the linker created + group sections. + (_bfd_elf_compute_section_file_positions): Pass link_info to + assign_section_numbers. + + * elfxx-ia64.c (elfNN_ia64_object_p): New. + (elf_backend_object_p): Defined. + +2005-04-04 H.J. Lu + + * elf-bfd.h (elf_section_data): Use (sec) instead of sec. + +2005-04-03 Fred Fish + + * dwarf2.c (struct dwarf2_debug): Add dwarf_ranges_buffer and + dwarf_ranges_size members. + (struct comp_unit): Add base_address member. + (struct funcinfo): Replace low/high members with an arange. + (arange_add): Replace incoming "unit" parameter with "abfd" and + "first_arange" pointers. Reorganize/rewrite function body. + (decode_line_info): Change arange_add call to pass bfd and arange + pointers. + (lookup_address_in_line_info_table): Use arange list instead of + individual low/high members. Walk function's arange list to find + lowest PC in list, to test for overlapping functions. + (read_debug_ranges): New function, reads the debug_ranges section. + (lookup_address_in_function_table): Use arange list instead of + individual low/high members. Rewrite to find smallest range that + matches. + (read_rangelist): Read a given rangelist from debug_ranges. + (scan_unit_for_functions): Use arange list instead of individual + low/high members. Handle a DW_AT_ranges attribute. + (parse_comp_unit): Use arange list instead of individual low/high + members. Save comp unit base address. Handle a DW_AT_ranges + attribute. + +2005-04-01 H.J. Lu + + * elf.c (assign_section_numbers): Really use the kept section. + +2005-03-31 H.J. Lu + + * elf-bfd.h (_bfd_elf_check_kept_section): New. + + * elf.c (assign_section_numbers): When sh_link points to a + discarded section, call _bfd_elf_check_kept_section to see if + the kept section can be used. Otherwise reject sh_link + pointing to discarded section. + + * elflink.c (_bfd_elf_check_kept_section): New. + (elf_link_input_bfd): Use it. + +2005-04-01 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_toc): Account for dynamic relocs + that we no longer need. + +2005-04-01 Alan Modra + + * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Return -1 on errors + rather than 0. + (ppc64_elf_check_relocs): Remove unnecessary SEC_ALLOC check. + +2005-03-31 H.J. Lu + + * elf.c (assign_section_numbers): Fix a typo. + +2005-03-31 H.J. Lu + + * elflink.c (elf_link_input_bfd): Remove the extra `\n' in + error message. + (_bfd_elf_section_already_linked): Likewise. + +2005-03-31 Jerome Guitton + + * config.in: Regenerate. + +2005-03-31 Jerome Guitton + + * config.in (HAVE_DECL_BASENAME): New configure macro. + * configure.in: Check for basename. + * configure: Regenerate. + +2005-03-30 Julian Brown + + * bfd-in.h (bfd_is_arm_mapping_symbol_name): Rename from + bfd_elf32_is_arm_mapping_symbol_name. + * bfd-in2.h: Regenerate. + * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Rename from + bfd_elf32_is_arm_mapping_symbol_name. + * elf32-arm.c (elf32_arm_is_target_special_symbol): Rename + bfd_elf32_is_arm_mapping_symbol_name to bfd_is_arm_mapping_symbol_name. + (arm_elf_find_function): Likewise. + (elf32_arm_output_symbol_hook): Likewise. + +2005-03-30 Julian Brown + + * bfd-in.h (bfd_elf32_is_arm_mapping_symbol_name): Add prototype. + * bfd-in2.h: Regenerate. + * elf32-arm.c (elf32_arm_is_target_special_symbol): Rename call to + bfd_elf32_is_arm_mapping_symbol_name. + (elf32_arm_output_symbol_hook): Likewise. + (arm_elf_find_function): Likewise, and include STT_NOTYPE in test for + mapping symbols. + (is_arm_mapping_symbol_name): Function moved from here... + * cpu-arm.c (bfd_elf32_is_arm_mapping_symbol_name): ...to here, renamed + and made global. + +2005-03-29 Aaron W. LaFramboise + + * configure.in: Check for ffs decl and alphabetize. + * config.in: Regenerate. + * configure: Regenerate. + * sysdep.h [NEED_DECLARATION_FFS] (ffs): Prototype and alphabetize. + +2005-03-29 Fred Fish + + * dwarf2.c (struct comp_unit): Fix typo. + (scan_unit_for_functions): Remove unused local variable "name" + and dead code that set it. + +2005-03-29 Daniel Jacobowitz + Phil Blundell + + * bfd-in2.h, libbfd.h: Regenerated. + * reloc.c: Add ARM TLS relocations. + * elf32-arm.c (elf32_arm_howto_table): Add dynamic TLS + relocations. + (elf32_arm_tls_gd32_howto, elf32_arm_tls_ldo32_howto) + (elf32_arm_tls_ldm32_howto, elf32_arm_tls_le32_howto) + (elf32_arm_tls_ie32_howto): New. + (elf32_arm_howto_from_type): Support TLS relocations. + (elf32_arm_reloc_map): Likewise. + (elf32_arm_reloc_type_lookup): Likewise. + (TCB_SIZE): Define. + (struct elf32_arm_obj_tdata): New. + (elf32_arm_tdata, elf32_arm_local_got_tls_type): Define. + (elf32_arm_mkobject): New function. + (struct elf32_arm_relocs_copied): Add pc_count. + (elf32_arm_hash_entry, GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD) + (GOT_TLS_IE): Define. + (struct elf32_arm_link_hash_table): Add tls_ldm_got. + (elf32_arm_link_hash_newfunc): Initialize tls_type. + (elf32_arm_copy_indirect_symbol): Copy pc_count and tls_type. + (elf32_arm_link_hash_table_create): Initialize tls_ldm_got. + (dtpoff_base, tpoff): New functions. + (elf32_arm_final_link_relocate): Handle TLS relocations. + (IS_ARM_TLS_RELOC): Define. + (elf32_arm_relocate_section): Warn about TLS mismatches. + (elf32_arm_gc_sweep_hook): Handle TLS relocations and pc_count. + (elf32_arm_check_relocs): Detect invalid symbol indexes. Handle + TLS relocations and pc_count. + (elf32_arm_adjust_dynamic_symbol): Check non_got_ref. + (allocate_dynrelocs): Handle TLS. Bind REL32 relocs to local + calls. + (elf32_arm_size_dynamic_sections): Handle TLS. + (elf32_arm_finish_dynamic_symbol): Likewise. + (bfd_elf32_mkobject): Define. + +2005-03-29 Daniel Jacobowitz + + * elf32-arm.c (elf32_arm_check_relocs): Increment count for all + relocation types. Don't count relocations which will use a PLT. + +2005-03-29 Joel Brobecker + + * elf.c (elfcore_grok_nto_status): Print tid as long. + (elfcore_grok_nto_regs): Likewise. + +2005-03-29 Joel Brobecker + + * irix-core.c: Remove some unnecessary prototypes. + +2005-03-28 Joel Brobecker + + * irix-core.c: Convert to ISO C. + +2005-03-28 Joel Brobecker + + * irix-core.c (do_sections): Replace + by | in expression. + (irix_core_core_file_matches_executable_p): Add ATTRIBUTE_UNUSED + to unused parameters to avoid a compiler warning. + +2005-03-28 Mark Kettenis + + * netbsd-core.c: Convert to ISO C. Fix formatting. + +2005-03-24 Eric Christopher + + * elfxx-mips.c: Revert previous patch. + +2005-03-24 Nick Clifton + + * targets.c (_bfd_target_vector): Only include the + bfd_elf32_ia64_hpux_big_vec vector when building a 64-bit BFD with + all targets enabled. + +2005-03-24 James E Wilson + + * Makefile.am (BFD32_BACKENDS): Delete elf32-ia64.lo. + (BFD64_BACKENDS): Add elf32-ia64.lo. + * Makefile.in: Regenerate. + +2005-03-23 Eric Christopher + + * elfxx-mips.c (MIPS_ELF_READONLY_SECTION): New. + (mips_elf_calculate_relocation): Use. Define DF_TEXTREL + after emitting relocation. + (_bfd_mips_elf_adjust_dynamic_symbol): Ditto. + (_bfd_mips_elf_check_relocs): Remove code to set DF_TEXTREL + and readonly_reloc. + +2005-03-23 Mike Frysinger + Nick Clifton + + * config.bfd: Accept any C library to accompany a GNU Linux + implementation, not just the GNU C library. + * configure.in: Likewise. + * configure: Regenerate. + +2005-03-22 H.J. Lu + + * bfd-in.h (_bfd_elf_provide_symbol): New. + * bfd-in2.h: Regenerated. + + * elf32-ppc.c (set_linker_sym): Moved to elflink.c. + (ppc_elf_set_sdata_syms): Call _bfd_elf_provide_symbol instead + of set_linker_sym. + + * elflink.c (_bfd_elf_provide_symbol): New. Moved and renamed + from elf32-ppc.c. + +2005-03-22 Hans-Peter Nilsson + + * hash.c (strtab_hash_newfunc): Fix typo in allocated size. + +2005-03-22 Bob Wilson + + * xtensa-isa.c (xtensa_opcode_lookup, xtensa_state_lookup, + xtensa_sysreg_lookup_name, xtensa_interface_lookup, + xtensa_funcUnit_lookup): Skip bsearch call if count is zero. + (xtensa_opcode_decode): Rearrange code. + +2005-03-22 Nick Clifton + + * binary.c: Convert to ISO C90 formatting. + * coff-arm.c: Convert to ISO C90 formatting. + * coffgen.c: Convert to ISO C90 formatting. + * elf32-gen.c: Convert to ISO C90 formatting. + * elf64-gen.c: Convert to ISO C90 formatting. + * hash.c: Convert to ISO C90 formatting. + * ieee.c: Convert to ISO C90 formatting. + +2005-03-22 Daniel Jacobowitz + + * elf32-arm.c (elf32_arm_final_link_relocate): Don't fail for + unresolved symbols in R_ARM_NONE relocations. + +2005-03-22 Daniel Jacobowitz + + * elf32-arm.c (elf32_arm_final_link_relocate): Add + UNRESOLVED_RELOC_P argument. Set it appropriately. + (elf32_arm_relocate_section): Update call to + elf32_arm_final_link_relocate. Don't clobber RELOCATION; use + unresolved_reloc instead. + +2005-03-23 Alan Modra + + * elflink.c (elf_link_add_object_symbols): Set SEC_EXCLUDE on + .gnu.warning.* sections. + +2005-03-22 Alan Modra + + * elf32-ppc.c (elf_linker_section_pointers_t): Remove + written_address_p. + (ppc_elf_create_linker_section): Don't try to reuse existing section. + (elf_create_pointer_linker_section): Delete info parm. Don't make + h dynamic. Don't set written_address_p. + (ppc_elf_check_relocs): Adjust ppc_elf_create_linker_section calls. + (bfd_put_ptr): Delete. + (elf_finish_pointer_linker_section): Remove output_bfd and info parms. + Always write section contents. Assert global sym is def_regular. + Use offset bottom bit as a written flag. + (ppc_elf_relocate_section): Adjust elf_finish_pointer_linker_section + calls. + +2005-03-22 Alan Modra + + * elf32-ppc.c (ppc_elf_set_sdata_syms): New function, extracted from.. + (ppc_elf_set_sdata_syms): ..here. Expand comment. Set .sbss start + and end syms. + +2005-03-21 Nick Clifton + + * coff-arm.c (coff_link_hash_entry): Only define for non WINCE + targets. + (t2a1_bx_pc_insn): Likewise. + (t2a2_noop_insn): Likewise. + (t2a3_b_insn): Likewise. + (t2a1_push_insn): Likewise. + (t2a2_ldr_insn): Likewise. + (t2a3_mov_insn): Likewise. + (t2a4_bx_insn): Likewise. + (t2a5_pop_insn): Likewise. + (t2a6_bx_insn): Likewise. + (coff_arm_relocate_section): Only declare the high_address + variable for non WINCE targets. + +2005-03-22 Alan Modra + + * elf32-ppc.c (ppc_elf_add_symbol_hook): Make htab->sbss + SEC_LINKER_CREATED. Attach to dynobj. + (ppc_elf_size_dynamic_sections): Strip htab->sbss if zero size. + +2005-03-21 Alan Modra + + * elf32-ppc.c (struct elf_linker_section): Remove sym_hash and + sym_offset. Add name, bss_name, sym_name, sym_val. + (struct ppc_elf_link_hash_table): Remove sdata and sdata2 pointers. + Add sdata array of elf_linker_section_t. + (ppc_elf_link_hash_table_create): Set name, sym_name, and bss_name. + (enum elf_linker_section_enum): Delete. + (ppc_elf_create_linker_section): Rewrite. Don't create syms here. + (ppc_elf_check_relocs): Delay ppc_elf_create_linker_section until + the special sections are needed. Adjust htab->sdata refs. + Ensure dynobj is set in sreloc code. + (ppc_elf_size_dynamic_sections): Strip sdata sections. + (ppc_elf_set_sdata_syms): New function. + (elf_finish_pointer_linker_section): Use 0x8000 for sym_offset. + (ppc_elf_relocate_section): Adjust references to htab->sdata. Use + sym_val instead of sym_hash. + * elf32-ppc.h (ppc_elf_set_sdata_syms): Declare. + +2005-03-21 Alan Modra + + * elf32-ppc.c (is_ppc_elf_target): Move to linker part of file. + (ppc_elf_merge_private_bfd_data): Likewise. + +2005-03-21 Alan Modra + + * elf32-ppc.c (struct elf_linker_section): Remove rel_section. + (ppc_elf_create_linker_section): Don't create rel_section. + (elf_create_pointer_linker_section): Don't size relocs. + (elf_finish_pointer_linker_section): Remove relative_reloc parm. + Don't generate relocs. + (ppc_elf_relocate_section): Adjust calls to + elf_finish_pointer_linker_section. + +2005-03-21 Alan Modra + + * elf32-ppc.c (is_ppc_elf_target): New function. + (ppc_elf_merge_private_bfd_data): Use it rather than just testing + for bfd_target_elf_flavour. Do this test before endian check. + (ppc_elf_add_symbol_hook): Use is_pcc_elf_target. + (ppc_elf_size_dynamic_sections): Likewise. + +2005-03-20 H.J. Lu + + * elf-bfd.h (elf_backend_data): Add int to + elf_backend_section_from_shdr. + (bfd_elf_section_data): Update comment for this_idx. + (_bfd_elf_make_section_from_shdr): Add int. + * elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise. + + * elf.c (_bfd_elf_make_section_from_shdr): Take section index + and use it to set this_idx in bfd_elf_section_data. + (bfd_section_from_shdr): Pass shindex to + _bfd_elf_make_section_from_shdr. + (_bfd_elf_section_from_bfd_section): Use this_idx in + bfd_elf_section_data to find section index. + + * elf32-arm.c (elf32_arm_section_from_shdr): Take section + index and pass it to _bfd_elf_make_section_from_shdr. + * elf32-i370.c(i370_elf_section_from_shdr): Likewise. + * elf32-ppc.c (ppc_elf_section_from_shdr): Likewise. + * elf32-sh64.c (sh64_backend_section_from_shdr): Likewise. + * elf32-v850.c (v850_elf_section_from_shdr): Likewise. + * elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise. + * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise. + * elf64-x86-64.c (elf64_x86_64_section_from_shdr): Likewise. + * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise. + * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise. + +2005-03-19 Danny Smith + Ross Ridge + + * peicode.h (pe_ILF_build_a_bfd): Strip only one prefix + character in IMPORT_NAME_UNDECORATE and IMPORT_NAME_NOPREFIX + cases. Add comment. + +2005-03-18 H.J. Lu + + * elflink.c (elf_mark_used_section): Remove check for special + sections. + +2005-03-18 Andreas Schwab + + * elfxx-ia64.c (elfNN_ia64_install_value): Change type of insn + from bfd_vma to ia64_insn, remove broken cast. + +2005-03-18 C Jaiprakash + + * elf32-m68k.c (elf_cfv4e_plt0_entry): plt entry for coldfire v4e. + (elf_m68k_adjust_dynamic_symbol,elf_m68k_finish_dynamic_symbol, + elf_m68k_finish_dynamic_sections): Use it. + +2005-03-17 Paul Brook + Dan Jacobowitz + Mark Mitchell + + * elf32-arm.c (elf32_arm_modify_segment_map): New function. + (elf32_arm_additional_program_headers): Likewise. + (elf_backend_modify_segment_map): Define. + (elf_backend_additional_program_headers): Likewise. + (elf32_arm_symbian_modify_segment_map): Use + elf32_arm_modify_segment_map. + +2005-03-18 H.J. Lu + + * elflink.c (elf_mark_used_section): Check bfd_is_const_section + for special sections. + +2005-03-18 Alan Modra + + * elf-bfd.h (_bfd_elf_link_renumber_dynsyms): Delete. + * elflink.c (_bfd_elf_link_renumber_dynsyms): Make static, add + section_sym_count param, and return number of section symbols. + (bfd_elf_size_dynamic_sections): Clear section symbol area of + .dynsym contents. Don't bother calling swap_symbol_out on the + first all-zero dynsym. + (elf_mark_used_section): Formatting. Avoid twiddling flags in + special sections like bfd_abs_section. + (bfd_elf_gc_sections): Spelling fix. + +2005-03-16 Fred Fish + + PR binutils/790 + * dwarf2.c (read_indirect_string): Fix apparent typo, check + dwarf_str_buffer allocation, not dwarf_abbrev_buffer. + +2005-03-16 H.J. Lu + + * elflink.c (elf_mark_used_section): New. + (bfd_elf_gc_sections): Call elf_gc_mark_section for + non-relocatable link if we don't do GC. + +2005-03-16 Nick Clifton + Ben Elliston + + * configure.in (werror): New switch: Add -Werror to the + compiler command line. Enabled by default. Disable via + --disable-werror. + * configure: Regenerate. + +2005-03-16 Nick Clifton + + * ecoff.c: Convert to ISO C90 formatting. + +2005-03-16 Alan Modra + + * elf32-ppc.c: Divide file into general and linker specific + functions. Sort linker functions into roughly the order in which + they are called by the ELF linker code. + +2005-03-16 Alan Modra + + * elf32-ppc.c (ppc_elf_create_linker_section): Set SEC_LINKER_CREATED + on section. Correct comment, and add FIXME. + (ppc_elf_additional_program_headers): Don't bump header count for + interp. Test SEC_ALLOC, not SEC_LOAD, and don't test size. + (ppc_elf_size_dynamic_sections): Don't strip sdata and sdata2, but + do allocate memory if they need it. + +2005-03-15 Mikkel Krautz + + * config.bfd (x86_64-elf): Add target. + +2005-03-15 Alan Modra + + * po/es.po: Commit new Spanish translation. + +2005-03-14 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Set symbo name + for global symbol when reporting overflow. + +2005-03-11 Jakub Jelinek + + * libbfd-in.h (_bfd_ar_spacepad): New prototype. + * libbfd.h: Rebuilt. + * archive.c (_bfd_ar_spacepad): New function. + (_bfd_construct_extended_name_table, _bfd_write_archive_contents, + bsd_write_armap, _bfd_archive_bsd_update_armap_timestamp, + coff_write_armap): Use it. + (bfd_ar_hdr_from_filesystem): Likewise. Fix HP-UX large + uid/gid support. + * archive64.c (bfd_elf64_archive_write_armap): Use _bfd_ar_spacepad. + +2005-03-10 Mark Kettenis + + * archive.c (_bfd_look_for_bfd_in_cache): Move declaration of + has_table to the start of the function. + +2005-03-10 Ben Elliston + + * archive.c: Include hashtab.h. + (struct ar_cache): Rename `arelt' to `arbfd' and remove `next'. + (_bfd_look_for_bfd_in_cache): Reimplement using htab_find. + (hash_file_ptr): New function. + (eq_file_ptr): Likewise. + (_bfd_add_bfd_to_archive_cache): Reimplement using a hash table. + * libbfd-in.h: Include hashtab.h. + (struct artdata): Change `cache' member type to htab_t. + * libbfd.h: Rebuild. + +2005-03-08 Daniel Jacobowitz + + * configure.in: Bump version to 2.16.90. + * configure: Regenerated. + +2005-03-07 Jakub Jelinek + + * opncls.c (opncls_bread, opncls_bclose): Fix if pread resp. + close is a function like macro in system headers. + +2005-03-07 Alan Modra + + PR ld/778 + * elf32-hppa.c (elf32_hppa_create_dynamic_sections): Reinstate + _GLOBAL_OFFSET_TABLE_ as a normal dynamic symbol. + +2005-03-06 Alan Modra + + * elf.c (elfcore_grok_win32pstatus): Warning fixes. + +2005-03-05 Alan Modra + + * po/bfd.pot: Regenerate. + +2005-03-05 Alan Modra + + * elf64-ppc.c (update_plt_info): Don't mark new ABI call syms + with is_func. + (func_desc_adjust): Force dot-syms local in executables as well + as shared libs. + +2005-03-04 David Daney + + * elfxx-mips.c (mips_elf_calculate_relocation): Handle special + '__gnu_local_gp' symbol used by gas -mno-shared. + +2005-03-03 H.J. Lu + + * elf-bfd.h (elf_backend_data): Add "const char *" to + elf_backend_section_from_phdr. + + * elf.c (bfd_section_from_phdr): Pass "proc" to the + elf_backend_section_from_phdr hook. + +2005-03-02 Daniel Jacobowitz + Joseph Myers + + * elfxx-mips.c (struct mips_got_entry): Add tls_type. + (struct mips_got_info): Add tls_gotno, tls_assigned_gotno, + and tls_ldm_offset. + (struct mips_elf_got_per_bfd_arg): Add global_count. + (struct mips_elf_count_tls_arg): New. + (struct mips_elf_hash_sort_data): Update comment for min_got_dynindx. + (struct mips_elf_link_hash_entry): Add tls_type and tls_got_offset. + (GOT_NORMAL, GOT_TLS_GD, GOT_TLS_LDM, GOT_TLS_IE) + (GOT_TLS_OFFSET_DONE, GOT_TLS_DONE): Define. + (TLS_RELOC_P): Define. + (TP_OFFSET, DTP_OFFSET): Define. + (dtprel_base, tprel_base): New functions. + (mips_elf_link_hash_newfunc): Initialize tls_type. + (mips_elf_got_entry_hash, mips_elf_got_entry_eq) + (mips_elf_multi_got_entry_hash, mips_elf_multi_got_entry_eq): Handle + TLS entries. + (mips_tls_got_relocs, mips_elf_count_local_tls_relocs) + (mips_elf_count_global_tls_entries, mips_elf_count_global_tls_relocs) + (mips_elf_output_dynamic_relocation, mips_elf_initialize_tls_slots) + (mips_tls_got_index): New functions. + (mips_elf_local_got_index): Add new R_SYMNDX, H, and R_TYPE + arguments. Pass them to mips_elf_create_local_got_entry. Use + mips_tls_got_index. + (mips_elf_global_got_index): Add new R_TYPE and INFO arguments. + Handle TLS entries. + (mips_elf_got_page, mips_elf_got16_entry): Update calls to + mips_elf_create_local_got_entry. + (mips_elf_create_local_got_entry): Add new R_SYMNDX, H, and R_TYPE + arguments. Handle TLS entries. + (mips_elf_sort_hash_table_f): Add non-TLS assertions. + (mips_elf_record_local_got_symbol): Add new TLS_FLAG argument. Handle + TLS entries. + (mips_elf_record_global_got_symbol): Likewise. + (mips_elf_make_got_per_bfd): Initialize new mips_got_info members. + Count TLS entries. + (mips_elf_merge_gots): Handle TLS entries when merging. + (mips_elf_initialize_tls_index): New function. + (mips_elf_set_global_got_offset): Handle TLS entries. + (mips_elf_adjust_gp): Handle TLS. + (mips_elf_multi_got): Remove redundant call to + mips_elf_resolve_final_got_entries. Initialize global_count. + Correct a comment. Initialize new TLS members of mips_got_info. + Assign TLS GOT indexes for new GOTs. + (mips_elf_create_got_section): Initialize new TLS members of + mips_got_info. + (mips_elf_calculate_relocation): Handle TLS relocs. + (_bfd_mips_elf_check_relocs): Likewise. Update calls to changed + functions. + (_bfd_mips_elf_always_size_sections): Handle TLS. + (_bfd_mips_elf_size_dynamic_sections): Likewise. + (_bfd_mips_elf_finish_dynamic_symbol): Likewise. Update calls to + changed functions. + (_bfd_mips_elf_copy_indirect_symbol): Copy tls_type. + (_bfd_mips_elf_hide_symbol): Handle TLS. + * elfn32-mips.c (elf_mips_howto_table_rel, elf_mips_howto_table_rela) + (mips_reloc_map): Add TLS relocs. + * elf32-mips.c (elf_mips_howto_table_rel, mips_reloc_map): Likewise. + * elf64-mips.c (mips_elf64_howto_table_rel) + (mips_elf64_howto_table_rela, mips_reloc_map): Likewise. + * reloc.c: Define new MIPS TLS relocations. + * libbfd.h, bfd-in2.h: Regenerated. + +2005-03-02 Jan Beulich + + * Makefile.am: Add dependency of cache.o on libiberty.h. + * cache.c: Include libiberty.h. + (bfd_open_file): Use unlink_if_ordinary instead of unlink. + +2005-03-01 Zack Weinberg + + * elf.c (bfd_section_from_shdr ): Call + elf_backend_section_from_shdr hook unconditionally, and return + what it returns. + (bfd_section_from_phdr): Similarly, for elf_backend_section_from_phdr. + * elfxx-target.h (elf_backend_section_from_shdr) + (elf_backend_section_from_phdr): Default to + _bfd_elf_make_section_from_shdr and _bfd_elf_make_section_from_phdr + respectively. + +2005-03-01 Alan Modra + + * targets.h: Typo fix. + * bfd-in2.h: Regenerate. + + * bout.c (b_out_write_object_contents): Don't use sizeof on host + structs to size on-disk structures. + (b_out_set_section_contents): Size the external struct, not the + internal one for on-disk size. + (b_out_sizeof_headers): Likewise. + +2005-03-01 Alan Modra + + * elf64-ppc.c (ppc64_elf_size_stubs): Override defined dot-sym + entry points with the func descriptor as well as undefweak. + +2005-02-28 Ross Ridge + + * peicode.h (pe_ILF_build_a_bfd): Do not assume that an @ will be + present when IMPORT_NAME_UNDOECRATE is used. + +2005-02-28 H.J. Lu + + PR 757 + * elf-bfd.h (_bfd_elf_merge_symbol): Add a pointer to unsigned + int. + + * elf32-sh-symbian.c (sh_symbian_relocate_section): Pass NULL + to _bfd_elf_merge_symbol. + + * elflink.c (_bfd_elf_merge_symbol): Use the pointer to + unsigned int to return the alignment of the old common symbol + in the dynamic object. + (_bfd_elf_add_default_symbol): Pass NULL to + _bfd_elf_merge_symbol. + (elf_link_add_object_symbols): Pass &old_alignment to + _bfd_elf_merge_symbol. Get the alignment of the new common + symbol in the dynamic object. + +2005-02-24 Ben Elliston + + * coffcode.h (coff_sym_filepos): Remove GNU960 conditional code. + * format.c (bfd_check_format_matches): Likewise. + * archive.c (BFD_GNU960_ARMAG): Likewise. + (bfd_generic_archive_p): Likewise. + (_bfd_write_archive_contents): Likewise. + +2005-02-24 H.J. Lu + + * configure.in: (AM_INIT_AUTOMAKE): Set version to 2.15.95. + * configure: Regenerate. + +2005-02-24 Julian Brown + + * elflink.c (elf_link_add_object_symbols): Force symbols in discarded + COMDAT group sections to have default visibility. + +2005-02-24 Alan Modra + + * coffcode.h (coff_print_aux): Warning fix. + * elf-m10300.c (mn10300_elf_relax_section): Use section->id + instead of section pointer to identify. + * coff-h8300.c (h8300_reloc16_extra_cases): Likewise. Allocate + the correct size buffer for local sym mangling too. + (h8300_bfd_link_add_symbols): Likewise. + * elf32-sh-symbian.c (sh_symbian_process_embedded_commands): Fix + warning. + * elf32-sh64.c (shmedia_prepare_reloc): Use %B and %p in error message + * elf32-xtensa.c (literal_value_hash): Warning fix. + * versados.c (process_otr): Warning fix. + (versados_canonicalize_reloc): Likewise. + * vms-gsd.c (_bfd_vms_slurp_gsd): Warning fix. + * vms.c (fill_section_ptr): Warning fix. + +2005-02-23 H.J. Lu + + * coff-tic54x.c (SWAP_OUT_RELOC_EXTRA): Defined. + * coff-tic80.c (SWAP_OUT_RELOC_EXTRA): Likewise. + +2005-02-23 Nick Clifton + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Initialise + the relvaddr field of the Elf32_crinfo structure. + + * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Initialise + variables that are passed by reference to + m68hc11_get_relocation_value in case that function does not + initialise them. + + * elf32-cr16c.c (cr16c_elf_final_link_relocate): Remove duplicated + return statements and replace with a single return at the end of + the function. This helps pacify the flow analysis code in gcc 4.0. + + * elf.c (_bfd_elf_compute_section_file_positions): Initialise + strtab to avoid compile time warning. + +2005-02-23 Ben Elliston + + * opncls.c (bfd_zalloc): Document this function. + +2005-02-21 H.J. Lu + + * coffcode.h (sec_to_styp_flags): Replaced SEC_CLINK with + SEC_TIC54X_CLINK. Replace SEC_BLOCK with SEC_TIC54X_BLOCK. + Replace SEC_SHARED with SEC_COFF_SHARED. + (styp_to_sec_flags): Likewise. + + * elfxx-target.h (TARGET_BIG_SYM): Remove SEC_ARCH_BIT_0. + (TARGET_LITTLE_SYM): Likewise. + + * section.c (SEC_ARCH_BIT_0): Removed. + (SEC_LINK_DUPLICATES_SAME_CONTENTS): Defined with + SEC_LINK_DUPLICATES_ONE_ONLY and SEC_LINK_DUPLICATES_SAME_SIZE. + (SEC_SHARED): Renamed to ... + (SEC_COFF_SHARED): This. + (SEC_BLOCK): Renamed to ... + (SEC_TIC54X_BLOCK): This. + (SEC_CLINK): Renamed to ... + (SEC_TIC54X_CLINK): This. + (SEC_XXX): Rearranged. Move SEC_COFF_SHARED_LIBRARY, + SEC_COFF_SHARED, SEC_TIC54X_BLOCK and SEC_TIC54X_CLINK to the + end. + * bfd-in2.h: Regenerated. + +2005-02-21 Fred Fish + + * dwarf2.c (find_abstract_instance_name): Call recursively + to handle a DW_AT_specification. + +2005-02-21 Thiemo Seufer + + * elfxx-mips.c (ecoff_swap_rpdr_out, mips_elf_output_extsym, + mips_elf_create_dynamic_relocation, + _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_final_link): + Remove #if 0'd code. + +2005-02-21 Alan Modra + + * Makefile.am: Run "make dep-am" + * Makefile.in: Regenerate. + +2005-02-21 Alan Modra + + * coffgen.c (bfd_coff_get_comdat_section): Check that + coff_section_data isn't NULL. + +2005-02-21 Alan Modra + + * bfd-in.h (bfd_elf_bfd_from_remote_memory): Warning fix. + * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): Likewise. + * coff-rs6000.c (xcoff_write_armap_big): Warning fixes. Remove + useless assignments. + (xcoff_write_archive_contents_big): Likewise. + (_bfd_xcoff_put_ldsymbol_name): Likewise. + * coff64-rs6000.c (_bfd_xcoff64_put_ldsymbol_name): Likewise. + * coffgen.c (coff_write_symbols): Make "written" a bfd_vma. + * cofflink.c (process_embedded_commands): Warning fixes. + * cpu-arm.c: Delete unnecessary prototypes. Convert to C90. + Warning fixes. + * dwarf2.c: Warning fixes. + * elf-bfd.h: Likewise. + * elf-eh-frame.c: Likewise. + * elf-strtab.c: Likewise. + * elf.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-sh-symbian.c: Likewise. + * elf32-sh.c: Delete unnecessary prototypes. Warning fixes. + * elf64-sh64.c: Likewise. + * peicode.h: Likewise. + * elf64-mmix.c: Warning fixes. + * elfcode.h: Likewise. + * elfxx-mips.c: Likewise. + * libbfd-in.h: Likewise. + * libbfd.c: Likewise. + * mach-o.c: Likewise. + * merge.c: Likewise. + * mmo.c: Likewise. + * opncls.c: Likewise. + * pef.c: Likewise. + * srec.c: Likewise. + * vms-hdr.c: Likewise. + * vms-tir.c: Likewise. + * xtensa-isa.c: Likewise. + * xtensa-modules.c: Likewise. + * xsym.c: Likewise. + (pstrcmp): Use correct choice of string lengths. Fix return value. + (bfd_sym_module_name): Correct string length. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2005-02-17 Alexandre Oliva + + * elf32-frv.c (elf32_frv_relocate_section): Remove warning from + uninitialized check_segment[1] in TLSMOFF case. + Reported by Alan Modra. + (elf32_frv_relocate_section): Improve errors and warnings. + +2005-02-17 Alan Modra + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Fix warning. + +2005-02-16 Alan Modra + + * coff-arm.c (coff_arm_is_local_label_name): Warning fix. + * elf32-frv.c (frvfdpic_relocs_info_hash): Likewise. + * pef.c (bfd_pef_scan): Don't ignore return value of + bfd_pef_scan_start_address. + * mach-o.c (bfd_mach_o_scan): Don't ignore return value of + bfd_mach_o_scan_start_address. + * elfxx-ia64.c (elfNN_ia64_relax_brl): Rewrite for 32-bit bfd_vma. + * elfxx-mips.c: Remove unnecessary prototypes. + (sort_dynamic_relocs_64): Abort if not BFD64. + +2005-02-16 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_toc): Skip toc if size is zero. + Skip toc reloc adjust if reloc_count is zero. + +2005-02-15 Nigel Stephens + Maciej W. Rozycki + + * elf32-mips.c (elf_mips16_howto_table_rel): New array for MIPS16 + reloc howtos. Add R_MIPS16_HI16 and R_MIPS16_LO16 relocs and + R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders. + (elf_mips16_jump_howto): Move into elf_mips16_howto_table_rel. + (elf_mips16_gprel_howto): Likewise. Redefine src_mask and + dst_mask. + (mips16_gprel_reloc): Remove bit shuffling; call + _bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp() + and _bfd_mips16_elf_reloc_shuffle() instead. + (mips16_reloc_map): New reloc map for MIPS16 relocs. + (bfd_elf32_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16 + relocs. + (mips_elf32_rtype_to_howto): Fetch MIPS16 howtos from + elf_mips16_howto_table_rel. + * elf64-mips.c (mips16_elf64_howto_table_rel): New array for + MIPS16 REL reloc howtos. Add R_MIPS16_HI16 and R_MIPS16_LO16 + relocs and R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders. + (elf_mips16_jump_howto): Move into mips16_elf64_howto_table_rel. + (elf_mips16_gprel_howto): Likewise. Redefine src_mask and + dst_mask. + (mips16_elf64_howto_table_rela): New array for MIPS16 RELA + reloc howtos. Add R_MIPS16_26, R_MIPS16_GPREL, R_MIPS16_HI16 and + R_MIPS16_LO16 relocs and R_MIPS16_GOT16 and R_MIPS16_CALL16 + placeholders. + (mips16_gprel_reloc): Remove bit shuffling; call + _bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp() + and _bfd_mips16_elf_reloc_shuffle() instead. + (mips16_reloc_map): New reloc map for MIPS16 relocs. + (bfd_elf64_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16 + relocs. + (mips_elf64_rtype_to_howto): Fetch MIPS16 howtos from + mips16_elf64_howto_table_rela or mips16_elf64_howto_table_rel. + * elfn32-mips.c (elf_mips16_howto_table_rel): New array for MIPS16 + REL reloc howtos. Add R_MIPS16_HI16 and R_MIPS16_LO16 relocs and + R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders. + (elf_mips16_jump_howto): Move into elf_mips16_howto_table_rel. + (elf_mips16_gprel_howto): Likewise. Redefine src_mask and + dst_mask. + (mips16_gprel_reloc): Remove bit shuffling; call + _bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp() + and _bfd_mips16_elf_reloc_shuffle() instead. + (mips16_reloc_map): New reloc map for MIPS16 relocs. + (bfd_elf32_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16 + relocs. + (mips_elf_n32_rtype_to_howto): Fetch MIPS16 howtos from + elf_mips16_howto_table_rela or elf_mips16_howto_table_rel. + * elfxx-mips.c (_bfd_mips16_elf_reloc_unshuffle): New function to + handle bit shuffling for MIPS16 relocs. + (_bfd_mips16_elf_reloc_shuffle): Likewise. + (_bfd_mips_elf_lo16_reloc): Use _bfd_mips16_elf_reloc_unshuffle() + and _bfd_mips16_elf_reloc_shuffle(). + (_bfd_mips_elf_generic_reloc): Likewise. + (mips_elf_calculate_relocation): Likewise. Handle R_MIPS16_HI16 + and R_MIPS16_LO16. + (mips_elf_obtain_contents): Remove bit shuffling. + (mips_elf_perform_relocation): Likewise; call + _bfd_mips16_elf_reloc_unshuffle() and _bfd_mips16_elf_reloc_shuffle() + instead. + (_bfd_mips_elf_relocate_section): Likewise. Handle R_MIPS16_HI16 + and R_MIPS16_LO16. + * elfxx-mips.h (_bfd_mips16_elf_reloc_unshuffle): Declare. + (_bfd_mips16_elf_reloc_shuffle): Likewise. + * reloc.c (BFD_RELOC_MIPS16_HI16): New reloc. + (BFD_RELOC_MIPS16_HI16_S): Likewise. + (BFD_RELOC_MIPS16_LO16): Likewise. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2005-02-15 Jan Beulich + + * elfxx-ia64.c (ia64_howto_table): Correct strings for + R_IA64_DTPMOD64[LM]SB. + +2005-02-14 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_section): Allow relax + backward branch in the same section. + (elfNN_ia64_relocate_section): Inform users that the input + section is too big to relax br instruction when overflow + happens to R_IA64_PCREL21B, R_IA64_PCREL21BI, R_IA64_PCREL21M + and R_IA64_PCREL21F. + +2005-02-14 Orjan Friberg + + * elfcore.h (elf_core_file_p): Move the call to + elf_backend_object_p to allow the correct machine to be set before + processing the program headers. + +2005-02-14 Nick Clifton + + PR binutils/716 + * peicode.h (pe_bfd_copy_private_bfd_data): Copy the large address + aware flag from the input bfd to the output bfd. + +2005-02-11 Maciej W. Rozycki + + * elf32-mips.c (_bfd_mips_elf32_gprel16_reloc): Reject + R_MIPS_LITERAL relocations for external symbols. + * elf64-mips.c (mips_elf64_literal_reloc): Likewise. + * elfn32-mips.c (mips_elf_literal_reloc): Likewise. + +2005-02-11 H.J. Lu + + * bfd-in2.h: Rebuilt. + +2005-02-11 Paul Brook + + * elf-bfd.h (struct elf_link_hash_table): Add + is_relocatable_executable. + * elf.c (_bfd_elf_link_hash_table_init): Initialize it. + * elflink.c (bfd_elf_link_record_dynamic_symbol): Create local dynamic + symbols in relocatable executables. + (bfd_elf_record_link_assignment): Create dynamic section symbols in + relocatable executables. + (_bfd_elf_link_renumber_dynsyms): Ditto. + (bfd_elf_final_link): Ditto. + * elf32-arm.c (elf32_arm_final_link_relocate): Copy absolute + relocations into relocatable executables. + (elf32_arm_check_relocs): Crate dynamic sections for relocatable + executables. Also copy absolute relocations. + (elf32_arm_adjust_dynamic_symbol): Don't create copy relocations + in relocatable executables. + (allocate_dynrelocs): Copy relocations for relocatable executables. + Output dynamic symbols for symbols defined in linker scripts. + +2005-02-11 Nick Clifton + + * libbfd.c (read_signed_leb128): Use an unsigned type for 'shift' + to avoid a compile time warning. + + * coff-alpha.c (alpha_adjust_reloc_in): Remove redundant test from + BFD_ASSERT. + + * coff-tic4x.c (coff_rtype_to_howto): Move definition before + inclusion of coffcode.h so that it is actually picked up. + + * coffcode.h (coff_std_swap_table): Add an unused attribute in + case it is not used. + + * elf32-ip2k.c (ip2k_call_opcode, IS_CALL_OPCODE): Remove unused + structure and macro. + + * elf32-iq2000.c (iq2000_reloc_map): Remove unused structure and + array. + + * elf32-m32r.c (m32r_reloc_map_old): Use #ifdef USE_M32R_OLD_RELOC + to protect the declaration of this array. + + * xsym.c (bfd_sym_parse_contained_variables_table_entry_v32): + Avoid call to memcpy with a size of 0. + +2005-02-12 Alan Modra + + * elf64-ppc.c (toc_adjusting_stub_needed): Return true for + old-style branches to undefined dot-symbols which will be + satisfied by a plt call. + +2005-02-11 Alan Modra + + * elf64-ppc.c (move_plt_plist): New function, extracted from.. + (ppc64_elf_copy_indirect_symbol): ..here. + (func_desc_adjust): Use move_plt_plist. + +2005-02-10 Paul Brook + + * elf32-arm.c (elf32_arm_final_link_relocate): Handle R_ARM_THM_PC9. + +2005-02-10 Paul Brook + + * elflink.c (bfd_elf_record_link_assignment): Make hidden and internal + symbols local. + (elf_link_renumber_hash_table_dynsyms): Ignore local symbols. + (elf_link_renumber_local_hash_table_dynsyms): New function. + (_bfd_elf_link_renumber_dynsyms): Number local dynamic symbols. + +2005-02-10 Jakub Jelinek + + * bfd-in.h (BFD_LINKER_CREATED): Define. + * bfd-in2.h: Rebuilt. + * elflink.c (bfd_elf_size_dynamic_sections): Disregard + BFD_LINKER_CREATED bfds when determining input bfds without + .note.GNU-stack section. + +2005-02-10 Maciej W. Rozycki + + * elf64-mips.c (mips16_gprel_reloc): Update a comment. + * elfn32-mips.c (mips16_gprel_reloc): Keep R_MIPS16_GPREL + relocations against external symbols unchanged. + +2005-02-08 Paul Brook + + * elflink.c (elf_link_input_bfd): Ignore symbols from null input + sections. + +2005-02-08 Hans-Peter Nilsson + + * elflink.c (elf_link_add_object_symbols): Don't add "warning: " + prefix here. + +2005-02-07 Maciej W. Rozycki + + * elf64-mips.c: Fix formatting throughout. + +2005-02-07 Maciej W. Rozycki + + * elfn32-mips.c (elf_mips_howto_table_rela): Fix a comment typo. + +2005-02-07 Alexandre Oliva + + * elf32-frv.c (FRVFDPIC_SYM_LOCAL): Remove special handling for + *ABS*/*UND* sections. + (elf32_frv_relocate_section): Move zero-addend-required error... + (_frv_emit_got_relocs_plt_entries): ... here. Report error for + missing needed TLS section. + +2005-02-07 Hans-Peter Nilsson + + * aoutx.h (NAME(aout,find_nearest_line)): Correct case for N_SO + being the last symbol. + (aout_link_add_symbols): Just return TRUE if a warning + symbol was last. + +2005-02-07 Maciej W. Rozycki + + * elf32-mips.c (mips_elf_gprel32_reloc): Reject + R_MIPS_GPREL32 relocations against external symbols. + * elf64-mips.c (mips_elf64_gprel32_reloc): Replace an incorrect + comment. + +2005-02-07 Alan Modra + + * elf-bfd.h (elf_string_from_elf_strtab): Delete macro. + * elf.c (bfd_elf_string_from_elf_section): Expand occurrence of + elf_string_from_elf_strtab. + (_bfd_elf_setup_group_pointers, bfd_section_from_shdr): Likewise. + (bfd_section_from_shdr): For SHT_SYMTAB, load SHT_SYMTAB_SHNDX too + if it exists. Don't do the reverse for SHT_SYMTAB_SHNDX. For + SHT_STRTAB, check whether the strtab is for symtab or dynsymtab by + looking at cached symtab info first, before iterating over headers. + For SHT_REL and SHT_RELA, load dynsymtab if needed. + * elfcode.h (elf_object_p): Don't load section header stringtab + specially. + +2005-02-06 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Disallow R_386_GOTOFF + against protected function when building shared library. + + PR 584 + * elf64-x86-64.c (is_32bit_relative_branch): New. + (elf64_x86_64_relocate_section): Alllow R_X86_64_PC32 on a + protected function symbol when building shared library for + 32bit relative branch instruction. + +2005-02-06 Alan Modra + + * elf64-ppc.c (add_symbol_adjust): Don't create fake descriptor + syms when doing a relocatable link. + (ppc64_elf_gc_mark_hook): Check that syms are defined before looking + at u.def.section. + (ppc64_elf_tls_setup): Likewise. + (ppc64_elf_edit_opd): Don't use an undefined func desc sym. + +2005-02-04 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_entry): Add "fake". + (link_hash_newfunc): Clear all locals using memset. + (make_fdh): Remove flags param. Always create fake func desc + weak. Link the descriptor with the code entry sym. + (ppc64_elf_archive_symbol_lookup): Don't return fake syms. + (add_symbol_adjust): Adjust make_fdh call. + (func_desc_adjust): Likewise. Twiddle any pre-existing fake + descriptor to strong undefined if code entry is strong. + +2005-02-04 Alan Modra + + * elflink.c (bfd_elf_record_link_assignment): Do "provide" symbol + lookup here. Set to new before calling bfd_link_repair_undef_list. + (elf_smash_syms): Check that u.undef.weak isn't the not_needed bfd. + +2005-02-03 Alan Modra + + * linker.c (_bfd_link_hash_newfunc): Set all local fields. + +2005-02-03 Alan Modra + + * linker.c (_bfd_generic_link_add_one_symbol): Set u.undef.weak. + * elflink.c (elf_smash_syms): Restore symbols that were undefweak + before the as-needed lib was loaded. Abort on unexpected refs. + +2005-02-02 Alan Modra + + * elflink.c (elf_smash_syms): Expand comments. + (elf_link_add_object_symbols): Only call elf_smash_syms for + as-needed dynamic objects. + + * elfxx-ia64.c (elfNN_ia64_new_elf_hash_entry): Don't clear + everything, just the field specific to ia64. + * elf64-hppa.c (elf64_hppa_new_dyn_hash_entry): Likewise. + +2005-02-01 Alan Modra + + * elf64-ppc.c (func_desc_adjust): Move code creating func desc sym to.. + (make_fdh): ..here. New function. Don't set BSF_OBJECT for + undefined syms. + (struct add_symbol_adjust_data): New. + (add_symbol_adjust): Make an undefweak func desc for old ABI + objects to link with --as-needed shared libs. Return fail status. + Don't adjust old ABI func entry sym to weak if func desc syms + isn't defined. + (ppc64_elf_check_directives): Adjust call to add_symbol_adjust, + and return status. + +2005-02-01 Hans-Peter Nilsson + + * cpu-cris.c (get_compatible): Rearrange disabled code and comment + for clarity. + +2005-02-01 Alan Modra + + * elf64-ppc.c (ppc64_elf_check_directives): Move undefs list fixup.. + * linker.c (bfd_link_repair_undef_list): ..to new function, but don't + remove anything but new and undefweak. + * elflink.c (_bfd_elf_link_create_dynamic_sections): Override any + existing _DYNAMIC. + (_bfd_elf_create_dynamic_sections): Formatting. + (bfd_elf_record_link_assignment): Call bfd_link_repair_undef_list. + (_bfd_elf_merge_symbol): Don't handle as-needed syms here. + (struct elf_smash_data): New. + (elf_smash_syms): New function. + (elf_link_add_object_symbols): Call elf_smash_syms. Don't add + unneeded dynamic objects to loaded list. + (elf_link_output_extsym): Don't handle as-needed here. Strip + bfd_link_hash_new symbols. + * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't + delref when dynindx is already -1. + * elf64-alpha.c (elf64_alpha_output_extsym): Strip bfd_link_hash_new + symbols. + * elfxx-mips.c (mips_elf_output_extsym): Likewise. + +2005-02-01 Ben Elliston + + * elfxx-target.h (bfd_elfNN_bfd_discard_group): Redefine. + +2005-02-01 Ben Elliston + + * aout-arm.c, aout-target.h, aoutx.h, archive.c, armnetbsd.c, + bfd-in.h, bfdio.c, coff-alpha.c, coff-arm.c, coff-h8300.c, + coff-i860.c, coff-mcore.c, coff-or32.c, coff-ppc.c, coff-sh.c, + coff-sparc.c, coffcode.h, coffgen.c, cofflink.c, cpu-cris.c, + cpu-h8500.c, cpu-ns32k.c, ecoff.c, ecofflink.c, elf.c, + elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-hppa.c, + elf32-i860.c, elf32-ip2k.c, elf32-m32r.c, elf32-sh.c, + elf32-v850.c, elf64-mips.c, elf64-sparc.c, elflink.c, + i386aout.c, i386msdos.c, i386os9k.c, ieee.c, mach-o.c, + nlm32-sparc.c, oasys.c, opncls.c, pdp11.c, pe-mips.c, peXXigen.c, + pef.c, peicode.h, reloc.c, riscix.c, section.c, simple.c, som.c, + sparclynx.c, targets.c, vms-misc.c, vms-tir.c, xsym.c, + hosts/delta68.h, hosts/vaxbsd.h: Remove #if 0'd code + throughout. Similarly, collapse #if 1'd code. + +2005-02-01 Ben Elliston + + * elf-bfd.h (bfd_elf_discard_group): Remove. + * elf.c (bfd_elf_discard_group): Likewise. + * elfxx-target.h (bfd_elfNN_bfd_discard_group): Remove macro. + +2005-01-31 Richard Sandiford + + * elf-bfd.h (elf_backend_data): Add elf_backend_eh_frame_address_size. + (_bfd_elf_eh_frame_address_size): Declare. + * elfxx-target.h (elf_backend_eh_frame_address_size): Define a default. + (elfNN_bed): Initialize elf_backend_eh_frame_address_size. + * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Declare. + (elf_backend_eh_frame_address_size): Define. + * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): New function. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Get the address + size from the new backend hook. + (_bfd_elf_write_section_eh_frame): Likewise. + (_bfd_elf_eh_frame_address_size): New function. + +2005-01-31 Andrew Cagney + + * configure: Regenerate to track ../gettext.m4. + +2005-01-31 Mark Mitchell + + * elf32-arm.c (elf32_arm_symbian_special_sections): Do not set + SHF_WRITE for .init_array, .fini_array, and .preinit_array. + +2005-01-31 Nick Clifton + + * confg.bfd: Make targets scheduled for obsoletion (m68k-lynxos, + sparc-lynxos, vax-vms) be obsolete. + +2005-01-28 Daniel Jacobowitz + + * elf-bfd.h (struct elf_backend_data): Add minpagesize. + * elf32-arm.c (ELF_MINPAGESIZE): Define. + * elf32-ppc.c (ELF_MINPAGESIZE): Define. + * elfcode.h (elf_object_p): Use minpagesize instead of + maxpagesize. + * elfxx-target.h (ELF_MINPAGESIZE): Default to ELF_MAXPAGESIZE. + (elfNN_bed): Include ELF_MINPAGESIZE. + +2005-01-28 Julian Brown + + * bin-in.h (bfd_elf32_arm_set_target_relocs): Update prototype. + * bin-in2.h (bfd_elf32_arm_set_target_relocs): Update prototype. + * elf32-arm.c (elf32_arm_link_hash_table): Add fix_v4bx flag. + (bfd_elf32_arm_set_target_relocs): Add formal parameter fix_v4bx for + passing flag value from ld. Set flag value in global hash table entry. + (elf32_arm_final_link_relocate): Add code to implement R_ARM_V4BX + relocation. + +2005-01-27 Andrew Cagney + + * configure: Regenerate to track ../gettext.m4 change. + +2005-01-25 Mark Mitchell + + * elf32-arm.c (elf_backend_default_use_rela_p): Define to zero for + SymbianOS. + +2005-01-25 Alexandre Oliva + + 2004-12-10 Alexandre Oliva + * elf32-frv.c (elf32_frv_relocate_section): Force local binding + for TLSMOFF. + * reloc.c: Add R_FRV_TLSMOFF. + * elf32-frv.c (elf32_frv_howto_table): Likewise. + (frv_reloc_map, frv_reloc_type_lookup): Map it. + (elf32_frv_relocate_section): Handle it. + (elf32_frv_check_relocs): Likewise. + * libbfd.h, bfd-in2.h: Rebuilt. + 2004-11-26 Alexandre Oliva + * elf32-frv.c (_frvfdpic_emit_got_relocs_plt_entries): Don't crash + when given an undefweak TLS symbol. Fix constant TLS PLT entries + such that they return the constant in gr9. + (_frvfdpic_relax_tls_entries): Don't crash for undefweak TLS + symbols. + (_frvfdpic_size_got_plt): Set _cooked_size of dynamic sections. + too, such that they shrink on relaxation. + (elf32_frvfdpic_finish_dynamic_sections): Check __ROFIXUP_END__ as + marking the position right past the _GLOBAL_OFFSET_TABLE_ value. + (_frvfdpic_assign_plt_entries): Shrink constant TLS PLT entries + if we can guarantee the use of 16-bit constants. + 2004-11-10 Alexandre Oliva + Introduce TLS support for FR-V FDPIC. + * reloc.c: Add TLS relocations. + * elf32-frv.c (elf32_frv_howto_table): Add TLS relocations. + (elf32_frv_rel_tlsdesc_value_howto): New. + (elf32_frv_rel_tlsoff_howto): New. + (frv_reloc_map): Add new mappings. + (struct frvfdpic_elf_link_hash_table): Add pointer to summary + reloc information. + (frvfdpic_dynamic_got_plt_info): New. + (frvfdpic_plt_tls_ret_offset): New. + (ELF_DYNAMIC_INTERPRETER, DEFAULT_STACK_SIZE): Move earlier. + (struct _frvfdpic_dynamic_got_info): Likewise. Add TLS members. + (struct _frvfdpic_dynamic_got_plt_info): Likewise. + (FRVFDPIC_SYM_LOCAL): Regard symbols defined in the absolute + section as local. + (struct frvfdpic_relocs_info): Add TLS fields. + (frvfdpic_relocs_info_hash): Warning clean up. + (frvfdpic_relocs_info_find): Initialize tlsplt_entry. + (frvfdpic_pic_merge_early_relocs_info): Merge TLS fields. + (FRVFDPIC_TLS_BIAS): Define. + (tls_biased_base): New. + (_frvfdpic_emit_got_relocs_plt_entries): Deal with TLS + relocations. + (frv_reloc_type_lookup): Likewise. + (frvfdpic_info_to_howto_rel): Likewise. + (elf32_frv_relocate_section): Likewise. + (_frv_create_got_section): Create the PLT section here. + (elf32_frvfdpic_create_dynamic_sections): Not here. + (_frvfdpic_count_nontls_entries): Move out of... + (_frvfdpic_count_got_plt_entries): ... here. + (_frvfdpic_count_tls_entries): Likewise. Add TLS support. + (_frvfdpic_count_relocs_fixups): Likewise. Add relaxation + support. + (_frvfdpic_relax_tls_entries): New. + (_frvfdpic_compute_got_alloc_data): Add TLS support. + (_frvfdpic_get_tlsdesc_entry): New. + (_frvfdpic_assign_got_entries): Add TLS support. + (_frvfdpic_assign_plt_entries): Likewise. + (_frvfdpic_reset_got_plt_entries): New. + (_frvfdpic_size_got_plt): Move out of... + (elf32_frvfdpic_size_dynamic_sections): ... here. + (_frvfdpic_relax_got_plt_entries): New. + (elf32_frvfdpic_relax_section): New. + (elf32_frvfdpic_finish_dynamic_sections): Add TLS sanity check. + (elf32_frv_check_relocs): Add TLS support. + (bfd_elf32_bfd_relax_section): Define for FDPIC. + * libbfd.h, bfd-in2.h: Rebuilt. + +2005-01-25 Alan Modra + + * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound): Only include + loadable reloc sections. + (_bfd_elf_canonicalize_dynamic_reloc): Likewise. + (_bfd_elf_get_synthetic_symtab): Return 0 if no dynamic syms. + +2005-01-25 Alan Modra + + * elflink.c (elf_link_add_object_symbols): Don't create link dynamic + sections immediately when linking shared libs. Instead, wait until + we know a lib is needed. + (_bfd_elf_link_create_dynstrtab): Extract from.. + (_bfd_elf_link_create_dynamic_sections_): ..here. + (elf_add_dt_needed_tag): Call _bfd_elf_link_create_dynstrtab and + _bfd_elf_link_create_dynamic_sections. Add abfd param. Allow + for non-existent .dynamic. + (elf_link_output_extsym): Don't complain about undefined symbols + in as-needed dynamic libs that aren't actually linked. + +2005-01-24 Andrew Cagney + + * configure: Regenerate, ../gettext.m4 was updated. + +2005-01-21 Ben Elliston + + * aout-encap.c: Remove unused file. + +2005-01-19 H.J. Lu + + PR 679 + * elflink.c (_bfd_elf_dynamic_symbol_p): Only protected + non-function symbols are local. + (_bfd_elf_symbol_refs_local_p): Likewise. + +2005-01-18 Alan Modra + + * bfd.c (bfd_link_just_syms): Add abfd param. + * bfd-in2.h: Regenerate. + +2005-01-17 Richard Sandiford + + * elf-eh-frame.c (skip_cfa_op, skip_non_nops): New functions. + (_bfd_elf_discard_section_eh_frame): Use them to interpret the CFA + instructions. If the amount of padding is known, reduce the size + of the CIE or FDE by that amount. + +2005-01-17 Richard Sandiford + + * elf-bfd.h (struct cie): Use bfd_vmas for code_align, ra_column and + augmentation_size. Use bfd_signed_vmas for data_align. + * elf-eh-frame.c (read_uleb128, read_sleb128): Delete in favor of... + (read_byte, skip_leb128, read_uleb128, read_sleb128): ...these new + functions. Don't read past the end of the enclosing CIE or FDE. + (skip_bytes): New utility function. + (_bfd_elf_discard_section_eh_frame): Use new functions, adding more + sanity checking. + (_bfd_elf_write_section_eh_frame): Use new functions. + +2005-01-17 Richard Sandiford + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use an + assert-style REQUIRE() macro to handle sanity checks. + +2005-01-17 H.J. Lu + + * dwarf2.c (dwarf2_debug): Move info_ptr_unit to ... + (comp_unit): Here. + (read_unsigned_leb128): Removed. + (read_signed_leb128): Removed. + (find_abstract_instance_name): Updated. + (parse_comp_unit): Accept info_ptr_unit. + (_bfd_dwarf2_find_nearest_line): Set info_ptr_unit for each + comp unit and pass it to parse_comp_unit. + + * elf-eh-frame.c (read_unsigned_leb128): Moved to ... + (read_signed_leb128): Moved to ... + * libbfd.c: Here. + + * libbfd-in.h (read_unsigned_leb128): New prototype. + (read_signed_leb128): Likewise. + * libbfd.h: Regenerated. + +2005-01-17 Andrew Stubbs + Nick Clifton + + * cpu-sh.c (bfd_to_arch_table): Change arch_sh1_up to arch_sh_up, + arch__sh4_nofp_up to arch_sh4_nofpu_up and arch_sh4a_nofp_up to + arch_sh4a_nofpu_up in order to match the external names and make the + testsuite's job easier. + * archuires.c: Rename bfd_mach_sh2a_fake? to more meaningful + names. + * bfd-in2.h: Regenerate. + +2005-01-15 Andrew Cagney + + * bfd.m4: New file. + * acinclude.m4: Move BFD_NEED_DECLARATION, + BFD_HAVE_SYS_PROCFS_TYPE and BFD_HAVE_SYS_PROCFS_TYPE_MEMBER to + the new file bfd.m4. Include ../bfd/bfd.m4. + * configure: Re-generate. + +2005-01-12 Alan Modra + + * elf32-ppc.c (ppc_elf_howto_raw): Delete RELAX32* entries. + (ppc_elf_relax_section): Use PLT variants of RELAX32 relocs for + reaching PLT. + (ppc_elf_relocate_section): Handle R_PPC_RELAX32_PLT and + R_PPC_RELAX32PC_PLT. + +2005-01-11 Alan Modra + + * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Follow indirect and warning + symbols. + * elf32-arm.c (elf32_arm_gc_sweep_hook): Likewise. + * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise. + * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise. + * elf32-i386.c (elf_i386_gc_sweep_hook): Likewise. + * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise. + * elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise. + * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise. + * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise. + * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise. + * elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise. + * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise. + * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise. + * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise. + * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise. + +2005-01-11 Alan Modra + + * elf32-ppc.c (ppc_elf_create_dynamic_sections): Correct + .dynsbss flags. + +2005-01-10 Inderpreet Singh + + * archures.c: Define bfd_mach_maxq10 and bfd_mach_maxq20. + * bfd-in2.h: Regenerate. + * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Add code + to support these new machine values. + * cpu-maxq.c (bfd_maxq10_arch): New architecture definition for + the maxq10. + (bfd_maxq_arch): Update values for the maxq20. + +2005-01-10 Eric Botcazou + + * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): When linking a + non-shared object, do not reserve space in .plt and .rela.plt for + regular symbols neither defined nor referenced in shared objects. + +2005-01-09 Eric Botcazou + + * elf32-sparc.c (elf32_sparc_link_hash_table_create): Use bfd_zmalloc + to zero the structure. + (create_got_section): Use BFD_ASSERT instead of abort. + * elf64-sparc.c (struct sparc64_elf_link_hash_table): New 'sgot' and + 'srelgot' fields. + (create_got_section): New function. + (sparc64_elf_create_dynamic_sections): Likewise. + (sparc64_elf_check_relocs): Invoke create_got_section instead of + _bfd_elf_create_got_section. Use the sgot and srelgot shortcuts. + (sparc64_elf_size_dynamic_sections): Use the srelgot shortcut. + (sparc64_elf_relocate_section): Use the sgot and srelgot shortcuts. + (sparc64_elf_finish_dynamic_symbol): Likewise. + (sparc64_elf_finish_dynamic_sections): Use the sgot shortcut. + (elf_backend_create_dynamic_sections): Define to + sparc64_elf_create_dynamic_sections. + +2005-01-09 Eric Botcazou + + * elf32-sparc.c (elf32_sparc_omit_section_dynsym): New function. + (elf_backend_omit_section_dynsym): Define to it. + * elf64-sparc.c (sparc64_elf_omit_section_dynsym): New function. + (elf_backend_omit_section_dynsym): Define to it. + +2005-01-07 Jakub Jelinek + + * elf.c (INCLUDE_SECTION_IN_SEGMENT): Don't put empty sections into + PT_DYNAMIC segment, unless .dynamic. + +2005-01-06 Paul Brook + + * config.bfd: Add entry for arm-*-vxworks and arm-*-windiss. + * configure.in: Add bfd_elf32_{big,little}arm_vxworks_vec. + * configure: Regenerate. + * elf32-arm.c: Add VxWorks target bfd. + (USE_REL): Remove. + (elf32_arm_link_hash_table): Add use_rel. + (elf32_arm_link_hash_table_create, elf32_arm_final_link_relocate, + elf32_arm_relocate_section): Replace USE_REL with runtime check. + Correct offset calculation for RELA case. + (elf_backend_may_use_rel_p, elf_backend_may_use_rela_p, + elf_backend_default_use_rela_p, elf_backend_rela_normal): Define. + (elf32_arm_vxworks_link_hash_table_create): New function. + * targets.c (bfd_elf32_bigarm_vxworks_vec): Add declaration. + (bfd_elf32_littlearm_vxworks_vec): Ditto. + (_bfd_target_vector): Add bfd_elf32_{big,little}arm_vxworks_vec. + +2005-01-06 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_table): Add no_multi_toc and + multi_toc_needed. + (has_toc_reloc, makes_toc_func_call, call_check_in_progress): Define. + (ppc64_elf_check_relocs): Update references to has_gp_reloc. + (ppc64_elf_setup_section_lists): Add no_multi_toc parm, set htab bit. + (ppc64_elf_next_toc_section): Heed no_multi_toc. + (ppc64_elf_reinit_toc): Set multi_toc_needed. + (toc_adjusting_stub_needed): Rewrite. + (ppc64_elf_next_input_section): Use multi_toc_needed to shortcut + toc tests. Adjust for toc_adjusting_stub_needed changes. + (ppc64_elf_size_stubs): Update references to has_gp_reloc. + * elf64-ppc.h (ppc64_elf_setup_section_lists): Update prototype. + * section.c: Expand comment on backend bits. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2005-01-06 Alan Modra + + * elf64-ppc.c (ppc64_elf_size_stubs): When determining need for + toc adjusting stub, do not test source section flags. + +2005-01-05 Eric Botcazou + + * elf64-sparc.c (sparc64_elf_relocate_section): Ignore overflows + from STABS debugging sections again. + +2005-01-05 Fred Fish + + * dwarf2.c (struct dwarf2_debug): Add info_ptr_unit member. + (find_abstract_instance_name): New function. + (scan_unit_for_functions): Handle DW_TAG_inlined_subroutine. + (scan_unit_for_functions): Handle DW_AT_abstract_origin. + (_bfd_dwarf2_find_nearest_line): Initialize info_ptr_unit. + +For older changes see ChangeLog-2004 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-2006 sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-2006 --- sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-2006 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-2006 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,3601 @@ +2006-12-31 H.J. Lu + + * bfd.c (bfd_record_phdr): Call bfd_zalloc instead of bfd_alloc + to allocate elf_segment_map. + +2006-12-29 H.J. Lu + + * elflink.c (elf_link_add_object_symbols): Remember the symbol + size only if it is defined. + +2006-12-25 Kazu Hirata + + * archures.c (bfd_mach_cpu32_fido): New. + (bfd_mach_mcf_isa_a_nodiv, bfd_mach_mcf_isa_a, + bfd_mach_mcf_isa_a_mac, bfd_mach_mcf_isa_a_emac, + bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac, + bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_b_nousp, + bfd_mach_mcf_isa_b_nousp_mac, bfd_mach_mcf_isa_b_nousp_emac, + bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac, + bfd_mach_mcf_isa_b_emac, bfd_mach_mcf_isa_b_float, + bfd_mach_mcf_isa_b_float_mac, bfd_mach_mcf_isa_b_float_emac): + Increment the defined values. + * bfd-in2.h: Regenerate. + * cpu-m68k.c (arch_info_struct): Add en entry for + bfd_mach_cpu32_fido. + * elf32-m68k.c (elf32_m68k_object_p): Handle + EF_M68K_CPU32_FIDO_A. + (elf32_m68k_merge_private_bfd_data): Use EF_M68K_CPU32_MASK. + (elf32_m68k_print_private_bfd_data): Handle + EF_M68K_CPU32_FIDO_A. + +2006-12-25 Mei Ligang + + * elf32-score.c (score_elf_got_lo16_reloc): Change some variables + type from unsigned to signed. + (score_elf_final_link_relocate): Fix bugs of handling relocation + type R_SCORE_GOT15, R_SCORE_GOT_LO16, and R_SCORE_REL32. + (_bfd_score_elf_relocate_section): Handle R_SCORE_GOT_LO16 + specially. + +2006-12-23 Jakub Jelinek + + * elf-bfd.h (struct elf_backend_data): Add as_needed_cleanup hook. + * elfxx-target.h (elf_backend_as_needed_cleanup): Define. + (elfNN_bed): Add as_needed_cleanup hook. + * elflink.c (elf_link_add_object_symbols): Call it when reverting + hash table changes for unneeded --as-needed input. + * elf64-ppc64.c (elf_backend_as_needed_cleanup): Define. + (ppc64_elf_as_needed_cleanup): New function. + +2006-12-19 Kazu Hirata + + * elf32-m68k.c (elf32_m68k_object_p, + elf32_m68k_print_private_bfd_data): Use EF_M68K_ARCH_MASK to + extract architecture mask. + +2006-12-19 Nathan Sidwell + + * elf.c (assign_file_positions_for_load_sections): Adjust p_vaddr + by p_vaddr_offset. Copy alignment & use if it is valid. + (rewrite_elf_program_headers): Cope with leading padding in a + segment that does not contain file or program headers. + (copy_elf_program_header): Likewise. + +2006-12-15 Mark Kettenis + + * config.bfd: (sh*-*-openbsd*): Add target. + * configure.in (sh*-*-openbsd*): Set COREFILE to netbsd-core.lo. + * configure: Regenerate. + +2006-12-15 Alan Modra + + * opncls.c (bfd_openr_iovec): Add "stat" parameter. + (struct opncls): Add "stat" field. + (opncls_bstat): Call vec->stat. + * bfd-in2.h: Regenerate. + * elf32-spu.c (spu_elf_open_builtin_lib): Adjust. + +2006-12-14 Alan Modra + + * elf-bfd.h (struct bfd_elf_section_data): Clarify sec_group + and next_in_group usage. + +2006-12-14 Alan Modra + + PR 3704 + * bfdio.c (bfd_bread): Don't read past end of archive elements. + +2006-12-12 Daniel Jacobowitz + + * doc/Makefile.am (bfd_TEXINFOS): Set. + (bfd.info bfd.dvi bfd.html): Delete rule. + * doc/Makefile.in: Regenerated. + +2006-12-11 Daniel Jacobowitz + + * configure.in: Define GENINSRC_NEVER. + * doc/Makefile.am (bfd.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, doc/Makefile.in: Regenerated. + +2006-12-11 Eric Botcazou + + * elflink.c (bfd_elf_gc_sections): Also search for corresponding + sections with .gnu.linkonce.t. prefix. + +2006-12-07 Kazu Hirata + + * elf32-m68k.c: Update uses of EF_M68K_*. + +2006-12-07 H.J. Lu + + PR ld/3666 + * elflink.c (elf_link_add_object_symbols): Keep symbol + visibility for symbols from discarded section. + +2006-12-06 Alan Modra + + * elf64-alpha.c (elf64_alpha_merge_symbol_attribute): New function. + (elf_backend_merge_symbol_attribute): Define. + +2006-12-04 Jan Beulich + + * elflink.c (_bfd_elf_link_create_dynamic_sections): Don't create + .eh_frame_hdr section from here anymore. + (bfd_elf_size_dynamic_sections): Call _bfd_elf_maybe_strip_eh_frame_hdr + a little earlier. + +2006-12-01 H.J. Lu + + PR binutils/3609 + * elf.c (rewrite_elf_program_header): Preserve segment physical + address in the output segment if the first section in the + corresponding input segment is null. + +2006-12-01 Nick Clifton + + PR 3609 + * elf.c (rewrite_elf_program_header): Do not use the first_section + pointer if it is null. + +2006-11-29 Paul Brook + + * elf32-arm.c (elf32_arm_to_thumb_export_stub): Assert that output + section is present. + (allocate_dynrelocs): Only add export stub for symbols defined in + this object. + +2006-11-29 Paul Brook + + * elf32-arm.c (elf32_arm_to_thumb_export_stub): Assert that output + section is present. + (allocate_dynrelocs): Only add export stub for symbols defined in + this object. + +2006-11-29 Paul Brook + Julian Brown + + * elf32-arm.c (copy_eabi_attributes): Correct starting offset. + (elf32_arm_merge_eabi_attributes): Mark output as initialized. + Only set Tag_CPU_name and Tag_ABI_PCS_R9_use if input attribute + is present. + +2006-11-27 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_special_sections): Add .xtensa.info. + +2006-11-24 H.J. Lu + + * elf.c (IS_SECTION_IN_INPUT_SEGMENT): New. + (INCLUDE_SECTION_IN_SEGMENT): Use IS_SECTION_IN_INPUT_SEGMENT. + (rewrite_elf_program_header): Don't preserve segment physical + address in the output segment if the first section in the + corresponding input segment is removed. + +2006-11-22 Alan Modra + + * pef.c (bfd_pef_make_empty_symbol): Delete function. Define instead. + * xsym.c (bfd_sym_make_empty_symbol): Likewise. + * xsym.h (bfd_sym_make_empty_symbol): Delete. + +2006-11-21 Greg McGary + + * elf32-ppc.c (ppc_elf_relocate_section): Fixup D field + at proper offset in little-endian mode. + * elf64-ppc.c (ppc_elf_relocate_section): Likewise. + +2006-11-21 Jakub Jelinek + + * elf-eh-frame.c (struct cie): New type. + (cie_compare): Removed. + (cie_eq, cie_hash, cie_compute_hash): New functions. + (_bfd_elf_discard_section_eh_frame): Rewrite not to rely on FDEs + pointing only to last CIE and allow merging of any duplicate CIEs, + not just duplicate consecutive CIEs. + (_bfd_elf_discard_section_eh_frame_hdr): Delete cies hash table. + * elf-bfd.h (struct cie_header, struct cie): Removed. + (struct eh_frame_sec_info): Remove alloced field. + (struct eh_frame_hdr_info): Remove last_cie, last_cie_sec + and last_cie_inf fields. Add cies field. + +2006-11-20 Alan Modra + + * bfd-in.h (struct stat): Don't typedef. + * bfdio.c (bfd_get_size): Return a file_ptr. + * cisco-core.c (cisco_core_file_validate): Use bfd_size_type for nread. + * mmo.c (mmo_scan): Use file_ptr for curpos. + * trad-core.c (trad_unix_core): Don't cast statbuf.st_size to + unsigned long. + * bfd-in2.h: Regenerate. + +2006-11-20 Alan Modra + + PR 3532 + * bfd-in.h (struct bfd_hash_table): Reorganize. Add "frozen". + * hash.c (bfd_hash_table_init_n): Init frozen. + (bfd_hash_lookup): Don't grow if frozen. + (bfd_hash_traverse): Freeze hash table during traversal. + * bfd-in2.h: Regenerate. + +2006-11-18 Alan Modra + + * elflink.c (_bfd_elf_check_kept_section): Test for kept group + section. Save result of checks in kept_section. + (_bfd_elf_section_already_linked): Tidy. Correct comments. + Ignore all group member sections. Handle special matching of + single-member groups against linkonce sections via their group + section. When such a match is found, set kept_section to the + group member section rather than to the group. + +2006-11-14 Phil Lello + + * peXXigen.c: Updates for PE/COFF V8.0, and clarification + (dir_names): Added CLR Runtime Header to dir_names[]. + (_bfd_XX_print_private_bfd_data_common): Added EFI_ROM and XBOX + subsystem names + (_bfd_XXi_swap_aouthdr_in, _bfd_XXi_swap_aouthdr_out) + (pe_print_idata, pe_print_edata) + (_bfd_XX_bfd_copy_private_bfd_data_common) + (_bfd_XXi_final_link_postscript): Use #DEFINEs for index into + DataDirectory. + +2006-11-13 Daniel Jacobowitz + + * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update + prototype. + (bfd_elf32_arm_set_byteswap_code): New prototype. + * bfd-in2.h: Regenerate. + * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Don't take + byteswap_code as an argument. Revert 2006-11-01 change. + (bfd_elf32_arm_set_byteswap_code): New. + (elf32_arm_size_dynamic_sections): Call + bfd_elf32_arm_process_before_allocation. + +2006-11-10 Thiemo Seufer + + * config.bfd (mips*el-sde-elf*, mips*-sde-elf*): Drop ECOFF support + for SDE configs. + +2006-11-10 Nick Clifton + + * config.bfd: Move previously obsoleted targets to the REMOVED + list. + Add maxq-*-coff to the obsolete list. + +2006-11-10 Pedro Alves + + * pe-arm-wince.c (LOCAL_LABEL_PREFIX): Define as ".". + * pei-arm-wince.c (LOCAL_LABEL_PREFIX): Likewise. + * coff-arm.c (LOCAL_LABEL_PREFIX): Only define if not defined before. + +2006-11-07 Daniel Jacobowitz + + * elf32-arm.c (find_thumb_glue): Add ERROR_MESSAGE argument; set it + on error. + (find_arm_glue): Likewise. + (elf32_thumb_to_arm_stub, elf32_arm_create_thumb_stub) + (elf32_arm_to_thumb_stub, elf32_arm_final_link_relocate): Add + ERROR_MESSAGE argument and pass it through. + (elf32_arm_to_thumb_export_stub): Update. + (elf32_arm_relocate_section): Use ERROR_MESSAGE and reloc_dangerous. + +2006-11-07 Alan Modra + + * elf64-ppc.c (enum _ppc64_sec_type): New. + (struct _ppc64_elf_section_data): Move "t_symndx" into opd union, + and rename fields. Add sec_type and has_14bit_branch. + (struct ppc_link_hash_table): Remove has_14bit_branch. + (get_opd_info, get_tls_mask, ppc64_elf_edit_opd): Adjust. + (ppc64_elf_relocate_section): Likewise. + (ppc64_elf_check_relocs): Likewise. Set per-section has_14bit_branch. + (ppc64_elf_size_stubs): Don't set default group size here. + (group_sections): Instead do so here, and group sections using + their individual requirements. + +2006-11-07 Alan Modra + + * elf64-ppc.c (struct ppc64_elf_obj_tdata): Remove "has_dotsym" + and union. + (struct ppc_link_hash_entry): Add "next_dot_sym". + (struct ppc_link_hash_table): Add "dot_syms". + (link_hash_newfunc): Make list of syms starting with a dot. + (ppc_get_stub_entry, adjust_opd_syms): Adjust. + (ppc64_elf_add_symbol_hook): Don't set has_dotsym. + (struct add_symbol_adjust_data): Delete. + (add_symbol_adjust): Simplify params and return. + (ppc64_elf_check_directives): Just process the "dot_syms" lists, + not all syms. + +2006-11-02 Daniel Jacobowitz + + * libbfd-in.h (_bfd_clear_contents): New prototype. + * reloc.c (_bfd_clear_contents): New. + * libbfd.h: Regenerated. + + * elf32-arm.c (elf32_arm_final_link_relocate): Use + _bfd_clear_contents. + * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise. + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Set value to + zero for discarded symbols. + * elfxx-mips.c (mips_elf_calculate_relocation): Likewise. + +2006-11-01 Thiemo Seufer + David Ung + + * elf-bfd.h (local_call_stubs): New member. + * elfxx-mips.c (FN_STUB_P, CALL_STUB_P, CALL_FP_STUB_P): New macros. + (mips_elf_calculate_relocation): Handle local mips16 call stubs. + (mips16_stub_section_p): Rename from mips_elf_stub_section_p, use + the new stub macros. + (_bfd_mips_elf_check_relocs): Handle call stubs for code which + mixes mips16 and mips32 functions. Use mips16_stub_section_p. Mark + used stubs with SEC_KEEP. Use the new stub macros. + +2006-11-01 Alan Modra + + * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Correct + check for PLT usage. + +2006-11-01 Daniel Jacobowitz + + * elfxx-mips.c (mips_elf_merge_gots): Always use maxcnt. + +2006-10-31 Alan Modra + + * elf.c (elfcore_write_note): Pad note descriptor to 4-byte + boundary. Tidy. Comment. + +2006-10-30 H.J. Lu + + PR ld/3111 + * elf-bfd.h (elf_obj_tdata): Add symbuf. + (_bfd_elf_section_already_linked): Add struct bfd_link_info *. + (_bfd_elf_check_kept_section): Likewise. + (bfd_elf_match_symbols_in_sections): Likewise. + + * elf.c (assign_section_numbers): Updated to add + struct bfd_link_info *. + (bfd_elf_match_symbols_in_sections): Updated. Cache symbol + buffer if info->reduce_memory_overheads is false. + + * elflink.c (match_group_member): Updated to add + struct bfd_link_info *. + (_bfd_elf_check_kept_section): Likewise. + (elf_link_input_bfd): Likewise. + (_bfd_elf_section_already_linked): Likewise. + (bfd_elf_final_link): Free symbol buffer if + info->reduce_memory_overheads is false. + + * libbfd-in.h (_bfd_nolink_section_already_linked): Add + struct bfd_link_info *. + (_bfd_generic_section_already_linked): Likewise. + * libbfd.h: Regenerated. + + * linker.c (bfd_section_already_linked): Add + struct bfd_link_info *. + (_bfd_generic_section_already_linked): Likewise. + * targets.c (bfd_target): Add struct bfd_link_info * to + _section_already_linked. + * bfd-in2.h: Regenerated. + +2006-10-30 Alan Modra + + * bfd.c (bfd_error_type): Add bfd_error_on_input. + (input_bfd, input_error): New static vars. + (bfd_set_error): Handle bfd_error_on_input. + (bfd_errmsg): Likewise. + (bfd_perror): Simplify. + * archive.c (_bfd_write_archive_contents): Report errors on input. + * bfd-in2.h: Regenerate. + +2006-10-30 Alan Modra + + * elf.c (elfcore_write_note): Pad to 4-byte boundary. + +2006-10-28 Richard Sandiford + + * elf32-mips.c (elf_mips_howto_table_rel): Add R_MIPS_GLOB_DAT. + * elfn32-mips.c (elf_mips_howto_table_rel): Likewise. + (elf_mips_howto_table_rela): Likewise. + * elf64-mips.c (mips_elf64_howto_table_rel): Likewise. + (mips_elf64_howto_table_rela): Likewise. + +2006-10-26 H.J. Lu + + * elf.c (_bfd_elf_init_private_section_data): Assert output + section ELF type instead of check if it is SHT_NULL. Copy + OS/PROC specific flags from input section to output section. + +2006-10-27 Alan Modra + + * section.c (SEC_KEEP): Update comment. + * bfd-in2.h: Regenerate. + * elflink.c (bfd_elf_gc_sections): Ignore SEC_EXCLUDE sections. + * merge.c (_bfd_merge_sections): Set SEC_KEEP on excluded sections. + * stabs.c (_bfd_discard_section_stabs): Likewise. + (_bfd_link_section_stabs): Likewise. Simplify abs_section check. + +2006-10-26 Ben Elliston + + * reloc.c (_bfd_relocate_contents): Remove explicit case 0. + + * elf.c (bfd_section_from_shdr): Remove extraneous breaks. + * targets.c (find_target): Remove extraneous break. + +2006-10-26 Ben Elliston + + * coff-maxq.c (coff_maxq20_reloc): Remove unused variable `howto'. + (struct maxq_reloc_map): Unused; remove. + (maxq_reloc_map): Likewise. + (maxq_reloc_type_lookup): Remove loop over maxq_reloc_map. + +2006-10-26 Ben Elliston + + * elf.c (bfd_elf_set_dyn_lib_class): Change second argument type + from int to enum dynamic_lib_link_class lib_class. + * bfd-in.h (bfd_elf_set_dyn_lib_class): Likewise. + * bfd-in2.h: Regenerate. + +2006-10-25 Alan Modra + Trevor Smigiel + Yukishige Shibata + Nobuhisa Fujinami + Takeaki Fukuoka + + * cpu-spu.c: New file. + * elf32-spu.c: New file. + * elf32-spu.h: New file. + * archures.c: Add SPU support. + * config.bfd: Likewise. + * configure.in: Likewise. + * reloc.c: Likewise. + * targets.c: Likewise. + * Makefile.am: Likewise. Run "make dep-am". + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * Makefile.in: Regenerate. + * configure: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2006-10-23 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_opd): Clarify comment. + +2006-10-23 Alan Modra + + * elf32-score.c: Formatting. + (elf_backend_omit_section_dynsym): Define. + (score_elf_create_dynamic_relocation): Remove code copied from mips. + Don't use section syms in dynamic relocs. Remove unused param. + (score_elf_final_link_relocate): Remove unused param. + +2006-10-23 Alan Modra + + * linker.c (fix_syms): Choose best of previous and next + section based on section flags and vma. + +2006-10-21 Kaz Kojima + + * elf32-sh64.c (sh64_elf_merge_symbol_attribute): Do merging + only when the non visibility part of st_other is non-zero. + * elf64-sh64.c (sh64_elf64_merge_symbol_attribute): Likewise. + +2006-10-20 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Don't extend + PT_DYNAMIC on GNU/Linux targets. + +2006-10-20 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Make the + size of .rel.dyn reflect the value of DT_RELSZ. + +2006-10-20 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_additional_program_headers): Allocate + a PT_NULL header for dynamic objects. + (_bfd_mips_elf_modify_segment_map): Add it. + +2006-10-19 Mei Ligang + + * elf32-score.c (score_elf_rel_dyn_section): Replace + bfd_make_section with bfd_make_section_with_flags. + (_bfd_score_elf_create_dynamic_sections): Ditto. + (score_elf_create_got_section): Ditto. + (score_elf_final_link_relocate): Delete referrence to + EF_SCORE_HASENTRY. + +2006-10-19 Richard Sandiford + + * elfxx-mips.c (sort_dynamic_relocs): Sort relocations against the + same symbol by increasing r_offset. + (sort_dynamic_relocs_64): Likewise. Fix comparisons between very + large and very small symbol indexes. + +2006-10-19 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Add DT_DEBUG + and DT_MIPS_RLD_MAP tags for position-independent executables. + Do not add DT_DEBUG to shared libraries for any MIPS target. + +2006-10-18 H.J. Lu + + PR ld/3290 + * elflink.c (elf_link_add_object_symbols): Hide definitions in + debug sections. + +2006-10-19 Alan Modra + + * elf32-arm.c (bfd_elf32_arm_allocate_interworking_sect): Check, + don't set, glue section size. + (record_arm_to_thumb_glue): Set glue section size here. + (record_thumb_to_arm_glue): Likewise. + (bfd_elf32_arm_add_glue_sections_to_bfd): Formatting. + (bfd_elf32_arm_process_before_allocation): Ignore exluded sections. + +2006-10-18 Roy Marples + + * elf64-sparc.c: Add FreeBSD support. + (elf64_sparc_fbsd_post_process_headers): New function. + * targets.c (_bfd_target_vector): Add bfd_elf64_sparc_freebsd_vec. + * config.bfd (sparc64-*-freebsd*): Set targ_defvec to bfd_elf64_sparc_freebsd_vec. + * configure.in: Add entry for bfd_elf64_sparc_freebsd_vec. + * configure: Regenerate. + +2006-10-17 Mark Shinwell + + * elf32-arm.c (elf32_arm_final_link_relocate): Add support for + R_ARM_MOVW_BREL_NC, R_ARM_MOVW_BREL, R_ARM_MOVT_BREL, + R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVW_BREL and + R_ARM_THM_MOVT_BREL relocations. + +2006-10-17 Mark Shinwell + + * elf32-arm.c (elf32_arm_howto_table_1): Change offset for + R_THM_CALL to 25 and remove FIXME comment. + (using_thumb2): New function. + (elf32_arm_final_link_relocate): Cope with Thumb-2 BL encoding. + +2006-10-17 Mark Shinwell + + * elf32-arm.c (elf32_arm_final_link_relocate): Add cases + for R_ARM_ABS32_NOI and R_ARM_REL32_NOI. + (elf32_arm_gc_sweep_hook): Likewise. + (elf32_arm_check_relocs): Likewise. + (allocate_dynrelocs): Likewise. + +2006-10-17 Alan Modra + + * elf-bfd.h (struct elf_link_hash_table): Reorder. Add + text_index_section and data_index_section. + (struct elf_backend_data): Add elf_backend_init_index_section. + (_bfd_elf_init_1_index_section): Declare. + (_bfd_elf_init_2_index_sections): Declare. + * elfxx-target.h (elf_backend_init_index_section): Define. + (elfNN_bed): Init new field. + * elflink.c (_bfd_elf_link_omit_section_dynsym): Keep first tls + section and text_index_section plus data_index_section. + (_bfd_elf_link_renumber_dynsyms): Clear dynindx on omitted sections. + (_bfd_elf_init_1_index_section): New function. + (_bfd_elf_init_2_index_sections): New function. + (bfd_elf_size_dynsym_hash_dynstr): Call elf_backend_init_index_section. + (elf_link_input_bfd): When emitting relocs, use text_index_section + and data_index_section for removed sections. + * elf-m10300.c (elf_backend_omit_section_dynsym): Define. + * elf32-i386.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-xstormy16.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-sh64.c: Likewise. + * elfxx-ia64.c: Likewise. + * elf32-arm.c (elf32_arm_final_link_relocate): Use text_index_section + and data_index_section sym for relocs against sections with no dynamic + section sym. + (elf_backend_init_index_section): Define. + * elf32-cris.c: Similarly. + * elf32-hppa.c: Similarly. + * elf32-i370.c: Similarly. + * elf32-m68k.c: Similarly. + * elf32-mips.c: Similarly. + * elf32-ppc.c: Similarly. + * elf32-s390.c: Similarly. + * elf32-sparc.c: Similarly. + * elf32-vax.c: Similarly. + * elf64-mips.c: Similarly. + * elf64-ppc.c: Similarly. + * elf64-s390.c: Similarly. + * elf64-sparc.c: Similarly. + * elf64-x86-64.c: Similarly. + * elfn32-mips.c: Similarly. + * elfxx-mips.c: Similarly. + * elfxx-sparc.c: Similarly. + * linker.c (fix_syms): Base symbols in removed sections on + previous section in preference to using absolute section. + +2006-10-16 Andreas Schwab + + * elfxx-ia64.c (addend_compare): Properly compute return value. + +2006-10-15 H.J. Lu + + PR ld/3314 + * elf.c (assign_file_positions_for_non_load_sections): Don't + page align empty SHF_ALLOC sections. + +2006-10-13 Jakub Jelinek + + * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_sections): Set + .plt sh_entsize to 0 if plt header size isn't multiple of + plt entry size or for 32-bit which adds a nop insn at the + end of the .plt section. + +2006-10-12 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_action_discarded): New. + (elf_backend_action_discarded): Define. + +2006-10-11 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_relocate_section): Return after + unresolvable relocation error. + (elf_xtensa_finish_dynamic_symbol): Set value of undefined, weak + symbols to zero. + +2006-10-10 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Add DT_DEBUG + for PIE executables. + +2006-10-03 Jakub Jelinek + + * elf-bfd.h (struct eh_cie_fde): Add set_loc pointer. + * elf-eh-frame.c (skip_cfa_op): Fix handling of DW_CFA_advance_loc. + Handle DW_CFA_{remember,restore}_state, DW_CFA_GNU_window_save, + DW_CFA_val_{offset{,_sf},expression}. + (skip_non_nops): Record number of DW_CFA_set_loc ops. + (_bfd_elf_discard_section_eh_frame): Require skip_non_nops recognizes + all ops. If there are any DW_CFA_set_loc ops and they are pcrel + or going to be pcrel, compute set_loc array. + (_bfd_elf_eh_frame_section_offset): If make_relative, kill relocations + against DW_CFA_set_loc operands. + (_bfd_elf_write_section_eh_frame): Handle DW_CFA_set_loc adjusting. + +2006-10-02 Daniel Jacobowitz + + * elflink.c (_bfd_elf_merge_symbol): Discard references to TLS + symbols from the --just-syms file. + +2006-10-01 Alan Modra + + * elf64-ppc.c (ppc64_elf_build_stubs): Test glink size for + existence of PLT. + +2006-09-29 H.J. Lu + + PR ld/3283 + * elf64-x86-64.c (elf64_x86_64_relocate_section): Don't ignore + relocation overflow on branches to undefweaks. + +2006-09-29 Alan Modra + + * po/BLD-POTFILES.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2006-09-29 Danny Smith + + PR 3276 + * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte + alignment for .data$, .rdata$ and .text$ sections so that sse + and sse2 code will work for linkonce sections too. + * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. + +2006-09-28 Alan Modra + + * elflink.c (_bfd_elf_gc_mark_hook): New function. + * elf-bfd.h (_bfd_elf_gc_mark_hook): Declare. + * elfxx-target.h (elf_backend_gc_mark_hook): Default to above. + * elf-m10300.c (mn10300_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + * elf32-arm.c (elf32_arm_gc_mark_hook): Likewise. + * elf32-cris.c (cris_elf_gc_mark_hook): Likewise. + * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise. + * elf32-i386.c (elf_i386_gc_mark_hook): Likewise. + * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise. + * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise. + * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise. + * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise. + * elf32-s390.c (elf_s390_gc_mark_hook): Likewise. + * elf32-score.c (_bfd_score_elf_gc_mark_hook): Likewise. + * elf32-sh.c (sh_elf_gc_mark_hook): Likewise. + * elf32-vax.c (elf_vax_gc_mark_hook): Likewise. + * elf32-xtensa.c (elf_xtensa_gc_mark_hook): Likewise. + * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise. + * elf64-s390.c (elf_s390_gc_mark_hook): Likewise. + * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise. + * elfxx-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Likewise. + * elf32-bfin.c (bfin_gc_mark_hook): Likewise. + (bfinfdpic_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define for elf32-bfinfdpic. + * elf32-d10v.c (elf32_d10v_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (elf32_d10v_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-fr30.c (fr30_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (fr30_elf_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-frv.c (elf32_frv_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (elf32_frv_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-iq2000.c (iq2000_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (iq2000_elf_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Use + _bfd_elf_gc_mark_hook. + (openrisc_elf_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-v850.c (v850_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (v850_elf_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Use + _bfd_elf_gc_mark_hook. + (xstormy16_elf_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf64-sh64.c (sh_elf64_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (sh_elf64_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-avr.c (elf32_avr_gc_mark_hook): Delete. + (elf32_avr_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-cr16c.c (elf32_cr16c_gc_mark_hook): Delete. + (elf32_cr16c_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-crx.c (elf32_crx_gc_mark_hook): Delete. + (elf32_crx_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-h8300.c (elf32_h8_gc_mark_hook): Delete. + (elf32_h8_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-ip2k.c (ip2k_elf_gc_mark_hook): Delete. + (ip2k_elf_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-m32c.c (m32c_elf_gc_mark_hook, m32c_elf_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-m68hc11.c (elf_backend_gc_mark_hook): Don't define. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-m68hc12.c (elf_backend_gc_mark_hook): Don't define. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-m68hc1x.c (elf32_m68hc11_gc_mark_hook): Delete. + (elf32_m68hc11_gc_sweep_hook): Delete. + * elf32-m68hc1x.h (elf32_m68hc11_gc_mark_hook): Delete. + (elf32_m68hc11_gc_sweep_hook): Delete. + * elf32-msp430.c (elf32_msp430_gc_mark_hook): Delete. + (elf32_msp430_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-mt.c (mt_elf_gc_mark_hook, mt_elf_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + +2006-09-25 Pedro Alves + + * bfd-in.h (CONST_STRNCPY) : Delete. + (LITSTRCPY) : New. + (LITMEMCPY) : New. + * bfd-in2.h : Regenerate. + * elflink.c (bfd_elf_gc_sections) : Use LITMEMCPY. Don't manually + calculate string lengths. + * nlmcode.h (nlm_swap_auxiliary_headers_in) : Use LITMEMCPY. + +2006-09-26 H.J. Lu + + PR ld/3223 + PR ld/3267 + * elf.c (assign_file_positions_for_non_load_sections): Don't + warn zero size allocated sections. + +2006-09-27 Alan Modra + + * elf32-score.c (_bfd_score_elf_relocate_section): Move assignment + to "name" so that compiler realizes it is never uninitialized. + Use bfd_elf_sym_name. + +2006-09-26 H.J. Lu + + PR binutils/3262 + * elf.c (rewrite_elf_program_header): Use bfd_zalloc instead of + bfd_alloc to allocate segment map. + (copy_elf_program_header): Likewise. + +2006-09-26 Mark Shinwell + Joseph Myers + Ian Lance Taylor + Ben Elliston + + * archures.c: Add definition for bfd_mach_arm_iWMMXt2. + * cpu-arm.c (processors): Add bfd_mach_arm_iWMMXt2. + (arch_info_struct, bfd_arm_update_notes): Likewise. + (architectures): Likewise. + (bfd_arm_merge_machines): Check for iWMMXt2. + * bfd-in2.h: Rebuild. + +2006-09-24 H.J. Lu + + * configure: Regenerated. + +2006-09-22 Alan Modra + + * elfcode.h (elf_swap_symbol_in): Return bfd_boolean. Don't abort + on error. + * elf-bfd.h (elf_size_info ): Adjust decl. + (bfd_elf32_swap_symbol_in, bfd_elf64_swap_symbol_in): Likewise. + * elf.c (bfd_elf_get_elf_syms): Test return of swap_symbol_in, + and report error. + * elf32-arm.c (elf32_arm_swap_symbol_in): Return bfd_boolean. + +2006-09-20 Martin Schwidefsky + + * elf32-s390.c (elf_s390_relocate_section): Remove check for code + section in LD to LE linker relaxation for R_390_TLS_LDO32. + * elf64-s390.c (elf_s390_relocate_section): Likewise for + R_390_TLS_LDO64. + +2006-09-20 Kai Tietz + + * configure.in: Added new target-vectors x86_64coff_vec, + x86_64pe_vec, and x86_64pei_vec. + * configure: Regenerate. + * config.bfd: Adjusted x86_64 target architecture detection. + * bfd.c: Add for new target "coff-x86-64" + (bfd_get_sign_extend): Add target vector idents for pe-x86-64. and pei-x86-64. + * coff-x86_64.c: Add new file for x86_64 (AMD64) coff support. + * libpei.h: Adjustments for COFF_WITH_pex64. + * coffcode.h: Add for new target machine, architecture, signature, and internal + signature handler. + * Makefile.am: Add new files to target-all and define make-rule for pex64igen.c + * Makefile.in: Regenerate. + * pe-x86_64.c: Add for new target "pe-x86-64". + * pei-x86_64.c: Add for new target "pei-x86-64". + * peicode.h: Adjusts for new targets. + (coff_swap_filehdr_out): Set for this target to + _bfd_pex64_only_swap_filehdr_out. + (SIZEOF_IDATA4): Define it as 8 byte size for this target. + (SIZEOF_IDATA5): Define it as 8 byte size for this target. + (jump_table jtab): Add for AMD64MAGIC. + (pe_ILF_build_a_bfd): Adjusts for new size of SIZEOF_IDATA4 and SIZE_IDATA5. + (pe_ILF_object_p): Add coff image-file signature to internal + signature translation. + * peXXigen.c: Adjust proper include of target coff-header and + introduced target specific code + (COFF_WITH_pex64): New macro for this target. + (pe_print_idata): New dumping method for import section of PE+ files. + * targets.c: Add new target vectors declarations for x86_64 coff targets. + * coffcode.h: Support code to support the x86_64 PE magic number. + * coff-x86_64.c: New file. + +2006-09-17 Hans-Peter Nilsson + + * elf.c (special_sections_s): Revert last STRING_COMMA_LEN change + for .stabstr entry, explain why. + +2006-09-17 Anton Blanchard + Alan Modra + + * dwarf2.c (concat_filename): Apply DW_AT_comp_dir if dir table + entry isn't absolute. + +2006-09-17 Mei Ligang + + * cpu-score.c: New file. + * elf32-score.c: New file. + * config.bfd: Add Score target. + * Makefile.am: Add Score files. + * Makefile.in: Regenerate. + * archures.c: Add Score architecture. + * reloc.c: Add Score relocs. + * targets.c: Add Score target vectors. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * configure.in: Add Score target. + * configure: Regenerate. + +2006-09-16 Nick Clifton + Pedro Alves + + * bfd-in.h (STRING_COMMA_LEN): New macro. Takes one constant + string as its argument and emits the string followed by a comma + and then the length of the string. + (CONST_STRNEQ): New macro. Checks to see if a variable string + has a constant string as its initial characters. + (CONST_STRNCPY): New macro. Copies a constant string to the start + of a variable string. + * bfd-in2.h: Regenerate. + * archive.c: Make use of the new macros. + * archive64.c: Likewise. + * bfd.c: Likewise. + * coff-ppc.c: Likewise. + * coff-stgo32.c: Likewise. + * coffcode.h: Likewise. + * cofflink.c: Likewise. + * cpu-i960.c: Likewise. + * dwarf2.c: Likewise. + * ecoff.c: Likewise. + * elf-m10300.c: Likewise. + * elf.c: Likewise. + * elf32-arm.c: Likewise. + * elf32-bfin.c: Likewise. + * elf32-cris.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-iq2000.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc12.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh-symbian.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-v850.c: Likewise. + * elf32-vax.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-x86-64.c: Likewise. + * elflink.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * elfxx-sparc.c: Likewise. + * hpux-core.c: Likewise. + * i386linux.c: Likewise. + * ieee.c: Likewise. + * libpei.h: Likewise. + * linker.c: Likewise. + * m68klinux.c: Likewise. + * mmo.c: Likewise. + * nlmcode.h: Likewise. + * osf-core.c: Likewise. + * pef.c: Likewise. + * som.c: Likewise. + * sparclinux.c: Likewise. + * vms-hdr.c: Likewise. + +2006-09-14 Alan Modra + + PR 3181 + * elf.c (_bfd_elf_copy_private_header_data): Fix group members + that have had their SHT_GROUP section removed. + +2006-09-12 H.J. Lu + + PR ld/3197 + * elflink.c (elf_link_output_extsym): Compute bucket only if + needed. + +2006-09-10 H.J. Lu + + PR binutils/3186 + * elf.c (_bfd_elf_make_section_from_shdr): Correct length of + "gnu.linkonce.wi.". + +2006-09-08 Vladimir Prus + + * elf32-arm.c (elf32_arm_swap_symbol_out): Remove + unconditional setting of low bit for Thumb symbol + mistakenly left behind after check for external + symbols was added. Fix comment typo. + +2006-09-07 H.J. Lu + + * elf-bfd.h (elf_link_hash_entry): Add a dynamic field. + (bfd_elf_link_mark_dynamic_symbol): New. + (SYMBOLIC_BIND): New. + + * elf32-i386.c (elf_i386_check_relocs): Replace info->symbolic + with SYMBOLIC_BIND (info, h). + (elf_i386_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. + (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_check_relocs): Likewise. + + * elflink.c (bfd_elf_link_mark_dynamic_symbol): New. + (bfd_elf_record_link_assignment): Call + bfd_elf_link_mark_dynamic_symbol on new entry. + (_bfd_elf_merge_symbol): Likewise. + (_bfd_elf_export_symbol): Return if the symbol isn't exported. + (_bfd_elf_fix_symbol_flags): Replace info->symbolic with + SYMBOLIC_BIND (info, h). + (_bfd_elf_dynamic_symbol_p): Likewise. + (_bfd_elf_symbol_refs_local_p): Likewise. + (bfd_elf_size_dynamic_sections): Updated. + +2006-09-05 Bibo Mao + + PR binutils/3171 + * coffcode.h (coff_write_object_contents): Set the optional + header magic number to PE32PMAGIC instead of ZMAGIC for ia64. + +2006-09-04 Mark Shinwell + + * elf32-arm.c (elf32_arm_howto_table_1): Adjust entries for + R_ARM_THM_ALU_PREL_11_0 and R_ARM_THM_PC12 relocations. + (elf32_arm_final_link_relocate): Handle R_ARM_THM_ALU_PREL_11_0 + and R_ARM_THM_PC12 relocations. + +2006-08-24 Bob Wilson + + * elf32-xtensa.c (xtensa_get_property_section_name): Delete. + (xtensa_get_property_section): New. + (xtensa_read_table_entries): Use xtensa_get_property_section. + (relax_property_section, xtensa_get_property_predef_flags): Handle + group name suffixes in property section names. + (match_section_group): New. + +2006-08-23 Frediano Ziglio + + * archive.c (hpux_uid_gid_encode): Fix thinko decrementing "cnt" + variable. + +2006-08-22 Daniel Jacobowitz + + * elf32-arm.c (elf32_arm_copy_indirect_symbol): Only copy + plt_thumb_refcount from indirect symbols. + +2006-08-22 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Correct GOT and PLT HA + reloc handling. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + +2006-08-21 Mark Shinwell + + * elf32-arm.c (elf32_arm_link_hash_table): Correct typo in + comment for target1_is_rel. + +2006-08-21 Pedro Alves + + * Makefile.am: Add rules to build pe-arm-wince.lo + and pei-arm-wince.lo objects. + * Makefile.in: Regenerate. + * pe-arm-wince.c: New file. + * pei-arm-wince.c: New file. + * pei-arm.c: Remove ARM_WINCE block. + * pe-arm.c: Remove ARM_WINCE block. Rename + bfd_arm_pe_allocate_interworking_sections, + bfd_arm_pe_get_bfd_for_interworking, and + bfd_arm_pe_process_before_allocation to + bfd_armpe_allocate_interworking_sections, + bfd_armpe_get_bfd_for_interworking, and + bfd_armpe_process_before_allocation. Move them before + including bfd.h. + * bfd.c: ARM wince bfd format names were renamed. Adjust. + * coff-arm.c [ARM_WINCE]: Adjust so Windows CE doesn't end up + with unexpected/conflicting relocs. + * targets.c: The arm-wince-pe target got its own new vector. + Adjust. + * config.bfd: Likewise. + * configure.in: Likewise. + * configure: Regenerate. + +2006-08-18 Paul Brook + + * elf32-arm.c (elf32_arm_link_hash_entry): Add export_glue. + (elf32_arm_link_hash_newfunc): Initialize export_glue. + (record_arm_to_thumb_glue): Return stub symbol. + (elf32_arm_create_thumb_stub): New function. + (elf32_arm_to_thumb_stub): Use it. + (elf32_arm_to_thumb_export_stub): New function. + (elf32_arm_begin_write_processing): New function. + (allocate_dynrelocs): Allocate Arm stubs. + (elf_backend_begin_write_processing): Define. + (elf32_arm_symbian_begin_write_processing): Remove ATTRIBUTE_UNUSED. + Call elf32_arm_begin_write_processing. + +2006-08-17 Alan Modra + + * elf64-ppc.c (create_linkage_sections): Align .glink to 8 bytes. + (ppc64_elf_build_stubs): Use new lazy linking stub. + +2006-08-17 Alan Modra + + * elf64-ppc.c (ppc64_elf_size_stubs): Ignore non-code sections. + +2006-08-16 H.J. Lu + + PR ld/3015 + * elf.c (get_program_header_size): Add a PT_GNU_RELRO segment + only if there is a PT_DYNAMIC segment. + (_bfd_elf_map_sections_to_segments): Likewise. + (assign_file_positions_for_load_sections): Set PT_GNU_RELRO + segment alignment to 1. + +2006-08-15 Thiemo Seufer + Nigel Stephens + + * elf32-mips.c, elf64-mips.c, elfn32-mips.c + (elf_backend_merge_symbol_attribute): Define. + * elflink.c (elf_link_add_object_symbols): Merge only the ELF + visibility flags. + * elfxx-mips.c (_bfd_mips_elf_merge_symbol_attribute): New function. + +2006-08-15 Thiemo Seufer + Nigel Stephens + David Ung + + * config.bfd: Add configurations for mips*el-sde-elf* and + mips*-sde-elf*. + +2006-08-14 DJ Delorie + + * elf-m10300.c (elf32_mn10300_link_hash_entry): Add value. + (elf32_mn10300_count_hash_table_entries): New. + (elf32_mn10300_list_hash_table_entries): New. + (sort_by_value): New. + (mn10300_elf_relax_section): Don't skip data sections; restrict + code-specific tests to code-specific areas so that potential + indirect calls can be detected. Check for multiple local symbols + at the same address and merge their flags. + (elf32_mn10300_link_hash_newfunc): Initialize value. + +2006-08-14 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_symbol_processing, + _bfd_mips_elf_add_symbol_hook): Don't try to place small common TLS + symbols in .scommon. + +2006-08-11 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Set + sh_entsize only when sgot was already initialized. + +2006-08-08 DJ Delorie + + * elf32-sh.c (sh_elf_relax_section): Allow for branches across + non-moving .align directives. Preserve any DIR32 offset when + converting bsr's to jsr's. + +2006-08-08 Alan Modra + + * elf64-ppc.c (ppc64_elf_build_stubs): Clear relbrlt reloc_count + after stubs have been built. + +2006-08-07 Nick Clifton + + * elf32-sh.c (vxworks_object_p): Only check for vxworks target + vectors if they are going to be created. + +2006-08-07 Nick Clifton + + * configure.in (bfd_elf32_shnbsd_vec): Fix typo. + * configure: Regenerate. + +2006-08-07 Nick Clifton + + * coff-arm.c (coff_arm_rtype_to_howto): Only check for ARM_SECREL + relocation types if the target is ARM_WINCE. + +2006-08-05 Pedro Alves + + * bfd.c (bfd_get_sign_extend_vma): Add cases for pe-arm-little + and pei-arm-little. + * coff-arm.c (coff_arm_rtype_to_howto) [COFF_WITH_PE]: Handle + ARM_SECREL. + (coff_arm_reloc_type_lookup): Map BFD_RELOC_32_SECREL to + ARM_SECREL. + * pe-arm.c [COFF_SECTION_ALIGNMENT_ENTRIES]: Define. + * pei-arm.c [TARGET_UNDERSCORE]: Define for ARM_WINCE like in + pe-arm.c. + [COFF_SECTION_ALIGNMENT_ENTRIES]: Define. + +2006-08-04 Marcelo Tosatti + + * elflink.c (elf_gc_sweep): If info.print_gc_sections is true, + list removed sections to stderr. + +2006-08-04 Richard Sandiford + Kazu Hirata + Phil Edwards + Nathan Sidwell + + * config.bfd (sh-*-vxworks): Use bfd_elf32_shvxworks_vec and + bfd_elf32_shlvxworks_vec. + * configure.in (bfd_elf32_sh64_vec): Add elf-vxworks.lo. + (bfd_elf32_sh64l_vec, bfd_elf32_sh64lin_vec): Likewise. + (bfd_elf32_sh64blin_vec, bfd_elf32_sh64lnbsd_vec): Likewise. + (bfd_elf32_sh64nbsd_vec, bfd_elf32_sh_vec): Likewise. + (bfd_elf32_shblin_vec, bfd_elf32_shl_vec): Likewise. + (bfd_elf32_shl_symbian_vec, bfd_elf32_shlin_vec): Likewise. + (bfd_elf32_shlnbsd_vec, bfd_elf32_shnbsd_vec): Likewise. + (bfd_elf32_shlvxworks_vec, bfd_elf32_shvxworks_vec): New stanzas. + * configure: Regenerate. + * Makefile.am: Regenerate dependencies. + * Makefile.in: Regenerate. + * elf-vxworks.c (elf_vxworks_gott_symbol_p): New function. + (elf_vxworks_add_symbol_hook): Use it. + (elf_vxworks_link_output_symbol_hook): Likewise. Use the hash + table entry to check for weak undefined symbols and to obtain + the original bfd. + (elf_vxworks_emit_relocs): Use target_index instead of this_idx. + * elf32-sh-relocs.h: New file, split from elf32-sh.c. + (R_SH_DIR32): Use SH_PARTIAL32 for the partial_inplace field, + SH_SRC_MASK32 for the src_mask field, and SH_ELF_RELOC for the + special_function field. + (R_SH_REL32): Use SH_PARTIAL32 and SH_SRC_MASK32 here too. + (R_SH_REL32, R_SH_TLS_GD_32, R_SH_TLS_LD_32): Likewise. + (R_SH_TLS_LDO_32, R_SH_TLS_IE_32, R_SH_TLS_LE_32): Likewise. + (R_SH_TLS_DTPMOD32, R_SH_TLS_DTPOFF32, R_SH_TLS_TPOFF32): Likewise. + (R_SH_GOT32, R_SH_PLT32, R_SH_COPY, R_SH_GLOB_DAT): Likewise. + (R_SH_JMP_SLOT, R_SH_RELATIVE, R_SH_GOTOFF, R_SH_GOTPC): Likewise. + (SH_PARTIAL32, SH_SRC_MASK32, SH_ELF_RELOC): Undefine at end of file. + * elf32-sh.c: Include elf32-vxworks.h. + (MINUS_ONE): Define. + (sh_elf_howto_table): Include elf32-sh-relocs.h with SH_PARTIAL32 + set to TRUE, SH_SRC_MASK32 set to 0xffffffff, and SH_ELF_RELOC set + to sh_elf_reloc. + (sh_vxworks_howto_table): New variable. Include elf32-sh-relocs.h + with SH_PARTIAL32 set to FALSE, SH_SRC_MASK32 set to 0, and + SH_ELF_RELOC set to bfd_elf_generic_reloc. + (vxworks_object_p, get_howto_table): New functions. + (sh_elf_reloc_type_lookup): Fix typo. Use get_howto_table. + (sh_elf_info_to_howto): Use get_howto_table. + (sh_elf_relax_section): Honor the partial_inplace field of the + R_SH_DIR32 howto. + (sh_elf_relax_delete_bytes): Likewise. + (elf_sh_plt_info): New structure. + (PLT_ENTRY_SIZE): Replace both definitions with... + (ELF_PLT_ENTRY_SIZE): ...this new macro, with separate definitions for + INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA. + (elf_sh_plt0_entry_be): Update sizes of both definitions accordingly. + (elf_sh_plt0_entry_le): Likewise. + (elf_sh_plt_entry_be, elf_sh_plt_entry_le): Likewise. + (elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le): Likewise. + (elf_sh_plts): New structure, with separate definitions for + INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA. + (elf_sh_plt0_entry): Delete both definitions. + (elf_sh_plt_entry, elf_sh_pic_plt_entry): Likewise. + (elf_sh_sizeof_plt, elf_sh_plt_plt0_offset): Likewise. + (elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset): Likewise. + (elf_sh_plt_reloc_offset): Likewise. + (movi_shori_putval): Delete in favor of... + (install_plt_field): ...this new function, with separate definitions + for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA. + (get_plt_info): New function, with separate definitions + for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA. + (elf_sh_plt0_linker_offset, elf_sh_plt0_gotid_offset): Delete. + (VXWORKS_PLT_HEADER_SIZE, VXWORKS_PLT_ENTRY_SIZE): New macros. + (vxworks_sh_plt0_entry_be, vxworks_sh_plt0_entry_le): New constants. + (vxworks_sh_plt_entry_be, vxworks_sh_plt_entry_le): Likewise. + (vxworks_sh_pic_plt_entry_be, vxworks_sh_pic_plt_entry_le): Likewise. + (get_plt_index, get_plt_offset): New functions. + (elf_sh_link_hash_table): Add srelplt2, plt_info and vxworks_p fields. + (sh_elf_link_hash_table_create): Initialize them. + (sh_elf_create_dynamic_sections): Call + elf_vxworks_create_dynamic_sections for VxWorks. + (allocate_dynrelocs): Use htab->plt_info to get the size of PLT + entries. Allocate relocation entries in .rela.plt.unloaded if + generating a VxWorks executable. + (sh_elf_always_size_sections): New function. + (sh_elf_size_dynamic_sections): Extend .rela.plt handling to + .rela.plt.unloaded. + (sh_elf_relocate_section): Use get_howto_table. Honor + partial_inplace when calculating the addend for dynamic + relocations. Use get_plt_index. + (sh_elf_finish_dynamic_symbol): Use get_plt_index, install_plt_field + and htab->plt_info. Fill in the bra .plt offset for VxWorks + executables. Populate .rela.plt.unloaded. Do not make + _GLOBAL_OFFSET_TABLE_ absolute on VxWorks. + (sh_elf_finish_dynamic_sections): Use install_plt_field and + htab->plt_info. Handle cases where there is no special PLT header. + Populate the first relocation in .rela.plt.unloaded and fix up + the remaining entries. + (sh_elf_plt_sym_val): Use get_plt_info. + (elf_backend_always_size_sections): Define. + (TARGET_BIG_SYM, TARGET_BIG_NAME): Override for VxWorks. + (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Likewise. + (elf32_bed, elf_backend_want_plt_sym): Likewise. + (elf_symbol_leading_char, elf_backend_want_got_underscore): Likewise. + (elf_backend_grok_prstatus, elf_backend_grok_psinfo): Likewise. + (elf_backend_add_symbol_hook): Likewise. + (elf_backend_link_output_symbol_hook): Likewise. + (elf_backend_emit_relocs): Likewise. + (elf_backend_final_write_processing): Likewise. + (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): Likewise. + * targets.c (bfd_elf32_shlvxworks_vec): Declare. + (bfd_elf32_shvxworks_vec): Likewise. + (_bfd_target_vector): Include bfd_elf32_shlvxworks_vec and + bfd_elf32_shvxworks_vec. + +2006-08-02 Mark Kettenis + + * configure.in (arm-*-openbsd*): Set COREFILE to netbsd-core.lo. + * configure: Regenerate. + +2006-08-02 Petr Salinger + + PR binutils/2983 + * elf64-x86-64.c: Add FreeBSD support. + (elf64_x86_64_fbsd_post_process_headers): New function. + * targets.c (_bfd_target_vector): Add bfd_elf64_x86_64_freebsd_vec. + * config.bfd (x64_64-*-freebsd*): Add bfd_elf64_x86_64_freebsd_vec + to the targ_selvecs. + * configure.in: Add entry for bfd_elf64_x86_64_freebsd_vec. + * configure: Regenerate. + +2006-07-26 Andreas Schwab + + * elfxx-ia64.c (elfNN_ia64_choose_gp): Use rawsize if set. + +2006-07-26 Alan Modra + + * elf.c (elf_modify_segment_map): Delete empty PT_LOAD segments. + * elf32-xtensa.c (elf_xtensa_modify_segment_map): Delete. + (define elf_backend_modify_segment_map): Don't define. + +2006-07-25 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Allow + linking of objects for compatible machine types. + +2006-07-25 Thiemo Seufer + + * elfxx-mips.c (mips_elf_next_relocation): Tighten check to test + also for same symbol. + +2006-07-25 Thiemo Seufer + + * elfxx-mips.c (mips_elf_calculate_relocation): Remove magic constant. + +2006-07-24 Michael Wetherell + + * elf.c (bfd_section_from_shdr): Reject unrecognised OS-specific + sections only if the SHF_OS_NONCONFORMING flag is present. + +2006-07-24 Nick Clifton + + PR ld/2729 + * peXXigen.c (_bfd_XXi_final_link_postscript): Check for the + existance of output sections before putting their entries into the + DataDictionary. + +2006-07-20 Thiemo Seufer + + * elf32-mips.c (mips16_jump_reloc): Remove function. + (elf_mips16_howto_table_rel): Use _bfd_mips_elf_generic_reloc + instead of mips16_jump_reloc. + * elf64_mips.c, wlfn32-mips.c (mips16_jump_reloc): Remove function. + (elf_mips16_howto_table_rel, elf_mips16_howto_table_rela): Use + _bfd_mips_elf_generic_reloc instead of mips16_jump_reloc. + +2006-07-19 Alan Modra + + * bfd-in.h (enum notice_asneeded_action): Define. + * bfd-in2.h: Regenerate. + * elflink.c (elf_link_add_object_symbols): Call linker "notice" + function with NULL name for as-needed handling. + +2006-07-18 Paul Brook + + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * reloc.c: Add BFD_RELOC_ARM_T32_ADD_IMM. + +2006-07-18 Nick Clifton + + * elfxx-mips.c (_bfd_mips_elf_common_definition): New function. + Consider SHN_MIPS_ACOMMON and SHN_MIPS_SCOMMON as being common + sections. + * elfxx-mips.h (_bfd_mips_elf_common_definition): Prototype. + +2006-07-14 Jakub Jelinek + + * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Fix cinfo.shift2 value. + +2006-07-14 Mark Kettenis + + * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Move declarations + to the start of a block. + +2006-07-13 Nick Clifton + + * coff-sh.c (_bfd_sh_align_load_span): Catch sh_insn_info() + returning a NULL value. + +2006-07-12 H.J. Lu + + PR ld/2884 + * elflink.c (_bfd_elf_merge_symbol): Copy the symbol info from + the old versioned dynamic definition to the new one with + non-default visibility. Hide the symbol if it is hidden or + internal. + +2006-07-12 Matthew R. Dempsky + + * cpu-m68k.c (bfd_m68k_compatible): Handle CPU32. + +2006-07-10 Jakub Jelinek + + * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_GNU_HASH. + (bfd_section_from_shdr, elf_fake_sections, assign_section_numbers): + Handle SHT_GNU_HASH. + (special_sections_g): Include .gnu.hash section. + (bfd_elf_gnu_hash): New function. + * elf-bfd.h (bfd_elf_gnu_hash, _bfd_elf_hash_symbol): New prototypes. + (struct elf_backend_data): Add elf_hash_symbol method. + * elflink.c (_bfd_elf_link_create_dynamic_sections): Create .hash + only if info->emit_hash, create .gnu.hash section if + info->emit_gnu_hash. + (struct collect_gnu_hash_codes): New type. + (elf_collect_gnu_hash_codes, elf_renumber_gnu_hash_syms, + _bfd_elf_hash_symbol): New functions. + (compute_bucket_count): Don't compute HASHCODES array, instead add + that and NSYMS as arguments. Use bed->s->sizeof_hash_entry + instead of bed->s->arch_size / 8. Fix .hash size estimation. + When not optimizing, use the number of hashed symbols rather than + dynsymcount. + (bfd_elf_size_dynamic_sections): Only add DT_HASH if info->emit_hash, + and ADD DT_GNU_HASH if info->emit_gnu_hash. + (bfd_elf_size_dynsym_hash_dynstr): Size .hash only if info->emit_hash, + adjust compute_bucket_count caller. Create and populate .gnu.hash + section if info->emit_gnu_hash. + (elf_link_output_extsym): Only populate .hash section if + finfo->hash_sec != NULL. + (bfd_elf_final_link): Adjust assertion. Handle DT_GNU_HASH. + * elfxx-target.h (elf_backend_hash_symbol): Define if not yet defined. + (elfNN_bed): Add elf_backend_hash_symbol. + * elf64-x86-64.c (elf64_x86_64_hash_symbol): New function. + (elf_backend_hash_symbol): Define. + * elf32-i386.c (elf_i386_hash_symbol): New function. + (elf_backend_hash_symbol): Define. + +2006-07-05 Nick Clifton + + PR ld/2659 + * cofflink.c (_bfd_coff_link_input_bfd): Fix selection of aux + entry when multiple definitions of a symbol are encountered. + +2006-06-30 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Use xchg %ax,%ax + instead of 2 nops. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + (elf64_x86_64_plt0_entry): Use nopl 0(%rax) instead of 4 nops. + +2006-06-29 Jakub Jelinek + + PR ld/2513 + * elf32-i386.c (GOT_TLS_MASK, GOT_TLS_IE_IE, GOT_TLS_IE_GD, + GOT_TLS_IE_MASK, elf_i386_check_relocs, allocate_dynrelocs): Revert + 2006-04-08 changes. + (elf_i386_relocate_section): Likewise. For GD->IE transition + change subl into addl whenever tls_type is GOT_TLS_IE_POS. + +2006-06-23 Alan Modra + + PR ld/2754 + * elf.c (bfd_elf_mkobject): Don't alloc if already done. Set + program_header_size to -1. + (_bfd_elf_map_sections_to_segments): Adjust program_header_size check. + (assign_file_positions_for_load_sections ): Likewise. + (_bfd_elf_sizeof_headers): Use saved program_header_size if + available. + * elf32-arm.c (elf32_arm_mkobject): Call bfd_elf_mkobject, don't + alloc if already done. + * elf32-i386.c (elf_i386_mkobject): Likewise. + * elf32-ppc.c (ppc_elf_mkobject): Likewise. + * elf32-s390.c (elf_s390_mkobject): Likewise. + * elf32-sh.c (sh_elf_mkobject): Likewise. + * elf64-alpha.c (elf64_alpha_mkobject): Likewise. + * elf64-ppc.c (ppc64_elf_mkobject): Likewise. + * elf64-s390.c (elf_s390_mkobject): Likewise. + * elf64-x86-64.c (elf64_x86_64_mkobject): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_mkobject): Likewise. + +2006-06-20 Jakub Jelinek + + * elflink.c (elf_link_add_object_symbols): Don't create .tcommon + section for relocatable link. + +2006-06-21 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add + elf_backend_modify_program_headers. + * elfxx-target.h (elf_backend_modify_program_headers): Define. + (elfNN_bed): Init new field. + * elf.c (elf_modify_segment_map): Remove comment. + (assign_file_positions_for_load_sections): Only call + elf_modify_segment_map for objcopy/strip. + (assign_file_positions_except_relocs): Call + elf_backend_modify_program_headers. + * elf32-frv.c (elf32_frvfdpic_always_size_sections): Don't make + .stack section. + (elf32_frvfdpic_modify_segment_map): Delete. + (elf32_frvfdpic_modify_program_headers): New. + (elf_backend_modify_segment_map): Don't define. + (elf_backend_modify_program_headers): Define. + * elf32-bfin.c (elf32_bfinfdpic_always_size_sections): Don't make + .stack section. + (elf32_bfinfdpic_modify_segment_map): Delete. + (elf32_bfinfdpic_modify_program_headers): New. + (elf_backend_modify_segment_map): Don't define. + (elf_backend_modify_program_headers): Define. + * elfxx-ia64.c (elfNN_ia64_modify_program_headers): New function. + Split out from.. + (elfNN_ia64_modify_segment_map): ..here. + (elf_backend_modify_program_headers): Define. + +2006-06-20 Jakub Jelinek + + * bfd.c (bfd_record_phdr): Clear p_align and p_align_valid fields. + * elf.c (_bfd_elf_link_hash_table_init): Clear hplt field. + +2006-06-20 Alan Modra + + * elf-bfd.h: Formatting. + (_bfd_elf_map_sections_to_segments): Declare. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame_hdr): Don't + clear program_header_size. + * elf.c (get_program_header_size): Move. Don't use or set saved + program_header_size here. + (elf_modify_segment_map): New function. Split out from.. + (assign_file_positions_for_load_sections): ..here. Assert + header size is correct. Remove dead code. + (_bfd_elf_map_sections_to_segments): Rename from + map_sections_to_segments. Make global. Use get_program_header_size + when we need estimate of header size. Call elf_modify_segment_map. + Set program_header_size. + (print_segment_map): Delete. + (_bfd_elf_sizeof_headers): If segment_map available, get the + actual size. + * elf32-arm.c (elf32_arm_symbian_modify_segment_map): Make safe + for calling more than once. + * elf32-bfin.c (elf32_bfinfdpic_modify_segment_map): Likewise. + * elf32-frv.c (elf32_frvfdpic_modify_segment_map): Likewise. + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Likewise. + * elf32-i370.c (elf_backend_add_symbol_hook): Delete. + (elf_backend_additional_program_headers): Delete. + (elf_backend_modify_segment_map): Delete. + * elf64-hppa.c (elf64_hppa_modify_segment_map): Convert to ISO C. + * elfxx-ia64.c (elfNN_ia64_modify_segment_map): Likewise. + * doc/bfdint.texi: Delete SIZEOF_HEADERS difficulties. + +2006-06-19 Vladimir Prus + + * elf32-arm.c (elf32_arm_swap_symbol_out): Don't set low + bit for undefined symbols. + +2006-06-19 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add bfd_link_info pointer + parameter. + (_bfd_elf_sizeof_headers): Replace bfd_boolean param with + bfd_link_info pointer. + * targets.c (struct bfd_target <_bfd_sizeof_headers>): Likewise. + * bfd.c (bfd_sizeof_headers): Tweak param name. + * aout-adobe.c (aout_adobe_sizeof_headers): Adjust. + * aoutx.h (NAME (aout, sizeof_headers)): Adjust. + * binary.c (binary_sizeof_headers): Adjust. + * bout.c (b_out_sizeof_headers): Adjust. + * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust. + * coff64-rs6000.c (xcoff64_sizeof_headers): Adjust. + * coffgen.c (coff_sizeof_headers): Adjust. + * ecoff.c (_bfd_ecoff_sizeof_headers): Adjust. + (ecoff_compute_section_file_positions): Adjust. + (_bfd_ecoff_write_object_contents): Adjust. + * elf.c (get_program_header_size, _bfd_elf_sizeof_headers): Adjust. + * elf32-arm.c (elf32_arm_additional_program_headers): Adjust. + * elf32-i370.c (elf_backend_additional_program_headers): Adjust. + * elf32-ppc.c (ppc_elf_additional_program_headers): Adjust. + * elf64-hppa.c (elf64_hppa_additional_program_headers): Adjust. + * elf64-x86-64.c (elf64_x86_64_additional_program_headers): Adjust. + * elfxx-ia64.c (elfNN_ia64_additional_program_headers): Adjust. + * elfxx-mips.c (_bfd_mips_elf_additional_program_headers): Adjust. + * elfxx-mips.h (_bfd_mips_elf_additional_program_headers): Adjust. + * i386msdos.c: Convert to ISO C. + (msdos_sizeof_headers): Adjust. + * i386os9k.c: Convert to ISO C. + (os9k_sizeof_headers): Adjust. + * ieee.c (ieee_sizeof_headers): Adjust. + * ihex.c (ihex_sizeof_headers): Adjust. + * libaout.h (NAME (aout, sizeof_headers)): Adjust. + * libbfd-in.h (_bfd_nolink_sizeof_headers): Adjust. + * libcoff-in.h (coff_sizeof_headers): Adjust. + * libecoff.h (_bfd_ecoff_sizeof_headers): Adjust. + * mach-o.c (bfd_mach_o_sizeof_headers): Adjust. + * mmo.c (mmo_sizeof_headers): Adjust. + * oasys.c (oasys_sizeof_headers): Adjust. + * pdp11.c (NAME (aout, sizeof_headers)): Adjust. + * pef.c (bfd_pef_sizeof_headers): Adjust. + * ppcboot.c (ppcboot_sizeof_headers): Adjust. + * som.c (som_sizeof_headers): Adjust. + * srec.c (srec_sizeof_headers): Adjust. + * tekhex.c (tekhex_sizeof_headers): Adjust. + * versados.c (versados_sizeof_headers): Adjust. + * vms.c (vms_sizeof_headers): Adjust. + * xcoff-target.h (_bfd_xcoff_sizeof_headers): Adjust. + * xsym.c (bfd_sym_sizeof_headers): Adjust. + * xsym.h (bfd_sym_sizeof_headers): Adjust. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2006-06-15 Mark Shinwell + + * bfd-in2.h: Regenerate. + * elf32-arm.c (R_ARM_ALU_PC_G0_NC, R_ARM_ALU_PC_G0, + R_ARM_ALU_PC_G1_NC, R_ARM_ALU_PC_G1, R_ARM_ALU_PC_G2, + R_ARM_LDR_PC_G1, R_ARM_LDR_PC_G2, R_ARM_LDRS_PC_G0, + R_ARM_LDRS_PC_G1, R_ARM_LDRS_PC_G2, R_ARM_LDC_PC_G0, + R_ARM_LDC_PC_G1, R_ARM_LDC_PC_G2, R_ARM_ALU_SB_G0_NC, + R_ARM_ALU_SB_G0, R_ARM_ALU_SB_G1_NC, R_ARM_ALU_SB_G1, + R_ARM_ALU_SB_G2, R_ARM_LDR_SB_G0, R_ARM_LDR_SB_G1, + R_ARM_LDR_SB_G2, R_ARM_LDRS_SB_G0, R_ARM_LDRS_SB_G1, + R_ARM_LDRS_SB_G2, R_ARM_LDC_SB_G0, R_ARM_LDC_SB_G1, + R_ARM_LDC_SB_G2): New relocation types. + (R_ARM_PC13): Rename to AAELF name R_ARM_LDR_PC_G0 and + adjust HOWTO entry to be consistent with R_ARM_LDR_PC_G1 + and friends. + (elf32_arm_howto_table_3): Delete; contents merged into + elf32_arm_howto_table_2. + (elf32_arm_howto_from_type): Adjust correspondingly. + (elf32_arm_reloc_map): Extend with the above relocations. + (calculate_group_reloc_mask): New function. + (identify_add_or_sub): New function. + (elf32_arm_final_link_relocate): Support for the above + relocations. + * reloc.c: Add enumeration entries for BFD_RELOC_ARM_... + codes to correspond to the above relocations. + +2006-06-14 Richard Sandiford + + * elf32-m68k.c (elf_m68k_plt_info): New structure. + (elf_m68k_plt0_entry): Add R_68K_PC32-style in-place addends. + (elf_m68k_plt_entry): Likewise. + (elf_m68k_plt_info): New table. + (CFV4E_PLT_ENTRY_SIZE): Rename to... + (ISAB_PLT_ENTRY_SIZE): ...this. + (CFV4E_FLAG): Delete. + (elf_cfv4e_plt0_entry): Rename to... + (elf_isab_plt0_entry): ...this. Adjust comments. Use (-6,%pc,%d0) + for the second instruction too. + (elf_cfv4e_plt_entry): Rename to... + (elf_isab_plt_entry): ...this. Adjust comments and use (-6,%pc,%d0). + (elf_isab_plt_info): New table. + (CPU32_FLAG): Delete. + (PLT_CPU32_ENTRY_SIZE): Rename to... + (CPU32_PLT_ENTRY_SIZE): ...this. + (elf_cpu32_plt0_entry): Update bounds accordingly. Add R_68K_PC32- + style in-place addends. + (elf_cpu32_plt_entry): Likewise. + (elf_cpu32_plt_info): New table. + (elf_m68k_link_hash_table): Add a plt_info field. + (elf_m68k_link_hash_table_create): Initialize it. + (elf_m68k_get_plt_info): New function. + (elf_m68k_always_size_sections): Likewise. + (elf_m68k_adjust_dynamic_symbol): Use the plt_info hash table field. + (elf_m68k_install_pc32): New function. + (elf_m68k_finish_dynamic_symbol): Factor code using plt_info and + elf_m68k_install_pc32. + (elf_m68k_finish_dynamic_sections): Likewise. + (elf_m68k_plt_sym_val): Use elf_m68k_get_plt_info. + (elf_backend_always_size_sections): Define. + +2006-06-14 Alan Modra + + * elflink.c (elf_link_add_object_symbols): Save and restore + struct bfd_hash_table table, size and count fields for + as-needed libs. + +2006-06-12 Thiemo Seufer + + * elf32-mips.c: Expand comment about ABI-mandated pagesize values. + (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): define in a more obvious way. + * elf64-mips.c, elfn32-mips.c (ELF_MAXPAGESIZE): Fix value for IRIX6. + Delete old comments. + (ELF_COMMONPAGESIZE): Define in a more obvious way. + +2006-06-12 Nick Clifton + + PR binutils/2735 + * elflink.c (elf_link_add_object_symbols): Fix the warning message + about mismatched alignments to allow for the case where the common + alignment has been deduced from the section alignment. + * bfd.c (_bfd_default_error_handler): Update comment to explain + why bfd and asection varargs are out of order. Explicitly catch + and abort on NULL bfd and asection arguments. + +2006-06-11 Richard Sandiford + Thiemo Seufer + + * elfxx-mips.c (mips_elf_link_hash_table): Add function_stub_size. + (STUB_ORI): New macro. + (STUB_LI16U): Fix formatting. + (MIPS_FUNCTION_STUB_SIZE): Delete. + (MIPS_FUNCTION_STUB_MAX_SIZE): Likewise. + (MIPS_FUNCTION_STUB_NORMAL_SIZE): New macro. + (MIPS_FUNCTION_STUB_BIG_SIZE): Likewise. + (_bfd_mips_elf_adjust_dynamic_symbol): Use htab->function_stub_size + instead of MIPS_FUNCTION_STUB_SIZE. + (count_section_dynsyms): New function, split out from + _bfd_mips_elf_final_link. + (_bfd_mips_elf_always_size_sections): Get a worst-case estimate + of the number of dynamic symbols needed and use it to set up + function_stub_size. Use function_stub_size rather than + MIPS_FUNCTION_STUB_SIZE to determine the size of the stub section. + Use 16-byte stubs for 0x10000 dynamic symbols. + (_bfd_mips_elf_size_dynamic_sections): Use htab->function_stub_size + instead of MIPS_FUNCTION_STUB_SIZE. Fix formatting. + (_bfd_mips_elf_finish_dynamic_symbol): Likewise. Change the + size of the stub buffer from MIPS_FUNCTION_STUB_MAX_SIZE to + MIPS_FUNCTION_STUB_BIG_SIZE. Tweak the check for unhandled dynindxes. + Use MIPS_FUNCTION_STUB_BIG_SIZE rather than a hard-coded 20. + Use STUB_ORI rather than STUB_LI16U for big stubs. + (_bfd_mips_elf_link_hash_table_create): Initialize function_stub_size. + (_bfd_mips_elf_final_link): Use count_section_dynsyms. + +2006-06-09 David Ung + + * bfd/elfxx-mips.c (mips_elf_calculate_relocation): Fix mode for stub + calling relocations. + +2006-06-08 David Daney + + * elfxx-mips.c (STUB_LI16): Removed. + (STUB_LUI): New macro. + (STUB_LI16U): Ditto. + (STUB_LI16S): Ditto. + (MIPS_FUNCTION_STUB_SIZE): Rewrote to take info parameter. + (_bfd_mips_elf_adjust_dynamic_symbol): Pass info parameter to + MIPS_FUNCTION_STUB_SIZE. + (_bfd_mips_elf_always_size_sections): Ditto. + (_bfd_mips_elf_size_dynamic_sections): Ditto. + (_bfd_mips_elf_finish_dynamic_sections): Ditto. + (_bfd_mips_elf_finish_dynamic_symbol): Rewrote stub generation + to allow larger symbol table indexes. + +2006-06-07 Joseph S. Myers + + * po/Make-in (pdf, ps): New dummy targets. + +2006-06-06 Alan Modra + + * hash.c (bfd_hash_lookup): Correct stray line. + + * elf.c (_bfd_elf_init_private_section_data): Comment typo. + (elfcore_grok_nto_status): Use long instead of pid_t. + (elfcore_grok_nto_regs, elfcore_grok_nto_note): Likewise. + +2006-06-05 Daniel Jacobowitz + + * po/Make-in (top_builddir): Define. + +2006-06-05 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * config.in: Regenerate. + +2006-06-02 Alan Modra + H.J. Lu + + PR ld/2723 + * elflink.c (bfd_elf_final_link): Don't output section symbols + for special ELF sections. + +2006-06-01 Alan Modra + + * stabs.c (_bfd_link_section_stabs): Use bfd_make_section*_with_flags + instead of bfd_make_section*. + * aix386-core.c: Likewise. + * aix5ppc-core.c: Likewise. + * aout-adobe.c: Likewise. + * aoutf1.h: Likewise. + * binary.c: Likewise. + * cisco-core.c: Likewise. + * coff-arm.c: Likewise. + * coff-h8300.c: Likewise. + * elf.c: Likewise. + * elf32-bfin.c: Likewise. + * elf32-m32c.c: Likewise. + * hppabsd-core.c: Likewise. + * hpux-core.c: Likewise. + * i386linux.c: Likewise. + * ieee.c: Likewise. + * ihex.c: Likewise. + * irix-core.c: Likewise. + * lynx-core.c: Likewise. + * m68klinux.c: Likewise. + * mach-o.c: Likewise. + * netbsd-core.c: Likewise. + * nlmcode.h: Likewise. + * opncls.c: Likewise. + * osf-core.c: Likewise. + * peXXigen.c: Likewise. + * ppcboot.c: Likewise. + * ptrace-core.c: Likewise. + * rs6000-core.c: Likewise. + * sco5-core.c: Likewise. + * sparclinux.c: Likewise. + * srec.c: Likewise. + * sunos.c: Likewise. + * trad-core.c: Likewise. + * xcofflink.c: Likewise. + * xsym.c: Likewise. + +2006-05-31 Daniel Jacobowitz + + * Makefile.am (INCLUDES): Use @INCINTL@. + * acinclude.m4: Include new gettext macros. + * configure.in: Use ZW_GNU_GETTEXT_SISTER_DIR and AM_PO_SUBDIRS. + Manually substitute POFILES and GMOFILES. + * Makefile.in, aclocal.m4, configure, doc/Makefile.in: Regenerated. + +2006-05-30 H.J. Lu + + * bfd.c (bfd_emul_get_maxpagesize): New. + (bfd_elf_set_pagesize): Likewise. + (bfd_emul_set_maxpagesize): Likewise. + (bfd_emul_get_commonpagesize): Likewise. + (bfd_emul_set_commonpagesize): Likewise. + * bfd-in2.h: Regenerated. + + * elf-bfd.h (elf_backend_data): Add commonpagesize. + (xvec_get_elf_backend_data): New. + (get_elf_backend_data): Use xvec_get_elf_backend_data. + + * elf32-arm.c (elf32_arm_vxworks_bed): Remove const. + * elfxx-target.h (elfNN_bed): Likewise. + + * elf32-arm.c (ELF_COMMONPAGESIZE): Defined. + * elf32-mips.c (ELF_COMMONPAGESIZE): Likewise. + * elf32-ppc.c (ELF_COMMONPAGESIZE): Likewise. + * elf32-sh.c (ELF_COMMONPAGESIZE): Likewise. + * elf32-sh64.c (ELF_COMMONPAGESIZE): Likewise. + * elf32-sparc.c (ELF_COMMONPAGESIZE): Likewise. + * elf64-alpha.c (ELF_COMMONPAGESIZE): Likewise. + * elf64-ppc.c (ELF_COMMONPAGESIZE): Likewise. + * elf64-sparc.c (ELF_COMMONPAGESIZE): Likewise. + * elf64-x86-64.c (ELF_COMMONPAGESIZE): Likewise. + * elfn32-mips.c (ELF_COMMONPAGESIZE): Likewise. + * elfxx-ia64.c (ELF_COMMONPAGESIZE): Likewise. + + * elfxx-target.h (ELF_COMMONPAGESIZE): Define if not defined. + (elfNN_bed): Initialize commonpagesize with ELF_COMMONPAGESIZE. + + * targets.c (bfd_find_target): Support NULL abfd. + +2006-05-30 Nick Clifton + + * po/es.po: Updated Spanish translation. + +2006-05-27 Alan Modra + H.J. Lu + + * elf.c (assign_file_positions_for_load_sections): Retrieve + maxpagesize from m->p_align if it is valid. Set p_vaddr, + p_paddr and p_align earlier. Revert 2006-05-19 change to p_align. + (copy_elf_program_header): Copy p_align. Set p_align_valid. + +2006-05-26 H.J. Lu + + * elf64-x86-64.c (ELF_MINPAGESIZE): Changed to 0x1000. + +2006-05-25 H.J. Lu + + * elf64-x86-64.c (ELF_MINPAGESIZE): Set to 0x100000. + +2006-05-25 H.J. Lu + + * elf64-x86-64.c (ELF_MAXPAGESIZE): Updated to 0x200000. + +2006-05-26 Alan Modra + + * elf.c (sym_is_global): Return a bfd_boolean. + (ignore_section_sym): New function. + (elf_map_symbols): Use ignore_section_sym to discard some syms. + (_bfd_elf_symbol_from_bfd_symbol): Ensure section belongs to + bfd before using elf_section_syms. + +2006-05-25 H.J. Lu + + * config.bfd: (sh-*-linux*): Treat as 64bit target. + (sh*l*-*-netbsdelf*): Likewise. + (sh-*-netbsdelf*): Likewise. + (shl*-*-elf*): Likewise. + (sh[1234]l*-*-elf*): Likewise. + (sh3el*-*-elf*): Likewise. + (shl*-*-kaos*): Likewise. + (sh-*-elf*): Likewise. + (sh[1234]*-elf*): Likewise. + (sh-*-rtems*): Likewise. + (sh-*-kaos*): Likewise. + +2006-05-24 H.J. Lu + + PR ld/1485 + * config.bfd: Set want64 to true if 64bit bfd is used. + (sh-*-linux*): Use targ64_selvecs for 64bit targets. + (sh*l*-*-netbsdelf*): Likewise. + (sh-*-netbsdelf*): Likewise. + (shl*-*-elf*): Likewise. + (sh[1234]l*-*-elf*): Likewise. + (sh3el*-*-elf*): Likewise. + (shl*-*-kaos*): Likewise. + (sh-*-elf*): Likewise. + (sh[1234]*-elf*): Likewise. + (sh-*-rtems*): Likewise. + (sh-*-kaos*): Likewise. + +2006-05-24 Paul Brook + + * elf-bfd.h (elf_backend_data): Add elf_backend_output_arch_local_syms + * elf32-arm.c (output_arch_syminfo): Define. + (elf32_arm_ouput_plt_map_sym, elf32_arm_output_plt_map, + elf32_arm_output_arch_local_syms): New functions. + (elf_backend_output_arch_local_syms): Define. + * elflink.c (bfd_elf_final_link): Call + elf_backend_output_arch_local_syms. + * elfxx-target.h (elf_backend_output_arch_local_syms): Provide default + definition. + (elfNN_bed): Add elf_backend_output_arch_local_syms. + +2006-05-24 Paul Brook + + * elf32-arm.c (put_arm_insn, put_thumb_insn): New functions. + (elf32_thumb_to_arm_stub, elf32_arm_to_thumb_stub, + elf32_arm_finish_dynamic_symbol): Use them. + +2006-05-24 Carlos O'Donell + Randolph Chung + + * elf-hppa.h (reloc_hppa_howto_table): Check bitfield for + TPREL21L/TPREL14R relocations. Handle LTOFF_TP14R relocations. + Add handling for TLS relocations. + (elf_hpp_reloc_final_type): Handle TLS relocs. + * elf32-hppa.c: Add authors for cleanup and TLS support. + (hppa_elf_local_got_tls_type, hh_name, eh_name): Define. + (elf32_hppa_link_hash_entry): Add tls_type. + (elf32_hppa_link_hash_table): Add tld_ldm_got. + (hppa_link_has_newfunc): Set tls_type. + (elf32_hppa_link_hash_table_create): Set tls_ldm_got refcount. + (hppa_stub_name): Use hh_name macro. + (elf32_hppa_copy_indirect_symbol): Copy TLS information. + (elf32_hppa_check_relocs): Call elf32_hppa_optimized_tls_reloc. + Handle TLS relocs. + (elf32_hppa_gc_sweep_hook): Likewise. + (allocate_dynrelocs): Handle TLS relocs. + (elf32_hppa_size_dynamic_sections): Count space required by TLS + relocs. Use hh_name macro. + (dtpoff_base): New function. + (tpoff): Likewise. + (elf32_hppa_optimized_tls_reloc): Likewise. + (final_link_relocate): Handle TLS relocs. + (elf32_hppa_relocate_section): Handle TLS relocs. Use eh_name + and hh_name macros. + (elf32_hppa_finish_dynamic_symbol): Setup TLS got entries. Use + hh_name and eh_name macros. + (elf32_hppa_reloc_type_clas): Handle TLS relocs. + +2006-05-24 Bjoern Haase + + * archures.c: Add bfd_mach_avr6. + * cpu-avr.c: Likewise. + * reloc.c (BFD_RELOC_AVR_LO8_LDI_GS, BFD_RELOC_AVR_HI8_LDI_GS): + New relocations. + * libbfd.h: Regenerate. + * bfd-in2.h:Regenerate. + * elf32-avr.h: New file. Protoypes for functions accessed from ld. + * elf32-avr.c: Add elf32-avr.h to include list. + (elf32_avr_stub_hash_entry): New function. + (elf32_avr_link_hash_table): New struct. + (avr_link_hash_table): Likewise. + (avr_stub_hash_entry): Likewise. + (avr_stub_hash_lookup): New function. + (stub_hash_newfunc): New function. + (elf32_avr_link_hash_table_create): New function. + (elf32_avr_link_hash_table_free): New function. + (avr_get_stub_addr): New function. + (debug_relax, debug_stubs): Add new global variables controlling + debugging printout to stdout. + (avr_pc_wrap_around): Change the type to bfd_vma. + (avr_replace_call_ret_sequences): Add a new variable controling + linkrelax optimizations. + (avr_stub_is_required_for_16_bit_reloc): New function. + (avr_final_link_relocate): + Add linker hash table to parameter list. Use stub addr. if necessary. + (elf32_avr_relocate_section): + Add linker hashtable to parameter list of avr_final_link_relocate. + (bfd_elf_avr_final_write_processing): Add support for bfd_mach_avr6. + (elf32_avr_object_p): Add support for E_AVR_MACH_AVR6. + (elf32_avr_relax_delete_bytes): + Iterate over all sections of a bfd when adjusting relocs addends. + (elf32_avr_relax_section): + Evaluate avr_replace_call_ret_sequences and recalculate the size of + stub section. + (avr_stub_name): New function. + (avr_get_stub_entry): New function. + (avr_add_stub): New function. + (avr_build_one_stub): New function. + (avr_size_one_stub): New function. + (elf32_avr_setup_params): New function. + (elf32_avr_setup_section_lists): New function. + (get_local_syms): New function. + (elf32_avr_size_stubs): New function. + (bfd_elf32_bfd_link_hash_table_create): New function. + (bfd_elf32_bfd_link_hash_table_free): New function. + +2006-05-23 H.J. Lu + + PR ld/2655 + PR ld/2657 + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Properly + update CIE/FDE length. Don't pad to the section alignment. + +2006-05-23 Jie Zhang + + * elf32-bfin.c (bfinfdpic_relocate_section): Clear reloc for + deteted entries in .eh_frame section. + +2006-05-23 Jie Zhang + + * elf32-bfin.c (bfin_check_relocs): Use __GLOBAL_OFFSET_TABLE_ + instead of _GLOBAL_OFFSET_TABLE_. + (bfin_relocate_section): Ditto. + (_bfin_create_got_section): Ditto. + (elf32_bfinfdpic_create_dynamic_sections): Use + __PROCEDURE_LINKAGE_TABLE_ instead of _PROCEDURE_LINKAGE_TABLE_. + (bfin_finish_dynamic_symbol): Use __DYNAMIC instead of _DYNAMIC. + +2006-05-23 Alan Modra + + * elf64-ppc.c (compare_symbols): Prefer strong dynamic global + function syms over other syms. + +2006-05-22 Daniel Jacobowitz + + * elflink.c (_bfd_elf_add_dynamic_entry): Remove DT_TEXTREL + check. + (bfd_elf_final_link): Add a late DT_TEXTREL check. + * elfxx-mips.c (MIPS_ELF_READONLY_SECTION): Define. + (mips_elf_create_dynamic_relocation): Set DF_TEXTREL. + (_bfd_mips_elf_check_relocs): Delete MIPS_READONLY_SECTION. + Use MIPS_ELF_READONLY_SECTION. + (_bfd_mips_elf_size_dynamic_sections): Clear DF_TEXTREL after + creating DT_TEXTREL. + (_bfd_mips_elf_finish_dynamic_sections): Clear textrel markers + if no text relocations were generated. + +2006-05-19 H.J. Lu + + * elfxx-ia64.c (ELF_MAXPAGESIZE): Fix a typo in comment. + +2006-05-19 Alan Modra + + * elf.c (elf_fake_sections): Formatting. + (assign_file_positions_for_load_sections): Only add SEC_ALLOC + sections to p_memsz. Remove hack for PT_NOTE sections. Allow + section alignment to increase p_align for PT_LOAD. + (assign_file_positions_for_non_load_sections): Remove ARM BPABI + hack for PT_DYNAMIC. Instead, set p_filesz for all segments + other than PT_LOAD, and PT_NOTE in core. + +2006-05-17 Alan Modra + + * elf.c (assign_file_positions_for_segments): Split into.. + (assign_file_positions_for_load_sections): ..this, and.. + (assign_file_positions_for_non_load_sections): ..this new function,.. + (assign_file_positions_except_relocs): ..writing program headers here. + +2006-05-17 Alan Modra + + * elflink.c (elf_gc_sweep): Don't specially keep non-alloc, + non-load sections if they have relocs. + +2006-05-15 Paul Brook + + * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Rename ... + (bfd_is_arm_special_symbol_name): ... to this. Add type argument. + Check symbol name is of specified type. + * elf32-arm.c (elf32_arm_is_target_special_symbol, + arm_elf_find_function, elf32_arm_output_symbol_hook): Use + bfd_is_arm_special_symbol_name. + * bfd-in.h (BFD_ARM_SPECIAL_SYM_TYPE_MAP, + BFD_ARM_SPECIAL_SYM_TYPE_TAG, BFD_ARM_SPECIAL_SYM_TYPE_OTHER, + BFD_ARM_SPECIAL_SYM_TYPE_ANY): Define. + (bfd_is_arm_mapping_symbol_name): Remove prototype. + (bfd_is_arm_special_symbol_name): Add prototype. + * bfd-in2.h: Regenerate. + +2006-05-15 David Heine + Bob Wilson + + * elf32-xtensa.c (check_loop_aligned): Fix reversed check for + undefined opcode. Clean up assertions. + (narrow_instruction, widen_instruction): Remove "do_it" parameters. + Factor most of the code into separate functions.... + (can_narrow_instruction, can_widen_instruction): New. + (prev_instr_is_a_loop): New. + (compute_ebb_proposed_actions): Combine error handling code for + decode errors. Replace call to insn_decode_len with inline code. + Use can_narrow_instruction and can_widen_instruction. Handle errors + from call to xtensa_opcode_is_loop. + (relax_section): Adjust calls to narrow_instruction and + widen_instruction. + +2006-05-15 Alan Modra + + PR 2658 + * elf32-ppc.c (ppc_elf_relax_section): Don't segfault on non-pic + -shared link. + +2006-05-11 Michael Matz + + * elflink.c (match_group_member): Correctly iterate group + members. + +2006-05-11 Paul Brook + + * elf32-arm.c (elf32_arm_reloc_map): Add MOVW and MOVT relocs. + (elf32_arm_final_link_relocate): Handle MOVW and MOVT relocs. + (elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto. + * reloc.c: Ditto. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2006-05-11 Mike Bland + + * elf.c (_bfd_elf_init_private_section_data): Don't change + section type if already set. + +2006-05-10 Nick Clifton + + PR ld/2607 + * elfcode.h (valid_section_index_p): New function: Checks for a + valid section index. Allows indicies in the range SHN_LOPROC to + SHN_HIOS. + (elf_object_p): Use valid_section_index_p. + +2006-05-11 Pedro Alves + + * coff-arm.c (ARM_26D, ARM_32, ARM_RVA_32, ARM_SECTION, + ARM_SECREL): Mark WinCE versions of these relocs as partial + inplace. + (coff_arm_relocate_section): Adjust addend for WinCE. + +2006-05-10 Alan Modra + + PR 2342 + * elflink.c (_bfd_elf_default_action_discarded): Revert 2006-02-16. + +2006-05-09 Nick Clifton + + * coffcode.h (coff_write_relocs): Produce an error message if a an + out-of-range symbol index is detected in a reloc. + +2006-05-09 Ben Elliston + + * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Remove unused + local variable `dynobj'. + +2006-05-05 Bjoern Haase + + * elf32-avr.c (elf32_avr_relax_delete_bytes): Iterate over all + of the bfd's sections for the reloc-addend adjustments. + +2006-05-05 Martin Schwidefsky + + * elf32-s390.c (invalid_tls_insn): Call bfd_set_error. + (elf_s390_relocate_section): Add code to do the GD->LE and + LD->LE TLS linker optimizations if a brasl instruction is used + for the __tls_get_offset function call. + * elf64-s390.c (invalid_tls_insn): Call bfd_set_error. + +2006-05-05 Alan Modra + + * elf64-ppc.c (ppc64_elf_tls_optimize): Only optimize + R_PPC64_TPREL64 and R_PPC64_DTPMOD64 relocs when they are in + the .toc and referenced by a TLS code sequence. + (ppc64_elf_edit_toc): Cater for the unlikely situation that + .toc is the first section in a file. + +2006-05-04 Andreas Schwab + + * aoutf1.h (struct external_sparc_core): Declare c_regs as struct + regs instead of an array of int. + (struct external_solaris_bcp_core): Likewise. + (swapcore_sun3): Use offsetof instead of computing the offset + manually. + (swapcore_sparc): Likewise. Simplify reference to c_regs. + (swapcore_solaris_bcp): Likewise. + +2006-05-04 Daniel Jacobowitz + + * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Adjust handling + for missing GOTs. + +2006-05-04 Daniel Jacobowitz + + * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Accept more + mapping symbols. + +2006-05-04 Ben Elliston + + * coff-or32.c (bfd_section_from_shdr): Remove unused local + variable `ptr'. + * cofflink.c (process_embedded_commands): Remove unused local + variables `had_read' and `had_shared'. + * ecofflink.c (bfd_ecoff_debug_accumulate): Remove unused local + variable `fdr_adr'. + * ihex.c (ihex_read_section): Remove unused local variable `addr'. + +2006-05-03 Alan Modra + + * libbfd-in.h (_bfd_generic_new_section_hook): Declare. + * section.c (bfd_abs_symbol, bfd_com_symbol): Delete. + (bfd_und_symbol, bfd_ind_symbol): Delete. + (BFD_FAKE_SECTION): Remove SYM_PTR param, set symbol_ptr_ptr to + &SEC.symbol. + (STD_SECTION): Adjust. + (_bfd_generic_new_section_hook): New function, extracted from.. + (bfd_section_init): ..here. + (bfd_make_section_old_way): Call new_section_hook for abs, com, + und and ind sections. + * elf.c (_bfd_elf_large_com_section): Adjust. + * aoutx.h (new_section_hook): Call _bfd_generic_new_section_hook. + * pdp11.c (new_section_hook): Likewise. + * coffcode.h (coff_new_section_hook): Likewise. + * ecoff.c (_bfd_ecoff_new_section_hook): Likewise. + * elf.c (_bfd_elf_new_section_hook): Likewise. + * vms.c (vms_new_section_hook): Likwise. + * elf32-arm.c (elf32_arm_new_section_hook): Check used_by_bfd isn't + already set. + * elf32-sh64.c (sh64_elf_new_section_hook): Likewise. + * elf32-xtensa.c (elf_xtensa_new_section_hook): Likewise. + * elf64-mmix.c (mmix_elf_new_section_hook): Likewise. + * elf64-ppc.c (ppc64_elf_new_section_hook): Likewise. + * elfxx-mips.c (_bfd_mips_elf_new_section_hook): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_new_section_hook): Likewise. + * ieee.c (ieee_new_section_hook): Likewise. Call + _bfd_generic_new_section_hook too. + * mmo.c (mmo_new_section_hook): Likewise. + * oasys.c (oasys_new_section_hook): Likewise. + * som.c (som_new_section_hook): Likewise. + * coff-w65.c (reloc_processing): Don't use bfd_abs_symbol. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2006-05-03 Alan Modra + + * hash.c (DEFAULT_SIZE): Revert last change. + (higher_prime_number): Correct test for no larger prime. Don't + abort on error, instead return 0. Depopulate primes[]. + (bfd_hash_lookup): If we overflow size, refuse to grow table. + +2006-05-02 Paul Brook + + * elf32-arm.c (elf32_arm_final_link_relocate): Set thumb funciton bit + for R_ARM_REL32. + +2006-05-02 Ben Elliston + + * archive.c (bfd_generic_archive_p): Remove unused local variable + `fail'. + * dwarf2.c (decode_line_info): Remove unused local variable + `basic_block'. + * elfcode.h (elf_slurp_reloc_table_from_section): Remove unused + local variable `s'. + * tekhex.c (tekhex_write_object_contents): Remove unused local + variable `bytes_written'. + * aout-ns32k.c (MY_swap_std_reloc_out): Remove unused local + variable `r_addend'. + * elf32-dlx.c (dlx_rtype_to_howto): Remove breaks after returns. + * elfxx-mips.c (_bfd_elf_mips_mach): Remove breaks after returns. + (_bfd_ns32k_relocate_contents): Remove break after return. + * elf.c (bfd_section_from_shdr): Remove breaks after returns. + +2006-05-02 Nick Clifton + + * elf32-sh-symbian.c: Rename local define DEBUG to SYMBIAN_DEBUG + in order to avoid conflicts with the global DEBUG define. + +2006-05-02 Alan Modra + + * dwarf2.c: Formatting. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Simplify + output section check. + * elf32-i370.c: Warning fixes inside #ifdef DEBUG. + * elf32-m32c.c: Similarly. + * elf32-ppc.c: Similarly. + * elf32-v850.c: Similarly. + * nlm32-sparc.c: Similarly. + * elfcode.h: Similarly. + (elf_symbol_flags): Delete. + * elflink.c (elf_link_input_bfd): Comment typo. + +2006-05-01 DJ Delorie + + * bfd-in.h (bfd_hash_table): Add count field. + * bfd-in2.h: Regenerate. + * hash.c (higher_prime_number): New. + (bfd_hash_table_inint_n): Init count field. + (bfd_hash_lookup): Grow table as needed. + +2006-04-27 Kaz Kojima + + PR binutils/2584 + * tekhex.c (getvalue): Change return type to bfd_boolean and + add the new parameter. Return false if the unexpected character + is found. + (getsym): Likewise. + (first_phase): Change return type to bfd_boolean and return + false if the unexpected character is found. Replace abort + with returning false. + (pass_over): Change return type to bfd_boolean and the type of + the second argument to bfd_boolean (*) (bfd *, int, char *). + Return false if FUNC returns false. + (tekhex_object_p): Return NULL if pass_over fails. + +2006-04-27 Alan Modra + + * coff-rs6000.c (xcoff_write_archive_contents_old): Warning fix. + +2006-04-26 H.J. Lu + + PR binutils/2593 + * elf.c (_bfd_elf_new_section_hook): Don't set section ELF type + and flags if its BFD flags have been set. + (_bfd_elf_init_private_section_data): Don't copy the output ELF + section type from input if it has been set to something + different. + +2006-04-25 H.J. Lu + + PR binutils/2467 + * elf.c (_bfd_elf_close_and_cleanup): Check elf_tdata (abfd) + is NULL first. + + * elf32-arm.c (elf32_arm_close_and_cleanup): Check if + abfd->sections is NULL. + (elf32_arm_bfd_free_cached_info): New. + (bfd_elf32_bfd_free_cached_info): Defined. + + * elfxx-target.h (bfd_elfNN_bfd_free_cached_info): Default it + to _bfd_free_cached_info. + + * libbfd-in.h (_bfd_free_cached_info): New. + * libbfd: Regenerated. + + * opncls.c (_bfd_delete_bfd): Check if abfd->memory is NULL. + (_bfd_free_cached_info): New. + +2006-04-21 Alan Modra + + * elf.c (assign_file_positions_except_relocs): Move code setting + file position of non-loaded sections.. + (assign_file_positions_for_segments): ..to here. + +2006-04-20 H.J. Lu + + PR ld/2537 + * elf.c (bfd_section_from_shdr): Allow sections reserved for + applications. Issue an error on sections we don't know how + to handle. + +2006-04-19 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2006-04-19 Alan Modra + + * warning.m4 (--enable-werror): Format help message. + (--enable-build-warnings): Likewise. + * configure: Regenerate. + +2006-04-18 Nick Clifton + + PR 2257 + * elfcode.h (elf_object_p): Allow files with corrupt e_shstrndx + fields to still be handled as ELF files. + +2006-04-16 Daniel Jacobowitz + + * po/SRC-POTFILES.in: Regenerated. + +2006-04-16 Daniel Jacobowitz + + * configure.in: Update version to 2.17.50. + * configure: Regenerated. + +2006-04-14 David Heine + + * elf32-xtensa.c (build_reloc_opcodes): New. + (compute_text_actions): Use it to decode opcodes outside inner loop. + (check_section_ebb_pcrels_fit): Add "reloc_opcodes" argument, and if + it is set, use it to get the opcodes for relocations. + (move_shared_literal): Adjust call to check_section_ebb_pcrels_fit. + +2006-04-08 H.J. Lu + + PR ld/2513 + * elf32-i386.c (GOT_TLS_MASK): New macro for tls_type. + (GOT_TLS_IE_IE): Likewise. + (GOT_TLS_IE_GD): Likewise. + (GOT_TLS_IE_MASK): Likewise. + (elf_i386_check_relocs): For global symbols, set GOT_TLS_IE_GD + and GOT_TLS_IE_IE for R_386_TLS_GD and R_386_TLS_IE + respectively. + (allocate_dynrelocs): If both GOT_TLS_IE_IE and GOT_TLS_IE_GD + are set, treat tls_type as GOT_TLS_IE_BOTH. + (elf_i386_relocate_section): Likewise. + +2006-04-07 Randolph Chung + + * elf64-hppa.c (elf64_hppa_grok_prstatus): New function. + (elf64_hppa_grok_psinfo): Likewise. + (elf_backend_grok_pstatus, elf_backend_grok_psinfo): Define. + +2006-04-06 DJ Delorie + + * elf32-m32c.c (m32c_elf_relocate_section): Generate a symbol for + each plt entry we create. + +2006-04-06 Carlos O'Donell + + * po/Make-in: Add install-html target. + * Makefile.am: Rename docdir to bfddocdir. Add datarootdir, docdir + htmldir. Add install-html and install-html-recursive targets. + * Makefile.in: Regenerate. + * configure.in: AC_SUBST for datarootdir, docdir and htmldir. + * configure: Regenerate. + +2006-04-06 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_section): Skip unneeded passes + with the skip_relax_pass_0 and skip_relax_pass_1 bits in the + section structure. + +2006-04-05 Bernd Schmidt + + * elf32-bfin.c (bfinfdpic_relocs_info_hash): Sprinkle casts to + eliminate warnings. + +2006-04-05 H.J. Lu + James E Wilson + + PR ld/2442 + * elfxx-ia64.c (elfNN_ia64_dyn_sym_info): Remove next. + (elfNN_ia64_local_hash_entry): Add count, sorted_count and + size. + (elfNN_ia64_link_hash_entry): Likewise. + (elfNN_ia64_new_elf_hash_entry): Initialize count, sorted_count + and size. + (elfNN_ia64_hash_copy_indirect): Updated elfNN_ia64_dyn_sym_info + processing. + (elfNN_ia64_hash_hide_symbol): Likewise. + (elfNN_ia64_global_dyn_sym_thunk): Likewise. + (elfNN_ia64_local_dyn_sym_thunk): Likewise. + (elfNN_ia64_global_dyn_info_free): New function. + (elfNN_ia64_local_dyn_info_free): Likewise. + (elfNN_ia64_hash_table_free): Free local and global + elfNN_ia64_dyn_sym_info. + (addend_compare): New function. + (sort_dyn_sym_info): Likewise. + (get_dyn_sym_info): Updated to use binary search for addend. + (elfNN_ia64_check_relocs): Scan relocations to create dynamic + relocation arrays first. + +2006-04-05 Bernd Schmidt + + * elf32-bfin.c (_bfin_create_got_section): Don't generate a _gp + symbol. + +2006-04-05 H.J. Lu + + PR ld/2411 + * elflink.c (check_dynsym): New. + (elf_link_output_extsym): Use it. + (bfd_elf_final_link): Likewise. + +2006-04-05 H.J. Lu + + PR ld/2404 + * elflink.c (_bfd_elf_merge_symbol): Skip the default indirect + symbol from the dynamic definition with the default version if + its type and the type of existing regular definition mismatch. + +2006-04-05 Richard Sandiford + Daniel Jacobowitz + + * config.bfd (sparc-*-vxworks*): New stanza. + * configure.in (bfd_elf32_sparc_vxworks_vec): New stanza. + (bfd_elf32_sparc_vec, bfd_elf64_sparc_vec): Add elf-vxworks.lo. + * configure: Regenerate. + * elf32-sparc.c: Include elf-vxworks.h. + (elf32_sparc_vxworks_link_hash_table_create: New. + (elf32_sparc_vxworks_final_write_processing): New. + (TARGET_BIG_SYM): Override for VxWorks. + (TARGET_BIG_NAME, ELF_MINPAGESIZE): Likewise. + (bfd_elf32_bfd_link_hash_table_create): Likewise. + (elf_backend_want_got_plt, elf_backend_plt_readonly): Likewise. + (elf_backend_got_header_size, elf_backend_add_symbol_hook): Likewise. + (elf_backend_link_output_symbol_hook): Likewise. + (elf_backend_emit_relocs): Likewise. + (elf_backend_final_write_processing, elf32_bed): Likewise. + * elfxx-sparc.c: Include libiberty.h and elf-vxworks.h. + (sparc_vxworks_exec_plt0_entry, sparc_vxworks_exec_plt_entry): New. + (sparc_vxworks_shared_plt0_entry, sparc_vxworks_shared_plt_entry): New. + (_bfd_sparc_elf_link_hash_table_create): Don't initialize + build_plt_entry here. + (create_got_section): Initialize sgotplt for VxWorks. + (_bfd_sparc_elf_create_dynamic_sections): Initialize build_plt_entry, + plt_header_size and plt_entry_size, with new VxWorks-specific settings. + Call elf_vxworks_create_dynamic_sections for VxWorks. + (allocate_dynrelocs): Use plt_header_size and plt_entry_size. + Allocate room for .got.plt and .rela.plt.unloaded entries on VxWorks. + (_bfd_sparc_elf_size_dynamic_sections): Don't allocate a nop in .plt + for VxWorks. Check for the .got.plt section. + (sparc_vxworks_build_plt_entry): New function. + (_bfd_sparc_elf_finish_dynamic_symbol): Add handling of VxWorks PLTs. + Don't make _GLOBAL_OFFSET_TABLE_ and _PROCEDURE_LINKAGE_TABLE_ + absolute on VxWorks. + (sparc32_finish_dyn): Add special handling for DT_RELASZ + and DT_PLTGOT on VxWorks. + (sparc_vxworks_finish_exec_plt): New. + (sparc_vxworks_finish_shared_plt): New. + (_bfd_sparc_elf_finish_dynamic_sections): Call them. + Use plt_header_size and plt_entry_size. + * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add is_vxworks, + srelplt2, sgotplt, plt_header_size and plt_entry_size fields. + * Makefile.am (elfxx-sparc.lo): Depend on elf-vxworks.h. + (elf32-sparc.lo): Likewise. + * Makefile.in: Regenerate. + * targets.c (bfd_elf32_sparc_vxworks_vec): Declare. + (_bfd_target_vector): Add a pointer to it. + +2006-03-30 Ben Elliston + + PR ld/2267 + * elflink.c (elf_fixup_link_order): Ensure `elfsec' is not a + special section number that exceeds the number of ELF sections + (eg. SHN_MIPS_SCOMMON). + +2006-03-27 Richard Sandiford + + * elfxx-mips.c (mips_got_entry): Add more commentary. + (mips_elf_local_got_index): Use the hash table entry to record + the GOT index of forced-local symbols. + (mips_elf_initialize_tls_index): Rearrange code. Store the index + in either the hash table entry or the mips_got_entry, not both. + Add more commentary. + (mips_elf_multi_got): Make sure the g->next is nonnull when calling + mips_elf_initialize_tls_index. + +2006-03-25 Bernd Schmidt + + * elf32-bfin.c (bfd_const_reloc, bfd_oper_reloc, bfin_push_reloc, + RELOC_STACK_SIZE, reloc_stack, reloc_stack_tos, is_reloc_stack_empty, + reloc_stack_push, reloc_stack_pop, reloc_stack_operate, + bfin_areloc_howto_table): Delete. All + uses deleted as well. + (bfin_reloc_map): Delete all stack relocs. + (bfin_info_to_howto, bfin_bfd_reloc_type_lookup, + bfin_reloc_type_lookup): Don't support them. + (bfin_relocate_section): Don't try to handle them. + + * config.bfd (bfin-*-*): Add bfd_elf32_bfinfdpic_vec. + * configure.in: Likewise. + * configure: Regenerate. + * elf32-bfin.c: Include "elf/dwarf2.h" and "hashtab.h". + (BFIN_RELOC_MAX): Now 0x21. + (bfin_howto_table, bfin_reloc_map): Add FD-PIC relocs. + (bfd_elf32_bfinfdpic_vec): Declare. + (IS_FDPIC): New macro. + (struct bfinfdpic_elf_link_hash_table): New struct. + (bfinfdpic_hash_table, bfinfdpic_got_section, + bfinfdpic_gotrel_section, bfinfdpic_gotfixup_section, + bfinfdpic_plt_setion, bfinfdpic_pltrel_section, + bfinfdpic_relocs_info, bfinfdpic_got_initial_offset, + bfinfdpic_plt_initial_offset): Accessor macros for it. + (BFINFDPIC_SYM_LOCAL, BFINFDPIC_FUNCDESC_LOCAL): New macros. + (struct bfinfdpic_relocs_info): New struct. + (LZPLT_RESOLVER_EXTRA, LZPLT_NORMAL_SIZE, LZPLT_ENTRIES, + BFINFDPIC_LZPLT_BLOCK_SIZE, BFINFDPIC_LZPLT_RESOLV_LOC, + DEFAULT_STACK_SIZE): New macros. + (bfinfdpic_elf_link_hash_table_create, bfinfdpic_relocs_info_hash, + bfinfdpic_relocs_info_eq, bfinfdpics_relocs_info_find, + bfinfdpic_relocs_info_for_global, bfinfdpic_relocs_info_for_local, + bfinfdpic_pic_merge_early_relocs_info, _bfinfdpic_add_dyn_reloc, + _bfinfdpic_add_rofixup, _bfinfdpic_osec_to_segment, + _bfinfdpic_osec_readonly_p, bfinfdpic_relocate_section, + bfinfdpic_check_relocs, bfinfdpic_gc_sweep_hook, + _bfinfdpic_link_omit_section_dynsym, _bfin_create_got_section, + elf32_bfinfdpic_create_dynamic_sections, _bfinfdpic_get_fd_entry, + _bfinfdpic_compute_got_alloc_data, _bfinfdpic_get_got_entry, + _bfinfdpic_assign_got_entries, _bfinfdpic_assign_plt_entries, + _bfinfdpic_resolve_final_relocs_info, + elf32_bfinfdpic_size_dynamic_sections, + elf32_bfinfdpic_always_size_sections, + elf32_bfinfdpic_modify_segment_map, + _bfinfdpic_count_got_plt_entries, + elf32_bfinfdpic_finish_dynamic_sections, + elf32_bfinfdpic_adjust_dynamic_symbol, + elf32_bfinfdpic_finish_dynamic_symbol, + elf32_bfinfdpic_elf_use_relative_eh_frame, + elf32_bfinfdpic_elf_encode_eh_address, + elf32_bfin_object_p, bfin_elf_copy_private_bfd_data, + elf32_bfinfdpic_copy_private_bfd_data, + (struct _bfinfdpic_dynamic_got_info, + struct _bfinfdpic_dynamic_got_plt_info): New structs. + (elf32_bfin_print_private_bfd_data): Print PIC flags. + (elf32_bfin_merge_private_bfd_data): Extend to support FD-PIC. + (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, elf32_bed, + elf_backend_got_header_size, bfd_elf32_bfd_link_hash_table_create, + elf_backend_always_size_sectinos, elf_backend_modify_segment_map, + bfd_elf32_bfd_copy_private_bfd_data, + elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol, + elf_backend_size_dynamic_sections, elf_backend_finish_dynamic_symbol, + elf_backend_finish_dynamic_sections, elf_backend_relocate_section, + elf_backend_can_make_relative_eh_frame, elf_backend_check_relocs, + elf_backend_can_make_ldsa_relative_eh_frame, elf_backend_may_use_rel_p, + elf_backend_may_use_rela_p, elf_backend_default_use_rela_p, + elf_backend_omit_section_dynsym): Redefine these macros and include + "elf32-target.h" again to create the elf32-bfinfdpic target. + * reloc.c (BFD_RELOC_BFIN_GOT17M4, BFD_RELOC_BFIN_GOTHI, + BFD_RELOC_BFIN_GOTLO, BFD_RELOC_BFIN_FUNCDESC, + BFD_RELOC_BFIN_FUNCDESC_GOT17M4, BFD_RELOC_BFIN_FUNCDESC_GOTHI, + BFD_RELOC_BFIN_FUNCDESC_GOTLO, BFD_RELOC_BFIN_FUNCDESC_VALUE, + BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4, BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI, + BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO, BFD_RELOC_BFIN_GOTOFFHI, + BFD_RELOC_BFIN_GOTOFFLO): New. + * targets.c (bfd_elf32_bfinfdpic_vec): New bfd_target. + (_bfd_target_vector): Add it. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2006-03-25 Richard Sandiford + + * cpu-m68k.c (bfd_m68k_compatible): Treat ISA A+ and ISA B code as + incompatible. Likewise MAC and EMAC code. + * elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Use + bfd_get_compatible to set the new bfd architecture. Rely on it + to detect incompatibilities. + +2006-03-23 Michael Matz + + * reloc.c: Add BFD_RELOC_X86_64_GOT64, BFD_RELOC_X86_64_GOTPCREL64, + BFD_RELOC_X86_64_GOTPC64, BFD_RELOC_X86_64_GOTPLT64, + BFD_RELOC_X86_64_PLTOFF64. + * bfd-in2.h: Regenerated. + * libbfd.h: Regenerated. + * elf64-x86-64.c (x86_64_elf_howto_table): Correct comment. + Add howtos for above relocs. + (x86_64_reloc_map): Add mappings for new relocs. + (elf64_x86_64_check_relocs): R_X86_64_GOT64, R_X86_64_GOTPCREL64, + R_X86_64_GOTPLT64 need a got entry. R_X86_64_GOTPLT64 also a PLT + entry. R_X86_64_GOTPC64 needs a .got section. R_X86_64_PLTOFF64 + needs a PLT entry. + (elf64_x86_64_gc_sweep_hook): Reflect changes from + elf64_x86_64_check_relocs for the new relocs. + (elf64_x86_64_relocate_section): Handle new relocs. + +2006-03-22 Bob Wilson + + * elf32-xtensa.c (xtensa_read_table_entries): Remove assertion that + rel->r_addend is zero. + +2006-03-22 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Fix type + of "loc". + +2006-03-22 Richard Sandiford + Daniel Jacobowitz + Phil Edwards + Zack Weinberg + Mark Mitchell + Nathan Sidwell + + * bfd-in2.h: Regenerate. + * config.bfd (mips*-*-vxworks*, mips*el-*-vxworks*): New stanzas. + * configure.in (bfd_elf32_bigmips_vxworks_vec): New stanza. + (bfd_elf32_littlemips_vxworks_vec): Likewise. + (bfd_elf32_bigmips_vec): Add elf-vxworks.lo. + (bfd_elf32_littlemips_vec): Likewise. + (bfd_elf32_nbigmips_vec): Likewise. + (bfd_elf32_nlittlemips_vec): Likewise. + (bfd_elf32_ntradbigmips_vec): Likewise. + (bfd_elf32_ntradlittlemips_vec): Likewise. + (bfd_elf32_tradbigmips_vec): Likewise. + (bfd_elf32_tradlittlemips_vec): Likewise. + (bfd_elf64_bigmips_vec): Likewise. + (bfd_elf64_littlemips_vec): Likewise. + (bfd_elf64_tradbigmips_vec): Likewise. + (bfd_elf64_tradlittlemips_vec): Likewise. + * elf32-mips.c: Include elf-vxworks.h. + (mips_info_to_howto_rel): Use elf_backend_mips_rtype_to_howto + instead of calling mips_elf32_rtype_to_howto directly. + (mips_vxworks_copy_howto_rela): New reloc howto. + (mips_vxworks_jump_slot_howto_rela): Likewise. + (mips_vxworks_bfd_reloc_type_lookup): New function. + (mips_vxworks_rtype_to_howto): Likewise. + (mips_vxworks_final_write_processing): Likewise. + (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Override for VxWorks. + (TARGET_BIG_SYM, TARGET_BIG_NAME, elf_bed, ELF_MAXPAGESIZE): Likewise. + (elf_backend_want_got_plt): Likewise. + (elf_backend_want_plt_sym): Likewise. + (elf_backend_got_symbol_offset): Likewise. + (elf_backend_want_dynbss): Likewise. + (elf_backend_may_use_rel_p): Likewise. + (elf_backend_may_use_rela_p): Likewise. + (elf_backend_default_use_rela_p): Likewise. + (elf_backend_got_header_size: Likewise. + (elf_backend_plt_readonly): Likewise. + (bfd_elf32_bfd_reloc_type_lookup): Likewise. + (elf_backend_mips_rtype_to_howto): Likewise. + (elf_backend_adjust_dynamic_symbol): Likewise. + (elf_backend_finish_dynamic_symbol): Likewise. + (bfd_elf32_bfd_link_hash_table_create): Likewise. + (elf_backend_add_symbol_hook): Likewise. + (elf_backend_link_output_symbol_hook): Likewise. + (elf_backend_emit_relocs): Likewise. + (elf_backend_final_write_processing: Likewise. + (elf_backend_additional_program_headers): Likewise. + (elf_backend_modify_segment_map): Likewise. + (elf_backend_symbol_processing): Likewise. + * elfxx-mips.c: Include elf-vxworks.h. + (mips_elf_link_hash_entry): Add is_relocation_target and + is_branch_target fields. + (mips_elf_link_hash_table): Add is_vxworks, srelbss, sdynbss, srelplt, + srelplt2, sgotplt, splt, plt_header_size and plt_entry_size fields. + (MIPS_ELF_RELA_SIZE, MIPS_ELF_REL_DYN_NAME): New macros. + (MIPS_RESERVED_GOTNO): Take a mips_elf_link_hash_table argument. + Return 3 for VxWorks. + (ELF_MIPS_GP_OFFSET): Change the argument from a bfd to a + mips_elf_link_hash_table. Return 0 for VxWorks. + (MIPS_ELF_GOT_MAX_SIZE): Change the argument from a bfd to a + mips_elf_link_hash_table. Update the call to ELF_MIPS_GP_OFFSET. + (mips_vxworks_exec_plt0_entry): New variable. + (mips_vxworks_exec_plt_entry): Likewise. + (mips_vxworks_shared_plt0_entry): Likewise. + (mips_vxworks_shared_plt_entry): Likewise. + (mips_elf_link_hash_newfunc): Initialize the new hash_entry fields. + (mips_elf_rel_dyn_section): Change the bfd argument to a + mips_elf_link_hash_table. Use MIPS_ELF_REL_DYN_NAME to get + the name of the section. + (mips_elf_initialize_tls_slots): Update the call to + mips_elf_rel_dyn_section. + (mips_elf_gotplt_index): New function. + (mips_elf_local_got_index): Add an input_section argument. + Update the call to mips_elf_create_local_got_entry. + (mips_elf_got_page): Likewise. + (mips_elf_got16_entry): Likewise. + (mips_elf_create_local_got_entry): Add bfd_link_info and input_section + arguments. Create dynamic relocations for each entry on VxWorks. + (mips_elf_merge_gots): Update the use of MIPS_ELF_GOT_MAX_SIZE. + (mips_elf_multi_got): Update the uses of MIPS_ELF_GOT_MAX_SIZE + and MIPS_RESERVED_GOTNO. + (mips_elf_create_got_section): Update the uses of + MIPS_ELF_GOT_MAX_SIZE. Create .got.plt on VxWorks. + (is_gott_symbol): New function. + (mips_elf_calculate_relocation): Use a dynobj local variable. + Update the calls to mips_elf_local_got_index, mips_elf_got16_entry and + mips_elf_got_page_entry. Set G to the .got.plt entry when calculating + VxWorks R_MIPS_CALL* relocations. Calculate and use G for all GOT + relocations on VxWorks. Add dynamic relocations for references + to the VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols. Don't + create dynamic relocations for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 + in VxWorks executables. + (mips_elf_allocate_dynamic_relocations): Add a bfd_link_info argument. + Use MIPS_ELF_RELA_SIZE to calculate the size of a VxWorks entry. + Don't allocate a null entry on VxWorks. + (mips_elf_create_dynamic_relocation): Update the call to + mips_elf_rel_dyn_section. Use absolute rather than relative + relocations for VxWorks, and make them RELA rather than REL. + (_bfd_mips_elf_create_dynamic_sections): Don't make .dynamic + read-only on VxWorks. Update the call to mips_elf_rel_dyn_section. + Create the .plt, .rela.plt, .dynbss and .rela.bss sections on + VxWorks. Likewise create the _PROCEDURE_LINKAGE_TABLE symbol. + Call elf_vxworks_create_dynamic_sections for VxWorks and + initialize the plt_header_size and plt_entry_size fields. + (_bfd_mips_elf_check_relocs): Don't allow GOT relocations to be + used in VxWorks executables. Don't allocate dynamic relocations + for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 in VxWorks executables. + Set is_relocation_target for each symbol referenced by a relocation. + Allocate .rela.dyn entries for relocations against the special + VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols. Create GOT + entries for all VxWorks R_MIPS_GOT16 relocations. Don't allocate + a global GOT entry for symbols mentioned in VxWorks R_MIPS_CALL*, + R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 relocations. Update the calls + to mips_elf_rel_dyn_section and mips_elf_allocate_dynamic_relocations. + Set is_branch_target for symbols mentioned in R_MIPS_PC16 or R_MIPS_26 + relocations. Don't set no_fn_stub on VxWorks. + (_bfd_mips_elf_adjust_dynamic_symbol): Update the call to + mips_elf_allocate_dynamic_relocations. + (_bfd_mips_vxworks_adjust_dynamic_symbol): New function. + (_bfd_mips_elf_always_size_sections): Do not allocate GOT page + entries for VxWorks, and do not create multiple GOTs. + (_bfd_mips_elf_size_dynamic_sections): Use MIPS_ELF_REL_DYN_NAME. + Handle .got specially for VxWorks. Update the uses of + MIPS_RESERVED_GOTNO and mips_elf_allocate_dynamic_relocations. + Check for sgotplt and splt. Allocate the .rel(a).dyn contents last, + once its final size is known. Set DF_TEXTREL for VxWorks. Add + DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, DT_PLTRELSZ and DT_JMPREL + tags on VxWorks. Do not add the MIPS-specific tags for VxWorks. + (_bfd_mips_vxworks_finish_dynamic_symbol): New function. + (mips_vxworks_finish_exec_plt): Likewise. + (mips_vxworks_finish_shared_plt): Likewise. + (_bfd_mips_elf_finish_dynamic_sections): Remove an unncessary call + to mips_elf_rel_dyn_section. Use a VxWorks-specific value of + DT_PLTGOT. Handle DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, + DT_PLTRELSZ and DT_JMPREL. Update the uses of MIPS_RESERVED_GOTNO + and mips_elf_rel_dyn_section. Use a different GOT header for + VxWorks. Don't sort .rela.dyn on VxWorks. Finish the PLT on VxWorks. + (_bfd_mips_elf_link_hash_table_create): Initialize the new + mips_elf_link_hash_table fields. + (_bfd_mips_vxworks_link_hash_table_create): New function. + (_bfd_mips_elf_final_link): Set the GP value to _GLOBAL_OFFSET_TABLE_ + on VxWorks. Update the call to ELF_MIPS_GP_OFFSET. + * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Declare. + (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. + (_bfd_mips_vxworks_link_hash_table_create): Likewise. + * libbfd.h: Regenerate. + * Makefile.am (elfxx-mips.lo): Depend on elf-vxworks.h. + (elf32-mips.lo): Likewise. + * Makefile.in: Regenerate. + * reloc.c (BFD_RELOC_MIPS_COPY, BFD_RELOC_MIPS_JUMP_SLOT): Declare. + * targets.c (bfd_elf32_bigmips_vxworks_vec): Declare. + (bfd_elf32_littlemips_vxworks_vec): Likewise. + (_bfd_target_vector): Add entries for them. + +2006-03-19 John David Anglin + + * elf64-hppa.c (elf64_hppa_special_sections): Change flags for .tbss + section from SHF_PARISC_WEAKORDER to SHF_HP_TLS. + (elf_backend_special_sections): Remove #undef. + +2006-03-18 John David Anglin + + * elf64-hppa.c (allocate_global_data_opd): Don't create an OPD entry + for undefined weak symbols. + +2006-03-17 Daniel Jacobowitz + + PR ld/2462 + * elflink.c (bfd_elf_final_link): Remove + bed->elf_backend_emit_relocs from emit_relocs. + +2006-03-17 Alexandre Oliva + + * elf32-ppc.c (ppc_elf_relocate_section): Copy addend from + first relocation to the second when relaxing TLS GD to LE; + zero it out when relaxing to IE. + +2006-03-17 Alan Modra + + PR 2434 + * elflink.c (elf_link_add_object_symbols): Save and restore + warning sym's linked sym. + +2006-03-16 Alan Modra + + PR 2434 + * elflink.c (struct elf_smash_syms_data, elf_smash_syms): Delete. + (elf_link_add_object_symbols): Delete unnecessary locals. Rename + hash_table -> htab. Formatting. Save entire symbol table + before loading as-needed syms, and restore afterwards if lib not + needed. Use bfd_hash_allocate rather than bfd_alloc for sym + name. Free some buffers earlier. + * bfd-in.h (struct bfd_hash_table): Add entsize. + (bfd_hash_table_init, bfd_hash_table_init_n): Adjust prototype. + * elf-bfd.h (_bfd_elf_link_hash_table_init): Likewise + * hash.c (bfd_hash_table_init_n): Add entsize param, save to + hash table. + (bfd_hash_table_init): Add param, adjust calls. + * aoutx.h: Adjust all hash_table_init functions and calls. + * bfd.c: Likewise. + * coff-arm.c: Likewise. + * coff-h8300.c: Likewise. + * coff-ppc.c: Likewise. + * cofflink.c: Likewise. + * ecoff.c: Likewise. + * ecofflink.c: Likewise. + * elf-m10300.c: Likewise. + * elf-strtab.c: Likewise. + * elf.c: Likewise. + * elf32-arm.c: Likewise. + * elf32-bfin.c: Likewise. + * elf32-cris.c: Likewise. + * elf32-frv.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68hc1x.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-vax.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * elfxx-sparc.c: Likewise. + * i386linux.c: Likewise. + * libaout.h: Likewise. + * libbfd-in.h: Likewise. + * libcoff-in.h: Likewise. + * linker.c: Likewise. + * m68klinux.c: Likewise. + * merge.c: Likewise. + * opncls.c: Likewise. + * pdp11.c: Likewise. + * sparclinux.c: Likewise. + * stabs.c: Likewise. + * sunos.c: Likewise. + * vms.c: Likewise. + * xcofflink.c: Likewise. + * section.c (struct section_hash_entry): Move to.. + * libbfd-in.h: ..here. + * Makefile.am: Run "make dep-am" + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2006-03-16 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): REL24 and REL14 relocs + against __GLOBAL_OFFSET_TABLE__ need never be dynamic. Tweak + last change to REL32 relocs so that they are counted as + possibly dynamic as per REL24 and REL14. + +2006-03-16 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Don't fall into REL24 + checks from REL32. + +2006-03-15 Ben Elliston + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Iterate over all + in_list elements, not just the first. + +2006-03-14 Richard Sandiford + + * elf32-mips.c (mips_elf_adjust_addend): New function, mostly split + out from... + (_bfd_mips_elf_relocate_section): ...here. Use it to adjust r_addend + for final links too. + +2006-03-13 Richard Sandiford + + * elfxx-mips.c (mips_elf_create_got_section): Initialize hgot. + +2006-03-11 H.J. Lu + + PR ld/2443 + * dwarf2.c (concat_filename): Don't issue an error if file is 0. + +2006-03-10 Paul Brook + + * elf32-arm.c (INTERWORK_FLAG): Handle EABIv5. + (elf32_arm_print_private_bfd_data): Ditto. + +2006-03-09 Paul Brook + + * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Recognise additional + mapping symbols. + +2006-03-09 Khem Raj + + * elf32-arm.c(elf32_arm_finish_dynamic_sections): Use unsigned + char type. + +2006-03-08 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_choose_gp): Properly choose gp. + +2006-03-07 Richard Sandiford + Daniel Jacobowitz + Zack Weinberg + Nathan Sidwell + Paul Brook + Ricardo Anguiano + Phil Edwards + + * configure.in (bfd_elf32_bigarm_vec): Include elf-vxworks.lo. + (bfd_elf32_bigarm_symbian_vec): Likewise. + (bfd_elf32_bigarm_vxworks_vec): Likewise. + (bfd_elf32_littlearm_vec): Likewise. + (bfd_elf32_littlearm_symbian_vec): Likewise. + (bfd_elf32_littlearm_vxworks_vec): Likewise. + * configure: Regenerate. + * elf32-arm.c: Include libiberty.h and elf-vxworks.h. + (RELOC_SECTION, RELOC_SIZE, SWAP_RELOC_IN, SWAP_RELOC_OUT): New macros. + (elf32_arm_vxworks_bed): Add forward declaration. + (elf32_arm_howto_table_1): Fix the masks for R_ASM_ABS12. + (elf32_arm_vxworks_exec_plt0_entry): New table. + (elf32_arm_vxworks_exec_plt_entry): Likewise. + (elf32_arm_vxworks_shared_plt_entry): Likewise. + (elf32_arm_link_hash_table): Add vxworks_p and srelplt2 fields. + (reloc_section_p): New function. + (create_got_section): Use RELOC_SECTION. + (elf32_arm_create_dynamic_sections): Likewise. Call + elf_vxworks_create_dynamic_sections for VxWorks targets. + Choose between the two possible values of plt_header_size + and plt_entry_size. + (elf32_arm_link_hash_table_create): Initialize vxworks_p and srelplt2. + (elf32_arm_abs12_reloc): New function. + (elf32_arm_final_link_relocate): Call it. Allow the creation of + dynamic R_ARM_ABS12 relocs on VxWorks. Use reloc_section_p, + RELOC_SIZE, SWAP_RELOC_OUT and RELOC_SECTION. Initialize the + r_addend fields of relocs. On rela targets, skip any code that + adjusts in-place addends. When using _bfd_link_final_relocate + to perform a final relocation, pass rel->r_addend as the addend + argument. + (elf32_arm_merge_private_bfd_data): If one of the bfds is a VxWorks + object, ignore flags that are not standard on VxWorks. + (elf32_arm_check_relocs): Allow the creation of dynamic R_ARM_ABS12 + relocs on VxWorks. Use reloc_section_p. + (elf32_arm_adjust_dynamic_symbol): Use RELOC_SECTION and RELOC_SIZE. + (allocate_dynrelocs): Use RELOC_SIZE. Account for the size of + .rela.plt.unloaded relocs on VxWorks targets. + (elf32_arm_size_dynamic_sections): Use RELOC_SIZE. Check for + .rela.plt.unloaded as well as .rel(a).plt. Add DT_RELA* tags + instead of DT_REL* tags on RELA targets. + (elf32_arm_finish_dynamic_symbol): Use RELOC_SECTION, RELOC_SIZE + and SWAP_RELOC_OUT. Initialize r_addend fields. Handle VxWorks + PLT entries. Do not make _GLOBAL_OFFSET_TABLE_ absolute on VxWorks. + (elf32_arm_finish_dynamic_sections): Use RELOC_SECTION, RELOC_SIZE + and SWAP_RELOC_OUT. Initialize r_addend fields. Handle DT_RELASZ + like DT_RELSZ. Handle the VxWorks form of initial PLT entry. + Correct the .rela.plt.unreloaded symbol indexes. + (elf32_arm_output_symbol_hook): Call the VxWorks version of this + hook on VxWorks targets. + (elf32_arm_vxworks_link_hash_table_create): Set vxworks_p to true. + Minor formatting tweak. + (elf32_arm_vxworks_final_write_processing): New function. + (elf_backend_add_symbol_hook): Override for VxWorks and reset + for Symbian. + (elf_backend_final_write_processing): Likewise. + (elf_backend_emit_relocs): Likewise. + (elf_backend_want_plt_sym): Likewise. + (ELF_MAXPAGESIZE): Likewise. + (elf_backend_may_use_rel_p): Minor formatting tweak. + (elf_backend_may_use_rela_p): Likewise. + (elf_backend_default_use_rela_p): Likewise. + (elf_backend_rela_normal): Likewise. + * Makefile.in (elf32-arm.lo): Depend on elf-vxworks.h. + +2006-03-06 Nathan Sidwell + + * archures.c (bfd_mach_mcf_isa_a_nodiv, bfd_mach_mcf_isa_b_nousp): + New. Adjust other variants. + (bfd_default_scan): Update. + * bfd-in2.h: Rebuilt. + * cpu-m68k.c: Adjust. + (bfd_m68k_compatible): New. Use it for architectures. + * elf32-m68k.c (elf32_m68k_object_p): Adjust. + (elf32_m68k_merge_private_bfd_data): Adjust. Correct isa-a/b + mismatch. + (elf32_m68k_print_private_bfd_data): Adjust. + * ieee.c (ieee_write_processor): Adjust. + +2006-03-06 Alan Modra + + * dwarf2.c: Formatting. + (add_line_info): Remove outer loop. + +2006-03-05 H.J. Lu + Alan Modra + + PR binutils/2338 + * dwarf2.c (loadable_section): New struct. + (dwarf2_debug): Add loadable_section_count and + loadable_sections. + (new_line_sorts_after): New. + (add_line_info): Use new_line_sorts_after to compare line + addresses. + (check_function_name): Removed. + (unset_sections): New. + (place_sections): New. + (_bfd_dwarf2_find_nearest_line): Updated. Call place_sections + and unset_sections on relocatable files. + (_bfd_dwarf2_find_line): Likewise. + +2006-03-03 Nick Clifton + + * cpu-avr.c: Update to ISO-C90 formatting. + * elf32-avr.c: Likewise. + +2006-03-03 Bjoern Haase + + * elf32-avr.c (avr_reloc_map): Insert BFD_RELOC_AVR_MS8_LDI + and R_AVR_MS8_LDI + (bfd_elf_avr_final_write_processing): Set + EF_AVR_LINKRELAX_PREPARED in e_flags field. + (elf32_avr_relax_section): New function. + (elf32_avr_relax_delete_bytes): New function. + (elf32_avr_get_relocated_section_contents): New function. + (avr_pc_wrap_around): New function. + (avr_relative_distance_considering_wrap_around): New function. + (avr_final_link_relocate): Handle negative int8t_t immediate for R_AVR_LDI. + * reloc.c: Add BFD_RELOC_AVR_MS8_LDI and BFD_RELOC_AVR_LDI_NEG + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2006-03-02 DJ Delorie + + * elf32-m32c.c (m32c_offset_for_reloc): Fix local symbol + calculations. + +2006-03-02 Richard Sandiford + + * elf32-ppc.c (is_ppc_elf_target): Return true if the target is + bfd_elf32_powerpc_vxworks_vec. + +2006-03-02 Nick Clifton + + * elf32-m32c.c (m32c_elf_relax_section): Initialise 'gap'. + +2006-03-02 Richard Sandiford + + * elf32-i386.c (elf_i386_create_dynamic_sections): Use + elf_vxworks_create_dynamic_sections. + (elf_i386_size_dynamic_sections): Remove VxWorks GOT and PLT + symbol handling. + * elf32-ppc.c (ppc_elf_create_dynamic_sections): Use + elf_vxworks_create_dynamic_sections. + (ppc_elf_size_dynamic_sections): Remove VxWorks GOT and PLT + symbol handling. + * elf-vxworks.c (elf_vxworks_create_dynamic_sections): New function. + * elf-vxworks.h (elf_vxworks_create_dynamic_sections): Declare. + +2006-03-02 Richard Sandiford + + * elf32-i386.c (elf_i386_vxworks_link_output_symbol_hook): Delete. + (elf_backend_link_output_symbol_hook): Use + elf_vxworks_link_output_symbol_hook instead. + * elf32-ppc.c (elf_i386_vxworks_link_output_symbol_hook): Delete. + (elf_backend_link_output_symbol_hook): Use + elf_vxworks_link_output_symbol_hook instead. + * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Provide the + same interface as elf_backend_link_output_symbol_hook. + * elf-vxworks.h (elf_vxworks_link_output_symbol_hook): Update + prototype accordingly. + +2006-03-02 Richard Sandiford + + * elf32-ppc.c (ppc_elf_plt_type): New enumeration. + (ppc_elf_link_hash_table): Replace old_got and new_got with + plt_type and can_use_new_plt. + (ppc_elf_create_dynamic_sections): Add SEC_HAS_CONTENTS, + SEC_LOAD and SEC_READONLY to the VxWorks .plt flags. + (ppc_elf_check_relocs): Set can_use_new_plt instead of new_plt. + Move from plt_type == PLT_UNSET to PLT_OLD instead of setting old_plt. + (ppc_elf_select_plt_layout): Move from plt_type == PLT_UNSET to + either plt_type == PLT_OLD or plt_type == PLT_NEW. Assert that + this function should not be called for VxWorks targets. + (ppc_elf_tls_setup): Use plt_type instead of old_got. + (allocate_got): Likewise. Rearrange so that max_before_header + is only used for PLT_OLD and PLT_NEW. + (allocate_dynrelocs): Use plt_type instead of old_got and is_vxworks. + (ppc_elf_size_dynamic_sections): Likewise. + (ppc_elf_relax_section): Likewise. + (ppc_elf_relocate_section): Likewise. + (ppc_elf_finish_dynamic_symbol): Likewise. + (ppc_elf_vxworks_link_hash_table_create): Initialize plt_type. + +2006-02-28 Richard Sandiford + + * elf32-i386.c (elf_i386_link_hash_table): Add next_tls_desc_index. + (elf_i386_link_hash_table_create): Initialize it. + (elf_i386_compute_jump_table_size): Use it instead of + srelplt->reloc_count. + (allocate_dynrelocs): Likewise. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. + +2006-02-27 Jakub Jelinek + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle S flag. + (_bfd_elf_write_section_eh_frame): Likewise. + +2006-02-27 Carlos O'Donell + + * po/Make-in: Add html target. + +2006-02-27 Richard Sandiford + + * elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_symbol): Use the + cached hgot entry to check for _GLOBAL_OFFSET_TABLE_. + * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Likewise. + * elf32-bfin.c (bfin_finish_dynamic_symbol): Likewise. + * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise. + * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise. + * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise. + * elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise. + * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Likewise. + * elf32-sh.c (sh_elf_finish_dynamic_symbol): Likewise. + * elf32-vax.c (elf_vax_finish_dynamic_symbol): Likewise. + * elf32-xtensa.c (elf_xtensa_finish_dynamic_symbol): Likewise. + * elf64-sh64.c (sh64_elf64_finish_dynamic_symbol): Likewise. + * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Likewise. + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Likewise. + * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise. Also use + the cached hplt entry to check for _PROCEDURE_LINKAGE_TABLE_. + * elf64-alpha.c (elf64_alpha_finish_dynamic_symbol): Likewise. + * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise. + * elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise. + +2006-02-25 Richard Sandiford + + * elf-bfd.h (elf_link_hash_table): Add hplt field. + * elflink.c (_bfd_elf_create_dynamic_sections): Initialize it. + * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Likewise. + * elf32-frv.c (_frv_create_got_section): Likewise. + * elf32-m32r.c (m32r_elf_create_dynamic_sections): Likewise. + * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise. + * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise. + * elf64-sh64.c (sh64_elf64_create_dynamic_sections): Likewise. + * elf32-i386.c (elf_i386_link_hash_table): Remove hgot and hplt. + (elf_i386_link_hash_table_create): Don't initialize them. + (elf_i386_size_dynamic_sections): Use the generic ELF hplt and + hgot fields. + (elf_i386_finish_dynamic_symbol): Likewise. + * elf32-ppc.c (ppc_elf_link_hash_table): Remove hplt. + (ppc_elf_size_dynamic_sections): Use the generic ELF hplt fields. + (ppc_elf_finish_dynamic_symbol): Likewise. + +2006-02-24 DJ Delorie + + * elf32-m32c.c (m32c_elf_howto_table): Add relaxation relocs. + (m32c_elf_relocate_section): Don't relocate them. + (compare_reloc): New. + (relax_reloc): Remove. + (m32c_offset_for_reloc): New. + (m16c_addr_encodings): New. + (m16c_jmpaddr_encodings): New. + (m32c_addr_encodings): New. + (m32c_elf_relax_section): Relax jumps and address displacements. + (m32c_elf_relax_delete_bytes): Adjust for internal syms. Fix up + short jumps. + + * reloc.c: Add m32c relax relocs. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2006-02-24 H.J. Lu + + PR ld/2218 + * elf-bfd.h (elf_backend_data): Add elf_backend_fixup_symbol. + (_bfd_elf_link_hash_fixup_symbol): New. + + * elflink.c (_bfd_elf_link_hash_fixup_symbol): New. + (_bfd_elf_fix_symbol_flags): Call elf_backend_fixup_symbol if + it isn't NULL. + + * elfxx-ia64.c (elf_backend_fixup_symbol): Defined. + + * elfxx-target.h (elf_backend_fixup_symbol): New. + (elfNN_bed): Initialize elf_backend_fixup_symbol. + +2006-02-23 H.J. Lu + + * cpu-ia64-opc.c (ins_immu5b): New. + (ext_immu5b): Likewise. + (elf64_ia64_operands): Add IMMU5b. + +2006-02-21 Alan Modra + + PR ld/2218 + * elf32-arm.c (allocate_dynrelocs): Ensure undef weak sym in pie + is dynamic. + * elf32-hppa.c (allocate_dynrelocs): Likewise. + * elf32-i386.c (allocate_dynrelocs): Likewise. + * elf32-s390.c (allocate_dynrelocs): Likewise. + * elf32-sh.c (allocate_dynrelocs): Likewise. + * elf64-s390.c (allocate_dynrelocs): Likewise. + * elf64-x86-64.c (allocate_dynrelocs): Likewise. + * elf32-m32r.c (allocate_dynrelocs): Likewise. Discard relocs + on undef weak with non-default visibility too. + * elfxx-sparc.c (allocate_dynrelocs): Ditto. + +2006-02-21 Alan Modra + + * bfd.c: (_bfd_default_error_handler): Don't call abort on + error, instead call _exit. + (_bfd_abort): Call _exit not xexit. + +2006-02-17 Kevin Buettner + + * elf32-frv.c (elf32_frv_grok_prstatus, elf32_frv_grok_psinfo): + New functions. + * elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define. + +2006-02-17 Shrirang Khisti + Anil Paranjape + Shilin Shakti + + * Makefile.am: Add xc16x related entry + * Makefile.in: Regenerate + * archures.c: Add bfd_xc16x_arch + * bfd-in2.h: Regenerate + * config.bfd: Add xc16x-*-elf + * configure.in: Add bfd_elf32_xc16x_vec + * configure: Regenerate. + * targets.c: Added xc16x related information + * cpu-xc16x.c: New file + * reloc.c: Add new relocations specific to xc16x: + BFD_RELOC_XC16X_PAG, BFD_RELOC_XC16X_POF, BFD_RELOC_XC16X_SEG, + BFD_RELOC_XC16X_SOF + * elf32-xc16x.c: New file. + +2006-02-17 Alan Modra + + * elf32-ppc.c (allocate_dynrelocs): Tweak undef weak handling. + * elf64-ppc.c (allocate_dynrelocs): Likewise. + +2006-02-17 Alan Modra + + PR ld/2218 + * elf64-ppc.c (allocate_dynrelocs): Ensure undef weak sym is + dynamic. + (ppc64_elf_relocate_section): Check output reloc section size. + * elf32-ppc.c (allocate_dynrelocs): Simplify undef weak test. + +2006-02-16 H.J. Lu + + PR ld/2322 + * elf.c (get_segment_type): New function. + (_bfd_elf_print_private_bfd_data): Use it. + (print_segment_map): New function. + (assign_file_positions_for_segments): Call print_segment_map + when there are not enough room for program headers. + +2006-02-16 Nick Hudson + + * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Use + traditional MIPS ELF targets. + +2006-02-15 H.J. Lu + + PR binutils/2338 + * dwarf2.c (check_function_name): New function. + (_bfd_dwarf2_find_nearest_line): Use check_function_name to + check if function is correct. + +2006-02-16 Alan Modra + + * elflink.c (_bfd_elf_default_action_discarded): Return 0 for + debug sections. + (elf_link_input_bfd): Adjust comments. + +2006-02-10 H.J. Lu + + * elf.c (copy_private_bfd_data): Minor update. + +2006-02-10 H.J. Lu + + PR binutils/2258 + * elf.c (copy_private_bfd_data): Renamed to ... + (rewrite_elf_program_header): This. + (copy_elf_program_header): New function. + (copy_private_bfd_data): Likewise. + +2006-02-07 Nathan Sidwell + + * archures.c (bfd_mach_mcf5200, bfd_mach_mcf5206e, + bfd_mach_mcf5307, bfd_mach_mcf5407, bfd_mach_mcf528x, + bfd_mach_mcfv4e, bfd_mach_mcf521x, bfd_mach_mcf5249, + bfd_mach_mcf547x, bfd_mach_mcf548x): Remove. + (bfd_mach_mcf_isa_a, bfd_mach_mcf_isa_a_div, + bfd_mach_mcf_isa_a_div_mac, bfd_mach_mcf_isa_a_div_emac, + bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac, + bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_aplus_usp, + bfd_mach_mcf_isa_aplus_usp_mac, bfd_mach_mcf_isa_aplus_usp_emac, + bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac, bfd_mach_mcf_isa_b_emac, + bfd_mach_mcf_isa_b_usp_float, bfd_mach_mcf_isa_b_usp_float_mac, + bfd_mach_mcf_isa_b_usp_float_emac): New. + (bfd_default_scan): Update coldfire mapping. + * bfd-in.h (bfd_m68k_mach_to_features, + bfd_m68k_features_to_mach): Declare. + * bfd-in2.h: Rebuilt. + * cpu-m68k.c (arch_info_struct): Add new coldfire machines, + adjust legacy names. + (m68k_arch_features): New. + (bfd_m68k_mach_to_features, + bfd_m68k_features_to_mach): Define. + * elf32-m68k.c (elf32_m68k_object_p): New. + (elf32_m68k_merge_private_bfd_data): Merge the CF EF flags. + (elf32_m68k_print_private_bfd_data): Print the CF EF flags. + (elf_backend_object_p): Define. + * ieee.c (ieee_write_processor): Update coldfire machines. + * libbfd.h: Rebuilt. + +2006-02-06 Steve Ellcey + + * elfxx-ia64.c (elfNN_ia64_fake_sections): Set SHF_IA_64_HP_TLS + if SHF_TLS is set. + +2006-02-05 Arnold Metselaar + + * coff-z80.c (r_imm24): New howto. + (rtype2howto): New case R_IMM24. + (coff_z80_reloc_type_lookup): New case BFD_RELOC_24. + (extra_case): Use bfd_get_8 for R_IMM8, new case R_IMM24. + +2006-02-04 Richard Sandiford + + * elfxx-mips.c (mips_elf_initialize_tls_index): If a TLS symbol + has already been assigned a GOT index, copy that index to the + current hash table entry. + +2006-02-01 Eric Botcazou + + * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass + for call-to-undefweak reloc overflow. + +2006-01-31 Eric Botcazou + + * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass + for 32-bit relocs overflow. + +2006-01-27 Paul Brook + + * elf32-arm.c (elf32_arm_get_symbol_type): Allow STT_TLS thumb + objects. + +2006-01-18 Alexandre Oliva + + Introduce TLS descriptors for i386 and x86_64. + * reloc.c (BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_386_TLS_DESC, + BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_X86_64_GOTPC32_TLSDESC, + BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_TLSDESC_CALL): New. + * libbfd.h, bfd-in2.h: Rebuilt. + * elf32-i386.c (elf_howto_table): New relocations. + (R_386_tls): Adjust. + (elf_i386_reloc_type_lookup): Map new relocations. + (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros. + (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros. + (struct elf_i386_link_hash_entry): Add tlsdesc_got field. + (struct elf_i386_obj_tdata): Add local_tlsdesc_gotent field. + (elf_i386_local_tlsdesc_gotent): New macro. + (struct elf_i386_link_hash_table): Add sgotplt_jump_table_size. + (elf_i386_compute_jump_table_size): New macro. + (link_hash_newfunc): Initialize tlsdesc_got. + (elf_i386_link_hash_table_create): Set sgotplt_jump_table_size. + (elf_i386_tls_transition): Handle R_386_TLS_GOTDESC and + R_386_TLS_DESC_CALL. + (elf_i386_check_relocs): Likewise. Allocate space for + local_tlsdesc_gotent. + (elf_i386_gc_sweep_hook): Handle R_386_TLS_GOTDESC and + R_386_TLS_DESC_CALL. + (allocate_dynrelocs): Count function PLT relocations. Reserve + space for TLS descriptors and relocations. + (elf_i386_size_dynamic_sections): Reserve space for TLS + descriptors and relocations. Set up sgotplt_jump_table_size. + Don't zero reloc_count in srelplt. + (elf_i386_always_size_sections): New. Set up _TLS_MODULE_BASE_. + (elf_i386_relocate_section): Handle R_386_TLS_GOTDESC and + R_386_TLS_DESC_CALL. + (elf_i386_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P. + (elf_backend_always_size_sections): Define. + * elf64-x86-64.c (x86_64_elf_howto): Add R_X86_64_GOTPC32_TLSDESC, + R_X86_64_TLSDESC, R_X86_64_TLSDESC_CALL. + (R_X86_64_standard): Adjust. + (x86_64_reloc_map): Map new relocs. + (elf64_x86_64_rtype_to_howto): New, split out of... + (elf64_x86_64_info_to_howto): ... this function, and... + (elf64_x86_64_reloc_type_lookup): ... use it to map elf_reloc_val. + (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros. + (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros. + (struct elf64_x86_64_link_hash_entry): Add tlsdesc_got field. + (struct elf64_x86_64_obj_tdata): Add local_tlsdesc_gotent field. + (elf64_x86_64_local_tlsdesc_gotent): New macro. + (struct elf64_x86_64_link_hash_table): Add tlsdesc_plt, + tlsdesc_got and sgotplt_jump_table_size fields. + (elf64_x86_64_compute_jump_table_size): New macro. + (link_hash_newfunc): Initialize tlsdesc_got. + (elf64_x86_64_link_hash_table_create): Initialize new fields. + (elf64_x86_64_tls_transition): Handle R_X86_64_GOTPC32_TLSDESC and + R_X86_64_TLSDESC_CALL. + (elf64_x86_64_check_relocs): Likewise. Allocate space for + local_tlsdesc_gotent. + (elf64_x86_64_gc_sweep_hook): Handle R_X86_64_GOTPC32_TLSDESC and + R_X86_64_TLSDESC_CALL. + (allocate_dynrelocs): Count function PLT relocations. Reserve + space for TLS descriptors and relocations. + (elf64_x86_64_size_dynamic_sections): Reserve space for TLS + descriptors and relocations. Set up sgotplt_jump_table_size, + tlsdesc_plt and tlsdesc_got. Make room for them. Don't zero + reloc_count in srelplt. Add dynamic entries for DT_TLSDESC_PLT + and DT_TLSDESC_GOT. + (elf64_x86_64_always_size_sections): New. Set up + _TLS_MODULE_BASE_. + (elf64_x86_64_relocate_section): Handle R_386_TLS_GOTDESC and + R_386_TLS_DESC_CALL. + (elf64_x86_64_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P. + (elf64_x86_64_finish_dynamic_sections): Set DT_TLSDESC_PLT and + DT_TLSDESC_GOT. Set up TLS descriptor lazy resolver PLT entry. + (elf_backend_always_size_sections): Define. + +2006-01-17 H.J. Lu + + PR binutils/2096 + * dwarf2.c (comp_unit_contains_address): Update comment. + (_bfd_dwarf2_find_nearest_line): Use section's vma, instead of + lma. Return TRUE only if both comp_unit_contains_address and + comp_unit_find_nearest_line return TRUE. + (_bfd_dwarf2_find_line): Use section's vma, instead of lma. + +2006-01-18 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add gc_mark_dynamic_ref. + (bfd_elf_gc_mark_dynamic_ref_symbol): Declare. + * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Rename from + elf_gc_mark_dynamic_ref_symbol. Make global. + (bfd_elf_gc_sections): Call bed->gc_mark_dynamic_ref. + * elfxx-target.h (elf_backend_gc_mark_dynamic_ref): Define. + (elfNN_bed): Init new field. + * elf64-ppc.c (elf_backend_gc_mark_dynamic_ref): Define. + (ppc64_elf_gc_mark_dynamic_ref): New function. + +2006-01-17 Alan Modra + + * elf64-ppc.c (ppc64_elf_gc_mark_hook): Don't hang forever in loop. + +2006-01-17 Nick Clifton + + PR binutils/2159 + * elf.c (elfcore_write_pstatus): Add ATTRIBUTE_UNUSED to unused + parameters. + +2006-01-11 Nick Clifton + + * elf32-arm.c (elf32_arm_output_symbol_hook): Install new entry + into the newly (re)allocated map array. + +2006-01-09 Alexis Wilke + + * peXXigen.c (tbl): Add comma after "HIGH3ADJ". + +2006-01-01 Jakub Jelinek + + * elf64-ppc.c (ppc64_elf_action_discarded): Return 0 + for .toc1 section. + +For older changes see ChangeLog-2005 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-2007 sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-2007 --- sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-2007 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-2007 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,3561 @@ +2007-12-31 H.J. Lu + + PR ld/5530 + * elfxx-ia64.c (elfNN_ia64_relocate_section): Call + _bfd_elf_find_segment_containing_section with output_bfd, + instead of input_bfd. + +2007-12-31 Nick Clifton + + * elf-m10300.c (mn10300_elf_relax_section): Use + _bfd_merged_section_offset to compute the offset of a symbol in a + merged section. + +2007-12-31 Nick Clifton + + * elf.c (_bfd_elf_find_segment_containing_section): New function: + Scan the segment map looking for the segment containing a + specified function. + * elf-bfd.h: Prototype the new function. + * elf-hppa.h (elf_hppa_osec_to_segment): Delete. + (elf_hppa_record_segment_addrs): Use new function. + * elf32-bfin.c (_bfdfdpic_osec_to_segment): Use new function. + * elf32-frv.c (_frvfdpic_osec_to_segment): Use new function. + * elf32-hppa.c (hppa_record_segment_addr): Use new function. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Use new function. + +2007-12-28 John David Anglin + + PR binutils/5146 + * elf64-hppa.c: Declare alloca when __GNUC__ is defined. + * som.c: Likewise. + + * elf-hppa.h (elf_hppa_osec_to_segment): New function. + (elf_hppa_record_segment_addrs): Use elf_hppa_osec_to_segment. + Remove ATTRIBUTE_UNUSED from abfd argument. + * elf32-hppa.c (hppa_record_segment_addr): Likewise. + +2007-12-28 Nick Hudson + + * elf32-hppa.c (hppa_record_segment_addr): Locate the segment + containing the section using the segment map, rather than guessing + based upon the section's vma and file position. + +2007-12-24 H.J. Lu + + PR binutils/5488 + * elf.c (IS_NOTE): New. + (IS_COREFILE_NOTE): Use IS_NOTE. + (IS_SECTION_IN_INPUT_SEGMENT): Use IS_NOTE instead of + IS_COREFILE_NOTE. + +2007-12-24 H.J. Lu + + PR binutils/5449 + * elf.c (rewrite_elf_program_header): Don't adjust p_paddr if + p_paddr is set to 0. + (copy_private_bfd_data): Call rewrite_elf_program_header if + p_paddr is set to 0. + + * elfcode.h (elf_swap_phdr_out): Set p_paddr to 0 if needed. + + * elfxx-ia64.c (ELF_MAXPAGESIZE): Don't redefine it for HPUX. + +2007-12-21 Bob Wilson + + * elf32-xtensa.c (relax_section): Update DIFF relocations in the + same way as other relocations. + +2007-12-18 Daniel Jacobowitz + + * section.c (BFD_FAKE_SECTION): Update. + * bfd-in2.h: Regenerate. + +2007-12-18 Daniel Jacobowitz + + * bfd-in2.h: Regenerate. + +2007-12-17 Pedro Alves + + * config.bfd: Add arm-*-mingw32ce* target. + +2007-12-15 Richard Sandiford + + * elf-bfd.h (eh_cie_fde): Replace u.cie.merged with a union of + a merged field and a sec field. + (eh_frame_hdr_info): Remove offsets_adjusted. + * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Update accesses to + the CIE merged field. + (_bfd_elf_gc_mark_fdes): Likewise. + (_bfd_elf_discard_section_eh_frame): Likewise. Set u.cie.u.sec + when clearing the removed flag. + (_bfd_elf_eh_frame_section_offset): Remove offsets_adjusted handling. + (_bfd_elf_write_section_eh_frame): Likewise. Apply output_offsets + where appropriate. + +2007-12-15 Richard Sandiford + + * elf-bfd.h (eh_cie_fde): Move add_fde_encoding and + per_encoding_relative to u.cie. Add commentary. + * elf-eh-frame.c (cie): Remove make_relative. + (extra_augmentation_string_bytes): Update use of add_fde_encoding. + (extra_augmentation_data_bytes): Likewise. Use an FDE's own + add_augmentation_size field, rather than referring to the CIE. + (_bfd_elf_parse_eh_frame): Don't set the struct cie + make_relative field; set the eh_cie_fde field directly. + Update setting of add_fde_encoding and per_encoding_relative. + Copy make_relative and add_augmentation_size from the CIE + to the FDE. + (_bfd_elf_discard_section_eh_frame): Use the FDE's own + make_relative field. + (_bfd_elf_eh_frame_section_offset): Likewise. + (_bfd_elf_write_section_eh_frame): Update accesses to + add_fde_encoding and per_encoding_relative. Use the FDE's + own make_relative and add_augmentation_size fields. + +2007-12-15 Richard Sandiford + + * elf-bfd.h (eh_cie_fde): Remove need_lsda_relative. + Move make_lsda_relative to u.cie. + * elf-eh-frame.c (cie): Rename make_lsda_relative to + can_make_lsda_relative. + (_bfd_elf_parse_eh_frame): Don't set the old eh_cie_fde + make_lsda_relative field. Update after cie renaming. + Set u.cie.make_lsda_relative if can_make_lsda_relative + and if we find a relocation against the LSDA. + (_bfd_elf_discard_section_eh_frame): Copy make_lsda_relative when + changing a CIE's group representative. + (_bfd_elf_eh_frame_section_offset): Don't set need_ldsa_relative here. + (_bfd_elf_write_section_eh_frame): Check u.cie.make_lsda_relative + rather than need_lsda_relative. + +2007-12-15 Richard Sandiford + + * elf-bfd.h (eh_cie_fde): Add u.fde.next_for_section and + u.cie.gc_mark. + (bfd_elf_section_data): Add fde_list. + (elf_fde_list): New macro. + (elf_obj_tdata): Add eh_frame_section. + (elf_eh_frame_section): New macro. + (_bfd_elf_gc_mark_reloc): Remove last parameter. + (_bfd_elf_gc_mark_fdes): Declare. + * elf-eh-frame.c (_bfd_elf_get_eh_frame_sec_info): Chain the FDEs + for each input section. + (mark_entry, _bfd_elf_gc_mark_fdes): New functions. + * elflink.c (_bfd_elf_gc_mark_reloc): Remove is_eh parameter. + (_bfd_elf_gc_mark): Update call accordingly. Mark the relocations + againts the section's FDEs. Don't mark the bfd's elf_eh_frame_section. + (bfd_elf_gc_sections): Parse each input bfd's .eh_frame before + marking any input sections. Remove the current EH handling. + * section.c (bfd_section): Remove gc_mark_from_eh. + * ecoff.c (bfd_debug_section): Update initializer accordingly. + +2007-12-15 Richard Sandiford + + * elf-bfd.h (eh_cie_fde): Add u.cie. Document how u.fde.cie_inf + changes when removed == 0. + (eh_frame_hdr_info): Add parsed_eh_frames. + (_bfd_elf_begin_eh_frame_parsing): Declare. + (_bfd_elf_parse_eh_frame): Declare. + (_bfd_elf_end_eh_frame_parsing): Declare. + * elf-eh-frame.c (_bfd_elf_begin_eh_frame_parsing): New function. + (_bfd_elf_parse_eh_frame): New function, split out from + _bfd_elf_discard_section_eh_frame. Make a first pass through the + buffer to calculate the number of entries and CIEs. Allocate memory + for them before the main loop. Replace current extended cie + representation with a pair of pointers, one to the local eh_cie_fde + and one to the full struct cie. Allocate a separate array of struct + cies if not merging. Merge CIEs during the main loop and set up each + u.cie.merged field. Point an FDE's cie_inf field directly at the + local CIE. Initially assume that all entries should be removed. + (_bfd_elf_end_eh_frame_parsing): New function. + (_bfd_elf_discard_section_eh_frame): Assume that the section has + already been parsed. Use a separate pass to mark entries that + need to be kept. Use the u.cie.merged field to track a CIE's + group representative. + * elflink.c (bfd_elf_discard_info): Call _bfd_elf_parse_eh_frame + before _bfd_elf_discard_section_eh_frame. Wrap loop with calls to + _bfd_elf_begin_eh_frame_parsing and _bfd_elf_end_eh_frame_parsing. + +2007-12-15 Richard Sandiford + + * elf-bfd.h (eh_cie_fde): Put cie_inf in a union. Add a reloc_index + field. Use bitfields for fde_encoding, lsda_encoding and lsda_offset. + * elf-eh-frame.c (extra_augmentation_data_bytes): Adjust cie_inf + accesses after the above change. + (_bfd_elf_eh_frame_section_offset): Likewise. + (_bfd_elf_write_section_eh_frame): Likewise. + (_bfd_elf_discard_section_eh_frame): Likewise. Set up reloc_index. + +2007-12-15 Richard Sandiford + + * elf-bfd.h (_bfd_elf_gc_mark_rsec, _bfd_elf_gc_mark_reloc): Declare. + (_bfd_elf_gc_mark): Use elf_gc_mark_hook_fn. + * elflink.c (init_reloc_cookie, fini_reloc_cookie) + (init_reloc_cookie_rels, fini_reloc_cookie_rels): New functions, + split out from... + (bfd_elf_discard_info): ...here. + (init_reloc_cookie_for_section): New function. + (fini_reloc_cookie_for_section): Likewise. + (_bfd_elf_gc_mark_rsec, _bfd_elf_gc_mark_reloc): New functions, + split out from... + (_bfd_elf_gc_mark): ...here. Use init_reloc_cookie_for_section + and fini_reloc_cookie_for_section. + +2007-12-12 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_do_reloc): Update self_address along with + address. + (print_action_list): Fix name for ta_convert_longcall. + +2007-12-11 Catherine Moore + + * elf.c (_bfd_elf_copy_private_symbol_data): Don't copy shndx if + the symbol's section is the undefined section. + +2007-12-11 Alan Modra + + * elf.c (elf_fake_sections): Add "warning:" to "..changed to PROGBITS" + message. + +2007-12-07 Bob Wilson + + * elf32-xtensa.c (elf_howto_table): Add R_XTENSA_32_PCREL. + (elf_xtensa_reloc_type_lookup): Handle BFD_RELOC_32_PCREL. + (elf_xtensa_check_relocs): Use default case for all relocations that + need nothing done here. + (elf_xtensa_do_reloc): Compute self_address for all relocation types. + Handle R_XTENSA_32_PCREL. + (elf_xtensa_relocate_section): Check for R_XTENSA_32_PCREL for dynamic + symbols. + (check_section_ebb_pcrels_fit): Ignore R_XTENSA_32_PCREL relocations. + +2007-12-05 Alan Modra + + * elf32-spu.c (spu_elf_size_stubs): Do consider branches to + non-function symbols for overlay stubs. + +2007-12-04 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Create DT_PLTGOT + entry for all dynamic objects. + +2007-12-04 Alan Modra + + * elf32-spu.c (spu_elf_size_stubs): Correct section alignment. + +2007-11-30 Richard Sandiford + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use the + ELF header to choose between 32-bit and 64-bit relocation structures. + +2007-11-29 Mark Shinwell + + * archures.c (bfd_mach_mips_loongson_2e): New. + (bfd_mach_mips_loongson_2f): New. + * bfd-in2.h (bfd_mach_mips_loongson_2e): New. + (bfd_mach_mips_loongson_2f): New. + * cpu-mips.c: Add I_loongson_2e and I_loongson_2f to + anonymous enum. + (arch_info_struct): Add Loongson-2E and Loongson-2F entries. + * elfxx-mips.c (_bfd_elf_mips_mach): Handle Loongson-2E + and Loongson-2F flags. + (mips_set_isa_flags): Likewise. + (mips_mach_extensions): Add Loongson-2E and Loongson-2F + entries. + +2007-11-29 Nick Clifton + + PR ld/5398 + * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Do not + complain if there is no glue bfd, just return. + +2007-11-28 Nick Clifton + + * elf-m10300.c (mn10300_elf_relax_section): Extend previous fix to + cover forward jumps. + +2007-11-21 Nick Clifton + + * elf-m10300.c (mn10300_elf_relax_section): Allow for alignment + relocs when computing whether instructions can be relaxed. + +2007-11-16 Tristan Gingold + + * elflink.c (elf_link_output_extsym): Weaken assertion: if + --gc-section is set, there may be no TLS segment. + +2007-11-19 Alan Modra + + * elf-bfd.h (bfd_elf_perform_complex_relocation): Update prototype. + * elflink.c (bfd_elf_perform_complex_relocation): Return status. + Don't print reloc overflow message. + * elf32-mep.c (mep_elf_relocate_section): Handle status from + bfd_elf_perform_complex_relocation. + +2007-11-17 Thiemo Seufer + + * elfxx-mips.c (mips_elf_merge_obj_attributes): Handle -mips32r2 + -mfp64 attribute. + +2007-11-16 Nick Clifton + + * elf-m10300.c (mn10300_elf_check_relocs): Fix memory leak and + check that bfd_elf_get_elf_syms is only called once. + +2007-11-16 Ulrich Weigand + + * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Set udata.p of + synthetic symbol to point to the ELF symbol it was derived from. + +2007-11-15 Alan Modra + + PR 5328 + * opncls.c (separate_debug_file_exists): Use fopen/fread + rather than open/read and open in binary mode. + +2007-11-14 Richard Sandiford + + * elfxx-mips.c (mips_got_page_range): New structure. + (mips_got_page_entry): Likewise. + (mips_got_info): Add page_gotno and got_page_entries fields. + (mips_elf_got_per_bfd_arg): Add max_pages field. Delete + primary_count and current_count fields. + (mips_got_page_entry_hash, mips_got_page_entry_eq): New functions. + (mips_elf_pages_for_range, mips_elf_record_got_page_entry): Likewise. + (mips_elf_get_got_for_bfd): New function, split out from + mips_elf_make_got_per_bfd. Initialize the page_gotno and + got_page_entries fields when creating a new GOT structure. + (mips_elf_make_got_pages_per_bfd): New function. + (mips_elf_merge_got_with): New function, split out from + mips_elf_make_got_per_bfd. Merge page entries as well as + non-page entries. Use the minimum of max_pages and the sum + of the page_gotnos to estimate the number of page entries. + (mips_elf_merge_gots): Use the minimum of max_pages and the + bfd's page_gotno to estimate the number of page entries. + Use the above functions. + (mips_elf_multi_got): Add page entries as well as non-page entries + to the individual per-bfd GOTs. Initialize got_per_bfd_arg.max_pages. + Initialize the page_gotno and got_page_entries fields when creating + a new primary GOT. Use the minimum of pages and page_gotno when + adding the number of pages entries to local_gotno. + (mips_elf_create_got_section): Initialize the page_gotno and + got_page_entries fields of the GOT structure. + (mips_elf_rel_relocation_p, mips_elf_read_rel_addend) + (mips_elf_add_lo16_rel_addend, mips_elf_get_section_contents): New + functions, split out from... + (_bfd_mips_elf_relocate_section): ...here. + (_bfd_mips_elf_check_relocs): Record GOT page entries too. + (_bfd_mips_relax_section): Use mips_elf_get_section_contents. + (_bfd_mips_elf_always_size_sections): Use the smaller of the + loadable_size- and page_gotno-derived estimates. + +2007-11-14 Thiemo Seufer + + * elfxx-mips.c (mips_elf_merge_obj_attributes): Prevent + unwanted fallthroughs in case statement. + +2007-11-13 H.J. Lu + + PR binutils/5307 + * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Don't + copy input subsystem if output is different from input. + +2007-11-13 Nick Clifton + + * elf-m10300.c (mn10300_elf_final_link_relocate): Prevent the + accidental termination of DWARF location list entries. + (mn10300_elf_relax_delete_bytes): Stop deletion if an align reloc + is encountered that is larger than or not a mutliple of the number + of bytes being deleted. + When adjusting symbols, any symbols inside the region being + deleted must be moved to the end of the region. + Move align relocs forward if there is room for them after the + deletion of the region. + +2007-11-13 Alan Modra + + PR 5233 + * elf.c (rewrite_elf_program_header): Formatting. Add + first_matching_lma and first_suggested_lma booleans and use + instead of testing matching_lma and suggested_lma for zero. + +2007-11-12 H.J. Lu + + PR binutils/5299 + * peicode.h (pe_bfd_object_p): Save and restore previous bfd + state when calling coff_object_p. + +2007-11-12 Alan Modra + + * elf.c (_bfd_elf_get_synthetic_symtab): Only bump the symbol + pointer when we have a valid symbol. Init udata.p to NULL. + +2007-11-09 Nathan Sidwell + + * elf-vxworks.c (elf_vxworks_emit_relocs): Don't clobber + rel_hash. Move loop inside if test. + +2007-11-08 Nathan Sidwell + + * elf-vxworks.h (elf_vxworks_add_dynamic_entries): Declare. + (elf_vxworks_finish_dynamic_entry): Declare. + * elf-vxworks.c: Include elf/vxworks.h. + (elf_vxworks_add_dynamic_entries): New. + (elf_vxworks_finish_dynamic_entry): New. + * Makefile.am (elf-vxworks.lo): Add dependency. + * Makefile.in (elf-vxworks.lo): Add dependency. + * elf32-i386.c (elf_i386_size_dynamic_sections, + elf_i386_finish_dynamic_sections): Call + elf_vxworks_add_dynamic_entries and + elf_vxworks_finish_dynamic_entry. + * elf32-ppc.c (ppc_elf_size_dynamic_sections, + ppc_elf_finish_dynamic_sections): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections, + sparc_finish_dyn): Likewise. + * elf32-sh.c (sh_elf_size_dynamic_sections, + sh_elf_finish_dynamic_sections): Likewise. + * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections, + _bfd_mips_elf_finish_dynamic_sections): Likewise. + * elf32-arm.c (elf32_arm_size_dynamic_sections, + elf32_arm_finish_dynamic_sections): Likewise. + +2007-11-07 Olivier Hainque + + * bfd/elfxx-mips.c (_bfd_mips_elf_fake_sections): Force + SHF_MIPS_NOSTRIP on .debug_frame for Irix. + +2007-11-06 Alan Modra + + * elf64-ppc.c (ppc64_elf_check_relocs): Don't refcount tlsld_got here.. + (ppc64_elf_gc_sweep_hook): ..or here.. + (ppc64_elf_tls_optimize): ..or here. Make two passes through the + relocs, ensuring that tls_get_addr calls follow gd and ld relocs. + (allocate_dynrelocs): Refcount tlsld_got here. + (ppc64_elf_size_dynamic_sections): Allocate local got and call + allocate_dynrelocs before allocating tlsld_got. + (ppc64_elf_relocate_section): Remove check that a tls_get_addr + call follows gd and ld relocs. + + * elf32-ppc.c (ppc_elf_check_relocs): Don't refcount tlsld_got here.. + (ppc_elf_gc_sweep_hook): ..or here.. + (ppc_elf_tls_optimize): ..or here. Make two passes through the + relocs, ensuring that tls_get_addr calls follow gd and ld relocs. + (allocate_dynrelocs): Refcount tlsld_got here. + (ppc_elf_size_dynamic_sections): Call allocate_dynrelocs before + allocating tlsld_got. + (ppc_elf_relocate_section): Remove check that a tls_get_addr + call follows gd and ld relocs. + +2007-11-05 Alan Modra + + * merge.c (sec_merge_hash_lookup): Revert last change. + (record_section): Likewise. + (_bfd_merge_sections): Likewise. + (_bfd_merged_section_offset): Properly handle NULL secinfo. + (_bfd_add_merge_section): Allocate extra space for a zero + terminator on SEC_STRINGS sections. + +2007-11-05 Danny Smith + + * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Let .data, .text + and .bss section use the default. + * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. + +2007-11-01 Joseph Myers + + * merge.c (sec_merge_hash_lookup): Add parameter sec_end. Check + for unterminated strings. All callers changed. + (record_section): Add parameter abfd. Give error message for + unterminated strings. + (_bfd_merge_sections): Update call to record_section. + (_bfd_write_merged_section, _bfd_merged_section_offset): Handle + NULL secinfo from merge failures. + +2007-10-31 Nick Clifton + + * elf-m10300.c (mn10300_elf_relax_delete_bytes): Do not look for + align relocs when there are no relocs attached to the section. + +2007-10-31 Alan Modra + + * elf-bfd.h (bfd_elf_match_symbols_in_sections): Don't declare. + * elflink.c (bfd_elf_match_symbols_in_sections): Make static. + Remove section name comparisons. + +2007-10-30 Nick Clifton + + * reloc.c (BFD_RELOC_MN10300_ALIGN): Add. + * bfd-in2.h: Regenerate. + * libbfd.h: Regnerate. + * elf-m10300.h: Handle R_MN10300_ALIGN relocs. + (mn10300_elf_relax_delete_bytes): Honour R_MN10300_ALIGN relocs. + Re-fix off by one error in comparisons. + +2007-10-25 Pedro Alves + + * bfd-in.h (STRING_COMMA_LEN): Don't handle NULL STR case. + * bfd-in2.h: Regenerate. + +2007-10-25 Daniel Jacobowitz + + * elf32-ppc.c (ppc_elf_merge_obj_attributes): Add support for + Tag_GNU_Power_ABI_Vector. + +2007-10-25 Joseph Myers + + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Do not add + PT_NULL header when not linking. + +2007-10-25 Carlos Eduardo Seo + + * elf.c (elfcore_grok_ppc_vmx): New function. + (elfcore_grok_note): Handle NT_PPC_VMX. + (elfcore_write_ppc_vmx): New function. + * elf-bfd.h (elfcore_write_ppc_vmx): Declare. + +2007-10-24 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2007-10-23 Alan Modra + + * elf64-ppc.c (ppc_build_one_stub): Don't duplicate relocs + emitted for ".brlt" entries. + (toc_adjusting_stub_needed): Don't treat ".fixup" specially here.. + (ppc64_elf_next_input_section): ..instead do so here. + +2007-10-19 Nick Clifton + + * config.bfd: Recognise am34-linux-gnu target. + * reloc.c: Add BFD_RELOC_MN10300_SYM_DIFF relocation. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * elf-m10300.c (elf_mn10300_howto): Add R_MN10300_SYM_DIFF. + (mn10300_reloc_map): Likewise. + (mn10300_elf_check_relocs): Do not create dynamic relocs for + symbol differences or relocations against absolute symbols. + (mn10300_elf_final_link_relocate): Likewise. + Handle R_MN10300_SYM_DIFF relocs. + (mn10300_elf_relocate_section): Fix for creating local copys of + dynamic relocs. + (mn10300_elf_relax_delete_bytes): Adjust symbols at the end of the + region. Adjust the size of function symbols. + (mn10300_elf_relax_section): Ignore symbols that are in discarded + sections. + +2007-10-19 Nick Clifton + + * elf-m10300.c: Convert to ISO C. + +2007-10-18 H.J. Lu + Alan Modra + + PR ld/4424 + * config.bfd (targ_selvecs): Add bfd_elf64_alpha_vec for + alpha/FreeBSD. Add bfd_elf64_sparc_vec for sparc64/FreeBSD. + Add bfd_elf32_i386_vec and bfd_efi_app_ia32_vec for i386/FreeBSD. + (targ64_selvecs): Set for i386/FreeBSD. + * elf-bfd.h (elf_backend_data): Add relocs_compatible. + (_bfd_elf_default_relocs_compatible): Declare. + (_bfd_elf_relocs_compatible): Declare. + * elfxx-target.h (elf_backend_relocs_compatible): Define. + (elfNN_bed): Init new relocs_compatible field. + * elflink.c (_bfd_elf_default_relocs_compatible): New function. + (_bfd_elf_relocs_compatible): New function. + (elf_link_add_object_symbols): Call bed->relocs_compatible. + * elf32-i386.c (elf_backend_relocs_compatible): Define. + * elf64-alpha.c: Likewise. + * elf64-sparc.c: Likewise. + * elf64-x86-64.c: Likewise. + +2007-10-16 Bob Wilson + + * elf32-xtensa.c (relax_section): Check for a reference to a discarded + DWARF section and anticipate its replacement with the kept section. + +2007-10-16 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_discard_info_for_section): Remove + unnecessary size variables. Set sec->rawsize. + (relax_section, relax_property_section): Likewise. + +2007-10-16 Bob Wilson + + * section.c (struct bfd_section): Clarify comment for rawsize field. + * bfd-in2.h: Regenerate. + +2007-10-16 Bob Wilson + + * elflink.c (_bfd_elf_check_kept_section): Use the section rawsize + values if they are set. + +2007-10-16 Nick Clifton + + PR 5146 + * configure.in (AC_CHECK_HEADERS): Add alloca.h + * configure: Regenerate. + * config.in: Regenerate. + * som.c: Replace alloca-conf.h inclusion with code recommended in + autoconf documentation. + * elf64-hppa.c: Likewise. + +2007-10-16 Nick Clifton + + * configure.in (--enable-elf-stt-common): New configure + option. If enabled then the tools can generate symbols with + the ELF STT_COMMON type. + * config.in: Regenerate. + * configure: Regenerate. + * elf.c (swap_out_syms): If USE_STT_COMMON is defined then set + the type of emitted common symbols to STT_COMMON. + * elfcode.h (elf_slurp_symbol_table): Accept STT_COMMON symbol + types. + +2007-10-15 Alan Modra + + * coff-arm.c (arm_emit_base_file_entry): Check fwrite return value. + Return status. Adjust callers. + * coff-mcore.c (mcore_emit_base_file_entry): Likewise. + * coff-ppc.c (write_base_file_entry): New function. + (coff_ppc_relocate_section): Use it. + * elf32-arm.c (find_thumb_glue): Check asprintf return status. + (find_arm_glue): Likewise. + * vms-misc.c (_bfd_vms_output_flush): Check fwrite return value. + +2007-10-12 Nick Clifton + + PR 5160 + * elflink.c (eval_symbol): Remove bufsz variable and use + sizeof(symbuf) where necessary. + +2007-10-12 M R Swami Reddy + + * elf32-cr16.c (elf32_cr16_relax_section): Fix condition check typo. + +2007-10-12 Daniel Jacobowitz + + * elfxx-mips.c (mips_elf_sort_hash_table_f): Handle forced + local symbols specially. + (mips_elf_set_global_got_offset): Skip forced local symbols. + +2007-10-12 Alan Modra + + * elf.c (elfcore_grok_prxfpreg): Fix comment typo. + +2007-10-10 H.J. Lu + + * elf.c (get_program_header_size): Always add a PT_GNU_RELRO + segment for -z relro. + (_bfd_elf_map_sections_to_segments): Make a PT_GNU_RELRO + segment only when needed. + +2007-10-05 Bob Wilson + + * elf32-xtensa.c (relax_section): Call pin_internal_relocs when + changing a relocation's offset. Adjust call to translate_reloc. Do + not add a fix record for a DIFF reloc. For other relocs, only add a + fix record if the translated target is in a different object file; + otherwise, just update the relocation. Call pin_internal_relocs when + updating a reloc but not when adding a fix record. + (translate_reloc): Get the target section from a new argument, not + from the relocation. Change check for relaxable sections to an + assertion. Compute separate offset adjustments for the base symbol + and the addend, and set the new relocation's addend correctly. Return + the new target section. + +2007-10-05 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_relocate_section): Remove updates of + r_type and howto after calling do_fix_for_relocateable_link and + do_fix_for_final_link. + +2007-10-05 Bob Wilson + + * elf32-xtensa.c (removed_by_actions): New. + (offset_with_removed_text): Reimplement using removed_by_actions. + (offset_with_removed_text_before_fill): Delete. + (relax_property_section): Use removed_by_actions. Rearrange logic. + (relax_section_symbols): Likewise. + +2007-10-04 Bob Wilson + + * elf32-xtensa.c (reloc_bfd_fix_struct): Delete target_abfd field. + (reloc_bfd_fix_init): Remove target_abfd argument. + (relax_section, move_literal): Adjust calls to reloc_bfd_fix_init. + +2007-10-04 Nick Clifton + + PR linker/5099 + * elf64-x86-64.c (elf64_x86_64_check_relocs): Add missing + apostrophe to error message. + +2007-10-01 M R Swami Reddy + + * elf32-cr16.c: Fixed DISP8, DISP20 and IMM20 relocations at + final relocation phase. + Added the below relaxations: IMM32 -> IMM20/IM16 -> IMM4. + * reloc.c: Added 3 new relocations: R_CR16_SWITCH8, + R_CR16_SWITCH16, R_CR16_SWITCH32. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2007-09-30 Alan Modra + + * elflink.c: Formatting. + +2007-09-29 Alan Modra + + * elflink.c (resolve_symbol): Handle symbols in SEC_MERGE + sections. Don't test symbol st_shndx. Don't bother with + bfd_link_hash_common symbols. Print longs rather than ints + in debug messages. + (eval_symbol): Replace "sym" and "advanced" params with "symp". + Replace "addr" and "section_offset" params with "dot". Don't + cast bfd_vma values to signed, cast them to bfd_signed_vma. + (bfd_elf_perform_complex_relocation): Delete "output_bfd", "info", + "local_syms" and "local_sections" params. Add "relocation". + Delete code calculating relocation value. + (evaluate_complex_relocation_symbols): Delete function. Fold into.. + (elf_link_input_bfd): ..existing code examining relocs. + * elf-bfd.h (bfd_elf_perform_complex_relocation): Update prototype. + * elf32-mep.c (mep_elf_check_relocs): Delete function. + (mep_elf_gc_sweep_hook, mep_elf_gc_mark_hook): Likewise. + (mep_elf_object_p): Don't set elf_bad_symtab. + (elf_backend_check_relocs): Don't define. + (elf_backend_gc_mark_hook, elf_backend_gc_sweep_hook): Likewise. + (elf_backend_can_gc_sections, USE_RELA): Likwise. + (mep_elf_relocate_section): Move bfd_elf_perform_complex_relocation + call after we have calculated reloc value. Delete local sym + debug code. Use RELOC_FOR_GLOBAL_SYMBOL. Delete addend + adjusting code.. + (elf_backend_rela_normal): ..instead define this. + +2007-09-28 Alan Modra + + * elf-m10300.c (mn10300_elf_check_relocs): Delete dead code. + * elf32-arm.c (elf32_arm_check_relocs): Likewise. + * elf32-avr.c (elf32_avr_check_relocs): Likewise. + * elf32-bfin.c (bfinfdpic_check_relocs): Likewise. + * elf32-cris.c (cris_elf_check_relocs): Likewise. + * elf32-d10v.c (elf32_d10v_check_relocs): Likewise. + * elf32-dlx.c (elf32_dlx_check_relocs): Likewise. + * elf32-fr30.c (fr30_elf_check_relocs): Likewise. + * elf32-frv.c (_frvfdpic_check_discarded_relocs): Likewise. + (elf32_frv_check_relocs): Likewise. + * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise. + * elf32-m32c.c (m32c_elf_check_relocs): Likewise. + * elf32-m32r.c (m32r_elf_check_relocs): Likewise. + * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise. + * elf32-mcore.c (mcore_elf_check_relocs): Likewise. + * elf32-msp430.c (elf32_msp430_check_relocs): Likewise. + * elf32-mt.c (mt_elf_check_relocs): Likewise. + * elf32-openrisc.c (openrisc_elf_check_relocs): Likewise. + * elf32-sh.c (sh_elf_check_relocs): Likewise. + * elf64-mmix.c (mmix_elf_check_relocs): Likewise. + * elf64-sh64.c (sh_elf64_check_relocs): Likewise. + * elf32-score.c (_bfd_score_elf_check_relocs): Likewise. + (score_elf_local_relocation_p): Likewise. + (_bfd_score_elf_relocate_section): Likewise. + (score_elf_final_link_relocate): Likewise. + +2007-09-26 Jan Beulich + + * elf32-i386.c (elf_i386_check_relocs): Revert NULL pointer + check for R_386_GNU_VTINHERIT. + * elf-m10300.c (mn10300_elf_check_relocs): Check for NULL + pointer for R_xxx_GNU_VTENTRY. + * elf32-arm.c (elf32_arm_check_relocs): Likewise. + * elf32-bfin.c (bfin_check_relocs): Likewise. + (bfinfdpic_check_relocs): Likewise. + * elf32-cris.c (cris_elf_check_relocs): Likewise. + * elf32-d10v.c (elf32_d10v_check_relocs): Likewise. + * elf32-dlx.c (elf32_dlx_check_relocs): Likewise. + * elf32-fr30.c (fr30_elf_check_relocs): Likewise. + * elf32-frv.c (elf32_frv_check_relocs): Likewise. + * elf32-hppa.c (elf32_hppa_check_relocs): Likewise. + * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise. + * elf32-m32r.c (m32r_elf_check_relocs): Likewise. + * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise. + * elf32-m68k.c (elf_m68k_check_relocs): Likewise. + * elf32-mcore.c (mcore_elf_check_relocs): Likewise. + * elf32-openrisc.c (openrisc_elf_check_relocs): Likewise. + * elf32-ppc.c (ppc_elf_check_relocs): Likewise. + * elf32-s390.c (elf_s390_check_relocs): Likewise. + * elf32-score.c (_bfd_score_elf_check_relocs): Likewise. + * elf32-sh.c (sh_elf_check_relocs): Likewise. + * elf32-v850.c (v850_elf_check_relocs): Likewise. + * elf32-vax.c (elf_vax_check_relocs): Likewise. + * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise. + * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise. + * elf64-mmix.c (mmix_elf_check_relocs): Likewise. + * elf64-ppc.c (ppc64_elf_check_relocs): Likewise. + * elf64-s390.c (elf_s390_check_relocs): Likewise. + * elf64-sh64.c (sh_elf64_check_relocs): Likewise. + * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. + * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise. + +2007-09-26 Alan Modra + + * elflink.c (set_symbol_value): Add isymbuf and locsymcount + params. Change symidx to a size_t. Don't access past end + of symbol buffer. + (resolve_symbol): Add isymbuf param and use instead of + finfo->internal_syms. + (eval_symbol, evaluate_complex_relocation_symbols): Likewise. + (elf_link_input_bfd): Don't read symbols specially for + evaluate_complex_relocation_symbols. + +2007-09-26 Tristan Gingold + + * som.c (som_get_reloc_upper_bound): If there are no relocs return + enough space to hold a NULL pointer. + +2007-09-26 Alan Modra + + * elf64-ppc.c (ppc_build_one_stub): Correct rel_hdr.sh_size. + +2007-09-25 Alan Modra + + * elf32-spu.c (struct spu_link_hash_table): Add ovly_load_r_symndx. + (spu_elf_size_stubs): Count stub relocs. + (write_one_stub): Emit relocs on overlay call stubs. + + * elf32-spu.c (struct spu_link_hash_table): Add "stubs". + (spu_elf_link_hash_table_create): Init new field. + (spu_elf_size_stubs): Store sorted stub syms in new htab field + rather than local var. + (spu_elf_build_stubs): Iterate over htab stubs rather than + hash traversal. + (struct stubarr): Delete. + (allocate_spuear_stubs, populate_stubs, write_one_stub): Adjust. + +2007-09-24 Daniel Jacobowitz + + * elf.c (assign_file_positions_for_load_sections): Trust + p_align_valid. + (copy_elf_program_header): Copy PT_NULL segments. + +2007-09-24 Trevor Smigiel + + * elf32-spu.c (is_indirect_branch): New function. + (find_function_stack_adjust): End scan on hitting indirect branch. + (sum_stack): Cast %v arg to correct type. + +2007-09-21 H.J. Lu + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerated. + +2007-09-21 Doug Kwan + + * Makefile.am (BFD32_LIBS): Add arange-set.lo. + (BFD32_LIBS_CFILES): Add arange-set.c. + (SOURCE_HFILES): Add arange-set.h + (dwarf2.lo): Add dependency upon arange-set.h. + (arange-set.lo): New target. + * Makefile.in: Regenerate. + * arange-set.c: New file. + * arange-set.h: New file. + * dwarf2.c: Include arange-set.h. + (struct dwarf2_debug) Add new fields comp_unit_count and + comp_unit_arange_set. + (struct comp_unit) Replace field arange with a new field arange_set. + (dwarf2_arange_set_allocate, dwarf2_arange_set_deallocate, + dwarf2_combine_arange_value, dwarf2_arange_set_new, + dwarf2_arange_set_with_value_new, dwarf2_comp_unit_arange_add): New + functions to utilize arange set in dwarf2.c. + (arange_add): Formatting change for a line longer than 80 characters. + (decode_line_info): Replace call target arange_add with + dwarf2_comp_unit_arange_add. + (read_rangelist_insert_arange_list, + read_rangelist_comp_unit_arange_add): New functions used as callbacks + for read_rangelist. + (read_rangelist): Change interface to accept a callback and data to + allow caller to select the action peformed on a new range list read. + (scan_unit_for_symbols): Use new interface of read_rangelist. + (parse_comp_unit): Create an arange set for each new comp unit. + Use new interface of read_rangelist. Replace call to arange_add + with that to dwarf2_comp_unit_arange_add. + (comp_unit_contains_address): Replace sequential search with a call to + arange_set_lookup_address, which can handles large set efficiently. + (stash_copy_local_aranges, stash_maybe_enable_arange_set, + stash_find_nearest_line_fast): New functions maintaining and using a + valued global arange set for all compilation units to speed up + bfd_dwarf2_find_nearest_line. + (find_line): Use global arange set. Replace sequential search over all + compilation units with a call to stash_find_nearest_line_fast. Add + book keeping to count number of compilation units. Replace empty + arange list test with a call to arange_set_empty_p. + +2007-09-21 Olivier Hainque + Tristan Gingold + + * syms.c (_bfd_stab_section_find_nearest_line): Look at the + specific SOM sections for stabs if the regular ones are not found. + * som.h (struct somdata): Add a line_info field, to be used by + som_find_nearest_line. + * som.c (som_find_nearest_line): Implement using the bfd stabs + function above. + +2007-09-19 Daniel Jacobowitz + + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Make sure .got + will be output. + +2007-09-19 Alan Modra + Doug Kwan + + * bfd-in.h (bfd_hash_insert): Declare. + * bfd-in2.h: Regenerate. + * hash.c (bfd_hash_insert): New function. Split out from.. + (bfd_hash_lookup): ..here. + * merge.c (sec_merge_hash_lookup): Use bfd_hash_insert. + +2007-09-18 Alan Modra + + * elf.c (bfd_section_from_shdr): Check bfd_alloc return. + (elfcore_write_note): Check realloc return. + * elflink.c (_bfd_elf_link_find_version_dependencies): Check + bfd_zalloc return. + (_bfd_elf_link_assign_sym_version): Check bfd_malloc return. + (elf_link_add_object_symbols): Likewise. + (struct hash_codes_info): New. + (elf_collect_hash_codes): Return bfd_malloc error. + (struct collect_gnu_hash_codes): Add "error". + (elf_collect_gnu_hash_codes): Return bfd_malloc error. + (bfd_elf_size_dynamic_sections): Check return status of + _bfd_elf_link_find_version_dependencies. + (bfd_elf_size_dynsym_hash_dynstr): Adjust for elf_collect_hash_codes + and elf_collect_gnu_hash_codes changes. + (elf_sym_name_compare): Formatting. + (elf_fixup_link_order): Use bfd_malloc, not xmalloc. + +2007-09-17 H.J. Lu + + PR binutils/3281 + PR binutils/5037 + * elf-bfd.h (elf_obj_tdata): Remove relro. + + * elf.c (get_program_header_size): Check info->relro instead + of elf_tdata (abfd)->relro. + (_bfd_elf_map_sections_to_segments): Likewise. + (assign_file_positions_for_load_sections): Don't set + PT_GNU_RELRO segment alignment here. + (assign_file_positions_for_non_load_sections): Properly set up + PT_GNU_RELRO segment for copying executable/shared library. + (rewrite_elf_program_header): Remove PT_GNU_RELRO segment. + (copy_elf_program_header): Set p_size and p_size_valid fields for + PT_GNU_RELRO segment. + +2007-09-17 Nick Clifton + + * po/fi.po: New Finnish translation. + * po/es.po: Updated Spanish translation. + * configure.in (ALL_LINGUAS): Add fi. + * configure: Regenerate. + * po/bfd.pot: Regenerate. + +2007-09-15 Nick Clifton + + * bfd.c (_bfd_default_error_handler): fflush stdout. + +2007-09-14 Alan Modra + + * opncls.c (find_separate_debug_file): Ensure bfd_set_error has + been called on all error return paths. + (bfd_fill_in_gnu_debuglink_section): Use bfd_malloc, not malloc. + Clear padding after filename + +2007-09-14 Alan Modra + + * format.c (bfd_check_format_matches): Record matching targets even + when "matching" is NULL to allow bfd_associated_vector matches. + Consolidate error return code. Consolidate ok return code. Always + restore original target and format on error. + +2007-09-14 Alan Modra + + * configure.in: Delete BFD_HOST_LONG_LONG and bfd checks for + long long. Partly revert 2007-07-12 change, so that + BFD_HOST_64BIT_LONG and BFD_HOST_64BIT_LONG_LONG are set + independent of "void *" size. + * configure: Regenerate. + * config.in: Regenerate. + * Makefile.in: Regenerate. + +2007-09-12 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Delete elf_backend_sprintf_vma + and elf_backend_fprintf_vma. + (_bfd_elf_sprintf_vma, _bfd_elf_fprintf_vma): Delete. + * elf.c (_bfd_elf_sprintf_vma, _bfd_elf_fprintf_vma): Delete. + * elfxx-target.h (elf_backend_sprintf_vma): Don't define. + (elf_backend_fprintf_vma): Likewise. + (elfNN_bed): Don't init removed fields. + * bfd.c (is32bit): New function. + (bfd_sprintf_vma, bfd_fprintf_vma): Use the above. + +2007-09-11 Nathan Sidwell + + * archures.c: Add bfd_mach_mcf_isa_c_nodiv, + bfd_mach_mcf_isa_c_nodiv_mac & bfd_mach_mcf_isa_c_nodiv_emac. + * ieee.c (ieee_write_processor): Update coldfire architecture + list. + * bfd-in2.h: Rebuilt. + * cpu-m68k.c (arch_info_struct): Add isa_c nodiv architectures. + (m68k_arch_features): Likewise. + * elf32-m68k.c (elf32_m68k_object_p): Add EF_M68K_CF_ISA_C_NODIV. + (elf32_m68k_print_private_bfd_data): Likewise. + +2007-09-11 Jan Beulich + + * elf64-i386.c (elf64_i386_tls_transition): Remove redundant 'const'. + * elf64-x86_64.c (elf64_x86_64_tls_transition): Likewise. + +2007-09-08 Alan Modra + + * elf64-ppc.c (func_desc_adjust): When resolving undefined + references to dot-symbols, transfer def_regular and + def_dynamic from the descriptor symbol. + +2007-09-08 Alan Modra + + * config.bfd: Set want64 for spu-*-elf. + +2007-09-08 Alan Modra + + PR ld/2864, ld/5006 + * elf.c (special_sections): Comment typo. + (elf_fake_sections): Force SHT_PROGBITS for sections that are + SHT_NOBITS if BFD section flags say they have contents. + +2007-09-04 Michael Snyder + + * elf32-bfin.c (howto_table): Cut and paste error? + Name field of reloc is wrong. + +2007-09-04 Alan Modra + + * elf32-spu.c (elf_howto_table): Formatting. + +2007-09-02 H.J. Lu + + PR ld/4986 + * dwarf2.c (new_line_sorts_after): Undo the last change. + (add_line_info): Only keep the last entry with the same address + and end sequence. + +2007-08-31 H.J. Lu + + PR ld/4986 + * dwarf2.c (new_line_sorts_after): Also compare line number. + +2007-08-31 Jesse Michael + + * mach-o.c (bfd_mach_o_make_bfd_section): Fix test for non + zerofill sections. + +2007-08-28 David Heine + + * elf32-xtensa.c (compute_ebb_actions): Update removed_bytes when + narrowing instructions. + +2007-08-28 Mark Shinwell + Joseph Myers + + * elf32-arm.c (elf32_arm_compare_mapping): Compare first on vma, + then on type. + +2007-08-28 Robert Sebastian Gerus + + * config.bfd: Add support for i[3-7]86-*-dragonfly*. + * configure.in: Likewise. + * configure: Regenerate. + +2007-08-25 Ulrich Weigand + Alan Modra + + * elf.c (elfcore_grok_spu_note): New function. + (elf_parse_notes): Call it. + +2007-08-24 H.J. Lu + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Adjust + indentation. + +2007-08-24 Pedro Alves + + * elf.c (elfcore_grok_win32pstatus): Remove HAVE_WIN32_PSTATUS_T + guard. Make it host independent. + (elfcore_grok_note): Remove HAVE_WIN32_PSTATUS_T guard around + NT_WIN32PSTATUS. + +2007-08-24 Jan Kratochvil + + * elf-bfd.h (struct elf_obj_tdata): New BUILD_ID_SIZE, BUILD_ID. + * elf.c (elfcore_read_notes): Split to ... + (elf_read_notes) ... here ... + (elf_parse_notes): ... and here. Check `bfd_get_format (abfd)' with + the former subfunctions called only for BFD_CORE. + Call ELFOBJ_GROK_GNU_NOTE for BFD_OBJECT files with the owner "GNU". + (_bfd_elf_make_section_from_shdr): Call ELF_PARSE_NOTES for SHT_NOTEs. + (bfd_section_from_phdr): Update the call for renamed ELFCORE_READ_NOTES. + (elfobj_grok_gnu_build_id, elfobj_grok_gnu_note): New functions. + Code advisory: Roland McGrath + +2007-08-24 Daniel Jacobowitz + + * elf64-mips.c (elf_backend_sign_extend_vma): Define. + +2007-08-24 Alan Modra + + * elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Warning fix. + +2007-08-23 H.J. Lu + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerated. + +2007-08-23 H.J. Lu + + * elf32-i386.c: Include "bfd_stdint.h". + (elf_i386_rtype_to_howto): New function. + (elf_i386_info_to_howto_rel): Use it. + (x86_64_opcode16): New union type. + (elf_i386_check_tls_transition): New function. + (elf_i386_tls_transition): Updated to check transition and + issue an error if a transition isn't supported. + (elf_i386_check_relocs): Return FALSE if + elf_i386_tls_transition returns FALSE. + (elf_i386_gc_sweep_hook): Likewise. + (elf_i386_relocate_section): Likewise. Remove BFD_ASSERT + on TLS transitions. + + * elf64-x86-64.c: Include "bfd_stdint.h". + (x86_64_opcode16): New union type. + (x86_64_opcode32): Likewise. + (elf64_x86_64_check_tls_transition): New function. + (elf64_x86_64_tls_transition): Updated to check transition and + issue an error if a transition isn't supported. + (elf64_x86_64_check_relocs): Return FALSE if + elf64_x86_64_tls_transition returns FALSE. + (elf64_x86_64_gc_sweep_hook): Likewise. + (elf64_x86_64_relocate_section): Likewise. Remove BFD_ASSERT + on TLS transitions. + +2007-08-22 H.J. Lu + + * elfxx-ia64.c: Convert to ISO C90 prototypes. + (elfNN_hpux_backend_section_from_bfd_section): Make it static. + +2007-08-22 H.J. Lu + + * elf64-x86-64.c: Remove trailing whitespace. + * elfxx-ia64.c: Likewise. + +2007-08-21 H.J. Lu + + * elf32-i386.c (elf_i386_tls_transition): Accept a pointer + to ELF hash entry instead of an integer for local test. + (elf_i386_check_relocs): Updated. + (elf_i386_gc_sweep_hook): Likewise. + (elf_i386_relocate_section): Likewise. + + * elf64-x86-64.c (elf64_x86_64_tls_transition): Accept a + pointer to ELF hash entry instead of an integer for local + test. + (elf64_x86_64_check_relocs): Updated. + (elf64_x86_64_gc_sweep_hook): Likewise. + (elf64_x86_64_relocate_section): Likewise. + +2007-08-20 H.J. Lu + + * elf32-i386.c (elf_i386_tls_transition): Break long line. + * elf64-x86-64.c (elf64_x86_64_tls_transition): Likewise. + +2007-08-20 Jan Kratochvil + + * elfxx-target.h [ELF_COMMONPAGESIZE && ELF_MAXPAGESIZE] + (ELF_MINPAGESIZE): Fixed its size guess. Sanity checked its size. + (ELF_COMMONPAGESIZE, ELF_MAXPAGESIZE): Sanity checked their size. + +2007-08-20 Nick Clifton + + * elflink.c (elf_fixup_link_order): Rewrite conversion of + s->alignment_power into an offset mask in order to avoid a gcc + error message. + +2007-08-17 Jakub Jelinek + + * config.bfd: Handle sparcv*-*-linux-* the same as sparc-*-linux-*. + Change sparc64-*-linux-* to sparc64*-*-linux-*. + +2007-08-17 Alan Modra + + * po/Make-in: Add --msgid-bugs-address to xgettext invocation. + +2007-08-16 H.J. Lu + + * elf.c: Revert last change. + +2007-08-16 H.J. Lu + + * elf.c (get_segment_type): Change PT_GNU_STACK to PT_GNU_ATTR. + (bfd_section_from_phdr): Likewise. + (get_program_header_size): Likewise. Add a PT_GNU_ATTR segment + if there is an attribute section. + (_bfd_elf_map_sections_to_segments): Likewise. + (IS_SECTION_IN_INPUT_SEGMENT): Likewise. + +2007-08-14 H.J. Lu + + PR ld/4918 + * elf32-i386.c (elf_i386_relocate_section): Allow R_386_PC32 + on ___tls_get_addr for GD->LE/LD->LE transitions when not + building shared library. + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Allow + R_X86_64_PC32 on __tls_get_addr for GD->LE/LD->LE transitions + when not building shared library. + +2007-08-14 Jan Kratochvil + + * elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): LOADBASE is now + initialized only on the first PT_LOAD. New variable LOADBASE_SET. + Removed PF_R checking for IA-64 vDSOs as redundant now. + Code advisory: Roland McGrath + +2007-08-13 Richard Sandiford + + * elfxx-mips.c (mips_elf_link_hash_table): Add computed_got_sizes. + (mips_elf_record_global_got_symbol): Increment local_gotno for + each forced-local symbol. + (_bfd_mips_elf_check_relocs): Pass forced-local call symbols to + mips_elf_record_global_got_symbol for VxWorks too. + (_bfd_mips_elf_always_size_sections): Set computed_got_sizes + to true after computing the GOT size. + (_bfd_mips_elf_hide_symbol): Increase local_gotno whenever + got.offset == 1. Only adjust global_gotno if computed_got_sizes. + For VxWorks, add a local entry when hiding a symbol that needs a + plt but has not been marked as needing a global got entry. + (_bfd_mips_elf_link_hash_table_create): Set computed_got_sizes to + false. + +2007-08-12 Daniel Jacobowitz + + * coffgen.c (coff_get_normalized_symtab): Correct cast. + +2007-08-13 Alan Modra + + * elf.c (elf_modify_segment_map): Add remove_empty_load param. + Don't remove empty PT_LOAD header if false. + (_bfd_elf_map_sections_to_segments): If user phdrs, pass false + to elf_modify_segment_map. + (assign_file_positions_for_load_sections): Pass false to + elf_modify_segment_map. + +2007-08-13 Alan Modra + + * elf64-ppc.c (ADDI_R12_R12, LD_R11_0R2, LD_R2_0R2): Define. + Update stub comments. + (build_plt_stub): Build two variants, one without "addis". + (ppc_build_one_stub): Build stubs without "addis" if possible. + (ppc_size_one_stub): Size new stubs. + +2007-08-11 Richard Sandiford + + * config.bfd (sh-*-vxworks): Define targ_underscore to "yes". + +2007-08-09 Michael Snyder + + * aoutx.h (aout_get_external_symbols): Return if count is zero. + +2007-08-09 H.J. Lu + + PR ld/4909 + * elf.c (print_segment_map): New function. + (assign_file_positions_for_load_sections): Call print_segment_map + when a section can't be allocated in segment. + +2007-08-09 Jan Kratochvil + + * opncls.c (bfd_openr_iovec): Fix the OPEN parameter macro expansion. + +2007-08-07 Nick Clifton + + * po/bfd.pot: Updated template. + * po/BLD-POTFILES.in: Regenerate. + +2007-08-07 Alan Modra + + * elf.c: (_bfd_elf_make_section_from_phdr): Properly handle + bss segments. + +2007-08-06 Daniel Jacobowitz + + * Makefile.am (BUILD_HFILES): Clean bfd_stdint.h. + * Makefile.in: Regenerated. + +2007-08-06 Daniel Jacobowitz + + * configure.in: Update version to 2.18.50. + * configure: Regenerated. + +2007-08-06 Paul Brook + + * elf32-arm.c (elf32_arm_link_hash_entry): Add + plt_maybe_thumb_refcount. + (elf32_arm_link_hash_newfunc): Set plt_maybe_thumb_refcount. + (elf32_arm_copy_indirect_symbol): Ditto. + (elf32_arm_adjust_dynamic_symbol): Ditto. + (bfd_elf32_arm_process_before_allocation): Handle R_ARM_THM_JUMP24. + (arm_add_to_rel): Ditto. + (elf32_arm_final_link_relocate): Merge R_ARM_THM_JUMP24 with + R_ARM_THM_CALL. Handle R_ARM_THM_JUMP19 against a PLT stub. + (elf32_arm_gc_sweep_hook): Call check_use_blx. Update plt counts + for R_ARM_THM_JUMP24 and R_ARM_THM_JUMP19. + (elf32_arm_check_relocs): Update plt counts for R_ARM_THM_JUMP24 + and R_ARM_THM_JUMP19. + (allocate_dynrelocs): Use plt_maybe_thumb_refcount. + (elf32_arm_finish_dynamic_symbol): Ditto. + (elf32_arm_output_plt_map): Ditto. + +2007-08-06 Daniel Jacobowitz + + * elf.c (rewrite_elf_program_header): Handle sections not sorted + by address. + (copy_elf_program_header): Likewise. + +2007-08-04 H.J. Lu + + * elf-bfd.h (xvec_get_elf_backend_data): Add const. + + * elfcode.h (elf_object_p): Use xvec_get_elf_backend_data. + * elfcore.h (elf_core_file_p): Likewise. + +2007-08-02 H.J. Lu + + * coffcode.h (ALIGN_SET): Removed. + (ELIFALIGN_SET): Likewise. + (coff_set_alignment_hook): Handle IMAGE_SCN_ALIGN_128BYTES, + IMAGE_SCN_ALIGN_256BYTES, IMAGE_SCN_ALIGN_512BYTES, + IMAGE_SCN_ALIGN_1024BYTES, IMAGE_SCN_ALIGN_2048BYTES, + IMAGE_SCN_ALIGN_4096BYTES and IMAGE_SCN_ALIGN_8192BYTES. + +2007-08-01 Michael Snyder + + * vms-tir.c (new_section): Fix cut and paste error. + + * aoutx.h (aout_link_add_symbols): Return if count is zero. + + * elf.c (bfd_elf_print_symbol): Macro dereferences pointer, so + pointer must be non-null. + +2007-08-01 Tristan Gingold + + * coffcode.h (coff_sort_func_alent): New function. + (coff_slurp_line_table): Sort line table if not already sorted. + +2007-08-01 Jakub Jelinek + + * elf.c (_bfd_elf_map_sections_to_segments): Work around buggy + GCC 3.4.x warning. + +2007-08-01 Alan Modra + + * aoutx.h (swap_ext_reloc_in): Set howto to NULL for unknown + r_type. + (swap_std_reloc_in): Likewise. + (aout_link_input_section_std): Likewise. Return with an error + on unexpected relocation type. + (aout_link_input_section_ext): Likewise. + +2007-08-01 Alan Modra + + PR4694 + * aoutx.h (final_link): Write a zero in first word of + stringtab if no symbols rather than corrupting last byte + of text/data. + +2007-07-31 Jakub Jelinek + + * elf.c (get_program_header_size): Adjacent loadable .note* + sections need just one PT_NOTE segment. + (_bfd_elf_map_sections_to_segments): Likewise. + +2007-07-30 Michael Snyder + + * coffgen.c (_bfd_coff_read_internal_relocs): Revert change of + 2007-07-26. Buffer still in use, can't be freed. + +2007-07-27 Michael Snyder + + * cofflink.c (coff_link_add_symbols): Return if count is zero. + + * coff-i386.c (coff_i386_rtype_to_howto): Off by one error. + + * aoutx.h (slurp_symbol_table): Return if count == 0. + + * coffgen.c (_bfd_coff_read_internal_relocs): Return if count is zero. + + * elf32-i386.c (elf_i386_check_relocs): Check for null pointer. + +2007-07-27 H.J. Lu + + * config.bfd (x86_64-*-mingw*): Don't include x86_64coff_vec. + +2007-07-26 Michael Snyder + + * coff-i386.c (coff_i386_rtype_to_howto): Guard against null. + + * linker.c (bfd_section_already_linked_table_insert): Change + return type from void to boolean. Return FALSE on failure. + (_bfd_generic_section_already_linked): Test return value of + bfd_section_already_linked_table_insert, call fatal on error. + + * elflink.c (_bfd_elf_section_already_linked): Test return value + of bfd_section_already_linked_table_insert, call fatal on error. + + * libbfd-in.h (bfd_section_already_linked_table_insert): Update + return type to bfd_boolean. + + * libbfd.h: Regenerate. + +2007-07-26 Adam Nemet + + * archive.c (do_slurp_bsd_armap, do_slurp_coff_armap, + bfd_slurp_armap): Improve function comment. + +2007-07-26 Michael Snyder + + * linker.c (already_linked_newfunc): Check for NULL return from + bfd_hash_allocate. + + * coffgen.c (fixup_symbol_value): Guard against null; + bfd_is_com_section will dereference the section pointer. + + * syms.c (bfd_decode_symclass): Guard against NULL, since + bfd_is_com_section dereferences the pointer. + + * srec.c (srec_scan): Check for EOF (critical because return value + will be used as array index). + + * coffgen.c (_bfd_coff_read_internal_relocs): If internal_relocs + are not to be cached, free the temporary buffer. + + * aoutx.h (slurp_reloc_table): Return TRUE if reloc_size == zero + or count == zero. + + * tekhex.c (first_phase): Check return value for null. + + * elf.c (_bfd_elf_get_synthetic_symtab): Remove meaningless + pointer increment. + +2007-07-26 Alan Modra + + * elflink.c (_bfd_elf_fix_symbol_flags): Remove unnecessary + check on dynobj. Remove bed shadow. + + * srec.c (srec_get_section_contents): Return immediately on + count zero. Check that offset and count are within section. + * libbfd.c (_bfd_generic_get_section_contents): Check that + offset + count does not overflow. + + * srec.c (srec_canonicalize_symtab): Don't alloc when symcount + is zero. Correct return value on error. + * mmo.c (mmo_canonicalize_symtab): Likewise. + * binary.c (binary_canonicalize_symtab) Correct return on error. + +2007-07-26 Thiemo Seufer + + * bfd.c (_bfd_set_gp_value): Use abort instead of BFD_FAIL. + +2007-07-26 Alan Modra + + * reloc.c (bfd_generic_get_relocated_section_contents): Avoid + bfd_canonicalize_reloc call when bfd_get_reloc_upper_bound + says there are no relocs. + +2007-07-26 Doug Kwan + + Speed up bfd_dwarf2_find_line. + * dwarf2.c (struct dwarf2_debug): Add new fields to support function + and variable info hash tables. Add last_comp_unit, info_hash_count, + funcinfo_hash_table, varinfo_hash_table, hash_units_head. + (struct comp_unit): Add prev_unit, cached. + (struct info_list_node, struct info_hash_entry, + struct info_hash_table): New. + (info_hash_table_newfunc, create_info_hash_table, + insert_info_hash_table, lookup_info_hash_table): New functions + implementing function and variable info hash tables. + (scan_unit_for_symbols): Add checks to make sure hash tables are + consistent with compilation units. + (comp_unit_maybe_decode_line_info): New function. + (comp_unit_find_line): Use comp_unit_maybe_decode_line_info. + (reverse_funcinfo_list, reverse_varinfo_list, comp_unit_hash_info, + info_hash_lookup_funcinfo, info_hash_lookup_varinfo, + stash_maybe_update_info_hash_table, stash_verify_info_hash_table, + stash_maybe_enable_info_hash_tables, stash_find_line_fast): New + functions. Make use of info hash tables to speed up + bfd_dwarf2_find_line. + (find_line): Use hash table for faster lookup if it is turned on. + Also add code to maintain bi-directional link in comp units. + +2007-07-25 Michael Snyder + + * coffgen.c (_bfd_coff_get_external_symbols): Nothing to be done + if size == 0; return and avoid possible null pointer issues. + +2007-07-25 Alan Modra + + * linker.c (generic_link_add_symbol_list): Warning fix. + +2007-07-24 Michael Snyder + + * opncls.c (bfd_make_writable): Check return from bfd_malloc. + + * elflink.c (bfd_elf_final_link): Avoid redundant frees -- return + on bfd_malloc error rather than goto error_return. + +2007-07-24 Alan Modra + + * elflink.c (_bfd_elf_link_just_syms, merge_sections_remove_hook, + _bfd_elf_merge_sections, _bfd_elf_link_hash_newfunc, + _bfd_elf_link_hash_copy_indirect, _bfd_elf_link_hash_hide_symbol, + _bfd_elf_link_hash_table_init, _bfd_elf_link_hash_table_create, + bfd_elf_set_dt_needed_name, bfd_elf_get_dyn_lib_class, + bfd_elf_set_dyn_lib_class, bfd_elf_get_needed_list, + bfd_elf_get_runpath_list, bfd_elf_get_dt_soname, + bfd_elf_get_bfd_needed_list, struct elf_symbuf_symbol, + struct elf_symbuf_head, struct elf_symbol, elf_sort_elf_symbol, + elf_sym_name_compare, elf_create_symbuf, + bfd_elf_match_symbols_in_sections, + _bfd_elf_match_sections_by_type): Move to here.. + * elf.c: ..from here. + +2007-07-23 Richard Sandiford + + * elflink.c (_bfd_elf_fix_symbol_flags): Only assert the type + of weakdef->root.type if weakdef has no regular definition. + +2007-07-22 Adam Nemet + + * elfxx-mips.c (struct mips_elf_link_hash_table): Add new field + small_data_overflow_reported. + (_bfd_mips_elf_link_hash_table_create): Initialize it. + (_bfd_mips_elf_relocate_section) : Report + small-data section overflow. + +2007-07-19 Doug Kwan + + PR binutils/4797 + * dwarf2.c: (find_line) Do not dereference functionname_ptr if + do_line is true. + +2007-07-18 Bob Wilson + + * elf32-xtensa.c (xtensa_callback_required_dependence): Ignore + non-ELF sections. + +2007-07-18 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Get section + vma and size for dynamic tags from the output sections. + +2007-07-18 Alan Modra + + * elf-bfd.h (struct sym_sec_cache): Delete "sec". Add "shndx". + * elf.c (bfd_section_from_r_symndx): Don't cache bfd section of + symbol. Instead cache ELF section index. Remove redundant + checks of st_shndx. + +2007-07-15 Mike Frysinger + + * trad-core.c (NBPG): If not defined, set to getpagesize(). + +2007-07-13 Roland McGrath + + * elf-bfd.h (struct elf_obj_tdata): Revert last change. + Add after_write_object_contents, after_write_object_contents_info. + * elf.c (_bfd_elf_write_object_contents): Revert last change. + Instead, call after_write_object_contents if set. + +2007-07-12 Kai Tietz + + * bfd-in.h: (BFD_HOST_64BIT_LONG_LONG): New. + (BFD_HOSTPTR_T): Host pointer type for casting a + pointer to an integer type. + (bfd_hostptr_t): The typedef of BFD_HOSTPTR_T. + (sprintf_vma, fprintf_vma): Add support for long long prints. + * bfd-in2.h: Regenerate. + * configure.in: (BFD_HOST_64BIT_LONG_LONG): New. + (BFD_HOSTPTR_T): Host pointer type for casting a + pointer to an integer type. Default is "unsigned long". + (AC_CHECK_SIZEOF(void *)): New. + (host64): Set it if the pointer size is 8. + * configure: Regenerate. + * config.in: Add macro SIZEOF_VOID_P. + * coffcode.h: Replace host ptr type assuming "long" with + bfd_hostptr_t type. + * coffgen.c: Likewise. + * elf-eh-frame.c: Likewise. + * peicode.h: Likewise. + +2007-07-10 H.J. Lu + + * Makefile.in: Regenerated. + +2007-07-10 H.J. Lu + + PR binutils/4756 + * simple.c (bfd_simple_get_relocated_section_content): Don't + apply relocation on executable and shared library. + +2007-07-10 Nathan Sidwell + + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't eliminate + copy relocs on vxworks. + +2007-07-10 Alan Modra + + * elf32-arm.c (elf32_arm_size_info): Init checksum_contents field. + * elf64-alpha.c (alpha_elf_size_info): Likewise. + * elf64-hppa.c (hppa64_elf_size_info): Likewise. + * elf64-mips.c (mips_elf64_size_info): Likewise. + * elf64-s390.c (s390_elf64_size_info): Likewise. + * elf64-sparc.c (elf64_sparc_size_info): Likewise. + +2007-07-09 H.J. Lu + + * elflink.c (bfd_elf_record_link_assignment): Handle indirect + symbol. + (_bfd_elf_merge_symbol): Properly update normal symbol when + overriding the versioned symbol from a dynamic library. + +2007-07-09 Roland McGrath + + * elf-bfd.h (struct elf_obj_tdata): Add members + emit_note_gnu_build_id and note_gnu_build_id_sec. + * elf.c (_bfd_id_note_section_size): New global function. + (read_hex, _bfd_elf_write_build_id_section): New static functions. + (_bfd_elf_write_object_contents): Call _bfd_elf_write_build_id_section + if emit_note_gnu_build_id is set. + * Makefile.am (elf.lo): Update dependencies. + + * elf-bfd.h (struct elf_size_info): Add checksum_contents hook. + (bfd_elf32_checksum_contents, bfd_elf64_checksum_contents): Declare. + * elfcode.h (elf_checksum_contents): New macro and function. + (NAME(_bfd_elf,size_info)): Initialize checksum_contents hook. + +2007-07-06 Michael Snyder + + * elflink.c (elf_link_add_object_symbols): Return via + error_free_vers on "notice" failure. + +2007-07-04 H.J. Lu + + * peicode.h (pe_bfd_object_p): Don't check PE vs. EFI target + if arch is unknown. + +2007-07-04 Nick Clifton + + Import this patch from an internal tree: + + 2001-07-17 Richard Henderson + + * elf32-mep.c (mep_final_link_relocate) [R_MEP_HI16S]: Correctly + compensate for high bit set in R_MEP_LOW16. + +2007-07-03 Joseph Myers + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Copy type from + input attributes if value has been copied. + +2007-07-03 Nick Clifton + + * COPYING: Replace with GPLv3 text. + * aix386-core.c: Update copyright notice to refer to GPLv3. + * aix5ppc-core.c, aout0.c, aout32.c, aout64.c, aout-adobe.c, + aout-arm.c, aout-cris.c, aoutf1.h, aout-ns32k.c, aout-sparcle.c, + aout-target.h, aout-tic30.c, aoutx.h, archive64.c, archive.c, + archures.c, armnetbsd.c, bfd.c, bfd-in.h, bfdio.c, bfdwin.c, + binary.c, bout.c, cache.c, cf-i386lynx.c, cf-sparclynx.c, + cisco-core.c, coff64-rs6000.c, coff-alpha.c, coff-apollo.c, + coff-arm.c, coff-aux.c, coffcode.h, coffgen.c, coff-go32.c, + coff-h8300.c, coff-h8500.c, coff-i386.c, coff-i860.c, coff-i960.c, + coff-ia64.c, cofflink.c, coff-m68k.c, coff-m88k.c, coff-maxq.c, + coff-mcore.c, coff-mips.c, coff-or32.c, coff-pmac.c, coff-ppc.c, + coff-rs6000.c, coff-sh.c, coff-sparc.c, coff-stgo32.c, + coff-svm68k.c, coffswap.h, coff-tic30.c, coff-tic4x.c, + coff-tic54x.c, coff-tic80.c, coff-u68k.c, coff-w65.c, + coff-we32k.c, coff-x86_64.c, coff-z80.c, coff-z8k.c, corefile.c, + cpu-alpha.c, cpu-arc.c, cpu-arm.c, cpu-avr.c, cpu-bfin.c, + cpu-cr16.c, cpu-cr16c.c, cpu-cris.c, cpu-crx.c, cpu-d10v.c, + cpu-d30v.c, cpu-dlx.c, cpu-fr30.c, cpu-frv.c, cpu-h8300.c, + cpu-h8500.c, cpu-hppa.c, cpu-i370.c, cpu-i386.c, cpu-i860.c, + cpu-i960.c, cpu-ia64.c, cpu-ia64-opc.c, cpu-ip2k.c, cpu-iq2000.c, + cpu-m10200.c, cpu-m10300.c, cpu-m32c.c, cpu-m32r.c, cpu-m68hc11.c, + cpu-m68hc12.c, cpu-m68k.c, cpu-m88k.c, cpu-maxq.c, cpu-mcore.c, + cpu-mep.c, cpu-mips.c, cpu-mmix.c, cpu-msp430.c, cpu-mt.c, + cpu-ns32k.c, cpu-openrisc.c, cpu-or32.c, cpu-pdp11.c, cpu-pj.c, + cpu-powerpc.c, cpu-rs6000.c, cpu-s390.c, cpu-score.c, cpu-sh.c, + cpu-sparc.c, cpu-spu.c, cpu-tic30.c, cpu-tic4x.c, cpu-tic54x.c, + cpu-tic80.c, cpu-v850.c, cpu-vax.c, cpu-w65.c, cpu-we32k.c, + cpu-xc16x.c, cpu-xstormy16.c, cpu-xtensa.c, cpu-z80.c, cpu-z8k.c, + demo64.c, doc/chew.c, dwarf1.c, dwarf2.c, ecoff.c, ecofflink.c, + ecoffswap.h, efi-app-ia32.c, efi-app-ia64.c, efi-app-x86_64.c, + elf32-am33lin.c, elf32-arc.c, elf32-arm.c, elf32-avr.c, + elf32-avr.h, elf32-bfin.c, elf32.c, elf32-cr16.c, elf32-cr16c.c, + elf32-cris.c, elf32-crx.c, elf32-d10v.c, elf32-d30v.c, + elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-gen.c, + elf32-h8300.c, elf32-hppa.c, elf32-hppa.h, elf32-i370.c, + elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c, + elf32-iq2000.c, elf32-m32c.c, elf32-m32r.c, elf32-m68hc11.c, + elf32-m68hc12.c, elf32-m68hc1x.c, elf32-m68hc1x.h, elf32-m68k.c, + elf32-m88k.c, elf32-mcore.c, elf32-mep.c, elf32-mips.c, + elf32-msp430.c, elf32-mt.c, elf32-openrisc.c, elf32-or32.c, + elf32-pj.c, elf32-ppc.c, elf32-ppc.h, elf32-s390.c, elf32-score.c, + elf32-sh64.c, elf32-sh64-com.c, elf32-sh64.h, elf32-sh.c, + elf32-sh-symbian.c, elf32-sparc.c, elf32-spu.c, elf32-spu.h, + elf32-v850.c, elf32-vax.c, elf32-xc16x.c, elf32-xstormy16.c, + elf32-xtensa.c, elf64-alpha.c, elf64.c, elf64-gen.c, elf64-hppa.c, + elf64-hppa.h, elf64-mips.c, elf64-mmix.c, elf64-ppc.c, + elf64-ppc.h, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, + elf64-x86-64.c, elf-attrs.c, elf-bfd.h, elf.c, elfcode.h, + elfcore.h, elf-eh-frame.c, elf-hppa.h, elflink.c, elf-m10200.c, + elf-m10300.c, elfn32-mips.c, elf-strtab.c, elf-vxworks.c, + elf-vxworks.h, elfxx-ia64.c, elfxx-mips.c, elfxx-mips.h, + elfxx-sparc.c, elfxx-sparc.h, elfxx-target.h, epoc-pe-arm.c, + epoc-pei-arm.c, format.c, freebsd.h, gen-aout.c, genlink.h, + hash.c, host-aout.c, hosts/alphavms.h, hp300bsd.c, hp300hpux.c, + hppabsd-core.c, hpux-core.c, i386aout.c, i386bsd.c, i386dynix.c, + i386freebsd.c, i386linux.c, i386lynx.c, i386mach3.c, i386msdos.c, + i386netbsd.c, i386os9k.c, ieee.c, ihex.c, init.c, irix-core.c, + libaout.h, libbfd.c, libbfd-in.h, libcoff-in.h, libecoff.h, + libhppa.h, libieee.h, libnlm.h, liboasys.h, libpei.h, libxcoff.h, + linker.c, lynx-core.c, m68k4knetbsd.c, m68klinux.c, m68knetbsd.c, + m88kmach3.c, m88kopenbsd.c, mach-o.c, mach-o.h, mach-o-target.c, + mep-relocs.pl, merge.c, mipsbsd.c, mmo.c, netbsd-core.c, netbsd.h, + newsos3.c, nlm32-alpha.c, nlm32.c, nlm32-i386.c, nlm32-ppc.c, + nlm32-sparc.c, nlm64.c, nlm.c, nlmcode.h, nlmswap.h, nlm-target.h, + ns32k.h, ns32knetbsd.c, oasys.c, opncls.c, osf-core.c, + pc532-mach.c, pdp11.c, pe-arm.c, pe-arm-wince.c, pef.c, pef.h, + pef-traceback.h, pe-i386.c, pei-arm.c, pei-arm-wince.c, peicode.h, + pei-i386.c, pei-mcore.c, pei-mips.c, pei-ppc.c, pei-sh.c, + pei-x86_64.c, pe-mcore.c, pe-mips.c, pe-ppc.c, pe-sh.c, + pe-x86_64.c, peXXigen.c, ppcboot.c, ptrace-core.c, reloc16.c, + reloc.c, riscix.c, rs6000-core.c, sco5-core.c, section.c, + simple.c, som.c, som.h, sparclinux.c, sparclynx.c, sparcnetbsd.c, + srec.c, stabs.c, stab-syms.c, stamp-h.in, sunos.c, syms.c, + sysdep.h, targets.c, targmatch.sed, tekhex.c, ticoff.h, + trad-core.c, vax1knetbsd.c, vaxbsd.c, vaxnetbsd.c, versados.c, + vms.c, vms-gsd.c, vms.h, vms-hdr.c, vms-misc.c, vms-tir.c, + xcofflink.c, xcoff-target.h, xsym.c, xsym.h, xtensa-isa.c, + xtensa-modules.c: Likewise. + * elf32-sh-relocs.h: Add copyright notice. + * hosts/alphalinux.h, hosts/decstation.h, hosts/delta68.h, + hosts/dpx2.h, hosts/hp300bsd.h, hosts/i386bsd.h, + hosts/i386linux.h, hosts/i386mach3.h, hosts/i386sco.h, + hosts/i860mach3.h, hosts/m68kaux.h, hosts/m68klinux.h, + hosts/m88kmach3.h, hosts/mipsbsd.h, hosts/mipsmach3.h, + hosts/news.h, hosts/news-mips.h, hosts/pc532mach.h, + hosts/riscos.h, hosts/symmetry.h, hosts/tahoe.h, hosts/vaxbsd.h, + hosts/vaxlinux.h, hosts/vaxult2.h, hosts/vaxult.h: Likewise. + * bfd-in2.h, libbfd.h, libcoff.h: Regenerate. + +2007-07-02 Joseph Myers + + * elfxx-mips.c (mips_elf_calculate_relocation): Handle + R_MIPS_TLS_DTPREL32 and R_MIPS_TLS_DTPREL64. + * elf64-mips.c (mips_elf64_howto_table_rela): Support + R_MIPS_TLS_DTPREL64. + +2007-07-02 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. + +2007-07-02 Alan Modra + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Tidy + symsec != NULL tests. + +2007-07-02 Alan Modra + + PR 4712 + * elf.c (assign_file_positions_for_load_sections): Adjust lma + by p_vaddr_offset. + +2007-06-30 H.J. Lu + + * aclocal.m4: Regenerated. + * Makefile.in: Likewise. + +2007-06-29 Joseph Myers + + * elf32-ppc.c (ppc_elf_merge_obj_attributes): New. + (ppc_elf_merge_private_bfd_data): Call it. + +2007-06-29 Joseph Myers + + * elfxx-mips.c (mips_elf_merge_obj_attributes): New. + (_bfd_mips_elf_merge_private_bfd_data): Call it. + +2007-06-29 Joseph Myers + + * elf-attrs.c: New. + * Makefile.am (BFD32_BACKENDS): Add elf-attrs.lo. + (BFD32_BACKENDS_CFILES): Add elf-attrs.c. + (elf-attrs.lo): Generate dependencies. + * Makefile.in: Regenerate. + * configure.in (elf): Add elf-attrs.lo. + * configure: Regenerate. + * elf-bfd.h (struct elf_backend_data): Add entries for object + attributes. + (NUM_KNOWN_OBJ_ATTRIBUTES, obj_attribute, obj_attribute_list, + OBJ_ATTR_PROC, OBJ_ATTR_GNU, OBJ_ATTR_FIRST, OBJ_ATTR_LAST, + Tag_NULL, Tag_File, Tag_Section, Tag_Symbol, Tag_compatibility): + New. + (struct elf_obj_tdata): Add entries for object attributes. + (elf_known_obj_attributes, elf_other_obj_attributes, + elf_known_obj_attributes_proc, elf_other_obj_attributes_proc): + New. + (bfd_elf_obj_attr_size, bfd_elf_set_obj_attr_contents, + bfd_elf_get_obj_attr_int, bfd_elf_add_obj_attr_int, + bfd_elf_add_proc_attr_int, bfd_elf_add_obj_attr_string, + bfd_elf_add_proc_attr_string, bfd_elf_add_obj_attr_compat, + bfd_elf_add_proc_attr_compat, _bfd_elf_attr_strdup, + _bfd_elf_copy_obj_attributes, _bfd_elf_obj_attrs_arg_type, + _bfd_elf_parse_attributes, _bfd_elf_merge_object_attributes): New. + * elf.c (_bfd_elf_copy_private_bfd_data): Copy object attributes. + (bfd_section_from_shdr): Handle attributes sections. + * elflink.c (bfd_elf_final_link): Handle attributes sections. + * elfxx-target.h (elf_backend_obj_attrs_vendor, + elf_backend_obj_attrs_section, elf_backend_obj_attrs_arg_type, + elf_backend_obj_attrs_section_type): New. + (elfNN_bed): Update. + * elf32-arm.c (NUM_KNOWN_ATTRIBUTES, aeabi_attribute, + aeabi_attribute_list): Remove. + (struct elf32_arm_obj_tdata): Remove object attributes fields. + (check_use_blx, bfd_elf32_arm_set_vfp11_fix, using_thumb2, + elf32_arm_copy_private_bfd_data, elf32_arm_merge_eabi_attributes): + Update for new object attributes interfaces. + (uleb128_size, is_default_attr, eabi_attr_size, + elf32_arm_eabi_attr_size, write_uleb128, write_eabi_attribute, + elf32_arm_set_eabi_attr_contents, elf32_arm_bfd_final_link, + elf32_arm_new_eabi_attr, elf32_arm_get_eabi_attr_int, + elf32_arm_add_eabi_attr_int, attr_strdup, + elf32_arm_add_eabi_attr_string, elf32_arm_add_eabi_attr_compat, + copy_eabi_attributes, elf32_arm_parse_attributes): Remove. Moved + to generic code in elf-attrs.c. + (elf32_arm_obj_attrs_arg_type): New. + (elf32_arm_fake_sections): Do not handle .ARM.attributes. + (elf32_arm_section_from_shdr): Do not handle SHT_ARM_ATTRIBUTES. + (bfd_elf32_bfd_final_link): Remove. + (elf_backend_obj_attrs_vendor, elf_backend_obj_attrs_section, + elf_backend_obj_attrs_arg_type, + elf_backend_obj_attrs_section_type): New. + * elf32-bfin.c (bfin_elf_copy_private_bfd_data): Copy object + attributes. + * elf32-frv.c (frv_elf_copy_private_bfd_data): Likewise. + * elf32-iq2000.c (iq2000_elf_copy_private_bfd_data): Likewise. + * elf32-mep.c (mep_elf_copy_private_bfd_data): Likewise. + * elf32-mt.c (mt_elf_copy_private_bfd_data): Likewise. + * elf32-sh.c (sh_elf_copy_private_data): Likewise. + * elf64-sh64.c (sh_elf64_copy_private_data_internal): Likewise. + +2007-06-29 Paul Brook + + * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Suppress + call veneers for call relocations against undefined symbols. + (elf32_arm_final_link_relocate): Turn call to undefined symbol + into a jump to the next instruction. + +2007-06-29 Michael Snyder + + * bfd.c (bfd_demangle): Plug memory leak (Coverity). + +2007-06-29 M R Swami Reddy + + * Makefile.am: Add cr16 related entry + * Makefile.in: Regenerate + * archures.c: Add bfd_cr16_arch + * bfd-in2.h: Regenerate + * config.bfd: Add cr16-elf + * configure.in: Add bfd_elf32_cr16_vec + * configure: Regenerate. + * targets.c: Added cr16 related information + * cpu-cr16.c: New file. + * elf32-cr16.c: New file. + * reloc.c: Added cr16 relocs. + +2007-06-29 Alan Modra + + * elflink.c (_bfd_elf_link_assign_sym_version): Improve error + message for undefined version nodes. + (elf_gc_sweep): Don't warn when zero size sections are + removed. + +2007-06-29 Nathan Froyd + + * elf32-ppc.c (ppc_elf_info_to_howto): Check for invalid relocation + types. + +2007-06-29 Alan Modra + + * elf32-spu.c (spu_elf_fake_sections): New function. + (elf_backend_fake_sections): Define. + +2007-06-29 Alan Modra + + * elf.c (assign_file_positions_for_load_sections): Use elf + section header sh_size rather than bfd section size, simplifying + .tbss handling. + +2007-06-29 Alan Modra + + PR ld/4701 + * elf.c (assign_file_positions_for_load_sections): Ensure bss + segments meet gABI alignment requirements. Don't allocate + file space for bss sections in a segment also containing file + or program headers. + +2007-06-27 Alan Modra + + * bfd.c (struct bfd): Rename "next" to "archive_next". + * archive.c: Rename uses throughout file. + * archive64.c: Likewise. + * coff-rs6000.c: Likewise. + * ecoff.c: Likewise. + * som.c: Likewise. + * bfd-in2.h: Regenerate. + + * elf32-ppc.c (ppc_elf_select_plt_layout): Properly iterate over + input bfds. + * elf32-spu.c (spu_elf_create_sections): Likewise. + +2007-06-26 H.J. Lu + + * dwarf2.c (find_line): New. Contains the duplicated code from: + (_bfd_dwarf2_find_nearest_line): Use it. + (_bfd_dwarf2_find_line): Use it. + +2007-06-26 Joseph Myers + + * elf32-arm.c (copy_eabi_attributes): Copy type of attributes. + +2007-06-25 Richard Sandiford + + * elfxx-mips.c (mips_elf_calculate_relocation): Allow local stubs + to be used for calls from MIPS16 code. + +2007-06-23 Andreas Schwab + + * configure.in (--with-separate-debug-dir): New option. + * configure: Regenerate. + * Makefile.am (dwarf2.lo): Add rule to pass DEBUGDIR. + * Makefile.in: Regenerate. + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Pass DEBUGDIR to + bfd_follow_gnu_debuglink. + (_bfd_dwarf2_find_line): Likewise. + +2007-06-22 Nick Clifton + + * dwarf2.c: Add support for reading in debug information via a + .gnu_debuglink section: + (struct dwarf2_debug): Add bfd field to record the bfd containing + the debug info. + (parse_comp_unit): Remove ABFD parameter. Instead use the bfd + field in the dwarf2_debug structure. + (_bfd_dwarf2_find_nearest_line): If a debug info section could not + be found in the current bfd call bfd_follow_gnu_debuglink to see + if another file contains the debug information. If it does, open + it and continue. + (_bfd_dwarf2_find_line): Likewise. + +2007-06-19 H.J. Lu + + PR ld/4590 + * elfxx-ia64.c (sort_dyn_sym_info): Keep the valid got_offset + when removing duplicated entries. + (get_dyn_sym_info): Initialize the got_offset field to -1. + Update call to sort_dyn_sym_info. + (elfNN_ia64_relocate_section): Call sort_dyn_sym_info to sort + array of addend and remove duplicates. + +2007-06-18 H.J. Lu + + * libpei.h (_bfd_XXi_final_link_postscript): Remove + duplication. + (bfd_target_pei_p): New. + (bfd_target_pei_arch): New + (bfd_target_efi_p): Likewise. + (bfd_target_efi_arch): New + (bfd_pe_executable_p): Use bfd_target_pei_p and + bfd_target_efi_p. + + * peicode.h (arch_type): New enum. + (pe_arch): New function. + (pe_bfd_object_p): Don't match PE/EFI target with EFI/PE file + if there is an EFI/PE target. + +2007-06-14 H.J. Lu + + * Makefile.am (ACLOCAL_AMFLAGS): Add -I . -I ../config. + + * acinclude.m4: Don't include m4 files. Remove libtool + kludge. + + * Makefile.in: Regenerated. + * aclocal.m4: Likewise. + * configure: Likewise. + +2007-06-11 Sterling Augustine + Bob Wilson + + * elf32-xtensa.c (extend_ebb_bounds_forward): Use renamed + XTENSA_PROP_NO_TRANSFORM flag instead of XTENSA_PROP_INSN_NO_TRANSFORM. + (extend_ebb_bounds_backward, compute_text_actions): Likewise. + (compute_ebb_proposed_actions, coalesce_shared_literal): Likewise. + (xtensa_get_property_predef_flags): Likewise. + (compute_removed_literals): Pass new arguments to is_removable_literal. + (is_removable_literal): Add sec, prop_table and ptblsize arguments. + Do not remove literal if the NO_TRANSFORM property flag is set. + +2007-05-31 Richard Sandiford + + * elfxx-mips.c (mips_elf_initialize_tls_index): When processing a + type (3) single-GOT entry, read tls_type from the hash table entry + rather than the GOT entry. + +2007-06-01 Alan Modra + + * simple.c (bfd_simple_get_relocated_section_contents): Init + input_bfds_tail. + +2007-05-30 Alan Modra + + * elf.c (elf_fake_sections): Adjust test for SHT_NOBITS sections + created by objcopy --only-keep-debug. + (_bfd_elf_init_private_section_data): Only change elf_section_type + if it is SHT_NULL. + + * elf.c (assign_file_positions_for_load_sections): Correct sh_type + to SHT_NOBITS earlier. Base actions in rest of function on sh_type + and sh_flags instead of bfd section flags. Delete voff and code + keeping nobits segments aligned. + +2007-05-25 Eric Christopher + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): + Check that sym_sec isn't NULL before accessing. + +2007-05-24 Steve Ellcey + + * Makefile.in: Regnerate. + * configure: Regenerate. + * aclocal.m4: Regenerate. + * doc/Makefile.in: Regenerate. + +2007-05-22 Paul Brook + + * elf32-arm.c (output_arch_syminfo): Replace plt_shndx and plt_offset + with sec and sec_shndx. + (elf32_arm_ouput_plt_map_sym): Use them. + (elf32_arm_output_arch_local_syms): Output mapping symbols for + interworking glue. + +2007-05-18 Paul Brook + + * elf32-arm.c (ARM2THUMB_V5_STATIC_GLUE_SIZE): Define. + (a2t1v5_ldr_insn, a2t1v5_ldr_insn): New. + (record_arm_to_thumb_glue): Add v5t non-pic glue. + (elf32_arm_create_thumb_stub): Ditto. + +2007-05-16 H.J. Lu + Alan Modra + + * elflink.c (_bfd_elf_adjust_dynamic_copy): Align dynamic bss + section to the minimum alignment. + +2007-05-15 H.J. Lu + Alan Modra + + PR ld/4504 + * elf-bfd.h (_bfd_elf_adjust_dynamic_copy): New. + * elflink.c (_bfd_elf_adjust_dynamic_copy): New. + + * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Call + _bfd_elf_adjust_dynamic_copy to adjust for the copy in dynamic + bss section. + * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise. + * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise. + * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise. + * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise. + * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise. + * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise. + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise. + * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. + * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise. + * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise. + * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. + * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise. + * elf64-x86-64.c (elf64_x86_64_adjust_dynamic_symbol): Likewise. + * elfxx-mips.c (_bfd_mips_vxworks_adjust_dynamic_symbol): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise. + +2007-05-15 Richard Sandiford + + * elfxx-mips.c (mips_elf_create_local_got_entry): Remove + input_section argument. Create .rela.dyn relocations against + symbol 0 rather than the section symbol. + (mips_elf_local_got_index): Remove input_section argument. + Update call to mips_elf_create_local_got_entry. + (mips_elf_got_page, mips_elf_got16_entry): Likewise. + (mips_elf_calculate_relocation): Update calls to + mips_elf_local_got_index, mips_elf_got16_entry and mips_elf_got_page. + +2007-05-15 Mark Shinwell + + * elf32-arm.c (elf32_arm_final_link_relocate): Correctly + handle the Thumb-2 JUMP19 relocation. + +2007-05-15 Alan Modra + + PR 4479 + * elf.c (elf_fake_sections): Don't allow backend to change + SHT_NOBITS if called for strip/objcopy --only-keep-debug. + * elfxx-mips.c (_bfd_mips_elf_fake_sections): Remove similar + fix from here. + +2007-05-14 Alan Modra + + * elf.c (bfd_elf_string_from_elf_section): Return NULL on + invalid shstrndx. + (bfd_elf_get_str_section): Likewise. + +2007-05-12 Alan Modra + + PR 4497 + * elf-eh-frame.c (struct cie): Add "local_personality". Make + "personality" a union. + (cie_eq): Compare local_personality too. Adjust personality + comparison. + (_bfd_elf_discard_section_eh_frame): Check binding on personality + reloc sym to allow for bad symtab. Use stashed local syms rather + than reading personality local sym. Handle discarded sections. + +2007-05-12 Alan Modra + + * elf32-spu.c (elf_howto_table): Add howto for R_SPU_ADDR16X. + +2007-05-11 Alan Modra + + * elf32-ppc.h (ppc_elf_select_plt_layout): Update prototype. + (enum ppc_elf_plt_type): Move from.. + * elf32-ppc.c: ..here. + (struct ppc_elf_obj_tdata): Add makes_plt_call and has_rel16. + (struct ppc_elf_link_hash_table): Reorder. Add old_bfd. Delete + can_use_new_plt. Make is_vxworks a bitfield. + (ppc_elf_link_hash_table_create): Don't clear is_vxworks (again). + (ppc_elf_check_relocs): Update setting of reloc flags. Set old_bfd. + (ppc_elf_select_plt_layout): Modify parameters. Use bfd reloc + flags to better detect object files needing old bss-style plt. + Allow secure plt to be used without rel16 relocs being detected. + Warn if secure plt request cannot be allowed. + +2007-05-11 Alan Modra + + * reloc.c (BFD_RELOC_SPU_PPU32, BFD_RELOC_SPU_PPU64): Define. + * elf-bfd.h (struct elf_backend_data): Change return type of + elf_backend_relocate_section to int. + * elf32-spu.c (elf_howto_table): Add howtos for R_SPU_PPU32 and + R_SPU_PPU64. + (spu_elf_bfd_to_reloc_type): Convert new relocs. + (spu_elf_count_relocs): New function. + (elf_backend_count_relocs): Define. + (spu_elf_relocate_section): Arrange to emit R_SPU_PPU32 and + R_SPU_PPU64 relocs. + * elflink.c (elf_link_input_bfd): Emit relocs if relocate_section + returns 2. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2007-05-10 Richard Sandiford + + * elf32-arm.c (elf32_arm_check_relocs): Don't create PLT entries + for R_ARM_ABS12 relocs. + (elf32_arm_finish_dynamic_symbol): Fix the loop that creates + non-shared VxWorks PLT entries. + +2007-05-11 Alan Modra + + PR 4454 + * elf-eh-frame.c (struct cie): Make "personality" a bfd_vma. + (_bfd_elf_discard_section_eh_frame): Handle local syms on + personality relocation. + +2007-05-10 Richard Sandiford + + * elf.c (assign_file_positions_for_load_sections): Use p_memsz + rather than p_filesz to calculate the LMA of the end of a segment. + +2007-05-10 Jakub Jelinek + + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't do copyreloc + processing if symbol is defined in the executable. + +2007-05-10 Alexandre Oliva + + * elf32-frv.c (_frvfdpic_check_discarded_relocs): New. + (frvfdpic_elf_discard_info): New. + (elf_backend_discard_info): Define for FDPIC. + +2007-05-09 Mark Shinwell + + * elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Don't + attempt to scan if the bfd doesn't correspond to an ELF image. + (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise. + +2007-05-08 Alexandre Oliva + + * elf32-frv.c (elf32_frv_relocate_section): Discard dynamic relocs + for which _bfd_elf_section_offset returns -1. + +2007-05-08 Alan Modra + + * elf32-spu.c (spu_elf_size_stubs): Use "void *" for psyms. + (mark_functions_via_relocs): Likewise. + +2007-05-07 Alan Modra + + * elflink.c (bfd_elf_final_link): Correct reloc handling for + elf_backend_count_relocs. + (bfd_elf_discard_info): Print an error if we can't read syms. + +2007-05-07 Alan Modra + + * elf32-spu.c (spu_elf_reloc_type_lookup): Return NULL on + invalid reloc code. + (spu_elf_gc_mark_hook, spu_elf_section_processing): Delete functions. + (elf_backend_gc_mark_hook, elf_backend_section_processing): Don't + define. + +2007-05-07 Alan Modra + + * elf.c (assign_file_positions_for_load_sections): Don't check + core segment. + +2007-05-04 H.J. Lu + + * elflink.c (elf_link_sort_relocs): Return if both .rela.dyn + and .rel.dyn aren't present. + +2007-05-04 Nick Clifton + + * elflink.c (elf_link_sort_relocs): If both .rela.dyn and .rel.dyn + sections are present examine the indirect sections in an attempt + to compute the correct relocation size. If there is any + ambiguity, produce an error and refuse to sort. + +2007-05-03 Sandra Loosemore + + * elf32-arm.c (allocate_dynrelocs): Fix typo in comment. + +2007-05-03 Vincent Riviere + Nick Clifton + + PR gas/3041 + * aoutx.h (swap_std_reloc_out): Treat relocs against weak symbols + in the same way as relocs against external symbols. + +2007-05-02 Alan Modra + + * elf.c (assign_file_positions_for_load_sections): Set sh_offset + here. Set sh_type to SHT_NOBITS if we won't be allocating + file space. Don't bump p_memsz for non-alloc sections. Adjust + section-in-segment check. + (assign_file_positions_for_non_load_sections): Don't set sh_offset + here for sections that have already been handled above. + +2007-04-30 Alan Modra + + * elf32-spu.c (struct spu_link_hash_table): Add stack_analysis + and emit_stack_syms bitfields. + (get_sym_h): Read all symbols if stack analysis will be done. + (spu_elf_create_sections): Add stack_analysis and emit_stack_syms + params, and stash in hash table. + (is_hint): Split off from.. + (is_branch): ..here. Adjust callers. + (spu_elf_size_stubs): Add stack_analysis param. Arrange to read + and keep all syms. + (write_one_stub): Fix mem leak. + (find_function_stack_adjust): New function. + (sort_syms_syms, sort_syms_psecs): New vars. + (sort_syms): New function. + (struct call_info, struct function_info): New. + (struct spu_elf_stack_info): New. + (alloc_stack_info, maybe_insert_function, func_name): New functions. + (is_nop, insns_at_end, check_function_ranges): Likewise. + (find_function, insert_callee, mark_functions_via_relocs): Likewise. + (pasted_function, interesting_section, discover_functions): Likewise. + (mark_non_root, call_graph_traverse, build_call_tree): Likewise. + (sum_stack, spu_elf_stack_analysis, spu_elf_final_link): Likewise. + (bfd_elf32_bfd_final_link): Define. + * elf32-spu.h (struct _spu_elf_section_data): Add stack_info field. + (spu_elf_create_sections, spu_elf_size_stubs): Update prototypes. + +2007-04-28 Sergey Rogozhkin + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Don't access + memory which we might not own. + +2007-04-27 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_make_sym_local): Restore deleted function. + (elf_xtensa_hide_symbol, elf_backend_hide_symbol): Likewise. + (elf_xtensa_allocate_dynrelocs): Use elf_xtensa_make_sym_local. + +2007-04-27 Bob Wilson + + * elf32-xtensa.c (xtensa_read_table_entries): Step through table + contents and relocs in parallel. + +2007-04-27 Bob Wilson + + * elf32-xtensa.c (relax_property_section): Remove extra irel increment. + +2007-04-27 Alan Modra + + * cpu-rs6000.c: Write Mimi's name in ASCII. + * coff-rs6000.c: Likewise. + * rs6000-core.c: Likewise. + +2007-04-27 Alan Modra + + * sysdep.h: Include config.h first. + Many files: Include sysdep.h before bfd.h. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2007-04-25 Alan Modra + + * sysdep.h: Revert last change. + +2007-04-24 Nick Clifton + + * coffcode.h (coff_slurp_reloc_table): Initialise dst.r_offset. + * coff-m68k.c (m68kcoff_rtype_to_howto): Initialize relent.howto. + +2007-04-24 Alan Modra + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Warn if + eh_frame_hdr table won't be created. + +2007-04-24 Alan Modra + + * acinclude.m4: Include config/stdint.m4. + * configure.in: Invoke GCC_HEADER_STDINT. + * sysdep.h: Don't include ansidecl.h here. + * configure: Regenerate. + * config.in: Regenerate. + * Makefile.in: Regenerate. + +2007-04-23 Nathan Sidwell + + * archures.c (bfd_mach_mcf_isa_c, bfd_mach_mcf_isa_c_mac, + bfd_mach_mcf_isa_c_emac): New. + * elf32-m68k.c (ISAC_PLT_ENTRY_SIZE, elf_isac_plt0_entry, + elf_isac_plt_entry, elf_isac_plt_info): New. + (elf32_m68k_object_p): Add ISA_C. + (elf32_m68k_print_private_bfd_data): Print ISA_C. + (elf32_m68k_get_plt_info): Detect ISA_C. + * cpu-m68k.c (arch_info): Add ISAC. + (m68k_arch_features): Likewise, + (bfd_m68k_compatible): ISAs B & C are not compatible. + +2007-04-21 Nick Clifton + + * ecoff.c (_bfd_ecoff_write_armap): Initialise rehash. + (ecoff_link_add_archive_symbols): Likewise. + * coff-m68k.c (m68kcoff_common_addend_rtype_to_howto): Initialise + relent.howto. + * ieee.c (parse_int): Initialise x. + (must_parse_int): Initialise result. + (ieee_slurp_external_symbols): Initialise value. + +2007-04-21 Alan Modra + + * config.bfd (spu-*-elf): Delete targ_selvecs. + +2007-04-19 Nick Clifton + + * coffcode.h (coff_rtype_to_howto): Initialise genrel.howto. + +2007-04-19 Alan Modra + + * bfd.c (bfd_demangle): New function. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + +2007-04-18 Matthias Klose + + * Makefile.am (libbfd_la_LDFLAGS): Use bfd soversion. + (bfdver.h): Use the date in non-release builds for the soversion. + * Makefile.in: Regenerate. + +2007-04-17 Paul Brook + + * elf.c (_bfd_elf_is_function_type): New function. + * elflink.c (_bfd_elf_merge_symbol): Use bed->is_function_type. + (_bfd_elf_dynamic_symbol_p, _bfd_elf_symbol_refs_local_p, + is_global_data_symbol_definition, elf_link_add_object_symbols): Ditto. + * elf-bfd.h (elf_backend_data): Add is_function_type. + (_bfd_elf_is_function_type): Add prototype. + * elfxx-target.h (elf_backend_is_function_type): Add default + definition. + (elfNN_bed): Add elf_backend_is_function_type. + * elf32-arm.c (elf32_arm_is_function_type): New function. + (elf_backend_is_function_type): Define. + +2007-04-17 Daniel Jacobowitz + + * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Put + DT_MIPS_RLD_MAP before DT_DEBUG again. + +2007-04-14 Steve Ellcey + + * Makefile.am: Add ACLOCAL_AMFLAGS. + * configure.in: Change macro call order. + * Makefile.in: Regnerate. + * doc/Makefile.in: Regenerate. + * configure: Regenerate. + +2007-04-14 Jakub Jelinek + + * elflink.c (bfd_elf_final_link): Don't free symbuf for + non-elf input bfds. + (bfd_elf_size_dynamic_sections): Don't access elf_section_data + for non-elf input bfds. + +2007-04-12 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Don't add + DT_MIPS_RTLD_MAP for PIEs. + +2007-04-12 Richard Sandiford + + * elfxx-mips.c (mips_elf_calculate_relocation): Set DT_TEXTREL + when creating a __GOTT_BASE__ or __GOTT_INDEX__ relocation + in a read-only section. + (_bfd_mips_elf_check_relocs): Likewise. + +2007-04-12 Bob Wilson + + * elf32-xtensa.c (xtensa_is_insntable_section): New. + (xtensa_is_proptable_section): New. + (elf_xtensa_discard_info_for_section): Handle "full" .xt.prop property + tables with 12-byte entries, as well as tables with 8-byte entries. + Sort the relocations before examining them. + (relax_property_section): Use xtensa_is_proptable_section and + xtensa_is_littable_section. Rewrite code for combining table entries + to be more robust in case of unexpected relocations. Do not set offset + of unused relocations to less than zero. + (xtensa_is_property_section): Use other functions instead of + duplicating section name comparisons. + (xtensa_is_littable_section): Use CONST_STRNEQ for ".gnu.linkonce.p.". + (xtensa_get_property_predef_flags): Use xtensa_is_insntable_section. + +2007-04-12 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_gc_mark_hook): Don't follow references + from Xtensa property sections. + +2007-04-12 Alan Modra + + * elf32-spu.c (needs_ovl_stub): Test that spu_elf_section_data + is non-NULL before dereferencing. + +2007-04-11 Nathan Sidwell + + * elf-vxworks.c (elf_vxworks_emit_relocs): Remap weakdef PLT slot + relocs too. + +2007-04-10 Richard Henderson + + * elf64-alpha.c (struct alpha_elf_link_hash_table): Add relax_trip. + (elf64_alpha_size_got_sections): Remove unused something_changed local. + (elf64_alpha_size_plt_section): Return void. + (elf64_alpha_size_rela_got_section): Likewise. + (elf64_alpha_relax_section): Only regenerate got+plt if the + relax_trip counter has changed. + +2007-04-09 Daniel Jacobowitz + + * Makefile.am (bfdver.h): Do not generate doc/bfdver.texi. + * doc/Makefile.am (DOCFILES): Add bfdver.texi. + (bfdver.texi): New rule. + * Makefile.in, doc/Makefile.in: Regenerated. + +2007-04-03 Matt Thomas + + * elf32-vax.c (elf_vax_relocate_section): Do not emit a PCREL reloc + in a shared object if it is not in a CODE section or if it is against + a section symbol. This allows DWARF2 to use pcrel format. + +2007-04-05 H.J. Lu + + PR ld/4304 + * elflink.c (bfd_elf_final_link): Call einfo callback in + bfd_link_info instead of _bfd_error_handler for DT_TEXTREL + warning. + +2007-04-05 Alan Modra + + * elf32-spu.c (spu_elf_output_symbol_hook): New function. + (elf_backend_link_output_symbol_hook): Define. + +2007-04-02 Nick Clifton + + PR binutils/4292 + * bfd.c (bfd_fprintf_vma): Do not print addresses of 32-bit + targets as 64-bit values, even if running on a 64-bit host. + * coffgen.c (coff_print_symbol): Likewise. + +2007-03-29 Nick Clifton + + PR binutils/4110 + * elf.c (IS_VALID_GROUP_SECTION_HEADER): New macro. + (setup_group): Use it. Report corrupt group section headers. + (bfd_section_from_shdr): Use new macro. Replace constant 4 with + GRP_ENTRY_SIZE. Cope with NULLs in the group section table. + (elf_fake_section): Replace constant 4 with GRP_ENTRY_SIZE. + +2007-03-29 Alan Modra + + PR ld/4267 + * elflink.c (evaluate_complex_relocation_symbols): Use bfd_vma + for rel->r_info values. + (bfd_elf_perform_complex_relocation): Likewise. + * elf32-ppc.c (allocate_dynrelocs): Set plt.offset to -1 for + unused entries. Don't clear plt.plist in loop. + +2007-03-28 Richard Sandiford + + * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove append_rela. + * elfxx-sparc.c (sparc_elf_append_rela_64, sparc_elf_append_rela_32): + Merge into... + (sparc_elf_append_rela): ...this new function. + (SPARC_ELF_APPEND_RELA): Delete. + (_bfd_sparc_elf_link_hash_table_create): Don't initialize + the deleted append_rela field. + (_bfd_sparc_elf_relocate_section): Use sparc_elf_append_rela + instead of SPARC_ELF_APPEND_RELA. + (_bfd_sparc_elf_finish_dynamic_symbol): Likewise. Use the + elf_size_info structure to find the size of a RELA entry and + the associated swap-out function. + (sparc64_finish_dyn, sparc64_finish_dyn): Merge into... + (sparc_finish_dyn): ...this new function. + (_bfd_sparc_elf_finish_dynamic_sections): Update calls accordingly. + +2007-03-28 Richard Sandiford + Phil Edwards + + * doc/bfd.texinfo: Put the contents after the title page rather + than at the end of the document. + +2007-03-27 Andreas Schwab + + * elfxx-ia64.c (elf_backend_default_execstack): Define to 0. + +2007-03-26 H.J. Lu + + * configure: Regenerated. + +2007-03-26 Alan Modra + + * elf32-spu.c (struct stubarr): Add stub_hash_table and err fields. + (allocate_spuear_stubs): New function. + (spu_elf_size_stubs): Call allocate_spuear_stubs. + +2007-03-26 Alan Modra + + * aout-adobe.c (aout_32_bfd_reloc_name_lookup): Define. + * aout-arm.c (MY_bfd_reloc_name_lookup): Define. + (MY (bfd_reloc_name_lookup)): New function. + * aout-ns32k.c (MY (bfd_reloc_name_lookup)): New function. + * aout-target.h (NAME (aout, reloc_name_lookup)): Declare. + (MY_bfd_reloc_name_lookup): Define. + * aout-tic30.c (tic30_aout_reloc_name_lookup): New function. + (MY_bfd_reloc_name_lookup): Define. + * aoutx.h (NAME (aout, reloc_type_lookup)): Don't declare. + (NAME (aout, reloc_name_lookup)): New function. + * bout.c (b_out_bfd_reloc_name_lookup): New function. + * coff-alpha.c (alpha_bfd_reloc_name_lookup): New function. + (_bfd_ecoff_bfd_reloc_name_lookup): Define. + * coff-arm.c (coff_arm_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-i386.c (coff_bfd_reloc_name_lookup): Define. + (coff_i386_reloc_name_lookup): New function. + * coff-i860.c (coff_i860_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-i960.c (coff_i960_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-m68k.c (m68k_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-maxq.c (maxq_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-mcore.c (mcore_coff_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-mips.c (mips_bfd_reloc_name_lookup): New function. + (_bfd_ecoff_bfd_reloc_name_lookup): Define. + * coff-ppc.c (ppc_coff_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-rs6000.c (coff_bfd_reloc_name_lookup): Define. + (_bfd_xcoff_reloc_name_lookup): New function. + (rs6000coff_vec, pmac_xcoff_vec): Init new field. + * coff-sh.c (coff_bfd_reloc_name_lookup): Define. + (sh_coff_reloc_name_lookup): New function. + * coff-sparc.c (coff_sparc_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-tic30.c (coff_bfd_reloc_name_lookup): Define. + (tic30_coff_reloc_name_lookup): New function. + * coff-tic4x.c (coff_bfd_reloc_name_lookup): Define. + (tic4x_coff_reloc_name_lookup): New function. + * coff-tic54x.c (coff_bfd_reloc_name_lookup): Define. + (tic54x_coff_reloc_name_lookup): New function. + * coff-x86_64.c (coff_bfd_reloc_name_lookup): Define. + (coff_amd64_reloc_name_lookup): New function. + * coff-z80.c (coff_z80_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-z8k.c (coff_z8k_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff64-rs6000.c (coff_bfd_reloc_name_lookup): Define. + (xcoff64_reloc_name_lookup): New function. + (rs6000coff64_vec, aix5coff64_vec): Init new field. + * coffcode.h (coff_bfd_reloc_name_lookup): Define. + * elf-hppa.h (elf_hppa_reloc_name_lookup): New function. + * elf-m10200.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf-m10300.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-arc.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-arm.c (elf32_arm_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-avr.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-bfin.c (bfin_bfd_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-cr16c.c (elf_cr16c_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-cris.c (cris_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-crx.c (elf_crx_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-d10v.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-d30v.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-dlx.c (elf32_dlx_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-fr30.c (fr30_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-frv.c (frv_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-gen.c (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-h8300.c (elf32_h8_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-hppa.c (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-i370.c (i370_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-i386.c (elf_i386_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-i860.c (elf32_i860_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-i960.c (elf32_i960_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-ip2k.c (ip2k_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-iq2000.c (iq2000_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-m32c.c (m32c_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-m32r.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-m68hc11.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-m68hc12.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-m68k.c (reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-m88k.c (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-mcore.c (mcore_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-mep.c (mep_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-mips.c (bfd_elf32_bfd_reloc_name_lookup): New function. + (mips_vxworks_bfd_reloc_name_lookup): Likewise. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-msp430.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-mt.c (mt_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-openrisc.c (openrisc_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-or32.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-pj.c (pj_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-ppc.c (ppc_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-s390.c (elf_s390_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-score.c (elf32_score_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-sh.c (sh_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-sparc.c (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-spu.c (spu_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-v850.c (v850_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-vax.c (reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-xc16x.c (xc16x_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-xstormy16.c (xstormy16_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-xtensa.c (elf_xtensa_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf64-alpha.c (elf64_alpha_bfd_reloc_name_lookup): New function. + (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-gen.c (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-hppa.c (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-mips.c (bfd_elf64_bfd_reloc_name_lookup): New function. + * elf64-mmix.c (bfd_elf64_bfd_reloc_name_lookup): New function. + * elf64-ppc.c (ppc64_elf_reloc_name_lookup): New function. + (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-s390.c (elf_s390_reloc_name_lookup): New function. + (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-sh64.c (sh_elf64_reloc_name_lookup): New function. + (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-sparc.c (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-x86-64.c (elf64_x86_64_reloc_name_lookup): New function. + (bfd_elf64_bfd_reloc_name_lookup): Define. + * elfn32-mips.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elfxx-ia64.c (elfNN_ia64_reloc_name_lookup): New function. + (bfd_elfNN_bfd_reloc_name_lookup): Define. + * elfxx-sparc.c (_bfd_sparc_elf_reloc_name_lookup): New function. + * elfxx-sparc.h (_bfd_sparc_elf_reloc_name_lookup): Declare. + * i386msdos.c (msdos_bfd_reloc_name_lookup): Define. + * i386os9k.c (aout_32_bfd_reloc_name_lookup): Define. + * ieee.c (ieee_bfd_reloc_name_lookup): Define. + * libaout.h (NAME (aout, reloc_name_lookup)): Declare. + * libbfd-in.h (_bfd_norelocs_bfd_reloc_name_lookup): Declare. + * mipsbsd.c (MY_bfd_reloc_name_lookup): Define. + (MY(reloc_type_lookup)): Rename from MY(reloc_howto_type_lookup). + (MY(reloc_name_lookup)): New function. + * nlm-target.h (nlm_bfd_reloc_name_lookup): Define. + * oasys.c (oasys_bfd_reloc_name_lookup): Define. + * pdp11.c (NAME (aout, reloc_name_lookup)): New function. + * pe-mips.c (coff_mips_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * reloc.c (bfd_reloc_name_lookup): New function. + * riscix.c (riscix_reloc_name_lookup): New function. + (MY_bfd_reloc_name_lookup): Define. + * som.c (som_bfd_reloc_name_lookup): New function. + * targets.c (struct bfd_target): Add reloc_name_lookup. + (BFD_JUMP_TABLE_RELOCS): Add NAME##_bfd_reloc_name_lookup. + * versados.c (versados_bfd_reloc_name_lookup): Define. + * vms.c (vms_bfd_reloc_name_lookup): New function. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2007-03-26 Thiemo Seufer + + PR ld/4208 + * elfxx-mips.c (mips_elf_next_relocation): Don't signal an error if no + matching relocation is found. + (_bfd_mips_elf_relocate_section): Only warn about missing relocations. + +2007-03-23 H.J. Lu + + * configure: Regenerated. + +2007-03-23 Joseph Myers + + * configure.in: Use ACX_PKGVERSION and ACX_BUGURL. + * configure: Regenerate. + +2007-03-23 Alan Modra + + * elf32-spu.c (spu_stub_name): Don't put input section in stub name. + Remove input_sec param. Adjust all calls. + (write_one_stub): Adjust stub symbol. + (needs_ovl_stub): New function, extracted from.. + (spu_elf_size_stubs): ..here. + (spu_elf_relocate_section): Use needs_ovl_stub. + +2007-03-22 Joseph Myers + + * Makefile.am (bfdver.h): Only set VERSION_PACKAGE in bfdver.texi + if nonempty. + * configure.in (REPORT_BUGS_TO): Do not use "URL:" prefix. + * Makefile.in, configure, doc/Makefile.in: Regenerate. + +2007-03-22 H.J. Lu + + PR ld/4210 + * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Use the virtual + address and virtual size of the last section for the image + size. + +2007-03-22 H.J. Lu + + PR ld/4007 + * elf.c (assign_file_positions_for_load_sections): Check if + all sections are in the segment. + +2007-03-20 H.J. Lu + + PR ld/4208 + * elfxx-mips.c (_bfd_mips_elf_relocate_section): Report missing + matching LO16 relocation for HI16 relocation. + +2007-03-20 Paul Brook + + * bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype. + * bfd-in2.h: Regenerate. + * elf32-arm.c (elf32_arm_link_hash_table): Add pic_veneer. + (record_arm_to_thumb_glue): Use globals->pic_veneer. + (elf32_arm_create_thumb_stub): Ditto. + (bfd_elf32_arm_set_target_relocs): Set globals->pic_veneer. + +2007-03-18 Mark Shinwell + + * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add "bfd *" + argument and extra last argument. + * bfd-in2.h: Regenerate. + * elf32-arm.c (elf32_arm_obj_tdata): Add no_enum_size_warning + member. + (bfd_elf32_arm_set_target_relocs): Add "bfd *" argument and + extra last argument. Set no_enum_size_warning appropriately. + (elf32_arm_merge_eabi_attributes): Improve enum sizes + diagnostic, suppressing it when no_enum_size_warning dictates. + +2007-03-20 Nick Clifton + + PR binutils/3535 + * elf.c (copy_private_bfd_data): Widen the scope of Solaris + specific conditions that need the program headers to be + rewritten. + +2007-03-19 H.J. Lu + + * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Store Magic, + MajorLinkerVersion, MinorLinkerVersion, SizeOfCode, + SizeOfInitializedData, SizeOfUninitializedData, + AddressOfEntryPoint, BaseOfCode and BaseOfData in internal + extra PE a.out header. + (IMAGE_NT_OPTIONAL_HDR_MAGIC): Defined as 0x10b if not defined. + (IMAGE_NT_OPTIONAL_HDR64_MAGIC): Defined as 0x20b if not + defined. + (IMAGE_NT_OPTIONAL_HDRROM_MAGIC): Defined as 0x107 if not + defined. + (_bfd_XX_print_private_bfd_data_common): Also print Magic, + MajorLinkerVersion, MinorLinkerVersion, SizeOfCode, + SizeOfInitializedData, SizeOfUninitializedData, + AddressOfEntryPoint, BaseOfCode and BaseOfData from internal + extra PE a.out header. + +2007-03-18 H.J. Lu + + * targets.c (_bfd_target_vector): Add bfd_efi_app_x86_64_vec + only if BFD64 is defined. + +2007-03-17 Alan Modra + + * elf32-spu.c (spu_elf_size_stubs): Always use an overlay stub + on setjmp calls. + +2007-03-15 H.J. Lu + + * doc/Makefile.in: Regenerated. + +2007-03-15 H.J. Lu + + * Makefile.am (bfdver.h): Substitute report_bugs_to. Also + create doc/bfdver.texi. + * Makefile.in: Regenerated. + + * configure.in (--with-bugurl): New option. + * configure: Regenerated. + + * version.h (REPORT_BUGS_TO): New. + +2007-03-13 H.J. Lu + + PR binutils/3826 + * elf-bfd.h (elf_backend_data): Add elf_osabi. + (_bfd_elf_set_osabi): New. + + * elf.c (_bfd_elf_set_osabi): New. + + * elf32-hppa.c (elf32_hppa_post_process_headers): Removed. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi. + (ELF_OSABI): Properly defined for each target. + + * elf32-i370.c (i370_elf_post_process_headers): Removed. + (ELF_OSABI): Defined. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi. + + * elf32-i386.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for + freebsd. + (elf_i386_post_process_headers): Set EI_OSABI with elf_osabi. + + * elf32-msp430.c (elf32_msp430_post_process_headers): Removed. + (ELF_OSABI): Defined. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi. + + * elf64-alpha.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for + freebsd. + (elf64_alpha_fbsd_post_process_headers): Set EI_OSABI with + elf_osabi. + + * elf64-hppa.c (elf64_hppa_post_process_headers): Set EI_OSABI + with elf_osabi. + (ELF_OSABI): Properly defined for each target. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi for Linux. + + * elf64-sparc.c (elf64_sparc_fbsd_post_process_headers): Removed. + (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi. + + * elf64-x86-64.c (elf64_x86_64_fbsd_post_process_headers): Removed. + (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi. + + * elfcode.h (elf_object_p): Match the ELFOSABI_NONE ELF target + with any ELF target of the compatible machine for which we do not + have a specific backend. + + * elfxx-ia64.c (elfNN_hpux_post_process_headers): Set EI_OSABI + with elf_osabi. + + * elfxx-target.h (ELF_OSABI): Default to ELFOSABI_NONE. + (elfNN_bed): Initialize elf_osabi with ELF_OSABI. + +2007-03-08 Alan Modra + + * elf32-v850.c (v850_elf_link_output_symbol_hook): Clean out + V850_OTHER_* bits. + +2007-03-08 Alan Modra + + * Makefile.am (BFD64_BACKENDS): Add efi-app-x86_64.lo. + (BFD64_BACKENDS_CFILES): Add efi-app-x86_64.c. + Run "make dep-am". + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2007-03-07 H.J. Lu + + * config.bfd (x86_64-*-freebsd*): Add bfd_efi_app_x86_64_vec. + (x86_64-*-kfreebsd*-gnu): Likewise. + (x86_64-*-netbsd*): Likewise. + (x86_64-*-openbsd*): Likewise. + (x86_64-*-linux-*): Likewise. + + * configure.in: Support bfd_efi_app_x86_64_vec. + * configure: Regenerated. + + * efi-app-x86_64.c: New file. + + * targets.c (bfd_efi_app_x86_64_vec): New. + (_bfd_target_vector): Add bfd_efi_app_x86_64_vec. + +2007-03-07 Kai Tietz + + * reloc.c (bfd_generic_get_relocated_section_contents): Remove + const for type reloc_howto_type. + +2007-03-07 Alan Modra + + PR 3958 + * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): No error on relocatable link. + (elf_discarded_section): Move.. + * bfd-in.h: ..to here. + * bfd-in2.h: Regenerate. + * elflink.c (elf_link_input_bfd): Don't zap relocs against symbols + from discarded sections before relocate_section has done its job. + * reloc.c (bfd_generic_get_relocated_section_contents): Handle + relocs against symbols from discarded sections. + * elf-hppa.h (elf_hppa_howto_table): Set size. Set dst_mask on + SECREL32. + (elf_hppa_relocate_section): Handle relocatable link after setting + sec, sym, h etc. for final link. Squash error messages for + relocatable link. Clear section contents for relocs against + symbols in discarded sections, and zero reloc. Remove existing + zero r_symndx code. + * elf-m10200.c (mn10200_elf_relocate_section): Likewise. + * elf-m10300.c (mn10300_elf_relocate_section): Likewise. + * elf32-arm.c (elf32_arm_relocate_section): Likewise. + * elf32-avr.c (elf32_avr_relocate_section): Likewise. + * elf32-bfin.c (bfinfdpic_relocate_section): Likewise. + (bfin_relocate_section): Likewise. + * elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-crx.c (elf32_crx_relocate_section): Likewise. + * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. + * elf32-fr30.c (fr30_elf_relocate_section): Likewise. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-h8300.c (elf32_h8_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-i860.c (elf32_i860_relocate_section): Likewise. + * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. + * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise. + * elf32-m32c.c (m32c_elf_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-mep.c (mep_elf_relocate_section): Likewise. + * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. + * elf32-mt.c (mt_elf_relocate_section): Likewise. + * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-score.c (_bfd_score_elf_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-spu.c (spu_elf_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section): Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. + * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section_r): Likewise. + (elf64_alpha_relocate_section): Likewise. + * elf64-mmix.c (mmix_elf_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise. + + * elf32-arm.c (elf32_arm_relocate_section): Always adjust section + symbols for relocatable link. Don't use always-zero st_value. + (elf_backend_rela_normal): Don't define. + * elf32-bfin.c (bfinfdpic_relocate_section): Use + RELOC_FOR_GLOBAL_SYMBOL. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-d10v.c (elf32_d10v_relocate_section): Combine SEC_MERGE + section symbol adjustments with same for relocatable link. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-m68hc1x.c (m68hc11_get_relocation_value): Move.. + (elf32_m68hc11_check_relocs): ..to here. + * elf32-score.c (score_elf_final_link_relocate): Remove zero + r_symndx code. + * elfxx-mips.c (mips_elf_calculate_relocation): Likewise. + +2007-03-07 Alan Modra + + PR 4144 + * elf.c (assign_file_positions_for_load_sections): Don't + adjust p_memsz for !SEC_LOAD section vma modulo page size. + Instead, use the same lma based adjustment for SEC_LOAD + sections. + +2007-03-01 Bob Wilson + + * elf32-xtensa.c (analyze_relocations): Zero src_count if not relaxing. + (find_relaxable_sections): Do not increment src_count for unknown + opcodes. Decode only once instead of calling is_l32r_relocation. + (compute_text_actions): Remove unused no_insn_move flag. Assert that + src_next matches src_count in relax_info. + +2007-03-01 Joseph Myers + + * Makefile.am (bfdver.h): Use "." not " " between version number + and date. + * Makefile.in: Regenerate. + * configure.in (PKGVERSION): Default to "(GNU Binutils) ". + * configure: Regenerate. + +2007-02-28 Nathan Sidwell + + * config.bfd (sh-*-uclinux, sh[12]-*-uclinux): New stanza. + +2007-02-27 Alan Modra + + * elf32-spu.h (struct _ovl_stream): Make "start" and "end" const. + * elf32-spu.c (ovl_mgr_pread): Add const to casts. + +2007-02-23 Carlos O'Donell + + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Assume 32-bit + DWARF even with 64-bit addresses. + (_bfd_dwarf2_find_nearest_line): Likewise. + +2007-02-23 Nick Clifton + + PR binutils/3535 + * elf.c (copy_private_bfd_data): Always rewrite the program + headers when a Solaris interpreter segment is involved. + +2007-02-22 Paul Brook + + * elflink.c (gc_mark_hook_fn): Remove. + (_bfd_elf_gc_mark): Rename gc_mark_hook_fn to elf_gc_mark_hook_fn. + (bfd_elf_gc_sections): Ditto. Call gc_mark_extra_sections. + * elf-bfd.h (elf_gc_mark_hook_fn): Define. + (elf_backend_data): Add gc_mark_extra_sections. + * elfxx-target.h (elf_backend_gc_mark_extra_sections): Provide default + definition. + (elfNN_bed): Add elf_backend_gc_mark_extra_sections. + * elf32-arm.c (elf32_arm_gc_mark_extra_sections): New function. + (elf_backend_gc_mark_extra_sections): Define. + +2007-02-21 Nick Clifton + + * elf.c (_bfd_elf_map_sections_to_segments): If the + override_segment_assignment callback is defined then call it. + +2007-02-21 Alan Modra + + * elf32-spu.c (spu_elf_size_stubs): Correct order of warning args. + +2007-02-19 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): Remove + translation marker from untranslatable strings. + +2007-02-19 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add default_execstack. + * elflink.c (bfd_elf_size_dynamic_sections): Heed default_execstack. + * elfxx-target.h (elf_backend_default_execstack): Define to 1. + (elfNN_bed): Init new field. + * elf64-ppc.c (elf_backend_default_execstack): Define to 0. + +2007-02-17 Mark Mitchell + Nathan Sidwell + Vladimir Prus + + * configure.in (--with-pkgversion): New option. + * configure: Regenerate. + * Makefile.am (bfdver.h): Substitute for @bfd_version_package@. + * Makefile.in: Regenerate. + * version.h (BFD_VERSION_STRING): Define using + @bfd_version_package@. + +2007-02-16 Carlos O'Donell + + * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): + Print EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_XGOT + and EF_MIPS_UCODE. + +2007-02-15 Alan Modra + + * libbfd-in.h (_bfd_norelocs_get_reloc_upper_bound): Don't define, + declare. + (_bfd_norelocs_canonicalize_reloc): Likewise. + * libbfd.h: Regenerate. + * libbfd.c (_bfd_norelocs_get_reloc_upper_bound): New function. + (_bfd_norelocs_canonicalize_reloc): Likewise. + * binary.c (binary_bfd_reloc_type_lookup): Don't define. + (binary_get_reloc_upper_bound, binary_canonicalize_reloc): Likewise. + (binary_vec): Use _bfd_norelocs in BFD_JUMP_TABLE_RELOCS. + * ihex.c: Similarly. + * mach-o-target.c: Similarly. + * mach-o.c: Similarly. + * mmo.c: Similarly. + * pef.c: Similarly. + * ppcboot.c: Similarly. + * srec.c: Similarly. + * xsym.c: Similarly. + +2007-02-14 H.J. Lu + + PR ld/3953 + * elflink.c (_bfd_elf_add_default_symbol): Check warning symbol + when adding default symbol. + +2007-02-13 Alan Modra + + * elf64-ppc.c (create_linkage_sections): Use section ".branch_lt" + for branch lookup table. + +2007-02-12 Alan Modra + + * elf64-ppc.c (create_linkage_sections): Don't create + .rela.rodata.brlt for --emit-relocs. + (ppc_build_one_stub): Create relocs for brlt --emit-relocs here. + (ppc_size_one_stub): Count them. Simplify test of stub type + when counting stub relocs. Set SEC_RELOC too. + (ppc64_elf_size_stubs): Clear reloc_count and SEC_RELOC. + (ppc64_elf_finish_dynamic_sections): Output brlt relocs. + +2007-02-12 Alan Modra + + * elflink.c (evaluate_complex_relocation_symbols): Ignore relocs + with a zero symbol index. + +2007-02-12 Alan Modra + + * elflink.c (bfd_elf_discard_info): Tidy setting of "eh". + +2007-02-05 Dave Brolley + Stan Cox + + PR ld/3972 + * elflink.c (elf_link_input_bfd): Always setup finfo->internal_syms. + +2007-02-05 Dave Brolley + Richard Sandiford + Stan Cox + Nick Clifton + DJ Delorie + Frank Ch. Eigler + Ben Elliston + Richard Henderson + + * Makefile.am (ALL_MACHINES): Add cpu-mep.lo. + (ALL_MACHINES_CFILES): Add CPU_MEP.c. + (BFD32_BACKENDS): Add elf32-mep.lo. + (BFD32_BACKENDS_CFILES): Add elf32-mep.c. + (cpu-mep.lo,elf32-mep.lo): New targets. + * archures.c (bfd_arch_mep): New enumerator. + (bfd_mach_mep, bfd_mach_mep_h1): New macros. + (bfd_mep_arch): New external variable. + (bfd_archures_list): Add bfd_mep_arch. + * config.bfd: Support mep-*-elf. + * configure.in: Support bfd_elf32_mep_vec and bfd_elf32_mep_little_vec. + * reloc.c (BFD_RELOC_MEP_*): New relocation numbers. + * targets.c (bfd_elf32_mep_vec,bfd_elf32_mep_little_vec): New extern + declarations. + (_bfd_target_vector): Add bfd_elf32_mep_vec and + bfd_elf32_mep_little_vec. + * mep-relocs.pl: New file. + * cpu-mep.c: New file. + * elf32-mep.c: New file. + * bfd-in2.h: Regenerate. + * po/POTFILES.in: Regenerate. + * libbfd.h: Regenerate. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2007-02-05 Dave Brolley + + * elflink.c (evaluate_complex_relocation_symbols): Check for + STT_SRELC for global symbols. + (perform_complex_relocations): Renamed to + perform_complex_relocation and now examines only one relocation. + (elf_link_input_bfd): Don't call perform_complex_relocations. + * elf-bfd.h (bfd_elf_perform_complex_relocation_: New prototype. + * elf32-mep.c (mep_elf_howto_table): Add R_RELC. + (OD,OS,OU): #undefs corrected to N, S and U repectively. + (mep_reloc_type_lookup): Handle BFD_RELOC_RELC. + (complex_reloc_installation_howto): Removed. + (mep_info_to_howto_rela): Remove special case for r_type==0xff. + (mep_elf_relocate_section): Call bfd_elf_perform_complex_relocation. + +2007-02-05 Dave Brolley + Richard Sandiford + DJ Delorie + Graydon Hoare + Nick Clifton + Jeff Holcomb + Frank Ch. Eigler + + * elf-bfd.h (bfd_elf_perform_complex_relocations): New prototype. + * elf.c (swap_out_syms): Handle BSF_RELC and BSF_SRELC. + * elfcode.h (elf_slurp_symbol_table): Handle STT_RELC and STT_SRELC. + * elflink.c (set_symbolValue): New static function. + (resolve_symbol): Likewise. + (resolve_section): Likewise. + (undefined_reference): Likewise. + (eval_symbol): Likewise. + (evaluate_complex_relocation_symbols): Likewise. + (put_value): Likewise. + (get_value): Likewise. + (decode_complex_addend): + (bfd_elf_perform_complex_relocation): New function. + (elf_link_input_bfd): Call evaluate_complex_relocation_symbols. + * reloc.c (BFD_RELOC_RELC): New relocation number. + * syms.c (BSF_RELC,BSF_SRELC): New macros. + +2007-02-05 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_make_sym_local): Delete. + (elf_xtensa_hide_symbol, elf_backend_hide_symbol): Delete. + (elf_xtensa_fix_refcounts, elf_xtensa_allocate_plt_size) + (elf_xtensa_allocate_got_size): Replace these with... + (elf_xtensa_allocate_dynrelocs): ...this new function. + (elf_xtensa_size_dynamic_sections): Use it. + +2007-02-05 Bob Wilson + + * elf32-xtensa.c (elf_howto_table) + : + Set src_mask to zero. + : Likewise. Also fix dst_mask. + : Set pcrel_offset to TRUE. + +2007-02-02 Bob Wilson + + * elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Renamed to... + (elf_xtensa_dynamic_symbol_p): ...this. + +2007-02-02 Bob Wilson + + * elf32-xtensa.c (plt_reloc_count): Move into link hash table. + (struct elf_xtensa_link_hash_table): New. + (elf_xtensa_hash_table): New. + (elf_xtensa_link_hash_table_create): New. + (elf_xtensa_check_relocs): Update plt_reloc_count references. + Update arguments to add_extra_plt_sections. + (elf_xtensa_create_dynamic_sections): Record new sections in the hash + table. Update for plt_reloc_count and add_extra_plt_sections. + (add_extra_plt_sections, elf_xtensa_create_plt_entry): Replace dynobj + argument with link info. Update calls to elf_xtensa_get_plt_section + and elf_xtensa_get_gotplt_section. + (elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections) + (elf_xtensa_relocate_section, elf_xtensa_finish_dynamic_sections) + (elf_xtensa_discard_info_for_section, shrink_dynamic_reloc_sections) + (relax_property_section): Get sections from the hash table and update + function calls. + (elf_xtensa_get_plt_section, elf_xtensa_get_gotplt_section): Replace + dynobj argument with link info. Get sections for first plt chunk from + the hash table. + (bfd_elf32_bfd_link_hash_table_create): Define. + +2007-02-02 Jakub Jelinek + + * elf-bfd.h (struct elf_obj_tdata): Change symbuf type to void *. + * elf.c (struct elf_symbuf_symbol, struct elf_symbuf_head): New types. + (struct elf_symbol): Change first member into union. + (elf_sort_elf_symbol): Compare pointers to internal syms rather than + internal syms. Only compare st_shndx fields. + (elf_create_symbuf): New function. + (bfd_elf_match_symbols_in_sections): Use it. If symbufs are available + for bfds, use a binary search, otherwise don't qsort symbols + unnecessarily only to select which symbols are for the particular + shndx. + +2007-02-01 Nick Clifton + + PR ld/3852 + * elf.c (_bfd_elf_link_hash_table_init): Initialize all the fields + in the elf_link_hash_table structure. + +2007-02-01 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add elf_backend_write_core_note. + * elfxx-target.h (elf_backend_write_core_note): Define and use. + * elf.c (elfcore_write_prpsinfo): Call the above. Add support for + 32-bit core note on 64-bit target. + (elfcore_write_prstatus): Likewise. + (elfcore_write_lwpstatus): Make note_name const. + (elfcore_write_prfpreg): Likewise. + (elfcore_write_pstatus): Add support for 32-bit core note on 64-bit + target. + * elf32-ppc.c (ppc_elf_write_core_note): New function. + (elf_backend_write_core_note): Define. + * elf64-ppc.c (ppc64_elf_write_core_note): New function. + (elf_backend_write_core_note): Define. + +2007-01-31 H.J. Lu + + * elf32-cris.c (INCLUDED_TARGET_FILE): Removed. + (elf32_bed): Defined for elf32-us-cris. + + * elf64-sh64.c (elf64_bed): Defined for Linux. + (INCLUDED_TARGET_FILE): Removed. + + * elfxx-target.h (elfNN_bed): Always define. Don't check + INCLUDED_TARGET_FILE. + +2007-01-31 DJ Delorie + + * elf-m10300.c (mn10300_elf_relocate_section): Clarify the warning + message for dangerous relocs, special case the common user error. + +2007-01-30 H.J. Lu + + * elf.c (copy_elf_program_header): Start from the first section + in a segment and stop when all sections in a segment are + accounted for. + +2007-01-29 Julian Brown + + * bfd-in2.h: Regenerate. + * bfd-in.h (bfd_arm_vfp11_fix): New enum. Specify how VFP11 + instruction scanning should be done. + (bfd_elf32_arm_init_maps, bfd_elf32_arm_vfp11_erratum_scan) + (bfd_elf32_arm_vfp11_fix_veneer_locations): Add prototypes. + (bfd_elf32_arm_set_target_relocs): Add vfp11 fix type argument to + prototype. + * elf-bfd.h (elf_backend_write_section): Add struct bfd_link_info + argument. + * elf32-arm.c (VFP11_ERRATUM_VENEER_SECTION_NAME) + (VFP11_ERRATUM_VENEER_ENTRY_NAME): Define macros. + (elf32_vfp11_erratum_type): New enum. + (elf32_vfp11_erratum_list): New struct. List of veneers or jumps to + veneers. + (_arm_elf_section_data): Add mapsize, erratumcount, erratumlist. + (elf32_arm_link_hash_table): Add vfp11_erratum_glue_size, + vfp11_fix and num_vfp11_fixes fields. + (elf32_arm_link_hash_table_create): Initialise vfp11_fix, + vfp11_erratum_glue_size, num_vfp11_fixes fields. + (VFP11_ERRATUM_VENEER_SIZE): Define. Size of an (ARM) veneer. + (bfd_elf32_arm_allocate_interworking_sections): Initialise erratum + glue section. + (elf32_arm_section_map_add): Add an code/data mapping symbol entry + to a section's map. + (record_vfp11_erratum_veneer): Create a single veneer, and its + associated symbols. + (bfd_elf32_arm_add_glue_sections_to_bfd): Add vfp11 erratum glue. + (bfd_elf32_arm_init_maps): Initialise mapping symbol table for input + BFDs. + (bfd_elf32_arm_set_vfp11_fix): Set the type of erratum workaround + required. + (bfd_arm_vfp11_pipe): Define VFP11 instruction pipes. + (bfd_arm_vfp11_regno): Recode a register number from a VFP11 insn. + (bfd_arm_vfp11_write_mask): Update write mask according to coded + register number. + (bfd_arm_vfp11_antidependency): New function. + (bfd_arm_vfp11_insn_decode): Decode a VFP11 insn. + (elf32_arm_compare_mapping): Declare. + (bfd_elf32_arm_vfp11_erratum_scan): Scan the sections of an input + BFD for potential erratum-triggering insns. Record results. + (bfd_elf32_arm_vfp11_fix_veneer_locations): Find out where veneers + and branches to veneers have been placed in virtual memory after + layout. + (bfd_elf32_arm_set_target_relocs): Set vfp11_fix field in global + hash table. + (elf32_arm_output_symbol_hook): Remove. + (elf32_arm_write_section): Output veneers, and branches to veneers. + Use maps from input sections, not output sections, for code + byte-swapping. + * elf32-ppc.c (ppc_elf_write_section): Add dummy link_info argument. + * elf32-score.c (_bfd_score_elf_write_section): Likewise. + * elfxx-mips.c (_bfd_mips_elf_write_section): Likewise. + * elfxx-mips.h (_bfd_mips_elf_write_section): Likewise. + +2007-01-27 H.J. Lu + + * elf64-hppa.c (elf64_bed): Defined for HPUX and Linux. + (INCLUDED_TARGET_FILE): Removed. + +2007-01-27 Mike Frysinger + + * elf32-hppa.c (elf32_bed): Define for hpux, linux and netbsd. + (INCLUDED_TARGET_FILE): Remove. + +2007-01-25 DJ Delorie + + * elf32-m32c.c (m32c_elf_howto_table): Don't complain about + R_M32C_16 or R_M32C_24 relocs. + +2007-01-25 Nick Clifton + + PR binutils/3874 + * elf32-avr.c (avr_link_hash_table): Check to make sure that the + hash table was created by elf32_avr_link_hash_table_create before + using it. + (elf32_avr_link_hash_newfunc): New function. Just pass the call + through to _bfd_elf_link_hash_newfunc. + (elf32_avr_link_hash_table_create): Use + elf32_avr_link_hash_newfunc instead of + _bfd_elf_link_hash_newfunc. + (elf32_avr_relocate_section): Check for the hash table pointer + being NULL. + (elf32_avr_relax_section, avr_build_one_stub, + elf32_avr_setup_params, get_local_syms, elf32_avr_size_stubs, + elf32_avr_build_stubs): Likewise. + +2007-01-16 H.J. Lu + + PR ld/3831 + * elf-bfd.h (bfd_elf_link_mark_dynamic_symbol): Add an + argument, Elf_Internal_Sym *. + + * elflink.c (bfd_elf_link_mark_dynamic_symbol): Mark a data + symbol dynamic if info->dynamic_data is TRUE. + (bfd_elf_record_link_assignment): Updated call to + bfd_elf_record_link_assignment. + (_bfd_elf_merge_symbol): Likewise. Always call + bfd_elf_link_mark_dynamic_symbol. + +2007-01-12 H.J. Lu + + * Makefile.am (BFD_LIBS): Removed. + * Makefile.in: Regenerated. + +2007-01-11 H.J. Lu + + PR binutils/3631 + * Makefile.am (OFILES): Add @bfd64_libs@. + (libbfd_la_SOURCES): Remove $(BFD64_LIBS_CFILES). + * Makefile.in: Regenerated. + + * configure.in (bfd_libs): Replaced by ... + (bfd64_libs): This. + * configure: Regenerated. + +2007-01-11 Nathan Sidwell + + * elf.c (assign_file_positions_for_load_sections): We can + require fewer phdrs than expected. + +2007-01-08 Kazu Hirata + + * archures.c (bfd_mach_cpu32_fido): Rename to bfd_mach_fido. + * bfd-in2.h: Regenerate. + * cpu-m68k.c (arch_info_struct): Use bfd_mach_fido instead of + bfd_mach_cpu32_fido. + (m68k_arch_features): Use fido_a instead of cpu32. + (bfd_m68k_compatible): Reject the combination of Fido and + ColdFire. Accept the combination of CPU32 and Fido with a + warning. + * elf32-m68k.c (elf32_m68k_object_p, + elf32_m68k_merge_private_bfd_data, + elf32_m68k_print_private_bfd_data): Treat Fido as an + architecture by itself. + +2007-01-08 Kai Tietz + + * config.bfd: Renamed target x86_64-*-mingw64 to x86_64-*-mingw*. + +2007-01-05 Jakub Jelinek + + * texhex.c (first_phase): Don't fall through into the default + case. + (pass_over): Replace abort () calls with return FALSE. Fix + buffer overflow. + +2007-01-04 Jie Zhang + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't set + SEC_EXCLUDE on zero size .eh_frame. + +For older changes see ChangeLog-2006 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-2008 sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-2008 --- sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-2008 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-2008 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,3386 @@ +2008-12-29 Arnold Metselaar + + * coff-z80.c (r_imm32): Fix copy-paste bug that caused z80-objdump to + issue warnings about stabs debugging symbols rather than to show them. + +2008-12-23 Jon Beniston + + * Makefile.am: Add LM32 object files and dependencies. + * Makefile.in: Regenerate. + * archures.c: Add LM32 architechiture info. + * targets.c: Likewise. + * reloc.c: Likewise. + * bfd-in2.h: Regenerate. + * config.bfd: Add LM32 targets. + * configure.in: Likewise. + * configure: Regenerate. + * cpu-lm32.c: New file. + * elf32-lm32.c: New file. + +2008-12-23 H.J. Lu + + PR ld/7036 + * elfxx-ia64.c (elfNN_ia64_relax_section): Assume linker will + always insert 32byte between the .plt and .text sections after + the the first relaxation pass. + +2008-12-23 Nick Clifton + + PR 7093 + * elf32-arm.c (bfd_elf32_arm_init_maps): Only process ARM ELF + object files. + +2008-12-23 Tristan Gingold + + * mach-o.c (bfd_mach_o_make_bfd_section): Use the standard ELF name + .eh_frame for __TEXT.__eh_frame so that it is recognized by gdb. + Use shorter sections name for well known sections. + (bfd_mach_o_scan_read_dylinker): Only put dylinker name in the + section content. + (bfd_mach_o_scan_read_segment): Use shorter sections name for + well known segments. + (bfd_mach_o_scan_read_command): Ignore some new commands. + (bfd_mach_o_openr_next_archived_file): Use more descriptive names + for members filename. + (bfd_mach_o_fat_extract): New function to easily extract members + of a fat binary. + * mach-o.h (bfd_mach_o_load_command_type): Add new constants. + (bfd_mach_o_dylinker_command): Fix comment and reindent. + (bfd_mach_o_fat_extract): New prototype. + +2008-12-23 Johan Olmutz Nielsen + + * coffcode.h (coff_write_object_contents): Always initialise + section.s_page. + +2008-12-23 Andreas Schwab + + * elf32-m68k.c (elf_m68k_discard_copies): Use SYMBOL_CALLS_LOCAL. + (elf_m68k_relocate_section): Use SYMBOL_CALLS_LOCAL and + SYMBOL_REFERENCES_LOCAL. + (elf_m68k_relocate_section): Likewise. + +2008-12-23 Nick Clifton + + * elf-bfd.h (struct bfd_elf_section_data): Remove indirect_relocs + field. + (_bfd_elf_make_ifunc_reloc_section): Remove prototype. + * elf.c (swap_out_syms): Remove STT_IFUNC support. + (elf_find_function): Likewise. + * elf32-arm.c (arm_elf_find_function): Likewise. + (elf32_arm_adjust_dynamic_symbol): Likewise. + (elf32_arm_swap_symbol_in): Likewise. + (elf32_arm_is_function_type): Likewise. + * elf32-i386.c (is_indirect_symbol): Delete. + (elf_i386_check_relocs): Remove STT_IFUNC support. + (allocate_dynrelocs): Likewise. + (elf_i386_relocate_section): Likewise. + * elf64-x86-64.c (is_indirect_symbol): Delete. + (elf64_x86_64_check_relocs): Remove STT_IFUNC support. + (allocate_dynrelocs): Likewise. + (elf64_x86_64_relocate_section): Likewise. + * elfcode.h (elf_slurp_symbol_table): Likewise. + * elflink.c (_bfd_elf_adjust_symbol): Likewise. + (get_ifunc_reloc_section_name): Delete. + (_bfd_elf_make_ifunc_reloc_section): Delete. + * syms.c (BSF_INDIRECT_FUNCTION): Delete. + (bfd_print_symbol_vandf): Remove STT_IFUNC support. + (bfd_decode_symclass): Likewise. + * bfd-in2.h: Regenerate. + +2008-12-20 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_howto_table): Add entry for R_CRIS_32_IE. + (cris_reloc_map): Similarly. + (cris_elf_relocate_section, cris_elf_gc_sweep_hook) + (cris_elf_check_relocs): Handle R_CRIS_32_IE. + * reloc.c (bfd_reloc_code_type): Add entry for R_CRIS_32_IE. + * bfd-in2.h, libbfd.h: Regenerate. + +2008-12-18 Ralf Wildenhues + + * configure: Regenerate. + +2008-12-17 Hans-Peter Nilsson + + * elf32-cris.c (elf_cris_copy_indirect_symbol): Return without + action for symbols other than bfd_link_hash_indirect. + (cris_elf_relocate_section) : Add missing + gate h != NULL for h->def_regular test. + +2008-12-15 Hans-Peter Nilsson + + * elf32-cris.c (elf_cris_copy_indirect_symbol): New function. + (elf_backend_copy_indirect_symbol): Define to above. + + * elf32-cris.c (struct elf_cris_pcrel_relocs_copied): New member + r_type. Fix formatting. + (cris_elf_relocate_section) + : Also break early if the symbol doesn't get + emitted as a dynamic one. + (cris_elf_check_relocs) : Fork + from PCREL relocs code and simplify; don't fall through. + : Simplify for + pcrel only. For non-local or overridable symbols in a DSO, always + keep count of relocs, not just when -Bsymbolic. Don't emit + message nor mark as TEXTREL here. + (elf_cris_discard_excess_dso_dynamics): Emit warning and mark as + TEXTREL here, if there are nondiscarded pcrel relocs. + + * elf32-cris.c (elf_cris_got_elt_size) : Initialize + using ibfd, not abfd. + +2008-12-11 Alan Modra + + PR 7041 + * elf64-ppc.c (func_desc_adjust): Correct logic making fake function + descriptors. Similarly correct making function descriptors dynamic. + +2008-12-10 Alan Modra + + * elf32-spu.h (struct spu_elf_params): Add num_regions. + * elf32-spu.c (spu_elf_auto_overlay): Handle multiple overlay regions. + +2008-12-10 Alan Modra + + * elf32-spu.g (struct spu_elf_params, enum _ovly_flavour): New. + (spu_elf_setup): Declare. + (spu_elf_create_sections, spu_elf_size_stubs): Update prototype. + (spu_elf_build_stubs, spu_elf_check_vma): Likewise. + * elf32-spu.c (struct spu_link_hash_table): Add "params". Remove + various other fields now in "params". Adjust code throughout. + (struct call_info, struct function_info): Move earlier in file. + (struct spu_elf_stack_info): Likewise. + (spu_elf_setup): New function. + (spu_elf_create_sections): Remove args other than "info". + (spu_elf_size_stubs, spu_elf_build_stubs, spu_elf_check_vma): Likewise. + (maybe_needs_stubs): Remove "output_bfd" arg. Adjust all calls. + (interesting_section): Similarly with "obfd" arg. + (needs_ovl_stub): Adjust output_section test. + (allocate_spuear_stubs): Likewise. + (OVL_STUB_SIZE): Don't define. + (ovl_stub_size): New function, use in place of OVL_STUB_SIZE. + (build_stub): Test params->ovly_flavour rather than OVL_STUB_SIZE. + (spu_elf_auto_overlay): Remove args other than "info". Make use + of size returned from spu_elf_load_ovl_mgr. + (spu_elf_stack_analysis): Remove args other than "info". + (spu_elf_relocate_section): Tidy setting of "ea". + +2008-12-10 Alan Modra + + * elf32-spu.c (find_function_stack_adjust): Don't limit number + of insns scanned. Correct sp tests. Handle "fsmbi" and "andbi". + (mark_detached_root): New function. + (build_call_tree): Call it. + (sort_calls): Don't do void* arithmetic. + (define_ovtab_symbol): Don't abort on symbols defined in linker scripts. + (discover_functions): Consider STT_SECTION symbols too. + (collect_lib_sections): Don't cut short call tree traversal + when function size is too large. + +2008-12-09 Tom Tromey + + * pef.c (bfd_pef_parse_traceback_table): Add parens to placate gcc + 4.4. + +2008-12-09 Tristan Gingold + + * cpu-avr.c (compatible): Makes avr-6 compatible only with itself. + +2008-12-04 Andreas Krebbel + + * elf64-s390.c (elf_s390_check_relocs): Initialize + htab->elf.dynobj if necessary. + +2008-12-03 Nick Clifton + + * syms.c (struct bfd_symbol): Add new flag BSF_INDIRECT_FUNCTION. + Remove redundant flag BFD_FORT_COMM_DEFAULT_VALUE. Renumber flags + to remove gaps. + (bfd_print_symbol_vandf): Return 'i' for BSF_INDIRECT_FUNCTION. + (bfd_decode_symclass): Likewise. + * elf.c (swap_out_syms): Translate BSF_INDIRECT_FUNCTION into + STT_IFUNC. + (elf_find_function): Treat STT_IFUNC in the same way as STT_FUNC. + (_bfd_elf_is_function_type): Likewise. + * elf32-arm.c (arm_elf_find_function): Likewise. + (elf32_arm_adjust_dynamic_symbol): Likewise. + (elf32_arm_swap_symbol_in): Likewise. + (elf32_arm_additional_program_headers): Likewise. + * elf32-i386.c (is_indirect_symbol): New function. + (elf_i386_check_relocs): Also generate dynamic relocs for + relocations against STT_IFUNC symbols. + (allocate_dynrelocs): Likewise. + (elf_i386_relocate_section): Likewise. + * elf64-x86-64.c (is_indirect_symbol): New function. + (elf64_x86_64_check_relocs): Also generate dynamic relocs for + relocations against STT_IFUNC symbols. + (allocate_dynrelocs): Likewise. + (elf64_x86_64_relocate_section): Likewise. + * elfcode.h (elf_slurp_symbol_table): Translate STT_IFUNC into + BSF_INDIRECT_FUNCTION. + * elflink.c (_bfd_elf_adjust_dynamic_reloc_section): Add support + for STT_IFUNC symbols. + (get_ifunc_reloc_section_name): New function. + (_bfd_elf_make_ifunc_reloc_section): New function. + * elf-bfd.h (struct bfd_elf_section_data): Add indirect_relocs field. + * bfd-in2.h: Regenerate. + +2008-12-02 Tristan Gingold + + * config.bfd: Add x86_64-*-darwin* + +2008-11-28 John David Anglin + + * hpux-core.c: Don't include sys/file.h. + +2008-11-28 Joshua Kinard + + * aoutx.h (NAME): Add case statements for bfd_mach_mips14000, + bfd_mach_mips16000. + * archures.c (bfd_architecture): Add .#defines for bfd_mach_mips14000, + bfd_mach_mips16000. + * bfd-in2.h: Regenerate. + * cpu-mips.c: Add enums I_mips14000, I_mips16000. + (arch_info_struct): Add refs to R14000, R16000. + * elfxx-mips.c (mips_set_isa_flags): Handle bfd_mach_mips14000, + bfd_mach_mips16000. + (mips_mach_extensions): Map R14000, R16000 to R10000. + +2008-11-27 M R Swami Reddy + + * Add PIC support for CR16 target. + * elf32-cr16.c (R_CR16_GOT_REGREL20, R_CR16_GOTC_REGREL20 and + R_CR16_GLOB_DAT): New macros + (cr16_elf_howto_table): Add entries for for R_CR16_GOT_REGREL20, + R_CR16_GOTC_REGREL20 and R_CR16_GLOB_DAT. + (cr16_reloc_map): Ditto + (_bfd_cr16_elf_create_got_section): New function to create GOT section. + (_bfd_cr16_elf_create_dynamic_sections): New function to create dynamic + section. + (_bfd_cr16_elf_adjust_dynamic_symbol): New function to adjust symbol + defined by dynamic object. + (_bfd_cr16_elf_size_dynamic_sections): New function to find the size of + dynamic sections. + (_bfd_cr16_elf_finish_dynamic_symbol): New function to handle dynamic + symbols. + (_bfd_cr16_elf_finish_dynamic_symbol): New function to handle dynamic + sections. + (bfd_cr16_elf32_create_embedded_relocs): New function to create + embedded relocs in .emreloc section in memory for .data.rel section. + (_bfd_cr16_elf_reloc_type_class): New function for classify reloc types. + (cr16_elf_check_relocs): New function for checking reloc types in first + phase. + (cr16_elf_final_link_relocate): Update for handling the new reloc types + R_CR16_GOT_REGREL20 and R_CR16_GOTC_REGREL20. + (elf32_cr16_relax_section): Update relax implementation. + * reloc.c (bfd_reloc_code_type): Add entries for R_CR16_GOT_REGREL20, + R_CR16_GOTC_REGREL20 and R_CR16_GLOB_DAT. + * bfd-in.h (bfd_boolean bfd_cr16_elf32_create_embedded_relocs): Declared + * libbfd.h, bfd-in2.h: Regenerate. + +2008-11-26 Alan Modra + + PR 7047 + * configure.in: Bump version. + * configure: Regenerate. + * elflink.c (_bfd_elf_link_assign_sym_version): Continue matching + against version nodes when a global match is a wildcard. Similarly + continue matching on local wildcard matches, rather than only + continuing for "*". Have any global wildcard match override a + local wildcard match. Correct logic hiding unversioned symbol. + (bfd_elf_size_dynamic_sections): Update for changes to struct + bfd_elf_version_expr. + +2008-11-25 Joel Brobecker + + * configure.in: Deactivate large-file support on native x86-solaris + as well unless the user explicitly requested it. + * configure: Regenerate. + +2008-11-25 Joseph Myers + + * elf32-arm.c (elf32_arm_final_link_relocate): Do not turn + branches to undefine weak symbols into branches to the next + instruction if creating PLT entries for those symbols. + +2008-11-25 Nick Clifton + + * elflink.c (is_reloc_section): New function. Returns true if the + given name matches the name of the reloc-containing section + associated with the given section. + (get_dynamic_reloc_section_name): New function. Computes the name + of the section that contains the dynamic relocs associated with + the given section. + (_bfd_elf_get_dynamic_reloc_section): New function. Returns a + pointer to the section containing the dynamic relocs associated + with the given section. + (_bfd_elf_make_dynamic_reloc_section): New function. Creates a + section to contain the dynamic relocs associated with a given + section. + * elf-bfd.h: Prototype the new functions. + * elf-m10300.c (mn10300_elf_check_relocs): Use new functions. + (mn10300_elf_final_link_relocs): Likewise. + * elf32-arm.c (reloc_section_p): Delete - replaced by new + functions. + (elf32_arm_final_link_relocate): Use new functions. + (elf32_arm_check_relocs): Likewise. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + (elf_cris_check_relocs): Likewise. + * elf32-hppa.c (elf32_hppa_check_relocs): Likewise. + * elf32-i370.c (i370_elf_check_relocs): Likewise. + (i370_elf_relocate_section): Likewise. + * elf32-i386.c (elf_i386_check_relocs): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + (m32r_elf_check_relocs): Likewise. + * elf32-m68k.c (elf_m68k_check_relocs): Likewise. + * elf32_ppc.c (ppc_elf_check_relocs): Likewise. + (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_check_relocs): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + (sh_elf_check_relocs): Likewise. + * elf32-vax.c (elf_vax_check_relocs): Likewise. + (elf_vax_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_check_relocs): Likewise. + * elf64-ppc.c (ppc64_elf_check_relocs): Likewise. + * elf64-s390.c (elf_s390_check_relocs): Likewise. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise. + * elf32-bfin.c (bfin_check_relocs): Remove redundant local + variable 'sreloc'. + (bfin_relocate_section): Likewise. + * elf32-v850.c (v850_elf_check_relocs): Likewise. + +2008-11-23 Hans-Peter Nilsson + + Implement TLS for CRIS. + * elf32-cris.c: Include limits.h. + (TLSHOWTO16): Redefine in terms of and move contents to... + (TLSHOWTO16X): New macro. + (TLSHOWTO16S, LGOT_REG_NDX, LGOT_DTP_NDX, LGOT_ALLOC_NELTS_FOR) + (elf_cris_hash_entry): New macros. + (cris_elf_howto_table): Make R_CRIS_16_DTPREL, + R_CRIS_16_GOT_TPREL, R_CRIS_16_TPREL check overflow for signed, + not unsigned values. + (cris_info_to_howto_rela): Make r_type a enum elf_cris_reloc_type, + not unsigned int. + (struct elf_cris_link_hash_entry): New members reg_got_refcount, + tprel_refcount, and dtp_refcount. + (struct elf_cris_link_hash_table): New member dtpmod_refcount. + (elf_cris_link_hash_newfunc): Initialize new members. + (elf_cris_link_hash_table_create): Similar. + (cris_final_link_relocate, elf_cris_reloc_type_class): Use a + temporary variable when testing the relocation type. + (cris_elf_gc_mark_hook): Ditto. Add default case where needed. + (cris_elf_gc_sweep_hook): Ditto. Handle reference-counting for + the new assembly-generated relocs. Rewrite refcount handling to + set temporary variables to pointers to reloc-specific variables + and entry size and common code for the update. + (additional_relocation_error_msg_count): New variable. + (cris_elf_relocate_section): Use a function-local variable srelgot + for the .rela.got section instead of looking it up for every need. + Make r_type a enum elf_cris_reloc_type, not int. Actually set + symname for non-local symbols. Handle new assembly-generated + relocs. For overflow, emit additional messages for the new 16-bit + relocs as well as R_CRIS_16_GOTPLT and R_CRIS_16_GOT. + (elf_cris_finish_dynamic_symbol): Use elf_cris_finish_dynamic_symbol + instead of plain casts. Check new hash entry member + reg_got_refcount when checking whether to emit a GOT entry. + (elf_cris_finish_dynamic_sections): Update head comment to warn + about emitting relocs here. Use a temporary variable when testing + the relocation type. + (elf_cris_discard_excess_program_dynamics) + (elf_cris_adjust_gotplt_to_got): Handle reference counting change + regarding h->reg_got_refcount. + (cris_elf_check_relocs): Rewrite refcount handling to set + temporary variables and entry size and common code for the update + for local symbols. Use new macro elf_cris_hash_entry. Adjust + allocation for change in reference counting of GOT entries for + local symbols. + (elf_cris_size_dynamic_sections): Adjust calculated size of + .got.plt and .rela.got if we need a GOT entry for a + R_CRIS_DTPMOD relocation. + (elf_cris_got_elt_size): New function. + (elf_backend_got_elt_size): Define. + +2008-11-21 Sterling Augustine + + * xtensa-isa.c (xtensa_state_is_shared_or): New function. + +2008-11-21 Hans-Peter Nilsson + + * elf-bfd.h (struct elf_backend_data): New member got_elt_size. + (_bfd_elf_default_got_elt_size): Declare. + * elflink.c (struct alloc_got_off_arg): Replace member got_elt_size + by new member info. + (elf_gc_allocate_got_offsets): Adjust for calling bed->got_elt_size + to get the element size instead of using a gofarg entry. + (bfd_elf_gc_common_finalize_got_offsets): Similar. + (_bfd_elf_default_got_elt_size): New function. + * elfxx-target.h: New macro elf_backend_got_elt_size. + (elfNN_bed): Use it. + +2008-11-20 Tristan Gingold + + * bfdwin.c: Fix comment. + +2008-11-20 Tristan Gingold + + * bfd.c (is32bit): Use architecture information for non-ELF + targets. + +2008-11-20 Alan Modra + + * elf32-ppc.c (allocate_dynrelocs): Always use tlsld_got for + TLS_LD even when symbol is used with other TLS reloc types. + (ppc_elf_relocate_section): Bypass symbol checks when using tlsld_got. + Leave addend zero on LD DTPMOD dynamic reloc. + +2008-11-19 Bob Wilson + + * xtensa-modules.c (sysregs): Add MMID, VECBASE, EPC5, EPC6, EPC7, + EXCSAVE5, EXCSAVE6, EXCSAVE7, EPS5, EPS6, EPS7, CPENABLE, + SCOMPARE1, and THREADPTR registers. + (NUM_SYSREGS, MAX_USER_REG): Update. + (states): Change width of INTERRUPT, WindowBase, WindowStart, and + INTENABLE. Add VECBASE, EPC5, EPC6, EPC7, EXCSAVE5, EXCSAVE6, + EXCSAVE7, EPS6, EPS6, EPS7, THREADPTR, CPENABLE, and SCOMPARE1 states. + (NUM_STATES): Update. + (enum xtensa_state_id): Add entries for new states. + (enum xtensa_field_id): Add entries for xt_wbr15_imm and xt_wbr18_imm + fields, along with functions to extract and set them. + (regfiles): Change number of AR registers to 32. + (Operand_ar0_encode, Operand_ar4_encode, Operand_ar8_encode, + Operand_ar12_encode, Operand_ars_entry_encode): Update register mask. + (operands): Add entries for tp7, xt_wbr15_label, xt_wbr18_label, + xt_wbr15_imm, and xt_wbr18_imm operands, along with functions to + encode and decode them. + (enum xtensa_operand_id): Add entries for new operands. + (Iclass_xt_iclass_rfi_stateArgs): Add EPC5, EPC6, EPC7, EPS5, EPS6, and + EPC7 states. + (Iclass_xt_iclass_rfdo_stateArgs): Replace EPC4 and EPS4 by EPC6 and + EPS6, respectively. + (iclasses): Add entries for rur_threadptr, wur_threadptr, + xt_iclass_wsr_176, xt_iclass_rsr_epc5, xt_iclass_wsr_epc5, + xt_iclass_xsr_epc5, xt_iclass_rsr_excsave5, xt_iclass_wsr_excsave5, + xt_iclass_xsr_excsave5, xt_iclass_rsr_epc6, xt_iclass_wsr_epc6, + xt_iclass_xsr_epc6, xt_iclass_rsr_excsave6, xt_iclass_wsr_excsave6, + xt_iclass_xsr_excsave6, xt_iclass_rsr_epc7, xt_iclass_wsr_epc7, + xt_iclass_xsr_epc7, xt_iclass_rsr_excsave7, xt_iclass_wsr_excsave7, + xt_iclass_xsr_excsave7, xt_iclass_rsr_eps5, xt_iclass_wsr_eps5, + xt_iclass_xsr_eps5, xt_iclass_rsr_eps6, xt_iclass_wsr_eps6, + xt_iclass_xsr_eps6, xt_iclass_rsr_eps7, xt_iclass_wsr_eps7, + xt_iclass_xsr_eps7, xt_iclass_rsr_vecbase, xt_iclass_wsr_vecbase, + xt_iclass_xsr_vecbase, xt_iclass_mul16, xt_iclass_wsr_mmid, + xt_iclass_icache_lock, xt_iclass_dcache_lock, xt_iclass_rsr_cpenable, + xt_iclass_wsr_cpenable, xt_iclass_xsr_cpenable, xt_iclass_clamp, + xt_iclass_minmax, xt_iclass_sx, xt_iclass_l32ai, xt_iclass_s32ri, + xt_iclass_s32c1i, xt_iclass_rsr_scompare1, xt_iclass_wsr_scompare1, + xt_iclass_xsr_scompare1, xt_iclass_div, and xt_iclass_mul32, along + with corresponding argument and state argument arrays. Change + number of state arguments for xt_iclass_rfi. Add arguments for + xt_iclass_rfdo. + (enum xtensa_iclass_id): Add entries for new iclasses. + (opcodes): Add entries for RUR_THREADPTR, WUR_THREADPTR, WSR_176, + RSR_EPC5, WSR_EPC5, XSR_EPC5, RSR_EXCSAVE5, WSR_EXCSAVE5, XSR_EXCSAVE5, + RSR_EPC6, WSR_EPC6, XSR_EPC6, RSR_EXCSAVE6, WSR_EXCSAVE6, XSR_EXCSAVE6, + RSR_EPC7, WSR_EPC7, XSR_EPC7, RSR_EXCSAVE7, WSR_EXCSAVE7, XSR_EXCSAVE7, + RSR_EPS5, WSR_EPS5, XSR_EPS5, RSR_EPS6, WSR_EPS6, XSR_EPS6, RSR_EPS7, + WSR_EPS7, XSR_EPS7, RSR_VECBASE, WSR_VECBASE, XSR_VECBASE, MUL16U, + MUL16S, WSR_MMID, IPFL, IHU, IIU, DPFL, DHU, DIU, RSR_CPENABLE, + WSR_CPENABLE, XSR_CPENABLE, CLAMPS, MIN, MAX, MINU, MAXU, SEXT, L32AI, + S32RI, S32C1I, RSR_SCOMPARE1, WSR_SCOMPARE1, XSR_SCOMPARE1, QUOU, QUOS, + REMU, REMS, and MULL opcodes, along with the corresponding functions + to encode them. + (enum xtensa_opcode_id): Add entries for new opcodes. + (Slot_inst_decode): Handle new opcodes. + (Slot_inst_get_field_fns, Slot_inst_set_field_fns): Add entries for + xt_wbr15_imm and xt_wbr18_imm fields. + (Slot_inst16a_get_field_fns, Slot_inst16a_set_field_fns): Likewise. + (Slot_inst16b_get_field_fns, Slot_inst16b_set_field_fns): Likewise. + (xtensa_modules): Update number of fields, operands, iclasses and + opcodes. + +2008-11-19 Nix + + * elf.c (swap_out_syms) [USE_STT_COMMON]: Fix syntax error. + +2008-11-19 Nick Clifton + + PR 7027 + * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Treat WPLT30 relocs + against local symbols in 64-bit binaries as if they were WDISP30 + relocs. + (_bfd_sparc_elf_relocate_section): Likewise. + +2008-11-18 Catherine Moore + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Merge + half-precision attributes. + (elf32_arm_copy_one_eabi_other_attribute): New. + (elf32_arm_copy_other_attribute_list): New. + +2008-11-18 Nick Clifton + + * dwarf2.c (read_section): Fix formatting. + (read_n_bytes): Remove unhelpful comment. + (read_indirect_string): Pass symbol table to read_section in case + the .debug_str section needs relocating. + + PR 7037 + * elf32-cr16.c (cr16_elf_howto_table): Zero the src_mask field of + the reloc descriptions. + +2008-11-14 Eric B. Weddington + + PR 7022 + * elf32-avr.c (bfd_elf_avr_final_write_processing): + Add missing break statements. + +2008-11-14 Bob Wilson + + * xtensa-modules.c (xtensa_state_id): New enum, replacing STATE macros. + (xtensa_field_id, xtensa_regfile_id, xtensa_operand_id) + (xtensa_iclass_id, xtensa_opcode_id): New enums. + Replace hardcoded constants throughout this file with enum values. + +2008-11-14 Nathan Sidwell + + * elf.c (assign_file_positions_for_load_sections): Use header_size + to avoid moving the load address of file headers. + (assign_file_positions_for_load_sections): Set header_size for + segments containing the file header. + +2008-11-14 Tristan Gingold + + * configure.com: Handle bfd_default_target_size, BFD_HOST_LONG_LONG, + BFD_HOST_64BIT_LONG_LONG, BFD_HOSTPTR_T, bfd_file_ptr. + Generate bfdver.h. + * vms-hdr.c (_bfd_vms_write_hdr): Use strdup/free instead of alloca. + * hosts/alphavms.h: Defines macros to bypass i18n. + * makefile.vms (OBJS): Update file list. + (DEFS): Remove VMS_DEBUG, const, add DEBUGDIR. + (CFLAGS): Update flags. + * bfdio.c (real_fopen): Add code specific to VMS: extract attributes + from modes. + +2008-11-13 Joel Brobecker + + * configure.in: Deactivate large-file support on native 32bit + sparc-solaris unless the user explicitly requested it. + * configure: Regenerate. + +2008-11-13 Hans-Peter Nilsson + + PR ld/7028 + * elf.c (assign_file_positions_for_load_sections): Allocate phrds + with bfd_zalloc2 instead of bfd_alloc2. For the amount, use + the possibly-preset header-size, not the computed one. + +2008-11-13 Alan Modra + + PR 7023 + * elf.c (bfd_section_from_shdr ): Fail on invalid sh_info. + +2008-11-11 Alan Modra + + * elf.c (assign_file_positions_for_non_load_sections): Consolidate + PT_GNU_RELRO handling. + +2008-11-11 Alan Modra + + PR 7012 + * dwarf2.c (find_line): Don't keep stale pointers into realloc'd + memory. Return on errors. Fix memory leak. + (_bfd_dwarf2_cleanup_debug_info): Free dwarf_str_buffer. + +2008-11-10 Andreas Schwab + + PR 7011 + * elf.c (assign_file_positions_for_non_load_sections): Handle + PT_GNU_RELRO specially. + +2008-11-06 Joel Sherrill + + * config.bfd: Add m32c-*-rtems* and m32r-*-rtems*. + +2008-11-06 Tom Tromey + + * configure, config.in: Rebuild. + * configure.in: Check for fileno. + * bfdio.c (close_on_exec): New function. + (real_fopen): Use it. + (FD_CLOEXEC): New define. + +2008-11-06 Tristan Gingold + + * mach-o.h (BFD_MACH_O_NO_SECT): Add; reorders the macros. + (BFD_MACH_O_SYM_NTYPE, BFD_MACH_O_SYM_NSECT, + BFD_MACH_O_SYM_NDESC): New macros. + (bfd_mach_o_i386_thread_flavour): Define according to the latest + definition from system header. + (bfd_mach_o_load_command_type): Add BFD_MACH_O_LC_RPATH, + BFD_MACH_O_LC_CODE_SIGNATURE. + (BFD_MACH_O_SECTION_TYPE_MASK, BFD_MACH_O_SECTION_ATTRIBUTES_MASK, + BFD_MACH_O_SECTION_ATTRIBUTES_SYS, BFD_MACH_O_SECTION_ATTRIBUTES_USR, + BFD_MACH_O_S_ATTR_LOC_RELOC, BFD_MACH_O_S_ATTR_EXT_RELOC, + BFD_MACH_O_S_ATTR_SOME_INSTRUCTIONS, BFD_MACH_O_S_ATTR_DEBUG, + BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS): Add. + (bfd_mach_o_segment_command): Add room for a nul terminator in + segname field. + (BFD_MACH_O_PROT_READ, BFD_MACH_O_PROT_WRITE, + BFD_MACH_O_PROT_EXECUTE): Add. + (INDIRECT_SYMBOL_LOCAL): Renames to BFD_MACH_O_INDIRECT_SYMBOL_LOCAL. + (INDIRECT_SYMBOL_ABS): Renames to BFD_MACH_O_INDIRECT_SYMBOL_ABS. + (bfd_mach_o_uuid_command): Add the structure. + (bfd_mach_o_load_command): Add uuid field. + (bfd_get_mach_o_data): New macro. + * mach-o.c (bfd_mach_o_bfd_print_private_bfd_data): New function which + replaces the macro. + (SECTION_TYPE, SECTION_ATTRIBUTES, SECTION_ATTRIBUTES_USR, + S_ATTR_PURE_INSTRUCTIONS, SECTION_ATTRIBUTES_SYS, + S_ATTR_SOME_INSTRUCTIONS, S_ATTR_EXT_RELOC, S_ATTR_LOC_RELOC): Renamed + and moved to mach-o.h. + (N_STAB, N_TYPE, N_EXT, N_UNDF, N_ABS, N_TEXT, N_DATA, N_BSS, + N_SECT, N_INDR): Removed as they duplicated macros in mach-o.h. + (bfd_mach_o_print_symbol): Print much more details. + (bfd_mach_o_make_bfd_section): Add prot argument, use canonical + dwarf name for dwarf sections. Precisely set section flags. + (bfd_mach_o_scan_read_section_32): Add prot argument. + (bfd_mach_o_scan_read_section_64): Ditto. + (bfd_mach_o_scan_read_section): Ditto. + (bfd_mach_o_scan_read_symtab_symbol): Set section for debugging + stabs, set BSF_GLOBAL and LOCAL flags correctly. Fix section + for N_SECT symbols. + (bfd_mach_o_i386_flavour_string): Reindent and adjust for new + names. + (bfd_mach_o_scan_read_symtab): Set HAS_SYMS flags on bfd if there + are symbols. + (bfd_mach_o_scan_read_uuid): New function. + (bfd_mach_o_scan_read_segment): Add a trailing nul. Segments + flags are now simply HAS_CONTENTS. Pass protection to + bfd_mach_o_scan_read_section. + (bfd_mach_o_scan_read_command): Decode UUID command. + (bfd_mach_o_flatten_sections): Add comments. Fix flavour names. + (bfd_mach_o_scan): Set flags according to file type. + (mach_o_fat_archentry): Remove abfd field. + (bfd_mach_o_archive_p): Remove initialization of abfd field. + (bfd_mach_o_openr_next_archived_file): Find previous archive + by position and not by bfd (as former bfds may have been freed). + Give architecture name to archived file. + * mach-o-target.c (TARGET_NAME): Use generic archive for non fat + targets. + +2008-10-30 Jay Krell + + * cache.c (cache_bread): Cast void * pointer before performing + arithmetic on it. + +2008-10-20 Alan Modra + + * elf64-ppc.c (ppc64_elf_process_dot_syms): Renamed from + ppc64_elf_check_directives. + * elf32-sh-symbian.c (sh_symbian_process_directives): Combine.. + (sh_symbian_check_directives): ..this + (bfd_elf32_sh_symbian_process_directives) ..and this function. + +2008-10-20 Alan Modra + + * elflink.c (bfd_elf_final_link): Move code reading relocs to.. + * elf32-spu.c (spu_elf_count_relocs): ..here. Adjust params. + * elf-bfd.h (struct elf_backend_data): Update elf_backend_count_relocs + params. + +2008-10-20 Alan Modra + + * elflink.c (bfd_elf_final_link): Use d_ptr rather than d_val + where Elf_Internal_Dyn holds an address. + +2008-10-10 Nathan Froyd + + * elf32-ppc.c (ppc_elf_merge_obj_attributes): Merge + Tag_GNU_Power_ABI_Struct_Return. + +2008-10-09 Kai Tietz + + * cofflink.c (_bfd_coff_generic_relocate_section): Dump bfd_vma + sized addresses instead of long sized. + +2008-10-09 Alan Modra + + * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't attempt to + read plt relocs if no dynamic syms. + +2008-10-08 Nick Clifton + + * configure.in (ALL_LINGUAS): Add "id". + * configure: Regenerate. + * po/id.po: New Indonesian translation. + +2008-10-08 Alan Modra + + * elf.c (assign_file_positions_for_load_sections): When checking + a segment for contents, don't assume that a non-TLS nobits section + must only be followed by nobits sections. + +2008-10-04 Hans-Peter Nilsson + + * elf32-cris.c (TLSHOWTO32, TLSHOWTO16): New macros. + (cris_elf_howto_table): Add entries for R_CRIS_32_GOT_GD, + R_CRIS_16_GOT_GD, R_CRIS_32_GD, R_CRIS_DTP, R_CRIS_32_DTPREL, + R_CRIS_16_DTPREL, R_CRIS_DTPMOD, R_CRIS_32_GOT_TPREL, + R_CRIS_16_GOT_TPREL, R_CRIS_32_TPREL, R_CRIS_16_TPREL. + (cris_reloc_map): Similarly. + * reloc.c (bfd_reloc_code_type): Add entries for + BFD_RELOC_CRIS_32_GOT_GD, BFD_RELOC_CRIS_16_GOT_GD, + BFD_RELOC_CRIS_32_GD, BFD_RELOC_CRIS_DTP, + BFD_RELOC_CRIS_32_DTPREL, BFD_RELOC_CRIS_16_DTPREL, + BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_GOT_TPREL, + BFD_RELOC_CRIS_16_GOT_TPREL, BFD_RELOC_CRIS_32_TPREL, + BFD_RELOC_CRIS_16_TPREL. + * libbfd.h, bfd-in2.h: Regenerate. + +2008-10-03 Alan Modra + + PR 6931 + * elf.c (bfd_elf_set_group_contents): Assign sh_info for ld -r when + the signature symbol is global. + * elflink.c (elf_link_input_bfd): Ensure group signature symbol + is output when ld -r. Set group sh_info when local. + * linker.c (default_indirect_link_order): Handle group sections + specially. + +2008-09-30 Wesley W. Terpstra + Nick Clifton + + * coffgen.c (coff_write_symbols): Check to see if a symbol's flags + do not match it class and if necessary update the class. + (null_error_handler): New function. Suppresses the generation of + bfd error messages. + * coff64-rs6000.c (bfd_xcoff_backend_data): Update comment. + +2008-09-30 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2008-09-30 Alan Modra + + * elflink.c (elf_link_add_object_symbols): Don't ignore returned + value of check_directives. + +2008-09-29 Peter O'Gorman + Steve Ellcey + + * configure: Regenerate for new libtool. + * aclocal.m4: Ditto. + * Makefile.in: Ditto. + * doc/Makefile.in: Ditto. + +2008-09-29 Alan Modra + + PR 6789 + * elf.c (assign_file_positions_for_load_sections): Call + _bfd_elf_map_sections_to_segments, not elf_modify_segment_map. + (get_program_header_size): Protect against NULL info. + (_bfd_elf_map_sections_to_segments): Likewise. + * elf32-spu.c (spu_elf_additional_program_headers): Likewise. + +2008-09-29 Nick Clifton + + * po/vi.po: Updated Vietnamese translation. + +2008-09-28 Alan Modra + + * elf.c (_bfd_elf_init_private_section_data): Tweak union copy. + (bfd_section_from_shdr): Don't change SHT_GROUP section name. + * elflink.c (section_signature): New function. + (_bfd_elf_section_already_linked): Use it. + +2008-09-19 Alan Modra + + * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Handle vxworks + _GLOBAL_OFFSET_TABLE_ in .got.plt section. Add BFD_ASSERTs. + +2008-09-17 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_check_relocs): Check for negative + refcount. + +2008-09-17 Jan Kratochvil + + PR 6893 - Do not consider FDEs for discarded sections as invalid. + * elf-eh-frame.c (_bfd_elf_parse_eh_frame): New REQUIRE_CLEARED_RELOCS. + Consider FDEs with cleared relocations as valid and ignorable. + +2008-09-16 H.J. Lu + + PR ld/6877 + * elflink.c (_bfd_elf_merge_symbol): Allow a common symbol to + override the function in a shared library. + +2008-09-16 Alan Modra + + PR 6844 + * elf32-ppc.c (SYM_VAL): Define. Use throughout to find symbol vma. + (ppc_elf_relocate_section): Correct GOT offset calculation. + (ppc_elf_finish_dynamic_symbol): Use PPC_HA and PPC_LO. + (ppc_elf_finish_dynamic_sections): Likewise. Error if + htab->elf.hgot symbol is not defined in htab->got section. + +2008-09-16 Alan Modra + + PR 6888 + * elf32-ppc.c (ppc_elf_relocate_section): Handle NULL symbol section + on R_PPC_TOC16, R_PPC_SDAREL16, R_PPC_EMB_SDA2REL, R_PPC_EMB_SDA21, + R_PPC_EMB_RELSDA, R_PPC_SECTOFF* relocs. + +2008-09-11 Jan Kratochvil + + Fix loading large elf64 binaries on 32bit hosts. + * configure.in: Call AC_SYS_LARGEFILE. + * config.in: Regenerate. + * configure: Regenerate. + +2008-09-08 Tom Tromey + + * elfxx-mips.c (mips16_stub_symndx) : Mark argument as + unused. + +2008-09-08 H.J. Lu + Daniel Jacobowitz + + PR ld/3191 + * dwarf2.c (struct adjusted_section): Renamed from struct + loadable_section. + (struct dwarf2_debug): Adjust for renaming. Add version field. + (read_attribute_value): Correctly handle DW_FORM_ref_addr for + DWARF3. + (find_abstract_instance_name): Pass a pointer to + attribute instead of offset. For DW_FORM_ref_addr, get the + entry at the offset from the .debug_info section. + (scan_unit_for_symbols): Update. + (parse_comp_unit): Allow DWARF3. Save the version. + (unset_sections): Update for renaming. + (place_sections): Likewise. Set new VMAs for DWARF sections + also. + +2008-09-08 Tristan Gingold + + * configure.in: Update version to 2.19.50 + * configure: Regenerated. + +2008-09-05 Daniel Jacobowitz + + * dwarf2.c: Change leading whitespace to tabs. + +2008-09-05 Tristan Gingold + + Add MacOSX 64 bits support. + * mach-o.h (bfd_mach_o_ppc_thread_flavour): Add + BFD_MACH_O_PPC_THREAD_STATE_64. + (bfd_mach_o_i386_thread_flavour): Add BFD_MACH_O_x86_THREAD_STATE64, + BFD_MACH_O_x86_FLOAT_STATE64, BFD_MACH_O_x86_EXCEPTION_STATE64, + BFD_MACH_O_x86_THREAD_STATE, BFD_MACH_O_x86_FLOAT_STATE, + BFD_MACH_O_x86_EXCEPTION_STATE. + (bfd_mach_o_load_command_type): Add + BFD_MACH_O_LC_SEGMENT_64, BFD_MACH_O_LC_ROUTINES_64, + BFD_MACH_O_LC_UUID. + (BFD_MACH_O_CPU_IS64BIT): Added. + (bfd_mach_o_cpu_type): Add BFD_MACH_O_CPU_TYPE_POWERPC_64, + BFD_MACH_O_CPU_TYPE_X86_64. + (bfd_mach_o_header): Add version field. + (bfd_mach_o_section) Add reserved3 field. + (bfd_mach_o_segment_command): Add initprot and maxprot fields. + + * mach-o.c (N_TEXT, N_DATA, N_BSS): Added. + (bfd_mach_o_version): New function. + (bfd_mach_o_valid): Handle 64bits cpus. + (bfd_mach_o_write_header): handler 64bits headers. + (bfd_mach_o_scan_write_section_32, bfd_mach_o_scan_write_section_64): + New functions (from bfd_mach_o_scan_write_section) to handle both + flavors. + (bfd_mach_o_scan_write_segment): Parameter wide added to support + both flavors. + (bfd_mach_o_write_contents): Support both flavors. + (bfd_mach_o_read_header): Ditto. + (bfd_mach_o_scan_read_section_32, bfd_mach_o_scan_read_section_64): + New functions (from bfd_mach_o_scan_read_section) to support both + flavors. + (bfd_mach_o_scan_read_symtab_symbol): Support both flavors. + (bfd_mach_o_scan_read_symtab): Ditto. + (bfd_mach_o_scan_read_segment): Parameter wide added to support + both flavors. + (bfd_mach_o_scan_read_segment_32, bfd_mach_o_scan_read_segment_64): + New functions to call bfd_mach_o_scan_read_segment. + (bfd_mach_o_flatten_sections): Support both flavors. + (bfd_mach_o_scan_start_address): Ditto. + (bfd_mach_o_scan): Ditto. + (bfd_mach_o_lookup_section): Ditto. + +2008-08-27 John David Anglin + + * elf-hppa.h (elf_hppa_reloc_final_type): Handle R_PARISC_GPREL64, + R_PARISC_SEGREL32 and R_PARISC_SEGREL64. + * som.c (som_fixup_formats): Add R_DATA_GPREL fixup. + (som_hppa_howto_table): Likewise. + (hppa_som_gen_reloc_type): In case R_HPPA_GOTOFF, detect R_DATA_GPREL + final type. + (som_write_fixups): Handle R_DATA_GPREL. + +2008-08-26 Nick Clifton + + * elf32-arm.c: Fix up comment describing Thumb to ARM interworking + stub. + +2008-08-25 Christophe Lyon + + * elf32-arm.c (arm_thumb_arm_v4t_short_branch_stub): Define. + (elf32_arm_stub_type): Add arm_thumb_arm_v4t_stub_short_branch. + (arm_type_of_stub): Handle armv4t short branches. Update + prototype. + (arm_stub_is_thumb): Handle arm_thumb_arm_v4t_stub_short_branch. + (arm_build_one_stub): Likewise. + (arm_size_one_stub): Likewise. + (elf32_arm_size_stubs): Use new arm_type_of_stub prototype. + (arm_map_one_stub): Handle arm_thumb_arm_v4t_stub_short_branch. + +2008-08-24 Andreas Schwab + + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Do proper + extension when calculating difference of offsets. + +2008-08-24 Alan Modra + + * configure.in: Update a number of obsolete autoconf macros. + * aclocal.m4: Regenerate. + +2008-08-23 Andreas Schwab + + * opncls.c (find_separate_debug_file): Use the canonical + absolute name of the bfd object for finding the debug file in + the global debugfile directory. + +2008-08-22 Jakub Jelinek + + Fix PR ld/3290 regression for cross-files DW_FORM_ref_addr relocations. + * elflink.c (elf_link_add_object_symbols): Make debug symbols local + now only for non-RELOCATABLE targets. + +2008-08-20 Bob Wilson + + * elf-bfd.h (elf_object_id): Add XTENSA_ELF_TDATA. + * elf32-xtensa.c (elf_howto_table): Add TLS relocations. + (elf_xtensa_reloc_type_lookup): Likewise. + (TCB_SIZE): Define. + (elf_xtensa_link_hash_entry): New. + (GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE, GOT_TLS_ANY): Define. + (elf_xtensa_hash_entry): Define. + (elf_xtensa_obj_tdata): New. + (elf_xtensa_tdata): Define. + (elf_xtensa_local_got_tls_type): Define. + (elf_xtensa_local_tlsfunc_refcounts): Define. + (is_xtensa_elf): Define. + (elf_xtensa_mkobject): New. + (elf_xtensa_link_hash_table): Add tlsbase field. + (elf_xtensa_link_hash_newfunc): New. + (elf_xtensa_link_hash_table_create): Use elf_xtensa_link_hash_newfunc. + Create an entry for "_TLS_MODULE_BASE_" and save it in tlsbase field. + (elf_xtensa_copy_indirect_symbol): New. + (elf_xtensa_check_relocs): Rewrite to handle TLS relocations. + (elf_xtensa_gc_sweep_hook): Likewise. + (elf_xtensa_allocate_dynrelocs): Optimize away GOT entries for + TLSDESC_FN relocations when an IE reference is seen. + (elf_xtensa_allocate_local_got_size): Likewise. + (elf_xtensa_always_size_sections): New. + (dtpoff_base, tpoff): New. + (elf_xtensa_do_reloc): Handle TLS relocations. + (replace_tls_insn): New. + (IS_XTENSA_TLS_RELOC): Define. + (elf_xtensa_relocate_section): Handle TLS relocations. + (get_indirect_call_dest_reg): New. + (bfd_elf32_mkobject): Define. + (elf_backend_always_size_sections): New. + (elf_backend_copy_indirect_symbol): New. + * reloc.c (BFD_RELOC_XTENSA_TLSDESC_FN, BFD_RELOC_XTENSA_TLSDESC_ARG) + (BFD_RELOC_XTENSA_TLS_DTPOFF, BFD_RELOC_XTENSA_TLS_TPOFF) + (BFD_RELOC_XTENSA_TLS_FUNC, BFD_RELOC_XTENSA_TLS_ARG) + (BFD_RELOC_XTENSA_TLS_CALL): New. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2008-08-18 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Copy MIPS16 + stub information. + +2008-08-17 Nick Clifton + + * elf32-arm.c: Tidy up the code. + (bfd_elf32_arm_allocate_interworking_sections): Move common code + into... + (arm_allocate_glue_section_space): ... New function. + (bfd_elf32_arm_add_glue_sections_to_bfd): Move common code + into... + (arm_make_glue_section): ... New function. + + * elfxx-mips.c (_bfd_mips_elf_check_relocs): Handle the situation + where the sym_hashes are not available. + +2008-08-17 Alan Modra + + * bfd.c (struct _bfd): Correct outsymbols comment. + * bfd-in2.h: Regenerate. + * linker.c (bfd_generic_link_read_symbols): Renamed from.. + (generic_link_read_symbols): ..this, and made global. + +2008-08-15 Alan Modra + + PR 6526 + * configure.in: Invoke AC_USE_SYSTEM_EXTENSIONS. + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * configure: Regenerate. + +2008-08-14 Jaka Močnik + + * coffgen.c (coff_find_nearest_line): Correct cached line index. + +2008-08-12 Alan Modra + + * elf32-ppc.c (allocate_dynrelocs): Ignore dyn_relocs when + !dynamic_sections_created. Don't make symbols with got + references dynamic if !dynamic_sections_created. + * elf64-ppc.c (allocate_dynrelocs): Likewise. Alloc dynamic + relocs on undefined symbols. + (ppc64_elf_relocate_section): Allow dynamic relocs on + undefined symbols. + +2008-08-11 Alan Modra + + * elf64-ppc.c (toc_adjusting_stub_needed): Any call via the plt + needs r2 valid, not just those to external syms. + +2008-08-09 Pedro Alves + + * archive.c (_bfd_archive_bsd_update_armap_timestamp): Cast stat + st_mtime to long before comparison. + +2008-08-08 Anatoly Sokolov + + * archures.c (bfd_mach_avr25, bfd_mach_avr31, bfd_mach_avr35, + bfd_mach_avr51): New. + * bfd-in2.h: Regenerate. + * cpu-avr.c (arch_info_struct): Add avr25, avr31, avr35, and avr51 + architectures. Change comments to match architecture comments in GCC. + (compatible): Add test for new AVR architectures. + * elf32-avr.c (bfd_elf_avr_final_write_processing): Recognize + bfd_mach_avr25, bfd_mach_avr31, bfd_mach_avr35 and bfd_mach_avr51. + (elf32_avr_object_p): Recognize E_AVR_MACH_AVR25, E_AVR_MACH_AVR31, + E_AVR_MACH_AVR35 and E_AVR_MACH_AVR51. + + +2008-08-08 Richard Sandiford + Daniel Jacobowitz + Catherine Moore + Mark Shinwell + Maxim Kuvyrkov + + * elf32-mips.c (mips_vxworks_copy_howto_rela): Replace with... + (elf_mips_copy_howto): ...this howto. Clear the size fields. + (mips_vxworks_jump_slot_howto_rela): Replace with... + (elf_mips_jump_slot_howto): ...this howto. + (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS_COPY + and BFD_RELOC_MIPS_JUMP_SLOT. + (bfd_elf32_bfd_reloc_name_lookup): Handle "R_MIPS_COPY" and + "R_MIPS_JUMP_SLOT". + (mips_elf32_rtype_to_howto): Handle R_MIPS_COPY and R_MIPS_JUMP_SLOT. + (elf_backend_plt_readonly): Define. + (elf_backend_plt_sym_val): Define for non-VxWorks targets. + (mips_vxworks_bfd_reloc_type_lookup): Delete. + (mips_vxworks_bfd_reloc_name_lookup): Likewise. + (mips_vxworks_rtype_to_howto): Likewise. + (elf_backend_want_dynbss): Don't define for VxWorks. + (elf_backend_plt_readonly): Likewise. + (bfd_elf32_bfd_reloc_type_lookup): Likewise. + (bfd_elf32_bfd_reloc_name_lookup): Likewise. + (elf_backend_mips_rtype_to_howto): Likewise. + (elf_backend_adjust_dynamic_symbol): Likewise. + (elf_backend_got_symbol_offset): Don't define. + * elfn32-mips.c (elf_mips_copy_howto, elf_mips_jump_slot_howto): New. + (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS_COPY + and BFD_RELOC_MIPS_JUMP_SLOT. + (bfd_elf32_bfd_reloc_name_lookup): Handle "R_MIPS_COPY" and + "R_MIPS_JUMP_SLOT". + (mips_elf32_n32_rtype_to_howto): Handle R_MIPS_COPY and + R_MIPS_JUMP_SLOT. + (elf_backend_rela_plts_and_copies_p, elf_backend_plt_readonly) + (elf_backend_plt_sym_val): Define. + * elf64-mips.c (elf_mips_copy_howto, elf_mips_jump_slot_howto): New. + (bfd_elf64_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS_COPY + and BFD_RELOC_MIPS_JUMP_SLOT. + (bfd_elf64_bfd_reloc_name_lookup): Handle "R_MIPS_COPY" and + "R_MIPS_JUMP_SLOT". + (mips_elf64_rtype_to_howto): Handle R_MIPS_COPY and R_MIPS_JUMP_SLOT. + (elf_backend_rela_plts_and_copies_p, elf_backend_plt_readonly) + (elf_backend_plt_sym_val): Define. + * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Delete. + (_bfd_mips_elf_use_plts_and_copy_relocs, _bfd_mips_elf_init_stubs) + (_bfd_mips_elf_plt_sym_val, _bfd_mips_post_process_headers): Declare. + * elfxx-mips.c (mips_elf_la25_stub): New structure. + (LA25_LUI, LA25_J, LA25_ADDIU): New macros. + (mips_elf_link_hash_entry): Add "la25_stubs", "has_static_relocs" + and "has_nonpic_branches" fields. Remove "is_relocation_target" and + "is_branch_target". + (mips_elf_link_hash_table): Add blank lines. Add + "use_plts_and_copy_relocs", "reserved_gotno", "strampoline", + "la25_stubs" and "add_stub_section" fields. + (mips_htab_traverse_info): New structure. + (PIC_OBJECT_P, MIPS_ELF_LOAD_WORD): New macros. + (MIPS_RESERVED_GOTNO): Delete. + (mips_o32_exec_plt0_entry, mips_n32_exec_plt0_entry) + (mips_n64_exec_plt0_entry, mips_exec_plt_entry): New tables. + (mips_elf_link_hash_newfunc): Update after the changes to + mips_elf_link_hash_entry. + (mips_elf_check_mips16_stubs): Replace the DATA parameter with + an INFO parameter. Don't look through warnings symbols here; + do it in mips_elf_check_symbols instead. + (mips_elf_create_stub_symbol): New function. + (mips_elf_la25_stub_hash, mips_elf_la25_stub_eq): New functions. + (_bfd_mips_elf_init_stubs, mips_elf_local_pic_function_p): Likewise. + (mips_elf_add_la25_intro, mips_elf_add_la25_trampoline): Likewise. + (mips_elf_add_la25_stub, mips_elf_check_symbols): New functions. + (mips_elf_gotplt_index): Check for VxWorks. + (mips_elf_output_dynamic_relocation): Take the relocation index + as an extra parameter. Do not increment reloc_count here. + (mips_elf_initialize_tls_slots): Update the calls to + mips_elf_output_dynamic_relocation accordingly. + (mips_elf_multi_got): Use htab->reserved_gotno instead of + MIPS_RESERVED_GOTNO. + (mips_elf_create_got_section): Don't allocate reserved GOT + entries here. Unconditionally create .got.plt, but don't + set its alignment here. + (mips_elf_relocation_needs_la25_stub): New function. + (mips_elf_calculate_relocation): Redirect branches and jumps to + a non-PIC stub if one exists. Check !h->has_static_relocs instead + of !htab->is_vxworks when deciding whether to create dynamic + relocations for R_MIPS_32, R_MIPS_REL32 and R_MIPS_64. + (_bfd_mips_elf_create_dynamic_sections): Unconditionally call + _bfd_elf_create_dynamic_sections. Unconditionally set up + htab->splt and htab->sdynbss. Set htab->srelplt to ".rel.plt" + if !htab->is_vxworks. Add non-VxWorks values of + htab->plt_header_size and htab->plt_entry_size. + (_bfd_mips_elf_check_relocs): Set pointer_equality_needed for + non-branch static relocations. Set has_nonpic_branches when an la25 + stub might be required. Set can_make_dynamic_p to TRUE if R_MIPS_32, + R_MIPS_REL32 and R_MIPS_64 relocations can be made dynamic, + rather than duplicating the condition. Do not make them dynamic + for read-only sections in non-PIC executable objects. + Do not protect this code with dynobj == NULL || htab->sgot == NULL; + handle each group of cases separately. Add a default case that + sets has_static_relocs for non-GOT relocations that cannot be + made dynamic. Don't set is_relocation_target and is_branch_target. + Reject non-PIC static relocations in shared objects. + (_bfd_mips_vxworks_adjust_dynamic_symbol): Fold into... + (_bfd_mips_elf_adjust_dynamic_symbol): ...here, using + htab->use_plts_and_copy_relocs instead of htab->is_vxworks + to select PLT and copy-reloc handling. Set the alignment of + .plt and .got.plt when allocating the first entry. Generalize + code to handle REL as well as RELA sections and 64-bit as well as + 32-bit GOT entries. Complain if we find a static-only reloc + against an externally-defined symbol and if we cannot create + dynamic relocations for it. Allocate copy relocs using + mips_elf_allocate_dynamic_relocations on non-VxWorks targets. + Set possibly_dynamic_relocs to 0 when using PLTs or copy relocs. + Skip reserved .got.plt entries. + (_bfd_mips_elf_always_size_sections): Use mips_elf_check_symbols + instead of mips_elf_check_mips16_stubs to process each symbol. + Do the traversal for relocatable objects too. + (mips_elf_lay_out_got): Use htab->reserved_gotno instead of + MIPS_RESERVED_GOTNO. + (_bfd_mips_elf_size_dynamic_sections): Exclude sdynbss if it + is empty. Extend the DT_PLTREL, DT_JMPREL and DT_PLTRELSZ handling + to non-VxWorks targets. Only add DT_REL{,A}, DT_REL{,A}SZ and + DT_REL{,A}ENT if .rel.dyn is nonempty. Create a symbol for the + PLT. Allocate a nop at the end of the PLT. Allocate DT_MIPS_PLTGOT. + (mips_elf_create_la25_stub_info): New function. + (_bfd_mips_elf_finish_dynamic_symbol): Write out PLT entries + and copy relocs where necessary. Check pointer_equality_needed. + (mips_finish_exec_plt): New function. + (_bfd_mips_elf_finish_dynamic_sections): Always set DT_PLTGOT + to the beginning of htab->sgot. Use htab->reserved_gotno instead + of MIPS_RESERVED_GOTNO. Assert htab->use_plts_and_copy_relocs + instead of htab->is_vxworks for DT_PLTREL, DT_PLTRELSZ and DT_JMPREL. + Set DT_PLTREL to DT_REL instead of DT_RELA on non-VxWorks targets. + Use mips_finish_exec_plt to create non-VxWorks PLT headers. Set + DT_MIPS_PLTGOT. + (_bfd_mips_elf_copy_indirect_symbol): Copy has_static_relocs + from the indirect symbol to the direct symbol. Also copy + has_nonpic_branches for indirect symbols. + (_bfd_mips_elf_get_target_dtag): Handle DT_MIPS_PLTGOT and + DT_MIPS_RWPLT. + (_bfd_mips_elf_link_hash_table_create): Initialize the new + mips_elf_link_hash_table fields. + (_bfd_mips_vxworks_link_hash_table_create): Set + use_plts_and_copy_relocs to TRUE. Use TRUE rather than 1 + when setting is_vxworks. + (_bfd_mips_elf_use_plts_and_copy_relocs): New function. + (_bfd_mips_elf_final_link): Call mips_elf_create_la25_stub for + each la25_stub. + (_bfd_mips_elf_merge_private_bfd_data): Treat dynamic objects + as PIC. Generalize message about linking PIC and non-PIC. + (_bfd_mips_elf_plt_sym_val, _bfd_mips_post_process_headers): New + functions. + * reloc.c: Update comment near BFD_RELOC_MIPS_JUMP_SLOT. + * bfd-in2.h: Regenerated. + +2008-08-08 Alan Modra + + * elf.c (bfd_elf_get_elf_syms): Don't leak memory on error. + * elflink.c (_bfd_elf_link_read_relocs): bfd_release on error. + (elf_link_add_object_symbols): Don't leak memory on error. + (bfd_elf_size_dynsym_hash_dynstr): Likewise. + (elf_fixup_link_order): Free sections. + +2008-08-07 Richard Sandiford + + * elf-bfd.h (elf_backend_data): Add a "rela_plts_and_copies_p" field. + * elfxx-target.h (elf_backend_rela_plts_and_copies_p): New macro. + (elfNN_bed): Use it. + * elf.c (_bfd_elf_get_synthetic_symtab): Use rela_plts_and_copies_p + instead of default_use_rela_p to choose between ".rel.plt" and + ".rela.plt". + * elflink.c (_bfd_elf_create_dynamic_sections): Use + rela_plts_and_copies_p instead of default_use_rela_p to choose + between ".rel.plt" and ".rela.plt", and between ".rel.bss" and + ".rela.bss". + +2008-08-07 Richard Sandiford + + * elf-bfd.h (MIPS_ELF_TDATA): New elf_object_id. + * elf32-mips.c (bfd_elf32_mkobject): Define. + * elf64-mips.c (bfd_elf64_mkobject): Likewise. + * elfn32-mips.c (bfd_elf32_mkobject): Likewise. + * elfxx-mips.h (_bfd_mips_elf_mkobject): Declare. + * elfxx-mips.c (is_mips_elf): New macro. + (_bfd_mips_elf_mkobject): New function. + (_bfd_mips_elf_final_link): Use is_mips_elf. + (_bfd_mips_elf_merge_private_bfd_data): Likewise. + +2008-08-07 Richard Sandiford + + * elfxx-mips.c (mips_elf_record_relocs): Defer allocation of a + global GOT entry when deferring allocation of dynamic relocations. + (allocate_dynrelocs): When allocating deferred dynamic relocations, + also do the deferred allocation of a GOT entry. + +2008-08-07 Richard Sandiford + + * elfxx-mips.c (mips_got_info): Add a "reloc_only_gotno" field. + (mips_elf_got_section): Delete. + (mips_elf_sort_hash_table): Use g->reloc_only_gotno to decide + how many reloc-only entries there are. + (mips_elf_count_got_symbols): Adjust g->reloc_only_gotno as + well as g->global_gotno. + (mips_elf_make_got_per_bfd): Initialize reloc_only_gotno. + (mips_elf_multi_got): Likewise. Use gg->reloc_only_gotno + rather than gg->assigned_gotno to store the number of + reloc-only GOT entries. + (mips_elf_create_got_section): Remove the MAYBE_EXCLUDE parameter. + Initialize reloc_only_gotno. + (mips_elf_calculate_relocation): Check htab->got_info instead of + dynobj when deciding whether to call mips_elf_adjust_gp, + (_bfd_mips_elf_create_dynamic_sections): Adjust the call + to mips_elf_create_got_section. + (mips_elf_record_relocs): Likewise. Remove redundant + "dynobj == NULL" code. Do not use mips_elf_create_got_section + or mips_elf_record_global_got_symbol for R_MIPS_32, R_MIPS_REL32 + and R_MIPS_64; limit global_got_area to GGA_RELOC_ONLY instead. + (_bfd_mips_elf_finish_dynamic_symbol): Use htab->sgot instead + of mips_elf_got_section. + (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. + (_bfd_mips_elf_finish_dynamic_sections): Likewise. + Move the initial assignment of G to the block that uses it; + it is used for an unrelated purpose later. + +2008-08-07 Richard Sandiford + + * elfxx-mips.c (count_section_dynsyms): Move before the new first use. + (mips_elf_sort_hash_table): Take the output bfd as a parameter. + Remove the MAX_LOCAL parameter. Exit early if there are no + dynamic symbols, if there is no dynobj, or if there is no + GOT section. Use count_section_dynsyms instead of MAX_LOCAL. + Assert == rather than <= when checking hsd.max_unref_got_dynindx. + Also assert that g->global_gotno is right. + (mips_elf_count_forced_local_got_symbols): Rename to... + (mips_elf_count_got_symbols): ...and count global GOT entries too. + Set the global_got_area of a forced-local GGA_RELOC_ONLY symbol + to GGA_NONE. + (mips_elf_multi_got): Don't sort the symbol table. + (mips_elf_lay_out_got): Likewise. Use mips_elf_count_got_symbols + to count the number of global GOT entries. + (_bfd_mips_elf_final_link): Unconditionally call + mips_elf_sort_hash_table. + +2008-08-07 Richard Sandiford + + * elfxx-mips.c (GGA_NORMAL, GGA_RELOC_ONLY, GGA_NONE): New macros. + (mips_elf_link_hash_entry): Add a "global_got_area" field. + (mips_elf_link_hash_newfunc): Initialize it. + (mips_elf_sort_hash_table_f): Use h->global_got_area instead of + h->root.got.offset. Do not handle forced_local symbols specially. + (mips_elf_record_global_got_symbol): Set h->global_got_area + instead of h->root.got.offset. + (mips_elf_recreate_got): Assert that h->global_got_area == GGA_NONE + for indirect and warning symbols. + (mips_elf_count_forced_local_got_symbols): Change the argument + from a "elf_link_hash_entry" to "mips_elf_link_hash_entry". + Use and set h->global_got_area instead of h->root.got.offset. + Set it to GGA_NONE for all forced-local symbols. + (mips_elf_set_global_got_offset): Set h->global_got_area + instead of h->root.got.offset. Use g->global_got_area instead + of a combination of dynindx, forced_local and tls_type. + (mips_elf_multi_got): Remove disabled code. Pass GGA_* values to + mips_elf_set_global_got_offset. + (mips_elf_lay_out_got): Use mips_elf_link_hash_traverse instead + of elf_link_hash_traverse. + (_bfd_mips_elf_copy_indirect_symbol): Copy the indirect symbol's + global_got_area to the direct symbol if the latter's value is higher. + Set the indirect symbol's area to GGA_NONE. + +2008-08-07 Richard Sandiford + + * elf32-mips.c (elf_backend_hide_symbol): Delete. + * elfn32-mips.c (elf_backend_hide_symbol): Likewise. + * elf64-mips.c (elf_backend_hide_symbol): Likewise. + * elfxx-mips.h (elf_backend_hide_symbol): Likewise. + * elfxx-mips.c (mips_elf_link_hash_entry): Remove "forced_local" + and add "needs_lazy_stub". + (mips_elf_link_hash_newfunc): Update accordingly. + (mips_elf_link_hash_table): Remove "computed_got_sizes" and + add "lazy_stub_count". + (_bfd_mips_elf_link_hash_table_create): Update accordingly. + (mips_elf_output_extsym): Use hd->needs_lazy_stub to detect + cases where a lazy stub is being used. + (mips_elf_sort_hash_table_f): Use h->root.forced_local instead + of h->forced_local. + (mips_elf_record_global_got_symbol): Use _bfd_elf_link_hash_hide_symbol + instead of _bfd_mips_elf_hide_symbol. Do not increment local_gotno + here. + (mips_elf_allocate_dynamic_relocations): Move before new first use. + (mips_elf_check_recreate_got, mips_elf_recreate_got): New functions. + (mips_elf_resolve_final_got_entries): Move earlier in file. Make at + most two passes over the hash table. Use mips_elf_check_recreate_got + to see if there are any indirect or warning entries and + mips_elf_recreate_got to create a new GOT without them. + Return a boolean success value. + (mips_elf_count_forced_local_got_entries): New function. + (mips_elf_make_got_per_bfd): Check h->root.forced_local instead of + h->forced_local. + (mips_elf_set_global_got_offset): Likewise. + (mips_elf_set_no_stub): Replace with... + (mips_elf_forbid_lazy_stubs): ...this new function. + (mips_elf_resolve_final_got_entry): Delete. + (mips_elf_multi_got): Fix formatting. Use mips_elf_forbid_lazy_stubs + instead of mips_elf_set_no_stub. Move the code that sets + global offsets and allocates dynamic relocations from the main + _bfd_mips_elf_size_dynamic_sections loop to here. + (_bfd_mips_elf_adjust_dynamic_symbol): Do not allocate room in + .MIPS.stubs here; just set hmips->needs_lazy_stub and increment + htab->lazy_stub_count. + (_bfd_mips_elf_always_size_sections): Move the stub-estimation + code to mips_elf_estimate_stub_size and the GOT-sizing code to + mips_elf_lay_out_got. Do not call these functions here. + (mips_elf_estimate_stub_size): New function, split + out from _bfd_mips_elf_always_size_sections. Call + mips_elf_resolve_final_got_entries earlier. Count the number + of forced-local entries. Do not add stub sizes to loadable_size; + after this patch, the stub sizes are already included in the main + estimate. Allocate dynamic relocations here rather than in the + main _bfd_mips_elf_size_dynamic_sections loop. + (mips_elf_estimate_stub_size): New function, split out from + _bfd_mips_elf_always_size_sections. + (mips_elf_allocate_lazy_stub): New function. + (mips_elf_lay_out_lazy_stubs): Likewise. + (_bfd_mips_elf_size_dynamic_sections): Call mips_elf_estimate_stub_size, + mips_elf_lay_out_got and mips_elf_lay_out_lazy_stubs. Do not handle + the allocation of sreldyn specially. + (_bfd_mips_elf_hide_symbol): Delete. + +2008-08-07 Richard Sandiford + + * elfxx-mips.c (allocate_dynrelocs): Ignore indirect and warning + symbols. + +2008-08-06 Richard Sandiford + + * elfxx-mips.c (mips_elf_link_hash_entry): Move bfd_boolean + fields to the end of the structure and make them single-bit + bitfields. + (mips_elf_link_hash_newfunc): Make the initialization statements + follow the new field order. + +2008-08-06 Richard Sandiford + + * elfxx-mips.c (_mips_elf_section_data): Remove the "u.got_info" field. + (mips_elf_link_hash_table): Add "sgot" and "got_info" fields. + (_bfd_mips_elf_link_hash_table_create): Initialize them. + (mips_elf_got_section): Always apply the !maybe_excluded behavior. + (mips_elf_got_info): Delete. + (mips_elf_initialize_tls_slots): Remove the DYNOBJ local variable. + Adjust the call to mips_elf_got_section. + (mips_elf_local_got_index): Don't call mips_elf_got_info. + Update the call to mips_elf_create_local_got_entry. + Use htab->got_info. + (mips_elf_global_got_index): Don't call mips_elf_got_info; + use htab->got_info and htab->sgot instead. + (mips_elf_got_page): Don't call mips_elf_got_info. Update the + call to mips_elf_create_local_got_entry. + (mips_elf_got16_entry): Likewise. + (mips_elf_got_offset_from_index): Replace with DYNOBJ parameter + with an INFO parameter. Don't call mips_elf_got_info; use htab->sgot + and htab->got_info instead. + (mips_elf_create_local_got_entry): Remove the GG and SGOT parameters. + Use htab->sgot and htab->got_info. + (mips_elf_sort_hash_table): Remove the DYNOBJ local variable. + Don't call mips_elf_got_info; use htab->got_info instead. + (mips_elf_record_global_got_symbol): Turn G from a paramter to + a local variable and read it from htab->got_info. + (mips_elf_record_local_got_symbol): Replace the G parameter with + an INFO parameter. Make G a local variable and read it from + htab->got_info instead. + (mips_elf_record_got_page_entry): Likewise. + (mips_elf_multi_got): Remove the G parameter and make it a local + variable instead. Read it from htab->got_info. + (mips_elf_create_got_section): Cache the GOT section in htab->sgot. + Store the GOT information in htab->got_info. + (mips_elf_calculate_relocation): Don't call mips_elf_got_section + and mips_elf_got_info; use htab->sgot and htab->got_info instead. + Adjust the calls to mips_elf_got_offset_from_index and + mips_elf_adjust_gp. + (_bfd_mips_elf_check_relocs): Remove the G and SGOT local variables. + Adjust the calls to mips_elf_record_local_got_symbol, + mips_elf_record_global_got_symbol and mips_elf_record_got_page_entry. + Use htab->sgot. + (_bfd_mips_elf_always_size_sections): Remove the DYNOBJ local variable. + Don't call mips_elf_got_info; use htab->sgot and htab->got_info instead. + Update the call to mips_elf_multi_got. + (_bfd_mips_elf_size_dynamic_sections): Don't call mips_elf_got_info; + use htab->got_info instead. + (_bfd_mips_elf_finish_dynamic_symbol): Update the call to + mips_elf_got_section. Get the got_info from the hash table + rather than the GOT section. + (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. + (_bfd_mips_elf_finish_dynamic_sections): Likewise. + (_bfd_mips_elf_hide_symbol): Don't call mips_elf_got_section; + get the got_info from the hash table instead. Remove the GOT + local variable. + (_bfd_mips_elf_final_link): Likewise. Also remove the DYNOBJ + local variable. + +2008-08-06 Richard Sandiford + + * elfxx-mips.c (mips_elf_link_hash_table): Add an "sstubs" field. + (_bfd_mips_elf_create_dynamic_sections): Use it to cache the stubs + section. Don't check whether the section already exists. + (_bfd_mips_elf_adjust_dynamic_symbol): Use htab->sstubs. + (_bfd_mips_elf_finish_dynamic_symbol): Likewise. + (_bfd_mips_elf_finish_dynamic_sections): Likewise. + (_bfd_mips_elf_size_dynamic_sections): Likewise. Don't add the + dummy stub to an empty section. + (_bfd_mips_elf_link_hash_table_create): Initialize the "sstubs" field. + +2008-08-06 Richard Sandiford + + * reloc.c (BFD_RELOC_MIPS16_GOT16, BFD_RELOC_MIPS16_CALL16): Declare. + * libbfd.h, bfd-in2.h: Regenerate. + * elf32-mips.c (elf_mips16_howto_table_rel): Fill in reserved + R_MIPS16_GOT16 and R_MIPS16_CALL16 entries. + (mips16_reloc_map): Add mappings. + * elf64-mips.c (mips16_elf64_howto_table_rel): Fill in reserved + R_MIPS16_GOT16 and R_MIPS16_CALL16 entries. + (mips16_elf64_howto_table_rela): Likewise. + (mips16_reloc_map): Add mappings. + * elfn32-mips.c (elf_mips16_howto_table_rel): Fill in reserved + R_MIPS16_GOT16 and R_MIPS16_CALL16 entries. + (elf_mips16_howto_table_rela): Likewise. + (mips16_reloc_map): Add mappings. + * elfxx-mips.c (mips_elf_create_shadow_symbol): New function. + (section_allows_mips16_refs_p): Likewise. + (mips16_stub_symndx): Likewise. + (mips_elf_check_mips16_stubs): Treat the data argument as a + bfd_link_info. Mark every dynamic symbol as needing MIPS16 stubs + and create a "shadow" symbol for the original MIPS16 definition. + (mips16_reloc_p, got16_reloc_p, call16_reloc_p, hi16_reloc_p) + (lo16_reloc_p, mips16_call_reloc_p): New functions. + (_bfd_mips16_elf_reloc_unshuffle): Use mips16_reloc_p to generalize + relocation checks. + (_bfd_mips16_elf_reloc_shuffle): Likewise. + (_bfd_mips_elf_lo16_reloc): Handle R_MIPS16_GOT16. + (mips_elf_got16_entry): Add comment. + (mips_elf_calculate_relocation): Use hi16_reloc_p, + lo16_reloc_p, mips16_call_reloc_p, call16_reloc_p and got16_reloc_p + to generalize relocation checks. Use section_allows_mips16_refs_p + instead of mips16_stub_section_p. Handle R_MIPS16_CALL16 and + R_MIPS16_GOT16, allowing the former to refer directly to a + MIPS16 function if its stub is not needed. + (mips16_stub_section_p): Delete. + (_bfd_mips_elf_symbol_processing): Convert odd-valued function + symbols into even MIPS16 symbols. + (mips_elf_add_lo16_rel_addend): Use mips16_reloc_p to generalize + a relocation check. + (_bfd_mips_elf_check_relocs): Calculate "bed" and "rel_end" + earlier in the function. Use mips16_stub_symndx to identify + the target function. Avoid out-of-bounds accesses when the + stub has no relocations; report an error instead. Use + section_allows_mips16_refs_p instead of mips16_stub_section_p. + Use mips16_call_reloc_p and got16_reloc_p to generalize relocation + checks. Handle R_MIPS16_CALL16 and R_MIPS16_GOT16. Don't create + dynamic relocations for absolute references to __gnu_local_gp. + (_bfd_mips_elf_always_size_sections): Pass a bfd_link_info as + the argument to mips_elf_check_mips16_stubs. Generalize comment. + (_bfd_mips_elf_relocate_section): Use hi16_reloc_p and got16_reloc_p + to generalize relocation checks. + (_bfd_mips_elf_finish_dynamic_symbol): If a dynamic MIPS16 function + symbol has a non-MIPS16 stub, redirect the symbol to the stub. + Fix an overly long line. Don't give dynamic symbols type STO_MIPS16. + (_bfd_mips_elf_gc_sweep_hook): Handle R_MIPS16_CALL16 and + R_MIPS16_GOT16. + +2008-08-06 Alan Modra + + * elf32-ppc.c (ppc_elf_relax_section): Clear R_PPC_PLTREL24 addend. + (ppc_elf_relocate_section ): Don't bother here. + +2008-08-05 Alan Modra + Jaka Močnik + + * coffcode.h (coff_slurp_line_table): bfd_alloc lineno_cache first + so that we don't inadvertently free it. Use bfd_alloc for sort + arrays, and memcpy sorted line table. + +2008-08-04 Alan Modra + + * elf32-spu.c (spu_elf_auto_overlay): Use the maximum possible + if --fixed-space request is too large. + +2008-08-04 Alan Modra + + * Makefile.am (SRC-POTFILES.in, BLD-POTFILES.in): Set LC_ALL=C. + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2008-08-02 Alan Modra + + * elf32-spu.c (mark_overlay_section): Move code calculating + max_overlay_size to correct block. + (spu_elf_auto_overlay): Don't use %x in einfo error message. + +2008-08-01 Alan Modra + Jan Kratochvil + + * elfcore.h (elf_core_file_p): Ensure we have a backend match + with the correct arch size before rejecting the generic fallback. + * elfcode.h (elf_object_p): Likewise. Ensure arch size matches + before accepting a target. + +2008-08-01 Alan Modra + + PR 6774 + * elf.c (rewrite_elf_program_header): Don't wrap p_paddr to + include file or program headers. + +2008-07-30 Alan Modra + + * coff-ppc.c, coffgen.c, ecoff.c, ecofflink.c, elf.c, elf32-frv.c, + elf32-iq2000.c, elf32-m32c.c, elf32-mep.c, elf32-mt.c, + elf32-sh-symbian.c, elf64-hppa.c, mach-o.c, peXXigen.c, pef.c, + ppcboot.c, vms-misc.c, xsym.c: Silence gcc warnings. + +2008-07-28 Daniel Jacobowitz + + * elfxx-mips.c (mips_elf_calculate_relocation): Avoid generating + relocations for undefined weak symbols with non-default visibility. + (_bfd_mips_elf_check_relocs): Use possibly_dynamic_relocs for + global symbols in shared libraries. + (allocate_dynrelocs): New function. + (_bfd_mips_elf_adjust_dynamic_symbol): Do not handle + possibly_dynamic_relocs here. + (_bfd_mips_elf_size_dynamic_sections): Call allocate_dynrelocs. + +2008-07-28 Alexandre Oliva + + * elf32-i386.c (struct elf_i386_link_hash_table): Added field + tls_module_base. + (elf_i386_link_hash_table_create): Initialize it. + (elf_i386_always_size_sections): Set it. + (set_tls_module_base): New. + (elf_i386_relocate_sections): Call it. + * elf64-x86-64.c (struct elf64_x86_64_link_hash_table): Added + field tls_module_base. + (elf64_x86_64_link_hash_table_create): Initialize it. + (elf64_x86_64_always_size_sections): Set it. + (set_tls_module_base): New. + (elf64_x86_64_relocate_sections): Call it. + Reported by Cary Coutant + +2008-07-28 Ineiev + + * elf32-arm.c (arm_map_one_stub): Declare variables at beginning + of block. + * elf32-avr.c (get_local_syms): Likewise. + +2008-07-28 Alan Modra + + PR 6769 + * bfd-in.h (BFD_VMA_FMT): Define. + (printf_vma, sprintf_vma): Use the above. + (_bfd_int64_low, _bfd_int64_high): Delete. + * bfd-in2.h: Regenerate. + +2008-07-27 Alan Modra + + * elf.c (_bfd_elf_make_section_from_shdr): Ignore return from + elf_parse_notes. Use bfd_malloc_and_get_section. + (elf_parse_notes): Validate note namesz and descsz. + +2008-07-26 Michael Eager + + * elf32-ppc.c (ppc_elf_merge_obj_attributes): Check compatibility + between single-float, double-float, and soft-float. + +2008-07-24 Daniel Jacobowitz + + * elf32-mips.c (elf_backend_write_section): Define. + +2008-07-24 Nick Clifton + + * elf.c (_bfd_elf_map_sections_to_segments): Catch off by one + error assigning sections to segments. + +2008-07-22 Nick Clifton + + * elf.c (_bfd_elf_map_sections_to_segments): Allow sections in + adjoining pages to be included in the same segment. + +2008-07-22 Simon Baldwin + + * elflink.c (elf_link_output_extsym): Set st_size to zero for + symbols from dynamic libraries. + +2008-07-21 H.J. Lu + + PR ld/4424 + * elflink.c (_bfd_elf_merge_symbol): Call bed->relocs_compatible + to check if 2 inputs are compatible. + +2008-07-21 Sterling Augustine + + * elf.c (assign_file_positions_for_load_sections): Print vma in + error message about overlapping section vmas. + +2008-07-21 H.J. Lu + + PR ld/6747 + * elf32-frv.c (elf32_frv_relocate_section): Revert the change + for PR ld/6446 checked in by accident on May 21, 2008. + +2008-07-21 Nick Clifton + + * coff-sh.c (bfd_pe_print_pdata): Define to NULL for non + COFF_WITH_PE based SH ports. + * libpei.h (_bfd_XX_print_ce_compressed_pdata): Prototype. + * arm-wince-pe.c (bfd_pe_print_pdata): Use + _bfd_pe_print_ce_compressed_pdata. + (slurp_symcache, cleanup_syms, pe_print_ce_compressed_pdata): Move + to... + * peXXigen.c: ... here and rename pe_print_ce_compressed_pdata to + _bfd_XX_print_ce_compressed_pdata. + +2008-07-21 Alan Modra + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Drop + unwanted zero terminators. + +2008-07-21 Alan Modra + + * elf32-spu.c (spu_elf_relocate_section): Expand + RELOC_FOR_GLOBAL_SYMBOL. Don't warn about undefined symbols for + R_SPU_PPU32 and R_SPU_PPU64 relocations. + +2008-07-21 Luis Machado + + * elf-bfd.h: Declare elfcore_write_ppc_vsx. + * elf.c (elfcore_grok_ppc_vsx): New function. + (elfcore_write_ppc_vsx): New function + (elfcore_grok_note): Handle VSX notes. + (elfcore_write_register_note): Handle VSX notes. + +2008-07-18 Joseph Myers + + * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add new parameter. + * bfd-in2.h: Regenerate. + * elf32-arm.c (struct elf_arm_obj_tdata): Add field + no_wchar_size_warning. + (bfd_elf32_arm_set_target_relocs): Add new parameter + no_wchar_warn. + (elf32_arm_merge_eabi_attributes): Give a warning, not an error, + for conflicting wchar_t attributes. Do not warn if + --no-wchar-size-warning. Make diagnostic text more specific. + +2008-07-18 H.J. Lu + + PR ld/6748 + * elf32-arm.c (elf32_arm_link_hash_table_create): Initialize + new fields added for ARM long call support. + +2008-07-18 Danny Backx + + * pe-arm-wince.c (pe_print_compressed_pdata): Define new function to + print compressed pdata structure as described on MSDN. This only + applies to a limited set of architectures (ARM, SH4). + (slurp_symtab, my_symbol_for_address): Define static helper + functions for pe_print_compressed_pdata. + * coffcode.h (bfd_coff_backend_data): Add _bfd_coff_print_pdata field. + (bfd_coff_have_print_pdata, bfd_coff_print_pdata): Define. + * bfd/peXXigen.c (_bfd_XX_print_private_bfd_data_common): Add check on + bfd_coff_backend_data, call the function if non-null. + * pei-mcore.c: Add target dependent initialisation for + bfd_coff_backend_data. + * coff-sh.c: Likewise. + * coff64-rs6000.c: Likewise. + * coff-rs6000.c: Likewise. + * libcoff-in.h: Likewise. + * cf-i386lynx.c: Likewise. + * coff-alpha.c: Likewise. + * coff-apollo.c: Likewise. + * coff-arm.c: Likewise. + * coff-aux.c: Likewise. + * coff-h8300.c: Likewise. + * coff-h8500.c: Likewise. + * coff-i386.c: Likewise. + * coff-i860.c: Likewise. + * coff-i960.c: Likewise. + * coff-ia64.c: Likewise. + * coff-m68k.c: Likewise. + * coff-m88k.c: Likewise. + * coff-maxq.c: Likewise. + * coff-mips.c: Likewise. + * coff-or32.c: Likewise. + * coff-sparc.c: Likewise. + * coff-tic30.c: Likewise. + * coff-tic4x.c: Likewise. + * coff-tic54x.c: Likewise. + * coff-tic80.c: Likewise. + * coff-w65.c: Likewise. + * coff-we32k.c: Likewise. + * coff-x86_64.c: Likewise. + * coff-z80.c: Likewise. + * coff-z8k.c: Likewise. + * pe-mcore.c: Likewise. + * pe-mips.c: Likewise. + * pe-ppc.c: Likewise. + * peXXigen.c: Likewise. + * pei-ppc.c: Likewise. + * libcoff.h: Regenerate. + +2008-07-16 Bernd Schmidt + + * elf32-bfin.c (bfin_check_relocs, bfin_relocate_section, + bfin_final_link_relocate, bfin_gc_mark_hook, bfin_gc_sweep_hook, + ELF_DYNAMIC_INTERPRETER, DEFAULT_STACK_SIZE, + struct _bfinfdpic_dynamic_got_info): Moved around to keep FD-PIC code + separate from non-FD-PIC. + +2008-07-14 DJ Delorie + + * elf-m10300.c (mn10300_elf_final_link_relocate): Correct overflow + checks for PCREL8, PCREL16, GOTPC16, GOTOFF16, PLT16, and GOT16 + relocs. + (mn10300_elf_relax_section): Correct jump offset check when target + is in a different section. + +2008-07-15 Jie Zhang + + * elf32-bfin.c (elf32_bfin_special_sections[]): New. + (elf_backend_special_sections): Define. + +2008-07-13 Craig Silverstein + + PR binutils/6743 + * dwarf2.c (struct dwarf2_debug): New variable info_ptr_memory. + (find_line): Use info_ptr_memory instead of sec_info_ptr. + (_bfd_dwarf2_cleanup_debug_info): Likewise. + +2008-07-12 Jie Zhang + + Revert + 2008-07-12 Jie Zhang + * elf.c (_bfd_elf_map_sections_to_segments): Don't put + executable sections into the same segment with other + read only sections if --sep-code. + * elf32-bfin.c (elf32_bfin_code_in_l1): New variable. + (elf32_bfin_data_in_l1): New variable. + (elf32_bfin_final_write_processing): New. + (elf32_bfin_special_sections[]): New. + (elf_backend_final_write_processing): Define. + (elf_backend_special_sections): Define. + +2008-07-12 Jie Zhang + + * elf.c (_bfd_elf_map_sections_to_segments): Don't put + executable sections into the same segment with other + read only sections if --sep-code. + * elf32-bfin.c (elf32_bfin_code_in_l1): New variable. + (elf32_bfin_data_in_l1): New variable. + (elf32_bfin_final_write_processing): New. + (elf32_bfin_special_sections[]): New. + (elf_backend_final_write_processing): Define. + (elf_backend_special_sections): Define. + +2008-07-11 Andreas Schwab + + * dwarf2.c (read_section): Take pointer to bfd_size_type instead + of unsigned long as last parameter. + (struct dwarf2_debug): Define dwarf_abbrev_size, dwarf_line_size, + dwarf_str_size and dwarf_ranges_size as bfd_size_type instead of + unsigned long. + +2008-07-10 Richard Sandiford + + * elfxx-mips.c (mips_elf_calculate_relocation): Calculate GP and GP0 + for all relocation types. Allow any type of relocation to refer to + __gnu_local_gp. + +2008-07-10 Richard Sandiford + + * elfxx-mips.c (mips_elf_check_mips16_stubs): Use ELF_ST_IS_MIPS16. + (mips_elf_calculate_relocation): Likewise. + (_bfd_mips_elf_add_symbol_hook): Likewise. + (_bfd_mips_elf_finish_dynamic_symbol): Likewise. + (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. + +2008-07-10 Andreas Schwab + + * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Add missing + paren. + +2008-07-09 Craig Silverstein + + * Makefile.am (BFD32_LIBS): Add compress.lo. + (BFD32_LIBS_CFILES): Add compress.c. + (BFD_H_FILES): Likewise. + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * config.in: Add HAVE_ZLIB_H + * configure.in: Add test for libz and zlib.h + * configure: Regenerate. + * dwarf2.c (read_section): New function. + (read_indirect_string): Call new function read_section. + (read_abbrevs): Likewise. + (decode_line_info): Likewise. + (read_debug_ranges): Likewise. + (find_line): Call new function read_section when just one + .zdebug_info section is found, otherwise read and compress + multiple sections. + (_bfd_dwarf2_cleanup_debug_info): Free sec_info_ptr. + * elf.c (_bfd_elf_make_section_from_shdr): Add zdebug prefix. + (special_sections_z): New struct. + (special_sections): Refer to special_sections_z. + * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Recognize + sections named .zdebug_*. + (_bfd_mips_elf_fake_sections): Likewise. + * compress.c: New file. + (bfd_uncompress_section_contents): New function. + +2008-07-07 Christophe Lyon + + * elf32-arm.c (arm_type_of_stub): Don't crash on local symbols in + the presence of a PLT. + +2008-07-07 Alan Modra + + * bfd.c (bfd_demangle): Always trim off bfd_get_symbol_leading_char. + +2008-07-02 Alan Modra + + * elf32-ppc.c (is_pic_glink_stub): New function. + (ppc_elf_get_synthetic_symtab): Don't generate symbols when + multiple shared/pie stubs per plt entry. + +2008-06-30 Richard Sandiford + + * elf.c (_bfd_elf_get_synthetic_symtab): Increment p by + bed->s->int_rels_per_ext_rel. + +2008-06-30 Richard Sandiford + + * syms.c (BSF_SYNTHETIC): New flag. + * elf.c (_bfd_elf_get_synthetic_symtab): Set it. + * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Likewise. + * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise. + * bfd-in.h (bfd_asymbol_flavour): Return bfd_target_unknown_flavour + for synthetic symbols. + * bfd-in2.h: Regenerate. + +2008-06-30 Daniel Jacobowitz + + * elf32-arm.c (record_arm_to_thumb_glue, record_thumb_to_arm_glue): + Expand comments. + (arm_map_one_stub): Use | 1 when setting the low bit. + +2008-06-29 Andreas Schwab + + * elf32-m68k.c (elf_m68k_relocate_section): Don't ignore existing + addend on _GLOBAL_OFFSET_TABLE_. + +2008-06-24 Daniel Jacobowitz + + * elf32-arm.c (STUB_ENTRY_NAME): Define. + (arm_thumb_thumb_long_branch_stub): Use bx instead of b.n. + (arm_pic_long_branch_stub): Mention R_ARM_REL32 instead of + R_ARM_ABS32. + (struct elf32_arm_stub_hash_entry): Add output_name. + (arm_build_one_stub): Move offsets into the offset argument + of _bfd_final_link_relocate. Correct offset for + arm_thumb_arm_v4t_stub_long_branch. + (elf32_arm_size_stubs): Set stub_entry->output_name. + (elf32_arm_ouput_plt_map_sym): Rename to elf32_arm_output_map_sym. + Update all callers. + (elf32_arm_output_stub_sym): New. + (arm_map_one_stub): Correct formatting. Use elf32_arm_output_stub_sym. + +2008-06-20 Alan Modra + + * elf32-spu.c (needs_ovl_stub): Correctly return nonovl_stub for + non-branch insns. + +2008-06-20 Alan Modra + + * elf32-spu.c (build_stub): Allow wraparound on stub branches. + (allocate_spuear_stubs, build_spuear_stubs): Return value from + count_stub/build_stub. + (spu_elf_build_stubs): Correct location of stub reloc error message. + +2008-06-18 M R Swami Reddy + + * elf32-cr16.c (ELF_MACHINE_ALT1): Define to EM_CR16_OLD. + +2008-06-17 Ralf Wildenhues + + * configure: Regenerate. + +2008-06-17 Alan Modra + + * elf32-spu.c (struct spu_link_hash_table): Add extra_stack_space. + (spu_elf_check_vma): Add extra_stack_space param, copy to htab. + (spu_elf_auto_overlay): Use it. + (RECURSE_UNMARK): Define as 0. + (unmark_overlay_section): Heed RECURSE_UNMARK. + * elf32-spu.h (spu_elf_check_vma): Update prototype. + +2008-06-12 DJ Delorie + + * elf32-m32c.c (ELF_MACHINE_ALT1): Define as EM_M32C_OLD. + +2008-06-09 Paul Brook + + bfd/ + * elf32-arm.c (elf32_arm_merge_private_bfd_data): Allow BE8 shared + libraries. + +2008-06-09 Christophe Lyon + + * elf32-arm.c (arm_stub_is_thumb): Define. + (elf32_arm_final_link_relocate): Handle near mode switching stubs. + +2008-06-07 Alan Modra + + * elf32-spu.c (spu_elf_auto_overlay): Add valid area below sp + to stack calculation. + +2008-06-06 Paul Brook + + bfd/ + * elf32-arm.c (elf32_arm_merge_private_bfd_data): Reject BE8 input. + +2008-06-06 Alan Modra + + * elf32-spu.c (spu_elf_auto_overlay): Relax requirement that + file names be unique. Specify archive:path in overlay script. + +2008-06-05 Alan Modra + + PR ld/6590 + * elf64-ppc.c (ppc_build_one_stub): Correct reloc offsets. + +2008-06-04 Alan Modra + + * elf.c (ignore_section_sym): Don't test section sym value here. + (elf_map_symbols): Instead check zero value here as was done prior + to 2006-05-26 change. + +2008-06-04 Nick Clifton + + PR ld/6019 + * elf32-avr.c (elf32_avr_relax_section): Handle the case where + there are no local symbols. + +2008-06-04 Alan Modra + + * elf32-spu.c (get_sym_h): Don't attempt to read global syms. + (process_stubs): Likewise. + (discover_functions): Don't used cached symbols. + (maybe_insert_function): Correct condition under which function + array is realloc'd. + (mark_functions_via_relocs): Delete unused variable. + +2008-05-30 Frediano Ziglio + Nick Clifton + + PR ld/6511 + * elf64-hppa.c (allocate_global_data_opd): Default to using the + dynamic symbol table for local function names in shared libraries. + +2008-05-29 Jan Kratochvil + + * elf.c (assign_file_positions_for_load_sections): Adjust pre-section + gaps based on VMA and P_VADDR instead of LMA and P_PADDR addresses. + +2008-05-28 Alan Modra + + * elf32-spu.c (spu_elf_object_p): New function. + (elf_backend_object_p): Define. + (build_stub): Correct second word of 8 byte overlay stubs. + (spu_elf_relocate_section): Formatting. + +2008-05-24 Carlos Eduardo Seo + + * elf.c (elfcore_write_register_note): New function. + * elf-bfd.h (elfcore_write_register_note): New prototype. + +2008-05-22 Christophe Lyon + + * elf32-arm.c (arm_type_of_stub): Ignore STT_SECTION symbols. + (elf32_arm_stub_add_mapping_symbol): Remove. + (elf32_arm_add_stub): Don't generate mapping symbols. Change + prototype. + (elf32_arm_size_stubs): Use new elf32_arm_add_stub + prototype. Don't generate thumb to arm glue for calls. + (arm_map_one_stub): Define. + (elf32_arm_output_arch_local_syms): Generate mapping symbols for + long calls stubs. + +2008-05-21 Nick Clifton + + * elf32-arm.c (group_sections): Reformat comments. + + PR ld/6446 + * elf32-frv.c (elf32_frv_relocate_section): Set EF_FRV_PIC by + default (for FDPIC). Clear it if any inter-segment relocations + are found. + + * elf64-hppa.c (elf64_hppa_finalize_opd): Check NULL return + from elf_link_hash_lookup. + +2008-05-21 Maxim Kuvyrkov + + Add multi-GOT support for m68k. + * elf32-m68k.c (struct elf_m68k_link_hash_entry: got_entry_key, + glist): New fields. + (struct elf_m68k_got_entry_key, struct elf_m68k_got_entry, + struct elf_m68k_got, struct elf_m68k_bfd2got_entry, + struct elf_m68k_multi_got): New data structures. + (struct elf_m68k_link_hash_table: local_gp_p, use_neg_got_offsets_p, + allow_multigot_p, multi_got_): New fields. + (elf_m68k_multi_got): New macro. + (elf_m68k_link_hash_newfunc): Initialize new fields of + struct elf_m68k_link_hash_entry. + (elf_m68k_link_hash_table_create): Initialize new fields of + struct elf_m68k_link_hash_table. + (elf_m68k_link_hash_table_free): New static function implementing hook. + (elf_m68k_init_got, elf_m68k_clear_got, elf_m68k_create_empty_got): New + static functions for struct elf_m68k_got. + (elf_m68k_init_got_entry_key, elf_m68k_got_entry_hash, + elf_m68k_got_entry_eq): New static functions for + struct elf_m68k_got_entry. + (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT, + ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): New macros. + (enum elf_m68k_get_entry_howto): New enum. + (elf_m68k_get_got_entry, elf_m68k_update_got_entry_type, + elf_m68k_remove_got_entry_type): New static functions for + struct elf_m68k_got_entry. + (elf_m68k_add_entry_to_got): New static function. + (elf_m68k_bfd2got_entry_hash, elf_m68k_bfd2got_entry_eq, + elf_m68k_bfd2got_entry_del, elf_m68k_get_bfd2got_entry): New static + functions for struct elf_m68k_bfd2got_entry. + (struct elf_m68k_can_merge_gots_arg, elf_m68k_can_merge_gots_1, + elf_m68k_can_merge_gots): New traversal. + (struct elf_m68k_merge_gots_arg, elf_m68k_merge_gots_1, + elf_m68k_merge_gots): Ditto. + (struct elf_m68k_finalize_got_offsets_arg, + elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Ditto. + (struct elf_m68k_partition_multi_got_arg, + elf_m68k_partition_multi_got_1, elf_m68k_init_symndx2h_1, + elf_m68k_partition_multi_got): Ditto. + (elf_m68k_find_got_entry_ptr, elf_m68k_remove_got_entry): New static + functions. + (elf_m68k_copy_indirect_symbol): New static function implementing + a hook. + (elf_m68k_check_relocs): Update to add entries to multi-GOT. + (elf_m68k_gc_sweep_hook): Update to remove entries from multi-GOT. + (elf_m68k_always_size_sections): Assign BFDs to GOTs. + (elf_m68k_relocate_section): Update to properly handle GOT relocations. + (elf_m68k_finish_dynamic_symbol): Update to traverse all GOT entries + of a global symbol. + (bfd_elf_m68k_set_target_options): New function. + (bfd_elf32_bfd_link_hash_table_free): Define hook. + (bfd_elf32_bfd_final_link): Change expansion to bfd_elf_final_link + to skip generic calculation of GOT offsets. + (elf_backend_copy_indirect_symbol): Define hook. + * bfd-in.h (bfd_elf_m68k_set_target_options): Declare function. + * bfd-in2.h: Regenerate. + +2008-05-21 André Johansen + + PR 868 + * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free memory allocated + for filenames in function tables and variable tables. + +2008-05-19 Alan Modra + + PR 2995, PR 6473 + * elf.c (_bfd_elf_make_section_from_shdr): Leave lma equal to + vma when all p_paddr fields are zero and there is more than + one PT_LOAD header. + +2008-05-15 Christophe Lyon + + Add long call support for ARM. + * elf32-arm.c (THM2_MAX_FWD_BRANCH_OFFSET): Define. + (THM2_MAX_BWD_BRANCH_OFFSET): Define. + (ARM_MAX_FWD_BRANCH_OFFSET): Define. + (ARM_MAX_BWD_BRANCH_OFFSET): Define. + (THM_MAX_FWD_BRANCH_OFFSET): Define. + (THM_MAX_BWD_BRANCH_OFFSET): Define. + (arm_long_branch_stub): Define. + (arm_pic_long_branch_stub): Define. + (arm_thumb_v4t_long_branch_stub): Define. + (arm_thumb_thumb_long_branch_stub): Define. + (arm_thumb_arm_v4t_long_branch_stub): Define. + (STUB_SUFFIX): Define. + (elf32_arm_stub_type): Define. + (elf32_arm_stub_hash_entry): Define. + (elf32_arm_link_hash_entry): Add stub_cache field. + (arm_stub_hash_lookup): Define. + (elf32_arm_link_hash_table): Add stub_hash_table, stub_bfd, + add_stub_section, layout_sections_again, stub_group, bfd_count, + top_index, input_list fields. + (elf32_arm_link_hash_newfunc): Init new field. + (stub_hash_newfunc): New function. + (elf32_arm_link_hash_table_create): Init stub_hash_table. + (elf32_arm_hash_table_free): New function. + (arm_type_of_stub): New function. + (elf32_arm_stub_name): New function. + (elf32_arm_get_stub_entry): New function. + (elf32_arm_stub_add_mapping_symbol): New function. + (elf32_arm_add_stub): New function. + (arm_build_one_stub): New function. + (arm_size_one_stub): New function. + (elf32_arm_setup_section_lists): New function. + (elf32_arm_next_input_section): New function. + (group_sections): New function. + (elf32_arm_size_stubs): New function. + (elf32_arm_build_stubs): New function. + (bfd_elf32_arm_add_glue_sections_to_bfd): Skip stub sections. + (bfd_elf32_arm_process_before_allocation): No longer handle + R_ARM_CALL and R_ARM_THM_CALL. + (using_thumb_only): New function. + (elf32_arm_final_link_relocate): Redirect calls to stub if range + exceeds encoding capabilities. + (bfd_elf32_bfd_link_hash_table_free): Define. + * bfd-in.h (R_ARM_max): Fix value to 130. + (elf32_arm_setup_section_lists): Protype. + (elf32_arm_next_input_section): Protype. + (elf32_arm_size_stubs): Protype. + (elf32_arm_build_stubs): Protype. + * bfd-in2.h: Regenerate. + +2008-05-14 Ulrich Weigand + + * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Fix memset calls. + * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise. + +2008-05-14 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2008-05-14 Ulrich Weigand + Alan Modra + + * elf32-ppc.c (section_covers_vma): New function. + (ppc_elf_get_synthetic_symtab): New function. + (bfd_elf32_get_synthetic_symtab): Define. + * elf64-ppc.c (section_covers_vma): New function. + (ppc64_elf_get_synthetic_symtab): Generate sym@plt on glink branch + table entries, and __glink_PLTresolve on resolver stub. + (ppc64_elf_build_stubs): Rename __glink sym to __glink_PLTresolve. + +2008-05-12 Alan Modra + + PR 6443 + * elf32-ppc.c (MUST_BE_DYN_RELOC): Delete. + (must_be_dyn_reloc): New function. + (ppc_elf_check_relocs): Don't set DF_STATIC_TLS for tprel relocs + in pies. + (ppc_elf_tls_optimize): Optimise pies. + (ppc_elf_relocate_section): Use a section symbol rather than no + symbol if possible for LD->IE TLS sequence, but don't error if + we must use no symbol. + * elf64-ppc.c (MUST_BE_DYN_RELOC): As for elf32-ppc.c. + (must_be_dyn_reloc): Likewise. + (ppc64_elf_check_relocs): Likewise. + (ppc64_elf_tls_optimize): Likewise. + (ppc64_elf_relocate_section): Likewise. + +2008-05-12 Alan Modra + + * elf32-spu.c (spu_elf_relocate_section): Rename is_ea to is_ea_sym. + +2008-05-10 Paul Pluzhnikov + + * elfcore.h (elf_core_file_p): Warn about core truncation. + +2008-05-07 Bob Wilson + + * elf32-xtensa.c (xtensa_property_section_name): New. + (xtensa_make_property_section): New. + (xtensa_get_property_section): Make static. Do not create a new + section if it does not exist. + +2008-05-08 Alan Modra + + * elf32-spu.c (spu_elf_special_sections): Add "._ea". + (spu_elf_relocate_section): Handle relocations against symbols + defined in ._ea specially. + +2008-05-03 Daniel Jacobowitz + + * elf32-arm.c (elf32_arm_symbian_link_hash_table_create): Use + ARRAY_SIZE. + (elf32_arm_symbian_plt_sym_val): New. + (elf_backend_plt_sym_val): Define. + +2008-05-03 Alan Modra + + PR 2995, PR 6473 + * elf.c (rewrite_elf_program_header): Rather than clearing + p_paddr_valid at end, don't set it in the first place. Delete + comment no longer relevant. When not p_paddr_valid, don't set + paddr from vaddr, and don't set p_vaddr_offset. + +2008-05-01 Cary Coutant + + * elf.c (bfd_elf_get_str_section): Fix memory leak caused by + corrupt string table. + +2008-05-01 Joel Brobecker + + * cache.c (cache_bread_1): Renames cache_bread. + (cache_bread): New function. + +2008-05-01 Alan Modra + + PR 2995, PR 6473 + * elf.c (_bfd_elf_make_section_from_shdr): Always set lma from p_paddr. + (assign_file_positions_for_load_sections): Combine nested "if". + (copy_elf_program_header): Don't set p_paddr_valid or p_vaddr_offset + when all header p_paddr fields are zero. + +2008-04-30 Edmar Wienskoski + + * cpu-powerpc.c (bfd_powerpc_archs): Add e500mc entry. + +2008-04-29 Daniel Jacobowitz + + * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound) + (_bfd_elf_canonicalize_dynamic_reloc): Find dynamic relocations + even if they are not loaded. + * elflink.c (_bfd_elf_init_2_index_sections): Set data_index_section + first. + +2008-04-25 Jay Foad + + * reloc16.c (bfd_coff_reloc16_get_value): Add support for + undefined weak symbols. + +2008-04-25 Nick Clifton + + * po/vi.po: Updated Vietnamese translation. + +2008-04-23 Paolo Bonzini + + * aclocal.m4: Regenerate. + * configure: Regenerate. + +2008-04-21 Cary Coutant + + * archive.c (_bfd_write_archive_contents): Fix incorrect use of + ARFMAG. + +2008-04-21 Nathan Sidwell + + * elfxx-mips.c (_bfd_mips_vxworks_adjust_dynamic_symbol): Don't + set the value of undefined symbols in shared objects. + (_bfd_mips_vxworks_finish_dynamic_symbol): Clear value for + undefined symbols unless pointer equality is needed. + +2008-04-18 Dennis Roberts + + * aix5ppc-core.c: Define macros for the default architecture and + machine for matching core files. + (xcoff64_core_p): Set the architecture and machine to the default + values defined in the macros mentioned above. + * rs6000-core.c: Define macros to determine whether or not the + core file header uses the core_dumpxx header format. + (rs6000coff_core_p): Don't match core files that use the + core_dumpxx header format. + +2008-04-16 Pedro Alves + + * config.bfd (i[3-7]86-*-dicos*, x86_64-*-dicos*): Add. + +2008-04-16 David S. Miller + + * reloc.c (BFD_RELOC_SPARC_GOTDATA_HIX22, + BFD_RELOC_SPARC_GOTDATA_LOX10, BFD_RELOC_SPARC_GOTDATA_OP_HIX22, + BFD_RELOC_SPARC_GOTDATA_OP_LOX10, BFD_RELOC_SPARC_GOTDATA_OP): New. + * libbfd.h: Regnerate. + * bfd-in2.h: Regenerate. + * elfxx-sparc.c (_bfd_sparc_elf_howto_table): Add entries for + GOTDATA relocations. + (sparc_reloc_map): Likewise. + (_bfd_sparc_elf_check_relocs): Handle R_SPARC_GOTDATA_* like + R_SPARC_GOT*. + (_bfd_sparc_elf_gc_sweep_hook): Likewise. + (_bfd_sparc_elf_relocate_section): Transform R_SPARC_GOTDATA_HIX22, + R_SPARC_GOTDATA_LOX10, R_SPARC_GOTDATA_OP_HIX22, and + R_SPARC_GOTDATA_OP_LOX10 into the equivalent R_SPARC_GOT* reloc. + Simply ignore R_SPARC_GOTDATA_OP relocations. + +2008-04-14 Aurelien Jarno + + * configure.in: Link with the PIC version of libiberty on + Linux/MIPS hosts. + * configure: Regenerate. + +2008-04-14 Edmar Wienskoski + + * archures.c: Add bfd_mach_ppc_e500mc. + * bfd-in2.h: Regenerate. + +2008-04-08 Alan Modra + + * elf32-spu.c (spu_elf_build_stubs): Correct error message. + (mark_functions_via_relocs): Remove premature init of symtab_hdr. + (collect_overlays): Commment typo fix. + +2008-04-08 Kees Cook + + * elflink.c (bfd_elf_size_dynamic_sections): Ignore GNU-stack note + in EXEC_P bfds. + +2008-04-08 Alan Modra + + * elf32-spu.c: Include libiberty.h. + (struct spu_link_hash_table): Add local_stire, overlay_fixed, reserved, + non_ovly_stub, spu_elf_load_ovl_mgr, spu_elf_open_overlay_script, + spu_elf_relink, auto_overlay fields. + (AUTO_OVERLAY, AUTO_RELINK, OVERLAY_RODATA): Define. + (needs_ovl_stub): Flip test so that call to non-function warning + is emitted during relocate_section rather than earlier. + (spu_elf_check_vma): Stash --auto-overlay parameters, and clear + auto_overlay if no section exceeds local store. + (struct call_info): Add count, max_depth, is_pasted fields. + (struct function_info): Add rodata, last_caller, call_count, + depth, new visit flags. + (insert_callee): Increment call count. + (copy_callee): New function. + (mark_functions_via_relocs): Investigate all reloc types to count + possible function pointer stubs for --auto-overlay. Track + last_caller and increment function call_count. + (pasted_function): Insert a "call" into call info for pasted section. + (remove_cycles): Track max depth of calls. Don't emit call graph + pruning warning for --auto-overlay. + (build_call_tree): Don't transfer_calls for --auto-overlay. + Adjust remove_cycles call. + (sort_calls, sort_lib, sort_bfds): New functions. + (struct _mos_param, struct _uos_param, struct _cl_param): New. + (mark_overlay_section, unmark_overlay_section): New functions. + (collect_lib_sectios, auto_ovl_lib_functions): New functions. + (collect_overlays, find_pasted_call): New functions. + (sum_stack): Deal with is_pasted "calls". Exit before printing + when --auto-overlay. + (spu_elf_auto_overlay): New function. + (spu_elf_final_link): Call spu_elf_auto_overlay. + * elf32-spu.h (spu_elf_check_vma): Update prototype. + +2008-04-07 Alan Modra + + * elf32-spu.c (allocate_spuear_stubs): Ensure _SPUEAR_ symbol + is defined in overlay section before creating a stub. + (build_spuear_stubs): Likewise. + (spu_elf_size_stubs, spu_elf_build_stubs): Adjust calls. + +2008-04-02 Alan Modra + + * elf32-spu.c (insert_callee): Reorder call list so most recent + call is always first. + (interesting_section): Move. + (mark_functions_via_relocs): Fold interesting_section and + reloc_count tests in callers to here. Simplify output section + owner test. + (discover_functions): Set "gaps" when no symbols and some + "interesting_section". Run pasted_function loop for no symbol + bfds. + (for_each_node, transfer_calls): New functions. + (mark_non_root): Adjust to suit for_each_node. + (call_graph_traverse): Likewise. Fix memory leak. Rename to.. + (remove_cycles): ..this. + (build_call_tree): Use for_each_node and transfer_calls. + (struct _sum_stack_param): New. + (sum_stack): Adjust to suit for_each_node. Return error on + malloc failure. Move code to print root node cumulative stack from.. + (spu_elf_stack_analysis): ..here. Use for_each_node. + +2008-03-31 Cary Coutant + + PR 6006 + * archive.c (_bfd_slurp_extended_name_table): Change + ARFMAG[0] to ARFMAG[1]. + (_bfd_construct_extended_name_table): Likewise. + +2008-03-31 Daniel Jacobowitz + + * elfxx-mips.c (mips_elf_record_got_page_entry): Update comment. + (_bfd_mips_elf_check_relocs): Update comments. Always call + mips_elf_record_got_page_entry for R_MIPS_GOT_PAGE. + +2008-03-27 Cary Coutant + + Add support for thin archives. + * archive.c (_bfd_find_nested_archive): New function. + (get_extended_arelt_filename): Add origin parameter. + (_bfd_generic_read_ar_hdr_mag): Deal with extended name + combined with a file offset. + (append_relative_path): New function. + (_bfd_get_elt_at_filepos): Deal with external members and + nested archives. + (bfd_generic_openr_next_archived_file): Thin archives. + (bfd_generic_archive_p): Recognize new magic string. + (adjust_relative_path): New function. + (_bfd_construct_extended_name_table): Construct extended + names for thin archive members. + (_bfd_write_archive_contents): Emit new magic string, skip + copying files for thin archives. + * bfd-in.h (bfd_is_thin_archive): New macro. + * bfd.c (struct bfd): New fields for thin archives. + * libbfd-in.h (struct areltdata): New field for thin archives. + * opncls.c (bfd_close): Delete BFDs for nested archives. + +2008-03-25 Bernd Schmidt + + * elf32-bfin.c (bfin_final_link_relocate): New function, wrapper around + _bfd_final_link_relocate that also handles R_pcrel24 relocs. + (bfinfdpic_relocate_section, bfin_relocate_section): Use it. + +2008-03-25 Nathan Sidwell + + * elf32-arm.c (elf32_arm_final_link_relocate): Skip dynamic relocs + in vxworks tls_vars sections. + (allocate_dynrelocs, elf32_arm_size_dynamic_sections): Likewise. + * elf32-i386.c (allocate_dynrelocs, + elf_i386_size_dynamic_sections, elf_i386_relocate_section): Likewise. + * elf32-ppc.c (allocate_dynrelocs, ppc_elf_size_dynamic_sections, + ppc_elf_relocate_section): Likewise. + * elf32-sh.c (allocate_dynrelocs, sh_elf_size_dynamic_sections, + sh_elf_relocate_section): Likewise. + * elfxx-sparc.c (allocate_dynrelocs, + _bfd_sparc_elf_size_dynamic_sections, + _bfd_sparc_elf_relocate_section): Likewise. + +2008-03-21 Adam Nemet + + * elf.c (_bfd_elf_print_private_bfd_data): Use bfd_fprintf_vma to + print the values from the dynamic section. + +2008-03-20 Richard Sandiford + + * elfxx-mips.c (MIPS_ELF_GNU_GOT1_MASK): New macro. + (_bfd_mips_elf_finish_dynamic_sections): Use it instead of 0x80000000. + +2008-03-20 Alan Modra + + * elf32-spu.c (spu_elf_create_sections): Remove output_bfd parameter. + (spu_elf_find_overlays, spu_elf_size_stubs): Likewise + (process_stubs, discover_functions, build_call_tree): Likewise. + (spu_elf_stack_analysis): Likewise. + (spu_elf_check_vma): Likewise. Move. + (struct call_info): Make "is_tail" a bitfield. + (insert_callee): Clear fun->start and set fun->is_func if we find + a non-tail call. + * elf32-spu.h (spu_elf_create_sections): Update prototype. + (spu_elf_find_overlays, spu_elf_size_stubs, spu_elf_check_vma): Ditto. + +2008-03-17 Ralf Wildenhues + + * aclocal.m4: Regenerate. + * configure: Likewise. + * Makefile.in: Likewise. + +2008-03-16 H.J. Lu + + PR ld/5789 + PR ld/5943 + * elf32-i386.c (elf_i386_relocate_section): Issue an error + for R_386_GOTOFF relocaton against undefined hidden/internal + symbols when building a shared object. + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Issue an + error for R_X86_64_PC8/R_X86_64_PC16/R_X86_64_PC32 + relocaton against undefined hidden/internal symbols when + building a shared object. + (elf64_x86_64_finish_dynamic_symbol): Return FALSE when symbol + is referenced locally, but isn't defined in a regular file. + +2008-03-15 H.J. Lu + + * bfd-in.h (BFD_NO_FLAGS, HAS_RELOC, EXEC_P, HAS_LINENO, + HAS_DEBUG, HAS_SYMS, HAS_LOCALS, DYNAMIC, WP_TEXT, D_PAGED, + BFD_IS_RELAXABLE, BFD_TRADITIONAL_FORMAT, BFD_IN_MEMORY, + HAS_LOAD_PAGE, BFD_LINKER_CREATED): Moved to ... + * bfd.c: Here. + + * bfd.c (bfd): Change cacheable, target_defaulted, opened_once, + mtime_set, no_export, output_has_begun and has_armap to bit + field. + + * bfd-in2.h: Regenerated. + +2008-03-14 Daniel Jacobowitz + + * cache.c (close_one): Remove mtime hack. + +2008-03-14 H.J. Lu + + PR ld/5913 + * elfxx-ia64.c (elfNN_ia64_tprel_base): Remove BFD_ASSERT. + (elfNN_ia64_dtprel_base): Likewise. + (elfNN_ia64_relocate_section): Go to missing_tls_sec if + tls_sec is NULL before calling elfNN_ia64_tprel_base or + elfNN_ia64_dtprel_base. Report unsupported TLS relocations. + +2008-03-14 Alan Modra + + * elf32-spu.c (process_stubs, spu_elf_relocate_section): Move + common code to.. + (maybe_needs_stub): ..here, a new function that also omits stubs + for .eh_frame, and.. + (needs_ovl_stub): ..here. Create stubs for labels in code section + referenced by switch jump table. + (spu_elf_find_overlays): Set htab->ovly_load and htab->ovly_return. + (enum _insn_type): Delete. + (enum _stub_type): New. + (count_stub, build_stub): Adjust. + (allocate_spuear_stubs, build_spuear_stubs): Adjust. + +2008-03-13 Alan Modra + + * elf.c (_bfd_elf_make_section_from_shdr): Remove unnecessary cast. + (_bfd_elf_assign_file_position_for_section): Simplify align. + (_bfd_elf_init_reloc_shdr): Ensure shift expression wide enough + for sh_addralign. + (elf_fake_sections, swap_out_syms): Likewise. + * elflink.c (bfd_elf_final_link): Likewise. + +2008-03-13 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2008-03-12 Bernd Schmidt + + From Jie Zhang + * elf32-bfin.c (struct bfinfdpic_relocs_info): Make got17m4, + gothilo, fd, fdgot17m4, fdgothilo, fdgoff17m4, fdgoffhilo, + gotoff, call and sym not bitfields. + (bfinfdpic_gc_sweep_hook): New function; update the relocation + information for the relocations of the section being removed. + (bfinfdpic_check_relocs): Accumulate the number of relocations + which set got17m4, gothilo, fd, fdgot17m4, fdgothilo, fdgoff17m4, + fdgoffhilo, gotoff, call and sym fields. + (elf_backend_gc_sweep_hook): Redefine for FD-PIC. + +2008-03-12 Alan Modra + + PR 5900 + * elf-bfd.h: Include elf/internal.h after elf/external.h. + * elfcode.h (elf_swap_symbol_in): Map reserved shndx range. + (elf_swap_symbol_out): Adjust SHN_XINDEX test. + (elf_swap_ehdr_out): Mask SHN_LORESERVE and SHN_XINDEX to values + seen in external structs. + (valid_section_index_p): Delete. + (elf_object_p): Don't increment section numbers over reserved range. + Simplify test for valid sh_link, sh_info and e_shstrndx fields. + (elf_write_shdrs_and_ehdr): Mask SHN_LORESERVE and SHN_XINDEX to values + seen in external structs. Don't increment section numbers over + reserved range. + * elf.c (bfd_elf_sym_name): Remove redundant tests on st_shndx. + (bfd_section_from_shdr): Likewise. + (group_signature): Range check before accessing elf_elfsections. + (_bfd_elf_setup_sections): Likewise. + (bfd_section_from_shdr): Likewise. + (bfd_section_from_shdr): Don't increment section number over + reserved sections. + (assign_file_positions_for_non_load_sections): Likewise. + (assign_file_positions_except_relocs): Likewise. + (_bfd_elf_write_object_contents): Likewise. + (assign_section_numbers): Likewise. Adjust for changed SHN_*. + (prep_headers): Delete unused variable. + * elflink.c (bfd_elf_link_record_local_dynamic_symbol): Adjust + for changed SHN_* values. + (check_dynsym, elf_link_input_bfd): Likewise. + (bfd_elf_final_link): Likewise. Don't skip over reserved section + range. + (elf_fixup_link_order): Check that sh_link field is valid. + * elf-hppa.h (elf_hppa_add_symbol_hook): Make "index" unsigned. + * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Range check before + accesssing elf_elfsections. + * elf32-avr.c (elf32_avr_size_stubs): Likewise. + * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. + * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Likewise. + * elf64-hppa.c (elf64_hppa_check_relocs): Adjust for changed + SHN_* defines. Test for SHN_BAD return from + _bfd_elf_section_from_bfd_section + +2008-03-12 Alan Modra + + * elf-bfd.h (_bfd_elf_section_from_bfd_section): Update prototype. + * elf.c (_bfd_elf_section_from_bfd_section): Return unsigned int, + SHN_BAD on error. + (_bfd_elf_print_private_bfd_data): Test for SHN_BAD result from + _bfd_elf_section_from_bfd_section, not -1. + (swap_out_syms): Likewise. + * elflink.c (elf_link_add_object_symbols): Likewise. + (bfd_elf_get_bfd_needed_list): Likewise. + (bfd_elf_match_symbols_in_sections): Likewise. + (elf_link_add_object_symbols): Don't bother testing for symbols + using normal sections before calling bfd_section_from_elf_index. + (elf_link_input_bfd, bfd_elf_final_link): Likewise. + (bfd_elf_reloc_symbol_deleted_p): Likewise. + * elfcode.h (elf_slurp_symbol_table): Likewise. + * elf32-spu.c (get_sym_h): Likewise. + * elf32-xtensa.c (get_elf_r_symndx_section): Likewise. + * elf64-ppc.c (opd_entry_value, get_sym_h, ppc64_elf_edit_toc): Ditto. + * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise. + +2008-03-11 Alan Modra + + * elf32-spu.c (spu_elf_relocate_section): Test identical conditions + to those in process_stubs for overlay symbols. + +2008-03-09 Paul Brook + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle new + Tag_VFP_arch values. + +2008-03-08 Paul Brook + + * elf32-arm.c (insert_thumb_branch): Rewrite. + (elf32_thumb_to_arm_stub): Use new insert_thumb_branch. + +2008-03-07 Paul Brook + + * elf32-arm.c (elf32_arm_howto_table_1): Fix bitmasks for MOVW and + MOVT relocations. + (elf32_arm_final_link_relocate): Fix off by one MOVW/MOVT sign + extension. + (elf32_arm_relocate_section): Handle MOVW and MOVT + relocations. Improve safety check for other weird relocations. + (elf32_arm_check_relocs): Only set h->needs_plt for branch/call + relocations. + +2008-03-03 Bob Wilson + + * xtensa-isa.c (xtensa_isa_num_pipe_stages): Make max_stage static and + only compute its value once. + +2008-03-03 Alan Modra + + * elf32-spu.c (struct got_entry): Add "addend" field. + (count_stub, build_stub): Use a new stub if relocation addend + differs from existing stubs for this symbol. + (process_stubs): Deal with addends. + (spu_elf_relocate_section, spu_elf_output_symbol_hook): Likewise. + +2008-03-02 H.J. Lu + + PR ld/5789 + * elflink.c (_bfd_elf_symbol_refs_local_p): Always return true + for hidden and local symbols. + +2008-03-03 Alan Modra + + * elf32-ppc.c (allocate_dynrelocs): Discard relocs on + undefined symbols with internal or hidden visibility. + (ppc_elf_relocate_section): Likewise. Use SYMBOL_CALLS_LOCAL + rather than SYMBOL_REFERENCES_LOCAL on branches. Don't + return immediately on dynamic reloc error. + +2008-03-01 Alan Modra + + * elf64-ppc.c (build_plt_stub): Add relocs on plt call stubs + if emitrelocations. + (get_relocs): New function, split out from.. + (ppc_build_one_stub): ..here. Add relocs on plt_branch stubs if + emitrelocations. Remove indx temp. + (ppc_size_one_stub): Count new stub relocs. + (ppc64_elf_size_stubs): Count new glink reloc. + (ppc64_elf_build_stubs): Emit glink reloc if emitrelocations. + (ppc64_elf_finish_dynamic_sections): Output glink relocs. + * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Describe non-pic + glink code. + +2008-02-28 Alan Modra + + * elf32-spu.c (mark_functions_via_relocs): Don't assume that + the "->start" pointer reaches to function origin, so that we + can handle functions split over more than two sections. + (build_call_tree): Likewise. + (pasted_function): Don't attempt to set fun->start back to the + function origin, just go back one section. + +2008-02-27 Catherine Moore + + * elf.c ( _bfd_elf_print_private_bfd_data): Call + elf_backend_get_target_dtag if defined. + * elf32-mips.c (elf_backend_get_target_dtag): Define. + * elf64-mips.c: Likewise. + * elfn32-mips.c: Likewise. + * elfxx-mips.c (_bfd_mips_elf_get_target_dtag): New. + * elfxx-mips.h (_bfd_mips_elf_get_target_dtag): Declare. + * elf-bfd.h (elf_backend_get_target_dtag): Add prototype. + * elfxx-target.h (elf_backend_get_target_dtag): Add default. + (elf_backend_data): Add elf_backend_get_target_dtag. + +2008-02-26 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Set pointer_equality_needed + for R_PPC_REL32 syms. Don't set non_got_ref on branch reloc syms, + and assume branch relocs are not dynamic when non-shared. + (readonly_dynrelocs): New function, split out from.. + (maybe_set_textrel): ..here, renamed from old readonly_dynrelocs. + (ppc_elf_adjust_dynamic_symbol): For symbols generating plt entries, + clear non_got_ref.. + (allocate_dynrelocs): ..and don't set u.def for undefined weak. + Do allow dynamic relocs on undefined symbols. + (ppc_elf_adjust_dynamic_symbol): Use readonly_dynrelocs. + (ppc_elf_relocate_section): Mirror dynamic reloc changes in + check_relocs. + (ppc_elf_finish_dynamic_symbol): Don't give a warning on weak + plt symbols needing pointer_equality_needed. + +2008-02-23 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Revert non_got_ref change. + +2008-02-23 Alan Modra + + * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Copy + pointer_equality_needed. + (ppc_elf_check_relocs): Split out non-branch relocs from others + that might emit dynamic relocs. Set pointer_equality_needed + for their symbols. Don't set non_got_ref on branch reloc symbols. + (ppc_elf_hash_symbol): New function. + (elf_backend_hash_symbol): Define. + (ppc_elf_finish_dynamic_symbol): Handle pointer_equality_needed. + Error if pointer_equality_needed on weak plt symbol. + +2008-02-22 H.J. Lu + + PR ld/5788 + * elflink.c (elf_create_symbuf): Correct buffer size and + position. + +2008-02-22 Nick Clifton + + PR 868 + * dwarf2.c: Revert previous patch. All of the allocate memory is + on an obstack which will be freed at some other time. + +2008-02-20 Nick Clifton + + PR 868 + * libbfd.c (bfd_realloc_or_free): New function. Performs like + bfd_realloc, but if the (re)allocation fails, the pointer is + freed. + * libbfd-in.h: Prototype. + * libbfd.h: Regenerate. + * bfdio.c (bfd_bwrite): Use the new function. + (bfd_seek): Likewise. + * bfdwin.c:(bfd_get_file_window): Likewise. + * elf-strtab.c (_bfd_elf_strtab_add): Likewise. + * elf32-ppc.c (ppc_elf_relax_section): Likewise. + * elf32-xtensa.c (vsprintf_msg): Likewise. + * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise. + * stabs.c (_bfd_link_seciton_stabs): Likewise. + * vms-misc.c (_bfd_vms_get_record): Likewise. + * vms-tir.c (check_section): Likewise. + * vms.c (vms_new_section_hook): Likewise. + * elf32-arm.c (elf32_arm_section_map_add): Check that the + allocation of sec_data->map succeeded before using it. + * elflink.c (elf_link_output_sym): Do not overwrite finfo-> + symshndxbuf until it is known that the reallocation succeeded. + +2008-02-20 Diogo de Carvalho Kraemer + Nick Clifton + + PR 868 + * dwarf2.c (read_abbrevs): Free the abbreviation table if we run + out of memory. + (decode_line_info): Free the line_info_table before returning a + failure result. + (_bfd_dwarf2_cleanup_debug_info): Free the abbreviation table. + Free the line table. Free the function table. Free the variable + table. + +2008-02-17 Mark Kettenis + + * elf.c (swap_out_syms): Avoid preprocessing directive within + macro arg. + +2008-02-17 Jan Kratochvil + + * elf.c (assign_file_positions_for_load_sections): Set the type of + PT_NOTE sections to SHT_NOTE. + +2008-02-17 Ulrich Weigand + + * simple.c (bfd_simple_get_relocated_section_contents): Set + link_info.output_bfd. + +2008-02-16 Nathan Sidwell + + * dwarf2.c (find_line): Don't trust debug information after an + unparseable compilation unit. + +2008-02-15 Alan Modra + + PR 5765 + * section.c (SEC_LINK_DUPLICATES): Correct. Renumber following flags. + * bfd-in2.h: Regenerate. + +2008-02-15 Alan Modra + + * elf-bfd.h (enum elf_object_id): Add HPPA_ELF_TDATA. + * elf.c (bfd_elf_allocate_object): Don't check for already allocated + tdata. + * elf32-hppa.c (elf32_hppa_mkobject): New function. + (bfd_elf32_mkobject): Define. + * elf32-ppc.c (is_ppc_elf_target): Delete. Replace all uses with.. + (is_ppc_elf): ..this new macro. + * elf64-ppc.c (is_ppc64_elf_target): Delete. Replace all uses with.. + (is_ppc64_elf): ..this new macro. + +2008-02-15 Alan Modra + + * elflink.c: Replace all accesses to hash->creator field with + output_bfd->xvec. + * cofflink.c: Likewise. + * coff-h8300.c: Likewise. + * ecoff.c: Likewise. + * elf32-m68hc1x.c: Likewise. + * elf32-ppc.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-sparc.c: Likewise. + * elfxx-mips.c: Likewise. + * i386linux.c: Likewise. + * m68klinux.c: Likewise. + * sparclinux.c: Likewise. + * sunos.c: Likewise. + * xcofflink.c: Likewise. + * linker.c: Likewise. + (_bfd_link_hash_table_init): Don't store creator. + +2008-02-14 Peter Jones + + * efi-rtdrv-ia32.c: New file. + * efi-bsdrv-ia32.c: New file. + * efi-rtdrv-ia64.c: New file. + * efi-bsdrv-ia64.c: New file. + * efi-rtdrv-x86_64.c: New file. + * efi-bsdrv-x86_64.c: New file. + * peicode.h (pe_bfd_object_p): Add support for boot service and + runtime service drivers. + * libpei.h: Add macros for EFI formats, and rename the efi application + format macros to disambiguate. + * targets.c: Add bfd_target _vec externs. + (_bfd_tar): Add EFI _vec entries. + * config.bfd: Add EFI vectors into the selection routines. + * configure.in: add EFI _vec entries. + * configure: Regenerate. + * Makefile.am: Add EFI files. + * Makefile.in: Regenerate. + +2008-02-14 Nathan Sidwell + + * dwarf1.c (struct dwarf1_debug): Add syms member. + (alloc_dwarf1_unit, alloc_dwarf1_func): Check for out of memory. + (parse_line_table, _bfd_dwarf1_find_nearest_line): Relocate + section contents, check for out of memory. + + * dwarf1.c (struct dwarf1_debug): Change data pointers to bfd_byte. + (parse_die): Change data pointers to bfd_byte. + (parse_line_table, parse_functions_in_unit): Likewise. + +2008-02-14 Alan Modra + + * elflink.c (compute_bucket_count): Warning fixes. + +2008-02-12 DJ Delorie + + * elf32-iq2000.c (iq2000_elf_relocate_section): Adjust addend of + relocation pointing to local symbol in merged section. + + * elf32-iq2000.c (iq2000_elf_relocate_offset16): New. + (iq2000_elf_relocate_section): Call it. + +2008-02-12 Nick Clifton + + PR ld/5692 + * elf-bfd.h (enum elf_object_id): New enum, used to identify + target specific extensions to the elf_obj_tdata structure. + (struct elf_obj_tdata): New field 'object_id'. + (elf_object_id, elf_program_header_size, elf_symtab_hdr): New + macros for accessing fields in the elf_obj_tdata structure. + (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object. + (bfd_elf_allocate_object): New function. + * elf.c (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object + and implement by calling bfd_elf_allocate_object. + (bfd_elf_allocate_object): New function: Allocates an + elf_obj_tdata structure, possibly with a target specific + extension. + * elfxx-target.h (bfd_elfNN_mkobject): Use + bfd_elf_make_generic_object as the default value. + * elf32-arm.c (elf32_arm_obj_tdata): Rename to elf_arm_obj_tdata + for consistency with other, similar structures. + (is_arm_elf): New macro. Checks a BFD to make sure that is an ARM + ELF bfd. + (elf32_arm_mkobject): Call bfd_elf_allocate_object. + (bfd_elf32_arm_vfp11_erratum_scan): Use is_arm_elf macro to check + the bfd being processed. + (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise. + (bfd_elf32_arm_set_target_relocs): Likewise. + (bfd_elf32_arm_final_link_relocate): Likewise. + (bfd_elf32_arm_copy_private_bfd_data): Likewise. + (bfd_elf32_arm_merge_eabi_attributes): Likewise. + (bfd_elf32_arm_merge_private_bfd_data): Likewise. + (bfd_elf32_arm_check_relocs): Likewise. + (bfd_elf32_arm_gc_mark_extra_sections): Likewise. + (bfd_elf32_arm_size_dynamic_sections): Likewise. + (bfd_elf32_arm_process_before_allocation): Use elf_symtab_hdr. + (bfd_elf32_arm_init_maps): Likewise. + (bfd_elf32_arm_final_link_relocate): Likewise. + (bfd_elf32_arm_relocate_section): Likewise. + (bfd_elf32_arm_gc_sweep_hook): Likewise. + (bfd_elf32_arm_check_relocs): Likewise. + (bfd_elf32_arm_size_dynamic_sections): Likewise. + * elf32-i386.c (elf_i386_mkobject): Call bfd_elf_allocate_object. + (is_i386_elf): New macro. Checks a BFD to make sure that is an x86 + ELF bfd. + (elf_i386_check_relocs): Use is_i386_elf macro to check the bfd + being processed. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. + (elf_i386_check_relocs): Use elf_symtab_hdr. + (elf_i386_gc_sweep_hook): Likewise. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_mkobject): Call bfd_elf_allocate_object. + (elf_create_pointer_linker_section): Use is_ppc_elf_target to + verify that the bfd before accessing target specific fields. + (ppc_elf_check_relocs): Likewise. + (elf_finish_pointer_linker_section): Likewise. + (elf_create_pointer_linker_section): Use elf_symtab_hdr. + (ppc_elf_check_relocs): Likewise. + (ppc_elf_gc_sweep_hook): Likewise. + (ppc_elf_tls_optimize): Likewise. + (ppc_elf_size_dynamic_sections): Likewise. + (ppc_elf_relax_section): Likewise. + (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (struct elf_s390_obj_tdata): Add a comment + reminding programmers to keep this structure in sync with the one + defined in elf64-s390.c. + (elf_s390_mkobject): Call bfd_elf_allocate_object. + (is_s390_elf): New macro. Checks a BFD to make sure that is an s390 + ELF bfd. + (elf_s390_check_relocs): Use is_s390_elf macro to check the bfd + being processed. + (elf_s390_size_dynamic_sections): Likewise. + (elf_s390_relocate_section): Likewise. + (elf_s390_check_relocs): Use elf_symtab_hdr. + (elf_s390_gc_sweep_hook): Likewise. + (elf_s390_size_dynamic_sections): Likewise. + (elf_s390_relocate_section): Likewise. + * elf32-sh.c (sh_elf_mkobject): Call bfd_elf_allocate_object. + (is_sh_elf): New macro. Checks a BFD to make sure that is an SH + ELF bfd. + (sh_elf_size_dynamic_sections): Use is_sh_elf macro to check the + bfd being processed. + (sh_elf_relocate_section): Likewise. + (sh_elf_check_relocs): Likewise. + (sh_elf_copy_private_data): Likewise. + (sh_elf_relax_section): Use elf_symtab_hdr. + (sh_elf_size_dynamic_sections): Likewise. + (sh_elf_relocate_section): Likewise. + (sh_elf_get_relocated_section_contents): Likewise. + (sh_elf_gc_sweep_hook): Likewise. + (sh_elf_check_relocs): Likewise. + * elf64-alpha.c (elf64_alpha_mkobject): Call bfd_elf_allocate_object. + (is_alpha_elf): New macro. Checks a BFD to make sure that is an + Alpha ELF bfd. + (elf64_alpha_create_got_section): Use is_alpha_elf macro to check + the bfd being processed. + (elf64_alpha_create_dynamic_section): Likewise. + (elf64_alpha_check_relocs): Likewise. + (elf64_alpha_size_got_sections): Likewise. + (elf64_alpha_relax_section): Likewise. + (elf64_alpha_relocate_section): Likewise. + (elf64_alpha_final_link): Likewise. + (elf64_alpha_check_relocs): Use elf_symtab_hdr. + (elf64_alpha_relax_section): Likewise. + (elf64_alpha_relocate_section_r): Likewise. + (elf64_alpha_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_mkobject): Call bfd_elf_allocate_object. + (ppc64_elf_check_relocs): Use is_ppc64_elf_target to check the bfd + being processed. + (opd_entry_value): Likewise. + (allocate_dynrelocs): Likewise. + (ppc64_elf_relocate_section): Likewise. + (ppc64_elf_check_relocs): Use elf_symtab_hdr. + (opd_entry_value): Likewise. + (ppc64_elf_gc_sweep_hook): Likewise. + (get_sym_h): Likewise. + (ppc64_elf_edit_opd): Likewise. + (ppc64_elf_tls_optimize): Likewise. + (ppc64_elf_edit_toc): Likewise. + (ppc64_elf_size_dynamic_sections): Likewise. + (toc_adjusting_stub_needed): Likewise. + (ppc64_elf_size_stubs): Likewise. + (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (struct elf_s390_obj_tdata): Add a comment + reminding programmers to keep this structure in sync with the one + defined in elf32-s390.c. + (elf_s390_mkobject): Call bfd_elf_allocate_object. + (is_s390_elf): New macro. Checks a BFD to make sure that is an s390 + ELF bfd. + (elf_s390_check_relocs): Use is_s390_elf macro to check the bfd + being processed. + (elf_s390_size_dynamic_sections): Likewise. + (elf_s390_relocate_section): Likewise. + (elf_s390_check_relocs): Use elf_symtab_hdr. + (elf_s390_gc_sweep_hook): Likewise. + (elf_s390_size_dynamic_sections): Likewise. + (elf_s390_relocate_section): Likewise. + * elf64-x86_64.c (elf64_x86_64_mkobject): Call bfd_elf_allocate_object. + (is_x86_64_elf): New macro. Checks a BFD to make sure that is an + x86_64 ELF bfd. + (elf64_x86_64_check_relocs): Use is_x86_64_elf macro to check the bfd + being processed. + (elf64_x86_64_size_dynamic_sections): Likewise. + (elf64_x86_64_relocate_section): Likewise. + (elf64_x86_64_check_relocs): Use elf_symtab_hdr. + (elf64_x86_64_gc_sweep_hook): Likewise. + (elf64_x86_64_size_dynamic_sections): Likewise. + (elf64_x86_64_relocate_section): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_mkobject): Call bfd_elf_allocate_object. + (is_sparc_elf): New macro. Checks a BFD to make sure that is a Sparc + ELF bfd. + (_bfd_sparc_elf_check_relocs): Use is_sparc_elf macro to check the + bfd being processed. + (_bfd_sparc_elf_gc_sweep_hook): Likewise. + (_bfd_sparc_elf_size_dynamic_sections): Likewise. + (_bfd_sparc_elf_check_relocs): Use elf_symtab_hdr. + (_bfd_sparc_elf_gc_sweep_hook): Likewise. + (_bfd_sparc_elf_size_dynamic_sections): Likewise. + (_bfd_sparc_elf_relocate_section): Likewise. + +2008-02-12 Alan Modra + + PR 5303, 5755 + * arange-set.c: Delete. + * arange-set.h: Delete. + * dwarf2.c: Revert 2007-09-21 changes. + * Makefile.am: Likewise. + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2008-02-11 Bernd Schmidt + + * elf32-bfin.c (bfin_relocate_section): Set up dynobj before using it + if necessary. + (elf32_bfin_merge_private_bfd_data): Simplify, and ensure object type + mismatches are detected. + + * elf32-bfin.c (bfinfdpic_relocate_section): Take more care not to + emit invalid relocs or rofixup entries for deleted .eh_frame entries. + +2008-02-11 Daniel Jacobowitz + + * cache.c (cache_bread): Set bfd_error_file_truncated if EOF + was reached. + * srec.c (srec_scan): Calculate the checksum. Complain on mismatch. + +2008-02-07 Alan Modra + + * elf32-spu.c (spu_elf_size_stubs): Revert 2008-01-28 doubling + of _ovly_buf_table size. + (spu_elf_build_stubs): Use low bit of .size as "present" bit. + Adjust initialisations relating to _ovly_buf_table. + +2008-02-04 Bob Wilson + + * elf32-xtensa (elf_xtensa_relocate_section): After finding an invalid + relocation, do not continue processing it. Ignore R_XTENSA_ASM_EXPAND + relocations against dynamic symbols. + (elf_xtensa_finish_dynamic_sections): Do not fail if there is no + .xt.lit section. + +2008-02-04 Kai Tietz + H.J. Lu + + PR 5715 + * warning.m4: Enable -Wno-format by default when using gcc on + mingw. + * configure: Regenerated. + +2008-02-04 Adam Nemet + + * archures.c: Update copyright. + (bfd_mach_mips_octeon): New macro. + * bfd-in2.h: Regenerate. + * elfxx-mips.c (_bfd_elf_mips_mach): Handle Octeon. + (mips_set_isa_flags): Likewise. + (mips_mach_extensions): Add Octeon. + * cpu-mips.c: Update copyright. + (I_mipsocteon): New enum constant. + (arch_info_struct): Add Octeon. + +2008-02-04 Alan Modra + + * elf32-spu.c (spu_elf_relocate_section): Correct return type. + Return error status on unexpected relocation errors. + +2008-02-04 Alan Modra + + PR ld/5692 + * elf.c (bfd_elf_get_elf_syms): Revert 2008-01-31. Instead abort + on non-ELF input. + * elf32-arm.c (elf32_arm_size_dynamic_sections): Skip glue + processing on non-ELF input. + +2008-01-31 Marc Gauthier + + * config.bfd (xtensa*-*-*): Recognize processor variants. + +2008-01-31 Nick Clifton + + PR ld/5692 + * elf.c (bfd_elf_get_elf_syms): Check the return value of + get_elf_backend_data. + +2008-01-28 Fabian Groffen + + * config.bfd (x86_64-*-solaris2): Add support for this target. + +2008-01-28 Alan Modra + + Rewrite SPU overlay handling code. Put overlay calls stubs in the + overlays where possible. Use a faster call stub, or optionally at + compile time, a more compact stub. Double size of _ovly_buf_table + so that low bit of _ovly_table.buf can be used as a "present" bit. + Reserve an extra _ovly_table entry for index zero. + * elf32-spu.c: (struct spu_link_hash_table): Delete a number of fields, + add new ones. + (struct got_entry): New. + (struct spu_stub_hash_entry): Delete. + (stub_hash_newfunc, spu_elf_link_hash_table_free): Delete. + (spu_elf_link_hash_table_create): Adjust for struct changes. + (spu_stub_name): Delete. + (spu_elf_find_overlays): Don't track sections from overlay regions. + Instead set ovl_buf number in spu elf section data. Error if + overlays in one region don't start at the same address. Adjust + for struct _spu_elf_section_data changes. + (SIZEOF_STUB1, SIZEOF_STUB2, ILA_79, ILA_78): Delete. + (OVL_STUB_SIZE, BRSL, LNOP, ILA): Define. + (needs_ovl_stub): Adjust for struct _spu_elf_section_data changes. + (enum _insn_type): New. + (count_stub, build_stub): New functions. + (allocate_spuear_stubs): Use count_stub. + (build_spuear_stubs): Use build_stub. + (populate_stubs, sort_stubs): Delete. + (process_stubs): New function. + (write_one_stub): Delete. + (spu_elf_size_stubs, spu_elf_build_stubs): Rewrite. + (alloc_stack_info): Adjust for struct _spu_elf_section_data changes. + (maybe_insert_function, check_function_ranges): Likewise. + (find_function, pasted_function, build_call_tree): Likewise. + (spu_elf_stack_analysis, spu_elf_modify_segment_map): Likewise. + (spu_elf_modify_program_headers): Likewise. + (interesting_section): Detect stub sections differently. Delete + htab param, adjust all callers. + (spu_elf_relocate_section): Rewrite stub handling. + (spu_elf_output_symbol_hook): Likewise. + (bfd_elf32_bfd_link_hash_table_free): Delete. + * elf32-spu.h (struct _spu_elf_section_data): Move input-only and + output-only fields into a union. Add ovl_buf. + (spu_elf_size_stubs, spu_elf_build_stubs): Update prototypes. + +2008-01-25 DJ Delorie + + * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): New. + +2008-01-25 Kai Tietz + + * bfd-in.h: Add mingw I64 support. + * bfd-in2.h: Regenerated. + * bfd.c: (bfd_get_sign_extend_vma): Add pe-x86-64 and pei-x86-64. + +2008-01-21 Alan Modra + + PR 4453 + * format.c (bfd_check_format_matches): Don't accept archives as + fully matching unless they have a map. + +2008-01-21 Alan Modra + + * elflink.c (_bfd_elf_link_output_relocs): Correct error return. + +2008-01-21 Alan Modra + + * ecoff.c (_bfd_ecoff_archive_p): Delete. + * libecoff.h (_bfd_ecoff_archive_p): Delete. + * coff-alpha.c (ecoffalpha_little_vec): Use bfd_generic_archive_p. + * coff-mips.c (ecoff_little_vec, ecoff_big_vec): Likewise. + (ecoff_biglittle_vec): Likewise. + +2008-01-19 Alan Modra + + PR 5646 + * elf64-ppc.c (ppc64_elf_tls_optimize): Ensure htab->tls_get_addr + non-NULL before dereferencing. + +2008-01-15 Alan Modra + + PR 5604 + * elf-bfd.h (struct elf_backend_data): Add gc_keep. Remove param + names from others. + (_bfd_elf_gc_keep): Declare. + * elfxx-target.h (elf_backend_gc_keep): Define. + (elfNN_bed): Init new field. + * elflink.c (_bfd_elf_gc_keep): New function. + (bfd_elf_gc_sections): Call gc_keep. + * elf64-ppc.c (elf_backend_gc_keep): Define. + (struct _ppc64_elf_section_data): Move .opd related fields to + a struct so they don't occupy the same storage. Adjust accesses + throughout file. + (ppc64_elf_gc_keep): New function, split out from.. + (ppc64_elf_gc_mark_hook): ..here. Don't call _bfd_elf_gc_mark + to mark .opd section, just set gc_mark. + (ppc64_elf_edit_opd): Remove no_opd_opt parm. Don't set opd->adjust + unless we are changing .opd. Test non-NULL opd->adjust at all + accesses throughout file. + * elf64-ppc.h (ppc64_elf_edit_opd): Update prototype. + +2008-01-15 Alan Modra + + * bfd-in.h (BFD_HOST_LONG_LONG): Delete. + * bfd-in2.h: Regenerate. + +2008-01-11 Tristan Gingold + Eric Botcazou + + * elf32-ppc.c (ppc_elf_gc_sweep_hook): Exit early if generating a + relocatable. + * elf32-arm.c (elf32_arm_gc_sweep_hook): Likewise. + * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise. + * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise. + * elf32-i386.c (elf_i386_gc_sweep_hook): Likewise. + * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise. + * elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise. + * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise. + * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise. + * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise. + * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise. + * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise. + * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise. + * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Likewise. + * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise. + * elflink.c (bfd_elf_gc_sections): Do not punt on relocatable output + or executable output with relocations. + +2008-01-09 Nick Clifton + + PR gas/5552 + * elf32-fr30.c (fr30_elf_howto_table): Set partial_inplace field + to FALSE for all relocs. + +2008-01-09 Richard Sandiford + + PR ld/5526 + * elf-bfd.h (eh_cie_fde): Add u.cie.u.full_cie and u.cie.merged + fields. Rename u.cie.u.merged to u.cie.u.merged_with. + (eh_frame_sec_info): Add a cies field. + (eh_frame_hdr_info): Add a merge_cies field. + * elf-eh-frame.c (cie): Add a reloc_index member to the personality + union. + (_bfd_elf_begin_eh_frame_parsing): Set hdr_info->merge_cies instead + of hdr_info->cies. + (_bfd_elf_parse_eh_frame): Remove tmp_cie. Ccreate an array of + cie structures in all cases and use it instead of extended_cies. + If merging, store the cie array in sec_info->cies and point each + CIE's eh_fde_cie at the associated element. Do not try to + calculate the value of the personality routine here; record the + offset of the relocation instead. Do not merge CIEs here. + (_bfd_elf_end_eh_frame_parsing): Do not free hdr_info->cies here... + (_bfd_elf_discard_section_eh_frame_hdr): ...do it here instead. + (_bfd_elf_gc_mark_fdes): Mark the original (unmerged) CIE. + (find_merged_cie): New function. + (_bfd_elf_gc_mark_fdes): Use it. Free sec_info->cies. + +2008-01-07 Nick Clifton + + PR binutils/5535 + * vms.c (vms_close_and_cleanup): Check for the presence of a + vms_private_data_struct before examining any of its fields. + +2008-01-07 H.J. Lu + + PR ld/5522 + * elflink.c (elf_link_input_bfd): Don't write out a section if + its output section is marked with SEC_NEVER_LOAD. + +For older changes see ChangeLog-2007 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-2009 sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-2009 --- sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-2009 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-2009 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,5154 @@ +2009-12-31 Cary Coutant + + * dwarf2.c (struct line_sequence): New struct. + (struct line_info_table): Add num_sequences, remove last_line, + add sequences. + (add_line_info): Add new sequences as necessary. + (compare_sequences): New function. + (sort_line_sequences): New function. + (decode_line_info): Initialize new fields in line table. + Call sort_line_sequences. + (lookup_address_in_line_info_table): Binary search for proper + sequence. + +2009-12-28 Daniel Gutson + + * elf32-arm.c (elf32_arm_final_link_relocate): limits + fixed. + +2009-12-28 Daniel Gutson + + * elf-attrs.c (_bfd_elf_merge_object_attributes): Error + message rephrased. + +2009-12-21 Alan Modra + + * elf64-ppc.c: Delete my email address. + +2009-12-18 Ulrich Weigand + + * elf.c (elfcore_grok_s390_high_gprs): New function. + (elfcore_grok_note): Handle NT_S390_HIGH_GPRS notes. + (elfcore_write_s390_high_gprs): New function. + (elfcore_write_register_note): Call it. + +2009-12-17 Alan Modra + + PR ld/11088 + * elf32-ppc.c (update_plt_info): Clear sec here when addend is + less than 32768.. + (ppc_elf_check_relocs): ..rather than doing so here. Ignore new + relax relocs. + (ppc_elf_gc_sweep_hook): Don't segfault when symbol hiding has + removed plt_entry records. + (ppc_elf_tls_setup): Handle PIE calls to __tls_get_addr correctly. + (ppc_elf_tls_optimize): Likewise. Also dec __tls_get_addr refcount + when optimizing code using new tlsgd and tlsld marker relocs. + (ppc_elf_relax_section): Differentiate relaxed PLTREL24 relocs + from ADDR24 relocs using plt or glink. Don't clear the addend + for R_PPC_RELAX_PLTREL24. + (ppc_elf_relocate_section): Correctly handle addends on relaxed + PLTREL24 relocs. + +2009-12-17 Alan Modra + + PR ld/11088 + * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Don't abort if symbol + hiding has nulled out plt.plist. + +2009-12-15 H.J. Lu + + * opncls.c (bfd_opnr_iovec): Replace _XXX with XXX_P in + parameters. + + * tekhex.c (pass_over): Replace eof with is_eof. + +2009-12-15 Tristan Gingold + + * mach-o.h (bfd_mach_o_uuid_command): Remove section field. + * mach-o.c (bfd_mach_o_scan_read_uuid): Do not create a section + from this command. + +2009-12-15 Tristan Gingold + + * mach-o.c (struct mach_o_section_name_xlat): Add flags field. + (dwarf_section_names_xlat): Add section flags. + (text_section_names_xlat): Ditto. + (data_section_names_xlat): Ditto. + (bfd_mach_o_convert_section_name_to_bfd): Now return name and section + flags by reference. + (bfd_mach_o_make_bfd_section): Use section flags when know, otherwise + try to guess. + +2009-12-14 Doug Kwan + + * opncls.c (bfd_opnr_iovec): Rename parameters to avoid shawdowed + variable warnings. + * bfd-in2.h: Regnenerate. + +2009-12-12 Nick Clifton + + * coff-arm.c (coff_arm_rtype_to_howto): Fix shadowed variable + warning. + +2009-12-11 Tristan Gingold + + * som.c (bfd_som_set_subsection_attributes) + (bfd_section_from_som_symbol, som_reloc_queue_fix): Fix shadowed + variable warnings. + * cache.c (close_one): Likewise. + +2009-12-11 Nick Clifton + + * warning.m4 (GCC_WARN_CFLAGS): Add -Wshadow. + * configure: Regenerate. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + * aout-arm.c: Fix shadowed variable warnings. + * aout-tic30.c: Likewise. + * aoutx.h: Likewise. + * archive.c: Likewise. + * coff-alpha.c: Likewise. + * coff-i386.c: Likewise. + * coff-x86_64.c: Likewise. + * coffgen.c: Likewise. + * dwarf2.c: Likewise. + * ecoff.c: Likewise. + * elf-eh-frame.c: Likewise. + * elf-m10300.c: Likewise. + * elf.c: Likewise. + * elf32-arm.c: Likewise. + * elf32-avr.c: Likewise. + * elf32-bfin.c: Likewise. + * elf32-cr16.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-ip2k.c: Likewise. + * elf32-lm32.c: Likewise. + * elf32-m68hc1x.c: Likewise. + * elf32-microblaze.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-rx.c: Likewise. + * elf32-score.c: Likewise. + * elf32-score7.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-spu.c: Likewise. + * elf32-v850.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-x86-64.c: Likewise. + * elflink.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * elfxx-sparc.c: Likewise. + * hash.c: Likewise. + * ieee.c: Likewise. + * libbfd.c: Likewise. + * mach-o.c: Likewise. + * merge.c: Likewise. + * nlm32-sparc.c: Likewise. + * oasys.c: Likewise. + * opncls.c: Likewise. + * pdp11.c: Likewise. + * peXXigen.c: Likewise. + * pef.c: Likewise. + * versados.c: Likewise. + * vms-gsd.c: Likewise. + * vms-hdr.c: Likewise. + * vms-tir.c: Likewise. + * vms.c: Likewise. + * xcofflink.c: Likewise. + * xsym.c: Likewise. + * xtensa-isa.c: Likewise. + +2009-12-10 Maciej W. Rozycki + + * elfxx-mips.c (mips_elf_calculate_relocation): Correct handling + of undefined symbols. + +2009-12-09 Daniel Jacobowitz + + * elf32-arm.c (elf32_arm_next_input_section): Skip sections without + SEC_CODE. + +2009-12-08 Alan Modra + + * elf.c (write_zeros): New function. + (assign_file_positions_for_load_sections): Allocate file space for + NOBITS sections that are followed by PROGBITS sections in a segment. + +2009-12-03 Tristan Gingold + + * mach-o.c (bfd_mach_o_make_bfd_section): Force debug flags for + all sections of the __DWARF segment. + +2009-12-03 Alan Modra + + PR ld/11047 + * elf32-ppc.c (ppc_elf_relocate_section): Delete __tls_get_addr + symbol reference from relocs belonging to calls that are + optimized away. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + +2009-12-02 Jerker Bäck + + PR binutils/11017 + * coff-i386.h (COFF_PAGE_SIZE): Definition moved to coff/i386.h + +2009-11-30 Joseph Myers + + * configure: Regenerate. + +2009-11-26 Per Øyvind Karlsen + + * plugin.c (bfd_plugin_bfd_copy_link_hash_symbol_type): Define. + +2009-11-24 Joel Brobecker + + * acinclude.m4: Add include of ../config/zlib.m4. + * configure.in: AM_ZLIB to check for zlib support. + * configure: Regenerate. + +2009-11-23 Paul Brook + + * libbfd-in.h (_bfd_generic_copy_link_hash_symbol_type): Add + prototype. + * elf-bfd.h (_bfd_elf_copy_link_hash_symbol_type): Add prototype. + * linker.c (_bfd_generic_copy_link_hash_symbol_type): New function. + * elflink.c (_bfd_elf_copy_link_hash_symbol_type): New function. + * targets.c (BFD_JUMP_TABLE_LINK, struct bfd_target): Add + _copy_link_hash_symbol_type. + * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Add + _bfd_generic_copy_link_hash_symbol_type. + * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Add + _bfd_generic_copy_link_hash_symbol_type. + * aout-adobe.c (aout_32_bfd_copy_link_hash_symbol_type): Define. + * aout-target.h (MY_bfd_copy_link_hash_symbol_type): Define. + * aout-tic30.c (MY_bfd_copy_link_hash_symbol_type): Define. + * binary.c (binary_bfd_copy_link_hash_symbol_type): Define. + * bout.c (b_out_bfd_copy_link_hash_symbol_type): Define. + * coffcode.h (coff_bfd_copy_link_hash_symbol_type): Define. + * elfxx-target.h (bfd_elfNN_bfd_copy_link_hash_symbol_type): Define. + * i386msdos.c (msdos_bfd_copy_link_hash_symbol_type): Define. + * i386os9k.c (os9k_bfd_copy_link_hash_symbol_type): Define. + * ieee.c (ieee_bfd_copy_link_hash_symbol_type): Define. + * ihex.c (ihex_bfd_copy_link_hash_symbol_type): Define. + * libecoff.h (_bfd_ecoff_bfd_copy_link_hash_symbol_type): Define. + * mach-o.c (bfd_mach_o_bfd_copy_link_hash_symbol_type): Define. + * mmo.c (mmo_bfd_copy_link_hash_symbol_type): Define. + * nlm-target.h (nlm_bfd_copy_link_hash_symbol_type): Define. + * oasys.c (oasys_bfd_copy_link_hash_symbol_type): Define. + * pef.c (bfd_pef_bfd_copy_link_hash_symbol_type): Define. + * ppcboot.c (ppcboot_bfd_copy_link_hash_symbol_type): Define. + * som.c (som_bfd_copy_link_hash_symbol_type): Define. + * srec.c (srec_bfd_copy_link_hash_symbol_type): Define. + * tekhex.c (tekhex_bfd_copy_link_hash_symbol_type): Define. + * versados.c (versados_bfd_copy_link_hash_symbol_type): Define. + * vms.c (vms_bfd_copy_link_hash_symbol_type): Define. + * xsym.c (bfd_sym_bfd_copy_link_hash_symbol_type): Define. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2009-11-19 Tristan Gingold + + * coff-rs6000.c (rs6000coff_vec): Use generic routines instead of + hard-coded casts. + (pmac_xcoff_vec): Ditto. + * coff64-rs6000.c (rs6000coff64_vec): Ditto. + (aix5coff64_vec): Ditto. + +2009-11-18 Alan Modra + + * bfd-in.h (_bfd_elf_ppc_at_tls_transform): Declare. + * bfd-in2.h: Regenerate. + * elf64-ppc.c (ppc64_elf_relocate_section): Move code for R_PPC64_TLS + insn optimisation to.. + * elf32-ppc.c (_bfd_elf_ppc_at_tls_transform): ..here. New function. + (ppc_elf_relocate_section): Use it. + +2009-11-18 Alan Modra + + * targets.c: Don't include alloca-conf.h. + (bfd_get_target_info): Don't use alloca. + +2009-11-17 H.J. Lu + + PR ld/10955 + * elfxx-ia64.c (elfNN_ia64_update_short_info): Also skip ABS + sections. + +2009-11-17 H.J. Lu + + PR ld/10955 + * elfxx-ia64.c (elfNN_ia64_link_hash_table): Update comments. + (elfNN_ia64_update_short_info): Remove "->output_section" from + ia64_info->max_short_sec and ia64_info->min_short_sec. + (elfNN_ia64_choose_gp): Likewise. + (elfNN_ia64_relax_section): Pass tsec->output_section to + elfNN_ia64_update_short_info. + +2009-11-17 H.J. Lu + + PR ld/10955 + * elfxx-ia64.c (elfNN_ia64_link_hash_table): Add max_short_sec, + max_short_offset, min_short_sec and min_short_offset. + (elfNN_ia64_update_short_info): New. + (elfNN_ia64_relax_section): Update max_short_sec, + max_short_offset, min_short_sec and min_short_offset. + (elfNN_ia64_choose_gp): Use min_short_sec/max_short_sec if + they are set. + +2009-11-17 Paul Brook + Daniel Jacobowitz + + * elf32-arm.c (using_thumb_only, arch_has_arm_nop, + arch_has_thumb2_nop): Handle TAG_CPU_ARCH_V7E_M. + (tag_cpu_arch_combine): Ditto. Correct MAX_TAG_CPU_ARCH test. + +2009-11-17 Ulrich Weigand + + * elf32-spu.c (struct spu_link_hash_table): Remove overlay_fixed, + reserved, and extra_stack_space members. + (spu_elf_auto_overlay): Use auto_overlay_fixed, auto_overlay_reserved, + and extra_stack_space members of htab->params instead. + +2009-11-17 Tristan Gingold + + * targets.c: Include alloca-conf.h + +2009-11-16 Kai Tietz + + * targets.c (bfd_get_target_info): New function. + (_bfd_find_arch_match): New function. + * bfd-in2.h: Regenerated. + +2009-11-12 Nick Clifton + + * po/ru.po: Updates Russian translation. + +2009-11-11 Nick Clifton + + * po/id.po: Updated Indonesian translation. + +2009-11-11 Jan Kratochvil + + * configure.in: Call ACX_LARGEFILE. Stop calling AC_PLUGINS, + AC_SYS_LARGEFILE and checking the Solaris largefile exception. + * aclocal.m4: Regenerate. + * configure: Regenerate. + +2009-11-09 H.J. Lu + + PR ld/10911 + * elflink.c (elf_link_output_extsym): Don't return on + STT_GNU_IFUNC symbol when stripping. + +2009-11-08 John David Anglin + + * elf32-hppa.c (elf32_hppa_final_link): Don't sort unwind information + in a relocatable link. + * elf64-hppa.c (elf_hppa_final_link): Likewise. + +2009-11-05 Nick Clifton + + * elflink.c (elf_link_add_object_symbols): Improve error + message generated when a symbol is left unresolved because a + --no-add-needed command line option has prevented the + inclusion of the DSO defining it. + +2009-11-03 Alan Modra + Ulrich Weigand + + * elf32-spu.c (mark_functions_via_relocs): Handle non-branch relocs + (jump tables or other references to code labels) as well. + +2009-11-02 Paul Brook + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle VFPv4 + attributes. + +2009-11-02 Alan Modra + + * elflink.c (elf_link_add_object_symbols): Don't force debug + symbols local. + +2009-10-29 Johan Kristell + + * elf32-cris.c (cris_elf_plt_sym_val): New function. + (elf_backend_plt_sym_val): Define. + +2009-10-27 Kai Tietz + + * peXXigen.c (bfdver.h): Add include. + (LINKER_VERSION): Do calculation based on BFD_VERSION. + +2009-10-25 Maciej W. Rozycki + + * elf32-vax.c (elf_vax_relocate_section): Correct assertion. + +2009-10-25 Maciej W. Rozycki + + * elf32-vax.c (elf_vax_plt_entry): Fix formatting. + +2009-10-25 Maciej W. Rozycki + + * elf32-vax.c (elf_vax_relocate_section): Fix a typo. + +2009-10-23 Kai Tietz + + * coff-x86_64.c (coff_amd64_rtype_to_howto): Subtract offset + of R_AMD64_PCRLONG_ relocations from addend. + +2009-10-23 Alan Modra + + * plugin.c: Produce empty object if not BFD_SUPPORTS_PLUGINS. + +2009-10-20 Alan Modra + + PR binutils/10802 + * opncls.c (_maybe_make_executable): Make DYNAMIC files executable. + +2009-10-19 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) : + Don't subtract the size of the TLS block for non-shared objects + from the relocation. + +2009-10-17 Arnold Metselaar + + * coff-z80.c (z80coff_vec): Allow sections to be of type + SEC_CODE or SEC_DATA + +2009-10-16 Alan Modra + + PR binutils/10785 + * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Don't bfd_alloc + bim and bim->buffer. bfd_malloc instead. + * peicode.h (pe_ILF_build_a_bfd): Similarly. + (ILF_DATA_SIZE): Don't include bim. + * opncls.c (bfd_close): Test bim->buffer non-NULL before freeing. + +2009-10-14 Alan Modra + + * aoutx.h (aout_link_check_ar_symbols): Typo fix. + +2009-10-13 H.J. Lu + + PR binutils/10763 + * elf32-i386.c (elf_i386_finish_dynamic_symbol): Declare plt + earlier. + +2009-10-13 Alan Modra + + * elflink.c (_bfd_elf_merge_symbol): Revert previous patch. + +2009-10-12 Roland McGrath + + * elflink.c (elf_link_add_object_symbols, _bfd_elf_merge_symbol): + Fix %s that should be %B in several message formats. + +2009-10-10 Alan Modra + + * cofflink.c (_bfd_coff_link_input_bfd): Skip section symbols for + excluded output sections. + +2009-10-09 Tristan Gingold + + * mach-o.c (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_RPATH. + (bfd_mach_o_bfd_print_private_bfd_data): Ditto. + +2009-10-09 Tristan Gingold + + * mach-o.c (bfd_mach_o_scan_read_symtab_symbols): Rename to + bfd_mach_o_read_symtab_symbols. + (bfd_mach_o_scan_write_thread): Rename to bfd_mach_o_write_thread. + (bfd_mach_o_scan_write_relocs): Rename to bfd_mach_o_write_relocs. + (bfd_mach_o_scan_write_section_32): Rename to + bfd_mach_o_write_section_32. + (bfd_mach_o_scan_write_section_64): Rename to + bfd_mach_o_write_section_64. + (bfd_mach_o_scan_write_segment_32): Rename to + bfd_mach_o_write_segment_32. + (bfd_mach_o_scan_write_segment_64): Rename to + bfd_mach_o_write_segment_64. + (bfd_mach_o_scan_write_symtab): Rename to bfd_mach_o_write_symtab. + (bfd_mach_o_scan_read_section_32): Rename to + bfd_mach_o_read_section_32. + (bfd_mach_o_scan_read_section_64): Rename to + bfd_mach_o_read_section_64. + (bfd_mach_o_scan_read_section): Rename to bfd_mach_o_read_section. + (bfd_mach_o_scan_read_symtab_strtab): Rename to + bfd_mach_o_read_symtab_strtab. + (bfd_mach_o_scan_read_symtab_symbol): Rename to + bfd_mach_o_read_symtab_symbol. + (bfd_mach_o_scan_read_dysymtab_symbol): Rename to + bfd_mach_o_read_dysymtab_symbol. + (bfd_mach_o_scan_read_dylinker): Rename to bfd_mach_o_read_dylinker. + (bfd_mach_o_scan_read_dylib): Rename to bfd_mach_o_read_dylib. + (bfd_mach_o_scan_read_prebound_dylib): Rename to + bfd_mach_o_read_prebound_dylib. + (bfd_mach_o_scan_read_thread): Rename to bfd_mach_o_read_thread. + (bfd_mach_o_scan_read_dysymtab): Rename to bfd_mach_o_read_dysymtab. + (bfd_mach_o_scan_read_symtab): Rename to bfd_mach_o_read_symtab. + (bfd_mach_o_scan_read_uuid): Rename to bfd_mach_o_read_uuid. + (bfd_mach_o_scan_read_linkedit): Rename to bfd_mach_o_read_linkedit. + (bfd_mach_o_scan_read_str): Rename to bfd_mach_o_read_str. + (bfd_mach_o_scan_read_dyld_info): Rename to bfd_mach_o_read_dyld_info. + (bfd_mach_o_scan_read_segment): Rename to bfd_mach_o_read_segment. + (bfd_mach_o_scan_read_segment_32): Rename to + bfd_mach_o_read_segment_32. + (bfd_mach_o_scan_read_segment_64): Rename to + bfd_mach_o_read_segment_64. + (bfd_mach_o_scan_read_command): Rename to bfd_mach_o_read_command. + * mach-o.h (bfd_mach_o_scan_read_dysymtab_symbol): Rename to + bfd_mach_o_read_dysymtab_symbol. + +2009-10-09 Tristan Gingold + + * mach-o.c (bfd_mach_o_section_get_entry_size): Moved. + (bfd_mach_o_section_get_nbr_indirect): Ditto. + (bfd_mach_o_get_synthetic_symtab): New function. + (bfd_mach_o_print_private_header): Print the number of commands + in decimal. + * mach-o.h (bfd_mach_o_get_synthetic_symtab): Add prototype. + * mach-o-target.c: Do not defined bfd_mach_o_get_synthetic_symtab. + +2009-10-08 Tristan Gingold + + * config.bfd: Add bfd_mach_o_i386_vec in x86_64-darwin targ_selvecs. + +2009-10-06 H.J. Lu + + * bfd-in2.h: Regenerated. + +2009-10-02 Alan Modra + + * aout-cris.c (N_SHARED_LIB): Don't define. + * hp300bsd.c (N_SHARED_LIB): Don't define. + * i386bsd.c (N_SHARED_LIB): Don't define. + * i386linux.c (N_SHARED_LIB): Don't define. + * i386lynx.c (N_SHARED_LIB): Don't define. + * m68klinux.c (N_SHARED_LIB): Don't define. + * m88kmach3.c (N_SHARED_LIB): Don't define. + * mipsbsd.c (N_SHARED_LIB): Don't define. + * newsos3.c (N_SHARED_LIB): Don't define. + * pc532-mach.c (N_SHARED_LIB): Don't define. + * pdp11.c (N_SHARED_LIB): Don't define. + * sparclinux.c (N_SHARED_LIB): Don't define. + * vaxbsd.c (N_SHARED_LIB): Don't define. + +2009-10-01 Dave Korn + + * cofflink.c (_bfd_coff_generic_relocate_section): Look for the aux + symbol for a weak undef in the auxbfd, not the input bfd. + +2009-10-01 Ulrich Weigand + + * elf32-spu.c (spu_elf_auto_overlay): Insert icache linker script + after .toe instead of before .text section. Set the LMA of all + overlay sections to their icache IA address. + (spu_elf_find_overlays): Determine icache set id without reference + to the LMA. + +2009-09-30 Tristan Gingold + + * configure.com: Use hosts/alphavms.h on both alpha and ia64 VMS. + +2009-09-29 H.J. Lu + + * elf64-x86-64.c (elf64_x86_64_append_rela): New. + (elf64_x86_64_relocate_section): Use it. + (elf64_x86_64_finish_dynamic_symbol): Likewise. + +2009-09-29 DJ Delorie + + * Makefile.am (ALL_MACHINES): Add cpu-rx.lo. + (ALL_MACHINES_CFILES): Add cpu-rx.c. + (BFD32_BACKENDS): Add elf32-rx.lo. + (BFD32_BACKENDS_CFILES): Add elf32-rx.c. + * archures.c (bfd_architecture): Add bfd_arch_rx and bfd_mach_rx. + Export bfd_rx_arch. + (bfd_archures_list): Add bfd_rx_arch. + * config.bfd: Add entry for rx-*-elf. + * configure.in: Add entries for bfd_elf32_rx_le_vec and + bfd_elf32_rx_be_vec. + * reloc.c: Add RX relocations. + * targets.c: Add RX target vectors. + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + * libbfd.h: Regenerate. + * cpu-rx.c: New file. + * elf32-rx.c: New file. + +2009-09-29 M R Swami Reddy + + * elf32-cr16.c (elf32_cr16_relocate_section): Removed + info->relocatable to fix the ld/testsuites/ld-elf/linkonce1 test case. + +2009-09-28 Nick Clifton + + PR 10478: Accepting Solaris binaries. + * elf.c (bfd_section_from_shdr): Allow SHN_BEFORE and SHN_AFTER + section link values in x86 binaries. + * elfcode.h (elf_object_p): Likewise. + +2009-09-28 Philippe De Muyter + + * elf32-m68k.c (elf_m68k_final_write_processing): New function. + (elf_backend_final_write_processing): Macro defined as above function. + +2009-09-25 Martin Thuresson + + Update sources to make alpha and arm targets compile cleanly with + -Wc++-compat: + * ecoff.c: Add casts. + * ecofflink.c: Add casts. + * elf64-alpha.c: Add casts. + (struct alpha_elf_got_entry, struct alpha_elf_reloc_entry): Move + to top level. + (SKIP_HOWTO): Use enum name. + * elf32-arm.c: Add casts. + (elf32_arm_vxworks_bed): Update code to avoid multiple + declarations. + (struct map_stub): Move to top level. + +2009-09-24 H.J. Lu + + PR ld/10630 + * elflink.c (elf_link_output_extsym): Turn off visibility on + local symbol. + (bfd_elf_final_link): Turn off visibility on dynamic local + symbol. + +2009-09-24 Alan Modra + + PR binutils/10654 + * dwarf2.c (lookup_address_in_line_info_table): Remove workaround + for invalid location lists generated by gcc-2.95 and Intel 6.0 C++. + Remove "function" parm, adjust caller. + +2009-09-23 Matt Rice + + * bfd-in.h (bfd_elf_size_dynamic_sections): Add audit and depaudit + arguments. + * elflink.c (bfd_elf_size_dynamic_sections): Generate DT_AUDIT, + DT_DEPAUDIT from audit/depaudit arguments. + (elf_finalize_dynstr): Finalize DT_AUDIT and DT_DEPAUDIT strtab entries. + (elf_link_add_object_symbols): Set dt_audit target data when finding a + DT_AUDIT. + * bfd-in2.h: Regenerate. + * bfd-elf.h: Add dt_audit to elf_obj_tdata, and elf_dt_audit macro. + +2009-09-23 Jie Zhang + + * elf32-bfin.c (_bfinfdpic_size_got_plt): Make sure empty + .rel.plt and .plt sections are removed. + (elf32_bfinfdpic_size_dynamic_sections): Remove empty .dynbss + section. Remove the duplicated removing of empty .rel.plt + section. + +2009-09-21 Richard Sandiford + + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Extend previous + patch to handle the new personality relaxation. + +2009-09-21 Richard Sandiford + + * elf-eh-frame.c (make_pc_relative): New function. + (_bfd_elf_write_section_eh_frame): Use it. + +2009-09-21 Alan Modra + + * elf32-ppc.c (TLS_GET_ADDR_GLINK_SIZE): Define. + (ADD_3_12_2, BEQLR, CMPWI_11_0, LWZ_11_3, LWZ_12_3): Define. + (MR_0_3, MR_3_0): Define. + (struct ppc_elf_link_hash_table): Add no_tls_get_addr_opt. + (ppc_elf_select_plt_layout): Save emit_stub_syms param earlier. + (ppc_elf_tls_setup): Add no_tls_get_addr_opt param and save to hash + table. Check for presense of __tls_get_addr_opt + (allocate_dynrelocs): Increase glink entry size for __tls_get_addr. + (ppc_elf_size_dynamic_sections): Add DT_PPC_TLS_OPT tag. + (write_glink_stub): Add param p. + (ppc_elf_relocate_section): Adjust write_glink_stub call. + (ppc_elf_finish_dynamic_symbol): Emit special glink call stub for + __tls_get_addr. + * elf32-ppc.h (ppc_elf_tls_setup): Update prototype. + * elf64-ppc.c (struct ppc_link_hash_table): Add no_tls_get_addr_opt. + (ppc64_elf_tls_setup): Add no_tls_get_addr_opt param and save to hash + table. Check for presense of __tls_get_addr_opt. + (ppc64_elf_size_dynamic_sections): Add DT_PPC64_TLS_OPT tag. + (LD_R11_0R3, LD_R12_0R3, MR_R0_R3, CMPDI_R11_0, ADD_R3_R12_R13, + BEQLR, MR_R3_R0, MFLR_R11, STD_R11_0R1, BCTRL, LD_R11_0R1, + LD_R2_0R1, MTLR_R11): Define. + (build_tls_get_addr_stub): New function. + (ppc_build_one_stub): Call it. + (ppc_size_one_stub): Add extra size for __tls_get_addr stub. + (ppc64_elf_relocate_section): Don't change nop to ld 2,40(1) for + __tls_get_addr plt call. + * elf64-ppc.h (ppc64_elf_tls_setup): Update prototype. + +2009-09-19 Richard Sandiford + + * elf-bfd.h (eh_cie_fde): Add personality_offset and + make_per_encoding_relative to the CIE structure. Add a padding field. + * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Use 0x70 + rather than 0xf0 when masking out the base address encoding + Record the offset of personality data from the start of the CIE. + Remove a repeated elf_backend_can_make_relative_eh_frame check. + (find_merged_cie): Take an info argument. If the personality + binds locally, try converting an absolute personality into + a local one. + (_bfd_elf_discard_section_eh_frame): Use 0x70 rather than 0xf0 + when masking out the base address encoding. Update the call to + find_merged_cie. + (_bfd_elf_eh_frame_section_offset): Discard relocations against + the personality data if we are converting into PC-relative form. + (_bfd_elf_write_section_eh_frame): Use 0x70 rather than 0xf0 + when masking out the base address encoding. Handle + make_per_encoding_relative. + +2009-09-18 Alan Modra + + PR ld/10406 + * elf32-ppc.c (ppc_elf_howto_raw): Make R_PPC_EMB_SDAI16 and + R_PPC_EMB_SDA2I16 complain_overflow_signed. + (create_sdata_sym): Pass info rather than htab. + Update all callers. Ensure symbols are hidden. + (ppc_elf_check_relocs): Allow SDAREL16 when shared. + (ppc_elf_size_dynamic_sections): When shared, equate _SDA_BASE_ to + _GLOBAL_OFFSET_TABLE_. + (elf_finish_pointer_linker_section): Don't assume that sdata base + symbol is always at 0x8000 offset. Don't subtract the addend here. + (is_static_defined): New function. + (ppc_elf_relocate_section): Verify symbol base used in SDA relocs + is statically defined. Clear addend for EMB_SDAI16 and EMB_SDA2I16 + relocs. Downgrade error on unexpected section for EMB_SDA2REL + reloc symbols to a warning. + +2009-09-18 Nick Clifton + + * po/es.po: Updated Spanish translation. + * po/vi.po: Updated Vietnamese translation. + +2009-09-18 Alan Modra + + * elf64-ppc.c (follow_link, elf_follow_link, ppc_follow_link): New + functions. Use throughout. + (ppc64_elf_copy_indirect_symbol): Set direct symbol "oh" field + from indirect symbol. + (lookup_fdh): Rename from get_fdh. Follow indirect sym links. + (add_symbol_adjust): Simplify. + (defined_code_entry, defined_func_desc): New functions. + (ppc64_elf_gc_keep): Follow indirect sym links. Use defined_code_entry. + (ppc64_elf_gc_mark_dynamic_ref): Use defined_func_desc and + defined_code_entry to follow indirect sym links. + (ppc64_elf_gc_mark_hook, func_desc_adjust): Likewise. + (ppc_type_of_stub): Follow indirect sym links. + (toc_adjusting_stub_needed): Likewise. + (ppc_build_one_stub): Likewise. Make undefined dot-symbols weak + rather than defining them at stub. + (ppc64_elf_relocate_section): Rewrite call test to avoid multiple + assignments in test. + +2009-09-16 Tristan Gingold + + * mach-o.h (bfd_mach_o_filetype): Add new constants from darwin10. + Reindent. + * mach-o.c (bfd_mach_o_cpu_name): Reindent. + (bfd_mach_o_filetype_name): Complete with new constants. Reindent. + (bfd_mach_o_print_private_header): Use fputs instead of fprintf + when possible to avoid warnings. + (bfd_mach_o_print_section_map): Ditto. + (bfd_mach_o_section_get_entry_size): New function. + (bfd_mach_o_section_get_nbr_indirect): Simplify using the newly + added function. + (bfd_mach_o_print_dysymtab): Print address of indirect symbols. + +2009-09-14 Nick Clifton + + * po/fi.po: Updated Finnish translation. + +2009-09-11 Nick Clifton + + * po/bfd.pot: Updated by the Translation project. + +2009-09-11 Philippe De Muyter + + * binary.c (binary_object_p): Remove bfd_external_binary_architecture + hack. objcopy `-B' (`--binary-architecture') option is now handled + in a generic way. + +2009-09-11 Nick Clifton + + * rs6000-core.c (read_hdr): Fix typo in recent C++ compatibility + changes. + +2009-09-11 Jie Zhang + + * elf32-bfin.c (bfinfdpic_relocs_info_find): Just return + NULL if `ht' is NULL. + +2009-09-09 Martin Thuresson + + Update sources to compile cleanly with -Wc++-compat: + * aoutx.h: Add casts. + * archive.c: Add casts. + * archive64.c: Add casts. + * archures.c: Add casts. + * bfd-in2.h: Regenerated. + * bfd.c: Add casts. (enum bfd_direction): Move out to top level. + * bfdio.c: Add casts. + * binary.c: Add casts. + * cache.c (cache_bseek,cache_bread_1,cache_bwrite): Updated + parameter to use enum value instead of int. + * coffcode.h: Add casts. + * coffgen.c: Add casts. + * cofflink.c: Add casts. + * compress.c: Add casts. + * dwarf1.c: Add casts. + * dwarf2.c: Add casts. (struct dwarf2_debug): Rename member bfd to + bfd_ptr. Update code to use new name. + * elf-attrs.c: Add casts. + * elf-bfd.h (elf_link_virtual_table_entry): Gives name to + anonymous struct. (union gotplt_union, struct + elf_link_virtual_table_entry): Move to top level. + * elf-eh-frame.c: Add casts. + * elf-strtab.c: Add casts. + * elf.c: Add casts. (_bfd_elm_make_Section_from_phdr): Change + argument name from typename to type_name. + * elf32-i386.c: Add casts. + * elf64-x86-64.c: Add casts. + * elfcode.h: Add casts. + * elfcore.h: Add casts. + * elflink.c: Add casts. + * format.c: Add casts. + * hash.c: Add casts. + * ihex.c: Add casts. + * libaout.h (enum aout_subformat, enum aout_magic): Move to top + level. + * libbfd.c: Add casts. + * linker.c: Add casts. + * merge.c: Add casts. + * opncls.c: Add casts. + * peXXigen.c: Add casts. + * peicode.h: Add casts. + * reloc.c: Add casts. + * section.c: Add casts. + * simple.c: Add casts. + * srec.c: Add casts. + * stabs.c: Add casts. + * syms.c: Add casts. + * targets.c: Add casts. + * tekhex.c: Add casts. + * verilog.c: Add casts. + +2009-09-09 Paolo Bonzini + + * configure: Regenerate. + +2009-09-09 Daniel Jacobowitz + + * elf32-arm.c (elf32_arm_final_link_relocate): Set sym_flags + for the mode of target PLT entries. + (allocate_dynrelocs): Only adjust symbol type if setting its + value. + +2009-09-09 Paolo Bonzini + + * configure: Regenerate. + +2009-09-09 Nick Clifton + + PR 10478: + * elf.c (bfd_section_from_shdr): Do not reject sparc binaries with + section headers containing sh_link values of SHN_BEFORE or + SHN_AFTER. + * elfcode.h (elf_object_p): Likewise. + +2009-09-09 Tristan Gingold + + Handle DYLD_INFO introduced by Darwin10. + * mach-o.h (bfd_mach_o_load_command_type): Add + BFD_MACH_O_LC_DYLD_INFO. + (bfd_mach_o_dyld_info_command): New type. + (bfd_mach_o_load_command): Add dyld_info field. + * mach-o.c (bfd_mach_o_scan_read_str): Reduce size of buf. + (bfd_mach_o_scan_read_dyld_info): New function. + (bfd_mach_o_scan_read_command): Handle BFD_MACH_O_LC_DYLD_INFO. + (bfd_mach_o_bfd_print_private_bfd_data): Ditto. + (bfd_mach_o_load_command_name): AddB FD_MACH_O_LC_DYLD_INFO. + (bfd_mach_o_print_dyld_info): New function. + +2009-09-09 M R Swami Reddy + + * elf32-cr16.c (elf32_cr16_relocate_section): Add code to discard the + linkonce or linker script discarded section. + +2009-09-09 Alan Modra + + * elf32-xtensa.c (elf_xtensa_relax_section): Delete -r check. + +2009-09-07 Andreas Schwab + + * elf32-m68k.c (rtype_to_howto): If the reloc index is out of + range call the bfd error hander and use R_68K_NONE instead. + +2009-09-07 Tristan Gingold + + * po/SRC-POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. + + * bfd.m4 (BFD_HAVE_TIME_TYPE_MEMBER, + BFD_HAVE_SYS_STAT_TYPE_MEMBER): Moved to gas/acinclude.m4 + * configure.in: Move tests for tm_gmtoff, st_mtim.tv_sec and + st_mtim.tv_nsec to gas/configure.in + (bfd_elf64_ia64_vms_vec): Remove vmsutil.lo + * configure: Regenerate. + * config.in: Regenerate. + * vmsutil.c: Moved to gas/config/te-vms.c + * vmsutil.h: Removed. + * Makefile.am (BFD32_BACKENDS_CFILES): Remove vmsutil.c + (BFD32_BACKENDS): Remove vmsutil.lo + * Makefile.in: Regenerate. + +2009-09-05 Eli Zaretskii + + * coffcode.h: Include libiberty.h. + +2009-09-05 Martin Thuresson + + * coff-arm.c (coff_arm_relocate_section) + (record_thumb_to_arm_glue, bfd_arm_process_before_allocation): + Change member name class to symbol_class. + * coff-i960.c (coff_i960_relocate_section) Rename variable + class to class_val. Change member name class to symbol_class. + * coff-rs6000.c (_bfd_xcoff_swap_aux_in) + (_bfd_xcoff_swap_aux_out): Rename arguments class to in_class. + * coff-stgo32.c (adjust_aux_in_post) + (adjust_aux_out_pre, adjust_aux_out_post): Rename arguments class + to in_class. + * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in) + (_bfd_xcoff64_swap_aux_out): Rename arguments class to in_class. + * coffcode.h (coff_pointerize_aux_hook): Rename variable class + to n_sclass. + * coffgen.c (coff_write_symbol, coff_pointerize_aux): Rename + variables named class to n_sclass. (coff_write_symbols): Rename + variable class to sym_class. (bfd_coff_set_symbol_class): Rename + argument class to symbol_class. + * cofflink.c (_bfd_coff_link_hash_newfunc) + (coff_link_add_symbols, _bfd_coff_link_input_bfd) + (_bfd_coff_write_global_sym, _bfd_coff_generic_relocate_section): + Update code to use renamed members. + * coffswap.h (coff_swap_aux_in, coff_swap_aux_out): Rename + argument class to in_class. + * libcoff-in.h (struct coff_link_hash_entry, struct + coff_debug_merge_type) Renamed members class to symbol_class and + type_class. + * libcoff.h Regenerated. + * peXXigen.c: (_bfd_XXi_swap_aux_in, _bfd_XXi_swap_aux_out): + Rename argument class to in_class. + * pef.c (bfd_pef_parse_imported_symbol): Update code to use + renamed members. + * pef.h (struct bfd_pef_imported_symbol): Changed name of + member class to symbol_class. + +2009-09-04 H.J. Lu + + * configure: Regenerated. + +2009-09-04 Tristan Gingold + + * configure.in: Bump version to 2.20.51 + +2009-09-04 Alan Modra + + * elf32-spu.c (spu_elf_relocate_section): Correct 2009-07-24 logic. + +2009-09-04 Jie Zhang + + * elf32-bfin.c (elf32_bfinfdpic_create_dynamic_sections): Always + create .rela.bss. + (elf32_bfinfdpic_size_dynamic_sections): Set SEC_EXCLUDE flag + for empty .rela.bss and .rel.plt sections. + +2009-09-03 Adam Nemet + + * elfxx-mips.c (mips_elf_calculate_relocation): Don't relocate + R_MIPS_JALR unless symbol resolves locally. + +2009-09-03 Adam Nemet + + * elfxx-mips.c (_bfd_mips_elf_check_relocs): Don't set + has_static_relocs for R_MIPS_JALR. + +2009-09-03 Maciej W. Rozycki + + * elf64-mips.c (mips_elf64_howto_table_rela): Add support for + R_MIPS_TLS_DTPMOD64 and R_MIPS_TLS_TPREL64, replacing the + respective stubs. + +2009-09-01 H.J. Lu + + * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Declare + plt earlier. + +2009-09-01 Tristan Gingold + + * makefile.vms: Ported to Itanium VMS. Remove useless variable and + dependencies. Reindent. + * configure.com: Ported to Itanium VMS. Now generates a build.com + to build without make. Add messages but make edit silent. + * hosts/alphavms.h: Add a prototype for stpcpy. + * vms.c: Add a missing include for Alpha VMS. + * elfxx-ia64.c (ELF_OSABI): Define for OpenVMS. + +2009-08-31 Jan Beulich + + * elf-bfd.h (bfd_elf_get_default_section_type): Declare. + * elf.c (bfd_elf_get_default_section_type): New. + (elf_fake_sections): Use bfd_elf_get_default_section_type. + +2009-08-30 H.J. Lu + + * elf32-i386.c (elf_i386_finish_dynamic_symbol): Revert the + accidental checkin. + * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Likwise. + +2009-08-30 Alan Modra + + PR ld/10569 + * bfd.c (bfd_emul_get_maxpagesize): Don't abort. + (bfd_emul_get_commonpagesize): Likewise. + +2009-08-29 Martin Thuresson + + * elf32-arm.c (struct stub_def): Rename member template to + template_sequence. (arm_build_one_stub, + find_stub_size_and_template, arm_size_one_stub, arm_map_one_stub): + Rename variable template to template_sequence. + * elfxx-ia64.c (elfNN_ia64_relax_br, elfNN_ia64_relax_brl): + Rename variable template to template_val. + * aoutx.h (NAME (aout, make_empty_symbol)): Rename variable + new to new_symbol. + * coffgen.c (coff_make_empty_symbol) + (coff_bfd_make_debug_symbol): Rename variable new to new_symbol. + * cpu-ia64-opc.c (ext_reg, ins_imms_scaled): Rename variable + new to new_insn. + * ecoff.c (_bfd_ecoff_make_empty_symbol): Rename variable new + to new_symbol. + * elf32-m68k.c (elf_m68k_get_got_entry_type): Rename argument + new to new_reloc. + * hash.c (bfd_hash_lookup): Rename variable new to new_string. + * ieee.c (ieee_make_empty_symbol): Rename variable new to + new_symbol. + * linker.c (bfd_new_link_order): Rename variable new to + new_lo. + * mach-o.c (bfd_mach_o_sizeof_headers): Rename variable new to + symbol. + * oasys.c (oasys_make_empty_symbol): Rename variable new to + new_symbol_type. + * pdp11.c (NAME (aout, make_empty_symbol)): Rename variable + new to new_symbol_type. + * plugin.c (bfd_plugin_make_empty_symbol): Rename variable new + to new_symbol. + * rs6000-core.c (CoreHdr, VmInfo): Rename union member new to + new_dump. + (read_hdr, rs6000coff_core_p) + (rs6000coff_core_file_matches_executable_p) + (rs6000coff_core_file_failing_command) + (rs6000coff_core_file_failing_signal): Updated function to use new + union member name. + * som.c (som_make_empty_symbol): Rename variable new to + new_symbol_type. + * syms.c (_bfd_generic_make_empty_symbol): Rename variable new + to new_symbol. + * tekhex.c (first_phase, tekhex_make_empty_symbol): Rename + variable new to new_symbol. + +2009-08-27 Ralf Wildenhues + + * acinclude.m4 (AM_INSTALL_LIBBFD): Call AM_SUBST_NOTMAKE for + bfdlibdir and bfdincludedir. + * Makefile.am (bfdlibdir, bfdincludedir): Move definition ... + [INSTALL_LIBBFD]: ... here, ... + [INSTALL_LIBBFD]: ... and empty overrides here. + [!INSTALL_LIBBFD]: (rpath_bfdlibdir): New variable. + [!INSTALL_LIBBFD] (libbfd_la_LDFLAGS): Use it. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2009-08-26 Maxim Kuvyrkov + + * elf32-m68k.c: Rewrite initialization of GOT entries for TLS + relocations. Rewrite output of dynamic TLS relocations. + (DTP_OFFSET, TP_OFFSET): New constants. + (dtpoff_base): Update. + (tpoff): Rename to tpoff_base, update. + (elf_m68k_init_got_entry_static, elf_m68k_init_got_entry_local_shared): + New functions. Move code from elf_m68k_relocate_section here. + (elf_m68k_relocate_section): Update. + (elf_m68k_finish_dynamic_symbol): Fix handling of local TLS symbols. + +2009-08-26 Maxim Kuvyrkov + + * elf32-m68k.c (elf_m68k_copy_indirect_symbol): Propagate + non_got_ref value. + (elf_m68k_check_relocs): Handle dynamic TLS relocations. + Handle non_got_ref field. + (elf_m68k_adjust_dynamic_symbol): Handle non_got_ref field. + +2009-08-26 Alan Modra + + PR ld/10518 + * linker.c (bfd_find_version_for_sym): Revert warning. + +2009-08-26 Alan Modra + + PR ld/10518 + * linker.c (bfd_find_version_for_sym): Override a "*" match by any + other wildcard match. Warn on multiple wildcard matches. + +2009-08-22 Ralf Wildenhues + + * Makefile.am (libbfd_la_LDFLAGS): Initialize early, to allow + appending. + [INSTALL_LIBBFD] (bfdlib_LTLIBRARIES, bfdinclude_HEADERS): Set + only in this condition. + [!INSTALL_LIBBFD] (noinst_LTLIBRARIES, libbfd_la_LDFLAGS): New, + to build but not install libbfd.la in this condition. + (install-bfdlibLTLIBRARIES, uninstall-bfdlibLTLIBRARIES) + (install_libbfd, install_libbfd): Remove. + * Makefile.in: Regenerate. + * doc/Makefile.am (AM_CPPFLAGS): Renamed from ... + (INCLUDES): ... this. + ($(MKDOC)): Adjust. + * doc/Makefile.in: Regenerate. + + * Makefile.am (AUTOMAKE_OPTIONS): Remove cygnus, instead use + no-dist and foreign. + (EXTRA_libbfd_la_SOURCES): New, list $(CFILES) to allow + dependency tracking to work for them. + (targets.lo, archures.lo, dwarf.lo): Rewrite to + use automake dependency tracking mechanism. + (MKDEP, DEP, DEP1, dep.sed, dep, dep-in, dep-am): Remove. + (mkdep section): Remove. + (BUILT_SOURCES): New, list $(BUILD_HFILES). + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in, po/bfd.pot: Regenerate. + + * Makefile.am (datarootdir, docdir, htmldor, pdfdir) + (install-pdf, install-pdf-recursive, install-html) + (install-html-recursive): Remove. + * Makefile.in: Regenerate. + + * Makefile.in: Regenerate. + * aclocal.m4: Likewise. + * config.in: Likewise. + * configure: Likewise. + +2009-08-21 Daniel Gutson + + * elf32-arm.c (arch_has_thumb2_nop): New function. + (arch_has_arm_nop): New function. + (elf32_arm_final_link_relocate): NOP opcodes changed. + +2009-08-16 Doug Evans + + * opncls.c (bfd_close): Until BFD_IN_MEMORY has an iovec, + at least don't leak memory. + +2009-08-13 DJ Delorie + + * elf32-m32c.c (m32c_elf_relax_delete_bytes): Adjust symbol sizes + if needed. + +2009-08-12 Nick Clifton + + * po/fi.po: Updated Finnish translation. + +2009-08-11 Bernd Schmidt + + Merge some FRV FDPIC changes into the Blackfin code. + * elf32-bfin.c (struct bfinfdpic_elf_link_hash_table): Add pointer to + summary reloc information. + (bfinfdpic_dynamic_got_plt_info): New. + (_bfin_create_got_section): Create the PLT section here. + (elf32_bfinfdpic_create_dynamic_sections): Not here. + (_bfinfdpic_count_nontls_entries): Move out of... + (_bfinfdpic_count_got_plt_entries): ... here. + (_bfinfdpic_count_relocs_fixups): Likewise. + (_bfinfdpic_reset_got_plt_entries): New. + (_bfinfdpic_size_got_plt): Move out of... + (elf32_bfinfdpic_size_dynamic_sections): ... here. + (bfinfdpic_relocate_section): Be careful not to call + _bfinfdpic_add_rofixup or _bfinfdpic_add_dyn_reloc for deleted relocs. + (bfinfdpic_check_discarded_relocs, bfinfdpic_elf_discard_info): + New functions. + (elf_backend_discard_info): Define for FD-PIC. + +2009-08-11 Alan Modra + + * elflink.c: Add FIXMEs for some places that require octets_per_byte + adjustments. + * elf-eh-frame.c: Likewise. + * merge.c: Likewise. + +2009-08-11 Alan Modra + + * configure.in: Remove elf-ifunc.lo from common ELF files. Add + to x86 and x86_64 configurations. + * configure: Regenerate. + +2009-08-10 Jan Kratochvil + + Stop using bfd_usrdata in libbfd. + * coff-stgo32.c (bfd_coff_go32stub): Remove. + (stub_bytes, comment): Replace STUBSIZE by GO32_STUBSIZE. + (adjust_filehdr_in_post): Declare the abfd parameter as unused. + Replace STUBSIZE by GO32_STUBSIZE. Save now the stub in + filehdr_dst->u.go32.stub. New comment with the reason. + (adjust_filehdr_out_pre): Replace STUBSIZE by GO32_STUBSIZE. + Substitute the removed macro bfd_coff_go32stub. + (adjust_filehdr_out_post, adjust_scnhdr_in_post, adjust_scnhdr_out_pre) + (adjust_scnhdr_out_post, adjust_aux_in_post, adjust_aux_out_pre) + (adjust_aux_out_post): Replace STUBSIZE by GO32_STUBSIZE. + (create_go32_stub, go32_stubbed_coff_bfd_copy_private_bfd_data): + Replace STUBSIZE by GO32_STUBSIZE. Substitute the removed macro + bfd_coff_go32stub. + * coffcode.h (coff_mkobject_hook): Initialize coff->go32stub. + * libcoff-in.h (coff_data_type): New field go32stub. + * libcoff.h: Regenerated. + +2009-08-10 Jan Kratochvil + + Fix go32 stub preservation by objcopy. + * coff-stgo32.c (adjust_filehdr_in_post): Use bfd_malloc. + (go32_stubbed_coff_bfd_copy_private_bfd_data): Optionally allocate OBFD + go32stub. + +2009-08-10 Nathan Sidwell + + * elf32-arm.c (elf32_arm_size_stubs): Don't die on undefined local + symbols. + (elf32_arm_final_link_relocate): Treat local undefined symbols the + same as global undefined symbols. + (elf32_arm_relocate_section): Give an error for local undefined + non-weak symbols, unless the reloc will not use the symbol. + +2009-08-10 Nathan Sidwell + + * elf32-ppc.c (shared_stub_entry, stub_entry): Use r12, not r11. + (ppc_elf_relax_section): Use symbol index to distinguish + relocatable stubs. + +2009-08-10 Alan Modra + + * elf32-ppc.c (ppc_elf_relax_section): Ignore non-code sections. + +2009-08-10 Alan Modra + + * elflink.c (_bfd_elf_adjust_dynamic_symbol): Don't clear plt + info for STT_GNU_IFUNC. + * elf32-ppc.c (ppc_elf_check_relocs): Count a needed plt entry + on got refs in case the symbol turns out to be ifunc. + (ppc_elf_gc_sweep_hook): Similarly. + (ppc_elf_adjust_dynamic_symbol): Adjust assertion. + (allocate_dynrelocs): Don't specially allocate got relocs for ifunc. + (ppc_elf_size_dynamic_sections): Likewise. + (ppc_elf_relocate_section): Likewise. + +2009-08-09 Bernd Schmidt + + From Mike Frysinger + * elf32-bfin.c (bfin_howto_table, bfin_reloc_map, bfin_check_relocs, + bfin_final_link_relocate, bfin_relocate_section, bfin_gc_sweep_hook, + _bfinfdpic_emit_got_relocs_plt_entries, bfinfdpic_relocate_section, + bfinfdpic_gc_sweep_hook, bfinfdpic_check_relocs, + bfin_finish_dynamic_symbol, bfd_bfin_elf32_create_embedded_relocs): + Adjust to match the renamed reloc definitions. + +2009-08-08 Alan Modra + + PR 10494 + * elf.c (_bfd_elf_make_section_from_shdr): When setting up section + LMAs, use ELF_IS_SECTION_IN_SEGMENT to match sections with headers. + +2009-08-07 Tom Tromey + + * elf32-microblaze.c (microblaze_elf_check_relocs): Avoid strict + aliasing error. + +2009-08-06 Michael Eager + + * Makefile.am: Add cpu-microblaze.{lo,c}, elf32-microblaze.{lo,c}. + * Makefile.in: Regenerate. + * archures.c: Add bfd_arch_microblaze. + * bfd-in2.h: Regenerate. + * config.bfd: Add microblaze target. + * configure.in: Add bfd_elf32_microblaze_vec target. + * configure: Regenerate. + * cpu-microblaze.c: New. + * elf32-microblaze.c: New. + * libbfd-in.h: Add prototype _bfd_dwarf2_fixup_section_debug_loc(). + * libbfd.h: Regenerate. + * reloc.c: Add MICROBLAZE relocations. + * section.c: Add struct relax_table and relax_count to section. + * targets.c: Add bfd_elf32_microblaze_vec. + +2009-08-06 Jakub Jelinek + Alan Modra + + PR binutils/10492 + * elf.c (sym_is_global): Return true even for BSF_GNU_UNIQUE + symbols. + * elf32-mips.c (mips_elf_sym_is_global): Likewise. + * elfn32-mips.c (mips_elf_sym_is_global): Likewise. + +2009-08-06 Nathan Sidwell + + * elf32-arm.c (elf32_arm_size_stubs): Call layout_sections_again + at least once when fixing cortex-a8. + +2009-08-05 Chao-ying Fu + + * elf32-mips.c (mips_reloc_map): Add BFD_RELOC_MIPS_JALR. + * elfxx-mips.c (JAL_TO_BAL_P): New define to transform JAL to BAL + for CPUs. It is true for RM9000. + (JALR_TO_BAL_P): New define to transform JALR to BAL. It is true + for all CPUs. + (mips_elf_perform_relocation): Use JAL_TO_BAL_P and JALR_TO_BAL_P + to guard the transformation. + +2009-08-05 Trevor Smigiel + + * elf32-spu.h (spu_elf_params): Add member emit_fixups. + (spu_elf_size_sections): Declare prototype. + * elf32-spu.c (spu_link_hash_table): Add member sfixup. + (FIXUP_RECORD_SIZE, FIXUP_GET, FIXUP_PUT): New macros. + (spu_elf_emit_fixup): New function. + (spu_elf_relocate_section): Emit fixup for each SPU_ADDR32. + (spu_elf_size_sections): New function. + +2009-08-05 Nathan Sidwell + + * elf32-arm.c (elf32_arm_stub_type): Add arm_stub_a8_veneer_lwm. + (arm_build_one_stub): Build a8 veneers as a separate pass. + (cortex_a8_erratum_scan): Add prev_num_a8_fixes and stub_changed_p + parameters. Use them to check if we create a different a8 fixup + than the previous pass. + (elf32_arm_size_stubs): Move scope of stub_changed and + prev_num_a8_fixes into main loop. + (elf32_arm_build_stubs): Build a8 veneers in a second pass. + +2009-08-04 Alan Modra + + * elf32-ppc.c (ppc_elf_relax_section): Correct conditions under + which find_plt_ent is called. Delete redundant code. + +2009-08-03 H.J. Lu + + PR binutils/10363 + * elf.c (bfd_elf_string_from_elf_section): Return NULL on + invalid string offset. + +2009-08-03 H.J. Lu + + PR ld/10433 + * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Set got + to htab->init_got_offset and plt to htab->init_plt_offset + when discarding space for dynamic relocations. + +2009-08-03 Alan Modra + + * elf32-ppc.c (struct plt_entry): Revise comments. + (ppc_elf_check_relocs): Don't create needless plt_entry info + for non-pie executables. Don't test info->pie when info->shared + already covers that case. + (ppc_elf_gc_sweep_hook): Adjust for above change. + (add_stub_sym): Don't test info->pie when info->shared tested. + (allocate_dynrelocs, ppc_elf_size_dynamic_sections): Likewise. + (write_glink_stub, ppc_elf_finish_dynamic_symbol): Likewise. + (ppc_elf_relax_section): Adjust find_plt_ent arguments. + (ppc_elf_relocate_section): Likewise. + +2009-08-03 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Always add a plt ref count + for local ifunc symbols in non-pie executables, regardless of + reloc type. Don't specially create ifunc dyn relocs. Tidy ifunc + code so that it's obvious that we only do anything special for + local ifunc syms. + (ppc_elf_gc_sweep_hook): Adjust to suit check_relocs changes. + (allocate_dynrelocs): Correct comment for syms defined in plt. + Don't specially allocate ifunc dyn relocs. + (ppc_elf_relax_section): Relax branches to ifunc plt entries too. + (ppc_elf_relocate_section): Set "relocation" value for ifunc + syms in non-pie executables. No specially allocated dyn relocs + for ifunc to write. Allow for local sym on R_PPC_RELAX32_PLT. + (ppc_elf_finish_dynamic_symbol): Set value of ifunc symbols in + a non-pie executable. + +2009-08-02 H.J. Lu + Jakub Jelinek + + PR ld/6443 + * elf32-i386.c (elf_i386_tls_transition): Check executable + instead of shared for TLS when building PIE. + (elf_i386_check_relocs): Likewise. + (elf_i386_allocate_dynrelocs): Likewise. + (elf_i386_relocate_section): Likewise. + + * elf64-x86-64.c (elf64_x86_64_tls_transition): Check executable + instead of shared for TLS when building PIE. + (elf64_x86_64_check_relocs): Likewise. + (elf64_x86_64_allocate_dynrelocs): Likewise. + (elf64_x86_64_relocate_section): Likewise. + +2009-07-31 Anthony Green + + * config.bfd (targ_cpu): Add moxie-uclinux support. + +2009-07-31 Hans-Peter Nilsson + + * linker.c (fix_syms): Consider SEC_LOAD when choosing section. + +2009-07-30 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Always set up sections + used by indirect function support. Count dynamic relocs for + ifunc syms. + (ppc_elf_adjust_dynamic_symbol): Tweak for ifunc. + (allocate_dynrelocs): Allocate all non-dynamic ifunc plt entries + in iplt and their relocs in reliplt. Don't make ifunc syms + dynamic. Allocate got entry relocs for non-dynamic ifunc in + reliplt. Handle other dynamic relocs for ifunc. + (ppc_elf_size_dynamic_sections): Alloc dyn relocs for static + ifunc in reliplt, likewise relocs for got against local ifunc. + Typo fix on reliplt size adjust. + (ppc_elf_relocate_section): Don't use plt scheme of allocating + relocs 1-1 with entries for iplt, instead just add using + reloc_count. Write got relocs and dyn relocs for ifunc to reliplt. + Error on invalid ifunc dyn relocs. + (ppc_elf_finish_dynamic_symbol): Adjust for non-dynamic ifunc plt + in iplt/reliplt. + * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_JMP_IREL, + R_PPC64_REL16, R_PPC64_REL16_LO, R_PPC64_REL16_HI, R_PPC64_REL16_HA. + (ppc64_elf_reloc_type_lookup): Handle new relocs. + (ppc64_elf_check_relocs): Likewise. Count dyn relocs for ifunc. + (allocate_dynrelocs): As for elf32-ppc.c above. + (ppc64_elf_size_dynamic_sections): Likewise. + (ppc_build_one_stub): Put non-dynamic ifunc plt call stubs in iplt, + and their relocs in reliplt. Use R_PPC64_JMP_IREL. + (ppc_size_one_stub): Similarly. + (ppc64_elf_relocate_section): As for elf32-ppc.c above. Handle new + relocs too. + (ppc64_elf_finish_dynamic_symbol): As for elf32-ppc.c above. + +2009-07-29 Hans-Peter Nilsson + + * elf64-mmix.c (mmix_elf_relax_section): Revert 2009-05-27 + change. Add note to head comment. + +2009-07-28 Jan Beulich + + * archive.c (get_extended_arelt_filename): Remove redundant + range check on index. + +2009-07-27 Doug Kwan + + * elf32-arm.c (stub_hash_newfunc): Initialize field output_name. + +2009-07-27 H.J. Lu + + * archures.c bfd_*_arch): Sorted. + (bfd_archures_list): Likewise. + +2009-07-27 M R Swami Reddy + + * elf32-cr16.c (elf_cr16_final_link_relocate): Add code to handle + to R_cr16_NUM32 relocation. + +2009-07-26 Michael Eager + + * archures.c: Add bfd_mach_ppc_405 + * bfd-in2.h: Same. + +2009-07-25 H.J. Lu + + * cpu-i386.c (bfd_x86_64_arch): Fix comment typos. + * cpu-l1om.c (bfd_l1om_arch): Likewise. + +2009-07-25 H.J. Lu + + * archures.c (bfd_architecture): Add bfd_arch_l1om. + (bfd_l1om_arch): New. + (bfd_archures_list): Add &bfd_l1om_arch. + * bfd-in2.h: Regenerated. + + * config.bfd (targ64_selvecs): Add bfd_elf64_l1om_vec if + bfd_elf64_x86_64_vec is supported. Add bfd_elf64_l1om_freebsd_vec + if bfd_elf64_x86_64_freebsd_vec is supported. + (targ_selvecs): Likewise. + + * configure.in: Support bfd_elf64_l1om_vec and + bfd_elf64_l1om_freebsd_vec. + * configure: Regenerated. + + * cpu-l1om.c: New. + + * elf64-x86-64.c (elf64_l1om_elf_object_p): New. + (bfd_elf64_l1om_vec): Likewise. + (bfd_elf64_l1om_freebsd_vec): Likewise. + + * Makefile.am (ALL_MACHINES): Add cpu-l1om.lo. + (ALL_MACHINES_CFILES): Add cpu-l1om.c. + * Makefile.in: Regenerated. + + * targets.c (bfd_elf64_l1om_vec): New. + (bfd_elf64_l1om_freebsd_vec): Likewise. + (_bfd_target_vector): Add bfd_elf64_l1om_vec and + bfd_elf64_l1om_freebsd_vec. + +2009-07-24 Trevor Smigiel + Alan Modra + + * reloc.c (BFD_RELOC_SPU_ADD_PIC): Define. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * elf32-spu.c (elf_howto_table): Add entries SPU_ADD_PIC. + (spu_elf_bfd_to_reloc_type): Handle SPU_ADD_PIC. + (spu_elf_relocate_section): Patch instructions marked by SPU_ADD_PIC. + +2009-07-23 H.J. Lu + + PR ld/10434 + * elf64-x86-64.c (elf64_x86_64_check_relocs): Check executable + instead of shared for R_X86_64_TPOFF32. + (elf64_x86_64_relocate_section): Likewise. + +2009-07-23 Ulrich Drepper + + * elf-bfd.h (struct elf_link_hash_entry): Add unique_global field. + * elf.c (swap_out_syms): Set binding to STB_GNU_UNIQUE for symbols + with the BSF_GNU_UNIQUE flag bit set. + * elfcode.h (elf_slurp_symbol_table): Set the BSF_GNU_UNIQUE flag + for symbols with STB_GNU_UNIQUE binding. + * elflink.c (_bfd_elf_merge_symbol): Set unique_global for symbols + with the STB_GNU_UNIQUE binding. + (elf_link_add_object_symbols): Set the BSF_GNU_UNIQUE flag for + symbols with STB_GNU_UNIQUE binding. Set STB_GNU_UNIQUE for + symbols with the unique_global field set. + (elf_link_output_extsym): Set unique_global field for symbols with + the STB_GNU_UNIQUE binding. + * syms.c (struct bfd_symbol): Define BSF_GNU_UNIQUE flag bit. + (bfd_print_symbol_vandf): Print a 'u' character for BSF_GNU_UNIQUE + symbols. + (bfd_decode_symclass): Return a 'u' character for BSF_GNU_UNIQUE + symbols. + * bfd-in2.h: Regenerate. + +2009-07-22 H.J. Lu + + * elflink.c (elf_link_output_extsym): Revert the last change. + +2009-07-22 H.J. Lu + + PR ld/10433 + * elflink.c (elf_link_output_extsym): Special case ifunc syms + when ref_regular, not def_regular. + +2009-07-21 H.J. Lu + + PR ld/10426 + * elflink.c (elf_link_add_object_symbols): Turn an IFUNC symbol + from a DSO into a normal FUNC symbol. + (elf_link_output_extsym): Turn an undefined IFUNC symbol into + a normal FUNC symbol. + +2009-07-17 Chao-ying Fu + + * elfxx-mips.c (LOAD_INTERLOCKS_P): New define. + (_bfd_mips_elf_size_dynamic_sections): For CPUs without load + interlocking, the last PLT entry needs a nop in the branch delay slot. + (_bfd_mips_elf_finish_dynamic_symbol): For CPUs with load itnerlocking, + output the last two PLT entries in reverse order. + +2009-07-16 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Don't get local + STT_GNU_IFUNC symbol for relocatable link. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + +2009-07-10 H.J. Lu + + * bfdio.c (bfd_iovec): Add comments for bmmap. + * bfd-in2.h: Regenerated. + +2009-07-10 H.J. Lu + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerated. + +2009-07-10 Doug Kwan + + * elf32-arm.c (stub_hash_newfunc): Initialize fields + target_addend and orig_insn. + +2009-07-10 Tom Tromey + + * Makefile.am (dwarf2.lo): Use dwarf2.h, not elf/dwarf2.h. + (elf-eh-frame.lo): Likewise. + (elf32-bfin.lo): Likewise. + (elf32-frv.lo): Likewise. + (elf32-xc16x.lo): Likewise. + * Makefile.in: Rebuild. + * dwarf2.c: Included dwarf.h, not elf/dwarf2.h. + * elf-eh-frame.c: Likewise. + * elf32-bfin.c: Likewise. + * elf32-frv.c: Likewise. + * elf32-xc16x.c: Likewise. + +2009-07-10 Julian Brown + + * elf32-arm.c (arm_build_one_stub): Use the hash entry of the + symbol a stub entry is derived from, not the entry for the stub + itself, in call to elf32_arm_final_link_relocate. + +2009-07-10 H.J. Lu + + * elf.c (_bfd_elf_get_synthetic_symtab): Remove leading zeros + when reporting addends. + +2009-07-10 Alan Modra + + * elf32-spu.c (spu_elf_size_stubs): Do set up soft-icache manager + data even when no stubs. + (spu_elf_place_overlay_data, spu_elf_build_stubs): Adjust. + +2009-07-10 Alan Modra + + * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_IRELATIVE. + (ppc_elf_get_synthetic_symtab): Report addend. + (PLT_IFUNC): Define. + (struct ppc_elf_link_hash_table): Add iplt and reliplt. + (ppc_elf_create_glink): New function. + (ppc_elf_create_dynamic_sections): Use it. + (ppc_elf_add_symbol_hook): Set has_ifunc_symbols. + (update_local_sym_info): Allocate space for local_plt array. + Don't bump local_got_refcounts for PLT_IFUNC. Return local_plt + entry pointer. + (is_branch_reloc): New function. + (ppc_elf_check_relocs): Handle STT_GNU_IFUNC symbols. + (ppc_elf_gc_sweep_hook): Likewise. + (ppc_elf_adjust_dynamic_symbol): Likewise. + (allocate_dynrelocs): Likewise. + (ppc_elf_size_dynamic_sections): Likewise. + (ppc_elf_relocate_section): Likewise. + (branch_reloc_hash_match): Use is_branch_reloc. + (ppc_elf_tls_optimize): Adjust for local_plt. + (write_glink_stub): New function, extracted from.. + (ppc_elf_finish_dynamic_symbol): ..here. Handle STT_GNU_IFUNC. + (ppc_elf_finish_dynamic_sections): Only write plt resolver and + branch table when dynamic. + (elf_backend_post_process_headers): Define. + * elf64-ppc.c (elf_backend_post_process_headers): Define. + (ppc64_elf_howto_raw): Add R_PPC64_IRELATIVE. + (ppc64_elf_get_synthetic_symtab): Report addend. + (struct ppc_stub_hash_entry): Add plt_ent. + (PLT_IFUNC): Define. + (struct ppc_link_hash_table): Add iplt and reliplt. + (create_linkage_sections): Make .iplt and .rela.iplt sections. + (ppc64_elf_add_symbol_hook): Set has_ifunc_symbols. + (update_local_sym_info): Allocate space for local_plt array. + Don't bump local_got_ents for PLT_IFUNC. Return local_plt + entry pointer. + (update_plt_info): Pass pointer to plt_entry rather than sym hash, + and don't change hash flags here. + (is_branch_reloc): New function. + (ppc64_elf_check_relocs): Handle STT_GNU_IFUNC. + (ppc64_elf_gc_sweep_hook): Likewise. + (ppc64_elf_adjust_dynamic_symbol): Likewise. + (allocate_dynrelocs): Likewise. + (ppc64_elf_size_dynamic_sections): Likewise. + (ppc_build_one_stub, ppc_size_one_stub): Likewise. + (ppc64_elf_size_stubs): Likewise. + (ppc64_elf_relocate_section): Likewise. + (get_sym_h): Adjust for local_plt. + (branch_reloc_hash_match): Use is_branch_reloc. + (ppc_type_of_stub): Pass plt_entry pointer and handle ifunc. + (ppc64_elf_toc): Ignore SEC_EXCLUDE sections. + +2009-07-10 Alan Modra + + * elf.c (_bfd_elf_get_synthetic_symtab): Report addends. + +2009-07-10 Alan Modra + + * elf-bfd.h (struct elf_link_hash_entry): Clarify ref_regular + and ref_regular_nonweak comment. + * elflink.c (elf_link_output_extsym): Special case ifunc syms + when def_regular, not ref_regular. + (elf_link_add_object_symbols): Don't set needs_plt on ifunc syms,.. + * elf32-i386.c (elf_i386_check_relocs): ..set it here instead.. + * elf64-x86-64.c (elf64_x86_64_check_relocs): ..and here. + +2009-07-09 Alan Modra + + * elf32-spu.c (mark_functions_via_relocs): Init broken_cycle field + of malloc'd struct call_info. + (pasted_function): Likewise, priority too. + +2009-07-07 Alan Modra + + * elf32-spu.c (spu_elf_auto_overlay): Take into account section + alignment when packing sections into overlays. + +2009-07-03 Cary Coutant + + * dwarf2.c (decode_line_info): Ignore DW_LNE_set_discriminator. + +2009-07-03 Dave Korn + + * coffcode.h (sec_to_styp_flags): Partially revert (functional + changes only) earlier patch:- + +2009-06-25 Kai Tietz + + * coffcode.h (sec_to_styp_flags): Set discardable for .reloc and + give .debug and .reloc data characteristics. + (DOT_RELOC): New define for .reloc section string. + (coff_write_object_contents): Use DOT_RELOC instead of string. + +2009-07-02 Tom Tromey + + * aoutx.h (aout_get_external_symbols): Declare 'amt' locally. + * bfdwin.c (bfd_free_window): Cast to unsigned long. + +2009-07-01 Nick Clifton + + * elf-m10300.c: Remove trailing white space. + * reloc.c: Likewise. + +2009-07-01 Douglas B Rupp + + * bfd.m4 (BFD_HAVE_TIME_TYPE_MEMBER, + BFD_HAVE_SYS_STAT_TYPE_MEMBER): New config functions. + * configure.in: Use them. + * configure: Regenerate. + * config.in: Regenerate. + * vmsutil.c: Include sysdep.h, remove ansidecl.h. + #define _BSD_SOURCE. Add comments. + (vms_file_stats_name): Calculate creation date based on available + runtime data. Return 1 for version instead of 0. + +2009-07-01 Nick Clifton + + PR 10072 + * elf32-arm.c (elf32_arm_final_link_relocate): Add code to handle + to R_ARM_THM_PC8 relocation. + +2009-06-29 Nick Clifton + + * elf-m10300.c (mn10300_elf_relax_section): Allow for the + different uses of the relocations addend when a symbol is in a + merged section. + +2009-06-27 H.J. Lu + + PR ld/10337 + * elf.c (bfd_section_from_shdr): Don't change sh_link for + SHT_REL/SHT_RELA sections on executable nor shared library. + Treat SHT_REL/SHT_RELA sections with sh_link set to SHN_UNDEF + as a normal section. + +2009-06-25 Nick Clifton + + * elf-m10300.c (mn10300_elf_relax_section): Handle non-section + symbols with SEC_MERGE flag. + +2009-06-25 Kai Tietz + + * coffcode.h (sec_to_styp_flags): Set discardable for .reloc and + give .debug and .reloc data characteristics. + (DOT_RELOC): New define for .reloc section string. + (coff_write_object_contents): Use DOT_RELOC instead of string. + +2009-06-25 Tristan Gingold + + * mach-o-target.c (bfd_mach_o_get_dynamic_symtab_upper_bound) + (bfd_mach_o_canonicalize_dynamic_symtab) + (bfd_mach_o_get_synthetic_symtab): Defines. + (TARGET_NAME_BACKEND): Add bfd_mach_o_print_thread entry. + (TARGET_NAME): Use Mach-O specific functions for dynamic. + + * mach-o-i386.c (bfd_mach_o_i386_swap_reloc_in): Fix howto indexes + for scattered relocations. + (bfd_mach_o_i386_print_thread): New function. + (bfd_mach_o_print_thread): Define. + + * mach-o.c (text_section_names_xlat): Add an entry for __const. + (bfd_mach_o_canonicalize_one_reloc, bfd_mach_o_canonicalize_relocs): + New functions extracted from ... + (bfd_mach_o_canonicalize_reloc): ... This. Simplified. + (bfd_mach_o_get_dynamic_reloc_upper_bound): New function. + (bfd_mach_o_canonicalize_dynamic_reloc): New function. + (bfd_mach_o_i386_flavour_string): Adjusted after enum renaming. + (bfd_mach_o_ppc_flavour_string): Reindentation. Add 64 bits cases. + (bfd_mach_o_scan_read_dylinker): Do not create a section anymore. + Set name_str field. + (bfd_mach_o_scan_read_dylib): Ditto. + (bfd_mach_o_scan_read_thread): Set mdata at declaration. Add comments, + reindent. + (bfd_mach_o_scan_read_dysymtab): Set mdata at declaration. Correctly + decode isym and flags on little endian targets. Set dysymtab field. + (bfd_mach_o_scan_start_address): Adjust for enum names. + (bfd_mach_o_lookup_section): Do not look for segments anymore. + (bfd_mach_o_print_section): Display bfd section name. + (bfd_mach_o_print_segment): Display none if no name. + (bfd_mach_o_print_dysymtab): Display next index for local, external + and undefined symbols. + (bfd_mach_o_bfd_print_private_bfd_data): Adjust code by using name_str. + Display dylinker name. Display thread and unixthread commands content. + (bfd_mach_o_print_thread): New macro. + + * mach-o.h (bfd_mach_o_mach_header_magic): Align numbers. + (bfd_mach_o_ppc_thread_flavour): Ditto. + (bfd_mach_o_i386_thread_flavour): Ditto. + (BFD_MACH_O_PPC_THREAD_STATE_NONE): New enum. + (BFD_MACH_O_x86_THREAD_STATE_NONE): Replaces + BFD_MACH_O_THREAD_STATE_NONE. + (bfd_mach_o_segment_command): Remove segment field. + (bfd_mach_o_thread_flavour): Field offset is now unsigned long. + (bfd_mach_o_dylinker_command): Remove section field, add name_str. + (bfd_mach_o_prebound_dylib_command): Ditto. + (bfd_mach_o_dylib_command): Ditto. + (bfd_mach_o_prebound_dylib_command): Remove section field. + (mach_o_data_struct): Add dysymtab field. + (bfd_mach_o_backend_data): Add _bfd_mach_o_print_thread field. + (bfd_mach_o_get_reloc_upper_bound, bfd_mach_o_canonicalize_reloc) + (bfd_mach_o_build_commands): Remove parameter names and attributes. + (bfd_mach_o_get_dynamic_reloc_upper_bound) + (bfd_mach_o_canonicalize_dynamic_reloc): New prototypes. + +2009-06-25 Rafael Avila de Espindola + + * plugin.c (load_plugin): Use stat and S_ISREG instead of the d_type + field of struct dirent. + +2009-06-23 Tristan Gingold + + * vms.c (vms_get_synthetic_symtab): Remove duplicate definition + of this macro. Fix indentation. + +2009-06-22 Christophe Lyon + + * elf32-arm.c (elf32_arm_size_stubs): Use PLT address as + destination for defined dynamic symbols when deciding whether to + insert a stub or not. + (allocate_dynrelocs): Make sure functions are not marked as Thumb + when actually accessed through a PLT, even when generating a + shared lib. + +2009-06-22 Tristan Gingold + + * mach-o.c (bfd_mach_o_canonicalize_reloc): Append a sentinel to + the relocs array. + +2009-06-22 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Handle R_PPC_RELAX* in switch. + * elf32-v850.c (v850_elf_relocate_section): Warning fix. + +2009-06-22 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_opd): Avoid gcc warning. + +2009-06-19 H.J. Lu + + * elflink.c (elf_link_add_object_symbols): Avoid warning + from -Wjump-misses-init in gcc 4.5.0. + +2009-06-19 H.J. Lu + + * elf32-i386.c (elf_i386_check_relocs): Properly check local + symbol on error. + * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. + +2009-06-19 H.J. Lu + + * elf32-i386.c (elf_i386_tls_transition): Add a parameter, + r_symndx. Report local symbol name on error. + (elf_i386_check_relocs): Updated. Report local symbol name on + error. + (elf_i386_gc_sweep_hook): Updated. + (elf_i386_relocate_section): Likewise. + + * elf64-x86-64.c (elf64_x86_64_tls_transition): Add a parameter, + r_symndx. Report local symbol name on error. + (elf64_x86_64_check_relocs): Updated. Report local symbol name + on error. + (elf64_x86_64_gc_sweep_hook): Updated. + (elf64_x86_64_relocate_section): Likewise. + +2009-06-19 Tristan Gingold + + * mach-o.c (bfd_mach_o_print_private_header): Fix format character. + +2009-06-19 Tristan Gingold + + * mach-o.c (bfd_mach_o_scan_read_symtab_symbols): Add prototype. + (bfd_mach_o_version): Use bfd_mach_o_get_data instead of direct access. + (bfd_mach_o_valid): Ditto. + (bfd_mach_o_wide_p): Ditto. + (bfd_mach_o_canonicalize_reloc): Ditto. + (bfd_mach_o_build_commands): Ditto. + (bfd_mach_o_scan_read_thread): Ditto. + (bfd_mach_o_flatten_sections): Ditto. + (bfd_mach_o_scan_start_address): Ditto. + (bfd_mach_o_lookup_section): Ditto. + (bfd_mach_o_core_fetch_environment): Ditto. + (bfd_mach_o_write_contents): Ditto. Handle reexport_dylib. + (bfd_mach_o_scan_write_relocs): Adjust for bfd_mach_o_get_data. + (bfd_mach_o_scan_write_symtab): Ditto. + Use macros instead of hard-coded values. + (bfd_mach_o_scan_read_symtab_symbol): Make the function static. + Use bfd_mach_o_get_data instead of direct access. Use macros + instead of hard-coded values. + (bfd_mach_o_scan_read_symtab_strtab): Make the function static. + Remove sym argument and get section from mdata. + Move code into the else branch. + (bfd_mach_o_scan_read_symtab_symbols): Make the function static. + Remove sym argument and get section from mdata. Adjust code. + (bfd_mach_o_scan_read_dylib): Move assertion into the created + switch (which replaces consecutive if statements). + (bfd_mach_o_scan_read_dysymtab): Rename seg to cmd. Load + module table, table of content, indirect symbols and external + referenced symbols. + (bfd_mach_o_scan_read_symtab): Renames seg to symtab. Set symtab + field. + (bfd_mach_o_scan_read_linkedit): New function. + (bfd_mach_o_scan_read_str): Ditto. + (bfd_mach_o_count_symbols): Simplify the code by using the symtab + field of mdata. + (bfd_mach_o_get_symtab_upper_bound): Remove check as + bfd_mach_o_count_symbols never returns an error. + (bfd_mach_o_canonicalize_symtab): Simplify the code by using the + symtab field (there might be only one symtab). + (bfd_mach_o_scan_read_command): Handle reexported dylib. + Handle sub frameworks, sub umbrella, sub library and sub client. + Read code signature and segment split info commands. + (bfd_mach_o_scan): Reindent. + (bfd_mach_o_xlat_name): New type. + (bfd_mach_o_print_flags): New function. + (bfd_mach_o_get_name): Ditto. + (bfd_mach_o_cpu_name): New variable. + (bfd_mach_o_filetype_name, bfd_mach_o_header_flags_name) + (bfd_mach_o_section_type_name) + (bfd_mach_o_section_attribute_name) + (bfd_mach_o_load_command_name): New variables. + (bfd_mach_o_print_private_header): New function. + (bfd_mach_o_print_section_map): New function extracted from + bfd_mach_o_print_private_bfd_data. + (bfd_mach_o_print_section): Ditto. Print more infos. + (bfd_mach_o_print_segment): Ditto. + (bfd_mach_o_print_dysymtab): Ditto. + (bfd_mach_o_bfd_print_private_bfd_data): Reworked. Handle + load weak dylib, reexport dylib and id dylib. + Handle code signature and segment_split info. + Handle sub frameworks, sub umbrella, sub library and sub client. + (bfd_mach_o_section_get_nbr_indirect): New function. + + * mach-o.h (BFD_MACH_O_REFERENCE_MASK): New macro. Add comment. + (bfd_mach_o_header_flags): New enum to define header flags. + (bfd_mach_o_section_attribute): New enum to replace ... + (BFD_MACH_O_S_ATTR_LOC_RELOC, BFD_MACH_O_S_ATTR_EXT_RELOC, + BFD_MACH_O_S_ATTR_SOME_INSTRUCTIONS, BFD_MACH_O_S_ATTR_DEBUG, + BFD_MACH_O_S_SELF_MODIFYING_CODE, BFD_MACH_O_S_ATTR_LIVE_SUPPORT, + BFD_MACH_O_S_ATTR_NO_DEAD_STRIP, BFD_MACH_O_S_ATTR_STRIP_STATIC_SYMS, + BFD_MACH_O_S_ATTR_NO_TOC, BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS): ... + these removed macros. + (BFD_MACH_O_NLIST_SIZE, BFD_MACH_O_NLIST_64_SIZE): New macros. + (bfd_mach_o_dylib_module): New type. + (BFD_MACH_O_DYLIB_MODULE_SIZE, BFD_MACH_O_DYLIB_MODULE_64_SIZE): New + macros. + (bfd_mach_o_dylib_table_of_content): New type. + (BFD_MACH_O_TABLE_OF_CONTENT_SIZE): New macro. + (bfd_mach_o_dylib_reference): New type. + (BFD_MACH_O_REFERENCE_SIZE): New macro. + (bfd_mach_o_dysymtab_command): Add fields for loaded and decoded + modules, toc, references and indirect syms. + (BFD_MACH_O_INDIRECT_SYMBOL_SIZE): New macro. + (bfd_mach_o_dylinker_command): Remove cmd and cmdsize fields (were + unused). Add comment. + (bfd_mach_o_dylib_command): Ditto. + (bfd_mach_o_prebound_dylib_command): Ditto. + (bfd_mach_o_linkedit_command): New type. + (bfd_mach_o_str_command): New type. + (bfd_mach_o_load_command): Add linkedit and str fields. + (mach_o_data_struct): Add symtab field. + (bfd_get_mach_o_data): Renamed to ... + (bfd_mach_o_get_data): ... this new macro. + (bfd_mach_o_scan_read_symtab_symbol, + bfd_mach_o_scan_read_symtab_strtab, + bfd_mach_o_scan_read_symtab_symbols): Prototypes removed. + + * mach-o-i386.c (bfd_mach_o_i386_mkobject): Use bfd_mach_o_get_data + instead of direct access. + +2009-06-19 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Allow local symbols for + R_PPC_PLTREL24 relocs. + (ppc_elf_relocate_section): Likewise. + +2009-06-19 Alan Modra + + * elf32-ppc.c (find_plt_ent): Pass pointer to plist rather than + pointer to sym hash. Update all uses. + (update_plt_info): Likewise. Don't check addend here. + +2009-06-18 H.J. Lu + + * elf32-i386.c (elf_i386_check_relocs): Remove isymbuf and use + bfd_sym_from_r_symndx. + * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. + +2009-06-18 Alan Modra + + * elf-bfd.h (struct sym_sec_cache): Delete. + (struct sym_cache): New. + (bfd_section_from_r_symndx): Delete prototype. + (bfd_sym_from_r_symndx): Define prototype. + * elf.c (bfd_section_from_r_symndx): Delete, replace with.. + (bfd_sym_from_r_symndx): ..new function. + * elf32-arm.c: Update all uses of struct sym_sec_cache and + bfd_section_from_r_symndx to new struct and function. + * elf32-bfin.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68hc1x.c: Likewise. + * elf32-m68hc1x.h: Likewise. + * elf32-m68k.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfxx-sparc.c: Likewise. + * elfxx-sparc.h: Likewise. + +2009-06-18 H.J. Lu + + * elf32-i386.c (elf_i386_check_relocs): Cache or free isymbuf. + * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. + +2009-06-18 Nick Clifton + + * elflink.c (elf_link_sort_relocs): Return early if there are no + relocs to sort. + +2009-06-18 Dave Korn + + Merge cegcc and mingw32ce target name changes from + CeGCC project: + + 2007-12-25 Pedro Alves + + * config.bfd: Add arm*-*-cegcc* target. + + 2007-12-17 Pedro Alves + + * config.bfd: Add arm-*-mingw32ce* target. + +2009-06-17 H.J. Lu + + * elf-bfd.h (_bfd_elf_allocate_ifunc_dyn_relocs): New. + * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Likewise. + * elf32-i386.c (elf_i386_allocate_dynrelocs): Use it. + * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise. + +2009-06-17 H.J. Lu + + * elf-bfd.h (_bfd_elf_create_ifunc_dyn_reloc): New. + * elf-ifunc.c (_bfd_elf_create_ifunc_dyn_reloc): Likewise. + * elf32-i386.c (elf_i386_check_relocs): Use it. + * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. + +2009-06-17 H.J. Lu + + * elf-bfd.h (elf_dyn_relocs): New. + + * elf32-i386.c (elf_i386_dyn_relocs): Removed. + (elf_i386_link_hash_entry): Replace elf_i386_dyn_relocs with + elf_dyn_relocs. + (elf_i386_copy_indirect_symbol): Likewise. + (elf_i386_check_relocs): Likewise. + (elf_i386_gc_sweep_hook): Likewise. + (elf_i386_allocate_dynrelocs): Likewise. + (elf_i386_readonly_dynrelocs): Likewise. + (elf_i386_size_dynamic_sections): Likewise. + + * elf64-x86-64.c (elf64_x86_64_dyn_relocs): Removed. + (elf64_x86_64_link_hash_entry): Replace elf64_x86_64_dyn_relocs + with elf_dyn_relocs. + (elf64_x86_64_copy_indirect_symbol): Updated. + (elf64_x86_64_check_relocs): Likewise. + (elf64_x86_64_gc_sweep_hook): Likewise. + (elf64_x86_64_adjust_dynamic_symbol): Likewise. + (elf64_x86_64_allocate_dynrelocs): Likewise. + (elf64_x86_64_readonly_dynrelocs): Likewise. + (elf64_x86_64_size_dynamic_sections): Likewise. + +2009-06-17 H.J. Lu + + * elf32-arm.c (create_got_section): Get existing .rela.got + section. + * elf32-hppa.c (elf32_hppa_create_dynamic_sections): Likewise. + * elf32-lm32.c (create_got_section): Likewise. + * elf32-m32r.c (create_got_section): Likewise. + * elf32-ppc.c (ppc_elf_create_got): Likewise. + * elf32-s390.c (create_got_section): Likewise. + * elf32-sh.c (create_got_section): Likewise. + * elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Likewise. + * elf64-s390.c (create_got_section): Likewise. + * elfxx-sparc.c (create_got_section): Likewise. + + * elflink.c (_bfd_elf_create_got_section): Properly initialize + the GOT size. + +2009-06-16 H.J. Lu + + * elf-bfd.h (ELF_LOCAL_SYMBOL_HASH): New. + + * elf32-i386.c (elf_i386_local_hash): Removed. + (elf_i386_local_htab_hash): Use ELF_LOCAL_SYMBOL_HASH. + (elf_i386_get_local_sym_hash): Likewise. + + * elf64-x86-64.c (elf64_x86_64_local_hash): Removed. + (elf64_x86_64_local_htab_hash): Use ELF_LOCAL_SYMBOL_HASH. + (elf64_x86_64_get_local_sym_hash): Likewise. + * elfxx-ia64.c (elfNN_ia64_local_htab_hash): Likewise. + (get_local_sym_hash): Likewise. + +2009-06-16 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_link_hash_table): Remove got_sec, + rel_got_sec and plt_sec. + (elfNN_ia64_relax_section): Updated. + (elfNN_ia64_create_dynamic_sections): Likewise. + (get_got): Likewise. + (allocate_dynrel_entries): Likewise. + (elfNN_ia64_size_dynamic_sections): Likewise. + (set_got_entry): Likewise. + (elfNN_ia64_choose_gp): Likewise. + (elfNN_ia64_relocate_section): Likewise. + (elfNN_ia64_finish_dynamic_symbol): Likewise. + (elfNN_ia64_finish_dynamic_sections): Likewise. + +2009-06-16 Ulrich Weigand + + * elf32-spu.c (needs_ovl_stub): Respect .brinfo lrlive bits + also for calls. + +2009-06-16 H.J. Lu + + * configure.in (elf): Add elf-ifunc.lo. + + * configure: Regenerated. + * Makefile.in: Likewise. + + * elf-bfd.h (elf_link_hash_table): Add sgot, sgotplt, + srelgot, splt, srelplt, igotplt, iplt, irelplt and irelifunc. + + * elf32-i386.c (elf_i386_link_hash_table): Remove sgot, + sgotplt, srelgot, splt, srelplt, igotplt, iplt, irelplt and + irelifunc. + (elf_i386_link_hash_table_create): Likewise. + (elf_i386_create_dynamic_sections): Likewise. + (elf_i386_check_relocs): Likewise. + (elf_i386_allocate_dynrelocs): Likewise. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. + (elf_i386_finish_dynamic_symbol): Likewise. + (elf_i386_finish_dynamic_sections): Likewise. + (elf_i386_create_got_section): Removed. + + * elf64-x86-64.c (elf64_x86_64_link_hash_table): Remove sgot, + sgotplt, srelgot, splt, srelplt, igotplt, iplt, irelplt and + irelifunc. + (elf64_x86_64_compute_jump_table_size): Updated. + (elf64_x86_64_link_hash_table_create): Likewise. + (elf64_x86_64_create_dynamic_sections): Likewise. + (elf64_x86_64_check_relocs): Likewise. + (elf64_x86_64_allocate_dynrelocs): Likewise. + (elf64_x86_64_size_dynamic_sections): Likewise. + (elf64_x86_64_relocate_section): Likewise. + (elf64_x86_64_finish_dynamic_symbol): Likewise. + (elf64_x86_64_finish_dynamic_sections): Likewise. + (elf64_x86_64_create_got_section): Removed. + + * elflink.c (_bfd_elf_create_got_section): Use log_file_align + for pointer alignment. Set up section pointers. + (_bfd_elf_create_dynamic_sections): Likewise. + (_bfd_elf_create_ifunc_sections): Moved to ... + * elf-ifunc.c: Here. New. + + * Makefile.am (BFD32_BACKENDS): Add elf-ifunc.lo. + (BFD32_BACKENDS_CFILES): Add elf-ifunc.c. + Run "make dep-am". + +2009-06-16 Doug Kwan + + * elf32-arm.c (cortex_a8_erratum_scan): Change type of offset + to bfd_signed_vma. Cast constant operands which are used in + offset related expressions to bfd_signed_vma type as appropriate. + +2009-06-16 Maciej W. Rozycki + + * elf32-vax.c (elf_vax_plt_sym_val): New function. + (elf_backend_plt_sym_val): Define. + +2009-06-16 Maciej W. Rozycki + + * elf32-vax.c (elf_vax_reloc_type_class): New function. + (elf_backend_reloc_type_class): Define. + +2009-06-16 Maciej W. Rozycki + + * elf32-vax.c (elf_vax_relocate_section): For symbol references + from an executable to a shared library treat R_VAX_PC32 + relocations as R_VAX_PLT32 ones. + +2009-06-16 Maciej W. Rozycki + + * elf32-vax.c (elf_vax_instantiate_got_entries): Skip local + symbols in GOT space calculation. + (elf_vax_relocate_section): Adjust accordingly. + +2009-06-16 Maciej W. Rozycki + + * elf32-vax.c (elf_vax_plt_entry): Set the entry mask to + include . + +2009-06-16 Maciej W. Rozycki + + * elf32-vax.c (elf_vax_check_relocs): Handle the visibility + attribute. + (elf_vax_relocate_section): Likewise. + +2009-06-15 H.J. Lu + + * elf32-i386.c (elf_i386_allocate_dynrelocs): Update comments. + * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise. + +2009-06-15 H.J. Lu + + * elf32-i386.c (elf_i386_check_relocs): Reformat. + * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. + +2009-06-15 H.J. Lu + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerated. + +2009-06-15 H.J. Lu + + * elf32-i386.c (elf_i386_allocate_dynrelocs): Fix a typo. + * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise. + +2009-06-15 Nick Clifton + + * po/ru.po: New Russian translation. + * configure.in (ALL_LINGUAS): Add ru. + * configure: Regenerate. + +2009-06-14 H.J. Lu + + * elf32-i386.c: Remove duplicated comments. + +2009-06-14 H.J. Lu + + PR ld/10270 + * elf32-i386.c (elf_i386_allocate_dynrelocs): Disallow + dynamic IFUNC pointer in non-shared object. Use .got.plt + for IFUNC definition in PIE. + (elf_i386_allocate_dynrelocs): Resolve IFUNC definition in + PIE locally. + + * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Disallow + dynamic IFUNC pointer in non-shared object. Use .got.plt + for IFUNC definition in PIE. + (elf64_x86_64_relocate_section): Resolve IFUNC definition in + PIE locally. + +2009-06-13 H.J. Lu + + * elf32-i386.c (elf_i386_check_relocs): Properly report + local symbol for unhandled relocation against STT_GNU_IFUNC + symbol. + (elf_i386_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. + (elf64_x86_64_relocate_section): Likewise. + +2009-06-13 H.J. Lu + + PR ld/10269 + * elf32-i386.c: Include "objalloc.h" and "hashtab.h". + (elf_i386_link_hash_table): Add loc_hash_table and + loc_hash_memory. + (elf_i386_local_hash): New. + (elf_i386_local_htab_hash): Likewise. + (elf_i386_local_htab_eq): Likewise. + (elf_i386_get_local_sym_hash): Likewise. + (elf_i386_link_hash_table_free): Likewise. + (elf_i386_allocate_local_dynrelocs): Likewise. + (elf_i386_finish_local_dynamic_symbol): Likewise. + (bfd_elf64_bfd_link_hash_table_free): Likewise. + (elf_i386_link_hash_table_create): Create loc_hash_table and + loc_hash_memory. + (elf_i386_check_relocs): Handle local STT_GNU_IFUNC symbols. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. + (elf_i386_finish_dynamic_sections): Likewise. + (elf_i386_finish_dynamic_symbol): Check _DYNAMIC only if sym + isn't NULL. + + * elf64-x86-64.c: Include "objalloc.h" and "hashtab.h". + (elf64_x86_64_link_hash_table): Add loc_hash_table and + loc_hash_memory. + (elf64_x86_64_local_hash): New. + (elf64_x86_64_local_htab_hash): Likewise. + (elf64_x86_64_local_htab_eq): Likewise. + (elf64_x86_64_get_local_sym_hash): Likewise. + (elf64_x86_64_link_hash_table_free): Likewise. + (elf64_x86_64_allocate_local_dynrelocs): Likewise. + (elf64_x86_64_finish_local_dynamic_symbol): Likewise. + (bfd_elf64_bfd_link_hash_table_free): Likewise. + (elf64_x86_64_link_hash_table_create): Create loc_hash_table + and loc_hash_memory. + (elf64_x86_64_check_relocs): Handle local STT_GNU_IFUNC + symbols. + (elf64_x86_64_size_dynamic_sections): Likewise. + (elf64_x86_64_relocate_section): Likewise. + (elf64_x86_64_finish_dynamic_sections): Likewise. + (elf64_x86_64_finish_dynamic_symbol): Check _DYNAMIC only if + sym isn't NULL. + +2009-06-10 Philip Blundell + + * elf32-arm.c (elf32_arm_fix_exidx_coverage): Avoid crash if + elf_sec->this_hdr == NULL. + +2009-06-12 Tristan Gingold + + * reloc.c: Add BFD_RELOC_MACH_O_SECTDIFF and BFD_RELOC_MACH_O_PAIR. + * bfd-in2.h: Regenerated. + * libbfd.h: Regenerated. + + * mach-o.c (FILE_ALIGN): New macro. + (bfd_mach_o_canonicalize_symtab): Adjust for bfd_mach_o_asymbol. + (bfd_mach_o_print_symbol): Ditto. + (bfd_mach_o_scan_write_thread): Adjust type of variable offset. + (bfd_mach_o_get_reloc_upper_bound): New function. + (bfd_mach_o_canonicalize_reloc): Ditto. + (bfd_mach_o_scan_write_relocs): Ditto. + (bfd_mach_o_scan_write_section_32): Remove offset argument. + (bfd_mach_o_scan_write_section_64): Ditto. + (bfd_mach_o_scan_write_segment_32): Write relocs. Fix size of data + written for load command. Do not compute section file offset. + (bfd_mach_o_scan_write_segment_64): Ditto. + (bfd_mach_o_scan_write_symtab): Compute file offset first. + Adjust for bfd_mach_o_asymbol. Move code to convert from BFD to + Mach-O to ... + (bfd_mach_o_mangle_symbols): ... this new function. + (bfd_mach_o_write_contents): Be sure to have load commands built. + Call bfd_mach_o_mangle_symbols. + (bfd_mach_o_build_commands): Adjust for filelen field. + Use FILE_ALIGN macro. Clear section file offset if section is empty. + Do not set symtab file offset anymore here. + (bfd_mach_o_make_empty_symbol): Allocate a bfd_mach_o_asymbol. + (bfd_mach_o_make_bfd_section): Set SEC_RELOC if has reloc. + Set reloc_count and rel_filepos section fields. + (bfd_mach_o_scan_read_section_32): Type of argument offset is now + unsigned int. + (bfd_mach_o_scan_read_section_64): Ditto. + (bfd_mach_o_scan_read_section): Ditto. + (bfd_mach_o_scan_read_symtab_symbol): Typr of argument s is now + bfd_mach_o_asymbol. Use unsigned int for file offset type. + (bfd_mach_o_scan_read_symtab_symbol): Adjust for bfd_mach_o_asymbol. + Handle weak-ref symbols. + (bfd_mach_o_scan_read_symtab_symbols): Adjust for bfd_mach_o_asymbol. + (bfd_mach_o_scan_read_dysymtab_symbol): Ditto. + (bfd_mach_o_scan): Remove assignment to removed field. + (bfd_mach_o_mkobject_init): Ditto. + (bfd_mach_o_bfd_print_private_bfd_data): Adjust printf formatter. + (bfd_mach_o_bfd_reloc_type_lookup): New macro. + (bfd_mach_o_bfd_reloc_name_lookup): Ditto. + (bfd_mach_o_swap_reloc_in): Ditto. + (bfd_mach_o_swap_reloc_out): Ditto. + + * mach-o.h (BFD_MACH_O_REFERENCE_FLAG_UNDEFINED_NON_LAZY) + (BFD_MACH_O_REFERENCE_FLAG_UNDEFINED_LAZY) + (BFD_MACH_O_REFERENCE_FLAG_DEFINED) + (BFD_MACH_O_REFERENCE_FLAG_PRIVATE_DEFINED) + (BFD_MACH_O_REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY) + (BFD_MACH_O_REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY) + (BFD_MACH_O_REFERENCED_DYNAMICALLY, BFD_MACH_O_N_DESC_DISCARDED) + (BFD_MACH_O_N_NO_DEAD_STRIP, BFD_MACH_O_N_WEAK_REF) + (BFD_MACH_O_N_WEAK_DEF): New macros. + Add comments. + (bfd_mach_o_section_type): Add new enumeration values. + (BFD_MACH_O_S_SELF_MODIFYING_CODE) + (BFD_MACH_O_S_ATTR_LIVE_SUPPORT) + (BFD_MACH_O_S_ATTR_NO_DEAD_STRIP) + (BFD_MACH_O_S_ATTR_STRIP_STATIC_SYMS, BFD_MACH_O_S_ATTR_NO_TOC): New + macros. + (BFD_MACH_O_GENERIC_RELOC_VANILLA) + (BFD_MACH_O_GENERIC_RELOC_PAIR) + (BFD_MACH_O_GENERIC_RELOC_SECTDIFF) + (BFD_MACH_O_GENERIC_RELOC_PB_LA_PTR) + (BFD_MACH_O_GENERIC_RELOC_LOCAL_SECTDIFF): Ditto. + (BFD_MACH_O_RELENT_SIZE): Ditto. + (BFD_MACH_O_R_PCREL, BFD_MACH_O_GET_R_LENGTH) + (BFD_MACH_O_R_EXTERN, BFD_MACH_O_GET_R_TYPE) + (BFD_MACH_O_GET_R_SYMBOLNUM, BFD_MACH_O_SET_R_LENGTH) + (BFD_MACH_O_SET_R_TYPE, BFD_MACH_O_SET_R_SYMBOLNUM): Ditto. + (BFD_MACH_O_SR_SCATTERED, BFD_MACH_O_SR_PCREL) + (BFD_MACH_O_GET_SR_LENGTH, BFD_MACH_O_GET_SR_TYPE) + (BFD_MACH_O_GET_SR_ADDRESS, BFD_MACH_O_SET_SR_LENGTH) + (BFD_MACH_O_SET_SR_TYPE, BFD_MACH_O_SET_SR_ADDRESS): Ditto. + (bfd_mach_o_reloc_info): New struct. + (bfd_mach_o_asymbol): New struct. + (bfd_mach_o_symtab_command): The symbols field is now of type + bfd_mach_o_asymbol. + (bfd_mach_o_load_command): The offset and len fields are now of type + unsigned int. + (mach_o_data_struct): Remove symbols, nsymbols and ibfd fields. + Add a filelen field. Add comments. + (bfd_mach_o_backend_data): New struct. + (bfd_mach_o_get_backend_data): New macro. + (bfd_mach_o_scan_read_symtab_symbol): Parameter symbol now of type + bfd_mach_o_asymbol. + (bfd_mach_o_scan_read_dysymtab_symbol): Ditto. + (bfd_mach_o_get_reloc_upper_bound): New prototype. + (bfd_mach_o_canonicalize_reloc): Ditto. + + * mach-o-target.c (bfd_mach_o_bfd_is_local_label_name): Remove + duplicated macro. Now defined to _bfd_generic_is_local_label. + (TARGET_NAME_BACKEND): New macro... + (TARGET_NAME_BACKEND): ... used to name a new variable. + (TARGET_NAME): Define relocs table using bfd_mach_o, reference + Mach-O backend data. + + * mach-o-i386.c (i386_howto_table): New variable. + (bfd_mach_o_i386_swap_reloc_in): New function. + (bfd_mach_o_i386_swap_reloc_out): Ditto. + (bfd_mach_o_i386_bfd_reloc_type_lookup): Ditto. + (bfd_mach_o_i386_bfd_reloc_name_lookup): Ditto. + (bfd_mach_o_swap_reloc_in, bfd_mach_o_swap_reloc_out): New macros. + (bfd_mach_o_bfd_reloc_type_lookup) + (bfd_mach_o_bfd_reloc_name_lookup): Ditto. + +2009-06-11 Eric Paris + Nick Clifton + + * opncls.c (_maybe_make_executable): New function. Gives execute + permission to an executable bfd that was opened for writing + provided that it is a regular file. Replaces common code found in... + (bfd_close): here and ... + (bfd_close_all_done): here. + +2009-06-11 Anthony Green + + * reloc.c: Add BFD_RELOC_MOXIE_10_PCREL. + * bfd-in2.h: Rebuilt. + * libbfd.h: Rebuilt. + * elf32-moxie.c (moxie_elf_howto_table): Add R_MOXIE_PCREL10 + relocation support. + (moxie_reloc_map): Ditto. + Clean up copyright notice. + +2009-06-10 Paul Pluzhnikov + + * bfd-in2.h: bfd_mmap prototype. + * bfdio.c (bfd_mmap): New function. + * libbfd.h (bfd_iovec): Add bmmap. + * cache.c (cache_bmmap): New function. + (cache_iovec): Initialize bmmap member. + * opencls.c (opncls_bmmap): New function. + (opncls_iovec): Initialize bmmap member. + +2009-06-09 Tristan Gingold + + * mach-o.h (bfd_mach_o_symtab_command): Remove stabs_segment + and stabstr_segment fields. + (mach_o_be_vec, mach_o_le_vec): Removed + (bfd_mach_o_version): New prototype. + + * mach-o.c (bfd_mach_o_version): Make this function public. + (mach_o_wide_p): New function. + (bfd_mach_o_wide_p): Ditto. + (bfd_mach_o_convert_section_name_to_bfd): Add prefix only for + weird names. + (bfd_mach_o_convert_section_name_to_mach_o): Fix typo in comment. + Search in the list only if the name starts with a dot. + (bfd_mach_o_write_header): Use mach_o_wide_p instead of hard-coded + test. Check bfd_seek status. + (bfd_mach_o_scan_write_thread): Check bfd_seek status. + (bfd_mach_o_scan_write_section_32): Ditto. + (bfd_mach_o_scan_write_section_64): Ditto. + (bfd_mach_o_scan_write_section): Removed. + (bfd_mach_o_scan_write_segment): Split into ... + (bfd_mach_o_scan_write_segment_32): ... this and ... + (bfd_mach_o_scan_write_segment_64): ... this. Check bfd_seek status. + (bfd_mach_o_scan_write_symtab_symbols): Moved into ... + (bfd_mach_o_scan_write_symtab): ... this. Write symtab from BFD + symbol table. Now returns a boolean. + (bfd_mach_o_write_contents): Set filetype. Check bfd_seek status. + Adjust for status type. + (bfd_mach_o_build_commands): Use mach_o_wide_p instead of hard-coded + test. Write symbol table. Numbers the sections. + (bfd_mach_o_read_header): Check bfd_seek status. + Use mach_o_wide_p instead of hard-coded test. + (bfd_mach_o_scan_read_section_32): Check bfd_seek status. + (bfd_mach_o_scan_read_section_64): Ditto. + (bfd_mach_o_scan_read_symtab_symbol): Ditto. Check bfd_seek status. + Use BFD_MACH_O_N_TYPE instead of hard-coded value. Correctly + handled common symbols. + (bfd_mach_o_scan_read_symtab_strtab): Check bfd_seek status. + (bfd_mach_o_scan_read_dysymtab_symbol): Ditto. + (bfd_mach_o_scan_read_dylinker): Ditto. + (bfd_mach_o_scan_read_dylib): Ditto. + (bfd_mach_o_scan_read_thread): Ditto. + (bfd_mach_o_scan_read_symtab): Ditto. + Do not create a section for the stabs. + (bfd_mach_o_scan_read_uuid): Check bfd_seek status. + (bfd_mach_o_scan_read_segment): Ditto. + (bfd_mach_o_scan_read_command): Ditto. + (bfd_mach_o_scan_start_address): Ditto. + (bfd_mach_o_scan): Use mach_o_wide_p instead of hard-coded test. + (bfd_mach_o_archive_p): Check bfd_seek status. + (bfd_mach_o_core_fetch_environment): Ditto. + + * mach-o-i386.c (bfd_mach_o_i386_mkobject): Don't set filetype. + +2009-06-06 H.J. Lu + + * elf32-i386.c (elf_i386_link_hash_table): Add irelifunc. + (elf_i386_link_hash_table_create): Initialize irelifunc. + (elf_i386_check_relocs): Updated. Set up irelifunc for + shared objects. + (elf_i386_allocate_dynrelocs): Use irelifunc for dynamic + relocation for non-GOT reference of STT_GNU_IFUNC symbol in + shared objects. + (elf_i386_relocate_section): Likewise. + + * elf64-x86-64.c (elf64_x86_64_link_hash_table): Add irelifunc. + (elf64_x86_64_link_hash_table_create): Initialize irelifunc. + (elf64_x86_64_check_relocs): Updated. Set up irelifunc for + shared objects. + (elf64_x86_64_allocate_dynrelocs): Use irelifunc for dynamic + relocation for non-GOT reference of STT_GNU_IFUNC symbol in + shared objects. + (elf64_x86_64_relocate_section): Likewise. + + * elf-bfd.h (_bfd_elf_create_static_ifunc_sections): Renamed to + ... + (_bfd_elf_create_ifunc_sections): This. + + * elflink.c (_bfd_elf_create_static_ifunc_sections): Renamed to + ... + (_bfd_elf_create_ifunc_sections): This. Create .rel[a].ifunc + for shared objects. + +2009-06-06 H.J. Lu + + * elf32-i386.c (elf_i386_check_relocs): Make room for dynamic + relocation for R_386_32 against STT_GNU_IFUNC symbol when + building shared object. Check info->executable instead of + !info->shared when setting non_got_ref. + (elf_i386_allocate_dynrelocs): Allocate dynamic relocation + for non-GOT reference of STT_GNU_IFUNC symbol in shared + object. Allocate GOT relocation agsinst STT_GNU_IFUNC + symbol if needed. + (elf_i386_relocate_section): Output dynamic relocation for + R_386_32 against STT_GNU_IFUNC symbol to get the real + function address when building shared object. + (elf_i386_finish_dynamic_symbol): Output R_386_GLOB_DAT + relocation for STT_GNU_IFUNC symbol in shared object. + + * elf64-x86-64.c (elf64_x86_64_check_relocs): Make room for + dynamic relocation for R_X86_64_64 against STT_GNU_IFUNC + symbol when building shared object. Check info->executable + instead of !info->shared when setting non_got_ref. + (elf64_x86_64_allocate_dynrelocs): Allocate dynamic relocation + for non-GOT reference of STT_GNU_IFUNC symbol in shared + library. Allocate GOT relocation agsinst STT_GNU_IFUNC symbol + if needed. + (elf64_x86_64_relocate_section): Output dynamic relocation + for R_X86_64_64 against STT_GNU_IFUNC symbol to get the real + function address when building shared object. + (elf64_x86_64_finish_dynamic_symbol): Output R_X86_64_GLOB_DAT + relocation for STT_GNU_IFUNC symbol in shared object. + +2009-06-06 Jan Kratochvil + + * Makefile.am: Run "make dep-am". + (BFD32_BACKENDS): Add mach-o-i386.lo. + (BFD32_BACKENDS_CFILES): Add mach-o-i386.c. + * Makefile.in: Regenerate. + +2009-06-06 Alan Modra + + * elf32-spu.c (spu_elf_relocate_section): Match overlay number + when looking for soft-icache stubs. + +2009-06-05 Tristan Gingold + + * mach-o.h: Update copyright year. + (bfd_mach_o_mach_header_magic): New enum. + (bfd_mach_o_cpu_subtype): Now an enum. + (BFD_MACH_O_HEADER_SIZE, BFD_MACH_O_HEADER_64_SIZE): New macros. + (BFD_MACH_O_SECTION_SIZE, BFD_MACH_O_SECTION_64_SIZE): Ditto. + (BFD_MACH_O_LC_SEGMENT_SIZE, BFD_MACH_O_LC_SEGMENT_64_SIZE): Ditto. + (bfd_mach_o_load_command): Field type_required is now a boolean. + Reindent prototypes. + (bfd_mach_o_object_p, bfd_mach_o_core_p): Remove. + (bfd_mach_o_bfd_copy_private_symbol_data): Add a prototype. + (bfd_mach_o_bfd_copy_private_section_data): Ditto. + (bfd_mach_o_bfd_copy_private_bfd_data): Ditto. + (bfd_mach_o_get_symtab_upper_bound): Ditto. + (bfd_mach_o_canonicalize_symtab): Ditto. + (bfd_mach_o_get_symbol_info): Ditto. + (bfd_mach_o_print_symbol): Ditto. + (bfd_mach_o_bfd_print_private_bfd_data): Ditto. + (bfd_mach_o_make_empty_symbol): Ditto. + (bfd_mach_o_write_contents): Ditto. + + * mach-o.c (bfd_mach_o_object_p, bfd_mach_o_core_p, + bfd_mach_o_mkobject): Defines. + (bfd_mach_o_valid): Returns FALSE/TRUE instead of 0/1. + Do not check with target vector but with flavour. + (struct mach_o_section_name_xlat): New declaration. + (dwarf_section_names_xlat): Ditto. + (text_section_names_xlat): Ditto. + (data_section_names_xlat): Ditto. + (struct mach_o_segment_name_xlat): Ditto. + (segsec_names_xlat): Ditto. + (bfd_mach_o_convert_section_name_to_bfd): New function. + (bfd_mach_o_convert_section_name_to_mach_o): Ditto. + (bfd_mach_o_bfd_copy_private_symbol_data): Make it public. + (bfd_mach_o_bfd_copy_private_section_data): Ditto. + (bfd_mach_o_bfd_copy_private_bfd_data): Ditto. + Accept any input and output flavour. Do not share private data + anymore. + (bfd_mach_o_count_symbols): Add a comment. + (bfd_mach_o_get_symtab_upper_bound): Make it public. + (bfd_mach_o_canonicalize_symtab): Ditto. + (bfd_mach_o_get_symbol_info): Ditto. + (bfd_mach_o_print_symbol): Ditto. + (bfd_mach_o_write_header): Now returns a boolean instead of an int. + Use constants instead of hard-coded values. + (bfd_mach_o_scan_write_section_32): Use constants instead of hard-coded + values. + (bfd_mach_o_scan_write_section_64): Ditto. + (bfd_mach_o_scan_write_segment): Ditto. + Do not copy sections anymore. + (bfd_mach_o_write_contents): Make it public. + Remove dead code. Rewrite typeflag assignment. + (bfd_mach_o_build_commands): New function. + (bfd_mach_o_set_section_contents): Ditto. + (bfd_mach_o_make_empty_symbol): Make it public. + (bfd_mach_o_read_header): Make it static. + Convert to bfd_boolean. + Use constants instead of hard-coded values. + (bfd_mach_o_make_bfd_section): Call + bfd_mach_o_convert_section_name_to_bfd to create name. + (bfd_mach_o_scan_read_section_32): Use constants instead of hard-coded + values. + (bfd_mach_o_scan_read_section_64): Ditto. + (bfd_mach_o_scan_read_segment): Do not create a bfd section for + a segment anymore. Use constants instead of hard-coded values. + (bfd_mach_o_scan_read_command): Fix style. + (bfd_mach_o_scan): Use constants instead of hard-coded values. + Get rid of BFD_IO_FUNCS. + (bfd_mach_o_mkobject_init): Renamed from bfd_mach_o_mkobject. + (bfd_mach_o_header_p): Created from bfd_mach_o_object_p. + (bfd_mach_o_gen_object_p): New function, replaces bfd_mach_o_object_p. + (bfd_mach_o_object_p): Removed. + (bfd_mach_o_gen_core_p): New function, replaces ... + (bfd_mach_o_core_p): ... deleted. + (bfd_mach_o_bfd_print_private_bfd_data): Make it public. + + * mach-o-i386.c: New file. + * config.bfd: Use mach_o_i386_vec as targ_defvec for ix86-darwin. + * configure.in (TDEFINES): Add mach_o_i386_vec. + * configure: Regenerated. + * targets.c: Add mach_o_i386_vec. + + * mach-o.c: Update copyright years. + (BFD_IO_FUNCS): Remove (was not used). + (bfd_mach_o_mkarchive, bfd_mach_o_read_ar_hdr, bfd_mach_o_slurp_armap + bfd_mach_o_slurp_extended_name_table, + bfd_mach_o_construct_extended_name_table, + bfd_mach_o_truncate_arname, bfd_mach_o_write_armap, + bfd_mach_o_get_elt_at_index, bfd_mach_o_generic_stat_arch_elt, + bfd_mach_o_update_armap_timestamp, bfd_mach_o_close_and_cleanup, + bfd_mach_o_bfd_free_cached_info, bfd_mach_o_new_section_hook, + bfd_mach_o_get_section_contents_in_window, + bfd_mach_o_bfd_is_local_label_name, + bfd_mach_o_bfd_is_target_special_symbol, + bfd_mach_o_bfd_is_local_label_name, bfd_mach_o_get_lineno, + bfd_mach_o_find_nearest_line, bfd_mach_o_find_inliner_info, + bfd_mach_o_bfd_make_debug_symbol, bfd_mach_o_read_minisymbols, + bfd_mach_o_minisymbol_to_symbol, + bfd_mach_o_bfd_get_relocated_section_contents, + bfd_mach_o_bfd_relax_section, bfd_mach_o_bfd_link_hash_table_create, + bfd_mach_o_bfd_link_hash_table_free, bfd_mach_o_bfd_link_add_symbols, + bfd_mach_o_bfd_link_just_syms, bfd_mach_o_bfd_final_link, + bfd_mach_o_bfd_link_split_section, bfd_mach_o_set_arch_mach, + bfd_mach_o_bfd_merge_private_bfd_data, + bfd_mach_o_bfd_set_private_flags, bfd_mach_o_get_section_contents, + bfd_mach_o_bfd_gc_sections, bfd_mach_o_bfd_merge_sections, + bfd_mach_o_bfd_is_group_section, bfd_mach_o_bfd_discard_group, + bfd_mach_o_section_already_linked, bfd_mach_o_bfd_define_common_symbol, + bfd_mach_o_bfd_copy_private_header_data, + bfd_mach_o_core_file_matches_executable_p): Move these defines ... + * mach-o-target.c: ... here. + Update copyright years. + +2009-06-04 Alan Modra + + * dep-in.sed: Don't use \n in replacement part of s command. + * Makefile.am (DEP1): LC_ALL for uniq. + Run "make dep-am". + * Makefile.in: Regenerate. + +2009-06-03 H.J. Lu + + * elf32-i386.c (elf_i386_allocate_dynrelocs): Remove check of + h->plt.refcount > 0 on STT_GNU_IFUNC symbol. + * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise. + +2009-06-03 H.J. Lu + + * elf32-i386.c (elf_i386_allocate_dynrelocs): Allocate + GOT entry for STT_GNU_IFUNC symbol with pointer equality. + (elf_i386_relocate_section): Adjust R_386_GOT32 relocation + against STT_GNU_IFUNC symbols for static executables. + (elf_i386_finish_dynamic_symbol): Load GOT entry with + PLT entry for STT_GNU_IFUNC symbol with pointer equality. + + * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Allocate + GOT entry for STT_GNU_IFUNC symbol with pointer equality. + (elf64_x86_64_finish_dynamic_symbol): Load GOT entry with + PLT entry for STT_GNU_IFUNC symbol with pointer equality. + +2009-06-02 Richard Sandiford + + * coff-rs6000.c (xcoff_ppc_relocate_section): Allow undefined + symbols to be left unimported when linking statically. + * xcofflink.c (xcoff_link_add_symbols): Ignore global linkage + code when linking statically. + +2009-06-02 H.J. Lu + + * elf32-i386.c (elf_i386_check_relocs): Increment + got.refcount for R_386_GOT32/R_386_GOTOFF relocations + against STT_GNU_IFUNC symbol. + (elf_i386_allocate_dynrelocs): Set got.refcount to 0 if + local STT_GNU_IFUNC definition is used. + (elf_i386_relocate_section): Handle got.offset != -1 for + R_386_GOT32/R_386_GOTOFF relocations against STT_GNU_IFUNC + symbol. + + * elf64-x86-64.c (elf64_x86_64_check_relocs): Increment + got.refcount for R_X86_64_GOTPCREL/R_X86_64_GOTPCREL64 + relocations against STT_GNU_IFUNC symbol. + (elf64_x86_64_allocate_dynrelocs): Set got.refcount to 0 if + local STT_GNU_IFUNC definition is used. + (elf64_x86_64_relocate_section): Handle got.offset != -1 + for R_X86_64_GOTPCREL/R_X86_64_GOTPCREL64 relocations against + STT_GNU_IFUNC symbol. + +2009-06-01 H.J. Lu + + PR ld/10205 + * elf32-i386.c (elf_howto_table): Add R_386_IRELATIVE. + (elf_i386_reloc_type_lookup): Likewise. + (R_386_tls): Removed. + (R_386_irelative): New. + (R_386_vt_offset): Updated. + (elf_i386_rtype_to_howto): Likewise. + (elf_i386_link_hash_table): Add igotplt, iplt and irelplt. + (elf_i386_link_hash_table_create): Initialize igotplt, + iplt and irelplt. + (elf_i386_check_relocs): Handle STT_GNU_IFUNC symbol first. + (elf_i386_adjust_dynamic_symbol): Likewise. + (elf_i386_allocate_dynrelocs): Likewise. + (elf_i386_relocate_section): Likewise. + (elf_i386_size_dynamic_sections): Set up .iplt and .igot.plt + sections. + (elf_i386_finish_dynamic_symbol): When building a static + executable, use .iplt, .igot.plt and .rel.iplt sections for + STT_GNU_IFUNC symbols. Generate R_386_IRELATIVE relocation for + locally defined STT_GNU_IFUNC symbol. + + * elf64-x86-64.c (x86_64_elf_howto): Add R_X86_64_IRELATIVE. + (x86_64_reloc_map): Likewise. + (R_X86_64_standard): Updated. + (elf64_x86_64_link_hash_table): Add igotplt, iplt and irelplt. + (elf64_x86_64_link_hash_table_create): Initialize igotplt, + iplt and irelplt. + (elf64_x86_64_check_relocs): Handle STT_GNU_IFUNC symbol first. + (elf64_x86_64_adjust_dynamic_symbol): Likewise. + (elf64_x86_64_allocate_dynrelocs): Likewise. + (elf64_x86_64_relocate_section): Likewise. + (elf64_x86_64_size_dynamic_sections): Set up .iplt and .igot.plt + sections. + (elf64_x86_64_finish_dynamic_symbol): When building a static + executable, use .iplt, .igot.plt and .rela.iplt sections for + STT_GNU_IFUNC symbols. Generate R_X86_64_IRELATIVE relocation + for locally defined STT_GNU_IFUNC symbol. + + * reloc.c (BFD_RELOC_386_IRELATIVE): New. + (BFD_RELOC_X86_64_IRELATIVE): Likewise. + + * bfd-in2.h: Regenerated. + * libbfd.h: Likewise. + +2009-06-01 H.J. Lu + + * elf-bfd.h (struct bfd_elf_section_data): Remove indirect_relocs. + (_bfd_elf_make_ifunc_reloc_section): Removed. + (_bfd_elf_is_ifunc_symbol): Likewise. + (_bfd_elf_create_static_ifunc_sections): New. + + * elflink.c (_bfd_elf_adjust_dynamic_symbol): Move STT_GNU_IFUNC + symbol check to ... + (elf_link_add_object_symbols): Here. + (_bfd_elf_link_hash_hide_symbol): Don't clean plt on + STT_GNU_IFUNC symbol. + (elf_link_output_extsym): Call elf_backend_finish_dynamic_symbol + if a STT_GNU_IFUNC symbol is referenced in a non-shared object. + (IFUNC_INFIX): Removed. + (get_ifunc_reloc_section_name): Likewise. + (_bfd_elf_make_ifunc_reloc_section): Likewise. + (_bfd_elf_is_ifunc_symbol): Likewise. + (_bfd_elf_create_static_ifunc_sections): New. + +2009-05-29 H.J. Lu + + * elf32-i386.c (link_hash_newfunc): Add elf_i386_ prefix. + (create_got_section): Likewise. + (allocate_dynrelocs): Likewise. + (readonly_dynrelocs): Likewise. + (set_tls_module_base): Likewise. + (dtpoff_base): Likewise. + (tpoff): Likewise. + (elf_i386_link_hash_table_create): Updated. + (elf_i386_create_dynamic_sections): Likewise. + (elf_i386_check_relocs): Likewise. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. + + * elf64-x86-64.c (link_hash_newfunc): Add elf64_x86_64_ prefix. + (create_got_section): Likewise. + (allocate_dynrelocs): Likewise. + (readonly_dynrelocs): Likewise. + (set_tls_module_base): Likewise. + (dtpoff_base): Likewise. + (tpoff): Likewise. + (elf64_x86_64_link_hash_table_create): Updated. + (elf64_x86_64_create_dynamic_sections): Likewise. + (elf64_x86_64_check_relocs): Likewise. + (elf64_x86_64_size_dynamic_sections): Likewise. + (elf64_x86_64_relocate_section): Likewise. + +2009-05-28 Nick Clifton + + * targets.c (_bfd_target_vector): Only include plugin target in + all-targets build if BFD_SUPPORTS_PLUGINS is non-zero. + +2009-05-28 Ulrich Weigand + + * elf32-spu.c (struct call_info): New member broken_cycle. + (remove_cycle): Instead of physically removing call_info structures + to break call graph cycles, mark them using the broken_cycle flag. + (mark_overlay_section): Respect broken_cycle flag. + (unmark_overlay_section): Likewise. + (collect_lib_sections): Likewise. + (collect_overlays): Likewise. + (sum_stack): Likewise. + +2009-05-28 Ulrich Weigand + + * elf32-spu.c (insert_callee): Accumulate incoming callee->count. + (mark_functions_via_relocs): Initialize callee->count to 1. + (pasted_function): Likewise. + (spu_elf_auto_overlay): Honor call counts when determining number + of stubs required in software i-cache mode. + +2009-05-27 Rafael Avila de Espindola + + * plugin.c (program_name): Remove. + (plugin_program_name): New. + (bfd_plugin_set_program_name): New. + (try_load_plugin): Use plugin_program_name. + * plugin.h (bfd_plugin_set_program_name): New. + +2009-05-27 Rafael Avila de Espindola + + * aclocal.m4: Include ../config/plugins.m4. + * configure.in: Use AC_PLUGINS. + * configure: Regenerate. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + +2009-05-27 Nathan Sidwell + + * elf32-ppc.c (ppc_elf_relax_section): Work with a partial + link. + * bout.c (b_out_bfd_relax_section): Reject relocatable links. + * elf32-m10300.c (mn10300_elf_relax_section): Likewise. + * elf32-avr.c (elf32_avr_relax_section): Likewise. + * elf32-frv.c (elf32_avr_relax_section): Likewise. + * elf32-xtensa.c (elf_xtensa_relax_section): Likewise. + * elf64-mmix.c (mmix_elf_relax_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_relax_section): Likewise. + * reloc.c (bfd_generic_relax_section): Likewise. + * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. + * vms.c (vms_bfd_relax_section): Likewise. + +2009-05-26 H.J. Lu + + * elf-bfd.h (_bfd_elf_is_ifunc_symbol): New. + + * elf32-i386.c (is_indirect_symbol): Renamed to ... + * elflink.c (_bfd_elf_is_ifunc_symbol): This. + + * elf32-i386.c (allocate_dynrelocs): Updated. + (elf_i386_relocate_section): Likewise. + * elf64-x86-64.c (allocate_dynrelocs): Likewise. + (elf64_x86_64_relocate_section): Likewise. + + * elf64-x86-64.c (is_indirect_symbol): Removed. + +2009-05-26 Nick Clifton + + * po/id.po: Updated Indonesian translation. + +2009-05-26 Rafael Avila de Espindola + + * Makefile.am: Run "make dep-am". + (AM_CPPFLAGS): New. + (LIBDL): New. + (ALL_MACHINES): Add cpu-plugin.lo. + (ALL_MACHINES_CFILES): Add cpu-plugin.c. + (BFD32_BACKENDS): Add plugin.lo. + (BFD32_BACKENDS_CFILES): Add plugin.c. + (libbfd_la_LIBADD): Add LIBDL + * archures.c (bfd_architecture): Add bfd_arch_plugin. + (bfd_plugin_arch): Declare. + * bfd-in.h (BFD_SUPPORTS_PLUGINS): New. + * bfd.c (bfd): Add plugin_data. + * config.bfd: Handle the plugin target. + * configure.in: Check for --enable-plugins. + (LT_INIT): Use the dlopen option. + * cpu-plugin.c: New. + * plugin.c: New. + * plugin.h: New. + * targets.c (plugin_vec): Declare. + (_bfd_target_vector): Add plugin_vec. + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + +2009-05-26 Alan Modra + + * dep-in.sed: Don't modify .o to .lo here. Output one filename + per line with all lines having continuation backslash. Prefix + first line with "A", following lines with "B". + * Makefile.am (DEP): Don't use dep.sed here. + (DEP1): Run $MKDEP on single files, modify .o to .lo here. Use + dep.sed here on dependencies, sort and uniq. + * Makefile.in: Regenerate. + +2009-05-25 Tristan Gingold + + * makefile.vms: Add verilog.obj to object list OBJS. + +2009-05-24 Alan Modra + + * bfdio.c (bfd_seek): Formatting. Ensure newly allocated memory + for BFD_IN_MEMORY is cleared. + (bfd_bwrite): Zero excess memory allocated. + +2009-05-22 Julian Brown + + * elf32-arm.c (THUMB16_BCOND_INSN, THUMB32_INSN, THUMB32_B_INSN): New + macros. + (elf32_arm_stub_a8_veneer_b_cond, elf32_arm_stub_a8_veneer_b) + (elf32_arm_stub_a8_veneer_blx): New stub sequences. + (elf32_arm_stub_type): Add arm_stub_a8_veneer_b_cond, + arm_stub_a8_veneer_b and arm_stub_a8_veneer_blx. + (elf32_arm_stub_hash_entry): Add target_addend, orig_insn fields. + (a8_erratum_fix, a8_erratum_reloc): New structs. + (elf32_arm_link_hash_table): Add a8_erratum_fixes, + num_a8_erratum_fixes, fix_cortex_a8 fields. + (elf32_arm_link_hash_table_create): Zero fix_cortex_a8. + (elf32_arm_add_stub): Split into two parts, creating... + (elf32_arm_create_or_find_stub_sec): New function. + (elf32_arm_final_link_relocate): Add forward declaration. + (arm_build_one_stub): Add support for THUMB32_TYPE, Thumb-2 + relocations, multiple relocations per stub. + (find_stub_size_and_template): New (using parts of arm_size_one_stub). + (arm_size_one_stub): Use find_stub_size_and_template. + (a8_reloc_compare): New. + (find_thumb_glue): Add forward declaration. + (cortex_a8_erratum_scan): New. + (elf32_arm_size_stubs): Add Cortex-A8 erratum workaround support. + (bfd_elf32_arm_set_cortex_a8_fix): New. + (bfd_elf32_arm_set_target_relocs): Add fix_cortex_a8 argument. + (arm_map_one_stub): Add THUMB32_TYPE support. + (a8_branch_to_stub_data): New. + (make_branch_to_a8_stub): New. + (elf32_arm_write_section): Add Cortex-A8 erratum workaround support. + * bfd-in.h (bfd_elf32_arm_set_cortex_a8_fix): New. + (bfd_elf32_arm_set_target_relocs): Add argument for controlling + Cortex-A8 erratum workaround. + * bfd-in2.h: Regenerate. + +2009-05-22 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2009-05-21 Alan Modra + + * elflink.c (elf_link_input_bfd): Correct *pindex change in last + commit. + +2009-05-21 Alan Modra + + * elf-bfd.h (struct elf_backend_data + ): Return an int. + * elf64-ppc.c (ppc64_elf_output_symbol_hook): Return 2 to drop + symbols on deleted .opd entries. + * elflink.c (elf_link_output_sym): Return without outputting sym + if output_symbol_hook returns 2. + (elf_link_output_extsym): Don't assign h->indx when symbol discarded. + Abort if we must not discard sym. + (elf_link_input_bfd): Similarly, don't set finfo->indices for + local syms. + (bfd_elf_final_link): Adjust elf_link_output_sym calls. + * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Adjust for + elf_backend_link_output_symbol_hook return type change. + * elf32-arm.c (output_arch_syminfo): Likewise. + (elf32_arm_output_map_sym, elf32_arm_output_stub_sym): Likewise. + (elf32_arm_output_arch_local_syms): Likewise. + * elf32-cr16c.c (elf32_cr16c_link_output_symbol_hook): Likewise. + * elf32-score.c (s3_bfd_score_elf_link_output_symbol_hook): Likewise. + (bfd_score_elf_link_output_symbol_hook): Likewise. + * elf32-score.h (s7_bfd_score_elf_link_output_symbol_hook): Likewise. + * elf32-score7.c (s7_bfd_score_elf_link_output_symbol_hook): Likewise. + * elf32-sh64.c (sh64_elf_link_output_symbol_hook): Likewise. + * elf32-spu.c (spu_elf_output_symbol_hook): Likewise. + * elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise. + * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise. + * elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise. + * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise. + * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise. + * elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise. + * elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise. + +2009-05-21 Alan Modra + + * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't segfault on + out of range .opd symbols. + +2009-05-21 Dave Korn + + * coffgen.c (coff_print_symbol): Use bfd_fprintf_vma, not + fprintf_vma directly. + * peXXigen.c (pe_print_edata): Likewise. + (pe_print_pdata): Likewise. + (_bfd_XX_print_ce_compressed_pdata): Likewise. + (_bfd_XX_print_private_bfd_data_common): Likewise. + +2009-05-19 Dave Korn + + * cofflink.c (process_embedded_commands): Ignore "-aligncomm". + +2009-05-15 Andrew Stubbs + Paul Brook + + * elf32-arm.c (elf32_arm_fix_exidx_coverage): Don't attempt to + fix discarded sections. + +2009-05-14 Ulrich Weigand + + * elf32-spu.c (mark_overlay_section): Move .init and .fini + sections into the software icache. + +2009-05-14 Ulrich Weigand + + * elf32-spu.c (build_stub): Always build "compact" sofware + i-cache stubs. + +2009-05-14 Ulrich Weigand + + * elf32-spu.c (struct spu_link_hash_table): Add fromelem_size_log2. + (spu_elf_setup): Initialize it. + (spu_elf_size_stubs): Move .ovtab into .bss for software i-cache. + Update to new-sytle cache manager data structures. + (spu_elf_build_stubs): Generate new-style cache manager data + structures and symbols. + (spu_elf_auto_overlay): Update size computation. + +2009-05-14 Ulrich Weigand + + * elf32-spu.c (spu_elf_modify_segment_map): Move all PF_OVERLAY + segments first amongst the program headers. + +2009-05-14 Ulrich Weigand + + * elf32-spu.c (spu_elf_relocate_section): Only encode overlay index + into addresses for relocation types that look at high bits. Remove + special handling of relocation overflow warnings. + +2009-05-14 Ulrich Weigand + + * elf32-spu.c (mark_functions_via_relocs): Handle cycles in the + control flow graph between fragments of a function. + +2009-05-14 Ulrich Weigand + + * elf32-spu.c (spu_elf_size_stubs): Even in software i-cache mode, + generate only a 16-byte .toe section. + (spu_elf_build_stubs, spu_elf_auto_overlay): Likewise. + +2009-05-14 Alan Modra + + * elf32-spu.c (spu_elf_size_stubs): Split out section placement to.. + (spu_elf_place_overlay_data): ..here. New function. + * elf32-spu.h (spu_elf_place_overlay_data): Declare. + +2009-05-13 Andrew Jenner + + * elf32-arm.c: Move sysdep.h to start of file. + +2009-05-11 Ulrich Weigand + + * elf32-spu.c (spu_elf_find_overlays): Don't use .ovl.init lma as + start of overlays. + (spu_elf_build_stubs): Don't define __icache_tagbase. Define + __icache_tag_array and __icache_tag_array_size. + +2009-05-11 Masaki Muranaka + + * elf32-bfin.c (bfin_bfd_reloc_type_lookup): Remove unnecessary + ATTRIBUTE_UNUSED. + (bfinfdpic_link_omit_section_dynsym): Likewise. + (elf32_bfinfdpic_finish_dynamic_sections): Likewise. + +2009-05-05 Paul Brook + + * bfd-in.h (elf32_arm_fix_exidx_coverage): Add prototype. + * bfd-in2.h: Regenerate. + * elf32-arm.c (arm_unwind_edit_type, arm_unwind_table_edit): Define. + (_arm_elf_section_data): Add text and exidx fields. + (add_unwind_table_edit, get_arm_elf_section_data, adjust_exidx_size, + insert_cantunwind_after, elf32_arm_fix_exidx_coverage, offset_prel31, + copy_exidx_entry): New functions. + (elf32_arm_write_section): Fixup .ARM.exidx contents. + +2009-05-05 Christophe lyon + + * elf32-arm.c (DEF_STUBS): New helper define. + (DEF_STUB): Likewise. + (stub_def): New type. + (stub_definitions): New array, containing stub template pointers + and sizes. + (arm_size_one_stub): Make use of stub_definitions. + +2009-05-04 Dave Korn + + * elflink.c (find_version_for_sym): Remove from here, ... + * linker.c (bfd_find_version_for_sym): ... rename, replace + here, make public and update all callers. + * bfd-in2.h: Regenerate. + +2009-04-30 Nick Clifton + + * elf-bfd.h (struct bfd_elf_section_data): Add indirect_relocs + section pointer. + (struct elf_obj_data): Add has_ifunc_symbols boolean. + * elf.c (swap_out_syms): Convert BSF_GNU_INDIRECT_FUNCTION flags + into a STT_GNU_IFUNC symbol type. + (_bfd_elf_is_function_type): Accept STT_GNU_IFUNC as a function + type. + (_bfd_elf_set_osabi): Set the osasbi field to ELFOSABI_LINUX if + the binary contains ifunc symbols. + * elfcode.h (elf_slurp_symbol_table): Translate the STT_GNU_IFUNC + symbol type into a BSF_GNU_INDIRECT_FUNCTION flag. + * elf32-i386.c (is_indirect_function): New function. + (elf_i386_check_relocs): Create an ifunc output section. + (allocate_dynrelocs): Create dynamic relocs in the ifunc output + section if necessary. + (elf_i386_relocate_section): Emit a reloc against an ifunc symbol + if necessary. + (elf_i386_add_symbol_hook): New function. Set the + has_ifunc_symbols field of the elf_obj_data structure if an ifunc + symbol is encountered. + (elf_backend_post_process_headers): Define. + (elf_backend_add_symbol_hook): Define. + (elf_i386_post_process_headers): Rename to + elf_i388_fbsd_post_process_headers. + * elf64-x86_64.c (IS_X86_64_PCREL_TYPE): New macro. + (is_indirect_function): New function. + (elf64_x86_64_check_relocs): Create an ifunc output section. + (allocate_dynrelocs): Create dynamic relocs in the ifunc output + section if necessary. + (elf64_x86_64_relocate_section): Emit a reloc against an ifunc + symbol if necessary. + (elf_i386_add_symbol_hook): Set the has_ifunc_symbols field of the + elf_obj_data structure if an ifunc symbol is encountered. + (elf_backend_post_process_headers): Define. + * elflink.c (_bfd_elf_adjust_dynamic_symbol): Always create a PLT + if we have ifunc symbols to handle. + (get_ifunc_reloc_section_name): New function. Computes the name + for an ifunc section. + (_bfd_elf_make_ifunc_reloc_section): New function. Creates a + section to hold ifunc relocs. + * syms.c (BSF_GNU_INDIRECT_FUNCTION): Define. + (bfd_print_symbol_vandf): Handle ifunc symbols. + (bfd_decode_symclass): Likewise. + * bfd-in2.h: Regenerate. + +2009-04-30 Joseph Myers + + * elf32-arm.c (elf32_arm_check_relocs): Give errors for absolute + MOVW and MOVT relocations in a shared library link. + +2009-04-27 Anthony Green + + * verilog.c: New file. + * Makefile.am (BFD32_LIBS): Add verilog.c. + (BFD32_LIBS_CFILES): Add verilog.c. + (verilog.lo): New build rule. + * Makefile.in: Rebuilt. + * targets.c: Add verilog support. + * bfd.c (tdata union): Add Verilog private data field. + * bfd-in2.h: Regenerate. + +2009-04-27 H.J. Lu + + * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Don't + copy pe_opthdr. + +2009-04-23 Matthias Klose + + * peXXigen.c (_bfd_XXi_swap_sym_in): Initialize `name'. + +2009-04-22 Christophe Lyon + + PR9743 + * elf32-arm.c (arm_type_of_stub): Handle R_ARM_THM_JUMP24, + R_ARM_JUMP24 and R_ARM_PLT32 relocations. + (elf32_arm_size_stubs): Likewise. + (record_thumb_to_arm_glue): Deleted unused function. + (bfd_elf32_arm_process_before_allocation): No longer handle + R_ARM_THM_JUMP24, R_ARM_JUMP24 and R_ARM_PLT32 relocations here. + (elf32_arm_final_link_relocate): Handle R_ARM_THM_JUMP24, + R_ARM_JUMP24 and R_ARM_PLT32 relocations. + +2009-04-21 Daniel Jacobowitz + + * elf32-arm.c (INTERWORK_FLAG): Check BFD_LINKER_CREATED. + (elf32_arm_write_section): Declare early. + (elf32_arm_size_stubs): Skip non-stub sections in the stub BFD. + (arm_allocate_glue_section_space): Exclude empty sections. + (ARM_GLUE_SECTION_FLAGS): Add SEC_LINKER_CREATED. + (bfd_elf32_arm_add_glue_sections_to_bfd): Do not skip the stub + BFD. + (elf32_arm_output_glue_section, elf32_arm_final_link): New. + (elf32_arm_merge_eabi_attributes): Skip the stub BFD. + (elf32_arm_size_dynamic_sections): Allocate interworking + sections here. + (bfd_elf32_bfd_final_link): Define. + +2009-04-21 H.J. Lu + + * coff-ia64.c (COFF_PAGE_SIZE): Changed to 8K. + + * coffcode.h (coff_compute_section_file_positions): Clear + D_PAGED if PE section alignment is smaller than COFF_PAGE_SIZE. + + * libcoff-in.h (pe_tdata): Remove force_minimum_alignment and + force_minimum_alignment. + + * libcoff.h: Regenerated. + + * pei-ia64.c (PEI_TARGET_SUBSYSTEM): Removed. + (PEI_FORCE_MINIMUM_ALIGNMENT): Likewise. + + * peicode.h (pe_mkobject): Don't set force_minimum_alignment + nor target_subsystem. + + * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't check + force_minimum_alignment nor target_subsystem. + +2009-04-21 Kai Tietz + + * coff-x86_64.c (PEI_HEADERS): Protect includes. + (bfd_pe_print_pdata): Remove #ifdef PE variation. + * pei-x86_64.c (PEI_HEADERS): Define to prevent double + include in coff-x86_64.c of headers. + (PDATA_ROW_SIZE): New define. + (pex_regs[]): New static array. + (pex64_get_runtime_function): New static function. + (pex64_get_unwind_info): Likewise. + (pex64_get_scope_entry): Likewise. + (pex64_xdata_print_uwd_codes): Likewise. + (pex64_get_section_by_rva): Likewise. + (pex64_dump_xdata): Likewise. + (pex64_bfd_print_pdata): Likewise. + (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. + * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. + * libpei.h (_bfd_pex64_print_pdata): Removed declaration. + +2009-04-19 Peter O'Gorman + Alan Modra + Dave Korn + + * peXXigen.c (_bfd_XXi_swap_sym_in): Fix name handling w.r.t + long names and non-NUL-terminated strings. + +2009-04-17 H.J. Lu + + * bfd-in2.h: Regenerated. + +2009-04-17 H.J. Lu + + * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Replace + IMAGE_SUBSYSTEM_EFI_ROM with IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER. + +2009-04-17 H.J. Lu + + PR binutils/10074 + * coffcode.h (bfd_pei_p): New. + + * config.bfd: Remove bfd_efi_bsdrv_ia32_vec, + bfd_efi_rtdrv_ia32_vec, bfd_efi_bsdrv_x86_64_vec, + bfd_efi_rtdrv_x86_64_vec, bfd_efi_bsdrv_ia64_vec and + bfd_efi_rtdrv_ia64_vec. Replace bfd_efi_app_ia32_vec, + bfd_efi_app_x86_64_vec and bfd_efi_app_ia64_vec with + i386pei_vec, x86_64pei_vec and bfd_pei_ia64_vec, respectively. + + * configure.in: Remove bfd_efi_bsdrv_ia32_vec, + bfd_efi_rtdrv_ia32_vec, bfd_efi_bsdrv_x86_64_vec, + bfd_efi_rtdrv_x86_64_vec, + bfd_efi_bsdrv_ia64_vec and bfd_efi_rtdrv_ia64_vec. Replace + bfd_efi_ia64_vec with bfd_pei_ia64_vec. + * targets.c: Likewise. + + * configure: Regenerated. + * libcoff.h: Likewise. + * Makefile.in: Likewise. + + * efi-app-ia32.c: Removed. + * efi-app-x86_64.c: Likewise. + * efi-bsdrv-ia32.c: Likewise. + * efi-bsdrv-ia64.c: Likewise. + * efi-bsdrv-x86_64.c: Likewise. + * efi-rtdrv-ia32.c: Likewise. + * efi-rtdrv-ia64.c: Likewise. + * efi-rtdrv-x86_64.c: Likewise. + * efi-rtdrv-ia32.c: Likewise. + + * efi-app-ia64.c: Moved to ... + * pei-ia64.c: This. + (TARGET_SYM): Set to bfd_pei_ia64_vec. + (TARGET_NAME): Set to pei-ia64. + + * libpei.h (bfd_target_pei_p): Removed. + (bfd_target_pei_arch): Likewise. + (bfd_target_efi_app_p): Likewise. + (bfd_target_efi_app_arch): Likewise. + (bfd_target_efi_bsdrv_p): Likewise. + (bfd_target_efi_bsdrv_arch): Likewise. + (bfd_target_efi_rtdrv_p): Likewise. + (bfd_target_efi_rtdrv_arch): Likewise. + (bfd_pe_executable_p): Likewise. + + * Makefile.am (BFD32_BACKENDS): Remove efi-app-ia32.lo, + efi-bsdrv-ia32.lo and efi-rtdrv-ia32.lo. + (BFD32_BACKENDS_CFILES): Remove efi-app-ia32.c, efi-bsdrv-ia32.c + and efi-rtdrv-ia32.c. + (BFD64_BACKENDS): Remove efi-app-ia64.lo, efi-bsdrv-ia64.lo, + efi-rtdrv-ia64.lo, efi-app-x86_64.lo, efi-bsdrv-x86_64.lo and + efi-rtdrv-x86_64.lo. Add pei-ia64.lo. + (BFD64_BACKENDS_CFILES): Remove efi-app-ia64.c, efi-bsdrv-ia64.c, + efi-rtdrv-ia64.c, efi-app-x86_64.c, efi-bsdrv-x86_64.c and + efi-rtdrv-x86_64.c. Add pei-ia64.c. + (efi-app-ia64.lo): Removed. + (efi-bsdrv-ia32.lo): Likewise. + (efi-rtdrv-ia32.lo): Likewise. + (efi-app-ia64.lo): Likewise. + (efi-bsdrv-ia64.lo): Likewise. + (efi-rtdrv-ia64.lo): Likewise. + (efi-app-x86_64.lo): Likewise. + (efi-bsdrv-x86_64.lo): Likewise. + (efi-rtdrv-x86_64.lo): Likewise. + (pei-ia64.lo): New. + + * peicode.h (coff_swap_scnhdr_in): Replace bfd_pe_executable_p + with bfd_pei_p. + (arch_type): Removed. + (pe_arch): Likewise. + (pe_bfd_object_p): Just return coff_object_p. + + * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Replace + bfd_pe_executable_p with bfd_pei_p. + +2009-04-17 Christophe Lyon + + * elf32-arm.c (elf32_arm_size_stubs): Handle long branches through + PLT entries to an undefined symbol when generating a shared + library. + +2009-04-17 Nick Clifton + + PR 9909 + * coffcode.h (handle_COMDAT): Allow for external COMDAT symbols. + +2009-04-16 Richard Sandiford + + * aout-adobe.c (aout_32_bfd_define_common_symbol): Define. + * aout-target.h (MY_bfd_define_common_symbol): Likewise. + * aout-tic30.c (MY_bfd_define_common_symbol): Likewise. + * binary.c (binary_bfd_define_common_symbol): Likewise. + * bout.c (b_out_bfd_define_common_symbol): Likewise. + * coff-alpha.c (_bfd_ecoff_bfd_define_common_symbol): Likewise. + * coff-mips.c (_bfd_ecoff_bfd_define_common_symbol): Likewise. + * coffcode.h (coff_bfd_define_common_symbol): Likewise. + * elfxx-target.h (bfd_elfNN_bfd_define_common_symbol): Likewise. + * i386msdos.c (msdos_bfd_define_common_symbol): Likewise. + * i386os9k.c (os9k_bfd_define_common_symbol): Likewise. + * ieee.c (ieee_bfd_define_common_symbol): Likewise. + * ihex.c (ihex_bfd_define_common_symbol): Likewise. + * libbfd-in.h (_bfd_nolink_bfd_define_common_symbol): Likewise. + * mach-o.c (bfd_mach_o_bfd_define_common_symbol): Likewise. + * mmo.c (mmo_bfd_define_common_symbol): Likewise. + * nlm-target.h (nlm_bfd_define_common_symbol): Likewise. + * oasys.c (oasys_bfd_define_common_symbol): Likewise. + * pef.c (bfd_pef_bfd_define_common_symbol): Likewise. + * ppcboot.c (ppcboot_bfd_define_common_symbol): Likewise. + * som.c (som_bfd_define_common_symbol): Likewise. + * srec.c (srec_bfd_define_common_symbol): Likewise. + * tekhex.c (tekhex_bfd_define_common_symbol): Likewise. + * versados.c (versados_bfd_define_common_symbol): Likewise. + * vms.c (vms_bfd_define_common_symbol): Likewise. + * xcoff-target.h (_bfd_xcoff_bfd_define_common_symbol): Likewise. + * xsym.c (bfd_sym_bfd_define_common_symbol): Likewise. + * coff-rs6000.c (rs6000coff_vec): Add _bfd_xcoff_define_common_symbol. + (pmac_xcoff_vec): Likewise. + * coff64-rs6000.c (rs6000coff64_vec): Likewise. + (aix5coff64_vec): Likewise. + * linker.c (bfd_generic_define_common_symbol): New function. + * targets.c (BFD_JUMP_TABLE_LINK): Add NAME##_bfd_define_common_symbol. + (_bfd_define_common_symbol): New field. + * libcoff-in.h (_bfd_xcoff_define_common_symbol): Declare. + * xcofflink.c (_bfd_xcoff_define_common_symbol): New function. + (xcoff_build_ldsyms): Don't set XCOFF_DEF_REGULAR for common + symbols here. + * bfd-in2.h: Regenerate. + * libbfd.h: Likewise. + * libcoff.h: Likewise. + +2009-04-15 Anthony Green + + * targets.c: Add moxie support. + * Makefile.am: Ditto. + * Makefile.in: Rebuilt. + * cpu-moxie.c, elf32-moxie.c: New files. + * archures.c: Add moxie support. + * configure.in: Add moxie support. + * configure: Rebuilt. + * config.bfd, archures.c: Add moxie support. + * bfd-in2.h: Rebuilt. + +2009-04-15 Christophe Lyon + + * elf32-arm.c (elf32_arm_final_link_relocate): Don't convert ARM + branch to an undef weak symbol into a jump to next instruction if + a PLT entry will be created. + +2009-04-14 Dave Korn + + * coffgen.c (make_a_section_from_file): Set the backend long + section names enable if long section names found on input. + * coffcode.h: Extend long section names documentation to match. + +2009-04-08 H.J. Lu + + * elflink.c (elf_link_add_object_symbols): Warn alternate ELF + machine code. + +2009-04-07 DJ Delorie + + * archures.c: Add bfd_mach_mep_c5. + * bfd-in2.h: Likewise. + * cpu-mep.c: Add bfd_c5_arch. + * elf32-mep.c: Support it. + +2009-04-07 H.J. Lu + + * elflink.c (_bfd_elf_section_already_linked): Add `\n' for + info->callbacks->einfo. + * linker.c (_bfd_generic_section_already_linked): Likewise. + +2009-04-06 DJ Delorie + + * elf32-h8300.c (elf32_h8_relax_section): Relax MOVA opcodes. + +2009-04-06 H.J. Lu + + * coff-x86_64.c (bfd_pe_print_pdata): Defined to + _bfd_pex64_print_pdata only if PE is defined. + + * libpei.h (_bfd_pep_print_x64_pdata): Renamed to ... + (_bfd_pex64_print_pdata): This. + + * peXXigen.c (_bfd_pep_print_x64_pdata): Renamed to ... + (_bfd_pex64_print_pdata): This. Defined only if COFF_WITH_pex64 + is defined. + +2009-04-05 Kai Tietz + + * coff-x86_64.c (bfd_pe_print_pdata): Define as + _bfd_pep_print_x64_pdata. + * libpei.h (_bfd_pep_print_x64_pdata): Add prototype. + * peXXigen.c (_bfd_pep_print_x64_pdata): New. + +2009-04-02 Sterling Augustine + + * elf32-xtensa.c (relax_property_section): Always set r_offset + to zero. + +2009-04-02 Christophe Lyon + + * elf32-arm.c (elf32_arm_stub_long_branch_v4t_thumb_thumb, + elf32_arm_stub_long_branch_v4t_thumb_thumb_pic): Two new long + branch stubs. + (elf32_arm_stub_type): New enum values for the two new stubs. + (arm_type_of_stub): Make use of the two new stubs. + (arm_size_one_stub): Handle the two new stubs. + +2009-04-01 Matt Thomas + + * elf32-vax.c (elf_vax_check_relocs): Do not put relocations against + hidden symbols into the GOT or PLT.GOT. + (elf_vax_relocate_section): Do not emit a PCREL reloc + into a shared object if it is against a hidden symbol. + +2009-04-01 Richard Sandiford + + * xcofflink.c (xcoff_archive_info): Add contains_shared_object_p + and know_contains_shared_object_p. + (xcoff_archive_contains_shared_object_p): Add an "info" parameter. + Cache the result in the archive_info table. + (xcoff_auto_export_p): Add an "info" parameter and update the + call to xcoff_archive_contains_shared_object_p. + (xcoff_mark_auto_exports): Update accordingly. + (xcoff_post_gc_symbol): Likewise. + +2009-04-01 Richard Sandiford + + * xcofflink.c (bfd_link_input_bfd): Treat __rtinit as C_HIDEXT + rather than C_EXT. + +2009-04-01 Richard Sandiford + + * coff-rs6000.c (member_layout): New structure. + (archive_iterator): Likewise. + (member_layout_init): New function. + (archive_iterator_begin): Likewise. + (archive_iterator_next): Likewise. + (xcoff_write_armap_old): Use the new iterator functions. + (do_shared_object_padding): Delete. + (xcoff_write_armap_big): Use the new iterator functions. Simplify + handling of arch_info. + (xcoff_write_archive_contents_old): Allocate arelt_data in the + first loop rather than the second. Allocate a member header if + there isn't one, then work out the stat information and length + in the first loop too. Use the new iterators for the second loop. + (xcoff_write_archive_contents_big): Likewise. + +2009-04-01 Richard Sandiford + + * bfd-in.h (bfd_xcoff_split_import_path): Declare. + (bfd_xcoff_set_archive_import_path): Likewise. + * bfd-in2.h: Regenerate. + * xcofflink.c: Include libiberty.h. + (xcoff_archive_info): New structure. + (xcoff_archive_info_hash): New function. + (xcoff_archive_info_eq): Likewise. + (xcoff_get_archive_info): Likewise. + (_bfd_xcoff_bfd_link_hash_table_create): Initialize archive_info. + (bfd_xcoff_split_import_path): New function. + (bfd_xcoff_set_archive_import_path): Likewise. + (xcoff_set_import_path): Move earlier in file. + (xcoff_link_add_dynamic_symbols): Set the import path of a non-archive + object to the the directory part of the bfd's filename. Get the + import path and filename of an archive object from the archive's + xcoff_tdata, initializing it if necessary. Update use of + import_file_id. + (bfd_link_input_bfd): Update use of import_file_id. + (xcoff_write_global_symbol): Likewise. + +2009-04-01 Richard Sandiford + + * xcofflink.c (xcoff_link_hash_table): Moved from include/coff/xcoff.h. + +2009-04-01 Richard Sandiford + + * xcofflink.c (xcoff_link_create_extra_sections): Don't create + a .loader section for relocatable links. + (xcoff_need_ldrel_p): New function. + (xcoff_mark): Use it. + (bfd_xcoff_link_count_reloc): Only count loader relocs if there's + a loader section. + (xcoff_build_ldsym): New function, split out from... + (xcoff_build_ldsyms): ...here. Rename to... + (xcoff_post_gc_symbol): ...this. Only export symbols, and only + call xcoff_build_ldsym, if there's a loader section. + (xcoff_build_loader_section): New function, extracted verbatim from... + (bfd_xcoff_size_dynamic_sections): ...here. Only call it if + there's a loader section. Only add an __rtinit loader symbol + if there's a loader section. Update after above name change. + (xcoff_symbol_section, xcoff_create_ldrel): New functions. + (bfd_link_input_bfd): Use xcoff_need_ldrel_p, xcoff_symbol_section + and xcoff_create_ldrel. + (xcoff_write_global_symbol): Use xcoff_create_ldrel. + (xcoff_reloc_link_order): Likewise, but only call it if there's + a loader section. Use xcoff_symbol_section. + (_bfd_xcoff_bfd_final_link): Only use fdinfo.ldrel and fdinfo.ldsym + if there's a loader section. + +2009-04-01 Richard Sandiford + + * xcofflink.c (bfd_link_input_bfd): Fix buffer overrun. + +2009-04-01 Christophe Lyon + + * elf32-arm.c (group_sections): Rewrite loops for better + readability. + +2009-03-30 DJ Delorie + + * elflink.c (elf_link_input_bfd): Don't try to resolve complex + relocs when doing a relocatable link. + +2009-03-28 Mark Mitchell + + * coff-arm.c (coff_arm_merge_private_bfd_data): Use "error:", not + "ERROR:", in error messages. + * cpu-arm.c (bfd_arm_merge_machines): Likewise. + * elf-attrs.c (_bfd_elf_merge_object_attributes): Likewise. + * elf32-arm.c (tag_cpu_arch_combine): Likewise. + (elf32_arm_merge_eabi_attributes): Likewise. + (elf32_arm_merge_private_bfd_data): Likewise. + +2009-03-27 Nick Clifton + + * section.c (bfd_get_section_contents): Detect and handle the case + where a section has the SEC_IN_MEMORY flag set but no actual + contents allocated. + +2009-03-26 Alan Modra + + PR 6494 + * elf.c (copy_elf_program_header): Do not check that PT_GNU_RELRO + p_filesz and p_memsz are equal. Use p_memsz as the segment size. + (assign_file_positions_for_non_load_sections): Zap PT_GNU_RELRO + if we don't find matching PT_LOAD when copying. + +2009-03-25 M R Swami Reddy + + * elf32-crx.c (crx_elf_howto_table): Zero the src_mask field of + the reloc descriptions. + +2009-03-25 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) + : Handle COMMON symbols. + : Ditto. + +2009-03-24 H.J. Lu + + * cpu-i386.c (bfd_x86_64_arch_intel_syntax): Make it static. + (bfd_i386_arch_intel_syntax): Likewise. + (i8086_arch): Likewise. + (bfd_x86_64_arch): Likewise. + +2009-03-24 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section): : Allow use of non-local + symbols for non-allocated sections. Don't check whether to + generate R_CRIS_DTPMOD for non-allocated sections. + (cris_elf_gc_sweep_hook) : Don't + handle relocation GC:ing if applied to non-allocated section. + (cris_elf_check_relocs): Similar. + + * elf32-cris.c (cris_elf_relocate_section) + : Don't include the TLS size + when emitting a known TP offset in the GOT. + +2009-03-23 Alan Modra + + * elf64-ppc.c (synthetic_opd): Delete. + (compare_symbols): Look for .opd name rather than section match. + (ppc64_elf_get_synthetic_symtab): Likewise. + +2009-03-21 Alan Modra + + * elf32-ppc.c (is_pic_glink_stub): Delete. + (is_nonpic_glink_stub): New function. + (ppc_elf_get_synthetic_symtab): Check for last non-pic stub rather + than first pic one. + (struct ppc_elf_link_hash_table ): Comment fix. + +2009-03-20 Martin Schwidefsky + Andreas Krebbel + + * elf32-s390.c (elf_s390_check_relocs): Use the SYMBOL_* + macros for visibilty and locality checks. + (elf_s390_adjust_dynamic_symbol): Likewise. + (allocate_dynrelocs): Likewise. + (elf_s390_relocate_section): Likewise. + (elf_s390_finish_dynamic_symbol): Likewise. + * elf64-s390.c (elf_s390_check_relocs): Likewise. + (elf_s390_adjust_dynamic_symbol): Likewise. + (allocate_dynrelocs): Likewise. + (elf_s390_relocate_section): Likewise. + (elf_s390_finish_dynamic_symbol): Likewise. + +2009-03-19 Kai Tietz + + * bfd-in2.h: Regenerated. + * coffcode.h (sec_to_styp_flags): For pe-coff add SEC_READONLY + for debugging sections and map memory read/write dependent on + SEC_COFF_NOREAD. + (styp_to_sec_flags): Set SEC_COFF_NOREAD for sections + without memory read flags set. + * section.c: Add SEC_COFF_NOREAD to section flags. + +2009-03-19 Andreas Schwab + + * elf32-hppa.c (final_link_relocate): Cast bfd_vma values to long + for format string. + +2009-03-19 Alan Modra + + * elf32-spu.c (spu_elf_find_overlays): Separate error return from + "no overlays" return. If there are overlays, create overlay + manager entry symbols here, so that.. + (spu_elf_build_stubs): ..we don't need to set them up here. + Simplify entry symbol tests. + * elf32-spu.h (spu_elf_find_overlays): Update prototype. + +2009-03-18 Mark Kettenis + + * elf.c (elfcore_grok_openbsd_procinfo) + (elfcore_grok_openbsd_note): New functions. + (elf_parse_notes): Handle notes from OpenBSD ELF core files. + +2009-03-18 Alan Modra + + * vms-hdr.c: Don't include alloca.h. + * elf32-m68hc1x.c: Include alloca-conf.h. + * xsym.c: Likewise. + * elf64-hppa.c: Likewise. Remove existing #if's handling alloca. + * som.c: Likewise. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2009-03-17 Daniel Jacobowitz + + * elf32-arm.c (elf32_arm_check_relocs): Correct symbian_p test. + +2009-03-17 Alan Modra + + * elf32-spu.h (struct spu_elf_params): ovly_flavour now only 1 bit. + Add compact_stub. + (emum _ovly_flavour): Delete ovly_compact, ovly_none. + * elf32-spu.c (struct spu_link_hash_table): Replace ovly_load and + ovly_return fields with ovly_entry[2]. Adjust all users. + (spu_elf_find_overlays): Set ovly_entry[1] from __icache_call_handler + when soft-icache. + (spu_elf_build_stubs): Likewise. + (ovl_stub_size): Change arg to spu_elf_params pointer. Adjust for + ovly_flavour changes. Update all callers. + (ovl_stub_size_log2): New function. + (build_stub): Handle compact icache stubs. Use different manager + entry point for stubs in non-icache area. + (spu_elf_size_stubs): Don't allocate space for indirect branch + descriptors. + (spu_elf_build_stubs): And don't built them. + +2009-03-16 Andrew Stubbs + + * dwarf2.c (read_section): Always use rawsize, if available. + +2009-03-16 Alan Modra + + * simple.c (bfd_simple_get_relocated_section_contents): Use larger + of rawsize and size for buffer. + +2009-03-15 Ulrich Weigand + + * elf32-spu.c (spu_elf_check_vma): Do not reset auto_overlay + parameter just because fixed sections fit into local store. + (spu_elf_auto_overlay): Do not declare as "noreturn". Skip + generating overlays if fixed sections plus reserved stack + and heap space fit into local store. + +2009-03-15 Alan Modra + + * elf32-spu.c (build_stub): Correct icache set_id. + (spu_elf_relocate_section): Likewise. + +2009-03-14 Richard Sandiford + + * xcofflink.c (xcoff_link_check_archive_element): Only free the + symbol table if it was created by the current call. + +2009-03-14 Richard Sandiford + + * xcofflink.c (xcoff_build_ldsyms): Give imported descriptors + class XMC_DS rather than XMC_UA. + +2009-03-14 Richard Sandiford + + * bfd-in.h (bfd_xcoff_size_dynamic_sections): Replace the + bfd_boolean export_defineds parameter with an unsigned int + auto_export_flags parameter. + * bfd-in2.h: Regenerate. + * xcofflink.c (xcoff_archive_contains_shared_object_p): New function, + split out from xcoff_build_ldsyms. + (xcoff_covered_by_expall_p): New function. + (xcoff_auto_export_p): New function, split out from xcoff_build_ldsyms + but with extra code to handle -bexpfull and -bexpall. + (xcoff_mark_auto_exports): New function. + (xcoff_build_ldsyms): Use xcoff_auto_export_p to decide whether + a function should be automatically exported. + (bfd_xcoff_size_dynamic_sections): Replace the export_defineds + parameter with an auto_export_flags parameter. Update ldinfo + accordingly. Use xcoff_mark_auto_exports to mark all automatically- + exported symbols. + +2009-03-14 Richard Sandiford + + * xcofflink.c (xcoff_mark_symbol_by_name): New function. + (bfd_xcoff_size_dynamic_sections): Use it to mark the entry, + init and fini functions. Do garbage collection for objects + without an entry point too. + +2009-03-14 Richard Sandiford + + * coffcode.h (coff_pointerize_aux_hook): Update CSECT_SYM_P to + check whether a symbol has csect information. + (coff_print_aux): Likewise. + * coff-rs6000.c (_bfd_xcoff_swap_aux_in): Handle auxillary csect + information for C_AIX_WEAKEXT too. + (_bfd_xcoff_swap_aux_out): Likewise. + (xcoff_reloc_type_br): Handle defweak symbols too. + * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Handle auxillary csect + information for C_AIX_WEAKEXT too. + (_bfd_xcoff64_swap_aux_out): Likewise. + (xcoff64_reloc_type_br): Handle defweak symbols too. + * coffgen.c (coff_print_symbol): Handle auxillary function + information for C_AIX_WEAKEXT too. + * xcofflink.c (_bfd_xcoff_canonicalize_dynamic_symtab): Set BSF_WEAK + instead of BSF_GLOBAL if the L_WEAK flag is set. + (xcoff_dynamic_definition_p): New function. + (xcoff_link_add_dynamic_symbols): Use it to decide whether ldsym + defines h. Don't change h if ldsym isn't the definition. Otherwise, + always take the symbol class from the ldsym. Use weak bfd symbol + types for weak ldsyms. + (xcoff_link_add_symbols): Use CSECT_SYM_P and EXTERN_SYM_P. + Fix the check for whether a definition is from a shared object. + Allow redefinitions of weak symbols. + (xcoff_link_check_ar_symbols): Use EXTERN_SYM_P. + (xcoff_keep_symbol_p): Likewise. + (bfd_xcoff_size_dynamic_sections): Use CSECT_SYM_P. + (xcoff_link_input_bfd): Use CSECT_SYM_P and EXTERN_SYM_P. + Add .loader entries for C_AIX_WEAKEXT as well as C_EXT symbols, + but mark them as L_WEAK. + (xcoff_write_global_symbol): Treat weak symbols as C_AIX_WEAKEXT + instead of C_EXT if C_AIX_WEAKEXT == C_WEAKEXT. + +2009-03-14 Richard Sandiford + + * xcofflink.c (xcoff_mark): When walking the relocations, + only mark the target symbol or the target section, not both. + (xcoff_final_definition_p): New function. + (xcoff_keep_symbol_p): Use it to check whether an external XCOFF + symbol is a valid definition of the associated output symbol. + Use XCOFF_ALLOCATED to stop the same hash table entry having + two output symbols. + (bfd_xcoff_size_dynamic_sections): Set XCOFF_ALLOCATED when + keeping a symbol. + (xcoff_link_input_bfd): Use xcoff_final_definition_p. + +2009-03-14 Richard Sandiford + + * xcofflink.c (bfd_xcoff_import_symbol): Treat imported absolute + symbols as XMC_XO. + +2009-03-14 Richard Sandiford + + * libcoff-in.h (xcoff_tdata): Add a lineno_counts field. + * libcoff.h: Regenerate. + * xcofflink.c (xcoff_link_add_symbols): Record per-symbol + line-number counts in the bfd's lineno_counts field. + Don't keep per-csect line-number counts. + (xcoff_sweep): Don't update per-csect line-number counts. + (bfd_xcoff_size_dynamic_sections): Count the number of line-number + entries in each output section. + (xcoff_link_input_bfd): Get the number of line numbers from + the bfd's lineno_counts field, rather than recalculating it + from scratch. Fix the range check when updating C_BINCL and + C_EINCL symbols. + (_bfd_xcoff_bfd_final_link): Don't count the output line numbers + here. Don't expect csects to have line-number counts. + +2009-03-14 Richard Sandiford + + * libcoff-in.h (xcoff_tdata): Change debug_indices to a signed long. + * libcoff.h: Regenerate. + * xcofflink.c (xcoff_keep_symbol_p): New function, using the + "skip" logic from xcoff_link_input_bfd. + (bfd_xcoff_size_dynamic_sections): Explicitly skip dynamic + objects in a dynamic link, rather than checking whether csectpp + is null. Always allocate debug_index for other objects, + and always go through the loop. Update the type of debug_index + after the change above. Read the auxillary csect information + and use xcoff_keep_symbol_p to decide whether a symbol should + be kept. Set its debug_index to -2 if not. + (xcoff_link_input_bfd): Update the type of debug_index after + the change above and always expect it to be nonnull. Use it to + test whether a symbol should be stripped, rather than making the + decision here. Postpone all symbol creation to the second pass. + +2009-03-14 Richard Sandiford + + * xcofflink.c: (xcoff_mark_symbol): Mark the TOC section when + creating a descriptor. + (xcoff_sweep): Don't mark toc_section unless it's needed. + (bfd_xcoff_size_dynamic_sections): Skip the toc_section + when marking every bfd. + (xcoff_link_input_bfd): Skip all TOC anchors. + (xcoff_toc_section_p, xcoff_find_tc0): New functions. + (_bfd_xcoff_bfd_final_link): Don't set the output bfd's TOC anchor + to -1; call xcoff_find_tc0 instead. + +2009-03-14 Richard Sandiford + + * libcoff-in.h (xcoff_section_tdata): Update commentary. + * libcoff.h: Regenerate. + * xcofflink.c (xcoff_link_add_symbols): Set the csect of XTY_ER + symbols to bfd_und_section_ptr or bfd_abs_section_ptr, rather than + the previous symbol's csect. Treat last_symndx as an inclusive value + and simplify its handling. + (xcoff_mark): Treat last_symndx as an inclusive value. Only mark + symbols with the right csect. Don't mark rsec when processing + relocations against undefined or absolute sections. + (bfd_xcoff_size_dynamic_sections): Don't check the SEC_MARK flag + of bfd_und_section_ptr. + (xcoff_link_input_bfd): Likewise. + +2009-03-14 Richard Sandiford + + * coff-rs6000.c (xcoff_ppc_relocate_section): Report relocations + against undefined symbols if the symbol's XCOFF_WAS_UNDEFINED + flag is set. Assert that all undefined symbols are either + imported or defined by a dynamic object. + * coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise. + * xcofflink.c (xcoff_link_add_symbols): Extend function-symbol + handling to all relocations. Only set XCOFF_CALLED for function + symbols. + (xcoff_find_function): New function, split out from... + (bfd_xcoff_export_symbol) ...here. + (xcoff_set_import_path): New function, split out from... + (bfd_xcoff_import_symbol): ...here. Remove assertion for old + meaning of XCOFF_CALLED. + (xcoff_mark_symbol): If we mark an undefined and unimported + symbol, find some way of defining it. If the symbol is a function + descriptor, fill in its definition automatically. If the symbol + is a function, mark its descriptor and allocate room for global + linkage code. Otherwise mark the symbol as implicitly imported. + Move the code for creating function descriptors from... + (xcoff_build_ldsyms): ...here. Use XCOFF_WAS_UNDEFINED to + check for symbols that were implicitly defined. + (xcoff_mark): Don't count any dynamic relocations against + function symbols. + (bfd_xcoff_size_dynamic_sections): Save the rtld parameter + in the xcoff link info. + (xcoff_link_input_bfd): Remove handling of undefined and + unexported symbols. + +2009-03-14 Richard Sandiford + + * coff-rs6000.c (xcoff_reloc_type_br): Make the branch absolute + if the target is absolute. Fix comment typo. + (xcoff_ppc_relocate_section): Remove FIXME. + * coff64-rs6000.c (xcoff64_reloc_type_br): Make the branch absolute + if the target is absolute. + +2009-03-14 Richard Sandiford + + * xcofflink.c (xcoff_mark, xcoff_link_input_bfd): Don't copy + R_POS and R_NEG relocations against absolute symbols to the + .loader section. + +2009-03-14 Richard Sandiford + + * coff64-rs6000.c (xcoff64_write_object_contents): Set the cputype + to 2 for bfd_mach_ppc_620. + +2009-03-14 Richard Sandiford + + * config.bfd: Treat AIX 6+ in the same way as AIX 5. + * configure.in: Likewise. + * configure: Regenerate. + +2009-03-13 H.J. Lu + + PR binutils/9945 + * elf.c (assign_section_numbers): Generate symbol table if there + is any relocation in output. + (_bfd_elf_compute_section_file_positions): Likewise. + +2009-03-13 Nick Clifton + + PR 9934 + * elf-bfd.h (NUM_SHDR_ENTRIES): Cope with an empty section. + * elflink.c (elf_link_read_relocs_from_section): Use + NUM_SHDR_ENTRIES. Gracefully handle the case where there are + relocs but no symbol table. + * elf32-arm.c (elf32_arm_check_relocs): Likewise. + +2009-03-12 H.J. Lu + + PR ld/9938 + * elf32-i386.c (elf_i386_check_tls_transition): Use strncmp + to check ___tls_get_addr. + + * elf64-x86-64.c (elf64_x86_64_check_tls_transition): Use + strncmp to check __tls_get_addr. + +2009-03-12 Andrew Stubbs + + * dwarf2.c (read_section): Always check the offset, even when the + section has been read before. + +2009-03-11 H.J. Lu + + * elf32-i386.c (elf_i386_check_tls_transition): Fix a typo in + comments. + +2009-03-11 Chris Demetriou + + * bfd.c (BFD_DETERMINISTIC_OUTPUT): New flag. + * bfd-in2.h: Regenerate. + * archive.c (bfd_ar_hdr_from_filesystem): If BFD_DETERMINISTIC_OUTPUT + flag is set, use 0 for uid, gid, and timestamp, and use 0644 for file + mode. + (bsd_write_armap): Likewise. + (_bfd_archive_bsd_update_armap_timestamp): If BFD_DETERMINISTIC_OUTPUT + flag is set, do nothing. + (coff_write_armap): If BFD_DETERMINISTIC_OUTPUT flag is set, use 0 + for timestamp. + +2009-03-11 Ulrich Weigand + + * elf32-spu.c (find_function_stack_adjust): Handle sf instruction + used to update stack pointer. + +2009-03-07 John David Anglin + + PR binutils/9921 + * som.c (som_bfd_derive_misc_symbol_info): Set symbol type ST_ABSOLUTE + for unknown symbols in absolute section. + +2009-03-06 Nick Clifton + + * po/es.po: Updated Spanish translation. + +2009-03-05 Christophe Lyon + + * elf32-arm.c (group_sections): Take next section size into + account before accepting to group it. + +2009-03-05 Christophe Lyon + + * elf32-arm.c (arm_type_of_stub): Handle long branches targetting + PLT entries. + (elf32_arm_final_link_relocate): Likewise. + +2009-03-05 Moritz Kroll + + PR 9923 + * peXXigen.c (_bfd_XXi_final_link_postscript): Check h->root.type. + +2009-03-04 Alan Modra + + * reloc.c (BFD_RELOC_PPC_TLSGD, BFD_RELOC_PPC_TLSLD): New. + * section.c (struct bfd_section): Add has_tls_get_addr_call. + (BFD_FAKE_SECTION): Init new flag. + * ecoff.c (bfd_debug_section): Likewise. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_TLSGD and R_PPC_TLSLD. + (ppc_elf_reloc_type_lookup): Handle new relocs. + (ppc_elf_check_relocs): Set has_tls_get_addr_call on finding such + without marker relocs. + (ppc_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs + if section has no old-style calls. + (ppc_elf_relocate_section): Set tls_mask for non-tls relocs too. + Don't try to optimize new-style __tls_get_addr call when handling + arg setup relocs. Instead do so for R_PPC_TLSGD and R_PPC_TLSLD + relocs. + * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_TLSGD, R_PPC64_TLSLD. + (ppc64_elf_reloc_type_lookup): Handle new relocs. + (ppc64_elf_check_relocs): Set has_tls_get_addr_call on finding such + without marker relocs. + (ppc64_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs + if section has no old-style calls. Set toc_ref for new relocs as + appropriate. + (ppc64_elf_relocate_section): Set tls_mask for non-tls relocs too. + Don't try to optimize new-style __tls_get_addr call when handling + arg setup relocs. Instead do so for R_PPC_TLSGD and R_PPC_TLSLD + relocs. + +2009-03-04 Alan Modra + + PR 6768 + * configure.in: Test for ld --as-needed support. Link shared + libbfd against libm. + * configure: Regenerate. + +2009-03-03 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2009-03-02 Qinwei + + * elf32-score7.c: New file. + * elf32-score.h: New file. + * elf32-score.c: Add code to support score 7. Set score7 as the + default. + * cpu-score.c: Add score7 architecure. + (compatibile): New function. + * Makefile.am: Add rules for building elf32-score7 object. + * Makefile.in: Regenerate. + * configure.in: Add elf32-score7 object to score vectors. + * configure: Regenerate. + * reloc.c: Add score7 relocs. + * archures.c: Add score3 and score7 machine numbers. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2009-03-01 Ralf Wildenhues + + * configure: Regenerate. + +2009-03-01 John David Anglin + + * elf32-hppa.c (hppa32_elf_local_refcounts): New function. + (elf32_hppa_check_relocs): Use it. + + * elf_hppa_add_symbol_hook (elf_hppa_add_symbol_hook): Move to + elf64-hppa.c. + (elf_hppa_unmark_useless_dynamic_symbols): Likewise. + (elf_hppa_remark_useless_dynamic_symbols): Likewise. + (elf_hppa_is_dynamic_loader_symbol): Likewise. + (elf_hppa_record_segment_addrs): Likewise. + (elf_hppa_final_link): Likewise. + (elf_hppa_relocate_insn): Likewise. + (elf_hppa_final_link_relocate): Likewise. + (elf64_hppa_relocate_section): Likewise. + * elf64-hppa.c: Insert above. + +2009-02-28 John David Anglin + + * elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link. + (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table. + (elf_hppa_relocate_section): Likewise. + * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive + from struct elf_link_hash_entry. Add count field. + (struct elf64_hppa_dyn_hash_table): Delete. + (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field. + (elf64_hppa_hash_table): Rename to hppa_link_hash_table. + (hppa_elf_hash_entry, eh_name): Define. + (elf64_hppa_new_dyn_hash_entry): Delete. + (elf64_hppa_dyn_hash_lookup): Delete. + (elf64_hppa_dyn_hash_traverse): Delete. + (get_dyn_name): Delete. + (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead + of struct elf64_hppa_dyn_hash_entry *. + (elf64_hppa_finalize_dlt, llocate_global_data_dlt, + allocate_global_data_plt, allocate_global_data_stub, + allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries): + Likewise. + (hppa64_link_hash_newfunc): New. + (elf64_hppa_hash_table_create): Rework. + (count_dyn_reloc): Likewise. + (hppa64_elf_local_refcounts): New. + (elf64_hppa_check_relocs): Rework using standard technique for recording + local DLT, PLT and OPD reference counts. + (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct + elf_link_hash_entry *. + (elf64_hppa_mark_exported_functions, allocate_global_data_dlt, + allocate_global_data_plt, allocate_global_data_stub, + allocate_global_data_opd, allocate_dynrel_entries, + elf64_hppa_adjust_dynamic_symbol, + elf64_hppa_mark_milli_and_exported_functions): Likewise. + (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections): + Use hppa_link_hash_table. Rework. + (elf64_hppa_link_output_symbol_hook): Rework. + (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd, + elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc, + elf64_hppa_finish_dynamic_sections): Likewise. + +2009-02-26 Christophe Lyon + + * elf32-arm.c (stub_reloc_type): Removed. + (insn_sequence): Renamed reloc_type field to r_type. + (elf32_arm_stub_long_branch_v4t_arm_thumb_pic): New stub. + (elf32_arm_stub_long_branch_v4t_thumb_arm_pic): Likewise. + (elf32_arm_stub_long_branch_thumb_only_pic): Likewise. + (elf32_arm_stub_type): Add new enum entries for the new stubs. + (arm_stub_is_thumb): Catch new stubs. + (arm_type_of_stub): Handle new stubs. + (arm_size_one_stub): Use ARRAY_SIZE. Handle new stubs. + (bfd_elf32_arm_process_before_allocation): Remove useless + condition. + +2009-02-25 H.J. Lu + + * elf.c (elf_find_function): Use is_function_type to check + function symbol. + +2009-02-24 Sterling Augustine + + * xtensa-modules.c: Revert to previous version 1.11 due + to inadvertant commit. + +2009-02-24 Sterling Augustine + + * elf32-xtensa.c (text_action_add): Separate test for action + type. Break if saved action is ta_widen_insn at same offset. + +2009-02-24 Daniel Jacobowitz + + * elf32-arm.c (elf32_arm_stub_long_branch_any_any_pic): Rename + to elf32_arm_stub_long_branch_any_arm_pic. + (elf32_arm_stub_long_branch_any_thumb_pic): New. + (enum elf32_arm_stub_type, arm_type_of_stub) + (arm_size_one_stub): Handle any to ARM PIC and any to Thumb PIC + separately. + +2009-02-24 Joseph Myers + + * elf32-arm.c (PREV_SEC): Update comment. + (group_sections): Rename argument to stubs_always_after_branch. + Reverse the list and place stubs at the end of input sections. + Undefine NEXT_SEC. + (elf32_arm_size_stubs): Update to use stubs_always_after_branch. + +2009-02-23 Daniel Jacobowitz + + * elf32-arm.c (arm_build_one_stub): Initialize stub_reloc_offset. + Fix formatting. + (arm_size_one_stub): Remove unnecessary break. + (arm_map_one_stub): Fix formatting. Return after BFD_FAIL. + +2009-02-23 Christophe Lyon + + * elf32-arm.c (stub_insn_type): New type. + (stub_reloc_type): Likewise. + (insn_sequence): Likewise. + (elf32_arm_stub_long_branch_any_any): Encode using insn_sequence. + (elf32_arm_stub_long_branch_v4t_arm_thumb): Likewise. + (elf32_arm_stub_long_branch_thumb_only): Likewise. + (elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise. + (elf32_arm_stub_short_branch_v4t_thumb_arm): Likewise. + (elf32_arm_stub_long_branch_any_any_pic): Likewise. + (elf32_arm_stub_hash_entry): Add new helper fields. + (stub_hash_newfunc): Initialize these new fields. + (arm_build_one_stub): Encode Arm and Thumb instructions separately + to take endianness into account. + (arm_size_one_stub): Compute size of stubs using insn_sequence. + (arm_map_one_stub): Code is now more generic, thanks to + insn_sequence. + +2009-02-23 Christophe Lyon + + * elf32-arm.c (elf32_arm_stub_long_branch_thumb_only): Fix stub + code. + (elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise. + (arm_type_of_stub): Use Thumb-only long branch stub (non-PIC) when + BLX is not available. Fix typo in warning message. Add comments + and improve formatting. + (arm_build_one_stub): Adjust to new + elf32_arm_stub_long_branch_v4t_thumb_arm stub. + (arm_map_one_stub): Likewise. + +2009-02-23 Tristan Gingold + Eric Botcazou + Douglas B Rupp + + * vms.h: Update copyright year, fix comments, reorder declarations. + (_bfd_save_vms_section): Remove the prototype. + (EGPS_S_V_NO_SHIFT): New constant. + (bfd_vms_set_section_flags): New prototype. + (EGPS_S_B_ALIGN, EGPS_S_W_FLAGS, EGPS_S_L_ALLOC, EGPS_S_B_NAMLNG): New + constants. + (EGSY_S_W_FLAGS): Ditto. + (EGSY_S_V_QUAD_VAL): Ditto. + (ESDF_S_L_VALUE, ESDF_S_L_PSINDX, ESDF_S_B_NAMLNG): Ditto. + (EGST_S_W_FLAGS, EGST_S_Q_LP_1, EGST_S_Q_LP_2, EGST_S_L_PSINDX, + EGST_S_B_NAMLNG): Ditto. + (ESRF_S_B_NAMLNG): Ditto. + (ETIR_S_C_HEADER_SIZE): Ditto. + (EGPS_S_V_ALLOC_64BIT): Ditto. + (DST_S_C_EPILOG): Ditto. + (DST_S_C_SRC_SETLNUM_L, DST_S_C_SRC_SETLNUM_W) : Ditto. + (DST_S_C_SRC_INCRLNUM_B): Ditto. + (DST_S_B_PCLINE_UNSBYTE, DST_S_W_PCLINE_UNSWORD): Ditto. + (DST_S_L_PCLINE_UNSLONG): Ditto. + (DST_S_B_MODBEG_NAME, DST_S_L_RTNBEG_ADDRESS) : Ditto + (DST_S_B_RTNBEG_NAME, DST_S_L_RTNEND_SIZE): Ditto + (DST_S_C_SOURCE_HEADER_SIZE): Ditto. + (DST_S_B_SRC_DF_LENGTH, DST_S_W_SRC_DF_FILEID): Ditto. + (DST_S_B_SRC_DF_FILENAME, DST_S_B_SRC_UNSBYTE): Ditto. + (DST_S_B_SRC_UNSBYTE): Ditto. + (DST_S_W_SRC_UNSWORD, DST_S_L_SRC_UNSLONG): Ditto. + Add prototypes. + (vms_section, vms_reloc): Remove types. + (hdr_struc): Replaced by ... + (hdr_struct): ... new type. + (EMH_S_W_HDRTYP, EMH_S_B_STRLVL, EMH_S_L_ARCH1): New constants. + (EMH_S_L_ARCH2, EMH_S_L_RECSIZ, EMH_S_B_NAMLNG): Ditto. + (EMH_DATE_LENGTH): Ditto. + (eom_struc): Replaced by ... + (eom_struct): ... new type. + (EEOM_S_L_TOTAL_LPS, EEOM_S_W_COMCOD, EEOM_S_B_TFRFLG): New constants. + (EEOM_S_L_PSINDX, EEOM_S_L_TFRADR): Ditto. + (EIHD_S_K_MAJORID, EIHD_S_K_MINORID, EIHD_S_K_EXE): Ditto. + (EIHD_S_L_SIZE, EIHD_S_L_ISDOFF, EIHD_S_L_SYMDBGOFF): Ditto. + (EIHD_S_Q_SYMVVA, EIHD_S_L_IMGTYPE): Ditto. + (EISD_S_L_EISDSIZE, EISD_S_L_SECSIZE, EISD_S_Q_VIR_ADDR): Ditto. + (EISD_S_L_FLAGS, EISD_S_L_VBN, EISD_S_R_CONTROL): Ditto. + (EISD_S_L_IDENT, EISD_S_T_GBLNAM): Ditto. + (EISD_S_M_GBL, EISD_S_M_CRF, EISD_S_M_DZRO, EISD_S_M_WRT): Ditto. + (EISD_S_M_INITALCODE, EISD_S_M_BASED, EISD_S_M_FIXUPVEC): Ditto. + (EISD_S_M_RESIDENT, EISD_S_M_VECTOR, EISD_S_M_PROTECT): Ditto. + (EISD_S_M_LASTCLU, EISD_S_M_EXE, EISD_S_M_NONSHRADR): Ditto. + (EISD_S_M_QUAD_LENGTH, EISD_S_M_ALLOC_64BIT): Ditto. + (EIHS_S_L_DSTVBN, EIHS_S_L_DSTSIZE, EIHS_S_L_GSTVBN): Ditto. + (EIHS_S_L_GSTSIZE, EIHS_S_L_DMTVBN, EIHS_S_L_DMTBYTES): Ditto. + (DBG_S_L_DMT_MODBEG, DBG_S_L_DST_SIZE): Ditto. + (DBG_S_W_DMT_PSECT_COUNT, DBG_S_C_DMT_HEADER_SIZE): Ditto. + (DBG_S_L_DMT_PSECT_START, DBG_S_L_DMT_PSECT_LENGTH) + (DBG_S_C_DMT_PSECT_SIZE): Ditto. + (enum file_type_enum): New type. + (struct location_struct): Removed. + (struct fileinfo, struct srecinfo, struct lineinfo): New types. + (struct funcinfo, struct module): Ditto. + (struct vms_private_data_struct): Update fields. + (struct vms_section_data_struct): New type. + + * vms.c: Update copyright year, fix comments, + Fix includes for DECC, add prototypes. + (vms_initialize): Use bfd_alloc instead of bfd_zalloc and remove + some initializers. + Use flavour to set is_vax, location_stack is removed. + (struct pair): Declare. + (fill_section_ptr): Initialize variables at declaration. + Add guard to set SECTION_SYM flag, handlde und section. + (vms_fixup_sections): Use struct pair for fill_section_ptr argument. + (_bfd_vms_slurp_object_records): New function, replaces previous + vms_object_p. + (vms_slurp_module): New function. + (vms_slurp_image): Ditto. + (vms_object_p): Complete rewrite. + (vms_mkobject): Use is_vax field to slect architecture. + (free_reloc_stream): New function. + (vms_convert_to_var): Ditto. + (vms_convert_to_var_1): Ditto. + (vms_convert_to_var_unix_filename): Ditto. + (vms_close_and_cleanup): Call free_reloc_stream, convert file to + VAR format on VMS. + (vms_new_section_hook): Set alignment to 0, allocate private data. + (vms_get_section_contents): Load content. + (vms_get_symbol_info): Handle undefined section. + (vms_find_nearest_line): Handle. + (alloc_reloc_stream): New function. + (vms_slurp_reloc_table): Ditto. + (vms_get_reloc_upper_bound): Make it real. + (vms_canonicalize_reloc): Do the real work. + (alpha_howto_table): Add ALPHA_R_NOP, ALPHA_R_BSR, ALPHA_R_LDA, + ALPHA_R_BOH. + (vms_bfd_reloc_type_lookup): Handle NOP, BSR, LDA and BOH. + (vms_set_arch_mach): Check arch. + (vms_set_section_contents): Copy the content after allocation. + (vms_alpha_vec): Update object flags. + + * vms-tir.c: Update copyright year, fix comments, + add prototypes for new functions. + (dst_define_location): New function. + (dst_restore_location): New function. + (dst_retrieve_location): New function. + (dst_check_allocation): New function. + (image_dump): Call dst_check_allocation. + (image_write_b): Ditto. + (image_write_w): Ditto. + (image_write_l): Ditto. + (image_write_q): Ditto. + (cmd_name): Handle STA_LW, STA_QW, STO_OFF, STO_IMM, STO_IMMR, STO_LW, + STO_QW, OPR_ADD, CTL_SETRB, STC_LP_PSB, CTL_DFLOC, CTL_STLOC, + CTL_STKDL. + Call error handler instead of abort if name is not known. + (etir_sta): Add quarter_relocs argument and set it. + Fix cast. + (etir_sto): Ditto. + (etir_opr): Ditto, return FALSE in case of error. + (etir_ctl): Add quarter_relocs argument and set it, fix cast. + Fix CTL_DFLOC, CTL_STLOC, CTL_STKDL. + (etir_stc): Add quarter_relocs argument and set it, fix cast. + Fix STC_LP, STC_LP_PSB, STC_GBL and STC_CGA. + Handle STC_LP_PSB, STC_BSR_GBL, STC_LDA_GBL, STC_BOH_GBL. + Move STC_NOP_PS, STC_BSR_PS, STC_LDA_PS, STC_BOH_PS, STC_NBH_PS. + Return FALSE in case of error. + (tir_sta): Change sign of psect. + (tir_ctl): Ditto. + (tir_cmd): Fix cast. Makes tir_table static const. + (etir_cmd): Add quarter_relocs argument, makes etir_table const, + add argument to explain. + (analyze_etir): Initialize maxptr, add quarter_relocs + declaration, move some declarations into inner scopes. + Handle quarter_relocs and STO_IMM. + (_bfd_vms_slurp_tir): Use constant instead of hard-coded values. + (_bfd_vms_slurp_relocs): New function. + (_bfd_vms_decode_relocs): New function. + (sto_imm): Rewritten. + (start_first_etbt_record): New function. + (start_another_etbt_record): Ditto. + (etir_output_check): Ditto. + (defer_reloc_p): Ditto. + (_bfd_vms_write_tir): Remove nextoffset, convert a while-loop to + a for-loop. Correctly deals with contents, deals with .vmsdebug, + rewritte relocations handling. + (_bfd_vms_write_tbt): Removed. + (_bfd_vms_write_dbg): Ditto. + + * vms-misc.c: Update copyright year, Fix comments. + (_bfd_vms_get_header_values): Use 'size' instead of 'length'. + (maybe_adjust_record_pointer_for_object): New function. + (_bfd_vms_get_first_record): New function, replaces ... + (_bfd_vms_get_record): .. removed. + (_bfd_vms_get_object_record): New function. + (_bfd_vms_get_object_record): New function. + (vms_get_remaining_object_record): New function, replaces ... + (_bfd_vms_get_next_record): ... removed. + (add_new_contents): Removed. + (_bfd_save_vms_section): Removed. + (_bfd_get_vms_section): Removed. + (_bfd_vms_output_flush): Write in VAR format. + (new_symbol): Don't make UND section. + + * vms-hdr.c: Update copyright year, update list of record handled. + (_bfd_vms_slurp_hdr): rec_length renamed to rec_size. + (_bfd_vms_write_hdr): Strip vms and unix patches, + add comments, truncate module name at 31 characters, + use constants instead of hard-coded value, + write BFD version instead of a fixed string. + (_bfd_vms_slurp_ihd): New function. + (_bfd_vms_slurp_isd): Ditto. + (_bfd_vms_slurp_ihs): Ditto. + (new_module): Ditto. + (parse_module): Ditto + (build_module_list): Ditto. + (module_find_nearest_line): Ditto. + (_bfd_vms_find_nearest_dst_line): Ditto. + (vms_slurp_debug): Ditto. + (_bfd_vms_slurp_dbg): Ditto. + (_bfd_vms_slurp_tbt): Ditto. + (_bfd_vms_write_dbg): Ditto. + (_bfd_vms_write_tbt): Ditto. + + * vms-gsd.c: Update copyright year, update list of records handled. + (EVAX_LITERALS_NAME): New macro. + (evax_section_flags): Add an entry for EVAX_LITERALS_NAME. + (gpsflagdesc, gsyflagdesc): Moved out of _bfd_vms_slurp_gsd. + (register_universal_symbol): New function and prototype. + (_bfd_vms_slurp_gsd): Fix indentations and casts, + improve debug messages, + use constants instead of hard-coded value, + fix missing endianness conversion, + handle global symbol (SYMG). + (bfd_vms_set_section_flags): New function. + (_bfd_vms_write_gsd): Don't write .vmsdebug section, + handle section literals, + fix indentation, + handle section bfd and vms flags, + don't output LIB$INITIALIZE symbol, + fix handling of weak symbols, + fix evax vs vax procedure descriptor, + handle absolute symbols. + + * reloc.c (BFD_RELOC_ALPHA_NOP, BFD_RELOC_ALPHA_BSR, + BFD_RELOC_ALPHA_LDA, BFD_RELOC_ALPHA_BOH): New relocations. + + * makefile.vms (DEFS): Fix flags for VMS. + + * bfdio.c (real_fopen): Handle multiple VMS fopen attributes. + + * bfd-in2.h: Regenerated. + * libbfd.h: Regenerated. + +2009-02-20 Cary Coutant + + * vmsutil.c (vms_file_stats_name): Fix incorrect use of st_mtime + in struct stat. + +2009-18-02 Dave Korn + + PR gas/7059 + * coffcode.h (coff_write_object_contents): Don't let the string + table offset overflow the s_name field when using long section names. + +2009-18-02 Dave Korn + + * coff-alpha.c (alpha_ecoff_backend_data): Initialise fields which + control long section name handling with ECOFF_NO_LONG_SECTION_NAMES. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + * coff-rs6000.c (bfd_xcoff_backend_data): Initialise fields which + control long section name handling with XCOFF_NO_LONG_SECTION_NAMES. + (bfd_pmac_xcoff_backend_data): Likewise. + * coff64-rs6000.c (bfd_xcoff_backend_data): Likewise. + (bfd_xcoff_aix5_backend_data): Likewise. + (xcoff64_write_object_contents): Delete unused long_section_names + local variable. + * coff-sh.c (bfd_coff_small_swap_table): Initialise long section + name members using COFF_DEFAULT_LONG_SECTION_NAMES and make entire + struct non-const. + * coffcode.h (documentation): Update to describe long section names. + (COFFLONGSECTIONCATHELPER): New helper macro. + (BLANKOR1TOODD): Likewise. + (COFF_ENABLE_LONG_SECTION_NAMES): Likewise. + (COFF_LONG_SECTION_NAMES_SETTER): Likewise. + (COFF_DEFAULT_LONG_SECTION_NAMES): Likewise. + (bfd_coff_set_long_section_names_allowed): New function. + (bfd_coff_set_long_section_names_disallowed): Likewise. + (struct bfd_coff_backend_data): Add new backend hook function + pointer _bfd_coff_set_long_section_names. + (bfd_coff_set_long_section_names): New backend hook. + (coff_write_object_contents): Only generate long section names if + bfd_coff_long_section_names() indicates they are currently enabled. + (bfd_coff_std_swap_table): Make non-const, and initialise long + section name fields using COFF_DEFAULT_LONG_SECTION_NAMES. + (ticoff0_swap_table): Likewise to both. + (ticoff1_swap_table): Again, likewise to both. + * coffgen.c (make_a_section_from_file): Allow long section names + as inputs even if not currently allowed for outputs. + * ecoff.c (_bfd_ecoff_no_long_sections): New function. + * efi-app-ia32.c (COFF_LONG_SECTION_NAMES): Define to 0, not blank. + * efi-app-ia64.c (COFF_LONG_SECTION_NAMES): Likewise. + * efi-app-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. + * efi-bsdrv-ia32.c (COFF_LONG_SECTION_NAMES): Likewise. + * efi-bsdrv-ia64.c (COFF_LONG_SECTION_NAMES): Likewise. + * efi-bsdrv-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. + * efi-rtdrv-ia32.c (COFF_LONG_SECTION_NAMES): Likewise. + * efi-rtdrv-ia64.c (COFF_LONG_SECTION_NAMES): Likewise. + * efi-rtdrv-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. + * pei-arm.c (COFF_LONG_SECTION_NAMES): Likewise. + * pei-i386.c (COFF_LONG_SECTION_NAMES): Likewise. + * pei-mcore.c (COFF_LONG_SECTION_NAMES): Likewise. + * pei-mips.c (COFF_LONG_SECTION_NAMES): Likewise. + * pei-ppc.c (COFF_LONG_SECTION_NAMES): Likewise. + * pei-sh.c (COFF_LONG_SECTION_NAMES): Likewise. + * pei-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. + * libcoff-in.h: Update copyright year to cause updated copyright + year in generated libcoff.h, and fix typo. + * libcoff.h: Regenerated. + * libecoff.h (ECOFF_NO_LONG_SECTION_NAMES): New macro. + (_bfd_ecoff_no_long_sections): Add prototype. + * libxcoff.h (XCOFF_NO_LONG_SECTION_NAMES): New macro. + * pe-mips.c (COFF_LONG_SECTION_NAMES): Define empty if not already + defined by an including .c file. + * ticoff.h (ticoff0_swap_table): Make non-const, and initialise + long section name fields using COFF_DEFAULT_LONG_SECTION_NAMES. + (ticoff1_swap_table): Likewise to both. + +2009-02-18 Christophe Lyon + + * elf32-arm.c (arm_build_one_stub): Fix relocation target for pic + stub. Catch default case error. + (arm_map_one_stub): Add missing Thumb mapping symbol. + +2009-02-18 Bjoern Haase + + PR 9841 + * elf32-avr.c: Handle case where no local symbos exist correctly. + +2009-02-16 Christophe Lyon + + bfd/ + * elf32-arm.c (arm_long_branch_stub, + arm_thumb_v4t_long_branch_stub, + arm_thumb_thumb_long_branch_stub, + arm_thumb_arm_v4t_long_branch_stub, + arm_thumb_arm_v4t_short_branch_stub, + arm_pic_long_branch_stub): + Renamed to elf32_arm_stub_long_branch_any_any, + elf32_arm_stub_long_branch_v4t_arm_thumb, + elf32_arm_stub_long_branch_thumb_only, + elf32_arm_stub_long_branch_v4t_thumb_arm, + elf32_arm_stub_short_branch_v4t_thumb_arm, + elf32_arm_stub_long_branch_any_any_pic. + (arm_stub_long_branch, arm_thumb_v4t_stub_long_branch, + arm_thumb_thumb_stub_long_branch, + arm_thumb_arm_v4t_stub_long_branch, + arm_thumb_arm_v4t_stub_short_branch, arm_stub_pic_long_branch): + Renamed to arm_stub_long_branch_any_any, + arm_stub_long_branch_v4t_arm_thumb, + arm_stub_long_branch_thumb_only, + arm_stub_long_branch_v4t_thumb_arm, + arm_stub_short_branch_v4t_thumb_arm, + arm_stub_long_branch_any_any_pic. + +2009-02-15 John David Anglin + + * elf-hppa.h (elf_hppa_final_link_relocate): Correct addend value used + in branch offset check. + +2009-02-15 Alan Modra + + * elf64-ppc.c (struct _ppc64_elf_section_data): Delete t_symndx, + add toc.symndx and toc.add. + (ppc64_elf_check_relocs): Don't set htab->tls_get_addr here. + Set up toc.add. + (get_tls_mask): Add toc_addend param, set from toc.add. Adjust all + callers. + (ppc64_elf_tls_setup): Set htab->tls_get_addr and tls_get_addr_fd. + (branch_reloc_hash_match): New function, extracted from.. + (ppc64_elf_tls_optimize): ..here. + (ppc64_elf_relocate_section): Properly set addends when optimizing + tls sequences. Avoid unnecessary reading and writing of insns. + Only redo reloc when symbol changed. Bypass symbol checks when + using tlsld_got. + * elf32-ppc.c (ppc_elf_tls_setup): Correct comment. + (branch_reloc_hash_match): New function, extracted from.. + (ppc_elf_tls_optimize): ..here. + (ppc_elf_relocate_section): Avoid unnecessary reading of insns. + Don't clear addend on zapped __tls_get_addr reloc. + +2009-02-12 Nick Clifton + + PR 9827 + * elflink.c (bfd_elf_final_link): When counting the relocations, + if the header size has not been set yet then assume that it will + match the output section's reloc type. + +2009-02-12 Nathan Sidwell + + * elf32-mips.c (mips_elf_final_gp): Don't add 0x4000 offset for + relocatable link. + +2009-02-09 Alan Modra + + * elf32-spu.c (spu_elf_find_overlays): Call bfd_set_error on errors. + (find_function): Likewise. + (pasted_function): Don't error if no prior function found. + (discover_functions): Revert 2008-12-10 change. Extend first + function range to start of section. + +2009-02-08 John David Anglin + + * elf64-hppa.c: Remove PARAMS macro. Replace PTR with void *. Convert + functions to C90. + * elf64-hppa.h: Likewise. + +2009-02-06 Joseph Myers + + * elfxx-mips.c (_bfd_mips_elf_section_processing): Remove special + .sbss handling. + +2009-02-04 Alan Modra + + * elf32-spu.c (spu_elf_build_stubs): Define __icache_neg_log2_linesize. + Define __icache_ptr_handler*, not __icache_ptr___icache_bi_handler*. + +2009-02-03 Sandip Matte + + * aoutx.h (NAME (aout, machine_type)): Handle bfd_mach_mips_xlr. + * archures.c (bfd_mach_mips_xlr): Define. + * bfd-in2.h: Regenerate. + * cpu-mips.c (I_xlr): Define. + (arch_info_struct): Add XLR entry. + * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_XLR. + (mips_set_isa_flags): Handle bfd_mach_mips_xlr + (mips_mach_extensions): Add XLR entry. + +2009-02-03 Eric B. Weddington + + * elf32-avr.c (avr_final_link_relocate): Allow avr25 to wraparound. + +2009-02-03 Carlos O'Donell + + * configure.in: AC_SUBST pdfdir. + * Makefile.am: Add install-pdf, install-pdf-am + and install-pdf-recursive targets. Define pdfdir. + * doc/Makefile.am: Define pdf__strip_dir. Add + install-pdf and install-pdf-am targets. + * po/Make-in: Add install-pdf target. + * configure: Regenerate. + * Makefile.in: Regenerate + * doc/Makefile.in: Regenerate. + +2009-02-03 Maxim Kuvyrkov + + * bfd-in2.h: Regenerate. + * elf32-m68k.c: Handle 2-slot GOT entries. Rename variables and + fields from n_entries to n_slots where appropriate, update comments. + (HOWTO): Add TLS relocations. + (reloc_map): Map BFD_RELOC_68K_TLS_* to R_68K_TLS_*. + (enum elf_m68k_got_offset_size): New enum. + (struct elf_m68k_got_entry.type): Move field to ... + (struct elf_m68k_got_entry_key): ... here. Update all uses. + (elf_m68k_reloc_got_type, elf_m68k_reloc_got_offset_size): New static + functions. + (elf_m68k_reloc_got_n_entries, elf_m68k_reloc_tls_p): New static + functions. + (struct elf_m68k_got): merge rel_8o_n_entries and rel_8o_16o_n_entries + fields into n_entries array. Update comments. + (elf_m68k_init_got): Simplify, update all uses. + (elf_m68k_init_got_entry_key): Handle R_68K_TLS_LDM32 reloc, update. + (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT): Adjust to handle 2-slot + GOT entries; update name, update all uses. + (ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): Ditto. + (elf_m68k_get_got_entry): Update. + (elf_m68k_update_got_entry_type): Rewrite to handle TLS GOT entries, + simplify. + (elf_m68k_remove_got_entry_type): Simplify. + (elf_m68k_add_entry_to_got, elf_m68k_can_merge_gots_1): Update. + (elf_m68k_can_merge_gots): Update. + (elf_m68k_merge_gots_1, elf_m68k_merge_gots): Update. + (struct elf_m68k_finalize_got_offsets_arg): Rewrite to handle 2-slot + GOT entries, simplify. + (elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Same. + (struct elf_m68k_partition_multi_got_arg): Add slots_relas_diff + field, remove obsoleted local_n_entries field. + (elf_m68k_partition_multi_got_2): New static function. + (elf_m68k_partition_multi_got_1, elf_m68k_partition_multi_got): Use it; + update. + (elf_m68k_remove_got_entry_type): Update. + (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions. + (elf_m68k_check_relocs): Handle TLS relocations. Remove unnecessary + update of sgot->size and srelgot->size. + (elf_m68k_gc_sweep_hook): Update. + (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions. + (elf_m68k_relocate_section, elf_m68k_finish_dynamic_symbol): Handle + TLS relocations. + * reloc.c (BFD_RELOC_68K_TLS_*): Declare TLS relocations. + * libbfd.h (bfd_reloc_code_real_names): Add BFD_RELOC_68K_TLS_*. + +2009-02-02 DJ Delorie + + * elf32-mep.c (config_names): Regenerate configuration. + +2009-02-02 Alan Modra + + * elf-bfd.h (bfd_elf_get_str_section): Don't declare. + (bfd_elf_find_section, _sh_elf_set_mach_from_flags): Likewise. + * elf.c (bfd_elf_get_str_section): Make static. + (bfd_elf_find_section): Delete. + * libbfd.h: Regenerate. + +2009-02-01 Jan Kratochvil + + * elf-eh-frame.c (REQUIRE_CLEARED_RELOCS) Remove. + (_bfd_elf_parse_eh_frame): Do not check relocations for removed FDEs. + +2009-01-31 Alan Modra + + * elflink.c (on_needed_list): New function. + (elf_link_add_object_symbols): Link in --as-needed libs if they + satisfy undefined symbols in other libs. + +2009-01-30 Julian Brown + + * elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Skip BFDs with + EXEC_P or DYNAMIC flags, and skip sections which are being linked + with --just-symbols (-R). + +2009-01-29 Adam Nemet + + * dwarf2.c (read_rangelist): Use read_address to read low_pc and + high_pc in order to properly sign-extend VMAs. + +2009-01-29 Daniel Jacobowitz + Mark Shinwell + Catherine Moore + + * elf-attrs.c, elflink.c, elfxx-mips.c: Correct typos in comments. + +2009-01-28 Catherine Moore + + * elf32-arm.c (elf32_arm_check_relocs): Set SEC_ALLOC and + SEC_LOAD for dynamic relocation sections. + +2009-01-27 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section): Use elf_hash_table + (info)->tls_size, not elf_hash_table (info)->tls_sec->size for + the size of local TLS data. + +2009-01-27 Andreas Schwab + + * mach-o.c (bfd_mach_o_archive_p): Restrict the number of + architectures in the archive. + +2009-01-27 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) + : Correct relocation value. + + * elf32-cris.c (cris_elf_relocate_section) + : Don't call BFD_ASSERT for weak undefined + symbols with non-default visibility. + +2009-01-26 Nathan Sidwell + + * elf32-ppc.c (ppc_elf_relax_section): Add space for relocs + describing the trampolines. + (ppc_elf_relocate_section): Update relocs to describe the + trampolines. + +2009-01-25 John David Anglin + + * elf-hppa.h (elf_hppa_final_link_relocate): Add check to ensure that + branch targets can be reached for R_PARISC_PCREL22F, R_PARISC_PCREL17F + and R_PARISC_PCREL12F relocations. + +2009-01-24 Alan Modra + + PR 6022 + * elflink.c (find_version_for_sym): New function split out from, + but without export_dynamic test, .. + (_bfd_elf_link_assign_sym_version): ..here. + (_bfd_elf_export_symbol): Use it. + +2009-01-23 Alan Modra + + * elf-bfd.h (struct elf_assign_sym_version_info): Delete. + (struct elf_info_failed, struct elf_find_verdep_info): Move to.. + * elflink.c: ..here, somewhat modified. + * elf-bfd.h (_bfd_elf_add_default_symbol, _bfd_elf_export_symbol, + _bfd_elf_link_find_version_dependencies, + _bfd_elf_link_assign_sym_version, _bfd_elf_link_size_reloc_section, + _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol, + _bfd_elf_link_sec_merge_syms, bfd_elf_link_mark_dynamic_symbol): Don't + declare.. + * elflink.c: ..and make static here. + (_bfd_elf_link_find_version_dependencies): Adjust for removal + of output_bfd from struct elf_find_verdep_info. + (_bfd_elf_link_assign_sym_version): Similarly adjust to use + struct elf_info_failed. + (bfd_elf_size_dynamic_sections): Adjust. + +2009-01-22 Alan Modra + + PR 6832 + * dwarf2.c (find_line): Don't update stash->sec_info_ptr until + after comp_unit_find_line call. + +2009-01-21 Nick Clifton + + PR 9769 + * vmsutil.c (vms_file_stats_name): Remove use of unsupported + tm_gmtoff field in struct tm. + +2009-01-21 Alan Modra + + * elf32-spu.h (struct spu_elf_params): Add non_ia_text. + * elf32-spu.c (mark_overlay_section): Only include .text.ia.* + sections in soft-icache lines unless non_ia_text. Don't add + rodata if doing so would exceed line size. + +2009-01-19 Hans-Peter Nilsson + + * elf32-cris.c (elf_cris_copy_indirect_symbol): For other symbol + types than bfd_link_hash_indirect, before early return, call + _bfd_elf_link_hash_copy_indirect. + +2009-01-19 Andrew Stubbs + + * elf-attrs.c (vendor_set_obj_attr_contents): Support tag ordering. + * elf-bfd.h (elf_backend_data): Add obj_attrs_order. + * elf32-arm.c (elf32_arm_obj_attrs_order): New function. + (elf_backend_obj_attrs_order): New define. + * elfxx-target.h (elf_backend_obj_attrs_order): New define. + (elfNN_bed): Add elf_backend_obj_attrs_order. + +2009-01-19 Andrew Stubbs + + * elf-attrs.c (is_default_attr): Substitute magic numbers with macros. + (obj_attr_size): Likewise. + (write_obj_attribute): Likewise. + (_bfd_elf_copy_obj_attributes): Likewise. + (_bfd_elf_parse_attributes): Likewise. + * elf-bfd.h (ATTR_TYPE_FLAG_INT_VAL): New define. + (ATTR_TYPE_FLAG_STR_VAL, ATTR_TYPE_FLAG_NO_DEFAULT): New defines. + (ATTR_TYPE_HAS_INT_VAL, ATTR_TYPE_HAS_STR_VAL): New defines. + (ATTR_TYPE_HAS_NO_DEFAULT): New define. + * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Replace magic numbers + with macros. + +2009-01-19 Andrew Stubbs + + * elf-attrs.c (is_default_attr): Support defaultless attributes. + (bfd_elf_add_obj_attr_int): Get type from _bfd_elf_obj_attrs_arg_type. + (bfd_elf_add_obj_attr_string): Likewise. + (bfd_elf_add_obj_attr_int_string): Likewise. + (_bfd_elf_parse_attributes): Allow for unknown flag bits in type. + * elf-bfd.h (struct obj_attribute): Document new flag bit. + * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Specify that + Tag_nodefaults has no default value. + (elf32_arm_merge_eabi_attributes): Modify the Tag_nodefaults + comment to reflect the new state. + +2009-01-19 Alan Modra + + PR 9695 + * pdp11.c (N_BADMAG): True for anything but OMAGIC, NMAGIC, ZMAGIC. + (some_aout_object_p): Delete dead code handling QMAGIC and BMAGIC. + (adjust_z_magix): Delete dead code handling QMAGIC. + +2009-01-16 Kai Tietz + + * coffcode.h (styp_to_sec_flags): Correct interpretation of + IMAGE_SCN_MEM_DISCARDABLE. + +2009-01-16 Alan Modra + + * Makefile.am (libbfd_la_LIBADD, libbfd_la_LDFLAGS): Substitute + SHARED_LIBADD and SHARED_LDFLAGS rather than WIN32LIBADD, WIN32LDFLAGS. + * configure.in (commonbfdlib): Delete. + (SHARED_LDFLAGS): Rename from WIN32LDFLAGS/ + (SHARED_LIBADD): Rename from WIN32LIBADD. Add pic libiberty if such + is available, not just for linux. + * po/SRC-POTFILES.in: Regenerate. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2009-01-15 Andrew Stubbs + Julian Brown + + * elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Set to 71 to include all known + ARM attributes in ABI 2.07. + * elf32-arm.c (get_secondary_compatible_arch): New function. + (set_secondary_compatible_arch): New function. + (tag_cpu_arch_combine): New function. + (elf32_arm_copy_one_eabi_other_attribute): Delete function. + (elf32_arm_copy_eabi_other_attribute_list): Delete function. + (elf32_arm_merge_eabi_attributes): Rename order_312 to order_021 to + make it fit with order_01243. + Add support for Tag_also_compatible_with, + Tag_CPU_unaligned_access, Tag_T2EE_use, Tag_Virtualization_use, + Tag_MPextension_use, Tag_nodefaults and Tag_conformance. + Improve/tidy up support for Tag_CPU_raw_name, Tag_CPU_name, + Tag_CPU_arch, Tag_ABI_HardFP_use, Tag_VFP_HP_extension, + Tag_ABI_FP_denormal, Tag_ABI_PCS_GOT_use, Tag_ABI_align8_needed, + Tag_VFP_arch and Tag_ABI_FP_16bit_format. + Rework the way unknown attributes are handled. + Defer errors until all attributes have been processed. + +2009-01-15 Andrew Stubbs + + * elf-attrs.c (bfd_elf_add_obj_attr_compat): Rename to + bfd_elf_add_obj_attr_int_string. + Read Tag_compatibility from its new location in the attribute array, + rather than the attribute list. + (_bfd_elf_copy_obj_attributes): bfd_elf_add_obj_attr_compat -> + bfd_elf_add_obj_attr_int_string. + (_bfd_elf_parse_attributes): Likewise. + (_bfd_elf_merge_object_attributes): There's now only one + Tag_compatibility, and it's in the array, not the list. + * elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Set to 33 to include + Tag_compatibility. + (bfd_elf_add_obj_attr_compat): Rename to + bfd_elf_add_obj_attr_int_string. + (bfd_elf_add_proc_attr_compat): Rename to + bfd_elf_add_proc_attr_int_string. + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Explicitly don't handle + Tag_compatibility. + +2009-01-15 Douglas B Rupp + + * Makefile.am (BFD32_BACKENDS): Add new object vmsutil.lo + (BFD32_BACKENDS_CFILES): Add new file vmsutil.c + (vmsutil.lo): Add dependency rule. + * Makefile.in: Regenerate. + * config.bfd (ia64*-*-*vms*): Add case. + * configure.in (bfd_elf64_ia64_vms_vec): Add case. + * configure: Regenerate. + * vmsutil.c: New file. + * vmsutil.h: New file. + * elf-bfd.h (struct bfd_elf_special_section): Change type of + attr to bfd_vma. + * elfxx-ia64.c (elfNN_vms_post_process_headers, + elfNN_vms_section_processing, elfNN_vms_final_write_processing, + elfNN_vms_close_and_cleanup, elfNN_vms_section_from_shdr, + elfNN_vms_object_p): New functions + * targets.c (bfd_elf64_ia64_vms_vec): New target. + +2009-01-14 H.J. Lu + + PR ld/9727 + * elflink.c (elf_gc_sweep): Exclude the group section if the + first member of the section group is excluded. + +2009-01-14 Alan Modra + + PR 9735 + * syms.c (_bfd_stab_section_find_nearest_line): Don't free + saved filename, use bfd_alloc rather than bfd_malloc for it. + +2009-01-13 Alan Modra + + * elf32-spu.c (spu_elf_build_stubs): Make __icache_base absolute. + +2009-01-13 Alan Modra + + * elf32-spu.c (remove_cycles): Always set call->max_depth. + +2009-01-12 Alan Modra + + * elf32-spu.c (spu_elf_auto_overlay): Correct vma mask. + +2009-01-12 Alan Modra + + * elf32-spu.c (struct spu_link_hash_table): Add init, line_size_log2, + num_lines_log2. + (struct got_entry): Add br_addr. + (struct call_info): Add priority. + (struct function_info): Add lr_store and sp_adjust. + (spu_elf_setup): Init line_size_log2 and num_lines_log2. + (spu_elf_find_overlays): For soft-icache, mark any section within cache + area as an overlay, and check that no other overlays exist. Look up + icache overlay manager entry sym. + (BRA_STUBS, BRA, BRASL): Define. + (enum _stub_type): Replace ovl_stub with call_ovl_stub and br*_ovl_stub. + (needs_ovl_stub): Adjust for soft-icache. Return priority encoded + in branch insn. + (count_stub, build_stub): Support soft-icache. + (build_spuear_stubs, process_stubs): Adjust build_stub call. + (spu_elf_size_stubs): Size soft-icache stubs. + (overlay_index): New function. + (spu_elf_build_stubs): Make static. Support soft-icache. + (spu_elf_check_vma): Don't turn off auto_overlay if soft-icache. + (find_function_stack_adjust): Save lr store and stack adjust insn + offsets. + (maybe_insert_function): Adjust find_function_stack_adjust call. + (mark_functions_via_relocs): Retrieve priority. + (remove_cycles): Only warn about pruned arcs when stack_analysis. + (sort_calls): Sort by priority first. + (mark_overlay_section): Ignore .ovl.init. + (sum_stack): Only print when stack_analysis. + (print_one_overlay_section): New function, extracted from.. + (spu_elf_auto_overlay): ..here. Support soft-icache overlays. + (spu_elf_stack_analysis): Only print when htab->stack_analysis. + (spu_elf_final_link): Call spu_elf_stack_analysis for lrlive + analysis. Call spu_elf_build_stubs. + (spu_elf_relocate_section): For soft-icache encode overlay index + into addresses. + (spu_elf_output_symbol_hook): Support soft-icache. + (spu_elf_modify_program_headers: Likewise. + + * elf32-spu.h (struct spu_elf_params): Add lrlive_analysis. Rename + num_regions to num_lines. Add line_size and max_branch. + (enum _ovly_flavour): Add ovly_soft_icache. + (spu_elf_build_stubs): Delete. + +2009-01-11 Jan Kratochvil + + * elflink.c (_bfd_elf_section_already_linked): Handle g++-3.4 + relocations in `.gnu.linkonce.r.*' referencing its `.gnu.linkonce.t.*'. + +2009-01-07 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) + : For a symbol defined in + the program, the known offset starts at the negative size of the + TLS section. + : + Similar. + +2009-01-05 Joel Sherrill + + * config.bfd: Add lm32-*-rtems*. + +2009-01-03 H.J. Lu + + * coff-ppc.c: Add 2009 to Copyright. + * elf32-cris.c: Likewise. + * elflink.c: Likewise. + +2009-01-03 Hans-Peter Nilsson + + * elf32-cris.c (elf_cris_finish_dynamic_symbol): Rename + gotplt_index to rela_plt_index. Adjust for R_CRIS_DTPMOD entry. + +2009-01-02 H.J. Lu + + PR ld/9679 + * elflink.c (elf_merge_st_other): New. + (_bfd_elf_merge_symbol): Use it on skipped weak definitions and + hide them if needed. + (elf_link_add_object_symbols): Updated. + +2009-01-02 H.J. Lu + + PR ld/9676 + * elflink.c (elf_link_add_object_symbols): Update def_dynamic, + ref_dynamic and dynamic_def fields when setting def_regular + to 1. + +2009-01-02 Curtis Mackie + + PR 9682 + * coff-ppc.c (dump_toc): Fix up calls to fprintf without a string + literal. + +For older changes see ChangeLog-2008 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-2010 sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-2010 --- sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-2010 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-2010 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,3562 @@ +2010-12-31 Robert Millan + + * config.bfd: Recognize mips-freebsd and mips-kfreebsd-gnu. + * configure.host: Likewise. + * configure.in: Support for `bfd_elf32_ntradbigmips_freebsd_vec', + `bfd_elf32_ntradlittlemips_freebsd_vec', + `bfd_elf32_tradbigmips_freebsd_vec', + `bfd_elf32_tradlittlemips_freebsd_vec', + `bfd_elf64_tradbigmips_freebsd_vec' and + `bfd_elf64_tradlittlemips_freebsd_vec'. + * configure: Regenerate. + * elf32-mips.c: New target for FreeBSD support + (same as traditional MIPS but overrides ELF_OSABI + with ELFOSABI_FREEBSD). + * elf64-mips.c: Likewise. + * elfn32-mips.c: Likewise. + * targets.c (_bfd_target_vector): Add + `bfd_elf32_ntradbigmips_freebsd_vec', + `bfd_elf32_ntradlittlemips_freebsd_vec', + `bfd_elf32_tradbigmips_freebsd_vec', + `bfd_elf32_tradlittlemips_freebsd_vec', + `bfd_elf64_tradbigmips_freebsd_vec' and + `bfd_elf64_tradlittlemips_freebsd_vec'. + +2010-12-30 H.J. Lu + + * elfcode.h (NAME(elf,r_info)): New. + (NAME(elf,r_sym)): Likewise. + + * elflink.c (elf64_r_info): Removed. + (elf32_r_info): Likewise. + (elf64_r_sym): Likewise. + (elf32_r_sym): Likewise. + +2010-12-30 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_relocs_compatible): New. + (elf_backend_relocs_compatible): Defined to + elf_x86_64_relocs_compatible. + +2010-12-30 H.J. Lu + + * archures.c (bfd_mach_x64_32): New. + (bfd_mach_x64_32_intel_syntax): Likewise. + * bfd-in2.h: Regenerated. + + * config.bfd (targ64_selvecs): Add bfd_elf32_x86_64_vec for + i[3-7]86-*-linux-*. + (targ_selvecs): Add bfd_elf32_x86_64_vec for x86_64-*-linux-*. + + * configure.in: Support bfd_elf32_x86_64_vec. + * configure: Regenerated. + + * cpu-i386.c (bfd_x64_32_arch_intel_syntax): New. + (bfd_x64_32_arch): Likewise. + + * elf-bfd.h (elf_append_rela): New prototype. + (elf_append_rel): Likewise. + (elf64_r_info): Likewise. + (elf32_r_info): Likewise. + (elf64_r_sym): Likewise. + (elf32_r_sym): Likewise. + + * elf64-x86-64.c (ABI_64_P): New. + (elf_x86_64_info_to_howto): Replace ELF64_R_TYPE with + ELF32_R_TYPE. Replace ELF64_ST_TYPE with ELF_ST_TYPE. + (elf_x86_64_check_tls_transition):Likewise. + (elf_x86_64_check_relocs): Likewise. + (elf_x86_64_gc_mark_hook):Likewise. + (elf_x86_64_gc_sweep_hook): Likewise. + (elf_x86_64_relocate_section): Likewise. + (elf_x86_64_reloc_type_class): Likewise. + (ELF_DYNAMIC_INTERPRETER): Renamed to ... + (ELF64_DYNAMIC_INTERPRETER): This. + (ELF32_DYNAMIC_INTERPRETER): New. + (elf_x86_64_link_hash_table): Add r_info, r_sym, swap_reloca_out, + dynamic_interpreter and dynamic_interpreter_size. + (elf_x86_64_get_local_sym_hash): Replace ELF64_R_SYM with + htab->r_sym. Replace ELF64_R_INFO with htab->r_info. + (elf_x86_64_get_local_sym_hash): Likewise. + (elf_x86_64_check_tls_transition):Likewise. + (elf_x86_64_check_relocs): Likewise. + (elf_x86_64_gc_mark_hook):Likewise. + (elf_x86_64_gc_sweep_hook): Likewise. + (elf_x86_64_relocate_section): Likewise. + (elf_x86_64_finish_dynamic_symbol): Likewise. + (elf_x86_64_finish_local_dynamic_symbol): Likewise. + (elf_x86_64_link_hash_table_create): Initialize r_info, r_sym, + swap_reloca_out, dynamic_interpreter and dynamic_interpreter_size. + (elf_x86_64_check_relocs): Check ABI_64_P when requesting for + PIC. + (elf_x86_64_relocate_section): Likewise. + (elf64_x86_64_adjust_dynamic_symbol): Replace sizeof + (Elf64_External_Rela) with bed->s->sizeof_rela. + (elf64_x86_64_allocate_dynrelocs): Likewise. + (elf64_x86_64_size_dynamic_sections): Likewise. + (elf64_x86_64_finish_dynamic_symbol): Likewise. + (elf64_x86_64_append_rela): Removed. + (elf32_x86_64_elf_object_p): New. + Add bfd_elf32_x86_64_vec. + + * elf64-x86-64.c (elf64_x86_64_xxx): Renamed to ... + (elf_x86_64_xxx): This. + + * elflink.c (bfd_elf_final_link): Check ELF file class on error. + (elf_append_rela): New. + (elf_append_rel): Likewise. + (elf64_r_info): Likewise. + (elf32_r_info): Likewise. + (elf64_r_sym): Likewise. + (elf32_r_sym): Likewise. + + * targets.c (bfd_elf32_x86_64_vec): New. + (_bfd_target_vector): Add bfd_elf32_x86_64_vec. + +2010-12-24 Alan Modra + + * compress.c (decompress_contents): Style. + (bfd_get_full_section_contents): Do not decompress directly into + caller buffer or directly return cached section contents. + Check malloc return for compressed_buffer. + +2010-12-21 Kai Tietz + + * peXXigen.c (_bfd_XXi_final_link_postscript): Use + bfd_get_symbol_leading_char to determine "_tls_used" name. + +2010-12-21 Pierre Muller + + * peXXigen.c (_bfd_XXi_final_link_postscript): Use correct size + for windows 64-bit TLS table size. + +2010-12-16 DJ Delorie + + * reloc.c (BFD_RELOC_RX_ABS16_REV): Add. + (BFD_RELOC_RX_ABS32_REV): Add. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * elf32-rx.c (rx_reloc_map): Add them. + +2010-12-15 H.J. Lu + + * elf.c (_bfd_elf_new_section_hook): Special handling for + .init_array/.fini_array output sections. + +2010-12-13 Alan Modra + + * aoutx.h (aout_link_check_ar_symbols): Formatting. + * cofflink.c (coff_link_check_ar_symbols): Likewise. + * elflink.c (elf_link_add_archive_symbols): Likewise. + * pdp11.c (aout_link_check_ar_symbols): Likewise. + * xcofflink.c (xcoff_link_check_dynamic_ar_symbols, + xcoff_link_check_dynamic_ar_symbols): Likewise. + + * aoutx.h (aout_link_check_archive_element): Simplify code dealing + with add_archive_element substitute BFD. + * cofflink.c (coff_link_check_archive_element): Likewise. + * ecoff.c (ecoff_link_check_archive_element): Likewise. + (ecoff_link_add_archive_symbols): Likewise. + * linker.c (generic_link_check_archive_element): Likewise. + * pdp11.c (aout_link_check_archive_element): Likewise. + * vms-alpha.c (alpha_vms_link_add_archive_symbols): Likewise. + * xcofflink.c (xcoff_link_check_archive_element): Likewise. + + * aoutx.h (aout_link_check_archive_element): Free symbols from old + bfd if !keep_memory. + * cofflink.c (coff_link_check_archive_element): Likewise. + * pdp11.c (aout_link_check_archive_element): Likewise. + * xcofflink.c (xcoff_link_check_archive_element): Likewise. + +2010-12-13 Alan Modra + + * plugin.c (bfd_plugin_mkobject): Delete. + (plugin_vec): Use bfd_false instead. + +2010-12-12 H.J. Lu + + * elflink.c (elf_link_add_archive_symbols): Remove subsbfd. + +2010-12-12 H.J. Lu + + * elf.c (special_sections_g): Add ".gnu.lto_". + +2010-12-10 Alan Modra + + * config.bfd: Configure rs6000-*-aix* as for powerpc-*-aix*. + Add aix5coff64_vec to powerpc ELF entries. + +2010-12-09 Mike Frysinger + + * .gitignore: New file. + +2010-12-06 Dmitry Gorbachev + + PR ld/12288 + * plugin.c (message): Add putchar for the trailing `\n'. + +2010-12-04 Mike Frysinger + + * Makefile.am (!INSTALL_LIBBFD/bfdinclude_HEADERS): Set to nothing. + (PLUGINS/bfdinclude_HEADERS): Append plugin-api.h. + * Makefile.in: Regenerated. + +2010-12-04 Alan Modra + + PR ld/12277 + * elflink.c (elf_link_output_extsym): Set bfd_error on symbol + and section errors. Allow better translation of error messages. + +2010-12-02 Richard Sandiford + + * elf32-arm.c (elf32_arm_link_hash_table): Remove sgot, sgotplt, + srelgot, splt, srelplt. + (create_got_section, elf32_arm_link_hash_table_create): Don't set them. + (elf32_arm_create_dynamic_sections): Likewise. Use htab->root + fields instead. + (arm_type_of_stub): Use the root fields instead of the removed ones. + (cortex_a8_erratum_scan, elf32_arm_size_stubs): Likewise. + (bfd_elf32_arm_process_before_allocation): Likewise. + (elf32_arm_check_relocs, allocate_dynrelocs): Likewise. + (elf32_arm_size_dynamic_sections): Likewise. + (elf32_arm_output_arch_local_syms): Likewise. + (elf32_arm_final_link_relocate): Set sgot, splt and srelgot from the + htab fields instead of looking them up by name. Consistently use + these local variables instead of htab fields. + (elf32_arm_finish_dynamic_symbol): Likewise sgot, splt and srel. + Use srelbss instead of looking it up by name. + (elf32_arm_finish_dynamic_sections): Use sgotplt, splt and srelplt + instead of looking up the symbols by name. Use the root fields + instead of the removed ones. + +2010-12-02 Richard Sandiford + + * elf32-arm.c (elf32_arm_relocs_copied): Delete. + (elf32_arm_link_hash_entry): Replace relocs_copied with dyn_relocs. + (elf32_arm_link_hash_newfunc): Update accordingly. + (elf32_arm_copy_indirect_symbol, elf32_arm_gc_sweep_hook): Likewise. + (elf32_arm_check_relocs, allocate_dynrelocs): Likewise. + (elf32_arm_readonly_dynrelocs): Likewise. + (elf32_arm_size_dynamic_sections): Likewise. + +2010-12-02 Paul Koning + + * pdp11.c (aout_link_add_symbols): Ignore debug symbols. + +2010-11-30 Joel Sherrill + + * config.bfd: Add sparc64-rtems. + +2010-11-25 Alan Modra + + * po/es.po: Update. + * po/fi.po: Update. + * po/fr.po: Update. + * po/ja.po: Update. + * po/zh_CN.po: Update. + +2010-11-24 Joel Brobecker + + * Makefile.am (OPTIONAL_BACKENDS): Add rs6000-core.lo. + (OPTIONAL_BACKENDS_CFILES): Add rs6000-core.c. + * Makefile.in: Regenerate. + +2010-11-24 Alan Modra + + PR ld/12253 + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Correct + DW_EH_PE_datarel handling. Truncate .eh_frame_hdr address to + ptr_size. + +2010-11-23 Mingming Sun + + * elfxx-mips.c (mips_set_isa_flags): Move bfd_mach_loongson_3a + after bfd_mach_mips_sb1. + +2010-11-17 Tristan Gingold + + * vms-lib.c (vms_write_index): Add comments. + Partially revert previous patch. Free blocks later. + +2010-11-17 Nick Clifton + + PR ld/12161 + * elf32-avr.c (elf32_avr_check_relocs): Delete. + (elf_backend_check_relocs): Delete. + +2010-11-16 Jie Zhang + + * elf32-bfin.c (elf32_bfin_code_in_l1): New variable. + (elf32_bfin_data_in_l1): New variable. + (elf32_bfin_final_write_processing): New. + (elf_backend_final_write_processing): Define. + +2010-11-15 Mike Frysinger + + PR binutils/12177 + * elf32-bfin.c (_bfin_create_got_section): Drop unused flags code. + +2010-11-12 H.J. Lu + + * archive.c (_bfd_get_elt_at_filepos): Copy BFD_COMPRESS and + BFD_DECOMPRESS. + (bfd_openr_next_archived_file): Revert the last change. + +2010-11-11 Mingming Sun + + * archures.c (bfd_mach_mips_loongson_3a): Defined. + * bfd-in2.h (bfd_mach_mips_loongson_3a): Defined. + * cpu-mips.c (I_loongson_3a): New add. + (arch_info_struct): Add loongson_3a. + * elfxx-mips.c (_bfd_elf_mips_mach): Add loongson_3a. + (mips_set_isa_flags): Add loongson_3a. + (mips_mach_extensions): Add loongson_3a in MIPS64 extensions. + +2010-11-10 Richard Sandiford + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove unused + variables. + +2010-11-10 Nick Clifton + + * po/ja.po: Updated Japanese translation. + * po/ru.po: Updated Russian translation. + +2010-11-08 Nick Clifton + + * po/ja.po: Updated Japanese translation. + +2010-11-08 Alan Modra + + * hash.c (bfd_hash_hash): Extract from.. + (bfd_hash_lookup): ..here. + (bfd_hash_rename): New function. + * section.c (bfd_rename_section): New function. + * bfd-in.h (bfd_hash_rename): Declare. + * bfd-in2.h: Regenerate. + * elf.c (_bfd_elf_make_section_from_shdr): Rename input sections + when compressing or decompressing. Don't assert name match. + * elf64-hppa.c (get_reloc_section): Don't assert name match. + * elfxx-ia64.c (get_reloc_section): Likewise. + +2010-11-05 Joseph Myers + + * elf32-tic6x.c (elf32_tic6x_obj_attrs_handle_unknown): New. + (elf32_tic6x_merge_attributes): Use + _bfd_elf_merge_unknown_attribute_low and + _bfd_elf_merge_unknown_attribute_list. + (elf_backend_obj_attrs_handle_unknown): Define. + +2010-11-05 Joseph Myers + + * elf-attrs.c (_bfd_elf_merge_unknown_attribute_low, + _bfd_elf_merge_unknown_attribute_list): Correct test for matching + string attributes. + +2010-11-05 Tristan Gingold + + * po/bfd.pot: Regenerate + +2010-11-05 Tristan Gingold + + * configure.in: Bump version to 2.21.51 + * configure: Regenerate. + +2010-11-04 Maciej W. Rozycki + + PR ld/10144 + * elfxx-mips.c (_bfd_mips_elf_check_relocs) + [R_MIPS_32, R_MIPS_REL32, R_MIPS_64]: Ignore relocs from + SEC_DEBUGGING sections. + +2010-11-04 Tristan Gingold + + * vms-lib.c (vms_write_index): Fix thinko: reverse the loop. + Use bfd_zmalloc instead of bfd_malloc. Fix comment. + +2010-11-04 Kai Tietz + + * coffcode.h (GNU_LINKONCE_WT): New. + (sec_to_styp_flags): Add handling of new debug + section. + (styp_to_sec_flags): Likewise. + +2010-11-04 Tristan Gingold + + * makefile.vms (CFLAGS): Make badalias warnings informational. + * vms-lib.c (vms_lib_bread): Avoid arithmetic on void pointer. + +2010-11-04 Joseph Myers + + * elf-attrs.c (_bfd_elf_merge_unknown_attribute_low, + _bfd_elf_merge_unknown_attribute_list): New. + * elf-bfd.h (struct elf_backend_data): Add + obj_attrs_handle_unknown. + (_bfd_elf_merge_unknown_attribute_low, + _bfd_elf_merge_unknown_attribute_list): Declare. + * elf32-arm.c (elf32_arm_obj_attrs_handle_unknown): New. Split + out from elf32_arm_merge_eabi_attributes. + (elf32_arm_merge_eabi_attributes): Use + _bfd_elf_merge_unknown_attribute_low and + _bfd_elf_merge_unknown_attribute_list. + (elf_backend_obj_attrs_handle_unknown): Define. + * elfxx-target.h (elf_backend_obj_attrs_handle_unknown): Define. + (elfNN_bed): Update initializer. + +2010-11-02 H.J. Lu + + * bfd.c (BFD_FLAGS_FOR_BFD_USE_MASK): New. + * bfd-in2.h: Regenerated. + +2010-11-02 Joseph Myers + + * elf32-tic6x.c (elf32_tic6x_obj_attrs_arg_type): Except for + Tag_ABI_compatibility, treat odd tags as strings and even ones as + integers. + (elf32_tic6x_obj_attrs_order, elf32_tic6x_tag_to_array_alignment, + elf32_tic6x_array_alignment_to_tag): New. + (elf32_tic6x_merge_attributes): Handle more attributes. Set type + for merged attributes. + (elf_backend_obj_attrs_order): Define. + +2010-10-29 Maciej W. Rozycki + + * elfxx-mips.c (mips_elf_calculate_relocation): Fix a typo. + +2010-10-29 Pawel Sikora + + PR binutils/12075 + * compress.c (bfd_compress_section_contents): Use uLong on + compressed_size. + +2010-10-29 Joseph Myers + + * elf32-tic6x.c (elf32_tic6x_obj_attrs_arg_type): Check + Tag_ABI_compatibility not Tag_compatibility. + (elf32_tic6x_merge_attributes): Update compatibility attribute + name in comment. Return FALSE if merging common attributes fails. + +2010-10-29 Nick Clifton + + PR bintils/6962 + * coffcode.h (handle_COMDAT): Only check the base type when + looking for a section symbol. + +2010-10-29 H.J. Lu + Cary Coutant + + * archive.c (bfd_openr_next_archived_file): Copy BFD_COMPRESS + and BFD_DECOMPRESS. + + * bfd.c (BFD_COMPRESS): New. + (BFD_DECOMPRESS): Likewise. + (BFD_FLAGS_SAVED): Likewise. + (bfd_preserve_save): Replace BFD_IN_MEMORY with BFD_FLAGS_SAVED. + + * compress.c (bfd_uncompress_section_contents): Removed. + (get_uncompressed_size): New. + (decompress_contents): Likewise. + (bfd_compress_section_contents): Likewise. + (bfd_get_full_section_contents): Likewise. + (bfd_is_section_compressed): Likewise. + (bfd_init_section_decompress_status): Likewise. + (bfd_init_section_compress_status): Likewise. + + * dwarf2.c (dwarf_debug_sections): New. + (dwarf_debug_section_enum): Likewise. + (read_section): Remove section_name and compressed_section_name. + Add dwarf_debug_section_enum. Try compressed debug section. + (read_indirect_string): Updated. + (read_abbrevs): Likewise. + (decode_line_info): Likewise. + (read_debug_ranges): Likewise. + (find_line): Updated. + + * ecoff.c (bfd_debug_section): Add compress_status and + compressed_size. + + * elf.c (_bfd_elf_make_section_from_shdr): Call + bfd_is_section_compressed to check if a DWARF debug section is + compressed. Call bfd_init_section_compress_status or + bfd_init_section_decompress_status if needed. + + * elflink.c (elf_link_input_bfd): Replace bfd_get_section_contents + with bfd_get_full_section_contents. + * merge.c (_bfd_add_merge_section): Likewise. + * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. + * simple.c (bfd_simple_get_relocated_section_contents): Likewise. + + * elfxx-target.h (TARGET_BIG_SYM): Allow BFD_COMPRESS and + BFD_DECOMPRESS. + (TARGET_LITTLE_SYM): Likewise. + + * libbfd-in.h (dwarf_debug_section): New. + (dwarf_debug_sections): Likewise. + + * libbfd.c (_bfd_generic_get_section_contents): Issue an error + when getting contents on compressed/decompressed section. + + * section.c (COMPRESS_SECTION_NONE): New. + (COMPRESS_SECTION_DONE): Likewise. + (DECOMPRESS_SECTION_SIZED): Likewise. + (BFD_FAKE_SECTION): Add compress_status and compressed_size. + (bfd_malloc_and_get_section): Replace bfd_get_section_contents + with bfd_get_full_section_contents. + + * bfd-in2.h: Regenerated. + * libbfd.h: Likewise. + +2010-10-29 Bernd Schmidt + Joseph Myers + + * elf32-tic6x.c (elf32_tic6x_merge_attributes): Check for mismatch + of DSBT attributes. + +2010-10-25 Daniel Jacobowitz + + * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Always call + _bfd_clear_contents. Pass it the input section. + * libbfd-in.h (_bfd_clear_contents): Add input_section argument. + * libbfd.h: Regenerate. + * reloc.c (_bfd_clear_contents): Take input_section argument. + Use non-zero for .debug_ranges. + (bfd_generic_get_relocated_section_conten): Update _bfd_clear_contents + call. + + * elf32-arm.c (elf32_arm_relocate_section): Use + RELOC_AGAINST_DISCARDED_SECTION. + * elf-m10200.c (mn10200_elf_relocate_section): Likewise. + * elf-m10300.c (mn10300_elf_relocate_section): Likewise. + * elf32-arm.c (elf32_arm_relocate_section): Likewise. + * elf32-avr.c (elf32_avr_relocate_section): Likewise. + * elf32-bfin.c (bfin_relocate_section): Likewise. + (bfinfdpic_relocate_section): Likewise. + * elf32-cr16.c (elf32_cr16_relocate_section): Likewise. + * elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-crx.c (elf32_crx_relocate_section): Likewise. + * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. + * elf32-fr30.c (fr30_elf_relocate_section): Likewise. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-h8300.c (elf32_h8_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-i860.c (elf32_i860_relocate_section): Likewise. + * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. + * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise. + * elf32-lm32.c (lm32_elf_relocate_section): Likewise. + * elf32-m32c.c (m32c_elf_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-mep.c (mep_elf_relocate_section): Likewise. + * elf32-moxie.c (moxie_elf_relocate_section): Likewise. + * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. + * elf32-mt.c (mt_elf_relocate_section): Likewise. + * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-rx.c (rx_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise. + * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-spu.c (spu_elf_relocate_section): Likewise. + * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section): Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. + * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section_r): Likewise. + (elf64_alpha_relocate_section): Likewise. + * elf64-hppa.c (elf64_hppa_relocate_section): Likewise. + * elf64-mmix.c (mmix_elf_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise. + +2010-10-25 Nathan Sidwell + + * elf32-tic6x.c: Add attribution. + +2010-10-25 Alan Modra + + * elf32-arm.c (find_stub_size_and_template): Avoid uninitialized + var warning at -O3. + +2010-10-25 Alan Modra + + * opncls.c (bfd_alloc, bfd_zalloc): Don't mark internal. + * libbfd-in.h (bfd_alloc, bfd_zalloc): Don't declare here. + * libbfd.h: Regenerate + * bfd-in2.h: Regenerate. + +2010-10-25 Alan Modra + + * opncls.c (_bfd_id_counter): Rename to bfd_id_counter. + (bfd_reserved_id_counter, bfd_use_reserved_id): New vars. + (_bfd_new_bfd): Use negative id when bfd_use_reserved_id. + (bfd_create): Doc fix. + * bfd-in2.h: Regenerate. + +2010-10-22 Rainer Orth + + * elfxx-sparc.c (tpoff): Define bed, static_tls_size. + Consider static_tls_alignment. + + * elf32-sparc.c (TARGET_BIG_SYM): Redefine to + bfd_elf32_sparc_sol2_vec. + (TARGET_BIG_NAME): Redefine to elf32-sparc-sol2. + (elf32_bed): Redefine to elf32_sparc_sol2_bed. + (elf_backend_static_tls_alignment): Redefine to 8. + Include elf32-target.h. + (elf_backend_static_tls_alignment): Undef again for VxWorks. + + * elf64-sparc.c (TARGET_BIG_SYM): Redefine to + bfd_elf64_sparc_sol2_vec. + (TARGET_BIG_NAME): Redefine to elf64-sparc-sol2. + (ELF_OSABI): Undef. + (elf64_bed): Redefine to elf64_sparc_sol2_bed. + (elf_backend_static_tls_alignment): Redefine to 16. + Include elf64-target.h. + + * config.bfd (sparc-*-solaris2.[0-6]): Split from sparc-*-elf*. + Set targ_defvec to bfd_elf32_sparc_sol2_vec. + [BFD64] (sparc-*-solaris2*): Set targ_defvec to + bfd_elf32_sparc_sol2_vec. + Replace bfd_elf64_sparc_vec by bfd_elf64_sparc_sol2_vec in + targ_selvecs. + + * configure.in: Handle bfd_elf32_sparc_sol2_vec, + bfd_elf64_sparc_sol2_vec. + * configure: Regenerate. + + * targets.c (bfd_elf32_sparc_sol2_vec): Declare. + (bfd_elf64_sparc_sol2_vec): Declare. + (_bfd_target_vector): Add bfd_elf32_sparc_sol2_vec, + bfd_elf64_sparc_sol2_vec. + +2010-10-21 Joseph Myers + + * elf32-tic6x.c (elf32_tic6x_merge_arch_attributes): Update for + attribute renaming. + (elf_backend_obj_attrs_section): Change to ".c6xabi.attributes". + +2010-10-21 Rainer Orth + + * elf-bfd.h (struct elf_backend_data): New member + static_tls_alignment. + * elfxx-target.h (elf_backend_static_tls_alignment): Provide + default. + (elfNN_bed): Initialize static_tls_alignment. + * elflink.c (bfd_elf_final_link): Don't round end of TLS section + if static TLS has special alignment requirements. + * elf32-i386.c (elf_i386_tpoff): Define bed, static_tls_size. + Consider static_tls_alignment. + (elf_backend_static_tls_alignment): Redefine for Solaris 2. + Undef again for VxWorks. + * elf64-x86-64.c (elf64_x86_64_tpoff): Define bed, + static_tls_size. + Consider static_tls_alignment. + (elf_backend_static_tls_alignment): Redefine for Solaris 2. + Undef again for Intel L1OM. + +2010-10-14 Dave Korn + + Apply LD plugin patch series (part 6/6). + * aoutx.h (aout_link_check_ar_symbols): Take new "subsbfd" reference + parameter and pass it when invoking add_archive_element callback. + (aout_link_check_archive_element): Handle substitute bfd if it + was set during add_archive_element callback in the above. + * cofflink.c (coff_link_check_ar_symbols): Take new "subsbfd" reference + parameter and pass it when invoking add_archive_element callback. + (coff_link_check_archive_element): Handle substitute bfd if it + was set during add_archive_element callback in the above. + * ecoff.c (read_ext_syms_and_strs): New function holds symbol-reading + code factored-out from ecoff_link_check_archive_element. + (reread_ext_syms_and_strs): Clear old symbols and call it. + (ecoff_link_check_archive_element): Use the above. Handle substitute + BFD if one is set by add_archive_element callback. + (ecoff_link_add_archive_symbols): Likewise allow bfd substitution. + * elflink.c (elf_link_add_archive_symbols): Likewise. + * linker.c (generic_link_check_archive_element): Likewise. + * pdp11.c (aout_link_check_ar_symbols): Take new "subsbfd" reference + parameter and pass it when invoking add_archive_element callback. + (aout_link_check_archive_element): Handle substitute bfd if it was + set during add_archive_element callback in the above. + * vms-alpha.c (alpha_vms_link_add_archive_symbols): Handle substitute + BFD if one is set by add_archive_element callback. + * xcofflink.c (xcoff_link_check_dynamic_ar_symbols): Take new "subsbfd" + reference parameter and pass it when invoking add_archive_element + callback. + (xcoff_link_check_ar_symbols): Likewise. + (xcoff_link_check_archive_element): Handle bfd substitution if it was + set by callback in the above. + +2010-10-11 Alan Modra + + * elf32-frv.c (elf32_frv_relocate_section): Set "name" for global syms. + (elf32_frvfdpic_finish_dynamic_sections): Don't crash on + __ROFIXUP_END__ defined in shared lib. + +2010-10-11 Thomas Schwinge + + * elf32-arm.c (elf32_arm_final_link_relocate) + (elf32_arm_relocate_section): Handle relocations against STN_UNDEF. + +2010-10-11 Dave Korn + + * elflink.c (_bfd_elf_link_output_relocs): Delete unused variable + "output_rel_hdr". + +2010-10-09 John Tytgat + + * reloc.c (BFD_RELOC_ARM_HVC): Add. + * libbfd.h: Regenerate. + +2010-10-08 Kai Tietz + + * pei-x86_64.c (find_next_xdata_or_end): Removed. + (pex64_dump_xdata): Remove arguments stop, onaline, + and pdata. New argument endx. Print term "none" + instead of misleading "CFA". + (sort_xdata_arr): New function. + (pex64_bfd_print_pdata): Use binary search/sort for unwind-RVAs + instead of searching quadratic. + +2010-10-08 Pierre Muller + Alan Modra + + Fix build with -DDEBUG=7 + * elf.c (_bfd_elf_symbol_from_bfd_symbol): Remove call + to deleted function elf_symbol_flags. Add typecast to avoid warning. + * elf32-rx.c (dump_symbol) : Rename to.. + (rx_dump_symbol): ..this to avoid link errors. + * elflink.c (elf_link_input_bfd): Add typecast to avoid warnings. + (bfd_elf_perform_complex_relocation): Likewise. + * elf32-xtensa.c (print_action_list): Likewise. + +2010-10-06 Nathan Sidwell + + * elf32-arm.c (elf32_arm_stub_long_branch_any_arm_pic, + elf32_arm_stub_long_branch_any_arm_pic): Use a consistent name for + ip/r12. + (arm_type_of_stub): Remove superfluous braces. + +2010-10-04 Bernd Schmidt + + * elf-bfd.h (struct bfd_elf_section_reloc_data): New structure. + (struct bfd_elf_section_data): New members REL and RELA; delete + members REL_HDR, REL_HDR2, REL_COUNT, REL_COUNT2, REL_IDX, + REL_IDX2, REL_HASHES. + (_bfd_elf_init_reloc_shdr): Adjust declaration. + (_bfd_elf_single_rel_hdr): Declare. + (RELOC_AGAINST_DISCARDED_SECTION): Use it. + * elf.c (bfd_section_from_shdr): Adjusted to match changes in + data structures. + (_bfd_elf_init_reloc_shdr): New arg RELDATA. Remove arg REL_HDR. + All callers changed. Allocate memory for the Elf_Internal_Shdr + structure. + (_bfd_elf_single_rel_hdr): New function. + (struct fake_section_arg): New structure. + (elf_fake_section): Expect to see a pointer to it in the third + argument. If doing a relocatable link, allocate both REL and RELA + sections as needed. + (assign_section_numbers): Adjusted to match changes in + data structures. + (_bfd_elf_compute_section_file_positions): Call elf_fake_sections + with a struct fake_section_args argument. + * elfcode.h (elf_write_relocs): Adjusted to match changes in + data structures. + (elf_slurp_reloc_table): Likewise. + * elflink.c (_bfd_elf_link_read_relocs): Likewise. + (_bfd_elf_link_size_reloc_section): Remove arg REL_HDR, replace with + RELDATA. Remove argument O. All callers changed. Remove code to + discover the right rel_hdr and count. + (_bfd_elf_link_output_relocs): Adjusted to match changes in + data structures. + (elf_link_adjust_relocs): Remove args REL_HDR, COUNT and REL_HASH; + replace with RELDATA. All callers changed. + (elf_link_input_bfd): Correctly generate rel_hash data when both + REL and RELA sections are present. + (elf_reloc_link_order): Adjusted to match changes in + data structures. + (bfd_elf_final_link): Simplify code to count relocs. Free the + hashes array for both REL and RELA. + (get_dynamic_reloc_section_name): Use _bfd_elf_single_reloc_hdr + * elf32-m32r.c (m32r_elf_fake_sections, elf_backend_fake_sections): + Delete. + * elf32-tic6x.c (elf32_tic6x_fake_sections, elf_backend_fake_sections): + Delete. + (elf32_tic6x_rel_relocation_p): Adjusted to match changes in + data structures. + * elf32-microblaze.c (microblaze_elf_check_relocs): Use + _bfd_elf_single_rel_hdr. + * elf32-ppc.c (ppc_elf_relax_section): Likewise. + * elf32-spu.c (spu_elf_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-hppa.c (get_reloc_section): Likewise. + * elf64-mips.c (mips_elf64_slurp_reloc_table): Adjusted to match + changes in data structures. + (mips_elf64_write_relocs): Use _bfd_elf_single_rel_hdr. + * elf64-ppc.c (ppc64_elf_edit_opd): Likewise. + (ppc64_elf_edit_toc): Likewise. + (get_relocs): Adjusted to match changes in data structures. + Allocate an Elf_Internal_Shdr structure if necessary. + (ppc64_elf_finish_dynamic_sections): Use _bfd_elf_single_rel_hdr. + * elf64-sparc.c (elf64_sparc_slurp_reloc_table): Adjusted to match + changes in data structures. + * elfxx-ia64.c (get_reloc_section): Use _bfd_elf_single_rel_hdr. + * elfxx-mips.c (MIPS_RELOC_RELA_P): Remove macro. + (mips_elf_rel_relocation_p): Adjusted to match changes in data + structures. + (_bfd_mips_elf_relocate_section): Use mips_elf_rel_relocation_p rather + than MIPS_RELOC_RELOCA_P. + * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Use + _bfd_elf_single_rel_hdr. + (_bfd_sparc_elf_relocate_section): Likewise. + +2010-10-01 Thomas Schwinge + + * elf32-arm.c (elf32_arm_size_stubs): Don't choke on local symbols in + SHN_UNDEF, SHN_ABS, SHN_COMMON. + +2010-09-30 H.J. Lu + + PR ld/11812 + * elf32-i386.c (elf_i386_size_dynamic_sections): Don't + allocate .got.plt section if there are no GOT nor PLT + entries and there is no refeence to _GLOBAL_OFFSET_TABLE_. + * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Li.kewise. + + * elflink.c (_bfd_elf_define_linkage_sym): Clear non_elf. + +2010-09-27 Ralf Wildenhues + + * configure: Regenerate. + +2010-09-24 Thomas Schwinge + + * elf32-arm.c, elf32-cris.c, elf32-hppa.c, elf32-i370.c, elf32-m32r.c, + elf32-m68k.c, elf32-microblaze.c, elf32-ppc.c, elf32-score.c, + elf32-score7.c, elf32-sh.c, elf32-vax.c, elf32-xtensa.c, elf64-alpha.c, + elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-sparc.c, elfcode.h, + elflink.c, elfxx-ia64.c, elfxx-mips.c: Use STN_UNDEF when referring to + the zero symbol index. + + * elflink.c (bfd_elf_reloc_symbol_deleted_p): Compare the symbol index + to STN_UNDEF, not SHN_UNDEF. + +2010-09-23 Bernd Schmidt + + * elf32-tic6x.c (elf32_tic6x_fake_sections): New function. + (elf_backend_fake_sections): Define. + +2010-09-23 Matthew Gretton-Dann + + * bfd-in2.h (BFD_RELOC_ARM_HVC): New enum value. + +2010-09-23 Alan Modra + + * cpu-d10v.c: Make bits_per_address 18 for all arch_info entries. + +2010-09-23 Alan Modra + + * elf.c (_bfd_elf_init_private_section_data): Allow for SEC_RELOC + difference between input and output section. + +2010-09-22 Kai Tietz + + * coffcode.h (sec_to_styp_flags): Adjust debug + sections to be conform to pe-coff specification + and avoid marking them as excluded. + (styp_to_sec_flags): Doing reverse mapping. + + * peXXigen.c (_bfd_XXi_final_link_postscript): Add handling for + setting IAT directory entry. + +2010-09-20 Richard Henderson + + * elf64-alpha.c (elf64_alpha_howto_table): Use bfd_elf_generic_reloc. + +2010-09-19 Richard Sandiford + + * elfxx-mips.c (mips_elf_link_hash_entry): Add got_only_for_calls. + (mips_elf_link_hash_newfunc): Initialize it. + (mips_elf_record_global_got_symbol): Add a for_call parameter. + (mips_elf_count_got_symbols): Check SYMBOL_CALLS_LOCAL rather + than SYMBOL_REFERENCES_LOCAL if the GOT entry is only used for calls. + Try to remove .got entries in favour of .got.plt entries on VxWorks. + (_bfd_mips_elf_check_relocs): Do not try to avoid allocating + a global GOT entry for VxWorks calls. Update uses of + mips_elf_record_global_got_symbol. + (allocate_dynrelocs): Set got_only_for_calls to false if the GOT + entry is used for dynamic relocations. + +2010-09-19 Richard Sandiford + + * elfxx-mips.c (mips_got_entry): Adjust commentary. + (mips_elf_create_local_got_entry): If given a symbol, check that it + has been assigned to the local part of the GOT. + (mips_elf_count_got_symbols): Take the bfd_link_info as argument + instead of the master GOT. Put all locally-binding symbols in + the local area. + (mips_elf_make_got_per_bfd): Use global_got_area to decide whether + a symbol lives in the local or global area. + (mips_elf_local_relocation_p): Remove check_forced argument and + retain only the !check_forced behavior. + (mips_elf_calculate_relocation): Adjust call accordingly. + Use global_got_area to decide whether an output relocation + should be local or global. Explicitly decay R_MIPS_GOT_PAGE + into R_MIPS_GOT_DISP where appropriate. Fix selection of + local vs. global semantics for R_MIPS*_26. Remove redundant + reevaluation of what is stored in was_local_p. + (mips_elf_create_dynamic_relocation): Use global_got_area to decide + whether the relocation should be against a global or local symbol. + (mips_elf_lay_out_got): Update the GOT traversal after the above + change to mips_elf_count_got_symbols. + (mips_elf_adjust_addend): Adjust call to mips_elf_local_relocation_p. + (_bfd_mips_elf_relocate_section): Likewise. + (_bfd_mips_elf_finish_dynamic_symbol): Use global_got_area to decide + whether the symbol has a global got entry. + (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. + +2010-09-19 Richard Sandiford + + * elfxx-mips.c (allocate_dynrelocs): Don't add relocation symbols + to the global GOT on VxWorks. + +2010-09-19 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_check_relocs): On VxWorks, + exclude __GOTT_BASE__ and __GOTT_INDEX__ from the warning + about HI/LO relocations in shared objects. + +2010-09-16 Alan Modra + + * elf32-spu.c (spu_elf_size_sections): Omit fixups for non-alloc + sections. + (spu_elf_create_sections): Mark .fixup with SEC_LINKER_CREATED and + set dynobj. + (spu_elf_finish_dynamic_sections): New function. + (elf_backend_finish_dynamic_sections): Define. + +2010-09-16 Alan Modra + + * elf.c (bfd_elf_get_default_section_type): Don't test SEC_NEVER_LOAD. + * elflink.c (elf_link_input_bfd): Likewise. + +2010-09-15 Kai Tietz + + * pei-x86_64.c (pex64_get_unwind_info): Reorgnized. + (pex64_get_scope_entry): Removed. + (find_next_xdata_or_end): New helper. + (pex64_dump_xdata): Reworked. + (pex64_bfd_print_pdata): Add checking for + valid pdata sorting and values. Reworked + output. + +2010-09-15 H.J. Lu + + PR binutils/12004 + * plugin.c (bfd_plugin_object_p): Handle NULL iostream. + +2010-09-14 Kai Tietz + + * pe-x86_64.c (COFF_SECTION_ALIGNMENT_ENTRIES): Make + .rdata, .data, and .text partial matched section names. + * pei-x86_64.c: Likewise. + + * peXXigen.c (sort_x64_pdata): New helper. + (_bfd_XXi_final_link_postscript): Do pdata sorting. + +2010-09-09 H.J. Lu + + PR ld/11998 + * elf.c (assign_file_positions_for_load_sections): Don't warn + zero LMA adjustment. + +2010-09-09 Bernd Schmidt + + * elflink.c (bfd_elf_final_link): Correct calculation of + max_external_reloc_size. + +2010-09-07 Alan Modra + Marcus Brinkmann + + * peXXigen.c: Whitespace. + (pe_print_idata): Correct section limit calculations. Tidy array + indexing. + (_bfd_XX_print_ce_compressed_pdata): Don't leak memory. + +2010-09-02 Richard Henderson + + * config.bfd (x86_64-*-mingw*): Select 32-bit pei vectors too. + +2010-09-01 Pedro Alves + + * netbsd-core.c (netbsd_core_core_file_pid): Renamed to ... + (netbsd_core_file_pid): ... this. + +2010-09-01 Tristan Gingold + + * coffcode.h (coff_slurp_line_table): Add a cast. + (coff_slurp_reloc_table): Ditto. + +2010-08-30 Gunther Nikl + + * cisco-core.c (cisco_core_file_pid): Define. + +2010-08-30 Alan Modra + + PR binutils/11953 + * elf.c (copy_elf_program_header): Calculate map->header_size + from lowest_section, not first_section. Validate program + header p_paddr against section lma. Find lowest_section in + second loop over headers. + +2010-08-28 Alan Modra + + * elflink.c (_bfd_elf_dynamic_symbol_p): Rename param. Make + common syms local. + (_bfd_elf_symbol_refs_local_p): Expand comment. + (elf_link_output_extsym): Fix style nit. + +2010-08-26 Nathan Sidwell + + * elf32-arm.c (elf32_arm_final_link): Process stub sections + exactly once. + +2010-08-25 H.J. Lu + + PR ld/11939 + * elflink.c (elf_link_add_object_symbols): Don't set + unique_global for non-ELF hash link table. + +2010-08-25 H.J. Lu + + PR ld/11944 + * elf-bfd.h (elf_backend_data): Add target_id. + (bfd_elf_make_generic_object): Renamed to ... + (bfd_elf_make_object): This. + + * elf.c (bfd_elf_make_generic_object): Removed. + (bfd_elf_make_object): New. + (bfd_elf_mkcorefile): Really treat it as an object file. + + * elf-m10300.c (ELF_TARGET_ID): New. + * elf32-arm.c (ELF_TARGET_ID): Likewise. + * elf32-bfin.c (ELF_TARGET_ID): Likewise. + * elf32-cris.c (ELF_TARGET_ID): Likewise. + * elf32-frv.c (ELF_TARGET_ID): Likewise. + * elf32-i386.c (ELF_TARGET_ID): Likewise. + * elf32-lm32.c (ELF_TARGET_ID): Likewise. + * elf32-m32r.c (ELF_TARGET_ID): Likewise. + * elf32-m68hc11.c (ELF_TARGET_ID): Likewise. + * elf32-m68hc12.c (ELF_TARGET_ID): Likewise. + * elf32-m68k.c (ELF_TARGET_ID): Likewise. + * elf32-microblaze.c (ELF_TARGET_ID): Likewise. + * elf32-ppc.c (ELF_TARGET_ID): Likewise. + * elf32-s390.c (ELF_TARGET_ID): Likewise. + * elf32-sh.c (ELF_TARGET_ID): Likewise. + * elf32-sparc.c (ELF_TARGET_ID): Likewise. + * elf32-spu.c (ELF_TARGET_ID): Likewise. + * elf32-tic6x.c (ELF_TARGET_ID): Likewise. + * elf32-xtensa.c (ELF_TARGET_ID): Likewise. + * elf64-alpha.c (ELF_TARGET_ID): Likewise. + * elf64-hppa.c (ELF_TARGET_ID): Likewise. + * elf64-ppc.c (ELF_TARGET_ID): Likewise. + * elf64-s390.c (ELF_TARGET_ID): Likewise. + * elf64-x86-64.c (ELF_TARGET_ID): Likewise. + * elfxx-ia64.c (ELF_TARGET_ID): Likewise. + + * elf32-hppa.c (elf32_hppa_mkobject): Removed. + (bfd_elf32_mkobject): Likewise. + (ELF_TARGET_ID): New. + + * elf32-mips.c (ELF_TARGET_ID): New. + (bfd_elf32_mkobject): Removed. + + * elf64-mips.c (ELF_TARGET_ID): New. + (bfd_elf64_mkobject): Removed. + + * elfn32-mips.c (ELF_TARGET_ID): New. + (bfd_elf32_mkobject): Removed. + + * elfxx-mips.c (_bfd_mips_elf_mkobject): Removed. + * elfxx-mips.h (_bfd_mips_elf_mkobject): Likewise. + + * elfxx-target.h (bfd_elfNN_mkobject): Default to + bfd_elf_make_object. + (ELF_TARGET_ID): New. Default to GENERIC_ELF_DATA. + (elfNN_bed): Initialize target_id. + +2010-08-25 Julian Brown + + * elf32-arm.c (arm_stub_required_alignment): New. + (arm_build_one_stub): Use above to partition stubs. + (make_branch_to_a8_stub): Use arm_stub_a8_veneer_lwm not + arm_stub_a8_veneer_b_cond. + +2010-08-25 Alan Modra + + * aout-arm.c (MY(bfd_reloc_type_lookup)): Use bfd_arch_bits_per_address. + * aout-ns32k.c (MY(bfd_reloc_type_lookup)): Likewise. + * aoutx.h (NAME(aout,reloc_type_lookup)): Likewise. + * coff-arm.c (coff_arm_reloc_type_lookup): Likewise. + * elf-hppa.h (elf_hppa_reloc_final_type): Likewise. + * reloc.c (bfd_default_reloc_type_lookup): Likewise. + * riscix.c (riscix_reloc_type_lookup): Likewise. + +2010-08-25 Alan Modra + + * elf.c (_bfd_elf_map_sections_to_segments): Don't load program + headers if any loaded section wraps the address space. Simplify + ~(m-1) to -m. Use lma rather than vma when determining whether + note sections are adjacent. + +2010-08-22 H.J. Lu + + PR ld/11933 + * elflink.c (elf_link_add_object_symbols): Don't check relocation + if input ELF object ID doesn't match output. + +2010-08-21 Ralf Wildenhues + + * configure: Regenerate. + +2010-08-20 H.J. Lu + + * merge.c (sec_merge_emit): Revert the last checkin. + +2010-08-20 Maciej W. Rozycki + + * elf32-sh.c (sh_elf_relocate_section): Handle non-ELF output + BFD. + +2010-08-20 Maciej W. Rozycki + + * elf32-m68k.c (bfd_elf_m68k_set_target_options): Don't set GOT + options unless an m68k hash table has been found. + +2010-08-20 Nick Clifton + + * merge.c (sec_merge_emit): Do not zero pad sections that do not + have an alignment. + +2010-08-18 Pedro Alves + + PR corefile/8210 + + * bfd-in2.h: Regenerate. + * corefile.c (bfd_core_file_pid): New. + + * targets.c (BFD_JUMP_TABLE_CORE): Add NAME##_core_file_pid. + (struct bfd_target) <_core_file_pid>: New. + + * libbfd-in.h (_bfd_nocore_core_file_pid): Declare. + * libbfd.c (_bfd_nocore_core_file_pid): New. + + * elf-bfd.h (bfd_elf32_core_file_pid, bfd_elf64_core_file_pid): + Declare. + * elfcode.h (elf_core_file_pid): New define. + * elfcore.h (elf_core_file_pid): New function. + + * elf.c (elfcore_make_pid): Rewrite. + (elfcore_grok_prstatus): Only set core_pid if not set yet. + (elfcore_grok_prstatus) [!HAVE_PRSTATUS_T_PR_WHO]: Fallback to + getting the lwpid from prstat.pr_pid. + + * elf64-x86-64.c (elf64_x86_64_grok_prstatus): Write the LWPID to + elf_tdata's core_lwpid instead of to core_pid. + (elf64_x86_64_grok_psinfo): Extract the the main process's PID, + and store it in elf_tdata's core_pid field. + * elf32-i386.c (elf_i386_grok_prstatus): Write the LWPID to + elf_tdata's core_lwpid instead of to core_pid. + (elf_i386_grok_psinfo): Extract the the main process's PID, and + store it in elf_tdata's core_pid field. + + * elf32-am33lin.c (elf32_am33lin_grok_prstatus): Write the LWPID + to elf_tdata's core_lwpid instead of to core_pid. + * elf32-arm.c (elf32_arm_nabi_grok_prstatus): Write the LWPID to + elf_tdata's core_lwpid instead of to core_pid. + * elf32-cris.c (cris_elf_grok_prstatus): Write the LWPID to + elf_tdata's core_lwpid instead of to core_pid. + * elf32-frv.c (elf32_frv_grok_prstatus): Write the LWPID to + elf_tdata's core_lwpid instead of to core_pid. + * elf32-hppa.c (elf32_hppa_grok_prstatus): Write the LWPID to + elf_tdata's core_lwpid instead of to core_pid. + * elf32-mips.c (elf32_mips_grok_prstatus): Write the LWPID to + elf_tdata's core_lwpid instead of to core_pid. + * elf32-ppc.c (ppc_elf_grok_prstatus): Write the LWPID to + elf_tdata's core_lwpid instead of to core_pid. + * elf32-s390.c (elf_s390_grok_prstatus): Write the LWPID to + elf_tdata's core_lwpid instead of to core_pid. + * elf32-score.c (s3_bfd_score_elf_grok_prstatus): Write the LWPID + to elf_tdata's core_lwpid instead of to core_pid. + * elf32-score7.c (s7_bfd_score_elf_grok_prstatus): Write the LWPID + to elf_tdata's core_lwpid instead of to core_pid. + * elf32-sh.c (elf32_shlin_grok_prstatus): Write the LWPID to + elf_tdata's core_lwpid instead of to core_pid. + * elf32-xtensa.c (elf_xtensa_grok_prstatus): Write the LWPID to + elf_tdata's core_lwpid instead of to core_pid. + * elf64-hppa.c (elf64_hppa_grok_prstatus): Write the LWPID to + elf_tdata's core_lwpid instead of to core_pid. + * elf64-mips.c (elf64_mips_grok_prstatus): Write the LWPID to + elf_tdata's core_lwpid instead of to core_pid. + * elf64-ppc.c (ppc64_elf_grok_prstatus): Write the LWPID to + elf_tdata's core_lwpid instead of to core_pid. + * elfn32-mips.c (elf32_mips_grok_prstatus): Write the LWPID to + elf_tdata's core_lwpid instead of to core_pid. + + * plugin.c (bfd_plugin_core_file_pid): New function. + * aout-target.h (MY_core_file_pid): Define. + * aout-tic30.c (MY_core_file_pid, MY_core_file_p): New defines. + * coff-rs6000.c (coff_core_file_pid): New define. + (rs6000coff_vec, pmac_xcoff_vec): Use BFD_JUMP_TABLE_CORE. + * coff64-rs6000.c (coff_core_file_pid): New define. + (rs6000coff64_vec): Use BFD_JUMP_TABLE_CORE. + (xcoff64_core_file_pid): New define. + (aix5coff64_vec): Use BFD_JUMP_TABLE_CORE. + * mach-o-target.c (bfd_mach_o_core_file_pid): New define. + * aix386-core.c (aix386_core_file_pid): New define. + * hppabsd-core.c (hppabsd_core_core_file_pid): New define. + * hpux-core.c (hpux_core_core_file_pid): New define. + * irix-core.c (irix_core_core_file_pid): New define. + * lynx-core.c (lynx_core_file_pid): New define. + * osf-core.c (osf_core_core_file_pid): New define. + * ptrace-core.c (ptrace_unix_core_file_pid): New define. + * sco5-core.c (sco5_core_file_pid): New define. + * xcoff-target.h (coff_core_file_pid): New define. + * netbsd-core.c (netbsd_core_core_file_pid): New define. + +2010-08-13 H.J. Lu + + PR ld/11913 + * elf32-i386.c (elf_i386_finish_dynamic_sections): Check if + .got.plt section is discarded. + * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Likewise. + +2010-08-13 Nathan Sidwell + + * elf32-m69k.c (elf32_m68k_print_private_bfd_data): Detect EMAC_B + variant. + +2010-08-12 H.J. Lu + + PR binutils/11909 + * Makefile.am (coff-tic4x.lo): New. Disable -Werror. + (coff-tic54x.lo): Likewise. + * Makefile.in: Regenerated. + +2010-08-12 Todd Veldhuizen + + PR ld/11843 + * elflink.c (compute_bucket_count): Avoid futile long searches for + the best bucket size. + +2010-08-09 Richard Henderson + + PR ld/11891 + * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Disallow relaxing + to tlshi/lo until pos0 and pos1 are adjacent. Use the destination + register from the tldgd insn. + +2010-08-09 Catherine Moore + + * elfxx-mips.c (mips_elf_perform_relocation): Improve + interlinking error message. + +2010-08-06 Alan Modra + + * elf64-ppc.c (ha_reloc_match): Allow matches to other than r2. + (ppc64_elf_relocate_section): Nop out high part insn of large toc + code sequence when the high part of offset is zero. + +2010-08-04 Tristan Gingold + + * vms-alpha.c (alpha_vms_build_fixups): Write the EICP. + (alpha_vms_bfd_final_link): Explicitly forbid relocatable links. + Clear the SEC_RELOC flag. + +2010-08-04 Tristan Gingold + + * vms-alpha.c (alpha_vms_create_eisd_for_section): Make writable + sections with relocs. + (alpha_vms_add_fixup_lp): Set SEC_RELOC flag. + (alpha_vms_add_fixup_ca): Ditto. + (alpha_vms_add_fixup_qr): Ditto. + Add comments. + +2010-08-04 Tristan Gingold + + * vms-alpha.c (alpha_vms_create_eisd_for_section): Do not make + CODE sections writable. + +2010-08-04 Tristan Gingold + + * vms-alpha.c (alpha_vms_add_lw_fixup): Renamed to ... + (alpha_vms_add_fixup_lr): ... this for consistency. + (alpha_vms_add_qw_fixup): Removed. + Fix some comments. + (vms_get_symbol_info): Adjust type for unknown sections. + +2010-08-04 Tristan Gingold + + * vms-alpha.c (_bfd_vms_slurp_egsd): Use the canonical absolute + section for any absolute section. Remove some debugging code. + +2010-08-03 DJ Delorie + + * elf32-m32c.c (ELF_MAXPAGESIZE): Change page size to 256 bytes. + +2010-08-03 Tristan Gingold + + * vms-misc.c (vms_convert_to_var): Make it static. + (_bfd_vms_convert_to_var_unix_filename): Make it public. + +2010-08-03 Tristan Gingold + + * makefile.vms (OBJS): Update list. + +2010-08-03 Tristan Gingold + + * vms-alpha.c (_bfd_vms_slurp_egsd): Do not set SEC_HAS_CONTENTS + nor SEC_RELOC for empty sections. + +2010-08-03 Tristan Gingold + + * vms-alpha.c (evax_section_flags): Fix flags for absolute + section. Remove useless parenthesis. + +2010-08-03 Tristan Gingold + + * vms-lib.c (vms_lib_bread_raw): Change type of BUF argument. + (vms_lib_bread, vms_lib_bopen): Adjust. + +2010-08-02 Alan Modra + + PR 11866 + * elf.c (assign_file_positions_for_load_sections): Use p_vaddr to + calculate off_adjust rather than first section vma. + +2010-07-30 H.J. Lu + + * elflink.c (compute_bucket_count): Add ATTRIBUTE_UNUSED to info. + +2010-07-30 Anthony Green + + * config.bfd (targ_cpu): Add moxie-*-rtems support. + +2010-07-29 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_toc): Always adjust local syms in + .toc section, even when none are used in relocs. + +2010-07-27 Maciej W. Rozycki + + * elfxx-mips.h: Include "elf/mips.h". + (gprel16_reloc_p): New static inline function. + * elfxx-mips.c (_bfd_mips_elf_check_relocs) + [R_MIPS16_GOT16, R_MIPS_GOT16, R_MIPS_GOT_HI16, R_MIPS_GOT_LO16]: + Use got16_reloc_p. + (_bfd_mips_elf_relocate_section)[bfd_reloc_overflow]: Use + gprel16_reloc_p. + * elf32-mips.c (mips_info_to_howto_rel): Likewise. + * elfn32-mips.c (mips_info_to_howto_rel): Likewise. + +2010-07-27 Maciej W. Rozycki + + * elf64-mips.c (mips_elf64_howto_table_rela) + [R_MIPS_TLS_DTPMOD64]: Clear partial_inplace. + [R_MIPS_TLS_DTPREL64, R_MIPS_TLS_GD, R_MIPS_TLS_LDM]: Likewise. + [R_MIPS_TLS_DTPREL_HI16, R_MIPS_TLS_DTPREL_LO16]: Likewise. + [R_MIPS_TLS_GOTTPREL, R_MIPS_TLS_TPREL64]: Likewise. + [R_MIPS_TLS_TPREL_HI16, R_MIPS_TLS_TPREL_LO16]: Likewise. + * elfn32-mips.c (elf_mips_howto_table_rela) + [R_MIPS_TLS_DTPMOD32]: Likewise. + [R_MIPS_TLS_DTPREL32, R_MIPS_TLS_GD, R_MIPS_TLS_LDM]: Likewise. + [R_MIPS_TLS_DTPREL_HI16, R_MIPS_TLS_DTPREL_LO16]: Likewise. + [R_MIPS_TLS_GOTTPREL, R_MIPS_TLS_TPREL32]: Likewise. + [R_MIPS_TLS_TPREL_HI16, R_MIPS_TLS_TPREL_LO16]: Likewise. + +2010-07-23 Naveen.H.S + Ina Pandit + + * archures.c (DESCRIPTION): Define bfd_mach_v850e2 and + bfd_mach_v850e2v3. + * reloc.c (bfd_architecture): Define bfd_mach_v850e2 and + bfd_mach_v850e2v3. + (BFD_RELOC_V850_16_PCREL, BFD_RELOC_V850_17_PCREL, + BFD_RELOC_V850_22_PCREL, BFD_RELOC_V850_23, + BFD_RELOC_V850_32_PCREL, BFD_RELOC_V850_32_ABS, + BFD_RELOC_V850_16_SPLIT_OFFSET, BFD_RELOC_V850_16_S1, + BFD_RELOC_V850_LO16_SPLIT_OFFSET, BFD_RELOC_V850_SDA_15_16_OFFSET, + BFD_RELOC_V850_ZDA_16_16_OFFSET, BFD_RELOC_V850_CALLT_15_16_OFFSET, + BFD_RELOC_V850_32_GOTPCREL, BFD_RELOC_V850_16_GOT, + BFD_RELOC_V850_32_GOT, BFD_RELOC_V850_22_PLT_PCREL, + BFD_RELOC_V850_32_PLT_PCREL, BFD_RELOC_V850_COPY, + BFD_RELOC_V850_GLOB_DAT, BFD_RELOC_V850_JMP_SLOT, + BFD_RELOC_V850_RELATIVE, BFD_RELOC_V850_16_GOTOFF, + BFD_RELOC_V850_32_GOTOFF, BFD_RELOC_V850_CODE, + BFD_RELOC_V850_DATA): New relocations for V850 target. + * config.bfd: Match all v850 targets. + * cpu-v850.c (arch_info_struct): Define V850e2 and V850e2v3. + * elf32-v850.c (v850_elf_check_relocs): Check the newly added + relocations. + (v850_elf_perform_relocation ): Update the newly added + relocations. + (v850_elf_howto_t): Update the specifications of added + relocations. + (v850_elf_reloc_map): Update the relocation mappings. + (v850_elf_final_link_relocate): Maps added relocation into the + appropriate howto structure. + (v850_elf_object_p): Add support for V850E2 and V850E2V3. + (v850_elf_final_write_processing): Likewise. + (v850_elf_merge_private_bfd_data): Likewise. + (v850_elf_print_private_bfd_data): Likewise. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2010-07-23 Alan Modra + + * archive.c (_bfd_archive_bsd44_construct_extended_name_table): + Correct format specifier. + +2010-07-22 Alan Modra + + * ecoff.c: Don't include aout/ranlib.h. + (_bfd_ecoff_slurp_armap): Use correct struct for ardata->symdefs. + (_bfd_ecoff_write_armap): Output ar_date and ar_size using + _bfd_ar_spacepad. + +2010-07-22 Alan Modra + + * aoutx.h (some_aout_object_p): Don't set EXEC_P for files with + relocs. + +2010-07-20 Alan Modra + + * elf.c (assign_file_positions_for_load_sections): Check that + zero size sections are allocated in segments too. + (assign_file_positions_for_non_load_sections): Warn if zero + size alloc sections are found here. + (copy_elf_program_header): Don't drop zero size sections from + segment map. + (copy_private_bfd_data): Check for changes in zero size sections. + +2010-07-17 Alan Modra + + * elf.c (_bfd_elf_map_sections_to_segments): Force new segment + for sections with overlapping LMAs. + (assign_file_positions_for_load_sections): Catch overlap for + sections that wrap around the address space. Replace a + warning that duplicates ld's --check-sections error with a + warning that lma has been adjusted for overlapping sections. + +2010-07-14 Cary Coutant + + PR ld/11817 + * dwarf2.c (read_section): Revert patch for compressed debug sections. + (find_line): Likewise. + (read_and_uncompress_section): Remove. + +2010-07-13 H.J. Lu + + PR ld/11812 + * elf32-i386.c (elf_i386_size_dynamic_sections): Don't + allocate .got.plt section if there are no GOT nor PLT + entries. + * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Likewise. + +2010-07-13 H.J. Lu + + PR ld/11791 + * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Support + garbage collection against STT_GNU_IFUNC symbols. + + * elf32-i386.c (elf_i386_get_local_sym_hash): Don't set + elf.plt.offset/elf.got.offset to -1. + (elf_i386_tls_transition): Skip TLS transition for functions. + (elf_i386_gc_sweep_hook): Support STT_GNU_IFUNC symbols. + + * elf64-x86-64.c (elf64_x86_64_get_local_sym_hash): Don't set + elf.plt.offset/elf.got.offset to -1. + (elf64_x86_64_tls_transition): Skip TLS transition for functions. + (elf64_x86_64_gc_sweep_hook): Support STT_GNU_IFUNC symbols. + +2010-07-12 H.J. Lu + + * elf32-i386.c (elf_i386_check_relocs): Re-indent. + (elf_i386_relocate_section): Likewise. + +2010-07-06 H.J. Lu + + * dwarf2.c (add_line_info): Initialize prev_line. + +2010-07-06 Alan Modra + + * elf32-ppc.c (ppc_elf_relax_section): Insert branch around + trampolines only for .init and .fini sections. + +2010-07-05 Alan Modra + + * elf32-ppc.c: Formatting. + (ppc_elf_finish_dynamic_sections): Don't make plt_entry var static. + +2010-07-03 Cary Coutant + + * compress.c (bfd_uncompress_section_contents): Add ATTRIBUTE_UNUSED. + * dwarf2.c (read_and_uncompress_section): New function. + (read_section): Call it. + (find_line): Likewise. + +2010-07-01 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_toc): Use SYMBOL_CALLS_LOCAL rather + than SYMBOL_REFERENCES_LOCAL. + (ppc64_elf_relocate_section): Likewise. + +2010-07-01 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_toc): Keep toc entries for ifuncs. + +2010-06-29 Alan Modra + + * cpu-maxq.c: Delete file. + * coff-maxq.c: Delete file. + * Makefile.am: Remove references to maxq. + * archures.c: Likewise. + * coffcode.h: Likewise. + * configure.in: Likewise. + * targets.c: Likewise. + * config.bfd: Move maxq from obsolete to removed. + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + * libbfd.h: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2010-06-28 Alan Modra + + * compress.c (bfd_uncompress_section_contents): Use ATTRIBUTE_UNUSED + to silence gcc warning. + +2010-06-27 Alan Modra + + * elf64-ppc.c (get_tls_mask): Don't segfault on NULL elf_section_data. + (group_sections): Likewise. + +2010-06-27 Alan Modra + + * bout.c (aligncode): Delete set but unused variables. + * coff-mcore.c (coff_mcore_relocate_section): Likewise. + * coff-ppc.c (ppc_record_toc_entry): Likewise. + (coff_ppc_relocate_section): Likewise. + * coff-rs6000.c (xcoff_complain_overflow_bitfield_func): Likewise. + * elf-m10200.c (mn10200_elf_relax_delete_bytes): Likewise. + * elf-m10300.c (mn10300_elf_final_link_relocate): Likewise. + (mn10300_elf_relax_section): Likewise. + * elf32-arm.c (arm_build_one_stub, arm_size_one_stub): Likewise. + (record_vfp11_erratum_veneer): Likewise. + (bfd_elf32_arm_vfp11_erratum_scan): Likewise. + (elf32_arm_final_link_relocate): Likewise. + (elf32_arm_check_relocs, arm_map_one_stub): Likewise. + * elf32-avr.c (elf32_avr_relax_delete_bytes): Likewise. + (elf32_avr_relax_section): Likewise. + (avr_mark_stub_not_to_be_necessary): Likewise. + * elf32-bfin.c (_bfin_create_got_section): Likewise. + * elf32-cr16.c (cr16_elf_final_link_relocate): Likewise. + (elf32_cr16_relax_delete_bytes): Likewise. + * elf32-cr16c.c (cr16c_elf_final_link_relocate): Likewise. + * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise. + * elf32-crx.c (elf32_crx_relax_delete_bytes): Likewise. + * elf32-h8300.c (elf32_h8_relax_section): Likewise. + (elf32_h8_relax_delete_bytes): Likewise. + * elf32-hppa.c (elf32_hppa_check_relocs): Likewise. + * elf32-i370.c (i370_elf_check_relocs): Likewise. + (elf_relocate_section): Likewise. + * elf32-ip2k.c (adjust_all_relocations): Likewise. + (ip2k_elf_relax_section): Likewise. + * elf32-lm32.c (lm32_elf_relocate_section): Likewise. + (lm32_elf_check_relocs): Likewise. + (lm32_elf_finish_dynamic_sections): Likewise. + (lm32_elf_finish_dynamic_symbol): Likewise. + * elf32-m32c.c (m32c_offset_for_reloc): Likewise. + (m32c_elf_relax_delete_bytes): Likewise. + * elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise. + (m32r_elf_finish_dynamic_sections): Likewise. + (m32r_elf_check_relocs, m32r_elf_fake_sections): Likewise. + * elf32-m68hc11.c (m68hc11_elf_relax_section): Likewise. + * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise. + * elf32-microblaze.c (microblaze_elf_relocate_section): Likewise. + (microblaze_elf_check_relocs): Likewise. + (microblaze_elf_finish_dynamic_symbol): Likewise. + * elf32-msp430.c (msp430_elf_relax_delete_bytes): Likewise. + * elf32-ppc.c (ppc_elf_tls_optimize): Likewise. + * elf32-rx.c (rx_elf_relocate_section): Likewise. + (elf32_rx_relax_delete_bytes, rx_offset_for_reloc): Likewise. + (elf32_rx_relax_section): Likewise. + * elf32-score.c (score_elf_got_offset_from_index): Likewise. + (score_elf_final_link_relocate): Likewise. + (s3_bfd_score_elf_relocate_section): Likewise. + * elf32-score7.c (score_elf_got_offset_from_index): Likewise. + (s7_bfd_score_elf_relocate_section): Likewise. + * elf32-sh.c (sh_elf_check_relocs): Likewise. + * elf32-spu.c (spu_elf_relocate_section): Likewise. + * elf32-v850.c (v850_elf_check_relocs): Likewise. + (find_remembered_hi16s_reloc): Likewise. + * elf32-vax.c (elf32_vax_merge_private_bfd_data): Likewise. + (elf_vax_relocate_section): Likewise. + * elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise. + * elf32-xtensa.c (xlate_offset_with_removed_text): Likewise. + (move_literal): Likewise. + * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise. + (elf64_hppa_check_relocs): Likewise. + (elf64_hppa_finish_dynamic_symbol): Likewise. + (elf64_hppa_relocate_section): Likewise. + * elf64-mmix.c (mmix_elf_reloc, mmix_elf_relax_section): Likewise. + * elf64-ppc.c (ppc64_elf_check_relocs): Likewise. + (ppc64_elf_edit_opd, ppc64_elf_edit_toc): Likewise. + * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise. + (elfNN_vms_section_from_shdr): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise. + (_bfd_sparc_elf_relocate_section): Likewise. + * hp300hpux.c (slurp_symbol_table): Likewise. + * i386lynx.c (swap_std_reloc_out, swap_std_reloc_in): Likewise. + * mach-o.c (bfd_mach_o_write_thread): Likewise. + * mmo.c (mmo_scan, mmo_write_symbols_and_terminator): Likewise. + * nlm32-sparc.c (nlm_sparc_read_reloc): Likewise. + * pdp11.c (pdp11_aout_link_input_section): Likewise. + (aout_link_input_section, aout_link_input_bfd): Likewise. + * pe-mips.c (mips_swap_reloc_out): Likewise. + (coff_pe_mips_relocate_section): Likewise. + * som.c (som_bfd_ar_write_symbol_stuff): Likewise. + * vms-alpha.c (_bfd_vms_slurp_egsd): Likewise. + * xsym.c (bfd_sym_fetch_type_information_table_ent): Likewise. + + * coff-i860.c (i860_reloc_processing): Avoid set but unused warning. + * coffcode.h (coff_compute_section_file_positions): Likewise. + (coff_slurp_reloc_table): Likewise. + * cpu-arm.c (arm_check_note): Likewise. + * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Likewise. + * elf32-avr.c (elf32_avr_relocate_section): Likewise. + * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Likewise. + * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. + * elf32-moxie.c (moxie_elf_relocate_section): Likewise. + * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. + * elf32-sh64.c (_bfd_sh_align_load_span): Likewise. + * ieee.c (parse_expression): Likewise. + (ieee_slurp_external_symbols, drop_int): Likewise. + * peXXigen.c (pe_print_pdata): Likewise. + * versados.c (process_esd): Likewise. + +2010-06-25 Tristan Gingold + + * vms-alpha.c (_bfd_vms_write_egsd): Check absolute section with + its flags. Create an absolute section if needed. + +2010-06-25 Tristan Gingold + + * vms-alpha.c (_bfd_vms_write_egsd): Set target_index field of + sections. Mark .vmsdebug section as SEC_DEBUGGING. Do not create + dummy psect anymore. Adjust. + (_bfd_vms_write_eeom): Adjust (use target_index instead of index) + (_bfd_vms_write_etir): Ditto. + (start_etir_or_etbt_record): Test for SEC_DEBUGGING instead of + section name. Adjust. + +2010-06-25 Tristan Gingold + + * vms-alpha.c (alpha_vms_write_exec): Set linktime field. + +2010-06-25 Alan Modra + + * elf64-ppc.c (toc_skip_enum): Define. + (ppc64_elf_edit_toc): Use two low bits of skip array as markers. + Optimize largetoc sequences. + (adjust_toc_syms): Update for skip array change. + (ppc64_elf_relocate_section): Handle R_PPC64_LO_DS_OPT. + +2010-06-25 Alan Modra + + * elf64-ppc.c (is_static_defined): New function. + (get_tls_mask, ppc_type_of_stub): Use it here. + (ppc64_elf_edit_opd): Ensure we only attempt to edit ppc64 input. + (ppc64_elf_tls_setup): Typo fix. + (adjust_toc_syms): Correctly handle symbols defined past the end + of the toc. Move syms on removed entries to next entry rather + than to start of toc. + (ppc64_elf_edit_toc): Likewise. Ensure we only attempt to + edit ppc64 input. Allocate one extra word in skip array. + Honour info->keep_memory when reading relocs if we can. + Adjust toc relocs after adjusting symbols. + +2010-06-23 Nathan Sidwell + + * archive64.c (bfd_elf64_archive_write_armap): Fix buffer overrun + when scaning map. + +2010-06-17 Tristan Gingold + + * Makefile.am (BFD32_BACKENDS_CFILES): Move vms-alpha.c to ... + (BFD64_BACKENDS_CFILES): ... here. + (BFD32_BACKENDS): Move vms-alpha.lo to ... + (BFD64_BACKENDS): ... here. + * Makefile.in: Regenerate. + +2010-06-15 Joseph Myers + + * elf-bfd.h (LEAST_KNOWN_OBJ_ATTRIBUTE): Decrease to 2. + * elf32-tic6x.c (elf32_tic6x_obj_attrs_arg_type, + elf32_tic6x_merge_arch_attributes, elf32_tic6x_merge_attributes, + elf32_tic6x_merge_private_bfd_data): New. + (bfd_elf32_bfd_merge_private_bfd_data, + elf_backend_obj_attrs_arg_type, elf_backend_obj_attrs_section, + elf_backend_obj_attrs_section_type, elf_backend_obj_attrs_vendor): + Define. + * elf32-tic6x.h (elf32_tic6x_merge_arch_attributes): Declare. + +2010-06-15 Joseph Myers + + * elf-bfd.h (LEAST_KNOWN_OBJ_ATTRIBUTE): Define. + (struct elf_backend_data): Update comment on obj_attrs_order. + * elf-attrs.c (vendor_obj_attr_size, vendor_set_obj_attr_contents, + _bfd_elf_copy_obj_attributes): Use LEAST_KNOWN_OBJ_ATTRIBUTE + instead of hardcoded 4. + * elf32-arm.c (elf32_arm_obj_attrs_order): Use + LEAST_KNOWN_OBJ_ATTRIBUTE and LEAST_KNOWN_OBJ_ATTRIBUTE + 1 + instead of hardcoded 4 and 5. + (elf32_arm_merge_eabi_attributes): Use LEAST_KNOWN_OBJ_ATTRIBUTE + instead of hardcoded 4. + +2010-06-14 Kevin Buettner + + * elf32-h8300.c (elf_symbol_leading_char): Define. + +2010-06-11 Jan Kratochvil + + * vms-alpha.c (_bfd_vms_write_egsd): Make sname const. + +2010-06-11 Tristan Gingold + + * vms-alpha.c (_bfd_vms_slurp_egsd): Always set vma of absolute + sections to 0. + +2010-06-11 Tristan Gingold + + * vms-alpha.c (evax_bfd_print_etir): Handle ETIR__C_STO_GBL_LW. + +2010-06-11 Tristan Gingold + + * vms-misc.c (_bfd_vms_output_counted): Make VALUE argument const. + Adjust cast. + (_bfd_vms_output_dump): Make DATA argument const, adjust cast. + * vms.h (_bfd_vms_output_counted, _bfd_vms_output_dump): Adjust. + * vms-alpha.c (evax_section_flags): Make it const. + (vms_secflag_by_name): Remove unused ABFD argument. + Make SECTION_FLAGS and NAME arguments const. Clarify comment. + (vms_esecflag_by_name): Make SECTION_FLAGS and NAME arguments const. + (_bfd_vms_slurp_egsd): Adjust call to vms_secflag_by_name. + (_bfd_vms_write_egsd): Remove useless cast. + +2010-06-10 Tristan Gingold + + * config.bfd: Remove #if/#endif so that som can be compiled on any + host. + * targets.c (_bfd_target_vector): Remove #if/#endif so that som + can be used on any host. + +2010-06-10 Tristan Gingold + + * som.c: Can now be compiled on any host. + Include bfd headers instead of system one. + (som_compute_checksum): Parameter is now a pointer to a + som_external_header structure. Adjust. + (struct section_to_type): Field section is now const. + (R_DLT_REL, R_AUX_UNWIND, R_SEC_STMT): Removed conditional + definition. + (R_LONG_PCREL_MODE, R_N0SEL, R_N1SEL, R_LINETAB): Ditto. + (R_LINETAB_ESC, R_LTP_OVERRIDE, R_COMMENT): Ditto. + (som_swap_clock_in, som_swap_clock_out): New functions. + (som_swap_header_in, som_swap_header_out): Likewise. + (som_swap_space_dictionary_in): Likewise. + (som_swap_space_dictionary_out): Likewise. + (som_swap_subspace_dictionary_in): Likewise. + (som_swap_subspace_dictionary_record_out): Likewise. + (som_swap_aux_id_in, som_swap_aux_id_out): Likewise. + (som_swap_string_auxhdr_out): Likewise. + (som_swap_compilation_unit_out): Likewise. + (som_swap_exec_auxhdr_in): Likewise. + (som_swap_exec_auxhdr_out): Likewise. + (som_swap_lst_header_in): Likewise. + (som_object_setup): Adjust parameter type using bfd types. + (setup_sections): Likewise. Ditto for object file types. + Use intermediate variables for external representation and use the + swap functions to convert. + (som_object_p): Ditto. Remove #ifdef/#endif on always defined + macros. + (som_prep_headers): Likewise. + (som_write_symbol_strings): Likewise. + (som_begin_writing): Likewise. + (som_finish_writing): Likewise. + (som_build_and_write_symbol_table): Likewise. + (bfd_section_from_som_symbol): Likewise. + (som_slurp_symbol_table): Likewise. + (som_bfd_print_private_bfd_data): Likewise. + (bfd_som_attach_aux_hdr): Likewise. Clear the padding. + (bfd_som_attach_compilation_unit): Likewise. + (som_bfd_count_ar_symbols): Likewise. + (som_bfd_fill_in_ar_symbols): Likewise. + (som_slurp_armap): Likewise. + (som_bfd_ar_write_symbol_stuff): Likewise. + (som_write_armap): Likewise. Use _bfd_ar_spacepad instead of + sprintf to write header fields. + * som.h: Include bfd headers instead of system one. + (FILE_HDR_SIZE, AUX_HDR_SIZE): Removed. + (struct somdata): Use bfd structures instead of system ones. + (struct som_section_data_struct): Likewise. + (struct som_subspace_dictionary_record): Removed (now in + include/som/internal.h) + +2010-06-10 Tristan Gingold + + * targets.c (bfd_target_list): Remove hp/ux compiler work-around + as bfd requires an ANSI-C compiler. + +2010-06-09 Tristan Gingold + + * bfdio.c (bfd_bread): Fix the code to prevent reading past the + end of archive members. + +2010-06-08 Tristan Gingold + + * som.c (som_bfd_free_cached_info): Do not free relocations as + they were allocated with bfd_zalloc. + +2010-06-08 Tristan Gingold + + * vms-lib.c (_bfd_vms_lib_write_archive_contents): Increment + for the first block. + +2010-06-08 Tristan Gingold + + * vms-lib.c (_bfd_vms_lib_ia64_mkarchive): New function. + * libbfd-in.h (_bfd_vms_lib_ia64_mkarchive): Declare. + * libbfd.h: Regenerate. + * elfxx-ia64.c (bfd_elfNN_write_archive_contents): Redefine for VMS. + (bfd_elfNN_mkarchive): Ditto. + +2010-06-02 Tristan Gingold + + * vms-alpha.c (alpha_vms_bfd_final_link): Fix 64bit constant. + +2010-06-01 Ralf Wildenhues + + * configure: Regenerate. + +2010-06-01 Tristan Gingold + + * vms-alpha.c (struct vms_private_data_struct): Add + transfer_address field. Remove unused dst_info field. + (alpha_vms_write_exec): Use transfer_address. + (_bfd_vms_write_egsd): Add a comment about LIB$INITIALIZE. + (alpha_vms_bfd_final_link): Set transfer_address. + +2010-05-31 Tristan Gingold + + * vms-lib.c (credat_lo, credat_hi): New fields. + (vms_read_block): Adjust comments. + (vms_write_block): New function. + (_bfd_vms_lib_archive_p): Decode majorid once. Replace some + hard-coded values with constants. Set credat_lo and credat_hi. + (_bfd_vms_lib_mkarchive): Add argument kind. + Set ver, mhd_size and type according to kind. + (_bfd_vms_lib_alpha_mkarchive): New function. + (struct lib_index): Renamed from struct vms_index + (lib_index_cmp): Renamed from vms_index_cmp. Adjusted. + (get_idxlen): Type of idx argument adjusted. Add is_elfidx + argument and handle it. + (vms_write_index): Adjust argument idx. Handle elf indexes. + (_bfd_vms_lib_build_map): Adjust type of arguments modules and res. + (_bfd_vms_lib_write_archive_contents): Add is_elfidx variable and + use it. Handle elf indexes. Set credat. + * libbfd-in.h (_bfd_vms_lib_mkarchive): Renamed to ... + (_bfd_vms_lib_alpha_mkarchive): ... this. + * libbfd.h: Regenerated. + * vms-alpha.c (vms_alpha_vec): Adjust after previous renaming. + +2010-05-28 Sterling Augustine + + * elf32-xtensa.c (elf_xtensa_relocate_section): Add a large amount + of code to change the bits in the instructions to match the changes + in the relocations. Declare dest_addr and sym_sec to help. + +2010-05-28 Jan Kratochvil + + Workaround GCC PR middle-end/4210. + * vms-misc.c (vms_time_t_to_vms_time): Use ternary operator for val[2] + and val[3]. + +2010-05-27 Tristan Gingold + + * vms-misc.c: Define __NEW_STARLET. Remove trailing spaces. + (VMS_TIME_FACTOR, VMS_TIME_OFFSET): New macros. + (vms_time_to_time_t): Use them instead of local const. + (vms_time_t_to_vms_time): New function. + (vms_get_time): Likewise. + (vms_raw_get_time): Likewise. + * vms.h (vms_time_t_to_vms_time): New declaration. + (vms_get_time): Likewise. + (vms_raw_get_time): Likewise. + +2010-05-26 Tristan Gingold + + * vms-alpha.c: Update comments. + (alpha_vms_write_exec): Set lnkflags. Write the GST. + (alpha_vms_link_output_symbol): New function. + (alpha_vms_bfd_final_link): Generate the VMS symbol table. + Set dst_section private field. + (alpha_vms_bfd_final_link): Remove code that set dst_section. + +2010-05-26 Tristan Gingold + + * bfdio.c: Declare and define _bfd_memory_iovec. + (bfd_bread): Move code for BFD_IN_MEMORY... + (bfd_bwrite): ... Ditto ... + (bfd_tell): ... Ditto ... + (bfd_flush): ... Ditto ... + (bfd_stat): ... Ditto ... + (bfd_seek): ... Ditto ... + (bfd_get_size): ... Ditto ... + (bfd_mmap): ... Ditto ... + (memory_bread): ... to these new functions. + (memory_bwrite): Ditto. + (memory_btell): Ditto. + (memory_bseek): Ditto. + (memory_bflush): Ditto. + (memory_bstat): Ditto. + (memory_bmmap): Ditto. + (memory_bclose): New function. + * peicode.h (pe_ILF_build_a_bfd): Use BFD_IN_MEMORY. + * xcofflink.c (bfd_xcoff_link_generate_rtinit): Ditto. + * opncls.c (bfd_close): Do not handle BFD_IN_MEMORY case. + (bfd_make_writable): Use _bfd_memory_iovec. + * elfcode.h (bfd_from_remote_memory): Use _bfd_memory_iovec. + * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Use + _bfd_memory_iovec. + (alpha_ecoff_openr_next_archived_file): Use proxy_origin + instead of origin. + * libbfd.h: Regenerate. + +2010-05-25 Daniel Jacobowitz + Joseph Myers + Andrew Stubbs + + * config.bfd (sh-*-uclinux* | sh[12]-*-uclinux*): Add + bfd_elf32_shl_vec, and FDPIC vectors to targ_selvecs. + * configure.in: Handle FDPIC vectors. + * elf32-sh-relocs.h: Add FDPIC and movi20 relocations. + * elf32-sh.c (DEFAULT_STACK_SIZE): Define. + (SYMBOL_FUNCDESC_LOCAL): Define. Use it instead of + SYMBOL_REFERENCES_LOCAL for function descriptors. + (fdpic_object_p): New. + (sh_reloc_map): Add FDPIC and movi20 relocations. + (sh_elf_info_to_howto, sh_elf_relocate_section): Handle new invalid + range. + (struct elf_sh_plt_info): Add got20 and short_plt. Update all + definitions. + (FDPIC_PLT_ENTRY_SIZE, FDPIC_PLT_LAZY_OFFSET): Define. + (fdpic_sh_plt_entry_be, fdpic_sh_plt_entry_le, fdpic_sh_plts): New. + (FDPIC_SH2A_PLT_ENTRY_SIZE, FDPIC_SH2A_PLT_LAZY_OFFSET): Define. + (fdpic_sh2a_plt_entry_be, fdpic_sh2a_plt_entry_le) + (fdpic_sh2a_short_plt_be, fdpic_sh2a_short_plt_le, fdpic_sh2a_plts): + New. + (get_plt_info): Handle FDPIC. + (MAX_SHORT_PLT): Define. + (get_plt_index, get_plt_offset): Handle short_plt. + (union gotref): New. + (struct elf_sh_link_hash_entry): Add funcdesc, rename tls_type to + got_type and adjust all uses. Add GOT_FUNCDESC. + (struct sh_elf_obj_tdata): Add local_funcdesc. Rename + local_got_tls_type to local_got_type. + (sh_elf_local_got_type): Renamed from sh_elf_local_got_tls_type. All + users changed. + (sh_elf_local_funcdesc): Define. + (struct elf_sh_link_hash_table): Add sfuncdesc, srelfuncdesc, fdpic_p, + and srofixup. + (sh_elf_link_hash_newfunc): Initialize new fields. + (sh_elf_link_hash_table_create): Set fdpic_p. + (sh_elf_omit_section_dynsym): New. + (create_got_section): Create .got.funcdesc, .rela.got.funcdesc + and .rofixup. + (allocate_dynrelocs): Allocate local function descriptors and space + for R_SH_FUNCDESC-related relocations, and for rofixups. + Handle GOT_FUNCDESC. Create fixups. Handle GOT entries which + require function descriptors. + (sh_elf_always_size_sections): Handle PT_GNU_STACK and __stacksize. + (sh_elf_modify_program_headers): New. + (sh_elf_size_dynamic_sections): Allocate function descriptors for + local symbols. Allocate .got.funcdesc contents. Allocate rofixups. + Handle local GOT entries of type GOT_FUNCDESC. Create fixups for + local GOT entries. Ensure that FDPIC libraries always have a PLTGOT + entry in the .dynamic section. + (sh_elf_add_dyn_reloc, sh_elf_got_offset, sh_elf_initialize_funcdesc) + (sh_elf_add_rofixup, sh_elf_osec_to_segment) + (sh_elf_osec_readonly_p, install_movi20_field): New functions. + (sh_elf_relocate_section): Handle new relocations, R_SH_FUNCDESC, + R_SH_GOTFUNCDESC and R_SH_GOTOFFFUNCDESC. Use sh_elf_got_offset + and .got.plt throughout to find _GLOBAL_OFFSET_TABLE_. Add rofixup + read-only section warnings. Handle undefined weak symbols. Generate + fixups for R_SH_DIR32 and GOT entries. Check for cross-segment + relocations and clear EF_SH_PIC. Handle 20-bit relocations. + Always generate R_SH_DIR32 for FDPIC instead of R_SH_RELATIVE. + (sh_elf_gc_sweep_hook): Handle R_SH_FUNCDESC, R_SH_GOTOFF20, + R_SH_GOTFUNCDESC, R_SH_GOTFUNCDESC20, and R_SH_GOTOFFFUNCDESC. + Handle 20-bit relocations. + (sh_elf_copy_indirect_symbol): Copy function descriptor reference + counts. + (sh_elf_check_relocs): Handle new relocations. Make symbols + dynamic for FDPIC relocs. Account for rofixups. Error for FDPIC + symbol mismatches. Allocate a GOT for R_SH_DIR32. Allocate fixups + for R_SH_DIR32. + (sh_elf_copy_private_data): Copy PT_GNU_STACK size. + (sh_elf_merge_private_data): Copy initial flags. Do not clobber + non-mach flags. Set EF_SH_PIC for FDPIC. Reject FDPIC mismatches. + (sh_elf_finish_dynamic_symbol): Do not handle got_funcdesc entries + here. Rename sgot to sgotplt and srel to srelplt. Handle short_plt, + FDPIC descriptors, and got20. Create R_SH_FUNCDESC_VALUE for FDPIC. + Use install_movi20_field. Rename srel to srelgot. Always generate + R_SH_DIR32 for FDPIC instead of R_SH_RELATIVE. + (sh_elf_finish_dynamic_sections): Fill in the GOT pointer in rofixup. + Do not fill in reserved GOT entries for FDPIC. Correct DT_PLTGOT. + Rename sgot to sgotplt. Assert that the right number of rofixups + and dynamic relocations were allocated. + (sh_elf_use_relative_eh_frame, sh_elf_encode_eh_address): New. + (elf_backend_omit_section_dynsym): Use sh_elf_omit_section_dynsym. + (elf_backend_can_make_relative_eh_frame) + (elf_backend_can_make_lsda_relative_eh_frame) + (elf_backend_encode_eh_address): Define. + (TARGET_BIG_SYM, TARGET_BIG_NAME, TARGET_LITTLE_SYM) + (TARGET_LITTLE_NAME, elf_backend_modify_program_headers, elf32_bed): + Redefine for FDPIC vector. + * reloc.c: Add SH FDPIC and movi20 relocations. + * targets.c (_bfd_target_vector): Add FDPIC vectors. + * configure, bfd-in2.h, libbfd.h: Regenerated. + +2010-05-25 Jay Krell + + PR ld/11624 + * archive.c (_bfd_calloc_wrapper): New function. + (_bfd_add_bfd_to_archive_cache): Use it. + + * configure.in: Add alpha*-*-*vms* to list of natives. + * configure: Regenerate. + + * vms-misc.c: Define globalref if necessary. + (vms_convert_to_var_unix_filename): Rename to + _bfd_vms_convert_to_var_unix_filename and export. + * vms.h: Add prototype for _bfd_vms_convert_to_var_unix_filename. + * vms-alpha.c (vms_close_and_cleanup): Update invocation of + vms_convert_to_var_unix_filename. + +2010-05-24 Tristan Gingold + + * vms-alpha.c (add_symbol_entry): New function extrated from ... + (add_symbol): ... adjusted. + +2010-05-24 Tristan Gingold + + * vms-alpha.c (_bfd_vms_slurp_egsd): Fix indentation. + (alpha_vms_write_exec): Add a comment. + (_bfd_vms_write_egsd): Ditto. + (alpha_vms_convert_symbol): Remove a blank line. + +2010-05-21 Tristan Gingold + + * vms-alpha.c (_bfd_vms_slurp_eihs): Do not create a bfd section + for the GST. + +2010-05-21 Tristan Gingold + + * vms-alpha.c (_bfd_vms_slurp_eisd): Set SEC_HAS_CONTENTS and + SEC_LOAD if isect has data. + (vms_get_symbol_info): Refine the condition for 'T' type. + +2010-05-18 Tristan Gingold + + * vms-alpha.c (_bfd_vms_write_emh): New function. + (_bfd_vms_write_lmn): New function. + (_bfd_vms_write_eeom): Moved. + (hash_string): Likewise. + (_bfd_vms_length_hash_symbol): Likewise. + (_bfd_vms_write_ehdr): Code moved to _bfd_vms_write_emh + and _bfd_vms_write_lmn, and call these functions. + +2010-05-18 Tristan Gingold + + * vms-alpha.c (evax_bfd_print_dst): Handle INCR_LINUM_L. + Add details in the messages. + (evax_bfd_print_image): Change message. + +2010-05-18 H.J. Lu + + PR gas/11600 + * elf.c (_bfd_elf_make_section_from_shdr): Handle SHF_EXCLUDE + (elf_fake_sections): Likewise. + + * elf32-i370.c (i370_elf_section_from_shdr): Don't handle + SHF_EXCLUDE here. + * elf32-ppc.c (ppc_elf_fake_sections): Likewise. + +2010-05-17 Tristan Gingold + + * vms-alpha.c: Include esgps.h and eidc.h. + (_bfd_vms_slurp_egsd): Ignore SPSC and IDC sub-records. + (evax_bfd_print_egsd_flags): New function, extracted from ... + (evax_bfd_print_egsd): ..., calls evax_bfd_print_egsd_flags. Handles + EGSD__C_SPSC and EGSD__C_IDC. + +2010-05-14 Tristan Gingold + + * vms-alpha.c (alpha_vms_object_p): Accept header size of 0. + (_bfd_vms_get_object_record): Handle align byte only in the + foreign case. + +2010-05-14 Tristan Gingold + + * vms-lib.c (_bfd_vms_lib_ia64_archive_p): New function. + * libbfd-in.h (_bfd_vms_lib_ia64_archive_p): Add prototype. + * libbfd.h: Regenerate. + * configure.in (havevecs): Define HAVE_all_vecs when + --enable-targets=all is set. Use AC_SUBST on it. + (tdefaults): Do not add havevecs. + (bfd_elf64_ia64_vms_vec): Add vms-lib.lo and vms-misc.lo + * configure: Regenerate. + * Makefile.am (HAVEVECS): New variable. + (INCLUDES): Add HAVEVECS. + * Makefile.in: Regenerate. + * elfxx-ia64.c (INCLUDE_IA64_VMS): New macro, defined if vms + target is selected. Add #ifdef/#endif around vms specific code. + (bfd_elfNN_archive_p, bfd_elfNN_archive_slurp_armap, + bfd_elfNN_archive_slurp_extended_name_table, + bfd_elfNN_archive_construct_extended_name_table, + bfd_elfNN_archive_truncate_arname, + bfd_elfNN_archive_write_armap, + bfd_elfNN_archive_read_ar_hdr, + bfd_elfNN_archive_write_ar_hdr, + bfd_elfNN_archive_openr_next_archived_file, + bfd_elfNN_archive_get_elt_at_index, + bfd_elfNN_archive_generic_stat_arch_elt, + bfd_elfNN_archive_update_armap_timestamp): Define to use vms archives. + +2010-05-11 Jie Zhang + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Merge + Tag_ABI_HardFP_use correctly. + +2010-05-11 Alan Modra + + * coffcode.h (coff_write_object_contents): Enclose all occurrences + of hasdebug and is_reloc_section in #ifdef COFF_IMAGE_WITH_PE. + +2010-05-07 Daniel Jacobowitz + + * elf32-arm.c (struct a8_erratum_reloc): Add hash member. Move + sym_name to improve packing. + (cortex_a8_erratum_scan): Check for PLT entries. + (elf32_arm_size_stubs): Save the target symbol for a8 relocs. + +2010-05-07 Tristan Gingold + + * Makefile.in: Regenerate with automake 1.11.1. + * aclocal.m4: Ditto. + +2010-05-05 Nick Clifton + + * po/es.po: Updated Spanish translation. + +2010-05-03 Tristan Gingold + + * vms-lib.c (vms_lib_bopen): Fix the size threshold to read + selective_search flag. + Add comments. + * vms-alpha.c (alpha_vms_bfd_final_link): Create the DMT section + before output_has_begun is set. + +2010-05-03 Tristan Gingold + + * vms-alpha.c: Add comments. + (struct vms_private_data_struct): Remove image_autoextend field. + (dst_check_allocation): Removed. + (image_write): Remove call to dst_check_allocation. + (vms_slurp_debug): Do not set image_autoextend. Adjust section + size. + (_bfd_vms_slurp_object_records): Remove useless new_type variable. + (alpha_vms_write_exec): Use dst_section to get the dst section. + Write the dmt section. + (evax_bfd_print_image): Also print the dst size in hexa. Fix typo. + (alpha_vms_read_sections_content): Do not set image_autoextend. + (alpha_vms_bfd_final_link): Generate the dst. + +2010-05-03 Tristan Gingold + + * vms-lib.c (_bfd_vms_lib_archive_p): Adjust for a possible empty + next array. + (vms_lib_dcx): Adjust for the above change. + +2010-04-30 H.J. Lu + + PR ld/11542 + * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): New. + + * elf32-i386.c (elf_i386_relocate_section): Use it. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + +2010-04-30 Tristan Gingold + + * vms-lib.c (vms_read_block): New function. + (vms_traverse_index): Use vms_read_block. Handle long key names. + +2010-04-30 Tristan Gingold + + * vms-lib.c (struct lib_tdata): Field artdata added, fields nbr_syms + and syms removed. + (struct carsym_mem): New structure. + (vms_add_index): New function. + (vms_add_indexes_from_list): New function. + (vms_traverse_index): Parameter carsym changed to carsym_mem. + Code adjusted to handle elfidx. + (vms_lib_read_index): Adjusted for vms_traverse_index changes. + Parameter NBREL is now a pointer. + (_bfd_vms_lib_archive_p): Adjust for above change. Handle ia64 + archives. + (_bfd_vms_lib_mkarchive): Adjusted for changes in struct lib_tdata. + (_bfd_vms_lib_find_symbol): Ditto. + (vms_lib_bopen): Fix two typos: return FALSE in case of error, + check MHD id. + (_bfd_vms_lib_get_module): New function. + (_bfd_vms_lib_get_elt_at_index): Rewritten using the above + function. + (_bfd_vms_lib_openr_next_archived_file): Use _bfd_vms_lib_get_module. + (_bfd_vms_lib_generic_stat_arch_elt): Handle ia64 archives. + (vms_write_index): Adjust for structure renamed. + * vms-alpha.c (alpha_vms_link_add_archive_symbols): Adjust for + changes of _bfd_vms_lib_find_symbol. + +2010-04-28 Kai Tietz + + * config.bfd: Correct accidential reverted patch + about vax*-*-*vms*. + +2010-04-27 Kai Tietz + + * pe-x86_64.c (TARGET_UNDERSCORE): Set value dependent + to USE_MINGW64_LEADING_UNDERSCORES. + * pei-x86_64.c (TARGET_UNDERSCORE): Likewise. + * config.bfd: Change underscoring default for x64 mingw + to false. + * coffcode.h (coff_write_relocs): Add check that dereferenced + sym_ptr_ptr isn't NULL. + * config.in (USE_MINGW64_LEADING_UNDERSCORES): New. + * configure: Regenerated. + * configure.in: Add option '--enable-leading-mingw64-underscores' + and define config.in variable USE_MINGW64_LEADING_UNDERSCORES. + +2010-04-27 Nick Clifton + + PR binutils/11512 + * coffgen.c (coff_find_nearest_line): Incldue the section address + of function name symbols in address comparisons. + +2010-04-27 Nick Clifton + + * po/fr.po: Updated French translation. + +2010-04-23 Alan Modra + + * elf.c: Replace use of ELF_IS_SECTION_IN_SEGMENT and + ELF_IS_SECTION_IN_SEGMENT_FILE with ELF_SECTION_IN_SEGMENT + throughout file. + (assign_file_positions_for_load_sections): Modify section in + segment warning to ignore overlay vmas. + * elf32-spu.c (spu_elf_object_p): Replace use of + ELF_IS_SECTION_IN_SEGMENT_MEMORY with ELF_SECTION_IN_SEGMENT. + +2010-04-22 Nick Clifton + + * po/bfd.pot: Updated by the Translation project. + * po/vi.po: Updated Vietnamese translation. + +2010-04-22 Alan Modra + + * elf.c (assign_file_positions_for_load_sections): Revert 2008-05-29 + change. Tidy. Don't error on sections not allocated in segment. + +2010-04-15 Andrew Haley + + * bfd-in.h (elf32_arm_fix_exidx_coverage): Add new flag: + merge_exidx_entries. + * bfd-in2.h: Likewise. + * elf32-arm.c (elf32_arm_fix_exidx_coverage): Likewise. Use it to + control merging of exidx entries. + +2010-04-20 Joseph Myers + + * elf32-tic6x.h: New. + * elf-bfd.h (enum elf_target_id): Define TIC6X_ELF_DATA. + * elf32-tic6x.c (struct elf32_tic6x_obj_tdata, elf32_tic6x_tdata, + elf32_tic6x_howto_table_rel, elf32_tic6x_info_to_howto_rel, + elf32_tic6x_set_use_rela_p, elf32_tic6x_mkobject, + elf32_tic6x_new_section_hook, elf32_tic6x_rel_relocation_p, + bfd_elf32_mkobject, bfd_elf32_new_section_hook): New. + (elf32_tic6x_reloc_type_lookup, elf32_tic6x_reloc_name_lookup, + elf32_tic6x_relocate_section): Handle REL relocations. + (elf_info_to_howto_rel): Define to elf32_tic6x_info_to_howto_rel. + +2010-04-20 Jakub Jelinek + + * dwarf2.c (find_abstract_instance_name, scan_unit_for_symbols): Treat + DW_AT_linkage_name the same as DW_AT_MIPS_linkage_name. + +2010-04-19 Nick Clifton + + * archive64.c (bfd_elf64_archive_slurp_armap): Remove unused + arhdrpos variable. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Add unused + attribute to warned variable. Remove unused val, type and type2 + variables. + +2010-04-16 Andreas Schwab + + * vms-alpha.c (alpha_vms_link_add_object_symbols): Avoid breaking + strict-aliasing rules. + +2010-04-16 Tristan Gingold + + * vms-alpha.c (_bfd_vms_slurp_eihd): Fix typo. + (_bfd_vms_get_object_record): Always assume there is a pad byte + for alignment. + + * vms-lib.c: Add a few comments. + +2010-04-15 Matthew Gretton-Dann + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Support additions to + attributes in v2.08 of the ABI. + +2010-04-15 Alan Modra + + * config.bfd (vax*-*-*vms*): Delete. + +2010-04-14 Tristan Gingold + + * Makefile.am (BFD32_BACKENDS): Remove vms-gsd.lo, vms-hdr.lo, + vms-tir.lo, vms.lo and add vms-alpha.lo + (BFD32_BACKENDS_CFILES): Remove vms-gsd.c, vms-hdr.c, + vms-tir.c, vms.c and add vms-alpha.c + * Makefile.in: Regenerate. + * configure.in (TDEFINES): Adjust file list for vms_alpha_vec. + Remove vms_vax_vec. + * configure: Regenerate. + * targets.c (vms_vax_vec): Remove the declaration. + (_bfd_target_vector): Remove vms_vax_vec. + * vms-alpha.c: New file. + * vms-gsd.c: Removed, rewritten in vms-alpha.c + * vms-hdr.c: Ditto. + * vms-tir.c: Ditto. + * vms.c: Ditto. + * vms-misc.c: Fix indentation and comments. Replace most of + #if VMS_DEBUG/vms_debug with vms_debug2. + (_bfd_vms_hash_newfunc): Moved to vms-alpha.c + (hash_string): Ditto. + (_bfd_vms_length_hash_symbol): Ditto. + (maybe_adjust_record_pointer_for_object): Ditto. + (_bfd_vms_get_object_record): Ditto. + (vms_get_remaining_object_record): Ditto. + (_bfd_vms_push): Ditto. + (_bfd_vms_pop): Ditto. + (_bfd_vms_get_header_values): Removed. + (_bfd_vms_get_first_record): Removed. + (vms_get_remaining_image_record): Removed. + (new_symbol): Removed. + (_bfd_vms_enter_symbol): Removed. + (_bfd_vms_save_sized_string): Use memcpy instead of strncpy. + (_bfd_vms_output_begin): Remove rechead parameter. Replace bfd + parameter with struct vms_rec_wr. + (_bfd_vms_output_push): Removed and replaced by ... + (_bfd_vms_output_begin_subrec): ... new function. + (_bfd_vms_output_alignment): Replace bfd parameter with + struct vms_rec_wr, and adjust. + (_bfd_vms_output_check): Ditto + (_bfd_vms_output_byte): Ditto. + (_bfd_vms_output_short): Ditto. + (_bfd_vms_output_long): Ditto. + (_bfd_vms_output_quad): Ditto. + (_bfd_vms_output_counted): Ditto. + (_bfd_vms_output_dump): Ditto. + (_bfd_vms_output_fill): Ditto. + (_bfd_vms_output_pop): Removed and replaced by ... + (_bfd_vms_output_end_subrec): ... new function. + (_bfd_vms_output_flush): Removed. + (_bfd_vms_output_align): New function. + (_bfd_vms_output_end): Add recwr parameter. Adjust for this new + parameter. + (vms_convert_to_var): New function imported from vms.c + (vms_convert_to_var_1): Ditto. + (vms_convert_to_var_unix_filename): Ditto. + (vms_get_module_name): Ditto. + (get_vms_time_string): Ditto. + (vms_time_to_time_t): Ditto. + (vms_rawtime_to_time_t): Ditto. + * vms.h: All macros for the VMS file format are now in include/vms. + Prototypes for vms.c, vms-gsd.c, vms-misc.c, vms-hdr.c, vms-tir.c + have been removed. + (struct vms_symbol_struct, struct stack_struct): Moved to vms-alpha.c + (struct fileinfo, struct srecinfo, struct lineinfo): Ditto. + (struct funcinfo, struct vms_private_data_struct): Ditto. + (struct vms_section_data_struct): Ditto. + (struct vms_rec_rd, stryct vms_rec_wr): New declarations. + (vms_get_module_name, get_vms_time_string): New declarations. + (vms_time_to_time_t, vms_rawtime_to_time_t): Ditto. + (_bfd_vms_output_begin_subrec, _bfd_vms_output_end_subrec): Ditto. + (_bfd_vms_save_sized_string, _bfd_vms_save_counted_string): Adjusted. + (_bfd_vms_output_begin, _bfd_vms_output_alignment): Ditto. + (_bfd_vms_output_end,_bfd_vms_output_check): Ditto. + (_bfd_vms_output_byte, _bfd_vms_output_short): Ditto. + (_bfd_vms_output_long, _bfd_vms_output_quad): Ditto. + (_bfd_vms_output_counted, _bfd_vms_output_dump): Ditto. + (_bfd_vms_output_fill): Ditto. + (bfd_vms_set_section_flags): Ditto. + +2010-04-14 Matthew Gretton-Dann + + * elflink.c (_bfd_elf_merge_symbol): Tighten up the test for early + exit due to merging the same weak symbol to test that the symbols are + actually weak. + +2010-04-13 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Correct NOP location + when optimizing high got_tlsgd/ld insns. + +2010-04-10 H.J. Lu + + * hosts/x86-64linux.h (HAVE_PRPSINFO32_T): Undefine before + define. + (HAVE_PRSTATUS32_T): Likewise. + +2010-04-10 H.J. Lu + + PR corefiles/11467 + * configure.in (CORE_HEADER): New. Set to hosts/x86-64linux.h + for x86_64-*-linux*. + * config.in: Regenerated. + * configure: Likewise. + + * elf.c: Include CORE_HEADER if it is defined. + +2010-04-10 H.J. Lu + Jan Kratochvil + + * hosts/x86-64linux.h: New. + +2010-04-09 Nick Clifton + + * aoutx.h (aout_link_input_bfd): Remove unused variable sym_count. + * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Remove unused + variables htab and hdr_info and mark info parameter as unused. + * elf.c (prep_headers): Remove unused variable i_phdrp. + (_bfd_elf_write_object_contents): Remove unused variable i_ehdrp. + * elf32-i386.c (elf_i386_relocate_section): Mark variabled warned + as unused. + * peXXigen.c (pe_print_reloc): Remove unused variable datasize. + * verilog.c (verilog_write_section): Remove unused variable + address. + +2010-04-07 Alan Modra + + * warning.m4 (GCC_WARN_CFLAGS): Only add -Wshadow for gcc-4 and above. + * configure: Regenerate. + +2010-04-06 H.J. Lu + + PR ld/11434 + * elf-bfd.h (SYMBOLIC_BIND): Don't bind unique symbol locally. + +2010-04-06 Tristan Gingold + + * vms-lib.c (_bfd_vms_lib_write_archive_contents): Fix idd flags. + +2010-04-05 Jakub Jelinek + + * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Handle CIE version 4 + provided that it has the expected address size and zero segment + length. + + * dwarf2.c (struct line_head): Add maximum_ops_per_insn field. + (struct line_info): Add op_index field, change end_sequence type to + unsigned char. + (new_line_sorts_after): For the same address compare op_index. + (add_line_info): Add op_index argument, store it into the structure. + (decode_line_info): Complain about unknown versions of .debug_line. + Initialize maximum_ops_per_insn. Add op_index state register and + track it. + +2010-04-01 Nathan Sidwell + + * elf32-ppc.c (apuinfo_set): New static var. + (ppc_elf_begin_write_processing): Set it here, always create an + APUinfo section if there were any in the inputs. + (ppc_elf_write_section): Check apuinfo_set. + (ppc_elf_final_write_processing): Likewise. + +2010-04-01 Tristan Gingold + + * vms.h: Include time.h. Add prototypes for vms_get_module_name, + vms_time_to_time_t and vms_rawtime_to_time_t. + * vms.c (vms_alpha_vec): Add archives support. + * vms-misc.c: Include safe-ctype.h + (vms_get_module_name): New function. + (vms_time_to_time_t, vms_rawtime_to_time_t): Ditto. + * vms-hdr.c (_bfd_vms_write_hdr): Put module name creation to the + vms_get_module_name function. Use this function. + * targets.c: Declare vms_lib_txt_vec. Add it to _bfd_target_vector. + * libbfd-in.h: Add prototype for _bfd_append_relative_path. + Add prototypes for vms-lib.c + * libbfd.h: Regenerate. + * configure.in (TDEFINES): Add an entry for vms_lib_txt_vec. Add + vms-lib.lo to vms_alpha_vec. + * config.bfd (targ_cpu): Add targ_selvecs for alpha*-*-*vms*. + * configure: Regenerate. + * bfd.c: Add selective_search field. + * bfd-in2.h: Regenerate. + * archive.c (append_relative_path): Rename to + _bfd_append_relative_path and make it public. + (_bfd_get_elt_at_filepos): Adjust for above renaming. + * Makefile.am (BFD32_BACKENDS): Add vms-lib.lo + (BFD32_BACKENDS_CFILES): Add vms-lib.c + * Makefile.in: Regenerate. + +2010-04-01 Jakub Jelinek + + * dwarf2.c (read_attribute_value): Handle CU version 4 + for DW_FORM_ref_addr, handle DW_FORM_sec_offset, DW_FORM_exprloc + and DW_FORM_flag_present. For unknown form value return NULL. + (scan_unit_for_symbols): For DW_AT_location handle DW_FORM_exprloc + like DW_FORM_block. + (parse_comp_unit): Allow CU version 4. + +2010-04-01 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section): Correct first argument + to _bfd_elf_get_dynamic_reloc_section. + (elf_cris_discard_excess_dso_dynamics): Ditto. + +2010-03-31 Kai Tietz + + * coff-i386.c (in_reloc_p): Check also for R_SECREL32. + * coff-x86_64.c (in_reloc_p): Check also for R_AMD64_SECREL. + +2010-03-31 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Nop out optimized + TPREL16_HI and TPREL16_HA insns. + +2010-03-31 Hans-Peter Nilsson + + PR ld/11458 + * elf32-cris.c (elf_cris_copy_indirect_symbol): Remove invalid + assert of empty pcrel_relocs_copied on the direct symbol. Instead + of moving the list from the indirect symbol to the direct symbol, + merge into any existing list. + (cris_elf_check_relocs): Store the original section in the + pcrel_relocs_copied list, not the relocation section. + (elf_cris_discard_excess_dso_dynamics): Adjust accordingly to find + the relocation section, for reducing its size. Change the + BFD_ASSERT into a check for the section being read-only, and only + emit warnings and TEXTREL marker when there's an entry for a + read-only section. + +2010-03-29 Daniel Jacobowitz + + * elf32-arm.c (using_thumb_only): Handle v6-M. + +2010-03-26 Alan Modra + + * elf32-ppc.c (ppc_elf_howto_raw ): Not pc-relative. + * bfd-in.h (elf_discarded_section): Clarify comment. + * reloc.c (struct reloc_howto_struct ): Likewise. + * bfd-in2.h: Regenerate. + +2010-03-26 Matt Rice + + * archive.c (_bfd_compute_and_write_armap): Allow symbols flagged + as unique in the armap. + +2010-03-26 Alan Modra + + PR ld/11375 + * elf64-ppc.c (ppc64_elf_relocate_section): Always look up a + possible stub on branches. + +2010-03-25 Joseph Myers + + * Makefile.am (ALL_MACHINES): Add cpu-tic6x.lo. + (ALL_MACHINES_CFILES): Add cpu-tic6x.c. + (BFD32_BACKENDS): Add elf32-tic6x.lo. + (BFD32_BACKENDS_CFILES): Add elf32-tic6x.c. + * Makefile.in: Regenerate. + * archures.c (bfd_arch_tic6x, bfd_tic6x_arch): New. + (bfd_archures_list): Update. + * config.bfd (tic6x-*-elf): New. + * configure.in (bfd_elf32_tic6x_be_vec, bfd_elf32_tic6x_le_vec): + New. + * configure: Regenerate. + * cpu-tic6x.c, elf32-tic6x.c: New. + * reloc.c (BFD_RELOC_C6000_PCR_S21, BFD_RELOC_C6000_PCR_S12, + BFD_RELOC_C6000_PCR_S10, BFD_RELOC_C6000_PCR_S7, + BFD_RELOC_C6000_ABS_S16, BFD_RELOC_C6000_ABS_L16, + BFD_RELOC_C6000_ABS_H16, BFD_RELOC_C6000_SBR_U15_B, + BFD_RELOC_C6000_SBR_U15_H, BFD_RELOC_C6000_SBR_U15_W, + BFD_RELOC_C6000_SBR_S16, BFD_RELOC_C6000_SBR_L16_B, + BFD_RELOC_C6000_SBR_L16_H, BFD_RELOC_C6000_SBR_L16_W, + BFD_RELOC_C6000_SBR_H16_B, BFD_RELOC_C6000_SBR_H16_H, + BFD_RELOC_C6000_SBR_H16_W, BFD_RELOC_C6000_SBR_GOT_U15_W, + BFD_RELOC_C6000_SBR_GOT_L16_W, BFD_RELOC_C6000_SBR_GOT_H16_W, + BFD_RELOC_C6000_DSBT_INDEX, BFD_RELOC_C6000_PREL31, + BFD_RELOC_C6000_COPY, BFD_RELOC_C6000_ALIGN, + BFD_RELOC_C6000_FPHEAD, BFD_RELOC_C6000_NOCMP): New. + * targets.c (bfd_elf32_tic6x_be_vec, bfd_elf32_tic6x_le_vec): New. + (_bfd_target_vector): Update. + * bfd-in2.h, libbfd.h: Regenerate. + +2010-03-24 H.J. Lu + + * aout-target.h: Update copyright year. + * aout-tic30.c: Likewise. + * coff-alpha.c: Likewise. + * coff-rs6000.c: Likewise. + * coff64-rs6000.c: Likewise. + * elf64-mips.c: Likewise. + * ieee.c: Likewise. + * libecoff.h: Likewise. + * mach-o-target.c: Likewise. + * mach-o.c: Likewise. + * oasys.c: Likewise. + * targets.c: Likewise. + +2010-03-24 H.J. Lu + + * libbfd-in.h: Update copyright year. + +2010-03-21 H.J. Lu + + PR ld/11413 + * elflink.c (_bfd_elf_add_default_symbol): Check !executable + instead of shared. + +2010-03-19 Jie Zhang + + * elf32-arm.c (struct section_list): Remove. + (section_list): Remove typedef. + (record_section_with_arm_elf_section_data): Remove. + (find_arm_elf_section_entry): Remove. + (get_arm_elf_section_data): Use is_arm_elf. + (unrecord_section_with_arm_elf_section_data): Remove. + (elf32_arm_new_section_hook): Don't call + record_section_with_arm_elf_section_data. + (elf32_arm_write_section): Set mapcount to -1 when + the map has been used. Don't call + unrecord_section_with_arm_elf_section_data. + (unrecord_section_via_map_over_sections): Remove. + (elf32_arm_close_and_cleanup): Remove. + (elf32_arm_bfd_free_cached_info): Remove. + (bfd_elf32_close_and_cleanup): Don't define. + (bfd_elf32_bfd_free_cached_info): Don't define. + +2010-03-18 H.J. Lu + + PR binutils/11396 + * libcoff-in.h (pe_tdata): Add dont_strip_reloc. + * libcoff.h: Regenerated. + + * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Clear F_RELFLG + if dont_strip_reloc is set. + (_bfd_XX_bfd_copy_private_bfd_data_common): Set + dont_strip_reloc on output if there is no .reloc and + IMAGE_FILE_RELOCS_STRIPPED isn't set in input. + +2010-03-18 Wei Guozhi + + PR gas/11323 + * elf32-arm.c (elf32_arm_reloc_map): Map BFD_RELOC_ARM_GOT_PREL to + R_ARM_GOT_PREL. + * reloc.c (BFD_RELOC_ARM_GOT_PREL): New ARM relocation. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2010-03-17 H.J. Lu + + * reloc.c (BFD_RELOC_SPU_PIC18): Removed. + (BFD_RELOC_SPU_STUB): Likewise. + +2010-03-17 Jie Zhang + + * elf.c (assign_file_positions_for_load_sections): Avoid + overflow. + +2010-03-17 Alan Modra + + PR binutils/11382 + * plugin.c (bfd_plugin_object_p): Pass iostream to fileno using + proper type. + +2010-03-17 Alan Modra + + * elf32-arm.c (cortex_a8_erratum_scan): Warning fix. + +2010-03-16 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_table): Add do_toc_opt. + (ppc64_elf_edit_toc): Set it here. + (ha_reloc_match): New function. + (ppc64_elf_relocate_section): Optimize bigtoc insn sequences. + +2010-03-15 Alan Modra + + * elf64-ppc.c (ppc64_elf_has_small_toc_reloc): New function. + * elf64-ppc.h (ppc64_elf_has_small_toc_reloc): Declare. + +2010-03-14 Alan Modra + + PR ld/11378 + * elf64-ppc.h (ppc64_elf_check_init_fini): Declare. + * elf64-ppc.c (call_check_done): Define. + (ppc64_elf_add_symbol_hook): Substitute bfd_get_section_name macro. + (ppc64_elf_check_relocs, ppc64_elf_size_dynamic_sections): Likewise. + (ppc64_elf_finish_multitoc_partition): Remove unnecessary check. + (toc_adjusting_stub_needed): Use call_check_done rather than toc_off. + Simplify return logic. Iterate over all .init and .fini fragments + by recursion. Set makes_toc_func_call here.. + (ppc64_elf_next_input_section): ..rather than here. + (check_pasted_section, ppc64_elf_check_init_fini): New functions. + +2010-03-13 Alan Modra + + PR ld/11375 + * elf64-ppc.c (ppc_type_of_stub): Always set *hash to the + function descriptor symbol if there is one, not just for plt stubs. + (ppc64_elf_relocate_section): Use fdh on all ppc_get_stub_entry calls. + +2010-03-05 Rainer Orth + + * elflink.c (bfd_elf_size_dynamic_sections): Don't emit base + version twice. + Skip it when constructing def.vd_next. + + * elf32-i386.c (TARGET_LITTLE_SYM): Redefine to + bfd_elf32_i386_sol2_vec. + (TARGET_LITTLE_NAME): Redefine to elf32-i386-sol2. + (elf32_bed): Redefine to elf32_i386_sol2_bed. + (elf_backend_want_plt_sym): Redefine to 1. + + * elf64-x86-64.c (TARGET_LITTLE_SYM): Redefine to + bfd_elf64_x86_64_sol2_vec. + (TARGET_LITTLE_NAME): Redefine to elf64-x86-64-sol2. + (elf64_bed): Redefine to elf64_x86_64_sol2_bed. + (elf_backend_want_plt_sym): Redefine to 1. + + * config.bfd (i[3-7]86-*-solaris2*): Set targ_defvec to + bfd_elf32_i386_sol2_vec. + Replace bfd_elf64_x86_64_vec by bfd_elf64_x86_64_sol2_vec in + targ64_selvecs. + (x86_64-*-solaris2*): Set targ_defvec to bfd_elf32_i386_sol2_vec. + Replace bfd_elf64_x86_64_vec by bfd_elf64_x86_64_sol2_vec in + targ_selvecs. + + * configure.in: Handle bfd_elf32_i386_sol2_vec, + bfd_elf64_x86_64_sol2_vec. + * configure: Regenerate. + + * targets.c (bfd_elf32_i386_sol2_vec): Declare. + (bfd_elf64_x86_64_sol2_vec): Declare. + (_bfd_target_vector): Add bfd_elf32_i386_sol2_vec, + bfd_elf64_x86_64_sol2_vec. + +2010-03-04 Daniel Jacobowitz + + * elf32-arm.c (elf32_arm_output_arch_local_syms): Skip non-program + sections. + +2010-03-04 Alan Modra + + PR 11302 + * dwarf2.c (read_abbrevs): Return NULL on alloc failures. + (read_attribute_value, decode_line_info): Likewise. + (add_line_info, read_rangelist): Return FALSE on alloc failures. + (arange_add, sort_line_sequences): Likewise. + (find_abstract_instance_name): Handle failures from called funcs. + (scan_unit_for_symbols, parse_comp_unit, decode_line_info): Likewise. + (find_line): Realloc to a temp, and handle alloc fail. + +2010-03-03 Daniel Jacobowitz + + * elf32-arm.c (elf32_arm_output_arch_local_syms): Do not add + a mapping symbol to an empty section. + +2010-03-02 Matthew Gretton-Dann + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Add a check of the + return value from the call to _bfd_elf_merge_object_attributes. + +2010-03-02 Christophe Lyon + Alan Modra + + * elf32-arm.c (a8_erratum_fix): Add st_type field to record the + destination mode of the a8 stub. + (elf32_arm_link_hash_table): Add top_id field. + (elf32_arm_link_hash_table_create): Initialize top_id. + (arm_type_of_stub): Update prototype, st_type can now be updated + by this function. Actual destination address in case of PLT is + computed here, to help factorizing code. + (elf32_arm_stub_name): Update prototype, use stub_type additional + parameter to build stub name. + (elf32_arm_get_stub_entry): Update prototype, use stub_type + additional parameter to build stub entry. + (arm_build_one_stub): Use bfd_put_16/bfd_put_32 instead of + put_thumb_insn/put_arm_insn as BE8 encoding is now handled later. + Call elf32_arm_final_link_relocate to process all in-stub + relocations. + (elf32_arm_setup_section_lists): Update top_id. + (cortex_a8_erratum_scan): Record stub destination mode. + (elf32_arm_size_stubs): Update call to arm_type_of_stub according + to new prototype. + (elf32_arm_final_link_relocate): Enable processing of in-stub + REL32 relocations. Rely on arm_type_of_stub to detect if a stub is + needed, enabling code factorization. + (elf32_arm_final_link): Process stub sections. + (elf32_arm_output_map_sym): Add entry to code/data map. + +2010-03-01 David S. Miller + + * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): When STT_GNU_IFUNC and + h->def_regular, set h->ref_regular. + (allocate_dynrelocs): Only force output of STT_GNU_IFUNC plt entries + and dynamic relocations if h->ref_regular. + + * elfxx-sparc.c (struct elf_reloc_map): Delete. + (sparc_reloc_map): Delete. + (_bfd_sparc_elf_reloc_type_lookup): Explicitly handle each + relocation type in switch statements. + +2010-02-25 Alan Modra + + PR ld/11304 + * elf.c (_bfd_elf_init_private_section_data): Rename need_group + to final_link and invert. For final link allow some flags to + differ. Don't specially allow flags to be all zero. + +2010-02-24 Alan Modra + + PR binutils/10858 + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Ise + SYMBOL_REFERENCES_LOCAL to exclude entries from the dynamic symbol + table. + +2010-02-23 Andrew Zabolotny + + PR binutils/11297 + * elf32-avr.c (elf_avr_howto_table): Add R_AVR_8. + (avr_reloc_map): Map BFD_RELOC_8 to R_AVR_8. + +2010-02-22 Alan Modra + + * reloc.c (bfd_check_overflow): When forming addrmask, shift + fieldmask left by rightshift. + (_bfd_relocate_contents): Likewise. Use rightshift addrmask in all + overflow checks. + +2010-02-20 H.J. Lu + + * elf64-x86-64.c (elf64_x86_64_add_symbol_hook): Don't check + STT_GNU_IFUNC on large common symbol. + +2010-02-18 H.J. Lu + + * elf32-i386.c (elf_i386_add_symbol_hook): Don't set + has_ifunc_symbols if the symbol comes from a shared library. + * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise. + * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise. + * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise. + * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise. + * elf64-x86-64.c (elf64_x86_64_add_symbol_hook): Likewise. + +2010-02-19 Alan Modra + + * elf.c (_bfd_elf_fixup_group_sections): New function, split out from.. + (_bfd_elf_copy_private_header_data): ..here. + * elflink.c (_bfd_elf_size_group_sections): New function. + (bfd_elf_size_dynamic_sections): Call it. + * elf-bfd.h (_bfd_elf_size_group_sections): Declare. + (_bfd_elf_fixup_group_sections): Declare. + +2010-02-18 Matthew Gretton-Dann + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Add support for + merging Tag_DIV_use, Tag_MPextension_use, and + Tag_MPextension_use_legacy tags. + +2010-02-18 Alan Modra + + * elf.c (bfd_elf_set_group_contents): Revert accidental 2009-01-15 + commit. Don't write zeros for removed group members. + (_bfd_elf_copy_private_header_data): Adjust size of group section + when group members are removed by objcopy. + +2010-02-15 Dave Korn + + PR binutils/11280 + * configure.host (*-*-solaris2.11): Add host define to select + valid default code page for windres/windmc on solaris. + +2010-02-15 Nick Clifton + + * po/vi.po: Updated Vietnamese translation. + +2010-02-12 Daniel Gutson + + * elf32-arm.c (elf32_arm_output_arch_local_syms): add + missing mapping symbol to data only sections. + +2010-02-11 David S. Miller + + * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): For R_SPARC_GOTDATA_OP_HIX22 + and R_SPARC_GOTDATA_OP_LOX10, only bump the GOT refcount for global + symbols. + (_bfd_sparc_elf_gc_sweep_hook): Likewise only decrement the GOT count for + these relocs on global symbols. + (gdopoff): New. + (_bfd_sparc_elf_relocate_section): Perform GOTDATA optimizations on + local symbol references which are not STT_GNU_IFUNC. Handle + relocation of them like R_SPARC_HIX22 and R_SPARC_LOX10 respectively, + and deal with negative vs. non-negative values properly. + +2010-02-09 Tristan Gingold + + * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Adjust addend for + non-external relocation. + +2010-02-09 Alan Modra + + * elf64-ppc.c (merge_got_entries): Move earlier in file. + (allocate_dynrelocs): Merge got entries here if not doing multi-toc. + (ppc64_elf_size_dynamic_sections): Similarly merge tlsld_got. + (ppc64_elf_layout_multitoc): Don't resize if we have already + merged got entries. + +2010-02-09 Michael Holzheu + + * elf-bfd.h (elfcore_write_s390_timer, elfcore_write_s390_todcmp, + elfcore_write_s390_todpreg, elfcore_write_s390_ctrs, + elfcore_write_s390_prefix): New. + * elf.c (elfcore_write_s390_timer, elfcore_write_s390_todcmp, + elfcore_write_s390_todpreg, elfcore_write_s390_ctrs, + elfcore_write_s390_prefix): New. + (elfcore_grok_note): Handle NT_S390_TIMER, NT_S390_TODCMP, + NT_S390_TODPREG, NT_S390_CTRS and NT_S390_PREFIX. + (elfcore_write_register_note): Handle .reg-s390-timer, + .reg-s390-todcmp, .reg-s390-todpreg, .reg-s390-ctrs, + .reg-s390-prefix section. + +2010-02-09 Alan Modra + + * elf64-ppc.c (struct got_entry): Make tls_type and is_indirect + unsigned char. Update variables and code using them throughout file. + (struct ppc_link_hash_entry): Likewise for tls_mask. + + * elf64-ppc.c (ppc64_elf_layout_multitoc): Don't merge local got ents. + + * elf64-ppc.c (has_small_toc_reloc): Don't define. + (makes_toc_func_call, call_check_in_progress): Shuffle flags. + (struct ppc64_elf_obj_tdata): Add has_small_toc_reloc. Update + code setting the flag. + (ppc64_elf_next_toc_section): Group big-toc sections in + 0x80008000 chunks. + +2010-02-08 David S. Miller + + * elfxx-sparc.h (struct _bfd_sparc_elf_link_hash_table): Remove sgot, + srelgot, splt, srelplt, and sgotplt members in favor of generic copies. + + * elfxx-sparc.c (create_got_section): Delete. + (_bfd_sparc_elf_create_dynamic_sections): Don't call, the dynamic + section creator does that work for us. Use ->elf.foo instead of + ->foo where applicable. + (_bfd_sparc_elf_check_relocs): Use ->elf.foo instead of ->foo + where applicable. + (allocate_dynrelocs): Likewise. + (_bfd_sparc_elf_size_dynamic_sections): Likewise. + (_bfd_sparc_elf_relocate_section): Likewise. + (sparc_vxworks_build_plt_entry): Likewise. + (_bfd_sparc_elf_finish_dynamic_symbol): Likewise. + (sparc_finish_dyn): Likewise. + (sparc_vxworks_finish_exec_plt): Likewise. + (sparc_vxworks_finish_shared_plt): Likewise. + (_bfd_sparc_elf_finish_dynamic_sections): Likewise. + + * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Use the SYMBOL_* + macros for visibilty and locality checks. + (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise. + (allocate_dynrelocs): Likewise. + (_bfd_sparc_elf_relocate_section): Likewise. + (_bfd_sparc_elf_finish_dynamic_symbol):Likewise. + + * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove set + but never used local var 'dynobj'. + + * elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Handle + nocopyreloc. + + * reloc.c (BFD_RELOC_SPARC_JMP_IREL): New. + (BFD_RELOC_SPARC_IRELATIVE): Likewise. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + + * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add loc_hash_table + and loc_hash_memory. + (_bfd_sparc_elf_link_hash_table_free): Declare. + * elf32-sparc.c (elf32_sparc_add_symbol_hook): New. + (elf_backend_add_symbol_hook, elf_backend_post_process_headers, + bfd_elf32_bfd_link_hash_table_free): Define. + * elf64-sparc.c (elf64_sparc_add_symbol_hook): Set + has_ifunc_symbols if STT_GNU_IFUNC. + (bfd_elf64_bfd_link_hash_table_free): Define. + (elf_backend_post_process_headers): Define always. + * elfxx-sparc.c (sparc_jmp_irel_howto, sparc_irelative_howto): New. + (sparc_reloc_map): Add entries for new IFUNC relocs. + (_bfd_sparc_elf_reloc_type_lookup): Handle new IFUNC relocs. + (_bfd_sparc_elf_info_to_howto_ptr): Likewise. + (elf_sparc_local_htab_hash, elf_sparc_local_htab_eq, + elf_sparc_get_local_sym_hash): New. + (_bfd_sparc_elf_create_dynamic_sections): Move PLT ops initialization + from here... + (_bfd_sparc_elf_link_hash_table_create): ... to here. Allocate + local hash table. + (_bfd_sparc_elf_link_hash_table_free): New. + (create_ifunc_sections): New. + (_bfd_sparc_elf_check_relocs): Unconditionally assign htab->elf.dynobj + and call create_ifunc_sections(). For local STT_GNU_IFUNC symbols + cons up a fake local hash table entry for it. Unconditionally add + a PLT refcount for STT_GNU_IFUNC symbols when h->def_regular. Count + dyn relocs for ifunc. + (_bfd_sparc_elf_adjust_dynamic_symbol): Handle ifunc. + (allocate_dynrelocs): Unconditionally emit a PLT entry when + STT_GNU_IFUNC and h->def_regular. Count GOT dyn relocs for ifunc. + (allocate_local_dynrelocs): New function. + (_bfd_sparc_elf_size_dynamic_sections): Invoke it over the local hash + table. Emit dynamic relocs to irelplt when not shared. Treat iplt + like splt. + (_bfd_sparc_elf_relocate_section): Handle ifunc relocations by hand. + (_bfd_sparc_elf_finish_dynamic_symbol): Adjust for non-dynamic ifunc + plt in iplt/irelplt. + +2010-02-08 Richard Sandiford + + * xcofflink.c (_bfd_xcoff_bfd_final_link): When calculating + max_contents_size, only consider sections whose contents must + be swapped in. + +2010-02-09 Alan Modra + + * elf64-ppc.c (allocate_dynrelocs): Remove unused got structs here.. + (ppc64_elf_size_dynamic_sections): ..and here.. + (merge_got_entries): ..rather than here. + +2010-02-09 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_table): Add do_multi_toc. + (has_small_toc_reloc): Define. + (ppc64_elf_check_relocs): Set the above flags. + (ppc64_elf_edit_opd): Delete obfd param. + (ppc64_elf_tls_optimize): Likewise. + (ppc64_elf_edit_toc): Likewise. + (ppc64_elf_tls_setup): Likewise. Add no_multi_toc param. + * elf64-ppc.h: Update prototypes. + +2010-02-08 Alan Modra + + * section.c (struct bfd_section): Delete has_tls_reloc, + has_tls_get_addr_call, has_gp_reloc, need_finalize_relax, reloc_done. + Add sec_flg0 thru sec_flg5. + (BFD_FAKE_SECTION): Update for changed flags. + * ecoff.c (bfd_debug_section): Likewise. + * elf32-ppc.c (has_tls_reloc, has_tls_get_addr_call): Define. + * elf64-ppc.c (has_tls_reloc, has_tls_get_addr_call): Define. + (has_toc_reloc, makes_toc_func_call, call_check_in_progress): Update. + * elf32-xtensa.c (reloc_done): Define. + * elfxx-ia64.c (skip_relax_pass_0, skip_relax_pass_1): Update. + * bfd-in2.h: Regenerate. + +2010-02-08 Tristan Gingold + + * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Set reloc.r_extern + for non-scattered relocations. + +2010-02-08 Nathan Sidwell + + * elf32-ppc.c (ppc_elf_begin_write_processing): Allow empty + apuinfo sections, only scan input sections once and reuse the + buffer. + +2010-02-08 Philipp Tomsich + + * archures.c (bfd_mach_ppc_titan): Define. + * bfd-in2.h: Regenerate. + * cpu-powerpc.c (bfd_powerpc_archs): Add titan entry. + +2010-02-08 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Remove dead ifunc code. + +2010-02-05 Sterling Augustine + + * elf.c (assign_file_positions_for_load_sections) Update lma of + section if necessary. Fixes Bugzilla 11219. + +2010-02-05 H.J. Lu + + * elf32-i386.c: Remove trailing white spaces. + * elf64-x86-64.c: Likewise. + +2010-02-03 Nick Clifton + + * elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add + entries for other architectures. + (struct elf_link_hash_table): Add hash_table_id field. + (elf_hash_table_id): New accessor macro. + * elflink.c (_bfd_elf_link_hash_table_init): Add target_id + parameter. + * elf-m10300.c (elf32_mn10300_hash_table): Check table id before + returning cast pointer. + (elf32_mn10300_link_hash_table_create): Identify new table as + containing MN10300 extensions. + (mn10300_elf_relax_section): Check pointer returned by + elf32_mn10300_hash_table. + * elf32-arm.c: Likewise, except using ARM extensions. + * elf32-avr.c: Likewise, except using AVR extensions. + * elf32-bfin.c: Likewise, except using BFIN extensions. + * elf32-cris.c: Likewise, except using CRIS extensions. + * elf32-frv.c: Likewise, except using FRV extensions. + * elf32-hppa.c: Likewise, except using HPPA32 extensions. + * elf32-i386.c: Likewise, except using I386 extensions. + * elf32-lm32.c: Likewise, except using LM32 extensions. + * elf32-m32r.c: Likewise, except using M32RM extensions. + * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. + * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. + * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. + * elf32-m68k.c: Likewise, except using M68K extensions. + * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. + * elf32-ppc.c: Likewise, except using PPC32 extensions. + * elf32-s390.c: Likewise, except using S390 extensions. + * elf32-sh.c: Likewise, except using SH extensions. + * elf32-spu.c: Likewise, except using SPU extensions. + * elf32-xtensa.c: Likewise, except using XTENSA extensions. + * elf64-alpha.c: Likewise, except using ALPHA extensions. + * elf64-hppa.c: Likewise, except using HPPA64 extensions. + * elf64-ppc.c: Likewise, except using PPC64 extensions. + * elf64-s390.c: Likewise, except using S390 extensions. + * elf64-x86-64.c: Likewise, except using X86_64 extensions. + * elfxx-ia64.c: Likewise, except using IA64 extensions. + * elfxx-mips.c: Likewise, except using MIPS extensions. + * elfxx-sparc.c: Likewise, except using SPARC extensions. + * elfxx-sparc.h: Likewise, except using SPARC extensions. + * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete + redundant structure. + (elf32_cr16_hash_table): Delete unused macro. + (elf32_cr16_link_hash_traverse): Delete unused macro. + * elf32-score.c: Likewise. + * elf32-score7.c: Likewise. + * elf32-vax.c: Likewise. + * elf64-sh64.c: Likewise. + +2010-02-03 Alan Modra + + * elf64-ppc.c (struct plt_entry): Move earlier in file. + (struct got_entry): Likewise. Add is_indirect and got.ent fields. + (struct ppc64_elf_obj_tdata): Change tlsld_got to be a struct got_entry. + Update all uses. + (struct ppc_link_hash_table): Add got_reli_size and second_toc_pass. + Remove no_multi_toc. + (update_local_sym_info, ppc64_elf_check_relocs): Clear is_indirect + when allocating a new struct got_entry. + (allocate_got): New function, extracted from.. + (allocate_dynrelocs): ..here. Abort on got entry in non-ppc64 bfd. + (ppc64_elf_size_dynamic_sections): Track got relocs allocated in + .reliplt by got_reli_size. Set owner on ppc64_tlsld_got entries. + (ppc64_elf_setup_section_lists): Remove output_bfd param and + no_multi_toc, add add_stub_section and layout_sections_again. Stash + new params in htab. Extract some code to.. + (ppc64_elf_start_multitoc_partition): ..here. New function. + (ppc64_elf_next_toc_section): Check for linker script errors. Handle + second pass toc scan. + (merge_got_entries, merge_global_got, reallocate_got): New functions. + (ppc64_elf_reinit_toc): Rename to.. + (ppc64_elf_finish_multitoc_partition): ..this. + (ppc64_elf_layout_multitoc): New function. + (ppc64_elf_size_stubs): Delete output_bfd, add_stub_section and + layout_sections_again params. + (ppc64_elf_relocate_section): Handle indirect got entries. + * elf64-ppc.h: Update prototypes. Declare new functions. + +2010-02-02 H.J. Lu + + * elf-bfd.h (elfcore_write_xstatereg): New. + + * elf.c (elfcore_grok_xstatereg): New. + (elfcore_write_xstatereg): Likewise. + (elfcore_grok_note): Handle NT_X86_XSTATE. + (elfcore_write_register_note): Handle .reg-xstate section. + +2010-02-01 Tristan Gingold + + * som.c (som_write_ar_hdr): Define this macro. + +2010-01-30 John David Anglin + + * elf32-hppa.c (final_link_relocate): Convert R_PARISC_TLS_GD21L, + R_PARISC_TLS_LDM21L and R_PARISC_TLS_IE21L relocations that use the + linkage table pointer to use the global table pointer if not doing + a shared link. + +2010-01-29 Joel Brobecker + + * elf.c (elfcore_grok_lwpstatus): Do not overwrite the core signal + if it has already been set. + +2010-01-27 Tristan Gingold + + * vms.h: Remove trailing spaces. + (struct hdr_struct): Remove unused hdr_c_cpr field. + (enum file_format_enum): Add comments. + * vms.c (vms_bfd_print_private_bfd_data): New function that + replaces the macro. + Remove trailing spaces. + * vms-misc.c: Improve comments. + (_bfd_vms_get_object_record): Also handle files without pads. + * vms-hdr.c (_bfd_vms_write_dbg): Fix format string. + * vms-gsd.c (struct flagdescstruct): Make name field const. + (gsyflagdesc): Fix typo. + +2010-01-27 Alan Modra + + PR ld/11217 + * elf64-ppc.c (struct ppc_link_hash_table): Add toc_bfd, toc_first_sec. + (ppc64_elf_setup_section_lists): Init them. + (ppc64_elf_next_toc_section): Don't partition multi-toc between .got + and .toc on the same input file. + (ppc64_elf_relocate_section): Correct GOT entry offset. + +2010-01-26 Tristan Gingold + + * targets.c (BFD_JUMP_TABLE_ARCHIVE): Add initializer for write_ar_hdr. + (bfd_target): Add _bfd_write_ar_hdr_fn field. + * archive.c (is_bsd44_extended_name): New macro. + (_bfd_generic_read_ar_hdr_mag): Use it. Add extra_size. + (bfd_slurp_armap): Also check for "__.SYMDEF" as a BSD4.4 extended + name. + (_bfd_archive_bsd44_construct_extended_name_table): New function. + (_bfd_generic_write_ar_hdr): Ditto. + (_bfd_bsd44_write_ar_hdr): Ditto. + (_bfd_write_archive_contents): Call _bfd_write_ar_hdr. + (bsd_write_armap): Adjust firstreal computation. + * libbfd-in.h (struct areltdata): Add extra_size field. + (_bfd_generic_write_ar_hdr): Add prototype. + (_bfd_bsd44_write_ar_hdr): Ditto. + (_bfd_write_ar_hdr): Define. + (_bfd_noarchive_write_ar_hdr): Ditto. + (_bfd_archive_bsd_write_ar_hdr): Ditto. + (_bfd_archive_coff_write_ar_hdr): Ditto. + (_bfd_archive_bsd44_slurp_armap): Ditto. + (_bfd_archive_bsd44_slurp_extended_name_table): Ditto. + (_bfd_archive_bsd44_construct_extended_name_table): New prototype. + (_bfd_archive_bsd44_truncate_arname): Ditto. + (_bfd_archive_bsd44_write_armap): Ditto. + (_bfd_archive_bsd44_read_ar_hdr): Ditto. + (_bfd_archive_bsd44_write_ar_hdr): Ditto. + (_bfd_archive_bsd44_openr_next_archived_file): Ditto. + (_bfd_archive_bsd44_get_elt_at_index): Ditto. + (_bfd_archive_bsd44_generic_stat_arch_elt): Ditto. + (_bfd_archive_bsd44_update_armap_timestamp): Ditto. + * libbfd.h: Regenerate. + * oasys.c (oasys_write_ar_hdr): Define. + * libecoff.h (_bfd_ecoff_write_ar_hdr): Define. + * ieee.c (ieee_write_ar_hdr): Define. + * elf64-mips.c (bfd_elf64_archive_write_ar_hdr): Define. + * coff-rs6000.c (rs6000coff_vec): Adjust for write_ar_hdr field. + (bfd_pmac_xcoff_backend_data): Ditto. + * coff64-rs6000.c (rs6000coff64_vec): Ditto. + (bfd_xcoff_aix5_backend_data): Ditto. + * coff-alpha.c (alpha_ecoff_write_ar_hdr): Define. + * aout-target.h (MY_write_ar_hdr): Define it if not defined. + * aout-tic30.c (MY_write_ar_hdr): Ditto. + * mach-o-target.c (TARGET_NAME): Use _bfd_archive_bsd44 archive. + (bfd_mach_o_mkarchive, bfd_mach_o_read_ar_hdr) + (bfd_mach_o_slurp_armap, bfd_mach_o_slurp_extended_name_table) + (bfd_mach_o_construct_extended_name_table) + (bfd_mach_o_truncate_arname, bfd_mach_o_write_armap) + (bfd_mach_o_get_elt_at_index, bfd_mach_o_generic_stat_arch_elt) + (bfd_mach_o_update_armap_timestamp): Moved to mach-o.c + * mach-o.c (bfd_mach_o_mkarchive, bfd_mach_o_read_ar_hdr) + (bfd_mach_o_slurp_armap, bfd_mach_o_slurp_extended_name_table) + (bfd_mach_o_construct_extended_name_table) + (bfd_mach_o_truncate_arname, bfd_mach_o_write_armap) + (bfd_mach_o_get_elt_at_index, bfd_mach_o_generic_stat_arch_elt) + (bfd_mach_o_update_armap_timestamp): Moved from mach-o-target.c + * bfd-in2.h: Regenerate. + +2010-01-26 Alan Modra + H.J. Lu + + PR ld/11218 + * elflink.c (elf_link_output_extsym): Do not ignore undefined + symbols with ref_regular set when gc_sections is active. + +2010-01-25 Alan Modra + + PR ld/11217 + * elf64-ppc.c (ppc64_elf_tls_optimize): Optimize tls sequences + with relocations against undefined weak symbols. + (ppc64_elf_relocate_section): Don't optimize calls to undefined + weak functions if the symbol is dynamic. + (ppc64_elf_relocate_section): Edit tprel tls sequences. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + (_bfd_elf_ppc_at_tprel_transform): New function. + * bfd-in.h (_bfd_elf_ppc_at_tprel_transform): Declare. + * bfd-in2.h: Regenerate. + +2010-01-23 Richard Sandiford + + * coff-rs6000.c (xcoff_howto_table): Change size to 0 and bitsize to 1. + (_bfd_xcoff_reloc_type_lookup): Handle BFD_RELOC_NONE. + * coff64-rs6000.c (xcoff64_howto_table): Change size to 0 and + bitsize to 1. + (xcoff64_reloc_type_lookup): Handle BFD_RELOC_NONE. + +2010-01-21 Nick Clifton + + * elflink.c (elf_link_add_object_symbols): Look up name of + undefined symbol both before and after versioning has been + applied. Do not bother with symbols that are weakly undefined. + +2010-01-21 Andreas Krebbel + + * elf32-s390.c (elf32_s390_merge_private_bfd_data): New function. + (bfd_elf32_bfd_merge_private_bfd_data): New macro definition. + +2010-01-19 Cary Coutant + + * dwarf2.c (read_attribute_value): Add DW_FORM_ref_sig8. + +2010-01-19 Daisuke Hatayama + Alan Modra + + * elfcode.h (elf_swap_ehdr_out): Handle e_phnum > 0xffff. + (elf_object_p): Read e_phnum extension. + (elf_write_shdrs_and_ehdr): Write e_phnum extension. + * elfcore.h (elf_core_file_p): Read e_phnum extension. Sanity check + that we can read last program header. + +2010-01-19 Matthew Gretton-Dann + + * elf32-arm.c (elf32_arm_howto_table_1): Correct bitsize of + R_ARM_THM_CALL entry. + (elf32_arm_final_link_relocate): Correct calculation of + reloc_signed_max when doing a R_ARM_THM_CALL, R_ARM_THM_XPC22, + or R_ARM_THM_JUMP24 relocation. + +2010-01-18 Alan Modra + + PR 11168 + * coffcode.h (coff_compute_section_file_positions): Move Rs6000COFF_C + block past vars in COFF_IMAGE_WITH_PE block. Report error on more + than 32k sections. + +2010-01-15 Jan Kratochvil + + Fix compilation warning on gcc-3.4. + * vms-tir.c (start_etir_record, sto_imm): Rename the prototype + parameter index to sec_index according to the function definition. + +2010-01-13 Chao-ying Fu + + * elfxx-mips.c (JR_TO_B_P): New define to transform JR to B. + It is true for all CPUs. + (jal_reloc_p): New function. + (mips_elf_calculate_relocation): Rename require_jalxp to + cross_mode_jump_p. + Update comment for CROSS_MODE_JUMP_P. + Set up cross_mode_jump_p based on the mode change. + (mips_elf_perform_relocation): Rename require_jalx to cross_mode_jump_p. + Update comment for CROSS_MODE_JUMP_P. + Test cross_mode_jump_p and jal_reloc_p to turn jal to jalx. + Use !cross_mode_jump_p to guard conversion. + Convert "jr t9" to "b", if possible. + (_bfd_mips_elf_relocate_section): Rename require_jalx to + cross_mode_jump_p. + Pass &cross_mode_jump_p to call mips_elf_calculate_relocation. + Pass cross_mode_jump_p to call mips_elf_perform_relocation. + +2010-01-13 Nick Clifton + + * cpu-m32c.c (m32c_scan): New function. Ensures that a scan for + "m32c" returns the m32c arch_info_struct and not the m16c + arch_info_struct. + (arch_info_struct): Use the new scan function. + (bfd_m32c_arch): Likewise. + +2010-01-13 Tristan Gingold + + * config.bfd: Remove duplicated target vector for i386-*-darwin. + Appends new arch instead of overriding. + Use mach_o_x86_64_vec for x86_64-*-darwin. + * configure.in: Add mach_o_x86_64_vec. + * configure: Regenerate. + * targets.c: Declare mach_o_x86_64_vec, add it to _bfd_target_vector. + * Makefile.am (BFD64_BACKENDS): Add mach-o-x86-64.lo + (BFD64_BACKENDS_CFILES): Add mach-o-x86-64.c + * Makefile.in: Regenerate. + * mach-o-x86-64.c: New file. + +2010-01-13 Tristan Gingold + + * reloc.c: Add MACH_O_X86_64 relocations. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2010-01-13 Tristan Gingold + + * archive.c (normalize): Use lbasename. + (bfd_bsd_truncate_arname): Ditto. + (bfd_gnu_truncate_arname): Ditto. + +2010-01-12 Tristan Gingold + + * makefile.vms (CFLAGS): Turns warnings into informational messages. + +2010-01-11 Tristan Gingold + + * mach-o.h: Add x86-64 relocation types. + +2010-01-11 Tristan Gingold + + * mach-o.h (bfd_mach_o_backend_data): Add arch field. + (bfd_mach_o_set_arch_mach): New prototype. + * mach-o.c (bfd_mach_o_mkobject): Define with bfd_mach_o_gen_mkobject. + (bfd_mach_o_set_arch_mach): New function. + (bfd_mach_o_gen_mkobject): New function. + Set TARGET_ARCHITECTURE for the generic back-ends. + * mach-o-target.c (bfd_mach_o_set_arch_mach): Remove define. + Check that TARGET_ARCHITECTURE is defined. + Add TARGET_ARCHITECTURE in TARGET_NAME_BACKEND structure. + * mach-o-i386.c (TARGET_ARCHITECTURE): Define. + +2010-01-11 Tristan Gingold + + * archive.c (bfd_slurp_armap): Also check for Mach-O sorted armap. + +2010-01-11 Nick Clifton + + * elf32-v850.c (v850_elf_perform_relocation): Fix overflow + handling of R_V850_HI16_S relocation. + +2010-01-11 Alan Modra + + PR 11103 + * dwarf1.c (parse_die): Correct FORM_STRING data pointer increment. + +2010-01-11 Alan Modra + + PR 6832 + * dwarf2.c (struct comp_unit): Add sec_info_ptr. + (find_abstract_instance_name): Use it. + (parse_comp_unit): Set it. + +2010-01-09 Ralf Wildenhues + + * Makefile.in: Regenerate. + * configure: Regenerate. + +2010-01-08 Tristan Gingold + + * archive.c: Remove bfd_special_undocumented_glue. + +2010-01-08 Alan Modra + + PR ld/11133 + * elf32-cr16.c (elf32_cr16_gc_mark_hook): Call _bfd_elf_gc_mark_hook. + * elf32-microblaze.c (microblaze_elf_gc_mark_hook): Likewise. + * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise. + +2010-01-07 H.J. Lu + + PR ld/11138 + * elflink.c (elf_link_check_versioned_symbol): Don't abort if + a symbol referenced by DSO is is defined in a non-shared object + and forced local. + +2010-01-07 H.J. Lu + + PR ld/11133 + * elflink.c (_bfd_elf_gc_mark_hook): Check section XXX for + undefined __start_XXX/__stop_XXX in all input files and set + SEC_KEEP. + +2010-01-07 H.J. Lu + + PR ld/11143 + * elflink.c (elf_gc_sweep): Keep SHT_NOTE section. + +2010-01-04 Daniel Gutson + + * bfd.m4 (BFD_HAVE_SYS_PROCFS_TYPE): Define _STRUCTURE_PROC + before including procfs.h. + (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise. + * configure.in: Added autoconf probe for the pr_fpreg member. + * configure: Regenerated. + * config.in: Regenerated. + * elf.c: Define _STRUCTURE_PROC before including procfs.h. + +2010-01-04 Joel Brobecker + + Fix -Wshadow warnings in dwarf2.c (seen on alpha-tru64). + * dwarf2.c (concat_filename): Rename dirname with dir_name + to void shadowing the dirname function. + Rename subdirname with subdir_name to stay consistent with + the new dir_name variable name. + +2010-01-04 Edmar Wienskoski + + * archures.c: Add bfd_mach_ppc_e500mc64. + * bfd-in2.h: Regenerate. + * cpu-powerpc.c (bfd_powerpc_archs): Add entry for + bfd_mach_ppc_e500mc64. + +2010-01-01 Joel Brobecker + + Fix -Wshadow warnings (seen on ppc-aix) + * xcofflink.c: Replace finfo by flinfo throughout. + +For older changes see ChangeLog-2009 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-9193 sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-9193 --- sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-9193 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-9193 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,7848 @@ +Fri Dec 31 16:23:43 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Minor cleanups suggested by CodeCenter. + * aoutx.h, coffgen.c, ecoff.c, ecofflink.c, elf.c, libbfd.c, + linker.c, reloc.c, section.c, srec.c: Added /*ARGSUSED*/ as + appropriate. + * aoutx.h (struct external_exec): Removed unnecessary declaration. + (NAME(aout,some_aout_object_p)): Set some tdata pointers to NULL. + (adjust_z_magic): Removed useless variable data_vma. + (stringtab_init): Initialize hash_zero. + (add_to_stringtab): Removed unused fourth argument. + (NAME(aout,swap_std_reloc_out)): Removed useless variable + r_addend. + (aout_link_input_section): Added some casts. + * archive.c (get_extended_arelt_filename, do_slurp_coff_armap, + bfd_ar_hdr_from_filesystem, bsd_write_armap, coff_write_armap): + Minor code rewriting to make it more C like. + (do_slurp_bsd_armap): Added some casts. + * ecoff.c (ecoff_write_object_contents): Removed useless variable + scn_base. + (ecoff_write_armap): Added some casts. Use "" rather than "\0". + * ecofflink.c (bfd_ecoff_write_debug): Added a cast. + * libaout.h (struct internal_exec): Removed unnecessary + declaration. + * linker.c (_bfd_generic_indirect_link_order): Added a cast. + * opncls.c (new_bfd): Removed a cast. + * reloc.c (bfd_generic_get_relocated_section_contents): Added + some casts. + * srec.c (internal_srec_write_object_contents): Removed useless + variable bytes_written. + +Fri Dec 31 11:46:13 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * i386mach3.c (N_TXTADDR): Don't define after all. + (TEXT_START_ADDR): Don't include exec header size in value. + +Thu Dec 30 15:47:54 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * i386mach3.c (N_TXTADDR): Define. + +Thu Dec 30 13:37:24 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Extensive changes to move the bulk of the linker into BFD so that + more efficient backend code can be written for specific object + files. Only existing efficient backend is a.out. + * seclet.c, seclet.h: Removed. + * hash.c, linker.c, genlink.h: New files. + * bfd-in.h: Removed bfd_error_vector. Declared hash table + structures and functions. + (JUMP_TABLE): Removed bfd_seclet_link, added + bfd_link_hash_table_create, bfd_link_add_symbols and + bfd_final_link. + * All backends: Changed accordingly. + * bfd-in2.h: Rebuilt. + * bfd.c (struct _bfd): Added link_next and archive_pass fields. + Removed ld_symbols field. + (bfd_nonrepresentable_section, bfd_undefined_symbol, + bfd_reloc_value_truncated, bfd_reloc_is_dangerous, + bfd_error_vector): Removed. + (bfd_default_error_trap, bfd_error_trap, + bfd_error_nonrepresentabltrap): Removed. + (bfd_get_relocated_section_contents): Pass link_info. Pass + link_order instead of seclet. Pass symbols. + (bfd_relax_section): Pass link_info. + (bfd_seclet_link): Removed. + (bfd_link_hash_table_create, bfd_link_add_symbols, + bfd_final_link): New macros. + * libbfd-in.h: If __GNUC__ is defined and alloca is not, define + alloca as __builtin_alloca. Declare internal linking functions. + * libbfd.h: Rebuilt. + * libbfd.c (bfd_seek): Comment out fseek assertion. It's worked + for months. + * reloc.c (reloc_howto_type): Added error_message argument to + special_function field. Changed all callers and all definitions. + (bfd_get_reloc_size): Make argument a const pointer. + (bfd_perform_relocation): Add error_message argument to hold + string set if return value if bfd_reloc_dangerous. Changed all + callers. + (_bfd_final_link_relocate, _bfd_relocate_contents): New functions. + * section.c (asection): Renamed seclets_head and seclets_tail to + link_order_head and link_order_tail. + * targets.c (bfd_target): Replaced seclet argument with link_info + and link_order and symbols arguments in + bfd_get_relocated_section_contents. Added symbols argument to + bfd_relax_section. Removed bfd_seclet_link. Added + bfd_link_hash_table_create, bfd_link_add_symbols and + bfd_final_link. + * libaout.h (struct aoutdata): Added external_syms, + external_sym_count, external_strings, sym_hashes fields. + (obj_aout_external_syms, obj_aout_external_sym_count, + obj_aout_external_strings, obj_aout_sym_hashes): New accessor + macros. + (WRITE_HEADERS): Only output symbols if outsymbols is not NULL. + * aoutx.h: Wrote new back end linker routines. + (translate_to_native_sym_flags): Return boolean value. Don't use + bfd_error_vector. + (NAME(aout,write_syms)): Return boolean value. Check return value + of translate_to_native_sym_flags and bfd_write. + * aout-target.h (final_link_callback): New function. + (MY_bfd_final_link): New function. + * aout-adobe.c (aout_adobe_write_object_contents): Check return + value of aout_32_write_syms. + * hp300hpux.c (MY(write_object_contents)): Likewise. + * i386lynx.c (WRITE_HEADERS): Likewise. + * libaout.h (WRITE_HEADERS): Likewise. + * bout.c: Changed functions to use link_info->callbacks rather + than bfd_error_vector, and link_orders rather than seclets. + * coff-alpha.c: Likewise. + * coff-h8300.c: Likewise. + * coff-h8500.c: Likewise. + * coff-sh.c: Likewise. + * coff-z8k.c: Likewise. + * elf32-hppa.c: Likewise. + * reloc16.c: Likewise. + * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look + up _gp in the hash table rather than in outsymbols. + * coff-a29k.c (a29k_reloc): Pass errors back in new error_message + argument rather than printing them. + * coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and + link_order arguments rather than seclet. Changed all uses and + definitions. + (bfd_coff_reloc16_estimate): Pass link_info arguments. Changed + all uses and definitions. + * libcoff.h: Rebuilt. + * ecoff.c (ecoff_get_extr): If symbol is defined by linker, but + not by ECOFF, make it scAbs. + (ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and + rewritten. + * elf32-mips.c (mips_elf_final_link): Renamed from + mips_elf_seclet_link and rewritten. + * elf32-hppa.c (elf32_hppa_stub_description): Added link_info + field. + (new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub, + hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section): + Added link_info arguments. Changed all callers. + * elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is + not NULL. + * oasys.c (oasys_write_sections): Return boolean value rather than + using bfd_error_vector. + (oasys_write_object_contents): Check return value of + oasys_write_sections. + * hosts/std-host.h: Don't declare qsort or strtol. + * Makefile.in: Rebuild dependencies. + (BFD_LIBS): Removed seclet.o. Added hash.o and linker.o. + (CFILES): Removed seclet.c. Added hash.c and linker.c. + (HFILES): Removed seclet.h. Added genlink.h. + +Thu Dec 30 07:41:36 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * section.c (bfd_get_section_contents): Return zero filled buffer + if section has no contents. + +Tue Dec 28 12:43:54 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elf.c (bfd_elf_generic_reloc): If this is not an inplace reloc, + then skip bfd_perform_relocation even if the addend is non-zero. + +Tue Dec 21 09:22:19 1993 Ken Raeburn (raeburn@rtl.cygnus.com) + + * coffcode.h (coff_write_relocs) [SWAP_OUT_RELOC_OFFSET]: Copy + addend to r_offset field. + + * Makefile.in (CFILES): Added coff-sparc.c. Rebuild dependencies. + + * coff-sparc.c (SWAP_IN_RELOC_OFFSET, SWAP_OUT_RELOC_OFFSET, + CALC_ADDEND): Define. + + * aix386-core.c (aix386_core_file_p): Use cd_regs[0] for computing + the offsetof because AIX /bin/cc does not like to take the address + of an array. (From Minh Tran-Le.) + +Thu Dec 16 13:06:32 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * Thu Dec 16 15:41:06 1993 Peter Hoogenboom (hoogen@cs.utah.edu) + + * elf32-hppa.c (hppa_elf_build_arg_reloc_stub): Make sure to copy + the return pointer into %r2 if no jump-in-call-delay-slot + optimization was done. + + * hosts/hp300bsd.h: Correctly identify 4.3BSD vs 4.4BSD. + +Wed Dec 15 08:04:16 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * hosts/std-host.h: (time): Don't declare; conflicts on Mach3. + + * hosts/i386mach3.h (HOST_PAGE_SIZE): Set to 1 to avoid padding. + (HOST_SEGMENT_SIZE): Set to 0 for same reason. + + * i386mach3.c (PAGE_SIZE, SEGMENT_SIZE): Same changes as above. + (TEXT_START_ADDR): Correct. + (MY_backend_data): Define. + + * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): + New functions; code moved from aout__adjust_sizes_and_vmas. + +Tue Dec 14 21:48:33 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_begin_writing): Fix thinkos in auxiliary header + support. + (bfd_som_attach_aux_hdr): Likewise. + +Mon Dec 13 23:34:48 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (hppa_elf_gen_reloc_type): Handle 'T' field + selectors for PIC code. + + * som.c (hppa_som_gen_reloc_type): Handle 'T' field selectors. + (som_write_fixups): Handle R_DLT_REL, R_FSEL, R_RSEL, R_LSEL + relocations needed by PIC. + +Tue Dec 7 15:47:51 1993 Stu Grossman (grossman at cygnus.com) + + * nlmcode.h: Fixes to avoid compiler warnings... + +Tue Dec 7 15:10:54 1993 Ian Lance Taylor (ian@cygnus.com) + + * libnlm.h (nlm_backend_data): Removed macro definition. + (nlm_alpha_backend_data): Adjusted accordingly. + +Sun Dec 5 19:32:08 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_begin_writing): Flesh out code for handling simple + auxiliary headers. + (bfd_som_attach_aux_hdr): New function. + + * som.h (struct somdata): Add fields for attaching version and + copyright headers. Add accessor macros. + + * som.c (R_DLT_REL, R_AUX_UNWIND, R_SEC_STMT): Add protected + definitions for old versions of HPUX which fail to define them. + (som_hppa_howto_talbe): Add R_DLT_REL, R_AUX_UNWIND, and R_SEC_STMT + now that they're safe. Delete bogus R_STATEMENT relocations. + + * som.c (som_hppa_howto_table): Add missing R_END_TRY. Delete + extra R_DATA_OVERRIDE. + (hppa_som_gen_reloc_type): Generate a relocation for the rounding + mode selector if needed. + (som_write_fixups): Handle requests for a change in the default + rounding mode. Rounding modes do not consume input bytes, but + are just markers much like R_ENTRY and R_EXIT. + +Sat Dec 4 19:40:32 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + Fri Dec 3 09:55:17 1993 Pete Hoogenboom (hoogen@cs.utah.edu) + + * elf32-hppa.c: (hppa_elf_reloc): Do not do code reordering when + the branch instruction as originally been nullified. + hppa_elf_reloc): Avoid useless call to bfd_put_32 () in the + case of no code reordering due to an LDO instruction in the + delay slot of the branch. Make sure to relocate the correct + instruction. Do not perform instruction reordering for millicode + calls. + (hppa_elf_build_arg_reloc_stub): Change the relocation type + to R_HPPA_STUB_CALL_17 when special processing might be needed. + (hppa_elf_build_long_branch_stub): Prevent code reordering on + a call from a linker stub to another linker stub and for millicode + calls. Do not trash the return register for calls from one linker + stub to a second linker stub. + + * elf32-hppa.c: (elf_hppa_howto_table): PLABEL and DLT + relocations are not pc-relative. + + * hppa_stubs.h: (BLE_N_XXX_0_31): New instruction used in + linker stub code. + (COPY_2_31): Likewise. + +Fri Dec 3 18:40:58 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * config/solaris2.mh (HDEFINES): Remove -Dconst= + * hosts/solaris.h: If not __GNUC__, define const as empty. + +Thu Dec 2 15:43:32 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c: Added various casts for 32/64 bit cross targeting. + (ecoff_mkobject_hook): Set SEC_SHARED_LIBRARY for the .reginfo + section so that the linker ignores it. + * ecofflink.c: Added various casts for 32/64 bit cross targeting. + (ecoff_add_bytes): Changed need argument to size_t. + (bfd_ecoff_debug_link_other): Check return value of + ecoff_add_string. + + * libbfd-in.h (new_bfd): Use void rather than an empty parameter + list. + * libbfd.h: Rebuilt. + + * libnlm.h (struct nlm_obj_tdata): New field backend_data. + (nlm_backend_data, nlm_alpha_backend_data): New accessor macros. + (struct nlm_backend_data): New field no_uninitialized_data. + (nlm_no_uninitialized_data): New accessor macro. + * nlmcode.h (nlm_compute_section_file_positions): Handle + no_uninitialized_data. + (nlm_external_reloc_compare): Sort relocs by address for a + particular symbol, to make the sort more stable. + (nlm_write_object_contents): Cast the arguments to qsort. Get the + value of a debugging symbol the same way we get the value of a + normal symbol. + * nlm32-alpha.c: Various changes. Write out GP and .lita relocs. + Set no_uninitialized_data to true. + * nlm32-i386.c (nlm32_i386_backend), nlm32-sparc.c + (nlm32_sparc_backend): Set no_uninitialized_data field false. + * nlmswap.h (nlm_swap_fixed_header_out): Zero out destination + before filling it in. + +Wed Dec 1 21:47:58 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_section_type, som_decode_symcalss): New functions. + (som_get_symbol_info): Use them. + (som_slurp_symbol_table): Set the section of common and undefined + symbols correctly. + +Wed Dec 1 14:15:10 1993 Ken Raeburn (raeburn@cygnus.com) + + * elfcode.h (write_relocs): Initialize local var LAST_SYM_IDX, to + make gcc happy. + + * mipsbsd.c: Changes from Ralph Campbell: + (mips_howto_table_ext): MIPS_RELOC_LO16 should use + complain_overflow_dont. + (aout_mips_*_vec): Make name use "a.out" instead of "aout", to + make gdb happy. + + * bfd.c (bfd_errmsgs): Reword invalid-target message. + + * config.bfd: For sparc*-*-coff, use sparc-coff. + * configure.in: Handle sparccoff_vec. + * targets.c (sparccoff_vec): Declare. + + * reloc.c (bfd_get_reloc_size): New function. + (struct reloc_howto_type): Update documentation of size field. + +Wed Dec 1 14:39:05 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlm32-alpha.c: New file; preliminary Alpha NetWare support. + * config.bfd (alpha-*-netware*): New target; use alpha-nlm. + * config/alpha-nlm.mt: New file. + * configure.in (nlm32_alpha_vec): New vector; use nlm32-alpha.o, + nlm32.o, and nlm.o. + * Makefile.in (BFD32_BACKENDS): Added nlm32-alpha.o. + (CFILES): Added nlm32-alpha.c. + Rebuilt dependencies. + * targets.c (nlm32_alpha_vec): Declare. + + * libnlm.h (struct nlm_backend_data): New fields + optional_prefix_size, nlm_backend_object_p, nlm_write_prefix, + nlm_set_public_section, nlm_get_public_offset. Removed unused + nlm_write_reloc field. Changed nlm_write_import to remove + unnecessary symbol argument. Renamed nlm_write_externals to + nlm_write_external, and changed cound argument from bfd_vma to + bfd_size_type. + (nlm_optional_prefix_size, nlm_backend_object_p_func, + nlm_write_prefix_func, nlm_set_public_section_func, + nlm_get_public_offset_func): New accessor macros. + (nlm_write_reloc_func): Removed. + (nlm_write_external_func): Adjusted for field renaming. + * nlm32-i386.c (nlm_i386_write_import): Renamed from + nlm_i386_write_reloc. Removed old nlm_i386_write_import which + just called old nlm_i386_write_reloc. + (nlm_i386_write_external): Renamed from nlm_i386_write_externals. + Declared. Changed second argument from bfd_vma to bfd_size_type. + (nlm32_i386_backend): Adjusted for changes to fields and names. + * nlm32-sparc.c (nlm_sparc_mangle_relocs): Removed unused, + ifdeffed out code. + (nlm_sparc_write_import): Removed second argument. + (nlm_sparc_write_external): Renamed from + nlm_sparc_write_externals. Changed second argument from bfd_vma + to bfd_size_type. + (nlm32_sparc_backend): Adjusted for changes to fields and names. + * nlmcode.h: Removed some unused code. + (nlm_object_p): Don't destroy tdata pointer. Call + backend_object_p function if it exists. + (nlm_slurp_symbol_table): Removed unused variable rcount. Call + set_public_section_func if it exists instead of checking + NLM_HIBIT. + (nlm_compute_section_file_positions): Account for + optional_prefix_size. + (nlm_write_object_contents): Account for optional_prefix_size. + Removed useless variable write_reloc_func. Changed declaration + and call of write_import_func. Call write_prefix_func if it + exists. Removed unused variables len and temp. Call + get_public_offset_func if it exists rather than setting NLM_HIBIT. + * nlmswap.h: Declare functions. + + * bfd-in.h (uint64_typeLOW, uint64_typeHIGH): Fully parenthesize + for clarity. + (fprintf_vma, sprintf_vma): Use %lx, not %x. + * bfd-in2.h: Rebuilt. + * hosts/alphaosf.h (uint64_typeLOW, uint64_typeHIGH): Cast results + to unsigned long. + + * config.bfd: Don't set target64 here, as the setting is ignored. + * configure.in (ecoffalpha_little_vec): Set target64. + + * config/alphaosf.mt (TDEFINES): Removed; setting host parameters + in TDEFINES is wrong. + + * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): + Remove unused variable output_section. + +Tue Nov 30 16:45:23 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * irix-core.c: New file for Irix 4 and Irix 5 core support. + Functions taken out of coff-mips.c. Handle vmap type VMAPFILE. + * coff-mips.c: Irix 4 core file support moved to irix-core.c. + * targets.c: If IRIX_CORE defined, include irix_core_vec in + target_vector. + * config/irix4.mh (HDEFINES): Add -DIRIX_CORE. + (HDEPFILES): Define to be irix-core.o. + * config/irix5.mh (HDEFINES): Define to be -DIRIX_CORE. + (HDEPFILES): Define to be irix-core.o. + * Makefile.in (OPTIONAL_BACKENDS): Added irix-core.o. Removed + sco5-core.o, which no longer exists. + (CFILES): Added all *-core.c files. + Rebuilt dependencies. + +Wed Nov 24 02:02:41 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (map_program_segments): Restore check of file_size != + mem_size, but only if SHT_PROGBITS. + + * ecofflink.c: New file to hold ECOFF debug information linking + routines. + * ecoff.c (ecoff_clear_output_flags, ecoff_rel, ecoff_dump_seclet, + ecoff_add_string, ecoff_get_debug): Removed. Functionality now in + ecofflink.c. + (ecoff_get_extr, ecoff_set_index): New functions. + (ecoff_slurp_symbolic_info): Don't save raw_size. + (ecoff_bfd_seclet_link): Rewrote to use ecofflink.c functions. + (ecoff_compute_section_file_positions): Don't set EXEC_P just + because there is a start address. + (ecoff_write_object_contents): Handle external symbols here. Use + ecofflink.c functions to write out debugging information. + * elf32-mips.c (mips_elf_read_ecoff_info, mips_elf_get_extr, + mips_elf_set_index): New functions. + (mips_elf_seclet_link): Discard empty sections, the .options + section and .gptab sections. Handle linking .mdebug section. + * libecoff.h (ecoff_data_type): Removed raw_size and ifdbase. + * libelf.h (elf_symbol_type): Added mips_extr to tc_data union. + * bfd-in.h: Added prototypes for routines in ecofflink.c (some are + called by gas, so they are public). + * bfd-in2.h: Rebuilt. + * Makefile.in (BFD_LIBS): Added ecofflink.o. + (CFILES): Added ecofflink.c. + (ecofflink.o): New target. Rebuilt dependencies. + +Mon Nov 22 22:26:42 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (hppa_object_p): Also recognize SHARED_MAGIC_CNX as + a valid magic number if it's been defined. + +Mon Nov 22 14:17:36 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_mkobject): Don't create .scommon section; linker + no longer requires it. + (ecoff_bfd_seclet_link, ecoff_sizeof_headers, + ecoff_write_object_contents): Don't treat .scommon section + specially. + +Mon Nov 22 10:54:27 1993 Fred Fish (fnf@cygnus.com) + + Merged changes from kev@spuds.geg.mot.com (Kevin A. Buettner): + * config/delta88.mh (HDEFINES): Define this to be -DPTRACE_CORE. + * config/delta88.mh (HDEPFILES): Defined to be ptrace-core.o. + * ptrace-core.c: New file for dealing with core files with + start with the ptrace_user structure found on BCS compliant systems. + * targets.c (ptrace_core_vec): New vector. + +Mon Nov 22 02:33:12 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * Minimal support for reading SOM fixup streams. Allows + objdump -r to do something reasonable. + * som.c (som_get_reloc_upper_bound): Implement. + (som_canonicalize_reloc): Implement. + (som_set_reloc_info, som_slurp_reloc_table): New functions. + +Sun Nov 21 13:46:55 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * hosts/lynx.h (FPRINTF_ALREADY_DECLARED): Define. + * hosts/sparclynx.h: Include lynx.h instead of duplicating it. + +Fri Nov 19 14:34:04 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-a29k.c (a29k_reloc): For R_IREL, don't left shift + signed_value before sign extending it. Don't subtract out + reloc_entry->address. This makes it compatible with what gas is + generating. + + * elfcode.h (elf_fake_sections): Accept .sbss as the name for a + SHT_NOBITS sections. + (map_program_segments): Don't leave the loop after the first + SHT_NOBITS section. + (assign_file_positions_except_relocs): Only force sh_offset and + sh_addr to match modulo maxpagesize for a section which is not + SHT_NOBITS. Changed the method used to force page alignment after + a SHT_NOBITS section to only do it for the last such consecutive + section, and to really force page alignment. + +Fri Nov 19 04:02:01 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * coffcode.h (coff_slurp_symbol_table): Print more verbose message + in the case of an unknown (or unhandled) storage class. + + * config/i386-lynx.mt (TDEFINES): FPRINTF_ALREADY_DECLARED should + not be defined here, since it is a host attribute, not a target + one. + * config/m68k-lynx.mt, config/sparc-lynx.mt: Ditto. + + * coffcode.h (coff_bfd_reloc_type_lookup): Don't define if already + defined. + + * coff-sparc.c: Define some relocations, based on ELF relocations. + (enum reloc_type, bfd_coff_generic_reloc, coff_sparc_howto_table, + struct coff_reloc_map, sparc_reloc_map, + coff_sparc_reloc_type_lookup): Borrowed from elf32-sparc.c and + elf.c, renamed. + (coff_bfd_reloc_type_lookup): Define to be coff_sparc_reloc_.... + (rtype2howto): Index into coff_sparc_howto_table using + dst->r_type. + +Thu Nov 18 11:45:39 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * config.bfd (mips*-*-irix5*): New target; use mipsbelf. + * configure.host (mips-sgi-irix5*) New host; use irix5 (no + hosts/irix5.h created; just use std-host.h). + * config/irix5.mh: New file; like irix4.mh, but don't use -G or + -lmalloc. + * Makefile.in: Rebuilt dependencies. + + * ecoffswap.h: Changed type of internal pointers for swap out + functions to const *. + + * elf32-mips.c (mips_elf_got16_reloc): New function. Handle GOT16 + correctly for assembler, but linker support not implemented. + (elf_mips_howto_table): Use mips_elf_got16_reloc for GOT16. + (mips_elf_sym_is_global): New function; at least on Irix 5, all + non section symbols are considered global. + (elf_backend_sym_is_global): Define. + (mips_elf_final_write_processing): New function. Set the MIPS + architecture level correctly. + (elf_backend_final_write_processing): Define. + (mips_elf_section_from_shdr): Handle SHT_MIPS_OPTIONS. + (mips_elf_fake_sections): Set entsize of .mdebug or .reginfo + section to 1. Handle .options section. + (mips_elf_acom_section, mips_elf_acom_symbol, + mips_elf_acom_symbol_ptr): New static variables, used to build a + generic .acommon section to hold SHN_MIPS_ACOMMON symbols. + (mips_elf_symbol_processing): Handle SHN_MIPS_ACOMMON symbols by + putting them all in a global .acommon section. + + * elfcode.h (bfd_section_from_shdr): Don't dump core if target + section has no ELF section data. + (elf_make_sections): Set addralign of reloc section to 4. + (elf_fake_sections): Likewise. + (map_program_segments): Don't consider section 0. + (assign_file_positions_except_relocs): Don't consider section 0. + In the main loop, skip the symtab and strtab sections, since their + positions are set elsewhere. + (swap_out_syms): Set addralign of symtab section to 4. Set + addralign of strtab sections to 1. + (assign_file_positions_for_relocs): Don't consider section 0. + (write_object_contents): Don't write out section 0. + + * libelf.h (struct elf_backend_data): Added fields + elf_backend_sym_is_global and elf_backend_final_write_processing. + * elf32-target.h (elf32_bed): Added corresponding initializers. + * elf64-target.h (elf64_bed): Likewise. + * elfcode.h (sym_is_global): Take abfd argument. Call + elf_backend_sym_is_global if it is not NULL. + (elf_map_symbols): Pass abfd to sym_is_global. + (write_object_contents): Call elf_backend_final_write_processing + if it is defined. + +Wed Nov 17 18:43:28 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libecoff.h: Include coff/ecoff.h. + (struct ecoff_backend_data): Move external debugging information + fields into a single field pointing to an ecoff_debug_swap + structure. + (ecoff_data_type): Move debugging information fields into a single + field pointing to an ecoff_debug_info structure. + * coff-alpha.c, coff-mips.c, ecoff.c: Corresponding changes. + +Wed Nov 17 17:38:58 1993 Sean Eric Fagan (sef@cygnus.com) + + * nlmswap.h: New file to swap fixed header. Included by NLM + backends. + * libnlm.h (struct reloc_and_sec): Define. + (struct nlm_backend_data): Add fields fixed_header_size, + nlm_read_import, nlm_write_import, nlm_swap_fhdr_in, + nlm_swap_fhdr_out. + (nlm_fixed_header_size, nlm_read_import_func, + nlm_write_import_func, nlm_swap_fixed_header_in_func, + nlm_swap_fixed_header_out_func, nlm_write_external_func): New + accessor macros. + * nlmcode.h: Use new functions. + * nlm32-i386.c: Provide new functions. + * nlm32-sparc.c: New file; SPARC NLM backend. + +Wed Nov 17 13:56:10 1993 Stan Shebs (shebs@rtl.cygnus.com) + + * i386lynx.c (swap_std_reloc_in, swap_ext_reloc_in): Ignore + garbage bits appearing in the upper end of symbolnums. + + * config/sparc-lynx.mt (TDEFINES): Add -DFPRINTF_ALREADY_DECLARED. + +Tue Nov 16 17:03:41 1993 Stu Grossman (grossman at cygnus.com) + + * lynx-core.c (lynx_core_file_p): Change bfd_zalloc to bfd_alloc. + * m68klynx.c: Define core file macros. + * hosts/i386lynx.h, hosts/m68klynx.h, hosts/lynx.h: Move all + non-architecture specific stuff into lynx.h. + +Tue Nov 16 15:45:54 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * i386linux.c: Define new macro ZMAGIC_DISK_BLOCK_SIZE to 1024, and + change PAGE_SIZE to 4096. + +Mon Nov 15 11:48:08 1993 Ken Raeburn (raeburn@rtl.cygnus.com) + + * Makefile.in (diststuff): New target. + + * VERSION: Updated. + +Sun Nov 14 23:33:01 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_object_setup): Do not create dummy ".text", ".data", + and ".bss" sections. + (setup_sections): Do not set SEC_HAS_CONTENTS if a section's size + is zero. Recognize BSS type sections and turn off SEC_LOAD and + SEC_DATA (so binutils/size works). Set the correct value for + a section's _raw_size. + (som_slurp_symbol_table): Program entry points, and millicode are + also functions. Mark them as such. Also mark L$* symbols as + debugging symbols. + + * bfd-in2.h: Rebuilt. + +Sat Nov 13 15:27:15 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_reloc_type_lookup): Add missing prototype. Returns + a pointer to constant data. Delete bogus #define which made the + function useless. + + * som.c (som_prep_for_fixups): New function. + (som_write_fixups): New function. + (som_write_space_strings): New function. + (som_write_symbol_strings): New function. + (som_begin_writing): New function. + +Fri Nov 12 15:29:36 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_write_object_contents): Do not abort. Flesh out. + (som_set_section_contents): Do not abort. Flesh out. + + * som.c (som_write_headers): New function. + (som_prep_headers): New function. + (som_build_and_write_symbol_table): New function. + + * som.c (som_sizeof_headers): Add missing prototype. + (som_set_arch_mach): Do not abort. + + * som.c (som_count_spaces): New function. + (som_count_subspaces): New function. + (compare_syms): New function. + (som_compute_checksum): New function. + + * som.c (hppa_som_gen_reloc_type): New function. + (som_bfd_reloc_type_lookup): New function. + + * som.c (try_prev_fixup): New function. + (som_reloc_skip): New function. + (som_reloc_addend): New function. + (som_reloc_call): New function. + + * som.c (som_initialize_reloc_queue): New function. + (som_reloc_queue_insert): Likewise. + (som_reloc_queue_fix): Likewise. + (som_reloc_queue_find): Likewise. + + * som.c (som_hppa_howto_table): SOM howto relocation table. + (hppa_som_reloc): New function. + + * som.c (struct reloc_queue): New structure to keep track of + the last four multibyte relocations emitted. + (enum pa_symbol_type): Type to fully describe the symbol types + associated with .import/.export assembler directives. + + * som.c: Include libhppa.h + + * som.c (bfd_som_set_section_attributes): New function. + (bfd_som_set_subsection_attributes): Likewise. + (bfd_som_set_symboL_type): Likewise. + (bfd_som_attach_unwind_info): Likewise. + * som.h: Declare new exported functions. + + * som.h (struct som_symbol): Add new fields to hold additional + information needed to build/write symbol tables and fixup streams. + (struct som_section_data_struct): Add new fields to hold additional + information needed to build/write space and subspace headers. + (som_symbol_data): New accessor macro for SOM symbol information. + (R_HPPA_*): Basic relocation types to be used by the assembler. + +Fri Nov 12 11:00:28 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * trad-core.c (trad_unix_core_file_p): If new hook + TRAD_CORE_ALLOW_ANY_EXTRA_SIZE defined, then skip the check for the + corefile being too big. + * hosts/i386sco.h: Define it. + +Thu Nov 11 15:16:28 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * bfd.c (struct _bfd): Add hppabsd_core_data. + * targets.c (target_vector): Add hppabsd_core_vec. + * hpux-core.c (hpux_core_core_file_p): Fail if an unknown core + section is encountered during core section scanning. + * hppabsd-core.c: New file. + * config/hppabsd.mh: Enable HPPA BSD core files. + + * elf32-hppa.c (hppa_elf_reloc): Remove DEFUN crud. Remove code + which is either commented out or ifdef'd out. Add, update and + clean comments. Fix various indention and spacing problems. Handle + problems related to using "ble" to jump to a stub rather than "bl" + (%r31 is trashed by "ble", but not by "bl"). + (NEW_INSTRUCTION): Put inside curly braces. + (CURRENT_STUB_OFFSET): Fix indention problems. + (hppa_elf_build_arg_reloc_stub): Fix indention and spacing problems. + Add, update and clean comments. Handle "ble" %r31 lossage problems. + (hppa_elf_build_long_branch_stub): Likewise. + (hppa_look_for_stubs_in_section): Likewise. + (hppa_elf_stub_check): Remove obsolete function. + + * hppa_stubs.h: Add new instructions to deal with %r31 lossage + problems. Delete unused instructions. + +Tue Nov 9 11:40:27 1993 Stan Shebs (shebs@rtl.cygnus.com) + + * m68klynx.c (TARGET_IS_BIG_ENDIAN_P): Define. + +Tue Nov 9 11:26:05 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (elf_object_p): Rather than looking through an array + of architectures, get the ELF EM_xxx code from the backend + information. Let the generic ELF target match any EM_xxx code not + matched by another ELF target. Call elf_backend_object_p to let + the backend do more checks and set global information. + * libelf.h (struct elf_backend_data): Added elf_machine_code and + elf_backend_object_p fields. + (struct bfd_elf_arch_map): Removed. + (bfd_elf_arch_map, bfd_elf_arch_map_size): Don't declare. + * elf32-target.h, elf64-target.h: Initialize elf_machine_code + field with ELF_MACHINE_CODE. Initialize elf_backend_object_p + field with elf_backend_object_p (if it is defined). + * elf32-gen.c, elf32-hppa.c, elf32-i386.c, elf32-i860.c, + elf32-m68k.c, elf32-m88k.c, elf32-mips.c, elf32-sparc.c, + elf64-gen.c (ELF_MACHINE_CODE): Defined. + * elf32-mips.c: Include ecoffswap.h to get ECOFF swapping + routines. + (mips_elf_object_p): Set the right machine number. + (mips_elf_ecoff_debug_swap): Defined. + (elf_backend_object_p): Defined to be mips_elf_object_p. + (elf_backend_ecoff_debug_swap): Defined to be + mips_elf_ecoff_debug_swap. + * elf.c (bfd_elf_arch_map, bfd_elf_arch_map_size): Removed. + + * libbfd-in.h (target_vector, default_vector): Declare. + * libbfd.h: Rebuilt. + * format.c (target_vector, default_vector): Don't declare. + + * elf32-mips.c (elf_mips_howto_table): Don't complain on overflow + for R_MIPS_26. Correct overflow detection requires matching the + upper four bits of the destination against the PC. From Ted Lemon + . + + * bout.c (b_out_reloc_type_lookup): Return type should point to + const data. + * coff-i960.c (coff_i960_reloc_type_lookup): Likewise. + * elf32-hppa.c (elf_hppa_reloc_type_lookup): Likewise. + * mipsbsd.c (MY(reloc_howto_type_lookup)): Likewise. + * coff-i386.c (coff_i386_reloc): Made howto const. + * oasys.c (oasys_write_data): Made how const. + + * libelf.h: Added some comments. + (struct elf_backend_data): Added elf_backend_ecoff_debug_swap + field. Removed unused write_relocs field. + * elf32-target.h: Adjusted elf_backend_data initialization + accordingly. + * elf64-target.h: Corrected elf_backend_data initialization to + fill in all fields and to set elf_64_p to 1. + +Mon Nov 8 18:13:14 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (bfd_section_from_shdr): Remove duplicate assignment + to filepos in SHT_STRTAB case. + (assign_file_position_for_section): Set BFD section filepos as + well as ELF section sh_offset. + + * reloc.c: Use const instead of CONST. + (bfd_perform_relocation): Make variable howto a const pointer. + * bfd-in2.h, libbfd.h: Rebuilt. + +Mon Nov 8 12:19:15 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in (realclean): Don't remove generated headers. Reverts + change of 2 Jul 1993. + +Mon Nov 8 06:08:31 1993 D. V. Henkel-Wallace (gumby@cirdan.cygnus.com) + + * configure.bfd: make unixware equivalent to sysv4. + + * config/i386-nlm.mt: bring in elf config; make it the default. + +Sun Nov 7 20:21:38 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * libbfd.c (bfd_put_8): Add parens around reference to "val" + argument. + +Fri Nov 5 21:45:09 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * hosts/i386mach3.h (HOST_SEGMENT_SIZE), + i386mach3.c (SEGMENT_SIZE, TEXT_START_ADDR): Correct values (?). + +Fri Nov 5 15:17:57 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coffcode.h (coff_write_object_contents): Zero out internal_a. + +Fri Nov 5 10:41:07 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * aoutx.h, archive.c, archures.c, bfd.c, cache.c, coffcode.h, + core.c, ctor.c, format.c, init.c, libbfd.c, opncls.c, reloc.c, + section.c, syms.c, targets.c: + Doc cleanup (spelling, punctuation, grammar, formatting). + * bfd-in2.h, libbfd.h: Rebuild. + +Thu Nov 4 14:46:14 1993 John Gilmore (gnu@rtl.cygnus.com) + + * bfd-in.h (bfd_get_cacheable, bfd_set_cacheable): New accessors. + * bfd.c, opncls.c: Improve comments on file descriptor cacheing. + +Thu Nov 4 08:54:30 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * From Pete Hoogenboom (hoogen@cs.utah.edu) + * elf32-hppa.c (hppa_elf_get_section_contents): Fix logic error + in last change. Always rebuild symbol extension section the first + time though if output sections exist (fixes ld -r problems). + +Thu Nov 04 08:08:46 1993 Jeffrey Wheat (cassidy@cygnus.com) + + * Makefile.in: Add .PHONY for check and installcheck rules. + +Tue Nov 2 14:42:27 1993 Bill Cox (bill@tarkas.cygnus.com) + + * libbfd-in.h (artdata): Use long, not time_t for portability, at + least to HPUX. File below is a derived file. + +Tue Nov 2 14:42:27 1993 Bill Cox (bill@tarkas.cygnus.com) + + * libbfd.h (artdata): Use long, not time_t for portability, at + least to HPUX. + +Tue Nov 2 09:32:25 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.bfd: Use bigmips for mips*-*-bsd*. + +Mon Nov 1 14:30:09 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (elf_slurp_reloca_table, elf_slurp_reloc_table): + Handle symbol number of zero. + + * reloc.c (enum bfd_reloc_code_real): Added + BFD_RELOC_MIPS_LITERAL, BFD_RELOC_MIPS_GOT16, + BFD_RELOC_MIPS_CALL16, BFD_RELOC_MIPS_GPREL32. + * bfd-in2.h: Rebuilt. + * coff-mips.c (mips_bfd_reloc_type_lookup): Handle + BFD_RELOC_MIPS_LITERAL. + * elf32-mips.c (mips_reloc_map): Handle new relocs. + (mips_elf_hi16_reloc, mips_elf_lo16_reloc): Rearrange _gp_disp + checks slightly. + + * aout-target.h (MY_bfd_debug_info_start, MY_bfd_debug_info_end, + MY_bfd_debug_info_accumulat [sic]): Remove unused definitions. + (MY_bfd_get_relocated_section_contents, MY_bfd_relax_section, + MY_bfd_seclet_link): Define. + (MY_bfd_reloc_type_lookup): Rename from + MY_reloc_howto_type_lookup. + (MY_bfd_make_debug_symbol): Rename from MY_make_debug_symbol. + (MY(vec)): Use JUMP_TABLE rather than listing functions. + * hp300hpux.c (MY_get_symtab, MY_get_symtab_upper_bound, + MY_canonicalize_reloc, MY_write_object_contents): Don't define in + terms of MY, because that causes a recusive invocation of CAT when + expanded within JUMP_TABLE, and ANSI compilers don't expand + recursive macros. + * mipsbsd.c (MY_bfd_reloc_type_lookup): Rename from + MY_reloc_howto_type_lookup, and don't define in terms of MY. + (MY_canonicalize_reloc): Don't define in terms of MY. + (aout_mips_little_vec, aout_mips_big_vec): Use JUMP_TABLE rather + than listing functions. + +Mon Nov 1 09:12:25 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.bfd: Use m68k-elf for m68*-*-sysv4*. + +Sun Oct 31 09:35:49 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * targets.c: Move enum target_flavour outside of struct and change + the name to enum bfd_flavour. This means bfd clients can use it. + * bfd-in.h: Add macro bfd_get_flavour. + * bfd-in2.h: Rebuilt. + + * som.c: Add comment about how abort() on corrupt executable is evil. + +Sat Oct 30 12:27:09 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * aoutx.h (aout,slurp_reloc_table): Avoid a goto. + +Fri Oct 29 16:04:33 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * gen-aout.c, libbfd.c: exit(1) instead of exit(-1). + +Fri Oct 29 13:17:21 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * bfd-in.h: Added commands for object file flag values. + * bfd-in2.h: Rebuilt. + * elfcode.h (elf_object_p): If type is ET_DYN, set DYNAMIC flag, + not EXEC_P. + * bout.c, coff-h8300.c, coff-sh.c: Add BFD_IS_RELAXABLE to + object_flags field for target vector. + * aix386-core.c, aout-adobe.c, aout-target.h, bout.c, coff-a29k.c, + coff-alpha.c, coff-apollo.c, coff-h8300.c, coff-h8500.c, + coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c, coff-mips.c, + coff-rs6000.c, coff-sh.c, coff-we32k.c, coff-z8k.c, hpux-core.c, + ieee.c, mipsbsd.c, nlm-target.h, oasys.c, osf-core.c, som.c, + srec.c, tekhex.c, trad-core.c: Remove DYNAMIC from object_flags + field for target vector. + +Thu Oct 28 20:02:31 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * hosts/std-host.h: Don't declare time; causes error on mach3. + * configure.in (i386mach3_vec): Require aout32.o stab-syms.o. + +Thu Oct 28 16:33:26 1993 Stan Shebs (shebs@rtl.cygnus.com) + + LynxOS and Sparc LynxOS changes: + * config.bfd: Recognize sparc-*-lynxos*. + * configure.host: Recognize sparc-*-lynxos*. + * configure.in: Recognize Sparc Lynx vectors. + * targets.c (sparclynx_aout_vec): Declare. + (sparclynx_coff_vec): Declare. + (target_vector): Add them. + * cf-i386lynx.c: New file, renamed from i386lynx-cf.c. + * cf-m68klynx.c: New file, renamed from m68klynx-cf.c. + * cf-sparclynx.c: New file, support for coff in Sparc LynxOS. + * coff-sparc.c: New file, basic Sparc coff support. + * sparclynx.c: New file, support for a.out in Sparc LynxOS. + * Makefile.in: Change filenames appropriately, add Sparc rules. + * coffcode.h (coff_set_arch_mach_hook): Recognize Sparc magic + number. + (coff_set_flags): Use LynxOS magic number for i386, m68k, and + Sparc LynxOS, set Sparc magic number for Sparcs. + * config/m68k-lynx.mt (SELECT_VECS): Remove redundant vector. + * config/sparc-lynx.mt: New file. + * hosts/i386lynx.h: Cosmetic improvements. + * hosts/m68klynx.h: Add ifdefs, #define of cfree. + * hosts/sparclynx.h: New file. + +Thu Oct 28 16:23:40 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + gcc -Wall lint: + * coff-h8300.c (h8300_reloc16_estimate): Declare return type. + Remove useless statement probably left by code copy. + * cpu-i960.c (compatible): Fully bracket matrix initializer. + * elf32-hppa.c (hppa_elf_build_arg_reloc_stub): Use bfd_xmalloc + rather than xmalloc. Use realloc and check the return value + rather than xrealloc. + (hppa_elf_get_section_contents): Add some casts. + * elf32-i386.c (elf_i386_reloc_type_lookup): Remove unused + variable. Add default case to switch. + * hp300hpux.c: Declare aout_32_write_syms. + * i386bsd.c, i386linux.c, netbsd386.c (N_SHARED_LIB): Define as 0 + (definition from aout/aout64.h is always 0 anyhow). + * i386lynx.c (swap_std_reloc_in): Remove unused variable. + * ieee.c (ieee_write_id): length can never be negative. + (read_id): Likewise. + (ieee_archive_p): Remove unused variable. + * libcoff-in.h (bfd_perform_slip): Declare. + * libcoff.h: Rebuilt. + * oasys.c (oasys_write_sections): Remove zero initialization of + static structure. + * reloc16.c: Indentation change. + +Wed Oct 27 16:51:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * configure.in, config/i386-mach3.mt: Update for new configuration + (--with-targets and so on). + * hosts/i386mach3.h: Declare errno. + * targets.c: Declare i386mach3_vec. + +Wed Oct 27 12:18:07 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmcode.h (nlm_swap_auxiliary_headers_in, + nlm_swap_auxiliary_headers_out): Handle sharedDebugRecordOffset + and sharedDebugRecordCount fields. + +Tue Oct 26 16:21:12 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * targets.c (target_vector): Remove SCO_CORE. On Sep 11 1993, + we started using trad-core.c for SCO instead. + + * targets.c (target_vector): Re-enable generic ELF and NLM targets. + +Tue Oct 26 16:53:12 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (assign_file_position_for_section): Align sh_offset to + sh_addralign (this is what UnixWare does, and it shouldn't hurt). + +Tue Oct 26 10:16:54 1993 Ken Raeburn (raeburn@cygnus.com) + + From Jeff Law and Pete Hoogenboom at Utah: + + * elf32-hppa.h (hppa_elf_stub_finish): Add prototype. + (ELF32_HPPA_R_ARG_RELOC): Renamed without the ELF32 prefix + and moved into libhppa.h. All references changed. + (ELF32_HPPA_R_CONSTANT, ELF32_HPPA_R_ADDEND): Likewise. + (get_opcode and opcode defines): Move into libhppa.h + * elf32-hppa.c (hppa_elf_insn2fmt): Rename and move info + libhppa.h. + * libhppa.h (HPPA_R_*): Moved here. Reformatted slightly to make + for easier reading. + (get_opcode): Moved here. FIXME! this really should be a C function + inside the opcode library! + (bfd_hppa_insn2fmt): Likewise. + + * targets.c (target_vector): Enable elf32-hppa vector. + + * elf32-hppa.c (hppa_elf_get_section_contents): Add new comments + and clarify existing comments. Do not use DEFUN to declare this + function. Fix numerous indention problems. Correctly handle cases + where symbol extension section may need to be read from disk, + read from memory, or built then read from memory. + + * elf32-hppa.h: Reformat with gnu-indent and hand fix numerous + formatting and indention problems gnu-indent can not handle. + Clarify some comments about relocation types. Comment basic + relocation "classes". Group PARAM declarations together. + (HPPA_SXT_{NULL, SYMNDX, RG_RELOC}): Make members of a new + enumerated type rather than #defines. + +Tue Oct 26 02:40:46 1993 Stu Grossman (grossman at cygnus.com) + + * som.c (hppa_object_setup): Set SEC_CODE for .text section so + that GDB can figure out text_start and text_end. + +Mon Oct 25 16:05:23 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Fix up warnings from gcc -Wall: + * coffgen.c (coff_print_symbol): Use %lx and cast n_value to + unsigned long. Use %ld for tagndx. Use %lx for offset + vma and + cast it to unsigned long. + * ecoff.c (ecoff_emit_aggregate): Use %ld. + (ecoff_print_symbol): Use %ld, and cast indx and sym_base to long. + * coffcode.h (dummy_reloc16_estimate): Specify return type. + + * libbfd.c (bfd_write): If not everything is written out, set + bfd_error to system_call_error. If the return value is + non-negative, set errno to ENOSPC (if ENOSPC is defined). + (bfd_seek): If the seek fails, set bfd_error to system_call_error. + (bfd_generic_set_section_contents): For a bad offset + count, set + bfd_error to bad_value. + * seclet.c (rel): Don't abort. Instead, return false. + +Mon Oct 25 09:59:37 1993 Ken Raeburn (raeburn@cygnus.com) + + * aoutx.h (reloc_type_lookup): Handle BFD_RELOC_SPARC_WDISP22. + +Fri Oct 22 20:35:54 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * config.bfd: handle mips*-* instead of mips-*, use mips*el + instead of mips-*-*l + +Fri Oct 22 14:03:33 1993 Mark Eichin (eichin@cygnus.com) + + * m68k-lynx.mt, i386-lynx.mt (TDEFINES): set + FPRINTF_ALREADY_DECLARED because the objdump.c declaration of + fprintf collides with the native one. + +Fri Oct 22 11:50:25 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * targets.c (target_vector): Enable MIPS ELF vectors. + +Fri Oct 22 07:51:51 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.bfd: Use bigmips for mips-sony-bsd*. + + * configure.host, config.bfd: Add * to end of all OS names. + +Thu Oct 21 12:16:26 1993 Ken Raeburn (raeburn@cygnus.com) + + * elfcode.h (FILE_ALIGN): Renamed from EALIGN, to avoid conflict + with Ultrix header files. + + * som.h (struct som_section_data_struct): Renamed from + som_section_data to avoid conflict with macro by that name. + + Changes from Jeff Law and Peter Hoogenboom at Utah: + + * elf32-hppa.c (hppa_elf_reloc): Target register for a 'jump + in delay slot' optimization in combination with a long call + stub should always be r31. + + * elf32-hppa.c: (hppa_elf_relocate_insn): To be consistent + across all relocation types, retrieve instruction addends from + the relocation entry rather than from the instruction itself. + + * elf32-hppa.c: (hppa_elf_relocate_insn): Fix a relocation + error that only occurred when the addend of an 'addil' or + 'ldil' was larger than 21 bits and very close to a 2K byte + boundary. + + * elf32-hppa.c: (hppa_elf_reloc): Handle the optimization in + which a jump is placed in the delay slot of a function call. + The jump was being accomplished via an adjustment to the + return pointer. This optimization would break the long call + stub code, if there was any. + + * elf32-hppa.c: (hppa_elf_build_long_branch_stub): Corrections + to long branch stubs to avoid use of general register 2. + + * hppa_stubs.h: New stub instructions. + + * elfcode.h: Declare bfd_elf_find_section. + + * som.h (som_section_data): Add new "subspace_index" field. + + * som.c (setup_sections): Save the original SOM subspace index + in the BFD section associated with that subspace. + (som_get_symtab_upper_bound): Implement. + (som_get_symtab): Implement. + (som_print_symbol): Implement. + (som_slurp_string_table): New function to read a string table + from a SOM object file. + (som_section_from_subspace_index): New function to return the + section which corresponds to a SOM subspace index. + (som_slurp_symbol_table): New function to read the symbol + table from a SOM object file. + (som_make_empty_symbol): Check for errors from bfd_zalloc. + (som_new_section_hook): Initialize subspace_index field to + -1 instead of 0. + + * som.c (som_object_setup): Fix polarity of test to set HAS_RELOC. + Set EXEC_P for executables. + (setup_sections): Correctly identify when a section has + relocations. + (log2): New function. + (setup_sections): Correctly convert between SOM alignments and BFD + alignments. + + * som.c (setup_sections): Do not set SEC_ALLOC or SEC_LOAD + for sections which correspond to SOM spaces, doing so confuses + many utilities. Set assorted SEC_* flags for SOM subspaces + which correspond to BFD sections. + + * elf32-hppa.c: (elf32_hppa_backend_fake_sections): The stab + string table should have sh_type == SHT_STRTAB. Add + processing to make it so. + + * elfcode.h: (bfd_section_from_shdr): String tables (other + than .strtab) were not getting the file offsets recorded, so + they could not be read from disk. + + * elfcode.h: (elf_make_sections): Leave the sh_addr field of + the section header and the vma field of a section at 0 if the + section is not part of the program execution image. (e.g., + .stab) + + * som.[hc]: Change target vector prefix from "hppa" to "som". + Consistently use obj_som prefix to access fields in backend data + structures. Fix all callers/references. + + * som.h: Do not include files only needed for core file reading here. + Include a.out for both HOST_HPPAHPUX and HOST_HPPABSD. Delete + forward structure declarations, they are unnecessary. + (struct somdata): Delete aux_hdr, and hp_symbol_entry_size fields. + Change "symbols" to "symtab". Add "stringtab" and "reloc_filepos" + fields for future use. Change obj_som_* macros as appropriate. + (som_section_data): New structure to keep SOM specific information + about BFD sections (for future use). + + * som.c: Provide PARAMS declarations for all functions currently + in this file. + (struct container): Delete unwanted structure definition. + (som_object_setup): Add comments. Use som_mkobject to allocate + SOM specific information in the BFD; use information from the + file and (possibly empty) auxiliary headers to initialize this + information. Delete redundant bfd_get_symcount (abfd) "calls". + (setup_sections): Return type is now boolean, fix return statements. + "Fix" handling of BSS like subspaces in the computation of the + containing space's size. If the subspace has relocations, set the + appropriate BFD section flags and record the index into and the + size of the fixup stream. Always return a value. + (som_object_p): Set bfd_error appropriately if errors are detected + from bfd_{read,seek} functions. Handle EXECLIBMAGIC type files. + Do not try to read a non-existant auxiliary header. + (som_mkobject): Flesh out. + (som_section_hook): Allocate space to hold SOM specific information + about sections. + +Thu Oct 21 12:41:34 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + gcc -Wall lint: + * coff-h8300.c, coffcode.h: Change shrink parameter + in *_reloc16_estimate to unsigned to match prototype. + * archive.c: Avoid "/*" in comment. + +Thu Oct 21 13:05:16 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * dep-in.sed: Create our own line breaks for a more aesthetic + Makefile. + * Makefile.in: Rebuilt dependencies. + + * elf32-mips.c: Include "seclet.h". + (mips_elf_fake_sections): Force size of .reginfo section to sizeof + Elf32_External_RegInfo. + (mips_elf_seclet_link): New function. Link the .reginfo section + specially, and pass everything else to the generic routine. + (bfd_elf32_bfd_seclet_link): Define macro. + * elf32-target.h: If bfd_elf32_bfd_seclet_link is already defined, + don't override it. + +Wed Oct 20 12:22:37 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libnlm.h (nlm_backend_data): Added signature field. + (nlm_signature): New macro. + * nlmcode.h (nlm_object_p, nlm_write_object_contents): Use the NLM + signature from the backend rather than the constant NLM_SIGNATURE. + * nlm32-i386.c (nlm32_i386_backend): Initialize signature field. + + * aoutf1.h (MACHTYPE_OK): Accept M_UNKNOWN. + (NAME(sunos,set_arch_mach)): Treat M_UNKNOWN as 68000, not 68020. + +Wed Oct 20 10:28:27 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hosts/i386bsd.h [__bsdi__]: Define HOST_DATA_START_ADDR. + +Wed Oct 20 10:10:07 1993 Ken Raeburn (raeburn@cygnus.com) + + * Makefile.in (HFILES): New variable, for use in "make dep". + (.dep): Depend on $(CFILES) and $(HFILES). Delete .dep1 and + remake it, so that "$?" is complete. + (.dep1): Don't need to remove .dep1 first. + (dep.sed): Depend on config.status, not Makefile. + (CFILES): Add nlm.c. + +Tue Oct 19 15:26:26 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-alpha.c: Implemented reloc handling for the linker, made + various other related changes. + * libecoff.h (ecoff_backend_data): Added rdata_in_text field. + Renamed finish_reloc to adjust_reloc_in. Added adjust_reloc_out + field. + (ecoff_bfd_get_relocated_section_contents): Don't define. + * ecoff.c (ecoff_sec_to_styp_flags, ecoff_styp_to_sec_flags): + Handle .lita section. + (ecoff_slurp_reloc_table): Handle RELOC_SECTION_FINI. + finish_reloc backend field renamed to adjust_reloc_in. + (ecoff_bfd_seclet_link): Adjust number of aux entries to + debug_align boundary. + (ecoff_compute_section_file_positions): If rdata_in_text put + .rdata section in text segment, not data segment. Put .pdata + section in text segment. + (ecoff_write_object_contents): Likewise. Also, call + adjust_reloc_out, and handle .lita, .xdata, .pdata, .fini and + absolute sections when writing out relocs. + * coffswap.h (coff_swap_aouthdr_out): For ALPHAECOFF, output 2 for + bldrev field, as on Alpha OSF/1. Padding field is now 2 bytes. + * coff-mips.c (mips_ecoff_swap_reloc_out): Added assertion. + (mips_adjust_reloc_in): Renamed from mips_finish_reloc. + (mips_adjust_reloc_out): New function (does nothing). + (mips_ecoff_backend_data): Initialize new fields. + (ecoff_bfd_get_relocation_section_contents): Define to be + bfd_generic_get_relocated_section_contents. + + * reloc.c (bfd_perform_relocation): Added casts to avoid Alpha + OSF/1 cc bug. + +Thu Oct 14 01:10:35 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * reloc.c (bfd_perform_relocation): Add comments attempting to + explain PC relative relocations. + + * coffcode.h (styp_to_sec_flags): Don't set SEC_DEBUGGING until it + is made to work. + (coff_compute_section_file_positions): Remove check for + USE_DISCARDED_SECTIONS_COUNT. + * coff-i386.c: Don't define USE_DISCARDED_SECTIONS_COUNT. Basing + it on host defines is wrong. + + * ecoff.c (ecoff_bfd_seclet_link): Don't link a .reginfo section. + (ecoff_write_object_contents): Don't require the .reginfo section + to be a particular size. + +Wed Oct 13 18:39:03 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * Makefile.in (dep-in): New rule, for editing dependencies into + Makefile.in in $(srcdir). Use move-if-change. + (.dep1, dep): Use move-if-change. + (CFILES): Add coff-apollo.c. + + Sun Oct 10 18:02:56 1993 Troy Rollo (troy@cbme.unsw.EDU.AU) + + * Makefile.in: Recognise new file, coff-apollo.o + + * coff-apollo.c: New file + + * coffcode.h: Recognise apollo magic numbers and writable text + + * coffswap.h: Swap Apollo optional header entries + + * config.bfd: Add line for Apollo + + * configure.host: Replace apollo68b and apollo68v with Apollo + + * configure.in: Recognise apollocoff_vec + + * targets.c: Likewise + + * config/apollo.mh, config/apollo.mt: New files + + * hosts/apollo68.h: Remove inclusion of strings.h + +Wed Oct 13 14:28:17 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * coff-i386.c (i3coff_object_p): Now static. + + * Makefile.in: Updated dependencies. + (.dep, .dep1, dep.sed): New targets, to make "make dep" work + better. + * dep-in.sed: New file. + + * m68klynx-cf.c (ONLY_DECLARE_RELOCS): Define, to avoid name + conflicts when "--with-targets=all". + * coff-m68k.c (m68kcoff_howto_table, m68k_rtype2howto, + m68k_howto2rtype): Rename via macros to keep namespace clean. + * configure.in: For m68klynx_coff_vec, include coff-m68k.o for + now. + +Tue Oct 12 17:03:27 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elf32-mips.c: Extensive additions to do relocations and to + handle MIPS specific sections. + * libelf.h (elf_backend_data): Pass fourth argument to + elf_backend_section_from_bfd_section to permit it to control the + section index to use. + (elf_obj_tdata): Add gp and gp_size fields. + (elf_gp, elf_gp_size): New accessor macros. + * elfcode.h: Removed a number of unused local variables. + (elf_fake_sections): Clear section header before calling + elf_backend_fake_sections, not after. + (prep_headers): Return true at end. + (elf_section_from_bfd_section): Pass retval argument to + elf_backend_section_from_bfd_section. + * elf32-hppa.c (elf32_hppa_backend_section_from_bfd_section): + Accept and ignore new retval argument. + * bfd.c: Include libelf.h. + (bfd_set_gp_size): Handle ELF targets. + * Makefile.in (bfd.o): Depends upon libelf.h. + (elf32-mips.o): Depends upon $(INCDIR)/elf/mips.h. + +Mon Oct 11 17:25:18 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_mkobject): Check bfd_make_section return value. + (ecoff_mkobject_hook): New function. + (ecoff_new_section_hook, ecoff_sizeof_headers, + ecoff_compute_section_file_positions, ecoff_set_section_contents, + ecoff_write_object_contents): Handle dummy REGINFO section. + (ecoff_get_section_contents): New function to handle reading + REGINFO section. + * libecoff.h (ecoff_get_section_contents): Change from macro + definition to function prototype. + (ecoff_mkobject_hook): New prototype. + * coff-alpha.c (alpha_ecoff_mkobject_hook): Removed. + (alpha_ecoff_backend_data): Use ecoff_mkobject_hook. + * coff-mips.c (mips_ecoff_mkobject_hook): Removed. + (mips_ecoff_backend_data): Use ecoff_mkobject_hook. + +Fri Oct 8 15:25:33 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * libbfd.c (bfd_get*32, bfd_get*64): Prevent ANSI sign extension + by casting the most significant byte to bfd_vma. + +Fri Oct 8 02:34:21 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * configure.in: Do not define SELECT_VECS, SELECT_ARCHITECTURES + if configuring --with-targets=all. + +Thu Oct 7 17:34:07 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * aoutx.h (howto_table_std): Correct the "size" field in some + entries. + + * reloc.c (reloc_howto_type): Change documentation to dispel any + notion that the "size" field is a power-of-two indicator. + +Thu Oct 7 10:50:38 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * coffswap.h: (bfd_swap_reloc_in): a symndx is signed. + + Make support for relaxing more generic. + * reloc16.c: Add new target entry - bfd_coff_reloc16_estimate, + fix bit rot. + * libcoff.h, libcoff-in.h: declarations. Prototypes + * coffcode.h (bfd_coff_std_swap_table): Add calls to + coff_reloc_16_extra_cases and coff_reloc16_estimate. + (dummy_reloc16_estimate): New function. + * coff-h8300.c (h8300_reloc16_estimate): New function + +Thu Oct 7 14:24:13 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elfcode.h (EALIGN): Define, dependent on ARCH_SIZE. + (align_file_position): New function. + (elf_locate_sh): Disabled function deleted. + (assign_file_positions_for_symtab_and_strtabs): Align position, + then place symtab, then do other sections. + (map_program_segments): Align program header. + (assign_file_positions_except_relocs): Align section headers. + (assign_file_positions_for_relocs): Align relocation sections. + +Tue Oct 5 10:44:32 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * configure.host: Recognize hppa*-*-hiux* (currently synonym for hpux). + Change other hppa entries to use -*- not -hp-. + * config.bfd: Recognize hppa*-*-hiux* (currently synonym for hpux). + + * coff-rs6000.c, cpu-rs6000.c, rs6000-core.c: Change non-ASCII + characters in comment to octal escapes. + +Sun Oct 3 12:35:15 1993 Stan Shebs (shebs@rtl.cygnus.com) + + * coff-i386lynx.c: Removed, name too long. + * i386lynx-cf.c: New file, was coff-i386lynx.c. + * configure.in: Reflect file name changes. + * Makefile.in: Mention Lynx-related files. + + * i386lynx.c (lynx_32_swap_ext_reloc_in): get reloc bits in i386 + Lynx-specific way. + + * m68klynx-cf.c: New file, defines coff format for M68K LynxOS. + * m68klynx.c: Remove coff vector definition, now in m68klynx-cf.c. + + * coffcode.h (sec_to_styp_flags): Set section flag to STYP_INFO + for .stab, .stabstr and .debug sections, and set SEC_DEBUGGING for + sections of type STYP_INFO. (from Minh Tran-Le) + (coff_compute_section_file_positions): Add discarded_sections_count + to abfd->section_count, which helps `strip' keep the size + of the executable header constant. + * coff-i386.c (discarded_sections_count): New variable, initialized + to zero. For use by `strip'. Currently being used only in aix386 + coff, but may be useful for other coff systems. (from Minh Tran-Le) + + * coffswap.h (coff_swap_filehdr_out): Added a missing cast. + + * archive.c: Cosmetic improvements. + * opncls.c: Cosmetic improvements. + (new_bfd): Removed redundant structure slot init. + +Sat Oct 2 18:48:17 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config/news-mips.mh, hosts/news-mips.h: New files. + * configure.host: Use news-mips for mips-sony-bsd*. + +Fri Oct 1 13:14:17 1993 Stan Shebs (shebs@rtl.cygnus.com) + + * configure.in: i386lynx_coff_vec requires coff-i386lynx.o. + * coff-i386lynx.c: New file, defines Lynx target vector and name, + includes coff-i386.c. + * coff-i386.c (i386coff_vec): Allow redefinition of target vector + symbol and name, if TARGET_SYM and/or TARGET_NAME are defined. + * i386lynx.c: Remove coff vector definition entirely. + (lynx_32_swap_ext_reloc_in): Define. + (lynx_32_swap_std_reloc_in): Define, get reloc bits in i386 + Lynx-specific way. + (lynx_32_swap_ext_reloc_out): Define. + (lynx_32_swap_std_reloc_out): Define. + (lynx_32_slurp_reloc_table): Define, call Lynx swapping fns. + (lynx_32_squirt_out_relocs): Define, call Lynx swapping fns. + (lynx_32_canonicalize_reloc): Define, call Lynx swapping fns. + (WRITE_HEADERS): Define, call Lynx swapping fns. + + * config/i386-lynx.mt (SELECT_VECS): Remove redundant vector. + +Thu Sep 30 17:50:52 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * reloc.c (bfd_reloc_code_type): Add linkage-table relative + relocations of size 8, 16, 32. Sort generic relocs by type rather + than size. Added a little documentation too. + + * aoutx.h (howto_table_std): Add BASE16 and BASE32 relocs. + (TABLE_SIZE): New macro. + (reloc_type_lookup): Handle BFD_RELOC_{16,32}_BASEREL for std + relocs. + (swap_std_reloc_out): Write baserel relocs correctly. + (swap_std_reloc_in): Handle r_baserel field. Assert that + r_jmptable and r_relative fields are clear, and that the computed + index does refer to a defined entry of the howto table. + +Tue Sep 28 14:47:46 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * section.c (bfd_make_section_anyway): New function. + * section.c: Change comments to say several sections can have + the same name. + * bfd-in2.h: Re-generate to reflect above change. + * coffgen.c (make_a_section_from_file): Call bfd_make_section_anyway + if still no section after the bfd_coff_make_section_hook. + * coffcode.h: Add comment about TWO_DATA_SECS. + +Tue Sep 28 03:22:24 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * ecoff.c (ecoff_slurp_symbolic_info): Always determine raw_size + explicitly. + * ecoff.c (ecoff_sec_to_styp_flags, ecoff_styp_to_sec_flags): Handle + .fini section. + +Mon Sep 27 18:29:18 1993 Stan Shebs (shebs@rtl.cygnus.com) + + * config.bfd configure.host: Match on *-lynxos* for LynxOS, + add m68*-*-lynxos*. + * configure.in : Replaced i386lynx_vec with i386lynx_aout_vec + and i386lynx_coff_vec. + Added m68klynx_aout_vec and m68klynx_coff_vec. + * targets.c (target_vector): Removed i386lynx_vec, added + {i386,m68k}lynx_{aout,coff}_vec. + * i386lynx.c: Added copy of i386coff.c, renamed bfd target to + i386lynx_coff_vec. + * m68klynx.c: New file. + * config/i386-lynx.mt: Replaced i386lynx_vec with i386lynx_aout_vec + and i386lynx_coff_vec. + * config/m68k-lynx.mt: New file. + * hosts/i386lynx.h: Added definition of cfree as free (from Eichin). + * hosts/m68klynx.h: New file. + +Mon Sep 27 18:00:41 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * archive.c: Define offsetof here. + * hosts/*.h: Don't define it here. + +Mon Sep 27 19:09:27 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (bfd_section_from_shdr): Set filepos for SHT_STRTAB + section. + +Fri Sep 24 15:47:40 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hpux-core.c: Add comment about hpux version 7. + +Fri Sep 24 16:50:26 1993 Stu Grossman (grossman at cygnus.com) + + * lynx-core.c (lynx_core_file_p): Change per-thread register + section names from .regXXX to .reg/XXX to avoid parsing ambiguity + in gdb/corelow.c. Create alias .reg section for the currently + running thread. + +Fri Sep 24 13:22:32 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libecoff.h (ecoff_backend_data): Removed big_magic and + little_magic fields. + * coff-alpha.c (alpha_ecoff_backend_data): Removed initialization + of big_magic and little_magic. + * coff-mips.c (mips_ecoff_bad_format_hook): Make sure magic number + matches endianess of bfd. + (mips_ecoff_backend_data): Removed initialization of big_magic and + little_magic. + * ecoff.c (ecoff_set_arch_mach_hook): Set MIPS machine number + based on magic number. Support r4000 magic numbers. + (ecoff_get_magic): New function. + (ecoff_write_object_contents): Use ecoff_get_magic, not fields in + the backend structure. + * cpu-mips.c (arch_info_struct): Added case for r6000. + + For MIPS configurations put both big and little endian versions in + the list of targets; the code is getting compiled in anyhow. + * bigmips.mt (SELECT_VECS): Define to be ecoff_little_vec. + * decstation.mt (SELECT_VECS): Define to be ecoff_big_vec. + * mipsbelf.mt (SELECT_VECS): Define to be bfd_elf32_littlemips_vec. + * mipslelf.mt (SELECT_VECS): Define to be bfd_elf32_bitmips_vec. + * riscos.mt (SELECT_VECS): Define to be ecoff_little_vec. + +Fri Sep 24 00:42:23 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * osf-core.c: New file for OSF/1 core file support. + * config/alphaosf.mh (HDEFINES): Add -DOSF_CORE. + (HDEPFILES): Set to osf-core.o. + * bfd-in2.h (union tdata): Add osf_core_data member. + * targets.c: If OSF_CORE is defined, add osf_core_vec to target list. + * Makefile.in (OPTIONAL_BACKENDS): Add osf-core.o. + (osf-core.o): New dependency. + +Thu Sep 23 21:04:53 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * TODO: Remove note about making --with-bfd-targets use canonical + target configuration name (already done); reword item about + separating reading and writing stuff to not refer to a + non-existent item. + + * ecoff.h (ecoff_set_arch_mach_hook): Accept MIPS_MAGIC_LITTLE2 + and MIPS_MAGIC_BIG2. + +Thu Sep 23 11:06:34 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * gen-aout.c (main): Output newline after end of comment, not + before. (Reported by Jonathan Stone, + jonathan@oscar.stanford.edu). + +Thu Sep 23 10:48:27 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * archive.c (compute_and_write_armap): Put weak symbols in the + armap. + + * elfcode.h (fix_up_strtabs): Set sh_entsize for the .stab + section, not the .stabstr section. Set the type of the .stabstr + section to SHT_STRTAB. + (elf_section_from_bfd_section): Handle SHT_STRTAB sections. + + * section.c (SEC_DEBUGGING): New section flag. + * elfcode.h (bfd_section_from_shdr): If section is SHT_PROGBITS, + and the name starts with .debug, .line or .stab, set + SEC_DEBUGGING. If SHT_STRTAB, check for .debug and .stab. + * elf32-target.h (TARGET_BIG_SYM, TARGET_LITTLE_SYM): Added + SEC_DEBUGGING to section_flags. + * elf64-target.h (TARGET_BIG_SYM, TARGET_LITTLE_SYM): Added + SEC_DEBUGGING and SEC_CODE to section_flags. + * bfd-in2.h: Updated. + +Wed Sep 22 16:34:14 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * bfd.c (tdata): Add lynx_core_data. + + * ecoff.c (ecoff_compute_section_file_positions): Set filepos for + sections with SEC_LOAD set, even if SEC_HAS_CONTENTS is clear. + (ecoff_write_object_contents): Don't set scnptr to zero just + because size of section is zero. Needed for Irix 4.0.5F. + +Wed Sep 22 09:49:32 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.bfd: Use i960-bout, not i960-coff for i960-*-nindy*. + +Wed Sep 22 07:34:09 1993 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (OPTIONAL_BACKENDS): Add lynx-core.o. + * bfd-in2.h (tdata): Add lynx_core_data; + * config.bfd configure.host: Get rid of superfluous netbsd and + lynxos entries. + * configure.in: Add lynx-core.o to Lynx config. + * i386lynx.c: Add defs for core file support. + * lynx-core.c: New file with Lynx core file support. + * hosts/i386lynx.h: Move lots of host specific includes to here. + Add def of HOST_LYNX. Remove unnecessary defs. + +Mon Sep 20 19:18:10 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (bfd_section_from_shdr): Only set SEC_DATA for a + SHF_PROGBITS or SHT_STRTAB section if SEC_ALLOC is set. Never set + SEC_DATA for a SHF_NOBITS section. + + * nlm32-i386.c (nlm_i386_mangle_relocs): Check SEC_LOAD rather + than SEC_CODE | SEC_DATA. Add some casts to avoid warnings. + * nlmcode.h: Add some casts to avoid warnings. + (nlm_write_object_contents): Ignore relocs for sections that are + neither code nor data. Just use the symbol value for debugging + symbols; don't offset by the section vma. + +Fri Sep 17 18:08:55 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * reloc.c (bfd_perform_relocation): Don't return an error when + performing a reloc against an undefined weak symbol. + * syms.c (bfd_print_symbol_vandf): Show value of BSF_WEAK rather + than obsolete BSF_EXPORT. + +Fri Sep 17 02:04:31 1993 John Gilmore (gnu@cygnus.com) + + * hosts/{alphaosf.h, amix.h, apollo68.h, apollov68.h, + decstation.h, delta88.h, dgux.h, dose.h, go32.h, harris.h, + hp300.h, hp300bsd.h, hppabsd.h, hppahpux.h, i386aix.h, i386bsd.h, + i386linux.h, i386lynx.h, i386v.h, i386v4.h, irix3.h, irix4.h, + mipsbsd.h, ncr3000.h, rs6000.h, rtbsd.h, solaris2.h, sparc-ll.h, + std-host.h, stratus.h, sun3.h, sysv4.h, tahoe.h, ultra3.h, + vaxult.h, vaxult2.h, we32k.h}: Make sure that "offsetof" is + defined on all hosts, now that archive.c uses it. + +Thu Sep 16 18:20:30 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (elf_map_symbols): Create section symbols for all + sections, not just allocated sections; debugging sections can have + relocs. + (elf_symbol_from_bfd_symbol): If there is an output section, use + the section index from that rather than the input section. + +Thu Sep 16 12:20:50 1993 Ken Raeburn (raeburn@cygnus.com) + + * libbfd-in.h (bfd_flush, bfd_stat): Reflect John's changes to + libbfd.h, which is regenerated from this file. + + * bfd-in.h (symtype): Deleted typedef. + +Wed Sep 15 11:48:37 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libbfd.c (COERCExx): Cast x to bfd_signed_vma before doing the + xor and subtract. Otherwise it will not sign extend if the type + of bfd_vma is larger than int. + + * ecoffswap.h (ecoff_swap_pdr_in): Get regoffset, iopt, fregoffset + and frameoffset as signed numbers. From Peter Schauer. + +Tue Sep 14 18:20:36 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elf32-i386.c (elf_howto_table): Add bfd_elf_generic_reloc + special function for all reloc entries. + * elf32-target.h (TARGET_LITTLE_SYM): Add SEC_CODE to + section_flags. + * libelf.h (elf_symbol_type): Remove desc, type and other fields. + * Makefile.in (elf32-*.o): These depend upon elf32-target.h. + +Tue Sep 14 14:34:45 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * libbfd-in.h (struct artdata): Add armap_timestamp and + armap_datepos here too. + +Mon Sep 13 21:03:18 1993 John Gilmore (gnu@cacophony.cygnus.com) + + Improve timestamp support in BSD archive files to avoid linker + warnings. + + * libbfd.h (struct artdata): Add armap_timestamp and armap_datepos. + (bfd_flush, bfd_stat): Add prototypes. + * libbfd.c (bfd_flush): Add, does fflush on a BFD. + (bfd_stat): Add, does fstat on a BFD. + + * archive.c (_bfd_write_archive_contents): At end of file writing, + verify and possibly update the timestamp in the armap, if a BSD + archive. FIXME! Kludge recognizes BSD archive, rather than + vectoring properly. Should add to xvec. + (compute_and_write_armap): Move prototype to top, avoid PROTO. + (bsd_write_armap): Save timestamp and file location thereof, when + writing the armap in a BSD file. + (bsd_update_armap_timestamp): New function to check and + rewrite the timestamp. + + * hosts/std-host.h (offsetof): Define, if not already, for archive.c. + +Sat Sep 11 18:13:42 1993 Jim Kingdon (kingdon@poseidon.cygnus.com) + + * hosts/i386sco.h: Define a bunch of stuff for core files. + * sco-core.c: Remove, replace by trad-core.c. + * trad-core.c: If HOST_STACK_START_ADDR is defined, use it. + * config/i386sco.mh: Use trad-core not sco-core. + * hosts/i386isc.h, config/i386isc.mh: Remove. + * configure.host: Use i386sco for isc. + * config/i386-sco.mt: Remove, identical to i386-coff.mt. + * config.bfd: Use i386-coff not i386-sco. + + * config.bfd: Recognize i[34]86-*-solaris2* specifically rather + than using *-*-solaris2* (i486-unknown-solaris2 is i386-elf, not + i486-elf which doesn't exist). + +Fri Sep 10 12:56:36 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coffswap.h (coff_swap_aouthdr_out): For ALPHAECOFF, force + padding field to zero. + + * config.bfd (i[34]86-*-netbsd*): New target; use i386-netbsd. + * configure.in: Remove bogus netbsd386 handling. + + * coff-mips.c: Don't warn about overflow for MIPS_R_JMPADDR reloc. + Correct overflow detection requires matching the upper four bits + of the destination against the PC. + +Thu Sep 9 16:57:46 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * configure.in: Make 64-bit stuff work with "--with-targets=all". + +Tue Sep 7 14:17:02 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libbfd-in.h: Removed swapping routines declarations. + * bfd-in.h: Added swapping routine declarations, and renamed them + from _do_* to bfd_*. + * libbfd.c: Renamed swapping routines from _do_* to _bfd_*. + * Changed all callers. + * libbfd.h, bfd-in2.h: Rebuilt. + +Mon Sep 6 15:28:07 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elf32-i386.c (elf_howto_table): Set pcrel_offset to true for + R_386_PC32. + +Fri Sep 3 13:06:12 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * configure.in: Reorganized setting of makefile variables so + 64-bit stuff works again. + + * libbfd-in.h (_do_get*, _do_put*): Renamed via macros to clean up + namespace. + + * libelf.h (elf32_symbol_type, elf64_symbol_type): Deleted + "native_elf_sym" field, merged to make new type "elf_symbol_type". + (struct elf_obj_tdata): Field symbols is now elf_symbol_type*. + Deleted field raw_syms. + (obj_symbols): Remove cast. + (obj_raw_syms): Deleted. + * elfcode.h (elf_slurp_symbol_table): Don't set raw_syms or + native_elf_sym fields. + * elf32-hppa.c: Changed uses of elf32_symbol_type to + elf_symbol_type. + + From Pete Hoogenboom and Jeff Law: + + * elf32-hppa.c (ELF_MAXPAGESIZE): Define. + + * elf32-hppa.c (elf_hppa_tc_symbol): If the argument relocation + bits are zero (e.g., they specify no relocations), then do not + even bother adding their entries to the symextn section. + + * elf32-hppa.c (elf_hppa_tc_symbol): Any function, regardless + of scope can have an argument relocation stub. + + * elf32-hppa.c: (Elf32_hppa_Stub_description): Rename this + structure and type to elf32_hppa_stub_description. This makes + it consistent with the GNU coding conventions. + (elf32_hppa_stub_description): Added a 'next' field to allow + linking of stub description structures. + (elf32_hppa_stub_description): Added a 'stub_listP' field to + keep track of individual stubs. + (Elf32_hppa_Stub_list, Elf32_hppa_Stub_list_struct): Removed. + Combined with the elf32_hppa_stub_description structure. + (elf32_hppa_stub_name_list): New type to keep track of + individual stubs. + (add_stub): Removed. + (add_stub_by_name): New function. + (find_stub_by_name): New function. + (hppa_elf_build_arg_reloc_stub): Allow reusing stubs that + already exist. + (hppa_elf_build_long_branch_stub): Allow reusing stubs that + already exist. + + * elf32-hppa.c: (retval_mismatches): The direction of argument + relocation was reversed. + (hppa_elf_build_arg_reloc_stub): Return address was not being + restored. + (hppa_elf_arg_reloc_needed_p): Add argument containing caller + argument relocation bits so this function can be used in the check + for plabel stubs. + (hppa_elf_stub_check): Pass caller argument relocation bits into + hppa_elf_arg_reloc_needed_p(). + (hppa_look_for_stubs_in_section): Add check for plabel stubs and + pass caller argument relocation bits into + hppa_elf_arg_reloc_needed_p(). + +Thu Sep 2 00:59:55 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * libhppa.h (hppa_field_adjust): Remove unused `init_value' variable. + + * hosts/delta88v4.h: New for SVR4. + * configure.host: Use it. + +Wed Sep 1 14:23:32 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * libaout.h, netbsd386.c: Change M_I386 to M_386_NETBSD. M_I386 + is an SCO pre-define. + +Tue Aug 31 12:50:19 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmcode.h (nlm_object_p): Set HAS_SYMS if there are external + references. + (nlm_swap_auxiliary_headers_{in,out}): The copyright length is + only one byte. + (nlm_get_symtab_upper_bound): Include debugging symbols in symbol + count. + (nlm_slurp_symbol_table): Make symlength unsigned. Read debugging + symbols as BFD local symbols. + (nlm_write_object_contents): Don't bother writing out exported + symbols more than once; they now appear in the symbol table more + than once (with and without a prefix) if necessary. Set offset + values to be non-zero as NLMLINK does. + +Tue Aug 31 12:07:43 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * libhppa.h: Restore #undefs of e_fsel and other e_* symbols. + +Fri Aug 27 16:43:35 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * section.c (struct sec): Move position of user_set_vma, and + document it. + (SEC_BALIGN): Disable for now. I don't think it's currently used. + + * elf32-hppa.c (elf_hppa_howto_table): Now static. + (symext_rootP, symext_lastP, global_value, GOT_value, + global_symbol, global_sym_defined, symextn_contents, + symextn_contents_real_size, elf_hppa_stub_rootP, + elf32_hppa_symextn_map, elf32_hppa_symextn_map_size): Rely on + default initialization. + (hppa_elf_gen_reloc_type): Macro "UNDEFINED" doesn't need a + trailing semicolon. + (hppa_look_for_stubs_in_section): Introduce temporaries to make + code more readable in 80 columns. + + * libhppa.h (all functions): Now inline under GNU C. + + More patches from Jeff Law: + + * elf32-hppa.c (AR_WARN): Give argument which caused the + invalid argument relocation. + (AR_UNIMP): Delete unused macro. + (hppa_elf_set_section_contents): Always return a value. + (elf32_hppa_backend_table_processing): Likewise. + (elf32_hppa_backend_section_processing: Likewise. + + * som.c: New file containing SOM specific code extracted + from hppa.c + + * som.h: New file containing SOM specific code extracted + from libhppa.h + + * hppa.c: Deleted. + + * libhppa.h: Delete SOM specific code. Add generic PA + code which can be shared by both SOM and ELF backends. + + * Makefile.in: Replace hppa.c with som.c. elf32-hppa.o + depends on libhppa.h now. + + * configure.in (hppa_vec): Needs som.o module instead of + hppa.o. + + * elf32-hppa.c: Include libhppa.h. Do not define + BYTES_IN_WORD. + + * elf32-hppa.h (hppa_reloc_field_selector_type): Delete + now lives in libhppa.h. + (hppa_reloc_field_selector_type_alt): Likewise. + + * hosts/hppabsd.h: Include and . Do not + define malloc or free. + + * config/hppa-elf.mt (SELECT_ARCHITECTURES): Don't define + SELECT_VECS. + + * elf32-hppa.c (hppa_elf_relocate_unwind_table): Delete unused + variables. + (elf_hppa_reloc_type_lookup): Likewise. + (elf_hppa_tc_make_sections): Likewise. + (hppa_elf_arg_reloc_needed_p): Likewise. + (hppa_elf_build_long_branch_stub): Likewise. + (elf_reloc_map): Delete, no longer used. + (elf_hppa_reloc_map): Likewise. + (elf32_hppa_symextn_map_max_size): Likewise. + (elf32_hppa_get_sym_extn): Abort if type is bogus. + + * elf32-hppa.c (elf32_hppa_backend_fake_sections): Add processing + of the .hppa_unwind section. + +Wed Aug 25 16:13:49 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + * config.bfd: recognize m88110. + +Tue Aug 24 16:32:35 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + Merged changes from Jeff Law and Pete Hoogenboom at Utah: + + * elfcode.h (elf_section_from_bfd_section): Add detection of + SHT_NOTE sections. + + * elf32-hppa.c: + (hppa_elf_build_long_branch_stub,hppa_elf_long_branch_needed_p): + New functions for support of long branch stubs. + (hppa_elf_stub_check,hppa_look_for_stubs_in_section): Add + check for long branch stubs. + (hppa_look_for_stubs): Unused function. Removed. + (hppa_elf_set_section_contents): Implement a PA/ELF-specific + version of bfd_set_section_contents. + (hppa_elf_long_branch_needed_p): Only output debugging diagnostics + when BFD is configured for debugging. + + * elf32-hppa.c: (elf32_hppa_get_symextn_chain): New function + to return a list of symbols that have non-zero argument + relocation bits. + (hppa_elf_stub_finish): Make sure stub generation is done only + once. + + * elf32-hppa.c: (hppa_elf_stub_reloc): New function for + generation relocation entries within a stub. + (hppa_elf_build_arg_reloc_stub): Corrections to argument + relocation stubs. + + * elf32-hppa.c: New #define's for argument relocation types. + (mismatches, retval_mismatches): Updated to reflect new + argument relocation types. + (CURRENT_STUB_OFFSET): New macro. + + * elfcode.h (map_program_segments): Set the PF_X bit for data + segments. + + * elf32-hppa.c: (elf_hppa_howto_table): Add + R_HPPA_STUB_CALL_17 for support of linker stub generation. + (hppa_elf_reloc): Add support of R_HPPA_STUB_CALL_17 + relocation type. + + * elf32-hppa.h: (elf32_hppa_reloc_type): Add + R_HPPA_STUB_CALL_17 for support of linker stub generation. + + * hppa_stubs.h: Add new instructions that are used in linker + stub generation. + + * elf32-hppa.c (hppa_elf_relocate_unwind_table): The offsets in an + unwind descriptor were incorrect. + + * libelf.h (bfd_elf_find_section): Declare. + + * elf32-hppa.c: (elf32_hppa_backend_symbol_processing): New + function in place of global_sym field in elf_backend_data + structure. + (elf32_hppa_backend_symbol_table_processing, + elf32_hppa_backend_section_processing, + elf32_hppa_backend_fake_sections, + elf32_hppa_backend_section_from_shdr, + elf32_hppa_backend_section_from_bfd_section): New functions to + provide support of symbol extension sections and argument + relocation stubs. + (elf_info_to_howto): Remove call to abort(). + + * elf32-target.h: Support for special processing by the backend. + (struct elf_backend_data): Added elf_backend_symbol_processing, + elf_backend_symbol_table_processing, + elf_backend_section_processing, elf_backend_section_from_shdr, + elf_backend_fake_sections, and + elf_backend_section_from_bfd_section fields. + * elfcode.h: (bfd_section_from_shdr): Add a check for + processor-specific section types. + (elf_fake_sections): Add a check for processor-specific + section types. + (bfd_elf32_write_object_contents): Add a check to see if + there is any final section processing to be done by the + backend. + (elf_section_from_bfd_section): Add a check for + processor-specific section types. + (elf_slurp_symbol_table): Remove reference to global_sym in the + elf_backend_data structure. Replace it with a call to + elf_backend_symbol_processing. + * libelf.h: Remove global_sym field in the elf_backend_data + structure. Replace it with a series of backend-specific + functions. + + * elf32-hppa.c (hppa_elf_stub_branch_reloc): The formal argument + stub_sym should be called target_sym. + (hppa_elf_build_arg_reloc_stub): Refer to the stub bfd (abfd) + rather than the output bfd (output_bfd). + (hppa_elf_reloc): Get rid of references to the global_sym field in + the elf_backend_data structure. + + * elfcode.h (elf_fake_sections): Check the correct condition for + .bss. Also, detect the existence of a .note section. + + * elf32-hppa.c (hppa_elf_relocate_insn): r_format argument should + have been r_field. + + * hosts/hppabsd.h (HOST_MACHINE_ARCH): Reference to bfd_arch_m68k + should be a reference to bfd_arch_hppa. + + * hppa.c (hppa_vec): Replace bfd_false with _bfd_dummy_target in + the bfd_check_format structure to avoid a type mismatch. + +Mon Aug 23 1993 Sean Fagan (sef@cygnus.com) + and Jim Kingdon (kingdon@cygnus.com) + + Add NetBSD support: + * netbsd386.c: New file. + * aoutx.h: Make sym_is_debugger_info true for N_FN. + * Makefile.in, aout-target.h, config.bfd, configure.host, configure.in, + libaout.h, targets.c: Other changes. + +Fri Aug 20 17:04:59 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config/m88k-elf.mt: New file. + * config.bfd: Use it for m88*-*-sysv4*. + +Fri Aug 20 15:16:58 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elfcode.h (elf_build_phdrs): Unused function deleted. + (bfd_shdr_from_section): Ditto. + (write_relocs): Don't change section contents for addend. + (elf_locate_sh): Return type is now always elf_internal_shdr, + since the other types were really aliases for this type anyways. + Don't compile this function, since it is static and doesn't appear + to be used in this file. + (sym_is_global): Return non-zero for weak symbols. Abort if + section pointer is null. + (swap_out_syms): Reorder tests so function symbols can be weak. + (elf_slurp_symbol_table): Don't use BSF_EXPORT. + (elf_slurp_reloca_table): Make RELOC_PROCESSING section smaller by + extracting out some common code. Abort if BFD section symbol has + null name. + (elf_slurp_reloc_table): Translate ELF section symbols into BFD + section symbols. Don't read section contents to fill in addend + field. + + * elf32-i386.c (elf_howto_table): All partial_inplace fields + should be "true". + + * Merged from OSF: + + Tue Jun 15 14:38:32 1993 Michael Meissner (meissner@osf.org) + + * libelf.h (struct Elf_Sym_Extra): New structure to contain ELF + specific information for a symbol. Put in elf_sym_num, which + gives the external symbol number in the elf object file, since + local symbols must come before global symbols. + (elf_sym_extra): New macro. + (elf_symtab_map): Delete, in favor of using Elf_Sym_Extra. + * elfcode.h (elf_map_symbols): Use Elf_Sym_Extra to map internal + symbol number to external number. Store the address of the + Elf_Sym_Extra field for the symbol in the udata field. + (elf_write_object_contents): Use Elf_Sym_Extra to map out symbols. + + Sun Jun 20 16:30:11 1993 Michael Meissner (meissner@osf.org) + + * elfcode.h (elf_obj_tdata): Add field to count the size of the + array of pointers to section symbols. + (elf_map_symbols): Bump the max index of the section symbols so + that we don't overwrite memory. Store the max index into the + elf_obj_tdata field. + + Sat Jun 19 10:12:27 1993 Michael Meissner (meissner@osf.org) + + * elfcode.h (elf_obj_tdata): Add pointer to an array of pointers + to the section symbols we created. Remove unused field + internal_syms. + (elf_map_symbols): Fill in array of pointers to section symbols. + Only create section symbols for sections that have SEC_ALLOC set, + and have non-zero size. + (elf_symbol_from_bfd_symbol): If udata is NULL, and this is a + section symbol, look up the section in the list of section + symbols, and set the udata pointer appropriately. Otherwise, if + udata is still NULL, fail an assertion, and use 0, instead of + dropping core. + +Fri Aug 20 12:18:05 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * config.bfd (mips-*-elfl*, mips-*-elf*): New targets, using + mipslelf and mipsbelf respectively. + * config/mipslelf.mt, config/mipsbelf.mt: New files. + * elf32-mips.c: Added some reloc information. + * configure.in: Fixed error message. + + * ecoff.c (ECOFF_LONG_SIZE): Removed. Just use constants. + +Thu Aug 19 09:45:51 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * Makefile.in (BFD_LIBS, ALL_MACHINES, BFD32_BACKENDS, BFD64_BACKENDS, + OPTIONAL_BACKENDS): Alphabetize entries and add a few missing ones. + * archures.c: Alphabetize decls. + + * configure.in, targets.c: Add missing vectors to the tables. + * targets.c (target_vector) [!SELECT_VECS]: Add DEFAULT_VECTOR. + Remove hp300bsd_vec due to clash with sunos_big_vec. + +Tue Aug 17 18:12:32 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hosts/i386{mach3,osf1mk}.h: New files, for Mach hosting. + * hosts/i386mach.h: removed, replaced by i386osf1mk.h. + * config/i386mach3.mt, i386mach3.c: New files, for Mach a.out format. + * Makefile.in, configure.host, config.bfd: Corresponding changes. + * hosts/decstation.h: Include not . + +Tue Aug 17 15:19:41 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coffgen.c (coff_section_symbol): If section's output_section is + not yet set, point to itself. This is needed because this is + called on the output file, not the input file. + + * coff-rs6000.c (dummy_reloc, RTYPE2HOWTO): Set howto field to a + dummy value, rather than leaving it NULL. + + * archures.c (bfd_default_set_arch_mach): Set bfd_error on + failure. + * aoutx.h (NAME(aout,set_arch_mach)): Check return value of + bfd_default_set_arch_mach. + +Tue Aug 17 09:42:16 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * config.bfd (cpu): Extract from canonical name with sed. + * configure.in: Don't pass it. + +Sun Aug 15 20:45:45 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * bfd-in.h: Remove {BYTE,WORD,LONG}_SIZE; they are pointless and + BYTE_SIZE conflicts with a Mach header. + * ecoff.c: Change LONG_SIZE to ECOFF_LONG_SIZE and define it. + + * configure.host: Make sure all OS fields end in *. + +Fri Aug 13 16:33:33 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_slurp_reloc_table): Use bfd_abs_section for + RELOC_SECTION_NONE and RELOC_SECTION_ABS. If a reloc section + doesn't exist, don't try to create it. + + * nlmcode.h (nlm_write_object_contents): procedure offsets are + from start of code segment, not start of file. + * config/i386-nlm.mt (DEFAULT_VECTOR): It's nlm32_i386_vec, not + bfd_nlm32_i386_vec. + * configure.in (SELECT_VECS switch): Likewise. + +Thu Aug 12 10:32:47 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * format.c (bfd_check_format): If the target matches the default + target, set match_count to 1, to ignore any previous matches. + + * Makefile.in (BFD32_BACKENDS): Remove srec.o, add reloc16.o. + + * configure.in: Add reloc16.o when we add + coff-h8300.o, coff-h8500.o, coff-sh.o, coff-z8k.o. + Makefile.in (BFD_LIBS): Remove reloc16.o. + + * config/u68k-coff.mt: Fix typo, DEFAULT_TARGET for + DEFAULT_VECTOR. + + * config/h8300-coff.mt, h8500-coff.mt, sh-coff.mt, st2000.mt, + z8k-coff.mt (DEFAULT_VECTOR): Define. Don't explicitly add + S-records via SELECT_VECS. + + * targets.c (target_vector), Makefile.in (BFD_LIBS): Always + support S-records, for convenience. + +Thu Aug 12 08:30:05 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-alpha.c (alpha_howto_table, alpha_finish_reloc, + alpha_ecoff_swap_reloc_{in,out}, alpha_bfd_reloc_type_lookup): + Read and write Alpha relocs. Can't process them yet. + * ecoff.c (ecoff_slurp_reloc_table): Recognize new reloc sections. + If the section does not already exist, create it. + + * ecoffswap.h (ecoff_swap_pdr_{in,out}): Handle new fields defined + on the Alpha. + + * libecoff.h (ecoff_backend_data): Added constructor_reloc and + finish_reloc fields. + * ecoff.c: Move MIPS reloc support from here... + * coff-mips.c: to here. + * ecoff.c (ecoff_set_symbol_info): Get constructor reloc howto + from backend. + (ecoff_slurp_reloc_table): Removed MIPS specific stuff. Call + finish_reloc backend function. + (ecoff_write_object_contents): Removed MIPS specific assertions. + * coff-mips.c (mips_finish_reloc): New function. + (mips_ecoff_backend_data): Fill in new fields. + * coff-alpha.c (alpha_ecoff_backend_data): Use NULL for new + fields. + * targets.c: Added extern for ecoffalpha_little_vec. + + * bfd.c (_bfd_host_big_endian): Removed. + * bfd-in.h (HOST_BYTE_ORDER_BIG_P, bfd_header_twiddle_required): + Removed. + * bfd-in2.h: Regenerated. + +Wed Aug 11 12:11:23 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * config.bfd: New file, broken out of configure.in. + * configure.in: Use it, and use standard target names for + --with-targets, replacing --with-bfd-targets. + + * archures.c (archures_init_table): Add bfd_sh_arch. + + * configure.in: Include coff-m68k.o for m68kcoffun_vec. + Include nlm32.o and nlm.o for bfd_nlm32_i386_vec. + Fix error in error message. + + * oasys.c: Make bfd_error_vector extern. + + * configure.in: Include stab-syms.o for a.out/b.out targets + and hp300{bsd,hpux}. + +Wed Aug 11 06:40:51 1993 Ian Lance Taylor (ian@cygnus.com) + + * nlmcode.h (nlm_compute_section_file_positions): Add the .bss + section before setting output_has_begun. + (nlm_set_section_contents): Remove argument names from + mangle_relocs_func prototype. + (nlm_write_object_contents): Remove shadowing local variable. + Don't write out debugging symbols if debugInfoOffset is -1. Add + the codeImageOffset to the start, exit, and check procedure + offsets. + * nlm32-i386.c (nlm_i386_write_reloc, nlm_i386_mangle_relocs): + Don't check partial_inplace field; its value is irrelevant. + + * Base use of sco-core on host, not target. + * configure.host (i[34]86-*-sco*): Use i386sco rather than i386v. + * config/i386-sco.mt (TDEFINES): Removed. + * config/i386sco.mh: New file to use sco-core. + * hosts/i386sco.h: New file; just includes hosts/i386v.h. + + * ecoffswap.h (ecoff_swap_{hdr,ext}_{in,out}): Use signed + conversions for some fields. + +Tue Aug 10 13:32:23 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_gprel_reloc): If _gp is not defined, give an + error rather than aborting. + + * libnlm.h (struct nlm_backend_data): Added mach field. + (nlm_machine): New accessor macro. + * nlm.c (nlm_mkobject): Set architecture and machine from backend + information. + * nlm32-i386.c (nlm32_i386_backend): Initialize new mach field. + +Tue Aug 10 09:31:18 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * configure.in: Replace calls to sort with shell code + to uniq the lists. + +Tue Aug 10 06:23:16 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * configure.in: Include aout32.o for any a.out/b.out formats. + +Mon Aug 9 09:37:18 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * config/i386-linux.mt (SELECT_VECS): Support bfd_elf32_i386_vec. + * config/m68k-elf.mt (SELECT_VECS): Support m68kcoff_vec. + * config/i386-elf.mt (SELECT_VECS): Support i386coff_vec. + * config/hppa-elf.mt (SELECT_VECS): Support hppa_vec. + * config/sparc-elf.mt (SELECT_VECS): Support sunos_big_vec. + * config/i386-sco.mt (SELECT_VECS): Don't define; Ian says it was + just a hack. + +Mon Aug 9 13:15:00 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + * config/m88k-coff.mt (DEFAULT_VEC -> DEFAULT_VECTOR): renamed. + +Mon Aug 9 14:26:45 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * syms.c (BSF_EXPORT): Now same as BSF_GLOBAL. + + * bfd.c (bfd_scan_vma): New function. + +Mon Aug 9 11:29:53 1993 Ian Lance Taylor (ian@cygnus.com) + + * bfd-in.h (bfd_get_architecture, bfd_get_machine): Removed + obsolete macros. + * bfd-in2.h: Updated. + + * ecoff.c (ecoff_slurp_armap): Correct bug in initialization of + stringbase. + +Sun Aug 8 12:21:13 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * configure.in: Remove unneeded test. + +Sun Aug 8 12:41:22 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in ({dist,real}clean): Use $(MAKE), not make. + +Sat Aug 7 09:14:21 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * config/st2000.mt (TDEFINES): Don't define MRI; not used. + + * PORTING, TODO, config/README: Update to reflect below changes. + + * configure.in: Replace MINIMIZE and --with-minimal-bfd with + --with-bfd-targets="target1,target2,..." and the special target + "all" to get the previous default behavior. + Figure out which architecture and backend .o files are needed from + DEFAULT_VECTOR, SELECT_VECS, and SELECT_ARCHITECTURES as set in + the .mt files. Define TDEFAULTS based on them, also. + + * Makefile.in: Remove references to MINIMIZE. + * archures.c, targets.c: Ditto. + + * config/*.mt: Define DEFAULT_VECTOR, SELECT_VECS, and + SELECT_ARCHITECTURES as variables rather than as -D arguments to + TDEFAULTS. + + * config/a29k-coff.mt,alphaosf.mt, i386-sco.mt, i960-bout.mt, + i960-coff.mt (TDEFAULTS): Don't put the default vector in + SELECT_VECS manually; it's automatic now. + + * config/i386-sco.mt (TDEFAULTS): Don't put &sco_core_vec in + SELECT_VECS manually; -DSCO_CORE does it automatically now. + + * config/h8300-coff.mt, config/h8500-coff.mt, config/sh-coff.mt, + config/st2000.mt, config/z8k-coff.mt (TDEFAULTS): Don't define + BFD; not used. + + * config/hppaosf.mh (HDEFINES): Don't define SELECT_ARCHITECTURES; + this is a host, not a target. + +Sat Aug 7 05:28:03 1993 Fred Fish (fnf@deneb.cygnus.com) + + * elfcode.h (elf_object_p): Add comment about what this function + does and to watch out for side effects. Add FIXME for memory leaks. + Fix comment about checking for matching byte order. Preserve + pointer to old tdata (if any), and restore it if we don't match + file with target vector. If we are going to use goto's, use them + consistently and maintainably. + * nlmcode.h (nlm_object_p): Expand comments about leaked memory + to note that the problem is even more serious than just leaked + memory. Replace goto with more traditional return. + +Fri Aug 6 12:00:03 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + Fix incorrect or useless makefile variable definitions: + * config/news.mt, config/u68k-coff.mt (TDEFAULTS): Use this to + define DEFAULT_VECTOR, instead of TDEFINES. + * config/i386aix.mh (MINIMIZE): Don't define. + * config/hppaosf.mh (MINIMIZE): Don't conditionalize. + * config/rs6000.mh (ALLOCA), + * config/i386v.mh (ALLOCA), + * config/i386linux.mh (ALLOCA), + * config/i386isc.mh (ALLOCA), + * config/go32.mh (EXTRALIBS): Don't define; not used. + * config/solaris2.mh (HDEFINES): Renamed from H_DEFINES. + * config/alphaosf.mt (TDEFINES): Set it, not HDEFINES. + * config/z8k-coff.mt (CC): Don't define. It's a target, not a host. + + * config/README: New file, explaining the variables. + + * targets.c (target_vector): Add hp300_bsd_vec. + * Makefile.in (BFD32_BACKENDS, CFILES): Add hp300bsd. + (hp300bsd.o): New rule. + +Fri Aug 6 15:13:22 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * libelf.h (NAME): Provide a default definition, that's neither + for 32 bits nor for 64. + + Tue Jun 15 14:38:32 1993 Michael Meissner (meissner@osf.org) + + * libelf.h (elf_hash): Change declaration to bfd_elf_hash, since + that is what is in elf.c. + +Fri Aug 6 12:28:38 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_set_symbol_info): Removed special handling for + scBss and scSBss symbols, since it was wrong. + + * Makefile.in (coff-mips.o, coff-alpha.o): Don't depend on + coffcode.h. + + * coffcode.h (sec_to_styp_flags): Inspired by mb@tti.COM (Michael + Bloom): Only set STYP_BSS for SEC_ALLOC sections. + + * ecoff.c (ecoff_slurp_armap): From Arne Henrik Juul + : Handle a COFF style armap. + +Fri Aug 6 09:59:45 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hpux-core.c: Cast return value from bfd_zalloc. + +Thu Aug 5 13:22:44 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * aoutx.h (log2): Delete i387-specific code. + + * Makefile.in (BFD_LIBS): Always include elf.o. + (BFD32_BACKENDS): Don't include elf.o here. + (ofiles): Delete references to ofiles2 and ofiles3. + (do_clean): Delete ofiles. + (BFDIN_H): Changed references to $(srcdir)/bfd-in2.h. + (stmp-bfd.h): Use bfd.h-new as temporary name, not bfd.h2. + (headers): Use bfd-in2.h-new as temporary name, not bfd.h-new. + + * bfd-in.h: Reworded comment to make it clear that bfd-in2.h is a + generated file. + + * reloc.c (enum bfd_reloc_code_real): Added i386-elf reloc types + (from Meissner's additions to bfd-in2.h). + + * elf32-i386.c (ELF_MAXPAGESIZE): Define. + + Merged: + + Wed Jun 23 06:05:58 1993 Michael Meissner (meissner@osf.org) + + * elfcode.h (elf_write_object_contents): Don't drop core if + elf_symbol_from returns a NULL pointer when processing a non-elf + symbol, use a 0 size instead. + + Tue Jun 15 14:38:32 1993 Michael Meissner (meissner@osf.org) + + * elfcode.h (elf_hash): Delete macro mapping elf_hash to + bfd_elf32_hash, since the hash table is independent of the 32/64 + bit system. + + * libelf.h (elf_hash): Change declaration to bfd_elf_hash, since + that is what is in elf.c. + + Sat Jun 19 10:12:27 1993 Michael Meissner (meissner@osf.org) + + * elf32-i386.h (reloc_type): Reformat spacing. + (elf_howto_table): Add the rest of the 386/ELF relocations. + (elf_i386_reloc_type_lookup): Ditto. + (elf_i386_info_to_howto): Ditto. + (elf_i386_info_to_howto_rel): Ditto. + +Thu Aug 5 10:07:43 1993 Fred Fish (fnf@cygnus.com) + + * nlmcode.h (nlm_get_reloc_upper_bound): Test return value + of nlm_slurp_symbol_table as boolean, not pointer. + * nlmcode.h (nlm_canonicalize_reloc): Test return value + of nlm_slurp_reloc_fixups as boolean, not pointer. + +Wed Aug 4 16:22:55 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * config/go32.mh: remove HDEFINES; since __MSDOS__ and __GO32__ + are now predefined by GCC + +Wed Aug 4 16:06:29 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * coffgen.c (coff_print_symbol): Add the section offset to the + line number address, so it's printed the same way as the function + address. Only showed up for line numbers that aren't in the first + section (.text). + +Wed Aug 4 08:33:55 1993 Ian Lance Taylor (ian@cygnus.com) + + * libnlm.h (nlm_backend_data): Added nlm_mangle_relocs. + (nlm_mangle_relocs_func): New macro. + * nlm32-i386.c (nlm_i386_write_reloc): Rewrote correctly. + (nlm_i386_mangle_relocs): New function. + * nlmcode.h (nlm_compute_section_file_positions): Move all common + symbols into the .bss section. + (nlm_set_section_contents): Call the mangle_relocs function. + (nlm_write_object_contents): Treat a reloc against any defined + symbol as an internal reloc. Fix bug in external reloc counting. + Get the offset and debugging type right for .bss symbols. Only + output debugging symbols for defined symbols. + + * coff-h8500.c (rtype2howto): Do an fprintf to stderr rather than + using printf. + * coff-z8k.c (rtype2howto): Likewise. + * coffcode.h (dummy_reloc16_extra_cases): Likewise. + * elf32-i386.c (TRACE): Likewise. + * hp300hpux.c (convert_sym_type, swap_std_reloc_in): Likewise. + * rs6000-core.c (rs6000coff_get_section_contents): Likewise. + * coffgen.c (coff_print_symbol): Do an fprintf to the file + argument rather than using printf. + +Tue Aug 3 18:17:25 1993 Ian Lance Taylor (ian@cygnus.com) + + * coffswap.h: Added macros used when accessing several fields; + default is the same as before. + (coff_swap_aouthdr_{in,out}): Handle the Alpha ECOFF fields. + * coff-alpha.c: Defined macros to use the right sizes in + coffswap.h. + * libecoff.h: Backend information is now in target vector, not + BFD. Start of backend information is COFF backend information. + * coff-alpha.c, coff-mips.c: Changed accordingly. + * ecoff.c (ecoff_mkobject): New function. + (ARMAP_START): Changed into backend information, since Alpha uses + a different name. + (ecoff_slurp_armap): Don't overlay archive header. + * bfd.c: Include libcoff.h. + +Tue Aug 3 16:33:11 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * Makefile.in (install): Fix sh syntax error. + + * aoutf1.h: Make bfd_error_trap extern; it's defined in bfd.c. + +Tue Aug 3 15:19:09 1993 Fred Fish (fnf@deneb.cygnus.com) + + * nlmcode.h (nlm_slurp_symbol_table): Don't use '&' on arrays. + +Tue Aug 3 11:06:28 1993 Ian Lance Taylor (ian@cygnus.com) + + * ecoff.c: New file for generic ECOFF functions. + * ecoffswap.h: New file for ECOFF swapping functions which differ + only slightly for different targets. + * libecoff.h: Added prototypes for ecoff.c functions. + (ecoff_backend_data): New structure. + (ecoff_tdata): Added backend_data field. Changed external data + pointers to be PTR rather than to a particular struct. + (ecoff_symbol_struct): Moved in from coff-mips.c. + * coff-alpha.c, coff-mips.c: Moved common functions into ecoff.c. + Added ECOFF backend structures. Include ecoffswap.h. + * coff-msym.c: Removed; superseded by ecoffswap.h. + * bfd.c: Include coff/internal.h. + * Makefile.in (BFD_LIBS): Removed coff-mips.o and coff-msym.o. + Added ecoff.o. + (BFD64_BACKENDS): Added coff-alpha.o. + (CFILES): Removed coff-msym.c. Added ecoff.c. + (bfd.o): Added dependency on $(INCDIR)/coff/sym.h. + (coff-mips.o): Added dependency on ecoffswap.h and coff/ecoff.h. + (ecoff.o, coff-alpha.o): New targets. + (coff-msym.o): Removed target. + +Mon Aug 2 23:33:38 1993 John Gilmore (gnu@cygnus.com) + + * elf32-hppa.h, hosts/*: Remove (one more time) all occurrances + of EXFUN in the BFD sources. Heave ho! + +Mon Aug 2 16:45:57 1993 Stu Grossman (grossman at cygnus.com) + + * coffcode.h (coff_set_arch_mach_hook): Add check for I386LYNXMAGIC. + +Mon Aug 2 12:18:03 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * hosts/sun3.h: remove some more conflicting decls + +Mon Aug 2 11:48:23 1993 Stu Grossman (grossman at cygnus.com) + + * i386lynx.c: Remove unnecessary def of N_HEADER_IN_TEXT, + redefine TEXT_START_ADDR to be 0. + +Sun Aug 1 22:54:08 1993 Stu Grossman (grossman at cygnus.com) + + * configure.host, configure.in, hosts/i386lynx.h: Lynx/386 + host and target info. + +Fri Jul 30 18:08:27 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlm32-i386.c: New file. First cut at i386 NLM code. + * libnlm.h: Added some more prototypes. + (struct nlm_relent): New structure. + (nlmNAME(symbol_type)): Added rcnt and relocs fields. + (struct nlm_obj_tdata): Added new fields: nlm_symbols, + nlm_text_low, nlm_data_low, nlm_reloc_fixups, + nlm_reloc_fixup_secs. + (struct nlm_backend_data): New structure, with accessor macros. + * nlmcode.h: Use NLM_HIBIT rather than MSB. + (nlm_object_p): Set SEC_RELOC for .text and .data. Don't set + SEC_DATA for .bss. Set HAS_RELOC and HAS_SYMS for abfd. Set the + architecture. + (nlm_swap_fixed_header_out, nlm_swap_variable_header_out, + find_nonzero, nlm_swap_auxiliary_headers_out): New outbound + swapping functions. + (nlm_get_symtab_upper_bound, nlm_slurp_symbol_table): Include + external references in symbol table as undefined symbols. + (nlm_get_symtab, nlm_slurp_symbol_table): Fill in alocation + argument in get_symtab rather than in slurp_symbol_table. + (nlm_slurp_symbol_table): Save symbol information in tdata. + (nlm_print_symbol): New function. + (nlm_slurp_reloc_fixups, nlm_get_reloc_upper_bound, + nlm_canonicalize_reloc): New functions to read relocs. + (nlm_compute_section_file_positions, nlm_set_section_contents, + nlm_external_reloc_compare, nlm_write_object_contents): New + functions to create NLM files. + * nlm-target.h: Define all the nlm functions here either as + default values or in terms of nlmNAME. Use JUMP_TABLE(nlm). Set + the backend_data field to TARGET_BACKEND_DATA. + * nlm32-gen.c, nlm64-gen.c: Don't define function macros here; + they are now in nlm-target.h. + (TARGET_BACKEND_DATA): Define as NULL. + * nlm.c (nlm_mkobject): Do allocate the tdata field. + (nlm_set_arch_mach): New function. + * targets.c: Added nlm32_i386_vec. + * Makefile.in (BFD32_BACKENDS): Added nlm32-i386.o. + (CFILES): Added nlm32-i386.c. + (nlm32-gen.o, nlm64-gen.o): Depend on nlm-target.h. + (nlm32-i386.o): New target. + +Thu Jul 29 20:20:39 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * hosts/sun3.h: remove some function decls that conflict w/ ANSI + C, and aren't needed anyway (return int) + +Wed Jul 28 15:46:38 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elfcode.h: Use casts with bfd_alloc and alloca. + +Tue Jul 27 12:51:43 1993 Fred Fish (fnf@deneb.cygnus.com) + + * nlm{32,64}-gen.c (JUMP_TABLE_PREFIX): Delete. + * nlm{32,64}-gen.c (JUMP_TABLE_INIT): New macro that works with + older cpp's, that don't do additional replacement on the JUMP_TABLE + macro's argument. + * nlm-target.h (JUMP_TABLE_INIT): Use new macro in place of + JUMP_TABLE macro. + +Mon Jul 26 17:39:01 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + Yet another trad-core variant: + * config/esix.mh, hosts/esix.h: New files. + * configure.host: Use them. + +Mon Jul 26 13:22:15 1993 Ian Lance Taylor (ian@cygnus.com) + + * reloc.c (bfd_perform_relocation): Handle the case of + complain_overflow_bitfield, rightshift > bitpos, and a negative + number. + +Mon Jul 26 14:40:10 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elfcode.h: Reimplement segment writing. + (elf_write_phdrs): Use precomputed e_phoff rather than making + assumptions. + (elf_build_phdrs): Disabled, for now. + (assign_file_position_for_section): Don't change file offset for + SHT_NOBITS. + (assign_file_positions_for_symtab_and_strtabs): New function. + (struct seg_info): New type. + (map_program_segments): New function. + (assign_file_positions_except_relocs): For executables, leave + section headers &c for last, and properly align all sections with + flag SHF_ALLOC set. + (prep_headers): No longer abort when EXEC_P is set. + (write_shdrs_and_ehdr): Deleted all code relating to program + segments. + + * elfcode.h (various): Deleted some unused code, and debugging + "malloc(0)" calls. + (write_relocs): Cache value of last symbol looked up, to save + time if the symbol is referred to repeatedly. + (elf_fake_sections): Check only SEC_RELOC flag, not number of + relocs. + (assign_section_numbers): Likewise. + + * Makefile.in (ofiles): Stars in wildcards belong outside quotes. + + * libelf.h (struct elf_backend_data): New field, maxpagesize. + (struct elf_obj_tdata): New field, phdr. + * elf32-target.h (elf32_bed): Initialize maxpagesize from + ELF_MAXPAGESIZE. + (ELF_MAXPAGESIZE): Default to 1. + * elf64-target.h (elf64_bed, ELF_MAXPAGESIZE): Likewise. + * elf32-sparc.c (ELF_MAXPAGESIZE): Define. + (elf_sparc_howto_table): All relocs should have pcrel_offset=true. + Most should have length field of `2'. + + * reloc.c (bfd_perform_relocation): Handle 64-bit relocs. + + * config/sparc-aout.mt (TARGET_BACKENDS): Define. + +Mon Jul 26 08:56:16 1993 Ian Lance Taylor (ian@cygnus.com) + + * configure.in: Don't look in ${srcdir} for ${target_makefile_frag}; + the top level script has already adjusted for it. + +Mon Jul 26 08:09:19 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * srec.c (srec_write_symbols): Get CR LF in the right order. + +Mon Jul 26 02:08:41 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hosts/vaxbsd.h: Include std-host.h. Don't include . + +Sat Jul 24 16:13:01 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * reloc.c (bfd_perform_relocation): Handle case of rightshift != + bitpos when overflow checking. + +Fri Jul 23 10:20:27 1993 Doug Evans (dje@canuck.cygnus.com) + + * bfd.c (bfd_nonrepresentable_section, bfd_undefined_symbol, + bfd_reloc_value_truncated, bfd_reloc_is_dangerous, bfd_assert): + Send error messages to stderr. + +Thu Jul 22 15:57:29 1993 Fred Fish (fnf@deneb.cygnus.com) + + * nlm{32,64}-target.h: Remove. + * nlm-target.h: New file, merged from nlm{32,64}-target.h + * libnlm.h (NLM_ARCH_SIZE): Define to ARCH_SIZE. + * nlm.c (ARCH_SIZE): Remove define to zero. + * nlm32-gen.c (ARCH_SIZE): Define to 32. + * nlm32-gen.c (JUMP_TABLE_PREFIX): Define to nlm32. + * nlm{32,64}-gen.c (nlm-target.h): Include. + * targets.c, libnlm.h, nlm.c, nlm{32,64}-gen.c, nlm{32,64}.c, + nlmcode.h: Convert prefixes from bfd_nlm to just + nlm, and use macros select size. + +Thu Jul 22 15:40:14 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + * Makefile.in (Makefile): add configure.in, drop redundant + $(srcdir), drop redundant ./ + +Thu Jul 22 13:34:57 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * hpux-core.c: New file; backend for HP/UX style core files. + * bfd.c (struct _bfd): Renamed hppa_core_data field to + hpux_core_data. + * bfd-in2.h: Updated. + * hppa.c (make_bfd_asection, hppa_core_file_p, + hppa_core_file_failing_command, hppa_core_file_failing_signal, + hppa_core_file_matches_executable_p): Moved into hpux-core.c. + Removed from target vector. + * libhppa.h (struct hppa_core_struct and accessor macros): Moved + into hpux-core.c. + * targets.c: If HPUX_CORE is defined, add hpux_core_vec to + target list. + * config/hp300.mh (HDEFINES): Set to -DHPUX_CORE. + (HDEPFILES): Set to hpux-core.o. + * config/hppabsd.mh, config/hppahpux.mh: Likewise. + * hosts/hp300.h (HOST_HP300HPUX): Define. + * Makefile.in (OPTIONAL_BACKENDS): Added sco-core.o, + aix386-core.o, hpux-core.o. + (sco-core.o, aix386-core.o, hpux-core.o): New dependencies. + + * reloc.c (enum complain_overflow): New enumeration with the + various flavours of overflow checking. + (srtuct reloc_howto_struct): Changed complain_on_overflow field + from boolean to emum complain_overflow. Removed obsolete absolute + field. + (HOWTO): Removed absolute argument. + (bfd_perform_relocation): Do overflow checking on all types of + fields. + * bfd-in2.h: Updated accordingly. + * all targets: Updated initialization of reloc howto tables. + +Wed Jul 21 20:34:34 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * opncls.c (bfd_create): Don't use C++ keyword "template" as a C + variable name. + +Tue Jul 20 15:02:23 1993 Fred Fish (fnf@deneb.cygnus.com) + + * coff-m68k.c (m68k_howto2rtype): Make arg CONST to match callers. + + * elfcode.h: Fix several illegal pointer combination warnings for + usages of bfd_alloc and alloca. + + * libnlm.h (nlm_obj_tdata): Rename hidden struct members to avoid + apparent Sun C preprocessor recursion. Fix access macros. + * nlmcode.h: Remove spurious '&' before several array references. + +Tue Jul 20 14:36:27 1993 Jim Kingdon (kingdon@deneb.cygnus.com) + + * Rename for DOS uniqueness: coff-m68k-un.c -> coff-u68k.c + config/m68k-coffun.mt -> u68k-coff.mt. + * Makefile.in, configure.in: Corresponding changes. + +Tue Jul 20 16:21:52 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elf32-sparc.c (elf_sparc_howto_table): Don't use "&" before + function name; it's valid without, and some compilers give + warnings with it there. + +Tue Jul 20 08:21:15 1993 Fred Fish (fnf@deneb.cygnus.com) + + * bfd-in.h: Apply some of the changes that were made to bfd-in2.h. + * bfd.c (union tdata): Add nlm_obj_data; + * targets.c (enum target_flavour): Add bfd_target_nlm_flavour. + +Mon Jul 19 20:46:18 1993 Fred Fish (fnf@deneb.cygnus.com) + + * configure.in (*-*-netware, i[34]86-*-netware): New configs. + * Makefile.in (BFD32_BACKENDS): Add nlm.o, nlm32.o, nlm32-gen.o. + * Makefile.in (BFD64_BACKENDS): Add nlm64.o, nlm64-gen.o. + * Makefile.in (CFILES): Add nlm{32,64}.c, nlm{32,64}-gen.c. + * Makefile.in (nlm.o, nlm{32,64}.o, nlm{32,64}-gen.o: New targets. + * bfd-in2.h (INLINE): Defines moved here. + * {aoutx.h, elf.c, elfcode.h}: Move INLINE defines to bfd-in2.h. + * libelf.h (CAT4): Move define to bfd-in2.h. + * bfd-in2.h (CAT4): Merge CAT4 macro with other CAT macros. + * bfd-in2.h (union tdata): Add nlm_obj_data. + * bfd-in2.h (enum target_flavour): Add bfd_target_nlm_flavour. + * targets.c (bfd_nlm{32,64}_{big,little}_vec): Add prototypes. + * targets.c (target_vector): Add bfd_nlm{32,64}_{big,little}_vec. + * (libnlm.h, nlm.c, nlmcode.h, nlm{32,64}-gen.c, + nlm{32,64}-target.h, nlm{32,64}.c, config/i386-nlm.mt): New files + for NLM support. + +Mon Jul 19 15:09:01 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * configure.{hosts,in}: add i[34]86-*-lynxos* support + +Mon Jul 19 14:53:30 1993 Ken Raeburn (raeburn@rtl.cygnus.com) + + * elf.c, elfcode.h, libelf.h: Serious reorganization. + Deleted `thunk' structure, merged into tdata, duplicate data + eliminated. + Rearranged functions, grouping by functionality. + Broke up many functions in elfcode.h, re-ordered many parts of + file writing to handle unpredictable state of section relocation + table as provided by various applications. + Still needs cleanup: Merge functions back together, split out + data structure with only data that is used only when writing out + object file. + + * elf.c (bfd_elf_generic_reloc): New function, taken from + coff-mips.c. + * elf32-sparc.c (elf_sparc_howto_table): Use it, to work around + bfd_perform_relocation lossage. + + * Makefile.in (BFD_LIBS): Include coff-mips.o and coff-msym.o, so + that gdb will link. + (ofiles): Don't use sort or uniq; do it with sh constructs. + +Sun Jul 18 19:42:14 1993 Jim Kingdon (kingdon@rtl.cygnus.com) + + * coffcode.h: Recognize I386PTXMAGIC. + * aoutf1.h, libaout.h: Add M_386_DYNIX. + * trad-core.c (TRAD_CORE_USER_OFFSET, TRAD_CORE_STACK_FILEPOS): + New macros; use it if defined. + * config/symmetry.mh, hosts/symmetry.h: New files. + +Fri Jul 16 14:56:31 1993 Jim Kingdon (kingdon@rtl.cygnus.com) + + * Rename elf{32,64}-generic.c to *-gen.c for 14 char filenames. + * Makefile.in: Change accordingly. + (CFILES): Add elf64-gen.c. + +Fri Jul 16 09:53:23 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c: Use MIPS_AOUT_{OZ}MAGIC rather than {OZ}MAGIC. + +Thu Jul 15 16:02:07 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-m88k.c (howto_table): Corrected bitsize for R_PCR26L from + 16 to 26. + +Wed Jul 14 15:29:56 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hppa.c [HOST_HPPABSD]: Use hpux-style core files. + * libhppa.h [HOST_HPPABSD]: Include hpux version of core.h + +Wed Jul 14 09:30:48 1993 Doug Evans (dje@canuck.cygnus.com) + + * configure.in: Recognize h8300h-*-*. + +Tue Jul 13 12:03:00 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * coff-h8500.c (reloc_processing, rtype2howto): New relocation + type R_H8500_HIGH_16. + * coff-sh.c (r_imm32): Get the width of the reloc right. + +Tue Jul 13 16:48:56 1993 Frederic Pierresteguy (F.Pierresteguy@frcl.bull.fr) + + * configure.in: Add new target m68k-coffun to the dpx/2. + * config/m68k-coffun.mt: New file, renamed from config/dpx2.mt. + +Mon Jul 12 10:42:49 1993 Ken Raeburn (raeburn@deneb.cygnus.com) + + * reloc.c (enum bfd_reloc_code_real): Move SPARC_BASE13 reloc into + sparc-aout-specific list. + + * libelf.h (struct elf_obj_tdata): Add field `thunk'. + + * config/sparc-elf.mt (TARGET_BACKENDS): New make variable. + +Thu Jul 1 14:52:47 1993 Frederic Pierresteguy (F.Pierresteguy@frcl.bull.fr) + and Jim Kingdon (kingdon@cygnus.com) + + * elfcode.h: Use memset not bzero. + * trad-core.c: Don't include . + * i386linux.h: Include . + * coff-m68k-un.c: new file to handle names with underscores on + svr3 machines. + * coff-m68k.c (m68k_rtype2howto): added #ifdef ONLY_DECLARE_RELOCS + to not duplicate the function in the executable. + (TARGET_SYM, TARGET_NAME, NAMES_HAVE_UNDERSCORE): new macros needed + by coff-m68k-un.c. + * coffcode.h (MC68KBCSMAGIC): case added. + * targets.c: Add m68kcoffun_vec. + * configure.host: added support for Bull dpx/2. + * config/dpx2.mh, hosts/dpx2.h: new files. + * Makefile.in: added target coff-m68k-un. + +Fri Jul 9 00:43:06 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * aoutf1.h: Add definition of MACHTYPE_OK. + +Thu Jul 8 14:37:44 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * reloc.c (bfd_perform_relocation): Don't subtract the addend + again for coff. + + * syms.c, bfd-in2.h: Doc fix. + + * coffcode.h (CALC_ADDEND): Check for common section using the + section flag as well as the symbol flag. + +Thu Jul 8 13:43:52 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hosts/i386bsd.h: Conditionalize HOST_STACK_END_ADDR on __bsdi__. + i386bsd.c: Remove defines of N_TXT*; the versions in aout64.h should + be sufficient. Define TEXT_START_ADDR. + +Wed Jul 7 10:56:21 1993 Ian Lance Taylor (ian@cygnus.com) + + * aoutx.h (translate_from_native_sym_flags): Removed statep + argument. Just let an indirect symbol point to the next symbol + without forcing the next symbol to be undefined. Changed all + callers. + * hp300hpux.c (slurp_symbol_table): Changed call to + translate_from_native_sym_flags. + * targets.c: Added hp300hpux_vec. + * Makefile.in (hp300hpux.o): Added dependencies. + +Tue Jul 6 13:24:55 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * reloc.c (enum bfd_reloc_code_real): Put simple power-of-two + relocs together, and add 64-bit versions. + (bfd_generic_get_relocated_section_contents): Argument to alloca + is size_t. + + * libbfd.c (bfd_xmalloc_by_size_t): New function. + * opncls.c (bfd_cache_init, bfd_open_file): Add prototypes to + declarations. + (obstack_chunk_alloc): Use bfd_xmalloc_by_size_t. + (new_bfd): Prototype-style definition, using DEFUN. + (bfd_alloc_grow, bfd_alloc, bfd_zalloc, bfd_realloc): Size + argument is type size_t, not bfd_size_type. + * ieee.c (obstack_chunk_alloc): Use bfd_xmalloc_by_size_t. + * bfd.c (bfd_default_error_trap, bfd_error_trap, + bfd_error_nonrepresentabltrap): Prototypes. + * libbfd-in.h (bfd_alloc, bfd_zalloc, bfd_realloc, + bfd_alloc_grow): Adjusted prototypes for arg type change. + * archive.c (get_elt_at_filepos, do_slurp_bsd_armap, normalize, + do_slurp_coff_armap, bfd_construct_extended_name_table): + Prototypes. + * elfcode.h (elf_string_from_elf_strtab): Prototypes. + * libelf.h (elf_string_from_elf_section, elf_get_str_section): + Prototypes. + + * Makefile.in (ALL_MACHINES): Renamed from BFD_MACHINES. + (ofiles): New target. Build a list of unique file names, in case + any got duplicated. + (TARGETLIB): Use list of files from ofiles. + * configure.in: Set BFD_MACHINES and BFD_BACKENDS depending on + minimal-bfd flag and target makefile frag contents. + + * elfcode.h (elf_read): Delete static declaration, since function + has moved. + (elf_map_symbols): Write out section symbols for all sections, for + now. + (elf_symbol_from_bfd_symbol): Allow match if both symbols are + section symbols for the same section. + (elf_find_nearest_line): Don't print message, just return false. + + * libelf.h (bfd_elf_locate_sh): Declaration deleted. + +Mon Jul 5 16:48:11 1993 Doug Evans (dje@canuck.cygnus.com) + + * cpu-h8300.c (h8300_scan): Fix parsing of architecture string. + +Fri Jul 2 18:27:00 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in (clean): Remove bfd.h and stmp-bfd.h. + (realclean): Remove generated headers. + +Fri Jul 2 14:51:51 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * section.c (bfd_set_section_content): Deny if file is not opened with + the proper mode, set output_has_begun if file is openened for update. + * aoutx.h (aout_*_set_section_content): Remove checks that are now + done in bfd_set_section_content. + +Fri Jul 2 09:25:20 1993 Ian Lance Taylor (ian@cygnus.com) + + * hosts/std-host.h: Removed declarations of printf, fprintf, + fcntl, fread and fwrite. They are all error prone for one reason + or another. Changed declaration of memchr from char * to PTR. + + * configure.in (mips-*-riscos*): New target; use riscos. + * configure.host (mips-*-riscos*): New host; use riscos. + * config/riscos.mh (HDEFINES): Add -G 4. + + * libaout.h (GET_SWORD): Use the bfd_h_get_signed entry points + rather than casting the result of bfd_h_get. + +Fri Jul 2 10:13:48 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * configure.in, hosts/delta68.h, config/delta68.mh: Add stuff for + Motorola Delta 68. + +Wed Jun 30 06:02:43 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * targets.c (bfd_elf64_{big,little}_generic_vec): Declare, and + include in search list if BFD64 is defined. + + * libelf.h (CAT4): Added a version for Saber-C, ANSI mode. + (bfd_elf64_*): Declarations for 64-bit versions of many routines. + +Tue Jun 29 22:50:59 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elf64-target.h, elf64-generic.c: New files. + * Makefile.in (BFD64_BACKENDS): Include elf64-generic.o. + (elf64-generic.o): List dependencies. + + * Makefile.in: List target `all' explicitly before host/target + makefile fragments are included, in case they define any new + targets. + + * elfcode.h (ELF_R_INFO, ELF_R_SYM): Define as 32- or 64-bit + versions as appropriate. Uses updated. + (elf_debug_section): Declare before use. + (elf_debug_file): New function. + (bfd_section_from_shdr, bfd_shdr_from_section, elf_fake_sections): + Alignment value in section header is n_bytes, not log2. + (new_section_hook): Do nothing for now. + (bfd_section_from_shdr): Use Elf_External_Rel[a], not 32-bit + version explicitly. + (elf_core_file_p): Simplify check for correct class (word size). + (elf_make_sections, elf_fake_sections, elf_write_object_contents): + Initialize all fields when creating data structures. + (elf_locate_sh): Renamed from bfd_elfXX_locate_sh, made static. + (elf_compute_section_file_positions): Set correct class in output + file. + (elf_write_object_contents): Section symbols have empty names in + output file. + + * libbfd.c (bfd_xmalloc, zalloc): Be sure to cast malloc, memset + args to size_t before call. + (bfd_add_to_string_table): Cast zalloc arg to bfd_size_type. + +Tue Jun 29 10:49:42 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_find_nearest_line): If procedure has no line + number information, return 0 for line number. + +Mon Jun 28 10:45:02 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * aoutx.h (some_aout_object_p): If *oldrawptr is non-NULL, copy it + into *rawptr. + +Sun Jun 27 09:05:19 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hosts/riscos.h: Define NBPG and UPAGES. + +Sun Jun 27 16:28:26 1993 Ken Raeburn (raeburn@cygnus.com) + + * elfcode.h (elf_slurp_symbol_table): Don't use obj_raw_syms as + lvalue; it contains a cast. + +Fri Jun 25 17:09:55 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * aoutx.h (hash, compare, struct stringtab_entry, add_to_stringtab): + Use unsigned hash values for better hashing. + (hash): Hash in the string length for long strings. + +Thu Jun 24 15:47:51 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * aoutx.h (compare): Replace 3 if's with a subtraction. + (translate_to_native_sym_flags, add_to_stringtab): Reorder tests + in decreasing order of success, as an optimization. + (hash): Take a length arg; ignore chars after #25, for speed. + (add_to_stringtab): Pass length to hash. + +Thu Jun 24 17:25:51 1993 Ken Raeburn (raeburn@poseidon.cygnus.com) + + * elf32-sparc.c (sparc_reloc_map): Add SPARC_WDISP22 reloc. + + * elfcode.h (elf_new_section_hook): Do nothing for now. + (elf_write_object_contents): Output common symbols the way ELF + wants them. + +Wed Jun 23 16:20:07 1993 Ken Raeburn (raeburn@poseidon.cygnus.com) + + * libelf.h (struct elf_obj_tdata and associated macros): Moved + here from elfcode.h. A couple of size-specific structure pointers + were changed to PTR; uses fixed appropriately. + (elf32_symbol_type, elf64_symbol_type): Separated definitions. + (bfd_elf_mkobject): Renamed from bfd_elf32_mkobject. + (bfd_elf32_mkobject, bfd_elf64_mkobject, elf_mkobject): New + temporary macros to ease name change. + * elf.c (elf_read, elf_mkobject, elf_get_str_section, + elf_string_from_elf_section, bfd_elf_find_section): Moved here + from elfcode.h. + * doc/Makefile.in (libbfd.h): Process elf.c too. + * Makefile.in (elf.o): Note new dependencies. + + * elfcode.h: Lots of stuff moved elsewhere. Deleted some unused + code, tweaked some debug hooks. + (elf_slurp_reloca_table): Translate ELF section symbols into BFD + section symbols. + +Wed Jun 23 11:34:21 1993 Jim Kingdon (kingdon@cygnus.com) + + * hosts/riscos.h: New file. + +Tue Jun 22 14:35:20 1993 Ken Raeburn (raeburn@poseidon.cygnus.com) + + * elfcode.h (bfd_section_from_shdr, case SHT_PROGBITS): Even if + section already exists, use its pointer to fill in rawdata slot. + +Tue Jun 22 16:36:51 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hosts/std-host.h: Return value of puts and fputs is int not void. + +Tue Jun 22 14:25:58 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * aoutx.h (howto_table_ext): Comment the field names. + * reloc.c (bfd_perform_relocation): Fix max and min values. + +Mon Jun 21 18:19:14 1993 Ken Raeburn (raeburn@poseidon.cygnus.com) + + * elf32-target.h, elf32-hppa.c, elfcode.h: Use new + size-independent elf internal data structures. + * elfcode.h (put_word, get_word): Define as appropriate for + architecture word size. Structure swapping functions changed to + use them as appropriate. + + * configure.in: If compiling 64-bit back ends, do them before + 32-bit ones. + + * libelf.h: Use new size-independent versions of elf internal data + structures. + (symbol_type): Reordered to put any fields dependent on target + size at the end. + (elf_backend_data): Renamed from elf##_backend_data and made + size-independent. + (elf_sect_thunk): Now size-independent. + + * libbfd.c (bfd_log2): Now returns unsigned int. + +Mon Jun 21 12:30:47 1993 Jim Kingdon (kingdon@cygnus.com) + + * Rename config/m88k-aout.mt to config/noop.mt. + configure.in: Use it for mips-*-bsd*. + +Sun Jun 20 20:32:19 1993 Ken Raeburn (raeburn@poseidon.cygnus.com) + + * cpu-m68k.c (arch_info_struct): Eliminate "partially bracketed + initializer" warning from gcc. + * cpu-h8500.c (arch_info_struct): Likewise. + * cpu-sh.c (arch_info_struct): Likewise. + + * cpu-h8300.c (local_bfd_reloc_type_lookup, howto*_callback, + howto_*): Unused functions and variables commented out. + * cpu-z8k.c (local_bfd_reloc_type_lookup, howto*_callback, + howto_*): Likewise. + * cpu-h8500.c (compatible): Likewise. + * cpu-sh.c (compatible): Likewise. + + * hp300hpux.c (swap_std_reloc_in): Delete unused variables. + Always set a valid length value, even for invalid input. + + * srec.c (srec_write_symbols): Use sprintf_vma. + + * bfd-in.h (uint64_typeLOW, uint64_typeHIGH, int64_type, + uint64_type): Provide default definitions. + * hosts/std-host.h (int64 stuff): Remove them from here. + + * bfd-in.h (sprintf_vma): Define parallel to fprintf_vma. + + * elf32-i386.c (elf_i386_reloc_type_lookup): Delete unused + variable. Added default case to switch. + + * aoutx.h (translate_from_native_sym_flags): Before casting + pointers to integers, make sure the integer type is wide enough. + * coff-mips.c (ecoff_set_symbol_info): Ditto. + + * section.c (bfd_get_section_contents): Since `count' is unsigned, + don't bother comparing for less-than-zero. + (bfd_set_section_contents): Ditto. + + * elfcode.h (bfd_add_to_strtab): Now static. + (sym_is_global): New function. + (elf_map_symbols): Call it. Now returns void. Removed unused + local variable. + (bfd_section_from_shdr): Mark string tables other than for section + and symbol names as normal sections having contents. + (fix_up_strtabs): New function; fixes up ELF header fields for + stab sections with string tables associated. + (elf_write_object_contents): Map fix_up_strtabs over all BFD + sections. Reordered condition tests for symbol flags; default to + local-object value instead of global-object. + (elf_symbol_from_bfd_symbol): Hid conditionally-used variable + inside condition test. + (elf_print_symbol): Use fprintf_vma. + (elf_idx_of_sym, bfd_shdr_from_section): Unused functions + commented out. + + * bfd-in.h (int64_type, uint64_type): Define these if we fall + back to "long long" for HOST_64_BIT. + + * libelf.h (elfNAME, ElfNAME): New versions to get desired results + without using invalid ANSI C preprocessing tokens. + + * elf32-target.h (bfd_elf32_new_section_hook): Delete macro. + * libelf.h (bfd_elf32_new_section_hook): Declare. + * elfcode.h (new_section_hook): Define here. + + * hosts/sparc.h, hosts/std-host.h, hosts/i386bsd.h: Protect + against multiple inclusions. + + * hosts/news.h: Include hosts/std-host.h, not plain std-host.h. + + * Makefile.in (bfd.h): Generate into current directory by grabbing + 64-bit definition (if any) from sysdep.h. + * bfd-in.h: Put in marker for sysdep.h inclusion. + +Fri Jun 18 19:57:23 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * reloc.c (bfd_perform_relocation): Check for overflow on + pc-relative relocations if the howto asked for it. + +Fri Jun 18 16:00:20 1993 Jim Kingdon (kingdon@cygnus.com) + + * Makefile.in (stmp-bfd.h): Ignore nonzero exit status from grep. + +Fri Jun 18 16:54:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config/riscos.m{h,t}: New files. + * configure.{host,in}: Use them. + +Fri Jun 18 12:55:10 1993 K. Richard Pixley (rich@cygnus.com) + + * elf32-mips.c: comment change. This is a mips file, not 88k. + +Mon Jun 14 14:02:41 1993 Jim Kingdon (kingdon@cygnus.com) + + * cache.c (bfd_cache_init): Increment open_files and call close_one + if necessary. + (bfd_open_file): Don't increment open_files here. + +Fri Jun 18 10:00:14 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config/delta88.mh: Don't set CC. + + * Makefile.in: Add elf32-{mips,m88k,generic}. + elf32-{mips,m88k,generic}.c: New files. + targets.c (target_vector): Include bfd_elf32_{mips,m88k,generic}_vec. + elfcode.h (elf_object_p): Match elf32-generic for all machines which + don't match a different target. + +Fri Jun 18 03:12:12 1993 John Gilmore (gnu@cygnus.com) + + Eliminate "int8_type", "int16_type", "int32_type", and their + variants from the BFD universe. Leave the 64-bit types for now, + since they are in flux. + + * aoutx.h, hp300hpux.c: Eliminate needless (int32_type) casts. + * libaout.h (GET_SWORD): Convert (int32_type) to (int). + * ieee.c: Convert uint8e_type => unsigned char. + * oasys.c: Extensive changes to eliminate obsolete types. + These depend on changes in ../include/oasys.h as well. + * hosts/*.h: Remove declarations of all these types. + +Mon Jun 14 14:02:41 1993 Jim Kingdon (kingdon@cygnus.com) + + * hosts/delta88.h: #if 0 out some declarations which conflict with + system headers. + +Mon Jun 14 17:08:18 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com) + + * Makefile.in (install): remove parentdir cruft + +Mon Jun 14 19:04:09 1993 Stu Grossman (grossman@cygnus.com) + + * hppa.c (hppa_get_symbol_info): Remove redundant copy. + * Expurgate random DEFUNs that have crept in. + +Mon Jun 14 10:23:53 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_set_symbol_info): Constructor sections should + only be aligned to a 4 byte boundary. + +Sat Jun 12 16:13:17 1993 Jim Kingdon (kingdon@cygnus.com) + + * hosts/std-host.h (struct int64e_struct): Remove needless typedef + keyword. + +Fri Jun 11 14:25:34 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * aoutf1.h (sunos4_write_object_contents): set flags to 1, breaking + 1927 but fixing some other important things. + +Thu Jun 10 20:36:22 1993 Doug Evans (dje@canuck.cygnus.com) + + * hosts/std-host.h (int64e_type): Fix definition. + +Thu Jun 10 11:48:28 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_sec_to_styp_flags): Use STYP_MIPS_INIT for + section named _INIT. Don't set STYP_TEXT unless SEC_CODE is set. + (ecoff_styp_to_sec_flags): Treat a STYP_MIPS_INIT section like + a STYP_TEXT section. + +Wed Jun 9 16:48:13 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in (install, headers): don't put comments after a tab + in the actions section of a rule + +Wed Jun 9 15:00:01 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_mkobject_hook): Mark ZMAGIC files as D_PAGED. + (ecoff_write_object_contents): If not D_PAGED, don't add the + section headers to text_size. If not D_PAGED, set the magic + number to OMAGIC rather than ZMAGIC. If creating a D_PAGED + executable, the executable must fully occupy an even number of + pages. + (ecoff_set_symbol_info, make_bfd_asection, ecoff_little_vec, + ecoff_big_vec): Consistently set section alignment power to 4, + since ECOFF sections should be multiples of 16 bytes. + (ecoff_little_vec, ecoff_big_vec): Added D_PAGED to object_flags. + Made ar_pad_char and ar_max_namelen agree for both. + +Tue Jun 8 20:28:02 1993 Mark Eichin (eichin at tweedledumber) + + * elfcode.h (elf_slurp_symbol_table): subtract section vma from + symbol value, since bfd symbols are section relative, but ELF + symbols aren't. + +Tue Jun 8 12:08:27 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * cpu-i960.c, cpu-h8300.c (compatible): Make static. + +Tue Jun 8 14:27:56 1993 Jim Kingdon (kingdon@rtl.cygnus.com) + + * hosts/news.h, config/news.mh: New files. + +Tue Jun 8 12:08:27 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * bfd-in2.h, archures.c (bfd_mach_h8300[h]): new defines. + * coff-h8300.c: More addressing modes. + * coffcode.h (coff_set_arch_mach_hook): Cope with H8300 magic + number. + * cpu-h8300.c: Removed disassemble stuff. (h8300_scan): Recognise + H8/300H name. (compatible): New function. + * reloc16.c (bfd_coff_reloc16_get_relocated_sec): Cope with more + addressing modes. + +Tue Jun 8 10:30:13 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_compute_section_file_positions, + ecoff_write_object_contents): Only round to page boundaries if + D_PAGED flag is set for the output BFD. + +Fri Jun 4 15:47:52 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * coffcode.h (get_index, coff_slurp_symbol_table): Fix pointer + casts to work on machine where sizeof(long) != sizeof(int) != + sizeof(char *). + * coffgen.c (coff_get_normalized_symtab): Ditto. + * cpu-h8300.c coff-h8300.c: Support for H8/300-H. + +Fri Jun 4 15:24:27 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * coffgen.c (coff_write_symbols): For empty string table, write + out 4 in correct byte order. (from minyard@bnr.ca) + + * elf32-hppa.c: Don't include libhppa.h for now; define + BYTES_IN_WORD instead, until Utah sends a better fix. + (hppa_elf_build_arg_reloc_stub): Use xmalloc and xrealloc instead + of malloc and realloc. + +Fri Jun 4 07:49:01 1993 Ian Lance Taylor (ian@cygnus.com) + + * configure.in (mips-*-ecoffl*): New target; use decstation. + (mips-*-ecoff*): Added trailing '*'. + + * coff-mips.c (ecoff_get_debug): Get the offset from the first PDR + for the FDR, not from the first PDR in the file. + +Thu Jun 3 16:41:10 1993 Stu Grossman (grossman@cygnus.com) + + * hppa.c (hppa_get_symbol_info): New func needed for JUMP_TABLE. + +Thu Jun 3 15:33:57 1993 David J. Mackenzie (djm@rtl.cygnus.com) + + * hppa.c (hppa_get_symbol_info): New function. + +Thu Jun 3 13:07:42 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elfcode.h (elf_map_symbols): Don't crash if no symbols have been + allocated yet. + + From Peter Hoogenboom (hoogen@schafer.cs.utah.edu): + * libhppa.h (MAXCOMLEN): Define unconditionally. + (_PA_RISC_ID): Only define if not already defined. + * elf32-hppa.c: Include libhppa.h. + + From Ralph Campbell: + * hosts/mipsbsd.h (HOST_DATA_START_ADDR): Delete definition. + + * elf32-hppa.h (symext_rootP, symext_lastP): Delete decls. + +Thu Jun 3 00:23:53 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * config/go32.mh: define EXTRALIBES to -lm (for binutils), also + remove defines of __MSDOS__ and __GO32__ (these are in the + compiler now). + +Wed Jun 2 17:57:13 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + From Utah: + * hosts/hppabsd.h: Eliminate use of obsolete EXFUN. + * config/hppabsd.mh: Don't use ranlib. + +Tue Jun 1 04:15:57 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * elf.c: New file, for word-size independent code. + * elfcode.h (elf_hash): Moved to there, renamed bfd_elf_hash. + * Makefile.in: Include elf.o in standard objects. + + * bfd-in.h (CAT3): Define here. + * libaout.h, libelf.h: Not here. + + * libelf.h (struct strtab): Define here. + (bfd_elf_locate_sh): Declare here. + * elfcode.h (struct strtab): Definition deleted. + + * reloc.c (enum bfd_reloc_code_real): Added HPPA_PCREL_CALL_12. + + * Makefile.in: Make "all", not "bfd.h", be the default target. + (stmp-bfd.h): New target; prevents rebuilding world if bfd.h + hasn't really changed. + + Tue May 25 12:15:15 1993 Michael Meissner (meissner@osf.org) + + * elfcode.h (elf_hash): Provide elf standard hash function. + (various): Key off of the machines use_rela_p field to determine + whether to use REL or RELA relocations. + (elf_swap_reloc_out, elf_swap_reloc_in): New functions. + (elf_make_sections): Allocate a pointer to hold all data for a + given section, and copy each fragment into the data region. + Update the section's pointer with the REL implicit addends if the + machine uses REL relocation. + + * elf32-i386.c (elf_bfd_reloc_type_lookup): Rename to + elf_i386_bfd_reloc_type_lookup, and use cpp to map the name back + into was elf32-target.h expects. + (elf_info_to_howto): Rename to elf_i386_info_to_howto. + (elf_i386_bfd_reloc_type_lookup): Add relocation support. + (elf_i386_info_to_howto): Add minimal relocation support. + + * libelf.h (elf_backend_data): Add use_rela_p, elf_64_p, + elf_info_to_howto_rel fields. + + * elf32-target.h (elf_bed): Add support for new fields in + elf_backend_data. + + Sun May 30 16:38:24 1993 Peter Hoogenboom (hoogen@fast.cs.utah.edu) + + * elf32-hppa.c: Add symbol extension section support, fix + relocation howto table, add stub generation support. + + * elf32-hppa.h: Add symbol extension section support, fix + relocation howto table, add stub generation support. + + * elfcode.h (bfd_elf_locate_sh): New function to locate ELF + section header. + + * elfcode.h (bfd_add_to_strtab): Made non-static due to a call + from elf32-hppa.c. + + * elfcode.h (elf_idx_of_sym): Return STN_UNDEF instead of 0 when + the symbol is not found. + + * elfcode.h (elf_compute_section_file_positions): Not all section + file positions were computed. + + * elfcode.h (elf_get_sect_thunk): New function. + + * hppa.c (sign_ext): Reimplement. + + * hppa.c (round_down,round,round_up,L,R,LS,RS,LD,RD,LR,RR): Make + these functions static. + +Tue Jun 1 14:40:41 1993 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in (bfd.h): Move closer to headers - and after 'all'! + + * aoutx.h (translate_from_native_sym_flags): Don't set + BSF_DEBUGGING for constructor symbols, only BSF_CONSTRUCTOR. + * aoutx.h (translate_to_native_sym_flags): Translate + constructor symbols properly. + +Thu May 27 16:09:04 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * archures.c (bfd_default_arch_struct): use 4 byte alignment as a + minimum. + * aout-target.h (minimum_alignment): 8 byte alignment is right. + (fix ld/2680) + +Thu May 27 13:38:47 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * configure.in, Makefile.in: Build bfd-in2.h in source directory, + from bfd-in.h and .c files. Build bfd.h in build directory, + substituting in requested target word size. Insert word size into + makefile, and maybe enable 64-bit targets. + + * bfd-in.h, libbfd.c, demo64.c, targets.c: Define BFD64 if 64 bits + are available. Conditionalize on this. Assume HOST_64_BIT + will be defined if needed, so 64-bit targets are conditionalized + only in the Makefile. + +Tue May 25 14:03:56 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * libbfd.c (COERCE64): Rewrite to avoid out-of-range values. + + * coff-sh.c (rtype2howto): Put error message on stderr. + (extra_case): Delete unused variable. + + * coff-mips.c (ecoff_print_symbol): Cast bfd_vma values to long + before calling printf. + + * elfcode.h: New file, almost completely derived from old elf32.c. + * elf32.c: Now just define ARCH_SIZE and include elfcode.h. + * Makefile.in (elf64.o): List dependencies, don't build by + default. + (elf64.c): Add to list of sources. + (elf32.o): Update dependencies. + * elf32-*.c: Updated type/macro/structure names. Cleaned up + namespace pollution; rename vectors. + * targets.c, config/*-elf.mt: Updated. + * All uses of 32-bit versions of structures, routines, and macros + renamed. + + * Makefile.in (archures.o, targets.o): Depend on Makefile. + +Mon May 24 15:53:13 1993 Ken Raeburn (raeburn@cygnus.com) + + * elf32-i386.c (enum reloc_type): No comma after last enumerator. + + * elf32.c (elf_string_from_elf_section): Handle index of zero + specially. + (bfd_section_from_shdr, elf_slurp_symbol_table): Don't need to do + so here. + (elf_write_object_contents): Deleted one unused variable and + initialized another to avoid gcc warnings. + (elf_set_section_contents): Delete unused variable. + +Fri May 21 19:04:21 1993 Stu Grossman (grossman@cygnus.com) + + * i386lynx.c: New module for Lynx variant of a.out. + * Makefile.in (BFD_BACKENDS CFILES depends): Add i386lynx.c. + * gen-aout.c: Get rid of defunct endian stuff, print out true + pagesize. + * targets.c (target_vector): Add i386lynx_vec. + +Fri May 21 17:02:22 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * configure.in: Use i386-sco.mt for i[36]86-*-isc*. + +Fri May 21 13:44:18 1993 David J. Mackenzie (djm@rtl.cygnus.com) + + * aix386-core.c, aout-target.h, aoutx.h, coff-alpha.c, + coff-mips.c, coffgen.c, elf32.c, ieee.c, libaout.h, libcoff-in.h, + libelf.h, mipsbsd.c, oasys.c, sco-core.c, srec.c, tekhex.c, + trad-core.c: Define a TARGET_get_symbol_info function or macro. + Remove the bfd_print_symbol_nm case from TARGET_print_symbol. + + * bfd-in.h: Don't define bfd_print_symbol_nm. + Define symbol_info type. + (JUMP_TABLE): Set _get_symbol_info element. + + * syms.c (coff_section_type, bfd_symbol_info): New functions. + (bfd_decode_symclass): Use coff_section_type. + + * targets.c: Add bfd_get_symbol_info call. + +Wed May 19 15:30:52 1993 Stu Grossman (grossman@cygnus.com) + + * coff-i386.c (coff_i386_reloc): Use unsigned char to avoid + complaints from ancient gcc's. + +Wed May 19 15:51:19 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * trad-core.c: Check macro TRAD_CORE_EXTRA_SIZE_ALLOWED. + hosts/i386linux.h: Define it. + +Mon May 17 15:00:33 1993 Ken Raeburn (raeburn@deneb.cygnus.com) + + * VERSION, bfd-in.h: Bump version number to 2.2. + + * hppa.c (assemble_3, dis_assemble_3, assemble_12, + dis_assemble_12, assemble_17, dis_assemble_17, assemble_21, + dis_assemble_21, sign_ext, ones, sign_unext, low_sign_ext, + low_sign_unext, round_down, round, round_up, L, R, LS, RS, LD, RD, + LR, RR, hppa_field_adjust): New functions. + +Mon May 17 10:04:16 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_set_symbol_info): Added support for indirect + stabs symbols, including new indirect_ptr_ptr argument. + (ecoff_slurp_symbol_table): Pass new argument in calls to + ecoff_set_symbol_info. + +Fri May 14 00:05:06 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * configure.in: For m68k sysv systems, use m68k-coff. + + * config/hppa-elf.mt (TDEFINES): Don't define DEFAULT_VECTOR here. + (TDEFAULTS): Define it here. Use the new name. + + * elf32-hppa.c (elf_hppa_backend_data): Delete; rely on default + values instead. + + * reloc.c (bfd_reloc_code_real_type): Add some HPPA reloc types. + + * aix386-core.c (NO_GETS): Fix PROTO invocation to have correct + number of arguments. + (aix386_core_file_p): Initialize core_size to correct value. + +Wed May 12 14:39:59 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (CC_FOR_BUILD): New variable, set to $(CC). + (FLAGS_TO_PASS): Pass down CC_FOR_BUILD. + + * bout.c (aout32_slurp_extended_name_table): Define to be + _bfd_slurp_extended_name_table rather than bfd_true. + + * coff-mips.c: Include libaout.h and aout/aout64.h to get + definitions for N_SET[ATDB]. + (ecoff_howto_table): Moved near top of file. + (ecoff_set_symbol_info): If a STABS symbol of type N_SET[ATDB] is + seen, cook up a constructor section of the same name and put in a + reloc pointing to the symbol. This lets the GNU linker build + global constructors and destructors without using collect. + +Tue May 11 00:33:31 1993 John Gilmore (gnu@cygnus.com) + + * coff-m88k.c (m88kbcs_vec): Symbols have underbars. + +Mon May 10 05:55:45 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * hosts/miniframe.h: New file. + * configure.host: Use it. + +Sun May 9 16:36:59 1993 Fred Fish (fnf@cygnus.com) + + * configure.in (hppa*-*-bsd): Change to hppa*-*-bsd* + * configure.in (hppa*-*-hpux): Change to hppa*-*-hpux* + * configure.in (m68*-hp-bsd): Change to m68*-hp-bsd* + * configure.in (m68*-*-hpux): Change to m68*-*-hpux* + * configure.in (*-*-bsd): Change to *-*-bsd* + +Wed May 5 16:08:32 1993 Per Bothner (bothner@cygnus.com) + + * elf32-hppa.c (elf_hppa_reloc_type_lookup): Cast enums to + int, for the sake of the old Portable C Compiler. + +Mon May 3 14:37:01 1993 Stu Grossman (grossman@cygnus.com) + + * Makefile.in (CFILES): Add cpu-sh.c and coff-sh.c. + +Mon May 3 14:03:21 1993 Ken Raeburn (raeburn@deneb.cygnus.com) + + * configure.in: Get target name right for m68*-*-hpux. + +Sun May 2 11:39:44 1993 Fred Fish (fnf@cygnus.com) + + * trad-core.c (NO_SIGNED_GET): New macro. + * trad-core.c (trad_core_vec): Use new NO_SIGNED_GET instead of + signed NO_GET, where appropriate. + + * configure.in (i[34]86-*-linux*): Add; bfd_target = i386-linux. + * configure.in (*-*-linux*): Remove until linux port for a + non-i386/i486 system is actually available. + +Fri Apr 30 20:04:10 1993 Stu Grossman (grossman@cygnus.com) + + * libhppa.h: #undef e_* symbols which come from + when compiling under HPUX. + +Fri Apr 30 17:25:23 1993 Stu Grossman (grossman@cygnus.com) + + * The following patches are from Jeffrey Law . + * hppa.c (hppa_core_file_p): Provide a temporary dummy routine + for HOST_HPPABSD. + * hosts/hppabsd.h: Fix declarations of malloc and free. + * libhppa.h: Include sysdep here. Conditionalize + includes based on HOST_HPPAHPUX or HOST_HPPABSD. + Provide definitions for MAXCOMLEN and _PA_RISC_ID suitable + for BSD. + +Fri Apr 30 17:34:11 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elf32-hppa.c: Don't include a.out.h. Apparently not even the + GNU version is needed. + +Fri Apr 30 09:38:59 1993 Jim Kingdon (kingdon@cygnus.com) + + * coffcode.h: use dummy_reloc16_extra_cases rather than casting abort. + +Thu Apr 29 11:30:32 1993 Ken Raeburn (raeburn@deneb.cygnus.com) + + * Makefile.in: Build elf32-hppa.o. + + * syms.c (BSF_FUNCTION): New symbol flag. + + * elf32-hppa.c: Fixed to work with elf32-target.h. + + * hp300hpux.c (NAME, NAME_swap_exec_header_in): Fix for + traditional C. + * libaout.h (NAME): Don't define if already defined. + + * libelf.h: Protect against multiple inclusions. + (elf_symbol_type): Moved here, added new fields. + (struct elf_backend_data): New field `global_sym'; I suspect this + may be misplaced. + * elf32.c (elf_symbol_type): Deleted from here. + (struct elf_obj_tdata): New fields raw_syms and internal_syms, to + point to backend versions of symbols. + (obj_symbols, obj_raw_syms, obj_internal_syms): New macros. + (elf_swap_phdr_out, elf_build_phdrs, elf_write_phdrs): New + functions. + (elf_write_object_contents): Write program headers if appropriate. + (bfd_section_from_shdr): Unnamed sections get empty string for + name, not "unnamed". Handle SHT_NOBITS separately from + SHT_PROGBITS, and set some different flags. + (elf_file_p): New routine. + (elf_object_p, elf_core_file_p): Call it. + (elf_object_p): Handle EM_HPPA. + (elf_symbol_from, elf_idx_of_sym): New functions. + (elf_make_sections): Get symbol number right for relocations. Set + SHF_ALLOC, SHF_WRITE, SHF_EXECINSTR when appropriate. + (elf_fake_sections): BSS section should be SHT_NOBITS, not + SHT_PROGBITS. Always generate symtab and strtab, not only if + relocations are needed. Set SHF_* flags as appropriate. + (elf_compute_section_file_positions): Handle bfd_arch_hppa. + (elf_write_object_contents): Fix off-by-one error in symbol count. + Store a correct value for the symbol; write the size field + properly; make some guesses about the type field. Set section + type correctly for string tables. + (section_from_elf_index): Check for absolute and common sections + first. + (elf_section_from_bfd_section): Ditto. + (elf_slurp_symbol_table): Use elf_symbol_type instead of asymbol. + Use empty string instead of "unnamed" for nameless symbols. + Handle STTY_FUNC type, and weirdness with "$global$" symbol for + HPPA (only?). Don't free raw symbols; keep the pointer around for + later. + (elf_set_arch_mach): Handle bfd_arch_hppa. + (elf_find_nearest_line): Just return false. + (elf_write_object_contents, elf_set_section_contents): Set + output_has_begun field after computing file positions. + (elf_set_section_contents): Write section contents immediately, + rather than caching the whole file and writing it at close time. + + * libhppa.h (enum hppa_reloc_field_selector_type, enum + hppa_reloc_field_selector_typ_alt, enum hppa_reloc_expr_type, enum + hppa_reloc_expr_type_alt): New enumerator types. + + * config/hppa-elf.mt,. config/hppaosf.mh: HP PA/OSF support. + * configure.in, configure.host: Use them. + +Wed Apr 28 23:21:01 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elf32-target.h: Allow overrides of armap defaults. + + * elf32-hppa.c, elf32-hppa.h: New files. + + * config/hp300hpux.mt: New file. + +Tue Apr 27 05:39:40 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * aix386-core.c (NO_GETS): New macro; NO_GET for signed values. + (aix386_core_vec): Update for new fields. + + * archive.c (bfd_generic_archive_p): Call target-specific + slurp_armap code, instead of bfd_slurp_armap. + (bfd_slurp_bsd_armap_f2): New function. + * libbfd-in.h (bfd_slurp_bsd_armap_f2): Declare it. + * aout-target.h (AR_PAD_CHAR): Define it if not already defined. + (vec): Use it. + * libaout.h (struct aoutdata): New field for subformat, for + differentiating between highly similar a.out formats. + * aoutx.h (NAME_swap_exec_header_in): New macro, defaults to local + version of function. + (swap_exec_header_in): Don't define if NAME_swap_exec_header_in is + already defined. + * hp300hpux.c: New file. + * Makefile.in: Include it. + +Mon Apr 26 13:24:43 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * Makefile.in, archures.c, coffcode.h, targets.c: Support for + Hitachi SH. + +Mon Apr 26 13:55:42 1993 Jim Kingdon (kingdon@cygnus.com) + + * trad-core.c (trad_unix_core_file_p): Check the file size. + +Mon Apr 26 13:24:43 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-alpha.c: Remove duplicate function and add warnings. + +Mon Apr 26 11:25:58 1993 Ian Lance Taylor (ian@cygnus.com) + + * sco-core.c (sco_core_vec): Add initializers for new target + fields. + +Sat Apr 24 21:33:45 1993 Jim Kingdon (kingdon@cygnus.com) + + * coffcode.h [_LIT]: Recognize .lit section. + +Fri Apr 23 19:00:36 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-alpha.c, cpu-alpha.c, config/alphaosf.mt, + config/alphaosf.mt, hosts/alphaosf.h: New files. + +Fri Apr 23 16:48:46 1993 Stu Grossman (grossman@cygnus.com) + + * Merge in HPPA/BSD changes from Utah. + * hppa.c: Use this for both HPUX & BSD. + * targets.c: Enable hppa_vec for both HPUX & BSD. + * config/hppabsd.mt: TDEFINES => TDEFAULTS. + * hosts/hppabsd.h: #define HOST_HPPABSD. + +Wed Apr 21 01:50:10 1993 John Gilmore (gnu@cygnus.com) + + * libbfd.c: Whitespace changes around byteswap macros. + * libbfd-in.h: Whitespace changes around byteswap declarations. + +Tue Apr 20 15:59:07 1993 Stu Grossman (grossman@cygnus.com) + + * aoutf1.h (sunos4_core_file_p): Don't default bfd_error to + system_error anymore. It confuses bfd_check_format(). + +Mon Apr 19 23:03:08 1993 Stu Grossman (grossman@cygnus.com) + + * bfd.c: Add sgi_core_data to tdata union. + * coff-mips.c: Add Irix 4.x core file support. + * hosts/irix4.h: #define HOST_IRIX4. + +Mon Apr 19 18:52:52 1993 Ken Raeburn (raeburn@deneb.cygnus.com) + + * aoutx.h (translate_from_native_sym_flags): Check that the + symbol's section does get set. + (slurp_symbol_table): Zero index means null-string name. + + * aoutx.h (struct stringtab_entry, struct stringtab_data): New + data structures. + (hash, stringtab_init, add_to_stringtab, emit_strtab, compare): + New functions. + (write_syms): Use them, to reduce string table size. + +Mon Apr 19 16:45:12 1993 Fred Fish (fnf@cygnus.com) + + * trad-core.c (trad_core_vec): Add 6 new initializers to match + new signed get/put fields. Minor reformatting to label + some fields. + +Mon Apr 19 06:09:41 1993 Jim Kingdon (kingdon@cygnus.com) + + * bfd-in.h: Insert comment about SVR3 compiler warnings. + + * hosts/{hp300,i386isc,i386v}.h: Remove unused #defines of {r,}index + (bfd uses strchr and the broken SVR3.2 cpp loses with the defines). + + * libbfd.c: bfd_put*: Remove casts to bfd_vma. + +Fri Apr 16 17:49:27 1993 Jim Kingdon (kingdon@cygnus.com) + + * aoutf1.h (internal_sunos_core): Make c_stacktop a bfd_vma. + (swapcore_sparc): Make sp a bfd_vma. + +Thu Apr 15 09:09:18 1993 Jim Kingdon (kingdon@cygnus.com) + + * libbfd.c: Add signed versions of bfd_{h_,}{get,put}_signed_. + libbfd.c, libbfd-in.h: Add _do*signed*. + targets.c, all targets: Add bfd*signed*. + bfd-in.h: Add bfd_signed_vma. Add comments. + + * bfd-in.h (bfd_error), bfd.c (bfd_errmsgs): Add file_truncated. + + * format.c (bfd_check_error): Check error return from + _bfd_check_format routines. + +Wed Apr 14 23:48:25 1993 Jim Kingdon (kingdon@cygnus.com) + + * rs6000-core.c (rs6000coff_core_p): Improve error checking and + recognize .data section if present. + +Thu Apr 15 01:00:29 1993 John Gilmore (gnu@cygnus.com) + + * aoutx.h (aout_*_adjust_sizes_and_vmas): Avoid `sanity' + check for the case where the user sets the address of the BSS + section (and the file header can't specify this). Let the user + set it wherever they want, regardless of what goes in the header. + + * ieee.c (ieee_slurp_sections): Pass all ieee section names + straight through into BFD sections. Add comments. + +Wed Apr 14 20:34:54 1993 John Gilmore (gnu@cygnus.com) + + Cleanup in preparation for better 64-bit host support. + + * bfd-in.h (bfd_64_type): Remove. + * libbfd.c (_do_getb64, _do_putb64): Use bfd_vma, not bfd_64_type. + + * bfd-in.h (bfd_size): Remove. + + * bfd-in.h (bfd_offset): Remove, after fixing ld/ldlang.[ch]. + + * bfd-in.h (bfd_word): Remove. + * reloc.c (reloc_howto_type): Replace bfd_word with bfd_vma. + + * bfd-in.h (rawdata_offset): Remove. + * reloc.c (arelent): Replace rawdata_offset with bfd_size_type. + (bfd_perform_relocation): Lint. + (enum bfd_reloc_status): Comment cleanup. + + * aout-adobe.c, cpu-h8300.c, mipsbsd.c, srec.c: lint -Wall. + +Tue Apr 13 11:19:52 1993 Jim Kingdon (kingdon@cygnus.com) + + * aoutf1.h (swapcore_sparc): Guess the right value of USRSTACK. + +Mon Apr 12 14:18:00 1993 John Gilmore (gnu@cygnus.com) + + * elf32.c: Clean up old comments. + +Fri Apr 9 10:43:20 1993 Ian Lance Taylor (ian@cygnus.com) + + * config/sun3.h: String argument to fprintf is const. + + * coff-mips.c: Renamed PAGE_SIZE to ROUND_SIZE, to avoid confusion + on systems which define PAGE_SIZE in . + +Thu Apr 8 10:28:00 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * trad-core.c (trad_unix_core_file_failing_signal): Use new macro + TRAD_UNIX_CORE_FILE_FAILING_SIGNAL to allow host files to specify + the core file failing signal. + * hosts/decstation.h (TRAD_UNIX_CORE_FILE_FAILING_SIGNAL): Define + to supply the core file failing signal. + +Thu Apr 8 09:17:35 1993 Ian Lance Taylor (ian@cygnus.com) + + * coffcode.h (styp_to_sec_flags): Only set SEC_SHARED_LIBRARY for + a STYP_NOLOAD | STYP_BSS section if BSS_NOLOAD_IS_SHARED_LIBRARY + is defined. On many COFF targets STYP_BSS is always STYP_NOLOAD. + * coff-i386.h (BSS_NOLOAD_IS_SHARED_LIBRARY): Define. + +Wed Apr 7 11:33:06 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (PAGESIZE): Correct value. + +Tue Apr 6 12:05:44 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_find_nearest_line): Address of first PDR is + an offset (patch from Jean-Daniel Fekete ). + +Mon Apr 5 12:07:12 1993 Ian Lance Taylor (ian@cygnus.com) + + * coffcode.h (styp_to_sec_flags): Set SEC_SHARED_LIBRARY for a + STYP_NOLOAD | STYP_BSS section. Don't set SEC_NEVER_LOAD for a + STYP_INFO section. + (coff_compute_section_file_positions): Force vma and lma of _LIB + section to be zero. + (coff_set_section_contents): Count number of entries in new lma + field, not in vma. + * coffgen.c (make_a_section_from_file): Force lineno_count of + SEC_SHARED_LIBRARY section to be zero, since it is non-zero on the + SCO 3.2v4 shared library. + * seclet.c (rel): Copy over any section with contents, not just + loadable sections. + + * coff-mips.c (ecoff_make_empty_symbol): Zero out newly allocated + symbol. + + * coff-i386.c (coff_i386_reloc): New function, to generate + relocateable output correctly. + (howto_table): Use coff_i386_reloc for all reloc types. + (CALC_ADDEND): Use a more efficient hack to get the correct addend + for a common symbol. + (i386comm_value): Removed; no longer needed. + +Sun Apr 4 15:08:48 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * coffcode.h (coff_set_section_contents): Don't write out + sections without a filepos. + +Fri Apr 2 14:35:05 1993 Ian Lance Taylor (ian@cygnus.com) + + * seclet.c (seclet_dump_seclet): Correct SEC_HAS_CONTENTS test. + +Wed Mar 31 17:41:05 1993 Ian Lance Taylor (ian@cygnus.com) + + * reloc.c (bfd_reloc_code_real_type): Added BFD_RELOC_MIPS_GPREL. + * libecoff.h (ecoff_data_type): Added gp_size field. + * coff-mips.c (ecoff_mkobject_hook): Initialize gp_size to 8. + (ecoff_set_symbol_info): Compare against gp_size, not hardcoded 8. + Set flags to 0 for large common symbols. + (ecoff_gprel_reloc): Handle non-zero addend for external symbols, + which can occur for gas-generated relocs. + (ecoff_bfd_reloc_type_lookup): Added BFD_RELOC_MIPS_GPREL case. + * bfd.c (bfd_get_gp_size, bfd_set_gp_size): New functions. + * Makefile.in (bfd.o): Now depends on coff/sym.h and libecoff.h. + +Tue Mar 30 09:33:16 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * srec.c (srec_set_section_contents): Use lma field for load + address. + * section.c: Add declaration of lma field to section structure. + * coffcode.h (coff_write_object_contents): Use lma field for load + address. + * bfd-in.h (bfd_set_section_vma): Set lma along with vma. + + * aoutx.h (translate_from_native_sym_flags): Now handles indirect + symbols in a better way. (translate_to_native_sym_flag): Set the + N_INDR bit when necessary. (aout<>slurp_symbol_table): Maintain + indirect state. + * section.c: Added BFD_IND_SECTION_NAME and bfd_ind_section. + (bfd_make_section): Cope with new builtin section. + * syms.c (bfd_decode_symclass): Can now print indirect section + info. + +Wed Mar 24 13:36:33 1993 Per Bothner (bothner@rtl.cygnus.com) + + * aout-target.h (MY(object_p)): Fail if MACHTYPE_OK is + defined, and yields false. + * aout-mipsbsd.c, i386bsd.c: Define MACHTYPE_OK appropriately. + + * archive.c (snarf_ar_hdr): Add support for reading (only, + so far) BSD-4.4-style extended headers. + * archive.c: Some more comments. + +Wed Mar 24 02:05:10 1993 david d `zoo' zuhn (zoo at poseidon.cygnus.com) + + * Makefile.in: fix rule for dvi and info, so that the recursive + makes does the right thing, instead of always info + +Wed Mar 24 02:56:44 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * libbfd.c (bfd_seek): Disable optimized handling for archives and + archive members; they need more special reatment. For now, verify + that computed and actual file positions correspond. + +Tue Mar 23 08:45:33 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * mipsbsd.c: Renamed from aout-mipsbsd.c. + (set_arch_mach): Delete non-MIPS code. + (reloc_howto_type_lookup): Ditto. + * Makefile.in: Adjusted. + + * libbfd.c (bfd_tell): Update `where' field. + (bfd_seek): Don't do anything if we're not changing the file + position. If FILE_OFFSET_IS_CHAR_INDEX is defined, check `where' + field against a SEEK_SET request. Call bfd_tell to re-update + `where' field when done. + (bfd_read, bfd_write) [FILE_OFFSET_IS_CHAR_INDEX]: Maintain + `where' field. + * hosts/sparc.h: Define FILE_OFFSET_IS_CHAR_INDEX. + +Mon Mar 22 23:18:10 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: added installcheck target + +Mon Mar 22 14:57:18 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_set_symbol_info): Relocate encapsulated stabs + if the type is not stNil. + +Tue Mar 16 10:35:27 1993 Ken Raeburn (raeburn@cygnus.com) + + * elf32.c (elf_little_vec, elf_big_vec): Delete now-invalid + forward declarations. + + * elf32-sparc.c (elf_sparc_howto_table): Don't use CONST here, + it's implied by the type. + +Fri Mar 12 18:58:08 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.host: recognize sparc-sun-solaris2* instead of sparc-sun-solaris* + +Tue Mar 9 09:23:12 1993 Jim Kingdon (kingdon@cygnus.com) + + * rs6000-core.c: Add .ldinfo section. + +Fri Mar 12 11:57:52 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (MAKEOVERRIDES): Define to be empty. + +Fri Mar 12 08:32:11 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * section.c (bfd_set_section_contents): whitespace + * seclet.c (seclet_dump_seclet): Don't try and fill sections with + no contents. + +Thu Mar 11 19:26:15 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * hosts/go32.h: don't define POSIX_UTIME + +Tue Mar 9 10:52:01 1993 Fred Fish (fnf@cygnus.com) + + * elf32.c (elf_object_p): Use ELF_ARCH stored in xvec to match + against machine architecture stored in the ELF header, to resolve + ambiguities. + * elf32.c (bfd_section_from_shdr): Bfd_make_section can return + NULL, so only use results when non-NULL. + * targets.c (elf32_m68k_vec, elf32_i860_vec): Add extern decls + and add to vector of targets. + +Mon Mar 8 15:13:44 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_set_symbol_info): Encapsulated STABS symbols + are always just debugging symbols. + + * coff-mips.c (ecoff_[gs]et_sym_index): Moved macros from here... + libecoff.h (ecoff_[gs]et_sym_index): ...to here. + +Mon Mar 8 14:55:13 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * hppa.c (_PA_RISC_ID): Defined if not already defined (e.g., for + hpux 7). Patch from friedman@gnu.ai.mit.edu. + (hppa_object_p): Only check for DL_MAGIC and SHL_MAGIC if they're + defined, which they aren't in hpux 7.0. + + * aix386-core.c: Include uinfo.h and coredump.h. Patch from Minh + Tran-Le, tranle@intellicorp.com. + +Fri Mar 5 14:54:21 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_generic_reloc): If the addend is non-zero, go + ahead and do the relocation. + (ecoff_refhi_reloc): Don't to the relocation here, just remember + what needs to be done. + (ecoff_reflo_reloc): Do the REFHI relocation here. + +Thu Mar 4 14:44:01 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_bfd_reloc_type_lookup): New function. + (ecoff_write_object_contents): Added BFD_ASSERT calls to ensure + relocs are reasonable. + * coff-msym.c: Eliminated uses of DEFUN. + (ecoff_swap_tir_out): New function. + +Tue Mar 2 17:52:58 1993 Fred Fish (fnf@cygnus.com) + + (Ultrix 2.2 support from Michael Rendell ) + * configure.host (vax-*-ultrix2*): Add triplet. + * hosts/vaxult2.h: New file. + * config/vaxult2.mh: New file. + + * aoutx.h (string.h): Include for strchr and friends. + * archive.c (string.h): Include for memchr and friends. + * elf32.c (string.h): Include for strrchr and friends. + +Sat Feb 27 00:44:24 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * aoutf1.c (sunos4_reloc_type_lookup): Unused; deleted. + (MY_set_sizes): Use sunos4_set_sizes. + + * elf32.c: Renamed from elf.c. Several CPU-specific functions + deleted, as well as elf-big and elf-little targets. + * libelf.h: New file. + * elf32-sparc.c, elf32-i386.c, elf32-i860.c, elf32-m68k.c: New + files, new targets. + * Makefile.in, config/*-elf.mt, targets.c: Adjusted. + + * i386linux.c (TARGETNAME): Use hyphens instead of parentheses. + + * coffcode.h (coff_compute_section_file_positions): Don't need + variable "old_sofar" if compiling for i960. + + * reloc.c (bfd_default_reloc_type_lookup): First argument is now a + bfd pointer. + * libbfd.h: Updated. + + * ieee.c (exten, envi): "static" belongs first in declaration. + +Fri Feb 26 17:37:34 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * srec.c: add support for symbolsrec, srecords with symbols in + them. + +Thu Feb 25 11:43:30 1993 John Gilmore (gnu@cacophony.cygnus.com) + + * ieee.c: cast all arguments of ieee_write_byte to bfd_byte + to avoid lint complaints. + +Thu Feb 25 02:15:52 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elf.c (elf_write_object_contents): Section ".shstrtab" should be + type SHT_STRTAB. Don't alter file offset for section 0. + (reloc_type_names): Now an array instead of a macro. Still inside + "#if 0", since it's used only in debugging code also in "#if 0". + (struct elf_reloc_map_elt, struct elf_reloc_map): New types. + (sort_reloc_map): New function. + (sparc_reloc_map): New variable. + (elf_bfd_reloc_type_lookup): New function. + +Tue Feb 23 12:17:16 1993 Ian Lance Taylor (ian@cygnus.com) + + * bfd-in.h (JUMP_TABLE): Added bfd_reloc_type_lookup and + bfd_make_debug_symbol; they were already in the target structure. + * Adjusted all uses of JUMP_TABLE. + * coffgen.c, libcoff-in.h (coff_bfd_make_debug_symbol): Renamed + from coff_make_debug_symbol. + * libcoff.h: Updated accordingly. + + * Minor cleanups provoked by gcc warnings: + * aoutx.h (NAME(aout, reloc_type_lookup)), + cpu-h8300.c (local_bfd_reloc_type_lookup), + cpu-z8k.c (local_bfd_reloc_type_lookup): Added default case to + switches. + * archive.c (do_slurp_bsd_armap, do_slurp_coff_armap), + ieee.c (ieee_slurp_section_data), + elf.c (elf_make_sections, elf_fake_sections, + elf_compute_section_file_positions, elf_write_object_contents): + Removed unused variables. + * archures.c: Removed /* from within comment. + * bout.c (b_out_squirt_out_relocs): Initialize r_extern. + * oasys.c (oasys_write_data): Initialize i. + +Mon Feb 22 18:40:06 1993 Per Bothner (bothner@rtl.cygnus.com) + + * libcoff.h (obj_raw_syment_coun): New macro. + * coffgen.c (coff_get_normalized_symtab): Initialize + raw_syment_count. + * coffgen.c (coff_find_nearest_line): Numerous little fixes. + +Mon Feb 22 15:03:07 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_set_symbol_info): stBlock symbols are always + debugging symbols. + (ecoff_get_debug): Offset the fdr adr by the adr of the first pdr, + for compatibility with tools from MIPS. + + * config/bigmips.mt: New file; default vector is ecoff_big_vec. + * config/irix3.mt, config/irix4.mt: Removed. + * configure.in (mips-*-ecoff): New target; uses bigmips.mt. + (mips-sgi-*, mips-big-*): Use bigmips rather than irix3. + +Wed Feb 17 23:40:41 1993 John Gilmore (gnu@cygnus.com) + + * hosts/hp300bsd.h: Add gross hack to determine whether we + are running on BSD 4.3 or BSD 4.4, and use appropriate include + files (and set other parameters) to match. + +Wed Feb 17 12:28:13 1993 K. Richard Pixley (rich@cygnus.com) + + * trad-core.c (trad_unix_make_empty_symbol): wrap PARAMS around an + ansi definition which otherwise confuses non-ansi compilers. + + * aout-adobe.c (aout_adobe_object_p): eliminate a warning from vax + ultrix cc by forward declaring getenv as is done in + bfd_find_target. + +Tue Feb 16 17:56:58 1993 K. Richard Pixley (rich@cygnus.com) + + * elf.c (elf_info_to_howto): cast an enum into unsigned char + avoiding a fatal error in vax ultrix 4.2 cc. + +Tue Feb 16 00:44:54 1993 John Gilmore (gnu@cygnus.com) + + * bfd-in.h, VERSION: Roll to version 2.1. + +Mon Feb 15 20:43:51 1993 John Gilmore (gnu@cygnus.com) + + * oasys.c (oasys_write_object_contents): Lint. + * srec.c: Whitespace cleanup. + +Fri Feb 12 14:23:07 1993 Ian Lance Taylor (ian@cygnus.com) + + * coffgen.c (coff_print_symbol): Print correct tagndx value; + cleaned up output formatting a bit. + +Fri Feb 12 08:28:56 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * coffcode.h (coff_set_arch_mach_hook): *FIXME* the H8/300 is always + relaxable. Should be moved somewhere else. + +Thu Feb 11 14:09:42 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * aout-mipsbsd.c: Eliminated uses of DEFUN. + (aout_mips_*_vec): Added seclet_link element. + + * Makefile.in (BFD_BACKENDS, CFILES, aout-mipsbsd.o): Added + support for aout-mipsbsd target. + + * bout.c (get_value): Don't truncate 32-bit addend to 16 bits. + +Fri Feb 5 08:08:43 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * cpu-h8500.c (scan_mach): return false if it's not an H8/500 + +Thu Feb 4 12:52:40 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + Add support for the H8/500 + + * coff-h8500.c, cpu-h8500.c, archures.c, coffcode.h, targets.c + +Thu Feb 4 12:35:02 1993 Ian Lance Taylor (ian@cygnus.com) + + * libecoff.h: New file. Defines ECOFF backend data for gdb. + * coff-mips.c: Now includes libecoff.h. + (ecoff_data_type): Moved to libecoff.h. + (ecoff_slurp_symbolic_info): Made globally visible so that gdb can + call it. If there is ever another ECOFF target, this and the + swapping functions should be accessed via an ECOFF specific target + vector. + * Makefile.in (coff-mips.o): Depends on libecoff.h. + +Wed Feb 3 09:14:36 1993 Ian Lance Taylor (ian@cygnus.com) + + * coffcode.h: Removed MIPS specific information, since coff-mips.c + no longer includes this file. + + * coff-msym.c (ecoff_swap_fdr_in, ecoff_swap_ext_in): Set reserved + bits to 0 to make comparison test useful. + + * config/irix3.mh, config/irix4.mh (HDEFINES): Set to -G 4 to + avoid overflowing GP accessible sections in binutils/objdump. + +Tue Feb 2 15:36:55 1993 Per Bothner (bothner@cygnus.com) + + * aoutx.h (NAME(aout,slurp_symbol_table)): Made symbol + reading more robust: Fail if string index is out of string + table range. + +Tue Feb 2 11:43:25 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * bout.c (b_out_get_relocated_section_contents, cases PCREL24 and + PCREL13): Don't take dst_address into account; the input file has + already taken care of that. + +Tue Feb 2 11:41:06 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c: Completed support for linker and binutils. + +Mon Feb 1 14:45:38 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * bout.c (b_out_get_relocated_section_contents, case ABS32): Keep + original addend from section contents. + +Thu Jan 28 21:01:37 1993 John Gilmore (gnu@cygnus.com) + + Fix minor bugs reported by Carl Greco, : + * hosts/delta88.h (strtol): Fix prototype. + * config/m88k-coff.mt (SELECT_ARCHITECTURES): Fix name. + +Wed Jan 27 17:16:51 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elf.c: Get rid of "#ifdef sparc". + (RELOC_TYPE_NAMES): Never used (currently), so don't include it. + (elf_sparc_howto_table): Renamed from elf_howto_table, and always + used. + (elf_info_to_howto): Use runtime conditionals on CPU type, not + compile type conditionals on host CPU. + (elf_little_vec, elf_big_vec): Use bfd_default_reloc_type_lookup, + not null pointer. + (reloc_type, RELOC_TYPE_NAMES): Include i386 values. + +Tue Jan 26 11:43:14 1993 Ian Lance Taylor (ian@cygnus.com) + + * section.c (SEC_IS_COMMON): New section flag, needed for MIPS + ECOFF which has two common sections. + (bfd_com_section): Set SEC_IS_COMMON flag. + * bfd-in.h (bfd_is_com_section): New macro to test SEC_IS_COMMON. + * aoutx.h, archive.c, bout.c, coff-a29k.c, coff-m88k.c, + coff-mips.c, coffgen.c, ieee.c, oasys.c, reloc.c, syms.c: Use + bfd_is_com_section macro rather than checking for equality to + bfd_com_section. + +Mon Jan 25 15:27:36 1993 Ian Lance Taylor (ian@cygnus.com) + + * coffcode.h (_bfd_coff_mkobject_hook): Pass aouthdr argument. + (coff_mkobject_hook): Accept aouthdr argument. + * coffgen.c (coff_real_object_p): Pass aouthdr to mkobject_hook. + Handle NULL aouthdr argument. + (coff_object_p): If there is no aouthdr, pass it as NULL to + coff_real_object_p. + * libcoff.h: Rebuilt for mkobject_hook changes. + + * coffswap.h (coff_swap_aouthdr_in, coff_swap_aouthdr_in): Swap + additional MIPS ECOFF fields. + +Sat Jan 23 18:36:20 PST 1993 Ralph Campbell (ralphc@pyramid.com) + + * configure.host: added mips-dec-bsd* + * configure.in: added mips-dec-bsd* + * aout-mipsbsd.c: new file for mips-dec-bsd* + * aout-target.h: don't define '' if 'MY_BFD_TARGET' is defined. + * aoutx.h: added mips support. + * archures.c: added mips support to bfd_default_scan(). + * cpu-mips.c: added support for R4000 (untested). + * libaout.h: added MIPS1 & MIPS2 magic numbers. + * reloc.c: fix typo's in comments. Added BFD_RELOC entries which I + hope will make it into include/bfd.h. + * targets.c: added aout_mips_*_vec. + +Wed Jan 20 17:15:52 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * config/decstation.mt: Set DEFAULT_VECTOR to ecoff_little_vec. + +Tue Jan 19 09:06:14 1993 Ian Lance Taylor (ian@cygnus.com) + + * bfd-in.h (bfd_asymbol_value): Add needed parentheses. + + * libcoff-in.h: Update prototype for coff_count_linenumbers. + +Fri Jan 15 18:13:17 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-msym.c (ecoff_swap_hdr_out, ecoff_swap_fdr_out, + ecoff_swap_pdr_out, ecoff_swap_sym_out, ecoff_swap_ext_out, + ecoff_swap_rndx_out, ecoff_swap_rfd_out, ecoff_swap_opt_in, + ecoff_swap_opt_out, ecoff_swap_dnr_in, ecoff_swap_dnr_out): New + functions. + * coffswap.h: If NO_COFF_RELOCS is defined, don't define + bfd_swap_reloc_in or coff_swap_reloc_out. + * coff-mips.c: Added code to link and write out symbolic debugging + information, and to swap relocs in and out. + +Thu Jan 14 15:51:58 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * libcoff.h, coffgen.c (coff_count_linenumbers), coffcode.h + (coff_write_object_contents): coff_count_linenumbers returns the + number of line number records it found. + + * coffgen.c (coff_write_linenumbers): only write out line numbers + in the section they belong to. + +Mon Jan 11 18:32:22 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * targets.c (bfd_target): Added relocateable argument to + _bfd_get_relocated_section_contents. Added _bfd_seclet_link + target vector for linker use. + * bfd.c (bfd_seclet_link): New macro. + * bfd-in.h (JUMP_TABLE): Added _bfd_seclet_link. + * seclet.c (rel, seclet_dump_seclet): Added relocateable argument + and boolean return value. Made static. + (bfd_generic_seclet_link): Renamed from seclet_dump. Added + relocateable argument. + * reloc.c (bfd_generic_get_relocated_section_contents): Added + relocateable argument (if relocateable, saves relocs). + * bout.c (b_out_get_relocated_section_contents), + reloc16.c (bfd_coff_reloc16_get_relocated_section_contents): Added + relocateable argument (if relocateable, just calls + bfd_generic_get_relocated_section_contents). + * libcoff-in.h (bfd_coff_reloc16_get_value): Added relocateable + argument to prototype. + * All targets: Set new _bfd_seclet_link vector to + bfd_generic_seclet_link. + +Sat Jan 9 21:29:32 1993 Stu Grossman (grossman at cygnus.com) + + * coffgen.c: #include seclet.h. + +Sat Jan 9 19:48:14 1993 Stu Grossman (grossman at cygnus.com) + + * hppa.c (hppa_object_setup): Get rid of all knowledge of stabs + debug info. Setup info about linker symbols only, and use + standard bfd fields to hold the info. + * (hppa_object_p): Remove unneeded decls. + * (hppa_new_section_hook): Get rid of most of this. + * libhppa.h (struct hppadata): Remove ten pounds of useless ugly + fat. Remove all knowledge of stabs, remove redundant knowledge of + linker symbols. + * Remove macros for accessing fields which are now gone. + +Fri Jan 8 15:20:00 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * coffcode.h (sec_to_styp_flags): allow SEC_NEVER_LOAD to turn on + STYP_NOLOAD bit. + * coff-z8k.c: delete unused reloc functions + +Fri Jan 8 15:47:53 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * bfd.c (struct _bfd): Added ecoff_tdata to tdata union. + * targets.c (enum target_flavour): Added bfd_target_ecoff_flavour. + * coff-msym.c: Use DEFUN for function definitons. + * coff-mips.c: Added code to read and print symbols, and to find + line numbers. + + * coffcode.h: Moved many generic functions into coffgen.c. Moved + swapping functions into coffswap.h for ECOFF use. Moved + relocation functions, only used by h8300 and z8k, into reloc16.c. + Added hooks for coffgen.c functions to backend data structure, and + added hook functions. Still more could be done. + * coffswap.h: New file to hold COFF swapping routines. + * coffgen.c: New file to hold generic COFF functions. + * reloc16.c: New file to hold h8300 and z8k specific relocation + functions. + * libcoff-in.h: Added declarations for functions in coffgen.c. + * libcoff.h: Rebuilt to incorporate changes. + * coff-h8300.c: Function name changes. + * coff-z8k.c: Function name changes. Use coff_reloc16_extra_cases + hook rather than defining EXTRA_CASES. + * Makefile.in: Build new files coffgen and reloc16. Added + dependencies of coff-*.o on coffswap.h and seclet.h. + +Thu Jan 7 16:16:26 1993 Per Bothner (bothner@cygnus.com) + + * ieee.c (ieee_slurp_sections): Add cast to avoid warning + about discarding const. + +Wed Jan 6 00:16:49 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * archive.c, seclet.c, elf.c use bfd_xmalloc instead of malloc + +Tue Jan 5 09:35:57 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * configure.in (post-target): If --with-minimal-bfd is specified, + set MINIMIZE=1. + +Mon Jan 4 07:20:01 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * srec.c (srec_write_records): one of my boards wants a CR between + records. + +Wed Dec 30 12:46:30 1992 Ian Lance Taylor (ian@cygnus.com) + + * archive.c (do_slurp_coff_armap): set symdef_count correctly + (it broke a couple of weeks ago). + +Tue Dec 29 21:41:05 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elf.c (bfd_elf_find_section): Switch back to "struct ..." for + return type, so libbfd.h doesn't reference undefined typedefnames. + +Tue Dec 29 13:54:35 1992 Ian Lance Taylor (ian@cygnus.com) + + * coffcode.h (coff_real_object_p): use name I386AIXMAGIC rather + than I386SVMAGIC. + (coff_pointerize_aux): don't pointerize a negative tagndx + (sometimes generated by SCO 3.2v4 cc). + + * bout.c (calljx_callback, callj_callback, + b_out_get_relocated_section_contents): warn if relocating against + an undefined symbol. + +Mon Dec 28 14:30:55 1992 Stu Grossman (grossman at cygnus.com) + + * hppa.c: Get rid of DEFUN, use more conventional prolog stuff. + Make a bunch more routines be static. + * hppa.c (fill_spaces): Get rid of this, replace with much better + written setup_sections(). + * (setup_sections): New routine to create BFD sections for each + space and subspace in SOM files. + * (hppa_object_setup): Use BFD sections created by + setup_sections() to locate GDB symbol table info. + * (make_unique_section): New routine to create a BFD section. It + ensures that the given name is unique, and will generate a unique + one if necessary. + * (hppa_object_p): Become much more paranoid about file header. + * (make_bfd_asection): Call bfd_make_section to do the dirty + work. Simplify code somewhat. + * (hppa_core_file_p): Use proper name for stack section. + * libhppa.h: Remove millicode_start, millicode_end decls. + +Mon Dec 28 11:03:22 1992 Ken Raeburn (raeburn@cygnus.com) + + * Makefile.in (coff-we32k.o, coff-z8k.o): Note dependencies. + + * reloc.c (bfd_perform_relocation): For normal 2- or 4-byte + relocs, don't bother doing the adjustment if the value to add is + zero. + +Sun Dec 27 17:45:05 1992 Fred Fish (fnf@cygnus.com) + + * bfd.c (bfd_get_size): New function that gets an upper bound + on the possible size of any object in a bfd. + * elf.c (bfd_elf_find_section, elf_get_str_section, + elf_get_symtab_upper_bound): Rewrite to avoid NULL pointer + dereferences. + * elf.c (elf_big_vec, elf_little_vec): Document last three + members initialized to NULL. + +Thu Dec 24 17:49:09 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * hppa.c: change a 'const' to 'CONST', or else HP C compiler dies + +Mon Dec 21 16:33:34 1992 Per Bothner (bothner@rtl.cygnus.com) + + * hosts/std-host.h: New file. Attempt at a generic/default + set of definitions, to discourage porting to new hosts by copying. + * hosts/news.h: Removed. + * hosts/sparc.h: Use std-host.h. + * bfd-in.h: New macros bfd_asymbol_bfd and bfd_asymbol_flavour; + perhaps we can later remove the the_bfd field from each symbol. + * syms.c (struct symbol_cache_entry): Remove unused field + app_data. Add comment noting that the_bfd is almost redundant, + but not quite. + * aoutx.h, coff-a29k.c, coff-i386.c, coff-i960.c, coffcode.h: + Use new macros bfd_asymbol_bfd and bfd_asymbol_flavour. + * hppa.c (fill_spaces): Make slightly more rebust. + * configure.in: Allow std-host as the "default" host. + +Mon Dec 21 17:24:13 1992 Stu Grossman (grossman at cygnus.com) + + * bfd.c: Add struct hppa_core_data to tdata union. + * hppa.c: Conditionalize on HOST_HPPAHPUX instead of hp9000s800. + Get rid of HPPA/BSD specific code. That will go somewhere else + someday. + * (fill_spaces): Don't spin forever and die if you don't find + $MILLICODE$ subspace. + * (hppa_object_p): Make sure that we have a real honest-to-cthulu + exec file! + * (hppa_core_file_failing_signal, hppa_core_file_failing_command): + Make these work for HPUX. + * (make_bfd_asection): New routine to make section creation a + little easier. + * (hppa_core_file_p): Completely rewrite, leave out bugs. + * libhppa.h: #include the right system files. Redefine all of + the structs/macros for hacking core files to use more sensible + HPUX core file structures. + * targets.c (target_vector): Conditionalize hppa_vec on + HOST_HPPAHPUX, not hp9000s800. + * hosts/hppahpux.h: #include stdlib.h to get correct decls for + malloc and realloc. #define HOST_HPPAHPUX. + +Mon Dec 21 12:40:10 1992 Ian Lance Taylor (ian@cygnus.com) + + * Patches from Minh Tran-le . + * configure.in (i386-*-isc*, i386-*-aix*): New targets. + * configure.host (i386-*-isc*, i386-*-aix*): New hosts. + * hosts/i386isc.h, config/i386isc.mh: New files for Interactive + Unix. + * hosts/i386aix.h, config/i386aix.mh: New files for AIX on PS/2. + * aix386-core.c: New file for handling core files on AIX on PS/2. + * targets.c: if AIX386_CORE, use aix386_core_vec. + * coffcode.h (coff_real_object_p): check for I386SVMAGIC as well + as I386MAGIC. + +Fri Dec 18 10:20:27 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * aoutf1.h (sunos4_write_object_contents): set flags to 0, fixing + 1927. + +Thu Dec 17 19:35:32 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: added dvi target + +Thu Dec 17 00:36:24 1992 John Gilmore (gnu@cygnus.com) + + * bfd.c: Use right name for tekhex tdata struct. + * tekhex.c: Insert leading_char (0) into bfd_target struct. Style. + * libcoff.h: Updated to get spacing change from coffcode.h. + * trad-core.c: leading_char is 0 (no symbols!), not '_'. + +Tue Dec 15 15:40:30 1992 Per Bothner (bothner@cygnus.com) + + * archive.c (do_slurp_bsd_armap, do_slurp_coff_armap): New + functions, with the "guts" of the old bfd_slurp_bsd_armap + and bfd_slurp_coff_armap, but assuming we've already checked + if the armap is present or not. + Also, rewrite a bit to avoid keeping around obstack data + that we don't need. + * archive.c (snarf_ar_header, _bfd_slurp_extended_name_table): + Various fixes to correctly handle COFF_style archives names. + (Note that because these have a trailing '/', the names can + have embedded spaces.) + * archive.c (bfd_slurp_armap): New function, replaces old + bfd_slurp_bsd_armap and bfd_slurp_coff_armap. Recognizes + _either_ format, and calls do_slurp_bsd_armap or + do_slurp_coff_armap if either form of map is seen. + * libbfd-in.h: Changed bfd_slurp_bsd_armap and + bfd_slurp_coff_armap into macro synonyms for bfd_slurp_armap. + * elf.c (elf_slurp_armap, elf_write_armap): Fix. + * Makefile.in (AR_FLAGS): Use rc instead of non-standard qc. + +Mon Dec 14 17:08:08 1992 Stu Grossman (grossman at cygnus.com) + + * hppa.c: #include "sysdep.h", not . + * libhppa.h: Make millicode_start and millicode_end be unsigned + int to be same type as CORE_ADDR in GDB. Why are these here? + +Sat Dec 12 15:54:36 1992 Ian Lance Taylor (ian@cygnus.com) + + * coff-i386.c (CALC_ADDEND): if reloc is PC relative, add the + vaddr of the section to the addend. + * targets.c: if MINIMIZE is 1, and SCO_CORE is defined, add + SCO_CORE to SELECT_VECS. + (target_vector): add sco_core_vec. + * sco-core.c (sco_core_vec): add leading underscore initializer. + * configure.in (i[34]86-*-sco*): use target i386-sco. + * config/i386-sco.mt: new file; define SCO_CORE. + +Thu Dec 10 02:13:15 1992 John Gilmore (gnu@cygnus.com) + + * aout-adobe.c (aout_adobe_object_p): Fix !strcmp thinko. + +Fri Dec 4 14:02:49 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * coffcode.h (bfd_coff_std_swap_table): Now static and const. + +Thu Dec 3 16:54:58 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * hosts/i386linux.h: Include unistd.h. + + * aoutx.h (print_symbol): aout_stab_name returns a constant + string. + * libaout.h (aout_stab_name): Fix prototype. + * stab-syms.c (aout_stab_names): Array is now const. + (aout_stab_name): Return value is now pointer to const. + + * aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c, + syms.c: Doc fixes. + + * syms.c (asymbol): Added new field "app_data", for data + particular to the application. Some of the linker flags ought to + get moved to this field someday. + + * archures.c (bfd_default_scan): Recognize a few more numbers: + 80486, 80960, and 960. + + * bfd-in.h (COFF_SWAP_TABLE): New is just address of + bfd_coff_std_swap_table, cast to PTR. + * bfd.c (bfd_coff_swap_*): Deleted macros. + * targets.c (struct bfd_target): Deleted COFF-specific swapping + routine pointers. + * coffcode.h (type bfd_coff_backend_data): New structure type, + contains pointers to the COFF-specific swapping routines. + (bfd_coff_std_swap_table): New data structure, to be used when + NO_COFF_SYMBOLS and NO_COFF_LINENOS are not defined. + (bfd_coff_swap_*): New macros. + * coff-mips.c (mips_coff_swap_table): New data structure. + (ecoff_big_vec): Use it. + * All COFF targets: Moved COFF_SWAP_TABLE to target-specific data. + * All other targets: Deleted coff-specific vector entries. + + * trad-core.c: Fixed some `PARAMS' uses that were missing + parentheses. + +Sun Nov 29 08:37:13 1992 Fred Fish (fnf@cygnus.com) + + * aoutx.h (some_aout_object_p): Protect arg prototype in + callback_to_real_object_p with PARAMS macro for non-ANSI compilers. + +Sat Nov 28 04:01:21 1992 John Gilmore (gnu@cygnus.com) + + * aout-target.h, aoutf1.h, trad-core.c, coffcode.h, libaout.h, + libbfd-in.h, bfd-in.h: Eliminate all PROTO calls, replace with + PARAMS for readability. + + * aoutx.h: Add type to callback parameter. + * coff-mips.c: Don't call trad-core.h, not needed. + * trad-core.c: Incorporate trad-core.h declarations. Fix comments. + * trad-core.h: Eliminate, unused. + +Wed Nov 18 13:16:17 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * format.c (bfd_check_format): if default target isn't found + then look through the entire list rather than return early. + +Mon Nov 16 14:33:03 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * config/i960-coff.mt: reorder vec to match bfd_check_format (from Per) + +Thu Nov 12 17:01:41 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: pass down prefix and exec_prefix in FLAGS_TO_PASS + +Thu Nov 12 09:46:47 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-z8k.c: checkpoint, more addressing modes handled + * coffcode.h (get_value): don't truncate reloc->addend field, it's + a long now. + +Wed Nov 11 23:57:55 1992 Brendan Kehoe (brendan@cygnus.com) + + * we32k.mt (TDEFAULTS): Use we32kcoff_vec, not i386coff_vec. + +Tue Nov 10 14:04:38 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: minor tweaks to make $(CC) command lines more consistent + +Mon Nov 9 23:58:17 1992 John Gilmore (gnu@cygnus.com) + + * opncls.c (bfd_fdopenr, bfd_close): Add doc about cacheing + and about when file descriptors are closed. + +Sat Nov 7 00:42:20 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * bout.c (b_out_squirt_out_relocs): Make sure alignment relocs get + written out correctly. + +Thu Nov 5 15:34:19 1992 Ian Lance Taylor (ian@cygnus.com) + + * section.c: New section bit SEC_SHARED_LIBRARY. + coffcode.h (styp_to_sec_flags): if STYP_NOLOAD && (STYP_TEXT || + STYP_DATA), set SEC_SHARED_LIBRARY. This seems to be correct for + i386-sysv. + +Thu Nov 5 04:43:09 1992 John Gilmore (gnu@cygnus.com) + + * targets.c (struct bfd_target): Eliminate the SDEF and SDEF_FMT + macros; use PARAMS to declare the function pointers involved. + + * bfd-in.h, bfd.c, libbfd.h, reloc.c, seclet.h, section.c, + targets.c: Rename struct bfd_seclet_struct to struct bfd_seclet. + +Thu Nov 5 02:59:09 1992 John Gilmore (gnu@cygnus.com) + + Cleanup: Replace all uses of EXFUN in the BFD sources, with PARAMS. + + * archures.c, reloc.c, section.c, tekhex.c: Use PARAMS in + declaring pointers to functions. + * cache.c, elf.c: Move static function decls to top, use PARAMS. + * seclet.h: Declare external function with PARAMS. + + * doc/chew.c (exfunstuff): Eliminate. + (paramstuff): Replace exfunstuff with function to generate PARAMS. + * doc/proto.str: Use paramstuff rather than exfunstuff. + + * libbfd.h: Update, based on changes in source code and chew. + +Wed Nov 4 22:47:29 1992 John Gilmore (gnu@cygnus.com) + + * libieee.h: Add FIXME about removing limit on number of sections. + * bfd-in.h: Improve comments to make it clear that bfd.h is + the wrong place to edit this file. + * Makefile.in (install): Install ansidecl.h and obstack.h in the + same places where we install bfd.h. + +Wed Nov 4 13:40:23 1992 Sean Eric Fagan (sef@cygnus.com) + + * coffcode.h (coff_swap_aux_out, coff_swap_aux_in): check for + symbol type before blindly modifying the auxent. Specifically, + only modify the endndx fields for types that need it, and don't + set the array information for non-arrays. + +Wed Nov 4 09:30:50 1992 Ken Raeburn (raeburn@cygnus.com) + + * aoutx.h (some_aout_object_p): Section list should be set up + correctly anyways; don't have to set up "next" pointers manually. + +Mon Nov 2 12:36:14 1992 Ian Lance Taylor (ian@cygnus.com) + + * config/delta88.mh, config/hp300.mh, config/hppahpux.mh, + config/i386v.mh: removed -DUSG from HDEFINES. + hosts/delta88.h, hosts/hp300.h, hosts/hppahpux.h, hosts/i386v.h: + defined USE_UTIME. + hosts/i386v.h: don't define POSIX_UTIME. + +Fri Oct 30 16:13:52 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * ieee.c (ieee_slurp_sections): make a private copy of the + section's name before truncating it. + +Thu Oct 29 08:30:50 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * hppa.c: add symbol_leading_char entry in transfer vec + +,Wed Oct 28 16:11:57 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * ieee.c (get_symbol): can now cope when two symbols of a + different class, but the same index number occur consecutively. + (get_section_entry): nicer name for sections being forward + referenced. (ieee_archive_p): don't free the filename string, + since it was never malloced. + +Wed Oct 28 13:42:09 1992 John Gilmore (gnu@cygnus.com) + + * coffcode.h (coff_write_object_contents): Zero timestamp field. + +Tue Oct 27 12:24:34 1992 Ian Lance Taylor (ian@cygnus.com) + + * coffcode.h (coff_swap_aux_out): set the fcnary info before + optionally setting the dimen info, since they are in the same + memory locations. Also zero out external auxent. + (coff_write_symbol): don't zero external auxent; now done in + coff_swap_aux_out. + +Fri Oct 23 13:55:35 1992 Ian Lance Taylor (ian@cygnus.com) + + * Check fclose return value for errors. + libbfd.h: bfd_cache_close now returns a boolean. + cache.c (bfd_cache_delete): return fclose success value. + (bfd_cache_close): return bfd_cache_delete return value. + opncls.c (bfd_close, bfd_close_all_done): return result of + bfd_cache_close. + +Fri Oct 23 10:32:36 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * seclet.c (rel): don't load sections without the SEC_LOAD bit. + +Thu Oct 15 10:16:35 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-m68k.c (m68k_howto2type, SELECT_RELOC): new function to + work out a coff relocation type from a howto's attributes rather + than using the input r_type field. This fixes PR1677 and allows + conversion of a.out relocs to coff relocs. + + * coffcode.h (coff_write_relocs): if supplied a relocation + relative to an absolute symbol, use the right symbol index. + + * reloc.c (bfd_perform_relocation): do a partial link for coff + relocs right. + +Fri Oct 23 08:15:56 1992 Ian Lance Taylor (ian@cygnus.com) + + * changes to support i386-sysv with shared libraries: + * coffcode.h (sec_to_styp_flags): if TWO_DATA_SECS is defined, + check for .data2; if _LIB is defined, check for it; map + SEC_NEVER_LOAD to STYP_NOLOAD. + (styp_to_sec_flags): map STYP_NOLOAD to SEC_NEVER_LOAD. + (make_a_section_from_file): if TWO_DATA_SECS, accept .data2. + (coff_write_object_contents): force vaddr of .lib to 0; set scnptr + if section has contents, not just if it is loadable; if + TWO_DATA_SECS, check for .data2 + (coff_set_section_contents): set vma of .lib section to number of + .lib sections. + * coff-i386.c: define TWO_DATA_SECS; use a special CALC_ADDEND; + don't define coff_write_armap to bsd_write_armap. + * hosts/i386v.h: don't include , since it is not provided + by SVR3.2. + +Thu Oct 22 22:40:20 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * solaris2.h: Get the definition of alloca from alloca.h if we + aren't using gcc. + +Thu Oct 22 03:07:28 1992 John Gilmore (gnu@cygnus.com) + + * configure.in (i960-*-{aout,bout}): Support these. + +Wed Oct 21 03:46:34 1992 John Gilmore (gnu@cygnus.com) + + * config/a29k-aout.mt (DEFAULT_TARGET): Set to one that exists. + +Thu Oct 15 15:05:39 1992 Per Bothner (bothner@cygnus.com) + + * apollo68.h, apollov68.h, hp300.h, i386v.h, irix3.h: Remove + no-longer-used definitions of L_SET and L_INCR. + * i386linux.h: Tweaks to smooth Linux build. + +Thu Oct 15 01:32:22 1992 John Gilmore (gnu@cygnus.com) + + * seclet.h: Add enum tag to bfd_seclet_enum_type. + + * bfd-in.h (file_ptr): Update comments, make FIXME re off_t. + + * aout-adobe.c, aoutf1.h, archive.c, bout.c, coff-rs6000.c, + coffcode.h, elf.c, ieee.c, libaout.h, libbfd.c, oasys.c, + sco-core.c: Lint: Second argument of bfd_seek is always file_ptr. + Third argument is SEEK_SET or SEEK_CUR. Result is always 0 or -1. + + * aout-adobe.c, aoutf1.h, aoutx.h, bout.c coff-m68k.c, coff-z8k.c, + coffcode.h, elf.c, libaout.h, libbfd-in.h, srec.c: Lint. + +Fri Oct 9 03:46:37 1992 John Gilmore (gnu@cygnus.com) + + * configure.host: New file, contains mapping of host configs + to host support file names for bfd, binutils, opcodes. + * configure.in: Use it. + * i386aout.c: Cleanup, dump TARGET_IS_LITTLE_ENDIAN_P. + * i386bsd.c: Cleanup, reformat. + * config/i386-bsd.mt: Comment changes. + * config/i386bsd.mh: New file for core file support. + * hosts/i386bsd.h: Merge changes from Peter Schauer. + * bout.c (ALIGN): Rename to ALIGNER, since system header files + on BSD 4.4 define ALIGN (sigh!). + +Thu Oct 8 22:18:10 1992 Mark Eichin (eichin at tweedledumber.cygnus.com) + + * libaout.h (aout_backend_data): added exec_header_not_counted + field. For ZMAGIC files only, when text_includes_header is set, by + default the length of the exec header is counted in the text + section size. For go32, exec header is mapped in but does *not* + contribute to the size of section. + * aoutx.h (aout_adjust_sizes_and_vmas): if exec_header_not_counted + is not set, but ztih is, add the size of the exec header to the + recorded size of the text section. + * aoutf1.h (sunos4_aout_backend): clear exec_header_not_counted. + * i386aout.c (i386aout_backend_data): set exec_header_not_counted. + Also set text_includes_header. + * aout-target.h (*_backend_data): cleare exec_header_not_counted + by default in MY(backend_data). + +Thu Oct 8 18:12:49 1992 Ken Raeburn (raeburn@cygnus.com) + + * aout-target.h (callback): Don't define this function if it won't be + used. + + * aoutx.h (some_aout_object_p): Restore old aout_data value if this + type doesn't match. Don't lose if file sections have already been + created. + (set_arch_mach): Set reloc_entry_size. + (slurp_symbol_table): Use bfd_h_get_{16,8} for reaeding symbol data. + + * hosts/i386bsd.h: New file. + * configure.in: Recognize i[34]86-*-bsd host. + + * aout-target.h (callback, write_object_contents): Delete unused + variables. + + * aoutx.h (reloc_type_lookup): New function. + * aout-target.h (MY_reloc_howto_type_lookup): Use it as default. + * aoutf1.h (sunos4_reloc_type_lookup): Deleted. + (MY_reloc_howto_type_lookup): Don't define it. + + * aoutx.h (adjust_sizes_and_vmas): Don't bother with padding for + OMAGIC files. + (slurp_symbol_table): Use header byte order, not target byte + order, for reading symbol data. + +Thu Oct 8 17:33:39 1992 John Gilmore (gnu@cygnus.com) + + * configure.in: Undo some brain damage in the host section. + * configure.in: Reformat the target section, test many configs. + * Makefile.in (make): Remove obsolete `make make'. + * aoutx.h (some_aout_object_p): Make defines line up. + +Thu Oct 8 08:52:48 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + Now a bfd knows whether underscores are normally prepended + to symbols in its file format. + + * aout-adobe.c, aout-target.h, bout.c, coff-a29k.c, coff-h8300.c, + coff-z8k.c: targets set so they have leading underscore + * coff-i386.c, coff-i960.c, coff-m68k.c, coff-mips.c, coff-m88k.c, + coff-rs6000.c, coff-we32k.c, elf.c, ieee.c, srec.c: targets set + without leading underscore flag + * targets.c: add symbol leading char to xvec description + * bfd-in.h (bfd_get_symbol_leading_char): new macro. + +Mon Oct 5 14:32:55 1992 Per Bothner (bothner@cygnus.com) + + * archive.c: Make errno global. + * archive.c (_bfd_write_archive_contents): If read fails (and + errno!=0) set bfd_error to malformed_archive (since this probably + indicates a truncated archive), rather than system_call_error. + +Mon Oct 5 03:33:39 1992 Mark Eichin (eichin at tweedledumber.cygnus.com) + + * Makefile.in: added rules for i386bsd.c + * i386bsd.c: new file, supporting 386bsd. + * configure.in: recognize i386-*-bsd target. + * config/i386-bsd.mt: new file - 386bsd target configuration. + +Thu Oct 1 17:51:07 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: re-arrange host section to use *-*-* notation, + clean up some of the target section as well + + * seclet.c: cast result of bfd_get_relocated_section_contents to + avoid compiler warnings + +Tue Sep 29 13:24:09 1992 Ken Raeburn (raeburn@cygnus.com) + + * coffcode.h (coff_section_symbol): Create section if it doesn't + already exist. + + * bout.c: Removed some unused variables. + +Tue Sep 29 08:30:21 1992 Ian Lance Taylor (ian@cygnus.com) + + * Portability fixes from p3: + coffcode.h (coff_write_relocs): removed sanity check until it + works on all targets (per advice from sac). + config/hp9000.mh: new file to define USG. + hppa.c: #undef hppa before the JUMP_TABLE. + hosts/hppahpux.h: #define NATIVE_HPPAHPUX_COMPILER if not + __STDC__. + targets.c (bfd_target_list): if NATIVE_HPPAHPUX_COMPILER, make + local variable target volatile to avoid mysterious bug in + HP9000/700 cc. + +Sat Sep 26 03:58:49 1992 John Gilmore (gnu@cygnus.com) + + * config/hppabsd.mh, config.hppahpux.mh: Remove various bogosity. + * hosts/hppahpux.h: Remove bcopy and index circumventions. + +Fri Sep 25 22:36:52 1992 John Gilmore (gnu@cygnus.com) + + * coff-z8k.c (func_da, func_jr): Lint. + * coffcode.h: Use memset rather than bzero. + * elf.c: Use memcpy rather than bcopy. + * tekhex.c: Use memset rather than bzero. + +Fri Sep 25 19:14:48 1992 John Gilmore (gnu@cygnus.com) + + Add Adobe a.out support. + + * aout-adobe.c: New file. So far, only reads a.out.adobe. FIXME. + * config/adobe.mt: Add. + * configure.in (*-adobe-* target): Add. + * targets.c (a_out_adobe_vec): Add. + * Makefile.in: add aout-adobe.c. + + * configure.in: Put two dashes in all entries to be matched. + Add comments to remind people to do this. + Reorder all entries that match manufacturer names, to occur + last, so they will only be matched if no more specific match + occurs. Remove manufacturers `aout', `bout', `coff', and `elf'. + +Fri Sep 25 15:03:22 1992 Brendan Kehoe (brendan@rtl.cygnus.com) + + * elf.c (section_from_elf_index): Return bfd_abs_section, not 0, + since we should never have a NULL section. + (elf_slurp_symbol_table): If st_shndx doesn't match any of our + tests, set the section to bfd_abs_section. + +Fri Sep 25 11:11:57 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-z8k.c: getting closer + * coffcode.h (coff_get_relocated_section_contents): allow + EXTRA_CASES hooks for different arches to provide different reloc + types. + * seclet.h: #ifndef around it to allow multiple inclusion + * srec.c: minor doc fix + +Mon Sep 21 14:33:58 1992 Ian Lance Taylor (ian@cygnus.com) + + * hosts/hp9000.h, hosts/irix3.h: changes from WRS. + +Sun Sep 20 08:48:25 1992 Fred Fish (fnf@cygnus.com) + + * configure.in: Use i386-elf for all i386/i486 sysv4 hosts, not + just ncr. + +Thu Sep 17 06:40:46 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * bout.c (b_out_slurp_reloc_table): Clear howto field before + filling in reloc, in case immediately following code doesn't set + it. + +Fri Sep 11 15:37:06 1992 Ian Lance Taylor (ian@cygnus.com) + + * coffcode.h (coff_renumber_symbols): set the last renumbered + symbol pointer to NULL, as expected by coff_write_linenumbers. + (coff_write_relocs): apparently a non-zero addend is OK for reloc + type R_IHCONST used on the 29k. + +Thu Sep 10 13:28:24 1992 John Gilmore (gnu@cygnus.com) + + * opncls.c (bfd_fdopenr): Determine whether to fdopen for + update, based on how the underlying file was opened. Obsoletes + FASCIST_FDOPEN. + * hosts/rs6000.h, hosts/tahoe.h, hosts/vaxbsd.h: Remove + all FASCIST_FDOPEN config defines. + +Tue Sep 8 21:37:58 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * sparc-opc.c: Moved to opcodes library, now that we have one. + * Makefile: Don't compile it. + +Tue Sep 8 10:10:34 1992 Ian Lance Taylor (ian@cygnus.com) + + * aoutx.h: adjust_sizes_and_vmas did not return anything. + +Thu Sep 3 19:29:04 1992 Per Bothner (bothner@rtl.cygnus.com) + + * section.c (bfd_set_section_flags): Remove a sanity check. + It is unfortunately broken, and prevents strip from working. + +Thu Sep 3 16:14:40 1992 Jim Wilson (wilson@sphagnum.cygnus.com) + + * sparc-opc.c (condr): Remove extraneous, but harmless, backlash + created by last change. + +Thu Sep 3 13:52:38 1992 Per Bothner (bothner@rtl.cygnus.com) + + * reloc.c (reloc_howto_struct): Make size field be unsigned. + * bfd-in.h: Bump to version 2.0. + +Thu Sep 3 09:05:37 1992 Stu Grossman (grossman at cygnus.com) + + * bout.c, cpu-z8k.c: Use enums when initializing structs to keep + braindamaged HP/Apollo compiler happy. + +Wed Sep 2 02:53:29 1992 John Gilmore (gnu@cygnus.com) + + * format.c: Fix description of search for matching target. + * aoutx.h (some_aout_object_p): Set SEC_CODE and SEC_DATA. + * targets.c: Update description of search for matching target. + * Makefile.in (do_clean, clean): Fix infant mortality typo. + (docdir): Set to ./doc, not ${srcdir}/doc, which has no makefile. + (z8k and we32k files): `*.o: *.c': avoid Sun Make bug. + +Wed Sep 2 00:26:32 1992 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in: Added mostlyclean/clean/distclean rules. + +Tue Sep 1 13:38:40 1992 Per Bothner (bothner@cygnus.com) + + * targets.c (target_vector): Take out oasys (unless that is + the default): Because there is no magic number in archives, + there can be annoying target mis-matches. + +Mon Aug 31 10:11:37 1992 Jim Wilson (wilson@sphagnum.cygnus.com) + + * sparc-opc.c: Rigorously updated to match architecture manual. + +Mon Aug 31 08:07:58 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * aoutx.h (aoutswap_ext_reloc_out), bout.c + (b_out_squirt_out_relocs): fix bug 1506 where abs symbols attached + to the built-in abs_section were not written out correctly. + +Fri Aug 28 16:29:15 1992 Ian Lance Taylor (ian@cygnus.com) + + * archive.c (bfd_slurp_bsd_armap): if the symdef_count is too + large, assume we're using a swapped byte order and fail with + wrong_format rather than dumping core. + +Thu Aug 27 13:05:28 1992 Brendan Kehoe (brendan@cygnus.com) + + Add preliminary support for the we32k: + + * Makefile.in, archures.c, coffocode.h, configure.in, targets.c: + Minor edits. + * coff-we32k.c, cpu-we32k.c, config/we32k.mt, hosts/we32k.h: New files. + +Wed Aug 26 14:20:16 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * bout.c: added support for relaxable alignment relocs. + + * seclet.c (rel, seclet_dump_seclet, seclet_dump): get the app to + pass down pointer to play area rather than use alloca + + * cpu-z8k.c (compatible): made static to reduce name space + polution. + +Tue Aug 25 08:39:10 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + Add basic support for the z8k: + + * Makefile.in, archures.c, coffcode.h, configure.in, reloc.c, + section.c, targets.c, + + * syms.c: move mis-inserted patch. + +Fri Aug 14 15:39:29 PDT 1992 Howard Chu (hyc@hanauma.jpl.nasa.gov) + + Documentation fixes: + * ctor.c, format.c, section.c, reloc.c: append " -" to item tags. + * reloc.c, section.c, syms.c, targets.c: add DOCDD before @node + comments. + * reloc.c: break out addend item from surrounding text. + + * doc.str (DOCDD): Defined. Adds text to output. + (bodytext): Put bulletize before kill_bogus_lines. + * chew.c (bulletize): End itemization after a blank line, to + prevent following text from being swallowed up in an item. + +Mon Aug 24 20:50:22 1992 Stu Grossman (grossman at cygnus.com) + + * configure.in: Add sparclite as a target. + +Mon Aug 24 12:06:31 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * ieee.c (ieee_get_symtab): always null terminate the symbol list, + lint. + + * coffcode.h (coff_add_missing_symbols): if symbols don't come + from a coff file (csym is null), dont deref them + + * ieee.c (parse_expression): get the answer right when adding an + abs+(sec+off), (ieee_generic_stat_arch_elt): call ieee_object_p + on elts so that filename is filled in. + +Thu Aug 20 19:05:48 1992 Ken Raeburn (raeburn@cygnus.com) + + * bout.c (howto_align_table): New set of relocs, with enough + data for "objdump -r" to work. + (b_out_reloc_type_lookup): Recognize alignment relocs. + +Tue Aug 18 12:57:45 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: added FLAGS_TO_PASS, and used it for all recursive + invocations of make. Also, always create installation + directories. + + * config/apollov68.mh: removed -g from CC definition. + +Mon Aug 17 13:40:08 1992 Ken Raeburn (raeburn@cygnus.com) + + * config/decstation.mh (HDEFINES): Specify "-G 4" to avoid + overflowing gp-offset range. + +Mon Aug 17 11:44:28 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * srec.c (srec_set_section_contents): don't write out sections + without the LOAD and ALLOC attributes + +Mon Aug 17 11:55:07 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * archures.c, cpu-m68k.c, cpu-sparc.c: Undo 16 June changes. + * libaout.h (struct aout_backend_data): New callback "set_sizes". + * aout-target.h (callback): Don't set page/seg sizes. + (mkobject): Ditto. + (set_sizes): New routine. + (backend_data): Point to it. + * aoutf1.h (sunos4_set_sizes): Heed architecture when setting sizes. + (sunos4_aout_backend): Point to it. + * aoutx.h (set_arch_mach): Call set_sizes callback. + +Fri Aug 14 19:22:18 1992 Per Bothner (bothner@cygnus.com) + + * aout-target.h: Make _bfd_slurp_extended_name_table be + the default. Given that we *write* the suckers (for long + archive member names), we really ought to be able to read them! + * trad-core.c: Don't include . It doesn't + seem to be needed, and many machines don't have it. + +Thu Aug 13 09:53:39 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-m68k.c (vector): read and write archives in coff format. + +Tue Aug 11 12:19:42 1992 Ken Raeburn (raeburn@cygnus.com) + + * opc-sparc.c: New file. + +Sat Aug 8 23:15:35 1992 Fred Fish (fnf@cygnus.com) + + * bout.c (bfd_reloc_status_type, callj_callback): Cast void* + pointers to bfd_byte* before performing arithmetic on them. Such + use with bare void* pointers is a gcc extension. + * cache.c (bfd_cache_delete): Forward decl with prototype form. + * archive.c (normalize): Add to CONST to match actual usages with + CONST. + +Mon Aug 3 00:35:29 1992 Fred Fish (fnf@cygnus.com) + + * configure.in: Recognize i486 host cpu, and use i386-elf + for i486-ncr-sysv4. + +Sat Aug 1 13:49:59 1992 Fred Fish (fnf@cygnus.com) + + * config/stratus.mt (CC): Remove definition. + * elf.c (bfd_section_from_shdr): Test for the possibility that + section_from_elf_index returns NULL and don't dereference it. + +Mon Jul 20 02:46:09 1992 D. V. Henkel-Wallace (gumby@cygnus.com) + + * add hppa_data to bfd tdata (indirectly via sef). + + * config/hppahpux.mh: hpux is -DUSG (patch by sef) + +Sat Jul 18 15:50:11 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: error messages to stderr, not stdout + +Fri Jul 17 18:32:46 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * bfd.c, cache.c, coff-a29k.c, coff-i386.c, coff-i960.c, + coff-m68k.c, coff-m88k.c, demo64.c, libaout.h, libbfd.c, + oasys.c, opncls.c, sunos.c, targets.c: removed rcsid's. + +Fri Jul 17 17:06:56 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: recognize hppa* instead of hppa + +Thu Jul 16 16:39:25 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-m68k.c: added R_RELLONG_NEG reloc type, and changed + RTYPE2HOWTO to cope with same. + * reloc.c (bfd_perform_relocation): added support for size of -2 + (subtract a word reloc type). Updated doc. + +Thu Jul 16 16:28:09 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in: merged changes from progressive, removed rcsid. + + * archures.c, archive.c, Makefile.dos: removed rcsid. + +Thu Jul 16 08:08:25 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * bfd-in.h : add BFD_IS_RELAXABLE flag + * bout.c (bout_swap_exec_header_[in_out]): new field in exec + header e_relaxable, major hackery in callbacks + * libaout.h : add space for a_relaxable. + * seclet.c (rel): don't relax empty sections + + +Wed Jul 15 07:57:46 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * section.c (STD_SECTION): add some casts to the initializers for + dumb compilers + +Tue Jul 14 14:06:28 1992 Stu Grossman (grossman at cygnus.com) + + * rs6000-core.c (rs6000coff_core_p): Greatly simplify expression, + and add appropriate casts to keep (picayune) aix-cc happy. + +Mon Jul 13 05:06:51 1992 John Gilmore (gnu at cygnus.com) + + * elf.c (elf_slurp_symbol_table): Now 2nd arg is where to write + symbol pointers. Punt expensive & useless bfd_realloc. Use + malloc for raw symbols, and free it before returning. + (bfd_section_from_shdr): Do not slurp symbol table until politely + asked. Do not even slurp string tables. + (elf_get_symtab_upper_bound): Count 'em without reading them. + (elf_get_symtab): This is how to politely ask. Schlurp! + This should probably just *become* elf_slurp_symbol_table, FIXME. + +Wed Jul 8 16:24:33 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * archive.c (bsd_write_armap): write the timestamp of the + archive header to be just a little bit later than the timestamp of + the file, otherwise the linker will complain that the index is + out of date. + +Tue Jul 7 00:23:23 1992 Fred Fish (fnf@cygnus.com) + + * configure.in: Add m68k-ericsson-*. + +Sat Jul 4 03:29:41 1992 John Gilmore (gnu at cygnus.com) + + * syms.c: Define BSF_FILE, update BSF_SECTION_SYM desc. + * elf.c: Remove unconditional debug printf's. + (elf_write_object_contents, elf_slurp_symbol_table): Handle + BSF_SECTION_SYM <=> STT_SECTION, BSF_FILE <=> STT_FILE. + (elf_slurp_symbol_table): Hand out symbols in forward, not + reverse order. Simplify duplicate code. + +Fri Jul 3 20:23:34 1992 Fred Fish (fnf@cygnus.com) + + * elf.c: Remove "(void)" casts from function calls where the + return value is ignored, in accordance with GNU coding standards. + +Tue Jun 30 16:49:12 1992 Fred Fish (fnf@cygnus.com) + + * hppa.c: Apply John's standard fix to avoid "empty translation + unit" warnings from some ANSI-C compilers. + +Thu Jun 25 04:39:25 1992 John Gilmore (gnu at cygnus.com) + + * hosts/solaris2.h: Configure same as sysv4. + +Tue Jun 23 21:54:44 1992 Fred Fish (fnf@cygnus.com) + + * libbfd.h, libbfd-in.h (bfd_seek): Make prototype match definition. + * reloc.c (bfd_default_reloc_type_lookup): Make cast on return + type match actual return type. + * section.c (elf_print_symbol): Make CONST. + +Mon Jun 22 17:35:24 1992 Per Bothner (bothner@cygnus.com) + + * i386linux.c, hosts/i386linux.h, config/i386-linux.mt: + New files, for Linux (a free Unix clone for 386 machines). + * Makefile.in, configure.in, targets.c: Update accordingly. + +Fri Jun 19 20:23:21 1992 Steve Chamberlain (sac@thepub.cygnus.com) + Lints for bfd_reloc_code_type->bfd_reloc_code_real_type, and + correct calling of howto special functions and fixes from Raeburn + for gas<>bfdness + * archures.c: nuke bfd_reloc_code_type + * bout.c, cpu-h8300.c, coff-i960.c, coff-m88k.c: special function lint + * coffcode.h (styp_to_sec_flags): STYP_INFO is marked as + SEC_NEVER_LOAD, various other bfdgas newness + * reloc.c->libbfd.h: change protype of bfd_default_reloc_type_lookup + * targets.c: change jump table vector to above + + +Fri Jun 19 19:00:45 1992 John Gilmore (gnu at cygnus.com) + + * elf.c (bfd_elf_find_section): Mark as INTERNAL_FUNCTION so + its prototype will be included in libbfd.h. Change result type + to struct * (rather than equivalent typedef) so it can be used in + the prototype, where they typedef won't be known. + * libbfd.h: Updated version. + +Fri Jun 19 15:21:56 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in, archures.c, configure.in, cpu-hppa.c, hppa.c, libhppa.h, + targets.c: HPPA merge. + +Fri Jun 19 12:21:38 1992 John Gilmore (gnu at cygnus.com) + + * configure.in: Separate Solaris2 from SYSV4 on SPARC. + * config/solaris2.mh: Kludge around Sun compiler bug. + +Wed Jun 17 14:02:46 1992 Stu Grossman (grossman at cygnus.com) + + * libaout.h (aout_backend_data): Change defs of two bitfields to + be unsigned chars instead to get around rs6000 compiler problem. + +Wed Jun 17 13:55:31 1992 Fred Fish (fnf@cygnus.com) + + * elf.c (bfd_section_from_shdr, elf_slurp_symbol_table): + Correct misconception that there can be only one symbol table. + Only call elf_slurp_symbol_table on the full symbol table, not + the dynamic one which is only a subset of the full one. + +Wed Jun 17 15:54:57 1992 Ken Raeburn (Raeburn@Cygnus.COM) + + * coffcode.h (coff_compute_section_file_positions): For I960, + don't align sections in file. + +Tue Jun 16 06:28:21 1992 Ken Raeburn (Raeburn@Cygnus.COM) + + * targets.c (struct bfd_target): Added field for target-specific + (but not file-specific) data, for distinguishing minor + characteristics between (e.g.) a.out formats. + + * section.c (struct sec): New field user_set_vma indicates vma + field should be heeded, not assumed to be unset. + (STD_SECTION): Initialize that field of standard sections to zero. + * bfd-in.h (bfd_set_section_vma): Set user_set_vma to true. + + * coffcode.h (coff_write_relocs): Write out swapped reloc, not + pre-swapped version. + + * archures.c (struct bfd_arch_info): Fixed order of comment and + field decl. New fields indicate size of page and segment for + architecture. + * cpu-m68k.c (N): Fill in values. + * cpu-sparc.c (arch_info_struct): Ditto. + + * libaout.h (struct aout_backend_data): Various bits of data (not + all used currently) with characteristics of a.out implementation. + Important field for now is text_includes_header, indicating that + the text section starts immediately after the file header, which + gets mapped in with it. + (struct aout_data): New fields indicate whether vma has been + adjusted yet (not yet used), and what magic number will be used in + the output file (should go away in favor of vma_adjusted). + (WRITE_HEADERS): Code for dealing with section sizes and related + header fields replaced with call to adjust_sizes_and_vmas. + * aoutx.h (some_aout_object_p): Fill in magic number field. + Set WP_TEXT flag for ZMAGIC as well as NMAGIC files. + (set_arch_mach): Set page size and segment size once CPU + type is known. + (adjust_sizes_and_vmas): New function; has much code moved + from set_section_contents and WRITE_HEADERS. Sets or adjusts vma + and size parameters, as well as many header fields, after deciding + on magic number for output file. Checks to ensure that this + adjustment has only been done once. + (set_section_contents): Call adjust_sizes_and_vmas instead of + doing much of the work here. + + * aout-target.h (MY_make_debug_symbol, MY_backend_data): Provide + default (null) values of these fields. + * aoutf1.h (sunos4_write_object_contents): Don't override a_text + value in exec header. + (sunos4_aout_backend, MY_backend_data): Define backend data + indicating file header is included in text section. + + * aoutf1.h (MY_reloc_howto_type_lookup): Fix typo. + + * hosts/sparc.h (abort, exit): Hide these names if compiling with + gcc version 2, to avoid warnings. + +Mon Jun 15 12:26:56 1992 Fred Fish (fnf@cygnus.com) + + * config/ncr3000.mh (INSTALL, RANLIB): Don't use /usr/ucb/install, + it's broken on ncr 3000's. Use simple "true" for RANLIB. + +Sat Jun 13 09:16:43 1992 Michael Tiemann (tiemann@rtl.cygnus.com) + + * configure.in (m680[01234]0-wrs-*): Fix typo in match pattern. + +Fri Jun 12 19:48:34 1992 John Gilmore (gnu at cygnus.com) + + * section.c (STD_SECTION): Remove extra semicolon in declarations. + * configure.in: Rewrite target parsing to use simple format. + Handle sparc-sun-solaris2 configuration. + * aout64.h: Avoid ANSI C brain death warning. + * elf.c: Avoid trigraph (???) or /* in comments. + +Fri Jun 12 14:51:14 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * config/sysv4.mh: new file, RANLIB=echo + + * configure.in: handle Solaris2 as -sysv4 or -solaris2 + +Thu Jun 11 00:52:03 1992 John Gilmore (gnu at cygnus.com) + + * elf.c (elf_obj_tdata): Merge elf_obj_tdata_struct and + elf_core_tdata_struct into a single common struct. Core files + wouldn't have worked at all without this. + (bfd_elf_find_section): New function for GDB's undercover use + to find string sections that BFD hides from it. + (elf_get_str_section): Avoid multiple alloc&reads for same data; + lint. + (elf_object_p, elf_core_file_p): Allocate internal file header + storage dynamically. + * bfd.c (union {...} tdata): Remove elf_core_tdata_struct. + * demo64.c: Prevent "empty translation unit" warnings from idiots. + +Tue Jun 9 17:15:26 1992 Fred Fish (fnf at cygnus.com) + + * config/{i386v4.mh, ncr3000.mh}: Update RANLIB, add INSTALL. + +Sat Jun 6 17:02:51 1992 John Gilmore (gnu at cygnus.com) + + * configure.in: Handle Solaris2 as *-sun-sysv4 or as *-sun-sunos5. + +Sun May 31 05:45:00 1992 david d `zoo' zuhn (zoo@cygnus.com) + + * configure.in: handle m680[01234]0 as aliases for m68k + +Tue May 26 16:50:59 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-a29k.c: do byte relocs correctly + * coffcode.h (styp_to_sec_flags): never load INFO sections + * seclet.c (rel): don't relocate INFO sections + +Wed May 20 08:18:18 1992 Ken Raeburn (Raeburn@Cygnus.COM) + + * section.c (bfd_*_symbol, bfd_*_section): Initialize statically. + Make the symbols unmodifiable. + (bfd_section_init): Deleted. + * init.c (bfd_init): Don't call bfd_section_init. + + * section.c (bfd_set_section_contents): Ensure that range to be + written is within section boundaries. + (bfd_get_section_contents): Likewise. Don't bother dispatching if + size is zero. + + * libbfd.c (bfd_xmalloc): Text of error message should be const. + + * coff-i960.c (howto_table): Deleted. + (howto_rellong, howto_iprmed, howto_optcall): New vars; + interesting entries from old howto_table. + (RTYPE2HOWTO): Adjusted to use switch. + (coff_i960_reloc_type_lookup): New function. + + * coffcode.h (coff_new_section_hook): Allocate storage for aux + records for section symbol. + (make_abs_section): Unused; deleted. + (renumber_symbols): Re-order symbols so undefined symbols come + last, as COFF format desires. + (coff_write_symbol): Put C_FILE symbols in debug section always. + (coff_section_symbol): New function; creates a symbol with the + same name as a section, and sets up aux records for it. + (coff_add_missing_symbols): New function; adds section symbols to + symbol table if they aren't there already. Should someday also + add a dummy C_FILE symbol if none is present. + (coff_write_object_contents): Add missing symbols before preparing + symbol table to be written. + (coff_slurp_reloc_table): Verify that symbol indices read in are + in a reasonable range. + * libcoff-in.h (struct coff_tdata): New field conv_table_size. + (obj_conv_table_size): Accessor macro. + + * bout.c (b_out_reloc_type_lookup): New function. Handles three + reloc types on i960. + + * bfd-in.h (bfd_get_section_name): New macro. Like + bfd_section_name, but returns rvalue, not lvalue. + (bfd_get_section_vma, bfd_get_section_alignment): Similar. + (bfd_get_section_flags): Now returns rvalue. + + * reloc.c (enum bfd_reloc_code_real): Add several new values, some + general, some specific to sparc or i960. + + * aoutx.h (set_section_contents): Set VMA for each section based + on previous section. If text section VMA doesn't appear to have + been set, make a best guess from the type of file. + + * aout-target.h (MY_reloc_howto_type_lookup): Define as zero if + not defined. + (MY(vec)): Initialize reloc_type_lookup field. + + * aoutx.h (howto_table_*): Export as aout_#_*_howto_table. + (bfd_error_trap, bfd_error_vector): Extern, not common. + + * aoutf1.h (sunos4_reloc_type_lookup): New function. Handles a + few types of relocs for sparc; will need enhancement. + + * bout.c (callj_callback): Use DEFUN macro in definition. + * coff-i960.c (optcall_callback): Likewise. + + * targets.c (bfd_target): Added fields reloc_type_lookup and + _bfd_make_debug_symbol. Also minor comment changes. + * syms.c (bfd_make_debug_symbol): New dispatching macro. + * reloc.c (bfd_reloc_type_lookup): Take a BFD ptr as arg rather + than arch info, and dispatch with BFD_SEND. Callers changed. + * archures.c (struct bfd_arch_info): Deleted field + reloc_type_lookup. + * cpu-*.c: Don't initialize that field. + + * bfd-in.h (enum bfd_error): Add new value "bad_value". + * bfd.c (bfd_errmsgs): Now const; added entry for bad_value. + (bfd_errmsg): Now returns ptr to const. + * bfd-in.h (bfd_errmsg): Fix prototype. + + * cache.c (BFD_CACHE_MAX_OPEN): Fix typo in doc. + * reloc.c (bfd_generic_relax_section): Ditto. + + * section.c (Section Output doc): Improve description of use of + output_section and output_offset. + +Tue May 19 23:42:10 1992 D. V. Henkel-Wallace (gumby@cygnus.com) + + * sco-core.c: new file from net. + * aoutx.h (translate_to_native_sym_flags): bugfix from net: + Now we have the hairy linker, it's possible to move symbols from + one section into another. Actually make that work! + +Sat May 16 17:57:59 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * hosts/sun3.h: fix declaration of free. + +Tue May 12 14:08:59 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-a29k.c (perform_reloc): fix bug in jmp/call evaluation + * coff-h8300.c (reloc_processing): all relocs are relative to + section start. + * opncls.c: don't use fdopen on DOS systems + + short patches from Glenn Kasten (glenn@ready.com) + * targets.c: enabled oasys support + * oasys.c: Insert . when UNDERSCORE_HACK is enabled, + fix problem where a relocation which crossed a modification byte + boundary did not work. Fix problem where a relocation near the end + of a data record did not work. + + +Tue May 5 18:11:25 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * archive.c (bfd_slurp_coff_armap): old versions of BFD wrote + archvie header string counts the endian way, this heuristic sees + how big an archive string to read by trying it one way and if the + string table is unreasonably big, trying it the other. *FIXME*. + * opncls.c (bfd_fdopenr): can't do fdopens on VMS + +Tue May 5 14:18:24 1992 Per Bothner (bothner@rtl.cygnus.com) + + * bfd-in.h: Increase version number to 1.97, for consistency + with ../binutils. + * Makefile.in: docdir is ./doc, not ${srcdir}/doc. + +Mon May 4 11:49:15 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * bfd-in.h: bump version to 1.96 + Major change; changed calling convention for + bfd_get_relocated_section_contents so that caller allocates + memory for section data. + * coffcode.h (bfd_coff_get_relocated_section_contents), reloc.c, + seclet.c, targets.c, bfd.c: reflect new convention. + * coffcode.h (styp_to_sec_flags): if styp_flags is not a special + case, then use reasonable default values for SEC_* flags. + +Fri May 1 12:58:34 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coffcode.h (coff_write_object_contents): use RELSZ to work out + size of output reloc struct. + * targets.c, Makefile.in: comment out tekhex for the moment. + * ieee.c: if some places where null pointers were used instead of &bfd_abs_section. + * configure.in: tandem target is st2000 + * coff-m68k.c: rename static howto_table to global + m68kcoff_howto_table. + * bout.c: remove unnecessary abort + * coff-a29k.c: various changes to the way relocations work to cope + with the "new order" and latent bugs. + * coffcode.h: lint + +Wed Apr 29 12:37:07 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * aoutx.h (aout_swap_ext_reloc_out, aout_swap_std_reloc_out) + bout.c (b_out_squirt_out_relocs): treat abs sumbols the right way. + * reloc.c (bfd_perform-relocation): don't relocate refs to + absolute symbols if doing a partial link. + +Fri Apr 24 07:35:26 1992 Stu Grossman (grossman at cygnus.com) + + * configure.in: Add a29k-amd-udi. + +Thu Apr 23 18:37:55 1992 Fred Fish (fnf@cygnus.com) + + * aoutx.h (aout__swap_exec_header_in): Zero out the + internal_exec structure before initializing the fields that + are used, so that the unused fields are in a known state. + +Wed Apr 22 09:36:08 1992 Fred Fish (fnf@cygnus.com) + + * tekhex.c (struct data_struct): Convert from typedef that + typedefs nothing to a normal structure declaration. + * tekhex.c (pass_over): Prototype args for function that + second arg points to. + +Mon Apr 20 22:22:51 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in: remove old style staging. Do not print recursion + lines. + + * Makefile.in: rework CFLAGS so that CFLAGS can be passed from the + Makefile command line. Remove MINUS_G. Default CFLAGS to -g. + Pass CFLAGS. + +Fri Apr 17 09:15:31 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * bfd.c, Makefile.in: added tekhex + * aoutx.h (set_section_contents): pages should be padded to the + size of a page, not the size of a segment. + * configure.in: added go32 host and i386-aout target. + * i386aout.c, libaout.h: now works for go32 target + * ieee.c: fix bit rot. + * seclet.c: support for padding seclet type. + +Wed Apr 15 18:11:58 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in: added .NOEXPORT: + +Tue Apr 14 14:34:42 1992 Fred Fish (fnf@cygnus.com) + + * elf.c (bfd_add_strtab, bfd_add_2_to_strtab): CONST spreads + like ooze. + * elf.c (elf_compute_section_file_positions, + elf_write_object_contents): Return boolean, not NULL (which + can be void *). + * elf.c (bfd_section_from_shdr): Ifdef-out debugging code. + Also ifdef-out code that aborts on unhandled section types. + +Fri Apr 10 22:29:18 1992 Fred Fish (fnf@cygnus.com) + + * configure.in: Recognize ncr3000 config + * Makefile.in (MINUS_G): Pass on to recursive makes. + * hosts/ncr3000.h, config/ncr3000.mh: Add host config files. + +Thu Apr 2 17:42:45 1992 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Now that we have sym.h and symconst.h, compile + coff-msym.c on all systems. + * config/{decstation.mh, irix3.mh, irix4.mh}: Remove coff-msym.o dep. + * coff-msym.c: Update include files and comments; add weakext bit. + +Wed Apr 1 23:16:38 1992 John Gilmore (gnu at cygnus.com) + + * archive.c, bfd.c, bout.c, coffcode.h, init.c, reloc.c, + section.c, srec.c, syms.c, coff-h8300.c: Lint. + +Sun Mar 29 09:37:59 1992 John Gilmore (gnu at cygnus.com) + + * bout.c, coff-a29k.c, coff-i960.c: Lint. + * configure.in: Add new host and target configs. + * elf.c (bfd_prstatus, bfd_fpregset): Avoid typename of register + structs, which vary; just use member name. + (elf_object_p, elf_core_file_p): Lint, fix comments. + * config/sparc-elf.mt, hosts/sysv4.h: New config files. + +Sat Mar 28 13:07:02 1992 Fred Fish (fnf@cygnus.com) + + * elf.c (elf_object_p, elf_core_file_p): Fix to use only a single + local, disposable, copy of the external form of section header + table and program header table entries. + +Thu Mar 26 16:59:58 1992 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Set MINIMIZE back to 0 for a real release. + +Tue Mar 24 15:57:03 1992 K. Richard Pixley (rich@cygnus.com) + + * configure.in: config/irix4.m[ht], hosts/irix4.h: add support for + irix4. + +Mon Mar 23 22:37:34 1992 Stu Grossman (grossman at cygnus.com) + + * coff-msym.c (ecoff_swap_rfd_in): remove & for array ref. + +Tue Mar 17 14:12:25 1992 Per Bothner (bothner@rtl.cygnus.com) + + * bout.c (b_out_slurp_reloc_table): Use BFD_ASSERT macro, + not internal bfd_assert function (twice). + +Tue Mar 17 10:45:12 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * aout-target.h: change ar_max_namelen to 15 (the right value) + * coff-a29k.c, coffcode.h: more hangovers from the bfd_abs_section + change + +Mon Mar 16 14:57:22 1992 Steve Chamberlain (sac@rtl.cygnus.com) + + * archive.c (bfd_generic_archive_p): check for bout archives too. + * bout.c: make it work again. + +Sat Mar 14 17:30:40 1992 Fred Fish (fnf@cygnus.com) + + * elf.c (elf_corefile_note): Call bfd_xmalloc() instead of bare + malloc(). + * reloc.c (bfd_generic_get_relocated_section_contents): Call + bfd_xmalloc() instead of bare malloc(). + +Fri Mar 13 15:44:37 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: pass down MAKEINFO on info. + +Fri Mar 13 07:41:13 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * config/mt- now .mt, config/mh- now .mh. + host/h- now just . + * configure.in: reflect changes + +Thu Mar 12 11:15:02 1992 Per Bothner (bothner@cygnus.com) + + * libbfd-in.h (set_tdata): Make change of Feb 27 in the + actual source file, not just the generated libbfd.h. + +Sat Mar 7 10:33:41 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-i960.c (icoff_little_vec): add COFF_SWAP_TABLE so we can run + gdb on little-endian 960 code. + * archive.c (compute_and_write_armap): indirect symbols should go + into the archive header too. + +Fri Mar 6 21:55:16 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: added check target. + +Thu Mar 5 23:51:42 1992 John Gilmore (gnu at cygnus.com) + + * coff-msym.c: Move this file from gdb/ecoff.c. It + handles byte-swapping for ECOFF (MIPS symbol) files. + * config/mh-decstation, config/mh-irix3: Add coff-msym.o + to the files built on MIPS-based hosts. + * Makefile.in: Add rule for coff-msym. + +Thu Mar 5 21:36:05 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: added clean-info target. MINIMIZE=1. + +Sun Mar 1 22:32:58 1992 Per Bothner (bothner@cygnus.com) + + * coff-rs6000.c: Move core file functions into separate + new file rs6000-core.c. This is needed because reading + core files depends on native include files that conflict + with ../include/coff/rs6000.h. + * config/mh-rs6000: Add rs6000-core.o to HDEPFILES. + +Thu Feb 27 22:19:55 1992 Per Bothner (bothner@cygnus.com) + + * aoutx.h (NAME(aout,print_symbol)): Don't print + symbol addresss for undefined symbols. + * coff-rs6000.c: Various updates (due to target- + independent changes). + * libbfd.h: Ditto (tdata field is now a union). + * hosts/h-sparc.h: Removed prototype for bogus function + 'emset' (presumably should have been 'memset' - which is there). + +Thu Feb 27 11:46:33 1992 John Gilmore (gnu at cygnus.com) + + * configure.in (mips-big-* target): Same is Iris. + +Thu Feb 27 09:24:56 1992 Steve Chamberlain (sac at thepub.cygnus.com) + + * aoutx.h (translate_from_native_sym_flags): when creating an + alias symbol, fill in the section as undefined, rather than + leaving it blank. If an output section can't be found for a + symbol, then don't core dump. + +Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in, configure.in: removed traces of namesubdir, + -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced + copyrights to '92, changed some from Cygnus to FSF. + +Wed Feb 26 19:40:59 1992 Steve Chamberlain (sac at thepub.cygnus.com) + + * bfd.c: lint + * coff-h8300.c: fix stupid reloc subtraction bug + * coffcode.h (coff_swap_aux_out): only swap a tvndx by 2 bytes, + since that's how wide it is. (coff_slurp_symbol_table): always zero out + the symbol.flags and done_lineno fields. + +Tue Feb 25 14:29:24 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + * coffcode.h (coff_write_symbol): write out the correct number of + auxents. + * cpu-h8300.c: fix disassembly bug + +Fri Feb 21 21:39:56 1992 John Gilmore (gnu at cygnus.com) + + * bfd-in.h (bfd_errmsg), coffcode.h (coff_swap_aux_in, + section_from_bfd_index), cpu-h8300.c (howto*_callback), + reloc.c, section.c (bfd_map_over_sections), targets.c + (bfd_target_list): Protolint. + * libbfd.h: Update to match a libbfd-in.h from a month ago. + +Fri Feb 21 10:57:54 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + * coffcode.h (coff_swap_aux_in): lint, (coff_print_symbol): prints + out tagndx too. + * aoutx.h (swap_std_reloc_out, swap_ext_reloc_out): use the output + section of a symbol rather than the section of a reffed symbol to + determine the r_index of an emmitted reloc. + +Thu Feb 20 18:10:34 1992 Per Bothner (bothner at cygnus.com) + + * PORTING: New (preliminary) porting guide. + +Wed Feb 19 21:39:37 1992 John Gilmore (gnu at cygnus.com) + + * bout.c (callj_callback), coff-a29k.c (a29k_reloc), coff-m88k.c + (howto_hvrt16): lint. + +Mon Feb 17 12:02:17 1992 Per Bothner (bothner at cygnus.com) + + * hp300bsd.c (new), config/mt-hp300bsd: Make hp300bsd + a full configuration (with possible cross-development), + instead of using host-aout.c. + +Sun Feb 16 13:01:49 1992 Per Bothner (bothner at cygnus.com) + + * aout-target.h (MY(write_object_contents): + Set obj_reloc_entry_size (abfd). + * gen-aout.c: Change to emit a .c files, not a .h file. + +Thu Feb 13 20:11:47 1992 Fred Fish (fnf at cygnus.com) + + * elf.c (elf_slurp_symbol_table): Remove obsolete use of + BSF_ABSOLUTE and replace with bfd_abs_section reference. + +Thu Feb 13 17:22:44 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + * coffcode.h (get_normalized_symtab): fixed bug where symbols + with more than one auxent can cause nasty core dumps. + + * coffcode.h, libcoff.c: added new fielded to coff_symbol_struct + "done_lineno" so that a symbol which appears twice in the symbol + table only gets it's linenumbers relocated once. Modifed + (coff_write_native_symbol) and (coff_make_empty_symbol) to make + use of it. + +Tue Feb 4 15:39:55 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + * aoutx.h: (translate_from_native_sym_flags): fix constructor + stuff to use the New Order. + +Fri Jan 31 01:34:45 1992 Stu Grossman (grossman at cygnus.com) + + * ieee.c: Change type of envi[] to unsigned char. + + * configure.in: fix vax ultrix configuration. + + * elf.c (bfd_section_from_shdr): Deal with null return from + bfd_make_section(). (elf_object_p): Select endianess properly. + +Fri Jan 31 01:19:55 1992 John Gilmore (gnu at cygnus.com) + + * hosts/h-tahoe.h, h-vaxbsd.h: Fix stack in core files. + +Thu Jan 30 23:51:07 1992 John Gilmore (gnu at cygnus.com) + + * Makefile.in: host-aout.c doesn't depend on aout-params.h. + * aout-target.h: Use TARGET_BIG_ENDIAN_P to set up vector. + * host-aout.c: Don't use aout-params.h; configure these systems + in their xm files, not in a randomly generated file. + * hosts/h-hp300bsd.h, h-tahoe.h, h-vaxbsd.h, h-vaxult.h: + Specify byte order. + * hosts/h-vaxbsd.h: Define the form of exec and core files. + +Thu Jan 30 13:02:41 1992 Per Bothner (bothner at cygnus.com) + + * config/mt-tahoe, config/mt-vax: Change DEFAULT_VECTOR to + host_aout_vec here as well. + +Thu Jan 30 11:41:45 1992 Stu Grossman (grossman at cygnus.com) + + * host-aout.c: Change TARGETNAME to "a.out" to be compatible with + gdb. config/mt-hp300bsd: Change DEFAULT_VECTOR to host_aout_vec + to prevent undefined symbol. + +Thu Jan 30 07:26:53 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + Various lints found on PersSony + * aoutx.h: cast an enum + * coff-a29k.c: many ints in reloc structure turned to enum + * coffcode.h: more enums + * cpu-h8300.c: more enums + * opncls.c: more enums + +Thu Jan 30 01:19:56 1992 John Gilmore (gnu at cygnus.com) + + * configure.in: Make Tahoe configuration work again. + * bfd-in.h: Remove trailing comma from enum declaration. + * ieee.c: Can't put byte values >0x7F into a signed char. + +Tue Jan 28 21:10:51 1992 Fred Fish (fnf at cygnus.com) + + * Makefile.in: Add dependencies for various coff-*.o files. + + * elf.c: Remove extraneous paren from core_prpsinfo and + core_prpstatus macros, rename core_prpstatus to core_prstatus. + Replace references to old section "size" member with new + "_raw_size" member. Implement elf_make_empty_symbol, which + is now used. + +Tue Jan 28 14:51:40 1992 Stu Grossman (grossman at cygnus.com) + + * trad-core.c, bfd.c, ../include/bfd.h: Various fixes for PMAX + core reading. + +Tue Jan 28 10:46:32 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + * coffcode.h (bfd_coff_relax_section): now static. + (bfd_coff_get_relocated_section_contents): various type lints. + +Mon Jan 27 19:44:08 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + New entry point in the transfer vector - bfd_relax_section. + + * aout-target.h: add to vector, call generic_relax + * bfd-in.h: add to vector + * bfd.c: add #define for vector + * bout.c: add to vector, call generic_relax + * coffcode.h: add to vector, also now has coff specific relax code + for the relaxable H8/300 relocs. Also clean up abs section cruft. + * elf.c: call generic_relax + * ieee.c: call new vector, clean up some bugs due to the creation + of bfd_abs_section + * libbfd.h: add bfd_generic_relax_section EXFUN + * oasys.c: call generic_relax + * reloc.c: implement generic_relax + * seclet.c: moved much of this into coffcode.h + * srec.c: call generic_relax + * targets.c: define new transfer vector + +Fri Jan 24 14:40:17 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + * everything: now modified to use smaller reloc type. Self hosts + on sun3 & sun4. + +Sat Jan 18 17:00:16 1992 Fred Fish (fnf at cygnus.com) + + * config/mh-stratus, config/mt-i860-elf, hosts/h-stratus: + New files for stratus. + + * configure.in: Add configuration fragments for stratus. + +Wed Jan 15 10:02:43 1992 Fred Fish (fnf at cygnus.com) + + * aoutx.h (NAME(aout,find_nearest_line)): Declare various filename + variables as CONST since they are set to point to a const char + string. Fixes compiler complaints. + +Fri Jan 10 17:44:53 1992 Fred Fish (fnf at cygnus.com) + + * hosts/h-amix.h hosts/h-i386v4.h: Change abort() to a function + returning void. + +Fri Jan 10 14:33:32 1992 Per Bothner (bothner at cygnus.com) + + * aoutx.h (NAME(aout,find_nearest_line)): Recognize N_SOL + symbols, so that we can emit the correct file name even + if it's an include file. + +Thu Jan 2 16:43:34 1992 John Gilmore (gnu at cygnus.com) + + * coff-i960.c: Add COFF_SWAP_TABLE to little_vec as well as big_vec. + (Reported by john@labtam.labtam.oz.au (John Carey)). + +Wed Jan 1 04:23:06 1992 Fred Fish (fnf at cygnus.com) + + * elf.c: Change all '#if HAVE_PROCFS' to '#ifdef HAVE_PROCFS'. + + * config/mh-amix, config/mh-i386v4: Remove HDEFINES that was + being used to -DHAVE_PROCFS. + + * hosts/h-amix, hosts/h-i386v4: Add '#define HAVE_PROCFS'. Move + '#include "fopen-same.h"' to end of file to match other h-* files. + +Fri Dec 20 12:06:17 1991 Fred Fish (fnf at cygnus.com) + + * configure.in: Change svr4 references to sysv4. Add case + "unknown" for target vendor and infer some targets based + on the specified operating system. + +Wed Dec 18 17:17:59 1991 Stu Grossman (grossman at cygnus.com) + + * bfd-in.h, libaout.h: ANSIfy enums. + +Wed Dec 18 16:12:25 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + * archive.c (normalize): created version for VMS which removes the + VMS directory crap from the front and end of a filename, eg turn + [-.foo]bar.obj;123 into bar.obj + (bfd_construct_extended_name_table): now writes index into an + extended name table in decimal - the same base used to read an + extended name table. + +Wed Dec 18 14:40:39 1991 Per Bothner (bothner at cygnus.com) + + * aout-encap.c: Fix to use aout-target.h. + * aoutf1.h: Use standard MY_object_p and MY_callback + in aout-target.h. Remove target-specific versions. + * host-aout.c: Re-write to use aout-target.h. + * gen-aout.c: New files use with host-aout.c to generate + host-specific a.out-related parameters. + * Makefile.in: host-aout.o depends on aout-params.h, which is + generated by gen-aout. + * aout-target.h: Make a little more flexible. + * libaout.h, aout-target.h: Removed WORK_OUT_FILE_POSTIONS + macro. Instead, inline it in aout-target.h. + * newsos3.c: Define N_SHARED_LIB(x) as 0 to avoid + a gcc -Wall warning. + * archive.c: Add missing commas in DEFUN macro (2 places). + * elf.c, coffcode.h, aoutf1.h: Use ANSI functions instead of + Berkeley ones, now that libiberty has them: + bcopy->memcpy, bzero->memset, bcmp->memcmp. + * aoutx.h: Various touch-ups: Re-formatting, fix a cast, + remove unused variable. + +Tue Dec 17 19:48:59 1991 Fred Fish (fnf at cygnus.com) + + * elf.c (elf_core_file_matches_executable_p): Enclose corename + and execname inside HAVE_PROCFS ifdef since they are unused + when it is not defined. + +Mon Dec 16 12:00:10 1991 Fred Fish (fnf at cygnus.com) + + * elf.c: Flag all sections as either code or data. We can't + be sure what they are anyway, since ELF doesn't fit the + traditional model of text+data+bss very well. Add new local + function elf_read() to simplify code. Record entry point in + the bfd structure. + +Thu Dec 12 21:01:22 1991 John Gilmore (gnu at cygnus.com) + + * hosts/h-*.h: Configure fopen using ../include/fopen-*.h + rather than N copies of the same lines. + +Wed Dec 11 16:39:45 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + * cpu-h8300.c: disassemble branch displacements correctly + * coff-h8300.c: put reloc offsets out in 32bits + + * makefile.dos, configdj.bat: New files from DJ + * cache.c: fopen with new macros is needed for DOS. + * ieee.c: environ renamed to envi to stop an include file + conflict. + * opncls.c, coff-rs6000.c: more fopens with macros. + +Tue Dec 10 04:07:24 1991 K. Richard Pixley (rich at rtl.cygnus.com) + + * Makefile.in: infodir belongs in datadir. + +Sat Dec 7 16:39:23 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + * Makefile.in: fix where docdir lives + + * aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c, + coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c, + libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c, + srec.c, syms.c, targets.c : all new documentation and lint + removal. + + +Sat Dec 7 07:22:09 1991 John Gilmore (gnu at cygnus.com) + + * coffcode.h, srec.c: Lint. + +Fri Dec 6 22:58:48 1991 K. Richard Pixley (rich at rtl.cygnus.com) + + * Makefile.in: install using INSTALL_DATA, added standards.text + support. + + * configure.in: mark directory as target dependent. configure + nows works in objdir always so make file existence checks + against ${srcdir}. + +Thu Dec 5 22:46:19 1991 K. Richard Pixley (rich at rtl.cygnus.com) + + * Makefile.in: idestdir and ddestdir go away. Added copyrights + and shift gpl to v2. Added ChangeLog if it didn't exist. docdir + and mandir now keyed off datadir by default. + +Wed Dec 4 10:14:17 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + * aoutf1.h (sunos__object_p, sunos4_callback): moved the + computation of arch and machine type so it's worked out before + some_aout_object_p is called. + * aoutx.h: (some_aout_object_p): don't set arch and mach to + unknown. + * archures.c: add extra field 'section_align_power' to hold + default section alignment in object files. + * cpu-a29k.c, cpu-h8300.c, cpu-i386.c, cpu-i960.c, cpu-m68k.c, + cpu-m88k.c, cpu-mips.c, cpu-rs6000.c, cpu-sparc.c, cpu-vax.c: + initialize the new field. + * bout.c (b_out_callback): replace the text size, since aout + fries them. + * aoutx.h: Documentation in the new style + +Wed Dec 4 02:00:30 1991 John Gilmore (gnu at cygnus.com) + + * bfd.c (bfd_get_mtime): Don't cache mtime any more; only + use the saved value if mtime_set is already set (intended + for archive files, though apparently not used yet). + +Tue Dec 3 22:54:50 1991 John Gilmore (gnu at cygnus.com) + + * targets.c: Revise comments about how to configure the target + vector, to match reality. Remove mention of obsolete methods. + Remove long lists of capitalized macros that turn into the same + thing in lowercase. Normal vector simply lists all known + lowercase xvec names; all other cases are handled by SELECT_VECS. + + * config/mt-i386-coff: Set DEFAULT_VECTOR to real identifier, + not macro name. + + * config/mt-i960-{coff,bout}: Use SELECT_VECS to make a short + list of supported targets. + +Tue Dec 3 14:06:15 1991 Per Bothner (bothner at cygnus.com) + + * archive.c (bsd_write_armap): The pad byte sometimes added to + the string table in a __.SYMDEF member is now + counted as part of the size of the string table. + This is compatible with the old ranlib, as well as Sun's. + +Tue Dec 3 10:53:30 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + * srec.c: Rewrote to fix many bugs; now gets the record type + right, doesn't choke on input, sets the start address in an S9 and + fills in the filename on an S0. + +Sat Nov 30 21:19:15 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + * cpu-h8300.c: Add support for MEMIND addressing mode + + * coff-a29k.c: defined RELOC_PROCESSING to take the #ifdef out of + coffcode.h + * coffcode.h: use the new macro if available + + * elf.c (elf_corefile_note): cast malloc to avoid warning. + * Makefile.in: Fixed dependencies due to file rename + + * aout-encap.c, aoutf1.h, aoutx.h, archive.c, bout.c, coff-a29k.c, + coff-h8300.c, coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c, + coff-mips.c, coff-rs6000.c, cpu-h300.c, elf.c, i386aout.c, + newsos3.c, stab-syms.c, syms.c: All these files have had their + #includes altered to point to the new places. + +Fri Nov 29 20:04:49 1991 Fred Fish (fnf at cygnus.com) + + * config/mh-i386v4, config/mh-i386-elf, hosts/h-i386v4.h: New files. + + * configure.in: Add vendor "ncr" as supported per-target vendor. + Add svr4 case for i386 per-host case. + + * elf.c (elf_object_p, elf_core_file_p): Add missing "break" to + ELFDATA2LSB cases. + +Fri Nov 29 12:16:51 1991 Per Bothner (bothner at cygnus.com) + + * syms.c (bfd_decode_symclass): Return 'A' + for symbols that are both absolute and global. + * archive.c (bfd_special_undocumented_glue): Return NULL + if bfd_ar_hdr_from_filesystem returns NULL. + +Tue Nov 26 09:10:55 1991 Steve Chamberlain (sac at cygnus.com) + + * Makefile.in: added coff-h8300 + * configure.in: now h8 is a coff target + * cpu-h8300.c: fix various disassembly problems + * libcoff.h: took out some code which has been #0ed for a long + time. + * targets.c: added h8 coff + * coff-a29k.c, coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c + added new macro RTYPE2HOWTO to take a load of #ifdefs out of + coffcode.h + * coffcode.h: Started to change the way machine dependencies are + handled, from the nest of #ifdefs to macros defined in the + including coff-.c + +Fri Nov 22 08:11:42 1991 John Gilmore (gnu at cygnus.com) + + * aoutx.h (some_aout_object_p): Set the `executable' bit + if the entry point is contained in the text segment, even if the + text segment is at location 0. + + * coff-mips.c, coffcode.h: Peter Schauer's patch to kludge in + nonstandard MIPS sections (.rdata, .sdata, etc). + + * aoutx.h, bfd.c, coffcode.h, ieee.c, oasys.c, targets.c: CONST lint. + * libbfd-in.h, libbfd.h, aoutx.h, coffcode.h, elf.c, libaout.h: + Rename ALIGN to BFD_ALIGN to avoid conflict with BSD . + * libbfd.c: Lint. + * host-aout.c, trad-core.c: Fix write_armap prototypes. Lint. + +Thu Nov 21 19:56:40 1991 Per Bothner (bothner at cygnus.com) + + * stab-syms.c, syms.c: Moved bfd_stab_name() and bfd_stab_names[] + from syms.c to new file stab-syms.c. Also, since GNU extended + type codes such as N_SETT are no longer in ../include/stab.def, + include them manually. + * stab-syms.c, aoutx.h: Renamed bfd_stab_name() and + bfd_stab_names[] to aout_stab_name() and aout_stab_names[]. + * libaout.h: Added prototype for aout_stab_name(). + * Makefile.in: Update Makefile for new stab-syms.[co]. + +Thu Nov 21 11:50:49 1991 John Gilmore (gnu at cygnus.com) + + * libaout.h (WORK_OUT_FILE_POSITIONS): One more try at this + rather complicated seeming problem. Eliminate LOGICAL_ versions, + just make N_XXX work by excluding the header from the text segment. + * aoutx.h: Fix comments to match. + +Tue Nov 19 18:49:01 1991 Per Bothner (bothner at cygnus.com) + + * libaout.h (WORK_OUT_FILE_POSITIONS): Use new LOGICAL_TXTADDR, + LOGICAL_TXTOFF, LOGICAL_TXTSIZE macros to figure out numbers + for the "logical" text segment (i.e. never consider the exec + header to be part of the text segment). This change is + needed for consistency with various other parts of bfd and ld. + * aoutx.h (NAME(aout,soe_aout_object_p)): Fix comment, + and move calculation of obj_textsec(abfd)->size to libaout.h. + * bfd-in.h: Removed bogus ';'. + + * Makefile.in: Add MINIMIZE flag to select lean + or bloated target_vector. + * targets.c: Use new MINIMIZE macro, and add trad_core if needed. + * newsos3.c: Fixes to ../include/aout64.h remove need + for special N_TXTOFF macro, but require N_HEADER_IN_TEXT. + +Mon Nov 18 12:00:59 1991 Per Bothner (bothner at cygnus.com) + + * aout-target.h, aoutf1.h, newsos3.c: Make aout-target.h + handle both little and big-endian targets, with little + the default unless TARGET_IS_BIG_ENDIAN_P is defined. + * host-aout.c: Add FIXME note. + +Sun Nov 17 13:29:39 1991 Per Bothner (bothner at cygnus.com) + + * targets.c: Make the default target_vector contain + just &DEFAULT_VECTOR. This makes executables a lot smaller. + Old behavior can be gotten by defining ALL_TARGETS. + * aoutf1.h, demo64.c, i386aout.c, newsos3.c, sunos.c: + Factored out common code into new file aout-target.h. + Saves a lot of duplicate code for a.out variants. + +Fri Nov 15 13:00:43 1991 Per Bothner (bothner at cygnus.com) + + Get 'make headers' to work when configured with +subdirs. + * Makefile.in: Add $(subdir) to docdir path. + * doc/Makefile.in (protos): Add $(srcdir) prefix + to name of sed scripts. + +Thu Nov 14 19:49:10 1991 Per Bothner (bothner at cygnus.com) + + * aoutx.h (NAME(aout,print_symbol)): Fix thinko. + * syms.c (bfd_stab_names): Turn on new GNU_EXTRA_STABS macro + to include names of N_SETT etc. + +Thu Nov 14 19:11:13 1991 Fred Fish (fnf at cygnus.com) + + * elf.c: Add minimal support for ELF symbol tables. Generates + canonical bfd symbol tables from ELF symbol tables. Change the + name of some functions from bfd_ to elf_. + + * syms.c: Trivial fix to comment to remove a redundant "to". + +Wed Nov 13 17:02:01 1991 John Gilmore (gnu at cygnus.com) + + * coff-{i386,m68k,m88k}.c: Change name of file format to standard + form that GDB recognizes as COFF. + +Wed Nov 13 09:09:41 1991 Steve Chamberlain (sac at cygnus.com) + + * ieee.c (ieee_object_p): cast NULL correctly. + * configure.in: added harris host + + * coff-a29k.c: Lots of changes, most from David Wood. + +Tue Nov 12 07:21:41 1991 John Gilmore (gnu at cygnus.com) + + * coff-m88k.c (coff_write_armap): Just #undef it. + +Mon Nov 11 20:30:18 1991 Steve Chamberlain (sac at cygnus.com) + + * Makefile.in: standardize on MINUS_G to disable debugging + * coff-m88k.c: create coff armaps instead of bsd ones. + * opncls.c (bfd_close_all_done), (bfd_close): Mask out random bits + when calling chmod. + +Mon Nov 11 19:07:32 1991 Fred Fish (fnf at cygnus.com) + + * elf.c: Additions to support ELF format core files. + * config/mh-amix: Add -DHAVE_PROCFS to HDEFINES, since host + has support for /proc (all the include files in particular). + +Mon Nov 11 18:36:47 1991 Per Bothner (bothner at cygnus.com) + + * aoutx.h (NAME(aout,find_nearest_line)): Handle the case + of two N_SO stabs, one for directory, and one for filename. + + * bfd-in.h (print_vma): Factor out duplicate definition. + + Exit a little more gracefully when malloc returns NULL. + * libbfd.c: New function bfd_xmalloc (malloc wrapper). + * opncls.c, syms.c, bout.c, aoutx.h: Replace malloc by bfd_xmalloc. + * libbfd.h: Rre-generated due to libbfd.c update. + +Sat Nov 9 13:45:01 1991 Fred Fish (fnf at cygnus.com) + + * config/mt-m68k-elf: Define DEFAULT_VECTOR as elf_big_vec. + + * elf.c (elf_object_p): Don't try to create a bfd section for + the first ELF section header. It is just a placeholder. + +Sat Nov 9 03:04:26 1991 John Gilmore (gnu at cygnus.com) + + * coff-rs6000.c, config/mh-rs6000: Make it work on archive and + core files, when compiling native. + * hosts/h-rs6000.h: Define FASCIST_FDOPEN for bfd_fdopenr. + + FIXME: The aoutf1.h change below needs to be reversed back + to the way it was. + +Thu Nov 7 11:03:55 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + * coffcode.h: Defined new macros [PUT|GET]LINENO_LNNO for + manipulation of lnno fields in lineno structs in a coff-.h + independent way. Override it in coff-.h to your favourite + number if you don't have a 16bit lnno field. (coff_swap_lineno_in) + (coff_swap_lineno_out): modified to use the new macros. + +Mon Nov 4 11:38:33 1991 Steve Chamberlain (sac at cygnus.com) + + * aoutf1.h (sunos4_callback): Now defaults to 68020 rather than + unknown arch when the magic number doesn't specify the + architecture, since some OSs (eg old sun3s) don't set the number, and + 020 is probably the right answer anyway. + +Sun Nov 3 12:07:08 1991 Per Bothner (bothner at cygnus.com) + + * hosts/h-news.h, hosts/h-rtbsd.h: + Get rid of MISSING_VFPRINTF, since libiberty provides one. + * bfd-in.h (bfd_print_symbol_type_hopw enum): Add new option + bfd_print_symbol_nm, for use by nm. + * aoutx.h (NAME(aout,print_symbol)): Add code for new + bfd_print_symbol_nm option, to print in nm format. + * coffcode.h (coff_print_symbol), ieee.c (ieee_print_symbol) + oasys.c (oasys_print_symbol): Provide stub implementations + for bfd_print_symbol_nm. + * syms.c: New function bfd_decode_symclass, used by nm printer. + New function bfd_stab_name to look up string name of stab code. + +Sat Nov 2 14:26:03 1991 Steve Chamberlain (steve at cygnus.com) + + * Makefile.in: Added ctor.c + * archures.c (bfd_default_arch_struct) added + bfd_default_reloc_type_lookup. + * coffcode.h: removed a load of #if 0ed code. + (coff_compute_file_section_positions): now works out the section + alignment and size correctly in all cases. + (coff_get_symtab): looks for constructor symbols and calls the + right function when they're found. (coff_canonicalize_reloc): + knows when a section is full of constructors and does the right + thing. + * cpu-m88k.c: Added default_reloc_type lookup to the architecture + description. + * libbfd-in.h: (bfd_default_reloc_type_lookup) defun added. + * libcoff.h: removed #if 0ed code + * reloc.c: (bfd_reloc_code_real_type) added BFD_RELOC_CTOR for + arch independent constructor relocation type. + (bfd_reloc_type_lookup): removed the comment "this will go away" + since it won't. (bfd_howto_32): stolen from 88k, this is a 32bit + reloc which is used when BFD_RELOC_CTOR falls through to give a + default 32bit reloc for constructors. + (bfd_default_reloc_type_lookup): added. + * aoutf1.h: fixed SEGMENT_SIZE typo. + +Thu Oct 31 18:23:06 1991 John Gilmore (gnu at cygnus.com) + + * coff-rs6000.c: Change name to "aixcoff-rs6000", to avoid + matching prefix "coff". + * coffcode.h (coff_swap_aux_in, coff_swap_aux_out): Handle + rs/6000 csect records. + +Sun Oct 27 16:56:58 1991 Steve Chamberlain (steve at cygnus.com) + + * coff-m88k.c, targets.c: change name of m88k_bcs to m88kbcs + * configure.in: add motorola delta88 cases + * libbfd.h, libbfd-in.h, archive.c, ieee.c, elf.c, srec.c: fix + write_armap prototype + * libbfd.c: add doc on bfd_write_bigendian_4byte_int + +Fri Oct 25 02:48:19 1991 John Gilmore (gnu at cygnus.com) + + * Rename COFF-related files in `coff-ARCH.c' form. + coff-a29k.c, coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c, + coff-mips.c, coff-rs6000.c to be exact. + + * Makefile.in: Only supply TARGET_DEFAULTS to targets.c, reducing + make output clutter. + * config/mt-*: Ditto. + +Thu Oct 24 22:40:07 1991 John Gilmore (gnu at cygnus.com) + + RS/6000 support, by Metin G. Ozisik, Mimi Phng-Tho V, and + John Gilmore. Archive support from Damon A. Permezel. + + * Makefile.in: Add cpu-rs6000.c and rs6000coff.c. + * configure.in: Add rs6000 case. + * targets.c: Add rs6000 vector. + * archures.c: Add rs6000, fix comment on romp. + * bfd-in.h (enum bfd_error): Add no_debug_section error. + * libcoff-in.h (struct coff_tdata): Remove unused string_table. + * bfd.c (bfd_errmsgs): Add no_debug_section error message. + * section.c (bfd_make_section): Return NULL on attempt to create + a section twice. + * coffcode.h (bfd_swap_reloc_in): Handle r_type and r_size. + (bfd_swap_aouthdr_in): Handle lots more members. + (make_a_section_from_file): If section has already been seen, + just return false rather than overwriting it. + (coff_real_object_p): Understand incoming magic numbers. + (coff_set_flags): Understand outgoing magic numbers. + (coff_compute_section_file_positions): outgoing aouthdr magic #. + (build_debug_section): Add fn for reading debug string section. + (get_normalized_symtab): Handle symbol names in debug string section. + Remove unused obj_string_table. + (coff_slurp_symbol_table): Handle rs6000-specific storage classes. + * aoutx.h (translate_from_native_sym_flags, N_SET*): Check for + existing section before making one. + * cpu-rs6000.c: New file. + * rs6000coff.c: New file. + +Thu Oct 24 02:03:24 1991 Fred Fish (fnf at cygnus.com) + + * elf.c: Add partial support for ELF format corefiles. Still needs + support for extracting registers from corefiles. + + * config/t-m68k-elf: Set DEFAULT_VECTOR to elf_big_vec. + + * config/{h-amix,h-dgux,h-irix3,h-ultra3}: For systems where + RANLIB is defined as echo, send the output to /dev/null to help + reduce clutter in the output from doing a make. + +Mon Oct 21 17:48:48 1991 John Gilmore (gnu at cygnus.com) + + * hosts/h-vaxult.h: Remove malloc/free decls covered in stdlib.h. + Fix HOST_PAGE_SIZE and HOST_SEGMENT_SIZE. From David Taylor. + +Mon Oct 21 09:34:11 1991 Steve Chamberlain (steve at rtl.cygnus.com) + + * coffcode.h (coff_compute_section_file_positions): make it pad + section size out if there are alignment restrictions so that the + image will be ok on a system where section positions are worked + out by accumulating sizes rather than from the section headers. + * targets.c (proto write_armap). Changed orl_count to unsigned. + * opncls.c (bfd_close_all_done). Added so that generative + programs like gas can close a bfd without causing bfd confusion. + * libbfd.h (changed becuase of protos) + * amdcoff.c: messed with the way that jmp displacements are + calcualated. This may not yet be totally correct. + * archive.c (coff_write_armap): rewrote the way that ranlibs are + written out. + * coffcode.h (fixup_symbol_value): now doesn't core dump if a non + abs symbol has no section (like a register symbol). + (coff_write_symbol) now zeros auxent before filling it up to help + with sensitive applications. + * libbfd.c (bfd_write_bigendian_4byte_int): added. + +Wed Oct 16 22:58:45 1991 John Gilmore (gnu at cygnus.com) + + * bfd.c: Make sure we don't get a macro strerror(). + * opncls.c (bfd_fdopenr): If FASCIST_FDOPEN, use "r", not "r+". + * trad-core.c (trad_unix_core_file_failing_command): Suppress + attempt to recover command, ifdef NO_CORE_COMMAND. + * hosts/h-tahoe.h: Add FASCIST_FDOPEN and NO_CORE_COMMAND; + revamp HOST_*, etc. + * hosts/h-i386v.h: Use , not , unlike POSIX. + +Wed Oct 16 12:43:49 1991 Per Bothner (bothner at cygnus.com) + + * archive.c (bsd_write_argmap): The size of the ranlib structures + should not include the size field itself. + * aoutx.h, libaout.h (NAME(aout, sizeof_headers)): Use + adata(abfd)->exec_bytes_size field instead of constant macro, + because aoutx.h compiles to a simple .o file shared by + all 32-bits a.out targets. + +Wed Oct 16 11:11:05 1991 John Gilmore (gnu at cygnus.com) + + * configure.in: Allow i386-sco-sysv. + * bout.c: Remove unused i960_align; lint dummy core file handlers. + * cpu-h8300.c: lint. + + * host-aout.c: New strategy. We use common code, include files, + and data structures to handle the file, but set a few parameters + from the host's config file (page size, text start addr, etc). + * libaout.h: Define HP BSD machine types. + * aoutf1.h: Handle reading a.outs with these types. + + * trad-core.c: Pass the u.u_ar0 value as the negative of the + virtual-memory-address of the .reg section. We can't just make a + section for "all the regs and nothing else" because only GDB knows + exactly where the regs are (scattered around the upage and stack). + Clean up memory allocation. Remove big- and little-endian + vectors, replace with single vector; this only runs on the host, + in host byte order. Replace byteswap routines with aborts in case + anyone calls them. + * targets.c: There's only one trad_core_vec now. + * aoutf1.h (sunos_core_file_p): VMA of .reg* now needs to be 0. + +Tue Oct 15 08:29:03 1991 John Gilmore (gnu at cygnus.com) + + * hosts/h-amix.h (free): Fix prototype. + + * aoutx.h: Don't use NULL as an integer, for braindead systems + that declare it as (void *)0. (From Peter Schauer.) + +Mon Oct 14 17:20:47 1991 Per Bothner (bothner at cygnus.com) + + * opncls.c (bfd_fdopenr): Add parentheses to avoid reported + problem with bad Ultrix system headers. + * aoutx.h (NAME(aout,set_section_contents)): Try to handle the + various kinds of alignments for the various kinds of + magic numbers. + +Mon Oct 14 14:23:10 1991 John Gilmore (gnu at cygnus.com) + + * doc/Makefile: Don't assume . is on the path (from James Clark). + +Fri Oct 11 22:45:14 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Avoid Sun Make VPATH bugs. + * targets.c: Declare trad_core vectors extern. + +Fri Oct 11 13:03:02 1991 Per Bothner (bothner at cygnus.com) + + * coffcode.h: Moved ALIGN macro to libbfd.h. Removed i960_align. + * libbfd.h: Moved ALIGN macro here. + * bout.c (b_out_callback): Replace i960_align by align_power. + + * libaout.h (struct aoutdata): Added fields page_size, + segment_size and exec_bytes_size. These help generic code + (in aoutx.h and libaout.h) to figure out where to align + the various segments in a demand paged file. + * libaout.h (WRITE_HEADER): Use new (struct aoutdata) fields + to decide if the exec header counts in a_text (text segment size). + Also, assume D_PAGED flag is set; don't set it here. + * bout.c (b_out_callback): Add initialization of + adata fields page_size, segment_size, and exec_bytes_size. + * host-aout.c (NAME(host_aout, callback) and + NAME(host_aout,mkobject): Ditto. + * i386aout.c (aout386_callback) and new aout386_mkobject): Ditto. + * newsos3.c (newsos3_callback) and new newsos_mkobject): Ditto. + * aoutf1.c (sunos4_callback) and new sunos_mkobject): Ditto. + * aoutx.h (NAME(aout,some_aout_object_p)): Don't subtract + EXEC_BYTES_SIZE from the a_test size; this is only appropriate + for some systems (mainly sunos), so do it in the callback instead. + Same routine: Add stuff to the THIS_IS_ONLY_DOCUMENTATION comment. + * aoutx.h (NAME(aout,set_section_contents): Change the way + filepos and size of sections are carried out to support + older styles of demand paged executables. + + +Fri Oct 11 12:33:36 1991 Steve Chamberlain (steve at cygnus.com) + + * bfd-in.h: Added more macros to COFF_SWAP_TABLE. + * bfd.c: Added macros to enable gas to swap coff records. + * coffcode.h: Make the coff_swap_*_out routines return the number + of bytes swapped, and cleaned up their prototypes. + * configure.in: Added ebmon/coff support + * ecoff.c: Changed null definitions of coff_swap_*_out to conform + to new prototypes + * targets.c: Added new entry points for coff swapping + +Fri Oct 11 03:01:52 1991 John Gilmore (gnu at cygnus.com) + + Restructure configuration scheme for bfd, binutils, ld. + + * include/sys/h-*.h: Move to bfd/hosts/h-*.h. + * configure.in: Revise to symlink sysdep.h to hosts/h-xxx.h. + Change some config names to match other dirs. + * *.c: Include bfd.h before sysdep.h, so ansidecl and PROTO() + get defined first. + * Makefile.in: Use -I. to get sysdep.h. Remove refs to + ../include/sysdep.h. + * cpu-i960.c: Strncmp needed a length arg. + * ecoff.c: Don't ever call trad_unix_core_file_p from here. + * i386aout.c: Remove dead N_TXTOFF override. + * trad-core.c: Don't disable the whole file if SUN4_SYS. + * config/: Rename some config files to match up h-*.h names. + Remove all the HOST_SYS definitions from the config files. + * hosts/h-amix.h, h-i386v.h: Define POSIX_UTIME, not USG. + * hosts/h-hp9000.h: Remove USG comment. + * hosts/h-rs6000.h: Include for malloc. + * hosts/h-news.h, h-sparc-64.h: New config files that had + previously been kludged in the file. + +Thu Oct 10 17:54:08 1991 John Gilmore (gnu at cygnus.com) + + * config/*: trad-core support is HOST dependent, not target + dependent. Target config files only set DEFAULT_VECTOR and/or + other vector elements. Exception: when host-aout.c is in use, + in which case we're forced to assume we're native (hp, vax, + tahoe). Rename XDEPFILES to HDEPFILES. + * Makefile.in: Rename XDEPFILES. + * config/h-sun*: Don't force static linking. + * trad-core.c: Document how to use it nowadays. + * i386aout.c, newsos3.c: Clean up. + * i386coff.c: Allow 386 coff files to be used as core files too + (for reading core files from embedded systems). + +Tue Oct 8 15:30:39 1991 John Gilmore (gnu at cygnus.com) + + * Add i386aout.c for a.out support on the i386. + +Tue Oct 8 12:18:54 1991 Roland H. Pesch (pesch at cygnus.com) + + * reloc.c, section.c, syms.c, targets.c: correct info-node + structure in *doc* comments. + doc/Makefile: stop hiding complaints from makeinfo. + +Sun Oct 6 19:10:06 1991 John Gilmore (gnu at cygnus.com) + + * aoutx.h (...some_aout_object_p): Take a third parameter, + the internal_exec struct, and avoid ever looking at an + external_exec. All callers changed to read the entire + external_exec struct, swap and check its magic number, + swap in the whole structure, and pass the swapped-in version to + some_aout_object_p. + * bout.c: Bring into modern era. Use single _object_p routine + for big- aand little-endian. Provide internal and external + exec header structs. Use separate swap-in and swap-out routines. + + * libaout.h: Move struct internal_exec from ../include/aout64.h + to here. Add obj_symbol_entry_size to struct aoutdata. + * aoutx.h (...some_aout_object_p): Set obj_symbol_entry_size. + + * ../include/aout64.h: Change EXTERNAL_LIST_SIZE to + EXTERNAL_NLIST_SIZE. Callers changed. + +Fri Oct 4 18:18:46 1991 John Gilmore (gnu at cygnus.com) + + * bfd.c: Remove strerror() to libiberty. + + * elf.c: Remove elf_set_section_contents, use generic one. Lint. + * libbfd-in.h, libbfd.c: Add bfd_generic_set_section_contents. + * libbfd.c (bfd_generic_{get,set}_section_contents): Check that + last byte of transfer, not first byte, is within the section. + + * host-aout.c: Remove `BSD' archive support. Lint. + + * archures.c: Rename `struct bfd_arch_info_struct' to `struct + bfd_arch_info'. Rename `typedef bfd_arch_info_struct_type' to + `bfd_arch_info_type'. All uses changed. + * reloc.c: Rename `bfd_reloc_status_enum_type' to + `bfd_reloc_status_type'. Rename `bfd_reloc_code_enum_real_type' + to `bfd_reloc_code_real_type'. (This seems to be a misnomer, + it needs a better name.) All uses changed. + * targets.c: Rename `enum target_flavour_enum' to `enum + target_flavour', and remove the `_enum' from all of the enum + values themselves. All uses changed. + + * configure.in, config/h-i386mach: i386 mach host. + * config/t-i386-aout: Use host-aout.c. + + * trad-core.c: Give it its own xvec's to make it independent + of other file formats. + * ecoff.c, host-aout.c: Remove refs to trad-core. + * config/t-dec3100, t-hp300bsd, t-tahoe, t-vax: Define TRAD_CORE. + * targets.c: #ifdef TRAD_CORE, include it in the vector. + +Fri Oct 4 17:38:03 1991 Steve Chamberlain (steve at cygnus.com) + + * reloc.c: Extended NEWHOWTO macro + * ieee.c: Changed the way 8bit pcrel is done + * cpu-h8300.c: got the registers in the right order + +Thu Oct 3 19:39:55 1991 John Gilmore (gnu at cygnus.com) + + * bfd-in.h: enum boolean => enum bfd_boolean for SVR4. Gumby's + prediction is vindicated! + + * bfd-in.h, libbfd-in.h, doc/Makefile, doc/tolibbfd, doc/intobfd: + Remove refs to howto.c, since Steve forgot. + +Thu Oct 3 07:49:21 1991 Steve Chamberlain (steve at cygnus.com) + + * elf.c: took the abort out of set_arch_mach so that objdump -i will + still work. Now allows any architecture/machine to be set. + +Wed Oct 2 13:50:35 1991 Steve Chamberlain (steve at cygnus.com) + + * howto.c deleted and moved code to reloc.c + + * libbfd.h, libbfd-in.h removed $id stuff for real + + * cpu-h8300.c Made it match various different spellings of h8300. + + * archures.c: Took out the first char filter which made it only + look for a cpu/arch match when the first chars of supplied and + tested names were the same. + + * targets.c removed oasys stuff, pending someone to fix the bugs + in it. + + +Tue Oct 1 12:29:44 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in, configure.in, targets.c, elf.c: Add preliminary + ELF support good enough for GDB. + * configure.in, config/h-amix, config/t-m68k-elf: Handle + m68k-cbm-svr4 host and target. + * config/t-m68k-coff, t-m88k-coff, t-m88k-aout: Make files nonempty + so `diff' and `patch' can cope. + +Tue Oct 1 11:24:31 1991 Steve Chamberlain (steve at cygnus.com) + + * archures.c: removed texinfo error + + * init.c: added texinfo hooks, and removed initialization error + message. + + * libcoff-in.h, libbfd-in.h removed $id field so cvs can merge + without complaints. + +Tue Oct 1 05:02:53 1991 John Gilmore (gnu at cygnus.com) + + * cpu-i960.c: Avoid numerical count of initializers. + + Vax Ultrix changes from David Taylor : + * host-aout.c: Make little-endian vector really little-endian. + * configure.in: Separate vax and tahoe cases, handle ultrix. + * config/t-vax: Add trad-core.o. + * config/h-vaxult: New host system. + +Mon Sep 30 15:13:46 1991 Steve Chamberlain (steve at cygnus.com) + + * bfd-in.h VERSION, change version number to 0.18, this makes a + gap, but now is the same as the linker version number. + + * cpu-a29k.c, cpu-i386.c, cpu-m68k.c, cpu-mips.c, cpu-vax.c, + cpu-h8300.c, cpu-i960.c, cpu-m88k.c, cpu-sparc.c: added. These + files will eventually contain processor specific bits for bfd, + like strange relocation information and dis/assembly. So far only + the H8 has been even partially done. This work also ties in with + the change in handling architectures. + + * amdcoff.c: (a29k_reloc) fix error message. + + * aout-f1.h: (choose_reloc_size) now calls bfd_get_arch to + discover the architecture of the bfd. (sunos4_callback) calls the + function bfd_set_arch_mach rather than stuffing stuff directly + into the bfd. (sunos4_write_object_contents), changed names of + accessor functions. + + * aoutx.h: (set_arch_mach) now calls bfd_default_set_arch_mach to + setup the environment. + + * archive.c: (bfd_slurp_coff_armap) coff archives always have the + headers in big endian format, regardless of the endianess of the + host or target. + + * archures.c: totally changed. Now an architecture is represented + with a pointer to an info structure rather than an enumerated type + and a long. The old info is available as two elements in the + structure. Future enhancements to architecure support will + involve pointers to methods being placed into the info structure. + + * bfd.c: changed the definition of the bfd structure for the new + architecture stuff. + + * bout.c: (b_out_set_arch_mach) changed to use the new + architecture mechanism. + + * coffcode.h: (coff_set_arch_mach, coff_set_flags) changed to use + the new architecture mechanism. + + * configure.in: added h8 stuff. + + * ieee.c: too many changes to note. Now ieee files written with + bfd gas and ld can be read by gld and ieee only linkers and + simulators. + + * libbfd.c, libbfd.h: changed prototype of bfd_write. + + * newsos3.c: (newos3_callback) now calls bfd_set_arch_mach rather + than fixing the structure directly. + + * oasys.c: (oasys_object_p) now calls bfd_default_set_arch_mach rather + than fixing the structure directly. + + * opncls.c: (new_bfd) makes sure that bfd_init has been called + before opening a bfd. + + * srec.c: (srec_set_arch_mach) now calls bfd_default_set_arch_mach + rather than fixing the structure directly. + + * targets.c: (target_vector) now by defining SELECT_VECS (perhaps + in the t/hmake file) a user can select which backends they want + linked with bfd without changing the source. + + * init.c: new, looks after initializing modules. + + * howto.c: for future use, will allow an application to work out + what cookie to use as a handle on a relcoatio howto. + +Mon Sep 30 13:31:15 1991 John Gilmore (gnu at cygnus.com) + + * srec.c: Better error checking, partly from Peter Schauer. + (srec_object_p): Avoid assuming any file that starts with 'S' is + an S-record file! (Check for 3 uppercase-hex digits after it.) + (ISHEX): Define new macro for checking supposedly hex characters. + (pass_over): Treat as EOF any S-record line that: + * doesn't have hex in either size character + * produces a size larger than 0x7F + * has an unrecognized type number + +Thu Sep 26 15:27:29 1991 John Gilmore (gnu at cygnus.com) + + * aoutf1.h, aoutx.h, bout.c, coffcode.h, host-aout.c, oasys.c, + opncls.c: Lint (saber actually). + +Thu Sep 26 11:24:24 1991 Per Bothner (bothner at cygnus.com) + + * libaout.h (WRITE_HEADERS): Set header's a_text field always. + * newsos3.c: Fixed two types: newos3 -> newsos3. + * reloc.c (bfd_perform_relocation): Fix pc-relative relocation + to use correct segment. + +Mon Sep 23 18:24:34 1991 Per Bothner (bothner at cygnus.com) + + * aoutx.h (print_symbol): Handle missing symbol->name. + +Fri Sep 20 12:26:01 1991 Stu Grossman (grossman at cygnus.com) + + * aoutf1.h (swapcore_sparc): Change name of USRSTACK, fix comment + at top of routine. + +Tue Sep 17 17:23:49 1991 Stu Grossman (grossman at cygnus.com) + + * oasys.c, configure.in, config/h-irix3, config/t-irix3: + add sgi/irix support. + +Thu Sep 12 14:29:09 1991 John Gilmore (gnu at cygint.cygnus.com) + + Changes for the AMD 29000 Ultracomputer port from David Wood. + (wood@nyu.edu). + + * opncls.c (bfd_fdopenr): Handle NO_FCNTL. + + * Makefile.in: Make subdirs work by using $(INCDIR) in the + crude dependencies. + + * coffcode.h (coff_real_object_p): Pass information about the + current file's coff symbol format to BFD via the coff_data struct. + (coff_find_nearest_line): obj_icof => coff_data. + (coff_swap_sym_{in,out}): Check that SYMNMLEN == E_SYMNMLEN. + (coff_swap_aux_{in,out}): Check that FILNMLEN == E_FILNMLEN + and DIMNUM == E_DIMNUM. + * configure.in: Handle a29k-*-* hosts, and targets + a29k-*-coff, a29k-*-aout, and a29k-*-sym1. + * libcoff-in.h: Add local_n_btmask, local_n_btshft, + local_n_tmask, local_n_tshift, local_symesz, local_auxesz, + local_linesz to `coff_data' (tdata) struct. + (coff_data, coff_data_type, coff_tdata): Rename struct icofdata. + * config/h-ultra3: Handle a29k-*-* hosts as Ultracomputers. + +Thu Sep 12 14:07:22 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * Makefile.in: $(MAKE) for make, $(docdir) for doc + * doc/Makefile: redundant dependencies for Sun-make VPATH bug + +Tue Sep 10 20:34:12 1991 John Gilmore (gnu at cygint.cygnus.com) + + * aoutf1.h (sunos4_core_file_p): Release the right storage in + error case. + (sunos4_core_file_matches_executable_p): Fix header comparison. + * aoutx.h: Avoid shifts of 32 bits, undefined in C. Lint. + * bout.c, icoff.c, ieee.c, libbfd.c, oasys.c: gcc -O -W lint. + +Wed Sep 4 00:44:52 1991 John Gilmore (gnu at cygint.cygnus.com) + + Allow GDB to patch object files. + + * aoutf1.h (sunos_core_file_p): Set SEC_HAS_CONTENTS on all sections. + * trad-core.h (trad_unix_core_file_p): Ditto. + * aoutx.h (aout_set_section_contents): On first output, check + abfd->direction and complain if erroneous. + + * Makefile.in: Add crude dependencies. + +Tue Sep 3 13:46:19 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * config/* aoutx.h configure* shortened all the h/tmake-xxxx + to h/t-xxxx files so that everything will work on System V. + +Fri Aug 23 13:51:06 1991 John Gilmore (gnu at cygint.cygnus.com) + + * aoutx.h: Add information on host-aout.c and how to configure + to use it, to the manual. + * configure.in: Tix typo. + * ecoff.c: If compiling for DEC3100, use trad_unix core files, + else dummy out the core file support. + * trad-core.c (trad_unix_core_file_p): If HOST_DATA_START_ADDR is + specified, use it to locate the data section. + * coffcode.h (coff_write_symbols): Declare buffer as bfd_bytes + rather than as chars (lint). + +Thu Aug 22 22:20:19 1991 Stu Grossman (grossman at cygint.cygnus.com) + + * aoutx.h, coffcode.h: saberized. + +Thu Aug 22 11:27:06 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * bfd.texinfo: some cleanup, reincorporated more intro matter from + bfd.doc + bfd.c, targets.c: minor rewording of doc segments + + +Wed Aug 21 19:13:22 1991 John Gilmore (gnu at cygint.cygnus.com) + + * trad-core.c (trad_unix_core_file_p): Use HOST_TEXT_START_ADDR, + etc, rather than TEXT_START_ADDR. + * host-aout.c: Remove #if 0 around whole thing. + Update to modern (32/64-bit) a.out naming conventions. + Include a large chunk of ../include/a.out.gnu.h to get macros that + are not defined by the system include files. + (host_aout_{32,64}_write_object_contents): Use the WRITE_HEADERS + macro used by the other a.out implementations. + * Makefile.in: Give dependencies to OPTIONAL_BACKENDS. + +Wed Aug 21 14:33:06 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * Makefile.in: use targets "bfd.dvi" and "bfd.ps" instead of + texdoc and psdoc; make these depend on generated .texi's + + * scanit, (new) unPROTO: turn PROTO macros into ANSI declarations in + doc + + * bfd.c, reloc.c, syms.c: minor spelling/wording fixes in doc + portions + + * Makefile.in, awkscan-ip, awkscan-p, doc/intobfd, + libbfd.h, libcoff.h, tolibcoff; new bfd-in.h, libbfd-in.h, + libcoff-in.h: (a) use separate files for invariant parts of bfd.h, + libbfd.h, and libcoff.h; (b) in generated parts of same, use less + obtrusive marks indicating .c origins. + + * bfd.texinfo: generalize most references to linker + +Tue Aug 20 15:18:02 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * Makefile.in: include core.p in PROTOS (building better bfd.h) + * archures.c: remove empty foo() definition (crept in at vn1.9) + +Mon Aug 19 13:48:22 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * bfd.texinfo: use @setchapternewpage on instead of lots of + @page's; minor rephrasing in Introduction. + + * aoutx.h, archive.c, archures.c, bfd.c, bfd.texinfo, cache.c, + coffcode.h, core.c, format.c, ieee.c, libbfd.c, libbfd.h, libcoff.h, + oasys.c, opncls.c, reloc.c, section.c, syms.c, targets.c (documentation + segments): used BFD (caps) more consistently as a name in + discourse, fixed a few other minor typos and uses of fonts + + +Thu Aug 8 16:47:43 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * coffcode.h: fixed bug where string table size wasn't being swapped. + +Thu Aug 1 16:35:28 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * section.c: added SEC_CONSTRUCTOR_TEXT|DATA|BSS flags + + * syms.c: added BSF_CONSTRUCTOR, BSF_WARNING and BSF_INDIRECT + flags. (bfd_print_symbol_vandf) now knows what to do with the + above flags. + + * aoutx.h: made translate_from_native_sym_flags and + translate_to_native_sym_flags produce the above flags. + + +Wed Jul 31 09:53:52 1991 John Gilmore (gnu at cygint.cygnus.com) + + * all files: update copyright notices for GPL version 2. + Install header comments and attribute most modules to their + authors. BFD's name is now officially "Binary File Descriptor", + so remove any conflicting pejoratives. + archures.h: Consists solely of comments; remove it. + +Fri Jul 26 18:11:34 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * Makefile.in, bfd.c: Made it compile again. + +Fri Jul 19 08:17:09 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * newsos3.c, targets.c, coffcode.h: new patches from David Wood + + +Mon Jul 15 16:27:42 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * aoutf1.h archive.c bfd.c coffcode.h core.c ecoff.c ieee.c + bfd.texinfo oasys.c opncls.c reloc.c srec.c: More documentation on + lint fixes. + + * amdcoff.c bfd.texinfo Makefile.in : Folded in changes for amd + 29k coff by David Wood (wood@lab.ultra.nyu.edu). + +Thu Jul 4 09:53:16 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * core.c: New file. + * format.c: New file. + * reloc.c: New file. + * section.c: New file. + * syms.c: New filew. + Cleaned up the rest of the files a bit, and added some + documentation. + +Mon Jul 1 13:29:47 1991 David Wood (wood at david.ultra.nya.edu) + + * opncls.c, ../include/sys/h-sun3.h ../include/sys/h-sun4.h: fcntl + really takes 3 arguments, patched code and ammended prototypes. + +Fri Jun 14 13:19:40 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * ../include/bfd.h (struct bfd_target): Added new field + "align_power_min" which contains the minimum alignment for a + section. This is used in coff_new_section_hook. The field + insertion necessitates an update of all backends.. + + * aoutf1.h jump table field inserted + + * archive.c(snarf_ar_hdr)(bfd_slurp_coff_armap) can now parse dgux style extended + filenames too. + + * bout.c(b_out_squirt_out_relocs) fix to assertion tests. Jump + table field inserted. + + * coffcode.h(just about everything) Now patches up symbol tables + using a different mechanism. The Intel major bug has been fixed, + and the linker can self host on the Aviion and be debugged with + gdb. + + * ecoff.c: new include and jump table patch, i386coff.c: new + include and jump table patch, icoff.c: new include and jump table + patch, ieee.c: can now read archives containing ieee modules., + libcoff.h: added (combined_entry_type), libieee.h: uped max + sections to 20, m68kcoff.c: new include and jump table patch, + m88kbcs.c: new include and jump table patch, oasys.c: various bugs + fixed. opncls.c: added bfd_alloc_grow and bfd_alloc_finish. + srec.c: jump table patch. trad-code.c fixed #IF typeo + +Fri Jun 7 12:35:46 1991 Sean Fagan (sef at cygint.cygnus.com) + + * coffcode.h (coff_swap_aux_in): added else case to deal with + filenames less than 9 characters. + + +Thu Jun 6 18:27:38 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * oasys.c (oasys_archive_p): fixed so it works + + * srec.c: now allows any number of sections to be created in a + file. Outputs addresses of the right length. + +Thu May 30 15:30:10 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * bfd.c (bfd_check_format): Fixed problem where when a defaulted + target didn't match, the format got set to the attempted match, + breaking a future test. + + *../include/i386coff.h : fixed typo in type field with size + + * i386coff.c icoff.c m88k-bcs.c ecoff.c ../include/bfd.h : Added + support in the jump table for the swapping routines exported to + gdb. Now gdb works with the 386. + +Tue May 28 17:21:43 1991 John Gilmore (gnu at cygint.cygnus.com) + + * Merge in changes from gdb-3.95 release. + Makefile.in: Allow hmake and tmake files to add OFILES. + aoutf1.h: + bfd.c: support specific targets as well as searching. When + searching, take default target in preference to others. + bfd.doc: typos + ieee.c, oasys.c: Avoid using the "tdata" macros left of assignment. + liba.out.h: Don't hard-code file offsets; use N_ macros for them. + libbfd.h: Support specific targets as well as searching. + opncls.c: Support specific targets as well as searching. + targets.c: Search is short-circuited if default target matches. + liboasys.c, libieee.c: Undo bothner changes that make macros + work to the left of assignment, but which depend on the + representations of different pointer types being the same. + +Fri May 24 18:56:52 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * i386coff.c: created. + * coffcode.h: added support for 386. + * Makefile.in: added support for 386. + * ../include/i386coff.h: created + +Wed May 22 07:26:38 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * coffcode.h: removed all put_x_ + * libbfd.c: Changed #ifdef __GNUC__ to #ifdef HOST_64_BIT, Added + DEFUNS + + +Tue May 21 08:58:58 1991 Steve Chamberlain (steve at cygint.cygnus.com) + (bothner) + * opncls.c: Changed obstack_chunk_alloc use xmalloc + +Mon May 20 17:12:17 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * everything: Removed sysdep.h from bfd.h and put back into files + from which it was split out. Now 64 bit version is built with a + -DHOST_64_BIT="long long" on the compile line. + +Fri May 17 19:35:26 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + Changed all the [get|put][name] routines to use [get|put]_[size + in bytes]. + + Put in support for 64 bit work. Now two versions of bfd may be + generated, according to the state of TARGET_64_BIT, one which is + 32 bit only, and one which is 64/32 bits. + Created new back end 'demo64' to test 64 bit functionality. + + Renamed some files to work on DOS. + + * archive.c: lint * bfd.c: prototypes and lint. * ecoff.c: added + 64bit transfer * icoff.c: added 64bit transfer * ieee.c: name + chage, 64 bit transfer. * liba.out.h: Split out common code from + sunos and newsos into liba.out. Name changes and prototype mods. * + libbfd.c: lint and prototypes, extra 64bit swaps. * libbfd.h: + prototypes for new functions. * libcoff.h: lint * libieee.h: make + work on DOS * liboasys.h: make work on DOS * m88k-bcs.c: Name + change and 64bit stuff.* newsos3.c: common code removed, new jump + table. * oasys.c: Name change * opncls.c: Portability fixes * + srec.c: Name changes * sunos.c: Removed comon code. * targets.c: + Added demo * aout32, aout64.c include aoutx.h * bout.c: used to + be called b.out.c * coffcode.h: used to be called coff-code.h, now + 64bit ized. * demo64.c: 64 bit a.out back end + +Thu May 16 16:02:07 1991 Steve Chamberlain (steve at cygint.cygnus.com) + from bothner + * libieee.h: Make ieee_data and ieee_ar_data macros usable + on LHS of assignment, even when using old compilers. + * liboasys.h: Ditto for oasys_data and oasys_ar_data. + * m68kcoff.c: Add enum-to-int casts to accomodate old compilers. + * newsos3.c: Fix definitions of SEGMENT_SIZE and TEXT_START_ADDR. + * opncls.c: Define S_IXUSR, S_IXGRP, S_IXOTH if undefined. + * targets.c: Add declaration of newsos3_vec. + +Mon May 13 10:03:29 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * aout.c: fixxed some of the problems with filepos calculation. + (swap_ext_reloc): fixed problem with creation of relocs. + (aout_set_section_contents): fixed filepos problem + + * coff-code.h: (swap_filehdr_in, swap_filehdr_out) add. + (swap_filehdr) delete. Changed all the usage of bfd_h_put_x. + (swap_aouthdr_in, swap_aouthdr_out) add. (swap_aouthdr) delete. + (coff_real_object_p) cleaned up, added MIPS. (coff_object_p) + cleaned up. (coff_write_object_contents) cleaned up. + + * ecoff.c: Totally different. Now supports ecoff fully. + + * icoff.c: fixed problems in relocation callout. + + * libcoff.h: (struct icofdata) removed hdr structure from tdata. + + * m68kcoff.c: updated target vector. + + * sunos.c: (choose_reloc_size) added: (sunos4_callback) calls + choose_reloc_size. (sunos4_write_object_contents) now calls + choose_reloc_size so outputs relocs correctly, also calculates the + size of the sections correctly. + + + +Fri May 10 16:58:53 1991 John Gilmore (gnu at cygint.cygnus.com) + + Merge Per Bothner's changes to modularize BFD a.out a bit. + + * libbfd.h, libbfd.c (bfd_generic_get_section_contents): Add. + * ieee.c: Cast enums to int before comparing them, for brain- + dead compilers. + * coff-code.h: Remove coff_get_section_contents, and use the + generic one instead. + + * aout.c: Derive new module from sunos.c, containing generic + support code for all kinds of a.out files. + + * sunos.c: Remove all code that goes in aout.c. Split out + machine dependent followup in sunos4_object_p into + sunos4_callback. Use JUMP_TABLE(aout) for the transver vector, + and redefine only the names we CHANGE, not all the names. Drop + the little-endian vector, and rename the vector as sunos4 rather + than generic. + + * b.out.c: Use aout.c routines for most of the work. Slight + changes for the new regime. Remove close_and_cleanup and + get_section_contents in favor of generics. New transfer vector + regime. + + * newsos3.c: New support for Sony NEWS, another a.out format. + + * ecoff.c: Remove close_and_cleanup. New tvec regime. + * icoff.c, m88k-bcs.c: Add write_contents to tvec. + * ieee.c, oasys.c: Remove close_and_cleanup, add write_contents + to tvec. + * opncls.c (bfd_close): Call format-dependent write_contents + routine, if writing, before calling target-dependent + close_and_cleanup routine (which is now always generic, I think). + * srec.c: Use bfd_alloc instead of malloc. Remove + close_and_cleanup and move code from it to + srec_write_object_contents. Add write_contents to tvec. + * targets.c: Remove a.out little vector, replace a.out big + vector with SunOS vector. FIXME: Need Vax support again now. + + * libbfd.h: Add write_contents format-dependent-vector to the + bfd_target vector. Supply a generic close_and_cleanup routine. + * liba.out.h: Handle the new aout.c split. Add prototypes for + all routines defined in aout.c. Rename "sunos" things to "aout" + things. Add a few fields where needed for various formats. + * Makefile.in: Add aout.c and newsos3.c. + + * archive.c, ieee.c, oasys.c: Lint. + +Fri May 10 12:34:48 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * ../include/bfd.h + changed forward declaration struct stat; to reduce warnings. Changed + comment on bfd_h__x. + + * ../include/m68kcoff.h, ../include/intel-coff.h, + ../include/m88k-bcs.h + Now there are two incarnations of relocs, linenos and syments. One for + internal digestion, and one full of char arrays for I/O. The original + names have gone to detect errors. + + * Makefile.in, m68kcoff.c, targets.c + Test new structure code with a 68k coff implementaion + + * coff-code.h, icoff.c, coffswap.c, libcoff.h + Fixed all the places where there were problems with the size and + alignments of structures on disk and structures in memory. #ifed out + all the code in coffswap.c, since it should be done using the target + swap routines now. + +Thu May 9 11:00:45 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * ieee.c (do_one, ieee_slurp_section_data): now supports the load + multiple reloc command. + + * sunos.c (sunos4_set_section_contents): Made it so that sections + are always padded to their alignment size. + +Sat May 4 15:49:43 1991 John Gilmore (gnu at cygint.cygnus.com) + + * archive.c, bfd.c, coff-code.h, opncls.c, sunos.c, trad-core.c: + Clean up types and such (saber C problems). + * ecoff.c: Clean up types and such. Remove routines that are + not used. Fix up reading and swapping of shorts from files. + + Notes on bfd-0.5.2-patch1a, from Per Bothner: + + * a.out.vax.c: Remove two bogus "static" from prototypes. + + * ecoff.c: Got rid of lots of non-working junk (that had + been copied directly from coff-code.h). + Updated to be consistent with updates to icoff.c and coff-code.h. + + * libbfd.h: Added definitions for S_IXUSR, S_IXGRP, and S_IXOTH + if they're missing (as they are in (BDS-4.3-based) NewsOS-3). + + * sunos.c (n_txtoff): (Re-)Add support for sony. This is a kludge, + but until the target_vector is automatically generated, + it's as good as any. Note that the text offset is the only + difference between NewsOS and SunOs (including magic numbers). + (Most of the sunos_* routines should to renamed bsd_* + and move to a bsd.c file. Then (and when the target_vector + is automatically generated) it might make sense to create + a separate Sony target.) + + * sysdep.h: Don't declare fread and fwrite. Causes trouble + on some systems, and doesn't help on others. + Similarly, only define X_OK if not already defined. + + * trad-core.c: Don't include sys/stat.h - at least + on NewsOS 3, it has already been included. + +Tue Mar 5 01:47:57 1991 John Gilmore (gnu at cygint.cygnus.com) + + * coff-code.h (bfd_coff_swap_sym, bfd_coff_swap_aux, + bfd_coff_swap_lineno): Export the routines that byte-swap COFF + symbol tables if necessary when reading them in, so gdb can use + them. Add "bfd_coff_" to the names so they won't conflict with + names in calling programs. FIXME-soon: if coff-code.h is + included in two BFD modules, this will cause duplicate + definitions; the routines should be exported to a separate, + common, module (probably along with a mess of other ones). + +Sat Mar 2 12:11:26 1991 John Gilmore (gnu at cygint.cygnus.com) + + Improve modtime support. + + * bfd.h: Add boolean mtime_set, and declare bfd_get_mtime. + Remove #define for bfd_get_mtime. Remove gratuitous comment. + * bfd.c (bfd_get_mtime): New fn, caches mtime, gets if not cached. + BUG: archive members still do not get correct mod times. + + Improve floating point support for core files. + + * sunos.c (struct core): Change void *fpa_dummy to double fp_stuff. + (sunos4_core_file_p): Create a second registers section in the + core file, called ".reg2", for the float registers. + +Thu Feb 14 15:49:06 1991 Gumby Vinayak Wallace (gumby at cygint.cygnus.com) + + * many changes to improve archive handling; found a logic flaw in + bfd_check_format which only just happened to work by cooncidence. + +Thu Feb 14 07:53:16 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * bfd.c (bfd_perform_relocation): fixed to use output_offsets + correctly. + + * bfd.h: changed type of udata in asymbol to void *, like it + should be. Added bfd_reloc_dangerous enum member. + + * coff-code.h: Fixed it so that internally generated symbols get + their values relocated correctly in all cases. Removed calls to + xmalloc. + + * icoff.c: Not understanding the destination symbol of a reloc is + not a failure any more, just 'dangerous'. This allows linking of + b.out and coff images. + + * sunos.c: Cleaned up the way that ZMAGIC section sizes are + calculated. + + +Tue Feb 12 13:25:46 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * sunos.c (translate_to_native_sym_flags): fixed + sym_pointer->n_value so that symbols on the way out get their + section relative values calculated correctly. + + * coff-code.h (mangle_symbols): fixed problem where tags were not + being relocated for structs, enums, unions. Also various lints. + +Mon Feb 11 19:52:26 1991 Gumby Vinayak Wallace (gumby at cygint.cygnus.com) + + * archive.c (get_elt_at_filepos): system_call_error returned + incorrectly. + +Sun Feb 10 23:18:40 1991 Gumby Vinayak Wallace (gumby at cygint.cygnus.com) + + * Resolve the use of no_error and system_call_error. + The bfd library itself now will never set bfd_error to + no_error. + + The code still needs to be combed to make sure all the error + codes are correct. I suspect they are not always set correctly. + + * The names of all the messages have _ prepended because the sun + bundled compiler can't distinguish from a macro which takes an + argument and the same identifier in a non-macro context. + + * The reason for the above being that entry points which used to + be trampoline functions are now just macros which expand to a + direct call through the bfd's xfer vector. + + * (../include/intel-coff.h) F_AR32WR: fix this constant. Why + must gas have its own version of everything (the gas version + had the correct value) + +Tue Feb 5 11:46:53 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * b.out.c: Added patches supplied by chrisb@mipon2.intel.com to + properly support i960 architecture and output correct reloc stuff. + + * bfd.h: added prototype for bfd_printable_arch_mach, added + BFD_FAIL + + * coff-code.h: Applied patches from chrisb to support i960 + architecture, zero relocs and swap them correcly and conditionally + compiled the timestamp. + + * sunos.c: Made the default section alignment 2^3 so that doubles + are done properly. Fixed the same reloc bug that was in b.out.c + + * sysdep.h: Now compiles on a Posix box + +Wed Jan 30 21:36:26 1991 John Gilmore (gnu at cygint.cygnus.com) + + * icoff.c: Fix comment on big-endian version. + * coff-code.h: Make HAS_RELOC really work (it's backwards from + F_RELFLG). Set F_AR32WR in output files if little endian + architecture. + +Tue Jan 29 20:56:10 PST 1991 steve@cygnus.com + + * archures.c fixed =/== typo + + * sunos.c added architecture stuff for output. Fixed + bug where files where vma(data) != size(text) + were processed wrong. + + * coff-code.h added a lint cast + + * (../include/a.out.sun4.h) fixed it so zmagic + worked + +Mon Jan 28 19:15:29 PST 1991 steve@cygnus.com + + * archive.c removed loads of includes, and fixed bug where string + table didn't have a null at the end. + + * bfd.c fixed includes, added symbols argument to + canonicalize_reloc entry point. + + * libbfd.c fixed includes and added some lint patches. + + * targets.c added both sorts of intel coff. + + * b.out.c fixed included, changed was the canonical + relocs were done. + + * icoff.c added support for callj and big and little + enidian tables. + + * opncls.c added chmod+xing for files with EXEC_P set. + + * sunos.c fixed includes. Changed default section + alignement to words. Fixed relocation stuff to work with + new scheme + + * bfd.h various new types added, prototype for new + reloc calls, changed bfd->iostream to a void * + to including files don't need stdio.h. + + * libcoff.h added conversion table to tie relocs to + canonical symbols + + * sysdep.h created + + * coff-code.h fixed includes. Added code to support + big and little endian formats. Various lints. Better + processing of symbols. Changed reloc stuff to new + order + + * libbfd.h fixed includes + + +Mon Jan 21 11:53:51 PST 1991 steve@cygnus.com + + * bfd.h: changed name of alignment entry in sec_struct to + alignment_power, because of conflicting uses within bfd. + Now it should be obvious that it's a 2**n alignment + specifier. Removed start_pad, end_alignment, block, minsize, + output_file_alignment, subsection_alignment and original_vma fields. + Added align_power() macro. Fixed bfd_section_alignment + acessor macros. Added bfd_symbol_same_target macro. + + * b.out.c (b_out_write_object_contents): fixed to use + new alignment member. Fixed (callj_callback) to use section + relative symbols properly. + + * sunos.c (sunos4_object_p): fixed to use new alignment_power. + Fixed (translate_from_native_sym_flags) to correctly make + symbols section relative. + + * bfd.c (bfd_errmsg): fixed various enum cast problems. + (bfd_make_section): took out initialization of obsolete members. + (bfd_print_symbol_vandf): added + + * opncls.c (bfd_create): created. + + * coff-code.h (coff_new_section_hook): took away refs + to obsolete members. (make_a_section_from_file) added + conversion between alignment types. (coff_symbol_from) + added. (coff_count_linenumbers) only counts linenumbers + if symbol is of coff-type. (coff_mangle_symbols) only + heavily mangles symbols if symbol is coff-type. + (coff_write_symbols) various lints. (coff_write_object_contents) + various lints and modification for alignment conversion. + (coff_slurp_relocs) fixed for use with new asection shape. + +Sat Jan 19 16:10:42 PST 1991 steve@cygnus.com + + * archive.c> lots of lint. + + * b.out.c: added callj relocation support, upgrated reloc howto. + Fixed so that asymbol and reloc records are output + correctly. + + * bfd.c: lots of lint, support for new bfd entry point + bfd_print_symbol. + + * bfd.h: changed definition of asymbol to contain pointer to + owning bfd, removed target dependencies. + + * cache.c: took out print statements, put in BFD_ASSERT calls. + + * coff-code.h: various lints, corrected linenumber output + functionality. Added support for new style asymbols and + bfd_print_symbol. Fixed so that asymbol and + reloc records are handled correctly. Added timestamp. + + * icoff.c: Added support for new howto shape. + + * liba.out.h: Added support for new asymbol shape + + * libbfd.c: various lints + + * libbfd.h: various lints + + * libcoff.h: added support for new asymbol shape. + + * sunos.c: various lints. Added support for new asymbol shape + and bfd_print_symbol. + +Wed Jan 16 21:38:09 PST 1991 steve@cygnus.com + + * b.out.c removed prototype of sunos4_ennativate_symtab, lots of + pointer lint. Added support for callj relocation. Fixed bug where + the last 32 bytes of the text section were overwritten by data. Fixed bug + where archives of b.out didn't work due bfd_slurp_extended_name_table + returning false. + + * sunos.c added support for n_other field. Braced the howto table so + that it won't be affected by any lengthing of the howto struct typedef. + Various lints + + * bfd.h added support for n_other field, added special_function + reloc type, modified bfd_perform_relocation prototype. Added bfd_h_get_x + macros. + + * bfd.c upgraded bfd_perform_relocation, various lints. + +Wed Jan 16 01:55:53 1991 John Gilmore (gnu at rtl) + + * ChangeLog: Started ChangeLog for BFD. + * TODO: Create file for suggestions. + + * Makefile: Support easy loading into Saber C. + Add dependencies for icoff.o and bcs88kcoff.o. + Rename coff.c to coff-code.h. Change callers. + + * bfd.c (bfd_check_format): Allow the check_format routines + to return the desired target vector, rather than just a Boolean. + bfd.h (bfd_check_format): Change function pointer return type. + archive.c (bfd_generic_archive_p): change callee. + b.out.c (b_out_little_object_p, b_out_big_object_p, + b_out_real_object_p): change callee. + libbfd.c (_bfd_dummy_target): Dummy routine replacing bfd_false + in check_format transfer vectors that need a filler. + libbfd.h (bfd_generic_archive_p, _bfd_dummy_target): Fix decls. + bcs88kcoff.c: change callee. + coff-code.h (coff_real_object_p, coff_big_object_p): change callee. + icoff.c: change callee. + sunos.c (sunos4_object_p, sunos4_core_file_p): change callee. + + * libbfd.c (zalloc): It should actually zero the storage! + This was commented out for some reason. + + * libbfd.h: Add malloc, xmalloc, memcpy, and fatal decls. + This is so callers can avoid which doesn't exist + on older systems. + + * bfd.c (map_over_sections): Add debugging code, since I + noticed the section count for sunos core files was bad, but only + GDB had detected the problem. + (bfd_set_section_lineno_size, bfd_set_section_linenos, + bfd_get_section_linenos): Remove obsolete functions. + (bfd_apply_relocations): Use longs, not ints, for the math. + + * bfd.h: Declare enum boolean and struct bfd_target as well + as typedefs for them. Remove obsolete + bfd_get_section_lineno_size. + + * cache.c: Make the "fdopen" support work. Keep better track + of how many files are open. Centralize the opening of files + and be sure bfd_open[rw] actually try to open the file. Evade + linked list initialization problems. + + * b.out.c, coff-code.h, opncls.c, sunos.c: lint. + + * coff-code.h (coff_slurp_symbol_table): Null-terminate symtab names. + + * cplus-dem.c: Delete file, since it is not part of BFD. + + * opncls.c (bfd_openr): Eliminate misplaced #if 0 code. + (bfd_openr, bfd_openw): Actually open the file, give error now. + + * sunos.c (sunos4_core_file_p): Set section count. + (sunos4_set_section_linenos, stab_names, fprint_name): Eliminiate + obsolete definitions. + (_write_symbol_table): Initialize counter. + (foop): Eliminate debugging code. + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-9495 sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-9495 --- sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-9495 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-9495 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,10043 @@ +Thu Dec 21 12:43:49 1995 Michael Meissner + + * elf32-ppc.c (ppc_elf_howto_raw): Add a phony reloc to handle the + old style TOC16 references without using R_PPC_GOT. + (ppc_reloc_type): Ditto. + (ppc_elf_reloc_type_lookup): Add support for TOC16. + (ppc_elf_toc16_inner): Renamed from ppc_elf_got16_inner. + (ppc_elf_toc16_reloc): Renamed from ppc_elf_toc16_reloc. + (ppc_elf_got16_{inner,reloc}): Stubs for real GOT support. + (ppc_elf_check_relocs): New function for GOT/PLT support that is + work in progress. + (ppc_elf_adjust_dynamic_symbol): Ditto. + (ppc_elf_adjust_dynindx): Ditto. + (ppc_elf_size_dynamic_sections): Ditto. + (ppc_elf_finish_dynamic_symbol): Ditto. + (ppc_elf_finish_dynamic_sections): Ditto. + (ELF_DYNAMIC_INTERPRETER): Define. + +Wed Dec 20 19:14:18 1995 Ken Raeburn + + * elf.c (copy_private_bfd_data): When attaching sections to + segments ignore sections that won't be allocated. Patch from + Andreas Schwab. + +Tue Dec 19 20:01:43 1995 Ken Raeburn + + * config.bfd: Match on m68k-cbm-* only if OS doesn't match + anything else. + +Tue Dec 19 16:38:59 1995 Ian Lance Taylor + + * coff-i960.c (CALC_ADDEND): Define. + (coff_i960_relocate_section): Add the input section VMA to the + addend for PC relative relocs. + +Sun Dec 17 20:11:55 1995 Kim Knuttila + + * peicode.h (pe_print_pdata): Must test the entire entry for zero + to correctly terminate. + +Fri Dec 15 12:05:57 1995 Ian Lance Taylor + + * targets.c (enum bfd_endian): Define. + (bfd_target): Rename byteorder_big_p to byteorder, and change it + from boolean to enum bfd_endian. Change header_byteorder_big_p + correspondingly. + * bfd-in.h (bfd_big_endian, bfd_little_endian): New macros. + (bfd_header_big_endian, bfd_header_little_endian): New macros. + * bfd-in2.h: Rebuild. + * All targets: Change initialization of byteorder and + header_byteorder to use enum bfd_endian values rather than + booleans. + * All files: Change all references to byteorder_big_p and + header_byteorder_big_p to use new bfd_*_endian macros. + + * coffgen.c (make_a_section_from_file): Set lma to s_paddr, not + s_vaddr. + * coffcode.h (coff_write_object_contents): Set s_paddr to lma, not + vma. + * ecoff.c (_bfd_ecoff_write_object_contents): Likewise. + +Fri Dec 15 07:32:09 1995 steve chamberlain + + * pe[i]-i386.c (TARGET_UNDERSCORE): Define to '_'. + +Thu Dec 14 13:45:37 1995 Ian Lance Taylor + + * ieee.c: Lots of minor cleanups. Make many functions return + errors rather than calling abort. Also: + (ieee_write_twobyte): Remove; change callers to call existing + ieee_write_2bytes function. + (ieee_write_expression): Don't output the section twice when + outputting a local symbol. Don't emit an extraneous zero if there + is only one term. + (ieee_slurp_sections): Set the lma as well as the vma. + (ieee_archive_p): Use bfd_alloc_grow rather than an obstack. + + * ihex.c (ihex_set_arch_mach): Don't accept any architecture, just + a recognized one or bfd_arch_unknown. + (ihex_get_symtab_upper_bound): Define as bfd_0l, to permit objcopy + to succeed. + (ihex_get_symtab): Likewise. + +Wed Dec 13 15:44:06 1995 Ian Lance Taylor + + * aoutx.h: Include . + (struct aout_link_includes_table): Define. + (struct aout_link_includes_totals): Define. + (struct aout_link_includes_entry): Define. + (aout_link_includes_lookup): Define macro. + (struct aout_final_link_info): Add includes field. + (aout_link_includes_newfunc): New static function. + (NAME(aout,final_link)): Initialize includes hash table. + (aout_link_write_symbols): Eliminate duplicate N_BINCL entries. + +Wed Dec 13 10:52:14 1995 Stan Shebs + + * mpw-config.in: Match on mips-*-* instead of mips-idt-ecoff. + +Wed Dec 13 11:07:45 1995 Kim Knuttila + + * coff-ppc.c (coff_ppc_relocate_section): removed debugging code. + +Tue Dec 12 17:42:06 1995 Kim Knuttila + + * peicode.h (pe_print_reloc): New function to dump the .reloc section. + (pe_print_private_bfd_data): call pe_print_reloc. + * coffcode.h (coff_set_alignment_hook): .reloc section alignment. + * coff-ppc.c (in_reloc_p): Added missing non-eligible relocs. Spiffed + up some debugging as well. + +Tue Dec 12 11:34:23 1995 Ian Lance Taylor + + * config.bfd: Handle sparc-*-elf*. From Ronald F. Guilmette + . + +Fri Dec 8 17:47:07 1995 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Set section_count to 0 + when setting sections to NULL. + +Wed Dec 6 17:05:37 1995 Ian Lance Taylor + + * xcofflink.c (struct xcoff_loader_info): Add export_defineds + field. + (bfd_xcoff_size_dynamic_sections): Add export_defineds parameter. + (xcoff_build_ldsyms): If export_defineds is set, set XCOFF_EXPORT + for all symbols. + * bfd-in.h (bfd_xcoff_size_dynamic_sections): Update declaration. + * bfd-in2.h: Rebuild. + +Mon Dec 4 16:40:47 1995 Kim Knuttila + + * coffcode.h (coff_set_alignment_hook): Removed some debugging printf's + +Mon Dec 4 11:25:39 1995 Ian Lance Taylor + + * ihex.c (ihex_scan): Handle record types 4 and 5. + (ihex_object_p): Permit types 4 and 5. + (ihex_set_section_contents): Remove check for out of range + addresses. + (ihex_write_object_contents): Generate types 4 and 5. + + * elflink.h (elf_link_output_extsym): Just ignore warning and + indirect references to symbols which don't really exist. + +Sun Dec 3 19:00:27 1995 Kim Knuttila + + * peicode.h (pe_print_idata): Minor format fixes + (pe_print_edata): New function. Under private printing, this formats + the edata section of a PE file. + (pe_print_private_bfd_data): Added call to pe_print_edata. + +Sun Dec 3 16:46:54 1995 Richard Earnshaw (rearnsha@armltd.co.uk) + + * aout-arm.c (MY_swap_std_reloc_out): Use KEEPIT to get the symbol + index, don't call stoi. + +Fri Dec 1 14:46:51 1995 Ian Lance Taylor + + * srec.c (srec_scan): Set lma as well as vma. + + * ihex.c: New file; support for Intel Hex format. + * targets.c (enum bfd_flavour): Add bfd_target_ihex_flavour. + (ihex_vec): Declare. + (bfd_target_vector): Always include ihex_vec. + * bfd.c (struct _bfd): Add ihex_data field to tdata union. + * Makefile.in: Rebuild dependencies. + (BFD_LIBS): Add ihex.o + (BFD_LIBS_CFILES): Add ihex.c. + * bfd-in2.h: Rebuild. + + * elf.c (assign_file_positions_for_segments): Sort the sections in + each segment. + (get_program_header_size): Return the right size if segment_map is + not NULL. + (copy_private_bfd_data): Don't bother to sort the sections. + + * bfd.c (bfd_record_phdr): New function. + * bfd-in.h (bfd_record_phdr): Declare. + * bfd-in2.h: Rebuild. + + * elf32-sparc.c (elf32_sparc_relocate_section): Remove bogus + BFD_ASSERT. + + * libbfd.c (bfd_malloc, bfd_realloc): New functions. + (bfd_zmalloc): Return PTR, not char *. Take size_t, not + bfd_size_type. + * libbfd-in.h (bfd_malloc, bfd_realloc): Declare. + (bfd_zmalloc): Change declaration. + * libbfd.h: Rebuild. + * Many files: Use bfd_malloc and bfd_realloc rather than malloc + and realloc. Don't set bfd_error_no_memory if they fail. + +Thu Nov 30 19:32:26 1995 Kim Knuttila + + * coff-ppc.c: Added macros to tidy up toc cell treatment. Numerous + uses as well. Added a new howto to deal with TOCREL16 relocs that + are TOCDEFN as well. + (coff_ppc_relocate_section): Expanded treatment of ADDR32NB relocs + to handle RVA relocs from dlltool. + (ppc_coff_rtype2howto): TOCDEFN reloc addition. + (coff_ppc_rtype_to_howto): TOCDEFN reloc addition. + (ppc_coff_reloc_type_lookup): TOCDEFN reloc addition. + + * coffcode.h (coff_set_alignment_hook): check idata$X sections + to get the right section alignment. + +Thu Nov 30 16:48:18 1995 Ian Lance Taylor + + * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on + p_paddr if p_paddr is zero. + (make_mapping): Set includes_filehdr and includes_phdrs for first + PT_LOAD segment. + (map_sections_to_segments): Set includes_phdrs for PT_PHDR + segment. + (assign_file_positions_for_segments): Handle includes_filehdr and + includes_phdrs. Remove special handling of PT_PHDR and first + PT_LOAD segments. + (copy_private_bfd_data): Set includes_filehdr and includes_phdr + when appropriate. Remove special handling of PT_PHDR segment. + Use a more complex condition for when a section is included in a + segment to handle Solaris linker oddities. + +Thu Nov 30 11:17:33 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 + + * coff-m88k.c (howto_table): Reformatted for easier reading; + special_function now points to new function m88k_special_reloc. + (howto_hvrt16): Function previously used for handling HVRT16 relocs + removed. + (rtype2howto): Do not add reloc's r_offset to the addend, this will + be done correctly by m88k_special_reloc. + (reloc_processing): New function to be used by RELOC_PROCESSING. + (RELOC_PROCESSING): Define to call reloc_processing. + +Wed Nov 29 12:42:36 1995 Ian Lance Taylor + + * peicode.h (pe_print_idata): Call malloc rather than xmalloc. + (pe_print_pdata): Likewise. + + * opncls.c (bfd_alloc_by_size_t): Set bfd_error_no_memory if + obstack_alloc fails. + (bfd_alloc_finish): Set bfd_error_no_memory if obstack_finish + fails. + * libbfd.c (bfd_zmalloc): Set bfd_error_no_memory if malloc fails. + * Many files: don't set bfd_error_no_memory if one of the above + routines fails. + + * elf.c (assign_file_positions_for_segments): Don't adjust p_paddr + if p_paddr_valid is set. + (copy_private_bfd_data): New static function. + (_bfd_elf_copy_private_section_data): Call copy_private_bfd_data. + + * elf.c (assign_file_positions_for_segments): Fix case where extra + program headers were allocated. + + * elf.c (_bfd_elf_print_private_bfd_data): New function. + * elf-bfd.h (_bfd_elf_print_private_bfd_data): Declare. + * elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): Define to + _bfd_elf_print_private_bfd_data. + + * coff-alpha.c (alpha_ecoff_swap_reloc_in): Don't abort if + r_symndx is RELOC_SECTION_NONE for an ALPHA_R_IGNORE reloc. + Change a RELOC_SECTION_LITA symndx to RELOC_SECTION_ABS. + (alpha_ecoff_swap_reloc_out): Change RELOC_SECTION_ABS to + RELOC_SECTION_LITA for ALPHA_R_IGNORE. + (alpha_adjust_reloc_out): For ALPHA_R_IGNORE, don't change + RELOC_SECTION_ABS to RELOC_SECTION_NONE. + +Tue Nov 28 16:59:50 1995 Ian Lance Taylor + + * elf-bfd.h (struct elf_obj_tdata): Add segment_map field. + * elf.c (make_mapping): New static function. + (map_sections_to_segments): New static function. + (elf_sort_sections): New static function. + (assign_file_positions_for_segments): New static function. + (map_program_segments): Remove. + (get_program_header_size): Remove sorted_hdrs, count, and + maxpagesize parameters. Simplify. + (assign_file_positions_except_relocs): When generating an + executable, use assign_file_positions_for_segments. + (elf_sort_hdrs): Remove. + (_bfd_elf_sizeof_headers): Remove eliminated parameters from call + to get_program_header_size. + +Mon Nov 27 12:27:46 1995 Ian Lance Taylor + + * hp300hpux.c (MY(callback)): Set lma as well as vma. + + * configure, config.in: Regenerate with autoconf 2.7. + + * elf32-i386.c (elf_backend_plt_readonly): Set correctly, to 1. + * elf32-sparc.c (elf_backend_plt_readonly): Set correctly, to 0. + +Wed Nov 22 12:02:09 1995 Ian Lance Taylor + + * ecoff.c (_bfd_ecoff_new_section_hook): Handle .rconst section. + (ecoff_sec_to_styp_flags): Likewise. + (_bfd_ecoff_styp_to_sec_flags): Handle STYP_RCONST. + (ecoff_set_symbol_info): Handle scRConst. + (ecoff_slurp_reloc_table): Handle RELOC_SECTION_RCONST. + (ecoff_compute_section_file_positions): Handle .rconst section. + (_bfd_ecoff_write_object_contents): Likewise. + (ecoff_link_check_archive_element): Handle scRConst. + (ecoff_link_add_externals): Likewise. + (ecoff_link_write_external): Handle .rconst section. + (ecoff_reloc_link_order): Likewise. + * ecofflink.c (bfd_ecoff_debug_accumulate): Handle scRConst. + * coff-alpha.c (alpha_convert_external_reloc): Handle .rconst + section. + (alpha_relocate_section): Handle RELOC_SECTION_RCONST. + + * sunos.c (sunos_scan_dynamic_symbol): Only set written if the + DEF_DYNAMIC flag is set. + +Tue Nov 21 13:25:29 1995 Ken Raeburn + + * host-aout.c: If TRAD_HEADER is defined, include it. + +Tue Nov 21 13:03:57 1995 Ian Lance Taylor + + * aclocal.m4 (AC_PROG_CC): Remove local definition. + (BFD_BINARY_FOPEN): Require AC_CANONICAL_SYSTEM. + (BFD_NEED_DECLARATION): New function. + * configure.in: Use BFD_NEED_DECLARATION. + * acconfig.h: Put NEED_DECLARATION_* in @TOP@ section. + * configure, config.in: Rebuild with autoconf 2.6. + + * xcofflink.c (bfd_xcoff_size_dynamic_sections): Clear + special_sections before returning when called with a non XCOFF + BFD. + + * coffgen.c (coff_renumber_symbols): Sort common symbols with + global symbols. + + * coffcode.h (coff_compute_section_file_positions): Only pad the + previous section to force file alignment when creating an + executable. + +Mon Nov 20 14:54:09 1995 Ian Lance Taylor + + * coffcode.h (coff_compute_section_file_positions): If + RS6000COFF_C, set up the .debug section. + + * xcofflink.c (xcoff_link_input_bfd): Adjust the TOC anchor value + if it is not large enough to accomodate the entire TOC area with + signed 16 bit offsets. + (xcoff_write_global_symbol): Handle negative TOC offsets in global + linkage code. + (_bfd_ppc_xcoff_relocate_section): Adjust relocations against a + TOC anchor to use the TOC value used in the output file. + +Sat Nov 18 18:01:41 1995 Ian Lance Taylor + + * coffgen.c (_bfd_coff_get_external_symbols): Cast malloc return. + (_bfd_coff_read_string_table): Likewise. + +Sat Nov 18 19:43:04 1995 Richard Earnshaw (rearnsha@armltd.co.uk) + + * pe-arm.c: Fix typos. + * coff-arm.c: Likewise. + +Fri Nov 17 16:22:04 1995 Kim Knuttila + + * coff-ppc.c (list_ele): Added "cat"egory member. + (record_toc): New category parameter (priv or pub). + (ppc_record_toc_entry): Check to see if toc bounds exceeded. + (ppc_process_before_allocation): Removed embrionic data-in-toc from + the mainline. It addes extra toc cells in error. + (ppc_coff_swap_sym_in_hook): Added some documentation. + (dump_toc): Can now diagnose "virtual toc" chicanery. + +Fri Nov 17 10:41:25 1995 Philippe De Muyter + + * elf-bfd.h (struct elf_link_hash_table): Change type of + dynsymcount and bucketcount fields from size_t to bfd_size_type. + +Fri Nov 17 10:02:58 1995 Ian Lance Taylor + + * coffcode.h (coff_pointerize_aux_hook): I960 version: don't + pointerize C_LEAFSTAT or C_LEAFEXT entries. + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Only create + DT_INIT and DT_FINI entries if the _init or _fini symbol is + defined or mentioned in a regular file. + +Thu Nov 16 15:16:42 1995 Kim Knuttila + + * coff-ppc.c (ppc_record_data_in_toc_entry): new function + (coff_ppc_relocate_section): Handle TOCDEFN attribute + (coff_ppc_relocate_section): Correct REL24 handling + (ppc_process_before_allocation): Correct TOCDEFN handling + + * peicode.h (dir_names): Added name descriptions + +Thu Nov 16 03:38:03 1995 Ken Raeburn + + * VERSION: Updated to cygnus-2.6. + +Wed Nov 15 19:30:07 1995 Ken Raeburn + + * targets.c (m68k4knetbsd_vec): Declare. + +Wed Nov 15 18:05:52 1995 Ian Lance Taylor + + * targets.c (bfd_target): Change type of second argument to + _bfd_print_private_bfd_data from void * to PTR. + * libbfd-in.h (_bfd_generic_bfd_print_private_bfd_data): Cast + using PTR rather than void *. + * bfd-in2.h, libbfd.h: Rebuild. + * peicode.h (pe_print_private_bfd_data): Change vfile from void * + to PTR. + * elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): Define as + _bfd_generic_bfd_print_private_bfd_data rather than casting + bfd_true. + +Wed Nov 15 04:09:14 1995 Ken Raeburn + + * Makefile.in (.dep1): Fix stupid typo in last change. Remove any + "DO NOT DELETE" lines or blank lines that mkdep writes on some + systems. + (BFD_LIBS_CFILES, ALL_MACHINES_CFILES, BFD32_BACKENDS_CFILES, + BFD64_BACKENDS_CFILES): New variables. + (CFILES): Use them. + +Tue Nov 14 11:52:23 1995 Ian Lance Taylor + + * peicode.h (coff_swap_aouthdr_out): For PPC PE, start isize at 0, + not at the file position of the first section. + * coffcode.h (coff_compute_section_file_positions): Avoid using + unportable #elif. + (coff_write_object_contents): When generating a PPC PE executable + with no symbols, round up the file size to a COFF_PAGE_SIZE + boundary. + * cofflink.c (_bfd_coff_final_link): If there are no symbols, + don't write out a string table. + + * elf.c (bfd_section_from_shdr): When using a different section + header, pass the new one to _bfd_elf_make_section_from_shdr. + (elf_fake_sections): Don't set sh_info and sh_entsize fields. + (elf_map_symbols): Add section VMA to symbol value when comparing + against 0. + (_bfd_elf_compute_section_file_positions): Only build symbol table + if there are some symbols. Set file offset of symtab and strtab + sections. + (assign_file_positions_except_relocs): Remove dosyms parameter. + Change all callers. Never set file offset of symtab and strtab + sections. + (_bfd_elf_copy_private_section_data): New function. + (MAP_ONESYMTAB, MAP_DYNSYMTAB, MAP_STRTAB, MAP_SHSTRTAB): Define. + (_bfd_elf_copy_private_symbol_data): New function. + (swap_out_syms): Check for special mapping of st_shndx created by + copy_private_symbol_data. + * elfxx-target.h: Use new copy routines. + * elf-bfd.h (_bfd_elf_copy_private_symbol_data): Declare. + (_bfd_elf_copy_private_section_data): Declare. + + * config.bfd (sh-*-*): Set targ_defvec to shcoff_vec. + + * coffcode.h (coff_slurp_symbol_table): If COFF_WITH_PE, handle + C_NT_WEAK. + + * coff-sh.c (shlcoff_vec): Use _bfd_generic_archive_p, not + _bfd_dummy_target, matching the recent change to archive + recognition. + +Mon Nov 13 13:24:38 1995 Ian Lance Taylor + + * libbfd.c (bfd_get_file_window): Use casts to avoid doing + arithmetic on PTR types. + + * aout-target.h (MY(callback)): Set the lma of the sections. + + * ecoff.c (ecoff_reloc_link_order): Turn a reloc against a defined + symbol into a reloc against the section. + +Mon Nov 13 07:31:35 1995 Kim Knuttila + + * coff-ppc.c (ppc_coff_link_hash_entry): added support for inline + glue for the relocs: IMGLUE and IFGLUE. + (record_toc): new function - tracks toc contents + (ppc_mark_symbol_as_glue): new function - supports the IMGLUE reloc + (coff_ppc_relocate_section): Added support and fixes for IMGLUE/IFGLUE + (ppc_coff_rtype2howto): removed invalid IMGLUE hack + (coff_ppc_rtype_to_howto): removed invalid IMGLUE hack + (ppc_record_toc_entry): Removed a debug define (duh) + + * peicode.h (coff_swap_scnhdr_out): Fixed invalid strcmp for ".reldata" + (pe_print_idata): New function - formats the idata section data + (pe_print_pdata): New function - formats the pdata section data + (pe_print_private_bfd_data): calls to above + +Sun Nov 12 12:23:24 1995 Stan Shebs + + * Makefile.in (bfd_libs_here, etc): Provide empty definitions. + * coff-rs6000.c (rs6000coff_vec): Add conditional defines + TARGET_SYM and TARGET_NAME for vector and BFD name. + * coff-pmac.c (pmac_xcoff_vec): Remove. + (TARGET_SYM, TARGET_NAME): Define. + * coffcode.h (coff_set_arch_mach_hook) [POWERMAC]: Set the + machine to 0, not all PowerMacs are 601s. + +Fri Nov 10 12:10:14 1995 Ian Lance Taylor + + * elfcode.h (elf_object_p): Read in any program headers. + * elf.c (_bfd_elf_make_section_from_shdr): Adjust section lma + based on the program headers, if any. + (elf_fake_sections): Set sh_addr from the vma, not the lma. + (map_program_segments): Set p_paddr of program headers based on + the lma. + +Thu Nov 9 13:01:31 1995 Ian Lance Taylor + + * archive.c (bfd_generic_archive_p): Preserve tdata in case of + failure. + + * aoutx.h (NAME(aout,final_link)): Report a reasonable error when + trying to do a relocateable link with a non-a.out object file. + + * archive.c (bfd_generic_archive_p): Check the first object file + in an archive even if target_defaulted is set. If the object file + has the wrong xvec, reject it. + + * aoutx.h (NAME(aout,set_section_contents)): If a section can not + be represented, report the name via _bfd_error_handler. + (translate_to_native_sym_flags): Likewise. + * elf32-mips.c (mips_elf_final_link): Likewise. + * oasys.c (oasys_write_sections): Likewise. + + * coffcode.h (coff_set_alignment_hook): Write RS6000COFF_C version + which checks for STYP_OVRFLO sections. + (coff_compute_section_file_positions): If RS6000COFF_C, handle + reloc and lineno count overflows. + (coff_write_object_contents): Call coff_count_linenumbers before + coff_compute_section_file_positions. If RS6000COFF_C, handle + reloc and lineno count overflows. + * xcofflink.c (_bfd_xcoff_bfd_final_link): Count line numbers and + relocs before dealing with .pad sections. Count overflow section + headers when handling .pad sections. + + * coffcode.h (coff_write_object_contents): Set a.out vstamp to 1 + if RS6000COFF_C. + + * xcofflink.c (XCOFF_DESCRIPTOR): Define. + (struct xcoff_link_hash_table): Add descriptor_section and + special_sections fields. + (_bfd_xcoff_bfd_link_hash_table_create): Initialize new fields. + (xcoff_link_add_symbols): Set linkage section alignment. Create + descriptor section. Check for magic symbol names (_text, etc.), + and record them in special_sections if found. Set + XCOFF_DESCRIPTOR flag for a function descriptor, and set its + descriptor field to point back to the function code symbol. + (xcoff_sweep): Always mark the special descriptor_section. + (bfd_xcoff_export_symbol): Check whether the symbol might be a + function descriptor, and mark it if it is. + (bfd_xcoff_size_dynamic_sections): Add new special_sections + parameter, and fill it in. Allocate space for the descriptor + section. + (xcoff_build_ldsyms): Set XCOFF_DEF_REGULAR flag when defining + global linkage code. If an undefined function descriptor is + exported, arrange to define it. Warn about any other undefined + exported symbol. + (_bfd_xcoff_bfd_final_link): Write out the descriptor section. + (xcoff_write_global_symbol): Create a function descriptor when + necessary. + * bfd-in.h (bfd_xcoff_size_dynamic_sections): Update declaration. + * bfd-in2.h: Rebuild. + +Thu Nov 9 08:40:23 1995 Kim Knuttila + + * coff-ppc.c (ppc_coff_link_hash_entry): new types for hashing + (ppc_coff_link_hash_table): new types for hashing + (ppc_coff_link_hash_newfunc): hash entry constructor + (ppc_coff_link_hash_table_init): hash table initializer + (ppc_coff_link_hash_table_create): hash table constructor + (ppc_record_toc_entry): changed references to hash table + (coff_ppc_relocate_section): changed references to hash table + + * libcoff-in.h (coff_link_hash_entry): removed toc_offset + * libcoff.h: Rebuild + + * cofflink.c (_bfd_coff_link_hash_newfunc): removed toc_offset init + (coff_link_add_symbols): removed toc_offset init + +Thu Nov 9 04:00:38 1995 Ken Raeburn + + * Makefile.in (.dep1): Make sure the file mkdep is to write exists + first. + + * configure.in: Added new option --with[out]-mmap. Set USE_MMAP + if it is given and mmep is available. + * acconfig.h: Undef USE_MMAP. + * configure, config.in: Regenerated. + * aoutx.h: If USE_MMAP is not defined, do all symbol and string + table handling the old way. + (aout_get_external_symbols): Don't complain if last byte of string + table is nonzero. + * libbfd.c [HAVE_MADVISE]: Include sys/types.h and sys/mman.h. + (bfd_free_window) [! USE_MMAP]: Don't define. + (bfd_get_file_window, + _bfd_generic_get_section_contents_in_window) [! USE_MMAP]: Abort. + +Wed Nov 8 20:03:44 1995 Eric Freudenthal + + * coff-a29k.c (SIGN_EXTEND_HWORD): Use ~0xffff rather than + 0xffff0000. + +Wed Nov 8 11:31:11 1995 Ian Lance Taylor + + * coff-a29k.c (a29k_reloc): Change handling of R_IREL reloc to be + compatible with AMD generated COFF files. Try to support both AMD + and GNU formats simultaneously. + (coff_a29k_relocate_section): Likewise. + + * libbfd.c (bfd_get_file_window): Change writable parameter from + int to boolean; update all callers. Pass MAP_SHARED if not + writable--it's required on Solaris. Cast fprintf argument to + avoid warning. + * bfd-in.h (bfd_get_file_window): Update declaration. + * bfd-in2.h: Rebuild. + * aoutx.h: Update calls to bfd_get_file_window. + + * xcofflink.c (XCOFF_DEF_DYNAMIC): Rename from XCOFF_REF_DYNAMIC. + Change all uses. + (xcoff_swap_ldhdr_in): New static function. + (xcoff_swap_ldsym_in): New static function. + (xcoff_find_reloc): Handle the case of a single reloc correctly. + (xcoff_link_add_symbols): If we just created a descriptor, pass it + to _bfd_generic_link_add_one_symbol, to save a hash lookup. + Handle XTY_ER/XMC_XO symbols correctly. + (xcoff_link_add_dynamic_symbols): Rewrite to read .loader symbols + rather than normal symbol table. + (bfd_xcoff_import_symbol): It's not an error if the symbol is + already defined with the same absolute value. + (xcoff_mark): When considering called symbols, check whether the + descriptor is from a dynamic object, rather than the symbol + itself. + (xcoff_build_ldsyms): Likewise. + + * libbfd.c (bfd_get_file_window): Change return type to boolean. + Cast realloc and malloc return values. If malloc or realloc fail, + set bfd_error_no_memory. + * bfd-in.h (bfd_get_file_window): Change type to boolean. + * bfd-in2.h: Rebuild. + +Tue Nov 7 11:53:48 1995 Kim Knuttila + + * coff-ppc.c (ppc_record_toc_entry): new function. + (in_reloc_p): changed return value. + (coff_ppc_relocate_section): much rework. + (ppc_allocate_toc_section): new function. + (ppc_process_before_allocation): new function. + (ppc_coff_swap_sym_in_hook): new function. + + * cofflink.c (_bfd_coff_link_hash_newfunc): initialize toc_offset. + (coff_link_add_symbols): initialize toc_offset. + + * peicode.h (coff_swap_sym_in): Added coff_swap_sym_in_hook + (coff_swap_aouthdr_out): Added more sections to the data + dictionary for the pe file header. Also changed linker version + number on the ppc side. + (dir_names): small improvements to the dictionary printing. + (pe_mkobject_hook): save the file level flags. + + * libcoff-in.h (coff_link_hash_entry): added toc_offset field + (pe_tdata): added real_flags field + (coff_tdata): added local_toc_sym_map and access macro + + * libcoff.h (coff_link_hash_entry): added toc_offset field + (pe_tdata): added real_flags field + (coff_tdata): added local_toc_sym_map and access macro + + * coffcode.h (coff_set_alignment_hook): added hook for PE. + (coff_mkobject): init for local_toc_sym_map + (coff_write_object_contents): set the internal_a.magic to + IMAGE_NT_OPTIONAL_HDR_MAGIC which appears to be what other + ppc compilers use. + +Tue Nov 7 13:48:58 1995 Ian Lance Taylor + + * ecofflink.c (_bfd_ecoff_locate_line): Keep looking through stabs + entries until both the line number address and the function name + address are too large. + + * configure.in: Call AC_CHECK_PROG to find and cache AR. + * configure: Rebuilt. + + * aclocal.m4 (BFD_CC_FOR_BUILD): Don't define CC_FOR_BUILD if it + is defined in the environment. + +Tue Nov 7 10:57:24 1995 Jeffrey A Law (law@cygnus.com) + + * som.c (som_get_section_contents_in_window): Define to use + generic version. + +Mon Nov 6 17:13:15 1995 Harry Dolan + + * coff-i860.c: New file, based on coff-i386.c. + * cpu-i860.c: New file, based on cpu-i386.c. + * hosts/i860mach3.h: New file, based on hosts/i386mach3.h. + * config.bfd (i860-*-mach3*, i860-*-osf1*, i860-*-coff*): New + targets, using i860coff_vec. + * configure.in (i860-*-mach3*, i860-*-osf1*): New hosts, using + trad-core.o and hosts/i860mach3.h. + (i860coff_vec): Use coff-i860.o and cofflink.o. + * configure: Rebuild. + * Makefile.in: Rebuild dependencies. + (ALL_MACHINES): Add cpu-i860.o. + (BFD32_BACKENDS): Add coff-i860.o. + (CFILES): Add cpu-i860.c and coff-i860.c. + * targets.c (i860coff_vec): Declare. + (bfd_target_vector): Add &i860coff_vec. + * archures.c (bfd_i860_arch): Declare. + (bfd_archures_list): Add &bfd_i860_arch. + * coffcode.h (coff_set_arch_mach_hook): Handle I860 magic number. + (coff_set_flags): Handle bfd_arch_i860. + (coff_write_object_contents): Handle I860 a.out magic number. + +Mon Nov 6 14:34:07 1995 Ian Lance Taylor + + * xcofflink.c (xcoff_link_add_symbols): Set the alignment power of + the created .tc section to 2. + (xcoff_mark): Don't keep a .loader reloc for a call to an + undefined symbol when creating a shared library. + (xcoff_build_ldsyms): When creating a shared library, generate + global linkage code for a call to an undefined symbol. + +Sun Nov 5 21:44:13 1995 Ken Raeburn + + * Makefile.in (CFILES): Rebuild list from BFD_LIBS, ALL_MACHINES, + BFD32_BACKENDS, BFD64_BACKENDS. + (.dep1): Put mkdep output in a separate file. + Rebuilt dependencies. + + * ecoff.c (_bfd_ecoff_slurp_armap): Cast _bfd_read_ar_hdr return + value. + + Permit use of mmap when available: + + * configure.in: Check for mmap, madvise, mprotect. + * config.in, configure: Regenerated. + + * libbfd.c (struct _bfd_window_internal): Define type. + (bfd_init_window, bfd_free_window, bfd_get_file_window): New + functions. + (ok_to_map): New static variable for debugging. + (_bfd_generic_get_section_contents_in_window): New function. + * bfd-in.h (bfd_window_internal): Declare type. + (bfd_window): Define type. + (bfd_init_window, bfd_free_window, bfd_get_file_window): Declare. + * libbfd-in.h (_bfd_generic_get_section_contents_in_window): + Declare. + + * libaout.h (struct aoutdata): Add two window fields. + (obj_aout_sym_window, obj_aout_string_window): New macros. + * aoutx.h (some_aout_object_p): Initialize windows. + (aout_get_external_symbols): Get symbol data and strings in + windows instead of explicitly allocated buffers. + (slurp_symbol_table): Free window instead of memory. + (bfd_free_cached_info): Release windows instead of freeing storage + directly. + (aout_link_free_symbols): Ditto. + + * targets.c (bfd_target): Add new field for + get_section_contents_in_window. + (BFD_JUMP_TABLE_GENERIC): Updated. + * aout-adobe.c, aout-target.h, binary.c, bout.c, coff-alpha.c, + coff-mips.c, elfxx-target.h, i386msdos.c, i386os9k.c, ieee.c, + libcoff-in.h, oasys.c, srec.c, tekhex.c, versados.c: Added new + macros for get_section_contents_in_window field. + +Sat Nov 4 12:23:26 1995 Fred Fish + + * core.c: Renamed to corefile.c + * makefile.dos (OBJS): Change core.o to corefile.o + * Makefile.in (CFILES, BFD_LIBS): Use corefile.c instead of core.c + +Fri Nov 3 15:54:59 1995 Ian Lance Taylor + + * xcofflink.c (xcoff_link_add_symbols): Rename local variable sub + to o. Clobber and restore the list of new csects around the call + to _bfd_generic_link_add_one_symbol, in case it wants to report a + linker error and the linker wants to read the symbol table. Reset + the line number count of a real section even if it has no relocs. + (_bfd_xcoff_bfd_final_link): If shared, set the DYNAMIC flag. + + * coffgen.c (_bfd_coff_read_string_table): Warn if the string size + is too small. + +Thu Nov 2 23:16:39 1995 Ian Lance Taylor + + * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Don't warn about + an undefined symbol in a shared link. + + * linker.c (_bfd_generic_link_add_one_symbol): Correct type of + oldtype from bfd_link_order_type to bfd_link_hash_type. From + phdm@info.ucl.ac.be (Philippe De Muyter). + +Wed Nov 1 14:26:02 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 + + * coff-m88k.c (rtype2howto): New static function. + (RTYPE2HOWTO): Use it rather than a macro definition. + + * coffcode.h (coff_write_object_contents): set internal_a.magic + to PAGEMAGICPEXECPAGED #if defined (M68) && !defined (LYNXOS). + + * configure.in: m68*-motorola-sysv* does not use ptrace-core.o; + define TRAD_HEADER to new file hosts/delta68.h. + m88*-motorola-sysv*, however, does use ptrace-core.o. + * hosts/delta68.h: New file. + + * ptrace-core.c (ptrace_unix_core_file_p): change bfd_zmalloc to + bfd_zalloc; provide proper parm abfd to calls to bfd_zalloc. + +Wed Nov 1 13:51:54 1995 Ken Raeburn + + * i386linux.c (MY(vec)): Declare before use. + +Wed Nov 1 11:45:07 1995 Ian Lance Taylor + + * reloc16.c (bfd_coff_reloc16_get_relocated_section_contents): + Pass input_bfd, not in_bfd, to bfd_coff_reloc16_extra_cases. + + * elf.c (bfd_elf_set_dt_needed_name): Don't do anything if the + BFD is not of the right type. + (bfd_elf_get_needed_list): Likewise. + * i386linux.c (bfd_linux_size_dynamic_sections): Likewise. + * sunos.c (bfd_sunos_get_needed_list): Likewise. + * xcofflink.c (XCOFF_XVECP): Define. + (bfd_xcoff_link_record_set): Don't do anything if the BFD is not + of the right type. + (bfd_xcoff_import_symbol): Likewise. + (bfd_xcoff_export_symbol): Likewise. + (bfd_xcoff_link_count_reloc): Likewise. + (bfd_xcoff_record_link_assignment): Likewise. + (bfd_xcoff_size_dynamic_sections): Likewise. + + * sunos.c (sunos_scan_ext_relocs): Only check the reloc symbol + table index against the number of symbols for a base relative + reloc. + + * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Change from macro to + static function. + * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Set + full_aouthdr flag here... + (_bfd_xcoff_bfd_final_link): ...not here. + +Tue Oct 31 12:52:02 1995 Fred Fish + + * libelf.h: Rename to elf-bfd.h to avoid conflict with + systems that have a system . + * Makefile.in: Globally replace libelf.h with elf-bfd.h. + * bfd.c, elf.c, elf32-arc.c, elf32-gen.c, elf32-hppa.c, + elf32-hppa.h, elf32-i386.c, elf32-i860.c, elf32-m68k.c, + elf32-m88k.c, elf32-mips.c, elf32-ppc.c, elf32-sparc.c, + elf64-gen.c, elf64-sparc.c, elfcode.h, elflink.c, + elfxx-target.h: Include elf-bfd.h rather than libelf.h. + * elfxx-target.h: Change libelf.h reference to elf-bfd.h. + +Tue Oct 31 15:30:07 1995 David Mosberger-Tang + + * ecoff.c (ecoff_set_symbol_info): Add new parameter weak. If + set, set BSF_WEAK in symbol. Change all callers. + (ecoff_get_extr): Set weakext based on BSF_WEAK. + (ecoff_link_add_externals): If weakext is set, pass BSF_WEAK to + _bfd_generic_link_add_one_symbol. + (ecoff_indirect_link_order): Check that the section tdata relocs + are not NULL before using them. + + * configure.in (alpha*-*-linux*): Set COREFILE to trad-core.o and + define TRAD_HEADER as hosts/alphalinux.h. + * configure: Rebuild. + * hosts/alphalinux.h: New file. + * trad-core.c (trad_unix_core_file_p): Cast u.u_ar0 to bfd_vma, + not int. + +Tue Oct 31 12:34:11 1995 Ian Lance Taylor + + * coffcode.h (coff_slurp_symbol_table): Accept C_BCOMM and + C_ECOMM storage classes. + + * xcofflink.c (xcoff_mark_symbol): New static function, broken out + of xcoff_mark. + (xcoff_mark): Call xcoff_mark_symbol. + (bfd_xcoff_export_symbol): Call xcoff_mark_symbol. + (bfd_xcoff_link_count_reloc): Call xcoff_mark_symbol rather than + doing it by hand. + (xcoff_build_ldsyms): Build a .loader symbol for an export symbol. + +Mon Oct 30 14:53:48 1995 Ian Lance Taylor + + * xcofflink.c (struct xcoff_final_link_info): Add new line_filepos + field. + (xcoff_find_reloc): New static function. + (xcoff_link_add_symbols): Use it. + (_bfd_xcoff_bfd_final_link): Set finfo.line_filepos. + (xcoff_link_input_bfd): Handle C_BINCL and C_EINCL. Don't + relocate the value of C_DECL. + + * elf.c (elf_fake_sections): Remove bogus BFD_ASSERT. + +Sat Oct 28 01:25:34 1995 steve chamberlain + + * cofflink.c (_bfd_coff_generic_relocate_section): Make + callback decide what goes in .relocs. + * pe[i]-i386.c (TARGET_UNDERSCORE): Define. + * peicode.h (pe_mkobject_hook): Only copy aouthdr if + there is one. + +Sat Oct 28 01:51:02 1995 Ian Lance Taylor + + * xcofflink.c (xcoff_link_add_symbols): Handle csects in the + absolute section. + +Fri Oct 27 18:14:39 1995 Ian Lance Taylor + + * xcofflink.c: More improvements, mostly to fix handling of + constructors and a few other special cases. + * coff-rs6000.c (rs6000coff_vec): Set symbol_leading_char back to + zero, reverting yesterday's change. + * bfd-in.h (bfd_xcoff_link_record_set): Declare. + (bfd_xcoff_link_count_reloc): Declare. + (bfd_xcoff_record_link_assignment): Declare. + * bfd-in2.h: Rebuild. + +Fri Oct 27 14:42:15 1995 Niklas Hallqvist + + * PORTING, aout-arm.c, aout-encap.c, aout-target.h, + aoutx.h, gen-aout.c, host-aout.c, hp300bsd.c, i386aout.c + i386bsd.c, i386dynix.c, i386linux.c, i386lynx.c, i386mach3.c, + i386netbsd.c, m68klynx.c, m88kmach3.c, mipsbsd.c, newsos3.c, + ns32knetbsd.c, pc532-mach.c, riscix.c, sparclynx.c, sparcnetbsd.c: + Change PAGE_SIZE to TARGET_PAGE_SIZE. + + * m68knetbsd.c: Ditto as well as add support for the m68k4k object + format. + + * netbsd.h: Double ditto (incl. m68k4k support). NetBSD's text + segments includes the a.out header. See to that the magic number + *always* is big-endian. + + * config.bfd: Add m68*-hp*-netbsd* case. Cross-pollinate m68k and + m68k4k NetBSD configurations. + + * configure.in, configure: Separate i386 & mips NetBSD + configurations from other BSD ones. Don't assume DEC is the only + thing NetBSD/mips run on. Add {m68k,ns32k,sparc}-*-netbsd* + configurations. Add support for m68k4k NetBSD object format. + + * libaout.h: Added M_68K4K_NETBSD magic. + + * m68k4knetbsd.c: New file. + + * hosts/{m68k,sparc}nbsd.h: Don't define HOST_BIG_ENDIAN_P. + + * hosts/nbsd.h: Define HOST_BIG_ENDIAN_P according to + . + + * hosts/mipsnbsd.h: New file. + +Thu Oct 26 14:16:47 1995 Ian Lance Taylor + + * xcofflink.c: Numerous changes to get closer to a working XCOFF + linker. + * libcoff-in.h (struct xcoff_tdata): Add full_aouthdr, + toc_section, and entry_section fields. + (struct xcoff_section_tdata): Remove ldrel_count field. + * libcoff.h: Rebuild. + * coffcode.h (coff_mkobject_hook): Initialize new xcoff_data + fields. + (coff_compute_section_file_positions): If RS6000COFF_C, generate + full a.out header if full_aouthdr is set in xcoff_data. + (coff_write_object_contents): Likewise. Set o_snentry and o_sntoc + based on sections stored in xcoff_data. + * coff-rs6000.c (xcoff_copy_private_bfd_data): Copy new xcoff_data + fields. + (xcoff_reloc_type_lookup): Handle BFD_RELOC_CTOR. + (rs6000coff_vec): Set symbol_leading_char to '.'. + * coffgen.c (coff_get_symbol_info): If fix_value is set, fix the + value stored in ret rather than returning a pointer value. + +Wed Oct 25 23:10:39 1995 Michael Meissner + + * config.bfd (powerpc{,le}-{elf,sysv4,eabi,solaris2}): Remove MAC + format for now. + +Wed Oct 25 16:19:27 1995 Jeffrey A Law (law@cygnus.com) + + * som.c (som_slurp_string_table): Allocate the strings with malloc + since they're free'd by free_cached_info. + (som_slurp_symbol_table): Similarly for the symbol table. + +Wed Oct 25 14:59:22 1995 Per Bothner + + * Makefile.in (diststuff): Don't make headers. + +Wed Oct 25 11:32:54 1995 Ian Lance Taylor + + * Makefile.in: Rebuild dependencies. + + * sunos.c (bfd_sunos_record_link_assignment): Don't do anything if + output_bfd is not SunOS. + (bfd_sunos_size_dynamic_sections): Likewise. Don't scan relocs of + non-SunOS input files. + + * xcofflink.c: Extensive changes to support linking shared objects + and generating a .loader section. + * libcoff-in.h (struct xcoff_tdata): Add import_file_id field. + (struct xcoff_section_tdata): Add lineno_count, first_symndx, + last_symndx, and ldrel_count fields. + * libcoff.h: Rebuild. + * coff-rs6000.c (xcoff_howto_table): Correct reloc names. + * coffcode.h (styp_to_sec_flags): Don't set any flags if STYP_PAD + is set. + * bfd-in.h (bfd_xcoff_import_symbol): Declare. + (bfd_xcoff_export_symbol): Declare. + (bfd_xcoff_size_dynamic_sections): Declare. + * bfd-in2.h: Rebuild. + +Tue Oct 24 17:44:20 1995 Stan Shebs + + * configure.in: Add xcofflink.o to pmac_xcoff_vec. + * configure: Rebuild. + * mpw-config.in: Add xcofflink.c.o to powerpc-apple-macos. + * coff-pmac.c: Include coff-rs6000.c instead of duplicating its + contents. + (pmac_xcoff_vec): Update to use new xcoff support. + * coff-rs6000.c (xcoff_generic_stat_arch_elt): Make static. + (xcoff_write_armap): Declare buf as unsigned char. + * xcofflink.c (xcoff_link_add_symbols): Declare a local as PTR. + + * mpw-make.sed: Generalize subdir_do edit. + +Tue Oct 24 10:25:01 1995 Jeffrey A Law (law@cygnus.com) + + * hppabsd-core.c (make_bfd_asection): Initialize asect->filepos + correctly. Don't initialize asect->vma. + +Fri Oct 20 13:23:48 1995 Ken Raeburn + + * opncls.c (_bfd_new_bfd): If _bfd_chunksize wasn't preset, use + something a little less than the page size. + +Thu Oct 19 13:06:09 1995 Ian Lance Taylor + + * coff-i960.c (coff_i960_adjust_symndx): Clear *adjustedp. + +Wed Oct 18 16:20:08 1995 steve chamberlain + + * coff-i386.c (coff_i386_reloc_type_lookup): New. + * coffcode.h (coff_write_object_contents): If .bss is before + .data us that as data_start. + * cofflink.c (_bfd_coff_generic_relocate_section): Get reloc + calc correct. + * peicode.h (add_data_entry): Use _cooked_size of data directory. + (coff_swap_outhdr_out): Hardwire in version number. + +Wed Oct 18 16:50:54 1995 Ken Raeburn + + * sunos.c (sunos_add_dynamic_symbols): Rename local variables + major and minor to *_vno, since the former are also macros in + SunOS header files. Cast result of bfd_alloc to appropriate + type. + + * coffgen.c (coff_find_nearest_line): Cast used_by_bfd value + before assigning to sec_data. + +Wed Oct 18 13:25:17 1995 Ian Lance Taylor + + * ecoff.c (_bfd_ecoff_find_nearest_line): The offset argument is + now relative to the section, not absolute. + * ecofflink.c (_bfd_ecoff_locate_line): Use the right symbol to + get the file name when there is a N_SO directory name. When + handling stabs, remember that section->vma was added to the + offset. + +Tue Oct 17 18:24:54 1995 Ian Lance Taylor + + * sunos.c (struct sunos_link_hash_table): Add needed field. + (sunos_link_hash_table_create): Call bfd_release, not free. + (sunos_link_hash_table_create): Initialize needed field. + (sunos_add_dynamic_symbols): Record needed objects. + (bfd_sunos_get_needed_list): New function. + * bfd-in.h (bfd_sunos_get_needed_list): Declare. + * bfd-in2.h: Rebuild. + +Mon Oct 16 14:43:59 1995 steve chamberlain + + * libcoff-in.h (pe_data_type.in_reloc_p): New. + +Mon Oct 16 10:52:50 1995 Ian Lance Taylor + + * bfd-in.h (struct bfd_link_needed_list): Rename from + bfd_elf_link_needed_list. + * bfd-in2.h: Rebuild. + * elf.c, elflink.h, libelf.h: Corresponding changes. + + Add start at AIX linker support; no shared libraries yet. + * xcofflink.c: New file. + * configure.in (rs600coff_vec): Use xcofflink.o. + * configure: Rebuild. + * libcoff-in.h (struct xcoff_tdata): Add csects and debug_indices + fields. + (struct xcoff_section_tdata): Define. + (xcoff_section_data): Define macro. + (_bfd_xcoff_bfd_link_hash_table_create): Declare. + (_bfd_xcoff_bfd_link_add_symbols): Declare. + (_bfd_xcoff_bfd_final_link): Declare. + (_bfd_ppc_xcoff_relocate_section): Declare. + * libcoff.h: Rebuild. + * coff-rs6000.c: Clean up a bit. + (xcoff_mkobject): Default modtype to 1L, not RE. Initialize + cputype, csects, and debug_indices. + (xcoff_copy_private_bfd_data): Copy cputype. + (xcoff_howto_table): Rename from rs6000coff_howto_table. + (xcoff_rtype2howto): Rename from rs6000coff_rtype2howto. + (xcoff_reloc_type_lookup): Rename from + rs6000coff_reloc_type_lookup. + (coff_relocate_section): Define. + (_bfd_xcoff_sizeof_headers): Define. + (_bfd_xcoff_bfd_get_relocated_section_contents): Define. + (_bfd_xcoff_bfd_relax_section): Define. + (_bfd_xcoff_bfd_link_split_section): Define. + (rs6000coff_vec): For BFD_JUMP_TABLE_LINK, use _bfd_xcoff, not + coff. + * coffcode.h (coff_compute_section_file_positions): If AIX, + increment sofar by SMALL_AOUTSZ if not executable. + (coff_write_object_contents): If AIX, always output an a.out + header; if not executable, header size of SMALL_AOUTSZ. + * hash.c (struct bfd_strtab_hash): Add xcoff field. + (_bfd_stringtab_init): Initialize xcoff field. + (_bfd_xcoff_stringtab_init): New function. + (_bfd_stringtab_add): In XCOFF mode, leave two bytes for length. + (_bfd_stringtab_emit): In XCOFF mode, write out length. + * libbfd-in.h (_bfd_xcoff_stringtab_init): Declare. + * libbfd.h: Rebuild. + * Makefile.in: Rebuild dependencies. + (BFD32_BACKENDS): Add xcofflink.o. + (CFILES): Add xcofflink.c. + + * elf32-mips.c (mips_elf_symbol_processing): Set SEC_ALLOC, not + SEC_NO_FLAGS, for .acommon section. From Peter Schauer + . + +Sat Oct 14 21:36:02 1995 Michael Meissner + + * coff-ppc.c (in_reloc_p): Add, clone from coff-i386.c. + +Fri Oct 13 17:48:43 1995 Ken Raeburn + + * acconfig.h (HAVE_SYS_PROCFS_H): Undef, with comment. + * config.in: Regenerated. + + * opncls.c (getpagesize) [!HAVE_GETPAGESIZE]: Define as 2048. + (_bfd_chunksize): New variable. + (_bfd_new_bfd): Set it to getpagesize() if negative, and use it + for obstack chunk size. + * configure.in: Check for getpagesize. + * configure: Regenerated. + + Mon Sep 25 22:49:32 1995 Andreas Schwab + + * trad-core.c (rawptr): Make it a local variable of + ptrace_unix_core_file_p. + +Fri Oct 13 11:22:01 1995 steve chamberlain + + * coff-arm.c (in_reloc_p): New. + * coff-i386.c (in_reloc_p): New. + * coffcode.h: Allways include peicode.h if COFF_WITH_PE. + (coff_write_object_contents): Only set has_reloc_section + if PE_IMAGE. + * cofflink.c (_bfd_coff_generic_relocate_section): Call + in_reloc_p to decide if reloc should be emitted. + * libcoff.h (pe_data_type.in_reloc_p): New. + * peicode.h (pe_mkobject): Initialize in_reloc_p. + +Wed Oct 11 00:49:29 1995 Ian Lance Taylor + + * cofflink.c (_bfd_coff_internal_syment_name): Move to coffgen.c. + (_bfd_coff_read_internal_relocs): Likewise. + * coffgen.c (_bfd_coff_internal_syment_name): Copy from coffgen.c. + (_bfd_coff_read_internal_relocs): Likewise. + + * elflink.h (elf_link_add_object_symbols): Correct conditions + under which type and size change warnings are issued. + +Tue Oct 10 18:32:46 1995 Ian Lance Taylor + + * coffgen.c (coff_count_linenumbers): Don't count line numbers for + a symbol which is not in a real section. + (coff_write_native_symbol): Corresponding change. + + * cofflink.c (_bfd_coff_link_hash_newfunc): Rename from + coff_link_hash_newfunc and make non-static. + (_bfd_coff_link_hash_table_init): New function, broken out of + _bfd_coff_link_hash_table_create. + (_bfd_coff_link_hash_table_create): Use it. + (process_embedded_commands): Make static. + * libcoff-in.h ((_bfd_coff_link_hash_newfunc): Declare. + (_bfd_coff_link_hash_table_init): Declare. + * libcoff.h: Rebuild. + + * coffcode.h (coff_mkobject_hook): If RS6000COFF_C, set cputype + field in XCOFF tdata. + (coff_set_arch_mach_hook): Check ifdef RS6000COFF_C, not ifdef + U802ROMAGIC, for clarity. Try to set arch and machine correctly + based on cputype stored in a.out header, or in n_type of initial + .file symbol. + (coff_write_object_contents): Set cputype correctly in a.out + header. + (coff_slurp_symbol_table): Add casts to file_ptr to avoid + warnings. + * coffswap.h (coff_swap_aouthdr_in): Swap in cputype field. + (coff_swap_aouthdr_out): Swap out cputype field. Don't clear + old resv1 field. + * libcoff-in.h (struct xcoff_tdata): Add cputype field. + * libcoff.h: Rebuild. + + * cpu-rs6000.c (rs6000_compatible): New static function. + (bfd_rs6000_arch): Use it. + * cpu-powerpc.c (powerpc_compatible): New static function. + (arch_info_struct): Define various flavours of PowerPC. + (bfd_powerpc_arch): Use powerpc_compatible. Point at + arch_info_struct. + +Tue Oct 10 10:50:46 1995 Fred Fish + + * Makefile.in (FLAGS_TO_PASS): Remove BISON. + +Tue Oct 10 01:28:29 1995 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Don't warn about + changing the size or type if the old definition was weak. + +Mon Oct 9 11:24:08 1995 Ian Lance Taylor + + * coffcode.h (combined_entry_type): Add fix_line field. + (coff_slurp_line_table): Warn if we try to set the lineno field of + a symbol twice. + (coff_slurp_symbol_table): If RS6000COFF_C, handle C_BINCL and + C_EINCL by setting fix_line. Fix C_BSTAT symbol value. + * coffgen.c (coff_mangle_symbols): Handle fix_line. + (coff_write_symbol): Only use N_DEBUG if the symbol is in the + absolute section. + (coff_print_symbol): Print fix_value symbols in a useful fashion. + * libcoff.h: Rebuild. + + * libcoff-in.h (struct xcoff_tdata): Define. + (xcoff_data): Define. + * bfd.c (struct _bfd): Add xcoff_obj_data field to tdata union. + * bfd-in2.h, libcoff.h: Rebuild. + * coff-rs6000.c (xcoff_mkobject): New static function. + (coff_mkobject): Define. + (xcoff_copy_private_bfd_data): New static function. + (coff_bfd_copy_private_bfd_data): Define. + (rs6000coff_howto_table): Change R_TOC complain_on_overflow from + signed to bitfield. + (rs6000coff_vec): Add DYNAMIC to object_flags. + * coffcode.h (sec_to_styp_flags): If RS6000COFF_C, handle .pad and + .loader sections specially. + (coff_new_section_hook): If RS6000COFF_C, get the .text and .data + section alignment from the XCOFF tdata information. + (coff_mkobject_hook): If RS6000COFF_C, set DYNAMIC based on + F_SHROBJ, and copy the extra a.out header information into the + XCOFF tdata structure. + (coff_write_object_contents): If RS6000COFF_C, set F_SHROBJ, + F_DYNLOAD and the extra a.out header information. + (coff_slurp_symbol_table): Set BSF_NOT_AT_END for a C_EXT or + C_HIDEXT symbol with attached csect information. + * coffswap.h (coff_swap_aouthdr_in): If RS6000COFF_C, swap + in the o_maxdata field. + (coff_swap_aouthdr_out): If RS6000COFF_C, swap extra XCOFF fields. + * coffgen.c (coff_renumber_symbols): Don't move any symbol to the + end if BSF_NOT_AT_END is set. + + * targets.c (bfd_target): Rename _bfd_read_ar_hdr field to + _bfd_read_ar_hdr_fn. + * libbfd-in.h (_bfd_read_ar_hdr): Update accordingly. + * bfd-in2.h, libbfd.h: Rebuild. + * archive.c (_bfd_get_elt_at_filepos): Cast _bfd_read_ar_hdr + return value. + (do_slurp_bsd_armap, do_slurp_coff_armap): Likewise. + (bfd_slurp_bsd_armap_f2): Likewise. + (_bfd_slurp_extended_name_table): Likewise. + +Fri Oct 6 16:18:35 1995 Ken Raeburn + + Mon Sep 25 22:49:32 1995 Andreas Schwab + + * archive.c (bfd_get_next_mapent): Return BFD_NO_MORE_SYMBOLS + when the symbol table is empty. + + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Don't reserve + space for section symbols, since we don't output them either. + (elf_m68k_adjust_dynindx): Removed. + + * ptrace-core.c (rawptr): Make it a local variable of + ptrace_unix_core_file_p. + +Fri Oct 6 12:24:47 1995 Michael Meissner + + * coff-rs6000.c (xcoff_write_archive_contents): Return false, not + NULL. + + * config.bfd (powerpc{,le}-{elf,sysv4,eabi,solaris2}): Add NT, and + Mac object file formats. + +Fri Oct 6 12:04:02 1995 Ian Lance Taylor + + * coffgen.c (coff_fix_symbol_name): Don't try to set up file + auxent if there isn't one. + (coff_write_symbols): If there is no file auxent, use SYMNMLEN + rather than FILNMLEN as the maximum name length. + + * coffcode.h (bfd_coff_backend_data): Add new field + _bfd_coff_print_aux. + (bfd_coff_print_aux): New static function. + (coff_pointerize_aux_hook (RS6000COFF_C version)): Pointerize the + scnlen field of an XTY_LD csect aux entry. + (coff_print_aux): New static function. + (coff_slurp_symbol_table): Don't pointerize scnlen field; now done + in coff_pointerize_aux_hook. + (bfd_coff_std_swap_table): Initialize new field. + * coffgen.c (coff_print_symbol): Call bfd_coff_print_aux. + * libcoff.h: Rebuild. + * coff-alpha.c (alpha_ecoff_backend_data): Initialize new field. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + + * coffcode.h (coff_write_object_contents): On AIX, clear F_RELFLG + if there are symbols, for native AIX ld compatibility. + + * coffcode.h (bfd_coff_backend_data): Add new field + _bfd_coff_pointerize_aux_hook. + (coff_pointerize_aux_hook): Define as a function if RS6000COFF_C + or I960, and as 0 otherwise. + (bfd_coff_std_swap_table): Initialize new field. + * libcoff.h: Rebuild. + * coffgen.c (coff_pointerize_aux): Change parameters to take + symbol pointer instead of type and class, and to take aux index. + Call _bfd_coff_pointerize_aux_hook if it is defined. + (coff_get_normalized_symtab): Always call coff_pointerize_aux. + * coff-alpha.c (alpha_ecoff_backend_data): Initialize all fields. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + + * coff-rs6000.c: Add full support for AIX archives. Rewrite old + read-only/host-only support. + + * coffcode.h (coff_slurp_symbol_table): Set C_HIDEXT symbols to be + BSF_LOCAL. + (OTHER_GLOBAL_CLASS): Do not define to be C_HIDEXT if + RS6000COFF_C. + + * targets.c (bfd_target): Add _bfd_read_ar_hdr field. Modify + BFD_JUMP_TABLE_ARCHIVE accordingly. + * libbfd-in.h (_bfd_snarf_ar_hdr): Don't declare. + (_bfd_compute_and_write_armap): Declare. + (_bfd_generic_read_ar_hdr): Declare. + (_bfd_read_ar_hdr): Define. + (_bfd_noarchive_read_ar_hdr): Define. + (_bfd_archive_bsd_read_ar_hdr): Define. + (_bfd_archive_coff_read_ar_hdr): Define. + * archive.c: Change all callers of _bfd_snarf_ar_hdr to call + _bfd_read_ar_hdr instead. + (_bfd_generic_read_ar_hdr): Rename from _bfd_snarf_ar_hdr. + (_bfd_compute_and_write_armap): Rename from + compute_and_write_armap. Make non-static. Change all callers. + * ecoff.c (_bfd_ecoff_slurp_armap): Call _bfd_read_ar_hdr rather + than _bfd_snarf_ar_hdr. + * aout-target.h (MY_read_ar_hdr): Define if not defined. + * ieee.c (ieee_read_ar_hdr): Define. + * libecoff.h (_bfd_ecoff_read_ar_hdr): Define. + * oasys.c (oasys_read_ar_hdr): Define. + * som.c (som_read_ar_hdr): Define. + * bfd-in2.h, libbfd.h: Rebuild. + +Thu Oct 5 14:04:07 1995 steve chamberlain + + * peicode.c (coff_swap_filehdr_in): If symptr is + zero, there aren't any symbols, even if nsyms is set. + +Thu Oct 5 11:45:02 1995 Ian Lance Taylor + + * libecoff.h (struct ecoff_backend_data): Add adjust_headers + field. + * ecoff.c (ecoff_sec_to_styp_flags): Check for various Alpha + sections, and set styp correctly for them: .got, .hash, .dynamic, + .liblist, .rel.dyn, .conflic, .dynstr, .dynsym, .comment. + (_bfd_ecoff_styp_to_sec_flags): Check for various Alpha section + types. + (ecoff_sort_hdrs): New static function. + (ecoff_compute_section_file_positions): Return boolean, not void. + Sort the sections by VMA before looking through them. Put the + first non SEC_ALLOC section on a new page. Put every SEC_ALLOC + section on an appropriate boundary within the page. + (ecoff_compute_reloc_file_positions): Check return value of + ecoff_compute_section_file_positions. + (_bfd_ecoff_set_section_contents): Likewise. + (_bfd_ecoff_write_object_contents): Check for various Alpha + section types when incrementing text_size and data_size. Call + adjust_headers backend function if it exists. + * coff-alpha.c (alpha_adjust_headers): New static function. + (alpha_ecoff_backend_data): Initialize adjust_headers field. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + + * hosts/i386bsd.h: Restore file incorrectly deleted on Sep 6. + +Wed Oct 4 18:15:02 1995 Jeff Law (law@hurl.cygnus.com) + + * rs6000-core.c (CORE_VERSION_1): Use CORE_VERSION_1 instead + of ALTERNATE_AIX_CORE_FORMAT. + * configure.in (aix4): No longer need CORE_FLAGS. + * configure: Updated. + +Wed Oct 4 15:36:36 1995 Ken Raeburn + + NS32k changes from Ian Dall: + * aoutx.h (MY_final_link_relocate, MY_relocate_contents): New + macros. + (aout_link_input_section_std, aout_link_input_section_ext, + aout_link_reloc_link_order): Call them instead of _bfd_* + versions. + * aout-target.h (MY_exec_header_not_counted): New macro, defaults + to zero. + (backend_data): Use it instead of hardcoded zero. + + * aout-ns32k.c (CTOR_TABLE_RELOC_HOWTO): New macro. + (MY_swap_std_reloc_out): Use udata.i for KEEPIT, don't call stoi. + + * ns32knetbsd.c: Include bfd.h. + (MY_text_includes_header, MY_bfd_reloc_type_lookup): New macros. + (MY_bfd_reloc_type_lookup): Declare function too. + * pc532-mach.c (set_sizes): Don't declare. + (MY_text_includes_header, MY_exec_header_not_counted): Define. + (backend_data, MY_backend_data): Don't define. + + * config.bfd: Treat ns32k-pc532-ux* like ns32k-pc532-mach*, and + ns32k-*-lites* like ns32k-*-netbsd*. + + * hosts/nbsd.h: Swap order of sys/vmparam.h and sys/param.h, to + compile on lites. + +Wed Oct 4 14:15:52 1995 Ian Lance Taylor + + * coffcode.h (coff_write_object_contents): Restore setting + f_timdat to 0, deleted on August 22. + +Tue Oct 3 16:28:32 1995 steve chamberlain + + * coffcode.h (coff_bfd_copy_private_symbol_data, + coff_bfd_copy_private_section_data, + coff_bfd_copy_private_bfd_data): ifdef to allow overrides. + * peicode.h (coff_bfd_copy_private_bfd_data): New + (pe_bfd_copy_private_bfd_data): New. + (coff_swap_scnhdr_in): Swap bss size into the right place. + (pe_print_private_bfd_data): Add some newlines. + +Tue Oct 3 11:53:04 1995 Jeff Law (law@hurl.cygnus.com) + + * som.c (setup_sections): Don't die if a space has no subspaces. + +Mon Oct 2 14:08:55 1995 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Don't let a weak + dynamic symbol override a common symbol. Don't change the size or + type if they have been set and the new symbol is not a definition. + Warn if the size or type changes. + +Sun Oct 1 01:34:41 1995 Jeff Law (law@hurl.cygnus.com) + + * som.c (som_begin_writing): Don't write the symbol table or + symbol strings. + (som_finish_writing): Write them here. Place them after the + subspace data, but before the relocs. + +Fri Sep 29 11:01:55 1995 Ian Lance Taylor + + * sunos.c (sunos_add_one_symbol): Just pass false, not + info->shared_library, to sunos_create_dynamic_sections. + (sunos_scan_ext_relocs): Don't warn about a reloc in the .text + section. + (sunos_check_dynamic_reloc): Remove .text section assertion. + +Thu Sep 28 18:48:47 1995 Stan Shebs + + * config.bfd: Add powerpc-*-macos*, powerpc-*-mpw*. + * configure, configure.in: Add pmac_xcoff_vec case. + * Makefile.in (BFD32_BACKENDS): Add coff-pmac.o. + * coff-pmac.c: New file, PowerMac XCOFF support. + * coffcode.h (coff_set_arch_mach_hook): Add PowerMac case. + * targets.c (pmac_xcoff_vec): Declare. + + * mpw-config.in: Various changes to be compatible with the + autoconf-based configury. + * mpw-make.sed: New file, sed commands to translate Unix + makefile into MPW syntax. + * mpw-make.in: Remove. + * hosts/mpw.h: Remove. + * bfd-in.h, bfd-in2.h: If MPW, include the file that defines + true and false as enums, then define TRUE_FALSE_ALREADY_DEFINED. + +Thu Sep 28 17:06:23 1995 steve chamberlain + + * binary.c (binary_get_symtab): Return an empty string on error. + * opncls.c (bfd_fdpenr): Change WIN32 restriction to WINGDB. + +Thu Sep 28 15:30:44 1995 Kim Knuttila + + * coff-ppc.c: Reformatted according to gnu conventions + Removed irrelevant "if 0" code + +Thu Sep 28 11:19:53 1995 Ian Lance Taylor + + * hp300hpux.c (convert_sym_type): Treat secondary symbols as weak + symbols rather than as indirect symbols. + (MY(slurp_symbol_table)): Don't do anything special about + secondary symbols. + + * coffcode.h (coff_new_section_hook): Make sure that the alignment + of .ctors and .dtors sections is no larger than 2. + + * sunos.c (sunos_add_one_symbol): Don't change + bfd_link_hash_common to bfd_link_hash_new, since it may be on the + undef list. + (bfd_sunos_record_link_assignment): Don't put __DYNAMIC in the + dynamic symbols when creating a shared library. + (sunos_scan_ext_relocs): Handle relocs correctly when creating a + shared library. + (sunos_scan_dynamic_symbol): Don't mark the __DYNAMIC symbol as + written even if it is not defined in a regular object. + (sunos_write_dynamic_symbol): Use plt_offset for the address of + the jump table reloc. Add an assertion. Use RELOC_JMP_SLOT + rather than the constant 22. + (sunos_check_dynamic_reloc): Handle creating a shared library. + (sunos_finish_dynamic_link): Set the first entry in the GOT to + zero when creating a shared library. + * aoutx.h (NAME(aout,final_link)): If there is a symbol __DYNAMIC, + write it out at the start of the symbol table. + + * Makefile.in (BFD32_BACKENDS): Add coff-arm.o. + +Thu Sep 28 00:58:05 1995 Doug Evans + + * config.bfd: Add arm-*-coff. + * configure.in, configure: Add armcoff_{little,big}_vec. + * targets.c (armcoff_{little,big}_vec): Declare. + (bfd_target_vector): Add armcoff_{little,big}_vec. + * coff-arm.c (armcoff_{little,big}_vec): Always define. + +Wed Sep 27 10:37:14 1995 Ian Lance Taylor + + * targets.c (bfd_find_target): Remove debugging code. + +Wed Sep 27 07:23:39 1995 Kim Knuttila + + * coff-ppc.c, pe-ppc.c, pei-ppc.c: Initial bfd for coff/PE + support on powerpc. + * Makefile.in: added *-ppc files + * coffcode.h: ppc MAGIC, and use peicode.h rather than coffswap.h to + allow pe based .o's to be shared with other tools on ppc/NT + * config.bfd: added powerpc[le]-[pe|winnt] config support + * configure, configure.in: added bfd_powerpc[le]_pe[i]_vec + * peicode.h: Added more section flags for PE on ppc + Added coff_swap_filehdr_out to allow peicode.h to be + used for non-image PE files on ppc. + Check for image, or not, before copying pe_opthdr + * targets.c: Added new bfd's + * targets.c: Removed two inactive bfds that shouldn't have made it this + far. + +Tue Sep 26 14:06:41 1995 Michael Meissner + + * elf32-ppc.c (ppc_reloc_type): Rename from reloc_type, and use + explicit values to initialize all relocs. Change all users. + (ppc_elf_brtaken_inner): New function to handle branch predicition + relocs. + (ppc_elf_brtaken_reloc): Ditto. + (ppc_elf_howto_raw): Use new functions. Make sure all unsupported + relocs use ppc_elf_unsupported_reloc. + (ppc_elf_merge_private_bfd_data): Keep track of whether an error + needs to be reported. + (ppc_elf_relocate_section): Support branch prediction relocs. + +Tue Sep 26 12:48:05 1995 Ian Lance Taylor + + * bfd.c (bfd_assert): Remove \n from string passed to + _bfd_error_handler. + + * coff-i386.c: (TWO_DATA_SECS): Don't define. + * coffcode.h (bfd_coff_backend_data): Remove _bfd_make_section_hook. + (bfd_coff_make_section_hook): Don't define. + (coff_make_section_hook): Remove. + (sec_to_styp_flags): Remove TWO_DATA_SECS case. + (styp_to_sec_flags): Likewise. + (coff_write_object_contents): Likewise. + (bfd_coff_std_swap_table): Don't initialize make_section_hook + field. + * libcoff.h: Rebuild. + * coffgen.c (make_a_section_from_file): Just call + bfd_make_section_anyway, not bfd_make_section or + bfd_coff_make_section_hook. + * ecoff.c (_bfd_ecoff_make_section_hook): Remove. + * libecoff.h (_bfd_ecoff_make_section_hook): Don't declare. + * coff-alpha.c (alpha_ecoff_backend_data): Don't initialize + make_section_hook field. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + + * aoutx.h (translate_from_native_sym_flags): Don't try to stuff + pointers into value field for warning and indirect symbols; just + leave the value field alone. + * linker.c (generic_link_add_symbol_list): Use next symbol for + warning and indirect symbols, rather than looking in symbol value. + * ecoff.c (ecoff_set_symbol_info): Remove indirect_ptr_ptr + parameter. Change all callers. Remove support for indirect + symbols; it didn't work anyhow. + (_bfd_ecoff_slurp_symbol_table): Remove indirect_ptr variable. + * syms.c: Change comments about BSF_WARNING and BSF_INDIRECT. + * bfd-in2.h: Rebuild. + +Mon Sep 25 16:04:09 1995 Michael Meissner + + * elf32-ppc.c (ppc_elf_howto_raw): For all 14-bit branch relocs, + go back to telling the tools this reloc operates on 32 bits. + +Mon Sep 25 11:48:02 1995 Ian Lance Taylor + + * aout-adobe.c (aout_adobe_callback): Use _bfd_error_handler + rather than a direct fprintf. + * archive.c (_bfd_write_archive_contents): Likewise. + * coffcode.h (coff_slurp_symbol_table): Likewise. + * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Likewise. + (ppc_elf_unsupported_reloc): Likewise. + (ppc_elf_relocate_section): Likewise. + * i386linux.c (linux_tally_symbols): Likewise. + (linux_finish_dynamic_link): Likewise. + * osf-core.c (osf_core_core_file_p): Likewise. + * rs6000-core.c (rs6000coff_get_section_contents): Likewise. + * som.c (som_sizeof_headers): Likewise. + * srec.c (srec_bad_byte): Likewise. + * bfd.c (bfd_assert): Likewise. Also change file to be const. + * libbfd-in.h (bfd_assert): Declare first parameter const. + * libbfd.h: Rebuild. + * coff-a29k.c (a29k_reloc): Don't bother to fprintf; returning + bfd_reloc_overflow is enough. + * coff-h8300.c (rtype2howto): Don't bother to fprintf; just abort. + * coff-h8500.c (rtype2howto): Likewise. + * coff-z8k.c (rtype2howto): Likewise. + * coffcode.h (dummy_reloc16_extra_cases): Likewise. + * elf.c (_bfd_elf_get_lineno): Likewise. + (_bfd_elf_no_info_to_howto): Likewise. + (_bfd_elf_no_info_to_howto_rel): Likewise. + * hp300hpux.c (convert_sym_type): Likewise. + (MY(swap_std_reloc_in)): Likewise. + * elf.c (bfd_section_from_shdr): Remove #if 0 sections. + + * libaout.h (struct aoutdata): Add line_buf field. + * aoutx.h (NAME(aout,find_nearest_line)): Remove statics buffer + and filename_buffer. Instead, use a malloc buffer stored in the + new line_buf field. Remove length restrictions. + + * coffgen.c (string_size): Remove static variable. + (debug_string_size, debug_string_section): Likewise. + (coff_fix_symbol_name): Add string_size_p, debug_string_section_p, + and debug_string_size_p parameters. Use them instead of the + global variables. Change all callers. + (coff_write_symbol): Likewise. + (coff_write_alien_symbol, coff_write_native_symbol): Likewise. + (coff_write_symbols): Add local variables to replace removed + global variables. + + * libcoff-in.h (struct coff_section_tdata): Add offset, i, + function, and line_base fields. + * libcoff.h: Rebuild. + * coffgen.c (coff_find_nearest_line): Use section tdata to cache + information, rather than using static variables. + + * sunos.c (sunos_read_dynamic_info): Adjust offsets in an NMAGIC + file. From Peter DeWolf . + + * init.c (initialized): Remove static variable. + (bfd_init): Don't bother setting initialized. + (bfd_check_init): Remove. + * opncls.c (_bfd_new_bfd): Don't call bfd_check_init. + * libbfd.h: Rebuild. + +Sat Sep 23 01:22:23 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * rs6000-core.c (rs6000coff_core_p): Don't check the core file + size for full core dumps. Copy core file header to private data. + (rs6000coff_core_file_failing_command, + rs6000coff_core_file_failing_signal): New functions to extract + the file name and terminating signal from the core file. + * coff-rs6000.c: Use them. + +Fri Sep 22 17:44:47 1995 Ian Lance Taylor + + Change arch info to be const, initialized at compile time. + * archures.c: Reindent many functions. Change CONST to const. + (bfd_arch_info_type): Make arch_name const. Remove disassemble; + nothing set it anyhow. Make next const. + (bfd_arch_info_list): Remove. + (bfd_archures_list): Rename from archures_init_table. Change from + a table of function pointers to a table of bfd_arch_info_type + structure addresses. + (bfd_scan_arch): Rewrite accordingly. Return a const pointer. + (bfd_lookup_arch): Likewise. + (bfd_set_arch_info): Rewrite accordingly. Change argument to be a + const pointer. + (bfd_default_arch_struct): Make const. + (bfd_arch_init, bfd_arch_linkin): Remove. + (bfd_get_arch_info): Return a const pointer. + * init.c (bfd_init): Don't call bfd_arch_init. + * bfd.c (struct _bfd): Make arch_info const. + * bfd-in2.h: Rebuild. + * libbfd.h: Rebuild. + * configure.in: Put & before everything in $selarchs. + * configure: Rebuild. + * cpu-*.c: Change bfd_*_arch from a function which calls + bfd_arch_linkin to a const structure. + * ieee.c (ieee_object_p): Make arch const. + +Fri Sep 22 16:23:18 1995 Michael Meissner + + * reloc.c (bfd_reloc_code_type): Add relocations to support all of + PowerPC V.4. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + + * elf32-ppc.c (reloc_type): Update names to match current draft. + (ppc_elf_howto_raw): Mark 14 bit relocs as short sized and PC + relative. Update names to current V.4 draft. + (ppc_elf_reloc_type_lookup): Add support for more relocations. + (ppc_elf_relocate_section): Rename relocations to match draft. + +Thu Sep 21 21:53:18 1995 Michael Meissner + + * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Allow modules + compiled with -mrelocatable-lib to be linked with either normal + modules or -mrelocatable modules. + +Wed Sep 20 12:03:26 1995 Ian Lance Taylor + + * coffcode.h (coff_write_object_contents): Clear the vstamp field + in the a.out header. + + * aoutx.h (NAME(aout,swap_ext_reloc_out)): Don't set r_extern for + a reloc against a local symbol, even if it's not a section. + +Tue Sep 19 17:02:26 1995 Ian Lance Taylor + + * targets.c (bfd_target): Remove unused align_power_min field. + * bfd-in2.h: Rebuild. + * All backends: Remove initialization of align_power_min. + +Tue Sep 19 14:02:21 1995 steve chamberlain + + * peicode.h (coff_swap_scnhdr_out): Get sizes for BSS right. + +Mon Sep 18 14:35:01 1995 Arne H. Juul + + * config.bfd (mips-dec-netbsd*): New target. + * configure.host (mips-dec-netbsd*): New host. + * configure.in (mips-dec-netbsd*): New native. + * configure: Rebuild. + +Fri Sep 15 10:24:36 1995 Ian Lance Taylor + + Make the COFF backend linker merge common types: + * cofflink.c (struct coff_debug_merge_element): Define. + (struct coff_debug_merge_type): Define. + (struct coff_debug_merge_hash_entry): Define. + (struct coff_debug_merge_hash_table): Define. + (coff_debug_merge_hash_table_init): Define. + (coff_debug_merge_hash_table_free): Define. + (coff_debug_merge_hash_lookup): Define. + (struct coff_final_link_info): Add debug_merge field. + (coff_debug_merge_hash_newfunc): New static function. + (_bfd_coff_final_link): Allocate and free debug_merge table. + (coff_link_input_bfd): Merge identical enum, struct and union + types. + +Thu Sep 14 14:53:58 1995 Ian Lance Taylor + + Convert i960 COFF to use COFF backend linker. + * coff-i960.c (coff_i960_relocate): Use a coff_section_data + structure to store the symbol being used. + (coff_i960_start_final_link): New static function. + (coff_i960_relocate_section): New static function. + (coff_i960_adjust_symndx): New static function. + (coff_start_final_link): Define. + (coff_relocate_section): Define. + (coff_adjust_symndx): Define. + * coffcode.h (bfd_coff_backend_data): Add new callback function + _bfd_coff_start_final_link. + (bfd_coff_start_final_link): Define. + (coff_start_final_link): Define if not defined. + (bfd_coff_std_swap_table): Add coff_start_final_link. + * cofflink.c (_bfd_coff_internal_syment_name): Make globally + visible. + (_bfd_coff_final_link): Call bfd_coff_start_final_link if the + function callback is not NULL. + * libcoff-in.h (struct coff_section_tdata): Add tdata field. + (_bfd_coff_internal_syment_name): Declare. + * libcoff.h: Rebuild. + * configure.in (icoff_big_vec): Add cofflink.o. + (icoff_little_vec): Likewise. + * configure: Rebuild. + +Wed Sep 13 17:38:23 1995 Fred Fish + + * Makefile.in (clean-info): Remove extraneous tab from line + following action. + +Wed Sep 13 13:27:53 1995 Ian Lance Taylor + + * cofflink.c (coff_link_input_bfd): Fail if a section with no + contents has relocs. + +Thu Sep 12 12:45:34 1995 steve chamberlain + + * coffcode.h (coff_compute_section_file_positions): Keep the + raw size safe. + (coff_write_object_contents): Remember if it's a relocatable + file. + * libcoff-in.h (pe_data_type): New member 'has_reloc_section' + * peicode.h (coff_swap_filehdr_out): Clear not-reloc flag + if relocatable file. Swap out saved raw size. + +Tue Sep 12 12:14:33 1995 Ian Lance Taylor + + * Makefile.in (do_maintainer_clean): Rename from do_realclean. + (maintainer-clean): Rename from realclean, passing + maintainer-clean down to subdirectories, but leave realclean as a + synonym. + + * linker.c (_bfd_generic_link_add_one_symbol): Pass symbol name to + warning callback. + + * dep-in.sed: Remove config.h from generated dependencies. + + * sunos.c (sunos_slurp_dynamic_symtab): New static function, + broken out of sunos_canonicalize_dynamic_symtab. + (sunos_canonicalize_dynamic_symtab): Call new function + sunos_slurp_dynamic_symtab. + (sunos_add_dynamic_symbols): Add three new parameters. Return the + dynamic symbol table to the caller. + * aoutx.h (aout_link_add_symbols): Permit add_dynamic_symbols + callback to override the symbols being read. + * libaout.h (struct aout_backend_data): Add three new parameters + to add_dynamic_symbols callback. + + Extensive minor changes to avoid various gcc warnings. Also: + * Makefile.in (BFD32_BACKENDS): Remove coff-arm.o. + * archures.c (bfd_arch_info_type): Change mach field from long to + unsigned long. + (bfd_lookup_arch): Change machine parameter from long to unsigned + long. + +Mon Sep 11 10:55:47 1995 Ian Lance Taylor + + * sunos.c (sunos_scan_std_relocs): Fix BFD_ASSERT: it's OK to find + a symbol with a non-zero plt_offset. + +Fri Sep 8 11:47:24 1995 Ian Lance Taylor + + * elfcode.h (align_file_position): Remove; not used. + + * configure.in: Only check for on a native system, + and make sure it defines prstatus_t. + * configure: Rebuild. + +Thu Sep 7 12:48:01 1995 Ian Lance Taylor + + * sunos.c (sunos_write_dynamic_symbol): Correct m68k abort test. + + * config.in: Rename from config.h.in. + * configure.in: Call AC_CONFIG_HEADER with config.h:config.in. + Check for config.h:config.in when creating stamp-h. + * configure: Rebuild. + * Makefile.in (stamp-h): Depend upon config.in rather than + config.h.in. Set CONFIG_HEADERS to config.h:config.in when + calling config.status. + + * Makefile.in (do_distclean): Remove config.h and stamp-h. + (Makefile): Just rebuild Makefile. + (config.h, stamp-h): New targets. + * configure.in: Create stamp-h when rebuilding config.h. + * configure: Rebuild. + +Wed Sep 6 15:00:33 1995 Ian Lance Taylor + + * configure.in: Call AC_CONFIG_HEADER. Substitute + HOST_64BIT_LONG. Check that various header files exist. Check + that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc + and/or free need to be declared. Don't make a link to sysdep.h. + Define TRAD_HEADER for various hosts. + * configure: Rebuild. + * configure.host: Don't set my_host. Add definitions taken from + host header files for various entries. Remove entries which now + do nothing. + * acconfig.h: New file. + * config.h.in: New file, built by autoheader. + * sysdep.h: New file. + * Makefile.in (do_distclean): Don't remove sysdep.h. + (RECONFIG): Remove. + (LOCAL_H_DEPS): New variable. + ($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and + $(RECONFIG). + ($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise. + ($(OPTIONAL_BACKENDS)): Likewise. + (stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than + looking through sysdep.h. + * bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile. + (BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG. + (fprintf_vma, sprintf_vma): Likewise. + (int64_type, uint64_type): Don't define. + * bfd-in2.h: Rebuild. + * archures.c, bfd.c, srec.c: Include . + * elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS. + * lynx-core.c: Include stuff from old hosts/lynx.h. + * opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL), + rather than NO_FCNTL. + * targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__ + rather than NATIVE_HPPAHPUX_COMPILER. + * trad-core.c: Don't include . Include TRAD_HEADER if it + is defined. + * hosts/*.h: Remove all header files which merely include, + declare, and define things. Leave header files which define + information needed by trad-core.c. + + * aclocal.m4 (BFD_BINARY_FOPEN): Define. + (BFD_CC_FOR_BUILD): Define. + * configure.in: Use BFD_CC_FOR_BUILD. + * configure: Rebuild. + +Tue Sep 5 19:35:28 1995 Ian Lance Taylor + + * aclocal.m4: Don't try to grep ../Makefile if it doesn't exist. + * configure: Rebuild. + + * coff-sparc.c (CALC_ADDEND): Don't set the addend to the value of + a global symbol. + +Tue Sep 5 12:48:26 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * config.bfd: i386pe_ve -> i386pe_vec. + +Mon Sep 4 14:02:43 1995 Ian Lance Taylor + + * configure.host: Incorporate host Makefile fragments by setting + shell variables. + * configure.in: Call AC_PROG_CC. Substitute CFLAGS, HDEFINES and + AR. Call AC_PROG_INSTALL. Substitute CC_FOR_BUILD, choosing a + value based on whether the code is being compiled by a cross + compiler. Don't substitute host_makefile_frag or frags. + * aclocal.m4: New file to define local AC_PROG_CC. + * configure: Rebuild. + * Makefile.in (INSTALL): Set to @INSTALL@. + (INSTALL_PROGRAM): Set to @INSTALL_PROGRAM@. + (INSTALL_DATA): Set to @INSTALL_DATA@. + (AR): Set to @AR@. + (CC): Define as @CC@. + (CFLAGS): Set to @CFLAGS@. + (CC_FOR_BUILD): Set to @CC_FOR_BUILD@. + (@host_makefile_frag@): Remove. + (ALL_CFLAGS): Change $(HDEFINES) to @HDEFINES@. Move $(CFLAGS) + after other options. + (config.status): Remove dependency upon @frags@. + * config/*.mh, config/README: Remove. + + * config.bfd: Rewrite to incorporate the contents of the Makefile + fragments by setting shell variables, rather than merely returning + the name of a Makefile fragment. + * configure.in: Use shell variables set by config.bfd rather than + looking at the target Makefile fragment files. Don't substitute + target_makefile_frag. Do substitute TDEFINES. + * configure: Rebuild. + * Makefile.in (@target_makefile_frag@): Remove. + (ALL_CFLAGS): Change $(TDEFINES) to @TDEFINES@. + * config/*.mt: Remove. + +Mon Sep 4 03:13:28 1995 Ken Raeburn + + * configure.in: Put changequote lines around "i[345]86" patterns + section of core file support. + +Sun Sep 3 11:31:58 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_print_private_bfd_data): Define to use the + generic version. + +Fri Sep 1 17:08:40 1995 steve chamberlain + + * peicode.h (coff_swap_aouthdr_in): Add ImageBase to + entry, text_start and data_start. + +Fri Sep 1 18:06:28 1995 Ian Lance Taylor + + * Makefile.in (OFILES): Remove $(TDEPFILES). + * config/apollo.mt (TDEPFILES): Remove. + * config/README: Update. + + * configure.in: For a native configuration, set COREFILE and + COREFLAG based on the canonical host name. + * configure: Rebuild. + * Makefile.in: Rebuild dependencies. + (ALL_CFLAGS): Add @COREFLAG@. + (OFILES): Replace $(HDEPFILES) with @COREFILE@. + * coff-rs6000.c: Check AIX_CORE rather than HOST_AIX for core file + support routines. Check LYNX_CORE rather than HOST_LYNX. + * lynx-core.c: Check LYNX_CORE rather than HOST_LYNX. + * i386lynx.c: Likewise. + * m68klynx.c: Likewise. + * sparclynx.c: Likewise. + * rs6000-core.c: Check AIX_CORE rather than HOST_AIX. + * *-core.c: Comment changes. + * config/decstation.mh (HDEPFILES): Remove. + (HDEFINES): Remove -DTRAD_CORE. + * config/irix3.mh (RANLIB): Remove. + * config/irix4.mh (HDEPFILES, RANLIB): Remove. + (HDEFINES): Remove -DIRIX_CORE. + * config/riscos.mh (RANLIB, HDEPFILES): Remove. + (HDEFINES): Remove -DTRAD_CORE. + * config/ncr3000.mh (AR_FLAGS, RANLIB): Remove. + * config/ultra3.mh (RANLIB): Remove. + * config/aix4.mh, config/alphaosf.mh, config/amix.mh: Remove. + * config/apollo.mh, config/delta68.mh, config/delta88.mh: Remove. + * config/dpx2.mh, config/esix.mh, config/harris.mh: Remove. + * config/hp300.mh, config/hp300bsd.mh, config/hppabsd.mh: Remove. + * config/hppahpux.mh, config/hppaosf.mh: Remove. + * config/i386aix.mh, config/i386bsd.mh: Remove. + * config/i386linux.mh, config/i386mach3.mh: Remove. + * config/i386sco.mh, config/i386v.mh, config/i386v4.mh: Remove. + * config/irix5.mh, config/m88kmach3.mh, config/mipsbsd.mh: Remove. + * config/mipsmach3.mh, config/news-mips.mh: Remove. + * config/news.mh, config/pc532mach.mh, config/riscix.mh: Remove. + * config/rs600.mh, config/rs6000lynx.mh: Remove. + * config/solaris2.mh, config/stratus.mh: Remove. + * config/symmetry.mh, config/sysv4.mh, config/tahoe.mh: Remove. + * config/vaxbsd.mh, config/vaxult.mh, config/vaxult2.mh: Remove. + +Fri Sep 1 15:18:50 1995 Kazumoto Kojima + + * elflink.h (elf_bfd_final_link): Don't change a DT_INIT or + DT_FINI entry if the appropriate symbol is not in the hash table. + + * libelf.h (struct elf_backend_data): Add create_program_headers + and want_hdr_in_seg fields. + * elfxx-target.h (elf_backend_want_hdr_in_seg): Define if not + defined. + (elf_backend_create_program_headers): Likewise. + (elfNN_bed): Initialize create_program_headers and + want_hdr_in_seg. + * elf.c (get_program_header_size): Call create_program_headers + backend routine. + (map_program_segments): Check want_hdr_in_seg backend field. Call + create_program_headers backend routine. + + * elf.c (assign_file_positions_except_relocs): Align non allocated + sections when creating an executable. + + * elfcode.h (elf_swap_phdr_in): Make non static. + (elf_swap_phdr_out): Make non static. + * libelf.h (bfd_elf32_swap_phdr_in): Declare. + (bfd_elf32_swap_phdr_out): Declare. + (bfd_elf64_swap_phdr_in): Declare. + (bfd_elf64_swap_phdr_out): Declare. + + * ecofflink.c (ecoff_collect_shuffle): New static function. + (_bfd_ecoff_get_accumulated_pdr): New function. + (_bfd_ecoff_get_accumulated_sym): New function. + (_bfd_ecoff_get_accumulated_ss): New function. + * libbfd-in.h (_bfd_ecoff_get_accumulated_pdr): Declare. + (_bfd_ecoff_get_accumulated_sym): Declare. + (_bfd_ecoff_get_accumulated_ss): Declare. + * libbfd.h: Rebuild. + +Fri Sep 1 13:20:25 1995 Ian Lance Taylor + + * libecoff.h (_bfd_ecoff_bfd_print_private_bfd_data): Fix typo. + + * elflink.h (elf_link_add_object_symbols): Handle indirect and + warning symbols. If any section is named .gnu.warning.XXX, treat + the contents as a warning to be issued if the symbol XXX is + referenced. + (elf_link_output_extsym): For an indirect or warning symbol, just + output the symbol it points to. + + * linker.c (_bfd_link_hash_newfunc): Don't bother to set bfd_error + if bfd_hash_allocate fails, since it will already be set. + (generic_link_hash_newfunc): Likewise. + (archive_hash_newfunc): Likewise. + (hash_entry_bfd): New static function. + (_bfd_generic_link_add_one_symbol): Pass new arguments to warning + callback. Allocate a new warning using the hash table newfunc. + Use bfd_hash_replace to update the entry in the hash table, rather + than assuming we can copy the fields with structure assignment. + + * hash.c (bfd_hash_replace): New function. + * bfd-in.h (bfd_hash_replace): Declare. + * bfd-in2.h: Rebuild. + +Fri Sep 1 08:12:50 1995 James G. Smith + + * config.bfd: Add mips*vr4300-*-elf* target. + * config/mipsbvr4300.mt: Added. + +Thu Aug 31 16:00:53 1995 steve chamberlain + + * Makefile.in: Update dependencies. + * aout-target.h (MY_bfd_print_private_bfd_data): New. + * bfd-in.h (PE STUFF): Deleted. + * bfd.c (tdata->pe_obj_data): New. + (bfd_print_private_bfd_data): New. + * coff-i386.c, coff-arm.c (coff_*-rtype_to_howto): Get image base from + new place. + * libcoff.h, libbfd.h, bfd-in2.h: Rebuilt. + * coffcode.h (pe_value): Delete + (coff_mkobject, coff_mkobject_hook): Conditionally build. + (coff_compute_section_file_positions): Look in new place. + (add_data_entry, fill_pe_header_info): Deleted. + (coff_write_object_contents): Remove PE stuff. + (coff_bfd_print_private_bfd_data): New. + * coffswap.h: Remove PE stuff. + * elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): New. + * libbfd-in.h (_bfd_generic_bfd_print_private_bfd_data): New. + * libcoff-in.h (pe_data_type): New. + * libecoff.h (_bfd_ecoff_bfd_print_private_bfd_data): New. + * targets.c (_bfd_print_private_bfd_data): New. + * peicode.h: New file. + +Thu Aug 31 11:49:21 1995 Ian Lance Taylor + + * bfd-in.h: Add extern "C" if __cplusplus. + * bfd-in2.h: Rebuild. + + * coff-mips.c (mips_relocate_section): Don't convert a reloc + against an absolute symbol into a reloc against a section. + +Thu Aug 31 08:00:14 1995 steve chamberlain + + * coff-arm.c (coff_arm_reloc): Fix common size problem. + (i3coff_object_p): Delete. + +Wed Aug 30 20:41:27 1995 steve chamberlain + + * coff-arm.c (deletemeacoff_arm_reloc): Deleted. + (arm26): Not partial inplace. + * coffcode.h (coff_compute_section_file_positions): Don't + do page aligning if COFF_PAGE_SIZE isn't defined. + * coffswap.h (coff_swap_scnhdr_in): Update image base correctly. + +Tue Aug 29 13:50:21 1995 steve chamberlain + + * coffcode.h (coff_compute_section_file_positions): + Compile even if COFF_PAGE_SIZE isn't defined. + * cofflink.c (_bfd_coff_generate_reloc_section): Write + base file info as rvas. + * coff-arm.c (coff_rtype_to_howto): Deal with reloc 11. + * coffcode.h (coff_write_object_contents): Remove #if0ed code + Only remove empty sections in PE inmage files. + * libbfd.h, bfd-in2.h: regenerated. + * coff-arm.c (aoutarm_std_relo): New entry at 11. + (arm_reloc_type_lookup) : Understand type 11. + * coff-i386.c (howto_table): fix name of rva type. + (coff-i386_rtype_to_howto): Understand R_IMAGEBASE type. + * coffcode.h (sec_to_styp_flags): .edata is data. + (coff_compute_section_file_positions): Get page size right for PE. + Pagesize info is only valid in PE image files. + (fill_pe_header_info): Fix fields. + (coff_write_object_contents): Remove end_of_image calc. + (_bfd_coff_generate_reloc_section): Remove orphaned comment. + * coffswap.h (coff_swap_scnhdr_in): Don't always add IMAGE_BASE. + Swap in PE header. + (coff_swap_scnhdr_out): Setup PE flags correctly. + * reloc.c (BFD_RELOC_RVA): New field. + +Thu Aug 24 17:49:59 1995 Ian Lance Taylor (ian@cygnus.com) + + * cofflink.c (coff_link_input_bfd): Don't include line numbers for + a section if its output section has no contents. + +Wed Aug 23 16:48:52 1995 Ian Lance Taylor (ian@cygnus.com) + + * ecoff.c (_bfd_ecoff_slurp_symbolic_info): Add parentheses to FIX + expression to avoid compiler bug on HP-UX 9.01. + +Wed Aug 23 09:49:39 1995 Steve Chamberlain + + * coffcode.h (pe_value): Unansify. + +Mon Aug 21 17:49:28 1995 steve chamberlain + + * bfd-in.h (bfd_link_subsystem): Turn enum into #defines. + (bfd_link_pe_info_dval): New + (bfd_link_stack_heap): Renamed and massaged into bfd_link_pe_info. + * bfd-in2.h: rebuilt. + * bfd.c (NT_subsystem, NT_stack_heap): Deleted. + * coffcode.h (pe_value): New function. + (fill_pe_header_info): New function. + (coff_write_object_contents): Use new function. + (coff_write_object_contents): Initialze link_data if not set. + * cofflink.c (coff_final_link_info): Remove pe randomness. + (dores_com): Update info in bfd_link_pe_info_dval. + (process_embedded_commands): Use the bfd_link_pe_info_dval. + (_bfd_coff_final_link): Remove PE stuff, initialize + coff_data->link_info. + * coffswap.h (coff_swap_[aout|filehdr]_out): Use indirect PE pointer. + (coff_swap_scnhdr_out): Use real imagebase. + * libcoff-in.h (coff_data_type.link_info): New field. + +Mon Aug 21 11:10:32 1995 Ian Lance Taylor + + * linker.c (link_action): If an undefined reference follows an + undefined weak reference, change the type to undefined. + * elflink.h (elf_link_add_archive_symbols): Don't record an + undefined weak reference as defined, in case it turns into a real + undefined reference later in the same archive. + +Thu Aug 17 16:29:09 1995 Ken Raeburn + + * coff-sh.c (sh_relax_section): Cast value for used_by_bfd field + to PTR, not coff_section_tdata pointer, since PTR is the real type + of the field. + * cofflink.c (_bfd_coff_read_internal_relocs): Ditto. + +Thu Aug 17 14:44:26 1995 Ian Lance Taylor + + Add support for linking SPARC SunOS PIC compiled code. + * sunos.c (SPARC_PLT_PIC_WORD0): Define. + (SPARC_PLT_PIC_WORD1, SPARC_PLT_PIC_WORD2): Define. + (struct sunos_link_hash_entry): Add got_offset and plt_offset + fields. + (struct sunos_link_hash_table): Add dynamic_sections_created and + dynamic_sections_needed fields. + (sunos_link_hash_newfunc): Initialize new fields. + (sunos_link_hash_table_create): Initialize new fields. + (sunos_create_dynamic_sections): New static function, broken out + of sunos_add_dynamic_symbols. + (sunos_add_dynamic_symbols): Call sunos_create_dynamic_sections. + (sunos_add_one_symbol): Call sunos_create_dynamic_sections. + (bfd_sunos_size_dynamic_sections): Call sunos_scan_relocs before + checking whether we need to set up the dynamic link information. + Define __GLOBAL_OFFSET_TABLE if anything referred to it. + (sunos_scan_std_relocs): Call sunos_create_dynamic_sections. Use + plt_offset field; only put symbol in .plt if it is not defined by + a regular object. + (sunos_scan_ext_relocs): Likewise. Handle base relative relocs. + (sunos_scan_dynamic_symbol): Store dynobj in local variable. + (sunos_write_dynamic_symbol): Check plt_offset rather than + checking whether symbol is in .plt section. If symbol is defined + in a regular object file, use SPARC_PLT_PIC_WORD[012], and don't + add a JMP_TBL reloc. + (sunos_check_dynamic_reloc): Add contents and relocationp fields. + If plt_offset is set, redirect relocation to PLT. If this is a + base relative reloc, redirect relocation to GOT. Check + dynamic_sections_needed field rather than whether dynobj is set. + (sunos_finish_dynamic_link): Check dynamic_sections_needed field + rather than whether dynobj is set. Don't die if .need and .rules + sections were not created. + * aoutx.h (howto_table_ext): Mark PC10, PC22, and JMP_TBL entries + PC relative. Mark PC10 complain_overflow_dont. Mark PC22 and + JMP_TBL complain_overflow_signed. + (NAME(aout,final_link)): If info->shared is set, set DYNAMIC. + (aout_link_input_section_std): Call check_dynamic_reloc for all + relocs. Pass contents and &relocation. Don't warn about an + undefined symbol until check_dynamic_reloc has been called. Don't + warn about an undefined symbol for a base relative reloc. + (aout_link_input_section_ext): Likewise. For a base relative + reloc, always treat r_index as an index into the symbol table. + * libaout.h (struct aout_backend_data): Add contents and + relocation argument to check_dynamic_reloc entry point. + (struct aoutdata): Add local_got_offsets field. + +Wed Aug 16 01:03:07 1995 Ian Lance Taylor + + * elf32-i386.c (elf_i386_check_relocs): Fix bug in last change. + +Mon Aug 14 11:39:24 1995 Ian Lance Taylor + + * aoutx.h (NAME(aout,machine_type)): Handle a machine of + bfd_mach_sparc or bfd_mach_sparc64. + + * elflink.h (elf_link_add_object_symbols): If a symbol is a weak + definition, add it to the dynamic symbol table if any dynamic + object mentions it. If we do add it, make sure we add the + corresponding real symbol. + (elf_adjust_dynamic_symbol): Adjust a weak defined symbol which we + put in the dynamic symbol table, even if no regular object refers + to it. + * elf32-i386.c (elf_i386_check_relocs): When creating a shared + library, don't allocate space for a PC relative reloc against a + local symbol. + * elf32-m68k.c (elf_m68k_check_relocs): Likewise. + * elf32-sparc.c (elf32_sparc_check_relocs): Likewise. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Change assertion + to accept symbol with weakdef set. + * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise. + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): When creating a shared + libary, don't copy over a PC relative reloc against a local + symbol. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + +Sun Aug 13 00:40:58 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.h (R_HPPA_BEGIN_BRTAB): Define. + (R_HPPA_END_BRTAB): Likewise. + * som.c (som_write_fixups): Handle R_BEGIN_BRTAB and R_END_BRTAB. + +Thu Aug 10 15:53:29 1995 Ian Lance Taylor + + * coffswap.h (coff_swap_aux_in): Swap the array dimensions + whenever x_fcnary is not being used for something else, rather + than only for an array. + (coff_swap_aux_out): Likewise. + +Tue Aug 8 16:34:57 1995 steve chamberlain + + * cofflink.c (_bfd_coff_generic_relocate_section): Remove most + of special case stuff for PE. Now handled by relocs. + * coff-i386.c (coff_i386_reloc): Special case of PE type 7s. + (howto_table): Type 7 is dir32-rva. + +Tue Aug 8 10:15:43 1995 Jeffrey A. Law + + * configure.host: Recognize aix4 explicitly. + * rs6000-core.c (CORE_DATA_SIZE_FIELD): New macro to get a the size + of a core dump's data section. Provide alternate definition for aix4. + (SAVE_FIELD): Similarly for save state field (register info). + (STACK_END_ADDR): Provide definition suitable for aix4. + * config/{aix4.mh,aix4.mt}: New configuration files. + * hosts/aix4.h: Likewise. + +Mon Aug 7 23:03:21 1995 Ian Lance Taylor + + * som.c (som_bfd_copy_private_symbol_data): Cast initializations + to avoid warnings. + +Mon Aug 7 14:51:08 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_decode_symclass): Handle absolute symbols by checking + the SOM type (since they will rarely if ever be in the absolute + section). + +Wed Aug 6 09:12:50 1995 Doug Evans + + * archures.c (bfd_mach_sparc, bfd_mach_sparc64): Define. + * bfd-in2.h: Regenerated. + * cpu-sparc.c (sparc_arch_info): Renamed from arch_info_struct. + (sparc64_arch_info): New static variable. + (bfd_sparc_arch): Link in sparc64_arch_info. + * elf64-sparc.c (sparc64_elf_xxx): Renamed from elf64_xxx. + (sparc64_elf_object_p): New static function. + (elf_backend_object_p): Define. + * config/sparc64-elf.mt (SELECT_VECS): Add bfd_elf32_sparc_vec. + +Sat Aug 5 00:04:08 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_get_reloc_upper_bound): Return -1 on error. Compute + return value with sizeof (arelent *), not sizeof (arelent). + +Wed Aug 2 12:32:21 1995 Ian Lance Taylor + + * elf.c (bfd_section_from_shdr): If the section pointed to by the + sh_link field of a reloc section is not a symbol table, and the + file contains a single symbol table, clobber the sh_link field of + the reloc section to point to the symbol table. + +Tue Aug 1 10:09:01 1995 Doug Evans + + * coff-arm.c (howto reloc ARM26): Change size from 3 to 2. + (howto reloc ARM26D): Likewise. + +Mon Jul 24 14:17:50 1995 Ian Lance Taylor + + * aoutx.h (NAME(aout,find_nearest_line)): Use the line just before + the offset, not the one just after. Break out of the loop after + finding a function past the offset, not merely when finding a + function with a line defined. + + * ecofflink.c (_bfd_ecoff_locate_line): When handling stabs: + correct setting of sym_ptr_end to consider symbols skipped when + setting sym_ptr; don't leave loop early unless an N_FUN is found + with a larger value. + + * coff-sh.c (sh_coff_howtos): Mark R_SH_PCDISP8BY2 and R_SH_PCDISP + as PC relative. Describe R_SH_IMM16. Add entries for + R_SH_SWITCH16, R_SH_SWITCH32, R_SH_USES, R_SH_COUNT, and + R_SH_ALIGN. + (SWAP_IN_RELOC_OFFSET): Define. + (SWAP_OUT_RELOC_OFFSET): Define. + (CALC_ADDEND): Define. + (sh_reloc): Change sym_value and addr to type bfd_vma. Skip reloc + types other than R_SH_IMM32 and R_SH_PCDISP on an external symbol. + (coff_bfd_relax_section): Define. + (coff_bfd_get_relocated_section_contents): Define. + (sh_relax_section): New static function. + (sh_relax_delete_bytes): New static function. + (sh_relocate_section): Handle R_SH_PCDISP on an external symbol. + (sh_coff_get_relocated_section_contents): New static function. + + * cofflink.c (coff_link_add_object_symbols): Call + _bfd_coff_get_external_symbols, not coff_link_get_symbols. Call + _bfd_coff_free_symbols, not coff_link_free_symbols. Call + _bfd_coff_read_string_table, not coff_read_string_table. + (coff_link_check_archive_element): Likewise. + (coff_link_input_bfd): Likewise. + (coff_link_get_symbols): Move to coffgen.c. + (coff_read_string_table): Likewise. + (coff_link_free_symbols): Likewise. + (_bfd_coff_internal_syment_name): New static function. + (coff_link_check_ar_symbols): Use _bfd_coff_internal_syment_name. + (coff_link_add_symbols): Likewise. + (coff_link_input_bfd): Likewise. + (_bfd_coff_generic_relocate_section): Likewise. + (_bfd_coff_read_internal_relocs): New function. + (coff_link_input_bfd): Use cached section contents if available. + Use _bfd_coff_read_internal_relocs. + * coffcode.h (coff_slurp_symbol_table): Don't call bfd_seek. + (coff_bfd_get_relocated_section_contents): Only define if not + already defined. + (coff_bfd_relax_section): Likewise. + * coffgen.c (build_string_table): Remove. + (_bfd_coff_get_external_symbols): New function, moved in from old + coff_link_get_symbols in cofflink.c. + (_bfd_coff_read_string_table): New function, moved in from old + coff_read_string_table in cofflink.c. + (_bfd_coff_free_symbols): New function, moved in frmo old + coff_link_free_symbols in cofflink.c. + (coff_get_normalized_symtab): Use _bfd_coff_get_external_symbols + rather than reading the symbols directly. To free them, call + _bfd_coff_free_symbols. Use _bfd_coff_read_string_table rather + than build_string_table. + * libcoff-in.h (obj_coff_keep_syms): Define. + (obj_coff_keep_strings): Define. + (coff_data_type): Add fields keep_syms and keep_strings. + (coff_section_tdata): Define new structure. + (coff_section_data): Define. + (_bfd_coff_get_external_symbols): Declare. + (_bfd_coff_read_string_table): Declare. + (_bfd_coff_free_symbols): Declare. + (_bfd_coff_read_internal_relocs): Declare. + * libcoff.h: Rebuild. + +Fri Jul 21 22:32:54 1995 Michael Meissner + + * elf32-ppc.c (ppc_elf_howto_raw): Add support for R_PPC_SDAREL + relocation. + (ppc_elf_reloc_type_lookup): Ditto. + (ppc_elf_got16_inner): Ditto. + (ppc_elf_relocate_section): Ditto. + +Thu Jul 20 19:19:06 1995 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (hppa_elf_gen_reloc_type): Add new (ignored) + argument. + * elf32-hppa.h: Corresponding change. + +Thu Jul 20 19:01:07 1995 Ken Raeburn + + * libaout.h (set_aout_section_data): New macro. + * sunos.c (sunos_scan_relocs): Use it. + + * aout-ns32k.c (MY_swap_std_reloc_out): Undef KEEPIT before + defining it. + +Thu Jul 20 13:48:00 1995 Fred Fish + + * hosts/i386v4.h (getgid, getuid): Change prototypes to be + compatible with Unixware 1.x and Unixware 2.x, and probably other + i386 svr4 versions as well. + +Thu Jul 20 13:41:21 1995 Ken Raeburn + + * targets.c (bfd_target_vector): Since armpe and armpei have been + split into big- and little-endian variants, list all of them, + instead of the now-nonexistant armpe[i]_vec. + +Thu Jul 20 00:06:39 1995 Ian Lance Taylor + + * elf.c (bfd_section_from_phdr): Set lma based on p_paddr. + (elf_fake_sections): Set sh_addr based on lma, not vma. + +Wed Jul 19 15:52:01 1995 Doug Evans + + * coff-arm.c (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Replaces TARGET_SYM. + * configure.in (armpe_vec, armpei_vec): Add bi-endian support. + * configure: "regenerated". + * pe-arm.c (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Replaces TARGET_SYM. + (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Replaces TARGET_NAME. + * pei-arm.c (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Replaces TARGET_SYM. + (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Replaces TARGET_NAME. + * targets.c (armpe_vec, armpei_vec): Deleted. + (armpe_little_vec, armpe_big_vec, armpei_little_vec, armpei_big_vec): + Added. + * config/arm-pe.mt (DEFAULT_VECTOR): Default is armpe_little_vec. + (SELECT_VECS): Add bi-endian support. + +Wed Jul 19 10:47:25 1995 Ian Lance Taylor + + * coff-sh.c: Clean up and comment. + (r_imm32): Remove. + (sh_coff_howtos): New static array. + (SH_COFF_HOWTO_COUNT): Define. + (get_symbol_value): Make relocation bfd_vma rather than long. + (RTYPE2HOWTO): Rewrite to use sh_coff_howtos. + (coff_relocate_section): Define to sh_relocate_section. + (sh_relocate_section): New static function. + +Sat Jul 15 01:02:53 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * configure.host: Add support for generic m68k SVR4 host. + +Fri Jul 14 13:13:55 1995 Ian Lance Taylor + + * aoutx.h (KEEPIT): Change definition to udata.i. + (KEEPITTYPE): Remove. + (NAME(aout,reloc_type_lookup)): Add cases to the + extended reloc type switch: SPARC_GOT10, SPARC_GOT13, SPARC_GOT22, + SPARC_PC10, SPARC_PC22, SPARC_WPLT30. + (NAME(aout,swap_std_reloc_out)): Don't bother to use stoi when + retrieving KEEPIT value. + (NAME(aout,swap_ext_reloc_out)): Likewise. Also, only add in + output section VMA for section symbols, and check BSF_SECTION_SYM + to control whether to set r_extern to 1. + + * syms.c: Fix comments so that `make info' works. + + * elf32-mips.c (mips_elf_find_nearest_line): Set SEC_HAS_CONTENTS + in .mdebug section, in case backend linker has cleared it. + +Fri Jul 14 11:58:34 1995 Michael Meissner + + * elf32-ppc.c (ppc_elf_addr16_ha_inner): Rewrite to take just one + argument, the final relocated address. + (ppc_elf_addr16_ha_inner): Adjust ppc_elf_addr16_ha_inner caller. + (ppc_elf_relocate_section): Ditto. + +Thu Jul 13 17:22:03 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (hppa_som_gen_reloc_type): Choose a reasonable field + selector relocation for the difference of two symbols. + +Thu Jul 13 10:33:25 1995 Ian Lance Taylor + + * aoutx.h (NAME(aout,slurp_reloc_table)): Cast argument to size_t + for malloc. + * coff-mips.c (mips_relocate_section): Likewise, for memmove. + (mips_relax_section): Likewise, for malloc. + * cofflink.c (process_embedded_commands): Likewise. + (_bfd_coff_final_link): Likewise. + * ecoff.c (_bfd_ecoff_write_object_contents): Likewise. + (ecoff_final_link_debug_accumulate): Likewise. + (ecoff_indirect_link_order): Likewise, for memcpy and malloc. + (ecoff_reloc_link_order): Likewise, for malloc. + * ecofflink.c (ecoff_align_debug): Likewise, for memset. + (ecoff_write_symhdr): Likewise, for malloc. + * elf32-hppa.c (elf32_hppa_read_symext_info): Likewise. + * elf.c (assign_file_positions_except_relocs): Likewise, for + qsort. + * elf32-mips.c (mips_elf_read_ecoff_info): Likewise, for malloc. + * elfcode.h (elf_slurp_reloc_table): Likewise. + * elfcore.h (elf_corefile_note): Likewise. + * elflink.h (elf_link_add_object_symbols): Likewise. + (elf_link_read_relocs): Likewise. + (NAME(bfd_elf,size_dynamic_sections)): Likewise, for memset. + * i386linux.c (bfd_linux_size_dynamic_sections): Likewise. + * ieee.c (do_with_relocs): Likewise. + * linker.c (default_indirect_link_order): Likewise, for malloc. + * nlmcode.h (nlm_object_p): Likewise. + (nlm_write_object_contents): Likewise. + * oasys.c (oasys_set_section_contents): Likewise, for memcpy. + * reloc.c (bfd_generic_get_relocated_section_contents): Likewise, + for malloc. + * section.c (bfd_get_section_contents): Likewise, for memcpy. + * srec.c (srec_get_section_contents): Likewise. + (srec_set_section_contents): Likewise. + * sunos.c (bfd_sunos_size_dynamic_sections): Likewise, for + realloc and memset. + (sunos_scan_relocs): Likewise, for malloc. + (sunos_scan_dynamic_symbol): Likewise, for realloc. + * syms.c (_bfd_generic_read_minisymbols): Likewise, for malloc. + * versados.c (versados_get_section_contents): Likewise, for + memcpy. + + * libbfd.c (real_read): Add prototype. Change argument types from + int to size_t. + (bfd_read): Cast real_read argument to size_t, not int. + (bfd_write): Cast fwrite argument to size_t, not int. + + * elf64-gen.c (elf_info_to_howto): Fix definition for recent elf.c + changes. + + * configure.in: Fix typo: change {$enableval} to ${enableval}. + * configure: Rebuild. + + * Makefile.in (BFD32_BACKENDS): Add elflink.o. + + * targets.c (bfd_target): Add fields _read_minisymbols and + _minisymbol_to_symbol. + (BFD_JUMP_TABLE_SYMBOLS): Add _read_minisymbols and + _minisymbol_to_symbol. + (bfd_read_minisymbols): Define. + (bfd_minisymbol_to_symbol): Define. + * syms.c (_bfd_generic_read_minisymbols): Define. + (_bfd_generic_minisymbol_to_symbol): Define. + * libbfd-in.h (_bfd_nosymbols_read_minisymbols): Define. + (_bfd_nosymbols_minisymbol_to_symbol): Define. + (_bfd_generic_read_minisymbols): Declare. + (_bfd_generic_minisymbol_to_symbol): Declare. + * bfd-in2.h: Rebuild. + * libbfd.h: Rebuild. + * aoutx.h (MINISYM_THRESHOLD): Define. + (NAME(aout,read_minisymbols)): New function. + (NAME(aout,minisymbol_to_symbol)): New function. + * libaout.h (NAME(aout,read_minisymbols)): Declare. + (NAME(aout,minisymbol_to_symbol)): Declare. + * aout-target.h (MY_read_minisymbols): Define. + (MY_minisymbol_to_symbol): Define. + * All targets: Define read_minisymbols and minisymbol_to_symbol. + +Wed Jul 12 17:55:55 1995 Ken Raeburn + + * elflink.h (elf_link_add_object_symbols): Cast return value from + bfd_alloc. + + * elfcode.h (size_info): Don't use "&" before function names. + +Wed Jul 12 00:16:48 1995 Ken Raeburn + + * libelf.h (elf_backend_data): Use unsigned, not unsigned char, + for bitfields. + +Tue Jul 11 15:19:53 1995 Ian Lance Taylor + + * elf.c (bfd_section_from_shdr): In case SHT_REL[A], only get the + BFD section for the sh_link section if it is a SYMTAB section. + + * aoutx.h (NAME(aout,link_add_symbols)): Don't bother to check + that archives hold a.out objects. + * cf-i386lynx.c (coff_bfd_link_add_symbols): Don't define. + (lynx_link_add_symbols): Remove. + * cf-m68klynx.c (coff_bfd_link_add_symbols): Don't define. + (lynx_link_add_symbols): Remove. + * elflink.h (elf_bfd_link_add_symbols): Don't bother to check that + archives hold ELF objects. + + * archive.c (bfd_generic_archive_p): If the archive has a map, and + the target was defaulted, but the first object in the archive can + not be matched with that target, then return a bad format error. + + * elf64-sparc.c (elf_sparc_howto_table): Set howto for WDISP16 to + elf64_wdisp16_reloc. + (elf64_wdisp16_reloc): New static function. + (elf64_sparc_relocate_section): New static function. + (elf_backend_relocate_section): Define. + + * libelf.h (struct elf_size_info): Change type of last argument to + swap_symbol_out from char * to PTR. + (bfd_elf32_swap_symbol_out): Update declaration. + (bfd_elf64_swap_symbol_out): Likewise. + * elfcode.h (elf_swap_symbol_out): Change type of cdst from char * + to PTR. + * elf.c (swap_out_syms): Cast to PTR, not char *, when calling + swap_symbol_out routine. + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Likewise. + (elf_link_output_sym): Likewise. + (elf_link_output_extsym): Likewise. + * elf32-sparc.c (elf32_sparc_finish_dynamic_sections): Likewise. + +Tue Jul 11 12:29:49 1995 Rick Sladkey + + * elf.c (_bfd_elf_find_nearest_line): Handle the simple case where + there is no debugging information. + +Mon Jul 10 11:45:55 1995 Ken Raeburn + + * makefile.dos (OBJS): Add binary.o and tekhex.o. From DJ + Delorie. + +Mon Jul 10 11:09:58 1995 Ian Lance Taylor + + * linker.c (set_symbol_from_hash): bfd_link_hash_new case: Don't + abort; it can happen for constructor symbols when not building + constructors. + + * coff-i960.c (coff_i960_relocate): Correct typo: use ! on strcmp, + not on string. + * cofflink.c (_bfd_coff_generic_relocate_section): Remove unused + local i. + * coff-arm.c (coff_arm_rtype_to_howto): Don't declare. + (PCRELOFFSET): Define if not already defined. + * Makefile.in: Rebuild dependencies. + (BFD32_BACKENDS): Add coff-arm.o + (CFILES): Add coff-arm.c, pe-arm.c, pei-arm.c. + + * aoutx.h (NAME(aout,link_hash_table_create)): Allocate hash table + using bfd_alloc, not malloc. + * cofflink.c (_bfd_coff_link_hash_table_create): Likewise. + * ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise. + * i386linux.c (linux_link_hash_table_create): Likewise. + * linker.c (_bfd_generic_link_hash_table_create): Likewise. + * sunos.c (sunos_link_hash_table_create): Likewise. + + Based on patches from Eric Youngdale : + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): If -Bsymbolic, + output a DT_SYMBOLIC dynamic entry. + (elf_adjust_dynamic_symbol): If -Bsymbolic, don't require a PLT + entry for a locally defined symbol. + * elf32-i386.c (elf_i386_relocate_section): If -Bsymbolic, do warn + about undefined symbols, and fill in the GOT entry for a symbol + defined in a regular object file. + (elf_i386_finish_dynamic_symbol): If -Bsymbolic, output a RELATIVE + reloc rather than a GLOB_DAT reloc for a symbol defined in a + regular object file. + * elf32-m68k.c (elf_m68k_relocate_section): If -Bsymbolic, do warn + about undefined symbols, and fill in the GOT entry for a symbol + defined in a regular object file. + (elf_m68k_finish_dynamic_symbol): If -Bsymbolic, output a RELATIVE + reloc rather than a GLOB_DAT reloc for a symbol defined in a + regular object file. + * elf32-sparc.c (elf32_sparc_relocate_section): If -Bsymbolic, do + warn about undefined symbols, and fill in the GOT entry for a + symbol defined in a regular object file. + (elf32_sparc_finish_dynamic_symbol): If -Bsymbolic, output a + RELATIVE reloc rather than a GLOB_DAT reloc for a symbol defined + in a regular object file. + + * config/m68k-coff.mt (SELECT_VECS): Rename from SELECT_VECTORS. + Correct elements to be actual BFD vector names. + + * Makefile.in (Makefile): Don't depend upon @frags@. + (config.status): Depend upon @frags@. + +Fri Jul 7 17:36:44 1995 Ian Lance Taylor + + * coffgen.c (coff_renumber_symbols): Sort defined symbols that are + neither BSF_FUNCTION not BSF_NOT_AT_END just before undefined + symbols. + * coffcode.h (coff_slurp_symbol_table): Set BSF_FUNCTION as well + as BSF_NOT_AT_END. + +Fri Jul 7 17:16:15 1995 Ken Raeburn + + * Makefile.in (do_mostlyclean): Remove config.log. + (do_distclean): Remove config.cache. + +Thu Jul 6 14:37:43 1995 Ian Lance Taylor + + * elf32-i386.c (elf_i386_relocate_section): Revert May 24 patch. + Don't copy PC32 reloc against section into shared object. + + * Makefile.in: Rebuild dependencies. + (CFILES): Added elflink.c. + (Makefile): Depend upon config.status, not configure.in. + (config.status): New target; depend upon configure configure.host + and config.bfd. + +Wed Jul 5 20:17:14 1995 Ken Raeburn + + * elfcore.h, elflink.h, elfcode.h, elf.c, elflink.c: Moved some + primarily size-independent code from elfcode.h to elf.c and new + file elflink.c; moved out other core- or linker-related routines + into other new .h files for clarity. Renamed many routines to + start with bfd_elf or _bfd_elf. Added a structure of + size-dependent but target-independent info to elfcode.h. + * Makefile.in: Build elflink.o. Update dependencies. + * libelf.h: Updated some declarations. Added a definition for the + new structure in elfcode.h. Added more fields to elf backend data + structure. + * elfxx-target.h: Refer to the appropriate size-dependent info. + * elf32-*.c: Changed some function names. Moved common + create_dynamic_sections code from m68k, sparc, and i386 support + into elflink.c. Define some new macros to fill in new fields of + back end data. Also clean up some "gcc -Wall" warnings regarding + unused or uninitialized variables. + + * Makefile.in (BFD_LIBS): No, don't put elflink.o here. + * configure.in: Include it here whenever elf.o is specified. + +Wed Jul 5 10:31:47 1995 Ian Lance Taylor + + * elf32-mips.c (mips_elf_object_p): Unconditionally set + elf_bad_symtab, since sometimes the symbol table is messed up and + the last symbol is global. + + * ecoff.c (_bfd_ecoff_bfd_is_local_label): New function. + * libecoff.h (_bfd_ecoff_bfd_is_local_label): Declare. + * elf32-mips.c (mips_elf_is_local_label): New static function. + (bfd_elf32_bfd_is_local_label): Define. + + * configure.in: Use $ac_config_sub, not $configsub. + * configure: Likewise. + + Permit --enable-targets=ieee: + * config.bfd (*-*-ieee*): New target. + * config/ieee.mt: New file. + +Wed Jul 5 04:16:35 1995 Ken Raeburn + + * config/i386aix.mh (HDEFINES): Remove -DFASCIST_FDOPEN. + + Autoconfiscation: + * configure.in, Makefile.in, doc/Makefile.in: Switch from Cygnus + configure to autoconf ways of processing --enable arguments, + setting up symlinks, incorporating makefile fragments, printing + messages at configuration time, setting variables in Makefile. + Deleted some unused variables. Check for ranlib via autoconf. + For now, configure script removes doc/config.status. + * configure: New file. + * dep-in.sed: Use @SRCDIR@ instead of @srcdir@, so Makefile.in + line doesn't get broken by configure. + * doc/configure.in: Removed. + +Tue Jul 4 12:22:21 1995 Ian Lance Taylor + + * archive.c (_bfd_construct_extended_name_table): If + BFD_TRADITIONAL_FORMAT is set, limit the length of all file names + to ar_max_namelen. + (bfd_dont_truncate_arname): If BFD_TRADITIONAL_FORMAT is set, call + bfd_bsd_truncate_arname. + (_bfd_write_archive_contents): Revert June 1 change. + + * elfcode.h (NAME(bfd_elf,record_link_assignment)): Add provide + argument. + * bfd-in.h (bfd_elf32_record_link_assignment): Update prototype. + (bfd_elf64_record_link_assignment): Likewise. + * bfd-in2.h: Rebuild. + + * libelf.h (struct elf_link_hash_table): Add needed field. Remove + saw_needed field. + * elfcode.h (elf_link_add_object_symbols): If elf_dt_needed_name + is an empty string, don't make a DT_NEEDED entry in the output + file. Record all DT_NEEDED entries found in input dynamic + objects. + (elf_link_output_extsym): Don't check saw_needed when issuing + warnings. + * elf.c (_bfd_elf_link_hash_table_init): Initialize needed, not + saw_needed. + (bfd_elf_get_needed_list): New function. + * bfd-in.h (struct bfd_elf_link_needed_list): Define. + (bfd_elf_get_needed_list): Define. + * bfd-in2.h: Rebuild. + + * ecoff.c (_bfd_ecoff_find_nearest_line): Also initialize + find_buffer and fdrtab_len fields of newly allocated + find_line_info structure. + +Mon Jul 3 17:03:52 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (hppa_som_gen_reloc_type): New argument "sym_diff", + nonzero when we're generating relocations for an expression + using the difference of two symbols. All callers changed. + Handle difference of symbols for both R_HPPA and R_COMPLEX + cases. + (som_write_fixups): Handle R_COMP1, R_COMP2 and R_CODE_EXPR + fixups. + +Mon Jul 3 13:55:18 1995 Steve Chamberlain + + * config.bfd (win32): New configuration. + * configure.host (pe): Changed to i386win32. + * config/i386pe.mh: Deleted. + * config/i386win32.mh: New file. + +Mon Jul 3 11:30:45 1995 Ian Lance Taylor + + * ecoff.c (_bfd_ecoff_find_nearest_line): If we allocate + find_line_info, clear the fdrtab field. + + * targets.c (enum bfd_flavour): Add bfd_target_msdos_flavour here, + rather than in bfd-in2.h. + + * bfd.c (enum bfd_error): Define bfd_error_no_armap. + (bfd_errmsgs): Add string for bfd_error_no_armap. + * bfd-in2.h: Rebuild. + * ecoff.c (ecoff_link_add_archive_symbols): If an archive has no + armap, set bfd_error_no_armap rather than bfd_error_no_symbols. + * elfcode.h (elf_link_add_archive_symbols): Likewise. + * linker.c (_bfd_generic_link_add_archive_symbols): Likewise. + + * elfcode.h (elf_link_add_object_symbols): Permit common and + indirect symbols in weakdefs BFD_ASSERT. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Simplify + BFD_ASSERT to permit some legal, but odd, cases. + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise. + * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise. + + * Makefile.in: Rebuild dependencies. + (BFD32_BACKENDS): Add versados.o. + (CFILES): Add pe-i386.c, pei-i386.c, and versados.c. + +Sun Jul 2 17:49:32 1995 Ian Lance Taylor + + * cofflink.c (_bfd_coff_generic_relocate_section): Cast base_file + to FILE * before using it. + * stab-syms.c: Revert yesterday's patch. + +Sat Jul 1 12:10:42 1995 Fred Fish + + * stab-syms.c (stdio.h): Include prior to libaout.h, which + includes bfdlink.h, which now uses FILE. + +Sat Jul 1 00:11:08 1995 Ken Raeburn + + * elfxx-target.h: New file. + + * libelf.h (struct elf_backend_data): Remove elf_64_p field. + * elfxx-target.h (elfNN_bed): Don't set it. + + * elf32-target.h, elf64-target.h: Deleted. + * Makefile.in (elf32-target.h, elf64-target.h): Build them from + elfxx-target.h. + +Fri Jun 30 16:07:18 1995 Steve Chamberlain + + * cofflink.c (_bfd_coff_generic_relocate_section): Compare + the full text of .reloc or .edata section names. + +Fri Jun 30 15:47:37 1995 Fred Fish + + * cofflink.c (_bfd_coff_generic_relocate_section): + Remove extra '+'. + +Thu Jun 29 17:24:52 1995 Steve Chamberlain + + * coff-h8300.c (COFF_LONG_FILENAMES): Define. + +Wed Jun 28 18:04:42 1995 Steve Chamberlain + + * Makefile.in: versados.o is now conditionally built. + * coffcode.h (add_data_entry): New function. + (coff_write_object_contents): Clean up. Calculate + data entries. + * cofflink.c (_bfd_coff_generic_relocate_section): + .reloc and .edata sections are IMAGE_BASED too. + If there's a base_file then write out base information. + * configure.host (i386-*-pe): New. + * syms.c (coff_section_type): Only scan prefixes. + * targets.c (bfd_target_vector): Versados is now conditionally + built. + * config/m68k-coff.mt: Build versados.o + * hosts/i386pe.h: New file. + +Mon Jun 26 13:53:49 1995 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hpa.c (elf32_hppa_relocate_section): Close comment before + R_PARISC_DPREL21L handling. + +Thu Jun 22 19:28:36 1995 Ken Raeburn + + Sun May 7 11:53:41 MDT 1995 Bryan Ford + + * config/i386-moss.mt: created. + +Thu Jun 22 08:56:10 1995 Steve Chamberlain + + * reloc.c (bfd_perform_relocation): Add case for -ve words. + +Wed Jun 21 13:13:49 1995 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (elf32_hppa_relocate_section): Don't try to apply a + relocation against an undefined symbols. + +Wed Jun 21 10:16:10 1995 Steve Chamberlain + + * versados.c: Second pass/rewrite. + +Mon Jun 19 08:40:45 1995 Steve Chamberlain + + * syms.c (coff_section_type): Compare only the front part + of a section name. + +Sat Jun 17 09:40:44 1995 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (elf32_hppa_size_stubs): Set the size of the stub + section if we get an error. + + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Don't mess + with the operands of an R_PARISC_DPREL21L relocation if the insn + is not "addil ,%r27". + +Fri Jun 16 15:04:47 1995 Stan Shebs + + * bfd-in.h (NT_subsystem, NT_stack_heap): Declare but don't + define. + * bfd-in2.h: Rebuilt. + * bfd.c (NT_subsystem, NT_stack_heap): Define. + +Fri Jun 16 00:07:25 1995 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (elf32_hppa_bfd_link_link_relocate): Use the right + type field (there are two!) when checking to see if $global$ is + defined. + +Thu Jun 15 14:03:47 1995 Stan Shebs + + * bfd-in.h, bfd-in2.h (bfd_boolean): Rename bfd_true, bfd_false + to bfd_tttrue, bfd_fffalse so as not to conflict with functions. + * coffswap.h (coff_swap_scnhdr_out): Remove version that was + hacked for MPW C. + * mpw-config.in: Set shell vars instead of pasting to makefile + for each configuration, edit coffswap.h to make MPW C not choke. + (i386-unknown-coff, sh-hitachi-hms): Recognize. + * mpw-make.in (BFD_LIBS): Add versados.c.o. + + * versados.c (versados_scan): Properly cast results from bfd_alloc. + +Wed Jun 14 15:27:32 1995 Steve Chamberlain + + * cofflink.c (process_embedded_commands): New function + reads and handles .drectve sections for PE. + (coff_link_input_bfd): Call new function if PE. + +Mon Jun 12 12:09:39 1995 Jeff Law (law@snake.cs.utah.edu) + + * bfd-in.h (bfd_set_section_vma): Case true to a boolean. + (bfd_set_cacheable): Likewise. + * bfd-in2.h: Rebuilt. + +Fri Jun 9 12:20:28 1995 Steve Chamberlain + + * elfcode.h (elf_sort_hdrs): Rewrite to be symmetrical. + +Fri Jun 9 12:49:00 1995 Jeff Law (law@snake.cs.utah.edu) + + * targets.c: Add copy_private_symbol_data and link_split_section + to the target vector. + * libbfd-in.h (_bfd_generic_bfd_copy_private_symbol_data): Define. + (_bfd_nolink_bfd_link_split_section): Likewise. + (bfd_generic_link_split_section): Declare. + * syms.c (bfd_copy_private_symbol_data): Define. + * linker.c (bf_link_split_section): Likewise. + * som.c (som_bfd_copy_private_symbol_data): New function + (som_bfd_link_split_section): Likewise. + * All other targets updated with default versions of new routines. + + * Take out my braindamaged bfd_true/bfd_false changes from earlier + today. Replace with just: + * bfd-in.h: (TRUE_FALSE_ALREADY_DEFINED): Define this if + compiling with g++-2.6 or later. + * bfd-in2.h: Rebuilt. + +Fri Jun 9 07:54:29 1995 Steve Chamberlain + + * versados.c (struct esd, get_4): Lint; use unsigned chars. + + * coff-i960.c (coff_i960_relocate): Compare output section names + when converting for vxworks. + +Wed Jun 7 19:01:30 1995 Ken Raeburn + + * elfcode.h (elf_fake_sections): Permit .scommon or COMMON + sections as random SHT_NOBITS sections, in case a linker script is + strange. + +Tue Jun 6 17:29:32 1995 Steve Chamberlain + + * bfd-in.h (NT_subsystem, NT_stack_heap): Moved from pe.h + * coff-i386.c (coff_i386_rtype_to_howto): Get PE relocs right. + * coffcode.h (coff_mkobject): Set pe tdata bit when using PE. + * cofflink.c (COFF_WITH_PE code): Test on obj_pe bit rather + than conditional compile. + * configure.in: Fix PE dependencies. + * libcoff-in.h (obj_pe): New. + (coff_tdata): Added pe entry. + * libcoff.h: Regenerated. + +Mon Jun 5 09:07:13 1995 Steve Chamberlain + + * coff-a29k.c (coff_a29k_adjust_symndx): Completely parenthesize + macro. + +Mon Jun 5 02:15:20 1995 Ken Raeburn + + Linker support for m68k-elf from Andreas Schwab + : + * elfcode.h (elf_link_add_object_symbols): Check for NULL when + looping through the symbol hashes. + (elf_bfd_final_link): When looking for _init and _fini don't use + the symbol if it is imported from another object. + * elf32-m68k.c: Relocation type changed from REL to RELA. Regular + and dynamic linking support functions added, similar to other elf + targets. + + * config.bfd (i[345]86-*-gnu*): Use ELF configuration. + +Fri Jun 2 18:54:59 1995 Steve Chamberlain + + * versados.c: New file. + * bfd-in2.h (struct _bfd): New field. + * bfd.c (struct _bfd): New field. + * configure.in (versados_vec): New field. + * targets.c (bfd_flavor): Added versados. + +Thu Jun 1 13:51:49 1995 Steve Chamberlain + + * coffcode.h (sec_to_styp_flags, styp_to_sec_flags, + coff_new_section_hook): Any section that starts ".stab" + is now marked as debugging. + +Thu Jun 1 16:15:16 1995 Ken Raeburn + + * archive.c (_bfd_write_archive_contents): Disable extended name + table until it can be made optional, so that native AR has half a + chance on SunOS and HP/UX. + + * linker.c (_bfd_generic_link_output_symbols, case + bfd_link_hash_indirect): Add cast to correct pointer types. + +Sat May 27 21:37:31 1995 J.T. Conklin + + * config.bfd (m68k-bull-sysv*): Added strip_underscore=yes. + (m68k-est-coff): Removed. target does not effect object format. + +Wed May 24 10:52:01 1995 Steve Chamberlain + + * linker.c (_bfd_generic_link_output_symbols): Cope with + indirect symbols. + + * elf32-i386.c (elf_i386_relocate_section): Give error + message when linking to a shared reloc which isn't there. + +Wed May 24 10:40:00 1995 Steve Chamberlain + + Support for ARM-PE. + + * Makefile.in, coffcode.h, config.bfd, configure.in, pe-arm.c, + pei-arm.c, coff-arm.c, reloc.c, targets.c, config/arm-pe.mt: + Support for ARM COFF/PE. + +Tue May 23 19:24:58 1995 Ken Raeburn + + * bfd.c (bfd_get_relocated_section_contents): Now a function, + tries calling routine from input bfd target vector for + bfd_indirect_link_order. Put a declaration into the header file. + * bfd-in2.h: Regenerated. + * elf32-mips.c (gprel16_with_gp): New function, split out from + mips_elf_gprel16_reloc. + (mips_elf_gprel16_reloc): Call it. If output bfd target vector + isn't elf flavoured, abort, since it's assumed to be elf in some + of this code, including the code that looks up the gp value. + (elf32_mips_get_relocated_section_contents): New function, + modified from bfd_generic_get_relocated_section_contents to deal + with passing gp to gprel16_with_gp. + (bfd_elf32_bfd_get_relocated_section_contents): New macro. + * elf32-target.h (bfd_elf32_bfd_get_relocated_section_contents): + Don't define if already defined. + +Tue May 23 15:58:15 1995 Jeff Law (law@snake.cs.utah.edu) + + * Makefile.in: Install bfdlink.h too. + +Sun May 21 22:25:09 1995 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (elf32_hppa_relocate_section): Handle undefined and + notsupported return codes from final_link_relocate (used when + $global$ is undefined or nonexistant). + (elf32_hppa_bfd_link_link_relocate): If $global$ exists, but is + not defined,then return bfd_reloc_undefined. + +Fri May 19 10:00:14 1995 Steve Chamberlain + + * coffswap.h: (IMAGE_BASE): Define to 0 if not. + +Thu May 18 04:24:01 1995 Ken Raeburn + + Wed May 10 14:28:16 1995 Richard Earnshaw (rearnsha@armltd.co.uk) + + * aoutx.h (aout_link_input_section_standard): If defined, call + MY_relocatable_reloc before doing a partial relocation. + + * aout-arm.c: (WRITE_HEADERS): Delete. + (NAME): Define version to override default in aoutx.h + (MY(howto_table)): Reformat. Alter some entries slightly. + (RELOC_ARM_BITS_NEG_{BIG,LITTLE}): Define. + (MY(reloc_howto), MY(put_reloc), MY(relocatable_reloc)): New functions. + (MY_reloc_howto, MY_put_reloc, MY_relocatable_reloc): Define. + (MY(fix_pcrel_26)): Renamed from aoutarm_fix_pcrel_26, return + bfd_reloc_ok not bfd_reloc_continue. + (MY(fix_pcrel_26_done)): Likewise. + (MY(bfd_reloc_type_lookup)): Renamed from aoutarm_reloc_type_lookup. + (MY_bfd_link_hash_table_create, MY_bfd_link_add_symbols, + MY_bfd_final_link): Delete. + (MY_swap_std_reloc_in, MY_swap_std_reloc_out, MY_get_section_contents): + Define. + (aoutx.h): Include it. + (MY(swap_std_reloc_{in,out})): New functions. + Use RELOC_ARM_BITS_NEG_{BIG,LITTLE} to extract negative reloc bit. + (aoutarm_squirt_out_relocs): Delete. + + From: David Taylor (dtaylor@armltd.co.uk) + * config/arm[lb]-aout.mt: New files. + * aout-arm.c: New file. + * config.bfd: Handle arm{,e[lb]}-*-aout + * configure.in: Add vetor for aout_arm_{big,little}_vec. + * reloc.c: New relocation types for the ARM. + * targets.c (aout_arm_{big,little}_vec): declare. + +Tue May 16 10:29:51 1995 Jim Kingdon + + * libbfd.c (bfd_stat): If bfd_cache_lookup returns an error, + return an error to the caller. Call bfd_set_error on errors. + +Tue May 16 14:44:45 1995 Ken Raeburn + + * libcoff-in.h (coff_renumber_symbols): Modified prototypes in + accordance with 11 May libcoff.h change. + +Thu May 11 16:43:14 1995 Steve Chamberlain + + tekhex.c (first_phase): Understand type 0 symbols. + (tekhex_write_object_contents): Fix typo in final record. + +Thu May 11 16:43:14 1995 Steve Chamberlain + + * coff-i960.c (optcall_callback): don't try and optimize + undefined refs. + (coff_write_relocs): Search for broken relocs on the way + out and fix them up. + (coff_renumber_symbols): Calculate and return index of + first undefined symbol. + (coff_write_object_contents): Call coff_renumber_symbols + and coff_write_relocs with the new args. + * libcoff.h: (coff_renumber_symbols, coff_renumber_symbols): + Modified prototypes. + +Thu May 11 16:43:14 1995 Steve Chamberlain + Tom Griest + + Initial support for PE format. + + * Makefile.in, targets.c, configure.in, config.bfd: + Add support for i386-*-winnt and i386-*-pe. + * archive.c (do_slurp_coff_armap): Understand NTPE format + archives. + (_bfd_slurp_extended_name_table): Turn \ in a filename + into /. + * bfd-in.h (bfd_link_subsystem, _bfd_link_stack_heap): New. + * coff-i386.c (howto_table): Conditionalize PCRELOFFSET. + * coffcode.h (IMAGE_BASE): New. + (coff_compute_section_file_positions): Throw away .junk + sections for PE, align symbols. + (coff_write_object_contents): Throw away .junk sections + for PE. Remember info on .idata and .rsrc sections. + Fill in the PE header. + (coff_slurp_symbol_table): PE uses C_SECTION class. + * cofflink.c (_bfd_coff_final_link): Keep PE info up to date. + (_bfd_coff_generic_relocate_section): Cope with PE relocs. + * coffswap.h (coff_swap_{aout/file/scn/sym}hdr_{in/out}): + New code for PE headers. + +Tue May 9 17:01:38 1995 Michael Meissner + + * config.bfd: Add little endian PowerPC support. + * configure.in: Ditto. + * targets.c: Ditto. + * config/ppcle-elf.mt: New file, for little endian PowerPC + support. + * config/ppc-elf.mt: Add little endian powerpc to the BFD + selection vectors. + * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Complain if + linking a different endian object than we expect. + (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Define, to provide little + endian support. + +Tue May 2 16:32:24 1995 Jeff Law (law@snake.cs.utah.edu) + + * config.bfd (hppa*-*-lites*): Treat just like hppa*-*-*elf*. + +Tue Apr 25 19:38:43 1995 Ken Raeburn + + * coffgen.c (make_a_section_from_file): Initialize lma same as + vma. + +Tue Apr 25 11:03:21 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * hosts/std-host.h: #include ansidecl.h 'cause PTR is used in + std-host.h. + +Mon Apr 24 23:56:44 1995 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * hosts/i386linux.h (HAVE_PROCFS): Don't define it. Added lengthy + comment explaining why. + +Mon Apr 24 10:34:02 1995 Michael Meissner + + * hosts/i386linux.h (HAVE_PROCFS): If NO_PROCFS is defined, don't + define HAVE_PROCFS. + +Mon Apr 24 08:33:12 1995 Michael Meissner + + * elf32-ppc.c (ppc_elf_relocate_section): Do not continue + processing unknown symbols to prevent a cascade of errors. + +Fri Apr 21 12:48:48 1995 Ken Raeburn + + Patches from H.J. Lu for Linux ELF core file support. + * elfcode.h (elf_core_file_matches_executable_p) [HAVE_PROCFS]: + Use prpsinfo_t instead of struct prpsinfo, for consistency. + * hosts/i386linux.h (HAVE_PROCFS): Define. + +Thu Apr 20 09:07:39 1995 Steve Chamberlain + + * linker.c (link_action): Do the right thing when a undefined + strong symbol appears after an undefined weak symbol. + +Fri Apr 14 16:51:17 1995 Michael Meissner + + * elf32-ppc.c (ppc_elf_relocate_section): New function to relocate + a whole section for the linker, bypassing bfd_perform_relocation. + (ppc_elf_reloc_type_lookup): New function to map the BFD + enumeration code into a howto structure. + (ppc_elf_howto_raw): Rename from ppc_elf_howto_table. + (ppc_elf_howto_table): New array that maps PowerPC relocation + numbers to howto structures without a linear search. Change from + using bfd_elf_generic_reloc to use ppc_elf_std_reloc. + (ppc_elf_howto_init): Initialize ppc_elf_howto_table from + ppc_elf_howto_raw. + (ppc_elf_reloc_type_lookup): Use a case statement instead of a + loop. + (ppc_elf_std_reloc): Replacement for bfd_elf_generic_reloc. + (ppc_elf_unsupported_reloc): Print a real error message, instead + of calling abort. + (ppc_elf_addr16_ha_inner): Abstract getting adjustment from + ppc_elf_addr16_ha_reloc, so ppc_elf_relocate_section can use it + too. + (ppc_elf_addr16_ha_reloc): Call it. + (ppc_elf_got16_inner): Abstract getting adjustment from + ppc_elf_got16_reloc, so ppc_elf_relocate_section can use it too. + (ppc_elf_got16_reloc): Call it. + (ppc_elf_info_to_howto): Rename from powerpc_info_to_howto. + + * elfcode.h (elf_symbol_from_bfd_symbol): Omit space in debugging + output. + (elf_symbol_flags): Add debug function to decode flags so that + defining DEBUG to be 4 will compile again. + (elf_debug_section): Fix typo in debug output. + +Fri Apr 14 16:03:04 1995 Ken Raeburn + + * config.bfd: Add m68*-*-elf*. + * elf32-m68k.c: Filled out implementation, except for dynamic + linking support. + * reloc.c (enum bfd_reloc_code_real): Added *_GOT_PCREL, *_GOTOFF, + *_PLT_PCREL, *_PLTOFF, *_68K_* relocations for ELF. + * libbfd.h, bfd-in2.h: Regenerated. + +Thu Apr 13 14:28:04 1995 Torbjorn Granlund + + * coff-m68k.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): Change from + 1 to 2. + (bfd_target): Change minimum section alignment from 1 to 2. + +Wed Apr 12 12:40:04 1995 Ken Raeburn + + * aoutx.h (machine_type, case bfd_arch_mips): Treat R8000 like + R6000 and R4000 for now. + +Tue Apr 4 12:28:25 1995 Stan Shebs + + * mpw-config.in: New file, MPW version of configure.in. + * mpw-make.in: New file, MPW version of Makefile.in. + * hosts/mpw.h: New file, MPW host definitions. + * ecoffswap.h (ecoff_swap_pdr_in, ecoff_swap_pdr_in) [MPW_C]: + Alternate versions without ECOFF_64 that chokes MPW C. + * coffswap.h (coff_swap_scnhdr_out): Add alternative version with + partly-expanded macros. + +Thu Mar 30 14:56:21 1995 Ian Lance Taylor + + * reloc.c (bfd_perform_relocation): Don't bother to check for + overflow if the symbol is undefined. + +Thu Mar 30 14:32:26 1995 H.J. Lu (hjl@nynexst.com) + + * config.bfd: Change linux to default to elf. Using + i[345]86-*-linuxaout will build a library which defaults to a.out. + * config/i386-laout.mt: Rename from old config/i386-linux.mt. + * config/i386-linux.mt: Rename from old config/i386-lelf.mt. + Comment out EXTRALIBS. + * config/i386-lelf.mt: Remove. + +Wed Mar 29 12:01:30 1995 Ian Lance Taylor + + * coff-i960.c (coff_i960_relocate): Cache the section symbol in + the used_by_bfd field of the section, to avoid looping for each + reloc. + + * cpu-h8500.c (arch_info_struct): Change name from "H8/300" to + "h8300" for consistency with other cpu-* files. + +Tue Mar 28 15:14:11 1995 Ian Lance Taylor + + * bout.c (b_out_canonicalize_reloc): Handle SEC_CONSTRUCTOR + sections. + (b_out_get_reloc_upper_bound): Likewise. + + * linker.c (generic_link_add_symbol_list): Skip constructor + symbols which the main linker code did not do anything with. + (_bfd_generic_link_output_symbols): Use udata.p if it is set, + rather than looking the symbol up in the hash table. Just pass + through constructor symbols for which udata.p is not set. If the + linker defined the symbol, clear the constructor flag. + +Tue Mar 21 10:50:32 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_set_reloc_info): Sign extend constants from + R_DATA_OVERRIDE fixups. + * libhppa.h (sign_extend): Renamed from sign_ext. Fix. + (low_sign_extend): Likewise. + +Mon Mar 20 22:39:10 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_slurp_symbol_table): Tighten test to determine + what symbols are section symbols. + +Sat Mar 18 01:54:45 1995 Ian Lance Taylor + + * elfcode.h (elf_bfd_link_add_symbols): An empty archive is OK. + +Fri Mar 17 16:29:02 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_copy_private_section_data): Just return true when + either the input or output section isn't attached to a SOM BFD. + (som_bfd_copy_private_bfd_data): Similarly for BFD private data. + +Fri Mar 17 11:50:34 1995 Ian Lance Taylor + + * elfcode.h (elf_link_add_object_symbols): Check whether a dynamic + object has already been included, and ignore it the second time. + +Wed Mar 15 11:56:40 1995 Ian Lance Taylor + + * elf32-sparc.c (elf_sparc_howto_table): Change R_SPARC_GOT13 from + complain_overflow_bitfield to complain_overflow_signed. + + * libelf.h (bfd_elf32__write_relocs): Don't declare. + (bfd_elf64__write_relocs): Don't declare. + +Tue Mar 14 05:54:33 1995 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * stab-syms.c (aout_stab_name): Moved aout_stab_names to be local + to this function. Recoded function to stop using table, to + improve performance (on i486-netbsd host). Left old version + intact under "#if 0" for further performance testing. + +Mon Mar 13 13:48:49 1995 Ian Lance Taylor + + * elfcode.h (write_relocs): Make static. Use PTR argument as a + pointer to a boolean variable set to true if something fails. + Cast to PTR rather than void *. + (sym_is_global): Rewrite for clarity. + (map_program_segments): If the program header size is too small, + call _bfd_error_handler and return failure rather than aborting. + (NAME(bfd_elf,write_object_contents)): Pass boolean variable when + calling write_relocs. + (elf_symbol_from_bfd_symbol): Use BFD_ASSERT rather than abort. + (struct elf_info_failed): Define. + (NAME(bfd_elf,size_dynamic_sections)): Declare variables in inner + blocks. Pass elf_info_failed structure when calling + elf_export_symbol and elf_adjust_dynamic_symbol. + (elf_export_symbol): Treat data argument as elf_info_failed rather + than bfd_link_info. Set failed field on error. + (elf_adjust_dynamic_symbol): Likewise. + (struct elf_finfo_failed): Define. + (elf_bfd_final_link): Pass elf_finfo_failed structure when calling + elf_link_output_extsym. Use BFD_ASSERT rather than abort. + (elf_link_output_extsym): Treat data argument as elf_finfo_failed + rather than elf_final_link_info. Set failed field on error. + (elf_link_input_bfd): Use BFD_ASSERT rather than abort. + (elf_reloc_link_order): Likewise. + + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Only write + out PLTRELSZ, PLTREL and JMPREL relocs if there is a .rela.plt + section. Solaris 2.4 apparently does not handle empty reloc + information correctly. + + * archive.c (bsd_write_armap): Cast getuid and getgid results to + long, and print with %ld. + +Fri Mar 10 16:41:05 1995 Ian Lance Taylor + + * aoutx.h (translate_to_native_sym_flags): Always use the output + section if it is not NULL. + +Thu Mar 9 15:06:25 1995 Ian Lance Taylor + + * coffswap.h (coff_swap_scnhdr_out): If the line number count or + the reloc count does not fit, print an error and return 0. + * coffcode.h (coff_write_object_contents): Check return value of + coff_swap_scnhdr_out. + * ecoff.c (_bfd_ecoff_write_object_contents): Check return value + of bfd_coff_swap_scnhdr_out. + + * bfd.c: Include or , depending upon + ANSI_PROTOTYPES. + (bfd_error_handler_type): New global type. + (_bfd_error_program_name): New static variable. + (_bfd_default_error_handler): New static function. + (_bfd_error_handler): New BFD private global variable. + (bfd_set_error_handler): New globally visible function. + (bfd_set_error_program_name): New globally visible function. + * libbfd-in.h (_bfd_error_handler): Declare. + * bfd-in2.h, libbfd.h: Rebuild. + + * aoutx.h (NAME(aout,swap_ext_reloc_in)): Add symcount parameter, + and use it instead of bfd_get_symcount. Check r_index after + setting r_extern based on whether this is a base relative reloc. + (NAME(aout,swap_std_reloc_IN)): Add symcount parameter, and use it + instead of bfd_get_symcount. + (NAME(aout,slurp_reloc_table)): Pass bfd_get_symcount to reloc + swap routines. + * libaout.h (NAME(aout,swap_ext_reloc_in)): Add symcount parameter + to declaration. + (NAME(aout,swap_std_reloc_in)): Likewise. + * sunos.c (sunos_canonicalize_dynamic_reloc): Pass + info->dynsym_count to reloc swap routines. + * aout-ns32k.c (MY_swap_std_reloc_in): Add symcount parameter. + * hp300hpux.c (MY(swap_std_reloc_in)): Likewise. + (MY(slurp_reloc_table)): Pass bfd_get_symcount to reloc swap + routine. + * i386lynx.c (NAME(lynx,swap_ext_reloc_in)): Add symcount + parameter. + (NAME(lynx,swap_std_reloc_in)): Likewise. + (NAME(lynx,slurp_reloc_table)): Pass bfd_get_symcount to reloc + swap routines. + +Thu Mar 9 12:04:05 1995 Michael Meissner + + * bfd.c (bfd_merge_private_bfd_data): New function vector to be + called by the linker to merge any private bfd data of the input + files and the output file. Used by the PowerPC ELF support to + check whether -mrelocatable is used for all modules. + (bfd_set_private_flags): New function vector to be called by the + assembler to set private flags. Used by the PowerPC ELF support + to set that a particular object file was assembled with the + -mrelocatable option. + + * targets.c (BFD_JUMP_TABLE_COPY): Add intiialization of the + bfd_merge_private_bfd_data and bfd_set_private_flags function + vectors. + + * bfd-in2.h, libbfd-in.h: Rebuild with bfd.c and targets.c + changes. + + * elf32-ppc.c (ppc_elf_set_private_flags): New function to set the + ELF e_flags field. + (ppc_elf_copy_private_bfd_data): Copy the e_flags field from the + input file to the output file. + (ppc_elf_merge_private_bfd_data): Check for a mismatch between the + e_flags field of all of the linker input files. + + * libelf.h (elf_obj_tdata): Add ppc_flags_init field so that the + PowerPC support can check if compataible e_flags are present. + + * aout-target.h: Add NOP for the bfd_merge_private_bfd_data + and bfd_set_private_flags function vectors. + * coffcode.h: Ditto. + * elf32-target.h: Ditto. + * elf64-target.h: Ditto. + * libbfd.h: Ditto. + * libecoff.h: Ditto. + * som.c: Ditto. + +Wed Mar 8 00:53:54 1995 Ian Lance Taylor + + * cpu-mips.c (arch_info_struct): Add mips:8000 entry. + + * elfcode.h (swap_out_syms): Mark an undefined BSF_WEAK symbol as + STB_WEAK rather than STB_GLOBAL. + +Tue Mar 7 12:23:47 1995 Ian Lance Taylor + + * coffcode.h (bfd_coff_backend_data): Add new field + _bfd_coff_adjust_symndx. + (bfd_coff_adjust_symndx): Define. + (coff_adjust_symndx): Define as NULL if not already defined. + (bfd_coff_std_swap_table): Initialize new field to + coff_adjust_symndx. + * cofflink.c (coff_link_input_bfd): Call coff_adjust_symndx if it + is defined. + * coff-a29k.c (coff_a29k_adjust_symndx): New static function. + (coff_adjust_symndx): Define before including coffcode.h. + * libcoff.h: Rebuild. + + * format.c (bfd_check_format_matches): Skip binary_vec when + searching through bfd_target_vector. + + * elfcode.h (elf_sort_hdrs): Check SHT_NOBITS before checking + sh_size. + +Mon Mar 6 23:31:36 1995 Doug Evans + + * elfcode.h (elf_sort_hdrs): Keep SHT_NOBITS sections after + !SHT_NOBITS ones. + +Mon Mar 6 09:53:08 1995 Jeff Law (law@snake.cs.utah.edu) + + * cpu-hppa.c (arch_info_struct): Support both PA1.0 and PA1.1 + machine types. + (bfd_hppa_arch): Link in both PA1.0 and PA1.1 architecture info + structures. + * libhppa.h (enum pa_arch): New enumeration to describe the + different variants of the PA architecture. + * som.c (som_object_setup): Use new enumeration to set machine + type. + (som_finish_writing): If the machine type is PA1.1, then use the + PA1.1 machine identifier in the output file. + +Thu Mar 2 15:58:24 1995 Ian Lance Taylor + + * aoutx.h (NAME(aout,swap_ext_reloc_in)): Treat the index of a + base relative reloc as an index into the symbol table, regardless + of the setting of r_extern. + (NAME(aout,swap_std_reloc_in)): Likewise. + + * aoutx.h (NAME(aout,set_section_contents)): Double check that the + caller is writing to a valid section. + +Thu Mar 2 14:37:57 1995 Bryan Ford + + * binary.c: Add support for reading binary files. Loads the raw + contents of the file into a data section and wraps some symbols + around it. The symbols `_binary__start' and + `_binary__end' indicate the start and end of the data, + while `_binary__size' is an absolute symbol whose value + is the size of the data. is the name of the binary + input file, with all non-alphanumeric characters converted to + underscores. + + * archures.c (bfd_arch_get_compatible): Assume users knows what + they're doing if one of the architectures is bfd_arch_unknown. + +Wed Mar 1 17:30:46 1995 Michael Meissner + + * elf32-ppc.c (elf_powerpc_howto_table): For relocation + R_PPC_GOT16, change complain_on_overflow to be + complain_overflow_signed. + +Wed Mar 1 11:52:55 1995 Jason Molenda + + * configure.host: Recognize powerpc-*-aix*. + +Wed Mar 1 11:57:39 1995 Ian Lance Taylor + + * coff-i960.c (COFF_PAGE_SIZE): Define. + + * configure.in: Rewrite output of TDEFAULTS to avoid relying on + semantics of single quotes in parameter substitution. + +Tue Feb 28 12:53:09 1995 Ian Lance Taylor + + * elfcode.h (elf_sort_hdrs): Sort empty sections before non-empty + sections, if they have the same VMA. + + * config.bfd (i[345]86-*-linuxelf*): New target. Use i386-lelf. + (i[345]86-*-gnuelf*): New target. Use i386-gelf. + * config/i386-lelf.mt: New file. + * config/i386-gelf.mt: New file. + +Mon Feb 27 12:58:25 1995 Kung Hsu + + * config.bfd: add a29k-*-vxworks configuration. + +Wed Feb 22 14:40:26 1995 Ian Lance Taylor + + * libaout.h (NAME(aout,slurp_reloc_table)): Change declaration to + use reloc_howto_type rather than const struct reloc_howto_struct. + +Tue Feb 21 18:19:22 1995 Ian Lance Taylor + + * bout.c (b_out_slurp_reloc_table): Don't return an error if asked + for relocations for the .bss section. + +Tue Feb 21 15:13:05 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_ar_write_symbol_stuff): Handle objects with odd + lengths. + +Fri Feb 17 12:34:36 1995 Michael Meissner + + * elf32-ppc.c (ppc_elf_got16_reloc): Make GOT style relocs add + 32768, so the GOT pointer can point to 16384 pointers, instead of + 8192. + +Fri Feb 17 11:45:38 1995 Ian Lance Taylor + + * hosts/sysv4.h: Include , , and . + Only define SEEK_SET and SEEK_CUR if they are not already defined. + Remove all external function declarations. + + * syms.c (bfd_decode_symclass): Return 'W' for a weak symbol. + + * coffgen.c (coff_real_object_p): Set start address and flags + before calling coff_mkobject_hook. Restore them on failure. + * ecoff.c (_bfd_ecoff_mkobject_hook): If not ECOFF_AOUT_ZMAGIC, + clear D_PAGED. + + * coffgen.c: Reindented. + +Thu Feb 16 14:37:23 1995 Doug Evans + + * reloc.c (bfd_perform_relocation): Don't use bitpos in overflow + calculations. + (bfd_install_relocation): Likewise. + +Thu Feb 16 13:22:29 1995 Ian Lance Taylor + + * hosts/std-host.h: Remove all function declarations which return + int or void, except the one for free. + +Wed Feb 15 14:54:18 1995 Michael Meissner + + * elf32-ppc.c (elf_powerpc_howto_table): Use a destination mask of + 0xffffffff for R_PPC_REL32, not 0. + (powerpc_reloc_map): Add low 16 bit, high 16 bit, and high 16 bit + adjusted relocations. + +Tue Feb 14 17:47:17 1995 Ian Lance Taylor + + * elf32-mips.c (struct mips_elf_find_line): Define. + (mips_elf_find_nearest_line): New static function. + (bfd_elf32_find_nearest_line): Define. + * libelf.h (struct elf_obj_tdata): Add find_line_info field. + + * ecoff.c (_bfd_ecoff_swap_tir_in): Move to ecofflink.c. + (_bfd_ecoff_swap_tir_out): Likewise. + (_bfd_ecoff_swap_rndx_in): Likewise. + (_bfd_ecoff_swap_rndx_out): Likewise. + (cmp_fdrtab_entry): Likewise. + (mk_fdrtab): Likewise. + (lookup): Likewise. + (_bfd_ecoff_find_nearest_line): Just call _bfd_ecoff_locate_line + to do most of the work. Allocate find_line_info if necessary. + * ecofflink.c: Include "aout/stab_gnu.h". + (_bfd_ecoff_swap_tir_in): Move in from ecoff.c. + (_bfd_ecoff_swap_tir_out): Likewise. + (_bfd_ecoff_swap_rndx_in): Likewise. + (_bfd_ecoff_swap_rndx_out): Likewise. + (cmp_fdrtab_entry): Likewise. Use PTR instead of void *. + (mk_fdrtab): Move in from ecoff.c. Add debug_info, debug_swap, + and line_info arguments, and use them instead of ecoff_data. + (fdrtab_lookup): Move in from lookup in ecoff.c. Remove abfd + argument, add line_info argument. Use it instead of ecoff_data. + (_bfd_ecoff_locate_line): New function, mostly from the old + _bfd_ecoff_find_nearest_line in ecoff.c. + * libecoff.h (ecoff_data_type): Remove find_buffer, fdrtab_len and + fdrtab fields, replacing them find_line_info field. + (_bfd_ecoff_swap_tir_in): Declare. + (_bfd_ecoff_swap_tir_out): Declare. + (_bfd_ecoff_swap_rndx_in): Declare. + (_bfd_ecoff_swap_rndx_out): Declare. + * libbfd-in.h (_bfd_ecoff_locate_line): Declare. + * libbfd.h: Rebuild. + * configure.in: Don't use ecoff.o for bfd_elf32_bigmips_vec or + bfd_elf32_littlemips_vec. + * Makefile.in: Rebuild dependencies. + +Tue Feb 14 14:04:22 1995 Michael Meissner + + * libelf.h (elf_backend_data): Add fields elf_machine_alt1 and + elf_machine_alt2 which provide alternate versions of the machine + code. + + * elf32-ppc.c (ELF_MACHINE_ALT1, ELF_MACHINE_ALT2): Define to + recognize old versions of the PowerPC machine code. + + * elf32-target.h (elf32_bed): Initialize alternate machine code + fields defined by ELF_MACHINE_ALT1 and ELF_MACHINE_ALT2. + + * elf64-target.h (elf64_bed): Initialize alternate machine code + fields defined by ELF_MACHINE_ALT1 and ELF_MACHINE_ALT2. + + * elfcode.h (elf_object_p, elf_core_file_p): In addition to the + main machine code field, check the two alternate machine code + fields. + +Tue Feb 14 12:46:48 1995 Ian Lance Taylor + + * aoutf1.h (MACHTYPE_OK): Don't define if already defined. Don't + accept M_SPARC if bfd_arch_sparc is not in the list of supported + architectures, and don't accept a 680x0 machine type if + bfd_arch_m68k is not in the list of supported architectures. + * aout0.c (MACHTYPE_OK): Define. + +Mon Feb 13 23:25:38 1995 Ian Lance Taylor + + * aoutx.h (NAME(aout,swap_ext_reloc_in)): Don't return a pointer + to garbage if the symbol index is out of range. + (NAME(aout,swap_std_reloc_in)): Likewise. + +Thu Feb 9 18:36:52 1995 Ken Raeburn + + * Makefile.in (BFD32_BACKENDS): Add i386msdos.o. + +Thu Feb 9 12:02:35 1995 Ian Lance Taylor + + * i386linux.c (NEEDS_SHRLIB): Define. + (linux_tally_symbols): Crash if a NEEDS_SHRLIB symbol is + undefined. From hjl@nynexst.com (H.J. Lu). + +Wed Feb 8 17:26:00 1995 Ian Lance Taylor + + * linker.c (generic_link_check_archive_element): Allocate common + symbol information structure. Don't bother to check for common + symbol size overflow. + (_bfd_generic_link_add_one_symbol): Likewise. + * aoutx.h (aout_link_check_ar_symbols): Likewise. + * linker.c (generic_link_check_archive_element): Adjust references + to common symbol information for new structure. + (_bfd_generic_link_add_one_symbol): Likewise. + * aoutx.h (aout_link_check_ar_symbols): Likewise. + (aout_link_add_symbols): Likewise. + * ecoff.c (ecoff_link_add_externals): Likewise. + * elfcode.h (elf_link_add_object_symbols): Likewise. + (elf_link_output_extsym): Likewise. + * sunos.c (sunos_add_one_symbol): Likewise. + +Wed Feb 8 09:53:42 1995 Doug Evans + + * elfcode.h (elf_sort_hdrs): Put SHT_NOBITS sections after !SHT_NOBITS. + +Tue Feb 7 16:27:33 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_find_nearest_line): Just return false, don't + abort. + +Tue Feb 7 14:43:33 1995 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * ecoff.c: Reformatted some comments and brace constructs in + recent changes to GNU style. + (cmp_fdrtab_entry, mk_fdrtab, lookup): Use old-style function + definitions. + +Tue Feb 7 14:21:28 1995 Ian Lance Taylor + + * ecoffswap.h (ecoff_swap_pdr_in): Zero out intern before setting + any of the fields. + +Mon Feb 6 20:01:24 1995 Ken Raeburn + + Sat Feb 4 14:20:24 1995 David Mosberger-Tang + + * ecoffswap.h (ecoff_swap_pdr_in, ecoff_swap_pdr_out): added + internalizing/externalizing new "prof" field. + + * libecoff.h (ecoff_tdata): added fdrtab. + + * ecoff.c (_bfd_ecoff_find_nearest_line): Fixed. + +Mon Feb 6 14:25:24 1995 Ian Lance Taylor + + * libelf.h (struct elf_link_hash_table): Add saw_needed field. + * elfcode.h (elf_link_add_object_symbols): Set saw_needed if + DT_NEEDED seen in .dynamic section. + (elf_link_output_extsym): Warn if an undefined symbol is + only referenced from a dynamic object, and not making a shared + object, and saw_needed is false. + * elf.c (_bfd_elf_link_hash_table_init): Initialize saw_needed. + + * libelf.h (ELF_LINK_HASH_DEFINED_WEAK): Don't define. + * elfcode.h (elf_link_add_object_symbols): Don't clear or set + ELF_LINK_HASH_DEFINED_WEAK. + (elf_link_output_extsym): Don't check ELF_LINK_HASH_DEFINED_WEAK. + + Distinguish a weak defined symbol from a regular defined symbol. + * linker.c (enum link_action): Add DEFW. + (link_action): Add bfd_link_hash_defweak column. + (_bfd_generic_link_add_one_symbol): Add DEFW case. Handle + bfd_link_hash_defweak in a few other cases. + * Many files (bfd_link_hash_undefweak): Renamed from + bfd_link_hash_weak. + * aoutx.h (aout_link_write_symbols): Handle bfd_link_hash_defweak. + (aout_link_write_other_symbol): Likewise. + (aout_link_input_section_std): Likewise. + (aout_link_input_section_ext): Likewise. + * bout.c (get_value): Likewise. + * coff-a29k.c (coff_a29k_relocate_section): Likewise. + * coff-alpha.c (alpha_convert_external_reloc): Likewise. + (alpha_relocate_section): Likewise. + * coff-mips.c (mips_relocate_section): Likewise. + (mips_relax_section): Likewise. + (bfd_mips_ecoff_create_embedded_relocs): Likewise. + * cofflink.c (coff_write_global_sym): Likewise. + (_bfd_coff_generic_relocate_section): Likewise. + * ecoff.c (ecoff_link_add_externals): Likewise. + (ecoff_link_write_external): LIkewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + (elf32_hppa_size_stubs): Likewise. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise. + (elf_i386_relocate_section): Likewise. + (elf_i386_finish_dynamic_symbol): Likewise. + * elf32-mips.c (mips_elf_output_extsym): Likewise. + (mips_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise. + (elf32_sparc_relocate_section): Likewise. + * elfcode.h (elf_link_add_object_symbols): Likewise. + (elf_adjust_dynamic_symbol): Likewise. + (elf_bfd_final_link): Likewise. + (elf_link_output_extsym): Likewise. + * i386linux.c (linux_add_one_symbol): Likewise. + (linux_tally_symbols): Likewise. + (linux_finish_dynamic_link): Likewise. + * linker.c (_bfd_generic_link_output_symbols): Likewise. + (set_symbol_from_hash): Likewise. + * reloc16.c (bfd_coff_reloc16_get_value): Likewise. + (bfd_perform_slip): Likewise. + * sunos.c (sunos_add_one_symbol): Likewise. + (sunos_scan_std_relocs): Likewise. + (sunos_scan_ext_relocs): Likewise. + (sunos_scan_dynamic_symbol): Likewise. + (sunos_write_dynamic_symbol): Likewise. + +Mon Feb 6 03:20:17 1995 Ken Raeburn + + Changes from Bryan Ford, baford@schirf.cs.utah.edu: + * config.bfd (i[345]86-*-msdos*): New target. + * configure.in (i386msdos_vec): Handle it. + * i386msdos.c: New file. + * config/i386-msdos.mt: New file. + * bfd.c (enum bfd_error): Added new value bfd_error_file_too_big. + (bfd_errmsgs): Added string to table. + * libaout.h (reloc_type-lookup): Declare it. + * targets.c (enum bfd_flavour): Added bfd_target_msdos_flavour. + (i386msdos_vec): Declare. + (bfd_target_vector): Add it to the list. + * bfd-in2.h: Regenerated. + +Wed Feb 1 01:32:14 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_set_reloc_info, case R_DATA_ONE_SYMBOL): If there's + nothing in R_DATA_OVERRIDE, then try to find the addend in the + section's contents. + (som_write_fixups): Ignore the addend in a R_DATA_ONE_SYMBOL fixup. + + * som.c (som_object_setup): More heruistics to detect the + braindamaged HP OSF1 linker. + (setup_sections): Don't forget to free subspace_sections if we get + an error. + (som_slurp_string_table): Allocate strings on this bfd's obstack + rather than directly out of the heap. + (som_slurp_symbol_table): Likewise for the saved copy of the + canonical symbols. + (som_slurp_reloc_table): Likewise for the saved copy of the + canonical relocations. Free the native relocations when we're + done with them. + +Tue Jan 31 21:53:28 1995 Doug Evans + + * libelf.h (struct elf_obj_tdata): New member program_header_size. + * elfcode.h (get_program_header_size): New parameters sorted_hdrs, + count, and maxpagesize. All callers updated. + If sorted_hdrs is non-NULL, use it to compute the number of segments. + Save result in case called again. + (assign_file_positions_except_relocs): Sort headers before calling + get_program_header_size. + +Tue Jan 31 15:27:53 1995 Ian Lance Taylor + + * elfcode.h (map_program_segments): Add sorted_hdrs parameter. + Search through it rather than through unsorted section headers. + (assign_file_positions_except_relocs): Pass sorted_hdrs to + map_program_segments. + +Mon Jan 30 22:04:53 1995 Ken Raeburn + + * ecoff.c (_bfd_ecoff_find_nearest_line): Fix problems in range + checking. Expect argument OFFSET to be section-relative. From + David Mosberger-Tang, davidm@piston.cs.arizona.edu. + +Mon Jan 30 11:22:11 1995 Ian Lance Taylor + + * elfcode.h (NAME(bfd_elf,record_link_assignment)): Don't do + anything if we are not linking an ELF file. + (NAME(bfd_elf,size_dynamic_sections)): Likewise. + +Sat Jan 28 12:48:57 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (compare_subspaces): New function to sort subspaces by + their location in the object file. + (setup_sections): When computing the index for each subspace, + handle case where setup_sections reads the subspaces in a + different order that they appear in the object file. + (som_is_space): Also examine the output section for the containing + section. + (som_is_subspace, som_is_container): Likewise. + (som_begin_writing): Don't prepare or write fixups here. When + writing the symbol strings, use the unsorted symbol table. + (som_write_object_contents): Don't write the symbol table here. + (som_finish_writing): Prepare and write the fixups here. Likewise + for the symbol table. + (som_bfd_derive_misc_symbol_info): Undefined symbols always have + type SS_UNSAT regardless of BSF_EXPORT. + (som_set_reloc_info): Unpack and attach argument location + information for R_PCREL_CALL and R_ABS_CALL relocations. + + * som.c (som_object_setup): New heuristic to determine if the + entry and flags fields are switched in the exec header. + +Sat Jan 28 00:16:01 1995 Ian Lance Taylor + + * elfcode.h (elf_link_add_object_symbols): Use *sym_hash instead + of h if we might not be doing an ELF link. + +Fri Jan 27 16:13:42 1995 Ian Lance Taylor + + * elf32-mips.c (mips_elf_final_link): If the size of an input + .reginfo section is zero, force it to the correct size, since the + linker emulation code may have clobbered it. + + * elfcode.h (elf_sort_hdrs): Correct SHF_ALLOC test. + (assign_file_positions_except_relocs): Free sorted_hdrs. + +Thu Jan 26 09:00:12 1995 Steve Chamberlain + + * srec.c (srec_set_section_contents): Fix off by + one end address calculation. + + * config.bfd: (m68*-est-coff): New configuration. + +Thu Jan 26 11:39:21 1995 Ian Lance Taylor + + * elfcode.h (elf_link_add_object_symbols): Only examine weakdef if + we are using an ELF hash table. + + * aoutx.h (NAME(aout,some_aout_object_p)): Always set EXEC_P if + the start address is in the .text section, even if STAT_FOR_EXEC + is set. Just use STAT_FOR_EXEC as an additional test. + +Thu Jan 26 11:12:54 1995 Michael Meissner + + * elfcode.h (prep_headers): Use EM_PPC instead of + EM_CYGNUS_POWERPC. + + * elf32-ppc.c (reloc_type): Add all System V.4 and eABI + relocations currently defined. + (powerpc_reloc_map): Adjust to new relocation names. + (elf_powerpc_howto_table): Add most of the new relocations. + (ELF_MACHINE_CODE): Use EM_PPC instead of EM_CYGNUS_POWERPC. + + * config.bfd: Add support for powerpc-*-eabi. + + * config/ppc-elf.mt: Add rs6000 architecture support to the + PowerPC. Also add XCOFF support. + +Wed Jan 25 23:26:13 1995 Ian Lance Taylor + + * coff-sh.c (CALC_ADDEND): Don't define. + (coff_sh_relocate_section): Remove. + (coff_relocate_section): Use _bfd_coff_generic_relocate_section. + +Tue Jan 24 14:22:47 1995 Ian Lance Taylor + + * elf32-mips.c (mips_elf_output_extsym): Set the value of the + ECOFF symbol from the hash table entry. + +Mon Jan 23 14:53:35 1995 Steve Chamberlain + + * coff-sh.c (coff_sh_relocate_section): Don't subtract + vma twice. + +Mon Jan 23 13:33:18 1995 Ian Lance Taylor + + * coff-sh.c (sh_reloc): Don't ignore the previous contents of an + R_SH_IMM32 reloc. + + * config.bfd (i[345]86-*-gnu*): Set bfd_name to i386-gnu. + * config/i386-gnu.mt: New file. Include ELF support. + + * opncls.c (bfd_openstreamr): Call bfd_cache_init. + +Fri Jan 20 11:44:45 1995 Ian Lance Taylor + + * sunos.c (sunos_add_one_symbol): Only set the sunos specific + fields if we are doing a sunos link. + +Wed Jan 18 12:28:17 1995 Ian Lance Taylor + + * cpu-h8300.c (h8300_info_struct): Change name from "H8/300" to + "h8300" for consistency with other cpu-* files. + (h8300h_info_struct): Change name from "H8/300H" to "h8300h". + * coff-h8300.c (special): Remove unused variable diff. + +Tue Jan 17 10:52:32 1995 Ian Lance Taylor + + * bfd-in.h (bfd_byte, reloc_howto_type): Define here, not... + * reloc.c (bfd_byte, reloc_howto_type): here. + * Changed all occurrences of ``const struct reloc_howto_struct'' + to be ``reloc_howto_type'' instead. + * bfd-in2.h, libbfd.h, libcoff.h: Rebuilt. + + * opncls.c (bfd_openstreamr): New function. + * bfd-in2.h: Rebuilt. + + * elf32-mips.c (enum reloc_type): Define new relocs used on Irix. + (elf_mips_howto_table): Add entries for new relocs. + (mips_elf_section_from_shdr): Handle SHT_MIPS_MSYM, + SHT_MIPS_DWARF, and SHT_MIPS_EVENTS. + (mips_elf_fake_sections): Handle sections named .msym, .debug_* + and .MIPS.events.*. + + * srec.c (srec_init): Remove unused local variable i. + +Sat Jan 14 19:09:48 1995 Steve Chamberlain + + * archures.c, Makefile.in, targets.c, bfd-in2.h, coffcode.h, + config.bfd, configure.in, config/w65.mt: Initial support for the W65. + +Sun Jan 15 13:57:45 1995 Steve Chamberlain + + * opncls.c (bfd_fdopenr): Configure for WIN32. + +Thu Jan 12 16:30:47 1995 Ken Raeburn + + * Makefile.in (diststuff): Include `headers'. + + * sunos.c (m68k_plt_first_entry, sparc_plt_first_entry): Now + const. + * tekhex.c (digs): Ditto. + * elf32-i386.c (elf_i386_plt0_entry, elf_i386_plt_entry): Ditto. + + * srec.c, tekhex.c: Include libiberty.h. Delete static array + hex_value and replace references to it with references to + hex_init, hex_p, and hex_value. + * Makefile.in: Updated dependencies. + + * archures.c (archures_init_table): Now const. + (bfd_arch_init): Adjusted type of local var `ptable'. + +Thu Jan 12 09:33:24 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * hosts/symmetry.h: Redefine `shared' to enable compilation + with the native Dynix cc compiler. + * i386dynix.c: Include aoutx.h instead of using routines + from aout32.c. + +Wed Jan 11 21:31:41 1995 Ken Raeburn + + * reloc.c (reloc_howto_type): Make typedef include `const'. + * aout-ns32k.c, aoutx.h, bout.c, cf-m68klynx.c, coff-i386.c, + coff-i960.c, coff-m68k.c, cofflink.c, cpu-ns32k.c, ecoff.c, + elf32-hppa.c, elf32-i386.c, elf32-mips.c, elf32-sparc.c, + elfcode.h, libbfd-in.h, linker.c, mipsbsd.c, nlm32-ppc.c, oasys.c, + reloc.c, som.c: Don't use `const' in combination with + `reloc_howto_type'. + * bfd-in2.h, libbfd.h: Regenerated. + + * ecoff.c (ecoff_type_to_string): Local variable `buffer1' doesn't + need to be static. + +Wed Jan 11 14:36:41 1995 Ian Lance Taylor + + * sunos.c (sunos_add_one_symbol): Don't core dump if a multiple + definition of an absolute symbol is encountered. + + * linker.c (_bfd_generic_link_add_one_symbol): Ignore + redefinitions of an absolute symbol to the same value. + +Mon Jan 9 15:51:32 1995 Ian Lance Taylor + + * elfcode.h (elf_link_add_object_symbols): It's reasonable for no + flags to be set, so don't insist otherwise. + +Fri Jan 6 16:39:40 1995 Ian Lance Taylor + + * elfcode.h (elf_slurp_symbol_table): Don't set BSF_GLOBAL for an + undefined or common symbol. + (elf_link_add_object_symbols): Likewise. + +Wed Jan 4 14:14:05 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (bfd_section_from_som_symbol): Only return sections which + correspond to subspaces. + + * som.c (som_begin_writing): Don't forget to bump the + total_subspaces when writing the unloadable subspaces. + +Wed Dec 28 20:54:47 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_write_fixups): Use SEC_HAS_CONTENTS to identify + bss-like sections. + (som_get_section_contents): Likewise. + (som_set_section_contents): Likewise. + +Tue Dec 27 14:03:47 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (setup_sections): Turn off SEC_HAS_CONTENTS for bss-like + sections. + +Tue Dec 20 15:30:12 1994 Ken Raeburn + + * coffgen.c (bfd_debug_section): Deleted. + (coff_section_from_bfd_index): Return absolute section for debug + symbol. + (coff_write_symbol): Set BSF_DEBUGGING for C_FILE symbols. If + BSF_DEBUGGING is set, set section to N_DEBUG. + (coff_bfd_make_debug_symbol): Use absolute section. + + * elfcode.h (assign_file_positions_except_relocs): In assertion, + force all values to the same type. + +Tue Dec 20 11:11:58 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * coff-h8300.c (howto_table): All relocs get a special function. + (special): Never do anything when linking -r. + +Tue Dec 20 13:58:01 1994 Ian Lance Taylor + + * i386linux.c (linux_add_one_symbol): Don't do anything Linux + specific if this is not a Linux hash table. From Eric Youngdale + . + + Patches from kkojima@mix.or.jp (Kazumoto Kojima): + * mipsbsd.c (mips_howto_table_ext): Change sizes of memory relocs + apply to from two bytes to four bytes. + * MY(reloc_howto_type_lookup): Handle BFD_RELOC_CTOR. + + * elf32-i386.c (elf_i386_relocate_section): Correct and expand the + list of cases for which relocation need not be computed. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + +Mon Dec 19 23:09:16 1994 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (elf32_hppa_read_symext_info): Delete do_locals and + do_globals arguments, always read symbol extension information for + globals and locals. All callers changed. + (elf32_hppa_size_stubs): Rework to only read symbol extension + information once for each input bfd. 10% improvement in linker + performance. + +Fri Dec 16 12:28:46 1994 Ian Lance Taylor + + * elfcode.h (elf_section_from_bfd_section): Check + bfd_is_abs_section, etc., only after checking for the section in + the BFD and after calling the backend routine. + +Wed Dec 14 20:21:58 1994 Ian Lance Taylor + + * elfcode.h (elf_map_symbols): Only use section symbols whose + value is the start of the section, checking output_offset when + using output_section. When creating a new symbol, set the value + to 0, since BFD symbol values are section relative. + +Tue Dec 13 13:31:06 1994 Ian Lance Taylor + + * cpu-z8k.c (arch_info_struct): Make z8002 the default + architecture. + +Fri Dec 9 12:43:05 1994 Ian Lance Taylor + + * elfcode.h (elf_bfd_link_add_symbols): If the first object in the + archive is not an ELF object, pass the archive to the add_symbols + entry point appropriate for the first object. From Eric Youngdale + . + * aoutx.h (NAME(aout,link_add_symbols)): Similar change if the + first object is not an a.out object. + + * elf32-i386.c (elf_i386_relocate_section): Don't compute + relocation in cases where we won't use it. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + +Thu Dec 8 14:19:41 1994 Ken Raeburn + + * pc532-mach.c (NAME): Define to use ns32kaout prefix. + * ns32knetbsd.c (NAME): Ditto. + (ns32kaout_32_get_section_contents): Define to standard aout-32 + version. + +Fri Dec 2 13:56:49 1994 Ian Lance Taylor + + * coff-mips.c (mips_read_relocs): New static function, broken out + of mips_relax_section. + (mips_relax_section): Call mips_read_relocs. + (bfd_mips_ecoff_create_embedded_relocs): New function. + * bfd-in.h (bfd_mnips_ecoff_create_embedded_relocs): Declare. + * bfd-in2.h: Rebuild. + +Wed Nov 30 14:12:55 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-sh.c: Use _bfd_dummy_target instead of no_archive. + +Tue Nov 29 14:00:19 1994 J.T. Conklin + + * config.bfd (i[345]86-*-freebsd*): Use i386-bsd as bfd_name. + * configure.host (i[345]86-*-freebsd*): Use i386bsd as my_host. + +Mon Nov 28 15:36:04 1994 J.T. Conklin (jtc@phishhead.cygnus.com) + + * config/m68k-nbsd.mt (DEFAULT_VECTOR): set to m68knetbsd_vec. + * Makefile.in: Rebuilt dependancies. + (CFILES): Added m68knetbsd.c. + (HFILES): Added netbsd.h. + +Wed Nov 23 19:21:41 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * coff-sh.c (shlcoff_vec): New target vector. + (no_archive): New function. + * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Handle + little endian SH. + * configure.in: Handle shl. + * targets.c (bfd_target_vector): Add shlcoff_vec. + * config/sh-coff.mt (SELECT_VECS): Handle shl_coff_vec. + +Wed Nov 23 10:50:13 1994 Jeff Law (law@snake.cs.utah.edu) + + * elfcode.h (write_relocs): Do not subtract the section's vma from + the reloc's offset when writing .o's. Instead add the section's + vma to the reloc's offset when writing an executable or shared + library. + +Tue Nov 22 23:34:37 1994 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Do not add + input_section->vma to the relocation's offset. + +Mon Nov 21 12:37:25 1994 Ian Lance Taylor + + * srec.c (srec_get_reloc_upper_bound): Define. + (srec_canonicalize_reloc): Define. + (srec_bfd_reloc_type_lookup): Define. + (srec_vec, symbolsrec_vec): Use BFD_JUMP_TABLE_RELOCS (srec). + +Sat Nov 19 03:10:51 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * configure.host (i[345]86-*-solaris*): Use solaris2 to + enable extraction of procfs info from core file for GDB. + +Thu Nov 17 17:37:39 1994 Ken Raeburn + + * reloc.c (bfd_reloc_code_type): Add new value BFD_RELOC_12_PCREL. + * bfd-in2.h, libbfd.h: Rebuilt. + +Thu Nov 17 13:12:08 1994 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocated): Use the + vma from the output_section containing $global$ when computing + global_vlaue. + +Thu Nov 17 14:29:13 1994 Ian Lance Taylor + + * archive.c (_bfd_write_archive_contents): Round up the archive + header size of the extended name table to an even number. + +Wed Nov 16 16:08:06 1994 Ken Raeburn + + * coff-sh.c: Deleted some code that was commented out or inside + "#if 0". + (COFF_LONG_FILENAMES): Define. + + * cpu-sh.c (arch_info_struct): Convert name to lowercase, for + consistency with other architectures. + +Sat Nov 12 23:50:10 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (elf_export_symbol): Also export symbols which are + referenced by a regular file. + +Fri Nov 11 14:29:31 1994 Ian Lance Taylor + + * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add + export_dynamic argument, and handle it. + (elf_export_symbol): New function. + * bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration. + (bfd_elf64_size_dynamic_sections): Update declaration. + * bfd-in2.h: Rebuild. + +Fri Nov 11 10:35:33 1994 Jeff Law (law@snake.cs.utah.edu) + + * hpux-core.c (hpux_core_struct): Delete handles for the + data, reg and stack sections. They're never used. Delete + accessor macros. + (make_bfd_asection): Use bfd_make_section_anyway since debugging + cores from dynamic executables may have several sections with the + same logical name. + (hpux_core_core_file_p): Don't save handles to data, reg and + stack sections. Handle CORE_TEXT, CORE_MMF and CORE_SHM. + +Tue Nov 8 13:03:30 1994 Ian Lance Taylor + + * bout.c (callj_callback): Add new argument shrinking. Change all + callers. Handle relocs against section symbols correctly. If not + shrinking, don't subtract out dstidx; the subtraction is already + in the object file. + +Sun Nov 6 12:52:00 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.h: Conditionally include and . + +Thu Nov 3 18:19:13 1994 Ken Raeburn + + * Makefile.in (ALL_MACHINES): Include m68knetbsd.o. + + * config/i386linux.mh (EXTRALIBS): Include -lm. + + Patches from DJ Delorie: + * coff-go32.c: Replacement file, uses coff-i386.c with minor + changes. + * coff-i386.c (TARGET_UNDERSCORE): allow other files to override + underscore also + * makefile.dos: del ctor.o, add cofflink.o and elf32.o + + * aoutx.h (adjust_o_magic): If user set data section vma, use it + to determine the default bss vma. Patch from Takada Hiroaki, + hiro@is.s.u-tokyo.ac.jp. + (machine_type, case bfd_arch_vax): Set *unknown to false. Patch + from John David Anglin . + + * configure.in (tb): Rename ns32knetbsd_vec to pc532netbsd_vec, + since that's what it's called. + +Wed Nov 2 15:24:51 1994 Ian Lance Taylor + + * archive.c (normalize): Change to take a BFD as an argument. + Change VMS version to use bfd_alloc rather than malloc, so that we + don't lose the memory forever. + (_bfd_construct_extended_name_table): Check the name of an archive + entry which is not being extended, and correct it if it is wrong. + This is necessary in case the archive was constructed by another + program which put an entry in the extended name table which we + don't plan to put in ourselves. From jjc@jclark.com (James + Clark). + (bfd_dont_truncate_arname): Check return value of normalize. + +Mon Oct 31 14:19:08 1994 Ian Lance Taylor + + * elf32-hppa.c (ELF32_PARISC_SX_SIZE): Define. + (ELF32_PARISC_SX_GET, ELF32_PARISC_SX_PUT): Define. + (symextn_entry): Don't define. + (symext_chain_size): Change type to bfd_size_type. + (symextn_contents): Change type to bfd_byte *. + (elf32_hppa_backend_begin_write_processing): Use + ELF32_PARISC_SX_SIZE instead of sizeof (symext_entryS). + (elf32_hppa_size_symext): Likewise. Also, change type of sizep to + bfd_size_type *. + (elf_hppa_tc_make_sections): Cast symextn_contents assignment to + bfd_byte *. Use ELF32_PARISC_SX_PUT instead of direct assignment. + (elf32_hppa_backend_symbol_table_processing): Use + ELF32_PARISC_SX_SIZE instead of sizeof (symext_entryS). Use + ELF32_PARISC_SX_GET insetad of direct assignment. + (elf32_hppa_read_symext_info): Change type of contents, and its + assignment cast, to bfd_byte *. Use ELF32_PARISC_SX_SIZE instead + of sizeof (symextn_entry). Use symext_entryS instead of + symextn_entry. Use ELF32_PARISC_SX_GET instead of direct + assignment. + + * archive.c (bfd_dont_truncate_arname): Add the ar padding + character, if there is room for it, even if the name is the + maximum length. + + * elfcode.h (assign_file_positions_except_relocs): Sort the ELF + headers by section address when assigning file positions. + (elf_sort_hdrs): New static function. + +Sun Oct 30 18:56:58 1994 Ian Lance Taylor + + * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Create DT_INIT + and DT_FINI dynamic entries based on the existence of _init and + _fini symbols, not on the .init and .fini sections. This is + compatible with some SVR4 linkers. + (elf_bfd_final_link): Corresponding change. + +Sat Oct 29 12:18:10 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't move a + symbol with a PLT entry into the .plt section if it is defined in + a regular file. + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise. + + * linker.c (_bfd_generic_link_add_archive_symbols): It's not an + error if an empty archive has no symbol table. + * ecoff.c (ecoff_link_add_archive_symbols): Likewise. + * elfcode.h (elf_link_add_archive_symbols): Likewise. + +Fri Oct 28 10:08:41 1994 J.T. Conklin (jtc@rtl.cygnus.com) + + NetBSD/m68k support, based on work by mikeb@snow.datametrics.com: + * config.bfd (m68*-*-netbsd*): Use m68k-nbsd as bfd_name. + * configure.in (m68knetbsd_vec): Added. + * targets.c (bfd_m68knetbsd_vec): Added. + * hosts/m68knbsd.h, config/m68k-nbsd.mt, m68knetbsd.c: New files. + * Makefile.in (BFD32_BACKENDS, CFILES): Add m68knetbsd.c. + + miscellaneous cleanup required by all netbsd targets, based on work + by Andrew Cagney : + * netbsd.h (N_MAGIC, N_SET_MAGIC, N_GETMAGIC, N_GETMAGIC2, N_TXTADDR, + N_TXTOFF, N_ALIGN, N_DATADDR, N_DATOFF): Removed. Generic a.out + definitions work. + * i386nbsd.c, ns32knbsd.c, sparcnbsd.c (__LDPGSZ): Removed. + (MY(write_object_contents)): Use NetBSD's magic numbers + +Thu Oct 27 16:59:52 1994 Ian Lance Taylor + + * libelf.h (struct bfd_elf_section_data): Add field dynindx. + * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Don't finalize + the .dynsym, .dynstr or .hash sections until after the backend + size_dynamic_sections routine, so that it can add dynamic symbols + if it wants to. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't define the + symbol to be in the .plt section when generating a shared library + if it is a defined symbol. + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise. + (elf32_sparc_size_dynamic_sections): When generating a shared + library, allocate space for a dynamic symbol for each output + section, storing the index in the dynindx field of the ELF section + data. Adjust the other dynindx fields to account for this. + (elf32_sparc_adjust_dynindx): New static function. + (elf32_sparc_relocate_section): When copying a reloc into a shared + library, use the original addend as appropriate. Convert an + R_SPARC_32 reloc into an R_SPARC_RELATIVE reloc. Use the dynamic + symbol index of the output section, not the normal symbol index. + (elf32_sparc_finish_dynamic_sections): Don't die if a section does + not exist when setting the value of the dynamic tags. Write out + a dynamic symbol for each output section. + +Wed Oct 26 01:15:51 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (aout_link_input_section): Don't bother to read or write + the relocs if there aren't any. + +Tue Oct 25 11:44:38 1994 Ian Lance Taylor + + * Makefile.in (ALL_MACHINES): Add tekhex.o. + * targets.c (bfd_target_vector): If SELECT_VECS is not defined, + include tekhex_vec. + * tekhex.c (NIBBLE, ISHEX): Cast array arguments to unsigned char. + (getvalue, getsym, out): Likewise. + (find_chunk): Remove unused variable s. + (first_phase): Remove unused variable s. + (pass_over): Remove unused variable address. + (tekhex_object_p): Remove unused variable section. + (move_section_contents): Change return type from boolean to void. + (tekhex_write_object_contents): Remove unused variables tdata and + list. + + * linker.c (enum link_action): Add CIND. + (link_action): Change COMMON_ROW\indr from MDEF to CREF. Change + INDR_ROW\common from MDEF to CIND. + (_bfd_generic_link_add_one_symbol): In CREF case, handle an + existing symbol which is indirect rather than defined. Add new + CIND case. + +Mon Oct 24 15:33:16 1994 Ian Lance Taylor + + Change S-record backend to use multiple sections to handle gaps in + file. + * srec.c (srec_data_list_struct): Move field next from last place + to first. Change type of data to bfd_byte *. + (struct srec_symbol): Define. + (tdata_type): Remove done_symbol_read, count, strings, symbol_idx, + string_size, string_idx. Change type of symbols to struct + srec_symbol *. Add symtail and csymbols. + (low, high): Remove. + (size_symbols, fillup_symbols, size_srec, fillup): Remove. + (white, skipwhite, pass_over, object_p): Remove. + (srec_mkobject): Call srec_init. Adjust tdata initialization for + field changes. + (srec_get_byte, srec_bad_byte): New static functions. + (srec_new_symbol, srec_scan): New static functions. + (srec_object_p): Change type of b to bfd_byte. Explicitly set + wrong_format error. Call srec_mkobject and srec_scan instead of + object_p. + (symbolsrec_object_p): Likewise. Also, change b to be only two + bytes. + (srec_read_section): New static function. + (srec_get_section_contents): Call srec_read_section rather than + pass_over. Handle zero length section correctly. + (set_set_arch_mach): Change from function to macro. + (srec_set_section_contents): Change data to bfd_byte *. + (srec_write_record): Change data, end and src to bfd_byte *. + (srec_write_header): Change buffer and dst to bfd_byte *. + (srec_write_section): Change location to bfd_byte *. + (srec_write_terminator): Change buffer to bfd_byte *. + (srec_get_symtab_upper_bound): Don't call + srec_get_section_contents. + (srec_get_symtab): Rewrite. + + * ecoff.c (ecoff_set_symbol_info): Set udata.i to 0, not NULL. + +Fri Oct 21 16:43:13 1994 J.T. Conklin (jtc@phishhead.cygnus.com) + + * libaout.h (machine_type): added M_68K_NETBSD and M_SPARC_NETBSD. + * i386netbsd.c, ns32knetbsd.c, sparcnetbsd.c: removed RCS Id's. + changed how PAGE_SIZE and SEGMENT_SIZE are defined so they are + consistant with each other. + * netbsd.h (N_HEADER_IN_TEXT, TEXT_START_ADDR): NetBSD fits its + header into the start of its text segment. + +Fri Oct 21 17:13:07 1994 Ian Lance Taylor + + * targets.c (BFD_JUMP_TABLE_ARCHIVE): Add case for + _construct_extended_name_table. + (bfd_target): Add _bfd_construct_extended_name_table. + * archive.c (_bfd_archive_bsd_construct_extended_name_table): New + function. + (_bfd_archive_coff_construct_extended_name_table): New function. + (_bfd_construct_extended_name_table): Renamed by adding a leading + underscore, and made externally visible. Added trailing_slash + argument, and used it instead of elf_style. Changed type of + tablen to bfd_size_type *. + (_bfd_write_archive_contents): Use BFD_SEND to call + construct_extended_name_table. Use the returned name. + * libbfd-in.h (_bfd_construct_extended_name_table): Declare. + (_bfd_noarchive_construct_extended_name_table): Define. + (_bfd_archive_bsd_construct_extended_name_table): Declare. + (_bfd_archive_coff_construct_extended_name_table): Declare. + * bfd-in2.h: Rebuild. + * libbfd.h: Rebuild. + * som.c (som_construct_extended_name_table): New static function. + * aout-target.h (MY_construct_extended_name_table): Define. + * coff-rs6000.c (rs6000coff_construct_extended_name_table): + Define. + * ieee.c (ieee_construct_extended_name_table): Define. + * libecoff.h (_bfd_ecoff_construct_extended_name_table): Define. + * oasys.c (oasys_construct_extended_name_table): Define. + + Fix the ELF linker to not require an interpreter if no dynamic + objects were seen, even when linking PIC code. + * libelf.h (ELF_LINK_HASH_NEEDS_PLT): Define. + (struct elf_link_hash_table): Add field dynamic_sections_created. + * elfcode.h (elf_link_record_dynamic_symbol): Create dynstr if it + doesn't already exist. + (elf_link_add_object_symbols): Create dynamic sections based on + dynamic_sections_created field, not dynobj field. Don't bother to + set dynobj. + (elf_link_create_dynamic_sections): If dynamic sections were + already created, don't do anything. If dynobj is already set, use + it; otherwise, set it to the bfd argument. Don't initialize + dynsymcount. Only create dynstr if it does not exist. Set + dynamic_sections_created to true. + (NAME(bfd_elf,size_dynamic_sections)): Skip most of this function + if no dynamic objects were seen. + (elf_adjust_dynamic_symbol): If a symbol has the + ELF_LINK_HASH_NEEDS_PLT flag set, let the backend adjust it. + (elf_bfd_final_link): Change most decisions based on dynobj to + check dynamic_sections_created instead. + (elf_link_output_extsym): Only handle dynamic symbols if a dynamic + object was seen. + * elf.c (_bfd_elf_link_hash_table_init): Initialize new field + dynamic_sections_created. Set dynsymcount to 1, not 0. + * elf32-i386.c (elf_i386_create_dynamic_sections): Call + elf_i386_create_got_section rather than creating the .got and + .got.plt sections. + (elf_i386_create_got_section): New static function. + (elf_i386_check_relocs): Just call elf_i386_create_got_section if + a GOT table is needed, not bfd_elf32_link_create_dynamic_sections. + Only create the .rel.got section, and only make space for a reloc, + for a global symbol or when generating a shared object. For a + R_386_PLT32 reloc, just set the ELF_LINK_HASH_NEEDS_PLT flag. + (elf_i386_adjust_dynamic_symbol): Rework initial assertion to + permit ELF_LINK_HASH_NEEDS_PLT non dynamic symbols. Create a + procedure linkage table entry for such symbols. But, if no + dynamic objects were seen, never create a PLT entry. + (elf_i386_size_dynamic_sections): If no dynamic objects were seen, + skip most of this function, and force the size of the .rel.got + section to zero. + (elf_i386_relocate_section): For a R_386_GOT32 reloc against a global + symbol when no dynamic object was seen, initialize the contents of + the .got section. For a R_386_GOT32 against a local symbol, only + create a R_386_RELATIVE reloc when generating a shared object. + Treat a R_386_PLT32 reloc against a symbol for which we did not + create a PLT entry as a R_386_PC32 reloc. + (elf_i386_finish_dynamic_sections): Only fiddle with the dynamic + entries and the PLT if we saw a dynamic object. + * elf32-sparc.c (elf_sparc_howto_table): Fix R_SPARC_PC22 by + setting rightshift to 10. Fix R_SPARC_WPLT20 by setting + rightshift to 2, size to 2, bitsize to 30, and dst_mask to + 0x3fffffff. + (elf32_sparc_create_dynamic_sections): Don't set the size of the + .plt section. Call elf32_sparc_create_got_section rather than + creating the .got section. + (elf32_sparc_check_relocs): Call elf32_sparc_create_got_section if + a GOT table is needed, not bfd_elf32_link_create_dynamic_sections. + Only create the .rela.got section, and only make space for a + reloc, for a global symbol or when generating a shared object. + Set the alignment of the .rela.got section to 2. For a + R_SPARC_WPLT30 reloc, just set the ELF_LINK_HASH_NEEDS_PLT flag. + (elf32_sparc_adjust_dynamic_symbol): Rework initial assertion to + permit ELF_LINK_HASH_NEDS_PLT non dynamic symbols. Create a + procedure linkage table for such symbols. But, if no dynamic + objects were seen, never create a PLT entry. Initialize the size + of the .plt section. + (elf32_sparc_size_dynamic_sections): If no dynamic objects were + seen, skip most of this function, and force the size of the + .rela.got section to zero. Strip empty reloc sections, and strip + an empty .plt section. + (elf32_sparc_relocate_section): For a GOT reloc against a global + symbol when no dynamic object was seen, initialize the contents of + the .got section. For a GOT reloc against a local symbol, only + create a R_SPARC_RELATIVE reloc when generating a shared object. + Treat a R_SPARC_WPLT30 reloc against a symbol for which we did not + create a PLT entry as a R_SPARC_WDISP30 reloc. + (elf32_sparc_finish_dynamic_sections): Only fiddle with the + dynamic entries and the PLT if we saw a dynamic object. + +Thu Oct 20 13:28:45 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (elf_map_symbols): Don't worry about section symbols + in a section not owned by any BFD. + (elf_section_from_bfd_section): Separate out loop which calls + backend routine. Check bfd_section and call the backend routine + even for a section not owned by any BFD. + * elf32-mips.c (mips_elf_section_from_bfd_section): Handle + .acommon section. + +Wed Oct 19 13:28:29 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * coffgen.c (coff_print_symbol): Make names for section number and + storage class slightly more verbose. It's not clear how many + characters I can justify using up, but before this change they + both were abbreviated "sc" which is (IMHO) clearly unacceptable. + +Wed Oct 19 01:26:39 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * binary.c (binary_set_section_contents): Set the base file + position from the lowest section VMA, not the start address. + + * aoutx.h (NAME(aout,slurp_symbol_table)): Don't return an error + if there are no symbols. + * coffgen.c (coff_get_normalized_symtab): Likewise. + * hp300hpux.c (MY(slurp_symbol_table)): Likewise. + +Tue Oct 18 12:56:43 1994 Ian Lance Taylor + + * aout-target.h (MY_bfd_copy_private_section_data): Only copy + subformat to another bfd_target_aout_flavour file. + + * binary.c: New file for raw binary output format. + * Makefile.in (BFD_LIBS): Add binary.o. + (CFILES): Add binary.c. + * targets.c (binary_vec): Declare. + (bfd_target_vector): Include binary_vec. + + * srec.c (tdata_type): Add field tail. + (srec_mkobject): Initialize tail. + (srec_set_section_contents): Sort S record list by address. + +Mon Oct 17 11:38:16 1994 Ian Lance Taylor + + * elfcode.h (elf_map_symbols): Sort the symbols into a new array, + rather than messing with Elf_Sym_Extra. Store the symbol index in + the udata.i field. + (swap_out_syms): Use outbound_syms as a pointer rather than as an + array. Don't worry about elf_sym_num. + * libelf.h (struct elf_sym_extra): Don't define. + (Elf_Sym_Extra): Don't define. + (struct elf_obj_tdata): Remove sym_extra field. + (elf_sym_extra): Don't define. + * elf32-hppa.c (elf32_hppa_backend_final_write_processing): Use + udata.i rather than elf_sym_extra array. + + * syms.c (asymbol): Change udata field into a union. + * bfd-in2.h: Rebuild. + * aoutx.h (NAME(aout,translate_symbol_table)): Use udata.p rather + than just udata. + * bout.c (perform_slip): Likewise. + * hp300hpux.c (MY(slurp_symbol_table)): Likewise. + * ieee.c (ieee_slurp_external_symbols): Likewise. + * linker.c (generic_link_add_symbol_list): Likewise. + (default_indirect_link_order): Likewise. + * oasys.c (oasys_slurp_symbol_table): Likewise. + * reloc16.c (bfd_perform_slip): Likewise. + * srec.c (fillup_symbols): Likewise. + * coffcode.h (get_index): Use udata.i rather than just udata. + (coff_slurp_symbol_table): Likewise. + * coffgen.c (set_index): Likewise. + * ecoff.c (ecoff_set_symbol_info): Likewise. + * elfcode.h (elf_symbol_from_bfd_symbol): Likewise. + * libecoff.h (ecoff_get_sym_index, ecoff_set_sym_index): Likewise. + * som.c (compare_syms): Likewise. + (som_prep_for_fixups): Likewise. + (som_write_fixups): Likewise. + + Use a hash table when writing out ELF symbol names. + * elfcode.h (elf_stringtab_init): New static function. + (bfd_new_strtab, bfd_add_to_strtab, bfd_add_2_to_strtab): Remove. + Change all callers to use elf_stringtab_init or + _bfd_stringtab_add, and get stringtab lengths using + _bfd_stringtab_size. + (elf_fake_sections): Change ignored argument to pointer to + boolean, and set the boolean to true if an error occurs. If an + error has already occurred, don't do anything. + (assign_section_numbers): Just set sh_size, not contents. + (elf_compute_section_file_positions): Pass the address of a + boolean to elf_fake_sections. Pass the address of a + bfd_strtab_hash to swap_out_syms. Write out the .strtab section. + (prep_headers): Change shstrtab to bfd_strtab_hash. + (swap_out_syms): Take a pointer to a bfd_strtab_hash as an + argument. Set it to the symbol names. + (NAME(bfd_elf,write_object_contents)): Write out the section + header names using _bfd_stringtab_emit. + (elf_debug_section): Remove first argument; get the section name + via the bfd_section pointer. Change caller. + (elf_bfd_final_link): Write out the symbol names using + _bfd_stringtab_emit. Likewise for the .dynstr section contents. + Free the symbol names at the end of the function. + (elf_link_input_bfd): Remove the last argument, output_names, + from relocate_section. Save the old symbol contents before + calling elf_link_output_sym, and restore them afterward. + * libelf.h (struct elf_link_hash_table): Change dynstr field to + struct bfd_strtab_hash. + (struct elf_backend_data): Remove last argument, output_names, + from elf_backend_relocate_section field. + (struct strtab): Don't define. + (struct elf_obj_tdata): Change strtab_ptr field to struct + bfd_strtab_hash. + * elf32-hppa.c (elf32_hppa_relocate_section): Remove last + argument, output_names. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-mips.c (mips_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + + * libbfd-in.h (DEFAULT_STRING_SPACE_SIZE): Don't define. + (bfd_add_to_string_table): Don't declare. + * libbfd.h: Rebuild. + * libbfd.c (bfd_add_to_string_table): Remove. + + * elfcode.h (elf_swap_shdr_in): Use bfd_section, not rawdata. + Clear contents field. + (bfd_section_from_shdr): In SHT_STRTAB case, check bfd_section, + not rawdata. Don't set rawdata if e_shstrndx. Use bfd_section + rather than rawdata in commented out code. In SHT_REL[A] case, + don't bother to check elf_section_data of section returned by + section_from_elf_index. + (elf_fake_sections): Set bfd_section, not rawdata. Don't set + size. + (elf_map_symbols): Don't set elf_num_section_syms. Don't create + section symbols that already exist. + (assign_file_position_for_section): Use bfd_section, not rawdata. + (section_from_elf_index): Just check bfd_section field. + (elf_section_from_bfd_section): Likewise. + (elf_debug_section): Don't print rawdata, contents, or size. + (elf_link_add_object_symbols): Don't error out if + section_from_elf_index returns NULL. + (elf_bfd_final_link): Check return value from + section_from_elf_index against NULL, not bfd_is_abs_section. + (elf_link_input_bfd): Don't check section_from_elf_index return + value. + * libelf.h (struct elf_obj_tdata): Remove num_section_syms field. + (elf_num_section_syms): Don't define. + * elf.c (elf_get_str_section): Store section contents in contents + field rather than rawdata field. + (elf_string_from_elf_section): Likewise. + (_bfd_elf_make_section_from_shdr): Store BFD section pointer in + bfd_section field rather than rawdata field. + * elf32-hppa.c (elf32_hppa_read_symext_info): Use bfd_section + rather than rawdata. + (elf32_hppa_size_stubs): Likewise. + (elf32_hppa_backend_symbol_table_processing): Don't set + symextn_hdr->size; just use sh_size. + * elf32-mips.c (mips_elf_final_write_processing): Use bfd_section + rathern than rawdata. + (mips_elf_section_from_shdr): Likewise. + (mips_elf_section_processing): Likewise. + (mips_elf_section_from_bfd_section): Remove rawdata check. + + * srec.c (pass_over): Set the start address for S7, S8 or S9. + +Fri Oct 14 19:15:46 1994 Ken Raeburn + + * VERSION: Updated to 2.5. + +Fri Oct 14 11:07:50 1994 Ian Lance Taylor + + * bfd.c (bfd_scan_vma): Cast end to be non const before passing it + to strtoul. + +Thu Oct 13 14:40:41 1994 Ian Lance Taylor + + * bfd.c (bfd_scan_vma): Pass end argument on to strtoul. + +Wed Oct 12 16:46:43 1994 Ken Raeburn + + * opncls.c (bfd_realloc): Deleted, since it's broken and fixing it + would make it slow. Besides, it isn't used much. + * elfcode.h (elf_map_symbols): Always allocate new storage for the + symbol table. + +Wed Oct 12 11:54:37 1994 Ian Lance Taylor + + * ecoff.c (ecoff_set_symbol_info): Mark local stProc, stLabel or + stabs symbols as BSF_DEBUGGING. + + * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Make + str1 and str2 const pointers. + + * Makefile.in (INSTALL): Use top level install.sh script. + * config/README (INSTALL): Remove. + * config/delta88.mh (INSTALL): Remove. + * config/i386v4.mh (INSTALL): Remove. + * config/irix4.mh (INSTALL): Remove. + * config/irix5.mh (INSTALL): Remove. + * config/ncrt3000.mh (INSTALL): Remove. + +Tue Oct 11 13:57:56 1994 Eric Youngdale (eric@andante.aib.com) + + * elf32-i386.c (elf_i386_check_relocs): Make sure that a symbol + with a global offset table entry or a procedure linkage table + entry is added to the dynamic symbol table. + * elf32-sparc.c (elf32_sparc_check_relocs): Likewise. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): If a symbol has + already gotten a procedure linkage table entry, change the + definition to the PLT entry. + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise. + +Tue Oct 11 17:12:00 1994 Ian Lance Taylor + + * lynx-core.c (lynx_core_file_p): SPARC Lynx appears to start + dumping the .data section in a core file at a page boundary. + +Mon Oct 10 16:24:44 1994 Ken Raeburn + + * cofflink.c (_bfd_coff_final_link): Cast argument to bfd_h_put_32 + to correct type. + (coff_read_string_table): Cast argument to bfd_h_get_32 to correct + type. + * elfcode.h (elf_link_output_extsym): Cast argument to + bfd_elf_hash to correct type. + + * elf32-sparc.c (elf_sparc_howto_table): The PC10, PC22, and + WPLT30 relocations are PC-relative. + +Thu Oct 6 12:57:26 1994 Richard Earnshaw (rwe@pegasus.esprit.ec.org) + + * aoutx.h (adjust_o_magic): Correctly initialize vma if the vma of + the text section was user-defined. + +Wed Oct 5 14:42:12 1994 Ian Lance Taylor + + * archive.c (bfd_construct_extended_name_table): SVR4 uses slash + newline at the end of the file name, not just newline. + +Tue Oct 4 11:23:12 1994 Ian Lance Taylor + + * ecoff.c (_bfd_ecoff_new_section_hook): Default section alignment + power to 4, rather than using align_power_min. + + * coffcode.h (coff_new_section_hook): Don't use align_power_min; + use COFF_DEFAULT_SECTION_ALIGNMENT_POWER instead. Force the .stab + and .stabstr sections to be aligned to no more than 2. Remove + COFF_SPARC special cases. + * coff-a29k.c: Define COFF_DEFAULT_SECTION_ALIGNMENT_POWER. + * coff-apollo.c, coff-go32.c, coff-h8300.c: Likewise. + * coff-h8500.c, coff-i386.c, coff-i960.c, coff-m68k.c: Likewise. + * coff-m88k.c, coff-rs6000.c, coff-sh.c, coff-sparc.c: Likewise. + * coff-we32k.c, coff-z8k.c: Likewise. + + * configure.in: Use ${config_shell} when running config.bfd. + + * cofflink.c (coff_link_input_bfd): Don't try to convert a long + filename if the offset field is zero. + + * elfcode.h (swap_out_syms): If the alignment of a common symbol + was not set, use a sensible default rather than zero. + +Mon Oct 3 16:04:29 1994 H.J. Lu (hjl@nynexst.com) + + * opncls.c (bfd_close): Honor umask when setting execution bits. + (bfd_close_all_done): Likewise. + +Mon Oct 3 04:41:49 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * rs6000-core.c (rs6000coff_core_p): Set SEC_HAS_CONTENTS flag + for .stack and .ldinfo sections. Cast coredata.c_tab to a + file_ptr to avoid warnings from gcc. + +Fri Sep 30 13:11:38 1994 Ian Lance Taylor + + * elfcode.h (elf_bfd_final_link): Remove assertion when a non + SEC_IN_MEMORY section is found in dynobj. This can happen when + linking PIC compiled code. + +Thu Sep 29 15:21:44 1994 Ken Raeburn + + * reloc.c (bfd_install_relocation): Change type of "data" to + bfd_byte *, to go along with yesterday's change. + + * elf.c (bfd_elf_print_symbol): Moved here from elf_print_symbol + in elfcode.h. (case bfd_print_symbol_all): Print symbol's size + field, except for common symbols; print their alignment. + * elfcode.h (elf_print_symbol): Deleted. + * libelf.h (bfd_elf_print_symbol): Declare. + (bfd_elf{32,64}_print_symbol): Replace declarations with macros. + + * syms.c (bfd_print_symbol_vandf): Show BSF_LOCAL and BSF_GLOBAL + in one column. Use the column freed up to show BSF_FUNCTION and + BSF_FILE. + +Thu Sep 29 12:29:01 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * syms.c (stt): Add .rdata and .rodata. + +Wed Sep 28 13:35:05 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * reloc.c (bfd_install_relocation): Cast data_start to bfd_byte * + before trying to add values to it. + +Tue Sep 27 16:47:58 1994 Ken Raeburn + + * elf32-hppa.c (elf32_hppa_backend_final_write_processing): Cast + return value from elf_sym_extra. + (elf32_hppa_build_stubs): Cast return value from bfd_zalloc. + (elf32_hppa_size_stubs): Cast return value from malloc. + + * gen-aout.c (main): Declare and initialize "arch". + + * cofflink.c (coff_link_add_symbols): Cast return value of + bfd_hash_allocate. + + * riscix.c (riscix_callback): Use PARAMS macro in prototype. + + * reloc.c (bfd_install_relocation): New function, mostly copied + from bfd_perform_relocation, adjusted for the assembler's needs. + * bfd-in2.h: Regenerated. + +Mon Sep 26 11:00:14 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elfcode.h (assign_file_positions_except_relocs): Align the + section VMA and the file position even if D_PAGED is not set. + + * bfd-in.h (bfd_seek): Change declaration to not mark fp const. + * bfd-in2.h: Rebuild. + * libbfd.c (bfd_seek): Don't mark parameters const, to avoid + conflicts with declaration. + +Fri Sep 23 15:15:31 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elfcode.h (map_program_segments): Don't abort if we allocated + too much space for the program header, only if we allocated too + little. + (assign_file_positions_except_relocs): Similar change. + +Tue Sep 20 13:17:07 1994 J.T. Conklin (jtc@phishhead.cygnus.com) + + * libaout.h: Fix comment. + * ns32knbsd.h: Changed M_NS32K_NETBSD to M_532_NETBSD to match + libaout.h. + +Tue Sep 20 15:23:21 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * Makefile.in: Rebuilt dependencies. + (BFD32_BACKENDS): Add sparcnetbsd.o. + (CFILES): Add ns32knetbsd.c and sparcnetbsd.c. + * targets.c: ns32knetbsd_vec was renamed to pc532netbsd_vec. + + * coff-sh.c (rtype2howto): Remove; unused. + (coff_sh_relocate_section): Remove unused local variable rstat. + (reloc_processing): Comment out; unused. + +Fri Sep 16 12:12:27 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * aoutx.h (aout_link_write_other_symbol): If h->indx is -2, then + always write it out even if it would normally be stripped. + (aout_link_input_section_std): If we find a reloc against a + stripped global symbol, force it to be written out rather than + merely calling unattached_reloc. + (aout_link_input_section_ext): Likewise. + (aout_link_reloc_link_order): Likewise. + +Wed Sep 14 15:37:19 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.h (struct somdata): New field sorted_syms. + (obj_som_sorted_syms): Accessor macro. + * som.c (som_object_setup): Initialize sorted_syms to NULL. + (som_prep_for_fixups): Sort a copy of the BFD's symbol table; + store the sorted symbol table in sorted_syms. + (som_write_fixups): Initalize tmp_reloc to NULL to make GCC happy. + (som_begin_writing): Similarly for exec_header. Pass the sorted + symbol table to som_write_symbol_strings. + (som_build_and_write_symbol_table): Use the sorted symbols rather + than the canonical symbol table. + + * som.h (som_symbol_type): Add "stringtab_offset" field. + * som.c (som_write_symbol_strings): Use "stringtab_offset" + rather than destroying the "name" field in the BFD symbol. + (som_build_and_write_symbol_table): Likewise. + +Wed Sep 14 15:06:55 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * aoutx.h (aout_link_write_symbols): Rename skip_indirect to + skip_next. If we find an N_WARNING symbol which has already been + written out, set skip_next. + + * libecoff.h (struct ecoff_tdata): Add field find_buffer. + * ecoff.c: Include aout/stab_gnu.h. + (ecoff_find_nearest_line): Handle stabs debugging information. + + * elfcode.h (elf_link_output_extsym): Keep a symbol marked as weak + even if it is referenced by another object. + +Tue Sep 13 17:57:00 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_fixup_formats): Case R_ENTRY (0xb3), set both + 'T' and 'U' to grab all the unwind information. + (som_set_reloc_info): Make 'U' unwind bits persist across + multiple SOM relocations. Set the addend field of an R_ENTRY + relocation to the value in 'T'; set the addend field on an + R_EXIT relocation to the value in 'U'. + + * som.h (som_symbol_type): Delete unwind field. + + * som.c (som_write_fixups): For R_ENTRY fixups, get 32bits of + unwind information from the addend field of the R_ENTRY, get the + other 32bits from the addend field of the R_EXIT. + (bfd_som_attach_unwind_info): Delete function and all references. + + * som.h (som_symbol_type): Delete unused a.out-related fields. + + * som.c (bfd_section_from_som_symbol): Use bfd_abs_section_ptr + instead of &bfd_abs_section. + + * som.c (som_object_setup): Handle exec_entry and exec_flags being + switched in executables created by the OSF1 linker. + (som_write_fixups): Handle R_EXIT just like the R_{F,L,R}SEL + fixups. Support R_ALT_ENTRY (handle just like R_EXIT). + +Tue Sep 13 16:04:07 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * cofflink.c (coff_link_input_bfd): syment_base is unsigned + so can't compare -ve numbers with it. + +Mon Sep 12 20:31:17 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * configure.in (shcoff_vec): Use cofflink.o now. + * coff-sh.c: Rewritten to use new fast coff backend. + +Tue Sep 13 16:23:57 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * aoutx.h (NAME(aout,final_link)): Don't assume that all the input + files are a.out. + +Tue Sep 13 11:09:39 1994 J.T. Conklin (jtc@rtl.cygnus.com) + + * configure.host (sparc-*-netbsd): use sparcnbsd. + (ns32k-*-netbsd): use ns32knbsd. + + * hosts/{nbsd,i386nbsd,ns32knbsd,sparcnbsd}.h: New files, NetBSD + host support. + + * sparcnetbsd.c: New file, adds support for NetBSD/sparc. + * config/sparc-nbsd.mt: Likewise. + + * netbsd.h: New file, definitions common to all netbsd ports. + * i386netbsd.c: Use it. + * ns32knetbsd.c: Use it. + + * Makefile.in, configure.in, targets.c, config/i386-nbsd.mt, + config/ns32k-nbsd.mt: canonicalize netbsd targets to conform to + file/variable naming conventions. + * i386netbsd.c: New file, renamed from netbsd386.c. + * ns32knetbsd.c: New file, renamed from netbsd532.c. + +Mon Sep 12 21:56:20 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_reloc_skip): Correct off-by-one error for 4-byte + R_NO_RELOCATION fixups. + (bfd_section_from_som_symbol): Return the absolute section if the + symbol isn't contained in any section in the output file. + (som_slurp_symbol_table): ST_PRI_PROG and ST_SEC_PROG symbols are + not function symbols (they are magic code labels which *can* be the + targets of cross space branches). $START$ is not a section symbol. + +Mon Sep 12 11:43:08 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coff-alpha.c (ecoffalpha_little_vec): Add SEC_CODE and SEC_DATA + to section_flags. + * coff-mips.c (ecoff_little_vec, ecoff_big_vec): Likewise. + + * elfcode.h (swap_out_syms): Set the type of an undefined symbol + to STT_FUNC if the BSF_FUNCTION flag is set. + + * cofflink.c (coff_link_input_bfd): If r_symndx is -1, don't + change it. + (_bfd_coff_generic_relocate_section): If r_symndx is -1, it is an + absolute reloc. Don't dump core using r_symndx as an array index. + * cf-m68klynx.c (coff_bfd_link_add_symbols): Define. + (lynx_link_add_symbols): New static function (copy of function in + coff-i386.c). + (coff_m68k_lynxrtype_to_howto): sym argument may be NULL. + * coff-i386.c (coff_i386_rtype_to_howto): Likewise. + * coff-a29k.c (coff_a29k_relocate_section): Handle an r_symndx + value of -1, meaning an absolute reloc. + + * ctor.c: Remove; obsolete. + * Makefile.in: Rebuild dependencies. + (BFD_LIBS): Remove ctor.o. + (CFILES): Remove ctor.c. + * libbfd.h: Rebuild. + +Mon Sep 12 01:58:47 1994 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (elf32_hppa_relocate_section): If there was a link + error of some sort (for example, undefined symbols), then do not + apply any relocs, just notify the user of the errors. + (elf32_hppa_backend_begin_write_processing): Do not build a symbol + extension section for an executable (it's useless). + (elf32_hppa_link_output_symbol_hook): Do nothing if there was a + link error of some sort (for example, undefined symbols). + (elf32_hppa_read_symext_info): Kludge. Turn off SEC_HAS_CONTENTS + for all the input symbol extension sections to keep the generic + BFD code happy. Temporarily turn it on to read the contents of + the symbol extension section. + +Sun Sep 11 21:58:59 1994 Jeff Law (law@snake.cs.utah.edu) + + * config/hppaosf.mh (RANLIB): Do not set. + * config/hppabsd.mh (RANLIB): Likewise. + +Sun Sep 11 22:50:49 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * cf-i386lynx.c: Remove #if 0 code. + (i386_lynxos_coff_object_p): Remove unused function. + (coff_bfd_link_add_symbols): Define. + (lynx_link_add_symbols): New static function. + * coffcode.h (coff_bfd_link_hash_table_create): If + coff_relocate_section is defined, only define this if not already + defined. + (coff_bfd_link_add_symbols, coff_bfd_final_link): Likewise. + + * linker.c (_bfd_generic_final_link): Handle + bfd_indirect_link_order explicitly, rather than via + _bfd_default_link_order. + (set_symbol_from_hash): New static function, broken out of + _bfd_generic_link_write_global_symbol. + (_bfd_generic_link_write_global_symbol): Symbol setting code moved + to set_symbol_from_hash; call it. + (default_indirect_link_order): Add generic_linker argument. + Change all callers. If false, set the generic symbols based on + the hash table entries. + +Fri Sep 9 11:51:49 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coffgen.c (coff_get_symtab): Reindented. Removed commented out + call to bfd_constructor_entry. + + Convert m68k COFF to use new COFF backend linker. + * coff-m68k.c (coff_relocate_section): Define. + * cf-m68klynx.c (coff_rtype_to_howto): Define. + (coff_m68k_lynx_rtype_to_howto): New static function. + * configure.in (m68kcoff_vec): Build cofflink.o. + (m68kcoffun_vec, m68klynx_coff_vec): Likewise. + +Thu Sep 8 16:20:38 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * coff-h8300.c (h8300_reloc16_extra_cases, case RELBYTE): Flag + overflows correctly. + +Wed Sep 7 19:01:42 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * libelf.h (struct elf_backend_data): Change second argument of + elf_backend_final_write_processing hook to boolean. + (struct elf_obj_tdata): Add linker field. + * elfcode.h (NAME(bfd_elf,write_object_contents)): Pass value of + tdata linker field to final_write_processing, rather than NULL. + (elf_bfd_final_link): Don't call final_write_processing hook. Set + tdata linker field to true. + * elf32-mips.c (mips_elf_final_write_processing): Change type of + second argument to boolean. + * elf32-hppa.c (elf32_hppa_backend_final_write_processing): + Likewise. + + * coff-go32.c (RTYPE2HOWTO): Fully parenthesize arguments. + * coff-i960.c (RTYPE2HOWTO): Likewise. + * coff-m88k.c (RTYPE2HOWTO): Likewise. + * coff-we32k.c (RTYPE2HOWTO): Likewise. + + Make i386 COFF use new COFF backend linker. + * coff-i386.c (RTYPE2HOWTO): Fully parenthesize arguments. + (coff_relocate_section): Define. + (coff_i386_rtype_to_howto): New function. + * configure.in (i386coff_vec): Use cofflink.o. + (i386lynx_coff_vec): Likewise. + + * coffcode.h (bfd_coff_backend_data): Add new field + _bfd_coff_rtype_to_howto. + (bfd_coff_rtype_to_howto): Define. + (coff_rtype_to_howto): Define to use RTYPE2HOWTO, if not already + defined. + (bfd_coff_std_swap_table): Initialize new field. + * cofflink.c (_bfd_coff_final_link): Allocate section_count + 1 + section_info structures, since the target_index is 1 based. + (coff_link_input_bfd): Set *secpp to bfd_com_section_ptr for a + common symbol. Adjust rel_hash by the output reloc count. + (_bfd_coff_generic_relocate_section): New function. + * libcoff-in.h (_bfd_coff_generic_relocate_section): Declare. + * libcoff.h: Rebuild. + * coff-alpha.c (alpha_ecoff_backend_data): Initialize new field. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + +Tue Sep 6 23:28:52 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_derive_misc_symbol_info): Treat undefined code + symbols and undefined symbols which no type in the same manner + if the associated BFD symbol has BSF_FUNCTION set. For a defined + symbol which no type, select a SOM type based on the flags of the + section containing the symbol. + (som_slurp_symbol_type): Set BSF_FUNCTION for undefined ST_STUB + or ST_CODE symbols (importing a non-function code symbol is + meaningless in SOM). + (som_set_reloc_info): Don't set "offset" to the section's vma; it + should always start at zero. + +Tue Sep 6 14:51:11 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + Add new style linker support to COFF backend. a29k only for now. + * cofflink.c: New file. + * libcoff-in.h: Include bfdlink.h. + (obj_coff_external_syms, obj_coff_strings): Define accessor macro. + (obj_coff_sym_hashes): Define accessor macro. + (struct coff_tdata): Add fields external_syms, strings, and + sym_hashes. + (struct coff_link_hash_entry): Define. + (struct coff_link_hash_table): Define. + (coff_link_hash_lookup, coff_link_hash_traverse): Define. + (coff_hash_table): Define. + (_bfd_coff_link_hash_table_create): Declare. + (_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare. + * coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz, + _bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global, + _bfd_coff_compute_section_file_positions, + _bfd_coff_relocate_section. + (bfd_coff_relsz, bfd_coff_swap_reloc_in): Define. + (bfd_coff_sym_is_global): Define. + (bfd_coff_compute_section_file_positions): Define. + (bfd_coff_relocate_section): Define. + (coff_mkobject_hook): Initialize obj_raw_syment_count and + obj_conv_table_size. + (coff_compute_section_file_positions): Set target_index of all + sections. Set output_has_begun field. + (coff_write_object_contents): Don't set target_index; now done by + coff_compute_section_file_positions. Remove obsolete handling of + scn_base and data_base. Don't bother to check that target_index + is positive, since it always is. Remove use of pad, which is + always zero. Check obj_raw_syment_count, not bfd_get_symcount, + for the number of symbols, but only write them out if + bfd_get_symcount is non-zero. Don't check obj_raw_syment_count + until after coff_write_symbols is called. + (coff_slurp_symbol_table): Use obj_raw_syment_count, not + bfd_get_symcount for the number of symbols. Don't set + obj_conv_table_size. + (coff_sym_is_global): New static function or macro. + (coff_slurp_reloc_table): Call coff_swap_reloc_in, not + bfd_swap_reloc_in. + (coff_bfd_link_hash_table_create): If coff_relocate_section is + defined, define as _bfd_coff_link_hash_table_create. + (coff_bfd_link_add_symbols): Similar change. + (coff_bfd_final_link): Similar change. + (coff_relocate_section): Define as NULL if not defined. + (bfd_coff_std_swap_table): Initialize new fields. + * coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count + and obj_conv_table_size here. + (coff_count_linenumbers): Reindent. If bfd_get_symcount is zero, + add up the line numbers from the sections. + (coff_write_symbols): Set obj_raw_syment_count, not + bfd_get_symcount. + (coff_pointerize_aux): Don't pointerize a nonpositive x_endndx + field. + (coff_get_normalized_symtab): Use obj_raw_syment_count, not + bfd_get_symcount. + (coff_print_symbol): If auxp->fix_end, print x_endndx value. + * coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in. + Reindent. Change argument type to PTR. + * coff-a29k.c (coff_a29k_relocate_section): New static function. + (coff_relocate_section): Define. + * configure.in (a29kcoff_big_vec): Compile cofflink.o. + * coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + * libcoff.h: Rebuilt. + * Makefile.in: Rebuilt dependencies. + (BFD32_BACKENDS): Add cofflink.o. + (CFILES): Add cofflink.c. + +Tue Sep 6 14:00:45 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * coffgen.c (coff_print_symbol, case bfd_symbol_print_all): Check + for section symbol, and print its aux fields with appropriate + labels. + + * Makefile.in (ALL_MACHINES): Added cpu-arm.o. + +Sun Sep 04 17:58:10 1994 Richard Earnshaw (rwe@pegasus.esprit.ec.org) + + * aoutx.h (NAME(aout,machine_type)): Recognize the ARM processor. + * archures.c, config.bfd, configure.host, libaout.h, reloc.c, + targets.c: Add support for the ARM. + * cpu-arm.c, riscix.c, config/riscix.mh, config/riscix.mt: New files. + + * aoutx.h (add_to_stringtable): Check that str isn't a NULL pointer. + +Fri Sep 2 14:10:30 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * reloc.c (enum bfd_reloc_code_real): Rewrote definition to use + new "chew" commands for simultaneous definition of enumerator and + enumerator name table. + (bfd_get_reloc_code_name): New function, for retrieving a symbolic + name associated with an enumerator. + * libbfd.h, bfd-in2.h: Regenerated. + +Tue Aug 30 21:24:54 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_write_fixups, case R_ENTRY): Handle case where no + unwind descriptor information is available. + +Tue Aug 30 11:43:30 1994 Eric Youngdale (ericy@cais.cais.com) + + * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add soname + argument, and use it to set DT_SONAME dynamic entry. + * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype. + (bfd_elf64_size_dynamic_sections): Update prototype. + * bfd-in2.h: Rebuilt. + +Fri Aug 26 15:47:57 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coffgen.c (coff_real_object_p): Set obj_raw_syment_count. + (coff_get_normalized_symtab): Verify obj_raw_syment_count, rather + than setting it. + +Thu Aug 25 10:44:53 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * archive.c (bsd_write_armap): Remove host dependencies. + + * aoutx.h (add_to_stringtab): Check for _bfd_stringtab_add error + before adding BYTES_IN_WORD. + + * coffgen.c (coff_find_nearest_line): Look for the best C_FILE, + not merely the first. + + * coffgen.c (coff_write_alien_symbol): If we are not using the + symbol, clear the name so that it is not put in the string table. + From Antti.Miettinen@ntc.nokia.com. + +Wed Aug 24 11:49:19 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coffgen.c (coff_print_symbol): Cast pointer different to long + and use %ld to print it. + * osf-core.c (osf_core_core_file_p): Remove unused variable + dseccnt. + * ecoffswap.h (ecoff_swap_ext_out): If ECOFF_64, clear remaining + bytes in bits2. + + * configure.host, config.bfd: Change i[34]86 to i[345]86. + * coffgen.c (coff_real_object_p): Set obj_conv_table_size here, + rather than waiting until coff_slurp_symbol_table. + (coff_write_alien_symbol): Just ignore BSF_DEBUGGING symbols. + From Antti.Miettinen@ntc.nokia.com. + + * section.c (bfd_make_section_anyway): Fix failure check of + bfd_make_empty_symbol. From Antti.Miettinen@ntc.nokia.com. + + * aoutx.h (translate_to_native_sym_flags): Use the output_section + (and output_offset) if there is one. + + * aoutx.h (aout_link_check_archive_element): Discard the symbols + if the archive element was not needed. + + * aoutx.h (aout_get_external_symbols): Ensure that a zero string + index yields an empty string. + (aout_link_write_symbols): If info->keep_memory is false, use name + from original hash table entry, not from entry in *sym_hash. + + * aoutx.h (struct aout_final_link_info): Add fields contents, + relocs, symbol_map and output_syms. + (NAME(aout,final_link)): Work out the largest section size, reloc + size, and number of symbols. Use them to preallocate buffers that + are large enough for all cases. + (aout_link_input_bfd): Use preallocated symbol_map. + (aout_link_write_symbols): Remove symbol_map argument; use + preallocated symbol_map instead. Change all callers. Use + preallocated output_syms. + (aout_link_input_section): Remove symbol_map argument. Change all + callers. Use preallocated contents and relocs. + (aout_link_input_section_std): Remove symbol_map argument; use + preallocated symbol_map instead. Change all callers. + (aout_link_input_section_ext): Likewise. + +Tue Aug 23 10:51:09 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * archive.c (_bfd_write_archive_contents): Don't update the + symbol map timestamp if there is no symbol map. From + schwab@issan.informatik.uni-dortmund.de (Andreas Schwab). + +Mon Aug 22 12:26:42 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * targets.c (BFD_JUMP_TABLE_ARCHIVE): Add _update_armap_timestamp. + (bfd_target): Add field _bfd_update_armap_timestamp. + * bfd.c (bfd_update_armap_timestamp): Define. + * bfd-in2.h: Rebuilt. + * libbfd-in.h (_bfd_noarchive_update_armap_timestamp): Define. + (_bfd_archive_bsd_update_armap_timestamp): Declare. + (_bfd_archive_coff_update_armap_timestamp): Define. + * libbfd.h: Rebuilt. + * archive.c (_bfd_write_archive_contents): Call + bfd_update_armap_timestamp instead of checking for a BSD archive + and calling bsd_update_armap_timestamp. + (_bfd_archive_bsd_update_armap_timestamp): Rename from + _bsd_update_armap_timestamp. Don't assume that armap_datepos is + already set. + * aout-target.h (MY_update_armap_timestamp): Define if not already + defined. + * coff-rs6000.c (rs6000coff_update_armap_timestamp): Define. + * ieee.c (ieee_update_armap_timestamp): Define. + * libecoff.h (_bfd_ecoff_update_armap_timestamp): Define. + * oasys.c (oasys_update_armap_timestamp): Define. + * som.c (som_update_armap_timestamp): Define. + + * hash.c: Copy string hash functions from aoutx.h. + * aoutx.h: String hash functions moved to hash.c. Retain + simplified versions of add_to_stringtab and emit_stringtab. + Change all callers to use new function and structure names. + * libbfd-in.h (_bfd_stringtab_init, _bfd_stringtab_free): Declare. + (_bfd_stringtab_size, _bfd_stringtab_add): Declare. + (_bfd_stringtab_emit): Declare. + * libbfd.h: Rebuilt. + +Mon Aug 22 10:49:37 1994 Eric Youngdale (ericy@cais.cais.com) + + * i386linux.c (linux_add_one_symbol): Create a fixup for any + defined absolute symbol, not just GOT or PLT symbols. + (linux_tally_symbols): Correct handling of references to defined + symbols. + +Thu Aug 18 16:29:57 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + Get ld -x -r to handle a.out set symbols correctly. + * aoutx.h (adjust_o_magic): If the .bss VMA was set outside of + BFD, pad the .data section up to the VMA of the .bss section. + (aout_link_add_symbols): If a set symbol does not get modified, + treat it as a local symbol. + (aout_link_write_symbols): Set the value of set symbols + correctly. Don't discard set symbols even if discarding local + symbols. + (aout_link_write_other_symbol): Don't abort on bfd_link_hash_new, + since it can now happen for set symbols. + + * elfcode.h (elf_fake_sections): Just check for ".rela" and + ".rel", not ".rela." and ".rel."; make this work by checking + use_rela_p. + * elf32-i386.c (elf_i386_check_relocs): Just check for ".rel", not + ".rel." + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_check_relocs): Just check for + ".rela", not ".rela." + (elf32_sparc_size_dynamic_sections): Likewise. + (elf32_sparc_relocate_section): Likewise. + +Wed Aug 17 16:54:18 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * linker.c (_bfd_generic_link_add_archive_symbols): Initialize + PASS to the old value + 1. + + * coffgen.c (coff_get_normalized_symtab): If a C_FILE symbol has + no aux entries, use the symbol name as the file name. + (coff_find_nearest_line): Look for the right C_FILE symbol, rather + than always using the first one. If there is a debugging symbol + after a function symbol, skip it. Add the section VMA to the line + offset, since it was subtracted out in coff_slurp_line_table. + +Tue Aug 16 16:53:00 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_prep_headers): If writing some form of an executable, + allocate and attach an exec header to the BFD private data. + (som_begin_writing): Don't fill fields of the exec header based + on BFD private data here (like the exec flags). Do not write + the exec header here. + (som_write_headers): Instead do it here. + * som.h (struct somdata): New field "exec_hdr" for the executable + file header. + (obj_som_exec_hdr): New accessor macro. + +Tue Aug 16 00:12:31 1994 Eric Youngdale (ericy@cais.cais.com) + + * i386linux.c (linux_link_create_dynamic_sections): Create section + named .linux-dynamic, not .dynamic. + (linux_add_one_symbol): Use .linux-dynamic, not .dynamic. + (bfd_linux_size_dynamic_sections): Likewise. + (linux_finish_dynamic_link): Likewise. + +Mon Aug 15 12:16:56 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coffgen.c (STRING_SIZE_SIZE): Define. + (coff_fix_symbol_name): Use STRING_SIZE_SIZE, not 4. + (coff_write_symbols, build_string_table): Likewise. + (coff_get_normalized_symtab): Likewise. + + * libcoff-in.h (obj_symbol_slew): Don't define. + (struct coff_tdata): Remove unused fields index_slew, raw_linenos, + and flags. + * libcoff.h: Rebuilt. + * coffcode.h (coff_mkobject): Don't initialize raw_linenos. + (coff_mkobject_hook): Don't initialize flags. + + * aout-target.h (MY_zmagic_contiguous): Define as 0 if not already + defined. + (MY(backend_data)): Use MY_zmagic_contiguous, not hardcoded 0. + * i386linux.c (MY_zmagic_contiguous): Define. + + * elfcode.h (bfd_section_from_shdr): If a SHT_SYMTAB section in a + shared object has SHF_ALLOC set, create a BFD section for it. + (elf_section_from_bfd_section): There may be a BFD section for a + SHT_SYMTAB section. + + * coffcode.h (styp_to_sec_flags): Add name argument. If no flags + are recognized, chose section flags based on the name. + (bfd_coff_backend_data): _bfd_styp_to_sec_flags_hook field: Add + name argument. + (bfd_coff_styp_to_sec_flags_hook): Add name argument. + (coff_compute_section_file_positions): Don't adjust the section + position by COFF_PAGE_SIZE unless SEC_ALLOC is set. + * libcoff.h: Rebuilt. + * coffgen.c (make_a_section_from_file): Pass section name to + bfd_coff_styp_to_sec_flags_hook. + * ecoff.c (_bfd_ecoff_styp_to_sec_flags): Add unused name + argument. + * libecoff.h (_bfd_ecoff_styp_to_sec_flags): Add name argument to + prototype. + +Fri Aug 12 11:22:40 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elfcode.h (section_from_elf_index): Correct check for invalid + section index. + + * elfcode.h (elf_link_add_object_symbols): If there is no symbol + table, try using the dynamic symbol table. From Eric Youngdale + . + + * configure.host (sparc-*-solaris2*): Use solaris2, not sysv4. + The linker depends upon configuring for solaris2. + * hosts/solaris2.h: New file; include hosts/sysv4.h. + * config/solaris2.mh: New file; copy of config/sysv4.mh. + +Wed Aug 10 13:09:38 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * aoutx.h (adjust_z_magic): Make sure data section is padded to + page boundary when the VMA is set by the calling program. From + Eric Youngdale . + +Mon Aug 8 17:18:49 1994 Stan Shebs (shebs@andros.cygnus.com) + + Update to ns32k support, from Ian Dall (dall@hfrd.dsto.gov.au). + * aout-ns32k.c: Add declarations that were in aout-ns32k.h, change + declarations to traditional form. + (MY_reloc_howto, MY_put_reloc): Change from macro to function. + (ns32k_relocate_contents): New function. + * aout-ns32k.h: Remove. + * cpu-ns32k.c: Add declarations that were in aout-ns32k.h, change + declarations to traditional form. + (ns32k_final_link_relocate): Call ns32k_relocate_contents. + * netbsd532.c: Reformat to standards, add copyright notice. + (ARCH): Don't define. + (aout-ns32k.h): Don't include. + * pc532-mach.c: Ditto. + +Mon Aug 8 17:55:52 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coff-i960.c (coff_i960_relocate): Don't try to convert relocs + against common symbols. + +Sat Aug 6 22:27:30 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * irix-core.c (irix_core_core_file_p): Ignore sections that + are not contained in the core file. + +Thu Aug 4 11:32:23 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coff-m68k.c (m68k_reloc_type_lookup): New function. + (coff_bfd_reloc_type_lookup): Define. + * cf-m68klynx.c (_bfd_m68kcoff_reloc_type_lookup): Define. + + * elfcode.h (elf_bfd_final_link): Force the vma of sections which + do not have SEC_ALLOC set to be 0. This is needed to handle + relocs against debugging sections. + +Wed Aug 3 16:45:41 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coff-i960.c (coff_i960_relocate): Rewrote to change relocs + against locally defined symbols into relocs against section + symbols, for VxWorks 5.1. + +Wed Aug 3 10:34:37 1994 Eric Youngdale (ericy@cais.cais.com) + + * i386linux.c (linux_add_one_symbol): Only handle + SHARABLE_CONFLICTS specially if BSF_CONSTRUCTOR is set. Set hashp + for a GOT or PLT symbol. Set jump field of fixup for a PLT symbol. + (linux_tally_symbols): Check section of real symbol. When looking + for a builtin fixup, check builtin and jump flags. Create no more + than one fixup, and always create one if the real symbol is in the + absolute section. Only strip absolute symbols. + +Wed Aug 3 05:08:24 1994 D. V. Henkel-Wallace (gumby@cygnus.com) + + * coffcode.h (coff_write_object_contents): set internal_a.magic to + LYNXCOFFMAGIC whenever 68k, SPARC or i386 LynxOS + (yes, they have the same magic number!) + +Tue Aug 2 10:43:21 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * hp300hpux.c (BMAGIC): Define as HPUX_DOT_O_MAGIC, to make test + in aoutx.h work correctly. + + * coff-i960.c (coff_i960_relocate): New function. + (howto_rellong, howto_iprmed): Use it as special_function. + + * libbfd-in.h: Move declarations of bfd_read, bfd_write, bfd_seek, + bfd_tell, bfd_flush, and bfd_stat from here... + * bfd-in.h: ...to here, to make them visible to programs which + know more about the object file format than BFD does. + * libbfd.h, bfd-in2.h: Rebuilt. + +Mon Aug 1 17:55:53 1994 Fred Fish (fnf@cygnus.com) + + * ptrace-core.c (ptrace_unix_core_file_p): Convert zalloc usage + to bfd_zalloc. + +Mon Aug 1 12:04:40 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elf64-sparc.c (ELF_MAXPAGESIZE): Define. + + ELF linker patches from Eric Youngdale . + * elfcode.h (elf_link_create_dynamic_sections): Set type of + _DYNAMIC to STT_OBJECT. + (NAME(bfd_elf,record_link_assignment)): Always create hash table + entry. Set type to STT_OBJECT. + (elf_link_output_extsym): Don't set type of weak defined symbol to + STB_WEAK if symbol was referenced. + (map_program_segments): Check DYNAMIC as well as EXEC_P. + (assign_file_positions_except_relocs): Likewise. + * elf32-i386.c (elf_i386_create_dynamic_sections): Set type of + _GLOBAL_OFFSET_TABLE to STT_OBJECT. + (elf_i386_check_relocs): Ignore local PLT32 relocs. + (elf_i386_relocate_section): Treat local PLT32 relocs as PC32. + + * elfcode.h (elf_adjust_dynamic_symbol): Correct weak symbol + handling again. + + * elfcode.h (elf_slurp_reloc_table): Don't try to read the relocs + if there aren't any. + + * configure.host (sparc-*-solaris2*): Use sysv4, not solaris2. + * hosts/solaris2.h: Remove. + * config/solaris2.mh: Remove. + +Sun Jul 31 14:27:04 1994 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c, elf32-hppa.h: Update comment reflecting which + HPPA ELF spec the code implements. + +Tue Jul 26 17:38:01 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * cpu-i960.c (MAX_ARCH): New macro. + (compatible): Use it in computing array bounds. Put comma after + last entry in array, for regularity. + (arch_info_struct): Adjust spacing for easier reading. + + * coff-i960.c (howto_rellong, howto_iprmed, howto_optcall): Use + HOWTO macro. + + * cpu-i960.c (JX): Define as bfd_mach_i960_jx. + (scan_960_mach): Recognize jx machine. + (MAX_ARCH): Define to be JX. + (compatible): Add JX row to array. + (arch_info_struct): Add JX entry. + + * archures.c (bfd_mach_i960_jx): New macro. + * bfd-in2.h: Regenerated. + + * coffcode.h (coff_set_arch_mach_hook): For F_I960JX, set machine + to bfd_mach_i960_jx. + (coff_set_flags): For bfd_mach_i960_jx, set F_I960JX. + +Tue Jul 26 11:04:00 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elfcode.h (elf_adjust_dynamic_symbol): When handling a weak + symbol, correct check to see whether the equivalent normal symbol + was referenced. + + Add support for creating shared libraries under i386 ELF and SPARC + ELF. Based on patches by Eric Youngdale . + * libelf.h (struct elf_link_hash_entry): Remove copy_offset field. + Add got_offset and plt_offset fields. + (ELF_LINK_HASH_REF_DYNAMIC_MULTIPLE): Don't define. + (ELF_LINK_HASH_DEF_DYNAMIC_MULTIPLE): Don't define. + (ELF_LINK_HASH_NEEDS_COPY): Define. + (struct elf_backend_data): Add check_relocs field. + (struct bfd_elf_section_data): Change relocs from PTR to + Elf_Internal_Rela *. + (struct elf_obj_tdata): Add local_got_offsets field. + (elf_local_got_offsets): Define accessor macro. + (bfd_elf32_link_create_dynamic_sections): Declare. + (bfd_elf32_link_record_dynamic_symbol): Declare. + (bfd_elf64_link_create_dynamic_sections): Declare. + (bfd_elf64_link_record_dynamic_symbol): Declare. + * elfcode.h (elf_slurp_reloc_table): Don't use the section data + relocs field. + (elf_link_record_dynamic_symbol): Make globally visible. Use + macro to rename to NAME(bfd_elf,link_record_dynamic_symbol). + (elf_link_add_object_symbols): If creating a shared library, put + make all local symbols dynamic. Don't bother with the + DYNAMIC_MULTIPLE flags. Call the check_relocs backend function if + it is defined. + (elf_link_create_dynamic_sections): Make globally visible. Use + macro to rename to NAME(bfd_elf,link_create_dynamic_sections). If + creating a shared library, make sure that _DYNAMIC is added as a + dynamic symbol. + (elf_link_read_relocs): New function. + (NAME(bfd_elf,record_link_assignment)): If creating a shared + library, always create symbols, and always make them dynamic. + (elf_bfd_final_link): Permit creation of shared libraries. + (elf_link_input_bfd): Use elf_link_read_relocs to get the relocs. + * elf.c (_bfd_elf_link_hash_newfunc): Don't initialize + copy_offset. Initialize got_offset and plt_offset. + * elf32-target.h (elf_backend_check_relocs): Define as 0 if not + defined. + (elf32_bed): Initialize check_relocs field. + * elf64-target.h (elf_backend_check_relocs): Define as 0 if not + defined. + (elf64_bed): Initialize check_relocs field. + * elf32-i386.c (elf_howto_table): Change R_386_PLT32 and + R_386_GOTPC to be pc_relative and pcrel_offset. + (elf_i386_pic_plt0_entry): Define. + (elf_i386_pic_plt_entry): Define. + (elf_i386_create_dynamic_sections): Create a .got.plt section, and + define _GLOBAL_OFFSET_TABLE_ at the start of it. If creating a + shared library, make sure that _GLOBAL_OFFSET_TABLE_ is added as a + dynamic symbol. Don't create .rel.bss if creating a shared + library. + (elf_i386_check_relocs): New function. + (elf_i386_adjust_dynamic_symbol): Don't make a PLT entry if the + symbol already has one. When making a PLT entry, set plt_offset. + Don't create a copy reloc when creating a shared library. Don't + set copy_offset, just set ELF_LINK_HASH_NEEDS_COPY. + (elf_i386_allocate_dynamic_section): Remove. + (elf_i386_size_dynamic_sections): Look through all the sections + rather than assuming we know their names. Remove any empty reloc + or plt sections. Only add a DT_DEBUG entry if not creating a + shared library. Only add a DT_PLTGOT entry if there is a PLT. + Add a DT_TEXTREL entry if required. + (elf_i386_relocate_section): Permit undefined symbols when + creating a shared library. Handle the special relocation types + specially. + (elf_i386_finish_dynamic_symbol): Create a PLT entry if plt_offset + is set. If creating a shared library, produce a PIC PLT entry. + Only mark a PLT symbol as undefined if it was not defined by a + regular object file. Create a GOT entry if got_offset is set. + Create a copy reloc if ELF_LINK_HASH_NEEDS_COPY is set. + (elf_i386_finish_dynamic_sections): Change the handling of + DT_RELSZ to simply subtract out the size of .rel.plt. If creating + a shared library, produce PIC PLT code. + (elf_backend_check_relocs): Define. + * elf32-sparc.c (elf_sparc_howto_table): Change R_SPARC_GOT10, + R_SPARC_GOT22, and R_SPARC_PC10 to not warn about reloc overflow. + (elf32_sparc_create_dynamic_sections): If creating a shared + library, make sure that _GLOBAL_OFFSET_TABLE_ is added as a + dynamic symbol, and set the type to STT_OBJECT. Likewise for + _PROCEDURE_LINKAGE_TABLE_. Don't create .rel.bss if creating a + shared library. + (elf32_sparc_check_relocs): New function. + (elf32_sparc_adjust_dynamic_symbol): Don't make a PLT entry if the + symbol already has one. When making a PLT entry, set plt_offset. + Don't create a copy reloc when creating a shared library. Don't + set copy_offset, just set ELF_LINK_HASH_NEEDS_COPY. + (elf32_sparc_allocate_dynamic_section): Remove. + (elf32_sparc_size_dynamic_sections): Look through all the sections + rather than assuming we know their names. Only add a DT_DEBUG + entry if not creating a shared library. Add a DT_TEXTREL entry if + required. + (elf32_sparc_relocate_section): Permit undefined symbols when + creating a shared library. Handle the special relocation types + specially. + (elf32_sparc_finish_dynamic_symbol): Create a PLT entry if plt_offset + is set. Only mark a PLT symbol as undefined if it was not defined + by a regular object file. Create a GOT entry if got_offset is + set. Create a copy reloc if ELF_LINK_HASH_NEEDS_COPY is set. + (elf32_sparc_finish_dynamic_sections): Store dynobj in a local + variable. + (elf_backend_check_relocs): Define. + +Mon Jul 25 12:21:07 1994 Stan Shebs (shebs@andros.cygnus.com) + + * configure.in (pc532mach_vec): Change to pc532machaout_vec. + * config.bfd (ns32k-*-netbsd*): Use ns32k-nbsd as bfd_name. + * Makefile.in (ALL_MACHINES): Add cpu-ns32k.o. + (BFD32_BACKENDS): Add aout-ns32k.o, netbsd532.o, m88kmach3.o, + pc532-mach.o. + * targets.c (pc532machaout_vec): Use instead of pc532mach_vec. + * config/pc532-mach.mt (DEFAULT_VECTOR): Ditto. + (SELECT_VECS): Remove. + * config/ns32k-nbsd.mt: New file, was ns32k-netbsd.mt. + * config/ns32k-netbsd.mt: Remove, name too long. + +Fri Jul 22 11:07:14 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * linker.c (generic_link_check_archive_element): When changing a + symbol to common, set the alignment. + (_bfd_generic_link_add_one_symbol): When creating a common symbol, + set the alignment. + * aoutx.h (aout_link_check_ar_symbols): When changing a symbol to + common, set the alignment. + (aout_link_add_symbols): Restrict the alignment of a common symbol + to the alignment power given by the architecture. + * libelf.h (struct elf_link_hash_entry): Remove align field. Add + copy_offset field. + * elfcode.h (elf_link_add_object_symbols): Store alignment in + new bfd_link_hash_entry field, not in elf_link_hash_entry field. + (elf_link_output_extsym): Similar change when getting alignment. + * elf.c (_bfd_elf_link_hash_newfunc): Don't initialize align. Do + initialize copy_offset. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use copy_offset + field rather than align field. Get alignment using bfd_log2 + rather than switch. + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise. + * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use copy_offset, + not align. + * elf32-sparc.c (elf32_sparc_finish_dynamic_symbol): Likewise. + + * aoutx.h (NAME(aout,some_aout_object_p)): Just check + STAT_FOR_EXEC, don't check MACH. + * m88kmach3.c (MACH): Don't define. + * config/i386-mach3.mt (TDEFINES): Define STAT_FOR_EXEC. + * config/m88k-mach3.mt (TDEFINES): Likewise. + * config/mips-mach3.mt (TDEFINES): Likewise. + +Thu Jul 21 17:24:31 1994 Stan Shebs (shebs@andros.cygnus.com) + + * i386mach3.c: Reverted to version from before Jul 5 1994 changes. + +Thu Jul 21 12:26:01 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * reloc.c (struct reloc_howto_struct): Remove special_function1. + It's the wrong way to do things. + (HOWTO): Change accordingly. + (HOWTO2): Remove. + (_bfd_final_link_relocate): Remove references to + special_function1. + * bfd-in2.h: Rebuilt. + * aoutx.h (aout_link_input_section_std): Remove references to + special_function1. + (aout_link_reloc_link_order): Likewise. + +Wed Jul 20 15:46:44 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add rpath + argument. If it is not NULL, use it to set DT_RPATH. + * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype. + (bfd_elf64_size_dynamic_sections): Likewise. + * bfd-in2.h: Rebuilt. + +Sat Jul 16 21:10:39 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elfcode.h (elf_get_dynamic_symtab_upper_bound): If there is no + dynamic symtab, return error. + + * libelf.h (ELF_LINK_HASH_DEFINED_WEAK): Define. + * elfcode.h (elf_link_add_object_symbols): If symbol is defined as + weak, set ELF_LINK_HASH_DEFINED_WEAK. + (elf_link_output_extsym): If symbol is defined as weak, mark it + STB_WEAK. + + * libelf.h (struct bfd_elf_section_data): Add relocs field. + (shdr_name): Remove; unused. + * elfcode.h (elf_slurp_reloc_table): Rewrote to handle both REL + and RELA relocs. Free up the unswapped relocs. Permit the relocs + to be cached in the section_data. Correct the reloc address. + (elf_slurp_reloca_table): Remove. + (elf_canonicalize_reloc): Rewrote. + (elf_link_input_bfd): Permit the relocs to be cached in the + section data. + +Sat Jul 16 13:55:38 1994 Stan Shebs (shebs@andros.cygnus.com) + + * config.bfd (m88*-harris-cxux*): Recognize. + * hosts/harris.h (POSIX_UTIME, HAVE_PROCFS): Define. + + * configure.host (m68*-atari-sysv4*): New host. + (m68*-cbm-sysv4*): Use m68kv4 instead of amix. + * hosts/amix.h: Remove. + * hosts/m68kv4.h: New file, was amix.h. + +Thu Jul 14 15:12:24 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * reloc.c (enum bfd_reloc_code_real, bfd_type, struct + reloc_howto_struct, reloc_howto_type, HOWTO, HOWTO2): Copied + changes over from bfd-in2.h so they get generated properly next + time someone runs "make headers". + * bfd-in2.h: Rebuilt. + + * targets.c (netbsd532_vec, pc532mach_vec): Declare const. + (m88kmach3_vec): Restore deleted declaration. + + * configure.in: Alphabetize target vector names. + + * config/pc532mach.mh: New file. + (HDEPFILES, HDEFINES): Define here. + * config/pc532-mach.mt (HDEPFILES, HDEFINES): Deleted. + * config/ns32k-netbsd.mt (HDEPFILES, HDEFINES): Deleted. + + Sun Jul 10 00:04:20 1994 Ian Dall (dall@hfrd.dsto.gov.au) + + * pc532-mach.c: New File. pc532-mach a.out format. + + * netbsd532.c: New file. pc532-netbsd532 a.out format. + + * hosts/pc532mach.h: New file. pc532-mach host support. + + * cpu-ns32k.c: New file. ns32k support cpu specific code rather + than format specific code. + + * config/pc532-mach.mt: New file. Support for pc532-mach target. + + * config/ns32k-netbsd.mt: New file. Support for netbsd532 target. + + * aout-ns32k.c, aout-ns32k.h: New files supporting aout format for + ns32k series. + + * targets.c: Add netbsd532_vec and pc532machaout_vec into + bfd_target_vector array. Move netbsd386_vec to alphabetic order + location. + + * reloc.c (_bfd_final_link_relocate) Add support for + special_function1 in howto. + + * libaout.h: add M_NS32032, M_NS32532, M_532_NETBSD entries in + machine_type enum. + + * configure.in: add pc532mach_vec and netbsd532_vec entries. + + * config.bfd: add pc532mach host entries. Use for both + ns32k-pc532-mach and ns32k-pc532-netbsd. + + * config.bfd: it doesn't work to use i386-mach3 for ns32k*-*-mach. + add ns32k-pc532-mach* and ns32k-*-netbsd* entries. + + * bfd-in2.h: Add ns32k specific relocations to bfd_reloc_code_real + enum. + + * bfd-in2.h: Add special_function1 to struct howto. Change HOWTO + and NEWHOWTO macros to make special_function1 NULL. Neww HOWTO2 + macro. + + * bfd-in2.h: Split definition of struct reloc_howto_struct + and corresponding typedef into two statements. + + * bfd-in2.h: Add entry bfd_arch_ns32k to bfd_architecture enum. + + * archures.c: Add bfd_ns32k_arch prototype, and entry in + archures_init_table. + + * aoutx.h (aout_link_reloc_link_order): Allow for target dependent + MY_put_reloc macro. Allow for target dependent special_function1 + to apply the relocation. + + * aoutx.h (aout_link_input_section_std): Allow for target + dependent determination of reloc howto. Allow for target dependent + special_function1 to apply the relocation. + + * aoutx.h (get_reloc_upper_bound): Detect bss and return 0. + + * aoutx.h (slurp_reloc_table): Detect bss and succesfully read + zero reloc entries. + + * aoutx.h (machine_type): Add bfd_arch_ns32k case. + + * aoutx.h: Stat to determine executable status if STAT_FOR_EXEC + is defined (not just MACH). Use fstat instead of stat and check + for fstat error. + + * aoutx.h: Allow target dependent swap_std_reloc_{in,out}. + + * aoutx.h: Allow CTORS reloc info to be in target dependent reloc + table. + + * aout-target.h: Apply SWAP_MAGIC (if defined) after + swap_exec_header_in, otherwise we have magic in the wrong order. + +Thu Jul 14 11:47:27 1994 Stan Shebs (shebs@andros.cygnus.com) + + * coff-sparc.c (sparccoff_vec): Have leading underscores. + +Tue Jul 12 12:08:10 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * aix386-core.c, aoutf1.h, cisco-core.c, elfcode.h, hppabsd-core.c, + hpux-core.c, irix-core.c, lynx-core.c, osf-core.c, ptrace-core.c, + rs6000-core.c, trad-core.c: Remove SEC_ALLOC flag from .reg + sections, .reg sections are not allocated and contain debug + information only. + * osf-core.c (make_bfd_asection, osf_core_core_file_p): Use + bfd_make_section_anyway instead of building unique section names. + +Tue Jul 12 11:41:22 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * libelf.h (bfd_elf32_swap_symbol_in): Declare. + (bfd_elf32_swap_symbol_out): Declare. + (bfd_elf64_swap_symbol_in, bfd_elf64_swap_symbol_out): Declare. + * elf32-hppa.c (elf32_hppa_args_hash_table_init): Correct cast. + + * aout-encap.c (ARCH): Don't define. Obsolete. + * aout0.c, aoutx.h, gen-aout.c, hp300bsd.c, hp300hpux.c: Likewise. + * i386aout.c, i386bsd.c, i386dynix.c, i386linux.c: Likewise. + * i386lynx.c, m68klynx.c, mipsbsd.c, netbsd386.c: Likewise. + * newsos3.c, sparclynx.c, sunos.c: Likewise. + +Mon Jul 11 20:08:23 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * section.c (STD_SECTION): Make the sixth argument boolean, not + the seventh. From gary@tuva.pacsemi.oz.au (gary kopff). + +Sun Jul 10 09:12:02 1994 D. V. Henkel-Wallace (gumby@cygnus.com) + + * aoutx.h (bfd_free_cached_info): Change name of FREE to BFCI_FREE + in order not to collide with LynxOS's definition of FREE in + /usr/include/sys/proc.h + +Thu Jul 7 14:18:06 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * reloc.c (bfd_perform_relocation): Don't clobber the relocation + value for coff-Intel-little or coff-Intel-big. Hack upon hack. + +Thu Jul 7 10:10:34 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * aoutx.h (howto_table_std): Add entry for GOT relocations + which are present in sun3 shared libraries, to avoid assertions + when reading the dynamic relocations. + +Thu Jul 7 10:19:20 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.h (R_HPPA_COMPLEX): Fix dumb typo. + +Wed Jul 6 19:21:57 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * hosts/sysv4.h (qsort, strtol): Don't declare. + + * elfcode.h (elf_link_output_sym): Don't call output_symbol_hook + if it is NULL. + + * elf32-mips.c (mips_elf_final_write_processing): Add ignored info + argument to correspond to recent libelf.h change. + +Wed Jul 6 00:48:57 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * coff-alpha.c (alpha_ecoff_mkobject_hook): New hook to + additionally copy object type information from the alpha file + header to the BFD flags. + (alpha_ecoff_backend_data): Use it. + (ecoffalpha_little_vec): Add DYNAMIC to object_flags. + * aout64.c: Fix typo in conditional QMAGIC definition. + +Wed Jul 6 00:13:17 1994 Jeff Law (law@snake.cs.utah.edu) + + * hppabsd-core.c (hppabsd_core_core_file_p): Sanity check the + value of clicksz to help weed out non HPPA BSD core files. + +Tue Jul 5 13:26:02 1994 Stan Shebs (shebs@andros.cygnus.com) + + Mach 3 support. + * config.bfd (m88*-*-mach3*, mips*-dec-mach3*, mips*-*-mach3*): + New targets. + * configure.host (i[34]86-*-mach3*, ns32k-*-mach3*): Recognize + "mach3" instead of "mach". + (m88*-*-mach3*, mips*-dec-mach3*, mips*-*-mach3*): New hosts. + * targets.c (m88kmach3_vec): New target vector. + (bfd_target_vector): Add i386mach3_vec and m88kmach3_vec, but + inside #if 0. + * aoutx.h (some_aout_object_p) [MACH]: Recognize executables by + checking for execute permission, instead of looking at entry + point. + * i386mach3.c: Update, define MACH, N_TXTOFF, N_TXTADDR, + N_SHARED_LIB, don't include aout/*.h files, etc. + * m88kmach3.c: New file, m88k Mach 3 target. + * config/m88k-mach3.mt, config/mips-mach3.mt: New files, target + makefile fragments. + * config/i386mach3.mh, config/m88kmach3.mh, config/mipsmach3.mh: + New files, host makefile fragments. + * hosts/m88kmach3.h, hosts/mipsmach3.h: New files, host definitions. + +Tue Jul 5 13:56:52 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elfcode.h (swap_out_syms): Get alignment of common symbol from + st_value field of saved ELF symbol information, if there is any. + +Mon Jul 4 19:13:32 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.h (R_HPPA_COMPLEX): Define. + * elf32-hppa.h (R_HPPA_COMPLEX): Define. + (elf32_hppa_reloc_type): Delete R_PARISC_STUB_CALL_17. + +Fri Jul 1 12:07:41 1994 Jeff Law (law@snake.cs.utah.edu) + + * Support code for enabling the new style linker for PA ELF. + * elfcode.h (swap_symbol_in, swap_symbol_out): Externalize. + (elf_compute_section_file_positions): Pass link_info to + the begin_write_processing hook. + (bfd_elf_write_object_contents): Pass NULL for new link_info + argument to final_write_processing hook. + (elf_link_output_sym): Accept new "input_section" argument for + the symbols's input section. All callers changed. Call the + link_output_symbol_hook if it's defined. + (elf_bfd_final_link): Call the final_write_processing hook if + it's defined. + * libelf.h (elf_backend_link_output_symbol_hook): Declare. + (elf_backend_begin_write_processing): Add new "info" argument. + (elf_backend_final_write_processing): Likewise. + * elf32-target.h (elf_backend_link_output_symbol_hook): Provide + a default definition. + (elf32_bed): Add elf_backend_link_output_symbol_hook. + * elf64-target.h: Likewise. + + * Major rework of the PA ELF code. Uses the new style BFD + linker, major cleanups. + * hppa_stubs.h: Rewrite from scratch. Much smaller and simpler. + * elf32-hppa.h: Delete all symbol extension related code. + (hppa_look_for_stubs_in_section): Delete decl. + (elf32_hppa_size_stubs, elf32_hppa_build_stubs): New decls. + * elf32-hppa.c: Symbol extension stuff moved form elf32-hppa.h + into elf32-hppa.c. Do not include aout64.h. + (typdef hppa_stub_type): Delete. + (elf32_hppa_stub_name_list_struct): Delete. + (elf32_hppa_stub_description_struct): Delete. + (arg_reloc_type): Use simpler enumerations. All references changed. + (arg_location, arg_reloc_relocation): Likewise. + (elf32_hppa_symextn_map_struct): Delete. + (get_symbol_value): Delete. + (elf32_hppa_get_sym_extn): Delete. + (find_stubs, new_stubs, type_of_mismatch): Delete. + (find_stub_by_name, add_stub_by_name): Delete. + (hppa_elf_stub_finish, hppa_elf_stub_reloc): Delete. + (hppa_elf_arg_reloc_needed): Renamed. Simplify. + (hppa_elf_build_linker_stub, hppa_elf_create_stub_sec): Delete. + (hppa_elf_long_branch_needed_p): Delete. + (hppa_look_for_stubs_in_section): Delete. + (hppa_elf_get_section_contents): Delete. + (elf32_hppa_backend_symbol_processing): Delete. + (elf32_hppa_backend_section_processing): Delete. + (elf32_hppa_backend_section_from_shdr): Delete. + (elf32_hppa_backend_fake_sections): Delete. + (elf32_hppa_backend_section_from_bfd_section): Delete. + (NEW_INSTRUCTION): Delete. + (CURRENT_STUB_OFFSET): Delete. + (elf32_hppa_relocate_section): New function. + (elf32_hppa_bfd_final_link_relocate): New function. + (elf32_hppa_size_symext): New function. + (elf32_hppa_link_output_symbol_hook): New function. + (elf32_hppa_read_symext_info): New function. + (elf32_hppa_add_symbol_hook): New function. + (elf32_hppa_name_of_stub): New function. + (elf32_hppa_size_of_stub): New function. + (elf32_hppa_build_one_sub): New function. + (elf32_hppa_build_stubs): New function. + (elf32_hppa_size_stubs): New function. + (linker, stub and argument hash tables): Add appropriate + structures, definitions and functions to implement all three + hash tables. + (hppa_elf_relocate_insn): Don't need argument location information + in this function. + (add_entry_to_symext_chain): Accept a symbol's argument location + information rather than the symbol itself. All callers changed. + (hppa_elf_gen_reloc_type): Simplify. + (hppa_elf_set_section_contents): Stub section is no longer special. + (hppa_elf_reloc): Greatly simplify. + (elf32_hppa_begin_write_processing): Accept link_info argument. + Handle being called from the BFD backend linker. + (elf32_hppa_final_write_processing): Likewise. + (elf_hppa_tc_make_sections): No longer call stub_finish. + +Mon Jun 27 18:07:06 1994 Steve Chamberlain (sac@cirdan.cygnus.com) + + * section.c (bfd_get_section_contents): Put in parens to get + precedence right. + +Sun Jun 26 18:08:29 1994 Jeff Law (law@snake.cs.utah.edu) + + * libelf.h (relocate_section): New argument "output_names" added + to prototype. + * elfcode.h (elf_link_input_bfd): New argument "output_names" + added to prototype of relocate_section. Pass the output symbol + names to relocate_section. + * elf32-i386.c (elf_i386_relocate_section): Use "output_names" to + determine the name of a local symbol. + * elf32-mips.c (mips_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + +Fri Jun 24 08:15:42 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + Add Solaris BCP (the part of Solaris which allows it to run + SunOS4 a.out files) core file handling. + * aoutf1.h (external_solaris_bcp_core, swapcore_solaris_bcp): + New structure and its swap in function. + (internal_sunos_core): New member c_data_addr, to receive the + start address of the data section in the core file. + (swapcore_sun3, swapcore_sparc, sunos4_core_file_p): Use it. + (sunos4_core_file_p): Recognize Solaris BCP core file. + (sunos4_core_file_matches_executable_p): Always indicate match + for Solaris BCP core files. + +Thu Jun 23 15:31:28 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + Preliminary support for generating shared libraries, from Eric + Youngdale . + * elfcode.h (prep_headers): If DYNAMIC, set e_type to ET_DYN. + (elf_link_add_object_symbols): If generating a shared library, + create dynamic sections for first input BFD with the right format. + (elf_link_create_dynamic_sections): Don't create .interp section + if creating a shared library. + (elf_link_input_bfd): Skip dynamic sections in input file. + (elf_bfd_final_link): If creating a shared library, it's OK for + dynobj to have sections which are not SEC_IN_MEMORY. + * elf32-i386.c (elf_i386_size_dynamic_sections): Only set .interp + section if not creating a shared library. + * elf32-sparc.c (elf_sparc_size_dynamic_sections): Likewise. + + * elfcode.h (elf_object_p): Don't set DYNAMIC just because there + is an SHT_DYNAMIC section. + + * cf-i386lynx.c (i386coff_vec): Don't include DYNAMIC in + object_flags. + * coff-sparc.c (sparccoff_vec): Likewise. + * hppabsd-core.c (hppabsd_core_vec): Likewise. + + * aoutx.h (NAME(aout,some_aout_object_p)): Don't set SEC_RELOC + just because DYNAMIC is set. + +Thu Jun 23 12:53:41 1994 David J. Mackenzie (djm@rtl.cygnus.com) + + * configure.in: Change --with-targets to --enable-targets and + --with-64-bit-bfd to --enable-64-bit-bfd. + * Makefile.in, mpw-make.in, targets.c: Change comments. + +Wed Jun 22 17:59:59 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * config.bfd (powerpc-*-elf*): New target, just like + powerpc-*-sysv4*. + + * linker.c (FAIL): Undefine macro before defining as enum. + +Wed Jun 22 10:52:47 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * linker.c (_bfd_generic_link_add_archive_symbols): Initialize + pass from abfd->archive_pass, and save it there as well. + + * hash.c (bfd_hash_allocate): Don't call bfd_set_error if + obstack_alloc returns NULL unless the size is non-zero. + + * linker.c (archive_hash_allocate): Define. + (_bfd_generic_link_add_archive_symbols): Use archive_hash_allocate + rather than obstack_alloc, for clarity. + + * elfcode.h (elf_get_reloc_upper_bound): Correct. + + * aout64.c (BMAGIC, QMAGIC): Define if not already defined. From + Peter Schauer . + + Linux ZMAGIC support from Eric Youngdale . + * libaout.h (struct aoutdata): Add field zmagic_disk_block_size. + * aout-target.h (MY(callback)): Only set alignment according to + architecture if the section sizes are aligned to that alignment, + for backward compatibility. + (MY(set_sizes)): Initialize zmagic_disk_block_size field. + * aoutx.h (adjust_z_magic): Set ztih if using q_magic_format. Set + text section filepos to zmagic_disk_block_size if not ztih. Use a + different padding algorithm if not ztih. + * i386linux.c (MY_text_includes_header): Don't define. + + * aoutx.h (aout_link_check_ar_symbols): Just skip N_STAB and N_FN + symbols; don't look them up in the hash table. From + ralphc@pyramid.com (Ralph Campbell). + +Tue Jun 21 11:47:20 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coff-go32.c (go32coff_archive_p): Remove unused function. + + * section.c (bfd_abs_section): Make const. + (bfd_abs_section_ptr, bfd_is_abs_section): Define. + (bfd_und_section): Make const. + (bfd_und_section_ptr, bfd_is_und_section): Define. + (bfd_com_section): Make const. + (bfd_com_section_ptr): Define. + (bfd_ind_section): Make const. + (bfd_ind_section_ptr, bfd_is_ind_section): Define. + (bfd_abs_symbol, bfd_com_symbol): Make const. + (bfd_und_symbol, bfd_ind_symbol): Likewise. + (global_syms): Cast initialization of section field. + (STD_SECTION): Define as const, and cast initializations. + * bfd-in2.h: Rebuilt. + * Many files: Change uses of bfd_abs_section, etc., to use + bfd_abs_section_ptr or bfd_is_abs_section, etc. + +Mon Jun 20 11:06:27 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * Many files: change all bfd_target vectors to be const. Change + all uses of bfd_target * to be const bfd_target *. Change + bfd_target_vector and bfd_default_vector arrays to be const + bfd_target * const *. + + * ecoff.c, libecoff.h, ecoffswap.h, coff-alpha.c, coff-mips.c, + elf32-mips.c: Renamed all externally visible ECOFF routines which + are local to BFD to start with _bfd_ecoff instead of just ecoff. + + * ecoff.c (ecoff_swap_tir_in): Change input argument to const. + (ecoff_swap_tir_out): Likewise. + (ecoff_swap_rndx_in, ecoff_swap_rndx_out): Likewise. + (ecoff_slurp_symbolic_info): Add new arguments to correspond to + read_debug_info entry point in ecoff_debug_swap structure. + Change all calls. + * libecoff.h (ecoff_slurp_symbolic_info): Change declaration. + * ecoffswap.h (ecoff_swap_tir_in, ecoff_swap_tir_out): Declare. + (ecoff_swap_rndx_in, ecoff_swap_rndx_out): Declare. + * coff-alpha.c (alpha_ecoff_backend_data): Initialize new + ecoff_debug_swap fields. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + * elf32-mips.c (mips_elf_read_ecoff_info): Undefine READ. + (mips_elf_ecoff_debug_swap): Initialize new ecoff_debug_swap + fields. + * configure.in (bfd_elf32_bigmips_vec): Use ecoff.o and + ecofflink.o. + (bfd_elf32_littlemips_vec): Likewise. + (ecoff_big_vec, ecoff_little_vec): Likewise. + (ecoffalpha_little_vec): Likewise. + * Makefile.in (BFD_LIBS): Remove ecoff.o and ecofflink.o. + (BFD32_BACKENDS): Add ecoff.o and ecofflink.o. + + * aoutx.h (NAME(aout,final_link)): Check flavour of sub, not abfd, + when computing reloc sizes. From Eric Youngdale + . + * elfcode.h (elf_bfd_final_link): Don't try to compute maximum + reloc count or size for a non-ELF file. + + * mipsbsd.c (MY_final_link_callback): Define to avoid warning. + + * hp300hpux.c (MY_final_link_callback): Define to avoid warning. + (BMAGIC, QMAGIC): Define; used by aoutx.h. + (MY(slurp_symbol_table)): Change translate_from_native_sym_flags + calls to use new parameters. + +Fri Jun 17 14:45:32 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aout-target.h (MY(callback)): Set the alignments of the text, + data and bss sections after determining the architecture. + + * sunos.c (sunos_add_one_symbol): Treat a common symbol from a + dynamic object as being in the .bss section of the object, rather + than as being undefined. + +Fri Jun 17 11:16:50 1994 Jeff Law (law@snake.cs.utah.edu) + + * libhppa.h (bfd_hppa_insn2fmt, hppa_rebuild_insn): Make INLINE. + + * elf32-hppa.h (elf_hppa_final_processing): Delete decl. + +Thu Jun 16 23:36:23 1994 Jeff Law (law@snake.cs.utah.edu) + + * elfcode.h (elf_link_input_bfd): Don't try to read local symbols + if there aren't any in the input file. + +Thu Jun 16 14:25:22 1994 Eric Youngdale (ericy@cais.cais.com) + + * i386linux.c: Many new functions and definitions for linker + support for Linux shared libraries. + * bfd-in.h (bfd_linux_size_dynamic_sections): Declare. + * bfd-in2.h: Rebuild. + +Thu Jun 16 14:23:46 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * config.bfd: If second argument is ``_'', then, instead of + echoing config file name, echo whether target uses leading + underscores on symbol names. Add appropriate settings to + different cases. Used by binutils/configure.in to set default for + c++filt. + + * elfcode.h (elf_bfd_final_link): If trying to generate a shared + object, warn and return false. + + * aoutx.h (NAME(aout,some_aout_object_p)): Accept BMAGIC objects + and treat them as OMAGIC. + +Wed Jun 15 18:02:21 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + Enable sparc v9 support for release. Note that this is still a + work in progress, pending release of an ABI specification. + * config.bfd, configure.in: Include sparc v9 elf config. + * elfcode.h (prep_headers): Handle sparc v9 (64 bit). + * reloc.c (bfd_reloc_code_real): New reloc types. + * elf64-sparc.c: Implement elf64-sparc target. + * Makefile.in, targets.c: Updated. + +Wed Jun 15 01:34:07 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libelf.h (struct elf_obj_tdata): New field dt_needed_name. + (elf_dt_needed_name): New accessor macro. + * elfcode.h (elf_link_add_object_symbols): If elf_dt_needed_name + is set, use that instead of the filename for the DT_NEEDED dynamic + entry. + * elf.c (bfd_elf_set_dt_needed_name): New function. + * bfd-in.h (bfd_elf_set_dt_needed_name): Declare. + * bfd-in2.h: Rebuilt. + + * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add sinterpptr + argument, and set it to the .interp section. + * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype. + (bfd_elf64_size_dynamic_sections): Likewise. + * bfd-in2.h: Rebuilt. + + * coff-sparc.c (SWAP_OUT_RELOC_EXTRA): Define to clear the r_spare + field of the reloc rather than letting it be garbage. + + * archive.c (bfd_slurp_armap): Recognize __.SYMDEF/ as well as + __.SYMDEF; the former was used in old Linux archives. From + jrs@world.std.com (Rick Sladkey). + + * i386linux.c (i386linux_write_object_contents): Define; like + MY(write_object_contents) in aout-target.h, but set MACHTYPE to + M_386. From jrs@world.std.com (Rick Sladkey). + (MY_write_object_contents): Define. + + * aoutx.h (translate_from_native_sym_flags): Treat N_SETV symbols + as N_DATA symbols. + (aout_link_add_symbols): Likewise. + + * aoutx.h: Rewrite symbol duplicate elimination to use BFD hash + tables. + (struct stringtab_entry, struct stringtab_data): Remove. + (HASHMAXLEN, HASH_CHAR, hash, compare, log2, emit_strtab): Remove. + (struct strtab_hash_entry, struct strtab_hash): Define. + (strtab_hash_newfunc, strtab_hash_lookup): Define. + (stringtab_free, emit_stringtab): Define. + (stringtab_init, add_to_stringtab): Rewrite. + (NAME(aout,write_syms)): Use new stringtab code. + (struct aout_final_link_info, NAME(aout,final_link)): Likewise. + (aout_link_write_symbols, aout_link_write_other_symbol): Likewise. + + * bfd-in.h (BFD_TRADITIONAL_FORMAT): Define new BFD flag to + request BFD to write object in the traditional format, whatever + that means for the particular backend. + * bfd-in2.h: Rebuilt. + + * hash.c (bfd_hash_allocate): If obstack_alloc fails, set + bfd_error_no_memory. + +Tue Jun 14 13:00:04 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libaout.h (struct aoutdata): Add q_magic_format to subformat + enum. + * aout-target.h (MY_bfd_copy_private_bfd_data): Define as function + if not already defined. Copy subformat information. + (MY_text_includes_header): Define as 0 if not already defined. + (MY(backend_data)): Use MY_text_includes_header rather than 0. + (MY_final_link_callback): Rename from final_link_callback, and + define only if MY_final_link_callback is not already defined. + (MY_bfd_final_link): Rename use of final_link_callback to + MY_final_link_callback. + * aoutx.h (NAME(aout,some_aout_object_p)): Handle QMAGIC like + ZMAGIC, but set the subformat to q_magic_format. Abort if the + magic number if not recognized. + (adjust_z_magic): Use QMAGIC if q_magic_format. + * i386linux.c (MY_text_includes_header): Define as 1. + (i386linux_bfd_final_link): New static function. + (MY_bfd_final_link): Define as i386linux_bfd_final_link. + + * aoutx.h (translate_to_native_sym_flags): Check both section and + output_section against sections of abfd. + + * libecoff.h (struct ecoff_link_hash_entry): Change type of + written from boolean to char. Add new field small. + * ecoff.c (ecoff_link_hash_newfunc): Initialize written to 0 + rather than false. Initialize small to 0. + (ecoff_link_add_externals): If ECOFF type is scSUndefined, set + small. If small is set, and hash table type is common, force the + symbol into a section named SCOMMON and change the ECOFF type from + scCommon to scSCommon. + (ecoff_link_write_external): Set written to 1 rather than true. + * coff-mips.c (mips_relocate_section): Correct JMPADDR reloc + overflow check to consider section VMA of input file. + +Mon Jun 13 14:20:07 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutf1.h (aout_32_sunos4_write_object_contents): Handle a + machine type of 68000. + * aoutx.h (NAME(aout,machine_type)): Add new argument unknown. + Set *unknown to true if machine type is really unknown, as opposed + to M_UNKNOWN for the 68000. + (NAME(aout,set_arch_mach)): Change NAME(aout,machine_type) call + accordingly. + * libaout.h (NAME(aout,machine_type)): Add new argument to + prototype. + +Sun Jun 12 20:21:03 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (EXEC_AUX_ID): Define based on availablity of HPUX_AUX_ID + or HIUX_AUX_ID. + (som_begin_writing): Use EXEC_AUX_ID instead of HPUX_AUX_ID. + (som_write_armap): Use CPU_PA_RISC1_0 as the magic number. Note + som.c is careful to always define CPU_PA_RISC1_0. + +Sat Jun 11 16:32:30 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Add weak symbols as an extension to a.out. + * aoutx.h (sym_in_text_section): Don't define. + (sym_in_data_section, sym_in_bss_section): Likewise. + (sym_is_undefined, sym_is_global_defn): Likewise. + (sym_is_debugger_info, sym_is_fortrancommon): Likewise. + (sym_is_absolute, sym_is_indirect): Likewise. + (translate_from_native_sym_flags): Rewrite for clarity. Rearrange + arguments and change caller. Handle weak symbols. + (translate_to_native_sym_flags): Likewise. + (aout_link_check_ar_symbols): Don't ignore weak symbols. Pull + object in from archive if a weak defintion is found for an + existing undefined symbol. + (aout_link_add_symbols): Put all cases in switch. Set flags of an + undefined symbol to 0. Handle weak symbols. + (aout_link_write_symbols): Handle weak symbols. + (aout_link_write_other_symbol): Likewise. + (aout_link_input_section_std): Likewise. + (aout_link_input_section_ext): Likewise. + * sunos.c (sunos_write_dynamic_symbol): Likewise. + +Fri Jun 10 13:25:13 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (NAME(aout,canonicalize_reloc)): Handle .bss section. + (NAME(aout,get_reloc_upper_bound)): Likewise. + + * coff-i960.c (coff_i960_reloc_type_lookup): Add BFD_RELOC_CTOR. + * linker.c (_bfd_generic_link_write_global_symbol): Don't assume + the section of a common symbol is not NULL. + +Wed Jun 8 23:15:53 1994 Stu Grossman (grossman@cygnus.com) + + * nlmcode.h (nlm_object_p): Set EXEC_P and start address for GDB. + +Wed Jun 8 23:57:34 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (aout_get_external_symbols): Don't try to read the + strings if there are no symbols. + (aout_link_write_other_symbol): Use the output section when + working out the type. + +Tue Jun 7 13:25:08 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (assign_section_numbers): Put shstrtab, symtab and + strtab sections at end of file. Avoids bug in some versions of + SVR4 strip. From Eric Youngdale . + + * coffcode.h (styp_to_sec_flags): If COFF_PAGE_SIZE is defined, + set SEC_DEBUGGING for STYP_INFO sections. + (coff_compute_section_file_positions): If COFF_PAGE_SIZE is + defined, and D_PAGED is set, set the file position equal to the + section VMA modulo COFF_PAGE_SIZE. + * coffgen.c (coff_real_object_p): If F_EXEC is set, set D_PAGED. + * coff-i386.c: Set D_PAGED in BFD target. + (COFF_PAGE_SIZE): Define. + * coff-m68k.c, coff-sparc.c: Likewise. + +Mon Jun 6 10:57:28 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (bfd_section_from_shdr): Don't turn a reloc section + into a BFD section just because SHF_ALLOC is set; require that it + not use the normal symbol table. + (elf_section_from_bfd_section): Corresponding change. + + Better indirect and warning symbol handling inspired by Stuart + Quick . + * linker.c (enum link_action): Add REF, MIND, CWARN, REFC. + (link_action): Change UNDEF_ROW/def and UNDEFW_ROW/def from NOACT + to REF. Change UNDEF_ROW/indr and UNDEFW_ROW/indr from CYCLE to + REFC. Change DEF_ROW/indr and COMMON_ROW/indr from CYCLE to MDEF. + Change DEFW_ROW/indr from CYCLE to NOACT. Change INDR_ROW/indr + from MDEF to MIND. Change INDR_ROW/warn from WARNC to CYCLE. + Change WARN_ROW/def and WARN_ROW/indr from MWARN to CWARN. Change + WARN_ROW/com from MWARN to WARN. Change WARN_ROW/warn from NOACT + to CYCLE. Change SET_ROW/warn from WARNC to CYCLE> + (_bfd_generic_link_add_one_symbol): Handle REF, MIND, CWARN and + REFC. If a new indirect symbol has been referenced, push the + reference down to the symbol it points to. FIx handling of WARN. + * aoutx.h (translate_from_native_sym_flags): If N_WARNING, don't + clobber e_type of next symbol. + (translate_to_native_sym_flags): Likewise. + (aout_link_write_symbols): Loop on bfd_link_hash_warning as well + as bfd_link_hash_indirect. + + * libaout.h (struct aout_link_hash_entry): New field written. + * aoutx.h (NAME(aout,link_hash_newfunc)): Initialize written. + (aout_link_write_symbols): Use written, not root.written. + (aout_link_write_other_symbol): Likewise. + * sunos.c (sunos_scan_dynamic_symbol): Likewise. + * libecoff.h (struct ecoff_link_hash_entry): New field written. + * ecoff.c (ecoff_link_hash_newfunc): Initialize written. + (ecoff_link_write_external): use written, not root.written. + * genlink.h (struct generic_link_hash_entry): New field written. + * linker.c (_bfd_link_hash_newfunc): Don't initialize written. + (generic_link_hash_newfunc): Initialize written. + (_bfd_generic_link_output_symbols): Use written, not root.written. + (_bfd_generic_link_write_global_symbol): Likewise. + (_bfd_generic_reloc_link_order): Likewise. + + * libecoff.h (ecoff_data_type): Add linker field. + * ecoff.c (ecoff_write_object_contents): Check new tdata linker + field, rather than outsymbols being non-NULL, to decide whether to + output the symbols and relocs. + (ecoff_bfd_final_link): Set new tdata linker field to true. + + * ecoff.c (ecoff_bfd_copy_private_bfd_data): Don't try to copy + data to a non-ECOFF file. + + * libbfd-in.h: Add warning that libbfd.h is a generated file. + * libbfd.h: Rebuilt. + +Sun Jun 5 15:02:30 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Changes to support ELF strip and objcopy on dynamically linked + files. + * elfcode.h (elf_fake_sections): Add prototype. + (bfd_section_from_shdr): Make a BFD section from an SHT_HASH + section, and from an SHT_DYNSYM section, and from the dynamic + string table section. + (elf_object_p): Set D_PAGED if there is a program header. + (elf_make_sections): Remove. + (fix_up_strtabs): Remove. + (elf_fake_sections): Rewrite. Now sets sh_entsize. + (assign_section_numbers): Rewrite. Now sets sh_link and sh_info + for all sections. + (elf_compute_section_file_positions): Don't call obsolete + functions elf_make_sections or fix_up_strtabs. + (swap_out_syms): Set sh_addralign to FILE_ALIGN rather than 4. + (NAME(bfd_elf,write_object_contents)): Permit writing DYNAMIC + objects. + (elf_section_from_bfd_section): Treat SHT_DYNSYM like other normal + sections. If an SHT_REL or SHT_RELA section is allocated or uses + an unusual symbol table, permit a BFD section to map to it. + Permit most SHT_STRTAB sections to have a BFD section mapped to + them. + (elf_bfd_final_link): Don't set sh_link, sh_info or sh_entsize + fields of dynamic sections here; do it in assign_section_numbers. + * elf32-target.h, elf64-target.h: Add D_PAGED to permitted object + flags. + + * elf.c (_bfd_elf_make_section_from_shdr): Only set SEC_DATA if + SEC_LOAD is set, rather than checking SEC_ALLOC. + + * libbfd-in.h (bfd_realloc): Change last arg to "size_t size". + +Fri Jun 3 10:58:02 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_write_object_contents): Don't compute the file header's + checksum here. + (som_write_headers): Instead do it here. + + * libbfd.h (bfd_realloc): Change last arg to "size_t size". + +Thu Jun 2 17:39:22 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * hosts/sun3.h: Include . Don't declare free, exit or + getenv. + + Add linker support for SunOS shared libraries. + * sunos.c: Include bfdlink.h. Add many new functions and + definitions for SunOS shared library support. + * bfd-in.h (bfd_sunos_record_link_assignment): Declare. + (bfd_sunos_size_dynamic_sections): Declare. + * bfd-in2.h: Rebuilt. + * aoutx.h (struct aout_link_hash_entry): Move to libaout.h. + (struct aout_link_hash_table): Likewise. + (aout_link_hash_lookup, aout_link_hash_traverse): Likewise. + (aout_hash_table): Likewise. + (NAME(aout,link_hash_newfunc)): Rename from aout_link_hash_newfunc + and make externally visible. + (NAME(aout,link_hash_table_init)): New function. + (NAME(aout,link_hash_table_create)): Call + NAME(aout,link_hash_table_init), not _bfd_link_hash_table_init. + (aout_link_add_symbols): Don't fail if no symbols. If it exists, + call add_dynamic_symbols backend entry point for dynamic objects. + Use add_one_symbol backend entry point if it exists. + (NAME(aout,final_link)): Call finish_dynamic_link backend entry + point, if it exists. + (aout_link_input_bfd): For a dynamic object, call + link_dynamic_object backend entry point, if it exists. + (aout_link_write_other_symbol): Call write_dynamic_symbol backend + entry point, if it exists. + (aout_link_input_section): Don't read the relocs if they have + already been read. + (aout_link_input_section_std): When doing a final link, for a + reloc against an external symbol, call check_dynamic_reloc backend + entry point, if it exists. + (aout_link_input_section_ext): Likewise. + * libaout.h: Protect against multiple inclusion. Include + bfdlink.h. + (struct aout_link_hash_entry): Move in from aoutx.h. + (struct aout_link_hash_table): Likewise. + (aout_link_hash_lookup, aout_link_hash_traverse): Likewise. + (aout_hash_table): Likewise. + (struct aout_backend_data): Add fields add_dynamic_symbols, + add_one_symbol, link_dynamic_object, write_dynamic_symbol, + check_dynamic_reloc, and finish_dynamic_link. + (struct aout_section_data_struct): Define new structure. + (aout_section_data): Define new accessor macro. + (NAME(aout,link_hash_newfunc)): Declare. + (NAME(aout,link_hash_table_init)): Declare. + * aoutf1.h (sunos4_aout_backend): Initialize new aout_backend_data + fields. + * aout-target.h (MY(backend_data)): Likewise. + * i386aout.c (MY(backend_data)): Likewise. + * i386mach3.c (MY(backend_data)): Likewise. + * mipsbsd.c (MY(backend_data)): Likewise. + * sparclynx.c (sparclynx_aout_backend): Likewise. + + * aoutx.h (NAME(aout,slurp_symbol_table)): Don't zero out cached + until we know it is non-NULL. + (aout_link_write_symbols): Don't skip a warning symbol even if it + has already been written out. If skipping an indirect symbol, + skip the next symbol as well. + +Wed Jun 1 14:37:50 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * hosts/sun3.h: Don't declare qsort, malloc or realloc. + +Thu May 26 13:56:03 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * nlmcode.h (nlm_swap_auxiliary_headers_in): Cast bfd_byte pointer + to char pointer to avoid compiler warnings. + + * dep-in.sed: Remove spaces before colons. + + Merged changes back in from FSF gas release 2.3: + + * Makefile.in (stmp-bfd.h): Wrap `if' block around grep + invocation, to avoid a bug in BSD 4.4 make. + + From Ralph Campbell: + * mipsbsd.c (mips_fix_jmp_addr): If symbol is undefined, return an + error. + (mips_fix_hi16_s): Ditto. + + Fri May 13 21:21:00 1994 DJ Delorie (dj@ctron.com) + + * makefile.dos: define a default target, or archives won't work + due to multiple matches. + + Wed May 11 22:32:00 1994 DJ Delorie (dj@ctron.com) + + * configure.bat: update for latest files + * makefile.dos: update for correct targets and sources + * coff-go32.c: [new] go32's COFF format (i386coff with underscores) + * targets.c: add go32coff target + * makefile.in: add coff-go32.c support + +Thu May 26 10:10:21 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_prep_headers): Do not set the system_id here, private + bfd data has not been copied yet. + (som_write_headers): Instead do it here. + +Tue May 24 16:17:18 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Make MIPS ELF use new ELF backend linker. No shared library + support yet. + * elf32-mips.c (bfd_mips_elf32_swap_gptab_in): New function. + (bfd_mips_elf32_swap_gptab_out): New function. + (mips_elf_object_p): If last symbol is LOCAL, set elf_bad_symtab. + (mips_elf_final_write_processing): Set sh_info field for .gptab.* + sections. + (mips_elf_fake_sections): Set sh_entsize for .gptab.* sections. + (mips_elf_read_ecoff_info): Read and free external symbols last, + not first, for clarity. + (struct mips_elf_link_hash_entry): Define new structure. + (struct mips_elf_link_hash_table): Define new structure. + (mips_elf_link_hash_lookup): Define new macro. + (mips_elf_link_hash_traverse): Define new macro. + (mips_elf_hash_table): Define new macro. + (mips_elf_link_hash_newfunc): New static function. + (mips_elf_link_hash_table_create): New static function. + (mips_elf_add_symbol_hook): New static function. + (struct extsym_info): Define new structure. + (mips_elf_get_extr, mips_elf_set_index): Remove. + (mips_elf_output_extsym): New static function. + (gptab_compare): New static function. + (mips_elf_final_link): Rewrite to use ELF backend linker, and to + merge gptab information in input files. + (mips_elf_relocate_hi16): New static function. + (mips_elf_relocate_section): New static function. + (bfd_elf32_bfd_link_hash_table_create): Define as macro before + including elf32-target.h. + (elf_backend_relocate_section): Likewise. + (elf_backend_add_symbol_hook): Likewise. + * elf.c (_bfd_elf_link_hash_newfunc): Rename from + elf_link_hash_newfunc and make globally visible. Change caller. + (_bfd_elf_link_hash_table_init): New function, broken out of + _bfd_elf_link_hash_table_create. + (_bfd_elf_link_hash_table_create): Use + _bfd_elf_link_hash_table_init. + * libelf.h (struct elf_obj_tdata): Add new field bad_symtab. + (elf_bad_symtab): Define new accessor macro. + (_bfd_elf_link_hash_newfunc): Declare. + (_bfd_elf_link_hash_table_init): Declare. + * elfcode.h (elf_object_p): Call backend object_p hook after + swapping in all the section headers. + (map_program_segments): Correct typo: Internal for External. + (elf_link_add_object_symbols): If elf_bad_symtab is set, read all + the symbols. Skip STB_LOCAL symbols rather than giving an error. + (elf_bfd_final_link): If elf_bad_symtab is set, allocate space for + all symbols, not just locals. + (elf_link_output_extsym): Only skip a symbol not mentioned by a + regular file if it is mentioned by a dynamic object. + (elf_link_input_bfd): If elf_bad_symtab is set, read all the + symbols. + +Fri May 20 13:38:23 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_set_reloc_info): Do not set any relocation info + for SOM fixups which are never passed to BFD. + +Fri May 20 11:57:05 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-mips.c (mips_relocate_section): Add MIPS_R_JMPADDR overflow + checking. + + * elf32-i386.c (elf_i386_size_dynamic_sections): Add DT_DEBUG to + the dynamic linking information for the benefit of the debugger. + From Peter Schauer. + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. + + * elf.c (_bfd_elf_make_section_from_shdr): New function, based on + code repeated three times in bfd_section_from_shdr in elfcode.h. + * libelf.h (_bfd_elf_make_section_from_shdr): Declare. + * elfcode.h (bfd_section_from_shdr): Use new function + _bfd_elf_make_section_from_shdr to create BFD sections. If a + reloc section does not use the main symbol table, or it is part of + the process image, treat it as a normal section, not relocs. + * elf32-mips.c (mips_elf_section_from_shdr): Use new function + _bfd_elf_make_section_from_shdr. + +Thu May 19 11:37:11 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elf32-target.h, elf64-target.h: Change ar_max_namelen value from + 15 to 14 to match SVR4 ar. + + Add support for ELF shared libraries. Loosely based on work by + Eric Youngdale . + * libelf.h (struct elf_backend_data): Add new fields for dynamic + linking: elf_backend_create_dynamic_sections, + elf_backend_adjust_dynamic_symbol, + elf_backend_size_dynamic_sections, + elf_backend_finish_dynamic_symbol, + elf_backend_finish_dynamic_sections. + (struct elf_link_hash_entry): Change type of align field to + bfd_size_type. Add fields dynindx, dynstr_index, weakdef, + elf_link_hash_flags. + (struct elf_link_hash_table): Add fields dynobj, dynsymcount, + dynstr, bucketcount. + (bfd_elf32_swap_reloc_in, bfd_elf32_swap_reloc_out): Declare. + (bfd_elf32_swap_reloca_in, bfd_elf32_swap_reloca_out): Declare. + (bfd_elf32_swap_dyn_in, bfd_elf32_swap_dyn_out): Declare. + (bfd_elf32_add_dynamic_entry): Declare. + (bfd_elf64_swap_reloc_in, bfd_elf64_swap_reloc_out): Declare. + (bfd_elf64_swap_reloca_in, bfd_elf64_swap_reloca_out): Declare. + (bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_out): Declare. + (bfd_elf64_add_dynamic_entry): Declare. + * elfcode.h (Elf_External_Dyn): Define. + (elf_swap_reloc_in): Define as macro using NAME. Make externally + visible. + (elf_swap_reloc_out): Likewise. + (elf_swap_reloca_in, elf_swap_reloca_out): Likewise. + (elf_swap_dyn_in, elf_swap_dyn_out): Define as macro using NAME + and as new externally visible function. + (elf_fake_sections): Set section type of dynamic sections based on + section names. + (elf_write_phdrs): Remove. + (assign_file_position_for_section): Add new align argument. + Change all callers. + (get_program_header_size): New static function. + (struct seg_info): Remove. + (map_program_segments): Completely rewrite. + (assign_file_positions_except_relocs): Completely rewrite. + (assign_file_positions_for_relocs): Don't set a file position for + sections which already have one. Don't bother to align the file + position here. + (section_from_elf_index): Handle SHT_HASH and SHT_DYNAMIC + section types. + (elf_section_from_bfd_section): Likewise. + (elf_slurp_symbol_table): If section_from_elf_index fails, just + use bfd_abs_section rather than returning an error. + (elf_sizeof_headers): Make useful. + (elf_link_record_dynamic_symbol): New static function. + (elf_link_add_object_symbols): Handle dynamic objects. + (elf_link_create_dynamic_sections): New static function. + (elf_add_dynamic_entry): Define as macro using NAME and as new + externally visible function. + (NAME(bfd_elf,record_link_assignment)): New function. + (elf_buckets): New static variable. + (NAME(bfd_elf,size_dynamic_sections)): New function. + (struct elf_final_link_info): Add dynsym_sec and hash_sec fields. + (elf_bfd_final_link): Handle dynamic linking. Create a section + symbol for all ELF sections, not all BFD sections. Store section + symbol index in target_index field, not index field. Traverse + over global symbols even if stripping. + (elf_link_output_extsym): Output dynamic symbols. Mark symbols + defined by dynamic objects as undefined. + (elf_link_input_bfd): Ignore dynamic objects. Use target_index + field for section relocs, and make sure it is set. + (elf_reloc_link_order): Use target_index field for section relocs, + and make sure it is set. + * elf.c (elf_link_hash_newfunc): Initialize dynindx, dynstr_index, + weakdef and elf_link_hash_flags fields. + (_bfd_elf_link_hash_table_create): Initialize dynobj, dynsymcount, + dynstr and bucketcount fields. + * elf32-target.h: Initialize new dynamic linking fields. + * elf64-target.h: Likewise. + * elf32-i386.c: New functions for dynamic linking support. + * elf32-sparc.c: Likewise. + * bfd-in.h (bfd_elf32_record_link_assignment): Declare. + (bfd_elf64_record_link_assignment): Declare. + (bfd_elf32_size_dynamic_sections): Declare. + (bfd_elf64_size_dynamic_sections): Declare. + * bfd-in2.h: Rebuilt. + +Wed May 18 08:29:04 1994 Ian Lance Taylor (ian@cygnus.com) + + * som.c: Don't include or . + (som_reloc_queue_find): Call memcmp instead of bcmp. + (som_bfd_reloc_type_lookup): Change first argument to bfd *. + (compare_syms): Change types of arguments to const void *. + (bfd_section_from_som_symbol): Removed unused local found. + (som_write_armap): Add elength, map, orl_count and int arguments. + (som_write_armap): Use %ld and cast to long for getuid result. + +Wed May 18 09:09:32 1994 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.h (R_HPPA_ABS_CALL): Define. + * elf32-hppa.c (hppa_elf_gen_reloc_type): Handle absolute calls. + + * som.h (R_HPPA_ABS_CALL): Define. + * som.c (hppa_som_gen_reloc_type): Delete complex relocation types. + +Tue May 17 19:33:12 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * coff-i960.c (icoff_little_vec, icoff_big_vec): Indicate leading + underscore, for compatibility with Intel tool chain (gnu960v2). + +Mon May 16 10:09:22 1994 Jeff Law (law@snake.cs.utah.edu) + + * bfd-in2.h: Rebuilt. + + * elf32-hppa.c: Change .hppa_linker_stubs to .PARISC.stubs, + likewise for other PA specific sections. + (hppa_elf_relocate_unwind_table): Delete unused + function. + (elf_hppa_howto_table): Completely new table based on 94-02-02 + draft PA ELF spec. Change relocation tags appropriately + throughout elf32-hppa.c + (hppa_elf_gen_reloc_type): Rewrite and simplify based on 94-02-02 + spec. + (hppa_elf_reloc): Likewise. + (hppa_look_for_stubs_in_section): Likewise + (ELF_MACHINE_CODE): Change to EM_PARISC. + * elf32-hppa.h: Include "elf/hppa.h". Change relocation tags + appropriately throughout elf32-hppa.h. + (elf32_hppa_reloc_type): New table based on 94-02-02 draft PA ELF + spec. + (R_HPPA_ABS_CALL, R_HPPA_COMPLEX*, R_HPPA_UNWIND): Delete definitions. + * elfcode.h (prep_headers): Use EM_PARISC instead of EM_HPPA. + * reloc.c (bfd_reloc_code_real): Delete unused HPPA relocations. + * som.h (R_HPPA_ABS_CALL, R_HPPA_COMPLEX): Delete definitions. + + * libhppa.h (hppa_field_adjust): Avoid adding constant_value into + the final value twice for LR and RR field selectors. + +Sat May 14 09:09:19 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * aoutx.h (add_to_stringtab): Use BFD_ASSERT not assert. This + avoids __eprintf troubles. + +Fri May 13 10:51:21 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * bout.c (b_out_bfd_reloc_type_lookup): Handle BFD_RELOC_CTOR. + + * config/mipsbelf.mt (SELECT_VECS): Add ecoff_big_vec and + ecoff_little_vec since Irix 5 supports ECOFF executables. + +Wed May 11 00:31:57 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_find_nearest_line): Handle fdr.adr != pdr.adr + correctly. + + * Makefile.in (stmp-bfd.h): Use || instead of ; to force SunOS + make to invoke the shell. + +Tue May 10 14:23:43 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * section.c (SEC_COFF_SHARED_LIBRARY): Renamed from + SEC_SHARED_LIBRARY for clarity. Changed all uses. + * bfd-in2.h: Rebuilt. + * coffcode.h (sec_to_styp_flags): If SEC_COFF_SHARED_LIBRARY is + set, set STYP_NOLOAD. + * coffgen.c (coff_section_from_bfd_index): Don't get an assertion + failure because of a bad shared library. + +Mon May 9 18:53:40 1994 Bill Cox (bill@rtl.cygnus.com) + + * linker.c: Add missing comment terminator. + +Mon May 9 11:53:54 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * linker.c (_bfd_generic_link_add_one_symbol): If hashp and *hashp + are not NULL, assume the caller has already looked up the symbol + in the hash table and has stored the entry in *hashp. + (generic_link_add_symbol_list): Set h to NULL before calling + _bfd_generic_link_add_one_symbol. + * ecoff.c (ecoff_link_add_externals): Likewise. + + * elfcode.h (assign_file_positions_except_relocs): Don't require + page shared between .data and .bss segments to contain zeroes. + + * elfcode.h: Include bfdlink.h. Added several new functions to do + linking. + (ELF_R_TYPE): Define. + (bfd_add_to_strtab): Return unsigned long. Change check for + realloc failure. + (elf_fake_sections): Check return value of bfd_add_to_strtab. + (elf_compute_section_file_positions): Add link_info argument. + Call elf_backend_begin_write_processing hook and prep_headers + here. Only call swap_out_syms if link_info is NULL. Set up + .shstrtab section here. Pass dosyms argument to + assign_file_positions_except_relocs. Set output_has_begun flag. + (assign_file_positions_for_symtab_and_strtabs): Add dosyms + argument, and use it to control setting .symtab and .strtab file + positions. + (assign_file_positions_except_relocs): Add dosyms argument, and + pass it on. + (prep_headers): Check return value of bfd_add_to_strtab. + (swap_out_syms): Likewise. Also, don't set up .shstrtab here. + (NAME(bfd_elf,write_object_contents)): Some calls moved into + elf_compute_section_file_positions. + (elf_set_section_contents): Likewise. + (elf_slurp_symbol_table): SHN_LORESERV corrected to SHN_LORESERVE. + * libelf.h: Include bfdlink.h. + (struct elf_backend_data): Add fields collect, + elf_add_symbol_hook, elf_backend_relocate_section. + (struct bfd_elf_section_data): Add field rel_hashes. + (struct elf_obj_tdata): Remove fields internal_syms and symbols. + Add field sym_hashes. + (obj_symbols, obj_internal_syms): Remove definitions. + (elf_sym_hashes): Define. + (struct elf_link_hash_entry): Define. + (struct elf_link_hash_table): Define. + (elf_link_hash_lookup): Define. + (elf_link_hash_traverse): Define. + (elf_hash_table): Define. + (_bfd_elf_link_hash_table_create): Declare. + (bfd_elf32_bfd_link_add_symbols): Declare. + (bfd_elf32_bfd_final_link): Declare. + (bfd_elf64_bfd_link_add_symbols): Declare. + (bfd_elf64_bfd_final_link): Declare. + * elf.c: Include bfdlink.h. + (elf_link_hash_newfunc): New function. + (_bfd_elf_link_hash_table_create): New function. + * elf32-target.h (elf_backend_relocate_section): If not defined, + define as 0 and use generic linker. Otherwise, use ELF backend + linker. + (elf_backend_collect): If not defined, define as false. + (elf_backend_add_symbol_hook): If not defined, define as 0. + (elf32_bed): Initialize new fields. + * elf64-target.h: Same changes as elf32-target.h. + * elf32-i386.c: Include bfdlink.h. + (elf_i386_relocate_section): New function. + (elf_backend_relocate_section): Define. + * elf32-sparc.c: Include bfdlink.h. + (elf_info_to_howto): Change type of dst from Elf32_Internal_Rela + to Elf_Internal_Rela (they're the same type anyhow). + (elf_sparc_relocate_section): New function. + (elf_backend_relocate_section): Define. + * elf32-mips.c (elf_backend_collect): Define. + + * Makefile.in (stmp-bfd.h): Avoid useless make error message in a + different way; touch takes a numeric argument on some systems. + +Fri May 6 13:34:14 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmcode.h (nlm_swap_auxiliary_headers_in): Rework custom header + handling for latest suggested format. + (nlm_swap_auxiliary_headers_out): Likewise. + (nlm_compute_section_file_positions): Likewise. + +Fri May 6 11:11:50 1994 D. V. Henkel-Wallace (gumby@rtl.cygnus.com) + + * config.bfd: handle erricsson config (for OSE). + +Thu May 5 15:40:47 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + Patches from Ralph Campbell: + * mipsbsd.c (mips_fix_jmp_addr): New function. + (mips_fix_hi16_s): Use bfd_is_com_section. + (mips_howto_table_ext): Call mips_fix_jmp_addr for MIPS_RELOC_JMP. + +Fri May 6 11:48:55 1994 Steve Chamberlain (sac@cygnus.com) + + * config/go32.mh: XX support. + + From bill + * Makefile.in: Build sysdep.h without causing worrying but + harmless error message. + +Wed May 4 11:09:53 1994 Ian Lance Taylor (ian@cygnus.com) + + Changed m68k-aout to set flags to 0; m68k-sunos still uses 1. + * aout0.c: New file. + * targets.c (aout0_big_vec): Declare. + (bfd_target_vector): Add aout0_big_vec. + * config.bfd (m68*-*-aout*): Use m68k-0aout, not m68k-aout. + * config/m68k-aout.mt (SELECT_VECS): Removed. + * config/m68k-0aout.mt: New file. + * configure.in (aout0_big_vec): New target vector: use aout0.o, + aout32.o and stab-syms.o. + * Makefile.in: Rebuilt dependencies. + (BFD32_BACKENDS): Add aout0.o. + (CFILES): Add aout0.c. + + * libaout.h (struct aout_backend_data): Add field exec_hdr_flags. + * aout-target.h (MY_exec_hdr_flags): If not defined, define as 0. + MY(backend_data): Initialize exec_hdr_flags field. + * aoutf1.h (sunos_32_set_arch_mach): Make static. + (aout32_sunos4_write_object_contents): Set flags from backend + info. + (MY_exec_hdr_flags): If not defined, define as 1. + (sunos4_aout_backend): Initialize exec_hdr_flags field. + * aout-encap.c (encap_write_object_contents): Set flags from + backend info. + (MY_exec_hdr_flags): Define as N_FLAGS_COFF_ENCAPSULATE. + * hp300hpux.c (MY_exec_hdr_flags): Define as 0x2. + (MY(write_object_contents)): Set flags from backend info. + * i386aout.c (MY(backend_data)): Initialize exec_hdr_flags field. + * i386mach3.c (MY(backend_data)): Likewise. + * mipsbsd.c (MY(backend_data)): Likewise. + * sparclynx.c (NAME(aout,sparclynx_write_object_contents)): Set + flags from backend info. + (sparclynx_aout_backend): Initialize exec_hdr_flags field. + +Wed May 4 02:56:00 1994 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * config.bfd (i386-*-gnu*): Treat like i386-*-mach*. + (m68*-apollo-*): Treat all Apollo configs the same, don't handle + BSD specially. + +Tue May 3 19:43:21 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * cache.c: Rewrote to work correctly. + * libbfd.h: Rebuilt. + * opncls.c (bfd_cache_init, bfd_open_file): Don't declare. + (bfd_fdopenr): Check return value of bfd_cache_init. + +Fri Apr 29 15:08:23 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * cf-m68klynx.c (CALC_ADDEND): Check for PC relative relocs by + enumerating them, since the reloc type can not serve as an index + into the m68k COFF howto_table. + +Fri Apr 29 09:42:39 1994 Steve Chamberlain (sac@cygnus.com) + + * config.bfd (*-go32): Changed to coff. + * coff-h8300.c (JMPL1): Get HOWTO right for 24bit branches. + * srec.c (srec_write_symbols): Write out the correct number of + symbols and don't stick in extra nulls. + +Tue Apr 26 15:07:24 1994 Stan Shebs (shebs@andros.cygnus.com) + + * cf-sparclynx.c (LYNXOS, COFF_LONG_FILENAMES): Define. + * coff-sparc.c (BADMAG): Recognize LYNXCOFFMAGIC. + (COFF_SPARC): Define. + * coffcode.h (coff_new_section_hook): If COFF_SPARC, set alignment + power of data and bss sections to 3. + * hosts/lynx.h (__LYNXOS): Define. + +Tue Apr 26 15:04:26 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (hppa_elf_reloc): Adjust the addend of relocations + against section symbols to avoid losing during ld -r. + +Tue Apr 26 12:16:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (shstrtab_length_fixed): Remove useless static + variable. + (struct elf_sect_data): Remove unused structure. + (elf_object_p): Free memory if error occurs. Check return value + of bfd_default_set_arch_mach. If elf_get_str_section fails, + preserve error code rather than setting wrong_format. + (null_shdr): Remove static variable. + (assign_section_numbers): Remove shstrtab_length_fixed assignment. + Allocate first section header on BFD obstack rather than using + null_shdr. + (bfd_prpsinfo): Remove unused local variable newsect. + +Mon Apr 25 15:31:04 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (write_relocs): Undo patch of Apr 10; breaks Solaris. + + * elfcode.h (bfd_section_from_shdr): Use bfd_make_section_anyway + to create sections. Check return value of recursive calls. + (bfd_section_from_phdr): Check return value of bfd_make_section. + (elf_symbol_from_bfd_symbol): Likewise. + (elf_object_p): Check return value of bfd_section_from_shdr. + (section_from_elf_index): Likewise. + (elf_slurp_symbol_table): Check return value of + section_from_elf_index. + (bfd_prstatus): Return boolean value. Check return value of + bfd_make_section. + (bfd_fpregset): Likewise. + (bfd_prpsinfo): Return boolean value. + (elf_corefile_note): Check return values of bfd_prstatus, + bfd_fpregset, and bfd_prpsinfo. + (elf_core_file_p): Check return value of elf_corefile_note. + +Fri Apr 22 11:08:38 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Get rid of the ECOFF .reginfo section hack. + * ecoff.c (ecoff_mkobject_hook): Don't create a .reginfo section. + (ecoff_new_section_hook): Don't handle the .reginfo section. + (ecoff_sizeof_headers): Likewise. + (ecoff_get_section_contents): Likewise. + (ecoff_compute_section_file_positions): Likewise. + (ecoff_compute_reloc_file_positions): Likewise. + (ecoff_set_section_contents): Likewise. + (ecoff_write_object_contents): Likewise. + (ecoff_bfd_final_link): Likewise. + (ecoff_bfd_copy_private_bfd_data): Copy the GP value and the + register masks. + (bfd_ecoff_get_gp_value): New function. + (bfd_ecoff_set_gp_value): New function. + (bfd_ecoff_set_regmasks): New function. + * bfd-in.h (bfd_ecoff_get_gp_value): Declare. + (bfd_ecoff_set_gp_value): Declare. + (bfd_ecoff_set_regmasks): Declare. + * bfd-in2.h: Rebuilt. + + Fix ECOFF objcopy to actually copy debugging information. + * ecoff.c (ecoff_bfd_copy_private_bfd_data): New function. + (ecoff_get_extr): Assume that any ECOFF symbol with local clear is + an external symbol, rather than checking the symbol flags. Only + check the flags for non-ECOFF symbols. + * ecofflink.c (bfd_ecoff_debug_externals): Don't crash if the + output_section field of the symbol section is NULL. + * libecoff.h (ecoff_bfd_copy_private_bfd_data): Declare as + function rather than defining as macro. + + * ieee.c (ieee_object_p): Set bfd_error_got_wrong_format if + appropriate. + + * targets.c (bfd_target_vector): Add bfd_elf32_powerpc_vec. + + * aout-adobe.c (aout_adobe_set_arch_mach): Check return value of + bfd_default_set_arch_mach. Accept bfd_arch_m68k as well as + bfd_arch_unknown. + * coffcode.h (coff_set_arch_mach): Check return value of + bfd_default_set_arch_mach. + * elfcode.h (elf_set_arch_mach): Don't check a list of ELF + architectures, just see if the desired architecture matches what + the ELF backend permits. + + * coffcode.h (coff_set_arch_mach_hook): Rename SHMAGIC to + SH_ARCH_MAGIC to match change in coff/sh.h. + (coff_set_flags): Likewise. + + Follow convention in which each NLM header has an 8 byte stamp + followed by a four byte length. + * libnlm.h (struct nlm_obj_tdata): Rename nlm_cygnus_section_hdr + to nlm_cygnus_ext_header, and change type to + Nlm_Internal_Cygnus_Ext_Header. + (nlm_cygnus_ext_header): Rename from nlm_cygnus_section_header. + * nlmcode.h (nlm_swap_auxiliary_headers_in): Use CyGnUsEx instead + of CyGnUsSeCs. Rename from cygnus_section to cygnus_ext. Require + length word to be 8. + (nlm_swap_auxiliary_headers_out): Rename from cygnus_section to + cygnus_ext. Set length word to 8. + (nlm_compute_section_file_positions): Rename from cygnus_section + to cygnus_ext. + +Thu Apr 21 22:54:22 1994 Stu Grossman (grossman at cygnus.com) + + * nlmcode.h (nlm_swap_auxiliary_headers_in): Keep section table + (from CyGnUsSeCs) in more permanent memory to keep section names + from getting trashed. + +Thu Apr 21 09:29:37 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * libelf.h (elf_obj_tdata): Add members for dynamic symbol table + handling. + * elfcode.h (bfd_section_from_shdr): Handle dynamic symbol table. + * elfcode.h (elf_slurp_symbol_table): Take additional parameter + to select static or dynamic symbol table and return number of + symbols slurped or -1 on error. + * elfcode.h (elf_get_symtab): Set bfd symcount from + elf_slurp_symbol_table result. + * elfcode.h (elf_get_dynamic_symtab_upper_bound, + elf_canonicalize_dynamic_symtab): New functions to handle dynamic + symbol table. + * elf32-target.h, elf64-target.h (BFD_JUMP_TABLE_DYNAMIC): + Change to handle dynamic symbol table, provide default definitions + for dynamic relocs. + * aoutx.h (howto_table_std, NAME(aout,swap_std_reloc_out), + NAME(aout,swap_std_reloc_in), aout_link_input_section_std, + aout_link_reloc_link_order): Handle r_jmptable and r_relative + relocations. + +Thu Apr 21 11:58:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Clean up uses of _bfd_dummy_target (from Peter Schauer). + * libbfd.c (_bfd_dummy_target): Set bfd_error_wrong_format. + * nlm-target.h (nlm_core_file_p): Define as _bfd_dummy_target, not + NULL. + * srec.c (srec_vec): Use _bfd_dummy_target, not NULL, in + _bfd_check_format. + (symbolsrec_vec): Likewise. + * tekhex.c (tekhex_vec): Likewise. + + * libnlm.h (struct nlm_obj_tdata): Add nlm_cygnus_section_hdr + field. + (nlm_cygnus_section_header): New accessor macro. + * nlmcode.h (nlm_object_p): Free new tdata structure if failure. + Add fixed sections before swapping in auxiliary headers. After + adding sections, treat errors as real, not as wrong format. + (nlm_swap_auxiliary_headers_in): Swap in the sections header; add + sections to the BFD for each section it describes. + (nlm_swap_auxiliary_headers_out): Swap out the sections header. + (nlm_compute_section_file_positions): Account for the size of the + sections header. + +Wed Apr 20 16:45:51 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * coff-sparc.c (sparccoff_vec): Change minimum alignment power to + 2, so that stab sections can be multiples of 4 bytes only. + + * hosts/i386aix.h: Changes to avoid prototypes conflicts with the + ones defined in stdlib.h. (From Minh Tran-Le.) + +Wed Apr 20 14:15:21 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlm32-ppc.c: Complete rewrite for new version of PowerPC + NetWare. Old code still present, but ifdeffed out. + + * nlmcode.h (nlm_swap_auxiliary_headers_in): Don't assume a + particular format for the customer header. Allocate a block of + memory and read it into that. + (nlm_swap_auxiliary_headers_out): Write out the block of memory. + (nlm_compute_section_file_positions): Include length of customer + header when computing its size. + +Mon Apr 18 14:27:17 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_prep_headers): Get the space's number from the + backend private section data rather than target_index. + (bfd_som_set_section_attributes): Store the space's number + in the backend private section data rather than target_index. + + * som.h (som_copyable_section_data_struct): Add space_number. + +Fri Apr 15 12:22:07 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-a29k.c (reloc_processing): Always set the address of a + R_IHCONST reloc to that of the immediately preceding R_IHIHALF. + gas does this anyhow, but some other assemblers seem to leave + garbage in the R_IHCONST address field. + + * archive.c: Consistently use ARFMAG; from + schwab@issan.informatik.uni-dortmund.de (Andreas Schwab). + (_bfd_write_archive_contents): Use ARFMAG rather than '`' and + '\012'. + (bsd_write_armap): Likewise. + (coff_write_armap): Likewise. + + * coff-mips.c (mips_relocate_section): When relaxing, adjust local + relocs against the .text section as required. + * ecofflink.c (bfd_ecoff_debug_accumulate): When relaxing, adjust + PDR addresses as required. + + * ecoff.c (ecoff_emit_aggregate): Take fdr argument. Map fdr + index through rfd map if it exists. Check for a couple of cases + which gdb handles specially. Change all callers. + (ecoff_type_to_string): Take fdr argument rather than aux_ptr and + bigendian argument. Change all callers. + (ecoff_print_symbol): Handle stStruct, stUnion and stEnum. + +Thu Apr 14 13:05:10 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-mips.c (mips_howto_table): Add dummy entries to account for + numbering changes in include/coff/mips.h. Add entries for + MIPS_R_RELHI and MIPS_R_RELLO. + (mips_ecoff_swap_reloc_in): Handle an extra bit for the reloc type + when little endian. Treat internal MIPS_R_RELLO or MIPS_R_RELHI + relocs like MIPS_R_SWITCH, and convert r_offset from 24 to 32 + bits. + (mips_ecoff_swap_reloc_out): Likewise. + (mips_adjust_reloc_in): Handle internal MIPS_R_RELLO or + MIPS_R_RELHI relocs like MIPS_R_SWITCH. + (mips_adjust_reloc_out): Likewise. + (mips_relhi_addr, mips_relhi_addend): New static variables. + (mips_relhi_reloc, mips_rello_reloc): New functions. + (mips_bfd_reloc_type_lookup): Turn BFD_RELOC_PCREL_HI16_S into + MIPS_R_RELHI and turn BFD_RELOC_PCREL_LO16 into MIPS_R_RELLO. + (mips_relocate_hi): Rename from mips_relocate_refhi, and add pcrel + argument. Changed all callers. + (mips_relocate_section): Rename got_reflo to got_lo and + reflo_int_rel to lo_int_rel. Handle MIPS_R_RELLO and MIPS_R_RELHI + relocs. + (mips_relax_section): Adjust MIPS_R_RELHI/MIPS_R_RELLO pairs when + expanding a PC relative call. + + * reloc.c (bfd_reloc_code_real_type): Add BFD_RELOC_PCREL_HI16_S + and BFD_RELOC_PCREL_LO16. + * bfd-in2.h: Rebuilt. + +Wed Apr 13 11:50:07 1994 Stan Shebs (shebs@andros.cygnus.com) + + * coff-sparc.c (sparccoff_vec): Set minimum alignment power to 3. + +Tue Apr 12 13:36:20 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_write_fixups): Always emit at least + one relocation for any non-bss section. + +Mon Apr 11 14:41:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (assign_file_positions_except_relocs): Don't require + the file alignment to correspond to the page size when linking + with -N. + +Sun Apr 10 01:02:24 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elfcode.h (write_relocs): For rela relocations, adjust the + addend for relocations involving section symbols to account + for the lossage of 1:1 mapping from input section symbols to + output section symbols. + +Fri Apr 8 12:22:02 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (NAME(aout,make_sections)): New function. + (NAME(aout,some_aout_object_p)): Call NAME(aout,make_sections) + rather than making sections inline. + (NAME(aout,mkobject)): Don't make any sections. + (NAME(aout,adjust_sizes_and_vmas)): Call NAME(aout,make_sections). + (NAME(aout,final_link)): Don't dereference obj_textsec (abfd) or + obj_datasec (abfd) if they are NULL. + * libaout.h (NAME(aout,make_sections)): Declare. + * bout.c (b_out_mkobject): Don't make any sections. + (b_out_write_object_contents): Call aout_32_make_sections. + (b_out_set_section_contents): Likewise. + * i386os9k.c (os9k_mkobject): Don't make any sections. + (os9k_write_object_contents): Call aout_32_make_sections. + (os9k_set_section_contents): Likewise. + + * aoutx.h (NAME(aout,new_section_hook)): Don't set N_EXT in target + index. + +Wed Apr 6 20:44:56 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * config.bfd, configure.host: Add mips-*-sysv4* support. + +Thu Apr 7 14:23:05 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-mips.c (mips_howto_table): Add entry for MIPS_R_SWITCH. + (mips_ecoff_swap_reloc_in): For MIPS_R_SWTICH, copy r_symndx into + r_offset and set r_symndx to RELOC_SECTION_TEXT. + (mips_ecoff_swap_reloc_out): For MIPS_R_SWITCH, get the r_symndx + value from the r_offset field. + (mips_adjust_reloc_in): Maximum r_type value is now MIPS_R_SWITCH. + For MIPS_R_SWITCH, copy the r_offset field into the addend field. + (mips_adjust_reloc_out): For MIPS_R_SWITCH, copy the addend field + into the r_offset field. + (mips_switch_reloc): New function. + (mips_bfd_reloc_type_lookup): Translate BFD_RELOC_GPREL32 into + MIPS_R_SWITCH. + (mips_relocate_section): Handle MIPS_R_SWITCH. + (mips_relax_section): Adjust MIPS_R_SWITCH offset if necessary. + +Thu Apr 7 11:10:51 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elfcode.h (elf_set_section_contents): Support calling the backend + function elf_backend_begin_write_processing when just beginning to + write an object file. + + * libelf.h (elf_backend_begin_write_processing): Declare. + + * elf{32,64}-target.h (elf_backend_begin_write_processing): Provide + a default definition. + (elf{32,64}_bed): Add elf_backend_begin_write_processing. + + * elf32-hppa.h (elf_hppa_tc_symbol): Delete extern declaration. + (elf_hppa_tc_make_sections): Likewise. + + * elf32-hppa.c (symext_chain_built): Delete. + (symext_chain_size): Renamed from symextn_contents_real_size. + (elf32_hppa_backend_{begin,final}_write_processing): New functions. + (add_entry_to_symext_chain): New function. + (hppa_elf_set_section_contents): Ignore writes to the symbol extension + section until it's been rebuilt internally. + (hppa_elf_get_section_contents): Symbol extension section is no + longer special. + (elf_backend_{begin,final}_write_processing): Define. + (elf_hppa_tc_make_sections): Simplify now that much code has + migrated into elf32_hppa_backend_{being,final}_write_processing. + +Wed Apr 6 17:24:14 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Add new target vectors to read the dynamic symbols and dynamic + relocs. Change a.out to use these rather than reading the dynamic + symbols and relocs along with the normal symbols and relocs. + * targets.c (bfd_target): Add fields + _bfd_get_dynamic_symtab_upper_bound, + _bfd_canonicalize_dynamic_symtab, + _bfd_get_dynamic_reloc_upper_bound, + _bfd_canonicalize_dynamic_reloc. + (BFD_JUMP_TABLE_DYNAMIC): Define. + * libbfd-in.h (_bfd_nodynamic_get_dynamic_symtab_upper_bound): + Define. + (_bfd_nodynamic_canonicalize_dynamic_symtab): Define. + (_bfd_nodynamic_get_dynamic_reloc_upper_bound): Define. + (_bfd_nodynamic_canonicalize_dynamic_reloc): Define. + * bfd.c (bfd_get_dynamic_symtab_upper_bound): Define. + (bfd_canonicalize_dynamic_symtab): Define. + (bfd_get_dynamic_reloc_upper_bound): Define. + (bfd_canonicalize_dynamic_reloc): Define. + * sunos.c (MY_read_dynamic_symbols): Don't define. + (MY_read_dynamic_relocs): Don't define. + (MY_get_dynamic_symtab_upper_bound): Define. + (MY_canonicalize_dynamic_symtab): Define. + (MY_get_dynamic_reloc_upper_bound): Define. + (MY_canonicalize_dynamic_reloc): Define. + (struct sunos_dynamic_info): Change type of dynsym_count and + dynrel_count to long. Add fields canonical_dynsym and + canonical_dynrel. + (sunos_read_dynamic_info): Check that BFD had DYNAMIC flag set. + Clear info->canonical_dynsym and info->canonical_dynrel. + (MY(read_dynamic_symbols)): Removed. + (MY(read_dynamic_relocs)): Removed. + (sunos_get_dynamic_symtab_upper_bound): New function. + (sunos_canonicalize_dynamic_symtab): New function. + (sunos_get_dynamic_reloc_upper_bound): New function. + (sunos_canonicalize_dynamic_reloc): New function. + * libaout.h: Declare struct reloc_ext_external and + reloc_std_external to avoid prototype problems. + (struct aout_backend_data): Remove fields read_dynamic_symbols and + read_dynamic_relocs. + (NAME(aout,translate_symbol_table)): Declare. + (NAME(aout,swap_ext_reloc_in)): Declare. + (NAME(aout,swap_std_reloc_in)): Declare. + * aoutx.h (NAME(aout,translate_symbol_table)): Renamed from + translate_symbol_table and made non-static. Changed all callers. + (NAME(aout,slurp_symbol_table)): Don't read dynamic symbols. + (NAME(aout,slurp_reloc_table)): Don't read dynamic relocs. + (NAME(aout,get_reloc_upper_bound)): Don't count dynamic relocs. + * aoutf1.h (aout_32_sunos4_write_object_contents): Don't bother to + remove dynamic symbols and relocs. They will no longer be + present. + (MY_read_dynamic_symbols): Don't define. + (MY_read_dynamic_relocs): Don't define. + (sunos4_aout_backend): Don't initialize dynamic entry points. + * aout-target.h (MY_read_dynamic_symbols): Don't define. + (MY_read_dynamic_relocs): Don't define. + (MY(backend_data)): Don't initialize dynamic entry points. + (MY_get_dynamic_symtab_upper_bound): If not defined, define to + _bfd_nodynamic version. + (MY_canonicalize_dynamic_symtab): Likewise. + (MY_get_dynamic_reloc_upper_bound): Likewise. + (MY_canonicalize_dynamic_reloc): Likewise. + * All backends: Added BFD_JUMP_TABLE_DYNAMIC to target vector. + * bfd-in2.h: Rebuilt. + * libbfd.h: Rebuilt. + + * cf-m68klynx.c: Include sysdep.h. + + * hp300hpux.c: Removed some spaces in uses of NAME to avoid + problems with traditional C compilers. + + * targets.c (bfd_target): Rearranged fields in target vector. + Removed _bfd_debug_info_start, _bfd_debug_info_end and + _bfd_debug_info_accumulate, which were never used. + (BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined. + (BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined. + (BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined. + (BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined. + * All backends: Changed to use the new BFD_JUMP_TABLE_* macros + rather than the single JUMP_TABLE macro. Removed many of the + weird macro definitions needed to support the monolithic + JUMP_TABLE. + * bfd-in.h (JUMP_TABLE): Removed. + * libbfd-in.h: Define a bunch of macros, and declare a few + functions, for use with the new BFD_JUMP_TABLE_* macros. + * libbfd.c (_bfd_dummy_new_section_hook): Removed. + (bfd_false): Set bfd_error_invalid_operation. + (bfd_nullvoidptr): Likewise. + (bfd_n1): New function. + (_bfd_nocore_core_file_matches_executable_p): Renamed from + _bfd_dummy_core_file_matches_executable_p. + (_bfd_nocore_core_file_failing_command): Similar rename. Set + bfd_error_invalid_operation. + (_bfd_nocore_core_file_failing_signal): Likewise. + (_bfd_generic_get_section_contents): Renamed from + bfd_generic_get_section_contents. Changed all callers. + (_bfd_generic_set_section_contents): Similar rename. + * ieee.c: #if 0 out ieee_bfd_debug_info_start, + ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They + were never called. + * bfd-in2.h: Rebuilt. + * libbfd.h: Rebuilt. + +Tue Apr 5 22:10:04 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * Crude support for examining dynamic libraries. + * som.c (som_object_setup): Set DYNAMIC flag for SHL_MAGIC and + DL_MAGIC objects. + (som_prep_headers): Preserve the system_id for DYNAMIC objects. + Use SHL_MAGIC as the magic number of the DYNAMIC flag is set. + Write exec headers for DYNAMIC objects. + (som_begin_writing): DYNAMIC objects have the same alignment + restrictions as D_PAGED objects. + (bfd_section_from_som_symbol): Treat DYNAMIC objects like EXEC_P + objects. + (object_flags): Add DYNAMIC. + +Tue Apr 5 17:48:52 1994 Stan Shebs (shebs@andros.cygnus.com) + + * i386lynx.c, sparclynx.c (NAME): Remove embedded whitespace in + macro uses, confuses some non-ANSI compilers. + +Tue Apr 5 15:50:01 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_free_cached_info): Add missing PARAMS decl. + Don't free anything if we don't have a bfd_object. + (som_close_and_cleanup): Call som_bfd_free_cached_info. + +Tue Apr 5 11:22:38 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elf32-mips.c (mips_elf_final_link): Don't remove empty sections. + It turns out not to be required on Irix 5, and it causes problems + if the sections happen to contain symbols. + + * elfcode.h (write_shdrs_and_ehdr): Correct bfd_write check. + + * aoutx.h (NAME(aout,canonicalize_reloc)): Don't error out if + section->relocation is NULL; malloc might have returned NULL when + given a zero size if there were no relocations. + * bout.c (b_out_canonicalize_reloc): Likewise. + * coffcode.h (coff_canonicalize_reloc): Likewise. + * ecoff.c (ecoff_canonicalize_reloc): Likewise. + * elfcode.h (elf_canonicalize_reloc): Likewise. + * mipsbsd.c (MY(canonicalize_reloc)): Likewise. + * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. + * nlmcode.h (nlm_canonicalize_reloc): Likewise. + * som.c (som_canonicalize_reloc): Likewise. + * hp300hpux.c (MY(slurp_reloc_table)): Likewise. Also, if malloc + returns NULL, don't report an error if we asked for zero bytes. + * i386lynx.c (NAME(lynx,slurp_reloc_table)): If malloc returns + NULL, don't report an error if we asked for zero bytes. + * nlmcode.h (nlm_slurp_reloc_fixups): Likewise. + +Mon Apr 4 15:30:49 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (NAME(aout,bfd_free_cached_info)): Don't free anything + if we don't have a bfd_object. + + Made sure that every call to bfd_read, bfd_write, and bfd_seek + checks the return value and handled bfd_error correctly. These + changes are not itemised. Also: + * aoutx.h (emit_strtab): Change return type to boolean, and return + errors. + (NAME(aout,write_syms)): Check emit_strtab return value. + (NAME(aout,final_link)): Likewise. + * coffcode.h (coff_write_relocs): Change return type to boolean, + and return errors. + (coff_write_object_contents): Check coff_write_relocs return + value. + * i386os9k.c (os9k_swap_exec_header_in): Change return type to + boolean. + (os9k_object_p): Check os9k_swap_exec_header_in return value. + * oasys.c (oasys_read_record): Change return type to boolean. + (oasys_slurp_symbol_table: Check oasys_read_record return value. + (oasys_object_p, oasys_slurp_section_data): Likewise. + (oasys_write_record): Change return type to boolean. + (oasys_write_syms): Likewise. Also, check oasys_write_record + return value. + (oasys_write_sections): Check oasys_write_record return value. + (oasys_write_header): Change return type to boolean. Check + oasys_write_record return value. + (oasys_write_end, oasys_write_data): Likewise. + (oasys_write_object_contents): Check return values of + oasys_write_header, oasys_write_syms, oasys_write_data, and + oasys_write_end. + * srec.c (srec_write_record): Change return type to boolean. + (srec_write_header): Likewise. Also, check srec_write_record + return value. + (srec_write_section, srec_write_terminator): Likewise. + (srec_write_symbols): Change return type to boolean. + (internal_srec_write_object_contents): Check return value of + srec_write_symbols, srec_write_header, srec_write_section, and + srec_write_terminator. + + * Makefile.in: Rebuilt dependencies. + +Mon Apr 4 10:56:45 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * aix386-core.c (aix386_bfd_is_local_label): Correct cast from + asection to asymbol. + * ptrace-core.c (ptrace_unix_bfd_is_local_label): Correct cast from + bfd to asymbol. + * trad-core.c (trad_unix_bfd_is_local_label): Correct cast from + asection to asymbol. + +Sun Apr 3 18:27:29 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_slurp_string_table): Use malloc to allocate space + for the cached copy of the native string table. + (som_slurp_symbol_table): Likewise for the native symbol table. + (som_slurp_reloc_table): Likewise for the native and generic + relocation tables. + (som_bfd_free_cached_info): Free the cached native strings, + symbols, and relocations. Also free the canonical cached + relocations. + +Fri Apr 1 12:40:58 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (aout_link_write_symbols): If keep_memory is false, make + sure the symbol name is stored in permanent memory before adding + it to the string table. + + * archive.c (_bfd_write_archive_contents): Once we've found an + object, don't bother to look for more when deciding whether to + build a map. + (compute_and_write_armap): After adding the symbols for a BFD, + call bfd_free_cached_info on it. + + Add bfd_free_cached_info support to a.out backends. + * aoutx.h (aout_get_external_symbols): Renamed from + aout_link_get_symbols. Read strings even if symbols have been + read. Store string size in obj_aout_string_size. + (NAME(aout,slurp_symbol_table)): Call aout_get_external_symbols to + read the symbols. Allocate the cached symbols with malloc, not + bfd_alloc. + (NAME(aout,slurp_reloc_table)): Allocate the cached relocs with + malloc, not bfd_alloc. + (NAME(aout,bfd_free_cached_info)): New function; free cached + symbols and relocs. + * libaout.h (struct aoutdata): Add external_string_size field. + (obj_aout_external_string_size): New accessor macro. + (NAME(aout,close_and_cleanup)): Don't declare. + (NAME(aout,bfd_free_cached_info)): Declare. + (aout_32_close_and_cleanup): Don't define. + (aout_64_close_and_cleanup): Don't define. + * aout-target.h (MY_bfd_free_cached_info): If not already defined, + define as NAME(aout,free_cached_info). + (MY_close_and_cleanup): If not already defined, define as + MY_bfd_free_cached_info. + * aout-adobe.c (aout_32_close_and_cleanup): Define. + (aout_32_bfd_free_cached_info): Don't define. + * bout.c (aout_32_close_and_cleanup): Define. + (aout_32_bfd_free_cached_info): Don't define. + * hp300hpux.c (MY_bfd_free_cached_info): Define as bfd_true. + (MY_close_and_cleanup): Don't define. + * i386lynx.c (NAME(lynx,slurp_reloc_table)): Allocate the cached + relocs with malloc, not bfd_alloc. + * i386os9k.c (aout_32_close_and_cleanup): Define. + (aout_32_bfd_free_cached_info): Don't define. + + Add a new entry point to free memory cached by a BFD. + * targets.c (bfd_target): Add _bfd_free_cached_info field. + * bfd.c (bfd_free_cached_info): Define. + * bfd-in.h (JUMP_TABLE): Add _bfd_free_cached_info. + * bfd-in2.h: Rebuilt. + * All backends: Initialize bfd_free_cached_info entry point to + bfd_true. + + * elf32-hppa.c (elf_hppa_reloc_type_lookup): Correct type of + first, unused, argument. + (hppa_elf_is_local_label): Declare instead of + som_bfd_is_local_label. + + * coff-a29k.c (a29k_reloc): Add reloc_entry->address to value of + absolute R_IREL reloc. + +Thu Mar 31 11:52:15 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Added some support for Irix 4 shared libraries. + * ecoff.c (ecoff_new_section_hook): Set SEC_SHARED_LIBRARY for a + .lib section. + (ecoff_sec_to_styp_flags): Set SEC_SHARED_LIBRARY if + STYP_ECOFF_LIB bit is set. + (ecoff_compute_section_file_positions): Round the contents of a + .lib section up to the next page boundary. + (ecoff_set_section_contents): If we see a .lib section, increment + the vma by one to count the number of shared libraries we have. + (ecoff_write_object_contents): Don't crash if we see a + STYP_ECOFF_LIB section, and don't adjust text_start or data_start + or bss_size either. + + * coffcode.h (CALC_ADDEND): Change to fetch original symbol value + from original BFD, rather than using value of current BFD symbol. + Needed for new linker. + * coff-sparc.c (CALC_ADDEND): Likewise. + + * ecoff.c (ecoff_write_object_contents): Set the text_start and + data_start entries in the optional header correctly even if a text + or data section starts at location zero. + + * reloc.c (bfd_reloc_code_real_type): Added BFD_RELOC_26 (from sef + and raeburn). + * bfd-in2.h: Rebuilt. + + * nlm32-i386.c (nlm_i386_read_import): Null terminate the symbol + name. + * nlm32-alpha.c (nlm_alpha_read_import): Likewise. + * nlm32-sparc.c (nlm_sparc_read_import): Likewise. + + * coffgen.c (coff_write_symbol): Reindented. Changed to return + boolean, and changed written to unsigned int *. Check error + returns from called functions. + (coff_write_alien_symbol): Likewise. + (coff_write_native_symbol): Likewise. + (coff_write_symbols): Likewise. Reworked checks on whether to + write symbol name to string table for clarity and to avoid core + dumping when given a non COFF symbol. + * libcoff-in.h (coff_write_symbols): Declare as returning boolean. + * libcoff.h: Rebuilt. + * coffcode.h (coff_write_object_contents): Check return value of + coff_write_symbols. + +Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Changes to let BFD return an error indication from + get_symtab_upper_bound, bfd_canonicalize_symtab, + bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now + return long instead of unsigned int, and use -1 to indicate an + error. Along the way, rename get_symtab_upper_bound to + bfd_get_symtab_upper_bound. + * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on + errors. + (bfd_canonicalize_reloc): Likewise. + * syms.c (bfd_get_symtab_upper_bound): Renamed from + get_symtab_upper_bound. + * targets.c (bfd_target): Renamed _get_symtab_upper_bound to + _bfd_get_symtab_upper_bound, and changed it and + _bfd_canonicalize_symtab and _get_reloc_upper_bound and + _bfd_canonicalize_reloc to all return long. + * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. + (NAME(aout,canonicalize_reloc)): Likewise. + (NAME(aout,get_reloc_upper_bound)): Likewise. + (NAME(aout,get_symtab_upper_bound)): Likewise. + * bout.c (b_out_canonicalize_reloc): Likewise. + (b_out_get_reloc_upper_bound): Likewise. + * coffcode.h (coff_canonicalize_reloc): Likewise. + * coffgen.c (coff_get_symtab_upper_bound): Likewise. + (coff_get_symtab): Likewise. + (coff_get_reloc_upper_bound): Likewise. + * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. + (ecoff_get_symtab): Likewise. + (ecoff_canonicalize_reloc): Likewise. + * elfcode.h (elf_get_symtab_upper_bound): Likewise. + (elf_get_reloc_upper_bound): Likewise. + (elf_canonicalize_reloc): Likewise. + (elf_get_symtab): Likewise. + * hp300hpux.c (MY(get_symtab)): Likewise. + (MY(get_symtab_upper_bound)): Likewise. + (MY(canonicalize_reloc)): Likewise. + * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. + * ieee.c (ieee_slurp_external_symbols): Change return type to + boolean. Check for errors from get_symbol. + (ieee_slurp_symbol_table): Change return type to boolean. Check + for errors from ieee_slurp_external_symbols. + (ieee_get_symtab_upper_bound): Return long, and -1 on errors. + (ieee_get_symtab): Likewise. + (ieee_get_reloc_upper_bound): Likewise. + (ieee_canonicalize_reloc): Likewise. + * mipsbsd.c (MY(canonicalize_reloc)): Likewise. + * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. + (nlm_get_symtab): Likewise. + (nlm_get_reloc_upper_bound): Likewise. + (nlm_canonicalize_reloc): Likewise. + * oasys.c (oasys_get_symtab_upper_bound): Likewise. + (oasys_get_symtab): Likewise. + (oasys_get_reloc_upper_bound): Likewise. + (oasys_canonicalize_reloc): Likewise. + * som.c (som_get_symtab_upper_bound): Likewise. + (som_get_symtab): Likewise. + (som_get_reloc_upper_bound): Likewise. + (som_canonicalize_reloc): Likewise. + * srec.c (srec_get_symtab_upper_bound): Likewise. + (srec_get_symtab): Likewise. + (srec_get_reloc_upper_bound): Define as bfd_0l. + (srec_canonicalize_reloc): Likewise. + * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. + (tekhex_get_symtab_upper_bound): Likewise. + (tekhex_get_reloc_upper_bound): Define as bfd_0l. + (tekhex_canonicalize_reloc): Likewise. + * libaout.h (NAME(aout,get_symtab_upper_bound)): Change + declaration to return long. + (NAME(aout,get_symtab)): Likewise. + (NAME(aout,canonicalize_reloc)): Likewise. + (NAME(aout,get_reloc_upper_bound)): Likewise. + * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. + (coff_get_symtab): Likewise. + (coff_get_reloc_upper_bound): Likewise. + * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. + (ecoff_get_symtab): Likewise. + (ecoff_canonicalize_reloc): Likewise. + * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. + (bfd_elf32_get_symtab): Likewise. + (bfd_elf32_get_reloc_upper_bound): Likewise. + (bfd_elf32_canonicalize_reloc): Likewise. + (bfd_elf64_get_symtab_upper_bound): Likewise. + (bfd_elf64_get_symtab): Likewise. + (bfd_elf64_get_reloc_upper_bound): Likewise. + (bfd_elf64_canonicalize_reloc): Likewise. + * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. + (nlmNAME(get_symtab)): Likewise. + (nlmNAME(get_reloc_upper_bound)): Likewise. + (nlmNAME(canonicalize_reloc)): Likewise. + * archive.c (compute_and_write_armap): Use error_return and + no_memory_return labels rather than freeing information in various + places. Change storage, symcount and src_count to long. Check + errors from bfd_get_symtab_upper_bound and + bfd_canonicalize_symtab. + * bout.c (b_out_relax_section): Change reloc_size to long. Check + for errors from bfd_get_reloc_upper_bound and + bfd_canonicalize_reloc. + (b_out_get_relocated_section_contents): Likewise. + * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): + Likewise. + * elf32-mips.c: Likewise. + * elf32-hppa.c (hppa_elf_stub_finish): Likewise. + (hppa_look_for_stubs_in_section): Check for errors from + bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and + bfd_canonicalize_reloc. + * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors + from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. + * linker.c (generic_link_read_symbols): Likewise. + (_bfd_generic_final_link): Check for errors from + bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. + * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. + * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. + (bfd_coff_reloc16_get_relocated_section_contents): Likewise. + * libbfd.c (bfd_0l): New function. + * libbfd-in.h (bfd_0l): Declare. + * aix386-core.c: Change get_symtab_upper_bound, get_symtab, + get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather + than bfd_0u. + * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. + * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. + * bfd-in2.h: Rebuilt. + * libbfd.h: Rebuilt. + * libcoff.h: Rebuilt. + + * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables + temp and name. + +Wed Mar 30 08:33:04 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hosts/dpx2.h: Define POSIX_UTIME. + +Wed Mar 30 00:31:49 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * i386dynix.c, config/i386-dynix.mt: New files, handling Dynix + variant of a.out. + * configure.in, config.bfd: Use them for Dynix. + * Makefile.in: Add dependencies for i386dynix.o. + * targets.c: Add definition for i386dynix_vec. + * hosts/symmetry.h: Do not define TRAD_CORE_USER_OFFSET for Dynix. + Define HOST_DATA_START_ADDR and TRAD_UNIX_CORE_FILE_FAILING_SIGNAL + for Dynix. Remove inclusion of dynix3.h, Dynix bfd is now handled by + i386dynix.c + +Mon Mar 28 12:53:27 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * Makefile.in (BFD32_BACKENDS): Add coff-sparc.o. + + * coffcode.h (coff_set_flags): Handle bfd_arch_powerpc like + bfd_arch_rs6000. + + * config.bfd (powerpc-*-aix*): New target; use rs6000.mt. + * config/rs6000.mt (SELECT_ARCHITECTURES): Add bfd_powerpc_arch. + + * aoutx.h (translate_from_native_sym_flags): Set SEC_RELOC flag + for generated constructor section. + +Sun Mar 27 16:25:22 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_begin_writing): New approach at dealing with holes + in executables left by the HP linker. Does not rely on subspace + alignments as subspaces are *NOT* guaranteed to be properly + aligned in an executable (can you believe that!). + +Sat Mar 26 10:25:43 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_get_section_contents): New function. Do not try + to actually read data from a section that doesn't have either + SEC_LOAD or SEC_DEBUGGING set (eg $BSS$) just return true. + + * libbfd.c (bfd_read): Set bfd_error as appropriate for a short + read. (bfd_error_system_call or bfd_error_file_truncated). + + * som.c: Do not blindly set bfd_error_system_call after a + failing bfd_read, bfd_write, or bfd_seek. In a few places + (like som_object_p) override the error status set by bfd_read. + + * aix386-core.c, aout-encap,c archive.c, bout.c: Likewise. + * coff-rs6000.c, coffgen.c ecoff.c, elf.c: Likewise. + * elf32-hppa.c, elfcode.h, hp300hpux.c, i386lynx.c: Likewise. + * nlm32-alpha.c, nlm32-i386.c, nlm32-sparc.c: Likewise. + + * som.c: Check return values from several bfd_{seek,read,write} + calls that we just assumed were not failing. + +Fri Mar 25 11:44:06 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hosts/sysv4.h (HAVE_PROCFS): Add comments about ptx4. + * config/sysv4.mh: Add comment. + * config/symmetry.mh: Change comment. + * configure.host: Use sysv4, not symmetry, for i[34]86-sequent-sysv4*. + +Fri Mar 25 17:10:45 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Changes to support linker relaxing of embedded MIPS PIC code to + use a five instruction sequence for function calls which are out of + range of the bal instruction. + * libecoff.h (struct ecoff_section_tdata): Define. + (ecoff_section_data): Define. + (ecoff_bfd_relax_section): Don't define. + * ecoff.c (ecoff_final_link_debug_accumulate): Don't read or free + the debugging information if it has already been read. + (ecoff_indirect_link_order): Handle _cooked_size being different + from _raw_size. Don't reread the contents or the relocs if they + have already been read in. + * coff-mips.c (mips_howto_table): Change bitsize of PCREL16 from + 18 to 16. + (PCREL16_EXPANSION_ADJUSTMENT): Define. + (mips_relocate_refhi): Take adjust argument. + (mips_relocate_section): Handle reloc offsets stored in section + used_by_bfd field. Call mips_relax_pcrel16 to handle details of + expanding an out of range PCREL16. Keep trace of adjustments + required by expansions. Set s and unset h when converting a reloc + from undefined to section. Change handling of PC relative relocs: + if against a section, they are correct in the object file, if + against an external symbol they are pcrel_offset. + (mips_relax_section): New function. + (mips_relax_pcrel16): New function. + (ecoff_bfd_relax_section): Define. + * coff-alpha.c (ecoff_bfd_relax_section): Define. + * ecofflink.c (bfd_ecoff_debug_accumulate): Handle adjustments + built by mips_relax_section when writing out addresses. + * elf32-mips.c (mips_elf_read_ecoff_info): Clear adjust field. + + * aoutx.h (NAME(aout,find_nearest_line)): The caller expects + functionname_ptr to be set to a symbol name, so prepend + symbol_leading_char. + +Thu Mar 24 11:33:46 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * coff-h8300.c (h8300_reloc16_extra_cases): Add relaxing info + for 16bit relative branches. + * coff-h8500.c (r_high8, r_low16, r_high16): Don't complain on + overflow. + +Thu Mar 24 09:21:13 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_prep_for_ar_write): Ignore non-SOM objects. + (som_bfd_ar_write_symbol_stuff, som_write_armap): Likewise. + +Wed Mar 23 14:29:31 1994 David J. Mackenzie (djm@rtl.cygnus.com) + + * netbsd386.c (N_SET_FLAGS): Delete the old definition. + +Wed Mar 23 14:58:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Clean up the relaxing code for the new linker. + * targets.c (_bfd_relax_section): Take boolean *again argument + rather than asymbol list. + * bfd.c (bfd_relax_section): Change name of fourth argument from + symbols to again. + * reloc.c (bfd_generic_relax_section): Take boolean *again + argument rather than asymbol list. Always return true. + * bout.c: Include genlink.h. + (aligncode, perform_slip): Declare. + (perform_slip): Take BFD argument rather than asymbol list. + Changed all callers. Get the symbols from the BFD. Change the + hash table entry value as well as the symbol value. + (abs32code): Take BFD argument rather than asymbol list. Changed + all callers. + (aligncode): Likewise. + (b_out_relax_section): Take boolean *again argument rather than + asymbol list. Only return false if an error occurred. Set *again + to false. Get symbols from BFD. + * reloc16.c: Include genlink.h. + (bfd_perform_slip): Take BFD argument rather than asymbol list. + Get the symbols from the BFD. Change the hash table entry value + as well as the symbol value. + (bfd_coff_reloc16_relax_section): Take boolean *again argument + rather than asymbol list. Only return false if an error occurred. + Set *again to false. Get symbols from BFD. + * coffcode.h (bfd_coff_backend_data): Change + _bfd_coff_reloc16_estimate to take BFD argument rather than + asymbol list. + (bfd_coff_reloc16_estimate): Corresponding change. + (dummy_reloc16_estimate): Corresponding change. + * libcoff-in.h (bfd_coff_reloc16_relax_section): Change + declaration to take boolean * rather than asymbol list. + (bfd_perform_slip): Change declaration to take BFD rather than + asymbol list. + * coff-h8300.c (h300_reloc16_estimate): Take BFD argument rather + than asymbol list. Changed calls to bfd_perform_slip. + * bfd-in2.h: Rebuilt. + * libbfd.h: Rebuilt. + * libcoff.h: Rebuilt. + * Makefile.in: Rebuilt dependencies. + + * genlink.h (_bfd_generic_link_get_symbols): Define. + (_bfd_generic_link_get_symcount): Define. + * linker.c (generic_link_read_symbols): New function. + (generic_link_add_object_symbols): Use it. Use + _bfd_generic_link_get_symbols and _bfd_generic_link_get_symcount + to get the symbols from the BFD. + (generic_link_check_archive_element): Likewise. + (_bfd_generic_final_link): Likewise. + (_bfd_generic_link_output_symbols): Likewise. + (default_indirect_link_order): Likewise. + (generic_link_add_symbol_list): Store pointer to hash table entry + in asymbol udata field. + +Tue Mar 22 13:09:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-mips.c (mips_howto_table): Add entry for new MIPS_R_PCREL16 + reloc, used in embedded PIC code. + (mips_adjust_reloc_in): Change sanity check to permit new reloc. + (mips_bfd_reloc_type_lookup): Turn BFD_RELOC_16_PCREL_S2 into + MIPS_R_PCREL16. + + * elf32-mips.c (mips_elf_final_link): Account for link_order + relocs when allocating space for relocations. Set SEC_RELOC flag + for any section which has relocs. Handle link_order relocs in + link_order loop. Use _bfd_generic_link_add_symbols_collect for + add_symbls entry point. + + * linker.c (_bfd_generic_final_link): Set reloc_count to 0 before + counting relocs. Set SEC_RELOC flag for any section which has + relocs. + + * linker.c (_bfd_default_link_order): Handle bfd_data_link_order. + + * linker.c (_bfd_generic_link_add_symbols): Just call + generic_link_add_symbols. + (_bfd_generic_link_add_symbols_collect): New function, like + _bfd_generic_link_add_symbols but also collect constructors and + destructors by name as collect2 does. + (generic_link_add_symbols): New function, like old + _bfd_generic_link_add_symbols but with collect argument. + (generic_link_add_object_symbols): Take collect argument. + (generic_link_check_archive_element_no_collect): New function. + (generic_link_check_archive_element_collect): New function. + (generic_link_check_archive_element): Take collect argument. + (generic_link_add_symbol_list): Take collect argument. + (_bfd_generic_link_add_one_symbol): Rename constructor argument to + collect. + * libbfd-in.h (_bfd_generic_link_add_symbols_collect): Declare. + * libbfd.h: Rebuilt. + +Tue Mar 22 10:04:00 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * archive.c (bfd_construct_extended_name_table): Use ar_padchar + for first character in an extended name. + (_bfd_write_archive_contents): If ar_padchar == '/', then use + "//" as the name of the special archive member holding the + extended name table. + +Mon Mar 21 12:28:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Support for link_order types which generate relocs in order to + support -Ur in the linker. + * linker.c (generic_link_add_symbol_list): Remove bitsize argument + from call to _bfd_generic_link_add_one_symbol. + (_bfd_generic_link_add_one_symbol): Remove bitsize argument. + Don't pass bitsize to constructor call back. Pass BFD_RELOC_CTOR + instead of bitsize to add_to_set call back. + (_bfd_generic_final_link): Account for link_order relocs when + allocating space for relocations. Handle them in link_order loop. + (_bfd_generic_reloc_link_order): New function. + (_bfd_default_link_order): If a reloc_link_order is seen here, + abort. + (_bfd_count_link_order_relocs): New function. + * libbfd-in.h (_bfd_generic_link_add_one_symbol): Remove bitsize + argument from declaration. + (_bfd_generic_reloc_link_order): Declare. + (_bfd_count_link_order_relocs): Declare. + * libbfd.h: Rebuilt. + * aoutx.h (aout_link_add_symbols): Remove bitsize argument from + call to _bfd_generic_link_add_one_symbol. + (NAME(aout,final_link)): Account for link_order relocs when + allocating space for relocations. Handle them after handling all + input BFDs. + (aout_link_reloc_link_order): New function. + * ecoff.c (ecoff_link_add_externals): Remove bitsize argument from + call to _bfd_generic_link_add_one_symbol. + (ecoff_bfd_final_link): Account for link_order relocs when + allocating space for relocations. Handle them in link_order loop. + (ecoff_link_write_external): Set the storage class of a defined + linker created symbol based on the section it is in. Correct + bfd_link_hash_weak case to use .sc rather than .st. + (ecoff_reloc_link_order): New function. + * coff-alpha.c (alpha_bfd_reloc_type_lookup): Handle + BFD_RELOC_CTOR. + * coff-mips.c (mips_bfd_reloc_type_lookup): Likewise. + + * sunos.c (sunos_read_dynamic_info): Remove unused locals dynsym + and buf. + + * cisco-core.c (cisco_core_file_p): Only pass one argument to + bfd_zmalloc. Free a pointer, not a union. + (cisco_bfd_is_local_label): Correct cast from asection to asymbol. + +Sun Mar 20 09:24:36 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_begin_writing): Fix thinko (off by one error). + + * som.c (bfd_section_from_som_symbol): Only to do the value + comparison for function symbols within executables. + + * som.c (bfd_section_from_som_symbol): Renamed from + som_section_from_subspace_index. Pass in a native SOM symbol. + For executables, iterate through the sections to find out + which contains the symbol's address rather than using the + symbol_info field. (symbol_info has a different meaning for + dynamicly linked executables.) + + * trad-core.c (trad_unix_core_file_p): Don't pass abfd to + bfd_zmalloc. + + * som.c (som_begin_writing): Fix braino (one call to align + space/subspace data was done unconditionally rather than + just for executables.) + + * som.c (som_begin_writing): Align text in all executables to + make HPUX kernel happy. Fixes strip/objcopy for shared + executables. + +Sat Mar 19 07:06:59 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_begin_writing): Account for alignment needs of + subspaces too when writing executables. Never request a negative + bss size. Fixes some problems with demand paged executables, + still having problems with pure executables and shared executables. + +Fri Mar 18 19:12:47 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * trad-core.c (trad_unix_core_file_p): Call bfd_zmalloc not + bfd_zalloc for rawptr, because later on we may call free, not + bfd_release, on it. + + * bfd.c (struct _bfd): Add cisco_core_struct to tdata union. + * libbfd.c (bfd_read, bfd_seek): Add comments regarding errors. + * cisco-core.c: New file. + * Makefile.in: Change accordingly. + * configure.in: Recognize cisco_core_vec. + * config/m68k-aout.mt (SELECT_VECS): Add cisco_core_vec. + * targets.c: Add cisco_core_vec. + * bfd-in2.h: Rebuilt. + +Fri Mar 18 18:13:49 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.h (som_copyable_section_data_struct): New structure + containing all the private section information which needs + to be copied from input section to output section during + objcopy or strip. + (som_section_data_struct): Remove several fields now in + som_copyable_section_data_struct. Make the space and + subspace dictionaries be pointers (to save space when + only reading objects). + + * som.c (bfd_som_set_section_attributes): Now returns a boolean; + some references changed. Allocate a copyable data stucture if + none exists. Store info into the copyable data structure. + (bfd_som_set_subsection_attributes): Likewise. + (som_is_space, som_is_subspace, som_is_container): New functions. + Use these instead of directly accessing private data. + (som_prep_headers): Allocate space and subspace headers here. + Fill in some fields in the space/subspace headers from the + copyable data. + (som_bfd_copy_private_section_data): Only copy the stuff + that we really need to make objcopy and strip work. Allocate + the copy_data structure for the output bfd before copying. + + * som.h (struct som_exec_data): New structure to hold exec + info that must be preserved when running objcopy/strip. + (struct somdata): Add new "exec_data" field and accessor + macro. Add some comments on how the various fields are used. + (som_section_data_struct): Make is_space and is_subspace bitfields. + Delete unused subspace_index. All references now use the + target_index field within the section structure itself. + + * som.c (make_unique_section): Delete unused declaration. + (som_bfd_copy_private_bfd_data): New function. + (som_object_setup): Allocate space for and save exec information + that needs to be copied during objcopy/strip. + (som_mkobject): Do not allocate space for a file header here. + It is not used when only reading SOM objects. + (som_prep_headers): Allocate space for and attach a file header + to the output bfd. For executables, use the saved system_id + value rather than trying to guess the right value. Do not abort + wwhen setting file_hdr->entry* for executables. + (som_begin_writing): For executables, set the exec_entry and + exec_flags fields. + (som_copy_private_backend_section_data): Always return a value. + + * libhppa.h (PA_PAGESIZE): Define. + + * som.c (SOM_ALIGN): Define. + (som_begin_writing): If writing an executable, initialize all + fields in the exec header to zero. Update fields in the exec + header as sizes of loadable subspaces are computed. Carefully + preserve alignments when building executables. Actually write the + exec after all the fields are filled in. + + * Better long-filename handling. Reads SOM ABI compliant extended + names, but doesn't quite write compliant extended names yet. + * som.c (som_slurp_extended_name_table): Delete function. The + generic code will handle things correctly. + (som_slurp_armap): Seek to the beginning of the next member. + (normalize): New function. + (som_bfd_ar_write_symbol_stuff): Take the size of the extended + name table into account when computing the file offsets in the + SOM dictionary. Make sure to align to an even boundary. + (som_write_armap): Initialize the checksum to zero. + (ar_maxchars): Fix. Opps. + +Fri Mar 18 20:35:24 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * aoutx.h (reloc_type_lookup): Handle BFD_RELOC_CTOR on a 64-bit + machine. Handle BFD_RELOC_SPARC13 and BFD_RELOC_SPARC_BASE13. + +Thu Mar 17 18:26:46 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * bfd-in.h (BFD_VERSION): Use @VERSION@. + * Makefile.in (bfd.h): Replace it with contents of VERSION file. + * bfd-in2.h: Regenerated. + + * trad-core.c (trad_unix_bfd_is_local_label): Fixed typo where + this was also named trad_unix_bfd_copy_private_bfd_data. + +Thu Mar 17 10:37:07 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * aoutx.h, elfcode.h, coff-alpha.c, bout.c, ecoff.c, ecofflink.c, + elf32-hppa.c, elf32-mips.c, linker.c, som.c, sunos.c: If malloc(0) + returns NULL, it is not an error. It's possible that some of + these checks are not necessary (because the size can never be + zero), but putting in the checks is the conservative thing to do + in light of the fact that some of these malloc calls replaced + unchecked alloca calls, in which a zero argument would work fine. + +Thu Mar 17 11:44:45 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * osf-core.c (osf_core_bfd_copy_private_bfd_data): Remove + duplicate definition. + (osf_core_bfd_is_local_label): Define. + + * reloc.c (bfd_generic_get_relocated_section_contents): Don't fail + if malloc (0) fails. bfd_canonicalize_reloc returning 0 is not a + failure indication, it merely means there are no relocs. + + * elfcode.h (NAME(bfd_elf,write_object_contents)): Don't use space + after NAME, since SunOS /bin/cc can't handle it. + +Wed Mar 16 16:43:33 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * netbsd386.c (N_SET_FLAGS): Don't nuke the machine id field. + From sukes@glue.umd.edu (Tasuki Hirata). + +Wed Mar 16 07:55:54 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * aoutf1.h (4 places): Use a simple #if on ARCH_SIZE, rather than + all that convoluted stuff with NAME, CAT3, etc. The convoluted + stuff broke for SunOS4 /bin/cc (due to DEFUN elimination, I guess). + +Wed Mar 16 00:02:05 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_prep_for_fixups): Detect section symbols based + on either the lack of private data or the symbol flags. Do not + munge section symbol names anymore -- they no longer confuse GDB. + (som_begin_writing): Leave space for an exec header if writing + an executable. + (som_slurp_symbol_table): Recognize both forms of section symbol + names "L$0\002" and "$$". Change the name of "L$0\002" + section symbols to be the name of the section they represent. + Debugging symbols begin with "L$0\001", not just "L$". + +Tue Mar 15 22:58:28 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * bfd-in2.h, libbfd.h, libcoff.h: Rebuilt. + + * bfd-in.h (JUMP_TABLE): Add new entries to the jump table + for bfd_copy_private_section_data, bfd_copy_private_bfd_data, + and bfd_is_local_label. + + * targets.c: Add new entries to the bfd_target structure. + + * bfd.c (bfd_copy_private_bfd_data): New definition. + + * section.c (bfd_copy_private_section_data): New definition. + + * syms.c (bfd_is_local_label): New definition. + + * libbfd-in.h (bfd_generic_is_local_label): Declare. + + * libbfd.c (bfd_generic_is_local_label): New function. + + * *-core.c: Provide default definitions for new functions in + the target vector which all point to bfd_false. + + * aout-target.h, coffcode.h, elf32-target.h elf64-target.h, ieee.c + libaout.h, libecoff.h, nlm-target.h, oasys.c, srec.c, tekhex.c + Default new vectors for copying private backend data to bfd_true. + Default new vector for determining if a symbol is a local label + to bfd_generic_is_local_label. + + * som.c (som_bfd_copy_private_section_data): New function. + (som_bfd_is_local_label): New function. + (som_bfd_copy_private_bfd_data): For now default to bfd_true. + + * elf32-hppa.c (hppa_elf_is_local_label): New function. + +Tue Mar 15 23:55:47 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * cf-m68klynx.c (CALC_ADDEND): Use _bfd_m68klynx_howto_table. + +Tue Mar 15 04:41:13 1994 David J. Mackenzie (djm@rtl.cygnus.com) + + * Most files: + Replace DEFUN and DEFUN_VOID with K&R-style function definition. + Indent some of them to GNU standards. + + * aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c, + cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c, + elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h, + libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c: + Update copyright years. + +Mon Mar 14 11:41:23 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_prep_for_fixups): A relocation involving the section + symbol for the *ABS* section is really a relocation involving + no symbol. + (som_slurp_symbol_table): Do not set BSF_GLOBAL or BSF_EXPORT for + undefined symbols. Correctly distinguish between debugger symbols + and section symbols. + + * som.c (setup_sections): Set SEC_DEBUGGING and the section attributes + for spaces and subspaces. + + * som.c (som_bfd_count_ar_symbols): Fix typo. + + * som.c (som_object_setup): Set EXEC_P, D_PAGED, WP_TEXT, and + HAS_RELOC based on the object's magic number. + (make_unique_section): Delete function. BFD and its users are + prepared to handle multiple sections with the same name. + (setup_sections): Allocate space on the BFD's obstack to hold + section names. Use bfd_make_setion_anyway rather than the + obsolete make_unique_section. + (som_prep_headers): Choose the correct SOM magic number based + on the BFD's flags. + (som_bfd_fill_in_ar_symbols): Return false, not NULL on error. + +Sat Mar 12 09:46:09 1994 Ian Lance Taylor (ian@cygnus.com) + + * elf32-ppc.c: Renamed from elf32-powerpc.c. + * nlm32-ppc.c: Renamed from nlm32-powerpc.c. + * Makefile.in, configure.in: Corresponding changes. + +Fri Mar 11 22:27:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elf32-powerpc.c: Extensive changes to update to preliminary ABI. + +Fri Mar 11 00:34:59 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * sunos.c (sunos_read_dynamic_info): Assume that dynamic info + is always located at the start of the data section to allow + recovery of the dynamic info from a stripped executable. + * ecoff.c (ecoff_styp_to_sec_flags): Handle STYP_PDATA, STYP_XDATA + and STYP_COMMENT. + +Wed Mar 9 17:17:53 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * libbfd-in.h: Remove alloca cruft. It was missing some necessary + cruft (like the #pragma alloca for AIX). + In addition to that problem, the C alloca calls xmalloc, which + means checking for being out of memory can't work right. The + following changes remove all uses of alloca from BFD. + * hosts/solaris2.h: Remove alloca cruft. + * som.c: Replace alloca with a fixed size auto array. + * aoutx.h, elfcode.h, nlmcode.h, bout.c, coff-alpha.c, ecoff.c, + ecofflink.c, elf32-hppa.c, elf32-mips.c, linker.c, reloc.c, som.c, + sunos.c: Replace alloca with malloc and appropriate error checking and + freeing. + * linker.c: Replace alloca with obstack_alloc. + * libbfd.h: Rebuilt. + +Tue Mar 8 12:10:38 1994 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (mips_relocate_section): Handle MIPS_R_LITERAL like + MIPS_R_GPREL. + +Sat Mar 5 14:08:54 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * elf32-hppa.h, elfcode.h: Replace uses of Elf*_Half, Elf*_Word, + Elf*_Off typedefs by their expansion, the typedefs have been + removed from include/elf/internal.h. + * elfcode.h (bfd_section_from_shdr): Handle SHT_DYNAMIC section like + SHT_PROGBITS section. + +Thu Mar 3 20:03:39 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.h (_PA_RISC_ID): Treat HOST_HPPAOSF just like HOST_HPPABSD. + +Wed Mar 2 13:28:06 1994 Jim Kingdon (kingdon@deneb.cygnus.com) + + * configure.host: Recognize i[34]86-sequent-*. + + * trad-core.c (trad_unix_core_file_p): A non-zero, not zero, + return from bfd_seek indicates an error. + New macro TRAD_CORE_DSIZE_INCLUDES_TSIZE to replace + TRAD_CORE_STACK_OFFSET. + * hosts/symmetry.h: Define TRAD_CORE_DSIZE_INCLUDES_TSIZE and + TRAD_CORE_USER_OFFSET but not HOST_STACK_OFFSET. + +Wed Mar 2 11:57:03 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.[ch]: Do not include libhppa.h in som.c, instead include + it in som.h. + + * elf32-hppa.[ch]: Do not include libhppa.h in elf32-hppa.c, instead + include it in elf32-hppa.h. + + * som.c (log2): Return -1 on error rather than aborting. + (setup_sections): Bubble up an error from log2. + + * Changes to make HP C compiler happy in both traditional + and ANSI mode. + * som.c (hppa_som_gen_reloc_type): Use correct enum type for + field parameter. + (bfd_som_set_section_attributes): Use unsigned int rather than + unsigned char to avoid GNU-C extensions. + (bfd_som_attach_aux_hdr): Return a boolean to indicate success + or failure rather than aborting on failure. + + * som.h (bfd_som_set_section_attributes): Fix prototype to match + som.c changes. + (bfd_som_attach_aux_hdr): Add prototype. + (hppa_som-gen_reloc_type): Likewise. + + * elf32-hppa.c: Add a couple casts to make HP compiler happy. + (hppa_look_for_stubs_in_section): Do not return false on failure + until rest of code is ready to handle it. Abort for now. + +Tue Mar 1 18:33:59 1994 Jim Kingdon (kingdon@deneb.cygnus.com) + + * bfd-in2.h: Rebuilt. + +Tue Mar 1 13:06:53 1994 Kung Hsu (kung@mexican.cygnus.com) + + * i386os9k.c: use new functions bfd_set_error and bfd_get_error. + * Makefile.in: delete an extra blank. + * configure.in : Add i396os9k_vec. + +Mon Feb 28 15:41:01 1994 Kung Hsu (kung@mexican.cygnus.com) + + * config.bfd : Add i386-os9k. + * config/i386-os9k.mt : Newly add os9k target makefile. + + * i386os9k.c : new file to handle os9k format bfd. + * Makefile.in : Handle new file i386os9k.c + * targets.c : Add bfd_target_os9k_flavour and i386os9k_vec. + * cache.c : Initialize cache_sentinel to 0. + +Sun Feb 27 16:30:55 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (mismatches, retval_mismatches): Fix mismatch + action in case where caller specified no argument relocation. + (hppa_elf_build_linker_stub): Try again to get the sym_ptr_ptr + right in the original relocation and the stub's relocation. + + * elf32-hppa.h (hppa_look_for_stub_in_section): Fix typo. Delete + unused symbols argument. + + * elf32-hppa.c (hppa_elf_stub_reloc): Accept asymbol ** rather + than asymbol * for original target symbol. All callers changed. + Set reloc->sym_ptr_ptr appropriately. + (hppa_elf_build_linker_stub): Set reloc->sym_ptr_ptr correctly. + (hppa_elf_look_for_stubs_in_section): No longer need symbols + argument. Use the output symbols when canonicalizing the relocs, + creating them if necessary. + + * linker.c (_bfd_generic_link_output_symbols): Do not + rebuild/clobber the output symbols if they already exist. + +Sun Feb 27 15:22:36 1994 Stan Shebs (shebs@andros.cygnus.com) + + * targets.c (BFD_SEND, BFD_SEND_FMT): Add debugging versions that + check all the pointer dereferences. Enabled via DEBUG_BFD_SEND. + * bfd-in2.h: Rebuilt. + + * srec.c (hex_value): Always set to a size of 256 bytes. + (srec_init): Cosmetic changes. + +Sun Feb 27 11:18:47 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elf32-hppa.c: Second half of major cleanup. More comments, + PARAMize and staticize rest of functions. Delete unused + functions. Delete unused/unnecessary arguments to some functions. + Group static vars together. Abort for bad errors until we have + error code propogation working. Work on spacing and indention. + Add FIXMEs for unresolved problems. Use enums rather than + #defines for lots of things. Merge two functions which build + linker stubs into a single function (so they can easily share a + ton of common code). + +Sat Feb 26 10:00:45 1994 Ian Lance Taylor (ian@cygnus.com) + + * reloc.c (_bfd_relocate_contents): Adjust handling of overflow to + avoid depending upon right shifts of signed numbers, and to + correct handling of src_mask with lower bits zero. + + * aoutx.h, archive.c: Add casts to avoid warnings from SVR4 cc. + * ecoff.c, ecofflink.c, ecoffswap.h, srec.c: Likewise. + * elf32-i386.c: Likewise. + * elfcode.h (bfd_section_from_shdr): Make i unsigned; remove old + #if 0 code. + (elf_write_phdrs): Make i unsigned. + (map_program_segments): Make i and n_left unsigned. + (assign_file_positions_except_relocs): Make i unsigned. + (write_shdrs_and_ehdr): Make count unsigned. + (assign_file_positions_for_relocs): Make i unsigned. + (NAME(bfd,elf_write_object_contents)): Make count unsigned. + (section_from_elf_index): Make index argument unsigned. + +Fri Feb 25 21:34:58 1994 Ian Lance Taylor (ian@cygnus.com) + + * elfcode.h: Don't include assert.h. + (swap_out_syms): Use BFD_ASSERT rather than assert. + + * linker.c (_bfd_generic_link_write_global_symbol): Add missing + break in switch. + + * hosts/i386v4.h (qsort, strtol): Remove incorrect and useless + declarations. + +Fri Feb 25 16:35:57 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * libhppa.h (hppa_rebuild_insn): Moved here from elf32-hppa.c. + + * elf32-hppa.h (elf_hppa_tc_symbol): Add new arguments. + (elf_hppa_tc_make_sections): Likewise. + (elf_hppa_final_processing): Add extern decl. + + * elf32-hppa.c: First half of major cleanup. Add/cleanup lots of + comments. PARAMize some static functions. Delete unused functions. + Delete unused/unnecessary arguments to many functions. Group + static vars together. Collapse common case statements together + in many places. Use default case when possible instead of listing + each case separately. Abort for bad errors until we get error + code propogation working. Work on spacing and indention problems. + Add FIXMEs for some unresolved problems. Delete hopelessly broken + COMPLEX relocation support (it's never used anyway). + (hppa_elf_rebuild_insn): Delete. Moved into libhppa.h. + (elf_hppa_tc_symbol): Accept and use new arguments (symext chains). + (elf_hppa_tc_make_sections): Likewise. + + * format.c (bfd_check_format_matches): Initialize matching_vector + to keep gcc -Wall quiet. + + * elfcode.h (elf_slurp_reloca_table): Fix typo. + + * som.c (som_get_symtab_upper_bound): Use "sizeof (asymbol *)" + not "sizeof (som_symbol_type *)". + + * elfcode.h (elf_get_symtab_upper_bound): Use "sizeof (asymbol *)" + not "sizeof (asymbol"). Opps. + +Fri Feb 25 13:19:04 1994 Ted Lemon (mellon@pepper.ncd.com) + + * bfd.c (bfd_get_gp_size): Can't return gp value on an archive. + (bfd_set_gp_size): Can't set gp value on an archive. + +Fri Feb 25 12:57:00 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * srec.c (pass_over): Don't skip too many characters when + end of line seen. + +Fri Feb 25 11:41:57 1994 Ian Lance Taylor (ian@cygnus.com) + + * ecoff.c (ecoff_sizeof_headers): Align result to 16 byte + boundary. + +Thu Feb 24 07:13:22 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_derive_misc_symbol_info): Derive symbol_info + field for absolute symbols in the same manner as undefined + and common symbols. + +Thu Feb 24 04:29:19 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * elfcode.h (elf_core_file_p): Check for core file e_machine match + like in elf_object_p. + +Wed Feb 23 18:28:37 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elfcode.h (alloca): Delete declaration. + + * som.c (som_prep_headers): Use CPU_PA_RISC1_0 for magic + number rather than HP9000S800_ID. Note som.c is careful + to make sure CPU_PA_RISC1_0 is always defined. + +Mon Feb 21 10:12:02 1994 Stan Shebs (shebs@andros.cygnus.com) + + * Makefile.in (targets.o, archures.o): Use ALL_CFLAGS to supply + flags to explicit compile actions. + +Mon Feb 21 09:50:06 1994 Ian Lance Taylor (ian@lisa.cygnus.com) + + * ecofflink.c (ecoff_write_symhdr): Set symhdr->magic here. + * ecoff.c (ecoff_write_object_contents): Make sure .bss section + ends on a page boundary if there is no symbol table. + (ecoff_bfd_final_link): Don't set symhdr->magic here. + + * hosts/hp300.h: Include ; don't declare free. + + * som.c (som_bfd_count_ar_symbols): Use a pointer and alloca + rather than an array of variable size. + (som_bfd_fill_in_ar_symbols): Likewise. + (som_bfd_ar_write_symbol_stuff): Likewise. + + * coff-alpha.c (alpha_relocate_section): Rewrite mask and shift + operation to avoid OSF 1.3 cc bug. + * ecoff.c (ecoff_write_object_contents): Make text_size, data_size + and bss_size bfd_size_type instead of unsigned long. Make + text_start and data_start bfd_vma instead of unsigned long. + * ecofflink.c (ecoff_add_string): Remove incorrect cast of return + value. + +Sun Feb 20 16:06:54 1994 Ian Lance Taylor (ian@lisa.cygnus.com) + + * linker.c (_bfd_generic_link_add_archive_symbols): Consider + symbols in the order they appear in the archive map. + +Sat Feb 19 03:17:32 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * coff-alpha.c (reloc_nil): Add forward declaration, add missing + error_message argument. + * coff-sparc.c (bfd_coff_generic_reloc): Add forward declaration, + add missing error_message argument. + * mipsbsd.c (mips_fix_hi16_s): Add forward declaration, add missing + error_message argument. + +Fri Feb 18 11:41:58 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Support for PowerPC NetWare. + * nlm32-powerpc.c: New file. + * config.bfd (powerpc-*-netware*): New target; use ppc-nlm. + * config/ppc-nlm.mt: New file. + * configure.in (nlm32_powerpc_vec): New target vector; use + nlm32-powerpc.o, nlm32.o, nlm.o. + * targets.c (nlm32_powerpc_vec): Declare. + * Makefile.in (BFD32_BACKENDS): Add nlm32-powerpc.o. + (CFILES): Add nlm32-powerpc.c. + + Initial support for PowerPC ELF. Done without an ABI, and + probably to be changed when I get an ABI. + * config.bfd (powerpc-*-sysv4*): New target; use ppc-elf. + * config/ppc-elf.mt: New file. + * configure.in (bfd_elf32_powerpc_vec): New target vector; use + elf32-powerpc.o, elf32.o, elf.o. + * elf32-powerpc.c: New file. + * elfcode.h (prep_headers): Add bfd_arch_powerpc case. + (elf_set_arch_mach): Likewise. + * targets.c (bfd_elf32_powerpc_vec): Declare. + * Makefile.in (BFD32_BACKENDS): Add elf32-powerpc.o. + (CFILES): Add elf32-powerpc.c. + Rebuilt dependencies. + +Thu Feb 17 15:29:55 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coffgen.c (coff_write_linenumbers): Always return a value. + + * elfcode.h (elf_slurp_symbol_table): Handle zero symbols + reasonably. Allocate x_symp using alloca. + + * elfcode.h (map_program_segments): ELF program header entries + must be sorted by load address. This used to generate the entries + in reverse order. + + * section.c (SEC_IN_MEMORY): Define. + (asection): Rename unused field otheruserdata to contents, and + make it char *. + (bfd_make_section_anyway): Initialize contents field to NULL. + (bfd_get_section_contents): If SEC_IN_MEMORY is set, get section + contents from contents field rather than from file. + * bfd-in2.h: Rebuilt. + +Thu Feb 17 08:30:53 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * bfd.c (bfd_get_error, bfd_set_error): New functions. + (bfd_error): Make static. + (bfd_error_type): Renamed from bfd_ec. Prepend "bfd_error_" to + all values. + * bfd-in2.h: Regenerated. + * aix386-core.c, aout-adobe.c, aout-encap.c, aout-target.h, + aoutf1.h, aoutx.h, archive.c, archures.c, + bfd.c, bout.c, cache.c, coff-alpha.c, coff-mips.c, + coff-rs6000.c, coffcode.h, coffgen.c, core.c, ctor.c, + ecoff.c, ecofflink.c, elf.c, elf32-hppa.c, elf32-mips.c, + elfcode.h, format.c, hash.c, hp300hpux.c, hppabsd-core.c, + i386lynx.c, ieee.c, libbfd.c, libelf.h, linker.c, + lynx-core.c, nlm.c, nlm32-alpha.c, nlm32-i386.c, + nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c, + ptrace-core.c, reloc16.c, rs6000-core.c, section.c, som.c, + srec.c, sunos.c, syms.c, targets.c, tekhex.c, + trad-core.c: Change callers. + +Tue Feb 15 22:27:27 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c: Remove FIXMEs for things which have been dealt with. + +Tue Feb 15 19:39:24 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * section.c (bfd_get_section_contents): Since this function reads + unrelocated contents, the section's raw size is always the one to + use for bounds checking. + + * linker.c (default_indirect_link_order): In assertion, compare + link_order size field against cooked size, not raw size, of input + section. + + * bout.c (b_out_get_reloc_upper_bound): For BSS section, just + return 0. + (aligncode): When shrinking, the addend should be set to the + current offset in the section plus the number of bytes of padding + that will actually be retained. + (b_out_relax_section): If a section contains no relocations, don't + bother processing them. + (b_out_get_relocated_section_contents): Set reloc_done. Assert + that bfd_get_section_contents returns true. Check that relocs are + properly ordered. + (b_out_get_relocated_section_contents, case ALIGNDONE): Assert + that reloc->addend falls between the current source offset and the + raw size of the input section. + + * config.bfd: Support i960 vxworks versions > 5.0 with coff, not + bout. Default with no version number is still bout. Support + explicit i960-coff target too. + + * bout.c: Changed some indentation, deleted trailing whitespace, + fixed some comments, removed some "#if 1" lines. + (output_addr): New macro. + (calljx_callback, callj_callback, get_value, abs32code, aligncode, + b_out_get_relocated_section_contents): Use it for readability. + +Tue Feb 15 09:00:16 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_prep_for_ar_write): Iterate through the SOM + symbols, not the BFD symbols. + (som_bfd_ar_write_symbol_stuff): Likewise. + +Mon Feb 14 22:55:20 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_slurp_symbol_table): Do not die if a BFD doesn't + have any symbols. + + * Finish basic read-write support for SOM archive libraries. Bugs + surely remain as this hasn't been tested all that much. + * som.c (SOM_LST_HASH_SIZE, SOM_LST_MODULE_LIMIT): Define. + (struct som_misc_symbol_info): New structure to hold info necessary + to build both normal and library symbol tables. + (som_derive_misc_symbol_info): New function to derive info necessary + to build both normal and library symbol tables. + (som_build_and_write_symbol_table): Use new function to derive misc + symbol information. + (som_slurp_symbol_table): Update backend private data for symbols + appropriately. + (som_bfd_prep_for_ar_write): New function. + (som_bfd_ar_symbol_hash): New function. + (som_bfd_ar_write_symbol_stuff): New function. + (som_write_armap): Flesh out. + (som_vec): Fix ar padding character. + + * som.c: Consistently use memset rather than bzero. + +Mon Feb 14 17:02:28 1994 Stu Grossman (grossman at cygnus.com) + + * coff-rs6000.c: Add Lynx core file support, use HOST_AIX, where + appropriate. + * rs6000-core.c: Use HOST_AIX instead of COREFILES_PLEASE. + * config/rs6000.mh: Remove defs of ARCHIVES_PLEASE and + COREFILES_PLEASE. + * config/rs6000lynx.mh: Turn on Lynx core file support. + * hosts/rs6000.h: #define HOST_AIX. + * hosts/rs6000lynx.h: Create this to enable Lynx host support. + +Sun Feb 13 14:30:00 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.h (som_symbol_data): Safely access backend private data + for BFD symbols. All callers changed. + + * Read-only SOM archive support. + * som.c (som_bfd_count_ar_symbols): New helper function. + (som_bfd_fill_in_ar_symbols): New helper function. + (som_slurp_armap): New function to read a SOM LST. + + * som.h: Include and . + +Sat Feb 12 22:34:14 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elfcode.h (elf_map_symbols): Fix typo. + (write_object_contents): Check return values from prep_headers and + elf_compute_section_file_positions. + (set_section_contents): Likewise. + +Fri Feb 11 16:56:50 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * archive.c (normalize) [VMS]: Call malloc, not bfd_xmalloc. + (bfd_construct_extended_name_table): Check result of normalize. + +Tue Feb 8 08:57:31 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + Make all callers of malloc or realloc (including via obstacks) + check the result for NULL. Most set bfd_error to no_memory and + return in that case; a few are harder to fix, and are marked + with "FIXME ". + + * elf32-hppa.c (hppa_elf_build_arg_reloc_stub + hppa_elf_build_long_branch_stub): Check bfd_make_empty_symbol return. + * linker.c (_bfd_generic_link_output_symbols + _bfd_generic_link_write_global_symbol): Ditto + * section.c (bfd_make_section_anyway): Ditto. + + * tekhex.c (find_chunk tekhex_mkobject): Check bfd_alloc. + (first_phase): Ditto. FIXME void + (tekhex_make_empty_symbol): Check bfd_zalloc. + + * sunos.c (sunos_read_dynamic_info): Check bfd_zalloc. + (MY(read_dynamic_symbols) MY(read_dynamic_relocs)): Check bfd_alloc. + + * stringhash.c (_bfd_stringtab_hash_newfunc): Check bfd_hash_allocate. + + * srec.c: Indent. + (fillup_symbols): Check bfd_alloc. FIXME void + (srec_mkobject srec_get_section_contents + srec_set_section_contents): Check bfd_alloc. + (srec_make_empty_symbol): Check bfd_zalloc. + + * som.c (hppa_som_gen_reloc_type): Check bfd_alloc_by_size_t. + (make_unique_section): Check bfd_alloc. + (som_new_section_hook): Check bfd_zalloc. + (bfd_som_attach_aux_hdr): Ditto. FIXME void + + * rs6000-core.c (rs6000coff_core_p): Check bfd_zalloc. + + * osf-core.c (osf_core_make_empty_symbol): Check bfd_zalloc. + (osf_core_core_file_p): Check bfd_alloc. + + * oasys.c (oasys_slurp_symbol_table oasys_archive_p + oasys_mkobject oasys_object_p oasys_new_section_hook + oasys_set_section_contents): Check bfd_alloc. + (oasys_slurp_section_data): Check bfd_zalloc and bfd_alloc. + (oasys_make_empty_symbol): Check bfd_zalloc. + + * nlmcode.h (nlm_make_empty_symbol): Check bfd_zalloc. + (nlm_slurp_symbol_table): Check bfd_zalloc and bfd_alloc. + + * nlm32-sparc.c (nlm_sparc_read_import): Check bfd_alloc. + + * nlm32-i386.c (nlm_i386_read_import): Check bfd_alloc. + + * nlm32-alpha.c (nlm_alpha_read_import): Check bfd_alloc. + + * linker.c (_bfd_link_hash_newfunc + (generic_link_hash_newfunc + (archive_hash_newfunc + (_bfd_generic_link_add_one_symbol): Check bfd_hash_allocate. + (_bfd_generic_final_link + (_bfd_generic_link_output_symbols + (default_indirect_link_order): Check bfd_alloc. + (bfd_new_link_order): Check bfd_alloc_by_size_t. + + * irix-core.c (irix_core_make_empty_symbol): Check bfd_zalloc. + + * ieee.c: Indent. + (read_id get_symbol get_section_entry ieee_archive_p ieee_object_p + ieee_slurp_section_data ieee_new_section_hook): Check bfd_alloc. + (do_one): Check bfd_alloc. Return a boolean. + (ieee_slurp_section_data): Check it. + (init_for_output): Check bfd_alloc. Return a boolean. + (ieee_set_section_contents): Check it. + (do_with_relocs): Check bfd_alloc. Return a boolean. + (ieee_bfd_debug_info_accumulate): Ditto. FIXME void. + (ieee_mkobject): Check bfd_zalloc. + (ieee_make_empty_symbol): Check bfd_zmalloc. + + * hpux-core.c (hpux_core_make_empty_symbol): Check + bfd_zalloc. + + * hppabsd-core.c (hppabsd_core_make_empty_symbol): Check + bfd_zalloc. + (hppabsd_core_core_file_p): Check bfd_zalloc. + + * hp300hpux.c (MY(slurp_symbol_table)): Check bfd_alloc. + + * elfcode.h (elf_new_section_hook): Check bfd_alloc. + (bfd_section_from_phdr): Ditto. + (write_relocs): Ditto. FIXME void + (elf_map_symbols assign_section_numbers map_program_segments): + Ditto. Return a boolean. + (swap_out_syms): Ditto. Check elf_map_symbols. + (elf_slurp_symbol_table): Check bfd_zalloc. + (elf_slurp_reloca_table): Check bfd_alloc. + (elf_slurp_reloc_table): Ditto. + (elf_compute_section_file_positions): Check assign_section_numbers. + (assign_file_positions_except_relocs): Return a boolean. + Check map_program_segments. + (elf_compute_section_file_positions): Check it. + + * elf32-mips.c (mips_elf_final_link): Check bfd_alloc. + + * elf32-hppa.c (hppa_elf_stub_branch_reloc): Check bfd_zmalloc and + realloc. + (hppa_elf_stub_reloc): Ditto. + (hppa_elf_build_arg_reloc_stub): Check bfd_zalloc. + (hppa_elf_build_long_branch_stub): Ditto. + (elf32_hppa_backend_symbol_table_processing): Ditto. + + * ecoff.c (ecoff_set_symbol_info): Check bfd_alloc. Return a boolean. + (ecoff_slurp_symbol_table): Check it. + (ecoff_slurp_armap): Check bfd_alloc. + (ecoff_write_armap): Check bfd_zalloc. + (ecoff_link_hash_newfunc): Check bfd_hash_allocate and + _bfd_link_hash_newfunc. + (ecoff_link_add_externals): Check bfd_alloc. + + * ctor.c (bfd_constructor_entry): Check bfd_alloc. + + * coffgen.c (coff_real_object_p): Check bfd_alloc. + (coff_renumber_symbols): Check bfd_alloc_by_size_t. Return a boolean. + (coff_write_symbol): Check bfd_alloc. FIXME int + (coff_write_linenumbers): Check bfd_alloc. Return a boolean. + (coff_section_symbol): Check bfd_alloc_by_size_t. + (coff_get_normalized_symtab): Check bfd_alloc. + (coff_bfd_make_debug_symbol): Check bfd_zalloc. + * libcoff-in.h: Change decls of coff_renumber_symbols, + coff_write_linenumbers. + * libcoff.h: Rebuilt. + * coffcode.h (coff_write_object_contents): Check + coff_renumber_symbols, coff_write_linenumbers. + + * coffcode.h: Indent. + (coff_add_missing_symbols): Check bfd_alloc_by_size_t. Return a + boolean. + (coff_write_object_contents): Check it. + + * coff-alpha.c (alpha_relocate_section): Check bfd_alloc. + * coff-mips.c (mips_relocate_section): Ditto. + + * archive.c (bfd_slurp_bsd_armap_f2): Check bfd_alloc value. + (do_slurp_bsd_armap): Ditto. + (compute_and_write_armap): Check bfd_realloc value. + + * aoutx.h (translate_from_native_sym_flags): Check bfd_alloc + return value. Return boolean value. + (NAME(aout,make_empty_symbol)): Check bfd_zalloc return value. + (NAME(aout,slurp_symbol_table)): Check bf_alloc and bfd_zalloc + return value. + (add_to_stringtab): Ditto. FIXME void + (aout_link_hash_newfunc): Check bfd_hash_allocate return value. + (aout_link_add_symbols): Check bfd_alloc value. + (translate_symbol_table): Check translate_from_native_sym_flags. + * hp300hpux.c (MY(slurp_symbol_table)): Ditto. + * aoutx.h (aout_link_hash_newfunc): Check _bfd_link_hash_newfunc. + + * opncls.c (bfd_zalloc bfd_realloc): Check result of bfd_alloc. + + * opncls.c (obstack_chunk_alloc): Define as malloc, not + bfd_xmalloc_by_size_t. + (_bfd_new_bfd): Check obstack_begin for 0 return. + + * ieee.c (obstack_chunk_alloc): Define as malloc, not + bfd_xmalloc_by_size_t. + (ieee_archive_p): Check obstack_begin for 0 return and + obstack_finish for NULL return. + + * hash.c (obstack_chunk_alloc): Define as malloc, not + bfd_xmalloc_by_size_t. + (bfd_hash_table_init_n): Check obstack_begin for 0 return and + obstack_finish for NULL return. + (bfd_hash_lookup): Check obstack_alloc for NULL return. + + * ecofflink.c (obstack_chunk_alloc): Define as malloc, not + bfd_xmalloc_by_size_t. + bfd_ecoff_debug_accumulate + bfd_ecoff_debug_accumulate_other): Check obstack_alloc. + (add_file_shuffle add_memory_shuffle): Check obstack_alloc for + NULL return. Return boolean, not void. + (bfd_ecoff_debug_init): Check obstack_begin for 0 return. + (bfd_ecoff_debug_accumulate): Check add_file_shuffle + and add_memory_shuffle return. + (string_hash_newfunc): Check bfd_hash_allocate and bfd_hash_newfunc. + (bfd_ecoff_debug_accumulate): Check bfd_alloc. + (ecoff_add_string): Check add_memory_shuffle return. + + * libbfd-in.h (xmalloc, bfd_xmalloc, bfd_xmalloc_by_size_t): + Remove decls. + * libbfd.h: Rebuilt. + +Fri Feb 11 15:35:32 1994 Stu Grossman (grossman at cygnus.com) + + * configure.host: Add Lynx/rs6000 support. + * config/i386-nlm.mt: Enable a.out file support. + * config/rs6000lynx.mh: Lynx/rs6000 host support. + +Fri Feb 11 17:25:58 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * archive.c (compute_and_write_armap): Rewrite somewhat to improve + memory usage. + +Fri Feb 11 13:10:42 1994 Stan Shebs (shebs@andros.cygnus.com) + + * archive.c: Change all references to '\n' in archive magic + to '\012', for greater portability. + * ecoff.c (ecoff_write_armap): Ditto. + +Thu Feb 10 12:58:48 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (aout_link_write_other_symbol): Check strip settings to + see whether symbol should be output. + * genlink.h (struct generic_write_global_symbol_info): Added info + field. + * linker.c (_bfd_generic_final_link): Initialize wginfo.info. + (_bfd_generic_link_write_global_symbol): Check strip settings to + see whether symbol should be output. + * elf32-mips.c (mips_elf_final_link): Initialize wginfo.info. + +Wed Feb 9 21:34:58 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_reloc_queue_find): Do not examine a NULL queue entry. + + * som.c: Cast return values from BFD memory allocation routines to + avoid warnings from the HP compiler. + +Wed Feb 9 12:55:02 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-alpha.c (alpha_relocate_section): Accept a LITERAL + reloc on an "ldl" instruction too. + + * archive.c (bfd_ar_hdr_from_filesystem): Cast status elements + when passing them to sprintf. Use %ld instead of %d. + + * coff-rs6000.c (rs6000coff_mkarchive): Return false. + (rs6000_coff_snarf_ar_hdr): Don't declare errno; it's not used. + Also removed unused variable namelen. + (rs6000coff_write_armap): Declare orl_count and stridx parameters. + +Tue Feb 8 18:00:34 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libbfd-in.h (xmalloc): Don't declare parameter type, to avoid + conflicts. + * libbfd.h: Rebuilt. + +Tue Feb 8 15:55:50 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * coff-alpha.c (reloc_nil): New function. + (alpha_howto_table): Use it as special_function to prevent certain + relocs from being adjusted by bfd_perform_relocation. IGNORE + reloc should be partial_inplace. + (alpha_ecoff_get_relocated_section_contents): Accept a LITERAL + reloc on an "ldl" instruction too. + +Tue Feb 8 00:32:28 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * elf32-hppa.c (CURRENT_STUB_OFFSET, hppa_elf_build_arg_reloc_stub, + hppa_elf_build_long_branch_stub): Cast to char * instead of int + before performing pointer arithmetic. + +Mon Feb 7 20:56:27 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * config.bfd (hppa*-*-osf*): Use bfd_name hppaosf for this + configuration. + (hppa*-*-*elf*): This configuration used hppa-elf now. + + * som.c: This file is also used for HOST_HPPAOSF. + + * targets.c (bfd_target_vector): Enable som_vec for HOST_HPPAOSF. + + * hosts/hppaosf.h: New host configuration file. + + * config/hppabsd.mt (SELECT_VECS): Add bfd_elf32_hppa_vec as + BSD handles both SOM and ELF object files. + + * config/hppaosf.mh (HDEFINES): Delete. No longer needed. + (RANLIB): Doesn't do anything, define it to be "echo". + + * config/hppaosf.mt: New target makefile fragment for a PA running + OSF1. + +Mon Feb 7 15:02:06 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * archures.c (enum bfd_architecture): Added bfd_arch_powerpc. + (archures_init_table): If SELECT_ARCHITECTURES is not defined, + added bfd_powerpc_arch. + * bfd-in2.h: Rebuilt. + * cpu-powerpc.c: New file. + * Makefile.in (ALL_MACHINES, CFILES): Added cpu-powerpc.c. + Rebuilt dependencies. + + * elfcode.h (bfd_section_from_shdr): Get vma and alignment_power + of an SHT_STRTAB section from sh_addr and sh_addralign, rather + than just setting them to zero. + +Sun Feb 6 20:04:10 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * elfcode.h (prep_headers, swap_out_syms): Check for NULL return + from bfd_new_strtab. + (elf_compute_section_file_positions): Check for false return from + swap_out_syms. + + * linker.c (default_indirect_link_order): Check for NULL return + from bfd_get_relocated_section_contents. + + * syms.c: Make example application in doc call xmalloc, not + bfd_xmalloc. + + * aoutx.h (NAME(aout,slurp_symbol_table), + aout_link_get_symbols, NAME(aout,link_hash_table_create)): + * bout.c (b_out_slurp_reloc_table, b_out_squirt_out_relocs): + * ecoff.c (ecoff_bfd_link_hash_table_create): + * ecofflink.c (bfd_ecoff_debug_init): + * format.c (bfd_check_format_matches): + * linker.c (_bfd_generic_link_hash_table_create): + (_bfd_generic_final_link): + * reloc16.c (bfd_coff_reloc16_relax_section): + (bfd_coff_reloc16_get_relocated_section_contents): + * elf32-hppa.c (hppa_elf_build_arg_reloc_stub): + * elf32-mips.c (mips_elf_final_link): + * elfcode.h (bfd_new_strtab): + (bfd_add_2_to_strtab): + (elf_slurp_symbol_table): + (elf_corefile_note): + * libbfd.c (bfd_zmalloc): + Use malloc and check the result, instead of bfd_xmalloc. + +Sat Feb 5 12:39:28 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.bfd: Put m68*-*-sysv* line after m68*-*-sysv4*. + +Sat Feb 5 05:32:44 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * srec.c (srec_write_record): Put CONST keyword for "src" before + "unsigned", some compilers don't like it after "unsigned". + * libcoff.h, libcoff-in.h (bfd_perform_slip): Rename "value" to + "val" in prototype declaration because some compilers don't like + arguments whose names are the same as types. + +Sat Feb 5 01:14:38 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (aout_link_check_ar_symbols): Correct test for whether + object file defines symbol. Also, if skipping a symbol, skip the + second symbol of a N_WARNING or N_INDR symbol as well. + +Fri Feb 4 23:55:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Add basic support for writing RS/6000 XCOFF files. + * coff-rs6000.c (dummy_reloc): Removed. + (rs6000coff_howto_table): Defined XCOFF relocs. + (RTYPE2HOWTO): Defined to use rs6000coff_rtype2howto. + (rs6000coff_rtype2howto): New function. + (coff_bfd_reloc_type_lookup): Defined to use + rs6000coff_reloc_type_lookup. + (rs6000coff_reloc_type_lookup): New function. + (SELECT_RELOC): Defined to set r_type and r_size fields. + (COFF_LONG_FILENAMES): Defined. + * coffcode.h (combined_entry_type): Changed fix_tag and fix_end + fields to bitfields. Added fields fix_value and fix_scnlen. + (sec_to_styp_flags): If STYP_DEBUG is defined, use it rather than + STYP_INFO for the type of a section named .debug. + (coff_add_missing_symbols): Don't define if RS6000COFF_C. + (coff_write_object_contents): If RS6000COFF_C, don't call + coff_add_missing_symbols. + (coff_slurp_symbol_table): If RS6000COFF_C, then if the last aux + entry has type STY_LD change the x_scnlen into a pointer to a + symbol and set fix_scnlen. Also, for a C_BSTAT symbol, change the + value into a pointer to a symbol and set fix_value. + * libcoff.h: Rebuilt. + * coffgen.c (coff_mangle_symbols): Reindent. If fix_value is set, + get the symbol offset. Likewise for fix_scnlen. + (string_size): Change type to bfd_size_type. + (debug_string_size, debug_string_section): New static variables. + (coff_fix_symbol_name): If bfd_coff_symname_in_debug returns true, + write the symbol name into the .debug section; assume that the + section has already been created with the right size. + (coff_write_symbols): Initialize debug_string_size to 0. If + bfd_coff_symname_in_debug returns true, don't put symbol name in + usual string table. After writing out all symbols, if + debug_string_size is not 0, check that it matches the size of the + .debug section. + (coff_get_normalized_symtab): Clear new fix_value and fix_scnlen + fields. If the string offset is 0, always use an empty string as + the name. + (coff_make_empty_symbol): Zero out the symbol structure. + * reloc.c (bfd_perform_relocation): Work around one gross hack + with another: actually look at the target name to avoid the broken + COFF check. + (bfd_reloc_code_real_type): Add BFD_RELOC_PPC_B26, + BFD_RELOC_PPC_BA26 and BFD_RELOC_PPC_TOC16. + * bfd-in2.h: Rebuilt. + +Fri Feb 4 17:28:32 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * libbfd.c (bfd_zmalloc): Call bfd_xmalloc instead of malloc. + (bfd_xmalloc, bfd_xmalloc_by_size_t): Functions deleted. + * libbfd-in.h: Define them as macros calling xmalloc and declare + xmalloc. + * libbfd.h: Rebuilt. + +Thu Feb 3 16:49:35 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecofflink.c (bfd_ecoff_debug_externals): If a small undefined + symbol has a value in the ECOFF symbol but not in the BFD symbol, + keep the value in the ECOFF symbol. This helps gas. + + * linker.c (_bfd_generic_link_output_symbols, + _bfd_generic_link_write_global_symbol): Don't require that all + references to a common symbol be themselves common symbols. + + * aoutx.h (aout_reloc_index_to_section): Handle N_UNDF. + +Wed Feb 2 20:37:19 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * libbfd.c, bfd-in.h, hosts/alphaosf.h, hosts/sparc-ll.h, aoutf1.h, + sparclynx.c, Makefile.in: Change HOST_64_BIT to BFD_HOST_64_BIT. + * bfd-in2.h: Rebuilt. + +Wed Feb 2 12:30:13 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coffswap.h (coff_swap_reloc_out): If RS6000COFF_C, handle type + and size correctly. + (coff_swap_aux_in): If RS6000COFF_C, change x_csect.x_scnlen to + x_csect.x_scnlen.l to match change in coff/internal.h. + (coff_swap_aux_out): Likewise. + + * coff-mips.c (mips_ecoff_backend_data), coff-alpha.c + (alpha_ecoff_backend_data): Change casts of aux_in and aux_out + fields to match yesterday's changes. + + * coffcode.h (coff_write_relocs): If SELECT_RELOC is defined, pass + in the internal_reloc itself, not the type. + * coff-apollo.c, coff-h8300.c, coff-h8500.c, coff-i386.c, + coff-m68k.c, coff-sh.c, coff-we32k.c, coff-z8k.c: Changed + definition of SELECT_RELOC accordingly. + +Tue Feb 1 12:05:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coffcode.h (bfd_coff_backend_data): Added new arguments to + _bfd_coff_swap_aux_in and _bfd_coff_swap_aux_out: aux index number + and number of aux entries. + (bfd_coff_swap_aux_in, bfd_coff_swap_aux_out): Changed + accordingly. + * libcoff.h: Rebuilt. + * coffswap.h (coff_swap_aux_in, coff_swap_aux_out): Accept new + arguments. If RS6000COFF_C, only treat C_EXT and C_HIDEXT + specially if this is the last aux entry. + * coffgen.c (coff_write_symbol, coff_get_normalized_symtab): Pass + new arguments to swap_aux functions. + +Sun Jan 30 15:14:36 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * gen-aout.c (main): Set DEFAULT_ARCH based on preprocessor macros + (only testing for m68k and vax at the moment); do verify that the + preprocessor didn't trash the arch name inside the string version. + Don't print out "pagesize =" line that prevents output from + compiling. Derive BYTES_IN_WORD and ARCH values from sizeof + results. + * Makefile.in (aout-params.h): Pass gen-aout a dummy target name. + (check, installcheck): Identify directory in "no testsuites" + message. + +Sun Jan 30 13:25:28 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (aout_link_write_symbols): Write out correct value for + object file symbol. + +Fri Jan 28 18:34:05 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * hosts/vaxbsd.h (HOST_STACK_END_ADDR): Vax BSD doesn't define + KERNBASE, so hard-code 0x80000000 instead. + +Thu Jan 27 13:54:08 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * linker.c (generic_link_add_symbol_list): If symbol is common, + set the BSF_OLD_COMMON flag. + +Wed Jan 26 13:47:15 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * format.c (bfd_check_format_matches): Put the new entry in the + correct element of matching_vector. + +Tue Jan 25 11:43:28 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * som.c, som.h (bfd_som_set_section_attributes, + bfd_som_set_subsection_attributes): Change parameters from char + to int. Following a prototype with an old-style function definition + in the presence of widened parameters is a GCC-ism not supported + by the HP compiler in ANSI mode. + +Tue Jan 25 11:46:46 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * reloc.c (bfd_get_reloc_size): Size of type -2 is 4 bytes, not 2. + + * hp300hpux.c (MY(write_object_contents)): Write out the symbols + before writing out the relocs, so that the right symbol indices + are used. + + * archive.c (do_slurp_bsd_armap, bfd_slurp_bsd_armap_f2): Do not + try to overlay the internal carsyms on the external symdefs. That + can not work if the size of a host pointer is larger than 4 bytes. + + * format.c (bfd_check_format_matches): Cast result of + bfd_xmalloc_by_size_t. + * opncls.c (_bfd_new_bfd): Avoid ANSI C prototype. + + * archive.c: Reindented to GNU standards. + +Mon Jan 24 14:41:23 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * opncls.c (_bfd_new_bfd, _bfd_new_bfd_contained_in): Add + "_bfd_" to function names. + * archive.c (_bfd_create_empty_archive_element_shell), + libbfd-in.h: Change callers. + + * libbfd.c (bfd_zmalloc): Renamed from zalloc. + * libbfd.c (bfd_add_to_string_table), + trad-core.c (trad_unix_core_file_p), + targets.c (bfd_target_list), + ptrace-core.c (ptrace_unix_core_file_p), + opncls.c (new_bfd), libbfd-in.h, + ieee.c (ieee_make_empty_symbol), + elf32-hppa.c (hppa_elf_stub_branch_reloc), + (hppa_elf_stub_reloc): Change callers. + * libbfd.h: Regenerated. + + * archive.c (_bfd_look_for_bfd_in_cache): Add "_bfd_" to name. + (_bfd_get_elt_at_filepos), + coff-rs6000.c (rs6000coff_get_elt_at_filepos), libbfd-in.h: + Change callers. + + * format.c (bfd_check_format_matches), libbfd-in.h, targets.c, + elfcode.h (elf_object_p): Rename target_vector to bfd_target_vector + and default_vector to bfd_default_vector. + * libbfd.h: Regenerated. + + * format.c (bfd_check_format_matches): New function. + (bfd_check_format): Call it. + (bfd_matching_formats): Function removed. + * targets.c: Replace the vector added on Jan 21 with a count of + entries in default_vector. + * bfd-in2.h: Regenerated. + +Mon Jan 24 12:38:54 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-alpha.c (alpha_ecoff_object_p): New function. Set size of + .pdata section based on lnnoptr field, not section header. + (alpha_relocate_section): Don't bother to check if r_symndx >= 0, + since it is unsigned. + (ecoffalpha_little_vec): Use alpha_ecoff_object_p rather than + coff_object_p. + * ecoff.c (ecoff_new_section_hook): Set alignment_power field of + .pdata section to 3. + (ecoff_compute_section_file_positions): Save the size of the + .pdata section in the line_filepos field, and actually align the + .pdata section to an alignment power of 4. + (ecoff_compute_reloc_file_positions): Set output_has_begun after + calling ecoff_compute_section_file_positions. + (ecoff_write_object_contents): Set s_lnnoptr for the .pdata + section from the line_filepos field. Set vstamp for the optional + header from the vstamp of the symbolic header. + (ecoff_bfd_final_link): Set vstamp of the symbolic header to the + vstamp used by the first object file in the link. + + * ecofflink.c (ecoff_align_debug): Align RFDs to debug_align. + + * linker.c (generic_link_check_achive_element): Set SEC_ALLOC flag + for a created common section. + (_bfd_generic_link_add_one_symbol): Likewise. + + * elfcode.h (swap_out_syms): Use elf_section_from_bfd_section to + get the index of a common section, rather than always using + SHN_COMMON (MIPS has multiple common sections). + + * elf32-hppa.c (hppa_elf_gen_reloc_type): Typo (== for =). + + * aoutx.h (aout_link_input_section_std, + aout_link_input_section_ext): Pass additional arguments to + reloc_overflow callback. + * coff-alpha.c (alpha_ecoff_get_relocated_section_contents, + alpha_relocat_section): Likewise. + * coff-h8300.c (h8300_reloc16_extra_cases): Likewise. + * coff-h8500.c (extra_case): Likewise. + * coff-mips.c (mips_relocate_section): Likewise. + * coff-z8k.c (extra_case): Likewise. + * elf32-hppa.c (hppa_elf_stub_finish): Likewise. + * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. + + * bout.c (calljx_callback, callj_callback): Use get_value to get + the symbol value and check for undefined symbols. + (get_value): If the symbol is undefined, look it up in the linker + hash table. + (b_out_get_relocated_section_contents): For PCREL24 and PCREL13 + use get_value to get the symbol value and check for undefined + symbols. + * reloc16.c (bfd_coff_reloc16_get_value): If the symbol is + undefined, look it up in the linker hash table. + + * aoutx.h (translate_symbol_table): The string index 0 has a + special meaning for normal symbols, but not for dynamic symbols. + +Sat Jan 22 12:26:01 1994 Stu Grossman (grossman at cygnus.com) + + * sparclynx.c: Setup appropriate macros to enable core file + support. + +Fri Jan 21 16:25:35 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * targets.c: Add a vector of matching format names. + * format.c (bfd_matching_formats): New function to return it. + (bfd_check_format): Set it. + * bfd-in2.h: Regenerated. + + * bfd-in.h: Remove decls of bfd_ec type and error printing functions. + Remove decl of type symclass; wasn't used. + * bfd.c: Document error handling, including code fragments + containing the error decls that were in bfd-in.h. + Remove DEFUNs. + * bfd-in2.h: Regenerated. + +Fri Jan 21 14:11:16 1994 Sean Fagan (sef@cygnus.com) + + * nlmcode.h, liblnm.h, nlm32-alpha.c nlm32-i386.c nlm32-sparc.c: + The sparc (and possibly other?) NLM format requires a different + way to write exports, so add a write_export field to the backend + data (and set it to NULL for everything but the sparc). + +Fri Jan 21 14:11:16 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * sunos.c (MY(read_dynamic_relocs)): Compare info->dynrel with NULL, + not (struct external_nlist *) NULL. info->dynrel is a PTR, not + a struct external_nlist *. + +Fri Jan 21 09:29:01 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * bfd.c: Remove error strings for errors removed below. + * aoutx.h (translate_to_native_sym_flags), bfd-in.h (bfd_ec), + oasys.c (oasys_write_sections): Rename + bfd_error_nonrepresentable_section to nonrepresentable_section. + None of the other bfd error names start with "bfd_error". + Remove errors symbol_not_found and no_relocation_info, which seem + to be unused. + * bfd-in2.h: Regenerated. + +Fri Jan 21 01:11:55 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * bfd.c (bfd_get_gp_size): Added support for ELF. + + * syms.c (BSF_DYNAMIC): New symbol flag. + (bfd_print_symbol_vandf): Print it. + * bfd-in2.h: Rebuilt. + * libaout.h (struct aout_backend_data): New read_dynamic_symbols + and read_dynamic_relocs fields. + (struct aoutdata): New dynamic_info field. + (obj_aout_dynamic_info): New accessor macro. + * sunos.c (struct sunos_dynamic_info): New structure. + (sunos_read_dynamic_info, MY(read_dynamic_symbols), + MY(read_dynamic_relocs)): New functions to read dynamic symbols + and relocs. + * aoutx.h (NAME(aout,some_aout_object_p)): If the object is + dynamically linked, set SEC_RELOC for both the .text and .data + sections. + (translate_from_native_sym_flags): Don't set BSF_LOCAL for an + undefined symbol. + (translate_symbol_table): New function, split out of + slurp_symbol_table; set the BSF_DYNAMIC flag appropriately. + (NAME(aout,slurp_symbol_table)): Read dynamic symbols, if any. + (NAME(aout,slurp_reloc_table)): Read dynamic relocs, if any. + (NAME(aout,get_reloc_upper_bound)): Include dynamic reloc count in + return value. + * aoutf1.h (NAME(aout,sunos4_write_object_contents)): Don't write + out dynamic symbols or relocs against reloc symbols, since they + are already in the .text section and we wouldn't know where to + write them anyhow. + (sunos4_aout_backend): Initialize read_dynamic_symbols and + read_dynamic_relocs fields. + * aout-target.h (MY(backend_data)): Initialize + read_dynamic_symbols and read_dynamic_relocs fields. + +Thu Jan 20 20:57:27 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * hosts/alphaosf.h (uint64e_type, uint64_type, int64_type): Delete + typedefs, since HOST_64_BIT will take care of defining them in + bfd.h. + +Wed Jan 19 17:28:59 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * config/alphaosf.mh (HDEFINES): Don't define HOST_64_BIT here; + that's dealt with elsewhere. + * hosts/alphaosf.h (sprintf_vma, fprintf_vma): New macros. + (uint64_typeHIGH, uint64_typeLOW): Comment with HOST_64_BIT so + they get copied to bfd.h. + + * reloc.c (enum bfd_reloc_code_real): Add some Alpha relocation + types. Reorganized some of the existing ones. + * coff-alpha.c (alpha_howto_table): Construct 64-bit negative one + values in case of compilation on a 32-bit machine. Fix pcrel + fields of some reloc types. + (alpha_bfd_reloc_type_lookup): Handle more relocation types. + + * bfd-in.h (uint64_typeHIGH, uint64_typeLOW): Supply default + definitions when not defined, regardless of whether uint64_type is + a defined macro or not. + (fprintf_vma, sprintf_vma): Define only if fprintf_vma is not + already defined. + +Wed Jan 19 00:02:54 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (translate_to_native_sym_flags): Set the type of a + BSF_WARNING symbol to N_WARNING. + +Tue Jan 18 16:43:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (aout_link_add_symbols): Increment sym_hash as well as p + for an indirect or warning symbol. + (aout_link_write_symbols): Update sym_hash with the target of an + indirect or warning symbol. If an indirect symbol is defined, + output the calculated value and don't output the target symbol. + +Tue Jan 18 03:54:59 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * aoutx.h (translate_from_native_sym_flags): Give warning symbols + an (unused) nonzero section value, needed for check below. + +Mon Jan 17 15:12:07 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * aoutx.h (translate_from_native_sym_flags, + aout_link_add_symbols): Treat N_SET[ABDT] | N_EXT like + N_SET[ABDT]. + +Fri Jan 14 16:45:43 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (elf_object_p): If there is a SHT_DYNAMIC section, set + the DYNAMIC flag for the BFD. + (NAME(bfd_elf,write_object_contents)): Don't try to write out a + BFD with the DYNAMIC flag set, since we don't generate the program + header table correctly. + +Fri Jan 14 01:04:36 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * elfcode.h (elf_slurp_symbol_table): Free x_symp at the end + of the function to avoid storage leak. + +Thu Jan 13 23:07:32 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_link_write_external): An ifd can be -1. + +Thu Jan 13 12:33:27 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_set_reloc_info): Provide a default symbol for + relocations which don't actually have an associated symbol. + + * som.c (hppa_som_reloc): Add new "error message" argument. + +Wed Jan 12 13:36:43 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + Enable gdb to write to core files on more core file readers. + * libbfd.c (bfd_generic_set_section_contents): Remove range check + for section size, it is already done in bfd_set_section_contents + with bfd_get_section_size_now. + * aix386-core.c, hppabsd-core.c, hpux-core.c, irix-core.c, + osf-core.c, ptrace-core.c, trad-core.c (*_set_section_contents): + Use bfd_generic_set_section_contents instead of bfd_false. + +Wed Jan 12 15:31:57 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * linker.c: Added initial documentation. + + * linker.c (default_indirect_link_order): Don't expect space for + output relocations if there aren't any input relocations. + +Tue Jan 11 14:37:12 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (NAME(aout,final_link)): Set a_entry before computing + file offsets. + + * elfcode.h (swap_out_syms): A common symbol is STT_OBJECT, not + STT_NOTYPE. + +Tue Jan 11 09:10:56 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.bfd: Use ELF, not COFF for m88*-*-dgux*. + Combine m88k-*-* and m88110-*-* cases into m88*-*-*. + +Tue Jan 11 00:07:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecofflink.c: Extensive changes to compress and merge debugging + information, and to write some of out directly rather than saving + it in memory. Several new functions and structures, and new + arguments to existing functions. + * ecoff.c (ecoff_compute_reloc_file_positions): Compute + sym_filepos as well. + (ecoff_get_extr): Use ifdmap instead of ifdbase. + (ecoff_write_object_contents): Don't compute sym_filepos here. + Only output symbols if outsymbols is not NULL. + (ecoff_bfd_final_link): Adjust for changes in ecoff_debug_info and + bfd_ecoff_debug functions. Write out debugging information here. + (ecoff_final_link_debug_accumulate): Adjust for changes in + bfd_ecoff_debug functions. + (ecoff_link_write_external): Use ifdmap rather than ifdbase. + * elf32-mips.c (mips_elf_read_ecoff_info): Read external symbols + first, to put them in the first memory buffer. Clear fdr field. + (mips_elf_get_extr): Use pointer to unswapped external symbol. + (mips_elf_final_link): Adjust for changes in bfd_ecoff functions. + Preserve .text, .data and .bss even if they are empty. Save + pointer to unswapped external symbol rather than copying it. + Don't free up the external symbols. + * libelf.h (elf_symbol_type): Change mips_extr to PTR. + * bfd-in.h (bfd_ecoff_debug_init, bfd_ecoff_debug_free): Declare. + (bfd_ecoff_debug_accumulate): Update declaration. + (bfd_ecoff_debug_accumulate_other): Rename declaration from + bfd_ecoff_debug_link_other and update. + (bfd_ecoff_write_accumulated_debug): Declare. + * bfd-in2.h: Rebuilt. + * Makefile.in: Rebuilt dependencies. + +Mon Jan 10 20:46:53 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in (install): Remove "@" which follows a backslash. In + this position it just causes errors, not suppresses echoes. + +Mon Jan 10 09:06:21 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (hppa_som_gen_reloc_type): Fix handling of LT and RT + field selectors. + +Sun Jan 9 04:32:25 1994 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * config/i386-netbsd.mt (SELECT_VECS): Include i386bsd_vec. + +Fri Jan 7 10:27:27 1994 David J. Mackenzie (djm@rtl.cygnus.com) + + * aoutx.h (adjust_z_magic): Don't merge the start of bss with the + end of data if they are not contiguous. + + * aoutf1.h (sunos4_aout_backend): Comment the fields' meanings. + +Fri Jan 7 15:40:16 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_mkobject_hook): Don't set SEC_SHARED_LIBRARY flag + for .reginfo section here. + (ecoff_new_section_hook): Set it here instead. + +Fri Jan 7 10:29:27 1994 Stan Shebs (shebs@andros.cygnus.com) + + * bfd-in.h: (bfd_boolean): Add workaround for systems that also + define true and false as enums. + (ALMOST_STDC): Add as alternative to __STDC__. + * bfd-in2.h: Rebuilt. + * syms.c (bfd_print_symbol_vandf): Convert a PTR to FILE*. + +Thu Jan 6 14:24:44 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * aoutx.h (translate_to_native_sym_flags): Catch the case where + there is no output section. + +Thu Jan 6 14:37:42 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmcode.h (nlm_object_p): If we can't read the fixed header, + count it as a wrong format error, not a system call error, since + the object file might simply be too small. + + * targets.c (target_vector): Added nlm32_alpha_vec inside #ifdef + BFD64. + * Makefile.in (BFD32_BACKENDS): Remove nlm32-alpha.o. + (BFD64_BACKENDS): Add nlm32-alpha.o. It depends on 64 bit + support, even though it is for an Alpha in 32 bit mode. + * configure.in (nlm32_alpha_vec): Set target64 to true. + + * nlm32-gen.c, nlm64-gen.c: Removed. All nlm targets are + different, so there is no point to providing a generic one. + * libnlm.h: Don't bother to check for nlm_backend(bfd) being NULL + in the backend accessor macros; that should no longer be possible. + * targets.c (target_vector): Removed nlm32_big_generic_vec, + nlm64_big_generic_vec, nlm64_little_generic_vec. + * configure.in (nlm32_big_generic_vec, nlm32_little_generic_vec, + nlm64_big_generic_vec, nlm64_little_generic_vec): Removed. + * Makefile.in: Rebuilt dependencies, and + (BFD32_BACKENDS): Removed nlm32-gen.o. + (BFD64_BACKENDS): Removed nlm64-gen.o. + (CFILES): Removed nlm32-gen.c and nlm64-gen.c. + + * hp300hpux.c (ARCH_SIZE): Define before including aoutx.h. + + * linker.c (_bfd_generic_link_add_one_symbol): Add constructor and + bitsize arguments. Changed all callers (aoutx.h). + * libbfd-in.h (_bfd_generic_link_add_one_symbol): Add constructor + and bitsize arguments to declaration. + * libbfd.h: Rebuilt. + + * ecoff.c: First cut at new style of linker backend for + ECOFF--added a bunch of functions. Also: + (ecoff_sec_to_styp_flags): Set flags for .pdata and .xdata. + (ecoff_slurp_symbolic_header): New function. + (ecoff_slurp_symbolic_info): Call ecoff_slurp_symbolic_header. + (ecoff_compute_reloc_file_positions): New function. + (ecoff_set_section_contents): Get out quickly if count is zero. + Check errors better. + (ecoff_write_object_contents): Put .xdata section in data segment. + Call ecoff_compute_reloc_file_positions. Don't output relocs or + external symbols if outsymbols is NULL. + (ecoff_bfd_final_link): Completely rewritten. + * libecoff.h: Include bfdlink.h. + (struct ecoff_backend_data): Add relocate_section field. + (ecoff_data_type): Add sym_hashes and symndx_to_section fields. + (struct ecoff_link_hash_entry): Define. + (struct ecoff_link_hash_table): Define. + (ecoff_bfd_link_add_symbols): Declare as function, not macro. + (ecoff_bfd_link_hash_table_create): Likewise. + * ecofflink.c (bfd_ecoff_debug_one_external): New function. + (bfd_ecoff_debug_externals): Call bfd_ecoff_debug_one_external. + * bfd-in.h (bfd_ecoff_debug_one_external): Declare. + * bfd-in2.h: Rebuilt. + * coff-alpha.c (alpha_howto_table): Mark BRADDR as + partial_inplace, and set the src_mask to 0x1fffff. + (alpha_ecoff_get_relocated_section_contents): Remove unused + variable gp_warned. + (alpha_convert_external_reloc): New static function. + (alpha_relocate_section): New static function. + (alpha_ecoff_backend_data): Initialize relocate_section field. + * coff-mips.c (mips_relocate_refhi): New static function. + (mips_relocate_section): New static function. + (mips_ecoff_backend_data): Initialize relocate_section field. + + * reloc.c (_bfd_relocate_contents): Corrected signed overflow + checking when there is an addend. + + * aoutx.h (NAME(aout,final_link)): Don't abort when trying to link + a non a.out file, just pass it to _bfd_default_link_order. + (aout_link_input_section_std): When doing a final PC relative link + against a section symbol, subtract the VMA of the input section. + (aout_link_input_section_ext): Likewise. + + * linker.c (default_indirect_link_order): Renamed from + _bfd_generic_indirect_link_order and made static. + (_bfd_generic_final_link): Don't switch on link_order type, just + call _bfd_default_link_order. + (_bfd_default_link_order): Handle bfd_indirect_link_order type. + * genlink.h: Removed declaration of + _bfd_generic_indirect_link_order. + * elf32-mips.c (mips_elf_final_link): Don't switch on link_order + type, just call _bfd_default_link_order. + +Tue Jan 4 21:23:37 1994 Ian Lance Taylor (ian@cygnus.com) + + * linker.c (generic_link_check_archive_element): Base the name of + the created common section on the name of the section the symbol + came from. + (_bfd_generic_link_add_one_symbol): (case BIG): A common symbol + must have a section, so don't bother to create one. + +Mon Jan 3 15:32:16 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * aout-target.h (MY(vec)): Add DYNAMIC to mask of object flags. + * aoutf1.h (NAME(aout,sunos4_write_object_contents)): + If the DYNAMIC flag is set, set it in the exec header. + * aoutx.h (NAME(aout,some_aout_object_p)): If the object is + dynamically linked, set the DYNAMIC flag in the BFD. + * libaout.h (N_SET_DYNAMIC): New macro. + (N_DYNAMIC): Add missing 0 in mask. + +Mon Jan 3 11:41:45 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_get_extr): Don't output section symbols as + external symbols. + + * bfd-in.h, hash.c: Change bfd_hash_allocate argument from size_t + to unsigned int, because size_t may not be defined in bfd.h. + * bfd-in2.h: Rebuilt. + + * bfd-in.h (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to + be a const pointer. + * bfd-in2.h: Rebuilt. + * libbfd.c (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to + be a const pointer. + * targets.c (bfd_target): Change swap function pointers + accordingly. + * archive.c (do_slurp_coff_armap): Change swap accordingly. + * aix386-core.c: Change NO_GET and NO_GETS accordingly. + * hppabsd-core.c, hpux-core.c, irix-core.c, osf-core.c, + ptrace-core.c, trad-core.c: Change NO_GET and NO_SIGNED_GET + accordingly. + + * libbfd-in.h (struct artdata): Added tdata field. + (_bfd_add_bfd_to_archive_cache): Declare. + (_bfd_get_elt_at_filepos): Declare. + (_bfd_snarf_ar_hdr): Renamed from snarf_ar_hdr. + * libbfd.h: Rebuilt. + * archive.c: Cleaned up some more. + (_bfd_generic_mkarchive, bfd_generic_archive_p): Initialize + pointer elements of artdata. + (_bfd_add_bfd_to_archive_cache): Renamed from add_bfd_to_cache. + (_bfd_snarf_ar_hdr): Renamed from snarf_ar_hdr. + (_bfd_get_elt_at_filepos): Renamed from get_elt_at_filepos. + (get_extended_arelt_filename, bfd_construct_extended_name_table, + bfd_ar_hdr_from_filesystem, compute_and_write_armap): Made static. + * ecoff.c: Some comment changes. + (ecoff_slurp_armap): Handle rename of snarf_ar_hdr. Set + ardata->tdata to raw_armap. + (ecoff_archive_p): Initialize pointer elements of artdata. + * coff-rs6000.c (rs6000coff_get_elt_at_filepos): Handle rename of + add_bfd_to_cache. + + * hash.c: Added some documentation. + +Mon Jan 3 11:09:28 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * aout-target.h, netbsd386.c: Replace NO_SWAP_MAGIC with SWAP_MAGIC, + and do the swapping here rather than calling ntohl from the N_* + macros. This cleans up assumptions about the size of a host long, + the existence to ntohl, etc. + +Sat Jan 1 13:50:05 1994 Rob Savoye (rob@darkstar.cygnus.com) + + * config.bfd: Add support for VSTa micro-kernel. It currently uses + i386-aout. + +Sat Jan 1 10:18:54 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * hosts/i386mach3.h (HOST_SEGMENT_SIZE): Fix value. + * i386mach3.c (SEGMENT_SIZE): Fix value. + +For older changes see ChangeLog-9193 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff -Nru sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-9697 sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-9697 --- sdcc-3.1.0+dfsg/support/sdbinutils/bfd/ChangeLog-9697 1970-01-01 00:00:00.000000000 +0000 +++ sdcc-3.2.0+dfsg/support/sdbinutils/bfd/ChangeLog-9697 2012-02-10 10:16:50.000000000 +0000 @@ -0,0 +1,6729 @@ +Tue Dec 30 12:45:18 1997 Ian Lance Taylor + + * elf32-sparc.c (elf32_sparc_check_relocs): If -Bsymbolic, don't + allocate space for a PC relative reloc against a symbol which is + defined in a regular file. + (elf32_sparc_relocate_section): If -Bsymbolic, don't copy a PC + relative reloc against a symbol which is defined in a regular + file. + +Mon Dec 29 18:02:28 1997 Ian Lance Taylor + + From Jonathan Stone : + * config.bfd (mips-dec-netbsd*): Add ECOFF vectors to + targ_selvecs. + (mips*el-*-netbsd*): Like mips-dec-netbsd*. + (mips*-*-netbsd*): New target. + +Mon Dec 29 17:13:28 1997 H.J. Lu (hjl@gnu.org) + + * elflink.h (elf_link_assign_sym_version): Change error message + from "undefined version name" to "undefined versioned symbol + name". + +Mon Dec 29 11:41:16 1997 Nick Clifton + + * coff-arm.c (coff_arm_relocate_section): Fix typo from previous + delta. + +Tue Dec 23 17:01:10 1997 Ian Lance Taylor + + * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Declare. + * libbfd.h: Rebuild. + + * peicode.h (coff_swap_scnhdr_out): Set .reloc section to be + shared. Set stab* sections to be shared and read. Set .rsrc + section to be read and shared. + +Mon Dec 22 13:20:57 1997 Ian Lance Taylor + + * Makefile.am: Rebuild dependencies. + (ALL_MACHINES_CFILES): Add dwarf2.lo. + (ALL_MACHINES_CFILES): Add dwarf2.c. + * Makefile.in: Rebuild. + + * coff-arm.c: Don't include obstack.h. + +Mon Dec 22 13:04:33 1997 Joel Sherrill + + * config.bfd (i[3456]86*-go32-rtems*): Fix to be the same as + i[3456]86-go32. + +Thu Dec 18 16:01:25 1997 Doug Evans + + * configure: Regenerate to get @SHELL@ substituted. + +Wed Dec 17 09:45:09 1997 Nick Clifton + + * coff-arm.c (coff_arm_relocate_section): Only look at section + owner if there is one. + + * elf.c (assign_file_positions_for_segments): Fail if there is not + enough room for the program headers. + +Tue Dec 16 08:09:56 1997 Gavin Koch + + * elf.c (_bfd_elf_find_nearest_line): Call + _bfd_dwarf2_find_nearest_line first. + * elf32-mips.c (_bfd_mips_elf_find_nearest_line): Same. + * dwarf2.c: New file; implement _bfd_dwarf2_find_nearest_line. + +Mon Dec 15 16:08:52 1997 Nick Clifton + + * archures.c: Add bfd_mach_m32r. + +Mon Dec 15 16:11:22 1997 Fred Fish + + * coffcode.h (ALIGN_SECTIONS_IN_FILE): Define if I960 not defined. + (coff_compute_section_file_positions): Use ALIGN_SECTIONS_IN_FILE + to decide when to align the file sections for paging. + * coffcode.h (ALIGN_SECTIONS_IN_FILE): Undefine for TIC80COFF. + +Mon Dec 15 15:01:15 1997 Nick Clifton + + * elf32-m32r.c (m32r_elf_object_p): New Function. + (m32r_elf_final_write_processing): New Function. + (m32r_elf_set_private_flags): New Function. + (m32r_elf_copy_private_bfd_data): New Function. + (m32r_elf_merge_private_bfd_data): New Function. + (m32r_elf_print_private_bfd_data): New Function. + (elf_backend_object_p): Point to m32r_object_p. + (elf_backend_final_write_processing): Point to + m32r_elf_final_write_processing. + (bfd_elf32_bfd_copy_private_bfd_data): Point to + m32r_elf_copy_private_bfd_data. + (bfd_elf32_bfd_merge_private_bfd_data): Point to + m32r_elf_merge_private_bfd_data. + (bfd_elf32_bfd_set_private_flags): Point to + m32r_elf_set_private_bfd_data. + (bfd_elf32_bfd_print_private_bfd_data): Point to + m32r_elf_print_private_bfd_data. + + + * bfd-in2.h (bfd_mach_m32r): Add identifier for M32R architecture + machines. + +Fri Dec 12 11:30:28 1997 Brendan Kehoe + + * configure: Only build libbfd shared if --enable-shared's value + was `yes', or was set to `*bfd*'. + * aclocal.m4: Likewise. + * NOTE: this really needs to be fixed in libtool/libtool.m4, the + original source of this bit of code. It's not clear what the best fix + would be, though. + +Thu Dec 11 17:48:11 1997 Richard Henderson + + * linker.c (generic_link_add_symbol_list): Always init udata.p so + that the generic relaxation code can function when input and output + file formats are mismatched. + +Thu Dec 11 01:02:18 1997 Ian Lance Taylor + + * coff-sh.c (bfd_coff_small_swap_table): Initialize new fields. + + * elf.c (assign_file_positions_for_segments): For a loadable + section, make sure that the load address is correct relative to + the load address of the segment plus the size of the segment so + far. + + * coffcode.h (_coff_link_output_has_begun): Make static. + (_coff_final_link_postscript): Likewise. + +Wed Dec 10 23:37:11 1997 Ian Lance Taylor + + * elflink.h (elf_link_input_bfd): Handle a relocateable link in + which a relocation refers to an indirect or warning symbol. + +Wed Dec 10 11:15:55 1997 Nick Clifton + + * coff-arm.c (bfd_arm_coff_final_link): Function deleted. + (coff_arm_final_link_postscript): New function. + (coff_arm_link_output_has_begun): New function. + + * libcoff.h (struct bfd_coff_backend_data): Add new fields: + _bfd_coff_link_output_has_begun and + _bfd_coff_final_link_postscript. Add new macros: + bfd_coff_link_output_has_begun() and + bfd_coff_final_link_postscript(). + + * cofflink.c (_bfd_coff_final_link): Insert calls to + bfd_coff_link_output_has_begun() and + bfd_coff_final_link_postscript(). + + * coffcode.h: Add two new fields to bfd_coff_backend_data + structure: _bfd_coff_link_output_has_begun and + _bfd_coff_final_link_postscript. Add default initialisers for + these fields. Add overridable aliases for the coff swap functions + in the backend data structure. + + * elf32-v850.c: Update with patches from the branch to fix + HI16_S/LO16 reloc pairs. + +Wed Dec 10 14:06:48 1997 Michael Meissner + + * elf32-d30v.c (d30v_info_to_howto_rela): New function to support + RELA relocations. + (USE_REL): Don't define any more, switch to using RELA + relocations. + (elf_info_to_howto): Define as d30v_info_to_howto_rela. + +Tue Dec 9 11:37:53 1997 Andrew Cagney + + * archures.c (bfd_mach_mips*): Define. + (bfd_default_scan): For 3000 and 4000 replace magic constant with + macro. + + * cpu-mips.c (N): Define. + (bfd_mips_arch, arch_info_struct): Re-write using macro N, replace + numbers with bfd_mach_mips* macros. + +Fri Dec 5 11:13:46 1997 Nick Clifton + + * elf32-v850.c (v850_elf_reloc, v850_elf_store_addend_in_insn, + v850_elf_relocate_section): Fix reloc addend handling. + (v850_elf_section_from_bfd_section, v850_elf_symbol_processing, + v850_elf_add_symbol_hook, v850_elf_link_output_symbol_hook, + v850_elf_section_from_shdr, v850_elf_fake_sections): New functions + to create and handle special common sections. + (v850_elf_final_link_relocate): Fix HI16 and HI16_S relocations + which have data stored in the instructions. + +Tue Dec 2 10:26:16 1997 Nick Clifton + + * coff-arm.c (TARGET_UNDERSCORE): Revert back to '_' + (USER_LABEL_PREFIX): Revert back to '_' + + * config.bfd (targ_cpu): Add support for Thumb target. + +Mon Dec 1 20:24:18 1997 J"orn Rennecke + + * coff-sh.c (sh_coff_howtos): Add R_SH_SWITCH8 entry. + (get_symbol_value): Handle R_SH_SWITCH8. + (sh_relax_delete_bytes): Likewise. + +Wed Nov 26 14:13:34 1997 Nick Clifton + + * coff-arm.c (TARGET_UNDERSCORE): Changed to match definition in + gcc/config/arm/semi.h + + * coffcode.h (coff_slurp_symbol_table): Add ARM and Thumb symbol + classes. + +Sun Nov 23 16:02:58 1997 Andrew Cagney + + * freebsd.h (SWAP_MAGIC): Read magic number little and not big + endian. + +Wed Nov 26 09:30:37 1997 Nick Clifton + + * coffcode.h (coff_mkobject_hook): Only set private flags for non + PE ARM ports. + +Tue Nov 25 15:33:23 1997 Richard Henderson + + * binary.c (binary_set_section_contents): Also ignore NEVER_LOAD + sections. + +Tue Nov 25 10:55:36 1997 Nick Clifton + + * coff-arm.c (coff_arm_bfd_merge_private_bfd_data): Do not + complain if inout and output formats differ. + +Tue Nov 25 11:26:27 1997 Ian Lance Taylor + + * Makefile.am (BFD32_BACKENDS): Remove tekhex.lo. + (BFD32_BACKENDS_CFILES): Remove tekhex.c. + * Makefile.in: Rebuild. + * aclocal.m4, configure, Makefile.in: Rebuild with current + automake and autoconf. + + * coff-arm.c (arm_allocate_interworking_sections): Fix typo + (COFF_WITH_PR to COFF_WITH_PE). + +Mon Nov 24 15:47:49 1997 Nick Clifton + + * coff-arm.c: Make variables and some functions static, so that + this file can be included in multiple object files. + (coff_arm_bfd_final_link): Fix minor bug. + +Sat Nov 22 15:16:00 1997 Nick Clifton + + * coff-arm.c: Add support for PIC and APCS-FLOAT type binaries. + + * coffcode.h: Add support for PIC and APCS-FLOAT type binaries. + +Sat Nov 22 16:06:56 1997 Klaus Kaempf + + * evax-emh.c (_bfd_evax_write_emh): Use alloca instead of strdup. + +Sat Nov 22 12:29:30 1997 Ian Lance Taylor + + * sunos.c (sunos_add_one_symbol): When overriding a defined + symbol, set it to undefined, not new. + + * elf32-sh.c (sh_elf_relax_delete_bytes): Don't kill LABEL + relocs. + +Fri Nov 21 14:14:22 1997 Richard Henderson + + * coff-sh.c (sh_relax_section): Force sign extention of USES r_offset. + (sh_relax_delete_bytes): Don't kill LABEL relocs. + +Mon Nov 17 15:08:38 1997 Jeffrey A Law (law@cygnus.com) + + * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Fix typo. + (mn10300_elf_relax_section): Likewise. + +Sat Nov 15 15:36:07 1997 Fred Fish + + * peicode.h (coff_swap_aouthdr_in): Cast second arg of + bfd_h_get_* calls to "bfd_byte *". + +Tue Nov 11 10:37:23 1997 Jeffrey A Law (law@cygnus.com) + + * elf-m10300.c (elf32_mn10300_link_hash_entry): Add new field + "movm_stack_size". + (mn10300_elf_relax_section): Include stack space for register saves + in the imm8 field of a "call" instruction. + (compute_function_info): Determine how much stack is allocated by + the movm instruction. Fix typo. + (elf32_mn10300_link_hash_newfunc): Initialize movm_stack_size. + +Mon Nov 10 14:32:40 1997 Andreas Schwab + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Don't crash if + a version dependency could not be found. + +Tue Nov 4 12:05:56 1997 Klaus K"ampf + + * configure.com: Get version info from configure.in + +Fri Oct 24 11:15:58 1997 Jakub Jelinek + + * elf64-sparc.c (sparc64_elf_merge_private_bfd_data): + New function. Avoid mixing US1 and HAL R1 code. + Set resulting memory ordering to the strongest one used. + (sparc64_elf_object_p): Set bfd_mach correctly. + +Thu Oct 23 14:09:33 1997 Richard Henderson + + * elf64-sparc.c (sparc64_elf_howto_table): Add UA64 & UA16. + (sparc64_elf_check_relocs): Handle them. + (sparc64_elf_relocate_section): Likewise. Before emitting a dyn reloc, + check alignment and transmute R_SPARC_x<->R_SPARC_UAx. + +Thu Oct 23 00:53:14 1997 Richard Henderson + + * configure.in (sparc*-*-linux*): Use trad-core and ... + * hosts/sparclinux.h: New file. + +Thu Oct 23 00:25:29 1997 Richard Henderson + + * config.bfd (sparc64-*-linux*): New target. + + * elf-bfd.h (struct elf_backend_data): Add plt_alignment member. + * elflink.c (_bfd_elf_create_got_section): Set .got alignment based + on arch_size. + (_bfd_elf_create_dynamic_sections): Likewise for .rel* sections. + Set .plt alignment from new plt_alignment. + * elflink.h (elf_link_create_dynamic_sections): Set version section + alignment to LOG_FILE_ALIGN. + * elfxx-target.h (elf_backend_plt_alignment): Provide default. + (elfXX_bed): Init plt_alignment. + + * elf64-sparc.c (sparc64_elf_check_relocs, + sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections, + sparc64_elf_adjust_dynindx, sparc64_elf_finish_dynamic_symbol, + sparc64_elf_finish_dynamic_sections): New functions. + (sparc64_elf_howto_table): Fix a few name strings. + (ELF_DYNAMIC_INTERPRETER): New definition. + (sparc64_elf_relocate_section): Handle shared libraries. + + * elf64-sparc.c (struct plt_template, plt_*_header, plt_*_entry, + sparc64_elf_build_plt_entry, sparc64_elf_finish_dynamic_symbol): + PLT definitions sparc64-linux originally choose. These will go + away soon in favour of the official abi definitions. + +Wed Oct 22 16:08:45 1997 Ian Lance Taylor + + * coff-sh.c (coff_small_object_p): New static function. + (coff_small_new_section_hook): New static function. + (bfd_coff_small_swap_table): New static const structure. + (coff_small_close_and_cleanup): Define. + (coff_small_bfd_free_cached_info): Define. + (coff_small_get_section_contents): Define. + (coff_small_get_section_contents_in_window): Define. + (shcoff_small_vec): New static structure. + (shlcoff_small_vec): New static structure. + * targets.c (bfd_target_vector): Add shcoff_small_vec and + shlcoff_small_vec. + * config.bfd (sh-*-elf*): Add shcoff_small_vec and + shlcoff_small_vec to targ_selvecs. + (sh-*-*): Likewise. + * configure.in: Add shcoff_small_vec and shlcoff_small_vec cases. + * configure: Rebuild. + +Mon Oct 20 15:01:27 1997 Klaus K"ampf + + * evax-egsd.c: Weak symbols are global. + + * evax-emh.c: Use proper casts. + + * evax-egsd.c (_bfd_evax_write_egsd): Remove unneeded uname. + + * evax-egsd.c: Section names and symbols have different + length restrictions. Add length parameter to + _bfd_evax_length_hash_symbol. + * evax-etir.c: Likewise. + * evax-misc.c (_bfd_evax_length_hash_symbol): Add length + parameter. + * evax.h (EOBJ_S_C_SECSIZ): Define. + + * evax-alpha.c: Remove duplicate test. + + * evax-emh.c: SYS$ functions are upper-case. + + * evax-egsd.c: Create separate sections for common symbols. + * evax-etir.c: Don't output common section. + * evax.h: Bump up section count. + + * configure.com: Use 64bit integers with DEC C. + + * evax-egsd.c: Make section flags dec c compatible. + +Mon Oct 20 09:38:31 1997 Jeffrey A Law (law@cygnus.com) + + * som.c (normalize): Delete function. + (som_bfd_ar_write_symbol_stuff): New parameter elength. All callers + changed. Use passed in elength to determine size of the extended + name table instead of computing it again. + +Sun Oct 19 23:36:21 1997 Jim Wilson + + * peicode.h (coff_swap_scnhdr_out): Use |= not = to set + IMAGE_SCN_MEM_READ for an unrecognized section. + +Sun Oct 19 21:04:56 1997 Jeffrey A Law (law@cygnus.com) + + * som.c (som_bfd_ar_write_symbol_stuff): Account for trailing + '/' in the extended name table. + +Fri Oct 17 00:04:13 1997 Richard Henderson + + * elflink.h (elf_link_assign_sym_version): For explicitly versioned + symbols, check globals list before matching on locals. + +Thu Oct 16 08:17:06 1997 Michael Meissner + + * peicode.h (coff_swap_scnhdr_out,pe_print_idata): Fix mangled + patch. + +Wed Oct 15 13:45:10 1997 Ian Lance Taylor + + * peicode.h (pe_mkobject_hook): Set DLL flag. + (pe_bfd_copy_private_bfd_data): Copy DLL flag. + + * peicode.h (coff_swap_scnhdr_out): Set IMAGE_SCN_MEM_DISCARDABLE + for .stab* sections. Replace strlen of constant strings with + number. + +Tue Oct 14 15:42:45 1997 Richard Henderson + + * elf64-alpha.c (elf64_alpha_merge_ind_symbols): New function to + merge got and reloc entries from ind syms to their target. + (elf64_alpha_always_size_sections): Call it. + (elf64_alpha_check_relocs): Operate on the target of indirect symbols. + (elf64_alpha_can_merge_gots): Likewise. + (elf64_alpha_merge_gots): Likewise. + + * elf64-alpha.c (elf64_alpha_relocate_section): Back out HJ's change, + as it is insufficient to handle the relocation changes as well. + +Mon Oct 13 23:10:08 1997 Richard Henderson + + * elf64-alpha.c (elf64_alpha_calc_dynrel_sizes): Allow for RELATIVE + relocs for symbols in shlibs that have been forced local. + (elf64_alpha_relocate_section): Output RELATIVEs in .got for same. + +Mon Oct 13 21:24:04 1997 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section): Use the + got_enties of the default symbol for the default versioned + symbol. Patch from hjl@gnu.ai.mit.edu, modified not to use + alloca in the loop. + +Mon Oct 13 17:37:37 1997 Nick Clifton + + * elf32-v850.c (v850_elf_final_link_relocate): Only use the bottom + 24 bits of the PC when computing a PC relative relocation. + +Fri Oct 10 16:01:30 1997 Nick Clifton + + * elf32-v850.c (v850_elf_reloc, v850_elf_final_link_relocate): + Correct value for maximum positive 22 bit PC relative relocation. + (v850_elf_final_link_relocate): Prevent overflow from HI16_S and + HI_16 relocations. Correct bit adjustment in TDA offsets. + +Thu Oct 9 16:43:39 1997 Doug Evans + + * elf64-sparc.c (sparc_elf_{hix22,lox10}_reloc): New functions. + (sparc64_elf_howto_table): Use them for HIX22,LOX10 relocs. + +Wed Oct 8 11:38:45 1997 Richard Henderson + + * elfcore.h (bfd_prstatus): Pedanticly, alignment_power should + be LOG_FILE_ALIGN. + +Wed Oct 8 11:36:00 1997 Richard Henderson + + * config.bfd: Missed one alpha* change. + +Tue Oct 7 13:00:17 1997 Doug Evans + + * elf32-sparc.c (_bfd_sparc_elf_howto_table): Remove BFD64 support. + * elf64-sparc.c (SPARC64_OLD_RELOCS): Undef. + (MINUS_ONE): New macro. + (sparc_elf_notsup_reloc): New function. + (sparc64_elf_howto_table): Add entries for DISP64,PLT64,HIX22,LOX10, + H44,M44,L44,REGISTER. + (sparc_reloc_map): Likewise. Map BFD_RELOC_CTOR to R_SPARC_64. + (init_insn_reloc): New function. + (sparc_elf_wdisp16_reloc): Use it. + (sparc64_elf_relocate_section): Add entries for OLO10,HIX22,LOX10. + +Tue Oct 7 11:40:37 1997 Ian Lance Taylor + + * som.c (som_construct_extended_name_table): Remove static + function, and define as macro instead. + +Fri Oct 3 14:02:17 1997 Richard Henderson + + * config.bfd: Change alpha-*-* to alpha*-*-*; config.guess now + recognizes alphaev5 etc. + * configure.host: Likewise. + +Fri Oct 3 11:23:47 1997 Ian Lance Taylor + + Make ld -s work on AIX: + * xcofflink.c (xcoff_link_add_symbols): Don't create the .debug + section if we are stripping. + (bfd_xcoff_size_dynamic_sections): Don't set the .debug section + size if we are stripping. + (_bfd_xcoff_bfd_final_link): Don't set SEC_RELOC or rel_filepos, + and don't write out relocs, if we are stripping. + (xcoff_link_input_bfd): Don't set up reloc if we are stripping. + (xcoff_write_global_symbol): Don't write out symbol or reloc if we + are stripping. + + * configure.in: Don't include elf.lo again for ELF targets; it's + always in the library anyhow. + * configure: Rebuild. + + * bfd-in2.h: Rebuild. + + * elf32-sparc.c (sparc_elf_wdisp16_reloc): Cast to bfd_byte *, not + char *, when calling bfd_get_32 and bfd_put_32. + * sunos.c (sunos_scan_dynamic_symbol): Cast contents to char * + when calling strcpy. + +Thu Oct 2 16:15:50 1997 Doug Evans + + * reloc.c (bfd_check_overflow): New function. + (bfd_perform_relocation, bfd_install_relocation): Use it. + (BFD_RELOC_SPARC_{DISP64,PLT64}): New relocs. + (BFD_RELOC_SPARC_{HIX22,LOX10,H44,M44,L44,REGISTER}): New relocs. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +Thu Oct 2 13:17:18 1997 Ian Lance Taylor + + * peicode.h (coff_swap_scnhdr_out): Set IMAGE_SCN_MEM_READ for an + unrecognized section. From Jon Thackray . + +Wed Oct 1 14:03:44 1997 Ian Lance Taylor + + * Makefile.am ($(BFD_H)): Change stmp-bfd.h to stmp-bfd-h. + (stmp-bfd-h): Rename from stmp-bfd.h. + (BFD_H_FILES, LIBBFD_H_FILES, LIBCOFF_H_FILES): New variables. + ($(srcdir)/bfd-in2.h): Just depend upon stmp-bin2-h. + (stmp-bin2-h): New target. + ($(srcdir)/libbfd.h): Just depend upon stmp-lbfd-h. + (stmp-lbfd-h): New target. + ($(srcdir)/libcoff.h): Just depend upon stmp-lcoff-h. + (stmp-lcoff-h): New target. + (CLEANFILES): Change stmp-bfd.h to stmp-bfd-h. Add stmp-bin2.h, + stmp-lbfd-h, and stmp-lcoff-h. + * Makefile.in: Rebuild. + + * configure.in: Use a diversion to set enable_shared before the + arguments are parsed. + * configure: Rebuild. + +Tue Sep 30 14:18:32 1997 Doug Evans + + * elf32-sparc.c (_bfd_sparc_elf_howto_table): R_SPARC_GLOB_JMP + renamed to R_SPARC_UNUSED_42. + (sparc_reloc_map): Delete R_SPARC_GLOB_JMP entry. + * elf64-sparc.c (_bfd_sparc_elf_howto_table): R_SPARC_GLOB_JMP + renamed to R_SPARC_UNUSED_42. + (sparc_reloc_map): Delete R_SPARC_GLOB_JMP entry. + * reloc.c (BFD_RELOC_SPARC_GLOB_JMP): Delete. + * bfd-in2.h: Regenerated. + * libbfd.h: Regenerated. + +Thu Sep 25 12:15:02 1997 Ian Lance Taylor + + * elflink.h (elf_merge_symbol): Don't check the hash creator until + after we have set *sym_hash. + +Wed Sep 24 16:52:28 1997 Joel Sherrill + + * config.bfd (sh*-*-rtems*): New target, like sh-*-*elf*. + +Wed Sep 24 11:27:23 1997 Ian Lance Taylor + + * Makefile.am (libbfd_a_SOURCES): Define. + * Makefile.in: Rebuild. + + * configure.in: Call AC_CHECK_TOOL before AM_PROG_LIBTOOL. + * aclocal.m4: Rebuild with new libtool. + * configure: Rebuild. + +Tue Sep 23 19:03:13 1997 Ian Lance Taylor + + * elf.c (map_sections_to_segments): Even if we are not demand + paged, don't put a loadable section after a nonloadable section. + (assign_file_positions_for_segments): Increment the file offset + for a section with contents, even if it is not loadable. + +Sun Sep 21 11:03:24 1997 Nick Clifton + + * elf32-v850.c (v850_elf_final_link_relocate): Add return code + indicating that __ctbp could not be found. + +Thu Sep 18 15:04:57 1997 Nick Clifton + + * elf32-v850.c (v850_elf_check_relocs): Improve error message. + +Wed Sep 17 09:54:51 1997 Nick Clifton + + * elf32-v850.c (v850_elf_final_link_relocate, v850_elf_reloc, + v850_elf_check_relocs, v850_elf_reloc_map, v850_elf_howto_table): + Add support for the CALLT relocs. + + * reloc.c (COMMENT): Add BFD_RELOC_V850_CALLT_6_7_OFFSET and + BFD_RELOC_V850_CALLT_16_16_OFFSET. + + * elf32-v850.c (v850_elf_final_link_relocate): Add checks to catch + relocations against non-existant symbols. + +Tue Sep 16 14:20:27 1997 Nick Clifton + + * reloc.c: Add BFR_RELOC_V850_TDA_16_16_OFFSET. + + * elf32-v850.c (v850_elf_reloc, v850_elf_final_link_relocate, + v850_elf_howto_table, v850_elf_reloc_map): Add support for a 16 + bit reloc in the tiny data area. + +Mon Sep 15 11:27:36 1997 Ken Raeburn + + Merged changes from Martin Hunt: + + * elf32-d30v.c (bfd_elf_d30v_reloc): Change pc-relative relocs + over 2^32 bytes to be absolute. Needed because D30V PC doesn't + necessarily wrap. + + * reloc.c, elf32-d30v.c (BFD_RELOC_D30V_9_PCREL, + BFD_RELOC_D30V_9_PCREL_R): New relocs. + + * elf32-d30v.c (bfd_elf_d30v_reloc_21): New function. + Do 15 and 21 bit pc-relative relocations. + * reloc.c (BFD_RELOC_D30V_15_PCREL_R, BFD_RELOC_D30V_21_PCREL_R): + New relocations. + + * elf32-d30v.c (bfd_elf_d30v_reloc): Addend needs to be + added to the relocation, not or'd. + +Wed Sep 10 15:17:25 1997 Nick Clifton + + * elf32-v850.c (v850_elf_reloc): Remove spurious error message. + +Wed Sep 10 11:17:50 1997 Andrew Cagney + + * archures.c (bfd_default_scan): Use strcasecmp. + (bfd_default_scan): Test for match with arch_name + ":" + + printable_name. + (bfd_default_scan): Test for match with printable_name - ":". + (bfd_default_scan): Delete w65, h8300, h8500, z8k, i960 special + cases. Each implements their own scan function. + (bfd_default_scan): Delete 386, 2900, 860, mips 2000, mips 4400 + special cases. Since info->mach == 0. The test mach == number + fails. + (bfd_arch_list): New function, return name of all the supported + architectures. + +Tue Sep 9 10:21:56 1997 Nick Clifton + + * elf32-v850.c (v850_elf_print_private_bfd_data): Break after + decoding architecture. + (v850_elf_reloc): Do not complain if a R_V850_LO16 reloc has bit + 15 set. + +Sun Sep 7 12:25:22 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * elf64-alpha.c (reloc_howto_type): Fix the howto table. + +Thu Sep 4 09:44:10 1997 Ian Lance Taylor + + * Makefile.am: Rebuild dependencies. + (ALL_MACHINES_CFILES): Add cpu-v850.c. + (ALL_MACHINES_CFILES): Add elf32-v850.c. + * Makefile.in: Rebuild. + + * reloc.c: Remove extraneous commas from relocation entries. + Remove BFD_RELOC_V850_16_PCREL. + * bfd-in2.h: Rebuild. + + * xcofflink.c (xcoff_link_add_symbols): Put XTY_CM/XMC_TD symbols + in sections named .tocbss rather than .bss. + +Wed Sep 3 11:23:23 1997 Nick Clifton + + * libbfd.h, bfd-in2.h, elf32-v850.c: Removed + BFD_RELOC_V850_16_PCREL. + +Tue Sep 2 20:44:10 1997 Fred Fish + + * cofflink.c (coff_link_check_ar_symbols): Handle C_SYSTEM syms + the same as C_EXT syms. + (coff_link_add_symbols): Ditto. + (_bfd_coff_link_input_bfd): Ditto. + (_bfd_coff_write_task_globals): Add save_global_to_static. Use + it to preserve and restore state of global_to_static flag. + +Tue Sep 2 17:45:22 1997 Nick Clifton + + * elf32-v850.c (v850_elf_object_p): Set machine number based on + bits in e_flags field rather than magic numbers. + (v850_elf_final_write_processing, v850_elf_set_private_flags, + v850_elf_copy_private_bfd_data, v850_elf_merge_private_bfd_data, + v850_elf_print_private_bfd_data): New functions. + +Tue Sep 2 17:43:49 1997 Nick Clifton + + * elf.c (prep_headers): Remove V850E magic number. + * elf.c (prep_headers): Remove V850EA magic number. + +Tue Sep 2 17:35:05 1997 Doug Evans + + * cpu-arc.c (arc_get_mach): Properly scan defined mach entries. + +Tue Sep 2 18:29:37 1997 Jeffrey A Law (law@cygnus.com) + + * elf-m10200.c (mn10200_elf_final_link_relocate): PC relative + instructions are relative to the next instruction, not the + current instruction. + (mn10200_elf_relax_section): Similarly. + +Tue Sep 2 15:45:45 1997 Nick Clifton + + * cpu-v850.c: Use a macro to construct bfd_arch_info_type + entries. + + * reloc.c, libbfd.h, bfd-in2.h, elf32-v850.c: Replace + BFD_RELOC_V850_{SDA/TDA/ZDA}_OFFSET relocs with new bit pattern + specific versions: BFD_RELOC_V850_{area}_{bits}_OFFSET. + +Thu Aug 28 17:01:09 1997 Andrew Cagney + + * cpu-v850.c: Remove "plain" from v850 printable name. + (scan): Use strcasecmp. + + * archures.c (bfd_mach_v850): Define. + + * cpu-sh.c (scan_mach): Compare with table instead of hardwired to + just sh/SH, use strcasecmp. + (arch_info_struct): Add entries for sh3 et.al. + + * archures.c (bfd_mach_sh, ...): Define. + +Wed Aug 27 17:33:07 1997 Andrew Cagney + + * archures.c (bfd_archures_list): Always NULL terminate the list. + +Tue Aug 26 17:26:51 1997 Ian Lance Taylor + + * Makefile.am: Rebuild dependencies. + (ALL_MACHINES_CFILES): Add cpu-arc.c. + (ALL_MACHINES_CFILES): Add elf32-arc.c. + (elf32-arc.lo): Remove explicit dependency. + * Makefile.in: Rebuild. + + * acinclude.m4 (BFD_CC_FOR_BUILD): Set EXEEXT_FOR_BUILD. + * doc/Makefile.am (MKDOC): Use EXEEXT_FOR_BUILD, not EXEEXT. + * aclocal.m4: Rebuild. + * configure: Rebuild. + * Makefile.in: Rebuild. + * doc/Makefile.in: Rebuild. + +Mon Aug 25 16:14:34 1997 Christopher Provenzano + + * configure: Rebuild with latest devo autoconf for NT support + +Mon Aug 25 16:11:04 1997 Nick Clifton + + * cpu-arm.c (compatible): If B is a default type, return A. + +Mon Aug 25 15:35:46 1997 Nick Clifton + + * cpu-v850.c (scan): New function. + (arch_info_struct): New structure. + (bfd_v850_arch): Add link into arch_info_structure. + + * config.bfd (targ_cpu): All v850 variants use the bfd_arch_v850 + architecture. + + * elf32-v850.c (v850_elf_object_p): New function. + + * archures.c (bfd_mach_v850e): Machine value for v850e. + + * bfd-in2.h (bfd_mach_v850e): Machine value for v850e. + + * elf32-v850.c (ELF_MACHINE_CODE): Default to v850e machine + number. + + * elf.c (prep_headers): Add support for v850e machine number. + + * archures.c (bfd_mach_v850ea): Machine value for v850ea. + + * bfd-in2.h (bfd_mach_v850ea): Machine value for v850ea. + + * elf32-v850.c (ELF_MACHINE_CODE): Default to v850ea machine + number. + + * elf.c (prep_headers): Add support for v850ea machine number. + +Mon Aug 25 14:07:33 1997 Ian Lance Taylor + + * syms.c (_bfd_stab_section_find_nearest_line): Clear the + cached_stab field if the offset prevents us from using the cache. + +Mon Aug 25 12:08:13 1997 Ian Lance Taylor + + * aout-target.h (MY(vec)): Add SEC_CODE and SEC_DATA to section + flags. + * aout-arm.c (aout_arm_little_vec): Likewise. + (aout_arm_big_vec): Likewise. + * bout.c (b_out_vec_big_host): Likewise. + (b_out_vec_little_host): Likewise. + * mipsbsd.c (aout_mips_little_vec): Likewise. + (aout_mips_big_vec): Likewise. + +Tue Aug 19 10:09:10 1997 Fred Fish + + * coff-tic80.c (COFF_ALIGN_IN_SFLAGS): Define to 1. + * coffcode.h (styp_to_sec_flags): Ignore incoming STYP_INFO + bit in s_flags if COFF_ALIGN_IN_S_FLAGS is defined. + +Tue Aug 19 08:47:17 1997 Fred Fish + + * coff-i960.c (COFF_ALIGN_IN_SECTION_HEADER): Define to 1. + (GET_SCNHDR_ALIGN, PUT_SCNHDR_ALIGN): Define. + * coff-m88k.c (GET_SCNHDR_NRELOC, GET_SCNHDR_NLNNO): Define. + * coffcode.h (coff_set_alignment_hook): Conditionally compile in if + COFF_ALIGN_IN_SECTION_HEADER is defined. Convert alignment to power + of two for I960 only. + * coffswap.h (GET_SCNHDR_NRELOC, PUT_SCNHDR_NRELOC, GET_SCNDHR_NLNNO, + PUT_SCNHDR_NLNNO, GET_SCNHDR_FLAGS, PUT_SCNHDR_FLAGS): Provide + default definitions. + (coff_swap_scnhdr_in): Use GET_SCNHDR_FLAGS, GET_SCNHDR_NRELOC, + GET_SCNHDR_NLNNO, and GET_SCNHDR_ALIGN. + (coff_swap_scnhdr_out): Use PUT_SCNHDR_FLAGS, PUT_SCNHDR_ALIGN. + * Makefile.in (coff-tic80.o): Depends upon coffswap.h. + * coff-tic80.c (COFF_ALIGN_IN_SECTION_HEADER): Define to 1. + (GET_SCNHDR_FLAGS, PUT_SCNHDR_FLAGS): Define + * coffcode.h (coff_write_object_contents): Set alignment field in + section header for TIC80COFF files. + +Mon Aug 18 11:36:19 1997 Nick Clifton + + * elf32-v850.c (v850_elf_howto_table, v850_elf_reloc_map, + v850_elf_check_relocs, v850_elf_reloc, + v850_elf_final_link_relocate): Add support for + BFD_RELOC_V850_16_PCREL relocation. + + * reloc.c (COMMENT): Add suuport for BFD_RELOC_V850_16_PCREL + relocation. + + * libbfd.h: Add support for BFD_RELOC_V850_16_PCREL relocation. + + * bfd-in2.h: Add support for BFD_RELOC_V850_16_PCREL relocation. + +Mon Aug 18 11:33:56 1997 Nick Clifton + + * cpu-v850e: New file. + + * elf.c (prep_headers): Add support for v850e target. + + * bfd-in2.h (bfd_architecture): Add support for v850e target. + + * config.bfd: Add support for v850e target. + + * archures.c: Add support for v850e target. + +Mon Aug 18 11:33:56 1997 Nick Clifton + + * cpu-v850ea: New file. + + * elf.c (prep_headers): Add support for v850ea target. + + * bfd-in2.h (bfd_architecture): Add support for v850ea target. + + * config.bfd: Add support for v850ea target. + + * archures.c: Add support for v850ea target. + +Fri Aug 15 12:01:28 1997 Ian Lance Taylor + + * coffgen.c (coff_find_nearest_line): Correctly handle the offset + argument as section relative, rather than an absolute address. + From Jan Hoogenraad . + +Fri Aug 15 04:58:02 1997 Doug Evans + + * config.bfd (arc-*-elf*): Add. + * configure.in (bfd_elf32_{little,big}arc_vec): Add. + * configure: Rebuild. + * Makefile.am (ALL_MACHINES): Add cpu-arc.lo. + (BFD32_BACKENDS): Add elf32-arc.lo. + (cpu-arc.lo,elf32-arc.lo): Add rules for. + * Makefile.in: Rebuild. + * archures.c (architecture list): Add bfd_arch_arc. + (bfd_archures_list): Add bfd_arc_arch. + (bfd_mach_arc_base): Define. + * reloc.c (BFD_RELOC_ARC_B22_PCREL,BFD_RELOC_ARC_B26): Add. + * targets.c (bfd_elf32_{little,big}arc_vec): Declare. + (bfd_target_vect): Add them. + * bfd-in2.h, libbfd.h: Rebuild. + * cpu-arc.c, elf32-arc.c: New files. + * elf.c (pre_headers): Recognize bfd_arch_arc. + +Tue Aug 12 11:45:18 1997 Ian Lance Taylor + + * aoutx.h (NAME(aout,final_link)): If no symbols, make sure the + data section is correctly rounded to a page in the file. + +Mon Aug 11 12:45:43 1997 Ian Lance Taylor + + * aoutx.h (NAME(aout,final_link)): Don't emit the string table if + there are no symbols. + +Sun Aug 10 14:45:56 1997 Ian Lance Taylor + + * coff-stgo32.c: Rename from coff-stubgo32.c to avoid old System V + file system 14 character limit. + * Makefile.am: Corresponding changes. + * configure.in: Corresponding changes. + * Makefile.in: Rebuild. + * configure: Rebuild. + +Fri Aug 8 18:34:36 1997 Ian Lance Taylor + + * Makefile.am: (ALL_MACHINES_CFILES): Add elf32-d10v.c. + Rebuild dependencies. + * Makefile.in: Rebuild. + +Wed Aug 6 18:56:51 1997 Ian Lance Taylor + + * Makefile.am (docdir): Define. + * Makefile.in: Rebuild. + +Tue Aug 5 23:05:03 1997 Ian Lance Taylor + + * configure: Rebuild with autoconf 2.12.1. + +Mon Aug 4 12:00:35 1997 Ian Lance Taylor + + * aclocal.m4, configure: Rebuild with new automake patches. + +Sun Aug 3 08:15:12 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * rs6000-core.c (make_bfd_asection): New function to add a section + to the core file bfd. + (rs6000coff_core_p): Use make_bfd_asection to add the core file + sections. + Use BFD routines to seek, read and stat the core file. + Handle .data sections from loaded objects and anonymously mmapped + regions, these are available in AIX 4 core files. + +Fri Aug 1 12:58:32 1997 Ian Lance Taylor + + * configure.in: Set enable_shared before AM_PROG_LIBTOOL. + * acinclude.m4: Move acmacros.m4 in here. Remove AM_PROG_LIBTOOL + copy; use a patches libtool instead. + * acmacros.m4: Remove. + * Makefile.in: Rebuild. + * aclocal.m4: Rebuild. + * configure: Rebuild. + +Thu Jul 31 19:55:36 1997 Ian Lance Taylor + + * Makefile.am: New file, based on old Makefile.in. + * acmacros.m4: New file, copied from old aclocal.m4. + * acinclude.m4: New file. + * configure.in: Call AM_PROG_LIBTOOL. Remove shared library + handling; now handled by libtool. Replace AC_CONFIG_HEADER with + AM_CONFIG_HEADER. Replace AC_PROG_INSTALL with AM_PROG_INSTALL. + Call AM_MAINTAINER_MODE, AM_CYGWIN32, and AM_EXEEXT. Change all + .o files to .lo. Remove stamp-h handling in AC_OUTPUT. + * acconfig.h: Mention PACKAGE and VERSION. + * stamp-h.in: New file. + * dep-in.sed: Change .o to .lo. + * Makefile.in: Now built with automake. + * aclocal.m4: Now built with aclocal. + * config.in, configure: Rebuild. + * VERSION: Remove. + +Thu Jul 31 12:09:20 1997 Geoff Keating + + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Don't set TEXTREL + if there is only a relocation to a read-only but not allocatable + section (like .stab). + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. + * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise. + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. + * elf32-mips.c (mips_elf_size_dynamic_sections): Likewise. + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise. + + * elf32-ppc.c (ppc_elf_howto_raw): Correct various comments. + (ppc_elf_create_linker_section): These sections are not + created by the linker (that is, they are created by the user + putting data in them). In particular, they can be the source + and target of relocations. + (ppc_elf_adjust_dynamic_symbol): Check postcondition of + bfd_elf32_link_record_dynamic_symbol. Align 16-byte common + objects (for instance, 'long double') to 16-byte boundaries. + (ppc_elf_size_dynamic_sections): Make the code that generates + section symbols exactly the same as for sparc, reducing the + number of section symbols output. + (ppc_elf_check_relocs): Check postcondition of + bfd_elf32_link_record_dynamic_symbol. Make default case the + same as corresponding code for sparc, fixing bug involving + .rela.stabs. + (ppc_elf_finish_dynamic_symbol): Fix case involving GOT symbols + forced to be local because of versioning (by replicating + corresponding change in sparc). Treat R_PPC_RELATIVE RELA relocs + as usual in ELF, not as pseudo-REL relocs (as the sparc linker + does). + (ppc_elf_relocate_section): Add handy debugging code for when + assertion fails. Add some more 'symbol made local because of + versioning' cases. + + * elf32-ppc.c (ppc_elf_relocate_section): Cope with addend when + processing a GOT relocation as required by ABI. + +Wed Jul 30 21:30:35 1997 Andreas Schwab + + * elflink.h (NAME(bfd_elf,record_link_assignment)): Remove any + version info if this symbol came from a dynamic object. + (elf_link_add_object_symbols): Set the version info of a symbol + only if the object actually contains version definitions and + defines this symbol. + +Mon Jul 28 18:07:43 1997 Rob Savoye + + * aclocal.m4: Add CYGWIN and EXEEXT autoconf macros. + * configure.in: Use CYGWIN and EXEEXT autoconf macro to look for + win32 dependencies. + * configure: Regenerated with autoconf 2.12. + * doc/Makefile.in: Add $(EXEEXT) to chew executable. + +Mon Jul 28 02:50:29 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * rs6000-core.c (rs6000coff_core_p): If CORE_TRUNC is set, print + a warning rather than returning an error. + +Sun Jul 27 19:54:14 1997 Felix Lee + + * coffswap.h (coff_swap_aux_in): add semicolon to make MSVC happy. + +Fri Jul 25 14:50:08 1997 Felix Lee + + * cisco-core.c: define signals for wingdb. + +Fri Jul 25 16:27:07 1997 Ian Lance Taylor + + * ecofflink.c (bfd_ecoff_debug_accumulate): Only merge files with + the same number of aux entries. + +Fri Jul 25 08:22:15 1997 Jeffrey A Law (law@cygnus.com) + + * som.c (hppa_som_gen_reloc_type): Use R_DATA_EXPR for the + difference of two symbols if the relocation size is 32 bits. + (som_write_fixups): Handle R_DATA_EXPR. + +Wed Jul 23 16:08:02 1997 Ian Lance Taylor + + * coff-i386.c (coff_i386_reloc): Don't offset a common symbol by + its value if COFF_WITH_PE is defined. + +Tue Jul 22 17:19:45 1997 Robert Hoehne + + * coff-stubgo32.c: New file. + * go32stub.h: New file. + * coff-i386.c: If COFF_GO32_EXE, include coff/go32exe.h. + * coffswap.h (coff_swap_filehdr_in): Invoke + COFF_ADJUST_FILEHDR_IN_PRE and COFF_ADJUST_FILEHDR_IN_POST if they + are defined. + (coff_swap_filehdr_out): Invoke COFF_ADJUST_FILEHDR_OUT_PRE and + COFF_ADJUST_FILEHDR_OUT_POST if they are defined. + (coff_swap_aux_in): Invoke COFF_ADJUST_AUX_IN_PRE and + COFF_ADJUST_AUX_IN_POST if they are defined. + (coff_swap_aux_out): Invoke COFF_ADJUST_AUX_OUT_PRE and + COFF_ADJUST_AUX_OUT_POST if they are defined. + (coff_swap_scnhdr_in): Invoke COFF_ADJUST_SCNHDR_IN_PRE and + COFF_ADJUST_SCNHDR_IN_POST if they are defined. + (coff_swap_scnhdr_out): Invoke COFF_ADJUST_SCNHDR_OUT_PRE and + COFF_ADJUST_SCNHDR_OUT_POST if they are defined. + * targets.c (go32stubbedcoff_vec): Declare. + (bfd_target_vector): Add go32stubbedcoff_vec. + * configure.in (go32coff_vec): New target vector. + (go32stubbedcoff_vec): Likewise. + * config.bfd (i[3456]86-*-msdosdjgpp*): New target. + (i[3456]86-*-go32*): Change to be like new msdosdjgpp*. + * Makefile.in: Rebuild dependencies. + (BFD32_BACKENDS): Add coff-stubgo32.o. + (BFD32_BACKENDS_CFILES): Add coff-stubgo32.c. + (HFILES): Add go32stub.h. + +Tue Jul 22 15:09:12 1997 Ian Lance Taylor + + * configure.in: Check for fdopen. + * configure, config.in: Rebuild. + * opncls.c (bfd_fdopenr): Check HAVE_FDOPEN rather than VMS or + __GO32__. Reindent a bit. + +Sun Jul 20 20:05:20 1997 Ian Lance Taylor + + * sunos.c (sunos_create_dynamic_sections): Set SEC_LINKER_CREATED + flag for newly created sections. + (sunos_add_dynamic_symbols): Don't discard newly created sections + if shared library is dynobj. + +Mon Jul 14 15:33:55 1997 Ian Lance Taylor + + * elf.c (map_sections_to_segments): When checking whether + including a section in a segment would force us to skip a page, + align the address of the next segment to avoid wraparound + problems. + +Tue Jul 8 12:11:29 1997 Fred Fish + + * coffcode.h (coff_write_object_contents): Initialize + target id field to TIC80_TARGET_ID. + * coffswap.h (coff_swap_filehdr_out): Swap out target id field + if used. + (coff_swap_filehdr_in): Swap in target id field if used. + +Mon Jul 7 16:41:20 1997 Ian Lance Taylor + + * coff-i386.c (coff_i386_is_local_label_name): New static function + if TARGET_UNDERSCORE. + (coff_bfd_is_local_label_name): Define if TARGET_UNDERSCORE. + (i386coff_vec): Add SEC_CODE and SEC_DATA to section_flags. + +Mon Jun 30 14:29:26 1997 Ian Lance Taylor + + * elf32-m68k.c (howto_table): Use complain_overflow_bitfield, not + complain_overflow_signed, for 32 bit PC relative relocations. + +Thu Jun 26 01:26:31 1997 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): When a version + indirection symbol is overridden, make the original symbol point + at the real overriding symbol. + + * elf.c (bfd_elf_string_from_elf_section): Check for an invalid + string index. + + * elflink.h (elf_link_output_extsym): Use the right section for a + common symbol. + * elf32-mips.c (mips_elf_link_output_symbol_hook): If a common + symbol was in .scommon, mark it as SHN_MIPS_SCOMMON. + +Wed Jun 25 12:43:10 1997 H.J. Lu + + * elflink.h (elf_merge_symbols): Resolve indirect and warning + symbols before checking for new symbols. + + * elfcore.h (elf_corefile_note): Move out of HAVE_SYS_PROCFS_H. + +Tue Jun 24 11:20:43 1997 Ian Lance Taylor + + * coffgen.c (coff_object_p): Read the f_opthdr bytes from the + file, not aoutsz bytes (they are different in XCOFF .o files). + + * xcofflink.c (xcoff_link_add_symbols): Permit symbols to be + redefined by objects included from archives. + +Mon Jun 23 18:03:27 1997 Ian Lance Taylor + + * elflink.h (elf_merge_symbol): In the case of a new defined + symbol overriding an old defined symbol, return the hash table + entry which we modify, even if it is the target of an + indirection. + (elf_link_add_object_symbols): If the real name of the symbol gets + overridden, convert the versioned symbol into an indirect symbol + to the real symbol. + + * elflink.h (elf_merge_symbol): New static function, broken out of + elf_link_add_object_symbols. + (elf_link_add_object_symbols): Call it. + +Sun Jun 22 19:40:57 1997 Ian Lance Taylor + + * coff-i386.c (i3coff_object_p): If COFF_IMAGE_WITH_PE, hack to + handle case where COFF filehdr does not immediately follow PE + header. + * coffgen.c (coff_object_p): Remove useless seek to current + location. + +Wed Jun 18 19:03:38 1997 Ian Lance Taylor + + * linker.c (link_action): Change COMMON_ROW/indr to from CREF to + REFC. + +Tue Jun 17 11:55:02 1997 Ian Lance Taylor + + * cofflink.c (_bfd_coff_link_input_bfd): If stripping debugging + symbols, skip N_ABS symbols with debugging storage classes. + +Mon Jun 16 18:56:27 1997 Geoff Keating + + * elf32-ppc.c (ppc_elf_relocate_section): Don't emit R_PPC_REL* + relocs in shared libraries which refer to local symbols. Cope + with addend when processing a GOT relocation. + + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Only create symbols + for sections that the linker didn't create. + (ppc_elf_finish_dynamic_sections): Only try to write out a section + symbol if it was created in ppc_elf_size_dynamic_sections. + (ppc_elf_relocate_section): Complain if we have to generate a reloc + relative to a section for which we didn't output a symbol. + + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Clean up. PLT + relocs are 'rela' relocs, like everything else. .rela.plt is not + a read-only section, so we don't have to special-case it. + + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Entries in the + .rela.bss section are (of course) 'rela' relocs not 'rel' relocs. + + * elf32-ppc.c (ppc_elf_check_relocs): Initialise srelgot. + (ppc_elf_relocate_section): @got offsets are 4 from start of the + actual .got section. + * elflink.c (_bfd_elf_create_got_section): The three reserved + words start from the symbol '_GLOBAL_OFFSET_TABLE_'. + + * elf32-ppc.c (ppc_elf_size_dynamic_sections): '.rela' is 5 + characters, not 4. + + * elf32-ppc.c (ppc_elf_check_relocs): Use + _bfd_elf_create_got_section to create the GOT rather than + ppc_elf_create_linker_section. Create the '.rela.got' section + ourselves. + (ppc_elf_finish_dynamic_symbol): Set up GOT relocations when a + symbol has a GOT entry. + (ppc_elf_relocate_section): Record when a symbol is used through + the GOT, and allocate space in the GOT for each such symbol. + (ppc_elf_adjust_dynamic_symbol): Delete unused .got.plt stuff. + (ppc_elf_create_linker_section): Delete unused LINKER_SECTION_GOT + stuff. + + * elf32-ppc.c (ppc_elf_howto_raw): GOT16_HA relocs should be + treated in a similar way to ADDR16_HA relocs. + (ppc_elf_relocate_section): PLTREL24 relocs do not get copied into + shared objects; the linker must deal with them. + (ppc_elf_create_linker_section): Stop setting + _GLOBAL_OFFSET_TABLE_ to the wrong value; delete unused + LINKER_SECTION_PLT stuff. + (ppc_elf_check_relocs): Delete unused LINKER_SECTION_PLT stuff. + (ppc_elf_finish_dynamic_sections): Use BFD calls to get GOT + section, not ELF-specific calls. + (elf_backend_plt_not_loaded): Set to 1. + (elf_backend_got_symbol_offset): Set to 4. + * elf-bfd.h (elf_backend_data): Add 'plt_not_loaded' member + for when ld.so fills in the PLT; and 'got_symbol_offset' member. + * elflink.c (_bfd_elf_create_dynamic_sections): Apply + plt_not_loaded member. + (_bfd_elf_create_got_section): Apply got_symbol_offset. + * elfxx-target.h (elf_backend_plt_not_loaded): Set default to + 'loaded'. + (elf_backend_G_O_T_offset): Set default to 0. + (elfNN_bed): Set added fields. + + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Was setting + DT_RELENT in shared objects; should be DT_RELAENT. + + * elf32-ppc.c (ppc_elf_relocate_section): Propagate + R_PPC_ADDR16_HA relocs to shared objects. Cope with case where + such a reloc (in a non-shared object) refers to a symbol that's + not defined. + +Mon Jun 16 14:42:14 1997 H.J. Lu + + * elfcode.h (put_signed_word): Define. + (get_signed_word): Define. + (elf_swap_reloca_in): Use get_signed_word for the r_addend field. + (elf_swap_reloca_out): Use put_signed_word for the r_addend + field. + * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Use + bfd_get_signed_32 to set the r_addend field. + * elf64-mips.c (mips_elf64_swap_reloca_in): Use + bfd_h_get_signed_64 to set the r_addend field. + +Mon Jun 16 12:31:29 1997 Ian Lance Taylor + + * elf32-i386.c (elf_i386_relocate_section): When generating a + shared library, do the relocation if the input section is not + allocated in memory. + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Call + elf_link_assign_sym_version before elf_adjust_dynamic_symbol. + (elf_fix_symbol_flags): New static function, broken out of + elf_adjust_dynamic_symbol. + (elf_adjust_dynamic_symbol): Call elf_fix_symbol_flags. + (elf_link_assign_sym_version): Likewise. Permit a symbol to be + forced local even if NEEDS_PLT is set. When forcing a symbol to + be local, clear NEEDS_PLT. + (elf_link_output_extsym): Remove unused local bed. + +Wed Jun 11 22:44:20 1997 Jeffrey A Law (law@cygnus.com) + + * elf32-mn10300.c (elf32_mn10300_link_hash_entry): New structure + for derived elf linker hash table entries. References to + elf_link_hash_entry changed appropriately. + (elf32_mn10300_link_hash_table): New structure for derived elf + linker hash table. + (elf32_mn10300_hash_table): Define. + (elf32_mn10300_link_hash_traverse): Likewise. + (elf32_mn10300_link_hash_newfunc): New function. + (elf32_mn10300_link_hash_table_create): Likewise. + (elf32_mn10300_finish_hash_table_entry): Likewise. + (mn10300_elf_relax_section): Handle "call" -> "calls", removal + of prologue code, and call:32->call:16 relaxing. + (compute_function_info: New function. + (bfd_elf32_bfd_ilink_hash_table_create): Define. + +Wed Jun 11 00:00:07 1997 Ian Lance Taylor + + * elflink.h (elf_link_output_extsym): Call finish_dynamic_symbol + for a symbol which is being forced to be local. + * elf32-i386.c (elf_i386_relocate_section): Write out the + relocation value for a GOT reloc for a symbol which is turning + into a local symbol. + (elf_i386_finish_dynamic_symbol): If a symbol is turning into a + local symbol, write out a RELATIVE reloc rather than a GLOB_DAT + reloc. + * elf32-m68k.c, elf32-sparc.c: Corresponding changes. + + * elf32-i386.c (elf_i386_relocate_section): Get the relocation + value if the symbol is turning into a local symbol. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + +1997-06-10 22:58 Ulrich Drepper + + * elflink.h (elf_link_add_object_symbols): Also read verneed + information by calling `_bfd_elf_slurp_version_tables'. + (elf_link_add_object_symbols): For undefined symbols look for + version information in the verneed records. + (elf_link_add_object_symbols): Use soname of shared object + for verneed record if it is available. + +Tue Jun 10 11:13:03 1997 H.J. Lu + + * cpu-arm.c: Add prototypes for compatible and scan. + * cofflink.c: Add prototype for mark_relocs. + + * archive.c (bfd_special_undocumented_glue): Change filename to + const pointer. Add prototype. + +Mon Jun 9 12:34:21 1997 Andreas Schwab + + * elflink.h (elf_link_add_object_symbols): Ignore relocations of + sections that will be discarded. + +1997-06-06 22:58 Ulrich Drepper + + * elflink.h (elf_link_find_version_dependencies): When searching + for known version symbol skip non-matching verdef records, not + matching records. + +Thu Jun 5 15:52:45 1997 Ian Lance Taylor + + * cofflink.c (_bfd_coff_generic_relocate_section): Write a long, + not a bfd_vma, to the base file, to match how dlltool reads it. + +Tue Jun 3 16:57:45 1997 Nick Clifton + + * reloc.c: Add thumb relocations. + + * bfd-in2.h: Add Thumb relocations. + + * libbfd.h: Add Thumb relocations. + +Mon Jun 2 10:41:52 1997 Andreas Schwab + + * cpu-m68k.c (arch_info_struct): Fix 68060 cpu name. + +Fri May 30 12:46:27 1997 Ian Lance Taylor + + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Set dynindx + for a section even if it is not loaded. + + * cofflink.c (coff_link_add_symbols): If PE file, don't subtract + section VMA. + (_bfd_coff_link_input_bfd): Separate section VMA handling for + input and output files. + (_bfd_coff_generic_relocate_section): Check whether input file, + not output file, is a PE file. + +Wed May 28 15:48:43 1997 Nick Clifton + + * coff-arm.c: (coff_arm_bfd_set_private_flags): Make static. + +Wed May 28 16:16:04 1997 Ian Lance Taylor + + * coff-i386.c (coff_i386_reloc): Don't just exit if we see an + R_IMAGEBASE reloc. + +Wed May 28 09:48:43 1997 Nick Clifton + + * cpu-arm.c (compatible): Add test for supersets of ARM + architectures. + +Tue May 27 19:42:03 1997 Bob Manson + + * cofflink.c (_bfd_coff_final_link): Initialize global_to_static + member. + +Tue May 27 14:34:08 1997 Nick Clifton + + * coff-arm.c (coff_arm_bfd_set_private_flags): Make global. It is + called directly by gas/config/tc-arm.c. + +Tue May 27 15:58:53 1997 Richard Henderson + + * elf64-alpha.c (PLT_ENTRY_*): Use a new thread-safe format. + (elf64_alpha_finish_dynamic_symbol): Fill it in properly. + +Mon May 26 14:05:13 1997 Ian Lance Taylor + + * coff-ppc.c (coff_ppc_relocate_section): If PE file, don't add + section VMA. + +Mon May 26 10:57:48 1997 Fred Fish + + * peicode.h (coff_bfd_print_private_bfd_data): #undef before #define. + (coff_bfd_copy_private_bfd_data): Ditto. + * coff-arm.c (coff_arm_bfd_merge_private_bfd_data): Make static. + (coff_arm_bfd_print_private_bfd_data): Ditto. + (coff_arm_bfd_set_private_flags): Ditto. + (coff_arm_bfd_copy_private_bfd_data): Ditto. + +Fri May 23 15:14:58 1997 Fred Fish + + * libcoff-in.h (struct coff_final_link_info): Add boolean + global_to_static member for support of task linking. + (_bfd_coff_write_task_globals): Add prototype. + * libcoff.h: Regenerate. + * coffcode.h (coff_write_object_contents): Use #ifdef to + check RS6000COFF_C, to be consistent with all other uses + in this file. + * cofflink.c (_bfd_coff_final_link): If doing task linking, + call _bfd_coff_write_task_globals. + (_bfd_coff_link_input_bfd): If doing task linking, convert + global functions to static. + (_bfd_coff_write_global_sym): If doing task linking, convert + global variables to static. + (_bfd_coff_write_task_globals): New function. + * coff-tic80.c (TIC80COFF): Define this instead of just TIC80. + (C_AUTOARG): #undef since it clashes with C_UEXT. + (C_LASTENT): #undef since it clashes with C_STATLAB. + * coffcode.h (coff_write_object_contents): Use TIC80COFF + rather than TIC80. + (coff_slurp_symbol_table): Use C_SYSTEM. Hide C_AUTOARG use + when TIC80COFF defined (clashes with C_UEXT). Explicitly + recognize C_UEXT, C_STATLAB, and C_EXTLAB as unsupported. + +Fri May 23 12:38:24 1997 Ian Lance Taylor + + * coff-tic80.c (tic80_howto_table): Change overflow check for most + PP relocations to complain_overflow_dont. + +Thu May 22 20:22:14 1997 Ian Lance Taylor + + * coff-tic80.c (tic80_howto_table): Add PP relocations. Change + name of R_RELLONG to "RELLONG". Set rightshift and complain for + M_PPCR. + (ppbase_reloc, glob15_reloc): New static functions. + (glob16_reloc, local16_reloc): New static functions. + (rtype2howto): Handle all relocation types. + (coff_tic80_relocate_section): New static function. + (coff_relocate_section): Define to coff_tic80_relocate_section. + * Makefile.in (coff-tic80.o): Depends upon include/coff/tic80.h. + +Wed May 21 17:15:50 1997 Ian Lance Taylor + + * coffcode.h (coff_slurp_symbol_table): If COFF_WITH_PE or + COFF_IMAGE_WITH_PE, don't subtract the section VMA from the symbol + value. + * coffgen.c (fixup_symbol_value): Add abfd parameter. Change all + callers. If PE file, don't add section VMA. + (coff_write_alien_symbol): If PE file, don't add section VMA. + * cofflink.c (_bfd_coff_link_input_bfd): Likewise. + (_bfd_coff_write_global_sym): Likewise. + (_bfd_coff_generic_relocate_section): Likewise. + + * peicode.h: Add & 0xffffffff when using ImageBase in case bfd_vma + is 64 bits. + +Wed May 21 09:58:10 1997 Nick Clifton + + * cofflink.c (mark_relocs): Add new function to mark symbols which + are used by relocations. + (_bfd_coff_link_input_bfd): Add call to mark_relocs() and code to + suppress the skipping of symbols that have thus been marked. + +Tue May 20 18:45:26 1997 Ian Lance Taylor + + * coff-sh.c (sh_merge_private_data): New static function. + (coff_bfd_merge_private_bfd_data): Define. + +Mon May 19 14:46:00 1997 Mark Alexander + + * coff-tic80.c: Remove unnecessary #ifdefs. + * config.bfd: Set targ_underscore to yes for tic80. + +Mon May 19 14:26:36 1997 Mark Alexander + + * coff-tic80.c (NAMES_HAVE_UNDERSCORE): Define (fixes problem + with unresolved external symbols in GDB). + +Fri May 16 10:23:03 1997 Jeffrey A Law (law@cygnus.com) + + * elf-m10300.c (elf32_mn10300_relax_section): Read in all + the symbols associated with each BFD. + (mn10300_elf_relax_delete_bytes): Don't adjust the same symbol + more than once. + * elf-m10200.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-sh.c: Likewise. + +Fri May 16 12:10:52 1997 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Don't decrease the + alignment of a common symbol. If two symbols that look like + common symbols are found in two shared libraries, and the size is + different, use the larger size, and warn if --warn-common. If a + common symbol overrides a definition in a shared library, set the + size to the larger size, and warn if --warn-common. + +Thu May 15 14:31:28 1997 Nick Clifton + + * cpu-arm.c (compatible): Allow default machine to be polymorphed + into any other machine type. + + * coffcode.h (coff_set_flags): Initialise flags variable to 0. + + * coff-arm.c (coff_arm_bfd_merge_private_bfd_data): When merging + data into an unitialised destination set its machine type as well. + +Thu May 15 16:40:20 1997 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Force ELF symbol size + to common symbol size. Consistently treat uninitialized symbols + in shared objects as common symbols. + +Fri May 9 10:15:27 1997 Nick Clifton + + * archures.c (constants): Added new constants to identify the + type of the ARM architecture: bfd_mach_arm_2, bfd_mach_arm_2a, + bfd_mach_arm_3, bfd_mach_arm_3M, bfd_mach_arm_4 and bfd_mach_arm_4T. + + * bfd-in2.h (constants): Added new constants to identify + the type of the ARM architecture: bfd_mach_arm_2, bfd_mach_arm_2a, + bfd_mach_arm_3, bfd_mach_arm_3M, bfd_mach_arm_4 and + bfd_mach_arm_4T. This file is auto-magically generated from the + archures.c file. This update is just to save work. + + * coff-arm.c (coff_arm_bfd_merge_private_bfd_data, + coff_arm_bfd_print_private_bfd_data, + coff_arm_bfd_set_private_flags, + coff_arm_bfd_copy_private_bfd_data): Added these new functions. + (global): Macro redefinitions set up to use these new functions. + + * coffcode.h (coff_mkobject_hook): Added call to + coff_arm_bfd_set_private_flags(). + (coff_set_arch_mach_hook): Added code to set machine type based on + bits stored in internal flags. + (coff_set_flags): Added code to set the new bits in the flags + field based on the machine number. + (function definition macros): Made all function definition macros + conditional so that they can be overridden by target specific + files. + + * cpu-arm.c (compatible): Added this function. (arch_info_struct): + Structure extended to include new types, one each for ARMv2, + ARMv2a, ARMv3, ARMv3M, ARMv4 and ARMv4T. + + * libcoff-in.h (struct coff_tdata): Added flags field. + +Fri May 9 17:40:02 1997 Ian Lance Taylor + + * config.bfd (i[3456]86-*-gnu*): Don't include Mach support. + + * config.bfd: Change #if 0 around uses of host_aout_vec to #if + HAVE_host_aout_vec. + +Mon May 5 13:57:32 1997 Mike Meissner + + * coffgen.c (coff_find_nearest_line): If there are no syments, + just return false. + +Mon May 5 18:18:45 1997 Philip Blundell + + * config.bfd: cope with '*-*-linux-gnuaout' targets. + +Thu May 1 11:31:12 1997 Ian Lance Taylor + + * targmatch.sed: Add explicit \n characters to work around bug in + HP/UX 10.20 sed program. + +Wed Apr 30 12:27:03 1997 Ian Lance Taylor + + * elf.c (copy_private_bfd_data): Cast csecs to avoid sign + extension problems. + +Tue Apr 22 12:06:08 1997 Ian Lance Taylor + + * Makefile.in (do_maintainer_clean): Don't remove bfd-in2.h. + +Mon Apr 21 11:21:31 1997 Andreas Schwab + + * elf32-m68k.c: Follow the last changes in elf32-i386.c: + (struct elf_m68k_pcrel_relocs_copied, struct + elf_m68k_link_hash_entry, struct elf_m68k_link_hash_table, + elf_m68k_link_hash_traverse, elf_m68k_hash_table, + elf_m68k_link_hash_newfunc, elf_m68k_link_hash_table_create, + elf_m68k_discard_copies, bfd_elf32_bfd_link_hash_table_create): + New definitions. + (elf_m68k_check_relocs): If linking with -Bsymbolic, don't copy + PC relative relocs for a global symbol defined in a regular + object, and count the number of PC relative relocs copied for any + global symbol. + (elf_m68k_size_dynamic_sections): If linking with -Bsymbolic, + traverse with elf_m68k_discard_copies. + +Sat Apr 19 22:50:14 1997 Ian Lance Taylor + + * elf32-i386.c (elf_i386_check_relocs): Only count PC relative + relocs. From Jamie Lokier . + + * coffcode.h (coff_compute_section_file_positions): Force the + potential last byte in the file to be written out when + COFF_IMAGE_WITH_PE. + +Thu Apr 17 13:46:56 1997 Per Fogelstrom + + * configure.host (mips*-*-openbsd*): New host. + +Thu Apr 17 11:10:54 1997 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Only subtract the + section VMA from the symbol value if this is a fully linked file. + + * elf32-i386.c (struct elf_i386_pcrel_relocs_copied): Define. + (struct elf_i386_link_hash_entry): Define. + (struct elf_i386_link_hash_table): Define. + (elf_i386_link_hash_traverse): Define. + (elf_i386_hash_table): Define. + (elf_i386_link_hash_newfunc): New static function. + (elf_i386_link_hash_table_create): New static function. + (elf_i386_check_relocs): If linking with -Bsymbolic, don't copy + PC relative relocs for a global symbol defined in a regular + object, and count the number of PC relative relocs copied for any + global symbol. + (elf_i386_size_dynamic_sections): If linking with -Bsymbolic, + traverse with elf_i386_discard_copies. + (elf_i386_discard_copies): New static function. + (bfd_elf32_bfd_link_hash_table_create): Define. + + From Gordon W. Ross : + * aoutf1.h (MY_entry_is_text_address): Define if not defined. + (sunos4_aout_backend): Use MY_entry_is_text_address. + +Wed Apr 16 12:43:32 1997 Martin Hunt + + * elf32-d30v.c (elf_d30v_howto_table): Changed size of + R_D30V_32_NORMAL to 2 (4 bytes). + +Wed Apr 16 14:02:29 1997 Ian Lance Taylor + + From Gordon W. Ross : + * netbsd.h (N_SHARED_LIB): Define. + (SEGMENT_SIZE): Don't define. + * m68knetbsd.c (SEGMENT_SIZE): Don't define (revert change of + April 11). + * sparcnetbsd.c (TARGET_PAGE_SIZE): Define as 0x2000. + (SEGMENT_SIZE): Don't define. + + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Set .rela.bss size + to sizeof Rela structure, not sizeof Rel structure. From Gary + Thomas . + +Tue Apr 15 11:50:37 1997 Ian Lance Taylor + + * aout-target.h (MY(callback)): If entry_is_text_address, adjust + whenever entry is larger than text address, but only by whole + pages. From Gordon W. Ross . + + * Makefile.in (install): Depend upon installdirs. Use + mkinstalldirs to build $(oldincludedir). + (installdirs): New target. + + * elflink.h (elf_link_add_object_symbols): Don't call check_relocs + if this is a debugging section which we are stripping. + +Mon Apr 14 12:39:30 1997 Richard Henderson + + * elf64-alpha.c (elf64_alpha_object_p): Allocate the + alpha-specific target data struct. + +Mon Apr 14 11:45:46 1997 Ian Lance Taylor + + From Thomas Graichen : + * Makefile.in: Always use $(SHELL) when running move-if-change. + * configure.in: Use ${CONFIG_SHELL} when running $ac_config_sub. + * configure: Rebuild. + +Fri Apr 11 15:43:24 1997 Ian Lance Taylor + + * elfcode.h (elf_slurp_symbol_table): Only subtract the section + VMA if this is an executable file or a shared object. + + * targets.c (netbsd_core_vec): Declare. From Gordon W. Ross + . + + * libaout.h (struct aout_backend_data): Add entry_is_text_address + field. + * aout-target.h (SEGMENT_SIZE): Define to TARGET_PAGE_SIZE at the + start of the file. Remove uses later on which switch using + ifdef. + (MY(callback)): Handle entry_is_text_address. + (MY_entry_is_text_address): Define if not defined. + (MY(backend_data)): Initialize new field. + * aoutf1.h (sunos4_aout_backend): Likewise. + * i386aout.c (MY(backend_data)): Likewise. + * i386mach3.c (MY(backend_data)): Likewise. + * mipsbsd.c (MY(backend_data)): Likewise. + * sparclynx.c (sparclynx_aout_backend): Likewise. + * netbsd.h (SEGMENT_SIZE): Define if not defined. + (MY_entry_is_text_address): Define. + * m68knetbsd.c (SEGMENT_SIZE): Define as 0x20000. + + * xcofflink.c (bfd_xcoff_import_symbol): Handle importing a symbol + whose name starts with `.'. + +Fri Apr 11 11:57:15 1997 Niklas Hallqvist + + * config.bfd: (i[3456]86-*-openbsd*, m68*-*-openbsd*, + mips*el*-*-openbsd*, mips*-*-openbsd*, ns32k-*-openbsd*, + powerpc-*-*bsd*, sparc-*-openbsd*): New targets. + * configure.in (i[3456]86-*-openbsd*, mips*-*-openbsd*, + m68*-*-openbsd*, ns32k-*-openbsd*, powerpc-*-*bsd*, + sparc-*-openbsd*): New targets. + * configure: Rebuild. + +Tue Apr 8 18:09:29 1997 Jamie Lokier + + * stabs.c (struct stab_section_info): New field + `cumulative_skips'. + (_bfd_link_section_stabs): Fill the above array. + (_bfd_stab_section_offset): Use `cumulative_skips' to + speed up offset calculation. + +Tue Apr 8 00:01:31 1997 Jeffrey A Law (law@cygnus.com) + + * elf-mn10300.c (mn10300_elf_relax_section): Don't forget the + addend for non pc-relative relocations. + + * elf-m10300.c (bfd_elf32_mn10300_reloc): Remove prototype + for non-existent function. + + * elf-m10300.c (mn10300_elf_relax_section): New function. + (mn10300_elf_relax_delete_bytes): Likewise. + (mn10300_elf_symbol_address_p): Likewise. + (mn10300_elf_get_relocated_section_contents): Likewise. + (bfd_elf32_bfd_relax_section): Define. + (bfd_elf32_bfd_get_relocated_section_contents): Likewise. + +Mon Apr 7 16:47:09 1997 Ian Lance Taylor + + * configure.host: Set SHLIB_LIBS. + * configure.in: Substitute SHLIB_LIBS. + * configure: Rebuild. + * Makefile.in (SHLIB_LIBS): New variable. + ($(SHLIB)): Use $(SHLIB_LIBS). + +Mon Apr 7 10:53:52 1997 Michael Snyder + + * bfd-in.h bfd-in2.h: add bfd_section_lma macro to correspond + with bfd_section_vma. + +Fri Apr 4 11:37:15 1997 Ian Lance Taylor + + * configure.in: Update file names for bfd_elf32_mn10[23]00_vec. + Correct CPU file names for mn10[23]00. + * configure: Rebuild. + + * bfd.c (bfd_record_phdr): Cast count to size_t before + subtraction. + + * coff-ppc.c (dump_toc): Add cast to avoid warning from SunOS cc. + * coff-rs6000.c (xcoff_read_ar_hdr): Likewise. + (xcoff_write_archive_contents): LIkewise. + * elf32-mips.c (_bfd_mips_elf_set_section_contents): Likewise. + (mips_elf_create_procedure_table): Likewise. + * peicode.h (pe_print_idata): Likewise. + (pe_print_edata, pe_print_pdata, pe_print_reloc): Likewise. + * xcofflink.c (xcoff_get_section_contents): Likewise. + (_bfd_xcoff_canonicalize_dynamic_symtab): Likewise. + (xcoff_link_add_symbols): Likewise. + (xcoff_link_add_symbols): Likewise. + + * ppcboot.c (ppcboot_set_arch_mach): Make static. + (ppcboot_bfd_print_private_bfd_data): Likewise. + + * elf32-mips.c (elf_mips_ctor64_howto): Set complain_on_overflow + to complain_overflow_signed. + +Thu Apr 3 11:51:54 1997 Ian Lance Taylor + + * VERSION: Set to 2.8.1. + + * Branched binutils 2.8. + + * elf32-ppc.c (ppc_elf_check_relocs): Don't check SEC_ALLOC when + deciding whether to copy a reloc into a shared object. + (ppc_elf_relocate_section): Likewise. Relocate R_PPC_RELATIVE + relocs in unallocated sections. + * elf32-sparc.c (elf32_sparc_relocate_section): Relocate + R_SPARC_RELATIVE relocs in unallocated sections. + +Wed Apr 2 16:19:41 1997 Mike Meissner + + * elf32-ppc.c (ppc_elf_check_relocs): Undo March 26 change and + always create got section so that the _GLOBAL_OFFSET_TABLE_ label + is always created. + +Wed Apr 2 10:49:07 1997 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Let a common symbol + override an uninitialized symbol from a shared library with a + smaller size. + + * elf-m10200.c: Rename from elf32-mn10200.c. + * elf-m10300.c: Rename from elf32-mn10300.c. + * cpu-m10200.c: Rename from cpu-mn10200.c + * cpu-m10300.c: Rename from cpu-mn10300.c + * Makefile.in: Update accordingly. + + * elf32-mips.c (elf_mips_ctor64_howto): New static variable. + (elf_mips_isa): Move to earlier in file. + (mips_reloc_map): Remove BFD_RELOC_CTOR entry. + (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_CTOR + specially. + + * elf32-mips.c (mips16_jump_reloc): Print a warning rather than + calling abort. + +Tue Apr 1 16:18:05 1997 Klaus Kaempf + + * configure.com: New file. + * config.h-vms: Remove file. + * makefile.vms: Update for new configure scheme. + +Mon Mar 31 23:28:39 1997 H.J. Lu + + * libcoff-in.h (ppc_allocate_toc_section): Declare. + (ppc_process_before_allocation): Declare. + * libcoff.h: Rebuild. + + * coffcode.h (coff_mkobject_hook): Declare if not a macro. + +Mon Mar 31 16:29:50 1997 Joel Sherrill + + * config.bfd (hppa*-*-rtems*): New target, like hppa-*-*elf*. + +Mon Mar 31 16:11:35 1997 Ian Lance Taylor + + * coff-a29k.c (coff_a29k_relocate_section): Don't use symndx as a + symbol index for a R_IHCONST reloc. + +Mon Mar 31 15:40:59 1997 Philippe De Muyter + + * targmatch.sed: Do not use \(\) recursively. + +Fri Mar 28 14:44:08 1997 H.J. Lu + + * m68klinux.c (MACHTYPE_OK): Define. + * i386linux.c (MACHTYPE_OK): Define. + +Fri Mar 28 11:56:15 1997 Ian Lance Taylor + + From David S. Miller and H.J. Lu + : + * sparclinux.c: New file. + * bfd-in.h (bfd_sparclinux_size_dynamic_sections): Declare. + * bfd-in2.h: Rebuild. + * config.bfd (sparc-*-linuxaout*, sparc-*-linux*): New targets. + * configure.in (sparclinux_vec): Add to list of vectors. + * configure: Rebuild. + * targets.c (sparclinux_vec): Declare. + (bfd_target_vector): Add sparclinux_vec. + * Makefile.in: Rebuild dependencies. + (BFD32_BACKENDS): Add sparclinux.o. + (BFD32_BACKENDS_CFILES): Add sparclinux.c. + + * coff-mips.c (mips_ecoff_backend_data): Initialize new + bfd_coff_backend_data field. + * coff-alpha.c (alpha_ecoff_backend_data): Likewise. + + * config.bfd: Add bfd_elf64_{big,little}mips_vec to targ_selvecs + for mips*el*-*-linux* and mips*-*-linux*. From H.J. Lu + and Ralf Baechle . + + * bfd.c: Include "libiberty.h". + (strerror): Don't declare. + (bfd_errmsg): Call xstrerror rather than strerror. + +Thu Mar 27 12:55:42 1997 Ian Lance Taylor + + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Generate a COPY + reloc even if the symbol is in the .bss section. + * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise. + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise. + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise. + + * coffcode.h (bfd_coff_backend_data): Add new field + _bfd_coff_default_section_alignment_power. + (bfd_coff_default_section_alignment_power): Define. + (bfd_coff_std_swap_table): Initialize new field. + * libcoff.h: Rebuild. + * cofflink.c (coff_link_add_symbols): Limit alignment of a common + symbol to the default section alignment. + + * COPYING: Update FSF address. + +Thu Mar 27 00:45:57 1997 Martin M. Hunt + + * elf32-d30v.c (elf_d30v_howto_table): Fix a typo in the + 21-bit absolute that made it act as a relative. + +Wed Mar 26 14:50:20 1997 Ian Lance Taylor + + * elflink.c (_bfd_elf_create_linker_section): Don't set + bss_section and rel_section from existing sections. + + * elf32-ppc.c (ppc_elf_check_relocs): Only create the got section + if it is needed. + +Tue Mar 25 22:26:56 1997 Stu Grossman (grossman@critters.cygnus.com) + + * aoutx.h (some_aout_object_p): Change executable test to fix + problems with embedded a.out systems. + +Tue Mar 25 14:35:37 1997 Ian Lance Taylor + + * stabs.c (_bfd_stab_section_offset): New function. + * libbfd-in.h (_bfd_stab_section_offset): Declare. + * libbfd.h: Rebuild. + * elf32-i386.c (elf_i386_relocate_section): Adjust the offset of a + stab reloc. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mips.c (mips_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + + * stabs.c (_bfd_link_section_stabs): Copy over the first header + symbol. Check for memory allocation failure of *psinfo. + (_bfd_write_section_stabs): Add psinfo parameter. Change all + callers. Set the value of the header symbol. + * libbfd-in.h (_bfd_write_section_stabs): Update declaration. + * libbfd.h: Rebuild. + +Mon Mar 24 20:07:29 1997 Fred Fish + + * coff-tic80.c (tic80_howto_table): Add R_ABS entry. + (rtype2howto): Handle R_ABS reloc type. Also abort on unhandled + reloc types, rather than silently failing to generate an output file. + +Mon Mar 24 13:41:00 1997 Ian Lance Taylor + + * targmatch.sed: Use the hold space to put the #ifdef around the + the string constant. + * targets.c (UNSUPPORTED_TARGET): Don't define. + (find_target): Don't check for UNSUPPORTED_TARGET. + (bfd_set_default_target): Don't try to optimize by checking for + default. + + * Makefile.in: Rebuild dependencies. + (ALL_MACHINES_CFILES): Add cpu-m32r.c. + (BFD32_BACKENDS_CFILES): Add elf32-m32r.c. + (elf32-m32r.o): Remove explicit target. + + * config.bfd: Don't set targ_underscore for i[3456]86-*-gnu* or + i[3456]86-*-linux*. + + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Don't + count section symbols for sections that were created by the + linker, or are not allocatable or not loadable. + (elf32_sparc_finish_dynamic_sections): Output output section + symbols for section for which we made space for them. + +Fri Mar 21 13:08:26 1997 Ian Lance Taylor + + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): If there is + no .rela.plt section, don't output a DT_PLTGOT dynamic entry. + +Fri Mar 21 12:36:46 1997 Doug Evans + + * elf32-m32r.c (m32r_elf_howto_table): Use special function for LO16. + (m32r_hi16_list): New static local. + (m32r_elf_hi16_reloc): Don't perform reloc, just queue it up. + (m32r_elf_do_hi16_reloc): Delete. + (m32r_elf_relocate_hi16): New function. + (m32r_elf_lo16_reloc): New function. + (m32r_elf_relocate_section): For HI16 relocs, scan for corresponding + LO16 reloc. + + Mon Mar 10 16:03:31 1997 Doug Evans + + * elf32-m32r.c (m32r_elf_create_linker_section): Delete. + (m32r_elf_add_symbol_hook): Rewrite _SDA_BASE_ support. + (m32r_elf_final_sda_base): New function. + (m32r_elf_relocate_section): Rewrite sdata support. + (m32r_elf_finish_dynamic_sections): Delete. + +Thu Mar 20 12:39:02 1997 Ian Lance Taylor + + Based on patches from Philippe De Muyter . + * coff-svm68k.c: New file. Just defines some macros and includes + coff-m68k.c. + * coff-m68k.c: Add functions to handle common addends, moved in + from cf-m68klynx.c. Control them using COFF_COMMON_ADDEND macro. + Control whether relocs are visible using STATIC_RELOCS. + * cf-m68klynx.c: Simplify greatly: just define macros to control + coff-m68k.c. + * coff-aux.c: Likewise. Just leave add_one_symbol routine. + * targets.c (m68ksysvcoff_vec): Declare. + (bfd_target_vector): Add m68ksysvcoff_vec. + * config.bfd (m68*-motorola-sysv*): New target. + * configure.in (m68ksysvcoff_vec): New vector. + * configure: Rebuild. + * Makefile.in: Rebuild dependencies. + (BFD32_BACKENDS): Add coff-svm68k.o. + (BFD32_BACKENDS_CFILES): Add coff-svm68k.c. + + * binary.c (binary_set_section_contents): Don't get misled if the + first section is not loadable. From Matthew L. Martin + . + + * elflink.h (elf_bfd_final_link): Set the value of a section + symbol to the section address unless doing a relocateable link. + +Tue Mar 18 23:03:17 1997 Richard Henderson + + * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't create + .plt entry if we've taken the function's address. + (elf64_alpha_merge_gots): Merge collected flags info as well. + +Tue Mar 18 22:40:09 1997 H.J. Lu + + * Many files: Add function prototypes. + * cpu-m68k.c (bfd_default_scan_num_mach): Don't declare. + * ecofflink.c: Include "libcoff.h" and "libecoff.h". + * elf32-ppc.c (ppc_elf_fake_sections): Make static. + * opncls.c (bfd_openstreamr): Change stream parameter to PTR. + * peicode.h: Change several void * parameters to PTR. + * srec.c (srec_get_symbol_info): Make static. + * syms.c (bfd_symbol_is_absolute): Remove. + * Makefile.in: Rebuild dependencies. + +Tue Mar 18 12:58:08 1997 Ian Lance Taylor + + * elf32-m32r.c (m32r_elf_is_local_label_name): Remove. + (bfd_elf32_bfd_is_local_label): Don't define. + + * xcofflink.c (_bfd_xcoff_bfd_final_link): Call bfd_malloc rather + than malloc. + +Mon Mar 17 11:32:53 1997 Ian Lance Taylor + + * bfd-in.h: Don't include obstack.h. + (struct bfd_hash_table): Change memory field to PTR. + * bfd.c (struct _bfd): Change memory field to PTR. + * bfd-in2.h: Rebuild. + * libbfd-in.h (bfd_release): Declare as function, don't define as + macro. + * libbfd.h: Rebuild. + * opncls.c: Include "objalloc.h" rather than "obstack.h". Use + objalloc routines rather than obstack routines. + (obstack_chunk_alloc, obstack_chunk_free): Don't define. + (getpagesize): Don't define. + (_bfd_new_bfd): Don't set _bfd_chunksize. + (bfd_openr): Free new bfd and objalloc on failure. + (bfd_fdopenr, bfd_openstreamr, bfd_openw): Likewise. + (bfd_alloc_size): Remove. + (bfd_release): New function. + * hash.c: Include "objalloc.h" rather than "obstack.h". Use + objalloc routines rather than obstack routines. + (obstack_chunk_alloc, obstack_chunk_free): Don't define. + * ecofflink.c: Include "objalloc.h" rather than "obstack.h". Use + objalloc routines rather than obstack routines. + (obstack_chunk_alloc, obstack_chunk_free): Don't define. + (struct accumulate): Change memory to struct objalloc *. + * liboasys.h (oasys_data_type): Remove oasys_obstack field. + * dep-in.sed: Don't remove obstack.h from dependency list. + * Makefile.in: Rebuild dependencies. + (BFD_H_DEPS): Remove obstack.h. + (install): Don't install obstack.h. + * Many files: Don't include "obstack.h". + * VERSION: Bump. + + * opncls.c (bfd_alloc_grow, bfd_alloc_finish): Remove. + * libbfd-in.h (bfd_alloc_grow, bfd_alloc_finish): Don't declare. + * libbfd.h: Rebuild. + * ieee.c (ieee_archive_p): Rewrite to not use bfd_alloc_grow. + * sunos.c (sunos_add_dynamic_symbols): Likewise. + * srec.c (srec_scan): Rewrite to not use obstack_1grow. + + * opncls.c (bfd_alloc): Rename from bfd_alloc_by_size_t. Remove + old version of bfd_alloc. + * libbfd-in.h (bfd_alloc_by_size_t): Don't declare. + * libbfd.h: Rebuild. + * Several files: Call bfd_alloc rather than bfd_alloc_by_size_t. + +Sat Mar 15 15:24:18 1997 Ian Lance Taylor + + * elf32-mips.c (mips_elf_is_local_label_name): Accept the generic + ELF local label syntax as well. + +Sat Mar 15 10:16:42 1997 Fred Fish + + * config.bfd (powerpc-*-beos*): New target. + * configure.in (powerpc-*-beos*): Add case that explicitly + does not set COREFILE for now. A future BeOS version is + expected to support core files. + * configure: Regenerate with autoconf. + +Fri Mar 14 16:43:22 1997 Ian Lance Taylor + + * elf32-mips.c (mips_elf_check_relocs): Give an error if CALL16 is + seen with a local symbol, rather than crashing. + + * elfcode.h (elf_slurp_symbol_table): Don't try to read the + version symbols if there aren't any. + +Thu Mar 13 16:38:30 1997 Fred Fish + + * coff-tic80.c (coff_rtype_to_howto): Define + (coff_tic80_rtype_to_howto): Clone generic coff version and + add code to handle the funky TI "internal relocations". + +Thu Mar 13 14:08:53 1997 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Don't warn about type + or size changes because of a weak symbol. + + * cisco-core.c (SIGEMT): Define if not defined. + +Wed Mar 12 21:36:05 1997 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Use extsymoff when + setting ever. Sanity check the version number. Sort out copying + flags and other information when adding an indirect symbol. + (NAME(bfd_elf,size_dynamic_sections)): Preserve any dynamic + symbols added by the backend. Clear the entire contents of the + versym section. + (elf_export_symbol): Ignore indirect symbols. + (elf_link_output_extsym): Accept a section without an owner in an + assert. + * elfcode.h (elf_slurp_symbol_table): Add a sanity check on the + version count. Correct the allocation of x_versymp. + + * elf32-mips.c (mips_elf_add_symbol_hook): Don't set the owner of + the magic sections used for SHN_MIPS_TEXT and SHN_MIPS_DATA. + Don't return bfd_und_section_ptr when info->shared. + (mips_elf_final_link): Set the alignment of .rtproc to 4, not 12. + (mips_elf_create_dynamic_sections): Correct type: ^= for &=. + (mips_elf_check_relocs): Resolve an indirect symbol in + sym_hashes. + (mips_elf_finish_dynamic_symbol): Don't change SHN_ABS into + SHN_MIPS_TEXT or SHN_MIPS_DATA. + + * elf.c (bfd_elf_print_symbol): Tweak version output slightly. + +Tue Mar 11 01:38:36 1997 Ian Lance Taylor + + From Eric Youngdale : + * elf-bfd.h (ELF_LINK_FORCED_LOCAL): Define. + * elf.c (bfd_elf_print_symbol): Correct errors in last change. + * elflink.h (elf_link_add_object_symbols): Handle cases in which a + versioned symbol appears in both a regular and a shared object. + (elf_link_assign_sym_version): Set ELF_LINK_FORCED_LOCAL when + appropriate. Improve error message. + (struct elf_outext_info): Rename from elf_finfo_failed. Change + all uses. Add localsyms field. + (elf_bfd_final_link): When generating a shared library, call + elf_link_output_extsym to output all local symbols. + (elf_link_output_extsym): Handle symbols which were forced to + become local. + +Sun Mar 9 23:08:49 1997 Ian Lance Taylor + + From Eric Youngdale : + * elf-bfd.h (elf_symbol_type): Add version field. + * elfcode.h (elf_slurp_symbol_table): Set version field. + * elflink.h (elf_link_add_object_symbols): When creating an + indirect symbol for a default version symbol, set DEF_DYNAMIC if + appropriate. Set up an indirection from the nondefault version of + the symbol as well. + (NAME(bfd_elf,size_dynamic_sections)): Call + elf_link_assign_sym_version before checking whether there are any + versions. Always record the version name as a dynamic symbol. + Initialize counters. + (elf_link_assign_sym_version): After finding a version, see if a + symbol should be forced to local scope. Create a new version + definition if appropriate. + (elf_link_output_extsym): Correct indirect symbol handling. + * elf.c (bfd_elf_print_symbol): Print version information. + (bfd_section_from_shdr): Turn version sections into BFD sections. + (elf_fake_sections): Only copy cverdefs and cverrefs into sh_info + if sh_info is not already set. + (_bfd_elf_copy_private_section_data): Copy sh_info for version + sections. + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Tell + _bfd_stringtab_add to copy the name into permanent memory if + appropriate. + +Fri Mar 7 11:55:31 1997 H.J. Lu + + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Fully parenthesize. + +Fri Mar 7 10:37:30 1997 Ian Lance Taylor + + * coffcode.h (bfd_coff_backend_data): Change + _bfd_coff_compute_section_file_positions to return a boolean + value. Change all callers. + (coff_compute_section_file_positions): Change return type to + boolean. If the size of the last section changed, then output a + zero byte at the end of the file. + * libcoff.h: Rebuild. + + * xcofflink.c (_bfd_xcoff_bfd_final_link): Always allocate space + for at least 6 output symbols. + (xcoff_write_global_symbol): When emitting TOC entry relocs, also + emit a TC csect to represent the space they take up. For an XO + symbol, just emit a reference, not a csect. + + * Makefile.in ($(SHLINK)): Just use ln -s, not ln -sf, since + Solaris doesn't like the combined options, and the -f is + unnecessary. + (stamp-tshlink, install): Likewise. + + * elf32-mips.c (mips_elf_relocate_section): Correct R_MIPS16_26 + handling when little endian. + +Thu Mar 6 13:51:51 1997 Jeffrey A Law (law@cygnus.com) + + * elf32-mn10300.c (mn10300_elf_final_link_relocate): New function. + (mn10300_elf_relocate_section): Likewise. + (elf_backend_relocate_section): Define. + + * elf32-mn10300.c (reloc_type): Remove PCREL{8,16,32}_{1,2}BYTE + relocs. Replace them with generic PCREL_{8,16,32} relocs. + (elf32_mn10300_howto_table): Likewise. + (elf32_mn10300_reloc_map): Likewise. + (bfd_elf32_mn10300_reloc): Delete unused function. + +Thu Mar 6 12:19:59 1997 Fred Fish + + * coff-tic80.c (rtype2howto): If passed a relocation type we don't + understand, just set the howto field to NULL, and the caller will + print an appropriate error message. + * coffcode.h (coff_slurp_reloc_table): Pull duplicate declarations and + code fragment out of both legs of #ifdef RELOC_PROCESSING ... #endif + block. Use NULL for initializations of "ptr" rather than bare 0. + * coff-h8300.c: Fix typo in comment. + * coff-h8500.c: Ditto. + * coff-w65.c: Ditto + * coff-z8k.c: Ditto. + +Wed Mar 5 13:59:09 1997 Doug Evans + + * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc): Fix overflow calc. + (m32r_elf_relax_section, m32r_elf_relax_delete_bytes, + m32r_elf_get_relocated_section_contents): First pass at relax support. + +Mon Mar 3 13:27:09 1997 Ulrich Drepper + + * elflink.h (elf_link_add_object_symbols): Use correct sh_size + entry for reading verdef records. + Use correct braces for computing increments of extverdaux and + exteverdef record pointers. + +Sun Mar 2 22:47:54 1997 Fred Fish + + * coff-tic80.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): Set this to 2 + instead of 4. + +Sun Mar 2 16:25:35 1997 Ian Lance Taylor + + * elflink.h (elf_link_find_version_dependencies): Check that + DEF_REGULAR is not set as well as checking that DEF_DYNAMIC is + set. + +Fri Feb 28 16:52:40 1997 Fred Fish + + * coffcode.h (coff_set_flags): Add case for TIC80_ARCH_MAGIC. + +Fri Feb 28 15:06:45 1997 Ian Lance Taylor + + * targets.c (bfd_default_vector): Make non-const. + (find_target): New static function, broken out of + bfd_find_target. + (bfd_set_default_target): New function. + (bfd_find_target): Call find_target. When defaulting, use + bfd_default_vector[0] if it is not NULL. + * libbfd-in.h (bfd_default_vector): Adjust declaration. + * bfd-in2.h, libbfd.h: Rebuild. + + * syms.c (bfd_is_local_label): Return false if the symbol has no + name. + * coff-i960.c (coff_i960_is_local_label_name): New function. + (coff_bfd_is_local_label_name): Define. + * coff-m68k.c (m68k_coff_is_local_label_name): New function. + (coff_bfd_is_local_label_name): Define. + * coff-rs6000.c (xcoff_is_local_label_name): New function. + (coff_bfd_is_local_label_name): Define. + * elf.c (_bfd_elf_is_local_label_name): Treat symbols beginning + with .. or _.L_ as local. + * elf32-i386.c (elf_i386_is_local_label_name): New function. + (bfd_elf32_bfd_is_local_label_name): Define. + * evax-alpha.c (evax_bfd_is_local_label_name): Treat symbols + beginning with $ as local. + +Thu Feb 27 18:36:23 1997 Ian Lance Taylor + + * aoutx.h (aout_link_write_symbols): Use bfd_is_local_label_name + rather than comparing against info->lprefix. + * cofflink.c (_bfd_coff_link_input_bfd): Likewise. + * elflink.h (elf_link_input_bfd): Likewise. + * linker.c (_bfd_generic_link_output_symbols): Likewise. + * xcofflink.c (xcoff_link_input_bfd): Likewise. + + * elfxx-target.h (bfd_elfNN_bfd_is_local_label_name): Define as + _bfd_elf_is_local_label_name if not already defined. + * elf.c (_bfd_elf_is_local_label_name): New function. + * elf-bfd.h (_bfd_elf_is_local_label_name): Declare. + + * coff-m88k.c (coff_bfd_is_local_label_name): Define. + (m88k_is_local_label_name): New static function. + + * coffcode.h (coff_bfd_is_local_label_name): Define as + _bfd_coff_is_local_label_name if not already defined. + * coffgen.c (_bfd_coff_is_local_label_name): New function. + * libcoff-in.h (_bfd_coff_is_local_label_name): Declare. + * libcoff.h: Rebuild. + + * targets.c (BFD_JUMP_TABLE_SYMBOLS): Change _bfd_is_local_label + to _bfd_is_local_label_name. + (bfd_target): Likewise. + * syms.c (bfd_is_local_label): Define as function, not macro. + (bfd_is_local_name): Define. + * libbfd.c (bfd_generic_is_local_label_name): Rename from + bfd_generic_is_local_label, and take a string rather than a + symbol. + * libbfd-in.h (_bfd_nosymbols_bfd_is_local_label): Don't define. + (_bfd_nosymbols_bfd_is_local_label_name): Define. + (bfd_generic_is_local_label): Don't declare. + (bfd_generic_is_local_label_name): Declare. + * bfd-in2.h, libbfd.h: Rebuild. + * All backends: Change local_label to local_label_name. + + * elf32-mips.c (struct mips_got_info): Add assigned_gotno field. + (mips_elf_relocate_got_local): Change return type to boolean. + Don't assume that the first zero entry is unassigned; instead, use + assigned_gotno. + (mips_elf_relocate_section): Check return value of + mips_elf_relocate_got_local. + (mips_elf_create_got_section): Initialize assigned_gotno field. + +Wed Feb 26 15:19:51 1997 Martin M. Hunt + + * elf32-d30v.c (bfd_elf_d30v_reloc): Add code to do 32-bit + relocations. + +Wed Feb 26 13:33:03 1997 Ian Lance Taylor + + * elflink.h (elf_link_input_bfd): Don't skip symbols from sections + that have no contents merely because linker_mark is not set. + +Tue Feb 25 18:51:35 1997 Stan Shebs + + * config.bfd (mips*-*-lnews*): New target. + * coff-mips.c (mips_relocate_section): Make assert compare + content byteorder instead of header byteorder. + (ecoff_biglittle_vec): New BFD, big-endian headers, little-endian + data. + * targets.c (bfd_target_vector): Add ecoff_biglittle_vec. + * configure.in (ecoff_biglittle_vec): Add case. + * configure: Update. + +Tue Feb 25 00:32:49 1997 Ian Lance Taylor + + * elf.c (elf_fake_sections): Use SHT_NOTE for any section whose + name begins with ".note". + (map_sections_to_segments): Add a PT_NOTE segment for any loadable + section whose name begins with ".note". + (get_program_header_size): Corresponding change. + + * elf32-mips.c (mips_elf_relocate_section): Check for misaligned + jal and for jal overflow. + +Mon Feb 24 17:53:14 1997 Ian Lance Taylor + + From Eric Youngdale : + * elflink.h (elf_link_add_archive_symbols): If a default symbol is + not found, try looking it up again without the version name. + (elf_link_add_object_symbols): Always link against the dynamic + symbol table of a dynamic object. When linking against a dynamic + object, include version strings in symbol names, and set up + version information. Add indirect symbols for default versions. + (elf_link_create_dynamic_sections): Add special version sections. + (struct elf_assign_sym_version_info): Define. + (struct elf_find_verdep_info): Define. + (NAME(bfd_elf,size_dynamic_sections)): Add verdefs parameter. Set + up version sections. + (elf_adjust_dynamic_symbol): Ignore indirect symbols. + (elf_link_find_version_dependencies): New static function. + (elf_link_assign_sym_version): New static function. + (elf_link_renumber_dynsyms): New static function. + (struct elf_final_link_info): Add symver_sec field. + (elf_bfd_final_link): Initialize finfo.symver_sec. Don't count + local symbols of a dynamic object. Handle DT_VER* constants. + (elf_link_output_extsym): Simplify BFD_ASSERT checking for a + dynamic object. Skip indirect symbols from ELF objects. Remove + the version name before choosing a hash bucket. Write out the + version information if appropriate. + (elf_link_input_bfd): Check for DYNAMIC, not ET_DYN. + * bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration. + (bfd_elf64_size_dynamic_sections): Likewise. + * bfd-in2.h: Rebuild. + * elf-bfd.h (struct elf_link_hash_entry): Add verinfo field. + Change elf_link_hash_flags to unsigned short. + (ELF_LINK_HIDDEN): Define. + (struct elf_obj_tdata): Add fields dynversym_hdr, dynverref_hdr, + dynverdef_hdr, dynversym_section, dynverdef_section, + dynverref_section, cverdefs, cverrefs, verdef, verref. + (elf_dynversym, elf_dynverdef, elf_dynverref): Define. + (_bfd_elf_swap_verdef_in, _bfd_elf_swap_verdef_out): Declare. + (_bfd_elf_swap_verdaux_in, _bfd_elf_swap_verdaux_out): Declare. + (_bfd_elf_swap_verneed_in, _bfd_elf_swap_verneed_out): Declare. + (_bfd_elf_swap_vernaux_in, _bfd_elf_swap_vernaux_out): Declare. + (_bfd_elf_swap_versym_in, _bfd_elf_swap_versym_out): Declare. + (_bfd_elf_slurp_version_tables): Declare. + * elf.c (_bfd_elf_swap_verdef_in): New function. + (_bfd_elf_swap_verdef_out): Likewise. + (_bfd_elf_swap_verdaux_in, _bfd_elf_swap_verdaux_out): Likewise. + (_bfd_elf_swap_verneed_in, _bfd_elf_swap_verneed_out): Likewise. + (_bfd_elf_swap_vernaux_in, _bfd_elf_swap_vernaux_out): Likewise. + (_bfd_elf_swap_versym_in, _bfd_elf_swap_versym_out): Likewise. + (_bfd_elf_print_private_bfd_data): Add DT_VER* constants. Print + version information if there is any. + (_bfd_elf_link_hash_newfunc): Initialize verinfo field. + (bfd_section_from_shdr): Handle SHT_GNU_ver* section types. + (elf_fake_sections): Handle .gnu.version* section names. + (assign_section_numbers): Handle SHT_GNU_ver* section types. + (_bfd_elf_slurp_version_tables): New function. + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Don't include + version name in string entered in dynamic hash table. + * elfcode.h: Include fnmatch.h. + * elf32-i386.c (elf_i386_relocate_section): Handle a dynamic + symbol which was forced to become local. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise. + +Fri Feb 21 16:15:18 1997 Jeffrey A Law (law@cygnus.com) + + * elf32-mn10200.c (mn10200_elf_final_link_relocate): Simplify + somewhat. + (mn10200_elf_relax_section): Correctly compute a symbol's value + when the symbol is local, but not in the same section as we are + relaxing. Implement abs24 -> abs16, imm24 -> imm16 and d24 -> d16 + relaxing. + +Fri Feb 21 13:55:14 1997 Doug Evans + + * elf32-m32r.c: Rewrite to use ELF backend linker. + Store lower 16 bits of addend in R_M32R_HI16_[SU]LO insns. + Add small data area support (R_M32R_SDA16). + * reloc.c: Document BFD_RELOC_M32R_SDA16. + * bfd-in2.h, libbfd.h: Regenerated. + +Thu Feb 20 23:50:31 1997 Jeffrey A Law (law@cygnus.com) + + * elf32-mn10200.c (mn10200_elf_relax_section): New function. + (mn10200_elf_relax_delete_bytes): Likewise. + (mn10200_elf_symbol_address_p): Likewise. + (mn10200_elf_get_relocated_section_contents): Likewise. + (bfd_elf32_bfd_relax_section): Define. + (bfd_elf32_bfd_get_relocated_section_contents): Likewise. + + * elf32-mn10200.c (mn10200_elf_final_link_relocate): New function. + (mn10200_elf_relocate_section): Likewise. + (elf_backend_relocate_section): Define. + +Tue Feb 18 17:22:59 1997 Martin M. Hunt + + * Makefile.in: New target, elf-*-D30V. + * archures.c: New target, elf-*-D30V. + * config.bfd: New target, elf-*-D30V. + * configure.in: New target, elf-*-D30V. + * elf.c: New target, elf-*-D30V. + * reloc.c: New target, elf-*-D30V. + * targets.c: New target, elf-*-D30V. + * bfd-in2.h: Rebuilt. + * configure: Rebuilt. + * libbfd.h: Rebuilt. + * cpu-d30v.c: New files. + * elf32-d30v.c: New files. + +Tue Feb 18 15:31:48 1997 Fred Fish + + * reloc.c (struct reloc_howto_struct): Fix typo in comment. + * bfd-in2.h: Regenerated. + * coff-tic80.c (RTYPE2HOWTO): Replace abort with real function. + (rtype2howto): Add function. + (tic80_howto_table): Add. + +Tue Feb 18 11:41:00 1997 Dawn Perchik + + * sysdep.h: Don't define errno in MSVC if error.h is included. + +Tue Feb 18 10:04:13 1997 Jeffrey A Law (law@cygnus.com) + + * elf32-v850.c (v850_elf_relocate_section): Make sure r_symndx + is initialized before it is used. + +Mon Feb 17 11:28:40 1997 Ian Lance Taylor + + * hp300hpux.c (convert_sym_type): Don't convert a secondary common + symbol into a weak undefined symbol; leave it as a common symbol. + +Fri Feb 14 19:08:03 1997 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Don't issue a warning + about a symbol defined in a dynamic object if it has already been + defined in a regular object. + +Thu Feb 13 20:53:22 1997 Klaus Kaempf (kkaempf@progis.de) + + * makefile.vms: Add gcc flags to allow compiling with current gcc + snapshot + (targmatch.h): New dependency. + + * reloc.c (BFD_RELOC_ALPHA_CODEADDR): New relocation for + openVMS/Alpha. + * evax.h (ALPHA_R_CODEADDR): New relocation. + * evax-alpha.c (ALPHA_R_CODEADDR): 64 bit procedure relocation for + openVMS/Alpha. + * evax-etir.c (ALPHA_R_CODEADDR): Output object code for this + relocation. + * bfd-in2.h, libbfd.h: Rebuild. + + Restrict symbol length to 64 bytes, case preserving: + * evax-emh.c (_bfd_evax_write_emh): Remove case hacking. + * evax-misc.c (_bfd_evax_case_hack_symbol): Remove. + (_bfd_evax_length_hash_symbol): Added. + * evax-etir.c (_bfd_evax_write_etir): Call + _bfd_evax_length_hash_symbol before output of symbol. + * evax-egsd.c (_bfd_evax_write_egsd): Likewise. + * evax.h (flag_hash_long_names, flag_show_after_trunc): Remove. + + * evax-emh.c: Output filename to object file without path. + + * evax-egsd.c: New sections for local and global commons. + + * evax-alpha.c, evax-emh.c, evax-egsd.c, evax-etir.c, + evax-misc.c, evax.h: Remove 8 bit characters from copyright + notices. Replace AXP with Alpha. + +Wed Feb 12 18:10:30 1997 Ian Lance Taylor + + * sunos.c (sunos_create_dynamic_sections): We need the dynamic + sections if we are creating a shared library. + +Tue Feb 11 15:45:43 1997 Doug Evans + + * configure.host (i386-windows): Don't set host64=true. + +Tue Feb 11 15:27:32 1997 Ian Lance Taylor + + * elf32-mips.c (reloc_type): Add R_MIPS16_GPREL. + (elf_mips16_gprel_howto): New static variable. + (mips16_gprel_reloc): New static function. + (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS16_GPREL. + (mips_info_to_howto_rel): Handle R_MIPS16_GPREL. + (mips_elf_relocate_section): Handle R_MIPS16_GPREL. + * reloc.c (BFD_RELOC_MIPS16_GPREL): Define. + * bfd-in2.h, libbfd.h: Rebuild. + +Mon Feb 10 23:25:00 1997 Doug Evans + + * elf32-m32r.c (elf_m32r_howto_table): Change partial_inplace to true + for R_M32R_{16,32,24,HI16_ULO,HI16_SLO,LO16}. + +Fri Feb 7 12:39:11 1997 Ian Lance Taylor + + * elflink.h (elf_link_input_bfd): If we've discarded a section, + the output section will be the absolute section; don't print an + assertion message for that case when doing a relocateable link. + +Thu Feb 6 16:55:43 1997 Ian Lance Taylor + + * elf32-mips.c (FN_STUB, CALL_STUB, CALL_FP_STUB): Define. + (struct mips_elf_link_hash_entry): Add new fields fn_stub, + need_fn_sub, call_stub, and call_fp_stub. + (struct mips_elf_link_hash_table): Add field mips16_stubs_seen. + (mips_elf_link_hash_newfunc): Initialize new fields. + (mips_elf_link_hash_table_create): Likewise. + (mips_elf_relocate_section): Redirect relocations to use mips16 + stubs when appropriate. + (mips_elf_check_relocs): Attach stub sections to the appropriate + symbol. Set need_fn_stub when appropriate. + (mips_elf_always_size_sections): New static function. + (mips_elf_check_mips16_stubs): New static function. + (elf_backend_always_size_sections): Define. + * elf-bfd.h (struct elf_obj_tdata): Add local_stubs field. + + * elflink.h (elf_link_input_bfd): Discard local symbols that are + attached to sections which are not being included in the link. + +Wed Feb 5 13:20:17 1997 Ian Lance Taylor + + * cofflink.c (_bfd_coff_generic_relocate_section): Ignore the + symbol value when computing the addend for a pc_relative + pcrel_offset reloc. + +Mon Feb 3 11:54:06 1997 Ian Lance Taylor + + * cofflink.c (_bfd_coff_generic_relocate_section): If doing a + relocateable link, just skip pc_relative pcrel_offset relocs. + * coff-arm.c (coff_arm_rtype_to_howto): Return a different howto + structure for an ARM26 reloc which can be resolved. + (coff_arm_adjust_symndx): Only convert ARM26 to ARM26D if the + reloc can be resolved. + + * coff-h8300.c (h8300_reloc16_extra_cases): Correct off by one + error in overflow check for R_RELBYTE. + +Fri Jan 31 14:07:27 1997 Ian Lance Taylor + + * ieee.c (ieee_slurp_section_data): Pick up the start address. + From Mark Rasin . + + * aoutx.h (aout_link_write_symbols): Don't apply discard_l to + debugging symbols. + +Wed Jan 29 00:00:49 1997 Jeffrey A Law (law@cygnus.com) + + * elf32-mn10200.c (reloc_type): Add 16bit pc-relative reloc. + (elf_mn10200_howto_table): Likewise. + (mn10200_reloc_map): Likewise. + +Mon Jan 27 12:07:35 1997 Doug Evans + + * reloc.c: Add relocs BFD_RELOC_M32R_{HI16_[US]LO,LO16}. + * bfd-in2.h, libbfd.h: Regenerated. + * elf32-m32r.c: Add support for them. + +Mon Jan 27 12:25:02 1997 Ian Lance Taylor + + * aout-arm.c (MY_swap_std_reloc_in): Remove unused r_length. + * elf32-ppc.c (ppc_elf_check_relocs): Remove unused plt. + * elf32-v850.c (v850_elf_final_link_relocate): Remove used + r_format and r_pcrel. Always return a value. + * riscix.c (MY_final_link_callback): Define to dummy value. + + * elf32-i386.c (elf_i386_size_dynamic_sections): When checking for + relocations against the text segment, look up the output name of + the reloc section. + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. + * elf32-mips.c (mips_elf_size_dynamic_sections): Likewise. + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise. + +Wed Jan 22 15:40:28 1997 Fred Fish + + * coff-tic80.c (tic80coff_vec): Use correct data put/get + routines for little endian data. + * coffcode.h (coff_write_object_contents): Set magic to + TIC80_ARCH_MAGIC for TIc80. + +Tue Jan 21 12:32:43 1997 Fred Fish + + * coff-tic80.c (tic80coff_vec): Change to little endian data + as the default. + +Thu Jan 16 17:45:57 1997 Ian Lance Taylor + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Change type of + auxiliary_filters parameter to be const char * const *. Accept a + NULL terminated array. + * bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration. + (bfd_elf32_size_dynamic_sections): Update declaration. + * bfd-in2.h: Rebuild. + +Wed Jan 15 11:21:32 1997 Ian Lance Taylor + + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Treat a + NOTYPE symbol in a text section as a FUNC symbol. + + * coffcode.h (coff_compute_section_file_positions): Force + relocbase to be aligned to COFF_DEFAULT_SECTION_ALIGNMENT_POWER. + +Tue Jan 14 08:46:33 1997 Doug Evans + + * libaout.h (machine_type): Reserve several values for sparclet. + +Mon Jan 13 22:39:08 1997 Michael Meissner + + * config.bfd (tic80-*-*): Don't require 'coff'. + +Mon Jan 13 19:36:25 1997 Michael Meissner + + * elf32-v850.c (v850_elf_howto_table): Set the special_function + table to v850_elf_reloc for all non-standard relocations. + (v850_elf_check_relocs): Add check for h being non-null. + (v850_elf_reloc): Add R_V850_ZDA_OFFSET support. Use switch + statement instead of multiple ifs. + (v850_elf_relocate_section): Fix up error message, don't just call + abort. + +Mon Jan 6 13:28:35 1997 Jeffrey A Law (law@cygnus.com) + + * elf32-mn10200.c (elf_mn10200_howto): Don't ever set partial-inplace. + Use bfd_elf_generic_reloc as special function for all relocs. + (bfd_elf32_mn10200_reloc): Remove unnecessary function. + + * elf32-mn10200.c (elf_mn10200_howto): Set pcrel_offset for + 24bit pc-relative reloc. + +Fri Jan 3 16:33:00 1997 Fred Fish + + * Makefile.in (coff-tic80.o): Add coffcode.h to dependency list. + * coff-tic80.c (tic80coff_vec): Data byte order is big endian and + header byte order is little endian. Use correct bfd_get and + bfd_put routines for little endian headers. + * coffcode.h (coff_set_arch_mach_hook): Set arch to + bfd_arch_tic80 for TIC80_ARCH_MAGIC number. + +Fri Jan 3 16:54:08 1997 Jeffrey A Law (law@cygnus.com) + + * reloc.c: Add BFD_RELOC_24. + * elf32-mn10200.c (enum reloc_type): Add 24bit and pcrel relocs. + (elf_mn10200_howto, mn10200_reloc_map): Corresponding changes. + * bfd-in2.h, libbfd.h: Rebuilt. + +Fri Jan 3 16:58:31 1997 Richard Henderson + + elf64-alpha multiple .got rewrite: + + * elf-bfd.h (struct elf_backend_data): Add always_size_sections entry. + (bfd_elf*_mkobject): Don't define here ... + * elfxx-target.h: ... but rather here. Default always_size_sections + hook to NULL. + * elf.c (elf_mkobject): Rename to bfd_elf_mkobject, since that was + what the #defines in elf-bfd.h transmuted it to anyway. + + * section.c: Add SEC_LINKER_CREATED flag. + * bfd-in2.h: Rebuild. + * elf32-i386.c (elf_i386_check_relocs): Add SEC_LINKER_CREATED to + relocation section flags. + (elf_i386_size_dynamic_sections): Use SEC_LINKER_CREATED instead of + SEC_IN_MEMORY to recognize generated bits. + * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_size_dynamic_sections): + Likewise. + * elf32-mips.c (mips_elf_final_link, mips_elf_create_dynamic_sections, + mips_elf_create_compact_rel_section, mips_elf_create_got_section, + mips_elf_check_relocs, mips_elf_size_dynamic_sections): Likewise. + * elf32-ppc.c (ppc_elf_create_linker_section, + ppc_elf_size_dynamic_sections): Likewise. + * elf32-sparc.c (elf32_sparc_check_relocs, + elf32_sparc_size_dynamic_sections): Likewise. + * elflink.c (_bfd_elf_create_got_section): Add SEC_LINKER_CREATED to + section flags. + (_bfd_elf_create_dynamic_sections): Likewise. + (_bfd_elf_make_linker_section_rela): Likewise. + * elflink.h (elf_link_create_dynamic_sections): Likewise. + (bfd_elf,size_dynamic_sections): Call the always_size_sections hook. + (elf_bfd_final_link): Use SEC_LINKER_CREATED instead of SEC_IN_MEMORY + to identify generated bits. + (elf_link_input_bfd): Likewise. + + * elf64-alpha.c: Rewrite everything touching relocations. + +Fri Jan 3 11:42:53 1997 Michael Meissner + + * elf32-v850.c (all functions and static variables): Go through + and regularize names to be of the form v850_elf_. + (toplevel): Include . + (enum reloc_type): Move to include/elf/v850.h. + (v850_elf_check_relocs): For common variables, if the variable is + referenced by a R_V850_{SDA,ZDA,TDA} relocation, put the variable + into the appropriate section. + (elf_backend_check_relocs): Define. + +Tue Dec 31 15:15:28 1996 Michael Meissner + + * elf32-v850.c (elf_v850_howto_table): Fix some spacing. + +Tue Dec 31 14:44:50 1996 Ian Lance Taylor + + * config.bfd (mips*el-*-linux*): New target. + (mips*-*-linux*): New target. + + * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Clean up. + Return a useful value. + + * Makefile.in (ALL_CFLAGS): Add -D_GNU_SOURCE. + + * configure.in: Check ac_cv_func_mmap_fixed_mapped, not + ac_cv_func_mmap. + * configure: Rebuild. + * configure.host: Use ac_cv_func_mmap_fixed_mapped instead of + ac_cv_func_mmap in bfd/configure.host. + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Add + filter_shlib and auxiliary_filter_shlib parameters. + * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_AUXILIARY and + DT_FILTER. + * bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration. + (bfd_elf64_size_dynamic_sections): Likewise. + * bfd-in2.h: Rebuild. + +Mon Dec 30 18:48:52 1996 Ian Lance Taylor + + * xcofflink.c (xcoff_build_ldsyms): When exporting all defined + symbols, don't export a symbol which is defined by an object in an + archive which contains shared objects. + +Mon Dec 30 16:12:58 1996 Fred Fish + + * archures.c (enum bfd_architecture): Add bfd_arch_tic80 + for TI TMS320c80 (MVP). + (bfd_archures_list): Add bfd_tic80_arch. + * bfd-in2.h: Regenerate by running "make headers". + +Sun Dec 29 16:18:52 1996 Fred Fish + + * cpu-tic80.c (bfd_tic80_arch): Add struct. + * configure.in (case $vec): Correct typo, "tb" not "tp". + Also add cofflink.o for tic80coff_vec. + * configure: Regenerate with autoconf. + +Mon Dec 30 11:54:56 1996 Ian Lance Taylor + + * libbfd.c: Patch up the mmap code so that it is only built if BFD + is configured with --with-mmap. + +Sun Dec 29 10:48:57 1996 Fred Fish + + * Makefile.in (BFD32_BACKENDS): Add coff-tic80.o + (ALL_MACHINES): Add cpu-tic80.o + (cpu-tic80.o, coff-tic80.o): Add dependencies. + * coff-tic80.c: Add skeleton, cloned from another coff config. + * coffcode.h (coff_write_object_contents): Set magic to TIC80MAGIC + for TIc80. + +Fri Dec 27 20:56:41 1996 Fred Fish + + * TODO: Correct a misspelling. + * coff-tic80.c: New file for TI TMS320C80 (MVP). + * cpu-tic80.c: New file for TI TMS320C80 (MVP). + * configure.in (case $vec): Add tic80coff_vec entry. + * configure: Regenerate with autoconf. + * archures.c (bfd_tic80_arch): Declare. + * bfd-in2.h (enum bfd_architecture): Add bfd_arch_tic80. + * config.bfd (case ${targ}): Add tic80*-*-coff* target. + * targets.c (tic80coff_vec): Add decl as extern bfd_target. + (bfd_target_vector): Add tic80coff_vec entry. + +Fri Dec 27 11:48:12 1996 H.J. Lu + + * elflink.h (elf_buckets): Add some more values for larger + binaries. + +Thu Dec 26 18:36:54 1996 Ian Lance Taylor + + * Makefile.in (install): Move subdir_do out of conditional. From + Fred Fish . + +Wed Dec 18 10:04:30 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-mn10200.c (enum reloc_type): Enable basic 8, 16, and + 32 bit relocs. + (elf_mn10200_howto_table): Likewise. + (mn10200_reloc_map): Likewise. + +Tue Dec 17 11:09:36 1996 Ian Lance Taylor + + * elf32-mips.c (mips_elf_add_symbol_hook): Add 1 to the value of a + mips16 symbol during the link. + (mips_elf_finish_dynamic_symbol): Subtract 1 from the value of a + mips16 symbol. + (mips_elf_link_output_symbol_hook): New static function. + (elf_backend_link_output_symbol_hook): Define. + + * elf.c (bfd_elf_print_symbol): Print the st_other field if it is + not zero. + +Mon Dec 16 14:38:39 1996 Ian Lance Taylor + + * elf.c (bfd_section_from_shdr): Don't check for reloc sections + against SEC_DEBUGGING sections here (revert patch of December 5). + * elfcode.h (elf_object_p): Check for them here, instead. + +Sun Dec 15 14:46:06 1996 Ian Lance Taylor + + * elfcode.h (elf_slurp_reloc_table): Add dynamic parameter. + * elf.c (_bfd_elf_canonicalize_reloc): Pass new argument to + slurp_reloc_table. + (_bfd_elf_get_dynamic_reloc_upper_bound): New function. + (_bfd_elf_canonicalize_dynamic_reloc): New function. + * elf-bfd.h (struct elf_size_info): Update declaration of + slurp_reloc_table. + (_bfd_elf_get_dynamic_reloc_upper_bound): Declare. + (_bfd_elf_canonicalize_dynamic_reloc): Declare. + * elfxx-target.h: Use new dynamic reloc routines by default. + * elf64-mips.c (mips_elf64_slurp_reloc_table): Add dynamic + parameter. + +Fri Dec 13 13:18:49 1996 Dan Wilder + + * coffcode.h (coff_set_flags): Use MC68KBCSMAGIC for bfd_arch_m68k + if NAMES_HAVE_UNDERSCORE is defined. + +Fri Dec 13 11:13:23 1996 Doug Evans + + * libaout.h (enum machine_type): Change M_SPARCLET from 142 to 131. + +Thu Dec 12 15:07:20 1996 Michael Meissner + + * elf32-ppc.c (ppc_elf_check_relocs): Move R_PPC_PLTREL24 into the + supported relocs. + +Thu Dec 12 14:55:41 1996 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Only add a weak + symbol if the real definition is in the dynamic symbol table. + After finding the real definition, then, if it is dynamic, add the + weak symbol to the dynamic symbol table. + + * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Make static. + + * ppcboot.c (ppcboot_set_arch_mach): Don't define; it's a + function. + (ppcboot_bfd_print_private_bfd_data): Don't take the address of an + array. + +Tue Dec 10 23:23:52 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-mn10300.c (reloc_type): Remove big endian mn10300 reloc + variants. + (elf32_mn10300_howto_table, mn10300_reloc_map): Likewise. + (bfd_elf32_mn10300_reloc): Write data in little endian format. + * reloc.c: Remove mn10300 big endian relocs. + * bfd-in2.h, libbfd.h: Rebuilt. + + * elf32-mn10200.c: Update from elf32-mn10300.c. + +Fri Dec 6 15:18:05 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-mn10300.c (elf_symbol_leading_char): Define. + + * elf32-mn10300.c: Add some comments. + +Fri Dec 6 17:16:43 1996 Ian Lance Taylor + + * ihex.c (ihex_scan): Always initialize buf before jumping to + error_return. + (ihex_read_section): Likewise. + +Thu Dec 5 22:29:18 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-mn10300.c (elf_mn10300_howto_table): Don't set partial- + inplace for most relocs. + +Thu Dec 5 13:24:46 1996 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Calling check_relocs + even if SEC_ALLOC is not set. + * elf32-i386.c (elf_i386_check_relocs): Don't check SEC_ALLOC + when deciding whether to copy a reloc into a shared object. + (elf_i386_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_check_relocs): Likewise. + (elf32_sparc_relocate_section): Likewise. + * elf32-i386.c (elf_i386_check_relocs): Don't set SEC_ALLOC in a + reloc section if it is not set in the source section. + * elf32-sparc.c (elf32_sparc_check_relocs): Likewise. + * elf.c (bfd_section_from_shdr): Mark a reloc section associated + with a SEC_DEBUGGING section as SEC_DEBUGGING. + +Wed Dec 4 14:18:13 1996 Michael Meissner + + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): #if 0 code that + expects a .got.plt until we actually create it. + +Mon Dec 2 12:13:51 1996 Ian Lance Taylor + + * cofflink.c (_bfd_coff_generic_relocate_section): Print an error + message for bfd_reloc_outofrange, rather than aborting. From + Philippe De Muyter . + + * cofflink.c (_bfd_coff_final_link): If there aren't any relocs in + a relocateable link, don't try to process them. From Heinz Wrobel + . + +Mon Dec 2 00:39:24 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-mn10300.c (mn10300_info_howto): Renamed from + mn10300_info_howto_rel. Tweak reloc argument to be an + Elf32_Internal_Rela. + (USE_RELA): Define instead of USE_REL. + (elf_info_to_howto, elf_info_howto_rel): Corresponding changes. + +Sun Dec 1 00:18:59 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * configure.in, configure: Handle mips*-sgi-irix6*. + * irix-core.c (irix_core_core_file_p): Accept CORE_MAGICN32 + core files. + +Wed Nov 27 12:10:25 1996 Ian Lance Taylor + + * elf32-i386.c (elf_i386_relocate_section): Warn about a + relocation against a symbol defined in a section with no output + section. + +Tue Nov 26 11:07:31 1996 Ian Lance Taylor + + * aclocal.m4 (BFD_CC_FOR_BUILD): Don't require AC_C_CROSS. + * configure, config.in: Rebuild with autoconf 2.12. + + * elf-bfd.h (struct elf_link_hash_entry): Add other field. + * elf.c (_bfd_elf_link_hash_newfunc): Initialize other field. + (swap_out_syms): Set st_other from existing st_other field. + * elflink.h (elf_link_add_object_symbols): Store st_other in hash + table other field. + (elf_link_output_extsym): Set the other field from the global hash + table entry. + * elf32-mips.c (enum reloc_type): Add R_MIPS16_26. + (elf_mips16_jump_howto): New static variable. + (mips16_jump_reloc): New static function. + (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS16_JMP. + (mips_info_to_howto_rel): Handle R_MIPS16_26. + (mips_elf_relocate_section): Handle R_MIPS16_26. Handle R_MIPS_26 + to a mips16 symbol. + * reloc.c (BFD_RELOC_MIPS16_JMP): Add to list of relocs. + * bfd-in2.h, libbfd.h: Rebuild. + * cpu-mips.c (arch_info_struct): Add mips:16 entry. + +Mon Nov 25 11:23:32 1996 Ian Lance Taylor + + * configure.host: Use long long for mips-sgi-irix6*. + + * coffswap.h (coff_swap_scnhdr_out): Make line number overflow + only a warning. From Philippe De Muyter . + +Mon Nov 25 08:52:29 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-mn10300.c (bfd_elf32_mn10300_reloc): New function. + (enum reloc_type): Add more reloc types. + (elf32_mn10300_howto_table): Update for new reloc types. + (elf32_mn10300_reloc_map): Update for new reloc types. + * reloc.c: Add some new relocs for the mn10300 series. + * bfd-in2.h, libbfd.h: Rebuilt. + +Sat Nov 23 13:26:18 1996 Jeffrey A Law (law@cygnus.com) + + * som.c (setup_sections): Don't lose for a space which has + no data, but some symbols. + +Fri Nov 22 11:32:13 1996 Ian Lance Taylor + + * sunos.c (struct sunos_link_hash_table): Add got_needed field. + (sunos_link_hash_table_create): Initialize got_needed. + (sunos_create_dynamic_sections): Only set .got section size if it + is not already set. Set got_needed. + (bfd_sunos_size_dynamic_sections): Check got_needed. Only set + sdynptr, and only handle dynamic sections, if dynamic sections are + needed. + (sunos_scan_std_relocs): Pass false to create_dynamic_sections. + Initialize .got section. + (sunos_scan_ext_relocs): Likewise. + (sunos_write_dynamic_symbol): Set up PLT entry even if this is not + a dynamic symbol. + (sunos_finish_dynamic_link): Check got_needed. Only set up + dynamic linking information if needed. + +Thu Nov 21 10:31:31 1996 Rob Savoye (rob@cygnus.com) + + * config.bfd: Added VersaDOS format to the Ericsson configuration. + +Wed Nov 20 16:31:31 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-mn10300.c: Rough cut at relocs for the mn10300. + +Wed Nov 13 08:12:38 1996 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (elf32-d10v.o): Don't depend on elf/d10v.h + anymore. + +Tue Nov 12 13:30:00 1996 Dawn Perchik + + * filemode.c: Include sysdep.h. + * ihex.c: Add casts to eliminate compiler warnings. + * sunos.c: Add casts to eliminate compiler warnings. + +Mon Nov 11 10:37:02 1996 Michael Meissner + + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Create .got.plt + section. + (ppc_elf_check_relocs): Add support for R_PPC_LOCAL24PC. Make + appropriate relocations in the .so file if shared. + (ppc_elf_relocate_section): Ditto. + +Tue Oct 29 15:03:02 1996 Doug Evans + + * elf32-m32r.c (elf_m32r_howto_table, R_M32R_24): Use + complain_overflow_unsigned. + +Tue Oct 29 12:53:46 1996 Martin M. Hunt + + * elf32-d10v.c (elf_d10v_howto_table): Don't complain on + overflows for R_D10V_16 and R_D10V_18. + +Tue Oct 29 13:23:53 1996 Ian Lance Taylor + + * ieee.c (ieee_write_section_part): Use LMA rather than VMA. + (do_with_relocs): Likewise. + (do_as_repeat): Likewise. + (copy_expression): Likewise. + +Fri Oct 25 16:56:40 1996 Ian Lance Taylor + + * ieee.c (ieee_write_external_part): Correctly record whether + there is an external part. + +Thu Oct 24 14:32:52 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-v850.c (elf32_v850_bfd_final_link_relocate): Correctly + handle tda offsets for sld.w and sst.w instructions. + Fix alignment check in sld.w and sst.w tda reloc handling. + +Thu Oct 24 09:08:47 1996 Stu Grossman (grossman@critters.cygnus.com) + + * aclocal.m4, configure: Set USE_BINARY_FOPEN for *-*-windows. + +Wed Oct 23 00:53:16 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-v850.c: Add comments about assumptions about + char, short & long sizes. + (elf32_v850_bfd_final_link_relocate): Fix sign extension + problems for several relocs. + + * elf32-v850.c (elf32_v850_howto_table): Fix typo in + R_V850_SDA_OFFSET entry. + +Wed Oct 23 00:20:34 1996 Ian Lance Taylor + + * xcofflink.c (bfd_xcoff_import_symbol): Don't allocate ldsym. + Store import file index in ldindx. + (xcoff_build_ldsyms): Assume that ldsym was not previously + allocated. For an imported symbol, copy ldindx into l_ifile. + +Tue Oct 22 19:20:38 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-v850.c (elf_v850_howto_table): Fix ordering of + R_V850_ZDA_OFFSET and R_V850_TDA_OFFSET. Fix various + fields in R_V850_TDA_OFFSET. + (elf32_v850_bfd_final_link_relocate): Tweak pc-relative + relocs to work more like other relocs. Handle R_V850_TDA_OFFSET + relocations. + + * elf32-v850.c: Include bfdlink.h. + (bfd_elf32_v850_reloc): Return an error if we get a reloc + we can't handle. + (elf32_v850_bfd_final_link_relocate): New function. + (v850_elf_relocation_section): Likewise. + (elf_backend_relocate_section): Define. + +Tue Oct 22 17:22:43 1996 Ian Lance Taylor + + * binary.c (binary_set_section_contents): Ignore sections which + don't have SEC_LOAD and SEC_ALLOC set. + +Mon Oct 21 12:13:05 1996 Jeffrey A Law (law@cygnus.com) + + * linker.c (_bfd_generic_final_link): Avoid losing static + symbols in the .bss section. + +Mon Oct 21 10:54:58 1996 Ian Lance Taylor + + * elf32-mips.c (elf_mips_howto_table): Describe R_MIPS_64. + (mips32_64bit_reloc): New static function. + (mips_reloc_map): Add entry for BFD_RELOC_64. + (mips_elf_relocate_section): Handle R_MIPS_64. + + * linker.c (default_indirect_link_order): Print an error message + when attempting to do a relocateable link with different object + file formats, rather than calling abort. + +Thu Oct 17 10:43:29 1996 Doug Evans + + * reloc.c (m32r relocs): Rename them. + * bfd-in2.h, libbfd.h: Regenerated. + * elf32-m32r.c: Update. + (m32r_elf_10_pcrel_reloc): New function. + (elf_m32r_howto_table, R_M32R_10_PCREL entry): Use it. + (elf_m32r_howto_table, R_M32R_24 entry): Fix {src,dst}_masks. + +Wed Oct 16 11:24:35 1996 Jeffrey A Law (law@cygnus.com) + + * linker.c (_bfd_generic_final_link): Set "linker_mark" for + all sections that will be included in the output file. + (_bfd_generic_link_output_symbols): Discard symbols in sections + which are being discarded. + * elf32-v850.c (enum reloc_type): Add R_V850_SDA_OFFSET, + R_V850_TDA_OFFSET and R_V850_ZDA_OFFSET. + (elf_v850_howto_table): Corresponding changes. + (elf_v850_reloc_map): Corresponding changes. + * reloc.c: Add additional V850 relocations. + * bfd-in2.h, libbfd.h: Rebuilt. + + * elf32-v850.c (bfd_elf32_v850_reloc): Mask out bits we + no longer want in pc-relative relocs. + +Tue Oct 15 22:17:37 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-v850.c (bfd_elf32_v850_reloc): Don't silently + accept a reloc against an undefined sybmol! + +Tue Oct 15 16:17:28 1996 Stu Grossman (grossman@critters.cygnus.com) + + * elf32-v850.c: Define elf_symbol_leading_char to be '_'. + +Tue Oct 15 12:40:41 1996 Ian Lance Taylor + + * VERSION: Bump for new relocation. + + * hosts/i386bsd.h: If NBPG is not defined, define it as + PAGE_SIZE, for recent versions of FreeBSD. + +Mon Oct 14 12:37:26 1996 Ian Lance Taylor + + * configure.host: Use `long long' as the 64 bit type on a Solaris + host, since both gcc and the SunPRO compilers support it. + +Mon Oct 14 11:17:24 1996 Richard Henderson + + * reloc.c: Create a new BFD_RELOC_ALPHA_ELF_LITERAL. It was a + mistake to have reused the ECOFF LITERAL for ELF since they have + different semantics. + * elf64-alpha.c (elf_reloc_map): Map from ELF_LITERAL. + * bfd-in2.h, libbfd.h: Rebuild. + + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Trap .got + section overflow. + + * elf64-alpha.c (elf64_alpha_relocate_section): Do not emit a + dynamic relocation for an undefweak symbol when we are building + a static executable. + +Thu Oct 10 11:15:06 1996 Stan Shebs + + * mpw-make.sed (config.bfd, targmatch.sed): Edit references to + point explicitly to srcdir. + (targmatch.h): Edit references to point explicitly to objdir. + +Thu Oct 10 14:14:23 1996 Ian Lance Taylor + + * config.bfd: When setting targ_cpu, don't get confused by + linux-gnu. + +Tue Oct 8 08:51:19 1996 Stu Grossman (grossman@critters.cygnus.com) + + * configure.host: Add support for windows host (a build done + under the Microsoft build environment). + +Tue Oct 8 11:40:16 1996 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): If a symbol is a weak + definition in a dynamic object, add it to the dynamic symbol table + if any dynamic object mentions it. Reverts part of last patch. + + * sunos.c (struct sunos_link_hash_table): Add got_base field. + (sunos_link_hash_table_create): Initialize got_base. + (bfd_sunos_size_dynamic_sections): If the .got section is more + than 0x1000 bytes, set __GLOBAL_OFFSET_TABLE_ and got_base to + 0x1000. + (sunos_check_dynamic_reloc): Subtract got_base from a base + relative relocation. + + * elf32-mips.c (elf_mips_isa): New static function. + (_bfd_mips_elf_merge_private_bfd_data): Don't warn about linking + -mips1 and -mips2 code together, or -mips3 and -mips4 code. + +Mon Oct 7 11:44:17 1996 Ian Lance Taylor + + * archive.c (do_slurp_coff_armap): Only treat archive as little + endian for i960 COFF. + +Fri Oct 4 13:49:01 1996 Ian Lance Taylor + + * coffcode.h (coff_compute_section_file_positions): Adjust sofar + by the change in size of the section when EXEC_P is not set. + + * coff-m68k.c (coff_rtype_to_howto): Define if not defined. + (m68kcoff_rtype_to_howto): New static function. + * cf-m68klynx.c (coff_m68k_lynx_rtype_to_howto): Add the section + VMA to the addend for a PC relative reloc. + + * dep-in.sed: Rework backslash loop a bit to avoid bug in sed on + HP/UX 10.20. + * Makefile.in: Rebuild dependencies. + + * dep-in.sed: Remove ../bfd/sysdep.h, since it will appear when + som.h is included. + +Fri Oct 4 11:41:39 1996 Jeffrey A Law (law@cygnus.com) + + * Makefile.in: Remove explicit dependencies for mn10200 and + mn10300 files. + (ALL_MACHINE_CFILES): Add cpu-mn10200.c and cpu-mn10300.c. + (BFD32_BACKENDS_CFILES): Add elf32-mn10200.c and elf32-mn10300.c + (dependencies): Rebuilt. + +Thu Oct 3 16:57:51 1996 Ian Lance Taylor + + * cofflink.c (coff_link_add_symbols): Set obj_coff_keep_syms + during this function. + + * elflink.c (_bfd_elf_create_linker_section): Only use an existing + section if the flags are compatible. + + * configure.in: Add havevecs, and put it in tdefaults. + * mpw-config.in: Likewise. + * configure: Rebuild. + * targmatch.sed: New file; a sed script to build targmatch.h from + config.bfd. + * config.bfd: Add #if, #endif, and comments for targmatch.h. + * targets.c: Include "fnmatch.h". + (struct targmatch): Define. + (bfd_target_match): Define by including targmatch.h. + (bfd_find_target): If the target is not found by name, search for + it as a configuration triplet. + * Makefile.in: Rebuild dependencies. + (BFD32_BACKENDS): Add aout-arm.o, aout-sparcle.o, hp300bsd.o, + i386dynix.o, m68k4knetbsd.o, and riscix.o. + (BFD32_BACKENDS_CFILES): Add aout-arm.c, aout-sparcle.c, + hp300bsd.c, i386dynix.c, m68k4knetbsd.c, and riscix.c. + (HFILES): Add targmatch.h. Also, alphabetize and reindent. + (CFILES): Remove i386dynix.c and hp300bsd.c. + (targmatch.h): New target. + (do_clean): Remove targmatch.h. + + * configure.in: Add BFD_NEED_DECLARATION(getenv). + * acconfig.h: Add NEED_DECLARATION_GETENV. + * configure, config.in: Rebuild. + * sysdep.h: If NEED_DECLARATION_GETENV, declare getenv. + * aout-adobe.c (aout_adobe_object_p): Don't declare getenv. + +Thu Oct 3 09:29:09 1996 Jeffrey A Law (law@cygnus.com) + + * cpu-mn10x00.c, elf32-mn10x00: Removed. + * cpu-mn10200.c, cpu-mn10300.c: New files. + * elf32-mn10200.c, elf32-mn10300.c: New files. + * Makefile.in: Break mn10x00 support into two separate + configurations, mn10200 and mn10300. + * archures.c, config.bfd, configure.in, elf.c, targets.c: Likewise. + * bfd-in2.h, configure: Rebuilt. + +Thu Oct 3 15:38:19 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) + + * Makefile.in (do_clean): Move config.log to do_distclean. + +Wed Oct 2 21:40:55 1996 Jeffrey A Law (law@cygnus.com) + + * cpu-mn10x00.c, elf32-mn10x00.c: New files. + * Makefile.in (ALL_MACHINES): Add cpu-mn10x00.o. + (BFD32_BACKENDS): Similarly for elf32-mn10x00.o. + (elf32-mn10x00.o): Add dependencies. + * archures.c (enum bfd_architecture): Add bfd_arch_mn10x00. + (bfd_mn10x00_arch): Declare. + (bfd_archures_list): Add bfd_mn10x00_arch. + * config.bfd: Add mn10x00-*-*. + * configure.in: Add bfd_elf32_mn10x00_vec. + * elf.c (prep_headers): Handle bfd_arch_mn10x00. + * targets.c (bfd_elf32_mn10x00_vec): Declare. + (bfd_target_vector): Add bfd_elf32_mn10x00_vec. + * bfd-in2.h, configure: Rebuilt. + +Wed Oct 2 15:46:45 1996 Klaus Kaempf + + openVMS/Alpha: Provide filename and case_hack flags via + symbol table from gas. + Add case_hack code for symbol output from vax/vms. + * evax-alpha.c (evax_initialize): Remove filename handling, + filename is provided via symbol table. + (evax_get_symtab): Use local symbol count when setting up table. + * evax-egsd.c (_bfd_evax_slurp_egsd): Print correct name when + debugging. + (_bfd_evax_write_egsd): Skip file name symbol. + * evax-emh.c (get_vms_time_string): Local function now. + (_bfd_evax_write_emh): Extract source filename and case_hack flags + from symbol table. + (_bfd_evax_write_etir): Pass all symbol names through + _bfd_evax_case_hack_symbol. + * evax-misc.c (hash_string, _bfd_evax_case_hack_symbol): New + functions. + (_bfd_evax_basename): Removed. + (_bfd_get_vms_time_string): Moved to evax-emh.c. + * evax.h (evax_private_data_struct): Remove filename. + (flag_hash_long_names, flag_show_after_trunc, + flag_no_hash_mixed_case, vms_name_mapping): New flags for + vms_case_hack. + +Wed Oct 2 12:02:02 1996 Ian Lance Taylor + + * freebsd.h (N_GET_MAGIC_NET): Don't use ntohl. + (N_GETMID_NET, N_GETFLAG_NET): Likewise. + (NO_SWAP_MAGIC): Don't define. + (SWAP_MAGIC): Define. + + * cofflink.c (_bfd_coff_link_input_bfd): Don't crash if there is + no hash table entry for a global symbol. + +Tue Oct 1 16:14:22 1996 Joel Sherrill + + * config.bfd (mips*-*-rtems*): New target, like mips*-*-elf*. + +Tue Oct 1 12:31:39 1996 Ian Lance Taylor + + * cofflink.c (coff_link_add_symbols): Don't override a meaningful + symbol type with T_NULL. Warn if symbol type changes. Based on + patch from Philippe De Muyter . + + * elflink.h (elf_link_add_object_symbols): Only put a symbol from + a dynamic object in the dynamic symbol table if it is referenced + or defined by a regular object. + +Fri Sep 27 18:41:07 1996 Stu Grossman (grossman@critters.cygnus.com) + + * elf32-v850.c (bfd_elf32_v850_is_local_label): New function to + remove dwarf local labels. Shrinks binaries by a factor of 3! + +Mon Sep 23 13:33:00 1996 Ian Lance Taylor + + * elf32-ppc.c (ppc_elf_add_symbol_hook): Create the .sbss section + by hand, rather than by calling bfd_make_section. + +Mon Sep 23 09:23:41 1996 Doug Evans + + * reloc.c: Rename m32r relocs. + * bfd-in2.h, libbfd.h: Rebuilt. + * elf32-m32r.c: Update. + +Fri Sep 20 11:43:43 1996 Ian Lance Taylor + + * aoutx.h (aout_link_input_section_ext): When doing a relocateable + link, adjust the symbol index of a base relative reloc. Don't + change the addend of a PC relative reloc if pcrel_offset is set. + * sunos.c (bfd_sunos_size_dynamic_sections): Don't do anything for + a relocateable link. + + * reloc.c (bfd_perform_relocation): Apply the relocation even if + it is zero, in case src_mask matters. + (bfd_install_relocation): Likewise. + +Thu Sep 19 11:03:06 1996 Ian Lance Taylor + + * xcofflink.c (xcoff_link_add_symbols): Always initialize + keep_syms. + (_bfd_xcoff_bfd_final_link): Don't set target_index + to an uninitialized value. + +Tue Sep 17 14:18:31 1996 Ian Lance Taylor + + * coffcode.h (coff_slurp_line_table): Warn about illegal symbol + indices, rather than crashing. + (coff_slurp_reloc_table): Likewise. Check whether the howto field + is NULL. + * coff-sh.c (sh_relocate_section): Check for an illegal symbol + index. + +Mon Sep 16 12:39:36 1996 Ian Lance Taylor + + * coff-arm.c (aoutarm_std_reloc_howto): Change dst_mask for ARM26D + reloc to 0. + (coff_arm_adjust_symndx): New static function. + (coff_adjust_symndx): Define. + + * srec.c (srec_scan): Accept multiple symbols on a single line. + From Pascal Martin . + + * README: New file. + +Fri Sep 13 14:32:42 1996 Doug Evans + + * aoutf1.h (MY_bfd_merge_private_bfd_data): Define. + (sunos_merge_private_bfd_data): New function. + +Fri Sep 13 15:50:57 1996 Ian Lance Taylor + + * bfd.c (bfd_copy_private_bfd_data): Switch on output BFD rather + than input BFD. + (bfd_merge_private_bfd_data): Likewise. + * section.c (bfd_copy_private_section_data): Likewise. + * syms.c (bfd_copy_private_symbol_data): Likewise. + * bfd-in2.h: Rebuild. + * aout-target.h (MY_bfd_copy_private_section_data): Check that + both BFD's are the right flavour. + * ecoff.c (_bfd_ecoff_bfd_copy_private_bfd_data): Likewise. + * elf.c (_bfd_elf_copy_private_symbol_data): Likewise. + * elf32-mips.c (_bfd_mips_elf_copy_private_bfd_data): Likewise. + (_bfd_mips_elf_merge_private_bfd_data): Likewise. + * elf32-ppc.c (ppc_elf_copy_private_bfd_data): Likewise. + (ppc_elf_merge_private_bfd_data): Likewise. + * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Likewise. + * peicode.h (pe_bfd_copy_private_section_data): Likewise. + + * elf32-hppa.c (elf_hppa_howto_table): Fill in some fields for + R_PARISC_DIR32, so that _bfd_stab_section_find_nearest_line passes + its sanity check. + +Thu Sep 12 11:45:57 1996 Doug Evans + + * reloc.c: Add m32r relocs. + * bfd-in2.h, libbfd.h: Rebuilt. + * cpu-m32r.c, elf32-m32r.c: New files. + +Thu Sep 12 11:10:05 1996 Ian Lance Taylor + + * ieee.c (ieee_vec): Set symbol_leading_char field to '_'. + +Wed Sep 11 11:57:56 1996 Ian Lance Taylor + + * tekhex.c (first_phase): Change type parameter from char to int. + (out): Likewise. + (pass_over): Change func to expect int, not char. + + * elf.c (assign_file_positions_for_segments): Test SEC_ALLOC + rather than SEC_LOAD when aligning the file offset for the first + section in a segment. + +Tue Sep 10 16:18:30 1996 Fred Fish + + * syms.c (coff_section_type): Make arg const. + * irix-core.c (irix_core_core_file_p): Remove extraneous extra arg + to make_bfd_asection(). + * elf-bfd.h (bfd_section_from_phdr): Add prototype. + * elfcode.h (bfd_section_from_phdr): Remove prototype. + (_bfd_elf_stringtab_init): Remove prototype. + + * netbsd-core.c (swap_abort): Add prototype. + * aix386-core.c (swap_abort): Ditto & make static + * hpux-core.c (swap_abort): Ditto & make static. + * irix-core.c (swap_abort): Ditto & make static. + * ptrace-core.c (swap_abort): Ditto & make static. + * trad-core.c (swap_abort): Ditto & make static. + * coffswap.h (coff_swap_reloc_in): Ditto. + (coff_swap_reloc_out): Ditto. + (coff_swap_filehdr_in): Ditto. + (coff_swap_filehdr_out): Ditto. + (coff_swap_sym_in): Ditto. + (coff_swap_sym_out): Ditto. + (coff_swap_aux_in): Ditto. + (coff_swap_aux_out): Ditto. + (coff_swap_lineno_in): Ditto. + (coff_swap_lineno_out): Ditto. + (coff_swap_aouthdr_in): Ditto. + (coff_swap_aouthdr_out): Ditto. + (coff_swap_scnhdr_in): Ditto. + (coff_swap_scnhdr_out): Ditto. + * ihex.c (ihex_sizeof_headers): Ditto. + * tekhex.c (getsym): Ditto. + (find_chunk): Ditto & make static. + (insert_byte): Ditto. + (first_phase): Ditto. + (pass_over): Ditto. + (tekhex_get_symtab): Ditto & make static. + (tekhex_get_symtab_upper_bound): Ditto & make static. + (tekhex_mkobject): Ditto. + (tekhex_object_p): Ditto. + (move_section_contents): Ditto. + (tekhex_get_section_contents): Ditto. + (tekhex_set_arch_mach): Ditto & make static. + (tekhex_set_section_contents): Ditto. + (writevalue): Ditto. + (writesym): Ditto. + (out): Ditto. + (tekhex_write_object_contents): Ditto. + (tekhex_sizeof_headers): Ditto. + (tekhex_make_empty_symbol): Ditto. + (tekhex_get_symbol_info): Ditto. + (tekhex_print_symbol): Ditto. + * irix-core.c (make_bfd_asection): Ditto. + (irix_core_core_file_p): Ditto. + (irix_core_core_file_failing_command): Ditto. + (irix_core_core_file_failing_signal): Ditto. + (irix_core_core_file_matches_executable_p): Ditto. + (irix_core_make_empty_symbol): Ditto. + * coff-mips.c (mips_bfd_reloc_type_lookup): Ditto. + * srec.c (srec_new_symbol): Ditto. + (srec_get_section_contents): Ditto. + (srec_set_arch_mach): Ditto. + (srec_set_section_contents): Ditto. + (internal_srec_write_object_contents): Ditto. + (srec_write_object_contents): Ditto. + (symbolsrec_write_object_contents): Ditto. + (srec_sizeof_headers): Ditto. + (srec_make_empty_symbol): Ditto. + (srec_get_symtab_upper_bound): Ditto. + (srec_get_symtab): Ditto. + (srec_print_symbol): Ditto and make static. + * elf.c (elf_read): Ditto + (assign_section_numbers): Ditto. + (elf_fake_sections): Ditto. + (sym_is_global): Ditto. + (elf_map_symbols): Ditto. + (get_program_header_size): Ditto. + * coffgen.c (make_a_section_from_file): Ditto. + (coff_real_object_p): Ditto. + (fixup_symbol_value): Ditto. + (build_debug_section): Ditto. + (copy_name): Ditto. + * syms.c (coff_section_type): Ditto. + +Mon Sep 9 22:36:01 1996 Jeffrey A Law (law@cygnus.com) + + * bfd-in2.h: Rebuilt after m32r changes. + +Mon Sep 9 12:31:22 1996 Doug Evans + + * config.bfd: Add m32r support. + * configure.in: Likewise. + * configure: Likewise. + * Makefile.in: Likewise. + * archures.c: Likewise. + * elf.c: Likewise. + * targets.c: Likewise. + * config.bfd: Keep target list alphabetically sorted. + +Mon Sep 9 11:48:41 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-v850.c (bfd_elf32_v850_reloc, case R_V850_HI16): Don't forget + to add in the constant part found in the instruction itself. + (case R_V850_HI16_S): Likewise. + +Fri Sep 6 17:04:39 1996 Martin M. Hunt + + * elf32-d10v.c (elf_d10v_howto_table): Modify the size of R_D10V_16 + and R_D10V_18 to be 1 (word). + +Thu Sep 5 15:23:08 1996 Ian Lance Taylor + + * stabs.c (_bfd_link_section_stabs): If the output_section field + of either section is bfd_abs_section, then the linker is + discarding the section and we should not optimize it. + +Tue Sep 3 12:16:20 1996 Doug Evans + + * Makefile.in (aout-sparcle.o): New target. + * aoutf1.h (TARGET_IS_BIG_ENDIAN_P): Don't define if little endian. + * config.bfd (sparclet-*-aout*): Add case. + * configure.in (sparcle_aout_vec): Add case. + * configure: Regenerated. + * targets.c (sparcle_aout_vec): Declare. + (bfd_target_vector): Add sparcle_aout_vec. + * aout-sparcle.c: New file. + +Tue Sep 3 00:57:02 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-v850.c (bfd_elf32_v850_reloc): Fix handling of + low order sign bit propogation for R_V850_HI16_S. + + * elf32-v850.c (bfd_elf32_v850_reloc): New function for + handling V850 specific relocs. + (elf_v850_howto_table): Use the new function for some + relocations. Twiddle masks & shifts for some relocs. + Set partial_inplace where needed. + +Mon Sep 2 12:12:34 1996 Ian Lance Taylor + + * cpu-mips.c: Add an explicit mips:3000 entry, and change the + default architecture to a machine number of 0. + * elf32-mips.c (_bfd_mips_elf_object_p): Set the machine number + for E_MIPS_ARCH_1. + (_bfd_mips_elf_merge_private_bfd_data): If the machine number of + the output BFD is the default, set it from the first input BFD. + +Sun Sep 1 18:38:01 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-v850.c (elf_v850_howto_table): All the 16bit relocs + insert at bitpos zero. The HI16 relocs are shifted right + by 16 bits. Fix src_mask for all relocs. + (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Define. The V850 is + little endian! + (TARGET_BIG_SYM, TARGET_BIG_NAME): Remove. The V850 is little + endian! + +Sun Sep 1 15:41:08 1996 Ian Lance Taylor + + * rs6000-core.c (rs6000coff_core_file_matches_executable_p): + Rewrite to use BFD file read routines and to avoid using a fixed + length for the file name. + +Sat Aug 31 10:22:25 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-v850.c (enum reloc_type): Add R_V850_{32,16,8}. + (elf_v850_howto_table): Add support for R_V850_{32,16,8}. + (v850_reloc_map): Add translation from BFD_RELOC_{32,16,8} + to R_V850_{32,16,8}. + +Fri Aug 30 18:06:04 1996 J.T. Conklin + + * elf32-v850.c (reloc_type): Add R_V850_HI16_S. + (elf_v850_howto_table): Add info for HI16_S reloc. + (v850_reloc_map): Add HI_16_S reloc. + * reloc.c: Define BFD_RELOC_V850_* relocs. + +Fri Aug 30 11:49:19 1996 Ian Lance Taylor + + Add SH ELF support. + * elf32-sh.c: New file. + * elf.c (prep_headers): Handle bfd_arch_sh. + * elfcode.h (write_relocs): Handle absolute symbol. + * elf-bfd.h (_bfd_elf32_link_read_relocs): Declare. + (_bfd_elf64_link_read_relocs): Declare. + * elflink.h (NAME(_bfd_elf,link_read_relocs)): Rename from + elf_link_read_relocs. Make globally visible. Change all + callers. + (elf_link_input_bfd): Get external symbols from cache in + symtab_hdr->contents. Get contents from cache in + elf_section_data. + * elfxx-target.h (bfD_elfNN_bfd_relax_section): Only define if not + already defined. + * reloc.c: Define BFD_RELOC_SH_* relocs. + * libbfd-in.h (_bfd_sh_align_load_span): Declare. + * coff-sh.c (sh_insns_conflict): Fix a return value. + (_bfd_sh_align_load_span): New globally visible function, broken + out of sh_align_load. + (sh_align_load): Call _bfd_sh_align_load_span. + (sh_swap_insns): Change relocs parameter to PTR. + * bfd-in2.h, libbfd.h: Rebuild. + * targets.c (bfd_elf32_sh_vec): Declare. + (bfd_elf32_shl_vec): Declare. + * config.bfd (sh-*-elf*): New target. + * configure.in (bfd_elf32_sh_vec): New target vector. + (bfd_elf32_shl_vec): New target vector. + * configure: Rebuild. + * Makefile.in: Rebuild dependencies. + (BFD32_BACKENDS): Add elf32-sh.o. + (BFD32_BACKENDS_CFILES): Add elf32-sh.c. + + * elf.c (map_sections_to_segments): Check that LMA does not skip a + page before checking D_PAGED. + + * ihex.c (ihex_scan): Removed unnecessary extbase variable. + (ihex_write_object_contents): Remove extbase; always use segbase + instead. + +Thu Aug 29 16:52:17 1996 Michael Meissner + + * configure.in (i[345]86-*-*): Recognize i686 for pentium pro. + * configure.host (i[345]86-*-*): Ditto. + * config.bfd (i[345]86-*-*): Ditto. + * configure: Regenerate. + + * config.bfd (i[3456]86-*-dgux*): Recognize as a synonym for x86 + elf. + +Tue Aug 27 09:18:18 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-hppa.c (hppa_elf_gen_reloc_type): Add new argument. + * elf32-hppa.h (hppa_elf_gen_reloc_type): Update prototype. + * som.c (hppa_som_gen_reloc_type): Add new argument. If + we encounter an R_DATA_ONE_SYMBOL reloc against a symbol that + will have an ST_CODE type, change the symbol's type to ST_DATA. + * som.c (hppa_som_gen_reloc_type): Update prototype. + +Tue Aug 27 00:12:22 1996 Ian Lance Taylor + + * elf32-mips.c (mips_elf_check_relocs): Set dynobj if needed for + R_MIPS_32 and R_MIPS_REL32. Set sgot and g as soon as possible. + (mips_elf_size_dynamic_sections): Don't require .got to exist. + (mips_elf_finish_dynamic_sections): Likewise. + +Thu Aug 22 10:54:38 1996 Ian Lance Taylor + + * configure.host (HLDENV): New variable to set. Set it for + *-*-sysv4*, since those linkers may not support -R but they always + support LD_RUN_PATH. + + * libieee.h (NSECTIONS): Don't define. + (ieee_data_struct): Change section_table to asection **. Add + section_table_size. + * ieee.c (get_section_entry): If the table isn't big enough, make + it bigger. + (ieee_slurp_sections): Remove assertion about number of sections. + (ieee_object_p): Adjust initialization of ieee to match changes to + the structure. + + * xcofflink.c (xcoff_mark): Don't copy relocs for undefined + symbols merely because we are generating a shared library. + (xcoff_build_ldsyms): Don't set up global linkage code for an + undefined symbol merely because we are generating a shared + library. + +Tue Aug 20 15:06:05 1996 J.T. Conklin + + * Makefile.in (ALL_MACHINES): Add cpu-v850.o. + (BFD32_BACKENDS) Add elf32-v850.o. + * archures.c: Add bfd_v850_arch. + * bfd-in2.h: Add bfd_v850_arch. + * config.bfd (v850-*-*): New target. + * configure: (bfd_elf32_v850_vec) New vector. + * configure.in: (bfd_elf32_v850_vec) New vector. + * cpu-v850.c: New file. + * elf.c (prep_headers): Added case bfd_arch_v850. + * elf32-v850.c: New file. + * targets.c (bfd_elf32_v850_vec): New vector. + +Fri Aug 16 16:25:35 1996 Ian Lance Taylor + + * xcofflink.c (xcoff_link_add_dynamic_symbols): Create and define + a function code symbol for an XMC_XO symbol. + +Thu Aug 15 12:33:29 1996 Stan Shebs + + * mpw-config.in: Update editing of autoconf vars to reflect + Jul 18 configure.in change. + * mpw-make.sed: Update editing of include pathnames to be + more general, add @DASH_C_FLAG@ to explicit compile rule edit. + +Thu Aug 15 10:35:13 1996 Richard Henderson + + * elf64-alpha.c (elf64_alpha_output_extsym): The section from + which to offset to get the .plt entry address is ".plt". + +Thu Aug 15 16:40:30 1996 James G. Smith + + * reloc.c: (BFD_RELOC_ARM_THUMB_ADD, BFD_RELOC_ARM_THUMB_IMM, + BFD_RELOC_ARM_THUMB_SHIFT, BFD_RELOC_ARM_THUMB_OFFSET): + Added, for internal use by the ARM gas. + * libbfd.h: Rebuilt + * bfd-in2.h: Rebuilt + +Wed Aug 14 17:02:09 1996 Richard Henderson + + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Correct typo + in section dynidx start. + +Tue Aug 13 14:35:38 1996 Ian Lance Taylor + + * elf.c (_bfd_elf_make_section_from_shdr): Treat sections whose + name begins with .gnu.linkonce as SEC_LINK_ONCE. This is an + optimization for g++. + +Tue Aug 13 17:04:40 1996 Michael Meissner + + * elf32-ppc.c (ppc_elf_merge_private_bfd_data): If one module has + the -mrelocatable-lib bit set and the other doesn't, clear the + -mrelocatable-lib bit in the header. + +Sat Aug 10 22:59:17 1996 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Do not resolve a common + symbol against a STT_FUNC symbol in a shared library. + +Fri Aug 9 12:44:57 1996 Ian Lance Taylor + + * xcofflink.c (xcoff_link_add_dynamic_symbols): If a descriptor + symbol is found, automatically define the corresponding function + code. + + * cofflink.c (coff_link_add_symbols): Only set (*sym_hash)->numaux + if sym.n_numaux is not zero. + (_bfd_coff_link_input_bfd): Permit the symbol and the hash table + entry to disagree about the number of aux entries if the symbol + has zero. + + * elf32-mips.c (mips_elf_check_relocs): Create the .rel.dyn + section if it might be needed, not just if info->shared. + (mips_elf_adjust_dynamic_symbol): Make room for a null element at + the start of .rel.dyn if we are going to use it. + (mips_elf_finish_dynamic_sections): Only clear the first element + of .rel.dyn if the size is greater than zero. + +Thu Aug 8 16:24:55 1996 Ian Lance Taylor + + * xcofflink.c (xcoff_link_input_bfd): If we already called the + undefined_symbol callback for a symbol, then don't issue any more + warnings about loader relocs. + (_bfd_ppc_xcoff_relocate_section): Don't do any further processing + after calling the undefined_symbol callback. + + * xcofflink.c (XCOFF_MULTIPLY_DEFINED): Define. + (xcoff_link_add_symbols): Permit multiple definitions of a symbol + as the AIX linker seems to do. + +Thu Aug 8 12:21:56 1996 Klaus Kaempf + + * evax-alpha.c (evax_alpha_vec): Corrected flags, cleanup. + (evax_initialize): Remove evax_reloc_table. + (evax_close_and_cleanup): Ditto. + (reloc_nil): Ditto. + (alpha_howto_table): Remove ALPHA_R_SWREL32 and ALPHA_R_SWREL64 + entries. + (evax_bfd_reloc_type_lookup): Ditto. + * evax-egsd.c (_bfd_evax_slurp_egsd): Add a few casts; set + cooked_size == raw_size. + * evax-emh.c (_bfd_evax_register_filename): Remove. + * evax-etir.c (etir_stc): Allow ETIR_S_C_STC_xx commands. + * evax-misc.c (add_new_contents): Malloc section at full size. + (_bfd_save_evax_section): Memcpy section contents directly. + * evax.h (ALPHA_R_SWREL32, ALPHA_R_SWREL64): Remove. + (evax_reloc_table): Remove. + + * hosts/alphavms.h (O_ACCMODE): Define if needed. + + * makefile.vms: Add better support for DEC C compilation + Add evax.h dependencies + + * reloc.c (bfd_get_reloc_size): Add case for 16 byte reloc. + (BFD_RELOC_SWREL32,BFD_RELOC_SWREL64): Remove. + (BFD_RELOC_ALPHA_BASEREG): Remove. + * bfd-in2.h, libbfd.h: Rebuild. + +Thu Aug 8 08:17:32 1996 Stu Grossman (grossman@critters.cygnus.com) + + * archive.c (bsd_write_armap): Ifdef around calls to getuid and + getgid if _WIN32 is defined. + * opncls.c (bfd_fdopenr): Remove unnecessary WINGDB ifdef. + +Wed Aug 7 23:19:00 1996 Stu Grossman (grossman@critters.cygnus.com) + + * aoutx.h bfd-in.h bfd-in2.h opncls.c riscix.c som.c targets.c: + Change NO_FLAGS to BFD_NO_FLAGS to avoid conflict with an HPUX + include file. + * libbfd.c: Create dummy getpagesize() macro if HAVE_GETPAGESIZE + isn't defined. + +Wed Aug 7 14:11:44 1996 Philippe De Muyter + + * configure.in: Call BFD_NEEDED_DECLARATION on strstr and + realloc. + * acconfig.h (NEED_DECLARATION_STRSTR): New macro. + (NEED_DECLARATION_REALLOC): New macro. + * configure, config.in: Rebuild. + * sysdep.h (strstr): Declare if NEED_DECLARATION_STRSTR. + (realloc): Declare if NEED_DECLARATION_REALLOC. + + * aclocal.m4 (BFD_NEED_DECLARATION): Include or + if they exist. + + * ieee.c (ieee_set_section_contents): Cast bfd_alloc return. + +Wed Aug 7 12:12:03 1996 Ian Lance Taylor + + * cpu-i386.c (i8086_arch): Architecture info for the i8086. + + Based on patches from Eric Valette : + * elf32-i386.c (enum reloc_type): Add FIRST_INVALID_RELOC, + LAST_INVALID_RELOC, R_386_16, R_386_PC16, R_386_8, R_386_PC8. + (elf_howto_table): Add entries for new relocs. + (elf_i386_reloc_type_lookup): Handle new relocs. + (elf_i386_info_to_howto): Just call abort. + (elf_i386_info_to_howto_rel): Check that the reloc type is valid. + (elf_i386_relocate_section): Likewise. + +Tue Aug 6 12:54:56 1996 Martin M. Hunt + + * elf32-d10v.c (elf_d10v_howto_table): Added R_D10V_32. + +Mon Aug 5 13:42:41 1996 Ian Lance Taylor + + * elf.c (_bfd_elf_make_section_from_shdr): For a loadable section, + only get the LMA from the phdr if they are in the same part of the + file. + + * elf.c (map_sections_to_segments): Rewrite tests for starting a + new segment to make them more comprehensible. If the relationship + between the LMA and the VMA changed, start a new segment. Don't + check dynsec when deciding whether to start a new segment for a + writeable section; -N will now handle this. + +Thu Aug 1 22:43:08 1996 Jeffrey A Law (law@cygnus.com) + + * libhppa.h: Remove "esel" changes. Not the right approach. + * som.c: Corresponding changes. + (som_bfd_derive_misc_symbol_info): Use ST_DATA for symbols + which don't have a SOM symbol type associated with them. + Reverses a 1994 change. + +Wed Jul 31 15:50:55 1996 Ian Lance Taylor + + Make ld -N more reasonable for ELF: + * elf.c (map_sections_to_segments): If D_PAGED is not set, set + phdr_in_section to false, and always use a single load segment. + (elf_sort_sections): Sort sections by LMA after VMA. + (assign_file_positions_for_segments): If D_PAGED is not set, don't + align to maxpagesize. + (assign_file_positions_except_relocs): Likewise. + * elfcode.h (elf_object_p): If a section is loaded but not page + aligned, clear D_PAGED. + +Wed Jul 31 15:00:12 1996 James G. Smith + + * reloc.c: (BFD_RELOC_ARM_OFFSETIMM8, BFD_RELOC_ARM_HWLITERAL): + Added, for internal use by the ARM gas. + * libbfd.h: Rebuilt + * bfd-in2.h: Rebuilt + +Tue Jul 30 14:14:57 1996 Jeffrey A Law (law@cygnus.com) + + * libhppa.h (R_HPPA_ESEL): New field selector. + (e_esel): Similarly. + * som.c (hppa_som_gen_reloc_type): If we encounter an e_esel, + then generate R_COMP2 (PUSH_SYM), R_DATA_EXPR fixup stream. + (som_write_fixups): Handle R_DATA_EXPR just like R_CODE_EXPR. + +Tue Jul 30 13:31:27 1996 Ian Lance Taylor + + * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Do the regular + archive search before looking for stripped dynamic objects. + +Fri Jul 26 17:51:39 1996 Ian Lance Taylor + + * xcofflink.c (xcoff_build_ldsyms): Make exporting an undefined + symbol a warning rather than an error. + +Wed Jul 24 12:02:53 1996 Ian Lance Taylor + + * elf.c (assign_file_positions_for_segments): Track the virtual + memory position separately from the file position, and use it to + compute the alignment adjustment. + +Tue Jul 23 10:43:31 1996 Martin M. Hunt + + * elf32-d10v.c (elf_d10v_howto_table): Changed all relocs to "long" + and fixed mask on R_D10V_10_PCREL_L. + +Mon Jul 22 15:30:30 1996 Ian Lance Taylor + + * elf64-mips.c: Include "aout/ar.h". + (mips_elf64_slurp_armap): New static function. + (mips_elf64_write_armap): New static function. + (bfd_elf64_archive_*): Define. + * elfxx-target.h (bfd_elfNN_archive_p): Define if not defined. + Use instead of bfd_generic_archive_p. + (bfd_elfNN_write_archive_contents): Define if not defined. Use + instead of _bfd_write_archive_contents. + (bfd_elfNN_mkdarchive): Define if not defined. Use instead of + _bfd_generic_mkarchive. + (TARGET_BIG_SYM): If bfd_elfNN_archive_functions is defined, use + bfd_elfNN_archive in BFD_JUMP_TABLE_ARCHIVE rather than + _bfd_archive_coff. + (TARGET_LITTLE_SYM): Likewise. + * archive.c (bfd_slurp_armap): Check for and reject an archive map + name of /SYM64/. + * Makefile.in: Rebuild dependencies. + + * elf32-mips.c (_bfd_mips_elf_final_write_processing): Handle + SHT_MIPS_LIBLIST, SHT_MIPS_CONTENT, SHT_MIPS_SYMBOL_LIB, and + SHT_MIPS_EVENTS sections. + (_bfd_mips_elf_section_from_shdr): Handle SHT_MIPS_IFACE, + SHT_MIPS_CONTENT, SHT_MIPS_SYMBOL_LIB, and SHT_MIPS_EVENTS + sections. + (_bfd_mips_elf_fake_sections): Likewise. + + * libecoff.h (ecoff_data_type): Add rdata_in_text field. + * ecoff.c (ecoff_compute_section_file_positions): Copy + rdata_in_text from backend info to tdata. Clear it if any data + section comes before .rdata. + (_bfd_ecoff_write_object_contents): Use rdata_in_text field in + tdata rather than backend info. + +Fri Jul 19 18:15:51 1996 Ian Lance Taylor + + * configure.in: Fix test for whether a compiler has a 64 bit + type. From Jim Wilson . + +Thu Jul 18 15:39:10 1996 Ian Lance Taylor + + * configure.host (mips-sgi-irix6*): New host. + + * configure.in: Set and substitute VERSION, BFD_HOST_64BIT_LONG + (replacing HOST_64BITLONG), BFD_HOST_64_BIT_DEFINED, + BFD_HOST_64_BIT, and BFD_HOST_U_64_BIT. Add bfd-in2.h:bfd-in2.h + to AC_OUTPUT call. + * configure: Rebuild. + * bfd-in.h (BFD_ARCH_SIZE): Define as @wordsize@, not @WORDSIZE@. + (BFD_HOST_64_BIT): Define conditionally. + (BFD_HOST_U_64_BIT): Define when BFD_HOST_64_BIT is defined. + (bfd_vma): Typedef as BFD_HOST_U_64_BIT. + (symvalue, bfd_size_type): Likewise. + * bfd-in2.h: Rebuild. + * Makefile.in (do_clean): Remove bfd-tmp.h. + (do_distclean): Remove bfd-in3.h. + (stmp-bfd.h): Just do copy-if-change bfd-in3.h bfd.h. + (bfd-in3.h): New target. + + * config.bfd (sparc-*-sysv4*): Don't build sunos_big_vec. From + Andrew Gierth . + + * configure.host: Set INSTALL_SHLIB. + * configure.in: Call AC_SUBST (INSTALL_SHLIB). + * configure: Rebuild. + * Makefile.in (install): Use @INSTALL_SHLIB@. + + * config.bfd (mips*-*-irix6*): New target. + * configure.host: Handle Irix 6 shared library like Irix 5. + + * xcofflink.c (xcoff_link_add_symbols): Don't check an XMC_TD + symbol for a magic name. + (xcoff_link_input_bfd): Don't change the reloc symbol for an + XMC_TD symbol. + (_bfd_ppc_xcoff_relocate_section): Don't get the TOC offset for an + XMC_TD symbol. + +Thu Jul 18 11:36:31 1996 Stan Shebs + + * mpw-config.in: Add ELF support to mips config, create the + elf32-target.h file in the object dir. + * mpw-make.sed: Edit elfXX-target.h refs at beginnings of lines. + +Wed Jul 17 18:02:32 1996 Kim Knuttila + + * coff-ppc.c: Redid debug scheme - numerous fprintf's gone. + Also removed most abort calls, in favor of using bfd reporting. + +Wed Jul 17 14:51:52 1996 Martin M. Hunt + + * Makefile.in (ALL_MACHINES): Add cpu-d10v.o. + (BFD32_BACKENDS) Add elf32-d10v.o. + * archures.c: Add bfd_d10v_arch. + * bfd-in2.h: Add bfd_d10v_arch. + * config.bfd (d10v-*-*): New target. + * configure: (bfd_elf32_d10v_vec) New vector. + * configure.in: (bfd_elf32_d10v_vec) New vector. + * cpu-d10v.c: New file. + * elf.c (prep_headers): Added case bfd_arch_d10v. + * elf32-d10v.c: New file. + * libbfd.h: Rebuild. + * reloc.c (BFD_RELOC_D10V_10_PCREL_R, BFD_RELOC_D10V_10_PCREL_L, + BFD_RELOC_D10V_18, BFD_RELOC_D10V_18_PCREL): Define. + * targets.c (bfd_elf32_d10v_vec): New vector. + +Wed Jul 17 10:58:55 1996 Kim Knuttila + + * coff-ppc.c (coff_ppc_relocate_section): Removed bogus fprintf + +Tue Jul 16 23:49:02 1996 Stu Grossman (grossman@critters.cygnus.com) + + * archures.c bfd-in2.h: Add bfd_mach_i386_i386 and + bfd_mach_i386_i8086 machine types. + +Wed Jul 10 12:42:56 1996 Ian Lance Taylor + + * ecoff.c (_bfd_ecoff_new_section_hook): Set SEC_CODE for _INIT + and _FINI sections. + +Wed Jul 10 11:18:21 1996 Richard Henderson + + * coffcode.h (coff_set_section_contents): A/UX does not require + special handling of the _LIB section. + +Tue Jul 9 15:52:20 1996 Jeffrey A Law (law@cygnus.com) + + * coff-h8300.c (h8300_reloc16_extra_cases): Use the correct + value for R_RELBYTE. + + * reloc16.c (bfd_coff_reloc16_relax_section): Only "shrinks" + array if one was allocated. + +Tue Jul 9 12:21:54 1996 Ian Lance Taylor + + From Kazumoto Kojima : + * elf32-mips.c (struct mips_elf_link_hash_table): Add new fields + use_rld_obj_head and rld_value. + (mips_elf_link_hash_table_create): Initialize new fields. + (mips_elf_add_symbol_hook): Mark __rld_obj_head symbol as + dynamic. + (mips_elf_create_dynamic_sections): Create .rld_map section. If + __rld_obj_head symbol not seen, create an __rld_map symbol. + (mips_elf_size_dynamic_sections): Make space in .rld_map section. + Create a DT_MIPS_RLD_MAP entry rather than a DT_DEBUG entry. + (mips_elf_finish_dynamic_symbol): Save value of __rld_map or + __rld_obj_head symbol. + (mips_elf_finish_dynamic_sections): Handle DT_MIPS_RLD_MAP. + +Mon Jul 8 16:18:03 1996 Ian Lance Taylor + + * elf32-mips.c (mips_reloc_map): Remove BFD_RELOC_32_PCREL entry. + + * elf32-ppc.c (ppc_elf_howto_raw): For R_PPC_ADDR16_HA, use + ppc_elf_addr16_ha_reloc. + (ppc_elf_addr16_ha_reloc): New static function. + + * coff-mips.c (struct mips_hi): Define. + (mips_refhi_list): New static variable. + (mips_refhi_addr, mips_refhi_addend): Remove. + (mips_refhi_reloc): Maintain a list of unmatched REFHI relocs. + (mips_reflo_reloc): Process mips_refhi_list. + (mips_relhi_list): New static variable. + (mips_relhi_addr, mips_relhi_addend): Remove. + (mips_relhi_reloc): Maintain a list of unmatched RELHI relocs. + (mips_rello_reloc): Process mips_relhi_list. + (mips_relocate_section): Permit an arbitrary number of REFHI or + RELHI relocs before the associated REFLO or RELLO reloc. + +Fri Jul 5 19:27:49 1996 Ian Lance Taylor + + * aout-target.h (MY(callback)): Set reloc_count fields. + +Thu Jul 4 12:00:37 1996 Ian Lance Taylor + + * sunos.c (sunos_add_dynamic_symbols): Don't create dynamic + sections unless this is a SunOS link. + + * VERSION: Set to 2.7.1. + + * Released binutils 2.7. + +Wed Jul 3 14:59:47 1996 Ian Lance Taylor + + * i386aout.c: Include "aout/aout64.h". + (i386aout_write_object_contents): New static function. + (MY_write_object_contents): Define. + + * netbsd.h (MY(write_object_contents)): Make sure that + adjust_sizes_and_vmas is called before fiddling with the magic + number. + +Tue Jul 2 23:30:39 1996 Ian Lance Taylor + + * stabs.c (_bfd_link_section_stabs): Fix casts of psinfo. + +Sun Jun 30 13:34:33 1996 Ian Lance Taylor + + * libbfd-in.h (itos, stoi): Don't define. + * libbfd.h: Rebuild. + * i386lynx.c (KEEPIT): Define as udata.i. + (NAME(lynx,swap_std_reloc_out)): Don't use stoi. + (NAME(lynx,swap_ext_reloc_out)): Likewise. + * riscix.c (riscix_swap_std_reloc_out): Use udata.i rather than + flags. Don't use stoi. + + * elf32-mips.c (ELF_MAGPAGESIZE): Change definition to 0x1000. + + * elf.c (map_sections_to_segments): Don't start a new segment for + a writable section if it's on the same page as the previous + segment. Reset the writable variable for a readonly section. + +Sat Jun 29 16:18:51 1996 Kim Knuttila + + * peicode.h (coff_swap_aouthdr_in): Missing initializations of + first_thunk_address, thunk_size, and import_table_size. + * peicode.h: Improved some diagnostics regarding edata sections. + + * coff-ppc.c (coff_ppc_relocate_section): Earlier error check + on IMGLUE relocs. + (coff_ppc_relocate_section): Improved diagnostic for large TOCDEFN's. + (TARGET_LITTLE_SYM): Added missing D_PAGED. + +Fri Jun 28 13:48:45 1996 Ian Lance Taylor + + * xcofflink.c (xcoff_link_check_ar_symbols): An undefined symbol + with XCOFF_DEF_DYNAMIC set is really defined. + (xcoff_link_check_dynamic_ar_symbols): Likewise. + (xcoff_link_add_symbols): Only create special sections if using an + XCOFF hash table. + + * reloc.c (bfd_perform_relocation): Handle xcoff-powermac like + aixcoff-rs6000. + (bfd_install_relocation): Likewise. + +Fri Jun 28 11:17:00 1996 Richard Henderson + + * elf64-alpha.c (struct alpha_elf_link_hash_entry): Add flags + field. + (ALPHA_ELF_LINK_HASH_LU_ADDR): Define. + (ALPHA_ELF_LINK_HASH_LU_MEM): Define. + (ALPHA_ELF_LINK_HASH_LU_FUNC): Define. + (elf64_alpha_link_hash_newfunc): Initialize flags field. + (elf64_alpha_check_relocs): Record types of LITUSE entries that + are found for LITERAL relocs. + (elf64_alpha_adjust_dynamic_symbol): If a symbol has its address + taken, we cannot generate a .plt entry for the symbol. + +Thu Jun 27 11:24:29 1996 Ian Lance Taylor + + * configure.in: Add AC_ISC_POSIX, and check for setitimer and + sysconf functions (for gprof). + * configure, config.in: Rebuild. + +Wed Jun 26 16:29:02 1996 Ian Lance Taylor + + * ecoff.c (_bfd_ecoff_archive_p): Check the first object file in + an archive if it has a map. If the object file has the wrong + xvec, reject it. + + * coff-alpha.c (alpha_adjust_reloc_in): Set the addend for a + BRADDR, SREL16, SREL32, or SREL64 reloc against an external + symbol. + (alpha_relocate_section): Likewise. + + * coffswap.h (coff_swap_reloc_out): Use RELSZ, not sizeof. + (coff_swap_filehdr_out): Use FILHSZ, not sizeof. + (coff_swap_sym_out): Use SYMESZ, not sizeof. + (coff_swap_aux_out): Use AUXESZ, not sizeof. + (coff_swap_lineno_out): Use LINESZ, not sizeof. + (coff_swap_aouthdr_out): Use AOUTSZ, not sizeof. + (coff_swap_scnhdr_out): Use SCNHSZ, not sizeof. + * peicode.h: Corresponding changes. + +Tue Jun 25 15:28:34 1996 Michael Meissner + + * elflink.h (elf_create_pointer_linker_section): Comment out code + dealing with making GOT pointers negative of the GOT symbol for + now. + +Tue Jun 25 11:41:24 1996 Richard Henderson + + * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't + increment the .rela.plt size until after we're done creating the + .plt entry. + (elf64_alpha_finish_dynamic_symbol): Change .plt entry to load the + .rela.plt offset directly rather than calculating it. + +Mon Jun 24 17:15:10 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) + + * Makefile.in (bindir, libdir, datadir, mandir, infodir, includedir): + Use autoconf-set values. + * doc/Makefile.in (bindir, libdir, datadir, mandir, infodir, + includedir, INSTALL, INSTALL_PROGRAM, INSTALL_DATA): Use autoconf-set + values. + (docdir): Deleted. + * configure.in (AC_PREREQ): autoconf v2.5 or higher. + * configure: Rebuilt. + +Mon Jun 24 22:50:35 1996 Jeffrey A Law (law@cygnus.com) + + * som.c (som_write_fixups): Fix typo in R_END_TRY for exception + handling code > 1k away. + +Mon Jun 24 18:41:06 1996 Michael Meissner + + * elflink.h (elf_create_pointer_linker_section): If DEBUG is + defined, output whenever the symbol is updated. + +Mon Jun 24 17:58:12 1996 Jouke Numan + + * elf.c (elf_fake_sections): Don't set sh_addr of a non SEC_ALLOC + section to 0 if user_set_vma is set. + * elflink.h (elf_bfd_final_link): Likewise. + +Sun Jun 23 20:42:51 1996 Doug Evans + + Partially undo patch of Jun 20. + * coffcode.h (coff_set_alignment_hook): Use COFF_IMAGE_WITH_PE. + (coff_compute_section_file_positions): Likewise. + (coff_write_object_contents): Likewise. Re-add deleted code, but + use #ifdef COFF_WITH_PE, not COFF_OBJ_WITH_PE. + * peicode.h (pe_bfd_copy_private_bfd_data): Re-add #ifdef. + +Fri Jun 21 17:38:15 1996 Joel Sherrill + + * config.bfd: Add support for *-*-rtems* configurations. + +Fri Jun 21 15:19:59 1996 Ian Lance Taylor + + * elf.c (prep_headers): Add bfd_arch_alpha case. + +Fri Jun 21 12:35:27 1996 Richard Henderson + + * elf64-alpha.c: New file. + * config.bfd (alpha-*-linuxecoff*): New target. + (alpha-*-linux*, alpha-*-elf*): New targets. + * configure.in (bfd_elf64_alpha_vec): New vector. + * configure: Rebuild. + * targets.c (bfd_elf64_alpha_vec): Declare. + (bfd_target_vector): Add bfd_elf64_alpha_vec if BFD64. + * reloc.c (BFD_RELOC_ALPHA_GPDISP): Define. + * bfd-in2.h, libbfd.h: Rebuild. + * Makefile.in: Rebuild dependencies. + (BFD64_BACKENDS): Add elf64-alpha.o. + (BFD64_BACKENDS_CFILES): Add elf64-alpha.c. + +Thu Jun 20 18:14:25 1996 Ian Lance Taylor + + * ecoff.c (ecoff_armap_hash): If hlog is 0, just return 0, rather + than relying on a right shift of 32. + +Thu Jun 20 11:00:57 1996 Doug Evans + + * coffcode.h (coff_set_alignment_hook): Change COFF_IMAGE_WITH_PE + ifdef to COFF_WITH_PE. + (coff_compute_section_file_positions): Likewise. + (coff_write_object_contents): Likewise. Delete COFF_OBJ_WITH_PE. + * pe-{arm,i386,ppc}.c (COFF_OBJ_WITH_PE): Delete. + * peicode.h (pe_bfd_copy_private_bfd_data): Delete ifdef + COFF_IMAGE_WITH_PE, always include. + + * peicode.h (coff_swap_scnhdr_out): ".drectve" doesn't have trailing 0. + +Wed Jun 19 11:37:52 1996 Ian Lance Taylor + + * elf.c (map_sections_to_segments): Fix up the test for -Ttext to + approximate the correct answer if SIZEOF_HEADERS was not used. + + * binary.c (binary_set_section_contents): Set section file + position based on LMA rather than VMA. + +Wed Jun 19 11:19:25 1996 Manfred Hollstein KS/EIC5 60/3/142 #40283 + + * linker.c (_bfd_generic_link_output_symbols): Don't output any + symbols if info->strip == strip_all. + +Tue Jun 18 15:17:36 1996 Jeffrey A. Law + + * coff-h8300.c: Remove #if 0 code. + (compatable): Don't allow mixing/matching of different architectures. + + * archures.c (bfd_mach_h8300s): Add. + * bfd-in2.h: Rebuilt. + * coff-h8300.c (funcvec_hash_newfunc): Handle H8/S too. + (BADMAG): Likewise. + (h8300_reloc16_estimate): Likewise. + (h8300_reloc16_extra_cases): Likewise. + (h8300_bfd_link_add_symbols): Likewise. + * coffcode.h (coff_set_arch_mach_hook): Likewise. + (coff_set_flags): Likewise. + * cpu-h8300.c (h8300_scan): Likewise. + Add H8/S to bfd_h8300_arch list. + +Tue Jun 18 14:42:58 1996 Klaus Kaempf + + Added support for Alpha OpenVMS: + * evax.h, evax-alpha.c, evax-egsd.c, evax-emh.c: New files. + * evax-etir.c, evax-misc.c, hosts/alphavms.h: New files. + * config.h-vms, makefile.vms: New files. + * config.bfd (alpha-*-*vms*): New target. + * configure.in (evax_alpha_vec): New target vector. + * configure: Rebuild. + * reloc.c (BFD_RELOC_SWREL32, BFD_RELOC_SWREL64): Define. + (BFD_RELOC_ALPHA_LINKAGE, BFD_RELOC_ALPHA_BASEREG): Define. + * targets.c (bfd_target_evax_flavour): Define. + (evax_alpha_vec): Declare. + (bfd_target_vector): Add ecoffalpha_little_vec and evax_alpha_vec + if BFD64 is defined. + * bfd-in2.h, libbfd.h: Rebuild. + * Makefile.in: Rebuild dependencies. + (BFD64_BACKENDS): Add evax-alpha.o, evax-egsd.o, evax-etir.o, + evax-emh.o, and evax-misc.o. + (BFD64_BACKENDS_CFILES): Add evax-alpha.c, evax-egsd.c, + evax-etir.c, evax-emh.c, and evax-misc.c. + (HFILES): Add evax.h. + +Tue Jun 18 13:54:18 1996 Ian Lance Taylor + + * coff-h8300.c (h8300_reloc16_extra_cases): Make name a const + pointer. + (h8300_bfd_link_add_symbols): Likewise. + +Mon Jun 17 10:06:50 1996 Jeffrey A. Law + + * som.h (R_HPPA_BEGIN_TRY, R_HPPA_END_TRY): Define. + * som.c (som_write_fixups): Handle R_BEGIN_TRY and R_END_TRY. + +Mon Jun 17 12:49:11 1996 Ian Lance Taylor + + * elf32-mips.c (mips_elf_relocate_section): Don't create a reloc + for R_MIPS_REL32 and R_MIPS_32 relocs if no dynamic sections were + created. + (mips_elf_check_relocs): Only create .rel.dyn for R_MIPS_REL32 and + R_MIPS_32 relocs if creating a shared library. + +Thu Jun 13 20:14:51 1996 Doug Evans + + * peicode.h (add_data_entry): Use pei_section_data rather than + _cooked_size. Corresponds to May 13 change in coffcode.h. + +Thu Jun 13 10:23:40 1996 Ian Lance Taylor + + * cofflink.c (_bfd_coff_final_link): Handle long section names. + * coffcode.h (coff_write_object_contents): If there are long + section names, always set the f_symptr field, even if there are no + symbols. + * peicode.h (coff_swap_filehdr_in): Don't clear the f_symptr field + if there are no symbols. + + * coffgen.c (make_a_section_from_file): Check return value of + _bfd_coff_read_string_table. + (coff_real_object_p): Check return value of + make_a_section_from_file. + (_bfd_coff_read_string_table): Check that there are some symbols + before trying to read the string table size. + +Wed Jun 12 11:16:37 1996 Ian Lance Taylor + + * xcofflink.c (xcoff_link_add_symbols): When considering whether + to replace a symbol in a dynamic object with a symbol from another + dynamic object, do the replacement if the existing symbol is + global linkage code. + + * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Check explicitly + for _ptrgl, and treat it as global linkage code. + + * aoutx.h (NAME(aout,find_nearest_line)): Notice if we find a + filename or N_SO symbol past the offset, and use it to indicate + that there is no line number or function when appropriate. + +Tue Jun 11 15:24:48 1996 Ian Lance Taylor + + * xcofflink.c (xcoff_build_ldsyms): Set XCOFF_DEF_REGULAR for a + common symbol defined by the linker. Don't export function code + even if export_defineds is set. + +Mon Jun 10 11:57:27 1996 Jeffrey A Law (law@cygnus.com) + + * coff-h8300.c (howto_table): Add new entries for R_BCC_INV + and R_JMP_DEL. + (rtype2howto): Handle R_BCC_INV and R_JMP_DEL. + (h8300_symbol_address_p): New function. + (h8300_reloc16_estimate): Eliminate jumps made unnecessary by + relaxing. + +Sun Jun 9 16:30:20 1996 Jeffrey A Law (law@cygnus.com) + + * coff-h8300.c (h8300_reloc16_estimate): Fix many minor spacing + problems. + (h8300_reloc16_estimate, cases R_JMP1, R_JMP2): Adjust "dot" + correctly for the two variants. Allow relaxing if the target + is 128 bytes away since after relaxation it'll be 126 bytes away. + (h8300_reloc16_estimate, case R_PCRWORD): Correctly adjust + "dot" and "value". Allow relaxing if the target is 128 bytes + away since after relaxation it'll be 126 bytes away. + * reloc16.c (bfd_coff_reloc16_relax_section): Keep relaxing + the given section until nothing changes. + +Thu Jun 6 15:24:45 1996 Richard Henderson + + * ecoff.c (_bfd_ecoff_new_section_hook): Remove the _PDATA + alignment hack--we can get the lnnoptr info another way without + suddenly increasing the alignment requirements. Set the flags for + the _PDATA section. + (ecoff_compute_section_file_positions): Do so. + +Thu Jun 6 11:24:37 1996 Ian Lance Taylor + + * ieee.c (ieee_write_object_contents): Put a timestamp in the file + to keep the HP emulator database happy. + + * config.bfd: Recognize powerpc-*-linux* and powerpcle-*-linux*. + From Kevin Buettner . + +Wed Jun 5 15:16:04 1996 Ian Lance Taylor + + * aoutx.h (translate_to_native_sym_flags): Don't try to print the + name of a NULL section. + +Tue Jun 4 18:53:58 1996 Ian Lance Taylor + + * linker.c (_bfd_generic_link_add_one_symbol): If notice_all is + set, always call the notice callback. + + * VERSION: Increment for bfdlink.h change. + +Mon Jun 3 11:01:53 1996 Ian Lance Taylor + + * coff-sh.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): Set to 4. + (sh_relax_delete_bytes): Correct handling of differently sized + trailing alignment reloc. + + * bfd-in.h: Use #error if BFD_HOST_64_BIT can not be defined. + * bfd-in2.h: Rebuild. + * configure.in: Warn if there is no known 64 bit type. + * configure: Rebuild. + + * Makefile.in: Rebuild dependencies. + (BFD32_BACKENDS): Add ppcboot.o. + (BFD32_BACKENDS_CFILES): Add ppcboot.c. + + * elf32-mips.c (mips_elf_size_dynamic_sections): Initialize c. + From Per Fogelstrom . + +Sat Jun 1 21:49:58 1996 Ian Lance Taylor + + * elf64-mips.c (bfd_mips_elf64_swap_reginfo_in) + (bfd_mips_elf64_swap_reginfo_out): Move from here... + * elf32-mips.c (bfd_mips_elf64_swap_reginfo_in) + (bfd_mips_elf64_swap_reginfo_out): ...to here. + +Fri May 31 13:51:28 1996 Ian Lance Taylor + + * elf64-mips.c: Improve reloc special_functions and handling of + SHT_MIPS_OPTIONS section. + * elf32-mips.c (_bfd_mips_elf_hi16_reloc): Rename from + mips_elf_hi16_reloc and make globally visible. + (_bfd_mips_elf_lo16_reloc): Rename from mips_elf_lo16_reloc and + make globally visible. + (_bfd_mips_elf_got16_reloc): Rename from mips_elf_got16_reloc and + make globally visible. + (_bfd_mips_elf_gprel16_reloc): Rename from mips_elf_gprel16_reloc + and make globally visible. + (gprel16_with_gp): Check howto->src_mask before using value in + insn. + (_bfd_mips_elf_gprel32_reloc): Rename from mips_elf_gprel32_reloc + and make globally visible. + (gprel32_with_gp): Check howto->src_mask before fetching value. + (bfd_mips_elf_swap_options_in): New function. + (bfd_mips_elf_swap_options_out): New function. + (_bfd_mips_elf_set_private_flags): Rename from + mips_elf_set_private_flags and make globally visible. + (_bfd_mips_elf_copy_private_bfd_data): Rename from + mips_elf_copy_private_bfd_data and make globally visible. + (_bfd_mips_elf_merge_private_bfd_data): Rename from + mips_elf_merge_private_bfd_data and make globally visible. + (_bfd_mips_elf_section_from_shdr): Accept .MIPS.options as a name + for a SHT_MIPS_OPTIONS section. + (mips_elf32_section_from_shdr): Handle SHT_MIPS_OPTIONS section. + (_bfd_mips_elf_fake_sections): Consider .MIPS.options to be the + name of a SHT_MIPS_OPTIONS section. + (_bfd_mips_elf_set_section_contents): New function. + (mips_elf32_section_processing): Set the GP value in a + SHT_MIPS_OPTIONS section. + (_bfd_mips_elf_find_nearest_line): Rename from + mips_elf_find_nearest_line and make globally visible. + (bfd_elf32_set_section_contents): Define. + * elf-bfd.h (_bfd_mips_elf_hi16_reloc): Declare. + (_bfd_mips_elf_lo16_reloc): Declare. + (_bfd_mips_elf_gprel16_reloc): Declare. + (_bfd_mips_elf_got16_reloc): Declare. + (_bfd_mips_elf_gprel32_reloc): Declare. + (_bfd_mips_elf_set_private_flags): Declare. + (_bfd_mips_elf_copy_private_bfd_data): Declare. + (_bfd_mips_elf_merge_private_bfd_data): Declare. + (_bfd_mips_elf_find_nearest_line): Declare. + (_bfd_mips_elf_set_section_contents): Declare. + + * elf32-hppa.c (elf32_hppa_info_to_howto): Rename from + elf_info_to_howto. + (elf_info_to_howto): Define. + * elf32-sparc.c (elf32_sparc_info_to_howto): Rename from + elf_info_to_howto. + (elf_info_to_howto): Define. + * elf64-sparc.c (sparc64_elf_info_to_howto): Rename from + elf_info_to_howto. + (elf_info_to_howto): Define. + + * coff-w65.c (h8300_reloc16_estimate): Rename R_MOVB[12] to + R_MOV16B[12], to match change in coff/internal.h. + +Thu May 30 12:38:49 1996 Ian Lance Taylor + + * elf64-mips.c: Extensive additions to provide better support for + writing files and for gas. + * elf32-mips.c (_bfd_mips_elf_object_p): New function, broken out + of mips_elf_object_p. + (mips_elf32_object_p): Rename from mips_elf_object_p; call + _bfd_mips_elf_object_p. + (_bfd_mips_elf_final_write_processing): Rename from + mips_elf_final_write_processing and make globally visible. + (_bfd_mips_elf_fake_sections): Rename from + mips_elf_fake_sections and make globally visible. + (_bfd_mips_elf_section_from_bfd_section): Rename from + mips_elf_section_from_bfd_section and make globally visible. + (_bfd_mips_elf_section_processing): New function, broken out of + mips_elf_section_processing. + (mips_elf32_section_processing): Rename from + mips_elf_section_processing; call + _bfd_mips_elf_section_processing. + (_bfd_mips_elf_symbol_processing): Rename from + mips_elf_symbol_processing and make globally visible. + (_bfd_mips_elf_read_ecoff_info): Rename from + mips_elf_read_ecoff_info and make globally visible. + (mips_elf32_ecoff_debug_swap): Rename from + mips_elf_ecoff_debug_swap. + * elf.c (_bfd_elf_symbol_from_bfd_symbol): Use asymbol rather than + struct symbol_cache_entry. + (_bfd_elf_validate_reloc): New function, moved in from + elfcode.h:validate_reloc. + * elfcode.h (validate_reloc): Remove; moved into elf.c and renamed + to _bfd_elf_validate_reloc. Change all callers. + * elf-bfd.h (bfd_section_from_shdr): Declare. + (_bfd_elf_symbol_from_bfd_symbol): Declare. + (_bfd_elf_validate_reloc): Declare. + (_bfd_mips_elf_object_p): Declare. + (_bfd_mips_elf_fake_sections): Declare. + (_bfd_mips_elf_section_from_bfd_section): Declare. + (_bfd_mips_elf_section_processing): Declare. + (_bfd_mips_elf_symbol_processing): Declare. + (_bfd_mips_elf_read_ecoff_info): Declare. + (_bfd_mips_elf_final_write_processing): Declare. + * elfxx-target.h (bfd_elfNN_get_reloc_upper_bound): Don't define + if already defined. + + * elf32-mips.c (mips_elf_object_p): Handle E_MIPS_ARCH_4. + (mips_elf_final_write_processing): Likewise. + +Wed May 29 16:15:29 1996 Ian Lance Taylor + + 64-bit MIPS ELF ABI objdump support: + * elf64-mips.c: New file. + * Makefile.in: Rebuild dependencies. + (BFD64_BACKENDS): Add elf64-mips.o. + (BFD64_BACKENDS_CFILES): Add elf64-mips.c. + * config.bfd (mips*el-*-elf*) Add bfd_elf64_bigmips_vec and + bfd_elf64_littlemips_vec to targ_selvecs. + (mips*-*-elf*): Likewise. + * configure.in: Add bfd_elf64_bigmips_vec and + bfd_elf64_littlemips_vec to vector switch. + * configure: Rebuild. + * elf32-mips.c (_bfd_mips_elf_section_from_shdr): New function, + broken out of mips_elf_section_from_shdr. + (mips_elf32_section_from_shdr): Rename from + mips_elf_section_from_shdr. Call new function. + (elf_backend_section_from_shdr): Update name of renamed function. + * elf-bfd.h (struct elf_size_info): Change second parameter of + write_out_phdrs to be const. Likewise for second parameter of + swap_symbol_out. + (struct bfd_elf_section_data): Add rel_hdr2 field. + (bfd_elf32_swap_symbol_in): Change second parameter to be const. + (bfd_elf32_swap_symbol_out): Likewise. + (bfd_elf32_swap_reloc_in): Likewise. + (bfd_elf32_swap_reloc_out): Likewise. + (bfd_elf32_swap_reloca_in): Likewise. + (bfd_elf32_swap_reloca_out): Likewise. + (bfd_elf32_swap_phdr_in): Likewise. + (bfd_elf32_swap_phdr_out): Likewise. + (bfd_elf32_swap_dyn_in): Likewise. + (bfd_elf32_swap_dyn_out): Likewise. + (bfd_elf32_slurp_symbol_table): Declare. + (bfd_elf32_write_shdrs_and_ehdr): Declare. + (bfd_elf32_write_out_phdrs): Declare. + (bfd_elf64_swap_symbol_in): Change second parameter to be const. + (bfd_elf64_swap_symbol_out): Likewise. + (bfd_elf64_swap_reloc_in): Likewise. + (bfd_elf64_swap_reloc_out): Likewise. + (bfd_elf64_swap_reloca_in): Likewise. + (bfd_elf64_swap_reloca_out): Likewise. + (bfd_elf64_swap_phdr_in): Likewise. + (bfd_elf64_swap_phdr_out): Likewise. + (bfd_elf64_swap_dyn_in): Likewise. + (bfd_elf64_swap_dyn_out): Likewise. + (bfd_elf64_slurp_symbol_table): Declare. + (bfd_elf64_write_shdrs_and_ehdr): Declare. + (bfd_elf64_write_out_phdrs): Declare. + (_bfd_mips_elf_section_from_shdr): Declare. + * elf.c (bfd_section_from_shdr): Remove assertion requiring + SHT_REL/SHT_RELA to match use_rela_p. If there is already a reloc + section for the section, add the new one to rel_hdr2. Increment + reloc_count rather than setting it. + * elfcode.h (elf_slurp_symbol_table): Define name as macro. + Remove static declaration. + (elf_write_shdrs_and_ehdr): Define name as macro. + (elf_write_out_phdrs): Likewise. + (elf_swap_ehdr_in, elf_swap_ehdr_out): Declare. + (elf_swap_shdr_in, elf_swap_shdr_out): Declare. + (elf_swap_symbol_in): Change second parameter to be const. + (elf_swap_symbol_out): Likewise. + (elf_swap_ehdr_in, elf_swap_ehdr_out): Likewise. + (elf_swap_shdr_in, elf_swap_shdr_out): Likewise. + (elf_swap_phdr_in, elf_swap_phdr_out): Likewise. + (elf_swap_reloc_in, elf_swap_reloc_out): Likewise. + (elf_swap_reloca_in, elf_swap_reloca_out): Likewise. + (elf_write_out_phdrs): Rename from write_out_phdrs. Change second + parameter to be const. Make non-static. + (elf_write_shdrs_and_ehdr): Rename from write_shdrs_and_ehdr. + Make non-static. + (elf_slurp_symbol_table): Make non-static. + (NAME(_bfd_elf,size_info)): Update names of renamed functions. + * elfxx-target.h (elf_info_to_howto): Define if not defined. + (elf_backend_size_info): Likewise. + (elfNN_bed): Use elf_backend_size_info. + * targets.c (bfd_elf64_bigmips_vec): Declare. + (bfd_elf64_littlemips_vec): Declare. + (bfd_target_vector): Add bfd_elf64_bigmips_vec and + bfd_elf64_littlemips_vec if BFD64 is defined. + + * libbfd.c (bfd_get_file_window): Add cast to fprintf argument. + +Tue May 28 11:42:08 1996 Ian Lance Taylor + + * coff-sh.c (sh_relax_delete_bytes): Insert nop instructions, not + zeroes, in alignment holes. + + * configure: Rebuild with autoconf 2.10. + + * aoutx.h (NAME(aout,find_nearest_line)): Make room for the + potential leading underscore in the allocated buffer. + +Fri May 24 14:28:38 1996 Michael Meissner + + * elf32-ppc.c (ppc_elf_add_symbol_hook): Do not put small common + symbols into .sbss if this is a relocatable link. + +Thu May 23 12:26:24 1996 Ian Lance Taylor + + * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Warn about + undefined symbols when creating a shared library. + +Fri May 17 13:54:15 1996 Ian Lance Taylor + + * coff-sh.c: Add a bunch of new code and static const arrays to + support aligning loads and stores on four byte memory boundaries. + Also: + (sh_coff_howtos): Add entries for R_SH_CODE, R_SH_DATA and + R_SH_LABEL. + (sh_relax_section): Look for R_SH_CODE relocs. If we find one, + call sh_align_loads. + (sh_relax_delete_bytes): Don't mark R_SH_CODE or R_SH_DATA relocs + as unused. + +Thu May 16 16:34:13 1996 Ian Lance Taylor + + * cache.c (bfd_open_file): Unlink the file before opening it for + write. From Marty Leisner . + + * opncls.c (bfd_fdopenr): Set opened_once. + +Tue May 14 12:35:32 1996 Ian Lance Taylor + + * som.c (som_slurp_reloc_table): Clear external_relocs cache after + freeing it. + + * libbfd.c: Remove #ifdef FILE_OFFSET_IS_CHAR_INDEX, and compile + the code unconditionally. + +Mon May 13 19:51:37 1996 Ian Lance Taylor + + * libcoff-in.h (struct pei_section_tdata): Define structure. + (pei_section_data): Define macro. + * libcoff.h: Rebuild. + * coffcode.h (coff_set_alignment_hook): If COFF_IMAGE_WITH_PE, + store s_paddr field in pei_section_data. + (coff_compute_section_file_positions): Use pei_section_data rather + than _cooked_size, and don't overwrite an existing value. + (coff_write_object_contents): If COFF_OBJ_WITH_PE, set s_paddr to + 0. If COFF_IMAGE_WITH_PE, set s_paddr to pei_section_data. + * peicode.h (coff_bfd_copy_private_section_data): Define if + COFF_IMAGE_WITH_PE. + (pe_bfd_copy_private_section_data): New static function if + COFF_IMAGE_WITH_PE. + +Wed May 8 16:10:38 1996 Ian Lance Taylor + + * srec.c (srec_set_arch_mach): Write as a function rather than a + macro definition. + + * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): If an archive has + no map, just check each member in turn to see whether it is + required. + +Wed May 8 09:17:34 1996 Michael Meissner + + * ppcboot.c (ppcboot_object_p): Check for type 0x41 in partition + table. Call BFD_ASSERT to validate header size, instead of + calling fatal. + (ppcboot_bfd_print_private_bfd_data): Put quotes around partition + name. + +Tue May 7 16:10:19 1996 Michael Meissner + + * ppcboot.c: New target for looking at PPCbug boot records. + + * config{ure.in,.bfd}: Add support for ppcboot target. + * targets.c: Ditto. + * configure: Regenerate. + +Tue May 7 11:15:19 1996 Jeffrey A Law (law@cygnus.com) + + * coff-h8300.c (howto_table): Update names to match recent + changes to include/coff/internal.h. Fix minor errors in the + existing relocs. Add R_MOVL1 and R_MOVL2. + (rtype2howto): Similarly. + (h8300_reloc16_estimate): Rewrite to simplify, fix bugs in the + existing relaxing code and peform more relaxing. + (h8300_reloc16_extra_cases): Likewise. + +Mon May 6 18:24:09 1996 Jeffrey A Law (law@cygnus.com) + + * reloc16.c (bfd_coff_reloc16_get_value): Handle common + symbols correctly. + +Sat May 4 05:08:45 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * elfcode.h (elf_object_p): Reject generic ELF target if + e_machine matches an alternate machine code in a specific backend. + + * netbsd-core.c (netbsd_core_vec): Remove initializer for + obsolete align_power_min field. + +Fri May 3 13:07:35 1996 Jeffrey A Law (law@cygnus.com) + + * coff-h8300.c (reloc_howto_type): Add howto entry for + R_PCRWORD_B. + (rtype2howto): Handle R_PCRWORD_B. + (h8300_reloc16_extra_cases): Handle R_PCRWORD_B. + (h8300_reloc_16_estimate): Likewise. Try to turn a 16bit + pc-relative branch (R_PCRWORD) into an 8bit pc-relative + branch (R_PCWORD_B). + +Fri May 3 10:47:41 1996 Ian Lance Taylor + + * aoutx.h (translate_from_native_sym_flags): Set the section for + BSF_CONSTRUCTOR symbols. + + * cofflink.c (_bfd_coff_link_input_bfd): Correct setting of + last_bf_index. + +Wed May 1 18:39:32 1996 Doug Evans + + * coffcode.h (coff_write_object_contents): In comdat section lookup, + stop looking when section is found. + +Wed May 1 14:17:57 1996 Ian Lance Taylor + + * coffcode.h (STRING_SIZE_SIZE): Define. + (styp_to_sec_flags): Handle long symbol names when looking for the + section symbol. + (bfd_coff_backend_data): Add _bfd_coff_long_section_names field. + (bfd_coff_long_section_names): Define. + (coff_write_object_contents): Handle long section names. + (bfd_coff_std_swap_table): Initialize new field. + * libcoff.h: Rebuild. + * coffgen.c (make_a_section_from_file): Handle long section + names. + (coff_write_symbols): Handle long section names. + * coff-alpha.c (alpha_ecoff_backend_data): Initialize new field. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + * pe-arm.c (COFF_LONG_SECTION_NAMES): Define. + * pei-arm.c (COFF_LONG_SECTION_NAMES): Define. + * pe-i386.c (COFF_LONG_SECTION_NAMES): Define. + * pei-i386.c (COFF_LONG_SECTION_NAMES): Define. + * pe-ppc.c (COFF_LONG_SECTION_NAMES): Define. + * pei-ppc.c (COFF_LONG_SECTION_NAMES): Define. + + * bout.c (b_out_callback): Set lma of sections. + (b_out_bfd_get_relocated_section_contents): Rename in_abfd + parameter to output_bfd. Used input_bfd instead of output_bfd in + several places. + +Tue Apr 30 17:56:39 1996 Ian Lance Taylor + + * aoutx.h (translate_from_native_sym_flags): Don't create + SEC_CONSTRUCTOR sections. + * ecoff.c (ecoff_set_symbol_info): Likewise. + + * elf32-mips.c (mips_elf_copy_private_bfd_data): Copy elf_gp. + From Don Bowman . + +Tue Apr 30 17:06:32 1996 Doug Evans + + * coff-arm.c (armcoff_little_vec): If COFF_WITH_PE is defined, add + SEC_LINK_ONCE and SEC_LINK_DUPLICATES to section_flags. + +Mon Apr 29 13:15:17 1996 Ian Lance Taylor + + * elf32-mips.c (struct mips_elf_link_hash_entry): Add + mips_32_relocs field. + (mips_elf_link_hash_newfunc): Initialize mips_32_relocs field. + (mips_elf_relocate_section): Copy R_MIPS_REL32 and R_MIPS_32 + relocs against a global symbol which is not defined in a regular + file. + (mips_elf_check_relocs): For a R_MIPS_REL32 or R_MIPS_32 reloc + against a global symbol, increment mips_32_relocs. + (mips_elf_adjust_dynamic_symbol): If mips_32_relocs is set, and + the symbol is not defined in a regular file, make room in the + .rel.dyn section. + +Fri Apr 26 18:00:37 1996 Ian Lance Taylor + + * ecoff.c (ecoff_compute_section_file_positions): Track the real + file position and the virtual file position separately. Set + filepos information bsaed on the real file position. + (_bfd_ecoff_set_section_contents): Handle .lib sections like the + Jan 23 change to coffcode.h. + + * som.c (som_slurp_symbol_table): Set the symbol count to the + number of BFD symbols created. + +Fri Apr 26 12:34:29 1996 Michael Meissner + + * elf32-ppc.c (ppc_elf_check_relocs): Forward relocations to the + output file if linking shared objects. Loop to check all relocs, + rather than returning false on first error. + +Thu Apr 25 13:25:12 1996 Michael Meissner + + * elf32-ppc.c (ppc_elf_create_linker_section): Add PLT case. + (ppc_elf_additional_program_headers): If .interp section, bump # + of program headers by 1. + (ppc_elf_adjust_dynamic_symbol): Flesh out support. + (ppc_elf_size_dynamic_sections): Add support for .plt section. + (ppc_elf_check_relocs): Print out filename in debug code. Enable + PLT support. + (ppc_elf_finish_dynamic_symbol): Add support for PLT's, beef up + debug output. + (ppc_elf_relocate_section): If the output section isn't defined, + don't abort, just give an error message. + + * elflink.c (_bfd_elf_create_dynamic_sections): If the section + being created is .sdata or .sdata2, don't make the symbol dynamic. + +Wed Apr 24 14:04:07 1996 Ian Lance Taylor + + * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Look through the + members of an archive for dynamic objects with no symbols, and + pass them directly to check_archive_element. + (xcoff_link_check_ar_symbols): Pass dynamic objects to + xcoff_link_check_dynamic_ar_symbols. + (xcoff_link_check_dynamic_ar_symbols): New static function. + + * coff-rs6000.c (rs6000coff_vec): Change BFD_JUMP_TABLE_DYNAMIC + from _bfd_nodynamic to _bfd_xcoff. + * libcoff-in.h (_bfd_xcoff_get_dynamic_symtab_upper_bound): + Declare. + (_bfd_xcoff_canonicalize_dynamic_symtab): Declare. + (_bfd_xcoff_get_dynamic_reloc_upper_bound): Declare. + (_bfd_xcoff_canonicalize_dynamic_reloc): Declare. + * libcoff.h: Rebuild. + * xcofflink.c (xcoff_swap_ldrel_in): New static function. + (xcoff_get_section_contents): New static function. + (_bfd_xcoff_get_dynamic_symtab_upper_bound): New function. + (_bfd_xcoff_canonicalize_dynamic_symtab): New function. + (_bfd_xcoff_get_dynamic_reloc_upper_bound): New function. + (xcoff_dynamic_reloc): New static variable. + (_bfd_xcoff_canonicalize_dynamic_reloc): New function. + (xcoff_link_add_dynamic_symbols): Use xcoff_get_section_contents. + +Tue Apr 23 12:48:42 1996 Ian Lance Taylor + + * coff-sparc.c (bfd_coff_generic_reloc): Return bfd_reloc_ok even + if reloc_entry->addend is not 0. + (CALC_ADDEND): Just set the addend to reloc.r_offset. + +Mon Apr 22 18:29:01 1996 Doug Evans + + * elf32-sparc.c (_bfd_sparc_elf_howto_table): Fix spelling of + R_SPARC_GLOB_JMP. + * elf64-sparc.c (sparc64_elf_howto_table): Likewise. + Add entries for R_SPARC_[56]. + (sparc_reloc_map): Add entries for R_SPARC_[56]. + +Mon Apr 22 15:07:24 1996 Ian Lance Taylor + + Optimize linking of stabs in sections as used in ELF and COFF. + * stabs.c: New file. + * libbfd-in.h (_bfd_link_section_stabs): Declare. + (_bfd_write_section_stabs): Declare. + (_bfd_write_stab_strings): Declare. + * libbfd.h: Rebuild. + * libcoff-in.h (struct coff_section_tdata): Add stab_info field. + (struct coff_link_hash_table): Add stab_info field. + * libcoff.h: Rebuild. + * cofflink.c (_bfd_coff_link_hash_table_init): Initialize + stab_info field. + (coff_link_add_symbols): Call _bfd_link_section_stabs if + appropriate. + (_bfd_coff_final_link): Write out stab strings hash table. + (_bfd_coff_link_input_bfd): Handle optimized stabs sections. + * coff-ppc.c (ppc_bfd_coff_final_link): Write out stab strings + hash table. + * elf-bfd.h (struct elf_link_hash_table): Add stab_info field. + (struct bfd_elf_section_data): Add stab_info field. + * elf.c (_bfd_elf_link_hash_table_init): Initialize stab_info + field. + * elflink.h (elf_link_add_object_symbols): If appropriate, call + _bfd_link_section_stabs. + (elf_bfd_final_link): Write out stab strings hash table. + (elf_link_input_bfd): Handle optimized stabs sections. + * reloc.c (_bfd_final_link_relocate): Check address against + _raw_size rather than _cooked_size. + * Makefile.in: Rebuild dependencies. + (BFD_LIBS): Add stabs.o + (BFD_LIBS_CFILES): Add stabs.c. + + * VERSION: Increment for bfdlink.h change. + + * coffgen.c (coff_renumber_symbols): Correct handling of + BSF_NOT_AT_END common symbols. + +Fri Apr 19 19:21:56 1996 Ian Lance Taylor + + * coff-ppc.c (record_toc): Add cast to avoid warning. + (ppc_allocate_toc_section): Likewise. + (coff_ppc_relocate_section): Remove ANSI C string concatenation. + (ppc_coff_reloc_type_lookup): Remove unreached code. + * coffcode.h (coff_write_object_contents): Don't take the address + of an array. + * peicode.h (pe_print_idata): Add casts to avoid warning. + (pe_print_edata): Likewise. + (pe_print_reloc): Remove ANSI C string concatenation. + +Thu Apr 18 18:51:18 1996 Ian Lance Taylor + + * libcoff-in.h (struct coff_final_link_info): Add last_bf_index + and last_bf fields. + * libcoff.h: Rebuild. + * coffswap.h (coff_swap_aux_in): Swap endndx field for C_FCN + symbols. + (coff_swap_aux_out): Likewise. + * peicode.h (coff_swap_aux_in): Likewise. + (coff_swap_aux_out): Likewise. + * coffgen.c (coff_pointerize_aux): Check endndx field for C_FCN + symbols. + * cofflink.c (_bfd_coff_final_link): Initialize last_bf_index + field. + (_bfd_coff_link_input_bfd): Check endndx field for C_FCN symbols. + Fix up .bf endndx link fields. + * coff-ppc.c (ppc_bfd_coff_final_link): Initialize last_bf_index + field. + * xcofflink.c (xcoff_link_input_bfd): Check endndx field for C_FCN + symbols. + +Wed Apr 17 12:08:24 1996 Michael Meissner + + * pe{,i}-ppc.c (PPC_PE): Define instead of PPC, so that compiling + on Solaris PowerPC systems doesn't get confused. + + * coffcode.h (coff_write_object_contents): Use #ifdef PPC_PE, not + #ifdef PPC. + + * elfcore.h (bfd_prstatus, bfd_fpregset): Add thread argument. + (elf_corefile_note): If HAVE_SYS_PROCFS_H is not defined, don't + update did_reg and did_reg2. + +Wed Apr 17 13:07:37 1996 Ian Lance Taylor + + * xcofflink.c (xcoff_link_input_bfd): Check for TOC overflow. + + * linker.c (_bfd_generic_link_add_one_symbol): When calling the + callback routines, pass h->root.string rather than name, in case + copy is true and name is transient. + +Tue Apr 16 16:36:38 1996 Stu Grossman (grossman@lisa.cygnus.com) + + * elfcore.h: Add support for core files with multiple threads. + (Primarily for Solaris.) + +Tue Apr 16 13:44:08 1996 Ian Lance Taylor + + * aoutx.h (NAME(aout,squirt_out_relocs)): Don't do anything if + section->orelocation is NULL. + + * coffgen.c (bfd_coff_get_syment): New function. + (bfd_coff_get_auxent): New function. + * bfd-in.h (bfd_coff_get_syment): Declare. + (bfd_coff_get_auxent): Declare. + * bfd-in2.h: Rebuild. + +Mon Apr 15 19:06:59 1996 Ian Lance Taylor + + * elf32-mips.c (struct mips_hi16): Define. + (mips_hi16_addr, mips_hi16_addend): Remove. + (mips_hi16_list): New static variable. + (mips_elf_hi16_reloc): Maintain a list of unmatched HI16 relocs. + (mips_elf_lo16_reloc): Process mips_hi16_list. + (mips_elf_relocate_section): Permit an arbitrary number of HI16 + relocs before the associated LO16 reloc. + +Wed Apr 10 00:23:53 1996 Ian Lance Taylor + + * versados.c (versados_scan): Check bfd_alloc return value. + (versados_object_p): Check all bfd_read return values. Require + that lang field be less than 10, to avoid confusion with Intel Hex + files. + + * libaout.h (WRITE_HEADERS): Write out the relocs even if there + aren't any symbols. + * aoutx.h (NAME(aout,swap_std_reloc_out)): Set r_index to N_ABS, + not 0, for an absolute symbol. + (NAME(aout,swap_ext_reloc_out)): Likewise. + + * ihex.c (ihex_scan): Accept a length of 4 for record type 5. + (ihex_write_object_contents): For a large start address, output + the full 32 bit address in record type 5. + + * ieee.c (ieee_write_byte): Change second parameter from bfd_byte + to int to avoid promotion problems in prototype. + +Tue Apr 9 11:44:21 1996 Ian Lance Taylor + + * configure.host: Use ${srcdir} when looking for picfrag. + + * configure.host: Switch on ${libdir}, not $(libdir). From + alan@spri.levels.unisa.edu.au (Alan Modra). + + * aoutx.h (aout_link_add_symbols): Always call add_dynamic_symbols + entry point, not just for DYNAMIC objects. + * sunos.c (sunos_add_dynamic_symbols): Always call + sunos_create_dynamic_sections. If called with a non DYNAMIC + object, don't do anything else. + (sunos_add_one_symbol): Don't call sunos_create_dynamic_sections. + +Mon Apr 8 12:09:36 1996 Ian Lance Taylor + + * configure.in: Permit --enable-shared to specify a list of + directories. + * configure: Rebuild. + + * configure.host: Set HLDFLAGS and SHLIB_CFLAGS for *-dec-osf* + host when configuring with --enable-shard. + +Fri Apr 5 12:24:13 1996 Ian Lance Taylor + + * config.bfd: Add i[345]86-*-freebsdelf* target; from John Polstra + . + + * linker.c (link_action): For WARN_ROW/warn, use MWARN, not CYCLE, + to avoid crashing in bfd_hash_replace. + + * sysdep.h: Use #ifdef, not #if. + +Thu Apr 4 23:32:23 1996 Ian Lance Taylor + + * config.in: Rebuild. + +Thu Apr 4 18:49:09 1996 Fred Fish + + * configure.in (mips-sony-bsd*): Fix typo in AC_DEFINE. + (AC_CHECK_HEADERS): Check for sys/time.h + (AC_HEADER_TIME): Add macro. + * configure: Rebuild. + * sysdep.h: Use TIME_WITH_SYS_TIME and HAVE_SYS_TIME_H + to control what combination of